@dolthub/react-contexts
Version:
A collection of React contexts for common tasks
15 lines • 1.73 MB
JavaScript
"use strict";var t=require("react");function r(t,r,e,n){return new(e||(e=Promise))((function(o,s){function u(t){try{i(n.next(t))}catch(t){s(t)}}function a(t){try{i(n.throw(t))}catch(t){s(t)}}function i(t){var r;t.done?o(t.value):(r=t.value,r instanceof e?r:new e((function(t){t(r)}))).then(u,a)}i((n=n.apply(t,r||[])).next())}))}function e(r){const e=t.useContext(r);return void 0===e&&console.error(`useContext must be used within a child of ContextProvider for context: ${r.displayName}`),e}function n(t){if(t.__esModule)return t;var r=t.default;if("function"==typeof r){var e=function t(){return this instanceof t?Reflect.construct(r,arguments,this.constructor):r.apply(this,arguments)};e.prototype=r.prototype}else e={};return Object.defineProperty(e,"__esModule",{value:!0}),Object.keys(t).forEach((function(r){var n=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(e,r,n.get?n:{enumerable:!0,get:function(){return t[r]}})})),e}"function"==typeof SuppressedError&&SuppressedError;var o,s,u,a,i={exports:{}},l={exports:{}};function c(){return s?o:(s=1,o="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}var f,b,v,p,d,y,h,C,L,w,E,m={exports:{}},A={},g={};
/** @license React v16.13.1
* react-is.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
function _(){return v||(v=1,"production"===process.env.NODE_ENV?m.exports=function(){if(b)return g;b=1;var t="function"==typeof Symbol&&Symbol.for,r=t?Symbol.for("react.element"):60103,e=t?Symbol.for("react.portal"):60106,n=t?Symbol.for("react.fragment"):60107,o=t?Symbol.for("react.strict_mode"):60108,s=t?Symbol.for("react.profiler"):60114,u=t?Symbol.for("react.provider"):60109,a=t?Symbol.for("react.context"):60110,i=t?Symbol.for("react.async_mode"):60111,l=t?Symbol.for("react.concurrent_mode"):60111,c=t?Symbol.for("react.forward_ref"):60112,f=t?Symbol.for("react.suspense"):60113,v=t?Symbol.for("react.suspense_list"):60120,p=t?Symbol.for("react.memo"):60115,d=t?Symbol.for("react.lazy"):60116,y=t?Symbol.for("react.block"):60121,h=t?Symbol.for("react.fundamental"):60117,C=t?Symbol.for("react.responder"):60118,L=t?Symbol.for("react.scope"):60119;function w(t){if("object"==typeof t&&null!==t){var b=t.$$typeof;switch(b){case r:switch(t=t.type){case i:case l:case n:case s:case o:case f:return t;default:switch(t=t&&t.$$typeof){case a:case c:case d:case p:case u:return t;default:return b}}case e:return b}}}function E(t){return w(t)===l}return g.AsyncMode=i,g.ConcurrentMode=l,g.ContextConsumer=a,g.ContextProvider=u,g.Element=r,g.ForwardRef=c,g.Fragment=n,g.Lazy=d,g.Memo=p,g.Portal=e,g.Profiler=s,g.StrictMode=o,g.Suspense=f,g.isAsyncMode=function(t){return E(t)||w(t)===i},g.isConcurrentMode=E,g.isContextConsumer=function(t){return w(t)===a},g.isContextProvider=function(t){return w(t)===u},g.isElement=function(t){return"object"==typeof t&&null!==t&&t.$$typeof===r},g.isForwardRef=function(t){return w(t)===c},g.isFragment=function(t){return w(t)===n},g.isLazy=function(t){return w(t)===d},g.isMemo=function(t){return w(t)===p},g.isPortal=function(t){return w(t)===e},g.isProfiler=function(t){return w(t)===s},g.isStrictMode=function(t){return w(t)===o},g.isSuspense=function(t){return w(t)===f},g.isValidElementType=function(t){return"string"==typeof t||"function"==typeof t||t===n||t===l||t===s||t===o||t===f||t===v||"object"==typeof t&&null!==t&&(t.$$typeof===d||t.$$typeof===p||t.$$typeof===u||t.$$typeof===a||t.$$typeof===c||t.$$typeof===h||t.$$typeof===C||t.$$typeof===L||t.$$typeof===y)},g.typeOf=w,g}():m.exports=(f||(f=1,"production"!==process.env.NODE_ENV&&function(){var t="function"==typeof Symbol&&Symbol.for,r=t?Symbol.for("react.element"):60103,e=t?Symbol.for("react.portal"):60106,n=t?Symbol.for("react.fragment"):60107,o=t?Symbol.for("react.strict_mode"):60108,s=t?Symbol.for("react.profiler"):60114,u=t?Symbol.for("react.provider"):60109,a=t?Symbol.for("react.context"):60110,i=t?Symbol.for("react.async_mode"):60111,l=t?Symbol.for("react.concurrent_mode"):60111,c=t?Symbol.for("react.forward_ref"):60112,f=t?Symbol.for("react.suspense"):60113,b=t?Symbol.for("react.suspense_list"):60120,v=t?Symbol.for("react.memo"):60115,p=t?Symbol.for("react.lazy"):60116,d=t?Symbol.for("react.block"):60121,y=t?Symbol.for("react.fundamental"):60117,h=t?Symbol.for("react.responder"):60118,C=t?Symbol.for("react.scope"):60119;function L(t){if("object"==typeof t&&null!==t){var b=t.$$typeof;switch(b){case r:var d=t.type;switch(d){case i:case l:case n:case s:case o:case f:return d;default:var y=d&&d.$$typeof;switch(y){case a:case c:case p:case v:case u:return y;default:return b}}case e:return b}}}var w=i,E=l,m=a,g=u,_=r,T=c,I=n,S=p,R=v,N=e,O=s,k=o,x=f,U=!1;function M(t){return L(t)===l}A.AsyncMode=w,A.ConcurrentMode=E,A.ContextConsumer=m,A.ContextProvider=g,A.Element=_,A.ForwardRef=T,A.Fragment=I,A.Lazy=S,A.Memo=R,A.Portal=N,A.Profiler=O,A.StrictMode=k,A.Suspense=x,A.isAsyncMode=function(t){return U||(U=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),M(t)||L(t)===i},A.isConcurrentMode=M,A.isContextConsumer=function(t){return L(t)===a},A.isContextProvider=function(t){return L(t)===u},A.isElement=function(t){return"object"==typeof t&&null!==t&&t.$$typeof===r},A.isForwardRef=function(t){return L(t)===c},A.isFragment=function(t){return L(t)===n},A.isLazy=function(t){return L(t)===p},A.isMemo=function(t){return L(t)===v},A.isPortal=function(t){return L(t)===e},A.isProfiler=function(t){return L(t)===s},A.isStrictMode=function(t){return L(t)===o},A.isSuspense=function(t){return L(t)===f},A.isValidElementType=function(t){return"string"==typeof t||"function"==typeof t||t===n||t===l||t===s||t===o||t===f||t===b||"object"==typeof t&&null!==t&&(t.$$typeof===p||t.$$typeof===v||t.$$typeof===u||t.$$typeof===a||t.$$typeof===c||t.$$typeof===y||t.$$typeof===h||t.$$typeof===C||t.$$typeof===d)},A.typeOf=L}()),A)),m.exports}
/*
object-assign
(c) Sindre Sorhus
@license MIT
*/function T(){return h?y:(h=1,y=Function.call.bind(Object.prototype.hasOwnProperty))}if("production"!==process.env.NODE_ENV){var I=_();l.exports=function(){if(E)return w;E=1;var t=_(),r=function(){if(d)return p;d=1;var t=Object.getOwnPropertySymbols,r=Object.prototype.hasOwnProperty,e=Object.prototype.propertyIsEnumerable;return p=function(){try{if(!Object.assign)return!1;var t=new String("abc");if(t[5]="de","5"===Object.getOwnPropertyNames(t)[0])return!1;for(var r={},e=0;e<10;e++)r["_"+String.fromCharCode(e)]=e;if("0123456789"!==Object.getOwnPropertyNames(r).map((function(t){return r[t]})).join(""))return!1;var n={};return"abcdefghijklmnopqrst".split("").forEach((function(t){n[t]=t})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},n)).join("")}catch(t){return!1}}()?Object.assign:function(n,o){for(var s,u,a=function(t){if(null==t)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(t)}(n),i=1;i<arguments.length;i++){for(var l in s=Object(arguments[i]))r.call(s,l)&&(a[l]=s[l]);if(t){u=t(s);for(var c=0;c<u.length;c++)e.call(s,u[c])&&(a[u[c]]=s[u[c]])}}return a},p}(),e=c(),n=T(),o=function(){if(L)return C;L=1;var t=function(){};if("production"!==process.env.NODE_ENV){var r=c(),e={},n=T();t=function(t){var r="Warning: "+t;"undefined"!=typeof console&&console.error(r);try{throw new Error(r)}catch(t){}}}function o(o,s,u,a,i){if("production"!==process.env.NODE_ENV)for(var l in o)if(n(o,l)){var c;try{if("function"!=typeof o[l]){var f=Error((a||"React class")+": "+u+" type `"+l+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof o[l]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw f.name="Invariant Violation",f}c=o[l](s,l,a,u,null,r)}catch(t){c=t}if(!c||c instanceof Error||t((a||"React class")+": type specification of "+u+" `"+l+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof c+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),c instanceof Error&&!(c.message in e)){e[c.message]=!0;var b=i?i():"";t("Failed "+u+" type: "+c.message+(null!=b?b:""))}}}return o.resetWarningCache=function(){"production"!==process.env.NODE_ENV&&(e={})},C=o}(),s=function(){};function u(){return null}return"production"!==process.env.NODE_ENV&&(s=function(t){var r="Warning: "+t;"undefined"!=typeof console&&console.error(r);try{throw new Error(r)}catch(t){}}),w=function(a,i){var l="function"==typeof Symbol&&Symbol.iterator,c="<<anonymous>>",f={array:d("array"),bigint:d("bigint"),bool:d("boolean"),func:d("function"),number:d("number"),object:d("object"),string:d("string"),symbol:d("symbol"),any:p(u),arrayOf:function(t){return p((function(r,n,o,s,u){if("function"!=typeof t)return new v("Property `"+u+"` of component `"+o+"` has invalid PropType notation inside arrayOf.");var a=r[n];if(!Array.isArray(a))return new v("Invalid "+s+" `"+u+"` of type `"+C(a)+"` supplied to `"+o+"`, expected an array.");for(var i=0;i<a.length;i++){var l=t(a,i,o,s,u+"["+i+"]",e);if(l instanceof Error)return l}return null}))},element:p((function(t,r,e,n,o){var s=t[r];return a(s)?null:new v("Invalid "+n+" `"+o+"` of type `"+C(s)+"` supplied to `"+e+"`, expected a single ReactElement.")})),elementType:p((function(r,e,n,o,s){var u=r[e];return t.isValidElementType(u)?null:new v("Invalid "+o+" `"+s+"` of type `"+C(u)+"` supplied to `"+n+"`, expected a single ReactElement type.")})),instanceOf:function(t){return p((function(r,e,n,o,s){if(!(r[e]instanceof t)){var u=t.name||c;return new v("Invalid "+o+" `"+s+"` of type `"+((a=r[e]).constructor&&a.constructor.name?a.constructor.name:c)+"` supplied to `"+n+"`, expected instance of `"+u+"`.")}var a;return null}))},node:p((function(t,r,e,n,o){return h(t[r])?null:new v("Invalid "+n+" `"+o+"` supplied to `"+e+"`, expected a ReactNode.")})),objectOf:function(t){return p((function(r,o,s,u,a){if("function"!=typeof t)return new v("Property `"+a+"` of component `"+s+"` has invalid PropType notation inside objectOf.");var i=r[o],l=C(i);if("object"!==l)return new v("Invalid "+u+" `"+a+"` of type `"+l+"` supplied to `"+s+"`, expected an object.");for(var c in i)if(n(i,c)){var f=t(i,c,s,u,a+"."+c,e);if(f instanceof Error)return f}return null}))},oneOf:function(t){return Array.isArray(t)?p((function(r,e,n,o,s){for(var u=r[e],a=0;a<t.length;a++)if(b(u,t[a]))return null;var i=JSON.stringify(t,(function(t,r){return"symbol"===L(r)?String(r):r}));return new v("Invalid "+o+" `"+s+"` of value `"+String(u)+"` supplied to `"+n+"`, expected one of "+i+".")})):("production"!==process.env.NODE_ENV&&s(arguments.length>1?"Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z]).":"Invalid argument supplied to oneOf, expected an array."),u)},oneOfType:function(t){if(!Array.isArray(t))return"production"!==process.env.NODE_ENV&&s("Invalid argument supplied to oneOfType, expected an instance of array."),u;for(var r=0;r<t.length;r++){var o=t[r];if("function"!=typeof o)return s("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+w(o)+" at index "+r+"."),u}return p((function(r,o,s,u,a){for(var i=[],l=0;l<t.length;l++){var c=(0,t[l])(r,o,s,u,a,e);if(null==c)return null;c.data&&n(c.data,"expectedType")&&i.push(c.data.expectedType)}return new v("Invalid "+u+" `"+a+"` supplied to `"+s+"`"+(i.length>0?", expected one of type ["+i.join(", ")+"]":"")+".")}))},shape:function(t){return p((function(r,n,o,s,u){var a=r[n],i=C(a);if("object"!==i)return new v("Invalid "+s+" `"+u+"` of type `"+i+"` supplied to `"+o+"`, expected `object`.");for(var l in t){var c=t[l];if("function"!=typeof c)return y(o,s,u,l,L(c));var f=c(a,l,o,s,u+"."+l,e);if(f)return f}return null}))},exact:function(t){return p((function(o,s,u,a,i){var l=o[s],c=C(l);if("object"!==c)return new v("Invalid "+a+" `"+i+"` of type `"+c+"` supplied to `"+u+"`, expected `object`.");var f=r({},o[s],t);for(var b in f){var p=t[b];if(n(t,b)&&"function"!=typeof p)return y(u,a,i,b,L(p));if(!p)return new v("Invalid "+a+" `"+i+"` key `"+b+"` supplied to `"+u+"`.\nBad object: "+JSON.stringify(o[s],null," ")+"\nValid keys: "+JSON.stringify(Object.keys(t),null," "));var d=p(l,b,u,a,i+"."+b,e);if(d)return d}return null}))}};function b(t,r){return t===r?0!==t||1/t==1/r:t!=t&&r!=r}function v(t,r){this.message=t,this.data=r&&"object"==typeof r?r:{},this.stack=""}function p(t){if("production"!==process.env.NODE_ENV)var r={},n=0;function o(o,u,a,l,f,b,p){if(l=l||c,b=b||a,p!==e){if(i){var d=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw d.name="Invariant Violation",d}if("production"!==process.env.NODE_ENV&&"undefined"!=typeof console){var y=l+":"+a;!r[y]&&n<3&&(s("You are manually calling a React.PropTypes validation function for the `"+b+"` prop on `"+l+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),r[y]=!0,n++)}}return null==u[a]?o?null===u[a]?new v("The "+f+" `"+b+"` is marked as required in `"+l+"`, but its value is `null`."):new v("The "+f+" `"+b+"` is marked as required in `"+l+"`, but its value is `undefined`."):null:t(u,a,l,f,b)}var u=o.bind(null,!1);return u.isRequired=o.bind(null,!0),u}function d(t){return p((function(r,e,n,o,s,u){var a=r[e];return C(a)!==t?new v("Invalid "+o+" `"+s+"` of type `"+L(a)+"` supplied to `"+n+"`, expected `"+t+"`.",{expectedType:t}):null}))}function y(t,r,e,n,o){return new v((t||"React class")+": "+r+" type `"+e+"."+n+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+o+"`.")}function h(t){switch(typeof t){case"number":case"string":case"undefined":return!0;case"boolean":return!t;case"object":if(Array.isArray(t))return t.every(h);if(null===t||a(t))return!0;var r=function(t){var r=t&&(l&&t[l]||t["@@iterator"]);if("function"==typeof r)return r}(t);if(!r)return!1;var e,n=r.call(t);if(r!==t.entries){for(;!(e=n.next()).done;)if(!h(e.value))return!1}else for(;!(e=n.next()).done;){var o=e.value;if(o&&!h(o[1]))return!1}return!0;default:return!1}}function C(t){var r=typeof t;return Array.isArray(t)?"array":t instanceof RegExp?"object":function(t,r){return"symbol"===t||!!r&&("Symbol"===r["@@toStringTag"]||"function"==typeof Symbol&&r instanceof Symbol)}(r,t)?"symbol":r}function L(t){if(null==t)return""+t;var r=C(t);if("object"===r){if(t instanceof Date)return"date";if(t instanceof RegExp)return"regexp"}return r}function w(t){var r=L(t);switch(r){case"array":case"object":return"an "+r;case"boolean":case"date":case"regexp":return"a "+r;default:return r}}return v.prototype=Error.prototype,f.checkPropTypes=o,f.resetWarningCache=o.resetWarningCache,f.PropTypes=f,f},w}()(I.isElement,!0)}else l.exports=function(){if(a)return u;a=1;var t=c();function r(){}function e(){}return e.resetWarningCache=r,u=function(){function n(r,e,n,o,s,u){if(u!==t){var a=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw a.name="Invariant Violation",a}}function o(){return n}n.isRequired=n;var s={array:n,bigint:n,bool:n,func:n,number:n,object:n,string:n,symbol:n,any:n,arrayOf:o,element:n,elementType:n,instanceOf:o,node:n,objectOf:o,oneOf:o,oneOfType:o,shape:o,exact:o,checkPropTypes:e,resetWarningCache:r};return s.PropTypes=s,s}}()();var S=function(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}(l.exports);function R(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return t.reduce((function(t,e){return t[e]=r||{value:e},t}),{})}function N(t,r){for(var e=0;e<r.length;e++){var n=r[e];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function O(t,r,e){return r in t?Object.defineProperty(t,r,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[r]=e,t}var k={logLevel:"warn",defaultKeyEvent:"keydown",defaultComponent:"div",defaultTabIndex:"-1",ignoreTags:["input","select","textarea"],enableHardSequences:!1,ignoreKeymapAndHandlerChangesByDefault:!0,ignoreEventsCondition:function(t){var r=t.target;if(r&&r.tagName){var e=r.tagName.toLowerCase();return U.option("_ignoreTagsDict")[e]||r.isContentEditable}return!1},ignoreRepeatedEventsWhenKeyHeldDown:!0,simulateMissingKeyPressEvents:!0,stopEventPropagationAfterHandling:!0,stopEventPropagationAfterIgnoring:!0,allowCombinationSubmatches:!1,customKeyCodes:{}},x=function(t){for(var r=1;r<arguments.length;r++){var e=null!=arguments[r]?arguments[r]:{},n=Object.keys(e);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(e).filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})))),n.forEach((function(r){O(t,r,e[r])}))}return t}({},k);x._ignoreTagsDict=R(x.ignoreTags,!0);var U=function(){function t(){!function(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}(this,t)}var r,e;return r=t,e=[{key:"init",value:function(t){var r=this,e=t.ignoreTags,n=t.customKeyCodes;e&&(t._ignoreTagsDict=R(t.ignoreTags)),n&&(t._customKeyNamesDict=R(Object.values(t.customKeyCodes))),Object.keys(t).forEach((function(e){r.set(e,t[e])}))}},{key:"set",value:function(t,r){x[t]=r}},{key:"reset",value:function(t){x[t]=k[t]}},{key:"option",value:function(t){return x[t]}}],null&&N(r.prototype,null),e&&N(r,e),t}();function M(t,r,e){return r in t?Object.defineProperty(t,r,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[r]=e,t}var P=function(){var t;function r(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"warn";!function(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}(this,r),M(this,"verbose",this.noop),M(this,"debug",this.noop),M(this,"info",this.noop),M(this,"warn",this.noop),M(this,"error",this.noop),this.logLevel=this.constructor.levels[e],this.logLevel>=this.constructor.levels.error&&(this.error=console.error,this.logLevel>=this.constructor.levels.warn&&(this.warn=console.warn,["info","debug","verbose"].some((function(r){return!(t.logLevel>=t.constructor.levels[r]&&(t[r]=console.log,1))}))))}return(t=[{key:"noop",value:function(){}}])&&function(t,r){for(var e=0;e<r.length;e++){var n=r[e];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}(r.prototype,t),r}();M(P,"logIcons",["📕","📗","📘","📙"]),M(P,"componentIcons",["🔺","⭐️","🔷","🔶","⬛️"]),M(P,"eventIcons",["❤️","💚","💙","💛","💜","🧡"]),M(P,"levels",{none:0,error:1,warn:2,info:3,debug:4,verbose:5});var D={keydown:0,keypress:1,keyup:2},j={Shift:["shiftKey"],Meta:["metaKey"],Control:["ctrlKey"],Alt:["altKey"]},F={"`":["~"],1:["!"],2:["@",'"'],3:["#","£"],4:["$"],5:["%"],6:["^"],7:["&"],8:["*"],9:["("],0:[")"],"-":["_"],"=":["plus"],";":[":"],"'":['"',"@"],",":["<"],".":[">"],"/":["?"],"\\":["|"],"[":["{"],"]":["}"],"#":["~"]};function K(t){return F[t]||[1===t.length?t.toUpperCase():t]}function H(t,r){return t.hasOwnProperty(r)}function $(t){return function(t){if(Array.isArray(t)){for(var r=0,e=new Array(t.length);r<t.length;r++)e[r]=t[r];return e}}(t)||function(t){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t))return Array.from(t)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}function G(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object.keys(t).reduce((function(e,n){var o=t[n];return o.forEach((function(t){H(e,t)||(e[t]=[]),e[t].push(n)})),r.includeOriginal&&(H(e,n)||(e[n]=[]),e[n]=[].concat($(e[n]),$(o))),e}),{})}var B=G(F);function Y(t){return B[t]||[1===t.length?t.toLowerCase():t]}var q=G({},{includeOriginal:!0});function W(t){return"string"==typeof t}var V={tab:"Tab",capslock:"CapsLock",shift:"Shift",meta:"Meta",alt:"Alt",ctrl:"Control",space:" ",spacebar:" ",escape:"Escape",esc:"Escape",left:"ArrowLeft",right:"ArrowRight",up:"ArrowUp",down:"ArrowDown",return:"Enter",del:"Delete",command:"Meta",option:"Alt",enter:"Enter",backspace:"Backspace",ins:"Insert",pageup:"PageUp",pagedown:"PageDown",end:"End",home:"Home",contextmenu:"ContextMenu",numlock:"Clear"},X={cmd:"Meta"};function z(t){var r=t.toLowerCase();return V[r]||X[r]||(t.match(/^f\d+$/)?t.toUpperCase():t)}var Z={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},J=R(Object.values(Z),!0);function Q(t){return!!J[t]}function tt(t){return tt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},tt(t)}function rt(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function et(t){var r="function"==typeof Map?new Map:void 0;return et=function(t){if(null===t||(e=t,-1===Function.toString.call(e).indexOf("[native code]")))return t;var e;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==r){if(r.has(t))return r.get(t);r.set(t,n)}function n(){return nt(t,arguments,st(this).constructor)}return n.prototype=Object.create(t.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),ot(n,t)},et(t)}function nt(t,r,e){return nt=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}()?Reflect.construct:function(t,r,e){var n=[null];n.push.apply(n,r);var o=new(Function.bind.apply(t,n));return e&&ot(o,e.prototype),o},nt.apply(null,arguments)}function ot(t,r){return ot=Object.setPrototypeOf||function(t,r){return t.__proto__=r,t},ot(t,r)}function st(t){return st=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},st(t)}function ut(t){return Q(t)||String.fromCharCode(t.charCodeAt(0))===t||function(t){return U.option("_customKeyNamesDict")[t]}(t)}var at=function(t){function r(){var t,e,n,o,s;!function(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}(this,r);for(var u=arguments.length,a=new Array(u),i=0;i<u;i++)a[i]=arguments[i];return e=function(t,r){return!r||"object"!==tt(r)&&"function"!=typeof r?rt(t):r}(this,(t=st(r)).call.apply(t,[this].concat(a))),s="InvalidKeyNameError",(o="name")in(n=rt(rt(e)))?Object.defineProperty(n,o,{value:s,enumerable:!0,configurable:!0,writable:!0}):n[o]=s,e}return function(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(r&&r.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),r&&ot(t,r)}(r,et(Error)),r}();function it(t,r){for(var e=0;e<r.length;e++){var n=r[e];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function lt(t){return t.sort().join("+")}var ct=function(){function t(){!function(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}(this,t)}var r,e;return r=t,e=[{key:"parse",value:function(t){var r,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=(W(r=t)?r.trim().replace(/\s+/g," "):r).split(" ");try{var o=n.slice(0,n.length-1),s=n[n.length-1],u=o.map((function(t){var r=ft(t,e);return lt(Object.keys(r))})).join(" "),a=ft(s,e),i={id:lt(Object.keys(a)),keyDictionary:a,keyEventType:e.keyEventType,size:Object.keys(a).length};return{sequence:{prefix:u,size:o.length+1},combination:i}}catch(t){return{sequence:null,combination:null}}}}],null&&it(r.prototype,null),e&&it(r,e),t}();function ft(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return t.replace(/^\+|(\s|[^+]\+)\+/,"$1plus").split("+").reduce((function(t,e){var n=z(e);if(r.ensureValidKeys&&!ut(n))throw new at;return t[n]=!0,t}),{})}var bt={"`":["`"],1:["¡"],2:["™"],3:["£"],4:["¢"],5:["∞"],6:["§"],7:["¶"],8:["•"],9:["ª"],0:["º"],"-":["–"],"=":["≠"],a:["å"],b:["∫"],c:["ç"],d:["∂"],e:["´"],f:["ƒ"],g:["©"],h:["˙"],i:["ˆ"],j:["∆"],k:["˚"],l:["¬"],m:["µ"],n:["˜"],o:["ø"],p:["π"],q:["œ"],r:["®"],s:["ß"],t:["†"],u:["¨"],v:["√"],w:["∑"],x:["≈"],y:["¥"],z:["Ω"],"[":["“"],"]":["‘"],"\\":["«"],"'":["æ"],";":["…"],",":["≤"],".":["≥"],"/":["÷"]},vt=G(bt);function pt(t){return vt[t]||[t]}function dt(t){return bt[t]||[t]}var yt={"`":["`"],1:["⁄"],2:["€"],3:["‹"],4:["›"],5:["fi"],6:["fl"],7:["‡"],8:["°"],9:["·"],0:["‚"],"-":["—"],"=":["±"],a:["Å"],b:["ı"],c:["Ç"],d:["Î"],e:["´"],f:["Ï"],g:["˝"],h:["Ó"],i:["ˆ"],j:["Ô"],k:[""],l:["Ò"],m:["Â"],n:["˜"],o:["Ø"],p:["π"],q:["Œ"],r:["‰"],s:["Í"],t:["Î"],u:["¨"],v:["◊"],w:["„"],x:["˛"],y:["Á"],z:["¸"],"[":["”"],"]":["’"],"\\":["»"],"'":["Æ"],";":["Ú"],",":["¯"],".":["˘"]},ht=G(yt);function Ct(t){return ht[t]||Y(t)}function Lt(t){return yt[t]||[t]}function wt(t,r,e){return r in t?Object.defineProperty(t,r,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[r]=e,t}function Et(t){return function(t){if(Array.isArray(t)){for(var r=0,e=new Array(t.length);r<t.length;r++)e[r]=t[r];return e}}(t)||function(t){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t))return Array.from(t)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}function mt(t,r){for(var e=0;e<r.length;e++){var n=r[e];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}var At=function(){function t(){!function(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}(this,t)}var r,e;return r=t,e=[{key:"serialize",value:function(t){var r=t.Shift,e=t.Alt,n={};return Object.keys(t).sort().forEach((function(t){var o=[];if(r)if(e){var s=Ct(t),u=Lt(t);o=[].concat(Et(o),[t],Et(s),Et(u))}else{var a=Y(t),i=K(t);o=[].concat(Et(o),[t],Et(a),Et(i))}else if(e){var l=pt(t),c=dt(t);o=[].concat(Et(o),[t],Et(l),Et(c))}else{o.push(t);var f=q[t];f&&(o=[].concat(Et(o),Et(f)))}var b=Object.keys(n);b.length>0?b.forEach((function(t){o.forEach((function(r){n[t+"+".concat(r)]=function(t){for(var r=1;r<arguments.length;r++){var e=null!=arguments[r]?arguments[r]:{},n=Object.keys(e);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(e).filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})))),n.forEach((function(r){wt(t,r,e[r])}))}return t}({},n[t],wt({},r,!0))})),delete n[t]})):o.forEach((function(t){n[t]=wt({},t,!0)}))})),Object.values(n).map((function(t){return Object.keys(t).sort().join("+")}))}},{key:"isValidKeySerialization",value:function(t){return t.length>0&&!!ct.parse(t,{ensureValidKeys:!0}).combination}}],null&&mt(r.prototype,null),e&&mt(r,e),t}();function gt(t){return void 0===t}function _t(t,r){for(var e=0;e<r.length;e++){var n=r[e];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}var Tt=function(){function t(){!function(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}(this,t)}var r,e;return r=t,e=[{key:"newRecord",value:function(t,r){var e=[0,0,0];if(!gt(t))for(var n=0;n<=t;n++)e[n]=r;return e}},{key:"setBit",value:function(t,r,e){return t[r]=e,t}},{key:"clone",value:function(t){for(var r=this.newRecord(),e=0;e<t.length;e++)r[e]=t[e];return r}}],null&&_t(r.prototype,null),e&&_t(r,e),t}();function It(t){return It="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},It(t)}function St(t){return!Array.isArray(t)&&"object"===It(t)&&null!==t}function Rt(t){return St(t)?0===Object.keys(t).length:!t||0===t.length}function Nt(t){return St(t)?Object.keys(t).length:t.length}var Ot=function(){function t(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};!function(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}(this,t),this._keys=r,this._includesKeyUp=!1,this._update()}var r;return r=[{key:"getIds",value:function(){return this._ids}},{key:"getKeyAliases",value:function(){return this._keyAliases}},{key:"getNormalizedKeyName",value:function(t){return this._keys[t]?t:this._keyAliases[t]||t}},{key:"getNumberOfKeys",value:function(){return Nt(this._keys)}},{key:"any",value:function(){return Object.keys(this._getKeyStates()).length>0}},{key:"isEnding",value:function(){return this._includesKeyUp}},{key:"hasEnded",value:function(){return Rt(this.keysStillPressedDict())}},{key:"addKey",value:function(t,r){this._setKeyState(t,[Tt.newRecord(),Tt.newRecord(D.keydown,r)])}},{key:"setKeyState",value:function(t,r,e){var n=this._getKeyState(t);if(this.isKeyIncluded(t)){var o=Tt.clone(n[1]),s=Tt.clone(o);Tt.setBit(s,r,e),this._setKeyState(t,[o,s])}else this.addKey(t,e);r===D.keyup&&(this._includesKeyUp=!0)}},{key:"forEachKey",value:function(t){return Object.keys(this._keys).forEach(t)}},{key:"some",value:function(t){return Object.keys(this._keys).some(t)}},{key:"getKeyDictionary",value:function(){return R(Object.keys(this._getKeyStates()),!0)}},{key:"keysStillPressedDict",value:function(){var t=this;return Object.keys(this._keys).reduce((function(r,e){return t.isKeyStillPressed(e)&&(r[e]=t._getKeyState(e)),r}),{})}},{key:"isKeyIncluded",value:function(t){return!!this._getKeyState(t)}},{key:"isKeyStillPressed",value:function(t){return this.isEventTriggered(t,D.keypress)&&!this.isKeyReleased(t)}},{key:"isKeyReleased",value:function(t){return this.isEventTriggered(t,D.keyup)}},{key:"isEventTriggered",value:function(t,r){return this._getKeyStateType(t,1,r)}},{key:"wasEventPreviouslyTriggered",value:function(t,r){return this._getKeyStateType(t,0,r)}},{key:"isKeyPressSimulated",value:function(t){return this._isKeyEventSimulated(t,D.keypress)}},{key:"isKeyUpSimulated",value:function(t){return this._isKeyEventSimulated(t,D.keyup)}},{key:"describe",value:function(){return this.getIds()[0]}},{key:"toJSON",value:function(){return{keys:this._getKeyStates(),ids:this.getIds(),keyAliases:this.getKeyAliases()}}},{key:"_getKeyStateType",value:function(t,r,e){var n=this._getKeyState(t);return n&&n[r][e]}},{key:"_update",value:function(){this._ids=At.serialize(this._keys),this._keyAliases=function(t){return Object.keys(t).reduce((function(r,e){return function(t){return q[t]||[t]}(e).forEach((function(n){(function(t){if(t.Shift)return t.Alt?[Lt,Ct]:[K,Y];if(t.Alt)return[dt,pt];var r=function(t){return[t]};return[r,r]})(t).forEach((function(t){t(n).forEach((function(t){t===e&&e===n||(r[t]=e)}))}))})),r}),{})}(this._keys)}},{key:"_isKeyEventSimulated",value:function(t,r){return 2===this.isEventTriggered(t,r)}},{key:"_getKeyStates",value:function(){return this._keys}},{key:"_getKeyState",value:function(t){var r=this._keys[t];if(r)return r;var e=this._keyAliases[t];return e?this._keys[e]:void 0}},{key:"_setKeyState",value:function(t,r){var e=this.getNormalizedKeyName(t);this._keys[e]=r,this._update()}}],r&&function(t,r){for(var e=0;e<r.length;e++){var n=r[e];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}(t.prototype,r),t}();var kt=function(){function t(r){var e=r.maxLength,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;!function(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}(this,t),this._records=[],this._maxLength=e,n?this._push(n):this._push(new Ot)}var r;return(r=[{key:"getMostRecentCombinations",value:function(t){return this._records.slice(-t,-1)}},{key:"any",value:function(){return this._records.some((function(t){return t.any()}))}},{key:"getLength",value:function(){return this._records.length}},{key:"getCurrentCombination",value:function(){return this._records[this.getLength()-1]}},{key:"addKeyToCurrentCombination",value:function(t,r,e){this._ensureInitialKeyCombination(),this.getCurrentCombination().setKeyState(t,r,e)}},{key:"setMaxLength",value:function(t){this._maxLength=t,this._trimHistory()}},{key:"startNewKeyCombination",value:function(t,r){this._ensureInitialKeyCombination();var e=new Ot(this.getCurrentCombination().keysStillPressedDict());e.addKey(t,r),this._push(e)}},{key:"toJSON",value:function(){return this._records.map((function(t){return t.toJSON()}))}},{key:"_ensureInitialKeyCombination",value:function(){0===this.getLength()&&this._push(new Ot)}},{key:"_push",value:function(t){this._trimHistory(),this._records.push(t)}},{key:"_trimHistory",value:function(){for(;this.getLength()>this._maxLength;)this._shift()}},{key:"_shift",value:function(){this._records.shift()}}])&&function(t,r){for(var e=0;e<r.length;e++){var n=r[e];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}(t.prototype,r),t}();var xt=function(){function t(){!function(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}(this,t),this._registry={}}var r;return(r=[{key:"get",value:function(t){return this._registry[t]}},{key:"set",value:function(t,r){this._registry[t]=r}},{key:"remove",value:function(t){delete this._registry[t]}},{key:"toJSON",value:function(){return this._registry}}])&&function(t,r){for(var e=0;e<r.length;e++){var n=r[e];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}(t.prototype,r),t}();function Ut(t){return Array.isArray(t)?t:t?[t]:[]}function Mt(t){return Mt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Mt(t)}function Pt(t,r,e){return r in t?Object.defineProperty(t,r,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[r]=e,t}function Dt(t,r,e){return Dt="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,r,e){var n=function(t,r){for(;!Object.prototype.hasOwnProperty.call(t,r)&&null!==(t=jt(t)););return t}(t,r);if(n){var o=Object.getOwnPropertyDescriptor(n,r);return o.get?o.get.call(e):o.value}},Dt(t,r,e||t)}function jt(t){return jt=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},jt(t)}function Ft(t,r){return Ft=Object.setPrototypeOf||function(t,r){return t.__proto__=r,t},Ft(t,r)}var Kt=function(t){function r(){return function(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}(this,r),function(t,r){return!r||"object"!==Mt(r)&&"function"!=typeof r?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):r}(this,jt(r).apply(this,arguments))}var e;return function(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(r&&r.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),r&&Ft(t,r)}(r,xt),e=[{key:"add",value:function(t,e){Dt(jt(r.prototype),"set",this).call(this,t,{childIds:[],parentId:null,keyMap:e})}},{key:"update",value:function(t,e){var n=Dt(jt(r.prototype),"get",this).call(this,t);Dt(jt(r.prototype),"set",this).call(this,t,function(t){for(var r=1;r<arguments.length;r++){var e=null!=arguments[r]?arguments[r]:{},n=Object.keys(e);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(e).filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})))),n.forEach((function(r){Pt(t,r,e[r])}))}return t}({},n,{keyMap:e}))}},{key:"setParent",value:function(t,r){this.get(t).parentId=r,this._addChildId(r,t)}},{key:"remove",value:function(t){var e=this._getParentId(t);this._removeChildId(e,t),Dt(jt(r.prototype),"remove",this).call(this,t)}},{key:"_getParentId",value:function(t){var r=this.get(t);return r&&r.parentId}},{key:"_addChildId",value:function(t,r){this.get(t).childIds.push(r)}},{key:"_removeChildId",value:function(t,r){var e=this.get(t);e&&(e.childIds=function(t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},e=R(Ut(arguments.length>1&&void 0!==arguments[1]?arguments[1]:[]));return Array.isArray(t)?t.reduce((function(t,n){return e[n]&&(r.stringifyFirst||e[n].value===n)||t.push(n),t}),[]):St(t)?Object.keys(t).reduce((function(r,n){return e[n]||(r[n]=t[n]),r}),{}):t}(e.childIds,r))}}],e&&function(t,r){for(var e=0;e<r.length;e++){var n=r[e];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}(r.prototype,e),r}();function Ht(t){return function(t){if(Array.isArray(t)){for(var r=0,e=new Array(t.length);r<t.length;r++)e[r]=t[r];return e}}(t)||function(t){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t))return Array.from(t)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}var $t=function(){function t(r){!function(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}(this,t),this._list=r,this._position=-1}var r;return(r=[{key:"getPosition",value:function(){return this._position}},{key:"getComponent",value:function(){return this._list.getAtPosition(this.getPosition())}},{key:"next",value:function(){return this.getPosition()+1<this._list.getLength()?(this._position++,this.getComponent()):null}}])&&function(t,r){for(var e=0;e<r.length;e++){var n=r[e];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}(t.prototype,r),t}();function Gt(t){for(var r=1;r<arguments.length;r++){var e=null!=arguments[r]?arguments[r]:{},n=Object.keys(e);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(e).filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})))),n.forEach((function(r){Bt(t,r,e[r])}))}return t}function Bt(t,r,e){return r in t?Object.defineProperty(t,r,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[r]=e,t}var Yt=function(){function t(){!function(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}(this,t),this._list=[],this._idToIndex={},this._longestSequence=1,this._longestSequenceComponentId=null,this._keyMapEventRecord=Tt.newRecord()}var r;return(r=[{key:"getNewIterator",value:function(){return new $t(this)}},{key:"add",value:function(t,r,e,n){if(this.containsId(t))return this.update(t,r,e,n);var o=this._build(t,r,e,n);this._list.push(o);var s=this._getLastIndex();return this._idToIndex[t]=s}},{key:"containsId",value:function(t){return!!this.get(t)}},{key:"get",value:function(t){return this.getAtPosition(this.getIndexById(t))}},{key:"getIndexById",value:function(t){return this._idToIndex[t]}},{key:"update",value:function(t,r,e,n){var o=this._isUpdatingComponentWithLongestSequence(t),s=this.getLongestSequence(),u=this._build(t,r,e,n);o&&u.sequenceLength!==s&&(u.sequenceLength>s?this._longestSequence=u.sequenceLength:this._recalculateLongestSequence()),this._list[this.getIndexById(t)]=u}},{key:"remove",value:function(t){var r=this._isUpdatingComponentWithLongestSequence(t);this.removeAtPosition(this.getIndexById(t)),r&&this._recalculateLongestSequence()}},{key:"any",value:function(){return 0!==this.getLength()}},{key:"isRoot",value:function(t){return this.getIndexById(t)>=this.getLength()-1}},{key:"getLongestSequence",value:function(){return this._longestSequence}},{key:"anyActionsForEventType",value:function(t){return!!this._keyMapEventRecord[t]}},{key:"getLength",value:function(){return this._list.length}},{key:"getAtPosition",value:function(t){return this._list[t]}},{key:"removeAtPosition",value:function(t){var r,e;this._list=(r=this._list,e=t,[].concat(Ht(r.slice(0,e)),Ht(r.slice(e+1))));for(var n=t;n<this.getLength();)this._idToIndex[this.getAtPosition(n).componentId]=n,n++}},{key:"toJSON",value:function(){return this._list}},{key:"_getLastIndex",value:function(){return this.getLength()-1}},{key:"_build",value:function(t,r,e,n){var o=this._applyHardSequences(r,e),s=o.keyMap,u=o.handlers;return{actions:this._buildActionDictionary(Gt({},r,s),n,t),handlers:u,componentId:t,options:n}}},{key:"_isUpdatingComponentWithLongestSequence",value:function(t){return t===this._getLongestSequenceComponentId()}},{key:"_getLongestSequenceComponentId",value:function(){return this._longestSequenceComponentId}},{key:"_recalculateLongestSequence",value:function(){for(var t=this.getNewIterator();t.next();){var r=t.getComponent(),e=r.longestSequence,n=r.componentId;e>this.getLongestSequence()&&(this._longestSequenceComponentId=n,this._longestSequence=e)}}},{key:"_applyHardSequences",value:function(t,r){return U.option("enableHardSequences")?Object.keys(r).reduce((function(e,n){return!t[n]&&At.isValidKeySerialization(n)&&(e.keyMap[n]=n),e.handlers[n]=r[n],e}),{keyMap:{},handlers:{}}):{keyMap:t,handlers:r}}},{key:"_buildActionDictionary",value:function(t,r,e){var n=this;return Object.keys(t).reduce((function(o,s){var u=t[s];return(St(u)&&H(u,"sequences")?Ut(u.sequences):Ut(u)).forEach((function(t){var u=function(t,r){if(St(t)){var e=t.sequence,n=t.action;return{keySequence:e,keyEventType:gt(n)?D[r.defaultKeyEvent]:D[n]}}return{keySequence:t,keyEventType:D[r.defaultKeyEvent]}}(t,r),a=u.keySequence,i=u.keyEventType;n._addActionOptions(o,e,s,a,i)})),o}),{})}},{key:"_addActionOptions",value:function(t,r,e,n,o){var s=ct.parse(n,{keyEventType:o}),u=s.sequence,a=s.combination;u.size>this.getLongestSequence()&&(this._longestSequence=u.size,this._longestSequenceComponentId=r),this._keyMapEventRecord[o]=1,t[e]||(t[e]=[]),t[e].push(Gt({prefix:u.prefix,actionName:e,sequenceLength:u.size},a))}}])&&function(t,r){for(var e=0;e<r.length;e++){var n=r[e];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}(t.prototype,r),t}();function qt(t,r){return t[t.length-(r+1)]}for(var Wt={Enter:!0,Backspace:!0,ArrowRight:!0,ArrowLeft:!0,ArrowUp:!0,ArrowDown:!0,CapsLock:!0},Vt=1;Vt<13;Vt++)Wt["F".concat(Vt)]=!0;function Xt(t){return 1===t.length||H(Wt,t)}function zt(t){for(var r=1;r<arguments.length;r++){var e=null!=arguments[r]?arguments[r]:{},n=Object.keys(e);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(e).filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})))),n.forEach((function(r){Zt(t,r,e[r])}))}return t}function Zt(t,r,e){return r in t?Object.defineProperty(t,r,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[r]=e,t}var Jt=function(){function t(){!function(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}(this,t),this._actionConfigs={},this._order=null}var r;return r=[{key:"addMatch",value:function(t,r){if(this._includesMatcherForCombination(t.id)){var e=t.keyEventType,n=t.actionName,o=t.id;this._addHandlerToActionConfig(o,{keyEventType:e,actionName:n,handler:r})}else this._addNewActionConfig(t,r)}},{key:"findMatch",value:function(t,r,e){this._order||this._setOrder();var n=!0,o=!1,s=void 0;try{for(var u,a=this._order[Symbol.iterator]();!(n=(u=a.next()).done);n=!0){var i=u.value,l=this._actionConfigs[i];if(this._matchesActionConfig(t,r,e,l))return l}}catch(t){o=!0,s=t}finally{try{n||null==a.return||a.return()}finally{if(o)throw s}}return null}},{key:"toJSON",value:function(){return{actionConfigs:this._actionConfigs,order:this._order}}},{key:"_matchesActionConfig",value:function(t,r,e,n){if(!function(t,r){var e=Nt(r.keyDictionary);return U.option("allowCombinationSubmatches")||function(t){return!!t.isKeyStillPressed("Meta")&&t.some((function(t){return Xt(t)}))}(t)?t.getNumberOfKeys()>=e:t.getNumberOfKeys()===e}(t,n))return!1;if(!n.events[e])return!1;var o=!1;return Object.keys(n.keyDictionary).every((function(n){return!!t.isEventTriggered(n,e)&&(r&&r===t.getNormalizedKeyName(n)&&(o=!t.wasEventPreviouslyTriggered(n,e)),!0)}))&&o}},{key:"_setOrder",value:function(){var t=Object.values(this._actionConfigs).reduce((function(t,r){var e=r.id,n=r.size;return t[n]||(t[n]=[]),t[n].push(e),t}),{});this._order=Object.keys(t).sort((function(t,r){return r-t})).reduce((function(r,e){return r.concat(t[e])}),[])}},{key:"_addNewActionConfig",value:function(t,r){var e=t.prefix,n=t.sequenceLength,o=t.id,s=t.keyDictionary,u=t.size,a=t.keyEventType,i=t.actionName;this._setCombinationMatcher(o,{prefix:e,sequenceLength:n,id:o,keyDictionary:s,size:u,events:{}}),this._addHandlerToActionConfig(o,{keyEventType:a,actionName:i,handler:r})}},{key:"_addHandlerToActionConfig",value:function(t,r){var e=r.keyEventType,n=r.actionName,o=r.handler,s=this._getCombinationMatcher(t);this._setCombinationMatcher(t,zt({},s,{events:zt({},s.events,Zt({},e,{actionName:n,handler:o}))}))}},{key:"_setCombinationMatcher",value:function(t,r){this._actionConfigs[t]=r}},{key:"_getCombinationMatcher",value:function(t){return this._actionConfigs[t]}},{key:"_includesMatcherForCombination",value:function(t){return!!this._getCombinationMatcher(t)}}],r&&function(t,r){for(var e=0;e<r.length;e++){var n=r[e];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}(t.prototype,r),t}();var Qt=function(){function t(){!function(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}(this,t),this._combinationMatchers={},this._eventRecord=Tt.newRecord()}var r;return(r=[{key:"addMatch",value:function(t,r){this._getOrCreateCombinationMatcher(t.prefix).addMatch(t,r),Tt.setBit(this._eventRecord,t.keyEventType,1),(!this._longestSequence||this._longestSequence<t.sequenceLength)&&(this._longestSequence=t.sequenceLength)}},{key:"findMatch",value:function(t,r,e){var n=this._findCombinationMatcher(t);return n?n.findMatch(t.getCurrentCombination(),t.getCurrentCombination().getNormalizedKeyName(r),e):null}},{key:"hasMatchesForEventType",value:function(t){return!!this._eventRecord[t]}},{key:"getLongestSequence",value:function(){return this._longestSequence}},{key:"toJSON",value:function(){var t=this;return Object.keys(this._combinationMatchers).reduce((function(r,e){var n=t._combinationMatchers[e];return r[e]=n.toJSON(),r}),{})}},{key:"_getOrCreateCombinationMatcher",value:function(t){return this._combinationMatchers[t]||(this._combinationMatchers[t]=new Jt),this._combinationMatchers[t]}},{key:"_findCombinationMatcher",value:function(t){var r=t.getMostRecentCombinations(this.getLongestSequence());if(0===r.length)return this._combinationMatchers[""];for(var e=r.map((function(t){return t.getIds()})),n=e.map((function(t){return t.length})),o=new Array(e.length).fill(0),s=!1;!s;){var u=o.map((function(t,r){return e[r][t]})).join(" ");if(this._combinationMatchers[u])return this._combinationMatchers[u];for(var a=0,i=!0;i&&a<o.length;){var l=(qt(o,a)+1)%(qt(n,a)||1);o[o.length-(a+1)]=l,(i=0===l)&&a++}s=a===o.length}}}])&&function(t,r){for(var e=0;e<r.length;e++){var n=r[e];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}(t.prototype,r),t}();var tr=function(){function t(r){!function(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}(this,t),this._keyMapMatchers=[],this._unmatchedHandlerStatus=[],this._handlersDictionary={},this._keySequencesDictionary={};for(var e=r.getNewIterator();e.next();){var n=e.getComponent().handlers;this._unmatchedHandlerStatus.push([Object.keys(n).length,{}]),this._keyMapMatchers.push(new Qt)}this._componentList=r,this._componentListIterator=r.getNewIterator()}var r;return(r=[{key:"getKeyHistoryMatcher",value:function(t){if(this._componentHasUnmatchedHandlers(t))for(;this._componentListIterator.next();)this._addHandlersFromComponent(),this._addActionsFromComponent();return this._getKeyHistoryMatcher(t)}},{key:"componentHasActionsBoundToEventType",value:function(t,r){return this.getKeyHistoryMatcher(t).hasMatchesForEventType(r)}},{key:"findMatchingKeySequenceInComponent",value:function(t,r,e,n){return this.componentHasActionsBoundToEventType(t,n)?this.getKeyHistoryMatcher(t).findMatch(r,e,n):null}},{key:"_getKeyHistoryMatcher",value:function(t){return this._keyMapMatchers[t]}},{key:"_addActionsFromComponent",value:function(){var t=this,r=this._componentListIterator.getComponent().actions;Object.keys(r).forEach((function(e){var n=t._getHandlers(e);if(n){var o=n[0],s=t._componentList.getAtPosition(o).handlers[e],u=t._getKeyHistoryMatcher(o);r[e].forEach((function(r){var e=[r.prefix,r.id].join(" ");t._isClosestHandlerFound(e,r)||(u.addMatch(r,s),t._addKeySequence(e,[o,r.keyEventType]))})),n.forEach((function(r){var n=t._getUnmatchedHandlerStatus(r);n[1][e]||(n[1][e]=!0,n[0]--)}))}}))}},{key:"_getHandlers",value:function(t){return this._handlersDictionary[t]}},{key:"_addHandlersFromComponent",value:function(){var t=this,r=this._componentListIterator.getComponent().handlers;Object.keys(r).forEach((function(r){t._addHandler(r)}))}},{key:"_addHandler",value:function(t){this._handlersDictionary[t]||(this._handlersDictiona