{
  "version": 3,
  "sources": ["../../src/store/selectors.ts"],
  "sourcesContent": ["/**\n * External dependencies\n */\nimport removeAccents from 'remove-accents';\n\n/**\n * WordPress dependencies\n */\nimport { createSelector } from '@wordpress/data';\nimport { RichTextData } from '@wordpress/rich-text';\nimport deprecated from '@wordpress/deprecated';\n\n/**\n * Internal dependencies\n */\nimport { getValueFromObjectPath, matchesAttributes } from './utils';\nimport { hasContentRoleAttribute as privateHasContentRoleAttribute } from './private-selectors';\nimport type {\n\tBlockType,\n\tBlockVariation,\n\tBlockVariationScope,\n\tBlockCategory,\n\tBlockCollection,\n\tBlockStyle,\n} from '../types';\nimport type { BlockStoreState } from './types';\n\n/**\n * Given a block name or block type object, returns the corresponding\n * normalized block type object.\n *\n * @param state      Blocks state.\n * @param nameOrType Block name or type object\n *\n * @return Block type object.\n */\nconst getNormalizedBlockType = (\n\tstate: BlockStoreState,\n\tnameOrType: string | BlockType\n): BlockType | undefined =>\n\t'string' === typeof nameOrType\n\t\t? getBlockType( state, nameOrType )\n\t\t: nameOrType;\n\n/**\n * Returns all the available block types.\n *\n * @param state Data state.\n *\n * @example\n * ```js\n * import { store as blocksStore } from '@wordpress/blocks';\n * import { useSelect } from '@wordpress/data';\n *\n * const ExampleComponent = () => {\n *     const blockTypes = useSelect(\n *         ( select ) => select( blocksStore ).getBlockTypes(),\n *         []\n *     );\n *\n *     return (\n *         <ul>\n *             { blockTypes.map( ( block ) => (\n *                 <li key={ block.name }>{ block.title }</li>\n *             ) ) }\n *         </ul>\n *     );\n * };\n * ```\n *\n * @return Block Types.\n */\nexport const getBlockTypes = createSelector(\n\t( state: BlockStoreState ): BlockType[] =>\n\t\tObject.values( state.blockTypes ),\n\t( state: BlockStoreState ) => [ state.blockTypes ]\n);\n\n/**\n * Returns a block type by name.\n *\n * @param state Data state.\n * @param name  Block type name.\n *\n * @example\n * ```js\n * import { store as blocksStore } from '@wordpress/blocks';\n * import { useSelect } from '@wordpress/data';\n *\n * const ExampleComponent = () => {\n *     const paragraphBlock = useSelect( ( select ) =>\n *         ( select ) => select( blocksStore ).getBlockType( 'core/paragraph' ),\n *         []\n *     );\n *\n *     return (\n *         <ul>\n *             { paragraphBlock &&\n *                 Object.entries( paragraphBlock.supports ).map(\n *                     ( blockSupportsEntry ) => {\n *                         const [ propertyName, value ] = blockSupportsEntry;\n *                         return (\n *                             <li\n *                                 key={ propertyName }\n *                             >{ `${ propertyName } : ${ value }` }</li>\n *                         );\n *                     }\n *                 ) }\n *         </ul>\n *     );\n * };\n * ```\n *\n * @return Block Type.\n */\nexport function getBlockType(\n\tstate: BlockStoreState,\n\tname: string\n): BlockType | undefined {\n\treturn state.blockTypes[ name ];\n}\n\n/**\n * Returns block styles by block name.\n *\n * @param state Data state.\n * @param name  Block type name.\n *\n * @example\n * ```js\n * import { store as blocksStore } from '@wordpress/blocks';\n * import { useSelect } from '@wordpress/data';\n *\n * const ExampleComponent = () => {\n *     const buttonBlockStyles = useSelect( ( select ) =>\n *         select( blocksStore ).getBlockStyles( 'core/button' ),\n *         []\n *     );\n *\n *     return (\n *         <ul>\n *             { buttonBlockStyles &&\n *                 buttonBlockStyles.map( ( style ) => (\n *                     <li key={ style.name }>{ style.label }</li>\n *                 ) ) }\n *         </ul>\n *     );\n * };\n * ```\n *\n * @return Block Styles.\n */\nexport function getBlockStyles(\n\tstate: BlockStoreState,\n\tname: string\n): BlockStyle[] {\n\treturn state.blockStyles[ name ];\n}\n\n/**\n * Returns block variations by block name.\n *\n * @param state     Data state.\n * @param blockName Block type name.\n * @param scope     Block variation scope name.\n *\n * @example\n * ```js\n * import { store as blocksStore } from '@wordpress/blocks';\n * import { useSelect } from '@wordpress/data';\n *\n * const ExampleComponent = () => {\n *     const socialLinkVariations = useSelect( ( select ) =>\n *         select( blocksStore ).getBlockVariations( 'core/social-link' ),\n *         []\n *     );\n *\n *     return (\n *         <ul>\n *             { socialLinkVariations &&\n *                 socialLinkVariations.map( ( variation ) => (\n *                     <li key={ variation.name }>{ variation.title }</li>\n *             ) ) }\n *     </ul>\n *     );\n * };\n * ```\n *\n * @return Block variations.\n */\nexport const getBlockVariations = createSelector(\n\t(\n\t\tstate: BlockStoreState,\n\t\tblockName: string,\n\t\tscope?: BlockVariationScope\n\t): BlockVariation[] | undefined => {\n\t\tconst variations = state.blockVariations[ blockName ];\n\t\tif ( ! variations || ! scope ) {\n\t\t\treturn variations;\n\t\t}\n\t\treturn variations.filter( ( variation ) => {\n\t\t\t// For backward compatibility reasons, variation's scope defaults to\n\t\t\t// `block` and `inserter` when not set.\n\t\t\treturn ( variation.scope || [ 'block', 'inserter' ] ).includes(\n\t\t\t\tscope\n\t\t\t);\n\t\t} );\n\t},\n\t( state: BlockStoreState, blockName: string ) => [\n\t\tstate.blockVariations[ blockName ],\n\t]\n);\n\n/**\n * Returns the active block variation for a given block based on its attributes.\n * Variations are determined by their `isActive` property.\n * Which is either an array of block attribute keys or a function.\n *\n * In case of an array of block attribute keys, the `attributes` are compared\n * to the variation's attributes using strict equality check.\n *\n * In case of function type, the function should accept a block's attributes\n * and the variation's attributes and determines if a variation is active.\n * A function that accepts a block's attributes and the variation's attributes and determines if a variation is active.\n *\n * @param state      Data state.\n * @param blockName  Name of block (example: \"core/columns\").\n * @param attributes Block attributes used to determine active variation.\n * @param scope      Block variation scope name.\n *\n * @example\n * ```js\n * import { __ } from '@wordpress/i18n';\n * import { store as blocksStore } from '@wordpress/blocks';\n * import { store as blockEditorStore } from '@wordpress/block-editor';\n * import { useSelect } from '@wordpress/data';\n *\n * const ExampleComponent = () => {\n *     // This example assumes that a core/embed block is the first block in the Block Editor.\n *     const activeBlockVariation = useSelect( ( select ) => {\n *         // Retrieve the list of blocks.\n *         const [ firstBlock ] = select( blockEditorStore ).getBlocks()\n *\n *         // Return the active block variation for the first block.\n *         return select( blocksStore ).getActiveBlockVariation(\n *             firstBlock.name,\n *             firstBlock.attributes\n *         );\n *     }, [] );\n *\n *     return activeBlockVariation && activeBlockVariation.name === 'spotify' ? (\n *         <p>{ __( 'Spotify variation' ) }</p>\n *         ) : (\n *         <p>{ __( 'Other variation' ) }</p>\n *     );\n * };\n * ```\n *\n * @return Active block variation.\n */\nexport function getActiveBlockVariation(\n\tstate: BlockStoreState,\n\tblockName: string,\n\tattributes: Record< string, unknown >,\n\tscope?: BlockVariationScope\n): BlockVariation | undefined {\n\tconst variations = getBlockVariations( state, blockName, scope );\n\n\tif ( ! variations ) {\n\t\treturn variations;\n\t}\n\n\tconst blockType = getBlockType( state, blockName );\n\tconst attributeKeys = Object.keys( blockType?.attributes || {} );\n\tlet match: BlockVariation | undefined;\n\tlet maxMatchedAttributes = 0;\n\n\tfor ( const variation of variations ) {\n\t\tif ( Array.isArray( variation.isActive ) ) {\n\t\t\tconst definedAttributes = variation.isActive.filter(\n\t\t\t\t( attribute ) => {\n\t\t\t\t\t// We support nested attribute paths, e.g. `layout.type`.\n\t\t\t\t\t// In this case, we need to check if the part before the\n\t\t\t\t\t// first dot is a known attribute.\n\t\t\t\t\tconst topLevelAttribute = attribute.split( '.' )[ 0 ];\n\t\t\t\t\treturn attributeKeys.includes( topLevelAttribute );\n\t\t\t\t}\n\t\t\t);\n\t\t\tconst definedAttributesLength = definedAttributes.length;\n\t\t\tif ( definedAttributesLength === 0 ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst isMatch = definedAttributes.every( ( attribute ) => {\n\t\t\t\tconst variationAttributeValue = getValueFromObjectPath(\n\t\t\t\t\tvariation.attributes as Record< string, unknown >,\n\t\t\t\t\tattribute\n\t\t\t\t);\n\t\t\t\tif ( variationAttributeValue === undefined ) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\tlet blockAttributeValue = getValueFromObjectPath(\n\t\t\t\t\tattributes,\n\t\t\t\t\tattribute\n\t\t\t\t);\n\t\t\t\tif ( blockAttributeValue instanceof RichTextData ) {\n\t\t\t\t\tblockAttributeValue = blockAttributeValue.toHTMLString();\n\t\t\t\t}\n\t\t\t\treturn matchesAttributes(\n\t\t\t\t\tblockAttributeValue,\n\t\t\t\t\tvariationAttributeValue\n\t\t\t\t);\n\t\t\t} );\n\t\t\tif ( isMatch && definedAttributesLength > maxMatchedAttributes ) {\n\t\t\t\tmatch = variation;\n\t\t\t\tmaxMatchedAttributes = definedAttributesLength;\n\t\t\t}\n\t\t} else if (\n\t\t\tvariation.isActive?.(\n\t\t\t\tattributes,\n\t\t\t\tvariation.attributes as Record< string, unknown >\n\t\t\t)\n\t\t) {\n\t\t\t// If isActive is a function, we cannot know how many attributes it matches.\n\t\t\t// This means that we cannot compare the specificity of our matches,\n\t\t\t// and simply return the best match we have found.\n\t\t\treturn match || variation;\n\t\t}\n\t}\n\n\t// If no variation matches the isActive condition, we return the default variation,\n\t// but only if it doesn't have an isActive condition that wasn't matched.\n\t// This fallback is only applied for the 'block' and 'transform' scopes but not to\n\t// the 'inserter', to avoid affecting block name display there.\n\tif ( ! match && [ 'block', 'transform' ].includes( scope as string ) ) {\n\t\tmatch = variations.find(\n\t\t\t( variation ) =>\n\t\t\t\tvariation?.isDefault && ! Object.hasOwn( variation, 'isActive' )\n\t\t);\n\t}\n\treturn match;\n}\n\n/**\n * Returns the default block variation for the given block type.\n * When there are multiple variations annotated as the default one,\n * the last added item is picked. This simplifies registering overrides.\n * When there is no default variation set, it returns the first item.\n *\n * @param state     Data state.\n * @param blockName Block type name.\n * @param scope     Block variation scope name.\n *\n * @example\n * ```js\n * import { __, sprintf } from '@wordpress/i18n';\n * import { store as blocksStore } from '@wordpress/blocks';\n * import { useSelect } from '@wordpress/data';\n *\n * const ExampleComponent = () => {\n *     const defaultEmbedBlockVariation = useSelect( ( select ) =>\n *         select( blocksStore ).getDefaultBlockVariation( 'core/embed' ),\n *         []\n *     );\n *\n *     return (\n *         defaultEmbedBlockVariation && (\n *             <p>\n *                 { sprintf(\n *                     __( 'core/embed default variation: %s' ),\n *                     defaultEmbedBlockVariation.title\n *                 ) }\n *             </p>\n *         )\n *     );\n * };\n * ```\n *\n * @return The default block variation.\n */\nexport function getDefaultBlockVariation(\n\tstate: BlockStoreState,\n\tblockName: string,\n\tscope?: BlockVariationScope\n): BlockVariation | undefined {\n\tconst variations = getBlockVariations( state, blockName, scope );\n\n\tconst defaultVariation = [ ...( variations || [] ) ]\n\t\t.reverse()\n\t\t.find( ( { isDefault } ) => !! isDefault );\n\n\treturn defaultVariation || variations?.[ 0 ];\n}\n\n/**\n * Returns all the available block categories.\n *\n * @param state Data state.\n *\n * @example\n * ```js\n * import { store as blocksStore } from '@wordpress/blocks';\n * import { useSelect, } from '@wordpress/data';\n *\n * const ExampleComponent = () => {\n *     const blockCategories = useSelect( ( select ) =>\n *         select( blocksStore ).getCategories(),\n *         []\n *     );\n *\n *     return (\n *         <ul>\n *             { blockCategories.map( ( category ) => (\n *                 <li key={ category.slug }>{ category.title }</li>\n *             ) ) }\n *         </ul>\n *     );\n * };\n * ```\n *\n * @return Categories list.\n */\nexport function getCategories( state: BlockStoreState ): BlockCategory[] {\n\treturn state.categories;\n}\n\n/**\n * Returns all the available collections.\n *\n * @param state Data state.\n *\n * @example\n * ```js\n * import { store as blocksStore } from '@wordpress/blocks';\n * import { useSelect } from '@wordpress/data';\n *\n * const ExampleComponent = () => {\n *     const blockCollections = useSelect( ( select ) =>\n *         select( blocksStore ).getCollections(),\n *         []\n *     );\n *\n *     return (\n *         <ul>\n *             { Object.values( blockCollections ).length > 0 &&\n *                 Object.values( blockCollections ).map( ( collection ) => (\n *                     <li key={ collection.title }>{ collection.title }</li>\n *             ) ) }\n *         </ul>\n *     );\n * };\n * ```\n *\n * @return Collections list.\n */\nexport function getCollections(\n\tstate: BlockStoreState\n): Record< string, BlockCollection > {\n\treturn state.collections;\n}\n\n/**\n * Returns the name of the default block name.\n *\n * @param state Data state.\n *\n * @example\n * ```js\n * import { __, sprintf } from '@wordpress/i18n';\n * import { store as blocksStore } from '@wordpress/blocks';\n * import { useSelect } from '@wordpress/data';\n *\n * const ExampleComponent = () => {\n *     const defaultBlockName = useSelect( ( select ) =>\n *         select( blocksStore ).getDefaultBlockName(),\n *         []\n *     );\n *\n *     return (\n *         defaultBlockName && (\n *             <p>\n *                 { sprintf( __( 'Default block name: %s' ), defaultBlockName ) }\n *             </p>\n *         )\n *     );\n * };\n * ```\n *\n * @return Default block name.\n */\nexport function getDefaultBlockName( state: BlockStoreState ): string | null {\n\treturn state.defaultBlockName;\n}\n\n/**\n * Returns the name of the block for handling non-block content.\n *\n * @param state Data state.\n *\n * @example\n * ```js\n * import { __, sprintf } from '@wordpress/i18n';\n * import { store as blocksStore } from '@wordpress/blocks';\n * import { useSelect } from '@wordpress/data';\n *\n * const ExampleComponent = () => {\n *     const freeformFallbackBlockName = useSelect( ( select ) =>\n *         select( blocksStore ).getFreeformFallbackBlockName(),\n *         []\n *     );\n *\n *     return (\n *         freeformFallbackBlockName && (\n *             <p>\n *                 { sprintf( __(\n *                     'Freeform fallback block name: %s' ),\n *                     freeformFallbackBlockName\n *                 ) }\n *             </p>\n *         )\n *     );\n * };\n * ```\n *\n * @return Name of the block for handling non-block content.\n */\nexport function getFreeformFallbackBlockName(\n\tstate: BlockStoreState\n): string | null {\n\treturn state.freeformFallbackBlockName;\n}\n\n/**\n * Returns the name of the block for handling unregistered blocks.\n *\n * @param state Data state.\n *\n * @example\n * ```js\n * import { __, sprintf } from '@wordpress/i18n';\n * import { store as blocksStore } from '@wordpress/blocks';\n * import { useSelect } from '@wordpress/data';\n *\n * const ExampleComponent = () => {\n *     const unregisteredFallbackBlockName = useSelect( ( select ) =>\n *         select( blocksStore ).getUnregisteredFallbackBlockName(),\n *         []\n *     );\n *\n *     return (\n *         unregisteredFallbackBlockName && (\n *             <p>\n *                 { sprintf( __(\n *                     'Unregistered fallback block name: %s' ),\n *                     unregisteredFallbackBlockName\n *                 ) }\n *             </p>\n *         )\n *     );\n * };\n * ```\n *\n * @return Name of the block for handling unregistered blocks.\n */\nexport function getUnregisteredFallbackBlockName(\n\tstate: BlockStoreState\n): string | null {\n\treturn state.unregisteredFallbackBlockName;\n}\n\n/**\n * Returns the name of the block for handling the grouping of blocks.\n *\n * @param state Data state.\n *\n * @example\n * ```js\n * import { __, sprintf } from '@wordpress/i18n';\n * import { store as blocksStore } from '@wordpress/blocks';\n * import { useSelect } from '@wordpress/data';\n *\n * const ExampleComponent = () => {\n *     const groupingBlockName = useSelect( ( select ) =>\n *         select( blocksStore ).getGroupingBlockName(),\n *         []\n *     );\n *\n *     return (\n *         groupingBlockName && (\n *             <p>\n *                 { sprintf(\n *                     __( 'Default grouping block name: %s' ),\n *                     groupingBlockName\n *                 ) }\n *             </p>\n *         )\n *     );\n * };\n * ```\n *\n * @return Name of the block for handling the grouping of blocks.\n */\nexport function getGroupingBlockName( state: BlockStoreState ): string | null {\n\treturn state.groupingBlockName;\n}\n\n/**\n * Returns an array with the child blocks of a given block.\n *\n * @param state     Data state.\n * @param blockName Block type name.\n *\n * @example\n * ```js\n * import { store as blocksStore } from '@wordpress/blocks';\n * import { useSelect } from '@wordpress/data';\n *\n * const ExampleComponent = () => {\n *     const childBlockNames = useSelect( ( select ) =>\n *         select( blocksStore ).getChildBlockNames( 'core/navigation' ),\n *         []\n *     );\n *\n *     return (\n *         <ul>\n *             { childBlockNames &&\n *                 childBlockNames.map( ( child ) => (\n *                     <li key={ child }>{ child }</li>\n *             ) ) }\n *         </ul>\n *     );\n * };\n * ```\n *\n * @return Array of child block names.\n */\nexport const getChildBlockNames = createSelector(\n\t( state: BlockStoreState, blockName: string ): string[] => {\n\t\treturn getBlockTypes( state )\n\t\t\t.filter( ( blockType ) => {\n\t\t\t\treturn blockType.parent?.includes( blockName );\n\t\t\t} )\n\t\t\t.map( ( { name } ) => name );\n\t},\n\t( state: BlockStoreState ) => [ state.blockTypes ]\n);\n\n/**\n * Returns the block support value for a feature, if defined.\n *\n * @param state           Data state.\n * @param nameOrType      Block name or type object\n * @param feature         Feature to retrieve\n * @param defaultSupports Default value to return if not\n *                        explicitly defined\n *\n * @example\n * ```js\n * import { __, sprintf } from '@wordpress/i18n';\n * import { store as blocksStore } from '@wordpress/blocks';\n * import { useSelect } from '@wordpress/data';\n *\n * const ExampleComponent = () => {\n *     const paragraphBlockSupportValue = useSelect( ( select ) =>\n *         select( blocksStore ).getBlockSupport( 'core/paragraph', 'anchor' ),\n *         []\n *     );\n *\n *     return (\n *         <p>\n *             { sprintf(\n *                 __( 'core/paragraph supports.anchor value: %s' ),\n *                 paragraphBlockSupportValue\n *             ) }\n *         </p>\n *     );\n * };\n * ```\n *\n * @return Block support value\n */\nexport const getBlockSupport = (\n\tstate: BlockStoreState,\n\tnameOrType: string | BlockType,\n\tfeature: string | string[],\n\tdefaultSupports?: unknown\n): unknown => {\n\tconst blockType = getNormalizedBlockType( state, nameOrType );\n\tif ( ! blockType?.supports ) {\n\t\treturn defaultSupports;\n\t}\n\n\treturn getValueFromObjectPath(\n\t\tblockType.supports,\n\t\tfeature,\n\t\tdefaultSupports\n\t);\n};\n\n/**\n * Returns true if the block defines support for a feature, or false otherwise.\n *\n * @param state           Data state.\n * @param nameOrType      Block name or type object.\n * @param feature         Feature to test.\n * @param defaultSupports Whether feature is supported by\n *                        default if not explicitly defined.\n *\n * @example\n * ```js\n * import { __, sprintf } from '@wordpress/i18n';\n * import { store as blocksStore } from '@wordpress/blocks';\n * import { useSelect } from '@wordpress/data';\n *\n * const ExampleComponent = () => {\n *     const paragraphBlockSupportClassName = useSelect( ( select ) =>\n *         select( blocksStore ).hasBlockSupport( 'core/paragraph', 'className' ),\n *         []\n *     );\n *\n *     return (\n *         <p>\n *             { sprintf(\n *                 __( 'core/paragraph supports custom class name?: %s' ),\n *                 paragraphBlockSupportClassName\n *             ) }\n *         /p>\n *     );\n * };\n * ```\n *\n * @return Whether block supports feature.\n */\nexport function hasBlockSupport(\n\tstate: BlockStoreState,\n\tnameOrType: string | BlockType,\n\tfeature: string | string[],\n\tdefaultSupports?: unknown\n): boolean {\n\treturn !! getBlockSupport( state, nameOrType, feature, defaultSupports );\n}\n\n/**\n * Normalizes a search term string: removes accents, converts to lowercase, removes extra whitespace.\n *\n * @param term Search term to normalize.\n * @return Normalized search term.\n */\nfunction getNormalizedSearchTerm( term?: string | null ): string {\n\treturn removeAccents( term ?? '' )\n\t\t.toLowerCase()\n\t\t.trim();\n}\n\n/**\n * Returns true if the block type by the given name or object value matches a\n * search term, or false otherwise.\n *\n * @param state      Blocks state.\n * @param nameOrType Block name or type object.\n * @param searchTerm Search term by which to filter.\n *\n * @example\n * ```js\n * import { __, sprintf } from '@wordpress/i18n';\n * import { store as blocksStore } from '@wordpress/blocks';\n * import { useSelect } from '@wordpress/data';\n *\n * const ExampleComponent = () => {\n *     const termFound = useSelect(\n *         ( select ) =>\n *             select( blocksStore ).isMatchingSearchTerm(\n *                 'core/navigation',\n *                 'theme'\n *             ),\n *             []\n *         );\n *\n *     return (\n *         <p>\n *             { sprintf(\n *                 __(\n *                     'Search term was found in the title, keywords, category or description in block.json: %s'\n *                 ),\n *                 termFound\n *             ) }\n *         </p>\n *     );\n * };\n * ```\n *\n * @return Whether block type matches search term.\n */\nexport function isMatchingSearchTerm(\n\tstate: BlockStoreState,\n\tnameOrType: string | BlockType,\n\tsearchTerm: string = ''\n): boolean {\n\tconst blockType = getNormalizedBlockType( state, nameOrType );\n\tconst normalizedSearchTerm = getNormalizedSearchTerm( searchTerm );\n\n\tconst isSearchMatch = ( candidate?: string | null ): boolean =>\n\t\tgetNormalizedSearchTerm( candidate ).includes( normalizedSearchTerm );\n\n\treturn ( isSearchMatch( blockType?.title ) ||\n\t\tblockType?.keywords?.some( isSearchMatch ) ||\n\t\tisSearchMatch( blockType?.category ) ||\n\t\t( typeof blockType?.description === 'string' &&\n\t\t\tisSearchMatch( blockType.description ) ) ) as boolean;\n}\n\n/**\n * Returns a boolean indicating if a block has child blocks or not.\n *\n * @param state     Data state.\n * @param blockName Block type name.\n *\n * @example\n * ```js\n * import { __, sprintf } from '@wordpress/i18n';\n * import { store as blocksStore } from '@wordpress/blocks';\n * import { useSelect } from '@wordpress/data';\n *\n * const ExampleComponent = () => {\n *     const navigationBlockHasChildBlocks = useSelect( ( select ) =>\n *         select( blocksStore ).hasChildBlocks( 'core/navigation' ),\n *         []\n *     );\n *\n *     return (\n *         <p>\n *             { sprintf(\n *                 __( 'core/navigation has child blocks: %s' ),\n *                 navigationBlockHasChildBlocks\n *             ) }\n *         </p>\n *     );\n * };\n * ```\n *\n * @return True if a block contains child blocks and false otherwise.\n */\nexport const hasChildBlocks = (\n\tstate: BlockStoreState,\n\tblockName: string\n): boolean => {\n\treturn getChildBlockNames( state, blockName ).length > 0;\n};\n\n/**\n * Returns a boolean indicating if a block has at least one child block with inserter support.\n *\n * @param state     Data state.\n * @param blockName Block type name.\n *\n * @example\n * ```js\n * import { __, sprintf } from '@wordpress/i18n';\n * import { store as blocksStore } from '@wordpress/blocks';\n * import { useSelect } from '@wordpress/data';\n *\n * const ExampleComponent = () => {\n *     const navigationBlockHasChildBlocksWithInserterSupport = useSelect( ( select ) =>\n *         select( blocksStore ).hasChildBlocksWithInserterSupport(\n *             'core/navigation'\n *         ),\n *         []\n *     );\n *\n *     return (\n *         <p>\n *             { sprintf(\n *                 __( 'core/navigation has child blocks with inserter support: %s' ),\n *                 navigationBlockHasChildBlocksWithInserterSupport\n *             ) }\n *         </p>\n *     );\n * };\n * ```\n *\n * @return True if a block contains at least one child blocks with inserter support\n *                   and false otherwise.\n */\nexport const hasChildBlocksWithInserterSupport = (\n\tstate: BlockStoreState,\n\tblockName: string\n): boolean => {\n\treturn getChildBlockNames( state, blockName ).some( ( childBlockName ) => {\n\t\treturn hasBlockSupport( state, childBlockName, 'inserter', true );\n\t} );\n};\n\nexport const __experimentalHasContentRoleAttribute = (\n\t...args: Parameters< typeof privateHasContentRoleAttribute >\n): ReturnType< typeof privateHasContentRoleAttribute > => {\n\tdeprecated( '__experimentalHasContentRoleAttribute', {\n\t\tsince: '6.7',\n\t\tversion: '6.8',\n\t\thint: 'This is a private selector.',\n\t} );\n\treturn privateHasContentRoleAttribute( ...args );\n};\n"],
  "mapp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