|
1
|
|
-"use strict";var wp;(wp||={}).plugins=(()=>{var K=Object.create;var g=Object.defineProperty;var Q=Object.getOwnPropertyDescriptor;var Y=Object.getOwnPropertyNames;var Z=Object.getPrototypeOf,aa=Object.prototype.hasOwnProperty;var d=(a,t)=>()=>(t||a((t={exports:{}}).exports,t),t.exports),ta=(a,t)=>{for(var r in t)g(a,r,{get:t[r],enumerable:!0})},B=(a,t,r,f)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Y(t))!aa.call(a,o)&&o!==r&&g(a,o,{get:()=>t[o],enumerable:!(f=Q(t,o))||f.enumerable});return a};var s=(a,t,r)=>(r=a!=null?K(Z(a)):{},B(t||!a||!a.__esModule?g(r,"default",{value:a,enumerable:!0}):r,a)),ea=a=>B(g({},"__esModule",{value:!0}),a);var h=d((ia,A)=>{A.exports=window.wp.element});var P=d((pa,T)=>{T.exports=window.wp.hooks});var z=d((na,V)=>{V.exports=window.wp.isShallowEqual});var j=d((ca,E)=>{E.exports=window.wp.compose});var F=d((ga,U)=>{U.exports=window.wp.deprecated});var v=d((ha,H)=>{H.exports=window.ReactJSXRuntime});var W=d((ba,J)=>{J.exports=window.wp.primitives});var ua={};ta(ua,{PluginArea:()=>X,getPlugin:()=>oa,getPlugins:()=>S,registerPlugin:()=>ra,unregisterPlugin:()=>fa,usePluginContext:()=>I,withPluginContext:()=>M});function D(a,t){var r=0,f,o;t=t||{};function l(){var e=f,C=arguments.length,c,u;a:for(;e;){if(e.args.length!==arguments.length){e=e.next;continue}for(u=0;u<C;u++)if(e.args[u]!==arguments[u]){e=e.next;continue a}return e!==f&&(e===o&&(o=e.prev),e.prev.next=e.next,e.next&&(e.next.prev=e.prev),e.next=f,e.prev=null,f.prev=e,f=e),e.val}for(c=new Array(C),u=0;u<C;u++)c[u]=arguments[u];return e={args:c,val:a.apply(null,c)},f?(f.prev=e,e.next=f):o=e,r===t.maxSize?(o=o.prev,o.next=null):r++,f=e,e.val}return l.clear=function(){f=null,o=null,r=0},l}var y=s(h(),1),i=s(P(),1),G=s(z(),1);var w=s(h(),1),N=s(j(),1),q=s(F(),1),L=s(v(),1),x=(0,w.createContext)({name:null,icon:null});x.displayName="PluginContext";var O=x.Provider;function I(){return(0,w.useContext)(x)}var M=a=>(0,N.createHigherOrderComponent)(t=>((0,q.default)("wp.plugins.withPluginContext",{since:"6.8.0",alternative:"wp.plugins.usePluginContext"}),r=>(0,L.jsx)(x.Consumer,{children:f=>(0,L.jsx)(t,{...r,...a(f,r)})})),"withPluginContext");var _=s(h(),1),$=class extends _.Component{constructor(a){super(a),this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(a){let{name:t,onError:r}=this.props;r&&r(t,a)}render(){return this.state.hasError?null:this.props.children}};var p=s(P(),1);var b=s(W(),1),R=s(v(),1),k=(0,R.jsx)(b.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,R.jsx)(b.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"})});var m={};function ra(a,t){if(typeof t!="object")return console.error("No settings object provided!"),null;if(typeof a!="string")return console.error("Plugin name must be string."),null;if(!/^[a-z][a-z0-9-]*$/.test(a))return console.error('Plugin name must include only lowercase alphanumeric characters or dashes, and start with a letter. Example: "my-plugin".'),null;m[a]&&console.error(`Plugin "${a}" is already registered.`),t=(0,p.applyFilters)("plugins.registerPlugin",t,a);let{render:r,scope:f}=t;if(typeof r!="function")return console.error('The "render" property must be specified and must be a valid function.'),null;if(f){if(typeof f!="string")return console.error("Plugin scope must be string."),null;if(!/^[a-z][a-z0-9-]*$/.test(f))return console.error('Plugin scope must include only lowercase alphanumeric characters or dashes, and start with a letter. Example: "my-page".'),null}return m[a]={name:a,icon:k,...t},(0,p.doAction)("plugins.pluginRegistered",t,a),t}function fa(a){if(!m[a]){console.error('Plugin "'+a+'" is not registered.');return}let t=m[a];return delete m[a],(0,p.doAction)("plugins.pluginUnregistered",t,a),t}function oa(a){return m[a]}function S(a){return Object.values(m).filter(t=>t.scope===a)}var n=s(v(),1),la=D((a,t)=>({icon:a,name:t}));function sa({scope:a,onError:t}){let r=(0,y.useMemo)(()=>{let o=[];return{subscribe(l){return(0,i.addAction)("plugins.pluginRegistered","core/plugins/plugin-area/plugins-registered",l),(0,i.addAction)("plugins.pluginUnregistered","core/plugins/plugin-area/plugins-unregistered",l),()=>{(0,i.removeAction)("plugins.pluginRegistered","core/plugins/plugin-area/plugins-registered"),(0,i.removeAction)("plugins.pluginUnregistered","core/plugins/plugin-area/plugins-unregistered")}},getValue(){let l=S(a);return(0,G.isShallowEqual)(o,l)||(o=l),o}}},[a]),f=(0,y.useSyncExternalStore)(r.subscribe,r.getValue,r.getValue);return(0,n.jsx)("div",{style:{display:"none"},children:f.map(({icon:o,name:l,render:e})=>(0,n.jsx)(O,{value:la(o,l),children:(0,n.jsx)($,{name:l,onError:t,children:(0,n.jsx)(e,{})})},l))})}var X=sa;return ea(ua);})(); |
|
2
|
+"use strict";var wp;(wp||={}).plugins=(()=>{var ga=Object.create;var y=Object.defineProperty;var ha=Object.getOwnPropertyDescriptor;var ya=Object.getOwnPropertyNames;var va=Object.getPrototypeOf,wa=Object.prototype.hasOwnProperty;var i=(a,t)=>()=>(t||a((t={exports:{}}).exports,t),t.exports),ba=(a,t)=>{for(var o in t)y(a,o,{get:t[o],enumerable:!0})},H=(a,t,o,f)=>{if(t&&typeof t=="object"||typeof t=="function")for(let l of ya(t))!wa.call(a,l)&&l!==o&&y(a,l,{get:()=>t[l],enumerable:!(f=ha(t,l))||f.enumerable});return a};var s=(a,t,o)=>(o=a!=null?ga(va(a)):{},H(t||!a||!a.__esModule?y(o,"default",{value:a,enumerable:!0}):o,a)),xa=a=>H(y({},"__esModule",{value:!0}),a);var v=i(($a,I)=>{I.exports=window.wp.element});var z=i((Aa,_)=>{_.exports=window.wp.hooks});var J=i((Da,W)=>{W.exports=window.wp.isShallowEqual});var X=i((za,G)=>{G.exports=window.wp.compose});var K=i((Va,Z)=>{Z.exports=window.wp.deprecated});var w=i((Fa,Q)=>{Q.exports=window.ReactJSXRuntime});var sa=i(e=>{"use strict";var F=Symbol.for("react.element"),U=Symbol.for("react.portal"),C=Symbol.for("react.fragment"),L=Symbol.for("react.strict_mode"),P=Symbol.for("react.profiler"),S=Symbol.for("react.provider"),k=Symbol.for("react.context"),Ca=Symbol.for("react.server_context"),R=Symbol.for("react.forward_ref"),E=Symbol.for("react.suspense"),j=Symbol.for("react.suspense_list"),B=Symbol.for("react.memo"),T=Symbol.for("react.lazy"),La=Symbol.for("react.offscreen"),la;la=Symbol.for("react.module.reference");function m(a){if(typeof a=="object"&&a!==null){var t=a.$$typeof;switch(t){case F:switch(a=a.type,a){case C:case P:case L:case E:case j:return a;default:switch(a=a&&a.$$typeof,a){case Ca:case k:case R:case T:case B:case S:return a;default:return t}}case U:return t}}}e.ContextConsumer=k;e.ContextProvider=S;e.Element=F;e.ForwardRef=R;e.Fragment=C;e.Lazy=T;e.Memo=B;e.Portal=U;e.Profiler=P;e.StrictMode=L;e.Suspense=E;e.SuspenseList=j;e.isAsyncMode=function(){return!1};e.isConcurrentMode=function(){return!1};e.isContextConsumer=function(a){return m(a)===k};e.isContextProvider=function(a){return m(a)===S};e.isElement=function(a){return typeof a=="object"&&a!==null&&a.$$typeof===F};e.isForwardRef=function(a){return m(a)===R};e.isFragment=function(a){return m(a)===C};e.isLazy=function(a){return m(a)===T};e.isMemo=function(a){return m(a)===B};e.isPortal=function(a){return m(a)===U};e.isProfiler=function(a){return m(a)===P};e.isStrictMode=function(a){return m(a)===L};e.isSuspense=function(a){return m(a)===E};e.isSuspenseList=function(a){return m(a)===j};e.isValidElementType=function(a){return typeof a=="string"||typeof a=="function"||a===C||a===P||a===L||a===E||a===j||a===La||typeof a=="object"&&a!==null&&(a.$$typeof===T||a.$$typeof===B||a.$$typeof===S||a.$$typeof===k||a.$$typeof===R||a.$$typeof===la||a.getModuleId!==void 0)};e.typeOf=m});var ma=i((Ha,ua)=>{"use strict";ua.exports=sa()});var ia=i((Oa,da)=>{da.exports=window.wp.primitives});var ja={};ba(ja,{PluginArea:()=>ca,getPlugin:()=>ka,getPlugins:()=>N,registerPlugin:()=>Pa,unregisterPlugin:()=>Sa,usePluginContext:()=>ea,withPluginContext:()=>ra});function O(a,t){var o=0,f,l;t=t||{};function u(){var r=f,D=arguments.length,h,d;a:for(;r;){if(r.args.length!==arguments.length){r=r.next;continue}for(d=0;d<D;d++)if(r.args[d]!==arguments[d]){r=r.next;continue a}return r!==f&&(r===l&&(l=r.prev),r.prev.next=r.next,r.next&&(r.next.prev=r.prev),r.next=f,r.prev=null,f.prev=r,f=r),r.val}for(h=new Array(D),d=0;d<D;d++)h[d]=arguments[d];return r={args:h,val:a.apply(null,h)},f?(f.prev=r,r.next=f):l=r,o===t.maxSize?(l=l.prev,l.next=null):o++,f=r,r.val}return u.clear=function(){f=null,l=null,o=0},u}var A=s(v(),1),n=s(z(),1),na=s(J(),1);var b=s(v(),1),Y=s(X(),1),aa=s(K(),1),V=s(w(),1),x=(0,b.createContext)({name:null,icon:null});x.displayName="PluginContext";var ta=x.Provider;function ea(){return(0,b.useContext)(x)}var ra=a=>(0,Y.createHigherOrderComponent)(t=>((0,aa.default)("wp.plugins.withPluginContext",{since:"6.8.0",alternative:"wp.plugins.usePluginContext"}),o=>(0,V.jsx)(x.Consumer,{children:f=>(0,V.jsx)(t,{...o,...a(f,o)})})),"withPluginContext");var oa=s(v(),1),fa=class extends oa.Component{constructor(a){super(a),this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(a){let{name:t,onError:o}=this.props;o&&o(t,a)}render(){return this.state.hasError?null:this.props.children}};var pa=s(ma(),1),c=s(z(),1);var $=s(ia(),1),M=s(w(),1),q=(0,M.jsx)($.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:(0,M.jsx)($.Path,{d:"M15.3995 11.5711L12.2175 8.38909L10.273 6.44454L7.67678 9.04074C7.3017 9.41581 7.09099 9.92452 7.09099 10.455L7.09099 13.455C7.09099 13.7202 6.98563 13.9745 6.7981 14.1621L5.14645 15.8137C4.95118 16.009 4.95118 16.3256 5.14645 16.5208L7.26777 18.6421C7.46303 18.8374 7.77961 18.8374 7.97487 18.6421L9.62652 16.9905C9.81406 16.8029 10.0684 16.6976 10.3336 16.6976H13.3336C13.8641 16.6976 14.3728 16.4869 14.7478 16.1118L17.344 13.5156L15.3995 11.5711ZM12.2175 8.38909L16.1066 4.5M15.3995 11.5711L19.2886 7.68198",vectorEffect:"non-scaling-stroke"})});var p={};function Pa(a,t){if(typeof t!="object")return console.error("No settings object provided!"),null;if(typeof a!="string")return console.error("Plugin name must be string."),null;if(!/^[a-z][a-z0-9-]*$/.test(a))return console.error('Plugin name must include only lowercase alphanumeric characters or dashes, and start with a letter. Example: "my-plugin".'),null;p[a]&&console.error(`Plugin "${a}" is already registered.`),t=(0,c.applyFilters)("plugins.registerPlugin",t,a);let{render:o,scope:f}=t;if(!(0,pa.isValidElementType)(o))return console.error('The "render" property must be specified and must be a valid component.'),null;if(f){if(typeof f!="string")return console.error("Plugin scope must be string."),null;if(!/^[a-z][a-z0-9-]*$/.test(f))return console.error('Plugin scope must include only lowercase alphanumeric characters or dashes, and start with a letter. Example: "my-page".'),null}return p[a]={name:a,icon:q,...t},(0,c.doAction)("plugins.pluginRegistered",t,a),t}function Sa(a){if(!p[a]){console.error('Plugin "'+a+'" is not registered.');return}let t=p[a];return delete p[a],(0,c.doAction)("plugins.pluginUnregistered",t,a),t}function ka(a){return p[a]}function N(a){return Object.values(p).filter(t=>t.scope===a)}var g=s(w(),1),Ra=O((a,t)=>({icon:a,name:t}));function Ea({scope:a,onError:t}){let o=(0,A.useMemo)(()=>{let l=[];return{subscribe(u){return(0,n.addAction)("plugins.pluginRegistered","core/plugins/plugin-area/plugins-registered",u),(0,n.addAction)("plugins.pluginUnregistered","core/plugins/plugin-area/plugins-unregistered",u),()=>{(0,n.removeAction)("plugins.pluginRegistered","core/plugins/plugin-area/plugins-registered"),(0,n.removeAction)("plugins.pluginUnregistered","core/plugins/plugin-area/plugins-unregistered")}},getValue(){let u=N(a);return(0,na.isShallowEqual)(l,u)||(l=u),l}}},[a]),f=(0,A.useSyncExternalStore)(o.subscribe,o.getValue,o.getValue);return(0,g.jsx)("div",{style:{display:"none"},children:f.map(({icon:l,name:u,render:r})=>(0,g.jsx)(ta,{value:Ra(l,u),children:(0,g.jsx)(fa,{name:u,onError:t,children:(0,g.jsx)(r,{})})},u))})}var ca=Ea;return xa(ja);})(); |