{"version":3,"file":"reducer.mjs","names":["queriedDataReducer"],"sources":["../src/reducer.ts"],"sourcesContent":["import fastDeepEqual from 'fast-deep-equal/es6/index.js';\nimport { compose } from '@wordpress/compose';\nimport { combineReducers } from '@wordpress/data';\nimport { createUndoManager } from '@wordpress/undo-manager';\nimport type { UndoManager } from '@wordpress/undo-manager';\nimport type {\n\tConnectionStatus,\n\tConnectionStatusDisconnected,\n} from '@wordpress/sync';\nimport { clearUnchangedEdits, ifMatchingAction, replaceAction } from './utils';\nimport { reducer as queriedDataReducer } from './queried-data';\nimport { rootEntitiesConfig, DEFAULT_ENTITY_KEY } from './entities';\nimport { ConnectionErrorCode } from './sync';\nimport type * as ET from './entity-types';\nimport type { EntityActionsConfig, FieldsConfig } from './private-selectors';\nimport type { ItemId } from './queried-data/types';\nimport type {\n\tAction,\n\tEntitiesState,\n\tEntityRecordsState,\n\tKeyedEntityAction,\n\tUsersState,\n} from './private-types';\nimport type { EntityConfig } from './types';\n\n/**\n * Reducer managing authors state. Keyed by id.\n *\n * @param state  Current state.\n * @param action Dispatched action.\n *\n * @return Updated state.\n */\nexport function users(\n\tstate: UsersState = { byId: {}, queries: {} },\n\taction: Action\n) {\n\tswitch ( action.type ) {\n\t\tcase 'RECEIVE_USER_QUERY':\n\t\t\treturn {\n\t\t\t\tbyId: {\n\t\t\t\t\t...state.byId,\n\t\t\t\t\t// Key users by their ID.\n\t\t\t\t\t...action.users.reduce(\n\t\t\t\t\t\t( newUsers, user ) => ( {\n\t\t\t\t\t\t\t...newUsers,\n\t\t\t\t\t\t\t[ user.id ]: user,\n\t\t\t\t\t\t} ),\n\t\t\t\t\t\t{}\n\t\t\t\t\t),\n\t\t\t\t},\n\t\t\t\tqueries: {\n\t\t\t\t\t...state.queries,\n\t\t\t\t\t[ action.queryID ]: action.users.map( ( user ) => user.id ),\n\t\t\t\t},\n\t\t\t};\n\t}\n\n\treturn state;\n}\n\n/**\n * Reducer managing current user state.\n *\n * @param state  Current state.\n * @param action Dispatched action.\n *\n * @return Updated state.\n */\nexport function currentUser(\n\tstate: ET.User< 'view' > | Record< string, never > = {},\n\taction: Action\n) {\n\tswitch ( action.type ) {\n\t\tcase 'RECEIVE_CURRENT_USER':\n\t\t\treturn action.currentUser;\n\t}\n\n\treturn state;\n}\n\n/**\n * Reducer managing the current theme.\n *\n * @param state  Current state.\n * @param action Dispatched action.\n *\n * @return Updated state.\n */\nexport function currentTheme(\n\tstate: string | undefined = undefined,\n\taction: Action\n) {\n\tswitch ( action.type ) {\n\t\tcase 'RECEIVE_CURRENT_THEME':\n\t\t\treturn action.currentTheme.stylesheet;\n\t}\n\n\treturn state;\n}\n\n/**\n * Reducer managing the current global styles id.\n *\n * @param state  Current state.\n * @param action Dispatched action.\n *\n * @return Updated state.\n */\nexport function currentGlobalStylesId(\n\tstate: number | undefined = undefined,\n\taction: Action\n) {\n\tswitch ( action.type ) {\n\t\tcase 'RECEIVE_CURRENT_GLOBAL_STYLES_ID':\n\t\t\treturn action.id;\n\t}\n\n\treturn state;\n}\n\n/**\n * Reducer managing the theme base global styles.\n *\n * @param state  Current state.\n * @param action Dispatched action.\n *\n * @return Updated state.\n */\nexport function themeBaseGlobalStyles(\n\tstate: Record< string, object > = {},\n\taction: Action\n) {\n\tswitch ( action.type ) {\n\t\tcase 'RECEIVE_THEME_GLOBAL_STYLES':\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\t[ action.stylesheet ]: action.globalStyles,\n\t\t\t};\n\t}\n\n\treturn state;\n}\n\n/**\n * Reducer managing the theme global styles variations.\n *\n * @param state  Current state.\n * @param action Dispatched action.\n *\n * @return Updated state.\n */\nexport function themeGlobalStyleVariations(\n\tstate: Record< string, unknown > = {},\n\taction: Action\n) {\n\tswitch ( action.type ) {\n\t\tcase 'RECEIVE_THEME_GLOBAL_STYLE_VARIATIONS':\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\t[ action.stylesheet ]: action.variations,\n\t\t\t};\n\t}\n\n\treturn state;\n}\n\nconst withMultiEntityRecordEdits =\n\t(\n\t\treducer: (\n\t\t\tstate: EntityRecordsState | undefined,\n\t\t\taction: Action\n\t\t) => EntityRecordsState\n\t) =>\n\t( state: EntityRecordsState | undefined, action: Action ) => {\n\t\tif ( action.type === 'UNDO' || action.type === 'REDO' ) {\n\t\t\tconst { record } = action;\n\n\t\t\tlet newState = state;\n\t\t\trecord.forEach( ( { id, changes } ) => {\n\t\t\t\t// Entity undo levels are identified by their entity and record.\n\t\t\t\tconst { kind, name, recordId } = id as {\n\t\t\t\t\tkind: string;\n\t\t\t\t\tname: string;\n\t\t\t\t\trecordId: ItemId;\n\t\t\t\t};\n\t\t\t\tconst persistedRecord =\n\t\t\t\t\tstate?.queriedData?.items?.default?.[ recordId ];\n\t\t\t\tconst edits = Object.fromEntries(\n\t\t\t\t\tObject.entries( changes ).map( ( [ key, value ] ) => [\n\t\t\t\t\t\tkey,\n\t\t\t\t\t\taction.type === 'UNDO' ? value.from : value.to,\n\t\t\t\t\t] )\n\t\t\t\t);\n\n\t\t\t\tnewState = reducer( newState, {\n\t\t\t\t\ttype: 'EDIT_ENTITY_RECORD',\n\t\t\t\t\tkind,\n\t\t\t\t\tname,\n\t\t\t\t\trecordId,\n\t\t\t\t\t// Clear edits matching the persisted record so the entity is\n\t\t\t\t\t// no longer dirty after undoing back to its saved state.\n\t\t\t\t\tedits: clearUnchangedEdits( edits, persistedRecord ),\n\t\t\t\t} );\n\t\t\t} );\n\t\t\treturn newState;\n\t\t}\n\n\t\treturn reducer( state, action );\n\t};\n\n/**\n * Higher Order Reducer for a given entity config. It supports:\n *\n *  - Fetching\n *  - Editing\n *  - Saving\n *\n * @param entityConfig Entity config.\n *\n * @return Reducer.\n */\nfunction entity( entityConfig: EntityConfig ) {\n\t// `compose` returns an untyped function, cast to the reducer it builds.\n\treturn compose( [\n\t\twithMultiEntityRecordEdits,\n\n\t\t// Limit to matching action type so we don't attempt to replace action on\n\t\t// an unhandled action.\n\t\tifMatchingAction(\n\t\t\t( action: { kind?: string; name?: string } ) =>\n\t\t\t\taction.name &&\n\t\t\t\taction.kind &&\n\t\t\t\taction.name === entityConfig.name &&\n\t\t\t\taction.kind === entityConfig.kind\n\t\t),\n\n\t\t// Inject the entity config into the action.\n\t\treplaceAction( ( action: Action ): KeyedEntityAction => {\n\t\t\treturn {\n\t\t\t\tkey: entityConfig.key || DEFAULT_ENTITY_KEY,\n\t\t\t\t...action,\n\t\t\t};\n\t\t} ),\n\t] )(\n\t\tcombineReducers( {\n\t\t\tqueriedData: queriedDataReducer,\n\t\t\tedits: (\n\t\t\t\tstate: EntityRecordsState[ 'edits' ] = {},\n\t\t\t\taction: KeyedEntityAction\n\t\t\t) => {\n\t\t\t\tswitch ( action.type ) {\n\t\t\t\t\tcase 'RECEIVE_ITEMS':\n\t\t\t\t\t\tconst context = action?.query?.context ?? 'default';\n\t\t\t\t\t\tif ( context !== 'default' ) {\n\t\t\t\t\t\t\treturn state;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tconst nextState = { ...state };\n\t\t\t\t\t\tconst itemsList = Array.isArray( action.items )\n\t\t\t\t\t\t\t? action.items\n\t\t\t\t\t\t\t: [ action.items ];\n\n\t\t\t\t\t\tfor ( const record of itemsList ) {\n\t\t\t\t\t\t\t// Records are keyed by their ID.\n\t\t\t\t\t\t\tconst recordId = record?.[ action.key ] as ItemId;\n\t\t\t\t\t\t\tconst edits = nextState[ recordId ];\n\t\t\t\t\t\t\tif ( ! edits ) {\n\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tconst nextEdits = Object.keys( edits ).reduce<\n\t\t\t\t\t\t\t\tRecord< string, unknown >\n\t\t\t\t\t\t\t>( ( acc, key ) => {\n\t\t\t\t\t\t\t\t// If the edited value is still different to the persisted value,\n\t\t\t\t\t\t\t\t// keep the edited value in edits.\n\t\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\t\t// Edits are the \"raw\" attribute values, but records may have\n\t\t\t\t\t\t\t\t\t// objects with more properties, so we use `get` here for the\n\t\t\t\t\t\t\t\t\t// comparison.\n\t\t\t\t\t\t\t\t\t! fastDeepEqual(\n\t\t\t\t\t\t\t\t\t\tedits[ key ],\n\t\t\t\t\t\t\t\t\t\t// A raw attribute holds its value under `raw`.\n\t\t\t\t\t\t\t\t\t\t(\n\t\t\t\t\t\t\t\t\t\t\trecord[ key ] as\n\t\t\t\t\t\t\t\t\t\t\t\t{ raw?: unknown } | undefined\n\t\t\t\t\t\t\t\t\t\t )?.raw ?? record[ key ]\n\t\t\t\t\t\t\t\t\t) &&\n\t\t\t\t\t\t\t\t\t// Sometimes the server alters the sent value which means\n\t\t\t\t\t\t\t\t\t// we need to also remove the edits before the api request.\n\t\t\t\t\t\t\t\t\t( ! action.persistedEdits ||\n\t\t\t\t\t\t\t\t\t\t! fastDeepEqual(\n\t\t\t\t\t\t\t\t\t\t\tedits[ key ],\n\t\t\t\t\t\t\t\t\t\t\taction.persistedEdits[ key ]\n\t\t\t\t\t\t\t\t\t\t) )\n\t\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\t\tacc[ key ] = edits[ key ];\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\treturn acc;\n\t\t\t\t\t\t\t}, {} );\n\n\t\t\t\t\t\t\tif ( Object.keys( nextEdits ).length ) {\n\t\t\t\t\t\t\t\tnextState[ recordId ] = nextEdits;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tdelete nextState[ recordId ];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\treturn nextState;\n\n\t\t\t\t\tcase 'EDIT_ENTITY_RECORD':\n\t\t\t\t\t\tconst nextEdits = {\n\t\t\t\t\t\t\t// A keyless entity keeps its edits under the `undefined` key.\n\t\t\t\t\t\t\t...state[ action.recordId as ItemId ],\n\t\t\t\t\t\t\t...action.edits,\n\t\t\t\t\t\t};\n\t\t\t\t\t\tObject.keys( nextEdits ).forEach( ( key ) => {\n\t\t\t\t\t\t\t// Delete cleared edits so that the properties\n\t\t\t\t\t\t\t// are not considered dirty.\n\t\t\t\t\t\t\tif ( nextEdits[ key ] === undefined ) {\n\t\t\t\t\t\t\t\tdelete nextEdits[ key ];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} );\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t...state,\n\t\t\t\t\t\t\t// A keyless entity keeps its edits under the `undefined` key.\n\t\t\t\t\t\t\t[ action.recordId as ItemId ]: nextEdits,\n\t\t\t\t\t\t};\n\t\t\t\t}\n\n\t\t\t\treturn state;\n\t\t\t},\n\n\t\t\tsaving: (\n\t\t\t\tstate: EntityRecordsState[ 'saving' ] = {},\n\t\t\t\taction: KeyedEntityAction\n\t\t\t) => {\n\t\t\t\tswitch ( action.type ) {\n\t\t\t\t\tcase 'SAVE_ENTITY_RECORD_START':\n\t\t\t\t\tcase 'SAVE_ENTITY_RECORD_FINISH':\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t...state,\n\t\t\t\t\t\t\t// A new record saves under the `undefined` key.\n\t\t\t\t\t\t\t[ action.recordId as ItemId ]: {\n\t\t\t\t\t\t\t\tpending:\n\t\t\t\t\t\t\t\t\taction.type === 'SAVE_ENTITY_RECORD_START',\n\t\t\t\t\t\t\t\terror: action.error,\n\t\t\t\t\t\t\t\tisAutosave: action.isAutosave,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t};\n\t\t\t\t}\n\n\t\t\t\treturn state;\n\t\t\t},\n\n\t\t\tdeleting: (\n\t\t\t\tstate: EntityRecordsState[ 'deleting' ] = {},\n\t\t\t\taction: KeyedEntityAction\n\t\t\t) => {\n\t\t\t\tswitch ( action.type ) {\n\t\t\t\t\tcase 'DELETE_ENTITY_RECORD_START':\n\t\t\t\t\tcase 'DELETE_ENTITY_RECORD_FINISH':\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t...state,\n\t\t\t\t\t\t\t[ action.recordId ]: {\n\t\t\t\t\t\t\t\tpending:\n\t\t\t\t\t\t\t\t\taction.type ===\n\t\t\t\t\t\t\t\t\t'DELETE_ENTITY_RECORD_START',\n\t\t\t\t\t\t\t\terror: action.error,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t};\n\t\t\t\t}\n\n\t\t\t\treturn state;\n\t\t\t},\n\n\t\t\trevisions: (\n\t\t\t\tstate: EntityRecordsState[ 'revisions' ] = {},\n\t\t\t\taction: KeyedEntityAction\n\t\t\t) => {\n\t\t\t\t// Use the same queriedDataReducer shape for revisions.\n\t\t\t\tif ( action.type === 'RECEIVE_ITEM_REVISIONS' ) {\n\t\t\t\t\t// Revisions are received for a record.\n\t\t\t\t\tconst recordKey = action.recordKey as ItemId;\n\t\t\t\t\tdelete action.recordKey;\n\t\t\t\t\tconst newState = queriedDataReducer( state[ recordKey ], {\n\t\t\t\t\t\t...action,\n\t\t\t\t\t\ttype: 'RECEIVE_ITEMS',\n\t\t\t\t\t} );\n\t\t\t\t\treturn {\n\t\t\t\t\t\t...state,\n\t\t\t\t\t\t[ recordKey ]: newState,\n\t\t\t\t\t};\n\t\t\t\t}\n\n\t\t\t\tif ( action.type === 'REMOVE_ITEMS' ) {\n\t\t\t\t\treturn Object.fromEntries(\n\t\t\t\t\t\tObject.entries( state ).filter(\n\t\t\t\t\t\t\t( [ id ] ) =>\n\t\t\t\t\t\t\t\t! action.itemIds.some( ( itemId ) => {\n\t\t\t\t\t\t\t\t\tif ( Number.isInteger( itemId ) ) {\n\t\t\t\t\t\t\t\t\t\treturn itemId === +id;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\treturn itemId === id;\n\t\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}\n\n\t\t\t\treturn state;\n\t\t\t},\n\t\t} )\n\t) as (\n\t\tstate: EntityRecordsState | undefined,\n\t\taction: Action\n\t) => EntityRecordsState;\n}\n\n/**\n * Reducer keeping track of the registered entities.\n *\n * @param state  Current state.\n * @param action Dispatched action.\n *\n * @return Updated state.\n */\nexport function entitiesConfig(\n\tstate: Array< EntityConfig > = rootEntitiesConfig,\n\taction: Action\n) {\n\tswitch ( action.type ) {\n\t\tcase 'ADD_ENTITIES':\n\t\t\treturn [ ...state, ...action.entities ];\n\t}\n\n\treturn state;\n}\n\n/**\n * Reducer keeping track of the registered entities config and data.\n *\n * @param state  Current state.\n * @param action Dispatched action.\n *\n * @return Updated state.\n */\nexport const entities = (\n\tstate: EntitiesState = {},\n\taction: Action\n): Required< EntitiesState > => {\n\tconst newConfig = entitiesConfig( state.config, action );\n\n\t// Generates a reducer for the entities nested by `kind` and `name`.\n\t// A config array with shape:\n\t// ```\n\t// [\n\t//   { kind: 'taxonomy', name: 'category' },\n\t//   { kind: 'taxonomy', name: 'post_tag' },\n\t//   { kind: 'postType', name: 'post' },\n\t//   { kind: 'postType', name: 'page' },\n\t// ]\n\t// ```\n\t// generates a reducer for state tree with shape:\n\t// ```\n\t// {\n\t//   taxonomy: {\n\t//     category,\n\t//     post_tag,\n\t//   },\n\t//   postType: {\n\t//     post,\n\t//     page,\n\t//   },\n\t// }\n\t// ```\n\tlet entitiesDataReducer = state.reducer;\n\tif ( ! entitiesDataReducer || newConfig !== state.config ) {\n\t\tconst entitiesByKind = newConfig.reduce<\n\t\t\tRecord< string, Array< EntityConfig > >\n\t\t>( ( acc, record ) => {\n\t\t\tconst { kind } = record;\n\t\t\tif ( ! acc[ kind ] ) {\n\t\t\t\tacc[ kind ] = [];\n\t\t\t}\n\t\t\tacc[ kind ].push( record );\n\t\t\treturn acc;\n\t\t}, {} );\n\n\t\tentitiesDataReducer = combineReducers(\n\t\t\tObject.fromEntries(\n\t\t\t\tObject.entries( entitiesByKind ).map(\n\t\t\t\t\t( [ kind, subEntities ] ) => {\n\t\t\t\t\t\tconst kindReducer = combineReducers(\n\t\t\t\t\t\t\tObject.fromEntries(\n\t\t\t\t\t\t\t\tsubEntities.map( ( entityConfig ) => [\n\t\t\t\t\t\t\t\t\tentityConfig.name,\n\t\t\t\t\t\t\t\t\tentity( entityConfig ),\n\t\t\t\t\t\t\t\t] )\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\treturn [ kind, kindReducer ];\n\t\t\t\t\t}\n\t\t\t\t)\n\t\t\t)\n\t\t);\n\t}\n\n\tconst newData = entitiesDataReducer( state.records, action );\n\n\tif (\n\t\tnewData === state.records &&\n\t\tnewConfig === state.config &&\n\t\tentitiesDataReducer === state.reducer\n\t) {\n\t\t// Unchanged, so it already holds the reducer, records and config.\n\t\treturn state as Required< EntitiesState >;\n\t}\n\n\treturn {\n\t\treducer: entitiesDataReducer,\n\t\trecords: newData,\n\t\tconfig: newConfig,\n\t};\n};\n\nexport function undoManager(\n\tstate: UndoManager = createUndoManager()\n): UndoManager {\n\treturn state;\n}\n\n// The undo manager above is a mutable object, so changes to it do not change\n// state on their own. Entity edits, undo, and redo are store actions already.\n// A level the entity sync manager adds to it arrives outside of one, so this\n// reference changes then, and selectors reading the undo manager run again.\nexport function undoManagerReference(\n\tstate: Record< string, never > = {},\n\taction: Action\n) {\n\tswitch ( action.type ) {\n\t\tcase 'RECORD_SYNC_UNDO_LEVEL':\n\t\t\treturn {};\n\t}\n\treturn state;\n}\n\nexport function editsReference(\n\tstate: Record< string, never > = {},\n\taction: Action\n) {\n\tswitch ( action.type ) {\n\t\tcase 'EDIT_ENTITY_RECORD':\n\t\tcase 'UNDO':\n\t\tcase 'REDO':\n\t\t\treturn {};\n\t}\n\treturn state;\n}\n\n/**\n * Reducer managing embed preview data.\n *\n * @param state  Current state.\n * @param action Dispatched action.\n *\n * @return Updated state.\n */\nexport function embedPreviews(\n\tstate: Record< string, unknown > = {},\n\taction: Action\n) {\n\tswitch ( action.type ) {\n\t\tcase 'RECEIVE_EMBED_PREVIEW':\n\t\t\tconst { url, preview } = action;\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\t[ url ]: preview,\n\t\t\t};\n\t}\n\treturn state;\n}\n\n/**\n * State which tracks whether the user can perform an action on a REST\n * resource.\n *\n * @param state  Current state.\n * @param action Dispatched action.\n *\n * @return Updated state.\n */\nexport function userPermissions(\n\tstate: Record< string, boolean > = {},\n\taction: Action\n) {\n\tswitch ( action.type ) {\n\t\tcase 'RECEIVE_USER_PERMISSION':\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\t[ action.key ]: action.isAllowed,\n\t\t\t};\n\t\tcase 'RECEIVE_USER_PERMISSIONS':\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\t...action.permissions,\n\t\t\t};\n\t}\n\n\treturn state;\n}\n\n/**\n * Reducer returning autosaves keyed by their parent's post id.\n *\n * @param state  Current state.\n * @param action Dispatched action.\n *\n * @return Updated state.\n */\nexport function autosaves(\n\tstate: Record< ItemId, Array< unknown > > = {},\n\taction: Action\n) {\n\tswitch ( action.type ) {\n\t\tcase 'RECEIVE_AUTOSAVES':\n\t\t\tconst { postId, autosaves: autosavesData } = action;\n\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\t[ postId ]: autosavesData,\n\t\t\t};\n\t}\n\n\treturn state;\n}\n\nexport function blockPatterns( state: Array< unknown > = [], action: Action ) {\n\tswitch ( action.type ) {\n\t\tcase 'RECEIVE_BLOCK_PATTERNS':\n\t\t\treturn action.patterns;\n\t}\n\n\treturn state;\n}\n\nexport function blockPatternCategories(\n\tstate: Array< unknown > = [],\n\taction: Action\n) {\n\tswitch ( action.type ) {\n\t\tcase 'RECEIVE_BLOCK_PATTERN_CATEGORIES':\n\t\t\treturn action.categories;\n\t}\n\n\treturn state;\n}\n\nexport function userPatternCategories(\n\tstate: Array< unknown > = [],\n\taction: Action\n) {\n\tswitch ( action.type ) {\n\t\tcase 'RECEIVE_USER_PATTERN_CATEGORIES':\n\t\t\treturn action.patternCategories;\n\t}\n\treturn state;\n}\n\nexport function navigationFallbackId(\n\tstate: ItemId | null | undefined = null,\n\taction: Action\n) {\n\tswitch ( action.type ) {\n\t\tcase 'RECEIVE_NAVIGATION_FALLBACK_ID':\n\t\t\treturn action.fallbackId;\n\t}\n\n\treturn state;\n}\n\n/**\n * Reducer managing the theme global styles revisions.\n *\n * @param state  Current state.\n * @param action Dispatched action.\n *\n * @return Updated state.\n */\nexport function themeGlobalStyleRevisions(\n\tstate: Record< number, Array< object > > = {},\n\taction: Action\n) {\n\tswitch ( action.type ) {\n\t\tcase 'RECEIVE_THEME_GLOBAL_STYLE_REVISIONS':\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\t[ action.currentId ]: action.revisions,\n\t\t\t};\n\t}\n\n\treturn state;\n}\n\n/**\n * Reducer managing the template lookup per query.\n *\n * @param state  Current state.\n * @param action Dispatched action.\n *\n * @return Updated state.\n */\nexport function defaultTemplates(\n\tstate: Record< string, string > = {},\n\taction: Action\n) {\n\tswitch ( action.type ) {\n\t\tcase 'RECEIVE_DEFAULT_TEMPLATE':\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\t[ JSON.stringify( action.query ) ]: action.templateId,\n\t\t\t};\n\t}\n\n\treturn state;\n}\n\n/**\n * Reducer returning an object of registered post meta.\n *\n * @param state  Current state.\n * @param action Dispatched action.\n *\n * @return Updated state.\n */\nexport function registeredPostMeta(\n\tstate: Record< string, Record< string, unknown > | undefined > = {},\n\taction: Action\n) {\n\tswitch ( action.type ) {\n\t\tcase 'RECEIVE_REGISTERED_POST_META':\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\t[ action.postType ]: action.registeredPostMeta,\n\t\t\t};\n\t}\n\treturn state;\n}\n\n/**\n * Reducer managing editor settings.\n *\n * @param state  Current state.\n * @param action Action object.\n *\n * @return Updated state.\n */\nexport function editorSettings(\n\tstate: Record< string, unknown > | null = null,\n\taction: Action\n) {\n\tswitch ( action.type ) {\n\t\tcase 'RECEIVE_EDITOR_SETTINGS':\n\t\t\treturn action.settings;\n\t}\n\treturn state;\n}\n\n/**\n * Reducer managing editor assets.\n *\n * @param state  Current state.\n * @param action Action object.\n *\n * @return Updated state.\n */\nexport function editorAssets(\n\tstate: Record< string, unknown > | null = null,\n\taction: Action\n) {\n\tswitch ( action.type ) {\n\t\tcase 'RECEIVE_EDITOR_ASSETS':\n\t\t\treturn action.assets;\n\t}\n\treturn state;\n}\n\n/**\n * Reducer managing sync connection states for entities.\n * Keyed by \"kind/name:id\" (e.g., \"postType/post:123\").\n *\n * @param state  Current state.\n * @param action Dispatched action.\n *\n * @return Updated state.\n */\nexport function syncConnectionStatuses(\n\tstate: Record< string, ConnectionStatus > = {},\n\taction: Action\n) {\n\tswitch ( action.type ) {\n\t\tcase 'SET_SYNC_CONNECTION_STATUS': {\n\t\t\tconst key = `${ action.kind }/${ action.name }:${ action.key }`;\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\t[ key ]: action.status,\n\t\t\t};\n\t\t}\n\t\tcase 'CLEAR_SYNC_CONNECTION_STATUS': {\n\t\t\tconst key = `${ action.kind }/${ action.name }:${ action.key }`;\n\t\t\tconst { [ key ]: _, ...rest } = state;\n\t\t\treturn rest;\n\t\t}\n\t}\n\treturn state;\n}\n\n/**\n * Reducer managing whether collaboration is supported.\n *\n * Default to true, as collaboration is supported by default\n * unless explicitly disabled due to unsupported conditions\n * such as metaboxes.\n *\n * @param state  Current state.\n * @param action Dispatched action.\n *\n * @return Updated state.\n */\nexport function collaborationSupported( state = true, action: Action ) {\n\tswitch ( action.type ) {\n\t\tcase 'SET_COLLABORATION_SUPPORTED':\n\t\t\treturn action.supported;\n\n\t\tcase 'SET_SYNC_CONNECTION_STATUS':\n\t\t\tif (\n\t\t\t\tConnectionErrorCode.DOCUMENT_SIZE_LIMIT_EXCEEDED ===\n\t\t\t\t// Only a disconnected status has an error.\n\t\t\t\t( action.status as ConnectionStatusDisconnected )?.error?.code\n\t\t\t) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\treturn state;\n\t}\n\treturn state;\n}\n\n/**\n * Reducer managing view configs, keyed by `kind/name`.\n *\n * @param state  Current state.\n * @param action Dispatched action.\n *\n * @return Updated state.\n */\nexport function viewConfigs(\n\tstate: Record< string, Record< string, unknown > > = {},\n\taction: Action\n) {\n\tswitch ( action.type ) {\n\t\tcase 'RECEIVE_VIEW_CONFIG': {\n\t\t\tconst key = `${ action.kind }/${ action.name }`;\n\t\t\t// Merge so a partial (`_fields`) response doesn't clobber\n\t\t\t// properties already received for the same entity.\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\t[ key ]: {\n\t\t\t\t\t...state[ key ],\n\t\t\t\t\t...action.config,\n\t\t\t\t},\n\t\t\t};\n\t\t}\n\t}\n\treturn state;\n}\n\n/**\n * Reducer managing the fields configs, keyed by kind, then name.\n *\n * @param state  Current state.\n * @param action Dispatched action.\n *\n * @return Updated state.\n */\nexport function fieldsConfigs(\n\tstate: Record< string, Record< string, FieldsConfig > > = {},\n\taction: Action\n) {\n\tswitch ( action.type ) {\n\t\tcase 'RECEIVE_FIELDS_CONFIG':\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\t[ action.kind ]: {\n\t\t\t\t\t...state[ action.kind ],\n\t\t\t\t\t[ action.name ]: action.config,\n\t\t\t\t},\n\t\t\t};\n\t}\n\treturn state;\n}\n\n/**\n * Reducer managing the actions configs, keyed by kind, then name.\n *\n * @param state  Current state.\n * @param action Dispatched action.\n *\n * @return Updated state.\n */\nexport function entityActionsConfigs(\n\tstate: Record< string, Record< string, EntityActionsConfig > > = {},\n\taction: Action\n) {\n\tswitch ( action.type ) {\n\t\tcase 'RECEIVE_ENTITY_ACTIONS_CONFIG':\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\t[ action.kind ]: {\n\t\t\t\t\t...state[ action.kind ],\n\t\t\t\t\t[ action.name ]: action.config,\n\t\t\t\t},\n\t\t\t};\n\t}\n\treturn state;\n}\n\nexport default combineReducers( {\n\tusers,\n\tcurrentTheme,\n\tcurrentGlobalStylesId,\n\tcurrentUser,\n\tthemeGlobalStyleVariations,\n\tthemeBaseGlobalStyles,\n\tthemeGlobalStyleRevisions,\n\tentities,\n\teditsReference,\n\tundoManagerReference,\n\tundoManager,\n\tembedPreviews,\n\tuserPermissions,\n\tautosaves,\n\tblockPatterns,\n\tblockPatternCategories,\n\tuserPatternCategories,\n\tnavigationFallbackId,\n\tdefaultTemplates,\n\tregisteredPostMeta,\n\teditorSettings,\n\teditorAssets,\n\tsyncConnectionStatuses,\n\tcollaborationSupported,\n\tviewConfigs,\n\tfieldsConfigs,\n\tentityActionsConfigs,\n} );\n"],"mappings":";;;;;;;;;;;;;;;;;AAiCA,SAAgB,MACf,QAAoB;CAAE,MAAM,CAAC;CAAG,SAAS,CAAC;AAAE,GAC5C,QACC;CACD,QAAS,OAAO,MAAhB;EACC,KAAK,sBACJ,OAAO;GACN,MAAM;IACL,GAAG,MAAM;IAET,GAAG,OAAO,MAAM,QACb,UAAU,UAAY;KACvB,GAAG;MACD,KAAK,KAAM;IACd,IACA,CAAC,CACF;GACD;GACA,SAAS;IACR,GAAG,MAAM;KACP,OAAO,UAAW,OAAO,MAAM,KAAO,SAAU,KAAK,EAAG;GAC3D;EACD;CACF;CAEA,OAAO;AACR;;;;;;;;;AAUA,SAAgB,YACf,QAAqD,CAAC,GACtD,QACC;CACD,QAAS,OAAO,MAAhB;EACC,KAAK,wBACJ,OAAO,OAAO;CAChB;CAEA,OAAO;AACR;;;;;;;;;AAUA,SAAgB,aACf,QAA4B,KAAA,GAC5B,QACC;CACD,QAAS,OAAO,MAAhB;EACC,KAAK,yBACJ,OAAO,OAAO,aAAa;CAC7B;CAEA,OAAO;AACR;;;;;;;;;AAUA,SAAgB,sBACf,QAA4B,KAAA,GAC5B,QACC;CACD,QAAS,OAAO,MAAhB;EACC,KAAK,oCACJ,OAAO,OAAO;CAChB;CAEA,OAAO;AACR;;;;;;;;;AAUA,SAAgB,sBACf,QAAkC,CAAC,GACnC,QACC;CACD,QAAS,OAAO,MAAhB;EACC,KAAK,+BACJ,OAAO;GACN,GAAG;IACD,OAA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