(t0)
| 57 | children: React.ReactNode; |
| 58 | }; |
| 59 | export function KeybindingProvider(t0) { |
| 60 | const $ = _c(24); |
| 61 | const { |
| 62 | bindings, |
| 63 | pendingChordRef, |
| 64 | pendingChord, |
| 65 | setPendingChord, |
| 66 | activeContexts, |
| 67 | registerActiveContext, |
| 68 | unregisterActiveContext, |
| 69 | handlerRegistryRef, |
| 70 | children |
| 71 | } = t0; |
| 72 | let t1; |
| 73 | if ($[0] !== bindings) { |
| 74 | t1 = (action, context) => getBindingDisplayText(action, context, bindings); |
| 75 | $[0] = bindings; |
| 76 | $[1] = t1; |
| 77 | } else { |
| 78 | t1 = $[1]; |
| 79 | } |
| 80 | const getDisplay = t1; |
| 81 | let t2; |
| 82 | if ($[2] !== handlerRegistryRef) { |
| 83 | t2 = registration => { |
| 84 | const registry = handlerRegistryRef.current; |
| 85 | if (!registry) { |
| 86 | return _temp; |
| 87 | } |
| 88 | if (!registry.has(registration.action)) { |
| 89 | registry.set(registration.action, new Set()); |
| 90 | } |
| 91 | registry.get(registration.action).add(registration); |
| 92 | return () => { |
| 93 | const handlers = registry.get(registration.action); |
| 94 | if (handlers) { |
| 95 | handlers.delete(registration); |
| 96 | if (handlers.size === 0) { |
| 97 | registry.delete(registration.action); |
| 98 | } |
| 99 | } |
| 100 | }; |
| 101 | }; |
| 102 | $[2] = handlerRegistryRef; |
| 103 | $[3] = t2; |
| 104 | } else { |
| 105 | t2 = $[3]; |
| 106 | } |
| 107 | const registerHandler = t2; |
| 108 | let t3; |
| 109 | if ($[4] !== activeContexts || $[5] !== handlerRegistryRef) { |
| 110 | t3 = action_0 => { |
| 111 | const registry_0 = handlerRegistryRef.current; |
| 112 | if (!registry_0) { |
| 113 | return false; |
| 114 | } |
| 115 | const handlers_0 = registry_0.get(action_0); |
| 116 | if (!handlers_0 || handlers_0.size === 0) { |
nothing calls this directly
no test coverage detected