(()=>{"use strict";vare={n:n=>{varr=n&&n.__esModule?()=>n.default:()=>n;returne.d(r,{a:r}),r},d:(n,r)=>{for(vartinr)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"!=typeofSymbol&&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:()=>h,getPlugins:()=>y,registerPlugin:()=>f,unregisterPlugin:()=>w,usePluginContext:()=>c,withPluginContext:()=>p});constr=window.React;constt=window.wp.element,o=window.wp.hooks,i=window.wp.isShallowEqual;varl=e.n(i);consts=window.wp.compose,u=(0,t.createContext)({name:null,icon:null}),a=u.Provider;functionc(){return(0,t.useContext)(u)}constp=e=>(0,s.createHigherOrderComponent)((n=>t=>(0,r.createElement)(u.Consumer,null,(o=>(0,r.createElement)(n,{...t,...e(o,t)})))),"withPluginContext");classgextendst.Component{constructor(e){super(e),this.state={hasError:!1}}staticgetDerivedStateFromError(){return{hasError:!0}}componentDidCatch(e){const{name:n,onError:r}=this.props;r&&r(n,e)}render(){returnthis.state.hasError?null:this.props.children}}constd=window.wp.primitives,m=(0,r.createElement)(d.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,r.createElement)(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"})),v={};functionf(e,n){if("object"!=typeofn)returnconsole.error("No settings object provided!"),null;if("string"!=typeofe)returnconsole.error("Plugin name must be string."),null;if(!/^[a-z][a-z0-9-]*$/.test(e))returnconsole.error('Plugin name must include only lowercase alphanumeric characters or dashes, and start with a letter. Example: "my-plugin".'),null;v[e]&&console.error(`Plugin "${e}" is already registered.`),n=(0,o.applyFilters)("plugins.registerPlugin",n,e);const{render:r,scope:t}=n;if("function"!=typeofr)returnconsole.error('The "render" property must be specified and must be a valid function.'),null;if(t){if("string"!=typeoft)returnconsole.error("Plugin scope must be string."),null;if(!/^[a-z][a-z0-9-]*$/.test(t))returnconsole.error('Plugin scope must include only lowercase alphanumeric characters or dashes, and start with a letter. Example: "my-page".'),null}returnv[e]={name:e,icon:m,...n},(0,o.doAction)("plugins.pluginRegistered",n,e),n}functionw(e){if(!v[e])returnvoidconsole.error('Plugin "'+e+'" is not registered.');constn=v[e];returndeletev[e],(0,o.doAction)("plugins.pluginUnregistered",n,e),n}functionh(e){returnv[e]}functiony(e){returnObject.values(v).filter((n=>n.scope===e))}constx=function(e,n){varr,t,o=0;functioni(){vari,l,s=r,u=arguments.length;e:for(;s;){if(s.args.length===arguments.length){for(l=0;l<u;l++)if(s.args[l]!==arguments[l]){s=s.next;continuee}returns!==r&&(s===t&&(t=s.prev),s.prev.next=s.next,s.next&&(s.next.prev=s.prev),s.next=r,s.prev=null,r.prev=s,r=s),s.val}s=s.next}for(i=newArray(u),l=0;l<u;l++)i[l]=arguments[l];returns={args:i,val:e.apply(null,i)},r?(r.prev=s,s.next=r):t=s,o===n.maxSize?(t=t.prev).next=null:o++,r=s,s.val}returnn=n||{},i.clear=function(){r=null,t=null,o=0},i}(((e,n)=>({icon:e,name:n})));constP=function({scope:e,onError:n}){consti=(0,t.useMemo)((()=>{letn=[];return{subscribe:e=>((0,o.addAction)("plugins.pluginRegistered","core/plugins/plugin-area/plugins-registered",e),(0,o.addAction)("plugins.pluginUnregistered","core/plugins/plugin-area/plugins-unregistered",e),()=>{(0,o.removeAction)("plugins.pluginRegistered","core/plugins/plugin-area/plugins-registered"),(0,o.removeAction)("plugins.pluginUnregistered","core/plugins/plugin-area/plugins-unregistered")}),getValue(){constr=y(e);returnl()(n,r)||(n=r),n}}}),[e]),s=(0,t.useSyncExternalStore)(i.subscribe,i.getValue);return(0,r.createElement)("div",{style:{display:"none"}},s.map((({icon:e,name:t,render:o})=>(0,r.createElement)(a,{key:t,value:x(e,t)},(0,r.createElement)(g,{name:t,onError:n},(0,r.createElement)(o,null)