Current File : /home/resuelf/www/wp-content/plugins/gutenberg/build/notices/index.min.js |
!function(){"use strict";var e={d:function(t,n){for(var r in n)e.o(n,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:n[r]})},o:function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r:function(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:function(){return b}});var n={};e.r(n),e.d(n,{createErrorNotice:function(){return E},createInfoNotice:function(){return d},createNotice:function(){return a},createSuccessNotice:function(){return l},createWarningNotice:function(){return p},removeAllNotices:function(){return O},removeNotice:function(){return y},removeNotices:function(){return N}});var r={};e.r(r),e.d(r,{getNotices:function(){return _}});var i,o=window.wp.data,c=(i="context",e=>(t={},n)=>{const r=n[i];if(void 0===r)return t;const o=e(t[r],n);return o===t[r]?t:{...t,[r]:o}})(((e=[],t)=>{switch(t.type){case"CREATE_NOTICE":return[...e.filter((({id:e})=>e!==t.notice.id)),t.notice];case"REMOVE_NOTICE":return e.filter((({id:e})=>e!==t.id));case"REMOVE_NOTICES":return e.filter((({id:e})=>!t.ids.includes(e)));case"REMOVE_ALL_NOTICES":return e.filter((({type:e})=>e!==t.noticeType))}return e}));const u="global",s="info";let f=0;function a(e=s,t,n={}){const{speak:r=!0,isDismissible:i=!0,context:o=u,id:c=`${o}${++f}`,actions:a=[],type:l="default",__unstableHTML:d,icon:E=null,explicitDismiss:p=!1,onDismiss:y}=n;return{type:"CREATE_NOTICE",context:o,notice:{id:c,status:e,content:t=String(t),spokenMessage:r?t:null,__unstableHTML:d,isDismissible:i,actions:a,type:l,icon:E,explicitDismiss:p,onDismiss:y}}}function l(e,t){return a("success",e,t)}function d(e,t){return a("info",e,t)}function E(e,t){return a("error",e,t)}function p(e,t){return a("warning",e,t)}function y(e,t=u){return{type:"REMOVE_NOTICE",id:e,context:t}}function O(e="default",t=u){return{type:"REMOVE_ALL_NOTICES",noticeType:e,context:t}}function N(e,t=u){return{type:"REMOVE_NOTICES",ids:e,context:t}}const T=[];function _(e,t=u){return e[t]||T}const b=(0,o.createReduxStore)("core/notices",{reducer:c,actions:n,selectors:r});(0,o.register)(b),(window.wp=window.wp||{}).notices=t}();
//# sourceMappingURL=index.min.js.map