WordPress/wp-includes/js/dist/core-data.min.js
isabel_brison 69e0187d65 Editor: update npm packages with critical bug fixes for 6.3.1.
Includes fixes for footnotes and editor styles related crashes, as well as a cut and paste-related crash.

Props ramonopoly.
See #59151.

Built from https://develop.svn.wordpress.org/trunk@56419


git-svn-id: http://core.svn.wordpress.org/trunk@55931 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-08-19 23:22:38 +00:00

2 lines
51 KiB
JavaScript

/*! This file is auto-generated */
(()=>{"use strict";var e={2167:e=>{function t(e){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},t(e)}function r(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function n(e,t){var r=e._map,n=e._arrayTreeMap,s=e._objectTreeMap;if(r.has(t))return r.get(t);for(var i=Object.keys(t).sort(),o=Array.isArray(t)?n:s,a=0;a<i.length;a++){var c=i[a];if(void 0===(o=o.get(c)))return;var u=t[c];if(void 0===(o=o.get(u)))return}var l=o.get("_ekm_value");return l?(r.delete(l[0]),l[0]=t,o.set("_ekm_value",l),r.set(t,l),l):void 0}var s=function(){function e(t){if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.clear(),t instanceof e){var r=[];t.forEach((function(e,t){r.push([t,e])})),t=r}if(null!=t)for(var n=0;n<t.length;n++)this.set(t[n][0],t[n][1])}var s,i,o;return s=e,i=[{key:"set",value:function(r,n){if(null===r||"object"!==t(r))return this._map.set(r,n),this;for(var s=Object.keys(r).sort(),i=[r,n],o=Array.isArray(r)?this._arrayTreeMap:this._objectTreeMap,a=0;a<s.length;a++){var c=s[a];o.has(c)||o.set(c,new e),o=o.get(c);var u=r[c];o.has(u)||o.set(u,new e),o=o.get(u)}var l=o.get("_ekm_value");return l&&this._map.delete(l[0]),o.set("_ekm_value",i),this._map.set(r,i),this}},{key:"get",value:function(e){if(null===e||"object"!==t(e))return this._map.get(e);var r=n(this,e);return r?r[1]:void 0}},{key:"has",value:function(e){return null===e||"object"!==t(e)?this._map.has(e):void 0!==n(this,e)}},{key:"delete",value:function(e){return!!this.has(e)&&(this.set(e,void 0),!0)}},{key:"forEach",value:function(e){var r=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this;this._map.forEach((function(s,i){null!==i&&"object"===t(i)&&(s=s[1]),e.call(n,s,i,r)}))}},{key:"clear",value:function(){this._map=new Map,this._arrayTreeMap=new Map,this._objectTreeMap=new Map}},{key:"size",get:function(){return this._map.size}}],i&&r(s.prototype,i),o&&r(s,o),e}();e.exports=s},5619:e=>{e.exports=function e(t,r){if(t===r)return!0;if(t&&r&&"object"==typeof t&&"object"==typeof r){if(t.constructor!==r.constructor)return!1;var n,s,i;if(Array.isArray(t)){if((n=t.length)!=r.length)return!1;for(s=n;0!=s--;)if(!e(t[s],r[s]))return!1;return!0}if(t instanceof Map&&r instanceof Map){if(t.size!==r.size)return!1;for(s of t.entries())if(!r.has(s[0]))return!1;for(s of t.entries())if(!e(s[1],r.get(s[0])))return!1;return!0}if(t instanceof Set&&r instanceof Set){if(t.size!==r.size)return!1;for(s of t.entries())if(!r.has(s[0]))return!1;return!0}if(ArrayBuffer.isView(t)&&ArrayBuffer.isView(r)){if((n=t.length)!=r.length)return!1;for(s=n;0!=s--;)if(t[s]!==r[s])return!1;return!0}if(t.constructor===RegExp)return t.source===r.source&&t.flags===r.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===r.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===r.toString();if((n=(i=Object.keys(t)).length)!==Object.keys(r).length)return!1;for(s=n;0!=s--;)if(!Object.prototype.hasOwnProperty.call(r,i[s]))return!1;for(s=n;0!=s--;){var o=i[s];if(!e(t[o],r[o]))return!1}return!0}return t!=t&&r!=r}}},t={};function r(n){var s=t[n];if(void 0!==s)return s.exports;var i=t[n]={exports:{}};return e[n](i,i.exports,r),i.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var n={};(()=>{r.r(n),r.d(n,{EntityProvider:()=>wr,__experimentalFetchLinkSuggestions:()=>Or,__experimentalFetchUrlData:()=>Cr,__experimentalUseEntityRecord:()=>Vr,__experimentalUseEntityRecords:()=>Gr,__experimentalUseResourcePermissions:()=>Br,store:()=>Yr,useEntityBlockEditor:()=>Sr,useEntityId:()=>kr,useEntityProp:()=>Tr,useEntityRecord:()=>Nr,useEntityRecords:()=>Mr,useResourcePermissions:()=>qr});var e={};r.r(e),r.d(e,{__experimentalBatch:()=>ue,__experimentalReceiveCurrentGlobalStylesId:()=>Z,__experimentalReceiveThemeBaseGlobalStyles:()=>J,__experimentalReceiveThemeGlobalStyleVariations:()=>X,__experimentalSaveSpecifiedEntityEdits:()=>de,__unstableCreateUndoLevel:()=>ae,addEntities:()=>z,deleteEntityRecord:()=>ne,editEntityRecord:()=>se,receiveAutosaves:()=>ye,receiveCurrentTheme:()=>W,receiveCurrentUser:()=>K,receiveEmbedPreview:()=>re,receiveEntityRecords:()=>H,receiveNavigationFallbackId:()=>Ee,receiveThemeGlobalStyleRevisions:()=>te,receiveThemeSupports:()=>ee,receiveUploadPermissions:()=>pe,receiveUserPermission:()=>fe,receiveUserQuery:()=>Y,redo:()=>oe,saveEditedEntityRecord:()=>le,saveEntityRecord:()=>ce,undo:()=>ie});var t={};r.r(t),r.d(t,{__experimentalGetCurrentGlobalStylesId:()=>_t,__experimentalGetCurrentThemeBaseGlobalStyles:()=>Ct,__experimentalGetCurrentThemeGlobalStylesVariations:()=>xt,__experimentalGetDirtyEntityRecords:()=>rt,__experimentalGetEntitiesBeingSaved:()=>nt,__experimentalGetEntityRecordNoResolver:()=>Je,__experimentalGetTemplateForLink:()=>At,canUser:()=>wt,canUserEditEntityRecord:()=>kt,getAuthors:()=>$e,getAutosave:()=>St,getAutosaves:()=>Tt,getBlockPatternCategories:()=>Lt,getBlockPatterns:()=>Ut,getCurrentTheme:()=>mt,getCurrentThemeGlobalStylesRevisions:()=>Pt,getCurrentUser:()=>Qe,getEditedEntityRecord:()=>at,getEmbedPreview:()=>bt,getEntitiesByKind:()=>Ke,getEntitiesConfig:()=>ze,getEntity:()=>He,getEntityConfig:()=>We,getEntityRecord:()=>Ze,getEntityRecordEdits:()=>st,getEntityRecordNonTransientEdits:()=>it,getEntityRecords:()=>tt,getLastEntityDeleteError:()=>pt,getLastEntitySaveError:()=>dt,getRawEntityRecord:()=>Xe,getRedoEdit:()=>Et,getReferenceByDistinctEdits:()=>Ot,getThemeSupports:()=>gt,getUndoEdit:()=>yt,getUserQueryResults:()=>Ye,hasEditsForEntityRecord:()=>ot,hasEntityRecords:()=>et,hasFetchedAutosaves:()=>It,hasRedo:()=>vt,hasUndo:()=>ht,isAutosavingEntityRecord:()=>ct,isDeletingEntityRecord:()=>lt,isPreviewEmbedFallback:()=>Rt,isRequestingEmbedPreview:()=>Fe,isSavingEntityRecord:()=>ut});var s={};r.r(s),r.d(s,{__experimentalGetCurrentGlobalStylesId:()=>Jt,__experimentalGetCurrentThemeBaseGlobalStyles:()=>Xt,__experimentalGetCurrentThemeGlobalStylesVariations:()=>er,__experimentalGetTemplateForLink:()=>Zt,canUser:()=>Kt,canUserEditEntityRecord:()=>zt,getAuthors:()=>Dt,getAutosave:()=>Wt,getAutosaves:()=>Ht,getBlockPatternCategories:()=>nr,getBlockPatterns:()=>rr,getCurrentTheme:()=>$t,getCurrentThemeGlobalStylesRevisions:()=>tr,getCurrentUser:()=>Mt,getEditedEntityRecord:()=>Bt,getEmbedPreview:()=>Yt,getEntityRecord:()=>Gt,getEntityRecords:()=>Ft,getNavigationFallbackId:()=>sr,getRawEntityRecord:()=>qt,getThemeSupports:()=>Qt});const i=window.wp.data;var o=r(5619),a=r.n(o);const c=window.wp.compose,u=window.wp.isShallowEqual;var l=r.n(u);const d=e=>t=>(r,n)=>void 0===r||e(n)?t(r,n):r,p=e=>t=>(r,n)=>t(r,e(n));const f=e=>t=>(r={},n)=>{const s=n[e];if(void 0===s)return r;const i=t(r[s],n);return i===r[s]?r:{...r,[s]:i}};var y=function(){return y=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var s in t=arguments[r])Object.prototype.hasOwnProperty.call(t,s)&&(e[s]=t[s]);return e},y.apply(this,arguments)};Object.create;Object.create;"function"==typeof SuppressedError&&SuppressedError;function E(e){return e.toLowerCase()}var h=[/([a-z0-9])([A-Z])/g,/([A-Z])([A-Z][a-z])/g],v=/[^A-Z0-9]+/gi;function m(e,t){void 0===t&&(t={});for(var r=t.splitRegexp,n=void 0===r?h:r,s=t.stripRegexp,i=void 0===s?v:s,o=t.transform,a=void 0===o?E:o,c=t.delimiter,u=void 0===c?" ":c,l=_(_(e,n,"$1\0$2"),i,"\0"),d=0,p=l.length;"\0"===l.charAt(d);)d++;for(;"\0"===l.charAt(p-1);)p--;return l.slice(d,p).split("\0").map(a).join(u)}function _(e,t,r){return t instanceof RegExp?e.replace(t,r):t.reduce((function(e,t){return e.replace(t,r)}),e)}function g(e){return function(e){return e.charAt(0).toUpperCase()+e.substr(1)}(e.toLowerCase())}function b(e,t){var r=e.charAt(0),n=e.substr(1).toLowerCase();return t>0&&r>="0"&&r<="9"?"_"+r+n:""+r.toUpperCase()+n}function R(e,t){return void 0===t&&(t={}),m(e,y({delimiter:"",transform:b},t))}const w=window.wp.apiFetch;var k=r.n(w);const T=window.wp.i18n;var S,I=new Uint8Array(16);function O(){if(!S&&!(S="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return S(I)}const A=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;const C=function(e){return"string"==typeof e&&A.test(e)};for(var x=[],U=0;U<256;++U)x.push((U+256).toString(16).substr(1));const L=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=(x[e[t+0]]+x[e[t+1]]+x[e[t+2]]+x[e[t+3]]+"-"+x[e[t+4]]+x[e[t+5]]+"-"+x[e[t+6]]+x[e[t+7]]+"-"+x[e[t+8]]+x[e[t+9]]+"-"+x[e[t+10]]+x[e[t+11]]+x[e[t+12]]+x[e[t+13]]+x[e[t+14]]+x[e[t+15]]).toLowerCase();if(!C(r))throw TypeError("Stringified UUID is invalid");return r};const P=function(e,t,r){var n=(e=e||{}).random||(e.rng||O)();if(n[6]=15&n[6]|64,n[8]=63&n[8]|128,t){r=r||0;for(var s=0;s<16;++s)t[r+s]=n[s];return t}return L(n)},j=window.wp.url,N=window.wp.deprecated;var V=r.n(N);function D(e,t){return{type:"RECEIVE_ITEMS",items:Array.isArray(e)?e:[e],persistedEdits:t}}let M=null;async function G(e){if(null===M){const e=await k()({path:"/batch/v1",method:"OPTIONS"});M=e.endpoints[0].args.requests.maxItems}const t=[];for(const r of function(e,t){const r=[...e],n=[];for(;r.length;)n.push(r.splice(0,t));return n}(e,M)){const e=await k()({path:"/batch/v1",method:"POST",data:{validation:"require-all-validate",requests:r.map((e=>({path:e.path,body:e.data,method:e.method,headers:e.headers})))}});let n;n=e.failed?e.responses.map((e=>({error:e?.body}))):e.responses.map((e=>{const t={};return e.status>=200&&e.status<300?t.output=e.body:t.error=e.body,t})),t.push(...n)}return t}function q(e=G){let t=0,r=[];const n=new B;return{add(e){const s=++t;n.add(s);const i=e=>new Promise(((t,i)=>{r.push({input:e,resolve:t,reject:i}),n.delete(s)}));return"function"==typeof e?Promise.resolve(e(i)).finally((()=>{n.delete(s)})):i(e)},async run(){let t;n.size&&await new Promise((e=>{const t=n.subscribe((()=>{n.size||(t(),e(void 0))}))}));try{if(t=await e(r.map((({input:e})=>e))),t.length!==r.length)throw new Error("run: Array returned by processor must be same size as input array.")}catch(e){for(const{reject:t}of r)t(e);throw e}let s=!0;return t.forEach(((e,t)=>{const n=r[t];var i;e?.error?(n?.reject(e.error),s=!1):n?.resolve(null!==(i=e?.output)&&void 0!==i?i:e)})),r=[],s}}}class B{constructor(...e){this.set=new Set(...e),this.subscribers=new Set}get size(){return this.set.size}add(e){return this.set.add(e),this.subscribers.forEach((e=>e())),this}delete(e){const t=this.set.delete(e);return this.subscribers.forEach((e=>e())),t}subscribe(e){return this.subscribers.add(e),()=>{this.subscribers.delete(e)}}}const F="core";function $(e){return e.undo.list[e.undo.list.length-1+e.undo.offset]}function Q(e){return e.undo.list[e.undo.list.length+e.undo.offset]}function Y(e,t){return{type:"RECEIVE_USER_QUERY",users:Array.isArray(t)?t:[t],queryID:e}}function K(e){return{type:"RECEIVE_CURRENT_USER",currentUser:e}}function z(e){return{type:"ADD_ENTITIES",entities:e}}function H(e,t,r,n,s=!1,i){let o;return"postType"===e&&(r=(Array.isArray(r)?r:[r]).map((e=>"auto-draft"===e.status?{...e,title:""}:e))),o=n?function(e,t={},r){return{...D(e,r),query:t}}(r,n,i):D(r,i),{...o,kind:e,name:t,invalidateCache:s}}function W(e){return{type:"RECEIVE_CURRENT_THEME",currentTheme:e}}function Z(e){return{type:"RECEIVE_CURRENT_GLOBAL_STYLES_ID",id:e}}function J(e,t){return{type:"RECEIVE_THEME_GLOBAL_STYLES",stylesheet:e,globalStyles:t}}function X(e,t){return{type:"RECEIVE_THEME_GLOBAL_STYLE_VARIATIONS",stylesheet:e,variations:t}}function ee(){return V()("wp.data.dispatch( 'core' ).receiveThemeSupports",{since:"5.9"}),{type:"DO_NOTHING"}}function te(e,t){return{type:"RECEIVE_THEME_GLOBAL_STYLE_REVISIONS",currentId:e,revisions:t}}function re(e,t){return{type:"RECEIVE_EMBED_PREVIEW",url:e,preview:t}}const ne=(e,t,r,n,{__unstableFetch:s=k(),throwOnError:i=!1}={})=>async({dispatch:o})=>{const a=(await o(Re(e))).find((r=>r.kind===e&&r.name===t));let c,u=!1;if(!a||a?.__experimentalNoFetch)return;const l=await o.__unstableAcquireStoreLock(F,["entities","records",e,t,r],{exclusive:!0});try{o({type:"DELETE_ENTITY_RECORD_START",kind:e,name:t,recordId:r});let l=!1;try{let i=`${a.baseURL}/${r}`;n&&(i=(0,j.addQueryArgs)(i,n)),u=await s({path:i,method:"DELETE"}),await o(function(e,t,r,n=!1){return{type:"REMOVE_ITEMS",itemIds:Array.isArray(r)?r:[r],kind:e,name:t,invalidateCache:n}}(e,t,r,!0))}catch(e){l=!0,c=e}if(o({type:"DELETE_ENTITY_RECORD_FINISH",kind:e,name:t,recordId:r,error:c}),l&&i)throw c;return u}finally{o.__unstableReleaseStoreLock(l)}},se=(e,t,r,n,s={})=>({select:i,dispatch:o})=>{const c=i.getEntityConfig(e,t);if(!c)throw new Error(`The entity being edited (${e}, ${t}) does not have a loaded config.`);const{mergedEdits:u={}}=c,l=i.getRawEntityRecord(e,t,r),d=i.getEditedEntityRecord(e,t,r),p={kind:e,name:t,recordId:r,edits:Object.keys(n).reduce(((e,t)=>{const r=l[t],s=d[t],i=u[t]?{...s,...n[t]}:n[t];return e[t]=a()(r,i)?void 0:i,e}),{})};o({type:"EDIT_ENTITY_RECORD",...p,meta:{undo:!s.undoIgnore&&{...p,edits:Object.keys(n).reduce(((e,t)=>(e[t]=d[t],e)),{}),isCached:s.isCached}}})},ie=()=>({select:e,dispatch:t})=>{const r=e((e=>$(e.root)));r&&t({type:"UNDO",stackedEdits:r})},oe=()=>({select:e,dispatch:t})=>{const r=e((e=>Q(e.root)));r&&t({type:"REDO",stackedEdits:r})};function ae(){return{type:"CREATE_UNDO_LEVEL"}}const ce=(e,t,r,{isAutosave:n=!1,__unstableFetch:s=k(),throwOnError:i=!1}={})=>async({select:o,resolveSelect:a,dispatch:c})=>{const u=(await c(Re(e))).find((r=>r.kind===e&&r.name===t));if(!u||u?.__experimentalNoFetch)return;const l=u.key||he,d=r[l],p=await c.__unstableAcquireStoreLock(F,["entities","records",e,t,d||P()],{exclusive:!0});try{for(const[n,s]of Object.entries(r))if("function"==typeof s){const i=s(o.getEditedEntityRecord(e,t,d));c.editEntityRecord(e,t,d,{[n]:i},{undoIgnore:!0}),r[n]=i}let l,p;c({type:"SAVE_ENTITY_RECORD_START",kind:e,name:t,recordId:d,isAutosave:n});let f=!1;try{const i=`${u.baseURL}${d?"/"+d:""}`,p=o.getRawEntityRecord(e,t,d);if(n){const n=o.getCurrentUser(),u=n?n.id:void 0,d=await a.getAutosave(p.type,p.id,u);let f={...p,...d,...r};if(f=Object.keys(f).reduce(((e,t)=>(["title","excerpt","content","meta"].includes(t)&&(e[t]=f[t]),e)),{status:"auto-draft"===f.status?"draft":f.status}),l=await s({path:`${i}/autosaves`,method:"POST",data:f}),p.id===l.id){let r={...p,...f,...l};r=Object.keys(r).reduce(((e,t)=>(["title","excerpt","content"].includes(t)?e[t]=r[t]:e[t]="status"===t?"auto-draft"===p.status&&"draft"===r.status?r.status:p.status:p[t],e)),{}),c.receiveEntityRecords(e,t,r,void 0,!0)}else c.receiveAutosaves(p.id,l)}else{let n=r;u.__unstablePrePersist&&(n={...n,...u.__unstablePrePersist(p,n)}),l=await s({path:i,method:d?"PUT":"POST",data:n}),c.receiveEntityRecords(e,t,l,void 0,!0,n)}}catch(e){f=!0,p=e}if(c({type:"SAVE_ENTITY_RECORD_FINISH",kind:e,name:t,recordId:d,error:p,isAutosave:n}),f&&i)throw p;return l}finally{c.__unstableReleaseStoreLock(p)}},ue=e=>async({dispatch:t})=>{const r=q(),n={saveEntityRecord:(e,n,s,i)=>r.add((r=>t.saveEntityRecord(e,n,s,{...i,__unstableFetch:r}))),saveEditedEntityRecord:(e,n,s,i)=>r.add((r=>t.saveEditedEntityRecord(e,n,s,{...i,__unstableFetch:r}))),deleteEntityRecord:(e,n,s,i,o)=>r.add((r=>t.deleteEntityRecord(e,n,s,i,{...o,__unstableFetch:r})))},s=e.map((e=>e(n))),[,...i]=await Promise.all([r.run(),...s]);return i},le=(e,t,r,n)=>async({select:s,dispatch:i})=>{if(!s.hasEditsForEntityRecord(e,t,r))return;const o=(await i(Re(e))).find((r=>r.kind===e&&r.name===t));if(!o)return;const a=o.key||he,c=s.getEntityRecordNonTransientEdits(e,t,r),u={[a]:r,...c};return await i.saveEntityRecord(e,t,u,n)},de=(e,t,r,n,s)=>async({select:i,dispatch:o})=>{if(!i.hasEditsForEntityRecord(e,t,r))return;const a=i.getEntityRecordNonTransientEdits(e,t,r),c={};for(const e in a)n.some((t=>t===e))&&(c[e]=a[e]);return await o.saveEntityRecord(e,t,c,s)};function pe(e){return V()("wp.data.dispatch( 'core' ).receiveUploadPermissions",{since:"5.9",alternative:"receiveUserPermission"}),fe("create/media",e)}function fe(e,t){return{type:"RECEIVE_USER_PERMISSION",key:e,isAllowed:t}}function ye(e,t){return{type:"RECEIVE_AUTOSAVES",postId:e,autosaves:Array.isArray(t)?t:[t]}}function Ee(e){return{type:"RECEIVE_NAVIGATION_FALLBACK_ID",fallbackId:e}}const he="id",ve=["title","excerpt","content"],me=[{label:(0,T.__)("Base"),kind:"root",name:"__unstableBase",baseURL:"/",baseURLParams:{_fields:["description","gmt_offset","home","name","site_icon","site_icon_url","site_logo","timezone_string","url"].join(",")}},{label:(0,T.__)("Site"),name:"site",kind:"root",baseURL:"/wp/v2/settings",getTitle:e=>{var t;return null!==(t=e?.title)&&void 0!==t?t:(0,T.__)("Site Title")}},{label:(0,T.__)("Post Type"),name:"postType",kind:"root",key:"slug",baseURL:"/wp/v2/types",baseURLParams:{context:"edit"}},{name:"media",kind:"root",baseURL:"/wp/v2/media",baseURLParams:{context:"edit"},plural:"mediaItems",label:(0,T.__)("Media"),rawAttributes:["caption","title","description"]},{name:"taxonomy",kind:"root",key:"slug",baseURL:"/wp/v2/taxonomies",baseURLParams:{context:"edit"},plural:"taxonomies",label:(0,T.__)("Taxonomy")},{name:"sidebar",kind:"root",baseURL:"/wp/v2/sidebars",baseURLParams:{context:"edit"},plural:"sidebars",transientEdits:{blocks:!0},label:(0,T.__)("Widget areas")},{name:"widget",kind:"root",baseURL:"/wp/v2/widgets",baseURLParams:{context:"edit"},plural:"widgets",transientEdits:{blocks:!0},label:(0,T.__)("Widgets")},{name:"widgetType",kind:"root",baseURL:"/wp/v2/widget-types",baseURLParams:{context:"edit"},plural:"widgetTypes",label:(0,T.__)("Widget types")},{label:(0,T.__)("User"),name:"user",kind:"root",baseURL:"/wp/v2/users",baseURLParams:{context:"edit"},plural:"users"},{name:"comment",kind:"root",baseURL:"/wp/v2/comments",baseURLParams:{context:"edit"},plural:"comments",label:(0,T.__)("Comment")},{name:"menu",kind:"root",baseURL:"/wp/v2/menus",baseURLParams:{context:"edit"},plural:"menus",label:(0,T.__)("Menu")},{name:"menuItem",kind:"root",baseURL:"/wp/v2/menu-items",baseURLParams:{context:"edit"},plural:"menuItems",label:(0,T.__)("Menu Item"),rawAttributes:["title"]},{name:"menuLocation",kind:"root",baseURL:"/wp/v2/menu-locations",baseURLParams:{context:"edit"},plural:"menuLocations",label:(0,T.__)("Menu Location"),key:"name"},{label:(0,T.__)("Global Styles"),name:"globalStyles",kind:"root",baseURL:"/wp/v2/global-styles",baseURLParams:{context:"edit"},plural:"globalStylesVariations",getTitle:e=>e?.title?.rendered||e?.title},{label:(0,T.__)("Themes"),name:"theme",kind:"root",baseURL:"/wp/v2/themes",baseURLParams:{context:"edit"},key:"stylesheet"},{label:(0,T.__)("Plugins"),name:"plugin",kind:"root",baseURL:"/wp/v2/plugins",baseURLParams:{context:"edit"},key:"plugin"}],_e=[{kind:"postType",loadEntities:async function(){const e=await k()({path:"/wp/v2/types?context=view"});return Object.entries(null!=e?e:{}).map((([e,t])=>{var r;const n=["wp_template","wp_template_part"].includes(e);return{kind:"postType",baseURL:`/${null!==(r=t?.rest_namespace)&&void 0!==r?r:"wp/v2"}/${t.rest_base}`,baseURLParams:{context:"edit"},name:e,label:t.name,transientEdits:{blocks:!0,selection:!0},mergedEdits:{meta:!0},rawAttributes:ve,getTitle:e=>{var t,r,s;return e?.title?.rendered||e?.title||(n?(r=null!==(t=e.slug)&&void 0!==t?t:"",void 0===s&&(s={}),m(r,y({delimiter:" ",transform:g},s))):String(e.id))},__unstablePrePersist:n?void 0:ge,__unstable_rest_base:t.rest_base}}))}},{kind:"taxonomy",loadEntities:async function(){const e=await k()({path:"/wp/v2/taxonomies?context=view"});return Object.entries(null!=e?e:{}).map((([e,t])=>{var r;return{kind:"taxonomy",baseURL:`/${null!==(r=t?.rest_namespace)&&void 0!==r?r:"wp/v2"}/${t.rest_base}`,baseURLParams:{context:"edit"},name:e,label:t.name}}))}}],ge=(e,t)=>{const r={};return"auto-draft"===e?.status&&(t.status||r.status||(r.status="draft"),t.title&&"Auto Draft"!==t.title||r.title||e?.title&&"Auto Draft"!==e?.title||(r.title="")),r};const be=(e,t,r="get",n=!1)=>{const s=me.find((r=>r.kind===e&&r.name===t)),i="root"===e?"":R(e),o=R(t)+(n?"s":"");return`${r}${i}${n&&"plural"in s&&s?.plural?R(s.plural):o}`},Re=e=>async({select:t,dispatch:r})=>{let n=t.getEntitiesConfig(e);if(n&&0!==n.length)return n;const s=_e.find((t=>t.kind===e));return s?(n=await s.loadEntities(),r(z(n)),n):[]};const we=function(e){return"string"==typeof e?e.split(","):Array.isArray(e)?e:null};const ke=function(e){const t=new WeakMap;return r=>{let n;return t.has(r)?n=t.get(r):(n=e(r),null!==r&&"object"==typeof r&&t.set(r,n)),n}}((function(e){const t={stableKey:"",page:1,perPage:10,fields:null,include:null,context:"default"},r=Object.keys(e).sort();for(let i=0;i<r.length;i++){const o=r[i];let a=e[o];switch(o){case"page":t[o]=Number(a);break;case"per_page":t.perPage=Number(a);break;case"context":t.context=a;break;default:var n,s;if("_fields"===o)t.fields=null!==(n=we(a))&&void 0!==n?n:[],a=t.fields.join();if("include"===o)"number"==typeof a&&(a=a.toString()),t.include=(null!==(s=we(a))&&void 0!==s?s:[]).map(Number),a=t.include.join();t.stableKey+=(t.stableKey?"&":"")+(0,j.addQueryArgs)("",{[o]:a}).slice(1)}}return t}));function Te(e){const{query:t}=e;if(!t)return"default";return ke(t).context}function Se(e,t){return Object.fromEntries(Object.entries(e).filter((([e])=>!t.some((t=>Number.isInteger(t)?t===+e:t===e)))))}const Ie=(0,c.compose)([d((e=>"query"in e)),p((e=>e.query?{...e,...ke(e.query)}:e)),f("context"),f("stableKey")])(((e=null,t)=>{const{type:r,page:n,perPage:s,key:i=he}=t;return"RECEIVE_ITEMS"!==r?e:function(e,t,r,n){var s;if(1===r&&-1===n)return t;const i=(r-1)*n,o=Math.max(null!==(s=e?.length)&&void 0!==s?s:0,i+t.length),a=new Array(o);for(let r=0;r<o;r++){const n=r>=i&&r<i+t.length;a[r]=n?t[r-i]:e?.[r]}return a}(e||[],t.items.map((e=>e[i])),n,s)})),Oe=(0,i.combineReducers)({items:function(e={},t){switch(t.type){case"RECEIVE_ITEMS":{const r=Te(t),n=t.key||he;return{...e,[r]:{...e[r],...t.items.reduce(((t,s)=>{const i=s[n];return t[i]=function(e,t){if(!e)return t;let r=!1;const n={};for(const s in t)a()(e[s],t[s])?n[s]=e[s]:(r=!0,n[s]=t[s]);if(!r)return e;for(const t in e)n.hasOwnProperty(t)||(n[t]=e[t]);return n}(e?.[r]?.[i],s),t}),{})}}}case"REMOVE_ITEMS":return Object.fromEntries(Object.entries(e).map((([e,r])=>[e,Se(r,t.itemIds)])))}return e},itemIsComplete:function(e={},t){switch(t.type){case"RECEIVE_ITEMS":{const r=Te(t),{query:n,key:s=he}=t,i=n?ke(n):{},o=!n||!Array.isArray(i.fields);return{...e,[r]:{...e[r],...t.items.reduce(((t,n)=>{const i=n[s];return t[i]=e?.[r]?.[i]||o,t}),{})}}}case"REMOVE_ITEMS":return Object.fromEntries(Object.entries(e).map((([e,r])=>[e,Se(r,t.itemIds)])))}return e},queries:(e={},t)=>{switch(t.type){case"RECEIVE_ITEMS":return Ie(e,t);case"REMOVE_ITEMS":const r=t.itemIds.reduce(((e,t)=>(e[t]=!0,e)),{});return Object.fromEntries(Object.entries(e).map((([e,t])=>[e,Object.fromEntries(Object.entries(t).map((([e,t])=>[e,t.filter((e=>!r[e]))])))])));default:return e}}});const Ae=e=>(t,r)=>{if("UNDO"===r.type||"REDO"===r.type){const{stackedEdits:n}=r;let s=t;return n.forEach((({kind:t,name:n,recordId:i,property:o,from:a,to:c})=>{s=e(s,{type:"EDIT_ENTITY_RECORD",kind:t,name:n,recordId:i,edits:{[o]:"UNDO"===r.type?a:c}})})),s}return e(t,r)};function Ce(e){return(0,c.compose)([Ae,d((t=>t.name&&t.kind&&t.name===e.name&&t.kind===e.kind)),p((t=>({...t,key:e.key||he})))])((0,i.combineReducers)({queriedData:Oe,edits:(e={},t)=>{var r;switch(t.type){case"RECEIVE_ITEMS":if("default"!==(null!==(r=t?.query?.context)&&void 0!==r?r:"default"))return e;const n={...e};for(const e of t.items){const r=e[t.key],s=n[r];if(!s)continue;const i=Object.keys(s).reduce(((r,n)=>{var i;return a()(s[n],null!==(i=e[n]?.raw)&&void 0!==i?i:e[n])||t.persistedEdits&&a()(s[n],t.persistedEdits[n])||(r[n]=s[n]),r}),{});Object.keys(i).length?n[r]=i:delete n[r]}return n;case"EDIT_ENTITY_RECORD":const s={...e[t.recordId],...t.edits};return Object.keys(s).forEach((e=>{void 0===s[e]&&delete s[e]})),{...e,[t.recordId]:s}}return e},saving:(e={},t)=>{switch(t.type){case"SAVE_ENTITY_RECORD_START":case"SAVE_ENTITY_RECORD_FINISH":return{...e,[t.recordId]:{pending:"SAVE_ENTITY_RECORD_START"===t.type,error:t.error,isAutosave:t.isAutosave}}}return e},deleting:(e={},t)=>{switch(t.type){case"DELETE_ENTITY_RECORD_START":case"DELETE_ENTITY_RECORD_FINISH":return{...e,[t.recordId]:{pending:"DELETE_ENTITY_RECORD_START"===t.type,error:t.error}}}return e}}))}const xe={list:[],offset:0};const Ue=(0,i.combineReducers)({terms:function(e={},t){return"RECEIVE_TERMS"===t.type?{...e,[t.taxonomy]:t.terms}:e},users:function(e={byId:{},queries:{}},t){return"RECEIVE_USER_QUERY"===t.type?{byId:{...e.byId,...t.users.reduce(((e,t)=>({...e,[t.id]:t})),{})},queries:{...e.queries,[t.queryID]:t.users.map((e=>e.id))}}:e},currentTheme:function(e=void 0,t){return"RECEIVE_CURRENT_THEME"===t.type?t.currentTheme.stylesheet:e},currentGlobalStylesId:function(e=void 0,t){return"RECEIVE_CURRENT_GLOBAL_STYLES_ID"===t.type?t.id:e},currentUser:function(e={},t){return"RECEIVE_CURRENT_USER"===t.type?t.currentUser:e},themeGlobalStyleVariations:function(e={},t){return"RECEIVE_THEME_GLOBAL_STYLE_VARIATIONS"===t.type?{...e,[t.stylesheet]:t.variations}:e},themeBaseGlobalStyles:function(e={},t){return"RECEIVE_THEME_GLOBAL_STYLES"===t.type?{...e,[t.stylesheet]:t.globalStyles}:e},themeGlobalStyleRevisions:function(e={},t){return"RECEIVE_THEME_GLOBAL_STYLE_REVISIONS"===t.type?{...e,[t.currentId]:t.revisions}:e},taxonomies:function(e=[],t){return"RECEIVE_TAXONOMIES"===t.type?t.taxonomies:e},entities:(e={},t)=>{const r=function(e=me,t){return"ADD_ENTITIES"===t.type?[...e,...t.entities]:e}(e.config,t);let n=e.reducer;if(!n||r!==e.config){const e=r.reduce(((e,t)=>{const{kind:r}=t;return e[r]||(e[r]=[]),e[r].push(t),e}),{});n=(0,i.combineReducers)(Object.entries(e).reduce(((e,[t,r])=>{const n=(0,i.combineReducers)(r.reduce(((e,t)=>({...e,[t.name]:Ce(t)})),{}));return e[t]=n,e}),{}))}const s=n(e.records,t);return s===e.records&&r===e.config&&n===e.reducer?e:{reducer:n,records:s,config:r}},undo:function(e=xe,t){const r=e=>({...e,list:e.list.slice(0,e.offset||void 0),offset:0}),n=e=>{if(!e.cache)return e;let t={...e,list:[...e.list]};t=r(t);const n=t.list.pop(),i=e.cache.reduce(s,n);return t.list.push(i),{...t,cache:void 0}},s=(e=[],{kind:t,name:r,recordId:n,property:s,from:i,to:o})=>{const a=e?.findIndex((({kind:e,name:i,recordId:o,property:a})=>e===t&&i===r&&o===n&&a===s)),c=[...e];return-1!==a?c[a]={...c[a],to:o}:c.push({kind:t,name:r,recordId:n,property:s,from:i,to:o}),c};switch(t.type){case"CREATE_UNDO_LEVEL":return n(e);case"UNDO":case"REDO":return{...n(e),offset:e.offset+("UNDO"===t.type?-1:1)};case"EDIT_ENTITY_RECORD":{if(!t.meta.undo)return e;const i=Object.keys(t.edits).map((e=>({kind:t.kind,name:t.name,recordId:t.recordId,property:e,from:t.meta.undo.edits[e],to:t.edits[e]})));if(t.meta.undo.isCached)return{...e,cache:i.reduce(s,e.cache)};let o=r(e);o=n(o),o={...o,list:[...o.list]};const a=Object.values(t.meta.undo.edits).filter((e=>"function"!=typeof e)),c=Object.values(t.edits).filter((e=>"function"!=typeof e));return l()(a,c)||o.list.push(i),o}}return e},embedPreviews:function(e={},t){if("RECEIVE_EMBED_PREVIEW"===t.type){const{url:r,preview:n}=t;return{...e,[r]:n}}return e},userPermissions:function(e={},t){return"RECEIVE_USER_PERMISSION"===t.type?{...e,[t.key]:t.isAllowed}:e},autosaves:function(e={},t){if("RECEIVE_AUTOSAVES"===t.type){const{postId:r,autosaves:n}=t;return{...e,[r]:n}}return e},blockPatterns:function(e=[],t){return"RECEIVE_BLOCK_PATTERNS"===t.type?t.patterns:e},blockPatternCategories:function(e=[],t){return"RECEIVE_BLOCK_PATTERN_CATEGORIES"===t.type?t.categories:e},navigationFallbackId:function(e=null,t){return"RECEIVE_NAVIGATION_FALLBACK_ID"===t.type?t.fallbackId:e}});var Le={};function Pe(e){return[e]}function je(e,t,r){var n;if(e.length!==t.length)return!1;for(n=r;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function Ne(e,t){var r,n=t||Pe;function s(){r=new WeakMap}function i(){var t,s,i,o,a,c=arguments.length;for(o=new Array(c),i=0;i<c;i++)o[i]=arguments[i];for(t=function(e){var t,n,s,i,o,a=r,c=!0;for(t=0;t<e.length;t++){if(!(o=n=e[t])||"object"!=typeof o){c=!1;break}a.has(n)?a=a.get(n):(s=new WeakMap,a.set(n,s),a=s)}return a.has(Le)||((i=function(){var e={clear:function(){e.head=null}};return e}()).isUniqueByDependants=c,a.set(Le,i)),a.get(Le)}(a=n.apply(null,o)),t.isUniqueByDependants||(t.lastDependants&&!je(a,t.lastDependants,0)&&t.clear(),t.lastDependants=a),s=t.head;s;){if(je(s.args,o,1))return s!==t.head&&(s.prev.next=s.next,s.next&&(s.next.prev=s.prev),s.next=t.head,s.prev=null,t.head.prev=s,t.head=s),s.val;s=s.next}return s={val:e.apply(null,o)},o[0]=null,s.args=o,t.head&&(t.head.prev=s,s.next=t.head),t.head=s,s.val}return i.getDependants=n,i.clear=s,s(),i}var Ve=r(2167),De=r.n(Ve);function Me(e,t,r){return e&&"object"==typeof e?(t.reduce(((e,n,s)=>(void 0===e[n]&&(Number.isInteger(t[s+1])?e[n]=[]:e[n]={}),s===t.length-1&&(e[n]=r),e[n])),e),e):e}const Ge=new WeakMap;const qe=Ne(((e,t={})=>{let r=Ge.get(e);if(r){const e=r.get(t);if(void 0!==e)return e}else r=new(De()),Ge.set(e,r);const n=function(e,t){const{stableKey:r,page:n,perPage:s,include:i,fields:o,context:a}=ke(t);let c;if(e.queries?.[a]?.[r]&&(c=e.queries[a][r]),!c)return null;const u=-1===s?0:(n-1)*s,l=-1===s?c.length:Math.min(u+s,c.length),d=[];for(let t=u;t<l;t++){const r=c[t];if(Array.isArray(i)&&!i.includes(r))continue;if(!e.items[a]?.hasOwnProperty(r))return null;const n=e.items[a][r];let s;if(Array.isArray(o)){s={};for(let e=0;e<o.length;e++){const t=o[e].split(".");let r=n;t.forEach((e=>{r=r[e]})),Me(s,t,r)}}else{if(!e.itemIsComplete[a]?.[r])return null;s=n}d.push(s)}return d}(e,t);return r.set(t,n),n}));const Be={},Fe=(0,i.createRegistrySelector)((e=>(t,r)=>e(F).isResolving("getEmbedPreview",[r])));function $e(e,t){V()("select( 'core' ).getAuthors()",{since:"5.9",alternative:"select( 'core' ).getUsers({ who: 'authors' })"});const r=(0,j.addQueryArgs)("/wp/v2/users/?who=authors&per_page=100",t);return Ye(e,r)}function Qe(e){return e.currentUser}const Ye=Ne(((e,t)=>{var r;return(null!==(r=e.users.queries[t])&&void 0!==r?r:[]).map((t=>e.users.byId[t]))}),((e,t)=>[e.users.queries[t],e.users.byId]));function Ke(e,t){return V()("wp.data.select( 'core' ).getEntitiesByKind()",{since:"6.0",alternative:"wp.data.select( 'core' ).getEntitiesConfig()"}),ze(e,t)}function ze(e,t){return e.entities.config.filter((e=>e.kind===t))}function He(e,t,r){return V()("wp.data.select( 'core' ).getEntity()",{since:"6.0",alternative:"wp.data.select( 'core' ).getEntityConfig()"}),We(e,t,r)}function We(e,t,r){return e.entities.config?.find((e=>e.kind===t&&e.name===r))}const Ze=Ne(((e,t,r,n,s)=>{var i;const o=e.entities.records?.[t]?.[r]?.queriedData;if(!o)return;const a=null!==(i=s?.context)&&void 0!==i?i:"default";if(void 0===s){if(!o.itemIsComplete[a]?.[n])return;return o.items[a][n]}const c=o.items[a]?.[n];if(c&&s._fields){var u;const e={},t=null!==(u=we(s._fields))&&void 0!==u?u:[];for(let r=0;r<t.length;r++){const n=t[r].split(".");let s=c;n.forEach((e=>{s=s[e]})),Me(e,n,s)}return e}return c}),((e,t,r,n,s)=>{var i;const o=null!==(i=s?.context)&&void 0!==i?i:"default";return[e.entities.records?.[t]?.[r]?.queriedData?.items[o]?.[n],e.entities.records?.[t]?.[r]?.queriedData?.itemIsComplete[o]?.[n]]}));function Je(e,t,r,n){return Ze(e,t,r,n)}const Xe=Ne(((e,t,r,n)=>{const s=Ze(e,t,r,n);return s&&Object.keys(s).reduce(((n,i)=>{var o;(function(e,t){return(e.rawAttributes||[]).includes(t)})(We(e,t,r),i)?n[i]=null!==(o=s[i]?.raw)&&void 0!==o?o:s[i]:n[i]=s[i];return n}),{})}),((e,t,r,n,s)=>{var i;const o=null!==(i=s?.context)&&void 0!==i?i:"default";return[e.entities.config,e.entities.records?.[t]?.[r]?.queriedData?.items[o]?.[n],e.entities.records?.[t]?.[r]?.queriedData?.itemIsComplete[o]?.[n]]}));function et(e,t,r,n){return Array.isArray(tt(e,t,r,n))}const tt=(e,t,r,n)=>{const s=e.entities.records?.[t]?.[r]?.queriedData;return s?qe(s,n):null},rt=Ne((e=>{const{entities:{records:t}}=e,r=[];return Object.keys(t).forEach((n=>{Object.keys(t[n]).forEach((s=>{const i=Object.keys(t[n][s].edits).filter((t=>Ze(e,n,s,t)&&ot(e,n,s,t)));if(i.length){const t=We(e,n,s);i.forEach((i=>{const o=at(e,n,s,i);r.push({key:o?o[t.key||he]:void 0,title:t?.getTitle?.(o)||"",name:s,kind:n})}))}}))})),r}),(e=>[e.entities.records])),nt=Ne((e=>{const{entities:{records:t}}=e,r=[];return Object.keys(t).forEach((n=>{Object.keys(t[n]).forEach((s=>{const i=Object.keys(t[n][s].saving).filter((t=>ut(e,n,s,t)));if(i.length){const t=We(e,n,s);i.forEach((i=>{const o=at(e,n,s,i);r.push({key:o?o[t.key||he]:void 0,title:t?.getTitle?.(o)||"",name:s,kind:n})}))}}))})),r}),(e=>[e.entities.records]));function st(e,t,r,n){return e.entities.records?.[t]?.[r]?.edits?.[n]}const it=Ne(((e,t,r,n)=>{const{transientEdits:s}=We(e,t,r)||{},i=st(e,t,r,n)||{};return s?Object.keys(i).reduce(((e,t)=>(s[t]||(e[t]=i[t]),e)),{}):i}),((e,t,r,n)=>[e.entities.config,e.entities.records?.[t]?.[r]?.edits?.[n]]));function ot(e,t,r,n){return ut(e,t,r,n)||Object.keys(it(e,t,r,n)).length>0}const at=Ne(((e,t,r,n)=>({...Xe(e,t,r,n),...st(e,t,r,n)})),((e,t,r,n,s)=>{var i;const o=null!==(i=s?.context)&&void 0!==i?i:"default";return[e.entities.config,e.entities.records?.[t]?.[r]?.queriedData.items[o]?.[n],e.entities.records?.[t]?.[r]?.queriedData.itemIsComplete[o]?.[n],e.entities.records?.[t]?.[r]?.edits?.[n]]}));function ct(e,t,r,n){var s;const{pending:i,isAutosave:o}=null!==(s=e.entities.records?.[t]?.[r]?.saving?.[n])&&void 0!==s?s:{};return Boolean(i&&o)}function ut(e,t,r,n){var s;return null!==(s=e.entities.records?.[t]?.[r]?.saving?.[n]?.pending)&&void 0!==s&&s}function lt(e,t,r,n){var s;return null!==(s=e.entities.records?.[t]?.[r]?.deleting?.[n]?.pending)&&void 0!==s&&s}function dt(e,t,r,n){return e.entities.records?.[t]?.[r]?.saving?.[n]?.error}function pt(e,t,r,n){return e.entities.records?.[t]?.[r]?.deleting?.[n]?.error}function ft(e){return e.undo.offset}function yt(e){return V()("select( 'core' ).getUndoEdit()",{since:"6.3"}),e.undo.list[e.undo.list.length-2+ft(e)]?.[0]}function Et(e){return V()("select( 'core' ).getRedoEdit()",{since:"6.3"}),e.undo.list[e.undo.list.length+ft(e)]?.[0]}function ht(e){return Boolean($(e))}function vt(e){return Boolean(Q(e))}function mt(e){return Ze(e,"root","theme",e.currentTheme)}function _t(e){return e.currentGlobalStylesId}function gt(e){var t;return null!==(t=mt(e)?.theme_supports)&&void 0!==t?t:Be}function bt(e,t){return e.embedPreviews[t]}function Rt(e,t){const r=e.embedPreviews[t],n='<a href="'+t+'">'+t+"</a>";return!!r&&r.html===n}function wt(e,t,r,n){const s=[t,r,n].filter(Boolean).join("/");return e.userPermissions[s]}function kt(e,t,r,n){const s=We(e,t,r);if(!s)return!1;return wt(e,"update",s.__unstable_rest_base,n)}function Tt(e,t,r){return e.autosaves[r]}function St(e,t,r,n){if(void 0===n)return;const s=e.autosaves[r];return s?.find((e=>e.author===n))}const It=(0,i.createRegistrySelector)((e=>(t,r,n)=>e(F).hasFinishedResolution("getAutosaves",[r,n]))),Ot=Ne((e=>[]),(e=>[e.undo.list.length,e.undo.offset]));function At(e,t){const r=tt(e,"postType","wp_template",{"find-template":t});return r?.length?at(e,"postType","wp_template",r[0].id):null}function Ct(e){const t=mt(e);return t?e.themeBaseGlobalStyles[t.stylesheet]:null}function xt(e){const t=mt(e);return t?e.themeGlobalStyleVariations[t.stylesheet]:null}function Ut(e){return e.blockPatterns}function Lt(e){return e.blockPatternCategories}function Pt(e){const t=_t(e);return t?e.themeGlobalStyleRevisions[t]:null}function jt(e,t){return 0===t?e.toLowerCase():b(e,t)}function Nt(e,t){return void 0===t&&(t={}),R(e,y({transform:jt},t))}const Vt=e=>(...t)=>async({resolveSelect:r})=>{await r[e](...t)},Dt=e=>async({dispatch:t})=>{const r=(0,j.addQueryArgs)("/wp/v2/users/?who=authors&per_page=100",e),n=await k()({path:r});t.receiveUserQuery(r,n)},Mt=()=>async({dispatch:e})=>{const t=await k()({path:"/wp/v2/users/me"});e.receiveCurrentUser(t)},Gt=(e,t,r="",n)=>async({select:s,dispatch:i})=>{const o=(await i(Re(e))).find((r=>r.name===t&&r.kind===e));if(!o||o?.__experimentalNoFetch)return;const a=await i.__unstableAcquireStoreLock(F,["entities","records",e,t,r],{exclusive:!1});try{void 0!==n&&n._fields&&(n={...n,_fields:[...new Set([...we(n._fields)||[],o.key||he])].join()});const a=(0,j.addQueryArgs)(o.baseURL+(r?"/"+r:""),{...o.baseURLParams,...n});if(void 0!==n){n={...n,include:[r]};if(s.hasEntityRecords(e,t,n))return}const c=await k()({path:a});i.receiveEntityRecords(e,t,c,n)}finally{i.__unstableReleaseStoreLock(a)}},qt=Vt("getEntityRecord"),Bt=Vt("getEntityRecord"),Ft=(e,t,r={})=>async({dispatch:n})=>{const s=(await n(Re(e))).find((r=>r.name===t&&r.kind===e));if(!s||s?.__experimentalNoFetch)return;const i=await n.__unstableAcquireStoreLock(F,["entities","records",e,t],{exclusive:!1});try{r._fields&&(r={...r,_fields:[...new Set([...we(r._fields)||[],s.key||he])].join()});const i=(0,j.addQueryArgs)(s.baseURL,{...s.baseURLParams,...r});let o=Object.values(await k()({path:i}));if(r._fields&&(o=o.map((e=>(r._fields.split(",").forEach((t=>{e.hasOwnProperty(t)||(e[t]=void 0)})),e)))),n.receiveEntityRecords(e,t,o,r),!r?._fields&&!r.context){const r=s.key||he,i=o.filter((e=>e[r])).map((n=>[e,t,n[r]]));n({type:"START_RESOLUTIONS",selectorName:"getEntityRecord",args:i}),n({type:"FINISH_RESOLUTIONS",selectorName:"getEntityRecord",args:i})}}finally{n.__unstableReleaseStoreLock(i)}};Ft.shouldInvalidate=(e,t,r)=>("RECEIVE_ITEMS"===e.type||"REMOVE_ITEMS"===e.type)&&e.invalidateCache&&t===e.kind&&r===e.name;const $t=()=>async({dispatch:e,resolveSelect:t})=>{const r=await t.getEntityRecords("root","theme",{status:"active"});e.receiveCurrentTheme(r[0])},Qt=Vt("getCurrentTheme"),Yt=e=>async({dispatch:t})=>{try{const r=await k()({path:(0,j.addQueryArgs)("/oembed/1.0/proxy",{url:e})});t.receiveEmbedPreview(e,r)}catch(r){t.receiveEmbedPreview(e,!1)}},Kt=(e,t,r)=>async({dispatch:n,registry:s})=>{const{hasStartedResolution:i}=s.select(F),o=r?`${t}/${r}`:t,a=["create","read","update","delete"];if(!a.includes(e))throw new Error(`'${e}' is not a valid action.`);for(const n of a){if(n===e)continue;if(i("canUser",[n,t,r]))return}let c;try{c=await k()({path:`/wp/v2/${o}`,method:"OPTIONS",parse:!1})}catch(e){return}const u=c.headers?.get("allow"),l=u?.allow||u||"",d={},p={create:"POST",read:"GET",update:"PUT",delete:"DELETE"};for(const[e,t]of Object.entries(p))d[e]=l.includes(t);for(const e of a)n.receiveUserPermission(`${e}/${o}`,d[e])},zt=(e,t,r)=>async({dispatch:n})=>{const s=(await n(Re(e))).find((r=>r.name===t&&r.kind===e));if(!s)return;const i=s.__unstable_rest_base;await n(Kt("update",i,r))},Ht=(e,t)=>async({dispatch:r,resolveSelect:n})=>{const{rest_base:s,rest_namespace:i="wp/v2"}=await n.getPostType(e),o=await k()({path:`/${i}/${s}/${t}/autosaves?context=edit`});o&&o.length&&r.receiveAutosaves(t,o)},Wt=(e,t)=>async({resolveSelect:r})=>{await r.getAutosaves(e,t)},Zt=e=>async({dispatch:t,resolveSelect:r})=>{let n;try{n=await k()({url:(0,j.addQueryArgs)(e,{"_wp-find-template":!0})}).then((({data:e})=>e))}catch(e){}if(!n)return;const s=await r.getEntityRecord("postType","wp_template",n.id);s&&t.receiveEntityRecords("postType","wp_template",[s],{"find-template":e})};Zt.shouldInvalidate=e=>("RECEIVE_ITEMS"===e.type||"REMOVE_ITEMS"===e.type)&&e.invalidateCache&&"postType"===e.kind&&"wp_template"===e.name;const Jt=()=>async({dispatch:e,resolveSelect:t})=>{const r=await t.getEntityRecords("root","theme",{status:"active"}),n=r?.[0]?._links?.["wp:user-global-styles"]?.[0]?.href;if(n){const t=await k()({url:n});e.__experimentalReceiveCurrentGlobalStylesId(t.id)}},Xt=()=>async({resolveSelect:e,dispatch:t})=>{const r=await e.getCurrentTheme(),n=await k()({path:`/wp/v2/global-styles/themes/${r.stylesheet}`});t.__experimentalReceiveThemeBaseGlobalStyles(r.stylesheet,n)},er=()=>async({resolveSelect:e,dispatch:t})=>{const r=await e.getCurrentTheme(),n=await k()({path:`/wp/v2/global-styles/themes/${r.stylesheet}/variations`});t.__experimentalReceiveThemeGlobalStyleVariations(r.stylesheet,n)},tr=()=>async({resolveSelect:e,dispatch:t})=>{const r=await e.__experimentalGetCurrentGlobalStylesId(),n=r?await e.getEntityRecord("root","globalStyles",r):void 0,s=n?._links?.["version-history"]?.[0]?.href;if(s){const e=await k()({url:s}),n=e?.map((e=>Object.fromEntries(Object.entries(e).map((([e,t])=>[Nt(e),t])))));t.receiveThemeGlobalStyleRevisions(r,n)}};tr.shouldInvalidate=e=>"SAVE_ENTITY_RECORD_FINISH"===e.type&&"root"===e.kind&&!e.error&&"globalStyles"===e.name;const rr=()=>async({dispatch:e})=>{const t=await k()({path:"/wp/v2/block-patterns/patterns"}),r=t?.map((e=>Object.fromEntries(Object.entries(e).map((([e,t])=>[Nt(e),t])))));e({type:"RECEIVE_BLOCK_PATTERNS",patterns:r})},nr=()=>async({dispatch:e})=>{e({type:"RECEIVE_BLOCK_PATTERN_CATEGORIES",categories:await k()({path:"/wp/v2/block-patterns/categories"})})},sr=()=>async({dispatch:e,select:t})=>{const r=await k()({path:(0,j.addQueryArgs)("/wp-block-editor/v1/navigation-fallback",{_embed:!0})}),n=r?._embedded?.self;if(e.receiveNavigationFallbackId(r?.id),n){const s=!t.getEntityRecord("postType","wp_navigation",r?.id);e.receiveEntityRecords("postType","wp_navigation",n,void 0,s),e.finishResolution("getEntityRecord",["postType","wp_navigation",r?.id])}};function ir(e,t){const r={...e};let n=r;for(const e of t)n.children={...n.children,[e]:{locks:[],children:{},...n.children[e]}},n=n.children[e];return r}function or(e,t){let r=e;for(const e of t){const t=r.children[e];if(!t)return null;r=t}return r}function ar({exclusive:e},t){return!(!e||!t.length)||!(e||!t.filter((e=>e.exclusive)).length)}const cr={requests:[],tree:{locks:[],children:{}}};function ur(e=cr,t){switch(t.type){case"ENQUEUE_LOCK_REQUEST":{const{request:r}=t;return{...e,requests:[r,...e.requests]}}case"GRANT_LOCK_REQUEST":{const{lock:r,request:n}=t,{store:s,path:i}=n,o=[s,...i],a=ir(e.tree,o),c=or(a,o);return c.locks=[...c.locks,r],{...e,requests:e.requests.filter((e=>e!==n)),tree:a}}case"RELEASE_LOCK":{const{lock:r}=t,n=[r.store,...r.path],s=ir(e.tree,n),i=or(s,n);return i.locks=i.locks.filter((e=>e!==r)),{...e,tree:s}}}return e}function lr(e,t,r,{exclusive:n}){const s=[t,...r],i=e.tree;for(const e of function*(e,t){let r=e;yield r;for(const e of t){const t=r.children[e];if(!t)break;yield t,r=t}}(i,s))if(ar({exclusive:n},e.locks))return!1;const o=or(i,s);if(!o)return!0;for(const e of function*(e){const t=Object.values(e.children);for(;t.length;){const e=t.pop();yield e,t.push(...Object.values(e.children))}}(o))if(ar({exclusive:n},e.locks))return!1;return!0}function dr(){let e=ur(void 0,{type:"@@INIT"});function t(){for(const t of function(e){return e.requests}(e)){const{store:r,path:n,exclusive:s,notifyAcquired:i}=t;if(lr(e,r,n,{exclusive:s})){const o={store:r,path:n,exclusive:s};e=ur(e,{type:"GRANT_LOCK_REQUEST",lock:o,request:t}),i(o)}}}return{acquire:function(r,n,s){return new Promise((i=>{e=ur(e,{type:"ENQUEUE_LOCK_REQUEST",request:{store:r,path:n,exclusive:s,notifyAcquired:i}}),t()}))},release:function(r){e=ur(e,{type:"RELEASE_LOCK",lock:r}),t()}}}function pr(){const e=dr();return{__unstableAcquireStoreLock:function(t,r,{exclusive:n}){return()=>e.acquire(t,r,n)},__unstableReleaseStoreLock:function(t){return()=>e.release(t)}}}const fr=window.wp.privateApis,{lock:yr,unlock:Er}=(0,fr.__dangerousOptInToUnstableAPIsOnlyForCoreModules)("I know using unstable features means my plugin or theme will inevitably break on the next WordPress release.","@wordpress/core-data"),hr=window.wp.element,vr=window.wp.blocks,mr=window.wp.blockEditor,_r=[];let gr={};const br={...me.reduce(((e,t)=>(e[t.kind]||(e[t.kind]={}),e[t.kind][t.name]={context:(0,hr.createContext)(void 0)},e)),{}),..._e.reduce(((e,t)=>(e[t.kind]={},e)),{})},Rr=(e,t)=>{if(!br[e])throw new Error(`Missing entity config for kind: ${e}.`);return br[e][t]||(br[e][t]={context:(0,hr.createContext)(void 0)}),br[e][t].context};function wr({kind:e,type:t,id:r,children:n}){const s=Rr(e,t).Provider;return(0,hr.createElement)(s,{value:r},n)}function kr(e,t){return(0,hr.useContext)(Rr(e,t))}function Tr(e,t,r,n){const s=kr(e,t),o=null!=n?n:s,{value:a,fullValue:c}=(0,i.useSelect)((n=>{const{getEntityRecord:s,getEditedEntityRecord:i}=n(F),a=s(e,t,o),c=i(e,t,o);return a&&c?{value:c[r],fullValue:a[r]}:{}}),[e,t,o,r]),{editEntityRecord:u}=(0,i.useDispatch)(F);return[a,(0,hr.useCallback)((n=>{u(e,t,o,{[r]:n})}),[e,t,o,r]),c]}function Sr(e,t,{id:r}={}){const n=kr(e,t),s=null!=r?r:n,{content:o,blocks:a,meta:c}=(0,i.useSelect)((r=>{const{getEditedEntityRecord:n}=r(F),i=n(e,t,s);return{blocks:i.blocks,content:i.content,meta:i.meta}}),[e,t,s]),{__unstableCreateUndoLevel:u,editEntityRecord:l}=(0,i.useDispatch)(F);(0,hr.useEffect)((()=>{if(o&&"function"!=typeof o&&!a){const r=(0,vr.parse)(o);l(e,t,s,{blocks:r},{undoIgnore:!0})}}),[o]);const d=(0,hr.useCallback)((e=>{const t={blocks:e};if(!c)return t;if(void 0===c.footnotes)return t;const{getRichTextValues:r}=Er(mr.privateApis),n=r(e).join("")||"",s=[];if(-1!==n.indexOf("data-fn")){const e=/data-fn="([^"]+)"/g;let t;for(;null!==(t=e.exec(n));)s.push(t[1])}const i=c.footnotes?JSON.parse(c.footnotes):[];if(i.map((e=>e.id)).join("")===s.join(""))return t;const o=s.map((e=>i.find((t=>t.id===e))||gr[e]||{id:e,content:""}));function a(e){if(!e||Array.isArray(e)||"object"!=typeof e)return e;e={...e};for(const t in e){const r=e[t];if(Array.isArray(r)){e[t]=r.map(a);continue}if("string"!=typeof r)continue;if(-1===r.indexOf("data-fn"))continue;const n=/(<sup[^>]+data-fn="([^"]+)"[^>]*><a[^>]*>)[\d*]*<\/a><\/sup>/g;e[t]=r.replace(n,((e,t,r)=>`${t}${s.indexOf(r)+1}</a></sup>`));const i=/<a[^>]+data-fn="([^"]+)"[^>]*>\*<\/a>/g;e[t]=e[t].replace(i,((e,t)=>`<sup data-fn="${t}" class="fn"><a href="#${t}" id="${t}-link">${s.indexOf(t)+1}</a></sup>`))}return e}const u=function e(t){return t.map((t=>({...t,attributes:a(t.attributes),innerBlocks:e(t.innerBlocks)})))}(e);return gr={...gr,...i.reduce(((e,t)=>(s.includes(t.id)||(e[t.id]=t),e)),{})},{meta:{...c,footnotes:JSON.stringify(o)},blocks:u}}),[c]),p=(0,hr.useCallback)(((r,n)=>{if(a===r)return u(e,t,s);const{selection:i}=n,o={selection:i,content:({blocks:e=[]})=>(0,vr.__unstableSerializeAndClean)(e),...d(r)};l(e,t,s,o,{isCached:!1})}),[e,t,s,a,d,u,l]),f=(0,hr.useCallback)(((r,n)=>{const{selection:i}=n,o={selection:i,...d(r)};l(e,t,s,o,{isCached:!0})}),[e,t,s,d,l]);return[null!=a?a:_r,f,p]}const Ir=window.wp.htmlEntities,Or=async(e,t={},r={})=>{const{isInitialSuggestions:n=!1,type:s,subtype:i,page:o,perPage:a=(n?3:20)}=t,{disablePostFormats:c=!1}=r,u=[];return s&&"post"!==s||u.push(k()({path:(0,j.addQueryArgs)("/wp/v2/search",{search:e,page:o,per_page:a,type:"post",subtype:i})}).then((e=>e.map((e=>({...e,meta:{kind:"post-type",subtype:i}}))))).catch((()=>[]))),s&&"term"!==s||u.push(k()({path:(0,j.addQueryArgs)("/wp/v2/search",{search:e,page:o,per_page:a,type:"term",subtype:i})}).then((e=>e.map((e=>({...e,meta:{kind:"taxonomy",subtype:i}}))))).catch((()=>[]))),c||s&&"post-format"!==s||u.push(k()({path:(0,j.addQueryArgs)("/wp/v2/search",{search:e,page:o,per_page:a,type:"post-format",subtype:i})}).then((e=>e.map((e=>({...e,meta:{kind:"taxonomy",subtype:i}}))))).catch((()=>[]))),s&&"attachment"!==s||u.push(k()({path:(0,j.addQueryArgs)("/wp/v2/media",{search:e,page:o,per_page:a})}).then((e=>e.map((e=>({...e,meta:{kind:"media"}}))))).catch((()=>[]))),Promise.all(u).then((e=>e.reduce(((e,t)=>e.concat(t)),[]).filter((e=>!!e.id)).slice(0,a).map((e=>{const t="attachment"===e.type;return{id:e.id,url:t?e.source_url:e.url,title:(0,Ir.decodeEntities)(t?e.title.rendered:e.title||"")||(0,T.__)("(no title)"),type:e.subtype||e.type,kind:e?.meta?.kind}}))))},Ar=new Map,Cr=async(e,t={})=>{const r={url:(0,j.prependHTTP)(e)};if(!(0,j.isURL)(e))return Promise.reject(`${e} is not a valid URL.`);const n=(0,j.getProtocol)(e);return n&&(0,j.isValidProtocol)(n)&&n.startsWith("http")&&/^https?:\/\/[^\/\s]/i.test(e)?Ar.has(e)?Ar.get(e):k()({path:(0,j.addQueryArgs)("/wp-block-editor/v1/url-details",r),...t}).then((t=>(Ar.set(e,t),t))):Promise.reject(`${e} does not have a valid protocol. URLs must be "http" based`)};const xr=function(e,t){var r,n,s=0;function i(){var i,o,a=r,c=arguments.length;e:for(;a;){if(a.args.length===arguments.length){for(o=0;o<c;o++)if(a.args[o]!==arguments[o]){a=a.next;continue e}return a!==r&&(a===n&&(n=a.prev),a.prev.next=a.next,a.next&&(a.next.prev=a.prev),a.next=r,a.prev=null,r.prev=a,r=a),a.val}a=a.next}for(i=new Array(c),o=0;o<c;o++)i[o]=arguments[o];return a={args:i,val:e.apply(null,i)},r?(r.prev=a,a.next=r):n=a,s===t.maxSize?(n=n.prev).next=null:s++,r=a,a.val}return t=t||{},i.clear=function(){r=null,n=null,s=0},i};let Ur;!function(e){e.Idle="IDLE",e.Resolving="RESOLVING",e.Error="ERROR",e.Success="SUCCESS"}(Ur||(Ur={}));const Lr=["getIsResolving","hasStartedResolution","hasFinishedResolution","isResolving","getCachedResolvers"];function Pr(e,t){return(0,i.useSelect)(((t,r)=>e((e=>jr(t(e))),r)),t)}const jr=xr((e=>{const t={};for(const r in e)Lr.includes(r)||Object.defineProperty(t,r,{get:()=>(...t)=>{const{getIsResolving:n,hasFinishedResolution:s}=e,i=!!n(r,t),o=!i&&s(r,t),a=e[r](...t);let c;return c=i?Ur.Resolving:o?a?Ur.Success:Ur.Error:Ur.Idle,{data:a,status:c,isResolving:i,hasResolved:o}}});return t}));function Nr(e,t,r,n={enabled:!0}){const{editEntityRecord:s,saveEditedEntityRecord:o}=(0,i.useDispatch)(Yr),a=(0,hr.useMemo)((()=>({edit:n=>s(e,t,r,n),save:(n={})=>o(e,t,r,{throwOnError:!0,...n})})),[s,e,t,r,o]),{editedRecord:c,hasEdits:u}=(0,i.useSelect)((n=>({editedRecord:n(Yr).getEditedEntityRecord(e,t,r),hasEdits:n(Yr).hasEditsForEntityRecord(e,t,r)})),[e,t,r]),{data:l,...d}=Pr((s=>n.enabled?s(Yr).getEntityRecord(e,t,r):{data:null}),[e,t,r,n.enabled]);return{record:l,editedRecord:c,hasEdits:u,...d,...a}}function Vr(e,t,r,n){return V()("wp.data.__experimentalUseEntityRecord",{alternative:"wp.data.useEntityRecord",since:"6.1"}),Nr(e,t,r,n)}const Dr=[];function Mr(e,t,r={},n={enabled:!0}){const s=(0,j.addQueryArgs)("",r),{data:i,...o}=Pr((s=>n.enabled?s(Yr).getEntityRecords(e,t,r):{data:Dr}),[e,t,s,n.enabled]);return{records:i,...o}}function Gr(e,t,r,n){return V()("wp.data.__experimentalUseEntityRecords",{alternative:"wp.data.useEntityRecords",since:"6.1"}),Mr(e,t,r,n)}function qr(e,t){return Pr((r=>{const{canUser:n}=r(Yr),s=n("create",e);if(!t){const t=n("read",e),r=s.isResolving||t.isResolving,i=s.hasResolved&&t.hasResolved;let o=Ur.Idle;return r?o=Ur.Resolving:i&&(o=Ur.Success),{status:o,isResolving:r,hasResolved:i,canCreate:s.hasResolved&&s.data,canRead:t.hasResolved&&t.data}}const i=n("read",e,t),o=n("update",e,t),a=n("delete",e,t),c=i.isResolving||s.isResolving||o.isResolving||a.isResolving,u=i.hasResolved&&s.hasResolved&&o.hasResolved&&a.hasResolved;let l=Ur.Idle;return c?l=Ur.Resolving:u&&(l=Ur.Success),{status:l,isResolving:c,hasResolved:u,canRead:u&&i.data,canCreate:u&&s.data,canUpdate:u&&o.data,canDelete:u&&a.data}}),[e,t])}function Br(e,t){return V()("wp.data.__experimentalUseResourcePermissions",{alternative:"wp.data.useResourcePermissions",since:"6.1"}),qr(e,t)}const Fr=me.reduce(((e,t)=>{const{kind:r,name:n}=t;return e[be(r,n)]=(e,t,s)=>Ze(e,r,n,t,s),e[be(r,n,"get",!0)]=(e,t)=>tt(e,r,n,t),e}),{}),$r=me.reduce(((e,t)=>{const{kind:r,name:n}=t;e[be(r,n)]=(e,t)=>Gt(r,n,e,t);const s=be(r,n,"get",!0);return e[s]=(...e)=>Ft(r,n,...e),e[s].shouldInvalidate=e=>Ft.shouldInvalidate(e,r,n),e}),{}),Qr=me.reduce(((e,t)=>{const{kind:r,name:n}=t;return e[be(r,n,"save")]=e=>ce(r,n,e),e[be(r,n,"delete")]=(e,t)=>ne(r,n,e,t),e}),{}),Yr=(0,i.createReduxStore)(F,{reducer:Ue,actions:{...e,...Qr,...pr()},selectors:{...t,...Fr},resolvers:{...s,...$r}});Er(Yr).registerPrivateSelectors({getNavigationFallbackId:function(e){return e.navigationFallbackId}}),(0,i.register)(Yr)})(),(window.wp=window.wp||{}).coreData=n})();