(()=>{"use strict";vare={n:r=>{varn=r&&r.__esModule?()=>r.default:()=>r;returne.d(n,{a:n}),n},d:(r,n)=>{for(vartinn)e.o(n,t)&&!e.o(r,t)&&Object.defineProperty(r,t,{enumerable:!0,get:n[t]})},o:(e,r)=>Object.prototype.hasOwnProperty.call(e,r),r:e=>{"undefined"!=typeofSymbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},r={};e.r(r),e.d(r,{PluginArea:()=>y,getPlugin:()=>f,getPlugins:()=>w,registerPlugin:()=>m,unregisterPlugin:()=>v,withPluginContext:()=>a});constn=window.wp.element;constt=window.wp.hooks,o=window.wp.isShallowEqual;varl=e.n(o);consti=window.wp.compose,{Consumer:s,Provider:u}=(0,n.createContext)({name:null,icon:null}),a=e=>(0,i.createHigherOrderComponent)((r=>t=>(0,n.createElement)(s,null,(o=>(0,n.createElement)(r,{...t,...e(o,t)})))),"withPluginContext");classcextendsn.Component{constructor(e){super(e),this.state={hasError:!1}}staticgetDerivedStateFromError(){return{hasError:!0}}componentDidCatch(e){const{name:r,onError:n}=this.props;n&&n(r,e)}render(){returnthis.state.hasError?null:this.props.children}}constp=window.wp.primitives,g=(0,n.createElement)(p.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,n.createElement)(p.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"})),d={};functionm(e,r){if("object"!=typeofr)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;d[e]&&console.error(`Plugin "${e}" is already registered.`),r=(0,t.applyFilters)("plugins.registerPlugin",r,e);const{render:n,scope:o}=r;if("function"!=typeofn)returnconsole.error('The "render" property must be specified and must be a valid function.'),null;if(o){if("string"!=typeofo)returnconsole.error("Plugin scope must be string."),null;if(!/^[a-z][a-z0-9-]*$/.test(o))returnconsole.error('Plugin scope must include only lowercase alphanumeric characters or dashes, and start with a letter. Example: "my-page".'),null}returnd[e]={name:e,icon:g,...r},(0,t.doAction)("plugins.pluginRegistered",r,e),r}functionv(e){if(!d[e])returnvoidconsole.error('Plugin "'+e+'" is not registered.');constr=d[e];returndeleted[e],(0,t.doAction)("plugins.pluginUnregistered",r,e),r}functionf(e){returnd[e]}functionw(e){returnObject.values(d).filter((r=>r.scope===e))}consth=function(e,r){varn,t,o=0;functionl(){varl,i,s=n,u=arguments.length;e:for(;s;){if(s.args.length===arguments.length){for(i=0;i<u;i++)if(s.args[i]!==arguments[i]){s=s.next;continuee}returns!==n&&(s===t&&(t=s.prev),s.prev.next=s.next,s.next&&(s.next.prev=s.prev),s.next=n,s.prev=null,n.prev=s,n=s),s.val}s=s.next}for(l=newArray(u),i=0;i<u;i++)l[i]=arguments[i];returns={args:l,val:e.apply(null,l)},n?(n.prev=s,s.next=n):t=s,o===r.maxSize?(t=t.prev).next=null:o++,n=s,s.val}returnr=r||{},l.clear=function(){n=null,t=null,o=0},l}(((e,r)=>({icon:e,name:r})));consty=function({scope:e,onError:r}){consto=(0,n.useMemo)((()=>{letr=[];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(){constn=w(e);returnl()(r,n)||(r=n),r}}}),[e]),i=(0,n.useSyncExternalStore)(o.subscribe,o.getValue);return(0,n.createElement)("div",{style:{display:"none"}},i.map((({icon:e,name:t,render:o})=>(0,n.createElement)(u,{key:t,value:h(e,t)},(0,n.createElement)(c,{name:t,onError:r},(0,n.createElement)(o,null))))))};(window.wp=window.wp||{}).plugins=r})();