blog-hexo/public/js/e0a67917.js

1 line
2.0 KiB
JavaScript
Raw Normal View History

2023-12-28 11:27:53 +08:00
(()=>{"use strict";function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e(t)}function t(e,t){for(var o=0;o<t.length;o++){var r=t[o];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,n(r.key),r)}}function n(t){var n=function(t,n){if("object"!=e(t)||!t)return t;var o=t[Symbol.toPrimitive];if(void 0!==o){var r=o.call(t,n||"default");if("object"!=e(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===n?String:Number)(t)}(t,"string");return"symbol"==e(n)?n:String(n)}var o,r=function(e){var t=e.key,n=e.handler,o=e.preventDefault,r=void 0!==o&&o,i=t.toLowerCase().split("+").map((function(e){return e.trim()})),u=/Mac|iPod|iPhone|iPad/.test(navigator.platform),a=function(e){i.every((function(t){return"control"===t?u?e.metaKey:e.ctrlKey:e.key.toLowerCase()===t}))&&(r&&e.preventDefault(),n(e))};return document.addEventListener("keydown",a),function(){return document.removeEventListener("keydown",a)}},i=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}var n,o,r;return n=e,o=[{key:"emit",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:document,o=new CustomEvent(e,{detail:t,bubbles:!0,composed:!0});n.dispatchEvent(o)}},{key:"on",value:function(e,t){(arguments.length>2&&void 0!==arguments[2]?arguments[2]:document).addEventListener(e,t)}},{key:"off",value:function(e,t){(arguments.length>2&&void 0!==arguments[2]?arguments[2]:document).removeEventListener(e,t)}}],o&&t(n.prototype,o),r&&t(n,r),Object.defineProperty(n,"prototype",{writable:!1}),e}();new i;o=()=>{r({key:"control+h",preventDefault:!0,handler:()=>location.href="/"}),r({key:"control+p",preventDefault:!0,handler:()=>location.href="/cosy-preference"})},"loading"===document.readyState?document.addEventListener("DOMContentLoaded",o):o()})();