Gutenberg - Version 13.7.0

Version Description

Download this release

Release Info

Developer gutenbergplugin
Plugin Icon 128x128 Gutenberg
Version 13.7.0
Comparing to
See all releases

Code changes from version 13.6.0 to 13.7.0

build/block-editor/index.js CHANGED
@@ -2219,6 +2219,7 @@ __webpack_require__.d(__webpack_exports__, {
2219
  "__experimentalGetBorderClassesAndStyles": () => (/* reexport */ getBorderClassesAndStyles),
2220
  "__experimentalGetColorClassesAndStyles": () => (/* reexport */ getColorClassesAndStyles),
2221
  "__experimentalGetElementClassName": () => (/* reexport */ __experimentalGetElementClassName),
 
2222
  "__experimentalGetGradientClass": () => (/* reexport */ __experimentalGetGradientClass),
2223
  "__experimentalGetGradientObjectByGradientValue": () => (/* reexport */ __experimentalGetGradientObjectByGradientValue),
2224
  "__experimentalGetMatchingVariation": () => (/* reexport */ __experimentalGetMatchingVariation),
@@ -2793,6 +2794,8 @@ function moveTo(array, from, to) {
2793
 
2794
 
2795
 
 
 
2796
  /**
2797
  * Given an array of blocks, returns an object where each key is a nesting
2798
  * context, the value of which is an array of block client IDs existing within
@@ -2804,6 +2807,7 @@ function moveTo(array, from, to) {
2804
  * @return {Object} Block order map object.
2805
  */
2806
 
 
2807
  function mapBlockOrder(blocks) {
2808
  let rootClientId = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
2809
  const result = {
@@ -2849,7 +2853,7 @@ function mapBlockParents(blocks) {
2849
 
2850
 
2851
  function flattenBlocks(blocks) {
2852
- let transform = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : external_lodash_namespaceObject.identity;
2853
  const result = {};
2854
  const stack = [...blocks];
2855
 
@@ -4346,7 +4350,7 @@ function lastBlockAttributesChange(state, action) {
4346
  /**
4347
  * Reducer returning automatic change state.
4348
  *
4349
- * @param {boolean} state Current state.
4350
  * @param {Object} action Dispatched action.
4351
  *
4352
  * @return {string} Updated state.
@@ -6061,7 +6065,7 @@ function getBlockInsertionPoint(state) {
6061
 
6062
  if (clientId) {
6063
  rootClientId = getBlockRootClientId(state, clientId) || undefined;
6064
- index = getBlockIndex(state, selectionEnd.clientId, rootClientId) + 1;
6065
  } else {
6066
  index = getBlockOrder(state).length;
6067
  }
@@ -6130,7 +6134,7 @@ function getTemplateLock(state, rootClientId) {
6130
  const checkAllowList = function (list, item) {
6131
  let defaultResult = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
6132
 
6133
- if ((0,external_lodash_namespaceObject.isBoolean)(list)) {
6134
  return list;
6135
  }
6136
 
@@ -6835,7 +6839,7 @@ const __experimentalGetDirectInsertBlock = rememo(function (state) {
6835
  }, (state, rootClientId) => [state.blockListSettings[rootClientId], state.blocks.tree[rootClientId]]);
6836
 
6837
  const checkAllowListRecursive = (blocks, allowedBlockTypes) => {
6838
- if ((0,external_lodash_namespaceObject.isBoolean)(allowedBlockTypes)) {
6839
  return allowedBlockTypes;
6840
  }
6841
 
@@ -7290,10 +7294,6 @@ function retrieveSelectedAttribute(blockAttributes) {
7290
  }
7291
 
7292
  ;// CONCATENATED MODULE: ./packages/block-editor/build-module/store/actions.js
7293
- /**
7294
- * External dependencies
7295
- */
7296
-
7297
  /**
7298
  * WordPress dependencies
7299
  */
@@ -7302,13 +7302,14 @@ function retrieveSelectedAttribute(blockAttributes) {
7302
 
7303
 
7304
 
7305
-
7306
  /**
7307
  * Internal dependencies
7308
  */
7309
 
7310
 
7311
 
 
 
7312
  /**
7313
  * Action which will insert a default block insert action if there
7314
  * are no other blocks at the root of the editor. This action should be used
@@ -7316,6 +7317,7 @@ function retrieveSelectedAttribute(blockAttributes) {
7316
  * replacement, etc).
7317
  */
7318
 
 
7319
  const ensureDefaultBlock = () => _ref => {
7320
  let {
7321
  select,
@@ -7465,7 +7467,7 @@ function updateBlockAttributes(clientIds, attributes) {
7465
  let uniqueByBlock = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
7466
  return {
7467
  type: 'UPDATE_BLOCK_ATTRIBUTES',
7468
- clientIds: (0,external_lodash_namespaceObject.castArray)(clientIds),
7469
  attributes,
7470
  uniqueByBlock
7471
  };
@@ -7691,9 +7693,9 @@ const replaceBlocks = function (clientIds, blocks, indexToSelect) {
7691
  } = _ref7;
7692
 
7693
  /* eslint-enable jsdoc/valid-types */
7694
- clientIds = (0,external_lodash_namespaceObject.castArray)(clientIds);
7695
- blocks = getBlocksWithDefaultStylesApplied((0,external_lodash_namespaceObject.castArray)(blocks), select.getSettings());
7696
- const rootClientId = select.getBlockRootClientId((0,external_lodash_namespaceObject.first)(clientIds)); // Replace is valid if the new blocks can be inserted in the root block.
7697
 
7698
  for (let index = 0; index < blocks.length; index++) {
7699
  const block = blocks[index];
@@ -7751,7 +7753,7 @@ const createOnMove = type => (clientIds, rootClientId) => _ref8 => {
7751
 
7752
  dispatch({
7753
  type,
7754
- clientIds: (0,external_lodash_namespaceObject.castArray)(clientIds),
7755
  rootClientId
7756
  });
7757
  };
@@ -7862,7 +7864,7 @@ const insertBlocks = function (blocks, index, rootClientId) {
7862
  } = _ref10;
7863
 
7864
  /* eslint-enable jsdoc/valid-types */
7865
- if ((0,external_lodash_namespaceObject.isObject)(initialPosition)) {
7866
  meta = initialPosition;
7867
  initialPosition = 0;
7868
  external_wp_deprecated_default()("meta argument in wp.data.dispatch('core/block-editor')", {
@@ -7871,7 +7873,7 @@ const insertBlocks = function (blocks, index, rootClientId) {
7871
  });
7872
  }
7873
 
7874
- blocks = getBlocksWithDefaultStylesApplied((0,external_lodash_namespaceObject.castArray)(blocks), select.getSettings());
7875
  const allowedBlocks = [];
7876
 
7877
  for (const block of blocks) {
@@ -8306,7 +8308,7 @@ const removeBlocks = function (clientIds) {
8306
  return;
8307
  }
8308
 
8309
- clientIds = (0,external_lodash_namespaceObject.castArray)(clientIds);
8310
  const rootClientId = select.getBlockRootClientId(clientIds[0]);
8311
  const canRemoveBlocks = select.canRemoveBlocks(clientIds, rootClientId);
8312
 
@@ -8677,7 +8679,7 @@ const duplicateBlocks = function (clientIds) {
8677
 
8678
  const blocks = select.getBlocksByClientId(clientIds);
8679
 
8680
- if ((0,external_lodash_namespaceObject.some)(blocks, block => !block)) {
8681
  return;
8682
  } // Return early if blocks don't support multiple usage.
8683
 
@@ -8689,12 +8691,13 @@ const duplicateBlocks = function (clientIds) {
8689
  }
8690
 
8691
  const rootClientId = select.getBlockRootClientId(clientIds[0]);
8692
- const lastSelectedIndex = select.getBlockIndex((0,external_lodash_namespaceObject.last)((0,external_lodash_namespaceObject.castArray)(clientIds)));
 
8693
  const clonedBlocks = blocks.map(block => (0,external_wp_blocks_namespaceObject.__experimentalCloneSanitizedBlock)(block));
8694
  dispatch.insertBlocks(clonedBlocks, lastSelectedIndex + 1, rootClientId, updateSelection);
8695
 
8696
  if (clonedBlocks.length > 1 && updateSelection) {
8697
- dispatch.multiSelect((0,external_lodash_namespaceObject.first)(clonedBlocks).clientId, (0,external_lodash_namespaceObject.last)(clonedBlocks).clientId);
8698
  }
8699
 
8700
  return clonedBlocks.map(block => block.clientId);
@@ -8827,8 +8830,6 @@ const STORE_NAME = 'core/block-editor';
8827
  * Block editor data store configuration.
8828
  *
8829
  * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/data/README.md#registerStore
8830
- *
8831
- * @type {Object}
8832
  */
8833
 
8834
  const storeConfig = {
@@ -8840,8 +8841,6 @@ const storeConfig = {
8840
  * Store definition for the block editor namespace.
8841
  *
8842
  * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/data/README.md#createReduxStore
8843
- *
8844
- * @type {Object}
8845
  */
8846
 
8847
  const store = (0,external_wp_data_namespaceObject.createReduxStore)(STORE_NAME, { ...storeConfig,
@@ -9161,8 +9160,8 @@ const arrowDown = (0,external_wp_element_namespaceObject.createElement)(external
9161
  /**
9162
  * Utility to generate the proper CSS selector for layout styles.
9163
  *
9164
- * @param {string|string[]} selectors - CSS selectors
9165
- * @param {boolean} append - string to append.
9166
  *
9167
  * @return {string} - CSS selector.
9168
  */
@@ -9173,7 +9172,37 @@ function appendSelectors(selectors) {
9173
  // it's used to reset the default margin added by wp-admin to paragraphs
9174
  // so we need this to be higher speficity otherwise, it won't be applied to paragraphs inside containers
9175
  // When the post editor is fully iframed, this extra classname could be removed.
9176
- return selectors.split(',').map(subselector => `.editor-styles-wrapper ${subselector} ${append}`).join(',');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9177
  }
9178
 
9179
  ;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/provider/block-refs-provider.js
@@ -9558,6 +9587,8 @@ function InspectorControlsFill(_ref) {
9558
  */
9559
 
9560
 
 
 
9561
  /**
9562
  * Removed falsy values from nested object.
9563
  *
@@ -9565,12 +9596,13 @@ function InspectorControlsFill(_ref) {
9565
  * @return {*} Object cleaned from falsy values
9566
  */
9567
 
 
9568
  const cleanEmptyObject = object => {
9569
- if (!(0,external_lodash_namespaceObject.isObject)(object) || Array.isArray(object)) {
9570
  return object;
9571
  }
9572
 
9573
- const cleanedNestedObjects = (0,external_lodash_namespaceObject.pickBy)((0,external_lodash_namespaceObject.mapValues)(object, cleanEmptyObject), external_lodash_namespaceObject.identity);
9574
  return (0,external_lodash_namespaceObject.isEmpty)(cleanedNestedObjects) ? undefined : cleanedNestedObjects;
9575
  };
9576
  function immutableSet(object, path, value) {
@@ -9923,7 +9955,7 @@ function BlockPopover(_ref) {
9923
  position: "top right left",
9924
  focusOnMount: false,
9925
  anchorRef: anchorRef // Render in the old slot if needed for backward compatibility,
9926
- // otherwise render in place (not in the the default popover slot).
9927
  ,
9928
  __unstableSlotName: __unstablePopoverSlot || null // Observe movement for block animations (especially horizontal).
9929
  ,
@@ -10939,7 +10971,6 @@ const JustifyToolbar = props => {
10939
 
10940
 
10941
 
10942
-
10943
  /**
10944
  * Internal dependencies
10945
  */
@@ -10947,7 +10978,6 @@ const JustifyToolbar = props => {
10947
 
10948
 
10949
 
10950
-
10951
  // Used with the default, horizontal flex orientation.
10952
 
10953
  const justifyContentMap = {
@@ -11018,49 +11048,59 @@ const flexWrapOptions = ['wrap', 'nowrap'];
11018
  isToolbar: true
11019
  }));
11020
  },
11021
- save: function FlexLayoutStyle(_ref3) {
11022
  var _style$spacing, _style$spacing2;
11023
 
11024
  let {
11025
  selector,
11026
  layout,
11027
  style,
11028
- blockName
 
 
11029
  } = _ref3;
11030
  const {
11031
  orientation = 'horizontal'
11032
- } = layout;
11033
- const blockGapSupport = useSetting('spacing.blockGap');
11034
- const fallbackValue = (0,external_wp_blocks_namespaceObject.getBlockSupport)(blockName, ['spacing', 'blockGap', '__experimentalDefault']) || '0.5em';
11035
- const hasBlockGapStylesSupport = blockGapSupport !== null; // If a block's block.json skips serialization for spacing or spacing.blockGap,
11036
  // don't apply the user-defined value to the styles.
11037
 
11038
- const blockGapValue = style !== null && style !== void 0 && (_style$spacing = style.spacing) !== null && _style$spacing !== void 0 && _style$spacing.blockGap && !shouldSkipSerialization(blockName, 'spacing', 'blockGap') ? getGapCSSValue(style === null || style === void 0 ? void 0 : (_style$spacing2 = style.spacing) === null || _style$spacing2 === void 0 ? void 0 : _style$spacing2.blockGap, fallbackValue) : `var( --wp--style--block-gap, ${fallbackValue} )`;
11039
- const justifyContent = justifyContentMap[layout.justifyContent] || justifyContentMap.left;
11040
  const flexWrap = flexWrapOptions.includes(layout.flexWrap) ? layout.flexWrap : 'wrap';
11041
- const verticalAlignment = verticalAlignmentMap[layout.verticalAlignment] || verticalAlignmentMap.center;
11042
- const rowOrientation = `
11043
- flex-direction: row;
11044
- align-items: ${verticalAlignment};
11045
- justify-content: ${justifyContent};
11046
- `;
11047
  const alignItems = alignItemsMap[layout.justifyContent] || alignItemsMap.left;
11048
- const columnOrientation = `
11049
- flex-direction: column;
11050
- align-items: ${alignItems};
11051
- `;
11052
- return (0,external_wp_element_namespaceObject.createElement)("style", null, `
11053
- ${appendSelectors(selector)} {
11054
- display: flex;
11055
- flex-wrap: ${flexWrap};
11056
- gap: ${hasBlockGapStylesSupport ? blockGapValue : fallbackValue};
11057
- ${orientation === 'horizontal' ? rowOrientation : columnOrientation}
11058
- }
11059
 
11060
- ${appendSelectors(selector, '> *')} {
11061
- margin: 0;
11062
- }
11063
- `);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
11064
  },
11065
 
11066
  getOrientation(layout) {
@@ -11389,25 +11429,25 @@ const stretchWide = (0,external_wp_element_namespaceObject.createElement)(extern
11389
  toolBarControls: function DefaultLayoutToolbarControls() {
11390
  return null;
11391
  },
11392
- save: function DefaultLayoutStyle(_ref2) {
11393
  var _style$spacing;
11394
 
11395
  let {
11396
  selector,
11397
  layout = {},
11398
  style,
11399
- blockName
 
 
11400
  } = _ref2;
11401
  const {
11402
  contentSize,
11403
  wideSize
11404
  } = layout;
11405
- const blockGapSupport = useSetting('spacing.blockGap');
11406
- const hasBlockGapStylesSupport = blockGapSupport !== null;
11407
  const blockGapStyleValue = getGapBoxControlValueFromStyle(style === null || style === void 0 ? void 0 : (_style$spacing = style.spacing) === null || _style$spacing === void 0 ? void 0 : _style$spacing.blockGap); // If a block's block.json skips serialization for spacing or
11408
  // spacing.blockGap, don't apply the user-defined value to the styles.
11409
 
11410
- const blockGapValue = blockGapStyleValue !== null && blockGapStyleValue !== void 0 && blockGapStyleValue.top && !shouldSkipSerialization(blockName, 'spacing', 'blockGap') ? blockGapStyleValue === null || blockGapStyleValue === void 0 ? void 0 : blockGapStyleValue.top : 'var( --wp--style--block-gap )';
11411
  let output = !!contentSize || !!wideSize ? `
11412
  ${appendSelectors(selector, '> :where(:not(.alignleft):not(.alignright))')} {
11413
  max-width: ${contentSize !== null && contentSize !== void 0 ? contentSize : wideSize};
@@ -11420,38 +11460,13 @@ const stretchWide = (0,external_wp_element_namespaceObject.createElement)(extern
11420
  ${appendSelectors(selector, '> .alignfull')} {
11421
  max-width: none;
11422
  }
11423
- ` : '';
11424
- output += `
11425
- ${appendSelectors(selector, '> .alignleft')} {
11426
- float: left;
11427
- margin-inline-start: 0;
11428
- margin-inline-end: 2em;
11429
- }
11430
- ${appendSelectors(selector, '> .alignright')} {
11431
- float: right;
11432
- margin-inline-start: 2em;
11433
- margin-inline-end: 0;
11434
- }
11435
 
11436
- ${appendSelectors(selector, '> .aligncenter')} {
11437
- margin-left: auto !important;
11438
- margin-right: auto !important;
11439
- }
11440
- `;
11441
-
11442
- if (hasBlockGapStylesSupport) {
11443
- output += `
11444
- ${appendSelectors(selector, '> *')} {
11445
- margin-block-start: 0;
11446
- margin-block-end: 0;
11447
- }
11448
- ${appendSelectors(selector, '> * + *')} {
11449
- margin-block-start: ${blockGapValue};
11450
- }
11451
- `;
11452
  }
11453
 
11454
- return (0,external_wp_element_namespaceObject.createElement)("style", null, output);
11455
  },
11456
 
11457
  getOrientation() {
@@ -11572,7 +11587,6 @@ function getLayoutTypes() {
11572
  ;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/block-list/layout.js
11573
 
11574
 
11575
-
11576
  /**
11577
  * WordPress dependencies
11578
  */
@@ -11582,6 +11596,7 @@ function getLayoutTypes() {
11582
  */
11583
 
11584
 
 
11585
  const defaultLayout = {
11586
  type: 'default'
11587
  };
@@ -11601,14 +11616,29 @@ function useLayout() {
11601
  function LayoutStyle(_ref) {
11602
  let {
11603
  layout = {},
 
11604
  ...props
11605
  } = _ref;
11606
  const layoutType = getLayoutType(layout.type);
 
 
11607
 
11608
  if (layoutType) {
11609
- return (0,external_wp_element_namespaceObject.createElement)(layoutType.save, _extends({
11610
- layout: layout
11611
- }, props));
 
 
 
 
 
 
 
 
 
 
 
 
11612
  }
11613
 
11614
  return null;
@@ -12596,7 +12626,7 @@ function generateBoxRules(style, options, path, ruleKeys) {
12596
  });
12597
  } else {
12598
  const sideRules = individualProperties.reduce((acc, side) => {
12599
- const value = (0,external_lodash_namespaceObject.get)(boxStyle, [side]);
12600
 
12601
  if (value) {
12602
  acc.push({
@@ -18163,7 +18193,8 @@ function useBlockClassNames(clientId) {
18163
  getBlockName,
18164
  getSettings,
18165
  hasSelectedInnerBlock,
18166
- isTyping
 
18167
  } = select(store);
18168
  const {
18169
  outlineMode
@@ -18174,10 +18205,12 @@ function useBlockClassNames(clientId) {
18174
  const checkDeep = true; // "ancestor" is the more appropriate label due to "deep" check.
18175
 
18176
  const isAncestorOfSelectedBlock = hasSelectedInnerBlock(clientId, checkDeep);
 
18177
  return classnames_default()({
18178
  'is-selected': isSelected,
18179
  'is-highlighted': isBlockHighlighted(clientId),
18180
- 'is-multi-selected': isBlockMultiSelected(clientId),
 
18181
  'is-reusable': (0,external_wp_blocks_namespaceObject.isReusableBlock)((0,external_wp_blocks_namespaceObject.getBlockType)(name)),
18182
  'is-dragging': isDragging,
18183
  'has-child-selected': isAncestorOfSelectedBlock,
@@ -18742,11 +18775,11 @@ function mergeWrapperProps(propsA, propsB) {
18742
  ...propsB
18743
  };
18744
 
18745
- if (propsA && propsB && propsA.className && propsB.className) {
18746
  newProps.className = classnames_default()(propsA.className, propsB.className);
18747
  }
18748
 
18749
- if (propsA && propsB && propsA.style && propsB.style) {
18750
  newProps.style = { ...propsA.style,
18751
  ...propsB.style
18752
  };
@@ -19603,23 +19636,17 @@ function BlockSelectionClearer(props) {
19603
  }
19604
 
19605
  ;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/writing-flow/use-multi-selection.js
19606
- /**
19607
- * External dependencies
19608
- */
19609
-
19610
  /**
19611
  * WordPress dependencies
19612
  */
19613
 
19614
 
19615
-
19616
  /**
19617
  * Internal dependencies
19618
  */
19619
 
19620
 
19621
 
19622
-
19623
  function selector(select) {
19624
  const {
19625
  isMultiSelecting,
@@ -19648,10 +19675,6 @@ function useMultiSelection() {
19648
  selectedBlockClientId,
19649
  isFullSelection
19650
  } = (0,external_wp_data_namespaceObject.useSelect)(selector, []);
19651
- const selectedRef = useBlockRef(selectedBlockClientId); // These must be in the right DOM order.
19652
-
19653
- const startRef = useBlockRef((0,external_lodash_namespaceObject.first)(multiSelectedBlockClientIds));
19654
- const endRef = useBlockRef((0,external_lodash_namespaceObject.last)(multiSelectedBlockClientIds));
19655
  /**
19656
  * When the component updates, and there is multi selection, we need to
19657
  * select the entire block contents.
@@ -19672,24 +19695,6 @@ function useMultiSelection() {
19672
  }
19673
 
19674
  if (!hasMultiSelection || isMultiSelecting) {
19675
- if (!selectedBlockClientId || isMultiSelecting) {
19676
- return;
19677
- }
19678
-
19679
- const selection = defaultView.getSelection();
19680
-
19681
- if (selection.rangeCount && !selection.isCollapsed) {
19682
- const blockNode = selectedRef.current;
19683
- const {
19684
- startContainer,
19685
- endContainer
19686
- } = selection.getRangeAt(0);
19687
-
19688
- if (!!blockNode && (!blockNode.contains(startContainer) || !blockNode.contains(endContainer))) {
19689
- selection.removeAllRanges();
19690
- }
19691
- }
19692
-
19693
  return;
19694
  }
19695
 
@@ -19709,23 +19714,9 @@ function useMultiSelection() {
19709
  // able to select across instances immediately.
19710
 
19711
 
19712
- node.contentEditable = true; // For some browsers, like Safari, it is important that focus happens
19713
- // BEFORE selection.
19714
-
19715
- node.focus(); // The block refs might not be immediately available
19716
- // when dragging blocks into another block.
19717
-
19718
- if (!startRef.current || !endRef.current) {
19719
- return;
19720
- }
19721
-
19722
- const selection = defaultView.getSelection();
19723
- const range = ownerDocument.createRange(); // These must be in the right DOM order.
19724
-
19725
- range.setStartBefore(startRef.current);
19726
- range.setEndAfter(endRef.current);
19727
- selection.removeAllRanges();
19728
- selection.addRange(range);
19729
  }, [hasMultiSelection, isMultiSelecting, multiSelectedBlockClientIds, selectedBlockClientId, initialPosition, isFullSelection]);
19730
  }
19731
 
@@ -20022,12 +20013,17 @@ function getClosestTabbable(target, isReverse, containerElement, onlyVertical) {
20022
  function useArrowNav() {
20023
  const {
20024
  getSelectedBlockClientId,
 
20025
  getMultiSelectedBlocksEndClientId,
20026
  getPreviousBlockClientId,
20027
  getNextBlockClientId,
20028
  getSettings,
20029
- hasMultiSelection
 
20030
  } = (0,external_wp_data_namespaceObject.useSelect)(store);
 
 
 
20031
  return (0,external_wp_compose_namespaceObject.useRefEffect)(node => {
20032
  // Here a DOMRect is stored while moving the caret vertically so
20033
  // vertical position of the start position can be restored. This is to
@@ -20076,9 +20072,36 @@ function useArrowNav() {
20076
  } = node;
20077
  const {
20078
  defaultView
20079
- } = ownerDocument;
 
20080
 
20081
  if (hasMultiSelection()) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
20082
  return;
20083
  } // When presing any key other than up or down, the initial vertical
20084
  // position must ALWAYS be reset. The vertical position is saved so
@@ -20450,11 +20473,9 @@ function useSelectionObserver() {
20450
  } = ownerDocument;
20451
 
20452
  function onSelectionChange(event) {
20453
- const selection = defaultView.getSelection(); // If no selection is found, end multi selection and disable the
20454
- // contentEditable wrapper.
20455
 
20456
  if (!selection.rangeCount) {
20457
- use_selection_observer_setContentEditableWrapper(node, false);
20458
  return;
20459
  } // If selection is collapsed and we haven't used `shift+click`,
20460
  // end multi selection and disable the contentEditable wrapper.
@@ -20851,12 +20872,25 @@ function useStylesCompatibility() {
20851
  return;
20852
  }
20853
 
20854
- const isMatch = Array.from(cssRules).find(_ref => {
20855
- let {
20856
- selectorText
20857
- } = _ref;
20858
- return selectorText && (selectorText.includes(`.${BODY_CLASS_NAME}`) || selectorText.includes(`.${BLOCK_PREFIX}`));
20859
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
20860
 
20861
  if (isMatch && !node.ownerDocument.getElementById(ownerNode.id)) {
20862
  // Display warning once we have a way to add style dependencies to the editor.
@@ -22007,7 +22041,7 @@ compress_Compiler.prototype.declaration = function (node) {
22007
  * Expose compiler.
22008
  */
22009
 
22010
- /* harmony default export */ const identity = (identity_Compiler);
22011
  /**
22012
  * Initialize a new `Compiler`.
22013
  */
@@ -22211,7 +22245,7 @@ identity_Compiler.prototype.indent = function (level) {
22211
 
22212
  /* harmony default export */ function stringify(node, options) {
22213
  options = options || {};
22214
- const compiler = options.compress ? new compress(options) : new identity(options);
22215
  const code = compiler.compile(node);
22216
  return code;
22217
  }
@@ -26004,7 +26038,7 @@ function BlockPopoverInbetween(_ref) {
26004
  animate: false,
26005
  getAnchorRect: getAnchorRect,
26006
  focusOnMount: false // Render in the old slot if needed for backward compatibility,
26007
- // otherwise render in place (not in the the default popover slot).
26008
  ,
26009
  __unstableSlotName: __unstablePopoverSlot || null // Forces a remount of the popover when its position changes
26010
  // This makes sure the popover doesn't animate from its previous position.
@@ -26541,15 +26575,22 @@ function useBlockDisplayInformation(clientId) {
26541
  * @example
26542
  *
26543
  * ```js
26544
- * useBlockDisplayTitle( 'afd1cb17-2c08-4e7a-91be-007ba7ddc3a1', 17 );
26545
  * ```
26546
  *
26547
- * @param {string} clientId Client ID of block.
26548
- * @param {number|undefined} maximumLength The maximum length that the block title string may be before truncated.
 
 
26549
  * @return {?string} Block title.
26550
  */
26551
 
26552
- function useBlockDisplayTitle(clientId, maximumLength) {
 
 
 
 
 
26553
  const {
26554
  attributes,
26555
  name,
@@ -26584,7 +26625,7 @@ function useBlockDisplayTitle(clientId, maximumLength) {
26584
  }
26585
 
26586
  const blockType = (0,external_wp_blocks_namespaceObject.getBlockType)(name);
26587
- const blockLabel = blockType ? (0,external_wp_blocks_namespaceObject.__experimentalGetBlockLabel)(blockType, attributes) : null;
26588
  const label = reusableBlockTitle || blockLabel; // Label will fallback to the title if no label is defined for the current
26589
  // label context. If the label is defined we prioritize it over a
26590
  // possible block variation title match.
@@ -26617,6 +26658,7 @@ function useBlockDisplayTitle(clientId, maximumLength) {
26617
  * @param {Object} props
26618
  * @param {string} props.clientId Client ID of block.
26619
  * @param {number|undefined} props.maximumLength The maximum length that the block title string may be before truncated.
 
26620
  *
26621
  * @return {JSX.Element} Block title.
26622
  */
@@ -26624,9 +26666,14 @@ function useBlockDisplayTitle(clientId, maximumLength) {
26624
  function BlockTitle(_ref) {
26625
  let {
26626
  clientId,
26627
- maximumLength
 
26628
  } = _ref;
26629
- return useBlockDisplayTitle(clientId, maximumLength);
 
 
 
 
26630
  }
26631
 
26632
  ;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/block-draggable/use-scroll-when-dragging.js
@@ -28768,8 +28815,14 @@ const BlockSwitcherDropdownMenu = _ref => {
28768
 
28769
 
28770
  const onPatternTransform = transformedBlocks => replaceBlocks(clientIds, transformedBlocks);
 
 
 
 
 
28771
 
28772
- const hasPossibleBlockTransformations = !!possibleBlockTransformations.length && canRemove;
 
28773
  const hasPatternTransformation = !!(patterns !== null && patterns !== void 0 && patterns.length) && canRemove;
28774
 
28775
  if (!hasBlockStyles && !hasPossibleBlockTransformations) {
@@ -29345,7 +29398,7 @@ function BlockModeToggle(_ref) {
29345
  isCodeEditingEnabled = true
29346
  } = _ref;
29347
 
29348
- if (!(0,external_wp_blocks_namespaceObject.hasBlockSupport)(blockType, 'html', true) || !isCodeEditingEnabled) {
29349
  return null;
29350
  }
29351
 
@@ -29701,6 +29754,21 @@ const lock = (0,external_wp_element_namespaceObject.createElement)(external_wp_p
29701
 
29702
 
29703
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
29704
  function BlockLockModal(_ref) {
29705
  let {
29706
  clientId,
@@ -29716,16 +29784,25 @@ function BlockLockModal(_ref) {
29716
  canRemove
29717
  } = useBlockLock(clientId);
29718
  const {
29719
- isReusable
 
 
29720
  } = (0,external_wp_data_namespaceObject.useSelect)(select => {
 
 
29721
  const {
29722
- getBlockName
 
29723
  } = select(store);
29724
  const blockName = getBlockName(clientId);
 
29725
  return {
29726
- isReusable: (0,external_wp_blocks_namespaceObject.isReusableBlock)((0,external_wp_blocks_namespaceObject.getBlockType)(blockName))
 
 
29727
  };
29728
  }, [clientId]);
 
29729
  const {
29730
  updateBlockAttributes
29731
  } = (0,external_wp_data_namespaceObject.useDispatch)(store);
@@ -29753,7 +29830,8 @@ function BlockLockModal(_ref) {
29753
  onSubmit: event => {
29754
  event.preventDefault();
29755
  updateBlockAttributes([clientId], {
29756
- lock
 
29757
  });
29758
  onClose();
29759
  }
@@ -29807,7 +29885,13 @@ function BlockLockModal(_ref) {
29807
  onChange: remove => setLock(prevLock => ({ ...prevLock,
29808
  remove
29809
  }))
29810
- })))), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Flex, {
 
 
 
 
 
 
29811
  className: "block-editor-block-lock-modal__actions",
29812
  justify: "flex-end",
29813
  expanded: false
@@ -30073,7 +30157,10 @@ function BlockSettingsDropdown(_ref2) {
30073
  __experimentalSelectBlock(ids[0]);
30074
  }
30075
  } : block_settings_dropdown_noop, [__experimentalSelectBlock]);
30076
- const blockTitle = useBlockDisplayTitle(firstBlockClientId, 25);
 
 
 
30077
  const updateSelectionAfterRemove = (0,external_wp_element_namespaceObject.useCallback)(__experimentalSelectBlock ? () => {
30078
  const blockToSelect = previousBlockClientId || nextBlockClientId;
30079
 
@@ -30684,7 +30771,7 @@ function BlockContextualToolbar(_ref) {
30684
  return {
30685
  blockType: selectedBlockClientId && getBlockType(getBlockName(selectedBlockClientId)),
30686
  hasParents: parents.length,
30687
- showParentSelector: (0,external_wp_blocks_namespaceObject.hasBlockSupport)(parentBlockType, '__experimentalParentSelector', true) && selectedBlockClientIds.length <= 1
30688
  };
30689
  }, []);
30690
 
@@ -32323,6 +32410,8 @@ function BorderRadiusControl(_ref) {
32323
  onChange: onChange,
32324
  units: units
32325
  }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.RangeControl, {
 
 
32326
  className: "components-border-radius-control__range-control",
32327
  value: allValue !== null && allValue !== void 0 ? allValue : '',
32328
  min: MIN_BORDER_RADIUS_VALUE,
@@ -33294,14 +33383,23 @@ function __experimentalUseGradient() {
33294
  */
33295
 
33296
 
33297
-
33298
-
33299
  /**
33300
  * Internal dependencies
33301
  */
33302
 
33303
 
33304
  const colorsAndGradientKeys = ['colors', 'disableCustomColors', 'gradients', 'disableCustomGradients'];
 
 
 
 
 
 
 
 
 
 
 
33305
 
33306
  function ColorGradientControlInner(_ref) {
33307
  let {
@@ -33323,12 +33421,38 @@ function ColorGradientControlInner(_ref) {
33323
  } = _ref;
33324
  const canChooseAColor = onColorChange && (!(0,external_lodash_namespaceObject.isEmpty)(colors) || !disableCustomColors);
33325
  const canChooseAGradient = onGradientChange && (!(0,external_lodash_namespaceObject.isEmpty)(gradients) || !disableCustomGradients);
33326
- const [currentTab, setCurrentTab] = (0,external_wp_element_namespaceObject.useState)(gradientValue ? 'gradient' : !!canChooseAColor && 'color');
33327
 
33328
  if (!canChooseAColor && !canChooseAGradient) {
33329
  return null;
33330
  }
33331
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
33332
  return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.BaseControl, {
33333
  className: classnames_default()('block-editor-color-gradient-control', className)
33334
  }, (0,external_wp_element_namespaceObject.createElement)("fieldset", {
@@ -33337,42 +33461,13 @@ function ColorGradientControlInner(_ref) {
33337
  spacing: 1
33338
  }, showTitle && (0,external_wp_element_namespaceObject.createElement)("legend", null, (0,external_wp_element_namespaceObject.createElement)("div", {
33339
  className: "block-editor-color-gradient-control__color-indicator"
33340
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.BaseControl.VisualLabel, null, label))), canChooseAColor && canChooseAGradient && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToggleGroupControl, {
33341
- value: currentTab,
33342
- onChange: setCurrentTab,
33343
- label: (0,external_wp_i18n_namespaceObject.__)('Select color type'),
33344
- hideLabelFromVision: true,
33345
- isBlock: true
33346
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToggleGroupControlOption, {
33347
- value: "color",
33348
- label: (0,external_wp_i18n_namespaceObject.__)('Solid')
33349
- }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToggleGroupControlOption, {
33350
- value: "gradient",
33351
- label: (0,external_wp_i18n_namespaceObject.__)('Gradient')
33352
- })), (currentTab === 'color' || !canChooseAGradient) && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ColorPalette, {
33353
- value: colorValue,
33354
- onChange: canChooseAGradient ? newColor => {
33355
- onColorChange(newColor);
33356
- onGradientChange();
33357
- } : onColorChange,
33358
- colors,
33359
- disableCustomColors,
33360
- __experimentalHasMultipleOrigins: __experimentalHasMultipleOrigins,
33361
- __experimentalIsRenderedInSidebar: __experimentalIsRenderedInSidebar,
33362
- clearable: clearable,
33363
- enableAlpha: enableAlpha
33364
- }), (currentTab === 'gradient' || !canChooseAColor) && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.GradientPicker, {
33365
- value: gradientValue,
33366
- onChange: canChooseAColor ? newGradient => {
33367
- onGradientChange(newGradient);
33368
- onColorChange();
33369
- } : onGradientChange,
33370
- gradients,
33371
- disableCustomGradients,
33372
- __experimentalHasMultipleOrigins: __experimentalHasMultipleOrigins,
33373
- __experimentalIsRenderedInSidebar: __experimentalIsRenderedInSidebar,
33374
- clearable: clearable
33375
- }))));
33376
  }
33377
 
33378
  function ColorGradientControlSelect(props) {
@@ -33757,7 +33852,6 @@ function ColorPanel(_ref) {
33757
  * External dependencies
33758
  */
33759
 
33760
-
33761
  /**
33762
  * WordPress dependencies
33763
  */
@@ -33789,12 +33883,12 @@ const hasLinkColorSupport = blockType => {
33789
  }
33790
 
33791
  const colorSupport = (0,external_wp_blocks_namespaceObject.getBlockSupport)(blockType, COLOR_SUPPORT_KEY);
33792
- return (0,external_lodash_namespaceObject.isObject)(colorSupport) && !!colorSupport.link;
33793
  };
33794
 
33795
  const hasGradientSupport = blockType => {
33796
  const colorSupport = (0,external_wp_blocks_namespaceObject.getBlockSupport)(blockType, COLOR_SUPPORT_KEY);
33797
- return (0,external_lodash_namespaceObject.isObject)(colorSupport) && !!colorSupport.gradients;
33798
  };
33799
 
33800
  const hasBackgroundColorSupport = blockType => {
@@ -36836,29 +36930,32 @@ const layoutBlockSupportKey = '__experimentalLayout';
36836
  * have the style engine generate a more extensive list of utility classnames which
36837
  * will then replace this method.
36838
  *
36839
- * @param { Array } attributes Array of block attributes.
 
36840
  *
36841
  * @return { Array } Array of CSS classname strings.
36842
  */
36843
 
36844
- function getLayoutClasses(attributes) {
36845
- var _attributes$layout, _attributes$layout2, _attributes$layout3;
36846
 
36847
  const layoutClassnames = [];
36848
 
36849
- if (!attributes.layout) {
36850
- return layoutClassnames;
 
 
36851
  }
36852
 
36853
- if (attributes !== null && attributes !== void 0 && (_attributes$layout = attributes.layout) !== null && _attributes$layout !== void 0 && _attributes$layout.orientation) {
36854
- layoutClassnames.push(`is-${(0,external_lodash_namespaceObject.kebabCase)(attributes.layout.orientation)}`);
36855
  }
36856
 
36857
- if (attributes !== null && attributes !== void 0 && (_attributes$layout2 = attributes.layout) !== null && _attributes$layout2 !== void 0 && _attributes$layout2.justifyContent) {
36858
- layoutClassnames.push(`is-content-justification-${(0,external_lodash_namespaceObject.kebabCase)(attributes.layout.justifyContent)}`);
36859
  }
36860
 
36861
- if (attributes !== null && attributes !== void 0 && (_attributes$layout3 = attributes.layout) !== null && _attributes$layout3 !== void 0 && _attributes$layout3.flexWrap && attributes.layout.flexWrap === 'nowrap') {
36862
  layoutClassnames.push('is-nowrap');
36863
  }
36864
 
@@ -37034,13 +37131,37 @@ const withLayoutStyles = (0,external_wp_compose_namespaceObject.createHigherOrde
37034
  default: defaultBlockLayout
37035
  } = (0,external_wp_blocks_namespaceObject.getBlockSupport)(name, layoutBlockSupportKey) || {};
37036
  const usedLayout = layout !== null && layout !== void 0 && layout.inherit ? defaultThemeLayout : layout || defaultBlockLayout || {};
37037
- const layoutClasses = shouldRenderLayoutStyles ? getLayoutClasses(attributes) : null;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
37038
  const className = classnames_default()(props === null || props === void 0 ? void 0 : props.className, {
37039
- [`wp-container-${id}`]: shouldRenderLayoutStyles
 
37040
  }, layoutClasses);
37041
- return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, shouldRenderLayoutStyles && element && (0,external_wp_element_namespaceObject.createPortal)((0,external_wp_element_namespaceObject.createElement)(LayoutStyle, {
37042
  blockName: name,
37043
- selector: `.wp-container-${id}`,
 
37044
  layout: usedLayout,
37045
  style: attributes === null || attributes === void 0 ? void 0 : attributes.style
37046
  }), element), (0,external_wp_element_namespaceObject.createElement)(BlockListBlock, _extends({}, props, {
@@ -37305,6 +37426,7 @@ function useCachedTruthy(value) {
37305
 
37306
 
37307
 
 
37308
 
37309
  ;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/colors/with-colors.js
37310
 
@@ -37372,7 +37494,7 @@ const withEditorColorPalette = () => (0,external_wp_compose_namespaceObject.crea
37372
  function createColorHOC(colorTypes, withColorPalette) {
37373
  const colorMap = (0,external_lodash_namespaceObject.reduce)(colorTypes, (colorObject, colorType) => {
37374
  return { ...colorObject,
37375
- ...((0,external_lodash_namespaceObject.isString)(colorType) ? {
37376
  [colorType]: (0,external_lodash_namespaceObject.kebabCase)(colorType)
37377
  } : colorType)
37378
  };
@@ -38579,6 +38701,10 @@ function ListViewBlockSelectButton(_ref, ref) {
38579
  draggable
38580
  } = _ref;
38581
  const blockInformation = useBlockDisplayInformation(clientId);
 
 
 
 
38582
  const {
38583
  isLocked
38584
  } = useBlockLock(clientId); // The `href` attribute triggers the browser's native HTML drag operations.
@@ -38614,18 +38740,22 @@ function ListViewBlockSelectButton(_ref, ref) {
38614
  }), (0,external_wp_element_namespaceObject.createElement)(block_icon, {
38615
  icon: blockInformation === null || blockInformation === void 0 ? void 0 : blockInformation.icon,
38616
  showColors: true
38617
- }), (0,external_wp_element_namespaceObject.createElement)("span", {
 
 
 
 
 
38618
  className: "block-editor-list-view-block-select-button__title"
38619
- }, (0,external_wp_element_namespaceObject.createElement)(BlockTitle, {
38620
- clientId: clientId,
38621
- maximumLength: 35
38622
- })), (blockInformation === null || blockInformation === void 0 ? void 0 : blockInformation.anchor) && (0,external_wp_element_namespaceObject.createElement)("span", {
38623
  className: "block-editor-list-view-block-select-button__anchor"
38624
  }, blockInformation.anchor), isLocked && (0,external_wp_element_namespaceObject.createElement)("span", {
38625
  className: "block-editor-list-view-block-select-button__lock"
38626
  }, (0,external_wp_element_namespaceObject.createElement)(build_module_icon, {
38627
  icon: library_lock
38628
- }))));
38629
  }
38630
 
38631
  /* harmony default export */ const block_select_button = ((0,external_wp_element_namespaceObject.forwardRef)(ListViewBlockSelectButton));
@@ -39252,7 +39382,7 @@ function ListViewDropIndicator(_ref) {
39252
  left: rect.left + indent,
39253
  right: rect.right,
39254
  width: 0,
39255
- height: rect.height,
39256
  ownerDocument
39257
  };
39258
 
@@ -40407,8 +40537,7 @@ const SetupContent = _ref => {
40407
  viewMode,
40408
  activeSlide,
40409
  patterns,
40410
- onBlockPatternSelect,
40411
- height
40412
  } = _ref;
40413
  const composite = (0,external_wp_components_namespaceObject.__unstableUseCompositeState)();
40414
  const containerClass = 'block-editor-block-pattern-setup__container';
@@ -40416,10 +40545,7 @@ const SetupContent = _ref => {
40416
  if (viewMode === VIEWMODES.carousel) {
40417
  const slideClass = new Map([[activeSlide, 'active-slide'], [activeSlide - 1, 'previous-slide'], [activeSlide + 1, 'next-slide']]);
40418
  return (0,external_wp_element_namespaceObject.createElement)("div", {
40419
- className: "block-editor-block-pattern-setup__carousel",
40420
- style: {
40421
- height
40422
- }
40423
  }, (0,external_wp_element_namespaceObject.createElement)("div", {
40424
  className: containerClass
40425
  }, (0,external_wp_element_namespaceObject.createElement)("ul", {
@@ -40427,15 +40553,11 @@ const SetupContent = _ref => {
40427
  }, patterns.map((pattern, index) => (0,external_wp_element_namespaceObject.createElement)(BlockPatternSlide, {
40428
  className: slideClass.get(index) || '',
40429
  key: pattern.name,
40430
- pattern: pattern,
40431
- minHeight: height
40432
  })))));
40433
  }
40434
 
40435
  return (0,external_wp_element_namespaceObject.createElement)("div", {
40436
- style: {
40437
- height
40438
- },
40439
  className: "block-editor-block-pattern-setup__grid"
40440
  }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__unstableComposite, _extends({}, composite, {
40441
  role: "listbox",
@@ -40517,9 +40639,6 @@ const BlockPatternSetup = _ref4 => {
40517
  replaceBlock
40518
  } = (0,external_wp_data_namespaceObject.useDispatch)(store);
40519
  const patterns = use_patterns_setup(clientId, blockName, filterPatternsFn);
40520
- const [contentResizeListener, {
40521
- height: contentHeight
40522
- }] = (0,external_wp_compose_namespaceObject.useResizeObserver)();
40523
 
40524
  if (!(patterns !== null && patterns !== void 0 && patterns.length)) {
40525
  return null;
@@ -40531,14 +40650,13 @@ const BlockPatternSetup = _ref4 => {
40531
  };
40532
 
40533
  const onPatternSelectCallback = onBlockPatternSelect || onBlockPatternSelectDefault;
40534
- return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, contentResizeListener, (0,external_wp_element_namespaceObject.createElement)("div", {
40535
  className: `block-editor-block-pattern-setup view-mode-${viewMode}`
40536
  }, (0,external_wp_element_namespaceObject.createElement)(SetupContent, {
40537
  viewMode: viewMode,
40538
  activeSlide: activeSlide,
40539
  patterns: patterns,
40540
- onBlockPatternSelect: onPatternSelectCallback,
40541
- height: contentHeight - 2 * 60
40542
  }), (0,external_wp_element_namespaceObject.createElement)(setup_toolbar, {
40543
  viewMode: viewMode,
40544
  setViewMode: setViewMode,
@@ -40860,7 +40978,7 @@ function NonDefaultControls(_ref2) {
40860
  // 2022) in German (de). The resultant array is de-duplicated as some
40861
  // languages will use the same format string for short, medium, and long
40862
  // formats.
40863
- 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')]);
40864
  const suggestedOptions = suggestedFormats.map((suggestedFormat, index) => ({
40865
  key: `suggested-${index}`,
40866
  name: (0,external_wp_date_namespaceObject.dateI18n)(suggestedFormat, EXAMPLE_DATE),
@@ -44449,7 +44567,7 @@ function LinkControl(_ref) {
44449
 
44450
  const handleSubmit = () => {
44451
  if (currentInputValue !== (value === null || value === void 0 ? void 0 : value.url) || internalTextValue !== (value === null || value === void 0 ? void 0 : value.title)) {
44452
- onChange({
44453
  url: currentInputValue,
44454
  title: internalTextValue
44455
  });
@@ -44688,7 +44806,6 @@ const MediaReplaceFlow = _ref => {
44688
  addToGallery,
44689
  handleUpload = true
44690
  } = _ref;
44691
- const [mediaURLValue, setMediaURLValue] = (0,external_wp_element_namespaceObject.useState)(mediaURL);
44692
  const mediaUpload = (0,external_wp_data_namespaceObject.useSelect)(select => {
44693
  return select(store).getSettings().mediaUpload;
44694
  }, []);
@@ -44723,8 +44840,7 @@ const MediaReplaceFlow = _ref => {
44723
  onToggleFeaturedImage();
44724
  }
44725
 
44726
- closeMenu();
44727
- setMediaURLValue(media === null || media === void 0 ? void 0 : media.url); // Calling `onSelect` after the state update since it might unmount the component.
44728
 
44729
  onSelect(media);
44730
  (0,external_wp_a11y_namespaceObject.speak)((0,external_wp_i18n_namespaceObject.__)('The media file has been replaced'));
@@ -44835,11 +44951,11 @@ const MediaReplaceFlow = _ref => {
44835
  }, (0,external_wp_element_namespaceObject.createElement)("span", {
44836
  className: "block-editor-media-replace-flow__image-url-label"
44837
  }, (0,external_wp_i18n_namespaceObject.__)('Current media URL:')), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Tooltip, {
44838
- text: mediaURLValue,
44839
  position: "bottom"
44840
  }, (0,external_wp_element_namespaceObject.createElement)("div", null, (0,external_wp_element_namespaceObject.createElement)(link_control, {
44841
  value: {
44842
- url: mediaURLValue
44843
  },
44844
  settings: [],
44845
  showSuggestions: false,
@@ -44847,7 +44963,6 @@ const MediaReplaceFlow = _ref => {
44847
  let {
44848
  url
44849
  } = _ref7;
44850
- setMediaURLValue(url);
44851
  onSelectURL(url);
44852
  editMediaButtonRef.current.focus();
44853
  }
@@ -45024,7 +45139,8 @@ function URLPopover(_ref) {
45024
  return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Popover, _extends({
45025
  className: "block-editor-url-popover",
45026
  focusOnMount: focusOnMount,
45027
- position: position
 
45028
  }, popoverProps), (0,external_wp_element_namespaceObject.createElement)("div", {
45029
  className: "block-editor-url-popover__input-container"
45030
  }, (0,external_wp_element_namespaceObject.createElement)("div", {
@@ -45124,6 +45240,7 @@ function MediaPlaceholder(_ref2) {
45124
  onSelect,
45125
  onCancel,
45126
  onSelectURL,
 
45127
  onDoubleClick,
45128
  onFilesPreUpload = media_placeholder_noop,
45129
  onHTMLDrop = media_placeholder_noop,
@@ -45347,6 +45464,16 @@ function MediaPlaceholder(_ref2) {
45347
  }));
45348
  };
45349
 
 
 
 
 
 
 
 
 
 
 
45350
  const renderMediaUploadChecked = () => {
45351
  const defaultButton = _ref6 => {
45352
  let {
@@ -45390,7 +45517,7 @@ function MediaPlaceholder(_ref2) {
45390
  variant: "primary",
45391
  className: classnames_default()('block-editor-media-placeholder__button', 'block-editor-media-placeholder__upload-button'),
45392
  onClick: openFileDialog
45393
- }, (0,external_wp_i18n_namespaceObject.__)('Upload')), uploadMediaLibraryButton, renderUrlSelectionUI(), renderCancelLink());
45394
  return renderPlaceholder(content);
45395
  }
45396
  }));
@@ -45403,7 +45530,7 @@ function MediaPlaceholder(_ref2) {
45403
  onChange: onUpload,
45404
  accept: accept,
45405
  multiple: multiple
45406
- }, (0,external_wp_i18n_namespaceObject.__)('Upload')), uploadMediaLibraryButton, renderUrlSelectionUI(), renderCancelLink());
45407
  return renderPlaceholder(content);
45408
  }
45409
 
2219
  "__experimentalGetBorderClassesAndStyles": () => (/* reexport */ getBorderClassesAndStyles),
2220
  "__experimentalGetColorClassesAndStyles": () => (/* reexport */ getColorClassesAndStyles),
2221
  "__experimentalGetElementClassName": () => (/* reexport */ __experimentalGetElementClassName),
2222
+ "__experimentalGetGapCSSValue": () => (/* reexport */ getGapCSSValue),
2223
  "__experimentalGetGradientClass": () => (/* reexport */ __experimentalGetGradientClass),
2224
  "__experimentalGetGradientObjectByGradientValue": () => (/* reexport */ __experimentalGetGradientObjectByGradientValue),
2225
  "__experimentalGetMatchingVariation": () => (/* reexport */ __experimentalGetMatchingVariation),
2794
 
2795
 
2796
 
2797
+
2798
+ const identity = x => x;
2799
  /**
2800
  * Given an array of blocks, returns an object where each key is a nesting
2801
  * context, the value of which is an array of block client IDs existing within
2807
  * @return {Object} Block order map object.
2808
  */
2809
 
2810
+
2811
  function mapBlockOrder(blocks) {
2812
  let rootClientId = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
2813
  const result = {
2853
 
2854
 
2855
  function flattenBlocks(blocks) {
2856
+ let transform = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : identity;
2857
  const result = {};
2858
  const stack = [...blocks];
2859
 
4350
  /**
4351
  * Reducer returning automatic change state.
4352
  *
4353
+ * @param {?string} state Current state.
4354
  * @param {Object} action Dispatched action.
4355
  *
4356
  * @return {string} Updated state.
6065
 
6066
  if (clientId) {
6067
  rootClientId = getBlockRootClientId(state, clientId) || undefined;
6068
+ index = getBlockIndex(state, selectionEnd.clientId) + 1;
6069
  } else {
6070
  index = getBlockOrder(state).length;
6071
  }
6134
  const checkAllowList = function (list, item) {
6135
  let defaultResult = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
6136
 
6137
+ if (typeof list === 'boolean') {
6138
  return list;
6139
  }
6140
 
6839
  }, (state, rootClientId) => [state.blockListSettings[rootClientId], state.blocks.tree[rootClientId]]);
6840
 
6841
  const checkAllowListRecursive = (blocks, allowedBlockTypes) => {
6842
+ if (typeof allowedBlockTypes === 'boolean') {
6843
  return allowedBlockTypes;
6844
  }
6845
 
7294
  }
7295
 
7296
  ;// CONCATENATED MODULE: ./packages/block-editor/build-module/store/actions.js
 
 
 
 
7297
  /**
7298
  * WordPress dependencies
7299
  */
7302
 
7303
 
7304
 
 
7305
  /**
7306
  * Internal dependencies
7307
  */
7308
 
7309
 
7310
 
7311
+
7312
+ const castArray = maybeArray => Array.isArray(maybeArray) ? maybeArray : [maybeArray];
7313
  /**
7314
  * Action which will insert a default block insert action if there
7315
  * are no other blocks at the root of the editor. This action should be used
7317
  * replacement, etc).
7318
  */
7319
 
7320
+
7321
  const ensureDefaultBlock = () => _ref => {
7322
  let {
7323
  select,
7467
  let uniqueByBlock = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
7468
  return {
7469
  type: 'UPDATE_BLOCK_ATTRIBUTES',
7470
+ clientIds: castArray(clientIds),
7471
  attributes,
7472
  uniqueByBlock
7473
  };
7693
  } = _ref7;
7694
 
7695
  /* eslint-enable jsdoc/valid-types */
7696
+ clientIds = castArray(clientIds);
7697
+ blocks = getBlocksWithDefaultStylesApplied(castArray(blocks), select.getSettings());
7698
+ const rootClientId = select.getBlockRootClientId(clientIds[0]); // Replace is valid if the new blocks can be inserted in the root block.
7699
 
7700
  for (let index = 0; index < blocks.length; index++) {
7701
  const block = blocks[index];
7753
 
7754
  dispatch({
7755
  type,
7756
+ clientIds: castArray(clientIds),
7757
  rootClientId
7758
  });
7759
  };
7864
  } = _ref10;
7865
 
7866
  /* eslint-enable jsdoc/valid-types */
7867
+ if (initialPosition !== null && typeof initialPosition === 'object') {
7868
  meta = initialPosition;
7869
  initialPosition = 0;
7870
  external_wp_deprecated_default()("meta argument in wp.data.dispatch('core/block-editor')", {
7873
  });
7874
  }
7875
 
7876
+ blocks = getBlocksWithDefaultStylesApplied(castArray(blocks), select.getSettings());
7877
  const allowedBlocks = [];
7878
 
7879
  for (const block of blocks) {
8308
  return;
8309
  }
8310
 
8311
+ clientIds = castArray(clientIds);
8312
  const rootClientId = select.getBlockRootClientId(clientIds[0]);
8313
  const canRemoveBlocks = select.canRemoveBlocks(clientIds, rootClientId);
8314
 
8679
 
8680
  const blocks = select.getBlocksByClientId(clientIds);
8681
 
8682
+ if (blocks.some(block => !block)) {
8683
  return;
8684
  } // Return early if blocks don't support multiple usage.
8685
 
8691
  }
8692
 
8693
  const rootClientId = select.getBlockRootClientId(clientIds[0]);
8694
+ const clientIdsArray = castArray(clientIds);
8695
+ const lastSelectedIndex = select.getBlockIndex(clientIdsArray[clientIdsArray.length - 1]);
8696
  const clonedBlocks = blocks.map(block => (0,external_wp_blocks_namespaceObject.__experimentalCloneSanitizedBlock)(block));
8697
  dispatch.insertBlocks(clonedBlocks, lastSelectedIndex + 1, rootClientId, updateSelection);
8698
 
8699
  if (clonedBlocks.length > 1 && updateSelection) {
8700
+ dispatch.multiSelect(clonedBlocks[0].clientId, clonedBlocks[clonedBlocks.length - 1].clientId);
8701
  }
8702
 
8703
  return clonedBlocks.map(block => block.clientId);
8830
  * Block editor data store configuration.
8831
  *
8832
  * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/data/README.md#registerStore
 
 
8833
  */
8834
 
8835
  const storeConfig = {
8841
  * Store definition for the block editor namespace.
8842
  *
8843
  * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/data/README.md#createReduxStore
 
 
8844
  */
8845
 
8846
  const store = (0,external_wp_data_namespaceObject.createReduxStore)(STORE_NAME, { ...storeConfig,
9160
  /**
9161
  * Utility to generate the proper CSS selector for layout styles.
9162
  *
9163
+ * @param {string} selectors CSS selector, also supports multiple comma-separated selectors.
9164
+ * @param {string} append The string to append.
9165
  *
9166
  * @return {string} - CSS selector.
9167
  */
9172
  // it's used to reset the default margin added by wp-admin to paragraphs
9173
  // so we need this to be higher speficity otherwise, it won't be applied to paragraphs inside containers
9174
  // When the post editor is fully iframed, this extra classname could be removed.
9175
+ return selectors.split(',').map(subselector => `.editor-styles-wrapper ${subselector}${append ? ` ${append}` : ''}`).join(',');
9176
+ }
9177
+ /**
9178
+ * Get generated blockGap CSS rules based on layout definitions provided in theme.json
9179
+ * Falsy values in the layout definition's spacingStyles rules will be swapped out
9180
+ * with the provided `blockGapValue`.
9181
+ *
9182
+ * @param {string} selector The CSS selector to target for the generated rules.
9183
+ * @param {Object} layoutDefinitions Layout definitions object from theme.json.
9184
+ * @param {string} layoutType The layout type (e.g. `default` or `flex`).
9185
+ * @param {string} blockGapValue The current blockGap value to be applied.
9186
+ * @return {string} The generated CSS rules.
9187
+ */
9188
+
9189
+ function getBlockGapCSS(selector, layoutDefinitions, layoutType, blockGapValue) {
9190
+ var _layoutDefinitions$la, _layoutDefinitions$la2;
9191
+
9192
+ let output = '';
9193
+
9194
+ if (layoutDefinitions !== null && layoutDefinitions !== void 0 && (_layoutDefinitions$la = layoutDefinitions[layoutType]) !== null && _layoutDefinitions$la !== void 0 && (_layoutDefinitions$la2 = _layoutDefinitions$la.spacingStyles) !== null && _layoutDefinitions$la2 !== void 0 && _layoutDefinitions$la2.length && blockGapValue) {
9195
+ layoutDefinitions[layoutType].spacingStyles.forEach(gapStyle => {
9196
+ output += `${appendSelectors(selector, gapStyle.selector.trim())} { `;
9197
+ output += Object.entries(gapStyle.rules).map(_ref => {
9198
+ let [cssProperty, value] = _ref;
9199
+ return `${cssProperty}: ${value ? value : blockGapValue}`;
9200
+ }).join('; ');
9201
+ output += '; }';
9202
+ });
9203
+ }
9204
+
9205
+ return output;
9206
  }
9207
 
9208
  ;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/provider/block-refs-provider.js
9587
  */
9588
 
9589
 
9590
+
9591
+ const utils_identity = x => x;
9592
  /**
9593
  * Removed falsy values from nested object.
9594
  *
9596
  * @return {*} Object cleaned from falsy values
9597
  */
9598
 
9599
+
9600
  const cleanEmptyObject = object => {
9601
+ if (object === null || typeof object !== 'object' || Array.isArray(object)) {
9602
  return object;
9603
  }
9604
 
9605
+ const cleanedNestedObjects = (0,external_lodash_namespaceObject.pickBy)((0,external_lodash_namespaceObject.mapValues)(object, cleanEmptyObject), utils_identity);
9606
  return (0,external_lodash_namespaceObject.isEmpty)(cleanedNestedObjects) ? undefined : cleanedNestedObjects;
9607
  };
9608
  function immutableSet(object, path, value) {
9955
  position: "top right left",
9956
  focusOnMount: false,
9957
  anchorRef: anchorRef // Render in the old slot if needed for backward compatibility,
9958
+ // otherwise render in place (not in the default popover slot).
9959
  ,
9960
  __unstableSlotName: __unstablePopoverSlot || null // Observe movement for block animations (especially horizontal).
9961
  ,
10971
 
10972
 
10973
 
 
10974
  /**
10975
  * Internal dependencies
10976
  */
10978
 
10979
 
10980
 
 
10981
  // Used with the default, horizontal flex orientation.
10982
 
10983
  const justifyContentMap = {
11048
  isToolbar: true
11049
  }));
11050
  },
11051
+ getLayoutStyle: function getLayoutStyle(_ref3) {
11052
  var _style$spacing, _style$spacing2;
11053
 
11054
  let {
11055
  selector,
11056
  layout,
11057
  style,
11058
+ blockName,
11059
+ hasBlockGapSupport,
11060
+ layoutDefinitions
11061
  } = _ref3;
11062
  const {
11063
  orientation = 'horizontal'
11064
+ } = layout; // If a block's block.json skips serialization for spacing or spacing.blockGap,
 
 
 
11065
  // don't apply the user-defined value to the styles.
11066
 
11067
+ const blockGapValue = style !== null && style !== void 0 && (_style$spacing = style.spacing) !== null && _style$spacing !== void 0 && _style$spacing.blockGap && !shouldSkipSerialization(blockName, 'spacing', 'blockGap') ? getGapCSSValue(style === null || style === void 0 ? void 0 : (_style$spacing2 = style.spacing) === null || _style$spacing2 === void 0 ? void 0 : _style$spacing2.blockGap) : undefined;
11068
+ const justifyContent = justifyContentMap[layout.justifyContent];
11069
  const flexWrap = flexWrapOptions.includes(layout.flexWrap) ? layout.flexWrap : 'wrap';
11070
+ const verticalAlignment = verticalAlignmentMap[layout.verticalAlignment];
 
 
 
 
 
11071
  const alignItems = alignItemsMap[layout.justifyContent] || alignItemsMap.left;
11072
+ let output = '';
11073
+ const rules = [];
 
 
 
 
 
 
 
 
 
11074
 
11075
+ if (flexWrap && flexWrap !== 'wrap') {
11076
+ rules.push(`flex-wrap: ${flexWrap}`);
11077
+ }
11078
+
11079
+ if (orientation === 'horizontal') {
11080
+ if (verticalAlignment) {
11081
+ rules.push(`align-items: ${verticalAlignment}`);
11082
+ }
11083
+
11084
+ if (justifyContent) {
11085
+ rules.push(`justify-content: ${justifyContent}`);
11086
+ }
11087
+ } else {
11088
+ rules.push('flex-direction: column');
11089
+ rules.push(`align-items: ${alignItems}`);
11090
+ }
11091
+
11092
+ if (rules.length) {
11093
+ output = `${appendSelectors(selector)} {
11094
+ ${rules.join('; ')};
11095
+ }`;
11096
+ } // Output blockGap styles based on rules contained in layout definitions in theme.json.
11097
+
11098
+
11099
+ if (hasBlockGapSupport && blockGapValue) {
11100
+ output += getBlockGapCSS(selector, layoutDefinitions, 'flex', blockGapValue);
11101
+ }
11102
+
11103
+ return output;
11104
  },
11105
 
11106
  getOrientation(layout) {
11429
  toolBarControls: function DefaultLayoutToolbarControls() {
11430
  return null;
11431
  },
11432
+ getLayoutStyle: function getLayoutStyle(_ref2) {
11433
  var _style$spacing;
11434
 
11435
  let {
11436
  selector,
11437
  layout = {},
11438
  style,
11439
+ blockName,
11440
+ hasBlockGapSupport,
11441
+ layoutDefinitions
11442
  } = _ref2;
11443
  const {
11444
  contentSize,
11445
  wideSize
11446
  } = layout;
 
 
11447
  const blockGapStyleValue = getGapBoxControlValueFromStyle(style === null || style === void 0 ? void 0 : (_style$spacing = style.spacing) === null || _style$spacing === void 0 ? void 0 : _style$spacing.blockGap); // If a block's block.json skips serialization for spacing or
11448
  // spacing.blockGap, don't apply the user-defined value to the styles.
11449
 
11450
+ const blockGapValue = blockGapStyleValue !== null && blockGapStyleValue !== void 0 && blockGapStyleValue.top && !shouldSkipSerialization(blockName, 'spacing', 'blockGap') ? blockGapStyleValue === null || blockGapStyleValue === void 0 ? void 0 : blockGapStyleValue.top : '';
11451
  let output = !!contentSize || !!wideSize ? `
11452
  ${appendSelectors(selector, '> :where(:not(.alignleft):not(.alignright))')} {
11453
  max-width: ${contentSize !== null && contentSize !== void 0 ? contentSize : wideSize};
11460
  ${appendSelectors(selector, '> .alignfull')} {
11461
  max-width: none;
11462
  }
11463
+ ` : ''; // Output blockGap styles based on rules contained in layout definitions in theme.json.
 
 
 
 
 
 
 
 
 
 
 
11464
 
11465
+ if (hasBlockGapSupport && blockGapValue) {
11466
+ output += getBlockGapCSS(selector, layoutDefinitions, 'default', blockGapValue);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
11467
  }
11468
 
11469
+ return output;
11470
  },
11471
 
11472
  getOrientation() {
11587
  ;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/block-list/layout.js
11588
 
11589
 
 
11590
  /**
11591
  * WordPress dependencies
11592
  */
11596
  */
11597
 
11598
 
11599
+
11600
  const defaultLayout = {
11601
  type: 'default'
11602
  };
11616
  function LayoutStyle(_ref) {
11617
  let {
11618
  layout = {},
11619
+ css,
11620
  ...props
11621
  } = _ref;
11622
  const layoutType = getLayoutType(layout.type);
11623
+ const blockGapSupport = useSetting('spacing.blockGap');
11624
+ const hasBlockGapSupport = blockGapSupport !== null;
11625
 
11626
  if (layoutType) {
11627
+ var _layoutType$getLayout;
11628
+
11629
+ if (css) {
11630
+ return (0,external_wp_element_namespaceObject.createElement)("style", null, css);
11631
+ }
11632
+
11633
+ const layoutStyle = (_layoutType$getLayout = layoutType.getLayoutStyle) === null || _layoutType$getLayout === void 0 ? void 0 : _layoutType$getLayout.call(layoutType, {
11634
+ hasBlockGapSupport,
11635
+ layout,
11636
+ ...props
11637
+ });
11638
+
11639
+ if (layoutStyle) {
11640
+ return (0,external_wp_element_namespaceObject.createElement)("style", null, layoutStyle);
11641
+ }
11642
  }
11643
 
11644
  return null;
12626
  });
12627
  } else {
12628
  const sideRules = individualProperties.reduce((acc, side) => {
12629
+ const value = getCSSVarFromStyleValue((0,external_lodash_namespaceObject.get)(boxStyle, [side]));
12630
 
12631
  if (value) {
12632
  acc.push({
18193
  getBlockName,
18194
  getSettings,
18195
  hasSelectedInnerBlock,
18196
+ isTyping,
18197
+ __unstableIsFullySelected
18198
  } = select(store);
18199
  const {
18200
  outlineMode
18205
  const checkDeep = true; // "ancestor" is the more appropriate label due to "deep" check.
18206
 
18207
  const isAncestorOfSelectedBlock = hasSelectedInnerBlock(clientId, checkDeep);
18208
+ const isMultiSelected = isBlockMultiSelected(clientId);
18209
  return classnames_default()({
18210
  'is-selected': isSelected,
18211
  'is-highlighted': isBlockHighlighted(clientId),
18212
+ 'is-multi-selected': isMultiSelected,
18213
+ 'is-partially-selected': isMultiSelected && !__unstableIsFullySelected(),
18214
  'is-reusable': (0,external_wp_blocks_namespaceObject.isReusableBlock)((0,external_wp_blocks_namespaceObject.getBlockType)(name)),
18215
  'is-dragging': isDragging,
18216
  'has-child-selected': isAncestorOfSelectedBlock,
18775
  ...propsB
18776
  };
18777
 
18778
+ if (propsA !== null && propsA !== void 0 && propsA.className && propsB !== null && propsB !== void 0 && propsB.className) {
18779
  newProps.className = classnames_default()(propsA.className, propsB.className);
18780
  }
18781
 
18782
+ if (propsA !== null && propsA !== void 0 && propsA.style && propsB !== null && propsB !== void 0 && propsB.style) {
18783
  newProps.style = { ...propsA.style,
18784
  ...propsB.style
18785
  };
19636
  }
19637
 
19638
  ;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/writing-flow/use-multi-selection.js
 
 
 
 
19639
  /**
19640
  * WordPress dependencies
19641
  */
19642
 
19643
 
 
19644
  /**
19645
  * Internal dependencies
19646
  */
19647
 
19648
 
19649
 
 
19650
  function selector(select) {
19651
  const {
19652
  isMultiSelecting,
19675
  selectedBlockClientId,
19676
  isFullSelection
19677
  } = (0,external_wp_data_namespaceObject.useSelect)(selector, []);
 
 
 
 
19678
  /**
19679
  * When the component updates, and there is multi selection, we need to
19680
  * select the entire block contents.
19695
  }
19696
 
19697
  if (!hasMultiSelection || isMultiSelecting) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
19698
  return;
19699
  }
19700
 
19714
  // able to select across instances immediately.
19715
 
19716
 
19717
+ node.contentEditable = true;
19718
+ defaultView.getSelection().removeAllRanges();
19719
+ node.focus();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
19720
  }, [hasMultiSelection, isMultiSelecting, multiSelectedBlockClientIds, selectedBlockClientId, initialPosition, isFullSelection]);
19721
  }
19722
 
20013
  function useArrowNav() {
20014
  const {
20015
  getSelectedBlockClientId,
20016
+ getMultiSelectedBlocksStartClientId,
20017
  getMultiSelectedBlocksEndClientId,
20018
  getPreviousBlockClientId,
20019
  getNextBlockClientId,
20020
  getSettings,
20021
+ hasMultiSelection,
20022
+ __unstableIsFullySelected
20023
  } = (0,external_wp_data_namespaceObject.useSelect)(store);
20024
+ const {
20025
+ selectBlock
20026
+ } = (0,external_wp_data_namespaceObject.useDispatch)(store);
20027
  return (0,external_wp_compose_namespaceObject.useRefEffect)(node => {
20028
  // Here a DOMRect is stored while moving the caret vertically so
20029
  // vertical position of the start position can be restored. This is to
20072
  } = node;
20073
  const {
20074
  defaultView
20075
+ } = ownerDocument; // If there is a multi-selection, the arrow keys should collapse the
20076
+ // selection to the start or end of the selection.
20077
 
20078
  if (hasMultiSelection()) {
20079
+ // Only handle if we have a full selection (not a native partial
20080
+ // selection).
20081
+ if (!__unstableIsFullySelected()) {
20082
+ return;
20083
+ }
20084
+
20085
+ if (event.defaultPrevented) {
20086
+ return;
20087
+ }
20088
+
20089
+ if (!isNav) {
20090
+ return;
20091
+ }
20092
+
20093
+ if (isShift) {
20094
+ return;
20095
+ }
20096
+
20097
+ event.preventDefault();
20098
+
20099
+ if (isReverse) {
20100
+ selectBlock(getMultiSelectedBlocksStartClientId());
20101
+ } else {
20102
+ selectBlock(getMultiSelectedBlocksEndClientId(), -1);
20103
+ }
20104
+
20105
  return;
20106
  } // When presing any key other than up or down, the initial vertical
20107
  // position must ALWAYS be reset. The vertical position is saved so
20473
  } = ownerDocument;
20474
 
20475
  function onSelectionChange(event) {
20476
+ const selection = defaultView.getSelection();
 
20477
 
20478
  if (!selection.rangeCount) {
 
20479
  return;
20480
  } // If selection is collapsed and we haven't used `shift+click`,
20481
  // end multi selection and disable the contentEditable wrapper.
20872
  return;
20873
  }
20874
 
20875
+ function matchFromRules(_cssRules) {
20876
+ return Array.from(_cssRules).find(_ref => {
20877
+ let {
20878
+ selectorText,
20879
+ conditionText,
20880
+ cssRules: __cssRules
20881
+ } = _ref;
20882
+
20883
+ // If the rule is conditional then it will not have selector text.
20884
+ // Recurse into child CSS ruleset to determine selector eligibility.
20885
+ if (conditionText) {
20886
+ return matchFromRules(__cssRules);
20887
+ }
20888
+
20889
+ return selectorText && (selectorText.includes(`.${BODY_CLASS_NAME}`) || selectorText.includes(`.${BLOCK_PREFIX}`));
20890
+ });
20891
+ }
20892
+
20893
+ const isMatch = matchFromRules(cssRules);
20894
 
20895
  if (isMatch && !node.ownerDocument.getElementById(ownerNode.id)) {
20896
  // Display warning once we have a way to add style dependencies to the editor.
22041
  * Expose compiler.
22042
  */
22043
 
22044
+ /* harmony default export */ const stringify_identity = (identity_Compiler);
22045
  /**
22046
  * Initialize a new `Compiler`.
22047
  */
22245
 
22246
  /* harmony default export */ function stringify(node, options) {
22247
  options = options || {};
22248
+ const compiler = options.compress ? new compress(options) : new stringify_identity(options);
22249
  const code = compiler.compile(node);
22250
  return code;
22251
  }
26038
  animate: false,
26039
  getAnchorRect: getAnchorRect,
26040
  focusOnMount: false // Render in the old slot if needed for backward compatibility,
26041
+ // otherwise render in place (not in the default popover slot).
26042
  ,
26043
  __unstableSlotName: __unstablePopoverSlot || null // Forces a remount of the popover when its position changes
26044
  // This makes sure the popover doesn't animate from its previous position.
26575
  * @example
26576
  *
26577
  * ```js
26578
+ * useBlockDisplayTitle( { clientId: 'afd1cb17-2c08-4e7a-91be-007ba7ddc3a1', maximumLength: 17 } );
26579
  * ```
26580
  *
26581
+ * @param {Object} props
26582
+ * @param {string} props.clientId Client ID of block.
26583
+ * @param {number|undefined} props.maximumLength The maximum length that the block title string may be before truncated.
26584
+ * @param {string|undefined} props.context The context to pass to `getBlockLabel`.
26585
  * @return {?string} Block title.
26586
  */
26587
 
26588
+ function useBlockDisplayTitle(_ref) {
26589
+ let {
26590
+ clientId,
26591
+ maximumLength,
26592
+ context
26593
+ } = _ref;
26594
  const {
26595
  attributes,
26596
  name,
26625
  }
26626
 
26627
  const blockType = (0,external_wp_blocks_namespaceObject.getBlockType)(name);
26628
+ const blockLabel = blockType ? (0,external_wp_blocks_namespaceObject.__experimentalGetBlockLabel)(blockType, attributes, context) : null;
26629
  const label = reusableBlockTitle || blockLabel; // Label will fallback to the title if no label is defined for the current
26630
  // label context. If the label is defined we prioritize it over a
26631
  // possible block variation title match.
26658
  * @param {Object} props
26659
  * @param {string} props.clientId Client ID of block.
26660
  * @param {number|undefined} props.maximumLength The maximum length that the block title string may be before truncated.
26661
+ * @param {string|undefined} props.context The context to pass to `getBlockLabel`.
26662
  *
26663
  * @return {JSX.Element} Block title.
26664
  */
26666
  function BlockTitle(_ref) {
26667
  let {
26668
  clientId,
26669
+ maximumLength,
26670
+ context
26671
  } = _ref;
26672
+ return useBlockDisplayTitle({
26673
+ clientId,
26674
+ maximumLength,
26675
+ context
26676
+ });
26677
  }
26678
 
26679
  ;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/block-draggable/use-scroll-when-dragging.js
28815
 
28816
 
28817
  const onPatternTransform = transformedBlocks => replaceBlocks(clientIds, transformedBlocks);
28818
+ /**
28819
+ * The `isTemplate` check is a stopgap solution here.
28820
+ * Ideally, the Transforms API should handle this
28821
+ * by allowing to exclude blocks from wildcard transformations.
28822
+ */
28823
 
28824
+
28825
+ const hasPossibleBlockTransformations = !!possibleBlockTransformations.length && canRemove && !isTemplate;
28826
  const hasPatternTransformation = !!(patterns !== null && patterns !== void 0 && patterns.length) && canRemove;
28827
 
28828
  if (!hasBlockStyles && !hasPossibleBlockTransformations) {
29398
  isCodeEditingEnabled = true
29399
  } = _ref;
29400
 
29401
+ if (!blockType || !(0,external_wp_blocks_namespaceObject.hasBlockSupport)(blockType, 'html', true) || !isCodeEditingEnabled) {
29402
  return null;
29403
  }
29404
 
29754
 
29755
 
29756
 
29757
+
29758
+ function getTemplateLockValue(lock) {
29759
+ // Prevents all operations.
29760
+ if (lock.remove && lock.move) {
29761
+ return 'all';
29762
+ } // Prevents inserting or removing blocks, but allows moving existing blocks.
29763
+
29764
+
29765
+ if (lock.remove && !lock.move) {
29766
+ return 'insert';
29767
+ }
29768
+
29769
+ return false;
29770
+ }
29771
+
29772
  function BlockLockModal(_ref) {
29773
  let {
29774
  clientId,
29784
  canRemove
29785
  } = useBlockLock(clientId);
29786
  const {
29787
+ isReusable,
29788
+ templateLock,
29789
+ hasTemplateLock
29790
  } = (0,external_wp_data_namespaceObject.useSelect)(select => {
29791
+ var _getBlockAttributes, _blockType$attributes;
29792
+
29793
  const {
29794
+ getBlockName,
29795
+ getBlockAttributes
29796
  } = select(store);
29797
  const blockName = getBlockName(clientId);
29798
+ const blockType = (0,external_wp_blocks_namespaceObject.getBlockType)(blockName);
29799
  return {
29800
+ isReusable: (0,external_wp_blocks_namespaceObject.isReusableBlock)(blockType),
29801
+ templateLock: (_getBlockAttributes = getBlockAttributes(clientId)) === null || _getBlockAttributes === void 0 ? void 0 : _getBlockAttributes.templateLock,
29802
+ hasTemplateLock: !!(blockType !== null && blockType !== void 0 && (_blockType$attributes = blockType.attributes) !== null && _blockType$attributes !== void 0 && _blockType$attributes.templateLock)
29803
  };
29804
  }, [clientId]);
29805
+ const [applyTemplateLock, setApplyTemplateLock] = (0,external_wp_element_namespaceObject.useState)(!!templateLock);
29806
  const {
29807
  updateBlockAttributes
29808
  } = (0,external_wp_data_namespaceObject.useDispatch)(store);
29830
  onSubmit: event => {
29831
  event.preventDefault();
29832
  updateBlockAttributes([clientId], {
29833
+ lock,
29834
+ templateLock: applyTemplateLock ? getTemplateLockValue(lock) : undefined
29835
  });
29836
  onClose();
29837
  }
29885
  onChange: remove => setLock(prevLock => ({ ...prevLock,
29886
  remove
29887
  }))
29888
+ }))), hasTemplateLock && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
29889
+ className: "block-editor-block-lock-modal__template-lock",
29890
+ label: (0,external_wp_i18n_namespaceObject.__)('Apply to all blocks inside'),
29891
+ checked: applyTemplateLock,
29892
+ disabled: lock.move && !lock.remove,
29893
+ onChange: () => setApplyTemplateLock(!applyTemplateLock)
29894
+ })), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Flex, {
29895
  className: "block-editor-block-lock-modal__actions",
29896
  justify: "flex-end",
29897
  expanded: false
30157
  __experimentalSelectBlock(ids[0]);
30158
  }
30159
  } : block_settings_dropdown_noop, [__experimentalSelectBlock]);
30160
+ const blockTitle = useBlockDisplayTitle({
30161
+ clientId: firstBlockClientId,
30162
+ maximumLength: 25
30163
+ });
30164
  const updateSelectionAfterRemove = (0,external_wp_element_namespaceObject.useCallback)(__experimentalSelectBlock ? () => {
30165
  const blockToSelect = previousBlockClientId || nextBlockClientId;
30166
 
30771
  return {
30772
  blockType: selectedBlockClientId && getBlockType(getBlockName(selectedBlockClientId)),
30773
  hasParents: parents.length,
30774
+ showParentSelector: parentBlockType && (0,external_wp_blocks_namespaceObject.hasBlockSupport)(parentBlockType, '__experimentalParentSelector', true) && selectedBlockClientIds.length <= 1
30775
  };
30776
  }, []);
30777
 
32410
  onChange: onChange,
32411
  units: units
32412
  }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.RangeControl, {
32413
+ label: (0,external_wp_i18n_namespaceObject.__)('Border radius'),
32414
+ hideLabelFromVision: true,
32415
  className: "components-border-radius-control__range-control",
32416
  value: allValue !== null && allValue !== void 0 ? allValue : '',
32417
  min: MIN_BORDER_RADIUS_VALUE,
33383
  */
33384
 
33385
 
 
 
33386
  /**
33387
  * Internal dependencies
33388
  */
33389
 
33390
 
33391
  const colorsAndGradientKeys = ['colors', 'disableCustomColors', 'gradients', 'disableCustomGradients'];
33392
+ const TAB_COLOR = {
33393
+ name: 'color',
33394
+ title: 'Solid color',
33395
+ value: 'color'
33396
+ };
33397
+ const TAB_GRADIENT = {
33398
+ name: 'gradient',
33399
+ title: 'Gradient',
33400
+ value: 'gradient'
33401
+ };
33402
+ const TABS_SETTINGS = [TAB_COLOR, TAB_GRADIENT];
33403
 
33404
  function ColorGradientControlInner(_ref) {
33405
  let {
33421
  } = _ref;
33422
  const canChooseAColor = onColorChange && (!(0,external_lodash_namespaceObject.isEmpty)(colors) || !disableCustomColors);
33423
  const canChooseAGradient = onGradientChange && (!(0,external_lodash_namespaceObject.isEmpty)(gradients) || !disableCustomGradients);
 
33424
 
33425
  if (!canChooseAColor && !canChooseAGradient) {
33426
  return null;
33427
  }
33428
 
33429
+ const tabPanels = {
33430
+ [TAB_COLOR.value]: (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ColorPalette, {
33431
+ value: colorValue,
33432
+ onChange: canChooseAGradient ? newColor => {
33433
+ onColorChange(newColor);
33434
+ onGradientChange();
33435
+ } : onColorChange,
33436
+ colors,
33437
+ disableCustomColors,
33438
+ __experimentalHasMultipleOrigins: __experimentalHasMultipleOrigins,
33439
+ __experimentalIsRenderedInSidebar: __experimentalIsRenderedInSidebar,
33440
+ clearable: clearable,
33441
+ enableAlpha: enableAlpha
33442
+ }),
33443
+ [TAB_GRADIENT.value]: (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.GradientPicker, {
33444
+ value: gradientValue,
33445
+ onChange: canChooseAColor ? newGradient => {
33446
+ onGradientChange(newGradient);
33447
+ onColorChange();
33448
+ } : onGradientChange,
33449
+ gradients,
33450
+ disableCustomGradients,
33451
+ __experimentalHasMultipleOrigins: __experimentalHasMultipleOrigins,
33452
+ __experimentalIsRenderedInSidebar: __experimentalIsRenderedInSidebar,
33453
+ clearable: clearable
33454
+ })
33455
+ };
33456
  return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.BaseControl, {
33457
  className: classnames_default()('block-editor-color-gradient-control', className)
33458
  }, (0,external_wp_element_namespaceObject.createElement)("fieldset", {
33461
  spacing: 1
33462
  }, showTitle && (0,external_wp_element_namespaceObject.createElement)("legend", null, (0,external_wp_element_namespaceObject.createElement)("div", {
33463
  className: "block-editor-color-gradient-control__color-indicator"
33464
+ }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.BaseControl.VisualLabel, null, label))), canChooseAColor && canChooseAGradient && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.TabPanel, {
33465
+ className: "block-editor-color-gradient-control__tabs",
33466
+ tabs: TABS_SETTINGS,
33467
+ initialTabName: gradientValue ? TAB_GRADIENT.value : !!canChooseAColor && TAB_COLOR.value
33468
+ }, tab => (0,external_wp_element_namespaceObject.createElement)("div", {
33469
+ className: "block-editor-color-gradient-control__tab-panel"
33470
+ }, tabPanels[tab.value])), !canChooseAGradient && tabPanels[TAB_COLOR.value], !canChooseAColor && tabPanels[TAB_GRADIENT.value])));
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
33471
  }
33472
 
33473
  function ColorGradientControlSelect(props) {
33852
  * External dependencies
33853
  */
33854
 
 
33855
  /**
33856
  * WordPress dependencies
33857
  */
33883
  }
33884
 
33885
  const colorSupport = (0,external_wp_blocks_namespaceObject.getBlockSupport)(blockType, COLOR_SUPPORT_KEY);
33886
+ return colorSupport !== null && typeof colorSupport === 'object' && !!colorSupport.link;
33887
  };
33888
 
33889
  const hasGradientSupport = blockType => {
33890
  const colorSupport = (0,external_wp_blocks_namespaceObject.getBlockSupport)(blockType, COLOR_SUPPORT_KEY);
33891
+ return colorSupport !== null && typeof colorSupport === 'object' && !!colorSupport.gradients;
33892
  };
33893
 
33894
  const hasBackgroundColorSupport = blockType => {
36930
  * have the style engine generate a more extensive list of utility classnames which
36931
  * will then replace this method.
36932
  *
36933
+ * @param { Object } layout Layout object.
36934
+ * @param { Object } layoutDefinitions An object containing layout definitions, stored in theme.json.
36935
  *
36936
  * @return { Array } Array of CSS classname strings.
36937
  */
36938
 
36939
+ function getLayoutClasses(layout, layoutDefinitions) {
36940
+ var _layoutDefinitions;
36941
 
36942
  const layoutClassnames = [];
36943
 
36944
+ if (layoutDefinitions !== null && layoutDefinitions !== void 0 && (_layoutDefinitions = layoutDefinitions[(layout === null || layout === void 0 ? void 0 : layout.type) || 'default']) !== null && _layoutDefinitions !== void 0 && _layoutDefinitions.className) {
36945
+ var _layoutDefinitions2;
36946
+
36947
+ layoutClassnames.push(layoutDefinitions === null || layoutDefinitions === void 0 ? void 0 : (_layoutDefinitions2 = layoutDefinitions[(layout === null || layout === void 0 ? void 0 : layout.type) || 'default']) === null || _layoutDefinitions2 === void 0 ? void 0 : _layoutDefinitions2.className);
36948
  }
36949
 
36950
+ if (layout !== null && layout !== void 0 && layout.orientation) {
36951
+ layoutClassnames.push(`is-${(0,external_lodash_namespaceObject.kebabCase)(layout.orientation)}`);
36952
  }
36953
 
36954
+ if (layout !== null && layout !== void 0 && layout.justifyContent) {
36955
+ layoutClassnames.push(`is-content-justification-${(0,external_lodash_namespaceObject.kebabCase)(layout.justifyContent)}`);
36956
  }
36957
 
36958
+ if (layout !== null && layout !== void 0 && layout.flexWrap && layout.flexWrap === 'nowrap') {
36959
  layoutClassnames.push('is-nowrap');
36960
  }
36961
 
37131
  default: defaultBlockLayout
37132
  } = (0,external_wp_blocks_namespaceObject.getBlockSupport)(name, layoutBlockSupportKey) || {};
37133
  const usedLayout = layout !== null && layout !== void 0 && layout.inherit ? defaultThemeLayout : layout || defaultBlockLayout || {};
37134
+ const layoutClasses = shouldRenderLayoutStyles ? getLayoutClasses(usedLayout, defaultThemeLayout === null || defaultThemeLayout === void 0 ? void 0 : defaultThemeLayout.definitions) : null;
37135
+ const selector = `.${(0,external_wp_blocks_namespaceObject.getBlockDefaultClassName)(name)}.wp-container-${id}`;
37136
+ const blockGapSupport = useSetting('spacing.blockGap');
37137
+ const hasBlockGapSupport = blockGapSupport !== null; // Get CSS string for the current layout type.
37138
+ // The CSS and `style` element is only output if it is not empty.
37139
+
37140
+ let css;
37141
+
37142
+ if (shouldRenderLayoutStyles) {
37143
+ var _fullLayoutType$getLa;
37144
+
37145
+ const fullLayoutType = getLayoutType((usedLayout === null || usedLayout === void 0 ? void 0 : usedLayout.type) || 'default');
37146
+ css = fullLayoutType === null || fullLayoutType === void 0 ? void 0 : (_fullLayoutType$getLa = fullLayoutType.getLayoutStyle) === null || _fullLayoutType$getLa === void 0 ? void 0 : _fullLayoutType$getLa.call(fullLayoutType, {
37147
+ blockName: name,
37148
+ selector,
37149
+ layout: usedLayout,
37150
+ layoutDefinitions: defaultThemeLayout === null || defaultThemeLayout === void 0 ? void 0 : defaultThemeLayout.definitions,
37151
+ style: attributes === null || attributes === void 0 ? void 0 : attributes.style,
37152
+ hasBlockGapSupport
37153
+ });
37154
+ } // Attach a `wp-container-` id-based class name as well as a layout class name such as `is-layout-flex`.
37155
+
37156
+
37157
  const className = classnames_default()(props === null || props === void 0 ? void 0 : props.className, {
37158
+ [`wp-container-${id}`]: shouldRenderLayoutStyles && !!css // Only attach a container class if there is generated CSS to be attached.
37159
+
37160
  }, layoutClasses);
37161
+ return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, shouldRenderLayoutStyles && element && !!css && (0,external_wp_element_namespaceObject.createPortal)((0,external_wp_element_namespaceObject.createElement)(LayoutStyle, {
37162
  blockName: name,
37163
+ selector: selector,
37164
+ css: css,
37165
  layout: usedLayout,
37166
  style: attributes === null || attributes === void 0 ? void 0 : attributes.style
37167
  }), element), (0,external_wp_element_namespaceObject.createElement)(BlockListBlock, _extends({}, props, {
37426
 
37427
 
37428
 
37429
+
37430
 
37431
  ;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/colors/with-colors.js
37432
 
37494
  function createColorHOC(colorTypes, withColorPalette) {
37495
  const colorMap = (0,external_lodash_namespaceObject.reduce)(colorTypes, (colorObject, colorType) => {
37496
  return { ...colorObject,
37497
+ ...(typeof colorType === 'string' ? {
37498
  [colorType]: (0,external_lodash_namespaceObject.kebabCase)(colorType)
37499
  } : colorType)
37500
  };
38701
  draggable
38702
  } = _ref;
38703
  const blockInformation = useBlockDisplayInformation(clientId);
38704
+ const blockTitle = useBlockDisplayTitle({
38705
+ clientId,
38706
+ context: 'list-view'
38707
+ });
38708
  const {
38709
  isLocked
38710
  } = useBlockLock(clientId); // The `href` attribute triggers the browser's native HTML drag operations.
38740
  }), (0,external_wp_element_namespaceObject.createElement)(block_icon, {
38741
  icon: blockInformation === null || blockInformation === void 0 ? void 0 : blockInformation.icon,
38742
  showColors: true
38743
+ }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalHStack, {
38744
+ alignment: "center",
38745
+ className: "block-editor-list-view-block-select-button__label-wrapper",
38746
+ justify: "flex-start",
38747
+ spacing: 1
38748
+ }, (0,external_wp_element_namespaceObject.createElement)("span", {
38749
  className: "block-editor-list-view-block-select-button__title"
38750
+ }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalTruncate, {
38751
+ ellipsizeMode: "auto"
38752
+ }, blockTitle)), (blockInformation === null || blockInformation === void 0 ? void 0 : blockInformation.anchor) && (0,external_wp_element_namespaceObject.createElement)("span", {
 
38753
  className: "block-editor-list-view-block-select-button__anchor"
38754
  }, blockInformation.anchor), isLocked && (0,external_wp_element_namespaceObject.createElement)("span", {
38755
  className: "block-editor-list-view-block-select-button__lock"
38756
  }, (0,external_wp_element_namespaceObject.createElement)(build_module_icon, {
38757
  icon: library_lock
38758
+ })))));
38759
  }
38760
 
38761
  /* harmony default export */ const block_select_button = ((0,external_wp_element_namespaceObject.forwardRef)(ListViewBlockSelectButton));
39382
  left: rect.left + indent,
39383
  right: rect.right,
39384
  width: 0,
39385
+ height: 0,
39386
  ownerDocument
39387
  };
39388
 
40537
  viewMode,
40538
  activeSlide,
40539
  patterns,
40540
+ onBlockPatternSelect
 
40541
  } = _ref;
40542
  const composite = (0,external_wp_components_namespaceObject.__unstableUseCompositeState)();
40543
  const containerClass = 'block-editor-block-pattern-setup__container';
40545
  if (viewMode === VIEWMODES.carousel) {
40546
  const slideClass = new Map([[activeSlide, 'active-slide'], [activeSlide - 1, 'previous-slide'], [activeSlide + 1, 'next-slide']]);
40547
  return (0,external_wp_element_namespaceObject.createElement)("div", {
40548
+ className: "block-editor-block-pattern-setup__carousel"
 
 
 
40549
  }, (0,external_wp_element_namespaceObject.createElement)("div", {
40550
  className: containerClass
40551
  }, (0,external_wp_element_namespaceObject.createElement)("ul", {
40553
  }, patterns.map((pattern, index) => (0,external_wp_element_namespaceObject.createElement)(BlockPatternSlide, {
40554
  className: slideClass.get(index) || '',
40555
  key: pattern.name,
40556
+ pattern: pattern
 
40557
  })))));
40558
  }
40559
 
40560
  return (0,external_wp_element_namespaceObject.createElement)("div", {
 
 
 
40561
  className: "block-editor-block-pattern-setup__grid"
40562
  }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__unstableComposite, _extends({}, composite, {
40563
  role: "listbox",
40639
  replaceBlock
40640
  } = (0,external_wp_data_namespaceObject.useDispatch)(store);
40641
  const patterns = use_patterns_setup(clientId, blockName, filterPatternsFn);
 
 
 
40642
 
40643
  if (!(patterns !== null && patterns !== void 0 && patterns.length)) {
40644
  return null;
40650
  };
40651
 
40652
  const onPatternSelectCallback = onBlockPatternSelect || onBlockPatternSelectDefault;
40653
+ return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)("div", {
40654
  className: `block-editor-block-pattern-setup view-mode-${viewMode}`
40655
  }, (0,external_wp_element_namespaceObject.createElement)(SetupContent, {
40656
  viewMode: viewMode,
40657
  activeSlide: activeSlide,
40658
  patterns: patterns,
40659
+ onBlockPatternSelect: onPatternSelectCallback
 
40660
  }), (0,external_wp_element_namespaceObject.createElement)(setup_toolbar, {
40661
  viewMode: viewMode,
40662
  setViewMode: setViewMode,
40978
  // 2022) in German (de). The resultant array is de-duplicated as some
40979
  // languages will use the same format string for short, medium, and long
40980
  // formats.
40981
+ 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'), (0,external_wp_i18n_namespaceObject._x)('M j', 'short date format without the year')]);
40982
  const suggestedOptions = suggestedFormats.map((suggestedFormat, index) => ({
40983
  key: `suggested-${index}`,
40984
  name: (0,external_wp_date_namespaceObject.dateI18n)(suggestedFormat, EXAMPLE_DATE),
44567
 
44568
  const handleSubmit = () => {
44569
  if (currentInputValue !== (value === null || value === void 0 ? void 0 : value.url) || internalTextValue !== (value === null || value === void 0 ? void 0 : value.title)) {
44570
+ onChange({ ...value,
44571
  url: currentInputValue,
44572
  title: internalTextValue
44573
  });
44806
  addToGallery,
44807
  handleUpload = true
44808
  } = _ref;
 
44809
  const mediaUpload = (0,external_wp_data_namespaceObject.useSelect)(select => {
44810
  return select(store).getSettings().mediaUpload;
44811
  }, []);
44840
  onToggleFeaturedImage();
44841
  }
44842
 
44843
+ closeMenu(); // Calling `onSelect` after the state update since it might unmount the component.
 
44844
 
44845
  onSelect(media);
44846
  (0,external_wp_a11y_namespaceObject.speak)((0,external_wp_i18n_namespaceObject.__)('The media file has been replaced'));
44951
  }, (0,external_wp_element_namespaceObject.createElement)("span", {
44952
  className: "block-editor-media-replace-flow__image-url-label"
44953
  }, (0,external_wp_i18n_namespaceObject.__)('Current media URL:')), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Tooltip, {
44954
+ text: mediaURL,
44955
  position: "bottom"
44956
  }, (0,external_wp_element_namespaceObject.createElement)("div", null, (0,external_wp_element_namespaceObject.createElement)(link_control, {
44957
  value: {
44958
+ url: mediaURL
44959
  },
44960
  settings: [],
44961
  showSuggestions: false,
44963
  let {
44964
  url
44965
  } = _ref7;
 
44966
  onSelectURL(url);
44967
  editMediaButtonRef.current.focus();
44968
  }
45139
  return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Popover, _extends({
45140
  className: "block-editor-url-popover",
45141
  focusOnMount: focusOnMount,
45142
+ position: position,
45143
+ __unstableShift: true
45144
  }, popoverProps), (0,external_wp_element_namespaceObject.createElement)("div", {
45145
  className: "block-editor-url-popover__input-container"
45146
  }, (0,external_wp_element_namespaceObject.createElement)("div", {
45240
  onSelect,
45241
  onCancel,
45242
  onSelectURL,
45243
+ onToggleFeaturedImage,
45244
  onDoubleClick,
45245
  onFilesPreUpload = media_placeholder_noop,
45246
  onHTMLDrop = media_placeholder_noop,
45464
  }));
45465
  };
45466
 
45467
+ const renderFeaturedImageToggle = () => {
45468
+ return onToggleFeaturedImage && (0,external_wp_element_namespaceObject.createElement)("div", {
45469
+ className: "block-editor-media-placeholder__url-input-container"
45470
+ }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
45471
+ className: "block-editor-media-placeholder__button",
45472
+ onClick: onToggleFeaturedImage,
45473
+ variant: "tertiary"
45474
+ }, (0,external_wp_i18n_namespaceObject.__)('Use featured image')));
45475
+ };
45476
+
45477
  const renderMediaUploadChecked = () => {
45478
  const defaultButton = _ref6 => {
45479
  let {
45517
  variant: "primary",
45518
  className: classnames_default()('block-editor-media-placeholder__button', 'block-editor-media-placeholder__upload-button'),
45519
  onClick: openFileDialog
45520
+ }, (0,external_wp_i18n_namespaceObject.__)('Upload')), uploadMediaLibraryButton, renderUrlSelectionUI(), renderFeaturedImageToggle(), renderCancelLink());
45521
  return renderPlaceholder(content);
45522
  }
45523
  }));
45530
  onChange: onUpload,
45531
  accept: accept,
45532
  multiple: multiple
45533
+ }, (0,external_wp_i18n_namespaceObject.__)('Upload')), uploadMediaLibraryButton, renderUrlSelectionUI(), renderFeaturedImageToggle(), renderCancelLink());
45534
  return renderPlaceholder(content);
45535
  }
45536
 
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-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' => '43ca7066da0f86787d4a');
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' => '34565542c4c978a3e4a5');
build/block-editor/index.min.js CHANGED
@@ -1,33 +1,33 @@
1
- (()=>{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:(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: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:(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 g(){for(var n=-1*u;n<=u;n+=2){var l=void 0,d=p[n-1],m=p[n+1],g=(m?m.newPos:0)-n;d&&(p[n-1]=void 0);var h=d&&d.newPos+1<a,f=m&&0<=g&&g<c;if(h||f){if(!h||f&&d.newPos<m.newPos?(l=r(m),i.pushComponent(l.components,void 0,!0)):((l=d).newPos++,i.pushComponent(l.components,!0,void 0)),g=i.extractCommon(l,t,e,n),l.newPos+1>=a&&g+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();g()||e()}),0)}();else for(;u<=d;){var h=g();if(h)return h}},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:(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:(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),g=o.offset(e),h=o.outerHeight(e),f=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:g.left-S.left-c,top:g.top-S.top-a},E={left:g.left+f-(S.left+w)+d,top:g.top+h-(S.top+B)+u},_=S):(v=o.offset(t),b=t.clientHeight,k=t.clientWidth,_={left:t.scrollLeft,top:t.scrollTop},y={left:g.left-(v.left+(parseFloat(o.css(t,"borderLeftWidth"))||0))-c,top:g.top-(v.top+(parseFloat(o.css(t,"borderTopWidth"))||0))-a},E={left:g.left+f-(v.left+k+(parseFloat(o.css(t,"borderRightWidth"))||0))+d,top:g.top+h-(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:(e,t,n)=>{"use strict";e.exports=n(1345)},5022: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 g(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 h(e){return null!=e&&e==e.window}var f={};function v(e,t,n){if(h(e))return"width"===t?f.viewportWidth(e):f.viewportHeight(e);if(9===e.nodeType)return"width"===t?f.docWidth(e):f.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-g(e,["border","padding"],o):i;if(s){var u=2===n?-g(e,["border"],o):g(e,["margin"],o);return a+(1===n?0:u)}return i+g(e,p.slice(n),o)}u(["Width","Height"],(function(e){f["doc"+e]=function(t){var n=t.document;return Math.max(n.documentElement["scroll"+e],n.body["scroll"+e],f["viewport"+e](n))},f["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);f["outer"+t]=function(t,n){return t&&k(t,e,n?0:1)};var n="width"===e?["Left","Right"]:["Top","Bottom"];f[e]=function(t,o){return void 0===o?t&&k(t,e,-1):t?(c(t),d(t)&&(o+=g(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:h,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(h(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(h(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},f)},8575: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:(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="&nbsp;","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:(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:(e,t,n)=>{e.exports=n(5372)()},9567: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:(e,t,n)=>{"use strict";var o=n(5438);t.Z=o.TextareaAutosize},3124: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={},g=!0,h={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){h.isRoot||(h.parent.node[h.key]=e),h.node=e,t&&(g=!1)},delete:function(e){delete h.parent.node[h.key],e&&(g=!1)},remove:function(e){s(h.parent.node)?h.parent.node.splice(h.key,1):delete h.parent.node[h.key],e&&(g=!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(){g=!1}};if(!u)return h;function f(){if("object"==typeof h.node&&null!==h.node){h.keys&&h.node_===h.node||(h.keys=l(h.node)),h.isLeaf=0==h.keys.length;for(var e=0;e<i.length;e++)if(i[e].node_===d){h.circular=i[e];break}}else h.isLeaf=!0,h.keys=null;h.notLeaf=!h.isLeaf,h.notRoot=!h.isRoot}f();var v=t.call(h,h.node);return void 0!==v&&h.update&&h.update(v),m.before&&m.before.call(h,h.node),g?("object"!=typeof h.node||null===h.node||h.circular||(i.push(h),f(),a(h.keys,(function(t,r){o.push(t),m.pre&&m.pre.call(h,h.node[t],t);var l=e(h.node[t]);n&&c.call(h.node,t)&&(h.node[t]=l.node),l.isLast=r==h.keys.length-1,l.isFirst=0==r,m.post&&m.post.call(h,l),o.pop()})),i.pop()),m.after&&m.after.call(h,h.node),h):h}(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: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=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(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=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var o={};(()=>{"use strict";n.r(o),n.d(o,{AlignmentControl:()=>lb,AlignmentToolbar:()=>ib,Autocomplete:()=>fb,BlockAlignmentControl:()=>Yr,BlockAlignmentToolbar:()=>Zr,BlockBreadcrumb:()=>Eb,BlockColorsStyleSelector:()=>Ib,BlockContextProvider:()=>Cl,BlockControls:()=>co,BlockEdit:()=>Il,BlockEditorKeyboardShortcuts:()=>iE,BlockEditorProvider:()=>iu,BlockFormatControls:()=>ao,BlockIcon:()=>tu,BlockInspector:()=>tE,BlockList:()=>lh,BlockMover:()=>ym,BlockNavigationDropdown:()=>Kb,BlockPreview:()=>Od,BlockSelectionClearer:()=>cu,BlockSettingsMenu:()=>Ig,BlockSettingsMenuControls:()=>yg,BlockStyles:()=>Xb,BlockTitle:()=>sm,BlockToolbar:()=>Ag,BlockTools:()=>nE,BlockVerticalAlignmentControl:()=>gr,BlockVerticalAlignmentToolbar:()=>hr,ButtonBlockAppender:()=>Zp,ButtonBlockerAppender:()=>Yp,ColorPalette:()=>hk,ColorPaletteControl:()=>fk,ContrastChecker:()=>Xh,CopyHandler:()=>og,DefaultBlockAppender:()=>Kp,FontSizePicker:()=>zf,InnerBlocks:()=>th,Inserter:()=>jp,InspectorAdvancedControls:()=>Oo,InspectorControls:()=>Fo,JustifyContentControl:()=>br,JustifyToolbar:()=>kr,LineHeightControl:()=>yf,MediaPlaceholder:()=>X_,MediaReplaceFlow:()=>j_,MediaUpload:()=>G_,MediaUploadCheck:()=>U_,MultiSelectScrollIntoView:()=>sE,NavigableToolbar:()=>dm,ObserveTyping:()=>dE,PanelColorSettings:()=>J_,PlainText:()=>Iy,RichText:()=>Sy,RichTextShortcut:()=>Ny,RichTextToolbarButton:()=>Py,SETTINGS_DEFAULTS:()=>v,SkipToSelectedBlock:()=>Yy,ToolSelector:()=>My,Typewriter:()=>hE,URLInput:()=>p_,URLInputButton:()=>Fy,URLPopover:()=>Y_,Warning:()=>Tl,WritingFlow:()=>Cu,__experimentalBlockAlignmentMatrixControl:()=>_b,__experimentalBlockFullHeightAligmentControl:()=>bb,__experimentalBlockPatternSetup:()=>uk,__experimentalBlockPatternsList:()=>ip,__experimentalBlockVariationPicker:()=>ek,__experimentalBlockVariationTransforms:()=>mk,__experimentalBorderRadiusControl:()=>_h,__experimentalColorGradientControl:()=>Kh,__experimentalColorGradientSettingsDropdown:()=>Qh,__experimentalDateFormatPicker:()=>kk,__experimentalDuotoneControl:()=>Iv,__experimentalFontAppearanceControl:()=>_f,__experimentalFontFamilyControl:()=>Pf,__experimentalGetBorderClassesAndStyles:()=>zv,__experimentalGetColorClassesAndStyles:()=>Hv,__experimentalGetElementClassName:()=>CE,__experimentalGetGradientClass:()=>zh,__experimentalGetGradientObjectByGradientValue:()=>Hh,__experimentalGetMatchingVariation:()=>SE,__experimentalGetSpacingClassesAndStyles:()=>Wv,__experimentalImageEditingProvider:()=>$k,__experimentalImageEditor:()=>t_,__experimentalImageSizeControl:()=>r_,__experimentalImageURLInputUI:()=>jy,__experimentalInspectorPopoverHeader:()=>_E,__experimentalLayoutStyle:()=>Fr,__experimentalLetterSpacingControl:()=>sv,__experimentalLibrary:()=>rE,__experimentalLinkControl:()=>F_,__experimentalLinkControlSearchInput:()=>T_,__experimentalLinkControlSearchItem:()=>h_,__experimentalLinkControlSearchResults:()=>E_,__experimentalListView:()=>$b,__experimentalPanelColorGradientSettings:()=>wk,__experimentalPreviewOptions:()=>Ky,__experimentalPublishDateTimePicker:()=>yE,__experimentalResponsiveBlockControl:()=>Ty,__experimentalTextDecorationControl:()=>Yf,__experimentalTextTransformControl:()=>ov,__experimentalUnitControl:()=>Ay,__experimentalUseBlockOverlayActive:()=>Cb,__experimentalUseBlockPreview:()=>Fd,__experimentalUseBorderProps:()=>Vv,__experimentalUseColorProps:()=>Uv,__experimentalUseCustomSides:()=>nr,__experimentalUseGradient:()=>Uh,__experimentalUseMultipleOriginColorsAndGradients:()=>Bh,__experimentalUseNoRecursiveRenders:()=>bE,__experimentalUseResizeCanvas:()=>qy,__unstableBlockNameContext:()=>Mg,__unstableBlockSettingsMenuFirstItem:()=>ug,__unstableBlockToolbarLastItem:()=>Qm,__unstableDuotoneFilter:()=>Ld,__unstableDuotoneStylesheet:()=>Nd,__unstableDuotoneUnsetStylesheet:()=>Pd,__unstableEditorStyles:()=>xd,__unstableGetValuesFromColors:()=>Td,__unstableIframe:()=>Bu,__unstableInserterMenuExtension:()=>Ap,__unstablePresetDuotoneFilter:()=>Rd,__unstableRichTextInputEvent:()=>Ly,__unstableUseBlockSelectionClearer:()=>au,__unstableUseClipboardHandler:()=>ng,__unstableUseMouseMoveTypingReset:()=>cE,__unstableUseTypewriter:()=>gE,__unstableUseTypingObserver:()=>uE,createCustomColorsHOC:()=>Yv,getColorClassName:()=>Sh,getColorObjectByAttributeValues:()=>Eh,getColorObjectByColorValue:()=>Ch,getFontSize:()=>Df,getFontSizeClass:()=>Ff,getFontSizeObjectByValue:()=>Of,getGradientSlugByValue:()=>Gh,getGradientValueBySlug:()=>Vh,getPxFromCssUnit:()=>ME,store:()=>Jn,storeConfig:()=>Xn,transformStyles:()=>wd,useBlockDisplayInformation:()=>lm,useBlockEditContext:()=>oo,useBlockProps:()=>Wc,useCachedTruthy:()=>$v,useInnerBlocksProps:()=>eh,useSetting:()=>Bo,withColorContext:()=>gk,withColors:()=>Zv,withFontSizes:()=>Xv});var e={};n.r(e),n.d(e,{__experimentalGetActiveBlockIdByBlockNames:()=>Ot,__experimentalGetAllowedBlocks:()=>vt,__experimentalGetAllowedPatterns:()=>yt,__experimentalGetBlockListSettingsForBlocks:()=>It,__experimentalGetDirectInsertBlock:()=>bt,__experimentalGetGlobalBlocksByName:()=>J,__experimentalGetLastBlockAttributeChanges:()=>Nt,__experimentalGetParsedPattern:()=>kt,__experimentalGetPatternTransformItems:()=>Ct,__experimentalGetPatternsByBlockTypes:()=>Et,__experimentalGetReusableBlockTitle:()=>xt,__unstableGetBlockWithoutInnerBlocks:()=>j,__unstableGetClientIdWithClientIdsTree:()=>q,__unstableGetClientIdsTree:()=>Y,__unstableGetSelectedBlocksWithPartialSelection:()=>Le,__unstableGetVisibleBlocks:()=>Vt,__unstableIsFullySelected:()=>Te,__unstableIsLastBlockChangeIgnored:()=>Tt,__unstableIsSelectionCollapsed:()=>Ne,__unstableIsSelectionMergeable:()=>Pe,areInnerBlocksControlled:()=>Dt,canEditBlock:()=>st,canInsertBlockType:()=>tt,canInsertBlocks:()=>nt,canLockBlockType:()=>at,canMoveBlock:()=>lt,canMoveBlocks:()=>it,canRemoveBlock:()=>ot,canRemoveBlocks:()=>rt,didAutomaticChange:()=>Mt,getAdjacentBlockClientId:()=>he,getBlock:()=>$,getBlockAttributes:()=>W,getBlockCount:()=>te,getBlockHierarchyRootClientId:()=>me,getBlockIndex:()=>Me,getBlockInsertionPoint:()=>qe,getBlockListSettings:()=>St,getBlockMode:()=>He,getBlockName:()=>G,getBlockOrder:()=>Re,getBlockParents:()=>de,getBlockParentsByBlockName:()=>pe,getBlockRootClientId:()=>ue,getBlockSelectionEnd:()=>le,getBlockSelectionStart:()=>re,getBlockTransformItems:()=>ht,getBlocks:()=>K,getBlocksByClientId:()=>ee,getClientIdsOfDescendants:()=>Z,getClientIdsWithDescendants:()=>Q,getDraggedBlockClientIds:()=>We,getFirstMultiSelectedBlockClientId:()=>Ee,getGlobalBlockCount:()=>X,getInserterItems:()=>gt,getLastMultiSelectedBlockClientId:()=>Ce,getLowestCommonAncestorWithSelectedBlock:()=>ge,getMultiSelectedBlockClientIds:()=>_e,getMultiSelectedBlocks:()=>ye,getMultiSelectedBlocksEndClientId:()=>xe,getMultiSelectedBlocksStartClientId:()=>Ie,getNextBlockClientId:()=>ve,getPreviousBlockClientId:()=>fe,getSelectedBlock:()=>ce,getSelectedBlockClientId:()=>ae,getSelectedBlockClientIds:()=>ke,getSelectedBlockCount:()=>ie,getSelectedBlocksInitialCaretPosition:()=>be,getSelectionEnd:()=>oe,getSelectionStart:()=>ne,getSettings:()=>wt,getTemplate:()=>Qe,getTemplateLock:()=>Xe,hasBlockMovingClientId:()=>Rt,hasInserterItems:()=>ft,hasMultiSelection:()=>Fe,hasSelectedBlock:()=>se,hasSelectedInnerBlock:()=>De,isAncestorBeingDragged:()=>je,isAncestorMultiSelected:()=>Be,isBlockBeingDragged:()=>$e,isBlockHighlighted:()=>At,isBlockInsertionPointVisible:()=>Ye,isBlockMultiSelected:()=>we,isBlockSelected:()=>Ae,isBlockValid:()=>U,isBlockVisible:()=>zt,isBlockWithinSelection:()=>Oe,isCaretWithinFormattedText:()=>Ke,isDraggingBlocks:()=>Ue,isFirstMultiSelectedBlock:()=>Se,isLastBlockChangePersistent:()=>Bt,isMultiSelecting:()=>ze,isNavigationMode:()=>Lt,isSelectionEnabled:()=>Ve,isTyping:()=>Ge,isValidTemplate:()=>Ze,wasBlockJustInserted:()=>Ft});var t={};n.r(t),n.d(t,{__unstableDeleteSelection:()=>kn,__unstableExpandSelection:()=>En,__unstableMarkAutomaticChange:()=>Hn,__unstableMarkLastChangeAsPersistent:()=>zn,__unstableMarkNextChangeAsNotPersistent:()=>Vn,__unstableSaveReusableBlock:()=>Fn,__unstableSplitSelection:()=>yn,clearSelectedBlock:()=>nn,duplicateBlocks:()=>Wn,enterFormattedText:()=>Ln,exitFormattedText:()=>Rn,flashBlock:()=>qn,hideInsertionPoint:()=>fn,insertAfterBlock:()=>jn,insertBeforeBlock:()=>$n,insertBlock:()=>mn,insertBlocks:()=>gn,insertDefaultBlock:()=>An,mergeBlocks:()=>Cn,moveBlockToPosition:()=>pn,moveBlocksDown:()=>cn,moveBlocksToPosition:()=>dn,moveBlocksUp:()=>un,multiSelect:()=>tn,receiveBlocks:()=>Kt,removeBlock:()=>wn,removeBlocks:()=>Sn,replaceBlock:()=>sn,replaceBlocks:()=>ln,replaceInnerBlocks:()=>Bn,resetBlocks:()=>Wt,resetSelection:()=>jt,selectBlock:()=>Zt,selectNextBlock:()=>Xt,selectPreviousBlock:()=>Qt,selectionChange:()=>Mn,setBlockMovingClientId:()=>Un,setBlockVisibility:()=>Zn,setHasControlledInnerBlocks:()=>Yn,setNavigationMode:()=>Gn,setTemplateValidity:()=>vn,showInsertionPoint:()=>hn,startDraggingBlocks:()=>Nn,startMultiSelect:()=>Jt,startTyping:()=>xn,stopDraggingBlocks:()=>Pn,stopMultiSelect:()=>en,stopTyping:()=>Tn,synchronizeTemplate:()=>bn,toggleBlockHighlight:()=>Kn,toggleBlockMode:()=>In,toggleSelection:()=>on,updateBlock:()=>Yt,updateBlockAttributes:()=>qt,updateBlockListSettings:()=>Dn,updateSettings:()=>On,validateBlocksToTemplate:()=>$t});const 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}));const s=window.wp.element;var a=n(4403),c=n.n(a);const u=window.lodash,d=window.wp.compose,p=window.wp.components,m=window.wp.data,g={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")},h=window.wp.i18n,f={insertUsage:{}},v={alignWide:!1,supportsLayout:!0,colors:[{name:(0,h.__)("Black"),slug:"black",color:"#000000"},{name:(0,h.__)("Cyan bluish gray"),slug:"cyan-bluish-gray",color:"#abb8c3"},{name:(0,h.__)("White"),slug:"white",color:"#ffffff"},{name:(0,h.__)("Pale pink"),slug:"pale-pink",color:"#f78da7"},{name:(0,h.__)("Vivid red"),slug:"vivid-red",color:"#cf2e2e"},{name:(0,h.__)("Luminous vivid orange"),slug:"luminous-vivid-orange",color:"#ff6900"},{name:(0,h.__)("Luminous vivid amber"),slug:"luminous-vivid-amber",color:"#fcb900"},{name:(0,h.__)("Light green cyan"),slug:"light-green-cyan",color:"#7bdcb5"},{name:(0,h.__)("Vivid green cyan"),slug:"vivid-green-cyan",color:"#00d084"},{name:(0,h.__)("Pale cyan blue"),slug:"pale-cyan-blue",color:"#8ed1fc"},{name:(0,h.__)("Vivid cyan blue"),slug:"vivid-cyan-blue",color:"#0693e3"},{name:(0,h.__)("Vivid purple"),slug:"vivid-purple",color:"#9b51e0"}],fontSizes:[{name:(0,h._x)("Small","font size name"),size:13,slug:"small"},{name:(0,h._x)("Normal","font size name"),size:16,slug:"normal"},{name:(0,h._x)("Medium","font size name"),size:20,slug:"medium"},{name:(0,h._x)("Large","font size name"),size:36,slug:"large"},{name:(0,h._x)("Huge","font size name"),size:42,slug:"huge"}],imageDefaultSize:"large",imageSizes:[{slug:"thumbnail",name:(0,h.__)("Thumbnail")},{slug:"medium",name:(0,h.__)("Medium")},{slug:"large",name:(0,h.__)("Large")},{slug:"full",name:(0,h.__)("Full Size")}],imageEditing:!0,maxWidth:580,allowedBlockTypes:!0,maxUploadFileSize:0,allowedMimeTypes:null,canLockBlocks:!0,__experimentalCanUserUseUnfilteredHTML:!1,__experimentalBlockDirectory:!1,__mobileEnablePageTemplates:!1,__experimentalBlockPatterns:[],__experimentalBlockPatternCategories:[],__unstableGalleryWithImageBlocks:!1,generateAnchors:!1,gradients:[{name:(0,h.__)("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,h.__)("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,h.__)("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,h.__)("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,h.__)("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,h.__)("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,h.__)("Blush light purple"),gradient:"linear-gradient(135deg,rgb(255,206,236) 0%,rgb(152,150,240) 100%)",slug:"blush-light-purple"},{name:(0,h.__)("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,h.__)("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,h.__)("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,h.__)("Electric grass"),gradient:"linear-gradient(135deg,rgb(202,248,128) 0%,rgb(113,206,126) 100%)",slug:"electric-grass"},{name:(0,h.__)("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)(Object.keys(e),Object.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 I(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 x=(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=I(o,{...o.tree,...e},n.rootClientId?[n.rootClientId]:[""],!0);break}case"UPDATE_BLOCK":o.tree=I(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=I(o,{...o.tree,...e},n.clientIds,!1);break}case"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN":{const e=B(o,n.blocks);o.tree=I(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=I(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=I(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):e.push(""),n.toRootClientId&&e.push(n.toRootClientId),o.tree=I(o,o.tree,e,!0);break}case"MOVE_BLOCKS_UP":case"MOVE_BLOCKS_DOWN":{const e=[n.rootClientId?n.rootClientId:""];o.tree=I(o,o.tree,e,!0);break}case"SAVE_REUSABLE_BLOCK_SUCCESS":{const e=Object.keys((0,u.omitBy)(o.attributes,((e,t)=>"core/block"!==o.byClientId[t].name||e.ref!==n.updatedId)));o.tree=I(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.tree={...l.tree,...(0,u.reduce)(o,((e,n,o)=>{const r=`controlled||${o}`;return t.tree[r]&&(e[r]=t.tree[r]),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:{},visibility:{}},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},visibility(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return"SET_BLOCK_VISIBILITY"===t.type?{...e,...t.updates}: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}const N=(0,m.combineReducers)({blocks:x,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},selection:function(){var e,t,n,o;let r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},l=arguments.length>1?arguments[1]:void 0;switch(l.type){case"SELECTION_CHANGE":return l.clientId?{selectionStart:{clientId:l.clientId,attributeKey:l.attributeKey,offset:l.startOffset},selectionEnd:{clientId:l.clientId,attributeKey:l.attributeKey,offset:l.endOffset}}:{selectionStart:l.start||r.selectionStart,selectionEnd:l.end||r.selectionEnd};case"RESET_SELECTION":const{selectionStart:i,selectionEnd:s}=l;return{selectionStart:i,selectionEnd:s};case"MULTI_SELECT":const{start:a,end:c}=l;return a===(null===(e=r.selectionStart)||void 0===e?void 0:e.clientId)&&c===(null===(t=r.selectionEnd)||void 0===t?void 0:t.clientId)?r:{selectionStart:{clientId:a},selectionEnd:{clientId:c}};case"RESET_BLOCKS":const u=null==r||null===(n=r.selectionStart)||void 0===n?void 0:n.clientId,d=null==r||null===(o=r.selectionEnd)||void 0===o?void 0:o.clientId;if(!u&&!d)return r;if(!l.blocks.some((e=>e.clientId===u)))return{selectionStart:{},selectionEnd:{}};if(!l.blocks.some((e=>e.clientId===d)))return{...r,selectionEnd:r.selectionStart}}return{selectionStart:T(r.selectionStart,l),selectionEnd:T(r.selectionEnd,l)}},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]:f,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"SET_BLOCK_VISIBILITY":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}});var P={};function L(e){return[e]}function R(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 M(e,t){var n,o=t||L;function r(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=function(){var e={clear:function(){e.head=null}};return e}()).isUniqueByDependants=a,s.set(P,l)),s.get(P)}function l(){n=new WeakMap}function i(){var t,n,l,i,s,a=arguments.length;for(i=new Array(a),l=0;l<a;l++)i[l]=arguments[l];for((t=r(s=o.apply(null,i))).isUniqueByDependants||(t.lastDependants&&!R(s,t.lastDependants,0)&&t.clear(),t.lastDependants=s),n=t.head;n;){if(R(n.args,i,1))return n!==t.head&&(n.prev.next=n.next,n.next&&(n.next.prev=n.prev),n.next=t.head,n.prev=null,t.head.prev=n,t.head=n),n.val;n=n.next}return n={val:e.apply(null,i)},i[0]=null,n.args=i,t.head&&(t.head.prev=n,n.next=t.head),t.head=n,n.val}return i.getDependants=o,i.clear=l,l(),i}const A=window.wp.primitives,D=(0,s.createElement)(A.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(A.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"})),O=window.wp.richText,F=window.wp.deprecated;var z=n.n(F);function V(e){const{multiline:t,__unstableMultilineWrapperTags:n,__unstablePreserveWhiteSpace:o}=e;return{multilineTag:t,multilineWrapperTags:n,preserveWhiteSpace:o}}const H=[];function G(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 U(e,t){const n=e.blocks.byClientId[t];return!!n&&n.isValid}function W(e,t){return e.blocks.byClientId[t]?e.blocks.attributes[t]:null}function $(e,t){return e.blocks.byClientId[t]?e.blocks.tree[t]:null}const j=M(((e,t)=>{const n=e.blocks.byClientId[t];return n?{...n,attributes:W(e,t)}:null}),((e,t)=>[e.blocks.byClientId[t],e.blocks.attributes[t]]));function K(e,t){var n;const o=t&&Dt(e,t)?"controlled||"+t:t||"";return(null===(n=e.blocks.tree[o])||void 0===n?void 0:n.innerBlocks)||H}const q=M(((e,t)=>({clientId:t,innerBlocks:Y(e,t)})),(e=>[e.blocks.order])),Y=M((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return(0,u.map)(Re(e,t),(t=>q(e,t)))}),(e=>[e.blocks.order])),Z=M(((e,t)=>{const n=[];for(const o of t)for(const t of Re(e,o))n.push(t,...Z(e,[t]));return n}),(e=>[e.blocks.order])),Q=M((e=>{const t=[];for(const n of Re(e))t.push(n,...Z(e,[n]));return t}),(e=>[e.blocks.order])),X=M(((e,t)=>{const n=Q(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])),J=M(((e,t)=>{if(!t)return H;const n=Q(e).filter((n=>e.blocks.byClientId[n].name===t));return n.length>0?n:H}),(e=>[e.blocks.order,e.blocks.byClientId])),ee=M(((e,t)=>(0,u.map)((0,u.castArray)(t),(t=>$(e,t)))),((e,t)=>(0,u.map)((0,u.castArray)(t),(t=>e.blocks.tree[t]))));function te(e,t){return Re(e,t).length}function ne(e){return e.selection.selectionStart}function oe(e){return e.selection.selectionEnd}function re(e){return e.selection.selectionStart.clientId}function le(e){return e.selection.selectionEnd.clientId}function ie(e){return _e(e).length||(e.selection.selectionStart.clientId?1:0)}function se(e){const{selectionStart:t,selectionEnd:n}=e.selection;return!!t.clientId&&t.clientId===n.clientId}function ae(e){const{selectionStart:t,selectionEnd:n}=e.selection,{clientId:o}=t;return o&&o===n.clientId?o:null}function ce(e){const t=ae(e);return t?$(e,t):null}function ue(e,t){return void 0!==e.blocks.parents[t]?e.blocks.parents[t]:null}const de=M((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])),pe=M((function(e,t,n){let o=arguments.length>3&&void 0!==arguments[3]&&arguments[3];const r=de(e,t,o);return(0,u.map)((0,u.filter)((0,u.map)(r,(t=>({id:t,name:G(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 me(e,t){let n,o=t;do{n=o,o=e.blocks.parents[o]}while(o);return n}function ge(e,t){const n=ae(e),o=[...de(e,t),t],r=[...de(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 he(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;if(void 0===t&&(t=ae(e)),void 0===t&&(t=n<0?Ee(e):Ce(e)),!t)return null;const o=ue(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 he(e,t,-1)}function ve(e,t){return he(e,t,1)}function be(e){return e.initialPosition}const ke=M((e=>{const{selectionStart:t,selectionEnd:n}=e.selection;if(void 0===t.clientId||void 0===n.clientId)return H;if(t.clientId===n.clientId)return[t.clientId];const o=ue(e,t.clientId);if(null===o)return H;const r=Re(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 _e(e){const{selectionStart:t,selectionEnd:n}=e.selection;return t.clientId===n.clientId?H:ke(e)}const ye=M((e=>{const t=_e(e);return t.length?t.map((t=>$(e,t))):H}),(e=>[...ke.getDependants(e),e.blocks.byClientId,e.blocks.order,e.blocks.attributes]));function Ee(e){return(0,u.first)(_e(e))||null}function Ce(e){return(0,u.last)(_e(e))||null}function Se(e,t){return Ee(e)===t}function we(e,t){return-1!==_e(e).indexOf(t)}const Be=M(((e,t)=>{let n=t,o=!1;for(;n&&!o;)n=ue(e,n),o=we(e,n);return o}),(e=>[e.blocks.order,e.selection.selectionStart.clientId,e.selection.selectionEnd.clientId]));function Ie(e){const{selectionStart:t,selectionEnd:n}=e.selection;return t.clientId===n.clientId?null:t.clientId||null}function xe(e){const{selectionStart:t,selectionEnd:n}=e.selection;return t.clientId===n.clientId?null:n.clientId||null}function Te(e){const t=ne(e),n=oe(e);return!t.attributeKey&&!n.attributeKey&&void 0===t.offset&&void 0===n.offset}function Ne(e){const t=ne(e),n=oe(e);return!!t&&!!n&&t.clientId===n.clientId&&t.attributeKey===n.attributeKey&&t.offset===n.offset}function Pe(e,t){const n=ne(e),o=oe(e);if(n.clientId===o.clientId)return!1;if(!n.attributeKey||!o.attributeKey||void 0===n.offset||void 0===o.offset)return!1;const l=ue(e,n.clientId);if(l!==ue(e,o.clientId))return!1;const i=Re(e,l);let s,a;i.indexOf(n.clientId)>i.indexOf(o.clientId)?(s=o,a=n):(s=n,a=o);const c=t?a.clientId:s.clientId,u=t?s.clientId:a.clientId,d=$(e,c);if(!(0,r.getBlockType)(d.name).merge)return!1;const p=$(e,u);if(p.name===d.name)return!0;const m=(0,r.switchToBlockType)(p,d.name);return m&&m.length}const Le=e=>{const t=ne(e),n=oe(e);if(t.clientId===n.clientId)return H;if(!t.attributeKey||!n.attributeKey||void 0===t.offset||void 0===n.offset)return H;const o=ue(e,t.clientId);if(o!==ue(e,n.clientId))return H;const l=Re(e,o),i=l.indexOf(t.clientId),s=l.indexOf(n.clientId),[a,c]=i>s?[n,t]:[t,n],u=$(e,a.clientId),d=(0,r.getBlockType)(u.name),p=$(e,c.clientId),m=(0,r.getBlockType)(p.name),g=u.attributes[a.attributeKey],h=p.attributes[c.attributeKey],f=d.attributes[a.attributeKey],v=m.attributes[c.attributeKey];let b=(0,O.create)({html:g,...V(f)}),k=(0,O.create)({html:h,...V(v)});return b=(0,O.remove)(b,0,a.offset),k=(0,O.remove)(k,c.offset,k.text.length),[{...u,attributes:{...u.attributes,[a.attributeKey]:(0,O.toHTMLString)({value:b,...V(f)})}},{...p,attributes:{...p.attributes,[c.attributeKey]:(0,O.toHTMLString)({value:k,...V(v)})}}]};function Re(e,t){return e.blocks.order[t||""]||H}function Me(e,t){return Re(e,ue(e,t)).indexOf(t)}function Ae(e,t){const{selectionStart:n,selectionEnd:o}=e.selection;return n.clientId===o.clientId&&n.clientId===t}function De(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return(0,u.some)(Re(e,t),(t=>Ae(e,t)||we(e,t)||n&&De(e,t,n)))}function Oe(e,t){if(!t)return!1;const n=_e(e),o=n.indexOf(t);return o>-1&&o<n.length-1}function Fe(e){const{selectionStart:t,selectionEnd:n}=e.selection;return t.clientId!==n.clientId}function ze(e){return e.isMultiSelecting}function Ve(e){return e.isSelectionEnabled}function He(e,t){return e.blocksMode[t]||"visual"}function Ge(e){return e.isTyping}function Ue(e){return!!e.draggedBlocks.length}function We(e){return e.draggedBlocks}function $e(e,t){return e.draggedBlocks.includes(t)}function je(e,t){if(!Ue(e))return!1;const n=de(e,t);return(0,u.some)(n,(t=>$e(e,t)))}function Ke(){return z()('wp.data.select( "core/block-editor" ).isCaretWithinFormattedText',{since:"6.1",version:"6.3"}),!1}function qe(e){let t,n;const{insertionPoint:o,selection:{selectionEnd:r}}=e;if(null!==o)return o;const{clientId:l}=r;return l?(t=ue(e,l)||void 0,n=Me(e,r.clientId)+1):n=Re(e).length,{rootClientId:t,index:n}}function Ye(e){return null!==e.insertionPoint}function Ze(e){return e.template.isValid}function Qe(e){return e.settings.template}function Xe(e,t){if(!t)return e.settings.templateLock;const n=St(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:Array.isArray(e)?!(!e.includes("core/post-content")||null!==t)||e.includes(t):n},et=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}=wt(e),s=Je(i,t,!0);if(!s)return!1;const a=!!Xe(e,o);if(a)return!1;const c=St(e,o);if(o&&void 0===c)return!1;const d=null==c?void 0:c.allowedBlocks,p=Je(d,t),m=n.parent,g=G(e,o),h=Je(m,g);let f=!0;const v=n.ancestor;if(v){const t=[o,...de(e,o)];f=(0,u.some)(t,(t=>Je(v,G(e,t))))}const b=f&&(null===p&&null===h||!0===p||!0===h);return b?(0,l.applyFilters)("blockEditor.__unstableCanInsertBlockType",b,n,o,{getBlock:$.bind(null,e),getBlockParentsByBlockName:pe.bind(null,e)}):b},tt=M(et,((e,t,n)=>[e.blockListSettings[n],e.blocks.byClientId[n],e.settings.allowedBlockTypes,e.settings.templateLock]));function nt(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return t.every((t=>tt(e,G(e,t),n)))}function ot(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;const o=W(e,t);if(null===o)return!0;const{lock:r}=o,l=!!Xe(e,n);return void 0===r||void 0===(null==r?void 0:r.remove)?!l:!(null!=r&&r.remove)}function rt(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return t.every((t=>ot(e,t,n)))}function lt(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;const o=W(e,t);if(null===o)return;const{lock:r}=o,l="all"===Xe(e,n);return void 0===r||void 0===(null==r?void 0:r.move)?!l:!(null!=r&&r.move)}function it(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return t.every((t=>lt(e,t,n)))}function st(e,t){const n=W(e,t);if(null===n)return!0;const{lock:o}=n;return!(null!=o&&o.edit)}function at(e,t){var n;return!!(0,r.hasBlockSupport)(t,"lock",!0)&&!(null===(n=e.settings)||void 0===n||!n.canLockBlocks)}function ct(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 ut=(e,t,n)=>!!(0,r.hasBlockSupport)(t,"inserter",!0)&&et(e,t.name,n),dt=(e,t)=>n=>{const o=`${t.id}/${n.name}`,{time:r,count:l=0}=ct(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:pt(r,l)}},pt=(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}},mt=(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)(ee(e,Q(e)),{name:t.name}));const{time:i,count:s=0}=ct(e,o)||{},a={id:o,name:t.name,title:t.title,icon:t.icon,isDisabled:l,frecency:pt(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}}},gt=M((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const n=mt(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=D;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}=ct(e,l)||{},c=pt(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=>ut(e,n,t))).map(n),a=et(e,"core/block",t)?Pt(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=dt(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,Pt(e),(0,r.getBlockTypes)()])),ht=M((function(e,t){var n;let o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;const l=(0,u.castArray)(t),[i]=l,s=mt(e,{buildScope:"transform"}),a=(0,r.getBlockTypes)().filter((t=>ut(e,t,o))).map(s),c=(0,u.mapKeys)(a,(e=>{let{name:t}=e;return t}));c["*"]={frecency:1/0,id:"*",isDisabled:!1,name:"*",title:(0,h.__)("Unwrap"),icon:null===(n=c[null==i?void 0:i.name])||void 0===n?void 0:n.icon};const d=(0,r.getPossibleBlockTransformations)(l).reduce(((e,t)=>("*"===t?e.push(c["*"]):c[null==t?void 0:t.name]&&e.push(c[t.name]),e)),[]);return(0,u.orderBy)(d,(e=>c[e.name].frecency),"desc")}),((e,t)=>[e.blockListSettings[t],e.blocks.byClientId,e.preferences.insertUsage,e.settings.allowedBlockTypes,e.settings.templateLock,(0,r.getBlockTypes)()])),ft=M((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const n=(0,u.some)((0,r.getBlockTypes)(),(n=>ut(e,n,t)));if(n)return!0;const o=et(e,"core/block",t)&&Pt(e).length>0;return o}),((e,t)=>[e.blockListSettings[t],e.blocks.byClientId,e.settings.allowedBlockTypes,e.settings.templateLock,Pt(e),(0,r.getBlockTypes)()])),vt=M((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(t)return(0,u.filter)((0,r.getBlockTypes)(),(n=>ut(e,n,t)))}),((e,t)=>[e.blockListSettings[t],e.blocks.byClientId,e.settings.allowedBlockTypes,e.settings.templateLock,(0,r.getBlockTypes)()])),bt=M((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($(e,o))?r:null:r:void 0}),((e,t)=>[e.blockListSettings[t],e.blocks.tree[t]])),kt=M(((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])),_t=M((e=>{const t=e.settings.__experimentalBlockPatterns,{allowedBlockTypes:n}=wt(e);return t.filter((e=>{let{inserter:t=!0}=e;return!!t})).map((t=>{let{name:n}=t;return kt(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])),yt=M((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const n=_t(e),o=(0,u.filter)(n,(n=>{let{blocks:o}=n;return o.every((n=>{let{name:o}=n;return tt(e,o,t)}))}));return o}),((e,t)=>[e.settings.__experimentalBlockPatterns,e.settings.allowedBlockTypes,e.settings.templateLock,e.blockListSettings[t],e.blocks.byClientId[t]])),Et=M((function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(!t)return H;const o=yt(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)=>[...yt.getDependants(e,t)])),Ct=M((function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(!t)return H;if(t.some((t=>{let{clientId:n,innerBlocks:o}=t;return o.length||Dt(e,n)})))return H;const o=Array.from(new Set(t.map((e=>{let{name:t}=e;return t}))));return Et(e,o,n)}),((e,t)=>[...Et.getDependants(e,t)]));function St(e,t){return e.blockListSettings[t]}function wt(e){return e.settings}function Bt(e){return e.blocks.isPersistentChange}const It=M((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])),xt=M(((e,t)=>{var n;const o=(0,u.find)(Pt(e),(e=>e.id===t));return o?null===(n=o.title)||void 0===n?void 0:n.raw:null}),(e=>[Pt(e)]));function Tt(e){return e.blocks.isIgnoredChange}function Nt(e){return e.lastBlockAttributesChange}function Pt(e){var t,n;return null!==(t=null==e||null===(n=e.settings)||void 0===n?void 0:n.__experimentalReusableBlocks)&&void 0!==t?t:H}function Lt(e){return e.isNavigationMode}function Rt(e){return e.hasBlockMovingClientId}function Mt(e){return!!e.automaticChangeStatus}function At(e,t){return e.highlightedBlock===t}function Dt(e,t){return!!e.blocks.controlledInnerBlocks[t]}const Ot=M(((e,t)=>{if(!t.length)return null;const n=ae(e);if(t.includes(G(e,n)))return n;const o=_e(e),r=pe(e,n||o[0],t);return r?(0,u.last)(r):null}),((e,t)=>[e.selection.selectionStart.clientId,e.selection.selectionEnd.clientId,t]));function Ft(e,t,n){const{lastBlockInserted:o}=e;return o.clientId===t&&o.source===n}function zt(e,t){var n,o;return null===(n=null===(o=e.blocks.visibility)||void 0===o?void 0:o[t])||void 0===n||n}const Vt=M((e=>new Set(Object.keys(e.blocks.visibility).filter((t=>e.blocks.visibility[t])))),(e=>[e.blocks.visibility])),Ht=window.wp.a11y,Gt="†";function Ut(e){if(e)return Object.keys(e).find((t=>{const n=e[t];return"string"==typeof n&&-1!==n.indexOf(Gt)}))}const Wt=e=>t=>{let{dispatch:n}=t;n({type:"RESET_BLOCKS",blocks:e}),n($t(e))},$t=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 jt(e,t,n){return{type:"RESET_SELECTION",selectionStart:e,selectionEnd:t,initialPosition:n}}function Kt(e){return z()('wp.data.dispatch( "core/block-editor" ).receiveBlocks',{since:"5.9",alternative:"resetBlocks or insertBlocks"}),{type:"RECEIVE_BLOCKS",blocks:e}}function qt(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 Yt(e,t){return{type:"UPDATE_BLOCK",clientId:e,updates:t}}function Zt(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return{type:"SELECT_BLOCK",initialPosition:t,clientId:e}}const Qt=e=>t=>{let{select:n,dispatch:o}=t;const r=n.getPreviousBlockClientId(e);r&&o.selectBlock(r,-1)},Xt=e=>t=>{let{select:n,dispatch:o}=t;const r=n.getNextBlockClientId(e);r&&o.selectBlock(r)};function Jt(){return{type:"START_MULTI_SELECT"}}function en(){return{type:"STOP_MULTI_SELECT"}}const tn=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,Ht.speak)((0,h.sprintf)(
2
  /* translators: %s: number of selected blocks */
3
- (0,h._n)("%s block selected.","%s blocks selected.",i),i),"assertive")}};function nn(){return{type:"CLEAR_SELECTED_BLOCK"}}function on(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return{type:"TOGGLE_SELECTION",isSelectionEnabled:e}}function rn(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 ln=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=rn((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 sn(e,t){return ln(e,t)}const an=e=>(t,n)=>o=>{let{select:r,dispatch:l}=o;r.canMoveBlocks(t,n)&&l({type:e,clientIds:(0,u.castArray)(t),rootClientId:n})},cn=an("MOVE_BLOCKS_DOWN"),un=an("MOVE_BLOCKS_UP"),dn=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 pn(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 dn([e],t,n,o)}function mn(e,t,n,o,r){return gn([e],t,n,o,0,r)}const gn=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,z()("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=rn((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 hn(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 fn(){return{type:"HIDE_INSERTION_POINT"}}function vn(e){return{type:"SET_TEMPLATE_VALIDITY",isValid:e}}const bn=()=>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)},kn=e=>t=>{let{registry:n,select:o,dispatch:l}=t;const i=o.getSelectionStart(),s=o.getSelectionEnd();if(i.clientId===s.clientId)return;if(!i.attributeKey||!s.attributeKey||void 0===i.offset||void 0===s.offset)return!1;const a=o.getBlockRootClientId(i.clientId);if(a!==o.getBlockRootClientId(s.clientId))return;const c=o.getBlockOrder(a);let u,d;c.indexOf(i.clientId)>c.indexOf(s.clientId)?(u=s,d=i):(u=i,d=s);const p=e?d:u,m=o.getBlock(p.clientId),g=(0,r.getBlockType)(m.name);if(!g.merge)return;const h=u,f=d,v=o.getBlock(h.clientId),b=(0,r.getBlockType)(v.name),k=o.getBlock(f.clientId),_=(0,r.getBlockType)(k.name),y=v.attributes[h.attributeKey],E=k.attributes[f.attributeKey],C=b.attributes[h.attributeKey],S=_.attributes[f.attributeKey];let w=(0,O.create)({html:y,...V(C)}),B=(0,O.create)({html:E,...V(S)});w=(0,O.remove)(w,h.offset,w.text.length),B=(0,O.insert)(B,Gt,0,f.offset);const I=(0,r.cloneBlock)(v,{[h.attributeKey]:(0,O.toHTMLString)({value:w,...V(C)})}),x=(0,r.cloneBlock)(k,{[f.attributeKey]:(0,O.toHTMLString)({value:B,...V(S)})}),T=e?I:x,N=v.name===k.name?[T]:(0,r.switchToBlockType)(T,g.name);if(!N||!N.length)return;let P;if(e){const e=N.pop();P=g.merge(e.attributes,x.attributes)}else{const e=N.shift();P=g.merge(I.attributes,e.attributes)}const L=Ut(P),R=P[L],M=(0,O.create)({html:R,...V(g.attributes[L])}),A=M.text.indexOf(Gt),D=(0,O.remove)(M,A,A+1),F=(0,O.toHTMLString)({value:D,...V(g.attributes[L])});P[L]=F;const z=o.getSelectedBlockClientIds(),H=[...e?N:[],{...m,attributes:{...m.attributes,...P}},...e?[]:N];n.batch((()=>{l.selectionChange(m.clientId,L,A,A),l.replaceBlocks(z,H,0,o.getSelectedBlocksInitialCaretPosition())}))},yn=()=>e=>{let{select:t,dispatch:n}=e;const o=t.getSelectionStart(),l=t.getSelectionEnd();if(o.clientId===l.clientId)return;if(!o.attributeKey||!l.attributeKey||void 0===o.offset||void 0===l.offset)return;const i=t.getBlockRootClientId(o.clientId);if(i!==t.getBlockRootClientId(l.clientId))return;const s=t.getBlockOrder(i);let a,c;s.indexOf(o.clientId)>s.indexOf(l.clientId)?(a=l,c=o):(a=o,c=l);const u=a,d=c,p=t.getBlock(u.clientId),m=(0,r.getBlockType)(p.name),g=t.getBlock(d.clientId),h=(0,r.getBlockType)(g.name),f=p.attributes[u.attributeKey],v=g.attributes[d.attributeKey],b=m.attributes[u.attributeKey],k=h.attributes[d.attributeKey];let _=(0,O.create)({html:f,...V(b)}),y=(0,O.create)({html:v,...V(k)});_=(0,O.remove)(_,u.offset,_.text.length),y=(0,O.remove)(y,0,d.offset),n.replaceBlocks(t.getSelectedBlockClientIds(),[{...p,attributes:{...p.attributes,[u.attributeKey]:(0,O.toHTMLString)({value:_,...V(b)})}},(0,r.createBlock)((0,r.getDefaultBlockName)()),{...g,attributes:{...g.attributes,[d.attributeKey]:(0,O.toHTMLString)({value:y,...V(k)})}}],1,t.getSelectedBlocksInitialCaretPosition())},En=()=>e=>{let{select:t,dispatch:n}=e;const o=t.getSelectionStart(),r=t.getSelectionEnd();n.selectionChange({start:{clientId:o.clientId},end:{clientId:r.clientId}})},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),u=(0,r.getBlockType)(c.name);if(u&&!u.merge)return void l.selectBlock(c.clientId);const d=o.getBlock(a),p=(0,r.getBlockType)(d.name),{clientId:m,attributeKey:g,offset:h}=o.getSelectionStart(),f=(m===s?u:p).attributes[g],v=(m===s||m===a)&&void 0!==g&&void 0!==h&&!!f;f||("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 b=(0,r.cloneBlock)(c),k=(0,r.cloneBlock)(d);if(v){const e=m===s?b:k,t=e.attributes[g],n=(0,O.insert)((0,O.create)({html:t,...V(f)}),Gt,h,h);e.attributes[g]=(0,O.toHTMLString)({value:n,...V(f)})}const _=c.name===d.name?[k]:(0,r.switchToBlockType)(k,c.name);if(!_||!_.length)return;const y=u.merge(b.attributes,_[0].attributes);if(v){const e=Ut(y),t=y[e],n=(0,O.create)({html:t,...V(u.attributes[e])}),o=n.text.indexOf(Gt),r=(0,O.remove)(n,o,o+1),i=(0,O.toHTMLString)({value:r,...V(u.attributes[e])});y[e]=i,l.selectionChange(c.clientId,e,o,o)}l.replaceBlocks([c.clientId,d.clientId],[{...c,attributes:{...c.attributes,...y}},..._.slice(1)],0)},Sn=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 wn(e,t){return Sn([e],t)}function Bn(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 In(e){return{type:"TOGGLE_BLOCK_MODE",clientId:e}}function xn(){return{type:"START_TYPING"}}function Tn(){return{type:"STOP_TYPING"}}function Nn(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return{type:"START_DRAGGING_BLOCKS",clientIds:e}}function Pn(){return{type:"STOP_DRAGGING_BLOCKS"}}function Ln(){return z()('wp.data.dispatch( "core/block-editor" ).enterFormattedText',{since:"6.1",version:"6.3"}),{type:"DO_NOTHING"}}function Rn(){return z()('wp.data.dispatch( "core/block-editor" ).exitFormattedText',{since:"6.1",version:"6.3"}),{type:"DO_NOTHING"}}function Mn(e,t,n,o){return"string"==typeof e?{type:"SELECTION_CHANGE",clientId:e,attributeKey:t,startOffset:n,endOffset:o}:{type:"SELECTION_CHANGE",...e}}const An=(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 Dn(e,t){return{type:"UPDATE_BLOCK_LIST_SETTINGS",clientId:e,settings:t}}function On(e){return{type:"UPDATE_SETTINGS",settings:e}}function Fn(e,t){return{type:"SAVE_REUSABLE_BLOCK_SUCCESS",id:e,updatedId:t}}function zn(){return{type:"MARK_LAST_CHANGE_AS_PERSISTENT"}}function Vn(){return{type:"MARK_NEXT_CHANGE_AS_NOT_PERSISTENT"}}const Hn=()=>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"})}))},Gn=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,Ht.speak)((0,h.__)("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,Ht.speak)((0,h.__)("You are currently in edit mode. To return to the navigation mode, press Escape."))}},Un=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,Ht.speak)((0,h.__)("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."))}},Wn=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))}},$n=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)},jn=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 Kn(e,t){return{type:"TOGGLE_BLOCK_HIGHLIGHT",clientId:e,isHighlighted:t}}const qn=e=>async t=>{let{dispatch:n}=t;n(Kn(e,!0)),await new Promise((e=>setTimeout(e,150))),n(Kn(e,!1))};function Yn(e,t){return{type:"SET_HAS_CONTROLLED_INNER_BLOCKS",hasControlledInnerBlocks:t,clientId:e}}function Zn(e){return{type:"SET_BLOCK_VISIBILITY",updates:e}}const Qn="core/block-editor",Xn={reducer:N,selectors:e,actions:t},Jn=(0,m.createReduxStore)(Qn,{...Xn,persist:["preferences"]});(0,m.registerStore)(Qn,{...Xn,persist:["preferences"]});const eo={name:"",isSelected:!1},to=(0,s.createContext)(eo),{Provider:no}=to;function oo(){return(0,s.useContext)(to)}function ro(){const{isSelected:e,clientId:t,name:n}=oo();return(0,m.useSelect)((o=>{if(e)return!0;const{getBlockName:r,isFirstMultiSelectedBlock:l,getMultiSelectedBlockClientIds:i}=o(Jn);return!!l(t)&&i().every((e=>r(e)===n))}),[t,e,n])}function lo(e){let{group:t="default",controls:n,children:o,__experimentalShareWithChildBlocks:l=!1}=e;const i=function(e,t){const n=ro(),{clientId:o}=oo(),l=(0,m.useSelect)((e=>{const{getBlockName:n,hasSelectedInnerBlock:l}=e(Jn),{hasBlockSupport:i}=e(r.store);return t&&i(n(o),"__experimentalExposeControlsToChildren",!1)&&l(o)}),[t,o]);var i;return n?null===(i=g[e])||void 0===i?void 0:i.Fill:l?g.parent.Fill:null}(t,l);return i?(0,s.createElement)(p.__experimentalStyleProvider,{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 io(e){let{group:t="default",...n}=e;const o=(0,s.useContext)(p.__experimentalToolbarContext),r=g[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 so=lo;so.Slot=io;const ao=e=>(0,s.createElement)(lo,i({group:"inline"},e));ao.Slot=e=>(0,s.createElement)(io,i({group:"inline"},e));const co=so,uo=(0,s.createElement)(A.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(A.Path,{d:"M9 9v6h11V9H9zM4 20h1.5V4H4v16z"})),po=(0,s.createElement)(A.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(A.Path,{d:"M20 9h-7.2V4h-1.6v5H4v6h7.2v5h1.6v-5H20z"})),mo=(0,s.createElement)(A.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(A.Path,{d:"M4 15h11V9H4v6zM18.5 4v16H20V4h-1.5z"})),go=(0,s.createElement)(A.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(A.Path,{d:"M9 15h6V9H9v6zm-5 5h1.5V4H4v16zM18.5 4v16H20V4h-1.5z"})),ho=(0,s.createElement)(A.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(A.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"})),fo=(0,s.createElement)(A.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(A.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 vo(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return e.split(",").map((e=>`.editor-styles-wrapper ${e} ${t}`)).join(",")}const bo=(0,s.createContext)({refs:new Map,callbacks:new Map});function ko(e){let{children:t}=e;const n=(0,s.useMemo)((()=>({refs:new Map,callbacks:new Map})),[]);return(0,s.createElement)(bo.Provider,{value:n},t)}function _o(e){const{refs:t,callbacks:n}=(0,s.useContext)(bo),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 yo(e){const{refs:t}=(0,s.useContext)(bo),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 Eo(e){const{callbacks:t}=(0,s.useContext)(bo),n=yo(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 Co=["color","border","typography","spacing"],So={"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},wo={"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 Bo(e){const{name:t,clientId:n}=oo();return(0,m.useSelect)((o=>{if(Co.includes(e))return void console.warn("Top level useSetting paths are disabled. Please use a subpath to query the information needed.");let l;const i=(e=>wo[e]||e)(e);[...o(Jn).getBlockParents(n),n].forEach((e=>{const n=o(Jn).getBlockName(e);if((0,r.hasBlockSupport)(n,"__experimentalSettings",!1)){var s;const n=o(Jn).getBlockAttributes(e),r=null!==(s=(0,u.get)(n,`settings.blocks.${t}.${i}`))&&void 0!==s?s:(0,u.get)(n,`settings.${i}`);void 0!==r&&(l=r)}}));const s=o(Jn).getSettings();if(void 0===l){var a;const e=`__experimentalFeatures.${i}`,n=`__experimentalFeatures.blocks.${t}.${i}`;l=null!==(a=(0,u.get)(s,n))&&void 0!==a?a:(0,u.get)(s,e)}var c,d;if(void 0!==l)return r.__EXPERIMENTAL_PATHS_WITH_MERGE[i]?null!==(c=null!==(d=l.custom)&&void 0!==d?d:l.theme)&&void 0!==c?c:l.default:l;const p=So[i]?So[i](s):void 0;return void 0!==p?p:"typography.dropCap"===i||void 0}),[t,n,e])}window.wp.warning;const Io={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 xo(e){var t;let{__experimentalGroup:n="default",children:o}=e;const r=ro(),l=null===(t=Io[n])||void 0===t?void 0:t.Fill;return l?r?(0,s.createElement)(p.__experimentalStyleProvider,{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 To=e=>{if(!(0,u.isObject)(e)||Array.isArray(e))return e;const t=(0,u.pickBy)((0,u.mapValues)(e,To),u.identity);return(0,u.isEmpty)(t)?void 0:t};function No(e,t,n){return(0,u.setWith)(e?(0,u.clone)(e):{},t,n,u.clone)}function Po(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:No(c.attributes,e,t)})}))})),c}function Lo(e,t,n){const o=(0,r.getBlockSupport)(e,t),l=null==o?void 0:o.__experimentalSkipSerialization;return Array.isArray(l)?l.includes(n):l}function Ro(e){let{children:t,group:n,label:o}=e;const{updateBlockAttributes:r}=(0,m.useDispatch)(Jn),{getBlockAttributes:l,getMultiSelectedBlockClientIds:i,getSelectedBlockClientId:a,hasMultiSelection:c}=(0,m.useSelect)(Jn),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:To(r.style)},t[n]=r})),r(n,t,!0)}),[To,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 Mo(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 Ao(e){var t;let{__experimentalGroup:n="default",label:o,...r}=e;const l=null===(t=Io[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)(Ro,{group:n,label:o},(0,s.createElement)(Mo,i({},r,{Slot:l}))):(0,s.createElement)(l,i({},r,{bubblesVirtually:!0})):null:("undefined"!=typeof process&&process.env,null)}const Do=xo;Do.Slot=Ao;const Oo=e=>(0,s.createElement)(xo,i({},e,{__experimentalGroup:"advanced"}));Oo.Slot=e=>(0,s.createElement)(Ao,i({},e,{__experimentalGroup:"advanced"})),Oo.slotName="InspectorAdvancedControls";const Fo=Do,zo=window.wp.isShallowEqual;var Vo=n.n(zo);const Ho=function(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])};function Go(e){let{clientId:t,bottomClientId:n,children:o,__unstableRefreshSize:r,__unstableCoverTarget:l=!1,__unstablePopoverSlot:a,__unstableContentRef:u,...d}=e;const m=Eo(t),g=Eo(null!=n?n:t),h=Ho(u),f=(0,s.useMemo)((()=>m&&g===m?{position:"absolute",width:m.offsetWidth,height:m.offsetHeight}:{}),[m,g,r]);if(!m||n&&!g)return null;const v={top:m,bottom:g};return(0,s.createElement)(p.Popover,i({ref:h,animate:!1,position:"top right left",focusOnMount:!1,anchorRef:v,__unstableSlotName:a||null,__unstableObserveElement:m,__unstableForcePosition:!0,__unstableShift:!0},d,{className:c()("block-editor-block-popover",d.className)}),l&&(0,s.createElement)("div",{style:f},o),!l&&o)}function Uo(e){const t=(0,r.getBlockSupport)(e,Qo);return!!(!0===t||null!=t&&t.margin)}function Wo(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!Bo("spacing.margin"),n=!or(e,"margin");return!Uo(e)||t||n}function $o(e){var t;const{name:n,attributes:{style:o},setAttributes:r}=e,l=(0,p.__experimentalUseCustomUnits)({availableUnits:Bo("spacing.units")||["%","px","em","rem","vw"]}),i=nr(n,"margin"),a=i&&i.some((e=>Jo.includes(e)));return Wo(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:To(t)})},label:(0,h.__)("Margin"),sides:i,units:l,allowReset:!1,splitOnAxis:a})),native:null})}function jo(e){var t,n;let{clientId:o,attributes:r}=e;const l=null==r||null===(t=r.style)||void 0===t||null===(n=t.spacing)||void 0===n?void 0:n.margin,i=(0,s.useMemo)((()=>{var e,t,n,o;return{borderTopWidth:null!==(e=null==l?void 0:l.top)&&void 0!==e?e:0,borderRightWidth:null!==(t=null==l?void 0:l.right)&&void 0!==t?t:0,borderBottomWidth:null!==(n=null==l?void 0:l.bottom)&&void 0!==n?n:0,borderLeftWidth:null!==(o=null==l?void 0:l.left)&&void 0!==o?o:0,top:null!=l&&l.top?`-${l.top}`:0,right:null!=l&&l.right?`-${l.right}`:0,bottom:null!=l&&l.bottom?`-${l.bottom}`:0,left:null!=l&&l.left?`-${l.left}`:0}}),[l]),[a,c]=(0,s.useState)(!1),u=(0,s.useRef)(l),d=(0,s.useRef)(),p=()=>{d.current&&window.clearTimeout(d.current)};return(0,s.useEffect)((()=>(Vo()(l,u.current)||(c(!0),u.current=l,p(),d.current=setTimeout((()=>{c(!1)}),400)),()=>p())),[l]),a?(0,s.createElement)(Go,{clientId:o,__unstableCoverTarget:!0,__unstableRefreshSize:l},(0,s.createElement)("div",{className:"block-editor__padding-visualizer",style:i})):null}function Ko(e){const t=(0,r.getBlockSupport)(e,Qo);return!!(!0===t||null!=t&&t.padding)}function qo(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!Bo("spacing.padding"),n=!or(e,"padding");return!Ko(e)||t||n}function Yo(e){var t;const{name:n,attributes:{style:o},setAttributes:r}=e,l=(0,p.__experimentalUseCustomUnits)({availableUnits:Bo("spacing.units")||["%","px","em","rem","vw"]}),i=nr(n,"padding"),a=i&&i.some((e=>Jo.includes(e)));return qo(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:To(t)})},label:(0,h.__)("Padding"),sides:i,units:l,allowReset:!1,splitOnAxis:a})),native:null})}function Zo(e){var t,n;let{clientId:o,attributes:r}=e;const l=null==r||null===(t=r.style)||void 0===t||null===(n=t.spacing)||void 0===n?void 0:n.padding,i=(0,s.useMemo)((()=>{var e,t,n,o;return{borderTopWidth:null!==(e=null==l?void 0:l.top)&&void 0!==e?e:0,borderRightWidth:null!==(t=null==l?void 0:l.right)&&void 0!==t?t:0,borderBottomWidth:null!==(n=null==l?void 0:l.bottom)&&void 0!==n?n:0,borderLeftWidth:null!==(o=null==l?void 0:l.left)&&void 0!==o?o:0}}),[l]),[a,c]=(0,s.useState)(!1),u=(0,s.useRef)(l),d=(0,s.useRef)(),p=()=>{d.current&&window.clearTimeout(d.current)};return(0,s.useEffect)((()=>(Vo()(l,u.current)||(c(!0),u.current=l,p(),d.current=setTimeout((()=>{c(!1)}),400)),()=>p())),[l]),a?(0,s.createElement)(Go,{clientId:o,__unstableCoverTarget:!0,__unstableRefreshSize:l},(0,s.createElement)("div",{className:"block-editor__padding-visualizer",style:i})):null}const Qo="spacing",Xo=["top","right","bottom","left"],Jo=["vertical","horizontal"];function er(e){const t=ir(e),n=qo(e),o=Wo(e),l=tr(e),i=(a=e.name,"web"===s.Platform.OS&&(rr(a)||Ko(a)||Uo(a)));var a;if(l||!i)return null;const c=(0,r.getBlockSupport)(e.name,[Qo,"__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)(s.Fragment,null,(0,s.createElement)(Fo,{__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,h.__)("Padding"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:To({...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)(Yo,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,h.__)("Margin"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:To({...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)($o,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,h.__)("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)(sr,e))),!n&&(0,s.createElement)(Zo,e),!o&&(0,s.createElement)(jo,e))}const tr=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=ir(e),n=qo(e),o=Wo(e);return t&&n&&o};function nr(e,t){var n;const o=(0,r.getBlockSupport)(e,Qo);if(o&&"boolean"!=typeof o[t])return Array.isArray(o[t])?o[t]:null!==(n=o[t])&&void 0!==n&&n.sides?o[t].sides:void 0}function or(e,t){const n=nr(e,t);return!(n&&n.some((e=>Xo.includes(e)))&&n.some((e=>Jo.includes(e)))&&(console.warn(`The ${t} support for the "${e}" block can not be configured to support both axial and arbitrary sides.`),1))}function rr(e){const t=(0,r.getBlockSupport)(e,Qo);return!!(!0===t||null!=t&&t.blockGap)}function lr(e){if(!e)return null;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 ir(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!Bo("spacing.blockGap");return!rr(e)||t}function sr(e){var t;const{clientId:n,attributes:{style:o},name:r,setAttributes:l}=e,i=(0,p.__experimentalUseCustomUnits)({availableUnits:Bo("spacing.units")||["%","px","em","rem","vw"]}),a=nr(r,"blockGap"),c=yo(n);if(ir(e))return null;const u=a&&a.some((e=>Jo.includes(e))),d=e=>{var t;let n=e;e&&u&&(n={...lr(e)});const r={...o,spacing:{...null==o?void 0:o.spacing,blockGap:n}};l({style:To(r)});const i=(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;c.current&&i&&(null===(s=c.current.parentNode)||void 0===s||s.replaceChild(c.current,c.current))},m=lr(null==o||null===(t=o.spacing)||void 0===t?void 0:t.blockGap),g=u?{...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,u?(0,s.createElement)(p.__experimentalBoxControl,{label:(0,h.__)("Block spacing"),min:0,onChange:d,units:i,sides:a,values:g,allowReset:!1,splitOnAxis:u}):(0,s.createElement)(p.__experimentalUnitControl,{label:(0,h.__)("Block spacing"),__unstableInputWidth:"80px",min:0,onChange:d,units:i,value:g})),native:null})}const ar=(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"})),cr=(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"})),ur={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,h._x)("Align top","Block vertical alignment setting")},center:{icon:cr,title:(0,h._x)("Align middle","Block vertical alignment setting")},bottom:{icon:ar,title:(0,h._x)("Align bottom","Block vertical alignment setting")}},dr=["top","center","bottom"],pr={isAlternate:!0},mr=function(e){let{value:t,onChange:n,controls:o=dr,isCollapsed:r=!0,isToolbar:l}=e;const a=ur[t],c=ur.top,u=l?p.ToolbarGroup:p.ToolbarDropdownMenu,d=l?{isCollapsed:r}:{};return(0,s.createElement)(u,i({popoverProps:pr,icon:a?a.icon:c.icon,label:(0,h._x)("Change vertical alignment","Block vertical alignment setting label"),controls:o.map((e=>{return{...ur[e],isActive:t===e,role:r?"menuitemradio":void 0,onClick:(o=e,()=>n(t===o?void 0:o))};var o}))},d))},gr=e=>(0,s.createElement)(mr,i({},e,{isToolbar:!1})),hr=e=>(0,s.createElement)(mr,i({},e,{isToolbar:!0})),fr={left:uo,center:po,right:mo,"space-between":go},vr=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?fr[r]:fr.left,d=[{name:"left",icon:uo,title:(0,h.__)("Justify items left"),isActive:"left"===r,onClick:()=>c("left")},{name:"center",icon:po,title:(0,h.__)("Justify items center"),isActive:"center"===r,onClick:()=>c("center")},{name:"right",icon:mo,title:(0,h.__)("Justify items right"),isActive:"right"===r,onClick:()=>c("right")},{name:"space-between",icon:go,title:(0,h.__)("Space between items"),isActive:"space-between"===r,onClick:()=>c("space-between")}],m=a?p.ToolbarGroup:p.ToolbarDropdownMenu,g=a?{isCollapsed:n}:{};return(0,s.createElement)(m,i({icon:u,popoverProps:l,label:(0,h.__)("Change items justification"),controls:d.filter((e=>t.includes(e.name)))},g))},br=e=>(0,s.createElement)(vr,i({},e,{isToolbar:!1})),kr=e=>(0,s.createElement)(vr,i({},e,{isToolbar:!0})),_r={left:"flex-start",right:"flex-end",center:"center","space-between":"space-between"},yr={left:"flex-start",right:"flex-end",center:"center"},Er={top:"flex-start",center:"center",bottom:"flex-end"},Cr=["wrap","nowrap"],Sr={name:"flex",label:(0,h.__)("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)(Br,{layout:t,onChange:n})),(0,s.createElement)(p.FlexItem,null,r&&(0,s.createElement)(xr,{layout:t,onChange:n}))),(0,s.createElement)(Ir,{layout:t,onChange:n}))},toolBarControls:function(e){let{layout:t={},onChange:n,layoutBlockSupport:o}=e;if(null!=o&&o.allowSwitching)return null;const{allowVerticalAlignment:r=!0}=o;return(0,s.createElement)(co,{group:"block",__experimentalShareWithChildBlocks:!0},(0,s.createElement)(Br,{layout:t,onChange:n,isToolbar:!0}),r&&"vertical"!==(null==t?void 0:t.orientation)&&(0,s.createElement)(wr,{layout:t,onChange:n,isToolbar:!0}))},save:function(e){var t,n;let{selector:o,layout:l,style:i,blockName:a}=e;const{orientation:c="horizontal"}=l,u=Bo("spacing.blockGap"),d=(0,r.getBlockSupport)(a,["spacing","blockGap","__experimentalDefault"])||"0.5em",p=null!==u,m=null!=i&&null!==(t=i.spacing)&&void 0!==t&&t.blockGap&&!Lo(a,"spacing","blockGap")?function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"0";const n=lr(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==i||null===(n=i.spacing)||void 0===n?void 0:n.blockGap,d):`var( --wp--style--block-gap, ${d} )`,g=_r[l.justifyContent]||_r.left,h=Cr.includes(l.flexWrap)?l.flexWrap:"wrap",f=`\n\t\tflex-direction: row;\n\t\talign-items: ${Er[l.verticalAlignment]||Er.center};\n\t\tjustify-content: ${g};\n\t\t`,v=`\n\t\tflex-direction: column;\n\t\talign-items: ${yr[l.justifyContent]||yr.left};\n\t\t`;return(0,s.createElement)("style",null,`\n\t\t\t\t${vo(o)} {\n\t\t\t\t\tdisplay: flex;\n\t\t\t\t\tflex-wrap: ${h};\n\t\t\t\t\tgap: ${p?m:d};\n\t\t\t\t\t${"horizontal"===c?f:v}\n\t\t\t\t}\n\n\t\t\t\t${vo(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 wr(e){let{layout:t,onChange:n,isToolbar:o=!1}=e;const{verticalAlignment:r=Er.center}=t,l=e=>{n({...t,verticalAlignment:e})};if(o)return(0,s.createElement)(gr,{onChange:l,value:r});const i=[{value:"flex-start",label:(0,h.__)("Align items top")},{value:"center",label:(0,h.__)("Align items center")},{value:"flex-end",label:(0,h.__)("Align items bottom")}];return(0,s.createElement)("fieldset",{className:"block-editor-hooks__flex-layout-vertical-alignment-control"},(0,s.createElement)("legend",null,(0,h.__)("Vertical alignment")),(0,s.createElement)("div",null,i.map(((e,t,n)=>(0,s.createElement)(p.Button,{key:e,label:n,icon:t,isPressed:r===e,onClick:()=>l(e)})))))}function Br(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)(br,{allowedControls:a,value:r,onChange:i,popoverProps:{position:"bottom right",isAlternate:!0}});const c=[{value:"left",icon:uo,label:(0,h.__)("Justify items left")},{value:"center",icon:po,label:(0,h.__)("Justify items center")},{value:"right",icon:mo,label:(0,h.__)("Justify items right")}];return"horizontal"===l&&c.push({value:"space-between",icon:go,label:(0,h.__)("Space between items")}),(0,s.createElement)("fieldset",{className:"block-editor-hooks__flex-layout-justification-controls"},(0,s.createElement)("legend",null,(0,h.__)("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 Ir(e){let{layout:t,onChange:n}=e;const{flexWrap:o="wrap"}=t;return(0,s.createElement)(p.ToggleControl,{label:(0,h.__)("Allow to wrap to multiple lines"),onChange:e=>{n({...t,flexWrap:e?"wrap":"nowrap"})},checked:"wrap"===o})}function xr(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,h.__)("Orientation")),(0,s.createElement)(p.Button,{label:(0,h.__)("Horizontal"),icon:ho,isPressed:"horizontal"===o,onClick:()=>n({...t,orientation:"horizontal"})}),(0,s.createElement)(p.Button,{label:(0,h.__)("Vertical"),icon:fo,isPressed:"vertical"===o,onClick:()=>n({...t,orientation:"vertical"})}))}const Tr=function(e){let{icon:t,size:n=24,...o}=e;return(0,s.cloneElement)(t,{width:n,height:n,...o})},Nr=(0,s.createElement)(A.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(A.Path,{d:"M7 9v6h10V9H7zM5 19.8h14v-1.5H5v1.5zM5 4.3v1.5h14V4.3H5z"})),Pr=(0,s.createElement)(A.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(A.Path,{d:"M5 9v6h14V9H5zm11-4.8H8v1.5h8V4.2zM8 19.8h8v-1.5H8v1.5z"})),Lr=[{name:"default",label:(0,h.__)("Flow"),inspectorControls:function(e){let{layout:t,onChange:n}=e;const{wideSize:o,contentSize:r}=t,l=(0,p.__experimentalUseCustomUnits)({availableUnits:Bo("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,h.__)("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)(Tr,{icon:Nr})),(0,s.createElement)("div",{className:"block-editor-hooks__layout-controls-unit"},(0,s.createElement)(p.__experimentalUnitControl,{label:(0,h.__)("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)(Tr,{icon:Pr}))),(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,h.__)("Reset"))),(0,s.createElement)("p",{className:"block-editor-hooks__layout-controls-helptext"},(0,h.__)("Customize the width for all elements that are assigned to the center or wide columns.")))},toolBarControls:function(){return null},save:function(e){var t;let{selector:n,layout:o={},style:r,blockName:l}=e;const{contentSize:i,wideSize:a}=o,c=null!==Bo("spacing.blockGap"),u=lr(null==r||null===(t=r.spacing)||void 0===t?void 0:t.blockGap),d=null!=u&&u.top&&!Lo(l,"spacing","blockGap")?null==u?void 0:u.top:"var( --wp--style--block-gap )";let p=i||a?`\n\t\t\t\t\t${vo(n,"> :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${vo(n,"> .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${vo(n,"> .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${vo(n,"> .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${vo(n,"> .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${vo(n,"> .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${vo(n,"> *")} {\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${vo(n,"> * + *")} {\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,h.sprintf)((0,h.__)("Max %s wide"),t)),r.test(n)&&(
6
  // translators: %s: container size (i.e. 600px etc)
7
- o.wide=(0,h.sprintf)((0,h.__)("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}},Sr];function Rr(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default";return Lr.find((t=>t.name===e))}const Mr={type:"default"},Ar=(0,s.createContext)(Mr),Dr=Ar.Provider;function Or(){return(0,s.useContext)(Ar)}function Fr(e){let{layout:t={},...n}=e;const o=Rr(t.type);return o?(0,s.createElement)(o.save,i({layout:t},n)):null}const zr=["none","left","center","right","wide","full"],Vr=["wide","full"];function Hr(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:zr;e.includes("none")||(e=["none",...e]);const{wideControlsEnabled:t=!1,themeSupportsLayout:n}=(0,m.useSelect)((e=>{const{getSettings:t}=e(Jn),n=t();return{wideControlsEnabled:n.alignWide,themeSupportsLayout:n.supportsLayout}}),[]),o=Or(),r=Rr(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=zr}=o,s=e.filter((e=>(o.alignments||t||!Vr.includes(e))&&i.includes(e))).map((e=>({name:e})));return 1===s.length&&"none"===s[0].name?[]:s}const Gr=(0,s.createElement)(A.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(A.Path,{d:"M5 15h14V9H5v6zm0 4.8h14v-1.5H5v1.5zM5 4.2v1.5h14V4.2H5z"})),Ur=(0,s.createElement)(A.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(A.Path,{d:"M4 9v6h14V9H4zm8-4.8H4v1.5h8V4.2zM4 19.8h8v-1.5H4v1.5z"})),Wr=(0,s.createElement)(A.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(A.Path,{d:"M6 15h14V9H6v6zm6-10.8v1.5h8V4.2h-8zm0 15.6h8v-1.5h-8v1.5z"})),$r=(0,s.createElement)(A.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(A.Path,{d:"M5 4v11h14V4H5zm3 15.8h8v-1.5H8v1.5z"})),jr={none:{icon:Gr,title:(0,h._x)("None","Alignment option")},left:{icon:Ur,title:(0,h.__)("Align left")},center:{icon:Nr,title:(0,h.__)("Align center")},right:{icon:Wr,title:(0,h.__)("Align right")},wide:{icon:Pr,title:(0,h.__)("Wide width")},full:{icon:$r,title:(0,h.__)("Full width")}},Kr={isAlternate:!0},qr=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=jr[t],m=jr.none,g=r?p.ToolbarGroup:p.ToolbarDropdownMenu,f={popoverProps:Kr,icon:d?d.icon:m.icon,label:(0,h.__)("Align"),toggleProps:{describedBy:(0,h.__)("Change alignment")}},v=r?{isCollapsed:l,controls:a.map((e=>{let{name:n}=e;return{...jr[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}=jr[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)(g,i({},f,v))},Yr=e=>(0,s.createElement)(qr,i({},e,{isToolbar:!1})),Zr=e=>(0,s.createElement)(qr,i({},e,{isToolbar:!0})),Qr=["left","center","right","wide","full"],Xr=["wide","full"];function Jr(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)?Qr.filter((t=>e.includes(t))):!0===e?[...Qr]:[],!o||!0===e&&!n?(0,u.without)(t,...Xr):t}const el=(0,d.createHigherOrderComponent)((e=>t=>{const{name:n}=t,o=Hr(Jr((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)(co,{group:"block",__experimentalShareWithChildBlocks:!0},(0,s.createElement)(Yr,{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"),tl=(0,d.createHigherOrderComponent)((e=>t=>{const{name:n,attributes:o}=t,{align:l}=o,a=Hr(Jr((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:[...Qr,""]}}),e})),(0,l.addFilter)("editor.BlockListBlock","core/editor/align/with-data-align",tl),(0,l.addFilter)("editor.BlockEdit","core/editor/align/with-toolbar-controls",el),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/align/addAssignedAlign",(function(e,t,n){const{align:o}=n;return Jr((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 nl=/[\s#]/g,ol={type:"string",source:"attribute",attribute:"id",selector:"*"},rl=(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,h.__)("HTML anchor"),help:(0,s.createElement)(s.Fragment,null,(0,h.__)("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,h.__)("https://wordpress.org/support/article/page-jumps/")},(0,h.__)("Learn more about anchors"))),value:t.attributes.anchor||"",placeholder:n?null:(0,h.__)("Add an anchor"),onChange:e=>{e=e.replace(nl,"-"),t.setAttributes({anchor:e})},autoCapitalize:"none",autoComplete:"off"});return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(e,t),n&&(0,s.createElement)(Fo,{__experimentalGroup:"advanced"},o),!n&&"core/heading"===t.name&&(0,s.createElement)(Fo,null,(0,s.createElement)(p.PanelBody,{title:(0,h.__)("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:ol}),e})),(0,l.addFilter)("editor.BlockEdit","core/editor/anchor/with-inspector-control",rl),(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 ll={type:"string",source:"attribute",attribute:"aria-label",selector:"*"};(0,l.addFilter)("blocks.registerBlockType","core/ariaLabel/attribute",(function(e){var t,n;return null!=e&&null!==(t=e.attributes)&&void 0!==t&&null!==(n=t.ariaLabel)&&void 0!==n&&n.type||(0,r.hasBlockSupport)(e,"ariaLabel")&&(e.attributes={...e.attributes,ariaLabel:ll}),e})),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/ariaLabel/save-props",(function(e,t,n){return(0,r.hasBlockSupport)(t,"ariaLabel")&&(e["aria-label"]=""===n.ariaLabel?null:n.ariaLabel),e}));const il=(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)(Fo,{__experimentalGroup:"advanced"},(0,s.createElement)(p.TextControl,{autoComplete:"off",label:(0,h.__)("Additional CSS class(es)"),value:t.attributes.className||"",onChange:e=>{t.setAttributes({className:""!==e?e:void 0})},help:(0,h.__)("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",il),(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 sl="var:";function al(e,t,n,o){const r=(0,u.get)(e,n);return r?[{selector:null==t?void 0:t.selector,key:o,value:ul(r)}]:[]}function cl(e,t,n,o){let r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:["top","right","bottom","left"];const l=(0,u.get)(e,n);if(!l)return[];const i=[];if("string"==typeof l)i.push({selector:null==t?void 0:t.selector,key:o.default,value:l});else{const e=r.reduce(((e,n)=>{const r=(0,u.get)(l,[n]);return r&&e.push({selector:null==t?void 0:t.selector,key:null==o?void 0:o.individual.replace("%s",dl(n)),value:r}),e}),[]);i.push(...e)}return i}function ul(e){return"string"==typeof e&&e.startsWith(sl)?`var(--wp--${e.slice(sl.length).split("|").join("--")})`:e}function dl(e){let[t,...n]=e;return t.toUpperCase()+n.join("")}const pl={name:"radius",generate:(e,t)=>cl(e,t,["border","radius"],{default:"borderRadius",individual:"border%sRadius"},["topLeft","topRight","bottomLeft","bottomRight"])},ml=[{name:"color",generate:function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:["border","color"],o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"borderColor";return al(e,t,n,o)}},{name:"style",generate:function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:["border","style"],o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"borderStyle";return al(e,t,n,o)}},{name:"width",generate:function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:["border","width"],o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"borderWidth";return al(e,t,n,o)}}],gl=e=>(t,n)=>{var o;const r=null==t||null===(o=t.border)||void 0===o?void 0:o[e];return r?ml.reduce(((o,l)=>{const i=l.name;if(r.hasOwnProperty(i)&&"function"==typeof l.generate){const r=`border${dl(e)}${dl(i)}`;o.push(...l.generate(t,n,["border",e,i],r))}return o}),[]):[]},hl={name:"borderTop",generate:gl("top")},fl={name:"borderRight",generate:gl("right")},vl={name:"borderBottom",generate:gl("bottom")},bl={name:"borderLeft",generate:gl("left")},kl=[...ml,pl,hl,fl,vl,bl,{name:"text",generate:(e,t)=>al(e,t,["color","text"],"color")},{name:"gradient",generate:(e,t)=>al(e,t,["color","gradient"],"background")},{name:"background",generate:(e,t)=>al(e,t,["color","background"],"backgroundColor")},{name:"margin",generate:(e,t)=>cl(e,t,["spacing","margin"],{default:"margin",individual:"margin%s"})},{name:"padding",generate:(e,t)=>cl(e,t,["spacing","padding"],{default:"padding",individual:"padding%s"})},{name:"fontSize",generate:(e,t)=>al(e,t,["typography","fontSize"],"fontSize")},{name:"fontStyle",generate:(e,t)=>al(e,t,["typography","fontStyle"],"fontStyle")},{name:"fontWeight",generate:(e,t)=>al(e,t,["typography","fontWeight"],"fontWeight")},{name:"letterSpacing",generate:(e,t)=>al(e,t,["typography","letterSpacing"],"letterSpacing")},{name:"letterSpacing",generate:(e,t)=>al(e,t,["typography","lineHeight"],"lineHeight")},{name:"textDecoration",generate:(e,t)=>al(e,t,["typography","textDecoration"],"textDecoration")},{name:"textTransform",generate:(e,t)=>al(e,t,["typography","textTransform"],"textTransform")}];function _l(e,t){const n=[];return kl.forEach((o=>{"function"==typeof o.generate&&n.push(...o.generate(e,t))})),n}const yl=window.wp.dom,El=(0,s.createContext)({});function Cl(e){let{value:t,children:n}=e;const o=(0,s.useContext)(El),r=(0,s.useMemo)((()=>({...o,...t})),[o,t]);return(0,s.createElement)(El.Provider,{value:r,children:n})}const Sl=El,wl={},Bl=(0,p.withFilters)("editor.BlockEdit")((e=>{const{attributes:t={},name:n}=e,o=(0,r.getBlockType)(n),l=(0,s.useContext)(Sl),a=(0,s.useMemo)((()=>o&&o.usesContext?(0,u.pick)(l,o.usesContext):wl),[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 Il(e){const{name:t,isSelected:n,clientId:o}=e,r={name:t,isSelected:n,clientId:o};return(0,s.createElement)(no,{value:(0,s.useMemo)((()=>r),Object.values(r))},(0,s.createElement)(Bl,e))}const xl=(0,s.createElement)(A.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(A.Path,{d:"M11 13h2v-2h-2v2zm-6 0h2v-2H5v2zm12-2v2h2v-2h-2z"})),Tl=function(e){let{className:t,actions:n,children:o,secondaryActions:r}=e;return(0,s.createElement)("div",{style:{display:"contents",all:"initial"}},(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:xl,label:(0,h.__)("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))))))))))};var Nl=n(1973);function Pl(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,yl.safeHTML)(o)))),(0,s.createElement)("div",{className:"block-editor-block-compare__action"},(0,s.createElement)(p.Button,{variant:"secondary",tabIndex:"0",onClick:r},l)))}const Ll=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,g=a,(0,Nl.Kx)(m,g).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,g;return(0,s.createElement)("div",{className:"block-editor-block-compare__wrapper"},(0,s.createElement)(Pl,{title:(0,h.__)("Current"),className:"block-editor-block-compare__current",action:n,actionText:(0,h.__)("Convert to HTML"),rawContent:t.originalContent,renderedContent:t.originalContent}),(0,s.createElement)(Pl,{title:(0,h.__)("After Conversion"),className:"block-editor-block-compare__converted",action:o,actionText:i,rawContent:p,renderedContent:a}))},Rl=e=>(0,r.rawHandler)({HTML:e.originalContent}),Ml=(0,d.compose)([(0,m.withSelect)(((e,t)=>{let{clientId:n}=t;return{block:e(Jn).getBlock(n)}})),(0,m.withDispatch)(((e,t)=>{let{block:n}=t;const{replaceBlock:o}=e(Jn);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,Rl(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)),[]),g=(0,s.useMemo)((()=>[{
8
  // translators: Button to fix block content
9
- title:(0,h._x)("Resolve","imperative verb"),onClick:d},a&&{title:(0,h.__)("Convert to HTML"),onClick:t},{title:(0,h.__)("Convert to Classic Block"),onClick:o}].filter(Boolean)),[d,t,o]);return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(Tl,{actions:[(0,s.createElement)(p.Button,{key:"recover",onClick:l,variant:"primary"},(0,h.__)("Attempt Block Recovery"))],secondaryActions:g},(0,h.__)("This block contains unexpected or invalid content.")),c&&(0,s.createElement)(p.Modal,{title:// translators: Dialog title to fix block content
10
- (0,h.__)("Resolve Block"),onRequestClose:m,className:"block-editor-block-compare"},(0,s.createElement)(Ll,{block:i,onKeep:t,onConvert:n,convertor:Rl,convertButtonText:(0,h.__)("Convert to Blocks")})))})),Al=(0,s.createElement)(Tl,{className:"block-editor-block-list__block-crash-warning"},(0,h.__)("This block has encountered an error and cannot be previewed.")),Dl=()=>Al;class Ol 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}}const Fl=Ol;var zl=n(773);const Vl=function(e){let{clientId:t}=e;const[n,o]=(0,s.useState)(""),l=(0,m.useSelect)((e=>e(Jn).getBlock(t)),[t]),{updateBlock:i}=(0,m.useDispatch)(Jn);return(0,s.useEffect)((()=>{o((0,r.getBlockContent)(l))}),[l]),(0,s.createElement)(zl.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 Hl=oi();const Gl=e=>Jl(e,Hl);let Ul=oi();Gl.write=e=>Jl(e,Ul);let Wl=oi();Gl.onStart=e=>Jl(e,Wl);let $l=oi();Gl.onFrame=e=>Jl(e,$l);let jl=oi();Gl.onFinish=e=>Jl(e,jl);let Kl=[];Gl.setTimeout=(e,t)=>{let n=Gl.now()+t,o=()=>{let e=Kl.findIndex((e=>e.cancel==o));~e&&Kl.splice(e,1),Ql-=~e?1:0},r={time:n,handler:e,cancel:o};return Kl.splice(ql(n),0,r),Ql+=1,ei(),r};let ql=e=>~(~Kl.findIndex((t=>t.time>e))||~Kl.length);Gl.cancel=e=>{Wl.delete(e),$l.delete(e),Hl.delete(e),Ul.delete(e),jl.delete(e)},Gl.sync=e=>{Xl=!0,Gl.batchedUpdates(e),Xl=!1},Gl.throttle=e=>{let t;function n(){try{e(...t)}finally{t=null}}function o(...e){t=e,Gl.onStart(n)}return o.handler=e,o.cancel=()=>{Wl.delete(n),t=null},o};let Yl="undefined"!=typeof window?window.requestAnimationFrame:()=>{};Gl.use=e=>Yl=e,Gl.now="undefined"!=typeof performance?()=>performance.now():Date.now,Gl.batchedUpdates=e=>e(),Gl.catch=console.error,Gl.frameLoop="always",Gl.advance=()=>{"demand"!==Gl.frameLoop?console.warn("Cannot call the manual advancement of rafz whilst frameLoop is not set as demand"):ni()};let Zl=-1,Ql=0,Xl=!1;function Jl(e,t){Xl?(t.delete(e),e(0)):(t.add(e),ei())}function ei(){Zl<0&&(Zl=0,"demand"!==Gl.frameLoop&&Yl(ti))}function ti(){~Zl&&(Yl(ti),Gl.batchedUpdates(ni))}function ni(){let e=Zl;Zl=Gl.now();let t=ql(Zl);t&&(ri(Kl.splice(0,t),(e=>e.handler())),Ql-=t),Wl.flush(),Hl.flush(e?Math.min(64,Zl-e):16.667),$l.flush(),Ul.flush(),jl.flush(),Ql||(Zl=-1)}function oi(){let e=new Set,t=e;return{add(n){Ql+=t!=e||e.has(n)?0:1,e.add(n)},delete:n=>(Ql-=t==e&&e.has(n)?1:0,e.delete(n)),flush(n){t.size&&(e=new Set,Ql-=t.size,ri(t,(t=>t(n)&&e.add(t))),Ql+=e.size,t=e)}}}function ri(e,t){e.forEach((e=>{try{t(e)}catch(e){Gl.catch(e)}}))}var li=n(9196),ii=n.n(li);function si(){}const ai={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 ci(e,t){if(ai.arr(e)){if(!ai.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 ui=(e,t)=>e.forEach(t);function di(e,t,n){if(ai.arr(e))for(let o=0;o<e.length;o++)t.call(n,e[o],`${o}`);else for(const o in e)e.hasOwnProperty(o)&&t.call(n,e[o],o)}const pi=e=>ai.und(e)?[]:ai.arr(e)?e:[e];function mi(e,t){if(e.size){const n=Array.from(e);e.clear(),ui(n,t)}}const gi=(e,...t)=>mi(e,(e=>e(...t))),hi=()=>"undefined"==typeof window||!window.navigator||/ServerSideRendering|^Deno\//.test(window.navigator.userAgent);let fi,vi,bi=null,ki=!1,_i=si;var yi=Object.freeze({__proto__:null,get createStringInterpolator(){return fi},get to(){return vi},get colors(){return bi},get skipAnimation(){return ki},get willAdvance(){return _i},assign:e=>{e.to&&(vi=e.to),e.now&&(Gl.now=e.now),void 0!==e.colors&&(bi=e.colors),null!=e.skipAnimation&&(ki=e.skipAnimation),e.createStringInterpolator&&(fi=e.createStringInterpolator),e.requestAnimationFrame&&Gl.use(e.requestAnimationFrame),e.batchedUpdates&&(Gl.batchedUpdates=e.batchedUpdates),e.willAdvance&&(_i=e.willAdvance),e.frameLoop&&(Gl.frameLoop=e.frameLoop)}});const Ei=new Set;let Ci=[],Si=[],wi=0;const Bi={get idle(){return!Ei.size&&!Ci.length},start(e){wi>e.priority?(Ei.add(e),Gl.onStart(Ii)):(xi(e),Gl(Ni))},advance:Ni,sort(e){if(wi)Gl.onFrame((()=>Bi.sort(e)));else{const t=Ci.indexOf(e);~t&&(Ci.splice(t,1),Ti(e))}},clear(){Ci=[],Ei.clear()}};function Ii(){Ei.forEach(xi),Ei.clear(),Gl(Ni)}function xi(e){Ci.includes(e)||Ti(e)}function Ti(e){Ci.splice(function(t,n){const o=t.findIndex((t=>t.priority>e.priority));return o<0?t.length:o}(Ci),0,e)}function Ni(e){const t=Si;for(let n=0;n<Ci.length;n++){const o=Ci[n];wi=o.priority,o.idle||(_i(o),o.advance(e),o.idle||t.push(o))}return wi=0,Si=Ci,Si.length=0,Ci=t,Ci.length>0}const Pi="[-+]?\\d*\\.?\\d+",Li=Pi+"%";function Ri(...e){return"\\(\\s*("+e.join(")\\s*,\\s*(")+")\\s*\\)"}const Mi=new RegExp("rgb"+Ri(Pi,Pi,Pi)),Ai=new RegExp("rgba"+Ri(Pi,Pi,Pi,Pi)),Di=new RegExp("hsl"+Ri(Pi,Li,Li)),Oi=new RegExp("hsla"+Ri(Pi,Li,Li,Pi)),Fi=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,zi=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,Vi=/^#([0-9a-fA-F]{6})$/,Hi=/^#([0-9a-fA-F]{8})$/;function Gi(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 Ui(e,t,n){const o=n<.5?n*(1+t):n+t-n*t,r=2*n-o,l=Gi(r,o,e+1/3),i=Gi(r,o,e),s=Gi(r,o,e-1/3);return Math.round(255*l)<<24|Math.round(255*i)<<16|Math.round(255*s)<<8}function Wi(e){const t=parseInt(e,10);return t<0?0:t>255?255:t}function $i(e){return(parseFloat(e)%360+360)%360/360}function ji(e){const t=parseFloat(e);return t<0?0:t>1?255:Math.round(255*t)}function Ki(e){const t=parseFloat(e);return t<0?0:t>100?1:t/100}function qi(e){let t=function(e){let t;return"number"==typeof e?e>>>0===e&&e>=0&&e<=4294967295?e:null:(t=Vi.exec(e))?parseInt(t[1]+"ff",16)>>>0:bi&&void 0!==bi[e]?bi[e]:(t=Mi.exec(e))?(Wi(t[1])<<24|Wi(t[2])<<16|Wi(t[3])<<8|255)>>>0:(t=Ai.exec(e))?(Wi(t[1])<<24|Wi(t[2])<<16|Wi(t[3])<<8|ji(t[4]))>>>0:(t=Fi.exec(e))?parseInt(t[1]+t[1]+t[2]+t[2]+t[3]+t[3]+"ff",16)>>>0:(t=Hi.exec(e))?parseInt(t[1],16)>>>0:(t=zi.exec(e))?parseInt(t[1]+t[1]+t[2]+t[2]+t[3]+t[3]+t[4]+t[4],16)>>>0:(t=Di.exec(e))?(255|Ui($i(t[1]),Ki(t[2]),Ki(t[3])))>>>0:(t=Oi.exec(e))?(Ui($i(t[1]),Ki(t[2]),Ki(t[3]))|ji(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 Yi=(e,t,n)=>{if(ai.fun(e))return e;if(ai.arr(e))return Yi({range:e,output:t,extrapolate:n});if(ai.str(e.output[0]))return fi(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 Zi(){return(Zi=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 Qi=Symbol.for("FluidValue.get"),Xi=Symbol.for("FluidValue.observers"),Ji=e=>Boolean(e&&e[Qi]),es=e=>e&&e[Qi]?e[Qi]():e,ts=e=>e[Xi]||null;function ns(e,t){let n=e[Xi];n&&n.forEach((e=>{!function(e,t){e.eventObserved?e.eventObserved(t):e(t)}(e,t)}))}class os{constructor(e){if(this[Qi]=void 0,this[Xi]=void 0,!e&&!(e=this.get))throw Error("Unknown getter");rs(this,e)}}const rs=(e,t)=>ss(e,Qi,t);function ls(e,t){if(e[Qi]){let n=e[Xi];n||ss(e,Xi,n=new Set),n.has(t)||(n.add(t),e.observerAdded&&e.observerAdded(n.size,t))}return t}function is(e,t){let n=e[Xi];if(n&&n.has(t)){const o=n.size-1;o?n.delete(t):e[Xi]=null,e.observerRemoved&&e.observerRemoved(o,t)}}const ss=(e,t,n)=>Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0}),as=/[+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,cs=/(#(?:[0-9a-f]{2}){2,4}|(#[0-9a-f]{3})|(rgb|hsl)a?\((-?\d+%?[,\s]+){2,3}\s*[\d\.]+%?\))/gi,us=new RegExp(`(${as.source})(%|[a-z]+)`,"i"),ds=/rgba\(([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+)\)/gi,ps=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/,ms=e=>{const[t,n]=gs(e);if(!t||hi())return e;const o=window.getComputedStyle(document.documentElement).getPropertyValue(t);if(o)return o.trim();if(n&&n.startsWith("--")){return window.getComputedStyle(document.documentElement).getPropertyValue(n)||e}return n&&ps.test(n)?ms(n):n||e},gs=e=>{const t=ps.exec(e);if(!t)return[,];const[,n,o]=t;return[n,o]};let hs;const fs=(e,t,n,o,r)=>`rgba(${Math.round(t)}, ${Math.round(n)}, ${Math.round(o)}, ${r})`,vs=e=>{hs||(hs=bi?new RegExp(`(${Object.keys(bi).join("|")})(?!\\w)`,"g"):/^\b$/);const t=e.output.map((e=>es(e).replace(ps,ms).replace(cs,qi).replace(hs,qi))),n=t.map((e=>e.match(as).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=>Yi(Zi({},e,{output:t}))));return e=>{var n;const r=!us.test(t[0])&&(null==(n=t.find((e=>us.test(e))))?void 0:n.replace(as,""));let l=0;return t[0].replace(as,(()=>`${o[l++](e)}${r||""}`)).replace(ds,fs)}},bs="react-spring: ",ks=e=>{const t=e;let n=!1;if("function"!=typeof t)throw new TypeError(`${bs}once requires a function parameter`);return(...e)=>{n||(t(...e),n=!0)}},_s=ks(console.warn),ys=ks(console.warn);function Es(e){return ai.str(e)&&("#"==e[0]||/\d/.test(e)||!hi()&&ps.test(e)||e in(bi||{}))}const Cs="undefined"!=typeof window&&window.document&&window.document.createElement?li.useLayoutEffect:li.useEffect;function Ss(){const e=(0,li.useState)()[1],t=(()=>{const e=(0,li.useRef)(!1);return Cs((()=>(e.current=!0,()=>{e.current=!1})),[]),e})();return()=>{t.current&&e(Math.random())}}const ws=e=>(0,li.useEffect)(e,Bs),Bs=[];function Is(e){const t=(0,li.useRef)();return(0,li.useEffect)((()=>{t.current=e})),t.current}const xs=Symbol.for("Animated:node"),Ts=e=>e&&e[xs],Ns=(e,t)=>{return n=e,o=xs,r=t,Object.defineProperty(n,o,{value:r,writable:!0,configurable:!0});var n,o,r},Ps=e=>e&&e[xs]&&e[xs].getPayload();class Ls{constructor(){this.payload=void 0,Ns(this,this)}getPayload(){return this.payload||[]}}class Rs extends Ls{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,ai.num(this._value)&&(this.lastPosition=this._value)}static create(e){return new Rs(e)}getPayload(){return[this]}getValue(){return this._value}setValue(e,t){return ai.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,ai.num(this._value)&&(this.elapsedTime=0,this.durationProgress=0,this.lastPosition=this._value,e&&(this.lastVelocity=null),this.v0=null)}}class Ms extends Rs{constructor(e){super(0),this._string=null,this._toString=void 0,this._toString=Yi({output:[e,e]})}static create(e){return new Ms(e)}getValue(){let e=this._string;return null==e?this._string=this._toString(this._value):e}setValue(e){if(ai.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=Yi({output:[this.getValue(),e]})),this._value=0,super.reset()}}const As={dependencies:null};class Ds extends Ls{constructor(e){super(),this.source=e,this.setValue(e)}getValue(e){const t={};return di(this.source,((n,o)=>{var r;(r=n)&&r[xs]===r?t[o]=n.getValue(e):Ji(n)?t[o]=es(n):e||(t[o]=n)})),t}setValue(e){this.source=e,this.payload=this._makePayload(e)}reset(){this.payload&&ui(this.payload,(e=>e.reset()))}_makePayload(e){if(e){const t=new Set;return di(e,this._addToPayload,t),Array.from(t)}}_addToPayload(e){As.dependencies&&Ji(e)&&As.dependencies.add(e);const t=Ps(e);t&&ui(t,(e=>this.add(e)))}}class Os extends Ds{constructor(e){super(e)}static create(e){return new Os(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(Fs)),!0)}}function Fs(e){return(Es(e)?Ms:Rs).create(e)}function zs(e){const t=Ts(e);return t?t.constructor:ai.arr(e)?Os:Es(e)?Ms:Rs}function Vs(){return(Vs=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 Hs=(e,t)=>{const n=!ai.fun(e)||e.prototype&&e.prototype.isReactComponent;return(0,li.forwardRef)(((o,r)=>{const l=(0,li.useRef)(null),i=n&&(0,li.useCallback)((e=>{l.current=function(e,t){return e&&(ai.fun(e)?e(t):e.current=t),t}(r,e)}),[r]),[s,a]=function(e,t){const n=new Set;return As.dependencies=n,e.style&&(e=Vs({},e,{style:t.createAnimatedStyle(e.style)})),e=new Ds(e),As.dependencies=null,[e,n]}(o,t),c=Ss(),u=()=>{const e=l.current;n&&!e||!1===(!!e&&t.applyAnimatedValues(e,s.getValue(!0)))&&c()},d=new Gs(u,a),p=(0,li.useRef)();Cs((()=>(p.current=d,ui(a,(e=>ls(e,d))),()=>{p.current&&(ui(p.current.deps,(e=>is(e,p.current))),Gl.cancel(p.current.update))}))),(0,li.useEffect)(u,[]),ws((()=>()=>{const e=p.current;ui(e.deps,(t=>is(t,e)))}));const m=t.getComponentProps(s.getValue());return li.createElement(e,Vs({},m,{ref:i}))}))};class Gs{constructor(e,t){this.update=e,this.deps=t}eventObserved(e){"change"==e.type&&Gl.write(this.update)}}const Us=Symbol.for("AnimatedComponent"),Ws=e=>ai.str(e)?e:e&&ai.str(e.displayName)?e.displayName:ai.fun(e)&&e.name||null;function $s(){return($s=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 js(e,...t){return ai.fun(e)?e(...t):e}const Ks=(e,t)=>!0===e||!!(t&&e&&(ai.fun(e)?e(t):pi(e).includes(t))),qs=(e,t)=>ai.obj(e)?t&&e[t]:e,Ys=(e,t)=>!0===e.default?e[t]:e.default?e.default[t]:void 0,Zs=e=>e,Qs=(e,t=Zs)=>{let n=Xs;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);ai.und(n)||(o[r]=n)}return o},Xs=["config","onProps","onStart","onChange","onPause","onResume","onRest"],Js={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 ea(e){const t=function(e){const t={};let n=0;if(di(e,((e,o)=>{Js[o]||(t[o]=e,n++)})),n)return t}(e);if(t){const n={to:t};return di(e,((e,o)=>o in t||(n[o]=e))),n}return $s({},e)}function ta(e){return e=es(e),ai.arr(e)?e.map(ta):Es(e)?yi.createStringInterpolator({range:[0,1],output:[e,e]})(1):e}function na(e){for(const t in e)return!0;return!1}function oa(e){return ai.fun(e)||ai.arr(e)&&ai.obj(e[0])}function ra(e,t){var n;null==(n=e.ref)||n.delete(e),null==t||t.delete(e)}function la(e,t){var n;t&&e.ref!==t&&(null==(n=e.ref)||n.delete(e),t.add(e),e.ref=t)}Math.PI,Math.PI;const ia=$s({},{tension:170,friction:26},{mass:1,damping:1,easing:e=>e,clamp:!1});class sa{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,ia)}}function aa(e,t){if(ai.und(t.decay)){const n=!ai.und(t.tension)||!ai.und(t.friction);!n&&ai.und(t.frequency)&&ai.und(t.damping)&&ai.und(t.mass)||(e.duration=void 0,e.decay=void 0),n&&(e.frequency=void 0)}else e.duration=void 0}const ca=[];class ua{constructor(){this.changed=!1,this.values=ca,this.toValues=null,this.fromValues=ca,this.to=void 0,this.from=void 0,this.config=new sa,this.immediate=!1}}function da(e,{key:t,props:n,defaultProps:o,state:r,actions:l}){return new Promise(((i,s)=>{var a;let c,u,d=Ks(null!=(a=n.cancel)?a:null==o?void 0:o.cancel,t);if(d)g();else{ai.und(n.pause)||(r.paused=Ks(n.pause,t));let e=null==o?void 0:o.pause;!0!==e&&(e=r.paused||Ks(e,t)),c=js(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-Gl.now()}function m(){c>0&&!yi.skipAnimation?(r.delayed=!0,u=Gl.setTimeout(g,c),r.pauseQueue.add(p),r.timeouts.add(u)):g()}function g(){r.delayed&&(r.delayed=!1),r.pauseQueue.delete(p),r.timeouts.delete(u),e<=(r.cancelId||0)&&(d=!0);try{l.start($s({},n,{callId:e,cancel:d}),i)}catch(e){s(e)}}}))}const pa=(e,t)=>1==t.length?t[0]:t.some((e=>e.cancelled))?ha(e.get()):t.every((e=>e.noop))?ma(e.get()):ga(e.get(),t.every((e=>e.finished))),ma=e=>({value:e,noop:!0,finished:!0,cancelled:!1}),ga=(e,t,n=!1)=>({value:e,finished:t,cancelled:n}),ha=e=>({value:e,cancelled:!0,finished:!1});function fa(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=Qs(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)&&ha(o)||r!==n.asyncId&&ga(o,!1);if(t)throw e.result=t,d(e),e},g=(e,t)=>{const l=new ba,i=new ka;return(async()=>{if(yi.skipAnimation)throw va(n),i.result=ga(o,!1),d(i),i;m(l);const s=ai.obj(e)?$s({},e):$s({},t,{to:e});s.parentId=r,di(c,((e,t)=>{ai.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 h;if(yi.skipAnimation)return va(n),ga(o,!1);try{let t;t=ai.arr(e)?(async e=>{for(const t of e)await g(t)})(e):Promise.resolve(e(g,o.stop.bind(o))),await Promise.all([t.then(u),p]),h=ga(o.get(),!0,!1)}catch(e){if(e instanceof ba)h=e.result;else{if(!(e instanceof ka))throw e;h=e.result}}finally{r==n.asyncId&&(n.asyncId=l,n.asyncTo=l?s:void 0,n.promise=l?a:void 0)}return ai.fun(i)&&Gl.batchedUpdates((()=>{i(h,o,o.item)})),h})():a}function va(e,t){mi(e.timeouts,(e=>e.cancel())),e.pauseQueue.clear(),e.resumeQueue.clear(),e.asyncId=e.asyncTo=e.promise=void 0,t&&(e.cancelId=t)}class ba 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 ka extends Error{constructor(){super("SkipAnimationSignal"),this.result=void 0}}const _a=e=>e instanceof Ea;let ya=1;class Ea extends os{constructor(...e){super(...e),this.id=ya++,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=Ts(this);return e&&e.getValue()}to(...e){return yi.to(this,e)}interpolate(...e){return _s(`${bs}The "interpolate" function is deprecated in v9 (use "to" instead)`),yi.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){ns(this,{type:"change",parent:this,value:e,idle:t})}_onPriorityChange(e){this.idle||Bi.sort(this),ns(this,{type:"priority",parent:this,priority:e})}}const Ca=Symbol.for("SpringPhase"),Sa=e=>(1&e[Ca])>0,wa=e=>(2&e[Ca])>0,Ba=e=>(4&e[Ca])>0,Ia=(e,t)=>t?e[Ca]|=3:e[Ca]&=-3,xa=(e,t)=>t?e[Ca]|=4:e[Ca]&=-5;class Ta extends Ea{constructor(e,t){if(super(),this.key=void 0,this.animation=new ua,this.queue=void 0,this.defaultProps={},this._state={paused:!1,delayed:!1,pauseQueue:new Set,resumeQueue:new Set,timeouts:new Set},this._pendingCalls=new Set,this._lastCallId=0,this._lastToId=0,this._memoizedDuration=0,!ai.und(e)||!ai.und(t)){const n=ai.obj(e)?$s({},e):$s({},t,{from:e});ai.und(n.default)&&(n.default=!0),this.start(n)}}get idle(){return!(wa(this)||this._state.asyncTo)||Ba(this)}get goal(){return es(this.animation.to)}get velocity(){const e=Ts(this);return e instanceof Rs?e.lastVelocity||0:e.getPayload().map((e=>e.lastVelocity||0))}get hasAnimated(){return Sa(this)}get isAnimating(){return wa(this)}get isPaused(){return Ba(this)}get isDelayed(){return this._state.delayed}advance(e){let t=!0,n=!1;const o=this.animation;let{config:r,toValues:l}=o;const i=Ps(o.to);!i&&Ji(o.to)&&(l=pi(es(o.to))),o.values.forEach(((s,a)=>{if(s.done)return;const c=s.constructor==Ms?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=ai.arr(r.velocity)?r.velocity[a]:r.velocity;let i;if(ai.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=!ai.und(a),m=n==c?s.v0>0:n<c;let g,h=!1;const f=1,v=Math.ceil(e/f);for(let e=0;e<v&&(g=Math.abs(i)>o,g||(u=Math.abs(c-d)<=t,!u));++e)p&&(h=d==c||d>c==m,h&&(i=-i*a,d=c)),i+=(1e-6*-r.tension*(d-c)+.001*-r.friction*i)/r.mass*f,d+=i*f}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=Ts(this),a=s.getValue();if(t){const e=es(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 Gl.batchedUpdates((()=>{this._stop(),this._focus(e),this._set(e)})),this}pause(){this._update({pause:!0})}resume(){this._update({pause:!1})}finish(){if(wa(this)){const{to:e,config:t}=this.animation;Gl.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 ai.und(e)?(n=this.queue||[],this.queue=[]):n=[ai.obj(e)?e:$s({},t,{to:e})],Promise.all(n.map((e=>this._update(e)))).then((e=>pa(this,e)))}stop(e){const{to:t}=this.animation;return this._focus(this.get()),va(this._state,e&&this._lastCallId),Gl.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=ai.obj(n)?n[t]:n,(null==n||oa(n))&&(n=void 0),o=ai.obj(o)?o[t]:o,null==o&&(o=void 0);const r={to:n,from:o};return Sa(this)||(e.reverse&&([n,o]=[o,n]),o=es(o),ai.und(o)?Ts(this)||this._set(n):this._set(o)),r}_update(e,t){let n=$s({},e);const{key:o,defaultProps:r}=this;n.default&&Object.assign(r,Qs(n,((e,t)=>/^on/.test(t)?qs(e,o):e))),Da(this,n,"onProps"),Oa(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 da(++this._lastCallId,{key:o,props:n,defaultProps:r,state:i,actions:{pause:()=>{Ba(this)||(xa(this,!0),gi(i.pauseQueue),Oa(this,"onPause",ga(this,Na(this,this.animation.to)),this))},resume:()=>{Ba(this)&&(xa(this,!1),wa(this)&&this._resume(),gi(i.resumeQueue),Oa(this,"onResume",ga(this,Na(this,this.animation.to)),this))},start:this._merge.bind(this,l)}}).then((e=>{if(n.loop&&e.finished&&(!t||!e.noop)){const e=Pa(n);if(e)return this._update(e,!0)}return e}))}_merge(e,t,n){if(t.cancel)return this.stop(!0),n(ha(this));const o=!ai.und(e.to),r=!ai.und(e.from);if(o||r){if(!(t.callId>this._lastToId))return n(ha(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&&!ai.und(u)||(u=d),t.reverse&&([u,d]=[d,u]);const p=!ci(d,c);p&&(s.from=d),d=es(d);const m=!ci(u,a);m&&this._focus(u);const g=oa(t.to),{config:h}=s,{decay:f,velocity:v}=h;(o||r)&&(h.velocity=0),t.config&&!g&&function(e,t,n){n&&(aa(n=$s({},n),t),t=$s({},n,t)),aa(e,t),Object.assign(e,t);for(const t in ia)null==e[t]&&(e[t]=ia[t]);let{mass:o,frequency:r,damping:l}=e;ai.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)}(h,js(t.config,l),t.config!==i.config?js(i.config,l):void 0);let b=Ts(this);if(!b||ai.und(u))return n(ga(this,!0));const k=ai.und(t.reset)?r&&!t.default:!ai.und(d)&&Ks(t.reset,l),_=k?d:this.get(),y=ta(u),E=ai.num(y)||ai.arr(y)||Es(y),C=!g&&(!E||Ks(i.immediate||t.immediate,l));if(m){const e=zs(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=Ji(u),B=!1;if(!w){const e=k||!Sa(this)&&p;(m||e)&&(B=ci(ta(_),y),w=!B),(ci(s.immediate,C)||C)&&ci(h.decay,f)&&ci(h.velocity,v)||(w=!0)}if(B&&wa(this)&&(s.changed&&!k?w=!0:w||this._stop(a)),!g&&((w||Ji(a))&&(s.values=b.getPayload(),s.toValues=Ji(u)?null:S==Ms?[1]:pi(y)),s.immediate!=C&&(s.immediate=C,C||k||this._set(a)),w)){const{onRest:e}=s;ui(Aa,(e=>Da(this,t,e)));const o=ga(this,Na(this,a));gi(this._pendingCalls,o),this._pendingCalls.add(n),s.changed&&Gl.batchedUpdates((()=>{s.changed=!k,null==e||e(o,this),k?js(i.onRest,o):null==s.onStart||s.onStart(o,this)}))}k&&this._set(_),g?n(fa(t.to,t,this._state,this)):w?this._start():wa(this)&&!m?this._pendingCalls.add(n):n(ma(_))}_focus(e){const t=this.animation;e!==t.to&&(ts(this)&&this._detach(),t.to=e,ts(this)&&this._attach())}_attach(){let e=0;const{to:t}=this.animation;Ji(t)&&(ls(t,this),_a(t)&&(e=t.priority+1)),this.priority=e}_detach(){const{to:e}=this.animation;Ji(e)&&is(e,this)}_set(e,t=!0){const n=es(e);if(!ai.und(n)){const e=Ts(this);if(!e||!ci(n,e.getValue())){const o=zs(n);e&&e.constructor==o?e.setValue(n):Ns(this,o.create(n)),e&&Gl.batchedUpdates((()=>{this._onChange(n,t)}))}}return Ts(this)}_onStart(){const e=this.animation;e.changed||(e.changed=!0,Oa(this,"onStart",ga(this,Na(this,e.to)),this))}_onChange(e,t){t||(this._onStart(),js(this.animation.onChange,e,this)),js(this.defaultProps.onChange,e,this),super._onChange(e,t)}_start(){const e=this.animation;Ts(this).reset(es(e.to)),e.immediate||(e.fromValues=e.values.map((e=>e.lastPosition))),wa(this)||(Ia(this,!0),Ba(this)||this._resume())}_resume(){yi.skipAnimation?this.finish():Bi.start(this)}_stop(e,t){if(wa(this)){Ia(this,!1);const n=this.animation;ui(n.values,(e=>{e.done=!0})),n.toValues&&(n.onChange=n.onPause=n.onResume=void 0),ns(this,{type:"idle",parent:this});const o=t?ha(this.get()):ga(this.get(),Na(this,null!=e?e:n.to));gi(this._pendingCalls,o),n.changed&&(n.changed=!1,Oa(this,"onRest",o,this))}}}function Na(e,t){const n=ta(t);return ci(ta(e.get()),n)}function Pa(e,t=e.loop,n=e.to){let o=js(t);if(o){const r=!0!==o&&ea(o),l=(r||e).reverse,i=!r||r.reset;return La($s({},e,{loop:t,default:!1,pause:void 0,to:!l||oa(n)?n:void 0,from:i?e.from:void 0,reset:i},r))}}function La(e){const{to:t,from:n}=e=ea(e),o=new Set;return ai.obj(t)&&Ma(t,o),ai.obj(n)&&Ma(n,o),e.keys=o.size?Array.from(o):null,e}function Ra(e){const t=La(e);return ai.und(t.default)&&(t.default=Qs(t)),t}function Ma(e,t){di(e,((e,n)=>null!=e&&t.add(n)))}const Aa=["onStart","onRest","onChange","onPause","onResume"];function Da(e,t,n){e.animation[n]=t[n]!==Ys(t,n)?qs(t[n],e.key):void 0}function Oa(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 Fa=["onStart","onChange","onRest"];let za=1;class Va{constructor(e,t){this.id=za++,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($s({default:!0},e))}get idle(){return!this._state.asyncTo&&Object.values(this.springs).every((e=>e.idle&&!e.isDelayed&&!e.isPaused))}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];ai.und(n)||this.springs[t].set(n)}}update(e){return e&&this.queue.push(La(e)),this}start(e){let{queue:t}=this;return e?t=pi(e).map(La):this.queue=[],this._flush?this._flush(this,t):(Ka(this,t),Ha(this,t))}stop(e,t){if(e!==!!e&&(t=e),t){const n=this.springs;ui(pi(t),(t=>n[t].stop(!!e)))}else va(this._state,this._lastAsyncId),this.each((t=>t.stop(!!e)));return this}pause(e){if(ai.und(e))this.start({pause:!0});else{const t=this.springs;ui(pi(e),(e=>t[e].pause()))}return this}resume(e){if(ai.und(e))this.start({pause:!1});else{const t=this.springs;ui(pi(e),(e=>t[e].resume()))}return this}each(e){di(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,mi(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&&mi(t,(([e,t])=>{t.value=i,e(t,this,this._item)})),l&&(this._started=!1,mi(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)}Gl.onFrame(this._onFrame)}}function Ha(e,t){return Promise.all(t.map((t=>Ga(e,t)))).then((t=>pa(e,t)))}async function Ga(e,t,n){const{keys:o,to:r,from:l,loop:i,onRest:s,onResolve:a}=t,c=ai.obj(t.default)&&t.default;i&&(t.loop=!1),!1===r&&(t.to=null),!1===l&&(t.from=null);const u=ai.arr(r)||ai.fun(r)?r:void 0;u?(t.to=void 0,t.onRest=void 0,c&&(c.onRest=void 0)):ui(Fa,(n=>{const o=t[n];if(ai.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,gi(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===Ys(t,"cancel");(u||m&&d.asyncId)&&p.push(da(++e._lastAsyncId,{props:t,state:d,actions:{pause:si,resume:si,start(t,n){m?(va(d,e._lastAsyncId),n(ha(e))):(t.onRest=s,n(fa(u,t,d,e)))}}})),d.paused&&await new Promise((e=>{d.resumeQueue.add(e)}));const g=pa(e,await Promise.all(p));if(i&&g.finished&&(!n||!g.noop)){const n=Pa(t,i,r);if(n)return Ka(e,[n]),Ga(e,n,!0)}return a&&Gl.batchedUpdates((()=>a(g,e,e.item))),g}function Ua(e,t){const n=$s({},e.springs);return t&&ui(pi(t),(e=>{ai.und(e.keys)&&(e=La(e)),ai.obj(e.to)||(e=$s({},e,{to:void 0})),ja(n,e,(e=>$a(e)))})),Wa(e,n),n}function Wa(e,t){di(t,((t,n)=>{e.springs[n]||(e.springs[n]=t,ls(t,e))}))}function $a(e,t){const n=new Ta;return n.key=e,t&&ls(n,t),n}function ja(e,t,n){t.keys&&ui(t.keys,(o=>{(e[o]||(e[o]=n(o)))._prepareNode(t)}))}function Ka(e,t){ui(t,(t=>{ja(e.springs,t,(t=>$a(t,e)))}))}const qa=["children"],Ya=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,qa);const o=(0,li.useContext)(Za),r=n.pause||!!o.pause,l=n.immediate||!!o.immediate;n=function(e,t){const[n]=(0,li.useState)((()=>({inputs:t,result:e()}))),o=(0,li.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,li.useEffect)((()=>{o.current=l,r==n&&(n.inputs=n.result=void 0)}),[l]),l.result}((()=>({pause:r,immediate:l})),[r,l]);const{Provider:i}=Za;return li.createElement(i,{value:n},t)},Za=(Qa=Ya,Xa={},Object.assign(Qa,li.createContext(Xa)),Qa.Provider._context=Qa,Qa.Consumer._context=Qa,Qa);var Qa,Xa;Ya.Provider=Za.Provider,Ya.Consumer=Za.Consumer;const Ja=()=>{const e=[],t=function(t){ys(`${bs}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 ui(e,((e,r)=>{if(ai.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 ui(e,(e=>e.pause(...arguments))),this},t.resume=function(){return ui(e,(e=>e.resume(...arguments))),this},t.set=function(t){ui(e,(e=>e.set(t)))},t.start=function(t){const n=[];return ui(e,((e,o)=>{if(ai.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 ui(e,(e=>e.stop(...arguments))),this},t.update=function(t){return ui(e,((e,n)=>e.update(this._getProps(t,e,n)))),this};const n=function(e,t,n){return ai.fun(e)?e(n,t):e};return t._getProps=n,t};function ec(e,t,n){const o=ai.fun(t)&&t;o&&!n&&(n=[]);const r=(0,li.useMemo)((()=>o||3==arguments.length?Ja():void 0),[]),l=(0,li.useRef)(0),i=Ss(),s=(0,li.useMemo)((()=>({ctrls:[],queue:[],flush(e,t){const n=Ua(e,t);return l.current>0&&!s.queue.length&&!Object.keys(n).some((t=>!e.springs[t]))?Ha(e,t):new Promise((o=>{Wa(e,n),s.queue.push((()=>{o(Ha(e,t))})),i()}))}})),[]),a=(0,li.useRef)([...s.ctrls]),c=[],u=Is(e)||0;function d(e,n){for(let r=e;r<n;r++){const e=a.current[r]||(a.current[r]=new Va(null,s.flush)),n=o?o(r,e):t[r];n&&(c[r]=Ra(n))}}(0,li.useMemo)((()=>{ui(a.current.slice(e,u),(e=>{ra(e,r),e.stop(!0)})),a.current.length=e,d(u,e)}),[e]),(0,li.useMemo)((()=>{d(0,Math.min(u,e))}),n);const p=a.current.map(((e,t)=>Ua(e,c[t]))),m=(0,li.useContext)(Ya),g=Is(m),h=m!==g&&na(m);Cs((()=>{l.current++,s.ctrls=a.current;const{queue:e}=s;e.length&&(s.queue=[],ui(e,(e=>e()))),ui(a.current,((e,t)=>{null==r||r.add(e),h&&e.start({default:m});const n=c[t];n&&(la(e,n.ref),e.ref?e.queue.push(n):e.start(n))}))})),ws((()=>()=>{ui(s.ctrls,(e=>e.stop(!0)))}));const f=p.map((e=>$s({},e)));return r?[f,r]:f}let tc;!function(e){e.MOUNT="mount",e.ENTER="enter",e.UPDATE="update",e.LEAVE="leave"}(tc||(tc={}));class nc extends Ea{constructor(e,t){super(),this.key=void 0,this.idle=!0,this.calc=void 0,this._active=new Set,this.source=e,this.calc=Yi(...t);const n=this._get(),o=zs(n);Ns(this,o.create(n))}advance(e){const t=this._get();ci(t,this.get())||(Ts(this).setValue(t),this._onChange(t,this.idle)),!this.idle&&rc(this._active)&&lc(this)}_get(){const e=ai.arr(this.source)?this.source.map(es):pi(es(this.source));return this.calc(...e)}_start(){this.idle&&!rc(this._active)&&(this.idle=!1,ui(Ps(this),(e=>{e.done=!1})),yi.skipAnimation?(Gl.batchedUpdates((()=>this.advance())),lc(this)):Bi.start(this))}_attach(){let e=1;ui(pi(this.source),(t=>{Ji(t)&&ls(t,this),_a(t)&&(t.idle||this._active.add(t),e=Math.max(e,t.priority+1))})),this.priority=e,this._start()}_detach(){ui(pi(this.source),(e=>{Ji(e)&&is(e,this)})),this._active.clear(),lc(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=pi(this.source).reduce(((e,t)=>Math.max(e,(_a(t)?t.priority:0)+1)),0))}}function oc(e){return!1!==e.idle}function rc(e){return!e.size||Array.from(e).every(oc)}function lc(e){e.idle||(e.idle=!0,ui(Ps(e),(e=>{e.done=!0})),ns(e,{type:"idle",parent:e}))}yi.assign({createStringInterpolator:vs,to:(e,t)=>new nc(e,t)}),Bi.advance;const ic=window.ReactDOM;function sc(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 ac=["style","children","scrollTop","scrollLeft"],cc=/^--/;function uc(e,t){return null==t||"boolean"==typeof t||""===t?"":"number"!=typeof t||0===t||cc.test(e)||pc.hasOwnProperty(e)&&pc[e]?(""+t).trim():t+"px"}const dc={};let pc={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 mc=["Webkit","Ms","Moz","O"];pc=Object.keys(pc).reduce(((e,t)=>(mc.forEach((n=>e[((e,t)=>e+t.charAt(0).toUpperCase()+t.substring(1))(n,t)]=e[t])),e)),pc);const gc=["x","y","z"],hc=/^(matrix|translate|scale|rotate|skew)/,fc=/^(translate)/,vc=/^(rotate|skew)/,bc=(e,t)=>ai.num(e)&&0!==e?e+t:e,kc=(e,t)=>ai.arr(e)?e.every((e=>kc(e,t))):ai.num(e)?e===t:parseFloat(e)===t;class _c extends Ds{constructor(e){let{x:t,y:n,z:o}=e,r=sc(e,gc);const l=[],i=[];(t||n||o)&&(l.push([t||0,n||0,o||0]),i.push((e=>[`translate3d(${e.map((e=>bc(e,"px"))).join(",")})`,kc(e,0)]))),di(r,((e,t)=>{if("transform"===t)l.push([e||""]),i.push((e=>[e,""===e]));else if(hc.test(t)){if(delete r[t],ai.und(e))return;const n=fc.test(t)?"px":vc.test(t)?"deg":"";l.push(pi(e)),i.push("rotate3d"===t?([e,t,o,r])=>[`rotate3d(${e},${t},${o},${bc(r,n)})`,kc(r,0)]:e=>[`${t}(${e.map((e=>bc(e,n))).join(",")})`,kc(e,t.startsWith("scale")?1:0)])}})),l.length&&(r.transform=new yc(l,i)),super(r)}}class yc extends os{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 ui(this.inputs,((n,o)=>{const r=es(n[0]),[l,i]=this.transforms[o](ai.arr(r)?r:n.map(es));e+=" "+l,t=t&&i})),t?"none":e}observerAdded(e){1==e&&ui(this.inputs,(e=>ui(e,(e=>Ji(e)&&ls(e,this)))))}observerRemoved(e){0==e&&ui(this.inputs,(e=>ui(e,(e=>Ji(e)&&is(e,this)))))}eventObserved(e){"change"==e.type&&(this._value=null),ns(this,e)}}const Ec=["scrollTop","scrollLeft"];yi.assign({batchedUpdates:ic.unstable_batchedUpdates,createStringInterpolator:vs,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 Cc=((e,{applyAnimatedValues:t=(()=>!1),createAnimatedStyle:n=(e=>new Ds(e)),getComponentProps:o=(e=>e)}={})=>{const r={applyAnimatedValues:t,createAnimatedStyle:n,getComponentProps:o},l=e=>{const t=Ws(e)||"Anonymous";return(e=ai.str(e)?l[e]||(l[e]=Hs(e,r)):e[Us]||(e[Us]=Hs(e,r))).displayName=`Animated(${t})`,e};return di(e,((t,n)=>{ai.arr(e)&&(n=Ws(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=sc(o,ac),c=Object.values(a),u=Object.keys(a).map((t=>n||e.hasAttribute(t)?t:dc[t]||(dc[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=uc(t,r[t]);cc.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 _c(e),getComponentProps:e=>sc(e,Ec)}).animated,Sc=e=>e+1,wc=e=>({top:e.offsetTop,left:e.offsetLeft}),Bc=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)(Sc,0),[u,p]=(0,s.useReducer)(Sc,0),[m,g]=(0,s.useState)({x:0,y:0}),h=(0,s.useMemo)((()=>l.current?wc(l.current):null),[r]),f=(0,s.useMemo)((()=>{if(!n||!l.current)return()=>{};const e=(0,yl.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",f()}({x:o,y:r}),v.x=o,v.y=r)}return(0,s.useLayoutEffect)((()=>{a&&p()}),[a]),(0,s.useLayoutEffect)((()=>{if(!h)return;if(i)return void f();l.current.style.transform="";const e=wc(l.current);c(),g({x:Math.round(h.left-e.left),y:Math.round(h.top-e.top)})}),[r]),v.x=0,v.y=0,function(e,t){const n=ai.fun(e),[[o],r]=ec(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},Ic=".block-editor-block-list__block",xc=".block-list-appender",Tc=".block-editor-button-block-appender";function Nc(e,t){return t.closest([Ic,xc,Tc].join(","))===e}function Pc(e){for(;e&&e.nodeType!==e.ELEMENT_NODE;)e=e.parentNode;if(!e)return;const t=e.closest(Ic);return t?t.id.slice("block-".length):void 0}function Lc(e){const t=(0,s.useRef)(),n=function(e){return(0,m.useSelect)((t=>{const{getSelectedBlocksInitialCaretPosition:n,isNavigationMode:o,isBlockSelected:r}=t(Jn);if(r(e)&&!o())return n()}),[e])}(e),{isBlockSelected:o,isMultiSelecting:r}=(0,m.useSelect)(Jn);return(0,s.useEffect)((()=>{if(!o(e)||r())return;if(null==n)return;if(!t.current)return;const{ownerDocument:l}=t.current;if(t.current.contains(l.activeElement))return;const i=yl.focus.tabbable.find(t.current).filter((e=>(0,yl.isTextField)(e))),s=-1===n,a=(s?u.last:u.first)(i)||t.current;if(Nc(t.current,a)){if(!t.current.getAttribute("contenteditable")){const e=yl.focus.tabbable.findNext(t.current);if(e&&Nc(t.current,e)&&(0,yl.isFormElement)(e))return void e.focus()}(0,yl.placeCaretAtHorizontalEdge)(a,s)}else t.current.focus()}),[n,e]),t}function Rc(e){if(e.defaultPrevented)return;const t="mouseover"===e.type?"add":"remove";e.preventDefault(),e.currentTarget.classList[t]("is-hovered")}function Mc(){const e=(0,m.useSelect)((e=>{const{isNavigationMode:t,getSettings:n}=e(Jn);return t()||n().outlineMode}),[]);return(0,d.useRefEffect)((t=>{if(e)return t.addEventListener("mouseout",Rc),t.addEventListener("mouseover",Rc),()=>{t.removeEventListener("mouseout",Rc),t.removeEventListener("mouseover",Rc),t.classList.remove("is-hovered")}}),[e])}function Ac(e){return(0,m.useSelect)((t=>{const{isBlockBeingDragged:n,isBlockHighlighted:o,isBlockSelected:l,isBlockMultiSelected:i,getBlockName:s,getSettings:a,hasSelectedInnerBlock:u,isTyping:d}=t(Jn),{outlineMode:p}=a(),m=n(e),g=l(e),h=s(e),f=u(e,!0);return c()({"is-selected":g,"is-highlighted":o(e),"is-multi-selected":i(e),"is-reusable":(0,r.isReusableBlock)((0,r.getBlockType)(h)),"is-dragging":m,"has-child-selected":f,"remove-outline":g&&p&&d()})}),[e])}function Dc(e){return(0,m.useSelect)((t=>{const n=t(Jn).getBlockName(e),o=(0,r.getBlockType)(n);if((null==o?void 0:o.apiVersion)>1)return(0,r.getBlockDefaultClassName)(n)}),[e])}function Oc(e){return(0,m.useSelect)((t=>{const{getBlockName:n,getBlockAttributes:o}=t(Jn),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 Fc(e){return(0,m.useSelect)((t=>{const{hasBlockMovingClientId:n,canInsertBlockType:o,getBlockName:r,getBlockRootClientId:l,isBlockSelected:i}=t(Jn);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 zc(e){const{isBlockSelected:t}=(0,m.useSelect)(Jn),{selectBlock:n,selectionChange:o}=(0,m.useDispatch)(Jn);return(0,d.useRefEffect)((r=>{function l(l){r.parentElement.closest('[contenteditable="true"]')||(t(e)?l.target.isContentEditable||o(e):Nc(r,l.target)&&n(e))}return r.addEventListener("focusin",l),()=>{r.removeEventListener("focusin",l)}}),[t,n])}const Vc=window.wp.keycodes;function Hc(e){const t=(0,m.useSelect)((t=>t(Jn).isBlockSelected(e)),[e]),{getBlockRootClientId:n,getBlockIndex:o}=(0,m.useSelect)(Jn),{insertDefaultBlock:r,removeBlock:l}=(0,m.useDispatch)(Jn);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!==Vc.ENTER&&s!==Vc.BACKSPACE&&s!==Vc.DELETE||a!==i||(0,yl.isTextField)(a)||(t.preventDefault(),s===Vc.ENTER?r({},n(e),o(e)+1):l(e))}function a(e){e.preventDefault()}}),[e,t,n,o,r,l])}function Gc(e){const{isNavigationMode:t,isBlockSelected:n}=(0,m.useSelect)(Jn),{setNavigationMode:o,selectBlock:r}=(0,m.useDispatch)(Jn);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])}function Uc(){const e=(0,s.useContext)(oh);return(0,d.useRefEffect)((t=>{if(e)return e.observe(t),()=>{e.unobserve(t)}}),[e])}function Wc(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{__unstableIsHtml:t,__unstableIsDisabled:n=!1}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{clientId:o,className:l,wrapperProps:i={},isAligned:a}=(0,s.useContext)($c),{index:u,mode:p,name:g,blockApiVersion:f,blockTitle:v,isPartOfSelection:b,adjustScrolling:k,enableAnimation:_}=(0,m.useSelect)((e=>{const{getBlockIndex:t,getBlockMode:n,getBlockName:l,isTyping:i,getGlobalBlockCount:s,isBlockSelected:a,isBlockMultiSelected:c,isAncestorMultiSelected:u,isFirstMultiSelectedBlock:d}=e(Jn),p=a(o),m=c(o)||u(o),g=l(o),h=(0,r.getBlockType)(g);return{index:t(o),mode:n(o),name:g,blockApiVersion:(null==h?void 0:h.apiVersion)||1,blockTitle:null==h?void 0:h.title,isPartOfSelection:p||m,adjustScrolling:p||d(o),enableAnimation:!i()&&s()<=200}}),[o]),y=(0,h.sprintf)((0,h.__)("Block: %s"),v),E="html"!==p||t?"":"-visual",C=(0,d.useMergeRefs)([e.ref,Lc(o),_o(o),zc(o),Hc(o),Gc(o),Mc(),Uc(),Bc({isSelected:b,adjustScrolling:k,enableAnimation:_,triggerAnimationOnChange:u}),(0,d.useDisabled)({isDisabled:!n})]),S=oo();return f<2&&o===S.clientId&&"undefined"!=typeof process&&process.env,{...i,...e,ref:C,id:`block-${o}${E}`,tabIndex:0,role:"document","aria-label":y,"data-block":o,"data-type":g,"data-title":v,className:c()(c()("block-editor-block-list__block",{"wp-block":!a}),l,e.className,i.className,Ac(o),Dc(o),Oc(o),Fc(o)),style:{...i.style,...e.style}}}Wc.save=r.__unstableGetBlockProps;const $c=(0,s.createContext)();function jc(e){let{children:t,isHtml:n,...o}=e;return(0,s.createElement)("div",Wc(o,{__unstableIsHtml:n}),t)}const Kc=(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(Jn),d=a(n),p=r(n),m=s(o),g=c(n,o),h=u(n,o),{name:f,attributes:v,isValid:b}=d||{};return{mode:l(n),isSelectionEnabled:i(),isLocked:!!m,canRemove:g,canMove:h,block:d,name:f,attributes:v,isValid:b,isSelected:p}})),qc=(0,m.withDispatch)(((e,t,n)=>{let{select:o}=n;const{updateBlockAttributes:l,insertBlocks:i,mergeBlocks:s,replaceBlocks:a,toggleSelection:c,__unstableMarkLastChangeAsPersistent:u}=e(Jn);return{setAttributes(e){const{getMultiSelectedBlockClientIds:n}=o(Jn),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(Jn),s=l(n);i(e,s+1,r)},onMerge(e){const{clientId:n}=t,{getPreviousBlockClientId:r,getNextBlockClientId:l}=o(Jn);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)}}})),Yc=(0,d.compose)(d.pure,Kc,qc,(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:g,name:h,isValid:f,attributes:v,wrapperProps:b,setAttributes:k,onReplace:_,onInsertBlocksAfter:y,onMerge:E,toggleSelection:C}=e;const S=(0,m.useSelect)((e=>{const{getSettings:t}=e(Jn);return t().supportsLayout}),[]),{removeBlock:w}=(0,m.useDispatch)(Jn),B=(0,s.useCallback)((()=>w(a)),[a]);let I=(0,s.createElement)(Il,{name:h,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 x=(0,r.getBlockType)(h);null!=x&&x.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,x.getEditWrapperProps(v)));const T=b&&!!b["data-align"]&&!S;let N;if(T&&(I=(0,s.createElement)("div",{className:"wp-block","data-align":b["data-align"]},I)),f)N="html"===o?(0,s.createElement)(s.Fragment,null,(0,s.createElement)("div",{style:{display:"none"}},I),(0,s.createElement)(jc,{isHtml:!0},(0,s.createElement)(Vl,{clientId:a}))):(null==x?void 0:x.apiVersion)>1?I:(0,s.createElement)(jc,b,I);else{const e=n?(0,r.serializeRawBlock)(n):(0,r.getSaveContent)(x,v);N=(0,s.createElement)(jc,{className:"has-warning"},(0,s.createElement)(Ml,{clientId:a}),(0,s.createElement)(s.RawHTML,null,(0,yl.safeHTML)(e)))}const P={clientId:a,className:null!==(t=b)&&void 0!==t&&t["data-align"]&&S?c()(g,`align${b["data-align"]}`):g,wrapperProps:(0,u.omit)(b,["data-align"]),isAligned:T},L=(0,s.useMemo)((()=>P),Object.values(P));return(0,s.createElement)($c.Provider,{value:L},(0,s.createElement)(Fl,{fallback:(0,s.createElement)(jc,{className:"has-warning"},(0,s.createElement)(Dl,null))},N))})),Zc=window.wp.htmlEntities,Qc=(0,s.createElement)(A.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(A.Path,{d:"M18 11.2h-5.2V6h-1.6v5.2H6v1.6h5.2V18h1.6v-5.2H18z"})),Xc=[(0,s.createInterpolateElement)((0,h.__)("While writing, you can press <kbd>/</kbd> to quickly insert new blocks."),{kbd:(0,s.createElement)("kbd",null)}),(0,s.createInterpolateElement)((0,h.__)("Indent a list by pressing <kbd>space</kbd> at the beginning of a line."),{kbd:(0,s.createElement)("kbd",null)}),(0,s.createInterpolateElement)((0,h.__)("Outdent a list by pressing <kbd>backspace</kbd> at the beginning of a line."),{kbd:(0,s.createElement)("kbd",null)}),(0,h.__)("Drag files into the editor to automatically insert media blocks."),(0,h.__)("Change a block's type by pressing the block icon on the toolbar.")],Jc=function(){const[e]=(0,s.useState)(Math.floor(Math.random()*Xc.length));return(0,s.createElement)(p.Tip,null,Xc[e])},eu=(0,s.createElement)(A.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(A.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"})),tu=(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:eu});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)})),nu=function(e){let{title:t,icon:n,description:o,blockType:r}=e;return r&&(z()("`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)(tu,{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)))},ou=(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(Qn,Xn),a(e)}),[o]),l?(0,s.createElement)(m.RegistryProvider,{value:l},(0,s.createElement)(e,i({registry:l},r))):null}))),"withRegistryProvider"),ru=()=>{};function lu(e){let{clientId:t=null,value:n,selection:o,onChange:l=ru,onInput:i=ru}=e;const a=(0,m.useRegistry)(),{resetBlocks:c,resetSelection:d,replaceInnerBlocks:p,setHasControlledInnerBlocks:g,__unstableMarkNextChangeAsNotPersistent:h}=a.dispatch(Jn),{getBlockName:f,getBlocks:v}=a.select(Jn),b=(0,m.useSelect)((e=>!t||e(Jn).areInnerBlocksControlled(t)),[t]),k=(0,s.useRef)({incoming:null,outgoing:[]}),_=(0,s.useRef)(!1),y=()=>{n&&(h(),t?a.batch((()=>{g(t,!0);const e=n.map((e=>(0,r.cloneBlock)(e)));_.current&&(k.current.incoming=e),h(),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(Jn);let s=v(t),c=r(),u=!1;_.current=!0;const d=a.subscribe((()=>{if(null!==t&&null===f(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])}const iu=ou((function(e){const{children:t,settings:n}=e,{updateSettings:o}=(0,m.useDispatch)(Jn);return(0,s.useEffect)((()=>{o(n)}),[n]),lu(e),(0,s.createElement)(ko,null,t)}));function su(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)(lh,null)))}function au(){const{hasSelectedBlock:e,hasMultiSelection:t}=(0,m.useSelect)(Jn),{clearSelectedBlock:n}=(0,m.useDispatch)(Jn);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 cu(e){return(0,s.createElement)("div",i({ref:au()},e))}function uu(e){const{isMultiSelecting:t,getMultiSelectedBlockClientIds:n,hasMultiSelection:o,getSelectedBlockClientId:r,getSelectedBlocksInitialCaretPosition:l,__unstableIsFullySelected:i}=e(Jn);return{isMultiSelecting:t(),multiSelectedBlockClientIds:n(),hasMultiSelection:o(),selectedBlockClientId:r(),initialPosition:l(),isFullSelection:i()}}function du(){const{initialPosition:e,isMultiSelecting:t,multiSelectedBlockClientIds:n,hasMultiSelection:o,selectedBlockClientId:r,isFullSelection:l}=(0,m.useSelect)(uu,[]),i=yo(r),s=yo((0,u.first)(n)),a=yo((0,u.last)(n));return(0,d.useRefEffect)((c=>{const{ownerDocument:u}=c,{defaultView:d}=u;if(null==e)return;if(!o||t){if(!r||t)return;const e=d.getSelection();if(e.rangeCount&&!e.isCollapsed){const t=i.current,{startContainer:n,endContainer:o}=e.getRangeAt(0);!t||t.contains(n)&&t.contains(o)||e.removeAllRanges()}return}const{length:p}=n;if(p<2)return;if(!l)return;if(c.contentEditable=!0,c.focus(),!s.current||!a.current)return;const m=d.getSelection(),g=u.createRange();g.setStartBefore(s.current),g.setEndAfter(a.current),m.removeAllRanges(),m.addRange(g)}),[o,t,n,r,e,l])}function pu(e,t,n,o){let r,l=yl.focus.focusable.find(n);return t&&l.reverse(),l=l.slice(l.indexOf(e)+1),o&&(r=e.getBoundingClientRect()),l.find((function(e){if(!yl.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 mu(){const{getSelectedBlockClientId:e,getMultiSelectedBlocksEndClientId:t,getPreviousBlockClientId:n,getNextBlockClientId:o,getSettings:r,hasMultiSelection:l}=(0,m.useSelect)(Jn);return(0,d.useRefEffect)((i=>{let s;function a(){s=null}function c(a){const{keyCode:c,target:u}=a,d=c===Vc.UP,p=c===Vc.DOWN,m=c===Vc.LEFT,g=c===Vc.RIGHT,h=d||m,f=m||g,v=d||p,b=f||v,k=a.shiftKey,_=k||a.ctrlKey||a.altKey||a.metaKey,y=v?yl.isVerticalEdge:yl.isHorizontalEdge,{ownerDocument:E}=i,{defaultView:C}=E;if(l())return;if(v?s||(s=(0,yl.computeCaretRect)(C)):s=null,a.defaultPrevented)return;if(!b)return;if(!function(e,t,n){if((t===Vc.UP||t===Vc.DOWN)&&!n)return!0;const{tagName:o}=e;return"INPUT"===o?["button","checkbox","color","file","image","radio","reset","submit"].includes(e.getAttribute("type")):"TEXTAREA"!==o}(u,c,_))return;const S=(0,yl.isRTL)(u)?!h:h,{keepCaretInsideBlock:w}=r(),B=e();if(k){const e=t(),r=n(e||B),l=o(e||B);(h&&r||!h&&l)&&function(e,t){const n=pu(e,t,i);return!n||!function(e,t){return e.closest(Ic)===t.closest(Ic)}(e,n)}(u,h)&&y(u,h)&&(i.contentEditable=!0,i.focus())}else if(v&&(0,yl.isVerticalEdge)(u,h)&&!w){const e=pu(u,h,i,!0);e&&((0,yl.placeCaretAtVerticalEdge)(e,h,s),a.preventDefault())}else if(f&&C.getSelection().isCollapsed&&(0,yl.isHorizontalEdge)(u,S)&&!w){const e=pu(u,S,i);(0,yl.placeCaretAtHorizontalEdge)(e,h),a.preventDefault()}}return i.addEventListener("mousedown",a),i.addEventListener("keydown",c),()=>{i.removeEventListener("mousedown",a),i.removeEventListener("keydown",c)}}),[])}const gu=window.wp.keyboardShortcuts;function hu(){const{getBlockOrder:e,getSelectedBlockClientIds:t,getBlockRootClientId:n}=(0,m.useSelect)(Jn),{multiSelect:o}=(0,m.useDispatch)(Jn),r=(0,gu.__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,yl.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 fu(e,t){e.contentEditable=t,t&&e.focus()}function vu(){const{startMultiSelect:e,stopMultiSelect:t}=(0,m.useDispatch)(Jn),{isSelectionEnabled:n,hasMultiSelection:o}=(0,m.useSelect)(Jn);return(0,d.useRefEffect)((r=>{const{ownerDocument:l}=r,{defaultView:i}=l;let s,a;function c(){t(),i.removeEventListener("mouseup",c),a=i.requestAnimationFrame((()=>{if(o())return;fu(r,!1);const e=i.getSelection();if(e.rangeCount){const{commonAncestorContainer:t}=e.getRangeAt(0);s.contains(t)&&s.focus()}}))}function u(t){let{buttons:o,target:a}=t;1===o&&a.getAttribute("contenteditable")&&n()&&(s=l.activeElement,e(),i.addEventListener("mouseup",c),fu(r,!0))}return r.addEventListener("mouseout",u),()=>{r.removeEventListener("mouseout",u),i.removeEventListener("mouseup",c),i.cancelAnimationFrame(a)}}),[e,t,n,o])}function bu(e,t){e.contentEditable=t,t&&e.focus()}function ku(){const{multiSelect:e,selectBlock:t,selectionChange:n}=(0,m.useDispatch)(Jn),{getBlockParents:o,getBlockSelectionStart:r}=(0,m.useSelect)(Jn);return(0,d.useRefEffect)((n=>{const{ownerDocument:l}=n,{defaultView:i}=l;function s(l){const s=i.getSelection();if(!s.rangeCount)return void bu(n,!1);const a=l.shiftKey&&"mouseup"===l.type;if(s.isCollapsed&&!a)return void bu(n,!1);let c=Pc(function(e){const{anchorNode:t,anchorOffset:n}=e;return t.nodeType===t.TEXT_NODE?t:t.childNodes[n]}(s)),u=Pc(function(e){const{focusNode:t,focusOffset:n}=e;return t.nodeType===t.TEXT_NODE?t:t.childNodes[n-1]}(s));if(a){const e=r(),t=Pc(l.target),n=t!==u;(c===u&&s.isCollapsed||!u||n)&&(u=t),c!==e&&(c=e)}if(void 0!==c||void 0!==u)if(c===u)t(c);else{const t=[...o(c),c],n=[...o(u),u],r=function(e,t){let n=0;for(;e[n]===t[n];)n++;return n}(t,n);e(t[r],n[r])}else bu(n,!1)}function a(){l.addEventListener("selectionchange",s),i.addEventListener("mouseup",s)}function c(){l.removeEventListener("selectionchange",s),i.removeEventListener("mouseup",s)}function u(){c(),a()}return a(),n.addEventListener("focusin",u),()=>{c(),n.removeEventListener("focusin",u)}}),[e,t,n,o])}function _u(){const{selectBlock:e}=(0,m.useDispatch)(Jn),{isSelectionEnabled:t,getBlockSelectionStart:n,hasMultiSelection:o}=(0,m.useSelect)(Jn);return(0,d.useRefEffect)((r=>{function l(l){if(!t()||0!==l.button)return;const i=n(),s=Pc(l.target);l.shiftKey?i!==s&&(r.contentEditable=!0,r.focus()):o()&&e(s)}return r.addEventListener("mousedown",l),()=>{r.removeEventListener("mousedown",l)}}),[e,t,n,o])}function yu(){const{__unstableIsFullySelected:e,getSelectedBlockClientIds:t,__unstableIsSelectionMergeable:n,hasMultiSelection:o}=(0,m.useSelect)(Jn),{replaceBlocks:l,__unstableSplitSelection:i,removeBlocks:s,__unstableDeleteSelection:a,__unstableExpandSelection:c}=(0,m.useDispatch)(Jn);return(0,d.useRefEffect)((u=>{function d(e){var t;o()&&null!==(t=e.inputType)&&void 0!==t&&t.startsWith("format")&&e.preventDefault()}function p(d){d.defaultPrevented||o()&&(d.keyCode===Vc.ENTER?(u.contentEditable=!1,d.preventDefault(),e()?l(t(),(0,r.createBlock)((0,r.getDefaultBlockName)())):i()):d.keyCode===Vc.BACKSPACE||d.keyCode===Vc.DELETE?(u.contentEditable=!1,d.preventDefault(),e()?s(t()):n()?a(d.keyCode===Vc.DELETE):c()):1!==d.key.length||d.metaKey||d.ctrlKey||(u.contentEditable=!1,n()?a(d.keyCode===Vc.DELETE):(d.preventDefault(),u.ownerDocument.defaultView.getSelection().removeAllRanges())))}function m(e){o()&&(u.contentEditable=!1,n()?a():(e.preventDefault(),u.ownerDocument.defaultView.getSelection().removeAllRanges()))}return u.addEventListener("beforeinput",d),u.addEventListener("keydown",p),u.addEventListener("compositionstart",m),()=>{u.removeEventListener("beforeinput",d),u.removeEventListener("keydown",p),u.removeEventListener("compositionstart",m)}}),[])}function Eu(){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)(Jn),{setNavigationMode:a}=(0,m.useDispatch)(Jn),c=(0,m.useSelect)((e=>e(Jn).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";yl.focus.tabbable[n](t.target).focus()}}const g=(0,s.createElement)("div",{ref:t,tabIndex:c,onFocus:p}),h=(0,s.createElement)("div",{ref:n,tabIndex:c,onFocus:p}),f=(0,d.useRefEffect)((s=>{function c(e){if(e.defaultPrevented)return;if(e.keyCode===Vc.ESCAPE&&!r())return e.preventDefault(),void a(!0);if(e.keyCode!==Vc.TAB)return;const o=e.shiftKey,i=o?"findPrevious":"findNext";if(!r()&&!l())return void(e.target===s&&a(!0));if(((0,yl.isFormElement)(e.target)||e.target.getAttribute("data-block")===l())&&(0,yl.isFormElement)(yl.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!==Vc.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=yl.focus.tabbable[l](o.target);i!==t.current&&i!==n.current||(o.preventDefault(),i.focus({preventScroll:!0}))}const{ownerDocument:m}=s,{defaultView:g}=m;return g.addEventListener("keydown",p),s.addEventListener("keydown",c),s.addEventListener("focusout",d),()=>{g.removeEventListener("keydown",p),s.removeEventListener("keydown",c),s.removeEventListener("focusout",d)}}),[]);return[g,(0,d.useMergeRefs)([e,f]),h]}(),o=(0,m.useSelect)((e=>e(Jn).hasMultiSelection()),[]);return[e,(0,d.useMergeRefs)([t,yu(),vu(),ku(),_u(),du(),hu(),mu(),(0,d.useRefEffect)((e=>{if(e.tabIndex=-1,e.contentEditable=o,o)return e.setAttribute("aria-label",(0,h.__)("Multiple selected blocks")),()=>{e.removeAttribute("aria-label")}}),[o])]),n]}const Cu=(0,s.forwardRef)((function(e,t){let{children:n,...o}=e;const[r,l,a]=Eu();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)})),Su="editor-styles-wrapper";function wu(e){return(0,s.useMemo)((()=>{const t=document.implementation.createHTMLDocument("");return t.body.innerHTML=e,Array.from(t.body.children)}),[e])}const Bu=(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)((()=>({}))),[g,f]=(0,s.useState)(),[v,b]=(0,s.useState)([]),k=wu(null==a?void 0:a.styles),_=wu(null==a?void 0:a.scripts),y=au(),[E,C,S]=Eu(),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),f(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)}return e.addEventListener("load",t),()=>e.removeEventListener("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()}))}),[]),I=(0,d.useMergeRefs)([n,y,C]),x=(0,d.useRefEffect)((e=>{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(`.${Su}`)||t.includes(".wp-block"))}))&&!e.ownerDocument.getElementById(n.id)){e.appendChild(n.cloneNode(!0));const t=n.id.replace("-css","-inline-css"),o=document.getElementById(t);o&&e.appendChild(o.cloneNode(!0))}}))}),[]);return 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,srcDoc:"<!doctype html>",title:(0,h.__)("Editor canvas")}),g&&(0,s.createPortal)((0,s.createElement)(s.Fragment,null,(0,s.createElement)("head",{ref:B},r),(0,s.createElement)("body",{ref:I,className:c()(Su,...v)},(0,s.createElement)("div",{style:{display:"none"},ref:x}),(0,s.createElement)(p.__experimentalStyleProvider,{document:g},o))),g.documentElement)),l>=0&&S)}));var Iu={grad:.9,turn:360,rad:360/(2*Math.PI)},xu=function(e){return"string"==typeof e?e.length>0:"number"==typeof e},Tu=function(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=Math.pow(10,t)),Math.round(n*e)/n+0},Nu=function(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=1),e>n?n:e>t?e:t},Pu=function(e){return(e=isFinite(e)?e%360:0)>0?e:e+360},Lu=function(e){return{r:Nu(e.r,0,255),g:Nu(e.g,0,255),b:Nu(e.b,0,255),a:Nu(e.a)}},Ru=function(e){return{r:Tu(e.r),g:Tu(e.g),b:Tu(e.b),a:Tu(e.a,3)}},Mu=/^#([0-9a-f]{3,8})$/i,Au=function(e){var t=e.toString(16);return t.length<2?"0"+t:t},Du=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}},Ou=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}},Fu=function(e){return{h:Pu(e.h),s:Nu(e.s,0,100),l:Nu(e.l,0,100),a:Nu(e.a)}},zu=function(e){return{h:Tu(e.h),s:Tu(e.s),l:Tu(e.l),a:Tu(e.a,3)}},Vu=function(e){return Ou((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},Hu=function(e){return{h:(t=Du(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},Gu=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Uu=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Wu=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,$u=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,ju={string:[[function(e){var t=Mu.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?Tu(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?Tu(parseInt(e.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(e){var t=Wu.exec(e)||$u.exec(e);return t?t[2]!==t[4]||t[4]!==t[6]?null:Lu({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=Gu.exec(e)||Uu.exec(e);if(!t)return null;var n,o,r=Fu({h:(n=t[1],o=t[2],void 0===o&&(o="deg"),Number(n)*(Iu[o]||1)),s:Number(t[3]),l:Number(t[4]),a:void 0===t[5]?1:Number(t[5])/(t[6]?100:1)});return Vu(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 xu(t)&&xu(n)&&xu(o)?Lu({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(!xu(t)||!xu(n)||!xu(o))return null;var i=Fu({h:Number(t),s:Number(n),l:Number(o),a:Number(l)});return Vu(i)},"hsl"],[function(e){var t=e.h,n=e.s,o=e.v,r=e.a,l=void 0===r?1:r;if(!xu(t)||!xu(n)||!xu(o))return null;var i=function(e){return{h:Pu(e.h),s:Nu(e.s,0,100),v:Nu(e.v,0,100),a:Nu(e.a)}}({h:Number(t),s:Number(n),v:Number(o),a:Number(l)});return Ou(i)},"hsv"]]},Ku=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]},qu=function(e,t){var n=Hu(e);return{h:n.h,s:Nu(n.s+100*t,0,100),l:n.l,a:n.a}},Yu=function(e){return(299*e.r+587*e.g+114*e.b)/1e3/255},Zu=function(e,t){var n=Hu(e);return{h:n.h,s:n.s,l:Nu(n.l+100*t,0,100),a:n.a}},Qu=function(){function e(e){this.parsed=function(e){return"string"==typeof e?Ku(e.trim(),ju.string):"object"==typeof e&&null!==e?Ku(e,ju.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 Tu(Yu(this.rgba),2)},e.prototype.isDark=function(){return Yu(this.rgba)<.5},e.prototype.isLight=function(){return Yu(this.rgba)>=.5},e.prototype.toHex=function(){return t=(e=Ru(this.rgba)).r,n=e.g,o=e.b,l=(r=e.a)<1?Au(Tu(255*r)):"","#"+Au(t)+Au(n)+Au(o)+l;var e,t,n,o,r,l},e.prototype.toRgb=function(){return Ru(this.rgba)},e.prototype.toRgbString=function(){return t=(e=Ru(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 zu(Hu(this.rgba))},e.prototype.toHslString=function(){return t=(e=zu(Hu(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=Du(this.rgba),{h:Tu(e.h),s:Tu(e.s),v:Tu(e.v),a:Tu(e.a,3)};var e},e.prototype.invert=function(){return Xu({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),Xu(qu(this.rgba,e))},e.prototype.desaturate=function(e){return void 0===e&&(e=.1),Xu(qu(this.rgba,-e))},e.prototype.grayscale=function(){return Xu(qu(this.rgba,-1))},e.prototype.lighten=function(e){return void 0===e&&(e=.1),Xu(Zu(this.rgba,e))},e.prototype.darken=function(e){return void 0===e&&(e=.1),Xu(Zu(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?Xu({r:(t=this.rgba).r,g:t.g,b:t.b,a:e}):Tu(this.rgba.a,3);var t},e.prototype.hue=function(e){var t=Hu(this.rgba);return"number"==typeof e?Xu({h:e,s:t.s,l:t.l,a:t.a}):Tu(t.h)},e.prototype.isEqual=function(e){return this.toHex()===Xu(e).toHex()},e}(),Xu=function(e){return e instanceof Qu?e:new Qu(e)},Ju=[],ed=function(e){e.forEach((function(e){Ju.indexOf(e)<0&&(e(Qu,ju),Ju.push(e))}))};function td(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 nd=function(e){var t=e/255;return t<.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)},od=function(e){return.2126*nd(e.r)+.7152*nd(e.g)+.0722*nd(e.b)};function rd(e){e.prototype.luminance=function(){return e=od(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=od(l))>(a=od(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 ld=n(3124),id=n.n(ld);const sd=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g;function ad(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(),g(n);e.length&&"}"!==e.charAt(0)&&(t=S()||w());)!1!==t&&(n.push(t),g(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 g(e){let t;for(e=e||[];t=h();)!1!==t&&e.push(t);return e}function h(){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 f(){const e=p(/^([^{]+)/);if(e)return cd(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=cd(t[0]),!p(/^:\s*/))return a("property missing ':'");const n=p(/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^\)]*?\)|[^};])+)/),o=e({type:"declaration",property:t.replace(sd,""),value:n?cd(n[0]).replace(sd,""):""});return p(/^[;\s]*/),o}function b(){const e=[];if(!c())return a("missing '{'");let t;for(g(e);t=v();)!1!==t&&(e.push(t),g(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=g();for(;r=k();)i.push(r),i=i.concat(g());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=cd(t[1]);if(!c())return a("@media missing '{'");const o=g().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:cd(t[1]),media:cd(t[2])})}()||function(){const e=l(),t=p(/^@supports *([^{]+)/);if(!t)return;const n=cd(t[1]);if(!c())return a("@supports missing '{'");const o=g().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=cd(t[1]),o=cd(t[2]);if(!c())return a("@document missing '{'");const r=g().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=f()||[];if(!c())return a("@page missing '{'");let n,o=g();for(;n=v();)o.push(n),o=o.concat(g());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=g().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=g();for(;t=v();)n.push(t),n=n.concat(g());return u()?e({type:"font-face",declarations:n}):a("@font-face missing '}'")}()}function w(){const e=l(),t=f();return t?(g(),e({type:"rule",selectors:t,declarations:b()})):a("selector missing")}return ud(function(){const e=d();return{type:"stylesheet",stylesheet:{source:t.source,rules:e,parsingErrors:s}}}())}function cd(e){return e?e.replace(/^\s+|\s+$/g,""):""}function ud(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){ud(e,o)})):n&&"object"==typeof n&&ud(n,o)}return n&&Object.defineProperty(e,"parent",{configurable:!0,writable:!0,enumerable:!1,value:t||null}),e}var dd=n(8575),pd=n.n(dd);const md=gd;function gd(e){this.options=e||{}}gd.prototype.emit=function(e){return e},gd.prototype.visit=function(e){return this[e.type](e)},gd.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};const hd=fd;function fd(e){md.call(this,e)}pd()(fd,md),fd.prototype.compile=function(e){return e.stylesheet.rules.map(this.visit,this).join("")},fd.prototype.comment=function(e){return this.emit("",e.position)},fd.prototype.import=function(e){return this.emit("@import "+e.import+";",e.position)},fd.prototype.media=function(e){return this.emit("@media "+e.media,e.position)+this.emit("{")+this.mapVisit(e.rules)+this.emit("}")},fd.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("}")},fd.prototype.charset=function(e){return this.emit("@charset "+e.charset+";",e.position)},fd.prototype.namespace=function(e){return this.emit("@namespace "+e.namespace+";",e.position)},fd.prototype.supports=function(e){return this.emit("@supports "+e.supports,e.position)+this.emit("{")+this.mapVisit(e.rules)+this.emit("}")},fd.prototype.keyframes=function(e){return this.emit("@"+(e.vendor||"")+"keyframes "+e.name,e.position)+this.emit("{")+this.mapVisit(e.keyframes)+this.emit("}")},fd.prototype.keyframe=function(e){const t=e.declarations;return this.emit(e.values.join(","),e.position)+this.emit("{")+this.mapVisit(t)+this.emit("}")},fd.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("}")},fd.prototype["font-face"]=function(e){return this.emit("@font-face",e.position)+this.emit("{")+this.mapVisit(e.declarations)+this.emit("}")},fd.prototype.host=function(e){return this.emit("@host",e.position)+this.emit("{")+this.mapVisit(e.rules)+this.emit("}")},fd.prototype["custom-media"]=function(e){return this.emit("@custom-media "+e.name+" "+e.media+";",e.position)},fd.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("}"):""},fd.prototype.declaration=function(e){return this.emit(e.property+":"+e.value,e.position)+this.emit(";")};const vd=bd;function bd(e){e=e||{},md.call(this,e),this.indentation=e.indent}pd()(bd,md),bd.prototype.compile=function(e){return this.stylesheet(e)},bd.prototype.stylesheet=function(e){return this.mapVisit(e.stylesheet.rules,"\n\n")},bd.prototype.comment=function(e){return this.emit(this.indent()+"/*"+e.comment+"*/",e.position)},bd.prototype.import=function(e){return this.emit("@import "+e.import+";",e.position)},bd.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}")},bd.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}")},bd.prototype.charset=function(e){return this.emit("@charset "+e.charset+";",e.position)},bd.prototype.namespace=function(e){return this.emit("@namespace "+e.namespace+";",e.position)},bd.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}")},bd.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)+"}")},bd.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")},bd.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}")},bd.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}")},bd.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}")},bd.prototype["custom-media"]=function(e){return this.emit("@custom-media "+e.name+" "+e.media+";",e.position)},bd.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()+"}"):""},bd.prototype.declaration=function(e){return this.emit(this.indent())+this.emit(e.property+": "+e.value,e.position)+this.emit(";")},bd.prototype.indent=function(e){return this.level=this.level||1,null!==e?(this.level+=e,""):Array(this.level).join(this.indentation||" ")};const kd=function(e,t){try{const r=ad(e);return n=id().map(r,(function(e){if(!e)return e;const n=t(e);return this.update(n)})),((o=o||{}).compress?new hd(o):new vd(o)).compile(n)}catch(e){return console.warn("Error while traversing the CSS: "+e),null}var n,o};function _d(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 yd(e,t){return new URL(e,t).toString()}const Ed=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]};_d(e)&&o.push(e)}return o}(t.value).map((r=e,e=>({...e,newUrl:"url("+e.before+e.quote+yd(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},Cd=/^(body|html|:root).*$/,Sd=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(Cd)?n.replace(/^(body|html|:root)/,e):e+" "+n))}:n},wd=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(Sd(t)),o&&r.push(Ed(o)),r.length?kd(n,(0,d.compose)(r)):n}))},Bd=".editor-styles-wrapper";function Id(e){return(0,s.useCallback)((e=>{if(!e)return;const{ownerDocument:t}=e,{defaultView:n,body:o}=t,r=t.querySelector(Bd);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=Xu(l);i.luminance()>.5||0===i.alpha()?o.classList.remove("is-dark-theme"):o.classList.add("is-dark-theme")}),[e])}function xd(e){let{styles:t}=e;const n=(0,s.useMemo)((()=>wd(t,Bd)),[t]);return(0,s.createElement)(s.Fragment,null,(0,s.createElement)("style",{ref:Id(t)}),n.map(((e,t)=>(0,s.createElement)("style",{key:t},e))))}function Td(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t={r:[],g:[],b:[],a:[]};return e.forEach((e=>{const n=Xu(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 Nd(e){let{selector:t,id:n}=e;const o=`\n${t} {\n\tfilter: url( #${n} );\n}\n`;return(0,s.createElement)("style",null,o)}function Pd(e){let{selector:t}=e;const n=`\n${t} {\n\tfilter: none;\n}\n`;return(0,s.createElement)("style",null,n)}function Ld(e){let{id:t,colors:n}=e;const o=Td(n);return(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:t},(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"}))))}function Rd(e){let{preset:t}=e;return(0,s.createElement)(Ld,{id:`wp-duotone-${t.slug}`,colors:t.colors})}let Md;ed([td,rd]);const Ad=2e3,Dd=function(e){let{viewportWidth:t,__experimentalPadding:n,__experimentalMinHeight:o}=e;const[r,{width:l}]=(0,d.useResizeObserver)(),[i,{height:a}]=(0,d.useResizeObserver)(),{styles:c,assets:u,duotone:g}=(0,m.useSelect)((e=>{var t,n;const o=e(Jn).getSettings();return{styles:o.styles,assets:o.__unstableResolvedAssets,duotone:null===(t=o.__experimentalFeatures)||void 0===t||null===(n=t.color)||void 0===n?void 0:n.duotone}}),[]),h=(0,s.useMemo)((()=>c?[...c,{css:"body{height:auto;overflow:hidden;}",__unstableType:"presets"}]:c),[c]),f=(0,s.useMemo)((()=>{var e,t;return[...null!==(e=null==g?void 0:g.default)&&void 0!==e?e:[],...null!==(t=null==g?void 0:g.theme)&&void 0!==t?t:[]]}),[g]);Md=Md||(0,d.pure)(lh);const v=l/t;return(0,s.createElement)("div",{className:"block-editor-block-preview__container"},r,(0,s.createElement)(p.Disabled,{className:"block-editor-block-preview__content",style:{transform:`scale(${v})`,height:a*v,maxHeight:a>Ad?Ad*v:void 0,minHeight:o}},(0,s.createElement)(Bu,{head:(0,s.createElement)(xd,{styles:h}),assets:u,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:a,pointerEvents:"none",maxHeight:Ad,minHeight:0!==v&&v<1&&o?o/v:o}},i,f.map((e=>(0,s.createElement)(Rd,{preset:e,key:e.slug}))),(0,s.createElement)(Md,{renderAppender:!1}))))},Od=(0,s.memo)((function(e){let{blocks:t,__experimentalPadding:n=0,viewportWidth:o=1200,__experimentalLive:r=!1,__experimentalOnClick:l,__experimentalMinHeight:i}=e;const a=(0,m.useSelect)((e=>e(Jn).getSettings()),[]),c=(0,s.useMemo)((()=>{const e={...a};return e.__experimentalBlockPatterns=[],e}),[a]),d=(0,s.useMemo)((()=>(0,u.castArray)(t)),[t]);return t&&0!==t.length?(0,s.createElement)(iu,{value:d,settings:c},r?(0,s.createElement)(su,{onClick:l}):(0,s.createElement)(Dd,{viewportWidth:o,__experimentalPadding:n,__experimentalMinHeight:i})):null}));function Fd(e){let{blocks:t,props:n={},__experimentalLayout:o}=e;const r=(0,m.useSelect)((e=>e(Jn).getSettings()),[]),l=(0,d.useDisabled)(),i=(0,d.useMergeRefs)([n.ref,l]),a=(0,s.useMemo)((()=>({...r,__experimentalBlockPatterns:[]})),[r]),p=(0,s.useMemo)((()=>(0,u.castArray)(t)),[t]),g=(0,s.createElement)(iu,{value:p,settings:a},(0,s.createElement)(sh,{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?g:null}}const zd=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)(Od,{__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,h.__)("No Preview Available."))),!p&&(0,s.createElement)(nu,{title:i,icon:a,description:c}))},Vd=(0,s.createContext)(),Hd=(0,s.forwardRef)((function(e,t){let{isFirst:n,as:o,children:r,...l}=e;const a=(0,s.useContext)(Vd);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)}))})),Gd=(0,s.createElement)(A.SVG,{width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(A.Path,{d:"M8 7h2V5H8v2zm0 6h2v-2H8v2zm0 6h2v-2H8v2zm6-14v2h2V5h-2zm0 8h2v-2h-2v2zm0 6h2v-2h-2v2z"}));function Ud(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)(tu,{icon:n}):(0,h.sprintf)(
11
  /* translators: %d: Number of blocks. */
12
- (0,h._n)("%d block","%d blocks",t),t)),(0,s.createElement)(p.FlexItem,null,(0,s.createElement)(tu,{icon:Gd})))))}const Wd=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)(Ud,{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 $d(){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)}const jd=(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}:{},g=(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)(Wd,{isEnabled:u&&!o.disabled,blocks:g,icon:o.icon},(e=>{let{draggable:r,onDragStart:u,onDragEnd:g}=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,g&&g(e)}},(0,s.createElement)(Hd,i({isFirst:n,className:c()("block-editor-block-types-list__item",t),disabled:o.isDisabled,onClick:e=>{e.preventDefault(),l(o,$d()?e.metaKey:e.ctrlKey),a(null)},onKeyDown:e=>{const{keyCode:t}=e;t===Vc.ENTER&&(e.preventDefault(),l(o,$d()?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)(tu,{icon:o.icon,showColors:!0})),(0,s.createElement)("span",{className:"block-editor-block-types-list__item-title"},o.title)))}))})),Kd=(0,s.forwardRef)((function(e,t){const[n,o]=(0,s.useState)(!1);return(0,s.useEffect)((()=>{n&&(0,Ht.speak)((0,h.__)("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))})),qd=(0,s.forwardRef)((function(e,t){const n=(0,s.useContext)(Vd);return(0,s.createElement)(p.__unstableCompositeGroup,i({state:n,role:"presentation",ref:t},e))})),Yd=function(e){let{items:t=[],onSelect:n,onHover:o=(()=>{}),children:l,label:i,isDraggable:a=!0}=e;return(0,s.createElement)(Kd,{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)(qd,{key:t},e.map(((e,l)=>(0,s.createElement)(jd,{key:e.id,item:e,className:(0,r.getBlockMenuDefaultClassName)(e.id),onSelect:n,onHover:o,isDraggable:a,isFirst:0===t&&0===l})))))),l)},Zd=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))},Qd=(e,t)=>{const{categories:n,collections:o,items:l}=(0,m.useSelect)((t=>{const{getInserterItems:n}=t(Jn),{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])]},Xd=function(e){let{children:t}=e;const n=(0,p.__unstableUseCompositeState)({shift:!0,wrap:"horizontal"});return(0,s.createElement)(Vd.Provider,{value:n},t)},Jd=[],ep=function(e){let{rootClientId:t,onInsert:n,onHover:o,showMostUsedBlocks:r}=e;const[l,i,a,c]=Qd(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]),g=(0,s.useMemo)((()=>(0,u.flow)((e=>e.filter((e=>e.category&&"reusable"!==e.category))),(e=>(0,u.groupBy)(e,"category")))(l)),[l]),f=(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:Jd);return(0,s.createElement)(Xd,null,(0,s.createElement)("div",null,r&&!!p.length&&(0,s.createElement)(Zd,{title:(0,h._x)("Most used","blocks")},(0,s.createElement)(Yd,{items:p,onSelect:c,onHover:o,label:(0,h._x)("Most used","blocks")})),(0,u.map)(v,(e=>{const t=g[e.slug];return t&&t.length?(0,s.createElement)(Zd,{key:e.slug,title:e.title,icon:e.icon},(0,s.createElement)(Yd,{items:t,onSelect:c,onHover:o,label:e.title})):null})),b&&m.length>0&&(0,s.createElement)(Zd,{className:"block-editor-inserter__uncategorized-blocks-panel",title:(0,h.__)("Uncategorized")},(0,s.createElement)(Yd,{items:m,onSelect:c,onHover:o,label:(0,h.__)("Uncategorized")})),(0,u.map)(_,(e=>{let[t,n]=e;const r=f[t];return r&&r.length?(0,s.createElement)(Zd,{key:t,title:n.title,icon:n.icon},(0,s.createElement)(Yd,{items:r,onSelect:c,onHover:o,label:n.title})):null}))))},tp=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,h.__)("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,h.__)("Explore all patterns"),onClick:()=>r()},(0,h._x)("Explore","Label for showing all block patterns"))))},np=window.wp.notices,op=(e,t)=>{const{patternCategories:n,patterns:o}=(0,m.useSelect)((e=>{const{__experimentalGetAllowedPatterns:n,getSettings:o}=e(Jn);return{patterns:n(t),patternCategories:o().__experimentalBlockPatternCategories}}),[t]),{createSuccessNotice:l}=(0,m.useDispatch)(np.store);return[o,n,(0,s.useCallback)(((t,n)=>{e((0,u.map)(n,(e=>(0,r.cloneBlock)(e))),t.name),l((0,h.sprintf)(
13
  /* translators: %s: block pattern title. */
14
- (0,h.__)('Block pattern "%s" inserted.'),t.title),{type:"snackbar"})}),[])]};function rp(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)(rp)}`;return(0,s.createElement)(Wd,{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)(Od,{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 lp(){return(0,s.createElement)("div",{className:"block-editor-block-patterns-list__item is-placeholder"})}const ip=function(e){let{isDraggable:t,blockPatterns:n,shownPatterns:o,onClickPattern:r,orientation:l,label:a=(0,h.__)("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)(rp,{key:e.name,pattern:e,onClick:r,isDraggable:t,composite:c}):(0,s.createElement)(lp,{key:e.name}))))};function sp(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 ap(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,h.__)("Search for patterns"),placeholder:(0,h.__)("Search")}))}const cp=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)(ap,{filterValue:r,setFilterValue:l}),!r&&(0,s.createElement)(sp,{selectedCategory:t,patternCategories:n,onClickCategory:o}))},up=function(){return(0,s.createElement)("div",{className:"block-editor-inserter__no-results"},(0,s.createElement)(Tr,{className:"block-editor-inserter__no-results-icon",icon:eu}),(0,s.createElement)("p",null,(0,h.__)("No results found.")))},dp=function(e){let{rootClientId:t="",insertionIndex:n,clientId:o,isAppender:l,onSelect:i,shouldFocusBlock:a=!0}=e;const{getSelectedBlock:c}=(0,m.useSelect)(Jn),{destinationRootClientId:d,destinationIndex:p}=(0,m.useSelect)((e=>{const{getSelectedBlockClientId:r,getBlockRootClientId:i,getBlockIndex:s,getBlockOrder:a}=e(Jn),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:g,insertBlocks:f,showInsertionPoint:v,hideInsertionPoint:b}=(0,m.useDispatch)(Jn),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)?g(o.clientId,e,null,a||n?0:null,t):f(e,p,d,!0,a||n?0:null,t);const s=(0,h.sprintf)(// translators: %d: the name of the block that has been added
15
- (0,h._n)("%d block added.","%d blocks added.",(0,u.castArray)(e).length),(0,u.castArray)(e).length);(0,Ht.speak)(s),i&&i()}),[l,c,g,f,d,p,i,a]),_=(0,s.useCallback)((e=>{e?v(d,p):b()}),[v,b,d,p]);return[d,k,_]},pp=e=>e.name||"",mp=e=>e.title,gp=e=>e.description||"",hp=e=>e.keywords||[],fp=e=>e.category,vp=()=>null;function bp(){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 kp=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return(0,u.words)(bp(e))},_p=(e,t)=>e.filter((e=>!kp(t).some((t=>t.includes(e))))),yp=(e,t,n,o)=>0===kp(o).length?e:Ep(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}}),Ep=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=kp(t);if(0===o.length)return e;const r=e.map((e=>[e,Cp(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 Cp(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{getName:o=pp,getTitle:r=mp,getDescription:l=gp,getKeywords:i=hp,getCategory:s=fp,getCollection:a=vp}=n,c=o(e),d=r(e),p=l(e),m=i(e),g=s(e),h=a(e),f=bp(t),v=bp(d);let b=0;if(f===v)b+=30;else if(v.startsWith(f))b+=20;else{const e=[c,d,p,...m,g,h].join(" "),t=(0,u.words)(f);0===_p(t,e).length&&(b+=10)}return 0!==b&&c.startsWith("core/")&&(b+=c!==e.id?1:2),b}function Sp(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,h.sprintf)(
16
  /* translators: %d: number of patterns. %s: block pattern search query */
17
- (0,h._n)('%1$d pattern found for "%2$s"','%1$d patterns found for "%2$s"',n),n,t)):null}const wp=function(e){let{filterValue:t,selectedCategory:n,patternCategories:o}=e;const r=(0,d.useDebounce)(Ht.speak,500),[l,i]=dp({shouldFocusBlock:!0}),[a,,c]=op(i,l),u=(0,s.useMemo)((()=>o.map((e=>e.name))),[o]),p=(0,s.useMemo)((()=>t?Ep(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,h.sprintf)(
18
  /* translators: %d: number of results. */
19
- (0,h._n)("%d result found.","%d results found.",e),e);r(n)}),[t,r]);const m=(0,d.useAsyncList)(p,{step:2}),g=!(null==p||!p.length);return(0,s.createElement)("div",{className:"block-editor-block-patterns-explorer__list"},g&&(0,s.createElement)(Sp,{filterValue:t,filteredBlockPatternsLength:p.length}),(0,s.createElement)(Xd,null,!g&&(0,s.createElement)(up,null),g&&(0,s.createElement)(ip,{shownPatterns:m,blockPatterns:p,onClickPattern:c,isDraggable:!1})))};function Bp(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)(cp,{selectedCategory:l,patternCategories:n,onClickCategory:i,filterValue:o,setFilterValue:r}),(0,s.createElement)(wp,{filterValue:o,selectedCategory:l,patternCategories:n}))}const Ip=function(e){let{onModalClose:t,...n}=e;return(0,s.createElement)(p.Modal,{title:(0,h.__)("Patterns"),closeLabel:(0,h.__)("Close"),onRequestClose:t,isFullScreen:!0},(0,s.createElement)(Bp,n))};function xp(e){let{rootClientId:t,onInsert:n,selectedCategory:o,populatedCategories:r}=e;const[l,,i]=op(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)(ip,{shownPatterns:p,blockPatterns:c,onClickPattern:i,label:o.label,orientation:"vertical",isDraggable:!0})):null}const Tp=function(e){let{rootClientId:t,onInsert:n,onClickCategory:o,selectedCategory:r}=e;const[l,i]=(0,s.useState)(!1),[a,c]=op(),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,h._x)("Uncategorized")}),e}),[a,c]),p=r||d[0];return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(tp,{selectedCategory:p,patternCategories:d,onClickCategory:o,openPatternExplorer:()=>i(!0)}),!l&&(0,s.createElement)(xp,{rootClientId:t,onInsert:n,selectedCategory:p,populatedCategories:d}),l&&(0,s.createElement)(Ip,{initialCategory:p,patternCategories:d,onModalClose:()=>i(!1)}))},Np=window.wp.url;function Pp(e){let{onHover:t,onInsert:n,rootClientId:o}=e;const[r,,,l]=Qd(o,n),i=(0,s.useMemo)((()=>r.filter((e=>{let{category:t}=e;return"reusable"===t}))),[r]);return 0===i.length?(0,s.createElement)(up,null):(0,s.createElement)(Zd,{title:(0,h.__)("Reusable blocks")},(0,s.createElement)(Yd,{items:i,onSelect:l,onHover:t,label:(0,h.__)("Reusable blocks")}))}const Lp=function(e){let{rootClientId:t,onInsert:n,onHover:o}=e;return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(Pp,{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,Np.addQueryArgs)("edit.php",{post_type:"wp_block"})},(0,h.__)("Manage Reusable blocks"))))},{Fill:Rp,Slot:Mp}=(0,p.createSlotFill)("__unstableInserterMenuExtension");Rp.Slot=Mp;const Ap=Rp,Dp=[],Op=function(e){let{filterValue:t,onSelect:n,onHover:o,rootClientId:r,clientId:l,isAppender:i,__experimentalInsertionIndex:a,maxBlockPatterns:c,maxBlockTypes:m,showBlockDirectory:g=!1,isDraggable:f=!0,shouldFocusBlock:v=!0,prioritizePatterns:b}=e;const k=(0,d.useDebounce)(Ht.speak,500),[_,y]=dp({onSelect:n,rootClientId:r,clientId:l,isAppender:i,insertionIndex:a,shouldFocusBlock:v}),[E,C,S,w]=Qd(_,y),[B,,I]=op(y,_),x=(0,s.useMemo)((()=>{if(0===c)return[];const e=Ep(B,t);return void 0!==c?e.slice(0,c):e}),[t,B,c]);let T=m;b&&x.length>2&&(T=0);const N=(0,s.useMemo)((()=>{if(0===T)return[];const e=yp((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+x.length,n=(0,h.sprintf)(
20
  /* translators: %d: number of results. */
21
- (0,h._n)("%d result found.","%d results found.",e),e);k(n)}),[t,k]);const P=(0,d.useAsyncList)(N,{step:9}),L=(0,d.useAsyncList)(P.length===N.length?x:Dp),R=!(0,u.isEmpty)(N)||!(0,u.isEmpty)(x),M=!!N.length&&(0,s.createElement)(Zd,{title:(0,s.createElement)(p.VisuallyHidden,null,(0,h.__)("Blocks"))},(0,s.createElement)(Yd,{items:P,onSelect:w,onHover:o,label:(0,h.__)("Blocks"),isDraggable:f})),A=!!x.length&&(0,s.createElement)(Zd,{title:(0,s.createElement)(p.VisuallyHidden,null,(0,h.__)("Block Patterns"))},(0,s.createElement)("div",{className:"block-editor-inserter__quick-inserter-patterns"},(0,s.createElement)(ip,{shownPatterns:L,blockPatterns:x,onClickPattern:I,isDraggable:f})));return(0,s.createElement)(Xd,null,!g&&!R&&(0,s.createElement)(up,null),b?A:M,!!N.length&&!!x.length&&(0,s.createElement)("div",{className:"block-editor-inserter__quick-inserter-separator"}),b?M:A,g&&(0,s.createElement)(Ap.Slot,{fillProps:{onSelect:w,onHover:o,filterValue:t,hasItems:R,rootClientId:_}},(e=>e.length?e:R?null:(0,s.createElement)(up,null))))},Fp={name:"blocks",
22
  /* translators: Blocks tab title in the block inserter. */
23
- title:(0,h.__)("Blocks")},zp={name:"patterns",
24
  /* translators: Patterns tab title in the block inserter. */
25
- title:(0,h.__)("Patterns")},Vp={name:"reusable",
26
  /* translators: Reusable blocks tab title in the block inserter. */
27
- title:(0,h.__)("Reusable")},Hp=function(e){let{children:t,showPatterns:n=!1,showReusableBlocks:o=!1,onSelect:r}=e;const l=(0,s.useMemo)((()=>{const e=[Fp];return n&&e.push(zp),o&&e.push(Vp),e}),[Fp,n,zp,o,Vp]);return(0,s.createElement)(p.TabPanel,{className:"block-editor-inserter__tabs",tabs:l,onSelect:r},t)},Gp=(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[g,f]=(0,s.useState)(u),[v,b]=(0,s.useState)(null),[k,_]=(0,s.useState)(null),[y,E,C]=dp({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(Jn);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]),I=(0,s.useCallback)(((e,t)=>{E(e,{patternName:t}),i()}),[E,i]),x=(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)(ep,{rootClientId:y,onInsert:B,onHover:x,showMostUsedBlocks:c})),a&&(0,s.createElement)("div",{className:"block-editor-inserter__tips"},(0,s.createElement)(p.VisuallyHidden,{as:"h2"},(0,h.__)("A tip for using the block editor")),(0,s.createElement)(Jc,null)))),[y,B,x,g,c,a]),P=(0,s.useMemo)((()=>(0,s.createElement)(Tp,{rootClientId:y,onInsert:I,onClickCategory:T,selectedCategory:k})),[y,I,T,k]),L=(0,s.useMemo)((()=>(0,s.createElement)(Lp,{rootClientId:y,onInsert:B,onHover:x})),[y,B,x]),R=(0,s.useCallback)((e=>"blocks"===e.name?N:"patterns"===e.name?P:L),[N,P,L]),M=(0,s.useRef)();return(0,s.useImperativeHandle)(t,(()=>({focusSearch:()=>{M.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),f(e)},value:g,label:(0,h.__)("Search for blocks and patterns"),placeholder:(0,h.__)("Search"),ref:M}),!!g&&(0,s.createElement)(Op,{filterValue:g,onSelect:i,onHover:x,rootClientId:n,clientId:o,isAppender:r,__experimentalInsertionIndex:l,showBlockDirectory:!0,shouldFocusBlock:d}),!g&&(S||w)&&(0,s.createElement)(Hp,{showPatterns:S,showReusableBlocks:w},R),!g&&!S&&!w&&N)),a&&v&&(0,s.createElement)(zd,{item:v}))}));function Up(e){let{onSelect:t,rootClientId:n,clientId:o,isAppender:r,prioritizePatterns:l}=e;const[i,a]=(0,s.useState)(""),[u,d]=dp({onSelect:t,rootClientId:n,clientId:o,isAppender:r}),[g]=Qd(u,d),[f]=op(d,u),{setInserterIsOpened:v,insertionIndex:b}=(0,m.useSelect)((e=>{const{getSettings:t,getBlockIndex:n,getBlockCount:r}=e(Jn),l=t(),i=n(o),s=r();return{setInserterIsOpened:l.__experimentalSetIsInserterOpened,insertionIndex:-1===i?s:i}}),[o]),k=f.length&&(!!i||l),_=k&&f.length>6||g.length>6;(0,s.useEffect)((()=>{v&&v(!1)}),[v]);let y=0;return k&&(y=l?4:2),(0,s.createElement)("div",{className:c()("block-editor-inserter__quick-inserter",{"has-search":_,"has-expand":v})},_&&(0,s.createElement)(p.SearchControl,{className:"block-editor-inserter__search",value:i,onChange:e=>{a(e)},label:(0,h.__)("Search for blocks and patterns"),placeholder:(0,h.__)("Search")}),(0,s.createElement)("div",{className:"block-editor-inserter__quick-inserter-results"},(0,s.createElement)(Op,{filterValue:i,onSelect:t,rootClientId:n,clientId:o,isAppender:r,maxBlockPatterns:y,maxBlockTypes:6,isDraggable:!1,prioritizePatterns:l})),v&&(0,s.createElement)(p.Button,{className:"block-editor-inserter__quick-inserter-expand",onClick:()=>{v({rootClientId:n,insertionIndex:b,filterValue:i})},"aria-label":(0,h.__)("Browse all. This will open the main inserter panel in the editor toolbar.")},(0,h.__)("Browse all")))}const Wp=e=>{let t,{onToggle:n,disabled:o,isOpen:r,blockTitle:l,hasSingleBlockType:a,toggleProps:c={},prioritizePatterns:u}=e;t=a?(0,h.sprintf)(// translators: %s: the name of the block when there is only one
28
- (0,h._x)("Add %s","directly add the only allowed block"),l):u?(0,h.__)("Add pattern"):(0,h._x)("Add block","Generic label for block inserter button");const{onClick:d,...m}=c;return(0,s.createElement)(p.Button,i({icon:Qc,label:t,tooltipPosition:"bottom",onClick:function(e){n&&n(e),d&&d(e)},className:"block-editor-inserter__toggle","aria-haspopup":!a&&"true","aria-expanded":!a&&r,disabled:o},m))};class $p 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=Wp,prioritizePatterns:u}=this.props;return c({onToggle:t,isOpen:n,disabled:o||!a,blockTitle:r,hasSingleBlockType:l,directInsertBlock:i,toggleProps:s,prioritizePatterns:u})}renderContent(e){let{onClose:t}=e;const{rootClientId:n,clientId:o,isAppender:r,showInserterHelpPanel:l,__experimentalIsQuick:i,prioritizePatterns:a}=this.props;return i?(0,s.createElement)(Up,{onSelect:()=>{t()},rootClientId:n,clientId:o,isAppender:r,prioritizePatterns:a}):(0,s.createElement)(Gp,{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,h.__)("Add a block"),renderToggle:this.renderToggle,renderContent:this.renderContent,onClose:l})}}const jp=(0,d.compose)([(0,m.withSelect)(((e,t)=>{var n;let{clientId:o,rootClientId:l}=t;const{getBlockRootClientId:i,hasInserterItems:s,__experimentalGetAllowedBlocks:a,__experimentalGetDirectInsertBlock:c,getBlockIndex:u,getBlockCount:d,getSettings:p}=e(Jn),{getBlockVariations:m}=e(r.store);l=l||i(o)||void 0;const g=a(l),h=c(l),f=u(o),v=d(),b=p(),k=1===(null==g?void 0:g.length)&&0===(null===(n=m(g[0].name,"inserter"))||void 0===n?void 0:n.length);let _=!1;return k&&(_=g[0]),{hasItems:s(l),hasSingleBlockType:k,blockTitle:_?_.title:"",allowedBlockType:_,directInsertBlock:h,rootClientId:l,prioritizePatterns:b.__experimentalPreferPatternsOnRoot&&!l&&f>0&&(f<v||0===v)}})),(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(Jn);let p;if(c){const e=function(e){const{getBlock:t,getPreviousBlockClientId:r}=o(Jn);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(Jn);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,h.sprintf)(// translators: %s: the name of the block that has been added
29
- (0,h.__)("%s block added"),a.title);(0,Ht.speak)(m)}}})),(0,d.ifCondition)((e=>{let{hasItems:t,isAppender:n,rootClientId:o,clientId:r}=e;return t||!n&&!o&&!r}))])($p),Kp=(0,d.compose)((0,m.withSelect)(((e,t)=>{const{getBlockCount:n,getSettings:o,getTemplateLock:r}=e(Jn),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(Jn);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,Zc.decodeEntities)(r)||(0,h.__)("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,h.__)("Add default block"),className:"block-editor-default-block-appender__content",onKeyDown:e=>{Vc.ENTER!==e.keyCode&&Vc.SPACE!==e.keyCode||n()},onClick:()=>n(),onFocus:()=>{o&&n()}},o?i:"\ufeff"),(0,s.createElement)(jp,{rootClientId:l,position:"bottom right",isAppender:!0,__experimentalIsQuick:!0}))}));function qp(e,t){let{rootClientId:n,className:o,onFocus:r,tabIndex:l}=e;return(0,s.createElement)(jp,{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,h.sprintf)(// translators: %s: the name of the block when there is only one
30
- (0,h._x)("Add %s","directly add the only allowed block"),d):(0,h._x)("Add block","Generic label for block inserter button");const g=!m;let f=(0,s.createElement)(p.Button,{ref:t,onFocus:r,tabIndex:l,className:c()(o,"block-editor-button-block-appender"),onClick:i,"aria-haspopup":g?"true":void 0,"aria-expanded":g?u:void 0,disabled:a,label:n},!m&&(0,s.createElement)(p.VisuallyHidden,{as:"span"},n),(0,s.createElement)(Tr,{icon:Qc}));return(g||m)&&(f=(0,s.createElement)(p.Tooltip,{text:n},f)),f},isAppender:!0})}const Yp=(0,s.forwardRef)(((e,t)=>(z()("wp.blockEditor.ButtonBlockerAppender",{alternative:"wp.blockEditor.ButtonBlockAppender",since:"5.9"}),qp(e,t)))),Zp=(0,s.forwardRef)(qp),Qp=(0,m.withSelect)(((e,t)=>{let{rootClientId:n}=t;const{canInsertBlockType:o,getTemplateLock:l,getSelectedBlockClientId:i}=e(Jn);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)(Kp,{rootClientId:n}):(0,s.createElement)(Zp,{rootClientId:n,className:"block-list-appender__toggle"})}return(0,s.createElement)(u,{tabIndex:-1,className:c()("block-list-appender wp-block",i),contentEditable:!1,"data-block":!0},t)}));(0,s.createContext)();const Xp=function(e){let{previousClientId:t,nextClientId:n,children:o,__unstablePopoverSlot:r,__unstableContentRef:l,...a}=e;const{orientation:u,rootClientId:d,isVisible:g}=(0,m.useSelect)((e=>{var o;const{getBlockListSettings:r,getBlockRootClientId:l,isBlockVisible:i}=e(Jn),s=l(t);return{orientation:(null===(o=r(s))||void 0===o?void 0:o.orientation)||"vertical",rootClientId:s,isVisible:i(t)&&i(n)}}),[t]),f=Eo(t),v=Eo(n),b="vertical"===u,k=(0,s.useMemo)((()=>{if(!f&&!v||!g)return{};const e=f?f.getBoundingClientRect():null,t=v?v.getBoundingClientRect():null;if(b)return{width:f?f.offsetWidth:v.offsetWidth,height:t&&e?t.top-e.bottom:0};let n=0;return e&&t&&(n=(0,h.isRTL)()?e.left-t.right:t.left-e.right),{width:n,height:f?f.offsetHeight:v.offsetHeight}}),[f,v,b]),_=(0,s.useCallback)((()=>{if(!f&&!v||!g)return{};const{ownerDocument:e}=f||v,t=f?f.getBoundingClientRect():null,n=v?v.getBoundingClientRect():null;return b?(0,h.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,height:0,width:0,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,height:0,width:0,ownerDocument:e}:(0,h.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,height:0,width:0,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,height:0,width:0,ownerDocument:e}}),[f,v]),y=Ho(l);return f&&v&&g?(0,s.createElement)(p.Popover,i({ref:y,animate:!1,getAnchorRect:_,focusOnMount:!1,__unstableSlotName:r||null,key:n+"--"+d},a,{className:c()("block-editor-block-popover",a.className),__unstableForcePosition:!0}),(0,s.createElement)("div",{style:k},o)):null},Jp=(0,s.createContext)();function em(e){let{__unstablePopoverSlot:t,__unstableContentRef:n}=e;const{selectBlock:o,hideInsertionPoint:r}=(0,m.useDispatch)(Jn),l=(0,s.useContext)(Jp),i=(0,s.useRef)(),{orientation:a,previousClientId:u,nextClientId:g,rootClientId:h,isInserterShown:f}=(0,m.useSelect)((e=>{var t;const{getBlockOrder:n,getBlockListSettings:o,getBlockInsertionPoint:r,isBlockBeingDragged:l,getPreviousBlockClientId:i,getNextBlockClientId:s}=e(Jn),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}}),[]),v="vertical"===a,b=(0,d.useReducedMotion)(),k={start:{...v?{height:0,left:"50%",right:"50%",y:0}:{width:0,top:"50%",bottom:"50%",x:0},opacity:0},rest:{...v?{height:4,left:0,right:0,y:-2}:{width:4,top:0,bottom:0,x:-2},opacity:1,borderRadius:"2px",transition:{delay:f?.4:0}},hover:{...v?{height:4,left:0,right:0,y:-2}:{width:4,top:0,bottom:0,x:-2},opacity:1,borderRadius:"2px",transition:{delay:.4}}},_={start:{scale:b?1:0},rest:{scale:1,transition:{delay:.2}}},y=c()("block-editor-block-list__insertion-point","is-"+a);return(0,s.createElement)(Xp,{previousClientId:u,nextClientId:g,__unstablePopoverSlot:t,__unstableContentRef:n},(0,s.createElement)(p.__unstableMotion.div,{layout:!b,initial:b?"rest":"start",animate:"rest",whileHover:"hover",whileTap:"pressed",exit:"start",ref:i,tabIndex:-1,onClick:function(e){e.target===i.current&&g&&o(g,-1)},onFocus:function(e){e.target!==i.current&&(l.current=!0)},className:c()(y,{"is-with-inserter":f}),onHoverEnd:function(e){e.target!==i.current||l.current||r()}},(0,s.createElement)(p.__unstableMotion.div,{variants:k,className:"block-editor-block-list__insertion-point-indicator"}),f&&(0,s.createElement)(p.__unstableMotion.div,{variants:_,className:c()("block-editor-block-list__insertion-point-inserter")},(0,s.createElement)(jp,{position:"bottom center",clientId:g,rootClientId:h,__experimentalIsQuick:!0,onToggle:e=>{l.current=e},onSelectOrClose:()=>{l.current=!1}}))))}function tm(e){let{children:t,...n}=e;const o=(0,m.useSelect)((e=>e(Jn).isBlockInsertionPointVisible()),[]);return(0,s.createElement)(Jp.Provider,{value:(0,s.useRef)(!1)},o&&(0,s.createElement)(em,n),t)}function nm(){const e=(0,s.useContext)(Jp),t=(0,m.useSelect)((e=>e(Jn).getSettings().hasReducedUI),[]),{getBlockListSettings:n,getBlockRootClientId:o,getBlockIndex:r,isBlockInsertionPointVisible:l,isMultiSelecting:i,getSelectedBlockClientIds:a,getTemplateLock:c}=(0,m.useSelect)(Jn),{showInsertionPoint:u,hideInsertionPoint:p}=(0,m.useDispatch)(Jn);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",g=t.target.getBoundingClientRect(),h=t.clientY-g.top,f=t.clientX-g.left;let v=Array.from(t.target.children).find((e=>e.classList.contains("wp-block")&&"vertical"===m&&e.offsetTop>h||e.classList.contains("wp-block")&&"horizontal"===m&&e.offsetLeft>f));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"))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 om="undefined"==typeof window?e=>{setTimeout((()=>e(Date.now())),0)}:window.requestIdleCallback||window.requestAnimationFrame,rm="undefined"==typeof window?clearTimeout:window.cancelIdleCallback||window.cancelAnimationFrame;function lm(e){return(0,m.useSelect)((t=>{if(!e)return null;const{getBlockName:n,getBlockAttributes:o}=t(Jn),{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,anchor:null==c?void 0:c.anchor}:d}),[e])}function im(e,t){const{attributes:n,name:o,reusableBlockTitle:l}=(0,m.useSelect)((t=>{if(!e)return{};const{getBlockName:n,getBlockAttributes:o,__experimentalGetReusableBlockTitle:l}=t(Jn),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=lm(e);if(!o||!i)return null;const s=(0,r.getBlockType)(o),a=s?(0,r.__experimentalGetBlockLabel)(s,n):null,c=l||a,u=c&&c!==s.title?c:i.title;if(t&&t>0&&u.length>t){const e="...";return u.slice(0,t-e.length)+e}return u}function sm(e){let{clientId:t,maximumLength:n}=e;return im(t,n)}const am=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{canMoveBlocks:o,getBlockRootClientId:l,getBlockName:i}=e(Jn),s=l(n[0]),a=i(n[0]);return{srcRootClientId:s,isDraggable:o(n,s),icon:null===(t=(0,r.getBlockType)(a))||void 0===t?void 0:t.icon}}),[n]),d=(0,s.useRef)(!1),[g,h,f]=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,yl.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)(Jn);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,g(e),l&&l()},onDragOver:h,onDragEnd:()=>{b(),d.current=!1,f(),i&&i()},__experimentalDragComponent:(0,s.createElement)(Ud,{count:n.length,icon:u})},(e=>{let{onDraggableStart:n,onDraggableEnd:o}=e;return t({draggable:!0,onDragStart:n,onDragEnd:o})}))},cm=function(e){let{clientId:t,rootClientId:n}=e;const o=lm(t),l=(0,m.useSelect)((e=>{var o;const{getBlock:r,getBlockIndex:l,hasBlockMovingClientId:i,getBlockListSettings:s}=e(Jn),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:a,name:u,attributes:d,blockMovingMode:g,orientation:f}=l,{setNavigationMode:v,removeBlock:b}=(0,m.useDispatch)(Jn),k=(0,s.useRef)(),_=(0,r.getBlockType)(u),y=(0,r.__experimentalGetAccessibleBlockLabel)(_,d,a+1,f);(0,s.useEffect)((()=>{k.current.focus(),(0,Ht.speak)(y)}),[y]);const E=Eo(t),{hasBlockMovingClientId:C,getBlockIndex:S,getBlockRootClientId:w,getClientIdsOfDescendants:B,getSelectedBlockClientId:I,getMultiSelectedBlocksEndClientId:x,getPreviousBlockClientId:T,getNextBlockClientId:N,isNavigationMode:P}=(0,m.useSelect)(Jn),{selectBlock:L,clearSelectedBlock:R,setBlockMovingClientId:M,moveBlockToPosition:A}=(0,m.useDispatch)(Jn),D=c()("block-editor-block-list__block-selection-button",{"is-block-moving-mode":!!g}),O=(0,h.__)("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)(tu,{icon:null==o?void 0:o.icon,showColors:!0})),(0,s.createElement)(p.FlexItem,null,(0,s.createElement)(am,{clientIds:[t]},(e=>(0,s.createElement)(p.Button,i({icon:Gd,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:k,onClick:()=>v(!1),onKeyDown:function(e){const{keyCode:n}=e,o=n===Vc.UP,r=n===Vc.DOWN,l=n===Vc.LEFT,i=n===Vc.RIGHT,s=n===Vc.TAB,a=n===Vc.ESCAPE,c=n===Vc.ENTER,u=n===Vc.SPACE,d=e.shiftKey;if(n===Vc.BACKSPACE||n===Vc.DELETE)return b(t),void e.preventDefault();const p=I(),m=x(),g=T(m||p),h=N(m||p),f=s&&d||o,v=s&&!d||r,k=l,_=i;let y;if(f)y=g;else if(v)y=h;else if(k){var D;y=null!==(D=w(p))&&void 0!==D?D:p}else if(_){var O;y=null!==(O=B([p])[0])&&void 0!==O?O:p}const F=C();if(a&&P()&&(R(),e.preventDefault()),a&&F&&!e.defaultPrevented&&(M(null),e.preventDefault()),(c||u)&&F){const e=w(F),t=w(p),n=S(F);let o=S(p);n<o&&e===t&&(o-=1),A(F,e,t,o),L(F),M(null)}if(v||f||k||_)if(y)e.preventDefault(),L(y);else if(s&&p){let t;if(v){t=E;do{t=yl.focus.tabbable.findNext(t)}while(t&&E.contains(t));t||(t=E.ownerDocument.defaultView.frameElement,t=yl.focus.tabbable.findNext(t))}else t=yl.focus.tabbable.findPrevious(E);t&&(e.preventDefault(),t.focus(),R())}},label:y,showTooltip:!1,className:"block-selection-button_select-button"},(0,s.createElement)(sm,{clientId:t,maximumLength:35})))))};function um(e){return Array.from(e.querySelectorAll("[data-toolbar-item]"))}const dm=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=!yl.focus.tabbable.find(e.current).some((e=>!("toolbarItem"in e.dataset)));t||z()("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]=yl.focus.tabbable.find(e);t&&t.focus({preventScroll:!0})}(e.current)}),[]);(0,gu.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=um(e.current),n=i||0;var o;t[n]&&(o=e.current).contains(o.ownerDocument.activeElement)&&t[n].focus({preventScroll:!0})}))),()=>{if(window.cancelAnimationFrame(t),!r||!e.current)return;const n=um(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)},pm=(0,s.createElement)(A.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(A.Path,{d:"M10.6 6L9.4 7l4.6 5-4.6 5 1.2 1 5.4-6z"})),mm=(0,s.createElement)(A.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(A.Path,{d:"M14.6 7l-1.2-1L8 12l5.4 6 1.2-1-4.6-5z"})),gm=(0,s.createElement)(A.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,s.createElement)(A.Path,{d:"M6.5 12.4L12 8l5.5 4.4-.9 1.2L12 10l-4.5 3.6-1-1.2z"})),hm=(0,s.createElement)(A.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,s.createElement)(A.Path,{d:"M17.5 11.6L12 16l-5.5-4.4.9-1.2L12 14l4.5-3.6 1 1.2z"}));const fm=(e,t)=>"up"===e?"horizontal"===t?(0,h.isRTL)()?pm:mm:gm:"down"===e?"horizontal"===t?(0,h.isRTL)()?mm:pm:hm:null,vm=(e,t)=>"up"===e?"horizontal"===t?(0,h.isRTL)()?(0,h.__)("Move right"):(0,h.__)("Move left"):(0,h.__)("Move up"):"down"===e?"horizontal"===t?(0,h.isRTL)()?(0,h.__)("Move left"):(0,h.__)("Move right"):(0,h.__)("Move down"):null,bm=(0,s.forwardRef)(((e,t)=>{let{clientIds:n,direction:o,orientation:l,...a}=e;const g=(0,d.useInstanceId)(bm),f=(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(Jn),d=(0,u.castArray)(n),p=(0,u.first)(d),m=i(p),g=t(p),h=t((0,u.last)(d)),f=s(m),v=a(p),b=0===g,k=h===f.length-1,{orientation:_}=c(m)||{};return{blockType:v?(0,r.getBlockType)(v.name):null,isDisabled:"up"===o?b:k,rootClientId:m,firstIndex:g,isFirst:b,isLast:k,orientation:l||_}}),[n,o]),{moveBlocksDown:S,moveBlocksUp:w}=(0,m.useDispatch)(Jn),B="up"===o?w:S,I=`block-editor-block-mover-button__description-${g}`;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:fm(o,C),label:vm(o,C),"aria-describedby":I},a,{onClick:b?null:e=>{B(n,k),a.onClick&&a.onClick(e)},disabled:b,__experimentalIsFocusable:!0})),(0,s.createElement)(p.VisuallyHidden,{id:I},function(e,t,n,o,r,l,i){const s=n+1,a=e=>"up"===e?"horizontal"===i?(0,h.isRTL)()?"right":"left":"up":"down"===e?"horizontal"===i?(0,h.isRTL)()?"left":"right":"down":null;if(e>1)return function(e,t,n,o,r){const l=t+1;return r<0&&n?(0,h.__)("Blocks cannot be moved up as they are already at the top"):r>0&&o?(0,h.__)("Blocks cannot be moved down as they are already at the bottom"):r<0&&!n?(0,h.sprintf)(// translators: 1: Number of selected blocks, 2: Position of selected blocks
31
  (0,h._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,h.sprintf)(// translators: 1: Number of selected blocks, 2: Position of selected blocks
32
  (0,h._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,h.sprintf)(// translators: %s: Type of block (i.e. Text, Image etc)
33
  (0,h.__)("Block %s is the only block, and cannot be moved"),t);if(l>0&&!r){const e=a("down");if("down"===e)return(0,h.sprintf)(// translators: 1: Type of block (i.e. Text, Image etc), 2: Position of selected block, 3: New position
@@ -42,68 +42,68 @@ title:(0,h.__)("Reusable")},Hp=function(e){let{children:t,showPatterns:n=!1,show
42
  (0,h.__)("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,h.sprintf)(// translators: 1: Type of block (i.e. Text, Image etc)
43
  (0,h.__)("Block %1$s is at the beginning of the content and can’t be moved up"),t);if("left"===e)return(0,h.sprintf)(// translators: 1: Type of block (i.e. Text, Image etc)
44
  (0,h.__)("Block %1$s is at the beginning of the content and can’t be moved left"),t);if("right"===e)return(0,h.sprintf)(// translators: 1: Type of block (i.e. Text, Image etc)
45
- (0,h.__)("Block %1$s is at the beginning of the content and can’t be moved right"),t)}}(f,v&&v.title,E,_,y,"up"===o?-1:1,C)))})),km=(0,s.forwardRef)(((e,t)=>(0,s.createElement)(bm,i({direction:"up",ref:t},e)))),_m=(0,s.forwardRef)(((e,t)=>(0,s.createElement)(bm,i({direction:"down",ref:t},e)))),ym=function(e){let{clientIds:t,hideDragHandle:n}=e;const{canMove:o,rootClientId:r,isFirst:l,isLast:a,orientation:d}=(0,m.useSelect)((e=>{var n;const{getBlockIndex:o,getBlockListSettings:r,canMoveBlocks:l,getBlockOrder:i,getBlockRootClientId:s}=e(Jn),a=(0,u.castArray)(t),c=(0,u.first)(a),d=s((0,u.first)(a)),p=o(c),m=o((0,u.last)(a)),g=i(d);return{canMove:l(t,d),rootClientId:d,isFirst:0===p,isLast:m===g.length-1,orientation:null===(n=r(d))||void 0===n?void 0:n.orientation}}),[t]);if(!o||l&&a&&!r)return null;const g=(0,h.__)("Drag");return(0,s.createElement)(p.ToolbarGroup,{className:c()("block-editor-block-mover",{"is-horizontal":"horizontal"===d})},!n&&(0,s.createElement)(am,{clientIds:t},(e=>(0,s.createElement)(p.Button,i({icon:Gd,className:"block-editor-block-mover__drag-handle","aria-hidden":"true",label:g,tabIndex:"-1"},e)))),(0,s.createElement)("div",{className:"block-editor-block-mover__move-button-container"},(0,s.createElement)(p.ToolbarItem,null,(e=>(0,s.createElement)(km,i({clientIds:t},e)))),(0,s.createElement)(p.ToolbarItem,null,(e=>(0,s.createElement)(_m,i({clientIds:t},e))))))},{clearTimeout:Em,setTimeout:Cm}=window,Sm=()=>{},wm=200;function Bm(e){let{ref:t,isFocused:n,debounceTimeout:o=wm,onChange:r=Sm}=e;const[l,i]=(0,s.useState)(!1),a=(0,s.useRef)(),c=e=>{null!=t&&t.current&&i(e),r(e)},u=()=>{const e=a.current;e&&Em&&Em(e)};return(0,s.useEffect)((()=>()=>{c(!1),u()}),[]),{showMovers:l,debouncedShowMovers:e=>{e&&e.stopPropagation(),u(),l||c(!0)},debouncedHideMovers:e=>{e&&e.stopPropagation(),u(),a.current=Cm((()=>{(()=>{const e=(null==t?void 0:t.current)&&t.current.matches(":hover");return!n&&!e})()&&c(!1)}),o)}}}function Im(e){let{ref:t,debounceTimeout:n=wm,onChange:o=Sm}=e;const[r,l]=(0,s.useState)(!1),{showMovers:i,debouncedShowMovers:a,debouncedHideMovers:c}=Bm({ref:t,debounceTimeout:n,isFocused:r,onChange:o}),u=(0,s.useRef)(!1),d=()=>(null==t?void 0:t.current)&&t.current.contains(t.current.ownerDocument.activeElement);return(0,s.useEffect)((()=>{const e=t.current,n=()=>{d()&&(l(!0),a())},o=()=>{d()||(l(!1),c())};return e&&!u.current&&(e.addEventListener("focus",n,!0),e.addEventListener("blur",o,!0),u.current=!0),()=>{e&&(e.removeEventListener("focus",n),e.removeEventListener("blur",o))}}),[t,u,l,a,c]),{showMovers:i,gestures:{onMouseMove:a,onMouseLeave:c}}}function xm(){const{selectBlock:e,toggleBlockHighlight:t}=(0,m.useDispatch)(Jn),{firstParentClientId:n,shouldHide:o,hasReducedUI:l}=(0,m.useSelect)((e=>{const{getBlockName:t,getBlockParents:n,getSelectedBlockClientId:o,getSettings:l}=e(Jn),{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=lm(n),c=(0,s.useRef)(),{gestures:u}=Im({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,h.sprintf)(
46
  /* translators: %s: Name of the block's parent. */
47
- (0,h.__)("Select %s"),a.title),showTooltip:!0,icon:(0,s.createElement)(tu,{icon:a.icon})}))}const Tm=(0,s.createElement)(A.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(A.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 Nm(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,h.__)("Preview")),(0,s.createElement)(Od,{viewportWidth:500,blocks:t})))))}const Pm=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,h.__)("Transform to"),className:t},i&&(0,s.createElement)(Nm,{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)(tu,{icon:n,showColors:!0}),l)})))},Lm=(0,s.createElement)(A.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(A.Path,{d:"M16.7 7.1l-6.3 8.5-3.3-2.5-.9 1.2 4.5 3.4L17.9 8z"})),Rm=window.wp.tokenList;var Mm=n.n(Rm);function Am(e,t,n){const o=new(Mm())(e);return t&&o.remove("is-style-"+t.name),o.add("is-style-"+n.name),o.value}function Dm(e){return(0,u.find)(e,"isDefault")}function Om(e){let{clientId:t,onSwitch:n}=e;const{styles:o,block:l,blockType:i,className:a}=(0,m.useSelect)((e=>{const{getBlock:n}=e(Jn),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)(Jn),d=function(e){return e&&0!==e.length?Dm(e)?e:[{name:"default",label:(0,h._x)("Default","block style"),isDefault:!0},...e]:[]}(o),p=function(e,t){for(const n of new(Mm())(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),g=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=Am(a,p,e);c(t,{className:o}),n()},stylesToRender:d,activeStyle:p,genericPreviewBlock:g,className:a}}const Fm=()=>{};function zm(e){let{clientId:t,onSwitch:n=Fm}=e;const{onSelect:o,stylesToRender:r,activeStyle:l}=Om({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?Lm:null,onClick:()=>o(e)},(0,s.createElement)(p.__experimentalText,{as:"span",limit:18,ellipsizeMode:"tail",truncate:!0},t))}))):null}function Vm(e){let{hoveredBlock:t,onSwitch:n}=e;const{clientId:o}=t;return(0,s.createElement)(p.MenuGroup,{label:(0,h.__)("Styles"),className:"block-editor-block-switcher__styles__menugroup"},(0,s.createElement)(zm,{clientId:o,onSwitch:n}))}const Hm=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=Hm(e,t,n);if(o)return o}}},Gm=(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 Um(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,h.__)("Preview")),(0,s.createElement)(Wm,{patterns:t,onSelect:n})))))}function Wm(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,h.__)("Patterns list")}),t.map((e=>(0,s.createElement)($m,{key:e.name,pattern:e,onSelect:n,composite:o}))))}function $m(e){let{pattern:t,onSelect:n,composite:o}=e;const r="block-editor-block-switcher__preview-patterns-container",l=(0,d.useInstanceId)($m,`${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)(Od,{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))}const jm=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=Hm(r,t.name,o);if(n){e=!0,o.add(n.clientId),Gm(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)(Um,{patterns:a,onSelect:o}),(0,s.createElement)(p.MenuItem,{onClick:e=>{e.preventDefault(),i(!l)},icon:pm},(0,h.__)("Patterns"))):null},Km=e=>{let{clientIds:t,blocks:n}=e;const{replaceBlocks:o}=(0,m.useDispatch)(Jn),l=lm(n[0].clientId),{possibleBlockTransformations:i,canRemove:a,hasBlockStyles:c,icon:d,blockTitle:g,patterns:f}=(0,m.useSelect)((e=>{var o;const{getBlockRootClientId:i,getBlockTransformItems:s,__experimentalGetPatternTransformItems:a}=e(Jn),{getBlockStyles:c,getBlockType:d}=e(r.store),{canRemoveBlocks:p}=e(Jn),m=i((0,u.castArray)(t)[0]),[{name:g}]=n,h=1===n.length,f=h&&c(g);let v;var b;h?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(g))||void 0===b?void 0:b.icon:Tm;return{possibleBlockTransformations:s(n,m),canRemove:p(t,m),hasBlockStyles:!(null==f||!f.length),icon:v,blockTitle:null===(o=d(g))||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==f||!f.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:g,icon:(0,s.createElement)(s.Fragment,null,(0,s.createElement)(tu,{icon:d,showColors:!0}),(v||b)&&(0,s.createElement)("span",{className:"block-editor-block-switcher__toggle-text"},(0,s.createElement)(sm,{clientId:t,maximumLength:35})))}));const y=g,E=1===n.length?(0,h.sprintf)(
48
  /* translators: %s: block title. */
49
  (0,h.__)("%s: Change block type or style"),g):(0,h.sprintf)(
50
  /* translators: %d: number of blocks. */
51
- (0,h._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)(tu,{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)(sm,{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)(jm,{blocks:n,patterns:f,onSelect:e=>{(e=>{o(t,e)})(e),l()}}),k&&(0,s.createElement)(Pm,{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)(Vm,{hoveredBlock:n[0],onSwitch:l}))})))))},qm=e=>{let{clientIds:t}=e;const n=(0,m.useSelect)((e=>e(Jn).getBlocksByClientId(t)),[t]);return!n.length||n.some((e=>!e))?null:(0,s.createElement)(Km,{clientIds:t,blocks:n})},{Fill:Ym,Slot:Zm}=(0,p.createSlotFill)("__unstableBlockToolbarLastItem");Ym.Slot=Zm;const Qm=Ym,Xm=(0,s.createElement)(A.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(A.Path,{d:"M13 19h-2v-2h2v2zm0-6h-2v-2h2v2zm0-6h-2V5h2v2z"})),Jm=window.wp.blob;function eg(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 tg(){const{getBlockName:e}=(0,m.useSelect)(Jn),{getBlockType:t}=(0,m.useSelect)(r.store),{createSuccessNotice:n}=(0,m.useDispatch)(np.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,h.sprintf)(// Translators: Name of the block being copied, e.g. "Paragraph".
52
  (0,h.__)('Copied "%s" to clipboard.'),s):(0,h.sprintf)(// Translators: Name of the block being cut, e.g. "Paragraph".
53
  (0,h.__)('Moved "%s" to clipboard.'),s)}else l="copy"===o?(0,h.sprintf)(// Translators: %d: Number of blocks being copied.
54
  (0,h._n)("Copied %d block to clipboard.","Copied %d blocks to clipboard.",r.length),r.length):(0,h.sprintf)(// Translators: %d: Number of blocks being cut.
55
- (0,h._n)("Moved %d block to clipboard.","Moved %d blocks to clipboard.",r.length),r.length);n(l,{type:"snackbar"})}),[])}function ng(){const{getBlocksByClientId:e,getSelectedBlockClientIds:t,hasMultiSelection:n,getSettings:o,__unstableIsFullySelected:l,__unstableIsSelectionCollapsed:i,__unstableIsSelectionMergeable:s,__unstableGetSelectedBlocksWithPartialSelection:a}=(0,m.useSelect)(Jn),{flashBlock:c,removeBlocks:u,replaceBlocks:p,__unstableDeleteSelection:g,__unstableExpandSelection:h}=(0,m.useDispatch)(Jn),f=tg();return(0,d.useRefEffect)((d=>{function m(m){const v=t();if(0===v.length)return;if(!n()){const{target:e}=m,{ownerDocument:t}=e;if("copy"===m.type||"cut"===m.type?(0,yl.documentHasUncollapsedSelection)(t):(0,yl.documentHasSelection)(t))return}if(!d.contains(m.target.ownerDocument.activeElement))return;const b=m.defaultPrevented;m.preventDefault();const k=s(),_=i()||l(),y=!_&&!k;if("copy"===m.type||"cut"===m.type)if(1===v.length&&c(v[0]),y)h();else{let t;if(f(m.type,v),_)t=e(v);else{const[n,o]=a();t=[n,...e(v.slice(1,v.length-1)),o]}const n=(0,r.serialize)(t);m.clipboardData.setData("text/plain",(E=(E=n).replace(/<br>/g,"\n"),(0,yl.__unstableStripHTML)(E).trim().replace(/\n\n+/g,"\n\n"))),m.clipboardData.setData("text/html",n)}var E;if("cut"===m.type)_&&!y?u(v):g();else if("paste"===m.type){if(b)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,yl.getFilesFromDataTransfer)(t).filter((e=>{let{type:t}=e;return/^image\/(?:jpe?g|png|gif|webp)$/.test(t)}));return r.length&&!eg(r,o)&&(o=r.map((e=>`<img src="${(0,Jm.createBlobURL)(e)}">`)).join(""),n=""),{html:o,plainText:n}}(m),l=(0,r.pasteHandler)({HTML:n,plainText:t,mode:"BLOCKS",canUserUseUnfilteredHTML:e});p(v,l,l.length-1,-1)}}return d.ownerDocument.addEventListener("copy",m),d.ownerDocument.addEventListener("cut",m),d.ownerDocument.addEventListener("paste",m),()=>{d.ownerDocument.removeEventListener("copy",m),d.ownerDocument.removeEventListener("cut",m),d.ownerDocument.removeEventListener("paste",m)}}),[])}const og=function(e){let{children:t}=e;return(0,s.createElement)("div",{ref:ng()},t)};function rg(e){let{clientIds:t,children:n,__experimentalUpdateSelection:o}=e;const{canInsertBlockType:l,getBlockRootClientId:i,getBlocksByClientId:s,canMoveBlocks:a,canRemoveBlocks:c}=(0,m.useSelect)(Jn),{getDefaultBlockName:d,getGroupingBlockName:p}=(0,m.useSelect)(r.store),g=s(t),h=i(t[0]),f=(0,u.every)(g,(e=>!!e&&(0,r.hasBlockSupport)(e.name,"multiple",!0)&&l(e.name,h))),v=l(d(),h),b=a(t,h),k=c(t,h),{removeBlocks:_,replaceBlocks:y,duplicateBlocks:E,insertAfterBlock:C,insertBeforeBlock:S,flashBlock:w,setBlockMovingClientId:B,setNavigationMode:I,selectBlock:x}=(0,m.useDispatch)(Jn),T=tg();return n({canDuplicate:f,canInsertDefaultBlock:v,canMove:b,canRemove:k,rootClientId:h,blocks:g,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(){I(!0),x(t[0]),B(t[0])},onGroup(){if(!g.length)return;const e=p(),n=(0,r.switchToBlockType)(g,e);n&&y(t,n)},onUngroup(){if(!g.length)return;const e=g[0].innerBlocks;e.length&&y(t,e)},onCopy(){const e=g.map((e=>{let{clientId:t}=e;return t}));1===g.length&&w(e[0]),T("copy",e)}})}const lg=()=>{},ig=(0,d.compose)([(0,m.withSelect)(((e,t)=>{let{clientId:n}=t;const{getBlock:o,getBlockMode:l,getSettings:i}=e(Jn),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=lg,clientId:o}=t;return{onToggleMode(){e(Jn).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,h.__)("Edit as HTML"):(0,h.__)("Edit visually");return(0,s.createElement)(p.MenuItem,{onClick:o},!l&&a)})),sg=(0,d.compose)((0,m.withSelect)(((e,t)=>{let{clientId:n}=t;const o=e(Jn).getBlock(n);return{block:o,shouldRender:o&&"core/html"===o.name}})),(0,m.withDispatch)(((e,t)=>{let{block:n}=t;return{onClick:()=>e(Jn).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,h.__)("Convert to Blocks");return(0,s.createElement)(p.MenuItem,{onClick:n},!o&&r)})),{Fill:ag,Slot:cg}=(0,p.createSlotFill)("__unstableBlockSettingsMenuFirstItem");ag.Slot=cg;const ug=ag;function dg(e){let{clientIds:t,isGroupable:n,isUngroupable:o,blocksSelection:l,groupingBlockName:i,onClose:a=(()=>{})}=e;const{replaceBlocks:c}=(0,m.useDispatch)(Jn);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,h._x)("Group","verb")),o&&(0,s.createElement)(p.MenuItem,{onClick:()=>{(()=>{const e=l[0].innerBlocks;e.length&&c(t,e)})(),a()}},(0,h._x)("Ungroup","Ungrouping blocks from within a Group block back into individual blocks within the Editor "))):null}function pg(){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(Jn),{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}}function mg(e){return(0,m.useSelect)((t=>{const{canEditBlock:n,canMoveBlock:o,canRemoveBlock:r,canLockBlockType:l,getBlockName:i,getBlockRootClientId:s}=t(Jn),a=s(e),c=n(e),u=o(e,a),d=r(e,a);return{canEdit:c,canMove:u,canRemove:d,canLock:l(i(e)),isLocked:!c||!u||!d}}),[e])}const gg=(0,s.createElement)(A.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,s.createElement)(A.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"})),hg=(0,s.createElement)(A.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,s.createElement)(A.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"}));function fg(e){let{clientId:t,onClose:n}=e;const[o,l]=(0,s.useState)({move:!1,remove:!1}),{canEdit:i,canMove:a,canRemove:c}=mg(t),{isReusable:u}=(0,m.useSelect)((e=>{const{getBlockName:n}=e(Jn),o=n(t);return{isReusable:(0,r.isReusableBlock)((0,r.getBlockType)(o))}}),[t]),{updateBlockAttributes:g}=(0,m.useDispatch)(Jn),f=lm(t),v=(0,d.useInstanceId)(fg,"block-editor-block-lock-modal__options-title");(0,s.useEffect)((()=>{l({move:!a,remove:!c,...u?{edit:!i}:{}})}),[i,a,c,u]);const b=Object.values(o).every(Boolean),k=Object.values(o).some(Boolean)&&!b;return(0,s.createElement)(p.Modal,{title:(0,h.sprintf)(
56
  /* translators: %s: Name of the block. */
57
- (0,h.__)("Lock %s"),f.title),overlayClassName:"block-editor-block-lock-modal",closeLabel:(0,h.__)("Close"),onRequestClose:n},(0,s.createElement)("form",{onSubmit:e=>{e.preventDefault(),g([t],{lock:o}),n()}},(0,s.createElement)("p",null,(0,h.__)("Choose specific attributes to restrict or lock all available options.")),(0,s.createElement)("div",{role:"group","aria-labelledby":v,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:v},(0,h.__)("Lock all")),checked:b,indeterminate:k,onChange:e=>l({move:e,remove:e,...u?{edit:e}:{}})}),(0,s.createElement)("ul",{className:"block-editor-block-lock-modal__checklist"},u&&(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,h.__)("Restrict editing"),(0,s.createElement)(p.Icon,{icon:o.edit?hg:gg})),checked:!!o.edit,onChange:e=>l((t=>({...t,edit: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,h.__)("Disable movement"),(0,s.createElement)(p.Icon,{icon:o.move?hg:gg})),checked:o.move,onChange:e=>l((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,h.__)("Prevent removal"),(0,s.createElement)(p.Icon,{icon:o.remove?hg:gg})),checked:o.remove,onChange:e=>l((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,h.__)("Cancel"))),(0,s.createElement)(p.FlexItem,null,(0,s.createElement)(p.Button,{variant:"primary",type:"submit"},(0,h.__)("Apply"))))))}function vg(e){let{clientId:t}=e;const{canLock:n,isLocked:o}=mg(t),[r,l]=(0,s.useReducer)((e=>!e),!1);if(!n)return null;const i=o?(0,h.__)("Unlock"):(0,h.__)("Lock");return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.MenuItem,{icon:o?gg:hg,onClick:l},i),r&&(0,s.createElement)(fg,{clientId:t,onClose:l}))}const{Fill:bg,Slot:kg}=(0,p.createSlotFill)("BlockSettingsMenuControls");function _g(e){let{...t}=e;return(0,s.createElement)(p.__experimentalStyleProvider,{document},(0,s.createElement)(bg,t))}_g.Slot=e=>{let{fillProps:t,clientIds:n=null}=e;const{selectedBlocks:o,selectedClientIds:r,canRemove:l}=(0,m.useSelect)((e=>{const{getBlocksByClientId:t,getSelectedBlockClientIds:o,canRemoveBlocks:r}=e(Jn),l=null!==n?n:o();return{selectedBlocks:(0,u.map)((0,u.compact)(t(l)),(e=>e.name)),selectedClientIds:l,canRemove:r(l)}}),[n]),{canLock:a}=mg(r[0]),c=1===r.length&&a,d=pg(),{isGroupable:g,isUngroupable:h}=d,f=(g||h)&&l;return(0,s.createElement)(kg,{fillProps:{...t,selectedBlocks:o,selectedClientIds:r}},(e=>!(null!=e&&e.length)>0&&!f&&!c?null:(0,s.createElement)(p.MenuGroup,null,c&&(0,s.createElement)(vg,{clientId:r[0]}),e,f&&(0,s.createElement)(dg,i({},d,{onClose:null==t?void 0:t.onClose})))))};const yg=_g,Eg=()=>{},Cg={className:"block-editor-block-settings-menu__popover",position:"bottom right",isAlternate:!0};function Sg(e){let{blocks:t,onCopy:n}=e;const o=(0,d.useCopyToClipboard)((()=>(0,r.serialize)(t)),n),l=t.length>1?(0,h.__)("Copy blocks"):(0,h.__)("Copy block");return(0,s.createElement)(p.MenuItem,{ref:o},l)}const wg=function(e){let{clientIds:t,__experimentalSelectBlock:n,children:o,...l}=e;const a=(0,u.castArray)(t),c=a.length,d=a[0],{firstParentClientId:g,hasReducedUI:f,onlyBlock:v,parentBlockType:b,previousBlockClientId:k,nextBlockClientId:_,selectedBlockClientIds:y}=(0,m.useSelect)((e=>{const{getBlockCount:t,getBlockName:n,getBlockParents:o,getPreviousBlockClientId:l,getNextBlockClientId:i,getSelectedBlockClientIds:s,getSettings:a}=e(Jn),c=o(d),u=c[c.length-1],p=n(u);return{firstParentClientId:u,hasReducedUI:a().hasReducedUI,onlyBlock:1===t(),parentBlockType:(0,r.getBlockType)(p),previousBlockClientId:l(d),nextBlockClientId:i(d),selectedBlockClientIds:s()}}),[d]),E=(0,m.useSelect)((e=>{const{getShortcutRepresentation:t}=e(gu.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")}}),[]),{selectBlock:C,toggleBlockHighlight:S}=(0,m.useDispatch)(Jn),w=(0,s.useCallback)(n?async e=>{const t=await e;t&&t[0]&&n(t[0])}:Eg,[n]),B=im(d,25),I=(0,s.useCallback)(n?()=>{const e=k||_;e&&y.includes(d)&&!y.includes(e)&&n(e)}:Eg,[n,k,_,y]),x=(0,h.sprintf)(
58
  /* translators: %s: block name */
59
- (0,h.__)("Remove %s"),B),T=1===c?x:(0,h.__)("Remove blocks"),N=(0,s.useRef)(),{gestures:P}=Im({ref:N,onChange(e){e&&f||S(g,e)}});return(0,s.createElement)(rg,{clientIds:t,__experimentalUpdateSelection:!n},(e=>{let{canDuplicate:n,canInsertDefaultBlock:r,canMove:a,canRemove:m,onDuplicate:f,onInsertAfter:k,onInsertBefore:_,onRemove:y,onCopy:S,onMoveTo:B,blocks:x}=e;return(0,s.createElement)(p.DropdownMenu,i({icon:Xm,label:(0,h.__)("Options"),className:"block-editor-block-settings-menu",popoverProps:Cg,noIcons:!0},l),(e=>{let{onClose:l}=e;return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.MenuGroup,null,(0,s.createElement)(ug.Slot,{fillProps:{onClose:l}}),void 0!==g&&(0,s.createElement)(p.MenuItem,i({},P,{ref:N,icon:(0,s.createElement)(tu,{icon:b.icon}),onClick:()=>C(g)}),(0,h.sprintf)(
60
  /* translators: %s: Name of the block's parent. */
61
- (0,h.__)("Select parent block (%s)"),b.title)),1===c&&(0,s.createElement)(sg,{clientId:d}),(0,s.createElement)(Sg,{blocks:x,onCopy:S}),n&&(0,s.createElement)(p.MenuItem,{onClick:(0,u.flow)(l,f,w),shortcut:E.duplicate},(0,h.__)("Duplicate")),r&&(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.MenuItem,{onClick:(0,u.flow)(l,_),shortcut:E.insertBefore},(0,h.__)("Insert before")),(0,s.createElement)(p.MenuItem,{onClick:(0,u.flow)(l,k),shortcut:E.insertAfter},(0,h.__)("Insert after"))),a&&!v&&(0,s.createElement)(p.MenuItem,{onClick:(0,u.flow)(l,B)},(0,h.__)("Move to")),1===c&&(0,s.createElement)(ig,{clientId:d,onToggle:l})),(0,s.createElement)(yg.Slot,{fillProps:{onClose:l},clientIds:t}),"function"==typeof o?o({onClose:l}):s.Children.map((e=>(0,s.cloneElement)(e,{onClose:l}))),m&&(0,s.createElement)(p.MenuGroup,null,(0,s.createElement)(p.MenuItem,{onClick:(0,u.flow)(l,y,I),shortcut:E.remove},T)))}))}))};function Bg(e){let{clientIds:t,...n}=e;const{block:o,shouldRender:l}=(0,m.useSelect)((e=>{const n=t[0],{isBlockMultiSelected:o,getBlockMode:r,getBlock:l}=e(Jn),i=!o(n),s="html"===r(n);return{block:l(n),shouldRender:i&&s}}),[t[0]]),{replaceBlocks:a}=(0,m.useDispatch)(Jn),c=(0,s.useCallback)((()=>{a(o.clientId,(0,r.rawHandler)({HTML:(0,r.getBlockContent)(o)}))}),[o]);return l?(0,s.createElement)(p.ToolbarGroup,null,(0,s.createElement)(p.ToolbarButton,i({onClick:c},n),(0,h.__)("Edit visually"))):null}const Ig=function(e){let{clientIds:t,...n}=e;return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(Bg,i({clientIds:t},n)),(0,s.createElement)(p.ToolbarGroup,null,(0,s.createElement)(p.ToolbarItem,null,(e=>(0,s.createElement)(wg,i({clientIds:t,toggleProps:e},n))))))};function xg(e){let{clientId:t}=e;const n=lm(t),{canEdit:o,canMove:r,canRemove:l,canLock:i}=mg(t),[a,c]=(0,s.useReducer)((e=>!e),!1);return i?o&&r&&l?null:(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.ToolbarGroup,{className:"block-editor-block-lock-toolbar"},(0,s.createElement)(p.ToolbarButton,{icon:hg,label:(0,h.sprintf)(
62
  /* translators: %s: block name */
63
- (0,h.__)("Unlock %s"),n.title),onClick:c})),a&&(0,s.createElement)(fg,{clientId:t,onClose:c})):null}const Tg=(0,s.createElement)(A.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,s.createElement)(A.Path,{d:"M18 4h-7c-1.1 0-2 .9-2 2v3H6c-1.1 0-2 .9-2 2v7c0 1.1.9 2 2 2h7c1.1 0 2-.9 2-2v-3h3c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm-4.5 14c0 .3-.2.5-.5.5H6c-.3 0-.5-.2-.5-.5v-7c0-.3.2-.5.5-.5h3V13c0 1.1.9 2 2 2h2.5v3zm0-4.5H11c-.3 0-.5-.2-.5-.5v-2.5H13c.3 0 .5.2.5.5v2.5zm5-.5c0 .3-.2.5-.5.5h-3V11c0-1.1-.9-2-2-2h-2.5V6c0-.3.2-.5.5-.5h7c.3 0 .5.2.5.5v7z"})),Ng=(0,s.createElement)(A.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(A.Path,{d:"M9.2 6.5H4V8h5.2c.3 0 .5.2.5.5v7c0 .3-.2.5-.5.5H4v1.5h5.2c1.1 0 2-.9 2-2v-7c0-1.1-.8-2-2-2zM14.8 8H20V6.5h-5.2c-1.1 0-2 .9-2 2v7c0 1.1.9 2 2 2H20V16h-5.2c-.3 0-.5-.2-.5-.5v-7c-.1-.3.2-.5.5-.5z"})),Pg=(0,s.createElement)(A.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(A.Path,{d:"M16 4v5.2c0 .3-.2.5-.5.5h-7c-.3.1-.5-.2-.5-.5V4H6.5v5.2c0 1.1.9 2 2 2h7c1.1 0 2-.9 2-2V4H16zm-.5 8.8h-7c-1.1 0-2 .9-2 2V20H8v-5.2c0-.3.2-.5.5-.5h7c.3 0 .5.2.5.5V20h1.5v-5.2c0-1.2-.9-2-2-2z"})),Lg={group:void 0,row:{type:"flex",flexWrap:"nowrap"},stack:{type:"flex",orientation:"vertical"}},Rg=function(){const{blocksSelection:e,clientIds:t,groupingBlockName:n,isGroupable:o}=pg(),{replaceBlocks:l}=(0,m.useDispatch)(Jn),{canRemove:i,variations:a}=(0,m.useSelect)((e=>{const{canRemoveBlocks:o}=e(Jn),{getBlockVariations:l}=e(r.store);return{canRemove:o(t),variations:l(n,"transform")}}),[t,n]),c=function(){let o=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"group";const i=(0,r.switchToBlockType)(e,n);i&&i.length>0&&(i[0].attributes.layout=Lg[o],l(t,i))};if(!o||!i)return null;const u=!!a.find((e=>{let{name:t}=e;return"group-row"===t})),d=!!a.find((e=>{let{name:t}=e;return"group-stack"===t}));return(0,s.createElement)(p.ToolbarGroup,null,(0,s.createElement)(p.ToolbarButton,{icon:Tg,label:(0,h._x)("Group","verb"),onClick:c}),u&&(0,s.createElement)(p.ToolbarButton,{icon:Ng,label:(0,h._x)("Row","single horizontal line"),onClick:()=>c("row")}),d&&(0,s.createElement)(p.ToolbarButton,{icon:Pg,label:(0,h._x)("Stack","verb"),onClick:()=>c("stack")}))},Mg=(0,s.createContext)(""),Ag=e=>{let{hideDragHandle:t}=e;const{blockClientIds:n,blockClientId:o,blockType:l,hasFixedToolbar:a,hasReducedUI:u,isValid:g,isVisual:h}=(0,m.useSelect)((e=>{const{getBlockName:t,getBlockMode:n,getSelectedBlockClientIds:o,isBlockValid:l,getBlockRootClientId:i,getSettings:s}=e(Jn),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:f}=(0,m.useDispatch)(Jn),v=(0,s.useRef)(),{showMovers:b,gestures:k}=Im({ref:v,onChange(e){e&&u||f(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=g&&h,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)(xm,{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)(qm,{clientIds:n}),!C&&(0,s.createElement)(xg,{clientId:n[0]}),(0,s.createElement)(ym,{clientIds:n,hideDragHandle:t||u}))),E&&C&&(0,s.createElement)(Rg,null),E&&(0,s.createElement)(s.Fragment,null,(0,s.createElement)(co.Slot,{group:"parent",className:"block-editor-block-toolbar__slot"}),(0,s.createElement)(co.Slot,{group:"block",className:"block-editor-block-toolbar__slot"}),(0,s.createElement)(co.Slot,{className:"block-editor-block-toolbar__slot"}),(0,s.createElement)(co.Slot,{group:"inline",className:"block-editor-block-toolbar__slot"}),(0,s.createElement)(co.Slot,{group:"other",className:"block-editor-block-toolbar__slot"}),(0,s.createElement)(Mg.Provider,{value:null==l?void 0:l.name},(0,s.createElement)(Qm.Slot,null))),(0,s.createElement)(Ig,{clientIds:n}))},Dg=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(Jn),{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)(dm,i({focusOnMount:t,className:d
64
- /* translators: accessibility text for the block toolbar */,"aria-label":(0,h.__)("Block tools")},o),(0,s.createElement)(Ag,{hideDragHandle:n}))};function Og(e){const{isNavigationMode:t,isMultiSelecting:n,hasMultiSelection:o,isTyping:r,getSettings:l,getLastMultiSelectedBlockClientId:i}=e(Jn);return{isNavigationMode:t(),isMultiSelecting:n(),isTyping:r(),hasFixedToolbar:l().hasFixedToolbar,lastClientId:o()?i():null}}function Fg(e){let{clientId:t,rootClientId:n,isEmptyDefaultBlock:o,capturingClientId:r,__unstablePopoverSlot:l,__unstableContentRef:i}=e;const{isNavigationMode:a,isMultiSelecting:u,isTyping:p,hasFixedToolbar:g,lastClientId:h}=(0,m.useSelect)(Og,[]),f=(0,m.useSelect)((e=>{const{isBlockInsertionPointVisible:n,getBlockInsertionPoint:o,getBlockOrder:r}=e(Jn);if(!n())return!1;const l=o();return r(l.rootClientId)[l.index]===t}),[t]),v=(0,d.useViewportMatch)("medium"),b=(0,s.useRef)(!1),{stopTyping:k}=(0,m.useDispatch)(Jn),_=a,y=!a&&!g&&v&&!u&&!(!p&&!a&&o)&&!p,E=!(a||y||g||o);(0,gu.useShortcut)("core/block-editor/focus-toolbar",(()=>{b.current=!0,k(!0)}),{isDisabled:!E}),(0,s.useEffect)((()=>{b.current=!1}));const C=(0,s.useRef)();return _||y?(0,s.createElement)(Go,{clientId:r||t,bottomClientId:h,className:c()("block-editor-block-list__block-popover",{"is-insertion-point-visible":f}),__unstablePopoverSlot:l,__unstableContentRef:i},y&&(0,s.createElement)(Dg,{focusOnMount:b.current,__experimentalInitialIndex:C.current,__experimentalOnIndexChange:e=>{C.current=e},key:t}),_&&(0,s.createElement)(cm,{clientId:t,rootClientId:n})):null}function zg(e){const{getSelectedBlockClientId:t,getFirstMultiSelectedBlockClientId:n,getBlockRootClientId:o,getBlock:l,getBlockParents:i,__experimentalGetBlockListSettingsForBlocks:s}=e(Jn),a=t()||n();if(!a)return;const{name:c,attributes:d={}}=l(a)||{},p=i(a),m=s(p),g=(0,u.find)(p,(e=>{var t;return null===(t=m[e])||void 0===t?void 0:t.__experimentalCaptureToolbars}));return{clientId:a,rootClientId:o(a),name:c,isEmptyDefaultBlock:c&&(0,r.isUnmodifiedDefaultBlock)({name:c,attributes:d}),capturingClientId:g}}function Vg(e){let{__unstablePopoverSlot:t,__unstableContentRef:n}=e;const o=(0,m.useSelect)(zg,[]);if(!o)return null;const{clientId:r,rootClientId:l,name:i,isEmptyDefaultBlock:a,capturingClientId:c}=o;return i?(0,s.createElement)(Fg,{clientId:r,rootClientId:l,isEmptyDefaultBlock:a,capturingClientId:c,__unstablePopoverSlot:t,__unstableContentRef:n}):null}function Hg(e){let{children:t}=e;const n=(0,s.useContext)(Jp),o=(0,s.useContext)(p.Disabled.Context);return n||o?t:(z()('wp.components.Popover.Slot name="block-toolbar"',{alternative:"wp.blockEditor.BlockTools",since:"5.8"}),(0,s.createElement)(tm,{__unstablePopoverSlot:"block-toolbar"},(0,s.createElement)(Vg,{__unstablePopoverSlot:"block-toolbar"}),t))}const Gg=(0,d.createHigherOrderComponent)((e=>t=>{const{clientId:n}=oo();return(0,s.createElement)(e,i({},t,{clientId:n}))}),"withClientId"),Ug=Gg((e=>{let{clientId:t,showSeparator:n,isFloating:o,onAddBlock:r,isToggle:l}=e;return(0,s.createElement)(Zp,{className:c()({"block-list-appender__toggle":l}),rootClientId:t,showSeparator:n,isFloating:o,onAddBlock:r})})),Wg=(0,d.compose)([Gg,(0,m.withSelect)(((e,t)=>{let{clientId:n}=t;const{getBlockOrder:o}=e(Jn),r=o(n);return{lastBlockClientId:(0,u.last)(r)}}))])((e=>{let{clientId:t}=e;return(0,s.createElement)(Kp,{rootClientId:t})})),$g=new WeakMap;function jg(e,t){const n=(0,m.useSelect)((e=>e(Jn).getSettings().mediaUpload),[]),{canInsertBlockType:o,getBlockIndex:l,getClientIdsOfDescendants:i}=(0,m.useSelect)(Jn),{insertBlocks:s,moveBlocksToPosition:a,updateBlockAttributes:c,clearSelectedBlock:u}=(0,m.useDispatch)(Jn),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),g=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,yl.getFilesFromDataTransfer)(e.dataTransfer),n=e.dataTransfer.getData("text/html");n?g(n):t.length?p(t):d(e)}}function Kg(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 qg(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=Kg(e,t,r);(void 0===n||l<n)&&(n=l,o=r)})),[n,o]}function Yg(e,t,n){const o="horizontal"===n?["left","right"]:["top","bottom"],r=(0,h.isRTL)();let l,i;return e.forEach(((e,n)=>{const s=e.getBoundingClientRect(),[a,c]=qg(t,s,o);(void 0===i||a<i)&&(i=a,l=n+("bottom"===c||!r&&"right"===c||r&&"left"===c?1:0))})),l}function Zg(){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(Jn);return"all"===n(e)}),[e]),{getBlockListSettings:r}=(0,m.useSelect)(Jn),{showInsertionPoint:l,hideInsertionPoint:i}=(0,m.useDispatch)(Jn),a=jg(e,t),c=(0,d.useThrottle)((0,s.useCallback)(((t,o)=>{var i;const s=Yg(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 Qg(e){const{clientId:t,allowedBlocks:n,__experimentalDefaultBlock:o,__experimentalDirectInsert:l,template:i,templateLock:a,wrapperRef:c,templateInsertUpdatesSelection:d,__experimentalCaptureToolbars:p,__experimentalAppenderTagName:g,renderAppender:h,orientation:f,placeholder:v,__experimentalLayout:b}=e;!function(e,t,n,o,r,l,i,a){const{updateBlockListSettings:c}=(0,m.useDispatch)(Jn),{blockListSettings:u,parentLock:d}=(0,m.useSelect)((t=>{const n=t(Jn).getBlockRootClientId(e);return{blockListSettings:t(Jn).getBlockListSettings(e),parentLock:t(Jn).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=Rr(null==a?void 0:a.type);t.orientation=e.getOrientation(a)}void 0!==n&&(t.__experimentalDefaultBlock=n),void 0!==o&&(t.__experimentalDirectInsert=o),Vo()(u,t)||c(e,t)}),[e,u,p,n,o,r,d,l,i,c,a])}(t,n,o,l,a,p,f,b),function(e,t,n,o){const{getSelectedBlocksInitialCaretPosition:l}=(0,m.useSelect)(Jn),{replaceInnerBlocks:i}=(0,m.useDispatch)(Jn),a=(0,m.useSelect)((t=>t(Jn).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(Jn).getBlock(t),o=(0,r.getBlockType)(n.name);if(o&&o.providesContext)return function(e,t){$g.has(t)||$g.set(t,new WeakMap);const n=$g.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)(Cl,{value:k},(0,s.createElement)(sh,{rootClientId:t,renderAppender:h,__experimentalAppenderTagName:g,__experimentalLayout:b,wrapperRef:c,placeholder:v}))}function Xg(e){return lu(e),(0,s.createElement)(Qg,e)}const Jg=(0,s.forwardRef)(((e,t)=>{const n=eh({ref:t},e);return(0,s.createElement)("div",{className:"block-editor-inner-blocks"},(0,s.createElement)("div",n))}));function eh(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{clientId:n}=oo(),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(Jn),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,Zg({rootClientId:n})]),p={__experimentalCaptureToolbars:l,...t},g=p.value&&p.onChange?Xg:Qg;return{...e,ref:u,className:c()(e.className,"block-editor-block-list__layout",{"has-overlay":a}),children:n?(0,s.createElement)(g,i({},p,{clientId:n})):(0,s.createElement)(sh,t)}}eh.save=r.__unstableGetInnerBlocksProps,Jg.DefaultBlockAppender=Wg,Jg.ButtonBlockAppender=Ug,Jg.Content=()=>eh.save().children;const th=Jg,nh=(0,s.createContext)(),oh=(0,s.createContext)();function rh(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(Jn),{outlineMode:o,focusMode:r}=t();return{isOutlineMode:o,isFocusMode:r,isNavigationMode:n()}}),[]),{setBlockVisibility:p}=(0,m.useDispatch)(Jn),g=(0,s.useMemo)((()=>{const{IntersectionObserver:e}=window;if(e)return new e((e=>{const t={};for(const n of e)t[n.target.getAttribute("data-block")]=n.isIntersecting;p(t)}))}),[]),h=eh({ref:(0,d.useMergeRefs)([au(),nm(),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)(nh.Provider,{value:o},(0,s.createElement)(oh.Provider,{value:g},(0,s.createElement)("div",h)))}function lh(e){return function(){const e=(0,m.useSelect)((e=>e(Jn).getSettings().__experimentalBlockPatterns),[]);(0,s.useEffect)((()=>{if(null==e||!e.length)return;let t,n=-1;const o=()=>{n++,n>=e.length||((0,m.select)(Jn).__experimentalGetParsedPattern(e[n].name),t=om(o))};return t=om(o),()=>rm(t)}),[e])}(),(0,s.createElement)(Hg,null,(0,s.createElement)(no,{value:eo},(0,s.createElement)(rh,e)))}function ih(e){let{placeholder:t,rootClientId:n,renderAppender:o,__experimentalAppenderTagName:r,__experimentalLayout:l=Mr}=e;const{order:i,selectedBlocks:a,visibleBlocks:c}=(0,m.useSelect)((e=>{const{getBlockOrder:t,getSelectedBlockClientIds:o,__unstableGetVisibleBlocks:r}=e(Jn);return{order:t(n),selectedBlocks:o(),visibleBlocks:r()}}),[n]);return(0,s.createElement)(Dr,{value:l},i.map((e=>(0,s.createElement)(m.AsyncModeProvider,{key:e,value:!c.has(e)&&!a.includes(e)},(0,s.createElement)(Yc,{rootClientId:n,clientId:e})))),i.length<1&&t,(0,s.createElement)(Qp,{tagName:r,rootClientId:n,renderAppender:o}))}function sh(e){return(0,s.createElement)(m.AsyncModeProvider,{value:!1},(0,s.createElement)(ih,e))}function ah(e){return[...e].sort(((t,n)=>e.filter((e=>e===n)).length-e.filter((e=>e===t)).length)).shift()}function ch(){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=ah(o),i=0===r||r?`${r}${l}`:void 0;return i}function uh(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=ch(e),n="string"!=typeof e&&isNaN(parseFloat(t));return n}function dh(e){return!!e&&("string"==typeof e||!!Object.values(e).filter((e=>!!e||0===e)).length)}function ph(e){let{onChange:t,values:n,...o}=e;const r=ch(n),l=dh(n)&&uh(n),a=l?(0,h.__)("Mixed"):null;return(0,s.createElement)(p.__experimentalUnitControl,i({},o,{"aria-label":(0,h.__)("Border radius"),disableUnits:l,isOnly:!0,value:r,onChange:t,placeholder:a}))}lh.__unstableElementContext=nh;const mh={topLeft:(0,h.__)("Top left"),topRight:(0,h.__)("Top right"),bottomLeft:(0,h.__)("Bottom left"),bottomRight:(0,h.__)("Bottom right")};function gh(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(mh).map((e=>{let[n,l]=e;return(0,s.createElement)(p.Tooltip,{text:l,position:"top",key:n},(0,s.createElement)("div",{className:"components-border-radius-control__tooltip-wrapper"},(0,s.createElement)(p.__experimentalUnitControl,i({},o,{"aria-label":l,value:r[n],onChange:(a=n,e=>{t&&t({...r,[a]:e||void 0})})}))));var a})))}const hh=(0,s.createElement)(A.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(A.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"})),fh=(0,s.createElement)(A.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(A.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 vh(e){let{isLinked:t,...n}=e;const o=t?(0,h.__)("Unlink Radii"):(0,h.__)("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?hh:fh,iconSize:16,"aria-label":o})))}const bh={topLeft:null,topRight:null,bottomLeft:null,bottomRight:null},kh={px:100,em:20,rem:20};function _h(e){let{onChange:t,values:n}=e;const[o,r]=(0,s.useState)(!dh(n)||!uh(n)),l=(0,p.__experimentalUseCustomUnits)({availableUnits:Bo("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 ah(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)(ch(n));return(0,s.createElement)("fieldset",{className:"components-border-radius-control"},(0,s.createElement)("legend",null,(0,h.__)("Radius")),(0,s.createElement)("div",{className:"components-border-radius-control__wrapper"},o?(0,s.createElement)(s.Fragment,null,(0,s.createElement)(ph,{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:kh[i],initialPosition:0,withInputField:!1,onChange:e=>{t(void 0!==e?`${e}${i}`:void 0)},step:c})):(0,s.createElement)(gh,{min:0,onChange:t,values:n||bh,units:l}),(0,s.createElement)(vh,{onClick:()=>r(!o),isLinked:o})))}function yh(e){var t;const{attributes:{style:n},setAttributes:o}=e;return(0,s.createElement)(_h,{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=To(t)),o({style:t})}})}ed([td,rd]);const Eh=(e,t,n)=>{if(t){const n=(0,u.find)(e,{slug:t});if(n)return n}return{color:n}},Ch=(e,t)=>(0,u.find)(e,{color:t});function Sh(e,t){if(e&&t)return`has-${(0,u.kebabCase)(t)}-${e}`}function wh(){return{disableCustomColors:!Bo("color.custom"),disableCustomGradients:!Bo("color.customGradient")}}function Bh(){const e=wh(),t=Bo("color.palette.custom"),n=Bo("color.palette.theme"),o=Bo("color.palette.default"),r=Bo("color.defaultPalette");e.colors=(0,s.useMemo)((()=>{const e=[];return n&&n.length&&e.push({name:(0,h._x)("Theme","Indicates this palette comes from the theme."),colors:n}),r&&o&&o.length&&e.push({name:(0,h._x)("Default","Indicates this palette comes from WordPress."),colors:o}),t&&t.length&&e.push({name:(0,h._x)("Custom","Indicates this palette comes from the theme."),colors:t}),e}),[o,n,t]);const l=Bo("color.gradients.custom"),i=Bo("color.gradients.theme"),a=Bo("color.gradients.default"),c=Bo("color.defaultGradients");return e.gradients=(0,s.useMemo)((()=>{const e=[];return i&&i.length&&e.push({name:(0,h._x)("Theme","Indicates this palette comes from the theme."),gradients:i}),c&&a&&a.length&&e.push({name:(0,h._x)("Default","Indicates this palette comes from WordPress."),gradients:a}),l&&l.length&&e.push({name:(0,h._x)("Custom","Indicates this palette is created by the user."),gradients:l}),e}),[l,i,a]),e}const Ih="__experimentalBorder",xh=["top","right","bottom","left"],Th=e=>{var t,n;return{...e,borderColor:void 0,style:{...e.style,border:{radius:null===(t=e.style)||void 0===t||null===(n=t.border)||void 0===n?void 0:n.radius}}}},Nh=(e,t,n)=>{let o;return e.some((e=>e.colors.some((e=>e[t]===n&&(o=e,!0))))),o},Ph=e=>{let{colors:t,namedColor:n,customColor:o}=e;if(n){const e=Nh(t,"slug",n);if(e)return e}if(!o)return{color:void 0};return Nh(t,"color",o)||{color:o}};function Lh(e){const t=/var:preset\|color\|(.+)/.exec(e);return t&&t[1]?t[1]:null}function Rh(e){const{attributes:t,clientId:n,setAttributes:o}=e,{style:l}=t,{colors:i}=Bh(),a=Mh(e.name),c=Bo("border.color")&&Mh(e.name,"color"),u=Bo("border.radius")&&Mh(e.name,"radius"),d=Bo("border.style")&&Mh(e.name,"style"),m=Bo("border.width")&&Mh(e.name,"width");if([!c,!u,!d,!m].every(Boolean)||!a)return null;const g=(0,r.getBlockSupport)(e.name,[Ih,"__experimentalDefaultControls"]),f=(null==g?void 0:g.color)||(null==g?void 0:g.width),v=((e,t)=>{const{borderColor:n,style:o}=e,{border:r}=o||{};if(n){const{color:e}=Ph({colors:t,namedColor:n});return e?{...r,color:e}:r}if(!r)return r;const l={...r};return xh.forEach((e=>{var n;const o=Lh(null===(n=l[e])||void 0===n?void 0:n.color);if(o){const{color:n}=Ph({colors:t,namedColor:o});l[e]={...l[e],color:n}}})),l})(t,i);return(0,s.createElement)(Fo,{__experimentalGroup:"border"},(m||c)&&(0,s.createElement)(p.__experimentalToolsPanelItem,{hasValue:()=>(e=>{const{borderColor:t,style:n}=e.attributes;return(0,p.__experimentalIsDefinedBorder)(null==n?void 0:n.border)||!!t})(e),label:(0,h.__)("Border"),onDeselect:()=>(e=>{var t;let{attributes:n={},setAttributes:o}=e;const{style:r}=n;o({borderColor:void 0,style:{...r,border:To({radius:null==r||null===(t=r.border)||void 0===t?void 0:t.radius})}})})(e),isShownByDefault:f,resetAllFilter:Th,panelId:n},(0,s.createElement)(p.__experimentalBorderBoxControl,{colors:i,enableAlpha:!0,onChange:e=>{var t;let n,r={...e};if((0,p.__experimentalHasSplitBorders)(e))r={top:{...e.top},right:{...e.right},bottom:{...e.bottom},left:{...e.left}},xh.forEach((t=>{var n;if(null!==(n=e[t])&&void 0!==n&&n.color){var o;const n=Ph({colors:i,customColor:null===(o=e[t])||void 0===o?void 0:o.color});n.slug&&(r[t].color=`var:preset|color|${n.slug}`)}}));else if(null!=e&&e.color){const t=null==e?void 0:e.color,o=Ph({colors:i,customColor:t});o.slug&&(n=o.slug,r.color=void 0)}const s=To({...l,border:{radius:null==l||null===(t=l.border)||void 0===t?void 0:t.radius,...r}});o({style:s,borderColor:n})},popoverPlacement:"left-start",popoverOffset:40,showStyle:d,value:v,__experimentalHasMultipleOrigins:!0,__experimentalIsRenderedInSidebar:!0})),u&&(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,h.__)("Radius"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:Ah(o,"radius")})}(e),isShownByDefault:null==g?void 0:g.radius,resetAllFilter:e=>{var t;return{...e,style:{...e.style,border:{...null===(t=e.style)||void 0===t?void 0:t.border,radius:void 0}}}},panelId:n},(0,s.createElement)(yh,e)))}function Mh(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,Ih);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 Ah(e,t){return To({...e,border:{...null==e?void 0:e.border,[t]:void 0}})}function Dh(e,t,n){if(!Mh(t,"color")||Lo(t,Ih,"color"))return e;const o=Oh(n),r=c()(e.className,o);return e.className=r||void 0,e}function Oh(e){var t;const{borderColor:n,style:o}=e,r=Sh("border-color",n);return c()({"has-border-color":n||(null==o||null===(t=o.border)||void 0===t?void 0:t.color),[r]:!!r})}const Fh=(0,d.createHigherOrderComponent)((e=>t=>{var n,o,r,l,a,c,u,d,p;const{name:m,attributes:g}=t,{borderColor:h,style:f}=g,{colors:v}=Bh();if(!Mh(m,"color")||Lo(m,Ih,"color"))return(0,s.createElement)(e,t);const{color:b}=Ph({colors:v,namedColor:h}),{color:k}=Ph({colors:v,namedColor:Lh(null==f||null===(n=f.border)||void 0===n||null===(o=n.top)||void 0===o?void 0:o.color)}),{color:_}=Ph({colors:v,namedColor:Lh(null==f||null===(r=f.border)||void 0===r||null===(l=r.right)||void 0===l?void 0:l.color)}),{color:y}=Ph({colors:v,namedColor:Lh(null==f||null===(a=f.border)||void 0===a||null===(c=a.bottom)||void 0===c?void 0:c.color)}),{color:E}=Ph({colors:v,namedColor:Lh(null==f||null===(u=f.border)||void 0===u||null===(d=u.left)||void 0===d?void 0:d.color)}),C={borderTopColor:k||b,borderRightColor:_||b,borderBottomColor:y||b,borderLeftColor:E||b};let S=t.wrapperProps;return S={...t.wrapperProps,style:{...null===(p=t.wrapperProps)||void 0===p?void 0:p.style,...C}},(0,s.createElement)(e,i({},t,{wrapperProps:S}))}));function zh(e){if(e)return`has-${e}-gradient-background`}function Vh(e,t){const n=(0,u.find)(e,["slug",t]);return n&&n.gradient}function Hh(e,t){return(0,u.find)(e,["gradient",t])}function Gh(e,t){const n=Hh(e,t);return n&&n.slug}function Uh(){let{gradientAttribute:e="gradient",customGradientAttribute:t="customGradient"}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{clientId:n}=oo(),o=Bo("color.gradients.custom"),r=Bo("color.gradients.theme"),l=Bo("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(Jn),l=r(n)||{};return{customGradient:l[t],gradient:l[e]}}),[n,e,t]),{updateBlockAttributes:u}=(0,m.useDispatch)(Jn),d=(0,s.useCallback)((o=>{const r=Gh(i,o);u(n,r?{[e]:r,[t]:void 0}:{[e]:void 0,[t]:o})}),[i,n,u]),p=zh(a);let g;return g=a?Vh(i,a):c,{gradientClass:p,gradientValue:g,setGradient:d}}(0,l.addFilter)("blocks.registerBlockType","core/border/addAttributes",(function(e){return Mh(e,"color")?e.attributes.borderColor?e:{...e,attributes:{...e.attributes,borderColor:{type:"string"}}}:e})),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/border/addSaveProps",Dh),(0,l.addFilter)("blocks.registerBlockType","core/border/addEditProps",(function(e){if(!Mh(e,"color")||Lo(e,Ih,"color"))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=n=>{let o={};return t&&(o=t(n)),Dh(o,e,n)},e})),(0,l.addFilter)("editor.BlockListBlock","core/border/with-border-color-palette-styles",Fh);const Wh=["colors","disableCustomColors","gradients","disableCustomGradients"];function $h(e){let{colors:t,gradients:n,disableCustomColors:o,disableCustomGradients:r,__experimentalHasMultipleOrigins:l,__experimentalIsRenderedInSidebar:i,className:a,label:d,onColorChange:m,onGradientChange:g,colorValue:f,gradientValue:v,clearable:b,showTitle:k=!0,enableAlpha:_}=e;const y=m&&(!(0,u.isEmpty)(t)||!o),E=g&&(!(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,h.__)("Select color type"),hideLabelFromVision:!0,isBlock:!0},(0,s.createElement)(p.__experimentalToggleGroupControlOption,{value:"color",label:(0,h.__)("Solid")}),(0,s.createElement)(p.__experimentalToggleGroupControlOption,{value:"gradient",label:(0,h.__)("Gradient")})),("color"===C||!E)&&(0,s.createElement)(p.ColorPalette,{value:f,onChange:E?e=>{m(e),g()}: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=>{g(e),m()}:g,gradients:n,disableCustomGradients:r,__experimentalHasMultipleOrigins:l,__experimentalIsRenderedInSidebar:i,clearable:b})))):null}function jh(e){const t={};return t.colors=Bo("color.palette"),t.gradients=Bo("color.gradients"),t.disableCustomColors=!Bo("color.custom"),t.disableCustomGradients=!Bo("color.customGradient"),(0,s.createElement)($h,i({},t,e))}const Kh=function(e){return(0,u.every)(Wh,(t=>e.hasOwnProperty(t)))?(0,s.createElement)($h,e):(0,s.createElement)(jh,e)},qh=e=>{let{setting:t,children:n,panelId:o,...r}=e;return(0,s.createElement)(p.__experimentalToolsPanelItem,i({hasValue:()=>!!t.colorValue||!!t.gradientValue,label:t.label,onDeselect:()=>{t.colorValue?t.onColorChange():t.gradientValue&&t.onGradientChange()},isShownByDefault:void 0===t.isShownByDefault||t.isShownByDefault},r,{className:"block-editor-tools-panel-color-gradient-settings__item",panelId:o,resetAllFilter:t.resetAllFilter}),n)},Yh=e=>{let{colorValue:t,label:n}=e;return(0,s.createElement)(p.__experimentalHStack,{justify:"flex-start"},(0,s.createElement)(p.ColorIndicator,{className:"block-editor-panel-color-gradient-settings__color-indicator",colorValue:t}),(0,s.createElement)(p.FlexItem,null,n))},Zh=e=>t=>{let{onToggle:n,isOpen:o}=t;const{colorValue:r,label:l}=e,i={onClick:n,className:c()("block-editor-panel-color-gradient-settings__dropdown",{"is-open":o}),"aria-expanded":o};return(0,s.createElement)(p.Button,i,(0,s.createElement)(Yh,{colorValue:r,label:l}))};function Qh(e){let t,{colors:n,disableCustomColors:o,disableCustomGradients:r,enableAlpha:l,gradients:a,settings:c,__experimentalHasMultipleOrigins:u,__experimentalIsRenderedInSidebar:d,...m}=e;return d&&(t={placement:"left-start",offset:36,__unstableShift:!0}),(0,s.createElement)(s.Fragment,null,c.map(((e,c)=>{var g;const h={clearable:!1,colorValue:e.colorValue,colors:n,disableCustomColors:o,disableCustomGradients:r,enableAlpha:l,gradientValue:e.gradientValue,gradients:a,label:e.label,onColorChange:e.onColorChange,onGradientChange:e.onGradientChange,showTitle:!1,__experimentalHasMultipleOrigins:u,__experimentalIsRenderedInSidebar:d,...e},f={colorValue:null!==(g=e.gradientValue)&&void 0!==g?g:e.colorValue,label:e.label};return e&&(0,s.createElement)(qh,i({key:c,setting:e},m),(0,s.createElement)(p.Dropdown,{popoverProps:t,className:"block-editor-tools-panel-color-gradient-settings__dropdown",contentClassName:"block-editor-panel-color-gradient-settings__dropdown-content",renderToggle:Zh(f),renderContent:()=>(0,s.createElement)(Kh,h)}))})))}ed([td,rd]);const Xh=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,g=c||r;if(!m&&!g)return null;const f=[{color:m,description:(0,h.__)("text color")},{color:g,description:(0,h.__)("link color")}],v=Xu(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 f){if(!e.color)continue;const t=Xu(e.color),n=t.isReadable(v,_),o=t.alpha()<1;if(!n){if(b||o)continue;y=k<t.brightness()?(0,h.sprintf)(// translators: %s is a type of text color, e.g., "text color" or "link color".
65
  (0,h.__)("This color combination may be hard for people to read. Try using a darker background color and/or a brighter %s."),e.description):(0,h.sprintf)(// translators: %s is a type of text color, e.g., "text color" or "link color".
66
- (0,h.__)("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,h.__)("This color combination may be hard for people to read.");break}o&&u&&(y=(0,h.__)("Transparent text may be hard for people to read."),E=(0,h.__)("Transparent text may be hard for people to read."))}return y?((0,Ht.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 Jh(e){return e.ownerDocument.defaultView.getComputedStyle(e)}function ef(e){let{enableAlpha:t=!1,settings:n,clientId:o,enableContrastChecking:r=!0}=e;const[l,a]=(0,s.useState)(),[c,u]=(0,s.useState)(),[d,p]=(0,s.useState)(),m=yo(o);(0,s.useEffect)((()=>{var e;if(!r)return;if(!m.current)return;u(Jh(m.current).color);const t=null===(e=m.current)||void 0===e?void 0:e.querySelector("a");t&&t.innerText&&p(Jh(t).color);let n=m.current,o=Jh(n).backgroundColor;for(;"rgba(0, 0, 0, 0)"===o&&n.parentNode&&n.parentNode.nodeType===n.parentNode.ELEMENT_NODE;)n=n.parentNode,o=Jh(n).backgroundColor;a(o)}));const g=Bh();return(0,s.createElement)(Fo,{__experimentalGroup:"color"},(0,s.createElement)(Qh,i({enableAlpha:t,panelId:o,settings:n,__experimentalIsItemGroup:!1,__experimentalHasMultipleOrigins:!0,__experimentalIsRenderedInSidebar:!0},g)),r&&(0,s.createElement)(Xh,{backgroundColor:l,textColor:c,enableAlphaChecker:t,linkColor:d}))}const tf="color",nf=e=>{const t=(0,r.getBlockSupport)(e,tf);return t&&(!0===t.link||!0===t.gradient||!1!==t.background||!1!==t.text)},of=e=>{if("web"!==s.Platform.OS)return!1;const t=(0,r.getBlockSupport)(e,tf);return(0,u.isObject)(t)&&!!t.link},rf=e=>{const t=(0,r.getBlockSupport)(e,tf);return(0,u.isObject)(t)&&!!t.gradients},lf=e=>{const t=(0,r.getBlockSupport)(e,tf);return t&&!1!==t.background},sf=e=>{const t=(0,r.getBlockSupport)(e,tf);return t&&!1!==t.text},af=(e,t)=>To(No(t,e,void 0)),cf=e=>({textColor:void 0,style:af(["color","text"],e.style)}),uf=e=>({style:af(["elements","link","color","text"],e.style)}),df=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 pf(e,t,n){var o,r,l,i,s,a;if(!nf(t)||Lo(t,tf))return e;const u=rf(t),{backgroundColor:d,textColor:p,gradient:m,style:g}=n,h=e=>!Lo(t,tf,e),f=h("text")?Sh("color",p):void 0,v=h("gradients")?zh(m):void 0,b=h("background")?Sh("background-color",d):void 0,k=h("background")||h("gradients"),_=d||(null==g||null===(o=g.color)||void 0===o?void 0:o.background)||u&&(m||(null==g||null===(r=g.color)||void 0===r?void 0:r.gradient)),y=c()(e.className,f,v,{[b]:!(u&&null!=g&&null!==(l=g.color)&&void 0!==l&&l.gradient||!b),"has-text-color":h("text")&&(p||(null==g||null===(i=g.color)||void 0===i?void 0:i.text)),"has-background":k&&_,"has-link-color":h("link")&&(null==g||null===(s=g.elements)||void 0===s||null===(a=s.link)||void 0===a?void 0:a.color)});return e.className=y||void 0,e}const mf=(e,t)=>{const n=/var:preset\|color\|(.+)/.exec(t);return n&&n[1]?Eh(e,n[1]).color:t};function gf(e){var t,n,o,l,i,a,c,u,d;const{name:p,attributes:m}=e,g=Bo("color.palette.custom"),f=Bo("color.palette.theme"),v=Bo("color.palette.default"),b=(0,s.useMemo)((()=>[...g||[],...f||[],...v||[]]),[g,f,v]),k=Bo("color.gradients.custom"),_=Bo("color.gradients.theme"),y=Bo("color.gradients.default"),E=(0,s.useMemo)((()=>[...k||[],..._||[],...y||[]]),[k,_,y]),C=Bo("color.custom"),S=Bo("color.customGradient"),w=Bo("color.background"),B=Bo("color.link"),I=Bo("color.text"),x=C||!f||(null==f?void 0:f.length)>0,T=S||!_||(null==_?void 0:_.length)>0,N=(0,s.useRef)(m);if((0,s.useEffect)((()=>{N.current=m}),[m]),!nf(p))return null;const P=of(p)&&B&&x,L=sf(p)&&I&&x,R=lf(p)&&w&&x,M=rf(p)&&T;if(!(P||L||R||M))return null;const{style:A,textColor:D,backgroundColor:O,gradient:F}=m;let z;if(M&&F)z=Vh(E,F);else if(M){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=Ch(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:To(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,[tf,"__experimentalDefaultControls"]);return(0,s.createElement)(ef,{enableContrastChecking:G,clientId:e.clientId,enableAlpha:!0,settings:[...L?[{label:(0,h.__)("Text"),onColorChange:H("text"),colorValue:Eh(b,D,null==A||null===(n=A.color)||void 0===n?void 0:n.text).color,isShownByDefault:null==U?void 0:U.text,resetAllFilter:cf}]:[],...R||M?[{label:(0,h.__)("Background"),onColorChange:R?H("background"):void 0,colorValue:Eh(b,O,null==A||null===(o=A.color)||void 0===o?void 0:o.background).color,gradientValue:z,onGradientChange:M?t=>{const n=Gh(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:To(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:To(e),gradient:void 0}}e.setAttributes(o),N.current={...N.current,...o}}:void 0,isShownByDefault:null==U?void 0:U.background,resetAllFilter:df}]:[],...P?[{label:(0,h.__)("Link"),onColorChange:t=>{var n;const o=Ch(b,t),r=null!=o&&o.slug?`var:preset|color|${o.slug}`:t,l=To(No(null===(n=N.current)||void 0===n?void 0:n.style,["elements","link","color","text"],r));e.setAttributes({style:l}),N.current={...N.current,style:l}},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,resetAllFilter:uf}]:[]]})}const hf=(0,d.createHigherOrderComponent)((e=>t=>{var n;const{name:o,attributes:r}=t,{backgroundColor:l,textColor:a}=r,c=Bo("color.palette.custom")||[],u=Bo("color.palette.theme")||[],d=Bo("color.palette.default")||[],p=(0,s.useMemo)((()=>[...c||[],...u||[],...d||[]]),[c,u,d]);if(!nf(o)||Lo(o,tf))return(0,s.createElement)(e,t);const m={};var g,h;a&&!Lo(o,tf,"text")&&(m.color=null===(g=Eh(p,a))||void 0===g?void 0:g.color),l&&!Lo(o,tf,"background")&&(m.backgroundColor=null===(h=Eh(p,l))||void 0===h?void 0:h.color);let f=t.wrapperProps;return f={...t.wrapperProps,style:{...m,...null===(n=t.wrapperProps)||void 0===n?void 0:n.style}},(0,s.createElement)(e,i({},t,{wrapperProps:f}))})),ff={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 nf(e)?(e.attributes.backgroundColor||Object.assign(e.attributes,{backgroundColor:{type:"string"}}),e.attributes.textColor||Object.assign(e.attributes,{textColor:{type:"string"}}),rf(e)&&!e.attributes.gradient&&Object.assign(e.attributes,{gradient:{type:"string"}}),e):e})),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/color/addSaveProps",pf),(0,l.addFilter)("blocks.registerBlockType","core/color/addEditProps",(function(e){if(!nf(e)||Lo(e,tf))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=n=>{let o={};return t&&(o=t(n)),pf(o,e,n)},e})),(0,l.addFilter)("editor.BlockListBlock","core/color/with-color-palette-styles",hf),(0,l.addFilter)("blocks.switchToBlockType.transformedBlock","core/color/addTransforms",(function(e,t,n,o){const r=e.name;return Po({linkColor:of(r),textColor:sf(r),backgroundColor:lf(r),gradient:rf(r)},ff,e,t,n,o)}));const vf=[{name:(0,h._x)("Regular","font style"),value:"normal"},{name:(0,h._x)("Italic","font style"),value:"italic"}],bf=[{name:(0,h._x)("Thin","font weight"),value:"100"},{name:(0,h._x)("Extra Light","font weight"),value:"200"},{name:(0,h._x)("Light","font weight"),value:"300"},{name:(0,h._x)("Regular","font weight"),value:"400"},{name:(0,h._x)("Medium","font weight"),value:"500"},{name:(0,h._x)("Semi Bold","font weight"),value:"600"},{name:(0,h._x)("Bold","font weight"),value:"700"},{name:(0,h._x)("Extra Bold","font weight"),value:"800"},{name:(0,h._x)("Black","font weight"),value:"900"}],kf=(e,t)=>e?t?(0,h.__)("Appearance"):(0,h.__)("Font style"):(0,h.__)("Font weight");function _f(e){const{onChange:t,hasFontStyles:n=!0,hasFontWeights:o=!0,value:{fontStyle:r,fontWeight:l}}=e,i=n||o,a=kf(n,o),c={key:"default",name:(0,h.__)("Default"),style:{fontStyle:void 0,fontWeight:void 0}},u=(0,s.useMemo)((()=>n&&o?(()=>{const e=[c];return vf.forEach((t=>{let{name:n,value:o}=t;bf.forEach((t=>{let{name:r,value:l}=t;const i="normal"===o?r:(0,h.sprintf)(
67
  /* translators: 1: Font weight name. 2: Font style name. */
68
- (0,h.__)("%1$s %2$s"),r,n);e.push({key:`${o}-${l}`,name:i,style:{fontStyle:o,fontWeight:l}})}))})),e})():n?(()=>{const e=[c];return vf.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 bf.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,h.sprintf)(// translators: %s: Currently selected font appearance.
69
  (0,h.__)("Currently selected font appearance: %s"),d.name):(0,h.sprintf)(// translators: %s: Currently selected font style.
70
  (0,h.__)("Currently selected font style: %s"),d.name):(0,h.sprintf)(// translators: %s: Currently selected font weight.
71
- (0,h.__)("Currently selected font weight: %s"),d.name):(0,h.__)("No selected font appearance"),options:u,value:d,onChange:e=>{let{selectedItem:n}=e;return t(n.style)}})}const yf=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||z()("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,h.__)("Line height"),placeholder:1.5,step:.1,value:i,min:0}))},Ef="typography.lineHeight";function Cf(e){var t;const{attributes:{style:n},setAttributes:o}=e;return(0,s.createElement)(yf,{__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:To(t)})}})}function Sf(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!Bo("typography.lineHeight");return!(0,r.hasBlockSupport)(e,Ef)||t}const wf="typography.__experimentalFontStyle",Bf="typography.__experimentalFontWeight";function If(e){var t,n;const{attributes:{style:o},setAttributes:r}=e,l=!xf(e),i=!Tf(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)(_f,{onChange:e=>{r({style:To({...o,typography:{...null==o?void 0:o.typography,fontStyle:e.fontStyle,fontWeight:e.fontWeight}})})},hasFontStyles:l,hasFontWeights:i,value:{fontStyle:a,fontWeight:c}})}function xf(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=(0,r.hasBlockSupport)(e,wf),n=Bo("typography.fontStyle");return!t||!n}function Tf(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=(0,r.hasBlockSupport)(e,Bf),n=Bo("typography.fontWeight");return!t||!n}function Nf(e){const t=xf(e),n=Tf(e);return t&&n}function Pf(e){let{value:t="",onChange:n,fontFamilies:o,...r}=e;const l=Bo("typography.fontFamilies");if(o||(o=l),(0,u.isEmpty)(o))return null;const a=[{value:"",label:(0,h.__)("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,h.__)("Font family"),options:a,value:t,onChange:n,labelPosition:"top"},r))}const Lf="typography.__experimentalFontFamily";function Rf(e,t,n){if(!(0,r.hasBlockSupport)(t,Lf))return e;if(Lo(t,dv,"fontFamily"))return e;if(null==n||!n.fontFamily)return e;const o=new(Mm())(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 Mf(e){var t;let{setAttributes:n,attributes:{fontFamily:o}}=e;const r=Bo("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)(Pf,{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 Af(e){let{name:t}=e;const n=Bo("typography.fontFamilies");return!n||0===n.length||!(0,r.hasBlockSupport)(t,Lf)}(0,l.addFilter)("blocks.registerBlockType","core/fontFamily/addAttribute",(function(e){return(0,r.hasBlockSupport)(e,Lf)?(e.attributes.fontFamily||Object.assign(e.attributes,{fontFamily:{type:"string"}}),e):e})),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/fontFamily/addSaveProps",Rf),(0,l.addFilter)("blocks.registerBlockType","core/fontFamily/addEditProps",(function(e){if(!(0,r.hasBlockSupport)(e,Lf))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=n=>{let o={};return t&&(o=t(n)),Rf(o,e,n)},e}));const Df=(e,t,n)=>{if(t){const n=(0,u.find)(e,{slug:t});if(n)return n}return{size:n}};function Of(e,t){return(0,u.find)(e,{size:t})||{size:t}}function Ff(e){if(e)return`has-${(0,u.kebabCase)(e)}-font-size`}const zf=function(e){const t=Bo("typography.fontSizes"),n=!Bo("typography.customFontSize");return(0,s.createElement)(p.FontSizePicker,i({},e,{fontSizes:t,disableCustomFontSizes:n}))},Vf="typography.fontSize";function Hf(e,t,n){if(!(0,r.hasBlockSupport)(t,Vf))return e;if(Lo(t,dv,"fontSize"))return e;const o=new(Mm())(e.className);o.add(Ff(n.fontSize));const l=o.value;return e.className=l||void 0,e}function Gf(e){var t,n;const{attributes:{fontSize:o,style:r},setAttributes:l}=e,i=Bo("typography.fontSizes"),a=Df(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)(zf,{onChange:e=>{const t=Of(i,e).slug;l({style:To({...r,typography:{...null==r?void 0:r.typography,fontSize:t?void 0:e}}),fontSize:t})},value:c,withReset:!1})}function Uf(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=Bo("typography.fontSizes"),n=!(null==t||!t.length);return!(0,r.hasBlockSupport)(e,Vf)||!n}const Wf=(0,d.createHigherOrderComponent)((e=>t=>{var n,o;const l=Bo("typography.fontSizes"),{name:i,attributes:{fontSize:a,style:c},wrapperProps:u}=t;if(!(0,r.hasBlockSupport)(i,Vf)||Lo(i,dv,"fontSize")||!a||null!=c&&null!==(n=c.typography)&&void 0!==n&&n.fontSize)return(0,s.createElement)(e,t);const d=Df(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"),$f={fontSize:[["fontSize"],["style","typography","fontSize"]]};(0,l.addFilter)("blocks.registerBlockType","core/font/addAttribute",(function(e){return(0,r.hasBlockSupport)(e,Vf)?(e.attributes.fontSize||Object.assign(e.attributes,{fontSize:{type:"string"}}),e):e})),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/font/addSaveProps",Hf),(0,l.addFilter)("blocks.registerBlockType","core/font/addEditProps",(function(e){if(!(0,r.hasBlockSupport)(e,Vf))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=n=>{let o={};return t&&(o=t(n)),Hf(o,e,n)},e})),(0,l.addFilter)("editor.BlockListBlock","core/font-size/with-font-size-inline-styles",Wf),(0,l.addFilter)("blocks.switchToBlockType.transformedBlock","core/font-size/addTransforms",(function(e,t,n,o){const l=e.name;return Po({fontSize:(0,r.hasBlockSupport)(l,Vf)},$f,e,t,n,o)}));const jf=(0,s.createElement)(A.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(A.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"})),Kf=(0,s.createElement)(A.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(A.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"})),qf=[{name:(0,h.__)("Underline"),value:"underline",icon:jf},{name:(0,h.__)("Strikethrough"),value:"line-through",icon:Kf}];function Yf(e){let{value:t,onChange:n}=e;return(0,s.createElement)("fieldset",{className:"block-editor-text-decoration-control"},(0,s.createElement)("legend",null,(0,h.__)("Decoration")),(0,s.createElement)("div",{className:"block-editor-text-decoration-control__buttons"},qf.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 Zf="typography.__experimentalTextDecoration";function Qf(e){var t;const{attributes:{style:n},setAttributes:o}=e;return(0,s.createElement)(Yf,{value:null==n||null===(t=n.typography)||void 0===t?void 0:t.textDecoration,onChange:function(e){o({style:To({...n,typography:{...null==n?void 0:n.typography,textDecoration:e}})})}})}function Xf(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!(0,r.hasBlockSupport)(e,Zf),n=Bo("typography.textDecoration");return t||!n}const Jf=(0,s.createElement)(A.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(A.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"})),ev=(0,s.createElement)(A.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(A.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"})),tv=(0,s.createElement)(A.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(A.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"})),nv=[{name:(0,h.__)("Uppercase"),value:"uppercase",icon:Jf},{name:(0,h.__)("Lowercase"),value:"lowercase",icon:ev},{name:(0,h.__)("Capitalize"),value:"capitalize",icon:tv}];function ov(e){let{value:t,onChange:n}=e;return(0,s.createElement)("fieldset",{className:"block-editor-text-transform-control"},(0,s.createElement)("legend",null,(0,h.__)("Letter case")),(0,s.createElement)("div",{className:"block-editor-text-transform-control__buttons"},nv.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 rv="typography.__experimentalTextTransform";function lv(e){var t;const{attributes:{style:n},setAttributes:o}=e;return(0,s.createElement)(ov,{value:null==n||null===(t=n.typography)||void 0===t?void 0:t.textTransform,onChange:function(e){o({style:To({...n,typography:{...null==n?void 0:n.typography,textTransform:e}})})}})}function iv(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!(0,r.hasBlockSupport)(e,rv),n=Bo("typography.textTransform");return t||!n}function sv(e){let{value:t,onChange:n,__unstableInputWidth:o="60px"}=e;const r=(0,p.__experimentalUseCustomUnits)({availableUnits:Bo("spacing.units")||["px","em","rem"],defaultValues:{px:2,em:.2,rem:.2}});return(0,s.createElement)(p.__experimentalUnitControl,{label:(0,h.__)("Letter spacing"),value:t,__unstableInputWidth:o,units:r,onChange:n})}const av="typography.__experimentalLetterSpacing";function cv(e){var t;const{attributes:{style:n},setAttributes:o}=e;return(0,s.createElement)(sv,{value:null==n||null===(t=n.typography)||void 0===t?void 0:t.letterSpacing,onChange:function(e){o({style:To({...n,typography:{...null==n?void 0:n.typography,letterSpacing:e}})})},__unstableInputWidth:"100%"})}function uv(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!(0,r.hasBlockSupport)(e,av),n=Bo("typography.letterSpacing");return t||!n}const dv="typography",pv=[Ef,Vf,wf,Bf,Lf,Zf,rv,av];function mv(e){const{clientId:t}=e,n=Af(e),o=Uf(e),l=Nf(e),i=Sf(e),a=Xf(e),c=iv(e),u=uv(e),d=!xf(e),m=!Tf(e),g=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=[Nf(e),Uf(e),Sf(e),Af(e),Xf(e),iv(e),uv(e)];return t.filter(Boolean).length===t.length}(e),f=gv(e.name);if(g||!f)return null;const v=(0,r.getBlockSupport)(e.name,[dv,"__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)(Fo,{__experimentalGroup:"typography"},!n&&(0,s.createElement)(p.__experimentalToolsPanelItem,{hasValue:()=>function(e){return!!e.attributes.fontFamily}(e),label:(0,h.__)("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)(Mf,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)
72
- /* translators: Ensure translation is distinct from "Letter case" */,label:(0,h.__)("Font size"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({fontSize:void 0,style:To({...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)(Gf,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:kf(d,m),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:To({...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)(If,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,h.__)("Line height"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:To({...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)(Cf,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,h.__)("Decoration"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:To({...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)(Qf,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)
73
- /* translators: Ensure translation is distinct from "Font size" */,label:(0,h.__)("Letter case"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:To({...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)(lv,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,h.__)("Letter spacing"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:To({...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)(cv,e)))}const gv=e=>pv.some((t=>(0,r.hasBlockSupport)(e,t))),hv=[...pv,Ih,tf,Qo],fv=e=>hv.some((t=>(0,r.hasBlockSupport)(e,t))),vv="var:";function bv(e){var t;return null!=e&&null!==(t=e.startsWith)&&void 0!==t&&t.call(e,vv)?`var(--wp--${e.slice(vv.length).split("|").join("--")})`:e}function kv(){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"!==(null==l?void 0:l[0])){const s=(0,u.get)(e,l);r.__EXPERIMENTAL_STYLE_PROPERTY[o].useEngine||(i&&"string"!=typeof s?Object.entries(i).forEach((e=>{const[t,o]=e,r=(0,u.get)(s,[o]);r&&(n[t]=bv(r))})):t.includes(l.join("."))||(n[o]=bv((0,u.get)(e,l))))}}));const o=_l(e);return o.forEach((e=>{n[e.key]=e.value})),n}const _v={"__experimentalBorder.__experimentalSkipSerialization":["border"],"color.__experimentalSkipSerialization":[tf],[`${dv}.__experimentalSkipSerialization`]:[dv],[`${Qo}.__experimentalSkipSerialization`]:["spacing"]},yv={..._v,[`${Qo}`]:["spacing.blockGap"]},Ev={gradients:"gradient"};function Cv(e,t,n){let o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:yv;if(!fv(t))return e;let{style:l}=n;return Object.entries(o).forEach((e=>{let[n,o]=e;const i=(0,r.getBlockSupport)(t,n);!0===i&&(l=(0,u.omit)(l,o)),Array.isArray(i)&&i.forEach((e=>{const t=Ev[e]||e;l=(0,u.omit)(l,[[...o,t]])}))})),e.style={...kv(l),...e.style},e}const Sv=(0,d.createHigherOrderComponent)((e=>t=>{const n=ro();return(0,s.createElement)(s.Fragment,null,n&&(0,s.createElement)(s.Fragment,null,(0,s.createElement)(gf,t),(0,s.createElement)(mv,t),(0,s.createElement)(Rh,t),(0,s.createElement)(er,t)),(0,s.createElement)(e,t))}),"withToolbarControls"),wv=(0,d.createHigherOrderComponent)((e=>t=>{var n,o;const l=`wp-elements-${(0,d.useInstanceId)(e)}`,a=Lo(t.name,tf,"link")?(0,u.omit)(null===(n=t.attributes.style)||void 0===n?void 0:n.elements,["link"]):null===(o=t.attributes.style)||void 0===o?void 0:o.elements,p=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object.entries(t).map((t=>{let[n,o]=t;const l=kv(o);return(0,u.isEmpty)(l)?"":[`.editor-styles-wrapper .${e} ${r.__EXPERIMENTAL_ELEMENTS[n]}{`,...Object.entries(l).map((e=>{let[t,n]=e;return`\t${(0,u.kebabCase)(t)}: ${n};`})),"}"].join("\n")})).join("\n")}(l,a),m=(0,s.useContext)(lh.__unstableElementContext);return(0,s.createElement)(s.Fragment,null,a&&m&&(0,s.createPortal)((0,s.createElement)("style",{dangerouslySetInnerHTML:{__html:p}}),m),(0,s.createElement)(e,i({},t,{className:a?c()(t.className,l):t.className})))}));(0,l.addFilter)("blocks.registerBlockType","core/style/addAttribute",(function(e){return fv(e)?(e.attributes.style||Object.assign(e.attributes,{style:{type:"object"}}),e):e})),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/style/addSaveProps",Cv),(0,l.addFilter)("blocks.registerBlockType","core/style/addEditProps",(function(e){if(!fv(e))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=n=>{let o={};return t&&(o=t(n)),Cv(o,e,n,_v)},e})),(0,l.addFilter)("editor.BlockEdit","core/style/with-block-controls",Sv),(0,l.addFilter)("editor.BlockListBlock","core/editor/with-elements-styles",wv),(0,l.addFilter)("blocks.registerBlockType","core/settings/addAttribute",(function(e){var t,n;return n=e,(0,r.hasBlockSupport)(n,"__experimentalSettings",!1)?(null!=e&&null!==(t=e.attributes)&&void 0!==t&&t.settings||(e.attributes={...e.attributes,settings:{type:"object"}}),e):e}));const Bv=(0,s.createElement)(A.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(A.Path,{d:"M12 4 4 19h16L12 4zm0 3.2 5.5 10.3H12V7.2z"})),Iv=function(e){let t,{colorPalette:n,duotonePalette:o,disableCustomColors:r,disableCustomDuotone:l,value:i,onChange:a}=e;return t="unset"===i?(0,s.createElement)(p.ColorIndicator,{className:"block-editor-duotone-control__unset-indicator"}):i?(0,s.createElement)(p.DuotoneSwatch,{values:i}):(0,s.createElement)(Tr,{icon:Bv}),(0,s.createElement)(p.Dropdown,{popoverProps:{className:"block-editor-duotone-control__popover",headerTitle:(0,h.__)("Duotone"),isAlternate:!0},renderToggle:e=>{let{isOpen:n,onToggle:o}=e;return(0,s.createElement)(p.ToolbarButton,{showTooltip:!0,onClick:o,"aria-haspopup":"true","aria-expanded":n,onKeyDown:e=>{n||e.keyCode!==Vc.DOWN||(e.preventDefault(),o())},label:(0,h.__)("Apply duotone filter"),icon:t})},renderContent:()=>(0,s.createElement)(p.MenuGroup,{label:(0,h.__)("Duotone")},(0,s.createElement)("div",{className:"block-editor-duotone-control__description"},(0,h.__)("Create a two-tone color effect without losing your original image.")),(0,s.createElement)(p.DuotonePicker,{colorPalette:n,duotonePalette:o,disableCustomColors:r,disableCustomDuotone:l,value:i,onChange:a}))})},xv=[];function Tv(e){let{selector:t,id:n,colors:o}=e;return"unset"===o?(0,s.createElement)(Pd,{selector:t}):(0,s.createElement)(s.Fragment,null,(0,s.createElement)(Ld,{id:n,colors:o}),(0,s.createElement)(Nd,{id:n,selector:t}))}function Nv(e){let{presetSetting:t,defaultSetting:n}=e;const o=!Bo(n),r=Bo(`${t}.custom`)||xv,l=Bo(`${t}.theme`)||xv,i=Bo(`${t}.default`)||xv;return(0,s.useMemo)((()=>[...r,...l,...o?xv:i]),[o,r,l,i])}function Pv(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=Nv({presetSetting:"color.duotone",defaultSetting:"color.defaultDuotone"}),a=Nv({presetSetting:"color.palette",defaultSetting:"color.defaultPalette"}),c=!Bo("color.custom"),u=!Bo("color.customDuotone")||0===(null==a?void 0:a.length)&&c;return 0===(null==i?void 0:i.length)&&u?null:(0,s.createElement)(co,{group:"block",__experimentalShareWithChildBlocks:!0},(0,s.createElement)(Iv,{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})}}))}ed([td]);const Lv=(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)(Pv,t))}),"withDuotoneControls"),Rv=(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),g=c()(null==t?void 0:t.className,p),h=(0,s.useContext)(lh.__unstableElementContext);return(0,s.createElement)(s.Fragment,null,h&&(0,s.createPortal)((0,s.createElement)(Tv,{selector:m,id:p,colors:u}),h),(0,s.createElement)(e,i({},t,{className:g})))}),"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",Lv),(0,l.addFilter)("editor.BlockListBlock","core/editor/duotone/with-styles",Rv);const Mv="__experimentalLayout";function Av(e){let{setAttributes:t,attributes:n,name:o}=e;const{layout:l}=n,i=Bo("layout"),a=(0,m.useSelect)((e=>{const{getSettings:t}=e(Jn);return t().supportsLayout}),[]),c=(0,r.getBlockSupport)(o,Mv,{}),{allowSwitching:u,allowEditing:d=!0,allowInheriting:g=!0,default:f}=c;if(!d)return null;const v=!(!g||!i||null!=l&&l.type&&"default"!==(null==l?void 0:l.type)&&(null==l||!l.inherit)),b=l||f||{},{inherit:k=!1,type:_="default"}=b;if("default"===_&&!a)return null;const y=Rr(_),E=e=>t({layout:e});return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(Fo,null,(0,s.createElement)(p.PanelBody,{title:(0,h.__)("Layout")},v&&(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.ToggleControl,{label:(0,h.__)("Inner blocks use full width"),checked:!k,onChange:()=>t({layout:{inherit:!k}})}),(0,s.createElement)("p",{className:"block-editor-hooks__layout-controls-helptext"},k?(0,h.__)("Nested blocks use theme content width with options for full and wide widths."):(0,h.__)("Nested blocks will fill the width of this container."))),!k&&u&&(0,s.createElement)(Dv,{type:_,onChange:e=>t({layout:{type:e}})}),!k&&y&&(0,s.createElement)(y.inspectorControls,{layout:b,onChange:E,layoutBlockSupport:c}))),!k&&y&&(0,s.createElement)(y.toolBarControls,{layout:b,onChange:E,layoutBlockSupport:c}))}function Dv(e){let{type:t,onChange:n}=e;return(0,s.createElement)(p.ButtonGroup,null,Lr.map((e=>{let{name:o,label:r}=e;return(0,s.createElement)(p.Button,{key:o,isPressed:t===o,onClick:()=>n(o)},r)})))}const Ov=(0,d.createHigherOrderComponent)((e=>t=>{const{name:n}=t;return[(0,r.hasBlockSupport)(n,Mv)&&(0,s.createElement)(Av,i({key:"layout"},t)),(0,s.createElement)(e,i({key:"edit"},t))]}),"withInspectorControls"),Fv=(0,d.createHigherOrderComponent)((e=>t=>{const{name:n,attributes:o}=t,l=(0,r.hasBlockSupport)(n,Mv),a=(0,d.useInstanceId)(e),p=Bo("layout")||{},m=(0,s.useContext)(lh.__unstableElementContext),{layout:g}=o,{default:h}=(0,r.getBlockSupport)(n,Mv)||{},f=null!=g&&g.inherit?p:g||h||{},v=l?function(e){var t,n,o;const r=[];return e.layout?(null!=e&&null!==(t=e.layout)&&void 0!==t&&t.orientation&&r.push(`is-${(0,u.kebabCase)(e.layout.orientation)}`),null!=e&&null!==(n=e.layout)&&void 0!==n&&n.justifyContent&&r.push(`is-content-justification-${(0,u.kebabCase)(e.layout.justifyContent)}`),null!=e&&null!==(o=e.layout)&&void 0!==o&&o.flexWrap&&"nowrap"===e.layout.flexWrap&&r.push("is-nowrap"),r):r}(o):null,b=c()(null==t?void 0:t.className,{[`wp-container-${a}`]:l},v);return(0,s.createElement)(s.Fragment,null,l&&m&&(0,s.createPortal)((0,s.createElement)(Fr,{blockName:n,selector:`.wp-container-${a}`,layout:f,style:null==o?void 0:o.style}),m),(0,s.createElement)(e,i({},t,{className:b})))}));function zv(e){var t;const n=(null===(t=e.style)||void 0===t?void 0:t.border)||{};return{className:Oh(e)||void 0,style:kv({border:n})}}function Vv(e){const{colors:t}=Bh(),n=zv(e),{borderColor:o}=e;if(o){const e=Ph({colors:t,namedColor:o});n.style.borderColor=e.color}return n}function Hv(e){var t,n,o,r,l,i;const{backgroundColor:s,textColor:a,gradient:u,style:d}=e,p=Sh("background-color",s),m=Sh("color",a),g=zh(u),h=g||(null==d||null===(t=d.color)||void 0===t?void 0:t.gradient);return{className:c()(m,g,{[p]:!h&&!!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:kv({color:(null==d?void 0:d.color)||{}})}}(0,l.addFilter)("blocks.registerBlockType","core/layout/addAttribute",(function(e){return(0,u.has)(e.attributes,["layout","type"])||(0,r.hasBlockSupport)(e,Mv)&&(e.attributes={...e.attributes,layout:{type:"object"}}),e})),(0,l.addFilter)("editor.BlockListBlock","core/editor/layout/with-layout-styles",Fv),(0,l.addFilter)("editor.BlockEdit","core/editor/layout/with-inspector-controls",Ov);const Gv={};function Uv(e){const{backgroundColor:t,textColor:n,gradient:o}=e,r=Bo("color.palette.custom")||[],l=Bo("color.palette.theme")||[],i=Bo("color.palette.default")||[],a=Bo("color.gradients")||Gv,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=Hv(e);if(t){const e=Eh(c,t);d.style.backgroundColor=e.color}if(o&&(d.style.background=Vh(u,o)),n){const e=Eh(c,n);d.style.color=e.color}return d}function Wv(e){const{style:t}=e;return{style:kv({spacing:(null==t?void 0:t.spacing)||{}})}}function $v(e){const[t,n]=(0,s.useState)(e);return(0,s.useEffect)((()=>{e&&n(e)}),[e]),t}const jv=e=>(0,d.createHigherOrderComponent)((t=>n=>(0,s.createElement)(t,i({},n,{colors:e}))),"withCustomColorPalette"),Kv=()=>(0,d.createHigherOrderComponent)((e=>t=>{const n=Bo("color.palette.custom"),o=Bo("color.palette.theme"),r=Bo("color.palette.default"),l=(0,s.useMemo)((()=>[...n||[],...o||[],...r||[]]),[n,o,r]);return(0,s.createElement)(e,i({},t,{colors:l}))}),"withEditorColorPalette");function qv(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=Xu(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=Ch(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=Eh(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:Sh(n,i.slug)},e}),{})}render(){return(0,s.createElement)(e,i({},this.props,{colors:void 0},this.state,this.setters,{colorUtils:this.colorUtils}))}}])}function Yv(e){return function(){const t=jv(e);for(var n=arguments.length,o=new Array(n),r=0;r<n;r++)o[r]=arguments[r];return(0,d.createHigherOrderComponent)(qv(o,t),"withCustomColors")}}function Zv(){const e=Kv();for(var t=arguments.length,n=new Array(t),o=0;o<t;o++)n[o]=arguments[o];return(0,d.createHigherOrderComponent)(qv(n,e),"withColors")}const Qv=[],Xv=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=Bo("typography.fontSizes")||Qv;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=Df(r,l,n[t]);return e[o]={...i,class:Ff(l)},e}),{});return{...t,...i}}render(){return(0,s.createElement)(e,i({},this.props,{fontSizes:void 0},this.state,this.setters))}}]),"withFontSizes")},Jv=(0,s.createElement)(A.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(A.Path,{d:"M4 19.8h8.9v-1.5H4v1.5zm8.9-15.6H4v1.5h8.9V4.2zm-8.9 7v1.5h16v-1.5H4z"})),eb=(0,s.createElement)(A.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(A.Path,{d:"M16.4 4.2H7.6v1.5h8.9V4.2zM4 11.2v1.5h16v-1.5H4zm3.6 8.6h8.9v-1.5H7.6v1.5z"})),tb=(0,s.createElement)(A.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(A.Path,{d:"M11.1 19.8H20v-1.5h-8.9v1.5zm0-15.6v1.5H20V4.2h-8.9zM4 12.8h16v-1.5H4v1.5z"})),nb=[{icon:Jv,title:(0,h.__)("Align text left"),align:"left"},{icon:eb,title:(0,h.__)("Align text center"),align:"center"},{icon:tb,title:(0,h.__)("Align text right"),align:"right"}],ob={position:"bottom right",isAlternate:!0},rb=function(e){let{value:t,onChange:n,alignmentControls:o=nb,label:r=(0,h.__)("Align"),describedBy:l=(0,h.__)("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)),g=c?p.ToolbarGroup:p.ToolbarDropdownMenu,f=c?{isCollapsed:a}:{};return(0,s.createElement)(g,i({icon:m?m.icon:(0,h.isRTL)()?tb:Jv,label:r,toggleProps:{describedBy:l},popoverProps:ob,controls:o.map((e=>{const{align:n}=e,o=t===n;return{...e,isActive:o,role:a?"menuitemradio":void 0,onClick:d(n)}}))},f))},lb=e=>(0,s.createElement)(rb,i({},e,{isToolbar:!1})),ib=e=>(0,s.createElement)(rb,i({},e,{isToolbar:!0})),sb=()=>{},ab={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(Jn),r=t();return{selectedBlockName:r?n(r):null,rootClientId:o().rootClientId}}),[]),[o,r,l]=Qd(t,sb),i=(0,s.useMemo)((()=>(e.trim()?yp(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)(tu,{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))}}},cb=window.wp.apiFetch;var ub=n.n(cb);const db=(0,s.createElement)(A.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(A.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"})),pb=(0,s.createElement)(A.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(A.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"})),mb={name:"links",className:"block-editor-autocompleters__link",triggerPrefix:"[[",options:async e=>{let t=await ub()({path:(0,Np.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)(Tr,{key:"icon",icon:"page"===e.subtype?db:pb}),e.title),getOptionCompletion:e=>(0,s.createElement)("a",{href:e.url},e.title)},gb=[];function hb(e){let{completers:t=gb}=e;const{name:n}=oo();return(0,s.useMemo)((()=>{let e=t;return(n===(0,r.getDefaultBlockName)()||(0,r.getBlockSupport)(n,"__experimentalSlashInserter",!1))&&(e=e.concat([ab,mb])),(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])}const fb=function(e){return(0,s.createElement)(p.Autocomplete,i({},e,{completers:hb(e)}))},vb=(0,s.createElement)(A.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(A.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"})),bb=function(e){let{isActive:t,label:n=(0,h.__)("Toggle full height"),onToggle:o,isDisabled:r}=e;return(0,s.createElement)(p.ToolbarButton,{isActive:t,icon:vb,label:n,onClick:()=>o(!t),disabled:r})},kb=()=>{},_b=function(e){const{label:t=(0,h.__)("Change matrix alignment"),onChange:n=kb,value:o="center",isDisabled:r}=e,l=(0,s.createElement)(p.__experimentalAlignmentMatrixControl.Icon,{value:o});return(0,s.createElement)(p.Dropdown,{position:"bottom right",popoverProps:{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!==Vc.DOWN||(e.preventDefault(),n())},label:t,icon:l,showTooltip:!0,disabled:r})},renderContent:()=>(0,s.createElement)(p.__experimentalAlignmentMatrixControl,{hasFocusBorder:!1,onChange:n,value:o})})},yb=(0,s.createElement)(A.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(A.Path,{d:"M10.8622 8.04053L14.2805 12.0286L10.8622 16.0167L9.72327 15.0405L12.3049 12.0286L9.72327 9.01672L10.8622 8.04053Z"})),Eb=function(e){let{rootLabelText:t}=e;const{selectBlock:n,clearSelectedBlock:o}=(0,m.useDispatch)(Jn),{clientId:r,parents:l,hasSelection:i}=(0,m.useSelect)((e=>{const{getSelectionStart:t,getSelectedBlockClientId:n,getBlockParents:o}=e(Jn),r=n();return{parents:o(r),clientId:r,hasSelection:!!t().clientId}}),[]),a=t||(0,h.__)("Document");return(0,s.createElement)("ul",{className:"block-editor-block-breadcrumb",role:"list","aria-label":(0,h.__)("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)(Tr,{icon:yb,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)(sm,{clientId:e,maximumLength:35})),(0,s.createElement)(Tr,{icon:yb,className:"block-editor-block-breadcrumb__separator"})))),!!r&&(0,s.createElement)("li",{className:"block-editor-block-breadcrumb__current","aria-current":"true"},(0,s.createElement)(sm,{clientId:r,maximumLength:35})))};function Cb(e){return(0,m.useSelect)((t=>{const{isBlockSelected:n,hasSelectedInnerBlock:o,canEditBlock:r}=t(Jn);return!r(e)||!n(e)&&!o(e,!0)}),[e])}const Sb=()=>(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"})),wb=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)(Sb,null)))},Bb=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,h.__)("Open Colors Selector"),onClick:o,onKeyDown:e=>{r||e.keyCode!==Vc.DOWN||(e.preventDefault(),o())},icon:(0,s.createElement)(n,null,(0,s.createElement)(t,null,(0,s.createElement)(wb,null)))}))}},Ib=e=>{let{children:t,...n}=e;return z()("wp.blockEditor.BlockColorsStyleSelector",{alternative:"block supports API",since:"6.1",version:"6.3"}),(0,s.createElement)(p.Dropdown,{position:"bottom right",className:"block-library-colors-selector",contentClassName:"block-library-colors-selector__popover",renderToggle:Bb(n),renderContent:()=>t})},xb=(0,s.createElement)(A.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,s.createElement)(A.Path,{d:"M13.8 5.2H3v1.5h10.8V5.2zm-3.6 12v1.5H21v-1.5H10.2zm7.2-6H6.6v1.5h10.8v-1.5z"})),Tb=Cc(p.__experimentalTreeGridRow);function Nb(e){let{isSelected:t,position:n,level:o,rowCount:r,children:l,className:a,path:u,...d}=e;const p=Bc({isSelected:t,adjustScrolling:!1,enableAnimation:!0,triggerAnimationOnChange:u});return(0,s.createElement)(Tb,i({ref:p,className:c()("block-editor-list-view-leaf",a),level:o,positionInSet:n,setSize:r},d),l)}function Pb(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)(Tr,{icon:yb}))}const Lb=(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 g=lm(o),{isLocked:h}=mg(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!==Vc.ENTER&&e.keyCode!==Vc.SPACE||r(e)},ref:t,tabIndex:i,onFocus:a,onDragStart:e=>{e.dataTransfer.clearData(),null==u||u(e)},onDragEnd:d,draggable:m,href:`#block-${o}`,"aria-hidden":!0},(0,s.createElement)(Pb,{onClick:l}),(0,s.createElement)(tu,{icon:null==g?void 0:g.icon,showColors:!0}),(0,s.createElement)("span",{className:"block-editor-list-view-block-select-button__title"},(0,s.createElement)(sm,{clientId:o,maximumLength:35})),(null==g?void 0:g.anchor)&&(0,s.createElement)("span",{className:"block-editor-list-view-block-select-button__anchor"},g.anchor),h&&(0,s.createElement)("span",{className:"block-editor-list-view-block-select-button__lock"},(0,s.createElement)(Tr,{icon:hg}))))})),Rb=(0,s.forwardRef)(((e,t)=>{let{onClick:n,onToggleExpanded:o,block:r,isSelected:l,position:a,siblingBlockCount:u,level:d,isExpanded:p,selectedClientIds:g,...h}=e;const{clientId:f}=r,{blockMovingClientId:v,selectedBlockInBlockEditor:b}=(0,m.useSelect)((e=>{const{hasBlockMovingClientId:t,getSelectedBlockClientId:n}=e(Jn);return{blockMovingClientId:t(),selectedBlockInBlockEditor:n()}}),[f]),k=v&&b===f,_=c()("block-editor-list-view-block-contents",{"is-dropping-before":k}),y=g.includes(f)?g:[f];return(0,s.createElement)(am,{clientIds:y},(e=>{let{draggable:c,onDragStart:m,onDragEnd:g}=e;return(0,s.createElement)(Lb,i({ref:t,className:_,block:r,onClick:n,onToggleExpanded:o,isSelected:l,position:a,siblingBlockCount:u,level:d,draggable:c,onDragStart:m,onDragEnd:g,isExpanded:p},h))}))})),Mb=(0,s.createContext)({}),Ab=()=>(0,s.useContext)(Mb),Db=(0,s.memo)((function e(t){let{block:n,isDragged:o,isSelected:l,isBranchSelected:i,selectBlock:a,position:u,level:g,rowCount:f,siblingBlockCount:v,showBlockMovers:b,path:k,isExpanded:_,selectedClientIds:y,preventAnnouncement:E}=t;const C=(0,s.useRef)(null),[S,w]=(0,s.useState)(!1),{clientId:B}=n,I=l&&y[0]===B,x=l&&y[y.length-1]===B,{toggleBlockHighlight:T}=(0,m.useDispatch)(Jn),N=lm(B),P=(0,m.useSelect)((e=>e(Jn).getBlockName(B)),[B]),L=(0,r.hasBlockSupport)(P,"__experimentalToolbar",!0),{isLocked:R}=mg(B),M=`list-view-block-select-button__${(0,d.useInstanceId)(e)}`,A=((e,t,n)=>(0,h.sprintf)(
74
  /* translators: 1: The numerical position of the block. 2: The total number of blocks. 3. The level of nesting for the block. */
75
- (0,h.__)("Block %1$d of %2$d, Level %3$d"),e,t,n))(u,v,g);let D=(0,h.__)("Link");N&&(D=R?(0,h.sprintf)(// translators: %s: The title of the block. This string indicates a link to select the locked block.
76
  (0,h.__)("%s link (locked)"),N.title):(0,h.sprintf)(// translators: %s: The title of the block. This string indicates a link to select the block.
77
  (0,h.__)("%s link"),N.title));const O=N?(0,h.sprintf)(// translators: %s: The title of the block.
78
- (0,h.__)("Options for %s block"),N.title):(0,h.__)("Options"),{isTreeGridMounted:F,expand:z,collapse:V}=Ab(),H=b&&v>0,G=c()("block-editor-list-view-block__mover-cell",{"is-visible":S||l}),U=c()("block-editor-list-view-block__menu-cell",{"is-visible":S||I});(0,s.useEffect)((()=>{!F&&l&&C.current.focus()}),[]);const W=(0,s.useCallback)((()=>{w(!0),T(B,!0)}),[B,w,T]),$=(0,s.useCallback)((()=>{w(!1),T(B,!1)}),[B,w,T]),j=(0,s.useCallback)((e=>{a(e,B),e.preventDefault()}),[B,a]),K=(0,s.useCallback)((e=>{a(void 0,e)}),[a]),q=(0,s.useCallback)((e=>{e.preventDefault(),e.stopPropagation(),!0===_?V(B):!1===_&&z(B)}),[B,z,V,_]);let Y;H?Y=2:L||(Y=3);const Z=c()({"is-selected":l,"is-first-selected":I,"is-last-selected":x,"is-branch-selected":i,"is-dragging":o,"has-single-cell":!L}),Q=y.includes(B)?y:[B];return(0,s.createElement)(Nb,{className:Z,onMouseEnter:W,onMouseLeave:$,onFocus:W,onBlur:$,level:g,position:u,rowCount:f,path:k,id:`list-view-block-${B}`,"data-block":B,isExpanded:_,"aria-selected":!!l},(0,s.createElement)(p.__experimentalTreeGridCell,{className:"block-editor-list-view-block__contents-cell",colSpan:Y,ref:C,"aria-label":D,"aria-selected":!!l,"aria-expanded":_,"aria-describedby":M},(e=>{let{ref:t,tabIndex:o,onFocus:r}=e;return(0,s.createElement)("div",{className:"block-editor-list-view-block__contents-container"},(0,s.createElement)(Rb,{block:n,onClick:j,onToggleExpanded:q,isSelected:l,position:u,siblingBlockCount:v,level:g,ref:t,tabIndex:o,onFocus:r,isExpanded:_,selectedClientIds:y,preventAnnouncement:E}),(0,s.createElement)("div",{className:"block-editor-list-view-block-select-button__description",id:M},A))})),H&&(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.__experimentalTreeGridCell,{className:G,withoutGridItem:!0},(0,s.createElement)(p.__experimentalTreeGridItem,null,(e=>{let{ref:t,tabIndex:n,onFocus:o}=e;return(0,s.createElement)(km,{orientation:"vertical",clientIds:[B],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)(_m,{orientation:"vertical",clientIds:[B],ref:t,tabIndex:n,onFocus:o})})))),L&&(0,s.createElement)(p.__experimentalTreeGridCell,{className:U,"aria-selected":!!l},(e=>{let{ref:t,tabIndex:n,onFocus:o}=e;return(0,s.createElement)(wg,{clientIds:Q,icon:Xm,label:O,toggleProps:{ref:t,className:"block-editor-list-view-block__menu",tabIndex:n,onFocus:o},disableOpenOnArrowDown:!0,__experimentalSelectBlock:K})})))}));function Ob(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(Fb(t,n,o),0):1}const Fb=(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+Ob(r,e,t,n):o+1};function zb(e){const{blocks:t,selectBlock:n,showBlockMovers:o,selectedClientIds:r,level:l=1,path:i="",isBranchSelected:a=!1,listPosition:c=0,fixedListWindow:d,isExpanded:p}=e,{expandedState:g,draggedClientIds:h}=Ab(),f=(0,u.compact)(t),v=f.length;let b=c;return(0,s.createElement)(s.Fragment,null,f.map(((e,t)=>{var c;const{clientId:u,innerBlocks:k}=e;t>0&&(b+=Ob(f[t-1],g,h,p));const{itemInView:_}=d,y=_(b),E=t+1,C=i.length>0?`${i}_${E}`:`${E}`,S=!(null==k||!k.length),w=S?null!==(c=g[u])&&void 0!==c?c:p:void 0,B=!(null==h||!h.includes(u)),I=B||y,x=((e,t)=>Array.isArray(t)&&t.length?-1!==t.indexOf(e):t===e)(u,r),T=a||x&&S;return(0,s.createElement)(m.AsyncModeProvider,{key:u,value:!x},I&&(0,s.createElement)(Db,{block:e,selectBlock:n,isSelected:x,isBranchSelected:T,isDragged:B,level:l,position:E,rowCount:v,siblingBlockCount:v,showBlockMovers:o,path:C,isExpanded:w,listPosition:b,selectedClientIds:r}),!I&&(0,s.createElement)("tr",null,(0,s.createElement)("td",{className:"block-editor-list-view-placeholder"})),S&&w&&!B&&(0,s.createElement)(zb,{blocks:k,selectBlock:n,showBlockMovers:o,level:l+1,path:C,listPosition:b+1,fixedListWindow:d,isBranchSelected:T,selectedClientIds:r,isExpanded:p}))})))}zb.defaultProps={selectBlock:()=>{}};const Vb=(0,s.memo)(zb);function Hb(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,{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 Gb(e,t){return t.left<=e.x&&t.right>=e.x&&t.top<=e.y&&t.bottom>=e.y}const Ub=["top","bottom"];const Wb=(e,t)=>Array.isArray(t.clientIds)?{...e,...t.clientIds.reduce(((e,n)=>({...e,[n]:"expand"===t.type})),{})}:e,$b=(0,s.forwardRef)((function(e,t){let{id:n,blocks:o,showBlockMovers:l=!1,isExpanded:i=!1}=e;const{clientIdsTree:a,draggedClientIds:c,selectedClientIds:g}=function(e){return(0,m.useSelect)((t=>{const{getDraggedBlockClientIds:n,getSelectedBlockClientIds:o,__unstableGetClientIdsTree:r}=t(Jn);return{selectedClientIds:o(),draggedClientIds:n(),clientIdsTree:e||r()}}),[e])}(o),{visibleBlockCount:f}=(0,m.useSelect)((e=>{const{getGlobalBlockCount:t,getClientIdsOfDescendants:n}=e(Jn),o=(null==c?void 0:c.length)>0?n(c).length+1:0;return{visibleBlockCount:t()-o}}),[c]),{updateBlockSelection:v}=function(){const{clearSelectedBlock:e,multiSelect:t,selectBlock:n}=(0,m.useDispatch)(Jn),{getBlockName:o,getBlockParents:l,getBlockSelectionStart:i,getBlockSelectionEnd:a,getSelectedBlockClientIds:c,hasMultiSelection:d,hasSelectedBlock:p}=(0,m.useSelect)(Jn),{getBlockType:g}=(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===Vc.UP||r.keyCode===Vc.DOWN||r.keyCode===Vc.HOME||r.keyCode===Vc.END);if(!m&&!p()&&!d())return void n(s,null);const f=c(),v=[...l(s),s];m&&!f.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===Vc.HOME||r.keyCode===Vc.END)&&S.length>1)return;const w=(0,u.difference)(f,S);let B;if(1===w.length){var I;const e=null===(I=g(o(w[0])))||void 0===I?void 0:I.title;e&&(B=(0,h.sprintf)(
79
  /* translators: %s: block name */
80
  (0,h.__)("%s deselected."),e))}else w.length>1&&(B=(0,h.sprintf)(
81
  /* translators: %s: number of deselected blocks */
82
- (0,h.__)("%s blocks deselected."),w.length));B&&(0,Ht.speak)(B)}),[e,o,g,l,i,a,c,d,p,t,n])}}(),[b,k]=(0,s.useReducer)(Wb,{}),{ref:_,target:y}=function(){const{getBlockRootClientId:e,getBlockIndex:t,getBlockCount:n,getDraggedBlockClientIds:o,canInsertBlocks:r}=(0,m.useSelect)(Jn),[l,i]=(0,s.useState)(),{rootClientId:a,blockIndex:c}=l||{},u=jg(a,c),p=o(),g=(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]=qg(t,s,Ub),u=Gb(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){g(e,e.currentTarget)},onDragEnd(){g.cancel(),i(null)}}),target:l}}(),E=(0,s.useRef)(),C=(0,d.useMergeRefs)([E,_,t]),S=(0,s.useRef)(!1),{setSelectedTreeId:w}=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(Jn);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:g[0],setExpandedState:k}),B=(0,s.useCallback)(((e,t)=>{v(e,t),w(t)}),[w,v]);(0,s.useEffect)((()=>{S.current=!0}),[]);const[I]=(0,d.__experimentalUseFixedWindowList)(E,36,f,{useWindowing:!0,windowOverscan:40}),x=(0,s.useCallback)((e=>{e&&k({type:"expand",clientIds:[e]})}),[k]),T=(0,s.useCallback)((e=>{e&&k({type:"collapse",clientIds:[e]})}),[k]),N=(0,s.useCallback)((e=>{var t;x(null==e||null===(t=e.dataset)||void 0===t?void 0:t.block)}),[x]),P=(0,s.useCallback)((e=>{var t;T(null==e||null===(t=e.dataset)||void 0===t?void 0:t.block)}),[T]),L=(0,s.useCallback)(((e,t,n)=>{var o,r;e.shiftKey&&v(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)}),[v]),R=(0,s.useMemo)((()=>({isTreeGridMounted:S.current,draggedClientIds:c,expandedState:b,expand:x,collapse:T})),[S.current,c,b,x,T]);return(0,s.createElement)(m.AsyncModeProvider,{value:!0},(0,s.createElement)(Hb,{listViewRef:E,blockDropTarget:y}),(0,s.createElement)(p.__experimentalTreeGrid,{id:n,className:"block-editor-list-view-tree","aria-label":(0,h.__)("Block navigation structure"),ref:C,onCollapseRow:P,onExpandRow:N,onFocusRow:L},(0,s.createElement)(Mb.Provider,{value:R},(0,s.createElement)(Vb,{blocks:a,selectBlock:B,showBlockMovers:l,fixedListWindow:I,selectedClientIds:g,isExpanded:i}))))}));function jb(e){let{isEnabled:t,onToggle:n,isOpen:o,innerRef:r,...l}=e;return(0,s.createElement)(p.Button,i({},l,{ref:r,icon:xb,"aria-expanded":o,"aria-haspopup":"true",onClick:t?n:void 0
83
- /* translators: button label text should, if possible, be under 16 characters. */,label:(0,h.__)("List view"),className:"block-editor-block-navigation","aria-disabled":!t}))}const Kb=(0,s.forwardRef)((function(e,t){let{isDisabled:n,...o}=e;z()("wp.blockEditor.BlockNavigationDropdown",{since:"6.1",alternative:"wp.components.Dropdown and wp.blockEditor.ListView"});const r=(0,m.useSelect)((e=>!!e(Jn).getBlockCount()),[])&&!n;return(0,s.createElement)(p.Dropdown,{contentClassName:"block-editor-block-navigation__popover",position:"bottom right",renderToggle:e=>{let{isOpen:n,onToggle:l}=e;return(0,s.createElement)(jb,i({},o,{innerRef:t,isOpen:n,onToggle:l,isEnabled:r}))},renderContent:()=>(0,s.createElement)("div",{className:"block-editor-block-navigation__container"},(0,s.createElement)("p",{className:"block-editor-block-navigation__label"},(0,h.__)("List view")),(0,s.createElement)($b,null))})}));function qb(e){let{genericPreviewBlock:t,style:n,className:o,activeStyle:r}=e;const l=Am(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)(zd,{item:i,isStylePreview:!0})}function Yb(e){let{children:t,scope:n,...o}=e;return(0,s.createElement)(p.Fill,{name:`BlockStylesPreviewPanel/${n}`},(0,s.createElement)("div",o,t))}const Zb=()=>{};function Qb(e){let{clientId:t,onSwitch:n=Zb,onHoverClassName:o=Zb,scope:r}=e;const{onSelect:l,stylesToRender:i,activeStyle:a,genericPreviewBlock:m,className:g}=Om({clientId:t,onSwitch:n}),[h,f]=(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)}),[h]),!i||0===i.length)return null;const _=(0,u.debounce)(f,250),y=e=>{var t;h!==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:()=>y(e),onFocus:()=>y(e),onMouseLeave:()=>y(null),onBlur:()=>y(null),onClick:()=>(e=>{l(e),o(null),f(null),_.cancel()})(e),"aria-current":a.name===e.name},(0,s.createElement)(p.__experimentalText,{as:"span",limit:12,ellipsizeMode:"tail",className:"block-editor-block-styles__item-text",truncate:!0},t))}))),h&&!k&&(0,s.createElement)(Yb,{scope:r,className:"block-editor-block-styles__preview-panel",style:{top:v},onMouseLeave:()=>y(null)},(0,s.createElement)(qb,{activeStyle:a,className:g,genericPreviewBlock:m,style:h})))}Qb.Slot=function(e){let{scope:t}=e;return(0,s.createElement)(p.Slot,{name:`BlockStylesPreviewPanel/${t}`})};const Xb=Qb,Jb=(0,s.createElement)(A.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(A.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"})),ek=function(e){let{icon:t=Jb,label:n=(0,h.__)("Choose variation"),instructions:o=(0,h.__)("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,h.__)("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,h.__)("Skip"))))},tk=(0,s.createElement)(A.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(A.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"})),nk="carousel",ok="grid",rk=e=>{let{onBlockPatternSelect:t}=e;return(0,s.createElement)("div",{className:"block-editor-block-pattern-setup__actions"},(0,s.createElement)(p.Button,{variant:"primary",onClick:t},(0,h.__)("Choose")))},lk=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:mm,label:(0,h.__)("Previous pattern"),onClick:t,disabled:0===o}),(0,s.createElement)(p.Button,{icon:pm,label:(0,h.__)("Next pattern"),onClick:n,disabled:o===r-1}))},ik=e=>{let{viewMode:t,setViewMode:n,handlePrevious:o,handleNext:r,activeSlide:l,totalSlides:i,onBlockPatternSelect:a}=e;const c=t===nk,u=(0,s.createElement)("div",{className:"block-editor-block-pattern-setup__display-controls"},(0,s.createElement)(p.Button,{icon:$r,label:(0,h.__)("Carousel view"),onClick:()=>n(nk),isPressed:c}),(0,s.createElement)(p.Button,{icon:tk,label:(0,h.__)("Grid view"),onClick:()=>n(ok),isPressed:t===ok}));return(0,s.createElement)("div",{className:"block-editor-block-pattern-setup__toolbar"},c&&(0,s.createElement)(lk,{handlePrevious:o,handleNext:r,activeSlide:l,totalSlides:i}),u,c&&(0,s.createElement)(rk,{onBlockPatternSelect:a}))},sk=e=>{let{viewMode:t,activeSlide:n,patterns:o,onBlockPatternSelect:r,height:l}=e;const a=(0,p.__unstableUseCompositeState)(),c="block-editor-block-pattern-setup__container";if(t===nk){const e=new Map([[n,"active-slide"],[n-1,"previous-slide"],[n+1,"next-slide"]]);return(0,s.createElement)("div",{className:"block-editor-block-pattern-setup__carousel",style:{height:l}},(0,s.createElement)("div",{className:c},(0,s.createElement)("ul",{className:"carousel-container"},o.map(((t,n)=>(0,s.createElement)(ck,{className:e.get(n)||"",key:t.name,pattern:t,minHeight:l}))))))}return(0,s.createElement)("div",{style:{height:l},className:"block-editor-block-pattern-setup__grid"},(0,s.createElement)(p.__unstableComposite,i({},a,{role:"listbox",className:c,"aria-label":(0,h.__)("Patterns list")}),o.map((e=>(0,s.createElement)(ak,{key:e.name,pattern:e,onSelect:r,composite:a})))))};function ak(e){let{pattern:t,onSelect:n,composite:o}=e;const r="block-editor-block-pattern-setup-list",{blocks:l,description:a,viewportWidth:c=700}=t,u=(0,d.useInstanceId)(ak,`${r}__item-description`);return(0,s.createElement)("div",{className:`${r}__list-item`,"aria-label":t.title,"aria-describedby":t.description?u:void 0},(0,s.createElement)(p.__unstableCompositeItem,i({role:"option",as:"div"},o,{className:`${r}__item`,onClick:()=>n(l)}),(0,s.createElement)(Od,{blocks:l,viewportWidth:c})),!!a&&(0,s.createElement)(p.VisuallyHidden,{id:u},a))}function ck(e){let{className:t,pattern:n,minHeight:o}=e;const{blocks:r,title:l,description:i}=n,a=(0,d.useInstanceId)(ck,"block-editor-block-pattern-setup-list__item-description");return(0,s.createElement)("li",{className:`pattern-slide ${t}`,"aria-label":l,"aria-describedby":i?a:void 0},(0,s.createElement)(Od,{blocks:r,__experimentalMinHeight:o}),!!i&&(0,s.createElement)(p.VisuallyHidden,{id:a},i))}const uk=e=>{let{clientId:t,blockName:n,filterPatternsFn:o,onBlockPatternSelect:l}=e;const[i,a]=(0,s.useState)(nk),[c,u]=(0,s.useState)(0),{replaceBlock:p}=(0,m.useDispatch)(Jn),g=function(e,t,n){return(0,m.useSelect)((o=>{const{getBlockRootClientId:r,__experimentalGetPatternsByBlockTypes:l,__experimentalGetAllowedPatterns:i}=o(Jn),s=r(e);return n?i(s).filter(n):l(t,s)}),[e,t,n])}(t,n,o),[h,{height:f}]=(0,d.useResizeObserver)();if(null==g||!g.length)return null;const v=l||(e=>{const n=e.map((e=>(0,r.cloneBlock)(e)));p(t,n)});return(0,s.createElement)(s.Fragment,null,h,(0,s.createElement)("div",{className:`block-editor-block-pattern-setup view-mode-${i}`},(0,s.createElement)(sk,{viewMode:i,activeSlide:c,patterns:g,onBlockPatternSelect:v,height:f-120}),(0,s.createElement)(ik,{viewMode:i,setViewMode:a,activeSlide:c,totalSlides:g.length,handleNext:()=>{u((e=>e+1))},handlePrevious:()=>{u((e=>e-1))},onBlockPatternSelect:()=>{v(g[c].blocks)}})))};function dk(e){let{className:t,onSelectVariation:n,selectedValue:o,variations:r}=e;return(0,s.createElement)("fieldset",{className:t},(0,s.createElement)(p.VisuallyHidden,{as:"legend"},(0,h.__)("Transform to variation")),r.map((e=>(0,s.createElement)(p.Button,{key:e.name,icon:(0,s.createElement)(tu,{icon:e.icon,showColors:!0}),isPressed:o===e.name,label:o===e.name?e.title:(0,h.sprintf)(
84
  /* translators: %s: Name of the block variation */
85
- (0,h.__)("Transform to %s"),e.title),onClick:()=>n(e.name),"aria-label":e.title,showTooltip:!0}))))}function pk(e){let{className:t,onSelectVariation:n,selectedValue:o,variations:r}=e;const l=r.map((e=>{let{name:t,title:n,description:o}=e;return{value:t,label:n,info:o}}));return(0,s.createElement)(p.DropdownMenu,{className:t,label:(0,h.__)("Transform to variation"),text:(0,h.__)("Transform to variation"),popoverProps:{position:"bottom center",className:`${t}__popover`},icon:hm,toggleProps:{iconPosition:"right"}},(()=>(0,s.createElement)("div",{className:`${t}__container`},(0,s.createElement)(p.MenuGroup,null,(0,s.createElement)(p.MenuItemsChoice,{choices:l,value:o,onSelect:n})))))}const mk=function(e){let{blockClientId:t}=e;const{updateBlockAttributes:n}=(0,m.useDispatch)(Jn),{activeBlockVariation:o,variations:l}=(0,m.useSelect)((e=>{const{getActiveBlockVariation:n,getBlockVariations:o}=e(r.store),{getBlockName:l,getBlockAttributes:i}=e(Jn),s=t&&l(t);return{activeBlockVariation:n(s,i(t)),variations:s&&o(s,"transform")}}),[t]),i=null==o?void 0:o.name,a=(0,s.useMemo)((()=>{const e=new Set;return!!l&&(l.forEach((t=>{var n;t.icon&&e.add((null===(n=t.icon)||void 0===n?void 0:n.src)||t.icon)})),e.size===l.length)}),[l]);if(null==l||!l.length)return null;const c=a?dk:pk;return(0,s.createElement)(c,{className:"block-editor-block-variation-transforms",onSelectVariation:e=>{n(t,{...l.find((t=>{let{name:n}=t;return n===e})).attributes})},selectedValue:i,variations:l})},gk=(0,d.createHigherOrderComponent)((e=>t=>{const n=Bo("color.palette"),o=!Bo("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"),hk=gk(p.ColorPalette);function fk(e){let{onChange:t,value:n,...o}=e;return(0,s.createElement)(Kh,i({},o,{onColorChange:t,colorValue:n,gradients:[],disableCustomGradients:!0}))}const vk=window.wp.date,bk=new Date(2022,0,25);function kk(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,h.__)("Date format")),(0,s.createElement)(p.ToggleControl,{label:(0,s.createElement)(s.Fragment,null,(0,h.__)("Default format"),(0,s.createElement)("span",{className:"block-editor-date-format-picker__default-format-toggle-control__hint"},(0,vk.dateI18n)(n,bk))),checked:!t,onChange:e=>o(e?null:n)}),t&&(0,s.createElement)(_k,{format:t,onChange:o}))}function _k(e){var t;let{format:n,onChange:o}=e;const r=(0,u.uniq)(["Y-m-d",(0,h._x)("n/j/Y","short date format"),(0,h._x)("n/j/Y g:i A","short date format with time"),(0,h._x)("M j, Y","medium date format"),(0,h._x)("M j, Y g:i A","medium date format with time"),(0,h._x)("F j, Y","long date format")]),l=r.map(((e,t)=>({key:`suggested-${t}`,name:(0,vk.dateI18n)(e,bk),format:e}))),i={key:"custom",name:(0,h.__)("Custom"),className:"block-editor-date-format-picker__custom-format-select-control__custom-option",__experimentalHint:(0,h.__)("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,h.__)("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,h.__)("Custom format"),hideLabelFromVision:!0,help:(0,s.createInterpolateElement)((0,h.__)("Enter a date or time <Link>format string</Link>."),{Link:(0,s.createElement)(p.ExternalLink,{href:(0,h.__)("https://wordpress.org/support/article/formatting-date-and-time/")})}),value:n,onChange:e=>o(e)}))}const yk=["colors","disableCustomColors","gradients","disableCustomGradients"],Ek=e=>{let{className:t,colors:n,gradients:o,disableCustomColors:r,disableCustomGradients:l,children:i,settings:a,title:g,showTitle:h=!0,__experimentalHasMultipleOrigins:f,__experimentalIsRenderedInSidebar:v,enableAlpha:b}=e;const k=(0,d.useInstanceId)(Ek),{batch:_}=(0,m.useRegistry)();return(0,u.isEmpty)(n)&&(0,u.isEmpty)(o)&&r&&l&&(0,u.every)(a,(e=>(0,u.isEmpty)(e.colors)&&(0,u.isEmpty)(e.gradients)&&(void 0===e.disableCustomColors||e.disableCustomColors)&&(void 0===e.disableCustomGradients||e.disableCustomGradients)))?null:(0,s.createElement)(p.__experimentalToolsPanel,{className:c()("block-editor-panel-color-gradient-settings",t),label:h?g:void 0,resetAll:()=>{_((()=>{a.forEach((e=>{let{colorValue:t,gradientValue:n,onColorChange:o,onGradientChange:r}=e;t?o():n&&r()}))}))},panelId:k,__experimentalFirstVisibleItemClass:"first",__experimentalLastVisibleItemClass:"last"},(0,s.createElement)(Qh,{settings:a,panelId:k,colors:n,gradients:o,disableCustomColors:r,disableCustomGradients:l,__experimentalHasMultipleOrigins:f,__experimentalIsRenderedInSidebar:v,enableAlpha:b}),!!i&&(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.__experimentalSpacer,{marginY:4})," ",i))},Ck=e=>{const t=wh();return t.colors=Bo("color.palette"),t.gradients=Bo("color.gradients"),(0,s.createElement)(Ek,i({},t,e))},Sk=e=>{const t=Bh();return(0,s.createElement)(Ek,i({},t,e))},wk=e=>(0,u.every)(yk,(t=>e.hasOwnProperty(t)))?(0,s.createElement)(Ek,e):e.__experimentalHasMultipleOrigins?(0,s.createElement)(Sk,e):(0,s.createElement)(Ck,e);var Bk=function(e,t){return(Bk=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)},Ik=function(){return(Ik=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 xk(e,t,n,o){void 0===o&&(o=0);var r=zk(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 Tk(e,t,n,o,r){void 0===r&&(r=0);var l=zk(t.width,t.height,r),i=l.width,s=l.height;return{x:Nk(e.x,i,n.width,o),y:Nk(e.y,s,n.height,o)}}function Nk(e,t,n,o){var r=t*o/2-n/2;return Math.min(r,Math.max(e,-r))}function Pk(e,t){return Math.sqrt(Math.pow(e.y-t.y,2)+Math.pow(e.x-t.x,2))}function Lk(e,t){return 180*Math.atan2(t.y-e.y,t.x-e.x)/Math.PI}function Rk(e,t,n,o,r,l,i){void 0===l&&(l=0),void 0===i&&(i=!0);var s=i&&0===l?Mk:Ak,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:Ik(Ik({},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 Mk(e,t){return Math.min(e,Math.max(0,t))}function Ak(e,t){return t}function Dk(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 Ok(e,t){return{x:(t.x+e.x)/2,y:(t.y+e.y)/2}}function Fk(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 zk(e,t,n){var o=e/2,r=t/2,l=[Fk(0,0,o,r,n),Fk(e,0,o,r,n),Fk(e,t,o,r,n),Fk(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 Vk(){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()}const Hk=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=Dk(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:xk(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=Ik({},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?Tk(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?Tk(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=Rk(n.props.restrictPosition?Tk(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?Tk(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}Bk(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=Pk(n,o),this.lastPinchRotation=Lk(n,o),this.onDragStart(Ok(n,o))},t.prototype.onPinchMove=function(e){var n=this,o=t.getTouchPoint(e.touches[0]),r=t.getTouchPoint(e.touches[1]),l=Ok(o,r);this.onDrag(l),this.rafPinchTimeout&&window.cancelAnimationFrame(this.rafPinchTimeout),this.rafPinchTimeout=window.requestAnimationFrame((function(){var e=Pk(o,r),t=n.props.zoom*(e/n.lastPinchDistance);n.setNewZoom(t,l),n.lastPinchDistance=e;var i=Lk(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,g=p.cropAreaStyle,h=p.mediaStyle,f=t.classes,v=f.containerClassName,b=f.cropAreaClassName,k=f.mediaClassName;return ii().createElement("div",{onMouseDown:this.onMouseDown,onTouchStart:this.onTouchStart,ref:function(t){return e.containerRef=t},"data-testid":"container",style:m,className:Vk("reactEasyCrop_Container",v)},n?ii().createElement("img",Ik({alt:"",className:Vk("reactEasyCrop_Image",k)},r,{src:n,ref:function(t){return e.imageRef=t},style:Ik(Ik({},h),{transform:"translate("+i+"px, "+s+"px) rotate("+a+"deg) scale("+c+")"}),onLoad:this.onMediaLoad})):o&&ii().createElement("video",Ik({autoPlay:!0,loop:!0,muted:!0,className:Vk("reactEasyCrop_Video",k)},r,{src:o,ref:function(t){return e.videoRef=t},onLoadedMetadata:this.onMediaLoad,style:Ik(Ik({},h),{transform:"translate("+i+"px, "+s+"px) rotate("+a+"deg) scale("+c+")"}),controls:!1})),this.state.cropSize&&ii().createElement("div",{style:Ik(Ik({},g),{width:this.state.cropSize.width,height:this.state.cropSize.height}),"data-testid":"cropper",className:Vk("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}(ii().Component),Gk={position:"bottom right",isAlternate:!0};const Uk=(0,s.createContext)({}),Wk=()=>(0,s.useContext)(Uk);function $k(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)(),[g,h]=(0,s.useState)(),[f,v]=(0,s.useState)(),[b,k]=(0,s.useState)(),_=(0,s.useCallback)((()=>{d({x:0,y:0}),m(100),h(0),v(n/o),k(n/o)}),[n,o,d,m,h,v,k]),y=(0,s.useCallback)((()=>{const e=(g+90)%360;let r=n/o;if(g%180==90&&(r=o/n),0===e)return i(),h(e),v(1/f),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)),h(e),v(1/f),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)}),[g,n,o,i,h,v,d]);return(0,s.useMemo)((()=>({editedUrl:r,setEditedUrl:i,crop:a,setCrop:c,position:u,setPosition:d,zoom:p,setZoom:m,rotation:g,setRotation:h,rotateClockwise:y,aspect:f,setAspect:v,defaultAspect:b,initializeTransformValues:_})),[r,i,a,c,u,d,p,m,g,h,y,f,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)(np.store),[p,g]=(0,s.useState)(!1),f=(0,s.useCallback)((()=>{g(!1),u()}),[g,u]),v=(0,s.useCallback)((()=>{g(!0);let e={};(t.width<99.9||t.height<99.9)&&(e=t),n>0&&(e.rotation=n),e.src=i,ub()({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,h.sprintf)(
86
  /* translators: 1. Error message */
87
- (0,h.__)("Could not edit image. %s"),(0,yl.__unstableStripHTML)(e.message)),{id:"image-editing-error",type:"snackbar"})})).finally((()=>{g(!1),u()}))}),[g,t,n,o,r,l,i,c,d,g,u]);return(0,s.useMemo)((()=>({isInProgress:p,apply:v,cancel:f})),[p,v,f])}({id:t,url:n,onSaveImage:c,onFinishEditing:a,...d}),g=(0,s.useMemo)((()=>({...d,...p})),[d,p]);return(0,s.createElement)(Uk.Provider,{value:g},u)}function jk(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:g,setPosition:h,setCrop:f,setZoom:v,rotation:b}=Wk();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)(Hk,{image:u||t,disabled:a,minZoom:1,maxZoom:3,crop:d,zoom:m/100,aspect:g,onCropChange:h,onCropComplete:e=>{f(e)},onZoomChange:e=>{v(100*e)}}),a&&(0,s.createElement)(p.Spinner,null))}const Kk=(0,s.createElement)(A.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(A.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 qk(){const{isInProgress:e,zoom:t,setZoom:n}=Wk();return(0,s.createElement)(p.Dropdown,{contentClassName:"wp-block-image__zoom",popoverProps:Gk,renderToggle:t=>{let{isOpen:n,onToggle:o}=t;return(0,s.createElement)(p.ToolbarButton,{icon:Kk,label:(0,h.__)("Zoom"),onClick:o,"aria-expanded":n,disabled:e})},renderContent:()=>(0,s.createElement)(p.RangeControl,{label:(0,h.__)("Zoom"),min:100,max:300,value:Math.round(t),onChange:n})})}const Yk=(0,s.createElement)(A.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(A.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 Zk(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?Lm:void 0},t)})))}function Qk(e){let{toggleProps:t}=e;const{isInProgress:n,aspect:o,setAspect:r,defaultAspect:l}=Wk();return(0,s.createElement)(p.DropdownMenu,{icon:Yk,label:(0,h.__)("Aspect Ratio"),popoverProps:Gk,toggleProps:t,className:"wp-block-image__aspect-ratio"},(e=>{let{onClose:t}=e;return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(Zk,{isDisabled:n,onClick:e=>{r(e),t()},value:o,aspectRatios:[{title:(0,h.__)("Original"),aspect:l},{title:(0,h.__)("Square"),aspect:1}]}),(0,s.createElement)(Zk,{label:(0,h.__)("Landscape"),isDisabled:n,onClick:e=>{r(e),t()},value:o,aspectRatios:[{title:(0,h.__)("16:10"),aspect:1.6},{title:(0,h.__)("16:9"),aspect:16/9},{title:(0,h.__)("4:3"),aspect:4/3},{title:(0,h.__)("3:2"),aspect:1.5}]}),(0,s.createElement)(Zk,{label:(0,h.__)("Portrait"),isDisabled:n,onClick:e=>{r(e),t()},value:o,aspectRatios:[{title:(0,h.__)("10:16"),aspect:.625},{title:(0,h.__)("9:16"),aspect:9/16},{title:(0,h.__)("3:4"),aspect:3/4},{title:(0,h.__)("2:3"),aspect:2/3}]}))}))}const Xk=(0,s.createElement)(A.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(A.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 Jk(){const{isInProgress:e,rotateClockwise:t}=Wk();return(0,s.createElement)(p.ToolbarButton,{icon:Xk,label:(0,h.__)("Rotate"),onClick:t,disabled:e})}function e_(){const{isInProgress:e,apply:t,cancel:n}=Wk();return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.ToolbarButton,{onClick:t,disabled:e},(0,h.__)("Apply")),(0,s.createElement)(p.ToolbarButton,{onClick:n},(0,h.__)("Cancel")))}function t_(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)(jk,{url:t,width:n,height:o,clientWidth:r,naturalHeight:l,naturalWidth:i}),(0,s.createElement)(co,null,(0,s.createElement)(p.ToolbarGroup,null,(0,s.createElement)(qk,null),(0,s.createElement)(p.ToolbarItem,null,(e=>(0,s.createElement)(Qk,{toggleProps:e}))),(0,s.createElement)(Jk,null)),(0,s.createElement)(p.ToolbarGroup,null,(0,s.createElement)(e_,null))))}const n_=[25,50,75,100],o_=()=>{};function r_(e){let{imageWidth:t,imageHeight:n,imageSizeOptions:o=[],isResizable:r=!0,slug:l,width:i,height:a,onChange:c,onChangeImage:d=o_}=e;const{currentHeight:m,currentWidth:g,updateDimension:f,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,h.__)("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,h.__)("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,h.__)("Width"),value:g,min:1,onChange:e=>f("width",e)}),(0,s.createElement)(p.TextControl,{type:"number",className:"block-editor-image-size-control__height",label:(0,h.__)("Height"),value:m,min:1,onChange:e=>f("height",e)})),(0,s.createElement)("div",{className:"block-editor-image-size-control__row"},(0,s.createElement)(p.ButtonGroup,{"aria-label":(0,h.__)("Image size presets")},n_.map((e=>{const o=Math.round(t*(e/100)),r=Math.round(n*(e/100)),l=g===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,h.__)("Reset")))))}const l_=(0,s.createElement)(A.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"-2 -2 24 24"},(0,s.createElement)(A.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"})),i_=()=>{},s_=e=>{let{value:t,onChange:n=i_,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,h.__)("Currently selected link settings")),l)};var a_=n(5425),c_=n.n(a_);function u_(e){return"function"==typeof e}class d_ 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,c_()(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,Np.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,h.sprintf)(
88
  /* translators: %s: number of results. */
89
- (0,h._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,h.__)("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 Vc.UP:0!==e.target.selectionStart&&(e.preventDefault(),e.target.setSelectionRange(0,0));break;case Vc.DOWN:this.props.value.length!==e.target.selectionStart&&(e.preventDefault(),e.target.setSelectionRange(this.props.value.length,this.props.value.length));break;case Vc.ENTER:e.preventDefault(),this.props.onSubmit&&this.props.onSubmit(null,e)}return}const l=this.state.suggestions[this.state.selectedSuggestion];switch(e.keyCode){case Vc.UP:{e.preventDefault();const t=n?n-1:o.length-1;this.setState({selectedSuggestion:t});break}case Vc.DOWN:{e.preventDefault();const t=null===n||n===o.length-1?0:n+1;this.setState({selectedSuggestion:t});break}case Vc.TAB:null!==this.state.selectedSuggestion&&(this.selectLink(l),this.props.speak((0,h.__)("Link selected.")));break;case Vc.ENTER:e.preventDefault(),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=null,className:t,isFullWidth:n,instanceId:o,placeholder:r=(0,h.__)("Paste URL or type to search"),__experimentalRenderControl:l,value:i=""}=this.props,{loading:a,showSuggestions:u,selectedSuggestion:d,suggestionsListboxId:m,suggestionOptionIdPrefix:g}=this.state,f=`url-input-control-${o}`,v={id:f,label:e,className:c()("block-editor-url-input",t,{"is-full-width":n})},b={id:f,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":e?void 0:(0,h.__)("URL"),"aria-expanded":u,"aria-autocomplete":"list","aria-owns":m,"aria-activedescendant":null!==d?`${g}-${d}`:void 0,ref:this.inputRef};return l?l(v,b,a):(0,s.createElement)(p.BaseControl,v,(0,s.createElement)("input",b),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:u,suggestionOptionIdPrefix:d,loading:m}=this.state,g={id:u,ref:this.autocompleteRef,role:"listbox"},h=(e,t)=>({role:"option",tabIndex:"-1",id:`${d}-${t}`,ref:this.bindSuggestionNode(t),"aria-selected":t===a});return u_(t)&&r&&l.length?t({suggestions:l,selectedSuggestion:a,suggestionsListProps:g,buildSuggestionItemProps:h,isLoading:m,handleSuggestionClick:this.handleOnClick,isInitialSuggestions:o&&!(n&&n.length)}):!u_(t)&&r&&l.length?(0,s.createElement)(p.Popover,{position:"bottom",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}}const p_=(0,d.compose)(d.withSafeTimeout,p.withSpokenMessages,d.withInstanceId,(0,m.withSelect)(((e,t)=>{if(u_(t.__experimentalFetchLinkSuggestions))return;const{getSettings:n}=e(Jn);return{__experimentalFetchLinkSuggestions:n().__experimentalFetchLinkSuggestions}})))(d_),m_=e=>{let t,{searchTerm:n,onClick:o,itemProps:r,isSelected:l,buttonText:a}=e;return n?(t=a?"function"==typeof a?a(n):a:(0,s.createInterpolateElement)((0,h.sprintf)(
90
  /* translators: %s: search term. */
91
- (0,h.__)("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)(Tr,{className:"block-editor-link-control__search-item-icon",icon:Qc}),(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},g_=(0,s.createElement)(A.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(A.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"})),h_=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)(Tr,{className:"block-editor-link-control__search-item-icon",icon:g_}),(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,Np.filterURLForDisplay)((0,Np.safeDecodeURI)(n.url))||""),l&&(0,h.__)("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)))},f_="__CREATE__",v_="mailto",b_="internal",k_=["URL",v_,"tel",b_],y_=[{id:"opensInNewTab",title:(0,h.__)("Open in new tab")}];function E_(e){let{instanceId:t,withCreateSuggestion:n,currentInputValue:o,handleSuggestionClick:r,suggestionsListProps:l,buildSuggestionItemProps:a,suggestions:u,selectedSuggestion:d,isLoading:m,isInitialSuggestions:g,createSuggestionButtonText:f,suggestionsQuery:v}=e;const b=c()("block-editor-link-control__search-results",{"is-loading":m}),k=1===u.length&&k_.includes(u[0].type),_=n&&!k&&!g,y=!(null!=v&&v.type),E=`block-editor-link-control-search-results-label-${t}`,C=g?(0,h.__)("Recently updated"):(0,h.sprintf)(
92
  /* translators: %s: search term. */
93
- (0,h.__)('Search results for "%s"'),o),S=(0,s.createElement)(g?s.Fragment:p.VisuallyHidden,{},(0,s.createElement)("span",{className:"block-editor-link-control__search-results-label",id:E},C));return(0,s.createElement)("div",{className:"block-editor-link-control__search-results-wrapper"},S,(0,s.createElement)("div",i({},l,{className:b,"aria-labelledby":E}),u.map(((e,t)=>_&&f_===e.type?(0,s.createElement)(m_,{searchTerm:o,buttonText:f,onClick:()=>r(e),key:e.type,itemProps:a(e,t),isSelected:t===d}):f_===e.type?null:(0,s.createElement)(h_,{key:`${e.id}-${e.type}`,itemProps:a(e,t),suggestion:e,index:t,onClick:()=>{r(e)},isSelected:t===d,isURL:k_.includes(e.type),searchTerm:o,shouldShowType:y,isFrontPage:null==e?void 0:e.isFrontPage})))))}function C_(e){const t=(0,u.startsWith)(e,"#");return(0,Np.isURL)(e)||e&&e.includes("www.")||t}const S_=()=>Promise.resolve([]),w_=e=>{let t="URL";const n=(0,Np.getProtocol)(e)||"";return n.includes("mailto")&&(t=v_),n.includes("tel")&&(t="tel"),(0,u.startsWith)(e,"#")&&(t=b_),Promise.resolve([{id:e,title:e,url:"URL"===t?(0,Np.prependHTTP)(e):e,type:t}])};const B_=()=>Promise.resolve([]),I_=()=>{},x_=(0,s.forwardRef)(((e,t)=>{let{value:n,children:o,currentLink:r={},className:l=null,placeholder:i=null,withCreateSuggestion:a=!1,onCreateSuggestion:p=I_,onChange:g=I_,onSelect:f=I_,showSuggestions:v=!0,renderSuggestions:b=(e=>(0,s.createElement)(E_,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(Jn);return{pageOnFront:t().pageOnFront,fetchSearchSuggestions:t().__experimentalFetchLinkSuggestions}}),[]),i=t?w_:S_;return(0,s.useCallback)(((t,s)=>{let{isInitialSuggestions:a}=s;return C_(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||C_(e)||!r?c:c.concat({title:e,url:e,type:f_})})(t,{...e,isInitialSuggestions:a},r,i,n,o,l)}),[i,r,n])}(E,_,a,C),I=v?k||B:B_,x=(0,d.useInstanceId)(x_),[T,N]=(0,s.useState)(),P=async e=>{let t=e;if(f_!==e.type)(_||t&&Object.keys(t).length>=1)&&f({...(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&&f(t)}catch(e){}},L=c()(l,{"has-no-label":!w});return(0,s.createElement)("div",{className:"block-editor-link-control__search-input-container"},(0,s.createElement)(p_,{label:w?"URL":void 0,className:L,value:n,onChange:(e,t)=>{g(e),N(t)},placeholder:null!=i?i:(0,h.__)("Search or type url"),__experimentalRenderSuggestions:v?e=>b({...e,instanceId:x,withCreateSuggestion:a,currentInputValue:n,createSuggestionButtonText:S,suggestionsQuery:E,handleSuggestionClick:t=>{e.handleSuggestionClick&&e.handleSuggestionClick(t),P(t)}}):null,__experimentalFetchLinkSuggestions:I,__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?P(r||{url:n}):t.preventDefault()},ref:t}),o)})),T_=x_,N_=(0,s.createElement)(A.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(A.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"})),P_=(0,s.createElement)(A.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(A.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"})),{Slot:L_,Fill:R_}=(0,p.createSlotFill)("BlockEditorLinkControlViewer");function M_(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 A_(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)(M_,{richData:null,isFetching:!1}),{fetchRichUrlData:o}=(0,m.useSelect)((e=>{const{getSettings:t}=e(Jn);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),g=u&&Object.keys(u).length,f=n&&(0,Np.filterURLForDisplay)((0,Np.safeDecodeURI)(n.url),16)||"",v=(null==u?void 0:u.title)||(null==n?void 0:n.title)||f,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)(Tr,{icon:N_,size:32}):(0,s.createElement)(Tr,{icon:g_}),(0,s.createElement)("div",{"aria-label":(0,h.__)("Currently selected"),"aria-selected":"true",className:c()("block-editor-link-control__search-item",{"is-current":!0,"is-rich":g,"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,h.__)("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,yl.__unstableStripHTML)(v)),(null==n?void 0:n.url)&&(0,s.createElement)("span",{className:"block-editor-link-control__search-item-info"},f)))),(0,s.createElement)(p.Button,{icon:P_,label:(0,h.__)("Edit"),className:"block-editor-link-control__search-item-action",onClick:o,iconSize:24}),l&&(0,s.createElement)(p.Button,{icon:fh,label:(0,h.__)("Unlink"),className:"block-editor-link-control__search-item-action block-editor-link-control__unlink",onClick:i,iconSize:24}),(0,s.createElement)(L_,{fillProps:n})),(g&&((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))))}const D_=()=>{};function O_(e){var t,n,o;let{searchInputPlaceholder:r,value:l,settings:i=y_,onChange:a=D_,onRemove:u,noDirectEntry:d=!1,showSuggestions:m=!0,showInitialSuggestions:g,forceIsEditingLink:f,createSuggestion:v,withCreateSuggestion:b,inputValue:k="",suggestionsQuery:_={},noURLSuggestion:y=!1,createSuggestionButtonText:E,hasRichPreviews:C=!1,hasTextControl:S=!1,renderControlBottom:w=null}=e;void 0===b&&v&&(b=!0);const B=(0,s.useRef)(!0),I=(0,s.useRef)(),x=(0,s.useRef)(),[T,N]=(0,s.useState)((null==l?void 0:l.url)||""),[P,L]=(0,s.useState)((null==l?void 0:l.title)||""),R=k||T,[M,A]=(0,s.useState)(void 0!==f?f:!l||!l.url),D=(0,s.useRef)(!1),O=!(null!=R&&null!==(t=R.trim())&&void 0!==t&&t.length),{createPage:F,isCreatingPage:z,errorMessage:V}=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,h.__)("An unknown error occurred during creation. Please try again.")),e}finally{o(!1)}},isCreatingPage:n,errorMessage:r}}(v);function H(){var e;D.current=!(null===(e=I.current)||void 0===e||!e.contains(I.current.ownerDocument.activeElement)),A(!1)}(0,s.useEffect)((()=>{void 0!==f&&f!==M&&A(f)}),[f]),(0,s.useEffect)((()=>{if(B.current)return void(B.current=!1);const e=null!=x&&x.current?1:0;(yl.focus.focusable.find(I.current)[e]||I.current).focus(),D.current=!1}),[M,z]),(0,s.useEffect)((()=>{null!=l&&l.title&&l.title!==P&&L(l.title),null!=l&&l.url&&N(l.url)}),[l]);const G=()=>{R===(null==l?void 0:l.url)&&P===(null==l?void 0:l.title)||a({url:R,title:P}),H()},U=u&&l&&!M&&!z,W=!(null==i||!i.length),$=(null==l||null===(n=l.url)||void 0===n||null===(o=n.trim())||void 0===o?void 0:o.length)>0&&S;return(0,s.createElement)("div",{tabIndex:-1,ref:I,className:"block-editor-link-control"},z&&(0,s.createElement)("div",{className:"block-editor-link-control__loading"},(0,s.createElement)(p.Spinner,null)," ",(0,h.__)("Creating"),"…"),(M||!l)&&!z&&(0,s.createElement)(s.Fragment,null,(0,s.createElement)("div",{className:c()({"block-editor-link-control__search-input-wrapper":!0,"has-text-control":$})},$&&(0,s.createElement)(p.TextControl,{ref:x,className:"block-editor-link-control__field block-editor-link-control__text-content",label:"Text",value:P,onChange:L,onKeyDown:e=>{const{keyCode:t}=e;t!==Vc.ENTER||O||(e.preventDefault(),G())}}),(0,s.createElement)(T_,{currentLink:l,className:"block-editor-link-control__field block-editor-link-control__search-input",placeholder:r,value:R,withCreateSuggestion:b,onCreateSuggestion:F,onChange:N,onSelect:e=>{a({...e,title:P||(null==e?void 0:e.title)}),H()},showInitialSuggestions:g,allowDirectEntry:!d,showSuggestions:m,suggestionsQuery:_,withURLSuggestion:!y,createSuggestionButtonText:E,useLabel:$},(0,s.createElement)("div",{className:"block-editor-link-control__search-actions"},(0,s.createElement)(p.Button,{onClick:G,label:(0,h.__)("Submit"),icon:l_,className:"block-editor-link-control__search-submit",disabled:O})))),V&&(0,s.createElement)(p.Notice,{className:"block-editor-link-control__search-error",status:"error",isDismissible:!1},V)),l&&!M&&!z&&(0,s.createElement)(A_,{key:null==l?void 0:l.url,value:l,onEditClick:()=>A(!0),hasRichPreviews:C,hasUnlinkControl:U,onRemove:u}),W&&(0,s.createElement)("div",{className:"block-editor-link-control__tools"},(0,s.createElement)(s_,{value:l,settings:i,onChange:a})),w&&w())}O_.ViewerFill=R_;const F_=O_,z_=(0,s.createElement)(A.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(A.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"})),V_=(0,s.createElement)(A.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(A.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"})),H_=(0,s.createElement)(A.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(A.Path,{d:"M19 3H5c-.6 0-1 .4-1 1v7c0 .5.4 1 1 1h14c.5 0 1-.4 1-1V4c0-.6-.4-1-1-1zM5.5 10.5v-.4l1.8-1.3 1.3.8c.3.2.7.2.9-.1L11 8.1l2.4 2.4H5.5zm13 0h-2.9l-4-4c-.3-.3-.8-.3-1.1 0L8.9 8l-1.2-.8c-.3-.2-.6-.2-.9 0l-1.3 1V4.5h13v6zM4 20h9v-1.5H4V20zm0-4h16v-1.5H4V16z"})),G_=(0,p.withFilters)("editor.MediaUpload")((()=>null)),U_=function(e){let{fallback:t=null,children:n}=e;return(0,m.useSelect)((e=>{const{getSettings:t}=e(Jn);return!!t().mediaUpload}),[])?n:t},W_=()=>{};let $_=0;const j_=(0,d.compose)([(0,m.withDispatch)((e=>{const{createNotice:t,removeNotice:n}=e(np.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,onToggleFeaturedImage:u,useFeaturedImage:d,onFilesUpload:g=W_,name:f=(0,h.__)("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(Jn).getSettings().mediaUpload),[]),B=(0,s.useRef)(),I="block-editor/media-replace-flow/error-notice/"+ ++$_,x=e=>{const t=(0,yl.__unstableStripHTML)(e);i?i(t):setTimeout((()=>{v("error",t,{speak:!0,id:I,isDismissible:!0})}),1e3)},T=(e,t)=>{d&&u&&u(),t(),S(null==e?void 0:e.url),a(e),(0,Ht.speak)((0,h.__)("The media file has been replaced")),b(I)},N=e=>{e.keyCode===Vc.DOWN&&(e.preventDefault(),e.target.click())},P=_&&!(!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:N},f)},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)(s.Fragment,null,(0,s.createElement)(G_,{gallery:P,addToGallery:y,multiple:_,value:_?o:n,onSelect:e=>T(e,t),allowedTypes:r,render:e=>{let{open:t}=e;return(0,s.createElement)(p.MenuItem,{icon:z_,onClick:t},(0,h.__)("Open Media Library"))}}),(0,s.createElement)(U_,null,(0,s.createElement)(p.FormFileUpload,{onChange:e=>{((e,t)=>{const n=e.target.files;if(!E)return t(),a(n);g(n),w({allowedTypes:r,filesList:n,onFileChange:e=>{let[n]=e;T(n,t)},onError:x})})(e,t)},accept:l,multiple:_,render:e=>{let{openFileDialog:t}=e;return(0,s.createElement)(p.MenuItem,{icon:V_,onClick:()=>{t()}},(0,h.__)("Upload"))}}))),u&&(0,s.createElement)(p.MenuItem,{icon:H_,onClick:u,isPressed:d},(0,h.__)("Use featured image")),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,h.__)("Current media URL:")),(0,s.createElement)(p.Tooltip,{text:C,position:"bottom"},(0,s.createElement)("div",null,(0,s.createElement)(F_,{value:{url:C},settings:[],showSuggestions:!1,onChange:e=>{let{url:t}=e;S(t),c(t),B.current.focus()}})))))}})}));function K_(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,Np.filterURLForDisplay)((0,Np.safeDecodeURI)(t))):(0,s.createElement)("span",{className:r})}function q_(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:hm,label:(0,h.__)("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))}q_.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)(p_,{value:r,onChange:o,autocompleteRef:t}),(0,s.createElement)(p.Button,{icon:l_,label:(0,h.__)("Apply"),type:"submit"}))},q_.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)(K_,{url:r,urlLabel:l,className:n}),o&&(0,s.createElement)(p.Button,{icon:P_,label:(0,h.__)("Edit"),onClick:o}))};const Y_=q_,Z_=()=>{},Q_=e=>{let{src:t,onChange:n,onSubmit:o,onClose:r}=e;return(0,s.createElement)(Y_,{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,h.__)("URL"),placeholder:(0,h.__)("Paste or type URL"),onChange:n,value:t}),(0,s.createElement)(p.Button,{className:"block-editor-media-placeholder__url-input-submit-button",icon:l_,label:(0,h.__)("Apply"),type:"submit"})))},X_=(0,p.withFilters)("editor.MediaPlaceholder")((function(e){let{value:t={},allowedTypes:n,className:o,icon:r,labels:l={},mediaPreview:i,notices:a,isAppender:u,accept:d,addToGallery:g,multiple:f=!1,handleUpload:v=!0,disableDropZone:b,disableMediaButtons:k,onError:_,onSelect:y,onCancel:E,onSelectURL:C,onDoubleClick:S,onFilesPreUpload:w=Z_,onHTMLDrop:B=Z_,children:I,mediaLibraryButton:x,placeholder:T,style:N}=e;const P=(0,m.useSelect)((e=>{const{getSettings:t}=e(Jn);return t().mediaUpload}),[]),[L,R]=(0,s.useState)(""),[M,A]=(0,s.useState)(!1);(0,s.useEffect)((()=>{var e;R(null!==(e=null==t?void 0:t.src)&&void 0!==e?e:"")}),[null==t?void 0:t.src]);const D=e=>{R(e.target.value)},O=()=>{A(!0)},F=()=>{A(!1)},z=e=>{e.preventDefault(),L&&C&&(C(L),F())},V=e=>{if(!v)return y(e);let o;if(w(e),f)if(g){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)}))));y(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=y;else o=e=>{let[t]=e;return y(t)};P({allowedTypes:n,filesList:e,onFileChange:o,onError:_})},H=e=>{V(e.target.files)},G=null!=T?T:e=>{let{instructions:t,title:d}=l;if(P||C||(t=(0,h.__)("To edit this block, you need permission to upload media.")),void 0===t||void 0===d){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&&P&&(t=(0,h.__)("Upload a media file or pick one from your media library."),l?t=(0,h.__)("Upload an audio file, pick one from your media library, or add one with a URL."):i?t=(0,h.__)("Upload an image file, pick one from your media library, or add one with a URL."):s&&(t=(0,h.__)("Upload a video file, pick one from your media library, or add one with a URL."))),void 0===d&&(d=(0,h.__)("Media"),l?d=(0,h.__)("Audio"):i?d=(0,h.__)("Image"):s&&(d=(0,h.__)("Video")))}const m=c()("block-editor-media-placeholder",o,{"is-appender":u});return(0,s.createElement)(p.Placeholder,{icon:r,label:d,instructions:t,className:m,notices:a,onDoubleClick:S,preview:i,style:N},e,I)},U=()=>b?null:(0,s.createElement)(p.DropZone,{onFilesDrop:V,onHTMLDrop:B}),W=()=>E&&(0,s.createElement)(p.Button,{className:"block-editor-media-placeholder__cancel-button",title:(0,h.__)("Cancel"),variant:"link",onClick:E},(0,h.__)("Cancel")),$=()=>C&&(0,s.createElement)("div",{className:"block-editor-media-placeholder__url-input-container"},(0,s.createElement)(p.Button,{className:"block-editor-media-placeholder__button",onClick:O,isPressed:M,variant:"tertiary"},(0,h.__)("Insert from URL")),M&&(0,s.createElement)(Q_,{src:L,onChange:D,onSubmit:z,onClose:F}));return k?(0,s.createElement)(U_,null,U()):(0,s.createElement)(U_,{fallback:G($())},(()=>{const e=null!=x?x:e=>{let{open:t}=e;return(0,s.createElement)(p.Button,{variant:"tertiary",onClick:()=>{t()}},(0,h.__)("Media Library"))},o=(0,s.createElement)(G_,{addToGallery:g,gallery:f&&!(!n||0===n.length)&&n.every((e=>"image"===e||e.startsWith("image/"))),multiple:f,onSelect:y,allowedTypes:n,mode:"browse",value:Array.isArray(t)?t.map((e=>{let{id:t}=e;return t})):t.id,render:e});if(P&&u)return(0,s.createElement)(s.Fragment,null,U(),(0,s.createElement)(p.FormFileUpload,{onChange:H,accept:d,multiple:f,render:e=>{let{openFileDialog:t}=e;const n=(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.Button,{variant:"primary",className:c()("block-editor-media-placeholder__button","block-editor-media-placeholder__upload-button"),onClick:t},(0,h.__)("Upload")),o,$(),W());return G(n)}}));if(P){const e=(0,s.createElement)(s.Fragment,null,U(),(0,s.createElement)(p.FormFileUpload,{variant:"primary",className:c()("block-editor-media-placeholder__button","block-editor-media-placeholder__upload-button"),onChange:H,accept:d,multiple:f},(0,h.__)("Upload")),o,$(),W());return G(e)}return G(o)})())})),J_=e=>{let{colorSettings:t,...n}=e;const o=t.map((e=>{if(!e)return e;const{value:t,onChange:n,...o}=e;return{...o,colorValue:t,onColorChange:n}}));return(0,s.createElement)(wk,i({settings:o,gradients:[],disableCustomGradients:!0},n))},ey={position:"bottom right",isAlternate:!0},ty=()=>(0,s.createElement)(s.Fragment,null,["bold","italic","link"].map((e=>(0,s.createElement)(p.Slot,{name:`RichText.ToolbarControls.${e}`,key:e}))),(0,s.createElement)(p.Slot,{name:"RichText.ToolbarControls"},(e=>{if(!e.length)return null;const t=e.map((e=>{let[{props:t}]=e;return t})).some((e=>{let{isActive:t}=e;return t}));return(0,s.createElement)(p.ToolbarItem,null,(n=>(0,s.createElement)(p.DropdownMenu,{icon:hm
94
- /* translators: button label text should, if possible, be under 16 characters. */,label:(0,h.__)("More"),toggleProps:{...n,className:c()(n.className,{"is-pressed":t}),describedBy:(0,h.__)("Displays more block tools")},controls:(0,u.orderBy)(e.map((e=>{let[{props:t}]=e;return t})),"title"),popoverProps:ey})))}))),ny=e=>{let{inline:t,anchorRef:n}=e;return t?(0,s.createElement)(p.Popover,{position:"top center",focusOnMount:!1,anchorRef:n,className:"block-editor-rich-text__inline-format-toolbar",__unstableSlotName:"block-toolbar"},(0,s.createElement)("div",{className:"block-editor-rich-text__inline-format-toolbar-group"},(0,s.createElement)(p.ToolbarGroup,null,(0,s.createElement)(ty,null)))):(0,s.createElement)(co,{group:"inline"},(0,s.createElement)(ty,null))};function oy(){const{didAutomaticChange:e,getSettings:t}=(0,m.useSelect)(Jn);return(0,d.useRefEffect)((n=>{function o(n){const{keyCode:o}=n;n.defaultPrevented||o!==Vc.DELETE&&o!==Vc.BACKSPACE&&o!==Vc.ESCAPE||e()&&(n.preventDefault(),t().__experimentalUndo())}return n.addEventListener("keydown",o),()=>{n.removeEventListener("keydown",o)}}),[])}function ry(e){return e.filter((e=>{let{type:t}=e;return/^image\/(?:jpe?g|png|gif|webp)$/.test(t)})).map((e=>`<img src="${(0,Jm.createBlobURL)(e)}">`)).join("")}const ly=window.wp.shortcode;function iy(e,t){if(null!=t&&t.length){let n=e.formats.length;for(;n--;)e.formats[n]=[...t,...e.formats[n]||[]]}}function sy(e){if(!0===e||"p"===e||"li"===e)return!0===e?"p":e}function ay(e){let{allowedFormats:t,formattingControls:n,disableFormats:o}=e;return o?ay.EMPTY_ARRAY:t||n?t||(z()("wp.blockEditor.RichText formattingControls prop",{since:"5.4",alternative:"allowedFormats",version:"6.2"}),n.map((e=>`core/${e}`))):void 0}function cy(e){let{value:t,pastedBlocks:n=[],onReplace:o,onSplit:r,onSplitMiddle:l,multilineTag:i}=e;if(!o||!r)return;const{start:s=0,end:a=0}=t,c={...t,start:s,end:a},u=[],[d,p]=(0,O.split)(c),m=n.length>0;let g=-1;const h=(0,O.isEmpty)(d)&&!(0,O.isEmpty)(p);m&&(0,O.isEmpty)(d)||(u.push(r((0,O.toHTMLString)({value:d,multilineTag:i}),!h)),g+=1),m?(u.push(...n),g+=n.length):l&&u.push(l()),(m||l)&&(0,O.isEmpty)(p)||u.push(r((0,O.toHTMLString)({value:p,multilineTag:i}),h)),o(u,m?g:1,m?-1:0)}function uy(e,t){return t?(0,O.replace)(e,/\n+/g,O.__UNSTABLE_LINE_SEPARATOR):(0,O.replace)(e,new RegExp(O.__UNSTABLE_LINE_SEPARATOR,"g"),"\n")}function dy(e){const t=(0,s.useRef)(e);return t.current=e,(0,d.useRefEffect)((e=>{function n(e){const{isSelected:n,disableFormats:o,onChange:l,value:i,formatTypes:s,tagName:a,onReplace:c,onSplit:u,onSplitMiddle:d,__unstableEmbedURLOnPaste:p,multilineTag:m,preserveWhiteSpace:g,pastePlainText:h}=t.current;if(!n)return;const{clipboardData:f}=e;let v="",b="";try{v=f.getData("text/plain"),b=f.getData("text/html")}catch(e){try{b=f.getData("Text")}catch(e){return}}if(b=function(e){const t="\x3c!--StartFragment--\x3e",n=e.indexOf(t);if(!(n>-1))return e;const o=(e=e.substring(n+t.length)).indexOf("\x3c!--EndFragment--\x3e");return o>-1&&(e=e.substring(0,o)),e}(b),b=function(e){const t="<meta charset='utf-8'>";return e.startsWith(t)?e.slice(t.length):e}(b),e.preventDefault(),window.console.log("Received HTML:\n\n",b),window.console.log("Received plain text:\n\n",v),o)return void l((0,O.insert)(i,v));const k=s.reduce(((e,t)=>{let{__unstablePasteRule:n}=t;return n&&e===i&&(e=n(i,{html:b,plainText:v})),e}),i);if(k!==i)return void l(k);const _=[...(0,yl.getFilesFromDataTransfer)(f)];if("true"===f.getData("rich-text")){const e=f.getData("rich-text-multi-line-tag")||void 0;let t=(0,O.create)({html:b,multilineTag:e,multilineWrapperTags:"li"===e?["ul","ol"]:void 0,preserveWhiteSpace:g});return t=uy(t,!!m),iy(t,i.activeFormats),void l((0,O.insert)(i,t))}if(h)return void l((0,O.insert)(i,(0,O.create)({text:v})));if(null!=_&&_.length&&!eg(_,b)){const e=(0,r.pasteHandler)({HTML:ry(_),mode:"BLOCKS",tagName:a,preserveWhiteSpace:g});return window.console.log("Received items:\n\n",_),void(c&&(0,O.isEmpty)(i)?c(e):cy({value:i,pastedBlocks:e,onReplace:c,onSplit:u,onSplitMiddle:d,multilineTag:m}))}let y=c&&u?"AUTO":"INLINE";var E;"AUTO"===y&&(0,O.isEmpty)(i)&&(E=v,(0,ly.regexp)(".*").test(E))&&(y="BLOCKS"),p&&(0,O.isEmpty)(i)&&(0,Np.isURL)(v.trim())&&(y="BLOCKS");const C=(0,r.pasteHandler)({HTML:b,plainText:v,mode:y,tagName:a,preserveWhiteSpace:g});if("string"==typeof C){let e=(0,O.create)({html:C});e=uy(e,!!m),iy(e,i.activeFormats),l((0,O.insert)(i,e))}else C.length>0&&(c&&(0,O.isEmpty)(i)?c(C,C.length-1,-1):cy({value:i,pastedBlocks:C,onReplace:c,onSplit:u,onSplitMiddle:d,multilineTag:m}))}return e.addEventListener("paste",n),()=>{e.removeEventListener("paste",n)}}),[])}function py(e){let t=e.length;for(;t--;){const n=Ut(e[t].attributes);if(n)return e[t].attributes[n]=e[t].attributes[n].replace(Gt,""),e[t].clientId;const o=py(e[t].innerBlocks);if(o)return o}}function my(e){const{__unstableMarkLastChangeAsPersistent:t,__unstableMarkAutomaticChange:n}=(0,m.useDispatch)(Jn),o=(0,s.useRef)(e);return o.current=e,(0,d.useRefEffect)((e=>{function l(){const{value:e,onReplace:t,selectionChange:l}=o.current;if(!t)return;const{start:i,text:s}=e;if(" "!==s.slice(i-1,i))return;const a=s.slice(0,i).trim(),c=(0,r.getBlockTransforms)("from").filter((e=>{let{type:t}=e;return"prefix"===t})),u=(0,r.findTransform)(c,(e=>{let{prefix:t}=e;return a===t}));if(!u)return;const d=(0,O.toHTMLString)({value:(0,O.insert)(e,Gt,0,i)}),p=u.transform(d);l(py([p])),t([p]),n()}function i(e){const{inputType:r,type:i}=e,{value:s,onChange:a,__unstableAllowPrefixTransformations:c,formatTypes:u}=o.current;if("insertText"!==r&&"compositionend"!==i)return;c&&l&&l();const d=u.reduce(((e,t)=>{let{__unstableInputRule:n}=t;return n&&(e=n(e)),e}),function(e){const t="tales of gutenberg",{start:n,text:o}=e;return n<t.length||o.slice(n-t.length,n).toLowerCase()!==t?e:(0,O.insert)(e," 🐡🐢🦀🐤🦋🐘🐧🐹🦁🦄🦍🐼🐿🎃🐴🐝🐆🦕🦔🌱🍇π🍌🐉💧🥨🌌🍂🍠🥦🥚🥝🎟🥥🥒🛵🥖🍒🍯🎾🎲🐺🐚🐮⌛️")}(s));d!==s&&(t(),a({...d,activeFormats:s.activeFormats}),n())}return e.addEventListener("input",i),e.addEventListener("compositionend",i),()=>{e.removeEventListener("input",i),e.removeEventListener("compositionend",i)}}),[])}function gy(e){const{__unstableMarkAutomaticChange:t}=(0,m.useDispatch)(Jn),n=(0,s.useRef)(e);return n.current=e,(0,d.useRefEffect)((e=>{function o(e){if(e.defaultPrevented)return;const{removeEditorOnlyFormats:o,value:l,onReplace:i,onSplit:s,onSplitMiddle:a,multilineTag:c,onChange:u,disableLineBreaks:d,onSplitAtEnd:p}=n.current;if(e.keyCode!==Vc.ENTER)return;e.preventDefault();const m={...l};m.formats=o(l);const g=i&&s;if(i){const e=(0,r.getBlockTransforms)("from").filter((e=>{let{type:t}=e;return"enter"===t})),n=(0,r.findTransform)(e,(e=>e.regExp.test(m.text)));n&&(i([n.transform({content:m.text})]),t())}if(c)e.shiftKey?d||u((0,O.insert)(m,"\n")):g&&(0,O.__unstableIsEmptyLine)(m)?cy({value:m,onReplace:i,onSplit:s,onSplitMiddle:a,multilineTag:c}):u((0,O.__unstableInsertLineSeparator)(m));else{const{text:t,start:n,end:o}=m,r=p&&n===o&&o===t.length;e.shiftKey||!g&&!r?d||u((0,O.insert)(m,"\n")):!g&&r?p():g&&cy({value:m,onReplace:i,onSplit:s,onSplitMiddle:a,multilineTag:c})}}return e.addEventListener("keydown",o),()=>{e.removeEventListener("keydown",o)}}),[])}function hy(e){return e(O.store).getFormatTypes()}ay.EMPTY_ARRAY=[];const fy=new Set(["a","audio","button","details","embed","iframe","input","label","select","textarea","video"]);function vy(e){return(0,d.useRefEffect)((t=>{function n(t){for(const n of e.current)n(t)}return t.addEventListener("keydown",n),()=>{t.removeEventListener("keydown",n)}}),[])}function by(e){return(0,d.useRefEffect)((t=>{function n(t){for(const n of e.current)n(t)}return t.addEventListener("input",n),()=>{t.removeEventListener("input",n)}}),[])}function ky(){const{isMultiSelecting:e}=(0,m.useSelect)(Jn);return(0,d.useRefEffect)((t=>{function n(){if(!e())return;const n=t.parentElement.closest('[contenteditable="true"]');n&&n.focus()}return t.addEventListener("focus",n),()=>{t.removeEventListener("focus",n)}}),[])}function _y(e){let{formatTypes:t,onChange:n,onFocus:o,value:r,forwardedRef:l}=e;return t.map((e=>{const{name:t,edit:i}=e;if(!i)return null;const a=(0,O.getActiveFormat)(r,t);let c=void 0!==a;const d=(0,O.getActiveObject)(r),p=void 0!==d&&d.type===t;if("core/link"===t&&!(0,O.isCollapsed)(r)){const e=r.formats,t=(0,u.find)(e[r.start],{type:"core/link"}),n=(0,u.find)(e[r.end-1],{type:"core/link"});t&&n&&t===n||(c=!1)}return(0,s.createElement)(i,{key:t,isActive:c,activeAttributes:c&&a.attributes||{},isObjectActive:p,activeObjectAttributes:p&&d.attributes||{},value:r,onChange:n,onFocus:o,contentRef:l})}))}const yy=(0,s.createContext)(),Ey=(0,s.createContext)(),Cy=(0,s.forwardRef)((function e(t,n){let{children:o,tagName:l="div",value:a="",onChange:g,isSelected:h,multiline:f,inlineToolbar:v,wrapperClassName:b,autocompleters:k,onReplace:_,placeholder:y,allowedFormats:E,formattingControls:C,withoutInteractiveFormatting:S,onRemove:w,onMerge:B,onSplit:I,__unstableOnSplitAtEnd:x,__unstableOnSplitMiddle:T,identifier:N,preserveWhiteSpace:P,__unstablePastePlainText:L,__unstableEmbedURLOnPaste:R,__unstableDisableFormats:M,disableLineBreaks:A,unstableOnFocus:D,__unstableAllowPrefixTransformations:F,...V}=t;const H=(0,d.useInstanceId)(e);N=N||H,V=function(e){return(0,u.omit)(e,["__unstableMobileNoFocusOnMount","deleteEnter","placeholderTextColor","textAlign","selectionColor","tagsToEliminate","rootTagsToEliminate","disableEditingMenu","fontSize","fontFamily","fontWeight","fontStyle","minWidth","maxWidth","setRef","disableSuggestions","disableAutocorrection"])}(V);const G=(0,s.useRef)(),{clientId:U}=oo(),{selectionStart:W,selectionEnd:$,isSelected:j}=(0,m.useSelect)((e=>{const{getSelectionStart:t,getSelectionEnd:n}=e(Jn),o=t(),r=n();let l;return void 0===h?l=o.clientId===U&&r.clientId===U&&o.attributeKey===N:h&&(l=o.clientId===U),{selectionStart:l?o.offset:void 0,selectionEnd:l?r.offset:void 0,isSelected:l}})),{selectionChange:K}=(0,m.useDispatch)(Jn),q=sy(f),Y=ay({allowedFormats:E,formattingControls:C,disableFormats:M}),Z=!Y||Y.length>0;let Q=a,X=g;Array.isArray(a)&&(Q=r.children.toHTML(a),X=e=>g(r.children.fromDOM((0,O.__unstableCreateElement)(document,e).childNodes)));const J=(0,s.useCallback)(((e,t)=>{const n={},o=void 0===e&&void 0===t;("number"==typeof e||o)&&(n.start={clientId:U,attributeKey:N,offset:e}),("number"==typeof t||o)&&(n.end={clientId:U,attributeKey:N,offset:t}),K(n)}),[U,N]),{formatTypes:ee,prepareHandlers:te,valueHandlers:ne,changeHandlers:oe,dependencies:re}=function(e){let{clientId:t,identifier:n,withoutInteractiveFormatting:o,allowedFormats:r}=e;const l=(0,m.useSelect)(hy,[]),i=(0,s.useMemo)((()=>l.filter((e=>{let{name:t,tagName:n}=e;return!(r&&!r.includes(t)||o&&fy.has(n))}))),[l,r,fy]),a=(0,m.useSelect)((e=>i.reduce(((o,r)=>(r.__experimentalGetPropsForEditableTreePreparation&&(o[r.name]=r.__experimentalGetPropsForEditableTreePreparation(e,{richTextIdentifier:n,blockClientId:t})),o)),{})),[i,t,n]),c=(0,m.useDispatch)(),u=[],d=[],p=[],g=[];return i.forEach((e=>{if(e.__experimentalCreatePrepareEditableTree){const o=a[e.name],r=e.__experimentalCreatePrepareEditableTree(o,{richTextIdentifier:n,blockClientId:t});e.__experimentalCreateOnChangeEditableValue?d.push(r):u.push(r);for(const e in o)g.push(o[e])}if(e.__experimentalCreateOnChangeEditableValue){let o={};e.__experimentalGetPropsForEditableTreeChangeHandler&&(o=e.__experimentalGetPropsForEditableTreeChangeHandler(c,{richTextIdentifier:n,blockClientId:t})),p.push(e.__experimentalCreateOnChangeEditableValue({...a[e.name]||{},...o},{richTextIdentifier:n,blockClientId:t}))}})),{formatTypes:i,prepareHandlers:u,valueHandlers:d,changeHandlers:p,dependencies:g}}({clientId:U,identifier:N,withoutInteractiveFormatting:S,allowedFormats:Y});function le(e){return ee.forEach((t=>{t.__experimentalCreatePrepareEditableTree&&(e=(0,O.removeFormat)(e,t.name,0,e.text.length))})),e.formats}const{value:ie,onChange:se,ref:ae}=(0,O.__unstableUseRichText)({value:Q,onChange(e,t){let{__unstableFormats:n,__unstableText:o}=t;X(e),Object.values(oe).forEach((e=>{e(n,o)}))},selectionStart:W,selectionEnd:$,onSelectionChange:J,placeholder:y,__unstableIsSelected:j,__unstableMultilineTag:q,__unstableDisableFormats:M,preserveWhiteSpace:P,__unstableDependencies:[...re,l],__unstableAfterParse:function(e){return ne.reduce(((t,n)=>n(t,e.text)),e.formats)},__unstableBeforeSerialize:le,__unstableAddInvisibleFormats:function(e){return te.reduce(((t,n)=>n(t,e.text)),e.formats)}}),ce=function(e){return(0,p.__unstableUseAutocompleteProps)({...e,completers:hb(e)})}({onReplace:_,completers:k,record:ie,onChange:se});!function(e){let{html:t,value:n}=e;const o=(0,s.useRef)(),r=n.activeFormats&&!!n.activeFormats.length,{__unstableMarkLastChangeAsPersistent:l}=(0,m.useDispatch)(Jn);(0,s.useLayoutEffect)((()=>{if(o.current){if(o.current!==n.text){const e=window.setTimeout((()=>{l()}),1e3);return o.current=n.text,()=>{window.clearTimeout(e)}}l()}else o.current=n.text}),[t,r])}({html:Q,value:ie});const ue=(0,s.useRef)(new Set),de=(0,s.useRef)(new Set);function pe(){G.current.focus()}const me=l,ge=(0,s.createElement)(s.Fragment,null,j&&(0,s.createElement)(yy.Provider,{value:ue},(0,s.createElement)(Ey.Provider,{value:de},(0,s.createElement)(p.Popover.__unstableSlotNameProvider,{value:"__unstable-block-tools-after"},o&&o({value:ie,onChange:se,onFocus:pe}),(0,s.createElement)(_y,{value:ie,onChange:se,onFocus:pe,formatTypes:ee,forwardedRef:G})))),j&&Z&&(0,s.createElement)(ny,{inline:v,anchorRef:G}),(0,s.createElement)(me,i({role:"textbox","aria-multiline":!A,"aria-label":y},V,ce,{ref:(0,d.useMergeRefs)([n,ce.ref,V.ref,ae,my({value:ie,onChange:se,__unstableAllowPrefixTransformations:F,formatTypes:ee,onReplace:_,selectionChange:K}),(0,d.useRefEffect)((e=>{function t(e){(Vc.isKeyboardEvent.primary(e,"z")||Vc.isKeyboardEvent.primary(e,"y")||Vc.isKeyboardEvent.primaryShift(e,"z"))&&e.preventDefault()}return e.addEventListener("keydown",t),()=>{e.addEventListener("keydown",t)}}),[]),vy(ue),by(de),oy(),dy({isSelected:j,disableFormats:M,onChange:se,value:ie,formatTypes:ee,tagName:l,onReplace:_,onSplit:I,onSplitMiddle:T,__unstableEmbedURLOnPaste:R,multilineTag:q,preserveWhiteSpace:P,pastePlainText:L}),gy({removeEditorOnlyFormats:le,value:ie,onReplace:_,onSplit:I,onSplitMiddle:T,multilineTag:q,onChange:se,disableLineBreaks:A,onSplitAtEnd:x}),ky(),G]),contentEditable:!0,suppressContentEditableWarning:!0,className:c()("block-editor-rich-text__editable",V.className,"rich-text"),onFocus:D,onKeyDown:function(e){const{keyCode:t}=e;if(!e.defaultPrevented&&(t===Vc.DELETE||t===Vc.BACKSPACE)){const{start:n,end:o,text:r}=ie,l=t===Vc.BACKSPACE,i=ie.activeFormats&&!!ie.activeFormats.length;if(!(0,O.isCollapsed)(ie)||i||l&&0!==n||!l&&o!==r.length)return;B&&B(!l),w&&(0,O.isEmpty)(ie)&&l&&w(!l),e.preventDefault()}}})));if(!b)return ge;z()("wp.blockEditor.RichText wrapperClassName prop",{since:"5.4",alternative:"className prop or create your own wrapper div",version:"6.2"});const he=c()("block-editor-rich-text",b);return(0,s.createElement)("div",{className:he},ge)}));Cy.Content=e=>{let{value:t,tagName:n,multiline:o,...l}=e;Array.isArray(t)&&(t=r.children.toHTML(t));const i=sy(o);!t&&i&&(t=`<${i}></${i}>`);const a=(0,s.createElement)(s.RawHTML,null,t);return n?(0,s.createElement)(n,(0,u.omit)(l,["format"]),a):a},Cy.isEmpty=e=>!e||0===e.length;const Sy=Cy,wy=(0,s.forwardRef)(((e,t)=>(0,s.createElement)(Sy,i({ref:t},e,{__unstableDisableFormats:!0,preserveWhiteSpace:!0}))));wy.Content=e=>{let{value:t="",tagName:n="div",...o}=e;return(0,s.createElement)(n,o,t)};const By=wy,Iy=(0,s.forwardRef)(((e,t)=>{let{__experimentalVersion:n,...o}=e;if(2===n)return(0,s.createElement)(By,i({ref:t},o));const{className:r,onChange:l,...a}=o;return(0,s.createElement)(zl.Z,i({ref:t,className:c()("block-editor-plain-text",r),onChange:e=>l(e.target.value)},a))}));function xy(e){let{property:t,viewport:n,desc:o}=e;const r=(0,d.useInstanceId)(xy),l=o||(0,h.sprintf)(
95
  /* translators: 1: property name. 2: viewport name. */
96
- (0,h._x)("Controls the %1$s property for %2$s viewports.","Text labelling a interface as controlling a given layout property (eg: margin) for a given screen size."),t,n.label);return(0,s.createElement)(s.Fragment,null,(0,s.createElement)("span",{"aria-describedby":`rbc-desc-${r}`},n.label),(0,s.createElement)(p.VisuallyHidden,{as:"span",id:`rbc-desc-${r}`},l))}const Ty=function(e){const{title:t,property:n,toggleLabel:o,onIsResponsiveChange:r,renderDefaultControl:l,renderResponsiveControls:i,isResponsive:a=!1,defaultLabel:u={id:"all",
97
  /* translators: 'Label. Used to signify a layout property (eg: margin, padding) will apply uniformly to all screensizes.' */
98
  label:(0,h.__)("All")},viewports:d=[{id:"small",label:(0,h.__)("Small screens")},{id:"medium",label:(0,h.__)("Medium screens")},{id:"large",label:(0,h.__)("Large screens")}]}=e;if(!t||!n||!l)return null;const m=o||(0,h.sprintf)(
99
  /* translators: 'Toggle control label. Should the property be the same across all screen sizes or unique per screen size.'. %s property value for the control (eg: margin, padding...etc) */
100
- (0,h.__)("Use the same %s on all screensizes."),n),g=(0,h.__)("Toggle between using the same value for all screen sizes or using a unique value per screen size."),f=l((0,s.createElement)(xy,{property:n,viewport:u}),u);
101
- /* translators: 'Help text for the responsive mode toggle control.' */return(0,s.createElement)("fieldset",{className:"block-editor-responsive-block-control"},(0,s.createElement)("legend",{className:"block-editor-responsive-block-control__title"},t),(0,s.createElement)("div",{className:"block-editor-responsive-block-control__inner"},(0,s.createElement)(p.ToggleControl,{className:"block-editor-responsive-block-control__toggle",label:m,checked:!a,onChange:r,help:g}),(0,s.createElement)("div",{className:c()("block-editor-responsive-block-control__group",{"is-responsive":a})},!a&&f,a&&(i?i(d):d.map((e=>(0,s.createElement)(s.Fragment,{key:e.id},l((0,s.createElement)(xy,{property:n,viewport:e}),e))))))))};function Ny(e){let{character:t,type:n,onUse:o}=e;const r=(0,s.useContext)(yy),l=(0,s.useRef)();return l.current=o,(0,s.useEffect)((()=>{function e(e){Vc.isKeyboardEvent[n](e,t)&&(l.current(),e.preventDefault())}return r.current.add(e),()=>{r.current.delete(e)}}),[t,n]),null}function Py(e){let t,{name:n,shortcutType:o,shortcutCharacter:r,...l}=e,a="RichText.ToolbarControls";return n&&(a+=`.${n}`),o&&r&&(t=Vc.displayShortcut[o](r)),(0,s.createElement)(p.Fill,{name:a},(0,s.createElement)(p.ToolbarButton,i({},l,{shortcut:t})))}function Ly(e){let{inputType:t,onInput:n}=e;const o=(0,s.useContext)(Ey),r=(0,s.useRef)();return r.current=n,(0,s.useEffect)((()=>{function e(e){e.inputType===t&&(r.current(),e.preventDefault())}return o.current.add(e),()=>{o.current.delete(e)}}),[t]),null}const Ry=(0,s.createElement)(p.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},(0,s.createElement)(p.Path,{d:"M9.4 20.5L5.2 3.8l14.6 9-2 .3c-.2 0-.4.1-.7.1-.9.2-1.6.3-2.2.5-.8.3-1.4.5-1.8.8-.4.3-.8.8-1.3 1.5-.4.5-.8 1.2-1.2 2l-.3.6-.9 1.9zM7.6 7.1l2.4 9.3c.2-.4.5-.8.7-1.1.6-.8 1.1-1.4 1.6-1.8.5-.4 1.3-.8 2.2-1.1l1.2-.3-8.1-5z"})),My=(0,s.forwardRef)((function(e,t){const n=(0,m.useSelect)((e=>e(Jn).isNavigationMode()),[]),{setNavigationMode:o}=(0,m.useDispatch)(Jn),r=e=>{o("edit"!==e)};return(0,s.createElement)(p.Dropdown,{renderToggle:o=>{let{isOpen:r,onToggle:l}=o;return(0,s.createElement)(p.Button,i({},e,{ref:t,icon:n?Ry:P_,"aria-expanded":r,"aria-haspopup":"true",onClick:l
102
- /* translators: button label text should, if possible, be under 16 characters. */,label:(0,h.__)("Tools")}))},position:"bottom right",renderContent:()=>(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.NavigableMenu,{role:"menu","aria-label":(0,h.__)("Tools")},(0,s.createElement)(p.MenuItemsChoice,{value:n?"select":"edit",onSelect:r,choices:[{value:"edit",label:(0,s.createElement)(s.Fragment,null,(0,s.createElement)(Tr,{icon:P_}),(0,h.__)("Edit"))},{value:"select",label:(0,s.createElement)(s.Fragment,null,Ry,(0,h.__)("Select"))}]})),(0,s.createElement)("div",{className:"block-editor-tool-selector__help"},(0,h.__)("Tools provide different interactions for selecting, navigating, and editing blocks. Toggle between select and edit by pressing Escape and Enter.")))})}));function Ay(e){let{units:t,...n}=e;const o=(0,p.__experimentalUseCustomUnits)({availableUnits:Bo("spacing.units")||["%","px","em","rem","vw"],units:t});return(0,s.createElement)(p.__experimentalUnitControl,i({units:o},n))}const Dy=(0,s.createElement)(A.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(A.Path,{d:"M20 10.8H6.7l4.1-4.5-1.1-1.1-5.8 6.3 5.8 5.8 1.1-1.1-4-3.9H20z"}));class Oy extends s.Component{constructor(){super(...arguments),this.toggle=this.toggle.bind(this),this.submitLink=this.submitLink.bind(this),this.state={expanded:!1}}toggle(){this.setState({expanded:!this.state.expanded})}submitLink(e){e.preventDefault(),this.toggle()}render(){const{url:e,onChange:t}=this.props,{expanded:n}=this.state,o=e?(0,h.__)("Edit link"):(0,h.__)("Insert link");return(0,s.createElement)("div",{className:"block-editor-url-input__button"},(0,s.createElement)(p.Button,{icon:hh,label:o,onClick:this.toggle,className:"components-toolbar__control",isPressed:!!e}),n&&(0,s.createElement)("form",{className:"block-editor-url-input__button-modal",onSubmit:this.submitLink},(0,s.createElement)("div",{className:"block-editor-url-input__button-modal-line"},(0,s.createElement)(p.Button,{className:"block-editor-url-input__back",icon:Dy,label:(0,h.__)("Close"),onClick:this.toggle}),(0,s.createElement)(p_,{value:e||"",onChange:t}),(0,s.createElement)(p.Button,{icon:l_,label:(0,h.__)("Submit"),type:"submit"}))))}}const Fy=Oy,zy=(0,s.createElement)(A.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(A.Path,{d:"M13 11.8l6.1-6.3-1-1-6.1 6.2-6.1-6.2-1 1 6.1 6.3-6.5 6.7 1 1 6.5-6.6 6.5 6.6 1-1z"})),Vy="none",Hy="custom",Gy="media",Uy="attachment",Wy=["noreferrer","noopener"],$y=(0,s.createElement)(p.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,s.createElement)(p.Path,{d:"M0,0h24v24H0V0z",fill:"none"}),(0,s.createElement)(p.Path,{d:"m19 5v14h-14v-14h14m0-2h-14c-1.1 0-2 0.9-2 2v14c0 1.1 0.9 2 2 2h14c1.1 0 2-0.9 2-2v-14c0-1.1-0.9-2-2-2z"}),(0,s.createElement)(p.Path,{d:"m14.14 11.86l-3 3.87-2.14-2.59-3 3.86h12l-3.86-5.14z"})),jy=e=>{let{linkDestination:t,onChangeUrl:n,url:o,mediaType:r="image",mediaUrl:l,mediaLink:i,linkTarget:a,linkClass:c,rel:d}=e;const[m,g]=(0,s.useState)(!1),f=(0,s.useCallback)((()=>{g(!0)})),[v,b]=(0,s.useState)(!1),[k,_]=(0,s.useState)(null),y=(0,s.useRef)(null),E=(0,s.useCallback)((()=>{t!==Gy&&t!==Uy||_(""),b(!0)})),C=(0,s.useCallback)((()=>{b(!1)})),S=(0,s.useCallback)((()=>{_(null),C(),g(!1)})),w=(0,s.useCallback)((()=>e=>{const t=y.current;t&&t.contains(e.target)||(g(!1),_(null),C())})),B=(0,s.useCallback)((()=>e=>{if(k){var t;const e=(null===(t=x().find((e=>e.url===k)))||void 0===t?void 0:t.linkDestination)||Hy;n({href:k,linkDestination:e})}C(),_(null),e.preventDefault()})),I=(0,s.useCallback)((()=>{n({linkDestination:Vy,href:""})})),x=()=>{const e=[{linkDestination:Gy,title:(0,h.__)("Media File"),url:"image"===r?l:void 0,icon:$y}];return"image"===r&&i&&e.push({linkDestination:Uy,title:(0,h.__)("Attachment Page"),url:"image"===r?i:void 0,icon:(0,s.createElement)(p.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,s.createElement)(p.Path,{d:"M0 0h24v24H0V0z",fill:"none"}),(0,s.createElement)(p.Path,{d:"M14 2H6c-1.1 0-1.99.9-1.99 2L4 20c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8l-6-6zM6 20V4h7v5h5v11H6z"}))}),e},T=(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.ToggleControl,{label:(0,h.__)("Open in new tab"),onChange:e=>{const t=(e=>{const t=e?"_blank":void 0;let n;if(t){const e=(null!=d?d:"").split(" ");Wy.forEach((t=>{e.includes(t)||e.push(t)})),n=e.join(" ")}else{const e=(null!=d?d:"").split(" ").filter((e=>!1===Wy.includes(e)));n=e.length?e.join(" "):void 0}return{linkTarget:t,rel:n}})(e);n(t)},checked:"_blank"===a}),(0,s.createElement)(p.TextControl,{label:(0,h.__)("Link Rel"),value:null!=d?d:"",onChange:e=>{n({rel:e})}}),(0,s.createElement)(p.TextControl,{label:(0,h.__)("Link CSS Class"),value:c||"",onChange:e=>{n({linkClass:e})}})),N=null!==k?k:o,P=((0,u.find)(x(),["linkDestination",t])||{}).title;return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.ToolbarButton,{icon:hh,className:"components-toolbar__control",label:o?(0,h.__)("Edit link"):(0,h.__)("Insert link"),"aria-expanded":m,onClick:f}),m&&(0,s.createElement)(Y_,{onFocusOutside:w(),onClose:S,renderSettings:()=>T,additionalControls:!N&&(0,s.createElement)(p.NavigableMenu,null,(0,u.map)(x(),(e=>(0,s.createElement)(p.MenuItem,{key:e.linkDestination,icon:e.icon,onClick:()=>{_(null),(e=>{const t=x();let o;o=e?((0,u.find)(t,(t=>t.url===e))||{linkDestination:Hy}).linkDestination:Vy,n({linkDestination:o,href:e})})(e.url),C()}},e.title))))},(!o||v)&&(0,s.createElement)(Y_.LinkEditor,{className:"block-editor-format-toolbar__link-container-content",value:N,onChangeInputValue:_,onSubmit:B(),autocompleteRef:y}),o&&!v&&(0,s.createElement)(s.Fragment,null,(0,s.createElement)(Y_.LinkViewer,{className:"block-editor-format-toolbar__link-container-content",url:o,onEditLinkClick:E,urlLabel:P}),(0,s.createElement)(p.Button,{icon:zy,label:(0,h.__)("Remove link"),onClick:I}))))};function Ky(e){let{children:t,className:n,isEnabled:o=!0,deviceType:r,setDeviceType:l}=e;if((0,d.useViewportMatch)("small","<"))return null;const i={className:c()(n,"block-editor-post-preview__dropdown-content"),position:"bottom left"},a={variant:"tertiary",className:"block-editor-post-preview__button-toggle",disabled:!o,
103
  /* translators: button label text should, if possible, be under 16 characters. */
104
- children:(0,h.__)("Preview")},u={"aria-label":(0,h.__)("Preview options")};return(0,s.createElement)(p.DropdownMenu,{className:"block-editor-post-preview__dropdown",popoverProps:i,toggleProps:a,menuProps:u,icon:null},(()=>(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.MenuGroup,null,(0,s.createElement)(p.MenuItem,{className:"block-editor-post-preview__button-resize",onClick:()=>l("Desktop"),icon:"Desktop"===r&&Lm},(0,h.__)("Desktop")),(0,s.createElement)(p.MenuItem,{className:"block-editor-post-preview__button-resize",onClick:()=>l("Tablet"),icon:"Tablet"===r&&Lm},(0,h.__)("Tablet")),(0,s.createElement)(p.MenuItem,{className:"block-editor-post-preview__button-resize",onClick:()=>l("Mobile"),icon:"Mobile"===r&&Lm},(0,h.__)("Mobile"))),t)))}function qy(e){const[t,n]=(0,s.useState)(window.innerWidth);(0,s.useEffect)((()=>{if("Desktop"===e)return;const t=()=>n(window.innerWidth);return window.addEventListener("resize",t),()=>{window.removeEventListener("resize",t)}}),[e]);const o=e=>{let n;switch(e){case"Tablet":n=780;break;case"Mobile":n=360;break;default:return null}return n<t?n:t};return(e=>{const t="Mobile"===e?"768px":"1024px";switch(e){case"Tablet":case"Mobile":return{width:o(e),margin:(window.innerHeight<800?36:72)+"px auto",height:t,borderRadius:"2px 2px 2px 2px",border:"1px solid #ddd",overflowY:"auto"};default:return null}})(e)}const Yy=(0,m.withSelect)((e=>({selectedBlockClientId:e(Jn).getBlockSelectionStart()})))((e=>{let{selectedBlockClientId:t}=e;const n=yo(t);return t?(0,s.createElement)(p.Button,{variant:"secondary",className:"block-editor-skip-to-selected-block",onClick:()=>{n.current.focus()}},(0,h.__)("Skip to the selected block")):null})),Zy=window.wp.wordcount,Qy=(0,m.withSelect)((e=>{const{getMultiSelectedBlocks:t}=e(Jn);return{blocks:t()}}))((function(e){let{blocks:t}=e;const n=(0,Zy.count)((0,r.serialize)(t),"words");return(0,s.createElement)("div",{className:"block-editor-multi-selection-inspector__card"},(0,s.createElement)(tu,{icon:Tm,showColors:!0}),(0,s.createElement)("div",{className:"block-editor-multi-selection-inspector__card-content"},(0,s.createElement)("div",{className:"block-editor-multi-selection-inspector__card-title"},(0,h.sprintf)(
105
  /* translators: %d: number of blocks */
106
  (0,h._n)("%d block","%d blocks",t.length),t.length)),(0,s.createElement)("div",{className:"block-editor-multi-selection-inspector__card-description"},(0,h.sprintf)(
107
  /* translators: %d: number of words */
108
- (0,h._n)("%d word","%d words",n),n))))}));function Xy(e){let{blockName:t}=e;const{preferredStyle:n,onUpdatePreferredStyleVariations:o,styles:l}=(0,m.useSelect)((e=>{var n,o;const l=e(Jn).getSettings().__experimentalPreferredStyleVariations;return{preferredStyle:null==l||null===(n=l.value)||void 0===n?void 0:n[t],onUpdatePreferredStyleVariations:null!==(o=null==l?void 0:l.onChange)&&void 0!==o?o:null,styles:e(r.store).getBlockStyles(t)}}),[t]),i=(0,s.useMemo)((()=>[{label:(0,h.__)("Not set"),value:""},...l.map((e=>{let{label:t,name:n}=e;return{label:t,value:n}}))]),[l]),a=(0,s.useMemo)((()=>{var e;return null===(e=Dm(l))||void 0===e?void 0:e.name}),[l]),c=(0,s.useCallback)((e=>{o(t,e)}),[t,o]);return n&&n!==a?o&&(0,s.createElement)("div",{className:"default-style-picker__default-switcher"},(0,s.createElement)(p.SelectControl,{options:i,value:n||"",label:(0,h.__)("Default Style"),onChange:c})):null}const Jy=e=>{let{clientId:t,blockName:n,hasBlockStyles:o}=e;const l=lm(t);return(0,s.createElement)("div",{className:"block-editor-block-inspector"},(0,s.createElement)(nu,l),(0,s.createElement)(mk,{blockClientId:t}),o&&(0,s.createElement)("div",null,(0,s.createElement)(p.PanelBody,{title:(0,h.__)("Styles")},(0,s.createElement)(Xb,{scope:"core/block-inspector",clientId:t}),(0,r.hasBlockSupport)(n,"defaultStylePicker",!0)&&(0,s.createElement)(Xy,{blockName:n}))),(0,s.createElement)(Fo.Slot,null),(0,s.createElement)(Fo.Slot,{__experimentalGroup:"color",label:(0,h.__)("Color"),className:"color-block-support-panel__inner-wrapper"}),(0,s.createElement)(Fo.Slot,{__experimentalGroup:"typography",label:(0,h.__)("Typography")}),(0,s.createElement)(Fo.Slot,{__experimentalGroup:"dimensions",label:(0,h.__)("Dimensions")}),(0,s.createElement)(Fo.Slot,{__experimentalGroup:"border",label:(0,h.__)("Border")}),(0,s.createElement)("div",null,(0,s.createElement)(eE,null)),(0,s.createElement)(Yy,{key:"back"}))},eE=()=>{const e=(0,p.__experimentalUseSlot)(Oo.slotName);return Boolean(e.fills&&e.fills.length)?(0,s.createElement)(p.PanelBody,{className:"block-editor-block-inspector__advanced",title:(0,h.__)("Advanced"),initialOpen:!1},(0,s.createElement)(Fo.Slot,{__experimentalGroup:"advanced"})):null},tE=e=>{let{showNoBlockSelectedMessage:t=!0}=e;const{count:n,hasBlockStyles:o,selectedBlockName:l,selectedBlockClientId:i,blockType:a}=(0,m.useSelect)((e=>{const{getSelectedBlockClientId:t,getSelectedBlockCount:n,getBlockName:o}=e(Jn),{getBlockStyles:l}=e(r.store),i=t(),s=i&&o(i),a=s&&(0,r.getBlockType)(s),c=s&&l(s);return{count:n(),selectedBlockClientId:i,selectedBlockName:s,blockType:a,hasBlockStyles:c&&c.length>0}}),[]);if(n>1)return(0,s.createElement)("div",{className:"block-editor-block-inspector"},(0,s.createElement)(Qy,null),(0,s.createElement)(Fo.Slot,null),(0,s.createElement)(Fo.Slot,{__experimentalGroup:"color",label:(0,h.__)("Color"),className:"color-block-support-panel__inner-wrapper"}),(0,s.createElement)(Fo.Slot,{__experimentalGroup:"typography",label:(0,h.__)("Typography")}),(0,s.createElement)(Fo.Slot,{__experimentalGroup:"dimensions",label:(0,h.__)("Dimensions")}),(0,s.createElement)(Fo.Slot,{__experimentalGroup:"border",label:(0,h.__)("Border")}));const c=l===(0,r.getUnregisteredTypeHandlerName)();return a&&i&&!c?(0,s.createElement)(Jy,{clientId:i,blockName:a.name,hasBlockStyles:o}):t?(0,s.createElement)("span",{className:"block-editor-block-inspector__no-blocks"},(0,h.__)("No block selected.")):null};function nE(e){let{children:t,__unstableContentRef:n,...o}=e;const r=(0,d.useViewportMatch)("medium"),l=(0,m.useSelect)((e=>e(Jn).getSettings().hasFixedToolbar),[]),a=(0,gu.__unstableUseShortcutEventMatch)(),{getSelectedBlockClientIds:c,getBlockRootClientId:g}=(0,m.useSelect)(Jn),{duplicateBlocks:h,removeBlocks:f,insertAfterBlock:v,insertBeforeBlock:b,clearSelectedBlock:k,moveBlocksUp:_,moveBlocksDown:y}=(0,m.useDispatch)(Jn);return(0,s.createElement)("div",i({},o,{onKeyDown:function(e){if(a("core/block-editor/move-up",e)){const t=c();if(t.length){e.preventDefault();const n=g((0,u.first)(t));_(t,n)}}else if(a("core/block-editor/move-down",e)){const t=c();if(t.length){e.preventDefault();const n=g((0,u.first)(t));y(t,n)}}else if(a("core/block-editor/duplicate",e)){const t=c();t.length&&(e.preventDefault(),h(t))}else if(a("core/block-editor/remove",e)){const t=c();t.length&&(e.preventDefault(),f(t))}else if(a("core/block-editor/insert-after",e)){const t=c();t.length&&(e.preventDefault(),v((0,u.last)(t)))}else if(a("core/block-editor/insert-before",e)){const t=c();t.length&&(e.preventDefault(),b((0,u.first)(t)))}else a("core/block-editor/unselect",e)&&c().length>1&&(e.preventDefault(),k(),e.target.ownerDocument.defaultView.getSelection().removeAllRanges())}}),(0,s.createElement)(tm,{__unstableContentRef:n},(l||!r)&&(0,s.createElement)(Dg,{isFixed:!0}),(0,s.createElement)(Vg,{__unstableContentRef:n}),(0,s.createElement)(p.Popover.Slot,{name:"block-toolbar",ref:Ho(n)}),t,(0,s.createElement)(p.Popover.Slot,{name:"__unstable-block-tools-after",ref:Ho(n)})))}const oE=()=>{},rE=(0,s.forwardRef)((function(e,t){let{rootClientId:n,clientId:o,isAppender:r,showInserterHelpPanel:l,showMostUsedBlocks:i=!1,__experimentalInsertionIndex:a,__experimentalFilterValue:c,onSelect:u=oE,shouldFocusBlock:d=!1}=e;const p=(0,m.useSelect)((e=>{const{getBlockRootClientId:t}=e(Jn);return n||t(o)||void 0}),[o,n]);return(0,s.createElement)(Gp,{onSelect:u,rootClientId:p,clientId:o,isAppender:r,showInserterHelpPanel:l,showMostUsedBlocks:i,__experimentalInsertionIndex:a,__experimentalFilterValue:c,shouldFocusBlock:d,ref:t})}));function lE(){return null}lE.Register=function(){const{registerShortcut:e}=(0,m.useDispatch)(gu.store);return(0,s.useEffect)((()=>{e({name:"core/block-editor/duplicate",category:"block",description:(0,h.__)("Duplicate the selected block(s)."),keyCombination:{modifier:"primaryShift",character:"d"}}),e({name:"core/block-editor/remove",category:"block",description:(0,h.__)("Remove the selected block(s)."),keyCombination:{modifier:"access",character:"z"}}),e({name:"core/block-editor/insert-before",category:"block",description:(0,h.__)("Insert a new block before the selected block(s)."),keyCombination:{modifier:"primaryAlt",character:"t"}}),e({name:"core/block-editor/insert-after",category:"block",description:(0,h.__)("Insert a new block after the selected block(s)."),keyCombination:{modifier:"primaryAlt",character:"y"}}),e({name:"core/block-editor/delete-multi-selection",category:"block",description:(0,h.__)("Delete selection."),keyCombination:{character:"del"},aliases:[{character:"backspace"}]}),e({name:"core/block-editor/select-all",category:"selection",description:(0,h.__)("Select all text when typing. Press again to select all blocks."),keyCombination:{modifier:"primary",character:"a"}}),e({name:"core/block-editor/unselect",category:"selection",description:(0,h.__)("Clear selection."),keyCombination:{character:"escape"}}),e({name:"core/block-editor/focus-toolbar",category:"global",description:(0,h.__)("Navigate to the nearest toolbar."),keyCombination:{modifier:"alt",character:"F10"}}),e({name:"core/block-editor/move-up",category:"block",description:(0,h.__)("Move the selected block(s) up."),keyCombination:{modifier:"secondary",character:"t"}}),e({name:"core/block-editor/move-down",category:"block",description:(0,h.__)("Move the selected block(s) down."),keyCombination:{modifier:"secondary",character:"y"}})}),[e]),null};const iE=lE;function sE(){return z()("wp.blockEditor.MultiSelectScrollIntoView",{hint:"This behaviour is now built-in.",since:"5.8"}),null}const aE=new Set([Vc.UP,Vc.RIGHT,Vc.DOWN,Vc.LEFT,Vc.ENTER,Vc.BACKSPACE]);function cE(){const e=(0,m.useSelect)((e=>e(Jn).isTyping()),[]),{stopTyping:t}=(0,m.useDispatch)(Jn);return(0,d.useRefEffect)((n=>{if(!e)return;const{ownerDocument:o}=n;let r,l;function i(e){const{clientX:n,clientY:o}=e;r&&l&&(r!==n||l!==o)&&t(),r=n,l=o}return o.addEventListener("mousemove",i),()=>{o.removeEventListener("mousemove",i)}}),[e,t])}function uE(){const e=(0,m.useSelect)((e=>e(Jn).isTyping())),{startTyping:t,stopTyping:n}=(0,m.useDispatch)(Jn),o=cE(),r=(0,d.useRefEffect)((o=>{const{ownerDocument:r}=o,{defaultView:l}=r;if(e){let e;function t(t){const{target:o}=t;e=l.setTimeout((()=>{(0,yl.isTextField)(o)||n()}))}function i(e){const{keyCode:t}=e;t!==Vc.ESCAPE&&t!==Vc.TAB||n()}function s(){const e=l.getSelection();e.rangeCount>0&&e.getRangeAt(0).collapsed||n()}return o.addEventListener("focus",t),o.addEventListener("keydown",i),r.addEventListener("selectionchange",s),()=>{l.clearTimeout(e),o.removeEventListener("focus",t),o.removeEventListener("keydown",i),r.removeEventListener("selectionchange",s)}}function i(e){const{type:n,target:r}=e;(0,yl.isTextField)(r)&&o.contains(r)&&("keydown"!==n||function(e){const{keyCode:t,shiftKey:n}=e;return!n&&aE.has(t)}(e))&&t()}return o.addEventListener("keypress",i),o.addEventListener("keydown",i),()=>{o.removeEventListener("keypress",i),o.removeEventListener("keydown",i)}}),[e,t,n]);return(0,d.useMergeRefs)([o,r])}const dE=function(e){let{children:t}=e;return(0,s.createElement)("div",{ref:uE()},t)},pE=-1!==window.navigator.userAgent.indexOf("Trident"),mE=new Set([Vc.UP,Vc.DOWN,Vc.LEFT,Vc.RIGHT]);function gE(){const e=(0,m.useSelect)((e=>e(Jn).hasSelectedBlock()),[]);return(0,d.useRefEffect)((t=>{if(!e)return;const{ownerDocument:n}=t,{defaultView:o}=n;let r,l,i;function s(){r||(r=o.requestAnimationFrame((()=>{p(),r=null})))}function a(e){l&&o.cancelAnimationFrame(l),l=o.requestAnimationFrame((()=>{c(e),l=null}))}function c(e){let{keyCode:r}=e;if(!m())return;const l=(0,yl.computeCaretRect)(o);if(!l)return;if(!i)return void(i=l);if(mE.has(r))return void(i=l);const s=l.top-i.top;if(0===s)return;const a=(0,yl.getScrollContainer)(t);if(!a)return;const c=a===n.body,u=c?o.scrollY:a.scrollTop,d=c?0:a.getBoundingClientRect().top,p=c?i.top/o.innerHeight:(i.top-d)/(o.innerHeight-d);if(0===u&&p<.75&&function(){const e=t.querySelectorAll('[contenteditable="true"]');return e[e.length-1]===n.activeElement}())return void(i=l);const g=c?o.innerHeight:a.clientHeight;i.top+i.height>d+g||i.top<d?i=l:c?o.scrollBy(0,s):a.scrollTop+=s}function u(){n.addEventListener("selectionchange",d)}function d(){n.removeEventListener("selectionchange",d),p()}function p(){m()&&(i=(0,yl.computeCaretRect)(o))}function m(){return t.contains(n.activeElement)&&n.activeElement.isContentEditable}return o.addEventListener("scroll",s,!0),o.addEventListener("resize",s,!0),t.addEventListener("keydown",a),t.addEventListener("keyup",c),t.addEventListener("mousedown",u),t.addEventListener("touchstart",u),()=>{o.removeEventListener("scroll",s,!0),o.removeEventListener("resize",s,!0),t.removeEventListener("keydown",a),t.removeEventListener("keyup",c),t.removeEventListener("mousedown",u),t.removeEventListener("touchstart",u),n.removeEventListener("selectionchange",d),o.cancelAnimationFrame(r),o.cancelAnimationFrame(l)}}),[e])}const hE=pE?e=>e.children:function(e){let{children:t}=e;return(0,s.createElement)("div",{ref:gE(),className:"block-editor__typewriter"},t)},fE=(0,s.createContext)({});function vE(e,t,n){const o={...e,[t]:e[t]?new Set(e[t]):new Set};return o[t].add(n),o}function bE(e){var t;let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";const o=(0,s.useContext)(fE),{name:r}=oo();n=n||r;const l=Boolean(null===(t=o[n])||void 0===t?void 0:t.has(e)),i=(0,s.useMemo)((()=>vE(o,n,e)),[o,n,e]),a=(0,s.useCallback)((e=>{let{children:t}=e;return(0,s.createElement)(fE.Provider,{value:i},t)}),[i]);return[l,a]}const kE=(0,s.createElement)(A.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(A.Path,{d:"M12 13.06l3.712 3.713 1.061-1.06L13.061 12l3.712-3.712-1.06-1.06L12 10.938 8.288 7.227l-1.061 1.06L10.939 12l-3.712 3.712 1.06 1.061L12 13.061z"}));function _E(e){let{title:t,help:n,actions:o=[],onClose:r}=e;return(0,s.createElement)(p.__experimentalVStack,{className:"block-editor-inspector-popover-header",spacing:4},(0,s.createElement)(p.__experimentalHStack,{alignment:"center"},(0,s.createElement)(p.__experimentalHeading,{className:"block-editor-inspector-popover-header__heading",level:2,size:13},t),(0,s.createElement)(p.__experimentalSpacer,null),o.map((e=>{let{label:t,icon:n,onClick:o}=e;return(0,s.createElement)(p.Button,{key:t,className:"block-editor-inspector-popover-header__action",label:t,icon:n,variant:!n&&"tertiary",onClick:o},!n&&t)})),r&&(0,s.createElement)(p.Button,{className:"block-editor-inspector-popover-header__action",label:(0,h.__)("Close"),icon:kE,onClick:r})),n&&(0,s.createElement)(p.__experimentalText,null,n))}const yE=(0,s.forwardRef)((function(e,t){let{onClose:n,onChange:o,...r}=e;return(0,s.createElement)("div",{ref:t,className:"block-editor-publish-date-time-picker"},(0,s.createElement)(_E,{title:(0,h.__)("Publish"),actions:[{label:(0,h.__)("Now"),onClick:()=>null==o?void 0:o(null)}],onClose:n}),(0,s.createElement)(p.DateTimePicker,i({startOfWeek:(0,vk.__experimentalGetSettings)().l10n.startOfWeek,__nextRemoveHelpButton:!0,__nextRemoveResetButton:!0,onChange:o},r)))})),EE={button:"wp-element-button",caption:"wp-element-caption"},CE=e=>EE[e]?EE[e]:"",SE=(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};function wE(e){const t=null==e?void 0:e.trim().match(/^(0?[-.]?\d*\.?\d+)(r?e[m|x]|v[h|w|min|max]+|p[x|t|c]|[c|m]m|%|in|ch|Q|lh)$/);return isNaN(e)||isNaN(parseFloat(e))?t?{value:parseFloat(t[1])||t[1],unit:t[2]}:{value:e,unit:void 0}:{value:parseFloat(e),unit:"px"}}function BE(e,t){const n=e.split(/[(),]/g).filter(Boolean),o=n.slice(1).map((e=>wE(PE(e,t)).value)).filter(Boolean);switch(n[0]){case"min":return Math.min(...o)+"px";case"max":return Math.max(...o)+"px";case"clamp":return 3!==o.length?null:o[1]<o[0]?o[0]+"px":o[1]>o[2]?o[2]+"px":o[1]+"px";case"calc":return o[0]+"px"}}function IE(e){for(;;){const t=e,n=/(max|min|calc|clamp)\(([^()]*)\)/g.exec(e)||[];if(n[0]){const t=BE(n[0]);e=e.replace(n[0],t)}if(e===t||parseFloat(e))break}return wE(e)}function xE(e){for(let t=0;t<e.length;t++)if(["+","-","/","*"].includes(e[t]))return!0;return!1}function TE(e){let t=!1;const n=e.split(/[+-/*/]/g).filter(Boolean);for(const o of n){const n=wE(PE(o));if(!parseFloat(n.value)){t=!0;break}e=e.replace(o,n.value)}return t?null:(o=e,Function(`'use strict'; return (${o})`)()).toFixed(0)+"px";var o}function NE(e,t){const n=.01,o=Object.assign({},{fontSize:16,lineHeight:16,width:375,height:812,type:"font"},t),r={em:o.fontSize,rem:o.fontSize,vh:o.height*n,vw:o.width*n,vmin:(o.width<o.height?o.width:o.height)*n,vmax:(o.width>o.height?o.width:o.height)*n,"%":("font"===o.type?o.fontSize:o.width)*n,ch:8,ex:7.15625,lh:o.lineHeight},l={in:96,cm:37.79527559055118,mm:3.7795275590551185,pt:1.3333333333333333,pc:16,px:1,Q:.9448818897637794};return r[e.unit]?(r[e.unit]*e.value).toFixed(0)+"px":l[e.unit]?(l[e.unit]*e.value).toFixed(0)+"px":null}function PE(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(Number.isFinite(e))return e.toFixed(0)+"px";if(void 0===e)return null;let n=wE(e);return n.unit||(n=IE(e)),xE(e)&&!n.unit?TE(e):NE(n,t)}const LE={};function RE(e){let t="";return e.hasOwnProperty("fontSize")&&(t=":"+e.width),e.hasOwnProperty("lineHeight")&&(t=":"+e.lineHeight),e.hasOwnProperty("width")&&(t=":"+e.width),e.hasOwnProperty("height")&&(t=":"+e.height),e.hasOwnProperty("type")&&(t=":"+e.type),t}const ME=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=e+RE(t);return LE[n]||(LE[n]=PE(e,t)),LE[n]}})(),(window.wp=window.wp||{}).blockEditor=o})();
1
+ (()=>{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:(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: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:(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 g(){for(var n=-1*u;n<=u;n+=2){var l=void 0,d=p[n-1],m=p[n+1],g=(m?m.newPos:0)-n;d&&(p[n-1]=void 0);var h=d&&d.newPos+1<a,f=m&&0<=g&&g<c;if(h||f){if(!h||f&&d.newPos<m.newPos?(l=r(m),i.pushComponent(l.components,void 0,!0)):((l=d).newPos++,i.pushComponent(l.components,!0,void 0)),g=i.extractCommon(l,t,e,n),l.newPos+1>=a&&g+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();g()||e()}),0)}();else for(;u<=d;){var h=g();if(h)return h}},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:(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:(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),g=o.offset(e),h=o.outerHeight(e),f=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:g.left-S.left-c,top:g.top-S.top-a},E={left:g.left+f-(S.left+w)+d,top:g.top+h-(S.top+B)+u},_=S):(v=o.offset(t),b=t.clientHeight,k=t.clientWidth,_={left:t.scrollLeft,top:t.scrollTop},y={left:g.left-(v.left+(parseFloat(o.css(t,"borderLeftWidth"))||0))-c,top:g.top-(v.top+(parseFloat(o.css(t,"borderTopWidth"))||0))-a},E={left:g.left+f-(v.left+k+(parseFloat(o.css(t,"borderRightWidth"))||0))+d,top:g.top+h-(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:(e,t,n)=>{"use strict";e.exports=n(1345)},5022: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 g(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 h(e){return null!=e&&e==e.window}var f={};function v(e,t,n){if(h(e))return"width"===t?f.viewportWidth(e):f.viewportHeight(e);if(9===e.nodeType)return"width"===t?f.docWidth(e):f.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-g(e,["border","padding"],o):i;if(s){var u=2===n?-g(e,["border"],o):g(e,["margin"],o);return a+(1===n?0:u)}return i+g(e,p.slice(n),o)}u(["Width","Height"],(function(e){f["doc"+e]=function(t){var n=t.document;return Math.max(n.documentElement["scroll"+e],n.body["scroll"+e],f["viewport"+e](n))},f["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);f["outer"+t]=function(t,n){return t&&k(t,e,n?0:1)};var n="width"===e?["Left","Right"]:["Top","Bottom"];f[e]=function(t,o){return void 0===o?t&&k(t,e,-1):t?(c(t),d(t)&&(o+=g(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:h,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(h(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(h(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},f)},8575: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:(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="&nbsp;","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:(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:(e,t,n)=>{e.exports=n(5372)()},9567: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:(e,t,n)=>{"use strict";var o=n(5438);t.Z=o.TextareaAutosize},3124: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={},g=!0,h={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){h.isRoot||(h.parent.node[h.key]=e),h.node=e,t&&(g=!1)},delete:function(e){delete h.parent.node[h.key],e&&(g=!1)},remove:function(e){s(h.parent.node)?h.parent.node.splice(h.key,1):delete h.parent.node[h.key],e&&(g=!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(){g=!1}};if(!u)return h;function f(){if("object"==typeof h.node&&null!==h.node){h.keys&&h.node_===h.node||(h.keys=l(h.node)),h.isLeaf=0==h.keys.length;for(var e=0;e<i.length;e++)if(i[e].node_===d){h.circular=i[e];break}}else h.isLeaf=!0,h.keys=null;h.notLeaf=!h.isLeaf,h.notRoot=!h.isRoot}f();var v=t.call(h,h.node);return void 0!==v&&h.update&&h.update(v),m.before&&m.before.call(h,h.node),g?("object"!=typeof h.node||null===h.node||h.circular||(i.push(h),f(),a(h.keys,(function(t,r){o.push(t),m.pre&&m.pre.call(h,h.node[t],t);var l=e(h.node[t]);n&&c.call(h.node,t)&&(h.node[t]=l.node),l.isLast=r==h.keys.length-1,l.isFirst=0==r,m.post&&m.post.call(h,l),o.pop()})),i.pop()),m.after&&m.after.call(h,h.node),h):h}(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: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=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(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=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var o={};(()=>{"use strict";n.r(o),n.d(o,{AlignmentControl:()=>gb,AlignmentToolbar:()=>hb,Autocomplete:()=>wb,BlockAlignmentControl:()=>el,BlockAlignmentToolbar:()=>tl,BlockBreadcrumb:()=>Pb,BlockColorsStyleSelector:()=>Db,BlockContextProvider:()=>xl,BlockControls:()=>po,BlockEdit:()=>Ll,BlockEditorKeyboardShortcuts:()=>hE,BlockEditorProvider:()=>du,BlockFormatControls:()=>uo,BlockIcon:()=>iu,BlockInspector:()=>uE,BlockList:()=>dh,BlockMover:()=>Bm,BlockNavigationDropdown:()=>nk,BlockPreview:()=>Gd,BlockSelectionClearer:()=>gu,BlockSettingsMenu:()=>Mg,BlockSettingsMenuControls:()=>Ig,BlockStyles:()=>sk,BlockTitle:()=>pm,BlockToolbar:()=>Hg,BlockTools:()=>dE,BlockVerticalAlignmentControl:()=>kr,BlockVerticalAlignmentToolbar:()=>_r,ButtonBlockAppender:()=>tm,ButtonBlockerAppender:()=>em,ColorPalette:()=>Sk,ColorPaletteControl:()=>wk,ContrastChecker:()=>af,CopyHandler:()=>ag,DefaultBlockAppender:()=>Xp,FontSizePicker:()=>qf,InnerBlocks:()=>sh,Inserter:()=>Qp,InspectorAdvancedControls:()=>Ho,InspectorControls:()=>Go,JustifyContentControl:()=>Cr,JustifyToolbar:()=>Sr,LineHeightControl:()=>Nf,MediaPlaceholder:()=>sy,MediaReplaceFlow:()=>ty,MediaUpload:()=>Q_,MediaUploadCheck:()=>X_,MultiSelectScrollIntoView:()=>fE,NavigableToolbar:()=>fm,ObserveTyping:()=>_E,PanelColorSettings:()=>ay,PlainText:()=>Dy,RichText:()=>My,RichTextShortcut:()=>zy,RichTextToolbarButton:()=>Vy,SETTINGS_DEFAULTS:()=>v,SkipToSelectedBlock:()=>rE,ToolSelector:()=>Uy,Typewriter:()=>SE,URLInput:()=>E_,URLInputButton:()=>Ky,URLPopover:()=>ry,Warning:()=>Rl,WritingFlow:()=>xu,__experimentalBlockAlignmentMatrixControl:()=>Tb,__experimentalBlockFullHeightAligmentControl:()=>Ib,__experimentalBlockPatternSetup:()=>kk,__experimentalBlockPatternsList:()=>dp,__experimentalBlockVariationPicker:()=>ck,__experimentalBlockVariationTransforms:()=>Ek,__experimentalBorderRadiusControl:()=>Bh,__experimentalColorGradientControl:()=>nf,__experimentalColorGradientSettingsDropdown:()=>sf,__experimentalDateFormatPicker:()=>xk,__experimentalDuotoneControl:()=>Dv,__experimentalFontAppearanceControl:()=>Tf,__experimentalFontFamilyControl:()=>Vf,__experimentalGetBorderClassesAndStyles:()=>qv,__experimentalGetColorClassesAndStyles:()=>Zv,__experimentalGetElementClassName:()=>LE,__experimentalGetGapCSSValue:()=>ur,__experimentalGetGradientClass:()=>$h,__experimentalGetGradientObjectByGradientValue:()=>Kh,__experimentalGetMatchingVariation:()=>ME,__experimentalGetSpacingClassesAndStyles:()=>Jv,__experimentalImageEditingProvider:()=>e_,__experimentalImageEditor:()=>u_,__experimentalImageSizeControl:()=>m_,__experimentalImageURLInputUI:()=>tE,__experimentalInspectorPopoverHeader:()=>TE,__experimentalLayoutStyle:()=>Ur,__experimentalLetterSpacingControl:()=>fv,__experimentalLibrary:()=>mE,__experimentalLinkControl:()=>K_,__experimentalLinkControlSearchInput:()=>F_,__experimentalLinkControlSearchItem:()=>w_,__experimentalLinkControlSearchResults:()=>P_,__experimentalListView:()=>ek,__experimentalPanelColorGradientSettings:()=>Rk,__experimentalPreviewOptions:()=>nE,__experimentalPublishDateTimePicker:()=>NE,__experimentalResponsiveBlockControl:()=>Fy,__experimentalTextDecorationControl:()=>rv,__experimentalTextTransformControl:()=>pv,__experimentalUnitControl:()=>Wy,__experimentalUseBlockOverlayActive:()=>Lb,__experimentalUseBlockPreview:()=>Ud,__experimentalUseBorderProps:()=>Yv,__experimentalUseColorProps:()=>Xv,__experimentalUseCustomSides:()=>ir,__experimentalUseGradient:()=>Yh,__experimentalUseMultipleOriginColorsAndGradients:()=>Lh,__experimentalUseNoRecursiveRenders:()=>IE,__experimentalUseResizeCanvas:()=>oE,__unstableBlockNameContext:()=>Vg,__unstableBlockSettingsMenuFirstItem:()=>hg,__unstableBlockToolbarLastItem:()=>ng,__unstableDuotoneFilter:()=>Od,__unstableDuotoneStylesheet:()=>Ad,__unstableDuotoneUnsetStylesheet:()=>Dd,__unstableEditorStyles:()=>Md,__unstableGetValuesFromColors:()=>Rd,__unstableIframe:()=>Pu,__unstableInserterMenuExtension:()=>Vp,__unstablePresetDuotoneFilter:()=>Fd,__unstableRichTextInputEvent:()=>Hy,__unstableUseBlockSelectionClearer:()=>mu,__unstableUseClipboardHandler:()=>sg,__unstableUseMouseMoveTypingReset:()=>bE,__unstableUseTypewriter:()=>CE,__unstableUseTypingObserver:()=>kE,createCustomColorsHOC:()=>rb,getColorClassName:()=>Nh,getColorObjectByAttributeValues:()=>xh,getColorObjectByColorValue:()=>Th,getFontSize:()=>$f,getFontSizeClass:()=>Kf,getFontSizeObjectByValue:()=>jf,getGradientSlugByValue:()=>qh,getGradientValueBySlug:()=>jh,getPxFromCssUnit:()=>UE,store:()=>to,storeConfig:()=>eo,transformStyles:()=>Nd,useBlockDisplayInformation:()=>um,useBlockEditContext:()=>lo,useBlockProps:()=>Yc,useCachedTruthy:()=>eb,useInnerBlocksProps:()=>ih,useSetting:()=>To,withColorContext:()=>Ck,withColors:()=>lb,withFontSizes:()=>sb});var e={};n.r(e),n.d(e,{__experimentalGetActiveBlockIdByBlockNames:()=>Ft,__experimentalGetAllowedBlocks:()=>bt,__experimentalGetAllowedPatterns:()=>Et,__experimentalGetBlockListSettingsForBlocks:()=>xt,__experimentalGetDirectInsertBlock:()=>kt,__experimentalGetGlobalBlocksByName:()=>ee,__experimentalGetLastBlockAttributeChanges:()=>Pt,__experimentalGetParsedPattern:()=>_t,__experimentalGetPatternTransformItems:()=>St,__experimentalGetPatternsByBlockTypes:()=>Ct,__experimentalGetReusableBlockTitle:()=>Tt,__unstableGetBlockWithoutInnerBlocks:()=>K,__unstableGetClientIdWithClientIdsTree:()=>Y,__unstableGetClientIdsTree:()=>Z,__unstableGetSelectedBlocksWithPartialSelection:()=>Me,__unstableGetVisibleBlocks:()=>Ht,__unstableIsFullySelected:()=>Ne,__unstableIsLastBlockChangeIgnored:()=>Nt,__unstableIsSelectionCollapsed:()=>Pe,__unstableIsSelectionMergeable:()=>Le,areInnerBlocksControlled:()=>Ot,canEditBlock:()=>at,canInsertBlockType:()=>nt,canInsertBlocks:()=>ot,canLockBlockType:()=>ct,canMoveBlock:()=>it,canMoveBlocks:()=>st,canRemoveBlock:()=>rt,canRemoveBlocks:()=>lt,didAutomaticChange:()=>At,getAdjacentBlockClientId:()=>fe,getBlock:()=>j,getBlockAttributes:()=>$,getBlockCount:()=>ne,getBlockHierarchyRootClientId:()=>ge,getBlockIndex:()=>Ae,getBlockInsertionPoint:()=>Ye,getBlockListSettings:()=>wt,getBlockMode:()=>Ge,getBlockName:()=>U,getBlockOrder:()=>Re,getBlockParents:()=>pe,getBlockParentsByBlockName:()=>me,getBlockRootClientId:()=>de,getBlockSelectionEnd:()=>ie,getBlockSelectionStart:()=>le,getBlockTransformItems:()=>ft,getBlocks:()=>q,getBlocksByClientId:()=>te,getClientIdsOfDescendants:()=>Q,getClientIdsWithDescendants:()=>X,getDraggedBlockClientIds:()=>$e,getFirstMultiSelectedBlockClientId:()=>Ce,getGlobalBlockCount:()=>J,getInserterItems:()=>ht,getLastMultiSelectedBlockClientId:()=>Se,getLowestCommonAncestorWithSelectedBlock:()=>he,getMultiSelectedBlockClientIds:()=>ye,getMultiSelectedBlocks:()=>Ee,getMultiSelectedBlocksEndClientId:()=>Te,getMultiSelectedBlocksStartClientId:()=>xe,getNextBlockClientId:()=>be,getPreviousBlockClientId:()=>ve,getSelectedBlock:()=>ue,getSelectedBlockClientId:()=>ce,getSelectedBlockClientIds:()=>_e,getSelectedBlockCount:()=>se,getSelectedBlocksInitialCaretPosition:()=>ke,getSelectionEnd:()=>re,getSelectionStart:()=>oe,getSettings:()=>Bt,getTemplate:()=>Xe,getTemplateLock:()=>Je,hasBlockMovingClientId:()=>Rt,hasInserterItems:()=>vt,hasMultiSelection:()=>ze,hasSelectedBlock:()=>ae,hasSelectedInnerBlock:()=>Oe,isAncestorBeingDragged:()=>Ke,isAncestorMultiSelected:()=>Ie,isBlockBeingDragged:()=>je,isBlockHighlighted:()=>Dt,isBlockInsertionPointVisible:()=>Ze,isBlockMultiSelected:()=>Be,isBlockSelected:()=>De,isBlockValid:()=>W,isBlockVisible:()=>Vt,isBlockWithinSelection:()=>Fe,isCaretWithinFormattedText:()=>qe,isDraggingBlocks:()=>We,isFirstMultiSelectedBlock:()=>we,isLastBlockChangePersistent:()=>It,isMultiSelecting:()=>Ve,isNavigationMode:()=>Mt,isSelectionEnabled:()=>He,isTyping:()=>Ue,isValidTemplate:()=>Qe,wasBlockJustInserted:()=>zt});var t={};n.r(t),n.d(t,{__unstableDeleteSelection:()=>En,__unstableExpandSelection:()=>Sn,__unstableMarkAutomaticChange:()=>Un,__unstableMarkLastChangeAsPersistent:()=>Hn,__unstableMarkNextChangeAsNotPersistent:()=>Gn,__unstableSaveReusableBlock:()=>Vn,__unstableSplitSelection:()=>Cn,clearSelectedBlock:()=>rn,duplicateBlocks:()=>jn,enterFormattedText:()=>Rn,exitFormattedText:()=>An,flashBlock:()=>Zn,hideInsertionPoint:()=>bn,insertAfterBlock:()=>qn,insertBeforeBlock:()=>Kn,insertBlock:()=>hn,insertBlocks:()=>fn,insertDefaultBlock:()=>On,mergeBlocks:()=>wn,moveBlockToPosition:()=>gn,moveBlocksDown:()=>dn,moveBlocksToPosition:()=>mn,moveBlocksUp:()=>pn,multiSelect:()=>on,receiveBlocks:()=>Yt,removeBlock:()=>In,removeBlocks:()=>Bn,replaceBlock:()=>cn,replaceBlocks:()=>an,replaceInnerBlocks:()=>xn,resetBlocks:()=>jt,resetSelection:()=>qt,selectBlock:()=>Xt,selectNextBlock:()=>en,selectPreviousBlock:()=>Jt,selectionChange:()=>Dn,setBlockMovingClientId:()=>$n,setBlockVisibility:()=>Xn,setHasControlledInnerBlocks:()=>Qn,setNavigationMode:()=>Wn,setTemplateValidity:()=>kn,showInsertionPoint:()=>vn,startDraggingBlocks:()=>Ln,startMultiSelect:()=>tn,startTyping:()=>Nn,stopDraggingBlocks:()=>Mn,stopMultiSelect:()=>nn,stopTyping:()=>Pn,synchronizeTemplate:()=>yn,toggleBlockHighlight:()=>Yn,toggleBlockMode:()=>Tn,toggleSelection:()=>ln,updateBlock:()=>Qt,updateBlockAttributes:()=>Zt,updateBlockListSettings:()=>Fn,updateSettings:()=>zn,validateBlocksToTemplate:()=>Kt});const 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}));const s=window.wp.element;var a=n(4403),c=n.n(a);const u=window.lodash,d=window.wp.compose,p=window.wp.components,m=window.wp.data,g={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")},h=window.wp.i18n,f={insertUsage:{}},v={alignWide:!1,supportsLayout:!0,colors:[{name:(0,h.__)("Black"),slug:"black",color:"#000000"},{name:(0,h.__)("Cyan bluish gray"),slug:"cyan-bluish-gray",color:"#abb8c3"},{name:(0,h.__)("White"),slug:"white",color:"#ffffff"},{name:(0,h.__)("Pale pink"),slug:"pale-pink",color:"#f78da7"},{name:(0,h.__)("Vivid red"),slug:"vivid-red",color:"#cf2e2e"},{name:(0,h.__)("Luminous vivid orange"),slug:"luminous-vivid-orange",color:"#ff6900"},{name:(0,h.__)("Luminous vivid amber"),slug:"luminous-vivid-amber",color:"#fcb900"},{name:(0,h.__)("Light green cyan"),slug:"light-green-cyan",color:"#7bdcb5"},{name:(0,h.__)("Vivid green cyan"),slug:"vivid-green-cyan",color:"#00d084"},{name:(0,h.__)("Pale cyan blue"),slug:"pale-cyan-blue",color:"#8ed1fc"},{name:(0,h.__)("Vivid cyan blue"),slug:"vivid-cyan-blue",color:"#0693e3"},{name:(0,h.__)("Vivid purple"),slug:"vivid-purple",color:"#9b51e0"}],fontSizes:[{name:(0,h._x)("Small","font size name"),size:13,slug:"small"},{name:(0,h._x)("Normal","font size name"),size:16,slug:"normal"},{name:(0,h._x)("Medium","font size name"),size:20,slug:"medium"},{name:(0,h._x)("Large","font size name"),size:36,slug:"large"},{name:(0,h._x)("Huge","font size name"),size:42,slug:"huge"}],imageDefaultSize:"large",imageSizes:[{slug:"thumbnail",name:(0,h.__)("Thumbnail")},{slug:"medium",name:(0,h.__)("Medium")},{slug:"large",name:(0,h.__)("Large")},{slug:"full",name:(0,h.__)("Full Size")}],imageEditing:!0,maxWidth:580,allowedBlockTypes:!0,maxUploadFileSize:0,allowedMimeTypes:null,canLockBlocks:!0,__experimentalCanUserUseUnfilteredHTML:!1,__experimentalBlockDirectory:!1,__mobileEnablePageTemplates:!1,__experimentalBlockPatterns:[],__experimentalBlockPatternCategories:[],__unstableGalleryWithImageBlocks:!1,generateAnchors:!1,gradients:[{name:(0,h.__)("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,h.__)("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,h.__)("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,h.__)("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,h.__)("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,h.__)("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,h.__)("Blush light purple"),gradient:"linear-gradient(135deg,rgb(255,206,236) 0%,rgb(152,150,240) 100%)",slug:"blush-light-purple"},{name:(0,h.__)("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,h.__)("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,h.__)("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,h.__)("Electric grass"),gradient:"linear-gradient(135deg,rgb(202,248,128) 0%,rgb(113,206,126) 100%)",slug:"electric-grass"},{name:(0,h.__)("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)}const _=e=>e;function y(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,y(r,o))})),n}function E(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return e.reduce(((e,n)=>Object.assign(e,{[n.clientId]:t},E(n.innerBlocks,n.clientId))),{})}function C(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:_;const n={},o=[...e];for(;o.length;){const{innerBlocks:e,...r}=o.shift();o.push(...e),n[r.clientId]=t(r)}return n}function S(e){return C(e,(e=>(0,u.omit)(e,"attributes")))}function w(e){return C(e,(e=>e.attributes))}function B(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)(Object.keys(e),Object.keys(t))}(e.attributes,t.attributes)}function I(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 T=(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=I(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=I(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):e.push(""),n.toRootClientId&&e.push(n.toRootClientId),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=Object.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.tree={...l.tree,...(0,u.reduce)(o,((e,n,o)=>{const r=`controlled||${o}`;return t.tree[r]&&(e[r]=t.tree[r]),e}),{})}),l}),(e=>(t,n)=>{if("RESET_BLOCKS"===n.type){const e={...t,byClientId:S(n.blocks),attributes:w(n.blocks),order:y(n.blocks),parents:E(n.blocks),controlledInnerBlocks:{},visibility:{}},o=I(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:!B(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,...S(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),...S(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,...w(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),...w(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=y(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=y(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=y(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,...E(t.blocks)};case"INSERT_BLOCKS":return{...e,...E(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),...E(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},visibility(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return"SET_BLOCK_VISIBILITY"===t.type?{...e,...t.updates}:e}});function N(){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}const P=(0,m.combineReducers)({blocks:T,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},selection:function(){var e,t,n,o;let r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},l=arguments.length>1?arguments[1]:void 0;switch(l.type){case"SELECTION_CHANGE":return l.clientId?{selectionStart:{clientId:l.clientId,attributeKey:l.attributeKey,offset:l.startOffset},selectionEnd:{clientId:l.clientId,attributeKey:l.attributeKey,offset:l.endOffset}}:{selectionStart:l.start||r.selectionStart,selectionEnd:l.end||r.selectionEnd};case"RESET_SELECTION":const{selectionStart:i,selectionEnd:s}=l;return{selectionStart:i,selectionEnd:s};case"MULTI_SELECT":const{start:a,end:c}=l;return a===(null===(e=r.selectionStart)||void 0===e?void 0:e.clientId)&&c===(null===(t=r.selectionEnd)||void 0===t?void 0:t.clientId)?r:{selectionStart:{clientId:a},selectionEnd:{clientId:c}};case"RESET_BLOCKS":const u=null==r||null===(n=r.selectionStart)||void 0===n?void 0:n.clientId,d=null==r||null===(o=r.selectionEnd)||void 0===o?void 0:o.clientId;if(!u&&!d)return r;if(!l.blocks.some((e=>e.clientId===u)))return{selectionStart:{},selectionEnd:{}};if(!l.blocks.some((e=>e.clientId===d)))return{...r,selectionEnd:r.selectionStart}}return{selectionStart:N(r.selectionStart,l),selectionEnd:N(r.selectionEnd,l)}},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]:f,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"SET_BLOCK_VISIBILITY":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}});var L={};function M(e){return[e]}function R(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 A(e,t){var n,o=t||M;function r(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(L)||((l=function(){var e={clear:function(){e.head=null}};return e}()).isUniqueByDependants=a,s.set(L,l)),s.get(L)}function l(){n=new WeakMap}function i(){var t,n,l,i,s,a=arguments.length;for(i=new Array(a),l=0;l<a;l++)i[l]=arguments[l];for((t=r(s=o.apply(null,i))).isUniqueByDependants||(t.lastDependants&&!R(s,t.lastDependants,0)&&t.clear(),t.lastDependants=s),n=t.head;n;){if(R(n.args,i,1))return n!==t.head&&(n.prev.next=n.next,n.next&&(n.next.prev=n.prev),n.next=t.head,n.prev=null,t.head.prev=n,t.head=n),n.val;n=n.next}return n={val:e.apply(null,i)},i[0]=null,n.args=i,t.head&&(t.head.prev=n,n.next=t.head),t.head=n,n.val}return i.getDependants=o,i.clear=l,l(),i}const D=window.wp.primitives,O=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.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"})),F=window.wp.richText,z=window.wp.deprecated;var V=n.n(z);function H(e){const{multiline:t,__unstableMultilineWrapperTags:n,__unstablePreserveWhiteSpace:o}=e;return{multilineTag:t,multilineWrapperTags:n,preserveWhiteSpace:o}}const G=[];function U(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 W(e,t){const n=e.blocks.byClientId[t];return!!n&&n.isValid}function $(e,t){return e.blocks.byClientId[t]?e.blocks.attributes[t]:null}function j(e,t){return e.blocks.byClientId[t]?e.blocks.tree[t]:null}const K=A(((e,t)=>{const n=e.blocks.byClientId[t];return n?{...n,attributes:$(e,t)}:null}),((e,t)=>[e.blocks.byClientId[t],e.blocks.attributes[t]]));function q(e,t){var n;const o=t&&Ot(e,t)?"controlled||"+t:t||"";return(null===(n=e.blocks.tree[o])||void 0===n?void 0:n.innerBlocks)||G}const Y=A(((e,t)=>({clientId:t,innerBlocks:Z(e,t)})),(e=>[e.blocks.order])),Z=A((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return(0,u.map)(Re(e,t),(t=>Y(e,t)))}),(e=>[e.blocks.order])),Q=A(((e,t)=>{const n=[];for(const o of t)for(const t of Re(e,o))n.push(t,...Q(e,[t]));return n}),(e=>[e.blocks.order])),X=A((e=>{const t=[];for(const n of Re(e))t.push(n,...Q(e,[n]));return t}),(e=>[e.blocks.order])),J=A(((e,t)=>{const n=X(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])),ee=A(((e,t)=>{if(!t)return G;const n=X(e).filter((n=>e.blocks.byClientId[n].name===t));return n.length>0?n:G}),(e=>[e.blocks.order,e.blocks.byClientId])),te=A(((e,t)=>(0,u.map)((0,u.castArray)(t),(t=>j(e,t)))),((e,t)=>(0,u.map)((0,u.castArray)(t),(t=>e.blocks.tree[t]))));function ne(e,t){return Re(e,t).length}function oe(e){return e.selection.selectionStart}function re(e){return e.selection.selectionEnd}function le(e){return e.selection.selectionStart.clientId}function ie(e){return e.selection.selectionEnd.clientId}function se(e){return ye(e).length||(e.selection.selectionStart.clientId?1:0)}function ae(e){const{selectionStart:t,selectionEnd:n}=e.selection;return!!t.clientId&&t.clientId===n.clientId}function ce(e){const{selectionStart:t,selectionEnd:n}=e.selection,{clientId:o}=t;return o&&o===n.clientId?o:null}function ue(e){const t=ce(e);return t?j(e,t):null}function de(e,t){return void 0!==e.blocks.parents[t]?e.blocks.parents[t]:null}const pe=A((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])),me=A((function(e,t,n){let o=arguments.length>3&&void 0!==arguments[3]&&arguments[3];const r=pe(e,t,o);return(0,u.map)((0,u.filter)((0,u.map)(r,(t=>({id:t,name:U(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 ge(e,t){let n,o=t;do{n=o,o=e.blocks.parents[o]}while(o);return n}function he(e,t){const n=ce(e),o=[...pe(e,t),t],r=[...pe(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 fe(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;if(void 0===t&&(t=ce(e)),void 0===t&&(t=n<0?Ce(e):Se(e)),!t)return null;const o=de(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 ve(e,t){return fe(e,t,-1)}function be(e,t){return fe(e,t,1)}function ke(e){return e.initialPosition}const _e=A((e=>{const{selectionStart:t,selectionEnd:n}=e.selection;if(void 0===t.clientId||void 0===n.clientId)return G;if(t.clientId===n.clientId)return[t.clientId];const o=de(e,t.clientId);if(null===o)return G;const r=Re(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 ye(e){const{selectionStart:t,selectionEnd:n}=e.selection;return t.clientId===n.clientId?G:_e(e)}const Ee=A((e=>{const t=ye(e);return t.length?t.map((t=>j(e,t))):G}),(e=>[..._e.getDependants(e),e.blocks.byClientId,e.blocks.order,e.blocks.attributes]));function Ce(e){return(0,u.first)(ye(e))||null}function Se(e){return(0,u.last)(ye(e))||null}function we(e,t){return Ce(e)===t}function Be(e,t){return-1!==ye(e).indexOf(t)}const Ie=A(((e,t)=>{let n=t,o=!1;for(;n&&!o;)n=de(e,n),o=Be(e,n);return o}),(e=>[e.blocks.order,e.selection.selectionStart.clientId,e.selection.selectionEnd.clientId]));function xe(e){const{selectionStart:t,selectionEnd:n}=e.selection;return t.clientId===n.clientId?null:t.clientId||null}function Te(e){const{selectionStart:t,selectionEnd:n}=e.selection;return t.clientId===n.clientId?null:n.clientId||null}function Ne(e){const t=oe(e),n=re(e);return!t.attributeKey&&!n.attributeKey&&void 0===t.offset&&void 0===n.offset}function Pe(e){const t=oe(e),n=re(e);return!!t&&!!n&&t.clientId===n.clientId&&t.attributeKey===n.attributeKey&&t.offset===n.offset}function Le(e,t){const n=oe(e),o=re(e);if(n.clientId===o.clientId)return!1;if(!n.attributeKey||!o.attributeKey||void 0===n.offset||void 0===o.offset)return!1;const l=de(e,n.clientId);if(l!==de(e,o.clientId))return!1;const i=Re(e,l);let s,a;i.indexOf(n.clientId)>i.indexOf(o.clientId)?(s=o,a=n):(s=n,a=o);const c=t?a.clientId:s.clientId,u=t?s.clientId:a.clientId,d=j(e,c);if(!(0,r.getBlockType)(d.name).merge)return!1;const p=j(e,u);if(p.name===d.name)return!0;const m=(0,r.switchToBlockType)(p,d.name);return m&&m.length}const Me=e=>{const t=oe(e),n=re(e);if(t.clientId===n.clientId)return G;if(!t.attributeKey||!n.attributeKey||void 0===t.offset||void 0===n.offset)return G;const o=de(e,t.clientId);if(o!==de(e,n.clientId))return G;const l=Re(e,o),i=l.indexOf(t.clientId),s=l.indexOf(n.clientId),[a,c]=i>s?[n,t]:[t,n],u=j(e,a.clientId),d=(0,r.getBlockType)(u.name),p=j(e,c.clientId),m=(0,r.getBlockType)(p.name),g=u.attributes[a.attributeKey],h=p.attributes[c.attributeKey],f=d.attributes[a.attributeKey],v=m.attributes[c.attributeKey];let b=(0,F.create)({html:g,...H(f)}),k=(0,F.create)({html:h,...H(v)});return b=(0,F.remove)(b,0,a.offset),k=(0,F.remove)(k,c.offset,k.text.length),[{...u,attributes:{...u.attributes,[a.attributeKey]:(0,F.toHTMLString)({value:b,...H(f)})}},{...p,attributes:{...p.attributes,[c.attributeKey]:(0,F.toHTMLString)({value:k,...H(v)})}}]};function Re(e,t){return e.blocks.order[t||""]||G}function Ae(e,t){return Re(e,de(e,t)).indexOf(t)}function De(e,t){const{selectionStart:n,selectionEnd:o}=e.selection;return n.clientId===o.clientId&&n.clientId===t}function Oe(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return(0,u.some)(Re(e,t),(t=>De(e,t)||Be(e,t)||n&&Oe(e,t,n)))}function Fe(e,t){if(!t)return!1;const n=ye(e),o=n.indexOf(t);return o>-1&&o<n.length-1}function ze(e){const{selectionStart:t,selectionEnd:n}=e.selection;return t.clientId!==n.clientId}function Ve(e){return e.isMultiSelecting}function He(e){return e.isSelectionEnabled}function Ge(e,t){return e.blocksMode[t]||"visual"}function Ue(e){return e.isTyping}function We(e){return!!e.draggedBlocks.length}function $e(e){return e.draggedBlocks}function je(e,t){return e.draggedBlocks.includes(t)}function Ke(e,t){if(!We(e))return!1;const n=pe(e,t);return(0,u.some)(n,(t=>je(e,t)))}function qe(){return V()('wp.data.select( "core/block-editor" ).isCaretWithinFormattedText',{since:"6.1",version:"6.3"}),!1}function Ye(e){let t,n;const{insertionPoint:o,selection:{selectionEnd:r}}=e;if(null!==o)return o;const{clientId:l}=r;return l?(t=de(e,l)||void 0,n=Ae(e,r.clientId)+1):n=Re(e).length,{rootClientId:t,index:n}}function Ze(e){return null!==e.insertionPoint}function Qe(e){return e.template.isValid}function Xe(e){return e.settings.template}function Je(e,t){if(!t)return e.settings.templateLock;const n=wt(e,t);return n?n.templateLock:null}const et=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return"boolean"==typeof e?e:Array.isArray(e)?!(!e.includes("core/post-content")||null!==t)||e.includes(t):n},tt=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=et(i,t,!0);if(!s)return!1;const a=!!Je(e,o);if(a)return!1;const c=wt(e,o);if(o&&void 0===c)return!1;const d=null==c?void 0:c.allowedBlocks,p=et(d,t),m=n.parent,g=U(e,o),h=et(m,g);let f=!0;const v=n.ancestor;if(v){const t=[o,...pe(e,o)];f=(0,u.some)(t,(t=>et(v,U(e,t))))}const b=f&&(null===p&&null===h||!0===p||!0===h);return b?(0,l.applyFilters)("blockEditor.__unstableCanInsertBlockType",b,n,o,{getBlock:j.bind(null,e),getBlockParentsByBlockName:me.bind(null,e)}):b},nt=A(tt,((e,t,n)=>[e.blockListSettings[n],e.blocks.byClientId[n],e.settings.allowedBlockTypes,e.settings.templateLock]));function ot(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return t.every((t=>nt(e,U(e,t),n)))}function rt(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;const o=$(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 lt(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return t.every((t=>rt(e,t,n)))}function it(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;const o=$(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 st(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return t.every((t=>it(e,t,n)))}function at(e,t){const n=$(e,t);if(null===n)return!0;const{lock:o}=n;return!(null!=o&&o.edit)}function ct(e,t){var n;return!!(0,r.hasBlockSupport)(t,"lock",!0)&&!(null===(n=e.settings)||void 0===n||!n.canLockBlocks)}function ut(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 dt=(e,t,n)=>!!(0,r.hasBlockSupport)(t,"inserter",!0)&&tt(e,t.name,n),pt=(e,t)=>n=>{const o=`${t.id}/${n.name}`,{time:r,count:l=0}=ut(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:mt(r,l)}},mt=(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}},gt=(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)(te(e,X(e)),{name:t.name}));const{time:i,count:s=0}=ut(e,o)||{},a={id:o,name:t.name,title:t.title,icon:t.icon,isDisabled:l,frecency:mt(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}}},ht=A((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const n=gt(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=O;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}=ut(e,l)||{},c=mt(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=>dt(e,n,t))).map(n),a=tt(e,"core/block",t)?Lt(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=pt(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,Lt(e),(0,r.getBlockTypes)()])),ft=A((function(e,t){var n;let o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;const l=(0,u.castArray)(t),[i]=l,s=gt(e,{buildScope:"transform"}),a=(0,r.getBlockTypes)().filter((t=>dt(e,t,o))).map(s),c=(0,u.mapKeys)(a,(e=>{let{name:t}=e;return t}));c["*"]={frecency:1/0,id:"*",isDisabled:!1,name:"*",title:(0,h.__)("Unwrap"),icon:null===(n=c[null==i?void 0:i.name])||void 0===n?void 0:n.icon};const d=(0,r.getPossibleBlockTransformations)(l).reduce(((e,t)=>("*"===t?e.push(c["*"]):c[null==t?void 0:t.name]&&e.push(c[t.name]),e)),[]);return(0,u.orderBy)(d,(e=>c[e.name].frecency),"desc")}),((e,t)=>[e.blockListSettings[t],e.blocks.byClientId,e.preferences.insertUsage,e.settings.allowedBlockTypes,e.settings.templateLock,(0,r.getBlockTypes)()])),vt=A((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const n=(0,u.some)((0,r.getBlockTypes)(),(n=>dt(e,n,t)));if(n)return!0;const o=tt(e,"core/block",t)&&Lt(e).length>0;return o}),((e,t)=>[e.blockListSettings[t],e.blocks.byClientId,e.settings.allowedBlockTypes,e.settings.templateLock,Lt(e),(0,r.getBlockTypes)()])),bt=A((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(t)return(0,u.filter)((0,r.getBlockTypes)(),(n=>dt(e,n,t)))}),((e,t)=>[e.blockListSettings[t],e.blocks.byClientId,e.settings.allowedBlockTypes,e.settings.templateLock,(0,r.getBlockTypes)()])),kt=A((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(j(e,o))?r:null:r:void 0}),((e,t)=>[e.blockListSettings[t],e.blocks.tree[t]])),_t=A(((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])),yt=A((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 _t(e,n)})).filter((e=>{let{blocks:t}=e;return((e,t)=>{if("boolean"==typeof t)return t;const n=[...e];for(;n.length>0;){var o;const e=n.shift();if(!et(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])),Et=A((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const n=yt(e),o=(0,u.filter)(n,(n=>{let{blocks:o}=n;return o.every((n=>{let{name:o}=n;return nt(e,o,t)}))}));return o}),((e,t)=>[e.settings.__experimentalBlockPatterns,e.settings.allowedBlockTypes,e.settings.templateLock,e.blockListSettings[t],e.blocks.byClientId[t]])),Ct=A((function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(!t)return G;const o=Et(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)=>[...Et.getDependants(e,t)])),St=A((function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(!t)return G;if(t.some((t=>{let{clientId:n,innerBlocks:o}=t;return o.length||Ot(e,n)})))return G;const o=Array.from(new Set(t.map((e=>{let{name:t}=e;return t}))));return Ct(e,o,n)}),((e,t)=>[...Ct.getDependants(e,t)]));function wt(e,t){return e.blockListSettings[t]}function Bt(e){return e.settings}function It(e){return e.blocks.isPersistentChange}const xt=A((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])),Tt=A(((e,t)=>{var n;const o=(0,u.find)(Lt(e),(e=>e.id===t));return o?null===(n=o.title)||void 0===n?void 0:n.raw:null}),(e=>[Lt(e)]));function Nt(e){return e.blocks.isIgnoredChange}function Pt(e){return e.lastBlockAttributesChange}function Lt(e){var t,n;return null!==(t=null==e||null===(n=e.settings)||void 0===n?void 0:n.__experimentalReusableBlocks)&&void 0!==t?t:G}function Mt(e){return e.isNavigationMode}function Rt(e){return e.hasBlockMovingClientId}function At(e){return!!e.automaticChangeStatus}function Dt(e,t){return e.highlightedBlock===t}function Ot(e,t){return!!e.blocks.controlledInnerBlocks[t]}const Ft=A(((e,t)=>{if(!t.length)return null;const n=ce(e);if(t.includes(U(e,n)))return n;const o=ye(e),r=me(e,n||o[0],t);return r?(0,u.last)(r):null}),((e,t)=>[e.selection.selectionStart.clientId,e.selection.selectionEnd.clientId,t]));function zt(e,t,n){const{lastBlockInserted:o}=e;return o.clientId===t&&o.source===n}function Vt(e,t){var n,o;return null===(n=null===(o=e.blocks.visibility)||void 0===o?void 0:o[t])||void 0===n||n}const Ht=A((e=>new Set(Object.keys(e.blocks.visibility).filter((t=>e.blocks.visibility[t])))),(e=>[e.blocks.visibility])),Gt=window.wp.a11y,Ut="†";function Wt(e){if(e)return Object.keys(e).find((t=>{const n=e[t];return"string"==typeof n&&-1!==n.indexOf(Ut)}))}const $t=e=>Array.isArray(e)?e:[e],jt=e=>t=>{let{dispatch:n}=t;n({type:"RESET_BLOCKS",blocks:e}),n(Kt(e))},Kt=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 qt(e,t,n){return{type:"RESET_SELECTION",selectionStart:e,selectionEnd:t,initialPosition:n}}function Yt(e){return V()('wp.data.dispatch( "core/block-editor" ).receiveBlocks',{since:"5.9",alternative:"resetBlocks or insertBlocks"}),{type:"RECEIVE_BLOCKS",blocks:e}}function Zt(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return{type:"UPDATE_BLOCK_ATTRIBUTES",clientIds:$t(e),attributes:t,uniqueByBlock:n}}function Qt(e,t){return{type:"UPDATE_BLOCK",clientId:e,updates:t}}function Xt(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return{type:"SELECT_BLOCK",initialPosition:t,clientId:e}}const Jt=e=>t=>{let{select:n,dispatch:o}=t;const r=n.getPreviousBlockClientId(e);r&&o.selectBlock(r,-1)},en=e=>t=>{let{select:n,dispatch:o}=t;const r=n.getNextBlockClientId(e);r&&o.selectBlock(r)};function tn(){return{type:"START_MULTI_SELECT"}}function nn(){return{type:"STOP_MULTI_SELECT"}}const on=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,Gt.speak)((0,h.sprintf)(
2
  /* translators: %s: number of selected blocks */
3
+ (0,h._n)("%s block selected.","%s blocks selected.",i),i),"assertive")}};function rn(){return{type:"CLEAR_SELECTED_BLOCK"}}function ln(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return{type:"TOGGLE_SELECTION",isSelectionEnabled:e}}function sn(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 an=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=$t(e),t=sn($t(t),i.getSettings());const a=i.getBlockRootClientId(e[0]);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 cn(e,t){return an(e,t)}const un=e=>(t,n)=>o=>{let{select:r,dispatch:l}=o;r.canMoveBlocks(t,n)&&l({type:e,clientIds:$t(t),rootClientId:n})},dn=un("MOVE_BLOCKS_DOWN"),pn=un("MOVE_BLOCKS_UP"),mn=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 gn(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 mn([e],t,n,o)}function hn(e,t,n,o,r){return fn([e],t,n,o,0,r)}const fn=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;null!==r&&"object"==typeof r&&(l=r,r=0,V()("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=sn($t(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 vn(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 bn(){return{type:"HIDE_INSERTION_POINT"}}function kn(e){return{type:"SET_TEMPLATE_VALIDITY",isValid:e}}const yn=()=>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)},En=e=>t=>{let{registry:n,select:o,dispatch:l}=t;const i=o.getSelectionStart(),s=o.getSelectionEnd();if(i.clientId===s.clientId)return;if(!i.attributeKey||!s.attributeKey||void 0===i.offset||void 0===s.offset)return!1;const a=o.getBlockRootClientId(i.clientId);if(a!==o.getBlockRootClientId(s.clientId))return;const c=o.getBlockOrder(a);let u,d;c.indexOf(i.clientId)>c.indexOf(s.clientId)?(u=s,d=i):(u=i,d=s);const p=e?d:u,m=o.getBlock(p.clientId),g=(0,r.getBlockType)(m.name);if(!g.merge)return;const h=u,f=d,v=o.getBlock(h.clientId),b=(0,r.getBlockType)(v.name),k=o.getBlock(f.clientId),_=(0,r.getBlockType)(k.name),y=v.attributes[h.attributeKey],E=k.attributes[f.attributeKey],C=b.attributes[h.attributeKey],S=_.attributes[f.attributeKey];let w=(0,F.create)({html:y,...H(C)}),B=(0,F.create)({html:E,...H(S)});w=(0,F.remove)(w,h.offset,w.text.length),B=(0,F.insert)(B,Ut,0,f.offset);const I=(0,r.cloneBlock)(v,{[h.attributeKey]:(0,F.toHTMLString)({value:w,...H(C)})}),x=(0,r.cloneBlock)(k,{[f.attributeKey]:(0,F.toHTMLString)({value:B,...H(S)})}),T=e?I:x,N=v.name===k.name?[T]:(0,r.switchToBlockType)(T,g.name);if(!N||!N.length)return;let P;if(e){const e=N.pop();P=g.merge(e.attributes,x.attributes)}else{const e=N.shift();P=g.merge(I.attributes,e.attributes)}const L=Wt(P),M=P[L],R=(0,F.create)({html:M,...H(g.attributes[L])}),A=R.text.indexOf(Ut),D=(0,F.remove)(R,A,A+1),O=(0,F.toHTMLString)({value:D,...H(g.attributes[L])});P[L]=O;const z=o.getSelectedBlockClientIds(),V=[...e?N:[],{...m,attributes:{...m.attributes,...P}},...e?[]:N];n.batch((()=>{l.selectionChange(m.clientId,L,A,A),l.replaceBlocks(z,V,0,o.getSelectedBlocksInitialCaretPosition())}))},Cn=()=>e=>{let{select:t,dispatch:n}=e;const o=t.getSelectionStart(),l=t.getSelectionEnd();if(o.clientId===l.clientId)return;if(!o.attributeKey||!l.attributeKey||void 0===o.offset||void 0===l.offset)return;const i=t.getBlockRootClientId(o.clientId);if(i!==t.getBlockRootClientId(l.clientId))return;const s=t.getBlockOrder(i);let a,c;s.indexOf(o.clientId)>s.indexOf(l.clientId)?(a=l,c=o):(a=o,c=l);const u=a,d=c,p=t.getBlock(u.clientId),m=(0,r.getBlockType)(p.name),g=t.getBlock(d.clientId),h=(0,r.getBlockType)(g.name),f=p.attributes[u.attributeKey],v=g.attributes[d.attributeKey],b=m.attributes[u.attributeKey],k=h.attributes[d.attributeKey];let _=(0,F.create)({html:f,...H(b)}),y=(0,F.create)({html:v,...H(k)});_=(0,F.remove)(_,u.offset,_.text.length),y=(0,F.remove)(y,0,d.offset),n.replaceBlocks(t.getSelectedBlockClientIds(),[{...p,attributes:{...p.attributes,[u.attributeKey]:(0,F.toHTMLString)({value:_,...H(b)})}},(0,r.createBlock)((0,r.getDefaultBlockName)()),{...g,attributes:{...g.attributes,[d.attributeKey]:(0,F.toHTMLString)({value:y,...H(k)})}}],1,t.getSelectedBlocksInitialCaretPosition())},Sn=()=>e=>{let{select:t,dispatch:n}=e;const o=t.getSelectionStart(),r=t.getSelectionEnd();n.selectionChange({start:{clientId:o.clientId},end:{clientId:r.clientId}})},wn=(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),u=(0,r.getBlockType)(c.name);if(u&&!u.merge)return void l.selectBlock(c.clientId);const d=o.getBlock(a),p=(0,r.getBlockType)(d.name),{clientId:m,attributeKey:g,offset:h}=o.getSelectionStart(),f=(m===s?u:p).attributes[g],v=(m===s||m===a)&&void 0!==g&&void 0!==h&&!!f;f||("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 b=(0,r.cloneBlock)(c),k=(0,r.cloneBlock)(d);if(v){const e=m===s?b:k,t=e.attributes[g],n=(0,F.insert)((0,F.create)({html:t,...H(f)}),Ut,h,h);e.attributes[g]=(0,F.toHTMLString)({value:n,...H(f)})}const _=c.name===d.name?[k]:(0,r.switchToBlockType)(k,c.name);if(!_||!_.length)return;const y=u.merge(b.attributes,_[0].attributes);if(v){const e=Wt(y),t=y[e],n=(0,F.create)({html:t,...H(u.attributes[e])}),o=n.text.indexOf(Ut),r=(0,F.remove)(n,o,o+1),i=(0,F.toHTMLString)({value:r,...H(u.attributes[e])});y[e]=i,l.selectionChange(c.clientId,e,o,o)}l.replaceBlocks([c.clientId,d.clientId],[{...c,attributes:{...c.attributes,...y}},..._.slice(1)],0)},Bn=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=$t(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 In(e,t){return Bn([e],t)}function xn(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 Tn(e){return{type:"TOGGLE_BLOCK_MODE",clientId:e}}function Nn(){return{type:"START_TYPING"}}function Pn(){return{type:"STOP_TYPING"}}function Ln(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return{type:"START_DRAGGING_BLOCKS",clientIds:e}}function Mn(){return{type:"STOP_DRAGGING_BLOCKS"}}function Rn(){return V()('wp.data.dispatch( "core/block-editor" ).enterFormattedText',{since:"6.1",version:"6.3"}),{type:"DO_NOTHING"}}function An(){return V()('wp.data.dispatch( "core/block-editor" ).exitFormattedText',{since:"6.1",version:"6.3"}),{type:"DO_NOTHING"}}function Dn(e,t,n,o){return"string"==typeof e?{type:"SELECTION_CHANGE",clientId:e,attributeKey:t,startOffset:n,endOffset:o}:{type:"SELECTION_CHANGE",...e}}const On=(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 Fn(e,t){return{type:"UPDATE_BLOCK_LIST_SETTINGS",clientId:e,settings:t}}function zn(e){return{type:"UPDATE_SETTINGS",settings:e}}function Vn(e,t){return{type:"SAVE_REUSABLE_BLOCK_SUCCESS",id:e,updatedId:t}}function Hn(){return{type:"MARK_LAST_CHANGE_AS_PERSISTENT"}}function Gn(){return{type:"MARK_NEXT_CHANGE_AS_NOT_PERSISTENT"}}const Un=()=>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"})}))},Wn=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,Gt.speak)((0,h.__)("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,Gt.speak)((0,h.__)("You are currently in edit mode. To return to the navigation mode, press Escape."))}},$n=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,Gt.speak)((0,h.__)("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."))}},jn=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(i.some((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=$t(e),c=o.getBlockIndex(a[a.length-1]),u=i.map((e=>(0,r.__experimentalCloneSanitizedBlock)(e)));return l.insertBlocks(u,c+1,s,t),u.length>1&&t&&l.multiSelect(u[0].clientId,u[u.length-1].clientId),u.map((e=>e.clientId))}},Kn=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)},qn=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 Yn(e,t){return{type:"TOGGLE_BLOCK_HIGHLIGHT",clientId:e,isHighlighted:t}}const Zn=e=>async t=>{let{dispatch:n}=t;n(Yn(e,!0)),await new Promise((e=>setTimeout(e,150))),n(Yn(e,!1))};function Qn(e,t){return{type:"SET_HAS_CONTROLLED_INNER_BLOCKS",hasControlledInnerBlocks:t,clientId:e}}function Xn(e){return{type:"SET_BLOCK_VISIBILITY",updates:e}}const Jn="core/block-editor",eo={reducer:P,selectors:e,actions:t},to=(0,m.createReduxStore)(Jn,{...eo,persist:["preferences"]});(0,m.registerStore)(Jn,{...eo,persist:["preferences"]});const no={name:"",isSelected:!1},oo=(0,s.createContext)(no),{Provider:ro}=oo;function lo(){return(0,s.useContext)(oo)}function io(){const{isSelected:e,clientId:t,name:n}=lo();return(0,m.useSelect)((o=>{if(e)return!0;const{getBlockName:r,isFirstMultiSelectedBlock:l,getMultiSelectedBlockClientIds:i}=o(to);return!!l(t)&&i().every((e=>r(e)===n))}),[t,e,n])}function so(e){let{group:t="default",controls:n,children:o,__experimentalShareWithChildBlocks:l=!1}=e;const i=function(e,t){const n=io(),{clientId:o}=lo(),l=(0,m.useSelect)((e=>{const{getBlockName:n,hasSelectedInnerBlock:l}=e(to),{hasBlockSupport:i}=e(r.store);return t&&i(n(o),"__experimentalExposeControlsToChildren",!1)&&l(o)}),[t,o]);var i;return n?null===(i=g[e])||void 0===i?void 0:i.Fill:l?g.parent.Fill:null}(t,l);return i?(0,s.createElement)(p.__experimentalStyleProvider,{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 ao(e){let{group:t="default",...n}=e;const o=(0,s.useContext)(p.__experimentalToolbarContext),r=g[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 co=so;co.Slot=ao;const uo=e=>(0,s.createElement)(so,i({group:"inline"},e));uo.Slot=e=>(0,s.createElement)(ao,i({group:"inline"},e));const po=co,mo=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M9 9v6h11V9H9zM4 20h1.5V4H4v16z"})),go=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M20 9h-7.2V4h-1.6v5H4v6h7.2v5h1.6v-5H20z"})),ho=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M4 15h11V9H4v6zM18.5 4v16H20V4h-1.5z"})),fo=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M9 15h6V9H9v6zm-5 5h1.5V4H4v16zM18.5 4v16H20V4h-1.5z"})),vo=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.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"})),bo=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.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 ko(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return e.split(",").map((e=>`.editor-styles-wrapper ${e}${t?` ${t}`:""}`)).join(",")}function _o(e,t,n,o){var r,l;let i="";return null!=t&&null!==(r=t[n])&&void 0!==r&&null!==(l=r.spacingStyles)&&void 0!==l&&l.length&&o&&t[n].spacingStyles.forEach((t=>{i+=`${ko(e,t.selector.trim())} { `,i+=Object.entries(t.rules).map((e=>{let[t,n]=e;return`${t}: ${n||o}`})).join("; "),i+="; }"})),i}const yo=(0,s.createContext)({refs:new Map,callbacks:new Map});function Eo(e){let{children:t}=e;const n=(0,s.useMemo)((()=>({refs:new Map,callbacks:new Map})),[]);return(0,s.createElement)(yo.Provider,{value:n},t)}function Co(e){const{refs:t,callbacks:n}=(0,s.useContext)(yo),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 So(e){const{refs:t}=(0,s.useContext)(yo),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 wo(e){const{callbacks:t}=(0,s.useContext)(yo),n=So(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 Bo=["color","border","typography","spacing"],Io={"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},xo={"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 To(e){const{name:t,clientId:n}=lo();return(0,m.useSelect)((o=>{if(Bo.includes(e))return void console.warn("Top level useSetting paths are disabled. Please use a subpath to query the information needed.");let l;const i=(e=>xo[e]||e)(e);[...o(to).getBlockParents(n),n].forEach((e=>{const n=o(to).getBlockName(e);if((0,r.hasBlockSupport)(n,"__experimentalSettings",!1)){var s;const n=o(to).getBlockAttributes(e),r=null!==(s=(0,u.get)(n,`settings.blocks.${t}.${i}`))&&void 0!==s?s:(0,u.get)(n,`settings.${i}`);void 0!==r&&(l=r)}}));const s=o(to).getSettings();if(void 0===l){var a;const e=`__experimentalFeatures.${i}`,n=`__experimentalFeatures.blocks.${t}.${i}`;l=null!==(a=(0,u.get)(s,n))&&void 0!==a?a:(0,u.get)(s,e)}var c,d;if(void 0!==l)return r.__EXPERIMENTAL_PATHS_WITH_MERGE[i]?null!==(c=null!==(d=l.custom)&&void 0!==d?d:l.theme)&&void 0!==c?c:l.default:l;const p=Io[i]?Io[i](s):void 0;return void 0!==p?p:"typography.dropCap"===i||void 0}),[t,n,e])}window.wp.warning;const No={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 Po(e){var t;let{__experimentalGroup:n="default",children:o}=e;const r=io(),l=null===(t=No[n])||void 0===t?void 0:t.Fill;return l?r?(0,s.createElement)(p.__experimentalStyleProvider,{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 Lo=e=>e,Mo=e=>{if(null===e||"object"!=typeof e||Array.isArray(e))return e;const t=(0,u.pickBy)((0,u.mapValues)(e,Mo),Lo);return(0,u.isEmpty)(t)?void 0:t};function Ro(e,t,n){return(0,u.setWith)(e?(0,u.clone)(e):{},t,n,u.clone)}function Ao(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:Ro(c.attributes,e,t)})}))})),c}function Do(e,t,n){const o=(0,r.getBlockSupport)(e,t),l=null==o?void 0:o.__experimentalSkipSerialization;return Array.isArray(l)?l.includes(n):l}function Oo(e){let{children:t,group:n,label:o}=e;const{updateBlockAttributes:r}=(0,m.useDispatch)(to),{getBlockAttributes:l,getMultiSelectedBlockClientIds:i,getSelectedBlockClientId:a,hasMultiSelection:c}=(0,m.useSelect)(to),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:Mo(r.style)},t[n]=r})),r(n,t,!0)}),[Mo,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 Fo(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 zo(e){var t;let{__experimentalGroup:n="default",label:o,...r}=e;const l=null===(t=No[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)(Oo,{group:n,label:o},(0,s.createElement)(Fo,i({},r,{Slot:l}))):(0,s.createElement)(l,i({},r,{bubblesVirtually:!0})):null:("undefined"!=typeof process&&process.env,null)}const Vo=Po;Vo.Slot=zo;const Ho=e=>(0,s.createElement)(Po,i({},e,{__experimentalGroup:"advanced"}));Ho.Slot=e=>(0,s.createElement)(zo,i({},e,{__experimentalGroup:"advanced"})),Ho.slotName="InspectorAdvancedControls";const Go=Vo,Uo=window.wp.isShallowEqual;var Wo=n.n(Uo);const $o=function(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])};function jo(e){let{clientId:t,bottomClientId:n,children:o,__unstableRefreshSize:r,__unstableCoverTarget:l=!1,__unstablePopoverSlot:a,__unstableContentRef:u,...d}=e;const m=wo(t),g=wo(null!=n?n:t),h=$o(u),f=(0,s.useMemo)((()=>m&&g===m?{position:"absolute",width:m.offsetWidth,height:m.offsetHeight}:{}),[m,g,r]);if(!m||n&&!g)return null;const v={top:m,bottom:g};return(0,s.createElement)(p.Popover,i({ref:h,animate:!1,position:"top right left",focusOnMount:!1,anchorRef:v,__unstableSlotName:a||null,__unstableObserveElement:m,__unstableForcePosition:!0,__unstableShift:!0},d,{className:c()("block-editor-block-popover",d.className)}),l&&(0,s.createElement)("div",{style:f},o),!l&&o)}function Ko(e){const t=(0,r.getBlockSupport)(e,tr);return!!(!0===t||null!=t&&t.margin)}function qo(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!To("spacing.margin"),n=!sr(e,"margin");return!Ko(e)||t||n}function Yo(e){var t;const{name:n,attributes:{style:o},setAttributes:r}=e,l=(0,p.__experimentalUseCustomUnits)({availableUnits:To("spacing.units")||["%","px","em","rem","vw"]}),i=ir(n,"margin"),a=i&&i.some((e=>or.includes(e)));return qo(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:Mo(t)})},label:(0,h.__)("Margin"),sides:i,units:l,allowReset:!1,splitOnAxis:a})),native:null})}function Zo(e){var t,n;let{clientId:o,attributes:r}=e;const l=null==r||null===(t=r.style)||void 0===t||null===(n=t.spacing)||void 0===n?void 0:n.margin,i=(0,s.useMemo)((()=>{var e,t,n,o;return{borderTopWidth:null!==(e=null==l?void 0:l.top)&&void 0!==e?e:0,borderRightWidth:null!==(t=null==l?void 0:l.right)&&void 0!==t?t:0,borderBottomWidth:null!==(n=null==l?void 0:l.bottom)&&void 0!==n?n:0,borderLeftWidth:null!==(o=null==l?void 0:l.left)&&void 0!==o?o:0,top:null!=l&&l.top?`-${l.top}`:0,right:null!=l&&l.right?`-${l.right}`:0,bottom:null!=l&&l.bottom?`-${l.bottom}`:0,left:null!=l&&l.left?`-${l.left}`:0}}),[l]),[a,c]=(0,s.useState)(!1),u=(0,s.useRef)(l),d=(0,s.useRef)(),p=()=>{d.current&&window.clearTimeout(d.current)};return(0,s.useEffect)((()=>(Wo()(l,u.current)||(c(!0),u.current=l,p(),d.current=setTimeout((()=>{c(!1)}),400)),()=>p())),[l]),a?(0,s.createElement)(jo,{clientId:o,__unstableCoverTarget:!0,__unstableRefreshSize:l},(0,s.createElement)("div",{className:"block-editor__padding-visualizer",style:i})):null}function Qo(e){const t=(0,r.getBlockSupport)(e,tr);return!!(!0===t||null!=t&&t.padding)}function Xo(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!To("spacing.padding"),n=!sr(e,"padding");return!Qo(e)||t||n}function Jo(e){var t;const{name:n,attributes:{style:o},setAttributes:r}=e,l=(0,p.__experimentalUseCustomUnits)({availableUnits:To("spacing.units")||["%","px","em","rem","vw"]}),i=ir(n,"padding"),a=i&&i.some((e=>or.includes(e)));return Xo(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:Mo(t)})},label:(0,h.__)("Padding"),sides:i,units:l,allowReset:!1,splitOnAxis:a})),native:null})}function er(e){var t,n;let{clientId:o,attributes:r}=e;const l=null==r||null===(t=r.style)||void 0===t||null===(n=t.spacing)||void 0===n?void 0:n.padding,i=(0,s.useMemo)((()=>{var e,t,n,o;return{borderTopWidth:null!==(e=null==l?void 0:l.top)&&void 0!==e?e:0,borderRightWidth:null!==(t=null==l?void 0:l.right)&&void 0!==t?t:0,borderBottomWidth:null!==(n=null==l?void 0:l.bottom)&&void 0!==n?n:0,borderLeftWidth:null!==(o=null==l?void 0:l.left)&&void 0!==o?o:0}}),[l]),[a,c]=(0,s.useState)(!1),u=(0,s.useRef)(l),d=(0,s.useRef)(),p=()=>{d.current&&window.clearTimeout(d.current)};return(0,s.useEffect)((()=>(Wo()(l,u.current)||(c(!0),u.current=l,p(),d.current=setTimeout((()=>{c(!1)}),400)),()=>p())),[l]),a?(0,s.createElement)(jo,{clientId:o,__unstableCoverTarget:!0,__unstableRefreshSize:l},(0,s.createElement)("div",{className:"block-editor__padding-visualizer",style:i})):null}const tr="spacing",nr=["top","right","bottom","left"],or=["vertical","horizontal"];function rr(e){const t=dr(e),n=Xo(e),o=qo(e),l=lr(e),i=(a=e.name,"web"===s.Platform.OS&&(ar(a)||Qo(a)||Ko(a)));var a;if(l||!i)return null;const c=(0,r.getBlockSupport)(e.name,[tr,"__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)(s.Fragment,null,(0,s.createElement)(Go,{__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,h.__)("Padding"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:Mo({...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)(Jo,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,h.__)("Margin"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:Mo({...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)(Yo,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,h.__)("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)(pr,e))),!n&&(0,s.createElement)(er,e),!o&&(0,s.createElement)(Zo,e))}const lr=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=dr(e),n=Xo(e),o=qo(e);return t&&n&&o};function ir(e,t){var n;const o=(0,r.getBlockSupport)(e,tr);if(o&&"boolean"!=typeof o[t])return Array.isArray(o[t])?o[t]:null!==(n=o[t])&&void 0!==n&&n.sides?o[t].sides:void 0}function sr(e,t){const n=ir(e,t);return!(n&&n.some((e=>nr.includes(e)))&&n.some((e=>or.includes(e)))&&(console.warn(`The ${t} support for the "${e}" block can not be configured to support both axial and arbitrary sides.`),1))}function ar(e){const t=(0,r.getBlockSupport)(e,tr);return!!(!0===t||null!=t&&t.blockGap)}function cr(e){if(!e)return null;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 ur(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"0";const n=cr(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}`}function dr(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!To("spacing.blockGap");return!ar(e)||t}function pr(e){var t;const{clientId:n,attributes:{style:o},name:r,setAttributes:l}=e,i=(0,p.__experimentalUseCustomUnits)({availableUnits:To("spacing.units")||["%","px","em","rem","vw"]}),a=ir(r,"blockGap"),c=So(n);if(dr(e))return null;const u=a&&a.some((e=>or.includes(e))),d=e=>{var t;let n=e;e&&u&&(n={...cr(e)});const r={...o,spacing:{...null==o?void 0:o.spacing,blockGap:n}};l({style:Mo(r)});const i=(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;c.current&&i&&(null===(s=c.current.parentNode)||void 0===s||s.replaceChild(c.current,c.current))},m=cr(null==o||null===(t=o.spacing)||void 0===t?void 0:t.blockGap),g=u?{...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,u?(0,s.createElement)(p.__experimentalBoxControl,{label:(0,h.__)("Block spacing"),min:0,onChange:d,units:i,sides:a,values:g,allowReset:!1,splitOnAxis:u}):(0,s.createElement)(p.__experimentalUnitControl,{label:(0,h.__)("Block spacing"),__unstableInputWidth:"80px",min:0,onChange:d,units:i,value:g})),native:null})}const mr=(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"})),gr=(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"})),hr={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,h._x)("Align top","Block vertical alignment setting")},center:{icon:gr,title:(0,h._x)("Align middle","Block vertical alignment setting")},bottom:{icon:mr,title:(0,h._x)("Align bottom","Block vertical alignment setting")}},fr=["top","center","bottom"],vr={isAlternate:!0},br=function(e){let{value:t,onChange:n,controls:o=fr,isCollapsed:r=!0,isToolbar:l}=e;const a=hr[t],c=hr.top,u=l?p.ToolbarGroup:p.ToolbarDropdownMenu,d=l?{isCollapsed:r}:{};return(0,s.createElement)(u,i({popoverProps:vr,icon:a?a.icon:c.icon,label:(0,h._x)("Change vertical alignment","Block vertical alignment setting label"),controls:o.map((e=>{return{...hr[e],isActive:t===e,role:r?"menuitemradio":void 0,onClick:(o=e,()=>n(t===o?void 0:o))};var o}))},d))},kr=e=>(0,s.createElement)(br,i({},e,{isToolbar:!1})),_r=e=>(0,s.createElement)(br,i({},e,{isToolbar:!0})),yr={left:mo,center:go,right:ho,"space-between":fo},Er=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?yr[r]:yr.left,d=[{name:"left",icon:mo,title:(0,h.__)("Justify items left"),isActive:"left"===r,onClick:()=>c("left")},{name:"center",icon:go,title:(0,h.__)("Justify items center"),isActive:"center"===r,onClick:()=>c("center")},{name:"right",icon:ho,title:(0,h.__)("Justify items right"),isActive:"right"===r,onClick:()=>c("right")},{name:"space-between",icon:fo,title:(0,h.__)("Space between items"),isActive:"space-between"===r,onClick:()=>c("space-between")}],m=a?p.ToolbarGroup:p.ToolbarDropdownMenu,g=a?{isCollapsed:n}:{};return(0,s.createElement)(m,i({icon:u,popoverProps:l,label:(0,h.__)("Change items justification"),controls:d.filter((e=>t.includes(e.name)))},g))},Cr=e=>(0,s.createElement)(Er,i({},e,{isToolbar:!1})),Sr=e=>(0,s.createElement)(Er,i({},e,{isToolbar:!0})),wr={left:"flex-start",right:"flex-end",center:"center","space-between":"space-between"},Br={left:"flex-start",right:"flex-end",center:"center"},Ir={top:"flex-start",center:"center",bottom:"flex-end"},xr=["wrap","nowrap"],Tr={name:"flex",label:(0,h.__)("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)(Pr,{layout:t,onChange:n})),(0,s.createElement)(p.FlexItem,null,r&&(0,s.createElement)(Mr,{layout:t,onChange:n}))),(0,s.createElement)(Lr,{layout:t,onChange:n}))},toolBarControls:function(e){let{layout:t={},onChange:n,layoutBlockSupport:o}=e;if(null!=o&&o.allowSwitching)return null;const{allowVerticalAlignment:r=!0}=o;return(0,s.createElement)(po,{group:"block",__experimentalShareWithChildBlocks:!0},(0,s.createElement)(Pr,{layout:t,onChange:n,isToolbar:!0}),r&&"vertical"!==(null==t?void 0:t.orientation)&&(0,s.createElement)(Nr,{layout:t,onChange:n,isToolbar:!0}))},getLayoutStyle:function(e){var t,n;let{selector:o,layout:r,style:l,blockName:i,hasBlockGapSupport:s,layoutDefinitions:a}=e;const{orientation:c="horizontal"}=r,u=null!=l&&null!==(t=l.spacing)&&void 0!==t&&t.blockGap&&!Do(i,"spacing","blockGap")?ur(null==l||null===(n=l.spacing)||void 0===n?void 0:n.blockGap):void 0,d=wr[r.justifyContent],p=xr.includes(r.flexWrap)?r.flexWrap:"wrap",m=Ir[r.verticalAlignment],g=Br[r.justifyContent]||Br.left;let h="";const f=[];return p&&"wrap"!==p&&f.push(`flex-wrap: ${p}`),"horizontal"===c?(m&&f.push(`align-items: ${m}`),d&&f.push(`justify-content: ${d}`)):(f.push("flex-direction: column"),f.push(`align-items: ${g}`)),f.length&&(h=`${ko(o)} {\n\t\t\t\t${f.join("; ")};\n\t\t\t}`),s&&u&&(h+=_o(o,a,"flex",u)),h},getOrientation(e){const{orientation:t="horizontal"}=e;return t},getAlignments:()=>[]};function Nr(e){let{layout:t,onChange:n,isToolbar:o=!1}=e;const{verticalAlignment:r=Ir.center}=t,l=e=>{n({...t,verticalAlignment:e})};if(o)return(0,s.createElement)(kr,{onChange:l,value:r});const i=[{value:"flex-start",label:(0,h.__)("Align items top")},{value:"center",label:(0,h.__)("Align items center")},{value:"flex-end",label:(0,h.__)("Align items bottom")}];return(0,s.createElement)("fieldset",{className:"block-editor-hooks__flex-layout-vertical-alignment-control"},(0,s.createElement)("legend",null,(0,h.__)("Vertical alignment")),(0,s.createElement)("div",null,i.map(((e,t,n)=>(0,s.createElement)(p.Button,{key:e,label:n,icon:t,isPressed:r===e,onClick:()=>l(e)})))))}function Pr(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)(Cr,{allowedControls:a,value:r,onChange:i,popoverProps:{position:"bottom right",isAlternate:!0}});const c=[{value:"left",icon:mo,label:(0,h.__)("Justify items left")},{value:"center",icon:go,label:(0,h.__)("Justify items center")},{value:"right",icon:ho,label:(0,h.__)("Justify items right")}];return"horizontal"===l&&c.push({value:"space-between",icon:fo,label:(0,h.__)("Space between items")}),(0,s.createElement)("fieldset",{className:"block-editor-hooks__flex-layout-justification-controls"},(0,s.createElement)("legend",null,(0,h.__)("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 Lr(e){let{layout:t,onChange:n}=e;const{flexWrap:o="wrap"}=t;return(0,s.createElement)(p.ToggleControl,{label:(0,h.__)("Allow to wrap to multiple lines"),onChange:e=>{n({...t,flexWrap:e?"wrap":"nowrap"})},checked:"wrap"===o})}function Mr(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,h.__)("Orientation")),(0,s.createElement)(p.Button,{label:(0,h.__)("Horizontal"),icon:vo,isPressed:"horizontal"===o,onClick:()=>n({...t,orientation:"horizontal"})}),(0,s.createElement)(p.Button,{label:(0,h.__)("Vertical"),icon:bo,isPressed:"vertical"===o,onClick:()=>n({...t,orientation:"vertical"})}))}const Rr=function(e){let{icon:t,size:n=24,...o}=e;return(0,s.cloneElement)(t,{width:n,height:n,...o})},Ar=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M7 9v6h10V9H7zM5 19.8h14v-1.5H5v1.5zM5 4.3v1.5h14V4.3H5z"})),Dr=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M5 9v6h14V9H5zm11-4.8H8v1.5h8V4.2zM8 19.8h8v-1.5H8v1.5z"})),Or=[{name:"default",label:(0,h.__)("Flow"),inspectorControls:function(e){let{layout:t,onChange:n}=e;const{wideSize:o,contentSize:r}=t,l=(0,p.__experimentalUseCustomUnits)({availableUnits:To("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,h.__)("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)(Rr,{icon:Ar})),(0,s.createElement)("div",{className:"block-editor-hooks__layout-controls-unit"},(0,s.createElement)(p.__experimentalUnitControl,{label:(0,h.__)("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)(Rr,{icon:Dr}))),(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,h.__)("Reset"))),(0,s.createElement)("p",{className:"block-editor-hooks__layout-controls-helptext"},(0,h.__)("Customize the width for all elements that are assigned to the center or wide columns.")))},toolBarControls:function(){return null},getLayoutStyle:function(e){var t;let{selector:n,layout:o={},style:r,blockName:l,hasBlockGapSupport:i,layoutDefinitions:s}=e;const{contentSize:a,wideSize:c}=o,u=cr(null==r||null===(t=r.spacing)||void 0===t?void 0:t.blockGap),d=null!=u&&u.top&&!Do(l,"spacing","blockGap")?null==u?void 0:u.top:"";let p=a||c?`\n\t\t\t\t\t${ko(n,"> :where(:not(.alignleft):not(.alignright))")} {\n\t\t\t\t\t\tmax-width: ${null!=a?a:c};\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${ko(n,"> .alignwide")} {\n\t\t\t\t\t\tmax-width: ${null!=c?c:a};\n\t\t\t\t\t}\n\t\t\t\t\t${ko(n,"> .alignfull")} {\n\t\t\t\t\t\tmax-width: none;\n\t\t\t\t\t}\n\t\t\t\t`:"";return i&&d&&(p+=_o(n,s,"default",d)),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,h.sprintf)((0,h.__)("Max %s wide"),t)),r.test(n)&&(
6
  // translators: %s: container size (i.e. 600px etc)
7
+ o.wide=(0,h.sprintf)((0,h.__)("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}},Tr];function Fr(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default";return Or.find((t=>t.name===e))}const zr={type:"default"},Vr=(0,s.createContext)(zr),Hr=Vr.Provider;function Gr(){return(0,s.useContext)(Vr)}function Ur(e){let{layout:t={},css:n,...o}=e;const r=Fr(t.type),l=null!==To("spacing.blockGap");if(r){var i;if(n)return(0,s.createElement)("style",null,n);const e=null===(i=r.getLayoutStyle)||void 0===i?void 0:i.call(r,{hasBlockGapSupport:l,layout:t,...o});if(e)return(0,s.createElement)("style",null,e)}return null}const Wr=["none","left","center","right","wide","full"],$r=["wide","full"];function jr(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Wr;e.includes("none")||(e=["none",...e]);const{wideControlsEnabled:t=!1,themeSupportsLayout:n}=(0,m.useSelect)((e=>{const{getSettings:t}=e(to),n=t();return{wideControlsEnabled:n.alignWide,themeSupportsLayout:n.supportsLayout}}),[]),o=Gr(),r=Fr(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=Wr}=o,s=e.filter((e=>(o.alignments||t||!$r.includes(e))&&i.includes(e))).map((e=>({name:e})));return 1===s.length&&"none"===s[0].name?[]:s}const Kr=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M5 15h14V9H5v6zm0 4.8h14v-1.5H5v1.5zM5 4.2v1.5h14V4.2H5z"})),qr=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M4 9v6h14V9H4zm8-4.8H4v1.5h8V4.2zM4 19.8h8v-1.5H4v1.5z"})),Yr=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M6 15h14V9H6v6zm6-10.8v1.5h8V4.2h-8zm0 15.6h8v-1.5h-8v1.5z"})),Zr=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M5 4v11h14V4H5zm3 15.8h8v-1.5H8v1.5z"})),Qr={none:{icon:Kr,title:(0,h._x)("None","Alignment option")},left:{icon:qr,title:(0,h.__)("Align left")},center:{icon:Ar,title:(0,h.__)("Align center")},right:{icon:Yr,title:(0,h.__)("Align right")},wide:{icon:Dr,title:(0,h.__)("Wide width")},full:{icon:Zr,title:(0,h.__)("Full width")}},Xr={isAlternate:!0},Jr=function(e){let{value:t,onChange:n,controls:o,isToolbar:r,isCollapsed:l=!0}=e;const a=jr(o);if(!a.length)return null;function u(e){n([t,"none"].includes(e)?void 0:e)}const d=Qr[t],m=Qr.none,g=r?p.ToolbarGroup:p.ToolbarDropdownMenu,f={popoverProps:Xr,icon:d?d.icon:m.icon,label:(0,h.__)("Align"),toggleProps:{describedBy:(0,h.__)("Change alignment")}},v=r?{isCollapsed:l,controls:a.map((e=>{let{name:n}=e;return{...Qr[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}=Qr[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)(g,i({},f,v))},el=e=>(0,s.createElement)(Jr,i({},e,{isToolbar:!1})),tl=e=>(0,s.createElement)(Jr,i({},e,{isToolbar:!0})),nl=["left","center","right","wide","full"],ol=["wide","full"];function rl(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)?nl.filter((t=>e.includes(t))):!0===e?[...nl]:[],!o||!0===e&&!n?(0,u.without)(t,...ol):t}const ll=(0,d.createHigherOrderComponent)((e=>t=>{const{name:n}=t,o=jr(rl((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)(po,{group:"block",__experimentalShareWithChildBlocks:!0},(0,s.createElement)(el,{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"),il=(0,d.createHigherOrderComponent)((e=>t=>{const{name:n,attributes:o}=t,{align:l}=o,a=jr(rl((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:[...nl,""]}}),e})),(0,l.addFilter)("editor.BlockListBlock","core/editor/align/with-data-align",il),(0,l.addFilter)("editor.BlockEdit","core/editor/align/with-toolbar-controls",ll),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/align/addAssignedAlign",(function(e,t,n){const{align:o}=n;return rl((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 sl=/[\s#]/g,al={type:"string",source:"attribute",attribute:"id",selector:"*"},cl=(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,h.__)("HTML anchor"),help:(0,s.createElement)(s.Fragment,null,(0,h.__)("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,h.__)("https://wordpress.org/support/article/page-jumps/")},(0,h.__)("Learn more about anchors"))),value:t.attributes.anchor||"",placeholder:n?null:(0,h.__)("Add an anchor"),onChange:e=>{e=e.replace(sl,"-"),t.setAttributes({anchor:e})},autoCapitalize:"none",autoComplete:"off"});return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(e,t),n&&(0,s.createElement)(Go,{__experimentalGroup:"advanced"},o),!n&&"core/heading"===t.name&&(0,s.createElement)(Go,null,(0,s.createElement)(p.PanelBody,{title:(0,h.__)("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:al}),e})),(0,l.addFilter)("editor.BlockEdit","core/editor/anchor/with-inspector-control",cl),(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 ul={type:"string",source:"attribute",attribute:"aria-label",selector:"*"};(0,l.addFilter)("blocks.registerBlockType","core/ariaLabel/attribute",(function(e){var t,n;return null!=e&&null!==(t=e.attributes)&&void 0!==t&&null!==(n=t.ariaLabel)&&void 0!==n&&n.type||(0,r.hasBlockSupport)(e,"ariaLabel")&&(e.attributes={...e.attributes,ariaLabel:ul}),e})),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/ariaLabel/save-props",(function(e,t,n){return(0,r.hasBlockSupport)(t,"ariaLabel")&&(e["aria-label"]=""===n.ariaLabel?null:n.ariaLabel),e}));const dl=(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)(Go,{__experimentalGroup:"advanced"},(0,s.createElement)(p.TextControl,{autoComplete:"off",label:(0,h.__)("Additional CSS class(es)"),value:t.attributes.className||"",onChange:e=>{t.setAttributes({className:""!==e?e:void 0})},help:(0,h.__)("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",dl),(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 pl="var:";function ml(e,t,n,o){const r=(0,u.get)(e,n);return r?[{selector:null==t?void 0:t.selector,key:o,value:hl(r)}]:[]}function gl(e,t,n,o){let r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:["top","right","bottom","left"];const l=(0,u.get)(e,n);if(!l)return[];const i=[];if("string"==typeof l)i.push({selector:null==t?void 0:t.selector,key:o.default,value:l});else{const e=r.reduce(((e,n)=>{const r=hl((0,u.get)(l,[n]));return r&&e.push({selector:null==t?void 0:t.selector,key:null==o?void 0:o.individual.replace("%s",fl(n)),value:r}),e}),[]);i.push(...e)}return i}function hl(e){return"string"==typeof e&&e.startsWith(pl)?`var(--wp--${e.slice(pl.length).split("|").join("--")})`:e}function fl(e){let[t,...n]=e;return t.toUpperCase()+n.join("")}const vl={name:"radius",generate:(e,t)=>gl(e,t,["border","radius"],{default:"borderRadius",individual:"border%sRadius"},["topLeft","topRight","bottomLeft","bottomRight"])},bl=[{name:"color",generate:function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:["border","color"],o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"borderColor";return ml(e,t,n,o)}},{name:"style",generate:function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:["border","style"],o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"borderStyle";return ml(e,t,n,o)}},{name:"width",generate:function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:["border","width"],o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"borderWidth";return ml(e,t,n,o)}}],kl=e=>(t,n)=>{var o;const r=null==t||null===(o=t.border)||void 0===o?void 0:o[e];return r?bl.reduce(((o,l)=>{const i=l.name;if(r.hasOwnProperty(i)&&"function"==typeof l.generate){const r=`border${fl(e)}${fl(i)}`;o.push(...l.generate(t,n,["border",e,i],r))}return o}),[]):[]},_l={name:"borderTop",generate:kl("top")},yl={name:"borderRight",generate:kl("right")},El={name:"borderBottom",generate:kl("bottom")},Cl={name:"borderLeft",generate:kl("left")},Sl=[...bl,vl,_l,yl,El,Cl,{name:"text",generate:(e,t)=>ml(e,t,["color","text"],"color")},{name:"gradient",generate:(e,t)=>ml(e,t,["color","gradient"],"background")},{name:"background",generate:(e,t)=>ml(e,t,["color","background"],"backgroundColor")},{name:"margin",generate:(e,t)=>gl(e,t,["spacing","margin"],{default:"margin",individual:"margin%s"})},{name:"padding",generate:(e,t)=>gl(e,t,["spacing","padding"],{default:"padding",individual:"padding%s"})},{name:"fontSize",generate:(e,t)=>ml(e,t,["typography","fontSize"],"fontSize")},{name:"fontStyle",generate:(e,t)=>ml(e,t,["typography","fontStyle"],"fontStyle")},{name:"fontWeight",generate:(e,t)=>ml(e,t,["typography","fontWeight"],"fontWeight")},{name:"letterSpacing",generate:(e,t)=>ml(e,t,["typography","letterSpacing"],"letterSpacing")},{name:"letterSpacing",generate:(e,t)=>ml(e,t,["typography","lineHeight"],"lineHeight")},{name:"textDecoration",generate:(e,t)=>ml(e,t,["typography","textDecoration"],"textDecoration")},{name:"textTransform",generate:(e,t)=>ml(e,t,["typography","textTransform"],"textTransform")}];function wl(e,t){const n=[];return Sl.forEach((o=>{"function"==typeof o.generate&&n.push(...o.generate(e,t))})),n}const Bl=window.wp.dom,Il=(0,s.createContext)({});function xl(e){let{value:t,children:n}=e;const o=(0,s.useContext)(Il),r=(0,s.useMemo)((()=>({...o,...t})),[o,t]);return(0,s.createElement)(Il.Provider,{value:r,children:n})}const Tl=Il,Nl={},Pl=(0,p.withFilters)("editor.BlockEdit")((e=>{const{attributes:t={},name:n}=e,o=(0,r.getBlockType)(n),l=(0,s.useContext)(Tl),a=(0,s.useMemo)((()=>o&&o.usesContext?(0,u.pick)(l,o.usesContext):Nl),[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 Ll(e){const{name:t,isSelected:n,clientId:o}=e,r={name:t,isSelected:n,clientId:o};return(0,s.createElement)(ro,{value:(0,s.useMemo)((()=>r),Object.values(r))},(0,s.createElement)(Pl,e))}const Ml=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M11 13h2v-2h-2v2zm-6 0h2v-2H5v2zm12-2v2h2v-2h-2z"})),Rl=function(e){let{className:t,actions:n,children:o,secondaryActions:r}=e;return(0,s.createElement)("div",{style:{display:"contents",all:"initial"}},(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:Ml,label:(0,h.__)("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))))))))))};var Al=n(1973);function Dl(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,Bl.safeHTML)(o)))),(0,s.createElement)("div",{className:"block-editor-block-compare__action"},(0,s.createElement)(p.Button,{variant:"secondary",tabIndex:"0",onClick:r},l)))}const Ol=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,g=a,(0,Al.Kx)(m,g).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,g;return(0,s.createElement)("div",{className:"block-editor-block-compare__wrapper"},(0,s.createElement)(Dl,{title:(0,h.__)("Current"),className:"block-editor-block-compare__current",action:n,actionText:(0,h.__)("Convert to HTML"),rawContent:t.originalContent,renderedContent:t.originalContent}),(0,s.createElement)(Dl,{title:(0,h.__)("After Conversion"),className:"block-editor-block-compare__converted",action:o,actionText:i,rawContent:p,renderedContent:a}))},Fl=e=>(0,r.rawHandler)({HTML:e.originalContent}),zl=(0,d.compose)([(0,m.withSelect)(((e,t)=>{let{clientId:n}=t;return{block:e(to).getBlock(n)}})),(0,m.withDispatch)(((e,t)=>{let{block:n}=t;const{replaceBlock:o}=e(to);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,Fl(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)),[]),g=(0,s.useMemo)((()=>[{
8
  // translators: Button to fix block content
9
+ title:(0,h._x)("Resolve","imperative verb"),onClick:d},a&&{title:(0,h.__)("Convert to HTML"),onClick:t},{title:(0,h.__)("Convert to Classic Block"),onClick:o}].filter(Boolean)),[d,t,o]);return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(Rl,{actions:[(0,s.createElement)(p.Button,{key:"recover",onClick:l,variant:"primary"},(0,h.__)("Attempt Block Recovery"))],secondaryActions:g},(0,h.__)("This block contains unexpected or invalid content.")),c&&(0,s.createElement)(p.Modal,{title:// translators: Dialog title to fix block content
10
+ (0,h.__)("Resolve Block"),onRequestClose:m,className:"block-editor-block-compare"},(0,s.createElement)(Ol,{block:i,onKeep:t,onConvert:n,convertor:Fl,convertButtonText:(0,h.__)("Convert to Blocks")})))})),Vl=(0,s.createElement)(Rl,{className:"block-editor-block-list__block-crash-warning"},(0,h.__)("This block has encountered an error and cannot be previewed.")),Hl=()=>Vl;class Gl 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}}const Ul=Gl;var Wl=n(773);const $l=function(e){let{clientId:t}=e;const[n,o]=(0,s.useState)(""),l=(0,m.useSelect)((e=>e(to).getBlock(t)),[t]),{updateBlock:i}=(0,m.useDispatch)(to);return(0,s.useEffect)((()=>{o((0,r.getBlockContent)(l))}),[l]),(0,s.createElement)(Wl.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 jl=ai();const Kl=e=>ri(e,jl);let ql=ai();Kl.write=e=>ri(e,ql);let Yl=ai();Kl.onStart=e=>ri(e,Yl);let Zl=ai();Kl.onFrame=e=>ri(e,Zl);let Ql=ai();Kl.onFinish=e=>ri(e,Ql);let Xl=[];Kl.setTimeout=(e,t)=>{let n=Kl.now()+t,o=()=>{let e=Xl.findIndex((e=>e.cancel==o));~e&&Xl.splice(e,1),ni-=~e?1:0},r={time:n,handler:e,cancel:o};return Xl.splice(Jl(n),0,r),ni+=1,li(),r};let Jl=e=>~(~Xl.findIndex((t=>t.time>e))||~Xl.length);Kl.cancel=e=>{Yl.delete(e),Zl.delete(e),jl.delete(e),ql.delete(e),Ql.delete(e)},Kl.sync=e=>{oi=!0,Kl.batchedUpdates(e),oi=!1},Kl.throttle=e=>{let t;function n(){try{e(...t)}finally{t=null}}function o(...e){t=e,Kl.onStart(n)}return o.handler=e,o.cancel=()=>{Yl.delete(n),t=null},o};let ei="undefined"!=typeof window?window.requestAnimationFrame:()=>{};Kl.use=e=>ei=e,Kl.now="undefined"!=typeof performance?()=>performance.now():Date.now,Kl.batchedUpdates=e=>e(),Kl.catch=console.error,Kl.frameLoop="always",Kl.advance=()=>{"demand"!==Kl.frameLoop?console.warn("Cannot call the manual advancement of rafz whilst frameLoop is not set as demand"):si()};let ti=-1,ni=0,oi=!1;function ri(e,t){oi?(t.delete(e),e(0)):(t.add(e),li())}function li(){ti<0&&(ti=0,"demand"!==Kl.frameLoop&&ei(ii))}function ii(){~ti&&(ei(ii),Kl.batchedUpdates(si))}function si(){let e=ti;ti=Kl.now();let t=Jl(ti);t&&(ci(Xl.splice(0,t),(e=>e.handler())),ni-=t),Yl.flush(),jl.flush(e?Math.min(64,ti-e):16.667),Zl.flush(),ql.flush(),Ql.flush(),ni||(ti=-1)}function ai(){let e=new Set,t=e;return{add(n){ni+=t!=e||e.has(n)?0:1,e.add(n)},delete:n=>(ni-=t==e&&e.has(n)?1:0,e.delete(n)),flush(n){t.size&&(e=new Set,ni-=t.size,ci(t,(t=>t(n)&&e.add(t))),ni+=e.size,t=e)}}}function ci(e,t){e.forEach((e=>{try{t(e)}catch(e){Kl.catch(e)}}))}var ui=n(9196),di=n.n(ui);function pi(){}const mi={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 gi(e,t){if(mi.arr(e)){if(!mi.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 hi=(e,t)=>e.forEach(t);function fi(e,t,n){if(mi.arr(e))for(let o=0;o<e.length;o++)t.call(n,e[o],`${o}`);else for(const o in e)e.hasOwnProperty(o)&&t.call(n,e[o],o)}const vi=e=>mi.und(e)?[]:mi.arr(e)?e:[e];function bi(e,t){if(e.size){const n=Array.from(e);e.clear(),hi(n,t)}}const ki=(e,...t)=>bi(e,(e=>e(...t))),_i=()=>"undefined"==typeof window||!window.navigator||/ServerSideRendering|^Deno\//.test(window.navigator.userAgent);let yi,Ei,Ci=null,Si=!1,wi=pi;var Bi=Object.freeze({__proto__:null,get createStringInterpolator(){return yi},get to(){return Ei},get colors(){return Ci},get skipAnimation(){return Si},get willAdvance(){return wi},assign:e=>{e.to&&(Ei=e.to),e.now&&(Kl.now=e.now),void 0!==e.colors&&(Ci=e.colors),null!=e.skipAnimation&&(Si=e.skipAnimation),e.createStringInterpolator&&(yi=e.createStringInterpolator),e.requestAnimationFrame&&Kl.use(e.requestAnimationFrame),e.batchedUpdates&&(Kl.batchedUpdates=e.batchedUpdates),e.willAdvance&&(wi=e.willAdvance),e.frameLoop&&(Kl.frameLoop=e.frameLoop)}});const Ii=new Set;let xi=[],Ti=[],Ni=0;const Pi={get idle(){return!Ii.size&&!xi.length},start(e){Ni>e.priority?(Ii.add(e),Kl.onStart(Li)):(Mi(e),Kl(Ai))},advance:Ai,sort(e){if(Ni)Kl.onFrame((()=>Pi.sort(e)));else{const t=xi.indexOf(e);~t&&(xi.splice(t,1),Ri(e))}},clear(){xi=[],Ii.clear()}};function Li(){Ii.forEach(Mi),Ii.clear(),Kl(Ai)}function Mi(e){xi.includes(e)||Ri(e)}function Ri(e){xi.splice(function(t,n){const o=t.findIndex((t=>t.priority>e.priority));return o<0?t.length:o}(xi),0,e)}function Ai(e){const t=Ti;for(let n=0;n<xi.length;n++){const o=xi[n];Ni=o.priority,o.idle||(wi(o),o.advance(e),o.idle||t.push(o))}return Ni=0,Ti=xi,Ti.length=0,xi=t,xi.length>0}const Di="[-+]?\\d*\\.?\\d+",Oi=Di+"%";function Fi(...e){return"\\(\\s*("+e.join(")\\s*,\\s*(")+")\\s*\\)"}const zi=new RegExp("rgb"+Fi(Di,Di,Di)),Vi=new RegExp("rgba"+Fi(Di,Di,Di,Di)),Hi=new RegExp("hsl"+Fi(Di,Oi,Oi)),Gi=new RegExp("hsla"+Fi(Di,Oi,Oi,Di)),Ui=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,Wi=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,$i=/^#([0-9a-fA-F]{6})$/,ji=/^#([0-9a-fA-F]{8})$/;function Ki(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 qi(e,t,n){const o=n<.5?n*(1+t):n+t-n*t,r=2*n-o,l=Ki(r,o,e+1/3),i=Ki(r,o,e),s=Ki(r,o,e-1/3);return Math.round(255*l)<<24|Math.round(255*i)<<16|Math.round(255*s)<<8}function Yi(e){const t=parseInt(e,10);return t<0?0:t>255?255:t}function Zi(e){return(parseFloat(e)%360+360)%360/360}function Qi(e){const t=parseFloat(e);return t<0?0:t>1?255:Math.round(255*t)}function Xi(e){const t=parseFloat(e);return t<0?0:t>100?1:t/100}function Ji(e){let t=function(e){let t;return"number"==typeof e?e>>>0===e&&e>=0&&e<=4294967295?e:null:(t=$i.exec(e))?parseInt(t[1]+"ff",16)>>>0:Ci&&void 0!==Ci[e]?Ci[e]:(t=zi.exec(e))?(Yi(t[1])<<24|Yi(t[2])<<16|Yi(t[3])<<8|255)>>>0:(t=Vi.exec(e))?(Yi(t[1])<<24|Yi(t[2])<<16|Yi(t[3])<<8|Qi(t[4]))>>>0:(t=Ui.exec(e))?parseInt(t[1]+t[1]+t[2]+t[2]+t[3]+t[3]+"ff",16)>>>0:(t=ji.exec(e))?parseInt(t[1],16)>>>0:(t=Wi.exec(e))?parseInt(t[1]+t[1]+t[2]+t[2]+t[3]+t[3]+t[4]+t[4],16)>>>0:(t=Hi.exec(e))?(255|qi(Zi(t[1]),Xi(t[2]),Xi(t[3])))>>>0:(t=Gi.exec(e))?(qi(Zi(t[1]),Xi(t[2]),Xi(t[3]))|Qi(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 es=(e,t,n)=>{if(mi.fun(e))return e;if(mi.arr(e))return es({range:e,output:t,extrapolate:n});if(mi.str(e.output[0]))return yi(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 ts(){return(ts=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 ns=Symbol.for("FluidValue.get"),os=Symbol.for("FluidValue.observers"),rs=e=>Boolean(e&&e[ns]),ls=e=>e&&e[ns]?e[ns]():e,is=e=>e[os]||null;function ss(e,t){let n=e[os];n&&n.forEach((e=>{!function(e,t){e.eventObserved?e.eventObserved(t):e(t)}(e,t)}))}class as{constructor(e){if(this[ns]=void 0,this[os]=void 0,!e&&!(e=this.get))throw Error("Unknown getter");cs(this,e)}}const cs=(e,t)=>ps(e,ns,t);function us(e,t){if(e[ns]){let n=e[os];n||ps(e,os,n=new Set),n.has(t)||(n.add(t),e.observerAdded&&e.observerAdded(n.size,t))}return t}function ds(e,t){let n=e[os];if(n&&n.has(t)){const o=n.size-1;o?n.delete(t):e[os]=null,e.observerRemoved&&e.observerRemoved(o,t)}}const ps=(e,t,n)=>Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0}),ms=/[+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,gs=/(#(?:[0-9a-f]{2}){2,4}|(#[0-9a-f]{3})|(rgb|hsl)a?\((-?\d+%?[,\s]+){2,3}\s*[\d\.]+%?\))/gi,hs=new RegExp(`(${ms.source})(%|[a-z]+)`,"i"),fs=/rgba\(([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+)\)/gi,vs=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/,bs=e=>{const[t,n]=ks(e);if(!t||_i())return e;const o=window.getComputedStyle(document.documentElement).getPropertyValue(t);if(o)return o.trim();if(n&&n.startsWith("--")){return window.getComputedStyle(document.documentElement).getPropertyValue(n)||e}return n&&vs.test(n)?bs(n):n||e},ks=e=>{const t=vs.exec(e);if(!t)return[,];const[,n,o]=t;return[n,o]};let _s;const ys=(e,t,n,o,r)=>`rgba(${Math.round(t)}, ${Math.round(n)}, ${Math.round(o)}, ${r})`,Es=e=>{_s||(_s=Ci?new RegExp(`(${Object.keys(Ci).join("|")})(?!\\w)`,"g"):/^\b$/);const t=e.output.map((e=>ls(e).replace(vs,bs).replace(gs,Ji).replace(_s,Ji))),n=t.map((e=>e.match(ms).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=>es(ts({},e,{output:t}))));return e=>{var n;const r=!hs.test(t[0])&&(null==(n=t.find((e=>hs.test(e))))?void 0:n.replace(ms,""));let l=0;return t[0].replace(ms,(()=>`${o[l++](e)}${r||""}`)).replace(fs,ys)}},Cs="react-spring: ",Ss=e=>{const t=e;let n=!1;if("function"!=typeof t)throw new TypeError(`${Cs}once requires a function parameter`);return(...e)=>{n||(t(...e),n=!0)}},ws=Ss(console.warn),Bs=Ss(console.warn);function Is(e){return mi.str(e)&&("#"==e[0]||/\d/.test(e)||!_i()&&vs.test(e)||e in(Ci||{}))}const xs="undefined"!=typeof window&&window.document&&window.document.createElement?ui.useLayoutEffect:ui.useEffect;function Ts(){const e=(0,ui.useState)()[1],t=(()=>{const e=(0,ui.useRef)(!1);return xs((()=>(e.current=!0,()=>{e.current=!1})),[]),e})();return()=>{t.current&&e(Math.random())}}const Ns=e=>(0,ui.useEffect)(e,Ps),Ps=[];function Ls(e){const t=(0,ui.useRef)();return(0,ui.useEffect)((()=>{t.current=e})),t.current}const Ms=Symbol.for("Animated:node"),Rs=e=>e&&e[Ms],As=(e,t)=>{return n=e,o=Ms,r=t,Object.defineProperty(n,o,{value:r,writable:!0,configurable:!0});var n,o,r},Ds=e=>e&&e[Ms]&&e[Ms].getPayload();class Os{constructor(){this.payload=void 0,As(this,this)}getPayload(){return this.payload||[]}}class Fs extends Os{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,mi.num(this._value)&&(this.lastPosition=this._value)}static create(e){return new Fs(e)}getPayload(){return[this]}getValue(){return this._value}setValue(e,t){return mi.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,mi.num(this._value)&&(this.elapsedTime=0,this.durationProgress=0,this.lastPosition=this._value,e&&(this.lastVelocity=null),this.v0=null)}}class zs extends Fs{constructor(e){super(0),this._string=null,this._toString=void 0,this._toString=es({output:[e,e]})}static create(e){return new zs(e)}getValue(){let e=this._string;return null==e?this._string=this._toString(this._value):e}setValue(e){if(mi.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=es({output:[this.getValue(),e]})),this._value=0,super.reset()}}const Vs={dependencies:null};class Hs extends Os{constructor(e){super(),this.source=e,this.setValue(e)}getValue(e){const t={};return fi(this.source,((n,o)=>{var r;(r=n)&&r[Ms]===r?t[o]=n.getValue(e):rs(n)?t[o]=ls(n):e||(t[o]=n)})),t}setValue(e){this.source=e,this.payload=this._makePayload(e)}reset(){this.payload&&hi(this.payload,(e=>e.reset()))}_makePayload(e){if(e){const t=new Set;return fi(e,this._addToPayload,t),Array.from(t)}}_addToPayload(e){Vs.dependencies&&rs(e)&&Vs.dependencies.add(e);const t=Ds(e);t&&hi(t,(e=>this.add(e)))}}class Gs extends Hs{constructor(e){super(e)}static create(e){return new Gs(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(Us)),!0)}}function Us(e){return(Is(e)?zs:Fs).create(e)}function Ws(e){const t=Rs(e);return t?t.constructor:mi.arr(e)?Gs:Is(e)?zs:Fs}function $s(){return($s=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 js=(e,t)=>{const n=!mi.fun(e)||e.prototype&&e.prototype.isReactComponent;return(0,ui.forwardRef)(((o,r)=>{const l=(0,ui.useRef)(null),i=n&&(0,ui.useCallback)((e=>{l.current=function(e,t){return e&&(mi.fun(e)?e(t):e.current=t),t}(r,e)}),[r]),[s,a]=function(e,t){const n=new Set;return Vs.dependencies=n,e.style&&(e=$s({},e,{style:t.createAnimatedStyle(e.style)})),e=new Hs(e),Vs.dependencies=null,[e,n]}(o,t),c=Ts(),u=()=>{const e=l.current;n&&!e||!1===(!!e&&t.applyAnimatedValues(e,s.getValue(!0)))&&c()},d=new Ks(u,a),p=(0,ui.useRef)();xs((()=>(p.current=d,hi(a,(e=>us(e,d))),()=>{p.current&&(hi(p.current.deps,(e=>ds(e,p.current))),Kl.cancel(p.current.update))}))),(0,ui.useEffect)(u,[]),Ns((()=>()=>{const e=p.current;hi(e.deps,(t=>ds(t,e)))}));const m=t.getComponentProps(s.getValue());return ui.createElement(e,$s({},m,{ref:i}))}))};class Ks{constructor(e,t){this.update=e,this.deps=t}eventObserved(e){"change"==e.type&&Kl.write(this.update)}}const qs=Symbol.for("AnimatedComponent"),Ys=e=>mi.str(e)?e:e&&mi.str(e.displayName)?e.displayName:mi.fun(e)&&e.name||null;function Zs(){return(Zs=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 Qs(e,...t){return mi.fun(e)?e(...t):e}const Xs=(e,t)=>!0===e||!!(t&&e&&(mi.fun(e)?e(t):vi(e).includes(t))),Js=(e,t)=>mi.obj(e)?t&&e[t]:e,ea=(e,t)=>!0===e.default?e[t]:e.default?e.default[t]:void 0,ta=e=>e,na=(e,t=ta)=>{let n=oa;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);mi.und(n)||(o[r]=n)}return o},oa=["config","onProps","onStart","onChange","onPause","onResume","onRest"],ra={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 la(e){const t=function(e){const t={};let n=0;if(fi(e,((e,o)=>{ra[o]||(t[o]=e,n++)})),n)return t}(e);if(t){const n={to:t};return fi(e,((e,o)=>o in t||(n[o]=e))),n}return Zs({},e)}function ia(e){return e=ls(e),mi.arr(e)?e.map(ia):Is(e)?Bi.createStringInterpolator({range:[0,1],output:[e,e]})(1):e}function sa(e){for(const t in e)return!0;return!1}function aa(e){return mi.fun(e)||mi.arr(e)&&mi.obj(e[0])}function ca(e,t){var n;null==(n=e.ref)||n.delete(e),null==t||t.delete(e)}function ua(e,t){var n;t&&e.ref!==t&&(null==(n=e.ref)||n.delete(e),t.add(e),e.ref=t)}Math.PI,Math.PI;const da=Zs({},{tension:170,friction:26},{mass:1,damping:1,easing:e=>e,clamp:!1});class pa{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,da)}}function ma(e,t){if(mi.und(t.decay)){const n=!mi.und(t.tension)||!mi.und(t.friction);!n&&mi.und(t.frequency)&&mi.und(t.damping)&&mi.und(t.mass)||(e.duration=void 0,e.decay=void 0),n&&(e.frequency=void 0)}else e.duration=void 0}const ga=[];class ha{constructor(){this.changed=!1,this.values=ga,this.toValues=null,this.fromValues=ga,this.to=void 0,this.from=void 0,this.config=new pa,this.immediate=!1}}function fa(e,{key:t,props:n,defaultProps:o,state:r,actions:l}){return new Promise(((i,s)=>{var a;let c,u,d=Xs(null!=(a=n.cancel)?a:null==o?void 0:o.cancel,t);if(d)g();else{mi.und(n.pause)||(r.paused=Xs(n.pause,t));let e=null==o?void 0:o.pause;!0!==e&&(e=r.paused||Xs(e,t)),c=Qs(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-Kl.now()}function m(){c>0&&!Bi.skipAnimation?(r.delayed=!0,u=Kl.setTimeout(g,c),r.pauseQueue.add(p),r.timeouts.add(u)):g()}function g(){r.delayed&&(r.delayed=!1),r.pauseQueue.delete(p),r.timeouts.delete(u),e<=(r.cancelId||0)&&(d=!0);try{l.start(Zs({},n,{callId:e,cancel:d}),i)}catch(e){s(e)}}}))}const va=(e,t)=>1==t.length?t[0]:t.some((e=>e.cancelled))?_a(e.get()):t.every((e=>e.noop))?ba(e.get()):ka(e.get(),t.every((e=>e.finished))),ba=e=>({value:e,noop:!0,finished:!0,cancelled:!1}),ka=(e,t,n=!1)=>({value:e,finished:t,cancelled:n}),_a=e=>({value:e,cancelled:!0,finished:!1});function ya(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=na(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)&&_a(o)||r!==n.asyncId&&ka(o,!1);if(t)throw e.result=t,d(e),e},g=(e,t)=>{const l=new Ca,i=new Sa;return(async()=>{if(Bi.skipAnimation)throw Ea(n),i.result=ka(o,!1),d(i),i;m(l);const s=mi.obj(e)?Zs({},e):Zs({},t,{to:e});s.parentId=r,fi(c,((e,t)=>{mi.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 h;if(Bi.skipAnimation)return Ea(n),ka(o,!1);try{let t;t=mi.arr(e)?(async e=>{for(const t of e)await g(t)})(e):Promise.resolve(e(g,o.stop.bind(o))),await Promise.all([t.then(u),p]),h=ka(o.get(),!0,!1)}catch(e){if(e instanceof Ca)h=e.result;else{if(!(e instanceof Sa))throw e;h=e.result}}finally{r==n.asyncId&&(n.asyncId=l,n.asyncTo=l?s:void 0,n.promise=l?a:void 0)}return mi.fun(i)&&Kl.batchedUpdates((()=>{i(h,o,o.item)})),h})():a}function Ea(e,t){bi(e.timeouts,(e=>e.cancel())),e.pauseQueue.clear(),e.resumeQueue.clear(),e.asyncId=e.asyncTo=e.promise=void 0,t&&(e.cancelId=t)}class Ca 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 Sa extends Error{constructor(){super("SkipAnimationSignal"),this.result=void 0}}const wa=e=>e instanceof Ia;let Ba=1;class Ia extends as{constructor(...e){super(...e),this.id=Ba++,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=Rs(this);return e&&e.getValue()}to(...e){return Bi.to(this,e)}interpolate(...e){return ws(`${Cs}The "interpolate" function is deprecated in v9 (use "to" instead)`),Bi.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){ss(this,{type:"change",parent:this,value:e,idle:t})}_onPriorityChange(e){this.idle||Pi.sort(this),ss(this,{type:"priority",parent:this,priority:e})}}const xa=Symbol.for("SpringPhase"),Ta=e=>(1&e[xa])>0,Na=e=>(2&e[xa])>0,Pa=e=>(4&e[xa])>0,La=(e,t)=>t?e[xa]|=3:e[xa]&=-3,Ma=(e,t)=>t?e[xa]|=4:e[xa]&=-5;class Ra extends Ia{constructor(e,t){if(super(),this.key=void 0,this.animation=new ha,this.queue=void 0,this.defaultProps={},this._state={paused:!1,delayed:!1,pauseQueue:new Set,resumeQueue:new Set,timeouts:new Set},this._pendingCalls=new Set,this._lastCallId=0,this._lastToId=0,this._memoizedDuration=0,!mi.und(e)||!mi.und(t)){const n=mi.obj(e)?Zs({},e):Zs({},t,{from:e});mi.und(n.default)&&(n.default=!0),this.start(n)}}get idle(){return!(Na(this)||this._state.asyncTo)||Pa(this)}get goal(){return ls(this.animation.to)}get velocity(){const e=Rs(this);return e instanceof Fs?e.lastVelocity||0:e.getPayload().map((e=>e.lastVelocity||0))}get hasAnimated(){return Ta(this)}get isAnimating(){return Na(this)}get isPaused(){return Pa(this)}get isDelayed(){return this._state.delayed}advance(e){let t=!0,n=!1;const o=this.animation;let{config:r,toValues:l}=o;const i=Ds(o.to);!i&&rs(o.to)&&(l=vi(ls(o.to))),o.values.forEach(((s,a)=>{if(s.done)return;const c=s.constructor==zs?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=mi.arr(r.velocity)?r.velocity[a]:r.velocity;let i;if(mi.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=!mi.und(a),m=n==c?s.v0>0:n<c;let g,h=!1;const f=1,v=Math.ceil(e/f);for(let e=0;e<v&&(g=Math.abs(i)>o,g||(u=Math.abs(c-d)<=t,!u));++e)p&&(h=d==c||d>c==m,h&&(i=-i*a,d=c)),i+=(1e-6*-r.tension*(d-c)+.001*-r.friction*i)/r.mass*f,d+=i*f}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=Rs(this),a=s.getValue();if(t){const e=ls(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 Kl.batchedUpdates((()=>{this._stop(),this._focus(e),this._set(e)})),this}pause(){this._update({pause:!0})}resume(){this._update({pause:!1})}finish(){if(Na(this)){const{to:e,config:t}=this.animation;Kl.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 mi.und(e)?(n=this.queue||[],this.queue=[]):n=[mi.obj(e)?e:Zs({},t,{to:e})],Promise.all(n.map((e=>this._update(e)))).then((e=>va(this,e)))}stop(e){const{to:t}=this.animation;return this._focus(this.get()),Ea(this._state,e&&this._lastCallId),Kl.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=mi.obj(n)?n[t]:n,(null==n||aa(n))&&(n=void 0),o=mi.obj(o)?o[t]:o,null==o&&(o=void 0);const r={to:n,from:o};return Ta(this)||(e.reverse&&([n,o]=[o,n]),o=ls(o),mi.und(o)?Rs(this)||this._set(n):this._set(o)),r}_update(e,t){let n=Zs({},e);const{key:o,defaultProps:r}=this;n.default&&Object.assign(r,na(n,((e,t)=>/^on/.test(t)?Js(e,o):e))),Ha(this,n,"onProps"),Ga(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 fa(++this._lastCallId,{key:o,props:n,defaultProps:r,state:i,actions:{pause:()=>{Pa(this)||(Ma(this,!0),ki(i.pauseQueue),Ga(this,"onPause",ka(this,Aa(this,this.animation.to)),this))},resume:()=>{Pa(this)&&(Ma(this,!1),Na(this)&&this._resume(),ki(i.resumeQueue),Ga(this,"onResume",ka(this,Aa(this,this.animation.to)),this))},start:this._merge.bind(this,l)}}).then((e=>{if(n.loop&&e.finished&&(!t||!e.noop)){const e=Da(n);if(e)return this._update(e,!0)}return e}))}_merge(e,t,n){if(t.cancel)return this.stop(!0),n(_a(this));const o=!mi.und(e.to),r=!mi.und(e.from);if(o||r){if(!(t.callId>this._lastToId))return n(_a(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&&!mi.und(u)||(u=d),t.reverse&&([u,d]=[d,u]);const p=!gi(d,c);p&&(s.from=d),d=ls(d);const m=!gi(u,a);m&&this._focus(u);const g=aa(t.to),{config:h}=s,{decay:f,velocity:v}=h;(o||r)&&(h.velocity=0),t.config&&!g&&function(e,t,n){n&&(ma(n=Zs({},n),t),t=Zs({},n,t)),ma(e,t),Object.assign(e,t);for(const t in da)null==e[t]&&(e[t]=da[t]);let{mass:o,frequency:r,damping:l}=e;mi.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)}(h,Qs(t.config,l),t.config!==i.config?Qs(i.config,l):void 0);let b=Rs(this);if(!b||mi.und(u))return n(ka(this,!0));const k=mi.und(t.reset)?r&&!t.default:!mi.und(d)&&Xs(t.reset,l),_=k?d:this.get(),y=ia(u),E=mi.num(y)||mi.arr(y)||Is(y),C=!g&&(!E||Xs(i.immediate||t.immediate,l));if(m){const e=Ws(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=rs(u),B=!1;if(!w){const e=k||!Ta(this)&&p;(m||e)&&(B=gi(ia(_),y),w=!B),(gi(s.immediate,C)||C)&&gi(h.decay,f)&&gi(h.velocity,v)||(w=!0)}if(B&&Na(this)&&(s.changed&&!k?w=!0:w||this._stop(a)),!g&&((w||rs(a))&&(s.values=b.getPayload(),s.toValues=rs(u)?null:S==zs?[1]:vi(y)),s.immediate!=C&&(s.immediate=C,C||k||this._set(a)),w)){const{onRest:e}=s;hi(Va,(e=>Ha(this,t,e)));const o=ka(this,Aa(this,a));ki(this._pendingCalls,o),this._pendingCalls.add(n),s.changed&&Kl.batchedUpdates((()=>{s.changed=!k,null==e||e(o,this),k?Qs(i.onRest,o):null==s.onStart||s.onStart(o,this)}))}k&&this._set(_),g?n(ya(t.to,t,this._state,this)):w?this._start():Na(this)&&!m?this._pendingCalls.add(n):n(ba(_))}_focus(e){const t=this.animation;e!==t.to&&(is(this)&&this._detach(),t.to=e,is(this)&&this._attach())}_attach(){let e=0;const{to:t}=this.animation;rs(t)&&(us(t,this),wa(t)&&(e=t.priority+1)),this.priority=e}_detach(){const{to:e}=this.animation;rs(e)&&ds(e,this)}_set(e,t=!0){const n=ls(e);if(!mi.und(n)){const e=Rs(this);if(!e||!gi(n,e.getValue())){const o=Ws(n);e&&e.constructor==o?e.setValue(n):As(this,o.create(n)),e&&Kl.batchedUpdates((()=>{this._onChange(n,t)}))}}return Rs(this)}_onStart(){const e=this.animation;e.changed||(e.changed=!0,Ga(this,"onStart",ka(this,Aa(this,e.to)),this))}_onChange(e,t){t||(this._onStart(),Qs(this.animation.onChange,e,this)),Qs(this.defaultProps.onChange,e,this),super._onChange(e,t)}_start(){const e=this.animation;Rs(this).reset(ls(e.to)),e.immediate||(e.fromValues=e.values.map((e=>e.lastPosition))),Na(this)||(La(this,!0),Pa(this)||this._resume())}_resume(){Bi.skipAnimation?this.finish():Pi.start(this)}_stop(e,t){if(Na(this)){La(this,!1);const n=this.animation;hi(n.values,(e=>{e.done=!0})),n.toValues&&(n.onChange=n.onPause=n.onResume=void 0),ss(this,{type:"idle",parent:this});const o=t?_a(this.get()):ka(this.get(),Aa(this,null!=e?e:n.to));ki(this._pendingCalls,o),n.changed&&(n.changed=!1,Ga(this,"onRest",o,this))}}}function Aa(e,t){const n=ia(t);return gi(ia(e.get()),n)}function Da(e,t=e.loop,n=e.to){let o=Qs(t);if(o){const r=!0!==o&&la(o),l=(r||e).reverse,i=!r||r.reset;return Oa(Zs({},e,{loop:t,default:!1,pause:void 0,to:!l||aa(n)?n:void 0,from:i?e.from:void 0,reset:i},r))}}function Oa(e){const{to:t,from:n}=e=la(e),o=new Set;return mi.obj(t)&&za(t,o),mi.obj(n)&&za(n,o),e.keys=o.size?Array.from(o):null,e}function Fa(e){const t=Oa(e);return mi.und(t.default)&&(t.default=na(t)),t}function za(e,t){fi(e,((e,n)=>null!=e&&t.add(n)))}const Va=["onStart","onRest","onChange","onPause","onResume"];function Ha(e,t,n){e.animation[n]=t[n]!==ea(t,n)?Js(t[n],e.key):void 0}function Ga(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 Ua=["onStart","onChange","onRest"];let Wa=1;class $a{constructor(e,t){this.id=Wa++,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(Zs({default:!0},e))}get idle(){return!this._state.asyncTo&&Object.values(this.springs).every((e=>e.idle&&!e.isDelayed&&!e.isPaused))}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];mi.und(n)||this.springs[t].set(n)}}update(e){return e&&this.queue.push(Oa(e)),this}start(e){let{queue:t}=this;return e?t=vi(e).map(Oa):this.queue=[],this._flush?this._flush(this,t):(Xa(this,t),ja(this,t))}stop(e,t){if(e!==!!e&&(t=e),t){const n=this.springs;hi(vi(t),(t=>n[t].stop(!!e)))}else Ea(this._state,this._lastAsyncId),this.each((t=>t.stop(!!e)));return this}pause(e){if(mi.und(e))this.start({pause:!0});else{const t=this.springs;hi(vi(e),(e=>t[e].pause()))}return this}resume(e){if(mi.und(e))this.start({pause:!1});else{const t=this.springs;hi(vi(e),(e=>t[e].resume()))}return this}each(e){fi(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,bi(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&&bi(t,(([e,t])=>{t.value=i,e(t,this,this._item)})),l&&(this._started=!1,bi(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)}Kl.onFrame(this._onFrame)}}function ja(e,t){return Promise.all(t.map((t=>Ka(e,t)))).then((t=>va(e,t)))}async function Ka(e,t,n){const{keys:o,to:r,from:l,loop:i,onRest:s,onResolve:a}=t,c=mi.obj(t.default)&&t.default;i&&(t.loop=!1),!1===r&&(t.to=null),!1===l&&(t.from=null);const u=mi.arr(r)||mi.fun(r)?r:void 0;u?(t.to=void 0,t.onRest=void 0,c&&(c.onRest=void 0)):hi(Ua,(n=>{const o=t[n];if(mi.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,ki(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===ea(t,"cancel");(u||m&&d.asyncId)&&p.push(fa(++e._lastAsyncId,{props:t,state:d,actions:{pause:pi,resume:pi,start(t,n){m?(Ea(d,e._lastAsyncId),n(_a(e))):(t.onRest=s,n(ya(u,t,d,e)))}}})),d.paused&&await new Promise((e=>{d.resumeQueue.add(e)}));const g=va(e,await Promise.all(p));if(i&&g.finished&&(!n||!g.noop)){const n=Da(t,i,r);if(n)return Xa(e,[n]),Ka(e,n,!0)}return a&&Kl.batchedUpdates((()=>a(g,e,e.item))),g}function qa(e,t){const n=Zs({},e.springs);return t&&hi(vi(t),(e=>{mi.und(e.keys)&&(e=Oa(e)),mi.obj(e.to)||(e=Zs({},e,{to:void 0})),Qa(n,e,(e=>Za(e)))})),Ya(e,n),n}function Ya(e,t){fi(t,((t,n)=>{e.springs[n]||(e.springs[n]=t,us(t,e))}))}function Za(e,t){const n=new Ra;return n.key=e,t&&us(n,t),n}function Qa(e,t,n){t.keys&&hi(t.keys,(o=>{(e[o]||(e[o]=n(o)))._prepareNode(t)}))}function Xa(e,t){hi(t,(t=>{Qa(e.springs,t,(t=>Za(t,e)))}))}const Ja=["children"],ec=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,Ja);const o=(0,ui.useContext)(tc),r=n.pause||!!o.pause,l=n.immediate||!!o.immediate;n=function(e,t){const[n]=(0,ui.useState)((()=>({inputs:t,result:e()}))),o=(0,ui.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,ui.useEffect)((()=>{o.current=l,r==n&&(n.inputs=n.result=void 0)}),[l]),l.result}((()=>({pause:r,immediate:l})),[r,l]);const{Provider:i}=tc;return ui.createElement(i,{value:n},t)},tc=(nc=ec,oc={},Object.assign(nc,ui.createContext(oc)),nc.Provider._context=nc,nc.Consumer._context=nc,nc);var nc,oc;ec.Provider=tc.Provider,ec.Consumer=tc.Consumer;const rc=()=>{const e=[],t=function(t){Bs(`${Cs}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 hi(e,((e,r)=>{if(mi.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 hi(e,(e=>e.pause(...arguments))),this},t.resume=function(){return hi(e,(e=>e.resume(...arguments))),this},t.set=function(t){hi(e,(e=>e.set(t)))},t.start=function(t){const n=[];return hi(e,((e,o)=>{if(mi.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 hi(e,(e=>e.stop(...arguments))),this},t.update=function(t){return hi(e,((e,n)=>e.update(this._getProps(t,e,n)))),this};const n=function(e,t,n){return mi.fun(e)?e(n,t):e};return t._getProps=n,t};function lc(e,t,n){const o=mi.fun(t)&&t;o&&!n&&(n=[]);const r=(0,ui.useMemo)((()=>o||3==arguments.length?rc():void 0),[]),l=(0,ui.useRef)(0),i=Ts(),s=(0,ui.useMemo)((()=>({ctrls:[],queue:[],flush(e,t){const n=qa(e,t);return l.current>0&&!s.queue.length&&!Object.keys(n).some((t=>!e.springs[t]))?ja(e,t):new Promise((o=>{Ya(e,n),s.queue.push((()=>{o(ja(e,t))})),i()}))}})),[]),a=(0,ui.useRef)([...s.ctrls]),c=[],u=Ls(e)||0;function d(e,n){for(let r=e;r<n;r++){const e=a.current[r]||(a.current[r]=new $a(null,s.flush)),n=o?o(r,e):t[r];n&&(c[r]=Fa(n))}}(0,ui.useMemo)((()=>{hi(a.current.slice(e,u),(e=>{ca(e,r),e.stop(!0)})),a.current.length=e,d(u,e)}),[e]),(0,ui.useMemo)((()=>{d(0,Math.min(u,e))}),n);const p=a.current.map(((e,t)=>qa(e,c[t]))),m=(0,ui.useContext)(ec),g=Ls(m),h=m!==g&&sa(m);xs((()=>{l.current++,s.ctrls=a.current;const{queue:e}=s;e.length&&(s.queue=[],hi(e,(e=>e()))),hi(a.current,((e,t)=>{null==r||r.add(e),h&&e.start({default:m});const n=c[t];n&&(ua(e,n.ref),e.ref?e.queue.push(n):e.start(n))}))})),Ns((()=>()=>{hi(s.ctrls,(e=>e.stop(!0)))}));const f=p.map((e=>Zs({},e)));return r?[f,r]:f}let ic;!function(e){e.MOUNT="mount",e.ENTER="enter",e.UPDATE="update",e.LEAVE="leave"}(ic||(ic={}));class sc extends Ia{constructor(e,t){super(),this.key=void 0,this.idle=!0,this.calc=void 0,this._active=new Set,this.source=e,this.calc=es(...t);const n=this._get(),o=Ws(n);As(this,o.create(n))}advance(e){const t=this._get();gi(t,this.get())||(Rs(this).setValue(t),this._onChange(t,this.idle)),!this.idle&&cc(this._active)&&uc(this)}_get(){const e=mi.arr(this.source)?this.source.map(ls):vi(ls(this.source));return this.calc(...e)}_start(){this.idle&&!cc(this._active)&&(this.idle=!1,hi(Ds(this),(e=>{e.done=!1})),Bi.skipAnimation?(Kl.batchedUpdates((()=>this.advance())),uc(this)):Pi.start(this))}_attach(){let e=1;hi(vi(this.source),(t=>{rs(t)&&us(t,this),wa(t)&&(t.idle||this._active.add(t),e=Math.max(e,t.priority+1))})),this.priority=e,this._start()}_detach(){hi(vi(this.source),(e=>{rs(e)&&ds(e,this)})),this._active.clear(),uc(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=vi(this.source).reduce(((e,t)=>Math.max(e,(wa(t)?t.priority:0)+1)),0))}}function ac(e){return!1!==e.idle}function cc(e){return!e.size||Array.from(e).every(ac)}function uc(e){e.idle||(e.idle=!0,hi(Ds(e),(e=>{e.done=!0})),ss(e,{type:"idle",parent:e}))}Bi.assign({createStringInterpolator:Es,to:(e,t)=>new sc(e,t)}),Pi.advance;const dc=window.ReactDOM;function pc(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 mc=["style","children","scrollTop","scrollLeft"],gc=/^--/;function hc(e,t){return null==t||"boolean"==typeof t||""===t?"":"number"!=typeof t||0===t||gc.test(e)||vc.hasOwnProperty(e)&&vc[e]?(""+t).trim():t+"px"}const fc={};let vc={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 bc=["Webkit","Ms","Moz","O"];vc=Object.keys(vc).reduce(((e,t)=>(bc.forEach((n=>e[((e,t)=>e+t.charAt(0).toUpperCase()+t.substring(1))(n,t)]=e[t])),e)),vc);const kc=["x","y","z"],_c=/^(matrix|translate|scale|rotate|skew)/,yc=/^(translate)/,Ec=/^(rotate|skew)/,Cc=(e,t)=>mi.num(e)&&0!==e?e+t:e,Sc=(e,t)=>mi.arr(e)?e.every((e=>Sc(e,t))):mi.num(e)?e===t:parseFloat(e)===t;class wc extends Hs{constructor(e){let{x:t,y:n,z:o}=e,r=pc(e,kc);const l=[],i=[];(t||n||o)&&(l.push([t||0,n||0,o||0]),i.push((e=>[`translate3d(${e.map((e=>Cc(e,"px"))).join(",")})`,Sc(e,0)]))),fi(r,((e,t)=>{if("transform"===t)l.push([e||""]),i.push((e=>[e,""===e]));else if(_c.test(t)){if(delete r[t],mi.und(e))return;const n=yc.test(t)?"px":Ec.test(t)?"deg":"";l.push(vi(e)),i.push("rotate3d"===t?([e,t,o,r])=>[`rotate3d(${e},${t},${o},${Cc(r,n)})`,Sc(r,0)]:e=>[`${t}(${e.map((e=>Cc(e,n))).join(",")})`,Sc(e,t.startsWith("scale")?1:0)])}})),l.length&&(r.transform=new Bc(l,i)),super(r)}}class Bc extends as{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 hi(this.inputs,((n,o)=>{const r=ls(n[0]),[l,i]=this.transforms[o](mi.arr(r)?r:n.map(ls));e+=" "+l,t=t&&i})),t?"none":e}observerAdded(e){1==e&&hi(this.inputs,(e=>hi(e,(e=>rs(e)&&us(e,this)))))}observerRemoved(e){0==e&&hi(this.inputs,(e=>hi(e,(e=>rs(e)&&ds(e,this)))))}eventObserved(e){"change"==e.type&&(this._value=null),ss(this,e)}}const Ic=["scrollTop","scrollLeft"];Bi.assign({batchedUpdates:dc.unstable_batchedUpdates,createStringInterpolator:Es,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 xc=((e,{applyAnimatedValues:t=(()=>!1),createAnimatedStyle:n=(e=>new Hs(e)),getComponentProps:o=(e=>e)}={})=>{const r={applyAnimatedValues:t,createAnimatedStyle:n,getComponentProps:o},l=e=>{const t=Ys(e)||"Anonymous";return(e=mi.str(e)?l[e]||(l[e]=js(e,r)):e[qs]||(e[qs]=js(e,r))).displayName=`Animated(${t})`,e};return fi(e,((t,n)=>{mi.arr(e)&&(n=Ys(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=pc(o,mc),c=Object.values(a),u=Object.keys(a).map((t=>n||e.hasAttribute(t)?t:fc[t]||(fc[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=hc(t,r[t]);gc.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 wc(e),getComponentProps:e=>pc(e,Ic)}).animated,Tc=e=>e+1,Nc=e=>({top:e.offsetTop,left:e.offsetLeft}),Pc=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)(Tc,0),[u,p]=(0,s.useReducer)(Tc,0),[m,g]=(0,s.useState)({x:0,y:0}),h=(0,s.useMemo)((()=>l.current?Nc(l.current):null),[r]),f=(0,s.useMemo)((()=>{if(!n||!l.current)return()=>{};const e=(0,Bl.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",f()}({x:o,y:r}),v.x=o,v.y=r)}return(0,s.useLayoutEffect)((()=>{a&&p()}),[a]),(0,s.useLayoutEffect)((()=>{if(!h)return;if(i)return void f();l.current.style.transform="";const e=Nc(l.current);c(),g({x:Math.round(h.left-e.left),y:Math.round(h.top-e.top)})}),[r]),v.x=0,v.y=0,function(e,t){const n=mi.fun(e),[[o],r]=lc(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},Lc=".block-editor-block-list__block",Mc=".block-list-appender",Rc=".block-editor-button-block-appender";function Ac(e,t){return t.closest([Lc,Mc,Rc].join(","))===e}function Dc(e){for(;e&&e.nodeType!==e.ELEMENT_NODE;)e=e.parentNode;if(!e)return;const t=e.closest(Lc);return t?t.id.slice("block-".length):void 0}function Oc(e){const t=(0,s.useRef)(),n=function(e){return(0,m.useSelect)((t=>{const{getSelectedBlocksInitialCaretPosition:n,isNavigationMode:o,isBlockSelected:r}=t(to);if(r(e)&&!o())return n()}),[e])}(e),{isBlockSelected:o,isMultiSelecting:r}=(0,m.useSelect)(to);return(0,s.useEffect)((()=>{if(!o(e)||r())return;if(null==n)return;if(!t.current)return;const{ownerDocument:l}=t.current;if(t.current.contains(l.activeElement))return;const i=Bl.focus.tabbable.find(t.current).filter((e=>(0,Bl.isTextField)(e))),s=-1===n,a=(s?u.last:u.first)(i)||t.current;if(Ac(t.current,a)){if(!t.current.getAttribute("contenteditable")){const e=Bl.focus.tabbable.findNext(t.current);if(e&&Ac(t.current,e)&&(0,Bl.isFormElement)(e))return void e.focus()}(0,Bl.placeCaretAtHorizontalEdge)(a,s)}else t.current.focus()}),[n,e]),t}function Fc(e){if(e.defaultPrevented)return;const t="mouseover"===e.type?"add":"remove";e.preventDefault(),e.currentTarget.classList[t]("is-hovered")}function zc(){const e=(0,m.useSelect)((e=>{const{isNavigationMode:t,getSettings:n}=e(to);return t()||n().outlineMode}),[]);return(0,d.useRefEffect)((t=>{if(e)return t.addEventListener("mouseout",Fc),t.addEventListener("mouseover",Fc),()=>{t.removeEventListener("mouseout",Fc),t.removeEventListener("mouseover",Fc),t.classList.remove("is-hovered")}}),[e])}function Vc(e){return(0,m.useSelect)((t=>{const{isBlockBeingDragged:n,isBlockHighlighted:o,isBlockSelected:l,isBlockMultiSelected:i,getBlockName:s,getSettings:a,hasSelectedInnerBlock:u,isTyping:d,__unstableIsFullySelected:p}=t(to),{outlineMode:m}=a(),g=n(e),h=l(e),f=s(e),v=u(e,!0),b=i(e);return c()({"is-selected":h,"is-highlighted":o(e),"is-multi-selected":b,"is-partially-selected":b&&!p(),"is-reusable":(0,r.isReusableBlock)((0,r.getBlockType)(f)),"is-dragging":g,"has-child-selected":v,"remove-outline":h&&m&&d()})}),[e])}function Hc(e){return(0,m.useSelect)((t=>{const n=t(to).getBlockName(e),o=(0,r.getBlockType)(n);if((null==o?void 0:o.apiVersion)>1)return(0,r.getBlockDefaultClassName)(n)}),[e])}function Gc(e){return(0,m.useSelect)((t=>{const{getBlockName:n,getBlockAttributes:o}=t(to),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 Uc(e){return(0,m.useSelect)((t=>{const{hasBlockMovingClientId:n,canInsertBlockType:o,getBlockName:r,getBlockRootClientId:l,isBlockSelected:i}=t(to);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 Wc(e){const{isBlockSelected:t}=(0,m.useSelect)(to),{selectBlock:n,selectionChange:o}=(0,m.useDispatch)(to);return(0,d.useRefEffect)((r=>{function l(l){r.parentElement.closest('[contenteditable="true"]')||(t(e)?l.target.isContentEditable||o(e):Ac(r,l.target)&&n(e))}return r.addEventListener("focusin",l),()=>{r.removeEventListener("focusin",l)}}),[t,n])}const $c=window.wp.keycodes;function jc(e){const t=(0,m.useSelect)((t=>t(to).isBlockSelected(e)),[e]),{getBlockRootClientId:n,getBlockIndex:o}=(0,m.useSelect)(to),{insertDefaultBlock:r,removeBlock:l}=(0,m.useDispatch)(to);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!==$c.ENTER&&s!==$c.BACKSPACE&&s!==$c.DELETE||a!==i||(0,Bl.isTextField)(a)||(t.preventDefault(),s===$c.ENTER?r({},n(e),o(e)+1):l(e))}function a(e){e.preventDefault()}}),[e,t,n,o,r,l])}function Kc(e){const{isNavigationMode:t,isBlockSelected:n}=(0,m.useSelect)(to),{setNavigationMode:o,selectBlock:r}=(0,m.useDispatch)(to);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])}function qc(){const e=(0,s.useContext)(ch);return(0,d.useRefEffect)((t=>{if(e)return e.observe(t),()=>{e.unobserve(t)}}),[e])}function Yc(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{__unstableIsHtml:t,__unstableIsDisabled:n=!1}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{clientId:o,className:l,wrapperProps:i={},isAligned:a}=(0,s.useContext)(Zc),{index:u,mode:p,name:g,blockApiVersion:f,blockTitle:v,isPartOfSelection:b,adjustScrolling:k,enableAnimation:_}=(0,m.useSelect)((e=>{const{getBlockIndex:t,getBlockMode:n,getBlockName:l,isTyping:i,getGlobalBlockCount:s,isBlockSelected:a,isBlockMultiSelected:c,isAncestorMultiSelected:u,isFirstMultiSelectedBlock:d}=e(to),p=a(o),m=c(o)||u(o),g=l(o),h=(0,r.getBlockType)(g);return{index:t(o),mode:n(o),name:g,blockApiVersion:(null==h?void 0:h.apiVersion)||1,blockTitle:null==h?void 0:h.title,isPartOfSelection:p||m,adjustScrolling:p||d(o),enableAnimation:!i()&&s()<=200}}),[o]),y=(0,h.sprintf)((0,h.__)("Block: %s"),v),E="html"!==p||t?"":"-visual",C=(0,d.useMergeRefs)([e.ref,Oc(o),Co(o),Wc(o),jc(o),Kc(o),zc(),qc(),Pc({isSelected:b,adjustScrolling:k,enableAnimation:_,triggerAnimationOnChange:u}),(0,d.useDisabled)({isDisabled:!n})]),S=lo();return f<2&&o===S.clientId&&"undefined"!=typeof process&&process.env,{...i,...e,ref:C,id:`block-${o}${E}`,tabIndex:0,role:"document","aria-label":y,"data-block":o,"data-type":g,"data-title":v,className:c()(c()("block-editor-block-list__block",{"wp-block":!a}),l,e.className,i.className,Vc(o),Hc(o),Gc(o),Uc(o)),style:{...i.style,...e.style}}}Yc.save=r.__unstableGetBlockProps;const Zc=(0,s.createContext)();function Qc(e){let{children:t,isHtml:n,...o}=e;return(0,s.createElement)("div",Yc(o,{__unstableIsHtml:n}),t)}const Xc=(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(to),d=a(n),p=r(n),m=s(o),g=c(n,o),h=u(n,o),{name:f,attributes:v,isValid:b}=d||{};return{mode:l(n),isSelectionEnabled:i(),isLocked:!!m,canRemove:g,canMove:h,block:d,name:f,attributes:v,isValid:b,isSelected:p}})),Jc=(0,m.withDispatch)(((e,t,n)=>{let{select:o}=n;const{updateBlockAttributes:l,insertBlocks:i,mergeBlocks:s,replaceBlocks:a,toggleSelection:c,__unstableMarkLastChangeAsPersistent:u}=e(to);return{setAttributes(e){const{getMultiSelectedBlockClientIds:n}=o(to),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(to),s=l(n);i(e,s+1,r)},onMerge(e){const{clientId:n}=t,{getPreviousBlockClientId:r,getNextBlockClientId:l}=o(to);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)}}})),eu=(0,d.compose)(d.pure,Xc,Jc,(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:g,name:h,isValid:f,attributes:v,wrapperProps:b,setAttributes:k,onReplace:_,onInsertBlocksAfter:y,onMerge:E,toggleSelection:C}=e;const S=(0,m.useSelect)((e=>{const{getSettings:t}=e(to);return t().supportsLayout}),[]),{removeBlock:w}=(0,m.useDispatch)(to),B=(0,s.useCallback)((()=>w(a)),[a]);let I=(0,s.createElement)(Ll,{name:h,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 x=(0,r.getBlockType)(h);null!=x&&x.getEditWrapperProps&&(b=function(e,t){const n={...e,...t};return null!=e&&e.className&&null!=t&&t.className&&(n.className=c()(e.className,t.className)),null!=e&&e.style&&null!=t&&t.style&&(n.style={...e.style,...t.style}),n}(b,x.getEditWrapperProps(v)));const T=b&&!!b["data-align"]&&!S;let N;if(T&&(I=(0,s.createElement)("div",{className:"wp-block","data-align":b["data-align"]},I)),f)N="html"===o?(0,s.createElement)(s.Fragment,null,(0,s.createElement)("div",{style:{display:"none"}},I),(0,s.createElement)(Qc,{isHtml:!0},(0,s.createElement)($l,{clientId:a}))):(null==x?void 0:x.apiVersion)>1?I:(0,s.createElement)(Qc,b,I);else{const e=n?(0,r.serializeRawBlock)(n):(0,r.getSaveContent)(x,v);N=(0,s.createElement)(Qc,{className:"has-warning"},(0,s.createElement)(zl,{clientId:a}),(0,s.createElement)(s.RawHTML,null,(0,Bl.safeHTML)(e)))}const P={clientId:a,className:null!==(t=b)&&void 0!==t&&t["data-align"]&&S?c()(g,`align${b["data-align"]}`):g,wrapperProps:(0,u.omit)(b,["data-align"]),isAligned:T},L=(0,s.useMemo)((()=>P),Object.values(P));return(0,s.createElement)(Zc.Provider,{value:L},(0,s.createElement)(Ul,{fallback:(0,s.createElement)(Qc,{className:"has-warning"},(0,s.createElement)(Hl,null))},N))})),tu=window.wp.htmlEntities,nu=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M18 11.2h-5.2V6h-1.6v5.2H6v1.6h5.2V18h1.6v-5.2H18z"})),ou=[(0,s.createInterpolateElement)((0,h.__)("While writing, you can press <kbd>/</kbd> to quickly insert new blocks."),{kbd:(0,s.createElement)("kbd",null)}),(0,s.createInterpolateElement)((0,h.__)("Indent a list by pressing <kbd>space</kbd> at the beginning of a line."),{kbd:(0,s.createElement)("kbd",null)}),(0,s.createInterpolateElement)((0,h.__)("Outdent a list by pressing <kbd>backspace</kbd> at the beginning of a line."),{kbd:(0,s.createElement)("kbd",null)}),(0,h.__)("Drag files into the editor to automatically insert media blocks."),(0,h.__)("Change a block's type by pressing the block icon on the toolbar.")],ru=function(){const[e]=(0,s.useState)(Math.floor(Math.random()*ou.length));return(0,s.createElement)(p.Tip,null,ou[e])},lu=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.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"})),iu=(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:lu});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)})),su=function(e){let{title:t,icon:n,description:o,blockType:r}=e;return r&&(V()("`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)(iu,{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)))},au=(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(Jn,eo),a(e)}),[o]),l?(0,s.createElement)(m.RegistryProvider,{value:l},(0,s.createElement)(e,i({registry:l},r))):null}))),"withRegistryProvider"),cu=()=>{};function uu(e){let{clientId:t=null,value:n,selection:o,onChange:l=cu,onInput:i=cu}=e;const a=(0,m.useRegistry)(),{resetBlocks:c,resetSelection:d,replaceInnerBlocks:p,setHasControlledInnerBlocks:g,__unstableMarkNextChangeAsNotPersistent:h}=a.dispatch(to),{getBlockName:f,getBlocks:v}=a.select(to),b=(0,m.useSelect)((e=>!t||e(to).areInnerBlocksControlled(t)),[t]),k=(0,s.useRef)({incoming:null,outgoing:[]}),_=(0,s.useRef)(!1),y=()=>{n&&(h(),t?a.batch((()=>{g(t,!0);const e=n.map((e=>(0,r.cloneBlock)(e)));_.current&&(k.current.incoming=e),h(),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(to);let s=v(t),c=r(),u=!1;_.current=!0;const d=a.subscribe((()=>{if(null!==t&&null===f(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])}const du=au((function(e){const{children:t,settings:n}=e,{updateSettings:o}=(0,m.useDispatch)(to);return(0,s.useEffect)((()=>{o(n)}),[n]),uu(e),(0,s.createElement)(Eo,null,t)}));function pu(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)(dh,null)))}function mu(){const{hasSelectedBlock:e,hasMultiSelection:t}=(0,m.useSelect)(to),{clearSelectedBlock:n}=(0,m.useDispatch)(to);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 gu(e){return(0,s.createElement)("div",i({ref:mu()},e))}function hu(e){const{isMultiSelecting:t,getMultiSelectedBlockClientIds:n,hasMultiSelection:o,getSelectedBlockClientId:r,getSelectedBlocksInitialCaretPosition:l,__unstableIsFullySelected:i}=e(to);return{isMultiSelecting:t(),multiSelectedBlockClientIds:n(),hasMultiSelection:o(),selectedBlockClientId:r(),initialPosition:l(),isFullSelection:i()}}function fu(){const{initialPosition:e,isMultiSelecting:t,multiSelectedBlockClientIds:n,hasMultiSelection:o,selectedBlockClientId:r,isFullSelection:l}=(0,m.useSelect)(hu,[]);return(0,d.useRefEffect)((r=>{const{ownerDocument:i}=r,{defaultView:s}=i;if(null==e)return;if(!o||t)return;const{length:a}=n;a<2||l&&(r.contentEditable=!0,s.getSelection().removeAllRanges(),r.focus())}),[o,t,n,r,e,l])}function vu(e,t,n,o){let r,l=Bl.focus.focusable.find(n);return t&&l.reverse(),l=l.slice(l.indexOf(e)+1),o&&(r=e.getBoundingClientRect()),l.find((function(e){if(!Bl.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 bu(){const{getSelectedBlockClientId:e,getMultiSelectedBlocksStartClientId:t,getMultiSelectedBlocksEndClientId:n,getPreviousBlockClientId:o,getNextBlockClientId:r,getSettings:l,hasMultiSelection:i,__unstableIsFullySelected:s}=(0,m.useSelect)(to),{selectBlock:a}=(0,m.useDispatch)(to);return(0,d.useRefEffect)((c=>{let u;function d(){u=null}function p(d){const{keyCode:p,target:m}=d,g=p===$c.UP,h=p===$c.DOWN,f=p===$c.LEFT,v=p===$c.RIGHT,b=g||f,k=f||v,_=g||h,y=k||_,E=d.shiftKey,C=E||d.ctrlKey||d.altKey||d.metaKey,S=_?Bl.isVerticalEdge:Bl.isHorizontalEdge,{ownerDocument:w}=c,{defaultView:B}=w;if(i()){if(!s())return;if(d.defaultPrevented)return;if(!y)return;if(E)return;return d.preventDefault(),void(b?a(t()):a(n(),-1))}if(_?u||(u=(0,Bl.computeCaretRect)(B)):u=null,d.defaultPrevented)return;if(!y)return;if(!function(e,t,n){if((t===$c.UP||t===$c.DOWN)&&!n)return!0;const{tagName:o}=e;return"INPUT"===o?["button","checkbox","color","file","image","radio","reset","submit"].includes(e.getAttribute("type")):"TEXTAREA"!==o}(m,p,C))return;const I=(0,Bl.isRTL)(m)?!b:b,{keepCaretInsideBlock:x}=l(),T=e();if(E){const e=n(),t=o(e||T),l=r(e||T);(b&&t||!b&&l)&&function(e,t){const n=vu(e,t,c);return!n||!function(e,t){return e.closest(Lc)===t.closest(Lc)}(e,n)}(m,b)&&S(m,b)&&(c.contentEditable=!0,c.focus())}else if(_&&(0,Bl.isVerticalEdge)(m,b)&&!x){const e=vu(m,b,c,!0);e&&((0,Bl.placeCaretAtVerticalEdge)(e,b,u),d.preventDefault())}else if(k&&B.getSelection().isCollapsed&&(0,Bl.isHorizontalEdge)(m,I)&&!x){const e=vu(m,I,c);(0,Bl.placeCaretAtHorizontalEdge)(e,b),d.preventDefault()}}return c.addEventListener("mousedown",d),c.addEventListener("keydown",p),()=>{c.removeEventListener("mousedown",d),c.removeEventListener("keydown",p)}}),[])}const ku=window.wp.keyboardShortcuts;function _u(){const{getBlockOrder:e,getSelectedBlockClientIds:t,getBlockRootClientId:n}=(0,m.useSelect)(to),{multiSelect:o}=(0,m.useDispatch)(to),r=(0,ku.__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,Bl.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 yu(e,t){e.contentEditable=t,t&&e.focus()}function Eu(){const{startMultiSelect:e,stopMultiSelect:t}=(0,m.useDispatch)(to),{isSelectionEnabled:n,hasMultiSelection:o}=(0,m.useSelect)(to);return(0,d.useRefEffect)((r=>{const{ownerDocument:l}=r,{defaultView:i}=l;let s,a;function c(){t(),i.removeEventListener("mouseup",c),a=i.requestAnimationFrame((()=>{if(o())return;yu(r,!1);const e=i.getSelection();if(e.rangeCount){const{commonAncestorContainer:t}=e.getRangeAt(0);s.contains(t)&&s.focus()}}))}function u(t){let{buttons:o,target:a}=t;1===o&&a.getAttribute("contenteditable")&&n()&&(s=l.activeElement,e(),i.addEventListener("mouseup",c),yu(r,!0))}return r.addEventListener("mouseout",u),()=>{r.removeEventListener("mouseout",u),i.removeEventListener("mouseup",c),i.cancelAnimationFrame(a)}}),[e,t,n,o])}function Cu(e,t){e.contentEditable=t,t&&e.focus()}function Su(){const{multiSelect:e,selectBlock:t,selectionChange:n}=(0,m.useDispatch)(to),{getBlockParents:o,getBlockSelectionStart:r}=(0,m.useSelect)(to);return(0,d.useRefEffect)((n=>{const{ownerDocument:l}=n,{defaultView:i}=l;function s(l){const s=i.getSelection();if(!s.rangeCount)return;const a=l.shiftKey&&"mouseup"===l.type;if(s.isCollapsed&&!a)return void Cu(n,!1);let c=Dc(function(e){const{anchorNode:t,anchorOffset:n}=e;return t.nodeType===t.TEXT_NODE?t:t.childNodes[n]}(s)),u=Dc(function(e){const{focusNode:t,focusOffset:n}=e;return t.nodeType===t.TEXT_NODE?t:t.childNodes[n-1]}(s));if(a){const e=r(),t=Dc(l.target),n=t!==u;(c===u&&s.isCollapsed||!u||n)&&(u=t),c!==e&&(c=e)}if(void 0!==c||void 0!==u)if(c===u)t(c);else{const t=[...o(c),c],n=[...o(u),u],r=function(e,t){let n=0;for(;e[n]===t[n];)n++;return n}(t,n);e(t[r],n[r])}else Cu(n,!1)}function a(){l.addEventListener("selectionchange",s),i.addEventListener("mouseup",s)}function c(){l.removeEventListener("selectionchange",s),i.removeEventListener("mouseup",s)}function u(){c(),a()}return a(),n.addEventListener("focusin",u),()=>{c(),n.removeEventListener("focusin",u)}}),[e,t,n,o])}function wu(){const{selectBlock:e}=(0,m.useDispatch)(to),{isSelectionEnabled:t,getBlockSelectionStart:n,hasMultiSelection:o}=(0,m.useSelect)(to);return(0,d.useRefEffect)((r=>{function l(l){if(!t()||0!==l.button)return;const i=n(),s=Dc(l.target);l.shiftKey?i!==s&&(r.contentEditable=!0,r.focus()):o()&&e(s)}return r.addEventListener("mousedown",l),()=>{r.removeEventListener("mousedown",l)}}),[e,t,n,o])}function Bu(){const{__unstableIsFullySelected:e,getSelectedBlockClientIds:t,__unstableIsSelectionMergeable:n,hasMultiSelection:o}=(0,m.useSelect)(to),{replaceBlocks:l,__unstableSplitSelection:i,removeBlocks:s,__unstableDeleteSelection:a,__unstableExpandSelection:c}=(0,m.useDispatch)(to);return(0,d.useRefEffect)((u=>{function d(e){var t;o()&&null!==(t=e.inputType)&&void 0!==t&&t.startsWith("format")&&e.preventDefault()}function p(d){d.defaultPrevented||o()&&(d.keyCode===$c.ENTER?(u.contentEditable=!1,d.preventDefault(),e()?l(t(),(0,r.createBlock)((0,r.getDefaultBlockName)())):i()):d.keyCode===$c.BACKSPACE||d.keyCode===$c.DELETE?(u.contentEditable=!1,d.preventDefault(),e()?s(t()):n()?a(d.keyCode===$c.DELETE):c()):1!==d.key.length||d.metaKey||d.ctrlKey||(u.contentEditable=!1,n()?a(d.keyCode===$c.DELETE):(d.preventDefault(),u.ownerDocument.defaultView.getSelection().removeAllRanges())))}function m(e){o()&&(u.contentEditable=!1,n()?a():(e.preventDefault(),u.ownerDocument.defaultView.getSelection().removeAllRanges()))}return u.addEventListener("beforeinput",d),u.addEventListener("keydown",p),u.addEventListener("compositionstart",m),()=>{u.removeEventListener("beforeinput",d),u.removeEventListener("keydown",p),u.removeEventListener("compositionstart",m)}}),[])}function Iu(){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)(to),{setNavigationMode:a}=(0,m.useDispatch)(to),c=(0,m.useSelect)((e=>e(to).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";Bl.focus.tabbable[n](t.target).focus()}}const g=(0,s.createElement)("div",{ref:t,tabIndex:c,onFocus:p}),h=(0,s.createElement)("div",{ref:n,tabIndex:c,onFocus:p}),f=(0,d.useRefEffect)((s=>{function c(e){if(e.defaultPrevented)return;if(e.keyCode===$c.ESCAPE&&!r())return e.preventDefault(),void a(!0);if(e.keyCode!==$c.TAB)return;const o=e.shiftKey,i=o?"findPrevious":"findNext";if(!r()&&!l())return void(e.target===s&&a(!0));if(((0,Bl.isFormElement)(e.target)||e.target.getAttribute("data-block")===l())&&(0,Bl.isFormElement)(Bl.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!==$c.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=Bl.focus.tabbable[l](o.target);i!==t.current&&i!==n.current||(o.preventDefault(),i.focus({preventScroll:!0}))}const{ownerDocument:m}=s,{defaultView:g}=m;return g.addEventListener("keydown",p),s.addEventListener("keydown",c),s.addEventListener("focusout",d),()=>{g.removeEventListener("keydown",p),s.removeEventListener("keydown",c),s.removeEventListener("focusout",d)}}),[]);return[g,(0,d.useMergeRefs)([e,f]),h]}(),o=(0,m.useSelect)((e=>e(to).hasMultiSelection()),[]);return[e,(0,d.useMergeRefs)([t,Bu(),Eu(),Su(),wu(),fu(),_u(),bu(),(0,d.useRefEffect)((e=>{if(e.tabIndex=-1,e.contentEditable=o,o)return e.setAttribute("aria-label",(0,h.__)("Multiple selected blocks")),()=>{e.removeAttribute("aria-label")}}),[o])]),n]}const xu=(0,s.forwardRef)((function(e,t){let{children:n,...o}=e;const[r,l,a]=Iu();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)})),Tu="editor-styles-wrapper";function Nu(e){return(0,s.useMemo)((()=>{const t=document.implementation.createHTMLDocument("");return t.body.innerHTML=e,Array.from(t.body.children)}),[e])}const Pu=(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)((()=>({}))),[g,f]=(0,s.useState)(),[v,b]=(0,s.useState)([]),k=Nu(null==a?void 0:a.styles),_=Nu(null==a?void 0:a.scripts),y=mu(),[E,C,S]=Iu(),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),f(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)}return e.addEventListener("load",t),()=>e.removeEventListener("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()}))}),[]),I=(0,d.useMergeRefs)([n,y,C]),x=(0,d.useRefEffect)((e=>{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&&function e(t){return Array.from(t).find((t=>{let{selectorText:n,conditionText:o,cssRules:r}=t;return o?e(r):n&&(n.includes(`.${Tu}`)||n.includes(".wp-block"))}))}(o)&&!e.ownerDocument.getElementById(n.id)){e.appendChild(n.cloneNode(!0));const t=n.id.replace("-css","-inline-css"),o=document.getElementById(t);o&&e.appendChild(o.cloneNode(!0))}}))}),[]);return 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,srcDoc:"<!doctype html>",title:(0,h.__)("Editor canvas")}),g&&(0,s.createPortal)((0,s.createElement)(s.Fragment,null,(0,s.createElement)("head",{ref:B},r),(0,s.createElement)("body",{ref:I,className:c()(Tu,...v)},(0,s.createElement)("div",{style:{display:"none"},ref:x}),(0,s.createElement)(p.__experimentalStyleProvider,{document:g},o))),g.documentElement)),l>=0&&S)}));var Lu={grad:.9,turn:360,rad:360/(2*Math.PI)},Mu=function(e){return"string"==typeof e?e.length>0:"number"==typeof e},Ru=function(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=Math.pow(10,t)),Math.round(n*e)/n+0},Au=function(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=1),e>n?n:e>t?e:t},Du=function(e){return(e=isFinite(e)?e%360:0)>0?e:e+360},Ou=function(e){return{r:Au(e.r,0,255),g:Au(e.g,0,255),b:Au(e.b,0,255),a:Au(e.a)}},Fu=function(e){return{r:Ru(e.r),g:Ru(e.g),b:Ru(e.b),a:Ru(e.a,3)}},zu=/^#([0-9a-f]{3,8})$/i,Vu=function(e){var t=e.toString(16);return t.length<2?"0"+t:t},Hu=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}},Gu=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}},Uu=function(e){return{h:Du(e.h),s:Au(e.s,0,100),l:Au(e.l,0,100),a:Au(e.a)}},Wu=function(e){return{h:Ru(e.h),s:Ru(e.s),l:Ru(e.l),a:Ru(e.a,3)}},$u=function(e){return Gu((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},ju=function(e){return{h:(t=Hu(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},Ku=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,qu=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Yu=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Zu=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Qu={string:[[function(e){var t=zu.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?Ru(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?Ru(parseInt(e.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(e){var t=Yu.exec(e)||Zu.exec(e);return t?t[2]!==t[4]||t[4]!==t[6]?null:Ou({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=Ku.exec(e)||qu.exec(e);if(!t)return null;var n,o,r=Uu({h:(n=t[1],o=t[2],void 0===o&&(o="deg"),Number(n)*(Lu[o]||1)),s:Number(t[3]),l:Number(t[4]),a:void 0===t[5]?1:Number(t[5])/(t[6]?100:1)});return $u(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 Mu(t)&&Mu(n)&&Mu(o)?Ou({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(!Mu(t)||!Mu(n)||!Mu(o))return null;var i=Uu({h:Number(t),s:Number(n),l:Number(o),a:Number(l)});return $u(i)},"hsl"],[function(e){var t=e.h,n=e.s,o=e.v,r=e.a,l=void 0===r?1:r;if(!Mu(t)||!Mu(n)||!Mu(o))return null;var i=function(e){return{h:Du(e.h),s:Au(e.s,0,100),v:Au(e.v,0,100),a:Au(e.a)}}({h:Number(t),s:Number(n),v:Number(o),a:Number(l)});return Gu(i)},"hsv"]]},Xu=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]},Ju=function(e,t){var n=ju(e);return{h:n.h,s:Au(n.s+100*t,0,100),l:n.l,a:n.a}},ed=function(e){return(299*e.r+587*e.g+114*e.b)/1e3/255},td=function(e,t){var n=ju(e);return{h:n.h,s:n.s,l:Au(n.l+100*t,0,100),a:n.a}},nd=function(){function e(e){this.parsed=function(e){return"string"==typeof e?Xu(e.trim(),Qu.string):"object"==typeof e&&null!==e?Xu(e,Qu.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 Ru(ed(this.rgba),2)},e.prototype.isDark=function(){return ed(this.rgba)<.5},e.prototype.isLight=function(){return ed(this.rgba)>=.5},e.prototype.toHex=function(){return t=(e=Fu(this.rgba)).r,n=e.g,o=e.b,l=(r=e.a)<1?Vu(Ru(255*r)):"","#"+Vu(t)+Vu(n)+Vu(o)+l;var e,t,n,o,r,l},e.prototype.toRgb=function(){return Fu(this.rgba)},e.prototype.toRgbString=function(){return t=(e=Fu(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 Wu(ju(this.rgba))},e.prototype.toHslString=function(){return t=(e=Wu(ju(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=Hu(this.rgba),{h:Ru(e.h),s:Ru(e.s),v:Ru(e.v),a:Ru(e.a,3)};var e},e.prototype.invert=function(){return od({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),od(Ju(this.rgba,e))},e.prototype.desaturate=function(e){return void 0===e&&(e=.1),od(Ju(this.rgba,-e))},e.prototype.grayscale=function(){return od(Ju(this.rgba,-1))},e.prototype.lighten=function(e){return void 0===e&&(e=.1),od(td(this.rgba,e))},e.prototype.darken=function(e){return void 0===e&&(e=.1),od(td(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?od({r:(t=this.rgba).r,g:t.g,b:t.b,a:e}):Ru(this.rgba.a,3);var t},e.prototype.hue=function(e){var t=ju(this.rgba);return"number"==typeof e?od({h:e,s:t.s,l:t.l,a:t.a}):Ru(t.h)},e.prototype.isEqual=function(e){return this.toHex()===od(e).toHex()},e}(),od=function(e){return e instanceof nd?e:new nd(e)},rd=[],ld=function(e){e.forEach((function(e){rd.indexOf(e)<0&&(e(nd,Qu),rd.push(e))}))};function id(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 sd=function(e){var t=e/255;return t<.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)},ad=function(e){return.2126*sd(e.r)+.7152*sd(e.g)+.0722*sd(e.b)};function cd(e){e.prototype.luminance=function(){return e=ad(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=ad(l))>(a=ad(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 ud=n(3124),dd=n.n(ud);const pd=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g;function md(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(),g(n);e.length&&"}"!==e.charAt(0)&&(t=S()||w());)!1!==t&&(n.push(t),g(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 g(e){let t;for(e=e||[];t=h();)!1!==t&&e.push(t);return e}function h(){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 f(){const e=p(/^([^{]+)/);if(e)return gd(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=gd(t[0]),!p(/^:\s*/))return a("property missing ':'");const n=p(/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^\)]*?\)|[^};])+)/),o=e({type:"declaration",property:t.replace(pd,""),value:n?gd(n[0]).replace(pd,""):""});return p(/^[;\s]*/),o}function b(){const e=[];if(!c())return a("missing '{'");let t;for(g(e);t=v();)!1!==t&&(e.push(t),g(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=g();for(;r=k();)i.push(r),i=i.concat(g());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=gd(t[1]);if(!c())return a("@media missing '{'");const o=g().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:gd(t[1]),media:gd(t[2])})}()||function(){const e=l(),t=p(/^@supports *([^{]+)/);if(!t)return;const n=gd(t[1]);if(!c())return a("@supports missing '{'");const o=g().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=gd(t[1]),o=gd(t[2]);if(!c())return a("@document missing '{'");const r=g().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=f()||[];if(!c())return a("@page missing '{'");let n,o=g();for(;n=v();)o.push(n),o=o.concat(g());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=g().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=g();for(;t=v();)n.push(t),n=n.concat(g());return u()?e({type:"font-face",declarations:n}):a("@font-face missing '}'")}()}function w(){const e=l(),t=f();return t?(g(),e({type:"rule",selectors:t,declarations:b()})):a("selector missing")}return hd(function(){const e=d();return{type:"stylesheet",stylesheet:{source:t.source,rules:e,parsingErrors:s}}}())}function gd(e){return e?e.replace(/^\s+|\s+$/g,""):""}function hd(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){hd(e,o)})):n&&"object"==typeof n&&hd(n,o)}return n&&Object.defineProperty(e,"parent",{configurable:!0,writable:!0,enumerable:!1,value:t||null}),e}var fd=n(8575),vd=n.n(fd);const bd=kd;function kd(e){this.options=e||{}}kd.prototype.emit=function(e){return e},kd.prototype.visit=function(e){return this[e.type](e)},kd.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};const _d=yd;function yd(e){bd.call(this,e)}vd()(yd,bd),yd.prototype.compile=function(e){return e.stylesheet.rules.map(this.visit,this).join("")},yd.prototype.comment=function(e){return this.emit("",e.position)},yd.prototype.import=function(e){return this.emit("@import "+e.import+";",e.position)},yd.prototype.media=function(e){return this.emit("@media "+e.media,e.position)+this.emit("{")+this.mapVisit(e.rules)+this.emit("}")},yd.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("}")},yd.prototype.charset=function(e){return this.emit("@charset "+e.charset+";",e.position)},yd.prototype.namespace=function(e){return this.emit("@namespace "+e.namespace+";",e.position)},yd.prototype.supports=function(e){return this.emit("@supports "+e.supports,e.position)+this.emit("{")+this.mapVisit(e.rules)+this.emit("}")},yd.prototype.keyframes=function(e){return this.emit("@"+(e.vendor||"")+"keyframes "+e.name,e.position)+this.emit("{")+this.mapVisit(e.keyframes)+this.emit("}")},yd.prototype.keyframe=function(e){const t=e.declarations;return this.emit(e.values.join(","),e.position)+this.emit("{")+this.mapVisit(t)+this.emit("}")},yd.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("}")},yd.prototype["font-face"]=function(e){return this.emit("@font-face",e.position)+this.emit("{")+this.mapVisit(e.declarations)+this.emit("}")},yd.prototype.host=function(e){return this.emit("@host",e.position)+this.emit("{")+this.mapVisit(e.rules)+this.emit("}")},yd.prototype["custom-media"]=function(e){return this.emit("@custom-media "+e.name+" "+e.media+";",e.position)},yd.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("}"):""},yd.prototype.declaration=function(e){return this.emit(e.property+":"+e.value,e.position)+this.emit(";")};const Ed=Cd;function Cd(e){e=e||{},bd.call(this,e),this.indentation=e.indent}vd()(Cd,bd),Cd.prototype.compile=function(e){return this.stylesheet(e)},Cd.prototype.stylesheet=function(e){return this.mapVisit(e.stylesheet.rules,"\n\n")},Cd.prototype.comment=function(e){return this.emit(this.indent()+"/*"+e.comment+"*/",e.position)},Cd.prototype.import=function(e){return this.emit("@import "+e.import+";",e.position)},Cd.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}")},Cd.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}")},Cd.prototype.charset=function(e){return this.emit("@charset "+e.charset+";",e.position)},Cd.prototype.namespace=function(e){return this.emit("@namespace "+e.namespace+";",e.position)},Cd.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}")},Cd.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)+"}")},Cd.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")},Cd.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}")},Cd.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}")},Cd.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}")},Cd.prototype["custom-media"]=function(e){return this.emit("@custom-media "+e.name+" "+e.media+";",e.position)},Cd.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()+"}"):""},Cd.prototype.declaration=function(e){return this.emit(this.indent())+this.emit(e.property+": "+e.value,e.position)+this.emit(";")},Cd.prototype.indent=function(e){return this.level=this.level||1,null!==e?(this.level+=e,""):Array(this.level).join(this.indentation||" ")};const Sd=function(e,t){try{const r=md(e);return n=dd().map(r,(function(e){if(!e)return e;const n=t(e);return this.update(n)})),((o=o||{}).compress?new _d(o):new Ed(o)).compile(n)}catch(e){return console.warn("Error while traversing the CSS: "+e),null}var n,o};function wd(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 Bd(e,t){return new URL(e,t).toString()}const Id=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]};wd(e)&&o.push(e)}return o}(t.value).map((r=e,e=>({...e,newUrl:"url("+e.before+e.quote+Bd(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},xd=/^(body|html|:root).*$/,Td=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(xd)?n.replace(/^(body|html|:root)/,e):e+" "+n))}:n},Nd=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(Td(t)),o&&r.push(Id(o)),r.length?Sd(n,(0,d.compose)(r)):n}))},Pd=".editor-styles-wrapper";function Ld(e){return(0,s.useCallback)((e=>{if(!e)return;const{ownerDocument:t}=e,{defaultView:n,body:o}=t,r=t.querySelector(Pd);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=od(l);i.luminance()>.5||0===i.alpha()?o.classList.remove("is-dark-theme"):o.classList.add("is-dark-theme")}),[e])}function Md(e){let{styles:t}=e;const n=(0,s.useMemo)((()=>Nd(t,Pd)),[t]);return(0,s.createElement)(s.Fragment,null,(0,s.createElement)("style",{ref:Ld(t)}),n.map(((e,t)=>(0,s.createElement)("style",{key:t},e))))}function Rd(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t={r:[],g:[],b:[],a:[]};return e.forEach((e=>{const n=od(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 Ad(e){let{selector:t,id:n}=e;const o=`\n${t} {\n\tfilter: url( #${n} );\n}\n`;return(0,s.createElement)("style",null,o)}function Dd(e){let{selector:t}=e;const n=`\n${t} {\n\tfilter: none;\n}\n`;return(0,s.createElement)("style",null,n)}function Od(e){let{id:t,colors:n}=e;const o=Rd(n);return(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:t},(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"}))))}function Fd(e){let{preset:t}=e;return(0,s.createElement)(Od,{id:`wp-duotone-${t.slug}`,colors:t.colors})}let zd;ld([id,cd]);const Vd=2e3,Hd=function(e){let{viewportWidth:t,__experimentalPadding:n,__experimentalMinHeight:o}=e;const[r,{width:l}]=(0,d.useResizeObserver)(),[i,{height:a}]=(0,d.useResizeObserver)(),{styles:c,assets:u,duotone:g}=(0,m.useSelect)((e=>{var t,n;const o=e(to).getSettings();return{styles:o.styles,assets:o.__unstableResolvedAssets,duotone:null===(t=o.__experimentalFeatures)||void 0===t||null===(n=t.color)||void 0===n?void 0:n.duotone}}),[]),h=(0,s.useMemo)((()=>c?[...c,{css:"body{height:auto;overflow:hidden;}",__unstableType:"presets"}]:c),[c]),f=(0,s.useMemo)((()=>{var e,t;return[...null!==(e=null==g?void 0:g.default)&&void 0!==e?e:[],...null!==(t=null==g?void 0:g.theme)&&void 0!==t?t:[]]}),[g]);zd=zd||(0,d.pure)(dh);const v=l/t;return(0,s.createElement)("div",{className:"block-editor-block-preview__container"},r,(0,s.createElement)(p.Disabled,{className:"block-editor-block-preview__content",style:{transform:`scale(${v})`,height:a*v,maxHeight:a>Vd?Vd*v:void 0,minHeight:o}},(0,s.createElement)(Pu,{head:(0,s.createElement)(Md,{styles:h}),assets:u,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:a,pointerEvents:"none",maxHeight:Vd,minHeight:0!==v&&v<1&&o?o/v:o}},i,f.map((e=>(0,s.createElement)(Fd,{preset:e,key:e.slug}))),(0,s.createElement)(zd,{renderAppender:!1}))))},Gd=(0,s.memo)((function(e){let{blocks:t,__experimentalPadding:n=0,viewportWidth:o=1200,__experimentalLive:r=!1,__experimentalOnClick:l,__experimentalMinHeight:i}=e;const a=(0,m.useSelect)((e=>e(to).getSettings()),[]),c=(0,s.useMemo)((()=>{const e={...a};return e.__experimentalBlockPatterns=[],e}),[a]),d=(0,s.useMemo)((()=>(0,u.castArray)(t)),[t]);return t&&0!==t.length?(0,s.createElement)(du,{value:d,settings:c},r?(0,s.createElement)(pu,{onClick:l}):(0,s.createElement)(Hd,{viewportWidth:o,__experimentalPadding:n,__experimentalMinHeight:i})):null}));function Ud(e){let{blocks:t,props:n={},__experimentalLayout:o}=e;const r=(0,m.useSelect)((e=>e(to).getSettings()),[]),l=(0,d.useDisabled)(),i=(0,d.useMergeRefs)([n.ref,l]),a=(0,s.useMemo)((()=>({...r,__experimentalBlockPatterns:[]})),[r]),p=(0,s.useMemo)((()=>(0,u.castArray)(t)),[t]),g=(0,s.createElement)(du,{value:p,settings:a},(0,s.createElement)(mh,{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?g:null}}const Wd=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)(Gd,{__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,h.__)("No Preview Available."))),!p&&(0,s.createElement)(su,{title:i,icon:a,description:c}))},$d=(0,s.createContext)(),jd=(0,s.forwardRef)((function(e,t){let{isFirst:n,as:o,children:r,...l}=e;const a=(0,s.useContext)($d);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)}))})),Kd=(0,s.createElement)(D.SVG,{width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M8 7h2V5H8v2zm0 6h2v-2H8v2zm0 6h2v-2H8v2zm6-14v2h2V5h-2zm0 8h2v-2h-2v2zm0 6h2v-2h-2v2z"}));function qd(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)(iu,{icon:n}):(0,h.sprintf)(
11
  /* translators: %d: Number of blocks. */
12
+ (0,h._n)("%d block","%d blocks",t),t)),(0,s.createElement)(p.FlexItem,null,(0,s.createElement)(iu,{icon:Kd})))))}const Yd=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)(qd,{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 Zd(){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)}const Qd=(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}:{},g=(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)(Yd,{isEnabled:u&&!o.disabled,blocks:g,icon:o.icon},(e=>{let{draggable:r,onDragStart:u,onDragEnd:g}=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,g&&g(e)}},(0,s.createElement)(jd,i({isFirst:n,className:c()("block-editor-block-types-list__item",t),disabled:o.isDisabled,onClick:e=>{e.preventDefault(),l(o,Zd()?e.metaKey:e.ctrlKey),a(null)},onKeyDown:e=>{const{keyCode:t}=e;t===$c.ENTER&&(e.preventDefault(),l(o,Zd()?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)(iu,{icon:o.icon,showColors:!0})),(0,s.createElement)("span",{className:"block-editor-block-types-list__item-title"},o.title)))}))})),Xd=(0,s.forwardRef)((function(e,t){const[n,o]=(0,s.useState)(!1);return(0,s.useEffect)((()=>{n&&(0,Gt.speak)((0,h.__)("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))})),Jd=(0,s.forwardRef)((function(e,t){const n=(0,s.useContext)($d);return(0,s.createElement)(p.__unstableCompositeGroup,i({state:n,role:"presentation",ref:t},e))})),ep=function(e){let{items:t=[],onSelect:n,onHover:o=(()=>{}),children:l,label:i,isDraggable:a=!0}=e;return(0,s.createElement)(Xd,{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)(Jd,{key:t},e.map(((e,l)=>(0,s.createElement)(Qd,{key:e.id,item:e,className:(0,r.getBlockMenuDefaultClassName)(e.id),onSelect:n,onHover:o,isDraggable:a,isFirst:0===t&&0===l})))))),l)},tp=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))},np=(e,t)=>{const{categories:n,collections:o,items:l}=(0,m.useSelect)((t=>{const{getInserterItems:n}=t(to),{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])]},op=function(e){let{children:t}=e;const n=(0,p.__unstableUseCompositeState)({shift:!0,wrap:"horizontal"});return(0,s.createElement)($d.Provider,{value:n},t)},rp=[],lp=function(e){let{rootClientId:t,onInsert:n,onHover:o,showMostUsedBlocks:r}=e;const[l,i,a,c]=np(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]),g=(0,s.useMemo)((()=>(0,u.flow)((e=>e.filter((e=>e.category&&"reusable"!==e.category))),(e=>(0,u.groupBy)(e,"category")))(l)),[l]),f=(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:rp);return(0,s.createElement)(op,null,(0,s.createElement)("div",null,r&&!!p.length&&(0,s.createElement)(tp,{title:(0,h._x)("Most used","blocks")},(0,s.createElement)(ep,{items:p,onSelect:c,onHover:o,label:(0,h._x)("Most used","blocks")})),(0,u.map)(v,(e=>{const t=g[e.slug];return t&&t.length?(0,s.createElement)(tp,{key:e.slug,title:e.title,icon:e.icon},(0,s.createElement)(ep,{items:t,onSelect:c,onHover:o,label:e.title})):null})),b&&m.length>0&&(0,s.createElement)(tp,{className:"block-editor-inserter__uncategorized-blocks-panel",title:(0,h.__)("Uncategorized")},(0,s.createElement)(ep,{items:m,onSelect:c,onHover:o,label:(0,h.__)("Uncategorized")})),(0,u.map)(_,(e=>{let[t,n]=e;const r=f[t];return r&&r.length?(0,s.createElement)(tp,{key:t,title:n.title,icon:n.icon},(0,s.createElement)(ep,{items:r,onSelect:c,onHover:o,label:n.title})):null}))))},ip=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,h.__)("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,h.__)("Explore all patterns"),onClick:()=>r()},(0,h._x)("Explore","Label for showing all block patterns"))))},sp=window.wp.notices,ap=(e,t)=>{const{patternCategories:n,patterns:o}=(0,m.useSelect)((e=>{const{__experimentalGetAllowedPatterns:n,getSettings:o}=e(to);return{patterns:n(t),patternCategories:o().__experimentalBlockPatternCategories}}),[t]),{createSuccessNotice:l}=(0,m.useDispatch)(sp.store);return[o,n,(0,s.useCallback)(((t,n)=>{e((0,u.map)(n,(e=>(0,r.cloneBlock)(e))),t.name),l((0,h.sprintf)(
13
  /* translators: %s: block pattern title. */
14
+ (0,h.__)('Block pattern "%s" inserted.'),t.title),{type:"snackbar"})}),[])]};function cp(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)(cp)}`;return(0,s.createElement)(Yd,{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)(Gd,{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 up(){return(0,s.createElement)("div",{className:"block-editor-block-patterns-list__item is-placeholder"})}const dp=function(e){let{isDraggable:t,blockPatterns:n,shownPatterns:o,onClickPattern:r,orientation:l,label:a=(0,h.__)("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)(cp,{key:e.name,pattern:e,onClick:r,isDraggable:t,composite:c}):(0,s.createElement)(up,{key:e.name}))))};function pp(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 mp(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,h.__)("Search for patterns"),placeholder:(0,h.__)("Search")}))}const gp=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)(mp,{filterValue:r,setFilterValue:l}),!r&&(0,s.createElement)(pp,{selectedCategory:t,patternCategories:n,onClickCategory:o}))},hp=function(){return(0,s.createElement)("div",{className:"block-editor-inserter__no-results"},(0,s.createElement)(Rr,{className:"block-editor-inserter__no-results-icon",icon:lu}),(0,s.createElement)("p",null,(0,h.__)("No results found.")))},fp=function(e){let{rootClientId:t="",insertionIndex:n,clientId:o,isAppender:l,onSelect:i,shouldFocusBlock:a=!0}=e;const{getSelectedBlock:c}=(0,m.useSelect)(to),{destinationRootClientId:d,destinationIndex:p}=(0,m.useSelect)((e=>{const{getSelectedBlockClientId:r,getBlockRootClientId:i,getBlockIndex:s,getBlockOrder:a}=e(to),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:g,insertBlocks:f,showInsertionPoint:v,hideInsertionPoint:b}=(0,m.useDispatch)(to),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)?g(o.clientId,e,null,a||n?0:null,t):f(e,p,d,!0,a||n?0:null,t);const s=(0,h.sprintf)(// translators: %d: the name of the block that has been added
15
+ (0,h._n)("%d block added.","%d blocks added.",(0,u.castArray)(e).length),(0,u.castArray)(e).length);(0,Gt.speak)(s),i&&i()}),[l,c,g,f,d,p,i,a]),_=(0,s.useCallback)((e=>{e?v(d,p):b()}),[v,b,d,p]);return[d,k,_]},vp=e=>e.name||"",bp=e=>e.title,kp=e=>e.description||"",_p=e=>e.keywords||[],yp=e=>e.category,Ep=()=>null;function Cp(){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 Sp=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return(0,u.words)(Cp(e))},wp=(e,t)=>e.filter((e=>!Sp(t).some((t=>t.includes(e))))),Bp=(e,t,n,o)=>0===Sp(o).length?e:Ip(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}}),Ip=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=Sp(t);if(0===o.length)return e;const r=e.map((e=>[e,xp(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 xp(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{getName:o=vp,getTitle:r=bp,getDescription:l=kp,getKeywords:i=_p,getCategory:s=yp,getCollection:a=Ep}=n,c=o(e),d=r(e),p=l(e),m=i(e),g=s(e),h=a(e),f=Cp(t),v=Cp(d);let b=0;if(f===v)b+=30;else if(v.startsWith(f))b+=20;else{const e=[c,d,p,...m,g,h].join(" "),t=(0,u.words)(f);0===wp(t,e).length&&(b+=10)}return 0!==b&&c.startsWith("core/")&&(b+=c!==e.id?1:2),b}function Tp(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,h.sprintf)(
16
  /* translators: %d: number of patterns. %s: block pattern search query */
17
+ (0,h._n)('%1$d pattern found for "%2$s"','%1$d patterns found for "%2$s"',n),n,t)):null}const Np=function(e){let{filterValue:t,selectedCategory:n,patternCategories:o}=e;const r=(0,d.useDebounce)(Gt.speak,500),[l,i]=fp({shouldFocusBlock:!0}),[a,,c]=ap(i,l),u=(0,s.useMemo)((()=>o.map((e=>e.name))),[o]),p=(0,s.useMemo)((()=>t?Ip(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,h.sprintf)(
18
  /* translators: %d: number of results. */
19
+ (0,h._n)("%d result found.","%d results found.",e),e);r(n)}),[t,r]);const m=(0,d.useAsyncList)(p,{step:2}),g=!(null==p||!p.length);return(0,s.createElement)("div",{className:"block-editor-block-patterns-explorer__list"},g&&(0,s.createElement)(Tp,{filterValue:t,filteredBlockPatternsLength:p.length}),(0,s.createElement)(op,null,!g&&(0,s.createElement)(hp,null),g&&(0,s.createElement)(dp,{shownPatterns:m,blockPatterns:p,onClickPattern:c,isDraggable:!1})))};function Pp(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)(gp,{selectedCategory:l,patternCategories:n,onClickCategory:i,filterValue:o,setFilterValue:r}),(0,s.createElement)(Np,{filterValue:o,selectedCategory:l,patternCategories:n}))}const Lp=function(e){let{onModalClose:t,...n}=e;return(0,s.createElement)(p.Modal,{title:(0,h.__)("Patterns"),closeLabel:(0,h.__)("Close"),onRequestClose:t,isFullScreen:!0},(0,s.createElement)(Pp,n))};function Mp(e){let{rootClientId:t,onInsert:n,selectedCategory:o,populatedCategories:r}=e;const[l,,i]=ap(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)(dp,{shownPatterns:p,blockPatterns:c,onClickPattern:i,label:o.label,orientation:"vertical",isDraggable:!0})):null}const Rp=function(e){let{rootClientId:t,onInsert:n,onClickCategory:o,selectedCategory:r}=e;const[l,i]=(0,s.useState)(!1),[a,c]=ap(),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,h._x)("Uncategorized")}),e}),[a,c]),p=r||d[0];return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(ip,{selectedCategory:p,patternCategories:d,onClickCategory:o,openPatternExplorer:()=>i(!0)}),!l&&(0,s.createElement)(Mp,{rootClientId:t,onInsert:n,selectedCategory:p,populatedCategories:d}),l&&(0,s.createElement)(Lp,{initialCategory:p,patternCategories:d,onModalClose:()=>i(!1)}))},Ap=window.wp.url;function Dp(e){let{onHover:t,onInsert:n,rootClientId:o}=e;const[r,,,l]=np(o,n),i=(0,s.useMemo)((()=>r.filter((e=>{let{category:t}=e;return"reusable"===t}))),[r]);return 0===i.length?(0,s.createElement)(hp,null):(0,s.createElement)(tp,{title:(0,h.__)("Reusable blocks")},(0,s.createElement)(ep,{items:i,onSelect:l,onHover:t,label:(0,h.__)("Reusable blocks")}))}const Op=function(e){let{rootClientId:t,onInsert:n,onHover:o}=e;return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(Dp,{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,Ap.addQueryArgs)("edit.php",{post_type:"wp_block"})},(0,h.__)("Manage Reusable blocks"))))},{Fill:Fp,Slot:zp}=(0,p.createSlotFill)("__unstableInserterMenuExtension");Fp.Slot=zp;const Vp=Fp,Hp=[],Gp=function(e){let{filterValue:t,onSelect:n,onHover:o,rootClientId:r,clientId:l,isAppender:i,__experimentalInsertionIndex:a,maxBlockPatterns:c,maxBlockTypes:m,showBlockDirectory:g=!1,isDraggable:f=!0,shouldFocusBlock:v=!0,prioritizePatterns:b}=e;const k=(0,d.useDebounce)(Gt.speak,500),[_,y]=fp({onSelect:n,rootClientId:r,clientId:l,isAppender:i,insertionIndex:a,shouldFocusBlock:v}),[E,C,S,w]=np(_,y),[B,,I]=ap(y,_),x=(0,s.useMemo)((()=>{if(0===c)return[];const e=Ip(B,t);return void 0!==c?e.slice(0,c):e}),[t,B,c]);let T=m;b&&x.length>2&&(T=0);const N=(0,s.useMemo)((()=>{if(0===T)return[];const e=Bp((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+x.length,n=(0,h.sprintf)(
20
  /* translators: %d: number of results. */
21
+ (0,h._n)("%d result found.","%d results found.",e),e);k(n)}),[t,k]);const P=(0,d.useAsyncList)(N,{step:9}),L=(0,d.useAsyncList)(P.length===N.length?x:Hp),M=!(0,u.isEmpty)(N)||!(0,u.isEmpty)(x),R=!!N.length&&(0,s.createElement)(tp,{title:(0,s.createElement)(p.VisuallyHidden,null,(0,h.__)("Blocks"))},(0,s.createElement)(ep,{items:P,onSelect:w,onHover:o,label:(0,h.__)("Blocks"),isDraggable:f})),A=!!x.length&&(0,s.createElement)(tp,{title:(0,s.createElement)(p.VisuallyHidden,null,(0,h.__)("Block Patterns"))},(0,s.createElement)("div",{className:"block-editor-inserter__quick-inserter-patterns"},(0,s.createElement)(dp,{shownPatterns:L,blockPatterns:x,onClickPattern:I,isDraggable:f})));return(0,s.createElement)(op,null,!g&&!M&&(0,s.createElement)(hp,null),b?A:R,!!N.length&&!!x.length&&(0,s.createElement)("div",{className:"block-editor-inserter__quick-inserter-separator"}),b?R:A,g&&(0,s.createElement)(Vp.Slot,{fillProps:{onSelect:w,onHover:o,filterValue:t,hasItems:M,rootClientId:_}},(e=>e.length?e:M?null:(0,s.createElement)(hp,null))))},Up={name:"blocks",
22
  /* translators: Blocks tab title in the block inserter. */
23
+ title:(0,h.__)("Blocks")},Wp={name:"patterns",
24
  /* translators: Patterns tab title in the block inserter. */
25
+ title:(0,h.__)("Patterns")},$p={name:"reusable",
26
  /* translators: Reusable blocks tab title in the block inserter. */
27
+ title:(0,h.__)("Reusable")},jp=function(e){let{children:t,showPatterns:n=!1,showReusableBlocks:o=!1,onSelect:r}=e;const l=(0,s.useMemo)((()=>{const e=[Up];return n&&e.push(Wp),o&&e.push($p),e}),[Up,n,Wp,o,$p]);return(0,s.createElement)(p.TabPanel,{className:"block-editor-inserter__tabs",tabs:l,onSelect:r},t)},Kp=(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[g,f]=(0,s.useState)(u),[v,b]=(0,s.useState)(null),[k,_]=(0,s.useState)(null),[y,E,C]=fp({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(to);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]),I=(0,s.useCallback)(((e,t)=>{E(e,{patternName:t}),i()}),[E,i]),x=(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)(lp,{rootClientId:y,onInsert:B,onHover:x,showMostUsedBlocks:c})),a&&(0,s.createElement)("div",{className:"block-editor-inserter__tips"},(0,s.createElement)(p.VisuallyHidden,{as:"h2"},(0,h.__)("A tip for using the block editor")),(0,s.createElement)(ru,null)))),[y,B,x,g,c,a]),P=(0,s.useMemo)((()=>(0,s.createElement)(Rp,{rootClientId:y,onInsert:I,onClickCategory:T,selectedCategory:k})),[y,I,T,k]),L=(0,s.useMemo)((()=>(0,s.createElement)(Op,{rootClientId:y,onInsert:B,onHover:x})),[y,B,x]),M=(0,s.useCallback)((e=>"blocks"===e.name?N:"patterns"===e.name?P:L),[N,P,L]),R=(0,s.useRef)();return(0,s.useImperativeHandle)(t,(()=>({focusSearch:()=>{R.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),f(e)},value:g,label:(0,h.__)("Search for blocks and patterns"),placeholder:(0,h.__)("Search"),ref:R}),!!g&&(0,s.createElement)(Gp,{filterValue:g,onSelect:i,onHover:x,rootClientId:n,clientId:o,isAppender:r,__experimentalInsertionIndex:l,showBlockDirectory:!0,shouldFocusBlock:d}),!g&&(S||w)&&(0,s.createElement)(jp,{showPatterns:S,showReusableBlocks:w},M),!g&&!S&&!w&&N)),a&&v&&(0,s.createElement)(Wd,{item:v}))}));function qp(e){let{onSelect:t,rootClientId:n,clientId:o,isAppender:r,prioritizePatterns:l}=e;const[i,a]=(0,s.useState)(""),[u,d]=fp({onSelect:t,rootClientId:n,clientId:o,isAppender:r}),[g]=np(u,d),[f]=ap(d,u),{setInserterIsOpened:v,insertionIndex:b}=(0,m.useSelect)((e=>{const{getSettings:t,getBlockIndex:n,getBlockCount:r}=e(to),l=t(),i=n(o),s=r();return{setInserterIsOpened:l.__experimentalSetIsInserterOpened,insertionIndex:-1===i?s:i}}),[o]),k=f.length&&(!!i||l),_=k&&f.length>6||g.length>6;(0,s.useEffect)((()=>{v&&v(!1)}),[v]);let y=0;return k&&(y=l?4:2),(0,s.createElement)("div",{className:c()("block-editor-inserter__quick-inserter",{"has-search":_,"has-expand":v})},_&&(0,s.createElement)(p.SearchControl,{className:"block-editor-inserter__search",value:i,onChange:e=>{a(e)},label:(0,h.__)("Search for blocks and patterns"),placeholder:(0,h.__)("Search")}),(0,s.createElement)("div",{className:"block-editor-inserter__quick-inserter-results"},(0,s.createElement)(Gp,{filterValue:i,onSelect:t,rootClientId:n,clientId:o,isAppender:r,maxBlockPatterns:y,maxBlockTypes:6,isDraggable:!1,prioritizePatterns:l})),v&&(0,s.createElement)(p.Button,{className:"block-editor-inserter__quick-inserter-expand",onClick:()=>{v({rootClientId:n,insertionIndex:b,filterValue:i})},"aria-label":(0,h.__)("Browse all. This will open the main inserter panel in the editor toolbar.")},(0,h.__)("Browse all")))}const Yp=e=>{let t,{onToggle:n,disabled:o,isOpen:r,blockTitle:l,hasSingleBlockType:a,toggleProps:c={},prioritizePatterns:u}=e;t=a?(0,h.sprintf)(// translators: %s: the name of the block when there is only one
28
+ (0,h._x)("Add %s","directly add the only allowed block"),l):u?(0,h.__)("Add pattern"):(0,h._x)("Add block","Generic label for block inserter button");const{onClick:d,...m}=c;return(0,s.createElement)(p.Button,i({icon:nu,label:t,tooltipPosition:"bottom",onClick:function(e){n&&n(e),d&&d(e)},className:"block-editor-inserter__toggle","aria-haspopup":!a&&"true","aria-expanded":!a&&r,disabled:o},m))};class Zp 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=Yp,prioritizePatterns:u}=this.props;return c({onToggle:t,isOpen:n,disabled:o||!a,blockTitle:r,hasSingleBlockType:l,directInsertBlock:i,toggleProps:s,prioritizePatterns:u})}renderContent(e){let{onClose:t}=e;const{rootClientId:n,clientId:o,isAppender:r,showInserterHelpPanel:l,__experimentalIsQuick:i,prioritizePatterns:a}=this.props;return i?(0,s.createElement)(qp,{onSelect:()=>{t()},rootClientId:n,clientId:o,isAppender:r,prioritizePatterns:a}):(0,s.createElement)(Kp,{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,h.__)("Add a block"),renderToggle:this.renderToggle,renderContent:this.renderContent,onClose:l})}}const Qp=(0,d.compose)([(0,m.withSelect)(((e,t)=>{var n;let{clientId:o,rootClientId:l}=t;const{getBlockRootClientId:i,hasInserterItems:s,__experimentalGetAllowedBlocks:a,__experimentalGetDirectInsertBlock:c,getBlockIndex:u,getBlockCount:d,getSettings:p}=e(to),{getBlockVariations:m}=e(r.store);l=l||i(o)||void 0;const g=a(l),h=c(l),f=u(o),v=d(),b=p(),k=1===(null==g?void 0:g.length)&&0===(null===(n=m(g[0].name,"inserter"))||void 0===n?void 0:n.length);let _=!1;return k&&(_=g[0]),{hasItems:s(l),hasSingleBlockType:k,blockTitle:_?_.title:"",allowedBlockType:_,directInsertBlock:h,rootClientId:l,prioritizePatterns:b.__experimentalPreferPatternsOnRoot&&!l&&f>0&&(f<v||0===v)}})),(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(to);let p;if(c){const e=function(e){const{getBlock:t,getPreviousBlockClientId:r}=o(to);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(to);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,h.sprintf)(// translators: %s: the name of the block that has been added
29
+ (0,h.__)("%s block added"),a.title);(0,Gt.speak)(m)}}})),(0,d.ifCondition)((e=>{let{hasItems:t,isAppender:n,rootClientId:o,clientId:r}=e;return t||!n&&!o&&!r}))])(Zp),Xp=(0,d.compose)((0,m.withSelect)(((e,t)=>{const{getBlockCount:n,getSettings:o,getTemplateLock:r}=e(to),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(to);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,tu.decodeEntities)(r)||(0,h.__)("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,h.__)("Add default block"),className:"block-editor-default-block-appender__content",onKeyDown:e=>{$c.ENTER!==e.keyCode&&$c.SPACE!==e.keyCode||n()},onClick:()=>n(),onFocus:()=>{o&&n()}},o?i:"\ufeff"),(0,s.createElement)(Qp,{rootClientId:l,position:"bottom right",isAppender:!0,__experimentalIsQuick:!0}))}));function Jp(e,t){let{rootClientId:n,className:o,onFocus:r,tabIndex:l}=e;return(0,s.createElement)(Qp,{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,h.sprintf)(// translators: %s: the name of the block when there is only one
30
+ (0,h._x)("Add %s","directly add the only allowed block"),d):(0,h._x)("Add block","Generic label for block inserter button");const g=!m;let f=(0,s.createElement)(p.Button,{ref:t,onFocus:r,tabIndex:l,className:c()(o,"block-editor-button-block-appender"),onClick:i,"aria-haspopup":g?"true":void 0,"aria-expanded":g?u:void 0,disabled:a,label:n},!m&&(0,s.createElement)(p.VisuallyHidden,{as:"span"},n),(0,s.createElement)(Rr,{icon:nu}));return(g||m)&&(f=(0,s.createElement)(p.Tooltip,{text:n},f)),f},isAppender:!0})}const em=(0,s.forwardRef)(((e,t)=>(V()("wp.blockEditor.ButtonBlockerAppender",{alternative:"wp.blockEditor.ButtonBlockAppender",since:"5.9"}),Jp(e,t)))),tm=(0,s.forwardRef)(Jp),nm=(0,m.withSelect)(((e,t)=>{let{rootClientId:n}=t;const{canInsertBlockType:o,getTemplateLock:l,getSelectedBlockClientId:i}=e(to);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)(Xp,{rootClientId:n}):(0,s.createElement)(tm,{rootClientId:n,className:"block-list-appender__toggle"})}return(0,s.createElement)(u,{tabIndex:-1,className:c()("block-list-appender wp-block",i),contentEditable:!1,"data-block":!0},t)}));(0,s.createContext)();const om=function(e){let{previousClientId:t,nextClientId:n,children:o,__unstablePopoverSlot:r,__unstableContentRef:l,...a}=e;const{orientation:u,rootClientId:d,isVisible:g}=(0,m.useSelect)((e=>{var o;const{getBlockListSettings:r,getBlockRootClientId:l,isBlockVisible:i}=e(to),s=l(t);return{orientation:(null===(o=r(s))||void 0===o?void 0:o.orientation)||"vertical",rootClientId:s,isVisible:i(t)&&i(n)}}),[t]),f=wo(t),v=wo(n),b="vertical"===u,k=(0,s.useMemo)((()=>{if(!f&&!v||!g)return{};const e=f?f.getBoundingClientRect():null,t=v?v.getBoundingClientRect():null;if(b)return{width:f?f.offsetWidth:v.offsetWidth,height:t&&e?t.top-e.bottom:0};let n=0;return e&&t&&(n=(0,h.isRTL)()?e.left-t.right:t.left-e.right),{width:n,height:f?f.offsetHeight:v.offsetHeight}}),[f,v,b]),_=(0,s.useCallback)((()=>{if(!f&&!v||!g)return{};const{ownerDocument:e}=f||v,t=f?f.getBoundingClientRect():null,n=v?v.getBoundingClientRect():null;return b?(0,h.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,height:0,width:0,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,height:0,width:0,ownerDocument:e}:(0,h.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,height:0,width:0,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,height:0,width:0,ownerDocument:e}}),[f,v]),y=$o(l);return f&&v&&g?(0,s.createElement)(p.Popover,i({ref:y,animate:!1,getAnchorRect:_,focusOnMount:!1,__unstableSlotName:r||null,key:n+"--"+d},a,{className:c()("block-editor-block-popover",a.className),__unstableForcePosition:!0}),(0,s.createElement)("div",{style:k},o)):null},rm=(0,s.createContext)();function lm(e){let{__unstablePopoverSlot:t,__unstableContentRef:n}=e;const{selectBlock:o,hideInsertionPoint:r}=(0,m.useDispatch)(to),l=(0,s.useContext)(rm),i=(0,s.useRef)(),{orientation:a,previousClientId:u,nextClientId:g,rootClientId:h,isInserterShown:f}=(0,m.useSelect)((e=>{var t;const{getBlockOrder:n,getBlockListSettings:o,getBlockInsertionPoint:r,isBlockBeingDragged:l,getPreviousBlockClientId:i,getNextBlockClientId:s}=e(to),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}}),[]),v="vertical"===a,b=(0,d.useReducedMotion)(),k={start:{...v?{height:0,left:"50%",right:"50%",y:0}:{width:0,top:"50%",bottom:"50%",x:0},opacity:0},rest:{...v?{height:4,left:0,right:0,y:-2}:{width:4,top:0,bottom:0,x:-2},opacity:1,borderRadius:"2px",transition:{delay:f?.4:0}},hover:{...v?{height:4,left:0,right:0,y:-2}:{width:4,top:0,bottom:0,x:-2},opacity:1,borderRadius:"2px",transition:{delay:.4}}},_={start:{scale:b?1:0},rest:{scale:1,transition:{delay:.2}}},y=c()("block-editor-block-list__insertion-point","is-"+a);return(0,s.createElement)(om,{previousClientId:u,nextClientId:g,__unstablePopoverSlot:t,__unstableContentRef:n},(0,s.createElement)(p.__unstableMotion.div,{layout:!b,initial:b?"rest":"start",animate:"rest",whileHover:"hover",whileTap:"pressed",exit:"start",ref:i,tabIndex:-1,onClick:function(e){e.target===i.current&&g&&o(g,-1)},onFocus:function(e){e.target!==i.current&&(l.current=!0)},className:c()(y,{"is-with-inserter":f}),onHoverEnd:function(e){e.target!==i.current||l.current||r()}},(0,s.createElement)(p.__unstableMotion.div,{variants:k,className:"block-editor-block-list__insertion-point-indicator"}),f&&(0,s.createElement)(p.__unstableMotion.div,{variants:_,className:c()("block-editor-block-list__insertion-point-inserter")},(0,s.createElement)(Qp,{position:"bottom center",clientId:g,rootClientId:h,__experimentalIsQuick:!0,onToggle:e=>{l.current=e},onSelectOrClose:()=>{l.current=!1}}))))}function im(e){let{children:t,...n}=e;const o=(0,m.useSelect)((e=>e(to).isBlockInsertionPointVisible()),[]);return(0,s.createElement)(rm.Provider,{value:(0,s.useRef)(!1)},o&&(0,s.createElement)(lm,n),t)}function sm(){const e=(0,s.useContext)(rm),t=(0,m.useSelect)((e=>e(to).getSettings().hasReducedUI),[]),{getBlockListSettings:n,getBlockRootClientId:o,getBlockIndex:r,isBlockInsertionPointVisible:l,isMultiSelecting:i,getSelectedBlockClientIds:a,getTemplateLock:c}=(0,m.useSelect)(to),{showInsertionPoint:u,hideInsertionPoint:p}=(0,m.useDispatch)(to);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",g=t.target.getBoundingClientRect(),h=t.clientY-g.top,f=t.clientX-g.left;let v=Array.from(t.target.children).find((e=>e.classList.contains("wp-block")&&"vertical"===m&&e.offsetTop>h||e.classList.contains("wp-block")&&"horizontal"===m&&e.offsetLeft>f));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"))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 am="undefined"==typeof window?e=>{setTimeout((()=>e(Date.now())),0)}:window.requestIdleCallback||window.requestAnimationFrame,cm="undefined"==typeof window?clearTimeout:window.cancelIdleCallback||window.cancelAnimationFrame;function um(e){return(0,m.useSelect)((t=>{if(!e)return null;const{getBlockName:n,getBlockAttributes:o}=t(to),{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,anchor:null==c?void 0:c.anchor}:d}),[e])}function dm(e){let{clientId:t,maximumLength:n,context:o}=e;const{attributes:l,name:i,reusableBlockTitle:s}=(0,m.useSelect)((e=>{if(!t)return{};const{getBlockName:n,getBlockAttributes:o,__experimentalGetReusableBlockTitle:l}=e(to),i=n(t);if(!i)return{};const s=(0,r.isReusableBlock)((0,r.getBlockType)(i));return{attributes:o(t),name:i,reusableBlockTitle:s&&l(o(t).ref)}}),[t]),a=um(t);if(!i||!a)return null;const c=(0,r.getBlockType)(i),u=c?(0,r.__experimentalGetBlockLabel)(c,l,o):null,d=s||u,p=d&&d!==c.title?d:a.title;if(n&&n>0&&p.length>n){const e="...";return p.slice(0,n-e.length)+e}return p}function pm(e){let{clientId:t,maximumLength:n,context:o}=e;return dm({clientId:t,maximumLength:n,context:o})}const mm=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{canMoveBlocks:o,getBlockRootClientId:l,getBlockName:i}=e(to),s=l(n[0]),a=i(n[0]);return{srcRootClientId:s,isDraggable:o(n,s),icon:null===(t=(0,r.getBlockType)(a))||void 0===t?void 0:t.icon}}),[n]),d=(0,s.useRef)(!1),[g,h,f]=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,Bl.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)(to);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,g(e),l&&l()},onDragOver:h,onDragEnd:()=>{b(),d.current=!1,f(),i&&i()},__experimentalDragComponent:(0,s.createElement)(qd,{count:n.length,icon:u})},(e=>{let{onDraggableStart:n,onDraggableEnd:o}=e;return t({draggable:!0,onDragStart:n,onDragEnd:o})}))},gm=function(e){let{clientId:t,rootClientId:n}=e;const o=um(t),l=(0,m.useSelect)((e=>{var o;const{getBlock:r,getBlockIndex:l,hasBlockMovingClientId:i,getBlockListSettings:s}=e(to),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:a,name:u,attributes:d,blockMovingMode:g,orientation:f}=l,{setNavigationMode:v,removeBlock:b}=(0,m.useDispatch)(to),k=(0,s.useRef)(),_=(0,r.getBlockType)(u),y=(0,r.__experimentalGetAccessibleBlockLabel)(_,d,a+1,f);(0,s.useEffect)((()=>{k.current.focus(),(0,Gt.speak)(y)}),[y]);const E=wo(t),{hasBlockMovingClientId:C,getBlockIndex:S,getBlockRootClientId:w,getClientIdsOfDescendants:B,getSelectedBlockClientId:I,getMultiSelectedBlocksEndClientId:x,getPreviousBlockClientId:T,getNextBlockClientId:N,isNavigationMode:P}=(0,m.useSelect)(to),{selectBlock:L,clearSelectedBlock:M,setBlockMovingClientId:R,moveBlockToPosition:A}=(0,m.useDispatch)(to),D=c()("block-editor-block-list__block-selection-button",{"is-block-moving-mode":!!g}),O=(0,h.__)("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)(iu,{icon:null==o?void 0:o.icon,showColors:!0})),(0,s.createElement)(p.FlexItem,null,(0,s.createElement)(mm,{clientIds:[t]},(e=>(0,s.createElement)(p.Button,i({icon:Kd,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:k,onClick:()=>v(!1),onKeyDown:function(e){const{keyCode:n}=e,o=n===$c.UP,r=n===$c.DOWN,l=n===$c.LEFT,i=n===$c.RIGHT,s=n===$c.TAB,a=n===$c.ESCAPE,c=n===$c.ENTER,u=n===$c.SPACE,d=e.shiftKey;if(n===$c.BACKSPACE||n===$c.DELETE)return b(t),void e.preventDefault();const p=I(),m=x(),g=T(m||p),h=N(m||p),f=s&&d||o,v=s&&!d||r,k=l,_=i;let y;if(f)y=g;else if(v)y=h;else if(k){var D;y=null!==(D=w(p))&&void 0!==D?D:p}else if(_){var O;y=null!==(O=B([p])[0])&&void 0!==O?O:p}const F=C();if(a&&P()&&(M(),e.preventDefault()),a&&F&&!e.defaultPrevented&&(R(null),e.preventDefault()),(c||u)&&F){const e=w(F),t=w(p),n=S(F);let o=S(p);n<o&&e===t&&(o-=1),A(F,e,t,o),L(F),R(null)}if(v||f||k||_)if(y)e.preventDefault(),L(y);else if(s&&p){let t;if(v){t=E;do{t=Bl.focus.tabbable.findNext(t)}while(t&&E.contains(t));t||(t=E.ownerDocument.defaultView.frameElement,t=Bl.focus.tabbable.findNext(t))}else t=Bl.focus.tabbable.findPrevious(E);t&&(e.preventDefault(),t.focus(),M())}},label:y,showTooltip:!1,className:"block-selection-button_select-button"},(0,s.createElement)(pm,{clientId:t,maximumLength:35})))))};function hm(e){return Array.from(e.querySelectorAll("[data-toolbar-item]"))}const fm=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=!Bl.focus.tabbable.find(e.current).some((e=>!("toolbarItem"in e.dataset)));t||V()("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]=Bl.focus.tabbable.find(e);t&&t.focus({preventScroll:!0})}(e.current)}),[]);(0,ku.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=hm(e.current),n=i||0;var o;t[n]&&(o=e.current).contains(o.ownerDocument.activeElement)&&t[n].focus({preventScroll:!0})}))),()=>{if(window.cancelAnimationFrame(t),!r||!e.current)return;const n=hm(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)},vm=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M10.6 6L9.4 7l4.6 5-4.6 5 1.2 1 5.4-6z"})),bm=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M14.6 7l-1.2-1L8 12l5.4 6 1.2-1-4.6-5z"})),km=(0,s.createElement)(D.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,s.createElement)(D.Path,{d:"M6.5 12.4L12 8l5.5 4.4-.9 1.2L12 10l-4.5 3.6-1-1.2z"})),_m=(0,s.createElement)(D.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,s.createElement)(D.Path,{d:"M17.5 11.6L12 16l-5.5-4.4.9-1.2L12 14l4.5-3.6 1 1.2z"}));const ym=(e,t)=>"up"===e?"horizontal"===t?(0,h.isRTL)()?vm:bm:km:"down"===e?"horizontal"===t?(0,h.isRTL)()?bm:vm:_m:null,Em=(e,t)=>"up"===e?"horizontal"===t?(0,h.isRTL)()?(0,h.__)("Move right"):(0,h.__)("Move left"):(0,h.__)("Move up"):"down"===e?"horizontal"===t?(0,h.isRTL)()?(0,h.__)("Move left"):(0,h.__)("Move right"):(0,h.__)("Move down"):null,Cm=(0,s.forwardRef)(((e,t)=>{let{clientIds:n,direction:o,orientation:l,...a}=e;const g=(0,d.useInstanceId)(Cm),f=(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(to),d=(0,u.castArray)(n),p=(0,u.first)(d),m=i(p),g=t(p),h=t((0,u.last)(d)),f=s(m),v=a(p),b=0===g,k=h===f.length-1,{orientation:_}=c(m)||{};return{blockType:v?(0,r.getBlockType)(v.name):null,isDisabled:"up"===o?b:k,rootClientId:m,firstIndex:g,isFirst:b,isLast:k,orientation:l||_}}),[n,o]),{moveBlocksDown:S,moveBlocksUp:w}=(0,m.useDispatch)(to),B="up"===o?w:S,I=`block-editor-block-mover-button__description-${g}`;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:ym(o,C),label:Em(o,C),"aria-describedby":I},a,{onClick:b?null:e=>{B(n,k),a.onClick&&a.onClick(e)},disabled:b,__experimentalIsFocusable:!0})),(0,s.createElement)(p.VisuallyHidden,{id:I},function(e,t,n,o,r,l,i){const s=n+1,a=e=>"up"===e?"horizontal"===i?(0,h.isRTL)()?"right":"left":"up":"down"===e?"horizontal"===i?(0,h.isRTL)()?"left":"right":"down":null;if(e>1)return function(e,t,n,o,r){const l=t+1;return r<0&&n?(0,h.__)("Blocks cannot be moved up as they are already at the top"):r>0&&o?(0,h.__)("Blocks cannot be moved down as they are already at the bottom"):r<0&&!n?(0,h.sprintf)(// translators: 1: Number of selected blocks, 2: Position of selected blocks
31
  (0,h._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,h.sprintf)(// translators: 1: Number of selected blocks, 2: Position of selected blocks
32
  (0,h._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,h.sprintf)(// translators: %s: Type of block (i.e. Text, Image etc)
33
  (0,h.__)("Block %s is the only block, and cannot be moved"),t);if(l>0&&!r){const e=a("down");if("down"===e)return(0,h.sprintf)(// translators: 1: Type of block (i.e. Text, Image etc), 2: Position of selected block, 3: New position
42
  (0,h.__)("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,h.sprintf)(// translators: 1: Type of block (i.e. Text, Image etc)
43
  (0,h.__)("Block %1$s is at the beginning of the content and can’t be moved up"),t);if("left"===e)return(0,h.sprintf)(// translators: 1: Type of block (i.e. Text, Image etc)
44
  (0,h.__)("Block %1$s is at the beginning of the content and can’t be moved left"),t);if("right"===e)return(0,h.sprintf)(// translators: 1: Type of block (i.e. Text, Image etc)
45
+ (0,h.__)("Block %1$s is at the beginning of the content and can’t be moved right"),t)}}(f,v&&v.title,E,_,y,"up"===o?-1:1,C)))})),Sm=(0,s.forwardRef)(((e,t)=>(0,s.createElement)(Cm,i({direction:"up",ref:t},e)))),wm=(0,s.forwardRef)(((e,t)=>(0,s.createElement)(Cm,i({direction:"down",ref:t},e)))),Bm=function(e){let{clientIds:t,hideDragHandle:n}=e;const{canMove:o,rootClientId:r,isFirst:l,isLast:a,orientation:d}=(0,m.useSelect)((e=>{var n;const{getBlockIndex:o,getBlockListSettings:r,canMoveBlocks:l,getBlockOrder:i,getBlockRootClientId:s}=e(to),a=(0,u.castArray)(t),c=(0,u.first)(a),d=s((0,u.first)(a)),p=o(c),m=o((0,u.last)(a)),g=i(d);return{canMove:l(t,d),rootClientId:d,isFirst:0===p,isLast:m===g.length-1,orientation:null===(n=r(d))||void 0===n?void 0:n.orientation}}),[t]);if(!o||l&&a&&!r)return null;const g=(0,h.__)("Drag");return(0,s.createElement)(p.ToolbarGroup,{className:c()("block-editor-block-mover",{"is-horizontal":"horizontal"===d})},!n&&(0,s.createElement)(mm,{clientIds:t},(e=>(0,s.createElement)(p.Button,i({icon:Kd,className:"block-editor-block-mover__drag-handle","aria-hidden":"true",label:g,tabIndex:"-1"},e)))),(0,s.createElement)("div",{className:"block-editor-block-mover__move-button-container"},(0,s.createElement)(p.ToolbarItem,null,(e=>(0,s.createElement)(Sm,i({clientIds:t},e)))),(0,s.createElement)(p.ToolbarItem,null,(e=>(0,s.createElement)(wm,i({clientIds:t},e))))))},{clearTimeout:Im,setTimeout:xm}=window,Tm=()=>{},Nm=200;function Pm(e){let{ref:t,isFocused:n,debounceTimeout:o=Nm,onChange:r=Tm}=e;const[l,i]=(0,s.useState)(!1),a=(0,s.useRef)(),c=e=>{null!=t&&t.current&&i(e),r(e)},u=()=>{const e=a.current;e&&Im&&Im(e)};return(0,s.useEffect)((()=>()=>{c(!1),u()}),[]),{showMovers:l,debouncedShowMovers:e=>{e&&e.stopPropagation(),u(),l||c(!0)},debouncedHideMovers:e=>{e&&e.stopPropagation(),u(),a.current=xm((()=>{(()=>{const e=(null==t?void 0:t.current)&&t.current.matches(":hover");return!n&&!e})()&&c(!1)}),o)}}}function Lm(e){let{ref:t,debounceTimeout:n=Nm,onChange:o=Tm}=e;const[r,l]=(0,s.useState)(!1),{showMovers:i,debouncedShowMovers:a,debouncedHideMovers:c}=Pm({ref:t,debounceTimeout:n,isFocused:r,onChange:o}),u=(0,s.useRef)(!1),d=()=>(null==t?void 0:t.current)&&t.current.contains(t.current.ownerDocument.activeElement);return(0,s.useEffect)((()=>{const e=t.current,n=()=>{d()&&(l(!0),a())},o=()=>{d()||(l(!1),c())};return e&&!u.current&&(e.addEventListener("focus",n,!0),e.addEventListener("blur",o,!0),u.current=!0),()=>{e&&(e.removeEventListener("focus",n),e.removeEventListener("blur",o))}}),[t,u,l,a,c]),{showMovers:i,gestures:{onMouseMove:a,onMouseLeave:c}}}function Mm(){const{selectBlock:e,toggleBlockHighlight:t}=(0,m.useDispatch)(to),{firstParentClientId:n,shouldHide:o,hasReducedUI:l}=(0,m.useSelect)((e=>{const{getBlockName:t,getBlockParents:n,getSelectedBlockClientId:o,getSettings:l}=e(to),{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=um(n),c=(0,s.useRef)(),{gestures:u}=Lm({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,h.sprintf)(
46
  /* translators: %s: Name of the block's parent. */
47
+ (0,h.__)("Select %s"),a.title),showTooltip:!0,icon:(0,s.createElement)(iu,{icon:a.icon})}))}const Rm=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.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 Am(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,h.__)("Preview")),(0,s.createElement)(Gd,{viewportWidth:500,blocks:t})))))}const Dm=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,h.__)("Transform to"),className:t},i&&(0,s.createElement)(Am,{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)(iu,{icon:n,showColors:!0}),l)})))},Om=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M16.7 7.1l-6.3 8.5-3.3-2.5-.9 1.2 4.5 3.4L17.9 8z"})),Fm=window.wp.tokenList;var zm=n.n(Fm);function Vm(e,t,n){const o=new(zm())(e);return t&&o.remove("is-style-"+t.name),o.add("is-style-"+n.name),o.value}function Hm(e){return(0,u.find)(e,"isDefault")}function Gm(e){let{clientId:t,onSwitch:n}=e;const{styles:o,block:l,blockType:i,className:a}=(0,m.useSelect)((e=>{const{getBlock:n}=e(to),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)(to),d=function(e){return e&&0!==e.length?Hm(e)?e:[{name:"default",label:(0,h._x)("Default","block style"),isDefault:!0},...e]:[]}(o),p=function(e,t){for(const n of new(zm())(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),g=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=Vm(a,p,e);c(t,{className:o}),n()},stylesToRender:d,activeStyle:p,genericPreviewBlock:g,className:a}}const Um=()=>{};function Wm(e){let{clientId:t,onSwitch:n=Um}=e;const{onSelect:o,stylesToRender:r,activeStyle:l}=Gm({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?Om:null,onClick:()=>o(e)},(0,s.createElement)(p.__experimentalText,{as:"span",limit:18,ellipsizeMode:"tail",truncate:!0},t))}))):null}function $m(e){let{hoveredBlock:t,onSwitch:n}=e;const{clientId:o}=t;return(0,s.createElement)(p.MenuGroup,{label:(0,h.__)("Styles"),className:"block-editor-block-switcher__styles__menugroup"},(0,s.createElement)(Wm,{clientId:o,onSwitch:n}))}const jm=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=jm(e,t,n);if(o)return o}}},Km=(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 qm(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,h.__)("Preview")),(0,s.createElement)(Ym,{patterns:t,onSelect:n})))))}function Ym(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,h.__)("Patterns list")}),t.map((e=>(0,s.createElement)(Zm,{key:e.name,pattern:e,onSelect:n,composite:o}))))}function Zm(e){let{pattern:t,onSelect:n,composite:o}=e;const r="block-editor-block-switcher__preview-patterns-container",l=(0,d.useInstanceId)(Zm,`${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)(Gd,{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))}const Qm=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=jm(r,t.name,o);if(n){e=!0,o.add(n.clientId),Km(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)(qm,{patterns:a,onSelect:o}),(0,s.createElement)(p.MenuItem,{onClick:e=>{e.preventDefault(),i(!l)},icon:vm},(0,h.__)("Patterns"))):null},Xm=e=>{let{clientIds:t,blocks:n}=e;const{replaceBlocks:o}=(0,m.useDispatch)(to),l=um(n[0].clientId),{possibleBlockTransformations:i,canRemove:a,hasBlockStyles:c,icon:d,blockTitle:g,patterns:f}=(0,m.useSelect)((e=>{var o;const{getBlockRootClientId:i,getBlockTransformItems:s,__experimentalGetPatternTransformItems:a}=e(to),{getBlockStyles:c,getBlockType:d}=e(r.store),{canRemoveBlocks:p}=e(to),m=i((0,u.castArray)(t)[0]),[{name:g}]=n,h=1===n.length,f=h&&c(g);let v;var b;h?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(g))||void 0===b?void 0:b.icon:Rm;return{possibleBlockTransformations:s(n,m),canRemove:p(t,m),hasBlockStyles:!(null==f||!f.length),icon:v,blockTitle:null===(o=d(g))||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&&!b,_=!(null==f||!f.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:g,icon:(0,s.createElement)(s.Fragment,null,(0,s.createElement)(iu,{icon:d,showColors:!0}),(v||b)&&(0,s.createElement)("span",{className:"block-editor-block-switcher__toggle-text"},(0,s.createElement)(pm,{clientId:t,maximumLength:35})))}));const y=g,E=1===n.length?(0,h.sprintf)(
48
  /* translators: %s: block title. */
49
  (0,h.__)("%s: Change block type or style"),g):(0,h.sprintf)(
50
  /* translators: %d: number of blocks. */
51
+ (0,h._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)(iu,{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)(pm,{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)(Qm,{blocks:n,patterns:f,onSelect:e=>{(e=>{o(t,e)})(e),l()}}),k&&(0,s.createElement)(Dm,{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)($m,{hoveredBlock:n[0],onSwitch:l}))})))))},Jm=e=>{let{clientIds:t}=e;const n=(0,m.useSelect)((e=>e(to).getBlocksByClientId(t)),[t]);return!n.length||n.some((e=>!e))?null:(0,s.createElement)(Xm,{clientIds:t,blocks:n})},{Fill:eg,Slot:tg}=(0,p.createSlotFill)("__unstableBlockToolbarLastItem");eg.Slot=tg;const ng=eg,og=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M13 19h-2v-2h2v2zm0-6h-2v-2h2v2zm0-6h-2V5h2v2z"})),rg=window.wp.blob;function lg(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 ig(){const{getBlockName:e}=(0,m.useSelect)(to),{getBlockType:t}=(0,m.useSelect)(r.store),{createSuccessNotice:n}=(0,m.useDispatch)(sp.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,h.sprintf)(// Translators: Name of the block being copied, e.g. "Paragraph".
52
  (0,h.__)('Copied "%s" to clipboard.'),s):(0,h.sprintf)(// Translators: Name of the block being cut, e.g. "Paragraph".
53
  (0,h.__)('Moved "%s" to clipboard.'),s)}else l="copy"===o?(0,h.sprintf)(// Translators: %d: Number of blocks being copied.
54
  (0,h._n)("Copied %d block to clipboard.","Copied %d blocks to clipboard.",r.length),r.length):(0,h.sprintf)(// Translators: %d: Number of blocks being cut.
55
+ (0,h._n)("Moved %d block to clipboard.","Moved %d blocks to clipboard.",r.length),r.length);n(l,{type:"snackbar"})}),[])}function sg(){const{getBlocksByClientId:e,getSelectedBlockClientIds:t,hasMultiSelection:n,getSettings:o,__unstableIsFullySelected:l,__unstableIsSelectionCollapsed:i,__unstableIsSelectionMergeable:s,__unstableGetSelectedBlocksWithPartialSelection:a}=(0,m.useSelect)(to),{flashBlock:c,removeBlocks:u,replaceBlocks:p,__unstableDeleteSelection:g,__unstableExpandSelection:h}=(0,m.useDispatch)(to),f=ig();return(0,d.useRefEffect)((d=>{function m(m){const v=t();if(0===v.length)return;if(!n()){const{target:e}=m,{ownerDocument:t}=e;if("copy"===m.type||"cut"===m.type?(0,Bl.documentHasUncollapsedSelection)(t):(0,Bl.documentHasSelection)(t))return}if(!d.contains(m.target.ownerDocument.activeElement))return;const b=m.defaultPrevented;m.preventDefault();const k=s(),_=i()||l(),y=!_&&!k;if("copy"===m.type||"cut"===m.type)if(1===v.length&&c(v[0]),y)h();else{let t;if(f(m.type,v),_)t=e(v);else{const[n,o]=a();t=[n,...e(v.slice(1,v.length-1)),o]}const n=(0,r.serialize)(t);m.clipboardData.setData("text/plain",(E=(E=n).replace(/<br>/g,"\n"),(0,Bl.__unstableStripHTML)(E).trim().replace(/\n\n+/g,"\n\n"))),m.clipboardData.setData("text/html",n)}var E;if("cut"===m.type)_&&!y?u(v):g();else if("paste"===m.type){if(b)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,Bl.getFilesFromDataTransfer)(t).filter((e=>{let{type:t}=e;return/^image\/(?:jpe?g|png|gif|webp)$/.test(t)}));return r.length&&!lg(r,o)&&(o=r.map((e=>`<img src="${(0,rg.createBlobURL)(e)}">`)).join(""),n=""),{html:o,plainText:n}}(m),l=(0,r.pasteHandler)({HTML:n,plainText:t,mode:"BLOCKS",canUserUseUnfilteredHTML:e});p(v,l,l.length-1,-1)}}return d.ownerDocument.addEventListener("copy",m),d.ownerDocument.addEventListener("cut",m),d.ownerDocument.addEventListener("paste",m),()=>{d.ownerDocument.removeEventListener("copy",m),d.ownerDocument.removeEventListener("cut",m),d.ownerDocument.removeEventListener("paste",m)}}),[])}const ag=function(e){let{children:t}=e;return(0,s.createElement)("div",{ref:sg()},t)};function cg(e){let{clientIds:t,children:n,__experimentalUpdateSelection:o}=e;const{canInsertBlockType:l,getBlockRootClientId:i,getBlocksByClientId:s,canMoveBlocks:a,canRemoveBlocks:c}=(0,m.useSelect)(to),{getDefaultBlockName:d,getGroupingBlockName:p}=(0,m.useSelect)(r.store),g=s(t),h=i(t[0]),f=(0,u.every)(g,(e=>!!e&&(0,r.hasBlockSupport)(e.name,"multiple",!0)&&l(e.name,h))),v=l(d(),h),b=a(t,h),k=c(t,h),{removeBlocks:_,replaceBlocks:y,duplicateBlocks:E,insertAfterBlock:C,insertBeforeBlock:S,flashBlock:w,setBlockMovingClientId:B,setNavigationMode:I,selectBlock:x}=(0,m.useDispatch)(to),T=ig();return n({canDuplicate:f,canInsertDefaultBlock:v,canMove:b,canRemove:k,rootClientId:h,blocks:g,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(){I(!0),x(t[0]),B(t[0])},onGroup(){if(!g.length)return;const e=p(),n=(0,r.switchToBlockType)(g,e);n&&y(t,n)},onUngroup(){if(!g.length)return;const e=g[0].innerBlocks;e.length&&y(t,e)},onCopy(){const e=g.map((e=>{let{clientId:t}=e;return t}));1===g.length&&w(e[0]),T("copy",e)}})}const ug=()=>{},dg=(0,d.compose)([(0,m.withSelect)(((e,t)=>{let{clientId:n}=t;const{getBlock:o,getBlockMode:l,getSettings:i}=e(to),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=ug,clientId:o}=t;return{onToggleMode(){e(to).toggleBlockMode(o),n()}}}))])((function(e){let{blockType:t,mode:n,onToggleMode:o,small:l=!1,isCodeEditingEnabled:i=!0}=e;if(!t||!(0,r.hasBlockSupport)(t,"html",!0)||!i)return null;const a="visual"===n?(0,h.__)("Edit as HTML"):(0,h.__)("Edit visually");return(0,s.createElement)(p.MenuItem,{onClick:o},!l&&a)})),pg=(0,d.compose)((0,m.withSelect)(((e,t)=>{let{clientId:n}=t;const o=e(to).getBlock(n);return{block:o,shouldRender:o&&"core/html"===o.name}})),(0,m.withDispatch)(((e,t)=>{let{block:n}=t;return{onClick:()=>e(to).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,h.__)("Convert to Blocks");return(0,s.createElement)(p.MenuItem,{onClick:n},!o&&r)})),{Fill:mg,Slot:gg}=(0,p.createSlotFill)("__unstableBlockSettingsMenuFirstItem");mg.Slot=gg;const hg=mg;function fg(e){let{clientIds:t,isGroupable:n,isUngroupable:o,blocksSelection:l,groupingBlockName:i,onClose:a=(()=>{})}=e;const{replaceBlocks:c}=(0,m.useDispatch)(to);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,h._x)("Group","verb")),o&&(0,s.createElement)(p.MenuItem,{onClick:()=>{(()=>{const e=l[0].innerBlocks;e.length&&c(t,e)})(),a()}},(0,h._x)("Ungroup","Ungrouping blocks from within a Group block back into individual blocks within the Editor "))):null}function vg(){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(to),{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}}function bg(e){return(0,m.useSelect)((t=>{const{canEditBlock:n,canMoveBlock:o,canRemoveBlock:r,canLockBlockType:l,getBlockName:i,getBlockRootClientId:s}=t(to),a=s(e),c=n(e),u=o(e,a),d=r(e,a);return{canEdit:c,canMove:u,canRemove:d,canLock:l(i(e)),isLocked:!c||!u||!d}}),[e])}const kg=(0,s.createElement)(D.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,s.createElement)(D.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"})),_g=(0,s.createElement)(D.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,s.createElement)(D.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"}));function yg(e){return e.remove&&e.move?"all":!(!e.remove||e.move)&&"insert"}function Eg(e){let{clientId:t,onClose:n}=e;const[o,l]=(0,s.useState)({move:!1,remove:!1}),{canEdit:i,canMove:a,canRemove:c}=bg(t),{isReusable:u,templateLock:g,hasTemplateLock:f}=(0,m.useSelect)((e=>{var n,o;const{getBlockName:l,getBlockAttributes:i}=e(to),s=l(t),a=(0,r.getBlockType)(s);return{isReusable:(0,r.isReusableBlock)(a),templateLock:null===(n=i(t))||void 0===n?void 0:n.templateLock,hasTemplateLock:!(null==a||null===(o=a.attributes)||void 0===o||!o.templateLock)}}),[t]),[v,b]=(0,s.useState)(!!g),{updateBlockAttributes:k}=(0,m.useDispatch)(to),_=um(t),y=(0,d.useInstanceId)(Eg,"block-editor-block-lock-modal__options-title");(0,s.useEffect)((()=>{l({move:!a,remove:!c,...u?{edit:!i}:{}})}),[i,a,c,u]);const E=Object.values(o).every(Boolean),C=Object.values(o).some(Boolean)&&!E;return(0,s.createElement)(p.Modal,{title:(0,h.sprintf)(
56
  /* translators: %s: Name of the block. */
57
+ (0,h.__)("Lock %s"),_.title),overlayClassName:"block-editor-block-lock-modal",closeLabel:(0,h.__)("Close"),onRequestClose:n},(0,s.createElement)("form",{onSubmit:e=>{e.preventDefault(),k([t],{lock:o,templateLock:v?yg(o):void 0}),n()}},(0,s.createElement)("p",null,(0,h.__)("Choose specific attributes to restrict or lock all available options.")),(0,s.createElement)("div",{role:"group","aria-labelledby":y,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:y},(0,h.__)("Lock all")),checked:E,indeterminate:C,onChange:e=>l({move:e,remove:e,...u?{edit:e}:{}})}),(0,s.createElement)("ul",{className:"block-editor-block-lock-modal__checklist"},u&&(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,h.__)("Restrict editing"),(0,s.createElement)(p.Icon,{icon:o.edit?_g:kg})),checked:!!o.edit,onChange:e=>l((t=>({...t,edit: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,h.__)("Disable movement"),(0,s.createElement)(p.Icon,{icon:o.move?_g:kg})),checked:o.move,onChange:e=>l((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,h.__)("Prevent removal"),(0,s.createElement)(p.Icon,{icon:o.remove?_g:kg})),checked:o.remove,onChange:e=>l((t=>({...t,remove:e})))}))),f&&(0,s.createElement)(p.ToggleControl,{className:"block-editor-block-lock-modal__template-lock",label:(0,h.__)("Apply to all blocks inside"),checked:v,disabled:o.move&&!o.remove,onChange:()=>b(!v)})),(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,h.__)("Cancel"))),(0,s.createElement)(p.FlexItem,null,(0,s.createElement)(p.Button,{variant:"primary",type:"submit"},(0,h.__)("Apply"))))))}function Cg(e){let{clientId:t}=e;const{canLock:n,isLocked:o}=bg(t),[r,l]=(0,s.useReducer)((e=>!e),!1);if(!n)return null;const i=o?(0,h.__)("Unlock"):(0,h.__)("Lock");return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.MenuItem,{icon:o?kg:_g,onClick:l},i),r&&(0,s.createElement)(Eg,{clientId:t,onClose:l}))}const{Fill:Sg,Slot:wg}=(0,p.createSlotFill)("BlockSettingsMenuControls");function Bg(e){let{...t}=e;return(0,s.createElement)(p.__experimentalStyleProvider,{document},(0,s.createElement)(Sg,t))}Bg.Slot=e=>{let{fillProps:t,clientIds:n=null}=e;const{selectedBlocks:o,selectedClientIds:r,canRemove:l}=(0,m.useSelect)((e=>{const{getBlocksByClientId:t,getSelectedBlockClientIds:o,canRemoveBlocks:r}=e(to),l=null!==n?n:o();return{selectedBlocks:(0,u.map)((0,u.compact)(t(l)),(e=>e.name)),selectedClientIds:l,canRemove:r(l)}}),[n]),{canLock:a}=bg(r[0]),c=1===r.length&&a,d=vg(),{isGroupable:g,isUngroupable:h}=d,f=(g||h)&&l;return(0,s.createElement)(wg,{fillProps:{...t,selectedBlocks:o,selectedClientIds:r}},(e=>!(null!=e&&e.length)>0&&!f&&!c?null:(0,s.createElement)(p.MenuGroup,null,c&&(0,s.createElement)(Cg,{clientId:r[0]}),e,f&&(0,s.createElement)(fg,i({},d,{onClose:null==t?void 0:t.onClose})))))};const Ig=Bg,xg=()=>{},Tg={className:"block-editor-block-settings-menu__popover",position:"bottom right",isAlternate:!0};function Ng(e){let{blocks:t,onCopy:n}=e;const o=(0,d.useCopyToClipboard)((()=>(0,r.serialize)(t)),n),l=t.length>1?(0,h.__)("Copy blocks"):(0,h.__)("Copy block");return(0,s.createElement)(p.MenuItem,{ref:o},l)}const Pg=function(e){let{clientIds:t,__experimentalSelectBlock:n,children:o,...l}=e;const a=(0,u.castArray)(t),c=a.length,d=a[0],{firstParentClientId:g,hasReducedUI:f,onlyBlock:v,parentBlockType:b,previousBlockClientId:k,nextBlockClientId:_,selectedBlockClientIds:y}=(0,m.useSelect)((e=>{const{getBlockCount:t,getBlockName:n,getBlockParents:o,getPreviousBlockClientId:l,getNextBlockClientId:i,getSelectedBlockClientIds:s,getSettings:a}=e(to),c=o(d),u=c[c.length-1],p=n(u);return{firstParentClientId:u,hasReducedUI:a().hasReducedUI,onlyBlock:1===t(),parentBlockType:(0,r.getBlockType)(p),previousBlockClientId:l(d),nextBlockClientId:i(d),selectedBlockClientIds:s()}}),[d]),E=(0,m.useSelect)((e=>{const{getShortcutRepresentation:t}=e(ku.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")}}),[]),{selectBlock:C,toggleBlockHighlight:S}=(0,m.useDispatch)(to),w=(0,s.useCallback)(n?async e=>{const t=await e;t&&t[0]&&n(t[0])}:xg,[n]),B=dm({clientId:d,maximumLength:25}),I=(0,s.useCallback)(n?()=>{const e=k||_;e&&y.includes(d)&&!y.includes(e)&&n(e)}:xg,[n,k,_,y]),x=(0,h.sprintf)(
58
  /* translators: %s: block name */
59
+ (0,h.__)("Remove %s"),B),T=1===c?x:(0,h.__)("Remove blocks"),N=(0,s.useRef)(),{gestures:P}=Lm({ref:N,onChange(e){e&&f||S(g,e)}});return(0,s.createElement)(cg,{clientIds:t,__experimentalUpdateSelection:!n},(e=>{let{canDuplicate:n,canInsertDefaultBlock:r,canMove:a,canRemove:m,onDuplicate:f,onInsertAfter:k,onInsertBefore:_,onRemove:y,onCopy:S,onMoveTo:B,blocks:x}=e;return(0,s.createElement)(p.DropdownMenu,i({icon:og,label:(0,h.__)("Options"),className:"block-editor-block-settings-menu",popoverProps:Tg,noIcons:!0},l),(e=>{let{onClose:l}=e;return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.MenuGroup,null,(0,s.createElement)(hg.Slot,{fillProps:{onClose:l}}),void 0!==g&&(0,s.createElement)(p.MenuItem,i({},P,{ref:N,icon:(0,s.createElement)(iu,{icon:b.icon}),onClick:()=>C(g)}),(0,h.sprintf)(
60
  /* translators: %s: Name of the block's parent. */
61
+ (0,h.__)("Select parent block (%s)"),b.title)),1===c&&(0,s.createElement)(pg,{clientId:d}),(0,s.createElement)(Ng,{blocks:x,onCopy:S}),n&&(0,s.createElement)(p.MenuItem,{onClick:(0,u.flow)(l,f,w),shortcut:E.duplicate},(0,h.__)("Duplicate")),r&&(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.MenuItem,{onClick:(0,u.flow)(l,_),shortcut:E.insertBefore},(0,h.__)("Insert before")),(0,s.createElement)(p.MenuItem,{onClick:(0,u.flow)(l,k),shortcut:E.insertAfter},(0,h.__)("Insert after"))),a&&!v&&(0,s.createElement)(p.MenuItem,{onClick:(0,u.flow)(l,B)},(0,h.__)("Move to")),1===c&&(0,s.createElement)(dg,{clientId:d,onToggle:l})),(0,s.createElement)(Ig.Slot,{fillProps:{onClose:l},clientIds:t}),"function"==typeof o?o({onClose:l}):s.Children.map((e=>(0,s.cloneElement)(e,{onClose:l}))),m&&(0,s.createElement)(p.MenuGroup,null,(0,s.createElement)(p.MenuItem,{onClick:(0,u.flow)(l,y,I),shortcut:E.remove},T)))}))}))};function Lg(e){let{clientIds:t,...n}=e;const{block:o,shouldRender:l}=(0,m.useSelect)((e=>{const n=t[0],{isBlockMultiSelected:o,getBlockMode:r,getBlock:l}=e(to),i=!o(n),s="html"===r(n);return{block:l(n),shouldRender:i&&s}}),[t[0]]),{replaceBlocks:a}=(0,m.useDispatch)(to),c=(0,s.useCallback)((()=>{a(o.clientId,(0,r.rawHandler)({HTML:(0,r.getBlockContent)(o)}))}),[o]);return l?(0,s.createElement)(p.ToolbarGroup,null,(0,s.createElement)(p.ToolbarButton,i({onClick:c},n),(0,h.__)("Edit visually"))):null}const Mg=function(e){let{clientIds:t,...n}=e;return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(Lg,i({clientIds:t},n)),(0,s.createElement)(p.ToolbarGroup,null,(0,s.createElement)(p.ToolbarItem,null,(e=>(0,s.createElement)(Pg,i({clientIds:t,toggleProps:e},n))))))};function Rg(e){let{clientId:t}=e;const n=um(t),{canEdit:o,canMove:r,canRemove:l,canLock:i}=bg(t),[a,c]=(0,s.useReducer)((e=>!e),!1);return i?o&&r&&l?null:(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.ToolbarGroup,{className:"block-editor-block-lock-toolbar"},(0,s.createElement)(p.ToolbarButton,{icon:_g,label:(0,h.sprintf)(
62
  /* translators: %s: block name */
63
+ (0,h.__)("Unlock %s"),n.title),onClick:c})),a&&(0,s.createElement)(Eg,{clientId:t,onClose:c})):null}const Ag=(0,s.createElement)(D.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,s.createElement)(D.Path,{d:"M18 4h-7c-1.1 0-2 .9-2 2v3H6c-1.1 0-2 .9-2 2v7c0 1.1.9 2 2 2h7c1.1 0 2-.9 2-2v-3h3c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm-4.5 14c0 .3-.2.5-.5.5H6c-.3 0-.5-.2-.5-.5v-7c0-.3.2-.5.5-.5h3V13c0 1.1.9 2 2 2h2.5v3zm0-4.5H11c-.3 0-.5-.2-.5-.5v-2.5H13c.3 0 .5.2.5.5v2.5zm5-.5c0 .3-.2.5-.5.5h-3V11c0-1.1-.9-2-2-2h-2.5V6c0-.3.2-.5.5-.5h7c.3 0 .5.2.5.5v7z"})),Dg=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M9.2 6.5H4V8h5.2c.3 0 .5.2.5.5v7c0 .3-.2.5-.5.5H4v1.5h5.2c1.1 0 2-.9 2-2v-7c0-1.1-.8-2-2-2zM14.8 8H20V6.5h-5.2c-1.1 0-2 .9-2 2v7c0 1.1.9 2 2 2H20V16h-5.2c-.3 0-.5-.2-.5-.5v-7c-.1-.3.2-.5.5-.5z"})),Og=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M16 4v5.2c0 .3-.2.5-.5.5h-7c-.3.1-.5-.2-.5-.5V4H6.5v5.2c0 1.1.9 2 2 2h7c1.1 0 2-.9 2-2V4H16zm-.5 8.8h-7c-1.1 0-2 .9-2 2V20H8v-5.2c0-.3.2-.5.5-.5h7c.3 0 .5.2.5.5V20h1.5v-5.2c0-1.2-.9-2-2-2z"})),Fg={group:void 0,row:{type:"flex",flexWrap:"nowrap"},stack:{type:"flex",orientation:"vertical"}},zg=function(){const{blocksSelection:e,clientIds:t,groupingBlockName:n,isGroupable:o}=vg(),{replaceBlocks:l}=(0,m.useDispatch)(to),{canRemove:i,variations:a}=(0,m.useSelect)((e=>{const{canRemoveBlocks:o}=e(to),{getBlockVariations:l}=e(r.store);return{canRemove:o(t),variations:l(n,"transform")}}),[t,n]),c=function(){let o=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"group";const i=(0,r.switchToBlockType)(e,n);i&&i.length>0&&(i[0].attributes.layout=Fg[o],l(t,i))};if(!o||!i)return null;const u=!!a.find((e=>{let{name:t}=e;return"group-row"===t})),d=!!a.find((e=>{let{name:t}=e;return"group-stack"===t}));return(0,s.createElement)(p.ToolbarGroup,null,(0,s.createElement)(p.ToolbarButton,{icon:Ag,label:(0,h._x)("Group","verb"),onClick:c}),u&&(0,s.createElement)(p.ToolbarButton,{icon:Dg,label:(0,h._x)("Row","single horizontal line"),onClick:()=>c("row")}),d&&(0,s.createElement)(p.ToolbarButton,{icon:Og,label:(0,h._x)("Stack","verb"),onClick:()=>c("stack")}))},Vg=(0,s.createContext)(""),Hg=e=>{let{hideDragHandle:t}=e;const{blockClientIds:n,blockClientId:o,blockType:l,hasFixedToolbar:a,hasReducedUI:u,isValid:g,isVisual:h}=(0,m.useSelect)((e=>{const{getBlockName:t,getBlockMode:n,getSelectedBlockClientIds:o,isBlockValid:l,getBlockRootClientId:i,getSettings:s}=e(to),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:f}=(0,m.useDispatch)(to),v=(0,s.useRef)(),{showMovers:b,gestures:k}=Lm({ref:v,onChange(e){e&&u||f(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=g&&h,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)(Mm,{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)(Jm,{clientIds:n}),!C&&(0,s.createElement)(Rg,{clientId:n[0]}),(0,s.createElement)(Bm,{clientIds:n,hideDragHandle:t||u}))),E&&C&&(0,s.createElement)(zg,null),E&&(0,s.createElement)(s.Fragment,null,(0,s.createElement)(po.Slot,{group:"parent",className:"block-editor-block-toolbar__slot"}),(0,s.createElement)(po.Slot,{group:"block",className:"block-editor-block-toolbar__slot"}),(0,s.createElement)(po.Slot,{className:"block-editor-block-toolbar__slot"}),(0,s.createElement)(po.Slot,{group:"inline",className:"block-editor-block-toolbar__slot"}),(0,s.createElement)(po.Slot,{group:"other",className:"block-editor-block-toolbar__slot"}),(0,s.createElement)(Vg.Provider,{value:null==l?void 0:l.name},(0,s.createElement)(ng.Slot,null))),(0,s.createElement)(Mg,{clientIds:n}))},Gg=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(to),{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:c&&(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)(fm,i({focusOnMount:t,className:d
64
+ /* translators: accessibility text for the block toolbar */,"aria-label":(0,h.__)("Block tools")},o),(0,s.createElement)(Hg,{hideDragHandle:n}))};function Ug(e){const{isNavigationMode:t,isMultiSelecting:n,hasMultiSelection:o,isTyping:r,getSettings:l,getLastMultiSelectedBlockClientId:i}=e(to);return{isNavigationMode:t(),isMultiSelecting:n(),isTyping:r(),hasFixedToolbar:l().hasFixedToolbar,lastClientId:o()?i():null}}function Wg(e){let{clientId:t,rootClientId:n,isEmptyDefaultBlock:o,capturingClientId:r,__unstablePopoverSlot:l,__unstableContentRef:i}=e;const{isNavigationMode:a,isMultiSelecting:u,isTyping:p,hasFixedToolbar:g,lastClientId:h}=(0,m.useSelect)(Ug,[]),f=(0,m.useSelect)((e=>{const{isBlockInsertionPointVisible:n,getBlockInsertionPoint:o,getBlockOrder:r}=e(to);if(!n())return!1;const l=o();return r(l.rootClientId)[l.index]===t}),[t]),v=(0,d.useViewportMatch)("medium"),b=(0,s.useRef)(!1),{stopTyping:k}=(0,m.useDispatch)(to),_=a,y=!a&&!g&&v&&!u&&!(!p&&!a&&o)&&!p,E=!(a||y||g||o);(0,ku.useShortcut)("core/block-editor/focus-toolbar",(()=>{b.current=!0,k(!0)}),{isDisabled:!E}),(0,s.useEffect)((()=>{b.current=!1}));const C=(0,s.useRef)();return _||y?(0,s.createElement)(jo,{clientId:r||t,bottomClientId:h,className:c()("block-editor-block-list__block-popover",{"is-insertion-point-visible":f}),__unstablePopoverSlot:l,__unstableContentRef:i},y&&(0,s.createElement)(Gg,{focusOnMount:b.current,__experimentalInitialIndex:C.current,__experimentalOnIndexChange:e=>{C.current=e},key:t}),_&&(0,s.createElement)(gm,{clientId:t,rootClientId:n})):null}function $g(e){const{getSelectedBlockClientId:t,getFirstMultiSelectedBlockClientId:n,getBlockRootClientId:o,getBlock:l,getBlockParents:i,__experimentalGetBlockListSettingsForBlocks:s}=e(to),a=t()||n();if(!a)return;const{name:c,attributes:d={}}=l(a)||{},p=i(a),m=s(p),g=(0,u.find)(p,(e=>{var t;return null===(t=m[e])||void 0===t?void 0:t.__experimentalCaptureToolbars}));return{clientId:a,rootClientId:o(a),name:c,isEmptyDefaultBlock:c&&(0,r.isUnmodifiedDefaultBlock)({name:c,attributes:d}),capturingClientId:g}}function jg(e){let{__unstablePopoverSlot:t,__unstableContentRef:n}=e;const o=(0,m.useSelect)($g,[]);if(!o)return null;const{clientId:r,rootClientId:l,name:i,isEmptyDefaultBlock:a,capturingClientId:c}=o;return i?(0,s.createElement)(Wg,{clientId:r,rootClientId:l,isEmptyDefaultBlock:a,capturingClientId:c,__unstablePopoverSlot:t,__unstableContentRef:n}):null}function Kg(e){let{children:t}=e;const n=(0,s.useContext)(rm),o=(0,s.useContext)(p.Disabled.Context);return n||o?t:(V()('wp.components.Popover.Slot name="block-toolbar"',{alternative:"wp.blockEditor.BlockTools",since:"5.8"}),(0,s.createElement)(im,{__unstablePopoverSlot:"block-toolbar"},(0,s.createElement)(jg,{__unstablePopoverSlot:"block-toolbar"}),t))}const qg=(0,d.createHigherOrderComponent)((e=>t=>{const{clientId:n}=lo();return(0,s.createElement)(e,i({},t,{clientId:n}))}),"withClientId"),Yg=qg((e=>{let{clientId:t,showSeparator:n,isFloating:o,onAddBlock:r,isToggle:l}=e;return(0,s.createElement)(tm,{className:c()({"block-list-appender__toggle":l}),rootClientId:t,showSeparator:n,isFloating:o,onAddBlock:r})})),Zg=(0,d.compose)([qg,(0,m.withSelect)(((e,t)=>{let{clientId:n}=t;const{getBlockOrder:o}=e(to),r=o(n);return{lastBlockClientId:(0,u.last)(r)}}))])((e=>{let{clientId:t}=e;return(0,s.createElement)(Xp,{rootClientId:t})})),Qg=new WeakMap;function Xg(e,t){const n=(0,m.useSelect)((e=>e(to).getSettings().mediaUpload),[]),{canInsertBlockType:o,getBlockIndex:l,getClientIdsOfDescendants:i}=(0,m.useSelect)(to),{insertBlocks:s,moveBlocksToPosition:a,updateBlockAttributes:c,clearSelectedBlock:u}=(0,m.useDispatch)(to),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),g=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,Bl.getFilesFromDataTransfer)(e.dataTransfer),n=e.dataTransfer.getData("text/html");n?g(n):t.length?p(t):d(e)}}function Jg(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 eh(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=Jg(e,t,r);(void 0===n||l<n)&&(n=l,o=r)})),[n,o]}function th(e,t,n){const o="horizontal"===n?["left","right"]:["top","bottom"],r=(0,h.isRTL)();let l,i;return e.forEach(((e,n)=>{const s=e.getBoundingClientRect(),[a,c]=eh(t,s,o);(void 0===i||a<i)&&(i=a,l=n+("bottom"===c||!r&&"right"===c||r&&"left"===c?1:0))})),l}function nh(){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(to);return"all"===n(e)}),[e]),{getBlockListSettings:r}=(0,m.useSelect)(to),{showInsertionPoint:l,hideInsertionPoint:i}=(0,m.useDispatch)(to),a=Xg(e,t),c=(0,d.useThrottle)((0,s.useCallback)(((t,o)=>{var i;const s=th(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 oh(e){const{clientId:t,allowedBlocks:n,__experimentalDefaultBlock:o,__experimentalDirectInsert:l,template:i,templateLock:a,wrapperRef:c,templateInsertUpdatesSelection:d,__experimentalCaptureToolbars:p,__experimentalAppenderTagName:g,renderAppender:h,orientation:f,placeholder:v,__experimentalLayout:b}=e;!function(e,t,n,o,r,l,i,a){const{updateBlockListSettings:c}=(0,m.useDispatch)(to),{blockListSettings:u,parentLock:d}=(0,m.useSelect)((t=>{const n=t(to).getBlockRootClientId(e);return{blockListSettings:t(to).getBlockListSettings(e),parentLock:t(to).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=Fr(null==a?void 0:a.type);t.orientation=e.getOrientation(a)}void 0!==n&&(t.__experimentalDefaultBlock=n),void 0!==o&&(t.__experimentalDirectInsert=o),Wo()(u,t)||c(e,t)}),[e,u,p,n,o,r,d,l,i,c,a])}(t,n,o,l,a,p,f,b),function(e,t,n,o){const{getSelectedBlocksInitialCaretPosition:l}=(0,m.useSelect)(to),{replaceInnerBlocks:i}=(0,m.useDispatch)(to),a=(0,m.useSelect)((t=>t(to).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(to).getBlock(t),o=(0,r.getBlockType)(n.name);if(o&&o.providesContext)return function(e,t){Qg.has(t)||Qg.set(t,new WeakMap);const n=Qg.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)(xl,{value:k},(0,s.createElement)(mh,{rootClientId:t,renderAppender:h,__experimentalAppenderTagName:g,__experimentalLayout:b,wrapperRef:c,placeholder:v}))}function rh(e){return uu(e),(0,s.createElement)(oh,e)}const lh=(0,s.forwardRef)(((e,t)=>{const n=ih({ref:t},e);return(0,s.createElement)("div",{className:"block-editor-inner-blocks"},(0,s.createElement)("div",n))}));function ih(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{clientId:n}=lo(),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(to),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,nh({rootClientId:n})]),p={__experimentalCaptureToolbars:l,...t},g=p.value&&p.onChange?rh:oh;return{...e,ref:u,className:c()(e.className,"block-editor-block-list__layout",{"has-overlay":a}),children:n?(0,s.createElement)(g,i({},p,{clientId:n})):(0,s.createElement)(mh,t)}}ih.save=r.__unstableGetInnerBlocksProps,lh.DefaultBlockAppender=Zg,lh.ButtonBlockAppender=Yg,lh.Content=()=>ih.save().children;const sh=lh,ah=(0,s.createContext)(),ch=(0,s.createContext)();function uh(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(to),{outlineMode:o,focusMode:r}=t();return{isOutlineMode:o,isFocusMode:r,isNavigationMode:n()}}),[]),{setBlockVisibility:p}=(0,m.useDispatch)(to),g=(0,s.useMemo)((()=>{const{IntersectionObserver:e}=window;if(e)return new e((e=>{const t={};for(const n of e)t[n.target.getAttribute("data-block")]=n.isIntersecting;p(t)}))}),[]),h=ih({ref:(0,d.useMergeRefs)([mu(),sm(),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)(ah.Provider,{value:o},(0,s.createElement)(ch.Provider,{value:g},(0,s.createElement)("div",h)))}function dh(e){return function(){const e=(0,m.useSelect)((e=>e(to).getSettings().__experimentalBlockPatterns),[]);(0,s.useEffect)((()=>{if(null==e||!e.length)return;let t,n=-1;const o=()=>{n++,n>=e.length||((0,m.select)(to).__experimentalGetParsedPattern(e[n].name),t=am(o))};return t=am(o),()=>cm(t)}),[e])}(),(0,s.createElement)(Kg,null,(0,s.createElement)(ro,{value:no},(0,s.createElement)(uh,e)))}function ph(e){let{placeholder:t,rootClientId:n,renderAppender:o,__experimentalAppenderTagName:r,__experimentalLayout:l=zr}=e;const{order:i,selectedBlocks:a,visibleBlocks:c}=(0,m.useSelect)((e=>{const{getBlockOrder:t,getSelectedBlockClientIds:o,__unstableGetVisibleBlocks:r}=e(to);return{order:t(n),selectedBlocks:o(),visibleBlocks:r()}}),[n]);return(0,s.createElement)(Hr,{value:l},i.map((e=>(0,s.createElement)(m.AsyncModeProvider,{key:e,value:!c.has(e)&&!a.includes(e)},(0,s.createElement)(eu,{rootClientId:n,clientId:e})))),i.length<1&&t,(0,s.createElement)(nm,{tagName:r,rootClientId:n,renderAppender:o}))}function mh(e){return(0,s.createElement)(m.AsyncModeProvider,{value:!1},(0,s.createElement)(ph,e))}function gh(e){return[...e].sort(((t,n)=>e.filter((e=>e===n)).length-e.filter((e=>e===t)).length)).shift()}function hh(){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=gh(o),i=0===r||r?`${r}${l}`:void 0;return i}function fh(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=hh(e),n="string"!=typeof e&&isNaN(parseFloat(t));return n}function vh(e){return!!e&&("string"==typeof e||!!Object.values(e).filter((e=>!!e||0===e)).length)}function bh(e){let{onChange:t,values:n,...o}=e;const r=hh(n),l=vh(n)&&fh(n),a=l?(0,h.__)("Mixed"):null;return(0,s.createElement)(p.__experimentalUnitControl,i({},o,{"aria-label":(0,h.__)("Border radius"),disableUnits:l,isOnly:!0,value:r,onChange:t,placeholder:a}))}dh.__unstableElementContext=ah;const kh={topLeft:(0,h.__)("Top left"),topRight:(0,h.__)("Top right"),bottomLeft:(0,h.__)("Bottom left"),bottomRight:(0,h.__)("Bottom right")};function _h(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(kh).map((e=>{let[n,l]=e;return(0,s.createElement)(p.Tooltip,{text:l,position:"top",key:n},(0,s.createElement)("div",{className:"components-border-radius-control__tooltip-wrapper"},(0,s.createElement)(p.__experimentalUnitControl,i({},o,{"aria-label":l,value:r[n],onChange:(a=n,e=>{t&&t({...r,[a]:e||void 0})})}))));var a})))}const yh=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.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"})),Eh=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.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 Ch(e){let{isLinked:t,...n}=e;const o=t?(0,h.__)("Unlink Radii"):(0,h.__)("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?yh:Eh,iconSize:16,"aria-label":o})))}const Sh={topLeft:null,topRight:null,bottomLeft:null,bottomRight:null},wh={px:100,em:20,rem:20};function Bh(e){let{onChange:t,values:n}=e;const[o,r]=(0,s.useState)(!vh(n)||!fh(n)),l=(0,p.__experimentalUseCustomUnits)({availableUnits:To("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 gh(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)(hh(n));return(0,s.createElement)("fieldset",{className:"components-border-radius-control"},(0,s.createElement)("legend",null,(0,h.__)("Radius")),(0,s.createElement)("div",{className:"components-border-radius-control__wrapper"},o?(0,s.createElement)(s.Fragment,null,(0,s.createElement)(bh,{className:"components-border-radius-control__unit-control",values:n,min:0,onChange:t,units:l}),(0,s.createElement)(p.RangeControl,{label:(0,h.__)("Border radius"),hideLabelFromVision:!0,className:"components-border-radius-control__range-control",value:null!=u?u:"",min:0,max:wh[i],initialPosition:0,withInputField:!1,onChange:e=>{t(void 0!==e?`${e}${i}`:void 0)},step:c})):(0,s.createElement)(_h,{min:0,onChange:t,values:n||Sh,units:l}),(0,s.createElement)(Ch,{onClick:()=>r(!o),isLinked:o})))}function Ih(e){var t;const{attributes:{style:n},setAttributes:o}=e;return(0,s.createElement)(Bh,{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=Mo(t)),o({style:t})}})}ld([id,cd]);const xh=(e,t,n)=>{if(t){const n=(0,u.find)(e,{slug:t});if(n)return n}return{color:n}},Th=(e,t)=>(0,u.find)(e,{color:t});function Nh(e,t){if(e&&t)return`has-${(0,u.kebabCase)(t)}-${e}`}function Ph(){return{disableCustomColors:!To("color.custom"),disableCustomGradients:!To("color.customGradient")}}function Lh(){const e=Ph(),t=To("color.palette.custom"),n=To("color.palette.theme"),o=To("color.palette.default"),r=To("color.defaultPalette");e.colors=(0,s.useMemo)((()=>{const e=[];return n&&n.length&&e.push({name:(0,h._x)("Theme","Indicates this palette comes from the theme."),colors:n}),r&&o&&o.length&&e.push({name:(0,h._x)("Default","Indicates this palette comes from WordPress."),colors:o}),t&&t.length&&e.push({name:(0,h._x)("Custom","Indicates this palette comes from the theme."),colors:t}),e}),[o,n,t]);const l=To("color.gradients.custom"),i=To("color.gradients.theme"),a=To("color.gradients.default"),c=To("color.defaultGradients");return e.gradients=(0,s.useMemo)((()=>{const e=[];return i&&i.length&&e.push({name:(0,h._x)("Theme","Indicates this palette comes from the theme."),gradients:i}),c&&a&&a.length&&e.push({name:(0,h._x)("Default","Indicates this palette comes from WordPress."),gradients:a}),l&&l.length&&e.push({name:(0,h._x)("Custom","Indicates this palette is created by the user."),gradients:l}),e}),[l,i,a]),e}const Mh="__experimentalBorder",Rh=["top","right","bottom","left"],Ah=e=>{var t,n;return{...e,borderColor:void 0,style:{...e.style,border:{radius:null===(t=e.style)||void 0===t||null===(n=t.border)||void 0===n?void 0:n.radius}}}},Dh=(e,t,n)=>{let o;return e.some((e=>e.colors.some((e=>e[t]===n&&(o=e,!0))))),o},Oh=e=>{let{colors:t,namedColor:n,customColor:o}=e;if(n){const e=Dh(t,"slug",n);if(e)return e}if(!o)return{color:void 0};return Dh(t,"color",o)||{color:o}};function Fh(e){const t=/var:preset\|color\|(.+)/.exec(e);return t&&t[1]?t[1]:null}function zh(e){const{attributes:t,clientId:n,setAttributes:o}=e,{style:l}=t,{colors:i}=Lh(),a=Vh(e.name),c=To("border.color")&&Vh(e.name,"color"),u=To("border.radius")&&Vh(e.name,"radius"),d=To("border.style")&&Vh(e.name,"style"),m=To("border.width")&&Vh(e.name,"width");if([!c,!u,!d,!m].every(Boolean)||!a)return null;const g=(0,r.getBlockSupport)(e.name,[Mh,"__experimentalDefaultControls"]),f=(null==g?void 0:g.color)||(null==g?void 0:g.width),v=((e,t)=>{const{borderColor:n,style:o}=e,{border:r}=o||{};if(n){const{color:e}=Oh({colors:t,namedColor:n});return e?{...r,color:e}:r}if(!r)return r;const l={...r};return Rh.forEach((e=>{var n;const o=Fh(null===(n=l[e])||void 0===n?void 0:n.color);if(o){const{color:n}=Oh({colors:t,namedColor:o});l[e]={...l[e],color:n}}})),l})(t,i);return(0,s.createElement)(Go,{__experimentalGroup:"border"},(m||c)&&(0,s.createElement)(p.__experimentalToolsPanelItem,{hasValue:()=>(e=>{const{borderColor:t,style:n}=e.attributes;return(0,p.__experimentalIsDefinedBorder)(null==n?void 0:n.border)||!!t})(e),label:(0,h.__)("Border"),onDeselect:()=>(e=>{var t;let{attributes:n={},setAttributes:o}=e;const{style:r}=n;o({borderColor:void 0,style:{...r,border:Mo({radius:null==r||null===(t=r.border)||void 0===t?void 0:t.radius})}})})(e),isShownByDefault:f,resetAllFilter:Ah,panelId:n},(0,s.createElement)(p.__experimentalBorderBoxControl,{colors:i,enableAlpha:!0,onChange:e=>{var t;let n,r={...e};if((0,p.__experimentalHasSplitBorders)(e))r={top:{...e.top},right:{...e.right},bottom:{...e.bottom},left:{...e.left}},Rh.forEach((t=>{var n;if(null!==(n=e[t])&&void 0!==n&&n.color){var o;const n=Oh({colors:i,customColor:null===(o=e[t])||void 0===o?void 0:o.color});n.slug&&(r[t].color=`var:preset|color|${n.slug}`)}}));else if(null!=e&&e.color){const t=null==e?void 0:e.color,o=Oh({colors:i,customColor:t});o.slug&&(n=o.slug,r.color=void 0)}const s=Mo({...l,border:{radius:null==l||null===(t=l.border)||void 0===t?void 0:t.radius,...r}});o({style:s,borderColor:n})},popoverPlacement:"left-start",popoverOffset:40,showStyle:d,value:v,__experimentalHasMultipleOrigins:!0,__experimentalIsRenderedInSidebar:!0})),u&&(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,h.__)("Radius"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:Hh(o,"radius")})}(e),isShownByDefault:null==g?void 0:g.radius,resetAllFilter:e=>{var t;return{...e,style:{...e.style,border:{...null===(t=e.style)||void 0===t?void 0:t.border,radius:void 0}}}},panelId:n},(0,s.createElement)(Ih,e)))}function Vh(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,Mh);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 Hh(e,t){return Mo({...e,border:{...null==e?void 0:e.border,[t]:void 0}})}function Gh(e,t,n){if(!Vh(t,"color")||Do(t,Mh,"color"))return e;const o=Uh(n),r=c()(e.className,o);return e.className=r||void 0,e}function Uh(e){var t;const{borderColor:n,style:o}=e,r=Nh("border-color",n);return c()({"has-border-color":n||(null==o||null===(t=o.border)||void 0===t?void 0:t.color),[r]:!!r})}const Wh=(0,d.createHigherOrderComponent)((e=>t=>{var n,o,r,l,a,c,u,d,p;const{name:m,attributes:g}=t,{borderColor:h,style:f}=g,{colors:v}=Lh();if(!Vh(m,"color")||Do(m,Mh,"color"))return(0,s.createElement)(e,t);const{color:b}=Oh({colors:v,namedColor:h}),{color:k}=Oh({colors:v,namedColor:Fh(null==f||null===(n=f.border)||void 0===n||null===(o=n.top)||void 0===o?void 0:o.color)}),{color:_}=Oh({colors:v,namedColor:Fh(null==f||null===(r=f.border)||void 0===r||null===(l=r.right)||void 0===l?void 0:l.color)}),{color:y}=Oh({colors:v,namedColor:Fh(null==f||null===(a=f.border)||void 0===a||null===(c=a.bottom)||void 0===c?void 0:c.color)}),{color:E}=Oh({colors:v,namedColor:Fh(null==f||null===(u=f.border)||void 0===u||null===(d=u.left)||void 0===d?void 0:d.color)}),C={borderTopColor:k||b,borderRightColor:_||b,borderBottomColor:y||b,borderLeftColor:E||b};let S=t.wrapperProps;return S={...t.wrapperProps,style:{...null===(p=t.wrapperProps)||void 0===p?void 0:p.style,...C}},(0,s.createElement)(e,i({},t,{wrapperProps:S}))}));function $h(e){if(e)return`has-${e}-gradient-background`}function jh(e,t){const n=(0,u.find)(e,["slug",t]);return n&&n.gradient}function Kh(e,t){return(0,u.find)(e,["gradient",t])}function qh(e,t){const n=Kh(e,t);return n&&n.slug}function Yh(){let{gradientAttribute:e="gradient",customGradientAttribute:t="customGradient"}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{clientId:n}=lo(),o=To("color.gradients.custom"),r=To("color.gradients.theme"),l=To("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(to),l=r(n)||{};return{customGradient:l[t],gradient:l[e]}}),[n,e,t]),{updateBlockAttributes:u}=(0,m.useDispatch)(to),d=(0,s.useCallback)((o=>{const r=qh(i,o);u(n,r?{[e]:r,[t]:void 0}:{[e]:void 0,[t]:o})}),[i,n,u]),p=$h(a);let g;return g=a?jh(i,a):c,{gradientClass:p,gradientValue:g,setGradient:d}}(0,l.addFilter)("blocks.registerBlockType","core/border/addAttributes",(function(e){return Vh(e,"color")?e.attributes.borderColor?e:{...e,attributes:{...e.attributes,borderColor:{type:"string"}}}:e})),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/border/addSaveProps",Gh),(0,l.addFilter)("blocks.registerBlockType","core/border/addEditProps",(function(e){if(!Vh(e,"color")||Do(e,Mh,"color"))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=n=>{let o={};return t&&(o=t(n)),Gh(o,e,n)},e})),(0,l.addFilter)("editor.BlockListBlock","core/border/with-border-color-palette-styles",Wh);const Zh=["colors","disableCustomColors","gradients","disableCustomGradients"],Qh={name:"color",title:"Solid color",value:"color"},Xh={name:"gradient",title:"Gradient",value:"gradient"},Jh=[Qh,Xh];function ef(e){let{colors:t,gradients:n,disableCustomColors:o,disableCustomGradients:r,__experimentalHasMultipleOrigins:l,__experimentalIsRenderedInSidebar:i,className:a,label:d,onColorChange:m,onGradientChange:g,colorValue:h,gradientValue:f,clearable:v,showTitle:b=!0,enableAlpha:k}=e;const _=m&&(!(0,u.isEmpty)(t)||!o),y=g&&(!(0,u.isEmpty)(n)||!r);if(!_&&!y)return null;const E={[Qh.value]:(0,s.createElement)(p.ColorPalette,{value:h,onChange:y?e=>{m(e),g()}:m,colors:t,disableCustomColors:o,__experimentalHasMultipleOrigins:l,__experimentalIsRenderedInSidebar:i,clearable:v,enableAlpha:k}),[Xh.value]:(0,s.createElement)(p.GradientPicker,{value:f,onChange:_?e=>{g(e),m()}:g,gradients:n,disableCustomGradients:r,__experimentalHasMultipleOrigins:l,__experimentalIsRenderedInSidebar:i,clearable:v})};return(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},b&&(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&&(0,s.createElement)(p.TabPanel,{className:"block-editor-color-gradient-control__tabs",tabs:Jh,initialTabName:f?Xh.value:!!_&&Qh.value},(e=>(0,s.createElement)("div",{className:"block-editor-color-gradient-control__tab-panel"},E[e.value]))),!y&&E[Qh.value],!_&&E[Xh.value])))}function tf(e){const t={};return t.colors=To("color.palette"),t.gradients=To("color.gradients"),t.disableCustomColors=!To("color.custom"),t.disableCustomGradients=!To("color.customGradient"),(0,s.createElement)(ef,i({},t,e))}const nf=function(e){return(0,u.every)(Zh,(t=>e.hasOwnProperty(t)))?(0,s.createElement)(ef,e):(0,s.createElement)(tf,e)},of=e=>{let{setting:t,children:n,panelId:o,...r}=e;return(0,s.createElement)(p.__experimentalToolsPanelItem,i({hasValue:()=>!!t.colorValue||!!t.gradientValue,label:t.label,onDeselect:()=>{t.colorValue?t.onColorChange():t.gradientValue&&t.onGradientChange()},isShownByDefault:void 0===t.isShownByDefault||t.isShownByDefault},r,{className:"block-editor-tools-panel-color-gradient-settings__item",panelId:o,resetAllFilter:t.resetAllFilter}),n)},rf=e=>{let{colorValue:t,label:n}=e;return(0,s.createElement)(p.__experimentalHStack,{justify:"flex-start"},(0,s.createElement)(p.ColorIndicator,{className:"block-editor-panel-color-gradient-settings__color-indicator",colorValue:t}),(0,s.createElement)(p.FlexItem,null,n))},lf=e=>t=>{let{onToggle:n,isOpen:o}=t;const{colorValue:r,label:l}=e,i={onClick:n,className:c()("block-editor-panel-color-gradient-settings__dropdown",{"is-open":o}),"aria-expanded":o};return(0,s.createElement)(p.Button,i,(0,s.createElement)(rf,{colorValue:r,label:l}))};function sf(e){let t,{colors:n,disableCustomColors:o,disableCustomGradients:r,enableAlpha:l,gradients:a,settings:c,__experimentalHasMultipleOrigins:u,__experimentalIsRenderedInSidebar:d,...m}=e;return d&&(t={placement:"left-start",offset:36,__unstableShift:!0}),(0,s.createElement)(s.Fragment,null,c.map(((e,c)=>{var g;const h={clearable:!1,colorValue:e.colorValue,colors:n,disableCustomColors:o,disableCustomGradients:r,enableAlpha:l,gradientValue:e.gradientValue,gradients:a,label:e.label,onColorChange:e.onColorChange,onGradientChange:e.onGradientChange,showTitle:!1,__experimentalHasMultipleOrigins:u,__experimentalIsRenderedInSidebar:d,...e},f={colorValue:null!==(g=e.gradientValue)&&void 0!==g?g:e.colorValue,label:e.label};return e&&(0,s.createElement)(of,i({key:c,setting:e},m),(0,s.createElement)(p.Dropdown,{popoverProps:t,className:"block-editor-tools-panel-color-gradient-settings__dropdown",contentClassName:"block-editor-panel-color-gradient-settings__dropdown-content",renderToggle:lf(f),renderContent:()=>(0,s.createElement)(nf,h)}))})))}ld([id,cd]);const af=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,g=c||r;if(!m&&!g)return null;const f=[{color:m,description:(0,h.__)("text color")},{color:g,description:(0,h.__)("link color")}],v=od(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 f){if(!e.color)continue;const t=od(e.color),n=t.isReadable(v,_),o=t.alpha()<1;if(!n){if(b||o)continue;y=k<t.brightness()?(0,h.sprintf)(// translators: %s is a type of text color, e.g., "text color" or "link color".
65
  (0,h.__)("This color combination may be hard for people to read. Try using a darker background color and/or a brighter %s."),e.description):(0,h.sprintf)(// translators: %s is a type of text color, e.g., "text color" or "link color".
66
+ (0,h.__)("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,h.__)("This color combination may be hard for people to read.");break}o&&u&&(y=(0,h.__)("Transparent text may be hard for people to read."),E=(0,h.__)("Transparent text may be hard for people to read."))}return y?((0,Gt.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 cf(e){return e.ownerDocument.defaultView.getComputedStyle(e)}function uf(e){let{enableAlpha:t=!1,settings:n,clientId:o,enableContrastChecking:r=!0}=e;const[l,a]=(0,s.useState)(),[c,u]=(0,s.useState)(),[d,p]=(0,s.useState)(),m=So(o);(0,s.useEffect)((()=>{var e;if(!r)return;if(!m.current)return;u(cf(m.current).color);const t=null===(e=m.current)||void 0===e?void 0:e.querySelector("a");t&&t.innerText&&p(cf(t).color);let n=m.current,o=cf(n).backgroundColor;for(;"rgba(0, 0, 0, 0)"===o&&n.parentNode&&n.parentNode.nodeType===n.parentNode.ELEMENT_NODE;)n=n.parentNode,o=cf(n).backgroundColor;a(o)}));const g=Lh();return(0,s.createElement)(Go,{__experimentalGroup:"color"},(0,s.createElement)(sf,i({enableAlpha:t,panelId:o,settings:n,__experimentalIsItemGroup:!1,__experimentalHasMultipleOrigins:!0,__experimentalIsRenderedInSidebar:!0},g)),r&&(0,s.createElement)(af,{backgroundColor:l,textColor:c,enableAlphaChecker:t,linkColor:d}))}const df="color",pf=e=>{const t=(0,r.getBlockSupport)(e,df);return t&&(!0===t.link||!0===t.gradient||!1!==t.background||!1!==t.text)},mf=e=>{if("web"!==s.Platform.OS)return!1;const t=(0,r.getBlockSupport)(e,df);return null!==t&&"object"==typeof t&&!!t.link},gf=e=>{const t=(0,r.getBlockSupport)(e,df);return null!==t&&"object"==typeof t&&!!t.gradients},hf=e=>{const t=(0,r.getBlockSupport)(e,df);return t&&!1!==t.background},ff=e=>{const t=(0,r.getBlockSupport)(e,df);return t&&!1!==t.text},vf=(e,t)=>Mo(Ro(t,e,void 0)),bf=e=>({textColor:void 0,style:vf(["color","text"],e.style)}),kf=e=>({style:vf(["elements","link","color","text"],e.style)}),_f=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 yf(e,t,n){var o,r,l,i,s,a;if(!pf(t)||Do(t,df))return e;const u=gf(t),{backgroundColor:d,textColor:p,gradient:m,style:g}=n,h=e=>!Do(t,df,e),f=h("text")?Nh("color",p):void 0,v=h("gradients")?$h(m):void 0,b=h("background")?Nh("background-color",d):void 0,k=h("background")||h("gradients"),_=d||(null==g||null===(o=g.color)||void 0===o?void 0:o.background)||u&&(m||(null==g||null===(r=g.color)||void 0===r?void 0:r.gradient)),y=c()(e.className,f,v,{[b]:!(u&&null!=g&&null!==(l=g.color)&&void 0!==l&&l.gradient||!b),"has-text-color":h("text")&&(p||(null==g||null===(i=g.color)||void 0===i?void 0:i.text)),"has-background":k&&_,"has-link-color":h("link")&&(null==g||null===(s=g.elements)||void 0===s||null===(a=s.link)||void 0===a?void 0:a.color)});return e.className=y||void 0,e}const Ef=(e,t)=>{const n=/var:preset\|color\|(.+)/.exec(t);return n&&n[1]?xh(e,n[1]).color:t};function Cf(e){var t,n,o,l,i,a,c,u,d;const{name:p,attributes:m}=e,g=To("color.palette.custom"),f=To("color.palette.theme"),v=To("color.palette.default"),b=(0,s.useMemo)((()=>[...g||[],...f||[],...v||[]]),[g,f,v]),k=To("color.gradients.custom"),_=To("color.gradients.theme"),y=To("color.gradients.default"),E=(0,s.useMemo)((()=>[...k||[],..._||[],...y||[]]),[k,_,y]),C=To("color.custom"),S=To("color.customGradient"),w=To("color.background"),B=To("color.link"),I=To("color.text"),x=C||!f||(null==f?void 0:f.length)>0,T=S||!_||(null==_?void 0:_.length)>0,N=(0,s.useRef)(m);if((0,s.useEffect)((()=>{N.current=m}),[m]),!pf(p))return null;const P=mf(p)&&B&&x,L=ff(p)&&I&&x,M=hf(p)&&w&&x,R=gf(p)&&T;if(!(P||L||M||R))return null;const{style:A,textColor:D,backgroundColor:O,gradient:F}=m;let z;if(R&&F)z=jh(E,F);else if(R){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=Th(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:Mo(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,[df,"__experimentalDefaultControls"]);return(0,s.createElement)(uf,{enableContrastChecking:G,clientId:e.clientId,enableAlpha:!0,settings:[...L?[{label:(0,h.__)("Text"),onColorChange:H("text"),colorValue:xh(b,D,null==A||null===(n=A.color)||void 0===n?void 0:n.text).color,isShownByDefault:null==U?void 0:U.text,resetAllFilter:bf}]:[],...M||R?[{label:(0,h.__)("Background"),onColorChange:M?H("background"):void 0,colorValue:xh(b,O,null==A||null===(o=A.color)||void 0===o?void 0:o.background).color,gradientValue:z,onGradientChange:R?t=>{const n=qh(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:Mo(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:Mo(e),gradient:void 0}}e.setAttributes(o),N.current={...N.current,...o}}:void 0,isShownByDefault:null==U?void 0:U.background,resetAllFilter:_f}]:[],...P?[{label:(0,h.__)("Link"),onColorChange:t=>{var n;const o=Th(b,t),r=null!=o&&o.slug?`var:preset|color|${o.slug}`:t,l=Mo(Ro(null===(n=N.current)||void 0===n?void 0:n.style,["elements","link","color","text"],r));e.setAttributes({style:l}),N.current={...N.current,style:l}},colorValue:Ef(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,resetAllFilter:kf}]:[]]})}const Sf=(0,d.createHigherOrderComponent)((e=>t=>{var n;const{name:o,attributes:r}=t,{backgroundColor:l,textColor:a}=r,c=To("color.palette.custom")||[],u=To("color.palette.theme")||[],d=To("color.palette.default")||[],p=(0,s.useMemo)((()=>[...c||[],...u||[],...d||[]]),[c,u,d]);if(!pf(o)||Do(o,df))return(0,s.createElement)(e,t);const m={};var g,h;a&&!Do(o,df,"text")&&(m.color=null===(g=xh(p,a))||void 0===g?void 0:g.color),l&&!Do(o,df,"background")&&(m.backgroundColor=null===(h=xh(p,l))||void 0===h?void 0:h.color);let f=t.wrapperProps;return f={...t.wrapperProps,style:{...m,...null===(n=t.wrapperProps)||void 0===n?void 0:n.style}},(0,s.createElement)(e,i({},t,{wrapperProps:f}))})),wf={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 pf(e)?(e.attributes.backgroundColor||Object.assign(e.attributes,{backgroundColor:{type:"string"}}),e.attributes.textColor||Object.assign(e.attributes,{textColor:{type:"string"}}),gf(e)&&!e.attributes.gradient&&Object.assign(e.attributes,{gradient:{type:"string"}}),e):e})),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/color/addSaveProps",yf),(0,l.addFilter)("blocks.registerBlockType","core/color/addEditProps",(function(e){if(!pf(e)||Do(e,df))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=n=>{let o={};return t&&(o=t(n)),yf(o,e,n)},e})),(0,l.addFilter)("editor.BlockListBlock","core/color/with-color-palette-styles",Sf),(0,l.addFilter)("blocks.switchToBlockType.transformedBlock","core/color/addTransforms",(function(e,t,n,o){const r=e.name;return Ao({linkColor:mf(r),textColor:ff(r),backgroundColor:hf(r),gradient:gf(r)},wf,e,t,n,o)}));const Bf=[{name:(0,h._x)("Regular","font style"),value:"normal"},{name:(0,h._x)("Italic","font style"),value:"italic"}],If=[{name:(0,h._x)("Thin","font weight"),value:"100"},{name:(0,h._x)("Extra Light","font weight"),value:"200"},{name:(0,h._x)("Light","font weight"),value:"300"},{name:(0,h._x)("Regular","font weight"),value:"400"},{name:(0,h._x)("Medium","font weight"),value:"500"},{name:(0,h._x)("Semi Bold","font weight"),value:"600"},{name:(0,h._x)("Bold","font weight"),value:"700"},{name:(0,h._x)("Extra Bold","font weight"),value:"800"},{name:(0,h._x)("Black","font weight"),value:"900"}],xf=(e,t)=>e?t?(0,h.__)("Appearance"):(0,h.__)("Font style"):(0,h.__)("Font weight");function Tf(e){const{onChange:t,hasFontStyles:n=!0,hasFontWeights:o=!0,value:{fontStyle:r,fontWeight:l}}=e,i=n||o,a=xf(n,o),c={key:"default",name:(0,h.__)("Default"),style:{fontStyle:void 0,fontWeight:void 0}},u=(0,s.useMemo)((()=>n&&o?(()=>{const e=[c];return Bf.forEach((t=>{let{name:n,value:o}=t;If.forEach((t=>{let{name:r,value:l}=t;const i="normal"===o?r:(0,h.sprintf)(
67
  /* translators: 1: Font weight name. 2: Font style name. */
68
+ (0,h.__)("%1$s %2$s"),r,n);e.push({key:`${o}-${l}`,name:i,style:{fontStyle:o,fontWeight:l}})}))})),e})():n?(()=>{const e=[c];return Bf.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 If.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,h.sprintf)(// translators: %s: Currently selected font appearance.
69
  (0,h.__)("Currently selected font appearance: %s"),d.name):(0,h.sprintf)(// translators: %s: Currently selected font style.
70
  (0,h.__)("Currently selected font style: %s"),d.name):(0,h.sprintf)(// translators: %s: Currently selected font weight.
71
+ (0,h.__)("Currently selected font weight: %s"),d.name):(0,h.__)("No selected font appearance"),options:u,value:d,onChange:e=>{let{selectedItem:n}=e;return t(n.style)}})}const Nf=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||V()("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,h.__)("Line height"),placeholder:1.5,step:.1,value:i,min:0}))},Pf="typography.lineHeight";function Lf(e){var t;const{attributes:{style:n},setAttributes:o}=e;return(0,s.createElement)(Nf,{__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:Mo(t)})}})}function Mf(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!To("typography.lineHeight");return!(0,r.hasBlockSupport)(e,Pf)||t}const Rf="typography.__experimentalFontStyle",Af="typography.__experimentalFontWeight";function Df(e){var t,n;const{attributes:{style:o},setAttributes:r}=e,l=!Of(e),i=!Ff(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)(Tf,{onChange:e=>{r({style:Mo({...o,typography:{...null==o?void 0:o.typography,fontStyle:e.fontStyle,fontWeight:e.fontWeight}})})},hasFontStyles:l,hasFontWeights:i,value:{fontStyle:a,fontWeight:c}})}function Of(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=(0,r.hasBlockSupport)(e,Rf),n=To("typography.fontStyle");return!t||!n}function Ff(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=(0,r.hasBlockSupport)(e,Af),n=To("typography.fontWeight");return!t||!n}function zf(e){const t=Of(e),n=Ff(e);return t&&n}function Vf(e){let{value:t="",onChange:n,fontFamilies:o,...r}=e;const l=To("typography.fontFamilies");if(o||(o=l),(0,u.isEmpty)(o))return null;const a=[{value:"",label:(0,h.__)("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,h.__)("Font family"),options:a,value:t,onChange:n,labelPosition:"top"},r))}const Hf="typography.__experimentalFontFamily";function Gf(e,t,n){if(!(0,r.hasBlockSupport)(t,Hf))return e;if(Do(t,_v,"fontFamily"))return e;if(null==n||!n.fontFamily)return e;const o=new(zm())(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 Uf(e){var t;let{setAttributes:n,attributes:{fontFamily:o}}=e;const r=To("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)(Vf,{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 Wf(e){let{name:t}=e;const n=To("typography.fontFamilies");return!n||0===n.length||!(0,r.hasBlockSupport)(t,Hf)}(0,l.addFilter)("blocks.registerBlockType","core/fontFamily/addAttribute",(function(e){return(0,r.hasBlockSupport)(e,Hf)?(e.attributes.fontFamily||Object.assign(e.attributes,{fontFamily:{type:"string"}}),e):e})),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/fontFamily/addSaveProps",Gf),(0,l.addFilter)("blocks.registerBlockType","core/fontFamily/addEditProps",(function(e){if(!(0,r.hasBlockSupport)(e,Hf))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=n=>{let o={};return t&&(o=t(n)),Gf(o,e,n)},e}));const $f=(e,t,n)=>{if(t){const n=(0,u.find)(e,{slug:t});if(n)return n}return{size:n}};function jf(e,t){return(0,u.find)(e,{size:t})||{size:t}}function Kf(e){if(e)return`has-${(0,u.kebabCase)(e)}-font-size`}const qf=function(e){const t=To("typography.fontSizes"),n=!To("typography.customFontSize");return(0,s.createElement)(p.FontSizePicker,i({},e,{fontSizes:t,disableCustomFontSizes:n}))},Yf="typography.fontSize";function Zf(e,t,n){if(!(0,r.hasBlockSupport)(t,Yf))return e;if(Do(t,_v,"fontSize"))return e;const o=new(zm())(e.className);o.add(Kf(n.fontSize));const l=o.value;return e.className=l||void 0,e}function Qf(e){var t,n;const{attributes:{fontSize:o,style:r},setAttributes:l}=e,i=To("typography.fontSizes"),a=$f(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)(qf,{onChange:e=>{const t=jf(i,e).slug;l({style:Mo({...r,typography:{...null==r?void 0:r.typography,fontSize:t?void 0:e}}),fontSize:t})},value:c,withReset:!1})}function Xf(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=To("typography.fontSizes"),n=!(null==t||!t.length);return!(0,r.hasBlockSupport)(e,Yf)||!n}const Jf=(0,d.createHigherOrderComponent)((e=>t=>{var n,o;const l=To("typography.fontSizes"),{name:i,attributes:{fontSize:a,style:c},wrapperProps:u}=t;if(!(0,r.hasBlockSupport)(i,Yf)||Do(i,_v,"fontSize")||!a||null!=c&&null!==(n=c.typography)&&void 0!==n&&n.fontSize)return(0,s.createElement)(e,t);const d=$f(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"),ev={fontSize:[["fontSize"],["style","typography","fontSize"]]};(0,l.addFilter)("blocks.registerBlockType","core/font/addAttribute",(function(e){return(0,r.hasBlockSupport)(e,Yf)?(e.attributes.fontSize||Object.assign(e.attributes,{fontSize:{type:"string"}}),e):e})),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/font/addSaveProps",Zf),(0,l.addFilter)("blocks.registerBlockType","core/font/addEditProps",(function(e){if(!(0,r.hasBlockSupport)(e,Yf))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=n=>{let o={};return t&&(o=t(n)),Zf(o,e,n)},e})),(0,l.addFilter)("editor.BlockListBlock","core/font-size/with-font-size-inline-styles",Jf),(0,l.addFilter)("blocks.switchToBlockType.transformedBlock","core/font-size/addTransforms",(function(e,t,n,o){const l=e.name;return Ao({fontSize:(0,r.hasBlockSupport)(l,Yf)},ev,e,t,n,o)}));const tv=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.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"})),nv=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.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"})),ov=[{name:(0,h.__)("Underline"),value:"underline",icon:tv},{name:(0,h.__)("Strikethrough"),value:"line-through",icon:nv}];function rv(e){let{value:t,onChange:n}=e;return(0,s.createElement)("fieldset",{className:"block-editor-text-decoration-control"},(0,s.createElement)("legend",null,(0,h.__)("Decoration")),(0,s.createElement)("div",{className:"block-editor-text-decoration-control__buttons"},ov.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 lv="typography.__experimentalTextDecoration";function iv(e){var t;const{attributes:{style:n},setAttributes:o}=e;return(0,s.createElement)(rv,{value:null==n||null===(t=n.typography)||void 0===t?void 0:t.textDecoration,onChange:function(e){o({style:Mo({...n,typography:{...null==n?void 0:n.typography,textDecoration:e}})})}})}function sv(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!(0,r.hasBlockSupport)(e,lv),n=To("typography.textDecoration");return t||!n}const av=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.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"})),cv=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.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"})),uv=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.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"})),dv=[{name:(0,h.__)("Uppercase"),value:"uppercase",icon:av},{name:(0,h.__)("Lowercase"),value:"lowercase",icon:cv},{name:(0,h.__)("Capitalize"),value:"capitalize",icon:uv}];function pv(e){let{value:t,onChange:n}=e;return(0,s.createElement)("fieldset",{className:"block-editor-text-transform-control"},(0,s.createElement)("legend",null,(0,h.__)("Letter case")),(0,s.createElement)("div",{className:"block-editor-text-transform-control__buttons"},dv.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 mv="typography.__experimentalTextTransform";function gv(e){var t;const{attributes:{style:n},setAttributes:o}=e;return(0,s.createElement)(pv,{value:null==n||null===(t=n.typography)||void 0===t?void 0:t.textTransform,onChange:function(e){o({style:Mo({...n,typography:{...null==n?void 0:n.typography,textTransform:e}})})}})}function hv(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!(0,r.hasBlockSupport)(e,mv),n=To("typography.textTransform");return t||!n}function fv(e){let{value:t,onChange:n,__unstableInputWidth:o="60px"}=e;const r=(0,p.__experimentalUseCustomUnits)({availableUnits:To("spacing.units")||["px","em","rem"],defaultValues:{px:2,em:.2,rem:.2}});return(0,s.createElement)(p.__experimentalUnitControl,{label:(0,h.__)("Letter spacing"),value:t,__unstableInputWidth:o,units:r,onChange:n})}const vv="typography.__experimentalLetterSpacing";function bv(e){var t;const{attributes:{style:n},setAttributes:o}=e;return(0,s.createElement)(fv,{value:null==n||null===(t=n.typography)||void 0===t?void 0:t.letterSpacing,onChange:function(e){o({style:Mo({...n,typography:{...null==n?void 0:n.typography,letterSpacing:e}})})},__unstableInputWidth:"100%"})}function kv(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!(0,r.hasBlockSupport)(e,vv),n=To("typography.letterSpacing");return t||!n}const _v="typography",yv=[Pf,Yf,Rf,Af,Hf,lv,mv,vv];function Ev(e){const{clientId:t}=e,n=Wf(e),o=Xf(e),l=zf(e),i=Mf(e),a=sv(e),c=hv(e),u=kv(e),d=!Of(e),m=!Ff(e),g=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=[zf(e),Xf(e),Mf(e),Wf(e),sv(e),hv(e),kv(e)];return t.filter(Boolean).length===t.length}(e),f=Cv(e.name);if(g||!f)return null;const v=(0,r.getBlockSupport)(e.name,[_v,"__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)(Go,{__experimentalGroup:"typography"},!n&&(0,s.createElement)(p.__experimentalToolsPanelItem,{hasValue:()=>function(e){return!!e.attributes.fontFamily}(e),label:(0,h.__)("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)(Uf,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)
72
+ /* translators: Ensure translation is distinct from "Letter case" */,label:(0,h.__)("Font size"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({fontSize:void 0,style:Mo({...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)(Qf,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:xf(d,m),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:Mo({...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)(Df,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,h.__)("Line height"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:Mo({...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)(Lf,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,h.__)("Decoration"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:Mo({...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)(iv,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)
73
+ /* translators: Ensure translation is distinct from "Font size" */,label:(0,h.__)("Letter case"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:Mo({...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)(gv,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,h.__)("Letter spacing"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:Mo({...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)(bv,e)))}const Cv=e=>yv.some((t=>(0,r.hasBlockSupport)(e,t))),Sv=[...yv,Mh,df,tr],wv=e=>Sv.some((t=>(0,r.hasBlockSupport)(e,t))),Bv="var:";function Iv(e){var t;return null!=e&&null!==(t=e.startsWith)&&void 0!==t&&t.call(e,Bv)?`var(--wp--${e.slice(Bv.length).split("|").join("--")})`:e}function xv(){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"!==(null==l?void 0:l[0])){const s=(0,u.get)(e,l);r.__EXPERIMENTAL_STYLE_PROPERTY[o].useEngine||(i&&"string"!=typeof s?Object.entries(i).forEach((e=>{const[t,o]=e,r=(0,u.get)(s,[o]);r&&(n[t]=Iv(r))})):t.includes(l.join("."))||(n[o]=Iv((0,u.get)(e,l))))}}));const o=wl(e);return o.forEach((e=>{n[e.key]=e.value})),n}const Tv={"__experimentalBorder.__experimentalSkipSerialization":["border"],"color.__experimentalSkipSerialization":[df],[`${_v}.__experimentalSkipSerialization`]:[_v],[`${tr}.__experimentalSkipSerialization`]:["spacing"]},Nv={...Tv,[`${tr}`]:["spacing.blockGap"]},Pv={gradients:"gradient"};function Lv(e,t,n){let o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Nv;if(!wv(t))return e;let{style:l}=n;return Object.entries(o).forEach((e=>{let[n,o]=e;const i=(0,r.getBlockSupport)(t,n);!0===i&&(l=(0,u.omit)(l,o)),Array.isArray(i)&&i.forEach((e=>{const t=Pv[e]||e;l=(0,u.omit)(l,[[...o,t]])}))})),e.style={...xv(l),...e.style},e}const Mv=(0,d.createHigherOrderComponent)((e=>t=>{const n=io();return(0,s.createElement)(s.Fragment,null,n&&(0,s.createElement)(s.Fragment,null,(0,s.createElement)(Cf,t),(0,s.createElement)(Ev,t),(0,s.createElement)(zh,t),(0,s.createElement)(rr,t)),(0,s.createElement)(e,t))}),"withToolbarControls"),Rv=(0,d.createHigherOrderComponent)((e=>t=>{var n,o;const l=`wp-elements-${(0,d.useInstanceId)(e)}`,a=Do(t.name,df,"link")?(0,u.omit)(null===(n=t.attributes.style)||void 0===n?void 0:n.elements,["link"]):null===(o=t.attributes.style)||void 0===o?void 0:o.elements,p=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object.entries(t).map((t=>{let[n,o]=t;const l=xv(o);return(0,u.isEmpty)(l)?"":[`.editor-styles-wrapper .${e} ${r.__EXPERIMENTAL_ELEMENTS[n]}{`,...Object.entries(l).map((e=>{let[t,n]=e;return`\t${(0,u.kebabCase)(t)}: ${n};`})),"}"].join("\n")})).join("\n")}(l,a),m=(0,s.useContext)(dh.__unstableElementContext);return(0,s.createElement)(s.Fragment,null,a&&m&&(0,s.createPortal)((0,s.createElement)("style",{dangerouslySetInnerHTML:{__html:p}}),m),(0,s.createElement)(e,i({},t,{className:a?c()(t.className,l):t.className})))}));(0,l.addFilter)("blocks.registerBlockType","core/style/addAttribute",(function(e){return wv(e)?(e.attributes.style||Object.assign(e.attributes,{style:{type:"object"}}),e):e})),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/style/addSaveProps",Lv),(0,l.addFilter)("blocks.registerBlockType","core/style/addEditProps",(function(e){if(!wv(e))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=n=>{let o={};return t&&(o=t(n)),Lv(o,e,n,Tv)},e})),(0,l.addFilter)("editor.BlockEdit","core/style/with-block-controls",Mv),(0,l.addFilter)("editor.BlockListBlock","core/editor/with-elements-styles",Rv),(0,l.addFilter)("blocks.registerBlockType","core/settings/addAttribute",(function(e){var t,n;return n=e,(0,r.hasBlockSupport)(n,"__experimentalSettings",!1)?(null!=e&&null!==(t=e.attributes)&&void 0!==t&&t.settings||(e.attributes={...e.attributes,settings:{type:"object"}}),e):e}));const Av=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M12 4 4 19h16L12 4zm0 3.2 5.5 10.3H12V7.2z"})),Dv=function(e){let t,{colorPalette:n,duotonePalette:o,disableCustomColors:r,disableCustomDuotone:l,value:i,onChange:a}=e;return t="unset"===i?(0,s.createElement)(p.ColorIndicator,{className:"block-editor-duotone-control__unset-indicator"}):i?(0,s.createElement)(p.DuotoneSwatch,{values:i}):(0,s.createElement)(Rr,{icon:Av}),(0,s.createElement)(p.Dropdown,{popoverProps:{className:"block-editor-duotone-control__popover",headerTitle:(0,h.__)("Duotone"),isAlternate:!0},renderToggle:e=>{let{isOpen:n,onToggle:o}=e;return(0,s.createElement)(p.ToolbarButton,{showTooltip:!0,onClick:o,"aria-haspopup":"true","aria-expanded":n,onKeyDown:e=>{n||e.keyCode!==$c.DOWN||(e.preventDefault(),o())},label:(0,h.__)("Apply duotone filter"),icon:t})},renderContent:()=>(0,s.createElement)(p.MenuGroup,{label:(0,h.__)("Duotone")},(0,s.createElement)("div",{className:"block-editor-duotone-control__description"},(0,h.__)("Create a two-tone color effect without losing your original image.")),(0,s.createElement)(p.DuotonePicker,{colorPalette:n,duotonePalette:o,disableCustomColors:r,disableCustomDuotone:l,value:i,onChange:a}))})},Ov=[];function Fv(e){let{selector:t,id:n,colors:o}=e;return"unset"===o?(0,s.createElement)(Dd,{selector:t}):(0,s.createElement)(s.Fragment,null,(0,s.createElement)(Od,{id:n,colors:o}),(0,s.createElement)(Ad,{id:n,selector:t}))}function zv(e){let{presetSetting:t,defaultSetting:n}=e;const o=!To(n),r=To(`${t}.custom`)||Ov,l=To(`${t}.theme`)||Ov,i=To(`${t}.default`)||Ov;return(0,s.useMemo)((()=>[...r,...l,...o?Ov:i]),[o,r,l,i])}function Vv(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=zv({presetSetting:"color.duotone",defaultSetting:"color.defaultDuotone"}),a=zv({presetSetting:"color.palette",defaultSetting:"color.defaultPalette"}),c=!To("color.custom"),u=!To("color.customDuotone")||0===(null==a?void 0:a.length)&&c;return 0===(null==i?void 0:i.length)&&u?null:(0,s.createElement)(po,{group:"block",__experimentalShareWithChildBlocks:!0},(0,s.createElement)(Dv,{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})}}))}ld([id]);const Hv=(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)(Vv,t))}),"withDuotoneControls"),Gv=(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),g=c()(null==t?void 0:t.className,p),h=(0,s.useContext)(dh.__unstableElementContext);return(0,s.createElement)(s.Fragment,null,h&&(0,s.createPortal)((0,s.createElement)(Fv,{selector:m,id:p,colors:u}),h),(0,s.createElement)(e,i({},t,{className:g})))}),"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",Hv),(0,l.addFilter)("editor.BlockListBlock","core/editor/duotone/with-styles",Gv);const Uv="__experimentalLayout";function Wv(e){let{setAttributes:t,attributes:n,name:o}=e;const{layout:l}=n,i=To("layout"),a=(0,m.useSelect)((e=>{const{getSettings:t}=e(to);return t().supportsLayout}),[]),c=(0,r.getBlockSupport)(o,Uv,{}),{allowSwitching:u,allowEditing:d=!0,allowInheriting:g=!0,default:f}=c;if(!d)return null;const v=!(!g||!i||null!=l&&l.type&&"default"!==(null==l?void 0:l.type)&&(null==l||!l.inherit)),b=l||f||{},{inherit:k=!1,type:_="default"}=b;if("default"===_&&!a)return null;const y=Fr(_),E=e=>t({layout:e});return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(Go,null,(0,s.createElement)(p.PanelBody,{title:(0,h.__)("Layout")},v&&(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.ToggleControl,{label:(0,h.__)("Inner blocks use full width"),checked:!k,onChange:()=>t({layout:{inherit:!k}})}),(0,s.createElement)("p",{className:"block-editor-hooks__layout-controls-helptext"},k?(0,h.__)("Nested blocks use theme content width with options for full and wide widths."):(0,h.__)("Nested blocks will fill the width of this container."))),!k&&u&&(0,s.createElement)($v,{type:_,onChange:e=>t({layout:{type:e}})}),!k&&y&&(0,s.createElement)(y.inspectorControls,{layout:b,onChange:E,layoutBlockSupport:c}))),!k&&y&&(0,s.createElement)(y.toolBarControls,{layout:b,onChange:E,layoutBlockSupport:c}))}function $v(e){let{type:t,onChange:n}=e;return(0,s.createElement)(p.ButtonGroup,null,Or.map((e=>{let{name:o,label:r}=e;return(0,s.createElement)(p.Button,{key:o,isPressed:t===o,onClick:()=>n(o)},r)})))}const jv=(0,d.createHigherOrderComponent)((e=>t=>{const{name:n}=t;return[(0,r.hasBlockSupport)(n,Uv)&&(0,s.createElement)(Wv,i({key:"layout"},t)),(0,s.createElement)(e,i({key:"edit"},t))]}),"withInspectorControls"),Kv=(0,d.createHigherOrderComponent)((e=>t=>{const{name:n,attributes:o}=t,l=(0,r.hasBlockSupport)(n,Uv),a=(0,d.useInstanceId)(e),p=To("layout")||{},m=(0,s.useContext)(dh.__unstableElementContext),{layout:g}=o,{default:h}=(0,r.getBlockSupport)(n,Uv)||{},f=null!=g&&g.inherit?p:g||h||{},v=l?function(e,t){var n;const o=[];var r;return null!=t&&null!==(n=t[(null==e?void 0:e.type)||"default"])&&void 0!==n&&n.className&&o.push(null==t||null===(r=t[(null==e?void 0:e.type)||"default"])||void 0===r?void 0:r.className),null!=e&&e.orientation&&o.push(`is-${(0,u.kebabCase)(e.orientation)}`),null!=e&&e.justifyContent&&o.push(`is-content-justification-${(0,u.kebabCase)(e.justifyContent)}`),null!=e&&e.flexWrap&&"nowrap"===e.flexWrap&&o.push("is-nowrap"),o}(f,null==p?void 0:p.definitions):null,b=`.${(0,r.getBlockDefaultClassName)(n)}.wp-container-${a}`,k=null!==To("spacing.blockGap");let _;if(l){var y;const e=Fr((null==f?void 0:f.type)||"default");_=null==e||null===(y=e.getLayoutStyle)||void 0===y?void 0:y.call(e,{blockName:n,selector:b,layout:f,layoutDefinitions:null==p?void 0:p.definitions,style:null==o?void 0:o.style,hasBlockGapSupport:k})}const E=c()(null==t?void 0:t.className,{[`wp-container-${a}`]:l&&!!_},v);return(0,s.createElement)(s.Fragment,null,l&&m&&!!_&&(0,s.createPortal)((0,s.createElement)(Ur,{blockName:n,selector:b,css:_,layout:f,style:null==o?void 0:o.style}),m),(0,s.createElement)(e,i({},t,{className:E})))}));function qv(e){var t;const n=(null===(t=e.style)||void 0===t?void 0:t.border)||{};return{className:Uh(e)||void 0,style:xv({border:n})}}function Yv(e){const{colors:t}=Lh(),n=qv(e),{borderColor:o}=e;if(o){const e=Oh({colors:t,namedColor:o});n.style.borderColor=e.color}return n}function Zv(e){var t,n,o,r,l,i;const{backgroundColor:s,textColor:a,gradient:u,style:d}=e,p=Nh("background-color",s),m=Nh("color",a),g=$h(u),h=g||(null==d||null===(t=d.color)||void 0===t?void 0:t.gradient);return{className:c()(m,g,{[p]:!h&&!!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:xv({color:(null==d?void 0:d.color)||{}})}}(0,l.addFilter)("blocks.registerBlockType","core/layout/addAttribute",(function(e){return(0,u.has)(e.attributes,["layout","type"])||(0,r.hasBlockSupport)(e,Uv)&&(e.attributes={...e.attributes,layout:{type:"object"}}),e})),(0,l.addFilter)("editor.BlockListBlock","core/editor/layout/with-layout-styles",Kv),(0,l.addFilter)("editor.BlockEdit","core/editor/layout/with-inspector-controls",jv);const Qv={};function Xv(e){const{backgroundColor:t,textColor:n,gradient:o}=e,r=To("color.palette.custom")||[],l=To("color.palette.theme")||[],i=To("color.palette.default")||[],a=To("color.gradients")||Qv,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=Zv(e);if(t){const e=xh(c,t);d.style.backgroundColor=e.color}if(o&&(d.style.background=jh(u,o)),n){const e=xh(c,n);d.style.color=e.color}return d}function Jv(e){const{style:t}=e;return{style:xv({spacing:(null==t?void 0:t.spacing)||{}})}}function eb(e){const[t,n]=(0,s.useState)(e);return(0,s.useEffect)((()=>{e&&n(e)}),[e]),t}const tb=e=>(0,d.createHigherOrderComponent)((t=>n=>(0,s.createElement)(t,i({},n,{colors:e}))),"withCustomColorPalette"),nb=()=>(0,d.createHigherOrderComponent)((e=>t=>{const n=To("color.palette.custom"),o=To("color.palette.theme"),r=To("color.palette.default"),l=(0,s.useMemo)((()=>[...n||[],...o||[],...r||[]]),[n,o,r]);return(0,s.createElement)(e,i({},t,{colors:l}))}),"withEditorColorPalette");function ob(e,t){const n=(0,u.reduce)(e,((e,t)=>({...e,..."string"==typeof 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=od(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=Th(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=xh(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:Nh(n,i.slug)},e}),{})}render(){return(0,s.createElement)(e,i({},this.props,{colors:void 0},this.state,this.setters,{colorUtils:this.colorUtils}))}}])}function rb(e){return function(){const t=tb(e);for(var n=arguments.length,o=new Array(n),r=0;r<n;r++)o[r]=arguments[r];return(0,d.createHigherOrderComponent)(ob(o,t),"withCustomColors")}}function lb(){const e=nb();for(var t=arguments.length,n=new Array(t),o=0;o<t;o++)n[o]=arguments[o];return(0,d.createHigherOrderComponent)(ob(n,e),"withColors")}const ib=[],sb=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=To("typography.fontSizes")||ib;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=$f(r,l,n[t]);return e[o]={...i,class:Kf(l)},e}),{});return{...t,...i}}render(){return(0,s.createElement)(e,i({},this.props,{fontSizes:void 0},this.state,this.setters))}}]),"withFontSizes")},ab=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M4 19.8h8.9v-1.5H4v1.5zm8.9-15.6H4v1.5h8.9V4.2zm-8.9 7v1.5h16v-1.5H4z"})),cb=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M16.4 4.2H7.6v1.5h8.9V4.2zM4 11.2v1.5h16v-1.5H4zm3.6 8.6h8.9v-1.5H7.6v1.5z"})),ub=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M11.1 19.8H20v-1.5h-8.9v1.5zm0-15.6v1.5H20V4.2h-8.9zM4 12.8h16v-1.5H4v1.5z"})),db=[{icon:ab,title:(0,h.__)("Align text left"),align:"left"},{icon:cb,title:(0,h.__)("Align text center"),align:"center"},{icon:ub,title:(0,h.__)("Align text right"),align:"right"}],pb={position:"bottom right",isAlternate:!0},mb=function(e){let{value:t,onChange:n,alignmentControls:o=db,label:r=(0,h.__)("Align"),describedBy:l=(0,h.__)("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)),g=c?p.ToolbarGroup:p.ToolbarDropdownMenu,f=c?{isCollapsed:a}:{};return(0,s.createElement)(g,i({icon:m?m.icon:(0,h.isRTL)()?ub:ab,label:r,toggleProps:{describedBy:l},popoverProps:pb,controls:o.map((e=>{const{align:n}=e,o=t===n;return{...e,isActive:o,role:a?"menuitemradio":void 0,onClick:d(n)}}))},f))},gb=e=>(0,s.createElement)(mb,i({},e,{isToolbar:!1})),hb=e=>(0,s.createElement)(mb,i({},e,{isToolbar:!0})),fb=()=>{},vb={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(to),r=t();return{selectedBlockName:r?n(r):null,rootClientId:o().rootClientId}}),[]),[o,r,l]=np(t,fb),i=(0,s.useMemo)((()=>(e.trim()?Bp(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)(iu,{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))}}},bb=window.wp.apiFetch;var kb=n.n(bb);const _b=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.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"})),yb=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.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"})),Eb={name:"links",className:"block-editor-autocompleters__link",triggerPrefix:"[[",options:async e=>{let t=await kb()({path:(0,Ap.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)(Rr,{key:"icon",icon:"page"===e.subtype?_b:yb}),e.title),getOptionCompletion:e=>(0,s.createElement)("a",{href:e.url},e.title)},Cb=[];function Sb(e){let{completers:t=Cb}=e;const{name:n}=lo();return(0,s.useMemo)((()=>{let e=t;return(n===(0,r.getDefaultBlockName)()||(0,r.getBlockSupport)(n,"__experimentalSlashInserter",!1))&&(e=e.concat([vb,Eb])),(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])}const wb=function(e){return(0,s.createElement)(p.Autocomplete,i({},e,{completers:Sb(e)}))},Bb=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.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"})),Ib=function(e){let{isActive:t,label:n=(0,h.__)("Toggle full height"),onToggle:o,isDisabled:r}=e;return(0,s.createElement)(p.ToolbarButton,{isActive:t,icon:Bb,label:n,onClick:()=>o(!t),disabled:r})},xb=()=>{},Tb=function(e){const{label:t=(0,h.__)("Change matrix alignment"),onChange:n=xb,value:o="center",isDisabled:r}=e,l=(0,s.createElement)(p.__experimentalAlignmentMatrixControl.Icon,{value:o});return(0,s.createElement)(p.Dropdown,{position:"bottom right",popoverProps:{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!==$c.DOWN||(e.preventDefault(),n())},label:t,icon:l,showTooltip:!0,disabled:r})},renderContent:()=>(0,s.createElement)(p.__experimentalAlignmentMatrixControl,{hasFocusBorder:!1,onChange:n,value:o})})},Nb=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M10.8622 8.04053L14.2805 12.0286L10.8622 16.0167L9.72327 15.0405L12.3049 12.0286L9.72327 9.01672L10.8622 8.04053Z"})),Pb=function(e){let{rootLabelText:t}=e;const{selectBlock:n,clearSelectedBlock:o}=(0,m.useDispatch)(to),{clientId:r,parents:l,hasSelection:i}=(0,m.useSelect)((e=>{const{getSelectionStart:t,getSelectedBlockClientId:n,getBlockParents:o}=e(to),r=n();return{parents:o(r),clientId:r,hasSelection:!!t().clientId}}),[]),a=t||(0,h.__)("Document");return(0,s.createElement)("ul",{className:"block-editor-block-breadcrumb",role:"list","aria-label":(0,h.__)("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)(Rr,{icon:Nb,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)(pm,{clientId:e,maximumLength:35})),(0,s.createElement)(Rr,{icon:Nb,className:"block-editor-block-breadcrumb__separator"})))),!!r&&(0,s.createElement)("li",{className:"block-editor-block-breadcrumb__current","aria-current":"true"},(0,s.createElement)(pm,{clientId:r,maximumLength:35})))};function Lb(e){return(0,m.useSelect)((t=>{const{isBlockSelected:n,hasSelectedInnerBlock:o,canEditBlock:r}=t(to);return!r(e)||!n(e)&&!o(e,!0)}),[e])}const Mb=()=>(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"})),Rb=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)(Mb,null)))},Ab=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,h.__)("Open Colors Selector"),onClick:o,onKeyDown:e=>{r||e.keyCode!==$c.DOWN||(e.preventDefault(),o())},icon:(0,s.createElement)(n,null,(0,s.createElement)(t,null,(0,s.createElement)(Rb,null)))}))}},Db=e=>{let{children:t,...n}=e;return V()("wp.blockEditor.BlockColorsStyleSelector",{alternative:"block supports API",since:"6.1",version:"6.3"}),(0,s.createElement)(p.Dropdown,{position:"bottom right",className:"block-library-colors-selector",contentClassName:"block-library-colors-selector__popover",renderToggle:Ab(n),renderContent:()=>t})},Ob=(0,s.createElement)(D.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,s.createElement)(D.Path,{d:"M13.8 5.2H3v1.5h10.8V5.2zm-3.6 12v1.5H21v-1.5H10.2zm7.2-6H6.6v1.5h10.8v-1.5z"})),Fb=xc(p.__experimentalTreeGridRow);function zb(e){let{isSelected:t,position:n,level:o,rowCount:r,children:l,className:a,path:u,...d}=e;const p=Pc({isSelected:t,adjustScrolling:!1,enableAnimation:!0,triggerAnimationOnChange:u});return(0,s.createElement)(Fb,i({ref:p,className:c()("block-editor-list-view-leaf",a),level:o,positionInSet:n,setSize:r},d),l)}function Vb(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)(Rr,{icon:Nb}))}const Hb=(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 g=um(o),h=dm({clientId:o,context:"list-view"}),{isLocked:f}=bg(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!==$c.ENTER&&e.keyCode!==$c.SPACE||r(e)},ref:t,tabIndex:i,onFocus:a,onDragStart:e=>{e.dataTransfer.clearData(),null==u||u(e)},onDragEnd:d,draggable:m,href:`#block-${o}`,"aria-hidden":!0},(0,s.createElement)(Vb,{onClick:l}),(0,s.createElement)(iu,{icon:null==g?void 0:g.icon,showColors:!0}),(0,s.createElement)(p.__experimentalHStack,{alignment:"center",className:"block-editor-list-view-block-select-button__label-wrapper",justify:"flex-start",spacing:1},(0,s.createElement)("span",{className:"block-editor-list-view-block-select-button__title"},(0,s.createElement)(p.__experimentalTruncate,{ellipsizeMode:"auto"},h)),(null==g?void 0:g.anchor)&&(0,s.createElement)("span",{className:"block-editor-list-view-block-select-button__anchor"},g.anchor),f&&(0,s.createElement)("span",{className:"block-editor-list-view-block-select-button__lock"},(0,s.createElement)(Rr,{icon:_g})))))})),Gb=(0,s.forwardRef)(((e,t)=>{let{onClick:n,onToggleExpanded:o,block:r,isSelected:l,position:a,siblingBlockCount:u,level:d,isExpanded:p,selectedClientIds:g,...h}=e;const{clientId:f}=r,{blockMovingClientId:v,selectedBlockInBlockEditor:b}=(0,m.useSelect)((e=>{const{hasBlockMovingClientId:t,getSelectedBlockClientId:n}=e(to);return{blockMovingClientId:t(),selectedBlockInBlockEditor:n()}}),[f]),k=v&&b===f,_=c()("block-editor-list-view-block-contents",{"is-dropping-before":k}),y=g.includes(f)?g:[f];return(0,s.createElement)(mm,{clientIds:y},(e=>{let{draggable:c,onDragStart:m,onDragEnd:g}=e;return(0,s.createElement)(Hb,i({ref:t,className:_,block:r,onClick:n,onToggleExpanded:o,isSelected:l,position:a,siblingBlockCount:u,level:d,draggable:c,onDragStart:m,onDragEnd:g,isExpanded:p},h))}))})),Ub=(0,s.createContext)({}),Wb=()=>(0,s.useContext)(Ub),$b=(0,s.memo)((function e(t){let{block:n,isDragged:o,isSelected:l,isBranchSelected:i,selectBlock:a,position:u,level:g,rowCount:f,siblingBlockCount:v,showBlockMovers:b,path:k,isExpanded:_,selectedClientIds:y,preventAnnouncement:E}=t;const C=(0,s.useRef)(null),[S,w]=(0,s.useState)(!1),{clientId:B}=n,I=l&&y[0]===B,x=l&&y[y.length-1]===B,{toggleBlockHighlight:T}=(0,m.useDispatch)(to),N=um(B),P=(0,m.useSelect)((e=>e(to).getBlockName(B)),[B]),L=(0,r.hasBlockSupport)(P,"__experimentalToolbar",!0),{isLocked:M}=bg(B),R=`list-view-block-select-button__${(0,d.useInstanceId)(e)}`,A=((e,t,n)=>(0,h.sprintf)(
74
  /* translators: 1: The numerical position of the block. 2: The total number of blocks. 3. The level of nesting for the block. */
75
+ (0,h.__)("Block %1$d of %2$d, Level %3$d"),e,t,n))(u,v,g);let D=(0,h.__)("Link");N&&(D=M?(0,h.sprintf)(// translators: %s: The title of the block. This string indicates a link to select the locked block.
76
  (0,h.__)("%s link (locked)"),N.title):(0,h.sprintf)(// translators: %s: The title of the block. This string indicates a link to select the block.
77
  (0,h.__)("%s link"),N.title));const O=N?(0,h.sprintf)(// translators: %s: The title of the block.
78
+ (0,h.__)("Options for %s block"),N.title):(0,h.__)("Options"),{isTreeGridMounted:F,expand:z,collapse:V}=Wb(),H=b&&v>0,G=c()("block-editor-list-view-block__mover-cell",{"is-visible":S||l}),U=c()("block-editor-list-view-block__menu-cell",{"is-visible":S||I});(0,s.useEffect)((()=>{!F&&l&&C.current.focus()}),[]);const W=(0,s.useCallback)((()=>{w(!0),T(B,!0)}),[B,w,T]),$=(0,s.useCallback)((()=>{w(!1),T(B,!1)}),[B,w,T]),j=(0,s.useCallback)((e=>{a(e,B),e.preventDefault()}),[B,a]),K=(0,s.useCallback)((e=>{a(void 0,e)}),[a]),q=(0,s.useCallback)((e=>{e.preventDefault(),e.stopPropagation(),!0===_?V(B):!1===_&&z(B)}),[B,z,V,_]);let Y;H?Y=2:L||(Y=3);const Z=c()({"is-selected":l,"is-first-selected":I,"is-last-selected":x,"is-branch-selected":i,"is-dragging":o,"has-single-cell":!L}),Q=y.includes(B)?y:[B];return(0,s.createElement)(zb,{className:Z,onMouseEnter:W,onMouseLeave:$,onFocus:W,onBlur:$,level:g,position:u,rowCount:f,path:k,id:`list-view-block-${B}`,"data-block":B,isExpanded:_,"aria-selected":!!l},(0,s.createElement)(p.__experimentalTreeGridCell,{className:"block-editor-list-view-block__contents-cell",colSpan:Y,ref:C,"aria-label":D,"aria-selected":!!l,"aria-expanded":_,"aria-describedby":R},(e=>{let{ref:t,tabIndex:o,onFocus:r}=e;return(0,s.createElement)("div",{className:"block-editor-list-view-block__contents-container"},(0,s.createElement)(Gb,{block:n,onClick:j,onToggleExpanded:q,isSelected:l,position:u,siblingBlockCount:v,level:g,ref:t,tabIndex:o,onFocus:r,isExpanded:_,selectedClientIds:y,preventAnnouncement:E}),(0,s.createElement)("div",{className:"block-editor-list-view-block-select-button__description",id:R},A))})),H&&(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.__experimentalTreeGridCell,{className:G,withoutGridItem:!0},(0,s.createElement)(p.__experimentalTreeGridItem,null,(e=>{let{ref:t,tabIndex:n,onFocus:o}=e;return(0,s.createElement)(Sm,{orientation:"vertical",clientIds:[B],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)(wm,{orientation:"vertical",clientIds:[B],ref:t,tabIndex:n,onFocus:o})})))),L&&(0,s.createElement)(p.__experimentalTreeGridCell,{className:U,"aria-selected":!!l},(e=>{let{ref:t,tabIndex:n,onFocus:o}=e;return(0,s.createElement)(Pg,{clientIds:Q,icon:og,label:O,toggleProps:{ref:t,className:"block-editor-list-view-block__menu",tabIndex:n,onFocus:o},disableOpenOnArrowDown:!0,__experimentalSelectBlock:K})})))}));function jb(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(Kb(t,n,o),0):1}const Kb=(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+jb(r,e,t,n):o+1};function qb(e){const{blocks:t,selectBlock:n,showBlockMovers:o,selectedClientIds:r,level:l=1,path:i="",isBranchSelected:a=!1,listPosition:c=0,fixedListWindow:d,isExpanded:p}=e,{expandedState:g,draggedClientIds:h}=Wb(),f=(0,u.compact)(t),v=f.length;let b=c;return(0,s.createElement)(s.Fragment,null,f.map(((e,t)=>{var c;const{clientId:u,innerBlocks:k}=e;t>0&&(b+=jb(f[t-1],g,h,p));const{itemInView:_}=d,y=_(b),E=t+1,C=i.length>0?`${i}_${E}`:`${E}`,S=!(null==k||!k.length),w=S?null!==(c=g[u])&&void 0!==c?c:p:void 0,B=!(null==h||!h.includes(u)),I=B||y,x=((e,t)=>Array.isArray(t)&&t.length?-1!==t.indexOf(e):t===e)(u,r),T=a||x&&S;return(0,s.createElement)(m.AsyncModeProvider,{key:u,value:!x},I&&(0,s.createElement)($b,{block:e,selectBlock:n,isSelected:x,isBranchSelected:T,isDragged:B,level:l,position:E,rowCount:v,siblingBlockCount:v,showBlockMovers:o,path:C,isExpanded:w,listPosition:b,selectedClientIds:r}),!I&&(0,s.createElement)("tr",null,(0,s.createElement)("td",{className:"block-editor-list-view-placeholder"})),S&&w&&!B&&(0,s.createElement)(qb,{blocks:k,selectBlock:n,showBlockMovers:o,level:l+1,path:C,listPosition:b+1,fixedListWindow:d,isBranchSelected:T,selectedClientIds:r,isExpanded:p}))})))}qb.defaultProps={selectBlock:()=>{}};const Yb=(0,s.memo)(qb);function Zb(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:0,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,{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 Qb(e,t){return t.left<=e.x&&t.right>=e.x&&t.top<=e.y&&t.bottom>=e.y}const Xb=["top","bottom"];const Jb=(e,t)=>Array.isArray(t.clientIds)?{...e,...t.clientIds.reduce(((e,n)=>({...e,[n]:"expand"===t.type})),{})}:e,ek=(0,s.forwardRef)((function(e,t){let{id:n,blocks:o,showBlockMovers:l=!1,isExpanded:i=!1}=e;const{clientIdsTree:a,draggedClientIds:c,selectedClientIds:g}=function(e){return(0,m.useSelect)((t=>{const{getDraggedBlockClientIds:n,getSelectedBlockClientIds:o,__unstableGetClientIdsTree:r}=t(to);return{selectedClientIds:o(),draggedClientIds:n(),clientIdsTree:e||r()}}),[e])}(o),{visibleBlockCount:f}=(0,m.useSelect)((e=>{const{getGlobalBlockCount:t,getClientIdsOfDescendants:n}=e(to),o=(null==c?void 0:c.length)>0?n(c).length+1:0;return{visibleBlockCount:t()-o}}),[c]),{updateBlockSelection:v}=function(){const{clearSelectedBlock:e,multiSelect:t,selectBlock:n}=(0,m.useDispatch)(to),{getBlockName:o,getBlockParents:l,getBlockSelectionStart:i,getBlockSelectionEnd:a,getSelectedBlockClientIds:c,hasMultiSelection:d,hasSelectedBlock:p}=(0,m.useSelect)(to),{getBlockType:g}=(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===$c.UP||r.keyCode===$c.DOWN||r.keyCode===$c.HOME||r.keyCode===$c.END);if(!m&&!p()&&!d())return void n(s,null);const f=c(),v=[...l(s),s];m&&!f.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===$c.HOME||r.keyCode===$c.END)&&S.length>1)return;const w=(0,u.difference)(f,S);let B;if(1===w.length){var I;const e=null===(I=g(o(w[0])))||void 0===I?void 0:I.title;e&&(B=(0,h.sprintf)(
79
  /* translators: %s: block name */
80
  (0,h.__)("%s deselected."),e))}else w.length>1&&(B=(0,h.sprintf)(
81
  /* translators: %s: number of deselected blocks */
82
+ (0,h.__)("%s blocks deselected."),w.length));B&&(0,Gt.speak)(B)}),[e,o,g,l,i,a,c,d,p,t,n])}}(),[b,k]=(0,s.useReducer)(Jb,{}),{ref:_,target:y}=function(){const{getBlockRootClientId:e,getBlockIndex:t,getBlockCount:n,getDraggedBlockClientIds:o,canInsertBlocks:r}=(0,m.useSelect)(to),[l,i]=(0,s.useState)(),{rootClientId:a,blockIndex:c}=l||{},u=Xg(a,c),p=o(),g=(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]=eh(t,s,Xb),u=Qb(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){g(e,e.currentTarget)},onDragEnd(){g.cancel(),i(null)}}),target:l}}(),E=(0,s.useRef)(),C=(0,d.useMergeRefs)([E,_,t]),S=(0,s.useRef)(!1),{setSelectedTreeId:w}=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(to);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:g[0],setExpandedState:k}),B=(0,s.useCallback)(((e,t)=>{v(e,t),w(t)}),[w,v]);(0,s.useEffect)((()=>{S.current=!0}),[]);const[I]=(0,d.__experimentalUseFixedWindowList)(E,36,f,{useWindowing:!0,windowOverscan:40}),x=(0,s.useCallback)((e=>{e&&k({type:"expand",clientIds:[e]})}),[k]),T=(0,s.useCallback)((e=>{e&&k({type:"collapse",clientIds:[e]})}),[k]),N=(0,s.useCallback)((e=>{var t;x(null==e||null===(t=e.dataset)||void 0===t?void 0:t.block)}),[x]),P=(0,s.useCallback)((e=>{var t;T(null==e||null===(t=e.dataset)||void 0===t?void 0:t.block)}),[T]),L=(0,s.useCallback)(((e,t,n)=>{var o,r;e.shiftKey&&v(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)}),[v]),M=(0,s.useMemo)((()=>({isTreeGridMounted:S.current,draggedClientIds:c,expandedState:b,expand:x,collapse:T})),[S.current,c,b,x,T]);return(0,s.createElement)(m.AsyncModeProvider,{value:!0},(0,s.createElement)(Zb,{listViewRef:E,blockDropTarget:y}),(0,s.createElement)(p.__experimentalTreeGrid,{id:n,className:"block-editor-list-view-tree","aria-label":(0,h.__)("Block navigation structure"),ref:C,onCollapseRow:P,onExpandRow:N,onFocusRow:L},(0,s.createElement)(Ub.Provider,{value:M},(0,s.createElement)(Yb,{blocks:a,selectBlock:B,showBlockMovers:l,fixedListWindow:I,selectedClientIds:g,isExpanded:i}))))}));function tk(e){let{isEnabled:t,onToggle:n,isOpen:o,innerRef:r,...l}=e;return(0,s.createElement)(p.Button,i({},l,{ref:r,icon:Ob,"aria-expanded":o,"aria-haspopup":"true",onClick:t?n:void 0
83
+ /* translators: button label text should, if possible, be under 16 characters. */,label:(0,h.__)("List view"),className:"block-editor-block-navigation","aria-disabled":!t}))}const nk=(0,s.forwardRef)((function(e,t){let{isDisabled:n,...o}=e;V()("wp.blockEditor.BlockNavigationDropdown",{since:"6.1",alternative:"wp.components.Dropdown and wp.blockEditor.ListView"});const r=(0,m.useSelect)((e=>!!e(to).getBlockCount()),[])&&!n;return(0,s.createElement)(p.Dropdown,{contentClassName:"block-editor-block-navigation__popover",position:"bottom right",renderToggle:e=>{let{isOpen:n,onToggle:l}=e;return(0,s.createElement)(tk,i({},o,{innerRef:t,isOpen:n,onToggle:l,isEnabled:r}))},renderContent:()=>(0,s.createElement)("div",{className:"block-editor-block-navigation__container"},(0,s.createElement)("p",{className:"block-editor-block-navigation__label"},(0,h.__)("List view")),(0,s.createElement)(ek,null))})}));function ok(e){let{genericPreviewBlock:t,style:n,className:o,activeStyle:r}=e;const l=Vm(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)(Wd,{item:i,isStylePreview:!0})}function rk(e){let{children:t,scope:n,...o}=e;return(0,s.createElement)(p.Fill,{name:`BlockStylesPreviewPanel/${n}`},(0,s.createElement)("div",o,t))}const lk=()=>{};function ik(e){let{clientId:t,onSwitch:n=lk,onHoverClassName:o=lk,scope:r}=e;const{onSelect:l,stylesToRender:i,activeStyle:a,genericPreviewBlock:m,className:g}=Gm({clientId:t,onSwitch:n}),[h,f]=(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)}),[h]),!i||0===i.length)return null;const _=(0,u.debounce)(f,250),y=e=>{var t;h!==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:()=>y(e),onFocus:()=>y(e),onMouseLeave:()=>y(null),onBlur:()=>y(null),onClick:()=>(e=>{l(e),o(null),f(null),_.cancel()})(e),"aria-current":a.name===e.name},(0,s.createElement)(p.__experimentalText,{as:"span",limit:12,ellipsizeMode:"tail",className:"block-editor-block-styles__item-text",truncate:!0},t))}))),h&&!k&&(0,s.createElement)(rk,{scope:r,className:"block-editor-block-styles__preview-panel",style:{top:v},onMouseLeave:()=>y(null)},(0,s.createElement)(ok,{activeStyle:a,className:g,genericPreviewBlock:m,style:h})))}ik.Slot=function(e){let{scope:t}=e;return(0,s.createElement)(p.Slot,{name:`BlockStylesPreviewPanel/${t}`})};const sk=ik,ak=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.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"})),ck=function(e){let{icon:t=ak,label:n=(0,h.__)("Choose variation"),instructions:o=(0,h.__)("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,h.__)("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,h.__)("Skip"))))},uk=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.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"})),dk="carousel",pk="grid",mk=e=>{let{onBlockPatternSelect:t}=e;return(0,s.createElement)("div",{className:"block-editor-block-pattern-setup__actions"},(0,s.createElement)(p.Button,{variant:"primary",onClick:t},(0,h.__)("Choose")))},gk=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:bm,label:(0,h.__)("Previous pattern"),onClick:t,disabled:0===o}),(0,s.createElement)(p.Button,{icon:vm,label:(0,h.__)("Next pattern"),onClick:n,disabled:o===r-1}))},hk=e=>{let{viewMode:t,setViewMode:n,handlePrevious:o,handleNext:r,activeSlide:l,totalSlides:i,onBlockPatternSelect:a}=e;const c=t===dk,u=(0,s.createElement)("div",{className:"block-editor-block-pattern-setup__display-controls"},(0,s.createElement)(p.Button,{icon:Zr,label:(0,h.__)("Carousel view"),onClick:()=>n(dk),isPressed:c}),(0,s.createElement)(p.Button,{icon:uk,label:(0,h.__)("Grid view"),onClick:()=>n(pk),isPressed:t===pk}));return(0,s.createElement)("div",{className:"block-editor-block-pattern-setup__toolbar"},c&&(0,s.createElement)(gk,{handlePrevious:o,handleNext:r,activeSlide:l,totalSlides:i}),u,c&&(0,s.createElement)(mk,{onBlockPatternSelect:a}))},fk=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===dk){const e=new Map([[n,"active-slide"],[n-1,"previous-slide"],[n+1,"next-slide"]]);return(0,s.createElement)("div",{className:"block-editor-block-pattern-setup__carousel"},(0,s.createElement)("div",{className:a},(0,s.createElement)("ul",{className:"carousel-container"},o.map(((t,n)=>(0,s.createElement)(bk,{className:e.get(n)||"",key:t.name,pattern:t}))))))}return(0,s.createElement)("div",{className:"block-editor-block-pattern-setup__grid"},(0,s.createElement)(p.__unstableComposite,i({},l,{role:"listbox",className:a,"aria-label":(0,h.__)("Patterns list")}),o.map((e=>(0,s.createElement)(vk,{key:e.name,pattern:e,onSelect:r,composite:l})))))};function vk(e){let{pattern:t,onSelect:n,composite:o}=e;const r="block-editor-block-pattern-setup-list",{blocks:l,description:a,viewportWidth:c=700}=t,u=(0,d.useInstanceId)(vk,`${r}__item-description`);return(0,s.createElement)("div",{className:`${r}__list-item`,"aria-label":t.title,"aria-describedby":t.description?u:void 0},(0,s.createElement)(p.__unstableCompositeItem,i({role:"option",as:"div"},o,{className:`${r}__item`,onClick:()=>n(l)}),(0,s.createElement)(Gd,{blocks:l,viewportWidth:c})),!!a&&(0,s.createElement)(p.VisuallyHidden,{id:u},a))}function bk(e){let{className:t,pattern:n,minHeight:o}=e;const{blocks:r,title:l,description:i}=n,a=(0,d.useInstanceId)(bk,"block-editor-block-pattern-setup-list__item-description");return(0,s.createElement)("li",{className:`pattern-slide ${t}`,"aria-label":l,"aria-describedby":i?a:void 0},(0,s.createElement)(Gd,{blocks:r,__experimentalMinHeight:o}),!!i&&(0,s.createElement)(p.VisuallyHidden,{id:a},i))}const kk=e=>{let{clientId:t,blockName:n,filterPatternsFn:o,onBlockPatternSelect:l}=e;const[i,a]=(0,s.useState)(dk),[c,u]=(0,s.useState)(0),{replaceBlock:d}=(0,m.useDispatch)(to),p=function(e,t,n){return(0,m.useSelect)((o=>{const{getBlockRootClientId:r,__experimentalGetPatternsByBlockTypes:l,__experimentalGetAllowedPatterns:i}=o(to),s=r(e);return n?i(s).filter(n):l(t,s)}),[e,t,n])}(t,n,o);if(null==p||!p.length)return null;const g=l||(e=>{const n=e.map((e=>(0,r.cloneBlock)(e)));d(t,n)});return(0,s.createElement)(s.Fragment,null,(0,s.createElement)("div",{className:`block-editor-block-pattern-setup view-mode-${i}`},(0,s.createElement)(fk,{viewMode:i,activeSlide:c,patterns:p,onBlockPatternSelect:g}),(0,s.createElement)(hk,{viewMode:i,setViewMode:a,activeSlide:c,totalSlides:p.length,handleNext:()=>{u((e=>e+1))},handlePrevious:()=>{u((e=>e-1))},onBlockPatternSelect:()=>{g(p[c].blocks)}})))};function _k(e){let{className:t,onSelectVariation:n,selectedValue:o,variations:r}=e;return(0,s.createElement)("fieldset",{className:t},(0,s.createElement)(p.VisuallyHidden,{as:"legend"},(0,h.__)("Transform to variation")),r.map((e=>(0,s.createElement)(p.Button,{key:e.name,icon:(0,s.createElement)(iu,{icon:e.icon,showColors:!0}),isPressed:o===e.name,label:o===e.name?e.title:(0,h.sprintf)(
84
  /* translators: %s: Name of the block variation */
85
+ (0,h.__)("Transform to %s"),e.title),onClick:()=>n(e.name),"aria-label":e.title,showTooltip:!0}))))}function yk(e){let{className:t,onSelectVariation:n,selectedValue:o,variations:r}=e;const l=r.map((e=>{let{name:t,title:n,description:o}=e;return{value:t,label:n,info:o}}));return(0,s.createElement)(p.DropdownMenu,{className:t,label:(0,h.__)("Transform to variation"),text:(0,h.__)("Transform to variation"),popoverProps:{position:"bottom center",className:`${t}__popover`},icon:_m,toggleProps:{iconPosition:"right"}},(()=>(0,s.createElement)("div",{className:`${t}__container`},(0,s.createElement)(p.MenuGroup,null,(0,s.createElement)(p.MenuItemsChoice,{choices:l,value:o,onSelect:n})))))}const Ek=function(e){let{blockClientId:t}=e;const{updateBlockAttributes:n}=(0,m.useDispatch)(to),{activeBlockVariation:o,variations:l}=(0,m.useSelect)((e=>{const{getActiveBlockVariation:n,getBlockVariations:o}=e(r.store),{getBlockName:l,getBlockAttributes:i}=e(to),s=t&&l(t);return{activeBlockVariation:n(s,i(t)),variations:s&&o(s,"transform")}}),[t]),i=null==o?void 0:o.name,a=(0,s.useMemo)((()=>{const e=new Set;return!!l&&(l.forEach((t=>{var n;t.icon&&e.add((null===(n=t.icon)||void 0===n?void 0:n.src)||t.icon)})),e.size===l.length)}),[l]);if(null==l||!l.length)return null;const c=a?_k:yk;return(0,s.createElement)(c,{className:"block-editor-block-variation-transforms",onSelectVariation:e=>{n(t,{...l.find((t=>{let{name:n}=t;return n===e})).attributes})},selectedValue:i,variations:l})},Ck=(0,d.createHigherOrderComponent)((e=>t=>{const n=To("color.palette"),o=!To("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"),Sk=Ck(p.ColorPalette);function wk(e){let{onChange:t,value:n,...o}=e;return(0,s.createElement)(nf,i({},o,{onColorChange:t,colorValue:n,gradients:[],disableCustomGradients:!0}))}const Bk=window.wp.date,Ik=new Date(2022,0,25);function xk(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,h.__)("Date format")),(0,s.createElement)(p.ToggleControl,{label:(0,s.createElement)(s.Fragment,null,(0,h.__)("Default format"),(0,s.createElement)("span",{className:"block-editor-date-format-picker__default-format-toggle-control__hint"},(0,Bk.dateI18n)(n,Ik))),checked:!t,onChange:e=>o(e?null:n)}),t&&(0,s.createElement)(Tk,{format:t,onChange:o}))}function Tk(e){var t;let{format:n,onChange:o}=e;const r=(0,u.uniq)(["Y-m-d",(0,h._x)("n/j/Y","short date format"),(0,h._x)("n/j/Y g:i A","short date format with time"),(0,h._x)("M j, Y","medium date format"),(0,h._x)("M j, Y g:i A","medium date format with time"),(0,h._x)("F j, Y","long date format"),(0,h._x)("M j","short date format without the year")]),l=r.map(((e,t)=>({key:`suggested-${t}`,name:(0,Bk.dateI18n)(e,Ik),format:e}))),i={key:"custom",name:(0,h.__)("Custom"),className:"block-editor-date-format-picker__custom-format-select-control__custom-option",__experimentalHint:(0,h.__)("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,h.__)("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,h.__)("Custom format"),hideLabelFromVision:!0,help:(0,s.createInterpolateElement)((0,h.__)("Enter a date or time <Link>format string</Link>."),{Link:(0,s.createElement)(p.ExternalLink,{href:(0,h.__)("https://wordpress.org/support/article/formatting-date-and-time/")})}),value:n,onChange:e=>o(e)}))}const Nk=["colors","disableCustomColors","gradients","disableCustomGradients"],Pk=e=>{let{className:t,colors:n,gradients:o,disableCustomColors:r,disableCustomGradients:l,children:i,settings:a,title:g,showTitle:h=!0,__experimentalHasMultipleOrigins:f,__experimentalIsRenderedInSidebar:v,enableAlpha:b}=e;const k=(0,d.useInstanceId)(Pk),{batch:_}=(0,m.useRegistry)();return(0,u.isEmpty)(n)&&(0,u.isEmpty)(o)&&r&&l&&(0,u.every)(a,(e=>(0,u.isEmpty)(e.colors)&&(0,u.isEmpty)(e.gradients)&&(void 0===e.disableCustomColors||e.disableCustomColors)&&(void 0===e.disableCustomGradients||e.disableCustomGradients)))?null:(0,s.createElement)(p.__experimentalToolsPanel,{className:c()("block-editor-panel-color-gradient-settings",t),label:h?g:void 0,resetAll:()=>{_((()=>{a.forEach((e=>{let{colorValue:t,gradientValue:n,onColorChange:o,onGradientChange:r}=e;t?o():n&&r()}))}))},panelId:k,__experimentalFirstVisibleItemClass:"first",__experimentalLastVisibleItemClass:"last"},(0,s.createElement)(sf,{settings:a,panelId:k,colors:n,gradients:o,disableCustomColors:r,disableCustomGradients:l,__experimentalHasMultipleOrigins:f,__experimentalIsRenderedInSidebar:v,enableAlpha:b}),!!i&&(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.__experimentalSpacer,{marginY:4})," ",i))},Lk=e=>{const t=Ph();return t.colors=To("color.palette"),t.gradients=To("color.gradients"),(0,s.createElement)(Pk,i({},t,e))},Mk=e=>{const t=Lh();return(0,s.createElement)(Pk,i({},t,e))},Rk=e=>(0,u.every)(Nk,(t=>e.hasOwnProperty(t)))?(0,s.createElement)(Pk,e):e.__experimentalHasMultipleOrigins?(0,s.createElement)(Mk,e):(0,s.createElement)(Lk,e);var Ak=function(e,t){return(Ak=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)},Dk=function(){return(Dk=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 Ok(e,t,n,o){void 0===o&&(o=0);var r=qk(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 Fk(e,t,n,o,r){void 0===r&&(r=0);var l=qk(t.width,t.height,r),i=l.width,s=l.height;return{x:zk(e.x,i,n.width,o),y:zk(e.y,s,n.height,o)}}function zk(e,t,n,o){var r=t*o/2-n/2;return Math.min(r,Math.max(e,-r))}function Vk(e,t){return Math.sqrt(Math.pow(e.y-t.y,2)+Math.pow(e.x-t.x,2))}function Hk(e,t){return 180*Math.atan2(t.y-e.y,t.x-e.x)/Math.PI}function Gk(e,t,n,o,r,l,i){void 0===l&&(l=0),void 0===i&&(i=!0);var s=i&&0===l?Uk:Wk,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:Dk(Dk({},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 Uk(e,t){return Math.min(e,Math.max(0,t))}function Wk(e,t){return t}function $k(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 jk(e,t){return{x:(t.x+e.x)/2,y:(t.y+e.y)/2}}function Kk(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 qk(e,t,n){var o=e/2,r=t/2,l=[Kk(0,0,o,r,n),Kk(e,0,o,r,n),Kk(e,t,o,r,n),Kk(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 Yk(){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()}const Zk=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=$k(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:Ok(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=Dk({},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?Fk(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?Fk(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=Gk(n.props.restrictPosition?Fk(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?Fk(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}Ak(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=Vk(n,o),this.lastPinchRotation=Hk(n,o),this.onDragStart(jk(n,o))},t.prototype.onPinchMove=function(e){var n=this,o=t.getTouchPoint(e.touches[0]),r=t.getTouchPoint(e.touches[1]),l=jk(o,r);this.onDrag(l),this.rafPinchTimeout&&window.cancelAnimationFrame(this.rafPinchTimeout),this.rafPinchTimeout=window.requestAnimationFrame((function(){var e=Vk(o,r),t=n.props.zoom*(e/n.lastPinchDistance);n.setNewZoom(t,l),n.lastPinchDistance=e;var i=Hk(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,g=p.cropAreaStyle,h=p.mediaStyle,f=t.classes,v=f.containerClassName,b=f.cropAreaClassName,k=f.mediaClassName;return di().createElement("div",{onMouseDown:this.onMouseDown,onTouchStart:this.onTouchStart,ref:function(t){return e.containerRef=t},"data-testid":"container",style:m,className:Yk("reactEasyCrop_Container",v)},n?di().createElement("img",Dk({alt:"",className:Yk("reactEasyCrop_Image",k)},r,{src:n,ref:function(t){return e.imageRef=t},style:Dk(Dk({},h),{transform:"translate("+i+"px, "+s+"px) rotate("+a+"deg) scale("+c+")"}),onLoad:this.onMediaLoad})):o&&di().createElement("video",Dk({autoPlay:!0,loop:!0,muted:!0,className:Yk("reactEasyCrop_Video",k)},r,{src:o,ref:function(t){return e.videoRef=t},onLoadedMetadata:this.onMediaLoad,style:Dk(Dk({},h),{transform:"translate("+i+"px, "+s+"px) rotate("+a+"deg) scale("+c+")"}),controls:!1})),this.state.cropSize&&di().createElement("div",{style:Dk(Dk({},g),{width:this.state.cropSize.width,height:this.state.cropSize.height}),"data-testid":"cropper",className:Yk("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}(di().Component),Qk={position:"bottom right",isAlternate:!0};const Xk=(0,s.createContext)({}),Jk=()=>(0,s.useContext)(Xk);function e_(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)(),[g,h]=(0,s.useState)(),[f,v]=(0,s.useState)(),[b,k]=(0,s.useState)(),_=(0,s.useCallback)((()=>{d({x:0,y:0}),m(100),h(0),v(n/o),k(n/o)}),[n,o,d,m,h,v,k]),y=(0,s.useCallback)((()=>{const e=(g+90)%360;let r=n/o;if(g%180==90&&(r=o/n),0===e)return i(),h(e),v(1/f),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)),h(e),v(1/f),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)}),[g,n,o,i,h,v,d]);return(0,s.useMemo)((()=>({editedUrl:r,setEditedUrl:i,crop:a,setCrop:c,position:u,setPosition:d,zoom:p,setZoom:m,rotation:g,setRotation:h,rotateClockwise:y,aspect:f,setAspect:v,defaultAspect:b,initializeTransformValues:_})),[r,i,a,c,u,d,p,m,g,h,y,f,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)(sp.store),[p,g]=(0,s.useState)(!1),f=(0,s.useCallback)((()=>{g(!1),u()}),[g,u]),v=(0,s.useCallback)((()=>{g(!0);let e={};(t.width<99.9||t.height<99.9)&&(e=t),n>0&&(e.rotation=n),e.src=i,kb()({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,h.sprintf)(
86
  /* translators: 1. Error message */
87
+ (0,h.__)("Could not edit image. %s"),(0,Bl.__unstableStripHTML)(e.message)),{id:"image-editing-error",type:"snackbar"})})).finally((()=>{g(!1),u()}))}),[g,t,n,o,r,l,i,c,d,g,u]);return(0,s.useMemo)((()=>({isInProgress:p,apply:v,cancel:f})),[p,v,f])}({id:t,url:n,onSaveImage:c,onFinishEditing:a,...d}),g=(0,s.useMemo)((()=>({...d,...p})),[d,p]);return(0,s.createElement)(Xk.Provider,{value:g},u)}function t_(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:g,setPosition:h,setCrop:f,setZoom:v,rotation:b}=Jk();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)(Zk,{image:u||t,disabled:a,minZoom:1,maxZoom:3,crop:d,zoom:m/100,aspect:g,onCropChange:h,onCropComplete:e=>{f(e)},onZoomChange:e=>{v(100*e)}}),a&&(0,s.createElement)(p.Spinner,null))}const n_=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.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 o_(){const{isInProgress:e,zoom:t,setZoom:n}=Jk();return(0,s.createElement)(p.Dropdown,{contentClassName:"wp-block-image__zoom",popoverProps:Qk,renderToggle:t=>{let{isOpen:n,onToggle:o}=t;return(0,s.createElement)(p.ToolbarButton,{icon:n_,label:(0,h.__)("Zoom"),onClick:o,"aria-expanded":n,disabled:e})},renderContent:()=>(0,s.createElement)(p.RangeControl,{label:(0,h.__)("Zoom"),min:100,max:300,value:Math.round(t),onChange:n})})}const r_=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.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 l_(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?Om:void 0},t)})))}function i_(e){let{toggleProps:t}=e;const{isInProgress:n,aspect:o,setAspect:r,defaultAspect:l}=Jk();return(0,s.createElement)(p.DropdownMenu,{icon:r_,label:(0,h.__)("Aspect Ratio"),popoverProps:Qk,toggleProps:t,className:"wp-block-image__aspect-ratio"},(e=>{let{onClose:t}=e;return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(l_,{isDisabled:n,onClick:e=>{r(e),t()},value:o,aspectRatios:[{title:(0,h.__)("Original"),aspect:l},{title:(0,h.__)("Square"),aspect:1}]}),(0,s.createElement)(l_,{label:(0,h.__)("Landscape"),isDisabled:n,onClick:e=>{r(e),t()},value:o,aspectRatios:[{title:(0,h.__)("16:10"),aspect:1.6},{title:(0,h.__)("16:9"),aspect:16/9},{title:(0,h.__)("4:3"),aspect:4/3},{title:(0,h.__)("3:2"),aspect:1.5}]}),(0,s.createElement)(l_,{label:(0,h.__)("Portrait"),isDisabled:n,onClick:e=>{r(e),t()},value:o,aspectRatios:[{title:(0,h.__)("10:16"),aspect:.625},{title:(0,h.__)("9:16"),aspect:9/16},{title:(0,h.__)("3:4"),aspect:3/4},{title:(0,h.__)("2:3"),aspect:2/3}]}))}))}const s_=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.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 a_(){const{isInProgress:e,rotateClockwise:t}=Jk();return(0,s.createElement)(p.ToolbarButton,{icon:s_,label:(0,h.__)("Rotate"),onClick:t,disabled:e})}function c_(){const{isInProgress:e,apply:t,cancel:n}=Jk();return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.ToolbarButton,{onClick:t,disabled:e},(0,h.__)("Apply")),(0,s.createElement)(p.ToolbarButton,{onClick:n},(0,h.__)("Cancel")))}function u_(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)(t_,{url:t,width:n,height:o,clientWidth:r,naturalHeight:l,naturalWidth:i}),(0,s.createElement)(po,null,(0,s.createElement)(p.ToolbarGroup,null,(0,s.createElement)(o_,null),(0,s.createElement)(p.ToolbarItem,null,(e=>(0,s.createElement)(i_,{toggleProps:e}))),(0,s.createElement)(a_,null)),(0,s.createElement)(p.ToolbarGroup,null,(0,s.createElement)(c_,null))))}const d_=[25,50,75,100],p_=()=>{};function m_(e){let{imageWidth:t,imageHeight:n,imageSizeOptions:o=[],isResizable:r=!0,slug:l,width:i,height:a,onChange:c,onChangeImage:d=p_}=e;const{currentHeight:m,currentWidth:g,updateDimension:f,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,h.__)("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,h.__)("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,h.__)("Width"),value:g,min:1,onChange:e=>f("width",e)}),(0,s.createElement)(p.TextControl,{type:"number",className:"block-editor-image-size-control__height",label:(0,h.__)("Height"),value:m,min:1,onChange:e=>f("height",e)})),(0,s.createElement)("div",{className:"block-editor-image-size-control__row"},(0,s.createElement)(p.ButtonGroup,{"aria-label":(0,h.__)("Image size presets")},d_.map((e=>{const o=Math.round(t*(e/100)),r=Math.round(n*(e/100)),l=g===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,h.__)("Reset")))))}const g_=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"-2 -2 24 24"},(0,s.createElement)(D.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"})),h_=()=>{},f_=e=>{let{value:t,onChange:n=h_,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,h.__)("Currently selected link settings")),l)};var v_=n(5425),b_=n.n(v_);function k_(e){return"function"==typeof e}class y_ 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,b_()(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,Ap.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,h.sprintf)(
88
  /* translators: %s: number of results. */
89
+ (0,h._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,h.__)("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 $c.UP:0!==e.target.selectionStart&&(e.preventDefault(),e.target.setSelectionRange(0,0));break;case $c.DOWN:this.props.value.length!==e.target.selectionStart&&(e.preventDefault(),e.target.setSelectionRange(this.props.value.length,this.props.value.length));break;case $c.ENTER:e.preventDefault(),this.props.onSubmit&&this.props.onSubmit(null,e)}return}const l=this.state.suggestions[this.state.selectedSuggestion];switch(e.keyCode){case $c.UP:{e.preventDefault();const t=n?n-1:o.length-1;this.setState({selectedSuggestion:t});break}case $c.DOWN:{e.preventDefault();const t=null===n||n===o.length-1?0:n+1;this.setState({selectedSuggestion:t});break}case $c.TAB:null!==this.state.selectedSuggestion&&(this.selectLink(l),this.props.speak((0,h.__)("Link selected.")));break;case $c.ENTER:e.preventDefault(),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=null,className:t,isFullWidth:n,instanceId:o,placeholder:r=(0,h.__)("Paste URL or type to search"),__experimentalRenderControl:l,value:i=""}=this.props,{loading:a,showSuggestions:u,selectedSuggestion:d,suggestionsListboxId:m,suggestionOptionIdPrefix:g}=this.state,f=`url-input-control-${o}`,v={id:f,label:e,className:c()("block-editor-url-input",t,{"is-full-width":n})},b={id:f,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":e?void 0:(0,h.__)("URL"),"aria-expanded":u,"aria-autocomplete":"list","aria-owns":m,"aria-activedescendant":null!==d?`${g}-${d}`:void 0,ref:this.inputRef};return l?l(v,b,a):(0,s.createElement)(p.BaseControl,v,(0,s.createElement)("input",b),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:u,suggestionOptionIdPrefix:d,loading:m}=this.state,g={id:u,ref:this.autocompleteRef,role:"listbox"},h=(e,t)=>({role:"option",tabIndex:"-1",id:`${d}-${t}`,ref:this.bindSuggestionNode(t),"aria-selected":t===a});return k_(t)&&r&&l.length?t({suggestions:l,selectedSuggestion:a,suggestionsListProps:g,buildSuggestionItemProps:h,isLoading:m,handleSuggestionClick:this.handleOnClick,isInitialSuggestions:o&&!(n&&n.length)}):!k_(t)&&r&&l.length?(0,s.createElement)(p.Popover,{position:"bottom",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}}const E_=(0,d.compose)(d.withSafeTimeout,p.withSpokenMessages,d.withInstanceId,(0,m.withSelect)(((e,t)=>{if(k_(t.__experimentalFetchLinkSuggestions))return;const{getSettings:n}=e(to);return{__experimentalFetchLinkSuggestions:n().__experimentalFetchLinkSuggestions}})))(y_),C_=e=>{let t,{searchTerm:n,onClick:o,itemProps:r,isSelected:l,buttonText:a}=e;return n?(t=a?"function"==typeof a?a(n):a:(0,s.createInterpolateElement)((0,h.sprintf)(
90
  /* translators: %s: search term. */
91
+ (0,h.__)("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)(Rr,{className:"block-editor-link-control__search-item-icon",icon:nu}),(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},S_=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.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"})),w_=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)(Rr,{className:"block-editor-link-control__search-item-icon",icon:S_}),(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,Ap.filterURLForDisplay)((0,Ap.safeDecodeURI)(n.url))||""),l&&(0,h.__)("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)))},B_="__CREATE__",I_="mailto",x_="internal",T_=["URL",I_,"tel",x_],N_=[{id:"opensInNewTab",title:(0,h.__)("Open in new tab")}];function P_(e){let{instanceId:t,withCreateSuggestion:n,currentInputValue:o,handleSuggestionClick:r,suggestionsListProps:l,buildSuggestionItemProps:a,suggestions:u,selectedSuggestion:d,isLoading:m,isInitialSuggestions:g,createSuggestionButtonText:f,suggestionsQuery:v}=e;const b=c()("block-editor-link-control__search-results",{"is-loading":m}),k=1===u.length&&T_.includes(u[0].type),_=n&&!k&&!g,y=!(null!=v&&v.type),E=`block-editor-link-control-search-results-label-${t}`,C=g?(0,h.__)("Recently updated"):(0,h.sprintf)(
92
  /* translators: %s: search term. */
93
+ (0,h.__)('Search results for "%s"'),o),S=(0,s.createElement)(g?s.Fragment:p.VisuallyHidden,{},(0,s.createElement)("span",{className:"block-editor-link-control__search-results-label",id:E},C));return(0,s.createElement)("div",{className:"block-editor-link-control__search-results-wrapper"},S,(0,s.createElement)("div",i({},l,{className:b,"aria-labelledby":E}),u.map(((e,t)=>_&&B_===e.type?(0,s.createElement)(C_,{searchTerm:o,buttonText:f,onClick:()=>r(e),key:e.type,itemProps:a(e,t),isSelected:t===d}):B_===e.type?null:(0,s.createElement)(w_,{key:`${e.id}-${e.type}`,itemProps:a(e,t),suggestion:e,index:t,onClick:()=>{r(e)},isSelected:t===d,isURL:T_.includes(e.type),searchTerm:o,shouldShowType:y,isFrontPage:null==e?void 0:e.isFrontPage})))))}function L_(e){const t=(0,u.startsWith)(e,"#");return(0,Ap.isURL)(e)||e&&e.includes("www.")||t}const M_=()=>Promise.resolve([]),R_=e=>{let t="URL";const n=(0,Ap.getProtocol)(e)||"";return n.includes("mailto")&&(t=I_),n.includes("tel")&&(t="tel"),(0,u.startsWith)(e,"#")&&(t=x_),Promise.resolve([{id:e,title:e,url:"URL"===t?(0,Ap.prependHTTP)(e):e,type:t}])};const A_=()=>Promise.resolve([]),D_=()=>{},O_=(0,s.forwardRef)(((e,t)=>{let{value:n,children:o,currentLink:r={},className:l=null,placeholder:i=null,withCreateSuggestion:a=!1,onCreateSuggestion:p=D_,onChange:g=D_,onSelect:f=D_,showSuggestions:v=!0,renderSuggestions:b=(e=>(0,s.createElement)(P_,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(to);return{pageOnFront:t().pageOnFront,fetchSearchSuggestions:t().__experimentalFetchLinkSuggestions}}),[]),i=t?R_:M_;return(0,s.useCallback)(((t,s)=>{let{isInitialSuggestions:a}=s;return L_(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||L_(e)||!r?c:c.concat({title:e,url:e,type:B_})})(t,{...e,isInitialSuggestions:a},r,i,n,o,l)}),[i,r,n])}(E,_,a,C),I=v?k||B:A_,x=(0,d.useInstanceId)(O_),[T,N]=(0,s.useState)(),P=async e=>{let t=e;if(B_!==e.type)(_||t&&Object.keys(t).length>=1)&&f({...(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&&f(t)}catch(e){}},L=c()(l,{"has-no-label":!w});return(0,s.createElement)("div",{className:"block-editor-link-control__search-input-container"},(0,s.createElement)(E_,{label:w?"URL":void 0,className:L,value:n,onChange:(e,t)=>{g(e),N(t)},placeholder:null!=i?i:(0,h.__)("Search or type url"),__experimentalRenderSuggestions:v?e=>b({...e,instanceId:x,withCreateSuggestion:a,currentInputValue:n,createSuggestionButtonText:S,suggestionsQuery:E,handleSuggestionClick:t=>{e.handleSuggestionClick&&e.handleSuggestionClick(t),P(t)}}):null,__experimentalFetchLinkSuggestions:I,__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?P(r||{url:n}):t.preventDefault()},ref:t}),o)})),F_=O_,z_=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.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"})),V_=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.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"})),{Slot:H_,Fill:G_}=(0,p.createSlotFill)("BlockEditorLinkControlViewer");function U_(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 W_(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)(U_,{richData:null,isFetching:!1}),{fetchRichUrlData:o}=(0,m.useSelect)((e=>{const{getSettings:t}=e(to);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),g=u&&Object.keys(u).length,f=n&&(0,Ap.filterURLForDisplay)((0,Ap.safeDecodeURI)(n.url),16)||"",v=(null==u?void 0:u.title)||(null==n?void 0:n.title)||f,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)(Rr,{icon:z_,size:32}):(0,s.createElement)(Rr,{icon:S_}),(0,s.createElement)("div",{"aria-label":(0,h.__)("Currently selected"),"aria-selected":"true",className:c()("block-editor-link-control__search-item",{"is-current":!0,"is-rich":g,"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,h.__)("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,Bl.__unstableStripHTML)(v)),(null==n?void 0:n.url)&&(0,s.createElement)("span",{className:"block-editor-link-control__search-item-info"},f)))),(0,s.createElement)(p.Button,{icon:V_,label:(0,h.__)("Edit"),className:"block-editor-link-control__search-item-action",onClick:o,iconSize:24}),l&&(0,s.createElement)(p.Button,{icon:Eh,label:(0,h.__)("Unlink"),className:"block-editor-link-control__search-item-action block-editor-link-control__unlink",onClick:i,iconSize:24}),(0,s.createElement)(H_,{fillProps:n})),(g&&((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))))}const $_=()=>{};function j_(e){var t,n,o;let{searchInputPlaceholder:r,value:l,settings:i=N_,onChange:a=$_,onRemove:u,noDirectEntry:d=!1,showSuggestions:m=!0,showInitialSuggestions:g,forceIsEditingLink:f,createSuggestion:v,withCreateSuggestion:b,inputValue:k="",suggestionsQuery:_={},noURLSuggestion:y=!1,createSuggestionButtonText:E,hasRichPreviews:C=!1,hasTextControl:S=!1,renderControlBottom:w=null}=e;void 0===b&&v&&(b=!0);const B=(0,s.useRef)(!0),I=(0,s.useRef)(),x=(0,s.useRef)(),[T,N]=(0,s.useState)((null==l?void 0:l.url)||""),[P,L]=(0,s.useState)((null==l?void 0:l.title)||""),M=k||T,[R,A]=(0,s.useState)(void 0!==f?f:!l||!l.url),D=(0,s.useRef)(!1),O=!(null!=M&&null!==(t=M.trim())&&void 0!==t&&t.length),{createPage:F,isCreatingPage:z,errorMessage:V}=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,h.__)("An unknown error occurred during creation. Please try again.")),e}finally{o(!1)}},isCreatingPage:n,errorMessage:r}}(v);function H(){var e;D.current=!(null===(e=I.current)||void 0===e||!e.contains(I.current.ownerDocument.activeElement)),A(!1)}(0,s.useEffect)((()=>{void 0!==f&&f!==R&&A(f)}),[f]),(0,s.useEffect)((()=>{if(B.current)return void(B.current=!1);const e=null!=x&&x.current?1:0;(Bl.focus.focusable.find(I.current)[e]||I.current).focus(),D.current=!1}),[R,z]),(0,s.useEffect)((()=>{null!=l&&l.title&&l.title!==P&&L(l.title),null!=l&&l.url&&N(l.url)}),[l]);const G=()=>{M===(null==l?void 0:l.url)&&P===(null==l?void 0:l.title)||a({...l,url:M,title:P}),H()},U=u&&l&&!R&&!z,W=!(null==i||!i.length),$=(null==l||null===(n=l.url)||void 0===n||null===(o=n.trim())||void 0===o?void 0:o.length)>0&&S;return(0,s.createElement)("div",{tabIndex:-1,ref:I,className:"block-editor-link-control"},z&&(0,s.createElement)("div",{className:"block-editor-link-control__loading"},(0,s.createElement)(p.Spinner,null)," ",(0,h.__)("Creating"),"…"),(R||!l)&&!z&&(0,s.createElement)(s.Fragment,null,(0,s.createElement)("div",{className:c()({"block-editor-link-control__search-input-wrapper":!0,"has-text-control":$})},$&&(0,s.createElement)(p.TextControl,{ref:x,className:"block-editor-link-control__field block-editor-link-control__text-content",label:"Text",value:P,onChange:L,onKeyDown:e=>{const{keyCode:t}=e;t!==$c.ENTER||O||(e.preventDefault(),G())}}),(0,s.createElement)(F_,{currentLink:l,className:"block-editor-link-control__field block-editor-link-control__search-input",placeholder:r,value:M,withCreateSuggestion:b,onCreateSuggestion:F,onChange:N,onSelect:e=>{a({...e,title:P||(null==e?void 0:e.title)}),H()},showInitialSuggestions:g,allowDirectEntry:!d,showSuggestions:m,suggestionsQuery:_,withURLSuggestion:!y,createSuggestionButtonText:E,useLabel:$},(0,s.createElement)("div",{className:"block-editor-link-control__search-actions"},(0,s.createElement)(p.Button,{onClick:G,label:(0,h.__)("Submit"),icon:g_,className:"block-editor-link-control__search-submit",disabled:O})))),V&&(0,s.createElement)(p.Notice,{className:"block-editor-link-control__search-error",status:"error",isDismissible:!1},V)),l&&!R&&!z&&(0,s.createElement)(W_,{key:null==l?void 0:l.url,value:l,onEditClick:()=>A(!0),hasRichPreviews:C,hasUnlinkControl:U,onRemove:u}),W&&(0,s.createElement)("div",{className:"block-editor-link-control__tools"},(0,s.createElement)(f_,{value:l,settings:i,onChange:a})),w&&w())}j_.ViewerFill=G_;const K_=j_,q_=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.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"})),Y_=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.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"})),Z_=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M19 3H5c-.6 0-1 .4-1 1v7c0 .5.4 1 1 1h14c.5 0 1-.4 1-1V4c0-.6-.4-1-1-1zM5.5 10.5v-.4l1.8-1.3 1.3.8c.3.2.7.2.9-.1L11 8.1l2.4 2.4H5.5zm13 0h-2.9l-4-4c-.3-.3-.8-.3-1.1 0L8.9 8l-1.2-.8c-.3-.2-.6-.2-.9 0l-1.3 1V4.5h13v6zM4 20h9v-1.5H4V20zm0-4h16v-1.5H4V16z"})),Q_=(0,p.withFilters)("editor.MediaUpload")((()=>null)),X_=function(e){let{fallback:t=null,children:n}=e;return(0,m.useSelect)((e=>{const{getSettings:t}=e(to);return!!t().mediaUpload}),[])?n:t},J_=()=>{};let ey=0;const ty=(0,d.compose)([(0,m.withDispatch)((e=>{const{createNotice:t,removeNotice:n}=e(sp.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,onToggleFeaturedImage:u,useFeaturedImage:d,onFilesUpload:g=J_,name:f=(0,h.__)("Replace"),createNotice:v,removeNotice:b,children:k,multiple:_=!1,addToGallery:y,handleUpload:E=!0}=e;const C=(0,m.useSelect)((e=>e(to).getSettings().mediaUpload),[]),S=(0,s.useRef)(),w="block-editor/media-replace-flow/error-notice/"+ ++ey,B=e=>{const t=(0,Bl.__unstableStripHTML)(e);i?i(t):setTimeout((()=>{v("error",t,{speak:!0,id:w,isDismissible:!0})}),1e3)},I=(e,t)=>{d&&u&&u(),t(),a(e),(0,Gt.speak)((0,h.__)("The media file has been replaced")),b(w)},x=e=>{e.keyCode===$c.DOWN&&(e.preventDefault(),e.target.click())},T=_&&!(!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:S,"aria-expanded":t,"aria-haspopup":"true",onClick:n,onKeyDown:x},f)},renderContent:e=>{let{onClose:i}=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)(s.Fragment,null,(0,s.createElement)(Q_,{gallery:T,addToGallery:y,multiple:_,value:_?o:n,onSelect:e=>I(e,i),allowedTypes:r,render:e=>{let{open:t}=e;return(0,s.createElement)(p.MenuItem,{icon:q_,onClick:t},(0,h.__)("Open Media Library"))}}),(0,s.createElement)(X_,null,(0,s.createElement)(p.FormFileUpload,{onChange:e=>{((e,t)=>{const n=e.target.files;if(!E)return t(),a(n);g(n),C({allowedTypes:r,filesList:n,onFileChange:e=>{let[n]=e;I(n,t)},onError:B})})(e,i)},accept:l,multiple:_,render:e=>{let{openFileDialog:t}=e;return(0,s.createElement)(p.MenuItem,{icon:Y_,onClick:()=>{t()}},(0,h.__)("Upload"))}}))),u&&(0,s.createElement)(p.MenuItem,{icon:Z_,onClick:u,isPressed:d},(0,h.__)("Use featured image")),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,h.__)("Current media URL:")),(0,s.createElement)(p.Tooltip,{text:t,position:"bottom"},(0,s.createElement)("div",null,(0,s.createElement)(K_,{value:{url:t},settings:[],showSuggestions:!1,onChange:e=>{let{url:t}=e;c(t),S.current.focus()}})))))}})}));function ny(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,Ap.filterURLForDisplay)((0,Ap.safeDecodeURI)(t))):(0,s.createElement)("span",{className:r})}function oy(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,__unstableShift:!0},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:_m,label:(0,h.__)("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))}oy.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)(E_,{value:r,onChange:o,autocompleteRef:t}),(0,s.createElement)(p.Button,{icon:g_,label:(0,h.__)("Apply"),type:"submit"}))},oy.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)(ny,{url:r,urlLabel:l,className:n}),o&&(0,s.createElement)(p.Button,{icon:V_,label:(0,h.__)("Edit"),onClick:o}))};const ry=oy,ly=()=>{},iy=e=>{let{src:t,onChange:n,onSubmit:o,onClose:r}=e;return(0,s.createElement)(ry,{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,h.__)("URL"),placeholder:(0,h.__)("Paste or type URL"),onChange:n,value:t}),(0,s.createElement)(p.Button,{className:"block-editor-media-placeholder__url-input-submit-button",icon:g_,label:(0,h.__)("Apply"),type:"submit"})))},sy=(0,p.withFilters)("editor.MediaPlaceholder")((function(e){let{value:t={},allowedTypes:n,className:o,icon:r,labels:l={},mediaPreview:i,notices:a,isAppender:u,accept:d,addToGallery:g,multiple:f=!1,handleUpload:v=!0,disableDropZone:b,disableMediaButtons:k,onError:_,onSelect:y,onCancel:E,onSelectURL:C,onToggleFeaturedImage:S,onDoubleClick:w,onFilesPreUpload:B=ly,onHTMLDrop:I=ly,children:x,mediaLibraryButton:T,placeholder:N,style:P}=e;const L=(0,m.useSelect)((e=>{const{getSettings:t}=e(to);return t().mediaUpload}),[]),[M,R]=(0,s.useState)(""),[A,D]=(0,s.useState)(!1);(0,s.useEffect)((()=>{var e;R(null!==(e=null==t?void 0:t.src)&&void 0!==e?e:"")}),[null==t?void 0:t.src]);const O=e=>{R(e.target.value)},F=()=>{D(!0)},z=()=>{D(!1)},V=e=>{e.preventDefault(),M&&C&&(C(M),z())},H=e=>{if(!v)return y(e);let o;if(B(e),f)if(g){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)}))));y(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=y;else o=e=>{let[t]=e;return y(t)};L({allowedTypes:n,filesList:e,onFileChange:o,onError:_})},G=e=>{H(e.target.files)},U=null!=N?N:e=>{let{instructions:t,title:d}=l;if(L||C||(t=(0,h.__)("To edit this block, you need permission to upload media.")),void 0===t||void 0===d){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&&L&&(t=(0,h.__)("Upload a media file or pick one from your media library."),l?t=(0,h.__)("Upload an audio file, pick one from your media library, or add one with a URL."):i?t=(0,h.__)("Upload an image file, pick one from your media library, or add one with a URL."):s&&(t=(0,h.__)("Upload a video file, pick one from your media library, or add one with a URL."))),void 0===d&&(d=(0,h.__)("Media"),l?d=(0,h.__)("Audio"):i?d=(0,h.__)("Image"):s&&(d=(0,h.__)("Video")))}const m=c()("block-editor-media-placeholder",o,{"is-appender":u});return(0,s.createElement)(p.Placeholder,{icon:r,label:d,instructions:t,className:m,notices:a,onDoubleClick:w,preview:i,style:P},e,x)},W=()=>b?null:(0,s.createElement)(p.DropZone,{onFilesDrop:H,onHTMLDrop:I}),$=()=>E&&(0,s.createElement)(p.Button,{className:"block-editor-media-placeholder__cancel-button",title:(0,h.__)("Cancel"),variant:"link",onClick:E},(0,h.__)("Cancel")),j=()=>C&&(0,s.createElement)("div",{className:"block-editor-media-placeholder__url-input-container"},(0,s.createElement)(p.Button,{className:"block-editor-media-placeholder__button",onClick:F,isPressed:A,variant:"tertiary"},(0,h.__)("Insert from URL")),A&&(0,s.createElement)(iy,{src:M,onChange:O,onSubmit:V,onClose:z})),K=()=>S&&(0,s.createElement)("div",{className:"block-editor-media-placeholder__url-input-container"},(0,s.createElement)(p.Button,{className:"block-editor-media-placeholder__button",onClick:S,variant:"tertiary"},(0,h.__)("Use featured image")));return k?(0,s.createElement)(X_,null,W()):(0,s.createElement)(X_,{fallback:U(j())},(()=>{const e=null!=T?T:e=>{let{open:t}=e;return(0,s.createElement)(p.Button,{variant:"tertiary",onClick:()=>{t()}},(0,h.__)("Media Library"))},o=(0,s.createElement)(Q_,{addToGallery:g,gallery:f&&!(!n||0===n.length)&&n.every((e=>"image"===e||e.startsWith("image/"))),multiple:f,onSelect:y,allowedTypes:n,mode:"browse",value:Array.isArray(t)?t.map((e=>{let{id:t}=e;return t})):t.id,render:e});if(L&&u)return(0,s.createElement)(s.Fragment,null,W(),(0,s.createElement)(p.FormFileUpload,{onChange:G,accept:d,multiple:f,render:e=>{let{openFileDialog:t}=e;const n=(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.Button,{variant:"primary",className:c()("block-editor-media-placeholder__button","block-editor-media-placeholder__upload-button"),onClick:t},(0,h.__)("Upload")),o,j(),K(),$());return U(n)}}));if(L){const e=(0,s.createElement)(s.Fragment,null,W(),(0,s.createElement)(p.FormFileUpload,{variant:"primary",className:c()("block-editor-media-placeholder__button","block-editor-media-placeholder__upload-button"),onChange:G,accept:d,multiple:f},(0,h.__)("Upload")),o,j(),K(),$());return U(e)}return U(o)})())})),ay=e=>{let{colorSettings:t,...n}=e;const o=t.map((e=>{if(!e)return e;const{value:t,onChange:n,...o}=e;return{...o,colorValue:t,onColorChange:n}}));return(0,s.createElement)(Rk,i({settings:o,gradients:[],disableCustomGradients:!0},n))},cy={position:"bottom right",isAlternate:!0},uy=()=>(0,s.createElement)(s.Fragment,null,["bold","italic","link"].map((e=>(0,s.createElement)(p.Slot,{name:`RichText.ToolbarControls.${e}`,key:e}))),(0,s.createElement)(p.Slot,{name:"RichText.ToolbarControls"},(e=>{if(!e.length)return null;const t=e.map((e=>{let[{props:t}]=e;return t})).some((e=>{let{isActive:t}=e;return t}));return(0,s.createElement)(p.ToolbarItem,null,(n=>(0,s.createElement)(p.DropdownMenu,{icon:_m
94
+ /* translators: button label text should, if possible, be under 16 characters. */,label:(0,h.__)("More"),toggleProps:{...n,className:c()(n.className,{"is-pressed":t}),describedBy:(0,h.__)("Displays more block tools")},controls:(0,u.orderBy)(e.map((e=>{let[{props:t}]=e;return t})),"title"),popoverProps:cy})))}))),dy=e=>{let{inline:t,anchorRef:n}=e;return t?(0,s.createElement)(p.Popover,{position:"top center",focusOnMount:!1,anchorRef:n,className:"block-editor-rich-text__inline-format-toolbar",__unstableSlotName:"block-toolbar"},(0,s.createElement)("div",{className:"block-editor-rich-text__inline-format-toolbar-group"},(0,s.createElement)(p.ToolbarGroup,null,(0,s.createElement)(uy,null)))):(0,s.createElement)(po,{group:"inline"},(0,s.createElement)(uy,null))};function py(){const{didAutomaticChange:e,getSettings:t}=(0,m.useSelect)(to);return(0,d.useRefEffect)((n=>{function o(n){const{keyCode:o}=n;n.defaultPrevented||o!==$c.DELETE&&o!==$c.BACKSPACE&&o!==$c.ESCAPE||e()&&(n.preventDefault(),t().__experimentalUndo())}return n.addEventListener("keydown",o),()=>{n.removeEventListener("keydown",o)}}),[])}function my(e){return e.filter((e=>{let{type:t}=e;return/^image\/(?:jpe?g|png|gif|webp)$/.test(t)})).map((e=>`<img src="${(0,rg.createBlobURL)(e)}">`)).join("")}const gy=window.wp.shortcode;function hy(e,t){if(null!=t&&t.length){let n=e.formats.length;for(;n--;)e.formats[n]=[...t,...e.formats[n]||[]]}}function fy(e){if(!0===e||"p"===e||"li"===e)return!0===e?"p":e}function vy(e){let{allowedFormats:t,formattingControls:n,disableFormats:o}=e;return o?vy.EMPTY_ARRAY:t||n?t||(V()("wp.blockEditor.RichText formattingControls prop",{since:"5.4",alternative:"allowedFormats",version:"6.2"}),n.map((e=>`core/${e}`))):void 0}function by(e){let{value:t,pastedBlocks:n=[],onReplace:o,onSplit:r,onSplitMiddle:l,multilineTag:i}=e;if(!o||!r)return;const{start:s=0,end:a=0}=t,c={...t,start:s,end:a},u=[],[d,p]=(0,F.split)(c),m=n.length>0;let g=-1;const h=(0,F.isEmpty)(d)&&!(0,F.isEmpty)(p);m&&(0,F.isEmpty)(d)||(u.push(r((0,F.toHTMLString)({value:d,multilineTag:i}),!h)),g+=1),m?(u.push(...n),g+=n.length):l&&u.push(l()),(m||l)&&(0,F.isEmpty)(p)||u.push(r((0,F.toHTMLString)({value:p,multilineTag:i}),h)),o(u,m?g:1,m?-1:0)}function ky(e,t){return t?(0,F.replace)(e,/\n+/g,F.__UNSTABLE_LINE_SEPARATOR):(0,F.replace)(e,new RegExp(F.__UNSTABLE_LINE_SEPARATOR,"g"),"\n")}function _y(e){const t=(0,s.useRef)(e);return t.current=e,(0,d.useRefEffect)((e=>{function n(e){const{isSelected:n,disableFormats:o,onChange:l,value:i,formatTypes:s,tagName:a,onReplace:c,onSplit:u,onSplitMiddle:d,__unstableEmbedURLOnPaste:p,multilineTag:m,preserveWhiteSpace:g,pastePlainText:h}=t.current;if(!n)return;const{clipboardData:f}=e;let v="",b="";try{v=f.getData("text/plain"),b=f.getData("text/html")}catch(e){try{b=f.getData("Text")}catch(e){return}}if(b=function(e){const t="\x3c!--StartFragment--\x3e",n=e.indexOf(t);if(!(n>-1))return e;const o=(e=e.substring(n+t.length)).indexOf("\x3c!--EndFragment--\x3e");return o>-1&&(e=e.substring(0,o)),e}(b),b=function(e){const t="<meta charset='utf-8'>";return e.startsWith(t)?e.slice(t.length):e}(b),e.preventDefault(),window.console.log("Received HTML:\n\n",b),window.console.log("Received plain text:\n\n",v),o)return void l((0,F.insert)(i,v));const k=s.reduce(((e,t)=>{let{__unstablePasteRule:n}=t;return n&&e===i&&(e=n(i,{html:b,plainText:v})),e}),i);if(k!==i)return void l(k);const _=[...(0,Bl.getFilesFromDataTransfer)(f)];if("true"===f.getData("rich-text")){const e=f.getData("rich-text-multi-line-tag")||void 0;let t=(0,F.create)({html:b,multilineTag:e,multilineWrapperTags:"li"===e?["ul","ol"]:void 0,preserveWhiteSpace:g});return t=ky(t,!!m),hy(t,i.activeFormats),void l((0,F.insert)(i,t))}if(h)return void l((0,F.insert)(i,(0,F.create)({text:v})));if(null!=_&&_.length&&!lg(_,b)){const e=(0,r.pasteHandler)({HTML:my(_),mode:"BLOCKS",tagName:a,preserveWhiteSpace:g});return window.console.log("Received items:\n\n",_),void(c&&(0,F.isEmpty)(i)?c(e):by({value:i,pastedBlocks:e,onReplace:c,onSplit:u,onSplitMiddle:d,multilineTag:m}))}let y=c&&u?"AUTO":"INLINE";var E;"AUTO"===y&&(0,F.isEmpty)(i)&&(E=v,(0,gy.regexp)(".*").test(E))&&(y="BLOCKS"),p&&(0,F.isEmpty)(i)&&(0,Ap.isURL)(v.trim())&&(y="BLOCKS");const C=(0,r.pasteHandler)({HTML:b,plainText:v,mode:y,tagName:a,preserveWhiteSpace:g});if("string"==typeof C){let e=(0,F.create)({html:C});e=ky(e,!!m),hy(e,i.activeFormats),l((0,F.insert)(i,e))}else C.length>0&&(c&&(0,F.isEmpty)(i)?c(C,C.length-1,-1):by({value:i,pastedBlocks:C,onReplace:c,onSplit:u,onSplitMiddle:d,multilineTag:m}))}return e.addEventListener("paste",n),()=>{e.removeEventListener("paste",n)}}),[])}function yy(e){let t=e.length;for(;t--;){const n=Wt(e[t].attributes);if(n)return e[t].attributes[n]=e[t].attributes[n].replace(Ut,""),e[t].clientId;const o=yy(e[t].innerBlocks);if(o)return o}}function Ey(e){const{__unstableMarkLastChangeAsPersistent:t,__unstableMarkAutomaticChange:n}=(0,m.useDispatch)(to),o=(0,s.useRef)(e);return o.current=e,(0,d.useRefEffect)((e=>{function l(){const{value:e,onReplace:t,selectionChange:l}=o.current;if(!t)return;const{start:i,text:s}=e;if(" "!==s.slice(i-1,i))return;const a=s.slice(0,i).trim(),c=(0,r.getBlockTransforms)("from").filter((e=>{let{type:t}=e;return"prefix"===t})),u=(0,r.findTransform)(c,(e=>{let{prefix:t}=e;return a===t}));if(!u)return;const d=(0,F.toHTMLString)({value:(0,F.insert)(e,Ut,0,i)}),p=u.transform(d);l(yy([p])),t([p]),n()}function i(e){const{inputType:r,type:i}=e,{value:s,onChange:a,__unstableAllowPrefixTransformations:c,formatTypes:u}=o.current;if("insertText"!==r&&"compositionend"!==i)return;c&&l&&l();const d=u.reduce(((e,t)=>{let{__unstableInputRule:n}=t;return n&&(e=n(e)),e}),function(e){const t="tales of gutenberg",{start:n,text:o}=e;return n<t.length||o.slice(n-t.length,n).toLowerCase()!==t?e:(0,F.insert)(e," 🐡🐢🦀🐤🦋🐘🐧🐹🦁🦄🦍🐼🐿🎃🐴🐝🐆🦕🦔🌱🍇π🍌🐉💧🥨🌌🍂🍠🥦🥚🥝🎟🥥🥒🛵🥖🍒🍯🎾🎲🐺🐚🐮⌛️")}(s));d!==s&&(t(),a({...d,activeFormats:s.activeFormats}),n())}return e.addEventListener("input",i),e.addEventListener("compositionend",i),()=>{e.removeEventListener("input",i),e.removeEventListener("compositionend",i)}}),[])}function Cy(e){const{__unstableMarkAutomaticChange:t}=(0,m.useDispatch)(to),n=(0,s.useRef)(e);return n.current=e,(0,d.useRefEffect)((e=>{function o(e){if(e.defaultPrevented)return;const{removeEditorOnlyFormats:o,value:l,onReplace:i,onSplit:s,onSplitMiddle:a,multilineTag:c,onChange:u,disableLineBreaks:d,onSplitAtEnd:p}=n.current;if(e.keyCode!==$c.ENTER)return;e.preventDefault();const m={...l};m.formats=o(l);const g=i&&s;if(i){const e=(0,r.getBlockTransforms)("from").filter((e=>{let{type:t}=e;return"enter"===t})),n=(0,r.findTransform)(e,(e=>e.regExp.test(m.text)));n&&(i([n.transform({content:m.text})]),t())}if(c)e.shiftKey?d||u((0,F.insert)(m,"\n")):g&&(0,F.__unstableIsEmptyLine)(m)?by({value:m,onReplace:i,onSplit:s,onSplitMiddle:a,multilineTag:c}):u((0,F.__unstableInsertLineSeparator)(m));else{const{text:t,start:n,end:o}=m,r=p&&n===o&&o===t.length;e.shiftKey||!g&&!r?d||u((0,F.insert)(m,"\n")):!g&&r?p():g&&by({value:m,onReplace:i,onSplit:s,onSplitMiddle:a,multilineTag:c})}}return e.addEventListener("keydown",o),()=>{e.removeEventListener("keydown",o)}}),[])}function Sy(e){return e(F.store).getFormatTypes()}vy.EMPTY_ARRAY=[];const wy=new Set(["a","audio","button","details","embed","iframe","input","label","select","textarea","video"]);function By(e){return(0,d.useRefEffect)((t=>{function n(t){for(const n of e.current)n(t)}return t.addEventListener("keydown",n),()=>{t.removeEventListener("keydown",n)}}),[])}function Iy(e){return(0,d.useRefEffect)((t=>{function n(t){for(const n of e.current)n(t)}return t.addEventListener("input",n),()=>{t.removeEventListener("input",n)}}),[])}function xy(){const{isMultiSelecting:e}=(0,m.useSelect)(to);return(0,d.useRefEffect)((t=>{function n(){if(!e())return;const n=t.parentElement.closest('[contenteditable="true"]');n&&n.focus()}return t.addEventListener("focus",n),()=>{t.removeEventListener("focus",n)}}),[])}function Ty(e){let{formatTypes:t,onChange:n,onFocus:o,value:r,forwardedRef:l}=e;return t.map((e=>{const{name:t,edit:i}=e;if(!i)return null;const a=(0,F.getActiveFormat)(r,t);let c=void 0!==a;const d=(0,F.getActiveObject)(r),p=void 0!==d&&d.type===t;if("core/link"===t&&!(0,F.isCollapsed)(r)){const e=r.formats,t=(0,u.find)(e[r.start],{type:"core/link"}),n=(0,u.find)(e[r.end-1],{type:"core/link"});t&&n&&t===n||(c=!1)}return(0,s.createElement)(i,{key:t,isActive:c,activeAttributes:c&&a.attributes||{},isObjectActive:p,activeObjectAttributes:p&&d.attributes||{},value:r,onChange:n,onFocus:o,contentRef:l})}))}const Ny=(0,s.createContext)(),Py=(0,s.createContext)(),Ly=(0,s.forwardRef)((function e(t,n){let{children:o,tagName:l="div",value:a="",onChange:g,isSelected:h,multiline:f,inlineToolbar:v,wrapperClassName:b,autocompleters:k,onReplace:_,placeholder:y,allowedFormats:E,formattingControls:C,withoutInteractiveFormatting:S,onRemove:w,onMerge:B,onSplit:I,__unstableOnSplitAtEnd:x,__unstableOnSplitMiddle:T,identifier:N,preserveWhiteSpace:P,__unstablePastePlainText:L,__unstableEmbedURLOnPaste:M,__unstableDisableFormats:R,disableLineBreaks:A,unstableOnFocus:D,__unstableAllowPrefixTransformations:O,...z}=t;const H=(0,d.useInstanceId)(e);N=N||H,z=function(e){return(0,u.omit)(e,["__unstableMobileNoFocusOnMount","deleteEnter","placeholderTextColor","textAlign","selectionColor","tagsToEliminate","rootTagsToEliminate","disableEditingMenu","fontSize","fontFamily","fontWeight","fontStyle","minWidth","maxWidth","setRef","disableSuggestions","disableAutocorrection"])}(z);const G=(0,s.useRef)(),{clientId:U}=lo(),{selectionStart:W,selectionEnd:$,isSelected:j}=(0,m.useSelect)((e=>{const{getSelectionStart:t,getSelectionEnd:n}=e(to),o=t(),r=n();let l;return void 0===h?l=o.clientId===U&&r.clientId===U&&o.attributeKey===N:h&&(l=o.clientId===U),{selectionStart:l?o.offset:void 0,selectionEnd:l?r.offset:void 0,isSelected:l}})),{selectionChange:K}=(0,m.useDispatch)(to),q=fy(f),Y=vy({allowedFormats:E,formattingControls:C,disableFormats:R}),Z=!Y||Y.length>0;let Q=a,X=g;Array.isArray(a)&&(Q=r.children.toHTML(a),X=e=>g(r.children.fromDOM((0,F.__unstableCreateElement)(document,e).childNodes)));const J=(0,s.useCallback)(((e,t)=>{const n={},o=void 0===e&&void 0===t;("number"==typeof e||o)&&(n.start={clientId:U,attributeKey:N,offset:e}),("number"==typeof t||o)&&(n.end={clientId:U,attributeKey:N,offset:t}),K(n)}),[U,N]),{formatTypes:ee,prepareHandlers:te,valueHandlers:ne,changeHandlers:oe,dependencies:re}=function(e){let{clientId:t,identifier:n,withoutInteractiveFormatting:o,allowedFormats:r}=e;const l=(0,m.useSelect)(Sy,[]),i=(0,s.useMemo)((()=>l.filter((e=>{let{name:t,tagName:n}=e;return!(r&&!r.includes(t)||o&&wy.has(n))}))),[l,r,wy]),a=(0,m.useSelect)((e=>i.reduce(((o,r)=>(r.__experimentalGetPropsForEditableTreePreparation&&(o[r.name]=r.__experimentalGetPropsForEditableTreePreparation(e,{richTextIdentifier:n,blockClientId:t})),o)),{})),[i,t,n]),c=(0,m.useDispatch)(),u=[],d=[],p=[],g=[];return i.forEach((e=>{if(e.__experimentalCreatePrepareEditableTree){const o=a[e.name],r=e.__experimentalCreatePrepareEditableTree(o,{richTextIdentifier:n,blockClientId:t});e.__experimentalCreateOnChangeEditableValue?d.push(r):u.push(r);for(const e in o)g.push(o[e])}if(e.__experimentalCreateOnChangeEditableValue){let o={};e.__experimentalGetPropsForEditableTreeChangeHandler&&(o=e.__experimentalGetPropsForEditableTreeChangeHandler(c,{richTextIdentifier:n,blockClientId:t})),p.push(e.__experimentalCreateOnChangeEditableValue({...a[e.name]||{},...o},{richTextIdentifier:n,blockClientId:t}))}})),{formatTypes:i,prepareHandlers:u,valueHandlers:d,changeHandlers:p,dependencies:g}}({clientId:U,identifier:N,withoutInteractiveFormatting:S,allowedFormats:Y});function le(e){return ee.forEach((t=>{t.__experimentalCreatePrepareEditableTree&&(e=(0,F.removeFormat)(e,t.name,0,e.text.length))})),e.formats}const{value:ie,onChange:se,ref:ae}=(0,F.__unstableUseRichText)({value:Q,onChange(e,t){let{__unstableFormats:n,__unstableText:o}=t;X(e),Object.values(oe).forEach((e=>{e(n,o)}))},selectionStart:W,selectionEnd:$,onSelectionChange:J,placeholder:y,__unstableIsSelected:j,__unstableMultilineTag:q,__unstableDisableFormats:R,preserveWhiteSpace:P,__unstableDependencies:[...re,l],__unstableAfterParse:function(e){return ne.reduce(((t,n)=>n(t,e.text)),e.formats)},__unstableBeforeSerialize:le,__unstableAddInvisibleFormats:function(e){return te.reduce(((t,n)=>n(t,e.text)),e.formats)}}),ce=function(e){return(0,p.__unstableUseAutocompleteProps)({...e,completers:Sb(e)})}({onReplace:_,completers:k,record:ie,onChange:se});!function(e){let{html:t,value:n}=e;const o=(0,s.useRef)(),r=n.activeFormats&&!!n.activeFormats.length,{__unstableMarkLastChangeAsPersistent:l}=(0,m.useDispatch)(to);(0,s.useLayoutEffect)((()=>{if(o.current){if(o.current!==n.text){const e=window.setTimeout((()=>{l()}),1e3);return o.current=n.text,()=>{window.clearTimeout(e)}}l()}else o.current=n.text}),[t,r])}({html:Q,value:ie});const ue=(0,s.useRef)(new Set),de=(0,s.useRef)(new Set);function pe(){G.current.focus()}const me=l,ge=(0,s.createElement)(s.Fragment,null,j&&(0,s.createElement)(Ny.Provider,{value:ue},(0,s.createElement)(Py.Provider,{value:de},(0,s.createElement)(p.Popover.__unstableSlotNameProvider,{value:"__unstable-block-tools-after"},o&&o({value:ie,onChange:se,onFocus:pe}),(0,s.createElement)(Ty,{value:ie,onChange:se,onFocus:pe,formatTypes:ee,forwardedRef:G})))),j&&Z&&(0,s.createElement)(dy,{inline:v,anchorRef:G}),(0,s.createElement)(me,i({role:"textbox","aria-multiline":!A,"aria-label":y},z,ce,{ref:(0,d.useMergeRefs)([n,ce.ref,z.ref,ae,Ey({value:ie,onChange:se,__unstableAllowPrefixTransformations:O,formatTypes:ee,onReplace:_,selectionChange:K}),(0,d.useRefEffect)((e=>{function t(e){($c.isKeyboardEvent.primary(e,"z")||$c.isKeyboardEvent.primary(e,"y")||$c.isKeyboardEvent.primaryShift(e,"z"))&&e.preventDefault()}return e.addEventListener("keydown",t),()=>{e.addEventListener("keydown",t)}}),[]),By(ue),Iy(de),py(),_y({isSelected:j,disableFormats:R,onChange:se,value:ie,formatTypes:ee,tagName:l,onReplace:_,onSplit:I,onSplitMiddle:T,__unstableEmbedURLOnPaste:M,multilineTag:q,preserveWhiteSpace:P,pastePlainText:L}),Cy({removeEditorOnlyFormats:le,value:ie,onReplace:_,onSplit:I,onSplitMiddle:T,multilineTag:q,onChange:se,disableLineBreaks:A,onSplitAtEnd:x}),xy(),G]),contentEditable:!0,suppressContentEditableWarning:!0,className:c()("block-editor-rich-text__editable",z.className,"rich-text"),onFocus:D,onKeyDown:function(e){const{keyCode:t}=e;if(!e.defaultPrevented&&(t===$c.DELETE||t===$c.BACKSPACE)){const{start:n,end:o,text:r}=ie,l=t===$c.BACKSPACE,i=ie.activeFormats&&!!ie.activeFormats.length;if(!(0,F.isCollapsed)(ie)||i||l&&0!==n||!l&&o!==r.length)return;B&&B(!l),w&&(0,F.isEmpty)(ie)&&l&&w(!l),e.preventDefault()}}})));if(!b)return ge;V()("wp.blockEditor.RichText wrapperClassName prop",{since:"5.4",alternative:"className prop or create your own wrapper div",version:"6.2"});const he=c()("block-editor-rich-text",b);return(0,s.createElement)("div",{className:he},ge)}));Ly.Content=e=>{let{value:t,tagName:n,multiline:o,...l}=e;Array.isArray(t)&&(t=r.children.toHTML(t));const i=fy(o);!t&&i&&(t=`<${i}></${i}>`);const a=(0,s.createElement)(s.RawHTML,null,t);return n?(0,s.createElement)(n,(0,u.omit)(l,["format"]),a):a},Ly.isEmpty=e=>!e||0===e.length;const My=Ly,Ry=(0,s.forwardRef)(((e,t)=>(0,s.createElement)(My,i({ref:t},e,{__unstableDisableFormats:!0,preserveWhiteSpace:!0}))));Ry.Content=e=>{let{value:t="",tagName:n="div",...o}=e;return(0,s.createElement)(n,o,t)};const Ay=Ry,Dy=(0,s.forwardRef)(((e,t)=>{let{__experimentalVersion:n,...o}=e;if(2===n)return(0,s.createElement)(Ay,i({ref:t},o));const{className:r,onChange:l,...a}=o;return(0,s.createElement)(Wl.Z,i({ref:t,className:c()("block-editor-plain-text",r),onChange:e=>l(e.target.value)},a))}));function Oy(e){let{property:t,viewport:n,desc:o}=e;const r=(0,d.useInstanceId)(Oy),l=o||(0,h.sprintf)(
95
  /* translators: 1: property name. 2: viewport name. */
96
+ (0,h._x)("Controls the %1$s property for %2$s viewports.","Text labelling a interface as controlling a given layout property (eg: margin) for a given screen size."),t,n.label);return(0,s.createElement)(s.Fragment,null,(0,s.createElement)("span",{"aria-describedby":`rbc-desc-${r}`},n.label),(0,s.createElement)(p.VisuallyHidden,{as:"span",id:`rbc-desc-${r}`},l))}const Fy=function(e){const{title:t,property:n,toggleLabel:o,onIsResponsiveChange:r,renderDefaultControl:l,renderResponsiveControls:i,isResponsive:a=!1,defaultLabel:u={id:"all",
97
  /* translators: 'Label. Used to signify a layout property (eg: margin, padding) will apply uniformly to all screensizes.' */
98
  label:(0,h.__)("All")},viewports:d=[{id:"small",label:(0,h.__)("Small screens")},{id:"medium",label:(0,h.__)("Medium screens")},{id:"large",label:(0,h.__)("Large screens")}]}=e;if(!t||!n||!l)return null;const m=o||(0,h.sprintf)(
99
  /* translators: 'Toggle control label. Should the property be the same across all screen sizes or unique per screen size.'. %s property value for the control (eg: margin, padding...etc) */
100
+ (0,h.__)("Use the same %s on all screensizes."),n),g=(0,h.__)("Toggle between using the same value for all screen sizes or using a unique value per screen size."),f=l((0,s.createElement)(Oy,{property:n,viewport:u}),u);
101
+ /* translators: 'Help text for the responsive mode toggle control.' */return(0,s.createElement)("fieldset",{className:"block-editor-responsive-block-control"},(0,s.createElement)("legend",{className:"block-editor-responsive-block-control__title"},t),(0,s.createElement)("div",{className:"block-editor-responsive-block-control__inner"},(0,s.createElement)(p.ToggleControl,{className:"block-editor-responsive-block-control__toggle",label:m,checked:!a,onChange:r,help:g}),(0,s.createElement)("div",{className:c()("block-editor-responsive-block-control__group",{"is-responsive":a})},!a&&f,a&&(i?i(d):d.map((e=>(0,s.createElement)(s.Fragment,{key:e.id},l((0,s.createElement)(Oy,{property:n,viewport:e}),e))))))))};function zy(e){let{character:t,type:n,onUse:o}=e;const r=(0,s.useContext)(Ny),l=(0,s.useRef)();return l.current=o,(0,s.useEffect)((()=>{function e(e){$c.isKeyboardEvent[n](e,t)&&(l.current(),e.preventDefault())}return r.current.add(e),()=>{r.current.delete(e)}}),[t,n]),null}function Vy(e){let t,{name:n,shortcutType:o,shortcutCharacter:r,...l}=e,a="RichText.ToolbarControls";return n&&(a+=`.${n}`),o&&r&&(t=$c.displayShortcut[o](r)),(0,s.createElement)(p.Fill,{name:a},(0,s.createElement)(p.ToolbarButton,i({},l,{shortcut:t})))}function Hy(e){let{inputType:t,onInput:n}=e;const o=(0,s.useContext)(Py),r=(0,s.useRef)();return r.current=n,(0,s.useEffect)((()=>{function e(e){e.inputType===t&&(r.current(),e.preventDefault())}return o.current.add(e),()=>{o.current.delete(e)}}),[t]),null}const Gy=(0,s.createElement)(p.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},(0,s.createElement)(p.Path,{d:"M9.4 20.5L5.2 3.8l14.6 9-2 .3c-.2 0-.4.1-.7.1-.9.2-1.6.3-2.2.5-.8.3-1.4.5-1.8.8-.4.3-.8.8-1.3 1.5-.4.5-.8 1.2-1.2 2l-.3.6-.9 1.9zM7.6 7.1l2.4 9.3c.2-.4.5-.8.7-1.1.6-.8 1.1-1.4 1.6-1.8.5-.4 1.3-.8 2.2-1.1l1.2-.3-8.1-5z"})),Uy=(0,s.forwardRef)((function(e,t){const n=(0,m.useSelect)((e=>e(to).isNavigationMode()),[]),{setNavigationMode:o}=(0,m.useDispatch)(to),r=e=>{o("edit"!==e)};return(0,s.createElement)(p.Dropdown,{renderToggle:o=>{let{isOpen:r,onToggle:l}=o;return(0,s.createElement)(p.Button,i({},e,{ref:t,icon:n?Gy:V_,"aria-expanded":r,"aria-haspopup":"true",onClick:l
102
+ /* translators: button label text should, if possible, be under 16 characters. */,label:(0,h.__)("Tools")}))},position:"bottom right",renderContent:()=>(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.NavigableMenu,{role:"menu","aria-label":(0,h.__)("Tools")},(0,s.createElement)(p.MenuItemsChoice,{value:n?"select":"edit",onSelect:r,choices:[{value:"edit",label:(0,s.createElement)(s.Fragment,null,(0,s.createElement)(Rr,{icon:V_}),(0,h.__)("Edit"))},{value:"select",label:(0,s.createElement)(s.Fragment,null,Gy,(0,h.__)("Select"))}]})),(0,s.createElement)("div",{className:"block-editor-tool-selector__help"},(0,h.__)("Tools provide different interactions for selecting, navigating, and editing blocks. Toggle between select and edit by pressing Escape and Enter.")))})}));function Wy(e){let{units:t,...n}=e;const o=(0,p.__experimentalUseCustomUnits)({availableUnits:To("spacing.units")||["%","px","em","rem","vw"],units:t});return(0,s.createElement)(p.__experimentalUnitControl,i({units:o},n))}const $y=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M20 10.8H6.7l4.1-4.5-1.1-1.1-5.8 6.3 5.8 5.8 1.1-1.1-4-3.9H20z"}));class jy extends s.Component{constructor(){super(...arguments),this.toggle=this.toggle.bind(this),this.submitLink=this.submitLink.bind(this),this.state={expanded:!1}}toggle(){this.setState({expanded:!this.state.expanded})}submitLink(e){e.preventDefault(),this.toggle()}render(){const{url:e,onChange:t}=this.props,{expanded:n}=this.state,o=e?(0,h.__)("Edit link"):(0,h.__)("Insert link");return(0,s.createElement)("div",{className:"block-editor-url-input__button"},(0,s.createElement)(p.Button,{icon:yh,label:o,onClick:this.toggle,className:"components-toolbar__control",isPressed:!!e}),n&&(0,s.createElement)("form",{className:"block-editor-url-input__button-modal",onSubmit:this.submitLink},(0,s.createElement)("div",{className:"block-editor-url-input__button-modal-line"},(0,s.createElement)(p.Button,{className:"block-editor-url-input__back",icon:$y,label:(0,h.__)("Close"),onClick:this.toggle}),(0,s.createElement)(E_,{value:e||"",onChange:t}),(0,s.createElement)(p.Button,{icon:g_,label:(0,h.__)("Submit"),type:"submit"}))))}}const Ky=jy,qy=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M13 11.8l6.1-6.3-1-1-6.1 6.2-6.1-6.2-1 1 6.1 6.3-6.5 6.7 1 1 6.5-6.6 6.5 6.6 1-1z"})),Yy="none",Zy="custom",Qy="media",Xy="attachment",Jy=["noreferrer","noopener"],eE=(0,s.createElement)(p.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,s.createElement)(p.Path,{d:"M0,0h24v24H0V0z",fill:"none"}),(0,s.createElement)(p.Path,{d:"m19 5v14h-14v-14h14m0-2h-14c-1.1 0-2 0.9-2 2v14c0 1.1 0.9 2 2 2h14c1.1 0 2-0.9 2-2v-14c0-1.1-0.9-2-2-2z"}),(0,s.createElement)(p.Path,{d:"m14.14 11.86l-3 3.87-2.14-2.59-3 3.86h12l-3.86-5.14z"})),tE=e=>{let{linkDestination:t,onChangeUrl:n,url:o,mediaType:r="image",mediaUrl:l,mediaLink:i,linkTarget:a,linkClass:c,rel:d}=e;const[m,g]=(0,s.useState)(!1),f=(0,s.useCallback)((()=>{g(!0)})),[v,b]=(0,s.useState)(!1),[k,_]=(0,s.useState)(null),y=(0,s.useRef)(null),E=(0,s.useCallback)((()=>{t!==Qy&&t!==Xy||_(""),b(!0)})),C=(0,s.useCallback)((()=>{b(!1)})),S=(0,s.useCallback)((()=>{_(null),C(),g(!1)})),w=(0,s.useCallback)((()=>e=>{const t=y.current;t&&t.contains(e.target)||(g(!1),_(null),C())})),B=(0,s.useCallback)((()=>e=>{if(k){var t;const e=(null===(t=x().find((e=>e.url===k)))||void 0===t?void 0:t.linkDestination)||Zy;n({href:k,linkDestination:e})}C(),_(null),e.preventDefault()})),I=(0,s.useCallback)((()=>{n({linkDestination:Yy,href:""})})),x=()=>{const e=[{linkDestination:Qy,title:(0,h.__)("Media File"),url:"image"===r?l:void 0,icon:eE}];return"image"===r&&i&&e.push({linkDestination:Xy,title:(0,h.__)("Attachment Page"),url:"image"===r?i:void 0,icon:(0,s.createElement)(p.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,s.createElement)(p.Path,{d:"M0 0h24v24H0V0z",fill:"none"}),(0,s.createElement)(p.Path,{d:"M14 2H6c-1.1 0-1.99.9-1.99 2L4 20c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8l-6-6zM6 20V4h7v5h5v11H6z"}))}),e},T=(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.ToggleControl,{label:(0,h.__)("Open in new tab"),onChange:e=>{const t=(e=>{const t=e?"_blank":void 0;let n;if(t){const e=(null!=d?d:"").split(" ");Jy.forEach((t=>{e.includes(t)||e.push(t)})),n=e.join(" ")}else{const e=(null!=d?d:"").split(" ").filter((e=>!1===Jy.includes(e)));n=e.length?e.join(" "):void 0}return{linkTarget:t,rel:n}})(e);n(t)},checked:"_blank"===a}),(0,s.createElement)(p.TextControl,{label:(0,h.__)("Link Rel"),value:null!=d?d:"",onChange:e=>{n({rel:e})}}),(0,s.createElement)(p.TextControl,{label:(0,h.__)("Link CSS Class"),value:c||"",onChange:e=>{n({linkClass:e})}})),N=null!==k?k:o,P=((0,u.find)(x(),["linkDestination",t])||{}).title;return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.ToolbarButton,{icon:yh,className:"components-toolbar__control",label:o?(0,h.__)("Edit link"):(0,h.__)("Insert link"),"aria-expanded":m,onClick:f}),m&&(0,s.createElement)(ry,{onFocusOutside:w(),onClose:S,renderSettings:()=>T,additionalControls:!N&&(0,s.createElement)(p.NavigableMenu,null,(0,u.map)(x(),(e=>(0,s.createElement)(p.MenuItem,{key:e.linkDestination,icon:e.icon,onClick:()=>{_(null),(e=>{const t=x();let o;o=e?((0,u.find)(t,(t=>t.url===e))||{linkDestination:Zy}).linkDestination:Yy,n({linkDestination:o,href:e})})(e.url),C()}},e.title))))},(!o||v)&&(0,s.createElement)(ry.LinkEditor,{className:"block-editor-format-toolbar__link-container-content",value:N,onChangeInputValue:_,onSubmit:B(),autocompleteRef:y}),o&&!v&&(0,s.createElement)(s.Fragment,null,(0,s.createElement)(ry.LinkViewer,{className:"block-editor-format-toolbar__link-container-content",url:o,onEditLinkClick:E,urlLabel:P}),(0,s.createElement)(p.Button,{icon:qy,label:(0,h.__)("Remove link"),onClick:I}))))};function nE(e){let{children:t,className:n,isEnabled:o=!0,deviceType:r,setDeviceType:l}=e;if((0,d.useViewportMatch)("small","<"))return null;const i={className:c()(n,"block-editor-post-preview__dropdown-content"),position:"bottom left"},a={variant:"tertiary",className:"block-editor-post-preview__button-toggle",disabled:!o,
103
  /* translators: button label text should, if possible, be under 16 characters. */
104
+ children:(0,h.__)("Preview")},u={"aria-label":(0,h.__)("Preview options")};return(0,s.createElement)(p.DropdownMenu,{className:"block-editor-post-preview__dropdown",popoverProps:i,toggleProps:a,menuProps:u,icon:null},(()=>(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.MenuGroup,null,(0,s.createElement)(p.MenuItem,{className:"block-editor-post-preview__button-resize",onClick:()=>l("Desktop"),icon:"Desktop"===r&&Om},(0,h.__)("Desktop")),(0,s.createElement)(p.MenuItem,{className:"block-editor-post-preview__button-resize",onClick:()=>l("Tablet"),icon:"Tablet"===r&&Om},(0,h.__)("Tablet")),(0,s.createElement)(p.MenuItem,{className:"block-editor-post-preview__button-resize",onClick:()=>l("Mobile"),icon:"Mobile"===r&&Om},(0,h.__)("Mobile"))),t)))}function oE(e){const[t,n]=(0,s.useState)(window.innerWidth);(0,s.useEffect)((()=>{if("Desktop"===e)return;const t=()=>n(window.innerWidth);return window.addEventListener("resize",t),()=>{window.removeEventListener("resize",t)}}),[e]);const o=e=>{let n;switch(e){case"Tablet":n=780;break;case"Mobile":n=360;break;default:return null}return n<t?n:t};return(e=>{const t="Mobile"===e?"768px":"1024px";switch(e){case"Tablet":case"Mobile":return{width:o(e),margin:(window.innerHeight<800?36:72)+"px auto",height:t,borderRadius:"2px 2px 2px 2px",border:"1px solid #ddd",overflowY:"auto"};default:return null}})(e)}const rE=(0,m.withSelect)((e=>({selectedBlockClientId:e(to).getBlockSelectionStart()})))((e=>{let{selectedBlockClientId:t}=e;const n=So(t);return t?(0,s.createElement)(p.Button,{variant:"secondary",className:"block-editor-skip-to-selected-block",onClick:()=>{n.current.focus()}},(0,h.__)("Skip to the selected block")):null})),lE=window.wp.wordcount,iE=(0,m.withSelect)((e=>{const{getMultiSelectedBlocks:t}=e(to);return{blocks:t()}}))((function(e){let{blocks:t}=e;const n=(0,lE.count)((0,r.serialize)(t),"words");return(0,s.createElement)("div",{className:"block-editor-multi-selection-inspector__card"},(0,s.createElement)(iu,{icon:Rm,showColors:!0}),(0,s.createElement)("div",{className:"block-editor-multi-selection-inspector__card-content"},(0,s.createElement)("div",{className:"block-editor-multi-selection-inspector__card-title"},(0,h.sprintf)(
105
  /* translators: %d: number of blocks */
106
  (0,h._n)("%d block","%d blocks",t.length),t.length)),(0,s.createElement)("div",{className:"block-editor-multi-selection-inspector__card-description"},(0,h.sprintf)(
107
  /* translators: %d: number of words */
108
+ (0,h._n)("%d word","%d words",n),n))))}));function sE(e){let{blockName:t}=e;const{preferredStyle:n,onUpdatePreferredStyleVariations:o,styles:l}=(0,m.useSelect)((e=>{var n,o;const l=e(to).getSettings().__experimentalPreferredStyleVariations;return{preferredStyle:null==l||null===(n=l.value)||void 0===n?void 0:n[t],onUpdatePreferredStyleVariations:null!==(o=null==l?void 0:l.onChange)&&void 0!==o?o:null,styles:e(r.store).getBlockStyles(t)}}),[t]),i=(0,s.useMemo)((()=>[{label:(0,h.__)("Not set"),value:""},...l.map((e=>{let{label:t,name:n}=e;return{label:t,value:n}}))]),[l]),a=(0,s.useMemo)((()=>{var e;return null===(e=Hm(l))||void 0===e?void 0:e.name}),[l]),c=(0,s.useCallback)((e=>{o(t,e)}),[t,o]);return n&&n!==a?o&&(0,s.createElement)("div",{className:"default-style-picker__default-switcher"},(0,s.createElement)(p.SelectControl,{options:i,value:n||"",label:(0,h.__)("Default Style"),onChange:c})):null}const aE=e=>{let{clientId:t,blockName:n,hasBlockStyles:o}=e;const l=um(t);return(0,s.createElement)("div",{className:"block-editor-block-inspector"},(0,s.createElement)(su,l),(0,s.createElement)(Ek,{blockClientId:t}),o&&(0,s.createElement)("div",null,(0,s.createElement)(p.PanelBody,{title:(0,h.__)("Styles")},(0,s.createElement)(sk,{scope:"core/block-inspector",clientId:t}),(0,r.hasBlockSupport)(n,"defaultStylePicker",!0)&&(0,s.createElement)(sE,{blockName:n}))),(0,s.createElement)(Go.Slot,null),(0,s.createElement)(Go.Slot,{__experimentalGroup:"color",label:(0,h.__)("Color"),className:"color-block-support-panel__inner-wrapper"}),(0,s.createElement)(Go.Slot,{__experimentalGroup:"typography",label:(0,h.__)("Typography")}),(0,s.createElement)(Go.Slot,{__experimentalGroup:"dimensions",label:(0,h.__)("Dimensions")}),(0,s.createElement)(Go.Slot,{__experimentalGroup:"border",label:(0,h.__)("Border")}),(0,s.createElement)("div",null,(0,s.createElement)(cE,null)),(0,s.createElement)(rE,{key:"back"}))},cE=()=>{const e=(0,p.__experimentalUseSlot)(Ho.slotName);return Boolean(e.fills&&e.fills.length)?(0,s.createElement)(p.PanelBody,{className:"block-editor-block-inspector__advanced",title:(0,h.__)("Advanced"),initialOpen:!1},(0,s.createElement)(Go.Slot,{__experimentalGroup:"advanced"})):null},uE=e=>{let{showNoBlockSelectedMessage:t=!0}=e;const{count:n,hasBlockStyles:o,selectedBlockName:l,selectedBlockClientId:i,blockType:a}=(0,m.useSelect)((e=>{const{getSelectedBlockClientId:t,getSelectedBlockCount:n,getBlockName:o}=e(to),{getBlockStyles:l}=e(r.store),i=t(),s=i&&o(i),a=s&&(0,r.getBlockType)(s),c=s&&l(s);return{count:n(),selectedBlockClientId:i,selectedBlockName:s,blockType:a,hasBlockStyles:c&&c.length>0}}),[]);if(n>1)return(0,s.createElement)("div",{className:"block-editor-block-inspector"},(0,s.createElement)(iE,null),(0,s.createElement)(Go.Slot,null),(0,s.createElement)(Go.Slot,{__experimentalGroup:"color",label:(0,h.__)("Color"),className:"color-block-support-panel__inner-wrapper"}),(0,s.createElement)(Go.Slot,{__experimentalGroup:"typography",label:(0,h.__)("Typography")}),(0,s.createElement)(Go.Slot,{__experimentalGroup:"dimensions",label:(0,h.__)("Dimensions")}),(0,s.createElement)(Go.Slot,{__experimentalGroup:"border",label:(0,h.__)("Border")}));const c=l===(0,r.getUnregisteredTypeHandlerName)();return a&&i&&!c?(0,s.createElement)(aE,{clientId:i,blockName:a.name,hasBlockStyles:o}):t?(0,s.createElement)("span",{className:"block-editor-block-inspector__no-blocks"},(0,h.__)("No block selected.")):null};function dE(e){let{children:t,__unstableContentRef:n,...o}=e;const r=(0,d.useViewportMatch)("medium"),l=(0,m.useSelect)((e=>e(to).getSettings().hasFixedToolbar),[]),a=(0,ku.__unstableUseShortcutEventMatch)(),{getSelectedBlockClientIds:c,getBlockRootClientId:g}=(0,m.useSelect)(to),{duplicateBlocks:h,removeBlocks:f,insertAfterBlock:v,insertBeforeBlock:b,clearSelectedBlock:k,moveBlocksUp:_,moveBlocksDown:y}=(0,m.useDispatch)(to);return(0,s.createElement)("div",i({},o,{onKeyDown:function(e){if(a("core/block-editor/move-up",e)){const t=c();if(t.length){e.preventDefault();const n=g((0,u.first)(t));_(t,n)}}else if(a("core/block-editor/move-down",e)){const t=c();if(t.length){e.preventDefault();const n=g((0,u.first)(t));y(t,n)}}else if(a("core/block-editor/duplicate",e)){const t=c();t.length&&(e.preventDefault(),h(t))}else if(a("core/block-editor/remove",e)){const t=c();t.length&&(e.preventDefault(),f(t))}else if(a("core/block-editor/insert-after",e)){const t=c();t.length&&(e.preventDefault(),v((0,u.last)(t)))}else if(a("core/block-editor/insert-before",e)){const t=c();t.length&&(e.preventDefault(),b((0,u.first)(t)))}else a("core/block-editor/unselect",e)&&c().length>1&&(e.preventDefault(),k(),e.target.ownerDocument.defaultView.getSelection().removeAllRanges())}}),(0,s.createElement)(im,{__unstableContentRef:n},(l||!r)&&(0,s.createElement)(Gg,{isFixed:!0}),(0,s.createElement)(jg,{__unstableContentRef:n}),(0,s.createElement)(p.Popover.Slot,{name:"block-toolbar",ref:$o(n)}),t,(0,s.createElement)(p.Popover.Slot,{name:"__unstable-block-tools-after",ref:$o(n)})))}const pE=()=>{},mE=(0,s.forwardRef)((function(e,t){let{rootClientId:n,clientId:o,isAppender:r,showInserterHelpPanel:l,showMostUsedBlocks:i=!1,__experimentalInsertionIndex:a,__experimentalFilterValue:c,onSelect:u=pE,shouldFocusBlock:d=!1}=e;const p=(0,m.useSelect)((e=>{const{getBlockRootClientId:t}=e(to);return n||t(o)||void 0}),[o,n]);return(0,s.createElement)(Kp,{onSelect:u,rootClientId:p,clientId:o,isAppender:r,showInserterHelpPanel:l,showMostUsedBlocks:i,__experimentalInsertionIndex:a,__experimentalFilterValue:c,shouldFocusBlock:d,ref:t})}));function gE(){return null}gE.Register=function(){const{registerShortcut:e}=(0,m.useDispatch)(ku.store);return(0,s.useEffect)((()=>{e({name:"core/block-editor/duplicate",category:"block",description:(0,h.__)("Duplicate the selected block(s)."),keyCombination:{modifier:"primaryShift",character:"d"}}),e({name:"core/block-editor/remove",category:"block",description:(0,h.__)("Remove the selected block(s)."),keyCombination:{modifier:"access",character:"z"}}),e({name:"core/block-editor/insert-before",category:"block",description:(0,h.__)("Insert a new block before the selected block(s)."),keyCombination:{modifier:"primaryAlt",character:"t"}}),e({name:"core/block-editor/insert-after",category:"block",description:(0,h.__)("Insert a new block after the selected block(s)."),keyCombination:{modifier:"primaryAlt",character:"y"}}),e({name:"core/block-editor/delete-multi-selection",category:"block",description:(0,h.__)("Delete selection."),keyCombination:{character:"del"},aliases:[{character:"backspace"}]}),e({name:"core/block-editor/select-all",category:"selection",description:(0,h.__)("Select all text when typing. Press again to select all blocks."),keyCombination:{modifier:"primary",character:"a"}}),e({name:"core/block-editor/unselect",category:"selection",description:(0,h.__)("Clear selection."),keyCombination:{character:"escape"}}),e({name:"core/block-editor/focus-toolbar",category:"global",description:(0,h.__)("Navigate to the nearest toolbar."),keyCombination:{modifier:"alt",character:"F10"}}),e({name:"core/block-editor/move-up",category:"block",description:(0,h.__)("Move the selected block(s) up."),keyCombination:{modifier:"secondary",character:"t"}}),e({name:"core/block-editor/move-down",category:"block",description:(0,h.__)("Move the selected block(s) down."),keyCombination:{modifier:"secondary",character:"y"}})}),[e]),null};const hE=gE;function fE(){return V()("wp.blockEditor.MultiSelectScrollIntoView",{hint:"This behaviour is now built-in.",since:"5.8"}),null}const vE=new Set([$c.UP,$c.RIGHT,$c.DOWN,$c.LEFT,$c.ENTER,$c.BACKSPACE]);function bE(){const e=(0,m.useSelect)((e=>e(to).isTyping()),[]),{stopTyping:t}=(0,m.useDispatch)(to);return(0,d.useRefEffect)((n=>{if(!e)return;const{ownerDocument:o}=n;let r,l;function i(e){const{clientX:n,clientY:o}=e;r&&l&&(r!==n||l!==o)&&t(),r=n,l=o}return o.addEventListener("mousemove",i),()=>{o.removeEventListener("mousemove",i)}}),[e,t])}function kE(){const e=(0,m.useSelect)((e=>e(to).isTyping())),{startTyping:t,stopTyping:n}=(0,m.useDispatch)(to),o=bE(),r=(0,d.useRefEffect)((o=>{const{ownerDocument:r}=o,{defaultView:l}=r;if(e){let e;function t(t){const{target:o}=t;e=l.setTimeout((()=>{(0,Bl.isTextField)(o)||n()}))}function i(e){const{keyCode:t}=e;t!==$c.ESCAPE&&t!==$c.TAB||n()}function s(){const e=l.getSelection();e.rangeCount>0&&e.getRangeAt(0).collapsed||n()}return o.addEventListener("focus",t),o.addEventListener("keydown",i),r.addEventListener("selectionchange",s),()=>{l.clearTimeout(e),o.removeEventListener("focus",t),o.removeEventListener("keydown",i),r.removeEventListener("selectionchange",s)}}function i(e){const{type:n,target:r}=e;(0,Bl.isTextField)(r)&&o.contains(r)&&("keydown"!==n||function(e){const{keyCode:t,shiftKey:n}=e;return!n&&vE.has(t)}(e))&&t()}return o.addEventListener("keypress",i),o.addEventListener("keydown",i),()=>{o.removeEventListener("keypress",i),o.removeEventListener("keydown",i)}}),[e,t,n]);return(0,d.useMergeRefs)([o,r])}const _E=function(e){let{children:t}=e;return(0,s.createElement)("div",{ref:kE()},t)},yE=-1!==window.navigator.userAgent.indexOf("Trident"),EE=new Set([$c.UP,$c.DOWN,$c.LEFT,$c.RIGHT]);function CE(){const e=(0,m.useSelect)((e=>e(to).hasSelectedBlock()),[]);return(0,d.useRefEffect)((t=>{if(!e)return;const{ownerDocument:n}=t,{defaultView:o}=n;let r,l,i;function s(){r||(r=o.requestAnimationFrame((()=>{p(),r=null})))}function a(e){l&&o.cancelAnimationFrame(l),l=o.requestAnimationFrame((()=>{c(e),l=null}))}function c(e){let{keyCode:r}=e;if(!m())return;const l=(0,Bl.computeCaretRect)(o);if(!l)return;if(!i)return void(i=l);if(EE.has(r))return void(i=l);const s=l.top-i.top;if(0===s)return;const a=(0,Bl.getScrollContainer)(t);if(!a)return;const c=a===n.body,u=c?o.scrollY:a.scrollTop,d=c?0:a.getBoundingClientRect().top,p=c?i.top/o.innerHeight:(i.top-d)/(o.innerHeight-d);if(0===u&&p<.75&&function(){const e=t.querySelectorAll('[contenteditable="true"]');return e[e.length-1]===n.activeElement}())return void(i=l);const g=c?o.innerHeight:a.clientHeight;i.top+i.height>d+g||i.top<d?i=l:c?o.scrollBy(0,s):a.scrollTop+=s}function u(){n.addEventListener("selectionchange",d)}function d(){n.removeEventListener("selectionchange",d),p()}function p(){m()&&(i=(0,Bl.computeCaretRect)(o))}function m(){return t.contains(n.activeElement)&&n.activeElement.isContentEditable}return o.addEventListener("scroll",s,!0),o.addEventListener("resize",s,!0),t.addEventListener("keydown",a),t.addEventListener("keyup",c),t.addEventListener("mousedown",u),t.addEventListener("touchstart",u),()=>{o.removeEventListener("scroll",s,!0),o.removeEventListener("resize",s,!0),t.removeEventListener("keydown",a),t.removeEventListener("keyup",c),t.removeEventListener("mousedown",u),t.removeEventListener("touchstart",u),n.removeEventListener("selectionchange",d),o.cancelAnimationFrame(r),o.cancelAnimationFrame(l)}}),[e])}const SE=yE?e=>e.children:function(e){let{children:t}=e;return(0,s.createElement)("div",{ref:CE(),className:"block-editor__typewriter"},t)},wE=(0,s.createContext)({});function BE(e,t,n){const o={...e,[t]:e[t]?new Set(e[t]):new Set};return o[t].add(n),o}function IE(e){var t;let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";const o=(0,s.useContext)(wE),{name:r}=lo();n=n||r;const l=Boolean(null===(t=o[n])||void 0===t?void 0:t.has(e)),i=(0,s.useMemo)((()=>BE(o,n,e)),[o,n,e]),a=(0,s.useCallback)((e=>{let{children:t}=e;return(0,s.createElement)(wE.Provider,{value:i},t)}),[i]);return[l,a]}const xE=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M12 13.06l3.712 3.713 1.061-1.06L13.061 12l3.712-3.712-1.06-1.06L12 10.938 8.288 7.227l-1.061 1.06L10.939 12l-3.712 3.712 1.06 1.061L12 13.061z"}));function TE(e){let{title:t,help:n,actions:o=[],onClose:r}=e;return(0,s.createElement)(p.__experimentalVStack,{className:"block-editor-inspec