1
2
|
/*! For license information please see 9657.dfa7b893a137cdab396d.js.LICENSE.txt */
(self.webpackChunkapp=self.webpackChunkapp||[]).push([[9657],{80460:function(t,e,r){var n=r(58354),o=r(80351);t.exports=function(t){return"number"==typeof t||o(t)&&"[object Number]"==n(t)}},27926:function(t,e,r){"use strict";r.d(e,{Z:function(){return k}});var n=r(93379),o=r.n(n),i=r(7795),a=r.n(i),c=r(90569),u=r.n(c),l=r(3565),s=r.n(l),f=r(19216),d=r.n(f),p=r(44589),y=r.n(p),h=r(56281),v={};v.styleTagTransform=y(),v.setAttributes=s(),v.insert=u().bind(null,"head"),v.domAPI=a(),v.insertStyleElement=d(),o()(h.Z,v);var m=h.Z&&h.Z.locals?h.Z.locals:void 0,b=r(85893);function g(t){return g="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},g(t)}var w=["children","secondary","className"];function j(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function x(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?j(Object(r),!0).forEach((function(e){O(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):j(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function O(t,e,r){return(e=function(t){var e=function(t,e){if("object"!==g(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!==g(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"===g(e)?e:String(e)}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function S(t){var e=t.children,r=t.secondary,n=t.className,o=function(t,e){if(null==t)return{};var r,n,o=function(t,e){if(null==t)return{};var r,n,o={},i=Object.keys(t);for(n=0;n<i.length;n++)r=i[n],e.indexOf(r)>=0||(o[r]=t[r]);return o}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(n=0;n<i.length;n++)r=i[n],e.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(t,r)&&(o[r]=t[r])}return o}(t,w);return(0,b.jsx)("button",x(x({className:[n,m.action,r&&m.secondary].join(" ")},o),{},{children:e}))}S.defaultProps={className:""};var k=S},62928:function(t,e,r){"use strict";r.r(e),r.d(e,{ClipboardPicker:function(){return fe},default:function(){return pe}});var n=r(50361),o=r.n(n),i=r(67294),a=r(97168),c=r(85893);function u(t){return u="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},u(t)}function l(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function s(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?l(Object(r),!0).forEach((function(e){f(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):l(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function f(t,e,r){return(e=function(t){var e=function(t,e){if("object"!==u(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!==u(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"===u(e)?e:String(e)}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function d(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,c=[],u=!0,l=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(c.push(n.value),c.length!==e);u=!0);}catch(t){l=!0,o=t}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw o}}return c}}(t,e)||function(t,e){if(t){if("string"==typeof t)return p(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?p(t,e):void 0}}(t,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.")}()}function p(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var y="keymap_editor_clipboard_slots",h="".concat(y,":"),v="keymap_editor_clipboard_selected_slot",m=JSON.stringify({keyboardId:null,isCustom:!0,keymap:null,keymapRaw:'/ {\n keymap {\n compatible = "zmk,keymap";\n };\n};\n',metadata:null,metadataRaw:""});function b(){var t,e=JSON.parse(localStorage.getItem(v)||"null"),r=JSON.parse(localStorage.getItem(y)||"[]"),n=e||(null===(t=r[0])||void 0===t?void 0:t.id),o=JSON.parse(localStorage.getItem("".concat(h).concat(n))||"null"),i=(null==o?void 0:o.keyboardId)||"custom",a=(null==o?void 0:o.isCustom)||"custom"===i,c=null==o?void 0:o.keymap,u=null==o?void 0:o.keymapRaw;return{keyboards:r,selectedKeyboard:n,modalOpen:!u,feedbackModalOpen:!1,selection:{keyboardId:i,isCustom:a,keymap:c,keymapRaw:u,metadata:null==o?void 0:o.metadata,metadataRaw:null==o?void 0:o.metadataRaw},pending:{}}}var g=(0,a.oM)({name:"clipboard-picker",initialState:b,reducers:{selectedKeyboard:function(t,e){t.selectedKeyboard=e.payload.keyboard;var r="".concat(h).concat(t.selectedKeyboard);t.selection=JSON.parse(localStorage.getItem(r)||m),localStorage.setItem(v,JSON.stringify(t.selectedKeyboard))},addKeyboard:function(t,e){var r=e.payload,n=r.id,o=r.name,i={id:n,name:void 0===o?null:o};t.keyboards.push(i),localStorage.setItem(y,JSON.stringify(t.keyboards)),localStorage.setItem("".concat(h).concat(n),m)},removedKeyboard:function(t,e){var r=e.payload.id,n=t.keyboards.findIndex((function(t){return t.id===r}));-1!==n&&(t.keyboards.splice(n,1),localStorage.setItem(y,JSON.stringify(t.keyboards)),localStorage.removeItem("".concat(h).concat(r)))},setKeymap:function(t,e){var r=e.payload,n=r.raw,i=r.parsed,a=r.pending,c=void 0!==a&&a;t.pending||(t.pending=o()(t.selection)),t.pending.keymap=i,t.pending.keymapRaw=n,c||(t.selection.keymap=i,t.selection.keymapRaw=n)},setMetadata:function(t,e){var r=e.payload,n=r.keyboardId,i=r.isCustom,a=void 0!==i&&i,c=r.raw,u=r.parsed,l=r.pending,s=void 0!==l&&l;s&&!t.pending&&(t.pending=o()(t.selection));var f=s?t.pending:t.selection;f.keyboardId=n||f.keyboardId,f.isCustom=a,f.metadata=u,f.metadataRaw=c},confirmPending:function(t){t.selection=t.pending,t.pending=null,t.selectedKeyboard||(t.selectedKeyboard=Date.now());var e="".concat(h).concat(t.selectedKeyboard);localStorage.setItem(e,JSON.stringify(t.selection)),t.keyboards.length||t.keyboards.push({id:t.selectedKeyboard});var r=t.keyboards.find((function(e){return e.id===t.selectedKeyboard}));r.name||(r.name=t.selection.metadata.name,localStorage.setItem(y,JSON.stringify(t.keyboards)))},openModal:function(t){if(t.modalOpen=!0,t.pending=t.selection,t.pending.metadataRaw&&!t.pending.metadata)try{t.pending.metadata=JSON.parse(t.pending.metadataRaw)}catch(t){}},closeModal:function(t){t.modalOpen=!1},openFeedbackModal:function(t){t.feedbackModalOpen=!0},closeFeedbackModal:function(t){t.feedbackModalOpen=!1}}});var w=(0,i.createContext)([{},{}]);function j(t){var e=t.children,r=d(function(){var t,e=d((0,i.useReducer)(g.reducer,null,b),2),r=e[0],n=(t=e[1],(0,i.useMemo)((function(){return Object.keys(g.actions).reduce((function(e,r){return e[r]=function(){var e;return t((e=g.actions)[r].apply(e,arguments))},e}),{})}),[t]));return[r,n]}(),2),n=r[0],o=r[1];return(0,c.jsx)(w.Provider,{value:[n,o],children:e})}var x=r(93379),O=r.n(x),S=r(7795),k=r.n(S),E=r(90569),P=r.n(E),L=r(3565),_=r.n(L),I=r(19216),A=r.n(I),C=r(44589),N=r.n(C),T=r(8153),F={};F.styleTagTransform=N(),F.setAttributes=_(),F.insert=P().bind(null,"head"),F.domAPI=k(),F.insertStyleElement=A(),O()(T.Z,F);var D=T.Z&&T.Z.locals?T.Z.locals:void 0,M=r(41051);function G(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function K(){var t=function(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,c=[],u=!0,l=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(c.push(n.value),c.length!==e);u=!0);}catch(t){l=!0,o=t}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw o}}return c}}(t,e)||function(t,e){if(t){if("string"==typeof t)return G(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?G(t,e):void 0}}(t,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.")}()}((0,i.useContext)(w),2)[1].openFeedbackModal;return(0,c.jsxs)("button",{onClick:t,children:[(0,c.jsx)(M.Z,{name:"comments"})," Feedback?"]})}var Z=r(69247),U=r(18446),z=r.n(U),J=r(95998),Y=r(83858),R=r.n(Y),B=r(33295),q=r.n(B),$=r(41696);function H(t){return H="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},H(t)}function V(){V=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n=Object.defineProperty||function(t,e,r){t[e]=r.value},o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag";function u(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,r){return t[e]=r}}function l(t,e,r,o){var i=e&&e.prototype instanceof d?e:d,a=Object.create(i.prototype),c=new k(o||[]);return n(a,"_invoke",{value:j(t,r,c)}),a}function s(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=l;var f={};function d(){}function p(){}function y(){}var h={};u(h,i,(function(){return this}));var v=Object.getPrototypeOf,m=v&&v(v(E([])));m&&m!==e&&r.call(m,i)&&(h=m);var b=y.prototype=d.prototype=Object.create(h);function g(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function w(t,e){function o(n,i,a,c){var u=s(t[n],t,i);if("throw"!==u.type){var l=u.arg,f=l.value;return f&&"object"==H(f)&&r.call(f,"__await")?e.resolve(f.__await).then((function(t){o("next",t,a,c)}),(function(t){o("throw",t,a,c)})):e.resolve(f).then((function(t){l.value=t,a(l)}),(function(t){return o("throw",t,a,c)}))}c(u.arg)}var i;n(this,"_invoke",{value:function(t,r){function n(){return new e((function(e,n){o(t,r,e,n)}))}return i=i?i.then(n,n):n()}})}function j(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return{value:void 0,done:!0}}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var c=x(a,r);if(c){if(c===f)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var u=s(t,e,r);if("normal"===u.type){if(n=r.done?"completed":"suspendedYield",u.arg===f)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(n="completed",r.method="throw",r.arg=u.arg)}}}function x(t,e){var r=e.method,n=t.iterator[r];if(void 0===n)return e.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=void 0,x(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),f;var o=s(n,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,f;var i=o.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,f):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,f)}function O(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function S(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function k(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(O,this),this.reset(!0)}function E(t){if(t){var e=t[i];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,o=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return o.next=o}}return{next:P}}function P(){return{value:void 0,done:!0}}return p.prototype=y,n(b,"constructor",{value:y,configurable:!0}),n(y,"constructor",{value:p,configurable:!0}),p.displayName=u(y,c,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===p||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,y):(t.__proto__=y,u(t,c,"GeneratorFunction")),t.prototype=Object.create(b),t},t.awrap=function(t){return{__await:t}},g(w.prototype),u(w.prototype,a,(function(){return this})),t.AsyncIterator=w,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new w(l(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},g(b),u(b,c,"Generator"),u(b,i,(function(){return this})),u(b,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},t.values=E,k.prototype={constructor:k,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(S),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var c=r.call(i,"catchLoc"),u=r.call(i,"finallyLoc");if(c&&u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(c){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,f):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),f},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),S(r),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;S(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:E(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},t}function Q(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}function W(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){Q(i,n,o,a,c,"next",t)}function c(t){Q(i,n,o,a,c,"throw",t)}a(void 0)}))}}function X(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var tt=function(t){var e;return null===(e=t.keyboard)||void 0===e?void 0:e.keymap},et=function(t){return t.experimentalSettings};function rt(t){return rt="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},rt(t)}function nt(){nt=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n=Object.defineProperty||function(t,e,r){t[e]=r.value},o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag";function u(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,r){return t[e]=r}}function l(t,e,r,o){var i=e&&e.prototype instanceof d?e:d,a=Object.create(i.prototype),c=new k(o||[]);return n(a,"_invoke",{value:j(t,r,c)}),a}function s(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=l;var f={};function d(){}function p(){}function y(){}var h={};u(h,i,(function(){return this}));var v=Object.getPrototypeOf,m=v&&v(v(E([])));m&&m!==e&&r.call(m,i)&&(h=m);var b=y.prototype=d.prototype=Object.create(h);function g(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function w(t,e){function o(n,i,a,c){var u=s(t[n],t,i);if("throw"!==u.type){var l=u.arg,f=l.value;return f&&"object"==rt(f)&&r.call(f,"__await")?e.resolve(f.__await).then((function(t){o("next",t,a,c)}),(function(t){o("throw",t,a,c)})):e.resolve(f).then((function(t){l.value=t,a(l)}),(function(t){return o("throw",t,a,c)}))}c(u.arg)}var i;n(this,"_invoke",{value:function(t,r){function n(){return new e((function(e,n){o(t,r,e,n)}))}return i=i?i.then(n,n):n()}})}function j(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return{value:void 0,done:!0}}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var c=x(a,r);if(c){if(c===f)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var u=s(t,e,r);if("normal"===u.type){if(n=r.done?"completed":"suspendedYield",u.arg===f)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(n="completed",r.method="throw",r.arg=u.arg)}}}function x(t,e){var r=e.method,n=t.iterator[r];if(void 0===n)return e.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=void 0,x(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),f;var o=s(n,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,f;var i=o.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,f):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,f)}function O(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function S(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function k(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(O,this),this.reset(!0)}function E(t){if(t){var e=t[i];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,o=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return o.next=o}}return{next:P}}function P(){return{value:void 0,done:!0}}return p.prototype=y,n(b,"constructor",{value:y,configurable:!0}),n(y,"constructor",{value:p,configurable:!0}),p.displayName=u(y,c,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===p||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,y):(t.__proto__=y,u(t,c,"GeneratorFunction")),t.prototype=Object.create(b),t},t.awrap=function(t){return{__await:t}},g(w.prototype),u(w.prototype,a,(function(){return this})),t.AsyncIterator=w,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new w(l(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},g(b),u(b,c,"Generator"),u(b,i,(function(){return this})),u(b,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},t.values=E,k.prototype={constructor:k,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(S),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var c=r.call(i,"catchLoc"),u=r.call(i,"finallyLoc");if(c&&u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(c){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,f):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),f},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),S(r),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;S(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:E(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},t}function ot(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}function it(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){ot(i,n,o,a,c,"next",t)}function c(t){ot(i,n,o,a,c,"throw",t)}a(void 0)}))}}function at(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function ct(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?at(Object(r),!0).forEach((function(e){ut(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):at(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function ut(t,e,r){return(e=function(t){var e=function(t,e){if("object"!==rt(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!==rt(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"===rt(e)?e:String(e)}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function lt(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,c=[],u=!0,l=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(c.push(n.value),c.length!==e);u=!0);}catch(t){l=!0,o=t}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw o}}return c}}(t,e)||function(t,e){if(t){if("string"==typeof t)return st(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?st(t,e):void 0}}(t,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.")}()}function st(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function ft(){var t,e,r,n,a,u,l=lt((t=(0,J.v9)(tt),e=(0,J.v9)(et).enableBehaviorEditing,r=void 0!==e&&e,n=function(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,c=[],u=!0,l=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(c.push(n.value),c.length!==e);u=!0);}catch(t){l=!0,o=t}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw o}}return c}}(t,e)||function(t,e){if(t){if("string"==typeof t)return X(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?X(t,e):void 0}}(t,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.")}()}((0,i.useContext)(w),2),a=n[0].selection,u=n[1],[(0,i.useMemo)((function(){return t&&a.keymap&&!z()(t,a.keymap)}),[t,a.keymap]),(0,i.useCallback)(W(V().mark((function e(){var n,i,c,l,s,f,d;return V().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=a.metadata.layouts,i=t.chosen["zmk,matrix_transform"]?t.chosen["zmk,matrix_transform"].replace(/^&/,""):null,c=Object.keys(n)[0],l=n[i]||n[c],s=l.layout,e.prev=4,e.next=7,R()(s,o()(t),a.keymapRaw,{enableBehaviorEditing:r});case 7:return f=e.sent,e.next=10,q()(f);case 10:return d=e.sent,(0,$.u)(d),u.setKeymap({raw:f,parsed:d}),e.abrupt("return",f);case 16:throw e.prev=16,e.t0=e.catch(4),console.error("Failed to update/parse",t),console.error(e.t0),e.t0;case 21:case"end":return e.stop()}}),e,null,[[4,16]])}))),[t,a,u,r])]),2),s={updateNeeded:l[0],update:l[1]};return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(dt,ct({},s)),(0,c.jsx)(pt,ct({},s)),(0,c.jsx)(K,{})]})}function dt(t){var e=t.updateNeeded,r=t.update,n=lt((0,i.useContext)(w),2),o=n[0].selectedKeyboard,a=n[1].openModal,u=(0,i.useCallback)(it(nt().mark((function t(){return nt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!e){t.next=3;break}return t.next=3,r();case 3:a();case 4:case"end":return t.stop()}}),t)}))),[a,r,e]);if(o)return(0,c.jsx)(Z.zx,{onClick:u,title:"View/update keymap code",children:"Keymap"})}function pt(t){var e=t.updateNeeded,r=t.update,n=e?"Copy updated keymap":"No changes",o=lt((0,i.useContext)(w),1)[0].selection,a=lt((0,i.useState)(!1),2),u=a[0],l=a[1],s=(0,i.useCallback)(it(nt().mark((function t(){var e;return nt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,r();case 3:return e=t.sent,t.next=6,navigator.clipboard.writeText(e);case 6:l(!0),setTimeout((function(){return l(!1)}),1500),t.next=14;break;case 10:t.prev=10,t.t0=t.catch(0),console.error("Clipboard write failed"),console.log(t.t0);case 14:case"end":return t.stop()}}),t,null,[[0,10]])}))),[r]);return o.keymap?(0,c.jsx)(Z.zx,{title:n,disabled:!e,className:D.copyButton,onClick:s,"data-show-copied":u,children:(0,c.jsx)(M.Z,{name:e?"clipboard-list":"clipboard-check"})}):null}var yt=r(27926),ht=r(96186),vt=r(64261),mt=r(2968),bt=r(80031);function gt(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var wt=(0,c.jsx)(mt.Z,{external:!0,href:"https://github.com/nickcoutsos/keymap-editor/discussions/105",children:"Feature Discussion"});function jt(){var t=function(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,c=[],u=!0,l=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(c.push(n.value),c.length!==e);u=!0);}catch(t){l=!0,o=t}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw o}}return c}}(t,e)||function(t,e){if(t){if("string"==typeof t)return gt(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?gt(t,e):void 0}}(t,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.")}()}((0,i.useContext)(w),2)[1].closeFeedbackModal;return(0,c.jsx)(vt.Z,{onDismiss:t,children:(0,c.jsxs)(ht.Z,{dismissText:null,children:[(0,c.jsx)("h2",{children:"Beta Feedback"}),(0,c.jsx)("p",{children:"Hey, feel free to ignore this!"}),(0,c.jsx)("p",{children:"I just launched this feature very quickly, I hope it's working well for you! Your feedback, if you can spare a moment, would be immensely helpful to me. This feature is completely browser-based which means I have no server analytics, so even just letting me know that it worked would be cool!"}),(0,c.jsx)("p",{children:"Good ways to contact me:"}),(0,c.jsxs)("ul",{children:[(0,c.jsxs)("li",{children:["Ping me at ",bt.W8]}),(0,c.jsxs)("li",{children:["File an issue at ",bt.qM]}),(0,c.jsxs)("li",{children:["Join the ",wt]})]}),(0,c.jsx)("div",{style:{textAlign:"center"},children:(0,c.jsx)(yt.Z,{onClick:t,children:"Back to editor"})})]})})}function xt(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function Ot(){var t=function(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,c=[],u=!0,l=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(c.push(n.value),c.length!==e);u=!0);}catch(t){l=!0,o=t}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw o}}return c}}(t,e)||function(t,e){if(t){if("string"==typeof t)return xt(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?xt(t,e):void 0}}(t,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.")}()}((0,i.useContext)(w),2)[1],e=t.selectedKeyboard,r=t.addKeyboard,n=t.openModal,o=(0,i.useCallback)((function(){var t=Date.now();r({id:t}),e({keyboard:t}),n()}),[r,e,n]);return(0,c.jsxs)("button",{onClick:o,children:[(0,c.jsx)(M.Z,{name:"gear"})," Add Keyboard"]})}function St(t){return St="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},St(t)}function kt(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function Et(t,e,r){return(e=function(t){var e=function(t,e){if("object"!==St(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!==St(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"===St(e)?e:String(e)}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Pt(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,c=[],u=!0,l=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(c.push(n.value),c.length!==e);u=!0);}catch(t){l=!0,o=t}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw o}}return c}}(t,e)||function(t,e){if(t){if("string"==typeof t)return Lt(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Lt(t,e):void 0}}(t,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.")}()}function Lt(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function _t(){var t=Pt((0,i.useContext)(w),2),e=t[0],r=e.keyboards,n=e.selectedKeyboard,o=t[1].selectedKeyboard,a=(0,i.useMemo)((function(){return r.find((function(t){return t.id===n}))}),[r,n]),u=(0,i.useCallback)((function(t){o({keyboard:t.id})}),[o]);return 0===r.length?(0,c.jsx)(Ot,{}):(0,c.jsx)(Z.Ph,{value:a,options:r,onChange:u,getOptionLabel:function(t){return t.name||"<unnamed>"},getOptionValue:function(t){return t.id},formatOptionLabel:It,children:(0,c.jsx)(Ot,{})})}function It(t,e){var r=e.context,n=t.name||(0,c.jsx)("em",{children:"[unnamed]"});return"value"===r?n:(0,c.jsx)(At,function(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?kt(Object(r),!0).forEach((function(e){Et(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):kt(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}({},t))}function At(t){var e=t.id,r=t.name,n=Pt((0,i.useContext)(w),2),o=n[0],a=o.keyboards,u=o.selectedKeyboard,l=n[1],s=l.selectedKeyboard,f=l.removedKeyboard,d=(0,i.useCallback)((function(t){t.stopPropagation();var n='Remove "'.concat(r,'"? This operation cannot be undone.'),o=e===u,i=a.find((function(t){return t.id!==e}));window.confirm(n)&&(o&&i&&s({keyboard:i.id}),f({id:e}))}),[e,r,a,u,s,f]);return(0,c.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",gap:"10px",alignItems:"middle"},children:[r," ",(0,c.jsx)(M.Z,{title:"Delete keyboard",name:"times-circle",style:{cursor:"pointer",fontSize:"80%"},onClick:d})]})}function Ct(t){return Ct="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},Ct(t)}var Nt=["value","onChange"];function Tt(){Tt=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n=Object.defineProperty||function(t,e,r){t[e]=r.value},o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag";function u(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,r){return t[e]=r}}function l(t,e,r,o){var i=e&&e.prototype instanceof d?e:d,a=Object.create(i.prototype),c=new k(o||[]);return n(a,"_invoke",{value:j(t,r,c)}),a}function s(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=l;var f={};function d(){}function p(){}function y(){}var h={};u(h,i,(function(){return this}));var v=Object.getPrototypeOf,m=v&&v(v(E([])));m&&m!==e&&r.call(m,i)&&(h=m);var b=y.prototype=d.prototype=Object.create(h);function g(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function w(t,e){function o(n,i,a,c){var u=s(t[n],t,i);if("throw"!==u.type){var l=u.arg,f=l.value;return f&&"object"==Ct(f)&&r.call(f,"__await")?e.resolve(f.__await).then((function(t){o("next",t,a,c)}),(function(t){o("throw",t,a,c)})):e.resolve(f).then((function(t){l.value=t,a(l)}),(function(t){return o("throw",t,a,c)}))}c(u.arg)}var i;n(this,"_invoke",{value:function(t,r){function n(){return new e((function(e,n){o(t,r,e,n)}))}return i=i?i.then(n,n):n()}})}function j(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return{value:void 0,done:!0}}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var c=x(a,r);if(c){if(c===f)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var u=s(t,e,r);if("normal"===u.type){if(n=r.done?"completed":"suspendedYield",u.arg===f)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(n="completed",r.method="throw",r.arg=u.arg)}}}function x(t,e){var r=e.method,n=t.iterator[r];if(void 0===n)return e.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=void 0,x(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),f;var o=s(n,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,f;var i=o.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,f):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,f)}function O(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function S(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function k(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(O,this),this.reset(!0)}function E(t){if(t){var e=t[i];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,o=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return o.next=o}}return{next:P}}function P(){return{value:void 0,done:!0}}return p.prototype=y,n(b,"constructor",{value:y,configurable:!0}),n(y,"constructor",{value:p,configurable:!0}),p.displayName=u(y,c,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===p||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,y):(t.__proto__=y,u(t,c,"GeneratorFunction")),t.prototype=Object.create(b),t},t.awrap=function(t){return{__await:t}},g(w.prototype),u(w.prototype,a,(function(){return this})),t.AsyncIterator=w,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new w(l(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},g(b),u(b,c,"Generator"),u(b,i,(function(){return this})),u(b,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},t.values=E,k.prototype={constructor:k,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(S),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var c=r.call(i,"catchLoc"),u=r.call(i,"finallyLoc");if(c&&u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(c){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,f):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),f},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),S(r),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;S(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:E(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},t}function Ft(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}function Dt(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function Mt(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Dt(Object(r),!0).forEach((function(e){Gt(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Dt(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function Gt(t,e,r){return(e=function(t){var e=function(t,e){if("object"!==Ct(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!==Ct(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"===Ct(e)?e:String(e)}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Kt(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function Zt(t){var e=t.value,r=t.onChange,n=function(t,e){if(null==t)return{};var r,n,o=function(t,e){if(null==t)return{};var r,n,o={},i=Object.keys(t);for(n=0;n<i.length;n++)r=i[n],e.indexOf(r)>=0||(o[r]=t[r]);return o}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(n=0;n<i.length;n++)r=i[n],e.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(t,r)&&(o[r]=t[r])}return o}(t,Nt),o=function(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,c=[],u=!0,l=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(c.push(n.value),c.length!==e);u=!0);}catch(t){l=!0,o=t}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw o}}return c}}(t,e)||function(t,e){if(t){if("string"==typeof t)return Kt(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Kt(t,e):void 0}}(t,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.")}()}((0,i.useState)({raw:e,parsed:null}),2),a=o[0].raw,u=o[1];(0,i.useEffect)((function(){u((function(t){return Mt(Mt({},t),{},{raw:e})}))}),[e,u]);var l=(0,i.useCallback)((function(t){var e=t.target.value;u((function(t){return Mt(Mt({},t),{},{raw:e})}))}),[u]);return(0,i.useEffect)((function(){function t(){var e;return e=Tt().mark((function t(){var e;return Tt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,q()(a);case 2:e=t.sent,(0,$.u)(e),u((function(t){return Mt(Mt({},t),{},{parsed:e})})),r({raw:a,parsed:e});case 6:case"end":return t.stop()}}),t)})),t=function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function a(t){Ft(i,n,o,a,c,"next",t)}function c(t){Ft(i,n,o,a,c,"throw",t)}a(void 0)}))},t.apply(this,arguments)}a&&function(){t.apply(this,arguments)}()}),[a,u,r]),(0,c.jsx)("textarea",Mt({onChange:l,value:a},n))}var Ut=r(98553),zt=r(91829),Jt=r(62608);function Yt(t){return Yt="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},Yt(t)}var Rt=["value","onChange"];function Bt(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function qt(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Bt(Object(r),!0).forEach((function(e){$t(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Bt(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function $t(t,e,r){return(e=function(t){var e=function(t,e){if("object"!==Yt(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!==Yt(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"===Yt(e)?e:String(e)}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Ht(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function Vt(t){var e=t.value,r=t.onChange,n=function(t,e){if(null==t)return{};var r,n,o=function(t,e){if(null==t)return{};var r,n,o={},i=Object.keys(t);for(n=0;n<i.length;n++)r=i[n],e.indexOf(r)>=0||(o[r]=t[r]);return o}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(n=0;n<i.length;n++)r=i[n],e.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(t,r)&&(o[r]=t[r])}return o}(t,Rt),o=(0,i.useRef)(),a=function(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,c=[],u=!0,l=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(c.push(n.value),c.length!==e);u=!0);}catch(t){l=!0,o=t}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw o}}return c}}(t,e)||function(t,e){if(t){if("string"==typeof t)return Ht(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Ht(t,e):void 0}}(t,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.")}()}((0,i.useState)({raw:e,parsed:null,error:null}),2),u=a[0],l=u.raw,s=u.error,f=a[1],d=(0,i.useCallback)((function(t){var e=t.target.value,n=null,o=null;try{n=JSON.parse(e),(0,Jt.validateInfoJson)(n)}catch(t){o=t,n=null}f({raw:e,parsed:n,error:o}),r({raw:e,parsed:n})}),[f,r]);return(0,i.useEffect)((function(){f((function(t){return qt(qt({},t),{},{raw:e})}))}),[e,f]),(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)("textarea",qt({ref:o,onChange:d,value:l},n)),s&&(0,c.jsx)("p",{className:D.parseError,children:s instanceof Jt.InfoValidationError?s.errors[0]:s.toString()})]})}function Qt(t){return Qt="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},Qt(t)}function Wt(){Wt=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n=Object.defineProperty||function(t,e,r){t[e]=r.value},o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag";function u(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,r){return t[e]=r}}function l(t,e,r,o){var i=e&&e.prototype instanceof d?e:d,a=Object.create(i.prototype),c=new k(o||[]);return n(a,"_invoke",{value:j(t,r,c)}),a}function s(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=l;var f={};function d(){}function p(){}function y(){}var h={};u(h,i,(function(){return this}));var v=Object.getPrototypeOf,m=v&&v(v(E([])));m&&m!==e&&r.call(m,i)&&(h=m);var b=y.prototype=d.prototype=Object.create(h);function g(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function w(t,e){function o(n,i,a,c){var u=s(t[n],t,i);if("throw"!==u.type){var l=u.arg,f=l.value;return f&&"object"==Qt(f)&&r.call(f,"__await")?e.resolve(f.__await).then((function(t){o("next",t,a,c)}),(function(t){o("throw",t,a,c)})):e.resolve(f).then((function(t){l.value=t,a(l)}),(function(t){return o("throw",t,a,c)}))}c(u.arg)}var i;n(this,"_invoke",{value:function(t,r){function n(){return new e((function(e,n){o(t,r,e,n)}))}return i=i?i.then(n,n):n()}})}function j(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return{value:void 0,done:!0}}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var c=x(a,r);if(c){if(c===f)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var u=s(t,e,r);if("normal"===u.type){if(n=r.done?"completed":"suspendedYield",u.arg===f)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(n="completed",r.method="throw",r.arg=u.arg)}}}function x(t,e){var r=e.method,n=t.iterator[r];if(void 0===n)return e.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=void 0,x(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),f;var o=s(n,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,f;var i=o.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,f):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,f)}function O(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function S(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function k(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(O,this),this.reset(!0)}function E(t){if(t){var e=t[i];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,o=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return o.next=o}}return{next:P}}function P(){return{value:void 0,done:!0}}return p.prototype=y,n(b,"constructor",{value:y,configurable:!0}),n(y,"constructor",{value:p,configurable:!0}),p.displayName=u(y,c,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===p||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,y):(t.__proto__=y,u(t,c,"GeneratorFunction")),t.prototype=Object.create(b),t},t.awrap=function(t){return{__await:t}},g(w.prototype),u(w.prototype,a,(function(){return this})),t.AsyncIterator=w,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new w(l(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},g(b),u(b,c,"Generator"),u(b,i,(function(){return this})),u(b,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},t.values=E,k.prototype={constructor:k,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(S),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var c=r.call(i,"catchLoc"),u=r.call(i,"finallyLoc");if(c&&u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(c){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,f):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),f},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),S(r),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;S(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:E(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},t}function Xt(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}function te(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,c=[],u=!0,l=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(c.push(n.value),c.length!==e);u=!0);}catch(t){l=!0,o=t}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw o}}return c}}(t,e)||ee(t,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.")}()}function ee(t,e){if(t){if("string"==typeof t)return re(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?re(t,e):void 0}}function re(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var ne,oe=[{id:"custom",name:"Custom..."}].concat(function(t){if(Array.isArray(t))return re(t)}(ne=Object.values(Ut))||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(ne)||ee(ne)||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 ie(t){var e=t.value,n=(t.onChange,te((0,i.useContext)(w),2)),o=n[0].pending,a=n[1],u=te((0,zt.Z)(!(null!=o&&o.metadataRaw)),3),l=u[0],s=u[1],f=u[2],d=te((0,i.useState)(e),2),p=d[0],y=d[1],h=(0,i.useMemo)((function(){return oe.find((function(t){return t.id===p}))}),[p]),v=(0,i.useCallback)(function(){var t,e=(t=Wt().mark((function t(e){var n;return Wt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(y(e.id),"custom"!==e.id){t.next=6;break}a.setMetadata({pending:!0,keyboardId:"custom",isCustom:!0,raw:"",parsed:null}),f(),t.next=16;break;case 6:return t.prev=6,t.next=9,r(35943)("./".concat(e.id,".json"));case 9:n=t.sent,a.setMetadata({pending:!0,isCustom:!1,keyboardId:e.id,parsed:n,raw:""}),t.next=16;break;case 13:t.prev=13,t.t0=t.catch(6),console.error("Failed to load metadata for ".concat(e.id),t.t0);case 16:case"end":return t.stop()}}),t,null,[[6,13]])})),function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){Xt(i,n,o,a,c,"next",t)}function c(t){Xt(i,n,o,a,c,"throw",t)}a(void 0)}))});return function(t){return e.apply(this,arguments)}}(),[a,y,f]),m=(0,i.useCallback)((function(t){var e=t.raw,r=t.parsed,n=t.errors;a.setMetadata({pending:!0,id:h.id,custom:"custom"===h.id,raw:e,parsed:r,errors:n})}),[h,a]);return(0,c.jsxs)("article",{className:D.source,"data-expanded":l,children:[(0,c.jsxs)("h2",{children:[(0,c.jsx)("span",{onClick:s,children:"Keyboard"})," ",(0,c.jsx)("div",{style:{display:"inline-block",fontSize:"initial",fontWeight:"normal",verticalAlign:"middle"},children:(0,c.jsx)(Z.Ph,{value:h,onChange:v,options:oe,getOptionValue:function(t){return t.id},getOptionLabel:function(t){return t.name}})})]}),"custom"===(null==h?void 0:h.id)&&(0,c.jsxs)("section",{className:D.sourceContent,children:[(0,c.jsx)("p",{children:"In order to understand what keyboard you're using and now to display it visually, please paste the JSON source metadata file below."}),o.metadata&&(0,c.jsxs)("p",{children:["Parsed metadata for: ",o.metadata.name]}),(0,c.jsx)(Vt,{cols:80,rows:o.metadata?22:5,wrap:"off",spellCheck:!1,value:o.metadataRaw,onChange:m}),!o.metadata&&(0,c.jsxs)("div",{className:D.metadataHelp,children:[(0,c.jsx)("h3",{children:"Not sure what to put here?"}),(0,c.jsxs)("p",{children:["The ",(0,c.jsx)("em",{children:"Keymap Editor"})," app depends on a defined keyboard layout both to provide a friendly graphical representation to edit and a readable textual representation. You can learn more about this at ",bt.Jh,"."]}),(0,c.jsxs)("p",{children:["Note: If your keyboard works with QMK's Configurator you may be able to quickly get a visual representation by pasting the contents of that keyboard's ",(0,c.jsx)("code",{children:"info.json"})," file here."]})]})]})]})}function ae(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function ce(t){var e=t.onSubmit,r=t.onCancel,n=function(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,c=[],u=!0,l=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(c.push(n.value),c.length!==e);u=!0);}catch(t){l=!0,o=t}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw o}}return c}}(t,e)||function(t,e){if(t){if("string"==typeof t)return ae(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?ae(t,e):void 0}}(t,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.")}()}((0,i.useContext)(w),2),o=n[0],a=n[1],u=o.pending,l=(0,i.useCallback)((function(t){var e=t.raw,r=t.parsed;a.setKeymap({pending:!0,raw:e,parsed:r})}),[a]),s=(0,i.useCallback)((function(){a.confirmPending(),e({keymap:u.keymap,metadata:u.metadata})}),[a,u,e]),f=!(null!=u&&u.metadata&&null!=u&&u.keymap);return(0,c.jsx)(vt.Z,{onDismiss:r,children:(0,c.jsxs)(ht.Z,{style:{maxWidth:"640px",maxHeight:"90vh",overflow:"auto"},dismissText:null,children:[(0,c.jsx)(ie,{value:o.selection.keyboardId}),(0,c.jsx)("h2",{children:"Keymap"}),(0,c.jsxs)("p",{children:["Paste the devicetree source from your ",(0,c.jsx)("code",{children:".keymap"})," file below."]}),(0,c.jsxs)("p",{children:["You can ",(0,c.jsx)("em",{children:"technically"})," make changes directly to the DeviceTree code here, but this isn't intended as an editor."]}),(0,c.jsx)(Zt,{cols:80,rows:22,wrap:"off",spellCheck:!1,value:o.selection.keymapRaw,onChange:l}),(0,c.jsxs)("p",{style:{textAlign:"center"},children:[(0,c.jsx)(yt.Z,{disabled:f,onClick:s,children:"Set Keymap"}),(0,c.jsx)(yt.Z,{onClick:r,secondary:!0,children:"Cancel"})]})]})})}function ue(t){return ue="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},ue(t)}function le(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,c=[],u=!0,l=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(c.push(n.value),c.length!==e);u=!0);}catch(t){l=!0,o=t}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw o}}return c}}(t,e)||function(t,e){if(t){if("string"==typeof t)return se(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?se(t,e):void 0}}(t,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.")}()}function se(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function fe(t){var e,r,n=t.onSelect,a=(t.onError,le((0,i.useContext)(w),2)),u=a[0],l=a[1].closeModal,s=le((0,i.useState)(null),2),f=s[0],d=s[1],p=(0,i.useCallback)((function(t,e){var r=e.layouts,i=e.sensors,a=void 0===i?[]:i,c=t.chosen["zmk,matrix_transform"]?t.chosen["zmk,matrix_transform"].replace(/^&/,""):null;if("object"===ue(r)){var u=Object.keys(r)[0],l=r[c]||r[u];n(o()({source:"clipboard",keyboard:"",layoutMetadata:l,layout:l.layout,keymap:t,sensors:a}))}else console.error("Invalid metadata loaded",e)}),[n]);(0,i.useEffect)((function(){var t,e,r,n;null!==(t=u.selection)&&void 0!==t&&t.keymap&&null!==(e=u.selection)&&void 0!==e&&e.metadata&&p(null===(r=u.selection)||void 0===r?void 0:r.keymap,null===(n=u.selection)||void 0===n?void 0:n.metadata)}),[p,null===(e=u.selection)||void 0===e?void 0:e.keymap,null===(r=u.selection)||void 0===r?void 0:r.metadata]);var y=(0,i.useCallback)((function(t){var e=t.keymap,r=t.metadata;p(e,r),l()}),[p,l]);return(0,i.useEffect)((function(){var t,e,r,n;f||(d(!0),null!==(t=u.selection)&&void 0!==t&&t.keymap&&null!==(e=u.selection)&&void 0!==e&&e.metadata&&p(null===(r=u.selection)||void 0===r?void 0:r.keymap,null===(n=u.selection)||void 0===n?void 0:n.metadata))}),[f,d,p,u]),(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(_t,{}),(0,c.jsx)(ft,{}),u.modalOpen&&(0,c.jsx)(ce,{onSubmit:y,onCancel:l}),u.feedbackModalOpen&&(0,c.jsx)(jt,{})]})}var de,pe=(de=fe,function(t){return(0,c.jsx)(j,{children:(0,c.jsx)(de,s({},t))})})},56281:function(t,e,r){"use strict";var n=r(8081),o=r.n(n),i=r(23645),a=r.n(i)()(o());a.push([t.id,"button.pi2Ig8c3Fdh4H2Jpxdo7 {\n display: inline-block;\n cursor: pointer;\n background-color: var(--hover-selection);\n color: white;\n\n font-size: 16px;\n border: none;\n border-radius: 5px;\n padding: 0 5px;\n\n height: 30px;\n line-height: 30px;\n vertical-align: middle;\n}\n\nbutton.Ctpu4E2dZYJ6g8CUGFOF {\n color: var(--fg);\n background-color: transparent;\n}\n\nbutton.pi2Ig8c3Fdh4H2Jpxdo7[disabled] {\n filter: saturate(20%);\n opacity: .5;\n cursor: not-allowed;\n}\n",""]),a.locals={action:"pi2Ig8c3Fdh4H2Jpxdo7",secondary:"Ctpu4E2dZYJ6g8CUGFOF"},e.Z=a},8153:function(t,e,r){"use strict";var n=r(8081),o=r.n(n),i=r(23645),a=r.n(i)()(o());a.push([t.id,'.fnnwBtqwiwSQgnuN5sqg h2 {\n cursor: pointer;\n}\n\n.meN56P3rXkTYWdDY0oZq {\n height: auto;\n transition: height 100ms ease-out;\n}\n\n.H4OUxP43w5pZ9RYBB72x {\n background-color: rgba(0, 0, 0, 0.1);\n margin: 10px;\n padding: 0 10px;\n border-radius: 4px;\n}\n\n[data-expanded="false"] .meN56P3rXkTYWdDY0oZq {\n height: 0;\n overflow: hidden;\n}\n\n[data-expanded="false"] h2 {\n margin-bottom: 0;\n}\n\n.lFxBan5aXNzTEl2SGBzU {\n color: firebrick;\n background-color: pink;\n padding: 4px 8px;\n border-radius: 4px;\n}\n\n.eVrbmh_w8MbnDUOfUD2N {\n position: relative;\n}\n.eVrbmh_w8MbnDUOfUD2N span {\n font-size: 120%;\n margin: auto 5px;\n}\n\n.eVrbmh_w8MbnDUOfUD2N[data-show-copied="true"]::after {\n content: "Copied!";\n position: absolute;\n right: -5px;\n top: 50%;\n\n transform: translate(100%, -50%);\n background-color: var(--selection);\n color: white;\n padding: 10px;\n border-radius: 4px;\n\n animation: normal 1.5s h0IIQBfKFzrLn6r9v5qG;\n}\n\n@keyframes h0IIQBfKFzrLn6r9v5qG {\n 0% { opacity: 0; width: 0; margin-left: -100%; }\n 2.5% { opacity: 1; width: auto; }\n 75% { opacity: 1; margin-left: 0; }\n 100% { opacity: 0; }\n}',""]),a.locals={source:"fnnwBtqwiwSQgnuN5sqg",sourceContent:"meN56P3rXkTYWdDY0oZq",metadataHelp:"H4OUxP43w5pZ9RYBB72x",parseError:"lFxBan5aXNzTEl2SGBzU",copyButton:"eVrbmh_w8MbnDUOfUD2N",popInOut:"h0IIQBfKFzrLn6r9v5qG"},e.Z=a},35943:function(t,e,r){var n={"./a_dux.json":[73158,3712],"./bat43.json":[60888,3712],"./bdn9_rev2.json":[94591,3712],"./bfo9000.json":[19684,3712],"./boardsource3x4.json":[88602,3712],"./boardsource5x12.json":[8058,3712],"./bt60_v1.json":[92628,3712],"./bt60_v1_hs.json":[84628,3712],"./bt60_v2.json":[9417,3712],"./bt65_v1.json":[88455,3712],"./bt75_v1.json":[25397,3712],"./chalice.json":[7936,3712],"./clog.json":[31638,3712],"./contra.json":[42718,3712],"./corne.json":[26453,3712],"./corneish_zen.json":[39757,3712],"./cradio.json":[62089,3712],"./crbn.json":[48945,3712],"./eek.json":[63072,3712],"./elephant42.json":[83634,3712],"./ergodash.json":[68972,3712],"./ergodox.json":[75507,3712],"./eternal_keypad.json":[69416,3712],"./eternal_keypad_lefty.json":[56785,3712],"./ferris_rev02.json":[97365,3712],"./fourier.json":[14446,3712],"./helix.json":[73549,3712],"./hummingbird.json":[98321,3712],"./iris.json":[55262,3712],"./jian.json":[46228,3712],"./jiran.json":[14465,3712],"./jorne.json":[19151,3712],"./kbdfans_tofu65_v2.json":[7450,3712],"./knob_goblin.json":[71497,3712],"./kyria.json":[34458,3712],"./kyria_rev2.json":[70165,3712],"./kyria_rev3.json":[33669,3712],"./leeloo.json":[53677,3712],"./lily58.json":[21479,3712],"./lotus58.json":[63918,3712],"./m60.json":[53132,3712],"./microdox.json":[56792,3712],"./murphpad.json":[8662,3712],"./naked60.json":[79707,3712],"./nibble.json":[58244,3712],"./nice60.json":[41501,3712],"./osprette.json":[13467,3712],"./pancake.json":[19011,3712],"./planck_rev6.json":[55991,3712],"./preonic_rev3.json":[47308,3712],"./qaz.json":[46923,3712],"./quefrency.json":[23956,3712],"./redox.json":[17104,3712],"./reviung41.json":[71414,3712],"./reviung5.json":[31009,3712],"./romac.json":[15683,3712],"./romac_plus.json":[55318,3712],"./s40nc.json":[56036,3712],"./snap.json":[24380,3712],"./sofle.json":[45082,3712],"./splitkb_aurora_corne.json":[20216,3712],"./splitkb_aurora_lily58.json":[2674,3712],"./splitkb_aurora_sweep.json":[9738,3712],"./splitreus62.json":[47003,3712],"./tg4x.json":[87454,3712],"./tidbit.json":[60386,3712],"./two_percent_milk.json":[67150,3712],"./waterfowl.json":[14194,3712],"./zmk_uno.json":[71578,3712],"./zodiark.json":[12069,3712]};function o(t){if(!r.o(n,t))return Promise.resolve().then((function(){var e=new Error("Cannot find module '"+t+"'");throw e.code="MODULE_NOT_FOUND",e}));var e=n[t],o=e[0];return r.e(e[1]).then((function(){return r.t(o,19)}))}o.keys=function(){return Object.keys(n)},o.id=35943,t.exports=o},66317:function(){},99918:function(){}}]);
|