WordPress/wp-includes/js/dist/hooks.min.js
noisysocks 351400af80 Editor: Update @wordpress npm packages
Update @wordpress npm packages to the latest published versions. This means that
the block editor includes functionality that exists in Gutenberg 9.9.

Fixes #52334.

Built from https://develop.svn.wordpress.org/trunk@50137


git-svn-id: http://core.svn.wordpress.org/trunk@49816 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-02-02 05:17:13 +00:00

2 lines
6.8 KiB
JavaScript

/*! This file is auto-generated */
this.wp=this.wp||{},this.wp.hooks=function(n){var t={};function r(e){if(t[e])return t[e].exports;var i=t[e]={i:e,l:!1,exports:{}};return n[e].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=n,r.c=t,r.d=function(n,t,e){r.o(n,t)||Object.defineProperty(n,t,{enumerable:!0,get:e})},r.r=function(n){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(n,"__esModule",{value:!0})},r.t=function(n,t){if(1&t&&(n=r(n)),8&t)return n;if(4&t&&"object"==typeof n&&n&&n.__esModule)return n;var e=Object.create(null);if(r.r(e),Object.defineProperty(e,"default",{enumerable:!0,value:n}),2&t&&"string"!=typeof n)for(var i in n)r.d(e,i,function(t){return n[t]}.bind(null,i));return e},r.n=function(n){var t=n&&n.__esModule?function(){return n.default}:function(){return n};return r.d(t,"a",t),t},r.o=function(n,t){return Object.prototype.hasOwnProperty.call(n,t)},r.p="",r(r.s=467)}({15:function(n,t,r){"use strict";r.d(t,"a",(function(){return c}));var e=r(24);var i=r(37),o=r(31);function c(n){return function(n){if(Array.isArray(n))return Object(e.a)(n)}(n)||Object(i.a)(n)||Object(o.a)(n)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}},24:function(n,t,r){"use strict";function e(n,t){(null==t||t>n.length)&&(t=n.length);for(var r=0,e=new Array(t);r<t;r++)e[r]=n[r];return e}r.d(t,"a",(function(){return e}))},25:function(n,t,r){"use strict";function e(n,t){if(!(n instanceof t))throw new TypeError("Cannot call a class as a function")}r.d(t,"a",(function(){return e}))},31:function(n,t,r){"use strict";r.d(t,"a",(function(){return i}));var e=r(24);function i(n,t){if(n){if("string"==typeof n)return Object(e.a)(n,t);var r=Object.prototype.toString.call(n).slice(8,-1);return"Object"===r&&n.constructor&&(r=n.constructor.name),"Map"===r||"Set"===r?Array.from(n):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Object(e.a)(n,t):void 0}}},37:function(n,t,r){"use strict";function e(n){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(n))return Array.from(n)}r.d(t,"a",(function(){return e}))},467:function(n,t,r){"use strict";r.r(t),r.d(t,"createHooks",(function(){return v})),r.d(t,"addAction",(function(){return m})),r.d(t,"addFilter",(function(){return A})),r.d(t,"removeAction",(function(){return b})),r.d(t,"removeFilter",(function(){return y})),r.d(t,"hasAction",(function(){return _})),r.d(t,"hasFilter",(function(){return g})),r.d(t,"removeAllActions",(function(){return F})),r.d(t,"removeAllFilters",(function(){return j})),r.d(t,"doAction",(function(){return O})),r.d(t,"applyFilters",(function(){return k})),r.d(t,"currentAction",(function(){return x})),r.d(t,"currentFilter",(function(){return w})),r.d(t,"doingAction",(function(){return I})),r.d(t,"doingFilter",(function(){return S})),r.d(t,"didAction",(function(){return T})),r.d(t,"didFilter",(function(){return M})),r.d(t,"actions",(function(){return P})),r.d(t,"filters",(function(){return z}));var e=r(25);var i=function(n){return"string"!=typeof n||""===n?(console.error("The namespace must be a non-empty string."),!1):!!/^[a-zA-Z][a-zA-Z0-9_.\-\/]*$/.test(n)||(console.error("The namespace can only contain numbers, letters, dashes, periods, underscores and slashes."),!1)};var o=function(n){return"string"!=typeof n||""===n?(console.error("The hook name must be a non-empty string."),!1):/^__/.test(n)?(console.error("The hook name cannot begin with `__`."),!1):!!/^[a-zA-Z][a-zA-Z0-9_.-]*$/.test(n)||(console.error("The hook name can only contain numbers, letters, dashes, periods and underscores."),!1)};var c=function(n,t){return function(r,e,c){var u=arguments.length>3&&void 0!==arguments[3]?arguments[3]:10,s=n[t];if(o(r)&&i(e))if("function"==typeof c)if("number"==typeof u){var a={callback:c,priority:u,namespace:e};if(s[r]){var l,f=s[r].handlers;for(l=f.length;l>0&&!(u>=f[l-1].priority);l--);l===f.length?f[l]=a:f.splice(l,0,a),s.__current.forEach((function(n){n.name===r&&n.currentIndex>=l&&n.currentIndex++}))}else s[r]={handlers:[a],runs:0};"hookAdded"!==r&&n.doAction("hookAdded",r,e,c,u)}else console.error("If specified, the hook priority must be a number.");else console.error("The hook callback must be a function.")}};var u=function(n,t){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return function(e,c){var u=n[t];if(o(e)&&(r||i(c))){if(!u[e])return 0;var s=0;if(r)s=u[e].handlers.length,u[e]={runs:u[e].runs,handlers:[]};else for(var a=u[e].handlers,l=function(n){a[n].namespace===c&&(a.splice(n,1),s++,u.__current.forEach((function(t){t.name===e&&t.currentIndex>=n&&t.currentIndex--})))},f=a.length-1;f>=0;f--)l(f);return"hookRemoved"!==e&&n.doAction("hookRemoved",e,c),s}}};var s=function(n,t){return function(r,e){var i=n[t];return void 0!==e?r in i&&i[r].handlers.some((function(n){return n.namespace===e})):r in i}};r(15);var a=function(n,t){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return function(e){var i=n[t];i[e]||(i[e]={handlers:[],runs:0}),i[e].runs++;var o=i[e].handlers;for(var c=arguments.length,u=new Array(c>1?c-1:0),s=1;s<c;s++)u[s-1]=arguments[s];if(!o||!o.length)return r?u[0]:void 0;var a={name:e,currentIndex:0};for(i.__current.push(a);a.currentIndex<o.length;){var l=o[a.currentIndex],f=l.callback.apply(null,u);r&&(u[0]=f),a.currentIndex++}return i.__current.pop(),r?u[0]:void 0}};var l=function(n,t){return function(){var r,e,i=n[t];return null!==(r=null===(e=i.__current[i.__current.length-1])||void 0===e?void 0:e.name)&&void 0!==r?r:null}};var f=function(n,t){return function(r){var e=n[t];return void 0===r?void 0!==e.__current[0]:!!e.__current[0]&&r===e.__current[0].name}};var d=function(n,t){return function(r){var e=n[t];if(o(r))return e[r]&&e[r].runs?e[r].runs:0}},h=function n(){Object(e.a)(this,n),this.actions=Object.create(null),this.actions.__current=[],this.filters=Object.create(null),this.filters.__current=[],this.addAction=c(this,"actions"),this.addFilter=c(this,"filters"),this.removeAction=u(this,"actions"),this.removeFilter=u(this,"filters"),this.hasAction=s(this,"actions"),this.hasFilter=s(this,"filters"),this.removeAllActions=u(this,"actions",!0),this.removeAllFilters=u(this,"filters",!0),this.doAction=a(this,"actions"),this.applyFilters=a(this,"filters",!0),this.currentAction=l(this,"actions"),this.currentFilter=l(this,"filters"),this.doingAction=f(this,"actions"),this.doingFilter=f(this,"filters"),this.didAction=d(this,"actions"),this.didFilter=d(this,"filters")};var v=function(){return new h},p=v(),m=p.addAction,A=p.addFilter,b=p.removeAction,y=p.removeFilter,_=p.hasAction,g=p.hasFilter,F=p.removeAllActions,j=p.removeAllFilters,O=p.doAction,k=p.applyFilters,x=p.currentAction,w=p.currentFilter,I=p.doingAction,S=p.doingFilter,T=p.didAction,M=p.didFilter,P=p.actions,z=p.filters}});