lib/rack/queries/static/app.js in rack-queries-0.1.2 vs lib/rack/queries/static/app.js in rack-queries-0.1.3
- old
+ new
@@ -26,6 +26,6 @@
* 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.
*/
-Object.defineProperty(t,"__esModule",{value:!0});var n=null,r=!1,l=3,a=-1,i=-1,o=!1,u=!1;function c(){if(!o){var e=n.expirationTime;u?T():u=!0,w(d,e)}}function s(){var e=n,t=n.next;if(n===t)n=null;else{var r=n.previous;n=r.next=t,t.previous=r}e.next=e.previous=null,r=e.callback,t=e.expirationTime,e=e.priorityLevel;var a=l,o=i;l=e,i=t;try{var u=r()}finally{l=a,i=o}if("function"==typeof u)if(u={callback:u,priorityLevel:e,expirationTime:t,next:null,previous:null},null===n)n=u.next=u.previous=u;else{r=null,e=n;do{if(e.expirationTime>=t){r=e;break}e=e.next}while(e!==n);null===r?r=n:r===n&&(n=u,c()),(t=r.previous).next=r.previous=u,u.next=r,u.previous=t}}function f(){if(-1===a&&null!==n&&1===n.priorityLevel){o=!0;try{do{s()}while(null!==n&&1===n.priorityLevel)}finally{o=!1,null!==n?c():u=!1}}}function d(e){o=!0;var l=r;r=e;try{if(e)for(;null!==n;){var a=t.unstable_now();if(!(n.expirationTime<=a))break;do{s()}while(null!==n&&n.expirationTime<=a)}else if(null!==n)do{s()}while(null!==n&&!E())}finally{o=!1,r=l,null!==n?c():u=!1,f()}}var p,m,h=Date,y="function"==typeof setTimeout?setTimeout:void 0,v="function"==typeof clearTimeout?clearTimeout:void 0,g="function"==typeof requestAnimationFrame?requestAnimationFrame:void 0,b="function"==typeof cancelAnimationFrame?cancelAnimationFrame:void 0;function k(e){p=g(function(t){v(m),e(t)}),m=y(function(){b(p),e(t.unstable_now())},100)}if("object"==typeof performance&&"function"==typeof performance.now){var x=performance;t.unstable_now=function(){return x.now()}}else t.unstable_now=function(){return h.now()};var w,T,E,S=null;if("undefined"!=typeof window?S=window:void 0!==e&&(S=e),S&&S._schedMock){var _=S._schedMock;w=_[0],T=_[1],E=_[2],t.unstable_now=_[3]}else if("undefined"==typeof window||"function"!=typeof MessageChannel){var C=null,P=function(e){if(null!==C)try{C(e)}finally{C=null}};w=function(e){null!==C?setTimeout(w,0,e):(C=e,setTimeout(P,0,!1))},T=function(){C=null},E=function(){return!1}}else{"undefined"!=typeof console&&("function"!=typeof g&&console.error("This browser doesn't support requestAnimationFrame. Make sure that you load a polyfill in older browsers. https://fb.me/react-polyfills"),"function"!=typeof b&&console.error("This browser doesn't support cancelAnimationFrame. Make sure that you load a polyfill in older browsers. https://fb.me/react-polyfills"));var N=null,O=!1,R=-1,M=!1,I=!1,z=0,U=33,D=33;E=function(){return z<=t.unstable_now()};var F=new MessageChannel,j=F.port2;F.port1.onmessage=function(){O=!1;var e=N,n=R;N=null,R=-1;var r=t.unstable_now(),l=!1;if(0>=z-r){if(!(-1!==n&&n<=r))return M||(M=!0,k(L)),N=e,void(R=n);l=!0}if(null!==e){I=!0;try{e(l)}finally{I=!1}}};var L=function(e){if(null!==N){k(L);var t=e-z+D;t<D&&U<D?(8>t&&(t=8),D=t<U?U:t):U=t,z=e+D,O||(O=!0,j.postMessage(void 0))}else M=!1};w=function(e,t){N=e,R=t,I||0>t?j.postMessage(void 0):M||(M=!0,k(L))},T=function(){N=null,O=!1,R=-1}}t.unstable_ImmediatePriority=1,t.unstable_UserBlockingPriority=2,t.unstable_NormalPriority=3,t.unstable_IdlePriority=5,t.unstable_LowPriority=4,t.unstable_runWithPriority=function(e,n){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var r=l,i=a;l=e,a=t.unstable_now();try{return n()}finally{l=r,a=i,f()}},t.unstable_next=function(e){switch(l){case 1:case 2:case 3:var n=3;break;default:n=l}var r=l,i=a;l=n,a=t.unstable_now();try{return e()}finally{l=r,a=i,f()}},t.unstable_scheduleCallback=function(e,r){var i=-1!==a?a:t.unstable_now();if("object"==typeof r&&null!==r&&"number"==typeof r.timeout)r=i+r.timeout;else switch(l){case 1:r=i+-1;break;case 2:r=i+250;break;case 5:r=i+1073741823;break;case 4:r=i+1e4;break;default:r=i+5e3}if(e={callback:e,priorityLevel:l,expirationTime:r,next:null,previous:null},null===n)n=e.next=e.previous=e,c();else{i=null;var o=n;do{if(o.expirationTime>r){i=o;break}o=o.next}while(o!==n);null===i?i=n:i===n&&(n=e,c()),(r=i.previous).next=i.previous=e,e.next=i,e.previous=r}return e},t.unstable_cancelCallback=function(e){var t=e.next;if(null!==t){if(t===e)n=null;else{e===n&&(n=t);var r=e.previous;r.next=t,t.previous=r}e.next=e.previous=null}},t.unstable_wrapCallback=function(e){var n=l;return function(){var r=l,i=a;l=n,a=t.unstable_now();try{return e.apply(this,arguments)}finally{l=r,a=i,f()}}},t.unstable_getCurrentPriorityLevel=function(){return l},t.unstable_shouldYield=function(){return!r&&(null!==n&&n.expirationTime<i||E())},t.unstable_continueExecution=function(){null!==n&&c()},t.unstable_pauseExecution=function(){},t.unstable_getFirstCallbackNode=function(){return n}}).call(this,n(7))},function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t,n){"use strict";n.r(t);var r=n(0),l=n.n(r),a=n(2),i=function(e){return new Promise(function(t,n){var r=new XMLHttpRequest;r.onreadystatechange=function(){4===r.readyState&&(r.status>=200&&r.status<300?t(JSON.parse(r.responseText)):n(new Error(r.responseText)))},r.open("GET",e),r.send()})};function o(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=[],r=!0,l=!1,a=void 0;try{for(var i,o=e[Symbol.iterator]();!(r=(i=o.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){l=!0,a=e}finally{try{r||null==o.return||o.return()}finally{if(l)throw a}}return n}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}var u=function(e){var t=!1,n=o(Object(r.useState)({error:null,fetching:!0,json:{}}),2),l=n[0],a=n[1];return Object(r.useEffect)(function(){return a({error:null,fetching:!0,json:{}}),i(e).then(function(e){t||a({fetching:!1,json:e})}).catch(function(e){t||a({fetching:!1,error:e})}),function(){t=!0}},[e]),l},c=function(e){var t=e.query,n=e.opt,a=e.value,i=e.onValueChange,o=u("queries/".concat(t.name,"/opts/").concat(n)),c=o.error,s=o.fetching,f=o.json,d=Object(r.useCallback)(function(e){return i(n,e.target.value)},[i,n]);if(c)return"error";if(s)return"fetching";a||i(n,f.values[0]);var p="".concat(t.name,"-").concat(n);return l.a.createElement("label",{className:"opt",htmlFor:p},"".concat(n,": "),l.a.createElement("select",{id:p,name:p,onChange:d},f.values.map(function(e){return l.a.createElement("option",{key:e,value:e},e)})))},s=function(e){var t=e.query,n=e.values,r=e.onValueChange;return l.a.createElement(l.a.Fragment,null,t.opts.map(function(e){return l.a.createElement(c,{key:e,query:t,opt:e,value:n[e],onValueChange:r})}))};function f(e){return function(e){if(Array.isArray(e))return e}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}var d=function(e){var t=e.error,n=e.fetching,r=e.results;if(!t&&!n&&null===r)return null;if(t)return"error";if(n)return"fetching";if(!Array.isArray(r))return"Result: ".concat(r);var a=f(r),i=a[0],o=a.slice(1);return l.a.createElement(l.a.Fragment,null,"Results:",l.a.createElement("table",null,l.a.createElement("thead",null,l.a.createElement("tr",null,i.map(function(e,t){return l.a.createElement("th",{key:t},e)}))),l.a.createElement("tbody",null,o.map(function(e,t){return l.a.createElement("tr",{key:t},e.map(function(e,t){return l.a.createElement("td",{key:t},e)}))}))))};function p(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){m(e,t,n[t])})}return e}function m(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function h(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=[],r=!0,l=!1,a=void 0;try{for(var i,o=e[Symbol.iterator]();!(r=(i=o.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){l=!0,a=e}finally{try{r||null==o.return||o.return()}finally{if(l)throw a}}return n}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}var y=function(e){var t=e.query,n=Object(r.useRef)(null),a=h(Object(r.useState)(t.opts.reduce(function(e,t){return p({},e,m({},t,null))},{})),2),o=a[0],u=a[1],c=h(Object(r.useState)({error:null,fetching:!1,results:null}),2),f=c[0],y=c[1],v=Object(r.useCallback)(function(e,t){u(function(n){return p({},n,m({},e,t))}),y({error:null,fetching:!1,results:null})},[u,y]),g=Object(r.useCallback)(function(){y({error:null,fetching:!0,results:null}),i(function(e,t){var n="queries/".concat(e.name);if(0===Object.keys(t).length)return n;var r=Object.keys(t).map(function(e){return"".concat(encodeURIComponent(e),"=").concat(encodeURIComponent(t[e]))});return"".concat(n,"?").concat(r.join("&"))}(t,o)).then(function(e){var t=e.results;n.current&&y({fetching:!1,results:t})}).catch(function(e){n.current&&y({fetching:!1,error:e})})},[n,t,o,y]);return l.a.createElement("div",{ref:n},l.a.createElement(s,{query:t,values:o,onValueChange:v}),l.a.createElement("button",{className:"run",type:"button",disabled:Object.keys(o).some(function(e){return!o[e]}),onClick:g},"Run"),l.a.createElement("div",{className:"results"},l.a.createElement(d,f)))};function v(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=[],r=!0,l=!1,a=void 0;try{for(var i,o=e[Symbol.iterator]();!(r=(i=o.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){l=!0,a=e}finally{try{r||null==o.return||o.return()}finally{if(l)throw a}}return n}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}var g=function(e){var t=e.active,n=e.query,a=e.onQueryClick,i=Object(r.useCallback)(function(){return a(n)},[n,a]),o=t?"query query-active":"query";return l.a.createElement("button",{className:o,type:"button",onClick:i},n.name)},b=function(){var e=u("queries"),t=e.error,n=e.fetching,a=e.json,i=v(Object(r.useState)(null),2),o=i[0],c=i[1];return t?"error":n?"fetching":l.a.createElement("main",null,l.a.createElement("div",{className:"active"},o&&l.a.createElement(y,{key:o.name,query:o})),l.a.createElement("nav",null,a.queries.map(function(e){return l.a.createElement(g,{key:e.name,active:e===o,query:e,onQueryClick:c})})))};n.n(a).a.render(l.a.createElement(function(){return l.a.createElement(r.StrictMode,null,l.a.createElement("h1",null,"Rack::Queries"),l.a.createElement(b,null))},null),document.getElementById("main"))}]);
+Object.defineProperty(t,"__esModule",{value:!0});var n=null,r=!1,l=3,a=-1,i=-1,o=!1,u=!1;function c(){if(!o){var e=n.expirationTime;u?T():u=!0,w(d,e)}}function s(){var e=n,t=n.next;if(n===t)n=null;else{var r=n.previous;n=r.next=t,t.previous=r}e.next=e.previous=null,r=e.callback,t=e.expirationTime,e=e.priorityLevel;var a=l,o=i;l=e,i=t;try{var u=r()}finally{l=a,i=o}if("function"==typeof u)if(u={callback:u,priorityLevel:e,expirationTime:t,next:null,previous:null},null===n)n=u.next=u.previous=u;else{r=null,e=n;do{if(e.expirationTime>=t){r=e;break}e=e.next}while(e!==n);null===r?r=n:r===n&&(n=u,c()),(t=r.previous).next=r.previous=u,u.next=r,u.previous=t}}function f(){if(-1===a&&null!==n&&1===n.priorityLevel){o=!0;try{do{s()}while(null!==n&&1===n.priorityLevel)}finally{o=!1,null!==n?c():u=!1}}}function d(e){o=!0;var l=r;r=e;try{if(e)for(;null!==n;){var a=t.unstable_now();if(!(n.expirationTime<=a))break;do{s()}while(null!==n&&n.expirationTime<=a)}else if(null!==n)do{s()}while(null!==n&&!E())}finally{o=!1,r=l,null!==n?c():u=!1,f()}}var p,m,h=Date,y="function"==typeof setTimeout?setTimeout:void 0,v="function"==typeof clearTimeout?clearTimeout:void 0,g="function"==typeof requestAnimationFrame?requestAnimationFrame:void 0,b="function"==typeof cancelAnimationFrame?cancelAnimationFrame:void 0;function k(e){p=g(function(t){v(m),e(t)}),m=y(function(){b(p),e(t.unstable_now())},100)}if("object"==typeof performance&&"function"==typeof performance.now){var x=performance;t.unstable_now=function(){return x.now()}}else t.unstable_now=function(){return h.now()};var w,T,E,S=null;if("undefined"!=typeof window?S=window:void 0!==e&&(S=e),S&&S._schedMock){var _=S._schedMock;w=_[0],T=_[1],E=_[2],t.unstable_now=_[3]}else if("undefined"==typeof window||"function"!=typeof MessageChannel){var C=null,P=function(e){if(null!==C)try{C(e)}finally{C=null}};w=function(e){null!==C?setTimeout(w,0,e):(C=e,setTimeout(P,0,!1))},T=function(){C=null},E=function(){return!1}}else{"undefined"!=typeof console&&("function"!=typeof g&&console.error("This browser doesn't support requestAnimationFrame. Make sure that you load a polyfill in older browsers. https://fb.me/react-polyfills"),"function"!=typeof b&&console.error("This browser doesn't support cancelAnimationFrame. Make sure that you load a polyfill in older browsers. https://fb.me/react-polyfills"));var N=null,O=!1,R=-1,M=!1,I=!1,z=0,U=33,D=33;E=function(){return z<=t.unstable_now()};var F=new MessageChannel,j=F.port2;F.port1.onmessage=function(){O=!1;var e=N,n=R;N=null,R=-1;var r=t.unstable_now(),l=!1;if(0>=z-r){if(!(-1!==n&&n<=r))return M||(M=!0,k(L)),N=e,void(R=n);l=!0}if(null!==e){I=!0;try{e(l)}finally{I=!1}}};var L=function(e){if(null!==N){k(L);var t=e-z+D;t<D&&U<D?(8>t&&(t=8),D=t<U?U:t):U=t,z=e+D,O||(O=!0,j.postMessage(void 0))}else M=!1};w=function(e,t){N=e,R=t,I||0>t?j.postMessage(void 0):M||(M=!0,k(L))},T=function(){N=null,O=!1,R=-1}}t.unstable_ImmediatePriority=1,t.unstable_UserBlockingPriority=2,t.unstable_NormalPriority=3,t.unstable_IdlePriority=5,t.unstable_LowPriority=4,t.unstable_runWithPriority=function(e,n){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var r=l,i=a;l=e,a=t.unstable_now();try{return n()}finally{l=r,a=i,f()}},t.unstable_next=function(e){switch(l){case 1:case 2:case 3:var n=3;break;default:n=l}var r=l,i=a;l=n,a=t.unstable_now();try{return e()}finally{l=r,a=i,f()}},t.unstable_scheduleCallback=function(e,r){var i=-1!==a?a:t.unstable_now();if("object"==typeof r&&null!==r&&"number"==typeof r.timeout)r=i+r.timeout;else switch(l){case 1:r=i+-1;break;case 2:r=i+250;break;case 5:r=i+1073741823;break;case 4:r=i+1e4;break;default:r=i+5e3}if(e={callback:e,priorityLevel:l,expirationTime:r,next:null,previous:null},null===n)n=e.next=e.previous=e,c();else{i=null;var o=n;do{if(o.expirationTime>r){i=o;break}o=o.next}while(o!==n);null===i?i=n:i===n&&(n=e,c()),(r=i.previous).next=i.previous=e,e.next=i,e.previous=r}return e},t.unstable_cancelCallback=function(e){var t=e.next;if(null!==t){if(t===e)n=null;else{e===n&&(n=t);var r=e.previous;r.next=t,t.previous=r}e.next=e.previous=null}},t.unstable_wrapCallback=function(e){var n=l;return function(){var r=l,i=a;l=n,a=t.unstable_now();try{return e.apply(this,arguments)}finally{l=r,a=i,f()}}},t.unstable_getCurrentPriorityLevel=function(){return l},t.unstable_shouldYield=function(){return!r&&(null!==n&&n.expirationTime<i||E())},t.unstable_continueExecution=function(){null!==n&&c()},t.unstable_pauseExecution=function(){},t.unstable_getFirstCallbackNode=function(){return n}}).call(this,n(7))},function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t,n){"use strict";n.r(t);var r=n(0),l=n.n(r),a=n(2),i=function(e){return new Promise(function(t,n){var r=new XMLHttpRequest;r.onreadystatechange=function(){4===r.readyState&&(r.status>=200&&r.status<300?t(JSON.parse(r.responseText)):n(new Error(r.responseText)))},r.open("GET","".concat(document.body.dataset.scriptName,"/").concat(e)),r.send()})};function o(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=[],r=!0,l=!1,a=void 0;try{for(var i,o=e[Symbol.iterator]();!(r=(i=o.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){l=!0,a=e}finally{try{r||null==o.return||o.return()}finally{if(l)throw a}}return n}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}var u=function(e){var t=!1,n=o(Object(r.useState)({error:null,fetching:!0,json:{}}),2),l=n[0],a=n[1];return Object(r.useEffect)(function(){return a({error:null,fetching:!0,json:{}}),i(e).then(function(e){t||a({fetching:!1,json:e})}).catch(function(e){t||a({fetching:!1,error:e})}),function(){t=!0}},[e]),l},c=function(e){var t=e.query,n=e.opt,a=e.value,i=e.onValueChange,o=u("queries/".concat(t.name,"/opts/").concat(n)),c=o.error,s=o.fetching,f=o.json,d=Object(r.useCallback)(function(e){return i(n,e.target.value)},[i,n]);if(c)return"error";if(s)return"fetching";a||i(n,f.values[0]);var p="".concat(t.name,"-").concat(n);return l.a.createElement("label",{className:"opt",htmlFor:p},"".concat(n,": "),l.a.createElement("select",{id:p,name:p,onChange:d},f.values.map(function(e){return l.a.createElement("option",{key:e,value:e},e)})))},s=function(e){var t=e.query,n=e.values,r=e.onValueChange;return l.a.createElement(l.a.Fragment,null,t.opts.map(function(e){return l.a.createElement(c,{key:e,query:t,opt:e,value:n[e],onValueChange:r})}))};function f(e){return function(e){if(Array.isArray(e))return e}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}var d=function(e){var t=e.error,n=e.fetching,r=e.results;if(!t&&!n&&null===r)return null;if(t)return"error";if(n)return"fetching";if(!Array.isArray(r))return"Result: ".concat(r);var a=f(r),i=a[0],o=a.slice(1);return l.a.createElement(l.a.Fragment,null,"Results:",l.a.createElement("table",null,l.a.createElement("thead",null,l.a.createElement("tr",null,i.map(function(e,t){return l.a.createElement("th",{key:t},e)}))),l.a.createElement("tbody",null,o.map(function(e,t){return l.a.createElement("tr",{key:t},e.map(function(e,t){return l.a.createElement("td",{key:t},e)}))}))))};function p(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){m(e,t,n[t])})}return e}function m(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function h(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=[],r=!0,l=!1,a=void 0;try{for(var i,o=e[Symbol.iterator]();!(r=(i=o.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){l=!0,a=e}finally{try{r||null==o.return||o.return()}finally{if(l)throw a}}return n}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}var y=function(e){var t=e.query,n=Object(r.useRef)(null),a=h(Object(r.useState)(t.opts.reduce(function(e,t){return p({},e,m({},t,null))},{})),2),o=a[0],u=a[1],c=h(Object(r.useState)({error:null,fetching:!1,results:null}),2),f=c[0],y=c[1],v=Object(r.useCallback)(function(e,t){u(function(n){return p({},n,m({},e,t))}),y({error:null,fetching:!1,results:null})},[u,y]),g=Object(r.useCallback)(function(){y({error:null,fetching:!0,results:null}),i(function(e,t){var n="queries/".concat(e.name);if(0===Object.keys(t).length)return n;var r=Object.keys(t).map(function(e){return"".concat(encodeURIComponent(e),"=").concat(encodeURIComponent(t[e]))});return"".concat(n,"?").concat(r.join("&"))}(t,o)).then(function(e){var t=e.results;n.current&&y({fetching:!1,results:t})}).catch(function(e){n.current&&y({fetching:!1,error:e})})},[n,t,o,y]);return l.a.createElement("div",{ref:n},l.a.createElement(s,{query:t,values:o,onValueChange:v}),l.a.createElement("button",{className:"run",type:"button",disabled:Object.keys(o).some(function(e){return!o[e]}),onClick:g},"Run"),l.a.createElement("div",{className:"results"},l.a.createElement(d,f)))};function v(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=[],r=!0,l=!1,a=void 0;try{for(var i,o=e[Symbol.iterator]();!(r=(i=o.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){l=!0,a=e}finally{try{r||null==o.return||o.return()}finally{if(l)throw a}}return n}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}var g=function(e){var t=e.active,n=e.query,a=e.onQueryClick,i=Object(r.useCallback)(function(){return a(n)},[n,a]),o=t?"query query-active":"query";return l.a.createElement("button",{className:o,type:"button",onClick:i},n.name)},b=function(){var e=u("queries"),t=e.error,n=e.fetching,a=e.json,i=v(Object(r.useState)(null),2),o=i[0],c=i[1];return t?"error":n?"fetching":l.a.createElement("main",null,l.a.createElement("div",{className:"active"},o&&l.a.createElement(y,{key:o.name,query:o})),l.a.createElement("nav",null,a.queries.map(function(e){return l.a.createElement(g,{key:e.name,active:e===o,query:e,onQueryClick:c})})))};n.n(a).a.render(l.a.createElement(function(){return l.a.createElement(r.StrictMode,null,l.a.createElement("h1",null,"Rack::Queries"),l.a.createElement(b,null))},null),document.getElementById("main"))}]);
\ No newline at end of file