/*! This file is auto-generated */ !function(){var e={2167:function(e){"use strict";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 n(e,t){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:this;this._map.forEach((function(i,o){null!==o&&"object"===t(o)&&(i=i[1]),e.call(r,i,o,n)}))}},{key:"clear",value:function(){this._map=new Map,this._arrayTreeMap=new Map,this._objectTreeMap=new Map}},{key:"size",get:function(){return this._map.size}}],o&&n(i.prototype,o),s&&n(i,s),e}();e.exports=i},9756:function(e){e.exports=function(e,t){var n,r,i=0;function o(){var o,s,a=n,u=arguments.length;e:for(;a;){if(a.args.length===arguments.length){for(s=0;st=>(n,r)=>void 0===n||e(r)?t(n,r):n;var l=e=>t=>(n,r)=>t(n,e(r));function d(e,t){if(!e)return t;let n=!1;const r={};for(const i in t)(0,s.isEqual)(e[i],t[i])?r[i]=e[i]:(n=!0,r[i]=t[i]);if(!n)return e;for(const t in e)r.hasOwnProperty(t)||(r[t]=e[t]);return r}var f=e=>t=>function(){let n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0;const i=r[e];if(void 0===i)return n;const o=t(n[i],r);return o===n[i]?n:{...n,[i]:o}};var p=function(){return p=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0&&n>="0"&&n<="9"?"_"+n+r:""+n.toUpperCase()+r}function R(e,t){return void 0===t&&(t={}),E(e,p({delimiter:"",transform:_},t))}var b=window.wp.apiFetch,w=n.n(b),T=window.wp.i18n;var k={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};let S;const I=new Uint8Array(16);function U(){if(!S&&(S="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!S))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return S(I)}const C=[];for(let e=0;e<256;++e)C.push((e+256).toString(16).slice(1));function A(e,t=0){return(C[e[t+0]]+C[e[t+1]]+C[e[t+2]]+C[e[t+3]]+"-"+C[e[t+4]]+C[e[t+5]]+"-"+C[e[t+6]]+C[e[t+7]]+"-"+C[e[t+8]]+C[e[t+9]]+"-"+C[e[t+10]]+C[e[t+11]]+C[e[t+12]]+C[e[t+13]]+C[e[t+14]]+C[e[t+15]]).toLowerCase()}var x=function(e,t,n){if(k.randomUUID&&!t&&!e)return k.randomUUID();const r=(e=e||{}).random||(e.rng||U)();if(r[6]=15&r[6]|64,r[8]=63&r[8]|128,t){n=n||0;for(let e=0;e<16;++e)t[n+e]=r[e];return t}return A(r)},L=window.wp.url,O=window.wp.deprecated,P=n.n(O);function D(e,t){return{type:"RECEIVE_ITEMS",items:(0,s.castArray)(e),persistedEdits:t}}function V(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];return{type:"REMOVE_ITEMS",itemIds:(0,s.castArray)(n),kind:e,name:t,invalidateCache:r}}function j(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;return{...D(e,n),query:t}}let N=null;async function M(e){if(null===N){const e=await w()({path:"/batch/v1",method:"OPTIONS"});N=e.endpoints[0].args.requests.maxItems}const t=[];for(const n of function(e,t){const n=[...e],r=[];for(;n.length;)r.push(n.splice(0,t));return r}(e,N)){const e=await w()({path:"/batch/v1",method:"POST",data:{validation:"require-all-validate",requests:n.map((e=>({path:e.path,body:e.data,method:e.method,headers:e.headers})))}});let r;r=e.failed?e.responses.map((e=>({error:null==e?void 0: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(...r)}return t}class q{constructor(){for(var e=arguments.length,t=new Array(e),n=0;ne())),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 G="core";function B(e,t){return{type:"RECEIVE_USER_QUERY",users:(0,s.castArray)(t),queryID:e}}function $(e){return{type:"RECEIVE_CURRENT_USER",currentUser:e}}function F(e){return{type:"ADD_ENTITIES",entities:e}}function Q(e,t,n,r){let i,o=arguments.length>4&&void 0!==arguments[4]&&arguments[4],a=arguments.length>5?arguments[5]:void 0;return"postType"===e&&(n=(0,s.castArray)(n).map((e=>"auto-draft"===e.status?{...e,title:""}:e))),i=r?j(n,r,a):D(n,a),{...i,kind:e,name:t,invalidateCache:o}}function Y(e){return{type:"RECEIVE_CURRENT_THEME",currentTheme:e}}function K(e){return{type:"RECEIVE_CURRENT_GLOBAL_STYLES_ID",id:e}}function H(e,t){return{type:"RECEIVE_THEME_GLOBAL_STYLES",stylesheet:e,globalStyles:t}}function z(e,t){return{type:"RECEIVE_THEME_GLOBAL_STYLE_VARIATIONS",stylesheet:e,variations:t}}function W(){return P()("wp.data.dispatch( 'core' ).receiveThemeSupports",{since:"5.9"}),{type:"DO_NOTHING"}}function Z(e,t){return{type:"RECEIVE_EMBED_PREVIEW",url:e,preview:t}}const X=function(e,t,n,r){let{__unstableFetch:i=w(),throwOnError:o=!1}=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};return async a=>{let{dispatch:u}=a;const c=await u(ye(e)),l=(0,s.find)(c,{kind:e,name:t});let d,f=!1;if(!l||null!=l&&l.__experimentalNoFetch)return;const p=await u.__unstableAcquireStoreLock(G,["entities","records",e,t,n],{exclusive:!0});try{u({type:"DELETE_ENTITY_RECORD_START",kind:e,name:t,recordId:n});let s=!1;try{let o=`${l.baseURL}/${n}`;r&&(o=(0,L.addQueryArgs)(o,r)),f=await i({path:o,method:"DELETE"}),await u(V(e,t,n,!0))}catch(e){s=!0,d=e}if(u({type:"DELETE_ENTITY_RECORD_FINISH",kind:e,name:t,recordId:n,error:d}),s&&o)throw d;return f}finally{u.__unstableReleaseStoreLock(p)}}},J=function(e,t,n,r){let i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};return o=>{let{select:a,dispatch:u}=o;const c=a.getEntityConfig(e,t);if(!c)throw new Error(`The entity being edited (${e}, ${t}) does not have a loaded config.`);const{transientEdits:l={},mergedEdits:d={}}=c,f=a.getRawEntityRecord(e,t,n),p=a.getEditedEntityRecord(e,t,n),v={kind:e,name:t,recordId:n,edits:Object.keys(r).reduce(((e,t)=>{const n=f[t],i=p[t],o=d[t]?{...i,...r[t]}:r[t];return e[t]=(0,s.isEqual)(n,o)?void 0:o,e}),{}),transientEdits:l};u({type:"EDIT_ENTITY_RECORD",...v,meta:{undo:!i.undoIgnore&&{...v,edits:Object.keys(r).reduce(((e,t)=>(e[t]=p[t],e)),{})}}})}},ee=()=>e=>{let{select:t,dispatch:n}=e;const r=t.getUndoEdit();r&&n({type:"EDIT_ENTITY_RECORD",...r,meta:{isUndo:!0}})},te=()=>e=>{let{select:t,dispatch:n}=e;const r=t.getRedoEdit();r&&n({type:"EDIT_ENTITY_RECORD",...r,meta:{isRedo:!0}})};function ne(){return{type:"CREATE_UNDO_LEVEL"}}const re=function(e,t,n){let{isAutosave:r=!1,__unstableFetch:i=w(),throwOnError:o=!1}=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return async a=>{let{select:u,resolveSelect:c,dispatch:l}=a;const d=await l(ye(e)),f=(0,s.find)(d,{kind:e,name:t});if(!f||null!=f&&f.__experimentalNoFetch)return;const p=f.key||le,v=n[p],h=await l.__unstableAcquireStoreLock(G,["entities","records",e,t,v||x()],{exclusive:!0});try{for(const[r,i]of Object.entries(n))if("function"==typeof i){const o=i(u.getEditedEntityRecord(e,t,v));l.editEntityRecord(e,t,v,{[r]:o},{undoIgnore:!0}),n[r]=o}let s,a;l({type:"SAVE_ENTITY_RECORD_START",kind:e,name:t,recordId:v,isAutosave:r});let d=!1;try{const o=`${f.baseURL}${v?"/"+v:""}`,a=u.getRawEntityRecord(e,t,v);if(r){const r=u.getCurrentUser(),d=r?r.id:void 0,f=await c.getAutosave(a.type,a.id,d);let p={...a,...f,...n};if(p=Object.keys(p).reduce(((e,t)=>(["title","excerpt","content"].includes(t)&&(e[t]=p[t]),e)),{status:"auto-draft"===p.status?"draft":p.status}),s=await i({path:`${o}/autosaves`,method:"POST",data:p}),a.id===s.id){let n={...a,...p,...s};n=Object.keys(n).reduce(((e,t)=>(["title","excerpt","content"].includes(t)?e[t]=n[t]:e[t]="status"===t?"auto-draft"===a.status&&"draft"===n.status?n.status:a.status:a[t],e)),{}),l.receiveEntityRecords(e,t,n,void 0,!0)}else l.receiveAutosaves(a.id,s)}else{let r=n;f.__unstablePrePersist&&(r={...r,...f.__unstablePrePersist(a,r)}),s=await i({path:o,method:v?"PUT":"POST",data:r}),l.receiveEntityRecords(e,t,s,void 0,!0,r)}}catch(e){d=!0,a=e}if(l({type:"SAVE_ENTITY_RECORD_FINISH",kind:e,name:t,recordId:v,error:a,isAutosave:r}),d&&o)throw a;return s}finally{l.__unstableReleaseStoreLock(h)}}},ie=e=>async t=>{let{dispatch:n}=t;const r=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:M,t=0,n=[];const r=new q;return{add(e){const i=++t;r.add(i);const o=e=>new Promise(((t,o)=>{n.push({input:e,resolve:t,reject:o}),r.delete(i)}));return"function"==typeof e?Promise.resolve(e(o)).finally((()=>{r.delete(i)})):o(e)},async run(){let t;r.size&&await new Promise((e=>{const t=r.subscribe((()=>{r.size||(t(),e(void 0))}))}));try{if(t=await e(n.map((e=>{let{input:t}=e;return t}))),t.length!==n.length)throw new Error("run: Array returned by processor must be same size as input array.")}catch(e){for(const{reject:t}of n)t(e);throw e}let i=!0;return t.forEach(((e,t)=>{const r=n[t];var o;null!=e&&e.error?(null==r||r.reject(e.error),i=!1):null==r||r.resolve(null!==(o=null==e?void 0:e.output)&&void 0!==o?o:e)})),n=[],i}}}(),i={saveEntityRecord(e,t,i,o){return r.add((r=>n.saveEntityRecord(e,t,i,{...o,__unstableFetch:r})))},saveEditedEntityRecord(e,t,i,o){return r.add((r=>n.saveEditedEntityRecord(e,t,i,{...o,__unstableFetch:r})))},deleteEntityRecord(e,t,i,o,s){return r.add((r=>n.deleteEntityRecord(e,t,i,o,{...s,__unstableFetch:r})))}},o=e.map((e=>e(i))),[,...s]=await Promise.all([r.run(),...o]);return s},oe=(e,t,n,r)=>async i=>{let{select:o,dispatch:a}=i;if(!o.hasEditsForEntityRecord(e,t,n))return;const u=await a(ye(e)),c=(0,s.find)(u,{kind:e,name:t});if(!c)return;const l=c.key||le,d=o.getEntityRecordNonTransientEdits(e,t,n),f={[l]:n,...d};return await a.saveEntityRecord(e,t,f,r)},se=(e,t,n,r,i)=>async o=>{let{select:s,dispatch:a}=o;if(!s.hasEditsForEntityRecord(e,t,n))return;const u=s.getEntityRecordNonTransientEdits(e,t,n),c={};for(const e in u)r.some((t=>t===e))&&(c[e]=u[e]);return await a.saveEntityRecord(e,t,c,i)};function ae(e){return P()("wp.data.dispatch( 'core' ).receiveUploadPermissions",{since:"5.9",alternative:"receiveUserPermission"}),ue("create/media",e)}function ue(e,t){return{type:"RECEIVE_USER_PERMISSION",key:e,isAllowed:t}}function ce(e,t){return{type:"RECEIVE_AUTOSAVES",postId:e,autosaves:(0,s.castArray)(t)}}const le="id",de=["title","excerpt","content"],fe=[{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=>(0,s.get)(e,["title"],(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=>{var t;return(null==e||null===(t=e.title)||void 0===t?void 0:t.rendered)||(null==e?void 0: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"}],pe=[{kind:"postType",loadEntities:async function(){const e=await w()({path:"/wp/v2/types?context=view"});return(0,s.map)(e,((e,t)=>{var n;const r=["wp_template","wp_template_part"].includes(t);return{kind:"postType",baseURL:`/${null!==(n=null==e?void 0:e.rest_namespace)&&void 0!==n?n:"wp/v2"}/${e.rest_base}`,baseURLParams:{context:"edit"},name:t,label:e.name,transientEdits:{blocks:!0,selection:!0},mergedEdits:{meta:!0},rawAttributes:de,getTitle:e=>{var t,n,i,o;return(null==e||null===(t=e.title)||void 0===t?void 0:t.rendered)||(null==e?void 0:e.title)||(r?(i=null!==(n=e.slug)&&void 0!==n?n:"",void 0===o&&(o={}),E(i,p({delimiter:" ",transform:m},o))):String(e.id))},__unstablePrePersist:r?void 0:ve,__unstable_rest_base:e.rest_base}}))}},{kind:"taxonomy",loadEntities:async function(){const e=await w()({path:"/wp/v2/taxonomies?context=view"});return(0,s.map)(e,((e,t)=>{var n;return{kind:"taxonomy",baseURL:`/${null!==(n=null==e?void 0:e.rest_namespace)&&void 0!==n?n:"wp/v2"}/${e.rest_base}`,baseURLParams:{context:"edit"},name:t,label:e.name}}))}}],ve=(e,t)=>{const n={};return"auto-draft"===(null==e?void 0:e.status)&&(t.status||n.status||(n.status="draft"),t.title&&"Auto Draft"!==t.title||n.title||null!=e&&e.title&&"Auto Draft"!==(null==e?void 0:e.title)||(n.title="")),n};const he=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"get",r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];const i=(0,s.find)(fe,{kind:e,name:t}),o="root"===e?"":R(e),a=R(t)+(r?"s":""),u=r&&"plural"in i&&null!=i&&i.plural?R(i.plural):a;return`${n}${o}${u}`},ye=e=>async t=>{let{select:n,dispatch:r}=t,i=n.getEntitiesConfig(e);if(i&&0!==i.length)return i;const o=(0,s.find)(pe,{kind:e});return o?(i=await o.loadEntities(),r(F(i)),i):[]};var Ee=function(e){return"string"==typeof e?e.split(","):Array.isArray(e)?e:null};var ge=function(e){const t=new WeakMap;return n=>{let r;return t.has(n)?r=t.get(n):(r=e(n),null!==n&&"object"==typeof n&&t.set(n,r)),r}}((function(e){const t={stableKey:"",page:1,perPage:10,fields:null,include:null,context:"default"},n=Object.keys(e).sort();for(let o=0;o=o&&n"query"in e)),l((e=>e.query?{...e,...ge(e.query)}:e)),f("context"),f("stableKey")])((function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1?arguments[1]:void 0;const{type:n,page:r,perPage:i,key:o=le}=t;return"RECEIVE_ITEMS"!==n?e:_e(e||[],(0,s.map)(t.items,o),r,i)}));var be=(0,o.combineReducers)({items:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"RECEIVE_ITEMS":{const n=me(t),r=t.key||le;return{...e,[n]:{...e[n],...t.items.reduce(((t,i)=>{var o;const s=i[r];return t[s]=d(null==e||null===(o=e[n])||void 0===o?void 0:o[s],i),t}),{})}}}case"REMOVE_ITEMS":return(0,s.mapValues)(e,(e=>(0,s.omit)(e,t.itemIds)))}return e},itemIsComplete:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"RECEIVE_ITEMS":{const n=me(t),{query:r,key:i=le}=t,o=r?ge(r):{},s=!r||!Array.isArray(o.fields);return{...e,[n]:{...e[n],...t.items.reduce(((t,r)=>{var o;const a=r[i];return t[a]=(null==e||null===(o=e[n])||void 0===o?void 0:o[a])||s,t}),{})}}}case"REMOVE_ITEMS":return(0,s.mapValues)(e,(e=>(0,s.omit)(e,t.itemIds)))}return e},queries:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"RECEIVE_ITEMS":return Re(e,t);case"REMOVE_ITEMS":const n=t.itemIds.reduce(((e,t)=>(e[t]=!0,e)),{});return(0,s.mapValues)(e,(e=>(0,s.mapValues)(e,(e=>(0,s.filter)(e,(e=>!n[e]))))));default:return e}}});function we(e){return(0,s.flowRight)([c((t=>t.name&&t.kind&&t.name===e.name&&t.kind===e.kind)),l((t=>({...t,key:e.key||le})))])((0,o.combineReducers)({queriedData:be,edits:function(){var e,t;let n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0;switch(r.type){case"RECEIVE_ITEMS":if("default"!==(null!==(e=null==r||null===(t=r.query)||void 0===t?void 0:t.context)&&void 0!==e?e:"default"))return n;const i={...n};for(const e of r.items){const t=e[r.key],n=i[t];if(!n)continue;const o=Object.keys(n).reduce(((t,i)=>((0,s.isEqual)(n[i],(0,s.get)(e[i],"raw",e[i]))||r.persistedEdits&&(0,s.isEqual)(n[i],r.persistedEdits[i])||(t[i]=n[i]),t)),{});Object.keys(o).length?i[t]=o:delete i[t]}return i;case"EDIT_ENTITY_RECORD":const o={...n[r.recordId],...r.edits};return Object.keys(o).forEach((e=>{void 0===o[e]&&delete o[e]})),{...n,[r.recordId]:o}}return n},saving:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;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:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;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}}))}function Te(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:fe,t=arguments.length>1?arguments[1]:void 0;return"ADD_ENTITIES"===t.type?[...e,...t.entities]:e}const ke=Object.assign([],{offset:0});let Se;var Ie=(0,o.combineReducers)({terms:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return"RECEIVE_TERMS"===t.type?{...e,[t.taxonomy]:t.terms}:e},users:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{byId:{},queries:{}},t=arguments.length>1?arguments[1]:void 0;return"RECEIVE_USER_QUERY"===t.type?{byId:{...e.byId,...t.users.reduce(((e,t)=>({...e,[t.id]:t})),{})},queries:{...e.queries,[t.queryID]:(0,s.map)(t.users,(e=>e.id))}}:e},currentTheme:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0,t=arguments.length>1?arguments[1]:void 0;return"RECEIVE_CURRENT_THEME"===t.type?t.currentTheme.stylesheet:e},currentGlobalStylesId:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0,t=arguments.length>1?arguments[1]:void 0;return"RECEIVE_CURRENT_GLOBAL_STYLES_ID"===t.type?t.id:e},currentUser:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return"RECEIVE_CURRENT_USER"===t.type?t.currentUser:e},themeGlobalStyleVariations:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return"RECEIVE_THEME_GLOBAL_STYLE_VARIATIONS"===t.type?{...e,[t.stylesheet]:t.variations}:e},themeBaseGlobalStyles:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return"RECEIVE_THEME_GLOBAL_STYLES"===t.type?{...e,[t.stylesheet]:t.globalStyles}:e},taxonomies:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0;return"RECEIVE_TAXONOMIES"===t.type?t.taxonomies:e},entities:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;const n=Te(e.config,t);let r=e.reducer;if(!r||n!==e.config){const e=(0,s.groupBy)(n,"kind");r=(0,o.combineReducers)(Object.entries(e).reduce(((e,t)=>{let[n,r]=t;const i=(0,o.combineReducers)(r.reduce(((e,t)=>({...e,[t.name]:we(t)})),{}));return e[n]=i,e}),{}))}const i=r(e.records,t);return i===e.records&&n===e.config&&r===e.reducer?e:{reducer:r,records:i,config:n}},undo:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:ke,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"EDIT_ENTITY_RECORD":case"CREATE_UNDO_LEVEL":let n="CREATE_UNDO_LEVEL"===t.type;const r=!n&&(t.meta.isUndo||t.meta.isRedo);let i;if(n?t=Se:r||(Se=Object.keys(t.edits).some((e=>!t.transientEdits[e]))?t:{...t,edits:{...Se&&Se.edits,...t.edits}}),r){if(i=[...e],i.offset=e.offset+(t.meta.isUndo?-1:1),!e.flattenedUndo)return i;n=!0,Se.meta.undo||(Se.meta.undo={edits:{}}),t=Se}if(!t.meta.undo)return e;if(!n&&!Object.keys(t.edits).some((e=>!t.transientEdits[e])))return i=[...e],i.flattenedUndo={...e.flattenedUndo,...t.edits},i.offset=e.offset,i;i=i||e.slice(0,e.offset||void 0),i.offset=i.offset||0,i.pop(),n||i.push({kind:t.meta.undo.kind,name:t.meta.undo.name,recordId:t.meta.undo.recordId,edits:{...e.flattenedUndo,...t.meta.undo.edits}});const o=Object.values(t.meta.undo.edits).filter((e=>"function"!=typeof e)),s=Object.values(t.edits).filter((e=>"function"!=typeof e));return u()(o,s)||i.push({kind:t.kind,name:t.name,recordId:t.recordId,edits:n?{...e.flattenedUndo,...t.edits}:t.edits}),i}return e},embedPreviews:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;if("RECEIVE_EMBED_PREVIEW"===t.type){const{url:n,preview:r}=t;return{...e,[n]:r}}return e},userPermissions:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return"RECEIVE_USER_PERMISSION"===t.type?{...e,[t.key]:t.isAllowed}:e},autosaves:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;if("RECEIVE_AUTOSAVES"===t.type){const{postId:n,autosaves:r}=t;return{...e,[n]:r}}return e},blockPatterns:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0;return"RECEIVE_BLOCK_PATTERNS"===t.type?t.patterns:e},blockPatternCategories:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0;return"RECEIVE_BLOCK_PATTERN_CATEGORIES"===t.type?t.categories:e}}),Ue={};function Ce(e){return[e]}function Ae(e,t,n){var r;if(e.length!==t.length)return!1;for(r=n;r1&&void 0!==arguments[1]?arguments[1]:{},n=Pe.get(e);if(n){const e=n.get(t);if(void 0!==e)return e}else n=new(Oe()),Pe.set(e,n);const r=De(e,t);return n.set(t,r),r}));const je={},Ne=(0,o.createRegistrySelector)((e=>(t,n)=>e(G).isResolving("getEmbedPreview",[n])));function Me(e,t){P()("select( 'core' ).getAuthors()",{since:"5.9",alternative:"select( 'core' ).getUsers({ who: 'authors' })"});const n=(0,L.addQueryArgs)("/wp/v2/users/?who=authors&per_page=100",t);return Ge(e,n)}function qe(e){return e.currentUser}const Ge=xe(((e,t)=>{const n=e.users.queries[t];return(0,s.map)(n,(t=>e.users.byId[t]))}),((e,t)=>[e.users.queries[t],e.users.byId]));function Be(e,t){return P()("wp.data.select( 'core' ).getEntitiesByKind()",{since:"6.0",alternative:"wp.data.select( 'core' ).getEntitiesConfig()"}),$e(e,t)}function $e(e,t){return(0,s.filter)(e.entities.config,{kind:t})}function Fe(e,t,n){return P()("wp.data.select( 'core' ).getEntity()",{since:"6.0",alternative:"wp.data.select( 'core' ).getEntityConfig()"}),Qe(e,t,n)}function Qe(e,t,n){return(0,s.find)(e.entities.config,{kind:t,name:n})}const Ye=xe(((e,t,n,r,i)=>{var o,a;const u=(0,s.get)(e.entities.records,[t,n,"queriedData"]);if(!u)return;const c=null!==(o=null==i?void 0:i.context)&&void 0!==o?o:"default";if(void 0===i){var l;if(null===(l=u.itemIsComplete[c])||void 0===l||!l[r])return;return u.items[c][r]}const d=null===(a=u.items[c])||void 0===a?void 0:a[r];if(d&&i._fields){var f;const e={},t=null!==(f=Ee(i._fields))&&void 0!==f?f:[];for(let n=0;n{var o;const a=null!==(o=null==i?void 0:i.context)&&void 0!==o?o:"default";return[(0,s.get)(e.entities.records,[t,n,"queriedData","items",a,r]),(0,s.get)(e.entities.records,[t,n,"queriedData","itemIsComplete",a,r])]}));function Ke(e,t,n,r){return Ye(e,t,n,r)}const He=xe(((e,t,n,r)=>{const i=Ye(e,t,n,r);return i&&Object.keys(i).reduce(((r,o)=>(!function(e,t){return(e.rawAttributes||[]).includes(t)}(Qe(e,t,n),o)?r[o]=i[o]:r[o]=(0,s.get)(i[o],"raw",i[o]),r)),{})}),((e,t,n,r,i)=>{var o;const a=null!==(o=null==i?void 0:i.context)&&void 0!==o?o:"default";return[e.entities.config,(0,s.get)(e.entities.records,[t,n,"queriedData","items",a,r]),(0,s.get)(e.entities.records,[t,n,"queriedData","itemIsComplete",a,r])]}));function ze(e,t,n,r){return Array.isArray(We(e,t,n,r))}const We=(e,t,n,r)=>{const i=(0,s.get)(e.entities.records,[t,n,"queriedData"]);return i?Ve(i,r):null},Ze=xe((e=>{const{entities:{records:t}}=e,n=[];return Object.keys(t).forEach((r=>{Object.keys(t[r]).forEach((i=>{const o=Object.keys(t[r][i].edits).filter((t=>Ye(e,r,i,t)&&tt(e,r,i,t)));if(o.length){const t=Qe(e,r,i);o.forEach((o=>{var s;const a=nt(e,r,i,o);n.push({key:a?a[t.key||le]:void 0,title:(null==t||null===(s=t.getTitle)||void 0===s?void 0:s.call(t,a))||"",name:i,kind:r})}))}}))})),n}),(e=>[e.entities.records])),Xe=xe((e=>{const{entities:{records:t}}=e,n=[];return Object.keys(t).forEach((r=>{Object.keys(t[r]).forEach((i=>{const o=Object.keys(t[r][i].saving).filter((t=>it(e,r,i,t)));if(o.length){const t=Qe(e,r,i);o.forEach((o=>{var s;const a=nt(e,r,i,o);n.push({key:a?a[t.key||le]:void 0,title:(null==t||null===(s=t.getTitle)||void 0===s?void 0:s.call(t,a))||"",name:i,kind:r})}))}}))})),n}),(e=>[e.entities.records]));function Je(e,t,n,r){return(0,s.get)(e.entities.records,[t,n,"edits",r])}const et=xe(((e,t,n,r)=>{const{transientEdits:i}=Qe(e,t,n)||{},o=Je(e,t,n,r)||{};return i?Object.keys(o).reduce(((e,t)=>(i[t]||(e[t]=o[t]),e)),{}):o}),((e,t,n,r)=>[e.entities.config,(0,s.get)(e.entities.records,[t,n,"edits",r])]));function tt(e,t,n,r){return it(e,t,n,r)||Object.keys(et(e,t,n,r)).length>0}const nt=xe(((e,t,n,r)=>({...He(e,t,n,r),...Je(e,t,n,r)})),((e,t,n,r,i)=>{var o;const a=null!==(o=null==i?void 0:i.context)&&void 0!==o?o:"default";return[e.entities.config,(0,s.get)(e.entities.records,[t,n,"queriedData","items",a,r]),(0,s.get)(e.entities.records,[t,n,"queriedData","itemIsComplete",a,r]),(0,s.get)(e.entities.records,[t,n,"edits",r])]}));function rt(e,t,n,r){const{pending:i,isAutosave:o}=(0,s.get)(e.entities.records,[t,n,"saving",r],{});return Boolean(i&&o)}function it(e,t,n,r){return(0,s.get)(e.entities.records,[t,n,"saving",r,"pending"],!1)}function ot(e,t,n,r){return(0,s.get)(e.entities.records,[t,n,"deleting",r,"pending"],!1)}function st(e,t,n,r){return(0,s.get)(e.entities.records,[t,n,"saving",r,"error"])}function at(e,t,n,r){return(0,s.get)(e.entities.records,[t,n,"deleting",r,"error"])}function ut(e){return e.undo.offset}function ct(e){return e.undo[e.undo.length-2+ut(e)]}function lt(e){return e.undo[e.undo.length+ut(e)]}function dt(e){return Boolean(ct(e))}function ft(e){return Boolean(lt(e))}function pt(e){return Ye(e,"root","theme",e.currentTheme)}function vt(e){return e.currentGlobalStylesId}function ht(e){var t,n;return null!==(t=null===(n=pt(e))||void 0===n?void 0:n.theme_supports)&&void 0!==t?t:je}function yt(e,t){return e.embedPreviews[t]}function Et(e,t){const n=e.embedPreviews[t],r=''+t+"";return!!n&&n.html===r}function gt(e,t,n,r){const i=[t,n,r].filter(Boolean).join("/");return(0,s.get)(e,["userPermissions",i])}function mt(e,t,n,r){const i=Qe(e,t,n);if(!i)return!1;return gt(e,"update",i.__unstable_rest_base,r)}function _t(e,t,n){return e.autosaves[n]}function Rt(e,t,n,r){if(void 0===r)return;const i=e.autosaves[n];return(0,s.find)(i,{author:r})}const bt=(0,o.createRegistrySelector)((e=>(t,n,r)=>e(G).hasFinishedResolution("getAutosaves",[n,r]))),wt=xe((e=>[]),(e=>[e.undo.length,e.undo.offset,e.undo.flattenedUndo]));function Tt(e,t){const n=We(e,"postType","wp_template",{"find-template":t});return null!=n&&n.length?nt(e,"postType","wp_template",n[0].id):null}function kt(e){const t=pt(e);return t?e.themeBaseGlobalStyles[t.stylesheet]:null}function St(e){const t=pt(e);return t?e.themeGlobalStyleVariations[t.stylesheet]:null}function It(e){return e.blockPatterns}function Ut(e){return e.blockPatternCategories}function Ct(e,t){return 0===t?e.toLowerCase():_(e,t)}var At=e=>function(){for(var t=arguments.length,n=new Array(t),r=0;r{let{resolveSelect:r}=t;await r[e](...n)}};const xt=e=>async t=>{let{dispatch:n}=t;const r=(0,L.addQueryArgs)("/wp/v2/users/?who=authors&per_page=100",e),i=await w()({path:r});n.receiveUserQuery(r,i)},Lt=()=>async e=>{let{dispatch:t}=e;const n=await w()({path:"/wp/v2/users/me"});t.receiveCurrentUser(n)},Ot=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",r=arguments.length>3?arguments[3]:void 0;return async i=>{let{select:o,dispatch:s}=i;const a=(await s(ye(e))).find((n=>n.name===t&&n.kind===e));if(!a||null!=a&&a.__experimentalNoFetch)return;const u=await s.__unstableAcquireStoreLock(G,["entities","records",e,t,n],{exclusive:!1});try{void 0!==r&&r._fields&&(r={...r,_fields:[...new Set([...Ee(r._fields)||[],a.key||le])].join()});const i=(0,L.addQueryArgs)(a.baseURL+(n?"/"+n:""),{...a.baseURLParams,...r});if(void 0!==r){r={...r,include:[n]};if(o.hasEntityRecords(e,t,r))return}const c=await w()({path:i});s.receiveEntityRecords(e,t,c,r)}finally{s.__unstableReleaseStoreLock(u)}}},Pt=At("getEntityRecord"),Dt=At("getEntityRecord"),Vt=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return async r=>{let{dispatch:i}=r;const o=(await i(ye(e))).find((n=>n.name===t&&n.kind===e));if(!o||null!=o&&o.__experimentalNoFetch)return;const s=await i.__unstableAcquireStoreLock(G,["entities","records",e,t],{exclusive:!1});try{var a;n._fields&&(n={...n,_fields:[...new Set([...Ee(n._fields)||[],o.key||le])].join()});const r=(0,L.addQueryArgs)(o.baseURL,{...o.baseURLParams,...n});let u=Object.values(await w()({path:r}));if(n._fields&&(u=u.map((e=>(n._fields.split(",").forEach((t=>{e.hasOwnProperty(t)||(e[t]=void 0)})),e)))),i.receiveEntityRecords(e,t,u,n),!(null!==(a=n)&&void 0!==a&&a._fields||n.context)){const n=o.key||le,r=u.filter((e=>e[n])).map((r=>[e,t,r[n]]));i({type:"START_RESOLUTIONS",selectorName:"getEntityRecord",args:r}),i({type:"FINISH_RESOLUTIONS",selectorName:"getEntityRecord",args:r})}}finally{i.__unstableReleaseStoreLock(s)}}};Vt.shouldInvalidate=(e,t,n)=>("RECEIVE_ITEMS"===e.type||"REMOVE_ITEMS"===e.type)&&e.invalidateCache&&t===e.kind&&n===e.name;const jt=()=>async e=>{let{dispatch:t,resolveSelect:n}=e;const r=await n.getEntityRecords("root","theme",{status:"active"});t.receiveCurrentTheme(r[0])},Nt=At("getCurrentTheme"),Mt=e=>async t=>{let{dispatch:n}=t;try{const t=await w()({path:(0,L.addQueryArgs)("/oembed/1.0/proxy",{url:e})});n.receiveEmbedPreview(e,t)}catch(t){n.receiveEmbedPreview(e,!1)}},qt=(e,t,n)=>async r=>{var i;let{dispatch:o,registry:s}=r;const{hasStartedResolution:a}=s.select(G),u=n?`${t}/${n}`:t,c=["create","read","update","delete"];if(!c.includes(e))throw new Error(`'${e}' is not a valid action.`);for(const r of c){if(r===e)continue;if(a("canUser",[r,t,n]))return}let l;try{l=await w()({path:`/wp/v2/${u}`,method:"OPTIONS",parse:!1})}catch(e){return}const d=null===(i=l.headers)||void 0===i?void 0:i.get("allow"),f=(null==d?void 0:d.allow)||d||"",p={},v={create:"POST",read:"GET",update:"PUT",delete:"DELETE"};for(const[e,t]of Object.entries(v))p[e]=f.includes(t);for(const e of c)o.receiveUserPermission(`${e}/${u}`,p[e])},Gt=(e,t,n)=>async r=>{let{dispatch:i}=r;const o=(await i(ye(e))).find((n=>n.name===t&&n.kind===e));if(!o)return;const s=o.__unstable_rest_base;await i(qt("update",s,n))},Bt=(e,t)=>async n=>{let{dispatch:r,resolveSelect:i}=n;const{rest_base:o,rest_namespace:s="wp/v2"}=await i.getPostType(e),a=await w()({path:`/${s}/${o}/${t}/autosaves?context=edit`});a&&a.length&&r.receiveAutosaves(t,a)},$t=(e,t)=>async n=>{let{resolveSelect:r}=n;await r.getAutosaves(e,t)},Ft=e=>async t=>{let n,{dispatch:r,resolveSelect:i}=t;try{n=await window.fetch((0,L.addQueryArgs)(e,{"_wp-find-template":!0})).then((e=>e.json())).then((e=>{let{data:t}=e;return t}))}catch(e){}if(!n)return;const o=await i.getEntityRecord("postType","wp_template",n.id);o&&r.receiveEntityRecords("postType","wp_template",[o],{"find-template":e})};Ft.shouldInvalidate=e=>("RECEIVE_ITEMS"===e.type||"REMOVE_ITEMS"===e.type)&&e.invalidateCache&&"postType"===e.kind&&"wp_template"===e.name;const Qt=()=>async e=>{var t,n,r,i;let{dispatch:o,resolveSelect:s}=e;const a=await s.getEntityRecords("root","theme",{status:"active"}),u=null==a||null===(t=a[0])||void 0===t||null===(n=t._links)||void 0===n||null===(r=n["wp:user-global-styles"])||void 0===r||null===(i=r[0])||void 0===i?void 0:i.href;if(u){const e=await w()({url:u});o.__experimentalReceiveCurrentGlobalStylesId(e.id)}},Yt=()=>async e=>{let{resolveSelect:t,dispatch:n}=e;const r=await t.getCurrentTheme(),i=await w()({path:`/wp/v2/global-styles/themes/${r.stylesheet}`});n.__experimentalReceiveThemeBaseGlobalStyles(r.stylesheet,i)},Kt=()=>async e=>{let{resolveSelect:t,dispatch:n}=e;const r=await t.getCurrentTheme(),i=await w()({path:`/wp/v2/global-styles/themes/${r.stylesheet}/variations`});n.__experimentalReceiveThemeGlobalStyleVariations(r.stylesheet,i)},Ht=()=>async e=>{let{dispatch:t}=e;const n=await w()({path:"/wp/v2/block-patterns/patterns"});t({type:"RECEIVE_BLOCK_PATTERNS",patterns:null==n?void 0:n.map((e=>Object.fromEntries(Object.entries(e).map((e=>{let[t,n]=e;return[(r=t,void 0===i&&(i={}),R(r,p({transform:Ct},i))),n];var r,i})))))})},zt=()=>async e=>{let{dispatch:t}=e;t({type:"RECEIVE_BLOCK_PATTERN_CATEGORIES",categories:await w()({path:"/wp/v2/block-patterns/categories"})})};function Wt(e,t){const n={...e};let r=n;for(const e of t)r.children={...r.children,[e]:{locks:[],children:{},...r.children[e]}},r=r.children[e];return n}function Zt(e,t){let n=e;for(const e of t){const t=n.children[e];if(!t)return null;n=t}return n}function Xt(e,t){let{exclusive:n}=e;return!(!n||!t.length)||!(n||!t.filter((e=>e.exclusive)).length)}const Jt={requests:[],tree:{locks:[],children:{}}};function en(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Jt,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"ENQUEUE_LOCK_REQUEST":{const{request:n}=t;return{...e,requests:[n,...e.requests]}}case"GRANT_LOCK_REQUEST":{const{lock:n,request:r}=t,{store:i,path:o}=r,s=[i,...o],a=Wt(e.tree,s),u=Zt(a,s);return u.locks=[...u.locks,n],{...e,requests:e.requests.filter((e=>e!==r)),tree:a}}case"RELEASE_LOCK":{const{lock:n}=t,r=[n.store,...n.path],i=Wt(e.tree,r),o=Zt(i,r);return o.locks=o.locks.filter((e=>e!==n)),{...e,tree:i}}}return e}function tn(e,t,n,r){let{exclusive:i}=r;const o=[t,...n],s=e.tree;for(const e of function*(e,t){let n=e;yield n;for(const e of t){const t=n.children[e];if(!t)break;yield t,n=t}}(s,o))if(Xt({exclusive:i},e.locks))return!1;const a=Zt(s,o);if(!a)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))}}(a))if(Xt({exclusive:i},e.locks))return!1;return!0}function nn(){let e=en(void 0,{type:"@@INIT"});function t(){for(const t of function(e){return e.requests}(e)){const{store:n,path:r,exclusive:i,notifyAcquired:o}=t;if(tn(e,n,r,{exclusive:i})){const s={store:n,path:r,exclusive:i};e=en(e,{type:"GRANT_LOCK_REQUEST",lock:s,request:t}),o(s)}}}return{acquire:function(n,r,i){return new Promise((o=>{e=en(e,{type:"ENQUEUE_LOCK_REQUEST",request:{store:n,path:r,exclusive:i,notifyAcquired:o}}),t()}))},release:function(n){e=en(e,{type:"RELEASE_LOCK",lock:n}),t()}}}function rn(){const e=nn();return{__unstableAcquireStoreLock:function(t,n,r){let{exclusive:i}=r;return()=>e.acquire(t,n,i)},__unstableReleaseStoreLock:function(t){return()=>e.release(t)}}}var on=window.wp.element,sn=window.wp.blocks;const an=[],un={...fe.reduce(((e,t)=>(e[t.kind]||(e[t.kind]={}),e[t.kind][t.name]={context:(0,on.createContext)(void 0)},e)),{}),...pe.reduce(((e,t)=>(e[t.kind]={},e)),{})},cn=(e,t)=>{if(!un[e])throw new Error(`Missing entity config for kind: ${e}.`);return un[e][t]||(un[e][t]={context:(0,on.createContext)(void 0)}),un[e][t].context};function ln(e){let{kind:t,type:n,id:r,children:i}=e;const o=cn(t,n).Provider;return(0,on.createElement)(o,{value:r},i)}function dn(e,t){return(0,on.useContext)(cn(e,t))}function fn(e,t,n,r){const i=dn(e,t),s=null!=r?r:i,{value:a,fullValue:u}=(0,o.useSelect)((r=>{const{getEntityRecord:i,getEditedEntityRecord:o}=r(G),a=i(e,t,s),u=o(e,t,s);return a&&u?{value:u[n],fullValue:a[n]}:{}}),[e,t,s,n]),{editEntityRecord:c}=(0,o.useDispatch)(G);return[a,(0,on.useCallback)((r=>{c(e,t,s,{[n]:r})}),[e,t,s,n]),u]}function pn(e,t){let{id:n}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const r=dn(e,t),i=null!=n?n:r,{content:s,blocks:a}=(0,o.useSelect)((n=>{const{getEditedEntityRecord:r}=n(G),o=r(e,t,i);return{blocks:o.blocks,content:o.content}}),[e,t,i]),{__unstableCreateUndoLevel:u,editEntityRecord:c}=(0,o.useDispatch)(G);(0,on.useEffect)((()=>{if(s&&"function"!=typeof s&&!a){const n=(0,sn.parse)(s);c(e,t,i,{blocks:n},{undoIgnore:!0})}}),[s]);const l=(0,on.useCallback)(((n,r)=>{const{selection:o}=r,s={blocks:n,selection:o};if(a===s.blocks)return u(e,t,i);s.content=e=>{let{blocks:t=[]}=e;return(0,sn.__unstableSerializeAndClean)(t)},c(e,t,i,s)}),[e,t,i,a]),d=(0,on.useCallback)(((n,r)=>{const{selection:o}=r;c(e,t,i,{blocks:n,selection:o})}),[e,t,i]);return[null!=a?a:an,d,l]}var vn=window.wp.htmlEntities;var hn=async function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{isInitialSuggestions:r=!1,type:i,subtype:o,page:s,perPage:a=(r?3:20)}=t,{disablePostFormats:u=!1}=n,c=[];return i&&"post"!==i||c.push(w()({path:(0,L.addQueryArgs)("/wp/v2/search",{search:e,page:s,per_page:a,type:"post",subtype:o})}).then((e=>e.map((e=>({...e,meta:{kind:"post-type",subtype:o}}))))).catch((()=>[]))),i&&"term"!==i||c.push(w()({path:(0,L.addQueryArgs)("/wp/v2/search",{search:e,page:s,per_page:a,type:"term",subtype:o})}).then((e=>e.map((e=>({...e,meta:{kind:"taxonomy",subtype:o}}))))).catch((()=>[]))),u||i&&"post-format"!==i||c.push(w()({path:(0,L.addQueryArgs)("/wp/v2/search",{search:e,page:s,per_page:a,type:"post-format",subtype:o})}).then((e=>e.map((e=>({...e,meta:{kind:"taxonomy",subtype:o}}))))).catch((()=>[]))),i&&"attachment"!==i||c.push(w()({path:(0,L.addQueryArgs)("/wp/v2/media",{search:e,page:s,per_page:a})}).then((e=>e.map((e=>({...e,meta:{kind:"media"}}))))).catch((()=>[]))),Promise.all(c).then((e=>e.reduce(((e,t)=>e.concat(t)),[]).filter((e=>!!e.id)).slice(0,a).map((e=>{var t;const n="attachment"===e.type;return{id:e.id,url:n?e.source_url:e.url,title:(0,vn.decodeEntities)(n?e.title.rendered:e.title||"")||(0,T.__)("(no title)"),type:e.subtype||e.type,kind:null==e||null===(t=e.meta)||void 0===t?void 0:t.kind}}))))};const yn=new Map;var En=async function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n="/wp-block-editor/v1/url-details",r={url:(0,L.prependHTTP)(e)};if(!(0,L.isURL)(e))return Promise.reject(`${e} is not a valid URL.`);const i=(0,L.getProtocol)(e);return i&&(0,L.isValidProtocol)(i)&&i.startsWith("http")&&/^https?:\/\/[^\/\s]/i.test(e)?yn.has(e)?yn.get(e):w()({path:(0,L.addQueryArgs)(n,r),...t}).then((t=>(yn.set(e,t),t))):Promise.reject(`${e} does not have a valid protocol. URLs must be "http" based`)},gn=n(9756),mn=n.n(gn)();let _n;!function(e){e.Idle="IDLE",e.Resolving="RESOLVING",e.Error="ERROR",e.Success="SUCCESS"}(_n||(_n={}));const Rn=["getIsResolving","hasStartedResolution","hasFinishedResolution","isResolving","getCachedResolvers"];function bn(e,t){return(0,o.useSelect)(((t,n)=>e((e=>wn(t(e))),n)),t)}const wn=mn((e=>{const t={};for(const n in e)Rn.includes(n)||Object.defineProperty(t,n,{get:()=>function(){const{getIsResolving:t,hasFinishedResolution:r}=e;for(var i=arguments.length,o=new Array(i),s=0;s3&&void 0!==arguments[3]?arguments[3]:{enabled:!0};const{editEntityRecord:i,saveEditedEntityRecord:s}=(0,o.useDispatch)(Pn),a=(0,on.useMemo)((()=>({edit:r=>i(e,t,n,r),save:function(){let r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return s(e,t,n,{throwOnError:!0,...r})}})),[n]),{editedRecord:u,hasEdits:c}=(0,o.useSelect)((r=>({editedRecord:r(Pn).getEditedEntityRecord(e,t,n),hasEdits:r(Pn).hasEditsForEntityRecord(e,t,n)})),[e,t,n]),{data:l,...d}=bn((i=>r.enabled?i(Pn).getEntityRecord(e,t,n):null),[e,t,n,r.enabled]);return{record:l,editedRecord:u,hasEdits:c,...d,...a}}function kn(e,t,n,r){return P()("wp.data.__experimentalUseEntityRecord",{alternative:"wp.data.useEntityRecord",since:"6.1"}),Tn(e,t,n,r)}const Sn=[];function In(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{enabled:!0};const i=(0,L.addQueryArgs)("",n),{data:o,...s}=bn((i=>r.enabled?i(Pn).getEntityRecords(e,t,n):{data:Sn}),[e,t,i,r.enabled]);return{records:o,...s}}function Un(e,t,n,r){return P()("wp.data.__experimentalUseEntityRecords",{alternative:"wp.data.useEntityRecords",since:"6.1"}),In(e,t,n,r)}function Cn(e,t){return bn((n=>{const{canUser:r}=n(Pn),i=r("create",e);if(!t){const t=r("read",e),n=i.isResolving||t.isResolving,o=i.hasResolved&&t.hasResolved;let s=_n.Idle;return n?s=_n.Resolving:o&&(s=_n.Success),{status:s,isResolving:n,hasResolved:o,canCreate:i.hasResolved&&i.data,canRead:t.hasResolved&&t.data}}const o=r("read",e,t),s=r("update",e,t),a=r("delete",e,t),u=o.isResolving||i.isResolving||s.isResolving||a.isResolving,c=o.hasResolved&&i.hasResolved&&s.hasResolved&&a.hasResolved;let l=_n.Idle;return u?l=_n.Resolving:c&&(l=_n.Success),{status:l,isResolving:u,hasResolved:c,canRead:c&&o.data,canCreate:c&&i.data,canUpdate:c&&s.data,canDelete:c&&a.data}}),[e,t])}function An(e,t){return P()("wp.data.__experimentalUseResourcePermissions",{alternative:"wp.data.useResourcePermissions",since:"6.1"}),Cn(e,t)}const xn=fe.reduce(((e,t)=>{const{kind:n,name:r}=t;return e[he(n,r)]=(e,t,i)=>Ye(e,n,r,t,i),e[he(n,r,"get",!0)]=(e,t)=>We(e,n,r,t),e}),{}),Ln=fe.reduce(((e,t)=>{const{kind:n,name:r}=t;e[he(n,r)]=(e,t)=>Ot(n,r,e,t);const i=he(n,r,"get",!0);return e[i]=function(){for(var e=arguments.length,t=new Array(e),i=0;iVt.shouldInvalidate(e,n,r),e}),{}),On=fe.reduce(((e,t)=>{const{kind:n,name:r}=t;return e[he(n,r,"save")]=e=>re(n,r,e),e[he(n,r,"delete")]=(e,t)=>X(n,r,e,t),e}),{}),Pn=(0,o.createReduxStore)(G,{reducer:Ie,actions:{...e,...On,...rn()},selectors:{...t,...xn},resolvers:{...i,...Ln}});(0,o.register)(Pn)}(),(window.wp=window.wp||{}).coreData=r}();