plugins.min.js000064400000010062147177406350007362 0ustar00/*! This file is auto-generated */ (()=>{"use strict";var e={n:n=>{var r=n&&n.__esModule?()=>n.default:()=>n;return e.d(r,{a:r}),r},d:(n,r)=>{for(var t in r)e.o(r,t)&&!e.o(n,t)&&Object.defineProperty(n,t,{enumerable:!0,get:r[t]})},o:(e,n)=>Object.prototype.hasOwnProperty.call(e,n),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},n={};e.r(n),e.d(n,{PluginArea:()=>P,getPlugin:()=>w,getPlugins:()=>x,registerPlugin:()=>h,unregisterPlugin:()=>f,usePluginContext:()=>c,withPluginContext:()=>p});const r=window.wp.element,t=window.wp.hooks,o=window.wp.isShallowEqual;var i=e.n(o);const l=window.wp.compose,s=window.ReactJSXRuntime,u=(0,r.createContext)({name:null,icon:null}),a=u.Provider;function c(){return(0,r.useContext)(u)}const p=e=>(0,l.createHigherOrderComponent)((n=>r=>(0,s.jsx)(u.Consumer,{children:t=>(0,s.jsx)(n,{...r,...e(t,r)})})),"withPluginContext");class g extends r.Component{constructor(e){super(e),this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(e){const{name:n,onError:r}=this.props;r&&r(n,e)}render(){return this.state.hasError?null:this.props.children}}const d=window.wp.primitives,v=(0,s.jsx)(d.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,s.jsx)(d.Path,{d:"M10.5 4v4h3V4H15v4h1.5a1 1 0 011 1v4l-3 4v2a1 1 0 01-1 1h-3a1 1 0 01-1-1v-2l-3-4V9a1 1 0 011-1H9V4h1.5zm.5 12.5v2h2v-2l3-4v-3H8v3l3 4z"})}),m={};function h(e,n){if("object"!=typeof n)return console.error("No settings object provided!"),null;if("string"!=typeof e)return console.error("Plugin name must be string."),null;if(!/^[a-z][a-z0-9-]*$/.test(e))return console.error('Plugin name must include only lowercase alphanumeric characters or dashes, and start with a letter. Example: "my-plugin".'),null;m[e]&&console.error(`Plugin "${e}" is already registered.`),n=(0,t.applyFilters)("plugins.registerPlugin",n,e);const{render:r,scope:o}=n;if("function"!=typeof r)return console.error('The "render" property must be specified and must be a valid function.'),null;if(o){if("string"!=typeof o)return console.error("Plugin scope must be string."),null;if(!/^[a-z][a-z0-9-]*$/.test(o))return console.error('Plugin scope must include only lowercase alphanumeric characters or dashes, and start with a letter. Example: "my-page".'),null}return m[e]={name:e,icon:v,...n},(0,t.doAction)("plugins.pluginRegistered",n,e),n}function f(e){if(!m[e])return void console.error('Plugin "'+e+'" is not registered.');const n=m[e];return delete m[e],(0,t.doAction)("plugins.pluginUnregistered",n,e),n}function w(e){return m[e]}function x(e){return Object.values(m).filter((n=>n.scope===e))}const y=function(e,n){var r,t,o=0;function i(){var i,l,s=r,u=arguments.length;e:for(;s;){if(s.args.length===arguments.length){for(l=0;l({icon:e,name:n})));const P=function({scope:e,onError:n}){const o=(0,r.useMemo)((()=>{let n=[];return{subscribe:e=>((0,t.addAction)("plugins.pluginRegistered","core/plugins/plugin-area/plugins-registered",e),(0,t.addAction)("plugins.pluginUnregistered","core/plugins/plugin-area/plugins-unregistered",e),()=>{(0,t.removeAction)("plugins.pluginRegistered","core/plugins/plugin-area/plugins-registered"),(0,t.removeAction)("plugins.pluginUnregistered","core/plugins/plugin-area/plugins-unregistered")}),getValue(){const r=x(e);return i()(n,r)||(n=r),n}}}),[e]),l=(0,r.useSyncExternalStore)(o.subscribe,o.getValue,o.getValue);return(0,s.jsx)("div",{style:{display:"none"},children:l.map((({icon:e,name:r,render:t})=>(0,s.jsx)(a,{value:y(e,r),children:(0,s.jsx)(g,{name:r,onError:n,children:(0,s.jsx)(t,{})})},r)))})};(window.wp=window.wp||{}).plugins=n})();core-data.min.js000064400000167012147177406350007550 0ustar00/*! This file is auto-generated */ (()=>{"use strict";var e={6689:(e,t,r)=>{r.d(t,{createUndoManager:()=>a});var n=r(923),s=r.n(n);function i(e,t){const r={...e};return Object.entries(t).forEach((([e,t])=>{r[e]?r[e]={...r[e],to:t.to}:r[e]=t})),r}const o=(e,t)=>{const r=e?.findIndex((({id:e})=>"string"==typeof e?e===t.id:s()(e,t.id))),n=[...e];return-1!==r?n[r]={id:t.id,changes:i(n[r].changes,t.changes)}:n.push(t),n};function a(){let e=[],t=[],r=0;const n=()=>{e=e.slice(0,r||void 0),r=0},i=()=>{var r;const n=0===e.length?0:e.length-1;let s=null!==(r=e[n])&&void 0!==r?r:[];t.forEach((e=>{s=o(s,e)})),t=[],e[n]=s};return{addRecord(r,a=!1){const c=!r||(e=>!e.filter((({changes:e})=>Object.values(e).some((({from:e,to:t})=>"function"!=typeof e&&"function"!=typeof t&&!s()(e,t))))).length)(r);if(a){if(c)return;r.forEach((e=>{t=o(t,e)}))}else{if(n(),t.length&&i(),c)return;e.push(r)}},undo(){t.length&&(n(),i());const s=e[e.length-1+r];if(s)return r-=1,s},redo(){const t=e[e.length+r];if(t)return r+=1,t},hasUndo:()=>!!e[e.length-1+r],hasRedo:()=>!!e[e.length+r]}}},3249: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;r1&&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},7734: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}},923:e=>{e.exports=window.wp.isShallowEqual}},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:()=>Qr,__experimentalFetchLinkSuggestions:()=>Ht,__experimentalFetchUrlData:()=>Wt,__experimentalUseEntityRecord:()=>sn,__experimentalUseEntityRecords:()=>cn,__experimentalUseResourcePermissions:()=>un,fetchBlockPatterns:()=>Jt,store:()=>En,useEntityBlockEditor:()=>Wr,useEntityId:()=>Yr,useEntityProp:()=>Hr,useEntityRecord:()=>nn,useEntityRecords:()=>an,useResourcePermissions:()=>ln});var e={};r.r(e),r.d(e,{__experimentalBatch:()=>ce,__experimentalReceiveCurrentGlobalStylesId:()=>W,__experimentalReceiveThemeBaseGlobalStyles:()=>J,__experimentalReceiveThemeGlobalStyleVariations:()=>X,__experimentalSaveSpecifiedEntityEdits:()=>ue,__unstableCreateUndoLevel:()=>oe,addEntities:()=>Y,deleteEntityRecord:()=>re,editEntityRecord:()=>ne,receiveAutosaves:()=>fe,receiveCurrentTheme:()=>z,receiveCurrentUser:()=>Q,receiveDefaultTemplateId:()=>Ee,receiveEmbedPreview:()=>te,receiveEntityRecords:()=>H,receiveNavigationFallbackId:()=>ye,receiveRevisions:()=>me,receiveThemeGlobalStyleRevisions:()=>ee,receiveThemeSupports:()=>Z,receiveUploadPermissions:()=>de,receiveUserPermission:()=>pe,receiveUserQuery:()=>K,redo:()=>ie,saveEditedEntityRecord:()=>le,saveEntityRecord:()=>ae,undo:()=>se});var t={};r.r(t),r.d(t,{__experimentalGetCurrentGlobalStylesId:()=>Rt,__experimentalGetCurrentThemeBaseGlobalStyles:()=>xt,__experimentalGetCurrentThemeGlobalStylesVariations:()=>Pt,__experimentalGetDirtyEntityRecords:()=>it,__experimentalGetEntitiesBeingSaved:()=>ot,__experimentalGetEntityRecordNoResolver:()=>Ze,__experimentalGetTemplateForLink:()=>Ut,canUser:()=>Tt,canUserEditEntityRecord:()=>It,getAuthors:()=>Ke,getAutosave:()=>Ot,getAutosaves:()=>kt,getBlockPatternCategories:()=>jt,getBlockPatterns:()=>Lt,getCurrentTheme:()=>_t,getCurrentThemeGlobalStylesRevisions:()=>Dt,getCurrentUser:()=>Qe,getDefaultTemplateId:()=>Mt,getEditedEntityRecord:()=>ut,getEmbedPreview:()=>wt,getEntitiesByKind:()=>He,getEntitiesConfig:()=>ze,getEntity:()=>We,getEntityConfig:()=>Je,getEntityRecord:()=>Xe,getEntityRecordEdits:()=>at,getEntityRecordNonTransientEdits:()=>ct,getEntityRecords:()=>rt,getEntityRecordsTotalItems:()=>nt,getEntityRecordsTotalPages:()=>st,getLastEntityDeleteError:()=>Et,getLastEntitySaveError:()=>yt,getRawEntityRecord:()=>et,getRedoEdit:()=>gt,getReferenceByDistinctEdits:()=>At,getRevision:()=>Gt,getRevisions:()=>Vt,getThemeSupports:()=>bt,getUndoEdit:()=>mt,getUserPatternCategories:()=>Nt,getUserQueryResults:()=>Ye,hasEditsForEntityRecord:()=>lt,hasEntityRecords:()=>tt,hasFetchedAutosaves:()=>Ct,hasRedo:()=>vt,hasUndo:()=>ht,isAutosavingEntityRecord:()=>dt,isDeletingEntityRecord:()=>ft,isPreviewEmbedFallback:()=>St,isRequestingEmbedPreview:()=>$e,isSavingEntityRecord:()=>pt});var s={};r.r(s),r.d(s,{getBlockPatternsForPostType:()=>Ft,getNavigationFallbackId:()=>Bt,getUndoManager:()=>qt});var i={};r.r(i),r.d(i,{__experimentalGetCurrentGlobalStylesId:()=>pr,__experimentalGetCurrentThemeBaseGlobalStyles:()=>fr,__experimentalGetCurrentThemeGlobalStylesVariations:()=>yr,__experimentalGetTemplateForLink:()=>dr,canUser:()=>ar,canUserEditEntityRecord:()=>cr,getAuthors:()=>Xt,getAutosave:()=>ur,getAutosaves:()=>lr,getBlockPatternCategories:()=>gr,getBlockPatterns:()=>mr,getCurrentTheme:()=>sr,getCurrentThemeGlobalStylesRevisions:()=>Er,getCurrentUser:()=>Zt,getDefaultTemplateId:()=>_r,getEditedEntityRecord:()=>rr,getEmbedPreview:()=>or,getEntityRecord:()=>er,getEntityRecords:()=>nr,getNavigationFallbackId:()=>vr,getRawEntityRecord:()=>tr,getRevision:()=>br,getRevisions:()=>Rr,getThemeSupports:()=>ir,getUserPatternCategories:()=>hr});const o=window.wp.data;var a=r(7734),c=r.n(a);const l=window.wp.compose;var u=r(6689);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;r0&&r>="0"&&r<="9"?"_"+r+n:""+r.toUpperCase()+n}function b(e,t){return void 0===t&&(t={}),h(e,y({delimiter:"",transform:R},t))}const w=window.wp.apiFetch;var S=r.n(w);const T=window.wp.i18n,I=window.wp.richText,k={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};let O;const C=new Uint8Array(16);function A(){if(!O&&(O="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!O))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return O(C)}const U=[];for(let e=0;e<256;++e)U.push((e+256).toString(16).slice(1));function x(e,t=0){return U[e[t+0]]+U[e[t+1]]+U[e[t+2]]+U[e[t+3]]+"-"+U[e[t+4]]+U[e[t+5]]+"-"+U[e[t+6]]+U[e[t+7]]+"-"+U[e[t+8]]+U[e[t+9]]+"-"+U[e[t+10]]+U[e[t+11]]+U[e[t+12]]+U[e[t+13]]+U[e[t+14]]+U[e[t+15]]}const P=function(e,t,r){if(k.randomUUID&&!t&&!e)return k.randomUUID();const n=(e=e||{}).random||(e.rng||A)();if(n[6]=15&n[6]|64,n[8]=63&n[8]|128,t){r=r||0;for(let e=0;e<16;++e)t[r+e]=n[e];return t}return x(n)},L=window.wp.url,j=window.wp.deprecated;var N=r.n(j);function D(e,t,r){if(!e||"object"!=typeof e)return e;const n=Array.isArray(t)?t:t.split(".");return n.reduce(((e,t,s)=>(void 0===e[t]&&(Number.isInteger(n[s+1])?e[t]=[]:e[t]={}),s===n.length-1&&(e[t]=r),e[t])),e),e}function M(e,t,r){if(!e||"object"!=typeof e||"string"!=typeof t&&!Array.isArray(t))return e;const n=Array.isArray(t)?t:t.split(".");let s=e;return n.forEach((e=>{s=s?.[e]})),void 0!==s?s:r}function V(e,t,r){return{type:"RECEIVE_ITEMS",items:Array.isArray(e)?e:[e],persistedEdits:t,meta:r}}let G=null;async function q(e){if(null===G){const e=await S()({path:"/batch/v1",method:"OPTIONS"});G=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,G)){const e=await S()({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 B(e=q){let t=0,r=[];const n=new F;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 F{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 $="core";function K(e,t){return{type:"RECEIVE_USER_QUERY",users:Array.isArray(t)?t:[t],queryID:e}}function Q(e){return{type:"RECEIVE_CURRENT_USER",currentUser:e}}function Y(e){return{type:"ADD_ENTITIES",entities:e}}function H(e,t,r,n,s=!1,i,o){let a;return"postType"===e&&(r=(Array.isArray(r)?r:[r]).map((e=>"auto-draft"===e.status?{...e,title:""}:e))),a=n?function(e,t={},r,n){return{...V(e,r,n),query:t}}(r,n,i,o):V(r,i,o),{...a,kind:e,name:t,invalidateCache:s}}function z(e){return{type:"RECEIVE_CURRENT_THEME",currentTheme:e}}function W(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 Z(){return N()("wp.data.dispatch( 'core' ).receiveThemeSupports",{since:"5.9"}),{type:"DO_NOTHING"}}function ee(e,t){return N()("wp.data.dispatch( 'core' ).receiveThemeGlobalStyleRevisions()",{since:"6.5.0",alternative:"wp.data.dispatch( 'core' ).receiveRevisions"}),{type:"RECEIVE_THEME_GLOBAL_STYLE_REVISIONS",currentId:e,revisions:t}}function te(e,t){return{type:"RECEIVE_EMBED_PREVIEW",url:e,preview:t}}const re=(e,t,r,n,{__unstableFetch:s=S(),throwOnError:i=!1}={})=>async({dispatch:o})=>{const a=(await o(Ie(e,t))).find((r=>r.kind===e&&r.name===t));let c,l=!1;if(!a||a?.__experimentalNoFetch)return;const u=await o.__unstableAcquireStoreLock($,["entities","records",e,t,r],{exclusive:!0});try{o({type:"DELETE_ENTITY_RECORD_START",kind:e,name:t,recordId:r});let u=!1;try{let i=`${a.baseURL}/${r}`;n&&(i=(0,L.addQueryArgs)(i,n)),l=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){u=!0,c=e}if(o({type:"DELETE_ENTITY_RECORD_FINISH",kind:e,name:t,recordId:r,error:c}),u&&i)throw c;return l}finally{o.__unstableReleaseStoreLock(u)}},ne=(e,t,r,n,s={})=>({select:i,dispatch:o})=>{const a=i.getEntityConfig(e,t);if(!a)throw new Error(`The entity being edited (${e}, ${t}) does not have a loaded config.`);const{mergedEdits:l={}}=a,u=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=u[t],s=d[t],i=l[t]?{...s,...n[t]}:n[t];return e[t]=c()(r,i)?void 0:i,e}),{})};window.__experimentalEnableSync&&a.syncConfig||(s.undoIgnore||i.getUndoManager().addRecord([{id:{kind:e,name:t,recordId:r},changes:Object.keys(n).reduce(((e,t)=>(e[t]={from:d[t],to:n[t]},e)),{})}],s.isCached),o({type:"EDIT_ENTITY_RECORD",...p}))},se=()=>({select:e,dispatch:t})=>{const r=e.getUndoManager().undo();r&&t({type:"UNDO",record:r})},ie=()=>({select:e,dispatch:t})=>{const r=e.getUndoManager().redo();r&&t({type:"REDO",record:r})},oe=()=>({select:e})=>{e.getUndoManager().addRecord()},ae=(e,t,r,{isAutosave:n=!1,__unstableFetch:s=S(),throwOnError:i=!1}={})=>async({select:o,resolveSelect:a,dispatch:c})=>{const l=(await c(Ie(e,t))).find((r=>r.kind===e&&r.name===t));if(!l||l?.__experimentalNoFetch)return;const u=l.key||ge,d=r[u],p=await c.__unstableAcquireStoreLock($,["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 u,p;c({type:"SAVE_ENTITY_RECORD_START",kind:e,name:t,recordId:d,isAutosave:n});let f=!1;try{const i=`${l.baseURL}${d?"/"+d:""}`,p=o.getRawEntityRecord(e,t,d);if(n){const n=o.getCurrentUser(),l=n?n.id:void 0,d=await a.getAutosave(p.type,p.id,l);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":void 0}),u=await s({path:`${i}/autosaves`,method:"POST",data:f}),p.id===u.id){let r={...p,...f,...u};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,u)}else{let n=r;l.__unstablePrePersist&&(n={...n,...l.__unstablePrePersist(p,n)}),u=await s({path:i,method:d?"PUT":"POST",data:n}),c.receiveEntityRecords(e,t,u,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 u}finally{c.__unstableReleaseStoreLock(p)}},ce=e=>async({dispatch:t})=>{const r=B(),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(Ie(e,t))).find((r=>r.kind===e&&r.name===t));if(!o)return;const a=o.key||ge,c=s.getEntityRecordNonTransientEdits(e,t,r),l={[a]:r,...c};return await i.saveEntityRecord(e,t,l,n)},ue=(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 of n)D(c,e,M(a,e));const l=(await o(Ie(e,t))).find((r=>r.kind===e&&r.name===t));return r&&(c[l?.key||ge]=r),await o.saveEntityRecord(e,t,c,s)};function de(e){return N()("wp.data.dispatch( 'core' ).receiveUploadPermissions",{since:"5.9",alternative:"receiveUserPermission"}),pe("create/media",e)}function pe(e,t){return{type:"RECEIVE_USER_PERMISSION",key:e,isAllowed:t}}function fe(e,t){return{type:"RECEIVE_AUTOSAVES",postId:e,autosaves:Array.isArray(t)?t:[t]}}function ye(e){return{type:"RECEIVE_NAVIGATION_FALLBACK_ID",fallbackId:e}}function Ee(e,t){return{type:"RECEIVE_DEFAULT_TEMPLATE",query:e,templateId:t}}const me=(e,t,r,n,s,i=!1,o)=>async({dispatch:a})=>{const c=(await a(Ie(e,t))).find((r=>r.kind===e&&r.name===t));a({type:"RECEIVE_ITEM_REVISIONS",key:c&&c?.revisionKey?c.revisionKey:ge,items:Array.isArray(n)?n:[n],recordKey:r,meta:o,query:s,kind:e,name:t,invalidateCache:i})},ge="id",he=["title","excerpt","content"],ve=[{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(",")},plural:"__unstableBases",syncConfig:{fetch:async()=>S()({path:"/"}),applyChangesToDoc:(e,t)=>{const r=e.getMap("document");Object.entries(t).forEach((([e,t])=>{r.get(e)!==t&&r.set(e,t)}))},fromCRDTDoc:e=>e.getMap("document").toJSON()},syncObjectType:"root/base",getSyncObjectId:()=>"index"},{label:(0,T.__)("Post Type"),name:"postType",kind:"root",key:"slug",baseURL:"/wp/v2/types",baseURLParams:{context:"edit"},plural:"postTypes",syncConfig:{fetch:async e=>S()({path:`/wp/v2/types/${e}?context=edit`}),applyChangesToDoc:(e,t)=>{const r=e.getMap("document");Object.entries(t).forEach((([e,t])=>{r.get(e)!==t&&r.set(e,t)}))},fromCRDTDoc:e=>e.getMap("document").toJSON()},syncObjectType:"root/postType",getSyncObjectId:e=>e},{name:"media",kind:"root",baseURL:"/wp/v2/media",baseURLParams:{context:"edit"},plural:"mediaItems",label:(0,T.__)("Media"),rawAttributes:["caption","title","description"],supportsPagination:!0},{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,getRevisionsUrl:(e,t)=>`/wp/v2/global-styles/${e}/revisions${t?"/"+t:""}`,supportsPagination:!0},{label:(0,T.__)("Themes"),name:"theme",kind:"root",baseURL:"/wp/v2/themes",baseURLParams:{context:"edit"},plural:"themes",key:"stylesheet"},{label:(0,T.__)("Plugins"),name:"plugin",kind:"root",baseURL:"/wp/v2/plugins",baseURLParams:{context:"edit"},plural:"plugins",key:"plugin"},{label:(0,T.__)("Status"),name:"status",kind:"root",baseURL:"/wp/v2/statuses",baseURLParams:{context:"edit"},plural:"statuses",key:"slug"}],_e=[{kind:"postType",loadEntities:async function(){const e=await S()({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),s=null!==(r=t?.rest_namespace)&&void 0!==r?r:"wp/v2";return{kind:"postType",baseURL:`/${s}/${t.rest_base}`,baseURLParams:{context:"edit"},name:e,label:t.name,transientEdits:{blocks:!0,selection:!0},mergedEdits:{meta:!0},rawAttributes:he,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={}),h(r,y({delimiter:" ",transform:_},s))):String(e.id))},__unstablePrePersist:n?void 0:Re,__unstable_rest_base:t.rest_base,syncConfig:{fetch:async e=>S()({path:`/${s}/${t.rest_base}/${e}?context=edit`}),applyChangesToDoc:(e,t)=>{const r=e.getMap("document");Object.entries(t).forEach((([e,t])=>{"function"!=typeof t&&("blocks"===e&&(be.has(t)||be.set(t,Se(t)),t=be.get(t)),r.get(e)!==t&&r.set(e,t))}))},fromCRDTDoc:e=>e.getMap("document").toJSON()},syncObjectType:"postType/"+t.name,getSyncObjectId:e=>e,supportsPagination:!0,getRevisionsUrl:(e,r)=>`/${s}/${t.rest_base}/${e}/revisions${r?"/"+r:""}`,revisionKey:n?"wp_id":ge}}))}},{kind:"taxonomy",loadEntities:async function(){const e=await S()({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}}))}},{kind:"root",name:"site",plural:"sites",loadEntities:async function(){var e;const t={label:(0,T.__)("Site"),name:"site",kind:"root",baseURL:"/wp/v2/settings",syncConfig:{fetch:async()=>S()({path:"/wp/v2/settings"}),applyChangesToDoc:(e,t)=>{const r=e.getMap("document");Object.entries(t).forEach((([e,t])=>{r.get(e)!==t&&r.set(e,t)}))},fromCRDTDoc:e=>e.getMap("document").toJSON()},syncObjectType:"root/site",getSyncObjectId:()=>"index",meta:{}},r=await S()({path:t.baseURL,method:"OPTIONS"}),n={};return Object.entries(null!==(e=r?.schema?.properties)&&void 0!==e?e:{}).forEach((([e,t])=>{"object"==typeof t&&t.title&&(n[e]=t.title)})),[{...t,meta:{labels:n}}]}}],Re=(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},be=new WeakMap;function we(e){const t={...e};for(const[r,n]of Object.entries(e))n instanceof I.RichTextData&&(t[r]=n.valueOf());return t}function Se(e){return e.map((e=>{const{innerBlocks:t,attributes:r,...n}=e;return{...n,attributes:we(r),innerBlocks:Se(t)}}))}const Te=(e,t,r="get")=>`${r}${"root"===e?"":b(e)}${b(t)}`;const Ie=(e,t)=>async({select:r,dispatch:n})=>{let s=r.getEntitiesConfig(e);const i=!!r.getEntityConfig(e,t);if(s?.length>0&&i)return window.__experimentalEnableSync,s;const o=_e.find((r=>t&&r.name?r.kind===e&&r.name===t:r.kind===e));return o?(s=await o.loadEntities(),window.__experimentalEnableSync,n(Y(s)),s):[]};const ke=function(e){return"string"==typeof e?e.split(","):Array.isArray(e)?e:null};const Oe=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}};const Ce=Oe((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=i&&r!t.some((t=>Number.isInteger(t)?t===+e:t===e)))))}const Pe=(0,l.compose)([d((e=>"query"in e)),p((e=>e.query?{...e,...Ce(e.query)}:e)),f("context"),f("stableKey")])(((e={},t)=>{const{type:r,page:n,perPage:s,key:i=ge}=t;return"RECEIVE_ITEMS"!==r?e:{itemIds:Ue(e?.itemIds||[],t.items.map((e=>e?.[i])).filter(Boolean),n,s),meta:t.meta}})),Le=(0,o.combineReducers)({items:function(e={},t){switch(t.type){case"RECEIVE_ITEMS":{const r=Ae(t),n=t.key||ge;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)c()(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,xe(r,t.itemIds)])))}return e},itemIsComplete:function(e={},t){switch(t.type){case"RECEIVE_ITEMS":{const r=Ae(t),{query:n,key:s=ge}=t,i=n?Ce(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,xe(r,t.itemIds)])))}return e},queries:(e={},t)=>{switch(t.type){case"RECEIVE_ITEMS":return Pe(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,itemIds:t.itemIds.filter((e=>!r[e]))}])))])));default:return e}}});const je=e=>(t,r)=>{if("UNDO"===r.type||"REDO"===r.type){const{record:n}=r;let s=t;return n.forEach((({id:{kind:t,name:n,recordId:i},changes:o})=>{s=e(s,{type:"EDIT_ENTITY_RECORD",kind:t,name:n,recordId:i,edits:Object.entries(o).reduce(((e,[t,n])=>(e[t]="UNDO"===r.type?n.from:n.to,e)),{})})})),s}return e(t,r)};function Ne(e){return(0,l.compose)([je,d((t=>t.name&&t.kind&&t.name===e.name&&t.kind===e.kind)),p((t=>({key:e.key||ge,...t})))])((0,o.combineReducers)({queriedData:Le,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 c()(s[n],null!==(i=e[n]?.raw)&&void 0!==i?i:e[n])||t.persistedEdits&&c()(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},revisions:(e={},t)=>{if("RECEIVE_ITEM_REVISIONS"===t.type){const r=t.recordKey;delete t.recordKey;const n=Le(e[r],{...t,type:"RECEIVE_ITEMS"});return{...e,[r]:n}}return"REMOVE_ITEMS"===t.type?Object.fromEntries(Object.entries(e).filter((([e])=>!t.itemIds.some((t=>Number.isInteger(t)?t===+e:t===e))))):e}}))}const De=(0,o.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=ve,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,o.combineReducers)(Object.entries(e).reduce(((e,[t,r])=>{const n=(0,o.combineReducers)(r.reduce(((e,t)=>({...e,[t.name]:Ne(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}},editsReference:function(e={},t){switch(t.type){case"EDIT_ENTITY_RECORD":case"UNDO":case"REDO":return{}}return e},undoManager:function(e=(0,u.createUndoManager)()){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},userPatternCategories:function(e=[],t){return"RECEIVE_USER_PATTERN_CATEGORIES"===t.type?t.patternCategories:e},navigationFallbackId:function(e=null,t){return"RECEIVE_NAVIGATION_FALLBACK_ID"===t.type?t.fallbackId:e},defaultTemplates:function(e={},t){return"RECEIVE_DEFAULT_TEMPLATE"===t.type?{...e,[JSON.stringify(t.query)]:t.templateId}:e}});var Me=r(3249),Ve=r.n(Me);const Ge=new WeakMap;const qe=(0,o.createSelector)(((e,t={})=>{let r=Ge.get(e);if(r){const e=r.get(t);if(void 0!==e)return e}else r=new(Ve()),Ge.set(e,r);const n=function(e,t){const{stableKey:r,page:n,perPage:s,include:i,fields:o,context:a}=Ce(t);let c;if(e.queries?.[a]?.[r]&&(c=e.queries[a][r].itemIds),!c)return null;const l=-1===s?0:(n-1)*s,u=-1===s?c.length:Math.min(l+s,c.length),d=[];for(let t=l;t{r=r?.[e]})),D(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}));function Be(e,t={}){var r;const{stableKey:n,context:s}=Ce(t);return null!==(r=e.queries?.[s]?.[n]?.meta?.totalItems)&&void 0!==r?r:null}const Fe={},$e=(0,o.createRegistrySelector)((e=>(t,r)=>e($).isResolving("getEmbedPreview",[r])));function Ke(e,t){N()("select( 'core' ).getAuthors()",{since:"5.9",alternative:"select( 'core' ).getUsers({ who: 'authors' })"});const r=(0,L.addQueryArgs)("/wp/v2/users/?who=authors&per_page=100",t);return Ye(e,r)}function Qe(e){return e.currentUser}const Ye=(0,o.createSelector)(((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 He(e,t){return N()("wp.data.select( 'core' ).getEntitiesByKind()",{since:"6.0",alternative:"wp.data.select( 'core' ).getEntitiesConfig()"}),ze(e,t)}const ze=(0,o.createSelector)(((e,t)=>e.entities.config.filter((e=>e.kind===t))),((e,t)=>e.entities.config));function We(e,t,r){return N()("wp.data.select( 'core' ).getEntity()",{since:"6.0",alternative:"wp.data.select( 'core' ).getEntityConfig()"}),Je(e,t,r)}function Je(e,t,r){return e.entities.config?.find((e=>e.kind===t&&e.name===r))}const Xe=(0,o.createSelector)(((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 l;const e={},t=null!==(l=ke(s._fields))&&void 0!==l?l:[];for(let r=0;r{s=s?.[e]})),D(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 Ze(e,t,r,n){return Xe(e,t,r,n)}Xe.__unstableNormalizeArgs=e=>{const t=[...e],r=t?.[2];return t[2]=/^\s*\d+\s*$/.test(r)?Number(r):r,t};const et=(0,o.createSelector)(((e,t,r,n)=>{const s=Xe(e,t,r,n);return s&&Object.keys(s).reduce(((n,i)=>{var o;(function(e,t){return(e.rawAttributes||[]).includes(t)})(Je(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 tt(e,t,r,n){return Array.isArray(rt(e,t,r,n))}const rt=(e,t,r,n)=>{const s=e.entities.records?.[t]?.[r]?.queriedData;return s?qe(s,n):null},nt=(e,t,r,n)=>{const s=e.entities.records?.[t]?.[r]?.queriedData;return s?Be(s,n):null},st=(e,t,r,n)=>{const s=e.entities.records?.[t]?.[r]?.queriedData;if(!s)return null;if(-1===n.per_page)return 1;const i=Be(s,n);return i?n.per_page?Math.ceil(i/n.per_page):function(e,t={}){var r;const{stableKey:n,context:s}=Ce(t);return null!==(r=e.queries?.[s]?.[n]?.meta?.totalPages)&&void 0!==r?r:null}(s,n):i},it=(0,o.createSelector)((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=>Xe(e,n,s,t)&<(e,n,s,t)));if(i.length){const t=Je(e,n,s);i.forEach((i=>{const o=ut(e,n,s,i);r.push({key:o?o[t.key||ge]:void 0,title:t?.getTitle?.(o)||"",name:s,kind:n})}))}}))})),r}),(e=>[e.entities.records])),ot=(0,o.createSelector)((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=>pt(e,n,s,t)));if(i.length){const t=Je(e,n,s);i.forEach((i=>{const o=ut(e,n,s,i);r.push({key:o?o[t.key||ge]:void 0,title:t?.getTitle?.(o)||"",name:s,kind:n})}))}}))})),r}),(e=>[e.entities.records]));function at(e,t,r,n){return e.entities.records?.[t]?.[r]?.edits?.[n]}const ct=(0,o.createSelector)(((e,t,r,n)=>{const{transientEdits:s}=Je(e,t,r)||{},i=at(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 lt(e,t,r,n){return pt(e,t,r,n)||Object.keys(ct(e,t,r,n)).length>0}const ut=(0,o.createSelector)(((e,t,r,n)=>{const s=et(e,t,r,n),i=at(e,t,r,n);return!(!s&&!i)&&{...s,...i}}),((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 dt(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 pt(e,t,r,n){var s;return null!==(s=e.entities.records?.[t]?.[r]?.saving?.[n]?.pending)&&void 0!==s&&s}function ft(e,t,r,n){var s;return null!==(s=e.entities.records?.[t]?.[r]?.deleting?.[n]?.pending)&&void 0!==s&&s}function yt(e,t,r,n){return e.entities.records?.[t]?.[r]?.saving?.[n]?.error}function Et(e,t,r,n){return e.entities.records?.[t]?.[r]?.deleting?.[n]?.error}function mt(e){N()("select( 'core' ).getUndoEdit()",{since:"6.3"})}function gt(e){N()("select( 'core' ).getRedoEdit()",{since:"6.3"})}function ht(e){return e.undoManager.hasUndo()}function vt(e){return e.undoManager.hasRedo()}function _t(e){return e.currentTheme?Xe(e,"root","theme",e.currentTheme):null}function Rt(e){return e.currentGlobalStylesId}function bt(e){var t;return null!==(t=_t(e)?.theme_supports)&&void 0!==t?t:Fe}function wt(e,t){return e.embedPreviews[t]}function St(e,t){const r=e.embedPreviews[t],n=''+t+"";return!!r&&r.html===n}function Tt(e,t,r,n){const s=[t,r,n].filter(Boolean).join("/");return e.userPermissions[s]}function It(e,t,r,n){const s=Je(e,t,r);if(!s)return!1;return Tt(e,"update",s.__unstable_rest_base,n)}function kt(e,t,r){return e.autosaves[r]}function Ot(e,t,r,n){if(void 0===n)return;const s=e.autosaves[r];return s?.find((e=>e.author===n))}const Ct=(0,o.createRegistrySelector)((e=>(t,r,n)=>e($).hasFinishedResolution("getAutosaves",[r,n])));function At(e){return e.editsReference}function Ut(e,t){const r=rt(e,"postType","wp_template",{"find-template":t});return r?.length?ut(e,"postType","wp_template",r[0].id):null}function xt(e){const t=_t(e);return t?e.themeBaseGlobalStyles[t.stylesheet]:null}function Pt(e){const t=_t(e);return t?e.themeGlobalStyleVariations[t.stylesheet]:null}function Lt(e){return e.blockPatterns}function jt(e){return e.blockPatternCategories}function Nt(e){return e.userPatternCategories}function Dt(e){N()("select( 'core' ).getCurrentThemeGlobalStylesRevisions()",{since:"6.5.0",alternative:"select( 'core' ).getRevisions( 'root', 'globalStyles', ${ recordKey } )"});const t=Rt(e);return t?e.themeGlobalStyleRevisions[t]:null}function Mt(e,t){return e.defaultTemplates[JSON.stringify(t)]}const Vt=(e,t,r,n,s)=>{const i=e.entities.records?.[t]?.[r]?.revisions?.[n];return i?qe(i,s):null},Gt=(0,o.createSelector)(((e,t,r,n,s,i)=>{var o;const a=e.entities.records?.[t]?.[r]?.revisions?.[n];if(!a)return;const c=null!==(o=i?.context)&&void 0!==o?o:"default";if(void 0===i){if(!a.itemIsComplete[c]?.[s])return;return a.items[c][s]}const l=a.items[c]?.[s];if(l&&i._fields){var u;const e={},t=null!==(u=ke(i._fields))&&void 0!==u?u:[];for(let r=0;r{s=s?.[e]})),D(e,n,s)}return e}return l}),((e,t,r,n,s,i)=>{var o;const a=null!==(o=i?.context)&&void 0!==o?o:"default";return[e.entities.records?.[t]?.[r]?.revisions?.[n]?.items?.[a]?.[s],e.entities.records?.[t]?.[r]?.revisions?.[n]?.itemIsComplete?.[a]?.[s]]}));function qt(e){return e.undoManager}function Bt(e){return e.navigationFallbackId}const Ft=(0,o.createRegistrySelector)((e=>(0,o.createSelector)(((t,r)=>e($).getBlockPatterns().filter((({postTypes:e})=>!e||Array.isArray(e)&&e.includes(r)))),(()=>[e($).getBlockPatterns()]))));function $t(e,t){return 0===t?e.toLowerCase():R(e,t)}function Kt(e,t){return void 0===t&&(t={}),b(e,y({transform:$t},t))}const Qt=window.wp.htmlEntities,Yt=e=>(...t)=>async({resolveSelect:r})=>{await r[e](...t)},Ht=async(e,t={},r={})=>{const{isInitialSuggestions:n=!1,initialSuggestionsSearchOptions:s}=t,{disablePostFormats:i=!1}=r;let{type:o,subtype:a,page:c,perPage:l=(n?3:20)}=t;const u=[];return n&&s&&(o=s.type||o,a=s.subtype||a,c=s.page||c,l=s.perPage||l),o&&"post"!==o||u.push(S()({path:(0,L.addQueryArgs)("/wp/v2/search",{search:e,page:c,per_page:l,type:"post",subtype:a})}).then((e=>e.map((e=>({...e,meta:{kind:"post-type",subtype:a}}))))).catch((()=>[]))),o&&"term"!==o||u.push(S()({path:(0,L.addQueryArgs)("/wp/v2/search",{search:e,page:c,per_page:l,type:"term",subtype:a})}).then((e=>e.map((e=>({...e,meta:{kind:"taxonomy",subtype:a}}))))).catch((()=>[]))),i||o&&"post-format"!==o||u.push(S()({path:(0,L.addQueryArgs)("/wp/v2/search",{search:e,page:c,per_page:l,type:"post-format",subtype:a})}).then((e=>e.map((e=>({...e,meta:{kind:"taxonomy",subtype:a}}))))).catch((()=>[]))),o&&"attachment"!==o||u.push(S()({path:(0,L.addQueryArgs)("/wp/v2/media",{search:e,page:c,per_page:l})}).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,l).map((e=>{const t="attachment"===e.type;return{id:e.id,url:t?e.source_url:e.url,title:(0,Qt.decodeEntities)(t?e.title.rendered:e.title||"")||(0,T.__)("(no title)"),type:e.subtype||e.type,kind:e?.meta?.kind}}))))},zt=new Map,Wt=async(e,t={})=>{const r={url:(0,L.prependHTTP)(e)};if(!(0,L.isURL)(e))return Promise.reject(`${e} is not a valid URL.`);const n=(0,L.getProtocol)(e);return n&&(0,L.isValidProtocol)(n)&&n.startsWith("http")&&/^https?:\/\/[^\/\s]/i.test(e)?zt.has(e)?zt.get(e):S()({path:(0,L.addQueryArgs)("/wp-block-editor/v1/url-details",r),...t}).then((t=>(zt.set(e,t),t))):Promise.reject(`${e} does not have a valid protocol. URLs must be "http" based`)};async function Jt(){const e=await S()({path:"/wp/v2/block-patterns/patterns"});return e?e.map((e=>Object.fromEntries(Object.entries(e).map((([e,t])=>[Kt(e),t]))))):[]}const Xt=e=>async({dispatch:t})=>{const r=(0,L.addQueryArgs)("/wp/v2/users/?who=authors&per_page=100",e),n=await S()({path:r});t.receiveUserQuery(r,n)},Zt=()=>async({dispatch:e})=>{const t=await S()({path:"/wp/v2/users/me"});e.receiveCurrentUser(t)},er=(e,t,r="",n)=>async({select:s,dispatch:i})=>{const o=(await i(Ie(e,t))).find((r=>r.name===t&&r.kind===e));if(!o||o?.__experimentalNoFetch)return;const a=await i.__unstableAcquireStoreLock($,["entities","records",e,t,r],{exclusive:!1});try{if(window.__experimentalEnableSync&&o.syncConfig&&!n)0;else{void 0!==n&&n._fields&&(n={...n,_fields:[...new Set([...ke(n._fields)||[],o.key||ge])].join()});const a=(0,L.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 S()({path:a});i.receiveEntityRecords(e,t,c,n)}}finally{i.__unstableReleaseStoreLock(a)}},tr=Yt("getEntityRecord"),rr=Yt("getEntityRecord"),nr=(e,t,r={})=>async({dispatch:n,registry:s})=>{const i=(await n(Ie(e,t))).find((r=>r.name===t&&r.kind===e));if(!i||i?.__experimentalNoFetch)return;const o=await n.__unstableAcquireStoreLock($,["entities","records",e,t],{exclusive:!1});try{r._fields&&(r={...r,_fields:[...new Set([...ke(r._fields)||[],i.key||ge])].join()});const a=(0,L.addQueryArgs)(i.baseURL,{...i.baseURLParams,...r});let c,l;if(i.supportsPagination&&-1!==r.per_page){const e=await S()({path:a,parse:!1});c=Object.values(await e.json()),l={totalItems:parseInt(e.headers.get("X-WP-Total")),totalPages:parseInt(e.headers.get("X-WP-TotalPages"))}}else c=Object.values(await S()({path:a}));r._fields&&(c=c.map((e=>(r._fields.split(",").forEach((t=>{e.hasOwnProperty(t)||(e[t]=void 0)})),e)))),s.batch((()=>{if(n.receiveEntityRecords(e,t,c,r,!1,void 0,l),!r?._fields&&!r.context){const r=i.key||ge,s=c.filter((e=>e?.[r])).map((n=>[e,t,n[r]]));n({type:"START_RESOLUTIONS",selectorName:"getEntityRecord",args:s}),n({type:"FINISH_RESOLUTIONS",selectorName:"getEntityRecord",args:s})}n.__unstableReleaseStoreLock(o)}))}catch(e){n.__unstableReleaseStoreLock(o)}};nr.shouldInvalidate=(e,t,r)=>("RECEIVE_ITEMS"===e.type||"REMOVE_ITEMS"===e.type)&&e.invalidateCache&&t===e.kind&&r===e.name;const sr=()=>async({dispatch:e,resolveSelect:t})=>{const r=await t.getEntityRecords("root","theme",{status:"active"});e.receiveCurrentTheme(r[0])},ir=Yt("getCurrentTheme"),or=e=>async({dispatch:t})=>{try{const r=await S()({path:(0,L.addQueryArgs)("/oembed/1.0/proxy",{url:e})});t.receiveEmbedPreview(e,r)}catch(r){t.receiveEmbedPreview(e,!1)}},ar=(e,t,r)=>async({dispatch:n,registry:s})=>{const{hasStartedResolution:i}=s.select($),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 S()({path:`/wp/v2/${o}`,method:"OPTIONS",parse:!1})}catch(e){return}const l=c.headers?.get("allow"),u=l?.allow||l||"",d={},p={create:"POST",read:"GET",update:"PUT",delete:"DELETE"};for(const[e,t]of Object.entries(p))d[e]=u.includes(t);for(const e of a)n.receiveUserPermission(`${e}/${o}`,d[e])},cr=(e,t,r)=>async({dispatch:n})=>{const s=(await n(Ie(e,t))).find((r=>r.name===t&&r.kind===e));if(!s)return;const i=s.__unstable_rest_base;await n(ar("update",i,r))},lr=(e,t)=>async({dispatch:r,resolveSelect:n})=>{const{rest_base:s,rest_namespace:i="wp/v2"}=await n.getPostType(e),o=await S()({path:`/${i}/${s}/${t}/autosaves?context=edit`});o&&o.length&&r.receiveAutosaves(t,o)},ur=(e,t)=>async({resolveSelect:r})=>{await r.getAutosaves(e,t)},dr=e=>async({dispatch:t,resolveSelect:r})=>{let n;try{n=await S()({url:(0,L.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})};dr.shouldInvalidate=e=>("RECEIVE_ITEMS"===e.type||"REMOVE_ITEMS"===e.type)&&e.invalidateCache&&"postType"===e.kind&&"wp_template"===e.name;const pr=()=>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)return;const s=n.match(/\/(\d+)(?:\?|$)/),i=s?Number(s[1]):null;i&&e.__experimentalReceiveCurrentGlobalStylesId(i)},fr=()=>async({resolveSelect:e,dispatch:t})=>{const r=await e.getCurrentTheme(),n=await S()({path:`/wp/v2/global-styles/themes/${r.stylesheet}`});t.__experimentalReceiveThemeBaseGlobalStyles(r.stylesheet,n)},yr=()=>async({resolveSelect:e,dispatch:t})=>{const r=await e.getCurrentTheme(),n=await S()({path:`/wp/v2/global-styles/themes/${r.stylesheet}/variations`});t.__experimentalReceiveThemeGlobalStyleVariations(r.stylesheet,n)},Er=()=>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 S()({url:s}),n=e?.map((e=>Object.fromEntries(Object.entries(e).map((([e,t])=>[Kt(e),t])))));t.receiveThemeGlobalStyleRevisions(r,n)}};Er.shouldInvalidate=e=>"SAVE_ENTITY_RECORD_FINISH"===e.type&&"root"===e.kind&&!e.error&&"globalStyles"===e.name;const mr=()=>async({dispatch:e})=>{e({type:"RECEIVE_BLOCK_PATTERNS",patterns:await Jt()})},gr=()=>async({dispatch:e})=>{e({type:"RECEIVE_BLOCK_PATTERN_CATEGORIES",categories:await S()({path:"/wp/v2/block-patterns/categories"})})},hr=()=>async({dispatch:e,resolveSelect:t})=>{const r=await t.getEntityRecords("taxonomy","wp_pattern_category",{per_page:-1,_fields:"id,name,description,slug",context:"view"});e({type:"RECEIVE_USER_PATTERN_CATEGORIES",patternCategories:r?.map((e=>({...e,label:(0,Qt.decodeEntities)(e.name),name:e.slug})))||[]})},vr=()=>async({dispatch:e,select:t})=>{const r=await S()({path:(0,L.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])}},_r=e=>async({dispatch:t})=>{const r=await S()({path:(0,L.addQueryArgs)("/wp/v2/templates/lookup",e)});r?.id&&t.receiveDefaultTemplateId(e,r.id)},Rr=(e,t,r,n={})=>async({dispatch:s})=>{const i=(await s(Ie(e,t))).find((r=>r.name===t&&r.kind===e));if(!i||i?.__experimentalNoFetch)return;n._fields&&(n={...n,_fields:[...new Set([...ke(n._fields)||[],i.revisionKey||ge])].join()});const o=(0,L.addQueryArgs)(i.getRevisionsUrl(r),n);let a,c;const l={},u=i.supportsPagination&&-1!==n.per_page;try{c=await S()({path:o,parse:!u})}catch(e){return}if(c&&(u?(a=Object.values(await c.json()),l.totalItems=parseInt(c.headers.get("X-WP-Total"))):a=Object.values(c),n._fields&&(a=a.map((e=>(n._fields.split(",").forEach((t=>{e.hasOwnProperty(t)||(e[t]=void 0)})),e)))),s.receiveRevisions(e,t,r,a,n,!1,l),!n?._fields&&!n.context)){const n=i.key||ge,o=a.filter((e=>e[n])).map((s=>[e,t,r,s[n]]));s({type:"START_RESOLUTIONS",selectorName:"getRevision",args:o}),s({type:"FINISH_RESOLUTIONS",selectorName:"getRevision",args:o})}};Rr.shouldInvalidate=(e,t,r,n)=>"SAVE_ENTITY_RECORD_FINISH"===e.type&&r===e.name&&t===e.kind&&!e.error&&n===e.recordId;const br=(e,t,r,n,s)=>async({dispatch:i})=>{const o=(await i(Ie(e,t))).find((r=>r.name===t&&r.kind===e));if(!o||o?.__experimentalNoFetch)return;void 0!==s&&s._fields&&(s={...s,_fields:[...new Set([...ke(s._fields)||[],o.revisionKey||ge])].join()});const a=(0,L.addQueryArgs)(o.getRevisionsUrl(r,n),s);let c;try{c=await S()({path:a})}catch(e){return}c&&i.receiveRevisions(e,t,r,c,s)};function wr(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 Sr(e,t){let r=e;for(const e of t){const t=r.children[e];if(!t)return null;r=t}return r}function Tr({exclusive:e},t){return!(!e||!t.length)||!(e||!t.filter((e=>e.exclusive)).length)}const Ir={requests:[],tree:{locks:[],children:{}}};function kr(e=Ir,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=wr(e.tree,o),c=Sr(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=wr(e.tree,n),i=Sr(s,n);return i.locks=i.locks.filter((e=>e!==r)),{...e,tree:s}}}return e}function Or(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(Tr({exclusive:n},e.locks))return!1;const o=Sr(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(Tr({exclusive:n},e.locks))return!1;return!0}function Cr(){let e=kr(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(Or(e,r,n,{exclusive:s})){const o={store:r,path:n,exclusive:s};e=kr(e,{type:"GRANT_LOCK_REQUEST",lock:o,request:t}),i(o)}}}return{acquire:function(r,n,s){return new Promise((i=>{e=kr(e,{type:"ENQUEUE_LOCK_REQUEST",request:{store:r,path:n,exclusive:s,notifyAcquired:i}}),t()}))},release:function(r){e=kr(e,{type:"RELEASE_LOCK",lock:r}),t()}}}function Ar(){const e=Cr();return{__unstableAcquireStoreLock:function(t,r,{exclusive:n}){return()=>e.acquire(t,r,n)},__unstableReleaseStoreLock:function(t){return()=>e.release(t)}}}const Ur=window.wp.privateApis,{lock:xr,unlock:Pr}=(0,Ur.__dangerousOptInToUnstableAPIsOnlyForCoreModules)("I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.","@wordpress/core-data"),Lr=window.wp.element,jr=window.wp.blocks,Nr=window.wp.blockEditor;let Dr;const Mr=new WeakMap;const Vr=new WeakMap;function Gr(e){if(!Vr.has(e)){const t=[];for(const r of function(e){if(Dr||(Dr=Pr(Nr.privateApis)),!Mr.has(e)){const t=Dr.getRichTextValues([e]);Mr.set(e,t)}return Mr.get(e)}(e))r&&r.replacements.forEach((({type:e,attributes:r})=>{"core/footnote"===e&&t.push(r["data-fn"])}));Vr.set(e,t)}return Vr.get(e)}let qr={};function Br(e,t){const r={blocks:e};if(!t)return r;if(void 0===t.footnotes)return r;const n=function(e){return e.flatMap(Gr)}(e),s=t.footnotes?JSON.parse(t.footnotes):[];if(s.map((e=>e.id)).join("")===n.join(""))return r;const i=n.map((e=>s.find((t=>t.id===e))||qr[e]||{id:e,content:""}));function o(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(o);continue}if("string"!=typeof r&&!(r instanceof I.RichTextData))continue;const s="string"==typeof r?I.RichTextData.fromHTMLString(r):new I.RichTextData(r);s.replacements.forEach((e=>{if("core/footnote"===e.type){const t=e.attributes["data-fn"],r=n.indexOf(t),s=(0,I.create)({html:e.innerHTML});s.text=String(r+1),s.formats=Array.from({length:s.text.length},(()=>s.formats[0])),s.replacements=Array.from({length:s.text.length},(()=>s.replacements[0])),e.innerHTML=(0,I.toHTMLString)({value:s})}})),e[t]="string"==typeof r?s.toHTMLString():s}return e}const a=function e(t){return t.map((t=>({...t,attributes:o(t.attributes),innerBlocks:e(t.innerBlocks)})))}(e);return qr={...qr,...s.reduce(((e,t)=>(n.includes(t.id)||(e[t.id]=t),e)),{})},{meta:{...t,footnotes:JSON.stringify(i)},blocks:a}}const Fr=window.ReactJSXRuntime,$r=[],Kr=(0,Lr.createContext)({});function Qr({kind:e,type:t,id:r,children:n}){const s=(0,Lr.useContext)(Kr),i=(0,Lr.useMemo)((()=>({...s,[e]:{...s?.[e],[t]:r}})),[s,e,t,r]);return(0,Fr.jsx)(Kr.Provider,{value:i,children:n})}function Yr(e,t){const r=(0,Lr.useContext)(Kr);return r?.[e]?.[t]}function Hr(e,t,r,n){const s=Yr(e,t),i=null!=n?n:s,{value:a,fullValue:c}=(0,o.useSelect)((n=>{const{getEntityRecord:s,getEditedEntityRecord:o}=n($),a=s(e,t,i),c=o(e,t,i);return a&&c?{value:c[r],fullValue:a[r]}:{}}),[e,t,i,r]),{editEntityRecord:l}=(0,o.useDispatch)($);return[a,(0,Lr.useCallback)((n=>{l(e,t,i,{[r]:n})}),[l,e,t,i,r]),c]}const zr=new WeakMap;function Wr(e,t,{id:r}={}){const n=Yr(e,t),s=null!=r?r:n,{getEntityRecord:i,getEntityRecordEdits:a}=(0,o.useSelect)($),{content:c,editedBlocks:l,meta:u}=(0,o.useSelect)((r=>{if(!s)return{};const{getEditedEntityRecord:n}=r($),i=n(e,t,s);return{editedBlocks:i.blocks,content:i.content,meta:i.meta}}),[e,t,s]),{__unstableCreateUndoLevel:d,editEntityRecord:p}=(0,o.useDispatch)($),f=(0,Lr.useMemo)((()=>{if(!s)return;if(l)return l;if(!c||"string"!=typeof c)return $r;const r=a(e,t,s),n=!r||!Object.keys(r).length?i(e,t,s):r;let o=zr.get(n);return o||(o=(0,jr.parse)(c),zr.set(n,o)),o}),[e,t,s,l,c,i,a]),y=(0,Lr.useCallback)((e=>Br(e,u)),[u]),E=(0,Lr.useCallback)(((r,n)=>{if(f===r)return d(e,t,s);const{selection:i,...o}=n,a={selection:i,content:({blocks:e=[]})=>(0,jr.__unstableSerializeAndClean)(e),...y(r)};p(e,t,s,a,{isCached:!1,...o})}),[e,t,s,f,y,d,p]),m=(0,Lr.useCallback)(((r,n)=>{const{selection:i,...o}=n,a={selection:i,...y(r)};p(e,t,s,a,{isCached:!0,...o})}),[e,t,s,y,p]);return[f,m,E]}const Jr=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;oe((e=>tn(t(e))),r)),t)}const tn=Jr((e=>{const t={};for(const r in e)Zr.includes(r)||Object.defineProperty(t,r,{get:()=>(...t)=>{const n=e[r](...t),s=e.getResolutionState(r,t)?.status;let i;switch(s){case"resolving":i=Xr.Resolving;break;case"finished":i=Xr.Success;break;case"error":i=Xr.Error;break;case void 0:i=Xr.Idle}return{data:n,status:i,isResolving:i===Xr.Resolving,hasStarted:i!==Xr.Idle,hasResolved:i===Xr.Success||i===Xr.Error}}});return t})),rn={};function nn(e,t,r,n={enabled:!0}){const{editEntityRecord:s,saveEditedEntityRecord:i}=(0,o.useDispatch)(En),a=(0,Lr.useMemo)((()=>({edit:(n,i={})=>s(e,t,r,n,i),save:(n={})=>i(e,t,r,{throwOnError:!0,...n})})),[s,e,t,r,i]),{editedRecord:c,hasEdits:l,edits:u}=(0,o.useSelect)((s=>n.enabled?{editedRecord:s(En).getEditedEntityRecord(e,t,r),hasEdits:s(En).hasEditsForEntityRecord(e,t,r),edits:s(En).getEntityRecordNonTransientEdits(e,t,r)}:{editedRecord:rn,hasEdits:!1,edits:rn}),[e,t,r,n.enabled]),{data:d,...p}=en((s=>n.enabled?s(En).getEntityRecord(e,t,r):{data:null}),[e,t,r,n.enabled]);return{record:d,editedRecord:c,hasEdits:l,edits:u,...p,...a}}function sn(e,t,r,n){return N()("wp.data.__experimentalUseEntityRecord",{alternative:"wp.data.useEntityRecord",since:"6.1"}),nn(e,t,r,n)}const on=[];function an(e,t,r={},n={enabled:!0}){const s=(0,L.addQueryArgs)("",r),{data:i,...a}=en((s=>n.enabled?s(En).getEntityRecords(e,t,r):{data:on}),[e,t,s,n.enabled]),{totalItems:c,totalPages:l}=(0,o.useSelect)((s=>n.enabled?{totalItems:s(En).getEntityRecordsTotalItems(e,t,r),totalPages:s(En).getEntityRecordsTotalPages(e,t,r)}:{totalItems:null,totalPages:null}),[e,t,s,n.enabled]);return{records:i,totalItems:c,totalPages:l,...a}}function cn(e,t,r,n){return N()("wp.data.__experimentalUseEntityRecords",{alternative:"wp.data.useEntityRecords",since:"6.1"}),an(e,t,r,n)}function ln(e,t){return en((r=>{const{canUser:n}=r(En),s=n("create",e);if(!t){const t=n("read",e),r=s.isResolving||t.isResolving,i=s.hasResolved&&t.hasResolved;let o=Xr.Idle;return r?o=Xr.Resolving:i&&(o=Xr.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,l=i.hasResolved&&s.hasResolved&&o.hasResolved&&a.hasResolved;let u=Xr.Idle;return c?u=Xr.Resolving:l&&(u=Xr.Success),{status:u,isResolving:c,hasResolved:l,canRead:l&&i.data,canCreate:l&&s.data,canUpdate:l&&o.data,canDelete:l&&a.data}}),[e,t])}function un(e,t){return N()("wp.data.__experimentalUseResourcePermissions",{alternative:"wp.data.useResourcePermissions",since:"6.1"}),ln(e,t)}const dn=[...ve,..._e.filter((e=>!!e.name))],pn=dn.reduce(((e,t)=>{const{kind:r,name:n,plural:s}=t;return e[Te(r,n)]=(e,t,s)=>Xe(e,r,n,t,s),s&&(e[Te(r,s,"get")]=(e,t)=>rt(e,r,n,t)),e}),{}),fn=dn.reduce(((e,t)=>{const{kind:r,name:n,plural:s}=t;if(e[Te(r,n)]=(e,t)=>er(r,n,e,t),s){const t=Te(r,s,"get");e[t]=(...e)=>nr(r,n,...e),e[t].shouldInvalidate=e=>nr.shouldInvalidate(e,r,n)}return e}),{}),yn=dn.reduce(((e,t)=>{const{kind:r,name:n}=t;return e[Te(r,n,"save")]=(e,t)=>ae(r,n,e,t),e[Te(r,n,"delete")]=(e,t,s)=>re(r,n,e,t,s),e}),{}),En=(0,o.createReduxStore)($,{reducer:De,actions:{...e,...yn,...Ar()},selectors:{...t,...pn},resolvers:{...i,...fn}});Pr(En).registerPrivateSelectors(s),(0,o.register)(En)})(),(window.wp=window.wp||{}).coreData=n})();block-directory.min.js000064400000050434147177406350011004 0ustar00/*! This file is auto-generated */ (()=>{"use strict";var e={n:t=>{var o=t&&t.__esModule?()=>t.default:()=>t;return e.d(o,{a:o}),o},d:(t,o)=>{for(var l in o)e.o(o,l)&&!e.o(t,l)&&Object.defineProperty(t,l,{enumerable:!0,get:o[l]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{store:()=>G});var o={};e.r(o),e.d(o,{getDownloadableBlocks:()=>h,getErrorNoticeForBlock:()=>y,getErrorNotices:()=>f,getInstalledBlockTypes:()=>m,getNewBlockTypes:()=>g,getUnusedBlockTypes:()=>w,isInstalling:()=>_,isRequestingDownloadableBlocks:()=>k});var l={};e.r(l),e.d(l,{addInstalledBlockType:()=>C,clearErrorNotice:()=>P,fetchDownloadableBlocks:()=>T,installBlockType:()=>S,receiveDownloadableBlocks:()=>L,removeInstalledBlockType:()=>A,setErrorNotice:()=>D,setIsInstalling:()=>R,uninstallBlockType:()=>O});var s={};e.r(s),e.d(s,{getDownloadableBlocks:()=>Y});const n=window.wp.plugins,r=window.wp.hooks,i=window.wp.blocks,a=window.wp.data,c=window.wp.element,d=window.wp.editor,u=(0,a.combineReducers)({downloadableBlocks:(e={},t)=>{switch(t.type){case"FETCH_DOWNLOADABLE_BLOCKS":return{...e,[t.filterValue]:{isRequesting:!0}};case"RECEIVE_DOWNLOADABLE_BLOCKS":return{...e,[t.filterValue]:{results:t.downloadableBlocks,isRequesting:!1}}}return e},blockManagement:(e={installedBlockTypes:[],isInstalling:{}},t)=>{switch(t.type){case"ADD_INSTALLED_BLOCK_TYPE":return{...e,installedBlockTypes:[...e.installedBlockTypes,t.item]};case"REMOVE_INSTALLED_BLOCK_TYPE":return{...e,installedBlockTypes:e.installedBlockTypes.filter((e=>e.name!==t.item.name))};case"SET_INSTALLING_BLOCK":return{...e,isInstalling:{...e.isInstalling,[t.blockId]:t.isInstalling}}}return e},errorNotices:(e={},t)=>{switch(t.type){case"SET_ERROR_NOTICE":return{...e,[t.blockId]:{message:t.message,isFatal:t.isFatal}};case"CLEAR_ERROR_NOTICE":const{[t.blockId]:o,...l}=e;return l}return e}}),p=window.wp.blockEditor;function b(e,t=[]){if(!t.length)return!1;if(t.some((({name:t})=>t===e.name)))return!0;for(let o=0;ot=>{const o=e(p.store).getBlocks();return m(t).filter((e=>b(e,o)))})),w=(0,a.createRegistrySelector)((e=>t=>{const o=e(p.store).getBlocks();return m(t).filter((e=>!b(e,o)))}));function _(e,t){return e.blockManagement.isInstalling[t]||!1}function f(e){return e.errorNotices}function y(e,t){return e.errorNotices[t]}const v=window.wp.i18n,x=window.wp.apiFetch;var j=e.n(x);const B=window.wp.notices,E=window.wp.url,I=e=>new Promise(((t,o)=>{const l=document.createElement(e.nodeName);["id","rel","src","href","type"].forEach((t=>{e[t]&&(l[t]=e[t])})),e.innerHTML&&l.appendChild(document.createTextNode(e.innerHTML)),l.onload=()=>t(!0),l.onerror=()=>o(new Error("Error loading asset.")),document.body.appendChild(l),("link"===l.nodeName.toLowerCase()||"script"===l.nodeName.toLowerCase()&&!l.src)&&t()}));function N(e){if(!e)return!1;const t=e.links["wp:plugin"]||e.links.self;return!(!t||!t.length)&&t[0].href}function T(e){return{type:"FETCH_DOWNLOADABLE_BLOCKS",filterValue:e}}function L(e,t){return{type:"RECEIVE_DOWNLOADABLE_BLOCKS",downloadableBlocks:e,filterValue:t}}const S=e=>async({registry:t,dispatch:o})=>{const{id:l,name:s}=e;let n=!1;o.clearErrorNotice(l);try{o.setIsInstalling(l,!0);const r=N(e);let a={};if(r)await j()({method:"PUT",url:r,data:{status:"active"}});else{a=(await j()({method:"POST",path:"wp/v2/plugins",data:{slug:l,status:"active"}}))._links}o.addInstalledBlockType({...e,links:{...e.links,...a}});const c=["api_version","title","category","parent","icon","description","keywords","attributes","provides_context","uses_context","supports","styles","example","variations"];await j()({path:(0,E.addQueryArgs)(`/wp/v2/block-types/${s}`,{_fields:c})}).catch((()=>{})).then((e=>{e&&(0,i.unstable__bootstrapServerSideBlockDefinitions)({[s]:Object.fromEntries(Object.entries(e).filter((([e])=>c.includes(e))))})})),await async function(){const e=await j()({url:document.location.href,parse:!1}),t=await e.text(),o=(new window.DOMParser).parseFromString(t,"text/html"),l=Array.from(o.querySelectorAll('link[rel="stylesheet"],script')).filter((e=>e.id&&!document.getElementById(e.id)));for(const e of l)await I(e)}();if(!t.select(i.store).getBlockTypes().some((e=>e.name===s)))throw new Error((0,v.__)("Error registering block. Try reloading the page."));t.dispatch(B.store).createInfoNotice((0,v.sprintf)((0,v.__)("Block %s installed and added."),e.title),{speak:!0,type:"snackbar"}),n=!0}catch(e){let s=e.message||(0,v.__)("An error occurred."),n=e instanceof Error;const r={folder_exists:(0,v.__)("This block is already installed. Try reloading the page."),unable_to_connect_to_filesystem:(0,v.__)("Error installing block. You can reload the page and try again.")};r[e.code]&&(n=!0,s=r[e.code]),o.setErrorNotice(l,s,n),t.dispatch(B.store).createErrorNotice(s,{speak:!0,isDismissible:!0})}return o.setIsInstalling(l,!1),n},O=e=>async({registry:t,dispatch:o})=>{try{const t=N(e);await j()({method:"PUT",url:t,data:{status:"inactive"}}),await j()({method:"DELETE",url:t}),o.removeInstalledBlockType(e)}catch(e){t.dispatch(B.store).createErrorNotice(e.message||(0,v.__)("An error occurred."))}};function C(e){return{type:"ADD_INSTALLED_BLOCK_TYPE",item:e}}function A(e){return{type:"REMOVE_INSTALLED_BLOCK_TYPE",item:e}}function R(e,t){return{type:"SET_INSTALLING_BLOCK",blockId:e,isInstalling:t}}function D(e,t,o=!1){return{type:"SET_ERROR_NOTICE",blockId:e,message:t,isFatal:o}}function P(e){return{type:"CLEAR_ERROR_NOTICE",blockId:e}}var M=function(){return M=Object.assign||function(e){for(var t,o=1,l=arguments.length;o0&&o>="0"&&o<="9"?"_"+o+l:""+o.toUpperCase()+l}function K(e,t){return void 0===t&&(t={}),function(e,t){void 0===t&&(t={});for(var o=t.splitRegexp,l=void 0===o?V:o,s=t.stripRegexp,n=void 0===s?H:s,r=t.transform,i=void 0===r?F:r,a=t.delimiter,c=void 0===a?" ":a,d=$($(e,l,"$1\0$2"),n,"\0"),u=0,p=d.length;"\0"===d.charAt(u);)u++;for(;"\0"===d.charAt(p-1);)p--;return d.slice(u,p).split("\0").map(i).join(c)}(e,M({delimiter:"",transform:z},t))}function U(e,t){return 0===t?e.toLowerCase():z(e,t)}const Y=e=>async({dispatch:t})=>{if(e)try{t(T(e));const o=await j()({path:`wp/v2/block-directory/search?term=${e}`});t(L(o.map((e=>Object.fromEntries(Object.entries(e).map((([e,t])=>{return[(o=e,void 0===l&&(l={}),K(o,M({transform:U},l))),t];var o,l}))))),e))}catch{}},q={reducer:u,selectors:o,actions:l,resolvers:s},G=(0,a.createReduxStore)("core/block-directory",q);function W(){const{uninstallBlockType:e}=(0,a.useDispatch)(G),t=(0,a.useSelect)((e=>{const{isAutosavingPost:t,isSavingPost:o}=e(d.store);return o()&&!t()}),[]),o=(0,a.useSelect)((e=>e(G).getUnusedBlockTypes()),[]);return(0,c.useEffect)((()=>{t&&o.length&&o.forEach((t=>{e(t),(0,i.unregisterBlockType)(t.name)}))}),[t]),null}(0,a.register)(G);const Z=window.wp.compose,J=window.wp.components,Q=window.wp.coreData,X=window.wp.htmlEntities;const ee=(0,c.forwardRef)((function({icon:e,size:t=24,...o},l){return(0,c.cloneElement)(e,{width:t,height:t,...o,ref:l})})),te=window.wp.primitives,oe=window.ReactJSXRuntime,le=(0,oe.jsx)(te.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,oe.jsx)(te.Path,{d:"M11.776 4.454a.25.25 0 01.448 0l2.069 4.192a.25.25 0 00.188.137l4.626.672a.25.25 0 01.139.426l-3.348 3.263a.25.25 0 00-.072.222l.79 4.607a.25.25 0 01-.362.263l-4.138-2.175a.25.25 0 00-.232 0l-4.138 2.175a.25.25 0 01-.363-.263l.79-4.607a.25.25 0 00-.071-.222L4.754 9.881a.25.25 0 01.139-.426l4.626-.672a.25.25 0 00.188-.137l2.069-4.192z"})}),se=(0,oe.jsx)(te.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,oe.jsx)(te.Path,{d:"M9.518 8.783a.25.25 0 00.188-.137l2.069-4.192a.25.25 0 01.448 0l2.07 4.192a.25.25 0 00.187.137l4.626.672a.25.25 0 01.139.427l-3.347 3.262a.25.25 0 00-.072.222l.79 4.607a.25.25 0 01-.363.264l-4.137-2.176a.25.25 0 00-.233 0l-4.138 2.175a.25.25 0 01-.362-.263l.79-4.607a.25.25 0 00-.072-.222L4.753 9.882a.25.25 0 01.14-.427l4.625-.672zM12 14.533c.28 0 .559.067.814.2l1.895.997-.362-2.11a1.75 1.75 0 01.504-1.55l1.533-1.495-2.12-.308a1.75 1.75 0 01-1.317-.957L12 7.39v7.143z"})}),ne=(0,oe.jsx)(te.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,oe.jsx)(te.Path,{fillRule:"evenodd",d:"M9.706 8.646a.25.25 0 01-.188.137l-4.626.672a.25.25 0 00-.139.427l3.348 3.262a.25.25 0 01.072.222l-.79 4.607a.25.25 0 00.362.264l4.138-2.176a.25.25 0 01.233 0l4.137 2.175a.25.25 0 00.363-.263l-.79-4.607a.25.25 0 01.072-.222l3.347-3.262a.25.25 0 00-.139-.427l-4.626-.672a.25.25 0 01-.188-.137l-2.069-4.192a.25.25 0 00-.448 0L9.706 8.646zM12 7.39l-.948 1.921a1.75 1.75 0 01-1.317.957l-2.12.308 1.534 1.495c.412.402.6.982.503 1.55l-.362 2.11 1.896-.997a1.75 1.75 0 011.629 0l1.895.997-.362-2.11a1.75 1.75 0 01.504-1.55l1.533-1.495-2.12-.308a1.75 1.75 0 01-1.317-.957L12 7.39z",clipRule:"evenodd"})});const re=function({rating:e}){const t=.5*Math.round(e/.5),o=Math.floor(e),l=Math.ceil(e-o),s=5-(o+l);return(0,oe.jsxs)("span",{"aria-label":(0,v.sprintf)((0,v.__)("%s out of 5 stars"),t),children:[Array.from({length:o}).map(((e,t)=>(0,oe.jsx)(ee,{className:"block-directory-block-ratings__star-full",icon:le,size:16},`full_stars_${t}`))),Array.from({length:l}).map(((e,t)=>(0,oe.jsx)(ee,{className:"block-directory-block-ratings__star-half-full",icon:se,size:16},`half_stars_${t}`))),Array.from({length:s}).map(((e,t)=>(0,oe.jsx)(ee,{className:"block-directory-block-ratings__star-empty",icon:ne,size:16},`empty_stars_${t}`)))]})},ie=({rating:e})=>(0,oe.jsx)("span",{className:"block-directory-block-ratings",children:(0,oe.jsx)(re,{rating:e})});const ae=function({icon:e}){const t="block-directory-downloadable-block-icon";return null!==e.match(/\.(jpeg|jpg|gif|png|svg)(?:\?.*)?$/)?(0,oe.jsx)("img",{className:t,src:e,alt:""}):(0,oe.jsx)(p.BlockIcon,{className:t,icon:e,showColors:!0})},ce=({block:e})=>{const t=(0,a.useSelect)((t=>t(G).getErrorNoticeForBlock(e.id)),[e]);return t?(0,oe.jsx)("div",{className:"block-directory-downloadable-block-notice",children:(0,oe.jsxs)("div",{className:"block-directory-downloadable-block-notice__content",children:[t.message,t.isFatal?" "+(0,v.__)("Try reloading the page."):null]})}):null},de=window.wp.privateApis,{lock:ue,unlock:pe}=(0,de.__dangerousOptInToUnstableAPIsOnlyForCoreModules)("I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.","@wordpress/block-directory"),{CompositeItemV2:be}=pe(J.privateApis);function ke({title:e,rating:t,ratingCount:o},{hasNotice:l,isInstalled:s,isInstalling:n}){const r=.5*Math.round(t/.5);return!s&&l?(0,v.sprintf)("Retry installing %s.",(0,X.decodeEntities)(e)):s?(0,v.sprintf)("Add %s.",(0,X.decodeEntities)(e)):n?(0,v.sprintf)("Installing %s.",(0,X.decodeEntities)(e)):o<1?(0,v.sprintf)("Install %s.",(0,X.decodeEntities)(e)):(0,v.sprintf)((0,v._n)("Install %1$s. %2$s stars with %3$s review.","Install %1$s. %2$s stars with %3$s reviews.",o),(0,X.decodeEntities)(e),r,o)}const he=function({composite:e,item:t,onClick:o}){const{author:l,description:s,icon:n,rating:r,title:d}=t,u=!!(0,i.getBlockType)(t.name),{hasNotice:p,isInstalling:b,isInstallable:k}=(0,a.useSelect)((e=>{const{getErrorNoticeForBlock:o,isInstalling:l}=e(G),s=o(t.id),n=s&&s.isFatal;return{hasNotice:!!s,isInstalling:l(t.id),isInstallable:!n}}),[t]);let h="";return u?h=(0,v.__)("Installed!"):b&&(h=(0,v.__)("Installing…")),(0,oe.jsxs)(be,{render:(0,oe.jsx)(J.Button,{__experimentalIsFocusable:!0,type:"button",role:"option",className:"block-directory-downloadable-block-list-item",isBusy:b,onClick:e=>{e.preventDefault(),o()},label:ke(t,{hasNotice:p,isInstalled:u,isInstalling:b}),showTooltip:!0,tooltipPosition:"top center"}),store:e,disabled:b||!k,children:[(0,oe.jsxs)("div",{className:"block-directory-downloadable-block-list-item__icon",children:[(0,oe.jsx)(ae,{icon:n,title:d}),b?(0,oe.jsx)("span",{className:"block-directory-downloadable-block-list-item__spinner",children:(0,oe.jsx)(J.Spinner,{})}):(0,oe.jsx)(ie,{rating:r})]}),(0,oe.jsxs)("span",{className:"block-directory-downloadable-block-list-item__details",children:[(0,oe.jsx)("span",{className:"block-directory-downloadable-block-list-item__title",children:(0,c.createInterpolateElement)((0,v.sprintf)((0,v.__)("%1$s by %2$s"),(0,X.decodeEntities)(d),l),{span:(0,oe.jsx)("span",{className:"block-directory-downloadable-block-list-item__author"})})}),p?(0,oe.jsx)(ce,{block:t}):(0,oe.jsxs)(oe.Fragment,{children:[(0,oe.jsx)("span",{className:"block-directory-downloadable-block-list-item__desc",children:h||(0,X.decodeEntities)(s)}),k&&!(u||b)&&(0,oe.jsx)(J.VisuallyHidden,{children:(0,v.__)("Install block")})]})]})]})},{CompositeV2:me,useCompositeStoreV2:ge}=pe(J.privateApis),we=()=>{};const _e=function({items:e,onHover:t=we,onSelect:o}){const l=ge(),{installBlockType:s}=(0,a.useDispatch)(G);return e.length?(0,oe.jsx)(me,{store:l,role:"listbox",className:"block-directory-downloadable-blocks-list","aria-label":(0,v.__)("Blocks available for install"),children:e.map((e=>(0,oe.jsx)(he,{composite:l,onClick:()=>{(0,i.getBlockType)(e.name)?o(e):s(e).then((t=>{t&&o(e)})),t(null)},onHover:t,item:e},e.id)))}):null},fe=window.wp.a11y;const ye=function({children:e,downloadableItems:t,hasLocalBlocks:o}){const l=t.length;return(0,c.useEffect)((()=>{(0,fe.speak)((0,v.sprintf)((0,v._n)("%d additional block is available to install.","%d additional blocks are available to install.",l),l))}),[l]),(0,oe.jsxs)(oe.Fragment,{children:[!o&&(0,oe.jsx)("p",{className:"block-directory-downloadable-blocks-panel__no-local",children:(0,v.__)("No results available from your installed blocks.")}),(0,oe.jsx)("div",{className:"block-editor-inserter__quick-inserter-separator"}),(0,oe.jsxs)("div",{className:"block-directory-downloadable-blocks-panel",children:[(0,oe.jsxs)("div",{className:"block-directory-downloadable-blocks-panel__header",children:[(0,oe.jsx)("h2",{className:"block-directory-downloadable-blocks-panel__title",children:(0,v.__)("Available to install")}),(0,oe.jsx)("p",{className:"block-directory-downloadable-blocks-panel__description",children:(0,v.__)("Select a block to install and add it to your post.")})]}),e]})]})},ve=(0,oe.jsx)(te.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,oe.jsx)(te.Path,{d:"M19 8h-1V6h-5v2h-2V6H6v2H5c-1.1 0-2 .9-2 2v8c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2v-8c0-1.1-.9-2-2-2zm.5 10c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5v-8c0-.3.2-.5.5-.5h14c.3 0 .5.2.5.5v8z"})});const xe=function(){return(0,oe.jsxs)(oe.Fragment,{children:[(0,oe.jsxs)("div",{className:"block-editor-inserter__no-results",children:[(0,oe.jsx)(ee,{className:"block-editor-inserter__no-results-icon",icon:ve}),(0,oe.jsx)("p",{children:(0,v.__)("No results found.")})]}),(0,oe.jsx)("div",{className:"block-editor-inserter__tips",children:(0,oe.jsxs)(J.Tip,{children:[(0,v.__)("Interested in creating your own block?"),(0,oe.jsx)("br",{}),(0,oe.jsxs)(J.ExternalLink,{href:"https://developer.wordpress.org/block-editor/",children:[(0,v.__)("Get started here"),"."]})]})})]})},je=[],Be=e=>(0,a.useSelect)((t=>{const{getDownloadableBlocks:o,isRequestingDownloadableBlocks:l,getInstalledBlockTypes:s}=t(G),n=t(Q.store).canUser("read","block-directory/search");let r=je;if(n){r=o(e);const t=s(),l=r.filter((({name:e})=>{const o=t.some((t=>t.name===e)),l=(0,i.getBlockType)(e);return o||!l}));l.length!==r.length&&(r=l),0===r.length&&(r=je)}return{hasPermission:n,downloadableBlocks:r,isLoading:l(e)}}),[e]);function Ee({onSelect:e,onHover:t,hasLocalBlocks:o,isTyping:l,filterValue:s}){const{hasPermission:n,downloadableBlocks:r,isLoading:i}=Be(s);return void 0===n||i||l?(0,oe.jsxs)(oe.Fragment,{children:[n&&!o&&(0,oe.jsxs)(oe.Fragment,{children:[(0,oe.jsx)("p",{className:"block-directory-downloadable-blocks-panel__no-local",children:(0,v.__)("No results available from your installed blocks.")}),(0,oe.jsx)("div",{className:"block-editor-inserter__quick-inserter-separator"})]}),(0,oe.jsx)("div",{className:"block-directory-downloadable-blocks-panel has-blocks-loading",children:(0,oe.jsx)(J.Spinner,{})})]}):!1===n||0===r.length?o?null:(0,oe.jsx)(xe,{}):(0,oe.jsx)(ye,{downloadableItems:r,hasLocalBlocks:o,children:(0,oe.jsx)(_e,{items:r,onSelect:e,onHover:t})})}const Ie=function(){const[e,t]=(0,c.useState)(""),o=(0,Z.debounce)(t,400);return(0,oe.jsx)(p.__unstableInserterMenuExtension,{children:({onSelect:t,onHover:l,filterValue:s,hasItems:n})=>(e!==s&&o(s),e?(0,oe.jsx)(Ee,{onSelect:t,onHover:l,filterValue:e,hasLocalBlocks:n,isTyping:s!==e}):null)})};function Ne({items:e}){return e.length?(0,oe.jsx)("ul",{className:"block-directory-compact-list",children:e.map((({icon:e,id:t,title:o,author:l})=>(0,oe.jsxs)("li",{className:"block-directory-compact-list__item",children:[(0,oe.jsx)(ae,{icon:e,title:o}),(0,oe.jsxs)("div",{className:"block-directory-compact-list__item-details",children:[(0,oe.jsx)("div",{className:"block-directory-compact-list__item-title",children:o}),(0,oe.jsx)("div",{className:"block-directory-compact-list__item-author",children:(0,v.sprintf)((0,v.__)("By %s"),l)})]})]},t)))}):null}var Te;const{PluginPrePublishPanel:Le}=null!==(Te=window?.wp?.editor)&&void 0!==Te?Te:{};function Se(){const e=(0,a.useSelect)((e=>e(G).getNewBlockTypes()),[]);return e.length?(0,oe.jsxs)(Le,{icon:ve,title:(0,v.sprintf)((0,v._n)("Added: %d block","Added: %d blocks",e.length),e.length),initialOpen:!0,children:[(0,oe.jsx)("p",{className:"installed-blocks-pre-publish-panel__copy",children:(0,v._n)("The following block has been added to your site.","The following blocks have been added to your site.",e.length)}),(0,oe.jsx)(Ne,{items:e})]}):null}function Oe({attributes:e,block:t,clientId:o}){const l=(0,a.useSelect)((e=>e(G).isInstalling(t.id)),[t.id]),{installBlockType:s}=(0,a.useDispatch)(G),{replaceBlock:n}=(0,a.useDispatch)(p.store);return(0,oe.jsx)(J.Button,{onClick:()=>s(t).then((l=>{if(l){const l=(0,i.getBlockType)(t.name),[s]=(0,i.parse)(e.originalContent);s&&l&&n(o,(0,i.createBlock)(l.name,s.attributes,s.innerBlocks))}})),__experimentalIsFocusable:!0,disabled:l,isBusy:l,variant:"primary",children:(0,v.sprintf)((0,v.__)("Install %s"),t.title)})}const Ce=({originalBlock:e,...t})=>{const{originalName:o,originalUndelimitedContent:l,clientId:s}=t.attributes,{replaceBlock:n}=(0,a.useDispatch)(p.store),r=()=>{n(t.clientId,(0,i.createBlock)("core/html",{content:l}))},d=!!l,u=(0,a.useSelect)((e=>{const{canInsertBlockType:t,getBlockRootClientId:o}=e(p.store);return t("core/html",o(s))}),[s]);let b=(0,v.sprintf)((0,v.__)("Your site doesn’t include support for the %s block. You can try installing the block or remove it entirely."),e.title||o);const k=[(0,oe.jsx)(Oe,{block:e,attributes:t.attributes,clientId:t.clientId},"install")];return d&&u&&(b=(0,v.sprintf)((0,v.__)("Your site doesn’t include support for the %s block. You can try installing the block, convert it to a Custom HTML block, or remove it entirely."),e.title||o),k.push((0,oe.jsx)(J.Button,{onClick:r,variant:"tertiary",children:(0,v.__)("Keep as HTML")},"convert"))),(0,oe.jsxs)("div",{...(0,p.useBlockProps)(),children:[(0,oe.jsx)(p.Warning,{actions:k,children:b}),(0,oe.jsx)(c.RawHTML,{children:l})]})},Ae=e=>t=>{const{originalName:o}=t.attributes,{block:l,hasPermission:s}=(0,a.useSelect)((e=>{const{getDownloadableBlocks:t}=e(G),l=t("block:"+o).filter((({name:e})=>o===e));return{hasPermission:e(Q.store).canUser("read","block-directory/search"),block:l.length&&l[0]}}),[o]);return s&&l?(0,oe.jsx)(Ce,{...t,originalBlock:l}):(0,oe.jsx)(e,{...t})};(0,n.registerPlugin)("block-directory",{render:()=>(0,oe.jsxs)(oe.Fragment,{children:[(0,oe.jsx)(W,{}),(0,oe.jsx)(Ie,{}),(0,oe.jsx)(Se,{})]})}),(0,r.addFilter)("blocks.registerBlockType","block-directory/fallback",((e,t)=>("core/missing"!==t||(e.edit=Ae(e.edit)),e))),(window.wp=window.wp||{}).blockDirectory=t})();i18n.min.js000064400000021665147177406350006473 0ustar00/*! This file is auto-generated */ (()=>{var t={2058:(t,e,r)=>{var n;!function(){"use strict";var i={not_string:/[^s]/,not_bool:/[^t]/,not_type:/[^T]/,not_primitive:/[^v]/,number:/[diefg]/,numeric_arg:/[bcdiefguxX]/,json:/[j]/,not_json:/[^j]/,text:/^[^\x25]+/,modulo:/^\x25{2}/,placeholder:/^\x25(?:([1-9]\d*)\$|\(([^)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-gijostTuvxX])/,key:/^([a-z_][a-z_\d]*)/i,key_access:/^\.([a-z_][a-z_\d]*)/i,index_access:/^\[(\d+)\]/,sign:/^[+-]/};function a(t){return function(t,e){var r,n,o,s,l,u,p,c,f,d=1,h=t.length,g="";for(n=0;n=0),s.type){case"b":r=parseInt(r,10).toString(2);break;case"c":r=String.fromCharCode(parseInt(r,10));break;case"d":case"i":r=parseInt(r,10);break;case"j":r=JSON.stringify(r,null,s.width?parseInt(s.width):0);break;case"e":r=s.precision?parseFloat(r).toExponential(s.precision):parseFloat(r).toExponential();break;case"f":r=s.precision?parseFloat(r).toFixed(s.precision):parseFloat(r);break;case"g":r=s.precision?String(Number(r.toPrecision(s.precision))):parseFloat(r);break;case"o":r=(parseInt(r,10)>>>0).toString(8);break;case"s":r=String(r),r=s.precision?r.substring(0,s.precision):r;break;case"t":r=String(!!r),r=s.precision?r.substring(0,s.precision):r;break;case"T":r=Object.prototype.toString.call(r).slice(8,-1).toLowerCase(),r=s.precision?r.substring(0,s.precision):r;break;case"u":r=parseInt(r,10)>>>0;break;case"v":r=r.valueOf(),r=s.precision?r.substring(0,s.precision):r;break;case"x":r=(parseInt(r,10)>>>0).toString(16);break;case"X":r=(parseInt(r,10)>>>0).toString(16).toUpperCase()}i.json.test(s.type)?g+=r:(!i.number.test(s.type)||c&&!s.sign?f="":(f=c?"+":"-",r=r.toString().replace(i.sign,"")),u=s.pad_char?"0"===s.pad_char?"0":s.pad_char.charAt(1):" ",p=s.width-(f+r).length,l=s.width&&p>0?u.repeat(p):"",g+=s.align?f+r+l:"0"===u?f+l+r:l+f+r)}return g}(function(t){if(s[t])return s[t];var e,r=t,n=[],a=0;for(;r;){if(null!==(e=i.text.exec(r)))n.push(e[0]);else if(null!==(e=i.modulo.exec(r)))n.push("%");else{if(null===(e=i.placeholder.exec(r)))throw new SyntaxError("[sprintf] unexpected placeholder");if(e[2]){a|=1;var o=[],l=e[2],u=[];if(null===(u=i.key.exec(l)))throw new SyntaxError("[sprintf] failed to parse named argument key");for(o.push(u[1]);""!==(l=l.substring(u[0].length));)if(null!==(u=i.key_access.exec(l)))o.push(u[1]);else{if(null===(u=i.index_access.exec(l)))throw new SyntaxError("[sprintf] failed to parse named argument key");o.push(u[1])}e[2]=o}else a|=2;if(3===a)throw new Error("[sprintf] mixing positional and named placeholders is not (yet) supported");n.push({placeholder:e[0],param_no:e[1],keys:e[2],sign:e[3],pad_char:e[4],align:e[5],width:e[6],precision:e[7],type:e[8]})}r=r.substring(e[0].length)}return s[t]=n}(t),arguments)}function o(t,e){return a.apply(null,[t].concat(e||[]))}var s=Object.create(null);e.sprintf=a,e.vsprintf=o,"undefined"!=typeof window&&(window.sprintf=a,window.vsprintf=o,void 0===(n=function(){return{sprintf:a,vsprintf:o}}.call(e,r,e,t))||(t.exports=n))}()}},e={};function r(n){var i=e[n];if(void 0!==i)return i.exports;var a=e[n]={exports:{}};return t[n](a,a.exports,r),a.exports}r.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return r.d(e,{a:e}),e},r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var n={};(()=>{"use strict";r.r(n),r.d(n,{__:()=>F,_n:()=>j,_nx:()=>L,_x:()=>S,createI18n:()=>x,defaultI18n:()=>_,getLocaleData:()=>v,hasTranslation:()=>D,isRTL:()=>T,resetLocaleData:()=>w,setLocaleData:()=>m,sprintf:()=>a,subscribe:()=>k});var t=r(2058),e=r.n(t);const i=function(t,e){var r,n,i=0;function a(){var a,o,s=r,l=arguments.length;t:for(;s;){if(s.args.length===arguments.length){for(o=0;o":5,">=":5,"==":4,"!=":4,"&&":3,"||":2,"?":1,"?:":1},s=["(","?"],l={")":["("],":":["?","?:"]},u=/<=|>=|==|!=|&&|\|\||\?:|\(|!|\*|\/|%|\+|-|<|>|\?|\)|:/;var p={"!":function(t){return!t},"*":function(t,e){return t*e},"/":function(t,e){return t/e},"%":function(t,e){return t%e},"+":function(t,e){return t+e},"-":function(t,e){return t-e},"<":function(t,e){return t":function(t,e){return t>e},">=":function(t,e){return t>=e},"==":function(t,e){return t===e},"!=":function(t,e){return t!==e},"&&":function(t,e){return t&&e},"||":function(t,e){return t||e},"?:":function(t,e,r){if(t)throw e;return r}};function c(t){var e=function(t){for(var e,r,n,i,a=[],p=[];e=t.match(u);){for(r=e[0],(n=t.substr(0,e.index).trim())&&a.push(n);i=p.pop();){if(l[r]){if(l[r][0]===i){r=l[r][1]||r;break}}else if(s.indexOf(i)>=0||o[i]1===t?0:1},g=/^i18n\.(n?gettext|has_translation)(_|$)/,x=(t,e,r)=>{const n=new d({}),i=new Set,a=()=>{i.forEach((t=>t()))},o=(t,e="default")=>{n.data[e]={...n.data[e],...t},n.data[e][""]={...h,...n.data[e]?.[""]},delete n.pluralForms[e]},s=(t,e)=>{o(t,e),a()},l=(t="default",e,r,i,a)=>(n.data[t]||o(void 0,t),n.dcnpgettext(t,e,r,i,a)),u=(t="default")=>t,p=(t,e,n)=>{let i=l(n,e,t);return r?(i=r.applyFilters("i18n.gettext_with_context",i,t,e,n),r.applyFilters("i18n.gettext_with_context_"+u(n),i,t,e,n)):i};if(t&&s(t,e),r){const t=t=>{g.test(t)&&a()};r.addAction("hookAdded","core/i18n",t),r.addAction("hookRemoved","core/i18n",t)}return{getLocaleData:(t="default")=>n.data[t],setLocaleData:s,addLocaleData:(t,e="default")=>{n.data[e]={...n.data[e],...t,"":{...h,...n.data[e]?.[""],...t?.[""]}},delete n.pluralForms[e],a()},resetLocaleData:(t,e)=>{n.data={},n.pluralForms={},s(t,e)},subscribe:t=>(i.add(t),()=>i.delete(t)),__:(t,e)=>{let n=l(e,void 0,t);return r?(n=r.applyFilters("i18n.gettext",n,t,e),r.applyFilters("i18n.gettext_"+u(e),n,t,e)):n},_x:p,_n:(t,e,n,i)=>{let a=l(i,void 0,t,e,n);return r?(a=r.applyFilters("i18n.ngettext",a,t,e,n,i),r.applyFilters("i18n.ngettext_"+u(i),a,t,e,n,i)):a},_nx:(t,e,n,i,a)=>{let o=l(a,i,t,e,n);return r?(o=r.applyFilters("i18n.ngettext_with_context",o,t,e,n,i,a),r.applyFilters("i18n.ngettext_with_context_"+u(a),o,t,e,n,i,a)):o},isRTL:()=>"rtl"===p("ltr","text direction"),hasTranslation:(t,e,i)=>{const a=e?e+""+t:t;let o=!!n.data?.[null!=i?i:"default"]?.[a];return r&&(o=r.applyFilters("i18n.has_translation",o,t,e,i),o=r.applyFilters("i18n.has_translation_"+u(i),o,t,e,i)),o}}},y=window.wp.hooks,b=x(void 0,void 0,y.defaultHooks),_=b,v=b.getLocaleData.bind(b),m=b.setLocaleData.bind(b),w=b.resetLocaleData.bind(b),k=b.subscribe.bind(b),F=b.__.bind(b),S=b._x.bind(b),j=b._n.bind(b),L=b._nx.bind(b),T=b.isRTL.bind(b),D=b.hasTranslation.bind(b)})(),(window.wp=window.wp||{}).i18n=n})();compose.min.js000064400000111161147177406350007350 0ustar00/*! This file is auto-generated */ (()=>{var e={6689:(e,t,n)=>{"use strict";n.d(t,{createUndoManager:()=>c});var r=n(923),o=n.n(r);function u(e,t){const n={...e};return Object.entries(t).forEach((([e,t])=>{n[e]?n[e]={...n[e],to:t.to}:n[e]=t})),n}const i=(e,t)=>{const n=e?.findIndex((({id:e})=>"string"==typeof e?e===t.id:o()(e,t.id))),r=[...e];return-1!==n?r[n]={id:t.id,changes:u(r[n].changes,t.changes)}:r.push(t),r};function c(){let e=[],t=[],n=0;const r=()=>{e=e.slice(0,n||void 0),n=0},u=()=>{var n;const r=0===e.length?0:e.length-1;let o=null!==(n=e[r])&&void 0!==n?n:[];t.forEach((e=>{o=i(o,e)})),t=[],e[r]=o};return{addRecord(n,c=!1){const s=!n||(e=>!e.filter((({changes:e})=>Object.values(e).some((({from:e,to:t})=>"function"!=typeof e&&"function"!=typeof t&&!o()(e,t))))).length)(n);if(c){if(s)return;n.forEach((e=>{t=i(t,e)}))}else{if(r(),t.length&&u(),s)return;e.push(n)}},undo(){t.length&&(r(),u());const o=e[e.length-1+n];if(o)return n-=1,o},redo(){const t=e[e.length+n];if(t)return n+=1,t},hasUndo:()=>!!e[e.length-1+n],hasRedo:()=>!!e[e.length+n]}}},3758:function(e){ /*! * clipboard.js v2.0.11 * https://clipboardjs.com/ * * Licensed MIT © Zeno Rocha */ var t;t=function(){return function(){var e={686:function(e,t,n){"use strict";n.d(t,{default:function(){return x}});var r=n(279),o=n.n(r),u=n(370),i=n.n(u),c=n(817),s=n.n(c);function a(e){try{return document.execCommand(e)}catch(e){return!1}}var l=function(e){var t=s()(e);return a("cut"),t},f=function(e,t){var n=function(e){var t="rtl"===document.documentElement.getAttribute("dir"),n=document.createElement("textarea");n.style.fontSize="12pt",n.style.border="0",n.style.padding="0",n.style.margin="0",n.style.position="absolute",n.style[t?"right":"left"]="-9999px";var r=window.pageYOffset||document.documentElement.scrollTop;return n.style.top="".concat(r,"px"),n.setAttribute("readonly",""),n.value=e,n}(e);t.container.appendChild(n);var r=s()(n);return a("copy"),n.remove(),r},d=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{container:document.body},n="";return"string"==typeof e?n=f(e,t):e instanceof HTMLInputElement&&!["text","search","url","tel","password"].includes(null==e?void 0:e.type)?n=f(e.value,t):(n=s()(e),a("copy")),n};function p(e){return p="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},p(e)}var h=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.action,n=void 0===t?"copy":t,r=e.container,o=e.target,u=e.text;if("copy"!==n&&"cut"!==n)throw new Error('Invalid "action" value, use either "copy" or "cut"');if(void 0!==o){if(!o||"object"!==p(o)||1!==o.nodeType)throw new Error('Invalid "target" value, use a valid Element');if("copy"===n&&o.hasAttribute("disabled"))throw new Error('Invalid "target" attribute. Please use "readonly" instead of "disabled" attribute');if("cut"===n&&(o.hasAttribute("readonly")||o.hasAttribute("disabled")))throw new Error('Invalid "target" attribute. You can\'t cut text from elements with "readonly" or "disabled" attributes')}return u?d(u,{container:r}):o?"cut"===n?l(o):d(o,{container:r}):void 0};function v(e){return v="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},v(e)}function m(e,t){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{};this.action="function"==typeof e.action?e.action:this.defaultAction,this.target="function"==typeof e.target?e.target:this.defaultTarget,this.text="function"==typeof e.text?e.text:this.defaultText,this.container="object"===v(e.container)?e.container:document.body}},{key:"listenClick",value:function(e){var t=this;this.listener=i()(e,"click",(function(e){return t.onClick(e)}))}},{key:"onClick",value:function(e){var t=e.delegateTarget||e.currentTarget,n=this.action(t)||"copy",r=h({action:n,container:this.container,target:this.target(t),text:this.text(t)});this.emit(r?"success":"error",{action:n,text:r,trigger:t,clearSelection:function(){t&&t.focus(),window.getSelection().removeAllRanges()}})}},{key:"defaultAction",value:function(e){return w("action",e)}},{key:"defaultTarget",value:function(e){var t=w("target",e);if(t)return document.querySelector(t)}},{key:"defaultText",value:function(e){return w("text",e)}},{key:"destroy",value:function(){this.listener.destroy()}}],r=[{key:"copy",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{container:document.body};return d(e,t)}},{key:"cut",value:function(e){return l(e)}},{key:"isSupported",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:["copy","cut"],t="string"==typeof e?[e]:e,n=!!document.queryCommandSupported;return t.forEach((function(e){n=n&&!!document.queryCommandSupported(e)})),n}}],n&&m(t.prototype,n),r&&m(t,r),u}(o()),x=E},828:function(e){if("undefined"!=typeof Element&&!Element.prototype.matches){var t=Element.prototype;t.matches=t.matchesSelector||t.mozMatchesSelector||t.msMatchesSelector||t.oMatchesSelector||t.webkitMatchesSelector}e.exports=function(e,t){for(;e&&9!==e.nodeType;){if("function"==typeof e.matches&&e.matches(t))return e;e=e.parentNode}}},438:function(e,t,n){var r=n(828);function o(e,t,n,r,o){var i=u.apply(this,arguments);return e.addEventListener(n,i,o),{destroy:function(){e.removeEventListener(n,i,o)}}}function u(e,t,n,o){return function(n){n.delegateTarget=r(n.target,t),n.delegateTarget&&o.call(e,n)}}e.exports=function(e,t,n,r,u){return"function"==typeof e.addEventListener?o.apply(null,arguments):"function"==typeof n?o.bind(null,document).apply(null,arguments):("string"==typeof e&&(e=document.querySelectorAll(e)),Array.prototype.map.call(e,(function(e){return o(e,t,n,r,u)})))}},879:function(e,t){t.node=function(e){return void 0!==e&&e instanceof HTMLElement&&1===e.nodeType},t.nodeList=function(e){var n=Object.prototype.toString.call(e);return void 0!==e&&("[object NodeList]"===n||"[object HTMLCollection]"===n)&&"length"in e&&(0===e.length||t.node(e[0]))},t.string=function(e){return"string"==typeof e||e instanceof String},t.fn=function(e){return"[object Function]"===Object.prototype.toString.call(e)}},370:function(e,t,n){var r=n(879),o=n(438);e.exports=function(e,t,n){if(!e&&!t&&!n)throw new Error("Missing required arguments");if(!r.string(t))throw new TypeError("Second argument must be a String");if(!r.fn(n))throw new TypeError("Third argument must be a Function");if(r.node(e))return function(e,t,n){return e.addEventListener(t,n),{destroy:function(){e.removeEventListener(t,n)}}}(e,t,n);if(r.nodeList(e))return function(e,t,n){return Array.prototype.forEach.call(e,(function(e){e.addEventListener(t,n)})),{destroy:function(){Array.prototype.forEach.call(e,(function(e){e.removeEventListener(t,n)}))}}}(e,t,n);if(r.string(e))return function(e,t,n){return o(document.body,e,t,n)}(e,t,n);throw new TypeError("First argument must be a String, HTMLElement, HTMLCollection, or NodeList")}},817:function(e){e.exports=function(e){var t;if("SELECT"===e.nodeName)e.focus(),t=e.value;else if("INPUT"===e.nodeName||"TEXTAREA"===e.nodeName){var n=e.hasAttribute("readonly");n||e.setAttribute("readonly",""),e.select(),e.setSelectionRange(0,e.value.length),n||e.removeAttribute("readonly"),t=e.value}else{e.hasAttribute("contenteditable")&&e.focus();var r=window.getSelection(),o=document.createRange();o.selectNodeContents(e),r.removeAllRanges(),r.addRange(o),t=r.toString()}return t}},279:function(e){function t(){}t.prototype={on:function(e,t,n){var r=this.e||(this.e={});return(r[e]||(r[e]=[])).push({fn:t,ctx:n}),this},once:function(e,t,n){var r=this;function o(){r.off(e,o),t.apply(n,arguments)}return o._=t,this.on(e,o,n)},emit:function(e){for(var t=[].slice.call(arguments,1),n=((this.e||(this.e={}))[e]||[]).slice(),r=0,o=n.length;r{var r;!function(o,u,i){if(o){for(var c,s={8:"backspace",9:"tab",13:"enter",16:"shift",17:"ctrl",18:"alt",20:"capslock",27:"esc",32:"space",33:"pageup",34:"pagedown",35:"end",36:"home",37:"left",38:"up",39:"right",40:"down",45:"ins",46:"del",91:"meta",93:"meta",224:"meta"},a={106:"*",107:"+",109:"-",110:".",111:"/",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},l={"~":"`","!":"1","@":"2","#":"3",$:"4","%":"5","^":"6","&":"7","*":"8","(":"9",")":"0",_:"-","+":"=",":":";",'"':"'","<":",",">":".","?":"/","|":"\\"},f={option:"alt",command:"meta",return:"enter",escape:"esc",plus:"+",mod:/Mac|iPod|iPhone|iPad/.test(navigator.platform)?"meta":"ctrl"},d=1;d<20;++d)s[111+d]="f"+d;for(d=0;d<=9;++d)s[d+96]=d.toString();b.prototype.bind=function(e,t,n){var r=this;return e=e instanceof Array?e:[e],r._bindMultiple.call(r,e,t,n),r},b.prototype.unbind=function(e,t){return this.bind.call(this,e,(function(){}),t)},b.prototype.trigger=function(e,t){var n=this;return n._directMap[e+":"+t]&&n._directMap[e+":"+t]({},e),n},b.prototype.reset=function(){var e=this;return e._callbacks={},e._directMap={},e},b.prototype.stopCallback=function(e,t){if((" "+t.className+" ").indexOf(" mousetrap ")>-1)return!1;if(g(t,this.target))return!1;if("composedPath"in e&&"function"==typeof e.composedPath){var n=e.composedPath()[0];n!==e.target&&(t=n)}return"INPUT"==t.tagName||"SELECT"==t.tagName||"TEXTAREA"==t.tagName||t.isContentEditable},b.prototype.handleKey=function(){return this._handleKey.apply(this,arguments)},b.addKeycodes=function(e){for(var t in e)e.hasOwnProperty(t)&&(s[t]=e[t]);c=null},b.init=function(){var e=b(u);for(var t in e)"_"!==t.charAt(0)&&(b[t]=function(t){return function(){return e[t].apply(e,arguments)}}(t))},b.init(),o.Mousetrap=b,e.exports&&(e.exports=b),void 0===(r=function(){return b}.call(t,n,t,e))||(e.exports=r)}function p(e,t,n){e.addEventListener?e.addEventListener(t,n,!1):e.attachEvent("on"+t,n)}function h(e){if("keypress"==e.type){var t=String.fromCharCode(e.which);return e.shiftKey||(t=t.toLowerCase()),t}return s[e.which]?s[e.which]:a[e.which]?a[e.which]:String.fromCharCode(e.which).toLowerCase()}function v(e){return"shift"==e||"ctrl"==e||"alt"==e||"meta"==e}function m(e,t,n){return n||(n=function(){if(!c)for(var e in c={},s)e>95&&e<112||s.hasOwnProperty(e)&&(c[s[e]]=e);return c}()[e]?"keydown":"keypress"),"keypress"==n&&t.length&&(n="keydown"),n}function y(e,t){var n,r,o,u=[];for(n=function(e){return"+"===e?["+"]:(e=e.replace(/\+{2}/g,"+plus")).split("+")}(e),o=0;o1?d(e,c,n,r):(i=y(e,r),t._callbacks[i.key]=t._callbacks[i.key]||[],a(i.key,i.modifiers,{type:i.action},o,e,u),t._callbacks[i.key][o?"unshift":"push"]({callback:n,modifiers:i.modifiers,action:i.action,seq:o,level:u,combo:e}))}t._handleKey=function(e,t,n){var r,o=a(e,t,n),u={},f=0,d=!1;for(r=0;r{!function(e){if(e){var t={},n=e.prototype.stopCallback;e.prototype.stopCallback=function(e,r,o,u){return!!this.paused||!t[o]&&!t[u]&&n.call(this,e,r,o)},e.prototype.bindGlobal=function(e,n,r){if(this.bind(e,n,r),e instanceof Array)for(var o=0;o{"use strict";e.exports=window.wp.isShallowEqual}},t={};function n(r){var o=t[r];if(void 0!==o)return o.exports;var u=t[r]={exports:{}};return e[r].call(u.exports,u,u.exports,n),u.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var r={};(()=>{"use strict";n.r(r),n.d(r,{__experimentalUseDialog:()=>Z,__experimentalUseDragging:()=>X,__experimentalUseDropZone:()=>Re,__experimentalUseFixedWindowList:()=>Me,__experimentalUseFocusOutside:()=>$,compose:()=>m,createHigherOrderComponent:()=>a,debounce:()=>f,ifCondition:()=>g,observableMap:()=>p,pipe:()=>v,pure:()=>x,throttle:()=>d,useAsyncList:()=>be,useConstrainedTabbing:()=>j,useCopyOnClick:()=>N,useCopyToClipboard:()=>U,useDebounce:()=>Se,useDebouncedInput:()=>ke,useDisabled:()=>G,useFocusOnMount:()=>q,useFocusReturn:()=>W,useFocusableIframe:()=>Le,useInstanceId:()=>L,useIsomorphicLayoutEffect:()=>Q,useKeyboardShortcut:()=>ee,useMediaQuery:()=>ne,useMergeRefs:()=>B,useObservableValue:()=>Oe,usePrevious:()=>re,useReducedMotion:()=>oe,useRefEffect:()=>A,useResizeObserver:()=>ye,useStateWithHistory:()=>se,useThrottle:()=>Te,useViewportMatch:()=>he,useWarnOnChange:()=>we,withGlobalEvents:()=>C,withInstanceId:()=>D,withSafeTimeout:()=>M,withState:()=>O});var e=function(){return e=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0&&n>="0"&&n<="9"?"_"+n+r:""+n.toUpperCase()+r}function s(n,r){return void 0===r&&(r={}),function(e,n){void 0===n&&(n={});for(var r=n.splitRegexp,c=void 0===r?o:r,s=n.stripRegexp,a=void 0===s?u:s,l=n.transform,f=void 0===l?t:l,d=n.delimiter,p=void 0===d?" ":d,h=i(i(e,c,"$1\0$2"),a,"\0"),v=0,m=h.length;"\0"===h.charAt(v);)v++;for(;"\0"===h.charAt(m-1);)m--;return h.slice(v,m).split("\0").map(f).join(p)}(n,e({delimiter:"",transform:c},r))}function a(e,t){return n=>{const r=e(n);return r.displayName=l(t,n),r}}const l=(e,t)=>{const n=t.displayName||t.name||"Component";return`${s(null!=e?e:"")}(${n})`},f=(e,t,n)=>{let r,o,u,i,c,s=0,a=0,l=!1,f=!1,d=!0;function p(t){const n=r,i=o;return r=void 0,o=void 0,a=t,u=e.apply(i,n),u}function h(e,t){i=setTimeout(e,t)}function v(e){return e-(c||0)}function m(e){const n=v(e);return void 0===c||n>=t||n<0||f&&e-a>=s}function y(){const e=Date.now();if(m(e))return b(e);h(y,function(e){const n=v(e),r=e-a,o=t-n;return f?Math.min(o,s-r):o}(e))}function g(){i=void 0}function b(e){return g(),d&&r?p(e):(r=o=void 0,u)}function w(){return void 0!==i}function E(...e){const n=Date.now(),i=m(n);if(r=e,o=this,c=n,i){if(!w())return function(e){return a=e,h(y,t),l?p(e):u}(c);if(f)return h(y,t),p(c)}return w()||h(y,t),u}return n&&(l=!!n.leading,f="maxWait"in n,void 0!==n.maxWait&&(s=Math.max(n.maxWait,t)),d="trailing"in n?!!n.trailing:d),E.cancel=function(){void 0!==i&&clearTimeout(i),a=0,g(),r=c=o=void 0},E.flush=function(){return w()?b(Date.now()):u},E.pending=w,E},d=(e,t,n)=>{let r=!0,o=!0;return n&&(r="leading"in n?!!n.leading:r,o="trailing"in n?!!n.trailing:o),f(e,t,{leading:r,trailing:o,maxWait:t})};function p(){const e=new Map,t=new Map;function n(e){const n=t.get(e);if(n)for(const e of n)e()}return{get:t=>e.get(t),set(t,r){e.set(t,r),n(t)},delete(t){e.delete(t),n(t)},subscribe(e,n){let r=t.get(e);return r||(r=new Set,t.set(e,r)),r.add(n),()=>{r.delete(n),0===r.size&&t.delete(e)}}}}const h=(e=!1)=>(...t)=>(...n)=>{const r=t.flat();return e&&r.reverse(),r.reduce(((e,t)=>[t(...e)]),n)[0]},v=h(),m=h(!0),y=window.ReactJSXRuntime;const g=function(e){return a((t=>n=>e(n)?(0,y.jsx)(t,{...n}):null),"ifCondition")};var b=n(923),w=n.n(b);const E=window.wp.element,x=a((function(e){return e.prototype instanceof E.Component?class extends e{shouldComponentUpdate(e,t){return!w()(e,this.props)||!w()(t,this.state)}}:class extends E.Component{shouldComponentUpdate(e){return!w()(e,this.props)}render(){return(0,y.jsx)(e,{...this.props})}}}),"pure"),S=window.wp.deprecated;var k=n.n(S);const T=new class{constructor(){this.listeners={},this.handleEvent=this.handleEvent.bind(this)}add(e,t){this.listeners[e]||(window.addEventListener(e,this.handleEvent),this.listeners[e]=[]),this.listeners[e].push(t)}remove(e,t){this.listeners[e]&&(this.listeners[e]=this.listeners[e].filter((e=>e!==t)),this.listeners[e].length||(window.removeEventListener(e,this.handleEvent),delete this.listeners[e]))}handleEvent(e){this.listeners[e.type]?.forEach((t=>{t.handleEvent(e)}))}};function C(e){return k()("wp.compose.withGlobalEvents",{since:"5.7",alternative:"useEffect"}),a((t=>{class n extends E.Component{constructor(e){super(e),this.handleEvent=this.handleEvent.bind(this),this.handleRef=this.handleRef.bind(this)}componentDidMount(){Object.keys(e).forEach((e=>{T.add(e,this)}))}componentWillUnmount(){Object.keys(e).forEach((e=>{T.remove(e,this)}))}handleEvent(t){const n=e[t.type];"function"==typeof this.wrappedRef[n]&&this.wrappedRef[n](t)}handleRef(e){this.wrappedRef=e,this.props.forwardedRef&&this.props.forwardedRef(e)}render(){return(0,y.jsx)(t,{...this.props.ownProps,ref:this.handleRef})}}return(0,E.forwardRef)(((e,t)=>(0,y.jsx)(n,{ownProps:e,forwardedRef:t})))}),"withGlobalEvents")}const R=new WeakMap;const L=function(e,t,n){return(0,E.useMemo)((()=>{if(n)return n;const r=function(e){const t=R.get(e)||0;return R.set(e,t+1),t}(e);return t?`${t}-${r}`:r}),[e,n,t])},D=a((e=>t=>{const n=L(e);return(0,y.jsx)(e,{...t,instanceId:n})}),"instanceId"),M=a((e=>class extends E.Component{constructor(e){super(e),this.timeouts=[],this.setTimeout=this.setTimeout.bind(this),this.clearTimeout=this.clearTimeout.bind(this)}componentWillUnmount(){this.timeouts.forEach(clearTimeout)}setTimeout(e,t){const n=setTimeout((()=>{e(),this.clearTimeout(n)}),t);return this.timeouts.push(n),n}clearTimeout(e){clearTimeout(e),this.timeouts=this.timeouts.filter((t=>t!==e))}render(){return(0,y.jsx)(e,{...this.props,setTimeout:this.setTimeout,clearTimeout:this.clearTimeout})}}),"withSafeTimeout");function O(e={}){return k()("wp.compose.withState",{since:"5.8",alternative:"wp.element.useState"}),a((t=>class extends E.Component{constructor(t){super(t),this.setState=this.setState.bind(this),this.state=e}render(){return(0,y.jsx)(t,{...this.props,...this.state,setState:this.setState})}}),"withState")}const _=window.wp.dom;function A(e,t){const n=(0,E.useRef)();return(0,E.useCallback)((t=>{t?n.current=e(t):n.current&&n.current()}),t)}const j=function(){return A((e=>{function t(t){const{key:n,shiftKey:r,target:o}=t;if("Tab"!==n)return;const u=r?"findPrevious":"findNext",i=_.focus.tabbable[u](o)||null;if(o.contains(i))return t.preventDefault(),void i?.focus();if(e.contains(i))return;const c=r?"append":"prepend",{ownerDocument:s}=e,a=s.createElement("div");a.tabIndex=-1,e[c](a),a.addEventListener("blur",(()=>e.removeChild(a))),a.focus()}return e.addEventListener("keydown",t),()=>{e.removeEventListener("keydown",t)}}),[])};var P=n(3758),I=n.n(P);function N(e,t,n=4e3){k()("wp.compose.useCopyOnClick",{since:"5.8",alternative:"wp.compose.useCopyToClipboard"});const r=(0,E.useRef)(),[o,u]=(0,E.useState)(!1);return(0,E.useEffect)((()=>{let o;if(e.current)return r.current=new(I())(e.current,{text:()=>"function"==typeof t?t():t}),r.current.on("success",(({clearSelection:e,trigger:t})=>{e(),t&&t.focus(),n&&(u(!0),clearTimeout(o),o=setTimeout((()=>u(!1)),n))})),()=>{r.current&&r.current.destroy(),clearTimeout(o)}}),[t,n,u]),o}function z(e){const t=(0,E.useRef)(e);return t.current=e,t}function U(e,t){const n=z(e),r=z(t);return A((e=>{const t=new(I())(e,{text:()=>"function"==typeof n.current?n.current():n.current||""});return t.on("success",(({clearSelection:e})=>{e(),r.current&&r.current()})),()=>{t.destroy()}}),[])}const V=window.wp.keycodes;function q(e="firstElement"){const t=(0,E.useRef)(e),n=e=>{e.focus({preventScroll:!0})},r=(0,E.useRef)();return(0,E.useEffect)((()=>{t.current=e}),[e]),A((e=>{var o;if(e&&!1!==t.current&&!e.contains(null!==(o=e.ownerDocument?.activeElement)&&void 0!==o?o:null)){if("firstElement"!==t.current)return n(e),()=>{r.current&&clearTimeout(r.current)};r.current=setTimeout((()=>{const t=_.focus.tabbable.find(e)[0];t&&n(t)}),0)}}),[])}let K=null;const W=function(e){const t=(0,E.useRef)(null),n=(0,E.useRef)(null),r=(0,E.useRef)(e);return(0,E.useEffect)((()=>{r.current=e}),[e]),(0,E.useCallback)((e=>{if(e){if(t.current=e,n.current)return;n.current=e.ownerDocument.activeElement}else if(n.current){const e=t.current?.contains(t.current?.ownerDocument.activeElement);var o;if(t.current?.isConnected&&!e)return void(null!==(o=K)&&void 0!==o||(K=n.current));r.current?r.current():(n.current.isConnected?n.current:K)?.focus(),K=null}}),[])},H=["button","submit"];function $(e){const t=(0,E.useRef)(e);(0,E.useEffect)((()=>{t.current=e}),[e]);const n=(0,E.useRef)(!1),r=(0,E.useRef)(),o=(0,E.useCallback)((()=>{clearTimeout(r.current)}),[]);(0,E.useEffect)((()=>()=>o()),[]),(0,E.useEffect)((()=>{e||o()}),[e,o]);const u=(0,E.useCallback)((e=>{const{type:t,target:r}=e;["mouseup","touchend"].includes(t)?n.current=!1:function(e){if(!(e instanceof window.HTMLElement))return!1;switch(e.nodeName){case"A":case"BUTTON":return!0;case"INPUT":return H.includes(e.type)}return!1}(r)&&(n.current=!0)}),[]),i=(0,E.useCallback)((e=>{if(e.persist(),n.current)return;const o=e.target.getAttribute("data-unstable-ignore-focus-outside-for-relatedtarget");o&&e.relatedTarget?.closest(o)||(r.current=setTimeout((()=>{document.hasFocus()?"function"==typeof t.current&&t.current(e):e.preventDefault()}),0))}),[]);return{onFocus:o,onMouseDown:u,onMouseUp:u,onTouchStart:u,onTouchEnd:u,onBlur:i}}function F(e,t){"function"==typeof e?e(t):e&&e.hasOwnProperty("current")&&(e.current=t)}function B(e){const t=(0,E.useRef)(),n=(0,E.useRef)(!1),r=(0,E.useRef)(!1),o=(0,E.useRef)([]),u=(0,E.useRef)(e);return u.current=e,(0,E.useLayoutEffect)((()=>{!1===r.current&&!0===n.current&&e.forEach(((e,n)=>{const r=o.current[n];e!==r&&(F(r,null),F(e,t.current))})),o.current=e}),e),(0,E.useLayoutEffect)((()=>{r.current=!1})),(0,E.useCallback)((e=>{F(t,e),r.current=!0,n.current=null!==e;const i=e?u.current:o.current;for(const t of i)F(t,e)}),[])}const Z=function(e){const t=(0,E.useRef)(),{constrainTabbing:n=!1!==e.focusOnMount}=e;(0,E.useEffect)((()=>{t.current=e}),Object.values(e));const r=j(),o=q(e.focusOnMount),u=W(),i=$((e=>{t.current?.__unstableOnClose?t.current.__unstableOnClose("focus-outside",e):t.current?.onClose&&t.current.onClose()})),c=(0,E.useCallback)((e=>{e&&e.addEventListener("keydown",(e=>{e.keyCode===V.ESCAPE&&!e.defaultPrevented&&t.current?.onClose&&(e.preventDefault(),t.current.onClose())}))}),[]);return[B([n?r:null,!1!==e.focusOnMount?u:null,!1!==e.focusOnMount?o:null,c]),{...i,tabIndex:-1}]};function G({isDisabled:e=!1}={}){return A((t=>{if(e)return;const n=t?.ownerDocument?.defaultView;if(!n)return;const r=[],o=()=>{t.childNodes.forEach((e=>{e instanceof n.HTMLElement&&(e.getAttribute("inert")||(e.setAttribute("inert","true"),r.push((()=>{e.removeAttribute("inert")}))))}))},u=f(o,0,{leading:!0});o();const i=new window.MutationObserver(u);return i.observe(t,{childList:!0}),()=>{i&&i.disconnect(),u.cancel(),r.forEach((e=>e()))}}),[e])}const Q="undefined"!=typeof window?E.useLayoutEffect:E.useEffect;function X({onDragStart:e,onDragMove:t,onDragEnd:n}){const[r,o]=(0,E.useState)(!1),u=(0,E.useRef)({onDragStart:e,onDragMove:t,onDragEnd:n});Q((()=>{u.current.onDragStart=e,u.current.onDragMove=t,u.current.onDragEnd=n}),[e,t,n]);const i=(0,E.useCallback)((e=>u.current.onDragMove&&u.current.onDragMove(e)),[]),c=(0,E.useCallback)((e=>{u.current.onDragEnd&&u.current.onDragEnd(e),document.removeEventListener("mousemove",i),document.removeEventListener("mouseup",c),o(!1)}),[]),s=(0,E.useCallback)((e=>{u.current.onDragStart&&u.current.onDragStart(e),document.addEventListener("mousemove",i),document.addEventListener("mouseup",c),o(!0)}),[]);return(0,E.useEffect)((()=>()=>{r&&(document.removeEventListener("mousemove",i),document.removeEventListener("mouseup",c))}),[r]),{startDrag:s,endDrag:c,isDragging:r}}var Y=n(1933),J=n.n(Y);n(5760);const ee=function(e,t,{bindGlobal:n=!1,eventName:r="keydown",isDisabled:o=!1,target:u}={}){const i=(0,E.useRef)(t);(0,E.useEffect)((()=>{i.current=t}),[t]),(0,E.useEffect)((()=>{if(o)return;const t=new(J())(u&&u.current?u.current:document);return(Array.isArray(e)?e:[e]).forEach((e=>{const o=e.split("+"),u=new Set(o.filter((e=>e.length>1))),c=u.has("alt"),s=u.has("shift");if((0,V.isAppleOS)()&&(1===u.size&&c||2===u.size&&c&&s))throw new Error(`Cannot bind ${e}. Alt and Shift+Alt modifiers are reserved for character input.`);t[n?"bindGlobal":"bind"](e,((...e)=>i.current(...e)),r)})),()=>{t.reset()}}),[e,n,r,u,o])},te=new Map;function ne(e){const t=(0,E.useMemo)((()=>{const t=function(e){if(!e)return null;let t=te.get(e);return t||("undefined"!=typeof window&&"function"==typeof window.matchMedia?(t=window.matchMedia(e),te.set(e,t),t):null)}(e);return{subscribe:e=>t?(t.addEventListener?.("change",e),()=>{t.removeEventListener?.("change",e)}):()=>{},getValue(){var e;return null!==(e=t?.matches)&&void 0!==e&&e}}}),[e]);return(0,E.useSyncExternalStore)(t.subscribe,t.getValue,(()=>!1))}function re(e){const t=(0,E.useRef)();return(0,E.useEffect)((()=>{t.current=e}),[e]),t.current}const oe=()=>ne("(prefers-reduced-motion: reduce)");var ue=n(6689);function ie(e,t){switch(t.type){case"UNDO":{const t=e.manager.undo();return t?{...e,value:t[0].changes.prop.from}:e}case"REDO":{const t=e.manager.redo();return t?{...e,value:t[0].changes.prop.to}:e}case"RECORD":return e.manager.addRecord([{id:"object",changes:{prop:{from:e.value,to:t.value}}}],t.isStaged),{...e,value:t.value}}return e}function ce(e){return{manager:(0,ue.createUndoManager)(),value:e}}function se(e){const[t,n]=(0,E.useReducer)(ie,e,ce);return{value:t.value,setValue:(0,E.useCallback)(((e,t)=>{n({type:"RECORD",value:e,isStaged:t})}),[]),hasUndo:t.manager.hasUndo(),hasRedo:t.manager.hasRedo(),undo:(0,E.useCallback)((()=>{n({type:"UNDO"})}),[]),redo:(0,E.useCallback)((()=>{n({type:"REDO"})}),[])}}const ae={huge:1440,wide:1280,large:960,medium:782,small:600,mobile:480},le={">=":"min-width","<":"max-width"},fe={">=":(e,t)=>t>=e,"<":(e,t)=>t=")=>{const n=(0,E.useContext)(de),r=ne(!n&&`(${le[t]}: ${ae[e]}px)`||void 0);return n?fe[t](ae[e],n):r};pe.__experimentalWidthProvider=de.Provider;const he=pe;const ve=(e,t,n)=>e[t]?e[t][0]?e[t][0][n]:e[t][n]:"contentBoxSize"===t?e.contentRect["inlineSize"===n?"width":"height"]:void 0;function me(e={}){const t=e.onResize,n=(0,E.useRef)(void 0);n.current=t;const r=e.round||Math.round,o=(0,E.useRef)(),[u,i]=(0,E.useState)({width:void 0,height:void 0}),c=(0,E.useRef)(!1);(0,E.useEffect)((()=>(c.current=!1,()=>{c.current=!0})),[]);const s=(0,E.useRef)({width:void 0,height:void 0}),a=function(e,t){const n=(0,E.useRef)(null),r=(0,E.useRef)(null),o=(0,E.useRef)(),u=(0,E.useCallback)((()=>{let i=null;n.current?i=n.current:t&&(i=t instanceof HTMLElement?t:t.current),r.current&&r.current.element===i&&r.current.reporter===u||(o.current&&(o.current(),o.current=null),r.current={reporter:u,element:i},i&&(o.current=e(i)))}),[t,e]);return(0,E.useEffect)((()=>{u()}),[u]),(0,E.useCallback)((e=>{n.current=e,u()}),[u])}((0,E.useCallback)((t=>(o.current&&o.current.box===e.box&&o.current.round===r||(o.current={box:e.box,round:r,instance:new ResizeObserver((t=>{const o=t[0];let u="borderBoxSize";u="border-box"===e.box?"borderBoxSize":"device-pixel-content-box"===e.box?"devicePixelContentBoxSize":"contentBoxSize";const a=ve(o,u,"inlineSize"),l=ve(o,u,"blockSize"),f=a?r(a):void 0,d=l?r(l):void 0;if(s.current.width!==f||s.current.height!==d){const e={width:f,height:d};s.current.width=f,s.current.height=d,n.current?n.current(e):c.current||i(e)}}))}),o.current.instance.observe(t,{box:e.box}),()=>{o.current&&o.current.instance.unobserve(t)})),[e.box,r]),e.ref);return(0,E.useMemo)((()=>({ref:a,width:u.width,height:u.height})),[a,u?u.width:null,u?u.height:null])}function ye(){const{ref:e,width:t,height:n}=me(),r=(0,E.useMemo)((()=>({width:null!=t?t:null,height:null!=n?n:null})),[t,n]);return[(0,y.jsx)("div",{style:{position:"absolute",top:0,left:0,right:0,bottom:0,pointerEvents:"none",opacity:0,overflow:"hidden",zIndex:-1},"aria-hidden":"true",ref:e}),r]}const ge=window.wp.priorityQueue;const be=function(e,t={step:1}){const{step:n=1}=t,[r,o]=(0,E.useState)([]);return(0,E.useEffect)((()=>{let t=function(e,t){const n=[];for(let r=0;r{(0,E.flushSync)((()=>{o((t=>[...t,...e.slice(r,r+n)]))}))}));return()=>u.reset()}),[e]),r};const we=function(e,t="Change detection"){const n=re(e);Object.entries(null!=n?n:[]).forEach((([n,r])=>{r!==e[n]&&console.warn(`${t}: ${n} key changed:`,r,e[n])}))},Ee=window.React;function xe(e,t){var n=(0,Ee.useState)((function(){return{inputs:t,result:e()}}))[0],r=(0,Ee.useRef)(!0),o=(0,Ee.useRef)(n),u=r.current||Boolean(t&&o.current.inputs&&function(e,t){if(e.length!==t.length)return!1;for(var n=0;nf(e,null!=t?t:0,n)),[e,t,n]);return(0,E.useEffect)((()=>()=>r.cancel()),[r]),r}function ke(e=""){const[t,n]=(0,E.useState)(e),[r,o]=(0,E.useState)(e),u=Se(o,250);return(0,E.useEffect)((()=>{u(t)}),[t,u]),[t,n,r]}function Te(e,t,n){const r=xe((()=>d(e,null!=t?t:0,n)),[e,t,n]);return(0,E.useEffect)((()=>()=>r.cancel()),[r]),r}function Ce(e){const t=(0,E.useRef)();return t.current=e,t}function Re({dropZoneElement:e,isDisabled:t,onDrop:n,onDragStart:r,onDragEnter:o,onDragLeave:u,onDragEnd:i,onDragOver:c}){const s=Ce(n),a=Ce(r),l=Ce(o),f=Ce(u),d=Ce(i),p=Ce(c);return A((n=>{if(t)return;const r=null!=e?e:n;let o=!1;const{ownerDocument:u}=r;function i(e){o||(o=!0,u.addEventListener("dragend",y),u.addEventListener("mousemove",y),a.current&&a.current(e))}function c(e){e.preventDefault(),r.contains(e.relatedTarget)||l.current&&l.current(e)}function h(e){!e.defaultPrevented&&p.current&&p.current(e),e.preventDefault()}function v(e){(function(e){const{defaultView:t}=u;if(!(e&&t&&e instanceof t.HTMLElement&&r.contains(e)))return!1;let n=e;do{if(n.dataset.isDropZone)return n===r}while(n=n.parentElement);return!1})(e.relatedTarget)||f.current&&f.current(e)}function m(e){e.defaultPrevented||(e.preventDefault(),e.dataTransfer&&e.dataTransfer.files.length,s.current&&s.current(e),y(e))}function y(e){o&&(o=!1,u.removeEventListener("dragend",y),u.removeEventListener("mousemove",y),d.current&&d.current(e))}return r.dataset.isDropZone="true",r.addEventListener("drop",m),r.addEventListener("dragenter",c),r.addEventListener("dragover",h),r.addEventListener("dragleave",v),u.addEventListener("dragenter",i),()=>{delete r.dataset.isDropZone,r.removeEventListener("drop",m),r.removeEventListener("dragenter",c),r.removeEventListener("dragover",h),r.removeEventListener("dragleave",v),u.removeEventListener("dragend",y),u.removeEventListener("mousemove",y),u.removeEventListener("dragenter",i)}}),[t,e])}function Le(){return A((e=>{const{ownerDocument:t}=e;if(!t)return;const{defaultView:n}=t;if(n)return n.addEventListener("blur",r),()=>{n.removeEventListener("blur",r)};function r(){t&&t.activeElement===e&&e.focus()}}),[])}const De=30;function Me(e,t,n,r){var o,u;const i=null!==(o=r?.initWindowSize)&&void 0!==o?o:De,c=null===(u=r?.useWindowing)||void 0===u||u,[s,a]=(0,E.useState)({visibleItems:i,start:0,end:i,itemInView:e=>e>=0&&e<=i});return(0,E.useLayoutEffect)((()=>{if(!c)return;const o=(0,_.getScrollContainer)(e.current),u=e=>{var u;if(!o)return;const i=Math.ceil(o.clientHeight/t),c=e?i:null!==(u=r?.windowOverscan)&&void 0!==u?u:i,s=Math.floor(o.scrollTop/t),l=Math.max(0,s-c),f=Math.min(n-1,s+i+c);a((e=>{const t={visibleItems:i,start:l,end:f,itemInView:e=>l<=e&&e<=f};return e.start!==t.start||e.end!==t.end||e.visibleItems!==t.visibleItems?t:e}))};u(!0);const i=f((()=>{u()}),16);return o?.addEventListener("scroll",i),o?.ownerDocument?.defaultView?.addEventListener("resize",i),o?.ownerDocument?.defaultView?.addEventListener("resize",i),()=>{o?.removeEventListener("scroll",i),o?.ownerDocument?.defaultView?.removeEventListener("resize",i)}}),[t,e,n,r?.expandedState,r?.windowOverscan,c]),(0,E.useLayoutEffect)((()=>{if(!c)return;const r=(0,_.getScrollContainer)(e.current),o=e=>{switch(e.keyCode){case V.HOME:return r?.scrollTo({top:0});case V.END:return r?.scrollTo({top:n*t});case V.PAGEUP:return r?.scrollTo({top:r.scrollTop-s.visibleItems*t});case V.PAGEDOWN:return r?.scrollTo({top:r.scrollTop+s.visibleItems*t})}};return r?.ownerDocument?.defaultView?.addEventListener("keydown",o),()=>{r?.ownerDocument?.defaultView?.removeEventListener("keydown",o)}}),[n,t,e,s.visibleItems,c,r?.expandedState]),[s,a]}function Oe(e,t){const[n,r]=(0,E.useMemo)((()=>[n=>e.subscribe(t,n),()=>e.get(t)]),[e,t]);return(0,E.useSyncExternalStore)(n,r,r)}})(),(window.wp=window.wp||{}).compose=r})();customize-widgets.min.js000064400000104306147177406350011374 0ustar00/*! This file is auto-generated */ (()=>{"use strict";var e={7734:e=>{e.exports=function e(t,s){if(t===s)return!0;if(t&&s&&"object"==typeof t&&"object"==typeof s){if(t.constructor!==s.constructor)return!1;var i,r,o;if(Array.isArray(t)){if((i=t.length)!=s.length)return!1;for(r=i;0!=r--;)if(!e(t[r],s[r]))return!1;return!0}if(t instanceof Map&&s instanceof Map){if(t.size!==s.size)return!1;for(r of t.entries())if(!s.has(r[0]))return!1;for(r of t.entries())if(!e(r[1],s.get(r[0])))return!1;return!0}if(t instanceof Set&&s instanceof Set){if(t.size!==s.size)return!1;for(r of t.entries())if(!s.has(r[0]))return!1;return!0}if(ArrayBuffer.isView(t)&&ArrayBuffer.isView(s)){if((i=t.length)!=s.length)return!1;for(r=i;0!=r--;)if(t[r]!==s[r])return!1;return!0}if(t.constructor===RegExp)return t.source===s.source&&t.flags===s.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===s.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===s.toString();if((i=(o=Object.keys(t)).length)!==Object.keys(s).length)return!1;for(r=i;0!=r--;)if(!Object.prototype.hasOwnProperty.call(s,o[r]))return!1;for(r=i;0!=r--;){var n=o[r];if(!e(t[n],s[n]))return!1}return!0}return t!=t&&s!=s}}},t={};function s(i){var r=t[i];if(void 0!==r)return r.exports;var o=t[i]={exports:{}};return e[i](o,o.exports,s),o.exports}s.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return s.d(t,{a:t}),t},s.d=(e,t)=>{for(var i in t)s.o(t,i)&&!s.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},s.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),s.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var i={};(()=>{s.r(i),s.d(i,{initialize:()=>Pe,store:()=>T});var e={};s.r(e),s.d(e,{__experimentalGetInsertionPoint:()=>A,isInserterOpened:()=>E});var t={};s.r(t),s.d(t,{setIsInserterOpened:()=>M});const r=window.wp.element,o=window.wp.blockLibrary,n=window.wp.widgets,c=window.wp.blocks,a=window.wp.data,d=window.wp.preferences,l=window.wp.components,u=window.wp.i18n,h=window.wp.blockEditor,p=window.wp.compose,m=window.wp.hooks,g=window.ReactJSXRuntime;function b({text:e,children:t}){const s=(0,p.useCopyToClipboard)(e);return(0,g.jsx)(l.Button,{variant:"secondary",ref:s,children:t})}class w extends r.Component{constructor(){super(...arguments),this.state={error:null}}componentDidCatch(e){this.setState({error:e}),(0,m.doAction)("editor.ErrorBoundary.errorLogged",e)}render(){const{error:e}=this.state;return e?(0,g.jsx)(h.Warning,{className:"customize-widgets-error-boundary",actions:[(0,g.jsx)(b,{text:e.stack,children:(0,u.__)("Copy Error")},"copy-error")],children:(0,u.__)("The editor has encountered an unexpected error.")}):this.props.children}}const f=window.wp.coreData,_=window.wp.mediaUtils;const y=function({inspector:e,closeMenu:t,...s}){const i=(0,a.useSelect)((e=>e(h.store).getSelectedBlockClientId()),[]),o=(0,r.useMemo)((()=>document.getElementById(`block-${i}`)),[i]);return(0,g.jsx)(l.MenuItem,{onClick:()=>{e.open({returnFocusWhenClose:o}),t()},...s,children:(0,u.__)("Show more settings")})};function x(e){var t,s,i="";if("string"==typeof e||"number"==typeof e)i+=e;else if("object"==typeof e)if(Array.isArray(e)){var r=e.length;for(t=0;te(T).__experimentalGetInsertionPoint()),[]);return(0,g.jsxs)("div",{className:"customize-widgets-layout__inserter-panel","aria-labelledby":s,children:[(0,g.jsxs)("div",{className:"customize-widgets-layout__inserter-panel-header",children:[(0,g.jsx)("h2",{id:s,className:"customize-widgets-layout__inserter-panel-header-title",children:(0,u.__)("Add a block")}),(0,g.jsx)(l.Button,{className:"customize-widgets-layout__inserter-panel-header-close-button",icon:z,onClick:()=>t(!1),"aria-label":(0,u.__)("Close inserter")})]}),(0,g.jsx)("div",{className:"customize-widgets-layout__inserter-panel-content",children:(0,g.jsx)(h.__experimentalLibrary,{rootClientId:i.rootClientId,__experimentalInsertionIndex:i.insertionIndex,showInserterHelpPanel:!0,onSelect:()=>t(!1)})})]})},N=(0,g.jsx)(C.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,g.jsx)(C.Path,{d:"M13 19h-2v-2h2v2zm0-6h-2v-2h2v2zm0-6h-2V5h2v2z"})}),F=(0,g.jsx)(C.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,g.jsx)(C.Path,{d:"M19.5 4.5h-7V6h4.44l-5.97 5.97 1.06 1.06L18 7.06v4.44h1.5v-7Zm-13 1a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2v-3H17v3a.5.5 0 0 1-.5.5h-10a.5.5 0 0 1-.5-.5v-10a.5.5 0 0 1 .5-.5h3V5.5h-3Z"})}),L=window.wp.keyboardShortcuts,D=[{keyCombination:{modifier:"primary",character:"b"},description:(0,u.__)("Make the selected text bold.")},{keyCombination:{modifier:"primary",character:"i"},description:(0,u.__)("Make the selected text italic.")},{keyCombination:{modifier:"primary",character:"k"},description:(0,u.__)("Convert the selected text into a link.")},{keyCombination:{modifier:"primaryShift",character:"k"},description:(0,u.__)("Remove a link.")},{keyCombination:{character:"[["},description:(0,u.__)("Insert a link to a post or page.")},{keyCombination:{modifier:"primary",character:"u"},description:(0,u.__)("Underline the selected text.")},{keyCombination:{modifier:"access",character:"d"},description:(0,u.__)("Strikethrough the selected text.")},{keyCombination:{modifier:"access",character:"x"},description:(0,u.__)("Make the selected text inline code.")},{keyCombination:{modifier:"access",character:"0"},aliases:[{modifier:"access",character:"7"}],description:(0,u.__)("Convert the current heading to a paragraph.")},{keyCombination:{modifier:"access",character:"1-6"},description:(0,u.__)("Convert the current paragraph or heading to a heading of level 1 to 6.")},{keyCombination:{modifier:"primaryShift",character:"SPACE"},description:(0,u.__)("Add non breaking space.")}];function H({keyCombination:e,forceAriaLabel:t}){const s=e.modifier?v.displayShortcutList[e.modifier](e.character):e.character,i=e.modifier?v.shortcutAriaLabel[e.modifier](e.character):e.character;return(0,g.jsx)("kbd",{className:"customize-widgets-keyboard-shortcut-help-modal__shortcut-key-combination","aria-label":t||i,children:(Array.isArray(s)?s:[s]).map(((e,t)=>"+"===e?(0,g.jsx)(r.Fragment,{children:e},t):(0,g.jsx)("kbd",{className:"customize-widgets-keyboard-shortcut-help-modal__shortcut-key",children:e},t)))})}const R=function({description:e,keyCombination:t,aliases:s=[],ariaLabel:i}){return(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)("div",{className:"customize-widgets-keyboard-shortcut-help-modal__shortcut-description",children:e}),(0,g.jsxs)("div",{className:"customize-widgets-keyboard-shortcut-help-modal__shortcut-term",children:[(0,g.jsx)(H,{keyCombination:t,forceAriaLabel:i}),s.map(((e,t)=>(0,g.jsx)(H,{keyCombination:e,forceAriaLabel:i},t)))]})]})};const G=function({name:e}){const{keyCombination:t,description:s,aliases:i}=(0,a.useSelect)((t=>{const{getShortcutKeyCombination:s,getShortcutDescription:i,getShortcutAliases:r}=t(L.store);return{keyCombination:s(e),aliases:r(e),description:i(e)}}),[e]);return t?(0,g.jsx)(R,{keyCombination:t,description:s,aliases:i}):null},V=({shortcuts:e})=>(0,g.jsx)("ul",{className:"customize-widgets-keyboard-shortcut-help-modal__shortcut-list",role:"list",children:e.map(((e,t)=>(0,g.jsx)("li",{className:"customize-widgets-keyboard-shortcut-help-modal__shortcut",children:"string"==typeof e?(0,g.jsx)(G,{name:e}):(0,g.jsx)(R,{...e})},t)))}),U=({title:e,shortcuts:t,className:s})=>(0,g.jsxs)("section",{className:k("customize-widgets-keyboard-shortcut-help-modal__section",s),children:[!!e&&(0,g.jsx)("h2",{className:"customize-widgets-keyboard-shortcut-help-modal__section-title",children:e}),(0,g.jsx)(V,{shortcuts:t})]}),$=({title:e,categoryName:t,additionalShortcuts:s=[]})=>{const i=(0,a.useSelect)((e=>e(L.store).getCategoryShortcuts(t)),[t]);return(0,g.jsx)(U,{title:e,shortcuts:i.concat(s)})};function q({isModalActive:e,toggleModal:t}){const{registerShortcut:s}=(0,a.useDispatch)(L.store);return s({name:"core/customize-widgets/keyboard-shortcuts",category:"main",description:(0,u.__)("Display these keyboard shortcuts."),keyCombination:{modifier:"access",character:"h"}}),(0,L.useShortcut)("core/customize-widgets/keyboard-shortcuts",t),e?(0,g.jsxs)(l.Modal,{className:"customize-widgets-keyboard-shortcut-help-modal",title:(0,u.__)("Keyboard shortcuts"),onRequestClose:t,children:[(0,g.jsx)(U,{className:"customize-widgets-keyboard-shortcut-help-modal__main-shortcuts",shortcuts:["core/customize-widgets/keyboard-shortcuts"]}),(0,g.jsx)($,{title:(0,u.__)("Global shortcuts"),categoryName:"global"}),(0,g.jsx)($,{title:(0,u.__)("Selection shortcuts"),categoryName:"selection"}),(0,g.jsx)($,{title:(0,u.__)("Block shortcuts"),categoryName:"block",additionalShortcuts:[{keyCombination:{character:"/"},description:(0,u.__)("Change the block type after adding a new paragraph."),ariaLabel:(0,u.__)("Forward-slash")}]}),(0,g.jsx)(U,{title:(0,u.__)("Text formatting"),shortcuts:D})]}):null}function K(){const[e,t]=(0,r.useState)(!1),s=()=>t(!e);return(0,L.useShortcut)("core/customize-widgets/keyboard-shortcuts",s),(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)(l.ToolbarDropdownMenu,{icon:N,label:(0,u.__)("Options"),popoverProps:{placement:"bottom-end",className:"more-menu-dropdown__content"},toggleProps:{tooltipPosition:"bottom",size:"compact"},children:()=>(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)(l.MenuGroup,{label:(0,u._x)("View","noun"),children:(0,g.jsx)(d.PreferenceToggleMenuItem,{scope:"core/customize-widgets",name:"fixedToolbar",label:(0,u.__)("Top toolbar"),info:(0,u.__)("Access all block and document tools in a single place"),messageActivated:(0,u.__)("Top toolbar activated"),messageDeactivated:(0,u.__)("Top toolbar deactivated")})}),(0,g.jsxs)(l.MenuGroup,{label:(0,u.__)("Tools"),children:[(0,g.jsx)(l.MenuItem,{onClick:()=>{t(!0)},shortcut:v.displayShortcut.access("h"),children:(0,u.__)("Keyboard shortcuts")}),(0,g.jsx)(d.PreferenceToggleMenuItem,{scope:"core/customize-widgets",name:"welcomeGuide",label:(0,u.__)("Welcome Guide")}),(0,g.jsxs)(l.MenuItem,{role:"menuitem",icon:F,href:(0,u.__)("https://wordpress.org/documentation/article/block-based-widgets-editor/"),target:"_blank",rel:"noopener noreferrer",children:[(0,u.__)("Help"),(0,g.jsx)(l.VisuallyHidden,{as:"span",children:(0,u.__)("(opens in a new tab)")})]})]}),(0,g.jsx)(l.MenuGroup,{label:(0,u.__)("Preferences"),children:(0,g.jsx)(d.PreferenceToggleMenuItem,{scope:"core/customize-widgets",name:"keepCaretInsideBlock",label:(0,u.__)("Contain text cursor inside block"),info:(0,u.__)("Aids screen readers by stopping text caret from leaving blocks."),messageActivated:(0,u.__)("Contain text cursor inside block activated"),messageDeactivated:(0,u.__)("Contain text cursor inside block deactivated")})})]})}),(0,g.jsx)(q,{isModalActive:e,toggleModal:s})]})}const Z=function({sidebar:e,inserter:t,isInserterOpened:s,setIsInserterOpened:i,isFixedToolbarActive:o}){const[[n,c],a]=(0,r.useState)([e.hasUndo(),e.hasRedo()]),d=(0,v.isAppleOS)()?v.displayShortcut.primaryShift("z"):v.displayShortcut.primary("y");return(0,r.useEffect)((()=>e.subscribeHistory((()=>{a([e.hasUndo(),e.hasRedo()])}))),[e]),(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)("div",{className:k("customize-widgets-header",{"is-fixed-toolbar-active":o}),children:(0,g.jsxs)(h.NavigableToolbar,{className:"customize-widgets-header-toolbar","aria-label":(0,u.__)("Document tools"),children:[(0,g.jsx)(l.ToolbarButton,{icon:(0,u.isRTL)()?j:S,label:(0,u.__)("Undo"),shortcut:v.displayShortcut.primary("z"),"aria-disabled":!n,onClick:e.undo,className:"customize-widgets-editor-history-button undo-button"}),(0,g.jsx)(l.ToolbarButton,{icon:(0,u.isRTL)()?S:j,label:(0,u.__)("Redo"),shortcut:d,"aria-disabled":!c,onClick:e.redo,className:"customize-widgets-editor-history-button redo-button"}),(0,g.jsx)(l.ToolbarButton,{className:"customize-widgets-header-toolbar__inserter-toggle",isPressed:s,variant:"primary",icon:I,label:(0,u._x)("Add block","Generic label for block inserter button"),onClick:()=>{i((e=>!e))}}),(0,g.jsx)(K,{})]})}),(0,r.createPortal)((0,g.jsx)(P,{setIsOpened:i}),t.contentContainer[0])]})};var Y=s(7734),J=s.n(Y);const X=window.wp.isShallowEqual;var Q=s.n(X);function ee(e){const t=e.match(/^widget_(.+)(?:\[(\d+)\])$/);if(t){return`${t[1]}-${parseInt(t[2],10)}`}return e}function te(e,t=null){let s;if("core/legacy-widget"===e.name&&(e.attributes.id||e.attributes.instance))if(e.attributes.id)s={id:e.attributes.id};else{const{encoded:i,hash:r,raw:o,...n}=e.attributes.instance;s={idBase:e.attributes.idBase,instance:{...t?.instance,is_widget_customizer_js_value:!0,encoded_serialized_instance:i,instance_hash_key:r,raw_instance:o,...n}}}else{s={idBase:"block",widgetClass:"WP_Widget_Block",instance:{raw_instance:{content:(0,c.serialize)(e)}}}}const{form:i,rendered:r,...o}=t||{};return{...o,...s}}function se({id:e,idBase:t,number:s,instance:i}){let r;const{encoded_serialized_instance:o,instance_hash_key:a,raw_instance:d,...l}=i;if("block"===t){var u;const e=(0,c.parse)(null!==(u=d.content)&&void 0!==u?u:"",{__unstableSkipAutop:!0});r=e.length?e[0]:(0,c.createBlock)("core/paragraph",{})}else r=s?(0,c.createBlock)("core/legacy-widget",{idBase:t,instance:{encoded:o,hash:a,raw:d,...l}}):(0,c.createBlock)("core/legacy-widget",{id:e});return(0,n.addWidgetIdToBlock)(r,e)}function ie(e){const[t,s]=(0,r.useState)((()=>e.getWidgets().map((e=>se(e)))));(0,r.useEffect)((()=>e.subscribe(((e,t)=>{s((s=>{const i=new Map(e.map((e=>[e.id,e]))),r=new Map(s.map((e=>[(0,n.getWidgetIdFromBlock)(e),e]))),o=t.map((e=>{const t=i.get(e.id);return t&&t===e?r.get(e.id):se(e)}));return Q()(s,o)?s:o}))}))),[e]);const i=(0,r.useCallback)((t=>{s((s=>{if(Q()(s,t))return s;const i=new Map(s.map((e=>[(0,n.getWidgetIdFromBlock)(e),e]))),r=t.map((t=>{const s=(0,n.getWidgetIdFromBlock)(t);if(s&&i.has(s)){const r=i.get(s),o=e.getWidget(s);return J()(t,r)&&o?o:te(t,o)}return te(t)}));if(Q()(e.getWidgets(),r))return s;const o=e.setWidgets(r);return t.reduce(((e,s,i)=>{const r=o[i];return null!==r&&(e===t&&(e=t.slice()),e[i]=(0,n.addWidgetIdToBlock)(s,r)),e}),t)}))}),[e]);return[t,i,i]}const re=(0,r.createContext)();function oe({api:e,sidebarControls:t,children:s}){const[i,o]=(0,r.useState)({current:null}),n=(0,r.useCallback)((e=>{for(const s of t){if(s.setting.get().includes(e)){s.sectionInstance.expand({completeCallback(){o({current:e})}});break}}}),[t]);(0,r.useEffect)((()=>{function t(e){const t=ee(e);n(t)}let s=!1;function i(){e.previewer.preview.bind("focus-control-for-setting",t),s=!0}return e.previewer.bind("ready",i),()=>{e.previewer.unbind("ready",i),s&&e.previewer.preview.unbind("focus-control-for-setting",t)}}),[e,n]);const c=(0,r.useMemo)((()=>[i,n]),[i,n]);return(0,g.jsx)(re.Provider,{value:c,children:s})}const ne=()=>(0,r.useContext)(re);const ce=window.wp.privateApis,{lock:ae,unlock:de}=(0,ce.__dangerousOptInToUnstableAPIsOnlyForCoreModules)("I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.","@wordpress/customize-widgets"),{ExperimentalBlockEditorProvider:le}=de(h.privateApis);function ue({sidebar:e,settings:t,children:s}){const[i,o,c]=ie(e);return function(e){const{selectBlock:t}=(0,a.useDispatch)(h.store),[s]=ne(),i=(0,r.useRef)(e);(0,r.useEffect)((()=>{i.current=e}),[e]),(0,r.useEffect)((()=>{if(s.current){const e=i.current.find((e=>(0,n.getWidgetIdFromBlock)(e)===s.current));if(e){t(e.clientId);const s=document.querySelector(`[data-block="${e.clientId}"]`);s?.focus()}}}),[s,t])}(i),(0,g.jsx)(le,{value:i,onInput:o,onChange:c,settings:t,useSubRegistry:!1,children:s})}function he({sidebar:e}){const{toggle:t}=(0,a.useDispatch)(d.store),s=e.getWidgets().every((e=>e.id.startsWith("block-")));return(0,g.jsxs)("div",{className:"customize-widgets-welcome-guide",children:[(0,g.jsx)("div",{className:"customize-widgets-welcome-guide__image__wrapper",children:(0,g.jsxs)("picture",{children:[(0,g.jsx)("source",{srcSet:"https://s.w.org/images/block-editor/welcome-editor.svg",media:"(prefers-reduced-motion: reduce)"}),(0,g.jsx)("img",{className:"customize-widgets-welcome-guide__image",src:"https://s.w.org/images/block-editor/welcome-editor.gif",width:"312",height:"240",alt:""})]})}),(0,g.jsx)("h1",{className:"customize-widgets-welcome-guide__heading",children:(0,u.__)("Welcome to block Widgets")}),(0,g.jsx)("p",{className:"customize-widgets-welcome-guide__text",children:s?(0,u.__)("Your theme provides different “block” areas for you to add and edit content. Try adding a search bar, social icons, or other types of blocks here and see how they’ll look on your site."):(0,u.__)("You can now add any block to your site’s widget areas. Don’t worry, all of your favorite widgets still work flawlessly.")}),(0,g.jsx)(l.Button,{className:"customize-widgets-welcome-guide__button",variant:"primary",onClick:()=>t("core/customize-widgets","welcomeGuide"),children:(0,u.__)("Got it")}),(0,g.jsx)("hr",{className:"customize-widgets-welcome-guide__separator"}),!s&&(0,g.jsxs)("p",{className:"customize-widgets-welcome-guide__more-info",children:[(0,u.__)("Want to stick with the old widgets?"),(0,g.jsx)("br",{}),(0,g.jsx)(l.ExternalLink,{href:(0,u.__)("https://wordpress.org/plugins/classic-widgets/"),children:(0,u.__)("Get the Classic Widgets plugin.")})]}),(0,g.jsxs)("p",{className:"customize-widgets-welcome-guide__more-info",children:[(0,u.__)("New to the block editor?"),(0,g.jsx)("br",{}),(0,g.jsx)(l.ExternalLink,{href:(0,u.__)("https://wordpress.org/documentation/article/wordpress-block-editor/"),children:(0,u.__)("Here's a detailed guide.")})]})]})}function pe({undo:e,redo:t,save:s}){return(0,L.useShortcut)("core/customize-widgets/undo",(t=>{e(),t.preventDefault()})),(0,L.useShortcut)("core/customize-widgets/redo",(e=>{t(),e.preventDefault()})),(0,L.useShortcut)("core/customize-widgets/save",(e=>{e.preventDefault(),s()})),null}pe.Register=function(){const{registerShortcut:e,unregisterShortcut:t}=(0,a.useDispatch)(L.store);return(0,r.useEffect)((()=>(e({name:"core/customize-widgets/undo",category:"global",description:(0,u.__)("Undo your last changes."),keyCombination:{modifier:"primary",character:"z"}}),e({name:"core/customize-widgets/redo",category:"global",description:(0,u.__)("Redo your last undo."),keyCombination:{modifier:"primaryShift",character:"z"},aliases:(0,v.isAppleOS)()?[]:[{modifier:"primary",character:"y"}]}),e({name:"core/customize-widgets/save",category:"global",description:(0,u.__)("Save your changes."),keyCombination:{modifier:"primary",character:"s"}}),()=>{t("core/customize-widgets/undo"),t("core/customize-widgets/redo"),t("core/customize-widgets/save")})),[e]),null};const me=pe;function ge(e){const t=(0,r.useRef)(),s=(0,a.useSelect)((e=>0===e(h.store).getBlockCount()));return(0,r.useEffect)((()=>{if(s&&t.current){const{ownerDocument:e}=t.current;e.activeElement&&e.activeElement!==e.body||t.current.focus()}}),[s]),(0,g.jsx)(h.ButtonBlockAppender,{...e,ref:t})}const{ExperimentalBlockCanvas:be}=de(h.privateApis),{BlockKeyboardShortcuts:we}=de(o.privateApis);function fe({blockEditorSettings:e,sidebar:t,inserter:s,inspector:i}){const[o,n]=function(e){const t=(0,a.useSelect)((e=>e(T).isInserterOpened()),[]),{setIsInserterOpened:s}=(0,a.useDispatch)(T);return(0,r.useEffect)((()=>{t?e.open():e.close()}),[e,t]),[t,(0,r.useCallback)((e=>{let t=e;"function"==typeof e&&(t=e((0,a.select)(T).isInserterOpened())),s(t)}),[s])]}(s),c=(0,p.useViewportMatch)("small"),{hasUploadPermissions:l,isFixedToolbarActive:u,keepCaretInsideBlock:m,isWelcomeGuideActive:b}=(0,a.useSelect)((e=>{var t;const{get:s}=e(d.store);return{hasUploadPermissions:null===(t=e(f.store).canUser("create","media"))||void 0===t||t,isFixedToolbarActive:!!s("core/customize-widgets","fixedToolbar"),keepCaretInsideBlock:!!s("core/customize-widgets","keepCaretInsideBlock"),isWelcomeGuideActive:!!s("core/customize-widgets","welcomeGuide")}}),[]),w=(0,r.useMemo)((()=>{let t;return l&&(t=({onError:t,...s})=>{(0,_.uploadMedia)({wpAllowedMimeTypes:e.allowedMimeTypes,onError:({message:e})=>t(e),...s})}),{...e,__experimentalSetIsInserterOpened:n,mediaUpload:t,hasFixedToolbar:u||!c,keepCaretInsideBlock:m,__unstableHasCustomAppender:!0}}),[l,e,u,c,m,n]);return b?(0,g.jsx)(he,{sidebar:t}):(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)(me.Register,{}),(0,g.jsx)(we,{}),(0,g.jsxs)(ue,{sidebar:t,settings:w,children:[(0,g.jsx)(me,{undo:t.undo,redo:t.redo,save:t.save}),(0,g.jsx)(Z,{sidebar:t,inserter:s,isInserterOpened:o,setIsInserterOpened:n,isFixedToolbarActive:u||!c}),(u||!c)&&(0,g.jsx)(h.BlockToolbar,{hideDragHandle:!0}),(0,g.jsx)(be,{shouldIframe:!1,styles:w.defaultEditorStyles,height:"100%",children:(0,g.jsx)(h.BlockList,{renderAppender:ge})}),(0,r.createPortal)((0,g.jsx)("form",{onSubmit:e=>e.preventDefault(),children:(0,g.jsx)(h.BlockInspector,{})}),i.contentContainer[0])]}),(0,g.jsx)(h.__unstableBlockSettingsMenuFirstItem,{children:({onClose:e})=>(0,g.jsx)(y,{inspector:i,closeMenu:e})})]})}const _e=(0,r.createContext)();function ye({sidebarControls:e,activeSidebarControl:t,children:s}){const i=(0,r.useMemo)((()=>({sidebarControls:e,activeSidebarControl:t})),[e,t]);return(0,g.jsx)(_e.Provider,{value:i,children:s})}function xe({api:e,sidebarControls:t,blockEditorSettings:s}){const[i,o]=(0,r.useState)(null),n=document.getElementById("customize-theme-controls"),c=(0,r.useRef)();!function(e,t){const{hasSelectedBlock:s,hasMultiSelection:i}=(0,a.useSelect)(h.store),{clearSelectedBlock:o}=(0,a.useDispatch)(h.store);(0,r.useEffect)((()=>{if(t.current&&e){const r=e.inspector,n=e.container[0],c=n.ownerDocument,a=c.defaultView;function d(e){!s()&&!i()||!e||!c.contains(e)||n.contains(e)||t.current.contains(e)||e.closest('[role="dialog"]')||r.expanded()||o()}function l(e){d(e.target)}function u(){d(c.activeElement)}return c.addEventListener("mousedown",l),a.addEventListener("blur",u),()=>{c.removeEventListener("mousedown",l),a.removeEventListener("blur",u)}}}),[t,e,s,i,o])}(i,c),(0,r.useEffect)((()=>{const e=t.map((e=>e.subscribe((t=>{t&&o(e)}))));return()=>{e.forEach((e=>e()))}}),[t]);const d=i&&(0,r.createPortal)((0,g.jsx)(w,{children:(0,g.jsx)(fe,{blockEditorSettings:s,sidebar:i.sidebarAdapter,inserter:i.inserter,inspector:i.inspector},i.id)}),i.container[0]),u=n&&(0,r.createPortal)((0,g.jsx)("div",{className:"customize-widgets-popover",ref:c,children:(0,g.jsx)(l.Popover.Slot,{})}),n);return(0,g.jsx)(l.SlotFillProvider,{children:(0,g.jsx)(ye,{sidebarControls:t,activeSidebarControl:i,children:(0,g.jsxs)(oe,{api:e,sidebarControls:t,children:[d,u]})})})}const ke=e=>`widgets-inspector-${e}`;function ve(){const{wp:{customize:e}}=window,t=window.matchMedia("(prefers-reduced-motion: reduce)");let s=t.matches;return t.addEventListener("change",(e=>{s=e.matches})),class extends e.Section{ready(){const t=function(){const{wp:{customize:e}}=window;return class extends e.Section{constructor(e,t){super(e,t),this.parentSection=t.parentSection,this.returnFocusWhenClose=null,this._isOpen=!1}get isOpen(){return this._isOpen}set isOpen(e){this._isOpen=e,this.triggerActiveCallbacks()}ready(){this.contentContainer[0].classList.add("customize-widgets-layout__inspector")}isContextuallyActive(){return this.isOpen}onChangeExpanded(e,t){super.onChangeExpanded(e,t),this.parentSection&&!t.unchanged&&(e?this.parentSection.collapse({manualTransition:!0}):this.parentSection.expand({manualTransition:!0,completeCallback:()=>{this.returnFocusWhenClose&&!this.contentContainer[0].contains(this.returnFocusWhenClose)&&this.returnFocusWhenClose.focus()}}))}open({returnFocusWhenClose:e}={}){this.isOpen=!0,this.returnFocusWhenClose=e,this.expand({allowMultiple:!0})}close(){this.collapse({allowMultiple:!0})}collapse(e){this.isOpen=!1,super.collapse(e)}triggerActiveCallbacks(){this.active.callbacks.fireWith(this.active,[!1,!0])}}}();this.inspector=new t(ke(this.id),{title:(0,u.__)("Block Settings"),parentSection:this,customizeAction:[(0,u.__)("Customizing"),(0,u.__)("Widgets"),this.params.title].join(" ▸ ")}),e.section.add(this.inspector),this.contentContainer[0].classList.add("customize-widgets__sidebar-section")}hasSubSectionOpened(){return this.inspector.expanded()}onChangeExpanded(e,t){const i=this.controls(),r={...t,completeCallback(){i.forEach((t=>{t.onChangeSectionExpanded?.(e,r)})),t.completeCallback?.()}};if(r.manualTransition){e?(this.contentContainer.addClass(["busy","open"]),this.contentContainer.removeClass("is-sub-section-open"),this.contentContainer.closest(".wp-full-overlay").addClass("section-open")):(this.contentContainer.addClass(["busy","is-sub-section-open"]),this.contentContainer.closest(".wp-full-overlay").addClass("section-open"),this.contentContainer.removeClass("open"));const t=()=>{this.contentContainer.removeClass("busy"),r.completeCallback()};s?t():this.contentContainer.one("transitionend",t)}else super.onChangeExpanded(e,r)}}}const{wp:Ce}=window;function Se(e){const t=e.match(/^(.+)-(\d+)$/);return t?{idBase:t[1],number:parseInt(t[2],10)}:{idBase:e}}function je(e){const{idBase:t,number:s}=Se(e);return s?`widget_${t}[${s}]`:`widget_${t}`}class Ie{constructor(e,t){this.setting=e,this.api=t,this.locked=!1,this.widgetsCache=new WeakMap,this.subscribers=new Set,this.history=[this._getWidgetIds().map((e=>this.getWidget(e)))],this.historyIndex=0,this.historySubscribers=new Set,this._debounceSetHistory=function(e,t,s){let i,r=!1;function o(...o){const n=(r?t:e).apply(this,o);return r=!0,clearTimeout(i),i=setTimeout((()=>{r=!1}),s),n}return o.cancel=()=>{r=!1,clearTimeout(i)},o}(this._pushHistory,this._replaceHistory,1e3),this.setting.bind(this._handleSettingChange.bind(this)),this.api.bind("change",this._handleAllSettingsChange.bind(this)),this.undo=this.undo.bind(this),this.redo=this.redo.bind(this),this.save=this.save.bind(this)}subscribe(e){return this.subscribers.add(e),()=>{this.subscribers.delete(e)}}getWidgets(){return this.history[this.historyIndex]}_emit(...e){for(const t of this.subscribers)t(...e)}_getWidgetIds(){return this.setting.get()}_pushHistory(){this.history=[...this.history.slice(0,this.historyIndex+1),this._getWidgetIds().map((e=>this.getWidget(e)))],this.historyIndex+=1,this.historySubscribers.forEach((e=>e()))}_replaceHistory(){this.history[this.historyIndex]=this._getWidgetIds().map((e=>this.getWidget(e)))}_handleSettingChange(){if(this.locked)return;const e=this.getWidgets();this._pushHistory(),this._emit(e,this.getWidgets())}_handleAllSettingsChange(e){if(this.locked)return;if(!e.id.startsWith("widget_"))return;const t=ee(e.id);if(!this.setting.get().includes(t))return;const s=this.getWidgets();this._pushHistory(),this._emit(s,this.getWidgets())}_createWidget(e){const t=Ce.customize.Widgets.availableWidgets.findWhere({id_base:e.idBase});let s=e.number;t.get("is_multi")&&!s&&(t.set("multi_number",t.get("multi_number")+1),s=t.get("multi_number"));const i=s?`widget_${e.idBase}[${s}]`:`widget_${e.idBase}`,r={transport:Ce.customize.Widgets.data.selectiveRefreshableWidgets[t.get("id_base")]?"postMessage":"refresh",previewer:this.setting.previewer};this.api.create(i,i,"",r).set(e.instance);return ee(i)}_removeWidget(e){const t=je(e.id),s=this.api(t);if(s){const e=s.get();this.widgetsCache.delete(e)}this.api.remove(t)}_updateWidget(e){const t=this.getWidget(e.id);if(t===e)return e.id;if(t.idBase&&e.idBase&&t.idBase===e.idBase){const t=je(e.id);return this.api(t).set(e.instance),e.id}return this._removeWidget(e),this._createWidget(e)}getWidget(e){if(!e)return null;const{idBase:t,number:s}=Se(e),i=je(e),r=this.api(i);if(!r)return null;const o=r.get();if(this.widgetsCache.has(o))return this.widgetsCache.get(o);const n={id:e,idBase:t,number:s,instance:o};return this.widgetsCache.set(o,n),n}_updateWidgets(e){this.locked=!0;const t=[],s=e.map((e=>{if(e.id&&this.getWidget(e.id))return t.push(null),this._updateWidget(e);const s=this._createWidget(e);return t.push(s),s}));return this.getWidgets().filter((e=>!s.includes(e.id))).forEach((e=>this._removeWidget(e))),this.setting.set(s),this.locked=!1,t}setWidgets(e){const t=this._updateWidgets(e);return this._debounceSetHistory(),t}hasUndo(){return this.historyIndex>0}hasRedo(){return this.historyIndexe())),this._debounceSetHistory.cancel()}undo(){this.hasUndo()&&this._seek(this.historyIndex-1)}redo(){this.hasRedo()&&this._seek(this.historyIndex+1)}subscribeHistory(e){return this.historySubscribers.add(e),()=>{this.historySubscribers.delete(e)}}save(){this.api.previewer.save()}}const ze=window.wp.dom;const We=e=>`widgets-inserter-${e}`;function Be(){const{wp:{customize:e}}=window;return class extends e.Control{constructor(...e){super(...e),this.subscribers=new Set}ready(){const t=function(){const{wp:{customize:e}}=window,t=e.OuterSection;return e.OuterSection=class extends t{onChangeExpanded(t,s){return t&&e.section.each((e=>{"outer"===e.params.type&&e.id!==this.id&&e.expanded()&&e.collapse()})),super.onChangeExpanded(t,s)}},e.sectionConstructor.outer=e.OuterSection,class extends e.OuterSection{constructor(...e){super(...e),this.params.type="outer",this.activeElementBeforeExpanded=null,this.contentContainer[0].ownerDocument.defaultView.addEventListener("keydown",(e=>{!this.expanded()||e.keyCode!==v.ESCAPE&&"Escape"!==e.code||e.defaultPrevented||(e.preventDefault(),e.stopPropagation(),(0,a.dispatch)(T).setIsInserterOpened(!1))}),!0),this.contentContainer.addClass("widgets-inserter"),this.isFromInternalAction=!1,this.expanded.bind((()=>{this.isFromInternalAction||(0,a.dispatch)(T).setIsInserterOpened(this.expanded()),this.isFromInternalAction=!1}))}open(){if(!this.expanded()){const e=this.contentContainer[0];this.activeElementBeforeExpanded=e.ownerDocument.activeElement,this.isFromInternalAction=!0,this.expand({completeCallback(){const t=ze.focus.tabbable.find(e)[1];t&&t.focus()}})}}close(){if(this.expanded()){const e=this.contentContainer[0],t=e.ownerDocument.activeElement;this.isFromInternalAction=!0,this.collapse({completeCallback(){e.contains(t)&&this.activeElementBeforeExpanded&&this.activeElementBeforeExpanded.focus()}})}}}}();this.inserter=new t(We(this.id),{}),e.section.add(this.inserter),this.sectionInstance=e.section(this.section()),this.inspector=this.sectionInstance.inspector,this.sidebarAdapter=new Ie(this.setting,e)}subscribe(e){return this.subscribers.add(e),()=>{this.subscribers.delete(e)}}onChangeSectionExpanded(e,t){t.unchanged||(e||(0,a.dispatch)(T).setIsInserterOpened(!1),this.subscribers.forEach((s=>s(e,t))))}}}const Ee=(0,p.createHigherOrderComponent)((e=>t=>{let s=(0,n.getWidgetIdFromBlock)(t);const i=function(){const{sidebarControls:e}=(0,r.useContext)(_e);return e}(),o=function(){const{activeSidebarControl:e}=(0,r.useContext)(_e);return e}(),c=i?.length>1,d=t.name,l=t.clientId,u=(0,a.useSelect)((e=>e(h.store).canInsertBlockType(d,"")),[d]),p=(0,a.useSelect)((e=>e(h.store).getBlock(l)),[l]),{removeBlock:m}=(0,a.useDispatch)(h.store),[,b]=ne();return(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)(e,{...t}),c&&u&&(0,g.jsx)(h.BlockControls,{children:(0,g.jsx)(n.MoveToWidgetArea,{widgetAreas:i.map((e=>({id:e.id,name:e.params.label,description:e.params.description}))),currentWidgetAreaId:o?.id,onSelect:function(e){const t=i.find((t=>t.id===e));if(s){const e=o.setting,i=t.setting;e(e().filter((e=>e!==s))),i([...i(),s])}else{const e=t.sidebarAdapter;m(l);const i=e.setWidgets([...e.getWidgets(),te(p)]);s=i.reverse().find((e=>!!e))}b(s)}})})]})}),"withMoveToSidebarToolbarItem");(0,m.addFilter)("editor.BlockEdit","core/customize-widgets/block-edit",Ee);(0,m.addFilter)("editor.MediaUpload","core/edit-widgets/replace-media-upload",(()=>_.MediaUpload));const{wp:Ae}=window,Me=(0,p.createHigherOrderComponent)((e=>t=>{var s;const{idBase:i}=t.attributes,r=null!==(s=Ae.customize.Widgets.data.availableWidgets.find((e=>e.id_base===i))?.is_wide)&&void 0!==s&&s;return(0,g.jsx)(e,{...t,isWide:r})}),"withWideWidgetDisplay");(0,m.addFilter)("editor.BlockEdit","core/customize-widgets/wide-widget-display",Me);const{wp:Oe}=window,Te=["core/more","core/block","core/freeform","core/template-part"];function Pe(e,t){(0,a.dispatch)(d.store).setDefaults("core/customize-widgets",{fixedToolbar:!1,welcomeGuide:!0}),(0,a.dispatch)(c.store).reapplyBlockTypeFilters();const s=(0,o.__experimentalGetCoreBlocks)().filter((e=>!(Te.includes(e.name)||e.name.startsWith("core/post")||e.name.startsWith("core/query")||e.name.startsWith("core/site")||e.name.startsWith("core/navigation"))));(0,o.registerCoreBlocks)(s),(0,n.registerLegacyWidgetBlock)(),(0,n.registerLegacyWidgetVariations)(t),(0,n.registerWidgetGroupBlock)(),(0,c.setFreeformContentHandlerName)("core/html");const i=Be();Oe.customize.sectionConstructor.sidebar=ve(),Oe.customize.controlConstructor.sidebar_block_editor=i;const l=document.createElement("div");document.body.appendChild(l),Oe.customize.bind("ready",(()=>{const e=[];Oe.customize.control.each((t=>{t instanceof i&&e.push(t)})),(0,r.createRoot)(l).render((0,g.jsx)(xe,{api:Oe.customize,sidebarControls:e,blockEditorSettings:t}))}))}})(),(window.wp=window.wp||{}).customizeWidgets=i})();edit-post.js000064400000343744147177406350007047 0ustar00/******/ (() => { // webpackBootstrap /******/ "use strict"; /******/ // The require scope /******/ var __webpack_require__ = {}; /******/ /************************************************************************/ /******/ /* webpack/runtime/compat get default export */ /******/ (() => { /******/ // getDefaultExport function for compatibility with non-harmony modules /******/ __webpack_require__.n = (module) => { /******/ var getter = module && module.__esModule ? /******/ () => (module['default']) : /******/ () => (module); /******/ __webpack_require__.d(getter, { a: getter }); /******/ return getter; /******/ }; /******/ })(); /******/ /******/ /* webpack/runtime/define property getters */ /******/ (() => { /******/ // define getter functions for harmony exports /******/ __webpack_require__.d = (exports, definition) => { /******/ for(var key in definition) { /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); /******/ } /******/ } /******/ }; /******/ })(); /******/ /******/ /* webpack/runtime/hasOwnProperty shorthand */ /******/ (() => { /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) /******/ })(); /******/ /******/ /* webpack/runtime/make namespace object */ /******/ (() => { /******/ // define __esModule on exports /******/ __webpack_require__.r = (exports) => { /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); /******/ } /******/ Object.defineProperty(exports, '__esModule', { value: true }); /******/ }; /******/ })(); /******/ /************************************************************************/ var __webpack_exports__ = {}; // ESM COMPAT FLAG __webpack_require__.r(__webpack_exports__); // EXPORTS __webpack_require__.d(__webpack_exports__, { PluginBlockSettingsMenuItem: () => (/* reexport */ PluginBlockSettingsMenuItem), PluginDocumentSettingPanel: () => (/* reexport */ PluginDocumentSettingPanel), PluginMoreMenuItem: () => (/* reexport */ PluginMoreMenuItem), PluginPostPublishPanel: () => (/* reexport */ PluginPostPublishPanel), PluginPostStatusInfo: () => (/* reexport */ PluginPostStatusInfo), PluginPrePublishPanel: () => (/* reexport */ PluginPrePublishPanel), PluginSidebar: () => (/* reexport */ PluginSidebar), PluginSidebarMoreMenuItem: () => (/* reexport */ PluginSidebarMoreMenuItem), __experimentalFullscreenModeClose: () => (/* reexport */ fullscreen_mode_close), __experimentalMainDashboardButton: () => (/* binding */ __experimentalMainDashboardButton), __experimentalPluginPostExcerpt: () => (/* reexport */ __experimentalPluginPostExcerpt), initializeEditor: () => (/* binding */ initializeEditor), reinitializeEditor: () => (/* binding */ reinitializeEditor), store: () => (/* reexport */ store) }); // NAMESPACE OBJECT: ./node_modules/@wordpress/edit-post/build-module/store/actions.js var actions_namespaceObject = {}; __webpack_require__.r(actions_namespaceObject); __webpack_require__.d(actions_namespaceObject, { __experimentalSetPreviewDeviceType: () => (__experimentalSetPreviewDeviceType), __unstableCreateTemplate: () => (__unstableCreateTemplate), closeGeneralSidebar: () => (closeGeneralSidebar), closeModal: () => (closeModal), closePublishSidebar: () => (closePublishSidebar), hideBlockTypes: () => (hideBlockTypes), initializeMetaBoxes: () => (initializeMetaBoxes), metaBoxUpdatesFailure: () => (metaBoxUpdatesFailure), metaBoxUpdatesSuccess: () => (metaBoxUpdatesSuccess), openGeneralSidebar: () => (openGeneralSidebar), openModal: () => (openModal), openPublishSidebar: () => (openPublishSidebar), removeEditorPanel: () => (removeEditorPanel), requestMetaBoxUpdates: () => (requestMetaBoxUpdates), setAvailableMetaBoxesPerLocation: () => (setAvailableMetaBoxesPerLocation), setIsEditingTemplate: () => (setIsEditingTemplate), setIsInserterOpened: () => (setIsInserterOpened), setIsListViewOpened: () => (setIsListViewOpened), showBlockTypes: () => (showBlockTypes), switchEditorMode: () => (switchEditorMode), toggleDistractionFree: () => (toggleDistractionFree), toggleEditorPanelEnabled: () => (toggleEditorPanelEnabled), toggleEditorPanelOpened: () => (toggleEditorPanelOpened), toggleFeature: () => (toggleFeature), togglePinnedPluginItem: () => (togglePinnedPluginItem), togglePublishSidebar: () => (togglePublishSidebar), updatePreferredStyleVariations: () => (updatePreferredStyleVariations) }); // NAMESPACE OBJECT: ./node_modules/@wordpress/edit-post/build-module/store/selectors.js var selectors_namespaceObject = {}; __webpack_require__.r(selectors_namespaceObject); __webpack_require__.d(selectors_namespaceObject, { __experimentalGetInsertionPoint: () => (__experimentalGetInsertionPoint), __experimentalGetPreviewDeviceType: () => (__experimentalGetPreviewDeviceType), areMetaBoxesInitialized: () => (areMetaBoxesInitialized), getActiveGeneralSidebarName: () => (getActiveGeneralSidebarName), getActiveMetaBoxLocations: () => (getActiveMetaBoxLocations), getAllMetaBoxes: () => (getAllMetaBoxes), getEditedPostTemplate: () => (getEditedPostTemplate), getEditorMode: () => (getEditorMode), getHiddenBlockTypes: () => (getHiddenBlockTypes), getMetaBoxesPerLocation: () => (getMetaBoxesPerLocation), getPreference: () => (getPreference), getPreferences: () => (getPreferences), hasMetaBoxes: () => (hasMetaBoxes), isEditingTemplate: () => (isEditingTemplate), isEditorPanelEnabled: () => (isEditorPanelEnabled), isEditorPanelOpened: () => (isEditorPanelOpened), isEditorPanelRemoved: () => (isEditorPanelRemoved), isEditorSidebarOpened: () => (isEditorSidebarOpened), isFeatureActive: () => (isFeatureActive), isInserterOpened: () => (isInserterOpened), isListViewOpened: () => (isListViewOpened), isMetaBoxLocationActive: () => (isMetaBoxLocationActive), isMetaBoxLocationVisible: () => (isMetaBoxLocationVisible), isModalActive: () => (isModalActive), isPluginItemPinned: () => (isPluginItemPinned), isPluginSidebarOpened: () => (isPluginSidebarOpened), isPublishSidebarOpened: () => (isPublishSidebarOpened), isSavingMetaBoxes: () => (selectors_isSavingMetaBoxes) }); ;// CONCATENATED MODULE: external ["wp","blocks"] const external_wp_blocks_namespaceObject = window["wp"]["blocks"]; ;// CONCATENATED MODULE: external ["wp","blockLibrary"] const external_wp_blockLibrary_namespaceObject = window["wp"]["blockLibrary"]; ;// CONCATENATED MODULE: external ["wp","deprecated"] const external_wp_deprecated_namespaceObject = window["wp"]["deprecated"]; var external_wp_deprecated_default = /*#__PURE__*/__webpack_require__.n(external_wp_deprecated_namespaceObject); ;// CONCATENATED MODULE: external ["wp","element"] const external_wp_element_namespaceObject = window["wp"]["element"]; ;// CONCATENATED MODULE: external ["wp","data"] const external_wp_data_namespaceObject = window["wp"]["data"]; ;// CONCATENATED MODULE: external ["wp","preferences"] const external_wp_preferences_namespaceObject = window["wp"]["preferences"]; ;// CONCATENATED MODULE: external ["wp","widgets"] const external_wp_widgets_namespaceObject = window["wp"]["widgets"]; ;// CONCATENATED MODULE: external ["wp","editor"] const external_wp_editor_namespaceObject = window["wp"]["editor"]; ;// CONCATENATED MODULE: external ["wp","components"] const external_wp_components_namespaceObject = window["wp"]["components"]; ;// CONCATENATED MODULE: external ["wp","coreData"] const external_wp_coreData_namespaceObject = window["wp"]["coreData"]; ;// CONCATENATED MODULE: external ["wp","commands"] const external_wp_commands_namespaceObject = window["wp"]["commands"]; ;// CONCATENATED MODULE: ./node_modules/clsx/dist/clsx.mjs function r(e){var t,f,n="";if("string"==typeof e||"number"==typeof e)n+=e;else if("object"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t box.id === metabox.id); if (existing !== -1) { mergedMetaboxes[existing] = metabox; } else { mergedMetaboxes.push(metabox); } } return mergedMetaboxes; } /** * Reducer keeping track of the meta boxes per location. * * @param {boolean} state Previous state. * @param {Object} action Action Object. * * @return {Object} Updated state. */ function metaBoxLocations(state = {}, action) { switch (action.type) { case 'SET_META_BOXES_PER_LOCATIONS': { const newState = { ...state }; for (const [location, metaboxes] of Object.entries(action.metaBoxesPerLocation)) { newState[location] = mergeMetaboxes(newState[location], metaboxes); } return newState; } } return state; } /** * Reducer tracking whether meta boxes are initialized. * * @param {boolean} state * @param {Object} action * * @return {boolean} Updated state. */ function metaBoxesInitialized(state = false, action) { switch (action.type) { case 'META_BOXES_INITIALIZED': return true; } return state; } const metaBoxes = (0,external_wp_data_namespaceObject.combineReducers)({ isSaving: isSavingMetaBoxes, locations: metaBoxLocations, initialized: metaBoxesInitialized }); /* harmony default export */ const reducer = ((0,external_wp_data_namespaceObject.combineReducers)({ metaBoxes })); ;// CONCATENATED MODULE: external ["wp","apiFetch"] const external_wp_apiFetch_namespaceObject = window["wp"]["apiFetch"]; var external_wp_apiFetch_default = /*#__PURE__*/__webpack_require__.n(external_wp_apiFetch_namespaceObject); ;// CONCATENATED MODULE: external ["wp","hooks"] const external_wp_hooks_namespaceObject = window["wp"]["hooks"]; ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/utils/meta-boxes.js /** * Function returning the current Meta Boxes DOM Node in the editor * whether the meta box area is opened or not. * If the MetaBox Area is visible returns it, and returns the original container instead. * * @param {string} location Meta Box location. * * @return {string} HTML content. */ const getMetaBoxContainer = location => { const area = document.querySelector(`.edit-post-meta-boxes-area.is-${location} .metabox-location-${location}`); if (area) { return area; } return document.querySelector('#metaboxes .metabox-location-' + location); }; ;// CONCATENATED MODULE: external ["wp","privateApis"] const external_wp_privateApis_namespaceObject = window["wp"]["privateApis"]; ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/lock-unlock.js /** * WordPress dependencies */ const { lock, unlock } = (0,external_wp_privateApis_namespaceObject.__dangerousOptInToUnstableAPIsOnlyForCoreModules)('I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.', '@wordpress/edit-post'); ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/store/actions.js /** * WordPress dependencies */ /** * Internal dependencies */ const { interfaceStore } = unlock(external_wp_editor_namespaceObject.privateApis); /** * Returns an action object used in signalling that the user opened an editor sidebar. * * @param {?string} name Sidebar name to be opened. */ const openGeneralSidebar = name => ({ registry }) => { registry.dispatch(interfaceStore).enableComplementaryArea('core', name); }; /** * Returns an action object signalling that the user closed the sidebar. */ const closeGeneralSidebar = () => ({ registry }) => registry.dispatch(interfaceStore).disableComplementaryArea('core'); /** * Returns an action object used in signalling that the user opened a modal. * * @deprecated since WP 6.3 use `core/interface` store's action with the same name instead. * * * @param {string} name A string that uniquely identifies the modal. * * @return {Object} Action object. */ const openModal = name => ({ registry }) => { external_wp_deprecated_default()("select( 'core/edit-post' ).openModal( name )", { since: '6.3', alternative: "select( 'core/interface').openModal( name )" }); return registry.dispatch(interfaceStore).openModal(name); }; /** * Returns an action object signalling that the user closed a modal. * * @deprecated since WP 6.3 use `core/interface` store's action with the same name instead. * * @return {Object} Action object. */ const closeModal = () => ({ registry }) => { external_wp_deprecated_default()("select( 'core/edit-post' ).closeModal()", { since: '6.3', alternative: "select( 'core/interface').closeModal()" }); return registry.dispatch(interfaceStore).closeModal(); }; /** * Returns an action object used in signalling that the user opened the publish * sidebar. * @deprecated * * @return {Object} Action object */ const openPublishSidebar = () => ({ registry }) => { external_wp_deprecated_default()("dispatch( 'core/edit-post' ).openPublishSidebar", { since: '6.6', alternative: "dispatch( 'core/editor').openPublishSidebar" }); registry.dispatch(external_wp_editor_namespaceObject.store).openPublishSidebar(); }; /** * Returns an action object used in signalling that the user closed the * publish sidebar. * @deprecated * * @return {Object} Action object. */ const closePublishSidebar = () => ({ registry }) => { external_wp_deprecated_default()("dispatch( 'core/edit-post' ).closePublishSidebar", { since: '6.6', alternative: "dispatch( 'core/editor').closePublishSidebar" }); registry.dispatch(external_wp_editor_namespaceObject.store).closePublishSidebar(); }; /** * Returns an action object used in signalling that the user toggles the publish sidebar. * @deprecated * * @return {Object} Action object */ const togglePublishSidebar = () => ({ registry }) => { external_wp_deprecated_default()("dispatch( 'core/edit-post' ).togglePublishSidebar", { since: '6.6', alternative: "dispatch( 'core/editor').togglePublishSidebar" }); registry.dispatch(external_wp_editor_namespaceObject.store).togglePublishSidebar(); }; /** * Returns an action object used to enable or disable a panel in the editor. * * @deprecated * * @param {string} panelName A string that identifies the panel to enable or disable. * * @return {Object} Action object. */ const toggleEditorPanelEnabled = panelName => ({ registry }) => { external_wp_deprecated_default()("dispatch( 'core/edit-post' ).toggleEditorPanelEnabled", { since: '6.5', alternative: "dispatch( 'core/editor').toggleEditorPanelEnabled" }); registry.dispatch(external_wp_editor_namespaceObject.store).toggleEditorPanelEnabled(panelName); }; /** * Opens a closed panel and closes an open panel. * * @deprecated * * @param {string} panelName A string that identifies the panel to open or close. */ const toggleEditorPanelOpened = panelName => ({ registry }) => { external_wp_deprecated_default()("dispatch( 'core/edit-post' ).toggleEditorPanelOpened", { since: '6.5', alternative: "dispatch( 'core/editor').toggleEditorPanelOpened" }); registry.dispatch(external_wp_editor_namespaceObject.store).toggleEditorPanelOpened(panelName); }; /** * Returns an action object used to remove a panel from the editor. * * @deprecated * * @param {string} panelName A string that identifies the panel to remove. * * @return {Object} Action object. */ const removeEditorPanel = panelName => ({ registry }) => { external_wp_deprecated_default()("dispatch( 'core/edit-post' ).removeEditorPanel", { since: '6.5', alternative: "dispatch( 'core/editor').removeEditorPanel" }); registry.dispatch(external_wp_editor_namespaceObject.store).removeEditorPanel(panelName); }; /** * Triggers an action used to toggle a feature flag. * * @param {string} feature Feature name. */ const toggleFeature = feature => ({ registry }) => registry.dispatch(external_wp_preferences_namespaceObject.store).toggle('core/edit-post', feature); /** * Triggers an action used to switch editor mode. * * @deprecated * * @param {string} mode The editor mode. */ const switchEditorMode = mode => ({ registry }) => { external_wp_deprecated_default()("dispatch( 'core/edit-post' ).switchEditorMode", { since: '6.6', alternative: "dispatch( 'core/editor').switchEditorMode" }); registry.dispatch(external_wp_editor_namespaceObject.store).switchEditorMode(mode); }; /** * Triggers an action object used to toggle a plugin name flag. * * @param {string} pluginName Plugin name. */ const togglePinnedPluginItem = pluginName => ({ registry }) => { const isPinned = registry.select(interfaceStore).isItemPinned('core', pluginName); registry.dispatch(interfaceStore)[isPinned ? 'unpinItem' : 'pinItem']('core', pluginName); }; /** * Returns an action object used in signaling that a style should be auto-applied when a block is created. * * @deprecated */ function updatePreferredStyleVariations() { external_wp_deprecated_default()("dispatch( 'core/edit-post' ).updatePreferredStyleVariations", { since: '6.6', hint: 'Preferred Style Variations are not supported anymore.' }); return { type: 'NOTHING' }; } /** * Update the provided block types to be visible. * * @param {string[]} blockNames Names of block types to show. */ const showBlockTypes = blockNames => ({ registry }) => { unlock(registry.dispatch(external_wp_editor_namespaceObject.store)).showBlockTypes(blockNames); }; /** * Update the provided block types to be hidden. * * @param {string[]} blockNames Names of block types to hide. */ const hideBlockTypes = blockNames => ({ registry }) => { unlock(registry.dispatch(external_wp_editor_namespaceObject.store)).hideBlockTypes(blockNames); }; /** * Stores info about which Meta boxes are available in which location. * * @param {Object} metaBoxesPerLocation Meta boxes per location. */ function setAvailableMetaBoxesPerLocation(metaBoxesPerLocation) { return { type: 'SET_META_BOXES_PER_LOCATIONS', metaBoxesPerLocation }; } /** * Update a metabox. */ const requestMetaBoxUpdates = () => async ({ registry, select, dispatch }) => { dispatch({ type: 'REQUEST_META_BOX_UPDATES' }); // Saves the wp_editor fields. if (window.tinyMCE) { window.tinyMCE.triggerSave(); } // We gather the base form data. const baseFormData = new window.FormData(document.querySelector('.metabox-base-form')); const postId = baseFormData.get('post_ID'); const postType = baseFormData.get('post_type'); // Additional data needed for backward compatibility. // If we do not provide this data, the post will be overridden with the default values. // We cannot rely on getCurrentPost because right now on the editor we may be editing a pattern or a template. // We need to retrieve the post that the base form data is referring to. const post = registry.select(external_wp_coreData_namespaceObject.store).getEditedEntityRecord('postType', postType, postId); const additionalData = [post.comment_status ? ['comment_status', post.comment_status] : false, post.ping_status ? ['ping_status', post.ping_status] : false, post.sticky ? ['sticky', post.sticky] : false, post.author ? ['post_author', post.author] : false].filter(Boolean); // We gather all the metaboxes locations. const activeMetaBoxLocations = select.getActiveMetaBoxLocations(); const formDataToMerge = [baseFormData, ...activeMetaBoxLocations.map(location => new window.FormData(getMetaBoxContainer(location)))]; // Merge all form data objects into a single one. const formData = formDataToMerge.reduce((memo, currentFormData) => { for (const [key, value] of currentFormData) { memo.append(key, value); } return memo; }, new window.FormData()); additionalData.forEach(([key, value]) => formData.append(key, value)); try { // Save the metaboxes. await external_wp_apiFetch_default()({ url: window._wpMetaBoxUrl, method: 'POST', body: formData, parse: false }); dispatch.metaBoxUpdatesSuccess(); } catch { dispatch.metaBoxUpdatesFailure(); } }; /** * Returns an action object used to signal a successful meta box update. * * @return {Object} Action object. */ function metaBoxUpdatesSuccess() { return { type: 'META_BOX_UPDATES_SUCCESS' }; } /** * Returns an action object used to signal a failed meta box update. * * @return {Object} Action object. */ function metaBoxUpdatesFailure() { return { type: 'META_BOX_UPDATES_FAILURE' }; } /** * Action that changes the width of the editing canvas. * * @deprecated * * @param {string} deviceType */ const __experimentalSetPreviewDeviceType = deviceType => ({ registry }) => { external_wp_deprecated_default()("dispatch( 'core/edit-post' ).__experimentalSetPreviewDeviceType", { since: '6.5', version: '6.7', hint: 'registry.dispatch( editorStore ).setDeviceType' }); registry.dispatch(external_wp_editor_namespaceObject.store).setDeviceType(deviceType); }; /** * Returns an action object used to open/close the inserter. * * @deprecated * * @param {boolean|Object} value Whether the inserter should be opened (true) or closed (false). */ const setIsInserterOpened = value => ({ registry }) => { external_wp_deprecated_default()("dispatch( 'core/edit-post' ).setIsInserterOpened", { since: '6.5', alternative: "dispatch( 'core/editor').setIsInserterOpened" }); registry.dispatch(external_wp_editor_namespaceObject.store).setIsInserterOpened(value); }; /** * Returns an action object used to open/close the list view. * * @deprecated * * @param {boolean} isOpen A boolean representing whether the list view should be opened or closed. */ const setIsListViewOpened = isOpen => ({ registry }) => { external_wp_deprecated_default()("dispatch( 'core/edit-post' ).setIsListViewOpened", { since: '6.5', alternative: "dispatch( 'core/editor').setIsListViewOpened" }); registry.dispatch(external_wp_editor_namespaceObject.store).setIsListViewOpened(isOpen); }; /** * Returns an action object used to switch to template editing. * * @deprecated */ function setIsEditingTemplate() { external_wp_deprecated_default()("dispatch( 'core/edit-post' ).setIsEditingTemplate", { since: '6.5', alternative: "dispatch( 'core/editor').setRenderingMode" }); return { type: 'NOTHING' }; } /** * Create a block based template. * * @deprecated */ function __unstableCreateTemplate() { external_wp_deprecated_default()("dispatch( 'core/edit-post' ).__unstableCreateTemplate", { since: '6.5' }); return { type: 'NOTHING' }; } let actions_metaBoxesInitialized = false; /** * Initializes WordPress `postboxes` script and the logic for saving meta boxes. */ const initializeMetaBoxes = () => ({ registry, select, dispatch }) => { const isEditorReady = registry.select(external_wp_editor_namespaceObject.store).__unstableIsEditorReady(); if (!isEditorReady) { return; } // Only initialize once. if (actions_metaBoxesInitialized) { return; } const postType = registry.select(external_wp_editor_namespaceObject.store).getCurrentPostType(); if (window.postboxes.page !== postType) { window.postboxes.add_postbox_toggles(postType); } actions_metaBoxesInitialized = true; // Save metaboxes on save completion, except for autosaves. (0,external_wp_hooks_namespaceObject.addFilter)('editor.__unstableSavePost', 'core/edit-post/save-metaboxes', (previous, options) => previous.then(() => { if (options.isAutosave) { return; } if (!select.hasMetaBoxes()) { return; } return dispatch.requestMetaBoxUpdates(); })); dispatch({ type: 'META_BOXES_INITIALIZED' }); }; /** * Action that toggles Distraction free mode. * Distraction free mode expects there are no sidebars, as due to the * z-index values set, you can't close sidebars. * * @deprecated */ const toggleDistractionFree = () => ({ registry }) => { external_wp_deprecated_default()("dispatch( 'core/edit-post' ).toggleDistractionFree", { since: '6.6', alternative: "dispatch( 'core/editor').toggleDistractionFree" }); registry.dispatch(external_wp_editor_namespaceObject.store).toggleDistractionFree(); }; ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/store/selectors.js /** * WordPress dependencies */ /** * Internal dependencies */ const { interfaceStore: selectors_interfaceStore } = unlock(external_wp_editor_namespaceObject.privateApis); const EMPTY_ARRAY = []; const EMPTY_OBJECT = {}; /** * Returns the current editing mode. * * @param {Object} state Global application state. * * @return {string} Editing mode. */ const getEditorMode = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => () => { var _select$get; return (_select$get = select(external_wp_preferences_namespaceObject.store).get('core', 'editorMode')) !== null && _select$get !== void 0 ? _select$get : 'visual'; }); /** * Returns true if the editor sidebar is opened. * * @param {Object} state Global application state * * @return {boolean} Whether the editor sidebar is opened. */ const isEditorSidebarOpened = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => () => { const activeGeneralSidebar = select(selectors_interfaceStore).getActiveComplementaryArea('core'); return ['edit-post/document', 'edit-post/block'].includes(activeGeneralSidebar); }); /** * Returns true if the plugin sidebar is opened. * * @param {Object} state Global application state. * * @return {boolean} Whether the plugin sidebar is opened. */ const isPluginSidebarOpened = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => () => { const activeGeneralSidebar = select(selectors_interfaceStore).getActiveComplementaryArea('core'); return !!activeGeneralSidebar && !['edit-post/document', 'edit-post/block'].includes(activeGeneralSidebar); }); /** * Returns the current active general sidebar name, or null if there is no * general sidebar active. The active general sidebar is a unique name to * identify either an editor or plugin sidebar. * * Examples: * * - `edit-post/document` * - `my-plugin/insert-image-sidebar` * * @param {Object} state Global application state. * * @return {?string} Active general sidebar name. */ const getActiveGeneralSidebarName = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => () => { return select(selectors_interfaceStore).getActiveComplementaryArea('core'); }); /** * Converts panels from the new preferences store format to the old format * that the post editor previously used. * * The resultant converted data should look like this: * { * panelName: { * enabled: false, * opened: true, * }, * anotherPanelName: { * opened: true * }, * } * * @param {string[] | undefined} inactivePanels An array of inactive panel names. * @param {string[] | undefined} openPanels An array of open panel names. * * @return {Object} The converted panel data. */ function convertPanelsToOldFormat(inactivePanels, openPanels) { var _ref; // First reduce the inactive panels. const panelsWithEnabledState = inactivePanels?.reduce((accumulatedPanels, panelName) => ({ ...accumulatedPanels, [panelName]: { enabled: false } }), {}); // Then reduce the open panels, passing in the result of the previous // reduction as the initial value so that both open and inactive // panel state is combined. const panels = openPanels?.reduce((accumulatedPanels, panelName) => { const currentPanelState = accumulatedPanels?.[panelName]; return { ...accumulatedPanels, [panelName]: { ...currentPanelState, opened: true } }; }, panelsWithEnabledState !== null && panelsWithEnabledState !== void 0 ? panelsWithEnabledState : {}); // The panels variable will only be set if openPanels wasn't `undefined`. // If it isn't set just return `panelsWithEnabledState`, and if that isn't // set return an empty object. return (_ref = panels !== null && panels !== void 0 ? panels : panelsWithEnabledState) !== null && _ref !== void 0 ? _ref : EMPTY_OBJECT; } /** * Returns the preferences (these preferences are persisted locally). * * @param {Object} state Global application state. * * @return {Object} Preferences Object. */ const getPreferences = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => () => { external_wp_deprecated_default()(`select( 'core/edit-post' ).getPreferences`, { since: '6.0', alternative: `select( 'core/preferences' ).get` }); const corePreferences = ['editorMode', 'hiddenBlockTypes'].reduce((accumulatedPrefs, preferenceKey) => { const value = select(external_wp_preferences_namespaceObject.store).get('core', preferenceKey); return { ...accumulatedPrefs, [preferenceKey]: value }; }, {}); // Panels were a preference, but the data structure changed when the state // was migrated to the preferences store. They need to be converted from // the new preferences store format to old format to ensure no breaking // changes for plugins. const inactivePanels = select(external_wp_preferences_namespaceObject.store).get('core', 'inactivePanels'); const openPanels = select(external_wp_preferences_namespaceObject.store).get('core', 'openPanels'); const panels = convertPanelsToOldFormat(inactivePanels, openPanels); return { ...corePreferences, panels }; }); /** * * @param {Object} state Global application state. * @param {string} preferenceKey Preference Key. * @param {*} defaultValue Default Value. * * @return {*} Preference Value. */ function getPreference(state, preferenceKey, defaultValue) { external_wp_deprecated_default()(`select( 'core/edit-post' ).getPreference`, { since: '6.0', alternative: `select( 'core/preferences' ).get` }); // Avoid using the `getPreferences` registry selector where possible. const preferences = getPreferences(state); const value = preferences[preferenceKey]; return value === undefined ? defaultValue : value; } /** * Returns an array of blocks that are hidden. * * @return {Array} A list of the hidden block types */ const getHiddenBlockTypes = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => () => { var _select$get2; return (_select$get2 = select(external_wp_preferences_namespaceObject.store).get('core', 'hiddenBlockTypes')) !== null && _select$get2 !== void 0 ? _select$get2 : EMPTY_ARRAY; }); /** * Returns true if the publish sidebar is opened. * * @deprecated * * @param {Object} state Global application state * * @return {boolean} Whether the publish sidebar is open. */ const isPublishSidebarOpened = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => () => { external_wp_deprecated_default()(`select( 'core/edit-post' ).isPublishSidebarOpened`, { since: '6.6', alternative: `select( 'core/editor' ).isPublishSidebarOpened` }); return select(external_wp_editor_namespaceObject.store).isPublishSidebarOpened(); }); /** * Returns true if the given panel was programmatically removed, or false otherwise. * All panels are not removed by default. * * @deprecated * * @param {Object} state Global application state. * @param {string} panelName A string that identifies the panel. * * @return {boolean} Whether or not the panel is removed. */ const isEditorPanelRemoved = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => (state, panelName) => { external_wp_deprecated_default()(`select( 'core/edit-post' ).isEditorPanelRemoved`, { since: '6.5', alternative: `select( 'core/editor' ).isEditorPanelRemoved` }); return select(external_wp_editor_namespaceObject.store).isEditorPanelRemoved(panelName); }); /** * Returns true if the given panel is enabled, or false otherwise. Panels are * enabled by default. * * @deprecated * * @param {Object} state Global application state. * @param {string} panelName A string that identifies the panel. * * @return {boolean} Whether or not the panel is enabled. */ const isEditorPanelEnabled = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => (state, panelName) => { external_wp_deprecated_default()(`select( 'core/edit-post' ).isEditorPanelEnabled`, { since: '6.5', alternative: `select( 'core/editor' ).isEditorPanelEnabled` }); return select(external_wp_editor_namespaceObject.store).isEditorPanelEnabled(panelName); }); /** * Returns true if the given panel is open, or false otherwise. Panels are * closed by default. * * @deprecated * * @param {Object} state Global application state. * @param {string} panelName A string that identifies the panel. * * @return {boolean} Whether or not the panel is open. */ const isEditorPanelOpened = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => (state, panelName) => { external_wp_deprecated_default()(`select( 'core/edit-post' ).isEditorPanelOpened`, { since: '6.5', alternative: `select( 'core/editor' ).isEditorPanelOpened` }); return select(external_wp_editor_namespaceObject.store).isEditorPanelOpened(panelName); }); /** * Returns true if a modal is active, or false otherwise. * * @deprecated since WP 6.3 use `core/interface` store's selector with the same name instead. * * @param {Object} state Global application state. * @param {string} modalName A string that uniquely identifies the modal. * * @return {boolean} Whether the modal is active. */ const isModalActive = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => (state, modalName) => { external_wp_deprecated_default()(`select( 'core/edit-post' ).isModalActive`, { since: '6.3', alternative: `select( 'core/interface' ).isModalActive` }); return !!select(selectors_interfaceStore).isModalActive(modalName); }); /** * Returns whether the given feature is enabled or not. * * @param {Object} state Global application state. * @param {string} feature Feature slug. * * @return {boolean} Is active. */ const isFeatureActive = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => (state, feature) => { return !!select(external_wp_preferences_namespaceObject.store).get('core/edit-post', feature); }); /** * Returns true if the plugin item is pinned to the header. * When the value is not set it defaults to true. * * @param {Object} state Global application state. * @param {string} pluginName Plugin item name. * * @return {boolean} Whether the plugin item is pinned. */ const isPluginItemPinned = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => (state, pluginName) => { return select(selectors_interfaceStore).isItemPinned('core', pluginName); }); /** * Returns an array of active meta box locations. * * @param {Object} state Post editor state. * * @return {string[]} Active meta box locations. */ const getActiveMetaBoxLocations = (0,external_wp_data_namespaceObject.createSelector)(state => { return Object.keys(state.metaBoxes.locations).filter(location => isMetaBoxLocationActive(state, location)); }, state => [state.metaBoxes.locations]); /** * Returns true if a metabox location is active and visible * * @param {Object} state Post editor state. * @param {string} location Meta box location to test. * * @return {boolean} Whether the meta box location is active and visible. */ const isMetaBoxLocationVisible = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => (state, location) => { return isMetaBoxLocationActive(state, location) && getMetaBoxesPerLocation(state, location)?.some(({ id }) => { return select(external_wp_editor_namespaceObject.store).isEditorPanelEnabled(state, `meta-box-${id}`); }); }); /** * Returns true if there is an active meta box in the given location, or false * otherwise. * * @param {Object} state Post editor state. * @param {string} location Meta box location to test. * * @return {boolean} Whether the meta box location is active. */ function isMetaBoxLocationActive(state, location) { const metaBoxes = getMetaBoxesPerLocation(state, location); return !!metaBoxes && metaBoxes.length !== 0; } /** * Returns the list of all the available meta boxes for a given location. * * @param {Object} state Global application state. * @param {string} location Meta box location to test. * * @return {?Array} List of meta boxes. */ function getMetaBoxesPerLocation(state, location) { return state.metaBoxes.locations[location]; } /** * Returns the list of all the available meta boxes. * * @param {Object} state Global application state. * * @return {Array} List of meta boxes. */ const getAllMetaBoxes = (0,external_wp_data_namespaceObject.createSelector)(state => { return Object.values(state.metaBoxes.locations).flat(); }, state => [state.metaBoxes.locations]); /** * Returns true if the post is using Meta Boxes * * @param {Object} state Global application state * * @return {boolean} Whether there are metaboxes or not. */ function hasMetaBoxes(state) { return getActiveMetaBoxLocations(state).length > 0; } /** * Returns true if the Meta Boxes are being saved. * * @param {Object} state Global application state. * * @return {boolean} Whether the metaboxes are being saved. */ function selectors_isSavingMetaBoxes(state) { return state.metaBoxes.isSaving; } /** * Returns the current editing canvas device type. * * @deprecated * * @param {Object} state Global application state. * * @return {string} Device type. */ const __experimentalGetPreviewDeviceType = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => () => { external_wp_deprecated_default()(`select( 'core/edit-site' ).__experimentalGetPreviewDeviceType`, { since: '6.5', version: '6.7', alternative: `select( 'core/editor' ).getDeviceType` }); return select(external_wp_editor_namespaceObject.store).getDeviceType(); }); /** * Returns true if the inserter is opened. * * @deprecated * * @param {Object} state Global application state. * * @return {boolean} Whether the inserter is opened. */ const isInserterOpened = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => () => { external_wp_deprecated_default()(`select( 'core/edit-post' ).isInserterOpened`, { since: '6.5', alternative: `select( 'core/editor' ).isInserterOpened` }); return select(external_wp_editor_namespaceObject.store).isInserterOpened(); }); /** * Get the insertion point for the inserter. * * @deprecated * * @param {Object} state Global application state. * * @return {Object} The root client ID, index to insert at and starting filter value. */ const __experimentalGetInsertionPoint = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => () => { external_wp_deprecated_default()(`select( 'core/edit-post' ).__experimentalGetInsertionPoint`, { since: '6.5', version: '6.7' }); return unlock(select(external_wp_editor_namespaceObject.store)).getInsertionPoint(); }); /** * Returns true if the list view is opened. * * @param {Object} state Global application state. * * @return {boolean} Whether the list view is opened. */ const isListViewOpened = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => () => { external_wp_deprecated_default()(`select( 'core/edit-post' ).isListViewOpened`, { since: '6.5', alternative: `select( 'core/editor' ).isListViewOpened` }); return select(external_wp_editor_namespaceObject.store).isListViewOpened(); }); /** * Returns true if the template editing mode is enabled. * * @deprecated */ const isEditingTemplate = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => () => { external_wp_deprecated_default()(`select( 'core/edit-post' ).isEditingTemplate`, { since: '6.5', alternative: `select( 'core/editor' ).getRenderingMode` }); return select(external_wp_editor_namespaceObject.store).getCurrentPostType() === 'wp_template'; }); /** * Returns true if meta boxes are initialized. * * @param {Object} state Global application state. * * @return {boolean} Whether meta boxes are initialized. */ function areMetaBoxesInitialized(state) { return state.metaBoxes.initialized; } /** * Retrieves the template of the currently edited post. * * @return {Object?} Post Template. */ const getEditedPostTemplate = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => () => { const { id: postId, type: postType, slug } = select(external_wp_editor_namespaceObject.store).getCurrentPost(); const { getSite, getEditedEntityRecord, getEntityRecords } = select(external_wp_coreData_namespaceObject.store); const siteSettings = getSite(); // First check if the current page is set as the posts page. const isPostsPage = +postId === siteSettings?.page_for_posts; if (isPostsPage) { const defaultTemplateId = select(external_wp_coreData_namespaceObject.store).getDefaultTemplateId({ slug: 'home' }); return getEditedEntityRecord('postType', 'wp_template', defaultTemplateId); } const currentTemplate = select(external_wp_editor_namespaceObject.store).getEditedPostAttribute('template'); if (currentTemplate) { const templateWithSameSlug = getEntityRecords('postType', 'wp_template', { per_page: -1 })?.find(template => template.slug === currentTemplate); if (!templateWithSameSlug) { return templateWithSameSlug; } return getEditedEntityRecord('postType', 'wp_template', templateWithSameSlug.id); } let slugToCheck; // In `draft` status we might not have a slug available, so we use the `single` // post type templates slug(ex page, single-post, single-product etc..). // Pages do not need the `single` prefix in the slug to be prioritized // through template hierarchy. if (slug) { slugToCheck = postType === 'page' ? `${postType}-${slug}` : `single-${postType}-${slug}`; } else { slugToCheck = postType === 'page' ? 'page' : `single-${postType}`; } const defaultTemplateId = select(external_wp_coreData_namespaceObject.store).getDefaultTemplateId({ slug: slugToCheck }); return defaultTemplateId ? select(external_wp_coreData_namespaceObject.store).getEditedEntityRecord('postType', 'wp_template', defaultTemplateId) : null; }); ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/store/constants.js /** * The identifier for the data store. * * @type {string} */ const STORE_NAME = 'core/edit-post'; /** * CSS selector string for the admin bar view post link anchor tag. * * @type {string} */ const VIEW_AS_LINK_SELECTOR = '#wp-admin-bar-view a'; /** * CSS selector string for the admin bar preview post link anchor tag. * * @type {string} */ const VIEW_AS_PREVIEW_LINK_SELECTOR = '#wp-admin-bar-preview a'; ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/store/index.js /** * WordPress dependencies */ /** * Internal dependencies */ /** * Store definition for the edit post namespace. * * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/data/README.md#createReduxStore * * @type {Object} */ const store = (0,external_wp_data_namespaceObject.createReduxStore)(STORE_NAME, { reducer: reducer, actions: actions_namespaceObject, selectors: selectors_namespaceObject }); (0,external_wp_data_namespaceObject.register)(store); ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/back-button/fullscreen-mode-close.js /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ function FullscreenModeClose({ showTooltip, icon, href, initialPost }) { var _postType$labels$view; const { isActive, isRequestingSiteIcon, postType, siteIconUrl } = (0,external_wp_data_namespaceObject.useSelect)(select => { const { getCurrentPostType } = select(external_wp_editor_namespaceObject.store); const { isFeatureActive } = select(store); const { getEntityRecord, getPostType, isResolving } = select(external_wp_coreData_namespaceObject.store); const siteData = getEntityRecord('root', '__unstableBase', undefined) || {}; const _postType = initialPost?.type || getCurrentPostType(); return { isActive: isFeatureActive('fullscreenMode'), isRequestingSiteIcon: isResolving('getEntityRecord', ['root', '__unstableBase', undefined]), postType: getPostType(_postType), siteIconUrl: siteData.site_icon_url }; }, []); const disableMotion = (0,external_wp_compose_namespaceObject.useReducedMotion)(); if (!isActive || !postType) { return null; } let buttonIcon = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Icon, { size: "36px", icon: library_wordpress }); const effect = { expand: { scale: 1.25, transition: { type: 'tween', duration: '0.3' } } }; if (siteIconUrl) { buttonIcon = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__unstableMotion.img, { variants: !disableMotion && effect, alt: (0,external_wp_i18n_namespaceObject.__)('Site Icon'), className: "edit-post-fullscreen-mode-close_site-icon", src: siteIconUrl }); } if (isRequestingSiteIcon) { buttonIcon = null; } // Override default icon if custom icon is provided via props. if (icon) { buttonIcon = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Icon, { size: "36px", icon: icon }); } const classes = dist_clsx({ 'edit-post-fullscreen-mode-close': true, 'has-icon': siteIconUrl }); const buttonHref = href !== null && href !== void 0 ? href : (0,external_wp_url_namespaceObject.addQueryArgs)('edit.php', { post_type: postType.slug }); const buttonLabel = (_postType$labels$view = postType?.labels?.view_items) !== null && _postType$labels$view !== void 0 ? _postType$labels$view : (0,external_wp_i18n_namespaceObject.__)('Back'); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__unstableMotion.div, { whileHover: "expand", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { className: classes, href: buttonHref, label: buttonLabel, showTooltip: showTooltip, children: buttonIcon }) }); } /* harmony default export */ const fullscreen_mode_close = (FullscreenModeClose); ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/back-button/index.js /** * WordPress dependencies */ /** * Internal dependencies */ const { BackButton: BackButtonFill } = unlock(external_wp_editor_namespaceObject.privateApis); const slideX = { hidden: { x: '-100%' }, distractionFreeInactive: { x: 0 }, hover: { x: 0, transition: { type: 'tween', delay: 0.2 } } }; function BackButton({ initialPost }) { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(BackButtonFill, { children: ({ length }) => length <= 1 && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__unstableMotion.div, { variants: slideX, transition: { type: 'tween', delay: 0.8 }, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(fullscreen_mode_close, { showTooltip: true, initialPost: initialPost }) }) }); } /* harmony default export */ const back_button = (BackButton); ;// CONCATENATED MODULE: external ["wp","keyboardShortcuts"] const external_wp_keyboardShortcuts_namespaceObject = window["wp"]["keyboardShortcuts"]; ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/keyboard-shortcuts/index.js /** * WordPress dependencies */ /** * Internal dependencies */ function KeyboardShortcuts() { const { toggleFeature } = (0,external_wp_data_namespaceObject.useDispatch)(store); const { registerShortcut } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_keyboardShortcuts_namespaceObject.store); (0,external_wp_element_namespaceObject.useEffect)(() => { registerShortcut({ name: 'core/edit-post/toggle-fullscreen', category: 'global', description: (0,external_wp_i18n_namespaceObject.__)('Toggle fullscreen mode.'), keyCombination: { modifier: 'secondary', character: 'f' } }); }, []); (0,external_wp_keyboardShortcuts_namespaceObject.useShortcut)('core/edit-post/toggle-fullscreen', () => { toggleFeature('fullscreenMode'); }); return null; } /* harmony default export */ const keyboard_shortcuts = (KeyboardShortcuts); ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/init-pattern-modal/index.js /** * WordPress dependencies */ /** * Internal dependencies */ const { ReusableBlocksRenameHint } = unlock(external_wp_blockEditor_namespaceObject.privateApis); function InitPatternModal() { const { editPost } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_editor_namespaceObject.store); const [isModalOpen, setIsModalOpen] = (0,external_wp_element_namespaceObject.useState)(false); const [syncType, setSyncType] = (0,external_wp_element_namespaceObject.useState)(undefined); const [title, setTitle] = (0,external_wp_element_namespaceObject.useState)(''); const { postType, isNewPost } = (0,external_wp_data_namespaceObject.useSelect)(select => { const { getEditedPostAttribute, isCleanNewPost } = select(external_wp_editor_namespaceObject.store); return { postType: getEditedPostAttribute('type'), isNewPost: isCleanNewPost() }; }, []); (0,external_wp_element_namespaceObject.useEffect)(() => { if (isNewPost && postType === 'wp_block') { setIsModalOpen(true); } // We only want the modal to open when the page is first loaded. // eslint-disable-next-line react-hooks/exhaustive-deps }, []); if (postType !== 'wp_block' || !isNewPost) { return null; } return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: isModalOpen && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Modal, { title: (0,external_wp_i18n_namespaceObject.__)('Create pattern'), onRequestClose: () => { setIsModalOpen(false); }, overlayClassName: "reusable-blocks-menu-items__convert-modal", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("form", { onSubmit: event => { event.preventDefault(); setIsModalOpen(false); editPost({ title, meta: { wp_pattern_sync_status: syncType } }); }, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, { spacing: "5", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.TextControl, { label: (0,external_wp_i18n_namespaceObject.__)('Name'), value: title, onChange: setTitle, placeholder: (0,external_wp_i18n_namespaceObject.__)('My pattern'), className: "patterns-create-modal__name-input", __nextHasNoMarginBottom: true, __next40pxDefaultSize: true }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ReusableBlocksRenameHint, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, { label: (0,external_wp_i18n_namespaceObject._x)('Synced', 'pattern (singular)'), help: (0,external_wp_i18n_namespaceObject.__)('Sync this pattern across multiple locations.'), checked: !syncType, onChange: () => { setSyncType(!syncType ? 'unsynced' : undefined); } }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalHStack, { justify: "right", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { variant: "primary", type: "submit", disabled: !title, __experimentalIsFocusable: true, children: (0,external_wp_i18n_namespaceObject.__)('Create') }) })] }) }) }) }); } ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/browser-url/index.js /** * WordPress dependencies */ /** * Returns the Post's Edit URL. * * @param {number} postId Post ID. * * @return {string} Post edit URL. */ function getPostEditURL(postId) { return (0,external_wp_url_namespaceObject.addQueryArgs)('post.php', { post: postId, action: 'edit' }); } /** * Returns the Post's Trashed URL. * * @param {number} postId Post ID. * @param {string} postType Post Type. * * @return {string} Post trashed URL. */ function getPostTrashedURL(postId, postType) { return (0,external_wp_url_namespaceObject.addQueryArgs)('edit.php', { trashed: 1, post_type: postType, ids: postId }); } class BrowserURL extends external_wp_element_namespaceObject.Component { constructor() { super(...arguments); this.state = { historyId: null }; } componentDidUpdate(prevProps) { const { postId, postStatus, postType, isSavingPost, hasHistory } = this.props; const { historyId } = this.state; // Posts are still dirty while saving so wait for saving to finish // to avoid the unsaved changes warning when trashing posts. if (postStatus === 'trash' && !isSavingPost) { this.setTrashURL(postId, postType); return; } if ((postId !== prevProps.postId || postId !== historyId) && postStatus !== 'auto-draft' && postId && !hasHistory) { this.setBrowserURL(postId); } } /** * Navigates the browser to the post trashed URL to show a notice about the trashed post. * * @param {number} postId Post ID. * @param {string} postType Post Type. */ setTrashURL(postId, postType) { window.location.href = getPostTrashedURL(postId, postType); } /** * Replaces the browser URL with a post editor link for the given post ID. * * Note it is important that, since this function may be called when the * editor first loads, the result generated `getPostEditURL` matches that * produced by the server. Otherwise, the URL will change unexpectedly. * * @param {number} postId Post ID for which to generate post editor URL. */ setBrowserURL(postId) { window.history.replaceState({ id: postId }, 'Post ' + postId, getPostEditURL(postId)); this.setState(() => ({ historyId: postId })); } render() { return null; } } /* harmony default export */ const browser_url = ((0,external_wp_data_namespaceObject.withSelect)(select => { const { getCurrentPost, isSavingPost } = select(external_wp_editor_namespaceObject.store); const post = getCurrentPost(); let { id, status, type } = post; const isTemplate = ['wp_template', 'wp_template_part'].includes(type); if (isTemplate) { id = post.wp_id; } return { postId: id, postStatus: status, postType: type, isSavingPost: isSavingPost() }; })(BrowserURL)); ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/meta-boxes/meta-boxes-area/index.js /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ /** * Render metabox area. * * @param {Object} props Component props. * @param {string} props.location metabox location. * @return {Component} The component to be rendered. */ function MetaBoxesArea({ location }) { const container = (0,external_wp_element_namespaceObject.useRef)(null); const formRef = (0,external_wp_element_namespaceObject.useRef)(null); (0,external_wp_element_namespaceObject.useEffect)(() => { formRef.current = document.querySelector('.metabox-location-' + location); if (formRef.current) { container.current.appendChild(formRef.current); } return () => { if (formRef.current) { document.querySelector('#metaboxes').appendChild(formRef.current); } }; }, [location]); const isSaving = (0,external_wp_data_namespaceObject.useSelect)(select => { return select(store).isSavingMetaBoxes(); }, []); const classes = dist_clsx('edit-post-meta-boxes-area', `is-${location}`, { 'is-loading': isSaving }); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: classes, children: [isSaving && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Spinner, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "edit-post-meta-boxes-area__container", ref: container }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "edit-post-meta-boxes-area__clear" })] }); } /* harmony default export */ const meta_boxes_area = (MetaBoxesArea); ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/meta-boxes/meta-box-visibility.js /** * WordPress dependencies */ class MetaBoxVisibility extends external_wp_element_namespaceObject.Component { componentDidMount() { this.updateDOM(); } componentDidUpdate(prevProps) { if (this.props.isVisible !== prevProps.isVisible) { this.updateDOM(); } } updateDOM() { const { id, isVisible } = this.props; const element = document.getElementById(id); if (!element) { return; } if (isVisible) { element.classList.remove('is-hidden'); } else { element.classList.add('is-hidden'); } } render() { return null; } } /* harmony default export */ const meta_box_visibility = ((0,external_wp_data_namespaceObject.withSelect)((select, { id }) => ({ isVisible: select(external_wp_editor_namespaceObject.store).isEditorPanelEnabled(`meta-box-${id}`) }))(MetaBoxVisibility)); ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/meta-boxes/index.js /** * WordPress dependencies */ /** * Internal dependencies */ function MetaBoxes({ location }) { const registry = (0,external_wp_data_namespaceObject.useRegistry)(); const { metaBoxes, areMetaBoxesInitialized, isEditorReady } = (0,external_wp_data_namespaceObject.useSelect)(select => { const { __unstableIsEditorReady } = select(external_wp_editor_namespaceObject.store); const { getMetaBoxesPerLocation, areMetaBoxesInitialized: _areMetaBoxesInitialized } = select(store); return { metaBoxes: getMetaBoxesPerLocation(location), areMetaBoxesInitialized: _areMetaBoxesInitialized(), isEditorReady: __unstableIsEditorReady() }; }, [location]); const hasMetaBoxes = !!metaBoxes?.length; // When editor is ready, initialize postboxes (wp core script) and metabox // saving. This initializes all meta box locations, not just this specific // one. (0,external_wp_element_namespaceObject.useEffect)(() => { if (isEditorReady && hasMetaBoxes && !areMetaBoxesInitialized) { registry.dispatch(store).initializeMetaBoxes(); } }, [isEditorReady, hasMetaBoxes, areMetaBoxesInitialized]); if (!areMetaBoxesInitialized) { return null; } return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [(metaBoxes !== null && metaBoxes !== void 0 ? metaBoxes : []).map(({ id }) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(meta_box_visibility, { id: id }, id)), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(meta_boxes_area, { location: location })] }); } ;// CONCATENATED MODULE: external ["wp","keycodes"] const external_wp_keycodes_namespaceObject = window["wp"]["keycodes"]; ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/more-menu/manage-patterns-menu-item.js /** * WordPress dependencies */ function ManagePatternsMenuItem() { const url = (0,external_wp_data_namespaceObject.useSelect)(select => { const { canUser } = select(external_wp_coreData_namespaceObject.store); const defaultUrl = (0,external_wp_url_namespaceObject.addQueryArgs)('edit.php', { post_type: 'wp_block' }); const patternsUrl = (0,external_wp_url_namespaceObject.addQueryArgs)('site-editor.php', { path: '/patterns' }); // The site editor and templates both check whether the user has // edit_theme_options capabilities. We can leverage that here and not // display the manage patterns link if the user can't access it. return canUser('create', 'templates') ? patternsUrl : defaultUrl; }, []); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuItem, { role: "menuitem", href: url, children: (0,external_wp_i18n_namespaceObject.__)('Manage patterns') }); } /* harmony default export */ const manage_patterns_menu_item = (ManagePatternsMenuItem); ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/more-menu/welcome-guide-menu-item.js /** * WordPress dependencies */ function WelcomeGuideMenuItem() { const isEditingTemplate = (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_editor_namespaceObject.store).getCurrentPostType() === 'wp_template', []); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_preferences_namespaceObject.PreferenceToggleMenuItem, { scope: "core/edit-post", name: isEditingTemplate ? 'welcomeGuideTemplate' : 'welcomeGuide', label: (0,external_wp_i18n_namespaceObject.__)('Welcome Guide') }); } ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/preferences-modal/enable-custom-fields.js /** * WordPress dependencies */ /** * Internal dependencies */ const { PreferenceBaseOption } = unlock(external_wp_preferences_namespaceObject.privateApis); function submitCustomFieldsForm() { const customFieldsForm = document.getElementById('toggle-custom-fields-form'); // Ensure the referrer values is up to update with any customFieldsForm.querySelector('[name="_wp_http_referer"]').setAttribute('value', (0,external_wp_url_namespaceObject.getPathAndQueryString)(window.location.href)); customFieldsForm.submit(); } function CustomFieldsConfirmation({ willEnable }) { const [isReloading, setIsReloading] = (0,external_wp_element_namespaceObject.useState)(false); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("p", { className: "edit-post-preferences-modal__custom-fields-confirmation-message", children: (0,external_wp_i18n_namespaceObject.__)('A page reload is required for this change. Make sure your content is saved before reloading.') }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { className: "edit-post-preferences-modal__custom-fields-confirmation-button", variant: "secondary", isBusy: isReloading, __experimentalIsFocusable: true, disabled: isReloading, onClick: () => { setIsReloading(true); submitCustomFieldsForm(); }, children: willEnable ? (0,external_wp_i18n_namespaceObject.__)('Show & Reload Page') : (0,external_wp_i18n_namespaceObject.__)('Hide & Reload Page') })] }); } function EnableCustomFieldsOption({ label, areCustomFieldsEnabled }) { const [isChecked, setIsChecked] = (0,external_wp_element_namespaceObject.useState)(areCustomFieldsEnabled); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PreferenceBaseOption, { label: label, isChecked: isChecked, onChange: setIsChecked, children: isChecked !== areCustomFieldsEnabled && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(CustomFieldsConfirmation, { willEnable: isChecked }) }); } /* harmony default export */ const enable_custom_fields = ((0,external_wp_data_namespaceObject.withSelect)(select => ({ areCustomFieldsEnabled: !!select(external_wp_editor_namespaceObject.store).getEditorSettings().enableCustomFields }))(EnableCustomFieldsOption)); ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/preferences-modal/enable-panel.js /** * WordPress dependencies */ /** * Internal dependencies */ const { PreferenceBaseOption: enable_panel_PreferenceBaseOption } = unlock(external_wp_preferences_namespaceObject.privateApis); /* harmony default export */ const enable_panel = ((0,external_wp_compose_namespaceObject.compose)((0,external_wp_data_namespaceObject.withSelect)((select, { panelName }) => { const { isEditorPanelEnabled, isEditorPanelRemoved } = select(external_wp_editor_namespaceObject.store); return { isRemoved: isEditorPanelRemoved(panelName), isChecked: isEditorPanelEnabled(panelName) }; }), (0,external_wp_compose_namespaceObject.ifCondition)(({ isRemoved }) => !isRemoved), (0,external_wp_data_namespaceObject.withDispatch)((dispatch, { panelName }) => ({ onChange: () => dispatch(external_wp_editor_namespaceObject.store).toggleEditorPanelEnabled(panelName) })))(enable_panel_PreferenceBaseOption)); ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/preferences-modal/meta-boxes-section.js /** * WordPress dependencies */ /** * Internal dependencies */ const { PreferencesModalSection } = unlock(external_wp_preferences_namespaceObject.privateApis); function MetaBoxesSection({ areCustomFieldsRegistered, metaBoxes, ...sectionProps }) { // The 'Custom Fields' meta box is a special case that we handle separately. const thirdPartyMetaBoxes = metaBoxes.filter(({ id }) => id !== 'postcustom'); if (!areCustomFieldsRegistered && thirdPartyMetaBoxes.length === 0) { return null; } return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(PreferencesModalSection, { ...sectionProps, children: [areCustomFieldsRegistered && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(enable_custom_fields, { label: (0,external_wp_i18n_namespaceObject.__)('Custom fields') }), thirdPartyMetaBoxes.map(({ id, title }) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(enable_panel, { label: title, panelName: `meta-box-${id}` }, id))] }); } /* harmony default export */ const meta_boxes_section = ((0,external_wp_data_namespaceObject.withSelect)(select => { const { getEditorSettings } = select(external_wp_editor_namespaceObject.store); const { getAllMetaBoxes } = select(store); return { // This setting should not live in the block editor's store. areCustomFieldsRegistered: getEditorSettings().enableCustomFields !== undefined, metaBoxes: getAllMetaBoxes() }; })(MetaBoxesSection)); ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/preferences-modal/index.js /** * WordPress dependencies */ /** * Internal dependencies */ const { PreferenceToggleControl } = unlock(external_wp_preferences_namespaceObject.privateApis); const { PreferencesModal } = unlock(external_wp_editor_namespaceObject.privateApis); function EditPostPreferencesModal() { const extraSections = { general: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(meta_boxes_section, { title: (0,external_wp_i18n_namespaceObject.__)('Advanced') }), appearance: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PreferenceToggleControl, { scope: "core/edit-post", featureName: "themeStyles", help: (0,external_wp_i18n_namespaceObject.__)('Make the editor look like your theme.'), label: (0,external_wp_i18n_namespaceObject.__)('Use theme styles') }) }; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PreferencesModal, { extraSections: extraSections }); } ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/more-menu/index.js /** * WordPress dependencies */ /** * Internal dependencies */ const { ToolsMoreMenuGroup, ViewMoreMenuGroup } = unlock(external_wp_editor_namespaceObject.privateApis); const MoreMenu = () => { const isLargeViewport = (0,external_wp_compose_namespaceObject.useViewportMatch)('large'); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [isLargeViewport && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ViewMoreMenuGroup, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_preferences_namespaceObject.PreferenceToggleMenuItem, { scope: "core/edit-post", name: "fullscreenMode", label: (0,external_wp_i18n_namespaceObject.__)('Fullscreen mode'), info: (0,external_wp_i18n_namespaceObject.__)('Show and hide the admin user interface'), messageActivated: (0,external_wp_i18n_namespaceObject.__)('Fullscreen mode activated'), messageDeactivated: (0,external_wp_i18n_namespaceObject.__)('Fullscreen mode deactivated'), shortcut: external_wp_keycodes_namespaceObject.displayShortcut.secondary('f') }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(ToolsMoreMenuGroup, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(manage_patterns_menu_item, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(WelcomeGuideMenuItem, {})] }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(EditPostPreferencesModal, {})] }); }; /* harmony default export */ const more_menu = (MoreMenu); ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/welcome-guide/image.js function WelcomeGuideImage({ nonAnimatedSrc, animatedSrc }) { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("picture", { className: "edit-post-welcome-guide__image", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("source", { srcSet: nonAnimatedSrc, media: "(prefers-reduced-motion: reduce)" }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("img", { src: animatedSrc, width: "312", height: "240", alt: "" })] }); } ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/welcome-guide/default.js /** * WordPress dependencies */ /** * Internal dependencies */ function WelcomeGuideDefault() { const { toggleFeature } = (0,external_wp_data_namespaceObject.useDispatch)(store); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Guide, { className: "edit-post-welcome-guide", contentLabel: (0,external_wp_i18n_namespaceObject.__)('Welcome to the block editor'), finishButtonText: (0,external_wp_i18n_namespaceObject.__)('Get started'), onFinish: () => toggleFeature('welcomeGuide'), pages: [{ image: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(WelcomeGuideImage, { nonAnimatedSrc: "https://s.w.org/images/block-editor/welcome-canvas.svg", animatedSrc: "https://s.w.org/images/block-editor/welcome-canvas.gif" }), content: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("h1", { className: "edit-post-welcome-guide__heading", children: (0,external_wp_i18n_namespaceObject.__)('Welcome to the block editor') }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("p", { className: "edit-post-welcome-guide__text", children: (0,external_wp_i18n_namespaceObject.__)('In the WordPress editor, each paragraph, image, or video is presented as a distinct “block” of content.') })] }) }, { image: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(WelcomeGuideImage, { nonAnimatedSrc: "https://s.w.org/images/block-editor/welcome-editor.svg", animatedSrc: "https://s.w.org/images/block-editor/welcome-editor.gif" }), content: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("h1", { className: "edit-post-welcome-guide__heading", children: (0,external_wp_i18n_namespaceObject.__)('Make each block your own') }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("p", { className: "edit-post-welcome-guide__text", children: (0,external_wp_i18n_namespaceObject.__)('Each block comes with its own set of controls for changing things like color, width, and alignment. These will show and hide automatically when you have a block selected.') })] }) }, { image: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(WelcomeGuideImage, { nonAnimatedSrc: "https://s.w.org/images/block-editor/welcome-library.svg", animatedSrc: "https://s.w.org/images/block-editor/welcome-library.gif" }), content: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("h1", { className: "edit-post-welcome-guide__heading", children: (0,external_wp_i18n_namespaceObject.__)('Get to know the block library') }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("p", { className: "edit-post-welcome-guide__text", children: (0,external_wp_element_namespaceObject.createInterpolateElement)((0,external_wp_i18n_namespaceObject.__)('All of the blocks available to you live in the block library. You’ll find it wherever you see the icon.'), { InserterIconImage: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("img", { alt: (0,external_wp_i18n_namespaceObject.__)('inserter'), src: "data:image/svg+xml,%3Csvg width='18' height='18' viewBox='0 0 18 18' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Crect width='18' height='18' rx='2' fill='%231E1E1E'/%3E%3Cpath d='M9.22727 4V14M4 8.77273H14' stroke='white' stroke-width='1.5'/%3E%3C/svg%3E%0A" }) }) })] }) }, { image: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(WelcomeGuideImage, { nonAnimatedSrc: "https://s.w.org/images/block-editor/welcome-documentation.svg", animatedSrc: "https://s.w.org/images/block-editor/welcome-documentation.gif" }), content: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("h1", { className: "edit-post-welcome-guide__heading", children: (0,external_wp_i18n_namespaceObject.__)('Learn how to use the block editor') }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("p", { className: "edit-post-welcome-guide__text", children: [(0,external_wp_i18n_namespaceObject.__)('New to the block editor? Want to learn more about using it? '), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ExternalLink, { href: (0,external_wp_i18n_namespaceObject.__)('https://wordpress.org/documentation/article/wordpress-block-editor/'), children: (0,external_wp_i18n_namespaceObject.__)("Here's a detailed guide.") })] })] }) }] }); } ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/welcome-guide/template.js /** * WordPress dependencies */ /** * Internal dependencies */ function WelcomeGuideTemplate() { const { toggleFeature } = (0,external_wp_data_namespaceObject.useDispatch)(store); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Guide, { className: "edit-template-welcome-guide", contentLabel: (0,external_wp_i18n_namespaceObject.__)('Welcome to the template editor'), finishButtonText: (0,external_wp_i18n_namespaceObject.__)('Get started'), onFinish: () => toggleFeature('welcomeGuideTemplate'), pages: [{ image: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(WelcomeGuideImage, { nonAnimatedSrc: "https://s.w.org/images/block-editor/welcome-template-editor.svg", animatedSrc: "https://s.w.org/images/block-editor/welcome-template-editor.gif" }), content: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("h1", { className: "edit-post-welcome-guide__heading", children: (0,external_wp_i18n_namespaceObject.__)('Welcome to the template editor') }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("p", { className: "edit-post-welcome-guide__text", children: (0,external_wp_i18n_namespaceObject.__)('Templates help define the layout of the site. You can customize all aspects of your posts and pages using blocks and patterns in this editor.') })] }) }] }); } ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/welcome-guide/index.js /** * WordPress dependencies */ /** * Internal dependencies */ function WelcomeGuide() { const { isActive, isEditingTemplate } = (0,external_wp_data_namespaceObject.useSelect)(select => { const { isFeatureActive } = select(store); const { getCurrentPostType } = select(external_wp_editor_namespaceObject.store); const _isEditingTemplate = getCurrentPostType() === 'wp_template'; const feature = _isEditingTemplate ? 'welcomeGuideTemplate' : 'welcomeGuide'; return { isActive: isFeatureActive(feature), isEditingTemplate: _isEditingTemplate }; }, []); if (!isActive) { return null; } return isEditingTemplate ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(WelcomeGuideTemplate, {}) : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(WelcomeGuideDefault, {}); } ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/fullscreen.js /** * WordPress dependencies */ const fullscreen = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M6 4a2 2 0 0 0-2 2v3h1.5V6a.5.5 0 0 1 .5-.5h3V4H6Zm3 14.5H6a.5.5 0 0 1-.5-.5v-3H4v3a2 2 0 0 0 2 2h3v-1.5Zm6 1.5v-1.5h3a.5.5 0 0 0 .5-.5v-3H20v3a2 2 0 0 1-2 2h-3Zm3-16a2 2 0 0 1 2 2v3h-1.5V6a.5.5 0 0 0-.5-.5h-3V4h3Z" }) }); /* harmony default export */ const library_fullscreen = (fullscreen); ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/commands/use-commands.js /** * WordPress dependencies */ function useCommands() { const { isFullscreen } = (0,external_wp_data_namespaceObject.useSelect)(select => { const { get } = select(external_wp_preferences_namespaceObject.store); return { isFullscreen: get('core/edit-post', 'fullscreenMode') }; }, []); const { toggle } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_preferences_namespaceObject.store); const { createInfoNotice } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store); (0,external_wp_commands_namespaceObject.useCommand)({ name: 'core/toggle-fullscreen-mode', label: isFullscreen ? (0,external_wp_i18n_namespaceObject.__)('Exit fullscreen') : (0,external_wp_i18n_namespaceObject.__)('Enter fullscreen'), icon: library_fullscreen, callback: ({ close }) => { toggle('core/edit-post', 'fullscreenMode'); close(); createInfoNotice(isFullscreen ? (0,external_wp_i18n_namespaceObject.__)('Fullscreen off.') : (0,external_wp_i18n_namespaceObject.__)('Fullscreen on.'), { id: 'core/edit-post/toggle-fullscreen-mode/notice', type: 'snackbar', actions: [{ label: (0,external_wp_i18n_namespaceObject.__)('Undo'), onClick: () => { toggle('core/edit-post', 'fullscreenMode'); } }] }); } }); } ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/layout/use-padding-appender.js /** * WordPress dependencies */ function usePaddingAppender() { const registry = (0,external_wp_data_namespaceObject.useRegistry)(); return (0,external_wp_compose_namespaceObject.useRefEffect)(node => { function onMouseDown(event) { if (event.target !== node) { return; } const { ownerDocument } = node; const { defaultView } = ownerDocument; const pseudoHeight = defaultView.parseInt(defaultView.getComputedStyle(node, ':after').height, 10); if (!pseudoHeight) { return; } // Only handle clicks under the last child. const lastChild = node.lastElementChild; if (!lastChild) { return; } const lastChildRect = lastChild.getBoundingClientRect(); if (event.clientY < lastChildRect.bottom) { return; } event.stopPropagation(); const blockOrder = registry.select(external_wp_blockEditor_namespaceObject.store).getBlockOrder(''); const lastBlockClientId = blockOrder[blockOrder.length - 1]; const lastBlock = registry.select(external_wp_blockEditor_namespaceObject.store).getBlock(lastBlockClientId); const { selectBlock, insertDefaultBlock } = registry.dispatch(external_wp_blockEditor_namespaceObject.store); if (lastBlock && (0,external_wp_blocks_namespaceObject.isUnmodifiedDefaultBlock)(lastBlock)) { selectBlock(lastBlockClientId); } else { insertDefaultBlock(); } } node.addEventListener('mousedown', onMouseDown); return () => { node.removeEventListener('mousedown', onMouseDown); }; }, [registry]); } ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/layout/use-should-iframe.js /** * WordPress dependencies */ /** * Internal dependencies */ const isGutenbergPlugin = false ? 0 : false; function useShouldIframe() { const { isBlockBasedTheme, hasV3BlocksOnly, isEditingTemplate, hasMetaBoxes } = (0,external_wp_data_namespaceObject.useSelect)(select => { const { getEditorSettings, getCurrentPostType } = select(external_wp_editor_namespaceObject.store); const { getBlockTypes } = select(external_wp_blocks_namespaceObject.store); const editorSettings = getEditorSettings(); return { isBlockBasedTheme: editorSettings.__unstableIsBlockBasedTheme, hasV3BlocksOnly: getBlockTypes().every(type => { return type.apiVersion >= 3; }), isEditingTemplate: getCurrentPostType() === 'wp_template', hasMetaBoxes: select(store).hasMetaBoxes() }; }, []); return (hasV3BlocksOnly || isGutenbergPlugin && isBlockBasedTheme) && !hasMetaBoxes || isEditingTemplate; } ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/layout/index.js /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ const { getLayoutStyles } = unlock(external_wp_blockEditor_namespaceObject.privateApis); const { useCommands: layout_useCommands } = unlock(external_wp_coreCommands_namespaceObject.privateApis); const { useCommandContext } = unlock(external_wp_commands_namespaceObject.privateApis); const { EditorInterface, FullscreenMode, Sidebar } = unlock(external_wp_editor_namespaceObject.privateApis); const { BlockKeyboardShortcuts } = unlock(external_wp_blockLibrary_namespaceObject.privateApis); const DESIGN_POST_TYPES = ['wp_template', 'wp_template_part', 'wp_block', 'wp_navigation']; function useEditorStyles() { const { hasThemeStyleSupport, editorSettings, isZoomedOutView, renderingMode, postType } = (0,external_wp_data_namespaceObject.useSelect)(select => { const { __unstableGetEditorMode } = select(external_wp_blockEditor_namespaceObject.store); const { getCurrentPostType, getRenderingMode } = select(external_wp_editor_namespaceObject.store); const _postType = getCurrentPostType(); return { hasThemeStyleSupport: select(store).isFeatureActive('themeStyles'), editorSettings: select(external_wp_editor_namespaceObject.store).getEditorSettings(), isZoomedOutView: __unstableGetEditorMode() === 'zoom-out', renderingMode: getRenderingMode(), postType: _postType }; }, []); // Compute the default styles. return (0,external_wp_element_namespaceObject.useMemo)(() => { var _editorSettings$style, _editorSettings$style2, _editorSettings$style3; const presetStyles = (_editorSettings$style = editorSettings.styles?.filter(style => style.__unstableType && style.__unstableType !== 'theme')) !== null && _editorSettings$style !== void 0 ? _editorSettings$style : []; const defaultEditorStyles = [...editorSettings.defaultEditorStyles, ...presetStyles]; // Has theme styles if the theme supports them and if some styles were not preset styles (in which case they're theme styles). const hasThemeStyles = hasThemeStyleSupport && presetStyles.length !== ((_editorSettings$style2 = editorSettings.styles?.length) !== null && _editorSettings$style2 !== void 0 ? _editorSettings$style2 : 0); // If theme styles are not present or displayed, ensure that // base layout styles are still present in the editor. if (!editorSettings.disableLayoutStyles && !hasThemeStyles) { defaultEditorStyles.push({ css: getLayoutStyles({ style: {}, selector: 'body', hasBlockGapSupport: false, hasFallbackGapSupport: true, fallbackGapValue: '0.5em' }) }); } const baseStyles = hasThemeStyles ? (_editorSettings$style3 = editorSettings.styles) !== null && _editorSettings$style3 !== void 0 ? _editorSettings$style3 : [] : defaultEditorStyles; // Add a space for the typewriter effect. When typing in the last block, // there needs to be room to scroll up. if (!isZoomedOutView && renderingMode === 'post-only' && !DESIGN_POST_TYPES.includes(postType)) { return [...baseStyles, { css: ':root :where(.editor-styles-wrapper)::after {content: ""; display: block; height: 40vh;}' }]; } return baseStyles; }, [editorSettings.defaultEditorStyles, editorSettings.disableLayoutStyles, editorSettings.styles, hasThemeStyleSupport, postType]); } function Layout({ initialPost }) { layout_useCommands(); useCommands(); const paddingAppenderRef = usePaddingAppender(); const shouldIframe = useShouldIframe(); const { createErrorNotice } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store); const { mode, isFullscreenActive, hasActiveMetaboxes, hasBlockSelected, showIconLabels, isDistractionFree, showMetaBoxes, hasHistory, isEditingTemplate, isWelcomeGuideVisible } = (0,external_wp_data_namespaceObject.useSelect)(select => { const { get } = select(external_wp_preferences_namespaceObject.store); const { getEditorSettings } = select(external_wp_editor_namespaceObject.store); const { isFeatureActive } = select(store); return { mode: select(external_wp_editor_namespaceObject.store).getEditorMode(), isFullscreenActive: select(store).isFeatureActive('fullscreenMode'), hasActiveMetaboxes: select(store).hasMetaBoxes(), hasBlockSelected: !!select(external_wp_blockEditor_namespaceObject.store).getBlockSelectionStart(), showIconLabels: get('core', 'showIconLabels'), isDistractionFree: get('core', 'distractionFree'), showMetaBoxes: select(external_wp_editor_namespaceObject.store).getRenderingMode() === 'post-only', hasHistory: !!getEditorSettings().onNavigateToPreviousEntityRecord, isEditingTemplate: select(external_wp_editor_namespaceObject.store).getCurrentPostType() === 'wp_template', isWelcomeGuideVisible: isFeatureActive('welcomeGuide') }; }, []); // Set the right context for the command palette const commandContext = hasBlockSelected ? 'block-selection-edit' : 'entity-edit'; useCommandContext(commandContext); const styles = useEditorStyles(); // We need to add the show-icon-labels class to the body element so it is applied to modals. if (showIconLabels) { document.body.classList.add('show-icon-labels'); } else { document.body.classList.remove('show-icon-labels'); } const className = dist_clsx('edit-post-layout', 'is-mode-' + mode, { 'has-metaboxes': hasActiveMetaboxes }); function onPluginAreaError(name) { createErrorNotice((0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %s: plugin name */ (0,external_wp_i18n_namespaceObject.__)('The "%s" plugin has encountered an error and cannot be rendered.'), name)); } const { createSuccessNotice } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store); const onActionPerformed = (0,external_wp_element_namespaceObject.useCallback)((actionId, items) => { switch (actionId) { case 'move-to-trash': { document.location.href = (0,external_wp_url_namespaceObject.addQueryArgs)('edit.php', { trashed: 1, post_type: items[0].type, ids: items[0].id }); } break; case 'duplicate-post': { const newItem = items[0]; const title = typeof newItem.title === 'string' ? newItem.title : newItem.title?.rendered; createSuccessNotice((0,external_wp_i18n_namespaceObject.sprintf)( // translators: %s: Title of the created post e.g: "Post 1". (0,external_wp_i18n_namespaceObject.__)('"%s" successfully created.'), (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(title)), { type: 'snackbar', id: 'duplicate-post-action', actions: [{ label: (0,external_wp_i18n_namespaceObject.__)('Edit'), onClick: () => { const postId = newItem.id; document.location.href = (0,external_wp_url_namespaceObject.addQueryArgs)('post.php', { post: postId, action: 'edit' }); } }] }); } break; } }, [createSuccessNotice]); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(FullscreenMode, { isActive: isFullscreenActive }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(browser_url, { hasHistory: hasHistory }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_editor_namespaceObject.UnsavedChangesWarning, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_editor_namespaceObject.AutosaveMonitor, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_editor_namespaceObject.LocalAutosaveMonitor, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(keyboard_shortcuts, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_editor_namespaceObject.EditorKeyboardShortcutsRegister, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(BlockKeyboardShortcuts, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(WelcomeGuide, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(InitPatternModal, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_plugins_namespaceObject.PluginArea, { onError: onPluginAreaError }), !isDistractionFree && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Sidebar, { onActionPerformed: onActionPerformed, extraPanels: !isEditingTemplate && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(MetaBoxes, { location: "side" }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(more_menu, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(back_button, { initialPost: initialPost }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_editor_namespaceObject.EditorSnackbars, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(EditorInterface, { className: className, styles: styles, forceIsDirty: hasActiveMetaboxes, contentRef: paddingAppenderRef, disableIframe: !shouldIframe // We should auto-focus the canvas (title) on load. // eslint-disable-next-line jsx-a11y/no-autofocus , autoFocus: !isWelcomeGuideVisible, children: !isDistractionFree && showMetaBoxes && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: "edit-post-layout__metaboxes", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(MetaBoxes, { location: "normal" }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(MetaBoxes, { location: "advanced" })] }) })] }); } /* harmony default export */ const layout = (Layout); ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/editor-initialization/listener-hooks.js /** * WordPress dependencies */ /** * Internal dependencies */ /** * This listener hook monitors any change in permalink and updates the view * post link in the admin bar. */ const useUpdatePostLinkListener = () => { const { newPermalink } = (0,external_wp_data_namespaceObject.useSelect)(select => ({ newPermalink: select(external_wp_editor_namespaceObject.store).getCurrentPost().link }), []); const nodeToUpdate = (0,external_wp_element_namespaceObject.useRef)(); (0,external_wp_element_namespaceObject.useEffect)(() => { nodeToUpdate.current = document.querySelector(VIEW_AS_PREVIEW_LINK_SELECTOR) || document.querySelector(VIEW_AS_LINK_SELECTOR); }, []); (0,external_wp_element_namespaceObject.useEffect)(() => { if (!newPermalink || !nodeToUpdate.current) { return; } nodeToUpdate.current.setAttribute('href', newPermalink); }, [newPermalink]); }; ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/editor-initialization/index.js /** * Internal dependencies */ /** * Data component used for initializing the editor and re-initializes * when postId changes or on unmount. * * @return {null} This is a data component so does not render any ui. */ function EditorInitialization() { useUpdatePostLinkListener(); return null; } ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/hooks/use-navigate-to-entity-record.js /** * WordPress dependencies */ /** * A hook that records the 'entity' history in the post editor as a user * navigates between editing a post and editing the post template or patterns. * * Implemented as a stack, so a little similar to the browser history API. * * Used to control displaying UI elements like the back button. * * @param {number} initialPostId The post id of the post when the editor loaded. * @param {string} initialPostType The post type of the post when the editor loaded. * @param {string} defaultRenderingMode The rendering mode to switch to when navigating. * * @return {Object} An object containing the `currentPost` variable and * `onNavigateToEntityRecord` and `onNavigateToPreviousEntityRecord` functions. */ function useNavigateToEntityRecord(initialPostId, initialPostType, defaultRenderingMode) { const [postHistory, dispatch] = (0,external_wp_element_namespaceObject.useReducer)((historyState, { type, post, previousRenderingMode }) => { if (type === 'push') { return [...historyState, { post, previousRenderingMode }]; } if (type === 'pop') { // Try to leave one item in the history. if (historyState.length > 1) { return historyState.slice(0, -1); } } return historyState; }, [{ post: { postId: initialPostId, postType: initialPostType } }]); const { post, previousRenderingMode } = postHistory[postHistory.length - 1]; const { getRenderingMode } = (0,external_wp_data_namespaceObject.useSelect)(external_wp_editor_namespaceObject.store); const { setRenderingMode } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_editor_namespaceObject.store); const onNavigateToEntityRecord = (0,external_wp_element_namespaceObject.useCallback)(params => { dispatch({ type: 'push', post: { postId: params.postId, postType: params.postType }, // Save the current rendering mode so we can restore it when navigating back. previousRenderingMode: getRenderingMode() }); setRenderingMode(defaultRenderingMode); }, [getRenderingMode, setRenderingMode, defaultRenderingMode]); const onNavigateToPreviousEntityRecord = (0,external_wp_element_namespaceObject.useCallback)(() => { dispatch({ type: 'pop' }); if (previousRenderingMode) { setRenderingMode(previousRenderingMode); } }, [setRenderingMode, previousRenderingMode]); return { currentPost: post, onNavigateToEntityRecord, onNavigateToPreviousEntityRecord: postHistory.length > 1 ? onNavigateToPreviousEntityRecord : undefined }; } ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/editor.js /** * WordPress dependencies */ /** * Internal dependencies */ const { ExperimentalEditorProvider } = unlock(external_wp_editor_namespaceObject.privateApis); function Editor({ postId: initialPostId, postType: initialPostType, settings, initialEdits, ...props }) { const { currentPost, onNavigateToEntityRecord, onNavigateToPreviousEntityRecord } = useNavigateToEntityRecord(initialPostId, initialPostType, 'post-only'); const { post, template } = (0,external_wp_data_namespaceObject.useSelect)(select => { var _getPostType$viewable; const { getEditedPostTemplate } = select(store); const { getEntityRecord, getPostType, canUser } = select(external_wp_coreData_namespaceObject.store); const { getEditorSettings } = select(external_wp_editor_namespaceObject.store); const postObject = getEntityRecord('postType', currentPost.postType, currentPost.postId); const supportsTemplateMode = getEditorSettings().supportsTemplateMode; const isViewable = (_getPostType$viewable = getPostType(currentPost.postType)?.viewable) !== null && _getPostType$viewable !== void 0 ? _getPostType$viewable : false; const canViewTemplate = canUser('read', 'templates'); return { template: supportsTemplateMode && isViewable && canViewTemplate && currentPost.postType !== 'wp_template' ? getEditedPostTemplate() : null, post: postObject }; }, [currentPost.postType, currentPost.postId]); const editorSettings = (0,external_wp_element_namespaceObject.useMemo)(() => ({ ...settings, onNavigateToEntityRecord, onNavigateToPreviousEntityRecord, defaultRenderingMode: 'post-only' }), [settings, onNavigateToEntityRecord, onNavigateToPreviousEntityRecord]); const initialPost = (0,external_wp_element_namespaceObject.useMemo)(() => { return { type: initialPostType, id: initialPostId }; }, [initialPostType, initialPostId]); if (!post) { return null; } return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SlotFillProvider, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(ExperimentalEditorProvider, { settings: editorSettings, post: post, initialEdits: initialEdits, useSubRegistry: false, __unstableTemplate: template, ...props, children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_editor_namespaceObject.ErrorBoundary, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_commands_namespaceObject.CommandMenu, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(EditorInitialization, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(layout, { initialPost: initialPost })] }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_editor_namespaceObject.PostLockedModal, {})] }) }); } /* harmony default export */ const editor = (Editor); ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/deprecated.js /** * WordPress dependencies */ /** * Internal dependencies */ const { PluginPostExcerpt } = unlock(external_wp_editor_namespaceObject.privateApis); const isSiteEditor = (0,external_wp_url_namespaceObject.getPath)(window.location.href)?.includes('site-editor.php'); const deprecateSlot = name => { external_wp_deprecated_default()(`wp.editPost.${name}`, { since: '6.6', alternative: `wp.editor.${name}` }); }; /* eslint-disable jsdoc/require-param */ /** * @see PluginBlockSettingsMenuItem in @wordpress/editor package. */ function PluginBlockSettingsMenuItem(props) { if (isSiteEditor) { return null; } deprecateSlot('PluginBlockSettingsMenuItem'); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_editor_namespaceObject.PluginBlockSettingsMenuItem, { ...props }); } /** * @see PluginDocumentSettingPanel in @wordpress/editor package. */ function PluginDocumentSettingPanel(props) { if (isSiteEditor) { return null; } deprecateSlot('PluginDocumentSettingPanel'); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_editor_namespaceObject.PluginDocumentSettingPanel, { ...props }); } /** * @see PluginMoreMenuItem in @wordpress/editor package. */ function PluginMoreMenuItem(props) { if (isSiteEditor) { return null; } deprecateSlot('PluginMoreMenuItem'); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_editor_namespaceObject.PluginMoreMenuItem, { ...props }); } /** * @see PluginPrePublishPanel in @wordpress/editor package. */ function PluginPrePublishPanel(props) { if (isSiteEditor) { return null; } deprecateSlot('PluginPrePublishPanel'); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_editor_namespaceObject.PluginPrePublishPanel, { ...props }); } /** * @see PluginPostPublishPanel in @wordpress/editor package. */ function PluginPostPublishPanel(props) { if (isSiteEditor) { return null; } deprecateSlot('PluginPostPublishPanel'); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_editor_namespaceObject.PluginPostPublishPanel, { ...props }); } /** * @see PluginPostStatusInfo in @wordpress/editor package. */ function PluginPostStatusInfo(props) { if (isSiteEditor) { return null; } deprecateSlot('PluginPostStatusInfo'); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_editor_namespaceObject.PluginPostStatusInfo, { ...props }); } /** * @see PluginSidebar in @wordpress/editor package. */ function PluginSidebar(props) { if (isSiteEditor) { return null; } deprecateSlot('PluginSidebar'); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_editor_namespaceObject.PluginSidebar, { ...props }); } /** * @see PluginSidebarMoreMenuItem in @wordpress/editor package. */ function PluginSidebarMoreMenuItem(props) { if (isSiteEditor) { return null; } deprecateSlot('PluginSidebarMoreMenuItem'); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_editor_namespaceObject.PluginSidebarMoreMenuItem, { ...props }); } /** * @see PluginPostExcerpt in @wordpress/editor package. */ function __experimentalPluginPostExcerpt() { if (isSiteEditor) { return null; } external_wp_deprecated_default()('wp.editPost.__experimentalPluginPostExcerpt', { since: '6.6', hint: 'Core and custom panels can be access programmatically using their panel name.', link: 'https://developer.wordpress.org/block-editor/reference-guides/slotfills/plugin-document-setting-panel/#accessing-a-panel-programmatically' }); return PluginPostExcerpt; } /* eslint-enable jsdoc/require-param */ ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/index.js /** * WordPress dependencies */ /** * Internal dependencies */ const { BackButton: __experimentalMainDashboardButton } = unlock(external_wp_editor_namespaceObject.privateApis); /** * Initializes and returns an instance of Editor. * * @param {string} id Unique identifier for editor instance. * @param {string} postType Post type of the post to edit. * @param {Object} postId ID of the post to edit. * @param {?Object} settings Editor settings object. * @param {Object} initialEdits Programmatic edits to apply initially, to be * considered as non-user-initiated (bypass for * unsaved changes prompt). */ function initializeEditor(id, postType, postId, settings, initialEdits) { const isMediumOrBigger = window.matchMedia('(min-width: 782px)').matches; const target = document.getElementById(id); const root = (0,external_wp_element_namespaceObject.createRoot)(target); (0,external_wp_data_namespaceObject.dispatch)(external_wp_preferences_namespaceObject.store).setDefaults('core/edit-post', { fullscreenMode: true, themeStyles: true, welcomeGuide: true, welcomeGuideTemplate: true }); (0,external_wp_data_namespaceObject.dispatch)(external_wp_preferences_namespaceObject.store).setDefaults('core', { allowRightClickOverrides: true, editorMode: 'visual', fixedToolbar: false, hiddenBlockTypes: [], inactivePanels: [], openPanels: ['post-status'], showBlockBreadcrumbs: true, showIconLabels: false, showListViewByDefault: false, isPublishSidebarEnabled: true }); (0,external_wp_data_namespaceObject.dispatch)(external_wp_blocks_namespaceObject.store).reapplyBlockTypeFilters(); // Check if the block list view should be open by default. // If `distractionFree` mode is enabled, the block list view should not be open. // This behavior is disabled for small viewports. if (isMediumOrBigger && (0,external_wp_data_namespaceObject.select)(external_wp_preferences_namespaceObject.store).get('core', 'showListViewByDefault') && !(0,external_wp_data_namespaceObject.select)(external_wp_preferences_namespaceObject.store).get('core', 'distractionFree')) { (0,external_wp_data_namespaceObject.dispatch)(external_wp_editor_namespaceObject.store).setIsListViewOpened(true); } (0,external_wp_blockLibrary_namespaceObject.registerCoreBlocks)(); (0,external_wp_widgets_namespaceObject.registerLegacyWidgetBlock)({ inserter: false }); (0,external_wp_widgets_namespaceObject.registerWidgetGroupBlock)({ inserter: false }); if (false) {} // Show a console log warning if the browser is not in Standards rendering mode. const documentMode = document.compatMode === 'CSS1Compat' ? 'Standards' : 'Quirks'; if (documentMode !== 'Standards') { // eslint-disable-next-line no-console console.warn("Your browser is using Quirks Mode. \nThis can cause rendering issues such as blocks overlaying meta boxes in the editor. Quirks Mode can be triggered by PHP errors or HTML code appearing before the opening . Try checking the raw page source or your site's PHP error log and resolving errors there, removing any HTML before the doctype, or disabling plugins."); } // This is a temporary fix for a couple of issues specific to Webkit on iOS. // Without this hack the browser scrolls the mobile toolbar off-screen. // Once supported in Safari we can replace this in favor of preventScroll. // For details see issue #18632 and PR #18686 // Specifically, we scroll `interface-interface-skeleton__body` to enable a fixed top toolbar. // But Mobile Safari forces the `html` element to scroll upwards, hiding the toolbar. const isIphone = window.navigator.userAgent.indexOf('iPhone') !== -1; if (isIphone) { window.addEventListener('scroll', event => { const editorScrollContainer = document.getElementsByClassName('interface-interface-skeleton__body')[0]; if (event.target === document) { // Scroll element into view by scrolling the editor container by the same amount // that Mobile Safari tried to scroll the html element upwards. if (window.scrollY > 100) { editorScrollContainer.scrollTop = editorScrollContainer.scrollTop + window.scrollY; } // Undo unwanted scroll on html element, but only in the visual editor. if (document.getElementsByClassName('is-mode-visual')[0]) { window.scrollTo(0, 0); } } }); } // Prevent the default browser action for files dropped outside of dropzones. window.addEventListener('dragover', e => e.preventDefault(), false); window.addEventListener('drop', e => e.preventDefault(), false); root.render( /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(editor, { settings: settings, postId: postId, postType: postType, initialEdits: initialEdits })); return root; } /** * Used to reinitialize the editor after an error. Now it's a deprecated noop function. */ function reinitializeEditor() { external_wp_deprecated_default()('wp.editPost.reinitializeEditor', { since: '6.2', version: '6.3' }); } (window.wp = window.wp || {}).editPost = __webpack_exports__; /******/ })() ;data-controls.js000064400000016222147177406350007675 0ustar00/******/ (() => { // webpackBootstrap /******/ "use strict"; /******/ // The require scope /******/ var __webpack_require__ = {}; /******/ /************************************************************************/ /******/ /* webpack/runtime/compat get default export */ /******/ (() => { /******/ // getDefaultExport function for compatibility with non-harmony modules /******/ __webpack_require__.n = (module) => { /******/ var getter = module && module.__esModule ? /******/ () => (module['default']) : /******/ () => (module); /******/ __webpack_require__.d(getter, { a: getter }); /******/ return getter; /******/ }; /******/ })(); /******/ /******/ /* webpack/runtime/define property getters */ /******/ (() => { /******/ // define getter functions for harmony exports /******/ __webpack_require__.d = (exports, definition) => { /******/ for(var key in definition) { /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); /******/ } /******/ } /******/ }; /******/ })(); /******/ /******/ /* webpack/runtime/hasOwnProperty shorthand */ /******/ (() => { /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) /******/ })(); /******/ /******/ /* webpack/runtime/make namespace object */ /******/ (() => { /******/ // define __esModule on exports /******/ __webpack_require__.r = (exports) => { /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); /******/ } /******/ Object.defineProperty(exports, '__esModule', { value: true }); /******/ }; /******/ })(); /******/ /************************************************************************/ var __webpack_exports__ = {}; // ESM COMPAT FLAG __webpack_require__.r(__webpack_exports__); // EXPORTS __webpack_require__.d(__webpack_exports__, { __unstableAwaitPromise: () => (/* binding */ __unstableAwaitPromise), apiFetch: () => (/* binding */ apiFetch), controls: () => (/* binding */ controls), dispatch: () => (/* binding */ dispatch), select: () => (/* binding */ build_module_select), syncSelect: () => (/* binding */ syncSelect) }); ;// CONCATENATED MODULE: external ["wp","apiFetch"] const external_wp_apiFetch_namespaceObject = window["wp"]["apiFetch"]; var external_wp_apiFetch_default = /*#__PURE__*/__webpack_require__.n(external_wp_apiFetch_namespaceObject); ;// CONCATENATED MODULE: external ["wp","data"] const external_wp_data_namespaceObject = window["wp"]["data"]; ;// CONCATENATED MODULE: external ["wp","deprecated"] const external_wp_deprecated_namespaceObject = window["wp"]["deprecated"]; var external_wp_deprecated_default = /*#__PURE__*/__webpack_require__.n(external_wp_deprecated_namespaceObject); ;// CONCATENATED MODULE: ./node_modules/@wordpress/data-controls/build-module/index.js /** * WordPress dependencies */ /** * Dispatches a control action for triggering an api fetch call. * * @param {Object} request Arguments for the fetch request. * * @example * ```js * import { apiFetch } from '@wordpress/data-controls'; * * // Action generator using apiFetch * export function* myAction() { * const path = '/v2/my-api/items'; * const items = yield apiFetch( { path } ); * // do something with the items. * } * ``` * * @return {Object} The control descriptor. */ function apiFetch(request) { return { type: 'API_FETCH', request }; } /** * Control for resolving a selector in a registered data store. * Alias for the `resolveSelect` built-in control in the `@wordpress/data` package. * * @param storeNameOrDescriptor The store object or identifier. * @param selectorName The selector name. * @param args Arguments passed without change to the `@wordpress/data` control. */ function build_module_select(storeNameOrDescriptor, selectorName, ...args) { external_wp_deprecated_default()('`select` control in `@wordpress/data-controls`', { since: '5.7', alternative: 'built-in `resolveSelect` control in `@wordpress/data`' }); return external_wp_data_namespaceObject.controls.resolveSelect(storeNameOrDescriptor, selectorName, ...args); } /** * Control for calling a selector in a registered data store. * Alias for the `select` built-in control in the `@wordpress/data` package. * * @param storeNameOrDescriptor The store object or identifier. * @param selectorName The selector name. * @param args Arguments passed without change to the `@wordpress/data` control. */ function syncSelect(storeNameOrDescriptor, selectorName, ...args) { external_wp_deprecated_default()('`syncSelect` control in `@wordpress/data-controls`', { since: '5.7', alternative: 'built-in `select` control in `@wordpress/data`' }); return external_wp_data_namespaceObject.controls.select(storeNameOrDescriptor, selectorName, ...args); } /** * Control for dispatching an action in a registered data store. * Alias for the `dispatch` control in the `@wordpress/data` package. * * @param storeNameOrDescriptor The store object or identifier. * @param actionName The action name. * @param args Arguments passed without change to the `@wordpress/data` control. */ function dispatch(storeNameOrDescriptor, actionName, ...args) { external_wp_deprecated_default()('`dispatch` control in `@wordpress/data-controls`', { since: '5.7', alternative: 'built-in `dispatch` control in `@wordpress/data`' }); return external_wp_data_namespaceObject.controls.dispatch(storeNameOrDescriptor, actionName, ...args); } /** * Dispatches a control action for awaiting on a promise to be resolved. * * @param {Object} promise Promise to wait for. * * @example * ```js * import { __unstableAwaitPromise } from '@wordpress/data-controls'; * * // Action generator using apiFetch * export function* myAction() { * const promise = getItemsAsync(); * const items = yield __unstableAwaitPromise( promise ); * // do something with the items. * } * ``` * * @return {Object} The control descriptor. */ const __unstableAwaitPromise = function (promise) { return { type: 'AWAIT_PROMISE', promise }; }; /** * The default export is what you use to register the controls with your custom * store. * * @example * ```js * // WordPress dependencies * import { controls } from '@wordpress/data-controls'; * import { registerStore } from '@wordpress/data'; * * // Internal dependencies * import reducer from './reducer'; * import * as selectors from './selectors'; * import * as actions from './actions'; * import * as resolvers from './resolvers'; * * registerStore( 'my-custom-store', { * reducer, * controls, * actions, * selectors, * resolvers, * } ); * ``` * @return {Object} An object for registering the default controls with the * store. */ const controls = { AWAIT_PROMISE: ({ promise }) => promise, API_FETCH({ request }) { return external_wp_apiFetch_default()(request); } }; (window.wp = window.wp || {}).dataControls = __webpack_exports__; /******/ })() ;undo-manager.js000064400000020336147177406350007501 0ustar00/******/ (() => { // webpackBootstrap /******/ "use strict"; /******/ var __webpack_modules__ = ({ /***/ 923: /***/ ((module) => { module.exports = window["wp"]["isShallowEqual"]; /***/ }) /******/ }); /************************************************************************/ /******/ // The module cache /******/ var __webpack_module_cache__ = {}; /******/ /******/ // The require function /******/ function __webpack_require__(moduleId) { /******/ // Check if module is in cache /******/ var cachedModule = __webpack_module_cache__[moduleId]; /******/ if (cachedModule !== undefined) { /******/ return cachedModule.exports; /******/ } /******/ // Create a new module (and put it into the cache) /******/ var module = __webpack_module_cache__[moduleId] = { /******/ // no module.id needed /******/ // no module.loaded needed /******/ exports: {} /******/ }; /******/ /******/ // Execute the module function /******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__); /******/ /******/ // Return the exports of the module /******/ return module.exports; /******/ } /******/ /************************************************************************/ /******/ /* webpack/runtime/compat get default export */ /******/ (() => { /******/ // getDefaultExport function for compatibility with non-harmony modules /******/ __webpack_require__.n = (module) => { /******/ var getter = module && module.__esModule ? /******/ () => (module['default']) : /******/ () => (module); /******/ __webpack_require__.d(getter, { a: getter }); /******/ return getter; /******/ }; /******/ })(); /******/ /******/ /* webpack/runtime/define property getters */ /******/ (() => { /******/ // define getter functions for harmony exports /******/ __webpack_require__.d = (exports, definition) => { /******/ for(var key in definition) { /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); /******/ } /******/ } /******/ }; /******/ })(); /******/ /******/ /* webpack/runtime/hasOwnProperty shorthand */ /******/ (() => { /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) /******/ })(); /******/ /******/ /* webpack/runtime/make namespace object */ /******/ (() => { /******/ // define __esModule on exports /******/ __webpack_require__.r = (exports) => { /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); /******/ } /******/ Object.defineProperty(exports, '__esModule', { value: true }); /******/ }; /******/ })(); /******/ /************************************************************************/ var __webpack_exports__ = {}; // This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk. (() => { __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ createUndoManager: () => (/* binding */ createUndoManager) /* harmony export */ }); /* harmony import */ var _wordpress_is_shallow_equal__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(923); /* harmony import */ var _wordpress_is_shallow_equal__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_is_shallow_equal__WEBPACK_IMPORTED_MODULE_0__); /** * WordPress dependencies */ /** @typedef {import('./types').HistoryRecord} HistoryRecord */ /** @typedef {import('./types').HistoryChange} HistoryChange */ /** @typedef {import('./types').HistoryChanges} HistoryChanges */ /** @typedef {import('./types').UndoManager} UndoManager */ /** * Merge changes for a single item into a record of changes. * * @param {Record< string, HistoryChange >} changes1 Previous changes * @param {Record< string, HistoryChange >} changes2 NextChanges * * @return {Record< string, HistoryChange >} Merged changes */ function mergeHistoryChanges(changes1, changes2) { /** * @type {Record< string, HistoryChange >} */ const newChanges = { ...changes1 }; Object.entries(changes2).forEach(([key, value]) => { if (newChanges[key]) { newChanges[key] = { ...newChanges[key], to: value.to }; } else { newChanges[key] = value; } }); return newChanges; } /** * Adds history changes for a single item into a record of changes. * * @param {HistoryRecord} record The record to merge into. * @param {HistoryChanges} changes The changes to merge. */ const addHistoryChangesIntoRecord = (record, changes) => { const existingChangesIndex = record?.findIndex(({ id: recordIdentifier }) => { return typeof recordIdentifier === 'string' ? recordIdentifier === changes.id : _wordpress_is_shallow_equal__WEBPACK_IMPORTED_MODULE_0___default()(recordIdentifier, changes.id); }); const nextRecord = [...record]; if (existingChangesIndex !== -1) { // If the edit is already in the stack leave the initial "from" value. nextRecord[existingChangesIndex] = { id: changes.id, changes: mergeHistoryChanges(nextRecord[existingChangesIndex].changes, changes.changes) }; } else { nextRecord.push(changes); } return nextRecord; }; /** * Creates an undo manager. * * @return {UndoManager} Undo manager. */ function createUndoManager() { /** * @type {HistoryRecord[]} */ let history = []; /** * @type {HistoryRecord} */ let stagedRecord = []; /** * @type {number} */ let offset = 0; const dropPendingRedos = () => { history = history.slice(0, offset || undefined); offset = 0; }; const appendStagedRecordToLatestHistoryRecord = () => { var _history$index; const index = history.length === 0 ? 0 : history.length - 1; let latestRecord = (_history$index = history[index]) !== null && _history$index !== void 0 ? _history$index : []; stagedRecord.forEach(changes => { latestRecord = addHistoryChangesIntoRecord(latestRecord, changes); }); stagedRecord = []; history[index] = latestRecord; }; /** * Checks whether a record is empty. * A record is considered empty if it the changes keep the same values. * Also updates to function values are ignored. * * @param {HistoryRecord} record * @return {boolean} Whether the record is empty. */ const isRecordEmpty = record => { const filteredRecord = record.filter(({ changes }) => { return Object.values(changes).some(({ from, to }) => typeof from !== 'function' && typeof to !== 'function' && !_wordpress_is_shallow_equal__WEBPACK_IMPORTED_MODULE_0___default()(from, to)); }); return !filteredRecord.length; }; return { /** * Record changes into the history. * * @param {HistoryRecord=} record A record of changes to record. * @param {boolean} isStaged Whether to immediately create an undo point or not. */ addRecord(record, isStaged = false) { const isEmpty = !record || isRecordEmpty(record); if (isStaged) { if (isEmpty) { return; } record.forEach(changes => { stagedRecord = addHistoryChangesIntoRecord(stagedRecord, changes); }); } else { dropPendingRedos(); if (stagedRecord.length) { appendStagedRecordToLatestHistoryRecord(); } if (isEmpty) { return; } history.push(record); } }, undo() { if (stagedRecord.length) { dropPendingRedos(); appendStagedRecordToLatestHistoryRecord(); } const undoRecord = history[history.length - 1 + offset]; if (!undoRecord) { return; } offset -= 1; return undoRecord; }, redo() { const redoRecord = history[history.length + offset]; if (!redoRecord) { return; } offset += 1; return redoRecord; }, hasUndo() { return !!history[history.length - 1 + offset]; }, hasRedo() { return !!history[history.length + offset]; } }; } })(); (window.wp = window.wp || {}).undoManager = __webpack_exports__; /******/ })() ;primitives.js000064400000015350147177406350007317 0ustar00/******/ (() => { // webpackBootstrap /******/ "use strict"; /******/ // The require scope /******/ var __webpack_require__ = {}; /******/ /************************************************************************/ /******/ /* webpack/runtime/define property getters */ /******/ (() => { /******/ // define getter functions for harmony exports /******/ __webpack_require__.d = (exports, definition) => { /******/ for(var key in definition) { /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); /******/ } /******/ } /******/ }; /******/ })(); /******/ /******/ /* webpack/runtime/hasOwnProperty shorthand */ /******/ (() => { /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) /******/ })(); /******/ /******/ /* webpack/runtime/make namespace object */ /******/ (() => { /******/ // define __esModule on exports /******/ __webpack_require__.r = (exports) => { /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); /******/ } /******/ Object.defineProperty(exports, '__esModule', { value: true }); /******/ }; /******/ })(); /******/ /************************************************************************/ var __webpack_exports__ = {}; // ESM COMPAT FLAG __webpack_require__.r(__webpack_exports__); // EXPORTS __webpack_require__.d(__webpack_exports__, { BlockQuotation: () => (/* reexport */ BlockQuotation), Circle: () => (/* reexport */ Circle), Defs: () => (/* reexport */ Defs), G: () => (/* reexport */ G), HorizontalRule: () => (/* reexport */ HorizontalRule), Line: () => (/* reexport */ Line), LinearGradient: () => (/* reexport */ LinearGradient), Path: () => (/* reexport */ Path), Polygon: () => (/* reexport */ Polygon), RadialGradient: () => (/* reexport */ RadialGradient), Rect: () => (/* reexport */ Rect), SVG: () => (/* reexport */ SVG), Stop: () => (/* reexport */ Stop), View: () => (/* reexport */ View) }); ;// CONCATENATED MODULE: ./node_modules/clsx/dist/clsx.mjs function r(e){var t,f,n="";if("string"==typeof e||"number"==typeof e)n+=e;else if("object"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t} SVGProps */ /** * @param {import('react').ComponentPropsWithoutRef<'circle'>} props * * @return {JSX.Element} Circle component */ const Circle = props => (0,external_wp_element_namespaceObject.createElement)('circle', props); /** * @param {import('react').ComponentPropsWithoutRef<'g'>} props * * @return {JSX.Element} G component */ const G = props => (0,external_wp_element_namespaceObject.createElement)('g', props); /** * @param {import('react').ComponentPropsWithoutRef<'line'>} props * * @return {JSX.Element} Path component */ const Line = props => (0,external_wp_element_namespaceObject.createElement)('line', props); /** * @param {import('react').ComponentPropsWithoutRef<'path'>} props * * @return {JSX.Element} Path component */ const Path = props => (0,external_wp_element_namespaceObject.createElement)('path', props); /** * @param {import('react').ComponentPropsWithoutRef<'polygon'>} props * * @return {JSX.Element} Polygon component */ const Polygon = props => (0,external_wp_element_namespaceObject.createElement)('polygon', props); /** * @param {import('react').ComponentPropsWithoutRef<'rect'>} props * * @return {JSX.Element} Rect component */ const Rect = props => (0,external_wp_element_namespaceObject.createElement)('rect', props); /** * @param {import('react').ComponentPropsWithoutRef<'defs'>} props * * @return {JSX.Element} Defs component */ const Defs = props => (0,external_wp_element_namespaceObject.createElement)('defs', props); /** * @param {import('react').ComponentPropsWithoutRef<'radialGradient'>} props * * @return {JSX.Element} RadialGradient component */ const RadialGradient = props => (0,external_wp_element_namespaceObject.createElement)('radialGradient', props); /** * @param {import('react').ComponentPropsWithoutRef<'linearGradient'>} props * * @return {JSX.Element} LinearGradient component */ const LinearGradient = props => (0,external_wp_element_namespaceObject.createElement)('linearGradient', props); /** * @param {import('react').ComponentPropsWithoutRef<'stop'>} props * * @return {JSX.Element} Stop component */ const Stop = props => (0,external_wp_element_namespaceObject.createElement)('stop', props); const SVG = (0,external_wp_element_namespaceObject.forwardRef)( /** * @param {SVGProps} props isPressed indicates whether the SVG should appear as pressed. * Other props will be passed through to svg component. * @param {import('react').ForwardedRef} ref The forwarded ref to the SVG element. * * @return {JSX.Element} Stop component */ ({ className, isPressed, ...props }, ref) => { const appliedProps = { ...props, className: dist_clsx(className, { 'is-pressed': isPressed }) || undefined, 'aria-hidden': true, focusable: false }; // Disable reason: We need to have a way to render HTML tag for web. // eslint-disable-next-line react/forbid-elements return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("svg", { ...appliedProps, ref: ref }); }); SVG.displayName = 'SVG'; ;// CONCATENATED MODULE: ./node_modules/@wordpress/primitives/build-module/horizontal-rule/index.js const HorizontalRule = 'hr'; ;// CONCATENATED MODULE: ./node_modules/@wordpress/primitives/build-module/block-quotation/index.js const BlockQuotation = 'blockquote'; ;// CONCATENATED MODULE: ./node_modules/@wordpress/primitives/build-module/view/index.js const View = 'div'; ;// CONCATENATED MODULE: ./node_modules/@wordpress/primitives/build-module/index.js (window.wp = window.wp || {}).primitives = __webpack_exports__; /******/ })() ;html-entities.js000064400000007172147177406350007715 0ustar00/******/ (() => { // webpackBootstrap /******/ "use strict"; /******/ // The require scope /******/ var __webpack_require__ = {}; /******/ /************************************************************************/ /******/ /* webpack/runtime/define property getters */ /******/ (() => { /******/ // define getter functions for harmony exports /******/ __webpack_require__.d = (exports, definition) => { /******/ for(var key in definition) { /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); /******/ } /******/ } /******/ }; /******/ })(); /******/ /******/ /* webpack/runtime/hasOwnProperty shorthand */ /******/ (() => { /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) /******/ })(); /******/ /******/ /* webpack/runtime/make namespace object */ /******/ (() => { /******/ // define __esModule on exports /******/ __webpack_require__.r = (exports) => { /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); /******/ } /******/ Object.defineProperty(exports, '__esModule', { value: true }); /******/ }; /******/ })(); /******/ /************************************************************************/ var __webpack_exports__ = {}; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ decodeEntities: () => (/* binding */ decodeEntities) /* harmony export */ }); /** @type {HTMLTextAreaElement} */ let _decodeTextArea; /** * Decodes the HTML entities from a given string. * * @param {string} html String that contain HTML entities. * * @example * ```js * import { decodeEntities } from '@wordpress/html-entities'; * * const result = decodeEntities( 'á' ); * console.log( result ); // result will be "á" * ``` * * @return {string} The decoded string. */ function decodeEntities(html) { // Not a string, or no entities to decode. if ('string' !== typeof html || -1 === html.indexOf('&')) { return html; } // Create a textarea for decoding entities, that we can reuse. if (undefined === _decodeTextArea) { if (document.implementation && document.implementation.createHTMLDocument) { _decodeTextArea = document.implementation.createHTMLDocument('').createElement('textarea'); } else { _decodeTextArea = document.createElement('textarea'); } } _decodeTextArea.innerHTML = html; const decoded = _decodeTextArea.textContent; _decodeTextArea.innerHTML = ''; /** * Cast to string, HTMLTextAreaElement should always have `string` textContent. * * > The `textContent` property of the `Node` interface represents the text content of the * > node and its descendants. * > * > Value: A string or `null` * > * > * If the node is a `document` or a Doctype, `textContent` returns `null`. * > * If the node is a CDATA section, comment, processing instruction, or text node, * > textContent returns the text inside the node, i.e., the `Node.nodeValue`. * > * For other node types, `textContent returns the concatenation of the textContent of * > every child node, excluding comments and processing instructions. (This is an empty * > string if the node has no children.) * * @see https://developer.mozilla.org/en-US/docs/Web/API/Node/textContent */ return /** @type {string} */decoded; } (window.wp = window.wp || {}).htmlEntities = __webpack_exports__; /******/ })() ;dom.min.js000064400000030307147177406350006464 0ustar00/*! This file is auto-generated */ (()=>{"use strict";var t={n:e=>{var n=e&&e.__esModule?()=>e.default:()=>e;return t.d(n,{a:n}),n},d:(e,n)=>{for(var r in n)t.o(n,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:n[r]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};t.r(e),t.d(e,{__unstableStripHTML:()=>$,computeCaretRect:()=>b,documentHasSelection:()=>w,documentHasTextSelection:()=>N,documentHasUncollapsedSelection:()=>C,focus:()=>st,getFilesFromDataTransfer:()=>at,getOffsetParent:()=>O,getPhrasingContentSchema:()=>tt,getRectangleFromRange:()=>g,getScrollContainer:()=>v,insertAfter:()=>z,isEmpty:()=>J,isEntirelySelected:()=>A,isFormElement:()=>D,isHorizontalEdge:()=>I,isNumberInput:()=>F,isPhrasingContent:()=>et,isRTL:()=>P,isTextContent:()=>nt,isTextField:()=>E,isVerticalEdge:()=>V,placeCaretAtHorizontalEdge:()=>j,placeCaretAtVerticalEdge:()=>U,remove:()=>q,removeInvalidHTML:()=>it,replace:()=>W,replaceTag:()=>X,safeHTML:()=>Y,unwrap:()=>k,wrap:()=>G});var n={};t.r(n),t.d(n,{find:()=>i});var r={};function o(t){return t.offsetWidth>0||t.offsetHeight>0||t.getClientRects().length>0}function i(t,{sequential:e=!1}={}){const n=t.querySelectorAll(function(t){return[t?'[tabindex]:not([tabindex^="-"])':"[tabindex]","a[href]","button:not([disabled])",'input:not([type="hidden"]):not([disabled])',"select:not([disabled])","textarea:not([disabled])",'iframe:not([tabindex^="-"])',"object","embed","area[href]","[contenteditable]:not([contenteditable=false])"].join(",")}(e));return Array.from(n).filter((t=>{if(!o(t))return!1;const{nodeName:e}=t;return"AREA"!==e||function(t){const e=t.closest("map[name]");if(!e)return!1;const n=t.ownerDocument.querySelector('img[usemap="#'+e.name+'"]');return!!n&&o(n)}(t)}))}function a(t){const e=t.getAttribute("tabindex");return null===e?0:parseInt(e,10)}function s(t){return-1!==a(t)}function c(t,e){return{element:t,index:e}}function u(t){return t.element}function l(t,e){const n=a(t.element),r=a(e.element);return n===r?t.index-e.index:n-r}function d(t){return t.filter(s).map(c).sort(l).map(u).reduce(function(){const t={};return function(e,n){const{nodeName:r,type:o,checked:i,name:a}=n;if("INPUT"!==r||"radio"!==o||!a)return e.concat(n);const s=t.hasOwnProperty(a);if(!i&&s)return e;if(s){const n=t[a];e=e.filter((t=>t!==n))}return t[a]=n,e.concat(n)}}(),[])}function f(t){return d(i(t))}function m(t){return d(i(t.ownerDocument.body)).reverse().find((e=>t.compareDocumentPosition(e)&t.DOCUMENT_POSITION_PRECEDING))}function h(t){return d(i(t.ownerDocument.body)).find((e=>t.compareDocumentPosition(e)&t.DOCUMENT_POSITION_FOLLOWING))}function p(t,e){0}function g(t){if(!t.collapsed){const e=Array.from(t.getClientRects());if(1===e.length)return e[0];const n=e.filter((({width:t})=>t>1));if(0===n.length)return t.getBoundingClientRect();if(1===n.length)return n[0];let{top:r,bottom:o,left:i,right:a}=n[0];for(const{top:t,bottom:e,left:s,right:c}of n)to&&(o=e),sa&&(a=c);return new window.DOMRect(i,r,a-i,o-r)}const{startContainer:e}=t,{ownerDocument:n}=e;if("BR"===e.nodeName){const{parentNode:r}=e;p();const o=Array.from(r.childNodes).indexOf(e);p(),(t=n.createRange()).setStart(r,o),t.setEnd(r,o)}const r=t.getClientRects();if(r.length>1)return null;let o=r[0];if(!o||0===o.height){p();const e=n.createTextNode("​");(t=t.cloneRange()).insertNode(e),o=t.getClientRects()[0],p(e.parentNode),e.parentNode.removeChild(e)}return o}function b(t){const e=t.getSelection();p();const n=e.rangeCount?e.getRangeAt(0):null;return n?g(n):null}function N(t){p(t.defaultView);const e=t.defaultView.getSelection();p();const n=e.rangeCount?e.getRangeAt(0):null;return!!n&&!n.collapsed}function y(t){return"INPUT"===t?.nodeName}function E(t){return y(t)&&t.type&&!["button","checkbox","hidden","file","radio","image","range","reset","submit","number","email","time"].includes(t.type)||"TEXTAREA"===t.nodeName||"true"===t.contentEditable}function C(t){return N(t)||!!t.activeElement&&function(t){if(!y(t)&&!E(t))return!1;try{const{selectionStart:e,selectionEnd:n}=t;return null===e||e!==n}catch(t){return!0}}(t.activeElement)}function w(t){return!!t.activeElement&&(y(t.activeElement)||E(t.activeElement)||N(t))}function T(t){return p(t.ownerDocument.defaultView),t.ownerDocument.defaultView.getComputedStyle(t)}function v(t,e="vertical"){if(t){if(("vertical"===e||"all"===e)&&t.scrollHeight>t.clientHeight){const{overflowY:e}=T(t);if(/(auto|scroll)/.test(e))return t}if(("horizontal"===e||"all"===e)&&t.scrollWidth>t.clientWidth){const{overflowX:e}=T(t);if(/(auto|scroll)/.test(e))return t}return t.ownerDocument===t.parentNode?t:v(t.parentNode,e)}}function O(t){let e;for(;(e=t.parentNode)&&e.nodeType!==e.ELEMENT_NODE;);return e?"static"!==T(e).position?e:e.offsetParent:null}function S(t){return"INPUT"===t.tagName||"TEXTAREA"===t.tagName}function A(t){if(S(t))return 0===t.selectionStart&&t.value.length===t.selectionEnd;if(!t.isContentEditable)return!0;const{ownerDocument:e}=t,{defaultView:n}=e;p();const r=n.getSelection();p();const o=r.rangeCount?r.getRangeAt(0):null;if(!o)return!0;const{startContainer:i,endContainer:a,startOffset:s,endOffset:c}=o;if(i===t&&a===t&&0===s&&c===t.childNodes.length)return!0;t.lastChild;p();const u=a.nodeType===a.TEXT_NODE?a.data.length:a.childNodes.length;return R(i,t,"firstChild")&&R(a,t,"lastChild")&&0===s&&c===u}function R(t,e,n){let r=e;do{if(t===r)return!0;r=r[n]}while(r);return!1}function D(t){if(!t)return!1;const{tagName:e}=t;return S(t)||"BUTTON"===e||"SELECT"===e}function P(t){return"rtl"===T(t).direction}function L(t,e,n,r){const o=r.style.zIndex,i=r.style.position,{position:a="static"}=T(r);"static"===a&&(r.style.position="relative"),r.style.zIndex="10000";const s=function(t,e,n){if(t.caretRangeFromPoint)return t.caretRangeFromPoint(e,n);if(!t.caretPositionFromPoint)return null;const r=t.caretPositionFromPoint(e,n);if(!r)return null;const o=t.createRange();return o.setStart(r.offsetNode,r.offset),o.collapse(!0),o}(t,e,n);return r.style.zIndex=o,r.style.position=i,s}function M(t,e,n){let r=n();return r&&r.startContainer&&t.contains(r.startContainer)||(t.scrollIntoView(e),r=n(),r&&r.startContainer&&t.contains(r.startContainer))?r:null}function x(t,e,n=!1){if(S(t)&&"number"==typeof t.selectionStart)return t.selectionStart===t.selectionEnd&&(e?0===t.selectionStart:t.value.length===t.selectionStart);if(!t.isContentEditable)return!0;const{ownerDocument:r}=t,{defaultView:o}=r;p();const i=o.getSelection();if(!i||!i.rangeCount)return!1;const a=i.getRangeAt(0),s=a.cloneRange(),c=function(t){const{anchorNode:e,focusNode:n,anchorOffset:r,focusOffset:o}=t;p(),p();const i=e.compareDocumentPosition(n);return!(i&e.DOCUMENT_POSITION_PRECEDING)&&(!!(i&e.DOCUMENT_POSITION_FOLLOWING)||0!==i||r<=o)}(i),u=i.isCollapsed;u||s.collapse(!c);const l=g(s),d=g(a);if(!l||!d)return!1;const f=function(t){const e=Array.from(t.getClientRects());if(!e.length)return;const n=Math.min(...e.map((({top:t})=>t)));return Math.max(...e.map((({bottom:t})=>t)))-n}(a);if(!u&&f&&f>l.height&&c===e)return!1;const m=P(t)?!e:e,h=t.getBoundingClientRect(),b=m?h.left+1:h.right-1,N=e?h.top+1:h.bottom-1,y=M(t,e,(()=>L(r,b,N,t)));if(!y)return!1;const E=g(y);if(!E)return!1;const C=e?"top":"bottom",w=m?"left":"right",T=E[C]-d[C],v=E[w]-l[w],O=Math.abs(T)<=1,A=Math.abs(v)<=1;return n?O:O&&A}function I(t,e){return x(t,e)}t.r(r),t.d(r,{find:()=>f,findNext:()=>h,findPrevious:()=>m,isTabbableIndex:()=>s});const H=window.wp.deprecated;var _=t.n(H);function F(t){return _()("wp.dom.isNumberInput",{since:"6.1",version:"6.5"}),y(t)&&"number"===t.type&&!isNaN(t.valueAsNumber)}function V(t,e){return x(t,e,!0)}function B(t,e,n){if(!t)return;if(t.focus(),S(t)){if("number"!=typeof t.selectionStart)return;return void(e?(t.selectionStart=t.value.length,t.selectionEnd=t.value.length):(t.selectionStart=0,t.selectionEnd=0))}if(!t.isContentEditable)return;const r=M(t,e,(()=>function(t,e,n){const{ownerDocument:r}=t,o=P(t)?!e:e,i=t.getBoundingClientRect();return void 0===n?n=e?i.right-1:i.left+1:n<=i.left?n=i.left+1:n>=i.right&&(n=i.right-1),L(r,n,o?i.bottom-1:i.top+1,t)}(t,e,n)));if(!r)return;const{ownerDocument:o}=t,{defaultView:i}=o;p();const a=i.getSelection();p(),a.removeAllRanges(),a.addRange(r)}function j(t,e){return B(t,e,void 0)}function U(t,e,n){return B(t,e,n?.left)}function z(t,e){p(e.parentNode),e.parentNode.insertBefore(t,e.nextSibling)}function q(t){p(t.parentNode),t.parentNode.removeChild(t)}function W(t,e){p(t.parentNode),z(e,t.parentNode),q(t)}function k(t){const e=t.parentNode;for(p();t.firstChild;)e.insertBefore(t.firstChild,t);e.removeChild(t)}function X(t,e){const n=t.ownerDocument.createElement(e);for(;t.firstChild;)n.appendChild(t.firstChild);return p(t.parentNode),t.parentNode.replaceChild(n,t),n}function G(t,e){p(e.parentNode),e.parentNode.insertBefore(t,e),t.appendChild(e)}function Y(t){const{body:e}=document.implementation.createHTMLDocument("");e.innerHTML=t;const n=e.getElementsByTagName("*");let r=n.length;for(;r--;){const t=n[r];if("SCRIPT"===t.tagName)q(t);else{let e=t.attributes.length;for(;e--;){const{name:n}=t.attributes[e];n.startsWith("on")&&t.removeAttribute(n)}}}return e.innerHTML}function $(t){t=Y(t);const e=document.implementation.createHTMLDocument("");return e.body.innerHTML=t,e.body.textContent||""}function J(t){switch(t.nodeType){case t.TEXT_NODE:return/^[ \f\n\r\t\v\u00a0]*$/.test(t.nodeValue||"");case t.ELEMENT_NODE:return!t.hasAttributes()&&(!t.hasChildNodes()||Array.from(t.childNodes).every(J));default:return!0}}const K={strong:{},em:{},s:{},del:{},ins:{},a:{attributes:["href","target","rel","id"]},code:{},abbr:{attributes:["title"]},sub:{},sup:{},br:{},small:{},q:{attributes:["cite"]},dfn:{attributes:["title"]},data:{attributes:["value"]},time:{attributes:["datetime"]},var:{},samp:{},kbd:{},i:{},b:{},u:{},mark:{},ruby:{},rt:{},rp:{},bdi:{attributes:["dir"]},bdo:{attributes:["dir"]},wbr:{},"#text":{}},Q=["#text","br"];Object.keys(K).filter((t=>!Q.includes(t))).forEach((t=>{const{[t]:e,...n}=K;K[t].children=n}));const Z={...K,audio:{attributes:["src","preload","autoplay","mediagroup","loop","muted"]},canvas:{attributes:["width","height"]},embed:{attributes:["src","type","width","height"]},img:{attributes:["alt","src","srcset","usemap","ismap","width","height"]},object:{attributes:["data","type","name","usemap","form","width","height"]},video:{attributes:["src","poster","preload","playsinline","autoplay","mediagroup","loop","muted","controls","width","height"]}};function tt(t){if("paste"!==t)return Z;const{u:e,abbr:n,data:r,time:o,wbr:i,bdi:a,bdo:s,...c}={...Z,ins:{children:Z.ins.children},del:{children:Z.del.children}};return c}function et(t){const e=t.nodeName.toLowerCase();return tt().hasOwnProperty(e)||"span"===e}function nt(t){const e=t.nodeName.toLowerCase();return K.hasOwnProperty(e)||"span"===e}const rt=()=>{};function ot(t,e,n,r){Array.from(t).forEach((t=>{const o=t.nodeName.toLowerCase();if(!n.hasOwnProperty(o)||n[o].isMatch&&!n[o].isMatch?.(t))ot(t.childNodes,e,n,r),r&&!et(t)&&t.nextElementSibling&&z(e.createElement("br"),t),k(t);else if(function(t){return!!t&&t.nodeType===t.ELEMENT_NODE}(t)){const{attributes:i=[],classes:a=[],children:s,require:c=[],allowEmpty:u}=n[o];if(s&&!u&&J(t))return void q(t);if(t.hasAttributes()&&(Array.from(t.attributes).forEach((({name:e})=>{"class"===e||i.includes(e)||t.removeAttribute(e)})),t.classList&&t.classList.length)){const e=a.map((t=>"string"==typeof t?e=>e===t:t instanceof RegExp?e=>t.test(e):rt));Array.from(t.classList).forEach((n=>{e.some((t=>t(n)))||t.classList.remove(n)})),t.classList.length||t.removeAttribute("class")}if(t.hasChildNodes()){if("*"===s)return;if(s)c.length&&!t.querySelector(c.join(","))?(ot(t.childNodes,e,n,r),k(t)):t.parentNode&&"BODY"===t.parentNode.nodeName&&et(t)?(ot(t.childNodes,e,n,r),Array.from(t.childNodes).some((t=>!et(t)))&&k(t)):ot(t.childNodes,e,s,r);else for(;t.firstChild;)q(t.firstChild)}}}))}function it(t,e,n){const r=document.implementation.createHTMLDocument("");return r.body.innerHTML=t,ot(r.body.childNodes,r,e,n),r.body.innerHTML}function at(t){const e=Array.from(t.files);return Array.from(t.items).forEach((t=>{const n=t.getAsFile();n&&!e.find((({name:t,type:e,size:r})=>t===n.name&&e===n.type&&r===n.size))&&e.push(n)})),e}const st={focusable:n,tabbable:r};(window.wp=window.wp||{}).dom=e})();format-library.js000064400000207020147177406350010053 0ustar00/******/ (() => { // webpackBootstrap /******/ "use strict"; /******/ // The require scope /******/ var __webpack_require__ = {}; /******/ /************************************************************************/ /******/ /* webpack/runtime/make namespace object */ /******/ (() => { /******/ // define __esModule on exports /******/ __webpack_require__.r = (exports) => { /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); /******/ } /******/ Object.defineProperty(exports, '__esModule', { value: true }); /******/ }; /******/ })(); /******/ /************************************************************************/ var __webpack_exports__ = {}; // ESM COMPAT FLAG __webpack_require__.r(__webpack_exports__); ;// CONCATENATED MODULE: external ["wp","richText"] const external_wp_richText_namespaceObject = window["wp"]["richText"]; ;// CONCATENATED MODULE: external ["wp","i18n"] const external_wp_i18n_namespaceObject = window["wp"]["i18n"]; ;// CONCATENATED MODULE: external ["wp","blockEditor"] const external_wp_blockEditor_namespaceObject = window["wp"]["blockEditor"]; ;// CONCATENATED MODULE: external ["wp","primitives"] const external_wp_primitives_namespaceObject = window["wp"]["primitives"]; ;// CONCATENATED MODULE: external "ReactJSXRuntime" const external_ReactJSXRuntime_namespaceObject = window["ReactJSXRuntime"]; ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/format-bold.js /** * WordPress dependencies */ const formatBold = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M14.7 11.3c1-.6 1.5-1.6 1.5-3 0-2.3-1.3-3.4-4-3.4H7v14h5.8c1.4 0 2.5-.3 3.3-1 .8-.7 1.2-1.7 1.2-2.9.1-1.9-.8-3.1-2.6-3.7zm-5.1-4h2.3c.6 0 1.1.1 1.4.4.3.3.5.7.5 1.2s-.2 1-.5 1.2c-.3.3-.8.4-1.4.4H9.6V7.3zm4.6 9c-.4.3-1 .4-1.7.4H9.6v-3.9h2.9c.7 0 1.3.2 1.7.5.4.3.6.8.6 1.5s-.2 1.2-.6 1.5z" }) }); /* harmony default export */ const format_bold = (formatBold); ;// CONCATENATED MODULE: ./node_modules/@wordpress/format-library/build-module/bold/index.js /** * WordPress dependencies */ const bold_name = 'core/bold'; const title = (0,external_wp_i18n_namespaceObject.__)('Bold'); const bold = { name: bold_name, title, tagName: 'strong', className: null, edit({ isActive, value, onChange, onFocus }) { function onToggle() { onChange((0,external_wp_richText_namespaceObject.toggleFormat)(value, { type: bold_name, title })); } function onClick() { onChange((0,external_wp_richText_namespaceObject.toggleFormat)(value, { type: bold_name })); onFocus(); } return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichTextShortcut, { type: "primary", character: "b", onUse: onToggle }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichTextToolbarButton, { name: "bold", icon: format_bold, title: title, onClick: onClick, isActive: isActive, shortcutType: "primary", shortcutCharacter: "b" }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.__unstableRichTextInputEvent, { inputType: "formatBold", onInput: onToggle })] }); } }; ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/code.js /** * WordPress dependencies */ const code = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M20.8 10.7l-4.3-4.3-1.1 1.1 4.3 4.3c.1.1.1.3 0 .4l-4.3 4.3 1.1 1.1 4.3-4.3c.7-.8.7-1.9 0-2.6zM4.2 11.8l4.3-4.3-1-1-4.3 4.3c-.7.7-.7 1.8 0 2.5l4.3 4.3 1.1-1.1-4.3-4.3c-.2-.1-.2-.3-.1-.4z" }) }); /* harmony default export */ const library_code = (code); ;// CONCATENATED MODULE: ./node_modules/@wordpress/format-library/build-module/code/index.js /** * WordPress dependencies */ const code_name = 'core/code'; const code_title = (0,external_wp_i18n_namespaceObject.__)('Inline code'); const code_code = { name: code_name, title: code_title, tagName: 'code', className: null, __unstableInputRule(value) { const BACKTICK = '`'; const { start, text } = value; const characterBefore = text[start - 1]; // Quick check the text for the necessary character. if (characterBefore !== BACKTICK) { return value; } if (start - 2 < 0) { return value; } const indexBefore = text.lastIndexOf(BACKTICK, start - 2); if (indexBefore === -1) { return value; } const startIndex = indexBefore; const endIndex = start - 2; if (startIndex === endIndex) { return value; } value = (0,external_wp_richText_namespaceObject.remove)(value, startIndex, startIndex + 1); value = (0,external_wp_richText_namespaceObject.remove)(value, endIndex, endIndex + 1); value = (0,external_wp_richText_namespaceObject.applyFormat)(value, { type: code_name }, startIndex, endIndex); return value; }, edit({ value, onChange, onFocus, isActive }) { function onClick() { onChange((0,external_wp_richText_namespaceObject.toggleFormat)(value, { type: code_name, title: code_title })); onFocus(); } return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichTextShortcut, { type: "access", character: "x", onUse: onClick }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichTextToolbarButton, { icon: library_code, title: code_title, onClick: onClick, isActive: isActive, role: "menuitemcheckbox" })] }); } }; ;// CONCATENATED MODULE: external ["wp","components"] const external_wp_components_namespaceObject = window["wp"]["components"]; ;// CONCATENATED MODULE: external ["wp","element"] const external_wp_element_namespaceObject = window["wp"]["element"]; ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/keyboard-return.js /** * WordPress dependencies */ const keyboardReturn = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "m6.734 16.106 2.176-2.38-1.093-1.028-3.846 4.158 3.846 4.158 1.093-1.028-2.176-2.38h2.811c1.125 0 2.25.03 3.374 0 1.428-.001 3.362-.25 4.963-1.277 1.66-1.065 2.868-2.906 2.868-5.859 0-2.479-1.327-4.896-3.65-5.93-1.82-.813-3.044-.8-4.806-.788l-.567.002v1.5c.184 0 .368 0 .553-.002 1.82-.007 2.704-.014 4.21.657 1.854.827 2.76 2.657 2.76 4.561 0 2.472-.973 3.824-2.178 4.596-1.258.807-2.864 1.04-4.163 1.04h-.02c-1.115.03-2.229 0-3.344 0H6.734Z" }) }); /* harmony default export */ const keyboard_return = (keyboardReturn); ;// CONCATENATED MODULE: ./node_modules/@wordpress/format-library/build-module/image/index.js /** * WordPress dependencies */ const ALLOWED_MEDIA_TYPES = ['image']; const image_name = 'core/image'; const image_title = (0,external_wp_i18n_namespaceObject.__)('Inline image'); const image_image = { name: image_name, title: image_title, keywords: [(0,external_wp_i18n_namespaceObject.__)('photo'), (0,external_wp_i18n_namespaceObject.__)('media')], object: true, tagName: 'img', className: null, attributes: { className: 'class', style: 'style', url: 'src', alt: 'alt' }, edit: Edit }; function InlineUI({ value, onChange, activeObjectAttributes, contentRef }) { const { style } = activeObjectAttributes; const [width, setWidth] = (0,external_wp_element_namespaceObject.useState)(style?.replace(/\D/g, '')); const popoverAnchor = (0,external_wp_richText_namespaceObject.useAnchor)({ editableContentElement: contentRef.current, settings: image_image }); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Popover, { placement: "bottom", focusOnMount: false, anchor: popoverAnchor, className: "block-editor-format-toolbar__image-popover", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("form", { className: "block-editor-format-toolbar__image-container-content", onSubmit: event => { const newReplacements = value.replacements.slice(); newReplacements[value.start] = { type: image_name, attributes: { ...activeObjectAttributes, style: width ? `width: ${width}px;` : '' } }; onChange({ ...value, replacements: newReplacements }); event.preventDefault(); }, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { alignment: "bottom", spacing: "0", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalNumberControl, { className: "block-editor-format-toolbar__image-container-value", label: (0,external_wp_i18n_namespaceObject.__)('Width'), value: width, min: 1, onChange: newWidth => setWidth(newWidth) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { className: "block-editor-format-toolbar__image-container-button", icon: keyboard_return, label: (0,external_wp_i18n_namespaceObject.__)('Apply'), type: "submit" })] }) }) }); } function Edit({ value, onChange, onFocus, isObjectActive, activeObjectAttributes, contentRef }) { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_blockEditor_namespaceObject.MediaUploadCheck, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.MediaUpload, { allowedTypes: ALLOWED_MEDIA_TYPES, onSelect: ({ id, url, alt, width: imgWidth }) => { onChange((0,external_wp_richText_namespaceObject.insertObject)(value, { type: image_name, attributes: { className: `wp-image-${id}`, style: `width: ${Math.min(imgWidth, 150)}px;`, url, alt } })); onFocus(); }, render: ({ open }) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichTextToolbarButton, { icon: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Path, { d: "M4 18.5h16V17H4v1.5zM16 13v1.5h4V13h-4zM5.1 15h7.8c.6 0 1.1-.5 1.1-1.1V6.1c0-.6-.5-1.1-1.1-1.1H5.1C4.5 5 4 5.5 4 6.1v7.8c0 .6.5 1.1 1.1 1.1zm.4-8.5h7V10l-1-1c-.3-.3-.8-.3-1 0l-1.6 1.5-1.2-.7c-.3-.2-.6-.2-.9 0l-1.3 1V6.5zm0 6.1l1.8-1.3 1.3.8c.3.2.7.2.9-.1l1.5-1.4 1.5 1.4v1.5h-7v-.9z" }) }), title: image_title, onClick: open, isActive: isObjectActive }) }), isObjectActive && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(InlineUI, { value: value, onChange: onChange, activeObjectAttributes: activeObjectAttributes, contentRef: contentRef })] }); } ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/format-italic.js /** * WordPress dependencies */ const formatItalic = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M12.5 5L10 19h1.9l2.5-14z" }) }); /* harmony default export */ const format_italic = (formatItalic); ;// CONCATENATED MODULE: ./node_modules/@wordpress/format-library/build-module/italic/index.js /** * WordPress dependencies */ const italic_name = 'core/italic'; const italic_title = (0,external_wp_i18n_namespaceObject.__)('Italic'); const italic = { name: italic_name, title: italic_title, tagName: 'em', className: null, edit({ isActive, value, onChange, onFocus }) { function onToggle() { onChange((0,external_wp_richText_namespaceObject.toggleFormat)(value, { type: italic_name, title: italic_title })); } function onClick() { onChange((0,external_wp_richText_namespaceObject.toggleFormat)(value, { type: italic_name })); onFocus(); } return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichTextShortcut, { type: "primary", character: "i", onUse: onToggle }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichTextToolbarButton, { name: "italic", icon: format_italic, title: italic_title, onClick: onClick, isActive: isActive, shortcutType: "primary", shortcutCharacter: "i" }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.__unstableRichTextInputEvent, { inputType: "formatItalic", onInput: onToggle })] }); } }; ;// CONCATENATED MODULE: external ["wp","url"] const external_wp_url_namespaceObject = window["wp"]["url"]; ;// CONCATENATED MODULE: external ["wp","htmlEntities"] const external_wp_htmlEntities_namespaceObject = window["wp"]["htmlEntities"]; ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/link.js /** * WordPress dependencies */ const link_link = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M10 17.389H8.444A5.194 5.194 0 1 1 8.444 7H10v1.5H8.444a3.694 3.694 0 0 0 0 7.389H10v1.5ZM14 7h1.556a5.194 5.194 0 0 1 0 10.39H14v-1.5h1.556a3.694 3.694 0 0 0 0-7.39H14V7Zm-4.5 6h5v-1.5h-5V13Z" }) }); /* harmony default export */ const library_link = (link_link); ;// CONCATENATED MODULE: external ["wp","a11y"] const external_wp_a11y_namespaceObject = window["wp"]["a11y"]; ;// CONCATENATED MODULE: external ["wp","data"] const external_wp_data_namespaceObject = window["wp"]["data"]; ;// CONCATENATED MODULE: ./node_modules/@wordpress/format-library/build-module/link/utils.js /** * WordPress dependencies */ /** * Check for issues with the provided href. * * @param {string} href The href. * * @return {boolean} Is the href invalid? */ function isValidHref(href) { if (!href) { return false; } const trimmedHref = href.trim(); if (!trimmedHref) { return false; } // Does the href start with something that looks like a URL protocol? if (/^\S+:/.test(trimmedHref)) { const protocol = (0,external_wp_url_namespaceObject.getProtocol)(trimmedHref); if (!(0,external_wp_url_namespaceObject.isValidProtocol)(protocol)) { return false; } // Add some extra checks for http(s) URIs, since these are the most common use-case. // This ensures URIs with an http protocol have exactly two forward slashes following the protocol. if (protocol.startsWith('http') && !/^https?:\/\/[^\/\s]/i.test(trimmedHref)) { return false; } const authority = (0,external_wp_url_namespaceObject.getAuthority)(trimmedHref); if (!(0,external_wp_url_namespaceObject.isValidAuthority)(authority)) { return false; } const path = (0,external_wp_url_namespaceObject.getPath)(trimmedHref); if (path && !(0,external_wp_url_namespaceObject.isValidPath)(path)) { return false; } const queryString = (0,external_wp_url_namespaceObject.getQueryString)(trimmedHref); if (queryString && !(0,external_wp_url_namespaceObject.isValidQueryString)(queryString)) { return false; } const fragment = (0,external_wp_url_namespaceObject.getFragment)(trimmedHref); if (fragment && !(0,external_wp_url_namespaceObject.isValidFragment)(fragment)) { return false; } } // Validate anchor links. if (trimmedHref.startsWith('#') && !(0,external_wp_url_namespaceObject.isValidFragment)(trimmedHref)) { return false; } return true; } /** * Generates the format object that will be applied to the link text. * * @param {Object} options * @param {string} options.url The href of the link. * @param {string} options.type The type of the link. * @param {string} options.id The ID of the link. * @param {boolean} options.opensInNewWindow Whether this link will open in a new window. * @param {boolean} options.nofollow Whether this link is marked as no follow relationship. * @return {Object} The final format object. */ function createLinkFormat({ url, type, id, opensInNewWindow, nofollow }) { const format = { type: 'core/link', attributes: { url } }; if (type) { format.attributes.type = type; } if (id) { format.attributes.id = id; } if (opensInNewWindow) { format.attributes.target = '_blank'; format.attributes.rel = format.attributes.rel ? format.attributes.rel + ' noreferrer noopener' : 'noreferrer noopener'; } if (nofollow) { format.attributes.rel = format.attributes.rel ? format.attributes.rel + ' nofollow' : 'nofollow'; } return format; } /* eslint-disable jsdoc/no-undefined-types */ /** * Get the start and end boundaries of a given format from a rich text value. * * * @param {RichTextValue} value the rich text value to interrogate. * @param {string} format the identifier for the target format (e.g. `core/link`, `core/bold`). * @param {number?} startIndex optional startIndex to seek from. * @param {number?} endIndex optional endIndex to seek from. * @return {Object} object containing start and end values for the given format. */ /* eslint-enable jsdoc/no-undefined-types */ function getFormatBoundary(value, format, startIndex = value.start, endIndex = value.end) { const EMPTY_BOUNDARIES = { start: null, end: null }; const { formats } = value; let targetFormat; let initialIndex; if (!formats?.length) { return EMPTY_BOUNDARIES; } // Clone formats to avoid modifying source formats. const newFormats = formats.slice(); const formatAtStart = newFormats[startIndex]?.find(({ type }) => type === format.type); const formatAtEnd = newFormats[endIndex]?.find(({ type }) => type === format.type); const formatAtEndMinusOne = newFormats[endIndex - 1]?.find(({ type }) => type === format.type); if (!!formatAtStart) { // Set values to conform to "start" targetFormat = formatAtStart; initialIndex = startIndex; } else if (!!formatAtEnd) { // Set values to conform to "end" targetFormat = formatAtEnd; initialIndex = endIndex; } else if (!!formatAtEndMinusOne) { // This is an edge case which will occur if you create a format, then place // the caret just before the format and hit the back ARROW key. The resulting // value object will have start and end +1 beyond the edge of the format boundary. targetFormat = formatAtEndMinusOne; initialIndex = endIndex - 1; } else { return EMPTY_BOUNDARIES; } const index = newFormats[initialIndex].indexOf(targetFormat); const walkingArgs = [newFormats, initialIndex, targetFormat, index]; // Walk the startIndex "backwards" to the leading "edge" of the matching format. startIndex = walkToStart(...walkingArgs); // Walk the endIndex "forwards" until the trailing "edge" of the matching format. endIndex = walkToEnd(...walkingArgs); // Safe guard: start index cannot be less than 0. startIndex = startIndex < 0 ? 0 : startIndex; // // Return the indicies of the "edges" as the boundaries. return { start: startIndex, end: endIndex }; } /** * Walks forwards/backwards towards the boundary of a given format within an * array of format objects. Returns the index of the boundary. * * @param {Array} formats the formats to search for the given format type. * @param {number} initialIndex the starting index from which to walk. * @param {Object} targetFormatRef a reference to the format type object being sought. * @param {number} formatIndex the index at which we expect the target format object to be. * @param {string} direction either 'forwards' or 'backwards' to indicate the direction. * @return {number} the index of the boundary of the given format. */ function walkToBoundary(formats, initialIndex, targetFormatRef, formatIndex, direction) { let index = initialIndex; const directions = { forwards: 1, backwards: -1 }; const directionIncrement = directions[direction] || 1; // invalid direction arg default to forwards const inverseDirectionIncrement = directionIncrement * -1; while (formats[index] && formats[index][formatIndex] === targetFormatRef) { // Increment/decrement in the direction of operation. index = index + directionIncrement; } // Restore by one in inverse direction of operation // to avoid out of bounds. index = index + inverseDirectionIncrement; return index; } const partialRight = (fn, ...partialArgs) => (...args) => fn(...args, ...partialArgs); const walkToStart = partialRight(walkToBoundary, 'backwards'); const walkToEnd = partialRight(walkToBoundary, 'forwards'); ;// CONCATENATED MODULE: ./node_modules/@wordpress/format-library/build-module/link/inline.js /** * WordPress dependencies */ /** * Internal dependencies */ const LINK_SETTINGS = [...external_wp_blockEditor_namespaceObject.__experimentalLinkControl.DEFAULT_LINK_SETTINGS, { id: 'nofollow', title: (0,external_wp_i18n_namespaceObject.__)('Mark as nofollow') }]; function InlineLinkUI({ isActive, activeAttributes, value, onChange, onFocusOutside, stopAddingLink, contentRef, focusOnMount }) { const richLinkTextValue = getRichTextValueFromSelection(value, isActive); // Get the text content minus any HTML tags. const richTextText = richLinkTextValue.text; const { selectionChange } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store); const { createPageEntity, userCanCreatePages, selectionStart } = (0,external_wp_data_namespaceObject.useSelect)(select => { const { getSettings, getSelectionStart } = select(external_wp_blockEditor_namespaceObject.store); const _settings = getSettings(); return { createPageEntity: _settings.__experimentalCreatePageEntity, userCanCreatePages: _settings.__experimentalUserCanCreatePages, selectionStart: getSelectionStart() }; }, []); const linkValue = (0,external_wp_element_namespaceObject.useMemo)(() => ({ url: activeAttributes.url, type: activeAttributes.type, id: activeAttributes.id, opensInNewTab: activeAttributes.target === '_blank', nofollow: activeAttributes.rel?.includes('nofollow'), title: richTextText }), [activeAttributes.id, activeAttributes.rel, activeAttributes.target, activeAttributes.type, activeAttributes.url, richTextText]); function removeLink() { const newValue = (0,external_wp_richText_namespaceObject.removeFormat)(value, 'core/link'); onChange(newValue); stopAddingLink(); (0,external_wp_a11y_namespaceObject.speak)((0,external_wp_i18n_namespaceObject.__)('Link removed.'), 'assertive'); } function onChangeLink(nextValue) { const hasLink = linkValue?.url; const isNewLink = !hasLink; // Merge the next value with the current link value. nextValue = { ...linkValue, ...nextValue }; const newUrl = (0,external_wp_url_namespaceObject.prependHTTP)(nextValue.url); const linkFormat = createLinkFormat({ url: newUrl, type: nextValue.type, id: nextValue.id !== undefined && nextValue.id !== null ? String(nextValue.id) : undefined, opensInNewWindow: nextValue.opensInNewTab, nofollow: nextValue.nofollow }); const newText = nextValue.title || newUrl; // Scenario: we have any active text selection or an active format. let newValue; if ((0,external_wp_richText_namespaceObject.isCollapsed)(value) && !isActive) { // Scenario: we don't have any actively selected text or formats. const inserted = (0,external_wp_richText_namespaceObject.insert)(value, newText); newValue = (0,external_wp_richText_namespaceObject.applyFormat)(inserted, linkFormat, value.start, value.start + newText.length); onChange(newValue); // Close the Link UI. stopAddingLink(); // Move the selection to the end of the inserted link outside of the format boundary // so the user can continue typing after the link. selectionChange({ clientId: selectionStart.clientId, identifier: selectionStart.attributeKey, start: value.start + newText.length + 1 }); return; } else if (newText === richTextText) { newValue = (0,external_wp_richText_namespaceObject.applyFormat)(value, linkFormat); } else { // Scenario: Editing an existing link. // Create new RichText value for the new text in order that we // can apply formats to it. newValue = (0,external_wp_richText_namespaceObject.create)({ text: newText }); // Apply the new Link format to this new text value. newValue = (0,external_wp_richText_namespaceObject.applyFormat)(newValue, linkFormat, 0, newText.length); // Get the boundaries of the active link format. const boundary = getFormatBoundary(value, { type: 'core/link' }); // Split the value at the start of the active link format. // Passing "start" as the 3rd parameter is required to ensure // the second half of the split value is split at the format's // start boundary and avoids relying on the value's "end" property // which may not correspond correctly. const [valBefore, valAfter] = (0,external_wp_richText_namespaceObject.split)(value, boundary.start, boundary.start); // Update the original (full) RichTextValue replacing the // target text with the *new* RichTextValue containing: // 1. The new text content. // 2. The new link format. // As "replace" will operate on the first match only, it is // run only against the second half of the value which was // split at the active format's boundary. This avoids a bug // with incorrectly targetted replacements. // See: https://github.com/WordPress/gutenberg/issues/41771. // Note original formats will be lost when applying this change. // That is expected behaviour. // See: https://github.com/WordPress/gutenberg/pull/33849#issuecomment-936134179. const newValAfter = (0,external_wp_richText_namespaceObject.replace)(valAfter, richTextText, newValue); newValue = (0,external_wp_richText_namespaceObject.concat)(valBefore, newValAfter); } onChange(newValue); // Focus should only be returned to the rich text on submit if this link is not // being created for the first time. If it is then focus should remain within the // Link UI because it should remain open for the user to modify the link they have // just created. if (!isNewLink) { stopAddingLink(); } if (!isValidHref(newUrl)) { (0,external_wp_a11y_namespaceObject.speak)((0,external_wp_i18n_namespaceObject.__)('Warning: the link has been inserted but may have errors. Please test it.'), 'assertive'); } else if (isActive) { (0,external_wp_a11y_namespaceObject.speak)((0,external_wp_i18n_namespaceObject.__)('Link edited.'), 'assertive'); } else { (0,external_wp_a11y_namespaceObject.speak)((0,external_wp_i18n_namespaceObject.__)('Link inserted.'), 'assertive'); } } const popoverAnchor = (0,external_wp_richText_namespaceObject.useAnchor)({ editableContentElement: contentRef.current, settings: { ...build_module_link_link, isActive } }); async function handleCreate(pageTitle) { const page = await createPageEntity({ title: pageTitle, status: 'draft' }); return { id: page.id, type: page.type, title: page.title.rendered, url: page.link, kind: 'post-type' }; } function createButtonText(searchTerm) { return (0,external_wp_element_namespaceObject.createInterpolateElement)((0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %s: search term. */ (0,external_wp_i18n_namespaceObject.__)('Create page: %s'), searchTerm), { mark: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("mark", {}) }); } return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Popover, { anchor: popoverAnchor, animate: false, onClose: stopAddingLink, onFocusOutside: onFocusOutside, placement: "bottom", offset: 8, shift: true, focusOnMount: focusOnMount, constrainTabbing: true, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.__experimentalLinkControl, { value: linkValue, onChange: onChangeLink, onRemove: removeLink, hasRichPreviews: true, createSuggestion: createPageEntity && handleCreate, withCreateSuggestion: userCanCreatePages, createSuggestionButtonText: createButtonText, hasTextControl: true, settings: LINK_SETTINGS, showInitialSuggestions: true, suggestionsQuery: { // always show Pages as initial suggestions initialSuggestionsSearchOptions: { type: 'post', subtype: 'page', perPage: 20 } } }) }); } function getRichTextValueFromSelection(value, isActive) { // Default to the selection ranges on the RichTextValue object. let textStart = value.start; let textEnd = value.end; // If the format is currently active then the rich text value // should always be taken from the bounds of the active format // and not the selected text. if (isActive) { const boundary = getFormatBoundary(value, { type: 'core/link' }); textStart = boundary.start; // Text *selection* always extends +1 beyond the edge of the format. // We account for that here. textEnd = boundary.end + 1; } // Get a RichTextValue containing the selected text content. return (0,external_wp_richText_namespaceObject.slice)(value, textStart, textEnd); } /* harmony default export */ const inline = (InlineLinkUI); ;// CONCATENATED MODULE: ./node_modules/@wordpress/format-library/build-module/link/index.js /** * WordPress dependencies */ /** * Internal dependencies */ const link_name = 'core/link'; const link_title = (0,external_wp_i18n_namespaceObject.__)('Link'); function link_Edit({ isActive, activeAttributes, value, onChange, onFocus, contentRef }) { const [addingLink, setAddingLink] = (0,external_wp_element_namespaceObject.useState)(false); // We only need to store the button element that opened the popover. We can ignore the other states, as they will be handled by the onFocus prop to return to the rich text field. const [openedBy, setOpenedBy] = (0,external_wp_element_namespaceObject.useState)(null); (0,external_wp_element_namespaceObject.useEffect)(() => { // When the link becomes inactive (i.e. isActive is false), reset the editingLink state // and the creatingLink state. This means that if the Link UI is displayed and the link // becomes inactive (e.g. used arrow keys to move cursor outside of link bounds), the UI will close. if (!isActive) { setAddingLink(false); } }, [isActive]); (0,external_wp_element_namespaceObject.useLayoutEffect)(() => { const editableContentElement = contentRef.current; if (!editableContentElement) { return; } function handleClick(event) { // There is a situation whereby there is an existing link in the rich text // and the user clicks on the leftmost edge of that link and fails to activate // the link format, but the click event still fires on the `` element. // This causes the `editingLink` state to be set to `true` and the link UI // to be rendered in "creating" mode. We need to check isActive to see if // we have an active link format. const link = event.target.closest('[contenteditable] a'); if (!link || // other formats (e.g. bold) may be nested within the link. !isActive) { return; } setAddingLink(true); setOpenedBy({ el: link, action: 'click' }); } editableContentElement.addEventListener('click', handleClick); return () => { editableContentElement.removeEventListener('click', handleClick); }; }, [contentRef, isActive]); function addLink(target) { const text = (0,external_wp_richText_namespaceObject.getTextContent)((0,external_wp_richText_namespaceObject.slice)(value)); if (!isActive && text && (0,external_wp_url_namespaceObject.isURL)(text) && isValidHref(text)) { onChange((0,external_wp_richText_namespaceObject.applyFormat)(value, { type: link_name, attributes: { url: text } })); } else if (!isActive && text && (0,external_wp_url_namespaceObject.isEmail)(text)) { onChange((0,external_wp_richText_namespaceObject.applyFormat)(value, { type: link_name, attributes: { url: `mailto:${text}` } })); } else { if (target) { setOpenedBy({ el: target, action: null // We don't need to distinguish between click or keyboard here }); } setAddingLink(true); } } /** * Runs when the popover is closed via escape keypress, unlinking the selected text, * but _not_ on a click outside the popover. onFocusOutside handles that. */ function stopAddingLink() { // Don't let the click handler on the toolbar button trigger again. // There are two places for us to return focus to on Escape keypress: // 1. The rich text field. // 2. The toolbar button. // The toolbar button is the only one we need to handle returning focus to. // Otherwise, we rely on the passed in onFocus to return focus to the rich text field. // Close the popover setAddingLink(false); // Return focus to the toolbar button or the rich text field if (openedBy?.el?.tagName === 'BUTTON') { openedBy.el.focus(); } else { onFocus(); } // Remove the openedBy state setOpenedBy(null); } // Test for this: // 1. Click on the link button // 2. Click the Options button in the top right of header // 3. Focus should be in the dropdown of the Options button // 4. Press Escape // 5. Focus should be on the Options button function onFocusOutside() { setAddingLink(false); setOpenedBy(null); } function onRemoveFormat() { onChange((0,external_wp_richText_namespaceObject.removeFormat)(value, link_name)); (0,external_wp_a11y_namespaceObject.speak)((0,external_wp_i18n_namespaceObject.__)('Link removed.'), 'assertive'); } // Only autofocus if we have clicked a link within the editor const shouldAutoFocus = !(openedBy?.el?.tagName === 'A' && openedBy?.action === 'click'); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichTextShortcut, { type: "primary", character: "k", onUse: addLink }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichTextShortcut, { type: "primaryShift", character: "k", onUse: onRemoveFormat }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichTextToolbarButton, { name: "link", icon: library_link, title: isActive ? (0,external_wp_i18n_namespaceObject.__)('Link') : link_title, onClick: event => { addLink(event.currentTarget); }, isActive: isActive || addingLink, shortcutType: "primary", shortcutCharacter: "k", "aria-haspopup": "true", "aria-expanded": addingLink }), addingLink && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(inline, { stopAddingLink: stopAddingLink, onFocusOutside: onFocusOutside, isActive: isActive, activeAttributes: activeAttributes, value: value, onChange: onChange, contentRef: contentRef, focusOnMount: shouldAutoFocus ? 'firstElement' : false })] }); } const build_module_link_link = { name: link_name, title: link_title, tagName: 'a', className: null, attributes: { url: 'href', type: 'data-type', id: 'data-id', _id: 'id', target: 'target', rel: 'rel' }, __unstablePasteRule(value, { html, plainText }) { const pastedText = (html || plainText).replace(/<[^>]+>/g, '').trim(); // A URL was pasted, turn the selection into a link. // For the link pasting feature, allow only http(s) protocols. if (!(0,external_wp_url_namespaceObject.isURL)(pastedText) || !/^https?:/.test(pastedText)) { return value; } // Allows us to ask for this information when we get a report. window.console.log('Created link:\n\n', pastedText); const format = { type: link_name, attributes: { url: (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(pastedText) } }; if ((0,external_wp_richText_namespaceObject.isCollapsed)(value)) { return (0,external_wp_richText_namespaceObject.insert)(value, (0,external_wp_richText_namespaceObject.applyFormat)((0,external_wp_richText_namespaceObject.create)({ text: plainText }), format, 0, plainText.length)); } return (0,external_wp_richText_namespaceObject.applyFormat)(value, format); }, edit: link_Edit }; ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/format-strikethrough.js /** * WordPress dependencies */ const formatStrikethrough = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M9.1 9v-.5c0-.6.2-1.1.7-1.4.5-.3 1.2-.5 2-.5.7 0 1.4.1 2.1.3.7.2 1.4.5 2.1.9l.2-1.9c-.6-.3-1.2-.5-1.9-.7-.8-.1-1.6-.2-2.4-.2-1.5 0-2.7.3-3.6 1-.8.7-1.2 1.5-1.2 2.6V9h2zM20 12H4v1h8.3c.3.1.6.2.8.3.5.2.9.5 1.1.8.3.3.4.7.4 1.2 0 .7-.2 1.1-.8 1.5-.5.3-1.2.5-2.1.5-.8 0-1.6-.1-2.4-.3-.8-.2-1.5-.5-2.2-.8L7 18.1c.5.2 1.2.4 2 .6.8.2 1.6.3 2.4.3 1.7 0 3-.3 3.9-1 .9-.7 1.3-1.6 1.3-2.8 0-.9-.2-1.7-.7-2.2H20v-1z" }) }); /* harmony default export */ const format_strikethrough = (formatStrikethrough); ;// CONCATENATED MODULE: ./node_modules/@wordpress/format-library/build-module/strikethrough/index.js /** * WordPress dependencies */ const strikethrough_name = 'core/strikethrough'; const strikethrough_title = (0,external_wp_i18n_namespaceObject.__)('Strikethrough'); const strikethrough = { name: strikethrough_name, title: strikethrough_title, tagName: 's', className: null, edit({ isActive, value, onChange, onFocus }) { function onClick() { onChange((0,external_wp_richText_namespaceObject.toggleFormat)(value, { type: strikethrough_name, title: strikethrough_title })); onFocus(); } return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichTextShortcut, { type: "access", character: "d", onUse: onClick }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichTextToolbarButton, { icon: format_strikethrough, title: strikethrough_title, onClick: onClick, isActive: isActive, role: "menuitemcheckbox" })] }); } }; ;// CONCATENATED MODULE: ./node_modules/@wordpress/format-library/build-module/underline/index.js /** * WordPress dependencies */ const underline_name = 'core/underline'; const underline_title = (0,external_wp_i18n_namespaceObject.__)('Underline'); const underline = { name: underline_name, title: underline_title, tagName: 'span', className: null, attributes: { style: 'style' }, edit({ value, onChange }) { const onToggle = () => { onChange((0,external_wp_richText_namespaceObject.toggleFormat)(value, { type: underline_name, attributes: { style: 'text-decoration: underline;' }, title: underline_title })); }; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichTextShortcut, { type: "primary", character: "u", onUse: onToggle }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.__unstableRichTextInputEvent, { inputType: "formatUnderline", onInput: onToggle })] }); } }; ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/icon/index.js /** * WordPress dependencies */ /** @typedef {{icon: JSX.Element, size?: number} & import('@wordpress/primitives').SVGProps} IconProps */ /** * Return an SVG icon. * * @param {IconProps} props icon is the SVG component to render * size is a number specifiying the icon size in pixels * Other props will be passed to wrapped SVG component * @param {import('react').ForwardedRef} ref The forwarded ref to the SVG element. * * @return {JSX.Element} Icon component */ function Icon({ icon, size = 24, ...props }, ref) { return (0,external_wp_element_namespaceObject.cloneElement)(icon, { width: size, height: size, ...props, ref }); } /* harmony default export */ const icon = ((0,external_wp_element_namespaceObject.forwardRef)(Icon)); ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/text-color.js /** * WordPress dependencies */ const textColor = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M12.9 6h-2l-4 11h1.9l1.1-3h4.2l1.1 3h1.9L12.9 6zm-2.5 6.5l1.5-4.9 1.7 4.9h-3.2z" }) }); /* harmony default export */ const text_color = (textColor); ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/color.js /** * WordPress dependencies */ const color = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M17.2 10.9c-.5-1-1.2-2.1-2.1-3.2-.6-.9-1.3-1.7-2.1-2.6L12 4l-1 1.1c-.6.9-1.3 1.7-2 2.6-.8 1.2-1.5 2.3-2 3.2-.6 1.2-1 2.2-1 3 0 3.4 2.7 6.1 6.1 6.1s6.1-2.7 6.1-6.1c0-.8-.3-1.8-1-3zm-5.1 7.6c-2.5 0-4.6-2.1-4.6-4.6 0-.3.1-1 .8-2.3.5-.9 1.1-1.9 2-3.1.7-.9 1.3-1.7 1.8-2.3.7.8 1.3 1.6 1.8 2.3.8 1.1 1.5 2.2 2 3.1.7 1.3.8 2 .8 2.3 0 2.5-2.1 4.6-4.6 4.6z" }) }); /* harmony default export */ const library_color = (color); ;// CONCATENATED MODULE: external ["wp","privateApis"] const external_wp_privateApis_namespaceObject = window["wp"]["privateApis"]; ;// CONCATENATED MODULE: ./node_modules/@wordpress/format-library/build-module/lock-unlock.js /** * WordPress dependencies */ const { lock, unlock } = (0,external_wp_privateApis_namespaceObject.__dangerousOptInToUnstableAPIsOnlyForCoreModules)('I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.', '@wordpress/format-library'); ;// CONCATENATED MODULE: ./node_modules/@wordpress/format-library/build-module/text-color/inline.js /** * WordPress dependencies */ /** * Internal dependencies */ const { Tabs } = unlock(external_wp_components_namespaceObject.privateApis); const TABS = [{ name: 'color', title: (0,external_wp_i18n_namespaceObject.__)('Text') }, { name: 'backgroundColor', title: (0,external_wp_i18n_namespaceObject.__)('Background') }]; function parseCSS(css = '') { return css.split(';').reduce((accumulator, rule) => { if (rule) { const [property, value] = rule.split(':'); if (property === 'color') { accumulator.color = value; } if (property === 'background-color' && value !== transparentValue) { accumulator.backgroundColor = value; } } return accumulator; }, {}); } function parseClassName(className = '', colorSettings) { return className.split(' ').reduce((accumulator, name) => { // `colorSlug` could contain dashes, so simply match the start and end. if (name.startsWith('has-') && name.endsWith('-color')) { const colorSlug = name.replace(/^has-/, '').replace(/-color$/, ''); const colorObject = (0,external_wp_blockEditor_namespaceObject.getColorObjectByAttributeValues)(colorSettings, colorSlug); accumulator.color = colorObject.color; } return accumulator; }, {}); } function getActiveColors(value, name, colorSettings) { const activeColorFormat = (0,external_wp_richText_namespaceObject.getActiveFormat)(value, name); if (!activeColorFormat) { return {}; } return { ...parseCSS(activeColorFormat.attributes.style), ...parseClassName(activeColorFormat.attributes.class, colorSettings) }; } function setColors(value, name, colorSettings, colors) { const { color, backgroundColor } = { ...getActiveColors(value, name, colorSettings), ...colors }; if (!color && !backgroundColor) { return (0,external_wp_richText_namespaceObject.removeFormat)(value, name); } const styles = []; const classNames = []; const attributes = {}; if (backgroundColor) { styles.push(['background-color', backgroundColor].join(':')); } else { // Override default browser color for mark element. styles.push(['background-color', transparentValue].join(':')); } if (color) { const colorObject = (0,external_wp_blockEditor_namespaceObject.getColorObjectByColorValue)(colorSettings, color); if (colorObject) { classNames.push((0,external_wp_blockEditor_namespaceObject.getColorClassName)('color', colorObject.slug)); } else { styles.push(['color', color].join(':')); } } if (styles.length) { attributes.style = styles.join(';'); } if (classNames.length) { attributes.class = classNames.join(' '); } return (0,external_wp_richText_namespaceObject.applyFormat)(value, { type: name, attributes }); } function ColorPicker({ name, property, value, onChange }) { const colors = (0,external_wp_data_namespaceObject.useSelect)(select => { var _getSettings$colors; const { getSettings } = select(external_wp_blockEditor_namespaceObject.store); return (_getSettings$colors = getSettings().colors) !== null && _getSettings$colors !== void 0 ? _getSettings$colors : []; }, []); const onColorChange = (0,external_wp_element_namespaceObject.useCallback)(color => { onChange(setColors(value, name, colors, { [property]: color })); }, [colors, onChange, property]); const activeColors = (0,external_wp_element_namespaceObject.useMemo)(() => getActiveColors(value, name, colors), [name, value, colors]); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.ColorPalette, { value: activeColors[property], onChange: onColorChange }); } function InlineColorUI({ name, value, onChange, onClose, contentRef, isActive }) { const popoverAnchor = (0,external_wp_richText_namespaceObject.useAnchor)({ editableContentElement: contentRef.current, settings: { ...text_color_textColor, isActive } }); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Popover, { onClose: onClose, className: "format-library__inline-color-popover", anchor: popoverAnchor, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(Tabs, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Tabs.TabList, { children: TABS.map(tab => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Tabs.Tab, { tabId: tab.name, children: tab.title }, tab.name)) }), TABS.map(tab => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Tabs.TabPanel, { tabId: tab.name, focusable: false, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ColorPicker, { name: name, property: tab.name, value: value, onChange: onChange }) }, tab.name))] }) }); } ;// CONCATENATED MODULE: ./node_modules/@wordpress/format-library/build-module/text-color/index.js /** * WordPress dependencies */ /** * Internal dependencies */ const transparentValue = 'rgba(0, 0, 0, 0)'; const text_color_name = 'core/text-color'; const text_color_title = (0,external_wp_i18n_namespaceObject.__)('Highlight'); const EMPTY_ARRAY = []; function getComputedStyleProperty(element, property) { const { ownerDocument } = element; const { defaultView } = ownerDocument; const style = defaultView.getComputedStyle(element); const value = style.getPropertyValue(property); if (property === 'background-color' && value === transparentValue && element.parentElement) { return getComputedStyleProperty(element.parentElement, property); } return value; } function fillComputedColors(element, { color, backgroundColor }) { if (!color && !backgroundColor) { return; } return { color: color || getComputedStyleProperty(element, 'color'), backgroundColor: backgroundColor === transparentValue ? getComputedStyleProperty(element, 'background-color') : backgroundColor }; } function TextColorEdit({ value, onChange, isActive, activeAttributes, contentRef }) { const [allowCustomControl, colors = EMPTY_ARRAY] = (0,external_wp_blockEditor_namespaceObject.useSettings)('color.custom', 'color.palette'); const [isAddingColor, setIsAddingColor] = (0,external_wp_element_namespaceObject.useState)(false); const enableIsAddingColor = (0,external_wp_element_namespaceObject.useCallback)(() => setIsAddingColor(true), [setIsAddingColor]); const disableIsAddingColor = (0,external_wp_element_namespaceObject.useCallback)(() => setIsAddingColor(false), [setIsAddingColor]); const colorIndicatorStyle = (0,external_wp_element_namespaceObject.useMemo)(() => fillComputedColors(contentRef.current, getActiveColors(value, text_color_name, colors)), [value, colors]); const hasColorsToChoose = colors.length || !allowCustomControl; if (!hasColorsToChoose && !isActive) { return null; } return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichTextToolbarButton, { className: "format-library-text-color-button", isActive: isActive, icon: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(icon, { icon: Object.keys(activeAttributes).length ? text_color : library_color, style: colorIndicatorStyle }), title: text_color_title // If has no colors to choose but a color is active remove the color onClick. , onClick: hasColorsToChoose ? enableIsAddingColor : () => onChange((0,external_wp_richText_namespaceObject.removeFormat)(value, text_color_name)), role: "menuitemcheckbox" }), isAddingColor && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(InlineColorUI, { name: text_color_name, onClose: disableIsAddingColor, activeAttributes: activeAttributes, value: value, onChange: onChange, contentRef: contentRef, isActive: isActive })] }); } const text_color_textColor = { name: text_color_name, title: text_color_title, tagName: 'mark', className: 'has-inline-color', attributes: { style: 'style', class: 'class' }, edit: TextColorEdit }; ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/subscript.js /** * WordPress dependencies */ const subscript = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M16.9 18.3l.8-1.2c.4-.6.7-1.2.9-1.6.2-.4.3-.8.3-1.2 0-.3-.1-.7-.2-1-.1-.3-.4-.5-.6-.7-.3-.2-.6-.3-1-.3s-.8.1-1.1.2c-.3.1-.7.3-1 .6l.2 1.3c.3-.3.5-.5.8-.6s.6-.2.9-.2c.3 0 .5.1.7.2.2.2.2.4.2.7 0 .3-.1.5-.2.8-.1.3-.4.7-.8 1.3L15 19.4h4.3v-1.2h-2.4zM14.1 7.2h-2L9.5 11 6.9 7.2h-2l3.6 5.3L4.7 18h2l2.7-4 2.7 4h2l-3.8-5.5 3.8-5.3z" }) }); /* harmony default export */ const library_subscript = (subscript); ;// CONCATENATED MODULE: ./node_modules/@wordpress/format-library/build-module/subscript/index.js /** * WordPress dependencies */ const subscript_name = 'core/subscript'; const subscript_title = (0,external_wp_i18n_namespaceObject.__)('Subscript'); const subscript_subscript = { name: subscript_name, title: subscript_title, tagName: 'sub', className: null, edit({ isActive, value, onChange, onFocus }) { function onToggle() { onChange((0,external_wp_richText_namespaceObject.toggleFormat)(value, { type: subscript_name, title: subscript_title })); } function onClick() { onToggle(); onFocus(); } return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichTextToolbarButton, { icon: library_subscript, title: subscript_title, onClick: onClick, isActive: isActive, role: "menuitemcheckbox" }); } }; ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/superscript.js /** * WordPress dependencies */ const superscript = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M16.9 10.3l.8-1.3c.4-.6.7-1.2.9-1.6.2-.4.3-.8.3-1.2 0-.3-.1-.7-.2-1-.2-.2-.4-.4-.7-.6-.3-.2-.6-.3-1-.3s-.8.1-1.1.2c-.3.1-.7.3-1 .6l.1 1.3c.3-.3.5-.5.8-.6s.6-.2.9-.2c.3 0 .5.1.7.2.2.2.2.4.2.7 0 .3-.1.5-.2.8-.1.3-.4.7-.8 1.3l-1.8 2.8h4.3v-1.2h-2.2zm-2.8-3.1h-2L9.5 11 6.9 7.2h-2l3.6 5.3L4.7 18h2l2.7-4 2.7 4h2l-3.8-5.5 3.8-5.3z" }) }); /* harmony default export */ const library_superscript = (superscript); ;// CONCATENATED MODULE: ./node_modules/@wordpress/format-library/build-module/superscript/index.js /** * WordPress dependencies */ const superscript_name = 'core/superscript'; const superscript_title = (0,external_wp_i18n_namespaceObject.__)('Superscript'); const superscript_superscript = { name: superscript_name, title: superscript_title, tagName: 'sup', className: null, edit({ isActive, value, onChange, onFocus }) { function onToggle() { onChange((0,external_wp_richText_namespaceObject.toggleFormat)(value, { type: superscript_name, title: superscript_title })); } function onClick() { onToggle(); onFocus(); } return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichTextToolbarButton, { icon: library_superscript, title: superscript_title, onClick: onClick, isActive: isActive, role: "menuitemcheckbox" }); } }; ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/button.js /** * WordPress dependencies */ const button_button = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M8 12.5h8V11H8v1.5Z M19 6.5H5a2 2 0 0 0-2 2V15a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V8.5a2 2 0 0 0-2-2ZM5 8h14a.5.5 0 0 1 .5.5V15a.5.5 0 0 1-.5.5H5a.5.5 0 0 1-.5-.5V8.5A.5.5 0 0 1 5 8Z" }) }); /* harmony default export */ const library_button = (button_button); ;// CONCATENATED MODULE: ./node_modules/@wordpress/format-library/build-module/keyboard/index.js /** * WordPress dependencies */ const keyboard_name = 'core/keyboard'; const keyboard_title = (0,external_wp_i18n_namespaceObject.__)('Keyboard input'); const keyboard = { name: keyboard_name, title: keyboard_title, tagName: 'kbd', className: null, edit({ isActive, value, onChange, onFocus }) { function onToggle() { onChange((0,external_wp_richText_namespaceObject.toggleFormat)(value, { type: keyboard_name, title: keyboard_title })); } function onClick() { onToggle(); onFocus(); } return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichTextToolbarButton, { icon: library_button, title: keyboard_title, onClick: onClick, isActive: isActive, role: "menuitemcheckbox" }); } }; ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/help.js /** * WordPress dependencies */ const help = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M12 4.75a7.25 7.25 0 100 14.5 7.25 7.25 0 000-14.5zM3.25 12a8.75 8.75 0 1117.5 0 8.75 8.75 0 01-17.5 0zM12 8.75a1.5 1.5 0 01.167 2.99c-.465.052-.917.44-.917 1.01V14h1.5v-.845A3 3 0 109 10.25h1.5a1.5 1.5 0 011.5-1.5zM11.25 15v1.5h1.5V15h-1.5z" }) }); /* harmony default export */ const library_help = (help); ;// CONCATENATED MODULE: ./node_modules/@wordpress/format-library/build-module/unknown/index.js /** * WordPress dependencies */ const unknown_name = 'core/unknown'; const unknown_title = (0,external_wp_i18n_namespaceObject.__)('Clear Unknown Formatting'); function selectionContainsUnknownFormats(value) { if ((0,external_wp_richText_namespaceObject.isCollapsed)(value)) { return false; } const selectedValue = (0,external_wp_richText_namespaceObject.slice)(value); return selectedValue.formats.some(formats => { return formats.some(format => format.type === unknown_name); }); } const unknown = { name: unknown_name, title: unknown_title, tagName: '*', className: null, edit({ isActive, value, onChange, onFocus }) { if (!isActive && !selectionContainsUnknownFormats(value)) { return null; } function onClick() { onChange((0,external_wp_richText_namespaceObject.removeFormat)(value, unknown_name)); onFocus(); } return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichTextToolbarButton, { name: "unknown", icon: library_help, title: unknown_title, onClick: onClick, isActive: true }); } }; ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/language.js /** * WordPress dependencies */ const language = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M17.5 10h-1.7l-3.7 10.5h1.7l.9-2.6h3.9l.9 2.6h1.7L17.5 10zm-2.2 6.3 1.4-4 1.4 4h-2.8zm-4.8-3.8c1.6-1.8 2.9-3.6 3.7-5.7H16V5.2h-5.8V3H8.8v2.2H3v1.5h9.6c-.7 1.6-1.8 3.1-3.1 4.6C8.6 10.2 7.8 9 7.2 8H5.6c.6 1.4 1.7 2.9 2.9 4.4l-2.4 2.4c-.3.4-.7.8-1.1 1.2l1 1 1.2-1.2c.8-.8 1.6-1.5 2.3-2.3.8.9 1.7 1.7 2.5 2.5l.6-1.5c-.7-.6-1.4-1.3-2.1-2z" }) }); /* harmony default export */ const library_language = (language); ;// CONCATENATED MODULE: ./node_modules/@wordpress/format-library/build-module/language/index.js /** * WordPress dependencies */ /** * WordPress dependencies */ const language_name = 'core/language'; const language_title = (0,external_wp_i18n_namespaceObject.__)('Language'); const language_language = { name: language_name, tagName: 'bdo', className: null, edit: language_Edit, title: language_title }; function language_Edit({ isActive, value, onChange, contentRef }) { const [isPopoverVisible, setIsPopoverVisible] = (0,external_wp_element_namespaceObject.useState)(false); const togglePopover = () => { setIsPopoverVisible(state => !state); }; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichTextToolbarButton, { icon: library_language, label: language_title, title: language_title, onClick: () => { if (isActive) { onChange((0,external_wp_richText_namespaceObject.removeFormat)(value, language_name)); } else { togglePopover(); } }, isActive: isActive, role: "menuitemcheckbox" }), isPopoverVisible && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(InlineLanguageUI, { value: value, onChange: onChange, onClose: togglePopover, contentRef: contentRef })] }); } function InlineLanguageUI({ value, contentRef, onChange, onClose }) { const popoverAnchor = (0,external_wp_richText_namespaceObject.useAnchor)({ editableContentElement: contentRef.current, settings: language_language }); const [lang, setLang] = (0,external_wp_element_namespaceObject.useState)(''); const [dir, setDir] = (0,external_wp_element_namespaceObject.useState)('ltr'); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Popover, { className: "block-editor-format-toolbar__language-popover", anchor: popoverAnchor, onClose: onClose, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("form", { className: "block-editor-format-toolbar__language-container-content", onSubmit: event => { event.preventDefault(); onChange((0,external_wp_richText_namespaceObject.applyFormat)(value, { type: language_name, attributes: { lang, dir } })); onClose(); }, children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.TextControl, { label: language_title, value: lang, onChange: val => setLang(val), help: (0,external_wp_i18n_namespaceObject.__)('A valid language attribute, like "en" or "fr".') }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SelectControl, { label: (0,external_wp_i18n_namespaceObject.__)('Text direction'), value: dir, options: [{ label: (0,external_wp_i18n_namespaceObject.__)('Left to right'), value: 'ltr' }, { label: (0,external_wp_i18n_namespaceObject.__)('Right to left'), value: 'rtl' }], onChange: val => setDir(val) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalHStack, { alignment: "right", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { variant: "primary", type: "submit", text: (0,external_wp_i18n_namespaceObject.__)('Apply') }) })] }) }); } ;// CONCATENATED MODULE: ./node_modules/@wordpress/format-library/build-module/non-breaking-space/index.js /** * WordPress dependencies */ const non_breaking_space_name = 'core/non-breaking-space'; const non_breaking_space_title = (0,external_wp_i18n_namespaceObject.__)('Non breaking space'); const nonBreakingSpace = { name: non_breaking_space_name, title: non_breaking_space_title, tagName: 'nbsp', className: null, edit({ value, onChange }) { function addNonBreakingSpace() { onChange((0,external_wp_richText_namespaceObject.insert)(value, '\u00a0')); } return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichTextShortcut, { type: "primaryShift", character: " ", onUse: addNonBreakingSpace }); } }; ;// CONCATENATED MODULE: ./node_modules/@wordpress/format-library/build-module/default-formats.js /** * Internal dependencies */ /* harmony default export */ const default_formats = ([bold, code_code, image_image, italic, build_module_link_link, strikethrough, underline, text_color_textColor, subscript_subscript, superscript_superscript, keyboard, unknown, language_language, nonBreakingSpace]); ;// CONCATENATED MODULE: ./node_modules/@wordpress/format-library/build-module/index.js /** * WordPress dependencies */ /** * Internal dependencies */ default_formats.forEach(({ name, ...settings }) => (0,external_wp_richText_namespaceObject.registerFormatType)(name, settings)); (window.wp = window.wp || {}).formatLibrary = __webpack_exports__; /******/ })() ;dom.js000064400000172723147177406350005713 0ustar00/******/ (() => { // webpackBootstrap /******/ "use strict"; /******/ // The require scope /******/ var __webpack_require__ = {}; /******/ /************************************************************************/ /******/ /* webpack/runtime/compat get default export */ /******/ (() => { /******/ // getDefaultExport function for compatibility with non-harmony modules /******/ __webpack_require__.n = (module) => { /******/ var getter = module && module.__esModule ? /******/ () => (module['default']) : /******/ () => (module); /******/ __webpack_require__.d(getter, { a: getter }); /******/ return getter; /******/ }; /******/ })(); /******/ /******/ /* webpack/runtime/define property getters */ /******/ (() => { /******/ // define getter functions for harmony exports /******/ __webpack_require__.d = (exports, definition) => { /******/ for(var key in definition) { /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); /******/ } /******/ } /******/ }; /******/ })(); /******/ /******/ /* webpack/runtime/hasOwnProperty shorthand */ /******/ (() => { /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) /******/ })(); /******/ /******/ /* webpack/runtime/make namespace object */ /******/ (() => { /******/ // define __esModule on exports /******/ __webpack_require__.r = (exports) => { /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); /******/ } /******/ Object.defineProperty(exports, '__esModule', { value: true }); /******/ }; /******/ })(); /******/ /************************************************************************/ var __webpack_exports__ = {}; // ESM COMPAT FLAG __webpack_require__.r(__webpack_exports__); // EXPORTS __webpack_require__.d(__webpack_exports__, { __unstableStripHTML: () => (/* reexport */ stripHTML), computeCaretRect: () => (/* reexport */ computeCaretRect), documentHasSelection: () => (/* reexport */ documentHasSelection), documentHasTextSelection: () => (/* reexport */ documentHasTextSelection), documentHasUncollapsedSelection: () => (/* reexport */ documentHasUncollapsedSelection), focus: () => (/* binding */ build_module_focus), getFilesFromDataTransfer: () => (/* reexport */ getFilesFromDataTransfer), getOffsetParent: () => (/* reexport */ getOffsetParent), getPhrasingContentSchema: () => (/* reexport */ getPhrasingContentSchema), getRectangleFromRange: () => (/* reexport */ getRectangleFromRange), getScrollContainer: () => (/* reexport */ getScrollContainer), insertAfter: () => (/* reexport */ insertAfter), isEmpty: () => (/* reexport */ isEmpty), isEntirelySelected: () => (/* reexport */ isEntirelySelected), isFormElement: () => (/* reexport */ isFormElement), isHorizontalEdge: () => (/* reexport */ isHorizontalEdge), isNumberInput: () => (/* reexport */ isNumberInput), isPhrasingContent: () => (/* reexport */ isPhrasingContent), isRTL: () => (/* reexport */ isRTL), isTextContent: () => (/* reexport */ isTextContent), isTextField: () => (/* reexport */ isTextField), isVerticalEdge: () => (/* reexport */ isVerticalEdge), placeCaretAtHorizontalEdge: () => (/* reexport */ placeCaretAtHorizontalEdge), placeCaretAtVerticalEdge: () => (/* reexport */ placeCaretAtVerticalEdge), remove: () => (/* reexport */ remove), removeInvalidHTML: () => (/* reexport */ removeInvalidHTML), replace: () => (/* reexport */ replace), replaceTag: () => (/* reexport */ replaceTag), safeHTML: () => (/* reexport */ safeHTML), unwrap: () => (/* reexport */ unwrap), wrap: () => (/* reexport */ wrap) }); // NAMESPACE OBJECT: ./node_modules/@wordpress/dom/build-module/focusable.js var focusable_namespaceObject = {}; __webpack_require__.r(focusable_namespaceObject); __webpack_require__.d(focusable_namespaceObject, { find: () => (find) }); // NAMESPACE OBJECT: ./node_modules/@wordpress/dom/build-module/tabbable.js var tabbable_namespaceObject = {}; __webpack_require__.r(tabbable_namespaceObject); __webpack_require__.d(tabbable_namespaceObject, { find: () => (tabbable_find), findNext: () => (findNext), findPrevious: () => (findPrevious), isTabbableIndex: () => (isTabbableIndex) }); ;// CONCATENATED MODULE: ./node_modules/@wordpress/dom/build-module/focusable.js /** * References: * * Focusable: * - https://www.w3.org/TR/html5/editing.html#focus-management * * Sequential focus navigation: * - https://www.w3.org/TR/html5/editing.html#sequential-focus-navigation-and-the-tabindex-attribute * * Disabled elements: * - https://www.w3.org/TR/html5/disabled-elements.html#disabled-elements * * getClientRects algorithm (requiring layout box): * - https://www.w3.org/TR/cssom-view-1/#extension-to-the-element-interface * * AREA elements associated with an IMG: * - https://w3c.github.io/html/editing.html#data-model */ /** * Returns a CSS selector used to query for focusable elements. * * @param {boolean} sequential If set, only query elements that are sequentially * focusable. Non-interactive elements with a * negative `tabindex` are focusable but not * sequentially focusable. * https://html.spec.whatwg.org/multipage/interaction.html#the-tabindex-attribute * * @return {string} CSS selector. */ function buildSelector(sequential) { return [sequential ? '[tabindex]:not([tabindex^="-"])' : '[tabindex]', 'a[href]', 'button:not([disabled])', 'input:not([type="hidden"]):not([disabled])', 'select:not([disabled])', 'textarea:not([disabled])', 'iframe:not([tabindex^="-"])', 'object', 'embed', 'area[href]', '[contenteditable]:not([contenteditable=false])'].join(','); } /** * Returns true if the specified element is visible (i.e. neither display: none * nor visibility: hidden). * * @param {HTMLElement} element DOM element to test. * * @return {boolean} Whether element is visible. */ function isVisible(element) { return element.offsetWidth > 0 || element.offsetHeight > 0 || element.getClientRects().length > 0; } /** * Returns true if the specified area element is a valid focusable element, or * false otherwise. Area is only focusable if within a map where a named map * referenced by an image somewhere in the document. * * @param {HTMLAreaElement} element DOM area element to test. * * @return {boolean} Whether area element is valid for focus. */ function isValidFocusableArea(element) { /** @type {HTMLMapElement | null} */ const map = element.closest('map[name]'); if (!map) { return false; } /** @type {HTMLImageElement | null} */ const img = element.ownerDocument.querySelector('img[usemap="#' + map.name + '"]'); return !!img && isVisible(img); } /** * Returns all focusable elements within a given context. * * @param {Element} context Element in which to search. * @param {Object} options * @param {boolean} [options.sequential] If set, only return elements that are * sequentially focusable. * Non-interactive elements with a * negative `tabindex` are focusable but * not sequentially focusable. * https://html.spec.whatwg.org/multipage/interaction.html#the-tabindex-attribute * * @return {HTMLElement[]} Focusable elements. */ function find(context, { sequential = false } = {}) { /** @type {NodeListOf} */ const elements = context.querySelectorAll(buildSelector(sequential)); return Array.from(elements).filter(element => { if (!isVisible(element)) { return false; } const { nodeName } = element; if ('AREA' === nodeName) { return isValidFocusableArea( /** @type {HTMLAreaElement} */element); } return true; }); } ;// CONCATENATED MODULE: ./node_modules/@wordpress/dom/build-module/tabbable.js /** * Internal dependencies */ /** * Returns the tab index of the given element. In contrast with the tabIndex * property, this normalizes the default (0) to avoid browser inconsistencies, * operating under the assumption that this function is only ever called with a * focusable node. * * @see https://bugzilla.mozilla.org/show_bug.cgi?id=1190261 * * @param {Element} element Element from which to retrieve. * * @return {number} Tab index of element (default 0). */ function getTabIndex(element) { const tabIndex = element.getAttribute('tabindex'); return tabIndex === null ? 0 : parseInt(tabIndex, 10); } /** * Returns true if the specified element is tabbable, or false otherwise. * * @param {Element} element Element to test. * * @return {boolean} Whether element is tabbable. */ function isTabbableIndex(element) { return getTabIndex(element) !== -1; } /** @typedef {HTMLElement & { type?: string, checked?: boolean, name?: string }} MaybeHTMLInputElement */ /** * Returns a stateful reducer function which constructs a filtered array of * tabbable elements, where at most one radio input is selected for a given * name, giving priority to checked input, falling back to the first * encountered. * * @return {(acc: MaybeHTMLInputElement[], el: MaybeHTMLInputElement) => MaybeHTMLInputElement[]} Radio group collapse reducer. */ function createStatefulCollapseRadioGroup() { /** @type {Record} */ const CHOSEN_RADIO_BY_NAME = {}; return function collapseRadioGroup( /** @type {MaybeHTMLInputElement[]} */result, /** @type {MaybeHTMLInputElement} */element) { const { nodeName, type, checked, name } = element; // For all non-radio tabbables, construct to array by concatenating. if (nodeName !== 'INPUT' || type !== 'radio' || !name) { return result.concat(element); } const hasChosen = CHOSEN_RADIO_BY_NAME.hasOwnProperty(name); // Omit by skipping concatenation if the radio element is not chosen. const isChosen = checked || !hasChosen; if (!isChosen) { return result; } // At this point, if there had been a chosen element, the current // element is checked and should take priority. Retroactively remove // the element which had previously been considered the chosen one. if (hasChosen) { const hadChosenElement = CHOSEN_RADIO_BY_NAME[name]; result = result.filter(e => e !== hadChosenElement); } CHOSEN_RADIO_BY_NAME[name] = element; return result.concat(element); }; } /** * An array map callback, returning an object with the element value and its * array index location as properties. This is used to emulate a proper stable * sort where equal tabIndex should be left in order of their occurrence in the * document. * * @param {HTMLElement} element Element. * @param {number} index Array index of element. * * @return {{ element: HTMLElement, index: number }} Mapped object with element, index. */ function mapElementToObjectTabbable(element, index) { return { element, index }; } /** * An array map callback, returning an element of the given mapped object's * element value. * * @param {{ element: HTMLElement }} object Mapped object with element. * * @return {HTMLElement} Mapped object element. */ function mapObjectTabbableToElement(object) { return object.element; } /** * A sort comparator function used in comparing two objects of mapped elements. * * @see mapElementToObjectTabbable * * @param {{ element: HTMLElement, index: number }} a First object to compare. * @param {{ element: HTMLElement, index: number }} b Second object to compare. * * @return {number} Comparator result. */ function compareObjectTabbables(a, b) { const aTabIndex = getTabIndex(a.element); const bTabIndex = getTabIndex(b.element); if (aTabIndex === bTabIndex) { return a.index - b.index; } return aTabIndex - bTabIndex; } /** * Givin focusable elements, filters out tabbable element. * * @param {HTMLElement[]} focusables Focusable elements to filter. * * @return {HTMLElement[]} Tabbable elements. */ function filterTabbable(focusables) { return focusables.filter(isTabbableIndex).map(mapElementToObjectTabbable).sort(compareObjectTabbables).map(mapObjectTabbableToElement).reduce(createStatefulCollapseRadioGroup(), []); } /** * @param {Element} context * @return {HTMLElement[]} Tabbable elements within the context. */ function tabbable_find(context) { return filterTabbable(find(context)); } /** * Given a focusable element, find the preceding tabbable element. * * @param {Element} element The focusable element before which to look. Defaults * to the active element. * * @return {HTMLElement|undefined} Preceding tabbable element. */ function findPrevious(element) { return filterTabbable(find(element.ownerDocument.body)).reverse().find(focusable => // eslint-disable-next-line no-bitwise element.compareDocumentPosition(focusable) & element.DOCUMENT_POSITION_PRECEDING); } /** * Given a focusable element, find the next tabbable element. * * @param {Element} element The focusable element after which to look. Defaults * to the active element. * * @return {HTMLElement|undefined} Next tabbable element. */ function findNext(element) { return filterTabbable(find(element.ownerDocument.body)).find(focusable => // eslint-disable-next-line no-bitwise element.compareDocumentPosition(focusable) & element.DOCUMENT_POSITION_FOLLOWING); } ;// CONCATENATED MODULE: ./node_modules/@wordpress/dom/build-module/utils/assert-is-defined.js function assertIsDefined(val, name) { if (false) {} } ;// CONCATENATED MODULE: ./node_modules/@wordpress/dom/build-module/dom/get-rectangle-from-range.js /** * Internal dependencies */ /** * Get the rectangle of a given Range. Returns `null` if no suitable rectangle * can be found. * * @param {Range} range The range. * * @return {DOMRect?} The rectangle. */ function getRectangleFromRange(range) { // For uncollapsed ranges, get the rectangle that bounds the contents of the // range; this a rectangle enclosing the union of the bounding rectangles // for all the elements in the range. if (!range.collapsed) { const rects = Array.from(range.getClientRects()); // If there's just a single rect, return it. if (rects.length === 1) { return rects[0]; } // Ignore tiny selection at the edge of a range. const filteredRects = rects.filter(({ width }) => width > 1); // If it's full of tiny selections, return browser default. if (filteredRects.length === 0) { return range.getBoundingClientRect(); } if (filteredRects.length === 1) { return filteredRects[0]; } let { top: furthestTop, bottom: furthestBottom, left: furthestLeft, right: furthestRight } = filteredRects[0]; for (const { top, bottom, left, right } of filteredRects) { if (top < furthestTop) { furthestTop = top; } if (bottom > furthestBottom) { furthestBottom = bottom; } if (left < furthestLeft) { furthestLeft = left; } if (right > furthestRight) { furthestRight = right; } } return new window.DOMRect(furthestLeft, furthestTop, furthestRight - furthestLeft, furthestBottom - furthestTop); } const { startContainer } = range; const { ownerDocument } = startContainer; // Correct invalid "BR" ranges. The cannot contain any children. if (startContainer.nodeName === 'BR') { const { parentNode } = startContainer; assertIsDefined(parentNode, 'parentNode'); const index = /** @type {Node[]} */Array.from(parentNode.childNodes).indexOf(startContainer); assertIsDefined(ownerDocument, 'ownerDocument'); range = ownerDocument.createRange(); range.setStart(parentNode, index); range.setEnd(parentNode, index); } const rects = range.getClientRects(); // If we have multiple rectangles for a collapsed range, there's no way to // know which it is, so don't return anything. if (rects.length > 1) { return null; } let rect = rects[0]; // If the collapsed range starts (and therefore ends) at an element node, // `getClientRects` can be empty in some browsers. This can be resolved // by adding a temporary text node with zero-width space to the range. // // See: https://stackoverflow.com/a/6847328/995445 if (!rect || rect.height === 0) { assertIsDefined(ownerDocument, 'ownerDocument'); const padNode = ownerDocument.createTextNode('\u200b'); // Do not modify the live range. range = range.cloneRange(); range.insertNode(padNode); rect = range.getClientRects()[0]; assertIsDefined(padNode.parentNode, 'padNode.parentNode'); padNode.parentNode.removeChild(padNode); } return rect; } ;// CONCATENATED MODULE: ./node_modules/@wordpress/dom/build-module/dom/compute-caret-rect.js /** * Internal dependencies */ /** * Get the rectangle for the selection in a container. * * @param {Window} win The window of the selection. * * @return {DOMRect | null} The rectangle. */ function computeCaretRect(win) { const selection = win.getSelection(); assertIsDefined(selection, 'selection'); const range = selection.rangeCount ? selection.getRangeAt(0) : null; if (!range) { return null; } return getRectangleFromRange(range); } ;// CONCATENATED MODULE: ./node_modules/@wordpress/dom/build-module/dom/document-has-text-selection.js /** * Internal dependencies */ /** * Check whether the current document has selected text. This applies to ranges * of text in the document, and not selection inside `` and ` * * ); * ); * ``` */ const UnconnectedBaseControl = props => { const { __nextHasNoMarginBottom = false, id, label, hideLabelFromVision = false, help, className, children } = useContextSystem(props, 'BaseControl'); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(base_control_styles_Wrapper, { className: className, children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(StyledField, { className: "components-base-control__field" // TODO: Official deprecation for this should start after all internal usages have been migrated , __nextHasNoMarginBottom: __nextHasNoMarginBottom, children: [label && id && (hideLabelFromVision ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(visually_hidden_component, { as: "label", htmlFor: id, children: label }) : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(StyledLabel, { className: "components-base-control__label", htmlFor: id, children: label })), label && !id && (hideLabelFromVision ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(visually_hidden_component, { as: "label", children: label }) : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(VisualLabel, { children: label })), children] }), !!help && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(StyledHelp, { id: id ? id + '__help' : undefined, className: "components-base-control__help", __nextHasNoMarginBottom: __nextHasNoMarginBottom, children: help })] }); }; /** * `BaseControl.VisualLabel` is used to render a purely visual label inside a `BaseControl` component. * * It should only be used in cases where the children being rendered inside `BaseControl` are already accessibly labeled, * e.g., a button, but we want an additional visual label for that section equivalent to the labels `BaseControl` would * otherwise use if the `label` prop was passed. * * @example * import { BaseControl } from '@wordpress/components'; * * const MyBaseControl = () => ( * * Author * * * ); */ const VisualLabel = ({ className, children, ...props }) => { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(StyledVisualLabel, { ...props, className: dist_clsx('components-base-control__label', className), children: children }); }; const BaseControl = Object.assign(contextConnectWithoutRef(UnconnectedBaseControl, 'BaseControl'), { VisualLabel }); /* harmony default export */ const base_control = (BaseControl); ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/input-control/index.js /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ const input_control_noop = () => {}; function input_control_useUniqueId(idProp) { const instanceId = (0,external_wp_compose_namespaceObject.useInstanceId)(InputControl); const id = `inspector-input-control-${instanceId}`; return idProp || id; } function UnforwardedInputControl(props, ref) { const { __next40pxDefaultSize, __unstableStateReducer: stateReducer = state => state, __unstableInputWidth, className, disabled = false, help, hideLabelFromVision = false, id: idProp, isPressEnterToChange = false, label, labelPosition = 'top', onChange = input_control_noop, onValidate = input_control_noop, onKeyDown = input_control_noop, prefix, size = 'default', style, suffix, value, ...restProps } = useDeprecated36pxDefaultSizeProp(props); const id = input_control_useUniqueId(idProp); const classes = dist_clsx('components-input-control', className); const draftHookProps = useDraft({ value, onBlur: restProps.onBlur, onChange }); const helpProp = !!help ? { 'aria-describedby': `${id}__help` } : {}; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(base_control, { className: classes, help: help, id: id, __nextHasNoMarginBottom: true, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(input_base, { __next40pxDefaultSize: __next40pxDefaultSize, __unstableInputWidth: __unstableInputWidth, disabled: disabled, gap: 3, hideLabelFromVision: hideLabelFromVision, id: id, justify: "left", label: label, labelPosition: labelPosition, prefix: prefix, size: size, style: style, suffix: suffix, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(input_field, { ...restProps, ...helpProp, __next40pxDefaultSize: __next40pxDefaultSize, className: "components-input-control__input", disabled: disabled, id: id, isPressEnterToChange: isPressEnterToChange, onKeyDown: onKeyDown, onValidate: onValidate, paddingInlineStart: prefix ? space(2) : undefined, paddingInlineEnd: suffix ? space(2) : undefined, ref: ref, size: size, stateReducer: stateReducer, ...draftHookProps }) }) }); } /** * InputControl components let users enter and edit text. This is an experimental component * intended to (in time) merge with or replace `TextControl`. * * ```jsx * import { __experimentalInputControl as InputControl } from '@wordpress/components'; * import { useState } from 'react'; * * const Example = () => { * const [ value, setValue ] = useState( '' ); * * return ( * setValue( nextValue ?? '' ) } * /> * ); * }; * ``` */ const InputControl = (0,external_wp_element_namespaceObject.forwardRef)(UnforwardedInputControl); /* harmony default export */ const input_control = (InputControl); ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/dashicon/index.js /** * @typedef OwnProps * * @property {import('./types').IconKey} icon Icon name * @property {string} [className] Class name * @property {number} [size] Size of the icon */ /** * Internal dependencies */ function Dashicon({ icon, className, size = 20, style = {}, ...extraProps }) { const iconClass = ['dashicon', 'dashicons', 'dashicons-' + icon, className].filter(Boolean).join(' '); // For retro-compatibility reasons (for example if people are overriding icon size with CSS), we add inline styles just if the size is different to the default const sizeStyles = // using `!=` to catch both 20 and "20" // eslint-disable-next-line eqeqeq 20 != size ? { fontSize: `${size}px`, width: `${size}px`, height: `${size}px` } : {}; const styles = { ...sizeStyles, ...style }; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { className: iconClass, style: styles, ...extraProps }); } /* harmony default export */ const dashicon = (Dashicon); ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/icon/index.js /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ function Icon({ icon = null, size = 'string' === typeof icon ? 20 : 24, ...additionalProps }) { if ('string' === typeof icon) { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(dashicon, { icon: icon, size: size, ...additionalProps }); } if ((0,external_wp_element_namespaceObject.isValidElement)(icon) && dashicon === icon.type) { return (0,external_wp_element_namespaceObject.cloneElement)(icon, { ...additionalProps }); } if ('function' === typeof icon) { return (0,external_wp_element_namespaceObject.createElement)(icon, { size, ...additionalProps }); } if (icon && (icon.type === 'svg' || icon.type === external_wp_primitives_namespaceObject.SVG)) { const appliedProps = { ...icon.props, width: size, height: size, ...additionalProps }; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { ...appliedProps }); } if ((0,external_wp_element_namespaceObject.isValidElement)(icon)) { return (0,external_wp_element_namespaceObject.cloneElement)(icon, { // @ts-ignore Just forwarding the size prop along size, ...additionalProps }); } return icon; } /* harmony default export */ const build_module_icon = (Icon); ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/button/index.js /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ const disabledEventsOnDisabledButton = ['onMouseDown', 'onClick']; function button_useDeprecatedProps({ isDefault, isPrimary, isSecondary, isTertiary, isLink, isPressed, isSmall, size, variant, ...otherProps }) { let computedSize = size; let computedVariant = variant; const newProps = { // @todo Mark `isPressed` as deprecated 'aria-pressed': isPressed }; if (isSmall) { var _computedSize; (_computedSize = computedSize) !== null && _computedSize !== void 0 ? _computedSize : computedSize = 'small'; } if (isPrimary) { var _computedVariant; (_computedVariant = computedVariant) !== null && _computedVariant !== void 0 ? _computedVariant : computedVariant = 'primary'; } if (isTertiary) { var _computedVariant2; (_computedVariant2 = computedVariant) !== null && _computedVariant2 !== void 0 ? _computedVariant2 : computedVariant = 'tertiary'; } if (isSecondary) { var _computedVariant3; (_computedVariant3 = computedVariant) !== null && _computedVariant3 !== void 0 ? _computedVariant3 : computedVariant = 'secondary'; } if (isDefault) { var _computedVariant4; external_wp_deprecated_default()('wp.components.Button `isDefault` prop', { since: '5.4', alternative: 'variant="secondary"' }); (_computedVariant4 = computedVariant) !== null && _computedVariant4 !== void 0 ? _computedVariant4 : computedVariant = 'secondary'; } if (isLink) { var _computedVariant5; (_computedVariant5 = computedVariant) !== null && _computedVariant5 !== void 0 ? _computedVariant5 : computedVariant = 'link'; } return { ...newProps, ...otherProps, size: computedSize, variant: computedVariant }; } function UnforwardedButton(props, ref) { const { __next40pxDefaultSize, isBusy, isDestructive, className, disabled, icon, iconPosition = 'left', iconSize, showTooltip, tooltipPosition, shortcut, label, children, size = 'default', text, variant, __experimentalIsFocusable: isFocusable, describedBy, ...buttonOrAnchorProps } = button_useDeprecatedProps(props); const { href, target, 'aria-checked': ariaChecked, 'aria-pressed': ariaPressed, 'aria-selected': ariaSelected, ...additionalProps } = 'href' in buttonOrAnchorProps ? buttonOrAnchorProps : { href: undefined, target: undefined, ...buttonOrAnchorProps }; const instanceId = (0,external_wp_compose_namespaceObject.useInstanceId)(Button, 'components-button__description'); const hasChildren = 'string' === typeof children && !!children || Array.isArray(children) && children?.[0] && children[0] !== null && // Tooltip should not considered as a child children?.[0]?.props?.className !== 'components-tooltip'; const truthyAriaPressedValues = [true, 'true', 'mixed']; const classes = dist_clsx('components-button', className, { 'is-next-40px-default-size': __next40pxDefaultSize, 'is-secondary': variant === 'secondary', 'is-primary': variant === 'primary', 'is-small': size === 'small', 'is-compact': size === 'compact', 'is-tertiary': variant === 'tertiary', 'is-pressed': truthyAriaPressedValues.includes(ariaPressed), 'is-pressed-mixed': ariaPressed === 'mixed', 'is-busy': isBusy, 'is-link': variant === 'link', 'is-destructive': isDestructive, 'has-text': !!icon && (hasChildren || text), 'has-icon': !!icon }); const trulyDisabled = disabled && !isFocusable; const Tag = href !== undefined && !trulyDisabled ? 'a' : 'button'; const buttonProps = Tag === 'button' ? { type: 'button', disabled: trulyDisabled, 'aria-checked': ariaChecked, 'aria-pressed': ariaPressed, 'aria-selected': ariaSelected } : {}; const anchorProps = Tag === 'a' ? { href, target } : {}; const disableEventProps = {}; if (disabled && isFocusable) { // In this case, the button will be disabled, but still focusable and // perceivable by screen reader users. buttonProps['aria-disabled'] = true; anchorProps['aria-disabled'] = true; for (const disabledEvent of disabledEventsOnDisabledButton) { disableEventProps[disabledEvent] = event => { if (event) { event.stopPropagation(); event.preventDefault(); } }; } } // Should show the tooltip if... const shouldShowTooltip = !trulyDisabled && ( // An explicit tooltip is passed or... showTooltip && !!label || // There's a shortcut or... !!shortcut || // There's a label and... !!label && // The children are empty and... !children?.length && // The tooltip is not explicitly disabled. false !== showTooltip); const descriptionId = describedBy ? instanceId : undefined; const describedById = additionalProps['aria-describedby'] || descriptionId; const commonProps = { className: classes, 'aria-label': additionalProps['aria-label'] || label, 'aria-describedby': describedById, ref }; const elementChildren = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [icon && iconPosition === 'left' && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(build_module_icon, { icon: icon, size: iconSize }), text && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: text }), children, icon && iconPosition === 'right' && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(build_module_icon, { icon: icon, size: iconSize })] }); const element = Tag === 'a' ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("a", { ...anchorProps, ...additionalProps, ...disableEventProps, ...commonProps, children: elementChildren }) : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("button", { ...buttonProps, ...additionalProps, ...disableEventProps, ...commonProps, children: elementChildren }); // In order to avoid some React reconciliation issues, we are always rendering // the `Tooltip` component even when `shouldShowTooltip` is `false`. // In order to make sure that the tooltip doesn't show when it shouldn't, // we don't pass the props to the `Tooltip` component. const tooltipProps = shouldShowTooltip ? { text: children?.length && describedBy ? describedBy : label, shortcut, placement: tooltipPosition && // Convert legacy `position` values to be used with the new `placement` prop positionToPlacement(tooltipPosition) } : {}; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(tooltip, { ...tooltipProps, children: element }), describedBy && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(visually_hidden_component, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { id: descriptionId, children: describedBy }) })] }); } /** * Lets users take actions and make choices with a single click or tap. * * ```jsx * import { Button } from '@wordpress/components'; * const Mybutton = () => ( * * ); * ``` */ const Button = (0,external_wp_element_namespaceObject.forwardRef)(UnforwardedButton); /* harmony default export */ const build_module_button = (Button); ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/number-control/styles/number-control-styles.js function number_control_styles_EMOTION_STRINGIFIED_CSS_ERROR_() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; } /** * External dependencies */ /** * Internal dependencies */ var number_control_styles_ref = true ? { name: "euqsgg", styles: "input[type='number']::-webkit-outer-spin-button,input[type='number']::-webkit-inner-spin-button{-webkit-appearance:none!important;margin:0!important;}input[type='number']{-moz-appearance:textfield;}" } : 0; const htmlArrowStyles = ({ hideHTMLArrows }) => { if (!hideHTMLArrows) { return ``; } return number_control_styles_ref; }; const number_control_styles_Input = /*#__PURE__*/emotion_styled_base_browser_esm(input_control, true ? { target: "ep09it41" } : 0)(htmlArrowStyles, ";" + ( true ? "" : 0)); const SpinButton = /*#__PURE__*/emotion_styled_base_browser_esm(build_module_button, true ? { target: "ep09it40" } : 0)("&&&&&{color:", COLORS.theme.accent, ";}" + ( true ? "" : 0)); const smallSpinButtons = /*#__PURE__*/emotion_react_browser_esm_css("width:", space(5), ";min-width:", space(5), ";height:", space(5), ";" + ( true ? "" : 0), true ? "" : 0); const styles = { smallSpinButtons }; ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/utils/math.js /** * Parses and retrieves a number value. * * @param {unknown} value The incoming value. * * @return {number} The parsed number value. */ function getNumber(value) { const number = Number(value); return isNaN(number) ? 0 : number; } /** * Safely adds 2 values. * * @param {Array} args Values to add together. * * @return {number} The sum of values. */ function add(...args) { return args.reduce( /** @type {(sum:number, arg: number|string) => number} */ (sum, arg) => sum + getNumber(arg), 0); } /** * Safely subtracts 2 values. * * @param {Array} args Values to subtract together. * * @return {number} The difference of the values. */ function subtract(...args) { return args.reduce( /** @type {(diff:number, arg: number|string, index:number) => number} */ (diff, arg, index) => { const value = getNumber(arg); return index === 0 ? value : diff - value; }, 0); } /** * Determines the decimal position of a number value. * * @param {number} value The number to evaluate. * * @return {number} The number of decimal places. */ function getPrecision(value) { const split = (value + '').split('.'); return split[1] !== undefined ? split[1].length : 0; } /** * Clamps a value based on a min/max range. * * @param {number} value The value. * @param {number} min The minimum range. * @param {number} max The maximum range. * * @return {number} The clamped value. */ function math_clamp(value, min, max) { const baseValue = getNumber(value); return Math.max(min, Math.min(baseValue, max)); } /** * Clamps a value based on a min/max range with rounding * * @param {number | string} value The value. * @param {number} min The minimum range. * @param {number} max The maximum range. * @param {number} step A multiplier for the value. * * @return {number} The rounded and clamped value. */ function roundClamp(value = 0, min = Infinity, max = Infinity, step = 1) { const baseValue = getNumber(value); const stepValue = getNumber(step); const precision = getPrecision(step); const rounded = Math.round(baseValue / stepValue) * stepValue; const clampedValue = math_clamp(rounded, min, max); return precision ? getNumber(clampedValue.toFixed(precision)) : clampedValue; } ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/h-stack/utils.js /** * External dependencies */ /** * Internal dependencies */ const H_ALIGNMENTS = { bottom: { align: 'flex-end', justify: 'center' }, bottomLeft: { align: 'flex-end', justify: 'flex-start' }, bottomRight: { align: 'flex-end', justify: 'flex-end' }, center: { align: 'center', justify: 'center' }, edge: { align: 'center', justify: 'space-between' }, left: { align: 'center', justify: 'flex-start' }, right: { align: 'center', justify: 'flex-end' }, stretch: { align: 'stretch' }, top: { align: 'flex-start', justify: 'center' }, topLeft: { align: 'flex-start', justify: 'flex-start' }, topRight: { align: 'flex-start', justify: 'flex-end' } }; const V_ALIGNMENTS = { bottom: { justify: 'flex-end', align: 'center' }, bottomLeft: { justify: 'flex-end', align: 'flex-start' }, bottomRight: { justify: 'flex-end', align: 'flex-end' }, center: { justify: 'center', align: 'center' }, edge: { justify: 'space-between', align: 'center' }, left: { justify: 'center', align: 'flex-start' }, right: { justify: 'center', align: 'flex-end' }, stretch: { align: 'stretch' }, top: { justify: 'flex-start', align: 'center' }, topLeft: { justify: 'flex-start', align: 'flex-start' }, topRight: { justify: 'flex-start', align: 'flex-end' } }; function getAlignmentProps(alignment, direction = 'row') { if (!isValueDefined(alignment)) { return {}; } const isVertical = direction === 'column'; const props = isVertical ? V_ALIGNMENTS : H_ALIGNMENTS; const alignmentProps = alignment in props ? props[alignment] : { align: alignment }; return alignmentProps; } ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/utils/get-valid-children.js /** * External dependencies */ /** * WordPress dependencies */ /** * Gets a collection of available children elements from a React component's children prop. * * @param children * * @return An array of available children. */ function getValidChildren(children) { if (typeof children === 'string') { return [children]; } return external_wp_element_namespaceObject.Children.toArray(children).filter(child => (0,external_wp_element_namespaceObject.isValidElement)(child)); } ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/h-stack/hook.js /** * External dependencies */ /** * Internal dependencies */ function useHStack(props) { const { alignment = 'edge', children, direction, spacing = 2, ...otherProps } = useContextSystem(props, 'HStack'); const align = getAlignmentProps(alignment, direction); const validChildren = getValidChildren(children); const clonedChildren = validChildren.map((child, index) => { const _isSpacer = hasConnectNamespace(child, ['Spacer']); if (_isSpacer) { const childElement = child; const _key = childElement.key || `hstack-${index}`; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(flex_item_component, { isBlock: true, ...childElement.props }, _key); } return child; }); const propsForFlex = { children: clonedChildren, direction, justify: 'center', ...align, ...otherProps, gap: spacing }; // Omit `isColumn` because it's not used in HStack. const { isColumn, ...flexProps } = useFlex(propsForFlex); return flexProps; } ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/h-stack/component.js /** * Internal dependencies */ function UnconnectedHStack(props, forwardedRef) { const hStackProps = useHStack(props); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(component, { ...hStackProps, ref: forwardedRef }); } /** * `HStack` (Horizontal Stack) arranges child elements in a horizontal line. * * `HStack` can render anything inside. * * ```jsx * import { * __experimentalHStack as HStack, * __experimentalText as Text, * } from `@wordpress/components`; * * function Example() { * return ( * * Code * is * Poetry * * ); * } * ``` */ const HStack = contextConnect(UnconnectedHStack, 'HStack'); /* harmony default export */ const h_stack_component = (HStack); ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/number-control/index.js /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ const number_control_noop = () => {}; function UnforwardedNumberControl(props, forwardedRef) { const { __unstableStateReducer: stateReducerProp, className, dragDirection = 'n', hideHTMLArrows = false, spinControls = hideHTMLArrows ? 'none' : 'native', isDragEnabled = true, isShiftStepEnabled = true, label, max = Infinity, min = -Infinity, required = false, shiftStep = 10, step = 1, spinFactor = 1, type: typeProp = 'number', value: valueProp, size = 'default', suffix, onChange = number_control_noop, ...restProps } = useDeprecated36pxDefaultSizeProp(props); if (hideHTMLArrows) { external_wp_deprecated_default()('wp.components.NumberControl hideHTMLArrows prop ', { alternative: 'spinControls="none"', since: '6.2', version: '6.3' }); } const inputRef = (0,external_wp_element_namespaceObject.useRef)(); const mergedRef = (0,external_wp_compose_namespaceObject.useMergeRefs)([inputRef, forwardedRef]); const isStepAny = step === 'any'; const baseStep = isStepAny ? 1 : ensureNumber(step); const baseSpin = ensureNumber(spinFactor) * baseStep; const baseValue = roundClamp(0, min, max, baseStep); const constrainValue = (value, stepOverride) => { // When step is "any" clamp the value, otherwise round and clamp it. // Use '' + to convert to string for use in input value attribute. return isStepAny ? '' + Math.min(max, Math.max(min, ensureNumber(value))) : '' + roundClamp(value, min, max, stepOverride !== null && stepOverride !== void 0 ? stepOverride : baseStep); }; const autoComplete = typeProp === 'number' ? 'off' : undefined; const classes = dist_clsx('components-number-control', className); const cx = useCx(); const spinButtonClasses = cx(size === 'small' && styles.smallSpinButtons); const spinValue = (value, direction, event) => { event?.preventDefault(); const shift = event?.shiftKey && isShiftStepEnabled; const delta = shift ? ensureNumber(shiftStep) * baseSpin : baseSpin; let nextValue = isValueEmpty(value) ? baseValue : value; if (direction === 'up') { nextValue = add(nextValue, delta); } else if (direction === 'down') { nextValue = subtract(nextValue, delta); } return constrainValue(nextValue, shift ? delta : undefined); }; /** * "Middleware" function that intercepts updates from InputControl. * This allows us to tap into actions to transform the (next) state for * InputControl. * * @return The updated state to apply to InputControl */ const numberControlStateReducer = (state, action) => { const nextState = { ...state }; const { type, payload } = action; const event = payload.event; const currentValue = nextState.value; /** * Handles custom UP and DOWN Keyboard events */ if (type === PRESS_UP || type === PRESS_DOWN) { nextState.value = spinValue(currentValue, type === PRESS_UP ? 'up' : 'down', event); } /** * Handles drag to update events */ if (type === DRAG && isDragEnabled) { const [x, y] = payload.delta; const enableShift = payload.shiftKey && isShiftStepEnabled; const modifier = enableShift ? ensureNumber(shiftStep) * baseSpin : baseSpin; let directionModifier; let delta; switch (dragDirection) { case 'n': delta = y; directionModifier = -1; break; case 'e': delta = x; directionModifier = (0,external_wp_i18n_namespaceObject.isRTL)() ? -1 : 1; break; case 's': delta = y; directionModifier = 1; break; case 'w': delta = x; directionModifier = (0,external_wp_i18n_namespaceObject.isRTL)() ? 1 : -1; break; } if (delta !== 0) { delta = Math.ceil(Math.abs(delta)) * Math.sign(delta); const distance = delta * modifier * directionModifier; nextState.value = constrainValue( // @ts-expect-error TODO: Investigate if it's ok for currentValue to be undefined add(currentValue, distance), enableShift ? modifier : undefined); } } /** * Handles commit (ENTER key press or blur) */ if (type === PRESS_ENTER || type === COMMIT) { const applyEmptyValue = required === false && currentValue === ''; nextState.value = applyEmptyValue ? currentValue : // @ts-expect-error TODO: Investigate if it's ok for currentValue to be undefined constrainValue(currentValue); } return nextState; }; const buildSpinButtonClickHandler = direction => event => onChange(String(spinValue(valueProp, direction, event)), { // Set event.target to the so that consumers can use // e.g. event.target.validity. event: { ...event, target: inputRef.current } }); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(number_control_styles_Input, { autoComplete: autoComplete, inputMode: "numeric", ...restProps, className: classes, dragDirection: dragDirection, hideHTMLArrows: spinControls !== 'native', isDragEnabled: isDragEnabled, label: label, max: max, min: min, ref: mergedRef, required: required, step: step, type: typeProp // @ts-expect-error TODO: Resolve discrepancy between `value` types in InputControl based components , value: valueProp, __unstableStateReducer: (state, action) => { var _stateReducerProp; const baseState = numberControlStateReducer(state, action); return (_stateReducerProp = stateReducerProp?.(baseState, action)) !== null && _stateReducerProp !== void 0 ? _stateReducerProp : baseState; }, size: size, suffix: spinControls === 'custom' ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [suffix, /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(spacer_component, { marginBottom: 0, marginRight: 2, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(h_stack_component, { spacing: 1, children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SpinButton, { className: spinButtonClasses, icon: library_plus, size: "small", label: (0,external_wp_i18n_namespaceObject.__)('Increment'), onClick: buildSpinButtonClickHandler('up') }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SpinButton, { className: spinButtonClasses, icon: library_reset, size: "small", label: (0,external_wp_i18n_namespaceObject.__)('Decrement'), onClick: buildSpinButtonClickHandler('down') })] }) })] }) : suffix, onChange: onChange }); } const NumberControl = (0,external_wp_element_namespaceObject.forwardRef)(UnforwardedNumberControl); /* harmony default export */ const number_control = (NumberControl); ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/angle-picker-control/styles/angle-picker-control-styles.js function angle_picker_control_styles_EMOTION_STRINGIFIED_CSS_ERROR_() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; } /** * External dependencies */ /** * Internal dependencies */ const CIRCLE_SIZE = 32; const INNER_CIRCLE_SIZE = 6; const CircleRoot = /*#__PURE__*/emotion_styled_base_browser_esm("div", true ? { target: "eln3bjz3" } : 0)("border-radius:50%;border:", config_values.borderWidth, " solid ", COLORS.ui.border, ";box-sizing:border-box;cursor:grab;height:", CIRCLE_SIZE, "px;overflow:hidden;width:", CIRCLE_SIZE, "px;:active{cursor:grabbing;}" + ( true ? "" : 0)); const CircleIndicatorWrapper = /*#__PURE__*/emotion_styled_base_browser_esm("div", true ? { target: "eln3bjz2" } : 0)( true ? { name: "1r307gh", styles: "box-sizing:border-box;position:relative;width:100%;height:100%;:focus-visible{outline:none;}" } : 0); const CircleIndicator = /*#__PURE__*/emotion_styled_base_browser_esm("div", true ? { target: "eln3bjz1" } : 0)("background:", COLORS.theme.accent, ";border-radius:50%;box-sizing:border-box;display:block;left:50%;top:4px;transform:translateX( -50% );position:absolute;width:", INNER_CIRCLE_SIZE, "px;height:", INNER_CIRCLE_SIZE, "px;" + ( true ? "" : 0)); const UnitText = /*#__PURE__*/emotion_styled_base_browser_esm(text_component, true ? { target: "eln3bjz0" } : 0)("color:", COLORS.theme.accent, ";margin-right:", space(3), ";" + ( true ? "" : 0)); ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/angle-picker-control/angle-circle.js /** * WordPress dependencies */ /** * Internal dependencies */ function AngleCircle({ value, onChange, ...props }) { const angleCircleRef = (0,external_wp_element_namespaceObject.useRef)(null); const angleCircleCenter = (0,external_wp_element_namespaceObject.useRef)(); const previousCursorValue = (0,external_wp_element_namespaceObject.useRef)(); const setAngleCircleCenter = () => { if (angleCircleRef.current === null) { return; } const rect = angleCircleRef.current.getBoundingClientRect(); angleCircleCenter.current = { x: rect.x + rect.width / 2, y: rect.y + rect.height / 2 }; }; const changeAngleToPosition = event => { if (event === undefined) { return; } // Prevent (drag) mouse events from selecting and accidentally // triggering actions from other elements. event.preventDefault(); // Input control needs to lose focus and by preventDefault above, it doesn't. event.target?.focus(); if (angleCircleCenter.current !== undefined && onChange !== undefined) { const { x: centerX, y: centerY } = angleCircleCenter.current; onChange(getAngle(centerX, centerY, event.clientX, event.clientY)); } }; const { startDrag, isDragging } = (0,external_wp_compose_namespaceObject.__experimentalUseDragging)({ onDragStart: event => { setAngleCircleCenter(); changeAngleToPosition(event); }, onDragMove: changeAngleToPosition, onDragEnd: changeAngleToPosition }); (0,external_wp_element_namespaceObject.useEffect)(() => { if (isDragging) { if (previousCursorValue.current === undefined) { previousCursorValue.current = document.body.style.cursor; } document.body.style.cursor = 'grabbing'; } else { document.body.style.cursor = previousCursorValue.current || ''; previousCursorValue.current = undefined; } }, [isDragging]); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(CircleRoot, { ref: angleCircleRef, onMouseDown: startDrag, className: "components-angle-picker-control__angle-circle", ...props, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(CircleIndicatorWrapper, { style: value ? { transform: `rotate(${value}deg)` } : undefined, className: "components-angle-picker-control__angle-circle-indicator-wrapper", tabIndex: -1, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(CircleIndicator, { className: "components-angle-picker-control__angle-circle-indicator" }) }) }); } function getAngle(centerX, centerY, pointX, pointY) { const y = pointY - centerY; const x = pointX - centerX; const angleInRadians = Math.atan2(y, x); const angleInDeg = Math.round(angleInRadians * (180 / Math.PI)) + 90; if (angleInDeg < 0) { return 360 + angleInDeg; } return angleInDeg; } /* harmony default export */ const angle_circle = (AngleCircle); ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/angle-picker-control/index.js /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ function UnforwardedAnglePickerControl(props, ref) { const { className, label = (0,external_wp_i18n_namespaceObject.__)('Angle'), onChange, value, ...restProps } = props; const handleOnNumberChange = unprocessedValue => { if (onChange === undefined) { return; } const inputValue = unprocessedValue !== undefined && unprocessedValue !== '' ? parseInt(unprocessedValue, 10) : 0; onChange(inputValue); }; const classes = dist_clsx('components-angle-picker-control', className); const unitText = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(UnitText, { children: "\xB0" }); const [prefixedUnitText, suffixedUnitText] = (0,external_wp_i18n_namespaceObject.isRTL)() ? [unitText, null] : [null, unitText]; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(flex_component, { ...restProps, ref: ref, className: classes, gap: 2, children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(flex_block_component, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(number_control, { label: label, className: "components-angle-picker-control__input-field", max: 360, min: 0, onChange: handleOnNumberChange, size: "__unstable-large", step: "1", value: value, spinControls: "none", prefix: prefixedUnitText, suffix: suffixedUnitText }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(spacer_component, { marginBottom: "1", marginTop: "auto", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(angle_circle, { "aria-hidden": "true", value: value, onChange: onChange }) })] }); } /** * `AnglePickerControl` is a React component to render a UI that allows users to * pick an angle. Users can choose an angle in a visual UI with the mouse by * dragging an angle indicator inside a circle or by directly inserting the * desired angle in a text field. * * ```jsx * import { useState } from '@wordpress/element'; * import { AnglePickerControl } from '@wordpress/components'; * * function Example() { * const [ angle, setAngle ] = useState( 0 ); * return ( * * ); * } * ``` */ const AnglePickerControl = (0,external_wp_element_namespaceObject.forwardRef)(UnforwardedAnglePickerControl); /* harmony default export */ const angle_picker_control = (AnglePickerControl); // EXTERNAL MODULE: ./node_modules/remove-accents/index.js var remove_accents = __webpack_require__(9681); var remove_accents_default = /*#__PURE__*/__webpack_require__.n(remove_accents); ;// CONCATENATED MODULE: external ["wp","richText"] const external_wp_richText_namespaceObject = window["wp"]["richText"]; ;// CONCATENATED MODULE: external ["wp","a11y"] const external_wp_a11y_namespaceObject = window["wp"]["a11y"]; ;// CONCATENATED MODULE: external ["wp","keycodes"] const external_wp_keycodes_namespaceObject = window["wp"]["keycodes"]; ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/utils/strings.js /** * External dependencies */ /** * All unicode characters that we consider "dash-like": * - `\u007e`: ~ (tilde) * - `\u00ad`: ­ (soft hyphen) * - `\u2053`: ⁓ (swung dash) * - `\u207b`: ⁻ (superscript minus) * - `\u208b`: ₋ (subscript minus) * - `\u2212`: − (minus sign) * - `\\p{Pd}`: any other Unicode dash character */ const ALL_UNICODE_DASH_CHARACTERS = new RegExp(/[\u007e\u00ad\u2053\u207b\u208b\u2212\p{Pd}]/gu); const normalizeTextString = value => { return remove_accents_default()(value).toLocaleLowerCase().replace(ALL_UNICODE_DASH_CHARACTERS, '-'); }; /** * Converts any string to kebab case. * Backwards compatible with Lodash's `_.kebabCase()`. * Backwards compatible with `_wp_to_kebab_case()`. * * @see https://lodash.com/docs/4.17.15#kebabCase * @see https://developer.wordpress.org/reference/functions/_wp_to_kebab_case/ * * @param str String to convert. * @return Kebab-cased string */ function kebabCase(str) { var _str$toString; let input = (_str$toString = str?.toString?.()) !== null && _str$toString !== void 0 ? _str$toString : ''; // See https://github.com/lodash/lodash/blob/b185fcee26b2133bd071f4aaca14b455c2ed1008/lodash.js#L4970 input = input.replace(/['\u2019]/, ''); return paramCase(input, { splitRegexp: [/(?!(?:1ST|2ND|3RD|[4-9]TH)(?![a-z]))([a-z0-9])([A-Z])/g, // fooBar => foo-bar, 3Bar => 3-bar /(?!(?:1st|2nd|3rd|[4-9]th)(?![a-z]))([0-9])([a-z])/g, // 3bar => 3-bar /([A-Za-z])([0-9])/g, // Foo3 => foo-3, foo3 => foo-3 /([A-Z])([A-Z][a-z])/g // FOOBar => foo-bar ] }); } /** * Escapes the RegExp special characters. * * @param string Input string. * * @return Regex-escaped string. */ function escapeRegExp(string) { return string.replace(/[\\^$.*+?()[\]{}|]/g, '\\$&'); } ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/autocomplete/get-default-use-items.js /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ function filterOptions(search, options = [], maxResults = 10) { const filtered = []; for (let i = 0; i < options.length; i++) { const option = options[i]; // Merge label into keywords. let { keywords = [] } = option; if ('string' === typeof option.label) { keywords = [...keywords, option.label]; } const isMatch = keywords.some(keyword => search.test(remove_accents_default()(keyword))); if (!isMatch) { continue; } filtered.push(option); // Abort early if max reached. if (filtered.length === maxResults) { break; } } return filtered; } function getDefaultUseItems(autocompleter) { return filterValue => { const [items, setItems] = (0,external_wp_element_namespaceObject.useState)([]); /* * We support both synchronous and asynchronous retrieval of completer options * but internally treat all as async so we maintain a single, consistent code path. * * Because networks can be slow, and the internet is wonderfully unpredictable, * we don't want two promises updating the state at once. This ensures that only * the most recent promise will act on `optionsData`. This doesn't use the state * because `setState` is batched, and so there's no guarantee that setting * `activePromise` in the state would result in it actually being in `this.state` * before the promise resolves and we check to see if this is the active promise or not. */ (0,external_wp_element_namespaceObject.useLayoutEffect)(() => { const { options, isDebounced } = autocompleter; const loadOptions = (0,external_wp_compose_namespaceObject.debounce)(() => { const promise = Promise.resolve(typeof options === 'function' ? options(filterValue) : options).then(optionsData => { if (promise.canceled) { return; } const keyedOptions = optionsData.map((optionData, optionIndex) => ({ key: `${autocompleter.name}-${optionIndex}`, value: optionData, label: autocompleter.getOptionLabel(optionData), keywords: autocompleter.getOptionKeywords ? autocompleter.getOptionKeywords(optionData) : [], isDisabled: autocompleter.isOptionDisabled ? autocompleter.isOptionDisabled(optionData) : false })); // Create a regular expression to filter the options. const search = new RegExp('(?:\\b|\\s|^)' + escapeRegExp(filterValue), 'i'); setItems(filterOptions(search, keyedOptions)); }); return promise; }, isDebounced ? 250 : 0); const promise = loadOptions(); return () => { loadOptions.cancel(); if (promise) { promise.canceled = true; } }; }, [filterValue]); return [items]; }; } ;// CONCATENATED MODULE: ./node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.mjs /** * Provides data to position an inner element of the floating element so that it * appears centered to the reference element. * This wraps the core `arrow` middleware to allow React refs as the element. * @see https://floating-ui.com/docs/arrow */ const floating_ui_react_dom_arrow = options => { function isRef(value) { return {}.hasOwnProperty.call(value, 'current'); } return { name: 'arrow', options, fn(state) { const { element, padding } = typeof options === 'function' ? options(state) : options; if (element && isRef(element)) { if (element.current != null) { return floating_ui_dom_arrow({ element: element.current, padding }).fn(state); } return {}; } if (element) { return floating_ui_dom_arrow({ element, padding }).fn(state); } return {}; } }; }; var index = typeof document !== 'undefined' ? external_React_.useLayoutEffect : external_React_.useEffect; // Fork of `fast-deep-equal` that only does the comparisons we need and compares // functions function deepEqual(a, b) { if (a === b) { return true; } if (typeof a !== typeof b) { return false; } if (typeof a === 'function' && a.toString() === b.toString()) { return true; } let length; let i; let keys; if (a && b && typeof a === 'object') { if (Array.isArray(a)) { length = a.length; if (length !== b.length) return false; for (i = length; i-- !== 0;) { if (!deepEqual(a[i], b[i])) { return false; } } return true; } keys = Object.keys(a); length = keys.length; if (length !== Object.keys(b).length) { return false; } for (i = length; i-- !== 0;) { if (!{}.hasOwnProperty.call(b, keys[i])) { return false; } } for (i = length; i-- !== 0;) { const key = keys[i]; if (key === '_owner' && a.$$typeof) { continue; } if (!deepEqual(a[key], b[key])) { return false; } } return true; } // biome-ignore lint/suspicious/noSelfCompare: in source return a !== a && b !== b; } function getDPR(element) { if (typeof window === 'undefined') { return 1; } const win = element.ownerDocument.defaultView || window; return win.devicePixelRatio || 1; } function floating_ui_react_dom_roundByDPR(element, value) { const dpr = getDPR(element); return Math.round(value * dpr) / dpr; } function useLatestRef(value) { const ref = external_React_.useRef(value); index(() => { ref.current = value; }); return ref; } /** * Provides data to position a floating element. * @see https://floating-ui.com/docs/useFloating */ function useFloating(options) { if (options === void 0) { options = {}; } const { placement = 'bottom', strategy = 'absolute', middleware = [], platform, elements: { reference: externalReference, floating: externalFloating } = {}, transform = true, whileElementsMounted, open } = options; const [data, setData] = external_React_.useState({ x: 0, y: 0, strategy, placement, middlewareData: {}, isPositioned: false }); const [latestMiddleware, setLatestMiddleware] = external_React_.useState(middleware); if (!deepEqual(latestMiddleware, middleware)) { setLatestMiddleware(middleware); } const [_reference, _setReference] = external_React_.useState(null); const [_floating, _setFloating] = external_React_.useState(null); const setReference = external_React_.useCallback(node => { if (node !== referenceRef.current) { referenceRef.current = node; _setReference(node); } }, []); const setFloating = external_React_.useCallback(node => { if (node !== floatingRef.current) { floatingRef.current = node; _setFloating(node); } }, []); const referenceEl = externalReference || _reference; const floatingEl = externalFloating || _floating; const referenceRef = external_React_.useRef(null); const floatingRef = external_React_.useRef(null); const dataRef = external_React_.useRef(data); const hasWhileElementsMounted = whileElementsMounted != null; const whileElementsMountedRef = useLatestRef(whileElementsMounted); const platformRef = useLatestRef(platform); const update = external_React_.useCallback(() => { if (!referenceRef.current || !floatingRef.current) { return; } const config = { placement, strategy, middleware: latestMiddleware }; if (platformRef.current) { config.platform = platformRef.current; } floating_ui_dom_computePosition(referenceRef.current, floatingRef.current, config).then(data => { const fullData = { ...data, isPositioned: true }; if (isMountedRef.current && !deepEqual(dataRef.current, fullData)) { dataRef.current = fullData; external_ReactDOM_namespaceObject.flushSync(() => { setData(fullData); }); } }); }, [latestMiddleware, placement, strategy, platformRef]); index(() => { if (open === false && dataRef.current.isPositioned) { dataRef.current.isPositioned = false; setData(data => ({ ...data, isPositioned: false })); } }, [open]); const isMountedRef = external_React_.useRef(false); index(() => { isMountedRef.current = true; return () => { isMountedRef.current = false; }; }, []); // biome-ignore lint/correctness/useExhaustiveDependencies: `hasWhileElementsMounted` is intentionally included. index(() => { if (referenceEl) referenceRef.current = referenceEl; if (floatingEl) floatingRef.current = floatingEl; if (referenceEl && floatingEl) { if (whileElementsMountedRef.current) { return whileElementsMountedRef.current(referenceEl, floatingEl, update); } update(); } }, [referenceEl, floatingEl, update, whileElementsMountedRef, hasWhileElementsMounted]); const refs = external_React_.useMemo(() => ({ reference: referenceRef, floating: floatingRef, setReference, setFloating }), [setReference, setFloating]); const elements = external_React_.useMemo(() => ({ reference: referenceEl, floating: floatingEl }), [referenceEl, floatingEl]); const floatingStyles = external_React_.useMemo(() => { const initialStyles = { position: strategy, left: 0, top: 0 }; if (!elements.floating) { return initialStyles; } const x = floating_ui_react_dom_roundByDPR(elements.floating, data.x); const y = floating_ui_react_dom_roundByDPR(elements.floating, data.y); if (transform) { return { ...initialStyles, transform: "translate(" + x + "px, " + y + "px)", ...(getDPR(elements.floating) >= 1.5 && { willChange: 'transform' }) }; } return { position: strategy, left: x, top: y }; }, [strategy, transform, elements.floating, data.x, data.y]); return external_React_.useMemo(() => ({ ...data, update, refs, elements, floatingStyles }), [data, update, refs, elements, floatingStyles]); } ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/close.js /** * WordPress dependencies */ const close_close = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M13 11.8l6.1-6.3-1-1-6.1 6.2-6.1-6.2-1 1 6.1 6.3-6.5 6.7 1 1 6.5-6.6 6.5 6.6 1-1z" }) }); /* harmony default export */ const library_close = (close_close); ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/scroll-lock/index.js /** * WordPress dependencies */ /* * Setting `overflow: hidden` on html and body elements resets body scroll in iOS. * Save scroll top so we can restore it after locking scroll. * * NOTE: It would be cleaner and possibly safer to find a localized solution such * as preventing default on certain touchmove events. */ let previousScrollTop = 0; function setLocked(locked) { const scrollingElement = document.scrollingElement || document.body; if (locked) { previousScrollTop = scrollingElement.scrollTop; } const methodName = locked ? 'add' : 'remove'; scrollingElement.classList[methodName]('lockscroll'); // Adding the class to the document element seems to be necessary in iOS. document.documentElement.classList[methodName]('lockscroll'); if (!locked) { scrollingElement.scrollTop = previousScrollTop; } } let lockCounter = 0; /** * ScrollLock is a content-free React component for declaratively preventing * scroll bleed from modal UI to the page body. This component applies a * `lockscroll` class to the `document.documentElement` and * `document.scrollingElement` elements to stop the body from scrolling. When it * is present, the lock is applied. * * ```jsx * import { ScrollLock, Button } from '@wordpress/components'; * import { useState } from '@wordpress/element'; * * const MyScrollLock = () => { * const [ isScrollLocked, setIsScrollLocked ] = useState( false ); * * const toggleLock = () => { * setIsScrollLocked( ( locked ) => ! locked ) ); * }; * * return ( *
* * { isScrollLocked && } *

* Scroll locked: * { isScrollLocked ? 'Yes' : 'No' } *

*
* ); * }; * ``` */ function ScrollLock() { (0,external_wp_element_namespaceObject.useEffect)(() => { if (lockCounter === 0) { setLocked(true); } ++lockCounter; return () => { if (lockCounter === 1) { setLocked(false); } --lockCounter; }; }, []); return null; } /* harmony default export */ const scroll_lock = (ScrollLock); ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/slot-fill/bubbles-virtually/slot-fill-context.js /** * WordPress dependencies */ /** * Internal dependencies */ const initialContextValue = { slots: (0,external_wp_compose_namespaceObject.observableMap)(), fills: (0,external_wp_compose_namespaceObject.observableMap)(), registerSlot: () => { true ? external_wp_warning_default()('Components must be wrapped within `SlotFillProvider`. ' + 'See https://developer.wordpress.org/block-editor/components/slot-fill/') : 0; }, updateSlot: () => {}, unregisterSlot: () => {}, registerFill: () => {}, unregisterFill: () => {}, // This helps the provider know if it's using the default context value or not. isDefault: true }; const SlotFillContext = (0,external_wp_element_namespaceObject.createContext)(initialContextValue); /* harmony default export */ const slot_fill_context = (SlotFillContext); ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/slot-fill/bubbles-virtually/use-slot.js /** * WordPress dependencies */ /** * Internal dependencies */ function useSlot(name) { const registry = (0,external_wp_element_namespaceObject.useContext)(slot_fill_context); const slot = (0,external_wp_compose_namespaceObject.useObservableValue)(registry.slots, name); const api = (0,external_wp_element_namespaceObject.useMemo)(() => ({ updateSlot: fillProps => registry.updateSlot(name, fillProps), unregisterSlot: ref => registry.unregisterSlot(name, ref), registerFill: ref => registry.registerFill(name, ref), unregisterFill: ref => registry.unregisterFill(name, ref) }), [name, registry]); return { ...slot, ...api }; } ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/slot-fill/context.js /** * WordPress dependencies */ /** * Internal dependencies */ const initialValue = { registerSlot: () => {}, unregisterSlot: () => {}, registerFill: () => {}, unregisterFill: () => {}, getSlot: () => undefined, getFills: () => [], subscribe: () => () => {} }; const context_SlotFillContext = (0,external_wp_element_namespaceObject.createContext)(initialValue); /* harmony default export */ const context = (context_SlotFillContext); ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/slot-fill/use-slot.js /** * WordPress dependencies */ /** * Internal dependencies */ /** * React hook returning the active slot given a name. * * @param name Slot name. * @return Slot object. */ const use_slot_useSlot = name => { const { getSlot, subscribe } = (0,external_wp_element_namespaceObject.useContext)(context); return (0,external_wp_element_namespaceObject.useSyncExternalStore)(subscribe, () => getSlot(name), () => getSlot(name)); }; /* harmony default export */ const use_slot = (use_slot_useSlot); ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/slot-fill/fill.js /** * WordPress dependencies */ /** * Internal dependencies */ function Fill({ name, children }) { const { registerFill, unregisterFill } = (0,external_wp_element_namespaceObject.useContext)(context); const slot = use_slot(name); const ref = (0,external_wp_element_namespaceObject.useRef)({ name, children }); (0,external_wp_element_namespaceObject.useLayoutEffect)(() => { const refValue = ref.current; registerFill(name, refValue); return () => unregisterFill(name, refValue); // Ignore reason: the useLayoutEffects here are written to fire at specific times, and introducing new dependencies could cause unexpected changes in behavior. // We'll leave them as-is until a more detailed investigation/refactor can be performed. // eslint-disable-next-line react-hooks/exhaustive-deps }, []); (0,external_wp_element_namespaceObject.useLayoutEffect)(() => { ref.current.children = children; if (slot) { slot.forceUpdate(); } // Ignore reason: the useLayoutEffects here are written to fire at specific times, and introducing new dependencies could cause unexpected changes in behavior. // We'll leave them as-is until a more detailed investigation/refactor can be performed. // eslint-disable-next-line react-hooks/exhaustive-deps }, [children]); (0,external_wp_element_namespaceObject.useLayoutEffect)(() => { if (name === ref.current.name) { // Ignore initial effect. return; } unregisterFill(ref.current.name, ref.current); ref.current.name = name; registerFill(name, ref.current); // Ignore reason: the useLayoutEffects here are written to fire at specific times, and introducing new dependencies could cause unexpected changes in behavior. // We'll leave them as-is until a more detailed investigation/refactor can be performed. // eslint-disable-next-line react-hooks/exhaustive-deps }, [name]); return null; } ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/slot-fill/slot.js /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ /** * Whether the argument is a function. * * @param maybeFunc The argument to check. * @return True if the argument is a function, false otherwise. */ function isFunction(maybeFunc) { return typeof maybeFunc === 'function'; } class SlotComponent extends external_wp_element_namespaceObject.Component { constructor(props) { super(props); this.isUnmounted = false; } componentDidMount() { const { registerSlot } = this.props; this.isUnmounted = false; registerSlot(this.props.name, this); } componentWillUnmount() { const { unregisterSlot } = this.props; this.isUnmounted = true; unregisterSlot(this.props.name, this); } componentDidUpdate(prevProps) { const { name, unregisterSlot, registerSlot } = this.props; if (prevProps.name !== name) { unregisterSlot(prevProps.name, this); registerSlot(name, this); } } forceUpdate() { if (this.isUnmounted) { return; } super.forceUpdate(); } render() { var _getFills; const { children, name, fillProps = {}, getFills } = this.props; const fills = ((_getFills = getFills(name, this)) !== null && _getFills !== void 0 ? _getFills : []).map(fill => { const fillChildren = isFunction(fill.children) ? fill.children(fillProps) : fill.children; return external_wp_element_namespaceObject.Children.map(fillChildren, (child, childIndex) => { if (!child || typeof child === 'string') { return child; } let childKey = childIndex; if (typeof child === 'object' && 'key' in child && child?.key) { childKey = child.key; } return (0,external_wp_element_namespaceObject.cloneElement)(child, { key: childKey }); }); }).filter( // In some cases fills are rendered only when some conditions apply. // This ensures that we only use non-empty fills when rendering, i.e., // it allows us to render wrappers only when the fills are actually present. element => !(0,external_wp_element_namespaceObject.isEmptyElement)(element)); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: isFunction(children) ? children(fills) : fills }); } } const Slot = props => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(context.Consumer, { children: ({ registerSlot, unregisterSlot, getFills }) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SlotComponent, { ...props, registerSlot: registerSlot, unregisterSlot: unregisterSlot, getFills: getFills }) }); /* harmony default export */ const slot = (Slot); ;// CONCATENATED MODULE: ./node_modules/uuid/dist/esm-browser/native.js const randomUUID = typeof crypto !== 'undefined' && crypto.randomUUID && crypto.randomUUID.bind(crypto); /* harmony default export */ const esm_browser_native = ({ randomUUID }); ;// CONCATENATED MODULE: ./node_modules/uuid/dist/esm-browser/rng.js // Unique ID creation requires a high quality random # generator. In the browser we therefore // require the crypto API and do not support built-in fallback to lower quality random number // generators (like Math.random()). let getRandomValues; const rnds8 = new Uint8Array(16); function rng() { // lazy load so that environments that need to polyfill have a chance to do so if (!getRandomValues) { // getRandomValues needs to be invoked in a context where "this" is a Crypto implementation. getRandomValues = typeof crypto !== 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto); if (!getRandomValues) { throw new Error('crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported'); } } return getRandomValues(rnds8); } ;// CONCATENATED MODULE: ./node_modules/uuid/dist/esm-browser/stringify.js /** * Convert array of 16 byte values to UUID string format of the form: * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX */ const byteToHex = []; for (let i = 0; i < 256; ++i) { byteToHex.push((i + 0x100).toString(16).slice(1)); } function unsafeStringify(arr, offset = 0) { // Note: Be careful editing this code! It's been tuned for performance // and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434 return byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + '-' + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + '-' + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + '-' + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + '-' + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]; } function stringify_stringify(arr, offset = 0) { const uuid = unsafeStringify(arr, offset); // Consistency check for valid UUID. If this throws, it's likely due to one // of the following: // - One or more input array values don't map to a hex octet (leading to // "undefined" in the uuid) // - Invalid input values for the RFC `version` or `variant` fields if (!validate(uuid)) { throw TypeError('Stringified UUID is invalid'); } return uuid; } /* harmony default export */ const esm_browser_stringify = ((/* unused pure expression or super */ null && (stringify_stringify))); ;// CONCATENATED MODULE: ./node_modules/uuid/dist/esm-browser/v4.js function v4(options, buf, offset) { if (esm_browser_native.randomUUID && !buf && !options) { return esm_browser_native.randomUUID(); } options = options || {}; const rnds = options.random || (options.rng || rng)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved` rnds[6] = rnds[6] & 0x0f | 0x40; rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided if (buf) { offset = offset || 0; for (let i = 0; i < 16; ++i) { buf[offset + i] = rnds[i]; } return buf; } return unsafeStringify(rnds); } /* harmony default export */ const esm_browser_v4 = (v4); ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/style-provider/index.js /** * External dependencies */ /** * Internal dependencies */ const uuidCache = new Set(); // Use a weak map so that when the container is detached it's automatically // dereferenced to avoid memory leak. const containerCacheMap = new WeakMap(); const memoizedCreateCacheWithContainer = container => { if (containerCacheMap.has(container)) { return containerCacheMap.get(container); } // Emotion only accepts alphabetical and hyphenated keys so we just // strip the numbers from the UUID. It _should_ be fine. let key = esm_browser_v4().replace(/[0-9]/g, ''); while (uuidCache.has(key)) { key = esm_browser_v4().replace(/[0-9]/g, ''); } uuidCache.add(key); const cache = emotion_cache_browser_esm({ container, key }); containerCacheMap.set(container, cache); return cache; }; function StyleProvider(props) { const { children, document } = props; if (!document) { return null; } const cache = memoizedCreateCacheWithContainer(document.head); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(CacheProvider, { value: cache, children: children }); } /* harmony default export */ const style_provider = (StyleProvider); ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/slot-fill/bubbles-virtually/fill.js /** * WordPress dependencies */ /** * Internal dependencies */ function fill_useForceUpdate() { const [, setState] = (0,external_wp_element_namespaceObject.useState)({}); const mounted = (0,external_wp_element_namespaceObject.useRef)(true); (0,external_wp_element_namespaceObject.useEffect)(() => { mounted.current = true; return () => { mounted.current = false; }; }, []); return () => { if (mounted.current) { setState({}); } }; } function fill_Fill(props) { var _slot$fillProps; const { name, children } = props; const { registerFill, unregisterFill, ...slot } = useSlot(name); const rerender = fill_useForceUpdate(); const ref = (0,external_wp_element_namespaceObject.useRef)({ rerender }); (0,external_wp_element_namespaceObject.useEffect)(() => { // We register fills so we can keep track of their existence. // Some Slot implementations need to know if there're already fills // registered so they can choose to render themselves or not. registerFill(ref); return () => { unregisterFill(ref); }; }, [registerFill, unregisterFill]); if (!slot.ref || !slot.ref.current) { return null; } // When using a `Fill`, the `children` will be rendered in the document of the // `Slot`. This means that we need to wrap the `children` in a `StyleProvider` // to make sure we're referencing the right document/iframe (instead of the // context of the `Fill`'s parent). const wrappedChildren = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(style_provider, { document: slot.ref.current.ownerDocument, children: typeof children === 'function' ? children((_slot$fillProps = slot.fillProps) !== null && _slot$fillProps !== void 0 ? _slot$fillProps : {}) : children }); return (0,external_wp_element_namespaceObject.createPortal)(wrappedChildren, slot.ref.current); } ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/slot-fill/bubbles-virtually/slot.js /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ function slot_Slot(props, forwardedRef) { const { name, fillProps = {}, as, // `children` is not allowed. However, if it is passed, // it will be displayed as is, so remove `children`. // @ts-ignore children, ...restProps } = props; const { registerSlot, unregisterSlot, ...registry } = (0,external_wp_element_namespaceObject.useContext)(slot_fill_context); const ref = (0,external_wp_element_namespaceObject.useRef)(null); (0,external_wp_element_namespaceObject.useLayoutEffect)(() => { registerSlot(name, ref, fillProps); return () => { unregisterSlot(name, ref); }; // Ignore reason: We don't want to unregister and register the slot whenever // `fillProps` change, which would cause the fill to be re-mounted. Instead, // we can just update the slot (see hook below). // For more context, see https://github.com/WordPress/gutenberg/pull/44403#discussion_r994415973 // eslint-disable-next-line react-hooks/exhaustive-deps }, [registerSlot, unregisterSlot, name]); // fillProps may be an update that interacts with the layout, so we // useLayoutEffect. (0,external_wp_element_namespaceObject.useLayoutEffect)(() => { registry.updateSlot(name, fillProps); }); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(component, { as: as, ref: (0,external_wp_compose_namespaceObject.useMergeRefs)([forwardedRef, ref]), ...restProps }); } /* harmony default export */ const bubbles_virtually_slot = ((0,external_wp_element_namespaceObject.forwardRef)(slot_Slot)); ;// CONCATENATED MODULE: external ["wp","isShallowEqual"] const external_wp_isShallowEqual_namespaceObject = window["wp"]["isShallowEqual"]; var external_wp_isShallowEqual_default = /*#__PURE__*/__webpack_require__.n(external_wp_isShallowEqual_namespaceObject); ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/slot-fill/bubbles-virtually/slot-fill-provider.js /** * WordPress dependencies */ /** * Internal dependencies */ function createSlotRegistry() { const slots = (0,external_wp_compose_namespaceObject.observableMap)(); const fills = (0,external_wp_compose_namespaceObject.observableMap)(); const registerSlot = (name, ref, fillProps) => { const slot = slots.get(name); slots.set(name, { ...slot, ref: ref || slot?.ref, fillProps: fillProps || slot?.fillProps || {} }); }; const unregisterSlot = (name, ref) => { // Make sure we're not unregistering a slot registered by another element // See https://github.com/WordPress/gutenberg/pull/19242#issuecomment-590295412 if (slots.get(name)?.ref === ref) { slots.delete(name); } }; const updateSlot = (name, fillProps) => { const slot = slots.get(name); if (!slot) { return; } if (external_wp_isShallowEqual_default()(slot.fillProps, fillProps)) { return; } slot.fillProps = fillProps; const slotFills = fills.get(name); if (slotFills) { // Force update fills. slotFills.forEach(fill => fill.current.rerender()); } }; const registerFill = (name, ref) => { fills.set(name, [...(fills.get(name) || []), ref]); }; const unregisterFill = (name, ref) => { const fillsForName = fills.get(name); if (!fillsForName) { return; } fills.set(name, fillsForName.filter(fillRef => fillRef !== ref)); }; return { slots, fills, registerSlot, updateSlot, unregisterSlot, registerFill, unregisterFill }; } function SlotFillProvider({ children }) { const [registry] = (0,external_wp_element_namespaceObject.useState)(createSlotRegistry); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(slot_fill_context.Provider, { value: registry, children: children }); } ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/slot-fill/provider.js /** * WordPress dependencies */ /** * Internal dependencies */ function provider_createSlotRegistry() { const slots = {}; const fills = {}; let listeners = []; function registerSlot(name, slot) { const previousSlot = slots[name]; slots[name] = slot; triggerListeners(); // Sometimes the fills are registered after the initial render of slot // But before the registerSlot call, we need to rerender the slot. forceUpdateSlot(name); // If a new instance of a slot is being mounted while another with the // same name exists, force its update _after_ the new slot has been // assigned into the instance, such that its own rendering of children // will be empty (the new Slot will subsume all fills for this name). if (previousSlot) { previousSlot.forceUpdate(); } } function registerFill(name, instance) { fills[name] = [...(fills[name] || []), instance]; forceUpdateSlot(name); } function unregisterSlot(name, instance) { // If a previous instance of a Slot by this name unmounts, do nothing, // as the slot and its fills should only be removed for the current // known instance. if (slots[name] !== instance) { return; } delete slots[name]; triggerListeners(); } function unregisterFill(name, instance) { var _fills$name$filter; fills[name] = (_fills$name$filter = fills[name]?.filter(fill => fill !== instance)) !== null && _fills$name$filter !== void 0 ? _fills$name$filter : []; forceUpdateSlot(name); } function getSlot(name) { return slots[name]; } function getFills(name, slotInstance) { // Fills should only be returned for the current instance of the slot // in which they occupy. if (slots[name] !== slotInstance) { return []; } return fills[name]; } function forceUpdateSlot(name) { const slot = getSlot(name); if (slot) { slot.forceUpdate(); } } function triggerListeners() { listeners.forEach(listener => listener()); } function subscribe(listener) { listeners.push(listener); return () => { listeners = listeners.filter(l => l !== listener); }; } return { registerSlot, unregisterSlot, registerFill, unregisterFill, getSlot, getFills, subscribe }; } function provider_SlotFillProvider({ children }) { const [contextValue] = (0,external_wp_element_namespaceObject.useState)(provider_createSlotRegistry); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(context.Provider, { value: contextValue, children: children }); } /* harmony default export */ const provider = (provider_SlotFillProvider); ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/slot-fill/index.js /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ function slot_fill_Fill(props) { // We're adding both Fills here so they can register themselves before // their respective slot has been registered. Only the Fill that has a slot // will render. The other one will return null. return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Fill, { ...props }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(fill_Fill, { ...props })] }); } function UnforwardedSlot(props, ref) { const { bubblesVirtually, ...restProps } = props; if (bubblesVirtually) { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(bubbles_virtually_slot, { ...restProps, ref: ref }); } return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(slot, { ...restProps }); } const slot_fill_Slot = (0,external_wp_element_namespaceObject.forwardRef)(UnforwardedSlot); function Provider({ children, passthrough = false }) { const parent = (0,external_wp_element_namespaceObject.useContext)(slot_fill_context); if (!parent.isDefault && passthrough) { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: children }); } return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(provider, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SlotFillProvider, { children: children }) }); } function createSlotFill(key) { const baseName = typeof key === 'symbol' ? key.description : key; const FillComponent = props => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(slot_fill_Fill, { name: key, ...props }); FillComponent.displayName = `${baseName}Fill`; const SlotComponent = props => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(slot_fill_Slot, { name: key, ...props }); SlotComponent.displayName = `${baseName}Slot`; SlotComponent.__unstableName = key; return { Fill: FillComponent, Slot: SlotComponent }; } const createPrivateSlotFill = name => { const privateKey = Symbol(name); const privateSlotFill = createSlotFill(privateKey); return { privateKey, ...privateSlotFill }; }; ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/popover/overlay-middlewares.js /** * External dependencies */ function overlayMiddlewares() { return [{ name: 'overlay', fn({ rects }) { return rects.reference; } }, floating_ui_dom_size({ apply({ rects, elements }) { var _elements$floating; const { firstElementChild } = (_elements$floating = elements.floating) !== null && _elements$floating !== void 0 ? _elements$floating : {}; // Only HTMLElement instances have the `style` property. if (!(firstElementChild instanceof HTMLElement)) { return; } // Reduce the height of the popover to the available space. Object.assign(firstElementChild.style, { width: `${rects.reference.width}px`, height: `${rects.reference.height}px` }); } })]; } ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/popover/index.js /** * External dependencies */ // eslint-disable-next-line no-restricted-imports // eslint-disable-next-line no-restricted-imports /** * WordPress dependencies */ /** * Internal dependencies */ /** * Name of slot in which popover should fill. * * @type {string} */ const SLOT_NAME = 'Popover'; // An SVG displaying a triangle facing down, filled with a solid // color and bordered in such a way to create an arrow-like effect. // Keeping the SVG's viewbox squared simplify the arrow positioning // calculations. const ArrowTriangle = () => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 100 100", className: "components-popover__triangle", role: "presentation", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { className: "components-popover__triangle-bg", d: "M 0 0 L 50 50 L 100 0" }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { className: "components-popover__triangle-border", d: "M 0 0 L 50 50 L 100 0", vectorEffect: "non-scaling-stroke" })] }); const slotNameContext = (0,external_wp_element_namespaceObject.createContext)(undefined); const fallbackContainerClassname = 'components-popover__fallback-container'; const getPopoverFallbackContainer = () => { let container = document.body.querySelector('.' + fallbackContainerClassname); if (!container) { container = document.createElement('div'); container.className = fallbackContainerClassname; document.body.append(container); } return container; }; const UnforwardedPopover = (props, forwardedRef) => { const { animate = true, headerTitle, constrainTabbing, onClose, children, className, noArrow = true, position, placement: placementProp = 'bottom-start', offset: offsetProp = 0, focusOnMount = 'firstElement', anchor, expandOnMobile, onFocusOutside, __unstableSlotName = SLOT_NAME, flip = true, resize = true, shift = false, inline = false, variant, // Deprecated props __unstableForcePosition, anchorRef, anchorRect, getAnchorRect, isAlternate, // Rest ...contentProps } = useContextSystem(props, 'Popover'); let computedFlipProp = flip; let computedResizeProp = resize; if (__unstableForcePosition !== undefined) { external_wp_deprecated_default()('`__unstableForcePosition` prop in wp.components.Popover', { since: '6.1', version: '6.3', alternative: '`flip={ false }` and `resize={ false }`' }); // Back-compat, set the `flip` and `resize` props // to `false` to replicate `__unstableForcePosition`. computedFlipProp = !__unstableForcePosition; computedResizeProp = !__unstableForcePosition; } if (anchorRef !== undefined) { external_wp_deprecated_default()('`anchorRef` prop in wp.components.Popover', { since: '6.1', alternative: '`anchor` prop' }); } if (anchorRect !== undefined) { external_wp_deprecated_default()('`anchorRect` prop in wp.components.Popover', { since: '6.1', alternative: '`anchor` prop' }); } if (getAnchorRect !== undefined) { external_wp_deprecated_default()('`getAnchorRect` prop in wp.components.Popover', { since: '6.1', alternative: '`anchor` prop' }); } const computedVariant = isAlternate ? 'toolbar' : variant; if (isAlternate !== undefined) { external_wp_deprecated_default()('`isAlternate` prop in wp.components.Popover', { since: '6.2', alternative: "`variant` prop with the `'toolbar'` value" }); } const arrowRef = (0,external_wp_element_namespaceObject.useRef)(null); const [fallbackReferenceElement, setFallbackReferenceElement] = (0,external_wp_element_namespaceObject.useState)(null); const anchorRefFallback = (0,external_wp_element_namespaceObject.useCallback)(node => { setFallbackReferenceElement(node); }, []); const isMobileViewport = (0,external_wp_compose_namespaceObject.useViewportMatch)('medium', '<'); const isExpanded = expandOnMobile && isMobileViewport; const hasArrow = !isExpanded && !noArrow; const normalizedPlacementFromProps = position ? positionToPlacement(position) : placementProp; const middleware = [...(placementProp === 'overlay' ? overlayMiddlewares() : []), offset(offsetProp), computedFlipProp && floating_ui_dom_flip(), computedResizeProp && floating_ui_dom_size({ apply(sizeProps) { var _refs$floating$curren; const { firstElementChild } = (_refs$floating$curren = refs.floating.current) !== null && _refs$floating$curren !== void 0 ? _refs$floating$curren : {}; // Only HTMLElement instances have the `style` property. if (!(firstElementChild instanceof HTMLElement)) { return; } // Reduce the height of the popover to the available space. Object.assign(firstElementChild.style, { maxHeight: `${sizeProps.availableHeight}px`, overflow: 'auto' }); } }), shift && floating_ui_dom_shift({ crossAxis: true, limiter: floating_ui_dom_limitShift(), padding: 1 // Necessary to avoid flickering at the edge of the viewport. }), floating_ui_react_dom_arrow({ element: arrowRef })]; const slotName = (0,external_wp_element_namespaceObject.useContext)(slotNameContext) || __unstableSlotName; const slot = useSlot(slotName); let onDialogClose; if (onClose || onFocusOutside) { onDialogClose = (type, event) => { // Ideally the popover should have just a single onClose prop and // not three props that potentially do the same thing. if (type === 'focus-outside' && onFocusOutside) { onFocusOutside(event); } else if (onClose) { onClose(); } }; } const [dialogRef, dialogProps] = (0,external_wp_compose_namespaceObject.__experimentalUseDialog)({ constrainTabbing, focusOnMount, __unstableOnClose: onDialogClose, // @ts-expect-error The __unstableOnClose property needs to be deprecated first (see https://github.com/WordPress/gutenberg/pull/27675) onClose: onDialogClose }); const { // Positioning coordinates x, y, // Object with "regular" refs to both "reference" and "floating" refs, // Type of CSS position property to use (absolute or fixed) strategy, update, placement: computedPlacement, middlewareData: { arrow: arrowData } } = useFloating({ placement: normalizedPlacementFromProps === 'overlay' ? undefined : normalizedPlacementFromProps, middleware, whileElementsMounted: (referenceParam, floatingParam, updateParam) => autoUpdate(referenceParam, floatingParam, updateParam, { layoutShift: false, animationFrame: true }) }); const arrowCallbackRef = (0,external_wp_element_namespaceObject.useCallback)(node => { arrowRef.current = node; update(); }, [update]); // When any of the possible anchor "sources" change, // recompute the reference element (real or virtual) and its owner document. const anchorRefTop = anchorRef?.top; const anchorRefBottom = anchorRef?.bottom; const anchorRefStartContainer = anchorRef?.startContainer; const anchorRefCurrent = anchorRef?.current; (0,external_wp_element_namespaceObject.useLayoutEffect)(() => { const resultingReferenceElement = getReferenceElement({ anchor, anchorRef, anchorRect, getAnchorRect, fallbackReferenceElement }); refs.setReference(resultingReferenceElement); }, [anchor, anchorRef, anchorRefTop, anchorRefBottom, anchorRefStartContainer, anchorRefCurrent, anchorRect, getAnchorRect, fallbackReferenceElement, refs]); const mergedFloatingRef = (0,external_wp_compose_namespaceObject.useMergeRefs)([refs.setFloating, dialogRef, forwardedRef]); const style = isExpanded ? undefined : { position: strategy, top: 0, left: 0, // `x` and `y` are framer-motion specific props and are shorthands // for `translateX` and `translateY`. Currently it is not possible // to use `translateX` and `translateY` because those values would // be overridden by the return value of the // `placementToMotionAnimationProps` function. x: computePopoverPosition(x), y: computePopoverPosition(y) }; const shouldReduceMotion = (0,external_wp_compose_namespaceObject.useReducedMotion)(); const shouldAnimate = animate && !isExpanded && !shouldReduceMotion; const [animationFinished, setAnimationFinished] = (0,external_wp_element_namespaceObject.useState)(false); const { style: motionInlineStyles, ...otherMotionProps } = (0,external_wp_element_namespaceObject.useMemo)(() => placementToMotionAnimationProps(computedPlacement), [computedPlacement]); const animationProps = shouldAnimate ? { style: { ...motionInlineStyles, ...style }, onAnimationComplete: () => setAnimationFinished(true), ...otherMotionProps } : { animate: false, style }; // When Floating UI has finished positioning and Framer Motion has finished animating // the popover, add the `is-positioned` class to signal that all transitions have finished. const isPositioned = (!shouldAnimate || animationFinished) && x !== null && y !== null; let content = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(motion.div, { className: dist_clsx(className, { 'is-expanded': isExpanded, 'is-positioned': isPositioned, // Use the 'alternate' classname for 'toolbar' variant for back compat. [`is-${computedVariant === 'toolbar' ? 'alternate' : computedVariant}`]: computedVariant }), ...animationProps, ...contentProps, ref: mergedFloatingRef, ...dialogProps, tabIndex: -1, children: [isExpanded && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(scroll_lock, {}), isExpanded && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: "components-popover__header", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { className: "components-popover__header-title", children: headerTitle }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(build_module_button, { className: "components-popover__close", icon: library_close, onClick: onClose })] }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "components-popover__content", children: children }), hasArrow && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { ref: arrowCallbackRef, className: ['components-popover__arrow', `is-${computedPlacement.split('-')[0]}`].join(' '), style: { left: typeof arrowData?.x !== 'undefined' && Number.isFinite(arrowData.x) ? `${arrowData.x}px` : '', top: typeof arrowData?.y !== 'undefined' && Number.isFinite(arrowData.y) ? `${arrowData.y}px` : '' }, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ArrowTriangle, {}) })] }); const shouldRenderWithinSlot = slot.ref && !inline; const hasAnchor = anchorRef || anchorRect || anchor; if (shouldRenderWithinSlot) { content = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(slot_fill_Fill, { name: slotName, children: content }); } else if (!inline) { content = (0,external_wp_element_namespaceObject.createPortal)( /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(StyleProvider, { document: document, children: content }), getPopoverFallbackContainer()); } if (hasAnchor) { return content; } return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { ref: anchorRefFallback }), content] }); }; /** * `Popover` renders its content in a floating modal. If no explicit anchor is passed via props, it anchors to its parent element by default. * * ```jsx * import { Button, Popover } from '@wordpress/components'; * import { useState } from '@wordpress/element'; * * const MyPopover = () => { * const [ isVisible, setIsVisible ] = useState( false ); * const toggleVisible = () => { * setIsVisible( ( state ) => ! state ); * }; * * return ( * * ); * }; * ``` * */ const popover_Popover = contextConnect(UnforwardedPopover, 'Popover'); function PopoverSlot({ name = SLOT_NAME }, ref) { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(slot_fill_Slot, { bubblesVirtually: true, name: name, className: "popover-slot", ref: ref }); } // @ts-expect-error For Legacy Reasons popover_Popover.Slot = (0,external_wp_element_namespaceObject.forwardRef)(PopoverSlot); // @ts-expect-error For Legacy Reasons popover_Popover.__unstableSlotNameProvider = slotNameContext.Provider; /* harmony default export */ const popover = (popover_Popover); ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/autocomplete/autocompleter-ui.js /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ function ListBox({ items, onSelect, selectedIndex, instanceId, listBoxId, className, Component = 'div' }) { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Component, { id: listBoxId, role: "listbox", className: "components-autocomplete__results", children: items.map((option, index) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(build_module_button, { id: `components-autocomplete-item-${instanceId}-${option.key}`, role: "option", "aria-selected": index === selectedIndex, disabled: option.isDisabled, className: dist_clsx('components-autocomplete__result', className, { 'is-selected': index === selectedIndex }), onClick: () => onSelect(option), children: option.label }, option.key)) }); } function getAutoCompleterUI(autocompleter) { var _autocompleter$useIte; const useItems = (_autocompleter$useIte = autocompleter.useItems) !== null && _autocompleter$useIte !== void 0 ? _autocompleter$useIte : getDefaultUseItems(autocompleter); function AutocompleterUI({ filterValue, instanceId, listBoxId, className, selectedIndex, onChangeOptions, onSelect, onReset, reset, contentRef }) { const [items] = useItems(filterValue); const popoverAnchor = (0,external_wp_richText_namespaceObject.useAnchor)({ editableContentElement: contentRef.current }); const [needsA11yCompat, setNeedsA11yCompat] = (0,external_wp_element_namespaceObject.useState)(false); const popoverRef = (0,external_wp_element_namespaceObject.useRef)(null); const popoverRefs = (0,external_wp_compose_namespaceObject.useMergeRefs)([popoverRef, (0,external_wp_compose_namespaceObject.useRefEffect)(node => { if (!contentRef.current) { return; } // If the popover is rendered in a different document than // the content, we need to duplicate the options list in the // content document so that it's available to the screen // readers, which check the DOM ID based aria-* attributes. setNeedsA11yCompat(node.ownerDocument !== contentRef.current.ownerDocument); }, [contentRef])]); useOnClickOutside(popoverRef, reset); const debouncedSpeak = (0,external_wp_compose_namespaceObject.useDebounce)(external_wp_a11y_namespaceObject.speak, 500); function announce(options) { if (!debouncedSpeak) { return; } if (!!options.length) { if (filterValue) { debouncedSpeak((0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %d: number of results. */ (0,external_wp_i18n_namespaceObject._n)('%d result found, use up and down arrow keys to navigate.', '%d results found, use up and down arrow keys to navigate.', options.length), options.length), 'assertive'); } else { debouncedSpeak((0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %d: number of results. */ (0,external_wp_i18n_namespaceObject._n)('Initial %d result loaded. Type to filter all available results. Use up and down arrow keys to navigate.', 'Initial %d results loaded. Type to filter all available results. Use up and down arrow keys to navigate.', options.length), options.length), 'assertive'); } } else { debouncedSpeak((0,external_wp_i18n_namespaceObject.__)('No results.'), 'assertive'); } } (0,external_wp_element_namespaceObject.useLayoutEffect)(() => { onChangeOptions(items); announce(items); // Temporarily disabling exhaustive-deps to avoid introducing unexpected side effecst. // See https://github.com/WordPress/gutenberg/pull/41820 // eslint-disable-next-line react-hooks/exhaustive-deps }, [items]); if (items.length === 0) { return null; } return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(popover, { focusOnMount: false, onClose: onReset, placement: "top-start", className: "components-autocomplete__popover", anchor: popoverAnchor, ref: popoverRefs, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ListBox, { items: items, onSelect: onSelect, selectedIndex: selectedIndex, instanceId: instanceId, listBoxId: listBoxId, className: className }) }), contentRef.current && needsA11yCompat && (0,external_ReactDOM_namespaceObject.createPortal)( /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ListBox, { items: items, onSelect: onSelect, selectedIndex: selectedIndex, instanceId: instanceId, listBoxId: listBoxId, className: className, Component: visually_hidden_component }), contentRef.current.ownerDocument.body)] }); } return AutocompleterUI; } function useOnClickOutside(ref, handler) { (0,external_wp_element_namespaceObject.useEffect)(() => { const listener = event => { // Do nothing if clicking ref's element or descendent elements, or if the ref is not referencing an element if (!ref.current || ref.current.contains(event.target)) { return; } handler(event); }; document.addEventListener('mousedown', listener); document.addEventListener('touchstart', listener); return () => { document.removeEventListener('mousedown', listener); document.removeEventListener('touchstart', listener); }; // Disable reason: `ref` is a ref object and should not be included in a // hook's dependency list. // eslint-disable-next-line react-hooks/exhaustive-deps }, [handler]); } ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/autocomplete/index.js /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ const getNodeText = node => { if (node === null) { return ''; } switch (typeof node) { case 'string': case 'number': return node.toString(); break; case 'boolean': return ''; break; case 'object': { if (node instanceof Array) { return node.map(getNodeText).join(''); } if ('props' in node) { return getNodeText(node.props.children); } break; } default: return ''; } return ''; }; const EMPTY_FILTERED_OPTIONS = []; function useAutocomplete({ record, onChange, onReplace, completers, contentRef }) { const instanceId = (0,external_wp_compose_namespaceObject.useInstanceId)(useAutocomplete); const [selectedIndex, setSelectedIndex] = (0,external_wp_element_namespaceObject.useState)(0); const [filteredOptions, setFilteredOptions] = (0,external_wp_element_namespaceObject.useState)(EMPTY_FILTERED_OPTIONS); const [filterValue, setFilterValue] = (0,external_wp_element_namespaceObject.useState)(''); const [autocompleter, setAutocompleter] = (0,external_wp_element_namespaceObject.useState)(null); const [AutocompleterUI, setAutocompleterUI] = (0,external_wp_element_namespaceObject.useState)(null); const backspacing = (0,external_wp_element_namespaceObject.useRef)(false); function insertCompletion(replacement) { if (autocompleter === null) { return; } const end = record.start; const start = end - autocompleter.triggerPrefix.length - filterValue.length; const toInsert = (0,external_wp_richText_namespaceObject.create)({ html: (0,external_wp_element_namespaceObject.renderToString)(replacement) }); onChange((0,external_wp_richText_namespaceObject.insert)(record, toInsert, start, end)); } function select(option) { const { getOptionCompletion } = autocompleter || {}; if (option.isDisabled) { return; } if (getOptionCompletion) { const completion = getOptionCompletion(option.value, filterValue); const isCompletionObject = obj => { return obj !== null && typeof obj === 'object' && 'action' in obj && obj.action !== undefined && 'value' in obj && obj.value !== undefined; }; const completionObject = isCompletionObject(completion) ? completion : { action: 'insert-at-caret', value: completion }; if ('replace' === completionObject.action) { onReplace([completionObject.value]); // When replacing, the component will unmount, so don't reset // state (below) on an unmounted component. return; } else if ('insert-at-caret' === completionObject.action) { insertCompletion(completionObject.value); } } // Reset autocomplete state after insertion rather than before // so insertion events don't cause the completion menu to redisplay. reset(); } function reset() { setSelectedIndex(0); setFilteredOptions(EMPTY_FILTERED_OPTIONS); setFilterValue(''); setAutocompleter(null); setAutocompleterUI(null); } /** * Load options for an autocompleter. * * @param {Array} options */ function onChangeOptions(options) { setSelectedIndex(options.length === filteredOptions.length ? selectedIndex : 0); setFilteredOptions(options); } function handleKeyDown(event) { backspacing.current = event.key === 'Backspace'; if (!autocompleter) { return; } if (filteredOptions.length === 0) { return; } if (event.defaultPrevented) { return; } switch (event.key) { case 'ArrowUp': { const newIndex = (selectedIndex === 0 ? filteredOptions.length : selectedIndex) - 1; setSelectedIndex(newIndex); // See the related PR as to why this is necessary: https://github.com/WordPress/gutenberg/pull/54902. if ((0,external_wp_keycodes_namespaceObject.isAppleOS)()) { (0,external_wp_a11y_namespaceObject.speak)(getNodeText(filteredOptions[newIndex].label), 'assertive'); } break; } case 'ArrowDown': { const newIndex = (selectedIndex + 1) % filteredOptions.length; setSelectedIndex(newIndex); if ((0,external_wp_keycodes_namespaceObject.isAppleOS)()) { (0,external_wp_a11y_namespaceObject.speak)(getNodeText(filteredOptions[newIndex].label), 'assertive'); } break; } case 'Escape': setAutocompleter(null); setAutocompleterUI(null); event.preventDefault(); break; case 'Enter': select(filteredOptions[selectedIndex]); break; case 'ArrowLeft': case 'ArrowRight': reset(); return; default: return; } // Any handled key should prevent original behavior. This relies on // the early return in the default case. event.preventDefault(); } // textContent is a primitive (string), memoizing is not strictly necessary // but this is a preemptive performance improvement, since the autocompleter // is a potential bottleneck for the editor type metric. const textContent = (0,external_wp_element_namespaceObject.useMemo)(() => { if ((0,external_wp_richText_namespaceObject.isCollapsed)(record)) { return (0,external_wp_richText_namespaceObject.getTextContent)((0,external_wp_richText_namespaceObject.slice)(record, 0)); } return ''; }, [record]); (0,external_wp_element_namespaceObject.useEffect)(() => { if (!textContent) { if (autocompleter) { reset(); } return; } // Find the completer with the highest triggerPrefix index in the // textContent. const completer = completers.reduce((lastTrigger, currentCompleter) => { const triggerIndex = textContent.lastIndexOf(currentCompleter.triggerPrefix); const lastTriggerIndex = lastTrigger !== null ? textContent.lastIndexOf(lastTrigger.triggerPrefix) : -1; return triggerIndex > lastTriggerIndex ? currentCompleter : lastTrigger; }, null); if (!completer) { if (autocompleter) { reset(); } return; } const { allowContext, triggerPrefix } = completer; const triggerIndex = textContent.lastIndexOf(triggerPrefix); const textWithoutTrigger = textContent.slice(triggerIndex + triggerPrefix.length); const tooDistantFromTrigger = textWithoutTrigger.length > 50; // 50 chars seems to be a good limit. // This is a final barrier to prevent the effect from completing with // an extremely long string, which causes the editor to slow-down // significantly. This could happen, for example, if `matchingWhileBackspacing` // is true and one of the "words" end up being too long. If that's the case, // it will be caught by this guard. if (tooDistantFromTrigger) { return; } const mismatch = filteredOptions.length === 0; const wordsFromTrigger = textWithoutTrigger.split(/\s/); // We need to allow the effect to run when not backspacing and if there // was a mismatch. i.e when typing a trigger + the match string or when // clicking in an existing trigger word on the page. We do that if we // detect that we have one word from trigger in the current textual context. // // Ex.: "Some text @a" <-- "@a" will be detected as the trigger word and // allow the effect to run. It will run until there's a mismatch. const hasOneTriggerWord = wordsFromTrigger.length === 1; // This is used to allow the effect to run when backspacing and if // "touching" a word that "belongs" to a trigger. We consider a "trigger // word" any word up to the limit of 3 from the trigger character. // Anything beyond that is ignored if there's a mismatch. This allows // us to "escape" a mismatch when backspacing, but still imposing some // sane limits. // // Ex: "Some text @marcelo sekkkk" <--- "kkkk" caused a mismatch, but // if the user presses backspace here, it will show the completion popup again. const matchingWhileBackspacing = backspacing.current && wordsFromTrigger.length <= 3; if (mismatch && !(matchingWhileBackspacing || hasOneTriggerWord)) { if (autocompleter) { reset(); } return; } const textAfterSelection = (0,external_wp_richText_namespaceObject.getTextContent)((0,external_wp_richText_namespaceObject.slice)(record, undefined, (0,external_wp_richText_namespaceObject.getTextContent)(record).length)); if (allowContext && !allowContext(textContent.slice(0, triggerIndex), textAfterSelection)) { if (autocompleter) { reset(); } return; } if (/^\s/.test(textWithoutTrigger) || /\s\s+$/.test(textWithoutTrigger)) { if (autocompleter) { reset(); } return; } if (!/[\u0000-\uFFFF]*$/.test(textWithoutTrigger)) { if (autocompleter) { reset(); } return; } const safeTrigger = escapeRegExp(completer.triggerPrefix); const text = remove_accents_default()(textContent); const match = text.slice(text.lastIndexOf(completer.triggerPrefix)).match(new RegExp(`${safeTrigger}([\u0000-\uFFFF]*)$`)); const query = match && match[1]; setAutocompleter(completer); setAutocompleterUI(() => completer !== autocompleter ? getAutoCompleterUI(completer) : AutocompleterUI); setFilterValue(query === null ? '' : query); // Temporarily disabling exhaustive-deps to avoid introducing unexpected side effecst. // See https://github.com/WordPress/gutenberg/pull/41820 // eslint-disable-next-line react-hooks/exhaustive-deps }, [textContent]); const { key: selectedKey = '' } = filteredOptions[selectedIndex] || {}; const { className } = autocompleter || {}; const isExpanded = !!autocompleter && filteredOptions.length > 0; const listBoxId = isExpanded ? `components-autocomplete-listbox-${instanceId}` : undefined; const activeId = isExpanded ? `components-autocomplete-item-${instanceId}-${selectedKey}` : null; const hasSelection = record.start !== undefined; return { listBoxId, activeId, onKeyDown: withIgnoreIMEEvents(handleKeyDown), popover: hasSelection && AutocompleterUI && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(AutocompleterUI, { className: className, filterValue: filterValue, instanceId: instanceId, listBoxId: listBoxId, selectedIndex: selectedIndex, onChangeOptions: onChangeOptions, onSelect: select, value: record, contentRef: contentRef, reset: reset }) }; } function useLastDifferentValue(value) { const history = (0,external_wp_element_namespaceObject.useRef)(new Set()); history.current.add(value); // Keep the history size to 2. if (history.current.size > 2) { history.current.delete(Array.from(history.current)[0]); } return Array.from(history.current)[0]; } function useAutocompleteProps(options) { const ref = (0,external_wp_element_namespaceObject.useRef)(null); const onKeyDownRef = (0,external_wp_element_namespaceObject.useRef)(); const { record } = options; const previousRecord = useLastDifferentValue(record); const { popover, listBoxId, activeId, onKeyDown } = useAutocomplete({ ...options, contentRef: ref }); onKeyDownRef.current = onKeyDown; const mergedRefs = (0,external_wp_compose_namespaceObject.useMergeRefs)([ref, (0,external_wp_compose_namespaceObject.useRefEffect)(element => { function _onKeyDown(event) { onKeyDownRef.current?.(event); } element.addEventListener('keydown', _onKeyDown); return () => { element.removeEventListener('keydown', _onKeyDown); }; }, [])]); // We only want to show the popover if the user has typed something. const didUserInput = record.text !== previousRecord?.text; if (!didUserInput) { return { ref: mergedRefs }; } return { ref: mergedRefs, children: popover, 'aria-autocomplete': listBoxId ? 'list' : undefined, 'aria-owns': listBoxId, 'aria-activedescendant': activeId }; } function Autocomplete({ children, isSelected, ...options }) { const { popover, ...props } = useAutocomplete(options); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [children(props), isSelected && popover] }); } ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/base-control/hooks.js /** * WordPress dependencies */ /** * Internal dependencies */ /** * Generate props for the `BaseControl` and the inner control itself. * * Namely, it takes care of generating a unique `id`, properly associating it with the `label` and `help` elements. * * @param props */ function useBaseControlProps(props) { const { help, id: preferredId, ...restProps } = props; const uniqueId = (0,external_wp_compose_namespaceObject.useInstanceId)(base_control, 'wp-components-base-control', preferredId); return { baseControlProps: { id: uniqueId, help, ...restProps }, controlProps: { id: uniqueId, ...(!!help ? { 'aria-describedby': `${uniqueId}__help` } : {}) } }; } ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/link.js /** * WordPress dependencies */ const link_link = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M10 17.389H8.444A5.194 5.194 0 1 1 8.444 7H10v1.5H8.444a3.694 3.694 0 0 0 0 7.389H10v1.5ZM14 7h1.556a5.194 5.194 0 0 1 0 10.39H14v-1.5h1.556a3.694 3.694 0 0 0 0-7.39H14V7Zm-4.5 6h5v-1.5h-5V13Z" }) }); /* harmony default export */ const library_link = (link_link); ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/link-off.js /** * WordPress dependencies */ const linkOff = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M17.031 4.703 15.576 4l-1.56 3H14v.03l-2.324 4.47H9.5V13h1.396l-1.502 2.889h-.95a3.694 3.694 0 0 1 0-7.389H10V7H8.444a5.194 5.194 0 1 0 0 10.389h.17L7.5 19.53l1.416.719L15.049 8.5h.507a3.694 3.694 0 0 1 0 7.39H14v1.5h1.556a5.194 5.194 0 0 0 .273-10.383l1.202-2.304Z" }) }); /* harmony default export */ const link_off = (linkOff); ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/border-box-control/styles.js function border_box_control_styles_EMOTION_STRINGIFIED_CSS_ERROR_() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; } /** * External dependencies */ /** * Internal dependencies */ const borderBoxControl = /*#__PURE__*/emotion_react_browser_esm_css( true ? "" : 0, true ? "" : 0); const linkedBorderControl = () => /*#__PURE__*/emotion_react_browser_esm_css("flex:1;", rtl({ marginRight: '24px' })(), ";" + ( true ? "" : 0), true ? "" : 0); const wrapper = true ? { name: "bjn8wh", styles: "position:relative" } : 0; const borderBoxControlLinkedButton = size => { return /*#__PURE__*/emotion_react_browser_esm_css("position:absolute;top:", size === '__unstable-large' ? '8px' : '3px', ";", rtl({ right: 0 })(), " line-height:0;" + ( true ? "" : 0), true ? "" : 0); }; const borderBoxStyleWithFallback = border => { const { color = COLORS.gray[200], style = 'solid', width = config_values.borderWidth } = border || {}; const clampedWidth = width !== config_values.borderWidth ? `clamp(1px, ${width}, 10px)` : width; const hasVisibleBorder = !!width && width !== '0' || !!color; const borderStyle = hasVisibleBorder ? style || 'solid' : style; return `${color} ${borderStyle} ${clampedWidth}`; }; const borderBoxControlVisualizer = (borders, size) => { return /*#__PURE__*/emotion_react_browser_esm_css("position:absolute;top:", size === '__unstable-large' ? '20px' : '15px', ";right:", size === '__unstable-large' ? '39px' : '29px', ";bottom:", size === '__unstable-large' ? '20px' : '15px', ";left:", size === '__unstable-large' ? '39px' : '29px', ";border-top:", borderBoxStyleWithFallback(borders?.top), ";border-bottom:", borderBoxStyleWithFallback(borders?.bottom), ";", rtl({ borderLeft: borderBoxStyleWithFallback(borders?.left) })(), " ", rtl({ borderRight: borderBoxStyleWithFallback(borders?.right) })(), ";" + ( true ? "" : 0), true ? "" : 0); }; const borderBoxControlSplitControls = size => /*#__PURE__*/emotion_react_browser_esm_css("position:relative;flex:1;width:", size === '__unstable-large' ? undefined : '80%', ";" + ( true ? "" : 0), true ? "" : 0); const centeredBorderControl = true ? { name: "1nwbfnf", styles: "grid-column:span 2;margin:0 auto" } : 0; const rightBorderControl = () => /*#__PURE__*/emotion_react_browser_esm_css(rtl({ marginLeft: 'auto' })(), ";" + ( true ? "" : 0), true ? "" : 0); ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/border-box-control/border-box-control-linked-button/hook.js /** * WordPress dependencies */ /** * Internal dependencies */ function useBorderBoxControlLinkedButton(props) { const { className, size = 'default', ...otherProps } = useContextSystem(props, 'BorderBoxControlLinkedButton'); // Generate class names. const cx = useCx(); const classes = (0,external_wp_element_namespaceObject.useMemo)(() => { return cx(borderBoxControlLinkedButton(size), className); }, [className, cx, size]); return { ...otherProps, className: classes }; } ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/border-box-control/border-box-control-linked-button/component.js /** * WordPress dependencies */ /** * Internal dependencies */ const BorderBoxControlLinkedButton = (props, forwardedRef) => { const { className, isLinked, ...buttonProps } = useBorderBoxControlLinkedButton(props); const label = isLinked ? (0,external_wp_i18n_namespaceObject.__)('Unlink sides') : (0,external_wp_i18n_namespaceObject.__)('Link sides'); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(tooltip, { text: label, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(component, { className: className, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(build_module_button, { ...buttonProps, size: "small", icon: isLinked ? library_link : link_off, iconSize: 24, "aria-label": label, ref: forwardedRef }) }) }); }; const ConnectedBorderBoxControlLinkedButton = contextConnect(BorderBoxControlLinkedButton, 'BorderBoxControlLinkedButton'); /* harmony default export */ const border_box_control_linked_button_component = (ConnectedBorderBoxControlLinkedButton); ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/border-box-control/border-box-control-visualizer/hook.js /** * WordPress dependencies */ /** * Internal dependencies */ function useBorderBoxControlVisualizer(props) { const { className, value, size = 'default', ...otherProps } = useContextSystem(props, 'BorderBoxControlVisualizer'); // Generate class names. const cx = useCx(); const classes = (0,external_wp_element_namespaceObject.useMemo)(() => { return cx(borderBoxControlVisualizer(value, size), className); }, [cx, className, value, size]); return { ...otherProps, className: classes, value }; } ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/border-box-control/border-box-control-visualizer/component.js /** * WordPress dependencies */ /** * Internal dependencies */ const BorderBoxControlVisualizer = (props, forwardedRef) => { const { value, ...otherProps } = useBorderBoxControlVisualizer(props); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(component, { ...otherProps, ref: forwardedRef }); }; const ConnectedBorderBoxControlVisualizer = contextConnect(BorderBoxControlVisualizer, 'BorderBoxControlVisualizer'); /* harmony default export */ const border_box_control_visualizer_component = (ConnectedBorderBoxControlVisualizer); ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/close-small.js /** * WordPress dependencies */ const closeSmall = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M12 13.06l3.712 3.713 1.061-1.06L13.061 12l3.712-3.712-1.06-1.06L12 10.938 8.288 7.227l-1.061 1.06L10.939 12l-3.712 3.712 1.06 1.061L12 13.061z" }) }); /* harmony default export */ const close_small = (closeSmall); ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/line-solid.js /** * WordPress dependencies */ const lineSolid = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M5 11.25h14v1.5H5z" }) }); /* harmony default export */ const line_solid = (lineSolid); ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/line-dashed.js /** * WordPress dependencies */ const lineDashed = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { fillRule: "evenodd", d: "M5 11.25h3v1.5H5v-1.5zm5.5 0h3v1.5h-3v-1.5zm8.5 0h-3v1.5h3v-1.5z", clipRule: "evenodd" }) }); /* harmony default export */ const line_dashed = (lineDashed); ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/line-dotted.js /** * WordPress dependencies */ const lineDotted = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { fillRule: "evenodd", d: "M5.25 11.25h1.5v1.5h-1.5v-1.5zm3 0h1.5v1.5h-1.5v-1.5zm4.5 0h-1.5v1.5h1.5v-1.5zm1.5 0h1.5v1.5h-1.5v-1.5zm4.5 0h-1.5v1.5h1.5v-1.5z", clipRule: "evenodd" }) }); /* harmony default export */ const line_dotted = (lineDotted); ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/context/DeprecatedLayoutGroupContext.mjs /** * Note: Still used by components generated by old versions of Framer * * @deprecated */ const DeprecatedLayoutGroupContext = (0,external_React_.createContext)(null); ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/projection/node/group.mjs const notify = (node) => !node.isLayoutDirty && node.willUpdate(false); function nodeGroup() { const nodes = new Set(); const subscriptions = new WeakMap(); const dirtyAll = () => nodes.forEach(notify); return { add: (node) => { nodes.add(node); subscriptions.set(node, node.addEventListener("willUpdate", dirtyAll)); }, remove: (node) => { nodes.delete(node); const unsubscribe = subscriptions.get(node); if (unsubscribe) { unsubscribe(); subscriptions.delete(node); } dirtyAll(); }, dirty: dirtyAll, }; } ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/components/LayoutGroup/index.mjs const shouldInheritGroup = (inherit) => inherit === true; const shouldInheritId = (inherit) => shouldInheritGroup(inherit === true) || inherit === "id"; const LayoutGroup = ({ children, id, inherit = true }) => { const layoutGroupContext = (0,external_React_.useContext)(LayoutGroupContext); const deprecatedLayoutGroupContext = (0,external_React_.useContext)(DeprecatedLayoutGroupContext); const [forceRender, key] = use_force_update_useForceUpdate(); const context = (0,external_React_.useRef)(null); const upstreamId = layoutGroupContext.id || deprecatedLayoutGroupContext; if (context.current === null) { if (shouldInheritId(inherit) && upstreamId) { id = id ? upstreamId + "-" + id : upstreamId; } context.current = { id, group: shouldInheritGroup(inherit) ? layoutGroupContext.group || nodeGroup() : nodeGroup(), }; } const memoizedContext = (0,external_React_.useMemo)(() => ({ ...context.current, forceRender }), [key]); return ((0,external_ReactJSXRuntime_namespaceObject.jsx)(LayoutGroupContext.Provider, { value: memoizedContext, children: children })); }; ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/toggle-group-control/toggle-group-control/styles.js function toggle_group_control_styles_EMOTION_STRINGIFIED_CSS_ERROR_() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; } /** * External dependencies */ /** * Internal dependencies */ const toggleGroupControl = ({ isBlock, isDeselectable, size }) => /*#__PURE__*/emotion_react_browser_esm_css("background:", COLORS.ui.background, ";border:1px solid transparent;border-radius:", config_values.controlBorderRadius, ";display:inline-flex;min-width:0;position:relative;", toggleGroupControlSize(size), " ", !isDeselectable && enclosingBorders(isBlock), ";" + ( true ? "" : 0), true ? "" : 0); const enclosingBorders = isBlock => { const enclosingBorder = /*#__PURE__*/emotion_react_browser_esm_css("border-color:", COLORS.ui.border, ";" + ( true ? "" : 0), true ? "" : 0); return /*#__PURE__*/emotion_react_browser_esm_css(isBlock && enclosingBorder, " &:hover{border-color:", COLORS.ui.borderHover, ";}&:focus-within{border-color:", COLORS.ui.borderFocus, ";box-shadow:", config_values.controlBoxShadowFocus, ";z-index:1;outline:2px solid transparent;outline-offset:-2px;}" + ( true ? "" : 0), true ? "" : 0); }; var styles_ref = true ? { name: "1aqh2c7", styles: "min-height:40px;padding:3px" } : 0; var _ref2 = true ? { name: "1ndywgm", styles: "min-height:36px;padding:2px" } : 0; const toggleGroupControlSize = size => { const styles = { default: _ref2, '__unstable-large': styles_ref }; return styles[size]; }; const toggle_group_control_styles_block = true ? { name: "7whenc", styles: "display:flex;width:100%" } : 0; const VisualLabelWrapper = /*#__PURE__*/emotion_styled_base_browser_esm("div", true ? { target: "eakva830" } : 0)( true ? { name: "zjik7", styles: "display:flex" } : 0); ;// CONCATENATED MODULE: ./node_modules/@ariakit/core/esm/radio/radio-store.js "use client"; // src/radio/radio-store.ts function createRadioStore(_a = {}) { var props = _4R3V3JGP_objRest(_a, []); var _a2; const syncState = (_a2 = props.store) == null ? void 0 : _a2.getState(); const composite = createCompositeStore(_chunks_4R3V3JGP_spreadProps(_chunks_4R3V3JGP_spreadValues({}, props), { focusLoop: defaultValue(props.focusLoop, syncState == null ? void 0 : syncState.focusLoop, true) })); const initialState = _chunks_4R3V3JGP_spreadProps(_chunks_4R3V3JGP_spreadValues({}, composite.getState()), { value: defaultValue( props.value, syncState == null ? void 0 : syncState.value, props.defaultValue, null ) }); const radio = createStore(initialState, composite, props.store); return _chunks_4R3V3JGP_spreadProps(_chunks_4R3V3JGP_spreadValues(_chunks_4R3V3JGP_spreadValues({}, composite), radio), { setValue: (value) => radio.setState("value", value) }); } ;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/LEIRFLRL.js "use client"; // src/radio/radio-store.ts function useRadioStoreProps(store, update, props) { store = useCompositeStoreProps(store, update, props); useStoreProps(store, props, "value", "setValue"); return store; } function useRadioStore(props = {}) { const [store, update] = EKQEJRUF_useStore(createRadioStore, props); return useRadioStoreProps(store, update, props); } ;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/XEV62JUQ.js "use client"; // src/radio/radio-context.tsx var XEV62JUQ_ctx = createStoreContext( [CompositeContextProvider], [CompositeScopedContextProvider] ); var useRadioContext = XEV62JUQ_ctx.useContext; var useRadioScopedContext = XEV62JUQ_ctx.useScopedContext; var useRadioProviderContext = XEV62JUQ_ctx.useProviderContext; var RadioContextProvider = XEV62JUQ_ctx.ContextProvider; var RadioScopedContextProvider = XEV62JUQ_ctx.ScopedContextProvider; ;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/radio/radio-group.js "use client"; // src/radio/radio-group.tsx var useRadioGroup = createHook( (_a) => { var _b = _a, { store } = _b, props = __objRest(_b, ["store"]); const context = useRadioProviderContext(); store = store || context; invariant( store, false && 0 ); props = useWrapElement( props, (element) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(RadioScopedContextProvider, { value: store, children: element }), [store] ); props = _4R3V3JGP_spreadValues({ role: "radiogroup" }, props); props = useComposite(_4R3V3JGP_spreadValues({ store }, props)); return props; } ); var RadioGroup = createComponent((props) => { const htmlProps = useRadioGroup(props); return _3ORBWXWF_createElement("div", htmlProps); }); if (false) {} ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/toggle-group-control/context.js /** * WordPress dependencies */ /** * Internal dependencies */ const ToggleGroupControlContext = (0,external_wp_element_namespaceObject.createContext)({}); const useToggleGroupControlContext = () => (0,external_wp_element_namespaceObject.useContext)(ToggleGroupControlContext); /* harmony default export */ const toggle_group_control_context = (ToggleGroupControlContext); ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/toggle-group-control/toggle-group-control/utils.js /** * WordPress dependencies */ /** * Internal dependencies */ /** * Used to determine, via an internal heuristics, whether an `undefined` value * received for the `value` prop should be interpreted as the component being * used in uncontrolled mode, or as an "empty" value for controlled mode. * * @param valueProp The received `value` */ function useComputeControlledOrUncontrolledValue(valueProp) { const isInitialRender = (0,external_wp_element_namespaceObject.useRef)(true); const prevValueProp = (0,external_wp_compose_namespaceObject.usePrevious)(valueProp); const prevIsControlled = (0,external_wp_element_namespaceObject.useRef)(false); (0,external_wp_element_namespaceObject.useEffect)(() => { if (isInitialRender.current) { isInitialRender.current = false; } }, []); // Assume the component is being used in controlled mode on the first re-render // that has a different `valueProp` from the previous render. const isControlled = prevIsControlled.current || !isInitialRender.current && prevValueProp !== valueProp; (0,external_wp_element_namespaceObject.useEffect)(() => { prevIsControlled.current = isControlled; }, [isControlled]); if (isControlled) { // When in controlled mode, use `''` instead of `undefined` return { value: valueProp !== null && valueProp !== void 0 ? valueProp : '', defaultValue: undefined }; } // When in uncontrolled mode, the `value` should be intended as the initial value return { value: undefined, defaultValue: valueProp }; } ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/toggle-group-control/toggle-group-control/as-radio-group.js /** * External dependencies */ // eslint-disable-next-line no-restricted-imports /** * WordPress dependencies */ /** * Internal dependencies */ function UnforwardedToggleGroupControlAsRadioGroup({ children, isAdaptiveWidth, label, onChange: onChangeProp, size, value: valueProp, id: idProp, ...otherProps }, forwardedRef) { const generatedId = (0,external_wp_compose_namespaceObject.useInstanceId)(ToggleGroupControlAsRadioGroup, 'toggle-group-control-as-radio-group'); const baseId = idProp || generatedId; // Use a heuristic to understand if the component is being used in controlled // or uncontrolled mode, and consequently: // - when controlled, convert `undefined` values to `''` (ie. "no value") // - use the `value` prop as the `defaultValue` when uncontrolled const { value, defaultValue } = useComputeControlledOrUncontrolledValue(valueProp); // `useRadioStore`'s `setValue` prop can be called with `null`, while // the component's `onChange` prop only expects `undefined` const wrappedOnChangeProp = onChangeProp ? v => { onChangeProp(v !== null && v !== void 0 ? v : undefined); } : undefined; const radio = useRadioStore({ defaultValue, value, setValue: wrappedOnChangeProp }); const selectedValue = radio.useState('value'); const setValue = radio.setValue; const groupContextValue = (0,external_wp_element_namespaceObject.useMemo)(() => ({ baseId, isBlock: !isAdaptiveWidth, size, value: selectedValue, setValue }), [baseId, isAdaptiveWidth, size, selectedValue, setValue]); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(toggle_group_control_context.Provider, { value: groupContextValue, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(RadioGroup, { store: radio, "aria-label": label, render: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(component, {}), ...otherProps, id: baseId, ref: forwardedRef, children: children }) }); } const ToggleGroupControlAsRadioGroup = (0,external_wp_element_namespaceObject.forwardRef)(UnforwardedToggleGroupControlAsRadioGroup); ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/utils/hooks/use-controlled-value.js /** * WordPress dependencies */ /** * Simplified and improved implementation of useControlledState. * * @param props * @param props.defaultValue * @param props.value * @param props.onChange * @return The controlled value and the value setter. */ function useControlledValue({ defaultValue, onChange, value: valueProp }) { const hasValue = typeof valueProp !== 'undefined'; const initialValue = hasValue ? valueProp : defaultValue; const [state, setState] = (0,external_wp_element_namespaceObject.useState)(initialValue); const value = hasValue ? valueProp : state; let setValue; if (hasValue && typeof onChange === 'function') { setValue = onChange; } else if (!hasValue && typeof onChange === 'function') { setValue = nextValue => { onChange(nextValue); setState(nextValue); }; } else { setValue = setState; } return [value, setValue]; } ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/toggle-group-control/toggle-group-control/as-button-group.js /** * WordPress dependencies */ /** * Internal dependencies */ function UnforwardedToggleGroupControlAsButtonGroup({ children, isAdaptiveWidth, label, onChange, size, value: valueProp, id: idProp, ...otherProps }, forwardedRef) { const generatedId = (0,external_wp_compose_namespaceObject.useInstanceId)(ToggleGroupControlAsButtonGroup, 'toggle-group-control-as-button-group'); const baseId = idProp || generatedId; // Use a heuristic to understand if the component is being used in controlled // or uncontrolled mode, and consequently: // - when controlled, convert `undefined` values to `''` (ie. "no value") // - use the `value` prop as the `defaultValue` when uncontrolled const { value, defaultValue } = useComputeControlledOrUncontrolledValue(valueProp); const [selectedValue, setSelectedValue] = useControlledValue({ defaultValue, value, onChange }); const groupContextValue = (0,external_wp_element_namespaceObject.useMemo)(() => ({ baseId, value: selectedValue, setValue: setSelectedValue, isBlock: !isAdaptiveWidth, isDeselectable: true, size }), [baseId, selectedValue, setSelectedValue, isAdaptiveWidth, size]); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(toggle_group_control_context.Provider, { value: groupContextValue, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(component, { "aria-label": label, ...otherProps, ref: forwardedRef, role: "group", children: children }) }); } const ToggleGroupControlAsButtonGroup = (0,external_wp_element_namespaceObject.forwardRef)(UnforwardedToggleGroupControlAsButtonGroup); ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/toggle-group-control/toggle-group-control/component.js /** * External dependencies */ // eslint-disable-next-line no-restricted-imports /** * WordPress dependencies */ /** * Internal dependencies */ function UnconnectedToggleGroupControl(props, forwardedRef) { const { __nextHasNoMarginBottom = false, __next40pxDefaultSize = false, className, isAdaptiveWidth = false, isBlock = false, isDeselectable = false, label, hideLabelFromVision = false, help, onChange, size = 'default', value, children, ...otherProps } = useContextSystem(props, 'ToggleGroupControl'); const baseId = (0,external_wp_compose_namespaceObject.useInstanceId)(ToggleGroupControl, 'toggle-group-control'); const normalizedSize = __next40pxDefaultSize && size === 'default' ? '__unstable-large' : size; const cx = useCx(); const classes = (0,external_wp_element_namespaceObject.useMemo)(() => cx(toggleGroupControl({ isBlock, isDeselectable, size: normalizedSize }), isBlock && toggle_group_control_styles_block, className), [className, cx, isBlock, isDeselectable, normalizedSize]); const MainControl = isDeselectable ? ToggleGroupControlAsButtonGroup : ToggleGroupControlAsRadioGroup; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(base_control, { help: help, __nextHasNoMarginBottom: __nextHasNoMarginBottom, children: [!hideLabelFromVision && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(VisualLabelWrapper, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(base_control.VisualLabel, { children: label }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(MainControl, { ...otherProps, className: classes, isAdaptiveWidth: isAdaptiveWidth, label: label, onChange: onChange, ref: forwardedRef, size: normalizedSize, value: value, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(LayoutGroup, { id: baseId, children: children }) })] }); } /** * `ToggleGroupControl` is a form component that lets users choose options * represented in horizontal segments. To render options for this control use * `ToggleGroupControlOption` component. * * This component is intended for selecting a single persistent value from a set of options, * similar to a how a radio button group would work. If you simply want a toggle to switch between views, * use a `TabPanel` instead. * * Only use this control when you know for sure the labels of items inside won't * wrap. For items with longer labels, you can consider a `SelectControl` or a * `CustomSelectControl` component instead. * * ```jsx * import { * __experimentalToggleGroupControl as ToggleGroupControl, * __experimentalToggleGroupControlOption as ToggleGroupControlOption, * } from '@wordpress/components'; * * function Example() { * return ( * * * * * ); * } * ``` */ const ToggleGroupControl = contextConnect(UnconnectedToggleGroupControl, 'ToggleGroupControl'); /* harmony default export */ const toggle_group_control_component = (ToggleGroupControl); ;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/JL6IRDFK.js "use client"; // src/radio/radio.ts function getIsChecked(value, storeValue) { if (storeValue === void 0) return; if (value != null && storeValue != null) { return storeValue === value; } return !!storeValue; } function isNativeRadio(tagName, type) { return tagName === "input" && (!type || type === "radio"); } var useRadio = createHook( (_a) => { var _b = _a, { store, name, value, checked } = _b, props = __objRest(_b, ["store", "name", "value", "checked"]); const context = useRadioContext(); store = store || context; const id = useId(props.id); const ref = (0,external_React_.useRef)(null); const isChecked = useStoreState( store, (state) => checked != null ? checked : getIsChecked(value, state == null ? void 0 : state.value) ); (0,external_React_.useEffect)(() => { if (!id) return; if (!isChecked) return; const isActiveItem = (store == null ? void 0 : store.getState().activeId) === id; if (isActiveItem) return; store == null ? void 0 : store.setActiveId(id); }, [store, isChecked, id]); const onChangeProp = props.onChange; const tagName = useTagName(ref, props.as || "input"); const nativeRadio = isNativeRadio(tagName, props.type); const disabled = disabledFromProps(props); const [propertyUpdated, schedulePropertyUpdate] = useForceUpdate(); (0,external_React_.useEffect)(() => { const element = ref.current; if (!element) return; if (nativeRadio) return; if (isChecked !== void 0) { element.checked = isChecked; } if (name !== void 0) { element.name = name; } if (value !== void 0) { element.value = `${value}`; } }, [propertyUpdated, nativeRadio, isChecked, name, value]); const onChange = useEvent((event) => { if (disabled) { event.preventDefault(); event.stopPropagation(); return; } if (!nativeRadio) { event.currentTarget.checked = true; schedulePropertyUpdate(); } onChangeProp == null ? void 0 : onChangeProp(event); if (event.defaultPrevented) return; store == null ? void 0 : store.setValue(value); }); const onClickProp = props.onClick; const onClick = useEvent((event) => { onClickProp == null ? void 0 : onClickProp(event); if (event.defaultPrevented) return; if (nativeRadio) return; onChange(event); }); const onFocusProp = props.onFocus; const onFocus = useEvent((event) => { onFocusProp == null ? void 0 : onFocusProp(event); if (event.defaultPrevented) return; if (!nativeRadio) return; if (!store) return; const { moves, activeId } = store.getState(); if (!moves) return; if (id && activeId !== id) return; onChange(event); }); props = _4R3V3JGP_spreadProps(_4R3V3JGP_spreadValues({ id, role: !nativeRadio ? "radio" : void 0, type: nativeRadio ? "radio" : void 0, "aria-checked": isChecked }, props), { ref: useMergeRefs(ref, props.ref), onChange, onClick, onFocus }); props = useCompositeItem(_4R3V3JGP_spreadValues({ store, clickOnEnter: !nativeRadio }, props)); return _4R3V3JGP_spreadValues({ name: nativeRadio ? name : void 0, value: nativeRadio ? value : void 0, checked: isChecked }, props); } ); var Radio = createMemoComponent((props) => { const htmlProps = useRadio(props); return _3ORBWXWF_createElement("input", htmlProps); }); if (false) {} ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/toggle-group-control/toggle-group-control-option-base/styles.js function toggle_group_control_option_base_styles_EMOTION_STRINGIFIED_CSS_ERROR_() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; } /** * External dependencies */ /** * Internal dependencies */ const LabelView = /*#__PURE__*/emotion_styled_base_browser_esm("div", true ? { target: "et6ln9s1" } : 0)( true ? { name: "sln1fl", styles: "display:inline-flex;max-width:100%;min-width:0;position:relative" } : 0); const labelBlock = true ? { name: "82a6rk", styles: "flex:1" } : 0; const buttonView = ({ isDeselectable, isIcon, isPressed, size }) => /*#__PURE__*/emotion_react_browser_esm_css("align-items:center;appearance:none;background:transparent;border:none;border-radius:", config_values.controlBorderRadius, ";color:", COLORS.gray[700], ";fill:currentColor;cursor:pointer;display:flex;font-family:inherit;height:100%;justify-content:center;line-height:100%;outline:none;padding:0 12px;position:relative;text-align:center;@media not ( prefers-reduced-motion ){transition:background ", config_values.transitionDurationFast, " linear,color ", config_values.transitionDurationFast, " linear,font-weight 60ms linear;}user-select:none;width:100%;z-index:2;&::-moz-focus-inner{border:0;}&:active{background:", config_values.toggleGroupControlBackgroundColor, ";}", isDeselectable && deselectable, " ", isIcon && isIconStyles({ size }), " ", isPressed && pressed, ";" + ( true ? "" : 0), true ? "" : 0); const pressed = /*#__PURE__*/emotion_react_browser_esm_css("color:", COLORS.white, ";&:active{background:transparent;}" + ( true ? "" : 0), true ? "" : 0); const deselectable = /*#__PURE__*/emotion_react_browser_esm_css("color:", COLORS.gray[900], ";&:focus{box-shadow:inset 0 0 0 1px ", COLORS.white, ",0 0 0 ", config_values.borderWidthFocus, " ", COLORS.theme.accent, ";outline:2px solid transparent;}" + ( true ? "" : 0), true ? "" : 0); const ButtonContentView = /*#__PURE__*/emotion_styled_base_browser_esm("div", true ? { target: "et6ln9s0" } : 0)("display:flex;font-size:", config_values.fontSize, ";line-height:1;" + ( true ? "" : 0)); const isIconStyles = ({ size = 'default' }) => { const iconButtonSizes = { default: '30px', '__unstable-large': '32px' }; return /*#__PURE__*/emotion_react_browser_esm_css("color:", COLORS.gray[900], ";height:", iconButtonSizes[size], ";aspect-ratio:1;padding-left:0;padding-right:0;" + ( true ? "" : 0), true ? "" : 0); }; const backdropView = /*#__PURE__*/emotion_react_browser_esm_css("background:", COLORS.gray[900], ";border-radius:", config_values.controlBorderRadius, ";position:absolute;inset:0;z-index:1;outline:2px solid transparent;outline-offset:-3px;" + ( true ? "" : 0), true ? "" : 0); ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/toggle-group-control/toggle-group-control-option-base/component.js /** * External dependencies */ // eslint-disable-next-line no-restricted-imports // eslint-disable-next-line no-restricted-imports /** * WordPress dependencies */ /** * Internal dependencies */ const { ButtonContentView: component_ButtonContentView, LabelView: component_LabelView } = toggle_group_control_option_base_styles_namespaceObject; const REDUCED_MOTION_TRANSITION_CONFIG = { duration: 0 }; const LAYOUT_ID = 'toggle-group-backdrop-shared-layout-id'; const WithToolTip = ({ showTooltip, text, children }) => { if (showTooltip && text) { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(tooltip, { text: text, placement: "top", children: children }); } return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: children }); }; function ToggleGroupControlOptionBase(props, forwardedRef) { const shouldReduceMotion = (0,external_wp_compose_namespaceObject.useReducedMotion)(); const toggleGroupControlContext = useToggleGroupControlContext(); const id = (0,external_wp_compose_namespaceObject.useInstanceId)(ToggleGroupControlOptionBase, toggleGroupControlContext.baseId || 'toggle-group-control-option-base'); const buttonProps = useContextSystem({ ...props, id }, 'ToggleGroupControlOptionBase'); const { isBlock = false, isDeselectable = false, size = 'default' } = toggleGroupControlContext; const { className, isIcon = false, value, children, showTooltip = false, onFocus: onFocusProp, ...otherButtonProps } = buttonProps; const isPressed = toggleGroupControlContext.value === value; const cx = useCx(); const labelViewClasses = (0,external_wp_element_namespaceObject.useMemo)(() => cx(isBlock && labelBlock), [cx, isBlock]); const itemClasses = (0,external_wp_element_namespaceObject.useMemo)(() => cx(buttonView({ isDeselectable, isIcon, isPressed, size }), className), [cx, isDeselectable, isIcon, isPressed, size, className]); const backdropClasses = (0,external_wp_element_namespaceObject.useMemo)(() => cx(backdropView), [cx]); const buttonOnClick = () => { if (isDeselectable && isPressed) { toggleGroupControlContext.setValue(undefined); } else { toggleGroupControlContext.setValue(value); } }; const commonProps = { ...otherButtonProps, className: itemClasses, 'data-value': value, ref: forwardedRef }; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(component_LabelView, { className: labelViewClasses, children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(WithToolTip, { showTooltip: showTooltip, text: otherButtonProps['aria-label'], children: isDeselectable ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("button", { ...commonProps, onFocus: onFocusProp, "aria-pressed": isPressed, type: "button", onClick: buttonOnClick, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(component_ButtonContentView, { children: children }) }) : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Radio, { render: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("button", { type: "button", ...commonProps, onFocus: event => { onFocusProp?.(event); if (event.defaultPrevented) { return; } toggleGroupControlContext.setValue(value); } }), value: value, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(component_ButtonContentView, { children: children }) }) }), isPressed ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(motion.div, { layout: true, layoutRoot: true, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(motion.div, { className: backdropClasses, transition: shouldReduceMotion ? REDUCED_MOTION_TRANSITION_CONFIG : undefined, role: "presentation", layoutId: LAYOUT_ID }) }) : null] }); } /** * `ToggleGroupControlOptionBase` is a form component and is meant to be used as an internal, * generic component for any children of `ToggleGroupControl`. * * @example * ```jsx * import { * __experimentalToggleGroupControl as ToggleGroupControl, * __experimentalToggleGroupControlOptionBase as ToggleGroupControlOptionBase, * } from '@wordpress/components'; * * function Example() { * return ( * * * * * ); * } * ``` */ const ConnectedToggleGroupControlOptionBase = contextConnect(ToggleGroupControlOptionBase, 'ToggleGroupControlOptionBase'); /* harmony default export */ const toggle_group_control_option_base_component = (ConnectedToggleGroupControlOptionBase); ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/toggle-group-control/toggle-group-control-option-icon/component.js /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ function UnforwardedToggleGroupControlOptionIcon(props, ref) { const { icon, label, ...restProps } = props; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(toggle_group_control_option_base_component, { ...restProps, isIcon: true, "aria-label": label, showTooltip: true, ref: ref, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(build_module_icon, { icon: icon }) }); } /** * `ToggleGroupControlOptionIcon` is a form component which is meant to be used as a * child of `ToggleGroupControl` and displays an icon. * * ```jsx * * import { * __experimentalToggleGroupControl as ToggleGroupControl, * __experimentalToggleGroupControlOptionIcon as ToggleGroupControlOptionIcon, * from '@wordpress/components'; * import { formatLowercase, formatUppercase } from '@wordpress/icons'; * * function Example() { * return ( * * * * * ); * } * ``` */ const ToggleGroupControlOptionIcon = (0,external_wp_element_namespaceObject.forwardRef)(UnforwardedToggleGroupControlOptionIcon); /* harmony default export */ const toggle_group_control_option_icon_component = (ToggleGroupControlOptionIcon); ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/border-control/border-control-style-picker/component.js /** * WordPress dependencies */ /** * Internal dependencies */ const BORDER_STYLES = [{ label: (0,external_wp_i18n_namespaceObject.__)('Solid'), icon: line_solid, value: 'solid' }, { label: (0,external_wp_i18n_namespaceObject.__)('Dashed'), icon: line_dashed, value: 'dashed' }, { label: (0,external_wp_i18n_namespaceObject.__)('Dotted'), icon: line_dotted, value: 'dotted' }]; function UnconnectedBorderControlStylePicker({ onChange, ...restProps }, forwardedRef) { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(toggle_group_control_component, { __nextHasNoMarginBottom: true, __next40pxDefaultSize: true, ref: forwardedRef, isDeselectable: true, onChange: value => { onChange?.(value); }, ...restProps, children: BORDER_STYLES.map(borderStyle => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(toggle_group_control_option_icon_component, { value: borderStyle.value, icon: borderStyle.icon, label: borderStyle.label }, borderStyle.value)) }); } const BorderControlStylePicker = contextConnect(UnconnectedBorderControlStylePicker, 'BorderControlStylePicker'); /* harmony default export */ const border_control_style_picker_component = (BorderControlStylePicker); ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/color-indicator/index.js /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ function UnforwardedColorIndicator(props, forwardedRef) { const { className, colorValue, ...additionalProps } = props; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { className: dist_clsx('component-color-indicator', className), style: { background: colorValue }, ref: forwardedRef, ...additionalProps }); } /** * ColorIndicator is a React component that renders a specific color in a * circle. It's often used to summarize a collection of used colors in a child * component. * * ```jsx * import { ColorIndicator } from '@wordpress/components'; * * const MyColorIndicator = () => ; * ``` */ const ColorIndicator = (0,external_wp_element_namespaceObject.forwardRef)(UnforwardedColorIndicator); /* harmony default export */ const color_indicator = (ColorIndicator); ;// CONCATENATED MODULE: ./node_modules/colord/plugins/a11y.mjs var a11y_o=function(o){var t=o/255;return t<.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)},a11y_t=function(t){return.2126*a11y_o(t.r)+.7152*a11y_o(t.g)+.0722*a11y_o(t.b)};/* harmony default export */ function a11y(o){o.prototype.luminance=function(){return o=a11y_t(this.rgba),void 0===(r=2)&&(r=0),void 0===n&&(n=Math.pow(10,r)),Math.round(n*o)/n+0;var o,r,n},o.prototype.contrast=function(r){void 0===r&&(r="#FFF");var n,a,i,e,v,u,d,c=r instanceof o?r:new o(r);return e=this.rgba,v=c.toRgb(),u=a11y_t(e),d=a11y_t(v),n=u>d?(u+.05)/(d+.05):(d+.05)/(u+.05),void 0===(a=2)&&(a=0),void 0===i&&(i=Math.pow(10,a)),Math.floor(i*n)/i+0},o.prototype.isReadable=function(o,t){return void 0===o&&(o="#FFF"),void 0===t&&(t={}),this.contrast(o)>=(e=void 0===(i=(r=t).size)?"normal":i,"AAA"===(a=void 0===(n=r.level)?"AA":n)&&"normal"===e?7:"AA"===a&&"large"===e?3:4.5);var r,n,a,i,e}} ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/dropdown/index.js /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ const UnconnectedDropdown = (props, forwardedRef) => { const { renderContent, renderToggle, className, contentClassName, expandOnMobile, headerTitle, focusOnMount, popoverProps, onClose, onToggle, style, open, defaultOpen, // Deprecated props position, // From context system variant } = useContextSystem(props, 'Dropdown'); if (position !== undefined) { external_wp_deprecated_default()('`position` prop in wp.components.Dropdown', { since: '6.2', alternative: '`popoverProps.placement` prop', hint: 'Note that the `position` prop will override any values passed through the `popoverProps.placement` prop.' }); } // Use internal state instead of a ref to make sure that the component // re-renders when the popover's anchor updates. const [fallbackPopoverAnchor, setFallbackPopoverAnchor] = (0,external_wp_element_namespaceObject.useState)(null); const containerRef = (0,external_wp_element_namespaceObject.useRef)(); const [isOpen, setIsOpen] = useControlledValue({ defaultValue: defaultOpen, value: open, onChange: onToggle }); /** * Closes the popover when focus leaves it unless the toggle was pressed or * focus has moved to a separate dialog. The former is to let the toggle * handle closing the popover and the latter is to preserve presence in * case a dialog has opened, allowing focus to return when it's dismissed. */ function closeIfFocusOutside() { if (!containerRef.current) { return; } const { ownerDocument } = containerRef.current; const dialog = ownerDocument?.activeElement?.closest('[role="dialog"]'); if (!containerRef.current.contains(ownerDocument.activeElement) && (!dialog || dialog.contains(containerRef.current))) { close(); } } function close() { onClose?.(); setIsOpen(false); } const args = { isOpen: !!isOpen, onToggle: () => setIsOpen(!isOpen), onClose: close }; const popoverPropsHaveAnchor = !!popoverProps?.anchor || // Note: `anchorRef`, `getAnchorRect` and `anchorRect` are deprecated and // be removed from `Popover` from WordPress 6.3 !!popoverProps?.anchorRef || !!popoverProps?.getAnchorRect || !!popoverProps?.anchorRect; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: className, ref: (0,external_wp_compose_namespaceObject.useMergeRefs)([containerRef, forwardedRef, setFallbackPopoverAnchor]) // Some UAs focus the closest focusable parent when the toggle is // clicked. Making this div focusable ensures such UAs will focus // it and `closeIfFocusOutside` can tell if the toggle was clicked. , tabIndex: -1, style: style, children: [renderToggle(args), isOpen && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(popover, { position: position, onClose: close, onFocusOutside: closeIfFocusOutside, expandOnMobile: expandOnMobile, headerTitle: headerTitle, focusOnMount: focusOnMount // This value is used to ensure that the dropdowns // align with the editor header by default. , offset: 13, anchor: !popoverPropsHaveAnchor ? fallbackPopoverAnchor : undefined, variant: variant, ...popoverProps, className: dist_clsx('components-dropdown__content', popoverProps?.className, contentClassName), children: renderContent(args) })] }); }; /** * Renders a button that opens a floating content modal when clicked. * * ```jsx * import { Button, Dropdown } from '@wordpress/components'; * * const MyDropdown = () => ( * ( * * ) } * renderContent={ () =>
This is the content of the dropdown.
} * /> * ); * ``` */ const Dropdown = contextConnect(UnconnectedDropdown, 'Dropdown'); /* harmony default export */ const dropdown = (Dropdown); ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/input-control/input-suffix-wrapper.js /** * External dependencies */ /** * Internal dependencies */ function UnconnectedInputControlSuffixWrapper(props, forwardedRef) { const derivedProps = useContextSystem(props, 'InputControlSuffixWrapper'); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(spacer_component, { marginBottom: 0, ...derivedProps, ref: forwardedRef }); } /** * A convenience wrapper for the `suffix` when you want to apply * standard padding in accordance with the size variant. * * ```jsx * import { * __experimentalInputControl as InputControl, * __experimentalInputControlSuffixWrapper as InputControlSuffixWrapper, * } from '@wordpress/components'; * * %} * /> * ``` */ const InputControlSuffixWrapper = contextConnect(UnconnectedInputControlSuffixWrapper, 'InputControlSuffixWrapper'); /* harmony default export */ const input_suffix_wrapper = (InputControlSuffixWrapper); ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/select-control/styles/select-control-styles.js /** * External dependencies */ /** * Internal dependencies */ const select_control_styles_disabledStyles = ({ disabled }) => { if (!disabled) { return ''; } return /*#__PURE__*/emotion_react_browser_esm_css({ color: COLORS.ui.textDisabled }, true ? "" : 0, true ? "" : 0); }; const select_control_styles_sizeStyles = ({ __next40pxDefaultSize, multiple, selectSize = 'default' }) => { if (multiple) { // When `multiple`, just use the native browser styles // without setting explicit height. return; } const sizes = { default: { height: 40, minHeight: 40, paddingTop: 0, paddingBottom: 0 }, small: { height: 24, minHeight: 24, paddingTop: 0, paddingBottom: 0 }, compact: { height: 32, minHeight: 32, paddingTop: 0, paddingBottom: 0 }, '__unstable-large': { height: 40, minHeight: 40, paddingTop: 0, paddingBottom: 0 } }; if (!__next40pxDefaultSize) { sizes.default = sizes.compact; } const style = sizes[selectSize] || sizes.default; return /*#__PURE__*/emotion_react_browser_esm_css(style, true ? "" : 0, true ? "" : 0); }; const chevronIconSize = 18; const sizePaddings = ({ __next40pxDefaultSize, multiple, selectSize = 'default' }) => { const padding = { default: 16, small: 8, compact: 8, '__unstable-large': 16 }; if (!__next40pxDefaultSize) { padding.default = padding.compact; } const selectedPadding = padding[selectSize] || padding.default; return rtl({ paddingLeft: selectedPadding, paddingRight: selectedPadding + chevronIconSize, ...(multiple ? { paddingTop: selectedPadding, paddingBottom: selectedPadding } : {}) }); }; const overflowStyles = ({ multiple }) => { return { overflow: multiple ? 'auto' : 'hidden' }; }; // TODO: Resolve need to use &&& to increase specificity // https://github.com/WordPress/gutenberg/issues/18483 const Select = /*#__PURE__*/emotion_styled_base_browser_esm("select", true ? { target: "e1mv6sxx2" } : 0)("&&&{appearance:none;background:transparent;box-sizing:border-box;border:none;box-shadow:none!important;color:", COLORS.gray[900], ";display:block;font-family:inherit;margin:0;width:100%;max-width:none;cursor:pointer;white-space:nowrap;text-overflow:ellipsis;", select_control_styles_disabledStyles, ";", fontSizeStyles, ";", select_control_styles_sizeStyles, ";", sizePaddings, ";", overflowStyles, ";}" + ( true ? "" : 0)); const DownArrowWrapper = /*#__PURE__*/emotion_styled_base_browser_esm("div", true ? { target: "e1mv6sxx1" } : 0)("margin-inline-end:", space(-1), ";line-height:0;" + ( true ? "" : 0)); const InputControlSuffixWrapperWithClickThrough = /*#__PURE__*/emotion_styled_base_browser_esm(input_suffix_wrapper, true ? { target: "e1mv6sxx0" } : 0)("position:absolute;pointer-events:none;", rtl({ right: 0 }), ";" + ( true ? "" : 0)); ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/icon/index.js /** * WordPress dependencies */ /** @typedef {{icon: JSX.Element, size?: number} & import('@wordpress/primitives').SVGProps} IconProps */ /** * Return an SVG icon. * * @param {IconProps} props icon is the SVG component to render * size is a number specifiying the icon size in pixels * Other props will be passed to wrapped SVG component * @param {import('react').ForwardedRef} ref The forwarded ref to the SVG element. * * @return {JSX.Element} Icon component */ function icon_Icon({ icon, size = 24, ...props }, ref) { return (0,external_wp_element_namespaceObject.cloneElement)(icon, { width: size, height: size, ...props, ref }); } /* harmony default export */ const icons_build_module_icon = ((0,external_wp_element_namespaceObject.forwardRef)(icon_Icon)); ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/chevron-down.js /** * WordPress dependencies */ const chevronDown = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M17.5 11.6L12 16l-5.5-4.4.9-1.2L12 14l4.5-3.6 1 1.2z" }) }); /* harmony default export */ const chevron_down = (chevronDown); ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/select-control/chevron-down.js /** * WordPress dependencies */ /** * Internal dependencies */ const SelectControlChevronDown = () => { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(InputControlSuffixWrapperWithClickThrough, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(DownArrowWrapper, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(icons_build_module_icon, { icon: chevron_down, size: chevronIconSize }) }) }); }; /* harmony default export */ const select_control_chevron_down = (SelectControlChevronDown); ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/select-control/index.js /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ function select_control_useUniqueId(idProp) { const instanceId = (0,external_wp_compose_namespaceObject.useInstanceId)(SelectControl); const id = `inspector-select-control-${instanceId}`; return idProp || id; } function UnforwardedSelectControl(props, ref) { const { className, disabled = false, help, hideLabelFromVision, id: idProp, label, multiple = false, onChange, options = [], size = 'default', value: valueProp, labelPosition = 'top', children, prefix, suffix, __next40pxDefaultSize = false, __nextHasNoMarginBottom = false, ...restProps } = useDeprecated36pxDefaultSizeProp(props); const id = select_control_useUniqueId(idProp); const helpId = help ? `${id}__help` : undefined; // Disable reason: A select with an onchange throws a warning. if (!options?.length && !children) { return null; } const handleOnChange = event => { if (props.multiple) { const selectedOptions = Array.from(event.target.options).filter(({ selected }) => selected); const newValues = selectedOptions.map(({ value }) => value); props.onChange?.(newValues, { event }); return; } props.onChange?.(event.target.value, { event }); }; const classes = dist_clsx('components-select-control', className); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(base_control, { help: help, id: id, __nextHasNoMarginBottom: __nextHasNoMarginBottom, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(input_base, { className: classes, disabled: disabled, hideLabelFromVision: hideLabelFromVision, id: id, label: label, size: size, suffix: suffix || !multiple && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(select_control_chevron_down, {}), prefix: prefix, labelPosition: labelPosition, __next40pxDefaultSize: __next40pxDefaultSize, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Select, { ...restProps, __next40pxDefaultSize: __next40pxDefaultSize, "aria-describedby": helpId, className: "components-select-control__input", disabled: disabled, id: id, multiple: multiple, onChange: handleOnChange, ref: ref, selectSize: size, value: valueProp, children: children || options.map((option, index) => { const key = option.id || `${option.label}-${option.value}-${index}`; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("option", { value: option.value, disabled: option.disabled, hidden: option.hidden, children: option.label }, key); }) }) }) }); } /** * `SelectControl` allows users to select from a single or multiple option menu. * It functions as a wrapper around the browser's native `,