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jC,CAIuC,GAExC,CAAE0N,EAAMjR,SAAUuD,IAsCnB,OACCsD,EAAAA,EAAAA,eAAC0N,EAAAA,cAAa,CAACT,MAAM,UACpBjN,EAAAA,EAAAA,eAAC2N,EAAAA,aAAY,MACZ3N,EAAAA,EAAAA,eAAC4N,EAAAA,cAAa,CACbvI,QAvCJ,WACC,MAAM,mBAAEiI,EAAkB,2BAAEC,GAC3BnT,EAASuB,OAAQC,EAAAA,QACV4R,GAAoBD,EAC3BnD,EAAMjR,SACN,cACA,GAGD,IAAOqU,EACN,OAGD,MAAMC,EAAYH,EAAoBE,GAAmB9D,GAEzD,IAAO+D,EAAUjV,eAAgBkE,GAChC,OAGD,MAAM,sBAAEmR,EAAqB,qCAAEC,GAC9B1T,EAASO,SAAUiB,EAAAA,OACpBkS,IAEA,IAAIC,EAAe,IAAKN,UACjBM,EAAcrR,GAEdzE,OAAO8E,KAAMgR,GAAe/Q,SAClC+Q,OAAexT,GAGhBsT,EAAuBL,EAAiB,CACvC,CAAE9D,GAAWqE,GAEf,EAOIC,UAAaX,EACbY,2BAAyB,IAEvBtN,EAAAA,EAAAA,IAAI,WAKX,ECnDCK,sBAAqB,EACrB3H,cAAa,EACbG,yBAAwB,EACxB0U,sB7BvCoC,c6BwCpCC,yB7BvCuC,CACvC,OACA,yBACA,8B6BqCA1U,mBAAkB,EAClBG,iCAAgCA,K","sources":["webpack://wp/webpack/bootstrap","webpack://wp/webpack/runtime/define property getters","webpack://wp/webpack/runtime/hasOwnProperty shorthand","webpack://wp/webpack/runtime/make namespace object","webpack://wp/external window [\"wp\",\"data\"]","../../packages/patterns/src/store/reducer.js","webpack://wp/external window [\"wp\",\"blocks\"]","webpack://wp/external window [\"wp\",\"coreData\"]","webpack://wp/external window [\"wp\",\"blockEditor\"]","../../packages/patterns/src/constants.js","../../packages/patterns/src/store/actions.js","../../packages/patterns/src/store/selectors.js","webpack://wp/external window [\"wp\",\"privateApis\"]","../../packages/patterns/src/lock-unlock.js","../../packages/patterns/src/store/index.js","../../packages/patterns/src/store/constants.js","webpack://wp/external window \"React\"","webpack://wp/external window [\"wp\",\"components\"]","webpack://wp/external window [\"wp\",\"element\"]","webpack://wp/external window [\"wp\",\"i18n\"]","../../packages/patterns/src/api/index.js","../../packages/patterns/src/components/overrides-panel.js","webpack://wp/external window [\"wp\",\"notices\"]","webpack://wp/external window [\"wp\",\"compose\"]","webpack://wp/external window [\"wp\",\"htmlEntities\"]","../../packages/patterns/src/components/category-selector.js","../../packages/patterns/src/private-hooks.js","../../packages/patterns/src/components/create-pattern-modal.js","../../packages/patterns/src/components/duplicate-pattern-modal.js","webpack://wp/external window [\"wp\",\"primitives\"]","../../packages/icons/src/library/symbol.js","../../packages/patterns/src/components/pattern-convert-button.js","webpack://wp/external window [\"wp\",\"url\"]","../../packages/patterns/src/components/patterns-manage-button.js","webpack://wp/external window [\"wp\",\"a11y\"]","../../packages/patterns/src/components/allow-overrides-modal.js","../../packages/patterns/src/components/pattern-overrides-controls.js","../../packages/patterns/src/components/reset-overrides-control.js","../../packages/patterns/src/private-apis.js","../../packages/patterns/src/components/rename-pattern-modal.js","../../packages/patterns/src/components/index.js","../../packages/patterns/src/components/rename-pattern-category-modal.js"],"sourcesContent":["// The require scope\nvar __webpack_require__ = {};\n\n","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"data\"];","/**\n * WordPress dependencies\n */\nimport { combineReducers } from '@wordpress/data';\n\nexport function isEditingPattern( state = {}, action ) {\n\tif ( action?.type === 'SET_EDITING_PATTERN' ) {\n\t\treturn {\n\t\t\t...state,\n\t\t\t[ action.clientId ]: action.isEditing,\n\t\t};\n\t}\n\n\treturn state;\n}\n\nexport default combineReducers( {\n\tisEditingPattern,\n} );\n","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"blocks\"];","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"coreData\"];","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"blockEditor\"];","export const PATTERN_TYPES = {\n\ttheme: 'pattern',\n\tuser: 'wp_block',\n};\n\nexport const PATTERN_DEFAULT_CATEGORY = 'all-patterns';\nexport const PATTERN_USER_CATEGORY = 'my-patterns';\nexport const EXCLUDED_PATTERN_SOURCES = [\n\t'core',\n\t'pattern-directory/core',\n\t'pattern-directory/featured',\n];\nexport const PATTERN_SYNC_TYPES = {\n\tfull: 'fully',\n\tunsynced: 'unsynced',\n};\n\n// TODO: This should not be hardcoded. Maybe there should be a config and/or an UI.\nexport const PARTIAL_SYNCING_SUPPORTED_BLOCKS = {\n\t'core/paragraph': [ 'content' ],\n\t'core/heading': [ 'content' ],\n\t'core/button': [ 'text', 'url', 'linkTarget', 'rel' ],\n\t'core/image': [ 'id', 'url', 'title', 'alt' ],\n};\n\nexport const PATTERN_OVERRIDES_BINDING_SOURCE = 'core/pattern-overrides';\n","/**\n * WordPress dependencies\n */\n\nimport { getBlockType, cloneBlock } from '@wordpress/blocks';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport { PATTERN_SYNC_TYPES } from '../constants';\n\n/**\n * Returns a generator converting one or more static blocks into a pattern, or creating a new empty pattern.\n *\n * @param {string} title Pattern title.\n * @param {'full'|'unsynced'} syncType They way block is synced, 'full' or 'unsynced'.\n * @param {string|undefined} [content] Optional serialized content of blocks to convert to pattern.\n * @param {number[]|undefined} [categories] Ids of any selected categories.\n */\nexport const createPattern =\n\t( title, syncType, content, categories ) =>\n\tasync ( { registry } ) => {\n\t\tconst meta =\n\t\t\tsyncType === PATTERN_SYNC_TYPES.unsynced\n\t\t\t\t? {\n\t\t\t\t\t\twp_pattern_sync_status: syncType,\n\t\t\t\t }\n\t\t\t\t: undefined;\n\n\t\tconst reusableBlock = {\n\t\t\ttitle,\n\t\t\tcontent,\n\t\t\tstatus: 'publish',\n\t\t\tmeta,\n\t\t\twp_pattern_category: categories,\n\t\t};\n\n\t\tconst updatedRecord = await registry\n\t\t\t.dispatch( coreStore )\n\t\t\t.saveEntityRecord( 'postType', 'wp_block', reusableBlock );\n\n\t\treturn updatedRecord;\n\t};\n\n/**\n * Create a pattern from a JSON file.\n * @param {File} file The JSON file instance of the pattern.\n * @param {number[]|undefined} [categories] Ids of any selected categories.\n */\nexport const createPatternFromFile =\n\t( file, categories ) =>\n\tasync ( { dispatch } ) => {\n\t\tconst fileContent = await file.text();\n\t\t/** @type {import('./types').PatternJSON} */\n\t\tlet parsedContent;\n\t\ttry {\n\t\t\tparsedContent = JSON.parse( fileContent );\n\t\t} catch ( e ) {\n\t\t\tthrow new Error( 'Invalid JSON file' );\n\t\t}\n\t\tif (\n\t\t\tparsedContent.__file !== 'wp_block' ||\n\t\t\t! parsedContent.title ||\n\t\t\t! parsedContent.content ||\n\t\t\ttypeof parsedContent.title !== 'string' ||\n\t\t\ttypeof parsedContent.content !== 'string' ||\n\t\t\t( parsedContent.syncStatus &&\n\t\t\t\ttypeof parsedContent.syncStatus !== 'string' )\n\t\t) {\n\t\t\tthrow new Error( 'Invalid pattern JSON file' );\n\t\t}\n\n\t\tconst pattern = await dispatch.createPattern(\n\t\t\tparsedContent.title,\n\t\t\tparsedContent.syncStatus,\n\t\t\tparsedContent.content,\n\t\t\tcategories\n\t\t);\n\n\t\treturn pattern;\n\t};\n\n/**\n * Returns a generator converting a synced pattern block into a static block.\n *\n * @param {string} clientId The client ID of the block to attach.\n */\nexport const convertSyncedPatternToStatic =\n\t( clientId ) =>\n\t( { registry } ) => {\n\t\tconst patternBlock = registry\n\t\t\t.select( blockEditorStore )\n\t\t\t.getBlock( clientId );\n\t\tconst existingOverrides = patternBlock.attributes?.content;\n\n\t\tfunction cloneBlocksAndRemoveBindings( blocks ) {\n\t\t\treturn blocks.map( ( block ) => {\n\t\t\t\tlet metadata = block.attributes.metadata;\n\t\t\t\tif ( metadata ) {\n\t\t\t\t\tmetadata = { ...metadata };\n\t\t\t\t\tdelete metadata.id;\n\t\t\t\t\tdelete metadata.bindings;\n\t\t\t\t\t// Use overriden values of the pattern block if they exist.\n\t\t\t\t\tif ( existingOverrides[ metadata.name ] ) {\n\t\t\t\t\t\t// Iterate over each overriden attribute.\n\t\t\t\t\t\tfor ( const [ attributeName, value ] of Object.entries(\n\t\t\t\t\t\t\texistingOverrides[ metadata.name ]\n\t\t\t\t\t\t) ) {\n\t\t\t\t\t\t\t// Skip if the attribute does not exist in the block type.\n\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\t! getBlockType( block.name )?.attributes[\n\t\t\t\t\t\t\t\t\tattributeName\n\t\t\t\t\t\t\t\t]\n\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t// Update the block attribute with the override value.\n\t\t\t\t\t\t\tblock.attributes[ attributeName ] = value;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn cloneBlock(\n\t\t\t\t\tblock,\n\t\t\t\t\t{\n\t\t\t\t\t\tmetadata:\n\t\t\t\t\t\t\tmetadata && Object.keys( metadata ).length > 0\n\t\t\t\t\t\t\t\t? metadata\n\t\t\t\t\t\t\t\t: undefined,\n\t\t\t\t\t},\n\t\t\t\t\tcloneBlocksAndRemoveBindings( block.innerBlocks )\n\t\t\t\t);\n\t\t\t} );\n\t\t}\n\n\t\tconst patternInnerBlocks = registry\n\t\t\t.select( blockEditorStore )\n\t\t\t.getBlocks( patternBlock.clientId );\n\n\t\tregistry\n\t\t\t.dispatch( blockEditorStore )\n\t\t\t.replaceBlocks(\n\t\t\t\tpatternBlock.clientId,\n\t\t\t\tcloneBlocksAndRemoveBindings( patternInnerBlocks )\n\t\t\t);\n\t};\n\n/**\n * Returns an action descriptor for SET_EDITING_PATTERN action.\n *\n * @param {string} clientId The clientID of the pattern to target.\n * @param {boolean} isEditing Whether the block should be in editing state.\n * @return {Object} Action descriptor.\n */\nexport function setEditingPattern( clientId, isEditing ) {\n\treturn {\n\t\ttype: 'SET_EDITING_PATTERN',\n\t\tclientId,\n\t\tisEditing,\n\t};\n}\n","/**\n * Returns true if pattern is in the editing state.\n *\n * @param {Object} state Global application state.\n * @param {number} clientId the clientID of the block.\n * @return {boolean} Whether the pattern is in the editing state.\n */\nexport function isEditingPattern( state, clientId ) {\n\treturn state.isEditingPattern[ clientId ];\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"privateApis\"];","/**\n * WordPress dependencies\n */\nimport { __dangerousOptInToUnstableAPIsOnlyForCoreModules } from '@wordpress/private-apis';\nexport const { lock, unlock } =\n\t__dangerousOptInToUnstableAPIsOnlyForCoreModules(\n\t\t'I know using unstable features means my theme or plugin will inevitably break in the next version of WordPress.',\n\t\t'@wordpress/patterns'\n\t);\n","/**\n * WordPress dependencies\n */\nimport { createReduxStore, register } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport reducer from './reducer';\nimport * as actions from './actions';\nimport { STORE_NAME } from './constants';\nimport * as selectors from './selectors';\nimport { unlock } from '../lock-unlock';\n\n/**\n * Post editor data store configuration.\n *\n * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/data/README.md#registerStore\n *\n * @type {Object}\n */\nexport const storeConfig = {\n\treducer,\n};\n\n/**\n * Store definition for the editor namespace.\n *\n * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/data/README.md#createReduxStore\n *\n * @type {Object}\n */\nexport const store = createReduxStore( STORE_NAME, {\n\t...storeConfig,\n} );\n\nregister( store );\nunlock( store ).registerPrivateActions( actions );\nunlock( store ).registerPrivateSelectors( selectors );\n","/**\n * Module Constants\n */\nexport const STORE_NAME = 'core/patterns';\n","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"React\"];","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"components\"];","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"element\"];","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"i18n\"];","/**\n * Internal dependencies\n */\nimport { PARTIAL_SYNCING_SUPPORTED_BLOCKS } from '../constants';\n\n/**\n * Determines whether a block is overridable.\n *\n * @param {WPBlock} block The block to test.\n *\n * @return {boolean} `true` if a block is overridable, `false` otherwise.\n */\nexport function isOverridableBlock( block ) {\n\treturn (\n\t\tObject.keys( PARTIAL_SYNCING_SUPPORTED_BLOCKS ).includes(\n\t\t\tblock.name\n\t\t) &&\n\t\t!! block.attributes.metadata?.name &&\n\t\t!! block.attributes.metadata?.bindings &&\n\t\tObject.values( block.attributes.metadata.bindings ).some(\n\t\t\t( binding ) => binding.source === 'core/pattern-overrides'\n\t\t)\n\t);\n}\n","/**\n * WordPress dependencies\n */\nimport {\n\tprivateApis as blockEditorPrivateApis,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport { PanelBody } from '@wordpress/components';\nimport { useSelect } from '@wordpress/data';\nimport { useMemo } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { isOverridableBlock } from '../api';\nimport { unlock } from '../lock-unlock';\n\nconst { BlockQuickNavigation } = unlock( blockEditorPrivateApis );\n\nexport default function OverridesPanel() {\n\tconst allClientIds = useSelect(\n\t\t( select ) => select( blockEditorStore ).getClientIdsWithDescendants(),\n\t\t[]\n\t);\n\tconst { getBlock } = useSelect( blockEditorStore );\n\tconst clientIdsWithOverrides = useMemo(\n\t\t() =>\n\t\t\tallClientIds.filter( ( clientId ) => {\n\t\t\t\tconst block = getBlock( clientId );\n\t\t\t\treturn isOverridableBlock( block );\n\t\t\t} ),\n\t\t[ allClientIds, getBlock ]\n\t);\n\n\tif ( ! clientIdsWithOverrides?.length ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t\n\t\t\t\n\t\t\n\t);\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"notices\"];","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"compose\"];","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"htmlEntities\"];","/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { useMemo, useState } from '@wordpress/element';\nimport { FormTokenField } from '@wordpress/components';\nimport { useDebounce } from '@wordpress/compose';\nimport { decodeEntities } from '@wordpress/html-entities';\n\nconst unescapeString = ( arg ) => {\n\treturn decodeEntities( arg );\n};\n\nexport const CATEGORY_SLUG = 'wp_pattern_category';\n\nexport default function CategorySelector( {\n\tcategoryTerms,\n\tonChange,\n\tcategoryMap,\n} ) {\n\tconst [ search, setSearch ] = useState( '' );\n\tconst debouncedSearch = useDebounce( setSearch, 500 );\n\n\tconst suggestions = useMemo( () => {\n\t\treturn Array.from( categoryMap.values() )\n\t\t\t.map( ( category ) => unescapeString( category.label ) )\n\t\t\t.filter( ( category ) => {\n\t\t\t\tif ( search !== '' ) {\n\t\t\t\t\treturn category\n\t\t\t\t\t\t.toLowerCase()\n\t\t\t\t\t\t.includes( search.toLowerCase() );\n\t\t\t\t}\n\t\t\t\treturn true;\n\t\t\t} )\n\t\t\t.sort( ( a, b ) => a.localeCompare( b ) );\n\t}, [ search, categoryMap ] );\n\n\tfunction handleChange( termNames ) {\n\t\tconst uniqueTerms = termNames.reduce( ( terms, newTerm ) => {\n\t\t\tif (\n\t\t\t\t! terms.some(\n\t\t\t\t\t( term ) => term.toLowerCase() === newTerm.toLowerCase()\n\t\t\t\t)\n\t\t\t) {\n\t\t\t\tterms.push( newTerm );\n\t\t\t}\n\t\t\treturn terms;\n\t\t}, [] );\n\n\t\tonChange( uniqueTerms );\n\t}\n\n\treturn (\n\t\t\n\t);\n}\n","/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useMemo } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { CATEGORY_SLUG } from './components/category-selector';\n\n/**\n * Helper hook that creates a Map with the core and user patterns categories\n * and removes any duplicates. It's used when we need to create new user\n * categories when creating or importing patterns.\n * This hook also provides a function to find or create a pattern category.\n *\n * @return {Object} The merged categories map and the callback function to find or create a category.\n */\nexport function useAddPatternCategory() {\n\tconst { saveEntityRecord, invalidateResolution } = useDispatch( coreStore );\n\tconst { corePatternCategories, userPatternCategories } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getUserPatternCategories, getBlockPatternCategories } =\n\t\t\t\tselect( coreStore );\n\n\t\t\treturn {\n\t\t\t\tcorePatternCategories: getBlockPatternCategories(),\n\t\t\t\tuserPatternCategories: getUserPatternCategories(),\n\t\t\t};\n\t\t},\n\t\t[]\n\t);\n\tconst categoryMap = useMemo( () => {\n\t\t// Merge the user and core pattern categories and remove any duplicates.\n\t\tconst uniqueCategories = new Map();\n\t\tuserPatternCategories.forEach( ( category ) => {\n\t\t\tuniqueCategories.set( category.label.toLowerCase(), {\n\t\t\t\tlabel: category.label,\n\t\t\t\tname: category.name,\n\t\t\t\tid: category.id,\n\t\t\t} );\n\t\t} );\n\n\t\tcorePatternCategories.forEach( ( category ) => {\n\t\t\tif (\n\t\t\t\t! uniqueCategories.has( category.label.toLowerCase() ) &&\n\t\t\t\t// There are two core categories with `Post` label so explicitly remove the one with\n\t\t\t\t// the `query` slug to avoid any confusion.\n\t\t\t\tcategory.name !== 'query'\n\t\t\t) {\n\t\t\t\tuniqueCategories.set( category.label.toLowerCase(), {\n\t\t\t\t\tlabel: category.label,\n\t\t\t\t\tname: category.name,\n\t\t\t\t} );\n\t\t\t}\n\t\t} );\n\t\treturn uniqueCategories;\n\t}, [ userPatternCategories, corePatternCategories ] );\n\n\tasync function findOrCreateTerm( term ) {\n\t\ttry {\n\t\t\tconst existingTerm = categoryMap.get( term.toLowerCase() );\n\t\t\tif ( existingTerm?.id ) {\n\t\t\t\treturn existingTerm.id;\n\t\t\t}\n\t\t\t// If we have an existing core category we need to match the new user category to the\n\t\t\t// correct slug rather than autogenerating it to prevent duplicates, eg. the core `Headers`\n\t\t\t// category uses the singular `header` as the slug.\n\t\t\tconst termData = existingTerm\n\t\t\t\t? { name: existingTerm.label, slug: existingTerm.name }\n\t\t\t\t: { name: term };\n\t\t\tconst newTerm = await saveEntityRecord(\n\t\t\t\t'taxonomy',\n\t\t\t\tCATEGORY_SLUG,\n\t\t\t\ttermData,\n\t\t\t\t{ throwOnError: true }\n\t\t\t);\n\t\t\tinvalidateResolution( 'getUserPatternCategories' );\n\t\t\treturn newTerm.id;\n\t\t} catch ( error ) {\n\t\t\tif ( error.code !== 'term_exists' ) {\n\t\t\t\tthrow error;\n\t\t\t}\n\t\t\treturn error.data.term_id;\n\t\t}\n\t}\n\n\treturn { categoryMap, findOrCreateTerm };\n}\n","/**\n * WordPress dependencies\n */\nimport {\n\tModal,\n\tButton,\n\tTextControl,\n\t__experimentalHStack as HStack,\n\t__experimentalVStack as VStack,\n\tToggleControl,\n} from '@wordpress/components';\nimport { __, _x } from '@wordpress/i18n';\nimport { useState } from '@wordpress/element';\nimport { useDispatch } from '@wordpress/data';\nimport { store as noticesStore } from '@wordpress/notices';\n\n/**\n * Internal dependencies\n */\nimport { PATTERN_DEFAULT_CATEGORY, PATTERN_SYNC_TYPES } from '../constants';\nimport { store as patternsStore } from '../store';\nimport CategorySelector from './category-selector';\nimport { useAddPatternCategory } from '../private-hooks';\nimport { unlock } from '../lock-unlock';\n\nexport default function CreatePatternModal( {\n\tclassName = 'patterns-menu-items__convert-modal',\n\tmodalTitle = __( 'Create pattern' ),\n\t...restProps\n} ) {\n\treturn (\n\t\t\n\t\t\t\n\t\t\n\t);\n}\n\nexport function CreatePatternModalContents( {\n\tconfirmLabel = __( 'Create' ),\n\tdefaultCategories = [],\n\tcontent,\n\tonClose,\n\tonError,\n\tonSuccess,\n\tdefaultSyncType = PATTERN_SYNC_TYPES.full,\n\tdefaultTitle = '',\n} ) {\n\tconst [ syncType, setSyncType ] = useState( defaultSyncType );\n\tconst [ categoryTerms, setCategoryTerms ] = useState( defaultCategories );\n\tconst [ title, setTitle ] = useState( defaultTitle );\n\n\tconst [ isSaving, setIsSaving ] = useState( false );\n\tconst { createPattern } = unlock( useDispatch( patternsStore ) );\n\tconst { createErrorNotice } = useDispatch( noticesStore );\n\n\tconst { categoryMap, findOrCreateTerm } = useAddPatternCategory();\n\n\tasync function onCreate( patternTitle, sync ) {\n\t\tif ( ! title || isSaving ) {\n\t\t\treturn;\n\t\t}\n\n\t\ttry {\n\t\t\tsetIsSaving( true );\n\t\t\tconst categories = await Promise.all(\n\t\t\t\tcategoryTerms.map( ( termName ) =>\n\t\t\t\t\tfindOrCreateTerm( termName )\n\t\t\t\t)\n\t\t\t);\n\n\t\t\tconst newPattern = await createPattern(\n\t\t\t\tpatternTitle,\n\t\t\t\tsync,\n\t\t\t\ttypeof content === 'function' ? content() : content,\n\t\t\t\tcategories\n\t\t\t);\n\t\t\tonSuccess( {\n\t\t\t\tpattern: newPattern,\n\t\t\t\tcategoryId: PATTERN_DEFAULT_CATEGORY,\n\t\t\t} );\n\t\t} catch ( error ) {\n\t\t\tcreateErrorNotice( error.message, {\n\t\t\t\ttype: 'snackbar',\n\t\t\t\tid: 'pattern-create',\n\t\t\t} );\n\t\t\tonError?.();\n\t\t} finally {\n\t\t\tsetIsSaving( false );\n\t\t\tsetCategoryTerms( [] );\n\t\t\tsetTitle( '' );\n\t\t}\n\t}\n\n\treturn (\n\t\t {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tonCreate( title, syncType );\n\t\t\t} }\n\t\t>\n\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t {\n\t\t\t\t\t\tsetSyncType(\n\t\t\t\t\t\t\tsyncType === PATTERN_SYNC_TYPES.full\n\t\t\t\t\t\t\t\t? PATTERN_SYNC_TYPES.unsynced\n\t\t\t\t\t\t\t\t: PATTERN_SYNC_TYPES.full\n\t\t\t\t\t\t);\n\t\t\t\t\t} }\n\t\t\t\t/>\n\t\t\t\t\n\t\t\t\t\t {\n\t\t\t\t\t\t\tonClose();\n\t\t\t\t\t\t\tsetTitle( '' );\n\t\t\t\t\t\t} }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Cancel' ) }\n\t\t\t\t\t\n\n\t\t\t\t\t\n\t\t\t\t\t\t{ confirmLabel }\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t\n\t);\n}\n","/**\n * WordPress dependencies\n */\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { store as noticesStore } from '@wordpress/notices';\n\n/**\n * Internal dependencies\n */\nimport CreatePatternModal from './create-pattern-modal';\nimport { PATTERN_SYNC_TYPES, PATTERN_TYPES } from '../constants';\n\nfunction getTermLabels( pattern, categories ) {\n\t// Theme patterns rely on core pattern categories.\n\tif ( pattern.type !== PATTERN_TYPES.user ) {\n\t\treturn categories.core\n\t\t\t?.filter( ( category ) =>\n\t\t\t\tpattern.categories.includes( category.name )\n\t\t\t)\n\t\t\t.map( ( category ) => category.label );\n\t}\n\n\treturn categories.user\n\t\t?.filter( ( category ) =>\n\t\t\tpattern.wp_pattern_category.includes( category.id )\n\t\t)\n\t\t.map( ( category ) => category.label );\n}\n\nexport function useDuplicatePatternProps( { pattern, onSuccess } ) {\n\tconst { createSuccessNotice } = useDispatch( noticesStore );\n\tconst categories = useSelect( ( select ) => {\n\t\tconst { getUserPatternCategories, getBlockPatternCategories } =\n\t\t\tselect( coreStore );\n\n\t\treturn {\n\t\t\tcore: getBlockPatternCategories(),\n\t\t\tuser: getUserPatternCategories(),\n\t\t};\n\t} );\n\tif ( ! pattern ) {\n\t\treturn null;\n\t}\n\treturn {\n\t\tcontent: pattern.content,\n\t\tdefaultCategories: getTermLabels( pattern, categories ),\n\t\tdefaultSyncType:\n\t\t\tpattern.type !== PATTERN_TYPES.user // Theme patterns are unsynced by default.\n\t\t\t\t? PATTERN_SYNC_TYPES.unsynced\n\t\t\t\t: pattern.wp_pattern_sync_status || PATTERN_SYNC_TYPES.full,\n\t\tdefaultTitle: sprintf(\n\t\t\t/* translators: %s: Existing pattern title */\n\t\t\t__( '%s (Copy)' ),\n\t\t\ttypeof pattern.title === 'string'\n\t\t\t\t? pattern.title\n\t\t\t\t: pattern.title.raw\n\t\t),\n\t\tonSuccess: ( { pattern: newPattern } ) => {\n\t\t\tcreateSuccessNotice(\n\t\t\t\tsprintf(\n\t\t\t\t\t// translators: %s: The new pattern's title e.g. 'Call to action (copy)'.\n\t\t\t\t\t__( '\"%s\" duplicated.' ),\n\t\t\t\t\tnewPattern.title.raw\n\t\t\t\t),\n\t\t\t\t{\n\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t\tid: 'patterns-create',\n\t\t\t\t}\n\t\t\t);\n\n\t\t\tonSuccess?.( { pattern: newPattern } );\n\t\t},\n\t};\n}\n\nexport default function DuplicatePatternModal( {\n\tpattern,\n\tonClose,\n\tonSuccess,\n} ) {\n\tconst duplicatedProps = useDuplicatePatternProps( { pattern, onSuccess } );\n\tif ( ! pattern ) {\n\t\treturn null;\n\t}\n\treturn (\n\t\t\n\t);\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"primitives\"];","/**\n * WordPress dependencies\n */\nimport { SVG, Path } from '@wordpress/primitives';\n\nconst symbol = (\n\t\n\t\t\n\t\n);\n\nexport default symbol;\n","/**\n * WordPress dependencies\n */\nimport {\n\thasBlockSupport,\n\tisReusableBlock,\n\tcreateBlock,\n\tserialize,\n} from '@wordpress/blocks';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { useState, useCallback } from '@wordpress/element';\nimport { MenuItem } from '@wordpress/components';\nimport { symbol } from '@wordpress/icons';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { store as noticesStore } from '@wordpress/notices';\n/**\n * Internal dependencies\n */\nimport { store as patternsStore } from '../store';\nimport CreatePatternModal from './create-pattern-modal';\nimport { unlock } from '../lock-unlock';\nimport { PATTERN_SYNC_TYPES } from '../constants';\n\n/**\n * Menu control to convert block(s) to a pattern block.\n *\n * @param {Object} props Component props.\n * @param {string[]} props.clientIds Client ids of selected blocks.\n * @param {string} props.rootClientId ID of the currently selected top-level block.\n * @param {()=>void} props.closeBlockSettingsMenu Callback to close the block settings menu dropdown.\n * @return {import('react').ComponentType} The menu control or null.\n */\nexport default function PatternConvertButton( {\n\tclientIds,\n\trootClientId,\n\tcloseBlockSettingsMenu,\n} ) {\n\tconst { createSuccessNotice } = useDispatch( noticesStore );\n\tconst { replaceBlocks } = useDispatch( blockEditorStore );\n\t// Ignore reason: false positive of the lint rule.\n\t// eslint-disable-next-line @wordpress/no-unused-vars-before-return\n\tconst { setEditingPattern } = unlock( useDispatch( patternsStore ) );\n\tconst [ isModalOpen, setIsModalOpen ] = useState( false );\n\tconst canConvert = useSelect(\n\t\t( select ) => {\n\t\t\tconst { canUser } = select( coreStore );\n\t\t\tconst {\n\t\t\t\tgetBlocksByClientId,\n\t\t\t\tcanInsertBlockType,\n\t\t\t\tgetBlockRootClientId,\n\t\t\t} = select( blockEditorStore );\n\n\t\t\tconst rootId =\n\t\t\t\trootClientId ||\n\t\t\t\t( clientIds.length > 0\n\t\t\t\t\t? getBlockRootClientId( clientIds[ 0 ] )\n\t\t\t\t\t: undefined );\n\n\t\t\tconst blocks = getBlocksByClientId( clientIds ) ?? [];\n\n\t\t\tconst isReusable =\n\t\t\t\tblocks.length === 1 &&\n\t\t\t\tblocks[ 0 ] &&\n\t\t\t\tisReusableBlock( blocks[ 0 ] ) &&\n\t\t\t\t!! select( coreStore ).getEntityRecord(\n\t\t\t\t\t'postType',\n\t\t\t\t\t'wp_block',\n\t\t\t\t\tblocks[ 0 ].attributes.ref\n\t\t\t\t);\n\n\t\t\tconst _canConvert =\n\t\t\t\t// Hide when this is already a synced pattern.\n\t\t\t\t! isReusable &&\n\t\t\t\t// Hide when patterns are disabled.\n\t\t\t\tcanInsertBlockType( 'core/block', rootId ) &&\n\t\t\t\tblocks.every(\n\t\t\t\t\t( block ) =>\n\t\t\t\t\t\t// Guard against the case where a regular block has *just* been converted.\n\t\t\t\t\t\t!! block &&\n\t\t\t\t\t\t// Hide on invalid blocks.\n\t\t\t\t\t\tblock.isValid &&\n\t\t\t\t\t\t// Hide when block doesn't support being made into a pattern.\n\t\t\t\t\t\thasBlockSupport( block.name, 'reusable', true )\n\t\t\t\t) &&\n\t\t\t\t// Hide when current doesn't have permission to do that.\n\t\t\t\t!! canUser( 'create', 'blocks' );\n\n\t\t\treturn _canConvert;\n\t\t},\n\t\t[ clientIds, rootClientId ]\n\t);\n\tconst { getBlocksByClientId } = useSelect( blockEditorStore );\n\tconst getContent = useCallback(\n\t\t() => serialize( getBlocksByClientId( clientIds ) ),\n\t\t[ getBlocksByClientId, clientIds ]\n\t);\n\n\tif ( ! canConvert ) {\n\t\treturn null;\n\t}\n\n\tconst handleSuccess = ( { pattern } ) => {\n\t\tif ( pattern.wp_pattern_sync_status !== PATTERN_SYNC_TYPES.unsynced ) {\n\t\t\tconst newBlock = createBlock( 'core/block', {\n\t\t\t\tref: pattern.id,\n\t\t\t} );\n\n\t\t\treplaceBlocks( clientIds, newBlock );\n\t\t\tsetEditingPattern( newBlock.clientId, true );\n\t\t\tcloseBlockSettingsMenu();\n\t\t}\n\n\t\tcreateSuccessNotice(\n\t\t\tpattern.wp_pattern_sync_status === PATTERN_SYNC_TYPES.unsynced\n\t\t\t\t? sprintf(\n\t\t\t\t\t\t// translators: %s: the name the user has given to the pattern.\n\t\t\t\t\t\t__( 'Unsynced pattern created: %s' ),\n\t\t\t\t\t\tpattern.title.raw\n\t\t\t\t )\n\t\t\t\t: sprintf(\n\t\t\t\t\t\t// translators: %s: the name the user has given to the pattern.\n\t\t\t\t\t\t__( 'Synced pattern created: %s' ),\n\t\t\t\t\t\tpattern.title.raw\n\t\t\t\t ),\n\t\t\t{\n\t\t\t\ttype: 'snackbar',\n\t\t\t\tid: 'convert-to-pattern-success',\n\t\t\t}\n\t\t);\n\t\tsetIsModalOpen( false );\n\t};\n\treturn (\n\t\t<>\n\t\t\t setIsModalOpen( true ) }\n\t\t\t\taria-expanded={ isModalOpen }\n\t\t\t\taria-haspopup=\"dialog\"\n\t\t\t>\n\t\t\t\t{ __( 'Create pattern' ) }\n\t\t\t\n\t\t\t{ isModalOpen && (\n\t\t\t\t {\n\t\t\t\t\t\thandleSuccess( pattern );\n\t\t\t\t\t} }\n\t\t\t\t\tonError={ () => {\n\t\t\t\t\t\tsetIsModalOpen( false );\n\t\t\t\t\t} }\n\t\t\t\t\tonClose={ () => {\n\t\t\t\t\t\tsetIsModalOpen( false );\n\t\t\t\t\t} }\n\t\t\t\t/>\n\t\t\t) }\n\t\t\n\t);\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"url\"];","/**\n * WordPress dependencies\n */\nimport { MenuItem } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { isReusableBlock } from '@wordpress/blocks';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { addQueryArgs } from '@wordpress/url';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { store as patternsStore } from '../store';\nimport { unlock } from '../lock-unlock';\n\nfunction PatternsManageButton( { clientId } ) {\n\tconst { canRemove, isVisible, managePatternsUrl } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getBlock, canRemoveBlock, getBlockCount } =\n\t\t\t\tselect( blockEditorStore );\n\t\t\tconst { canUser } = select( coreStore );\n\t\t\tconst reusableBlock = getBlock( clientId );\n\n\t\t\treturn {\n\t\t\t\tcanRemove: canRemoveBlock( clientId ),\n\t\t\t\tisVisible:\n\t\t\t\t\t!! reusableBlock &&\n\t\t\t\t\tisReusableBlock( reusableBlock ) &&\n\t\t\t\t\t!! canUser(\n\t\t\t\t\t\t'update',\n\t\t\t\t\t\t'blocks',\n\t\t\t\t\t\treusableBlock.attributes.ref\n\t\t\t\t\t),\n\t\t\t\tinnerBlockCount: getBlockCount( clientId ),\n\t\t\t\t// The site editor and templates both check whether the user\n\t\t\t\t// has edit_theme_options capabilities. We can leverage that here\n\t\t\t\t// and omit the manage patterns link if the user can't access it.\n\t\t\t\tmanagePatternsUrl: canUser( 'create', 'templates' )\n\t\t\t\t\t? addQueryArgs( 'site-editor.php', {\n\t\t\t\t\t\t\tpath: '/patterns',\n\t\t\t\t\t } )\n\t\t\t\t\t: addQueryArgs( 'edit.php', {\n\t\t\t\t\t\t\tpost_type: 'wp_block',\n\t\t\t\t\t } ),\n\t\t\t};\n\t\t},\n\t\t[ clientId ]\n\t);\n\n\t// Ignore reason: false positive of the lint rule.\n\t// eslint-disable-next-line @wordpress/no-unused-vars-before-return\n\tconst { convertSyncedPatternToStatic } = unlock(\n\t\tuseDispatch( patternsStore )\n\t);\n\n\tif ( ! isVisible ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t{ canRemove && (\n\t\t\t\t convertSyncedPatternToStatic( clientId ) }\n\t\t\t\t>\n\t\t\t\t\t{ __( 'Detach' ) }\n\t\t\t\t\n\t\t\t) }\n\t\t\t\n\t\t\t\t{ __( 'Manage patterns' ) }\n\t\t\t\n\t\t\n\t);\n}\n\nexport default PatternsManageButton;\n","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"a11y\"];","/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalHStack as HStack,\n\t__experimentalVStack as VStack,\n\tButton,\n\t__experimentalText as Text,\n\tTextControl,\n\tModal,\n} from '@wordpress/components';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { useState, useId } from '@wordpress/element';\nimport { speak } from '@wordpress/a11y';\n\nexport function AllowOverridesModal( {\n\tplaceholder,\n\tinitialName = '',\n\tonClose,\n\tonSave,\n} ) {\n\tconst [ editedBlockName, setEditedBlockName ] = useState( initialName );\n\tconst descriptionId = useId();\n\n\tconst isNameValid = !! editedBlockName.trim();\n\n\tconst handleSubmit = () => {\n\t\tif ( editedBlockName !== initialName ) {\n\t\t\tconst message = sprintf(\n\t\t\t\t/* translators: %s: new name/label for the block */\n\t\t\t\t__( 'Block name changed to: \"%s\".' ),\n\t\t\t\teditedBlockName\n\t\t\t);\n\n\t\t\t// Must be assertive to immediately announce change.\n\t\t\tspeak( message, 'assertive' );\n\t\t}\n\t\tonSave( editedBlockName );\n\n\t\t// Immediate close avoids ability to hit save multiple times.\n\t\tonClose();\n\t};\n\n\treturn (\n\t\t\n\t\t\t {\n\t\t\t\t\tevent.preventDefault();\n\n\t\t\t\t\tif ( ! isNameValid ) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\thandleSubmit();\n\t\t\t\t} }\n\t\t\t>\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t'Overrides are changes you make to a block within a synced pattern instance. Use overrides to customize a synced pattern instance to suit its new context. Name this block to specify an override.'\n\t\t\t\t\t\t) }\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t{ __( 'Cancel' ) }\n\t\t\t\t\t\t\n\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t{ __( 'Enable' ) }\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t\n\t);\n}\n\nexport function DisallowOverridesModal( { onClose, onSave } ) {\n\tconst descriptionId = useId();\n\n\treturn (\n\t\t\n\t\t\t {\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\tonSave();\n\t\t\t\t\tonClose();\n\t\t\t\t} }\n\t\t\t>\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t'Are you sure you want to disable overrides? Disabling overrides will revert all applied overrides for this block throughout instances of this pattern.'\n\t\t\t\t\t\t) }\n\t\t\t\t\t\n\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t{ __( 'Cancel' ) }\n\t\t\t\t\t\t\n\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t{ __( 'Disable' ) }\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t\n\t);\n}\n","/**\n * WordPress dependencies\n */\nimport { useState, useId } from '@wordpress/element';\nimport { InspectorControls } from '@wordpress/block-editor';\nimport { BaseControl, Button } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport {\n\tPARTIAL_SYNCING_SUPPORTED_BLOCKS,\n\tPATTERN_OVERRIDES_BINDING_SOURCE,\n} from '../constants';\nimport {\n\tAllowOverridesModal,\n\tDisallowOverridesModal,\n} from './allow-overrides-modal';\n\nfunction removeBindings( bindings, syncedAttributes ) {\n\tlet updatedBindings = {};\n\tfor ( const attributeName of syncedAttributes ) {\n\t\t// Omit any bindings that's not the same source from the `updatedBindings` object.\n\t\tif (\n\t\t\tbindings?.[ attributeName ]?.source !==\n\t\t\t\tPATTERN_OVERRIDES_BINDING_SOURCE &&\n\t\t\tbindings?.[ attributeName ]?.source !== undefined\n\t\t) {\n\t\t\tupdatedBindings[ attributeName ] = bindings[ attributeName ];\n\t\t}\n\t}\n\tif ( ! Object.keys( updatedBindings ).length ) {\n\t\tupdatedBindings = undefined;\n\t}\n\treturn updatedBindings;\n}\n\nfunction addBindings( bindings, syncedAttributes ) {\n\tconst updatedBindings = { ...bindings };\n\tfor ( const attributeName of syncedAttributes ) {\n\t\tif ( ! bindings?.[ attributeName ] ) {\n\t\t\tupdatedBindings[ attributeName ] = {\n\t\t\t\tsource: PATTERN_OVERRIDES_BINDING_SOURCE,\n\t\t\t};\n\t\t}\n\t}\n\treturn updatedBindings;\n}\n\nfunction PatternOverridesControls( { attributes, name, setAttributes } ) {\n\tconst controlId = useId();\n\tconst [ showAllowOverridesModal, setShowAllowOverridesModal ] =\n\t\tuseState( false );\n\tconst [ showDisallowOverridesModal, setShowDisallowOverridesModal ] =\n\t\tuseState( false );\n\n\tconst syncedAttributes = PARTIAL_SYNCING_SUPPORTED_BLOCKS[ name ];\n\tconst attributeSources = syncedAttributes.map(\n\t\t( attributeName ) =>\n\t\t\tattributes.metadata?.bindings?.[ attributeName ]?.source\n\t);\n\tconst isConnectedToOtherSources = attributeSources.every(\n\t\t( source ) => source && source !== 'core/pattern-overrides'\n\t);\n\n\tfunction updateBindings( isChecked, customName ) {\n\t\tconst prevBindings = attributes?.metadata?.bindings;\n\t\tconst updatedBindings = isChecked\n\t\t\t? addBindings( prevBindings, syncedAttributes )\n\t\t\t: removeBindings( prevBindings, syncedAttributes );\n\n\t\tconst updatedMetadata = {\n\t\t\t...attributes.metadata,\n\t\t\tbindings: updatedBindings,\n\t\t};\n\n\t\tif ( customName ) {\n\t\t\tupdatedMetadata.name = customName;\n\t\t}\n\n\t\tsetAttributes( {\n\t\t\tmetadata: updatedMetadata,\n\t\t} );\n\t}\n\n\t// Avoid overwriting other (e.g. meta) bindings.\n\tif ( isConnectedToOtherSources ) {\n\t\treturn null;\n\t}\n\n\tconst hasName = !! attributes.metadata?.name;\n\tconst allowOverrides =\n\t\thasName &&\n\t\tattributeSources.some(\n\t\t\t( source ) => source === PATTERN_OVERRIDES_BINDING_SOURCE\n\t\t);\n\n\treturn (\n\t\t<>\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t {\n\t\t\t\t\t\t\tif ( allowOverrides ) {\n\t\t\t\t\t\t\t\tsetShowDisallowOverridesModal( true );\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tsetShowAllowOverridesModal( true );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ allowOverrides\n\t\t\t\t\t\t\t? __( 'Disable overrides' )\n\t\t\t\t\t\t\t: __( 'Enable overrides' ) }\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\n\n\t\t\t{ showAllowOverridesModal && (\n\t\t\t\t setShowAllowOverridesModal( false ) }\n\t\t\t\t\tonSave={ ( newName ) => {\n\t\t\t\t\t\tupdateBindings( true, newName );\n\t\t\t\t\t} }\n\t\t\t\t/>\n\t\t\t) }\n\t\t\t{ showDisallowOverridesModal && (\n\t\t\t\t setShowDisallowOverridesModal( false ) }\n\t\t\t\t\tonSave={ () => updateBindings( false ) }\n\t\t\t\t/>\n\t\t\t) }\n\t\t\n\t);\n}\n\nexport default PatternOverridesControls;\n","/**\n * WordPress dependencies\n */\nimport {\n\tstore as blockEditorStore,\n\tBlockControls,\n} from '@wordpress/block-editor';\nimport { ToolbarButton, ToolbarGroup } from '@wordpress/components';\nimport { useRegistry, useSelect } from '@wordpress/data';\nimport { __ } from '@wordpress/i18n';\n\nconst CONTENT = 'content';\n\nexport default function ResetOverridesControl( props ) {\n\tconst name = props.attributes.metadata?.name;\n\tconst registry = useRegistry();\n\tconst isOverriden = useSelect(\n\t\t( select ) => {\n\t\t\tif ( ! name ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst { getBlockAttributes, getBlockParentsByBlockName } =\n\t\t\t\tselect( blockEditorStore );\n\t\t\tconst [ patternClientId ] = getBlockParentsByBlockName(\n\t\t\t\tprops.clientId,\n\t\t\t\t'core/block',\n\t\t\t\ttrue\n\t\t\t);\n\n\t\t\tif ( ! patternClientId ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst overrides = getBlockAttributes( patternClientId )[ CONTENT ];\n\n\t\t\tif ( ! overrides ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\treturn overrides.hasOwnProperty( name );\n\t\t},\n\t\t[ props.clientId, name ]\n\t);\n\n\tfunction onClick() {\n\t\tconst { getBlockAttributes, getBlockParentsByBlockName } =\n\t\t\tregistry.select( blockEditorStore );\n\t\tconst [ patternClientId ] = getBlockParentsByBlockName(\n\t\t\tprops.clientId,\n\t\t\t'core/block',\n\t\t\ttrue\n\t\t);\n\n\t\tif ( ! patternClientId ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst overrides = getBlockAttributes( patternClientId )[ CONTENT ];\n\n\t\tif ( ! overrides.hasOwnProperty( name ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst { updateBlockAttributes, __unstableMarkLastChangeAsPersistent } =\n\t\t\tregistry.dispatch( blockEditorStore );\n\t\t__unstableMarkLastChangeAsPersistent();\n\n\t\tlet newOverrides = { ...overrides };\n\t\tdelete newOverrides[ name ];\n\n\t\tif ( ! Object.keys( newOverrides ).length ) {\n\t\t\tnewOverrides = undefined;\n\t\t}\n\n\t\tupdateBlockAttributes( patternClientId, {\n\t\t\t[ CONTENT ]: newOverrides,\n\t\t} );\n\t}\n\n\treturn (\n\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t{ __( 'Reset' ) }\n\t\t\t\t\n\t\t\t\n\t\t\n\t);\n}\n","/**\n * Internal dependencies\n */\nimport { lock } from './lock-unlock';\nimport OverridesPanel from './components/overrides-panel';\nimport {\n\tdefault as CreatePatternModal,\n\tCreatePatternModalContents,\n} from './components/create-pattern-modal';\nimport {\n\tdefault as DuplicatePatternModal,\n\tuseDuplicatePatternProps,\n} from './components/duplicate-pattern-modal';\nimport { isOverridableBlock } from './api';\nimport RenamePatternModal from './components/rename-pattern-modal';\nimport PatternsMenuItems from './components';\nimport RenamePatternCategoryModal from './components/rename-pattern-category-modal';\nimport PatternOverridesControls from './components/pattern-overrides-controls';\nimport ResetOverridesControl from './components/reset-overrides-control';\nimport { useAddPatternCategory } from './private-hooks';\nimport {\n\tPATTERN_TYPES,\n\tPATTERN_DEFAULT_CATEGORY,\n\tPATTERN_USER_CATEGORY,\n\tEXCLUDED_PATTERN_SOURCES,\n\tPATTERN_SYNC_TYPES,\n\tPARTIAL_SYNCING_SUPPORTED_BLOCKS,\n} from './constants';\n\nexport const privateApis = {};\nlock( privateApis, {\n\tOverridesPanel,\n\tCreatePatternModal,\n\tCreatePatternModalContents,\n\tDuplicatePatternModal,\n\tisOverridableBlock,\n\tuseDuplicatePatternProps,\n\tRenamePatternModal,\n\tPatternsMenuItems,\n\tRenamePatternCategoryModal,\n\tPatternOverridesControls,\n\tResetOverridesControl,\n\tuseAddPatternCategory,\n\tPATTERN_TYPES,\n\tPATTERN_DEFAULT_CATEGORY,\n\tPATTERN_USER_CATEGORY,\n\tEXCLUDED_PATTERN_SOURCES,\n\tPATTERN_SYNC_TYPES,\n\tPARTIAL_SYNCING_SUPPORTED_BLOCKS,\n} );\n","/**\n * WordPress dependencies\n */\nimport {\n\tButton,\n\tModal,\n\tTextControl,\n\t__experimentalHStack as HStack,\n\t__experimentalVStack as VStack,\n} from '@wordpress/components';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useDispatch } from '@wordpress/data';\nimport { useState } from '@wordpress/element';\nimport { decodeEntities } from '@wordpress/html-entities';\nimport { __ } from '@wordpress/i18n';\nimport { store as noticesStore } from '@wordpress/notices';\n\nexport default function RenamePatternModal( {\n\tonClose,\n\tonError,\n\tonSuccess,\n\tpattern,\n\t...props\n} ) {\n\tconst originalName = decodeEntities( pattern.title );\n\tconst [ name, setName ] = useState( originalName );\n\tconst [ isSaving, setIsSaving ] = useState( false );\n\n\tconst {\n\t\teditEntityRecord,\n\t\t__experimentalSaveSpecifiedEntityEdits: saveSpecifiedEntityEdits,\n\t} = useDispatch( coreStore );\n\n\tconst { createSuccessNotice, createErrorNotice } =\n\t\tuseDispatch( noticesStore );\n\n\tconst onRename = async ( event ) => {\n\t\tevent.preventDefault();\n\n\t\tif ( ! name || name === pattern.title || isSaving ) {\n\t\t\treturn;\n\t\t}\n\n\t\ttry {\n\t\t\tawait editEntityRecord( 'postType', pattern.type, pattern.id, {\n\t\t\t\ttitle: name,\n\t\t\t} );\n\n\t\t\tsetIsSaving( true );\n\t\t\tsetName( '' );\n\t\t\tonClose?.();\n\n\t\t\tconst savedRecord = await saveSpecifiedEntityEdits(\n\t\t\t\t'postType',\n\t\t\t\tpattern.type,\n\t\t\t\tpattern.id,\n\t\t\t\t[ 'title' ],\n\t\t\t\t{ throwOnError: true }\n\t\t\t);\n\n\t\t\tonSuccess?.( savedRecord );\n\n\t\t\tcreateSuccessNotice( __( 'Pattern renamed' ), {\n\t\t\t\ttype: 'snackbar',\n\t\t\t\tid: 'pattern-update',\n\t\t\t} );\n\t\t} catch ( error ) {\n\t\t\tonError?.();\n\n\t\t\tconst errorMessage =\n\t\t\t\terror.message && error.code !== 'unknown_error'\n\t\t\t\t\t? error.message\n\t\t\t\t\t: __( 'An error occurred while renaming the pattern.' );\n\n\t\t\tcreateErrorNotice( errorMessage, {\n\t\t\t\ttype: 'snackbar',\n\t\t\t\tid: 'pattern-update',\n\t\t\t} );\n\t\t} finally {\n\t\t\tsetIsSaving( false );\n\t\t\tsetName( '' );\n\t\t}\n\t};\n\n\tconst onRequestClose = () => {\n\t\tonClose?.();\n\t\tsetName( '' );\n\t};\n\n\treturn (\n\t\t\n\t\t\t
\n\t\t\t\t\n\t\t\t\t\t\n\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t{ __( 'Cancel' ) }\n\t\t\t\t\t\t\n\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t{ __( 'Save' ) }\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t
\n\t\t
\n\t);\n}\n","/**\n * WordPress dependencies\n */\nimport { BlockSettingsMenuControls } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport PatternConvertButton from './pattern-convert-button';\nimport PatternsManageButton from './patterns-manage-button';\n\nexport default function PatternsMenuItems( { rootClientId } ) {\n\treturn (\n\t\t\n\t\t\t{ ( { selectedClientIds, onClose } ) => (\n\t\t\t\t<>\n\t\t\t\t\t\n\t\t\t\t\t{ selectedClientIds.length === 1 && (\n\t\t\t\t\t\t\n\t\t\t\t\t) }\n\t\t\t\t\n\t\t\t) }\n\t\t\n\t);\n}\n","/**\n * WordPress dependencies\n */\nimport {\n\tModal,\n\tButton,\n\tTextControl,\n\t__experimentalHStack as HStack,\n\t__experimentalVStack as VStack,\n} from '@wordpress/components';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useDispatch } from '@wordpress/data';\nimport { useId, useRef, useState } from '@wordpress/element';\nimport { decodeEntities } from '@wordpress/html-entities';\nimport { __ } from '@wordpress/i18n';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { speak } from '@wordpress/a11y';\n\n/**\n * Internal dependencies\n */\nimport { CATEGORY_SLUG } from './category-selector';\n\nexport default function RenamePatternCategoryModal( {\n\tcategory,\n\texistingCategories,\n\tonClose,\n\tonError,\n\tonSuccess,\n\t...props\n} ) {\n\tconst id = useId();\n\tconst textControlRef = useRef();\n\tconst [ name, setName ] = useState( decodeEntities( category.name ) );\n\tconst [ isSaving, setIsSaving ] = useState( false );\n\tconst [ validationMessage, setValidationMessage ] = useState( false );\n\tconst validationMessageId = validationMessage\n\t\t? `patterns-rename-pattern-category-modal__validation-message-${ id }`\n\t\t: undefined;\n\n\tconst { saveEntityRecord, invalidateResolution } = useDispatch( coreStore );\n\tconst { createErrorNotice, createSuccessNotice } =\n\t\tuseDispatch( noticesStore );\n\n\tconst onChange = ( newName ) => {\n\t\tif ( validationMessage ) {\n\t\t\tsetValidationMessage( undefined );\n\t\t}\n\t\tsetName( newName );\n\t};\n\n\tconst onSave = async ( event ) => {\n\t\tevent.preventDefault();\n\n\t\tif ( isSaving ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( ! name || name === category.name ) {\n\t\t\tconst message = __( 'Please enter a new name for this category.' );\n\t\t\tspeak( message, 'assertive' );\n\t\t\tsetValidationMessage( message );\n\t\t\ttextControlRef.current?.focus();\n\t\t\treturn;\n\t\t}\n\n\t\t// Check existing categories to avoid creating duplicates.\n\t\tif (\n\t\t\texistingCategories.patternCategories.find( ( existingCategory ) => {\n\t\t\t\t// Compare the id so that the we don't disallow the user changing the case of their current category\n\t\t\t\t// (i.e. renaming 'test' to 'Test').\n\t\t\t\treturn (\n\t\t\t\t\texistingCategory.id !== category.id &&\n\t\t\t\t\texistingCategory.label.toLowerCase() === name.toLowerCase()\n\t\t\t\t);\n\t\t\t} )\n\t\t) {\n\t\t\tconst message = __(\n\t\t\t\t'This category already exists. Please use a different name.'\n\t\t\t);\n\t\t\tspeak( message, 'assertive' );\n\t\t\tsetValidationMessage( message );\n\t\t\ttextControlRef.current?.focus();\n\t\t\treturn;\n\t\t}\n\n\t\ttry {\n\t\t\tsetIsSaving( true );\n\n\t\t\t// User pattern category properties may differ as they can be\n\t\t\t// normalized for use alongside template part areas, core pattern\n\t\t\t// categories etc. As a result we won't just destructure the passed\n\t\t\t// category object.\n\t\t\tconst savedRecord = await saveEntityRecord(\n\t\t\t\t'taxonomy',\n\t\t\t\tCATEGORY_SLUG,\n\t\t\t\t{\n\t\t\t\t\tid: category.id,\n\t\t\t\t\tslug: category.slug,\n\t\t\t\t\tname,\n\t\t\t\t}\n\t\t\t);\n\n\t\t\tinvalidateResolution( 'getUserPatternCategories' );\n\t\t\tonSuccess?.( savedRecord );\n\t\t\tonClose();\n\n\t\t\tcreateSuccessNotice( __( 'Pattern category renamed.' ), {\n\t\t\t\ttype: 'snackbar',\n\t\t\t\tid: 'pattern-category-update',\n\t\t\t} );\n\t\t} catch ( error ) {\n\t\t\tonError?.();\n\t\t\tcreateErrorNotice( error.message, {\n\t\t\t\ttype: 'snackbar',\n\t\t\t\tid: 'pattern-category-update',\n\t\t\t} );\n\t\t} finally {\n\t\t\tsetIsSaving( false );\n\t\t\tsetName( '' );\n\t\t}\n\t};\n\n\tconst onRequestClose = () => {\n\t\tonClose();\n\t\tsetName( '' );\n\t};\n\n\treturn (\n\t\t\n\t\t\t
\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t{ validationMessage && (\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t{ validationMessage }\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t) }\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t{ __( 'Cancel' ) }\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t{ __( 'Save' ) }\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t
\n\t\t\n\t);\n}\n"],"names":["__webpack_require__","exports","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","Symbol","toStringTag","value","window","combineReducers","isEditingPattern","state","action","type","clientId","isEditing","PATTERN_TYPES","theme","user","PATTERN_DEFAULT_CATEGORY","PATTERN_SYNC_TYPES","full","unsynced","PARTIAL_SYNCING_SUPPORTED_BLOCKS","PATTERN_OVERRIDES_BINDING_SOURCE","createPattern","title","syncType","content","categories","async","registry","meta","wp_pattern_sync_status","undefined","reusableBlock","status","wp_pattern_category","dispatch","coreStore","saveEntityRecord","createPatternFromFile","file","fileContent","text","parsedContent","JSON","parse","e","Error","__file","syncStatus","convertSyncedPatternToStatic","patternBlock","select","blockEditorStore","getBlock","existingOverrides","attributes","patternInnerBlocks","getBlocks","replaceBlocks","cloneBlocksAndRemoveBindings","blocks","map","block","metadata","id","bindings","name","attributeName","entries","getBlockType","cloneBlock","keys","length","innerBlocks","setEditingPattern","lock","unlock","__dangerousOptInToUnstableAPIsOnlyForCoreModules","storeConfig","reducer","store","createReduxStore","register","registerPrivateActions","actions","registerPrivateSelectors","selectors","isOverridableBlock","includes","values","some","binding","source","BlockQuickNavigation","blockEditorPrivateApis","unescapeString","arg","decodeEntities","CATEGORY_SLUG","CategorySelector","categoryTerms","onChange","categoryMap","search","setSearch","useState","debouncedSearch","useDebounce","suggestions","useMemo","Array","from","category","label","filter","toLowerCase","sort","a","b","localeCompare","createElement","FormTokenField","className","termNames","uniqueTerms","reduce","terms","newTerm","term","push","onInputChange","__","tokenizeOnBlur","__experimentalExpandOnFocus","__next40pxDefaultSize","__nextHasNoMarginBottom","useAddPatternCategory","invalidateResolution","useDispatch","corePatternCategories","userPatternCategories","useSelect","getUserPatternCategories","getBlockPatternCategories","uniqueCategories","Map","forEach","set","has","findOrCreateTerm","existingTerm","termData","slug","throwOnError","error","code","data","term_id","CreatePatternModal","modalTitle","restProps","Modal","onRequestClose","onClose","overlayClassName","CreatePatternModalContents","confirmLabel","defaultCategories","onError","onSuccess","defaultSyncType","defaultTitle","setSyncType","setCategoryTerms","setTitle","isSaving","setIsSaving","patternsStore","createErrorNotice","noticesStore","onSubmit","event","preventDefault","patternTitle","sync","Promise","all","termName","newPattern","pattern","categoryId","message","onCreate","VStack","spacing","TextControl","placeholder","ToggleControl","_x","help","checked","HStack","justify","Button","variant","onClick","isBusy","getTermLabels","core","useDuplicatePatternProps","createSuccessNotice","sprintf","raw","SVG","xmlns","viewBox","Path","d","PatternConvertButton","clientIds","rootClientId","closeBlockSettingsMenu","isModalOpen","setIsModalOpen","canConvert","_getBlocksByClientId","canUser","getBlocksByClientId","canInsertBlockType","getBlockRootClientId","rootId","isReusableBlock","getEntityRecord","ref","every","isValid","hasBlockSupport","getContent","useCallback","serialize","Fragment","MenuItem","icon","symbol","handleSuccess","newBlock","createBlock","canRemove","isVisible","managePatternsUrl","canRemoveBlock","getBlockCount","innerBlockCount","addQueryArgs","path","post_type","href","AllowOverridesModal","initialName","onSave","editedBlockName","setEditedBlockName","descriptionId","useId","isNameValid","trim","focusOnMount","aria","describedby","size","handleSubmit","speak","Text","DisallowOverridesModal","CONTENT","privateApis","OverridesPanel","allClientIds","getClientIdsWithDescendants","clientIdsWithOverrides","PanelBody","DuplicatePatternModal","duplicatedProps","RenamePatternModal","props","originalName","setName","editEntityRecord","__experimentalSaveSpecifiedEntityEdits","saveSpecifiedEntityEdits","savedRecord","errorMessage","required","PatternsMenuItems","BlockSettingsMenuControls","selectedClientIds","PatternsManageButton","RenamePatternCategoryModal","existingCategories","textControlRef","useRef","validationMessage","setValidationMessage","validationMessageId","current","focus","patternCategories","find","existingCategory","newName","PatternOverridesControls","setAttributes","controlId","showAllowOverridesModal","setShowAllowOverridesModal","showDisallowOverridesModal","setShowDisallowOverridesModal","syncedAttributes","attributeSources","updateBindings","isChecked","customName","prevBindings","updatedBindings","addBindings","removeBindings","updatedMetadata","allowOverrides","InspectorControls","group","BaseControl","ResetOverridesControl","useRegistry","isOverriden","getBlockAttributes","getBlockParentsByBlockName","patternClientId","overrides","BlockControls","ToolbarGroup","ToolbarButton","updateBlockAttributes","__unstableMarkLastChangeAsPersistent","newOverrides","disabled","__experimentalIsFocusable","PATTERN_USER_CATEGORY","EXCLUDED_PATTERN_SOURCES"],"sourceRoot":""}