WordPress/wp-includes/js/dist/notices.min.js

1 line
11 KiB
JavaScript
Raw Normal View History

this.wp=this.wp||{},this.wp.notices=function(t){var e={};function r(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)r.d(n,o,function(e){return t[e]}.bind(null,o));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=371)}({15:function(t,e,r){"use strict";function n(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}r.d(e,"a",function(){return n})},17:function(t,e,r){"use strict";var n=r(34);function o(t){return function(t){if(Array.isArray(t)){for(var e=0,r=new Array(t.length);e<t.length;e++)r[e]=t[e];return r}}(t)||Object(n.a)(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}r.d(e,"a",function(){return o})},2:function(t,e){!function(){t.exports=this.lodash}()},23:function(t,e,r){t.exports=r(54)},34:function(t,e,r){"use strict";function n(t){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t))return Array.from(t)}r.d(e,"a",function(){return n})},371:function(t,e,r){"use strict";r.r(e);var n={};r.r(n),r.d(n,"createNotice",function(){return v}),r.d(n,"createSuccessNotice",function(){return g}),r.d(n,"createInfoNotice",function(){return m}),r.d(n,"createErrorNotice",function(){return b}),r.d(n,"createWarningNotice",function(){return w}),r.d(n,"removeNotice",function(){return O});var o={};r.r(o),r.d(o,"getNotices",function(){return j});var i=r(5),c=r(17),a=r(2),u=r(15),f=r(7),s=function(t){return function(e){return function(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0,o=n[t];if(void 0===o)return r;var i=e(r[o],n);return i===r[o]?r:Object(f.a)({},r,Object(u.a)({},o,i))}}}("context")(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1?arguments[1]:void 0;switch(e.type){case"CREATE_NOTICE":return[].concat(Object(c.a)(Object(a.reject)(t,{id:e.notice.id})),[e.notice]);case"REMOVE_NOTICE":return Object(a.reject)(t,{id:e.id})}return t}),l=r(23),h=r.n(l),p="global",d="info",y=h.a.mark(v);function v(){var t,e,r,n,o,i,c,u,f,s,l,v,g,m,b=arguments;return h.a.wrap(function(h){for(;;)switch(h.prev=h.next){case 0:if(t=b.length>0&&void 0!==b[0]?b[0]:d,e=b.length>1?b[1]:void 0,r=b.length>2&&void 0!==b[2]?b[2]:{},n=r.speak,o=void 0===n||n,i=r.isDismissible,c=void 0===i||i,u=r.context,f=void 0===u?p:u,s=r.id,l=void 0===s?Object(a.uniqueId)(f):s,v=r.actions,g=void 0===v?[]:v,m=r.__unstableHTML,e=String(e),!o){h.next=8;break}return h.next=8,{type:"SPEAK",message:e};case 8:return h.next=10,{type:"CREATE_NOTICE",context:f,notice:{id:l,status:t,content:e,__unstableHTML:m,isDismissible:c,actions:g}};case 10:case"end":return h.stop()}},y,this)}function g(t,e){return v("success",t,e)}function m(t,e){return v("info",t,e)}function b(t,e){return v("error",t,e)}function w(t,e){return v("warning",t,e)}function O(t){return{type:"REMOVE_NOTICE",id:t,context:arguments.length>1&&void 0!==arguments[1]?arguments[1]:p}}var x=[];function j(t){return t[arguments.length>1&&void 0!==arguments[1]?arguments[1]:p]||x}var E=r(48),L={SPEAK:function(t){Object(E.speak)(t.message,"assertive")}};Object(i.registerStore)("core/notices",{reducer:s,actions:n,selectors:o,controls:L})},48:function(t,e){!function(){t.exports=this.wp.a11y}()},5:function(t,e){!function(){t.exports=this.wp.data}()},54:function(t,e,r){var n=funct