hotkey-router 0.5.2 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +32 -27
- package/dist/auto.js +3 -3
- package/dist/auto.js.map +2 -2
- package/dist/auto.min.js +2 -2
- package/dist/core.js +17 -321
- package/dist/core.js.map +3 -3
- package/dist/dev.js +56 -0
- package/dist/dev.js.map +7 -0
- package/dist/format.js +4 -194
- package/dist/format.js.map +3 -3
- package/dist/hotkey-router.cjs +14 -145
- package/dist/hotkey-router.cjs.map +2 -2
- package/dist/hotkey-router.js +1 -1
- package/dist/hotkey-router.js.map +2 -2
- package/dist/hotkey-router.min.js +2 -2
- package/dist/lookup.js +9 -0
- package/dist/lookup.js.map +7 -0
- package/dist/parse.js +207 -0
- package/dist/parse.js.map +7 -0
- package/dist/platform.js +42 -0
- package/dist/platform.js.map +7 -0
- package/dist/reservations.js +6 -666
- package/dist/reservations.js.map +3 -3
- package/dist/shifted-punctuation.js +34 -0
- package/dist/shifted-punctuation.js.map +7 -0
- package/dist/sites.js +3 -227
- package/dist/sites.js.map +3 -3
- package/dist/testing.js +104 -0
- package/dist/testing.js.map +7 -0
- package/dist/types/core.d.ts +3 -9
- package/dist/types/dev.d.ts +48 -0
- package/dist/types/parse.d.ts +0 -13
- package/dist/types/reservations.d.ts +4 -44
- package/dist/types/shifted-punctuation.d.ts +17 -0
- package/dist/types/testing.d.ts +17 -0
- package/dist/validate.js +7 -203
- package/dist/validate.js.map +3 -3
- package/package.json +9 -1
package/README.md
CHANGED
|
@@ -31,8 +31,8 @@ hotkeys.unregisterPlugin('search') // remove the group
|
|
|
31
31
|
|
|
32
32
|
By default no binding fires while the user types in a field, chords included; `allowIn` opts one in (see
|
|
33
33
|
[`ignoreInput`](#ignoreinputvalue)).
|
|
34
|
-
During development, import `hotkey-router/auto`
|
|
35
|
-
|
|
34
|
+
During development, import `hotkey-router/auto` to enable warnings on the same router for reserved keys
|
|
35
|
+
and shifted-punctuation bindings.
|
|
36
36
|
|
|
37
37
|
## Why this library
|
|
38
38
|
|
|
@@ -48,7 +48,7 @@ when you bind a key the browser or OS keeps for itself.
|
|
|
48
48
|
- **Opt-in data:** which keys the browser and OS take, and which a page can win with `preventDefault` (Windows
|
|
49
49
|
rows checked with real key presses); which keys popular websites use.
|
|
50
50
|
- **`validateCombo`** for "press your keys" settings, with reasons ready to show.
|
|
51
|
-
- Zero dependencies. Core ~
|
|
51
|
+
- Zero dependencies. Core ~9.7 KB minified and ~4.1 KB gzipped. The data lives in separate entries.
|
|
52
52
|
|
|
53
53
|
It doesn't do key sequences (`g i`, `ctrl+k ctrl+s`), and it targets current browsers only.
|
|
54
54
|
|
|
@@ -77,7 +77,7 @@ Only the main entry has a CommonJS build. The subpaths (`/core`, `/auto`, `/rese
|
|
|
77
77
|
CDN (ESM), pinned to a version:
|
|
78
78
|
|
|
79
79
|
```js
|
|
80
|
-
import hotkeys from 'https://cdn.jsdelivr.net/npm/hotkey-router@0.
|
|
80
|
+
import hotkeys from 'https://cdn.jsdelivr.net/npm/hotkey-router@0.6.0/dist/hotkey-router.min.js'
|
|
81
81
|
```
|
|
82
82
|
|
|
83
83
|
`dist/auto.min.js` at the same path is the router with reservation warnings. It is a standalone build with its
|
|
@@ -214,21 +214,24 @@ calls `destroy()` first. `capture: true` runs every binding in the capture phase
|
|
|
214
214
|
with `{ capture: true }` do. `destroy()` removes the listeners and clears all bindings and plugins; `onBind`
|
|
215
215
|
hooks survive it.
|
|
216
216
|
|
|
217
|
-
### `
|
|
217
|
+
### `dispatch(event, type)`
|
|
218
218
|
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
219
|
+
Routes a keyboard event directly through one router and returns `true` if a handler ran. Pass `'keydown'`
|
|
220
|
+
or `'keyup'` as `type`. This considers both capture and bubble bindings without going through the DOM.
|
|
221
|
+
For testing from a hotkey string, use `trigger(router, hotkey, options?)` from `hotkey-router/testing`.
|
|
222
|
+
See [docs/testing.md](https://github.com/iWhatty/hotkey-router/blob/main/docs/testing.md).
|
|
222
223
|
|
|
223
224
|
### `parseHotkey(hotkey, options?)`
|
|
224
225
|
|
|
225
|
-
|
|
226
|
+
Import `parseHotkey` by name from `hotkey-router` or `hotkey-router/core`. Returns `{ combo, type, raw }`:
|
|
227
|
+
`combo` is `{ ctrl, shift, alt, meta, key, code, bareModifier
|
|
226
228
|
}`, `type` is `'keydown'` or `'keyup'`, `raw` the string you passed. Throws on a hotkey the router can't bind.
|
|
227
229
|
`{ platform }` resolves `mod` for another platform.
|
|
228
230
|
|
|
229
231
|
### `comboFromEvent(event, options?)`
|
|
230
232
|
|
|
231
|
-
|
|
233
|
+
Import `comboFromEvent` by name from `hotkey-router` or `hotkey-router/core`. Turns a keyboard event into a
|
|
234
|
+
hotkey string for a "press your keys" recorder. Physical by
|
|
232
235
|
default (`ctrl+shift+code:Period`); `{ useMod: true }` writes the platform's primary modifier as `mod`; `{
|
|
233
236
|
physical: false }` uses `event.key`; `{ platform }` decides what `mod` stands for. Returns `null` while only a
|
|
234
237
|
modifier is held.
|
|
@@ -244,15 +247,16 @@ field.addEventListener('keydown', (e) => {
|
|
|
244
247
|
|
|
245
248
|
### `detectPlatform(navigator?, { chromeos? })`
|
|
246
249
|
|
|
247
|
-
|
|
250
|
+
Import `detectPlatform` by name from `hotkey-router` or `hotkey-router/core`. Returns `'mac'`, `'windows'`,
|
|
251
|
+
`'linux'` or `null`. ChromeOS counts as `'linux'` unless you pass `{
|
|
248
252
|
chromeos: true }`. Reads `navigator.userAgentData.platform`, then `navigator.platform`, then the user agent.
|
|
249
253
|
The router and every add-on use it, so they agree on `mod`.
|
|
250
254
|
|
|
251
255
|
### `onBind(hook)`
|
|
252
256
|
|
|
253
|
-
Calls `hook({ combo, raw, options, plugin, id })` after every successful `bind()` on this router
|
|
254
|
-
an unsubscribe function.
|
|
255
|
-
|
|
257
|
+
Calls `hook({ combo, type, raw, options, plugin, id })` after every successful `bind()` on this router and returns
|
|
258
|
+
an unsubscribe function. `type` is `'keydown'` or `'keyup'`. The development warnings use this hook. The router
|
|
259
|
+
logs a hook error with `console.error` and keeps the binding registered.
|
|
256
260
|
|
|
257
261
|
```js
|
|
258
262
|
const stop = hotkeys.onBind(({ raw, plugin }) => console.debug('bound', raw, plugin))
|
|
@@ -290,9 +294,9 @@ is every keystroke during IME composition. `altGraph: true` or `composing: true`
|
|
|
290
294
|
off.
|
|
291
295
|
|
|
292
296
|
**Shifted punctuation.** With Shift held, `event.key` is the shifted character, so a key-based `ctrl+shift+,`
|
|
293
|
-
waits for a `,` that a US keyboard reports as `<`, and never fires.
|
|
294
|
-
|
|
295
|
-
|
|
297
|
+
waits for a `,` that a US keyboard reports as `<`, and never fires. Use the physical key `ctrl+shift+code:Comma`.
|
|
298
|
+
Development warnings flag Shift with `` , . / ; ' [ ] \ - = ` `` or a digit once per combo and event type.
|
|
299
|
+
`validateCombo` reports the same issue as `shifted-punctuation`. The other way round works: a binding for a
|
|
296
300
|
character with no case, such as `?`, `!` or `+`, also fires while Shift is held to type it, unless a `shift+`
|
|
297
301
|
binding matches exactly. Letters and Space keep Shift as part of the key.
|
|
298
302
|
|
|
@@ -332,15 +336,16 @@ are minified (gzipped) in an app bundle.
|
|
|
332
336
|
|
|
333
337
|
| Entry | What it does | Size |
|
|
334
338
|
| --- | --- | --- |
|
|
335
|
-
| `hotkey-router/auto` | The default router with
|
|
336
|
-
| `hotkey-router/
|
|
337
|
-
| `hotkey-router/
|
|
339
|
+
| `hotkey-router/auto` | The default router with development warnings installed | ~30.8 KB (~7.8 KB), router included |
|
|
340
|
+
| `hotkey-router/dev` | Installs reservation and shifted-punctuation warnings on a router | ~24.3 KB (~5.3 KB), reservation table included |
|
|
341
|
+
| `hotkey-router/reservations` | Looks up keys reserved by the browser or OS | ~22.2 KB (~4.4 KB) |
|
|
342
|
+
| `hotkey-router/validate` | Checks a recorded hotkey before you save it | ~62.6 KB (~13.9 KB), both tables |
|
|
338
343
|
| `hotkey-router/format` | Shows a hotkey to people: `Ctrl+Shift+.`, `⇧⌘.`, keycaps | ~8.6 KB (~3.5 KB) |
|
|
339
344
|
| `hotkey-router/sites` | Which keys popular websites use; a `when` gate that yields to them | ~38 KB (~9 KB) |
|
|
345
|
+
| `hotkey-router/testing` | Fires a router binding from a hotkey string in tests | ~1.5 KB (~0.6 KB) with `/core` already bundled |
|
|
340
346
|
|
|
341
|
-
The data tables are big next to the core.
|
|
342
|
-
|
|
343
|
-
runtime.
|
|
347
|
+
The data tables are big next to the core. Load `/auto` or `/dev` in development builds. Load `/reservations`,
|
|
348
|
+
`/validate` or `/sites` where your app uses the lookup data, such as a settings page that records keys.
|
|
344
349
|
|
|
345
350
|
### Reservation warnings
|
|
346
351
|
|
|
@@ -355,10 +360,10 @@ hotkeys.bind('meta+shift+f', toggleFullscreen)
|
|
|
355
360
|
// [hotkey-router] "meta+shift+f" (meta+shift+f) reserved by firefox on macOS: "Toggle fullscreen" [hard] — will not fire.
|
|
356
361
|
```
|
|
357
362
|
|
|
358
|
-
|
|
359
|
-
router. Keys the page never gets log a `warn
|
|
360
|
-
|
|
361
|
-
|
|
363
|
+
Call `installDevWarnings(router, { platform, browser })` from `hotkey-router/dev` to enable both warnings on a
|
|
364
|
+
specific router. It returns an unsubscribe function. Keys the page never gets log a `warn`. A key the page
|
|
365
|
+
can win logs an `info` with `preventDefault: true` and a `warn` otherwise. For runtime lookup use
|
|
366
|
+
`lookupReservation(combo, { platform, browser })` from `hotkey-router/reservations`. See
|
|
362
367
|
[docs/reservations.md](https://github.com/iWhatty/hotkey-router/blob/main/docs/reservations.md).
|
|
363
368
|
|
|
364
369
|
### Validating a recorded hotkey
|
package/dist/auto.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
// hotkey-router v0.
|
|
1
|
+
// hotkey-router v0.6.0 | SEE LICENSE IN LICENSE
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
// auto.js
|
|
5
5
|
import hotkeys from "./hotkey-router.js";
|
|
6
|
-
import {
|
|
7
|
-
|
|
6
|
+
import { installDevWarnings } from "./dev.js";
|
|
7
|
+
installDevWarnings(hotkeys);
|
|
8
8
|
var auto_default = hotkeys;
|
|
9
9
|
export {
|
|
10
10
|
auto_default as default
|
package/dist/auto.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../auto.js"],
|
|
4
|
-
"sourcesContent": ["// auto.js\r\n//\r\n// Ergonomic one-import entry: same default export as `hotkey-router`, but\r\n// with reservation
|
|
5
|
-
"mappings": ";;;;AAgBA,OAAO,aAAa;AACpB,SAAS,
|
|
4
|
+
"sourcesContent": ["// auto.js\r\n//\r\n// Ergonomic one-import entry: same default export as `hotkey-router`, but\r\n// with reservation and shifted-punctuation warnings pre-installed.\r\n//\r\n// import hotkeys from 'hotkey-router/auto'\r\n// hotkeys.bind('meta+shift+f', toggleFullscreen)\r\n// // Console (Firefox Mac):\r\n// // [hotkey-router] \"meta+shift+f\" reserved by firefox on macOS:\r\n// // \"Toggle fullscreen\" [hard] \u2014 will not fire.\r\n//\r\n// Pay-to-play: importing this entry pulls in the reservation table\r\n// (reservations module minified: ~23 KB, ~5.5 KB gzipped; measured 0.3.2).\r\n// If you want the tiny core only, `import hotkeys from 'hotkey-router'` and\r\n// the data file is tree-shaken out entirely.\r\n\r\nimport hotkeys from './hotkey-router.js'\r\nimport { installDevWarnings } from './dev.js'\r\n\r\ninstallDevWarnings(hotkeys)\r\n\r\nexport default hotkeys\r\n"],
|
|
5
|
+
"mappings": ";;;;AAgBA,OAAO,aAAa;AACpB,SAAS,0BAA0B;AAEnC,mBAAmB,OAAO;AAE1B,IAAO,eAAQ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/auto.min.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
// hotkey-router v0.
|
|
1
|
+
// hotkey-router v0.6.0 | SEE LICENSE IN LICENSE
|
|
2
2
|
|
|
3
|
-
function v(e,t){return e!=null&&Object.prototype.hasOwnProperty.call(e,t)?e[t]:void 0}function ie(e){return e?/Chrome ?OS|CrOS/i.test(e)?"chromeos":/Mac|iPhone|iPad|iPod/i.test(e)?"mac":/Win/i.test(e)?"windows":/Linux|X11/i.test(e)?"linux":null:null}function A(e=typeof navigator<"u"?navigator:null,{chromeos:t=!1}={}){if(!e)return null;let r=e.userAgent||"",i=(/\bCrOS\b/.test(r)?"chromeos":null)||ie(e.userAgentData?.platform)||ie(e.platform)||(/Mac OS X/i.test(r)?"mac":/Windows/i.test(r)?"windows":/Linux|X11/i.test(r)?"linux":null);return i==="chromeos"&&!t?"linux":i}function oe(e=typeof navigator<"u"?navigator:null){if(!e)return null;let t=e.userAgent||"";return/Edg\//.test(t)?"edge":/Firefox/.test(t)?"firefox":/Chrome/.test(t)?"chrome":/Safari/.test(t)?"safari":null}var Fe={mac:"macOS",windows:"Windows",linux:"Linux",chromeos:"ChromeOS"};function ae(e){return v(Fe,e)||e}var De=A(),ne=new Set(["ctrl","shift","alt","meta","mod"]),Te=new Map([["^","ctrl"],["!","alt"],["+","shift"],["#","meta"]]),se=Object.freeze({esc:"escape",escape:"escape",space:" ",spacebar:" ",enter:"enter",return:"enter",del:"delete",delete:"delete",backspace:"backspace",tab:"tab",up:"arrowup",down:"arrowdown",left:"arrowleft",right:"arrowright",home:"home",end:"end",pageup:"pageup",pagedown:"pagedown",pgup:"pageup",pgdn:"pagedown",cmd:"meta",command:"meta",win:"meta",meta:"meta",control:"ctrl",ctrl:"ctrl",option:"alt",opt:"alt",alt:"alt",shift:"shift","\u2318":"meta","\u2303":"ctrl","\u2325":"alt","\u21E7":"shift",mod:"mod",plus:"+"});function P(e){let t=String(e??"");if(t===" ")return" ";let i=t.trim().toLowerCase();return v(se,i)??i}function Ke(e){return ne.has(P(e))}var Re=/(^|\+)\s*code:([A-Za-z][A-Za-z0-9_]*)/;function j(e,{platform:t=De}={}){let r=String(e||"").trim(),i=null,s=m=>{i=i||`Invalid hotkey "${e}": ${m}`},f=/\s+up$/i.test(r),p=f?r.replace(/\s+up$/i,"").trim():r,a={ctrl:!1,shift:!1,alt:!1,meta:!1,key:null,code:null,bareModifier:null},b=m=>{m==="mod"?a[t==="mac"?"meta":"ctrl"]=!0:a[m]=!0},w=p;for(;w.length>1;){let m=Te.get(w[0])??null;if(!m)break;b(m),w=w.slice(1).trimStart()}let C=w.match(/code:[A-Za-z][A-Za-z0-9_]*/g);C&&C.length>1&&s(`multiple code: tokens not supported (got ${C.length}).`);let _=null,T=w.replace(Re,(m,S,W)=>(_=W,S+"__code__")).toLowerCase(),O=T.split("+").map(m=>m.trim()),I=O.filter(Boolean),z=O.some(m=>m==="")&&T.includes("++");if(!z){let m=!1;for(let S of I)Ke(S)?m&&s('modifiers must come before the base key (e.g. "ctrl+k", not "k+ctrl")'):m=!0}let M=0;for(let m of I){if(m==="__code__"){a.code=_,M++;continue}let S=v(se,m)??m;ne.has(S)?b(S):(a.key=P(S),M++)}if(M>1&&s('use one base key (e.g. "ctrl+k"), or one code: token'),!a.key&&!a.code&&(z||w==="+")&&(a.key="+"),!a.key&&!a.code){let m=(a.ctrl?1:0)+(a.shift?1:0)+(a.alt?1:0)+(a.meta?1:0);m===1?a.bareModifier=a.ctrl?"ctrl":a.shift?"shift":a.alt?"alt":"meta":m>1?s('multi-modifier bare bindings not supported. Add a base key (e.g. "ctrl+alt+x").'):i=i||`Invalid hotkey "${e}" (missing base key)`}return{combo:a,type:f?"keyup":"keydown",raw:e,error:i}}function D(e,t){let{combo:r,type:i,raw:s,error:f}=j(e,t);if(f)throw new Error(f);return{combo:r,type:i,raw:s}}var ce={",":["<","Comma"],".":[">","Period"],"/":["?","Slash"],";":[":","Semicolon"],"'":['"',"Quote"],"[":["{","BracketLeft"],"]":["}","BracketRight"],"\\":["|","Backslash"],"-":["_","Minus"],"=":["+","Equal"],"`":["~","Backquote"]};for(let e=0;e<10;e++)ce[e]=[")!@#$%^&*("[e],"Digit"+e];function le(e){let{combo:t,type:r,error:i}=j(e);if(i||!t.shift||t.code)return null;let s=v(ce,t.key);if(!s)return null;let[f,p]=s,b=String(e).trim().replace(/\s+up$/i,"").slice(0,-1)+"code:"+p+(r==="keyup"?" up":"");return{message:`"${e}" never fires on US layouts: Shift turns "${t.key}" into "${f}". Bind "${b}" instead.`,suggestion:b}}var G={".":"period",",":"comma",";":"semicolon","'":"quote","/":"slash","\\":"backslash","[":"bracketleft","]":"bracketright","-":"minus","=":"equal","`":"backquote"," ":"space","+":"equal"};function Oe(e){if(!e)return null;let t=/^Key([A-Za-z])$/.exec(e);if(t)return t[1].toLowerCase();let r=/^(?:Digit|Numpad)(\d)$/.exec(e);return r?r[1]:e.toLowerCase()}function Me(e){if(e==null||e==="")return null;if(v(G,e))return v(G,e);let t=P(e);return v(G,t)||t||null}function Z(e){if(!e||e.bareModifier)return null;let t=e.code?Oe(e.code):Me(e.key);if(!t)return null;let r=[];return e.ctrl&&r.push("ctrl"),e.meta&&r.push("meta"),e.alt&&r.push("alt"),e.shift&&r.push("shift"),r.push(t),r.join("+")}function R(e,t,r,i){return e.addEventListener(t,r,i),()=>e.removeEventListener(t,r,i)}var Be=A(),Q=Object.freeze({Alt:"alt",AltGraph:"alt",Control:"ctrl",Shift:"shift",Meta:"meta",OS:"meta"}),de=new Set;function L({ctrl:e,shift:t,alt:r,meta:i,key:s,code:f,bareModifier:p}){if(p)return`__bare__:${p}`;let a="";return e&&(a+="ctrl+"),t&&(a+="shift+"),r&&(a+="alt+"),i&&(a+="meta+"),f?a+"code:"+f:a?a+s:s}function Ne(e){let t=v(Q,e.key);return t?`__bare__:${t}`:L({ctrl:e.ctrlKey,shift:e.shiftKey,alt:e.altKey,meta:e.metaKey,key:P(e.key)})}function Le(e){if(!e.code)return null;let t="";return e.ctrlKey&&(t+="ctrl+"),e.shiftKey&&(t+="shift+"),e.altKey&&(t+="alt+"),e.metaKey&&(t+="meta+"),t+"code:"+e.code}var $e=new Set(["checkbox","radio","range","color","file","button","submit","reset","image"]);function _e(e){let t=e?.composedPath?.();if(t?.length)return t;let r=[];for(let i=e?.target;i;i=i.parentNode||i.host)r.push(i);return r}function Ie(e,t){let r=_e(e),i=r[0];if(!i)return null;let s=String(i.tagName||"").toUpperCase();if(i.isContentEditable||s==="TEXTAREA"||s==="SELECT"||i.getAttribute?.("role")==="textbox")return"text";if(s==="INPUT"){if(t==="all")return"text";let f=String(i.getAttribute?.("type")||"text").toLowerCase();return $e.has(f)?"control":"text"}if(t==="text"){for(let f of r)if(String(f.tagName||"").toUpperCase()==="BUTTON"||f.getAttribute?.("role")==="button")return"control"}return null}function ze(e){return!!((e.ctrlKey||e.altKey||e.metaKey)&&!v(Q,e.key))}function fe(e,t){if(typeof t!="function")throw new TypeError(`hotkeys.bind("${e}") expects a function handler, got ${t===null?"null":typeof t}`)}function he(e){if(e==="all"||e==="text")return e;if(typeof e=="string")throw new TypeError(`hotkeys.ignoreInput() expects true, false, 'all' or 'text', got "${e}"`);return e?"all":null}function He(e,t){let r=t?{...t}:{};return e==="keydown"&&r.repeat==null&&(r.repeat=!1),r.priority==null&&(r.priority=0),r}function ue(e){let t=null;for(let r of e)t?(r.options.priority>t.options.priority||r.options.priority===t.options.priority&&r.id>t.id)&&(t=r):t=r;return t}function je(e){return!!(e.ctrlKey&&e.altKey&&typeof e.getModifierState=="function"&&e.getModifierState("AltGraph")&&typeof e.key=="string"&&e.key.length===1)}function pe(e){return!!(e.isComposing||e.keyCode===229)}var Ue=/^(?!\p{Script=Latin})\p{L}$/u;function We(e){if(!(e.ctrlKey||e.metaKey)||e.altKey||pe(e)||typeof e.getModifierState=="function"&&e.getModifierState("AltGraph"))return null;let t=/^Key([A-Z])$/.exec(e.code||"");return!t||typeof e.key!="string"||!Ue.test(e.key)?null:L({ctrl:e.ctrlKey,shift:e.shiftKey,alt:!1,meta:e.metaKey,key:t[1].toLowerCase()})}function Ve(e){return!e.shiftKey||typeof e.key!="string"||e.key.length!==1||/\s/.test(e.key)||e.key.toLowerCase()!==e.key.toUpperCase()?null:L({ctrl:e.ctrlKey,shift:!1,alt:e.altKey,meta:e.metaKey,key:P(e.key)})}var qe={ctrl:"Control",shift:"Shift",alt:"Alt",meta:"Meta"},me={Period:".",Comma:",",Semicolon:";",Quote:"'",Slash:"/",Backslash:"\\",BracketLeft:"[",BracketRight:"]",Minus:"-",Equal:"=",Backquote:"`",Space:" ",Enter:"Enter",NumpadEnter:"Enter",Tab:"Tab",Escape:"Escape",Backspace:"Backspace",Delete:"Delete",Insert:"Insert",Home:"Home",End:"End",PageUp:"PageUp",PageDown:"PageDown",ArrowUp:"ArrowUp",ArrowDown:"ArrowDown",ArrowLeft:"ArrowLeft",ArrowRight:"ArrowRight"},U={},ye;for(let[e,t]of Object.entries(me))U[ye=P(t)]??(U[ye]=e);function Ge(e){if(!e)return null;let t=/^Key([A-Z])$/.exec(e);if(t)return t[1].toLowerCase();let r=/^(?:Digit|Numpad)(\d)$/.exec(e);return r?r[1]:/^F\d{1,2}$/.test(e)?e:v(me,e)??null}function Ze(e){return e?/^[a-z]$/.test(e)?"Key"+e.toUpperCase():/^\d$/.test(e)?"Digit"+e:/^f\d{1,2}$/.test(e)?e.toUpperCase():v(U,e)??null:null}function ve(e,{physical:t=!0,useMod:r=!1,platform:i=Be}={}){if(!e||v(Q,e.key))return null;let s=[],f=i==="mac";if(r&&(f?e.metaKey:e.ctrlKey)&&s.push("mod"),e.ctrlKey&&!(r&&!f)&&s.push("ctrl"),e.metaKey&&!(r&&f)&&s.push("meta"),e.altKey&&s.push("alt"),e.shiftKey&&s.push("shift"),t&&e.code)s.push(`code:${e.code}`);else{let p=P(e.key);if(!p)return null;s.push(p===" "?"space":p)}return s.join("+")}function be({target:e=typeof window<"u"?window:null,capture:t=!1,ignoreInput:r=!0}={}){let i=he(r),s=e,f=t,p=[],a=new Map,b=new Map,w=new Map,C=!1,_=1;function Y(o,c){let l=a.get(o);l||(l=new Map,a.set(o,l));let n=l.get(c);return n||(n=[],l.set(c,n)),n}function T(o){let c=w.get(o);if(!c)return!1;let{comboStr:l,type:n}=c,h=a.get(l),d=h?.get(n);if(!d?.length)return w.delete(o),!1;let u=d.filter(y=>y.id!==o);return u.length?h.set(n,u):h.delete(n),h.size||a.delete(l),w.delete(o),!0}function O(o,c,l=null,n={}){let{combo:h,type:d,raw:u}=D(o);fe(o,c);let y=L(h),k=He(d,n),x={id:_++,comboStr:y,type:d,combo:h,handler:c,plugin:l,raw:u,options:k};Y(y,d).push(x),w.set(x.id,{comboStr:y,type:d});let E=`${y} ${d}`;if(!de.has(E)){let F=le(o);F&&(de.add(E),console.warn(`[hotkey-router] ${F.message}`))}if(p.length)for(let F of p)try{F({combo:h,raw:u,options:k,plugin:l,id:x.id})}catch(H){console.error("[hotkey-router] onBind hook threw:",H)}let g=()=>T(x.id);return g.id=x.id,g.hotkey=u,g}function I(o){if(typeof o!="function")throw new TypeError("hotkeys.onBind(hook) expects a function");return p.push(o),()=>{p=p.filter(c=>c!==o)}}function z(o,c){let{combo:l,type:n}=D(o),h=L(l),d=a.get(h);if(!d)return;let u=d.get(n);if(u?.length){if(c){let y=[];for(let k of u)k.handler===c?w.delete(k.id):y.push(k);y.length?d.set(n,y):d.delete(n)}else{for(let y of u)w.delete(y.id);d.delete(n)}d.size||a.delete(h)}}function M(o,c){if(b.has(o))throw new Error(`Plugin "${o}" already registered`);let l=Object.entries(c).map(([h,d])=>{let[u,y]=Array.isArray(d)?d:[d,{}];return D(h),fe(h,u),[h,u,y]}),n=[];for(let[h,d,u]of l){let y=O(h,d,o,u);n.push(y.id)}return b.set(o,n),()=>{b.get(o)===n&&m(o)}}function m(o){let c=b.get(o);if(c){for(let l of c)T(l);b.delete(o)}}function S(){C=!0}function W(){C=!1}function Ce(o=!0){i=he(o)}function Ee(o){s=o}function J(o,c,l){let n={altGraphChar:je(o),composing:pe(o),focus:i&&Ie(o,i),chord:ze(o)},h=[],d=new Set;for(let u of[Ne(o),Le(o)])!u||d.has(u)||(d.add(u),ee(h,u,o,c,l,n));for(let u of[We,Ve]){if(h.length)break;let y=u(o);y&&!d.has(y)&&(d.add(y),ee(h,y,o,c,l,n))}return h}function ee(o,c,l,n,h,{altGraphChar:d,composing:u,focus:y,chord:k}){let x=a.get(c)?.get(n);if(x?.length)for(let E of x){let g=E.options;h==="capture"&&!g.capture||h==="bubble"&&g.capture||d&&!g.altGraph||u&&!g.composing||y&&!(y==="control"&&k)&&!g.allowIn?.(l)||n==="keydown"&&g.repeat===!1&&l.repeat||g.when&&g.when(l)===!1||o.push(E)}}function te(o,c){let l=o.options;l.preventDefault&&c.preventDefault(),l.stopImmediatePropagation?c.stopImmediatePropagation():l.stopPropagation&&c.stopPropagation(),l.once&&T(o.id),o.handler(c)}function K(o,c="all"){return l=>{if(C)return;let n=J(l,o,c);n.length&&te(ue(n),l)}}let B=null,N=null,V=null,q=null;function Ae({target:o=s,capture:c=f}={}){if(!o)throw new Error("hotkeys.init() requires a target (e.g. window)");if((B||N)&&re(),c){B=R(o,"keydown",K("keydown"),{capture:!0}),N=R(o,"keyup",K("keyup"),{capture:!0});return}B=R(o,"keydown",K("keydown","bubble"),{capture:!1}),N=R(o,"keyup",K("keyup","bubble"),{capture:!1}),V=R(o,"keydown",K("keydown","capture"),{capture:!0}),q=R(o,"keyup",K("keyup","capture"),{capture:!0})}function re(){B?.(),N?.(),V?.(),q?.(),B=null,N=null,V=null,q=null,a.clear(),b.clear(),w.clear()}function Pe(o,{type:c,target:l=null}={}){let{combo:n,type:h}=D(o),d=c||h;if(C)return!1;let u=n.bareModifier?v(qe,n.bareModifier):n.key??Ge(n.code),y=n.bareModifier?null:n.code??Ze(n.key),k=!!n.alt,x=!!n.ctrl,E=!!n.shift,g=!!n.meta;n.bareModifier&&d==="keyup"&&(n.bareModifier==="alt"?k=!1:n.bareModifier==="ctrl"?x=!1:n.bareModifier==="shift"?E=!1:n.bareModifier==="meta"&&(g=!1));let F={type:d,key:u,code:y,ctrlKey:x,shiftKey:E,altKey:k,metaKey:g,repeat:!1,isComposing:!1,getModifierState(){return!1},preventDefault(){},stopPropagation(){},stopImmediatePropagation(){},target:l},H=J(F,d,"all");return H.length?(te(ue(H),F),!0):!1}return{init:Ae,destroy:re,setTarget:Ee,bind:O,unbind:z,registerPlugin:M,unregisterPlugin:m,onBind:I,pause:S,resume:W,ignoreInput:Ce,trigger:Pe,parseHotkey:D,comboFromEvent:ve,detectPlatform:A}}var we=be();typeof window<"u"&&we.init();var X=we;var $={$comment:"Machine-readable companion to docs/browser-hotkeys.md. Each combo entry describes who claims the binding and how strongly. Intended for runtime conflict warnings in keyboard-routing libraries (e.g. hotkey-router) and dev-time validation in apps like WebRadar. Update both this file and the markdown together \u2014 the markdown is the human source of truth, this file is the machine projection.",version:{generated:"2026-10-29",schema:"1.0",sources:["https://support.mozilla.org/en-US/kb/keyboard-shortcuts-perform-firefox-tasks-quickly","https://firefox-source-docs.mozilla.org/devtools-user/keyboard_shortcuts/index.html","https://support.google.com/chrome/answer/157179","https://developer.chrome.com/docs/devtools/shortcuts","https://support.apple.com/guide/safari/keyboard-shortcuts-and-gestures-cpsh003/mac","https://developer.apple.com/documentation/safari-developer-tools/web-inspector","https://support.microsoft.com/en-us/microsoft-edge/keyboard-shortcuts-in-microsoft-edge-50d3edab-30d9-c7e4-21ce-37fe2713cfad","https://support.apple.com/en-us/102650","https://support.microsoft.com/en-us/windows/keyboard-shortcuts-in-windows-dcc61a57-8ff0-cffe-9796-cb9706c75eec","https://help.gnome.org/gnome-help/shell-keyboard-shortcuts.html"]},severityLevels:{hard:"Browser or OS intercepts before page-world keydown fires. preventDefault() can't recover it.","find-bar-only":"Reserved only when the browser's find bar has focus. Fires in page world during normal browsing.","menu-activation":"Win/Linux Alt+letter activates the browser menu bar. Hard to suppress reliably.","system-text":"Only reserved while a text input has focus (terminal-style cursor controls on macOS).",compose:"macOS Option+letter types a special character in text inputs. Outside inputs, free for page world.",os:"Operating system intercepts globally, before any application sees it.","devtools-open":"Only relevant when DevTools is already open; outside DevTools it fires normally.",preventable:"The browser's own shortcut, but keydown reaches the page first: a binding with preventDefault() keeps the browser out, and without one the browser acts. Checked with real keys on Windows (docs/notes/key-check-reserved-2026-10-29.md)."},$keyFormat:"Each combo key uses hotkey-router-compatible syntax: modifiers in canonical order (ctrl|meta|alt|shift) joined by '+', then the key (lowercased letter, or symbolic name). Per-platform tables use the platform's native modifier name \u2014 `meta` on macOS = Cmd, `meta` on Windows = Win, `ctrl` on Linux/Windows = the primary modifier.",platforms:{mac:{browsers:{firefox:{"meta+a":{action:"Select all",severity:"hard"},"meta+b":{action:"Bookmarks sidebar",severity:"hard"},"meta+c":{action:"Copy",severity:"hard"},"meta+d":{action:"Bookmark this page",severity:"hard"},"meta+e":{action:"Search from page",severity:"hard"},"meta+f":{action:"Find in page",severity:"hard"},"meta+g":{action:"Find next",severity:"hard"},"meta+j":{action:"Downloads",severity:"hard"},"meta+l":{action:"Focus address bar",severity:"hard"},"meta+n":{action:"New window",severity:"hard"},"meta+o":{action:"Open file",severity:"hard"},"meta+p":{action:"Print",severity:"hard"},"meta+r":{action:"Reload",severity:"hard"},"meta+s":{action:"Save page",severity:"hard"},"meta+t":{action:"New tab",severity:"hard"},"meta+u":{action:"View source",severity:"hard"},"meta+v":{action:"Paste",severity:"hard"},"meta+w":{action:"Close tab",severity:"hard"},"meta+x":{action:"Cut",severity:"hard"},"meta+y":{action:"Redo",severity:"hard"},"meta+z":{action:"Undo",severity:"hard"},"meta+shift+a":{action:"Add-ons manager",severity:"hard"},"meta+shift+b":{action:"Bookmarks toolbar",severity:"hard"},"meta+shift+c":{action:"Inspector (element picker)",severity:"hard"},"meta+shift+d":{action:"Bookmark all tabs",severity:"hard"},"meta+shift+e":{action:"Network Monitor",severity:"hard"},"meta+shift+f":{action:"Toggle fullscreen",severity:"hard"},"meta+shift+g":{action:"Find previous",severity:"find-bar-only"},"meta+shift+j":{action:"Browser Console",severity:"hard"},"meta+shift+n":{action:"New private window",severity:"hard"},"meta+shift+o":{action:"Bookmarks library",severity:"hard"},"meta+shift+p":{action:"New private window (alt)",severity:"hard"},"meta+shift+q":{action:"Quit (with confirm)",severity:"hard"},"meta+shift+s":{action:"Firefox Screenshot",severity:"hard"},"meta+shift+t":{action:"Reopen closed tab",severity:"hard"},"meta+shift+v":{action:"Paste as plain text",severity:"hard"},"meta+shift+w":{action:"Close window",severity:"hard"},"meta+shift+z":{action:"Redo",severity:"hard"},"meta+alt+c":{action:"Inspector",severity:"hard"},"meta+alt+e":{action:"Network Monitor",severity:"hard"},"meta+alt+i":{action:"DevTools Toolbox",severity:"hard"},"meta+alt+j":{action:"Browser Console",severity:"hard"},"meta+alt+k":{action:"Web Console",severity:"hard"},"meta+alt+m":{action:"Responsive Design Mode",severity:"hard"},"meta+alt+z":{action:"Debugger",severity:"hard"}},chrome:{"meta+a":{action:"Select all",severity:"hard"},"meta+c":{action:"Copy",severity:"hard"},"meta+d":{action:"Bookmark this page",severity:"hard"},"meta+e":{action:"Search selected text",severity:"find-bar-only"},"meta+f":{action:"Find in page",severity:"hard"},"meta+g":{action:"Find next",severity:"hard"},"meta+l":{action:"Focus address bar",severity:"hard"},"meta+n":{action:"New window",severity:"hard"},"meta+o":{action:"Open file",severity:"hard"},"meta+p":{action:"Print",severity:"hard"},"meta+r":{action:"Reload",severity:"hard"},"meta+s":{action:"Save page",severity:"hard"},"meta+t":{action:"New tab",severity:"hard"},"meta+v":{action:"Paste",severity:"hard"},"meta+w":{action:"Close tab",severity:"hard"},"meta+x":{action:"Cut",severity:"hard"},"meta+y":{action:"History page",severity:"hard"},"meta+z":{action:"Undo",severity:"hard"},"meta+shift+b":{action:"Bookmarks bar toggle",severity:"hard"},"meta+shift+c":{action:"DevTools Inspector",severity:"hard"},"meta+shift+d":{action:"Bookmark all tabs",severity:"hard"},"meta+shift+g":{action:"Find previous",severity:"find-bar-only"},"meta+shift+j":{action:"Downloads page",severity:"hard"},"meta+shift+m":{action:"Switch user / guest",severity:"hard"},"meta+shift+n":{action:"New incognito window",severity:"hard"},"meta+shift+r":{action:"Hard reload",severity:"hard"},"meta+shift+t":{action:"Reopen closed tab",severity:"hard"},"meta+shift+v":{action:"Paste as plain text",severity:"hard"},"meta+shift+w":{action:"Close window",severity:"hard"},"meta+shift+z":{action:"Redo",severity:"hard"},"meta+alt+i":{action:"DevTools",severity:"hard"},"meta+alt+j":{action:"DevTools (console)",severity:"hard"},"meta+alt+u":{action:"View source",severity:"hard"}},safari:{"meta+a":{action:"Select all",severity:"hard"},"meta+c":{action:"Copy",severity:"hard"},"meta+d":{action:"Add to Reading List",severity:"hard"},"meta+f":{action:"Find in page",severity:"hard"},"meta+g":{action:"Find next",severity:"hard"},"meta+j":{action:"Downloads",severity:"hard"},"meta+l":{action:"Focus Smart Search",severity:"hard"},"meta+n":{action:"New window",severity:"hard"},"meta+p":{action:"Print",severity:"hard"},"meta+r":{action:"Reload",severity:"hard"},"meta+s":{action:"Save page",severity:"hard"},"meta+t":{action:"New tab",severity:"hard"},"meta+v":{action:"Paste",severity:"hard"},"meta+w":{action:"Close tab",severity:"hard"},"meta+x":{action:"Cut",severity:"hard"},"meta+z":{action:"Undo",severity:"hard"},"meta+shift+c":{action:"Inspector pick element",severity:"hard"},"meta+shift+d":{action:"Add Reading List item",severity:"hard"},"meta+shift+g":{action:"Find previous",severity:"find-bar-only"},"meta+shift+h":{action:"Go to homepage",severity:"hard"},"meta+shift+n":{action:"New private window",severity:"hard"},"meta+shift+r":{action:"Reader mode",severity:"hard"},"meta+shift+t":{action:"Reopen last closed tab",severity:"hard"},"meta+shift+v":{action:"Paste as plain text",severity:"hard"},"meta+shift+w":{action:"Close window",severity:"hard"},"meta+shift+z":{action:"Redo",severity:"hard"},"meta+alt+c":{action:"Web Inspector pick",severity:"hard"},"meta+alt+i":{action:"Web Inspector",severity:"hard"}},edge:{$comment:"From Microsoft's Edge shortcuts page (Mac table), 2026-11-15. Edit-menu rows (meta+a/c/v/x/z, meta+shift+z) as Chrome. Not checked with real keys.","meta+a":{action:"Select all",severity:"hard"},"meta+c":{action:"Copy",severity:"hard"},"meta+d":{action:"Save as favorite",severity:"hard"},"meta+f":{action:"Find in page",severity:"hard"},"meta+g":{action:"Find next",severity:"hard"},"meta+l":{action:"Focus address bar",severity:"hard"},"meta+n":{action:"New window",severity:"hard"},"meta+o":{action:"Open file",severity:"hard"},"meta+p":{action:"Print",severity:"hard"},"meta+r":{action:"Reload",severity:"hard"},"meta+s":{action:"Save page",severity:"hard"},"meta+t":{action:"New tab",severity:"hard"},"meta+v":{action:"Paste",severity:"hard"},"meta+w":{action:"Close tab",severity:"hard"},"meta+x":{action:"Cut",severity:"hard"},"meta+y":{action:"History",severity:"hard"},"meta+z":{action:"Undo",severity:"hard"},"ctrl+m":{action:"Mute current tab",severity:"hard"},"ctrl+meta+f":{action:"Toggle full screen",severity:"hard"},"meta+shift+b":{action:"Favorites bar toggle",severity:"hard"},"meta+shift+c":{action:"Developer tools",severity:"hard"},"meta+shift+d":{action:"Favorite all tabs",severity:"hard"},"meta+shift+e":{action:"Search in sidebar",severity:"hard"},"meta+shift+g":{action:"Find previous",severity:"find-bar-only"},"meta+shift+h":{action:"Home page",severity:"hard"},"meta+shift+m":{action:"Switch user / guest",severity:"hard"},"meta+shift+n":{action:"New InPrivate window",severity:"hard"},"meta+shift+r":{action:"Hard reload",severity:"hard"},"meta+shift+t":{action:"Reopen closed tab",severity:"hard"},"meta+shift+u":{action:"Read Aloud toggle",severity:"hard"},"meta+shift+v":{action:"Paste as plain text",severity:"hard"},"meta+shift+w":{action:"Close window",severity:"hard"},"meta+shift+z":{action:"Redo",severity:"hard"},"meta+alt+f":{action:"Search the web",severity:"hard"},"meta+alt+j":{action:"JavaScript console",severity:"hard"},"meta+alt+l":{action:"Downloads",severity:"hard"},"meta+alt+m":{action:"Minimize all windows",severity:"hard"}}},system:{"meta+space":{action:"Spotlight",severity:"os"},"meta+tab":{action:"App switcher",severity:"os"},"meta+h":{action:"Hide app",severity:"os"},"meta+m":{action:"Minimize window",severity:"os"},"meta+q":{action:"Quit app",severity:"os"},"meta+shift+3":{action:"Screenshot full screen",severity:"os"},"meta+shift+4":{action:"Screenshot selection",severity:"os"},"meta+shift+5":{action:"Screen recording tool",severity:"os"},"meta+shift+q":{action:"Log out",severity:"os"},"meta+ctrl+q":{action:"Lock screen",severity:"os"},"meta+ctrl+space":{action:"Character Viewer",severity:"os"},"meta+alt+esc":{action:"Force-quit dialog",severity:"os"},"meta+shift+slash":{action:"Help menu search (Cmd+?)",severity:"os"},"meta+alt+h":{action:"Hide other apps",severity:"os"},"meta+alt+d":{action:"Show or hide the Dock",severity:"os"},"meta+backquote":{action:"Switch windows of the front app",severity:"os"}},noteForLetterCombos:{"alt+a..z":{behavior:"compose",note:"Option+letter types special characters in text inputs (Option+E\u2192\xB4, Option+A\u2192\xE5, Option+F\u2192\u0192). Outside inputs, free for page world."},"ctrl+a..z":{behavior:"system-text",note:"Mac uses Ctrl+letter as terminal-style cursor controls inside text inputs (Ctrl+A=line start, Ctrl+E=line end, Ctrl+K=delete-to-end, etc.). Outside inputs, free for page world."}}},windows:{browsers:{firefox:{"ctrl+a":{action:"Select all",severity:"preventable"},"ctrl+b":{action:"Bookmarks sidebar",severity:"preventable"},"ctrl+c":{action:"Copy",severity:"preventable"},"ctrl+d":{action:"Bookmark this page",severity:"preventable"},"ctrl+e":{action:"Search from page",severity:"preventable"},"ctrl+f":{action:"Find in page",severity:"preventable"},"ctrl+g":{action:"Find next",severity:"preventable"},"ctrl+h":{action:"History sidebar",severity:"preventable"},"ctrl+j":{action:"Downloads",severity:"preventable"},"ctrl+k":{action:"Search from page",severity:"preventable"},"ctrl+l":{action:"Focus address bar",severity:"preventable"},"ctrl+n":{action:"New window",severity:"hard"},"ctrl+o":{action:"Open file",severity:"preventable"},"ctrl+p":{action:"Print",severity:"preventable"},"ctrl+r":{action:"Reload",severity:"preventable"},"ctrl+s":{action:"Save page",severity:"preventable"},"ctrl+t":{action:"New tab",severity:"hard"},"ctrl+u":{action:"View source",severity:"preventable"},"ctrl+v":{action:"Paste",severity:"preventable"},"ctrl+w":{action:"Close tab",severity:"hard"},"ctrl+x":{action:"Cut",severity:"preventable"},"ctrl+y":{action:"Redo",severity:"preventable"},"ctrl+z":{action:"Undo",severity:"preventable"},"ctrl+shift+a":{action:"Add-ons manager",severity:"hard"},"ctrl+shift+b":{action:"Bookmarks toolbar",severity:"hard"},"ctrl+shift+c":{action:"Inspector (element picker)",severity:"hard"},"ctrl+shift+d":{action:"Bookmark all tabs",severity:"hard"},"ctrl+shift+e":{action:"Network Monitor",severity:"hard"},"ctrl+shift+g":{action:"Find previous",severity:"find-bar-only"},"ctrl+shift+i":{action:"Developer Tools",severity:"hard"},"ctrl+shift+j":{action:"Browser Console",severity:"hard"},"ctrl+shift+k":{action:"Web Console",severity:"hard"},"ctrl+shift+m":{action:"Responsive Design Mode",severity:"hard"},"ctrl+shift+n":{action:"New private window",severity:"hard"},"ctrl+shift+o":{action:"Bookmarks library",severity:"hard"},"ctrl+shift+p":{action:"New private window (alt)",severity:"hard"},"ctrl+shift+s":{action:"Firefox Screenshot",severity:"hard"},"ctrl+shift+t":{action:"Reopen closed tab",severity:"hard"},"ctrl+shift+v":{action:"Paste as plain text",severity:"hard"},"ctrl+shift+w":{action:"Close window",severity:"hard"},"ctrl+shift+y":{action:"Downloads (alt)",severity:"hard"},"ctrl+shift+z":{action:"Debugger",severity:"hard"},"alt+f":{action:"File menu",severity:"menu-activation"},"alt+e":{action:"Edit menu",severity:"menu-activation"},"alt+v":{action:"View menu",severity:"menu-activation"},"alt+b":{action:"Bookmarks menu",severity:"menu-activation"},"alt+t":{action:"Tools menu",severity:"menu-activation"},"alt+h":{action:"Help menu",severity:"menu-activation"},"alt+d":{action:"Focus address bar",severity:"hard"}},chrome:{"ctrl+a":{action:"Select all",severity:"preventable"},"ctrl+c":{action:"Copy",severity:"preventable"},"ctrl+d":{action:"Bookmark this page",severity:"preventable"},"ctrl+e":{action:"Search from page",severity:"preventable"},"ctrl+f":{action:"Find in page",severity:"preventable"},"ctrl+g":{action:"Find next",severity:"preventable"},"ctrl+h":{action:"History page",severity:"preventable"},"ctrl+j":{action:"Downloads",severity:"preventable"},"ctrl+k":{action:"Search from page",severity:"preventable"},"ctrl+l":{action:"Focus address bar",severity:"preventable"},"ctrl+n":{action:"New window",severity:"hard"},"ctrl+o":{action:"Open file",severity:"preventable"},"ctrl+p":{action:"Print",severity:"preventable"},"ctrl+r":{action:"Reload",severity:"preventable"},"ctrl+s":{action:"Save page",severity:"preventable"},"ctrl+t":{action:"New tab",severity:"hard"},"ctrl+u":{action:"View source",severity:"preventable"},"ctrl+v":{action:"Paste",severity:"preventable"},"ctrl+w":{action:"Close tab",severity:"hard"},"ctrl+x":{action:"Cut",severity:"preventable"},"ctrl+z":{action:"Undo",severity:"preventable"},"ctrl+shift+b":{action:"Bookmarks bar toggle",severity:"hard"},"ctrl+shift+d":{action:"Bookmark all tabs",severity:"hard"},"ctrl+shift+g":{action:"Find previous",severity:"find-bar-only"},"ctrl+shift+i":{action:"DevTools",severity:"hard"},"ctrl+shift+j":{action:"DevTools (console)",severity:"hard"},"ctrl+shift+m":{action:"Switch user / guest",severity:"hard"},"ctrl+shift+n":{action:"Incognito window",severity:"hard"},"ctrl+shift+r":{action:"Hard reload",severity:"hard"},"ctrl+shift+t":{action:"Reopen closed tab",severity:"hard"},"ctrl+shift+v":{action:"Paste as plain text",severity:"hard"},"ctrl+shift+w":{action:"Close window",severity:"hard"},"alt+d":{action:"Focus address bar",severity:"hard"},"alt+e":{action:"Customize menu",severity:"menu-activation"},"alt+f":{action:"Customize menu (alt)",severity:"menu-activation"}},edge:{"ctrl+a":{action:"Select all",severity:"preventable"},"ctrl+c":{action:"Copy",severity:"preventable"},"ctrl+d":{action:"Favorite this page",severity:"preventable"},"ctrl+e":{action:"Search from page",severity:"preventable"},"ctrl+f":{action:"Find in page",severity:"preventable"},"ctrl+g":{action:"Find next",severity:"preventable"},"ctrl+h":{action:"History",severity:"preventable"},"ctrl+j":{action:"Downloads",severity:"preventable"},"ctrl+k":{action:"Search from page",severity:"preventable"},"ctrl+l":{action:"Focus address bar",severity:"preventable"},"ctrl+m":{action:"Mute current tab",severity:"preventable"},"ctrl+n":{action:"New window",severity:"hard"},"ctrl+o":{action:"Open file",severity:"preventable"},"ctrl+p":{action:"Print",severity:"preventable"},"ctrl+r":{action:"Reload",severity:"preventable"},"ctrl+s":{action:"Save page",severity:"preventable"},"ctrl+t":{action:"New tab",severity:"hard"},"ctrl+u":{action:"View source",severity:"preventable"},"ctrl+v":{action:"Paste",severity:"preventable"},"ctrl+w":{action:"Close tab",severity:"hard"},"ctrl+x":{action:"Cut",severity:"preventable"},"ctrl+z":{action:"Undo",severity:"preventable"},"ctrl+shift+b":{action:"Favorites bar toggle",severity:"hard"},"ctrl+shift+d":{action:"Bookmark all tabs in folder",severity:"hard"},"ctrl+shift+e":{action:"Search in sidebar",severity:"hard"},"ctrl+shift+g":{action:"Find previous",severity:"find-bar-only"},"ctrl+shift+i":{action:"DevTools",severity:"hard"},"ctrl+shift+j":{action:"DevTools (console)",severity:"hard"},"ctrl+shift+k":{action:"Duplicate tab",severity:"hard"},"ctrl+shift+l":{action:"Paste and search",severity:"hard"},"ctrl+shift+m":{action:"Switch user / guest",severity:"hard"},"ctrl+shift+n":{action:"InPrivate window",severity:"hard"},"ctrl+shift+o":{action:"Open favorites",severity:"hard"},"ctrl+shift+p":{action:"Print (system dialog)",severity:"hard"},"ctrl+shift+r":{action:"Hard reload",severity:"hard"},"ctrl+shift+t":{action:"Reopen closed tab",severity:"hard"},"ctrl+shift+u":{action:"Read Aloud toggle",severity:"hard"},"ctrl+shift+v":{action:"Paste without formatting",severity:"hard"},"ctrl+shift+w":{action:"Close window",severity:"hard"},"ctrl+shift+y":{action:"Collections",severity:"hard"},"alt+d":{action:"Focus address bar",severity:"hard"},"alt+e":{action:"Settings menu",severity:"menu-activation"},"alt+f":{action:"Settings menu (alt)",severity:"menu-activation"},"alt+shift+b":{action:"Focus favorites bar",severity:"hard"},"alt+shift+i":{action:"Send feedback dialog",severity:"hard"},"alt+shift+t":{action:"Focus app bar toolbar",severity:"hard"}}},system:{"meta+a":{action:"Action Center",severity:"os"},"meta+c":{action:"Windows search",severity:"os"},"meta+d":{action:"Show desktop",severity:"os"},"meta+e":{action:"File Explorer",severity:"os"},"meta+g":{action:"Game bar",severity:"os"},"meta+h":{action:"Voice dictation",severity:"os"},"meta+i":{action:"Settings",severity:"os"},"meta+l":{action:"Lock",severity:"os"},"meta+n":{action:"Notification center",severity:"os"},"meta+p":{action:"Project / display mode",severity:"os"},"meta+r":{action:"Run dialog",severity:"os"},"meta+s":{action:"Search",severity:"os"},"meta+v":{action:"Clipboard history",severity:"os"},"meta+w":{action:"Widgets",severity:"os"},"meta+x":{action:"Quick Link menu",severity:"os"},"meta+z":{action:"Snap layouts",severity:"os"},"meta+tab":{action:"Task View",severity:"os"},"meta+shift+s":{action:"Screenshot region",severity:"os"},"ctrl+shift+esc":{action:"Task Manager",severity:"os"},"ctrl+alt+del":{action:"Security screen",severity:"os"},"alt+tab":{action:"Switch windows",severity:"os"},"alt+f4":{action:"Close active window",severity:"os"}}},linux:{browsers:{firefox:"$ref:platforms.windows.browsers.firefox",chrome:"$ref:platforms.windows.browsers.chrome",edge:"$ref:platforms.windows.browsers.edge"},system:{$comment:"GNOME defaults. KDE and other DEs have similar-shaped reservations but vary; this is a conservative baseline.","meta+tab":{action:"Switch windows",severity:"os"},"meta+a":{action:"Show applications",severity:"os"},"meta+l":{action:"Lock screen",severity:"os"},"meta+v":{action:"Notification list",severity:"os"},"alt+tab":{action:"Switch applications",severity:"os"},"alt+esc":{action:"Cycle windows",severity:"os"},"alt+f2":{action:"Run command",severity:"os"},"alt+f4":{action:"Close window",severity:"os"},"ctrl+alt+tab":{action:"Top-bar accessibility switcher",severity:"os"},"ctrl+alt+del":{action:"Power-off dialog",severity:"os"},"ctrl+shift+alt+r":{action:"Toggle screencast recording",severity:"os"}},noteForCtrlAlt:"Some Linux setups map right-Alt (AltGr) to 'compose' for typing accented characters, in which case AltGr+letter is reported as ctrl+alt+letter and types a special character. Avoid the ctrl+alt+letter namespace on Linux."}}};var Xe="1.0",Ye=new Set(["hard","os","menu-activation"]);function Je(e){return Z(j(e).combo)||""}function et(e,t){if(typeof e!="string"||!e.startsWith("$ref:"))return e;let r=e.slice(5).split("."),i=t;for(let s of r)i=i?.[s];return i}function ge(e){if(!e||typeof e!="object")return null;let t=Object.create(null);for(let[r,i]of Object.entries(e))!i||typeof i!="object"||!("severity"in i)||(t[Je(r)]=i);return t}function tt(e){let t={platforms:Object.create(null)},r=e?.platforms||{};for(let[i,s]of Object.entries(r)){let f=Object.create(null);for(let[p,a]of Object.entries(s.browsers||{}))f[p]=ge(et(a,e));t.platforms[i]={browsers:f,system:ge(s.system)}}return t}var ke=$?.version?.schema===Xe,rt=ke?tt($):{platforms:Object.create(null)},it=Z;function ot(e,{platform:t,browser:r}={}){if(!ke)return null;let i=it(e);if(!i)return null;let s=t&&v(rt.platforms,t);if(!s)return null;let f=r?v(s.browsers,r):null,p=v(f,i);if(p)return{source:"browser",platform:t,browser:r,lookupKey:i,action:p.action,severity:p.severity};let a=v(s.system,i);return a?{source:"system",platform:t,browser:r,lookupKey:i,action:a.action,severity:a.severity}:null}function xe(e){return Ye.has(e)}function at(e,t,r){let i=ae(e.platform),s=e.source==="browser"?`${e.browser} on ${i}`:i,f=xe(e.severity)?"will not fire":e.severity==="preventable"?r?.preventDefault?"fires first; preventDefault keeps the browser out":"fires, and the browser acts too; bind with preventDefault: true":"fires in normal browsing";return`[hotkey-router] "${t}" (${e.lookupKey}) reserved by ${s}: "${e.action}" [${e.severity}] \u2014 ${f}.`}function nt(e,t,r=console,i){let s=at(e,t,i);(xe(e.severity)||e.severity==="preventable"&&!i?.preventDefault?r.warn:r.info).call(r,s)}function Se(e,t={}){if(!e||typeof e.onBind!="function")throw new TypeError("installReservationWarnings(hotkeys) requires a hotkey-router instance with onBind() (>= v0.2.0)");let r=t.platform!==void 0?t.platform:A(),i=t.browser!==void 0?t.browser:oe(),s=t.console||console;return e.onBind(({combo:f,raw:p,options:a})=>{if(a?.warnOnReserved===!1||!r||!i)return;let b=ot(f,{platform:r,browser:i});b&&nt(b,p,s,a)})}var Ct=$?.version?.schema,Et=$?.version?.generated;Se(X);var Dt=X;export{Dt as default};
|
|
3
|
+
function w(t,e){return t!=null&&Object.prototype.hasOwnProperty.call(t,e)?t[e]:void 0}function J(t){return t?/Chrome ?OS|CrOS/i.test(t)?"chromeos":/Mac|iPhone|iPad|iPod/i.test(t)?"mac":/Win/i.test(t)?"windows":/Linux|X11/i.test(t)?"linux":null:null}function E(t=typeof navigator<"u"?navigator:null,{chromeos:e=!1}={}){if(!t)return null;let r=t.userAgent||"",i=(/\bCrOS\b/.test(r)?"chromeos":null)||J(t.userAgentData?.platform)||J(t.platform)||(/Mac OS X/i.test(r)?"mac":/Windows/i.test(r)?"windows":/Linux|X11/i.test(r)?"linux":null);return i==="chromeos"&&!e?"linux":i}function tt(t=typeof navigator<"u"?navigator:null){if(!t)return null;let e=t.userAgent||"";return/Edg\//.test(e)?"edge":/Firefox/.test(e)?"firefox":/Chrome/.test(e)?"chrome":/Safari/.test(e)?"safari":null}var Ct={mac:"macOS",windows:"Windows",linux:"Linux",chromeos:"ChromeOS"};function et(t){return w(Ct,t)||t}var Pt=E(),rt=new Set(["ctrl","shift","alt","meta","mod"]),Et=new Map([["^","ctrl"],["!","alt"],["+","shift"],["#","meta"]]),it=Object.freeze({esc:"escape",escape:"escape",space:" ",spacebar:" ",enter:"enter",return:"enter",del:"delete",delete:"delete",backspace:"backspace",tab:"tab",up:"arrowup",down:"arrowdown",left:"arrowleft",right:"arrowright",home:"home",end:"end",pageup:"pageup",pagedown:"pagedown",pgup:"pageup",pgdn:"pagedown",cmd:"meta",command:"meta",win:"meta",meta:"meta",control:"ctrl",ctrl:"ctrl",option:"alt",opt:"alt",alt:"alt",shift:"shift","\u2318":"meta","\u2303":"ctrl","\u2325":"alt","\u21E7":"shift",mod:"mod",plus:"+"});function K(t){let e=String(t??"");if(e===" ")return" ";let i=e.trim().toLowerCase();return w(it,i)??i}function Ft(t){return rt.has(K(t))}var Tt=/(^|\+)\s*code:([A-Za-z][A-Za-z0-9_]*)/;function _(t,{platform:e=Pt}={}){let r=String(t||"").trim(),i=null,s=y=>{i=i||`Invalid hotkey "${t}": ${y}`},l=/\s+up$/i.test(r),v=l?r.replace(/\s+up$/i,"").trim():r,o={ctrl:!1,shift:!1,alt:!1,meta:!1,key:null,code:null,bareModifier:null},b=y=>{y==="mod"?o[e==="mac"?"meta":"ctrl"]=!0:o[y]=!0},m=v;for(;m.length>1;){let y=Et.get(m[0])??null;if(!y)break;b(y),m=m.slice(1).trimStart()}let g=m.match(/code:[A-Za-z][A-Za-z0-9_]*/g);g&&g.length>1&&s(`multiple code: tokens not supported (got ${g.length}).`);let P=null,F=m.replace(Tt,(y,S,U)=>(P=U,S+"__code__")).toLowerCase(),B=F.split("+").map(y=>y.trim()),z=B.filter(Boolean),j=B.some(y=>y==="")&&F.includes("++");if(!j){let y=!1;for(let S of z)Ft(S)?y&&s('modifiers must come before the base key (e.g. "ctrl+k", not "k+ctrl")'):y=!0}let N=0;for(let y of z){if(y==="__code__"){o.code=P,N++;continue}let S=w(it,y)??y;rt.has(S)?b(S):(o.key=K(S),N++)}if(N>1&&s('use one base key (e.g. "ctrl+k"), or one code: token'),!o.key&&!o.code&&(j||m==="+")&&(o.key="+"),!o.key&&!o.code){let y=(o.ctrl?1:0)+(o.shift?1:0)+(o.alt?1:0)+(o.meta?1:0);y===1?o.bareModifier=o.ctrl?"ctrl":o.shift?"shift":o.alt?"alt":"meta":y>1?s('multi-modifier bare bindings not supported. Add a base key (e.g. "ctrl+alt+x").'):i=i||`Invalid hotkey "${t}" (missing base key)`}return{combo:o,type:l?"keyup":"keydown",raw:t,error:i}}function L(t,e){let{combo:r,type:i,raw:s,error:l}=_(t,e);if(l)throw new Error(l);return{combo:r,type:i,raw:s}}var q={".":"period",",":"comma",";":"semicolon","'":"quote","/":"slash","\\":"backslash","[":"bracketleft","]":"bracketright","-":"minus","=":"equal","`":"backquote"," ":"space","+":"equal"};function Rt(t){if(!t)return null;let e=/^Key([A-Za-z])$/.exec(t);if(e)return e[1].toLowerCase();let r=/^(?:Digit|Numpad)(\d)$/.exec(t);return r?r[1]:t.toLowerCase()}function Kt(t){if(t==null||t==="")return null;if(w(q,t))return w(q,t);let e=K(t);return w(q,e)||e||null}function $(t){if(!t||t.bareModifier)return null;let e=t.code?Rt(t.code):Kt(t.key);if(!e)return null;let r=[];return t.ctrl&&r.push("ctrl"),t.meta&&r.push("meta"),t.alt&&r.push("alt"),t.shift&&r.push("shift"),r.push(e),r.join("+")}function A(t,e,r,i){return t.addEventListener(e,r,i),()=>t.removeEventListener(e,r,i)}var le=E(),nt=Object.freeze({Alt:"alt",AltGraph:"alt",Control:"ctrl",Shift:"shift",Meta:"meta",OS:"meta"});function I({ctrl:t,shift:e,alt:r,meta:i,key:s,code:l,bareModifier:v}){if(v)return`__bare__:${v}`;let o="";return t&&(o+="ctrl+"),e&&(o+="shift+"),r&&(o+="alt+"),i&&(o+="meta+"),l?o+"code:"+l:o?o+s:s}function At(t){let e=w(nt,t.key);return e?`__bare__:${e}`:I({ctrl:t.ctrlKey,shift:t.shiftKey,alt:t.altKey,meta:t.metaKey,key:K(t.key)})}function Dt(t){if(!t.code)return null;let e="";return t.ctrlKey&&(e+="ctrl+"),t.shiftKey&&(e+="shift+"),t.altKey&&(e+="alt+"),t.metaKey&&(e+="meta+"),e+"code:"+t.code}var Bt=new Set(["checkbox","radio","range","color","file","button","submit","reset","image"]);function Nt(t){let e=t?.composedPath?.();if(e?.length)return e;let r=[];for(let i=t?.target;i;i=i.parentNode||i.host)r.push(i);return r}function Ot(t,e){let r=Nt(t),i=r[0];if(!i)return null;let s=String(i.tagName||"").toUpperCase();if(i.isContentEditable||s==="TEXTAREA"||s==="SELECT"||i.getAttribute?.("role")==="textbox")return"text";if(s==="INPUT"){if(e==="all")return"text";let l=String(i.getAttribute?.("type")||"text").toLowerCase();return Bt.has(l)?"control":"text"}if(e==="text"){for(let l of r)if(String(l.tagName||"").toUpperCase()==="BUTTON"||l.getAttribute?.("role")==="button")return"control"}return null}function Mt(t){return!!((t.ctrlKey||t.altKey||t.metaKey)&&!w(nt,t.key))}function at(t,e){if(typeof e!="function")throw new TypeError(`hotkeys.bind("${t}") expects a function handler, got ${e===null?"null":typeof e}`)}function ot(t){if(t==="all"||t==="text")return t;if(typeof t=="string")throw new TypeError(`hotkeys.ignoreInput() expects true, false, 'all' or 'text', got "${t}"`);return t?"all":null}function _t(t,e){let r=e?{...e}:{};return t==="keydown"&&r.repeat==null&&(r.repeat=!1),r.priority==null&&(r.priority=0),r}function Lt(t){let e=null;for(let r of t)e?(r.options.priority>e.options.priority||r.options.priority===e.options.priority&&r.id>e.id)&&(e=r):e=r;return e}function $t(t){return!!(t.ctrlKey&&t.altKey&&typeof t.getModifierState=="function"&&t.getModifierState("AltGraph")&&typeof t.key=="string"&&t.key.length===1)}function st(t){return!!(t.isComposing||t.keyCode===229)}var It=/^(?!\p{Script=Latin})\p{L}$/u;function Ht(t){if(!(t.ctrlKey||t.metaKey)||t.altKey||st(t)||typeof t.getModifierState=="function"&&t.getModifierState("AltGraph"))return null;let e=/^Key([A-Z])$/.exec(t.code||"");return!e||typeof t.key!="string"||!It.test(t.key)?null:I({ctrl:t.ctrlKey,shift:t.shiftKey,alt:!1,meta:t.metaKey,key:e[1].toLowerCase()})}function zt(t){return!t.shiftKey||typeof t.key!="string"||t.key.length!==1||/\s/.test(t.key)||t.key.toLowerCase()!==t.key.toUpperCase()?null:I({ctrl:t.ctrlKey,shift:!1,alt:t.altKey,meta:t.metaKey,key:K(t.key)})}function ct({target:t=typeof window<"u"?window:null,capture:e=!1,ignoreInput:r=!0}={}){let i=ot(r),s=t,l=e,v=[],o=new Map,b=new Map,m=new Map,g=!1,P=1;function D(a,n){let c=o.get(a);c||(c=new Map,o.set(a,c));let d=c.get(n);return d||(d=[],c.set(n,d)),d}function F(a){let n=m.get(a);if(!n)return!1;let{comboStr:c,type:d}=n,h=o.get(c),f=h?.get(d);if(!f?.length)return m.delete(a),!1;let u=f.filter(p=>p.id!==a);return u.length?h.set(d,u):h.delete(d),h.size||o.delete(c),m.delete(a),!0}function B(a,n,c=null,d={}){let{combo:h,type:f,raw:u}=L(a);at(a,n);let p=I(h),x=_t(f,d),C={id:P++,comboStr:p,type:f,combo:h,handler:n,plugin:c,raw:u,options:x};if(D(p,f).push(C),m.set(C.id,{comboStr:p,type:f}),v.length)for(let k of v)try{k({combo:h,type:f,raw:u,options:x,plugin:c,id:C.id})}catch(xt){console.error("[hotkey-router] onBind hook threw:",xt)}let R=()=>F(C.id);return R.id=C.id,R.hotkey=u,R}function z(a){if(typeof a!="function")throw new TypeError("hotkeys.onBind(hook) expects a function");return v.push(a),()=>{v=v.filter(n=>n!==a)}}function j(a,n){let{combo:c,type:d}=L(a),h=I(c),f=o.get(h);if(!f)return;let u=f.get(d);if(u?.length){if(n){let p=[];for(let x of u)x.handler===n?m.delete(x.id):p.push(x);p.length?f.set(d,p):f.delete(d)}else{for(let p of u)m.delete(p.id);f.delete(d)}f.size||o.delete(h)}}function N(a,n){if(b.has(a))throw new Error(`Plugin "${a}" already registered`);let c=Object.entries(n).map(([h,f])=>{let[u,p]=Array.isArray(f)?f:[f,{}];return L(h),at(h,u),[h,u,p]}),d=[];for(let[h,f,u]of c){let p=B(h,f,a,u);d.push(p.id)}return b.set(a,d),()=>{b.get(a)===d&&y(a)}}function y(a){let n=b.get(a);if(n){for(let c of n)F(c);b.delete(a)}}function S(){g=!0}function U(){g=!1}function mt(a=!0){i=ot(a)}function wt(a){s=a}function bt(a,n,c){let d={altGraphChar:$t(a),composing:st(a),focus:i&&Ot(a,i),chord:Mt(a)},h=[],f=new Set;for(let u of[At(a),Dt(a)])!u||f.has(u)||(f.add(u),X(h,u,a,n,c,d));for(let u of[Ht,zt]){if(h.length)break;let p=u(a);p&&!f.has(p)&&(f.add(p),X(h,p,a,n,c,d))}return h}function X(a,n,c,d,h,{altGraphChar:f,composing:u,focus:p,chord:x}){let C=o.get(n)?.get(d);if(C?.length)for(let R of C){let k=R.options;h==="capture"&&!k.capture||h==="bubble"&&k.capture||f&&!k.altGraph||u&&!k.composing||p&&!(p==="control"&&x)&&!k.allowIn?.(c)||d==="keydown"&&k.repeat===!1&&c.repeat||k.when&&k.when(c)===!1||a.push(R)}}function gt(a,n){let c=a.options;c.preventDefault&&n.preventDefault(),c.stopImmediatePropagation?n.stopImmediatePropagation():c.stopPropagation&&n.stopPropagation(),c.once&&F(a.id),a.handler(n)}function Q(a,n,c){if(g)return!1;let d=bt(a,n,c);return d.length?(gt(Lt(d),a),!0):!1}function T(a,n="all"){return c=>{Q(c,a,n)}}function kt(a,n){return Q(a,n,"all")}let O=null,M=null,V=null,W=null;function St({target:a=s,capture:n=l}={}){if(!a)throw new Error("hotkeys.init() requires a target (e.g. window)");if((O||M)&&Y(),n){O=A(a,"keydown",T("keydown"),{capture:!0}),M=A(a,"keyup",T("keyup"),{capture:!0});return}O=A(a,"keydown",T("keydown","bubble"),{capture:!1}),M=A(a,"keyup",T("keyup","bubble"),{capture:!1}),V=A(a,"keydown",T("keydown","capture"),{capture:!0}),W=A(a,"keyup",T("keyup","capture"),{capture:!0})}function Y(){O?.(),M?.(),V?.(),W?.(),O=null,M=null,V=null,W=null,o.clear(),b.clear(),m.clear()}return{init:St,destroy:Y,setTarget:wt,bind:B,unbind:j,registerPlugin:N,unregisterPlugin:y,onBind:z,pause:S,resume:U,ignoreInput:mt,dispatch:kt}}var lt=ct();typeof window<"u"&<.init();var G=lt;var H={version:{generated:"2026-10-29",schema:"1.0"},platforms:{mac:{browsers:{firefox:{"meta+a":{action:"Select all",severity:"hard"},"meta+b":{action:"Bookmarks sidebar",severity:"hard"},"meta+c":{action:"Copy",severity:"hard"},"meta+d":{action:"Bookmark this page",severity:"hard"},"meta+e":{action:"Search from page",severity:"hard"},"meta+f":{action:"Find in page",severity:"hard"},"meta+g":{action:"Find next",severity:"hard"},"meta+j":{action:"Downloads",severity:"hard"},"meta+l":{action:"Focus address bar",severity:"hard"},"meta+n":{action:"New window",severity:"hard"},"meta+o":{action:"Open file",severity:"hard"},"meta+p":{action:"Print",severity:"hard"},"meta+r":{action:"Reload",severity:"hard"},"meta+s":{action:"Save page",severity:"hard"},"meta+t":{action:"New tab",severity:"hard"},"meta+u":{action:"View source",severity:"hard"},"meta+v":{action:"Paste",severity:"hard"},"meta+w":{action:"Close tab",severity:"hard"},"meta+x":{action:"Cut",severity:"hard"},"meta+y":{action:"Redo",severity:"hard"},"meta+z":{action:"Undo",severity:"hard"},"meta+shift+a":{action:"Add-ons manager",severity:"hard"},"meta+shift+b":{action:"Bookmarks toolbar",severity:"hard"},"meta+shift+c":{action:"Inspector (element picker)",severity:"hard"},"meta+shift+d":{action:"Bookmark all tabs",severity:"hard"},"meta+shift+e":{action:"Network Monitor",severity:"hard"},"meta+shift+f":{action:"Toggle fullscreen",severity:"hard"},"meta+shift+g":{action:"Find previous",severity:"find-bar-only"},"meta+shift+j":{action:"Browser Console",severity:"hard"},"meta+shift+n":{action:"New private window",severity:"hard"},"meta+shift+o":{action:"Bookmarks library",severity:"hard"},"meta+shift+p":{action:"New private window (alt)",severity:"hard"},"meta+shift+q":{action:"Quit (with confirm)",severity:"hard"},"meta+shift+s":{action:"Firefox Screenshot",severity:"hard"},"meta+shift+t":{action:"Reopen closed tab",severity:"hard"},"meta+shift+v":{action:"Paste as plain text",severity:"hard"},"meta+shift+w":{action:"Close window",severity:"hard"},"meta+shift+z":{action:"Redo",severity:"hard"},"meta+alt+c":{action:"Inspector",severity:"hard"},"meta+alt+e":{action:"Network Monitor",severity:"hard"},"meta+alt+i":{action:"DevTools Toolbox",severity:"hard"},"meta+alt+j":{action:"Browser Console",severity:"hard"},"meta+alt+k":{action:"Web Console",severity:"hard"},"meta+alt+m":{action:"Responsive Design Mode",severity:"hard"},"meta+alt+z":{action:"Debugger",severity:"hard"}},chrome:{"meta+a":{action:"Select all",severity:"hard"},"meta+c":{action:"Copy",severity:"hard"},"meta+d":{action:"Bookmark this page",severity:"hard"},"meta+e":{action:"Search selected text",severity:"find-bar-only"},"meta+f":{action:"Find in page",severity:"hard"},"meta+g":{action:"Find next",severity:"hard"},"meta+l":{action:"Focus address bar",severity:"hard"},"meta+n":{action:"New window",severity:"hard"},"meta+o":{action:"Open file",severity:"hard"},"meta+p":{action:"Print",severity:"hard"},"meta+r":{action:"Reload",severity:"hard"},"meta+s":{action:"Save page",severity:"hard"},"meta+t":{action:"New tab",severity:"hard"},"meta+v":{action:"Paste",severity:"hard"},"meta+w":{action:"Close tab",severity:"hard"},"meta+x":{action:"Cut",severity:"hard"},"meta+y":{action:"History page",severity:"hard"},"meta+z":{action:"Undo",severity:"hard"},"meta+shift+b":{action:"Bookmarks bar toggle",severity:"hard"},"meta+shift+c":{action:"DevTools Inspector",severity:"hard"},"meta+shift+d":{action:"Bookmark all tabs",severity:"hard"},"meta+shift+g":{action:"Find previous",severity:"find-bar-only"},"meta+shift+j":{action:"Downloads page",severity:"hard"},"meta+shift+m":{action:"Switch user / guest",severity:"hard"},"meta+shift+n":{action:"New incognito window",severity:"hard"},"meta+shift+r":{action:"Hard reload",severity:"hard"},"meta+shift+t":{action:"Reopen closed tab",severity:"hard"},"meta+shift+v":{action:"Paste as plain text",severity:"hard"},"meta+shift+w":{action:"Close window",severity:"hard"},"meta+shift+z":{action:"Redo",severity:"hard"},"meta+alt+i":{action:"DevTools",severity:"hard"},"meta+alt+j":{action:"DevTools (console)",severity:"hard"},"meta+alt+u":{action:"View source",severity:"hard"}},safari:{"meta+a":{action:"Select all",severity:"hard"},"meta+c":{action:"Copy",severity:"hard"},"meta+d":{action:"Add to Reading List",severity:"hard"},"meta+f":{action:"Find in page",severity:"hard"},"meta+g":{action:"Find next",severity:"hard"},"meta+j":{action:"Downloads",severity:"hard"},"meta+l":{action:"Focus Smart Search",severity:"hard"},"meta+n":{action:"New window",severity:"hard"},"meta+p":{action:"Print",severity:"hard"},"meta+r":{action:"Reload",severity:"hard"},"meta+s":{action:"Save page",severity:"hard"},"meta+t":{action:"New tab",severity:"hard"},"meta+v":{action:"Paste",severity:"hard"},"meta+w":{action:"Close tab",severity:"hard"},"meta+x":{action:"Cut",severity:"hard"},"meta+z":{action:"Undo",severity:"hard"},"meta+shift+c":{action:"Inspector pick element",severity:"hard"},"meta+shift+d":{action:"Add Reading List item",severity:"hard"},"meta+shift+g":{action:"Find previous",severity:"find-bar-only"},"meta+shift+h":{action:"Go to homepage",severity:"hard"},"meta+shift+n":{action:"New private window",severity:"hard"},"meta+shift+r":{action:"Reader mode",severity:"hard"},"meta+shift+t":{action:"Reopen last closed tab",severity:"hard"},"meta+shift+v":{action:"Paste as plain text",severity:"hard"},"meta+shift+w":{action:"Close window",severity:"hard"},"meta+shift+z":{action:"Redo",severity:"hard"},"meta+alt+c":{action:"Web Inspector pick",severity:"hard"},"meta+alt+i":{action:"Web Inspector",severity:"hard"}},edge:{"meta+a":{action:"Select all",severity:"hard"},"meta+c":{action:"Copy",severity:"hard"},"meta+d":{action:"Save as favorite",severity:"hard"},"meta+f":{action:"Find in page",severity:"hard"},"meta+g":{action:"Find next",severity:"hard"},"meta+l":{action:"Focus address bar",severity:"hard"},"meta+n":{action:"New window",severity:"hard"},"meta+o":{action:"Open file",severity:"hard"},"meta+p":{action:"Print",severity:"hard"},"meta+r":{action:"Reload",severity:"hard"},"meta+s":{action:"Save page",severity:"hard"},"meta+t":{action:"New tab",severity:"hard"},"meta+v":{action:"Paste",severity:"hard"},"meta+w":{action:"Close tab",severity:"hard"},"meta+x":{action:"Cut",severity:"hard"},"meta+y":{action:"History",severity:"hard"},"meta+z":{action:"Undo",severity:"hard"},"ctrl+m":{action:"Mute current tab",severity:"hard"},"ctrl+meta+f":{action:"Toggle full screen",severity:"hard"},"meta+shift+b":{action:"Favorites bar toggle",severity:"hard"},"meta+shift+c":{action:"Developer tools",severity:"hard"},"meta+shift+d":{action:"Favorite all tabs",severity:"hard"},"meta+shift+e":{action:"Search in sidebar",severity:"hard"},"meta+shift+g":{action:"Find previous",severity:"find-bar-only"},"meta+shift+h":{action:"Home page",severity:"hard"},"meta+shift+m":{action:"Switch user / guest",severity:"hard"},"meta+shift+n":{action:"New InPrivate window",severity:"hard"},"meta+shift+r":{action:"Hard reload",severity:"hard"},"meta+shift+t":{action:"Reopen closed tab",severity:"hard"},"meta+shift+u":{action:"Read Aloud toggle",severity:"hard"},"meta+shift+v":{action:"Paste as plain text",severity:"hard"},"meta+shift+w":{action:"Close window",severity:"hard"},"meta+shift+z":{action:"Redo",severity:"hard"},"meta+alt+f":{action:"Search the web",severity:"hard"},"meta+alt+j":{action:"JavaScript console",severity:"hard"},"meta+alt+l":{action:"Downloads",severity:"hard"},"meta+alt+m":{action:"Minimize all windows",severity:"hard"}}},system:{"meta+space":{action:"Spotlight",severity:"os"},"meta+tab":{action:"App switcher",severity:"os"},"meta+h":{action:"Hide app",severity:"os"},"meta+m":{action:"Minimize window",severity:"os"},"meta+q":{action:"Quit app",severity:"os"},"meta+shift+3":{action:"Screenshot full screen",severity:"os"},"meta+shift+4":{action:"Screenshot selection",severity:"os"},"meta+shift+5":{action:"Screen recording tool",severity:"os"},"meta+shift+q":{action:"Log out",severity:"os"},"meta+ctrl+q":{action:"Lock screen",severity:"os"},"meta+ctrl+space":{action:"Character Viewer",severity:"os"},"meta+alt+esc":{action:"Force-quit dialog",severity:"os"},"meta+shift+slash":{action:"Help menu search (Cmd+?)",severity:"os"},"meta+alt+h":{action:"Hide other apps",severity:"os"},"meta+alt+d":{action:"Show or hide the Dock",severity:"os"},"meta+backquote":{action:"Switch windows of the front app",severity:"os"}}},windows:{browsers:{firefox:{"ctrl+a":{action:"Select all",severity:"preventable"},"ctrl+b":{action:"Bookmarks sidebar",severity:"preventable"},"ctrl+c":{action:"Copy",severity:"preventable"},"ctrl+d":{action:"Bookmark this page",severity:"preventable"},"ctrl+e":{action:"Search from page",severity:"preventable"},"ctrl+f":{action:"Find in page",severity:"preventable"},"ctrl+g":{action:"Find next",severity:"preventable"},"ctrl+h":{action:"History sidebar",severity:"preventable"},"ctrl+j":{action:"Downloads",severity:"preventable"},"ctrl+k":{action:"Search from page",severity:"preventable"},"ctrl+l":{action:"Focus address bar",severity:"preventable"},"ctrl+n":{action:"New window",severity:"hard"},"ctrl+o":{action:"Open file",severity:"preventable"},"ctrl+p":{action:"Print",severity:"preventable"},"ctrl+r":{action:"Reload",severity:"preventable"},"ctrl+s":{action:"Save page",severity:"preventable"},"ctrl+t":{action:"New tab",severity:"hard"},"ctrl+u":{action:"View source",severity:"preventable"},"ctrl+v":{action:"Paste",severity:"preventable"},"ctrl+w":{action:"Close tab",severity:"hard"},"ctrl+x":{action:"Cut",severity:"preventable"},"ctrl+y":{action:"Redo",severity:"preventable"},"ctrl+z":{action:"Undo",severity:"preventable"},"ctrl+shift+a":{action:"Add-ons manager",severity:"hard"},"ctrl+shift+b":{action:"Bookmarks toolbar",severity:"hard"},"ctrl+shift+c":{action:"Inspector (element picker)",severity:"hard"},"ctrl+shift+d":{action:"Bookmark all tabs",severity:"hard"},"ctrl+shift+e":{action:"Network Monitor",severity:"hard"},"ctrl+shift+g":{action:"Find previous",severity:"find-bar-only"},"ctrl+shift+i":{action:"Developer Tools",severity:"hard"},"ctrl+shift+j":{action:"Browser Console",severity:"hard"},"ctrl+shift+k":{action:"Web Console",severity:"hard"},"ctrl+shift+m":{action:"Responsive Design Mode",severity:"hard"},"ctrl+shift+n":{action:"New private window",severity:"hard"},"ctrl+shift+o":{action:"Bookmarks library",severity:"hard"},"ctrl+shift+p":{action:"New private window (alt)",severity:"hard"},"ctrl+shift+s":{action:"Firefox Screenshot",severity:"hard"},"ctrl+shift+t":{action:"Reopen closed tab",severity:"hard"},"ctrl+shift+v":{action:"Paste as plain text",severity:"hard"},"ctrl+shift+w":{action:"Close window",severity:"hard"},"ctrl+shift+y":{action:"Downloads (alt)",severity:"hard"},"ctrl+shift+z":{action:"Debugger",severity:"hard"},"alt+f":{action:"File menu",severity:"menu-activation"},"alt+e":{action:"Edit menu",severity:"menu-activation"},"alt+v":{action:"View menu",severity:"menu-activation"},"alt+b":{action:"Bookmarks menu",severity:"menu-activation"},"alt+t":{action:"Tools menu",severity:"menu-activation"},"alt+h":{action:"Help menu",severity:"menu-activation"},"alt+d":{action:"Focus address bar",severity:"hard"}},chrome:{"ctrl+a":{action:"Select all",severity:"preventable"},"ctrl+c":{action:"Copy",severity:"preventable"},"ctrl+d":{action:"Bookmark this page",severity:"preventable"},"ctrl+e":{action:"Search from page",severity:"preventable"},"ctrl+f":{action:"Find in page",severity:"preventable"},"ctrl+g":{action:"Find next",severity:"preventable"},"ctrl+h":{action:"History page",severity:"preventable"},"ctrl+j":{action:"Downloads",severity:"preventable"},"ctrl+k":{action:"Search from page",severity:"preventable"},"ctrl+l":{action:"Focus address bar",severity:"preventable"},"ctrl+n":{action:"New window",severity:"hard"},"ctrl+o":{action:"Open file",severity:"preventable"},"ctrl+p":{action:"Print",severity:"preventable"},"ctrl+r":{action:"Reload",severity:"preventable"},"ctrl+s":{action:"Save page",severity:"preventable"},"ctrl+t":{action:"New tab",severity:"hard"},"ctrl+u":{action:"View source",severity:"preventable"},"ctrl+v":{action:"Paste",severity:"preventable"},"ctrl+w":{action:"Close tab",severity:"hard"},"ctrl+x":{action:"Cut",severity:"preventable"},"ctrl+z":{action:"Undo",severity:"preventable"},"ctrl+shift+b":{action:"Bookmarks bar toggle",severity:"hard"},"ctrl+shift+d":{action:"Bookmark all tabs",severity:"hard"},"ctrl+shift+g":{action:"Find previous",severity:"find-bar-only"},"ctrl+shift+i":{action:"DevTools",severity:"hard"},"ctrl+shift+j":{action:"DevTools (console)",severity:"hard"},"ctrl+shift+m":{action:"Switch user / guest",severity:"hard"},"ctrl+shift+n":{action:"Incognito window",severity:"hard"},"ctrl+shift+r":{action:"Hard reload",severity:"hard"},"ctrl+shift+t":{action:"Reopen closed tab",severity:"hard"},"ctrl+shift+v":{action:"Paste as plain text",severity:"hard"},"ctrl+shift+w":{action:"Close window",severity:"hard"},"alt+d":{action:"Focus address bar",severity:"hard"},"alt+e":{action:"Customize menu",severity:"menu-activation"},"alt+f":{action:"Customize menu (alt)",severity:"menu-activation"}},edge:{"ctrl+a":{action:"Select all",severity:"preventable"},"ctrl+c":{action:"Copy",severity:"preventable"},"ctrl+d":{action:"Favorite this page",severity:"preventable"},"ctrl+e":{action:"Search from page",severity:"preventable"},"ctrl+f":{action:"Find in page",severity:"preventable"},"ctrl+g":{action:"Find next",severity:"preventable"},"ctrl+h":{action:"History",severity:"preventable"},"ctrl+j":{action:"Downloads",severity:"preventable"},"ctrl+k":{action:"Search from page",severity:"preventable"},"ctrl+l":{action:"Focus address bar",severity:"preventable"},"ctrl+m":{action:"Mute current tab",severity:"preventable"},"ctrl+n":{action:"New window",severity:"hard"},"ctrl+o":{action:"Open file",severity:"preventable"},"ctrl+p":{action:"Print",severity:"preventable"},"ctrl+r":{action:"Reload",severity:"preventable"},"ctrl+s":{action:"Save page",severity:"preventable"},"ctrl+t":{action:"New tab",severity:"hard"},"ctrl+u":{action:"View source",severity:"preventable"},"ctrl+v":{action:"Paste",severity:"preventable"},"ctrl+w":{action:"Close tab",severity:"hard"},"ctrl+x":{action:"Cut",severity:"preventable"},"ctrl+z":{action:"Undo",severity:"preventable"},"ctrl+shift+b":{action:"Favorites bar toggle",severity:"hard"},"ctrl+shift+d":{action:"Bookmark all tabs in folder",severity:"hard"},"ctrl+shift+e":{action:"Search in sidebar",severity:"hard"},"ctrl+shift+g":{action:"Find previous",severity:"find-bar-only"},"ctrl+shift+i":{action:"DevTools",severity:"hard"},"ctrl+shift+j":{action:"DevTools (console)",severity:"hard"},"ctrl+shift+k":{action:"Duplicate tab",severity:"hard"},"ctrl+shift+l":{action:"Paste and search",severity:"hard"},"ctrl+shift+m":{action:"Switch user / guest",severity:"hard"},"ctrl+shift+n":{action:"InPrivate window",severity:"hard"},"ctrl+shift+o":{action:"Open favorites",severity:"hard"},"ctrl+shift+p":{action:"Print (system dialog)",severity:"hard"},"ctrl+shift+r":{action:"Hard reload",severity:"hard"},"ctrl+shift+t":{action:"Reopen closed tab",severity:"hard"},"ctrl+shift+u":{action:"Read Aloud toggle",severity:"hard"},"ctrl+shift+v":{action:"Paste without formatting",severity:"hard"},"ctrl+shift+w":{action:"Close window",severity:"hard"},"ctrl+shift+y":{action:"Collections",severity:"hard"},"alt+d":{action:"Focus address bar",severity:"hard"},"alt+e":{action:"Settings menu",severity:"menu-activation"},"alt+f":{action:"Settings menu (alt)",severity:"menu-activation"},"alt+shift+b":{action:"Focus favorites bar",severity:"hard"},"alt+shift+i":{action:"Send feedback dialog",severity:"hard"},"alt+shift+t":{action:"Focus app bar toolbar",severity:"hard"}}},system:{"meta+a":{action:"Action Center",severity:"os"},"meta+c":{action:"Windows search",severity:"os"},"meta+d":{action:"Show desktop",severity:"os"},"meta+e":{action:"File Explorer",severity:"os"},"meta+g":{action:"Game bar",severity:"os"},"meta+h":{action:"Voice dictation",severity:"os"},"meta+i":{action:"Settings",severity:"os"},"meta+l":{action:"Lock",severity:"os"},"meta+n":{action:"Notification center",severity:"os"},"meta+p":{action:"Project / display mode",severity:"os"},"meta+r":{action:"Run dialog",severity:"os"},"meta+s":{action:"Search",severity:"os"},"meta+v":{action:"Clipboard history",severity:"os"},"meta+w":{action:"Widgets",severity:"os"},"meta+x":{action:"Quick Link menu",severity:"os"},"meta+z":{action:"Snap layouts",severity:"os"},"meta+tab":{action:"Task View",severity:"os"},"meta+shift+s":{action:"Screenshot region",severity:"os"},"ctrl+shift+esc":{action:"Task Manager",severity:"os"},"ctrl+alt+del":{action:"Security screen",severity:"os"},"alt+tab":{action:"Switch windows",severity:"os"},"alt+f4":{action:"Close active window",severity:"os"}}},linux:{browsers:{firefox:"$ref:platforms.windows.browsers.firefox",chrome:"$ref:platforms.windows.browsers.chrome",edge:"$ref:platforms.windows.browsers.edge"},system:{"meta+tab":{action:"Switch windows",severity:"os"},"meta+a":{action:"Show applications",severity:"os"},"meta+l":{action:"Lock screen",severity:"os"},"meta+v":{action:"Notification list",severity:"os"},"alt+tab":{action:"Switch applications",severity:"os"},"alt+esc":{action:"Cycle windows",severity:"os"},"alt+f2":{action:"Run command",severity:"os"},"alt+f4":{action:"Close window",severity:"os"},"ctrl+alt+tab":{action:"Top-bar accessibility switcher",severity:"os"},"ctrl+alt+del":{action:"Power-off dialog",severity:"os"},"ctrl+shift+alt+r":{action:"Toggle screencast recording",severity:"os"}}}}};var Ut="1.0",Vt=new Set(["hard","os","menu-activation"]);function Wt(t){return $(_(t).combo)||""}function qt(t,e){if(typeof t!="string"||!t.startsWith("$ref:"))return t;let r=t.slice(5).split("."),i=e;for(let s of r)i=i?.[s];return i}function dt(t){if(!t||typeof t!="object")return null;let e=Object.create(null);for(let[r,i]of Object.entries(t))!i||typeof i!="object"||!("severity"in i)||(e[Wt(r)]=i);return e}function Gt(t){let e={platforms:Object.create(null)},r=t?.platforms||{};for(let[i,s]of Object.entries(r)){let l=Object.create(null);for(let[v,o]of Object.entries(s.browsers||{}))l[v]=dt(qt(o,t));e.platforms[i]={browsers:l,system:dt(s.system)}}return e}var ft=H?.version?.schema===Ut,Zt=ft?Gt(H):{platforms:Object.create(null)},Xt=$;function yt(t,{platform:e,browser:r}={}){if(!ft)return null;let i=Xt(t);if(!i)return null;let s=e&&w(Zt.platforms,e);if(!s)return null;let l=r?w(s.browsers,r):null,v=w(l,i);if(v)return{source:"browser",platform:e,browser:r,lookupKey:i,action:v.action,severity:v.severity};let o=w(s.system,i);return o?{source:"system",platform:e,browser:r,lookupKey:i,action:o.action,severity:o.severity}:null}function Z(t){return Vt.has(t)}var we=H?.version?.schema,be=H?.version?.generated;var ht={",":["<","Comma"],".":[">","Period"],"/":["?","Slash"],";":[":","Semicolon"],"'":['"',"Quote"],"[":["{","BracketLeft"],"]":["}","BracketRight"],"\\":["|","Backslash"],"-":["_","Minus"],"=":["+","Equal"],"`":["~","Backquote"]};for(let t=0;t<10;t++)ht[t]=[")!@#$%^&*("[t],"Digit"+t];function ut(t,{combo:e,type:r,error:i}=_(t)){if(i||!e.shift||e.code)return null;let s=w(ht,e.key);if(!s)return null;let[l,v]=s,b=String(t).trim().replace(/\s+up$/i,"").slice(0,-1)+"code:"+v+(r==="keyup"?" up":"");return{message:`"${t}" never fires on US layouts: Shift turns "${e.key}" into "${l}". Bind "${b}" instead.`,suggestion:b}}var vt=new Set;function Qt(t,e,r){let i=et(t.platform),s=t.source==="browser"?`${t.browser} on ${i}`:i,l=Z(t.severity)?"will not fire":t.severity==="preventable"?r?.preventDefault?"fires first; preventDefault keeps the browser out":"fires, and the browser acts too; bind with preventDefault: true":"fires in normal browsing";return`[hotkey-router] "${e}" (${t.lookupKey}) reserved by ${s}: "${t.action}" [${t.severity}] \u2014 ${l}.`}function Yt(t,e,r=console,i){let s=Qt(t,e,i);(Z(t.severity)||t.severity==="preventable"&&!i?.preventDefault?r.warn:r.info).call(r,s)}function Jt(t,e,r){if(!t||typeof t.onBind!="function")throw new TypeError("Development warnings require a hotkey-router instance with onBind()");let{platform:i=E(),browser:s=tt()}=e,l=e.console||console;return t.onBind(({combo:v,type:o,raw:b,options:m})=>{if(r){let P=ut(b,{combo:v,type:o});if(P){let D=`${$(v)} ${o}`;vt.has(D)||(vt.add(D),l.warn(`[hotkey-router] ${P.message}`))}}if(m?.warnOnReserved===!1||!i||!s)return;let g=yt(v,{platform:i,browser:s});g&&Yt(g,b,l,m)})}function pt(t,e={}){return Jt(t,e,!0)}pt(G);var Ae=G;export{Ae as default};
|