WordPress/wp-includes/js/dist/keyboard-shortcuts.min.js

2 lines
8.6 KiB
JavaScript

/*! This file is auto-generated */
this.wp=this.wp||{},this.wp.keyboardShortcuts=function(e){var r={};function t(n){if(r[n])return r[n].exports;var o=r[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,t),o.l=!0,o.exports}return t.m=e,t.c=r,t.d=function(e,r,n){t.o(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:n})},t.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},t.t=function(e,r){if(1&r&&(e=t(e)),8&r)return e;if(4&r&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(t.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&r&&"string"!=typeof e)for(var o in e)t.d(n,o,function(r){return e[r]}.bind(null,o));return n},t.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(r,"a",r),r},t.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},t.p="",t(t.s="./node_modules/@wordpress/keyboard-shortcuts/build-module/index.js")}({"./node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js":function(e,r,t){"use strict";function n(e,r){(null==r||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}t.d(r,"a",(function(){return n}))},"./node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js":function(e,r,t){"use strict";function n(e){if(Array.isArray(e))return e}t.d(r,"a",(function(){return n}))},"./node_modules/@babel/runtime/helpers/esm/defineProperty.js":function(e,r,t){"use strict";function n(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}t.d(r,"a",(function(){return n}))},"./node_modules/@babel/runtime/helpers/esm/iterableToArray.js":function(e,r,t){"use strict";function n(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}t.d(r,"a",(function(){return n}))},"./node_modules/@babel/runtime/helpers/esm/nonIterableRest.js":function(e,r,t){"use strict";function n(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}t.d(r,"a",(function(){return n}))},"./node_modules/@babel/runtime/helpers/esm/slicedToArray.js":function(e,r,t){"use strict";t.d(r,"a",(function(){return a}));var n=t("./node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js");var o=t("./node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js"),u=t("./node_modules/@babel/runtime/helpers/esm/nonIterableRest.js");function a(e,r){return Object(n.a)(e)||function(e,r){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e)){var t=[],n=!0,o=!1,u=void 0;try{for(var a,i=e[Symbol.iterator]();!(n=(a=i.next()).done)&&(t.push(a.value),!r||t.length!==r);n=!0);}catch(e){o=!0,u=e}finally{try{n||null==i.return||i.return()}finally{if(o)throw u}}return t}}(e,r)||Object(o.a)(e,r)||Object(u.a)()}},"./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js":function(e,r,t){"use strict";t.d(r,"a",(function(){return a}));var n=t("./node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js");var o=t("./node_modules/@babel/runtime/helpers/esm/iterableToArray.js"),u=t("./node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js");function a(e){return function(e){if(Array.isArray(e))return Object(n.a)(e)}(e)||Object(o.a)(e)||Object(u.a)(e)||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.")}()}},"./node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js":function(e,r,t){"use strict";t.d(r,"a",(function(){return o}));var n=t("./node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js");function o(e,r){if(e){if("string"==typeof e)return Object(n.a)(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?Object(n.a)(e,r):void 0}}},"./node_modules/@wordpress/keyboard-shortcuts/build-module/index.js":function(e,r,t){"use strict";t.r(r),t.d(r,"store",(function(){return T})),t.d(r,"useShortcut",(function(){return x}));var n={};t.r(n),t.d(n,"registerShortcut",(function(){return d})),t.d(n,"unregisterShortcut",(function(){return f}));var o={};t.r(o),t.d(o,"getShortcutKeyCombination",(function(){return O})),t.d(o,"getShortcutRepresentation",(function(){return g})),t.d(o,"getShortcutDescription",(function(){return w})),t.d(o,"getShortcutAliases",(function(){return S})),t.d(o,"getAllShortcutRawKeyCombinations",(function(){return _})),t.d(o,"getCategoryShortcuts",(function(){return A}));var u=t("@wordpress/data"),a=t("./node_modules/@babel/runtime/helpers/esm/defineProperty.js"),i=t("lodash");function s(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),t.push.apply(t,n)}return t}function c(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?s(Object(t),!0).forEach((function(r){Object(a.a)(e,r,t[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):s(Object(t)).forEach((function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}))}return e}var l=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0;switch(r.type){case"REGISTER_SHORTCUT":return c(c({},e),{},Object(a.a)({},r.name,{category:r.category,keyCombination:r.keyCombination,aliases:r.aliases,description:r.description}));case"UNREGISTER_SHORTCUT":return Object(i.omit)(e,r.name)}return e};function d(e){var r=e.name,t=e.category,n=e.description;return{type:"REGISTER_SHORTCUT",name:r,category:t,keyCombination:e.keyCombination,aliases:e.aliases,description:n}}function f(e){return{type:"UNREGISTER_SHORTCUT",name:e}}var b=t("./node_modules/@babel/runtime/helpers/esm/slicedToArray.js"),p=t("./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js"),m=t("./node_modules/rememo/es/rememo.js"),y=t("@wordpress/keycodes"),h=[],j={display:y.displayShortcut,raw:y.rawShortcut,ariaLabel:y.shortcutAriaLabel};function v(e,r){return e?e.modifier?j[r][e.modifier](e.character):e.character:null}function O(e,r){return e[r]?e[r].keyCombination:null}function g(e,r){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"display",n=O(e,r);return v(n,t)}function w(e,r){return e[r]?e[r].description:null}function S(e,r){return e[r]&&e[r].aliases?e[r].aliases:h}var _=Object(m.a)((function(e,r){return Object(i.compact)([v(O(e,r),"raw")].concat(Object(p.a)(S(e,r).map((function(e){return v(e,"raw")})))))}),(function(e,r){return[e[r]]})),A=Object(m.a)((function(e,r){return Object.entries(e).filter((function(e){return Object(b.a)(e,2)[1].category===r})).map((function(e){return Object(b.a)(e,1)[0]}))}),(function(e){return[e]})),T=Object(u.createReduxStore)("core/keyboard-shortcuts",{reducer:l,actions:n,selectors:o});Object(u.register)(T);var k=t("@wordpress/compose");var x=function(e,r,t){var n=Object(u.useSelect)((function(r){return r(T).getAllShortcutRawKeyCombinations(e)}),[e]);Object(k.useKeyboardShortcut)(n,r,t)}},"./node_modules/rememo/es/rememo.js":function(e,r,t){"use strict";var n,o;function u(e){return[e]}function a(){var e={clear:function(){e.head=null}};return e}function i(e,r,t){var n;if(e.length!==r.length)return!1;for(n=t;n<e.length;n++)if(e[n]!==r[n])return!1;return!0}n={},o="undefined"!=typeof WeakMap,r.a=function(e,r){var t,s;function c(){t=o?new WeakMap:a()}function l(){var t,n,o,u,a,c=arguments.length;for(u=new Array(c),o=0;o<c;o++)u[o]=arguments[o];for(a=r.apply(null,u),(t=s(a)).isUniqueByDependants||(t.lastDependants&&!i(a,t.lastDependants,0)&&t.clear(),t.lastDependants=a),n=t.head;n;){if(i(n.args,u,1))return n!==t.head&&(n.prev.next=n.next,n.next&&(n.next.prev=n.prev),n.next=t.head,n.prev=null,t.head.prev=n,t.head=n),n.val;n=n.next}return n={val:e.apply(null,u)},u[0]=null,n.args=u,t.head&&(t.head.prev=n,n.next=t.head),t.head=n,n.val}return r||(r=u),s=o?function(e){var r,o,u,i,s,c=t,l=!0;for(r=0;r<e.length;r++){if(o=e[r],!(s=o)||"object"!=typeof s){l=!1;break}c.has(o)?c=c.get(o):(u=new WeakMap,c.set(o,u),c=u)}return c.has(n)||((i=a()).isUniqueByDependants=l,c.set(n,i)),c.get(n)}:function(){return t},l.getDependants=r,l.clear=c,c(),l}},"@wordpress/compose":function(e,r){e.exports=window.wp.compose},"@wordpress/data":function(e,r){e.exports=window.wp.data},"@wordpress/keycodes":function(e,r){e.exports=window.wp.keycodes},lodash:function(e,r){e.exports=window.lodash}});