(self.webpackChunkapp=self.webpackChunkapp||[]).push([[5819],{94062:function(n,r,e){"use strict";e.d(r,{Z:function(){return a}});var t=e(41051),o=e(2968),i=e(85893);function a(n){var r=n.url,e=n.text;return(0,i.jsxs)(o.Z,{external:!0,href:r,children:[(0,i.jsx)(t.Z,{name:"book"})," ",(0,i.jsx)("span",{children:e})]})}},97494:function(n,r,e){"use strict";e.d(r,{Z:function(){return B}});var t=e(45697),o=e.n(t),i=e(93379),a=e.n(i),l=e(7795),c=e.n(l),u=e(90569),s=e.n(u),d=e(3565),p=e.n(d),f=e(19216),A=e.n(f),m=e(44589),b=e.n(m),y=e(33988),h={};h.styleTagTransform=b(),h.setAttributes=p(),h.insert=s().bind(null,"head"),h.domAPI=c(),h.insertStyleElement=A(),a()(y.Z,h);var g=y.Z&&y.Z.locals?y.Z.locals:void 0,v=e(85893);function x(n){return x="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(n){return typeof n}:function(n){return n&&"function"==typeof Symbol&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},x(n)}var C=["validator","required","value"];function E(n,r){var e=Object.keys(n);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(n);r&&(t=t.filter((function(r){return Object.getOwnPropertyDescriptor(n,r).enumerable}))),e.push.apply(e,t)}return e}function j(n){for(var r=1;r=0||(o[e]=n[e]);return o}(n,r);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(n);for(t=0;t=0||Object.prototype.propertyIsEnumerable.call(n,e)&&(o[e]=n[e])}return o}(n,C),l=r(i)||!i&&t&&"cannot be empty";return(0,v.jsxs)("span",{className:g.wrapper,children:[(0,v.jsx)("input",j({type:"text",value:i},a)),l&&(0,v.jsx)("span",{className:g.error,children:l})]})}B.propTypes={value:o().any.isRequired,required:o().bool,validator:o().func}},49443:function(n,r,e){"use strict";e.d(r,{Z:function(){return g}});var t=e(67294),o=e(45697),i=e.n(o),a=e(97494),l={useRaw:i().bool,raw:i().string,parsed:i().any},c={name:i().string.isRequired,labels:i().arrayOf(i().string).isRequired,properties:i().objectOf((function(n,r,e,t,o){try{i().checkPropTypes({propValue:i().shape(l).isRequired},{propValue:n},t,e)}catch(n){return new Error("Invalid prop `"+o+"` supplied to `"+e+"`. Validation failed.")}})).isRequired},u=e(62417),s=e(85893);function d(n){return d="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(n){return typeof n}:function(n){return n&&"function"==typeof Symbol&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},d(n)}function p(n,r){var e=Object.keys(n);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(n);r&&(t=t.filter((function(r){return Object.getOwnPropertyDescriptor(n,r).enumerable}))),e.push.apply(e,t)}return e}function f(n){for(var r=1;rn.length)&&(r=n.length);for(var e=0,t=new Array(r);en.length)&&(r=n.length);for(var e=0,t=new Array(r);e=0||(o[e]=n[e]);return o}(n,r);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(n);for(t=0;t=0||Object.prototype.propertyIsEnumerable.call(n,e)&&(o[e]=n[e])}return o}function H(n,r){var e=Object.keys(n);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(n);r&&(t=t.filter((function(r){return Object.getOwnPropertyDescriptor(n,r).enumerable}))),e.push.apply(e,t)}return e}function q(n){for(var r=1;rn.length)&&(r=n.length);for(var e=0,t=new Array(r);e":on("GT"),"/":on("FSLH"),"?":on("QMARK")};var cn=function(n){var r,e,o=n.onClose,i=(r=(0,t.useState)("Type something..."),e=2,function(n){if(Array.isArray(n))return n}(r)||function(n,r){var e=null==n?null:"undefined"!=typeof Symbol&&n[Symbol.iterator]||n["@@iterator"];if(null!=e){var t,o,i,a,l=[],c=!0,u=!1;try{if(i=(e=e.call(n)).next,0===r){if(Object(e)!==e)return;c=!1}else for(;!(c=(t=i.call(e)).done)&&(l.push(t.value),l.length!==r);c=!0);}catch(n){u=!0,o=n}finally{try{if(!c&&null!=e.return&&(a=e.return(),Object(a)!==a))return}finally{if(u)throw o}}return l}}(r,e)||en(r,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),a=i[0],l=i[1],u=(0,t.useMemo)((function(){return a.split("").reduce((function(n,r){var e=function(n){if(ln[n])return ln[n];var r,e=function(n,r){var e="undefined"!=typeof Symbol&&n[Symbol.iterator]||n["@@iterator"];if(!e){if(Array.isArray(n)||(e=en(n))){e&&(n=e);var t=0,o=function(){};return{s:o,n:function(){return t>=n.length?{done:!0}:{done:!1,value:n[t++]}},e:function(n){throw n},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,l=!1;return{s:function(){e=e.call(n)},n:function(){var n=e.next();return a=n.done,n},e:function(n){l=!0,i=n},f:function(){try{a||null==e.return||e.return()}finally{if(l)throw i}}}}(an);try{for(e.s();!(r=e.n()).done;){var t=r.value,o=t.pattern,i=t.convert;if(n.match(o))return i(n)}}catch(n){e.e(n)}finally{e.f()}}(r);return e&&n.push(e),n}),[])}),[a]),s=(0,rn.NE)(u),d=(0,t.useCallback)((function(n){n&&(n.focus(),n.select())}),[]);return(0,I.jsx)(X.Z,{children:(0,I.jsxs)(Q.Z,{dismissText:!1,children:[(0,I.jsx)("h2",{children:"Create Typing Sequence"}),(0,I.jsx)("p",{children:"Type a message to generate a sequence of bindings in the macro."}),(0,I.jsx)("textarea",{value:a,ref:d,style:{width:"100%",height:"6rem"},onChange:function(n){return l(n.target.value)}}),(0,I.jsx)("div",{className:j.macroBindings,children:s.map((function(n,r){return(0,I.jsx)(t.Fragment,{children:(0,I.jsx)(F.Z,{selectable:!1,themeClass:c()(J.Z.keyDefaultTheme,J.Z.unified),children:(0,I.jsx)($.Z,{node:n.params[0],onSelect:function(){}})})},r)}))}),(0,I.jsxs)("div",{className:j.macroActions,children:[(0,I.jsx)(nn.Z,{onClick:function(){return o(s)},children:"Add to macro"}),(0,I.jsx)(nn.Z,{onClick:function(){return o([])},secondary:!0,children:"Cancel"})]})]})})},un=e(82607),sn=e(41051),dn=e(56803),pn=e(29709),fn=e(80671),An=e(7739),mn=e.n(An),bn=e(35161),yn=e.n(bn),hn=e(44908),gn=e.n(hn),vn=e(95130),xn=e(62412),Cn=e(67998);function En(n){return function(n){if(Array.isArray(n))return wn(n)}(n)||function(n){if("undefined"!=typeof Symbol&&null!=n[Symbol.iterator]||null!=n["@@iterator"])return Array.from(n)}(n)||jn(n)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function jn(n,r){if(n){if("string"==typeof n)return wn(n,r);var e=Object.prototype.toString.call(n).slice(8,-1);return"Object"===e&&n.constructor&&(e=n.constructor.name),"Map"===e||"Set"===e?Array.from(n):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?wn(n,r):void 0}}function wn(n,r){(null==r||r>n.length)&&(r=n.length);for(var e=0,t=new Array(r);e1){var o=mn()(t,"affectedParamIndex");for(var i in o){var a=o[i];a.length>1&&n.push({message:"Multiple substitions to the same binding parameter",affectedBindings:gn()([].concat(En(yn()(a,"controlBindingIndex")),[e]))})}}return n}),[])}(r)),En(function(n,r){return n.reduce((function(n,e){var t,o,i=r[e.affectedBindingIndex];if(i&&0===e.affectedParamIndex){var a,l=(t=xn.baseParametersByCode[i.value]||[],o=1,function(n){if(Array.isArray(n))return n}(t)||function(n,r){var e=null==n?null:"undefined"!=typeof Symbol&&n[Symbol.iterator]||n["@@iterator"];if(null!=e){var t,o,i,a,l=[],c=!0,u=!1;try{if(i=(e=e.call(n)).next,0===r){if(Object(e)!==e)return;c=!1}else for(;!(c=(t=i.call(e)).done)&&(l.push(t.value),l.length!==r);c=!0);}catch(n){u=!0,o=n}finally{try{if(!c&&null!=e.return&&(a=e.return(),Object(a)!==a))return}finally{if(u)throw o}}return l}}(t,o)||jn(t,o)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())[0];(null==l||null===(a=l.enum)||void 0===a?void 0:a.some((function(n){return n.additionalParams})))&&n.push({message:"Parameter assignment may affect additional parameters",affectedBindings:[e.affectedBindingIndex]})}return n}),[])}(r,n)))}),[r,n])}function On(n){var r=n.bindings,e=n.onHighlight,t=Sn(r);return 0===t.length?null:(0,I.jsxs)("div",{className:j.parameterWarnings,children:[(0,I.jsx)("p",{children:(0,I.jsx)("strong",{children:"Warnings"})}),(0,I.jsx)("ul",{children:t.map((function(n,r){return(0,I.jsxs)("li",{children:[(0,I.jsx)(sn.Z,{name:"search",className:j.warningHighlightIcon,onMouseEnter:function(){return e(n.affectedBindings)},onMouseLeave:function(){return e([])}})," ",(0,I.jsx)("span",{className:j.message,children:n.message})]},r)}))})]})}function kn(n){return kn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(n){return typeof n}:function(n){return n&&"function"==typeof Symbol&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},kn(n)}function In(n){return function(n){if(Array.isArray(n))return Tn(n)}(n)||function(n){if("undefined"!=typeof Symbol&&null!=n[Symbol.iterator]||null!=n["@@iterator"])return Array.from(n)}(n)||Zn(n)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Pn(n,r,e){return(r=function(n){var r=function(n,r){if("object"!==kn(n)||null===n)return n;var e=n[Symbol.toPrimitive];if(void 0!==e){var t=e.call(n,"string");if("object"!==kn(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(n)}(n);return"symbol"===kn(r)?r:String(r)}(r))in n?Object.defineProperty(n,r,{value:e,enumerable:!0,configurable:!0,writable:!0}):n[r]=e,n}function Dn(n,r){return function(n){if(Array.isArray(n))return n}(n)||function(n,r){var e=null==n?null:"undefined"!=typeof Symbol&&n[Symbol.iterator]||n["@@iterator"];if(null!=e){var t,o,i,a,l=[],c=!0,u=!1;try{if(i=(e=e.call(n)).next,0===r){if(Object(e)!==e)return;c=!1}else for(;!(c=(t=i.call(e)).done)&&(l.push(t.value),l.length!==r);c=!0);}catch(n){u=!0,o=n}finally{try{if(!c&&null!=e.return&&(a=e.return(),Object(a)!==a))return}finally{if(u)throw o}}return l}}(n,r)||Zn(n,r)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Zn(n,r){if(n){if("string"==typeof n)return Tn(n,r);var e=Object.prototype.toString.call(n).slice(8,-1);return"Object"===e&&n.constructor&&(e=n.constructor.name),"Map"===e||"Set"===e?Array.from(n):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?Tn(n,r):void 0}}function Tn(n,r){(null==r||r>n.length)&&(r=n.length);for(var e=0,t=new Array(r);en.length)&&(r=n.length);for(var e=0,t=new Array(r);en.length)&&(r=n.length);for(var e=0,t=new Array(r);en.length)&&(r=n.length);for(var e=0,t=new Array(r);e"},bindings:{parsed:[{value:"&none",params:[]}],raw:"&none"}}}}(l))}),[l,o]),d=(0,zn.zq)(l);return(0,I.jsx)(X.Z,{onDismiss:i,children:(0,I.jsxs)(Q.Z,{dismissText:null,children:[(0,I.jsx)("h3",{children:"Add new macro"}),(0,I.jsx)("div",{children:(0,I.jsxs)("label",{children:["Macro name: ",(0,I.jsx)(Xn.Z,{required:!0,value:l,validator:zn.zq,onChange:u})]})}),(0,I.jsx)("p",{children:(0,I.jsxs)("em",{children:["This value will be used for binding the macro's actions in your keymap (e.g. ",(0,I.jsxs)("code",{children:["&",l]}),") and should be unique. It will also be used internally for the node name and label property, which you can customize later."]})}),(0,I.jsxs)("div",{style:{textAlign:"center",margin:"10px"},children:[(0,I.jsx)(nn.Z,{disabled:!l||d,onClick:s,children:"Create"}),(0,I.jsx)(nn.Z,{onClick:i,secondary:!0,children:"Cancel"})]})]})})}Fn.propTypes={onCreate:a().func.isRequired,onCancel:a().func.isRequired};var Jn=e(2968);function $n(n,r){(null==r||r>n.length)&&(r=n.length);for(var e=0,t=new Array(r);en.length)&&(r=n.length);for(var e=0,t=new Array(r);e * {\n margin: 5px;\n}\n\n.TBgT7nB7JSSjnTpMQeXp {\n position: relative;\n width: 450px;\n /* border: 1px solid lightgray; */\n margin: 0 auto;\n padding: 5px;\n\n display: flex;\n flex-wrap: wrap;\n}\n\n.TBgT7nB7JSSjnTpMQeXp > * {\n margin: 5px;\n width: 65px;\n height: 65px;\n}\n\n.YMJbsLvnEGObUy4Y_i6w {\n width: 100%;\n height: 30px;\n box-sizing: border-box;\n}\n.YMJbsLvnEGObUy4Y_i6w:hover {\n background-color: var(--hover-selection);\n color: var(--key-color-hover);\n}\n.YMJbsLvnEGObUy4Y_i6w > :first-child {\n width: 100% !important;\n height: 100% !important;\n}\n\n.TBgT7nB7JSSjnTpMQeXp [draggable] {\n cursor: grab;\n}\n\n.I5drc4dA5Kpshp3PPle1 {\n visibility: hidden;\n position: absolute;\n top: 0px;\n right: 0px;\n font-size: 80%;\n\n color: var(--key-color-hover);\n}\n.I5drc4dA5Kpshp3PPle1 > * {\n margin: 2px;\n opacity: 0.5;\n cursor: pointer;\n}\n.TBgT7nB7JSSjnTpMQeXp :hover .I5drc4dA5Kpshp3PPle1 {\n visibility: visible;\n z-index: 10;\n}\n\n.I5drc4dA5Kpshp3PPle1 :hover {\n opacity: 1;\n}\n\n\n.iD9DsKMZZ1dQxr04488w {\n margin: 10px 0;\n display: flex;\n}\n\n.iD9DsKMZZ1dQxr04488w label {\n display: inline-block;\n width: 120px;\n text-align: right;\n margin-right: 10px;\n}\n\n.quGO7XFPrHoYiqu22mwg {\n font-size: 80%;\n}\n\n.ziS4tbh9X5RXMVKil0ZJ {\n width: 450px;\n margin: 0 auto;\n}\n.ziS4tbh9X5RXMVKil0ZJ .e5WrxtOt36BgXq_LJJSL {\n color: indianred\n}\n\n.BP90__cBSejXKVP6ojjM {\n cursor: pointer;\n}\n\n.Lvxxm3_prm2iJ0zIfRNq {\n outline: 2px solid crimson;\n}\n","",{version:3,sources:["webpack://./src/Keyboard/Macros/styles.module.css"],names:[],mappings:"AAAA;EACE,oBAAoB;AACtB;;AAEA;EACE,YAAY;EACZ,gBAAgB;AAClB;AACA;EACE,kBAAkB;EAClB,gBAAgB;EAChB,iBAAiB;EACjB,wCAAwC;AAC1C;;AAEA;EACE,YAAY;EACZ,sBAAsB;AACxB;AACA;EACE,aAAa;EACb,kBAAkB;EAClB,8BAA8B;EAC9B,2CAA2C;EAC3C,aAAa;AACf;AACA;EACE,SAAS;EACT,eAAe;AACjB;AACA;EACE,eAAe;EACf,YAAY;EACZ,YAAY;AACd;AACA;EACE,UAAU;AACZ;AACA;EACE,oBAAoB;AACtB;;AAEA;EACE,kBAAkB;AACpB;AACA;EACE,WAAW;AACb;;AAEA;EACE,kBAAkB;EAClB,YAAY;EACZ,iCAAiC;EACjC,cAAc;EACd,YAAY;;EAEZ,aAAa;EACb,eAAe;AACjB;;AAEA;EACE,WAAW;EACX,WAAW;EACX,YAAY;AACd;;AAEA;EACE,WAAW;EACX,YAAY;EACZ,sBAAsB;AACxB;AACA;EACE,wCAAwC;EACxC,6BAA6B;AAC/B;AACA;EACE,sBAAsB;EACtB,uBAAuB;AACzB;;AAEA;EACE,YAAY;AACd;;AAEA;EACE,kBAAkB;EAClB,kBAAkB;EAClB,QAAQ;EACR,UAAU;EACV,cAAc;;EAEd,6BAA6B;AAC/B;AACA;EACE,WAAW;EACX,YAAY;EACZ,eAAe;AACjB;AACA;EACE,mBAAmB;EACnB,WAAW;AACb;;AAEA;EACE,UAAU;AACZ;;;AAGA;EACE,cAAc;EACd,aAAa;AACf;;AAEA;EACE,qBAAqB;EACrB,YAAY;EACZ,iBAAiB;EACjB,kBAAkB;AACpB;;AAEA;EACE,cAAc;AAChB;;AAEA;EACE,YAAY;EACZ,cAAc;AAChB;AACA;EACE;AACF;;AAEA;EACE,eAAe;AACjB;;AAEA;EACE,0BAA0B;AAC5B",sourcesContent:[".main {\n padding-bottom: 60px;\n}\n\n.header, .footer {\n width: 550px;\n margin: 1px auto;\n}\n.footer {\n text-align: center;\n margin-top: 10px;\n padding-top: 20px;\n border-top: 2px solid var(--key-bg-base);\n}\n\n.macro {\n width: 550px;\n margin: 10px auto 40px;\n}\n.heading {\n display: flex;\n position: relative;\n justify-content: space-between;\n border-bottom: 2px solid var(--key-bg-base);\n margin: 5px 0;\n}\n.heading h5 {\n margin: 0;\n cursor: pointer;\n}\n.action {\n cursor: pointer;\n padding: 5px;\n opacity: 0.6;\n}\n.action:hover {\n opacity: 1;\n}\n.remove {\n color: var(--delete);\n}\n\n.macroActions {\n text-align: center;\n}\n.macroActions > * {\n margin: 5px;\n}\n\n.macroBindings {\n position: relative;\n width: 450px;\n /* border: 1px solid lightgray; */\n margin: 0 auto;\n padding: 5px;\n\n display: flex;\n flex-wrap: wrap;\n}\n\n.macroBindings > * {\n margin: 5px;\n width: 65px;\n height: 65px;\n}\n\n.controlBinding {\n width: 100%;\n height: 30px;\n box-sizing: border-box;\n}\n.controlBinding:hover {\n background-color: var(--hover-selection);\n color: var(--key-color-hover);\n}\n.controlBinding > :first-child {\n width: 100% !important;\n height: 100% !important;\n}\n\n.macroBindings [draggable] {\n cursor: grab;\n}\n\n.actions {\n visibility: hidden;\n position: absolute;\n top: 0px;\n right: 0px;\n font-size: 80%;\n\n color: var(--key-color-hover);\n}\n.actions > * {\n margin: 2px;\n opacity: 0.5;\n cursor: pointer;\n}\n.macroBindings :hover .actions {\n visibility: visible;\n z-index: 10;\n}\n\n.actions :hover {\n opacity: 1;\n}\n\n\n.field {\n margin: 10px 0;\n display: flex;\n}\n\n.field label {\n display: inline-block;\n width: 120px;\n text-align: right;\n margin-right: 10px;\n}\n\n.betaDisclaimer {\n font-size: 80%;\n}\n\n.parameterWarnings {\n width: 450px;\n margin: 0 auto;\n}\n.parameterWarnings .message {\n color: indianred\n}\n\n.warningHighlightIcon {\n cursor: pointer;\n}\n\n.bindingWarningHighlight {\n outline: 2px solid crimson;\n}\n"],sourceRoot:""}]),a.locals={main:"kc8Au327pmIjKO7auLXT",header:"iNHvhyaEJ4ILoK0oc97e",footer:"QSl4rRImPNo_Abu68kKW",macro:"Us3Ihf0AoVbZvDulP74Q",heading:"OVI4IkVsVzyk0eIAn9NX",action:"QNlSO_GSGhRfUFRE_v8E",remove:"DvzBwGDH7HsnnIbqaeHi",macroActions:"mwhR_W7iqHq803xNBV1H",macroBindings:"TBgT7nB7JSSjnTpMQeXp",controlBinding:"YMJbsLvnEGObUy4Y_i6w",actions:"I5drc4dA5Kpshp3PPle1",field:"iD9DsKMZZ1dQxr04488w",betaDisclaimer:"quGO7XFPrHoYiqu22mwg",parameterWarnings:"ziS4tbh9X5RXMVKil0ZJ",message:"e5WrxtOt36BgXq_LJJSL",warningHighlightIcon:"BP90__cBSejXKVP6ojjM",bindingWarningHighlight:"Lvxxm3_prm2iJ0zIfRNq"},r.Z=a},45652:function(n,r,e){var t=e(88668),o=e(47443),i=e(1196),a=e(74757),l=e(23593),c=e(21814);n.exports=function(n,r,e){var u=-1,s=o,d=n.length,p=!0,f=[],A=f;if(e)p=!1,s=i;else if(d>=200){var m=r?null:l(n);if(m)return c(m);p=!1,s=a,A=new t}else A=r?[]:f;n:for(;++u