diff --git a/Resources/Public/Module.js b/Resources/Public/Module.js index daaa684..a35c639 100644 --- a/Resources/Public/Module.js +++ b/Resources/Public/Module.js @@ -1,2 +1,2 @@ -(()=>{function e(e,t,n,r){Object.defineProperty(e,t,{get:n,set:r,enumerable:!0,configurable:!0})}var t,n,r,o,a,i,l,s={},u=[],c=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;function _(e,t){for(var n in t)e[n]=t[n];return e}function d(e){var t=e.parentNode;t&&t.removeChild(e)}function f(e,n,r){var o,a,i,l={};for(i in n)"key"==i?o=n[i]:"ref"==i?a=n[i]:l[i]=n[i];if(arguments.length>2&&(l.children=arguments.length>3?t.call(arguments,2):r),"function"==typeof e&&null!=e.defaultProps)for(i in e.defaultProps)void 0===l[i]&&(l[i]=e.defaultProps[i]);return m(e,l,o,a,null)}function m(e,t,o,a,i){var l={type:e,props:t,key:o,ref:a,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:null==i?++r:i};return null==i&&null!=n.vnode&&n.vnode(l),l}function h(e){return e.children}function p(e,t){this.props=e,this.context=t}function v(e,t){if(null==t)return e.__?v(e.__,e.__.__k.indexOf(e)+1):null;for(var n;tt&&o.sort((function(e,t){return e.__v.__b-t.__v.__b})));C.__r=0}function y(e,t,n,r,o,a,i,l,c,_){var d,f,p,E,g,C,y,I=r&&r.__k||u,b=I.length;for(n.__k=[],d=0;d0?m(E.type,E.props,E.key,E.ref?E.ref:null,E.__v):E)){if(E.__=n,E.__b=n.__b+1,null===(p=I[d])||p&&E.key==p.key&&E.type===p.type)I[d]=void 0;else for(f=0;f=0;t--)if((n=e.__k[t])&&(r=A(n)))return r;return null}function b(e,t,n){"-"===t[0]?e.setProperty(t,null==n?"":n):e[t]=null==n?"":"number"!=typeof n||c.test(t)?n:n+"px"}function O(e,t,n,r,o){var a;e:if("style"===t)if("string"==typeof n)e.style.cssText=n;else{if("string"==typeof r&&(e.style.cssText=r=""),r)for(t in r)n&&t in n||b(e.style,t,"");if(n)for(t in n)r&&n[t]===r[t]||b(e.style,t,n[t])}else if("o"===t[0]&&"n"===t[1])a=t!==(t=t.replace(/Capture$/,"")),t=t.toLowerCase()in e?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}),e.l[t+a]=n,n?r||e.addEventListener(t,a?N:R,a):e.removeEventListener(t,a?N:R,a);else if("dangerouslySetInnerHTML"!==t){if(o)t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!==t&&"height"!==t&&"href"!==t&&"list"!==t&&"form"!==t&&"tabIndex"!==t&&"download"!==t&&t in e)try{e[t]=null==n?"":n;break e}catch(e){}"function"==typeof n||(null==n||!1===n&&-1==t.indexOf("-")?e.removeAttribute(t):e.setAttribute(t,n))}}function R(e){return this.l[e.type+!1](n.event?n.event(e):e)}function N(e){return this.l[e.type+!0](n.event?n.event(e):e)}function D(e,r,o,a,i,l,u,c,f){var m,E,g,C,T,I,S,A,b,R,N,D,H,U,L,P=r.type;if(void 0!==r.constructor)return null;null!=o.__h&&(f=o.__h,c=r.__e=o.__e,r.__h=null,l=[c]),(m=n.__b)&&m(r);try{e:if("function"==typeof P){if(A=r.props,b=(m=P.contextType)&&a[m.__c],R=m?b?b.props.value:m.__:a,o.__c?S=(E=r.__c=o.__c).__=E.__E:("prototype"in P&&P.prototype.render?r.__c=E=new P(A,R):(r.__c=E=new p(A,R),E.constructor=P,E.render=M),b&&b.sub(E),E.props=A,E.state||(E.state={}),E.context=R,E.__n=a,g=E.__d=!0,E.__h=[],E._sb=[]),null==E.__s&&(E.__s=E.state),null!=P.getDerivedStateFromProps&&(E.__s==E.state&&(E.__s=_({},E.__s)),_(E.__s,P.getDerivedStateFromProps(A,E.__s))),C=E.props,T=E.state,E.__v=r,g)null==P.getDerivedStateFromProps&&null!=E.componentWillMount&&E.componentWillMount(),null!=E.componentDidMount&&E.__h.push(E.componentDidMount);else{if(null==P.getDerivedStateFromProps&&A!==C&&null!=E.componentWillReceiveProps&&E.componentWillReceiveProps(A,R),!E.__e&&null!=E.shouldComponentUpdate&&!1===E.shouldComponentUpdate(A,E.__s,R)||r.__v===o.__v){for(r.__v!==o.__v&&(E.props=A,E.state=E.__s,E.__d=!1),E.__e=!1,r.__e=o.__e,r.__k=o.__k,r.__k.forEach((function(e){e&&(e.__=r)})),N=0;N2&&(l.children=arguments.length>3?t.call(arguments,2):r),m(e.type,l,o||e.key,a||e.ref,null)}function w(e,t){var n={__c:t="__cC"+l++,__:e,Consumer:function(e,t){return e.children(t)},Provider:function(e){var n,r;return this.getChildContext||(n=[],(r={})[t]=this,this.getChildContext=function(){return r},this.shouldComponentUpdate=function(e){this.props.value!==e.value&&n.some((function(e){e.__e=!0,g(e)}))},this.sub=function(e){n.push(e);var t=e.componentWillUnmount;e.componentWillUnmount=function(){n.splice(n.indexOf(e),1),t&&t.call(e)}}),e.children}};return n.Provider.__=n.Consumer.contextType=n}function x(){return(x=Object.assign||function(e){for(var t=1;t=0||(o[n]=e[n]);return o}(e,["context","children"]);return G(t,n)}function F(){var e=new CustomEvent("_preact",{detail:{},bubbles:!0,cancelable:!0});this.dispatchEvent(e),this._vdom=f(V,x({},this._props,{context:e.detail.context}),function e(t,n){if(3===t.nodeType)return t.data;if(1!==t.nodeType)return null;var r=[],o={},a=0,i=t.attributes,l=t.childNodes;for(a=i.length;a--;)"slot"!==i[a].name&&(o[i[a].name]=i[a].value,o[B(i[a].name)]=i[a].value);for(a=l.length;a--;){var s=e(l[a],null),u=l[a].slot;u?o[u]=f($,{name:u},s):r[a]=s}var c=n?f($,null,r):r;return f(n||t.nodeName.toLowerCase(),o,c)}(this,this._vdomComponent)),(this.hasAttribute("hydrate")?k:P)(this._vdom,this._root)}function B(e){return e.replace(/-(\w)/g,(function(e,t){return t?t.toUpperCase():""}))}function j(e,t,n){if(this._vdom){var r={};r[e]=n=null==n?void 0:n,r[B(e)]=n,this._vdom=G(this._vdom,r),P(this._vdom,this._root)}}function W(){P(this._vdom=null,this._root)}function $(e,t){var n=this;return f("slot",x({},e,{ref:function(e){e?(n.ref=e,n._listener||(n._listener=function(e){e.stopPropagation(),e.detail.context=t},e.addEventListener("_preact",n._listener))):n.ref.removeEventListener("_preact",n._listener)}}))}t=u.slice,n={__e:function(e,t,n,r){for(var o,a,i;t=t.__;)if((o=t.__c)&&!o.__)try{if((a=o.constructor)&&null!=a.getDerivedStateFromError&&(o.setState(a.getDerivedStateFromError(e)),i=o.__d),null!=o.componentDidCatch&&(o.componentDidCatch(e,r||{}),i=o.__d),i)return o.__E=o}catch(t){e=t}throw e}},r=0,p.prototype.setState=function(e,t){var n;n=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=_({},this.state),"function"==typeof e&&(e=e(_({},n),this.props)),e&&_(n,e),null!=e&&this.__v&&(t&&this._sb.push(t),g(this))},p.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),g(this))},p.prototype.render=h,o=[],i="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,C.__r=0,l=0;var z=0;function X(e,t,r,o,a,i){var l,s,u={};for(s in t)"ref"==s?l=t[s]:u[s]=t[s];var c={type:e,props:u,key:r,ref:l,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:--z,__source:a,__self:i};if("function"==typeof e&&(l=e.defaultProps))for(s in l)void 0===u[s]&&(u[s]=l[s]);return n.vnode&&n.vnode(c),c}var Q,Y,q,Z,K=0,J=[],ee=[],te=n.__b,ne=n.__r,re=n.diffed,oe=n.__c,ae=n.unmount;function ie(e,t){n.__h&&n.__h(Y,e,K||t),K=0;var r=Y.__H||(Y.__H={__:[],__h:[]});return e>=r.__.length&&r.__.push({__V:ee}),r.__[e]}function le(e){return K=1,se(ye,e)}function se(e,t,n){var r=ie(Q++,2);if(r.t=e,!r.__c&&(r.__=[n?n(t):ye(void 0,t),function(e){var t=r.__N?r.__N[0]:r.__[0],n=r.t(t,e);t!==n&&(r.__N=[n,r.__[1]],r.__c.setState({}))}],r.__c=Y,!Y.u)){Y.u=!0;var o=Y.shouldComponentUpdate;Y.shouldComponentUpdate=function(e,t,n){if(!r.__c.__H)return!0;var a=r.__c.__H.__.filter((function(e){return e.__c}));if(a.every((function(e){return!e.__N})))return!o||o.call(this,e,t,n);var i=!1;return a.forEach((function(e){if(e.__N){var t=e.__[0];e.__=e.__N,e.__N=void 0,t!==e.__[0]&&(i=!0)}})),!(!i&&r.__c.props===e)&&(!o||o.call(this,e,t,n))}}return r.__N||r.__}function ue(e,t){var r=ie(Q++,3);!n.__s&&Ce(r.__H,t)&&(r.__=e,r.i=t,Y.__H.__h.push(r))}function ce(e,t){var r=ie(Q++,4);!n.__s&&Ce(r.__H,t)&&(r.__=e,r.i=t,Y.__h.push(r))}function _e(e){return K=5,de((function(){return{current:e}}),[])}function de(e,t){var n=ie(Q++,7);return Ce(n.__H,t)?(n.__V=e(),n.i=t,n.__h=e,n.__V):n.__}function fe(e,t){return K=8,de((function(){return e}),t)}function me(e){var t=Y.context[e.__c],n=ie(Q++,9);return n.c=e,t?(null==n.__&&(n.__=!0,t.sub(Y)),t.props.value):e.__}function he(){for(var e;e=J.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(Ee),e.__H.__h.forEach(ge),e.__H.__h=[]}catch(t){e.__H.__h=[],n.__e(t,e.__v)}}n.__b=function(e){Y=null,te&&te(e)},n.__r=function(e){ne&&ne(e),Q=0;var t=(Y=e.__c).__H;t&&(q===Y?(t.__h=[],Y.__h=[],t.__.forEach((function(e){e.__N&&(e.__=e.__N),e.__V=ee,e.__N=e.i=void 0}))):(t.__h.forEach(Ee),t.__h.forEach(ge),t.__h=[])),q=Y},n.diffed=function(e){re&&re(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(1!==J.push(t)&&Z===n.requestAnimationFrame||((Z=n.requestAnimationFrame)||ve)(he)),t.__H.__.forEach((function(e){e.i&&(e.__H=e.i),e.__V!==ee&&(e.__=e.__V),e.i=void 0,e.__V=ee}))),q=Y=null},n.__c=function(e,t){t.some((function(e){try{e.__h.forEach(Ee),e.__h=e.__h.filter((function(e){return!e.__||ge(e)}))}catch(r){t.some((function(e){e.__h&&(e.__h=[])})),t=[],n.__e(r,e.__v)}})),oe&&oe(e,t)},n.unmount=function(e){ae&&ae(e);var t,r=e.__c;r&&r.__H&&(r.__H.__.forEach((function(e){try{Ee(e)}catch(e){t=e}})),r.__H=void 0,t&&n.__e(t,r.__v))};var pe="function"==typeof requestAnimationFrame;function ve(e){var t,n=function(){clearTimeout(r),pe&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,100);pe&&(t=requestAnimationFrame(n))}function Ee(e){var t=Y,n=e.__c;"function"==typeof n&&(e.__c=void 0,n()),Y=t}function ge(e){var t=Y;e.__c=e.__(),Y=t}function Ce(e,t){return!e||e.length!==t.length||t.some((function(t,n){return t!==e[n]}))}function ye(e,t){return"function"==typeof t?t(e):t}function Te(e,t){for(var n in t)e[n]=t[n];return e}function Ie(e,t){for(var n in e)if("__source"!==n&&!(n in t))return!0;for(var r in t)if("__source"!==r&&e[r]!==t[r])return!0;return!1}function Se(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t}function Ae(e){this.props=e}(Ae.prototype=new p).isPureReactComponent=!0,Ae.prototype.shouldComponentUpdate=function(e,t){return Ie(this.props,e)||Ie(this.state,t)};var be=n.__b;n.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),be&&be(e)};var Oe="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.forward_ref")||3911;var Re=function(e,t){return null==e?null:I(I(e).map(t))},Ne={map:Re,forEach:Re,count:function(e){return e?I(e).length:0},only:function(e){var t=I(e);if(1!==t.length)throw"Children.only";return t[0]},toArray:I},De=n.__e;n.__e=function(e,t,n,r){if(e.then)for(var o,a=t;a=a.__;)if((o=a.__c)&&o.__c)return null==t.__e&&(t.__e=n.__e,t.__k=n.__k),o.__c(e,t);De(e,t,n,r)};var He=n.unmount;function Ue(e,t,n){return e&&(e.__c&&e.__c.__H&&(e.__c.__H.__.forEach((function(e){"function"==typeof e.__c&&e.__c()})),e.__c.__H=null),null!=(e=Te({},e)).__c&&(e.__c.__P===n&&(e.__c.__P=t),e.__c=null),e.__k=e.__k&&e.__k.map((function(e){return Ue(e,t,n)}))),e}function Le(e,t,n){return e&&(e.__v=null,e.__k=e.__k&&e.__k.map((function(e){return Le(e,t,n)})),e.__c&&e.__c.__P===t&&(e.__e&&n.insertBefore(e.__e,e.__d),e.__c.__e=!0,e.__c.__P=n)),e}function Me(){this.__u=0,this.t=null,this.__b=null}function Pe(e){var t=e.__.__c;return t&&t.__a&&t.__a(e)}function ke(){this.u=null,this.o=null}n.unmount=function(e){var t=e.__c;t&&t.__R&&t.__R(),t&&!0===e.__h&&(e.type=null),He&&He(e)},(Me.prototype=new p).__c=function(e,t){var n=t.__c,r=this;null==r.t&&(r.t=[]),r.t.push(n);var o=Pe(r.__v),a=!1,i=function(){a||(a=!0,n.__R=null,o?o(l):l())};n.__R=i;var l=function(){if(!--r.__u){if(r.state.__a){var e=r.state.__a;r.__v.__k[0]=Le(e,e.__c.__P,e.__c.__O)}var t;for(r.setState({__a:r.__b=null});t=r.t.pop();)t.forceUpdate()}},s=!0===t.__h;r.__u++||s||r.setState({__a:r.__b=r.__v.__k[0]}),e.then(i,i)},Me.prototype.componentWillUnmount=function(){this.t=[]},Me.prototype.render=function(e,t){if(this.__b){if(this.__v.__k){var n=document.createElement("div"),r=this.__v.__k[0].__c;this.__v.__k[0]=Ue(this.__b,n,r.__O=r.__P)}this.__b=null}var o=t.__a&&f(h,null,e.fallback);return o&&(o.__h=null),[f(h,null,t.__a?null:e.children),o]};var Ge=function(e,t,n){if(++n[1]===n[0]&&e.o.delete(t),e.props.revealOrder&&("t"!==e.props.revealOrder[0]||!e.o.size))for(n=e.u;n;){for(;n.length>3;)n.pop()();if(n[1]>>1,1),t.i.removeChild(e)}}),P(f(we,{context:t.context},e.__v),t.l)):t.l&&t.componentWillUnmount()}(ke.prototype=new p).__a=function(e){var t=this,n=Pe(t.__v),r=t.o.get(e);return r[0]++,function(o){var a=function(){t.props.revealOrder?(r.push(o),Ge(t,e,r)):o()};n?n(a):a()}},ke.prototype.render=function(e){this.u=null,this.o=new Map;var t=I(e.children);e.revealOrder&&"b"===e.revealOrder[0]&&t.reverse();for(var n=t.length;n--;)this.o.set(t[n],this.u=[1,0,this.u]);return e.children},ke.prototype.componentDidUpdate=ke.prototype.componentDidMount=function(){var e=this;this.o.forEach((function(t,n){Ge(e,n,t)}))};var Ve="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103,Fe=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,Be="undefined"!=typeof document,je=function(e){return("undefined"!=typeof Symbol&&"symbol"==typeof Symbol()?/fil|che|rad/i:/fil|che|ra/i).test(e)};p.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach((function(e){Object.defineProperty(p.prototype,e,{configurable:!0,get:function(){return this["UNSAFE_"+e]},set:function(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})}));var We=n.event;function $e(){}function ze(){return this.cancelBubble}function Xe(){return this.defaultPrevented}n.event=function(e){return We&&(e=We(e)),e.persist=$e,e.isPropagationStopped=ze,e.isDefaultPrevented=Xe,e.nativeEvent=e};var Qe,Ye={configurable:!0,get:function(){return this.class}},qe=n.vnode;n.vnode=function(e){var t=e.type,n=e.props,r=n;if("string"==typeof t){var o=-1===t.indexOf("-");for(var a in r={},n){var i=n[a];Be&&"children"===a&&"noscript"===t||"value"===a&&"defaultValue"in n&&null==i||("defaultValue"===a&&"value"in n&&null==n.value?a="value":"download"===a&&!0===i?i="":/ondoubleclick/i.test(a)?a="ondblclick":/^onchange(textarea|input)/i.test(a+t)&&!je(n.type)?a="oninput":/^onfocus$/i.test(a)?a="onfocusin":/^onblur$/i.test(a)?a="onfocusout":/^on(Ani|Tra|Tou|BeforeInp|Compo)/.test(a)?a=a.toLowerCase():o&&Fe.test(a)?a=a.replace(/[A-Z0-9]/g,"-$&").toLowerCase():null===i&&(i=void 0),/^oninput$/i.test(a)&&(a=a.toLowerCase(),r[a]&&(a="oninputCapture")),r[a]=i)}"select"==t&&r.multiple&&Array.isArray(r.value)&&(r.value=I(n.children).forEach((function(e){e.props.selected=-1!=r.value.indexOf(e.props.value)}))),"select"==t&&null!=r.defaultValue&&(r.value=I(n.children).forEach((function(e){e.props.selected=r.multiple?-1!=r.defaultValue.indexOf(e.props.value):r.defaultValue==e.props.value}))),e.props=r,n.class!=n.className&&(Ye.enumerable="className"in n,null!=n.className&&(r.class=n.className),Object.defineProperty(r,"className",Ye))}e.$$typeof=Ve,qe&&qe(e)};var Ze=n.__r;n.__r=function(e){Ze&&Ze(e),Qe=e.__c};var Ke=n.diffed;n.diffed=function(e){Ke&&Ke(e);var t=e.props,n=e.__e;null!=n&&"textarea"===e.type&&"value"in t&&t.value!==n.value&&(n.value=null==t.value?"":t.value),Qe=null};function Je(e){return!!e&&e.$$typeof===Ve}function et(e){e()}var tt={useState:le,useId:function(){var e=ie(Q++,11);if(!e.__){for(var t=Y.__v;null!==t&&!t.__m&&null!==t.__;)t=t.__;var n=t.__m||(t.__m=[0,0]);e.__="P"+n[0]+"-"+n[1]++}return e.__},useReducer:se,useEffect:ue,useLayoutEffect:ce,useInsertionEffect:ce,useTransition:function(){return[!1,et]},useDeferredValue:function(e){return e},useSyncExternalStore:function(e,t){var n=t(),r=le({h:{__:n,v:t}}),o=r[0].h,a=r[1];return ce((function(){o.__=n,o.v=t,Se(o.__,t())||a({h:o})}),[e,n,t]),ue((function(){return Se(o.__,o.v())||a({h:o}),e((function(){Se(o.__,o.v())||a({h:o})}))}),[e]),n},startTransition:et,useRef:_e,useImperativeHandle:function(e,t,n){K=6,ce((function(){return"function"==typeof e?(e(t()),function(){return e(null)}):e?(e.current=t(),function(){return e.current=null}):void 0}),null==n?n:n.concat(e))},useMemo:de,useCallback:fe,useContext:me,useDebugValue:function(e,t){n.useDebugValue&&n.useDebugValue(t?t(e):e)},version:"17.0.2",Children:Ne,render:function(e,t,n){return null==t.__k&&(t.textContent=""),P(e,t),"function"==typeof n&&n(),e?e.__c:null},hydrate:function(e,t,n){return k(e,t),"function"==typeof n&&n(),e?e.__c:null},unmountComponentAtNode:function(e){return!!e.__k&&(P(null,e),!0)},createPortal:function(e,t){var n=f(xe,{__v:e,i:t});return n.containerInfo=t,n},createElement:f,createContext:w,createFactory:function(e){return f.bind(null,e)},cloneElement:function(e){return Je(e)?G.apply(null,arguments):e},createRef:function(){return{current:null}},Fragment:h,isValidElement:Je,findDOMNode:function(e){return e&&(e.base||1===e.nodeType&&e)||null},Component:p,PureComponent:Ae,memo:function(e,t){function n(e){var n=this.props.ref,r=n==e.ref;return!r&&n&&(n.call?n(null):n.current=null),t?!t(this.props,e)||!r:Ie(this.props,e)}function r(t){return this.shouldComponentUpdate=n,f(e,t)}return r.displayName="Memo("+(e.displayName||e.name)+")",r.prototype.isReactComponent=!0,r.__f=!0,r},forwardRef:function(e){function t(t){var n=Te({},t);return delete n.ref,e(n,t.ref||null)}return t.$$typeof=Oe,t.render=t,t.prototype.isReactComponent=t.__f=!0,t.displayName="ForwardRef("+(e.displayName||e.name)+")",t},flushSync:function(e,t){return e(t)},unstable_batchedUpdates:function(e,t){return e(t)},StrictMode:h,Suspense:Me,SuspenseList:ke,lazy:function(e){var t,n,r;function o(o){if(t||(t=e()).then((function(e){n=e.default||e}),(function(e){r=e})),r)throw r;if(!n)throw t;return f(n,o)}return o.displayName="Lazy",o.__f=!0,o},__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:{ReactCurrentDispatcher:{current:{readContext:function(e){return Qe.__n[e.__c].props.value}}}}};function nt(e){const t=_e(e);return t.current=e,t}function rt(){throw new Error("Cycle detected")}function ot(){if(ct>1)ct--;else{for(var e,t=!1;void 0!==ut;){var n=ut;for(ut=void 0,_t++;void 0!==n;){var r=n.o;if(n.o=void 0,n.f&=-3,!(8&n.f)&&pt(n))try{n.c()}catch(n){t||(e=n,t=!0)}n=r}}if(_t=0,ct--,t)throw e}}function at(e){if(ct>0)return e();ct++;try{return e()}finally{ot()}}var it,lt,st=void 0,ut=void 0,ct=0,_t=0,dt=0;function ft(e){if(void 0!==st){var t=e.n;if(void 0===t||t.t!==st)return t={i:0,S:e,p:st.s,n:void 0,t:st,e:void 0,x:void 0,r:t},void 0!==st.s&&(st.s.n=t),st.s=t,e.n=t,32&st.f&&e.S(t),t;if(-1===t.i)return t.i=0,void 0!==t.n&&(t.n.p=t.p,void 0!==t.p&&(t.p.n=t.n),t.p=st.s,t.n=void 0,st.s.n=t,st.s=t),t}}function mt(e){this.v=e,this.i=0,this.n=void 0,this.t=void 0}function ht(e){return new mt(e)}function pt(e){for(var t=e.s;void 0!==t;t=t.n)if(t.S.i!==t.i||!t.S.h()||t.S.i!==t.i)return!0;return!1}function vt(e){for(var t=e.s;void 0!==t;t=t.n){var n=t.S.n;if(void 0!==n&&(t.r=n),t.S.n=t,t.i=-1,void 0===t.n){e.s=t;break}}}function Et(e){for(var t=e.s,n=void 0;void 0!==t;){var r=t.p;-1===t.i?(t.S.U(t),void 0!==r&&(r.n=t.n),void 0!==t.n&&(t.n.p=r)):n=t,t.S.n=t.r,void 0!==t.r&&(t.r=void 0),t=r}e.s=n}function gt(e){mt.call(this,void 0),this.x=e,this.s=void 0,this.g=dt-1,this.f=4}function Ct(e){return new gt(e)}function yt(e){var t=e.u;if(e.u=void 0,"function"==typeof t){ct++;var n=st;st=void 0;try{t()}catch(t){throw e.f&=-2,e.f|=8,Tt(e),t}finally{st=n,ot()}}}function Tt(e){for(var t=e.s;void 0!==t;t=t.n)t.S.U(t);e.x=void 0,e.s=void 0,yt(e)}function It(e){if(st!==this)throw new Error("Out-of-order effect");Et(this),st=e,this.f&=-2,8&this.f&&Tt(this),ot()}function St(e){this.x=e,this.u=void 0,this.s=void 0,this.o=void 0,this.f=32}function At(e){var t=new St(e);try{t.c()}catch(e){throw t.d(),e}return t.d.bind(t)}function bt(e,t){n[e]=t.bind(null,n[e]||function(){})}function Ot(e){lt&<(),lt=e&&e.S()}function Rt(e){var t=this,n=e.data,r=Dt(n);r.value=n;var o=de((function(){for(var e=t.__v;e=e.__;)if(e.__c){e.__c.__$f|=4;break}return t.__$u.c=function(){t.base.data=o.peek()},Ct((function(){var e=r.value.value;return 0===e?0:!0===e?"":e||""}))}),[]);return o.value}function Nt(e,t,n,r){var o=t in e&&void 0===e.ownerSVGElement,a=ht(n);return{o:function(e,t){a.value=e,r=t},d:At((function(){var n=a.value.value;r[t]!==n&&(r[t]=n,o?e[t]=n:n?e.setAttribute(t,n):e.removeAttribute(t))}))}}function Dt(e){return de((function(){return ht(e)}),[])}function Ht(e){var t=_e(e);return t.current=e,it.__$f|=4,de((function(){return Ct((function(){return t.current()}))}),[])}function Ut(e){var t=_e(e);t.current=e,ue((function(){return At((function(){return t.current()}))}),[])}function Lt(e,t=null){return Object.keys(e).reduce(((n,r)=>{const{icon:o,description:a,name:i,subCommands:l,action:s,canHandleQueries:u,closeOnExecute:c,category:_,executeManually:d}=e[r],f=t?`${t}.${r}`:r,m=l?Object.keys(l).map((e=>`${f}.${e}`)):[];return n[f]={id:f,name:i,icon:o,description:a,action:s,canHandleQueries:u,subCommandIds:m,parentId:t,closeOnExecute:c,category:_,executeManually:d},m.length>0?{...n,...Lt(l,f)}:n}),{})}mt.prototype.h=function(){return!0},mt.prototype.S=function(e){this.t!==e&&void 0===e.e&&(e.x=this.t,void 0!==this.t&&(this.t.e=e),this.t=e)},mt.prototype.U=function(e){if(void 0!==this.t){var t=e.e,n=e.x;void 0!==t&&(t.x=n,e.e=void 0),void 0!==n&&(n.e=t,e.x=void 0),e===this.t&&(this.t=n)}},mt.prototype.subscribe=function(e){var t=this;return At((function(){var n=t.value,r=32&this.f;this.f&=-33;try{e(n)}finally{this.f|=r}}))},mt.prototype.valueOf=function(){return this.value},mt.prototype.toString=function(){return this.value+""},mt.prototype.peek=function(){return this.v},Object.defineProperty(mt.prototype,"value",{get:function(){var e=ft(this);return void 0!==e&&(e.i=this.i),this.v},set:function(e){if(e!==this.v){_t>100&&rt(),this.v=e,this.i++,dt++,ct++;try{for(var t=this.t;void 0!==t;t=t.x)t.t.N()}finally{ot()}}}}),(gt.prototype=new mt).h=function(){if(this.f&=-3,1&this.f)return!1;if(32==(36&this.f))return!0;if(this.f&=-5,this.g===dt)return!0;if(this.g=dt,this.f|=1,this.i>0&&!pt(this))return this.f&=-2,!0;var e=st;try{vt(this),st=this;var t=this.x();(16&this.f||this.v!==t||0===this.i)&&(this.v=t,this.f&=-17,this.i++)}catch(e){this.v=e,this.f|=16,this.i++}return st=e,Et(this),this.f&=-2,!0},gt.prototype.S=function(e){if(void 0===this.t){this.f|=36;for(var t=this.s;void 0!==t;t=t.n)t.S.S(t)}mt.prototype.S.call(this,e)},gt.prototype.U=function(e){if(void 0!==this.t&&(mt.prototype.U.call(this,e),void 0===this.t)){this.f&=-33;for(var t=this.s;void 0!==t;t=t.n)t.S.U(t)}},gt.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(var e=this.t;void 0!==e;e=e.x)e.t.N()}},gt.prototype.peek=function(){if(this.h()||rt(),16&this.f)throw this.v;return this.v},Object.defineProperty(gt.prototype,"value",{get:function(){1&this.f&&rt();var e=ft(this);if(this.h(),void 0!==e&&(e.i=this.i),16&this.f)throw this.v;return this.v}}),St.prototype.c=function(){var e=this.S();try{8&this.f||void 0===this.x||(this.u=this.x())}finally{e()}},St.prototype.S=function(){1&this.f&&rt(),this.f|=1,this.f&=-9,yt(this),vt(this),ct++;var e=st;return st=this,It.bind(this,e)},St.prototype.N=function(){2&this.f||(this.f|=2,this.o=ut,ut=this)},St.prototype.d=function(){this.f|=8,1&this.f||Tt(this)},Rt.displayName="_st",Object.defineProperties(mt.prototype,{constructor:{configurable:!0,value:void 0},type:{configurable:!0,value:Rt},props:{configurable:!0,get:function(){return{data:this}}},__b:{configurable:!0,value:1}}),bt("__b",(function(e,t){if("string"==typeof t.type){var n,r=t.props;for(var o in r)if("children"!==o){var a=r[o];a instanceof mt&&(n||(t.__np=n={}),n[o]=a,r[o]=a.peek())}}e(t)})),bt("__r",(function(e,t){Ot();var n,r=t.__c;r&&(r.__$f&=-2,void 0===(n=r.__$u)&&(r.__$u=n=function(e){var t;return At((function(){t=this})),t.c=function(){r.__$f|=1,r.setState({})},t}())),it=r,Ot(n),e(t)})),bt("__e",(function(e,t,n,r){Ot(),it=void 0,e(t,n,r)})),bt("diffed",(function(e,t){var n;if(Ot(),it=void 0,"string"==typeof t.type&&(n=t.__e)){var r=t.__np,o=t.props;if(r){var a=n.U;if(a)for(var i in a){var l=a[i];void 0===l||i in r||(l.d(),a[i]=void 0)}else n.U=a={};for(var s in r){var u=a[s],c=r[s];void 0===u?(u=Nt(n,s,c,o),a[s]=u):u.o(c,o)}}}e(t)})),bt("unmount",(function(e,t){if("string"==typeof t.type){var n=t.__e;if(n){var r=n.U;if(r)for(var o in n.U=void 0,r){var a=r[o];a&&a.d()}}}else{var i=t.__c;if(i){var l=i.__$u;l&&(i.__$u=void 0,l.d())}}e(t)})),bt("__h",(function(e,t,n,r){r<3&&(t.__$f|=2),e(t,n,r)})),p.prototype.shouldComponentUpdate=function(e,t){var n=this.__$u;if(!(n&&void 0!==n.s||4&this.__$f))return!0;if(3&this.__$f)return!0;for(var r in t)return!0;for(var o in e)if("__source"!==o&&e[o]!==this.props[o])return!0;for(var a in this.props)if(!(a in e))return!0;return!1};const Mt="%c[COMMANDBAR]";var Pt={ok:(e,...t)=>console.log(Mt,"color: green",e,...t),error:(e,...t)=>console.log(Mt,"color: red",e,...t),warn:(e,...t)=>console.warn(Mt,"color: orange",e,...t),debug:()=>null};function kt(e,t,n){return Math.max(t,Math.min(n,e))}const Gt=new Intl.Collator("en").compare,wt=1/0,xt=/(?:\s+|^)-[a-z\d]+/gi,Vt={interSplit:"[^A-Za-z0-9']+",intraSplit:"[a-z][A-Z]",intraBound:"[A-Za-z][0-9]|[0-9][A-Za-z]|[a-z][A-Z]",interLft:0,interRgt:0,interChars:".",interIns:wt,intraChars:"[a-z\\d']",intraIns:0,intraContr:"'[a-z]{1,2}\\b",intraMode:0,intraSlice:[1,wt],intraSub:0,intraTrn:0,intraDel:0,intraFilt:(e,t,n)=>!0,sort:(e,t,n)=>{let{idx:r,chars:o,terms:a,interLft2:i,interLft1:l,start:s,intraIns:u,interIns:c}=e;return r.map(((e,t)=>t)).sort(((e,n)=>o[n]-o[e]||u[e]-u[n]||a[n]+i[n]+.5*l[n]-(a[e]+i[e]+.5*l[e])||c[e]-c[n]||s[e]-s[n]||Gt(t[r[e]],t[r[n]])))}},Ft=(e,t)=>0==t?"":1==t?e+"??":t==wt?e+"*?":e+`{0,${t}}?`,Bt="(?:\\b|_)";function jt(e){e=Object.assign({},Vt,e);const{interLft:t,interRgt:n,intraMode:r,intraSlice:o,intraIns:a,intraSub:i,intraTrn:l,intraDel:s,intraContr:u,intraSplit:c,interSplit:_,intraBound:d,intraChars:f}=e;let{intraRules:m}=e;null==m&&(m=e=>{let t=Vt.intraSlice,n=0,r=0,u=0,c=0,_=e.length;return _<=4?_>=3&&(u=Math.min(l,1),4==_&&(n=Math.min(a,1))):(t=o,n=a,r=i,u=l,c=s),{intraSlice:t,intraIns:n,intraSub:r,intraTrn:u,intraDel:c}});let h=!!c,p=new RegExp(c,"g"),v=new RegExp(_,"g"),E=new RegExp("^"+_+"|"+_+"$","g"),g=new RegExp(u,"gi");const C=e=>(e=e.replace(E,"").toLowerCase(),h&&(e=e.replace(p,(e=>e[0]+" "+e[1]))),e.split(v).filter((e=>""!=e))),y=(o,i=0,l=!1)=>{let s=C(o);if(0==s.length)throw"Empty needle!";let u,c=Array(s.length).fill("");if(s=s.map(((e,t)=>e.replace(g,(e=>(c[t]=e,""))))),1==r)u=s.map(((e,t)=>{let{intraSlice:n,intraIns:r,intraSub:o,intraTrn:a,intraDel:i}=m(e);if(r+o+a+i==0)return e+c[t];let[l,s]=n,u=e.slice(0,l),_=e.slice(s),d=e.slice(l,s);1==r&&1==u.length&&u!=d[0]&&(u+="(?!"+u+")");let h=d.length,p=[];if(o)for(let e=0;e0&&(e=")("+e+")("),u=s.map(((t,n)=>t.split("").map(((e,t,n)=>(1==a&&0==t&&n.length>1&&e[t]!=e[t+1]&&(e+="(?!"+e+")"),e))).join(e)+c[n]))}let _=2==t?Bt:"",d=2==n?Bt:"",h=d+Ft(e.interChars,e.interIns)+_;return i>0?l?u=_+"("+u.join(")"+d+"|"+_+"(")+")"+d:(u="("+u.join(")("+h+")(")+")",u="(.?"+_+")"+u+"("+d+".*)"):(u=u.join(h),u=_+u+d),[new RegExp(u,"i"),s,c]},T=(e,t,n)=>{let r=[],[o]=y(t);if(null!=n)for(let t=0;t{let[i,l,s]=y(a,1),[u]=y(a,2),c=l.length,_=r.length,d=Array(_).fill(0),f={idx:Array(_),start:d.slice(),chars:d.slice(),terms:d.slice(),interIns:d.slice(),intraIns:d.slice(),interLft2:d.slice(),interRgt2:d.slice(),interLft1:d.slice(),interRgt1:d.slice(),ranges:Array(_)},m=1==t||1==n,h=0;for(let a=0;a=u){let e=d[o+1].toLowerCase().indexOf(i);e>-1&&(H.push(v,e,u),v+=O(d,o,e,u),a=i,f=u,h=!0,0==r&&(p=v))}if(m||h){let e=v-1,r=v+f,l=!0,s=!0;if(-1==e||S.test(_[e]))h&&g++;else{if(2==t){E=!0;break}if(I&&A.test(_[e]+_[e+1]))h&&C++;else{if(1==t){let e=d[o+1],t=v+f;if(e.length>=u){let n,r=0,l=!1,s=new RegExp(i,"ig");for(;n=s.exec(e);){r=n.index;let e=t+r,o=e-1;if(-1==o||S.test(_[o])){g++,l=!0;break}if(A.test(_[o]+_[e])){C++,l=!0;break}}if(l){H.push(v,r,u),v+=O(d,o,r,u),a=i,f=u,h=!0;break}}E=!0;break}l=!1}}if(r==_.length||S.test(_[r]))h&&y++;else{if(2==n){E=!0;break}if(I&&A.test(_[r-1]+_[r]))h&&T++;else{if(1==n){E=!0;break}s=!1}}h&&(b+=u,l&&s&&R++)}if(f>u&&(D+=f-u),r>0&&(N+=d[o-1].length),!e.intraFilt(i,a,v)){E=!0;break}r0?0:1/0,c=l-3;for(let r=2;r0&&(t.push(o,i),o=i=n)}i>o&&t.push(o,i),h++}}if(h{let o=e[t]+e[t+1].slice(0,n);return e[t-1]+=o,e[t]=e[t+1].slice(n,n+r),e[t+1]=e[t+1].slice(n+r),o.length};return{search:(...t)=>((t,n,r=!1,o=1e3,a)=>{let i,l=null,s=null,u=[];if(n=n.replace(xt,(e=>(u.push(e.trim().slice(1)),""))),u.length>0&&(i=new RegExp(u.join("|"),"i"),""==n.trim())){let e=[];for(let n=0;n1){let n=e.slice().sort(((e,t)=>t.length-e.length));for(let e=0;ee.join(" "))),s=[];let r=new Set;for(let e=0;e!r.has(e))),o=T(t,l[e],n);for(let e=0;e0?a:T(t,n)]);let c=null,_=null;if(u.length>0&&(s=s.map((e=>e.filter((e=>!i.test(t[e])))))),s.reduce(((e,t)=>e+t.length),0)<=o){c={},_=[];for(let n=0;n0)for(let e=0;e{let e={A:"ÁÀÃÂÄĄ",a:"áàãâäą",E:"ÉÈÊËĖ",e:"éèêëę",I:"ÍÌÎÏĮ",i:"íìîïį",O:"ÓÒÔÕÖ",o:"óòôõö",U:"ÚÙÛÜŪŲ",u:"úùûüūų",C:"ÇČ",c:"çč",N:"Ñ",n:"ñ",S:"Š",s:"š"},t=new Map,n="";for(let r in e)e[r].split("").forEach((e=>{n+=e,t.set(e,r)}));let r=new RegExp(`[${n}]`,"g"),o=e=>t.get(e);return e=>{if("string"==typeof e)return e.replace(r,o);let t=Array(e.length);for(let n=0;nt?`${e}`:e,Xt=(e,t)=>e+t;jt.latinize=Wt,jt.permute=e=>$t([...Array(e.length).keys()]).sort(((e,t)=>{for(let n=0;nt.map((t=>e[t])))),jt.highlight=function(e,t,n=zt,r="",o=Xt){let a=o(r,n(e.substring(0,t[0]),!1));r=null!==a?a:r;for(let i=0;it.parentId===e||!e&&o.includes(t.id))),!t)return a.sort(((t,n)=>function(e,t,n,r){const o=r.includes(e.id),a=r.includes(t.id);if(o&&!a)return-1;if(!o&&a)return 1;if(o&&a)return r.indexOf(e.id)-r.indexOf(t.id);const i=n.includes(e.id),l=n.includes(t.id);return i&&!l?-1:!i&&l?1:e.name.localeCompare(t.name)}(t,n,r,e?[]:o))).map((e=>e.id));const i=a.map((({name:e,description:t})=>e+" "+t)),[l,,s]=Qt.search(i,t.toLowerCase());return s.map((e=>a[l[e]].id))}function qt(e,t="Assertion failed"){if(!1===e)throw Error(t)}function Zt(...e){return e.filter(Boolean).join(" ")}let Kt;var Jt;let en;var tn;let nn;var rn;(Jt=Kt||(Kt={})).COLLAPSED="collapsed",Jt.IDLE="idle",Jt.EXECUTING_COMMAND="executingCommand",Jt.DISPLAYING_RESULT="displayingResult",(tn=en||(en={})).RESET_SEARCH="RESET_SEARCH",tn.HIGHLIGHT_NEXT_ITEM="HIGHLIGHT_NEXT_ITEM",tn.HIGHLIGHT_PREVIOUS_ITEM="HIGHLIGHT_PREVIOUS_ITEM",tn.CANCEL="CANCEL",tn.SELECT_GROUP="SELECT_GROUP",tn.GO_TO_PARENT_GROUP="GO_TO_PARENT_GROUP",tn.UPDATE_SEARCH="UPDATE_SEARCH",tn.UPDATE_COMMAND_QUERY="UPDATE_COMMAND_QUERY",tn.EXECUTE_COMMAND="EXECUTE_COMMAND",tn.FINISH_COMMAND="FINISH_COMMAND",tn.UPDATE_RESULT="UPDATE_RESULT",tn.EXPAND="EXPAND",tn.ADD_FAVOURITE="ADD_FAVOURITE",tn.REMOVE_FAVOURITE="REMOVE_FAVOURITE",(rn=nn||(nn={})).ADD_FAVOURITE="ADD_FAVOURITE",rn.ADD_RECENTLY_USED="ADD_RECENTLY_USED",rn.EXPAND="EXPAND",rn.HIGHLIGHT_NEXT_COMMAND="HIGHLIGHT_NEXT_COMMAND",rn.HIGHLIGHT_NEXT_OPTION="HIGHLIGHT_NEXT_OPTION",rn.HIGHLIGHT_PREVIOUS_COMMAND="HIGHLIGHT_PREVIOUS_COMMAND",rn.HIGHLIGHT_PREVIOUS_OPTION="HIGHLIGHT_PREVIOUS_OPTION",rn.LEAVE_GROUP="LEAVE_GROUP",rn.REFRESH_COMMANDS="REFRESH_COMMANDS",rn.REMOVE_FAVOURITE="REMOVE_FAVOURITE",rn.RESET_HIGHLIGHT="RESET_HIGHLIGHT",rn.RESET_OPTION_HIGHLIGHT="RESET_OPTION_HIGHLIGHT",rn.RESET_SEARCH="RESET_SEARCH",rn.RESET_SEARCH_OR_LEAVE_GROUP="RESET_SEARCH_OR_LEAVE_GROUP",rn.SET_ACTIVE_COMMAND="SET_ACTIVE_COMMAND",rn.SET_COMMAND_QUERY="SET_COMMAND_QUERY",rn.SET_GROUP="SET_GROUP",rn.SET_SEARCH_WORD="SET_SEARCH_WORD",rn.UNSET_ACTIVE_COMMAND="UNSET_ACTIVE_COMMAND",rn.UNSET_RESULT="UNSET_RESULT",rn.UPDATE_RESULT="UPDATE_RESULT";Kt.COLLAPSED;const on={collapsed:{on:{UPDATE_SEARCH:{target:Kt.IDLE,actions:[nn.EXPAND,nn.SET_SEARCH_WORD,nn.REFRESH_COMMANDS]},HIGHLIGHT_NEXT_ITEM:{target:Kt.IDLE,actions:[nn.REFRESH_COMMANDS,nn.EXPAND]},EXPAND:{target:Kt.IDLE,actions:[nn.REFRESH_COMMANDS,nn.EXPAND]}}},idle:{on:{UPDATE_SEARCH:{target:Kt.IDLE,actions:[nn.SET_SEARCH_WORD,nn.RESET_HIGHLIGHT,nn.REFRESH_COMMANDS]},HIGHLIGHT_NEXT_ITEM:{target:Kt.IDLE,actions:[nn.HIGHLIGHT_NEXT_COMMAND]},HIGHLIGHT_PREVIOUS_ITEM:{target:Kt.IDLE,actions:[nn.HIGHLIGHT_PREVIOUS_COMMAND]},CANCEL:{target:Kt.IDLE,actions:[nn.RESET_HIGHLIGHT,nn.RESET_SEARCH_OR_LEAVE_GROUP,nn.REFRESH_COMMANDS]},EXECUTE_COMMAND:{target:Kt.EXECUTING_COMMAND,actions:[nn.ADD_RECENTLY_USED,nn.SET_ACTIVE_COMMAND,nn.REFRESH_COMMANDS]},GO_TO_PARENT_GROUP:{target:Kt.IDLE,actions:[nn.RESET_HIGHLIGHT,nn.LEAVE_GROUP,nn.REFRESH_COMMANDS]},SELECT_GROUP:{target:Kt.IDLE,actions:[nn.RESET_SEARCH,nn.RESET_HIGHLIGHT,nn.SET_GROUP,nn.REFRESH_COMMANDS]},ADD_FAVOURITE:{target:Kt.IDLE,actions:[nn.ADD_FAVOURITE,nn.REFRESH_COMMANDS]},REMOVE_FAVOURITE:{target:Kt.IDLE,actions:[nn.REMOVE_FAVOURITE,nn.REFRESH_COMMANDS]}}},executingCommand:{on:{UPDATE_RESULT:{target:Kt.DISPLAYING_RESULT,actions:[nn.UPDATE_RESULT]},FINISH_COMMAND:{target:Kt.IDLE,actions:[nn.UNSET_ACTIVE_COMMAND]}}},displayingResult:{on:{UPDATE_COMMAND_QUERY:{target:Kt.DISPLAYING_RESULT,actions:[nn.SET_COMMAND_QUERY]},UPDATE_RESULT:{target:Kt.DISPLAYING_RESULT,actions:[nn.UPDATE_RESULT,nn.RESET_OPTION_HIGHLIGHT]},HIGHLIGHT_NEXT_ITEM:{target:Kt.DISPLAYING_RESULT,actions:[nn.HIGHLIGHT_NEXT_OPTION]},HIGHLIGHT_PREVIOUS_ITEM:{target:Kt.DISPLAYING_RESULT,actions:[nn.HIGHLIGHT_PREVIOUS_OPTION]},EXECUTE_COMMAND:{target:Kt.DISPLAYING_RESULT,actions:[nn.SET_ACTIVE_COMMAND]},CANCEL:{target:Kt.IDLE,actions:[nn.UNSET_RESULT,nn.UNSET_ACTIVE_COMMAND,nn.RESET_OPTION_HIGHLIGHT]},FINISH_COMMAND:{target:Kt.DISPLAYING_RESULT,actions:[nn.UNSET_ACTIVE_COMMAND]}}}};function an(e,t,n){let r=on[e.status].on?.[t.type]??null;r||(Pt.error(`No transition found for event "${t.type}" in state "${e.status}"`),r={target:e.status});const o={...e,status:"string"==typeof r?r:r.target};return n&&"object"==typeof r&&r.actions?.forEach((e=>n(e,o,t))),Pt.debug(`Transitioned from "${e.status}" to "${o.status}" with event "${t.type}"`),o}function ln(e,t,n){switch(e){case nn.RESET_SEARCH:t.searchWord="";break;case nn.RESET_HIGHLIGHT:t.highlightedItem=0;break;case nn.REFRESH_COMMANDS:t.availableCommandIds=Yt(t.selectedCommandGroup,t.searchWord,t.commands,t.favouriteCommands,t.recentCommands);break;case nn.HIGHLIGHT_NEXT_COMMAND:t.highlightedItem=kt(t.highlightedItem+1,0,t.availableCommandIds.length-1);break;case nn.HIGHLIGHT_PREVIOUS_COMMAND:t.highlightedItem=kt(t.highlightedItem-1,0,t.availableCommandIds.length-1);break;case nn.HIGHLIGHT_NEXT_OPTION:t.highlightedOption=kt(t.highlightedOption+1,0,Object.keys(t.result.options).length-1);break;case nn.HIGHLIGHT_PREVIOUS_OPTION:t.highlightedOption=kt(t.highlightedOption-1,0,Object.keys(t.result.options).length-1);break;case nn.SET_SEARCH_WORD:qt(n.type===en.UPDATE_SEARCH),t.searchWord=n.searchWord;break;case nn.SET_COMMAND_QUERY:qt(n.type===en.UPDATE_COMMAND_QUERY),t.commandQuery=n.commandQuery;break;case nn.EXPAND:t.expanded=!0;break;case nn.SET_ACTIVE_COMMAND:qt(n.type===en.EXECUTE_COMMAND),t.activeCommandId=n.commandId,t.activeCommandMessage=n.message;break;case nn.UNSET_ACTIVE_COMMAND:t.activeCommandId=null,t.activeCommandMessage=null;break;case nn.UPDATE_RESULT:qt(n.type===en.UPDATE_RESULT),qt("boolean"==typeof n.result.success),t.result={options:{},message:"Command executed",view:null,success:!1,...n.result},t.resultCommandId=t.activeCommandId;break;case nn.RESET_OPTION_HIGHLIGHT:t.highlightedOption=0;break;case nn.RESET_SEARCH_OR_LEAVE_GROUP:t.commandQuery?t.commandQuery="":t.searchWord?t.searchWord="":t.selectedCommandGroup=t.selectedCommandGroup?t.commands[t.selectedCommandGroup].parentId:null;break;case nn.UNSET_RESULT:t.result=null,t.resultCommandId=null,t.commandQuery="";break;case nn.LEAVE_GROUP:t.selectedCommandGroup=t.selectedCommandGroup?t.commands[t.selectedCommandGroup].parentId:null;break;case nn.SET_GROUP:qt(n.type===en.SELECT_GROUP),t.selectedCommandGroup=n.commandId;break;case nn.ADD_FAVOURITE:qt(n.type===en.ADD_FAVOURITE),t.favouriteCommands.includes(n.commandId)||t.favouriteCommands.push(n.commandId);break;case nn.REMOVE_FAVOURITE:qt(n.type===en.REMOVE_FAVOURITE),t.favouriteCommands=t.favouriteCommands.filter((e=>e!==n.commandId));break;case nn.ADD_RECENTLY_USED:if(qt(n.type===en.EXECUTE_COMMAND),!t.commands[n.commandId].action)break;t.recentCommands.includes(n.commandId)&&(t.recentCommands=t.recentCommands.filter((e=>e!==n.commandId))),t.recentCommands.unshift(n.commandId),t.recentCommands.length>5&&t.recentCommands.pop();break;default:throw Error(`Action ${e} not implemented`)}}const sn=(e,t)=>an(e,t,ln);var un=tt.memo((({children:e})=>tt.createElement("span",{className:"xzQyjW_iconWrap"},e)));var cn=tt.memo((()=>{const{state:{showBranding:e}}=On(),{translate:t}=Ln();return e?tt.createElement("a",{href:"https://helzle.it/projects",title:t("CommandBarFooter.branding","Made with love by Sebastian Helzle"),target:"_blank",rel:"noreferrer noopener",className:"_345BVa_madeWithLove"},tt.createElement("small",null,t("CommandBarFooter.brandingSmall","Made with love by")),tt.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 180 180"},tt.createElement("defs",null,tt.createElement("linearGradient",{id:"a",gradientUnits:"userSpaceOnUse",x1:"280.25",y1:"377.003",x2:"373.261",y2:"377.003"},tt.createElement("stop",{offset:"0",stopColor:"#297AAC"}),tt.createElement("stop",{offset:"1",stopColor:"#53AADA"}))),tt.createElement("path",{d:"M0 180.017h37.287L71.35 52.898H34.061zM48.717 0l-9.083 33.898h36.675L85.392 0z",fill:"#B9B7B3"}),tt.createElement("path",{d:"M335.972 313.444H288.25l-8 28.306h47.691l-28.03 98.813h39.287l34.063-127.119z",fill:"url(#a)",transform:"translate(-195.462 -260.325)"}))):null}));function _n(){return tt.createElement("svg",{viewBox:"0 0 448 512"},tt.createElement("path",{fill:"currentColor",d:"m257.5 445.1-22.2 22.2c-9.4 9.4-24.6 9.4-33.9 0L7 273c-9.4-9.4-9.4-24.6 0-33.9L201.4 44.7c9.4-9.4 24.6-9.4 33.9 0l22.2 22.2c9.5 9.5 9.3 25-.4 34.3L136.6 216H424c13.3 0 24 10.7 24 24v32c0 13.3-10.7 24-24 24H136.6l120.5 114.8c9.8 9.3 10 24.8.4 34.3z"}))}function dn(){return tt.createElement("svg",{viewBox:"0 0 512 512"},tt.createElement("path",{fill:"currentColor",d:"M415.44 512h-95.11L212.12 357.46v91.1L125.69 512H28V29.82L68.47 0h108.05l123.74 176.13V63.45L386.69 0h97.69v461.5zM38.77 35.27V496l72-52.88V194l215.5 307.64h84.79l52.35-38.17h-78.27L69 13zm82.54 466.61 80-58.78v-101l-79.76-114.4v220.94L49 501.89h72.34zM80.63 10.77l310.6 442.57h82.37V10.77h-79.75v317.56L170.91 10.77zM311 191.65l72 102.81V15.93l-72 53v122.72z"}))}function fn(){return tt.createElement("svg",{viewBox:"0 0 512 512"},tt.createElement("path",{fill:"currentColor",d:"M288 39.056v16.659c0 10.804 7.281 20.159 17.686 23.066C383.204 100.434 440 171.518 440 256c0 101.689-82.295 184-184 184-101.689 0-184-82.295-184-184 0-84.47 56.786-155.564 134.312-177.219C216.719 75.874 224 66.517 224 55.712V39.064c0-15.709-14.834-27.153-30.046-23.234C86.603 43.482 7.394 141.206 8.003 257.332c.72 137.052 111.477 246.956 248.531 246.667C393.255 503.711 504 392.788 504 256c0-115.633-79.14-212.779-186.211-240.236C302.678 11.889 288 23.456 288 39.056z"}))}function mn(){return tt.createElement("svg",{viewBox:"0 0 576 512"},tt.createElement("path",{fill:"currentColor",d:"M528.1 171.5 382 150.2 316.7 17.8c-11.7-23.6-45.6-23.9-57.4 0L194 150.2 47.9 171.5c-26.2 3.8-36.7 36.1-17.7 54.6l105.7 103-25 145.5c-4.5 26.3 23.2 46 46.4 33.7L288 439.6l130.7 68.7c23.2 12.2 50.9-7.4 46.4-33.7l-25-145.5 105.7-103c19-18.5 8.5-50.8-17.7-54.6zM388.6 312.3l23.7 138.4L288 385.4l-124.3 65.3 23.7-138.4-100.6-98 139-20.2 62.2-126 62.2 126 139 20.2-100.6 98z"}))}function hn(){return tt.createElement("svg",{viewBox:"0 0 512 512"},tt.createElement("path",{fill:"currentColor",d:"M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm115.7 272l-176 101c-15.8 8.8-35.7-2.5-35.7-21V152c0-18.4 19.8-29.8 35.7-21l176 107c16.4 9.2 16.4 32.9 0 42z"}))}var pn=tt.memo((()=>{const{state:{activeCommandId:e,activeCommandMessage:t,commands:n,result:r,selectedCommandGroup:o,expanded:a},Icon:i}=On(),l=Ht((()=>e.value&&e.value?n.value[e.value]??r.value.options[e.value]:null));return a.value?tt.createElement("footer",{className:"UnIlTW_commandBarFooter"},e.value?tt.createElement("span",{className:"UnIlTW_activity"},tt.createElement(un,null,tt.createElement(fn,null)),tt.createElement("em",null,l.value.name," ‒ ",t)):o.value?tt.createElement("span",{className:"UnIlTW_breadcrumb"},tt.createElement(i,{icon:n.value[o.value].icon}),tt.createElement("small",null,n.value[o.value].name)):tt.createElement(un,null,tt.createElement(dn,null)),tt.createElement(cn,null)):null}));let vn=null;var En=tt.memo((()=>{const{state:e,actions:t}=On(),{executeCommand:n}=Dn(),{translate:r}=Ln(),o=_e(),a=fe((r=>{e.status.value===Kt.DISPLAYING_RESULT?(t.UPDATE_COMMAND_QUERY(r.target.value),e.commands.value[e.resultCommandId.value].executeManually||(vn&&clearTimeout(vn),vn=setTimeout((()=>n(e.resultCommandId.value)),500))):t.UPDATE_SEARCH(r.target.value)}),[]),i=fe((e=>{"Escape"===e.key&&o.current.value&&(e.preventDefault(),e.stopPropagation())}),[o.current]);return Ut((()=>{e.status.value!==Kt.EXECUTING_COMMAND&&o.current?.focus()})),tt.createElement(tt.Fragment,null,tt.createElement("input",{ref:o,className:"jZLCTa_searchBox",type:"search",placeholder:e.status.value===Kt.DISPLAYING_RESULT?r("SearchBox.commandQuery.placeholder","Enter the query for the command"):r("SearchBox.placeholder","What do you want to do today?"),autoFocus:!0,onChange:a,onKeyUp:i,value:e.status.value===Kt.DISPLAYING_RESULT?e.commandQuery:e.searchWord,"data-testid":"SearchBox"}),!e.expanded.value&&tt.createElement("button",{className:"jZLCTa_expandButton",onClick:t.EXPAND,title:r("SearchBox.expand.title","Expand to show all commands")},tt.createElement(un,null,tt.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 320 512"},tt.createElement("path",{fill:"currentColor",d:"M31.3 192h257.3c17.8 0 26.7 21.5 14.1 34.1L174.1 354.8c-7.8 7.8-20.5 7.8-28.3 0L17.2 226.1C4.6 213.5 13.5 192 31.3 192z"})))),e.status.value===Kt.DISPLAYING_RESULT&&e.commands.value[e.resultCommandId.value]?.executeManually&&tt.createElement("button",{className:"jZLCTa_executeButton",onClick:()=>n(e.resultCommandId.value),title:r("SearchBox.execute.title","Execute the command")},tt.createElement(un,null,tt.createElement(hn,null))))}));var gn=tt.memo((()=>{const{state:e,actions:t}=On(),n=Ht((()=>e.status.value==Kt.DISPLAYING_RESULT));return tt.createElement("header",{className:"_1JQCkq_commandBarHeader"},(n.value||e.selectedCommandGroup.value)&&tt.createElement("button",{type:"button",onClick:n.value?t.CANCEL:t.GO_TO_PARENT_GROUP,className:"_1JQCkq_backButton",title:"Back"},tt.createElement(un,null,tt.createElement(_n,null))),tt.createElement(En,null))}));function Cn({command:e,onItemSelect:t,highlightedId:n,onToggleFavourite:r}){const{state:{favouriteCommands:o},Icon:a}=On(),{translate:i}=Ln(),{id:l,name:s,description:u,icon:c,action:_}=e,d=function({subCommandIds:e,category:t,canHandleQueries:n,action:r},o){let a="command";return t||(e?.length>0?a="category":n?a="query":"string"==typeof r&&(a="link"),o(`CommandListItem.type.${a}`,a))}(e,i),f=Ht((()=>n.value===l)),m=Ht((()=>o.value.includes(l)));return tt.createElement("li",{className:Zt("bB4DKG_commandListItem",f.value&&"bB4DKG_highlighted"),onClick:()=>t(l),"data-testid":"CommandListItem"},tt.createElement(a,{icon:c}),tt.createElement("span",{className:"bB4DKG_label"},tt.createElement("span",null,s),u&&tt.createElement("span",{className:"bB4DKG_description"},"string"==typeof u?u:u())),r&&_&&tt.createElement("button",{type:"button",className:Zt("bB4DKG_favouriteButton",m.value&&"bB4DKG_isFavourite"),title:i("CommandListItem.toggleFavourite","Toggle favourite"),onClick:e=>{e.stopPropagation(),r(l)}},tt.createElement(un,null,tt.createElement(mn,null))),tt.createElement("small",{className:"bB4DKG_type"},d))}var yn=tt.memo(Cn);const Tn=()=>{const{state:{commands:e,highlightedItem:t,availableCommandIds:n,status:r,searchWord:o,favouriteCommands:a,recentCommands:i,selectedCommandGroup:l},actions:{ADD_FAVOURITE:s,REMOVE_FAVOURITE:u}}=On(),{translate:c}=Ln(),{executeCommand:_}=Dn(),d=tt.useRef(null);Ut((()=>{d.current?.querySelector(`li:nth-child(${t.value})`)?.scrollIntoView({behavior:"smooth",block:"center"})}));const f=fe((e=>{a.value.includes(e)?u(e):s(e)}),[a]),m=Ht((()=>o.value||l.value?[]:n.value.filter((e=>i.value.includes(e))))),h=Ht((()=>o.value||l.value?n.value:n.value.filter((e=>!i.value.includes(e))))),p=Ht((()=>n.value[t.value]));return tt.createElement("nav",{className:Zt("z-zZnG_results",r.value!==Kt.IDLE&&"z-zZnG_disabled"),"data-testid":"CommandList",ref:d},m.value.length>0&&tt.createElement(tt.Fragment,null,tt.createElement("h6",null,c("CommandList.suggestions","Recently used")),tt.createElement("ul",null,m.value.map((t=>tt.createElement(yn,{key:t,command:e.value[t],onItemSelect:_,highlightedId:p,onToggleFavourite:f}))))),h.value.length>0&&tt.createElement(tt.Fragment,null,tt.createElement("h6",null,c("CommandList.heading","Commands")),tt.createElement("ul",null,h.value.map((t=>tt.createElement(yn,{key:t,command:e.value[t],onItemSelect:_,highlightedId:p,onToggleFavourite:f}))))),0===n.value.length&&tt.createElement("small",{className:"z-zZnG_noResults"},c("CommandList.noCommandsMessage","No matching commands found")))};var In=tt.memo(Tn);var Sn=()=>{const{state:{result:e,highlightedOption:t}}=On(),{executeCommand:n}=Dn(),r=tt.useRef(null),o=Ht((()=>e.value?Object.values(e.value.options)[t.value].id:null));Ut((()=>{const e=t.value;r.current?.querySelector(`li:nth-child(${e})`)?.scrollIntoView({behavior:"smooth",block:"center"})}));const{options:a,view:i,message:l}=e.value??{};return tt.createElement("div",{className:"SDjQeG_commandResultsView"},l&&tt.createElement("h6",{className:"SDjQeG_message"},l),i?tt.createElement("div",null,i):"",a&&tt.createElement("nav",{className:"SDjQeG_results",ref:r},tt.createElement("ul",null,Object.keys(a).map((e=>tt.createElement(yn,{key:e,command:a[e],onItemSelect:n,highlightedId:o}))))))};var An=tt.memo((({handleToggle:e,disabled:t=!1,label:n,title:r})=>tt.createElement("button",{className:"Vkou1G_toggleButton",onClick:e,disabled:t,title:r},tt.createElement("span",null,n),tt.createElement("span",{className:"Vkou1G_buttonIcon"},"⌘K"))));const bn=w({}),On=()=>me(bn);const Rn=({commands:e,children:t,IconComponent:n,userPreferences:r})=>{const{state:o,dispatch:a}=de((()=>function(e){const t=ht(e);return{state:{activeCommandId:Ct((()=>t.value.activeCommandId)),activeCommandMessage:Ct((()=>t.value.activeCommandMessage)),availableCommandIds:Ct((()=>t.value.availableCommandIds)),commandQuery:Ct((()=>t.value.commandQuery)),commands:Ct((()=>t.value.commands)),expanded:Ct((()=>t.value.expanded)),favouriteCommands:Ct((()=>t.value.favouriteCommands)),highlightedItem:Ct((()=>t.value.highlightedItem)),highlightedOption:Ct((()=>t.value.highlightedOption)),recentCommands:Ct((()=>t.value.recentCommands)),result:Ct((()=>t.value.result)),resultCommandId:Ct((()=>t.value.resultCommandId)),searchWord:Ct((()=>t.value.searchWord)),selectedCommandGroup:Ct((()=>t.value.selectedCommandGroup)),showBranding:Ct((()=>t.value.showBranding)),status:Ct((()=>t.value.status))},dispatch:e=>{t.value=sn(t.value,e)}}}({activeCommandId:null,activeCommandMessage:null,availableCommandIds:Object.keys(e),commandQuery:"",commands:Lt(e),expanded:!1,favouriteCommands:r.favouriteCommands,highlightedItem:0,highlightedOption:0,recentCommands:r.recentCommands,result:null,resultCommandId:null,searchWord:"",selectedCommandGroup:null,showBranding:r.showBranding,status:Kt.COLLAPSED})),[]),i=de((()=>({[en.RESET_SEARCH]:()=>a({type:en.RESET_SEARCH}),[en.HIGHLIGHT_NEXT_ITEM]:()=>a({type:en.HIGHLIGHT_NEXT_ITEM}),[en.HIGHLIGHT_PREVIOUS_ITEM]:()=>a({type:en.HIGHLIGHT_PREVIOUS_ITEM}),[en.CANCEL]:()=>a({type:en.CANCEL}),[en.SELECT_GROUP]:e=>a({type:en.SELECT_GROUP,commandId:e}),[en.GO_TO_PARENT_GROUP]:()=>a({type:en.GO_TO_PARENT_GROUP}),[en.UPDATE_SEARCH]:e=>a({type:en.UPDATE_SEARCH,searchWord:e}),[en.UPDATE_COMMAND_QUERY]:e=>a({type:en.UPDATE_COMMAND_QUERY,commandQuery:e}),[en.EXECUTE_COMMAND]:async(e,t)=>(a({type:en.EXECUTE_COMMAND,commandId:e,message:t}),r.addRecentCommand(e).catch((e=>Pt.error("Could not add recent command",e)))),[en.FINISH_COMMAND]:()=>a({type:en.FINISH_COMMAND}),[en.UPDATE_RESULT]:e=>a({type:en.UPDATE_RESULT,result:e}),[en.EXPAND]:()=>a({type:en.EXPAND}),[en.ADD_FAVOURITE]:e=>{a({type:en.ADD_FAVOURITE,commandId:e}),r.setFavouriteCommands(o.favouriteCommands.value).catch((e=>Pt.error("Could not update favourite commands",e)))},[en.REMOVE_FAVOURITE]:e=>{a({type:en.REMOVE_FAVOURITE,commandId:e}),r.setFavouriteCommands(o.favouriteCommands.value).catch((e=>Pt.error("Could not update favourite commands",e)))}})),[]),l=fe((({icon:e,spin:t=!1})=>tt.createElement(un,null,tt.createElement(n,{icon:e,spin:t}))),[]);return tt.createElement(bn.Provider,{value:{state:o,actions:i,Icon:l}},t)},Nn=tt.createContext({}),Dn=()=>tt.useContext(Nn),Hn=({children:e,toggleOpen:t,dialogRef:n,open:r})=>{const{state:o,actions:a}=On(),i=nt((e=>{if(r&&!e.defaultPrevented)if("k"===e.key&&e.metaKey&&n?.current.contains(e.target))t(),e.stopPropagation(),e.preventDefault();else if("Escape"===e.key)e.stopPropagation(),e.preventDefault(),o.selectedCommandGroup.value||o.searchWord.value||o.commandQuery.value?a.CANCEL():t();else if("ArrowDown"===e.key)e.stopPropagation(),e.preventDefault(),a.HIGHLIGHT_NEXT_ITEM();else if("ArrowUp"===e.key)e.stopPropagation(),e.preventDefault(),a.HIGHLIGHT_PREVIOUS_ITEM();else if("Enter"===e.key){e.stopPropagation(),e.preventDefault();let t=o.availableCommandIds.value[o.highlightedItem.value];o.status.value===Kt.DISPLAYING_RESULT&&(t=Object.values(o.result.value.options).length?Object.keys(o.result.value.options)[o.highlightedOption.value]:o.resultCommandId.value),t&&l(t)}})),l=fe((async e=>{const n=o.result.value?.options[e]??o.commands.value[e],{action:r,canHandleQueries:i,subCommandIds:l,name:s}=n;if(l?.length>0)return void a.SELECT_GROUP(e);if(qt(r,`Command ${e} has no action`),"string"==typeof r)return await a.EXECUTE_COMMAND(e,"Loading url"),0===r.indexOf("http")&&0!==r.indexOf(document.location.origin)?window.open(r,"_blank","noopener,noreferrer")?.focus():window.location.href=r,a.FINISH_COMMAND();a.EXECUTE_COMMAND(e,"Running command");const u=r(i?o.commandQuery.value:void 0);if(u.then)u.then((e=>{if(e&&!e.success)throw new Error(`The command "${s}" failed`)})).catch((e=>{Pt.error("Command error",s,e)})).finally((()=>{a.FINISH_COMMAND()}));else if(u.next){const e=u;for await(const t of e)a.UPDATE_RESULT(t);a.FINISH_COMMAND()}else Pt.error("Command result is not a promise or generator",u);n.closeOnExecute&&t()}),[o.searchWord,o.commands,o.result]),s=nt((e=>{l(e)}));return ue((()=>{if(!r)return;const e=e=>i.current(e);return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)}),[r]),tt.createElement(Nn.Provider,{value:{executeCommand:s.current}},e)},Un=w({}),Ln=()=>me(Un),Mn=({translate:e,children:t})=>tt.createElement(Un.Provider,{value:{translate:e}},t);var Pn=({onDrag:e,open:t,toggleOpen:n})=>{const{state:{expanded:r,result:o}}=On(),a=_e(null),i=Dt(!1),l=Dt({left:window.innerWidth/2-300,top:window.innerHeight/2-20}),s=Dt({offsetLeft:0,offsetTop:0}),u=Dt(!1),c=Ht((()=>{const{left:e,top:t}=l.value;return u?{left:e+"px",top:t+"px",translate:"none",visibility:i.value?"hidden":"visible"}:{}})),_=fe(((e,t)=>{const n=a.current.getBoundingClientRect();l.value={left:kt(e,0,window.innerWidth-n.width),top:kt(t,0,window.innerHeight-n.height)}}),[]),d=fe((t=>{"INPUT"!==t.target.tagName&&(console.debug("dragstart"),t.dataTransfer.setData("text/plain","CommandBar"),t.dataTransfer.dropEffect="move",t.dataTransfer.effectAllowed="move",at((()=>{s.value={offsetLeft:t.clientX-a.current.offsetLeft,offsetTop:t.clientY-a.current.offsetTop},u.value=!0})),e&&e(!0))}),[a.current]),f=fe((t=>{const{clientX:n,clientY:r}=t;console.debug("dragdrop",n,r,s.value),at((()=>{i.value=!1,_(n-s.value.offsetLeft,r-s.value.offsetTop)})),e&&e(!1)}),[a.current]),m=fe((()=>_(l.value.left,l.value.top)),[]);return ue((()=>{if(t)return a.current.parentElement.addEventListener("drop",f),window.addEventListener("resize",m),()=>{a.current.parentElement.removeEventListener("drop",f),window.removeEventListener("resize",m)}}),[t,m,f]),t?tt.createElement("dialog",{ref:a,className:Zt("eoy0jW_commandBar",o.value&&"eoy0jW_hasResults"),open:t,draggable:!0,onDragStart:d,onDrag:()=>i.value=!0,style:c.value,"data-testid":"CommandBarDialog"},tt.createElement(Hn,{toggleOpen:n,dialogRef:a,open:t},tt.createElement(gn,null),tt.createElement("div",{className:Zt("eoy0jW_resultsWrap",r.value&&"eoy0jW_expanded",o.value&&"eoy0jW_split")},r.value&&tt.createElement(In,null),o.value&&tt.createElement(Sn,null)),tt.createElement(pn,null))):null};var kn=({commands:e,open:t,toggleOpen:n,onDrag:r,IconComponent:o,userPreferences:a,translate:i})=>tt.createElement(Mn,{translate:i},tt.createElement(Rn,{commands:e,IconComponent:o,userPreferences:a},tt.createElement(Pn,{onDrag:r,open:t,toggleOpen:n}))),Gn={};async function wn(e,t,n="GET"){return t&&"GET"===n&&(e=Object.keys(t).reduce(((e,n)=>e+"&"+n+"="+encodeURIComponent(t[n])),e+"?")),fetch(e,{method:n,credentials:"include",body:t&&"POST"===n?JSON.stringify(t):void 0,headers:{"Content-Type":"application/json",Accept:"application/json"}}).then((e=>{if(200!==e.status)throw new Error(`The request failed with code ${e.status}: "${e.statusText}"`);return e.headers.get("Content-Type")?.includes("application/json")?e.json():e.text()}))}e(Gn,"getPreferences",(()=>Vn)),e(Gn,"setFavouriteCommands",(()=>Fn)),e(Gn,"addRecentCommand",(()=>Bn));async function xn(e,t){return wn(e,t,"POST")}async function Vn(){return wn("/neos/shel-neos-commandbar/preferences/getpreferences")}async function Fn(e){return xn("/neos/shel-neos-commandbar/preferences/setfavourites",{commandIds:e})}async function Bn(e){return xn("/neos/shel-neos-commandbar/preferences/addrecentcommand",{commandId:e})}var jn={};e(jn,"getCommands",(()=>Wn));async function Wn(){return wn("/neos/service/data-source/shel-neos-commandbar-commands")}var $n={};e($n,"searchNeosDocs",(()=>zn));async function zn(e){return e?wn("/neos/service/data-source/shel-neos-commandbar-search-neos-docs",{query:e}):{}}var Xn={};e(Xn,"searchNeosPackages",(()=>Qn));async function Qn(e){return e?wn("/neos/service/data-source/shel-neos-commandbar-search-neos-packages",{query:e}):{}}var Yn,qn;Yn="o4liXq_fullScreenLayer",qn="o4liXq_spin";var Zn=({spin:e=!1})=>X("svg",{className:e?qn:"",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",children:X("path",{fill:"currentColor",d:"M509.5 184.6 458.9 32.8C452.4 13.2 434.1 0 413.4 0H272v192h238.7c-.4-2.5-.4-5-1.2-7.4zM240 0H98.6c-20.7 0-39 13.2-45.5 32.8L2.5 184.6c-.8 2.4-.8 4.9-1.2 7.4H240V0zM0 224v240c0 26.5 21.5 48 48 48h416c26.5 0 48-21.5 48-48V224H0z"})});class Kn extends p{static tagName="command-bar-container";static options={shadow:!0};constructor(){super(),Kn.i18nRegistry=window.NeosCMS.I18n,this.state={initialized:!1,open:!1,dragging:!1,commands:{searchNeosDocs:{name:Kn.translate("CommandBarUiPlugin.command.documentation","Documentation"),description:Kn.translate("CommandBarUiPlugin.command.documentation.description","Browse or search the Neos documentation"),icon:"book",canHandleQueries:!0,action:this.handleSearchNeosDocs.bind(this)},searchNeosPackages:{name:Kn.translate("CommandBarUiPlugin.command.packages","Packages"),description:Kn.translate("CommandBarUiPlugin.command.packages.description","Search for Neos packages"),icon:"boxes",canHandleQueries:!0,action:this.handleSearchNeosPackages.bind(this)}},preferences:{favouriteCommands:[],recentCommands:[],recentDocuments:[],showBranding:!0}}}static translate=(e,t,n)=>("string"==typeof t&&(n=t,t={}),Kn.i18nRegistry.translate(e,n,"Shel.Neos.CommandBar","Main",t));async componentDidMount(){try{const e=await Gn.getPreferences(),t=await jn.getCommands();this.setState((n=>({initialized:!0,preferences:e,commands:{...n.commands,...t}}))),document.addEventListener("keydown",(e=>{"k"===e.key&&e.metaKey&&(e.stopPropagation(),e.preventDefault(),this.handleToggle())}))}catch(e){Pt.error(e)}}handleToggle=()=>{this.setState((({open:e})=>({open:!e})))};handleDrag=e=>{this.setState({dragging:e})};handleSearchNeosDocs=async function*(e){let t;yield{success:!0,message:Kn.translate("CommandBarUiPlugin.command.documentation.searching",{query:e},`Search for "${e}"`)};const n=await $n.searchNeosDocs(e).catch((e=>{Pt.error("Could not search Neos docs",e),t=e.message}));t||!n?yield{success:!1,message:Kn.translate("CommandBarUiPlugin.command.documentation.error","Search failed"),view:t}:yield{success:!0,message:Kn.translate("CommandBarUiPlugin.command.documentation.matches",{matches:Object.keys(n).length},`${Object.values(n).length} options match your query`),options:n}};handleSearchNeosPackages=async function*(e){let t;yield{success:!0,message:Kn.translate("CommandBarUiPlugin.command.packages.searching",{query:e},`Search for "${e}"`)};const n=await Xn.searchNeosPackages(e).catch((e=>{Pt.error("Could not search Neos packages",e),t=e.message}));t||!n?yield{success:!1,message:Kn.translate("CommandBarUiPlugin.command.packages.error","Search failed"),view:t}:yield{success:!0,message:Kn.translate("CommandBarUiPlugin.command.packages.matches",{matches:Object.values(n).length},`${Object.values(n).length} options match your query`),options:n}};render(){const{initialized:e,open:t,dragging:n,commands:r,preferences:o}=this.state;return X(h,{children:[X("style",{children:'@import "'+this.props.styleuri+'";'}),X("div",{className:"o4liXq_pluginWrap",children:[X(An,{handleToggle:this.handleToggle,disabled:!e,label:Kn.translate("ToggleButton.label","Search…"),title:Kn.translate("ToggleButton.title","Search and execute commands")}),e&&X("div",{className:[Yn,t&&"o4liXq_open"].join(" "),onDragOver:e=>e.preventDefault(),style:n?{pointerEvents:"all"}:null,children:X(kn,{commands:r,open:t,toggleOpen:this.handleToggle,onDrag:this.handleDrag,IconComponent:Zn,userPreferences:{...o,setFavouriteCommands:Gn.setFavouriteCommands,addRecentCommand:Gn.addRecentCommand},translate:Kn.translate})})]})]})}}!function(e,t,n,r){function o(){var t=Reflect.construct(HTMLElement,[],o);return t._vdomComponent=e,t._root=r&&r.shadow?t.attachShadow({mode:"open"}):t,t}(o.prototype=Object.create(HTMLElement.prototype)).constructor=o,o.prototype.connectedCallback=F,o.prototype.attributeChangedCallback=j,o.prototype.disconnectedCallback=W,n=n||e.observedAttributes||Object.keys(e.propTypes||{}),o.observedAttributes=n,n.forEach((function(e){Object.defineProperty(o.prototype,e,{get:function(){return this._vdom.props[e]},set:function(t){this._vdom?this.attributeChangedCallback(e,null,t):(this._props||(this._props={}),this._props[e]=t,this.connectedCallback());var n=typeof t;null!=t&&"string"!==n&&"boolean"!==n&&"number"!==n||this.setAttribute(e,t)}})})),customElements.define(t||e.tagName||e.displayName||e.name,o)}(Kn,null,null,Kn.options),window.addEventListener("neoscms-i18n-initialized",(()=>{const e=document.querySelector(".neos-top-bar-left"),t=document.createElement("command-bar-container");t.id="shel-neos-commandbar";const n=document.querySelector('link[rel="stylesheet"][href*="Shel.Neos.CommandBar"]');t.setAttribute("styleuri",n.href),e.appendChild(t)}))})(); +(()=>{function e(e,t,n,r){Object.defineProperty(e,t,{get:n,set:r,enumerable:!0,configurable:!0})}var t,n,r,o,a,i,l,s={},u=[],c=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;function _(e,t){for(var n in t)e[n]=t[n];return e}function d(e){var t=e.parentNode;t&&t.removeChild(e)}function f(e,n,r){var o,a,i,l={};for(i in n)"key"==i?o=n[i]:"ref"==i?a=n[i]:l[i]=n[i];if(arguments.length>2&&(l.children=arguments.length>3?t.call(arguments,2):r),"function"==typeof e&&null!=e.defaultProps)for(i in e.defaultProps)void 0===l[i]&&(l[i]=e.defaultProps[i]);return m(e,l,o,a,null)}function m(e,t,o,a,i){var l={type:e,props:t,key:o,ref:a,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:null==i?++r:i};return null==i&&null!=n.vnode&&n.vnode(l),l}function h(e){return e.children}function p(e,t){this.props=e,this.context=t}function v(e,t){if(null==t)return e.__?v(e.__,e.__.__k.indexOf(e)+1):null;for(var n;tt&&o.sort((function(e,t){return e.__v.__b-t.__v.__b})));C.__r=0}function y(e,t,n,r,o,a,i,l,c,_){var d,f,p,E,g,C,y,I=r&&r.__k||u,b=I.length;for(n.__k=[],d=0;d0?m(E.type,E.props,E.key,E.ref?E.ref:null,E.__v):E)){if(E.__=n,E.__b=n.__b+1,null===(p=I[d])||p&&E.key==p.key&&E.type===p.type)I[d]=void 0;else for(f=0;f=0;t--)if((n=e.__k[t])&&(r=A(n)))return r;return null}function b(e,t,n){"-"===t[0]?e.setProperty(t,null==n?"":n):e[t]=null==n?"":"number"!=typeof n||c.test(t)?n:n+"px"}function O(e,t,n,r,o){var a;e:if("style"===t)if("string"==typeof n)e.style.cssText=n;else{if("string"==typeof r&&(e.style.cssText=r=""),r)for(t in r)n&&t in n||b(e.style,t,"");if(n)for(t in n)r&&n[t]===r[t]||b(e.style,t,n[t])}else if("o"===t[0]&&"n"===t[1])a=t!==(t=t.replace(/Capture$/,"")),t=t.toLowerCase()in e?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}),e.l[t+a]=n,n?r||e.addEventListener(t,a?N:R,a):e.removeEventListener(t,a?N:R,a);else if("dangerouslySetInnerHTML"!==t){if(o)t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!==t&&"height"!==t&&"href"!==t&&"list"!==t&&"form"!==t&&"tabIndex"!==t&&"download"!==t&&t in e)try{e[t]=null==n?"":n;break e}catch(e){}"function"==typeof n||(null==n||!1===n&&-1==t.indexOf("-")?e.removeAttribute(t):e.setAttribute(t,n))}}function R(e){return this.l[e.type+!1](n.event?n.event(e):e)}function N(e){return this.l[e.type+!0](n.event?n.event(e):e)}function D(e,r,o,a,i,l,u,c,f){var m,E,g,C,T,I,S,A,b,R,N,D,H,U,L,P=r.type;if(void 0!==r.constructor)return null;null!=o.__h&&(f=o.__h,c=r.__e=o.__e,r.__h=null,l=[c]),(m=n.__b)&&m(r);try{e:if("function"==typeof P){if(A=r.props,b=(m=P.contextType)&&a[m.__c],R=m?b?b.props.value:m.__:a,o.__c?S=(E=r.__c=o.__c).__=E.__E:("prototype"in P&&P.prototype.render?r.__c=E=new P(A,R):(r.__c=E=new p(A,R),E.constructor=P,E.render=M),b&&b.sub(E),E.props=A,E.state||(E.state={}),E.context=R,E.__n=a,g=E.__d=!0,E.__h=[],E._sb=[]),null==E.__s&&(E.__s=E.state),null!=P.getDerivedStateFromProps&&(E.__s==E.state&&(E.__s=_({},E.__s)),_(E.__s,P.getDerivedStateFromProps(A,E.__s))),C=E.props,T=E.state,E.__v=r,g)null==P.getDerivedStateFromProps&&null!=E.componentWillMount&&E.componentWillMount(),null!=E.componentDidMount&&E.__h.push(E.componentDidMount);else{if(null==P.getDerivedStateFromProps&&A!==C&&null!=E.componentWillReceiveProps&&E.componentWillReceiveProps(A,R),!E.__e&&null!=E.shouldComponentUpdate&&!1===E.shouldComponentUpdate(A,E.__s,R)||r.__v===o.__v){for(r.__v!==o.__v&&(E.props=A,E.state=E.__s,E.__d=!1),E.__e=!1,r.__e=o.__e,r.__k=o.__k,r.__k.forEach((function(e){e&&(e.__=r)})),N=0;N2&&(l.children=arguments.length>3?t.call(arguments,2):r),m(e.type,l,o||e.key,a||e.ref,null)}function w(e,t){var n={__c:t="__cC"+l++,__:e,Consumer:function(e,t){return e.children(t)},Provider:function(e){var n,r;return this.getChildContext||(n=[],(r={})[t]=this,this.getChildContext=function(){return r},this.shouldComponentUpdate=function(e){this.props.value!==e.value&&n.some((function(e){e.__e=!0,g(e)}))},this.sub=function(e){n.push(e);var t=e.componentWillUnmount;e.componentWillUnmount=function(){n.splice(n.indexOf(e),1),t&&t.call(e)}}),e.children}};return n.Provider.__=n.Consumer.contextType=n}function x(){return(x=Object.assign||function(e){for(var t=1;t=0||(o[n]=e[n]);return o}(e,["context","children"]);return G(t,n)}function F(){var e=new CustomEvent("_preact",{detail:{},bubbles:!0,cancelable:!0});this.dispatchEvent(e),this._vdom=f(V,x({},this._props,{context:e.detail.context}),function e(t,n){if(3===t.nodeType)return t.data;if(1!==t.nodeType)return null;var r=[],o={},a=0,i=t.attributes,l=t.childNodes;for(a=i.length;a--;)"slot"!==i[a].name&&(o[i[a].name]=i[a].value,o[B(i[a].name)]=i[a].value);for(a=l.length;a--;){var s=e(l[a],null),u=l[a].slot;u?o[u]=f($,{name:u},s):r[a]=s}var c=n?f($,null,r):r;return f(n||t.nodeName.toLowerCase(),o,c)}(this,this._vdomComponent)),(this.hasAttribute("hydrate")?k:P)(this._vdom,this._root)}function B(e){return e.replace(/-(\w)/g,(function(e,t){return t?t.toUpperCase():""}))}function j(e,t,n){if(this._vdom){var r={};r[e]=n=null==n?void 0:n,r[B(e)]=n,this._vdom=G(this._vdom,r),P(this._vdom,this._root)}}function W(){P(this._vdom=null,this._root)}function $(e,t){var n=this;return f("slot",x({},e,{ref:function(e){e?(n.ref=e,n._listener||(n._listener=function(e){e.stopPropagation(),e.detail.context=t},e.addEventListener("_preact",n._listener))):n.ref.removeEventListener("_preact",n._listener)}}))}t=u.slice,n={__e:function(e,t,n,r){for(var o,a,i;t=t.__;)if((o=t.__c)&&!o.__)try{if((a=o.constructor)&&null!=a.getDerivedStateFromError&&(o.setState(a.getDerivedStateFromError(e)),i=o.__d),null!=o.componentDidCatch&&(o.componentDidCatch(e,r||{}),i=o.__d),i)return o.__E=o}catch(t){e=t}throw e}},r=0,p.prototype.setState=function(e,t){var n;n=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=_({},this.state),"function"==typeof e&&(e=e(_({},n),this.props)),e&&_(n,e),null!=e&&this.__v&&(t&&this._sb.push(t),g(this))},p.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),g(this))},p.prototype.render=h,o=[],i="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,C.__r=0,l=0;var z=0;function X(e,t,r,o,a,i){var l,s,u={};for(s in t)"ref"==s?l=t[s]:u[s]=t[s];var c={type:e,props:u,key:r,ref:l,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:--z,__source:a,__self:i};if("function"==typeof e&&(l=e.defaultProps))for(s in l)void 0===u[s]&&(u[s]=l[s]);return n.vnode&&n.vnode(c),c}var Q,Y,q,Z,K=0,J=[],ee=[],te=n.__b,ne=n.__r,re=n.diffed,oe=n.__c,ae=n.unmount;function ie(e,t){n.__h&&n.__h(Y,e,K||t),K=0;var r=Y.__H||(Y.__H={__:[],__h:[]});return e>=r.__.length&&r.__.push({__V:ee}),r.__[e]}function le(e){return K=1,se(ye,e)}function se(e,t,n){var r=ie(Q++,2);if(r.t=e,!r.__c&&(r.__=[n?n(t):ye(void 0,t),function(e){var t=r.__N?r.__N[0]:r.__[0],n=r.t(t,e);t!==n&&(r.__N=[n,r.__[1]],r.__c.setState({}))}],r.__c=Y,!Y.u)){Y.u=!0;var o=Y.shouldComponentUpdate;Y.shouldComponentUpdate=function(e,t,n){if(!r.__c.__H)return!0;var a=r.__c.__H.__.filter((function(e){return e.__c}));if(a.every((function(e){return!e.__N})))return!o||o.call(this,e,t,n);var i=!1;return a.forEach((function(e){if(e.__N){var t=e.__[0];e.__=e.__N,e.__N=void 0,t!==e.__[0]&&(i=!0)}})),!(!i&&r.__c.props===e)&&(!o||o.call(this,e,t,n))}}return r.__N||r.__}function ue(e,t){var r=ie(Q++,3);!n.__s&&Ce(r.__H,t)&&(r.__=e,r.i=t,Y.__H.__h.push(r))}function ce(e,t){var r=ie(Q++,4);!n.__s&&Ce(r.__H,t)&&(r.__=e,r.i=t,Y.__h.push(r))}function _e(e){return K=5,de((function(){return{current:e}}),[])}function de(e,t){var n=ie(Q++,7);return Ce(n.__H,t)?(n.__V=e(),n.i=t,n.__h=e,n.__V):n.__}function fe(e,t){return K=8,de((function(){return e}),t)}function me(e){var t=Y.context[e.__c],n=ie(Q++,9);return n.c=e,t?(null==n.__&&(n.__=!0,t.sub(Y)),t.props.value):e.__}function he(){for(var e;e=J.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(Ee),e.__H.__h.forEach(ge),e.__H.__h=[]}catch(t){e.__H.__h=[],n.__e(t,e.__v)}}n.__b=function(e){Y=null,te&&te(e)},n.__r=function(e){ne&&ne(e),Q=0;var t=(Y=e.__c).__H;t&&(q===Y?(t.__h=[],Y.__h=[],t.__.forEach((function(e){e.__N&&(e.__=e.__N),e.__V=ee,e.__N=e.i=void 0}))):(t.__h.forEach(Ee),t.__h.forEach(ge),t.__h=[])),q=Y},n.diffed=function(e){re&&re(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(1!==J.push(t)&&Z===n.requestAnimationFrame||((Z=n.requestAnimationFrame)||ve)(he)),t.__H.__.forEach((function(e){e.i&&(e.__H=e.i),e.__V!==ee&&(e.__=e.__V),e.i=void 0,e.__V=ee}))),q=Y=null},n.__c=function(e,t){t.some((function(e){try{e.__h.forEach(Ee),e.__h=e.__h.filter((function(e){return!e.__||ge(e)}))}catch(r){t.some((function(e){e.__h&&(e.__h=[])})),t=[],n.__e(r,e.__v)}})),oe&&oe(e,t)},n.unmount=function(e){ae&&ae(e);var t,r=e.__c;r&&r.__H&&(r.__H.__.forEach((function(e){try{Ee(e)}catch(e){t=e}})),r.__H=void 0,t&&n.__e(t,r.__v))};var pe="function"==typeof requestAnimationFrame;function ve(e){var t,n=function(){clearTimeout(r),pe&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,100);pe&&(t=requestAnimationFrame(n))}function Ee(e){var t=Y,n=e.__c;"function"==typeof n&&(e.__c=void 0,n()),Y=t}function ge(e){var t=Y;e.__c=e.__(),Y=t}function Ce(e,t){return!e||e.length!==t.length||t.some((function(t,n){return t!==e[n]}))}function ye(e,t){return"function"==typeof t?t(e):t}function Te(e,t){for(var n in t)e[n]=t[n];return e}function Ie(e,t){for(var n in e)if("__source"!==n&&!(n in t))return!0;for(var r in t)if("__source"!==r&&e[r]!==t[r])return!0;return!1}function Se(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t}function Ae(e){this.props=e}(Ae.prototype=new p).isPureReactComponent=!0,Ae.prototype.shouldComponentUpdate=function(e,t){return Ie(this.props,e)||Ie(this.state,t)};var be=n.__b;n.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),be&&be(e)};var Oe="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.forward_ref")||3911;var Re=function(e,t){return null==e?null:I(I(e).map(t))},Ne={map:Re,forEach:Re,count:function(e){return e?I(e).length:0},only:function(e){var t=I(e);if(1!==t.length)throw"Children.only";return t[0]},toArray:I},De=n.__e;n.__e=function(e,t,n,r){if(e.then)for(var o,a=t;a=a.__;)if((o=a.__c)&&o.__c)return null==t.__e&&(t.__e=n.__e,t.__k=n.__k),o.__c(e,t);De(e,t,n,r)};var He=n.unmount;function Ue(e,t,n){return e&&(e.__c&&e.__c.__H&&(e.__c.__H.__.forEach((function(e){"function"==typeof e.__c&&e.__c()})),e.__c.__H=null),null!=(e=Te({},e)).__c&&(e.__c.__P===n&&(e.__c.__P=t),e.__c=null),e.__k=e.__k&&e.__k.map((function(e){return Ue(e,t,n)}))),e}function Le(e,t,n){return e&&(e.__v=null,e.__k=e.__k&&e.__k.map((function(e){return Le(e,t,n)})),e.__c&&e.__c.__P===t&&(e.__e&&n.insertBefore(e.__e,e.__d),e.__c.__e=!0,e.__c.__P=n)),e}function Me(){this.__u=0,this.t=null,this.__b=null}function Pe(e){var t=e.__.__c;return t&&t.__a&&t.__a(e)}function ke(){this.u=null,this.o=null}n.unmount=function(e){var t=e.__c;t&&t.__R&&t.__R(),t&&!0===e.__h&&(e.type=null),He&&He(e)},(Me.prototype=new p).__c=function(e,t){var n=t.__c,r=this;null==r.t&&(r.t=[]),r.t.push(n);var o=Pe(r.__v),a=!1,i=function(){a||(a=!0,n.__R=null,o?o(l):l())};n.__R=i;var l=function(){if(!--r.__u){if(r.state.__a){var e=r.state.__a;r.__v.__k[0]=Le(e,e.__c.__P,e.__c.__O)}var t;for(r.setState({__a:r.__b=null});t=r.t.pop();)t.forceUpdate()}},s=!0===t.__h;r.__u++||s||r.setState({__a:r.__b=r.__v.__k[0]}),e.then(i,i)},Me.prototype.componentWillUnmount=function(){this.t=[]},Me.prototype.render=function(e,t){if(this.__b){if(this.__v.__k){var n=document.createElement("div"),r=this.__v.__k[0].__c;this.__v.__k[0]=Ue(this.__b,n,r.__O=r.__P)}this.__b=null}var o=t.__a&&f(h,null,e.fallback);return o&&(o.__h=null),[f(h,null,t.__a?null:e.children),o]};var Ge=function(e,t,n){if(++n[1]===n[0]&&e.o.delete(t),e.props.revealOrder&&("t"!==e.props.revealOrder[0]||!e.o.size))for(n=e.u;n;){for(;n.length>3;)n.pop()();if(n[1]>>1,1),t.i.removeChild(e)}}),P(f(we,{context:t.context},e.__v),t.l)):t.l&&t.componentWillUnmount()}(ke.prototype=new p).__a=function(e){var t=this,n=Pe(t.__v),r=t.o.get(e);return r[0]++,function(o){var a=function(){t.props.revealOrder?(r.push(o),Ge(t,e,r)):o()};n?n(a):a()}},ke.prototype.render=function(e){this.u=null,this.o=new Map;var t=I(e.children);e.revealOrder&&"b"===e.revealOrder[0]&&t.reverse();for(var n=t.length;n--;)this.o.set(t[n],this.u=[1,0,this.u]);return e.children},ke.prototype.componentDidUpdate=ke.prototype.componentDidMount=function(){var e=this;this.o.forEach((function(t,n){Ge(e,n,t)}))};var Ve="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103,Fe=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,Be="undefined"!=typeof document,je=function(e){return("undefined"!=typeof Symbol&&"symbol"==typeof Symbol()?/fil|che|rad/i:/fil|che|ra/i).test(e)};p.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach((function(e){Object.defineProperty(p.prototype,e,{configurable:!0,get:function(){return this["UNSAFE_"+e]},set:function(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})}));var We=n.event;function $e(){}function ze(){return this.cancelBubble}function Xe(){return this.defaultPrevented}n.event=function(e){return We&&(e=We(e)),e.persist=$e,e.isPropagationStopped=ze,e.isDefaultPrevented=Xe,e.nativeEvent=e};var Qe,Ye={configurable:!0,get:function(){return this.class}},qe=n.vnode;n.vnode=function(e){var t=e.type,n=e.props,r=n;if("string"==typeof t){var o=-1===t.indexOf("-");for(var a in r={},n){var i=n[a];Be&&"children"===a&&"noscript"===t||"value"===a&&"defaultValue"in n&&null==i||("defaultValue"===a&&"value"in n&&null==n.value?a="value":"download"===a&&!0===i?i="":/ondoubleclick/i.test(a)?a="ondblclick":/^onchange(textarea|input)/i.test(a+t)&&!je(n.type)?a="oninput":/^onfocus$/i.test(a)?a="onfocusin":/^onblur$/i.test(a)?a="onfocusout":/^on(Ani|Tra|Tou|BeforeInp|Compo)/.test(a)?a=a.toLowerCase():o&&Fe.test(a)?a=a.replace(/[A-Z0-9]/g,"-$&").toLowerCase():null===i&&(i=void 0),/^oninput$/i.test(a)&&(a=a.toLowerCase(),r[a]&&(a="oninputCapture")),r[a]=i)}"select"==t&&r.multiple&&Array.isArray(r.value)&&(r.value=I(n.children).forEach((function(e){e.props.selected=-1!=r.value.indexOf(e.props.value)}))),"select"==t&&null!=r.defaultValue&&(r.value=I(n.children).forEach((function(e){e.props.selected=r.multiple?-1!=r.defaultValue.indexOf(e.props.value):r.defaultValue==e.props.value}))),e.props=r,n.class!=n.className&&(Ye.enumerable="className"in n,null!=n.className&&(r.class=n.className),Object.defineProperty(r,"className",Ye))}e.$$typeof=Ve,qe&&qe(e)};var Ze=n.__r;n.__r=function(e){Ze&&Ze(e),Qe=e.__c};var Ke=n.diffed;n.diffed=function(e){Ke&&Ke(e);var t=e.props,n=e.__e;null!=n&&"textarea"===e.type&&"value"in t&&t.value!==n.value&&(n.value=null==t.value?"":t.value),Qe=null};function Je(e){return!!e&&e.$$typeof===Ve}function et(e){e()}var tt={useState:le,useId:function(){var e=ie(Q++,11);if(!e.__){for(var t=Y.__v;null!==t&&!t.__m&&null!==t.__;)t=t.__;var n=t.__m||(t.__m=[0,0]);e.__="P"+n[0]+"-"+n[1]++}return e.__},useReducer:se,useEffect:ue,useLayoutEffect:ce,useInsertionEffect:ce,useTransition:function(){return[!1,et]},useDeferredValue:function(e){return e},useSyncExternalStore:function(e,t){var n=t(),r=le({h:{__:n,v:t}}),o=r[0].h,a=r[1];return ce((function(){o.__=n,o.v=t,Se(o.__,t())||a({h:o})}),[e,n,t]),ue((function(){return Se(o.__,o.v())||a({h:o}),e((function(){Se(o.__,o.v())||a({h:o})}))}),[e]),n},startTransition:et,useRef:_e,useImperativeHandle:function(e,t,n){K=6,ce((function(){return"function"==typeof e?(e(t()),function(){return e(null)}):e?(e.current=t(),function(){return e.current=null}):void 0}),null==n?n:n.concat(e))},useMemo:de,useCallback:fe,useContext:me,useDebugValue:function(e,t){n.useDebugValue&&n.useDebugValue(t?t(e):e)},version:"17.0.2",Children:Ne,render:function(e,t,n){return null==t.__k&&(t.textContent=""),P(e,t),"function"==typeof n&&n(),e?e.__c:null},hydrate:function(e,t,n){return k(e,t),"function"==typeof n&&n(),e?e.__c:null},unmountComponentAtNode:function(e){return!!e.__k&&(P(null,e),!0)},createPortal:function(e,t){var n=f(xe,{__v:e,i:t});return n.containerInfo=t,n},createElement:f,createContext:w,createFactory:function(e){return f.bind(null,e)},cloneElement:function(e){return Je(e)?G.apply(null,arguments):e},createRef:function(){return{current:null}},Fragment:h,isValidElement:Je,findDOMNode:function(e){return e&&(e.base||1===e.nodeType&&e)||null},Component:p,PureComponent:Ae,memo:function(e,t){function n(e){var n=this.props.ref,r=n==e.ref;return!r&&n&&(n.call?n(null):n.current=null),t?!t(this.props,e)||!r:Ie(this.props,e)}function r(t){return this.shouldComponentUpdate=n,f(e,t)}return r.displayName="Memo("+(e.displayName||e.name)+")",r.prototype.isReactComponent=!0,r.__f=!0,r},forwardRef:function(e){function t(t){var n=Te({},t);return delete n.ref,e(n,t.ref||null)}return t.$$typeof=Oe,t.render=t,t.prototype.isReactComponent=t.__f=!0,t.displayName="ForwardRef("+(e.displayName||e.name)+")",t},flushSync:function(e,t){return e(t)},unstable_batchedUpdates:function(e,t){return e(t)},StrictMode:h,Suspense:Me,SuspenseList:ke,lazy:function(e){var t,n,r;function o(o){if(t||(t=e()).then((function(e){n=e.default||e}),(function(e){r=e})),r)throw r;if(!n)throw t;return f(n,o)}return o.displayName="Lazy",o.__f=!0,o},__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:{ReactCurrentDispatcher:{current:{readContext:function(e){return Qe.__n[e.__c].props.value}}}}};function nt(e){const t=_e(e);return t.current=e,t}function rt(){throw new Error("Cycle detected")}function ot(){if(ct>1)ct--;else{for(var e,t=!1;void 0!==ut;){var n=ut;for(ut=void 0,_t++;void 0!==n;){var r=n.o;if(n.o=void 0,n.f&=-3,!(8&n.f)&&pt(n))try{n.c()}catch(n){t||(e=n,t=!0)}n=r}}if(_t=0,ct--,t)throw e}}function at(e){if(ct>0)return e();ct++;try{return e()}finally{ot()}}var it,lt,st=void 0,ut=void 0,ct=0,_t=0,dt=0;function ft(e){if(void 0!==st){var t=e.n;if(void 0===t||t.t!==st)return t={i:0,S:e,p:st.s,n:void 0,t:st,e:void 0,x:void 0,r:t},void 0!==st.s&&(st.s.n=t),st.s=t,e.n=t,32&st.f&&e.S(t),t;if(-1===t.i)return t.i=0,void 0!==t.n&&(t.n.p=t.p,void 0!==t.p&&(t.p.n=t.n),t.p=st.s,t.n=void 0,st.s.n=t,st.s=t),t}}function mt(e){this.v=e,this.i=0,this.n=void 0,this.t=void 0}function ht(e){return new mt(e)}function pt(e){for(var t=e.s;void 0!==t;t=t.n)if(t.S.i!==t.i||!t.S.h()||t.S.i!==t.i)return!0;return!1}function vt(e){for(var t=e.s;void 0!==t;t=t.n){var n=t.S.n;if(void 0!==n&&(t.r=n),t.S.n=t,t.i=-1,void 0===t.n){e.s=t;break}}}function Et(e){for(var t=e.s,n=void 0;void 0!==t;){var r=t.p;-1===t.i?(t.S.U(t),void 0!==r&&(r.n=t.n),void 0!==t.n&&(t.n.p=r)):n=t,t.S.n=t.r,void 0!==t.r&&(t.r=void 0),t=r}e.s=n}function gt(e){mt.call(this,void 0),this.x=e,this.s=void 0,this.g=dt-1,this.f=4}function Ct(e){return new gt(e)}function yt(e){var t=e.u;if(e.u=void 0,"function"==typeof t){ct++;var n=st;st=void 0;try{t()}catch(t){throw e.f&=-2,e.f|=8,Tt(e),t}finally{st=n,ot()}}}function Tt(e){for(var t=e.s;void 0!==t;t=t.n)t.S.U(t);e.x=void 0,e.s=void 0,yt(e)}function It(e){if(st!==this)throw new Error("Out-of-order effect");Et(this),st=e,this.f&=-2,8&this.f&&Tt(this),ot()}function St(e){this.x=e,this.u=void 0,this.s=void 0,this.o=void 0,this.f=32}function At(e){var t=new St(e);try{t.c()}catch(e){throw t.d(),e}return t.d.bind(t)}function bt(e,t){n[e]=t.bind(null,n[e]||function(){})}function Ot(e){lt&<(),lt=e&&e.S()}function Rt(e){var t=this,n=e.data,r=Dt(n);r.value=n;var o=de((function(){for(var e=t.__v;e=e.__;)if(e.__c){e.__c.__$f|=4;break}return t.__$u.c=function(){t.base.data=o.peek()},Ct((function(){var e=r.value.value;return 0===e?0:!0===e?"":e||""}))}),[]);return o.value}function Nt(e,t,n,r){var o=t in e&&void 0===e.ownerSVGElement,a=ht(n);return{o:function(e,t){a.value=e,r=t},d:At((function(){var n=a.value.value;r[t]!==n&&(r[t]=n,o?e[t]=n:n?e.setAttribute(t,n):e.removeAttribute(t))}))}}function Dt(e){return de((function(){return ht(e)}),[])}function Ht(e){var t=_e(e);return t.current=e,it.__$f|=4,de((function(){return Ct((function(){return t.current()}))}),[])}function Ut(e){var t=_e(e);t.current=e,ue((function(){return At((function(){return t.current()}))}),[])}function Lt(e,t=null){return Object.keys(e).reduce(((n,r)=>{const{icon:o,description:a,name:i,subCommands:l,action:s,canHandleQueries:u,closeOnExecute:c,category:_,executeManually:d}=e[r],f=t?`${t}.${r}`:r,m=l?Object.keys(l).map((e=>`${f}.${e}`)):[];return n[f]={id:f,name:i,icon:o,description:a,action:s,canHandleQueries:u,subCommandIds:m,parentId:t,closeOnExecute:c,category:_,executeManually:d},m.length>0?{...n,...Lt(l,f)}:n}),{})}mt.prototype.h=function(){return!0},mt.prototype.S=function(e){this.t!==e&&void 0===e.e&&(e.x=this.t,void 0!==this.t&&(this.t.e=e),this.t=e)},mt.prototype.U=function(e){if(void 0!==this.t){var t=e.e,n=e.x;void 0!==t&&(t.x=n,e.e=void 0),void 0!==n&&(n.e=t,e.x=void 0),e===this.t&&(this.t=n)}},mt.prototype.subscribe=function(e){var t=this;return At((function(){var n=t.value,r=32&this.f;this.f&=-33;try{e(n)}finally{this.f|=r}}))},mt.prototype.valueOf=function(){return this.value},mt.prototype.toString=function(){return this.value+""},mt.prototype.peek=function(){return this.v},Object.defineProperty(mt.prototype,"value",{get:function(){var e=ft(this);return void 0!==e&&(e.i=this.i),this.v},set:function(e){if(e!==this.v){_t>100&&rt(),this.v=e,this.i++,dt++,ct++;try{for(var t=this.t;void 0!==t;t=t.x)t.t.N()}finally{ot()}}}}),(gt.prototype=new mt).h=function(){if(this.f&=-3,1&this.f)return!1;if(32==(36&this.f))return!0;if(this.f&=-5,this.g===dt)return!0;if(this.g=dt,this.f|=1,this.i>0&&!pt(this))return this.f&=-2,!0;var e=st;try{vt(this),st=this;var t=this.x();(16&this.f||this.v!==t||0===this.i)&&(this.v=t,this.f&=-17,this.i++)}catch(e){this.v=e,this.f|=16,this.i++}return st=e,Et(this),this.f&=-2,!0},gt.prototype.S=function(e){if(void 0===this.t){this.f|=36;for(var t=this.s;void 0!==t;t=t.n)t.S.S(t)}mt.prototype.S.call(this,e)},gt.prototype.U=function(e){if(void 0!==this.t&&(mt.prototype.U.call(this,e),void 0===this.t)){this.f&=-33;for(var t=this.s;void 0!==t;t=t.n)t.S.U(t)}},gt.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(var e=this.t;void 0!==e;e=e.x)e.t.N()}},gt.prototype.peek=function(){if(this.h()||rt(),16&this.f)throw this.v;return this.v},Object.defineProperty(gt.prototype,"value",{get:function(){1&this.f&&rt();var e=ft(this);if(this.h(),void 0!==e&&(e.i=this.i),16&this.f)throw this.v;return this.v}}),St.prototype.c=function(){var e=this.S();try{8&this.f||void 0===this.x||(this.u=this.x())}finally{e()}},St.prototype.S=function(){1&this.f&&rt(),this.f|=1,this.f&=-9,yt(this),vt(this),ct++;var e=st;return st=this,It.bind(this,e)},St.prototype.N=function(){2&this.f||(this.f|=2,this.o=ut,ut=this)},St.prototype.d=function(){this.f|=8,1&this.f||Tt(this)},Rt.displayName="_st",Object.defineProperties(mt.prototype,{constructor:{configurable:!0,value:void 0},type:{configurable:!0,value:Rt},props:{configurable:!0,get:function(){return{data:this}}},__b:{configurable:!0,value:1}}),bt("__b",(function(e,t){if("string"==typeof t.type){var n,r=t.props;for(var o in r)if("children"!==o){var a=r[o];a instanceof mt&&(n||(t.__np=n={}),n[o]=a,r[o]=a.peek())}}e(t)})),bt("__r",(function(e,t){Ot();var n,r=t.__c;r&&(r.__$f&=-2,void 0===(n=r.__$u)&&(r.__$u=n=function(e){var t;return At((function(){t=this})),t.c=function(){r.__$f|=1,r.setState({})},t}())),it=r,Ot(n),e(t)})),bt("__e",(function(e,t,n,r){Ot(),it=void 0,e(t,n,r)})),bt("diffed",(function(e,t){var n;if(Ot(),it=void 0,"string"==typeof t.type&&(n=t.__e)){var r=t.__np,o=t.props;if(r){var a=n.U;if(a)for(var i in a){var l=a[i];void 0===l||i in r||(l.d(),a[i]=void 0)}else n.U=a={};for(var s in r){var u=a[s],c=r[s];void 0===u?(u=Nt(n,s,c,o),a[s]=u):u.o(c,o)}}}e(t)})),bt("unmount",(function(e,t){if("string"==typeof t.type){var n=t.__e;if(n){var r=n.U;if(r)for(var o in n.U=void 0,r){var a=r[o];a&&a.d()}}}else{var i=t.__c;if(i){var l=i.__$u;l&&(i.__$u=void 0,l.d())}}e(t)})),bt("__h",(function(e,t,n,r){r<3&&(t.__$f|=2),e(t,n,r)})),p.prototype.shouldComponentUpdate=function(e,t){var n=this.__$u;if(!(n&&void 0!==n.s||4&this.__$f))return!0;if(3&this.__$f)return!0;for(var r in t)return!0;for(var o in e)if("__source"!==o&&e[o]!==this.props[o])return!0;for(var a in this.props)if(!(a in e))return!0;return!1};const Mt="%c[COMMANDBAR]";var Pt={ok:(e,...t)=>console.log(Mt,"color: green",e,...t),error:(e,...t)=>console.log(Mt,"color: red",e,...t),warn:(e,...t)=>console.warn(Mt,"color: orange",e,...t),debug:()=>null};function kt(e,t,n){return Math.max(t,Math.min(n,e))}const Gt=new Intl.Collator("en").compare,wt=1/0,xt=/(?:\s+|^)-[a-z\d]+/gi,Vt={interSplit:"[^A-Za-z0-9']+",intraSplit:"[a-z][A-Z]",intraBound:"[A-Za-z][0-9]|[0-9][A-Za-z]|[a-z][A-Z]",interLft:0,interRgt:0,interChars:".",interIns:wt,intraChars:"[a-z\\d']",intraIns:0,intraContr:"'[a-z]{1,2}\\b",intraMode:0,intraSlice:[1,wt],intraSub:0,intraTrn:0,intraDel:0,intraFilt:(e,t,n)=>!0,sort:(e,t,n)=>{let{idx:r,chars:o,terms:a,interLft2:i,interLft1:l,start:s,intraIns:u,interIns:c}=e;return r.map(((e,t)=>t)).sort(((e,n)=>o[n]-o[e]||u[e]-u[n]||a[n]+i[n]+.5*l[n]-(a[e]+i[e]+.5*l[e])||c[e]-c[n]||s[e]-s[n]||Gt(t[r[e]],t[r[n]])))}},Ft=(e,t)=>0==t?"":1==t?e+"??":t==wt?e+"*?":e+`{0,${t}}?`,Bt="(?:\\b|_)";function jt(e){e=Object.assign({},Vt,e);const{interLft:t,interRgt:n,intraMode:r,intraSlice:o,intraIns:a,intraSub:i,intraTrn:l,intraDel:s,intraContr:u,intraSplit:c,interSplit:_,intraBound:d,intraChars:f}=e;let{intraRules:m}=e;null==m&&(m=e=>{let t=Vt.intraSlice,n=0,r=0,u=0,c=0,_=e.length;return _<=4?_>=3&&(u=Math.min(l,1),4==_&&(n=Math.min(a,1))):(t=o,n=a,r=i,u=l,c=s),{intraSlice:t,intraIns:n,intraSub:r,intraTrn:u,intraDel:c}});let h=!!c,p=new RegExp(c,"g"),v=new RegExp(_,"g"),E=new RegExp("^"+_+"|"+_+"$","g"),g=new RegExp(u,"gi");const C=e=>(e=e.replace(E,"").toLowerCase(),h&&(e=e.replace(p,(e=>e[0]+" "+e[1]))),e.split(v).filter((e=>""!=e))),y=(o,i=0,l=!1)=>{let s=C(o);if(0==s.length)throw"Empty needle!";let u,c=Array(s.length).fill("");if(s=s.map(((e,t)=>e.replace(g,(e=>(c[t]=e,""))))),1==r)u=s.map(((e,t)=>{let{intraSlice:n,intraIns:r,intraSub:o,intraTrn:a,intraDel:i}=m(e);if(r+o+a+i==0)return e+c[t];let[l,s]=n,u=e.slice(0,l),_=e.slice(s),d=e.slice(l,s);1==r&&1==u.length&&u!=d[0]&&(u+="(?!"+u+")");let h=d.length,p=[];if(o)for(let e=0;e0&&(e=")("+e+")("),u=s.map(((t,n)=>t.split("").map(((e,t,n)=>(1==a&&0==t&&n.length>1&&e[t]!=e[t+1]&&(e+="(?!"+e+")"),e))).join(e)+c[n]))}let _=2==t?Bt:"",d=2==n?Bt:"",h=d+Ft(e.interChars,e.interIns)+_;return i>0?l?u=_+"("+u.join(")"+d+"|"+_+"(")+")"+d:(u="("+u.join(")("+h+")(")+")",u="(.?"+_+")"+u+"("+d+".*)"):(u=u.join(h),u=_+u+d),[new RegExp(u,"i"),s,c]},T=(e,t,n)=>{let r=[],[o]=y(t);if(null!=n)for(let t=0;t{let[i,l,s]=y(a,1),[u]=y(a,2),c=l.length,_=r.length,d=Array(_).fill(0),f={idx:Array(_),start:d.slice(),chars:d.slice(),terms:d.slice(),interIns:d.slice(),intraIns:d.slice(),interLft2:d.slice(),interRgt2:d.slice(),interLft1:d.slice(),interRgt1:d.slice(),ranges:Array(_)},m=1==t||1==n,h=0;for(let a=0;a=u){let e=d[o+1].toLowerCase().indexOf(i);e>-1&&(H.push(v,e,u),v+=O(d,o,e,u),a=i,f=u,h=!0,0==r&&(p=v))}if(m||h){let e=v-1,r=v+f,l=!0,s=!0;if(-1==e||S.test(_[e]))h&&g++;else{if(2==t){E=!0;break}if(I&&A.test(_[e]+_[e+1]))h&&C++;else{if(1==t){let e=d[o+1],t=v+f;if(e.length>=u){let n,r=0,l=!1,s=new RegExp(i,"ig");for(;n=s.exec(e);){r=n.index;let e=t+r,o=e-1;if(-1==o||S.test(_[o])){g++,l=!0;break}if(A.test(_[o]+_[e])){C++,l=!0;break}}if(l){H.push(v,r,u),v+=O(d,o,r,u),a=i,f=u,h=!0;break}}E=!0;break}l=!1}}if(r==_.length||S.test(_[r]))h&&y++;else{if(2==n){E=!0;break}if(I&&A.test(_[r-1]+_[r]))h&&T++;else{if(1==n){E=!0;break}s=!1}}h&&(b+=u,l&&s&&R++)}if(f>u&&(D+=f-u),r>0&&(N+=d[o-1].length),!e.intraFilt(i,a,v)){E=!0;break}r0?0:1/0,c=l-3;for(let r=2;r0&&(t.push(o,i),o=i=n)}i>o&&t.push(o,i),h++}}if(h{let o=e[t]+e[t+1].slice(0,n);return e[t-1]+=o,e[t]=e[t+1].slice(n,n+r),e[t+1]=e[t+1].slice(n+r),o.length};return{search:(...t)=>((t,n,r=!1,o=1e3,a)=>{let i,l=null,s=null,u=[];if(n=n.replace(xt,(e=>(u.push(e.trim().slice(1)),""))),u.length>0&&(i=new RegExp(u.join("|"),"i"),""==n.trim())){let e=[];for(let n=0;n1){let n=e.slice().sort(((e,t)=>t.length-e.length));for(let e=0;ee.join(" "))),s=[];let r=new Set;for(let e=0;e!r.has(e))),o=T(t,l[e],n);for(let e=0;e0?a:T(t,n)]);let c=null,_=null;if(u.length>0&&(s=s.map((e=>e.filter((e=>!i.test(t[e])))))),s.reduce(((e,t)=>e+t.length),0)<=o){c={},_=[];for(let n=0;n0)for(let e=0;e{let e={A:"ÁÀÃÂÄĄ",a:"áàãâäą",E:"ÉÈÊËĖ",e:"éèêëę",I:"ÍÌÎÏĮ",i:"íìîïį",O:"ÓÒÔÕÖ",o:"óòôõö",U:"ÚÙÛÜŪŲ",u:"úùûüūų",C:"ÇČ",c:"çč",N:"Ñ",n:"ñ",S:"Š",s:"š"},t=new Map,n="";for(let r in e)e[r].split("").forEach((e=>{n+=e,t.set(e,r)}));let r=new RegExp(`[${n}]`,"g"),o=e=>t.get(e);return e=>{if("string"==typeof e)return e.replace(r,o);let t=Array(e.length);for(let n=0;nt?`${e}`:e,Xt=(e,t)=>e+t;jt.latinize=Wt,jt.permute=e=>$t([...Array(e.length).keys()]).sort(((e,t)=>{for(let n=0;nt.map((t=>e[t])))),jt.highlight=function(e,t,n=zt,r="",o=Xt){let a=o(r,n(e.substring(0,t[0]),!1));r=null!==a?a:r;for(let i=0;it.parentId===e||!e&&o.includes(t.id))),!t)return a.sort(((t,n)=>function(e,t,n,r){const o=r.includes(e.id),a=r.includes(t.id);if(o&&!a)return-1;if(!o&&a)return 1;if(o&&a)return r.indexOf(e.id)-r.indexOf(t.id);const i=n.includes(e.id),l=n.includes(t.id);return i&&!l?-1:!i&&l?1:e.name.localeCompare(t.name)}(t,n,r,e?[]:o))).map((e=>e.id));const i=a.map((({name:e,description:t})=>e+" "+t)),[l,,s]=Qt.search(i,t.toLowerCase());return s.map((e=>a[l[e]].id))}function qt(e,t="Assertion failed"){if(!1===e)throw Error(t)}function Zt(...e){return e.filter(Boolean).join(" ")}let Kt;var Jt;let en;var tn;let nn;var rn;(Jt=Kt||(Kt={})).COLLAPSED="collapsed",Jt.IDLE="idle",Jt.EXECUTING_COMMAND="executingCommand",Jt.DISPLAYING_RESULT="displayingResult",(tn=en||(en={})).RESET_SEARCH="RESET_SEARCH",tn.HIGHLIGHT_NEXT_ITEM="HIGHLIGHT_NEXT_ITEM",tn.HIGHLIGHT_PREVIOUS_ITEM="HIGHLIGHT_PREVIOUS_ITEM",tn.CANCEL="CANCEL",tn.SELECT_GROUP="SELECT_GROUP",tn.GO_TO_PARENT_GROUP="GO_TO_PARENT_GROUP",tn.UPDATE_SEARCH="UPDATE_SEARCH",tn.UPDATE_COMMAND_QUERY="UPDATE_COMMAND_QUERY",tn.EXECUTE_COMMAND="EXECUTE_COMMAND",tn.FINISH_COMMAND="FINISH_COMMAND",tn.UPDATE_RESULT="UPDATE_RESULT",tn.EXPAND="EXPAND",tn.ADD_FAVOURITE="ADD_FAVOURITE",tn.REMOVE_FAVOURITE="REMOVE_FAVOURITE",(rn=nn||(nn={})).ADD_FAVOURITE="ADD_FAVOURITE",rn.ADD_RECENTLY_USED="ADD_RECENTLY_USED",rn.EXPAND="EXPAND",rn.HIGHLIGHT_NEXT_COMMAND="HIGHLIGHT_NEXT_COMMAND",rn.HIGHLIGHT_NEXT_OPTION="HIGHLIGHT_NEXT_OPTION",rn.HIGHLIGHT_PREVIOUS_COMMAND="HIGHLIGHT_PREVIOUS_COMMAND",rn.HIGHLIGHT_PREVIOUS_OPTION="HIGHLIGHT_PREVIOUS_OPTION",rn.LEAVE_GROUP="LEAVE_GROUP",rn.REFRESH_COMMANDS="REFRESH_COMMANDS",rn.REMOVE_FAVOURITE="REMOVE_FAVOURITE",rn.RESET_HIGHLIGHT="RESET_HIGHLIGHT",rn.RESET_OPTION_HIGHLIGHT="RESET_OPTION_HIGHLIGHT",rn.RESET_SEARCH="RESET_SEARCH",rn.RESET_SEARCH_OR_LEAVE_GROUP="RESET_SEARCH_OR_LEAVE_GROUP",rn.SET_ACTIVE_COMMAND="SET_ACTIVE_COMMAND",rn.SET_COMMAND_QUERY="SET_COMMAND_QUERY",rn.SET_GROUP="SET_GROUP",rn.SET_SEARCH_WORD="SET_SEARCH_WORD",rn.UNSET_ACTIVE_COMMAND="UNSET_ACTIVE_COMMAND",rn.UNSET_RESULT="UNSET_RESULT",rn.UPDATE_RESULT="UPDATE_RESULT";Kt.COLLAPSED;const on={collapsed:{on:{UPDATE_SEARCH:{target:Kt.IDLE,actions:[nn.EXPAND,nn.SET_SEARCH_WORD,nn.REFRESH_COMMANDS]},HIGHLIGHT_NEXT_ITEM:{target:Kt.IDLE,actions:[nn.REFRESH_COMMANDS,nn.EXPAND]},EXPAND:{target:Kt.IDLE,actions:[nn.REFRESH_COMMANDS,nn.EXPAND]}}},idle:{on:{UPDATE_SEARCH:{target:Kt.IDLE,actions:[nn.SET_SEARCH_WORD,nn.RESET_HIGHLIGHT,nn.REFRESH_COMMANDS]},HIGHLIGHT_NEXT_ITEM:{target:Kt.IDLE,actions:[nn.HIGHLIGHT_NEXT_COMMAND]},HIGHLIGHT_PREVIOUS_ITEM:{target:Kt.IDLE,actions:[nn.HIGHLIGHT_PREVIOUS_COMMAND]},CANCEL:{target:Kt.IDLE,actions:[nn.RESET_HIGHLIGHT,nn.RESET_SEARCH_OR_LEAVE_GROUP,nn.REFRESH_COMMANDS]},EXECUTE_COMMAND:{target:Kt.EXECUTING_COMMAND,actions:[nn.ADD_RECENTLY_USED,nn.SET_ACTIVE_COMMAND,nn.REFRESH_COMMANDS]},GO_TO_PARENT_GROUP:{target:Kt.IDLE,actions:[nn.RESET_HIGHLIGHT,nn.LEAVE_GROUP,nn.REFRESH_COMMANDS]},SELECT_GROUP:{target:Kt.IDLE,actions:[nn.RESET_SEARCH,nn.RESET_HIGHLIGHT,nn.SET_GROUP,nn.REFRESH_COMMANDS]},ADD_FAVOURITE:{target:Kt.IDLE,actions:[nn.ADD_FAVOURITE,nn.REFRESH_COMMANDS]},REMOVE_FAVOURITE:{target:Kt.IDLE,actions:[nn.REMOVE_FAVOURITE,nn.REFRESH_COMMANDS]}}},executingCommand:{on:{UPDATE_RESULT:{target:Kt.DISPLAYING_RESULT,actions:[nn.UPDATE_RESULT]},FINISH_COMMAND:{target:Kt.IDLE,actions:[nn.UNSET_ACTIVE_COMMAND]}}},displayingResult:{on:{UPDATE_COMMAND_QUERY:{target:Kt.DISPLAYING_RESULT,actions:[nn.SET_COMMAND_QUERY]},UPDATE_RESULT:{target:Kt.DISPLAYING_RESULT,actions:[nn.UPDATE_RESULT,nn.RESET_OPTION_HIGHLIGHT]},HIGHLIGHT_NEXT_ITEM:{target:Kt.DISPLAYING_RESULT,actions:[nn.HIGHLIGHT_NEXT_OPTION]},HIGHLIGHT_PREVIOUS_ITEM:{target:Kt.DISPLAYING_RESULT,actions:[nn.HIGHLIGHT_PREVIOUS_OPTION]},EXECUTE_COMMAND:{target:Kt.DISPLAYING_RESULT,actions:[nn.SET_ACTIVE_COMMAND]},CANCEL:{target:Kt.IDLE,actions:[nn.UNSET_RESULT,nn.UNSET_ACTIVE_COMMAND,nn.RESET_OPTION_HIGHLIGHT]},FINISH_COMMAND:{target:Kt.DISPLAYING_RESULT,actions:[nn.UNSET_ACTIVE_COMMAND]}}}};function an(e,t,n){let r=on[e.status].on?.[t.type]??null;r||(Pt.error(`No transition found for event "${t.type}" in state "${e.status}"`),r={target:e.status});const o={...e,status:"string"==typeof r?r:r.target};return n&&"object"==typeof r&&r.actions?.forEach((e=>n(e,o,t))),Pt.debug(`Transitioned from "${e.status}" to "${o.status}" with event "${t.type}"`),o}function ln(e,t,n){switch(e){case nn.RESET_SEARCH:t.searchWord="";break;case nn.RESET_HIGHLIGHT:t.highlightedItem=0;break;case nn.REFRESH_COMMANDS:t.availableCommandIds=Yt(t.selectedCommandGroup,t.searchWord,t.commands,t.favouriteCommands,t.recentCommands);break;case nn.HIGHLIGHT_NEXT_COMMAND:t.highlightedItem=kt(t.highlightedItem+1,0,t.availableCommandIds.length-1);break;case nn.HIGHLIGHT_PREVIOUS_COMMAND:t.highlightedItem=kt(t.highlightedItem-1,0,t.availableCommandIds.length-1);break;case nn.HIGHLIGHT_NEXT_OPTION:t.highlightedOption=kt(t.highlightedOption+1,0,Object.keys(t.result.options).length-1);break;case nn.HIGHLIGHT_PREVIOUS_OPTION:t.highlightedOption=kt(t.highlightedOption-1,0,Object.keys(t.result.options).length-1);break;case nn.SET_SEARCH_WORD:qt(n.type===en.UPDATE_SEARCH),t.searchWord=n.searchWord;break;case nn.SET_COMMAND_QUERY:qt(n.type===en.UPDATE_COMMAND_QUERY),t.commandQuery=n.commandQuery;break;case nn.EXPAND:t.expanded=!0;break;case nn.SET_ACTIVE_COMMAND:qt(n.type===en.EXECUTE_COMMAND),t.activeCommandId=n.commandId,t.activeCommandMessage=n.message;break;case nn.UNSET_ACTIVE_COMMAND:t.activeCommandId=null,t.activeCommandMessage=null;break;case nn.UPDATE_RESULT:qt(n.type===en.UPDATE_RESULT),qt("boolean"==typeof n.result.success),t.result={options:{},message:"Command executed",view:null,success:!1,...n.result},t.resultCommandId=t.activeCommandId;break;case nn.RESET_OPTION_HIGHLIGHT:t.highlightedOption=0;break;case nn.RESET_SEARCH_OR_LEAVE_GROUP:t.commandQuery?t.commandQuery="":t.searchWord?t.searchWord="":t.selectedCommandGroup=t.selectedCommandGroup?t.commands[t.selectedCommandGroup].parentId:null;break;case nn.UNSET_RESULT:t.result=null,t.resultCommandId=null,t.commandQuery="";break;case nn.LEAVE_GROUP:t.selectedCommandGroup=t.selectedCommandGroup?t.commands[t.selectedCommandGroup].parentId:null;break;case nn.SET_GROUP:qt(n.type===en.SELECT_GROUP),t.selectedCommandGroup=n.commandId;break;case nn.ADD_FAVOURITE:qt(n.type===en.ADD_FAVOURITE),t.favouriteCommands.includes(n.commandId)||t.favouriteCommands.push(n.commandId);break;case nn.REMOVE_FAVOURITE:qt(n.type===en.REMOVE_FAVOURITE),t.favouriteCommands=t.favouriteCommands.filter((e=>e!==n.commandId));break;case nn.ADD_RECENTLY_USED:if(qt(n.type===en.EXECUTE_COMMAND),!t.commands[n.commandId].action)break;t.recentCommands.includes(n.commandId)&&(t.recentCommands=t.recentCommands.filter((e=>e!==n.commandId))),t.recentCommands.unshift(n.commandId),t.recentCommands.length>5&&t.recentCommands.pop();break;default:throw Error(`Action ${e} not implemented`)}}const sn=(e,t)=>an(e,t,ln);var un=tt.memo((({children:e})=>tt.createElement("span",{className:"xzQyjW_iconWrap"},e)));var cn=tt.memo((()=>{const{state:{showBranding:e}}=On(),{translate:t}=Ln();return e?tt.createElement("a",{href:"https://helzle.it/projects",title:t("CommandBarFooter.branding","Made with love by Sebastian Helzle"),target:"_blank",rel:"noreferrer noopener",className:"_345BVa_madeWithLove"},tt.createElement("small",null,t("CommandBarFooter.brandingSmall","Made with love by")),tt.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 180 180"},tt.createElement("defs",null,tt.createElement("linearGradient",{id:"a",gradientUnits:"userSpaceOnUse",x1:"280.25",y1:"377.003",x2:"373.261",y2:"377.003"},tt.createElement("stop",{offset:"0",stopColor:"#297AAC"}),tt.createElement("stop",{offset:"1",stopColor:"#53AADA"}))),tt.createElement("path",{d:"M0 180.017h37.287L71.35 52.898H34.061zM48.717 0l-9.083 33.898h36.675L85.392 0z",fill:"#B9B7B3"}),tt.createElement("path",{d:"M335.972 313.444H288.25l-8 28.306h47.691l-28.03 98.813h39.287l34.063-127.119z",fill:"url(#a)",transform:"translate(-195.462 -260.325)"}))):null}));function _n(){return tt.createElement("svg",{viewBox:"0 0 448 512"},tt.createElement("path",{fill:"currentColor",d:"m257.5 445.1-22.2 22.2c-9.4 9.4-24.6 9.4-33.9 0L7 273c-9.4-9.4-9.4-24.6 0-33.9L201.4 44.7c9.4-9.4 24.6-9.4 33.9 0l22.2 22.2c9.5 9.5 9.3 25-.4 34.3L136.6 216H424c13.3 0 24 10.7 24 24v32c0 13.3-10.7 24-24 24H136.6l120.5 114.8c9.8 9.3 10 24.8.4 34.3z"}))}function dn(){return tt.createElement("svg",{viewBox:"0 0 512 512"},tt.createElement("path",{fill:"currentColor",d:"M415.44 512h-95.11L212.12 357.46v91.1L125.69 512H28V29.82L68.47 0h108.05l123.74 176.13V63.45L386.69 0h97.69v461.5zM38.77 35.27V496l72-52.88V194l215.5 307.64h84.79l52.35-38.17h-78.27L69 13zm82.54 466.61 80-58.78v-101l-79.76-114.4v220.94L49 501.89h72.34zM80.63 10.77l310.6 442.57h82.37V10.77h-79.75v317.56L170.91 10.77zM311 191.65l72 102.81V15.93l-72 53v122.72z"}))}function fn(){return tt.createElement("svg",{viewBox:"0 0 512 512"},tt.createElement("path",{fill:"currentColor",d:"M288 39.056v16.659c0 10.804 7.281 20.159 17.686 23.066C383.204 100.434 440 171.518 440 256c0 101.689-82.295 184-184 184-101.689 0-184-82.295-184-184 0-84.47 56.786-155.564 134.312-177.219C216.719 75.874 224 66.517 224 55.712V39.064c0-15.709-14.834-27.153-30.046-23.234C86.603 43.482 7.394 141.206 8.003 257.332c.72 137.052 111.477 246.956 248.531 246.667C393.255 503.711 504 392.788 504 256c0-115.633-79.14-212.779-186.211-240.236C302.678 11.889 288 23.456 288 39.056z"}))}function mn(){return tt.createElement("svg",{viewBox:"0 0 576 512"},tt.createElement("path",{fill:"currentColor",d:"M528.1 171.5 382 150.2 316.7 17.8c-11.7-23.6-45.6-23.9-57.4 0L194 150.2 47.9 171.5c-26.2 3.8-36.7 36.1-17.7 54.6l105.7 103-25 145.5c-4.5 26.3 23.2 46 46.4 33.7L288 439.6l130.7 68.7c23.2 12.2 50.9-7.4 46.4-33.7l-25-145.5 105.7-103c19-18.5 8.5-50.8-17.7-54.6zM388.6 312.3l23.7 138.4L288 385.4l-124.3 65.3 23.7-138.4-100.6-98 139-20.2 62.2-126 62.2 126 139 20.2-100.6 98z"}))}function hn(){return tt.createElement("svg",{viewBox:"0 0 512 512"},tt.createElement("path",{fill:"currentColor",d:"M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm115.7 272l-176 101c-15.8 8.8-35.7-2.5-35.7-21V152c0-18.4 19.8-29.8 35.7-21l176 107c16.4 9.2 16.4 32.9 0 42z"}))}var pn=tt.memo((()=>{const{state:{activeCommandId:e,activeCommandMessage:t,commands:n,result:r,selectedCommandGroup:o,expanded:a},Icon:i}=On(),l=Ht((()=>e.value&&e.value?n.value[e.value]??r.value.options[e.value]:null));return a.value?tt.createElement("footer",{className:"UnIlTW_commandBarFooter"},e.value?tt.createElement("span",{className:"UnIlTW_activity"},tt.createElement(un,null,tt.createElement(fn,null)),tt.createElement("em",null,l.value.name," ‒ ",t)):o.value?tt.createElement("span",{className:"UnIlTW_breadcrumb"},tt.createElement(i,{icon:n.value[o.value].icon}),tt.createElement("small",null,n.value[o.value].name)):tt.createElement(un,null,tt.createElement(dn,null)),tt.createElement(cn,null)):null}));let vn=null;var En=tt.memo((()=>{const{state:e,actions:t}=On(),{executeCommand:n}=Dn(),{translate:r}=Ln(),o=_e(),a=fe((r=>{e.status.value===Kt.DISPLAYING_RESULT?(t.UPDATE_COMMAND_QUERY(r.target.value),e.commands.value[e.resultCommandId.value].executeManually||(vn&&clearTimeout(vn),vn=setTimeout((()=>n(e.resultCommandId.value)),500))):t.UPDATE_SEARCH(r.target.value)}),[]),i=fe((e=>{"Escape"===e.key&&o.current.value&&(e.preventDefault(),e.stopPropagation())}),[o.current]);return Ut((()=>{e.status.value!==Kt.EXECUTING_COMMAND&&o.current?.focus()})),tt.createElement(tt.Fragment,null,tt.createElement("input",{ref:o,className:"jZLCTa_searchBox",type:"search",placeholder:e.status.value===Kt.DISPLAYING_RESULT?r("SearchBox.commandQuery.placeholder","Enter the query for the command"):r("SearchBox.placeholder","What do you want to do today?"),autoFocus:!0,onChange:a,onKeyUp:i,value:e.status.value===Kt.DISPLAYING_RESULT?e.commandQuery:e.searchWord,"data-testid":"SearchBox"}),!e.expanded.value&&tt.createElement("button",{className:"jZLCTa_expandButton",onClick:t.EXPAND,title:r("SearchBox.expand.title","Expand to show all commands")},tt.createElement(un,null,tt.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 320 512"},tt.createElement("path",{fill:"currentColor",d:"M31.3 192h257.3c17.8 0 26.7 21.5 14.1 34.1L174.1 354.8c-7.8 7.8-20.5 7.8-28.3 0L17.2 226.1C4.6 213.5 13.5 192 31.3 192z"})))),e.status.value===Kt.DISPLAYING_RESULT&&e.commands.value[e.resultCommandId.value]?.executeManually&&tt.createElement("button",{className:"jZLCTa_executeButton",onClick:()=>n(e.resultCommandId.value),title:r("SearchBox.execute.title","Execute the command")},tt.createElement(un,null,tt.createElement(hn,null))))}));var gn=tt.memo((()=>{const{state:e,actions:t}=On(),n=Ht((()=>e.status.value==Kt.DISPLAYING_RESULT));return tt.createElement("header",{className:"_1JQCkq_commandBarHeader"},(n.value||e.selectedCommandGroup.value)&&tt.createElement("button",{type:"button",onClick:n.value?t.CANCEL:t.GO_TO_PARENT_GROUP,className:"_1JQCkq_backButton",title:"Back"},tt.createElement(un,null,tt.createElement(_n,null))),tt.createElement(En,null))}));function Cn({command:e,onItemSelect:t,highlightedId:n,onToggleFavourite:r}){const{state:{favouriteCommands:o},Icon:a}=On(),{translate:i}=Ln(),{id:l,name:s,description:u,icon:c,action:_}=e,d=function({subCommandIds:e,category:t,canHandleQueries:n,action:r},o){let a="command";return t||(e?.length>0?a="category":n?a="query":"string"==typeof r&&(a="link"),o(`CommandListItem.type.${a}`,a))}(e,i),f=Ht((()=>n.value===l)),m=Ht((()=>o.value.includes(l)));return tt.createElement("li",{className:Zt("bB4DKG_commandListItem",f.value&&"bB4DKG_highlighted"),onClick:()=>t(l),"data-testid":"CommandListItem"},tt.createElement(a,{icon:c}),tt.createElement("span",{className:"bB4DKG_label"},tt.createElement("span",null,s),u&&tt.createElement("span",{className:"bB4DKG_description"},"string"==typeof u?u:u())),r&&_&&tt.createElement("button",{type:"button",className:Zt("bB4DKG_favouriteButton",m.value&&"bB4DKG_isFavourite"),title:i("CommandListItem.toggleFavourite","Toggle favourite"),onClick:e=>{e.stopPropagation(),r(l)}},tt.createElement(un,null,tt.createElement(mn,null))),tt.createElement("small",{className:"bB4DKG_type"},d))}var yn=tt.memo(Cn);const Tn=()=>{const{state:{commands:e,highlightedItem:t,availableCommandIds:n,status:r,searchWord:o,favouriteCommands:a,recentCommands:i,selectedCommandGroup:l},actions:{ADD_FAVOURITE:s,REMOVE_FAVOURITE:u}}=On(),{translate:c}=Ln(),{executeCommand:_}=Dn(),d=tt.useRef(null);Ut((()=>{d.current?.querySelector(`li:nth-child(${t.value})`)?.scrollIntoView({behavior:"smooth",block:"center"})}));const f=fe((e=>{a.value.includes(e)?u(e):s(e)}),[a]),m=Ht((()=>o.value||l.value?[]:n.value.filter((e=>i.value.includes(e))))),h=Ht((()=>o.value||l.value?n.value:n.value.filter((e=>!i.value.includes(e))))),p=Ht((()=>n.value[t.value]));return tt.createElement("nav",{className:Zt("z-zZnG_results",r.value!==Kt.IDLE&&"z-zZnG_disabled"),"data-testid":"CommandList",ref:d},m.value.length>0&&tt.createElement(tt.Fragment,null,tt.createElement("h6",null,c("CommandList.suggestions","Recently used")),tt.createElement("ul",null,m.value.map((t=>tt.createElement(yn,{key:t,command:e.value[t],onItemSelect:_,highlightedId:p,onToggleFavourite:f}))))),h.value.length>0&&tt.createElement(tt.Fragment,null,tt.createElement("h6",null,c("CommandList.heading","Commands")),tt.createElement("ul",null,h.value.map((t=>tt.createElement(yn,{key:t,command:e.value[t],onItemSelect:_,highlightedId:p,onToggleFavourite:f}))))),0===n.value.length&&tt.createElement("small",{className:"z-zZnG_noResults"},c("CommandList.noCommandsMessage","No matching commands found")))};var In=tt.memo(Tn);var Sn=()=>{const{state:{result:e,highlightedOption:t}}=On(),{executeCommand:n}=Dn(),r=tt.useRef(null),o=Ht((()=>e.value?Object.values(e.value.options)[t.value].id:null));Ut((()=>{const e=t.value;r.current?.querySelector(`li:nth-child(${e})`)?.scrollIntoView({behavior:"smooth",block:"center"})}));const{options:a,view:i,message:l}=e.value??{};return tt.createElement("div",{className:"SDjQeG_commandResultsView"},l&&tt.createElement("h6",{className:"SDjQeG_message"},l),i?tt.createElement("div",null,i):"",a&&tt.createElement("nav",{className:"SDjQeG_results",ref:r},tt.createElement("ul",null,Object.keys(a).map((e=>tt.createElement(yn,{key:e,command:a[e],onItemSelect:n,highlightedId:o}))))))};var An=tt.memo((({handleToggle:e,disabled:t=!1,label:n,title:r})=>tt.createElement("button",{className:"Vkou1G_toggleButton",onClick:e,disabled:t,title:r},tt.createElement("span",null,n),tt.createElement("span",{className:"Vkou1G_buttonIcon"},"⌘K"))));const bn=w({}),On=()=>me(bn);const Rn=({commands:e,children:t,IconComponent:n,userPreferences:r})=>{const{state:o,dispatch:a}=de((()=>function(e){const t=ht(e);return{state:{activeCommandId:Ct((()=>t.value.activeCommandId)),activeCommandMessage:Ct((()=>t.value.activeCommandMessage)),availableCommandIds:Ct((()=>t.value.availableCommandIds)),commandQuery:Ct((()=>t.value.commandQuery)),commands:Ct((()=>t.value.commands)),expanded:Ct((()=>t.value.expanded)),favouriteCommands:Ct((()=>t.value.favouriteCommands)),highlightedItem:Ct((()=>t.value.highlightedItem)),highlightedOption:Ct((()=>t.value.highlightedOption)),recentCommands:Ct((()=>t.value.recentCommands)),result:Ct((()=>t.value.result)),resultCommandId:Ct((()=>t.value.resultCommandId)),searchWord:Ct((()=>t.value.searchWord)),selectedCommandGroup:Ct((()=>t.value.selectedCommandGroup)),showBranding:Ct((()=>t.value.showBranding)),status:Ct((()=>t.value.status))},dispatch:e=>{t.value=sn(t.value,e)}}}({activeCommandId:null,activeCommandMessage:null,availableCommandIds:Object.keys(e),commandQuery:"",commands:Lt(e),expanded:!1,favouriteCommands:r.favouriteCommands,highlightedItem:0,highlightedOption:0,recentCommands:r.recentCommands,result:null,resultCommandId:null,searchWord:"",selectedCommandGroup:null,showBranding:r.showBranding,status:Kt.COLLAPSED})),[]),i=de((()=>({[en.RESET_SEARCH]:()=>a({type:en.RESET_SEARCH}),[en.HIGHLIGHT_NEXT_ITEM]:()=>a({type:en.HIGHLIGHT_NEXT_ITEM}),[en.HIGHLIGHT_PREVIOUS_ITEM]:()=>a({type:en.HIGHLIGHT_PREVIOUS_ITEM}),[en.CANCEL]:()=>a({type:en.CANCEL}),[en.SELECT_GROUP]:e=>a({type:en.SELECT_GROUP,commandId:e}),[en.GO_TO_PARENT_GROUP]:()=>a({type:en.GO_TO_PARENT_GROUP}),[en.UPDATE_SEARCH]:e=>a({type:en.UPDATE_SEARCH,searchWord:e}),[en.UPDATE_COMMAND_QUERY]:e=>a({type:en.UPDATE_COMMAND_QUERY,commandQuery:e}),[en.EXECUTE_COMMAND]:async(e,t)=>(a({type:en.EXECUTE_COMMAND,commandId:e,message:t}),r.addRecentCommand(e).catch((e=>Pt.error("Could not add recent command",e)))),[en.FINISH_COMMAND]:()=>a({type:en.FINISH_COMMAND}),[en.UPDATE_RESULT]:e=>a({type:en.UPDATE_RESULT,result:e}),[en.EXPAND]:()=>a({type:en.EXPAND}),[en.ADD_FAVOURITE]:e=>{a({type:en.ADD_FAVOURITE,commandId:e}),r.setFavouriteCommands(o.favouriteCommands.value).catch((e=>Pt.error("Could not update favourite commands",e)))},[en.REMOVE_FAVOURITE]:e=>{a({type:en.REMOVE_FAVOURITE,commandId:e}),r.setFavouriteCommands(o.favouriteCommands.value).catch((e=>Pt.error("Could not update favourite commands",e)))}})),[]),l=fe((({icon:e,spin:t=!1})=>tt.createElement(un,null,tt.createElement(n,{icon:e,spin:t}))),[]);return tt.createElement(bn.Provider,{value:{state:o,actions:i,Icon:l}},t)},Nn=tt.createContext({}),Dn=()=>tt.useContext(Nn),Hn=({children:e,toggleOpen:t,dialogRef:n,open:r})=>{const{state:o,actions:a}=On(),i=nt((e=>{if(r&&!e.defaultPrevented)if("k"===e.key&&e.metaKey&&n?.current.contains(e.target))t(),e.stopPropagation(),e.preventDefault();else if("Escape"===e.key)e.stopPropagation(),e.preventDefault(),o.selectedCommandGroup.value||o.searchWord.value||o.commandQuery.value?a.CANCEL():t();else if("ArrowDown"===e.key)e.stopPropagation(),e.preventDefault(),a.HIGHLIGHT_NEXT_ITEM();else if("ArrowUp"===e.key)e.stopPropagation(),e.preventDefault(),a.HIGHLIGHT_PREVIOUS_ITEM();else if("Enter"===e.key){e.stopPropagation(),e.preventDefault();let t=o.availableCommandIds.value[o.highlightedItem.value];o.status.value===Kt.DISPLAYING_RESULT&&(t=Object.values(o.result.value.options).length?Object.keys(o.result.value.options)[o.highlightedOption.value]:o.resultCommandId.value),t&&l(t)}})),l=fe((async e=>{const n=o.result.value?.options[e]??o.commands.value[e],{action:r,canHandleQueries:i,subCommandIds:l,name:s}=n;if(l?.length>0)return void a.SELECT_GROUP(e);if(qt(r,`Command ${e} has no action`),"string"==typeof r)return await a.EXECUTE_COMMAND(e,"Loading url"),0===r.indexOf("http")&&0!==r.indexOf(document.location.origin)?window.open(r,"_blank","noopener,noreferrer")?.focus():window.location.href=r,a.FINISH_COMMAND();a.EXECUTE_COMMAND(e,"Running command");const u=r(i?o.commandQuery.value:void 0);if(u.then)u.then((e=>{if(e&&!e.success)throw new Error(`The command "${s}" failed`)})).catch((e=>{Pt.error("Command error",s,e)})).finally((()=>{a.FINISH_COMMAND()}));else if(u.next){const e=u;for await(const t of e)a.UPDATE_RESULT(t);a.FINISH_COMMAND()}else Pt.error("Command result is not a promise or generator",u);n.closeOnExecute&&t()}),[o.searchWord,o.commands,o.result]),s=nt((e=>{l(e)}));return ue((()=>{if(!r)return;const e=e=>i.current(e);return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)}),[r]),tt.createElement(Nn.Provider,{value:{executeCommand:s.current}},e)},Un=w({}),Ln=()=>me(Un),Mn=({translate:e,children:t})=>tt.createElement(Un.Provider,{value:{translate:e}},t);var Pn=({onDrag:e,open:t,toggleOpen:n})=>{const{state:{expanded:r,result:o}}=On(),a=_e(null),i=Dt(!1),l=Dt({left:window.innerWidth/2-300,top:window.innerHeight/2-20}),s=Dt({offsetLeft:0,offsetTop:0}),u=Dt(!1),c=Ht((()=>{const{left:e,top:t}=l.value;return u.value?{left:e+"px",top:t+"px",translate:"none",visibility:i.value?"hidden":"visible"}:{}})),_=fe(((e,t)=>{const n=a.current.getBoundingClientRect();l.value={left:kt(e,0,window.innerWidth-n.width),top:kt(t,0,window.innerHeight-n.height)}}),[]),d=fe((t=>{"INPUT"!==t.target.tagName&&(console.debug("dragstart"),t.dataTransfer.setData("text/plain","CommandBar"),t.dataTransfer.dropEffect="move",t.dataTransfer.effectAllowed="move",at((()=>{s.value={offsetLeft:t.clientX-a.current.offsetLeft,offsetTop:t.clientY-a.current.offsetTop},u.value=!0})),e&&e(!0))}),[a.current]),f=fe((t=>{const{clientX:n,clientY:r}=t;console.debug("dragdrop",n,r,s.value),at((()=>{i.value=!1,_(n-s.value.offsetLeft,r-s.value.offsetTop)})),e&&e(!1)}),[a.current]),m=fe((()=>_(l.value.left,l.value.top)),[]);return ue((()=>{if(t)return a.current?.parentElement?.addEventListener("drop",f),window.addEventListener("resize",m),()=>{a.current?.parentElement?.removeEventListener("drop",f),window.removeEventListener("resize",m)}}),[t,m,f]),t?tt.createElement("dialog",{ref:a,className:Zt("eoy0jW_commandBar",o.value&&"eoy0jW_hasResults"),open:t,draggable:!0,onDragStart:d,onDrag:()=>i.value=!0,style:c.value,"data-testid":"CommandBarDialog"},tt.createElement(Hn,{toggleOpen:n,dialogRef:a,open:t},tt.createElement(gn,null),tt.createElement("div",{className:Zt("eoy0jW_resultsWrap",r.value&&"eoy0jW_expanded",o.value&&"eoy0jW_split")},r.value&&tt.createElement(In,null),o.value&&tt.createElement(Sn,null)),tt.createElement(pn,null))):null};var kn=({commands:e,open:t,toggleOpen:n,onDrag:r,IconComponent:o,userPreferences:a,translate:i})=>tt.createElement(Mn,{translate:i},tt.createElement(Rn,{commands:e,IconComponent:o,userPreferences:a},tt.createElement(Pn,{onDrag:r,open:t,toggleOpen:n}))),Gn={};async function wn(e,t,n="GET"){return t&&"GET"===n&&(e=Object.keys(t).reduce(((e,n)=>e+"&"+n+"="+encodeURIComponent(t[n])),e+"?")),fetch(e,{method:n,credentials:"include",body:t&&"POST"===n?JSON.stringify(t):void 0,headers:{"Content-Type":"application/json",Accept:"application/json"}}).then((e=>{if(200!==e.status)throw new Error(`The request failed with code ${e.status}: "${e.statusText}"`);return e.headers.get("Content-Type")?.includes("application/json")?e.json():e.text()}))}e(Gn,"getPreferences",(()=>Vn)),e(Gn,"setFavouriteCommands",(()=>Fn)),e(Gn,"addRecentCommand",(()=>Bn));async function xn(e,t){return wn(e,t,"POST")}async function Vn(){return wn("/neos/shel-neos-commandbar/preferences/getpreferences")}async function Fn(e){return xn("/neos/shel-neos-commandbar/preferences/setfavourites",{commandIds:e})}async function Bn(e){return xn("/neos/shel-neos-commandbar/preferences/addrecentcommand",{commandId:e})}var jn={};e(jn,"getCommands",(()=>Wn));async function Wn(){return wn("/neos/service/data-source/shel-neos-commandbar-commands")}var $n={};e($n,"searchNeosDocs",(()=>zn));async function zn(e){return e?wn("/neos/service/data-source/shel-neos-commandbar-search-neos-docs",{query:e}):{}}var Xn={};e(Xn,"searchNeosPackages",(()=>Qn));async function Qn(e){return e?wn("/neos/service/data-source/shel-neos-commandbar-search-neos-packages",{query:e}):{}}var Yn,qn;Yn="o4liXq_fullScreenLayer",qn="o4liXq_spin";var Zn=({spin:e=!1})=>X("svg",{className:e?qn:"",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",children:X("path",{fill:"currentColor",d:"M509.5 184.6 458.9 32.8C452.4 13.2 434.1 0 413.4 0H272v192h238.7c-.4-2.5-.4-5-1.2-7.4zM240 0H98.6c-20.7 0-39 13.2-45.5 32.8L2.5 184.6c-.8 2.4-.8 4.9-1.2 7.4H240V0zM0 224v240c0 26.5 21.5 48 48 48h416c26.5 0 48-21.5 48-48V224H0z"})});class Kn extends p{static tagName="command-bar-container";static options={shadow:!0};constructor(){super(),Kn.i18nRegistry=window.NeosCMS.I18n,this.state={initialized:!1,open:!1,dragging:!1,commands:{searchNeosDocs:{name:Kn.translate("CommandBarUiPlugin.command.documentation","Documentation"),description:Kn.translate("CommandBarUiPlugin.command.documentation.description","Browse or search the Neos documentation"),icon:"book",canHandleQueries:!0,action:this.handleSearchNeosDocs.bind(this)},searchNeosPackages:{name:Kn.translate("CommandBarUiPlugin.command.packages","Packages"),description:Kn.translate("CommandBarUiPlugin.command.packages.description","Search for Neos packages"),icon:"boxes",canHandleQueries:!0,action:this.handleSearchNeosPackages.bind(this)}},preferences:{favouriteCommands:[],recentCommands:[],recentDocuments:[],showBranding:!0}}}static translate=(e,t,n)=>("string"==typeof t&&(n=t,t={}),Kn.i18nRegistry.translate(e,n,"Shel.Neos.CommandBar","Main",t));async componentDidMount(){try{const e=await Gn.getPreferences(),t=await jn.getCommands();this.setState((n=>({initialized:!0,preferences:e,commands:{...n.commands,...t}}))),document.addEventListener("keydown",(e=>{"k"===e.key&&e.metaKey&&(e.stopPropagation(),e.preventDefault(),this.handleToggle())}))}catch(e){Pt.error(e)}}handleToggle=()=>{this.setState((({open:e})=>({open:!e})))};handleDrag=e=>{this.setState({dragging:e})};handleSearchNeosDocs=async function*(e){let t;yield{success:!0,message:Kn.translate("CommandBarUiPlugin.command.documentation.searching",{query:e},`Search for "${e}"`)};const n=await $n.searchNeosDocs(e).catch((e=>{Pt.error("Could not search Neos docs",e),t=e.message}));t||!n?yield{success:!1,message:Kn.translate("CommandBarUiPlugin.command.documentation.error","Search failed"),view:t}:yield{success:!0,message:Kn.translate("CommandBarUiPlugin.command.documentation.matches",{matches:Object.keys(n).length},`${Object.values(n).length} options match your query`),options:n}};handleSearchNeosPackages=async function*(e){let t;yield{success:!0,message:Kn.translate("CommandBarUiPlugin.command.packages.searching",{query:e},`Search for "${e}"`)};const n=await Xn.searchNeosPackages(e).catch((e=>{Pt.error("Could not search Neos packages",e),t=e.message}));t||!n?yield{success:!1,message:Kn.translate("CommandBarUiPlugin.command.packages.error","Search failed"),view:t}:yield{success:!0,message:Kn.translate("CommandBarUiPlugin.command.packages.matches",{matches:Object.values(n).length},`${Object.values(n).length} options match your query`),options:n}};render(){const{initialized:e,open:t,dragging:n,commands:r,preferences:o}=this.state;return X(h,{children:[X("style",{children:'@import "'+this.props.styleuri+'";'}),X("div",{className:"o4liXq_pluginWrap",children:[X(An,{handleToggle:this.handleToggle,disabled:!e,label:Kn.translate("ToggleButton.label","Search…"),title:Kn.translate("ToggleButton.title","Search and execute commands")}),e&&X("div",{className:[Yn,t&&"o4liXq_open"].join(" "),onDragOver:e=>e.preventDefault(),style:n?{pointerEvents:"all"}:null,children:X(kn,{commands:r,open:t,toggleOpen:this.handleToggle,onDrag:this.handleDrag,IconComponent:Zn,userPreferences:{...o,setFavouriteCommands:Gn.setFavouriteCommands,addRecentCommand:Gn.addRecentCommand},translate:Kn.translate})})]})]})}}!function(e,t,n,r){function o(){var t=Reflect.construct(HTMLElement,[],o);return t._vdomComponent=e,t._root=r&&r.shadow?t.attachShadow({mode:"open"}):t,t}(o.prototype=Object.create(HTMLElement.prototype)).constructor=o,o.prototype.connectedCallback=F,o.prototype.attributeChangedCallback=j,o.prototype.disconnectedCallback=W,n=n||e.observedAttributes||Object.keys(e.propTypes||{}),o.observedAttributes=n,n.forEach((function(e){Object.defineProperty(o.prototype,e,{get:function(){return this._vdom.props[e]},set:function(t){this._vdom?this.attributeChangedCallback(e,null,t):(this._props||(this._props={}),this._props[e]=t,this.connectedCallback());var n=typeof t;null!=t&&"string"!==n&&"boolean"!==n&&"number"!==n||this.setAttribute(e,t)}})})),customElements.define(t||e.tagName||e.displayName||e.name,o)}(Kn,null,null,Kn.options),window.addEventListener("neoscms-i18n-initialized",(()=>{const e=document.querySelector(".neos-top-bar-left"),t=document.createElement("command-bar-container");t.id="shel-neos-commandbar";const n=document.querySelector('link[rel="stylesheet"][href*="Shel.Neos.CommandBar"]');t.setAttribute("styleuri",n.href),e.appendChild(t)}))})(); //# sourceMappingURL=Module.js.map diff --git a/Resources/Public/Module.js.map b/Resources/Public/Module.js.map index a810c7b..b3de27d 100644 --- a/Resources/Public/Module.js.map +++ b/Resources/Public/Module.js.map @@ -1 +1 @@ -{"mappings":"iGA0BaA,MCfPC,ECRFC,ECyKAC,EAWAC,EAEEC,ECvLKC,ECF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AAQuR,EACpBzV,KAAKmK,qBAIN,IAAM3L,SAAciX,EAEd,MAALA,GACS,WAATjX,GACS,YAATA,GACS,WAATA,GAEAwB,KAAKgF,aAAad,EAAMuR,SAMrByqB,eAAeC,OACrBnF,GAAWl7B,EAAUk7B,SAAWl7B,EAAUqZ,aAAerZ,EAAUoE,KACnEs7B,EAIF,C+D9CA,CAAS7B,GAAK,KAAM,KAAMA,GAAIpgC,SAE9B47B,OAAOz0B,iBAAiB,4BAA4B,KAEhD,MAAM07B,EAAa74B,SAASmvB,cAAc,sBACpC2J,EAAkB94B,SAAShJ,cAAc,yBAC/C8hC,EAAgBlgB,GAAK,uBAGrB,MAAMmgB,EAAqB/4B,SAASmvB,cAChC,wDAEJ2J,EAAgBr7B,aAAa,WAAYs7B,EAAmBjN,MAE5D+M,EAAW38B,YAAY48B,EAAA,G","sources":["node_modules/preact/src/util.js","node_modules/preact/src/options.js","node_modules/preact/src/create-element.js","node_modules/preact/src/component.js","node_modules/preact/src/create-context.js","node_modules/preact/src/constants.js","node_modules/preact/src/diff/children.js","node_modules/preact/src/diff/props.js","node_modules/preact/src/diff/index.js","node_modules/preact/src/render.js","node_modules/preact/src/clone-element.js","node_modules/preact-custom-element/src/index.js","node_modules/preact/src/diff/catch-error.js","node_modules/preact/jsx-runtime/src/index.js","node_modules/preact/hooks/src/index.js","node_modules/preact/compat/src/util.js","node_modules/preact/compat/src/PureComponent.js","node_modules/preact/compat/src/forwardRef.js","node_modules/preact/compat/src/Children.js","node_modules/preact/compat/src/suspense.js","node_modules/preact/compat/src/suspense-list.js","node_modules/preact/compat/src/portals.js","node_modules/preact/compat/src/render.js","node_modules/preact/compat/src/index.js","node_modules/preact/compat/src/memo.js","packages/commandbar/src/hooks/useFunctionRef.ts","node_modules/@preact/signals-core/src/index.ts","node_modules/@preact/signals/src/index.ts","packages/commandbar/src/helpers/flattenCommands.ts","packages/commandbar/src/helpers/logger.ts","packages/commandbar/src/helpers/clamp.ts","node_modules/@leeoniya/ufuzzy/dist/uFuzzy.esm.js","packages/commandbar/src/helpers/filterCommands.ts","packages/commandbar/src/helpers/asset.ts","packages/commandbar/src/helpers/classnames.ts","packages/commandbar/src/state/commandBarMachine.ts","packages/commandbar/src/state/commandBarReducer.ts","packages/commandbar/src/components/IconWrapper/IconWrapper.tsx","packages/commandbar/src/components/IconWrapper/IconWrapper.module.css","packages/commandbar/src/components/CommandBarFooter/Branding.tsx","packages/commandbar/src/components/CommandBarFooter/Branding.module.css","packages/commandbar/src/components/Icons/IconBack.tsx","packages/commandbar/src/components/Icons/IconNeos.tsx","packages/commandbar/src/components/Icons/IconSpinner.tsx","packages/commandbar/src/components/Icons/IconStar.tsx","packages/commandbar/src/components/Icons/IconPlay.tsx","packages/commandbar/src/components/CommandBarFooter/CommandBarFooter.tsx","packages/commandbar/src/components/CommandBarFooter/CommandBarFooter.module.css","packages/commandbar/src/components/SearchBox/SearchBox.tsx","packages/commandbar/src/components/SearchBox/SearchBox.module.css","packages/commandbar/src/components/CommandBarHeader/CommandBarHeader.tsx","packages/commandbar/src/components/CommandBarHeader/CommandBarHeader.module.css","packages/commandbar/src/components/CommandListItem/CommandListItem.tsx","packages/commandbar/src/components/CommandListItem/CommandListItem.module.css","packages/commandbar/src/components/CommandList/CommandList.tsx","packages/commandbar/src/components/CommandList/CommandListing.module.css","packages/commandbar/src/components/CommandResultsView/CommandResultsView.tsx","packages/commandbar/src/components/CommandResultsView/CommandResultsView.module.css","packages/commandbar/src/components/ToggleButton/ToggleButton.tsx","packages/commandbar/src/components/ToggleButton/ToggleButton.module.css","packages/commandbar/src/state/CommandBarStateProvider.tsx","packages/commandbar/src/state/CommandBarExecutor.tsx","packages/commandbar/src/state/IntlProvider.tsx","packages/commandbar/src/components/CommandBarDialog/CommandBarDialog.tsx","packages/commandbar/src/components/CommandBarDialog/CommandBarDialog.module.css","packages/commandbar/src/CommandBar.tsx","packages/neos-api/src/fetch.ts","packages/neos-api/src/preferences.ts","packages/neos-api/src/commands.ts","packages/neos-api/src/documentation.ts","packages/neos-api/src/packages.ts","packages/module-plugin/src/ModulePlugin.module.css","packages/module-plugin/src/IconComponent.tsx","packages/module-plugin/src/App.tsx","packages/module-plugin/src/index.tsx"],"sourcesContent":["import { EMPTY_ARR } from \"./constants\";\n\n/**\n * Assign properties from `props` to `obj`\n * @template O, P The obj and props types\n * @param {O} obj The object to copy properties to\n * @param {P} props The object to copy properties from\n * @returns {O & P}\n */\nexport function assign(obj, props) {\n\t// @ts-ignore We change the type of `obj` to be `O & P`\n\tfor (let i in props) obj[i] = props[i];\n\treturn /** @type {O & P} */ (obj);\n}\n\n/**\n * Remove a child node from its parent if attached. This is a workaround for\n * IE11 which doesn't support `Element.prototype.remove()`. Using this function\n * is smaller than including a dedicated polyfill.\n * @param {Node} node The node to remove\n */\nexport function removeNode(node) {\n\tlet parentNode = node.parentNode;\n\tif (parentNode) parentNode.removeChild(node);\n}\n\nexport const slice = EMPTY_ARR.slice;\n","import { _catchError } from './diff/catch-error';\n\n/**\n * The `option` object can potentially contain callback functions\n * that are called during various stages of our renderer. This is the\n * foundation on which all our addons like `preact/debug`, `preact/compat`,\n * and `preact/hooks` are based on. See the `Options` type in `internal.d.ts`\n * for a full list of available option hooks (most editors/IDEs allow you to\n * ctrl+click or cmd+click on mac the type definition below).\n * @type {import('./internal').Options}\n */\nconst options = {\n\t_catchError\n};\n\nexport default options;\n","import { slice } from './util';\nimport options from './options';\n\nlet vnodeId = 0;\n\n/**\n * Create an virtual node (used for JSX)\n * @param {import('./internal').VNode[\"type\"]} type The node name or Component\n * constructor for this virtual node\n * @param {object | null | undefined} [props] The properties of the virtual node\n * @param {Array} [children] The children of the virtual node\n * @returns {import('./internal').VNode}\n */\nexport function createElement(type, props, children) {\n\tlet normalizedProps = {},\n\t\tkey,\n\t\tref,\n\t\ti;\n\tfor (i in props) {\n\t\tif (i == 'key') key = props[i];\n\t\telse if (i == 'ref') ref = props[i];\n\t\telse normalizedProps[i] = props[i];\n\t}\n\n\tif (arguments.length > 2) {\n\t\tnormalizedProps.children =\n\t\t\targuments.length > 3 ? slice.call(arguments, 2) : children;\n\t}\n\n\t// If a Component VNode, check for and apply defaultProps\n\t// Note: type may be undefined in development, must never error here.\n\tif (typeof type == 'function' && type.defaultProps != null) {\n\t\tfor (i in type.defaultProps) {\n\t\t\tif (normalizedProps[i] === undefined) {\n\t\t\t\tnormalizedProps[i] = type.defaultProps[i];\n\t\t\t}\n\t\t}\n\t}\n\n\treturn createVNode(type, normalizedProps, key, ref, null);\n}\n\n/**\n * Create a VNode (used internally by Preact)\n * @param {import('./internal').VNode[\"type\"]} type The node name or Component\n * Constructor for this virtual node\n * @param {object | string | number | null} props The properties of this virtual node.\n * If this virtual node represents a text node, this is the text of the node (string or number).\n * @param {string | number | null} key The key for this virtual node, used when\n * diffing it against its children\n * @param {import('./internal').VNode[\"ref\"]} ref The ref property that will\n * receive a reference to its created child\n * @returns {import('./internal').VNode}\n */\nexport function createVNode(type, props, key, ref, original) {\n\t// V8 seems to be better at detecting type shapes if the object is allocated from the same call site\n\t// Do not inline into createElement and coerceToVNode!\n\tconst vnode = {\n\t\ttype,\n\t\tprops,\n\t\tkey,\n\t\tref,\n\t\t_children: null,\n\t\t_parent: null,\n\t\t_depth: 0,\n\t\t_dom: null,\n\t\t// _nextDom must be initialized to undefined b/c it will eventually\n\t\t// be set to dom.nextSibling which can return `null` and it is important\n\t\t// to be able to distinguish between an uninitialized _nextDom and\n\t\t// a _nextDom that has been set to `null`\n\t\t_nextDom: undefined,\n\t\t_component: null,\n\t\t_hydrating: null,\n\t\tconstructor: undefined,\n\t\t_original: original == null ? ++vnodeId : original\n\t};\n\n\t// Only invoke the vnode hook if this was *not* a direct copy:\n\tif (original == null && options.vnode != null) options.vnode(vnode);\n\n\treturn vnode;\n}\n\nexport function createRef() {\n\treturn { current: null };\n}\n\nexport function Fragment(props) {\n\treturn props.children;\n}\n\n/**\n * Check if a the argument is a valid Preact VNode.\n * @param {*} vnode\n * @returns {vnode is import('./internal').VNode}\n */\nexport const isValidElement = vnode =>\n\tvnode != null && vnode.constructor === undefined;\n","import { assign } from './util';\nimport { diff, commitRoot } from './diff/index';\nimport options from './options';\nimport { Fragment } from './create-element';\n\n/**\n * Base Component class. Provides `setState()` and `forceUpdate()`, which\n * trigger rendering\n * @param {object} props The initial component props\n * @param {object} context The initial context from parent components'\n * getChildContext\n */\nexport function Component(props, context) {\n\tthis.props = props;\n\tthis.context = context;\n}\n\n/**\n * Update component state and schedule a re-render.\n * @this {import('./internal').Component}\n * @param {object | ((s: object, p: object) => object)} update A hash of state\n * properties to update with new values or a function that given the current\n * state and props returns a new partial state\n * @param {() => void} [callback] A function to be called once component state is\n * updated\n */\nComponent.prototype.setState = function(update, callback) {\n\t// only clone state when copying to nextState the first time.\n\tlet s;\n\tif (this._nextState != null && this._nextState !== this.state) {\n\t\ts = this._nextState;\n\t} else {\n\t\ts = this._nextState = assign({}, this.state);\n\t}\n\n\tif (typeof update == 'function') {\n\t\t// Some libraries like `immer` mark the current state as readonly,\n\t\t// preventing us from mutating it, so we need to clone it. See #2716\n\t\tupdate = update(assign({}, s), this.props);\n\t}\n\n\tif (update) {\n\t\tassign(s, update);\n\t}\n\n\t// Skip update if updater function returned null\n\tif (update == null) return;\n\n\tif (this._vnode) {\n\t\tif (callback) {\n\t\t\tthis._stateCallbacks.push(callback);\n\t\t}\n\t\tenqueueRender(this);\n\t}\n};\n\n/**\n * Immediately perform a synchronous re-render of the component\n * @this {import('./internal').Component}\n * @param {() => void} [callback] A function to be called after component is\n * re-rendered\n */\nComponent.prototype.forceUpdate = function(callback) {\n\tif (this._vnode) {\n\t\t// Set render mode so that we can differentiate where the render request\n\t\t// is coming from. We need this because forceUpdate should never call\n\t\t// shouldComponentUpdate\n\t\tthis._force = true;\n\t\tif (callback) this._renderCallbacks.push(callback);\n\t\tenqueueRender(this);\n\t}\n};\n\n/**\n * Accepts `props` and `state`, and returns a new Virtual DOM tree to build.\n * Virtual DOM is generally constructed via [JSX](http://jasonformat.com/wtf-is-jsx).\n * @param {object} props Props (eg: JSX attributes) received from parent\n * element/component\n * @param {object} state The component's current state\n * @param {object} context Context object, as returned by the nearest\n * ancestor's `getChildContext()`\n * @returns {import('./index').ComponentChildren | void}\n */\nComponent.prototype.render = Fragment;\n\n/**\n * @param {import('./internal').VNode} vnode\n * @param {number | null} [childIndex]\n */\nexport function getDomSibling(vnode, childIndex) {\n\tif (childIndex == null) {\n\t\t// Use childIndex==null as a signal to resume the search from the vnode's sibling\n\t\treturn vnode._parent\n\t\t\t? getDomSibling(vnode._parent, vnode._parent._children.indexOf(vnode) + 1)\n\t\t\t: null;\n\t}\n\n\tlet sibling;\n\tfor (; childIndex < vnode._children.length; childIndex++) {\n\t\tsibling = vnode._children[childIndex];\n\n\t\tif (sibling != null && sibling._dom != null) {\n\t\t\t// Since updateParentDomPointers keeps _dom pointer correct,\n\t\t\t// we can rely on _dom to tell us if this subtree contains a\n\t\t\t// rendered DOM node, and what the first rendered DOM node is\n\t\t\treturn sibling._dom;\n\t\t}\n\t}\n\n\t// If we get here, we have not found a DOM node in this vnode's children.\n\t// We must resume from this vnode's sibling (in it's parent _children array)\n\t// Only climb up and search the parent if we aren't searching through a DOM\n\t// VNode (meaning we reached the DOM parent of the original vnode that began\n\t// the search)\n\treturn typeof vnode.type == 'function' ? getDomSibling(vnode) : null;\n}\n\n/**\n * Trigger in-place re-rendering of a component.\n * @param {import('./internal').Component} component The component to rerender\n */\nfunction renderComponent(component) {\n\tlet vnode = component._vnode,\n\t\toldDom = vnode._dom,\n\t\tparentDom = component._parentDom;\n\n\tif (parentDom) {\n\t\tlet commitQueue = [];\n\t\tconst oldVNode = assign({}, vnode);\n\t\toldVNode._original = vnode._original + 1;\n\n\t\tdiff(\n\t\t\tparentDom,\n\t\t\tvnode,\n\t\t\toldVNode,\n\t\t\tcomponent._globalContext,\n\t\t\tparentDom.ownerSVGElement !== undefined,\n\t\t\tvnode._hydrating != null ? [oldDom] : null,\n\t\t\tcommitQueue,\n\t\t\toldDom == null ? getDomSibling(vnode) : oldDom,\n\t\t\tvnode._hydrating\n\t\t);\n\t\tcommitRoot(commitQueue, vnode);\n\n\t\tif (vnode._dom != oldDom) {\n\t\t\tupdateParentDomPointers(vnode);\n\t\t}\n\t}\n}\n\n/**\n * @param {import('./internal').VNode} vnode\n */\nfunction updateParentDomPointers(vnode) {\n\tif ((vnode = vnode._parent) != null && vnode._component != null) {\n\t\tvnode._dom = vnode._component.base = null;\n\t\tfor (let i = 0; i < vnode._children.length; i++) {\n\t\t\tlet child = vnode._children[i];\n\t\t\tif (child != null && child._dom != null) {\n\t\t\t\tvnode._dom = vnode._component.base = child._dom;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\treturn updateParentDomPointers(vnode);\n\t}\n}\n\n/**\n * The render queue\n * @type {Array}\n */\nlet rerenderQueue = [];\n\n/*\n * The value of `Component.debounce` must asynchronously invoke the passed in callback. It is\n * important that contributors to Preact can consistently reason about what calls to `setState`, etc.\n * do, and when their effects will be applied. See the links below for some further reading on designing\n * asynchronous APIs.\n * * [Designing APIs for Asynchrony](https://blog.izs.me/2013/08/designing-apis-for-asynchrony)\n * * [Callbacks synchronous and asynchronous](https://blog.ometer.com/2011/07/24/callbacks-synchronous-and-asynchronous/)\n */\n\nlet prevDebounce;\n\nconst defer =\n\ttypeof Promise == 'function'\n\t\t? Promise.prototype.then.bind(Promise.resolve())\n\t\t: setTimeout;\n\n/**\n * Enqueue a rerender of a component\n * @param {import('./internal').Component} c The component to rerender\n */\nexport function enqueueRender(c) {\n\tif (\n\t\t(!c._dirty &&\n\t\t\t(c._dirty = true) &&\n\t\t\trerenderQueue.push(c) &&\n\t\t\t!process._rerenderCount++) ||\n\t\tprevDebounce !== options.debounceRendering\n\t) {\n\t\tprevDebounce = options.debounceRendering;\n\t\t(prevDebounce || defer)(process);\n\t}\n}\n\n/** Flush the render queue by rerendering all queued components */\nfunction process() {\n\tlet c;\n\trerenderQueue.sort((a, b) => a._vnode._depth - b._vnode._depth);\n\t// Don't update `renderCount` yet. Keep its value non-zero to prevent unnecessary\n\t// process() calls from getting scheduled while `queue` is still being consumed.\n\twhile ((c = rerenderQueue.shift())) {\n\t\tif (c._dirty) {\n\t\t\tlet renderQueueLength = rerenderQueue.length;\n\t\t\trenderComponent(c);\n\t\t\tif (rerenderQueue.length > renderQueueLength) {\n\t\t\t\t// When i.e. rerendering a provider additional new items can be injected, we want to\n\t\t\t\t// keep the order from top to bottom with those new items so we can handle them in a\n\t\t\t\t// single pass\n\t\t\t\trerenderQueue.sort((a, b) => a._vnode._depth - b._vnode._depth);\n\t\t\t}\n\t\t}\n\t}\n\tprocess._rerenderCount = 0;\n}\n\nprocess._rerenderCount = 0;\n","import { enqueueRender } from './component';\n\nexport let i = 0;\n\nexport function createContext(defaultValue, contextId) {\n\tcontextId = '__cC' + i++;\n\n\tconst context = {\n\t\t_id: contextId,\n\t\t_defaultValue: defaultValue,\n\t\t/** @type {import('./internal').FunctionComponent} */\n\t\tConsumer(props, contextValue) {\n\t\t\t// return props.children(\n\t\t\t// \tcontext[contextId] ? context[contextId].props.value : defaultValue\n\t\t\t// );\n\t\t\treturn props.children(contextValue);\n\t\t},\n\t\t/** @type {import('./internal').FunctionComponent} */\n\t\tProvider(props) {\n\t\t\tif (!this.getChildContext) {\n\t\t\t\t/** @type {import('./internal').Component[]} */\n\t\t\t\tlet subs = [];\n\t\t\t\tlet ctx = {};\n\t\t\t\tctx[contextId] = this;\n\n\t\t\t\tthis.getChildContext = () => ctx;\n\n\t\t\t\tthis.shouldComponentUpdate = function(_props) {\n\t\t\t\t\tif (this.props.value !== _props.value) {\n\t\t\t\t\t\t// I think the forced value propagation here was only needed when `options.debounceRendering` was being bypassed:\n\t\t\t\t\t\t// https://github.com/preactjs/preact/commit/4d339fb803bea09e9f198abf38ca1bf8ea4b7771#diff-54682ce380935a717e41b8bfc54737f6R358\n\t\t\t\t\t\t// In those cases though, even with the value corrected, we're double-rendering all nodes.\n\t\t\t\t\t\t// It might be better to just tell folks not to use force-sync mode.\n\t\t\t\t\t\t// Currently, using `useContext()` in a class component will overwrite its `this.context` value.\n\t\t\t\t\t\t// subs.some(c => {\n\t\t\t\t\t\t// \tc.context = _props.value;\n\t\t\t\t\t\t// \tenqueueRender(c);\n\t\t\t\t\t\t// });\n\n\t\t\t\t\t\t// subs.some(c => {\n\t\t\t\t\t\t// \tc.context[contextId] = _props.value;\n\t\t\t\t\t\t// \tenqueueRender(c);\n\t\t\t\t\t\t// });\n\t\t\t\t\t\tsubs.some(c => {\n\t\t\t\t\t\t\tc._force = true;\n\t\t\t\t\t\t\tenqueueRender(c);\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t};\n\n\t\t\t\tthis.sub = c => {\n\t\t\t\t\tsubs.push(c);\n\t\t\t\t\tlet old = c.componentWillUnmount;\n\t\t\t\t\tc.componentWillUnmount = () => {\n\t\t\t\t\t\tsubs.splice(subs.indexOf(c), 1);\n\t\t\t\t\t\tif (old) old.call(c);\n\t\t\t\t\t};\n\t\t\t\t};\n\t\t\t}\n\n\t\t\treturn props.children;\n\t\t}\n\t};\n\n\t// Devtools needs access to the context object when it\n\t// encounters a Provider. This is necessary to support\n\t// setting `displayName` on the context object instead\n\t// of on the component itself. See:\n\t// https://reactjs.org/docs/context.html#contextdisplayname\n\n\treturn (context.Provider._contextRef = context.Consumer.contextType = context);\n}\n","export const EMPTY_OBJ = {};\nexport const EMPTY_ARR = [];\nexport const IS_NON_DIMENSIONAL = /acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;\n","import { diff, unmount, applyRef } from './index';\nimport { createVNode, Fragment } from '../create-element';\nimport { EMPTY_OBJ, EMPTY_ARR } from '../constants';\nimport { getDomSibling } from '../component';\n\n/**\n * Diff the children of a virtual node\n * @param {import('../internal').PreactElement} parentDom The DOM element whose\n * children are being diffed\n * @param {import('../internal').ComponentChildren[]} renderResult\n * @param {import('../internal').VNode} newParentVNode The new virtual\n * node whose children should be diff'ed against oldParentVNode\n * @param {import('../internal').VNode} oldParentVNode The old virtual\n * node whose children should be diff'ed against newParentVNode\n * @param {object} globalContext The current context object - modified by getChildContext\n * @param {boolean} isSvg Whether or not this DOM node is an SVG node\n * @param {Array} excessDomChildren\n * @param {Array} commitQueue List of components\n * which have callbacks to invoke in commitRoot\n * @param {import('../internal').PreactElement} oldDom The current attached DOM\n * element any new dom elements should be placed around. Likely `null` on first\n * render (except when hydrating). Can be a sibling DOM element when diffing\n * Fragments that have siblings. In most cases, it starts out as `oldChildren[0]._dom`.\n * @param {boolean} isHydrating Whether or not we are in hydration\n */\nexport function diffChildren(\n\tparentDom,\n\trenderResult,\n\tnewParentVNode,\n\toldParentVNode,\n\tglobalContext,\n\tisSvg,\n\texcessDomChildren,\n\tcommitQueue,\n\toldDom,\n\tisHydrating\n) {\n\tlet i, j, oldVNode, childVNode, newDom, firstChildDom, refs;\n\n\t// This is a compression of oldParentVNode!=null && oldParentVNode != EMPTY_OBJ && oldParentVNode._children || EMPTY_ARR\n\t// as EMPTY_OBJ._children should be `undefined`.\n\tlet oldChildren = (oldParentVNode && oldParentVNode._children) || EMPTY_ARR;\n\n\tlet oldChildrenLength = oldChildren.length;\n\n\tnewParentVNode._children = [];\n\tfor (i = 0; i < renderResult.length; i++) {\n\t\tchildVNode = renderResult[i];\n\n\t\tif (childVNode == null || typeof childVNode == 'boolean') {\n\t\t\tchildVNode = newParentVNode._children[i] = null;\n\t\t}\n\t\t// If this newVNode is being reused (e.g.
{reuse}{reuse}
) in the same diff,\n\t\t// or we are rendering a component (e.g. setState) copy the oldVNodes so it can have\n\t\t// it's own DOM & etc. pointers\n\t\telse if (\n\t\t\ttypeof childVNode == 'string' ||\n\t\t\ttypeof childVNode == 'number' ||\n\t\t\t// eslint-disable-next-line valid-typeof\n\t\t\ttypeof childVNode == 'bigint'\n\t\t) {\n\t\t\tchildVNode = newParentVNode._children[i] = createVNode(\n\t\t\t\tnull,\n\t\t\t\tchildVNode,\n\t\t\t\tnull,\n\t\t\t\tnull,\n\t\t\t\tchildVNode\n\t\t\t);\n\t\t} else if (Array.isArray(childVNode)) {\n\t\t\tchildVNode = newParentVNode._children[i] = createVNode(\n\t\t\t\tFragment,\n\t\t\t\t{ children: childVNode },\n\t\t\t\tnull,\n\t\t\t\tnull,\n\t\t\t\tnull\n\t\t\t);\n\t\t} else if (childVNode._depth > 0) {\n\t\t\t// VNode is already in use, clone it. This can happen in the following\n\t\t\t// scenario:\n\t\t\t// const reuse =
\n\t\t\t//
{reuse}{reuse}
\n\t\t\tchildVNode = newParentVNode._children[i] = createVNode(\n\t\t\t\tchildVNode.type,\n\t\t\t\tchildVNode.props,\n\t\t\t\tchildVNode.key,\n\t\t\t\tchildVNode.ref ? childVNode.ref : null,\n\t\t\t\tchildVNode._original\n\t\t\t);\n\t\t} else {\n\t\t\tchildVNode = newParentVNode._children[i] = childVNode;\n\t\t}\n\n\t\t// Terser removes the `continue` here and wraps the loop body\n\t\t// in a `if (childVNode) { ... } condition\n\t\tif (childVNode == null) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tchildVNode._parent = newParentVNode;\n\t\tchildVNode._depth = newParentVNode._depth + 1;\n\n\t\t// Check if we find a corresponding element in oldChildren.\n\t\t// If found, delete the array item by setting to `undefined`.\n\t\t// We use `undefined`, as `null` is reserved for empty placeholders\n\t\t// (holes).\n\t\toldVNode = oldChildren[i];\n\n\t\tif (\n\t\t\toldVNode === null ||\n\t\t\t(oldVNode &&\n\t\t\t\tchildVNode.key == oldVNode.key &&\n\t\t\t\tchildVNode.type === oldVNode.type)\n\t\t) {\n\t\t\toldChildren[i] = undefined;\n\t\t} else {\n\t\t\t// Either oldVNode === undefined or oldChildrenLength > 0,\n\t\t\t// so after this loop oldVNode == null or oldVNode is a valid value.\n\t\t\tfor (j = 0; j < oldChildrenLength; j++) {\n\t\t\t\toldVNode = oldChildren[j];\n\t\t\t\t// If childVNode is unkeyed, we only match similarly unkeyed nodes, otherwise we match by key.\n\t\t\t\t// We always match by type (in either case).\n\t\t\t\tif (\n\t\t\t\t\toldVNode &&\n\t\t\t\t\tchildVNode.key == oldVNode.key &&\n\t\t\t\t\tchildVNode.type === oldVNode.type\n\t\t\t\t) {\n\t\t\t\t\toldChildren[j] = undefined;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\toldVNode = null;\n\t\t\t}\n\t\t}\n\n\t\toldVNode = oldVNode || EMPTY_OBJ;\n\n\t\t// Morph the old element into the new one, but don't append it to the dom yet\n\t\tdiff(\n\t\t\tparentDom,\n\t\t\tchildVNode,\n\t\t\toldVNode,\n\t\t\tglobalContext,\n\t\t\tisSvg,\n\t\t\texcessDomChildren,\n\t\t\tcommitQueue,\n\t\t\toldDom,\n\t\t\tisHydrating\n\t\t);\n\n\t\tnewDom = childVNode._dom;\n\n\t\tif ((j = childVNode.ref) && oldVNode.ref != j) {\n\t\t\tif (!refs) refs = [];\n\t\t\tif (oldVNode.ref) refs.push(oldVNode.ref, null, childVNode);\n\t\t\trefs.push(j, childVNode._component || newDom, childVNode);\n\t\t}\n\n\t\tif (newDom != null) {\n\t\t\tif (firstChildDom == null) {\n\t\t\t\tfirstChildDom = newDom;\n\t\t\t}\n\n\t\t\tif (\n\t\t\t\ttypeof childVNode.type == 'function' &&\n\t\t\t\tchildVNode._children === oldVNode._children\n\t\t\t) {\n\t\t\t\tchildVNode._nextDom = oldDom = reorderChildren(\n\t\t\t\t\tchildVNode,\n\t\t\t\t\toldDom,\n\t\t\t\t\tparentDom\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\toldDom = placeChild(\n\t\t\t\t\tparentDom,\n\t\t\t\t\tchildVNode,\n\t\t\t\t\toldVNode,\n\t\t\t\t\toldChildren,\n\t\t\t\t\tnewDom,\n\t\t\t\t\toldDom\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tif (typeof newParentVNode.type == 'function') {\n\t\t\t\t// Because the newParentVNode is Fragment-like, we need to set it's\n\t\t\t\t// _nextDom property to the nextSibling of its last child DOM node.\n\t\t\t\t//\n\t\t\t\t// `oldDom` contains the correct value here because if the last child\n\t\t\t\t// is a Fragment-like, then oldDom has already been set to that child's _nextDom.\n\t\t\t\t// If the last child is a DOM VNode, then oldDom will be set to that DOM\n\t\t\t\t// node's nextSibling.\n\t\t\t\tnewParentVNode._nextDom = oldDom;\n\t\t\t}\n\t\t} else if (\n\t\t\toldDom &&\n\t\t\toldVNode._dom == oldDom &&\n\t\t\toldDom.parentNode != parentDom\n\t\t) {\n\t\t\t// The above condition is to handle null placeholders. See test in placeholder.test.js:\n\t\t\t// `efficiently replace null placeholders in parent rerenders`\n\t\t\toldDom = getDomSibling(oldVNode);\n\t\t}\n\t}\n\n\tnewParentVNode._dom = firstChildDom;\n\n\t// Remove remaining oldChildren if there are any.\n\tfor (i = oldChildrenLength; i--; ) {\n\t\tif (oldChildren[i] != null) {\n\t\t\tif (\n\t\t\t\ttypeof newParentVNode.type == 'function' &&\n\t\t\t\toldChildren[i]._dom != null &&\n\t\t\t\toldChildren[i]._dom == newParentVNode._nextDom\n\t\t\t) {\n\t\t\t\t// If the newParentVNode.__nextDom points to a dom node that is about to\n\t\t\t\t// be unmounted, then get the next sibling of that vnode and set\n\t\t\t\t// _nextDom to it\n\t\t\t\tnewParentVNode._nextDom = getLastDom(oldParentVNode).nextSibling;\n\t\t\t}\n\n\t\t\tunmount(oldChildren[i], oldChildren[i]);\n\t\t}\n\t}\n\n\t// Set refs only after unmount\n\tif (refs) {\n\t\tfor (i = 0; i < refs.length; i++) {\n\t\t\tapplyRef(refs[i], refs[++i], refs[++i]);\n\t\t}\n\t}\n}\n\nfunction reorderChildren(childVNode, oldDom, parentDom) {\n\t// Note: VNodes in nested suspended trees may be missing _children.\n\tlet c = childVNode._children;\n\tlet tmp = 0;\n\tfor (; c && tmp < c.length; tmp++) {\n\t\tlet vnode = c[tmp];\n\t\tif (vnode) {\n\t\t\t// We typically enter this code path on sCU bailout, where we copy\n\t\t\t// oldVNode._children to newVNode._children. If that is the case, we need\n\t\t\t// to update the old children's _parent pointer to point to the newVNode\n\t\t\t// (childVNode here).\n\t\t\tvnode._parent = childVNode;\n\n\t\t\tif (typeof vnode.type == 'function') {\n\t\t\t\toldDom = reorderChildren(vnode, oldDom, parentDom);\n\t\t\t} else {\n\t\t\t\toldDom = placeChild(parentDom, vnode, vnode, c, vnode._dom, oldDom);\n\t\t\t}\n\t\t}\n\t}\n\n\treturn oldDom;\n}\n\n/**\n * Flatten and loop through the children of a virtual node\n * @param {import('../index').ComponentChildren} children The unflattened\n * children of a virtual node\n * @returns {import('../internal').VNode[]}\n */\nexport function toChildArray(children, out) {\n\tout = out || [];\n\tif (children == null || typeof children == 'boolean') {\n\t} else if (Array.isArray(children)) {\n\t\tchildren.some(child => {\n\t\t\ttoChildArray(child, out);\n\t\t});\n\t} else {\n\t\tout.push(children);\n\t}\n\treturn out;\n}\n\nfunction placeChild(\n\tparentDom,\n\tchildVNode,\n\toldVNode,\n\toldChildren,\n\tnewDom,\n\toldDom\n) {\n\tlet nextDom;\n\tif (childVNode._nextDom !== undefined) {\n\t\t// Only Fragments or components that return Fragment like VNodes will\n\t\t// have a non-undefined _nextDom. Continue the diff from the sibling\n\t\t// of last DOM child of this child VNode\n\t\tnextDom = childVNode._nextDom;\n\n\t\t// Eagerly cleanup _nextDom. We don't need to persist the value because\n\t\t// it is only used by `diffChildren` to determine where to resume the diff after\n\t\t// diffing Components and Fragments. Once we store it the nextDOM local var, we\n\t\t// can clean up the property\n\t\tchildVNode._nextDom = undefined;\n\t} else if (\n\t\toldVNode == null ||\n\t\tnewDom != oldDom ||\n\t\tnewDom.parentNode == null\n\t) {\n\t\touter: if (oldDom == null || oldDom.parentNode !== parentDom) {\n\t\t\tparentDom.appendChild(newDom);\n\t\t\tnextDom = null;\n\t\t} else {\n\t\t\t// `j= 0; i--) {\n\t\t\tlet child = vnode._children[i];\n\t\t\tif (child) {\n\t\t\t\tlet lastDom = getLastDom(child);\n\t\t\t\tif (lastDom) {\n\t\t\t\t\treturn lastDom;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn null;\n}\n","import { IS_NON_DIMENSIONAL } from '../constants';\nimport options from '../options';\n\n/**\n * Diff the old and new properties of a VNode and apply changes to the DOM node\n * @param {import('../internal').PreactElement} dom The DOM node to apply\n * changes to\n * @param {object} newProps The new props\n * @param {object} oldProps The old props\n * @param {boolean} isSvg Whether or not this node is an SVG node\n * @param {boolean} hydrate Whether or not we are in hydration mode\n */\nexport function diffProps(dom, newProps, oldProps, isSvg, hydrate) {\n\tlet i;\n\n\tfor (i in oldProps) {\n\t\tif (i !== 'children' && i !== 'key' && !(i in newProps)) {\n\t\t\tsetProperty(dom, i, null, oldProps[i], isSvg);\n\t\t}\n\t}\n\n\tfor (i in newProps) {\n\t\tif (\n\t\t\t(!hydrate || typeof newProps[i] == 'function') &&\n\t\t\ti !== 'children' &&\n\t\t\ti !== 'key' &&\n\t\t\ti !== 'value' &&\n\t\t\ti !== 'checked' &&\n\t\t\toldProps[i] !== newProps[i]\n\t\t) {\n\t\t\tsetProperty(dom, i, newProps[i], oldProps[i], isSvg);\n\t\t}\n\t}\n}\n\nfunction setStyle(style, key, value) {\n\tif (key[0] === '-') {\n\t\tstyle.setProperty(key, value == null ? '' : value);\n\t} else if (value == null) {\n\t\tstyle[key] = '';\n\t} else if (typeof value != 'number' || IS_NON_DIMENSIONAL.test(key)) {\n\t\tstyle[key] = value;\n\t} else {\n\t\tstyle[key] = value + 'px';\n\t}\n}\n\n/**\n * Set a property value on a DOM node\n * @param {import('../internal').PreactElement} dom The DOM node to modify\n * @param {string} name The name of the property to set\n * @param {*} value The value to set the property to\n * @param {*} oldValue The old value the property had\n * @param {boolean} isSvg Whether or not this DOM node is an SVG node or not\n */\nexport function setProperty(dom, name, value, oldValue, isSvg) {\n\tlet useCapture;\n\n\to: if (name === 'style') {\n\t\tif (typeof value == 'string') {\n\t\t\tdom.style.cssText = value;\n\t\t} else {\n\t\t\tif (typeof oldValue == 'string') {\n\t\t\t\tdom.style.cssText = oldValue = '';\n\t\t\t}\n\n\t\t\tif (oldValue) {\n\t\t\t\tfor (name in oldValue) {\n\t\t\t\t\tif (!(value && name in value)) {\n\t\t\t\t\t\tsetStyle(dom.style, name, '');\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (value) {\n\t\t\t\tfor (name in value) {\n\t\t\t\t\tif (!oldValue || value[name] !== oldValue[name]) {\n\t\t\t\t\t\tsetStyle(dom.style, name, value[name]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\t// Benchmark for comparison: https://esbench.com/bench/574c954bdb965b9a00965ac6\n\telse if (name[0] === 'o' && name[1] === 'n') {\n\t\tuseCapture = name !== (name = name.replace(/Capture$/, ''));\n\n\t\t// Infer correct casing for DOM built-in events:\n\t\tif (name.toLowerCase() in dom) name = name.toLowerCase().slice(2);\n\t\telse name = name.slice(2);\n\n\t\tif (!dom._listeners) dom._listeners = {};\n\t\tdom._listeners[name + useCapture] = value;\n\n\t\tif (value) {\n\t\t\tif (!oldValue) {\n\t\t\t\tconst handler = useCapture ? eventProxyCapture : eventProxy;\n\t\t\t\tdom.addEventListener(name, handler, useCapture);\n\t\t\t}\n\t\t} else {\n\t\t\tconst handler = useCapture ? eventProxyCapture : eventProxy;\n\t\t\tdom.removeEventListener(name, handler, useCapture);\n\t\t}\n\t} else if (name !== 'dangerouslySetInnerHTML') {\n\t\tif (isSvg) {\n\t\t\t// Normalize incorrect prop usage for SVG:\n\t\t\t// - xlink:href / xlinkHref --> href (xlink:href was removed from SVG and isn't needed)\n\t\t\t// - className --> class\n\t\t\tname = name.replace(/xlink(H|:h)/, 'h').replace(/sName$/, 's');\n\t\t} else if (\n\t\t\tname !== 'width' &&\n\t\t\tname !== 'height' &&\n\t\t\tname !== 'href' &&\n\t\t\tname !== 'list' &&\n\t\t\tname !== 'form' &&\n\t\t\t// Default value in browsers is `-1` and an empty string is\n\t\t\t// cast to `0` instead\n\t\t\tname !== 'tabIndex' &&\n\t\t\tname !== 'download' &&\n\t\t\tname in dom\n\t\t) {\n\t\t\ttry {\n\t\t\t\tdom[name] = value == null ? '' : value;\n\t\t\t\t// labelled break is 1b smaller here than a return statement (sorry)\n\t\t\t\tbreak o;\n\t\t\t} catch (e) {}\n\t\t}\n\n\t\t// ARIA-attributes have a different notion of boolean values.\n\t\t// The value `false` is different from the attribute not\n\t\t// existing on the DOM, so we can't remove it. For non-boolean\n\t\t// ARIA-attributes we could treat false as a removal, but the\n\t\t// amount of exceptions would cost us too many bytes. On top of\n\t\t// that other VDOM frameworks also always stringify `false`.\n\n\t\tif (typeof value === 'function') {\n\t\t\t// never serialize functions as attribute values\n\t\t} else if (value != null && (value !== false || name.indexOf('-') != -1)) {\n\t\t\tdom.setAttribute(name, value);\n\t\t} else {\n\t\t\tdom.removeAttribute(name);\n\t\t}\n\t}\n}\n\n/**\n * Proxy an event to hooked event handlers\n * @param {Event} e The event object from the browser\n * @private\n */\nfunction eventProxy(e) {\n\treturn this._listeners[e.type + false](options.event ? options.event(e) : e);\n}\n\nfunction eventProxyCapture(e) {\n\treturn this._listeners[e.type + true](options.event ? options.event(e) : e);\n}\n","import { EMPTY_OBJ } from '../constants';\nimport { Component, getDomSibling } from '../component';\nimport { Fragment } from '../create-element';\nimport { diffChildren } from './children';\nimport { diffProps, setProperty } from './props';\nimport { assign, removeNode, slice } from '../util';\nimport options from '../options';\n\n/**\n * Diff two virtual nodes and apply proper changes to the DOM\n * @param {import('../internal').PreactElement} parentDom The parent of the DOM element\n * @param {import('../internal').VNode} newVNode The new virtual node\n * @param {import('../internal').VNode} oldVNode The old virtual node\n * @param {object} globalContext The current context object. Modified by getChildContext\n * @param {boolean} isSvg Whether or not this element is an SVG node\n * @param {Array} excessDomChildren\n * @param {Array} commitQueue List of components\n * which have callbacks to invoke in commitRoot\n * @param {import('../internal').PreactElement} oldDom The current attached DOM\n * element any new dom elements should be placed around. Likely `null` on first\n * render (except when hydrating). Can be a sibling DOM element when diffing\n * Fragments that have siblings. In most cases, it starts out as `oldChildren[0]._dom`.\n * @param {boolean} [isHydrating] Whether or not we are in hydration\n */\nexport function diff(\n\tparentDom,\n\tnewVNode,\n\toldVNode,\n\tglobalContext,\n\tisSvg,\n\texcessDomChildren,\n\tcommitQueue,\n\toldDom,\n\tisHydrating\n) {\n\tlet tmp,\n\t\tnewType = newVNode.type;\n\n\t// When passing through createElement it assigns the object\n\t// constructor as undefined. This to prevent JSON-injection.\n\tif (newVNode.constructor !== undefined) return null;\n\n\t// If the previous diff bailed out, resume creating/hydrating.\n\tif (oldVNode._hydrating != null) {\n\t\tisHydrating = oldVNode._hydrating;\n\t\toldDom = newVNode._dom = oldVNode._dom;\n\t\t// if we resume, we want the tree to be \"unlocked\"\n\t\tnewVNode._hydrating = null;\n\t\texcessDomChildren = [oldDom];\n\t}\n\n\tif ((tmp = options._diff)) tmp(newVNode);\n\n\ttry {\n\t\touter: if (typeof newType == 'function') {\n\t\t\tlet c, isNew, oldProps, oldState, snapshot, clearProcessingException;\n\t\t\tlet newProps = newVNode.props;\n\n\t\t\t// Necessary for createContext api. Setting this property will pass\n\t\t\t// the context value as `this.context` just for this component.\n\t\t\ttmp = newType.contextType;\n\t\t\tlet provider = tmp && globalContext[tmp._id];\n\t\t\tlet componentContext = tmp\n\t\t\t\t? provider\n\t\t\t\t\t? provider.props.value\n\t\t\t\t\t: tmp._defaultValue\n\t\t\t\t: globalContext;\n\n\t\t\t// Get component and set it to `c`\n\t\t\tif (oldVNode._component) {\n\t\t\t\tc = newVNode._component = oldVNode._component;\n\t\t\t\tclearProcessingException = c._processingException = c._pendingError;\n\t\t\t} else {\n\t\t\t\t// Instantiate the new component\n\t\t\t\tif ('prototype' in newType && newType.prototype.render) {\n\t\t\t\t\t// @ts-ignore The check above verifies that newType is suppose to be constructed\n\t\t\t\t\tnewVNode._component = c = new newType(newProps, componentContext); // eslint-disable-line new-cap\n\t\t\t\t} else {\n\t\t\t\t\t// @ts-ignore Trust me, Component implements the interface we want\n\t\t\t\t\tnewVNode._component = c = new Component(newProps, componentContext);\n\t\t\t\t\tc.constructor = newType;\n\t\t\t\t\tc.render = doRender;\n\t\t\t\t}\n\t\t\t\tif (provider) provider.sub(c);\n\n\t\t\t\tc.props = newProps;\n\t\t\t\tif (!c.state) c.state = {};\n\t\t\t\tc.context = componentContext;\n\t\t\t\tc._globalContext = globalContext;\n\t\t\t\tisNew = c._dirty = true;\n\t\t\t\tc._renderCallbacks = [];\n\t\t\t\tc._stateCallbacks = [];\n\t\t\t}\n\n\t\t\t// Invoke getDerivedStateFromProps\n\t\t\tif (c._nextState == null) {\n\t\t\t\tc._nextState = c.state;\n\t\t\t}\n\n\t\t\tif (newType.getDerivedStateFromProps != null) {\n\t\t\t\tif (c._nextState == c.state) {\n\t\t\t\t\tc._nextState = assign({}, c._nextState);\n\t\t\t\t}\n\n\t\t\t\tassign(\n\t\t\t\t\tc._nextState,\n\t\t\t\t\tnewType.getDerivedStateFromProps(newProps, c._nextState)\n\t\t\t\t);\n\t\t\t}\n\n\t\t\toldProps = c.props;\n\t\t\toldState = c.state;\n\t\t\tc._vnode = newVNode;\n\n\t\t\t// Invoke pre-render lifecycle methods\n\t\t\tif (isNew) {\n\t\t\t\tif (\n\t\t\t\t\tnewType.getDerivedStateFromProps == null &&\n\t\t\t\t\tc.componentWillMount != null\n\t\t\t\t) {\n\t\t\t\t\tc.componentWillMount();\n\t\t\t\t}\n\n\t\t\t\tif (c.componentDidMount != null) {\n\t\t\t\t\tc._renderCallbacks.push(c.componentDidMount);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (\n\t\t\t\t\tnewType.getDerivedStateFromProps == null &&\n\t\t\t\t\tnewProps !== oldProps &&\n\t\t\t\t\tc.componentWillReceiveProps != null\n\t\t\t\t) {\n\t\t\t\t\tc.componentWillReceiveProps(newProps, componentContext);\n\t\t\t\t}\n\n\t\t\t\tif (\n\t\t\t\t\t(!c._force &&\n\t\t\t\t\t\tc.shouldComponentUpdate != null &&\n\t\t\t\t\t\tc.shouldComponentUpdate(\n\t\t\t\t\t\t\tnewProps,\n\t\t\t\t\t\t\tc._nextState,\n\t\t\t\t\t\t\tcomponentContext\n\t\t\t\t\t\t) === false) ||\n\t\t\t\t\tnewVNode._original === oldVNode._original\n\t\t\t\t) {\n\t\t\t\t\t// More info about this here: https://gist.github.com/JoviDeCroock/bec5f2ce93544d2e6070ef8e0036e4e8\n\t\t\t\t\tif (newVNode._original !== oldVNode._original) {\n\t\t\t\t\t\t// When we are dealing with a bail because of sCU we have to update\n\t\t\t\t\t\t// the props, state and dirty-state.\n\t\t\t\t\t\t// when we are dealing with strict-equality we don't as the child could still\n\t\t\t\t\t\t// be dirtied see #3883\n\t\t\t\t\t\tc.props = newProps;\n\t\t\t\t\t\tc.state = c._nextState;\n\t\t\t\t\t\tc._dirty = false;\n\t\t\t\t\t}\n\n\t\t\t\t\t// In cases of bailing due to strict-equality we have to reset force as well\n\t\t\t\t\tc._force = false;\n\t\t\t\t\tnewVNode._dom = oldVNode._dom;\n\t\t\t\t\tnewVNode._children = oldVNode._children;\n\t\t\t\t\tnewVNode._children.forEach(vnode => {\n\t\t\t\t\t\tif (vnode) vnode._parent = newVNode;\n\t\t\t\t\t});\n\n\t\t\t\t\tfor (let i = 0; i < c._stateCallbacks.length; i++) {\n\t\t\t\t\t\tc._renderCallbacks.push(c._stateCallbacks[i]);\n\t\t\t\t\t}\n\t\t\t\t\tc._stateCallbacks = [];\n\n\t\t\t\t\tif (c._renderCallbacks.length) {\n\t\t\t\t\t\tcommitQueue.push(c);\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak outer;\n\t\t\t\t}\n\n\t\t\t\tif (c.componentWillUpdate != null) {\n\t\t\t\t\tc.componentWillUpdate(newProps, c._nextState, componentContext);\n\t\t\t\t}\n\n\t\t\t\tif (c.componentDidUpdate != null) {\n\t\t\t\t\tc._renderCallbacks.push(() => {\n\t\t\t\t\t\tc.componentDidUpdate(oldProps, oldState, snapshot);\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tc.context = componentContext;\n\t\t\tc.props = newProps;\n\t\t\tc._parentDom = parentDom;\n\n\t\t\tlet renderHook = options._render,\n\t\t\t\tcount = 0;\n\t\t\tif ('prototype' in newType && newType.prototype.render) {\n\t\t\t\tc.state = c._nextState;\n\t\t\t\tc._dirty = false;\n\n\t\t\t\tif (renderHook) renderHook(newVNode);\n\n\t\t\t\ttmp = c.render(c.props, c.state, c.context);\n\n\t\t\t\tfor (let i = 0; i < c._stateCallbacks.length; i++) {\n\t\t\t\t\tc._renderCallbacks.push(c._stateCallbacks[i]);\n\t\t\t\t}\n\t\t\t\tc._stateCallbacks = [];\n\t\t\t} else {\n\t\t\t\tdo {\n\t\t\t\t\tc._dirty = false;\n\t\t\t\t\tif (renderHook) renderHook(newVNode);\n\n\t\t\t\t\ttmp = c.render(c.props, c.state, c.context);\n\n\t\t\t\t\t// Handle setState called in render, see #2553\n\t\t\t\t\tc.state = c._nextState;\n\t\t\t\t} while (c._dirty && ++count < 25);\n\t\t\t}\n\n\t\t\t// Handle setState called in render, see #2553\n\t\t\tc.state = c._nextState;\n\n\t\t\tif (c.getChildContext != null) {\n\t\t\t\tglobalContext = assign(assign({}, globalContext), c.getChildContext());\n\t\t\t}\n\n\t\t\tif (!isNew && c.getSnapshotBeforeUpdate != null) {\n\t\t\t\tsnapshot = c.getSnapshotBeforeUpdate(oldProps, oldState);\n\t\t\t}\n\n\t\t\tlet isTopLevelFragment =\n\t\t\t\ttmp != null && tmp.type === Fragment && tmp.key == null;\n\t\t\tlet renderResult = isTopLevelFragment ? tmp.props.children : tmp;\n\n\t\t\tdiffChildren(\n\t\t\t\tparentDom,\n\t\t\t\tArray.isArray(renderResult) ? renderResult : [renderResult],\n\t\t\t\tnewVNode,\n\t\t\t\toldVNode,\n\t\t\t\tglobalContext,\n\t\t\t\tisSvg,\n\t\t\t\texcessDomChildren,\n\t\t\t\tcommitQueue,\n\t\t\t\toldDom,\n\t\t\t\tisHydrating\n\t\t\t);\n\n\t\t\tc.base = newVNode._dom;\n\n\t\t\t// We successfully rendered this VNode, unset any stored hydration/bailout state:\n\t\t\tnewVNode._hydrating = null;\n\n\t\t\tif (c._renderCallbacks.length) {\n\t\t\t\tcommitQueue.push(c);\n\t\t\t}\n\n\t\t\tif (clearProcessingException) {\n\t\t\t\tc._pendingError = c._processingException = null;\n\t\t\t}\n\n\t\t\tc._force = false;\n\t\t} else if (\n\t\t\texcessDomChildren == null &&\n\t\t\tnewVNode._original === oldVNode._original\n\t\t) {\n\t\t\tnewVNode._children = oldVNode._children;\n\t\t\tnewVNode._dom = oldVNode._dom;\n\t\t} else {\n\t\t\tnewVNode._dom = diffElementNodes(\n\t\t\t\toldVNode._dom,\n\t\t\t\tnewVNode,\n\t\t\t\toldVNode,\n\t\t\t\tglobalContext,\n\t\t\t\tisSvg,\n\t\t\t\texcessDomChildren,\n\t\t\t\tcommitQueue,\n\t\t\t\tisHydrating\n\t\t\t);\n\t\t}\n\n\t\tif ((tmp = options.diffed)) tmp(newVNode);\n\t} catch (e) {\n\t\tnewVNode._original = null;\n\t\t// if hydrating or creating initial tree, bailout preserves DOM:\n\t\tif (isHydrating || excessDomChildren != null) {\n\t\t\tnewVNode._dom = oldDom;\n\t\t\tnewVNode._hydrating = !!isHydrating;\n\t\t\texcessDomChildren[excessDomChildren.indexOf(oldDom)] = null;\n\t\t\t// ^ could possibly be simplified to:\n\t\t\t// excessDomChildren.length = 0;\n\t\t}\n\t\toptions._catchError(e, newVNode, oldVNode);\n\t}\n}\n\n/**\n * @param {Array} commitQueue List of components\n * which have callbacks to invoke in commitRoot\n * @param {import('../internal').VNode} root\n */\nexport function commitRoot(commitQueue, root) {\n\tif (options._commit) options._commit(root, commitQueue);\n\n\tcommitQueue.some(c => {\n\t\ttry {\n\t\t\t// @ts-ignore Reuse the commitQueue variable here so the type changes\n\t\t\tcommitQueue = c._renderCallbacks;\n\t\t\tc._renderCallbacks = [];\n\t\t\tcommitQueue.some(cb => {\n\t\t\t\t// @ts-ignore See above ts-ignore on commitQueue\n\t\t\t\tcb.call(c);\n\t\t\t});\n\t\t} catch (e) {\n\t\t\toptions._catchError(e, c._vnode);\n\t\t}\n\t});\n}\n\n/**\n * Diff two virtual nodes representing DOM element\n * @param {import('../internal').PreactElement} dom The DOM element representing\n * the virtual nodes being diffed\n * @param {import('../internal').VNode} newVNode The new virtual node\n * @param {import('../internal').VNode} oldVNode The old virtual node\n * @param {object} globalContext The current context object\n * @param {boolean} isSvg Whether or not this DOM node is an SVG node\n * @param {*} excessDomChildren\n * @param {Array} commitQueue List of components\n * which have callbacks to invoke in commitRoot\n * @param {boolean} isHydrating Whether or not we are in hydration\n * @returns {import('../internal').PreactElement}\n */\nfunction diffElementNodes(\n\tdom,\n\tnewVNode,\n\toldVNode,\n\tglobalContext,\n\tisSvg,\n\texcessDomChildren,\n\tcommitQueue,\n\tisHydrating\n) {\n\tlet oldProps = oldVNode.props;\n\tlet newProps = newVNode.props;\n\tlet nodeType = newVNode.type;\n\tlet i = 0;\n\n\t// Tracks entering and exiting SVG namespace when descending through the tree.\n\tif (nodeType === 'svg') isSvg = true;\n\n\tif (excessDomChildren != null) {\n\t\tfor (; i < excessDomChildren.length; i++) {\n\t\t\tconst child = excessDomChildren[i];\n\n\t\t\t// if newVNode matches an element in excessDomChildren or the `dom`\n\t\t\t// argument matches an element in excessDomChildren, remove it from\n\t\t\t// excessDomChildren so it isn't later removed in diffChildren\n\t\t\tif (\n\t\t\t\tchild &&\n\t\t\t\t'setAttribute' in child === !!nodeType &&\n\t\t\t\t(nodeType ? child.localName === nodeType : child.nodeType === 3)\n\t\t\t) {\n\t\t\t\tdom = child;\n\t\t\t\texcessDomChildren[i] = null;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\tif (dom == null) {\n\t\tif (nodeType === null) {\n\t\t\t// @ts-ignore createTextNode returns Text, we expect PreactElement\n\t\t\treturn document.createTextNode(newProps);\n\t\t}\n\n\t\tif (isSvg) {\n\t\t\tdom = document.createElementNS(\n\t\t\t\t'http://www.w3.org/2000/svg',\n\t\t\t\t// @ts-ignore We know `newVNode.type` is a string\n\t\t\t\tnodeType\n\t\t\t);\n\t\t} else {\n\t\t\tdom = document.createElement(\n\t\t\t\t// @ts-ignore We know `newVNode.type` is a string\n\t\t\t\tnodeType,\n\t\t\t\tnewProps.is && newProps\n\t\t\t);\n\t\t}\n\n\t\t// we created a new parent, so none of the previously attached children can be reused:\n\t\texcessDomChildren = null;\n\t\t// we are creating a new node, so we can assume this is a new subtree (in case we are hydrating), this deopts the hydrate\n\t\tisHydrating = false;\n\t}\n\n\tif (nodeType === null) {\n\t\t// During hydration, we still have to split merged text from SSR'd HTML.\n\t\tif (oldProps !== newProps && (!isHydrating || dom.data !== newProps)) {\n\t\t\tdom.data = newProps;\n\t\t}\n\t} else {\n\t\t// If excessDomChildren was not null, repopulate it with the current element's children:\n\t\texcessDomChildren = excessDomChildren && slice.call(dom.childNodes);\n\n\t\toldProps = oldVNode.props || EMPTY_OBJ;\n\n\t\tlet oldHtml = oldProps.dangerouslySetInnerHTML;\n\t\tlet newHtml = newProps.dangerouslySetInnerHTML;\n\n\t\t// During hydration, props are not diffed at all (including dangerouslySetInnerHTML)\n\t\t// @TODO we should warn in debug mode when props don't match here.\n\t\tif (!isHydrating) {\n\t\t\t// But, if we are in a situation where we are using existing DOM (e.g. replaceNode)\n\t\t\t// we should read the existing DOM attributes to diff them\n\t\t\tif (excessDomChildren != null) {\n\t\t\t\toldProps = {};\n\t\t\t\tfor (i = 0; i < dom.attributes.length; i++) {\n\t\t\t\t\toldProps[dom.attributes[i].name] = dom.attributes[i].value;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (newHtml || oldHtml) {\n\t\t\t\t// Avoid re-applying the same '__html' if it did not changed between re-render\n\t\t\t\tif (\n\t\t\t\t\t!newHtml ||\n\t\t\t\t\t((!oldHtml || newHtml.__html != oldHtml.__html) &&\n\t\t\t\t\t\tnewHtml.__html !== dom.innerHTML)\n\t\t\t\t) {\n\t\t\t\t\tdom.innerHTML = (newHtml && newHtml.__html) || '';\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tdiffProps(dom, newProps, oldProps, isSvg, isHydrating);\n\n\t\t// If the new vnode didn't have dangerouslySetInnerHTML, diff its children\n\t\tif (newHtml) {\n\t\t\tnewVNode._children = [];\n\t\t} else {\n\t\t\ti = newVNode.props.children;\n\t\t\tdiffChildren(\n\t\t\t\tdom,\n\t\t\t\tArray.isArray(i) ? i : [i],\n\t\t\t\tnewVNode,\n\t\t\t\toldVNode,\n\t\t\t\tglobalContext,\n\t\t\t\tisSvg && nodeType !== 'foreignObject',\n\t\t\t\texcessDomChildren,\n\t\t\t\tcommitQueue,\n\t\t\t\texcessDomChildren\n\t\t\t\t\t? excessDomChildren[0]\n\t\t\t\t\t: oldVNode._children && getDomSibling(oldVNode, 0),\n\t\t\t\tisHydrating\n\t\t\t);\n\n\t\t\t// Remove children that are not part of any vnode.\n\t\t\tif (excessDomChildren != null) {\n\t\t\t\tfor (i = excessDomChildren.length; i--; ) {\n\t\t\t\t\tif (excessDomChildren[i] != null) removeNode(excessDomChildren[i]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// (as above, don't diff props during hydration)\n\t\tif (!isHydrating) {\n\t\t\tif (\n\t\t\t\t'value' in newProps &&\n\t\t\t\t(i = newProps.value) !== undefined &&\n\t\t\t\t// #2756 For the -element the initial value is 0,\n\t\t\t\t// despite the attribute not being present. When the attribute\n\t\t\t\t// is missing the progress bar is treated as indeterminate.\n\t\t\t\t// To fix that we'll always update it when it is 0 for progress elements\n\t\t\t\t(i !== dom.value ||\n\t\t\t\t\t(nodeType === 'progress' && !i) ||\n\t\t\t\t\t// This is only for IE 11 to fix \n\t\tif (\n\t\t\ttype == 'select' &&\n\t\t\tnormalizedProps.multiple &&\n\t\t\tArray.isArray(normalizedProps.value)\n\t\t) {\n\t\t\t// forEach() always returns undefined, which we abuse here to unset the value prop.\n\t\t\tnormalizedProps.value = toChildArray(props.children).forEach(child => {\n\t\t\t\tchild.props.selected =\n\t\t\t\t\tnormalizedProps.value.indexOf(child.props.value) != -1;\n\t\t\t});\n\t\t}\n\n\t\t// Adding support for defaultValue in select tag\n\t\tif (type == 'select' && normalizedProps.defaultValue != null) {\n\t\t\tnormalizedProps.value = toChildArray(props.children).forEach(child => {\n\t\t\t\tif (normalizedProps.multiple) {\n\t\t\t\t\tchild.props.selected =\n\t\t\t\t\t\tnormalizedProps.defaultValue.indexOf(child.props.value) != -1;\n\t\t\t\t} else {\n\t\t\t\t\tchild.props.selected =\n\t\t\t\t\t\tnormalizedProps.defaultValue == child.props.value;\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\n\t\tvnode.props = normalizedProps;\n\n\t\tif (props.class != props.className) {\n\t\t\tclassNameDescriptor.enumerable = 'className' in props;\n\t\t\tif (props.className != null) normalizedProps.class = props.className;\n\t\t\tObject.defineProperty(normalizedProps, 'className', classNameDescriptor);\n\t\t}\n\t}\n\n\tvnode.$$typeof = REACT_ELEMENT_TYPE;\n\n\tif (oldVNodeHook) oldVNodeHook(vnode);\n};\n\n// Only needed for react-relay\nlet currentComponent;\nconst oldBeforeRender = options._render;\noptions._render = function(vnode) {\n\tif (oldBeforeRender) {\n\t\toldBeforeRender(vnode);\n\t}\n\tcurrentComponent = vnode._component;\n};\n\nconst oldDiffed = options.diffed;\n/** @type {(vnode: import('./internal').VNode)} */\noptions.diffed = function(vnode) {\n\tif (oldDiffed) {\n\t\toldDiffed(vnode);\n\t}\n\n\tconst props = vnode.props;\n\tconst dom = vnode._dom;\n\tif (\n\t\tdom != null &&\n\t\tvnode.type === 'textarea' &&\n\t\t'value' in props &&\n\t\tprops.value !== dom.value\n\t) {\n\t\tdom.value = props.value == null ? '' : props.value;\n\t}\n\n\tcurrentComponent = null;\n};\n\n// This is a very very private internal function for React it\n// is used to sort-of do runtime dependency injection. So far\n// only `react-relay` makes use of it. It uses it to read the\n// context value.\nexport const __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = {\n\tReactCurrentDispatcher: {\n\t\tcurrent: {\n\t\t\treadContext(context) {\n\t\t\t\treturn currentComponent._globalContext[context._id].props.value;\n\t\t\t}\n\t\t}\n\t}\n};\n","import {\n\tcreateElement,\n\trender as preactRender,\n\tcloneElement as preactCloneElement,\n\tcreateRef,\n\tComponent,\n\tcreateContext,\n\tFragment\n} from 'preact';\nimport {\n\tuseState,\n\tuseId,\n\tuseReducer,\n\tuseEffect,\n\tuseLayoutEffect,\n\tuseRef,\n\tuseImperativeHandle,\n\tuseMemo,\n\tuseCallback,\n\tuseContext,\n\tuseDebugValue\n} from 'preact/hooks';\nimport { PureComponent } from './PureComponent';\nimport { memo } from './memo';\nimport { forwardRef } from './forwardRef';\nimport { Children } from './Children';\nimport { Suspense, lazy } from './suspense';\nimport { SuspenseList } from './suspense-list';\nimport { createPortal } from './portals';\nimport { is } from './util';\nimport {\n\thydrate,\n\trender,\n\tREACT_ELEMENT_TYPE,\n\t__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED\n} from './render';\n\nconst version = '17.0.2'; // trick libraries to think we are react\n\n/**\n * Legacy version of createElement.\n * @param {import('./internal').VNode[\"type\"]} type The node name or Component constructor\n */\nfunction createFactory(type) {\n\treturn createElement.bind(null, type);\n}\n\n/**\n * Check if the passed element is a valid (p)react node.\n * @param {*} element The element to check\n * @returns {boolean}\n */\nfunction isValidElement(element) {\n\treturn !!element && element.$$typeof === REACT_ELEMENT_TYPE;\n}\n\n/**\n * Wrap `cloneElement` to abort if the passed element is not a valid element and apply\n * all vnode normalizations.\n * @param {import('./internal').VNode} element The vnode to clone\n * @param {object} props Props to add when cloning\n * @param {Array} rest Optional component children\n */\nfunction cloneElement(element) {\n\tif (!isValidElement(element)) return element;\n\treturn preactCloneElement.apply(null, arguments);\n}\n\n/**\n * Remove a component tree from the DOM, including state and event handlers.\n * @param {import('./internal').PreactElement} container\n * @returns {boolean}\n */\nfunction unmountComponentAtNode(container) {\n\tif (container._children) {\n\t\tpreactRender(null, container);\n\t\treturn true;\n\t}\n\treturn false;\n}\n\n/**\n * Get the matching DOM node for a component\n * @param {import('./internal').Component} component\n * @returns {import('./internal').PreactElement | null}\n */\nfunction findDOMNode(component) {\n\treturn (\n\t\t(component &&\n\t\t\t(component.base || (component.nodeType === 1 && component))) ||\n\t\tnull\n\t);\n}\n\n/**\n * Deprecated way to control batched rendering inside the reconciler, but we\n * already schedule in batches inside our rendering code\n * @template Arg\n * @param {(arg: Arg) => void} callback function that triggers the updated\n * @param {Arg} [arg] Optional argument that can be passed to the callback\n */\n// eslint-disable-next-line camelcase\nconst unstable_batchedUpdates = (callback, arg) => callback(arg);\n\n/**\n * In React, `flushSync` flushes the entire tree and forces a rerender. It's\n * implmented here as a no-op.\n * @template Arg\n * @template Result\n * @param {(arg: Arg) => Result} callback function that runs before the flush\n * @param {Arg} [arg] Optional argument that can be passed to the callback\n * @returns\n */\nconst flushSync = (callback, arg) => callback(arg);\n\n/**\n * Strict Mode is not implemented in Preact, so we provide a stand-in for it\n * that just renders its children without imposing any restrictions.\n */\nconst StrictMode = Fragment;\n\nexport function startTransition(cb) {\n\tcb();\n}\n\nexport function useDeferredValue(val) {\n\treturn val;\n}\n\nexport function useTransition() {\n\treturn [false, startTransition];\n}\n\n// TODO: in theory this should be done after a VNode is diffed as we want to insert\n// styles/... before it attaches\nexport const useInsertionEffect = useLayoutEffect;\n\n/**\n * This is taken from https://github.com/facebook/react/blob/main/packages/use-sync-external-store/src/useSyncExternalStoreShimClient.js#L84\n * on a high level this cuts out the warnings, ... and attempts a smaller implementation\n */\nexport function useSyncExternalStore(subscribe, getSnapshot) {\n\tconst value = getSnapshot();\n\n\tconst [{ _instance }, forceUpdate] = useState({\n\t\t_instance: { _value: value, _getSnapshot: getSnapshot }\n\t});\n\n\tuseLayoutEffect(() => {\n\t\t_instance._value = value;\n\t\t_instance._getSnapshot = getSnapshot;\n\n\t\tif (!is(_instance._value, getSnapshot())) {\n\t\t\tforceUpdate({ _instance });\n\t\t}\n\t}, [subscribe, value, getSnapshot]);\n\n\tuseEffect(() => {\n\t\tif (!is(_instance._value, _instance._getSnapshot())) {\n\t\t\tforceUpdate({ _instance });\n\t\t}\n\n\t\treturn subscribe(() => {\n\t\t\tif (!is(_instance._value, _instance._getSnapshot())) {\n\t\t\t\tforceUpdate({ _instance });\n\t\t\t}\n\t\t});\n\t}, [subscribe]);\n\n\treturn value;\n}\n\nexport * from 'preact/hooks';\nexport {\n\tversion,\n\tChildren,\n\trender,\n\thydrate,\n\tunmountComponentAtNode,\n\tcreatePortal,\n\tcreateElement,\n\tcreateContext,\n\tcreateFactory,\n\tcloneElement,\n\tcreateRef,\n\tFragment,\n\tisValidElement,\n\tfindDOMNode,\n\tComponent,\n\tPureComponent,\n\tmemo,\n\tforwardRef,\n\tflushSync,\n\t// eslint-disable-next-line camelcase\n\tunstable_batchedUpdates,\n\tStrictMode,\n\tSuspense,\n\tSuspenseList,\n\tlazy,\n\t__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED\n};\n\n// React copies the named exports to the default one.\nexport default {\n\tuseState,\n\tuseId,\n\tuseReducer,\n\tuseEffect,\n\tuseLayoutEffect,\n\tuseInsertionEffect,\n\tuseTransition,\n\tuseDeferredValue,\n\tuseSyncExternalStore,\n\tstartTransition,\n\tuseRef,\n\tuseImperativeHandle,\n\tuseMemo,\n\tuseCallback,\n\tuseContext,\n\tuseDebugValue,\n\tversion,\n\tChildren,\n\trender,\n\thydrate,\n\tunmountComponentAtNode,\n\tcreatePortal,\n\tcreateElement,\n\tcreateContext,\n\tcreateFactory,\n\tcloneElement,\n\tcreateRef,\n\tFragment,\n\tisValidElement,\n\tfindDOMNode,\n\tComponent,\n\tPureComponent,\n\tmemo,\n\tforwardRef,\n\tflushSync,\n\tunstable_batchedUpdates,\n\tStrictMode,\n\tSuspense,\n\tSuspenseList,\n\tlazy,\n\t__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED\n};\n","import { createElement } from 'preact';\nimport { shallowDiffers } from './util';\n\n/**\n * Memoize a component, so that it only updates when the props actually have\n * changed. This was previously known as `React.pure`.\n * @param {import('./internal').FunctionComponent} c functional component\n * @param {(prev: object, next: object) => boolean} [comparer] Custom equality function\n * @returns {import('./internal').FunctionComponent}\n */\nexport function memo(c, comparer) {\n\tfunction shouldUpdate(nextProps) {\n\t\tlet ref = this.props.ref;\n\t\tlet updateRef = ref == nextProps.ref;\n\t\tif (!updateRef && ref) {\n\t\t\tref.call ? ref(null) : (ref.current = null);\n\t\t}\n\n\t\tif (!comparer) {\n\t\t\treturn shallowDiffers(this.props, nextProps);\n\t\t}\n\n\t\treturn !comparer(this.props, nextProps) || !updateRef;\n\t}\n\n\tfunction Memoed(props) {\n\t\tthis.shouldComponentUpdate = shouldUpdate;\n\t\treturn createElement(c, props);\n\t}\n\tMemoed.displayName = 'Memo(' + (c.displayName || c.name) + ')';\n\tMemoed.prototype.isReactComponent = true;\n\tMemoed._forwarded = true;\n\treturn Memoed;\n}\n","import { useRef } from 'react';\n\n/**\n * A custom hook that creates a ref for a function, and updates it on every render.\n * The new value is always the same function, but the function's context changes on every render.\n */\nexport default function useFunctionRef(fn) {\n const fnRef = useRef(fn);\n fnRef.current = fn;\n return fnRef;\n}\n","function cycleDetected(): never {\n\tthrow new Error(\"Cycle detected\");\n}\n\n// Flags for Computed and Effect.\nconst RUNNING = 1 << 0;\nconst NOTIFIED = 1 << 1;\nconst OUTDATED = 1 << 2;\nconst DISPOSED = 1 << 3;\nconst HAS_ERROR = 1 << 4;\nconst TRACKING = 1 << 5;\n\n// A linked list node used to track dependencies (sources) and dependents (targets).\n// Also used to remember the source's last version number that the target saw.\ntype Node = {\n\t// A source whose value the target depends on.\n\t_source: Signal;\n\t_prevSource?: Node;\n\t_nextSource?: Node;\n\n\t// A target that depends on the source and should be notified when the source changes.\n\t_target: Computed | Effect;\n\t_prevTarget?: Node;\n\t_nextTarget?: Node;\n\n\t// The version number of the source that target has last seen. We use version numbers\n\t// instead of storing the source value, because source values can take arbitrary amount\n\t// of memory, and computeds could hang on to them forever because they're lazily evaluated.\n\t// Use the special value -1 to mark potentially unused but recyclable nodes.\n\t_version: number;\n\n\t// Used to remember & roll back the source's previous `._node` value when entering &\n\t// exiting a new evaluation context.\n\t_rollbackNode?: Node;\n};\n\nfunction startBatch() {\n\tbatchDepth++;\n}\n\nfunction endBatch() {\n\tif (batchDepth > 1) {\n\t\tbatchDepth--;\n\t\treturn;\n\t}\n\n\tlet error: unknown;\n\tlet hasError = false;\n\n\twhile (batchedEffect !== undefined) {\n\t\tlet effect: Effect | undefined = batchedEffect;\n\t\tbatchedEffect = undefined;\n\n\t\tbatchIteration++;\n\n\t\twhile (effect !== undefined) {\n\t\t\tconst next: Effect | undefined = effect._nextBatchedEffect;\n\t\t\teffect._nextBatchedEffect = undefined;\n\t\t\teffect._flags &= ~NOTIFIED;\n\n\t\t\tif (!(effect._flags & DISPOSED) && needsToRecompute(effect)) {\n\t\t\t\ttry {\n\t\t\t\t\teffect._callback();\n\t\t\t\t} catch (err) {\n\t\t\t\t\tif (!hasError) {\n\t\t\t\t\t\terror = err;\n\t\t\t\t\t\thasError = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\teffect = next;\n\t\t}\n\t}\n\tbatchIteration = 0;\n\tbatchDepth--;\n\n\tif (hasError) {\n\t\tthrow error;\n\t}\n}\n\nfunction batch(callback: () => T): T {\n\tif (batchDepth > 0) {\n\t\treturn callback();\n\t}\n\t/*@__INLINE__**/ startBatch();\n\ttry {\n\t\treturn callback();\n\t} finally {\n\t\tendBatch();\n\t}\n}\n\n// Currently evaluated computed or effect.\nlet evalContext: Computed | Effect | undefined = undefined;\n\n// Effects collected into a batch.\nlet batchedEffect: Effect | undefined = undefined;\nlet batchDepth = 0;\nlet batchIteration = 0;\n\n// A global version number for signals, used for fast-pathing repeated\n// computed.peek()/computed.value calls when nothing has changed globally.\nlet globalVersion = 0;\n\nfunction addDependency(signal: Signal): Node | undefined {\n\tif (evalContext === undefined) {\n\t\treturn undefined;\n\t}\n\n\tlet node = signal._node;\n\tif (node === undefined || node._target !== evalContext) {\n\t\t/**\n\t\t * `signal` is a new dependency. Create a new dependency node, and set it\n\t\t * as the tail of the current context's dependency list. e.g:\n\t\t *\n\t\t * { A <-> B }\n\t\t * ↑ ↑\n\t\t * tail node (new)\n\t\t * ↓\n\t\t * { A <-> B <-> C }\n\t\t * ↑\n\t\t * tail (evalContext._sources)\n\t\t */\n\t\tnode = {\n\t\t\t_version: 0,\n\t\t\t_source: signal,\n\t\t\t_prevSource: evalContext._sources,\n\t\t\t_nextSource: undefined,\n\t\t\t_target: evalContext,\n\t\t\t_prevTarget: undefined,\n\t\t\t_nextTarget: undefined,\n\t\t\t_rollbackNode: node,\n\t\t};\n\n\t\tif (evalContext._sources !== undefined) {\n\t\t\tevalContext._sources._nextSource = node;\n\t\t}\n\t\tevalContext._sources = node;\n\t\tsignal._node = node;\n\n\t\t// Subscribe to change notifications from this dependency if we're in an effect\n\t\t// OR evaluating a computed signal that in turn has subscribers.\n\t\tif (evalContext._flags & TRACKING) {\n\t\t\tsignal._subscribe(node);\n\t\t}\n\t\treturn node;\n\t} else if (node._version === -1) {\n\t\t// `signal` is an existing dependency from a previous evaluation. Reuse it.\n\t\tnode._version = 0;\n\n\t\t/**\n\t\t * If `node` is not already the current tail of the dependency list (i.e.\n\t\t * there is a next node in the list), then make the `node` the new tail. e.g:\n\t\t *\n\t\t * { A <-> B <-> C <-> D }\n\t\t * ↑ ↑\n\t\t * node ┌─── tail (evalContext._sources)\n\t\t * └─────│─────┐\n\t\t * ↓ ↓\n\t\t * { A <-> C <-> D <-> B }\n\t\t * ↑\n\t\t * tail (evalContext._sources)\n\t\t */\n\t\tif (node._nextSource !== undefined) {\n\t\t\tnode._nextSource._prevSource = node._prevSource;\n\n\t\t\tif (node._prevSource !== undefined) {\n\t\t\t\tnode._prevSource._nextSource = node._nextSource;\n\t\t\t}\n\n\t\t\tnode._prevSource = evalContext._sources;\n\t\t\tnode._nextSource = undefined;\n\n\t\t\tevalContext._sources!._nextSource = node;\n\t\t\tevalContext._sources = node;\n\t\t}\n\n\t\t// We can assume that the currently evaluated effect / computed signal is already\n\t\t// subscribed to change notifications from `signal` if needed.\n\t\treturn node;\n\t}\n\treturn undefined;\n}\n\ndeclare class Signal {\n\t/** @internal */\n\t_value: unknown;\n\n\t/**\n\t * @internal\n\t * Version numbers should always be >= 0, because the special value -1 is used\n\t * by Nodes to signify potentially unused but recyclable nodes.\n\t */\n\t_version: number;\n\n\t/** @internal */\n\t_node?: Node;\n\n\t/** @internal */\n\t_targets?: Node;\n\n\tconstructor(value?: T);\n\n\t/** @internal */\n\t_refresh(): boolean;\n\n\t/** @internal */\n\t_subscribe(node: Node): void;\n\n\t/** @internal */\n\t_unsubscribe(node: Node): void;\n\n\tsubscribe(fn: (value: T) => void): () => void;\n\n\tvalueOf(): T;\n\n\ttoString(): string;\n\n\tpeek(): T;\n\n\tget value(): T;\n\tset value(value: T);\n}\n\n/** @internal */\nfunction Signal(this: Signal, value?: unknown) {\n\tthis._value = value;\n\tthis._version = 0;\n\tthis._node = undefined;\n\tthis._targets = undefined;\n}\n\nSignal.prototype._refresh = function () {\n\treturn true;\n};\n\nSignal.prototype._subscribe = function (node) {\n\tif (this._targets !== node && node._prevTarget === undefined) {\n\t\tnode._nextTarget = this._targets;\n\t\tif (this._targets !== undefined) {\n\t\t\tthis._targets._prevTarget = node;\n\t\t}\n\t\tthis._targets = node;\n\t}\n};\n\nSignal.prototype._unsubscribe = function (node) {\n\t// Only run the unsubscribe step if the signal has any subscribers to begin with.\n\tif (this._targets !== undefined) {\n\t\tconst prev = node._prevTarget;\n\t\tconst next = node._nextTarget;\n\t\tif (prev !== undefined) {\n\t\t\tprev._nextTarget = next;\n\t\t\tnode._prevTarget = undefined;\n\t\t}\n\t\tif (next !== undefined) {\n\t\t\tnext._prevTarget = prev;\n\t\t\tnode._nextTarget = undefined;\n\t\t}\n\t\tif (node === this._targets) {\n\t\t\tthis._targets = next;\n\t\t}\n\t}\n};\n\nSignal.prototype.subscribe = function (fn) {\n\tconst signal = this;\n\treturn effect(function (this: Effect) {\n\t\tconst value = signal.value;\n\t\tconst flag = this._flags & TRACKING;\n\t\tthis._flags &= ~TRACKING;\n\t\ttry {\n\t\t\tfn(value);\n\t\t} finally {\n\t\t\tthis._flags |= flag;\n\t\t}\n\t});\n};\n\nSignal.prototype.valueOf = function () {\n\treturn this.value;\n};\n\nSignal.prototype.toString = function () {\n\treturn this.value + \"\";\n};\n\nSignal.prototype.peek = function () {\n\treturn this._value;\n};\n\nObject.defineProperty(Signal.prototype, \"value\", {\n\tget() {\n\t\tconst node = addDependency(this);\n\t\tif (node !== undefined) {\n\t\t\tnode._version = this._version;\n\t\t}\n\t\treturn this._value;\n\t},\n\tset(value) {\n\t\tif (value !== this._value) {\n\t\t\tif (batchIteration > 100) {\n\t\t\t\tcycleDetected();\n\t\t\t}\n\n\t\t\tthis._value = value;\n\t\t\tthis._version++;\n\t\t\tglobalVersion++;\n\n\t\t\t/**@__INLINE__*/ startBatch();\n\t\t\ttry {\n\t\t\t\tfor (\n\t\t\t\t\tlet node = this._targets;\n\t\t\t\t\tnode !== undefined;\n\t\t\t\t\tnode = node._nextTarget\n\t\t\t\t) {\n\t\t\t\t\tnode._target._notify();\n\t\t\t\t}\n\t\t\t} finally {\n\t\t\t\tendBatch();\n\t\t\t}\n\t\t}\n\t},\n});\n\nfunction signal(value: T): Signal {\n\treturn new Signal(value);\n}\n\nfunction needsToRecompute(target: Computed | Effect): boolean {\n\t// Check the dependencies for changed values. The dependency list is already\n\t// in order of use. Therefore if multiple dependencies have changed values, only\n\t// the first used dependency is re-evaluated at this point.\n\tfor (\n\t\tlet node = target._sources;\n\t\tnode !== undefined;\n\t\tnode = node._nextSource\n\t) {\n\t\t// If there's a new version of the dependency before or after refreshing,\n\t\t// or the dependency has something blocking it from refreshing at all (e.g. a\n\t\t// dependency cycle), then we need to recompute.\n\t\tif (\n\t\t\tnode._source._version !== node._version ||\n\t\t\t!node._source._refresh() ||\n\t\t\tnode._source._version !== node._version\n\t\t) {\n\t\t\treturn true;\n\t\t}\n\t}\n\t// If none of the dependencies have changed values since last recompute then\n\t// there's no need to recompute.\n\treturn false;\n}\n\nfunction prepareSources(target: Computed | Effect) {\n\t/**\n\t * 1. Mark all current sources as re-usable nodes (version: -1)\n\t * 2. Set a rollback node if the current node is being used in a different context\n\t * 3. Point 'target._sources' to the tail of the doubly-linked list, e.g:\n\t *\n\t * { undefined <- A <-> B <-> C -> undefined }\n\t * ↑ ↑\n\t * │ └──────┐\n\t * target._sources = A; (node is head) │\n\t * ↓ │\n\t * target._sources = C; (node is tail) ─┘\n\t */\n\tfor (\n\t\tlet node = target._sources;\n\t\tnode !== undefined;\n\t\tnode = node._nextSource\n\t) {\n\t\tconst rollbackNode = node._source._node;\n\t\tif (rollbackNode !== undefined) {\n\t\t\tnode._rollbackNode = rollbackNode;\n\t\t}\n\t\tnode._source._node = node;\n\t\tnode._version = -1;\n\n\t\tif (node._nextSource === undefined) {\n\t\t\ttarget._sources = node;\n\t\t\tbreak;\n\t\t}\n\t}\n}\n\nfunction cleanupSources(target: Computed | Effect) {\n\tlet node = target._sources;\n\tlet head = undefined;\n\n\t/**\n\t * At this point 'target._sources' points to the tail of the doubly-linked list.\n\t * It contains all existing sources + new sources in order of use.\n\t * Iterate backwards until we find the head node while dropping old dependencies.\n\t */\n\twhile (node !== undefined) {\n\t\tconst prev = node._prevSource;\n\n\t\t/**\n\t\t * The node was not re-used, unsubscribe from its change notifications and remove itself\n\t\t * from the doubly-linked list. e.g:\n\t\t *\n\t\t * { A <-> B <-> C }\n\t\t * ↓\n\t\t * { A <-> C }\n\t\t */\n\t\tif (node._version === -1) {\n\t\t\tnode._source._unsubscribe(node);\n\n\t\t\tif (prev !== undefined) {\n\t\t\t\tprev._nextSource = node._nextSource;\n\t\t\t}\n\t\t\tif (node._nextSource !== undefined) {\n\t\t\t\tnode._nextSource._prevSource = prev;\n\t\t\t}\n\t\t} else {\n\t\t\t/**\n\t\t\t * The new head is the last node seen which wasn't removed/unsubscribed\n\t\t\t * from the doubly-linked list. e.g:\n\t\t\t *\n\t\t\t * { A <-> B <-> C }\n\t\t\t * ↑ ↑ ↑\n\t\t\t * │ │ └ head = node\n\t\t\t * │ └ head = node\n\t\t\t * └ head = node\n\t\t\t */\n\t\t\thead = node;\n\t\t}\n\n\t\tnode._source._node = node._rollbackNode;\n\t\tif (node._rollbackNode !== undefined) {\n\t\t\tnode._rollbackNode = undefined;\n\t\t}\n\n\t\tnode = prev;\n\t}\n\n\ttarget._sources = head;\n}\n\ndeclare class Computed extends Signal {\n\t_compute: () => T;\n\t_sources?: Node;\n\t_globalVersion: number;\n\t_flags: number;\n\n\tconstructor(compute: () => T);\n\n\t_notify(): void;\n\tget value(): T;\n}\n\nfunction Computed(this: Computed, compute: () => unknown) {\n\tSignal.call(this, undefined);\n\n\tthis._compute = compute;\n\tthis._sources = undefined;\n\tthis._globalVersion = globalVersion - 1;\n\tthis._flags = OUTDATED;\n}\n\nComputed.prototype = new Signal() as Computed;\n\nComputed.prototype._refresh = function () {\n\tthis._flags &= ~NOTIFIED;\n\n\tif (this._flags & RUNNING) {\n\t\treturn false;\n\t}\n\n\t// If this computed signal has subscribed to updates from its dependencies\n\t// (TRACKING flag set) and none of them have notified about changes (OUTDATED\n\t// flag not set), then the computed value can't have changed.\n\tif ((this._flags & (OUTDATED | TRACKING)) === TRACKING) {\n\t\treturn true;\n\t}\n\tthis._flags &= ~OUTDATED;\n\n\tif (this._globalVersion === globalVersion) {\n\t\treturn true;\n\t}\n\tthis._globalVersion = globalVersion;\n\n\t// Mark this computed signal running before checking the dependencies for value\n\t// changes, so that the RUNNING flag can be used to notice cyclical dependencies.\n\tthis._flags |= RUNNING;\n\tif (this._version > 0 && !needsToRecompute(this)) {\n\t\tthis._flags &= ~RUNNING;\n\t\treturn true;\n\t}\n\n\tconst prevContext = evalContext;\n\ttry {\n\t\tprepareSources(this);\n\t\tevalContext = this;\n\t\tconst value = this._compute();\n\t\tif (\n\t\t\tthis._flags & HAS_ERROR ||\n\t\t\tthis._value !== value ||\n\t\t\tthis._version === 0\n\t\t) {\n\t\t\tthis._value = value;\n\t\t\tthis._flags &= ~HAS_ERROR;\n\t\t\tthis._version++;\n\t\t}\n\t} catch (err) {\n\t\tthis._value = err;\n\t\tthis._flags |= HAS_ERROR;\n\t\tthis._version++;\n\t}\n\tevalContext = prevContext;\n\tcleanupSources(this);\n\tthis._flags &= ~RUNNING;\n\treturn true;\n};\n\nComputed.prototype._subscribe = function (node) {\n\tif (this._targets === undefined) {\n\t\tthis._flags |= OUTDATED | TRACKING;\n\n\t\t// A computed signal subscribes lazily to its dependencies when the it\n\t\t// gets its first subscriber.\n\t\tfor (\n\t\t\tlet node = this._sources;\n\t\t\tnode !== undefined;\n\t\t\tnode = node._nextSource\n\t\t) {\n\t\t\tnode._source._subscribe(node);\n\t\t}\n\t}\n\tSignal.prototype._subscribe.call(this, node);\n};\n\nComputed.prototype._unsubscribe = function (node) {\n\t// Only run the unsubscribe step if the computed signal has any subscribers.\n\tif (this._targets !== undefined) {\n\t\tSignal.prototype._unsubscribe.call(this, node);\n\n\t\t// Computed signal unsubscribes from its dependencies when it loses its last subscriber.\n\t\t// This makes it possible for unreferences subgraphs of computed signals to get garbage collected.\n\t\tif (this._targets === undefined) {\n\t\t\tthis._flags &= ~TRACKING;\n\n\t\t\tfor (\n\t\t\t\tlet node = this._sources;\n\t\t\t\tnode !== undefined;\n\t\t\t\tnode = node._nextSource\n\t\t\t) {\n\t\t\t\tnode._source._unsubscribe(node);\n\t\t\t}\n\t\t}\n\t}\n};\n\nComputed.prototype._notify = function () {\n\tif (!(this._flags & NOTIFIED)) {\n\t\tthis._flags |= OUTDATED | NOTIFIED;\n\n\t\tfor (\n\t\t\tlet node = this._targets;\n\t\t\tnode !== undefined;\n\t\t\tnode = node._nextTarget\n\t\t) {\n\t\t\tnode._target._notify();\n\t\t}\n\t}\n};\n\nComputed.prototype.peek = function () {\n\tif (!this._refresh()) {\n\t\tcycleDetected();\n\t}\n\tif (this._flags & HAS_ERROR) {\n\t\tthrow this._value;\n\t}\n\treturn this._value;\n};\n\nObject.defineProperty(Computed.prototype, \"value\", {\n\tget() {\n\t\tif (this._flags & RUNNING) {\n\t\t\tcycleDetected();\n\t\t}\n\t\tconst node = addDependency(this);\n\t\tthis._refresh();\n\t\tif (node !== undefined) {\n\t\t\tnode._version = this._version;\n\t\t}\n\t\tif (this._flags & HAS_ERROR) {\n\t\t\tthrow this._value;\n\t\t}\n\t\treturn this._value;\n\t},\n});\n\ninterface ReadonlySignal extends Signal {\n\treadonly value: T;\n}\n\nfunction computed(compute: () => T): ReadonlySignal {\n\treturn new Computed(compute);\n}\n\nfunction cleanupEffect(effect: Effect) {\n\tconst cleanup = effect._cleanup;\n\teffect._cleanup = undefined;\n\n\tif (typeof cleanup === \"function\") {\n\t\t/*@__INLINE__**/ startBatch();\n\n\t\t// Run cleanup functions always outside of any context.\n\t\tconst prevContext = evalContext;\n\t\tevalContext = undefined;\n\t\ttry {\n\t\t\tcleanup();\n\t\t} catch (err) {\n\t\t\teffect._flags &= ~RUNNING;\n\t\t\teffect._flags |= DISPOSED;\n\t\t\tdisposeEffect(effect);\n\t\t\tthrow err;\n\t\t} finally {\n\t\t\tevalContext = prevContext;\n\t\t\tendBatch();\n\t\t}\n\t}\n}\n\nfunction disposeEffect(effect: Effect) {\n\tfor (\n\t\tlet node = effect._sources;\n\t\tnode !== undefined;\n\t\tnode = node._nextSource\n\t) {\n\t\tnode._source._unsubscribe(node);\n\t}\n\teffect._compute = undefined;\n\teffect._sources = undefined;\n\n\tcleanupEffect(effect);\n}\n\nfunction endEffect(this: Effect, prevContext?: Computed | Effect) {\n\tif (evalContext !== this) {\n\t\tthrow new Error(\"Out-of-order effect\");\n\t}\n\tcleanupSources(this);\n\tevalContext = prevContext;\n\n\tthis._flags &= ~RUNNING;\n\tif (this._flags & DISPOSED) {\n\t\tdisposeEffect(this);\n\t}\n\tendBatch();\n}\n\ndeclare class Effect {\n\t_compute?: () => unknown;\n\t_cleanup?: unknown;\n\t_sources?: Node;\n\t_nextBatchedEffect?: Effect;\n\t_flags: number;\n\n\tconstructor(compute: () => void);\n\n\t_callback(): void;\n\t_start(): () => void;\n\t_notify(): void;\n\t_dispose(): void;\n}\n\nfunction Effect(this: Effect, compute: () => void) {\n\tthis._compute = compute;\n\tthis._cleanup = undefined;\n\tthis._sources = undefined;\n\tthis._nextBatchedEffect = undefined;\n\tthis._flags = TRACKING;\n}\n\nEffect.prototype._callback = function () {\n\tconst finish = this._start();\n\ttry {\n\t\tif (!(this._flags & DISPOSED) && this._compute !== undefined) {\n\t\t\tthis._cleanup = this._compute();\n\t\t}\n\t} finally {\n\t\tfinish();\n\t}\n};\n\nEffect.prototype._start = function () {\n\tif (this._flags & RUNNING) {\n\t\tcycleDetected();\n\t}\n\tthis._flags |= RUNNING;\n\tthis._flags &= ~DISPOSED;\n\tcleanupEffect(this);\n\tprepareSources(this);\n\n\t/*@__INLINE__**/ startBatch();\n\tconst prevContext = evalContext;\n\tevalContext = this;\n\treturn endEffect.bind(this, prevContext);\n};\n\nEffect.prototype._notify = function () {\n\tif (!(this._flags & NOTIFIED)) {\n\t\tthis._flags |= NOTIFIED;\n\t\tthis._nextBatchedEffect = batchedEffect;\n\t\tbatchedEffect = this;\n\t}\n};\n\nEffect.prototype._dispose = function () {\n\tthis._flags |= DISPOSED;\n\n\tif (!(this._flags & RUNNING)) {\n\t\tdisposeEffect(this);\n\t}\n};\n\nfunction effect(compute: () => unknown): () => void {\n\tconst effect = new Effect(compute);\n\ttry {\n\t\teffect._callback();\n\t} catch (err) {\n\t\teffect._dispose();\n\t\tthrow err;\n\t}\n\t// Return a bound function instead of a wrapper like `() => effect._dispose()`,\n\t// because bound functions seem to be just as fast and take up a lot less memory.\n\treturn effect._dispose.bind(effect);\n}\n\nexport { signal, computed, effect, batch, Signal, ReadonlySignal };\n","import { options, Component } from \"preact\";\nimport { useRef, useMemo, useEffect } from \"preact/hooks\";\nimport {\n\tsignal,\n\tcomputed,\n\tbatch,\n\teffect,\n\tSignal,\n\ttype ReadonlySignal,\n} from \"@preact/signals-core\";\nimport {\n\tVNode,\n\tOptionsTypes,\n\tHookFn,\n\tEffect,\n\tPropertyUpdater,\n\tAugmentedComponent,\n\tAugmentedElement as Element,\n} from \"./internal\";\n\nexport { signal, computed, batch, effect, Signal, type ReadonlySignal };\n\nconst HAS_PENDING_UPDATE = 1 << 0;\nconst HAS_HOOK_STATE = 1 << 1;\nconst HAS_COMPUTEDS = 1 << 2;\n\n// Install a Preact options hook\nfunction hook(hookName: T, hookFn: HookFn) {\n\t// @ts-ignore-next-line private options hooks usage\n\toptions[hookName] = hookFn.bind(null, options[hookName] || (() => {}));\n}\n\nlet currentComponent: AugmentedComponent | undefined;\nlet finishUpdate: (() => void) | undefined;\n\nfunction setCurrentUpdater(updater?: Effect) {\n\t// end tracking for the current update:\n\tif (finishUpdate) finishUpdate();\n\t// start tracking the new update:\n\tfinishUpdate = updater && updater._start();\n}\n\nfunction createUpdater(update: () => void) {\n\tlet updater!: Effect;\n\teffect(function (this: Effect) {\n\t\tupdater = this;\n\t});\n\tupdater._callback = update;\n\treturn updater;\n}\n\n/** @todo This may be needed for complex prop value detection. */\n// function isSignalValue(value: any): value is Signal {\n// \tif (typeof value !== \"object\" || value == null) return false;\n// \tif (value instanceof Signal) return true;\n// \t// @TODO: uncomment this when we land Reactive (ideally behind a brand check)\n// \t// for (let i in value) if (value[i] instanceof Signal) return true;\n// \treturn false;\n// }\n\n/**\n * A wrapper component that renders a Signal directly as a Text node.\n * @todo: in Preact 11, just decorate Signal with `type:null`\n */\nfunction Text(this: AugmentedComponent, { data }: { data: Signal }) {\n\t// hasComputeds.add(this);\n\n\t// Store the props.data signal in another signal so that\n\t// passing a new signal reference re-runs the text computed:\n\tconst currentSignal = useSignal(data);\n\tcurrentSignal.value = data;\n\n\tconst s = useMemo(() => {\n\t\t// mark the parent component as having computeds so it gets optimized\n\t\tlet v = this.__v;\n\t\twhile ((v = v.__!)) {\n\t\t\tif (v.__c) {\n\t\t\t\tv.__c._updateFlags |= HAS_COMPUTEDS;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\t// Replace this component's vdom updater with a direct text one:\n\t\tthis._updater!._callback = () => {\n\t\t\t(this.base as Text).data = s.peek();\n\t\t};\n\n\t\treturn computed(() => {\n\t\t\tlet data = currentSignal.value;\n\t\t\tlet s = data.value;\n\t\t\treturn s === 0 ? 0 : s === true ? \"\" : s || \"\";\n\t\t});\n\t}, []);\n\n\treturn s.value;\n}\nText.displayName = \"_st\";\n\nObject.defineProperties(Signal.prototype, {\n\tconstructor: { configurable: true, value: undefined },\n\ttype: { configurable: true, value: Text },\n\tprops: {\n\t\tconfigurable: true,\n\t\tget() {\n\t\t\treturn { data: this };\n\t\t},\n\t},\n\t// Setting a VNode's _depth to 1 forces Preact to clone it before modifying:\n\t// https://github.com/preactjs/preact/blob/d7a433ee8463a7dc23a05111bb47de9ec729ad4d/src/diff/children.js#L77\n\t// @todo remove this for Preact 11\n\t__b: { configurable: true, value: 1 },\n});\n\n/** Inject low-level property/attribute bindings for Signals into Preact's diff */\nhook(OptionsTypes.DIFF, (old, vnode) => {\n\tif (typeof vnode.type === \"string\") {\n\t\tlet signalProps: Record | undefined;\n\n\t\tlet props = vnode.props;\n\t\tfor (let i in props) {\n\t\t\tif (i === \"children\") continue;\n\n\t\t\tlet value = props[i];\n\t\t\tif (value instanceof Signal) {\n\t\t\t\tif (!signalProps) vnode.__np = signalProps = {};\n\t\t\t\tsignalProps[i] = value;\n\t\t\t\tprops[i] = value.peek();\n\t\t\t}\n\t\t}\n\t}\n\n\told(vnode);\n});\n\n/** Set up Updater before rendering a component */\nhook(OptionsTypes.RENDER, (old, vnode) => {\n\tsetCurrentUpdater();\n\n\tlet updater;\n\n\tlet component = vnode.__c;\n\tif (component) {\n\t\tcomponent._updateFlags &= ~HAS_PENDING_UPDATE;\n\n\t\tupdater = component._updater;\n\t\tif (updater === undefined) {\n\t\t\tcomponent._updater = updater = createUpdater(() => {\n\t\t\t\tcomponent._updateFlags |= HAS_PENDING_UPDATE;\n\t\t\t\tcomponent.setState({});\n\t\t\t});\n\t\t}\n\t}\n\n\tcurrentComponent = component;\n\tsetCurrentUpdater(updater);\n\told(vnode);\n});\n\n/** Finish current updater if a component errors */\nhook(OptionsTypes.CATCH_ERROR, (old, error, vnode, oldVNode) => {\n\tsetCurrentUpdater();\n\tcurrentComponent = undefined;\n\told(error, vnode, oldVNode);\n});\n\n/** Finish current updater after rendering any VNode */\nhook(OptionsTypes.DIFFED, (old, vnode) => {\n\tsetCurrentUpdater();\n\tcurrentComponent = undefined;\n\n\tlet dom: Element;\n\n\t// vnode._dom is undefined during string rendering,\n\t// so we use this to skip prop subscriptions during SSR.\n\tif (typeof vnode.type === \"string\" && (dom = vnode.__e as Element)) {\n\t\tlet props = vnode.__np;\n\t\tlet renderedProps = vnode.props;\n\t\tif (props) {\n\t\t\tlet updaters = dom._updaters;\n\t\t\tif (updaters) {\n\t\t\t\tfor (let prop in updaters) {\n\t\t\t\t\tlet updater = updaters[prop];\n\t\t\t\t\tif (updater !== undefined && !(prop in props)) {\n\t\t\t\t\t\tupdater._dispose();\n\t\t\t\t\t\t// @todo we could just always invoke _dispose() here\n\t\t\t\t\t\tupdaters[prop] = undefined;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tupdaters = {};\n\t\t\t\tdom._updaters = updaters;\n\t\t\t}\n\t\t\tfor (let prop in props) {\n\t\t\t\tlet updater = updaters[prop];\n\t\t\t\tlet signal = props[prop];\n\t\t\t\tif (updater === undefined) {\n\t\t\t\t\tupdater = createPropUpdater(dom, prop, signal, renderedProps);\n\t\t\t\t\tupdaters[prop] = updater;\n\t\t\t\t} else {\n\t\t\t\t\tupdater._update(signal, renderedProps);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\told(vnode);\n});\n\nfunction createPropUpdater(\n\tdom: Element,\n\tprop: string,\n\tpropSignal: Signal,\n\tprops: Record\n): PropertyUpdater {\n\tconst setAsProperty =\n\t\tprop in dom &&\n\t\t// SVG elements need to go through `setAttribute` because they\n\t\t// expect things like SVGAnimatedTransformList instead of strings.\n\t\t// @ts-ignore\n\t\tdom.ownerSVGElement === undefined;\n\n\tconst changeSignal = signal(propSignal);\n\treturn {\n\t\t_update: (newSignal: Signal, newProps: typeof props) => {\n\t\t\tchangeSignal.value = newSignal;\n\t\t\tprops = newProps;\n\t\t},\n\t\t_dispose: effect(() => {\n\t\t\tconst value = changeSignal.value.value;\n\t\t\t// If Preact just rendered this value, don't render it again:\n\t\t\tif (props[prop] === value) return;\n\t\t\tprops[prop] = value;\n\t\t\tif (setAsProperty) {\n\t\t\t\t// @ts-ignore-next-line silly\n\t\t\t\tdom[prop] = value;\n\t\t\t} else if (value) {\n\t\t\t\tdom.setAttribute(prop, value);\n\t\t\t} else {\n\t\t\t\tdom.removeAttribute(prop);\n\t\t\t}\n\t\t}),\n\t};\n}\n\n/** Unsubscribe from Signals when unmounting components/vnodes */\nhook(OptionsTypes.UNMOUNT, (old, vnode: VNode) => {\n\tif (typeof vnode.type === \"string\") {\n\t\tlet dom = vnode.__e as Element | undefined;\n\t\t// vnode._dom is undefined during string rendering\n\t\tif (dom) {\n\t\t\tconst updaters = dom._updaters;\n\t\t\tif (updaters) {\n\t\t\t\tdom._updaters = undefined;\n\t\t\t\tfor (let prop in updaters) {\n\t\t\t\t\tlet updater = updaters[prop];\n\t\t\t\t\tif (updater) updater._dispose();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t} else {\n\t\tlet component = vnode.__c;\n\t\tif (component) {\n\t\t\tconst updater = component._updater;\n\t\t\tif (updater) {\n\t\t\t\tcomponent._updater = undefined;\n\t\t\t\tupdater._dispose();\n\t\t\t}\n\t\t}\n\t}\n\told(vnode);\n});\n\n/** Mark components that use hook state so we can skip sCU optimization. */\nhook(OptionsTypes.HOOK, (old, component, index, type) => {\n\tif (type < 3)\n\t\t(component as AugmentedComponent)._updateFlags |= HAS_HOOK_STATE;\n\told(component, index, type);\n});\n\n/**\n * Auto-memoize components that use Signals/Computeds.\n * Note: Does _not_ optimize components that use hook/class state.\n */\nComponent.prototype.shouldComponentUpdate = function (\n\tthis: AugmentedComponent,\n\tprops,\n\tstate\n) {\n\t// @todo: Once preactjs/preact#3671 lands, this could just use `currentUpdater`:\n\tconst updater = this._updater;\n\tconst hasSignals = updater && updater._sources !== undefined;\n\n\t// let reason;\n\t// if (!hasSignals && !hasComputeds.has(this)) {\n\t// \treason = \"no signals or computeds\";\n\t// } else if (hasPendingUpdate.has(this)) {\n\t// \treason = \"has pending update\";\n\t// } else if (hasHookState.has(this)) {\n\t// \treason = \"has hook state\";\n\t// }\n\t// if (reason) {\n\t// \tif (!this) reason += \" (`this` bug)\";\n\t// \tconsole.log(\"not optimizing\", this?.constructor?.name, \": \", reason, {\n\t// \t\tdetails: {\n\t// \t\t\thasSignals,\n\t// \t\t\thasComputeds: hasComputeds.has(this),\n\t// \t\t\thasPendingUpdate: hasPendingUpdate.has(this),\n\t// \t\t\thasHookState: hasHookState.has(this),\n\t// \t\t\tdeps: Array.from(updater._deps),\n\t// \t\t\tupdater,\n\t// \t\t},\n\t// \t});\n\t// }\n\n\t// if this component used no signals or computeds, update:\n\tif (!hasSignals && !(this._updateFlags & HAS_COMPUTEDS)) return true;\n\n\t// if there is a pending re-render triggered from Signals,\n\t// or if there is hook or class state, update:\n\tif (this._updateFlags & (HAS_PENDING_UPDATE | HAS_HOOK_STATE)) return true;\n\n\t// @ts-ignore\n\tfor (let i in state) return true;\n\n\t// if any non-Signal props changed, update:\n\tfor (let i in props) {\n\t\tif (i !== \"__source\" && props[i] !== this.props[i]) return true;\n\t}\n\tfor (let i in this.props) if (!(i in props)) return true;\n\n\t// this is a purely Signal-driven component, don't update:\n\treturn false;\n};\n\nexport function useSignal(value: T) {\n\treturn useMemo(() => signal(value), []);\n}\n\nexport function useComputed(compute: () => T) {\n\tconst $compute = useRef(compute);\n\t$compute.current = compute;\n\t(currentComponent as AugmentedComponent)._updateFlags |= HAS_COMPUTEDS;\n\treturn useMemo(() => computed(() => $compute.current()), []);\n}\n\nexport function useSignalEffect(cb: () => void | (() => void)) {\n\tconst callback = useRef(cb);\n\tcallback.current = cb;\n\n\tuseEffect(() => {\n\t\treturn effect(() => callback.current());\n\t}, []);\n}\n\n/**\n * @todo Determine which Reactive implementation we'll be using.\n * @internal\n */\n// export function useReactive(value: T): Reactive {\n// \treturn useMemo(() => reactive(value), []);\n// }\n\n/**\n * @internal\n * Update a Reactive's using the properties of an object or other Reactive.\n * Also works for Signals.\n * @example\n * // Update a Reactive with Object.assign()-like syntax:\n * const r = reactive({ name: \"Alice\" });\n * update(r, { name: \"Bob\" });\n * update(r, { age: 42 }); // property 'age' does not exist in type '{ name?: string }'\n * update(r, 2); // '2' has no properties in common with '{ name?: string }'\n * console.log(r.name.value); // \"Bob\"\n *\n * @example\n * // Update a Reactive with the properties of another Reactive:\n * const A = reactive({ name: \"Alice\" });\n * const B = reactive({ name: \"Bob\", age: 42 });\n * update(A, B);\n * console.log(`${A.name} is ${A.age}`); // \"Bob is 42\"\n *\n * @example\n * // Update a signal with assign()-like syntax:\n * const s = signal(42);\n * update(s, \"hi\"); // Argument type 'string' not assignable to type 'number'\n * update(s, {}); // Argument type '{}' not assignable to type 'number'\n * update(s, 43);\n * console.log(s.value); // 43\n *\n * @param obj The Reactive or Signal to be updated\n * @param update The value, Signal, object or Reactive to update `obj` to match\n * @param overwrite If `true`, any properties `obj` missing from `update` are set to `undefined`\n */\n/*\nexport function update(\n\tobj: T,\n\tupdate: Partial>,\n\toverwrite = false\n) {\n\tif (obj instanceof Signal) {\n\t\tobj.value = peekValue(update);\n\t} else {\n\t\tfor (let i in update) {\n\t\t\tif (i in obj) {\n\t\t\t\tobj[i].value = peekValue(update[i]);\n\t\t\t} else {\n\t\t\t\tlet sig = signal(peekValue(update[i]));\n\t\t\t\tsig[KEY] = i;\n\t\t\t\tobj[i] = sig;\n\t\t\t}\n\t\t}\n\t\tif (overwrite) {\n\t\t\tfor (let i in obj) {\n\t\t\t\tif (!(i in update)) {\n\t\t\t\t\tobj[i].value = undefined;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n*/\n","/**\n * This method converts the hierarchical command list into a flat list of commands which is more convenient\n * for internal processing, whereas the hierarchical command list is more convenient for the user.\n */\nexport default function flattenCommands(\n commands: HierarchicalCommandList,\n parentId: CommandId = null\n): FlatCommandList {\n return Object.keys(commands).reduce((commandList, commandId) => {\n const {\n icon,\n description,\n name,\n subCommands,\n action,\n canHandleQueries,\n closeOnExecute,\n category,\n executeManually,\n } = commands[commandId] as Command & CommandGroup;\n\n // Create an uniquely identifiable command id for the flat command list\n const absoluteCommandId = parentId ? `${parentId}.${commandId}` : commandId;\n\n // Create list of available subcommand names\n const subCommandIds = subCommands\n ? Object.keys(subCommands).map((subCommandId) => `${absoluteCommandId}.${subCommandId}`)\n : [];\n\n // Insert the processed command into the flat command list\n commandList[absoluteCommandId] = {\n id: absoluteCommandId,\n name,\n icon,\n description,\n action,\n canHandleQueries,\n subCommandIds,\n parentId,\n closeOnExecute,\n category,\n executeManually,\n };\n\n // Insert subcommands into the list\n if (subCommandIds.length > 0) {\n return {\n ...commandList,\n ...flattenCommands(subCommands, absoluteCommandId),\n };\n }\n return commandList;\n }, {} as FlatCommandList);\n}\n","const PREFIX = '%c[COMMANDBAR]';\n\nconst logger = {\n ok: (message: string, ...args: any[]) => console.log(PREFIX, 'color: green', message, ...args),\n error: (message: string, ...args: any[]) => console.log(PREFIX, 'color: red', message, ...args),\n warn: (message: string, ...args: any[]) => console.warn(PREFIX, 'color: orange', message, ...args),\n debug:\n // @ts-ignore\n process.env.NODE_ENV === 'production'\n ? () => null\n : (message: string, ...args: any[]) => console.debug(PREFIX, 'color: lightblue', message, ...args),\n};\n\nexport default logger;\n","export default function clamp(value: number, min: number, max: number): number {\n return Math.max(min, Math.min(max, value));\n}\n","/**\n* Copyright (c) 2023, Leon Sorokin\n* All rights reserved. (MIT Licensed)\n*\n* uFuzzy.js (μFuzzy)\n* A tiny, efficient fuzzy matcher that doesn't suck\n* https://github.com/leeoniya/uFuzzy (v1.0.3)\n*/\n\nconst cmp = new Intl.Collator('en').compare;\n\nconst inf = Infinity;\n\nconst NEGS_RE = /(?:\\s+|^)-[a-z\\d]+/ig;\n\nconst OPTS = {\n\t// term segmentation & punct/whitespace merging\n\tinterSplit: \"[^A-Za-z0-9']+\",\n\tintraSplit: '[a-z][A-Z]',\n\n\t// intra bounds that will be used to increase lft1/rgt1 info counters\n\tintraBound: '[A-Za-z][0-9]|[0-9][A-Za-z]|[a-z][A-Z]',\n\n\t// inter-bounds mode\n\t// 2 = strict (will only match 'man' on whitepace and punct boundaries: Mega Man, Mega_Man, mega.man)\n\t// 1 = loose (plus allowance for alpha-num and case-change boundaries: MegaMan, 0007man)\n\t// 0 = any (will match 'man' as any substring: megamaniac)\n\tinterLft: 0,\n\tinterRgt: 0,\n\n\t// allowance between terms\n\tinterChars: '.',\n\tinterIns: inf,\n\n\t// allowance between chars in terms\n\tintraChars: \"[a-z\\\\d']\", // internally case-insensitive\n\tintraIns: 0,\n\n\tintraContr: \"'[a-z]{1,2}\\\\b\",\n\n\t// multi-insert or single-error mode\n\tintraMode: 0,\n\n\t// single-error bounds for errors within terms, default requires exact first char\n\tintraSlice: [1, inf],\n\n\t// single-error tolerance toggles\n\tintraSub: 0,\n\tintraTrn: 0,\n\tintraDel: 0,\n\n\t// can post-filter matches that are too far apart in distance or length\n\t// (since intraIns is between each char, it can accum to nonsense matches)\n\tintraFilt: (term, match, index) => true, // should this also accept WIP info?\n\n\t// final sorting fn\n\tsort: (info, haystack, needle) => {\n\t\tlet {\n\t\t\tidx,\n\t\t\tchars,\n\t\t\tterms,\n\t\t\tinterLft2,\n\t\t\tinterLft1,\n\t\t//\tinterRgt2,\n\t\t//\tinterRgt1,\n\t\t\tstart,\n\t\t\tintraIns,\n\t\t\tinterIns,\n\t\t} = info;\n\n\t\treturn idx.map((v, i) => i).sort((ia, ib) => (\n\t\t\t// most contig chars matched\n\t\t\tchars[ib] - chars[ia] ||\n\t\t\t// least char intra-fuzz (most contiguous)\n\t\t\tintraIns[ia] - intraIns[ib] ||\n\t\t\t// most prefix bounds, boosted by full term matches\n\t\t\t(\n\t\t\t\t(terms[ib] + interLft2[ib] + 0.5 * interLft1[ib]) -\n\t\t\t\t(terms[ia] + interLft2[ia] + 0.5 * interLft1[ia])\n\t\t\t) ||\n\t\t\t// highest density of match (least span)\n\t\t//\tspan[ia] - span[ib] ||\n\t\t\t// highest density of match (least term inter-fuzz)\n\t\t\tinterIns[ia] - interIns[ib] ||\n\t\t\t// earliest start of match\n\t\t\tstart[ia] - start[ib] ||\n\t\t\t// alphabetic\n\t\t\tcmp(haystack[idx[ia]], haystack[idx[ib]])\n\t\t));\n\t},\n};\n\nconst lazyRepeat = (chars, limit) => (\n\tlimit == 0 ? '' :\n\tlimit == 1 ? chars + '??' :\n\tlimit == inf ? chars + '*?' :\n\t chars + `{0,${limit}}?`\n);\n\nconst mode2Tpl = '(?:\\\\b|_)';\n\nfunction uFuzzy(opts) {\n\topts = Object.assign({}, OPTS, opts);\n\n\tconst {\n\t\tinterLft,\n\t\tinterRgt,\n\t\tintraMode,\n\t\tintraSlice,\n\t\tintraIns,\n\t\tintraSub,\n\t\tintraTrn,\n\t\tintraDel,\n\t\tintraContr,\n\t\tintraSplit: _intraSplit,\n\t\tinterSplit: _interSplit,\n\t\tintraBound: _intraBound,\n\t\tintraChars,\n\t} = opts;\n\n\tlet { intraRules } = opts;\n\n\tif (intraRules == null) {\n\t\tintraRules = p => {\n\t\t\t// default is exact term matches only\n\t\t\tlet _intraSlice = OPTS.intraSlice, // requires first char\n\t\t\t\t_intraIns = 0,\n\t\t\t\t_intraSub = 0,\n\t\t\t\t_intraTrn = 0,\n\t\t\t\t_intraDel = 0;\n\n\t\t\tlet plen = p.length;\n\n\t\t\t// prevent junk matches by requiring stricter rules for short terms\n\t\t\tif (plen <= 4) {\n\t\t\t\tif (plen >= 3) {\n\t\t\t\t\t// one swap in non-first char when 3-4 chars\n\t\t\t\t\t_intraTrn = Math.min(intraTrn, 1);\n\n\t\t\t\t\t// or one insertion when 4 chars\n\t\t\t\t\tif (plen == 4)\n\t\t\t\t\t\t_intraIns = Math.min(intraIns, 1);\n\t\t\t\t}\n\t\t\t\t// else exact match when 1-2 chars\n\t\t\t}\n\t\t\t// use supplied opts\n\t\t\telse {\n\t\t\t\t_intraSlice = intraSlice;\n\t\t\t\t_intraIns = intraIns,\n\t\t\t\t_intraSub = intraSub,\n\t\t\t\t_intraTrn = intraTrn,\n\t\t\t\t_intraDel = intraDel;\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\tintraSlice: _intraSlice,\n\t\t\t\tintraIns: _intraIns,\n\t\t\t\tintraSub: _intraSub,\n\t\t\t\tintraTrn: _intraTrn,\n\t\t\t\tintraDel: _intraDel,\n\t\t\t};\n\t\t};\n\t}\n\n\tlet withIntraSplit = !!_intraSplit;\n\n\tlet intraSplit = new RegExp(_intraSplit, 'g');\n\tlet interSplit = new RegExp(_interSplit, 'g');\n\n\tlet trimRe = new RegExp('^' + _interSplit + '|' + _interSplit + '$', 'g');\n\tlet contrsRe = new RegExp(intraContr, 'gi');\n\n\tconst split = needle => {\n\t\tneedle = needle.replace(trimRe, '').toLowerCase();\n\n\t\tif (withIntraSplit)\n\t\t\tneedle = needle.replace(intraSplit, m => m[0] + ' ' + m[1]);\n\n\t\treturn needle.split(interSplit).filter(t => t != '');\n\t};\n\n\tconst prepQuery = (needle, capt = 0, interOR = false) => {\n\t\t// split on punct, whitespace, num-alpha, and upper-lower boundaries\n\t\tlet parts = split(needle);\n\n\t\tif (parts.length == 0)\n\t\t\tthrow `Empty needle!`;\n\n\t\t// split out any detected contractions for each term that become required suffixes\n\t\tlet contrs = Array(parts.length).fill('');\n\t\tparts = parts.map((p, pi) => p.replace(contrsRe, m => {\n\t\t\tcontrs[pi] = m;\n\t\t\treturn '';\n\t\t}));\n\n\t\t// array of regexp tpls for each term\n\t\tlet reTpl;\n\n\t\t// allows single mutations within each term\n\t\tif (intraMode == 1) {\n\t\t\treTpl = parts.map((p, pi) => {\n\t\t\t\tlet {\n\t\t\t\t\tintraSlice,\n\t\t\t\t\tintraIns,\n\t\t\t\t\tintraSub,\n\t\t\t\t\tintraTrn,\n\t\t\t\t\tintraDel,\n\t\t\t\t} = intraRules(p);\n\n\t\t\t\tif (intraIns + intraSub + intraTrn + intraDel == 0)\n\t\t\t\t\treturn p + contrs[pi];\n\n\t\t\t\tlet [lftIdx, rgtIdx] = intraSlice;\n\t\t\t\tlet lftChar = p.slice(0, lftIdx); // prefix\n\t\t\t\tlet rgtChar = p.slice(rgtIdx); // suffix\n\n\t\t\t\tlet chars = p.slice(lftIdx, rgtIdx);\n\n\t\t\t\t// neg lookahead to prefer matching 'Test' instead of 'tTest' in ManifestTest or fittest\n\t\t\t\t// but skip when search term contains leading repetition (aardvark, aaa)\n\t\t\t\tif (intraIns == 1 && lftChar.length == 1 && lftChar != chars[0])\n\t\t\t\t\tlftChar += '(?!' + lftChar + ')';\n\n\t\t\t\tlet numChars = chars.length;\n\n\t\t\t\tlet variants = [];\n\n\t\t\t\t// variants with single char substitutions\n\t\t\t\tif (intraSub) {\n\t\t\t\t\tfor (let i = 0; i < numChars; i++)\n\t\t\t\t\t\tvariants.push(lftChar + chars.slice(0, i) + intraChars + chars.slice(i + 1) + rgtChar);\n\t\t\t\t}\n\n\t\t\t\t// variants with single transpositions\n\t\t\t\tif (intraTrn) {\n\t\t\t\t\tfor (let i = 0; i < numChars - 1; i++) {\n\t\t\t\t\t\tif (chars[i] != chars[i+1])\n\t\t\t\t\t\t\tvariants.push(lftChar + chars.slice(0, i) + chars[i+1] + chars[i] + chars.slice(i + 2) + rgtChar);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// variants with single char omissions\n\t\t\t\tif (intraDel) {\n\t\t\t\t\tfor (let i = 0; i < numChars; i++)\n\t\t\t\t\t\tvariants.push(lftChar + chars.slice(0, i + 1) + '?' + chars.slice(i + 1) + rgtChar);\n\t\t\t\t}\n\n\t\t\t\t// variants with single char insertions\n\t\t\t\tif (intraIns) {\n\t\t\t\t\tlet intraInsTpl = lazyRepeat(intraChars, 1);\n\n\t\t\t\t\tfor (let i = 0; i < numChars; i++)\n\t\t\t\t\t\tvariants.push(lftChar + chars.slice(0, i) + intraInsTpl + chars.slice(i) + rgtChar);\n\t\t\t\t}\n\n\t\t\t\tlet reTpl = '(?:' + p + '|' + variants.join('|') + ')' + contrs[pi];\n\n\t\t\t//\tconsole.log(reTpl);\n\n\t\t\t\treturn reTpl;\n\t\t\t});\n\t\t}\n\t\telse {\n\t\t\tlet intraInsTpl = lazyRepeat(intraChars, intraIns);\n\n\t\t\t// capture at char level\n\t\t\tif (capt == 2 && intraIns > 0) {\n\t\t\t\t// sadly, we also have to capture the inter-term junk via parenth-wrapping .*?\n\t\t\t\t// to accum other capture groups' indices for \\b boosting during scoring\n\t\t\t\tintraInsTpl = ')(' + intraInsTpl + ')(';\n\t\t\t}\n\n\t\t\treTpl = parts.map((p, pi) => p.split('').map((c, i, chars) => {\n\t\t\t\t// neg lookahead to prefer matching 'Test' instead of 'tTest' in ManifestTest or fittest\n\t\t\t\t// but skip when search term contains leading repetition (aardvark, aaa)\n\t\t\t\tif (intraIns == 1 && i == 0 && chars.length > 1 && c[i] != c[i+1])\n\t\t\t\t\tc += '(?!' + c + ')';\n\n\t\t\t\treturn c;\n\t\t\t}).join(intraInsTpl) + contrs[pi]);\n\t\t}\n\n\t//\tconsole.log(reTpl);\n\n\t\t// this only helps to reduce initial matches early when they can be detected\n\t\t// TODO: might want a mode 3 that excludes _\n\t\tlet preTpl = interLft == 2 ? mode2Tpl : '';\n\t\tlet sufTpl = interRgt == 2 ? mode2Tpl : '';\n\n\t\tlet interCharsTpl = sufTpl + lazyRepeat(opts.interChars, opts.interIns) + preTpl;\n\n\t\t// capture at word level\n\t\tif (capt > 0) {\n\t\t\tif (interOR) {\n\t\t\t\t// this is basically for doing .matchAll() occurence counting and highlighting without needing permuted ooo needles\n\t\t\t\treTpl = preTpl + '(' + reTpl.join(')' + sufTpl + '|' + preTpl + '(') + ')' + sufTpl;\n\t\t\t}\n\t\t\telse {\n\t\t\t\t// sadly, we also have to capture the inter-term junk via parenth-wrapping .*?\n\t\t\t\t// to accum other capture groups' indices for \\b boosting during scoring\n\t\t\t\treTpl = '(' + reTpl.join(')(' + interCharsTpl + ')(') + ')';\n\t\t\t\treTpl = '(.?' + preTpl + ')' + reTpl + '(' + sufTpl + '.*)'; // nit: trailing capture here assumes interIns = Inf\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\treTpl = reTpl.join(interCharsTpl);\n\t\t\treTpl = preTpl + reTpl + sufTpl;\n\t\t}\n\n\t//\tconsole.log(reTpl);\n\n\t\treturn [new RegExp(reTpl, 'i'), parts, contrs];\n\t};\n\n\tconst filter = (haystack, needle, idxs) => {\n\n\t\tlet out = [];\n\t\tlet [query] = prepQuery(needle);\n\n\t\tif (idxs != null) {\n\t\t\tfor (let i = 0; i < idxs.length; i++) {\n\t\t\t\tlet idx = idxs[i];\n\t\t\t\tquery.test(haystack[idx]) && out.push(idx);\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\tfor (let i = 0; i < haystack.length; i++)\n\t\t\t\tquery.test(haystack[i]) && out.push(i);\n\t\t}\n\n\t\treturn out;\n\t};\n\n\tlet withIntraBound = !!_intraBound;\n\n\tlet interBound = new RegExp(_interSplit);\n\tlet intraBound = new RegExp(_intraBound);\n\n\tconst info = (idxs, haystack, needle) => {\n\n\t\tlet [query, parts, contrs] = prepQuery(needle, 1);\n\t\tlet [queryR] = prepQuery(needle, 2);\n\t\tlet partsLen = parts.length;\n\n\t\tlet len = idxs.length;\n\n\t\tlet field = Array(len).fill(0);\n\n\t\tlet info = {\n\t\t\t// idx in haystack\n\t\t\tidx: Array(len),\n\n\t\t\t// start of match\n\t\t\tstart: field.slice(),\n\t\t\t// length of match\n\t\t//\tspan: field.slice(),\n\n\t\t\t// contiguous chars matched\n\t\t\tchars: field.slice(),\n\n\t\t\t// contiguous (no fuzz) and bounded terms (intra=0, lft2/1, rgt2/1)\n\t\t\t// excludes terms that are contiguous but have < 2 bounds (substrings)\n\t\t\tterms: field.slice(),\n\n\t\t\t// cumulative length of unmatched chars (fuzz) within span\n\t\t\tinterIns: field.slice(), // between terms\n\t\t\tintraIns: field.slice(), // within terms\n\n\t\t\t// interLft/interRgt counters\n\t\t\tinterLft2: field.slice(),\n\t\t\tinterRgt2: field.slice(),\n\t\t\tinterLft1: field.slice(),\n\t\t\tinterRgt1: field.slice(),\n\n\t\t\tranges: Array(len),\n\t\t};\n\n\t\t// might discard idxs based on bounds checks\n\t\tlet mayDiscard = interLft == 1 || interRgt == 1;\n\n\t\tlet ii = 0;\n\n\t\tfor (let i = 0; i < idxs.length; i++) {\n\t\t\tlet mhstr = haystack[idxs[i]];\n\n\t\t\t// the matched parts are [full, junk, term, junk, term, junk]\n\t\t\tlet m = mhstr.match(query);\n\n\t\t\t// leading junk\n\t\t\tlet start = m.index + m[1].length;\n\n\t\t\tlet idxAcc = start;\n\t\t//\tlet span = m[0].length;\n\n\t\t\tlet disc = false;\n\t\t\tlet lft2 = 0;\n\t\t\tlet lft1 = 0;\n\t\t\tlet rgt2 = 0;\n\t\t\tlet rgt1 = 0;\n\t\t\tlet chars = 0;\n\t\t\tlet terms = 0;\n\t\t\tlet inter = 0;\n\t\t\tlet intra = 0;\n\n\t\t\tlet refine = [];\n\n\t\t\tfor (let j = 0, k = 2; j < partsLen; j++, k+=2) {\n\t\t\t\tlet group = m[k].toLowerCase();\n\t\t\t\tlet term = parts[j] + contrs[j];\n\t\t\t\tlet termLen = term.length;\n\t\t\t\tlet groupLen = group.length;\n\t\t\t\tlet fullMatch = group == term;\n\n\t\t\t\t// this won't handle the case when an exact match exists across the boundary of the current group and the next junk\n\t\t\t\t// e.g. blob,ob when searching for 'bob' but finding the earlier `blob` (with extra insertion)\n\t\t\t\tif (!fullMatch && m[k+1].length >= termLen) {\n\t\t\t\t\t// probe for exact match in inter junk\n\t\t\t\t\tlet idxOf = m[k+1].toLowerCase().indexOf(term);\n\n\t\t\t\t\tif (idxOf > -1) {\n\t\t\t\t\t\trefine.push(idxAcc, idxOf, termLen);\n\t\t\t\t\t\tidxAcc += refineMatch(m, k, idxOf, termLen);\n\t\t\t\t\t\tgroup = term;\n\t\t\t\t\t\tgroupLen = termLen;\n\t\t\t\t\t\tfullMatch = true;\n\n\t\t\t\t\t\tif (j == 0)\n\t\t\t\t\t\t\tstart = idxAcc;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (mayDiscard || fullMatch) {\n\t\t\t\t\t// does group's left and/or right land on \\b\n\t\t\t\t\tlet lftCharIdx = idxAcc - 1;\n\t\t\t\t\tlet rgtCharIdx = idxAcc + groupLen;\n\n\t\t\t\t\tlet isPre = true;\n\t\t\t\t\tlet isSuf = true;\n\n\t\t\t\t\t// prefix info\n\t\t\t\t\tif (lftCharIdx == -1 || interBound.test(mhstr[lftCharIdx]))\n\t\t\t\t\t\tfullMatch && lft2++;\n\t\t\t\t\telse {\n\t\t\t\t\t\tif (interLft == 2) {\n\t\t\t\t\t\t\tdisc = true;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (withIntraBound && intraBound.test(mhstr[lftCharIdx] + mhstr[lftCharIdx + 1]))\n\t\t\t\t\t\t\tfullMatch && lft1++;\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tif (interLft == 1) {\n\t\t\t\t\t\t\t\t// regexps are eager, so try to improve the match by probing forward inter junk for exact match at a boundary\n\t\t\t\t\t\t\t\tlet junk = m[k+1];\n\t\t\t\t\t\t\t\tlet junkIdx = idxAcc + groupLen;\n\n\t\t\t\t\t\t\t\tif (junk.length >= termLen) {\n\t\t\t\t\t\t\t\t\tlet idxOf = 0;\n\t\t\t\t\t\t\t\t\tlet found = false;\n\t\t\t\t\t\t\t\t\tlet re = new RegExp(term, 'ig');\n\n\t\t\t\t\t\t\t\t\tlet m2;\n\t\t\t\t\t\t\t\t\twhile (m2 = re.exec(junk)) {\n\t\t\t\t\t\t\t\t\t\tidxOf = m2.index;\n\n\t\t\t\t\t\t\t\t\t\tlet charIdx = junkIdx + idxOf;\n\t\t\t\t\t\t\t\t\t\tlet lftCharIdx = charIdx - 1;\n\n\n\t\t\t\t\t\t\t\t\t\tif (lftCharIdx == -1 || interBound.test(mhstr[lftCharIdx])) {\n\t\t\t\t\t\t\t\t\t\t\tlft2++;\n\t\t\t\t\t\t\t\t\t\t\tfound = true;\n\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\telse if (intraBound.test(mhstr[lftCharIdx] + mhstr[charIdx])) {\n\t\t\t\t\t\t\t\t\t\t\tlft1++;\n\t\t\t\t\t\t\t\t\t\t\tfound = true;\n\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tif (found) {\n\t\t\t\t\t\t\t\t\t\t// identical to exact term refinement pass above\n\t\t\t\t\t\t\t\t\t\trefine.push(idxAcc, idxOf, termLen);\n\t\t\t\t\t\t\t\t\t\tidxAcc += refineMatch(m, k, idxOf, termLen);\n\t\t\t\t\t\t\t\t\t\tgroup = term;\n\t\t\t\t\t\t\t\t\t\tgroupLen = termLen;\n\t\t\t\t\t\t\t\t\t\tfullMatch = true;\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tdisc = true;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tisPre = false;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// suffix info\n\t\t\t\t\tif (rgtCharIdx == mhstr.length || interBound.test(mhstr[rgtCharIdx]))\n\t\t\t\t\t\tfullMatch && rgt2++;\n\t\t\t\t\telse {\n\t\t\t\t\t\tif (interRgt == 2) {\n\t\t\t\t\t\t\tdisc = true;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (withIntraBound && intraBound.test(mhstr[rgtCharIdx - 1] + mhstr[rgtCharIdx]))\n\t\t\t\t\t\t\tfullMatch && rgt1++;\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tif (interRgt == 1) {\n\t\t\t\t\t\t\t\tdisc = true;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tisSuf = false;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif (fullMatch) {\n\t\t\t\t\t\tchars += termLen;\n\n\t\t\t\t\t\tif (isPre && isSuf)\n\t\t\t\t\t\t\tterms++;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (groupLen > termLen)\n\t\t\t\t\tintra += groupLen - termLen; // intraFuzz\n\n\t\t\t\tif (j > 0)\n\t\t\t\t\tinter += m[k-1].length; // interFuzz\n\n\t\t\t\t// TODO: group here is lowercased, which is okay for length cmp, but not more case-sensitive filts\n\t\t\t\tif (!opts.intraFilt(term, group, idxAcc)) {\n\t\t\t\t\tdisc = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tif (j < partsLen - 1)\n\t\t\t\t\tidxAcc += groupLen + m[k+1].length;\n\t\t\t}\n\n\t\t\tif (!disc) {\n\t\t\t\tinfo.idx[ii] = idxs[i];\n\t\t\t\tinfo.interLft2[ii] = lft2;\n\t\t\t\tinfo.interLft1[ii] = lft1;\n\t\t\t\tinfo.interRgt2[ii] = rgt2;\n\t\t\t\tinfo.interRgt1[ii] = rgt1;\n\t\t\t\tinfo.chars[ii] = chars;\n\t\t\t\tinfo.terms[ii] = terms;\n\t\t\t\tinfo.interIns[ii] = inter;\n\t\t\t\tinfo.intraIns[ii] = intra;\n\n\t\t\t\tinfo.start[ii] = start;\n\t\t\t//\tinfo.span[ii] = span;\n\n\t\t\t\t// ranges\n\t\t\t\tlet m = mhstr.match(queryR);\n\t\t\t\tlet ranges = info.ranges[ii] = [];\n\n\t\t\t\tlet idxAcc = m.index + m[1].length;\n\t\t\t\tlet from = idxAcc;\n\t\t\t\tlet to = idxAcc;\n\n\t\t\t\tlet refLen = refine.length;\n\t\t\t\tlet ri = refLen > 0 ? 0 : Infinity;\n\t\t\t\tlet lastRi = refLen - 3;\n\n\t\t\t\tfor (let i = 2; i < m.length; i++) {\n\t\t\t\t\tlet len = m[i].length;\n\n\t\t\t\t\tif (ri <= lastRi && refine[ri] == idxAcc) {\n\t\t\t\t\t\tlet idxInNext = refine[ri+1];\n\t\t\t\t\t\tlet matchLen = refine[ri+2];\n\t\t\t\t\t\tlet offset = idxInNext + matchLen;\n\n\t\t\t\t\t\tidxAcc += len + offset;\n\t\t\t\t\t\tfrom = idxAcc - matchLen;\n\t\t\t\t\t\tm[i+1] = m[i+1].slice(offset);\n\n\t\t\t\t\t\tri+=3;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t\tidxAcc += len;\n\n\t\t\t\t\tif (i % 2 == 0)\n\t\t\t\t\t\tto = idxAcc;\n\t\t\t\t\telse if (len > 0) {\n\t\t\t\t\t\tranges.push(from, to);\n\t\t\t\t\t\tfrom = to = idxAcc;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (to > from)\n\t\t\t\t\tranges.push(from, to);\n\n\t\t\t\tii++;\n\t\t\t}\n\t\t}\n\n\t\t// trim arrays\n\t\tif (ii < idxs.length) {\n\t\t\tfor (let k in info)\n\t\t\t\tinfo[k] = info[k].slice(0, ii);\n\t\t}\n\n\t\treturn info;\n\t};\n\n\tconst refineMatch = (m, k, idxInNext, termLen) => {\n\t\t// shift the current group into the prior junk\n\t\tlet prepend = m[k] + m[k+1].slice(0, idxInNext);\n\t\tm[k-1] += prepend;\n\t\tm[k] = m[k+1].slice(idxInNext, idxInNext + termLen);\n\t\tm[k+1] = m[k+1].slice(idxInNext + termLen);\n\t\treturn prepend.length;\n\t};\n\n\t// returns [idxs, info, order]\n\tconst _search = (haystack, needle, outOfOrder = false, infoThresh = 1e3, preFiltered) => {\n\t\tlet needles = null;\n\t\tlet matches = null;\n\n\t\tlet negs = [];\n\n\t\tneedle = needle.replace(NEGS_RE, m => {\n\t\t\tnegs.push(m.trim().slice(1));\n\t\t\treturn '';\n\t\t});\n\n\t\tlet negsRe;\n\n\t\tif (negs.length > 0) {\n\t\t\tnegsRe = new RegExp(negs.join('|'), 'i');\n\n\t\t\tif (needle.trim() == '') {\n\t\t\t\tlet idxs = [];\n\n\t\t\t\tfor (let i = 0; i < haystack.length; i++) {\n\t\t\t\t\tif (!negsRe.test(haystack[i]))\n\t\t\t\t\t\tidxs.push(i);\n\t\t\t\t}\n\n\t\t\t\treturn [idxs, null, null];\n\t\t\t}\n\t\t}\n\n\t//\tconsole.log(negs);\n\t//\tconsole.log(needle);\n\n\t\tif (outOfOrder) {\n\t\t\t// since uFuzzy is an AND-based search, we can iteratively pre-reduce the haystack by searching\n\t\t\t// for each term in isolation before running permutations on what's left.\n\t\t\t// this is a major perf win. e.g. searching \"test man ger pp a\" goes from 570ms -> 14ms\n\t\t\tlet terms = split(needle);\n\n\t\t\tif (terms.length > 1) {\n\t\t\t\t// longest -> shortest\n\t\t\t\tlet terms2 = terms.slice().sort((a, b) => b.length - a.length);\n\n\t\t\t\tfor (let ti = 0; ti < terms2.length; ti++) {\n\t\t\t\t\t// no haystack item contained all terms\n\t\t\t\t\tif (preFiltered && preFiltered.length == 0)\n\t\t\t\t\t\treturn [[], null, null];\n\n\t\t\t\t\tpreFiltered = filter(haystack, terms2[ti], preFiltered);\n\t\t\t\t}\n\n\t\t\t\tneedles = permute(terms).map(perm => perm.join(' '));\n\n\t\t\t\t// filtered matches for each needle excluding same matches for prior needles\n\t\t\t\tmatches = [];\n\n\t\t\t\t// keeps track of already-matched idxs to skip in follow-up permutations\n\t\t\t\tlet matchedIdxs = new Set();\n\n\t\t\t\tfor (let ni = 0; ni < needles.length; ni++) {\n\t\t\t\t\tif (matchedIdxs.size < preFiltered.length) {\n\t\t\t\t\t\t// filter further for this needle, exclude already-matched\n\t\t\t\t\t\tlet preFiltered2 = preFiltered.filter(idx => !matchedIdxs.has(idx));\n\n\t\t\t\t\t\tlet matched = filter(haystack, needles[ni], preFiltered2);\n\n\t\t\t\t\t\tfor (let j = 0; j < matched.length; j++)\n\t\t\t\t\t\t\tmatchedIdxs.add(matched[j]);\n\n\t\t\t\t\t\tmatches.push(matched);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t\tmatches.push([]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// interOR\n\t//\tconsole.log(prepQuery(needle, 1, null, true));\n\n\t\t// non-ooo or ooo w/single term\n\t\tif (needles == null) {\n\t\t\tneedles = [needle];\n\t\t\tmatches = [preFiltered && preFiltered.length > 0 ? preFiltered : filter(haystack, needle)];\n\t\t}\n\n\t\tlet retInfo = null;\n\t\tlet retOrder = null;\n\n\t\tif (negs.length > 0)\n\t\t\tmatches = matches.map(idxs => idxs.filter(idx => !negsRe.test(haystack[idx])));\n\n\t\tlet matchCount = matches.reduce((acc, idxs) => acc + idxs.length, 0);\n\n\t\t// rank, sort, concat\n\t\tif (matchCount <= infoThresh) {\n\t\t\tretInfo = {};\n\t\t\tretOrder = [];\n\n\t\t\tfor (let ni = 0; ni < matches.length; ni++) {\n\t\t\t\tlet idxs = matches[ni];\n\n\t\t\t\tif (idxs == null || idxs.length == 0)\n\t\t\t\t\tcontinue;\n\n\t\t\t\tlet needle = needles[ni];\n\t\t\t\tlet _info = info(idxs, haystack, needle);\n\t\t\t\tlet order = opts.sort(_info, haystack, needle);\n\n\t\t\t\t// offset idxs for concat'ing infos\n\t\t\t\tif (ni > 0) {\n\t\t\t\t\tfor (let i = 0; i < order.length; i++)\n\t\t\t\t\t\torder[i] += retOrder.length;\n\t\t\t\t}\n\n\t\t\t\tfor (let k in _info) {\n\t\t\t\t\tretInfo[k] = (retInfo[k] ? retInfo[k] : []).concat(_info[k]);\n }\n\n\t\t\t\tretOrder = retOrder.concat(order);\n\t\t\t}\n\t\t}\n\n\t\treturn [\n\t\t\t[].concat(...matches),\n\t\t\tretInfo,\n\t\t\tretOrder,\n\t\t];\n\t};\n\n\treturn {\n\t\tsearch: (...args) => {\n\t\t\tlet out = _search(...args);\n\t\t\treturn out;\n\t\t},\n\t\tsplit,\n\t\tfilter,\n\t\tinfo,\n\t\tsort: opts.sort,\n\t};\n}\n\nconst latinize = (() => {\n\tlet accents = {\n\t\tA: 'ÁÀÃÂÄĄ',\n\t\ta: 'áàãâäą',\n\t\tE: 'ÉÈÊËĖ',\n\t\te: 'éèêëę',\n\t\tI: 'ÍÌÎÏĮ',\n\t\ti: 'íìîïį',\n\t\tO: 'ÓÒÔÕÖ',\n\t\to: 'óòôõö',\n\t\tU: 'ÚÙÛÜŪŲ',\n\t\tu: 'úùûüūų',\n\t\tC: 'ÇČ',\n\t\tc: 'çč',\n\t\tN: 'Ñ',\n\t\tn: 'ñ',\n\t\tS: 'Š',\n\t\ts: 'š'\n\t};\n\n\tlet accentsMap = new Map();\n\tlet accentsTpl = '';\n\n\tfor (let r in accents) {\n\t\taccents[r].split('').forEach(a => {\n\t\t\taccentsTpl += a;\n\t\t\taccentsMap.set(a, r);\n\t\t});\n\t}\n\n\tlet accentsRe = new RegExp(`[${accentsTpl}]`, 'g');\n\tlet replacer = m => accentsMap.get(m);\n\n\treturn strings => {\n\t\tif (typeof strings == 'string')\n\t\t\treturn strings.replace(accentsRe, replacer);\n\n\t\tlet out = Array(strings.length);\n\t\tfor (let i = 0; i < strings.length; i++)\n\t\t\tout[i] = strings[i].replace(accentsRe, replacer);\n\t\treturn out;\n\t};\n})();\n\n// https://stackoverflow.com/questions/9960908/permutations-in-javascript/37580979#37580979\nfunction permute(arr) {\n\tarr = arr.slice();\n\n\tlet length = arr.length,\n\t\tresult = [arr.slice()],\n\t\tc = new Array(length).fill(0),\n\t\ti = 1, k, p;\n\n\twhile (i < length) {\n\t\tif (c[i] < i) {\n\t\t\tk = i % 2 && c[i];\n\t\t\tp = arr[i];\n\t\t\tarr[i] = arr[k];\n\t\t\tarr[k] = p;\n\t\t\t++c[i];\n\t\t\ti = 1;\n\t\t\tresult.push(arr.slice());\n\t\t} else {\n\t\t\tc[i] = 0;\n\t\t\t++i;\n\t\t}\n\t}\n\n\treturn result;\n}\n\nconst _mark = (part, matched) => matched ? `${part}` : part;\nconst _append = (acc, part) => acc + part;\n\nfunction highlight(str, ranges, mark = _mark, accum = '', append = _append) {\n let tmp = append(accum, mark(str.substring(0, ranges[0]), false));\n\taccum = tmp !== null ? tmp : accum;\n\n\tfor (let i = 0; i < ranges.length; i+=2) {\n\t\tlet fr = ranges[i];\n\t\tlet to = ranges[i+1];\n\n tmp = append(accum, mark(str.substring(fr, to), true));\n\t\taccum = tmp !== null ? tmp : accum;\n\n\t\tif (i < ranges.length - 3) {\n tmp = append(accum, mark(str.substring(ranges[i + 1], ranges[i + 2]), false));\n accum = tmp !== null ? tmp : accum;\n }\n\t}\n\n tmp = append(accum, mark(str.substring(ranges[ranges.length - 1]), false));\n\taccum = tmp !== null ? tmp : accum;\n\n\treturn accum;\n}\n\nuFuzzy.latinize = latinize;\nuFuzzy.permute = arr => {\n\tlet idxs = permute([...Array(arr.length).keys()]).sort((a,b) => {\n\t\tfor (let i = 0; i < a.length; i++) {\n\t\t\tif (a[i] != b[i])\n\t\t\t\treturn a[i] - b[i];\n\t\t}\n\t\treturn 0;\n\t});\n\n\treturn idxs.map(pi => pi.map(i => arr[i]));\n};\nuFuzzy.highlight = highlight;\n\nexport { uFuzzy as default };\n","import uFuzzy from '@leeoniya/ufuzzy';\n\n// See https://github.com/leeoniya/uFuzzy#options\nconst uf = new uFuzzy({\n intraMode: 1,\n intraIns: 1,\n intraSub: 1,\n intraTrn: 1,\n intraDel: 1,\n});\n\nfunction sortCommands(\n a: ProcessedCommandItem,\n b: ProcessedCommandItem,\n favouriteCommands: CommandId[],\n recentCommands: CommandId[]\n): number {\n // Sort by recent first\n const aIsRecent = recentCommands.includes(a.id);\n const bIsRecent = recentCommands.includes(b.id);\n\n if (aIsRecent && !bIsRecent) {\n return -1;\n }\n\n if (!aIsRecent && bIsRecent) {\n return 1;\n }\n\n if (aIsRecent && bIsRecent) {\n return recentCommands.indexOf(a.id) - recentCommands.indexOf(b.id);\n }\n\n // Sort by favourites second\n const aIsFavourite = favouriteCommands.includes(a.id);\n const bIsFavourite = favouriteCommands.includes(b.id);\n\n if (aIsFavourite && !bIsFavourite) {\n return -1;\n }\n\n if (!aIsFavourite && bIsFavourite) {\n return 1;\n }\n\n // Sort by name third\n return a.name.localeCompare(b.name);\n}\n\nexport default function filterCommands(\n selectedCommandGroup: CommandId,\n searchWord: string,\n commands: FlatCommandList,\n favourites: CommandId[],\n recentCommands: CommandId[]\n): CommandId[] {\n // If there is a search word, return all commands to allow deep search\n // If no search word is given, return all commands in the currently selected group or all recent commands if no group is selected\n let availableCommands = Object.values(commands);\n availableCommands = searchWord\n ? availableCommands\n : availableCommands.filter(\n (command) =>\n command.parentId === selectedCommandGroup ||\n (!selectedCommandGroup && recentCommands.includes(command.id))\n );\n\n // If there is no search word, return all commands in the current context with favourites first, the recent commands will only be prioritised if we are at the top level\n if (!searchWord) {\n return availableCommands\n .sort((a, b) => sortCommands(a, b, favourites, selectedCommandGroup ? [] : recentCommands))\n .map((command) => command.id);\n }\n\n // Create a list of all available commands with their name and description as haystack for the search\n const availableCommandNames = availableCommands.map(({ name, description }) => name + ' ' + description);\n const [indices, , order] = uf.search(availableCommandNames, searchWord.toLowerCase());\n const matchingIds = order.map((i) => availableCommands[indices[i]].id);\n\n // Add all commands that can handle queries to the result, the Set removes duplicates\n return matchingIds;\n}\n","export default function assert(condition: unknown, message = 'Assertion failed'): asserts condition {\n if (condition === false) throw Error(message);\n}\n","export default function classnames(...args: Array): string {\n return args.filter(Boolean).join(' ');\n}\n","import { logger } from '../helpers';\n\nexport enum STATUS {\n COLLAPSED = 'collapsed',\n IDLE = 'idle',\n EXECUTING_COMMAND = 'executingCommand',\n DISPLAYING_RESULT = 'displayingResult',\n}\n\nexport enum TRANSITION {\n RESET_SEARCH = 'RESET_SEARCH',\n HIGHLIGHT_NEXT_ITEM = 'HIGHLIGHT_NEXT_ITEM',\n HIGHLIGHT_PREVIOUS_ITEM = 'HIGHLIGHT_PREVIOUS_ITEM',\n CANCEL = 'CANCEL',\n SELECT_GROUP = 'SELECT_GROUP',\n GO_TO_PARENT_GROUP = 'GO_TO_PARENT_GROUP',\n UPDATE_SEARCH = 'UPDATE_SEARCH',\n UPDATE_COMMAND_QUERY = 'UPDATE_COMMAND_QUERY',\n EXECUTE_COMMAND = 'EXECUTE_COMMAND',\n FINISH_COMMAND = 'FINISH_COMMAND',\n UPDATE_RESULT = 'UPDATE_RESULT',\n EXPAND = 'EXPAND',\n ADD_FAVOURITE = 'ADD_FAVOURITE',\n REMOVE_FAVOURITE = 'REMOVE_FAVOURITE',\n}\n\nexport enum ACTION {\n ADD_FAVOURITE = 'ADD_FAVOURITE',\n ADD_RECENTLY_USED = 'ADD_RECENTLY_USED',\n EXPAND = 'EXPAND',\n HIGHLIGHT_NEXT_COMMAND = 'HIGHLIGHT_NEXT_COMMAND',\n HIGHLIGHT_NEXT_OPTION = 'HIGHLIGHT_NEXT_OPTION',\n HIGHLIGHT_PREVIOUS_COMMAND = 'HIGHLIGHT_PREVIOUS_COMMAND',\n HIGHLIGHT_PREVIOUS_OPTION = 'HIGHLIGHT_PREVIOUS_OPTION',\n LEAVE_GROUP = 'LEAVE_GROUP',\n REFRESH_COMMANDS = 'REFRESH_COMMANDS',\n REMOVE_FAVOURITE = 'REMOVE_FAVOURITE',\n RESET_HIGHLIGHT = 'RESET_HIGHLIGHT',\n RESET_OPTION_HIGHLIGHT = 'RESET_OPTION_HIGHLIGHT',\n RESET_SEARCH = 'RESET_SEARCH',\n RESET_SEARCH_OR_LEAVE_GROUP = 'RESET_SEARCH_OR_LEAVE_GROUP',\n SET_ACTIVE_COMMAND = 'SET_ACTIVE_COMMAND',\n SET_COMMAND_QUERY = 'SET_COMMAND_QUERY',\n SET_GROUP = 'SET_GROUP',\n SET_SEARCH_WORD = 'SET_SEARCH_WORD',\n UNSET_ACTIVE_COMMAND = 'UNSET_ACTIVE_COMMAND',\n UNSET_RESULT = 'UNSET_RESULT',\n UPDATE_RESULT = 'UPDATE_RESULT',\n}\n\ninterface MachineDefinition {\n initial: STATUS;\n states: {\n [state in STATUS]: {\n on: {\n [transition in TRANSITION]?:\n | STATUS\n | {\n target: STATUS;\n actions?: ACTION[];\n };\n };\n };\n };\n}\n\nexport const machine: MachineDefinition = {\n initial: STATUS.COLLAPSED,\n states: {\n collapsed: {\n on: {\n UPDATE_SEARCH: {\n target: STATUS.IDLE,\n actions: [ACTION.EXPAND, ACTION.SET_SEARCH_WORD, ACTION.REFRESH_COMMANDS],\n },\n HIGHLIGHT_NEXT_ITEM: {\n target: STATUS.IDLE,\n actions: [ACTION.REFRESH_COMMANDS, ACTION.EXPAND],\n },\n EXPAND: {\n target: STATUS.IDLE,\n actions: [ACTION.REFRESH_COMMANDS, ACTION.EXPAND],\n },\n },\n },\n idle: {\n on: {\n UPDATE_SEARCH: {\n target: STATUS.IDLE,\n actions: [ACTION.SET_SEARCH_WORD, ACTION.RESET_HIGHLIGHT, ACTION.REFRESH_COMMANDS],\n },\n HIGHLIGHT_NEXT_ITEM: {\n target: STATUS.IDLE,\n actions: [ACTION.HIGHLIGHT_NEXT_COMMAND],\n },\n HIGHLIGHT_PREVIOUS_ITEM: {\n target: STATUS.IDLE,\n actions: [ACTION.HIGHLIGHT_PREVIOUS_COMMAND],\n },\n CANCEL: {\n target: STATUS.IDLE,\n actions: [ACTION.RESET_HIGHLIGHT, ACTION.RESET_SEARCH_OR_LEAVE_GROUP, ACTION.REFRESH_COMMANDS],\n },\n EXECUTE_COMMAND: {\n target: STATUS.EXECUTING_COMMAND,\n actions: [ACTION.ADD_RECENTLY_USED, ACTION.SET_ACTIVE_COMMAND, ACTION.REFRESH_COMMANDS],\n },\n GO_TO_PARENT_GROUP: {\n target: STATUS.IDLE,\n actions: [ACTION.RESET_HIGHLIGHT, ACTION.LEAVE_GROUP, ACTION.REFRESH_COMMANDS],\n },\n SELECT_GROUP: {\n target: STATUS.IDLE,\n actions: [ACTION.RESET_SEARCH, ACTION.RESET_HIGHLIGHT, ACTION.SET_GROUP, ACTION.REFRESH_COMMANDS],\n },\n ADD_FAVOURITE: {\n target: STATUS.IDLE,\n actions: [ACTION.ADD_FAVOURITE, ACTION.REFRESH_COMMANDS],\n },\n REMOVE_FAVOURITE: {\n target: STATUS.IDLE,\n actions: [ACTION.REMOVE_FAVOURITE, ACTION.REFRESH_COMMANDS],\n },\n },\n },\n executingCommand: {\n on: {\n UPDATE_RESULT: {\n target: STATUS.DISPLAYING_RESULT,\n actions: [ACTION.UPDATE_RESULT],\n },\n FINISH_COMMAND: {\n target: STATUS.IDLE,\n actions: [ACTION.UNSET_ACTIVE_COMMAND],\n },\n },\n },\n displayingResult: {\n on: {\n UPDATE_COMMAND_QUERY: {\n target: STATUS.DISPLAYING_RESULT,\n actions: [ACTION.SET_COMMAND_QUERY],\n },\n UPDATE_RESULT: {\n target: STATUS.DISPLAYING_RESULT,\n actions: [ACTION.UPDATE_RESULT, ACTION.RESET_OPTION_HIGHLIGHT],\n },\n HIGHLIGHT_NEXT_ITEM: {\n target: STATUS.DISPLAYING_RESULT,\n actions: [ACTION.HIGHLIGHT_NEXT_OPTION],\n },\n HIGHLIGHT_PREVIOUS_ITEM: {\n target: STATUS.DISPLAYING_RESULT,\n actions: [ACTION.HIGHLIGHT_PREVIOUS_OPTION],\n },\n EXECUTE_COMMAND: {\n target: STATUS.DISPLAYING_RESULT,\n actions: [ACTION.SET_ACTIVE_COMMAND],\n },\n CANCEL: {\n target: STATUS.IDLE,\n actions: [ACTION.UNSET_RESULT, ACTION.UNSET_ACTIVE_COMMAND, ACTION.RESET_OPTION_HIGHLIGHT],\n },\n FINISH_COMMAND: {\n target: STATUS.DISPLAYING_RESULT,\n actions: [ACTION.UNSET_ACTIVE_COMMAND],\n },\n },\n },\n },\n};\n\nexport interface MachineState {\n status: STATUS;\n}\n\ntype MachineEvent = {\n type: TRANSITION;\n payload?: any;\n};\n\nexport function transition(\n state: MachineState,\n event: MachineEvent,\n actionCallback?: (action: ACTION, nextState: MachineState, event: MachineEvent) => void\n): MachineState {\n let nextStateNode = machine.states[state.status].on?.[event.type] ?? null;\n\n if (!nextStateNode) {\n logger.error(`No transition found for event \"${event.type}\" in state \"${state.status}\"`);\n nextStateNode = { target: state.status };\n }\n\n const nextState = {\n ...state,\n status: typeof nextStateNode == 'string' ? nextStateNode : nextStateNode.target,\n } as MachineState;\n\n if (actionCallback && typeof nextStateNode == 'object') {\n nextStateNode.actions?.forEach((action) => actionCallback(action, nextState, event));\n }\n\n logger.debug(`Transitioned from \"${state.status}\" to \"${nextState.status}\" with event \"${event.type}\"`);\n\n return nextState;\n}\n","import { assert, clamp, filterCommands } from '../helpers';\nimport { ACTION, MachineState, TRANSITION, transition } from './commandBarMachine';\n\nexport type CommandBarEvent =\n | { type: TRANSITION.RESET_SEARCH }\n | { type: TRANSITION.HIGHLIGHT_NEXT_ITEM }\n | { type: TRANSITION.HIGHLIGHT_PREVIOUS_ITEM }\n | { type: TRANSITION.CANCEL }\n | { type: TRANSITION.SELECT_GROUP; commandId: string }\n | { type: TRANSITION.GO_TO_PARENT_GROUP }\n | { type: TRANSITION.UPDATE_SEARCH; searchWord: string }\n | { type: TRANSITION.UPDATE_COMMAND_QUERY; commandQuery: string }\n | { type: TRANSITION.EXECUTE_COMMAND; commandId: CommandId; message: string }\n | { type: TRANSITION.FINISH_COMMAND }\n | { type: TRANSITION.UPDATE_RESULT; result: CommandResult }\n | { type: TRANSITION.EXPAND }\n | { type: TRANSITION.ADD_FAVOURITE; commandId: CommandId }\n | { type: TRANSITION.REMOVE_FAVOURITE; commandId: CommandId };\n\nexport type CommandBarState = MachineState & {\n activeCommandId: CommandId;\n activeCommandMessage: string;\n availableCommandIds: CommandId[];\n commandQuery: string;\n commands: FlatCommandList;\n expanded: boolean;\n favouriteCommands: CommandId[];\n highlightedItem: number;\n highlightedOption: number;\n recentCommands: CommandId[];\n result: CommandResult | null;\n resultCommandId: CommandId;\n searchWord: string;\n selectedCommandGroup: CommandId;\n showBranding: boolean;\n};\n\nconst MAX_RECENTLY_USED = 5;\n\nfunction runAction(action: ACTION, nextState: CommandBarState, event: CommandBarEvent) {\n switch (action) {\n case ACTION.RESET_SEARCH:\n nextState.searchWord = '';\n break;\n case ACTION.RESET_HIGHLIGHT:\n nextState.highlightedItem = 0;\n break;\n case ACTION.REFRESH_COMMANDS:\n nextState.availableCommandIds = filterCommands(\n nextState.selectedCommandGroup,\n nextState.searchWord,\n nextState.commands,\n nextState.favouriteCommands,\n nextState.recentCommands\n );\n break;\n case ACTION.HIGHLIGHT_NEXT_COMMAND:\n nextState.highlightedItem = clamp(\n nextState.highlightedItem + 1,\n 0,\n nextState.availableCommandIds.length - 1\n );\n break;\n case ACTION.HIGHLIGHT_PREVIOUS_COMMAND:\n nextState.highlightedItem = clamp(\n nextState.highlightedItem - 1,\n 0,\n nextState.availableCommandIds.length - 1\n );\n break;\n case ACTION.HIGHLIGHT_NEXT_OPTION:\n nextState.highlightedOption = clamp(\n nextState.highlightedOption + 1,\n 0,\n Object.keys(nextState.result.options).length - 1\n );\n break;\n case ACTION.HIGHLIGHT_PREVIOUS_OPTION:\n nextState.highlightedOption = clamp(\n nextState.highlightedOption - 1,\n 0,\n Object.keys(nextState.result.options).length - 1\n );\n break;\n case ACTION.SET_SEARCH_WORD:\n assert(event.type === TRANSITION.UPDATE_SEARCH);\n nextState.searchWord = event.searchWord;\n break;\n case ACTION.SET_COMMAND_QUERY:\n assert(event.type === TRANSITION.UPDATE_COMMAND_QUERY);\n nextState.commandQuery = event.commandQuery;\n break;\n case ACTION.EXPAND:\n nextState.expanded = true;\n break;\n case ACTION.SET_ACTIVE_COMMAND:\n assert(event.type === TRANSITION.EXECUTE_COMMAND);\n nextState.activeCommandId = event.commandId;\n nextState.activeCommandMessage = event.message;\n break;\n case ACTION.UNSET_ACTIVE_COMMAND:\n nextState.activeCommandId = null;\n nextState.activeCommandMessage = null;\n break;\n case ACTION.UPDATE_RESULT:\n assert(event.type === TRANSITION.UPDATE_RESULT);\n assert(typeof event.result.success === 'boolean');\n nextState.result = {\n options: {},\n message: 'Command executed',\n view: null,\n success: false,\n ...event.result,\n };\n nextState.resultCommandId = nextState.activeCommandId;\n break;\n case ACTION.RESET_OPTION_HIGHLIGHT:\n nextState.highlightedOption = 0;\n break;\n case ACTION.RESET_SEARCH_OR_LEAVE_GROUP:\n if (nextState.commandQuery) {\n nextState.commandQuery = '';\n } else if (nextState.searchWord) {\n nextState.searchWord = '';\n } else {\n nextState.selectedCommandGroup = nextState.selectedCommandGroup\n ? nextState.commands[nextState.selectedCommandGroup].parentId\n : null;\n }\n break;\n case ACTION.UNSET_RESULT:\n nextState.result = null;\n nextState.resultCommandId = null;\n nextState.commandQuery = '';\n break;\n case ACTION.LEAVE_GROUP:\n nextState.selectedCommandGroup = nextState.selectedCommandGroup\n ? nextState.commands[nextState.selectedCommandGroup].parentId\n : null;\n break;\n case ACTION.SET_GROUP:\n assert(event.type === TRANSITION.SELECT_GROUP);\n nextState.selectedCommandGroup = event.commandId;\n break;\n case ACTION.ADD_FAVOURITE:\n assert(event.type === TRANSITION.ADD_FAVOURITE);\n if (!nextState.favouriteCommands.includes(event.commandId)) {\n nextState.favouriteCommands.push(event.commandId);\n }\n break;\n case ACTION.REMOVE_FAVOURITE:\n assert(event.type === TRANSITION.REMOVE_FAVOURITE);\n nextState.favouriteCommands = nextState.favouriteCommands.filter((id) => id !== event.commandId);\n break;\n case ACTION.ADD_RECENTLY_USED:\n assert(event.type === TRANSITION.EXECUTE_COMMAND);\n // Only add to recently used if the command has an action\n if (!nextState.commands[event.commandId].action) {\n break;\n }\n if (nextState.recentCommands.includes(event.commandId)) {\n nextState.recentCommands = nextState.recentCommands.filter((id) => id !== event.commandId);\n }\n nextState.recentCommands.unshift(event.commandId);\n if (nextState.recentCommands.length > MAX_RECENTLY_USED) {\n nextState.recentCommands.pop();\n }\n break;\n default:\n throw Error(`Action ${action} not implemented`);\n }\n}\n\nconst commandBarReducer = (state: CommandBarState, event: CommandBarEvent): CommandBarState => {\n return transition(state, event, runAction) as CommandBarState;\n};\n\nexport { commandBarReducer };\n","import React from 'react';\n\nimport * as styles from './IconWrapper.module.css';\n\ntype IconWrapperProps = {\n children: JSX.Element;\n};\n\nconst IconWrapper: React.FC = ({ children }) => {\n return {children};\n};\n\nexport default React.memo(IconWrapper);\n",".iconWrap {\n width: var(--icon-size);\n max-height: var(--icon-size);\n display: inline-block;\n text-align: center;\n}\n\n.iconWrap svg {\n max-width: 100%;\n max-height: inherit;\n display: inline-block;\n}\n","import React from 'react';\nimport { useCommandBarState, useIntl } from '../../state';\n\nimport * as styles from './Branding.module.css';\n\nconst Branding: React.FC = () => {\n const {\n state: { showBranding },\n } = useCommandBarState();\n const { translate } = useIntl();\n\n if (!showBranding) return null;\n\n return (\n \n {translate('CommandBarFooter.brandingSmall', 'Made with love by')}\n \n \n \n \n \n \n \n \n \n \n \n );\n};\n\nexport default React.memo(Branding);\n",".madeWithLove {\n display: flex;\n text-decoration: none;\n gap: 0.5rem;\n}\n\n.madeWithLove small {\n transition: color 0.1s ease-in-out;\n}\n\n.madeWithLove:hover small {\n color: var(--color-light-text-hover);\n}\n\n.madeWithLove svg {\n display: inline-block;\n width: var(--icon-size);\n height: auto;\n}\n","import React from 'react';\n\nexport function IconBack() {\n return (\n \n \n \n );\n}\n","import React from 'react';\n\nexport function IconNeos() {\n return (\n \n \n \n );\n}\n","import React from 'react';\n\nexport function IconSpinner() {\n return (\n \n \n \n );\n}\n","import React from 'react';\n\nexport function IconStar() {\n return (\n \n \n \n );\n}\n","import React from 'react';\n\nexport function IconPlay() {\n return (\n \n \n \n );\n}\n","import React from 'react';\nimport { useComputed } from '@preact/signals';\n\nimport { useCommandBarState } from '../../state';\nimport IconWrapper from '../IconWrapper/IconWrapper';\nimport Branding from './Branding';\nimport { IconNeos, IconSpinner } from '../Icons';\n\nimport * as styles from './CommandBarFooter.module.css';\n\nconst CommandBarFooter: React.FC = () => {\n const {\n state: { activeCommandId, activeCommandMessage, commands, result, selectedCommandGroup, expanded },\n Icon,\n } = useCommandBarState();\n\n const runningCommand = useComputed(() => {\n if (!activeCommandId.value) return null;\n // FIXME: This will not be correct when a command and an option in the result have the same id\n return activeCommandId.value\n ? commands.value[activeCommandId.value] ?? result.value.options[activeCommandId.value]\n : null;\n });\n\n if (!expanded.value) return null;\n\n return (\n
\n {activeCommandId.value ? (\n \n \n \n \n \n {runningCommand.value.name} ‒ {activeCommandMessage}\n \n \n ) : selectedCommandGroup.value ? (\n \n \n {commands.value[selectedCommandGroup.value].name}\n \n ) : (\n \n \n \n )}\n \n
\n );\n};\n\nexport default React.memo(CommandBarFooter);\n",".commandBarFooter {\n border-top: 1px solid var(--color-border);\n background-color: var(--footer-background);\n padding: 0.8rem 1rem;\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: 1rem;\n user-select: none;\n}\n\n.breadcrumb {\n display: flex;\n gap: 1rem;\n --icon-size: 0.875em;\n}\n\n.activity {\n display: flex;\n gap: 1rem;\n --icon-size: 0.875em;\n}\n","import React, { useCallback, useRef } from 'react';\nimport { useSignalEffect } from '@preact/signals';\n\nimport { useCommandBarState, STATUS, useIntl, useCommandExecutor } from '../../state';\nimport IconWrapper from '../IconWrapper/IconWrapper';\n\nimport * as styles from './SearchBox.module.css';\nimport { IconPlay } from '../Icons';\n\n// Timer helper for debouncing updates of command query results\nlet updateResultsTimer = null;\nconst RESULT_UPDATE_DEBOUNCE_TIME = 500;\n\nconst SearchBox: React.FC = () => {\n const { state, actions } = useCommandBarState();\n const { executeCommand } = useCommandExecutor();\n const { translate } = useIntl();\n const inputRef = useRef();\n\n const handleChange = useCallback((e) => {\n if (state.status.value === STATUS.DISPLAYING_RESULT) {\n actions.UPDATE_COMMAND_QUERY(e.target.value);\n\n // Execute command after a delay if it's not a manual command\n if (!state.commands.value[state.resultCommandId.value].executeManually) {\n if (updateResultsTimer) {\n clearTimeout(updateResultsTimer);\n }\n updateResultsTimer = setTimeout(\n () => executeCommand(state.resultCommandId.value),\n RESULT_UPDATE_DEBOUNCE_TIME\n );\n }\n } else {\n actions.UPDATE_SEARCH(e.target.value);\n }\n }, []);\n\n const handleKeyPress = useCallback(\n (e: React.KeyboardEvent) => {\n // Prevent escape event from bubbling up if the input is focused and the native reset should be used\n if (e.key === 'Escape') {\n if (inputRef.current.value) {\n e.preventDefault();\n e.stopPropagation();\n }\n }\n },\n [inputRef.current]\n );\n\n // Focus input when the command bar is ready for input\n useSignalEffect(() => {\n if (state.status.value !== STATUS.EXECUTING_COMMAND) {\n inputRef.current?.focus();\n }\n });\n\n return (\n <>\n \n {!state.expanded.value && (\n \n \n \n \n \n \n \n )}\n {state.status.value === STATUS.DISPLAYING_RESULT &&\n state.commands.value[state.resultCommandId.value]?.executeManually && (\n executeCommand(state.resultCommandId.value)}\n title={translate('SearchBox.execute.title', 'Execute the command')}\n >\n \n \n \n \n )}\n \n );\n};\n\nexport default React.memo(SearchBox);\n",".searchBox {\n appearance: none;\n background: none;\n border: none;\n color: currentColor;\n font-size: 1.1em !important; /* Fix to prevent Neos.UI css from forcing the font size to 14px */\n font-weight: 300;\n outline: none;\n padding: 0.5rem;\n flex: 1;\n}\n\n.searchBox:disabled {\n color: var(--color-light-text);\n cursor: not-allowed;\n}\n\n.expandButton {\n position: absolute;\n padding: 0 1rem;\n height: 100%;\n right: 0;\n display: block;\n background: none;\n border: none;\n cursor: pointer;\n}\n\n.expandButton svg {\n color: var(--grayLighter);\n transition: color 0.1s ease-in-out;\n}\n\n.expandButton:hover svg {\n color: var(--primaryBlue);\n}\n\n.executeButton {\n position: absolute;\n padding: 0 1rem;\n height: 100%;\n right: 0;\n display: block;\n background: none;\n border: none;\n cursor: pointer;\n}\n\n.executeButton {\n color: var(--grayLighter);\n transition: color 0.1s ease-in-out;\n}\n\n.executeButton:hover svg {\n color: var(--primaryBlue);\n}\n","import React from 'react';\nimport { useComputed } from '@preact/signals';\n\nimport { useCommandBarState, STATUS } from '../../state';\nimport IconWrapper from '../IconWrapper/IconWrapper';\nimport SearchBox from '../SearchBox/SearchBox';\nimport { IconBack } from '../Icons';\n\nimport * as styles from './CommandBarHeader.module.css';\n\nconst CommandBarHeader: React.FC = () => {\n const { state, actions } = useCommandBarState();\n const isDisplayingResults = useComputed(() => state.status.value == STATUS.DISPLAYING_RESULT);\n\n return (\n
\n {(isDisplayingResults.value || state.selectedCommandGroup.value) && (\n \n \n \n \n \n )}\n \n
\n );\n};\n\nexport default React.memo(CommandBarHeader);\n",".commandBarHeader {\n display: flex;\n align-items: center;\n gap: 1rem;\n padding: 0.3rem 0.5rem;\n border-bottom: 1px solid var(--color-border);\n position: relative;\n}\n\n.backButton {\n padding: 0.3rem;\n background-color: var(--color-icon-bg);\n border-radius: 50%;\n appearance: none;\n border: none;\n color: white;\n cursor: pointer;\n transition: background-color 0.1s ease-in-out;\n display: flex;\n}\n\n.backButton:hover {\n background-color: var(--color-icon-bg-hover);\n}\n","import React from 'react';\nimport { ReadonlySignal, useComputed } from '@preact/signals';\n\nimport { IconWrapper } from '../index';\nimport { classnames } from '../../helpers';\nimport { IconStar } from '../Icons';\n\nimport * as styles from './CommandListItem.module.css';\nimport { useCommandBarState, useIntl } from '../../state';\n\ntype CommandListItemProps = {\n command: ProcessedCommandItem;\n onItemSelect: (commandId: CommandId) => void;\n highlightedId: ReadonlySignal;\n onToggleFavourite?: (id: CommandId) => void;\n};\n\nfunction getCommandType(\n { subCommandIds, category, canHandleQueries, action }: ProcessedCommandItem,\n translate: TranslateFunction\n): string {\n let type = 'command';\n if (category) {\n return category;\n } else if (subCommandIds?.length > 0) {\n type = 'category';\n } else if (canHandleQueries) {\n type = 'query';\n } else if (typeof action == 'string') {\n type = 'link';\n }\n\n return translate(`CommandListItem.type.${type}`, type);\n}\n\nfunction CommandListItem({ command, onItemSelect, highlightedId, onToggleFavourite }: CommandListItemProps) {\n const {\n state: { favouriteCommands },\n Icon,\n } = useCommandBarState();\n const { translate } = useIntl();\n const { id, name, description, icon, action } = command;\n const commandType = getCommandType(command, translate);\n\n const isHighlighted = useComputed(() => highlightedId.value === id);\n const isFavourite = useComputed(() => favouriteCommands.value.includes(id));\n\n return (\n onItemSelect(id)}\n data-testid=\"CommandListItem\"\n >\n \n \n {name}\n {description && (\n \n {typeof description == 'string' ? description : description()}\n \n )}\n \n {onToggleFavourite && action && (\n {\n e.stopPropagation();\n onToggleFavourite(id);\n }}\n >\n \n \n \n \n )}\n {commandType}\n \n );\n}\n\n// Use memo to prevent rerendering of all items when the parent list is updated\nexport default React.memo(CommandListItem);\n",".commandListItem {\n cursor: pointer;\n display: flex !important; /* Necessary due to the neos header bar styling */\n gap: 1em;\n padding: 0.4rem 0.6rem;\n align-items: baseline;\n border-radius: var(--border-radius-item);\n transition: background-color 0.1s ease-in-out, opacity 0.1s ease-in-out;\n background-color: transparent;\n user-select: none;\n --icon-size: 0.875em;\n}\n\n.commandListItem:hover {\n background-color: var(--color-item-hover);\n}\n\n.highlighted {\n background-color: var(--color-item-highlighted);\n}\n\n.disabled {\n opacity: 0.5;\n cursor: not-allowed;\n}\n\n.label {\n display: flex;\n flex-wrap: wrap;\n flex: 1;\n gap: 0.2em 1em;\n align-items: baseline;\n}\n\n.description {\n white-space:pre-wrap;\n font-size: 0.9em;\n}\n\n.type {\n max-width: 30%;\n}\n\n.favouriteButton {\n visibility: hidden;\n border: none;\n background: none;\n cursor: pointer;\n transition: color 0.1s ease-in-out;\n color: var(--textSubtleLight);\n align-self: baseline;\n padding: 0 0.3rem;\n}\n.favouriteButton:hover {\n color: var(--primaryBlue);\n}\n\n.commandListItem:hover .favouriteButton {\n visibility: visible;\n}\n\n.isFavourite {\n display: block;\n color: var(--primaryBlue);\n visibility: visible;\n}\n","import React, { useCallback } from 'react';\nimport { useComputed, useSignalEffect } from '@preact/signals';\n\nimport CommandListItem from '../CommandListItem/CommandListItem';\nimport { useCommandBarState, useCommandExecutor, useIntl, STATUS } from '../../state';\nimport { classnames } from '../../helpers';\n\nimport * as styles from './CommandListing.module.css';\n\nconst CommandList: React.FC = () => {\n const {\n state: {\n commands,\n highlightedItem,\n availableCommandIds,\n status,\n searchWord,\n favouriteCommands,\n recentCommands,\n selectedCommandGroup,\n },\n actions: { ADD_FAVOURITE, REMOVE_FAVOURITE },\n } = useCommandBarState();\n const { translate } = useIntl();\n const { executeCommand } = useCommandExecutor();\n const navRef = React.useRef(null);\n\n useSignalEffect(() => {\n navRef.current\n ?.querySelector(`li:nth-child(${highlightedItem.value})`)\n ?.scrollIntoView({ behavior: 'smooth', block: 'center' });\n });\n\n const handleToggleFavourite = useCallback(\n (commandId: CommandId) => {\n if (favouriteCommands.value.includes(commandId)) {\n REMOVE_FAVOURITE(commandId);\n } else {\n ADD_FAVOURITE(commandId);\n }\n },\n [favouriteCommands]\n );\n\n const suggestions = useComputed(() => {\n return searchWord.value || selectedCommandGroup.value\n ? []\n : availableCommandIds.value.filter((commandId) => recentCommands.value.includes(commandId));\n });\n const availableCommands = useComputed(() => {\n return searchWord.value || selectedCommandGroup.value\n ? availableCommandIds.value\n : availableCommandIds.value.filter((commandId) => !recentCommands.value.includes(commandId));\n });\n const highlightedCommand = useComputed(() => availableCommandIds.value[highlightedItem.value]);\n\n return (\n \n {suggestions.value.length > 0 && (\n <>\n
{translate('CommandList.suggestions', 'Recently used')}
\n
    \n {suggestions.value.map((commandId) => (\n \n ))}\n
\n \n )}\n {availableCommands.value.length > 0 && (\n <>\n
{translate('CommandList.heading', 'Commands')}
\n
    \n {availableCommands.value.map((commandId) => (\n \n ))}\n
\n \n )}\n {availableCommandIds.value.length === 0 && (\n \n {translate('CommandList.noCommandsMessage', 'No matching commands found')}\n \n )}\n \n );\n};\n\nexport default React.memo(CommandList);\n",".results {\n min-height: 0;\n transition: opacity 0.3s ease-in;\n overflow-y: auto;\n max-height: 60vh;\n height: 100%;\n}\n\n.results h6 {\n color: var(--color-light-text);\n margin: 0.5rem;\n font-size: 0.9em;\n font-weight: normal;\n user-select: none;\n}\n\n.results ul {\n padding: 0;\n list-style: none;\n display: flex;\n flex-direction: column;\n gap: 0.5em;\n margin: 0;\n}\n\n.noResults {\n padding: 0.5rem;\n}\n\n.disabled {\n opacity: 0.5 !important;\n pointer-events: none;\n user-select: none;\n}\n","import React from 'react';\nimport { useComputed, useSignalEffect } from '@preact/signals';\n\nimport { useCommandBarState, useCommandExecutor } from '../../state';\nimport CommandListItem from '../CommandListItem/CommandListItem';\n\nimport * as styles from './CommandResultsView.module.css';\n\nconst CommandResultsView: React.FC = () => {\n const {\n state: { result, highlightedOption },\n } = useCommandBarState();\n const { executeCommand } = useCommandExecutor();\n const navRef = React.useRef(null);\n const highlightedId = useComputed(() =>\n result.value ? Object.values(result.value.options)[highlightedOption.value].id : null\n );\n\n useSignalEffect(() => {\n const highlightedIndex = highlightedOption.value;\n navRef.current\n ?.querySelector(`li:nth-child(${highlightedIndex})`)\n ?.scrollIntoView({ behavior: 'smooth', block: 'center' });\n });\n\n const { options, view, message } = result.value ?? {};\n\n return (\n
\n {message &&
{message}
}\n {view ?
{view}
: ''}\n {options && (\n \n )}\n
\n );\n};\n\nexport default CommandResultsView;\n",".commandResultsView {\n max-width: 100%;\n overflow: auto;\n}\n\n.message {\n font-size: 1em;\n}\n\n.results {\n min-height: 0;\n transition: opacity 0.3s ease-in;\n overflow-y: auto;\n max-height: 60vh;\n height: 100%;\n}\n\n.results h6 {\n color: var(--color-light-text);\n margin: 0.5rem;\n font-size: 0.9em;\n font-weight: normal;\n user-select: none;\n}\n\n.results ul {\n padding: 0;\n list-style: none;\n display: flex;\n flex-direction: column;\n gap: 0.5em;\n margin: 0;\n}\n\n.noResults {\n padding: 0.5rem;\n}\n\n.disabled {\n opacity: 0.5 !important;\n pointer-events: none;\n user-select: none;\n}\n","import React from 'react';\n\nimport * as styles from './ToggleButton.module.css';\n\ntype ToggleButtonProps = {\n handleToggle: () => void;\n disabled?: boolean;\n label: string;\n title: string;\n};\n\nconst ToggleButton: React.FC = ({ handleToggle, disabled = false, label, title }) => {\n return (\n \n );\n};\n\nexport default React.memo(ToggleButton);\n",".toggleButton {\n background-color: var(--grayDark);\n border: 1px solid var(--grayMedium);\n color: var(--textSubtleLight);\n border-radius: 6px;\n display: flex;\n align-items: center;\n gap: 0.5em;\n transition: 0.1s ease-out;\n user-select: none;\n padding: 2px 0.3rem 2px 0.5rem;\n cursor: pointer;\n line-height: 1.4em;\n}\n\n.toggleButton:disabled {\n opacity: 0.5;\n cursor: not-allowed;\n}\n\n.toggleButton:not(:disabled):hover {\n background-color: var(--grayLighter);\n color: var(--textOnWhite);\n}\n\n.buttonIcon {\n background-color: var(--gray);\n border-radius: 3px;\n color: var(--textOnGray);\n font-size: 80%;\n padding: 1px 4px;\n transition: background-color 0.1s ease-out;\n}\n\n.toggleButton:not(:disabled):hover .buttonIcon {\n background-color: var(--primaryBlue);\n}\n","import React, { createContext, useCallback, useContext, useMemo } from 'react';\nimport { signal, computed, ReadonlySignal } from '@preact/signals';\n\nimport { CommandBarEvent, commandBarReducer, CommandBarState } from './commandBarReducer';\nimport { flattenCommands, logger } from '../helpers';\nimport { STATUS, TRANSITION } from './commandBarMachine';\nimport { IconWrapper } from '../components';\n\ninterface CommandBarContextProps {\n commands: HierarchicalCommandList;\n children: JSX.Element;\n IconComponent: React.FC;\n userPreferences: UserPreferencesService;\n}\n\ninterface CommandBarContextValues {\n state: {\n activeCommandId: ReadonlySignal;\n activeCommandMessage: ReadonlySignal;\n availableCommandIds: ReadonlySignal;\n commandQuery: ReadonlySignal;\n commands: ReadonlySignal;\n expanded: ReadonlySignal;\n favouriteCommands: ReadonlySignal;\n highlightedItem: ReadonlySignal;\n highlightedOption: ReadonlySignal;\n recentCommands: ReadonlySignal;\n result: ReadonlySignal;\n resultCommandId: ReadonlySignal;\n searchWord: ReadonlySignal;\n selectedCommandGroup: ReadonlySignal;\n showBranding: ReadonlySignal;\n status: ReadonlySignal;\n };\n actions: Record void>;\n Icon: Renderable;\n}\n\nconst CommandBarContext = createContext({} as CommandBarContextValues);\nexport const useCommandBarState = (): CommandBarContextValues => useContext(CommandBarContext);\n\n/**\n * Create the app state and initialize it if it does not exist yet\n */\nfunction createAppState(initialState: CommandBarState) {\n // Define a signal to hold the state\n const commandBarState = signal(initialState);\n\n // Define a function to dispatch events to the reducer and its state machine and update the state with the result\n const dispatch = (event: CommandBarEvent) => {\n commandBarState.value = commandBarReducer(commandBarState.value, event);\n };\n\n // Derive readonly selectors for partial state values\n const activeCommandId = computed(() => commandBarState.value.activeCommandId);\n const activeCommandMessage = computed(() => commandBarState.value.activeCommandMessage);\n const availableCommandIds = computed(() => commandBarState.value.availableCommandIds);\n const commandQuery = computed(() => commandBarState.value.commandQuery);\n const commands = computed(() => commandBarState.value.commands);\n const expanded = computed(() => commandBarState.value.expanded);\n const favouriteCommands = computed(() => commandBarState.value.favouriteCommands);\n const highlightedItem = computed(() => commandBarState.value.highlightedItem);\n const highlightedOption = computed(() => commandBarState.value.highlightedOption);\n const recentCommands = computed(() => commandBarState.value.recentCommands);\n const result = computed(() => commandBarState.value.result);\n const resultCommandId = computed(() => commandBarState.value.resultCommandId);\n const searchWord = computed(() => commandBarState.value.searchWord);\n const selectedCommandGroup = computed(() => commandBarState.value.selectedCommandGroup);\n const showBranding = computed(() => commandBarState.value.showBranding);\n const status = computed(() => commandBarState.value.status);\n\n return {\n state: {\n activeCommandId,\n activeCommandMessage,\n availableCommandIds,\n commandQuery,\n commands,\n expanded,\n favouriteCommands,\n highlightedItem,\n highlightedOption,\n recentCommands,\n result,\n resultCommandId,\n searchWord,\n selectedCommandGroup,\n showBranding,\n status,\n },\n dispatch,\n };\n}\n\nexport const CommandBarStateProvider: React.FC = ({\n commands,\n children,\n IconComponent,\n userPreferences,\n}) => {\n const { state, dispatch } = useMemo(() => {\n return createAppState({\n activeCommandId: null,\n activeCommandMessage: null,\n availableCommandIds: Object.keys(commands),\n commandQuery: '',\n commands: flattenCommands(commands),\n expanded: false,\n favouriteCommands: userPreferences.favouriteCommands,\n highlightedItem: 0,\n highlightedOption: 0,\n recentCommands: userPreferences.recentCommands,\n result: null,\n resultCommandId: null,\n searchWord: '',\n selectedCommandGroup: null,\n showBranding: userPreferences.showBranding,\n status: STATUS.COLLAPSED,\n });\n }, []);\n\n // Provide all actions as shorthand functions\n const actions: Record void | Promise> = useMemo(() => {\n return {\n [TRANSITION.RESET_SEARCH]: () => dispatch({ type: TRANSITION.RESET_SEARCH }),\n [TRANSITION.HIGHLIGHT_NEXT_ITEM]: () => dispatch({ type: TRANSITION.HIGHLIGHT_NEXT_ITEM }),\n [TRANSITION.HIGHLIGHT_PREVIOUS_ITEM]: () => dispatch({ type: TRANSITION.HIGHLIGHT_PREVIOUS_ITEM }),\n [TRANSITION.CANCEL]: () => dispatch({ type: TRANSITION.CANCEL }),\n [TRANSITION.SELECT_GROUP]: (commandId: CommandId) => dispatch({ type: TRANSITION.SELECT_GROUP, commandId }),\n [TRANSITION.GO_TO_PARENT_GROUP]: () => dispatch({ type: TRANSITION.GO_TO_PARENT_GROUP }),\n [TRANSITION.UPDATE_SEARCH]: (searchWord: string) =>\n dispatch({ type: TRANSITION.UPDATE_SEARCH, searchWord }),\n [TRANSITION.UPDATE_COMMAND_QUERY]: (commandQuery: string) =>\n dispatch({ type: TRANSITION.UPDATE_COMMAND_QUERY, commandQuery }),\n [TRANSITION.EXECUTE_COMMAND]: async (commandId: CommandId, message: string) => {\n dispatch({\n type: TRANSITION.EXECUTE_COMMAND,\n commandId,\n message,\n });\n // Update recent commands in the user preferences when a command is executed\n return userPreferences\n .addRecentCommand(commandId)\n .catch((e) => logger.error('Could not add recent command', e));\n },\n [TRANSITION.FINISH_COMMAND]: () => dispatch({ type: TRANSITION.FINISH_COMMAND }),\n [TRANSITION.UPDATE_RESULT]: (result: CommandResult) => dispatch({ type: TRANSITION.UPDATE_RESULT, result }),\n [TRANSITION.EXPAND]: () => dispatch({ type: TRANSITION.EXPAND }),\n [TRANSITION.ADD_FAVOURITE]: (commandId: CommandId) => {\n dispatch({ type: TRANSITION.ADD_FAVOURITE, commandId });\n userPreferences\n .setFavouriteCommands(state.favouriteCommands.value)\n .catch((e) => logger.error('Could not update favourite commands', e));\n },\n [TRANSITION.REMOVE_FAVOURITE]: (commandId: CommandId) => {\n dispatch({ type: TRANSITION.REMOVE_FAVOURITE, commandId });\n userPreferences\n .setFavouriteCommands(state.favouriteCommands.value)\n .catch((e) => logger.error('Could not update favourite commands', e));\n },\n };\n }, []);\n\n const Icon: React.FC = useCallback(({ icon, spin = false }) => {\n return (\n \n \n \n );\n }, []);\n\n return {children};\n};\n","import React, { useCallback, useEffect } from 'react';\n\nimport useFunctionRef from '../hooks/useFunctionRef';\nimport { useCommandBarState } from './CommandBarStateProvider';\nimport { assert, logger } from '../helpers';\nimport { STATUS } from './commandBarMachine';\n\ninterface CommandInputContextProps {\n children: React.ReactElement | React.ReactElement[];\n toggleOpen: () => void;\n dialogRef: React.RefObject;\n open: boolean;\n}\n\ninterface CommandInputContextValues {\n executeCommand: (commandId: CommandId) => void;\n}\n\nconst CommandInputContext = React.createContext({} as CommandInputContextValues);\nexport const useCommandExecutor = (): CommandInputContextValues => React.useContext(CommandInputContext);\n\n/**\n * Context provider for the command bar input and command execution\n */\nexport const CommandBarExecutor: React.FC = ({ children, toggleOpen, dialogRef, open }) => {\n const { state, actions } = useCommandBarState();\n\n const handleKeyEnteredRef = useFunctionRef((e: KeyboardEvent | React.KeyboardEvent) => {\n if (!open || e.defaultPrevented) {\n return;\n }\n if (e.key === 'k' && e.metaKey && dialogRef?.current.contains(e.target as Node)) {\n // Close command bar\n toggleOpen();\n e.stopPropagation();\n e.preventDefault();\n } else if (e.key === 'Escape') {\n // Cancel search, or selection, or close command bar\n e.stopPropagation();\n e.preventDefault();\n if (state.selectedCommandGroup.value || state.searchWord.value || state.commandQuery.value) {\n actions.CANCEL();\n } else {\n // Close command bar if cancel is noop\n toggleOpen();\n }\n } else if (e.key === 'ArrowDown') {\n // Navigate to next command\n e.stopPropagation();\n e.preventDefault();\n actions.HIGHLIGHT_NEXT_ITEM();\n } else if (e.key === 'ArrowUp') {\n // Navigate to previous command\n e.stopPropagation();\n e.preventDefault();\n actions.HIGHLIGHT_PREVIOUS_ITEM();\n } else if (e.key === 'Enter') {\n // Execute highlighted command\n e.stopPropagation();\n e.preventDefault();\n\n // Select the highlighted command by default\n let commandId = state.availableCommandIds.value[state.highlightedItem.value];\n if (state.status.value === STATUS.DISPLAYING_RESULT) {\n // If there are options the command to execute is the highlighted option\n if (Object.values(state.result.value.options).length) {\n commandId = Object.keys(state.result.value.options)[state.highlightedOption.value];\n } else {\n // If there are no options we run the command which generated the result again\n commandId = state.resultCommandId.value;\n }\n }\n\n if (commandId) {\n void executeCommand(commandId);\n }\n }\n });\n\n const executeCommand = useCallback(\n async (commandId: CommandId) => {\n const command = state.result.value?.options[commandId] ?? state.commands.value[commandId];\n const { action, canHandleQueries, subCommandIds, name } = command;\n\n // If the command is a group, select it\n if (subCommandIds?.length > 0) {\n actions.SELECT_GROUP(commandId);\n return;\n }\n\n assert(action, `Command ${commandId} has no action`);\n\n // If the command is a url, open it\n if (typeof action == 'string') {\n // We wait for the state change to be finished before opening the url\n await actions.EXECUTE_COMMAND(commandId, 'Loading url');\n\n // We need to check if the url is in the same domain, otherwise we need to open it in a new tab\n // TODO: We should add another option to a link command to define its target\n if (action.indexOf('http') === 0 && action.indexOf(document.location.origin) !== 0) {\n window.open(action, '_blank', 'noopener,noreferrer')?.focus();\n } else {\n window.location.href = action;\n }\n return actions.FINISH_COMMAND();\n }\n\n // If the command is a function, execute it\n actions.EXECUTE_COMMAND(commandId, 'Running command');\n const actionResult = action(canHandleQueries ? state.commandQuery.value : undefined);\n if ((actionResult as AsyncCommandResult).then) {\n // Handle Promises\n (actionResult as AsyncCommandResult)\n .then((result) => {\n if (result && !result.success) {\n throw new Error(`The command \"${name}\" failed`);\n }\n })\n .catch((error) => {\n // TODO: Show an error message to the user\n logger.error('Command error', name, error);\n })\n .finally(() => {\n actions.FINISH_COMMAND();\n });\n } else if ((actionResult as CommandGeneratorResult).next) {\n // Handle generators\n const generator = actionResult as CommandGeneratorResult;\n // TODO: Handle errors / success === false\n for await (const result of generator) {\n actions.UPDATE_RESULT(result);\n }\n actions.FINISH_COMMAND();\n } else {\n logger.error('Command result is not a promise or generator', actionResult);\n }\n\n if (command.closeOnExecute) {\n toggleOpen();\n }\n },\n [state.searchWord, state.commands, state.result]\n );\n\n const executeCommandRef = useFunctionRef((commandId: CommandId) => {\n void executeCommand(commandId);\n });\n\n /**\n * Add key event handler, needs to be updated when any parameter for the key event handler changes\n */\n useEffect(() => {\n if (!open) return;\n\n // const guestFrame = document.getElementsByName('neos-content-main')[0] as HTMLIFrameElement;\n // guestFrame.contentWindow?.addEventListener('keyup', (e) => {\n // log.debug('keypress in guestframe', e);\n // });\n // log.debug('guestFrame', guestFrame.contentWindow);\n\n const windowKeyEventHandler = (e) => handleKeyEnteredRef.current(e);\n\n window.addEventListener('keydown', windowKeyEventHandler);\n return () => window.removeEventListener('keydown', windowKeyEventHandler);\n }, [open]);\n\n return (\n \n {children}\n \n );\n};\n","import React, { createContext, ReactNode, useContext } from 'react';\n\ntype IntlProviderProps = {\n children: ReactNode;\n translate: TranslateFunction;\n};\n\ntype IntlProviderValues = {\n translate: TranslateFunction;\n};\n\nexport const IntlContext = createContext({} as IntlProviderValues);\nexport const useIntl = (): IntlProviderValues => useContext(IntlContext);\n\nexport const IntlProvider = ({ translate, children }: IntlProviderProps) => {\n return {children};\n};\n","import React, { CSSProperties, DragEventHandler, useCallback, useEffect, useRef } from 'react';\nimport { batch, useComputed, useSignal } from '@preact/signals';\n\nimport { CommandBarFooter, CommandBarHeader, CommandList, CommandResultsView } from '../index';\nimport { CommandBarExecutor, useCommandBarState } from '../../state';\nimport { clamp, classnames } from '../../helpers';\n\nimport * as styles from './CommandBarDialog.module.css';\n\ninterface CommandBarDialogProps {\n onDrag?: (state: boolean) => void;\n open: boolean;\n toggleOpen: () => void;\n}\n\nconst CommandBarDialog: React.FC = ({ onDrag, open, toggleOpen }) => {\n const {\n state: { expanded, result },\n } = useCommandBarState();\n const dialogRef = useRef(null);\n\n const isDragging = useSignal(false);\n const dialogPosition = useSignal<{\n left: number;\n top: number;\n }>({\n left: window.innerWidth / 2 - 300,\n top: window.innerHeight / 2 - 20,\n });\n const dragStateOffset = useSignal<{\n offsetLeft: number;\n offsetTop: number;\n }>({\n offsetLeft: 0,\n offsetTop: 0,\n });\n const hasBeenDragged = useSignal(false);\n\n const dialogStyle = useComputed(() => {\n const { left, top } = dialogPosition.value;\n return (\n hasBeenDragged\n ? {\n left: left + 'px',\n top: top + 'px',\n translate: 'none',\n visibility: isDragging.value ? 'hidden' : 'visible',\n }\n : {}\n ) as CSSProperties;\n });\n\n const reposition = useCallback((left: number, top: number) => {\n const dialogSize = dialogRef.current.getBoundingClientRect();\n dialogPosition.value = {\n left: clamp(left, 0, window.innerWidth - dialogSize.width),\n top: clamp(top, 0, window.innerHeight - dialogSize.height),\n };\n }, []);\n\n const handleDragStart: DragEventHandler = useCallback(\n (e) => {\n // @ts-ignore\n if (e.target.tagName === 'INPUT') {\n return;\n }\n console.debug('dragstart');\n e.dataTransfer.setData('text/plain', 'CommandBar');\n e.dataTransfer.dropEffect = 'move';\n e.dataTransfer.effectAllowed = 'move';\n\n batch(() => {\n dragStateOffset.value = {\n offsetLeft: e.clientX - dialogRef.current.offsetLeft,\n offsetTop: e.clientY - dialogRef.current.offsetTop,\n };\n hasBeenDragged.value = true;\n });\n\n onDrag && onDrag(true);\n },\n [dialogRef.current]\n );\n\n const handleDragDrop = useCallback(\n (e: DragEvent) => {\n const { clientX, clientY } = e;\n console.debug('dragdrop', clientX, clientY, dragStateOffset.value);\n batch(() => {\n isDragging.value = false;\n reposition(clientX - dragStateOffset.value.offsetLeft, clientY - dragStateOffset.value.offsetTop);\n });\n onDrag && onDrag(false);\n },\n [dialogRef.current]\n );\n\n const onResize = useCallback(() => reposition(dialogPosition.value.left, dialogPosition.value.top), []);\n\n useEffect(() => {\n if (!open) return;\n dialogRef.current.parentElement.addEventListener('drop', handleDragDrop);\n window.addEventListener('resize', onResize);\n return () => {\n dialogRef.current.parentElement.removeEventListener('drop', handleDragDrop);\n window.removeEventListener('resize', onResize);\n };\n }, [open, onResize, handleDragDrop]);\n\n if (!open) {\n return null;\n }\n\n return (\n (isDragging.value = true)}\n style={dialogStyle.value}\n data-testid=\"CommandBarDialog\"\n >\n \n \n \n {expanded.value && }\n {result.value && }\n
\n \n \n \n );\n};\n\nexport default CommandBarDialog;\n",".commandBar {\n backdrop-filter: blur(var(--dialog-blur));\n background: var(--bar-background);\n border-radius: var(--border-radius-bar, 5);\n border: 1px solid var(--color-border);\n box-shadow: 0 3px 10px rgba(0, 0, 0, 0.5);\n color: white;\n display: flex;\n flex-direction: column;\n left: 50%;\n margin: 0;\n max-width: var(--bar-max-width);\n min-width: var(--bar-min-width);\n max-height: 90vh;\n overflow: hidden;\n position: absolute;\n padding: 0;\n top: 50%;\n translate: -50% -50%;\n width: var(--bar-width);\n pointer-events: all;\n transition: width 0.1s ease-out;\n}\n\n.commandBar.hasResults {\n width: var(--bar-width-expanded);\n}\n\n.commandBar small {\n color: var(--color-light-text);\n font-size: 90%;\n}\n\n.commandBar ::-webkit-scrollbar {\n width: 4px;\n height: 4px;\n}\n\n.commandBar ::-webkit-scrollbar-track {\n background-color: transparent;\n}\n\n.commandBar ::-webkit-scrollbar-thumb {\n background-color: var(--grayLight);\n}\n\n.commandBar ::-webkit-scrollbar-corner {\n background-color: var(--grayDark);\n}\n\n.resultsWrap {\n display: grid;\n grid-template-rows: 0fr;\n transform-origin: top center;\n transition: grid-template-rows 0.2s ease-in;\n overflow: auto;\n}\n\n.resultsWrap > * {\n opacity: 0;\n}\n\n.resultsWrap.expanded {\n grid-template-rows: 1fr;\n}\n\n.resultsWrap.expanded > * {\n opacity: 1;\n padding: 0.5rem;\n}\n.resultsWrap.split {\n grid-template-columns: 1fr 1fr;\n}\n","import React from 'react';\n\nimport { CommandBarStateProvider, IntlProvider } from './state';\nimport CommandBarDialog from './components/CommandBarDialog/CommandBarDialog';\n\nimport './Variables.module.css';\n\ntype CommandBarProps = {\n commands: HierarchicalCommandList;\n open: boolean;\n toggleOpen: () => void;\n onDrag?: (state: boolean) => void;\n IconComponent: React.FC;\n userPreferences: UserPreferencesService;\n translate: TranslateFunction;\n};\n\nconst CommandBar: React.FC = ({\n commands,\n open,\n toggleOpen,\n onDrag,\n IconComponent,\n userPreferences,\n translate,\n}) => {\n return (\n \n \n \n \n \n );\n};\n\nexport default CommandBar;\n","export async function fetchData(endpoint: string, params?: Record, method = 'GET'): Promise {\n if (params && method === 'GET') {\n endpoint = Object.keys(params).reduce((url, key) => {\n return url + '&' + key + '=' + encodeURIComponent(params[key]);\n }, endpoint + '?');\n }\n return fetch(endpoint, {\n method,\n credentials: 'include',\n body: params && method === 'POST' ? JSON.stringify(params) : undefined,\n headers: {\n // FIXME: Include CSRF Token\n // 'X-Flow-Csrftoken': csrfToken,\n 'Content-Type': 'application/json',\n Accept: 'application/json',\n },\n }).then((response: Response) => {\n if (response.status !== 200) {\n throw new Error(`The request failed with code ${response.status}: \"${response.statusText}\"`);\n }\n if (response.headers.get('Content-Type')?.includes('application/json')) {\n return response.json();\n }\n return response.text();\n }) as Promise;\n}\n","import { fetchData } from './fetch';\n\nconst ENDPOINT_GET_PREFERENCES = '/neos/shel-neos-commandbar/preferences/getpreferences';\nconst ENDPOINT_SET_FAVOURITE_COMMANDS = '/neos/shel-neos-commandbar/preferences/setfavourites';\nconst ENDPOINT_ADD_RECENT_COMMAND = '/neos/shel-neos-commandbar/preferences/addrecentcommand';\n\nasync function setPreference(endpoint: string, data: any): Promise {\n return fetchData(endpoint, data, 'POST');\n}\n\nexport async function getPreferences() {\n return fetchData(ENDPOINT_GET_PREFERENCES);\n}\n\nexport async function setFavouriteCommands(commandIds: CommandId[]) {\n return setPreference(ENDPOINT_SET_FAVOURITE_COMMANDS, { commandIds: commandIds });\n}\n\nexport async function addRecentCommand(commandId: CommandId) {\n // TODO: Check if sendBeacon is a better option here to reduce the impact on the user\n return setPreference(ENDPOINT_ADD_RECENT_COMMAND, { commandId: commandId });\n}\n","import { fetchData } from './fetch';\n\nconst ENDPOINT_COMMANDS = '/neos/service/data-source/shel-neos-commandbar-commands';\n\nexport async function getCommands() {\n return fetchData(ENDPOINT_COMMANDS);\n}\n","import { fetchData } from './fetch';\n\nconst ENDPOINT_SEARCH_NEOS_DOCS = '/neos/service/data-source/shel-neos-commandbar-search-neos-docs';\n\nexport async function searchNeosDocs(query: string): Promise {\n return query ? fetchData(ENDPOINT_SEARCH_NEOS_DOCS, { query }) : {};\n}\n","import { fetchData } from './fetch';\n\nconst ENDPOINT_SEARCH_NEOS_PACKAGES = '/neos/service/data-source/shel-neos-commandbar-search-neos-packages';\n\nexport async function searchNeosPackages(query: string): Promise {\n return query ? fetchData(ENDPOINT_SEARCH_NEOS_PACKAGES, { query }) : {};\n}\n",".pluginWrap {\n display: flex;\n align-items: center;\n height: 41px;\n font-size: 14px !important;\n line-height: 20px;\n margin: 0 1rem;\n}\n\n.fullScreenLayer {\n width: 100vw;\n height: 100vh;\n position: absolute;\n left: 0;\n top: 0;\n pointer-events: none;\n z-index: 9999;\n display: none;\n}\n\n.open {\n display: block;\n}\n\n@keyframes spin {\n 0% { transform: rotate(0deg); }\n 100% { transform: rotate(359deg); }\n}\n\n.spin {\n animation: spin 2s linear infinite;\n}\n","import React from 'preact/compat';\nimport * as styles from './ModulePlugin.module.css';\n\n/**\n * As we don't have font awesome in the shadow dom, we need to render a fallback icon for commands\n */\nconst IconComponent: React.FC = ({ spin = false }) => {\n return (\n \n \n \n );\n};\n\nexport default IconComponent;\n","import { Component } from 'preact';\nimport React from 'preact/compat';\n\nimport { CommandBar, logger, ToggleButton } from '@neos-commandbar/commandbar';\nimport { PreferencesApi, CommandsApi, DocumentationApi, PackagesApi } from '@neos-commandbar/neos-api';\nimport IconComponent from './IconComponent';\n\nimport * as styles from './ModulePlugin.module.css';\n\n/**\n * This is a custom element that is used to render the command bar inside a shadow dom to prevent Neos and module\n * styles from leaking into the component\n */\nexport default class App extends Component<\n {\n styleuri: string;\n },\n {\n initialized: boolean;\n open: boolean;\n dragging: boolean;\n commands: HierarchicalCommandList;\n preferences: {\n favouriteCommands: CommandId[];\n recentCommands: CommandId[];\n recentDocuments: NodeContextPath[];\n showBranding: boolean;\n };\n }\n> {\n static tagName = 'command-bar-container';\n static options = { shadow: true };\n private static i18nRegistry: NeosI18n;\n\n constructor() {\n super();\n App.i18nRegistry = (window as NeosModuleWindow).NeosCMS.I18n;\n this.state = {\n initialized: false,\n open: false,\n dragging: false,\n // TODO: Only load the search commands in dev context\n commands: {\n searchNeosDocs: {\n name: App.translate('CommandBarUiPlugin.command.documentation', 'Documentation'),\n description: App.translate(\n 'CommandBarUiPlugin.command.documentation.description',\n 'Browse or search the Neos documentation'\n ),\n icon: 'book',\n canHandleQueries: true,\n action: this.handleSearchNeosDocs.bind(this),\n },\n searchNeosPackages: {\n name: App.translate('CommandBarUiPlugin.command.packages', 'Packages'),\n description: App.translate(\n 'CommandBarUiPlugin.command.packages.description',\n 'Search for Neos packages'\n ),\n icon: 'boxes',\n canHandleQueries: true,\n action: this.handleSearchNeosPackages.bind(this),\n },\n },\n preferences: { favouriteCommands: [], recentCommands: [], recentDocuments: [], showBranding: true },\n };\n }\n\n /**\n * Wrapper for the Neos backend translation api\n */\n private static translate: TranslateFunction = (id, paramsOrFallback, fallback) => {\n if (typeof paramsOrFallback === 'string') {\n fallback = paramsOrFallback;\n paramsOrFallback = {};\n }\n return App.i18nRegistry.translate(id, fallback, 'Shel.Neos.CommandBar', 'Main', paramsOrFallback);\n };\n\n /**\n * Load the commands and preferences from the server and set the state to initialized\n */\n async componentDidMount() {\n try {\n const preferences = await PreferencesApi.getPreferences();\n const commands = await CommandsApi.getCommands();\n this.setState((prev) => ({ initialized: true, preferences, commands: { ...prev.commands, ...commands } }));\n\n document.addEventListener('keydown', (e) => {\n if (e.key === 'k' && e.metaKey) {\n e.stopPropagation();\n e.preventDefault();\n this.handleToggle();\n }\n });\n } catch (e) {\n logger.error(e);\n }\n }\n\n handleToggle = () => {\n this.setState(({ open }) => ({\n open: !open,\n }));\n };\n\n handleDrag = (dragging: boolean) => {\n this.setState({ dragging: dragging });\n };\n\n handleSearchNeosDocs = async function* (query: string): CommandGeneratorResult {\n yield {\n success: true,\n message: App.translate(\n 'CommandBarUiPlugin.command.documentation.searching',\n { query },\n `Search for \"${query}\"`\n ),\n };\n let error;\n const options = await DocumentationApi.searchNeosDocs(query).catch((e) => {\n logger.error('Could not search Neos docs', e);\n error = e.message;\n });\n if (error || !options) {\n yield {\n success: false,\n message: App.translate('CommandBarUiPlugin.command.documentation.error', 'Search failed'),\n view: error,\n };\n } else {\n yield {\n success: true,\n message: App.translate(\n 'CommandBarUiPlugin.command.documentation.matches',\n { matches: Object.keys(options).length },\n `${Object.values(options).length} options match your query`\n ),\n options,\n };\n }\n };\n\n handleSearchNeosPackages = async function* (query: string): CommandGeneratorResult {\n yield {\n success: true,\n message: App.translate('CommandBarUiPlugin.command.packages.searching', { query }, `Search for \"${query}\"`),\n };\n let error;\n const options = await PackagesApi.searchNeosPackages(query).catch((e) => {\n logger.error('Could not search Neos packages', e);\n error = e.message;\n });\n if (error || !options) {\n yield {\n success: false,\n message: App.translate('CommandBarUiPlugin.command.packages.error', 'Search failed'),\n view: error,\n };\n } else {\n yield {\n success: true,\n message: App.translate(\n 'CommandBarUiPlugin.command.packages.matches',\n { matches: Object.values(options).length },\n `${Object.values(options).length} options match your query`\n ),\n options,\n };\n }\n };\n\n render() {\n const { initialized, open, dragging, commands, preferences } = this.state;\n\n return (\n <>\n \n
\n \n {initialized && (\n e.preventDefault()}\n style={dragging ? { pointerEvents: 'all' } : null}\n >\n \n
\n )}\n \n \n );\n }\n}\n","import register from 'preact-custom-element';\n\nimport App from './App';\n\n// @ts-ignore\nif (process.env.NODE_ENV !== 'production') {\n // @ts-ignore\n require('preact/debug');\n}\n\n// Register & add the debug web component, tagName and attributes are automatically read from the component\nregister(App, null, null, App.options);\n\nwindow.addEventListener('neoscms-i18n-initialized', () => {\n // Get the top bar left container and create a custom element to render the command bar into\n const topBarLeft = document.querySelector('.neos-top-bar-left');\n const pluginContainer = document.createElement('command-bar-container');\n pluginContainer.id = 'shel-neos-commandbar';\n\n // Get the style tag of the command bar package from the HTML head to also load it inside the custom element\n const commandBarStyleTag = document.querySelector(\n 'link[rel=\"stylesheet\"][href*=\"Shel.Neos.CommandBar\"]'\n ) as HTMLLinkElement;\n pluginContainer.setAttribute('styleuri', commandBarStyleTag.href);\n\n topBarLeft.appendChild(pluginContainer);\n});\n"],"names":["slice","options","vnodeId","rerenderQueue","prevDebounce","defer","i","EMPTY_OBJ","EMPTY_ARR","IS_NON_DIMENSIONAL","assign","obj","props","removeNode","node","parentNode","removeChild","createElement","type","children","key","ref","normalizedProps","arguments","length","call","defaultProps","createVNode","original","vnode","__k","__","__b","__e","__d","__c","__h","constructor","__v","Fragment","Component","context","this","getDomSibling","childIndex","indexOf","sibling","updateParentDomPointers","child","base","enqueueRender","c","push","process","__r","debounceRendering","renderQueueLength","component","commitQueue","oldVNode","oldDom","parentDom","sort","a","b","shift","diff","ownerSVGElement","commitRoot","diffChildren","renderResult","newParentVNode","oldParentVNode","globalContext","isSvg","excessDomChildren","isHydrating","j","childVNode","newDom","firstChildDom","refs","oldChildren","oldChildrenLength","Array","isArray","reorderChildren","placeChild","getLastDom","nextSibling","unmount","applyRef","tmp","toChildArray","out","some","nextDom","sibDom","outer","appendChild","insertBefore","lastDom","setStyle","style","value","setProperty","test","dom","name","oldValue","useCapture","o","cssText","replace","toLowerCase","l","addEventListener","eventProxyCapture","eventProxy","removeEventListener","e","removeAttribute","setAttribute","event","newVNode","isNew","oldProps","oldState","snapshot","clearProcessingException","newProps","provider","componentContext","renderHook","count","newType","contextType","__E","prototype","render","doRender","sub","state","__n","_sb","__s","getDerivedStateFromProps","componentWillMount","componentDidMount","componentWillReceiveProps","shouldComponentUpdate","forEach","componentWillUpdate","componentDidUpdate","__P","getChildContext","getSnapshotBeforeUpdate","oldHtml","newHtml","nodeType","localName","document","createTextNode","createElementNS","is","data","childNodes","dangerouslySetInnerHTML","attributes","__html","innerHTML","diffProps","hydrate","checked","diffElementNodes","diffed","root","cb","current","parentVNode","skipRemove","r","componentWillUnmount","replaceNode","firstChild","cloneElement","createContext","defaultValue","contextId","Consumer","contextValue","Provider","subs","ctx","_props","old","splice","$8ce2b6e41a0de290$var$r","Object","t","n","hasOwnProperty","apply","ContextProvider","rest","connectedCallback","CustomEvent","detail","bubbles","cancelable","dispatchEvent","_vdom","h","toVdom","element","nodeName","cn","toCamelCase","slot","Slot","wrappedChildren","_vdomComponent","hasAttribute","_root","str","_","toUpperCase","attributeChangedCallback","newValue","disconnectedCallback","_this","_listener","stopPropagation","error","errorInfo","ctor","handled","getDerivedStateFromError","setState","componentDidCatch","update","callback","s","forceUpdate","Promise","then","bind","resolve","setTimeout","isStaticChildren","__source","__self","currentIndex","currentComponent","previousComponent","prevRaf","currentHook","afterPaintEffects","EMPTY","oldBeforeDiff","oldBeforeRender","oldAfterDiff","oldCommit","oldBeforeUnmount","getHookState","index","hooks","__H","__V","useState","initialState","useReducer","invokeOrReturn","reducer","init","hookState","_reducer","action","currentValue","__N","nextValue","_hasScuFromHooks","prevScu","p","stateHooks","filter","x","every","shouldUpdate","hookItem","useEffect","args","argsChanged","_pendingArgs","useLayoutEffect","useRef","initialValue","useMemo","factory","useCallback","useContext","flushAfterPaintEffects","invokeCleanup","invokeEffect","requestAnimationFrame","afterNextFrame","hasErrored","HAS_RAF","raf","done","clearTimeout","timeout","cancelAnimationFrame","hook","comp","cleanup","oldArgs","newArgs","arg","f","shallowDiffers","y","PureComponent","isPureReactComponent","oldDiffHook","__f","REACT_FORWARD_SYMBOL","Symbol","for","mapFn","fn","map","Children","only","normalized","toArray","oldCatchError","oldUnmount","detachedClone","detachedParent","effect","removeOriginal","originalParent","Suspense","__u","_suspenders","suspended","__a","SuspenseList","_next","_map","__R","promise","suspendingVNode","suspendingComponent","resolved","onResolved","onSuspensionComplete","suspendedVNode","pop","wasHydrating","detachedComponent","__O","fallback","list","delete","revealOrder","size","Portal","container","_container","_temp","before","delegated","get","unsuspend","wrappedUnsuspend","Map","reverse","set","REACT_ELEMENT_TYPE","CAMEL_PROPS","IS_DOM","onChangeInputType","isReactComponent","defineProperty","configurable","v","writable","oldEventHook","empty","isPropagationStopped","cancelBubble","isDefaultPrevented","defaultPrevented","persist","nativeEvent","classNameDescriptor","class","oldVNodeHook","nonCustomElement","multiple","selected","className","enumerable","$$typeof","oldDiffed","isValidElement","startTransition","useId","__m","mask","useInsertionEffect","useTransition","useDeferredValue","val","useSyncExternalStore","subscribe","getSnapshot","_useState","_instance","_getSnapshot","useImperativeHandle","createHandle","concat","useDebugValue","formatter","version","parent","textContent","preactRender","preactHydrate","unmountComponentAtNode","createPortal","el","containerInfo","createFactory","preactCloneElement","createRef","findDOMNode","memo","comparer","nextProps","updateRef","Memoed","displayName","forwardRef","Forwarded","clone","flushSync","unstable_batchedUpdates","StrictMode","lazy","loader","prom","Lazy","exports","default","__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED","ReactCurrentDispatcher","readContext","$1b06254f22bdd07e$export$2e2bcd8739ae039","fnRef","$d6bdfea1a1e13052$export$b8f5890fc79d6aca","cycleDetected","Error","endBatch","batchDepth","hasError","batchedEffect","_effect","batchIteration","next","_nextBatchedEffect","_flags","needsToRecompute","_callback","err","batch","evalContext","globalVersion","addDependency","signal","_node","_target","_version","_source","_prevSource","_sources","_nextSource","_prevTarget","_nextTarget","_rollbackNode","_subscribe","Signal","_value","_targets","target","_refresh","prepareSources","rollbackNode","cleanupSources","head","prev","_unsubscribe","Computed","compute","_compute","_globalVersion","computed","cleanupEffect","_cleanup","prevContext","disposeEffect","endEffect","Effect","_dispose","hookName","hookFn","setCurrentUpdater","updater","finishUpdate","_start","Text","_ref","currentSignal","useSignal","_updateFlags","_updater","peek","createPropUpdater","prop","propSignal","setAsProperty","changeSignal","_update","newSignal","useComputed","$compute","useSignalEffect","$edcc64b978b003b2$export$2e2bcd8739ae039","commands","parentId","keys","reduce","commandList","commandId","icon","description","subCommands","canHandleQueries","closeOnExecute","category","executeManually","absoluteCommandId","subCommandIds","subCommandId","id","flag","valueOf","toString","_notify","OUTDATED","finish","defineProperties","signalProps","__np","renderedProps","_updaters","updaters","_signal","_updater2","HAS_PENDING_UPDATE","_i","$ea926074f08a4cd5$var$PREFIX","$ea926074f08a4cd5$export$2e2bcd8739ae039","ok","message","console","log","warn","debug","$197034fc7f52566b$export$2e2bcd8739ae039","min","max","Math","$44ee2883445aae00$var$cmp","Intl","Collator","compare","$44ee2883445aae00$var$inf","Infinity","$44ee2883445aae00$var$NEGS_RE","$44ee2883445aae00$var$OPTS","interSplit","intraSplit","intraBound","interLft","interRgt","interChars","interIns","intraChars","intraIns","intraContr","intraMode","intraSlice","intraSub","intraTrn","intraDel","intraFilt","term","match","info","haystack","needle","idx","chars","terms","interLft2","interLft1","start","ia","ib","$44ee2883445aae00$var$lazyRepeat","limit","$44ee2883445aae00$var$mode2Tpl","$44ee2883445aae00$export$2e2bcd8739ae039","opts","_intraSplit","_interSplit","_intraBound","intraRules","_intraSlice","_intraIns","_intraSub","_intraTrn","_intraDel","plen","withIntraSplit","RegExp","trimRe","contrsRe","split","m","prepQuery","capt","interOR","parts","reTpl","contrs","fill","pi","lftIdx","rgtIdx","lftChar","rgtChar","numChars","variants","intraInsTpl","join","preTpl","sufTpl","interCharsTpl","idxs","query","withIntraBound","interBound","queryR","partsLen","len","field","interRgt2","interRgt1","ranges","mayDiscard","ii","mhstr","idxAcc","disc","lft2","lft1","rgt2","rgt1","inter","intra","refine","k","group","termLen","groupLen","fullMatch","idxOf","refineMatch","lftCharIdx","rgtCharIdx","isPre","isSuf","junk","junkIdx","m2","found","re","exec","charIdx","from","to","refLen","ri","lastRi","idxInNext","matchLen","offset","prepend","search","outOfOrder","infoThresh","preFiltered","negsRe","needles","matches","negs","trim","terms2","ti","$44ee2883445aae00$var$permute","perm","matchedIdxs","Set","ni","preFiltered2","has","matched","add","retInfo","retOrder","acc","_info","order","_search","$44ee2883445aae00$var$latinize","accents","A","E","I","O","U","u","C","N","S","accentsMap","accentsTpl","accentsRe","replacer","strings","arr","result","$44ee2883445aae00$var$_mark","part","$44ee2883445aae00$var$_append","latinize","permute","highlight","mark","accum","append","substring","fr","$f5323048963c3f50$var$uf","$f5323048963c3f50$export$2e2bcd8739ae039","selectedCommandGroup","searchWord","favourites","recentCommands","availableCommands","values","command","includes","favouriteCommands","aIsRecent","bIsRecent","aIsFavourite","bIsFavourite","localeCompare","$f5323048963c3f50$var$sortCommands","availableCommandNames","indices","$187cc7d792701051$export$2e2bcd8739ae039","condition","$4de6e96dcc9c5973$export$2e2bcd8739ae039","Boolean","$4327cc3088ca9bcc$export$e50006273435e7d4","STATUS","$4327cc3088ca9bcc$export$f2127cf693ff3edc","TRANSITION","$4327cc3088ca9bcc$export$9523889e0a5da4ba","ACTION","COLLAPSED","$4327cc3088ca9bcc$export$ea56d40cd27c3480","collapsed","on","UPDATE_SEARCH","IDLE","actions","EXPAND","SET_SEARCH_WORD","REFRESH_COMMANDS","HIGHLIGHT_NEXT_ITEM","idle","RESET_HIGHLIGHT","HIGHLIGHT_NEXT_COMMAND","HIGHLIGHT_PREVIOUS_ITEM","HIGHLIGHT_PREVIOUS_COMMAND","CANCEL","RESET_SEARCH_OR_LEAVE_GROUP","EXECUTE_COMMAND","EXECUTING_COMMAND","ADD_RECENTLY_USED","SET_ACTIVE_COMMAND","GO_TO_PARENT_GROUP","LEAVE_GROUP","SELECT_GROUP","RESET_SEARCH","SET_GROUP","ADD_FAVOURITE","REMOVE_FAVOURITE","executingCommand","UPDATE_RESULT","DISPLAYING_RESULT","FINISH_COMMAND","UNSET_ACTIVE_COMMAND","displayingResult","UPDATE_COMMAND_QUERY","SET_COMMAND_QUERY","RESET_OPTION_HIGHLIGHT","HIGHLIGHT_NEXT_OPTION","HIGHLIGHT_PREVIOUS_OPTION","UNSET_RESULT","$4327cc3088ca9bcc$export$66bb15e2994e6a26","actionCallback","nextStateNode","status","nextState","$3bdb7eb1bca92625$var$runAction","highlightedItem","availableCommandIds","highlightedOption","commandQuery","expanded","activeCommandId","activeCommandMessage","success","view","resultCommandId","unshift","$3bdb7eb1bca92625$export$9e3f7bba62d514d7","$5105b2e4b958e09e$export$2e2bcd8739ae039","$a35043596f133777$export$2e2bcd8739ae039","$1f5e800e7e637d25$export$2e2bcd8739ae039","showBranding","$c92c3390bd0178a7$export$53e25b3b0bb3833c","translate","$16998066b180f6ef$export$5aebe9a147f4d146","href","title","rel","xmlns","width","height","viewBox","gradientUnits","x1","y1","x2","y2","stopColor","d","transform","$a9d8acb8ffa4eae4$export$9f1a005b19e034c8","$04a90802deaf6510$export$1440ab2404307ace","$aa76484c3e1ffc63$export$bd96d8defd13d2a9","$5dcc0a8fea92bfd7$export$bfe304c803da70de","$d8d8e5123e381d27$export$4b2505a64d1f53bd","$2aa32f662e9078f8$export$2e2bcd8739ae039","Icon","runningCommand","$2f74d86b545ec476$export$e3d20747ab930783","$87c672bf702cb1a4$var$updateResultsTimer","$87c672bf702cb1a4$export$2e2bcd8739ae039","executeCommand","$1ea80d3c959bcb5f$export$40a06c0c5b3ff9aa","inputRef","handleChange","$d6bdfea1a1e13052$export$35808ee640e87ca7","handleKeyPress","preventDefault","$2f74d86b545ec476$export$ed99038c4a6f842a","focus","placeholder","autoFocus","onChange","onKeyUp","onClick","$937f9e11bd53a43f$export$2e2bcd8739ae039","isDisplayingResults","$b1dbce9614761190$var$CommandListItem","onItemSelect","highlightedId","onToggleFavourite","commandType","$b1dbce9614761190$var$getCommandType","isHighlighted","isFavourite","$b1dbce9614761190$export$2e2bcd8739ae039","$8564955bb37d770f$var$CommandList","navRef","querySelector","scrollIntoView","behavior","block","handleToggleFavourite","suggestions","highlightedCommand","$8564955bb37d770f$export$2e2bcd8739ae039","$798ea27d8acd4548$export$2e2bcd8739ae039","highlightedIndex","$2a001a2eafdc7fa7$export$2e2bcd8739ae039","handleToggle","disabled","label","$c92c3390bd0178a7$var$CommandBarContext","$450fc775b2f7950e$export$fd42f52fd3ae1109","$d6bdfea1a1e13052$export$fae74005e78b1a27","$c92c3390bd0178a7$export$8ffac7c47764ac1d","IconComponent","userPreferences","dispatch","$d6bdfea1a1e13052$export$1538c33de8887b59","commandBarState","$0ed7988ef29ac9ba$export$e2ef10f86a8d60e8","$0ed7988ef29ac9ba$export$2983e091f1a1e8e2","$c92c3390bd0178a7$var$createAppState","async","addRecentCommand","catch","setFavouriteCommands","spin","$1ea80d3c959bcb5f$var$CommandInputContext","$1ea80d3c959bcb5f$export$c67beff7acfe625","toggleOpen","dialogRef","open","handleKeyEnteredRef","metaKey","contains","location","origin","window","actionResult","undefined","finally","generator","executeCommandRef","$d6bdfea1a1e13052$export$6d9c69b0de29b591","windowKeyEventHandler","$16998066b180f6ef$export$9073ae457aa4b186","$16998066b180f6ef$export$480518999dfc4151","$e407a5ca25d14613$export$2e2bcd8739ae039","onDrag","isDragging","$2f74d86b545ec476$export$65d8bf213f6a4478","dialogPosition","left","innerWidth","top","innerHeight","dragStateOffset","offsetLeft","offsetTop","hasBeenDragged","dialogStyle","visibility","reposition","dialogSize","getBoundingClientRect","handleDragStart","tagName","dataTransfer","setData","dropEffect","effectAllowed","$0ed7988ef29ac9ba$export$712ea50be43a7858","clientX","clientY","handleDragDrop","onResize","parentElement","draggable","onDragStart","$0a82af2c679f148f$export$2e2bcd8739ae039","$6b9d0563b231bc8e$export$8134c072fddab6a5","endpoint","params","method","url","encodeURIComponent","fetch","credentials","body","JSON","stringify","headers","Accept","response","statusText","json","text","$524075ade96a5510$var$setPreference","$524075ade96a5510$export$1de6a888ae076ff8","$524075ade96a5510$export$df984a4ad36be2aa","commandIds","$524075ade96a5510$export$910806e2dc4fd6f4","$0c75c51914774a7a$export$7a6092e2ae7e1845","$a0088a67651538b4$export$e747fdfe1889f28d","$670219d361a1461f$export$6d49ca4503d8331","$0be707f3177806f3$export$27b1eaa2ed0d5a99","$0be707f3177806f3$export$c82e186cf428d56d","$83fa79e240d3a2bb$export$2e2bcd8739ae039","$563cc721c6a67067$export$34b9dba7ce09269b","$694b266eb137553d$export$2e2bcd8739ae039","$450fc775b2f7950e$export$16fa2f45be04daa8","static","shadow","super","i18nRegistry","NeosCMS","I18n","initialized","dragging","searchNeosDocs","handleSearchNeosDocs","searchNeosPackages","handleSearchNeosPackages","preferences","recentDocuments","paramsOrFallback","$524075ade96a5510$exports","getPreferences","$0c75c51914774a7a$exports","getCommands","handleDrag","$a0088a67651538b4$exports","$670219d361a1461f$exports","$450fc775b2f7950e$export$ffb0004e005737fa","styleuri","onDragOver","pointerEvents","propNames","PreactElement","inst","Reflect","construct","HTMLElement","attachShadow","mode","create","observedAttributes","propTypes","customElements","define","topBarLeft","pluginContainer","commandBarStyleTag"],"version":3,"file":"Module.js.map"} \ No newline at end of file +{"mappings":"iGA0BaA,MCfPC,ECRFC,ECyKAC,EAWAC,EAE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ChCxJ,KAAKwJ,OAAOtF,GAAQuR,EACpBzV,KAAKmK,qBAIN,IAAM3L,SAAciX,EAEd,MAALA,GACS,WAATjX,GACS,YAATA,GACS,WAATA,GAEAwB,KAAKgF,aAAad,EAAMuR,SAMrByqB,eAAeC,OACrBnF,GAAWl7B,EAAUk7B,SAAWl7B,EAAUqZ,aAAerZ,EAAUoE,KACnEs7B,EAIF,C+D9CA,CAAS7B,GAAK,KAAM,KAAMA,GAAIpgC,SAE9B47B,OAAOz0B,iBAAiB,4BAA4B,KAEhD,MAAM07B,EAAa74B,SAASmvB,cAAc,sBACpC2J,EAAkB94B,SAAShJ,cAAc,yBAC/C8hC,EAAgBlgB,GAAK,uBAGrB,MAAMmgB,EAAqB/4B,SAASmvB,cAChC,wDAEJ2J,EAAgBr7B,aAAa,WAAYs7B,EAAmBjN,MAE5D+M,EAAW38B,YAAY48B,EAAA,G","sources":["node_modules/preact/src/util.js","node_modules/preact/src/options.js","node_modules/preact/src/create-element.js","node_modules/preact/src/component.js","node_modules/preact/src/create-context.js","node_modules/preact/src/constants.js","node_modules/preact/src/diff/children.js","node_modules/preact/src/diff/props.js","node_modules/preact/src/diff/index.js","node_modules/preact/src/render.js","node_modules/preact/src/clone-element.js","node_modules/preact-custom-element/src/index.js","node_modules/preact/src/diff/catch-error.js","node_modules/preact/jsx-runtime/src/index.js","node_modules/preact/hooks/src/index.js","node_modules/preact/compat/src/util.js","node_modules/preact/compat/src/PureComponent.js","node_modules/preact/compat/src/forwardRef.js","node_modules/preact/compat/src/Children.js","node_modules/preact/compat/src/suspense.js","node_modules/preact/compat/src/suspense-list.js","node_modules/preact/compat/src/portals.js","node_modules/preact/compat/src/render.js","node_modules/preact/compat/src/index.js","node_modules/preact/compat/src/memo.js","packages/commandbar/src/hooks/useFunctionRef.ts","node_modules/@preact/signals-core/src/index.ts","node_modules/@preact/signals/src/index.ts","packages/commandbar/src/helpers/flattenCommands.ts","packages/commandbar/src/helpers/logger.ts","packages/commandbar/src/helpers/clamp.ts","node_modules/@leeoniya/ufuzzy/dist/uFuzzy.esm.js","packages/commandbar/src/helpers/filterCommands.ts","packages/commandbar/src/helpers/asset.ts","packages/commandbar/src/helpers/classnames.ts","packages/commandbar/src/state/commandBarMachine.ts","packages/commandbar/src/state/commandBarReducer.ts","packages/commandbar/src/components/IconWrapper/IconWrapper.tsx","packages/commandbar/src/components/IconWrapper/IconWrapper.module.css","packages/commandbar/src/components/CommandBarFooter/Branding.tsx","packages/commandbar/src/components/CommandBarFooter/Branding.module.css","packages/commandbar/src/components/Icons/IconBack.tsx","packages/commandbar/src/components/Icons/IconNeos.tsx","packages/commandbar/src/components/Icons/IconSpinner.tsx","packages/commandbar/src/components/Icons/IconStar.tsx","packages/commandbar/src/components/Icons/IconPlay.tsx","packages/commandbar/src/components/CommandBarFooter/CommandBarFooter.tsx","packages/commandbar/src/components/CommandBarFooter/CommandBarFooter.module.css","packages/commandbar/src/components/SearchBox/SearchBox.tsx","packages/commandbar/src/components/SearchBox/SearchBox.module.css","packages/commandbar/src/components/CommandBarHeader/CommandBarHeader.tsx","packages/commandbar/src/components/CommandBarHeader/CommandBarHeader.module.css","packages/commandbar/src/components/CommandListItem/CommandListItem.tsx","packages/commandbar/src/components/CommandListItem/CommandListItem.module.css","packages/commandbar/src/components/CommandList/CommandList.tsx","packages/commandbar/src/components/CommandList/CommandListing.module.css","packages/commandbar/src/components/CommandResultsView/CommandResultsView.tsx","packages/commandbar/src/components/CommandResultsView/CommandResultsView.module.css","packages/commandbar/src/components/ToggleButton/ToggleButton.tsx","packages/commandbar/src/components/ToggleButton/ToggleButton.module.css","packages/commandbar/src/state/CommandBarStateProvider.tsx","packages/commandbar/src/state/CommandBarExecutor.tsx","packages/commandbar/src/state/IntlProvider.tsx","packages/commandbar/src/components/CommandBarDialog/CommandBarDialog.tsx","packages/commandbar/src/components/CommandBarDialog/CommandBarDialog.module.css","packages/commandbar/src/CommandBar.tsx","packages/neos-api/src/fetch.ts","packages/neos-api/src/preferences.ts","packages/neos-api/src/commands.ts","packages/neos-api/src/documentation.ts","packages/neos-api/src/packages.ts","packages/module-plugin/src/ModulePlugin.module.css","packages/module-plugin/src/IconComponent.tsx","packages/module-plugin/src/App.tsx","packages/module-plugin/src/index.tsx"],"sourcesContent":["import { EMPTY_ARR } from \"./constants\";\n\n/**\n * Assign properties from `props` to `obj`\n * @template O, P The obj and props types\n * @param {O} obj The object to copy properties to\n * @param {P} props The object to copy properties from\n * @returns {O & P}\n */\nexport function assign(obj, props) {\n\t// @ts-ignore We change the type of `obj` to be `O & P`\n\tfor (let i in props) obj[i] = props[i];\n\treturn /** @type {O & P} */ (obj);\n}\n\n/**\n * Remove a child node from its parent if attached. This is a workaround for\n * IE11 which doesn't support `Element.prototype.remove()`. Using this function\n * is smaller than including a dedicated polyfill.\n * @param {Node} node The node to remove\n */\nexport function removeNode(node) {\n\tlet parentNode = node.parentNode;\n\tif (parentNode) parentNode.removeChild(node);\n}\n\nexport const slice = EMPTY_ARR.slice;\n","import { _catchError } from './diff/catch-error';\n\n/**\n * The `option` object can potentially contain callback functions\n * that are called during various stages of our renderer. This is the\n * foundation on which all our addons like `preact/debug`, `preact/compat`,\n * and `preact/hooks` are based on. See the `Options` type in `internal.d.ts`\n * for a full list of available option hooks (most editors/IDEs allow you to\n * ctrl+click or cmd+click on mac the type definition below).\n * @type {import('./internal').Options}\n */\nconst options = {\n\t_catchError\n};\n\nexport default options;\n","import { slice } from './util';\nimport options from './options';\n\nlet vnodeId = 0;\n\n/**\n * Create an virtual node (used for JSX)\n * @param {import('./internal').VNode[\"type\"]} type The node name or Component\n * constructor for this virtual node\n * @param {object | null | undefined} [props] The properties of the virtual node\n * @param {Array} [children] The children of the virtual node\n * @returns {import('./internal').VNode}\n */\nexport function createElement(type, props, children) {\n\tlet normalizedProps = {},\n\t\tkey,\n\t\tref,\n\t\ti;\n\tfor (i in props) {\n\t\tif (i == 'key') key = props[i];\n\t\telse if (i == 'ref') ref = props[i];\n\t\telse normalizedProps[i] = props[i];\n\t}\n\n\tif (arguments.length > 2) {\n\t\tnormalizedProps.children =\n\t\t\targuments.length > 3 ? slice.call(arguments, 2) : children;\n\t}\n\n\t// If a Component VNode, check for and apply defaultProps\n\t// Note: type may be undefined in development, must never error here.\n\tif (typeof type == 'function' && type.defaultProps != null) {\n\t\tfor (i in type.defaultProps) {\n\t\t\tif (normalizedProps[i] === undefined) {\n\t\t\t\tnormalizedProps[i] = type.defaultProps[i];\n\t\t\t}\n\t\t}\n\t}\n\n\treturn createVNode(type, normalizedProps, key, ref, null);\n}\n\n/**\n * Create a VNode (used internally by Preact)\n * @param {import('./internal').VNode[\"type\"]} type The node name or Component\n * Constructor for this virtual node\n * @param {object | string | number | null} props The properties of this virtual node.\n * If this virtual node represents a text node, this is the text of the node (string or number).\n * @param {string | number | null} key The key for this virtual node, used when\n * diffing it against its children\n * @param {import('./internal').VNode[\"ref\"]} ref The ref property that will\n * receive a reference to its created child\n * @returns {import('./internal').VNode}\n */\nexport function createVNode(type, props, key, ref, original) {\n\t// V8 seems to be better at detecting type shapes if the object is allocated from the same call site\n\t// Do not inline into createElement and coerceToVNode!\n\tconst vnode = {\n\t\ttype,\n\t\tprops,\n\t\tkey,\n\t\tref,\n\t\t_children: null,\n\t\t_parent: null,\n\t\t_depth: 0,\n\t\t_dom: null,\n\t\t// _nextDom must be initialized to undefined b/c it will eventually\n\t\t// be set to dom.nextSibling which can return `null` and it is important\n\t\t// to be able to distinguish between an uninitialized _nextDom and\n\t\t// a _nextDom that has been set to `null`\n\t\t_nextDom: undefined,\n\t\t_component: null,\n\t\t_hydrating: null,\n\t\tconstructor: undefined,\n\t\t_original: original == null ? ++vnodeId : original\n\t};\n\n\t// Only invoke the vnode hook if this was *not* a direct copy:\n\tif (original == null && options.vnode != null) options.vnode(vnode);\n\n\treturn vnode;\n}\n\nexport function createRef() {\n\treturn { current: null };\n}\n\nexport function Fragment(props) {\n\treturn props.children;\n}\n\n/**\n * Check if a the argument is a valid Preact VNode.\n * @param {*} vnode\n * @returns {vnode is import('./internal').VNode}\n */\nexport const isValidElement = vnode =>\n\tvnode != null && vnode.constructor === undefined;\n","import { assign } from './util';\nimport { diff, commitRoot } from './diff/index';\nimport options from './options';\nimport { Fragment } from './create-element';\n\n/**\n * Base Component class. Provides `setState()` and `forceUpdate()`, which\n * trigger rendering\n * @param {object} props The initial component props\n * @param {object} context The initial context from parent components'\n * getChildContext\n */\nexport function Component(props, context) {\n\tthis.props = props;\n\tthis.context = context;\n}\n\n/**\n * Update component state and schedule a re-render.\n * @this {import('./internal').Component}\n * @param {object | ((s: object, p: object) => object)} update A hash of state\n * properties to update with new values or a function that given the current\n * state and props returns a new partial state\n * @param {() => void} [callback] A function to be called once component state is\n * updated\n */\nComponent.prototype.setState = function(update, callback) {\n\t// only clone state when copying to nextState the first time.\n\tlet s;\n\tif (this._nextState != null && this._nextState !== this.state) {\n\t\ts = this._nextState;\n\t} else {\n\t\ts = this._nextState = assign({}, this.state);\n\t}\n\n\tif (typeof update == 'function') {\n\t\t// Some libraries like `immer` mark the current state as readonly,\n\t\t// preventing us from mutating it, so we need to clone it. See #2716\n\t\tupdate = update(assign({}, s), this.props);\n\t}\n\n\tif (update) {\n\t\tassign(s, update);\n\t}\n\n\t// Skip update if updater function returned null\n\tif (update == null) return;\n\n\tif (this._vnode) {\n\t\tif (callback) {\n\t\t\tthis._stateCallbacks.push(callback);\n\t\t}\n\t\tenqueueRender(this);\n\t}\n};\n\n/**\n * Immediately perform a synchronous re-render of the component\n * @this {import('./internal').Component}\n * @param {() => void} [callback] A function to be called after component is\n * re-rendered\n */\nComponent.prototype.forceUpdate = function(callback) {\n\tif (this._vnode) {\n\t\t// Set render mode so that we can differentiate where the render request\n\t\t// is coming from. We need this because forceUpdate should never call\n\t\t// shouldComponentUpdate\n\t\tthis._force = true;\n\t\tif (callback) this._renderCallbacks.push(callback);\n\t\tenqueueRender(this);\n\t}\n};\n\n/**\n * Accepts `props` and `state`, and returns a new Virtual DOM tree to build.\n * Virtual DOM is generally constructed via [JSX](http://jasonformat.com/wtf-is-jsx).\n * @param {object} props Props (eg: JSX attributes) received from parent\n * element/component\n * @param {object} state The component's current state\n * @param {object} context Context object, as returned by the nearest\n * ancestor's `getChildContext()`\n * @returns {import('./index').ComponentChildren | void}\n */\nComponent.prototype.render = Fragment;\n\n/**\n * @param {import('./internal').VNode} vnode\n * @param {number | null} [childIndex]\n */\nexport function getDomSibling(vnode, childIndex) {\n\tif (childIndex == null) {\n\t\t// Use childIndex==null as a signal to resume the search from the vnode's sibling\n\t\treturn vnode._parent\n\t\t\t? getDomSibling(vnode._parent, vnode._parent._children.indexOf(vnode) + 1)\n\t\t\t: null;\n\t}\n\n\tlet sibling;\n\tfor (; childIndex < vnode._children.length; childIndex++) {\n\t\tsibling = vnode._children[childIndex];\n\n\t\tif (sibling != null && sibling._dom != null) {\n\t\t\t// Since updateParentDomPointers keeps _dom pointer correct,\n\t\t\t// we can rely on _dom to tell us if this subtree contains a\n\t\t\t// rendered DOM node, and what the first rendered DOM node is\n\t\t\treturn sibling._dom;\n\t\t}\n\t}\n\n\t// If we get here, we have not found a DOM node in this vnode's children.\n\t// We must resume from this vnode's sibling (in it's parent _children array)\n\t// Only climb up and search the parent if we aren't searching through a DOM\n\t// VNode (meaning we reached the DOM parent of the original vnode that began\n\t// the search)\n\treturn typeof vnode.type == 'function' ? getDomSibling(vnode) : null;\n}\n\n/**\n * Trigger in-place re-rendering of a component.\n * @param {import('./internal').Component} component The component to rerender\n */\nfunction renderComponent(component) {\n\tlet vnode = component._vnode,\n\t\toldDom = vnode._dom,\n\t\tparentDom = component._parentDom;\n\n\tif (parentDom) {\n\t\tlet commitQueue = [];\n\t\tconst oldVNode = assign({}, vnode);\n\t\toldVNode._original = vnode._original + 1;\n\n\t\tdiff(\n\t\t\tparentDom,\n\t\t\tvnode,\n\t\t\toldVNode,\n\t\t\tcomponent._globalContext,\n\t\t\tparentDom.ownerSVGElement !== undefined,\n\t\t\tvnode._hydrating != null ? [oldDom] : null,\n\t\t\tcommitQueue,\n\t\t\toldDom == null ? getDomSibling(vnode) : oldDom,\n\t\t\tvnode._hydrating\n\t\t);\n\t\tcommitRoot(commitQueue, vnode);\n\n\t\tif (vnode._dom != oldDom) {\n\t\t\tupdateParentDomPointers(vnode);\n\t\t}\n\t}\n}\n\n/**\n * @param {import('./internal').VNode} vnode\n */\nfunction updateParentDomPointers(vnode) {\n\tif ((vnode = vnode._parent) != null && vnode._component != null) {\n\t\tvnode._dom = vnode._component.base = null;\n\t\tfor (let i = 0; i < vnode._children.length; i++) {\n\t\t\tlet child = vnode._children[i];\n\t\t\tif (child != null && child._dom != null) {\n\t\t\t\tvnode._dom = vnode._component.base = child._dom;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\treturn updateParentDomPointers(vnode);\n\t}\n}\n\n/**\n * The render queue\n * @type {Array}\n */\nlet rerenderQueue = [];\n\n/*\n * The value of `Component.debounce` must asynchronously invoke the passed in callback. It is\n * important that contributors to Preact can consistently reason about what calls to `setState`, etc.\n * do, and when their effects will be applied. See the links below for some further reading on designing\n * asynchronous APIs.\n * * [Designing APIs for Asynchrony](https://blog.izs.me/2013/08/designing-apis-for-asynchrony)\n * * [Callbacks synchronous and asynchronous](https://blog.ometer.com/2011/07/24/callbacks-synchronous-and-asynchronous/)\n */\n\nlet prevDebounce;\n\nconst defer =\n\ttypeof Promise == 'function'\n\t\t? Promise.prototype.then.bind(Promise.resolve())\n\t\t: setTimeout;\n\n/**\n * Enqueue a rerender of a component\n * @param {import('./internal').Component} c The component to rerender\n */\nexport function enqueueRender(c) {\n\tif (\n\t\t(!c._dirty &&\n\t\t\t(c._dirty = true) &&\n\t\t\trerenderQueue.push(c) &&\n\t\t\t!process._rerenderCount++) ||\n\t\tprevDebounce !== options.debounceRendering\n\t) {\n\t\tprevDebounce = options.debounceRendering;\n\t\t(prevDebounce || defer)(process);\n\t}\n}\n\n/** Flush the render queue by rerendering all queued components */\nfunction process() {\n\tlet c;\n\trerenderQueue.sort((a, b) => a._vnode._depth - b._vnode._depth);\n\t// Don't update `renderCount` yet. Keep its value non-zero to prevent unnecessary\n\t// process() calls from getting scheduled while `queue` is still being consumed.\n\twhile ((c = rerenderQueue.shift())) {\n\t\tif (c._dirty) {\n\t\t\tlet renderQueueLength = rerenderQueue.length;\n\t\t\trenderComponent(c);\n\t\t\tif (rerenderQueue.length > renderQueueLength) {\n\t\t\t\t// When i.e. rerendering a provider additional new items can be injected, we want to\n\t\t\t\t// keep the order from top to bottom with those new items so we can handle them in a\n\t\t\t\t// single pass\n\t\t\t\trerenderQueue.sort((a, b) => a._vnode._depth - b._vnode._depth);\n\t\t\t}\n\t\t}\n\t}\n\tprocess._rerenderCount = 0;\n}\n\nprocess._rerenderCount = 0;\n","import { enqueueRender } from './component';\n\nexport let i = 0;\n\nexport function createContext(defaultValue, contextId) {\n\tcontextId = '__cC' + i++;\n\n\tconst context = {\n\t\t_id: contextId,\n\t\t_defaultValue: defaultValue,\n\t\t/** @type {import('./internal').FunctionComponent} */\n\t\tConsumer(props, contextValue) {\n\t\t\t// return props.children(\n\t\t\t// \tcontext[contextId] ? context[contextId].props.value : defaultValue\n\t\t\t// );\n\t\t\treturn props.children(contextValue);\n\t\t},\n\t\t/** @type {import('./internal').FunctionComponent} */\n\t\tProvider(props) {\n\t\t\tif (!this.getChildContext) {\n\t\t\t\t/** @type {import('./internal').Component[]} */\n\t\t\t\tlet subs = [];\n\t\t\t\tlet ctx = {};\n\t\t\t\tctx[contextId] = this;\n\n\t\t\t\tthis.getChildContext = () => ctx;\n\n\t\t\t\tthis.shouldComponentUpdate = function(_props) {\n\t\t\t\t\tif (this.props.value !== _props.value) {\n\t\t\t\t\t\t// I think the forced value propagation here was only needed when `options.debounceRendering` was being bypassed:\n\t\t\t\t\t\t// https://github.com/preactjs/preact/commit/4d339fb803bea09e9f198abf38ca1bf8ea4b7771#diff-54682ce380935a717e41b8bfc54737f6R358\n\t\t\t\t\t\t// In those cases though, even with the value corrected, we're double-rendering all nodes.\n\t\t\t\t\t\t// It might be better to just tell folks not to use force-sync mode.\n\t\t\t\t\t\t// Currently, using `useContext()` in a class component will overwrite its `this.context` value.\n\t\t\t\t\t\t// subs.some(c => {\n\t\t\t\t\t\t// \tc.context = _props.value;\n\t\t\t\t\t\t// \tenqueueRender(c);\n\t\t\t\t\t\t// });\n\n\t\t\t\t\t\t// subs.some(c => {\n\t\t\t\t\t\t// \tc.context[contextId] = _props.value;\n\t\t\t\t\t\t// \tenqueueRender(c);\n\t\t\t\t\t\t// });\n\t\t\t\t\t\tsubs.some(c => {\n\t\t\t\t\t\t\tc._force = true;\n\t\t\t\t\t\t\tenqueueRender(c);\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t};\n\n\t\t\t\tthis.sub = c => {\n\t\t\t\t\tsubs.push(c);\n\t\t\t\t\tlet old = c.componentWillUnmount;\n\t\t\t\t\tc.componentWillUnmount = () => {\n\t\t\t\t\t\tsubs.splice(subs.indexOf(c), 1);\n\t\t\t\t\t\tif (old) old.call(c);\n\t\t\t\t\t};\n\t\t\t\t};\n\t\t\t}\n\n\t\t\treturn props.children;\n\t\t}\n\t};\n\n\t// Devtools needs access to the context object when it\n\t// encounters a Provider. This is necessary to support\n\t// setting `displayName` on the context object instead\n\t// of on the component itself. See:\n\t// https://reactjs.org/docs/context.html#contextdisplayname\n\n\treturn (context.Provider._contextRef = context.Consumer.contextType = context);\n}\n","export const EMPTY_OBJ = {};\nexport const EMPTY_ARR = [];\nexport const IS_NON_DIMENSIONAL = /acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;\n","import { diff, unmount, applyRef } from './index';\nimport { createVNode, Fragment } from '../create-element';\nimport { EMPTY_OBJ, EMPTY_ARR } from '../constants';\nimport { getDomSibling } from '../component';\n\n/**\n * Diff the children of a virtual node\n * @param {import('../internal').PreactElement} parentDom The DOM element whose\n * children are being diffed\n * @param {import('../internal').ComponentChildren[]} renderResult\n * @param {import('../internal').VNode} newParentVNode The new virtual\n * node whose children should be diff'ed against oldParentVNode\n * @param {import('../internal').VNode} oldParentVNode The old virtual\n * node whose children should be diff'ed against newParentVNode\n * @param {object} globalContext The current context object - modified by getChildContext\n * @param {boolean} isSvg Whether or not this DOM node is an SVG node\n * @param {Array} excessDomChildren\n * @param {Array} commitQueue List of components\n * which have callbacks to invoke in commitRoot\n * @param {import('../internal').PreactElement} oldDom The current attached DOM\n * element any new dom elements should be placed around. Likely `null` on first\n * render (except when hydrating). Can be a sibling DOM element when diffing\n * Fragments that have siblings. In most cases, it starts out as `oldChildren[0]._dom`.\n * @param {boolean} isHydrating Whether or not we are in hydration\n */\nexport function diffChildren(\n\tparentDom,\n\trenderResult,\n\tnewParentVNode,\n\toldParentVNode,\n\tglobalContext,\n\tisSvg,\n\texcessDomChildren,\n\tcommitQueue,\n\toldDom,\n\tisHydrating\n) {\n\tlet i, j, oldVNode, childVNode, newDom, firstChildDom, refs;\n\n\t// This is a compression of oldParentVNode!=null && oldParentVNode != EMPTY_OBJ && oldParentVNode._children || EMPTY_ARR\n\t// as EMPTY_OBJ._children should be `undefined`.\n\tlet oldChildren = (oldParentVNode && oldParentVNode._children) || EMPTY_ARR;\n\n\tlet oldChildrenLength = oldChildren.length;\n\n\tnewParentVNode._children = [];\n\tfor (i = 0; i < renderResult.length; i++) {\n\t\tchildVNode = renderResult[i];\n\n\t\tif (childVNode == null || typeof childVNode == 'boolean') {\n\t\t\tchildVNode = newParentVNode._children[i] = null;\n\t\t}\n\t\t// If this newVNode is being reused (e.g.
{reuse}{reuse}
) in the same diff,\n\t\t// or we are rendering a component (e.g. setState) copy the oldVNodes so it can have\n\t\t// it's own DOM & etc. pointers\n\t\telse if (\n\t\t\ttypeof childVNode == 'string' ||\n\t\t\ttypeof childVNode == 'number' ||\n\t\t\t// eslint-disable-next-line valid-typeof\n\t\t\ttypeof childVNode == 'bigint'\n\t\t) {\n\t\t\tchildVNode = newParentVNode._children[i] = createVNode(\n\t\t\t\tnull,\n\t\t\t\tchildVNode,\n\t\t\t\tnull,\n\t\t\t\tnull,\n\t\t\t\tchildVNode\n\t\t\t);\n\t\t} else if (Array.isArray(childVNode)) {\n\t\t\tchildVNode = newParentVNode._children[i] = createVNode(\n\t\t\t\tFragment,\n\t\t\t\t{ children: childVNode },\n\t\t\t\tnull,\n\t\t\t\tnull,\n\t\t\t\tnull\n\t\t\t);\n\t\t} else if (childVNode._depth > 0) {\n\t\t\t// VNode is already in use, clone it. This can happen in the following\n\t\t\t// scenario:\n\t\t\t// const reuse =
\n\t\t\t//
{reuse}{reuse}
\n\t\t\tchildVNode = newParentVNode._children[i] = createVNode(\n\t\t\t\tchildVNode.type,\n\t\t\t\tchildVNode.props,\n\t\t\t\tchildVNode.key,\n\t\t\t\tchildVNode.ref ? childVNode.ref : null,\n\t\t\t\tchildVNode._original\n\t\t\t);\n\t\t} else {\n\t\t\tchildVNode = newParentVNode._children[i] = childVNode;\n\t\t}\n\n\t\t// Terser removes the `continue` here and wraps the loop body\n\t\t// in a `if (childVNode) { ... } condition\n\t\tif (childVNode == null) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tchildVNode._parent = newParentVNode;\n\t\tchildVNode._depth = newParentVNode._depth + 1;\n\n\t\t// Check if we find a corresponding element in oldChildren.\n\t\t// If found, delete the array item by setting to `undefined`.\n\t\t// We use `undefined`, as `null` is reserved for empty placeholders\n\t\t// (holes).\n\t\toldVNode = oldChildren[i];\n\n\t\tif (\n\t\t\toldVNode === null ||\n\t\t\t(oldVNode &&\n\t\t\t\tchildVNode.key == oldVNode.key &&\n\t\t\t\tchildVNode.type === oldVNode.type)\n\t\t) {\n\t\t\toldChildren[i] = undefined;\n\t\t} else {\n\t\t\t// Either oldVNode === undefined or oldChildrenLength > 0,\n\t\t\t// so after this loop oldVNode == null or oldVNode is a valid value.\n\t\t\tfor (j = 0; j < oldChildrenLength; j++) {\n\t\t\t\toldVNode = oldChildren[j];\n\t\t\t\t// If childVNode is unkeyed, we only match similarly unkeyed nodes, otherwise we match by key.\n\t\t\t\t// We always match by type (in either case).\n\t\t\t\tif (\n\t\t\t\t\toldVNode &&\n\t\t\t\t\tchildVNode.key == oldVNode.key &&\n\t\t\t\t\tchildVNode.type === oldVNode.type\n\t\t\t\t) {\n\t\t\t\t\toldChildren[j] = undefined;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\toldVNode = null;\n\t\t\t}\n\t\t}\n\n\t\toldVNode = oldVNode || EMPTY_OBJ;\n\n\t\t// Morph the old element into the new one, but don't append it to the dom yet\n\t\tdiff(\n\t\t\tparentDom,\n\t\t\tchildVNode,\n\t\t\toldVNode,\n\t\t\tglobalContext,\n\t\t\tisSvg,\n\t\t\texcessDomChildren,\n\t\t\tcommitQueue,\n\t\t\toldDom,\n\t\t\tisHydrating\n\t\t);\n\n\t\tnewDom = childVNode._dom;\n\n\t\tif ((j = childVNode.ref) && oldVNode.ref != j) {\n\t\t\tif (!refs) refs = [];\n\t\t\tif (oldVNode.ref) refs.push(oldVNode.ref, null, childVNode);\n\t\t\trefs.push(j, childVNode._component || newDom, childVNode);\n\t\t}\n\n\t\tif (newDom != null) {\n\t\t\tif (firstChildDom == null) {\n\t\t\t\tfirstChildDom = newDom;\n\t\t\t}\n\n\t\t\tif (\n\t\t\t\ttypeof childVNode.type == 'function' &&\n\t\t\t\tchildVNode._children === oldVNode._children\n\t\t\t) {\n\t\t\t\tchildVNode._nextDom = oldDom = reorderChildren(\n\t\t\t\t\tchildVNode,\n\t\t\t\t\toldDom,\n\t\t\t\t\tparentDom\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\toldDom = placeChild(\n\t\t\t\t\tparentDom,\n\t\t\t\t\tchildVNode,\n\t\t\t\t\toldVNode,\n\t\t\t\t\toldChildren,\n\t\t\t\t\tnewDom,\n\t\t\t\t\toldDom\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tif (typeof newParentVNode.type == 'function') {\n\t\t\t\t// Because the newParentVNode is Fragment-like, we need to set it's\n\t\t\t\t// _nextDom property to the nextSibling of its last child DOM node.\n\t\t\t\t//\n\t\t\t\t// `oldDom` contains the correct value here because if the last child\n\t\t\t\t// is a Fragment-like, then oldDom has already been set to that child's _nextDom.\n\t\t\t\t// If the last child is a DOM VNode, then oldDom will be set to that DOM\n\t\t\t\t// node's nextSibling.\n\t\t\t\tnewParentVNode._nextDom = oldDom;\n\t\t\t}\n\t\t} else if (\n\t\t\toldDom &&\n\t\t\toldVNode._dom == oldDom &&\n\t\t\toldDom.parentNode != parentDom\n\t\t) {\n\t\t\t// The above condition is to handle null placeholders. See test in placeholder.test.js:\n\t\t\t// `efficiently replace null placeholders in parent rerenders`\n\t\t\toldDom = getDomSibling(oldVNode);\n\t\t}\n\t}\n\n\tnewParentVNode._dom = firstChildDom;\n\n\t// Remove remaining oldChildren if there are any.\n\tfor (i = oldChildrenLength; i--; ) {\n\t\tif (oldChildren[i] != null) {\n\t\t\tif (\n\t\t\t\ttypeof newParentVNode.type == 'function' &&\n\t\t\t\toldChildren[i]._dom != null &&\n\t\t\t\toldChildren[i]._dom == newParentVNode._nextDom\n\t\t\t) {\n\t\t\t\t// If the newParentVNode.__nextDom points to a dom node that is about to\n\t\t\t\t// be unmounted, then get the next sibling of that vnode and set\n\t\t\t\t// _nextDom to it\n\t\t\t\tnewParentVNode._nextDom = getLastDom(oldParentVNode).nextSibling;\n\t\t\t}\n\n\t\t\tunmount(oldChildren[i], oldChildren[i]);\n\t\t}\n\t}\n\n\t// Set refs only after unmount\n\tif (refs) {\n\t\tfor (i = 0; i < refs.length; i++) {\n\t\t\tapplyRef(refs[i], refs[++i], refs[++i]);\n\t\t}\n\t}\n}\n\nfunction reorderChildren(childVNode, oldDom, parentDom) {\n\t// Note: VNodes in nested suspended trees may be missing _children.\n\tlet c = childVNode._children;\n\tlet tmp = 0;\n\tfor (; c && tmp < c.length; tmp++) {\n\t\tlet vnode = c[tmp];\n\t\tif (vnode) {\n\t\t\t// We typically enter this code path on sCU bailout, where we copy\n\t\t\t// oldVNode._children to newVNode._children. If that is the case, we need\n\t\t\t// to update the old children's _parent pointer to point to the newVNode\n\t\t\t// (childVNode here).\n\t\t\tvnode._parent = childVNode;\n\n\t\t\tif (typeof vnode.type == 'function') {\n\t\t\t\toldDom = reorderChildren(vnode, oldDom, parentDom);\n\t\t\t} else {\n\t\t\t\toldDom = placeChild(parentDom, vnode, vnode, c, vnode._dom, oldDom);\n\t\t\t}\n\t\t}\n\t}\n\n\treturn oldDom;\n}\n\n/**\n * Flatten and loop through the children of a virtual node\n * @param {import('../index').ComponentChildren} children The unflattened\n * children of a virtual node\n * @returns {import('../internal').VNode[]}\n */\nexport function toChildArray(children, out) {\n\tout = out || [];\n\tif (children == null || typeof children == 'boolean') {\n\t} else if (Array.isArray(children)) {\n\t\tchildren.some(child => {\n\t\t\ttoChildArray(child, out);\n\t\t});\n\t} else {\n\t\tout.push(children);\n\t}\n\treturn out;\n}\n\nfunction placeChild(\n\tparentDom,\n\tchildVNode,\n\toldVNode,\n\toldChildren,\n\tnewDom,\n\toldDom\n) {\n\tlet nextDom;\n\tif (childVNode._nextDom !== undefined) {\n\t\t// Only Fragments or components that return Fragment like VNodes will\n\t\t// have a non-undefined _nextDom. Continue the diff from the sibling\n\t\t// of last DOM child of this child VNode\n\t\tnextDom = childVNode._nextDom;\n\n\t\t// Eagerly cleanup _nextDom. We don't need to persist the value because\n\t\t// it is only used by `diffChildren` to determine where to resume the diff after\n\t\t// diffing Components and Fragments. Once we store it the nextDOM local var, we\n\t\t// can clean up the property\n\t\tchildVNode._nextDom = undefined;\n\t} else if (\n\t\toldVNode == null ||\n\t\tnewDom != oldDom ||\n\t\tnewDom.parentNode == null\n\t) {\n\t\touter: if (oldDom == null || oldDom.parentNode !== parentDom) {\n\t\t\tparentDom.appendChild(newDom);\n\t\t\tnextDom = null;\n\t\t} else {\n\t\t\t// `j= 0; i--) {\n\t\t\tlet child = vnode._children[i];\n\t\t\tif (child) {\n\t\t\t\tlet lastDom = getLastDom(child);\n\t\t\t\tif (lastDom) {\n\t\t\t\t\treturn lastDom;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn null;\n}\n","import { IS_NON_DIMENSIONAL } from '../constants';\nimport options from '../options';\n\n/**\n * Diff the old and new properties of a VNode and apply changes to the DOM node\n * @param {import('../internal').PreactElement} dom The DOM node to apply\n * changes to\n * @param {object} newProps The new props\n * @param {object} oldProps The old props\n * @param {boolean} isSvg Whether or not this node is an SVG node\n * @param {boolean} hydrate Whether or not we are in hydration mode\n */\nexport function diffProps(dom, newProps, oldProps, isSvg, hydrate) {\n\tlet i;\n\n\tfor (i in oldProps) {\n\t\tif (i !== 'children' && i !== 'key' && !(i in newProps)) {\n\t\t\tsetProperty(dom, i, null, oldProps[i], isSvg);\n\t\t}\n\t}\n\n\tfor (i in newProps) {\n\t\tif (\n\t\t\t(!hydrate || typeof newProps[i] == 'function') &&\n\t\t\ti !== 'children' &&\n\t\t\ti !== 'key' &&\n\t\t\ti !== 'value' &&\n\t\t\ti !== 'checked' &&\n\t\t\toldProps[i] !== newProps[i]\n\t\t) {\n\t\t\tsetProperty(dom, i, newProps[i], oldProps[i], isSvg);\n\t\t}\n\t}\n}\n\nfunction setStyle(style, key, value) {\n\tif (key[0] === '-') {\n\t\tstyle.setProperty(key, value == null ? '' : value);\n\t} else if (value == null) {\n\t\tstyle[key] = '';\n\t} else if (typeof value != 'number' || IS_NON_DIMENSIONAL.test(key)) {\n\t\tstyle[key] = value;\n\t} else {\n\t\tstyle[key] = value + 'px';\n\t}\n}\n\n/**\n * Set a property value on a DOM node\n * @param {import('../internal').PreactElement} dom The DOM node to modify\n * @param {string} name The name of the property to set\n * @param {*} value The value to set the property to\n * @param {*} oldValue The old value the property had\n * @param {boolean} isSvg Whether or not this DOM node is an SVG node or not\n */\nexport function setProperty(dom, name, value, oldValue, isSvg) {\n\tlet useCapture;\n\n\to: if (name === 'style') {\n\t\tif (typeof value == 'string') {\n\t\t\tdom.style.cssText = value;\n\t\t} else {\n\t\t\tif (typeof oldValue == 'string') {\n\t\t\t\tdom.style.cssText = oldValue = '';\n\t\t\t}\n\n\t\t\tif (oldValue) {\n\t\t\t\tfor (name in oldValue) {\n\t\t\t\t\tif (!(value && name in value)) {\n\t\t\t\t\t\tsetStyle(dom.style, name, '');\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (value) {\n\t\t\t\tfor (name in value) {\n\t\t\t\t\tif (!oldValue || value[name] !== oldValue[name]) {\n\t\t\t\t\t\tsetStyle(dom.style, name, value[name]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\t// Benchmark for comparison: https://esbench.com/bench/574c954bdb965b9a00965ac6\n\telse if (name[0] === 'o' && name[1] === 'n') {\n\t\tuseCapture = name !== (name = name.replace(/Capture$/, ''));\n\n\t\t// Infer correct casing for DOM built-in events:\n\t\tif (name.toLowerCase() in dom) name = name.toLowerCase().slice(2);\n\t\telse name = name.slice(2);\n\n\t\tif (!dom._listeners) dom._listeners = {};\n\t\tdom._listeners[name + useCapture] = value;\n\n\t\tif (value) {\n\t\t\tif (!oldValue) {\n\t\t\t\tconst handler = useCapture ? eventProxyCapture : eventProxy;\n\t\t\t\tdom.addEventListener(name, handler, useCapture);\n\t\t\t}\n\t\t} else {\n\t\t\tconst handler = useCapture ? eventProxyCapture : eventProxy;\n\t\t\tdom.removeEventListener(name, handler, useCapture);\n\t\t}\n\t} else if (name !== 'dangerouslySetInnerHTML') {\n\t\tif (isSvg) {\n\t\t\t// Normalize incorrect prop usage for SVG:\n\t\t\t// - xlink:href / xlinkHref --> href (xlink:href was removed from SVG and isn't needed)\n\t\t\t// - className --> class\n\t\t\tname = name.replace(/xlink(H|:h)/, 'h').replace(/sName$/, 's');\n\t\t} else if (\n\t\t\tname !== 'width' &&\n\t\t\tname !== 'height' &&\n\t\t\tname !== 'href' &&\n\t\t\tname !== 'list' &&\n\t\t\tname !== 'form' &&\n\t\t\t// Default value in browsers is `-1` and an empty string is\n\t\t\t// cast to `0` instead\n\t\t\tname !== 'tabIndex' &&\n\t\t\tname !== 'download' &&\n\t\t\tname in dom\n\t\t) {\n\t\t\ttry {\n\t\t\t\tdom[name] = value == null ? '' : value;\n\t\t\t\t// labelled break is 1b smaller here than a return statement (sorry)\n\t\t\t\tbreak o;\n\t\t\t} catch (e) {}\n\t\t}\n\n\t\t// ARIA-attributes have a different notion of boolean values.\n\t\t// The value `false` is different from the attribute not\n\t\t// existing on the DOM, so we can't remove it. For non-boolean\n\t\t// ARIA-attributes we could treat false as a removal, but the\n\t\t// amount of exceptions would cost us too many bytes. On top of\n\t\t// that other VDOM frameworks also always stringify `false`.\n\n\t\tif (typeof value === 'function') {\n\t\t\t// never serialize functions as attribute values\n\t\t} else if (value != null && (value !== false || name.indexOf('-') != -1)) {\n\t\t\tdom.setAttribute(name, value);\n\t\t} else {\n\t\t\tdom.removeAttribute(name);\n\t\t}\n\t}\n}\n\n/**\n * Proxy an event to hooked event handlers\n * @param {Event} e The event object from the browser\n * @private\n */\nfunction eventProxy(e) {\n\treturn this._listeners[e.type + false](options.event ? options.event(e) : e);\n}\n\nfunction eventProxyCapture(e) {\n\treturn this._listeners[e.type + true](options.event ? options.event(e) : e);\n}\n","import { EMPTY_OBJ } from '../constants';\nimport { Component, getDomSibling } from '../component';\nimport { Fragment } from '../create-element';\nimport { diffChildren } from './children';\nimport { diffProps, setProperty } from './props';\nimport { assign, removeNode, slice } from '../util';\nimport options from '../options';\n\n/**\n * Diff two virtual nodes and apply proper changes to the DOM\n * @param {import('../internal').PreactElement} parentDom The parent of the DOM element\n * @param {import('../internal').VNode} newVNode The new virtual node\n * @param {import('../internal').VNode} oldVNode The old virtual node\n * @param {object} globalContext The current context object. Modified by getChildContext\n * @param {boolean} isSvg Whether or not this element is an SVG node\n * @param {Array} excessDomChildren\n * @param {Array} commitQueue List of components\n * which have callbacks to invoke in commitRoot\n * @param {import('../internal').PreactElement} oldDom The current attached DOM\n * element any new dom elements should be placed around. Likely `null` on first\n * render (except when hydrating). Can be a sibling DOM element when diffing\n * Fragments that have siblings. In most cases, it starts out as `oldChildren[0]._dom`.\n * @param {boolean} [isHydrating] Whether or not we are in hydration\n */\nexport function diff(\n\tparentDom,\n\tnewVNode,\n\toldVNode,\n\tglobalContext,\n\tisSvg,\n\texcessDomChildren,\n\tcommitQueue,\n\toldDom,\n\tisHydrating\n) {\n\tlet tmp,\n\t\tnewType = newVNode.type;\n\n\t// When passing through createElement it assigns the object\n\t// constructor as undefined. This to prevent JSON-injection.\n\tif (newVNode.constructor !== undefined) return null;\n\n\t// If the previous diff bailed out, resume creating/hydrating.\n\tif (oldVNode._hydrating != null) {\n\t\tisHydrating = oldVNode._hydrating;\n\t\toldDom = newVNode._dom = oldVNode._dom;\n\t\t// if we resume, we want the tree to be \"unlocked\"\n\t\tnewVNode._hydrating = null;\n\t\texcessDomChildren = [oldDom];\n\t}\n\n\tif ((tmp = options._diff)) tmp(newVNode);\n\n\ttry {\n\t\touter: if (typeof newType == 'function') {\n\t\t\tlet c, isNew, oldProps, oldState, snapshot, clearProcessingException;\n\t\t\tlet newProps = newVNode.props;\n\n\t\t\t// Necessary for createContext api. Setting this property will pass\n\t\t\t// the context value as `this.context` just for this component.\n\t\t\ttmp = newType.contextType;\n\t\t\tlet provider = tmp && globalContext[tmp._id];\n\t\t\tlet componentContext = tmp\n\t\t\t\t? provider\n\t\t\t\t\t? provider.props.value\n\t\t\t\t\t: tmp._defaultValue\n\t\t\t\t: globalContext;\n\n\t\t\t// Get component and set it to `c`\n\t\t\tif (oldVNode._component) {\n\t\t\t\tc = newVNode._component = oldVNode._component;\n\t\t\t\tclearProcessingException = c._processingException = c._pendingError;\n\t\t\t} else {\n\t\t\t\t// Instantiate the new component\n\t\t\t\tif ('prototype' in newType && newType.prototype.render) {\n\t\t\t\t\t// @ts-ignore The check above verifies that newType is suppose to be constructed\n\t\t\t\t\tnewVNode._component = c = new newType(newProps, componentContext); // eslint-disable-line new-cap\n\t\t\t\t} else {\n\t\t\t\t\t// @ts-ignore Trust me, Component implements the interface we want\n\t\t\t\t\tnewVNode._component = c = new Component(newProps, componentContext);\n\t\t\t\t\tc.constructor = newType;\n\t\t\t\t\tc.render = doRender;\n\t\t\t\t}\n\t\t\t\tif (provider) provider.sub(c);\n\n\t\t\t\tc.props = newProps;\n\t\t\t\tif (!c.state) c.state = {};\n\t\t\t\tc.context = componentContext;\n\t\t\t\tc._globalContext = globalContext;\n\t\t\t\tisNew = c._dirty = true;\n\t\t\t\tc._renderCallbacks = [];\n\t\t\t\tc._stateCallbacks = [];\n\t\t\t}\n\n\t\t\t// Invoke getDerivedStateFromProps\n\t\t\tif (c._nextState == null) {\n\t\t\t\tc._nextState = c.state;\n\t\t\t}\n\n\t\t\tif (newType.getDerivedStateFromProps != null) {\n\t\t\t\tif (c._nextState == c.state) {\n\t\t\t\t\tc._nextState = assign({}, c._nextState);\n\t\t\t\t}\n\n\t\t\t\tassign(\n\t\t\t\t\tc._nextState,\n\t\t\t\t\tnewType.getDerivedStateFromProps(newProps, c._nextState)\n\t\t\t\t);\n\t\t\t}\n\n\t\t\toldProps = c.props;\n\t\t\toldState = c.state;\n\t\t\tc._vnode = newVNode;\n\n\t\t\t// Invoke pre-render lifecycle methods\n\t\t\tif (isNew) {\n\t\t\t\tif (\n\t\t\t\t\tnewType.getDerivedStateFromProps == null &&\n\t\t\t\t\tc.componentWillMount != null\n\t\t\t\t) {\n\t\t\t\t\tc.componentWillMount();\n\t\t\t\t}\n\n\t\t\t\tif (c.componentDidMount != null) {\n\t\t\t\t\tc._renderCallbacks.push(c.componentDidMount);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (\n\t\t\t\t\tnewType.getDerivedStateFromProps == null &&\n\t\t\t\t\tnewProps !== oldProps &&\n\t\t\t\t\tc.componentWillReceiveProps != null\n\t\t\t\t) {\n\t\t\t\t\tc.componentWillReceiveProps(newProps, componentContext);\n\t\t\t\t}\n\n\t\t\t\tif (\n\t\t\t\t\t(!c._force &&\n\t\t\t\t\t\tc.shouldComponentUpdate != null &&\n\t\t\t\t\t\tc.shouldComponentUpdate(\n\t\t\t\t\t\t\tnewProps,\n\t\t\t\t\t\t\tc._nextState,\n\t\t\t\t\t\t\tcomponentContext\n\t\t\t\t\t\t) === false) ||\n\t\t\t\t\tnewVNode._original === oldVNode._original\n\t\t\t\t) {\n\t\t\t\t\t// More info about this here: https://gist.github.com/JoviDeCroock/bec5f2ce93544d2e6070ef8e0036e4e8\n\t\t\t\t\tif (newVNode._original !== oldVNode._original) {\n\t\t\t\t\t\t// When we are dealing with a bail because of sCU we have to update\n\t\t\t\t\t\t// the props, state and dirty-state.\n\t\t\t\t\t\t// when we are dealing with strict-equality we don't as the child could still\n\t\t\t\t\t\t// be dirtied see #3883\n\t\t\t\t\t\tc.props = newProps;\n\t\t\t\t\t\tc.state = c._nextState;\n\t\t\t\t\t\tc._dirty = false;\n\t\t\t\t\t}\n\n\t\t\t\t\t// In cases of bailing due to strict-equality we have to reset force as well\n\t\t\t\t\tc._force = false;\n\t\t\t\t\tnewVNode._dom = oldVNode._dom;\n\t\t\t\t\tnewVNode._children = oldVNode._children;\n\t\t\t\t\tnewVNode._children.forEach(vnode => {\n\t\t\t\t\t\tif (vnode) vnode._parent = newVNode;\n\t\t\t\t\t});\n\n\t\t\t\t\tfor (let i = 0; i < c._stateCallbacks.length; i++) {\n\t\t\t\t\t\tc._renderCallbacks.push(c._stateCallbacks[i]);\n\t\t\t\t\t}\n\t\t\t\t\tc._stateCallbacks = [];\n\n\t\t\t\t\tif (c._renderCallbacks.length) {\n\t\t\t\t\t\tcommitQueue.push(c);\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak outer;\n\t\t\t\t}\n\n\t\t\t\tif (c.componentWillUpdate != null) {\n\t\t\t\t\tc.componentWillUpdate(newProps, c._nextState, componentContext);\n\t\t\t\t}\n\n\t\t\t\tif (c.componentDidUpdate != null) {\n\t\t\t\t\tc._renderCallbacks.push(() => {\n\t\t\t\t\t\tc.componentDidUpdate(oldProps, oldState, snapshot);\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tc.context = componentContext;\n\t\t\tc.props = newProps;\n\t\t\tc._parentDom = parentDom;\n\n\t\t\tlet renderHook = options._render,\n\t\t\t\tcount = 0;\n\t\t\tif ('prototype' in newType && newType.prototype.render) {\n\t\t\t\tc.state = c._nextState;\n\t\t\t\tc._dirty = false;\n\n\t\t\t\tif (renderHook) renderHook(newVNode);\n\n\t\t\t\ttmp = c.render(c.props, c.state, c.context);\n\n\t\t\t\tfor (let i = 0; i < c._stateCallbacks.length; i++) {\n\t\t\t\t\tc._renderCallbacks.push(c._stateCallbacks[i]);\n\t\t\t\t}\n\t\t\t\tc._stateCallbacks = [];\n\t\t\t} else {\n\t\t\t\tdo {\n\t\t\t\t\tc._dirty = false;\n\t\t\t\t\tif (renderHook) renderHook(newVNode);\n\n\t\t\t\t\ttmp = c.render(c.props, c.state, c.context);\n\n\t\t\t\t\t// Handle setState called in render, see #2553\n\t\t\t\t\tc.state = c._nextState;\n\t\t\t\t} while (c._dirty && ++count < 25);\n\t\t\t}\n\n\t\t\t// Handle setState called in render, see #2553\n\t\t\tc.state = c._nextState;\n\n\t\t\tif (c.getChildContext != null) {\n\t\t\t\tglobalContext = assign(assign({}, globalContext), c.getChildContext());\n\t\t\t}\n\n\t\t\tif (!isNew && c.getSnapshotBeforeUpdate != null) {\n\t\t\t\tsnapshot = c.getSnapshotBeforeUpdate(oldProps, oldState);\n\t\t\t}\n\n\t\t\tlet isTopLevelFragment =\n\t\t\t\ttmp != null && tmp.type === Fragment && tmp.key == null;\n\t\t\tlet renderResult = isTopLevelFragment ? tmp.props.children : tmp;\n\n\t\t\tdiffChildren(\n\t\t\t\tparentDom,\n\t\t\t\tArray.isArray(renderResult) ? renderResult : [renderResult],\n\t\t\t\tnewVNode,\n\t\t\t\toldVNode,\n\t\t\t\tglobalContext,\n\t\t\t\tisSvg,\n\t\t\t\texcessDomChildren,\n\t\t\t\tcommitQueue,\n\t\t\t\toldDom,\n\t\t\t\tisHydrating\n\t\t\t);\n\n\t\t\tc.base = newVNode._dom;\n\n\t\t\t// We successfully rendered this VNode, unset any stored hydration/bailout state:\n\t\t\tnewVNode._hydrating = null;\n\n\t\t\tif (c._renderCallbacks.length) {\n\t\t\t\tcommitQueue.push(c);\n\t\t\t}\n\n\t\t\tif (clearProcessingException) {\n\t\t\t\tc._pendingError = c._processingException = null;\n\t\t\t}\n\n\t\t\tc._force = false;\n\t\t} else if (\n\t\t\texcessDomChildren == null &&\n\t\t\tnewVNode._original === oldVNode._original\n\t\t) {\n\t\t\tnewVNode._children = oldVNode._children;\n\t\t\tnewVNode._dom = oldVNode._dom;\n\t\t} else {\n\t\t\tnewVNode._dom = diffElementNodes(\n\t\t\t\toldVNode._dom,\n\t\t\t\tnewVNode,\n\t\t\t\toldVNode,\n\t\t\t\tglobalContext,\n\t\t\t\tisSvg,\n\t\t\t\texcessDomChildren,\n\t\t\t\tcommitQueue,\n\t\t\t\tisHydrating\n\t\t\t);\n\t\t}\n\n\t\tif ((tmp = options.diffed)) tmp(newVNode);\n\t} catch (e) {\n\t\tnewVNode._original = null;\n\t\t// if hydrating or creating initial tree, bailout preserves DOM:\n\t\tif (isHydrating || excessDomChildren != null) {\n\t\t\tnewVNode._dom = oldDom;\n\t\t\tnewVNode._hydrating = !!isHydrating;\n\t\t\texcessDomChildren[excessDomChildren.indexOf(oldDom)] = null;\n\t\t\t// ^ could possibly be simplified to:\n\t\t\t// excessDomChildren.length = 0;\n\t\t}\n\t\toptions._catchError(e, newVNode, oldVNode);\n\t}\n}\n\n/**\n * @param {Array} commitQueue List of components\n * which have callbacks to invoke in commitRoot\n * @param {import('../internal').VNode} root\n */\nexport function commitRoot(commitQueue, root) {\n\tif (options._commit) options._commit(root, commitQueue);\n\n\tcommitQueue.some(c => {\n\t\ttry {\n\t\t\t// @ts-ignore Reuse the commitQueue variable here so the type changes\n\t\t\tcommitQueue = c._renderCallbacks;\n\t\t\tc._renderCallbacks = [];\n\t\t\tcommitQueue.some(cb => {\n\t\t\t\t// @ts-ignore See above ts-ignore on commitQueue\n\t\t\t\tcb.call(c);\n\t\t\t});\n\t\t} catch (e) {\n\t\t\toptions._catchError(e, c._vnode);\n\t\t}\n\t});\n}\n\n/**\n * Diff two virtual nodes representing DOM element\n * @param {import('../internal').PreactElement} dom The DOM element representing\n * the virtual nodes being diffed\n * @param {import('../internal').VNode} newVNode The new virtual node\n * @param {import('../internal').VNode} oldVNode The old virtual node\n * @param {object} globalContext The current context object\n * @param {boolean} isSvg Whether or not this DOM node is an SVG node\n * @param {*} excessDomChildren\n * @param {Array} commitQueue List of components\n * which have callbacks to invoke in commitRoot\n * @param {boolean} isHydrating Whether or not we are in hydration\n * @returns {import('../internal').PreactElement}\n */\nfunction diffElementNodes(\n\tdom,\n\tnewVNode,\n\toldVNode,\n\tglobalContext,\n\tisSvg,\n\texcessDomChildren,\n\tcommitQueue,\n\tisHydrating\n) {\n\tlet oldProps = oldVNode.props;\n\tlet newProps = newVNode.props;\n\tlet nodeType = newVNode.type;\n\tlet i = 0;\n\n\t// Tracks entering and exiting SVG namespace when descending through the tree.\n\tif (nodeType === 'svg') isSvg = true;\n\n\tif (excessDomChildren != null) {\n\t\tfor (; i < excessDomChildren.length; i++) {\n\t\t\tconst child = excessDomChildren[i];\n\n\t\t\t// if newVNode matches an element in excessDomChildren or the `dom`\n\t\t\t// argument matches an element in excessDomChildren, remove it from\n\t\t\t// excessDomChildren so it isn't later removed in diffChildren\n\t\t\tif (\n\t\t\t\tchild &&\n\t\t\t\t'setAttribute' in child === !!nodeType &&\n\t\t\t\t(nodeType ? child.localName === nodeType : child.nodeType === 3)\n\t\t\t) {\n\t\t\t\tdom = child;\n\t\t\t\texcessDomChildren[i] = null;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\tif (dom == null) {\n\t\tif (nodeType === null) {\n\t\t\t// @ts-ignore createTextNode returns Text, we expect PreactElement\n\t\t\treturn document.createTextNode(newProps);\n\t\t}\n\n\t\tif (isSvg) {\n\t\t\tdom = document.createElementNS(\n\t\t\t\t'http://www.w3.org/2000/svg',\n\t\t\t\t// @ts-ignore We know `newVNode.type` is a string\n\t\t\t\tnodeType\n\t\t\t);\n\t\t} else {\n\t\t\tdom = document.createElement(\n\t\t\t\t// @ts-ignore We know `newVNode.type` is a string\n\t\t\t\tnodeType,\n\t\t\t\tnewProps.is && newProps\n\t\t\t);\n\t\t}\n\n\t\t// we created a new parent, so none of the previously attached children can be reused:\n\t\texcessDomChildren = null;\n\t\t// we are creating a new node, so we can assume this is a new subtree (in case we are hydrating), this deopts the hydrate\n\t\tisHydrating = false;\n\t}\n\n\tif (nodeType === null) {\n\t\t// During hydration, we still have to split merged text from SSR'd HTML.\n\t\tif (oldProps !== newProps && (!isHydrating || dom.data !== newProps)) {\n\t\t\tdom.data = newProps;\n\t\t}\n\t} else {\n\t\t// If excessDomChildren was not null, repopulate it with the current element's children:\n\t\texcessDomChildren = excessDomChildren && slice.call(dom.childNodes);\n\n\t\toldProps = oldVNode.props || EMPTY_OBJ;\n\n\t\tlet oldHtml = oldProps.dangerouslySetInnerHTML;\n\t\tlet newHtml = newProps.dangerouslySetInnerHTML;\n\n\t\t// During hydration, props are not diffed at all (including dangerouslySetInnerHTML)\n\t\t// @TODO we should warn in debug mode when props don't match here.\n\t\tif (!isHydrating) {\n\t\t\t// But, if we are in a situation where we are using existing DOM (e.g. replaceNode)\n\t\t\t// we should read the existing DOM attributes to diff them\n\t\t\tif (excessDomChildren != null) {\n\t\t\t\toldProps = {};\n\t\t\t\tfor (i = 0; i < dom.attributes.length; i++) {\n\t\t\t\t\toldProps[dom.attributes[i].name] = dom.attributes[i].value;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (newHtml || oldHtml) {\n\t\t\t\t// Avoid re-applying the same '__html' if it did not changed between re-render\n\t\t\t\tif (\n\t\t\t\t\t!newHtml ||\n\t\t\t\t\t((!oldHtml || newHtml.__html != oldHtml.__html) &&\n\t\t\t\t\t\tnewHtml.__html !== dom.innerHTML)\n\t\t\t\t) {\n\t\t\t\t\tdom.innerHTML = (newHtml && newHtml.__html) || '';\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tdiffProps(dom, newProps, oldProps, isSvg, isHydrating);\n\n\t\t// If the new vnode didn't have dangerouslySetInnerHTML, diff its children\n\t\tif (newHtml) {\n\t\t\tnewVNode._children = [];\n\t\t} else {\n\t\t\ti = newVNode.props.children;\n\t\t\tdiffChildren(\n\t\t\t\tdom,\n\t\t\t\tArray.isArray(i) ? i : [i],\n\t\t\t\tnewVNode,\n\t\t\t\toldVNode,\n\t\t\t\tglobalContext,\n\t\t\t\tisSvg && nodeType !== 'foreignObject',\n\t\t\t\texcessDomChildren,\n\t\t\t\tcommitQueue,\n\t\t\t\texcessDomChildren\n\t\t\t\t\t? excessDomChildren[0]\n\t\t\t\t\t: oldVNode._children && getDomSibling(oldVNode, 0),\n\t\t\t\tisHydrating\n\t\t\t);\n\n\t\t\t// Remove children that are not part of any vnode.\n\t\t\tif (excessDomChildren != null) {\n\t\t\t\tfor (i = excessDomChildren.length; i--; ) {\n\t\t\t\t\tif (excessDomChildren[i] != null) removeNode(excessDomChildren[i]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// (as above, don't diff props during hydration)\n\t\tif (!isHydrating) {\n\t\t\tif (\n\t\t\t\t'value' in newProps &&\n\t\t\t\t(i = newProps.value) !== undefined &&\n\t\t\t\t// #2756 For the -element the initial value is 0,\n\t\t\t\t// despite the attribute not being present. When the attribute\n\t\t\t\t// is missing the progress bar is treated as indeterminate.\n\t\t\t\t// To fix that we'll always update it when it is 0 for progress elements\n\t\t\t\t(i !== dom.value ||\n\t\t\t\t\t(nodeType === 'progress' && !i) ||\n\t\t\t\t\t// This is only for IE 11 to fix \n\t\tif (\n\t\t\ttype == 'select' &&\n\t\t\tnormalizedProps.multiple &&\n\t\t\tArray.isArray(normalizedProps.value)\n\t\t) {\n\t\t\t// forEach() always returns undefined, which we abuse here to unset the value prop.\n\t\t\tnormalizedProps.value = toChildArray(props.children).forEach(child => {\n\t\t\t\tchild.props.selected =\n\t\t\t\t\tnormalizedProps.value.indexOf(child.props.value) != -1;\n\t\t\t});\n\t\t}\n\n\t\t// Adding support for defaultValue in select tag\n\t\tif (type == 'select' && normalizedProps.defaultValue != null) {\n\t\t\tnormalizedProps.value = toChildArray(props.children).forEach(child => {\n\t\t\t\tif (normalizedProps.multiple) {\n\t\t\t\t\tchild.props.selected =\n\t\t\t\t\t\tnormalizedProps.defaultValue.indexOf(child.props.value) != -1;\n\t\t\t\t} else {\n\t\t\t\t\tchild.props.selected =\n\t\t\t\t\t\tnormalizedProps.defaultValue == child.props.value;\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\n\t\tvnode.props = normalizedProps;\n\n\t\tif (props.class != props.className) {\n\t\t\tclassNameDescriptor.enumerable = 'className' in props;\n\t\t\tif (props.className != null) normalizedProps.class = props.className;\n\t\t\tObject.defineProperty(normalizedProps, 'className', classNameDescriptor);\n\t\t}\n\t}\n\n\tvnode.$$typeof = REACT_ELEMENT_TYPE;\n\n\tif (oldVNodeHook) oldVNodeHook(vnode);\n};\n\n// Only needed for react-relay\nlet currentComponent;\nconst oldBeforeRender = options._render;\noptions._render = function(vnode) {\n\tif (oldBeforeRender) {\n\t\toldBeforeRender(vnode);\n\t}\n\tcurrentComponent = vnode._component;\n};\n\nconst oldDiffed = options.diffed;\n/** @type {(vnode: import('./internal').VNode)} */\noptions.diffed = function(vnode) {\n\tif (oldDiffed) {\n\t\toldDiffed(vnode);\n\t}\n\n\tconst props = vnode.props;\n\tconst dom = vnode._dom;\n\tif (\n\t\tdom != null &&\n\t\tvnode.type === 'textarea' &&\n\t\t'value' in props &&\n\t\tprops.value !== dom.value\n\t) {\n\t\tdom.value = props.value == null ? '' : props.value;\n\t}\n\n\tcurrentComponent = null;\n};\n\n// This is a very very private internal function for React it\n// is used to sort-of do runtime dependency injection. So far\n// only `react-relay` makes use of it. It uses it to read the\n// context value.\nexport const __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = {\n\tReactCurrentDispatcher: {\n\t\tcurrent: {\n\t\t\treadContext(context) {\n\t\t\t\treturn currentComponent._globalContext[context._id].props.value;\n\t\t\t}\n\t\t}\n\t}\n};\n","import {\n\tcreateElement,\n\trender as preactRender,\n\tcloneElement as preactCloneElement,\n\tcreateRef,\n\tComponent,\n\tcreateContext,\n\tFragment\n} from 'preact';\nimport {\n\tuseState,\n\tuseId,\n\tuseReducer,\n\tuseEffect,\n\tuseLayoutEffect,\n\tuseRef,\n\tuseImperativeHandle,\n\tuseMemo,\n\tuseCallback,\n\tuseContext,\n\tuseDebugValue\n} from 'preact/hooks';\nimport { PureComponent } from './PureComponent';\nimport { memo } from './memo';\nimport { forwardRef } from './forwardRef';\nimport { Children } from './Children';\nimport { Suspense, lazy } from './suspense';\nimport { SuspenseList } from './suspense-list';\nimport { createPortal } from './portals';\nimport { is } from './util';\nimport {\n\thydrate,\n\trender,\n\tREACT_ELEMENT_TYPE,\n\t__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED\n} from './render';\n\nconst version = '17.0.2'; // trick libraries to think we are react\n\n/**\n * Legacy version of createElement.\n * @param {import('./internal').VNode[\"type\"]} type The node name or Component constructor\n */\nfunction createFactory(type) {\n\treturn createElement.bind(null, type);\n}\n\n/**\n * Check if the passed element is a valid (p)react node.\n * @param {*} element The element to check\n * @returns {boolean}\n */\nfunction isValidElement(element) {\n\treturn !!element && element.$$typeof === REACT_ELEMENT_TYPE;\n}\n\n/**\n * Wrap `cloneElement` to abort if the passed element is not a valid element and apply\n * all vnode normalizations.\n * @param {import('./internal').VNode} element The vnode to clone\n * @param {object} props Props to add when cloning\n * @param {Array} rest Optional component children\n */\nfunction cloneElement(element) {\n\tif (!isValidElement(element)) return element;\n\treturn preactCloneElement.apply(null, arguments);\n}\n\n/**\n * Remove a component tree from the DOM, including state and event handlers.\n * @param {import('./internal').PreactElement} container\n * @returns {boolean}\n */\nfunction unmountComponentAtNode(container) {\n\tif (container._children) {\n\t\tpreactRender(null, container);\n\t\treturn true;\n\t}\n\treturn false;\n}\n\n/**\n * Get the matching DOM node for a component\n * @param {import('./internal').Component} component\n * @returns {import('./internal').PreactElement | null}\n */\nfunction findDOMNode(component) {\n\treturn (\n\t\t(component &&\n\t\t\t(component.base || (component.nodeType === 1 && component))) ||\n\t\tnull\n\t);\n}\n\n/**\n * Deprecated way to control batched rendering inside the reconciler, but we\n * already schedule in batches inside our rendering code\n * @template Arg\n * @param {(arg: Arg) => void} callback function that triggers the updated\n * @param {Arg} [arg] Optional argument that can be passed to the callback\n */\n// eslint-disable-next-line camelcase\nconst unstable_batchedUpdates = (callback, arg) => callback(arg);\n\n/**\n * In React, `flushSync` flushes the entire tree and forces a rerender. It's\n * implmented here as a no-op.\n * @template Arg\n * @template Result\n * @param {(arg: Arg) => Result} callback function that runs before the flush\n * @param {Arg} [arg] Optional argument that can be passed to the callback\n * @returns\n */\nconst flushSync = (callback, arg) => callback(arg);\n\n/**\n * Strict Mode is not implemented in Preact, so we provide a stand-in for it\n * that just renders its children without imposing any restrictions.\n */\nconst StrictMode = Fragment;\n\nexport function startTransition(cb) {\n\tcb();\n}\n\nexport function useDeferredValue(val) {\n\treturn val;\n}\n\nexport function useTransition() {\n\treturn [false, startTransition];\n}\n\n// TODO: in theory this should be done after a VNode is diffed as we want to insert\n// styles/... before it attaches\nexport const useInsertionEffect = useLayoutEffect;\n\n/**\n * This is taken from https://github.com/facebook/react/blob/main/packages/use-sync-external-store/src/useSyncExternalStoreShimClient.js#L84\n * on a high level this cuts out the warnings, ... and attempts a smaller implementation\n */\nexport function useSyncExternalStore(subscribe, getSnapshot) {\n\tconst value = getSnapshot();\n\n\tconst [{ _instance }, forceUpdate] = useState({\n\t\t_instance: { _value: value, _getSnapshot: getSnapshot }\n\t});\n\n\tuseLayoutEffect(() => {\n\t\t_instance._value = value;\n\t\t_instance._getSnapshot = getSnapshot;\n\n\t\tif (!is(_instance._value, getSnapshot())) {\n\t\t\tforceUpdate({ _instance });\n\t\t}\n\t}, [subscribe, value, getSnapshot]);\n\n\tuseEffect(() => {\n\t\tif (!is(_instance._value, _instance._getSnapshot())) {\n\t\t\tforceUpdate({ _instance });\n\t\t}\n\n\t\treturn subscribe(() => {\n\t\t\tif (!is(_instance._value, _instance._getSnapshot())) {\n\t\t\t\tforceUpdate({ _instance });\n\t\t\t}\n\t\t});\n\t}, [subscribe]);\n\n\treturn value;\n}\n\nexport * from 'preact/hooks';\nexport {\n\tversion,\n\tChildren,\n\trender,\n\thydrate,\n\tunmountComponentAtNode,\n\tcreatePortal,\n\tcreateElement,\n\tcreateContext,\n\tcreateFactory,\n\tcloneElement,\n\tcreateRef,\n\tFragment,\n\tisValidElement,\n\tfindDOMNode,\n\tComponent,\n\tPureComponent,\n\tmemo,\n\tforwardRef,\n\tflushSync,\n\t// eslint-disable-next-line camelcase\n\tunstable_batchedUpdates,\n\tStrictMode,\n\tSuspense,\n\tSuspenseList,\n\tlazy,\n\t__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED\n};\n\n// React copies the named exports to the default one.\nexport default {\n\tuseState,\n\tuseId,\n\tuseReducer,\n\tuseEffect,\n\tuseLayoutEffect,\n\tuseInsertionEffect,\n\tuseTransition,\n\tuseDeferredValue,\n\tuseSyncExternalStore,\n\tstartTransition,\n\tuseRef,\n\tuseImperativeHandle,\n\tuseMemo,\n\tuseCallback,\n\tuseContext,\n\tuseDebugValue,\n\tversion,\n\tChildren,\n\trender,\n\thydrate,\n\tunmountComponentAtNode,\n\tcreatePortal,\n\tcreateElement,\n\tcreateContext,\n\tcreateFactory,\n\tcloneElement,\n\tcreateRef,\n\tFragment,\n\tisValidElement,\n\tfindDOMNode,\n\tComponent,\n\tPureComponent,\n\tmemo,\n\tforwardRef,\n\tflushSync,\n\tunstable_batchedUpdates,\n\tStrictMode,\n\tSuspense,\n\tSuspenseList,\n\tlazy,\n\t__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED\n};\n","import { createElement } from 'preact';\nimport { shallowDiffers } from './util';\n\n/**\n * Memoize a component, so that it only updates when the props actually have\n * changed. This was previously known as `React.pure`.\n * @param {import('./internal').FunctionComponent} c functional component\n * @param {(prev: object, next: object) => boolean} [comparer] Custom equality function\n * @returns {import('./internal').FunctionComponent}\n */\nexport function memo(c, comparer) {\n\tfunction shouldUpdate(nextProps) {\n\t\tlet ref = this.props.ref;\n\t\tlet updateRef = ref == nextProps.ref;\n\t\tif (!updateRef && ref) {\n\t\t\tref.call ? ref(null) : (ref.current = null);\n\t\t}\n\n\t\tif (!comparer) {\n\t\t\treturn shallowDiffers(this.props, nextProps);\n\t\t}\n\n\t\treturn !comparer(this.props, nextProps) || !updateRef;\n\t}\n\n\tfunction Memoed(props) {\n\t\tthis.shouldComponentUpdate = shouldUpdate;\n\t\treturn createElement(c, props);\n\t}\n\tMemoed.displayName = 'Memo(' + (c.displayName || c.name) + ')';\n\tMemoed.prototype.isReactComponent = true;\n\tMemoed._forwarded = true;\n\treturn Memoed;\n}\n","import { useRef } from 'react';\n\n/**\n * A custom hook that creates a ref for a function, and updates it on every render.\n * The new value is always the same function, but the function's context changes on every render.\n */\nexport default function useFunctionRef(fn) {\n const fnRef = useRef(fn);\n fnRef.current = fn;\n return fnRef;\n}\n","function cycleDetected(): never {\n\tthrow new Error(\"Cycle detected\");\n}\n\n// Flags for Computed and Effect.\nconst RUNNING = 1 << 0;\nconst NOTIFIED = 1 << 1;\nconst OUTDATED = 1 << 2;\nconst DISPOSED = 1 << 3;\nconst HAS_ERROR = 1 << 4;\nconst TRACKING = 1 << 5;\n\n// A linked list node used to track dependencies (sources) and dependents (targets).\n// Also used to remember the source's last version number that the target saw.\ntype Node = {\n\t// A source whose value the target depends on.\n\t_source: Signal;\n\t_prevSource?: Node;\n\t_nextSource?: Node;\n\n\t// A target that depends on the source and should be notified when the source changes.\n\t_target: Computed | Effect;\n\t_prevTarget?: Node;\n\t_nextTarget?: Node;\n\n\t// The version number of the source that target has last seen. We use version numbers\n\t// instead of storing the source value, because source values can take arbitrary amount\n\t// of memory, and computeds could hang on to them forever because they're lazily evaluated.\n\t// Use the special value -1 to mark potentially unused but recyclable nodes.\n\t_version: number;\n\n\t// Used to remember & roll back the source's previous `._node` value when entering &\n\t// exiting a new evaluation context.\n\t_rollbackNode?: Node;\n};\n\nfunction startBatch() {\n\tbatchDepth++;\n}\n\nfunction endBatch() {\n\tif (batchDepth > 1) {\n\t\tbatchDepth--;\n\t\treturn;\n\t}\n\n\tlet error: unknown;\n\tlet hasError = false;\n\n\twhile (batchedEffect !== undefined) {\n\t\tlet effect: Effect | undefined = batchedEffect;\n\t\tbatchedEffect = undefined;\n\n\t\tbatchIteration++;\n\n\t\twhile (effect !== undefined) {\n\t\t\tconst next: Effect | undefined = effect._nextBatchedEffect;\n\t\t\teffect._nextBatchedEffect = undefined;\n\t\t\teffect._flags &= ~NOTIFIED;\n\n\t\t\tif (!(effect._flags & DISPOSED) && needsToRecompute(effect)) {\n\t\t\t\ttry {\n\t\t\t\t\teffect._callback();\n\t\t\t\t} catch (err) {\n\t\t\t\t\tif (!hasError) {\n\t\t\t\t\t\terror = err;\n\t\t\t\t\t\thasError = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\teffect = next;\n\t\t}\n\t}\n\tbatchIteration = 0;\n\tbatchDepth--;\n\n\tif (hasError) {\n\t\tthrow error;\n\t}\n}\n\nfunction batch(callback: () => T): T {\n\tif (batchDepth > 0) {\n\t\treturn callback();\n\t}\n\t/*@__INLINE__**/ startBatch();\n\ttry {\n\t\treturn callback();\n\t} finally {\n\t\tendBatch();\n\t}\n}\n\n// Currently evaluated computed or effect.\nlet evalContext: Computed | Effect | undefined = undefined;\n\n// Effects collected into a batch.\nlet batchedEffect: Effect | undefined = undefined;\nlet batchDepth = 0;\nlet batchIteration = 0;\n\n// A global version number for signals, used for fast-pathing repeated\n// computed.peek()/computed.value calls when nothing has changed globally.\nlet globalVersion = 0;\n\nfunction addDependency(signal: Signal): Node | undefined {\n\tif (evalContext === undefined) {\n\t\treturn undefined;\n\t}\n\n\tlet node = signal._node;\n\tif (node === undefined || node._target !== evalContext) {\n\t\t/**\n\t\t * `signal` is a new dependency. Create a new dependency node, and set it\n\t\t * as the tail of the current context's dependency list. e.g:\n\t\t *\n\t\t * { A <-> B }\n\t\t * ↑ ↑\n\t\t * tail node (new)\n\t\t * ↓\n\t\t * { A <-> B <-> C }\n\t\t * ↑\n\t\t * tail (evalContext._sources)\n\t\t */\n\t\tnode = {\n\t\t\t_version: 0,\n\t\t\t_source: signal,\n\t\t\t_prevSource: evalContext._sources,\n\t\t\t_nextSource: undefined,\n\t\t\t_target: evalContext,\n\t\t\t_prevTarget: undefined,\n\t\t\t_nextTarget: undefined,\n\t\t\t_rollbackNode: node,\n\t\t};\n\n\t\tif (evalContext._sources !== undefined) {\n\t\t\tevalContext._sources._nextSource = node;\n\t\t}\n\t\tevalContext._sources = node;\n\t\tsignal._node = node;\n\n\t\t// Subscribe to change notifications from this dependency if we're in an effect\n\t\t// OR evaluating a computed signal that in turn has subscribers.\n\t\tif (evalContext._flags & TRACKING) {\n\t\t\tsignal._subscribe(node);\n\t\t}\n\t\treturn node;\n\t} else if (node._version === -1) {\n\t\t// `signal` is an existing dependency from a previous evaluation. Reuse it.\n\t\tnode._version = 0;\n\n\t\t/**\n\t\t * If `node` is not already the current tail of the dependency list (i.e.\n\t\t * there is a next node in the list), then make the `node` the new tail. e.g:\n\t\t *\n\t\t * { A <-> B <-> C <-> D }\n\t\t * ↑ ↑\n\t\t * node ┌─── tail (evalContext._sources)\n\t\t * └─────│─────┐\n\t\t * ↓ ↓\n\t\t * { A <-> C <-> D <-> B }\n\t\t * ↑\n\t\t * tail (evalContext._sources)\n\t\t */\n\t\tif (node._nextSource !== undefined) {\n\t\t\tnode._nextSource._prevSource = node._prevSource;\n\n\t\t\tif (node._prevSource !== undefined) {\n\t\t\t\tnode._prevSource._nextSource = node._nextSource;\n\t\t\t}\n\n\t\t\tnode._prevSource = evalContext._sources;\n\t\t\tnode._nextSource = undefined;\n\n\t\t\tevalContext._sources!._nextSource = node;\n\t\t\tevalContext._sources = node;\n\t\t}\n\n\t\t// We can assume that the currently evaluated effect / computed signal is already\n\t\t// subscribed to change notifications from `signal` if needed.\n\t\treturn node;\n\t}\n\treturn undefined;\n}\n\ndeclare class Signal {\n\t/** @internal */\n\t_value: unknown;\n\n\t/**\n\t * @internal\n\t * Version numbers should always be >= 0, because the special value -1 is used\n\t * by Nodes to signify potentially unused but recyclable nodes.\n\t */\n\t_version: number;\n\n\t/** @internal */\n\t_node?: Node;\n\n\t/** @internal */\n\t_targets?: Node;\n\n\tconstructor(value?: T);\n\n\t/** @internal */\n\t_refresh(): boolean;\n\n\t/** @internal */\n\t_subscribe(node: Node): void;\n\n\t/** @internal */\n\t_unsubscribe(node: Node): void;\n\n\tsubscribe(fn: (value: T) => void): () => void;\n\n\tvalueOf(): T;\n\n\ttoString(): string;\n\n\tpeek(): T;\n\n\tget value(): T;\n\tset value(value: T);\n}\n\n/** @internal */\nfunction Signal(this: Signal, value?: unknown) {\n\tthis._value = value;\n\tthis._version = 0;\n\tthis._node = undefined;\n\tthis._targets = undefined;\n}\n\nSignal.prototype._refresh = function () {\n\treturn true;\n};\n\nSignal.prototype._subscribe = function (node) {\n\tif (this._targets !== node && node._prevTarget === undefined) {\n\t\tnode._nextTarget = this._targets;\n\t\tif (this._targets !== undefined) {\n\t\t\tthis._targets._prevTarget = node;\n\t\t}\n\t\tthis._targets = node;\n\t}\n};\n\nSignal.prototype._unsubscribe = function (node) {\n\t// Only run the unsubscribe step if the signal has any subscribers to begin with.\n\tif (this._targets !== undefined) {\n\t\tconst prev = node._prevTarget;\n\t\tconst next = node._nextTarget;\n\t\tif (prev !== undefined) {\n\t\t\tprev._nextTarget = next;\n\t\t\tnode._prevTarget = undefined;\n\t\t}\n\t\tif (next !== undefined) {\n\t\t\tnext._prevTarget = prev;\n\t\t\tnode._nextTarget = undefined;\n\t\t}\n\t\tif (node === this._targets) {\n\t\t\tthis._targets = next;\n\t\t}\n\t}\n};\n\nSignal.prototype.subscribe = function (fn) {\n\tconst signal = this;\n\treturn effect(function (this: Effect) {\n\t\tconst value = signal.value;\n\t\tconst flag = this._flags & TRACKING;\n\t\tthis._flags &= ~TRACKING;\n\t\ttry {\n\t\t\tfn(value);\n\t\t} finally {\n\t\t\tthis._flags |= flag;\n\t\t}\n\t});\n};\n\nSignal.prototype.valueOf = function () {\n\treturn this.value;\n};\n\nSignal.prototype.toString = function () {\n\treturn this.value + \"\";\n};\n\nSignal.prototype.peek = function () {\n\treturn this._value;\n};\n\nObject.defineProperty(Signal.prototype, \"value\", {\n\tget() {\n\t\tconst node = addDependency(this);\n\t\tif (node !== undefined) {\n\t\t\tnode._version = this._version;\n\t\t}\n\t\treturn this._value;\n\t},\n\tset(value) {\n\t\tif (value !== this._value) {\n\t\t\tif (batchIteration > 100) {\n\t\t\t\tcycleDetected();\n\t\t\t}\n\n\t\t\tthis._value = value;\n\t\t\tthis._version++;\n\t\t\tglobalVersion++;\n\n\t\t\t/**@__INLINE__*/ startBatch();\n\t\t\ttry {\n\t\t\t\tfor (\n\t\t\t\t\tlet node = this._targets;\n\t\t\t\t\tnode !== undefined;\n\t\t\t\t\tnode = node._nextTarget\n\t\t\t\t) {\n\t\t\t\t\tnode._target._notify();\n\t\t\t\t}\n\t\t\t} finally {\n\t\t\t\tendBatch();\n\t\t\t}\n\t\t}\n\t},\n});\n\nfunction signal(value: T): Signal {\n\treturn new Signal(value);\n}\n\nfunction needsToRecompute(target: Computed | Effect): boolean {\n\t// Check the dependencies for changed values. The dependency list is already\n\t// in order of use. Therefore if multiple dependencies have changed values, only\n\t// the first used dependency is re-evaluated at this point.\n\tfor (\n\t\tlet node = target._sources;\n\t\tnode !== undefined;\n\t\tnode = node._nextSource\n\t) {\n\t\t// If there's a new version of the dependency before or after refreshing,\n\t\t// or the dependency has something blocking it from refreshing at all (e.g. a\n\t\t// dependency cycle), then we need to recompute.\n\t\tif (\n\t\t\tnode._source._version !== node._version ||\n\t\t\t!node._source._refresh() ||\n\t\t\tnode._source._version !== node._version\n\t\t) {\n\t\t\treturn true;\n\t\t}\n\t}\n\t// If none of the dependencies have changed values since last recompute then\n\t// there's no need to recompute.\n\treturn false;\n}\n\nfunction prepareSources(target: Computed | Effect) {\n\t/**\n\t * 1. Mark all current sources as re-usable nodes (version: -1)\n\t * 2. Set a rollback node if the current node is being used in a different context\n\t * 3. Point 'target._sources' to the tail of the doubly-linked list, e.g:\n\t *\n\t * { undefined <- A <-> B <-> C -> undefined }\n\t * ↑ ↑\n\t * │ └──────┐\n\t * target._sources = A; (node is head) │\n\t * ↓ │\n\t * target._sources = C; (node is tail) ─┘\n\t */\n\tfor (\n\t\tlet node = target._sources;\n\t\tnode !== undefined;\n\t\tnode = node._nextSource\n\t) {\n\t\tconst rollbackNode = node._source._node;\n\t\tif (rollbackNode !== undefined) {\n\t\t\tnode._rollbackNode = rollbackNode;\n\t\t}\n\t\tnode._source._node = node;\n\t\tnode._version = -1;\n\n\t\tif (node._nextSource === undefined) {\n\t\t\ttarget._sources = node;\n\t\t\tbreak;\n\t\t}\n\t}\n}\n\nfunction cleanupSources(target: Computed | Effect) {\n\tlet node = target._sources;\n\tlet head = undefined;\n\n\t/**\n\t * At this point 'target._sources' points to the tail of the doubly-linked list.\n\t * It contains all existing sources + new sources in order of use.\n\t * Iterate backwards until we find the head node while dropping old dependencies.\n\t */\n\twhile (node !== undefined) {\n\t\tconst prev = node._prevSource;\n\n\t\t/**\n\t\t * The node was not re-used, unsubscribe from its change notifications and remove itself\n\t\t * from the doubly-linked list. e.g:\n\t\t *\n\t\t * { A <-> B <-> C }\n\t\t * ↓\n\t\t * { A <-> C }\n\t\t */\n\t\tif (node._version === -1) {\n\t\t\tnode._source._unsubscribe(node);\n\n\t\t\tif (prev !== undefined) {\n\t\t\t\tprev._nextSource = node._nextSource;\n\t\t\t}\n\t\t\tif (node._nextSource !== undefined) {\n\t\t\t\tnode._nextSource._prevSource = prev;\n\t\t\t}\n\t\t} else {\n\t\t\t/**\n\t\t\t * The new head is the last node seen which wasn't removed/unsubscribed\n\t\t\t * from the doubly-linked list. e.g:\n\t\t\t *\n\t\t\t * { A <-> B <-> C }\n\t\t\t * ↑ ↑ ↑\n\t\t\t * │ │ └ head = node\n\t\t\t * │ └ head = node\n\t\t\t * └ head = node\n\t\t\t */\n\t\t\thead = node;\n\t\t}\n\n\t\tnode._source._node = node._rollbackNode;\n\t\tif (node._rollbackNode !== undefined) {\n\t\t\tnode._rollbackNode = undefined;\n\t\t}\n\n\t\tnode = prev;\n\t}\n\n\ttarget._sources = head;\n}\n\ndeclare class Computed extends Signal {\n\t_compute: () => T;\n\t_sources?: Node;\n\t_globalVersion: number;\n\t_flags: number;\n\n\tconstructor(compute: () => T);\n\n\t_notify(): void;\n\tget value(): T;\n}\n\nfunction Computed(this: Computed, compute: () => unknown) {\n\tSignal.call(this, undefined);\n\n\tthis._compute = compute;\n\tthis._sources = undefined;\n\tthis._globalVersion = globalVersion - 1;\n\tthis._flags = OUTDATED;\n}\n\nComputed.prototype = new Signal() as Computed;\n\nComputed.prototype._refresh = function () {\n\tthis._flags &= ~NOTIFIED;\n\n\tif (this._flags & RUNNING) {\n\t\treturn false;\n\t}\n\n\t// If this computed signal has subscribed to updates from its dependencies\n\t// (TRACKING flag set) and none of them have notified about changes (OUTDATED\n\t// flag not set), then the computed value can't have changed.\n\tif ((this._flags & (OUTDATED | TRACKING)) === TRACKING) {\n\t\treturn true;\n\t}\n\tthis._flags &= ~OUTDATED;\n\n\tif (this._globalVersion === globalVersion) {\n\t\treturn true;\n\t}\n\tthis._globalVersion = globalVersion;\n\n\t// Mark this computed signal running before checking the dependencies for value\n\t// changes, so that the RUNNING flag can be used to notice cyclical dependencies.\n\tthis._flags |= RUNNING;\n\tif (this._version > 0 && !needsToRecompute(this)) {\n\t\tthis._flags &= ~RUNNING;\n\t\treturn true;\n\t}\n\n\tconst prevContext = evalContext;\n\ttry {\n\t\tprepareSources(this);\n\t\tevalContext = this;\n\t\tconst value = this._compute();\n\t\tif (\n\t\t\tthis._flags & HAS_ERROR ||\n\t\t\tthis._value !== value ||\n\t\t\tthis._version === 0\n\t\t) {\n\t\t\tthis._value = value;\n\t\t\tthis._flags &= ~HAS_ERROR;\n\t\t\tthis._version++;\n\t\t}\n\t} catch (err) {\n\t\tthis._value = err;\n\t\tthis._flags |= HAS_ERROR;\n\t\tthis._version++;\n\t}\n\tevalContext = prevContext;\n\tcleanupSources(this);\n\tthis._flags &= ~RUNNING;\n\treturn true;\n};\n\nComputed.prototype._subscribe = function (node) {\n\tif (this._targets === undefined) {\n\t\tthis._flags |= OUTDATED | TRACKING;\n\n\t\t// A computed signal subscribes lazily to its dependencies when the it\n\t\t// gets its first subscriber.\n\t\tfor (\n\t\t\tlet node = this._sources;\n\t\t\tnode !== undefined;\n\t\t\tnode = node._nextSource\n\t\t) {\n\t\t\tnode._source._subscribe(node);\n\t\t}\n\t}\n\tSignal.prototype._subscribe.call(this, node);\n};\n\nComputed.prototype._unsubscribe = function (node) {\n\t// Only run the unsubscribe step if the computed signal has any subscribers.\n\tif (this._targets !== undefined) {\n\t\tSignal.prototype._unsubscribe.call(this, node);\n\n\t\t// Computed signal unsubscribes from its dependencies when it loses its last subscriber.\n\t\t// This makes it possible for unreferences subgraphs of computed signals to get garbage collected.\n\t\tif (this._targets === undefined) {\n\t\t\tthis._flags &= ~TRACKING;\n\n\t\t\tfor (\n\t\t\t\tlet node = this._sources;\n\t\t\t\tnode !== undefined;\n\t\t\t\tnode = node._nextSource\n\t\t\t) {\n\t\t\t\tnode._source._unsubscribe(node);\n\t\t\t}\n\t\t}\n\t}\n};\n\nComputed.prototype._notify = function () {\n\tif (!(this._flags & NOTIFIED)) {\n\t\tthis._flags |= OUTDATED | NOTIFIED;\n\n\t\tfor (\n\t\t\tlet node = this._targets;\n\t\t\tnode !== undefined;\n\t\t\tnode = node._nextTarget\n\t\t) {\n\t\t\tnode._target._notify();\n\t\t}\n\t}\n};\n\nComputed.prototype.peek = function () {\n\tif (!this._refresh()) {\n\t\tcycleDetected();\n\t}\n\tif (this._flags & HAS_ERROR) {\n\t\tthrow this._value;\n\t}\n\treturn this._value;\n};\n\nObject.defineProperty(Computed.prototype, \"value\", {\n\tget() {\n\t\tif (this._flags & RUNNING) {\n\t\t\tcycleDetected();\n\t\t}\n\t\tconst node = addDependency(this);\n\t\tthis._refresh();\n\t\tif (node !== undefined) {\n\t\t\tnode._version = this._version;\n\t\t}\n\t\tif (this._flags & HAS_ERROR) {\n\t\t\tthrow this._value;\n\t\t}\n\t\treturn this._value;\n\t},\n});\n\ninterface ReadonlySignal extends Signal {\n\treadonly value: T;\n}\n\nfunction computed(compute: () => T): ReadonlySignal {\n\treturn new Computed(compute);\n}\n\nfunction cleanupEffect(effect: Effect) {\n\tconst cleanup = effect._cleanup;\n\teffect._cleanup = undefined;\n\n\tif (typeof cleanup === \"function\") {\n\t\t/*@__INLINE__**/ startBatch();\n\n\t\t// Run cleanup functions always outside of any context.\n\t\tconst prevContext = evalContext;\n\t\tevalContext = undefined;\n\t\ttry {\n\t\t\tcleanup();\n\t\t} catch (err) {\n\t\t\teffect._flags &= ~RUNNING;\n\t\t\teffect._flags |= DISPOSED;\n\t\t\tdisposeEffect(effect);\n\t\t\tthrow err;\n\t\t} finally {\n\t\t\tevalContext = prevContext;\n\t\t\tendBatch();\n\t\t}\n\t}\n}\n\nfunction disposeEffect(effect: Effect) {\n\tfor (\n\t\tlet node = effect._sources;\n\t\tnode !== undefined;\n\t\tnode = node._nextSource\n\t) {\n\t\tnode._source._unsubscribe(node);\n\t}\n\teffect._compute = undefined;\n\teffect._sources = undefined;\n\n\tcleanupEffect(effect);\n}\n\nfunction endEffect(this: Effect, prevContext?: Computed | Effect) {\n\tif (evalContext !== this) {\n\t\tthrow new Error(\"Out-of-order effect\");\n\t}\n\tcleanupSources(this);\n\tevalContext = prevContext;\n\n\tthis._flags &= ~RUNNING;\n\tif (this._flags & DISPOSED) {\n\t\tdisposeEffect(this);\n\t}\n\tendBatch();\n}\n\ndeclare class Effect {\n\t_compute?: () => unknown;\n\t_cleanup?: unknown;\n\t_sources?: Node;\n\t_nextBatchedEffect?: Effect;\n\t_flags: number;\n\n\tconstructor(compute: () => void);\n\n\t_callback(): void;\n\t_start(): () => void;\n\t_notify(): void;\n\t_dispose(): void;\n}\n\nfunction Effect(this: Effect, compute: () => void) {\n\tthis._compute = compute;\n\tthis._cleanup = undefined;\n\tthis._sources = undefined;\n\tthis._nextBatchedEffect = undefined;\n\tthis._flags = TRACKING;\n}\n\nEffect.prototype._callback = function () {\n\tconst finish = this._start();\n\ttry {\n\t\tif (!(this._flags & DISPOSED) && this._compute !== undefined) {\n\t\t\tthis._cleanup = this._compute();\n\t\t}\n\t} finally {\n\t\tfinish();\n\t}\n};\n\nEffect.prototype._start = function () {\n\tif (this._flags & RUNNING) {\n\t\tcycleDetected();\n\t}\n\tthis._flags |= RUNNING;\n\tthis._flags &= ~DISPOSED;\n\tcleanupEffect(this);\n\tprepareSources(this);\n\n\t/*@__INLINE__**/ startBatch();\n\tconst prevContext = evalContext;\n\tevalContext = this;\n\treturn endEffect.bind(this, prevContext);\n};\n\nEffect.prototype._notify = function () {\n\tif (!(this._flags & NOTIFIED)) {\n\t\tthis._flags |= NOTIFIED;\n\t\tthis._nextBatchedEffect = batchedEffect;\n\t\tbatchedEffect = this;\n\t}\n};\n\nEffect.prototype._dispose = function () {\n\tthis._flags |= DISPOSED;\n\n\tif (!(this._flags & RUNNING)) {\n\t\tdisposeEffect(this);\n\t}\n};\n\nfunction effect(compute: () => unknown): () => void {\n\tconst effect = new Effect(compute);\n\ttry {\n\t\teffect._callback();\n\t} catch (err) {\n\t\teffect._dispose();\n\t\tthrow err;\n\t}\n\t// Return a bound function instead of a wrapper like `() => effect._dispose()`,\n\t// because bound functions seem to be just as fast and take up a lot less memory.\n\treturn effect._dispose.bind(effect);\n}\n\nexport { signal, computed, effect, batch, Signal, ReadonlySignal };\n","import { options, Component } from \"preact\";\nimport { useRef, useMemo, useEffect } from \"preact/hooks\";\nimport {\n\tsignal,\n\tcomputed,\n\tbatch,\n\teffect,\n\tSignal,\n\ttype ReadonlySignal,\n} from \"@preact/signals-core\";\nimport {\n\tVNode,\n\tOptionsTypes,\n\tHookFn,\n\tEffect,\n\tPropertyUpdater,\n\tAugmentedComponent,\n\tAugmentedElement as Element,\n} from \"./internal\";\n\nexport { signal, computed, batch, effect, Signal, type ReadonlySignal };\n\nconst HAS_PENDING_UPDATE = 1 << 0;\nconst HAS_HOOK_STATE = 1 << 1;\nconst HAS_COMPUTEDS = 1 << 2;\n\n// Install a Preact options hook\nfunction hook(hookName: T, hookFn: HookFn) {\n\t// @ts-ignore-next-line private options hooks usage\n\toptions[hookName] = hookFn.bind(null, options[hookName] || (() => {}));\n}\n\nlet currentComponent: AugmentedComponent | undefined;\nlet finishUpdate: (() => void) | undefined;\n\nfunction setCurrentUpdater(updater?: Effect) {\n\t// end tracking for the current update:\n\tif (finishUpdate) finishUpdate();\n\t// start tracking the new update:\n\tfinishUpdate = updater && updater._start();\n}\n\nfunction createUpdater(update: () => void) {\n\tlet updater!: Effect;\n\teffect(function (this: Effect) {\n\t\tupdater = this;\n\t});\n\tupdater._callback = update;\n\treturn updater;\n}\n\n/** @todo This may be needed for complex prop value detection. */\n// function isSignalValue(value: any): value is Signal {\n// \tif (typeof value !== \"object\" || value == null) return false;\n// \tif (value instanceof Signal) return true;\n// \t// @TODO: uncomment this when we land Reactive (ideally behind a brand check)\n// \t// for (let i in value) if (value[i] instanceof Signal) return true;\n// \treturn false;\n// }\n\n/**\n * A wrapper component that renders a Signal directly as a Text node.\n * @todo: in Preact 11, just decorate Signal with `type:null`\n */\nfunction Text(this: AugmentedComponent, { data }: { data: Signal }) {\n\t// hasComputeds.add(this);\n\n\t// Store the props.data signal in another signal so that\n\t// passing a new signal reference re-runs the text computed:\n\tconst currentSignal = useSignal(data);\n\tcurrentSignal.value = data;\n\n\tconst s = useMemo(() => {\n\t\t// mark the parent component as having computeds so it gets optimized\n\t\tlet v = this.__v;\n\t\twhile ((v = v.__!)) {\n\t\t\tif (v.__c) {\n\t\t\t\tv.__c._updateFlags |= HAS_COMPUTEDS;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\t// Replace this component's vdom updater with a direct text one:\n\t\tthis._updater!._callback = () => {\n\t\t\t(this.base as Text).data = s.peek();\n\t\t};\n\n\t\treturn computed(() => {\n\t\t\tlet data = currentSignal.value;\n\t\t\tlet s = data.value;\n\t\t\treturn s === 0 ? 0 : s === true ? \"\" : s || \"\";\n\t\t});\n\t}, []);\n\n\treturn s.value;\n}\nText.displayName = \"_st\";\n\nObject.defineProperties(Signal.prototype, {\n\tconstructor: { configurable: true, value: undefined },\n\ttype: { configurable: true, value: Text },\n\tprops: {\n\t\tconfigurable: true,\n\t\tget() {\n\t\t\treturn { data: this };\n\t\t},\n\t},\n\t// Setting a VNode's _depth to 1 forces Preact to clone it before modifying:\n\t// https://github.com/preactjs/preact/blob/d7a433ee8463a7dc23a05111bb47de9ec729ad4d/src/diff/children.js#L77\n\t// @todo remove this for Preact 11\n\t__b: { configurable: true, value: 1 },\n});\n\n/** Inject low-level property/attribute bindings for Signals into Preact's diff */\nhook(OptionsTypes.DIFF, (old, vnode) => {\n\tif (typeof vnode.type === \"string\") {\n\t\tlet signalProps: Record | undefined;\n\n\t\tlet props = vnode.props;\n\t\tfor (let i in props) {\n\t\t\tif (i === \"children\") continue;\n\n\t\t\tlet value = props[i];\n\t\t\tif (value instanceof Signal) {\n\t\t\t\tif (!signalProps) vnode.__np = signalProps = {};\n\t\t\t\tsignalProps[i] = value;\n\t\t\t\tprops[i] = value.peek();\n\t\t\t}\n\t\t}\n\t}\n\n\told(vnode);\n});\n\n/** Set up Updater before rendering a component */\nhook(OptionsTypes.RENDER, (old, vnode) => {\n\tsetCurrentUpdater();\n\n\tlet updater;\n\n\tlet component = vnode.__c;\n\tif (component) {\n\t\tcomponent._updateFlags &= ~HAS_PENDING_UPDATE;\n\n\t\tupdater = component._updater;\n\t\tif (updater === undefined) {\n\t\t\tcomponent._updater = updater = createUpdater(() => {\n\t\t\t\tcomponent._updateFlags |= HAS_PENDING_UPDATE;\n\t\t\t\tcomponent.setState({});\n\t\t\t});\n\t\t}\n\t}\n\n\tcurrentComponent = component;\n\tsetCurrentUpdater(updater);\n\told(vnode);\n});\n\n/** Finish current updater if a component errors */\nhook(OptionsTypes.CATCH_ERROR, (old, error, vnode, oldVNode) => {\n\tsetCurrentUpdater();\n\tcurrentComponent = undefined;\n\told(error, vnode, oldVNode);\n});\n\n/** Finish current updater after rendering any VNode */\nhook(OptionsTypes.DIFFED, (old, vnode) => {\n\tsetCurrentUpdater();\n\tcurrentComponent = undefined;\n\n\tlet dom: Element;\n\n\t// vnode._dom is undefined during string rendering,\n\t// so we use this to skip prop subscriptions during SSR.\n\tif (typeof vnode.type === \"string\" && (dom = vnode.__e as Element)) {\n\t\tlet props = vnode.__np;\n\t\tlet renderedProps = vnode.props;\n\t\tif (props) {\n\t\t\tlet updaters = dom._updaters;\n\t\t\tif (updaters) {\n\t\t\t\tfor (let prop in updaters) {\n\t\t\t\t\tlet updater = updaters[prop];\n\t\t\t\t\tif (updater !== undefined && !(prop in props)) {\n\t\t\t\t\t\tupdater._dispose();\n\t\t\t\t\t\t// @todo we could just always invoke _dispose() here\n\t\t\t\t\t\tupdaters[prop] = undefined;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tupdaters = {};\n\t\t\t\tdom._updaters = updaters;\n\t\t\t}\n\t\t\tfor (let prop in props) {\n\t\t\t\tlet updater = updaters[prop];\n\t\t\t\tlet signal = props[prop];\n\t\t\t\tif (updater === undefined) {\n\t\t\t\t\tupdater = createPropUpdater(dom, prop, signal, renderedProps);\n\t\t\t\t\tupdaters[prop] = updater;\n\t\t\t\t} else {\n\t\t\t\t\tupdater._update(signal, renderedProps);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\told(vnode);\n});\n\nfunction createPropUpdater(\n\tdom: Element,\n\tprop: string,\n\tpropSignal: Signal,\n\tprops: Record\n): PropertyUpdater {\n\tconst setAsProperty =\n\t\tprop in dom &&\n\t\t// SVG elements need to go through `setAttribute` because they\n\t\t// expect things like SVGAnimatedTransformList instead of strings.\n\t\t// @ts-ignore\n\t\tdom.ownerSVGElement === undefined;\n\n\tconst changeSignal = signal(propSignal);\n\treturn {\n\t\t_update: (newSignal: Signal, newProps: typeof props) => {\n\t\t\tchangeSignal.value = newSignal;\n\t\t\tprops = newProps;\n\t\t},\n\t\t_dispose: effect(() => {\n\t\t\tconst value = changeSignal.value.value;\n\t\t\t// If Preact just rendered this value, don't render it again:\n\t\t\tif (props[prop] === value) return;\n\t\t\tprops[prop] = value;\n\t\t\tif (setAsProperty) {\n\t\t\t\t// @ts-ignore-next-line silly\n\t\t\t\tdom[prop] = value;\n\t\t\t} else if (value) {\n\t\t\t\tdom.setAttribute(prop, value);\n\t\t\t} else {\n\t\t\t\tdom.removeAttribute(prop);\n\t\t\t}\n\t\t}),\n\t};\n}\n\n/** Unsubscribe from Signals when unmounting components/vnodes */\nhook(OptionsTypes.UNMOUNT, (old, vnode: VNode) => {\n\tif (typeof vnode.type === \"string\") {\n\t\tlet dom = vnode.__e as Element | undefined;\n\t\t// vnode._dom is undefined during string rendering\n\t\tif (dom) {\n\t\t\tconst updaters = dom._updaters;\n\t\t\tif (updaters) {\n\t\t\t\tdom._updaters = undefined;\n\t\t\t\tfor (let prop in updaters) {\n\t\t\t\t\tlet updater = updaters[prop];\n\t\t\t\t\tif (updater) updater._dispose();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t} else {\n\t\tlet component = vnode.__c;\n\t\tif (component) {\n\t\t\tconst updater = component._updater;\n\t\t\tif (updater) {\n\t\t\t\tcomponent._updater = undefined;\n\t\t\t\tupdater._dispose();\n\t\t\t}\n\t\t}\n\t}\n\told(vnode);\n});\n\n/** Mark components that use hook state so we can skip sCU optimization. */\nhook(OptionsTypes.HOOK, (old, component, index, type) => {\n\tif (type < 3)\n\t\t(component as AugmentedComponent)._updateFlags |= HAS_HOOK_STATE;\n\told(component, index, type);\n});\n\n/**\n * Auto-memoize components that use Signals/Computeds.\n * Note: Does _not_ optimize components that use hook/class state.\n */\nComponent.prototype.shouldComponentUpdate = function (\n\tthis: AugmentedComponent,\n\tprops,\n\tstate\n) {\n\t// @todo: Once preactjs/preact#3671 lands, this could just use `currentUpdater`:\n\tconst updater = this._updater;\n\tconst hasSignals = updater && updater._sources !== undefined;\n\n\t// let reason;\n\t// if (!hasSignals && !hasComputeds.has(this)) {\n\t// \treason = \"no signals or computeds\";\n\t// } else if (hasPendingUpdate.has(this)) {\n\t// \treason = \"has pending update\";\n\t// } else if (hasHookState.has(this)) {\n\t// \treason = \"has hook state\";\n\t// }\n\t// if (reason) {\n\t// \tif (!this) reason += \" (`this` bug)\";\n\t// \tconsole.log(\"not optimizing\", this?.constructor?.name, \": \", reason, {\n\t// \t\tdetails: {\n\t// \t\t\thasSignals,\n\t// \t\t\thasComputeds: hasComputeds.has(this),\n\t// \t\t\thasPendingUpdate: hasPendingUpdate.has(this),\n\t// \t\t\thasHookState: hasHookState.has(this),\n\t// \t\t\tdeps: Array.from(updater._deps),\n\t// \t\t\tupdater,\n\t// \t\t},\n\t// \t});\n\t// }\n\n\t// if this component used no signals or computeds, update:\n\tif (!hasSignals && !(this._updateFlags & HAS_COMPUTEDS)) return true;\n\n\t// if there is a pending re-render triggered from Signals,\n\t// or if there is hook or class state, update:\n\tif (this._updateFlags & (HAS_PENDING_UPDATE | HAS_HOOK_STATE)) return true;\n\n\t// @ts-ignore\n\tfor (let i in state) return true;\n\n\t// if any non-Signal props changed, update:\n\tfor (let i in props) {\n\t\tif (i !== \"__source\" && props[i] !== this.props[i]) return true;\n\t}\n\tfor (let i in this.props) if (!(i in props)) return true;\n\n\t// this is a purely Signal-driven component, don't update:\n\treturn false;\n};\n\nexport function useSignal(value: T) {\n\treturn useMemo(() => signal(value), []);\n}\n\nexport function useComputed(compute: () => T) {\n\tconst $compute = useRef(compute);\n\t$compute.current = compute;\n\t(currentComponent as AugmentedComponent)._updateFlags |= HAS_COMPUTEDS;\n\treturn useMemo(() => computed(() => $compute.current()), []);\n}\n\nexport function useSignalEffect(cb: () => void | (() => void)) {\n\tconst callback = useRef(cb);\n\tcallback.current = cb;\n\n\tuseEffect(() => {\n\t\treturn effect(() => callback.current());\n\t}, []);\n}\n\n/**\n * @todo Determine which Reactive implementation we'll be using.\n * @internal\n */\n// export function useReactive(value: T): Reactive {\n// \treturn useMemo(() => reactive(value), []);\n// }\n\n/**\n * @internal\n * Update a Reactive's using the properties of an object or other Reactive.\n * Also works for Signals.\n * @example\n * // Update a Reactive with Object.assign()-like syntax:\n * const r = reactive({ name: \"Alice\" });\n * update(r, { name: \"Bob\" });\n * update(r, { age: 42 }); // property 'age' does not exist in type '{ name?: string }'\n * update(r, 2); // '2' has no properties in common with '{ name?: string }'\n * console.log(r.name.value); // \"Bob\"\n *\n * @example\n * // Update a Reactive with the properties of another Reactive:\n * const A = reactive({ name: \"Alice\" });\n * const B = reactive({ name: \"Bob\", age: 42 });\n * update(A, B);\n * console.log(`${A.name} is ${A.age}`); // \"Bob is 42\"\n *\n * @example\n * // Update a signal with assign()-like syntax:\n * const s = signal(42);\n * update(s, \"hi\"); // Argument type 'string' not assignable to type 'number'\n * update(s, {}); // Argument type '{}' not assignable to type 'number'\n * update(s, 43);\n * console.log(s.value); // 43\n *\n * @param obj The Reactive or Signal to be updated\n * @param update The value, Signal, object or Reactive to update `obj` to match\n * @param overwrite If `true`, any properties `obj` missing from `update` are set to `undefined`\n */\n/*\nexport function update(\n\tobj: T,\n\tupdate: Partial>,\n\toverwrite = false\n) {\n\tif (obj instanceof Signal) {\n\t\tobj.value = peekValue(update);\n\t} else {\n\t\tfor (let i in update) {\n\t\t\tif (i in obj) {\n\t\t\t\tobj[i].value = peekValue(update[i]);\n\t\t\t} else {\n\t\t\t\tlet sig = signal(peekValue(update[i]));\n\t\t\t\tsig[KEY] = i;\n\t\t\t\tobj[i] = sig;\n\t\t\t}\n\t\t}\n\t\tif (overwrite) {\n\t\t\tfor (let i in obj) {\n\t\t\t\tif (!(i in update)) {\n\t\t\t\t\tobj[i].value = undefined;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n*/\n","/**\n * This method converts the hierarchical command list into a flat list of commands which is more convenient\n * for internal processing, whereas the hierarchical command list is more convenient for the user.\n */\nexport default function flattenCommands(\n commands: HierarchicalCommandList,\n parentId: CommandId = null\n): FlatCommandList {\n return Object.keys(commands).reduce((commandList, commandId) => {\n const {\n icon,\n description,\n name,\n subCommands,\n action,\n canHandleQueries,\n closeOnExecute,\n category,\n executeManually,\n } = commands[commandId] as Command & CommandGroup;\n\n // Create an uniquely identifiable command id for the flat command list\n const absoluteCommandId = parentId ? `${parentId}.${commandId}` : commandId;\n\n // Create list of available subcommand names\n const subCommandIds = subCommands\n ? Object.keys(subCommands).map((subCommandId) => `${absoluteCommandId}.${subCommandId}`)\n : [];\n\n // Insert the processed command into the flat command list\n commandList[absoluteCommandId] = {\n id: absoluteCommandId,\n name,\n icon,\n description,\n action,\n canHandleQueries,\n subCommandIds,\n parentId,\n closeOnExecute,\n category,\n executeManually,\n };\n\n // Insert subcommands into the list\n if (subCommandIds.length > 0) {\n return {\n ...commandList,\n ...flattenCommands(subCommands, absoluteCommandId),\n };\n }\n return commandList;\n }, {} as FlatCommandList);\n}\n","const PREFIX = '%c[COMMANDBAR]';\n\nconst logger = {\n ok: (message: string, ...args: any[]) => console.log(PREFIX, 'color: green', message, ...args),\n error: (message: string, ...args: any[]) => console.log(PREFIX, 'color: red', message, ...args),\n warn: (message: string, ...args: any[]) => console.warn(PREFIX, 'color: orange', message, ...args),\n debug:\n // @ts-ignore\n process.env.NODE_ENV === 'production'\n ? () => null\n : (message: string, ...args: any[]) => console.debug(PREFIX, 'color: lightblue', message, ...args),\n};\n\nexport default logger;\n","export default function clamp(value: number, min: number, max: number): number {\n return Math.max(min, Math.min(max, value));\n}\n","/**\n* Copyright (c) 2023, Leon Sorokin\n* All rights reserved. (MIT Licensed)\n*\n* uFuzzy.js (μFuzzy)\n* A tiny, efficient fuzzy matcher that doesn't suck\n* https://github.com/leeoniya/uFuzzy (v1.0.3)\n*/\n\nconst cmp = new Intl.Collator('en').compare;\n\nconst inf = Infinity;\n\nconst NEGS_RE = /(?:\\s+|^)-[a-z\\d]+/ig;\n\nconst OPTS = {\n\t// term segmentation & punct/whitespace merging\n\tinterSplit: \"[^A-Za-z0-9']+\",\n\tintraSplit: '[a-z][A-Z]',\n\n\t// intra bounds that will be used to increase lft1/rgt1 info counters\n\tintraBound: '[A-Za-z][0-9]|[0-9][A-Za-z]|[a-z][A-Z]',\n\n\t// inter-bounds mode\n\t// 2 = strict (will only match 'man' on whitepace and punct boundaries: Mega Man, Mega_Man, mega.man)\n\t// 1 = loose (plus allowance for alpha-num and case-change boundaries: MegaMan, 0007man)\n\t// 0 = any (will match 'man' as any substring: megamaniac)\n\tinterLft: 0,\n\tinterRgt: 0,\n\n\t// allowance between terms\n\tinterChars: '.',\n\tinterIns: inf,\n\n\t// allowance between chars in terms\n\tintraChars: \"[a-z\\\\d']\", // internally case-insensitive\n\tintraIns: 0,\n\n\tintraContr: \"'[a-z]{1,2}\\\\b\",\n\n\t// multi-insert or single-error mode\n\tintraMode: 0,\n\n\t// single-error bounds for errors within terms, default requires exact first char\n\tintraSlice: [1, inf],\n\n\t// single-error tolerance toggles\n\tintraSub: 0,\n\tintraTrn: 0,\n\tintraDel: 0,\n\n\t// can post-filter matches that are too far apart in distance or length\n\t// (since intraIns is between each char, it can accum to nonsense matches)\n\tintraFilt: (term, match, index) => true, // should this also accept WIP info?\n\n\t// final sorting fn\n\tsort: (info, haystack, needle) => {\n\t\tlet {\n\t\t\tidx,\n\t\t\tchars,\n\t\t\tterms,\n\t\t\tinterLft2,\n\t\t\tinterLft1,\n\t\t//\tinterRgt2,\n\t\t//\tinterRgt1,\n\t\t\tstart,\n\t\t\tintraIns,\n\t\t\tinterIns,\n\t\t} = info;\n\n\t\treturn idx.map((v, i) => i).sort((ia, ib) => (\n\t\t\t// most contig chars matched\n\t\t\tchars[ib] - chars[ia] ||\n\t\t\t// least char intra-fuzz (most contiguous)\n\t\t\tintraIns[ia] - intraIns[ib] ||\n\t\t\t// most prefix bounds, boosted by full term matches\n\t\t\t(\n\t\t\t\t(terms[ib] + interLft2[ib] + 0.5 * interLft1[ib]) -\n\t\t\t\t(terms[ia] + interLft2[ia] + 0.5 * interLft1[ia])\n\t\t\t) ||\n\t\t\t// highest density of match (least span)\n\t\t//\tspan[ia] - span[ib] ||\n\t\t\t// highest density of match (least term inter-fuzz)\n\t\t\tinterIns[ia] - interIns[ib] ||\n\t\t\t// earliest start of match\n\t\t\tstart[ia] - start[ib] ||\n\t\t\t// alphabetic\n\t\t\tcmp(haystack[idx[ia]], haystack[idx[ib]])\n\t\t));\n\t},\n};\n\nconst lazyRepeat = (chars, limit) => (\n\tlimit == 0 ? '' :\n\tlimit == 1 ? chars + '??' :\n\tlimit == inf ? chars + '*?' :\n\t chars + `{0,${limit}}?`\n);\n\nconst mode2Tpl = '(?:\\\\b|_)';\n\nfunction uFuzzy(opts) {\n\topts = Object.assign({}, OPTS, opts);\n\n\tconst {\n\t\tinterLft,\n\t\tinterRgt,\n\t\tintraMode,\n\t\tintraSlice,\n\t\tintraIns,\n\t\tintraSub,\n\t\tintraTrn,\n\t\tintraDel,\n\t\tintraContr,\n\t\tintraSplit: _intraSplit,\n\t\tinterSplit: _interSplit,\n\t\tintraBound: _intraBound,\n\t\tintraChars,\n\t} = opts;\n\n\tlet { intraRules } = opts;\n\n\tif (intraRules == null) {\n\t\tintraRules = p => {\n\t\t\t// default is exact term matches only\n\t\t\tlet _intraSlice = OPTS.intraSlice, // requires first char\n\t\t\t\t_intraIns = 0,\n\t\t\t\t_intraSub = 0,\n\t\t\t\t_intraTrn = 0,\n\t\t\t\t_intraDel = 0;\n\n\t\t\tlet plen = p.length;\n\n\t\t\t// prevent junk matches by requiring stricter rules for short terms\n\t\t\tif (plen <= 4) {\n\t\t\t\tif (plen >= 3) {\n\t\t\t\t\t// one swap in non-first char when 3-4 chars\n\t\t\t\t\t_intraTrn = Math.min(intraTrn, 1);\n\n\t\t\t\t\t// or one insertion when 4 chars\n\t\t\t\t\tif (plen == 4)\n\t\t\t\t\t\t_intraIns = Math.min(intraIns, 1);\n\t\t\t\t}\n\t\t\t\t// else exact match when 1-2 chars\n\t\t\t}\n\t\t\t// use supplied opts\n\t\t\telse {\n\t\t\t\t_intraSlice = intraSlice;\n\t\t\t\t_intraIns = intraIns,\n\t\t\t\t_intraSub = intraSub,\n\t\t\t\t_intraTrn = intraTrn,\n\t\t\t\t_intraDel = intraDel;\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\tintraSlice: _intraSlice,\n\t\t\t\tintraIns: _intraIns,\n\t\t\t\tintraSub: _intraSub,\n\t\t\t\tintraTrn: _intraTrn,\n\t\t\t\tintraDel: _intraDel,\n\t\t\t};\n\t\t};\n\t}\n\n\tlet withIntraSplit = !!_intraSplit;\n\n\tlet intraSplit = new RegExp(_intraSplit, 'g');\n\tlet interSplit = new RegExp(_interSplit, 'g');\n\n\tlet trimRe = new RegExp('^' + _interSplit + '|' + _interSplit + '$', 'g');\n\tlet contrsRe = new RegExp(intraContr, 'gi');\n\n\tconst split = needle => {\n\t\tneedle = needle.replace(trimRe, '').toLowerCase();\n\n\t\tif (withIntraSplit)\n\t\t\tneedle = needle.replace(intraSplit, m => m[0] + ' ' + m[1]);\n\n\t\treturn needle.split(interSplit).filter(t => t != '');\n\t};\n\n\tconst prepQuery = (needle, capt = 0, interOR = false) => {\n\t\t// split on punct, whitespace, num-alpha, and upper-lower boundaries\n\t\tlet parts = split(needle);\n\n\t\tif (parts.length == 0)\n\t\t\tthrow `Empty needle!`;\n\n\t\t// split out any detected contractions for each term that become required suffixes\n\t\tlet contrs = Array(parts.length).fill('');\n\t\tparts = parts.map((p, pi) => p.replace(contrsRe, m => {\n\t\t\tcontrs[pi] = m;\n\t\t\treturn '';\n\t\t}));\n\n\t\t// array of regexp tpls for each term\n\t\tlet reTpl;\n\n\t\t// allows single mutations within each term\n\t\tif (intraMode == 1) {\n\t\t\treTpl = parts.map((p, pi) => {\n\t\t\t\tlet {\n\t\t\t\t\tintraSlice,\n\t\t\t\t\tintraIns,\n\t\t\t\t\tintraSub,\n\t\t\t\t\tintraTrn,\n\t\t\t\t\tintraDel,\n\t\t\t\t} = intraRules(p);\n\n\t\t\t\tif (intraIns + intraSub + intraTrn + intraDel == 0)\n\t\t\t\t\treturn p + contrs[pi];\n\n\t\t\t\tlet [lftIdx, rgtIdx] = intraSlice;\n\t\t\t\tlet lftChar = p.slice(0, lftIdx); // prefix\n\t\t\t\tlet rgtChar = p.slice(rgtIdx); // suffix\n\n\t\t\t\tlet chars = p.slice(lftIdx, rgtIdx);\n\n\t\t\t\t// neg lookahead to prefer matching 'Test' instead of 'tTest' in ManifestTest or fittest\n\t\t\t\t// but skip when search term contains leading repetition (aardvark, aaa)\n\t\t\t\tif (intraIns == 1 && lftChar.length == 1 && lftChar != chars[0])\n\t\t\t\t\tlftChar += '(?!' + lftChar + ')';\n\n\t\t\t\tlet numChars = chars.length;\n\n\t\t\t\tlet variants = [];\n\n\t\t\t\t// variants with single char substitutions\n\t\t\t\tif (intraSub) {\n\t\t\t\t\tfor (let i = 0; i < numChars; i++)\n\t\t\t\t\t\tvariants.push(lftChar + chars.slice(0, i) + intraChars + chars.slice(i + 1) + rgtChar);\n\t\t\t\t}\n\n\t\t\t\t// variants with single transpositions\n\t\t\t\tif (intraTrn) {\n\t\t\t\t\tfor (let i = 0; i < numChars - 1; i++) {\n\t\t\t\t\t\tif (chars[i] != chars[i+1])\n\t\t\t\t\t\t\tvariants.push(lftChar + chars.slice(0, i) + chars[i+1] + chars[i] + chars.slice(i + 2) + rgtChar);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// variants with single char omissions\n\t\t\t\tif (intraDel) {\n\t\t\t\t\tfor (let i = 0; i < numChars; i++)\n\t\t\t\t\t\tvariants.push(lftChar + chars.slice(0, i + 1) + '?' + chars.slice(i + 1) + rgtChar);\n\t\t\t\t}\n\n\t\t\t\t// variants with single char insertions\n\t\t\t\tif (intraIns) {\n\t\t\t\t\tlet intraInsTpl = lazyRepeat(intraChars, 1);\n\n\t\t\t\t\tfor (let i = 0; i < numChars; i++)\n\t\t\t\t\t\tvariants.push(lftChar + chars.slice(0, i) + intraInsTpl + chars.slice(i) + rgtChar);\n\t\t\t\t}\n\n\t\t\t\tlet reTpl = '(?:' + p + '|' + variants.join('|') + ')' + contrs[pi];\n\n\t\t\t//\tconsole.log(reTpl);\n\n\t\t\t\treturn reTpl;\n\t\t\t});\n\t\t}\n\t\telse {\n\t\t\tlet intraInsTpl = lazyRepeat(intraChars, intraIns);\n\n\t\t\t// capture at char level\n\t\t\tif (capt == 2 && intraIns > 0) {\n\t\t\t\t// sadly, we also have to capture the inter-term junk via parenth-wrapping .*?\n\t\t\t\t// to accum other capture groups' indices for \\b boosting during scoring\n\t\t\t\tintraInsTpl = ')(' + intraInsTpl + ')(';\n\t\t\t}\n\n\t\t\treTpl = parts.map((p, pi) => p.split('').map((c, i, chars) => {\n\t\t\t\t// neg lookahead to prefer matching 'Test' instead of 'tTest' in ManifestTest or fittest\n\t\t\t\t// but skip when search term contains leading repetition (aardvark, aaa)\n\t\t\t\tif (intraIns == 1 && i == 0 && chars.length > 1 && c[i] != c[i+1])\n\t\t\t\t\tc += '(?!' + c + ')';\n\n\t\t\t\treturn c;\n\t\t\t}).join(intraInsTpl) + contrs[pi]);\n\t\t}\n\n\t//\tconsole.log(reTpl);\n\n\t\t// this only helps to reduce initial matches early when they can be detected\n\t\t// TODO: might want a mode 3 that excludes _\n\t\tlet preTpl = interLft == 2 ? mode2Tpl : '';\n\t\tlet sufTpl = interRgt == 2 ? mode2Tpl : '';\n\n\t\tlet interCharsTpl = sufTpl + lazyRepeat(opts.interChars, opts.interIns) + preTpl;\n\n\t\t// capture at word level\n\t\tif (capt > 0) {\n\t\t\tif (interOR) {\n\t\t\t\t// this is basically for doing .matchAll() occurence counting and highlighting without needing permuted ooo needles\n\t\t\t\treTpl = preTpl + '(' + reTpl.join(')' + sufTpl + '|' + preTpl + '(') + ')' + sufTpl;\n\t\t\t}\n\t\t\telse {\n\t\t\t\t// sadly, we also have to capture the inter-term junk via parenth-wrapping .*?\n\t\t\t\t// to accum other capture groups' indices for \\b boosting during scoring\n\t\t\t\treTpl = '(' + reTpl.join(')(' + interCharsTpl + ')(') + ')';\n\t\t\t\treTpl = '(.?' + preTpl + ')' + reTpl + '(' + sufTpl + '.*)'; // nit: trailing capture here assumes interIns = Inf\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\treTpl = reTpl.join(interCharsTpl);\n\t\t\treTpl = preTpl + reTpl + sufTpl;\n\t\t}\n\n\t//\tconsole.log(reTpl);\n\n\t\treturn [new RegExp(reTpl, 'i'), parts, contrs];\n\t};\n\n\tconst filter = (haystack, needle, idxs) => {\n\n\t\tlet out = [];\n\t\tlet [query] = prepQuery(needle);\n\n\t\tif (idxs != null) {\n\t\t\tfor (let i = 0; i < idxs.length; i++) {\n\t\t\t\tlet idx = idxs[i];\n\t\t\t\tquery.test(haystack[idx]) && out.push(idx);\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\tfor (let i = 0; i < haystack.length; i++)\n\t\t\t\tquery.test(haystack[i]) && out.push(i);\n\t\t}\n\n\t\treturn out;\n\t};\n\n\tlet withIntraBound = !!_intraBound;\n\n\tlet interBound = new RegExp(_interSplit);\n\tlet intraBound = new RegExp(_intraBound);\n\n\tconst info = (idxs, haystack, needle) => {\n\n\t\tlet [query, parts, contrs] = prepQuery(needle, 1);\n\t\tlet [queryR] = prepQuery(needle, 2);\n\t\tlet partsLen = parts.length;\n\n\t\tlet len = idxs.length;\n\n\t\tlet field = Array(len).fill(0);\n\n\t\tlet info = {\n\t\t\t// idx in haystack\n\t\t\tidx: Array(len),\n\n\t\t\t// start of match\n\t\t\tstart: field.slice(),\n\t\t\t// length of match\n\t\t//\tspan: field.slice(),\n\n\t\t\t// contiguous chars matched\n\t\t\tchars: field.slice(),\n\n\t\t\t// contiguous (no fuzz) and bounded terms (intra=0, lft2/1, rgt2/1)\n\t\t\t// excludes terms that are contiguous but have < 2 bounds (substrings)\n\t\t\tterms: field.slice(),\n\n\t\t\t// cumulative length of unmatched chars (fuzz) within span\n\t\t\tinterIns: field.slice(), // between terms\n\t\t\tintraIns: field.slice(), // within terms\n\n\t\t\t// interLft/interRgt counters\n\t\t\tinterLft2: field.slice(),\n\t\t\tinterRgt2: field.slice(),\n\t\t\tinterLft1: field.slice(),\n\t\t\tinterRgt1: field.slice(),\n\n\t\t\tranges: Array(len),\n\t\t};\n\n\t\t// might discard idxs based on bounds checks\n\t\tlet mayDiscard = interLft == 1 || interRgt == 1;\n\n\t\tlet ii = 0;\n\n\t\tfor (let i = 0; i < idxs.length; i++) {\n\t\t\tlet mhstr = haystack[idxs[i]];\n\n\t\t\t// the matched parts are [full, junk, term, junk, term, junk]\n\t\t\tlet m = mhstr.match(query);\n\n\t\t\t// leading junk\n\t\t\tlet start = m.index + m[1].length;\n\n\t\t\tlet idxAcc = start;\n\t\t//\tlet span = m[0].length;\n\n\t\t\tlet disc = false;\n\t\t\tlet lft2 = 0;\n\t\t\tlet lft1 = 0;\n\t\t\tlet rgt2 = 0;\n\t\t\tlet rgt1 = 0;\n\t\t\tlet chars = 0;\n\t\t\tlet terms = 0;\n\t\t\tlet inter = 0;\n\t\t\tlet intra = 0;\n\n\t\t\tlet refine = [];\n\n\t\t\tfor (let j = 0, k = 2; j < partsLen; j++, k+=2) {\n\t\t\t\tlet group = m[k].toLowerCase();\n\t\t\t\tlet term = parts[j] + contrs[j];\n\t\t\t\tlet termLen = term.length;\n\t\t\t\tlet groupLen = group.length;\n\t\t\t\tlet fullMatch = group == term;\n\n\t\t\t\t// this won't handle the case when an exact match exists across the boundary of the current group and the next junk\n\t\t\t\t// e.g. blob,ob when searching for 'bob' but finding the earlier `blob` (with extra insertion)\n\t\t\t\tif (!fullMatch && m[k+1].length >= termLen) {\n\t\t\t\t\t// probe for exact match in inter junk\n\t\t\t\t\tlet idxOf = m[k+1].toLowerCase().indexOf(term);\n\n\t\t\t\t\tif (idxOf > -1) {\n\t\t\t\t\t\trefine.push(idxAcc, idxOf, termLen);\n\t\t\t\t\t\tidxAcc += refineMatch(m, k, idxOf, termLen);\n\t\t\t\t\t\tgroup = term;\n\t\t\t\t\t\tgroupLen = termLen;\n\t\t\t\t\t\tfullMatch = true;\n\n\t\t\t\t\t\tif (j == 0)\n\t\t\t\t\t\t\tstart = idxAcc;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (mayDiscard || fullMatch) {\n\t\t\t\t\t// does group's left and/or right land on \\b\n\t\t\t\t\tlet lftCharIdx = idxAcc - 1;\n\t\t\t\t\tlet rgtCharIdx = idxAcc + groupLen;\n\n\t\t\t\t\tlet isPre = true;\n\t\t\t\t\tlet isSuf = true;\n\n\t\t\t\t\t// prefix info\n\t\t\t\t\tif (lftCharIdx == -1 || interBound.test(mhstr[lftCharIdx]))\n\t\t\t\t\t\tfullMatch && lft2++;\n\t\t\t\t\telse {\n\t\t\t\t\t\tif (interLft == 2) {\n\t\t\t\t\t\t\tdisc = true;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (withIntraBound && intraBound.test(mhstr[lftCharIdx] + mhstr[lftCharIdx + 1]))\n\t\t\t\t\t\t\tfullMatch && lft1++;\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tif (interLft == 1) {\n\t\t\t\t\t\t\t\t// regexps are eager, so try to improve the match by probing forward inter junk for exact match at a boundary\n\t\t\t\t\t\t\t\tlet junk = m[k+1];\n\t\t\t\t\t\t\t\tlet junkIdx = idxAcc + groupLen;\n\n\t\t\t\t\t\t\t\tif (junk.length >= termLen) {\n\t\t\t\t\t\t\t\t\tlet idxOf = 0;\n\t\t\t\t\t\t\t\t\tlet found = false;\n\t\t\t\t\t\t\t\t\tlet re = new RegExp(term, 'ig');\n\n\t\t\t\t\t\t\t\t\tlet m2;\n\t\t\t\t\t\t\t\t\twhile (m2 = re.exec(junk)) {\n\t\t\t\t\t\t\t\t\t\tidxOf = m2.index;\n\n\t\t\t\t\t\t\t\t\t\tlet charIdx = junkIdx + idxOf;\n\t\t\t\t\t\t\t\t\t\tlet lftCharIdx = charIdx - 1;\n\n\n\t\t\t\t\t\t\t\t\t\tif (lftCharIdx == -1 || interBound.test(mhstr[lftCharIdx])) {\n\t\t\t\t\t\t\t\t\t\t\tlft2++;\n\t\t\t\t\t\t\t\t\t\t\tfound = true;\n\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\telse if (intraBound.test(mhstr[lftCharIdx] + mhstr[charIdx])) {\n\t\t\t\t\t\t\t\t\t\t\tlft1++;\n\t\t\t\t\t\t\t\t\t\t\tfound = true;\n\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tif (found) {\n\t\t\t\t\t\t\t\t\t\t// identical to exact term refinement pass above\n\t\t\t\t\t\t\t\t\t\trefine.push(idxAcc, idxOf, termLen);\n\t\t\t\t\t\t\t\t\t\tidxAcc += refineMatch(m, k, idxOf, termLen);\n\t\t\t\t\t\t\t\t\t\tgroup = term;\n\t\t\t\t\t\t\t\t\t\tgroupLen = termLen;\n\t\t\t\t\t\t\t\t\t\tfullMatch = true;\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tdisc = true;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tisPre = false;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// suffix info\n\t\t\t\t\tif (rgtCharIdx == mhstr.length || interBound.test(mhstr[rgtCharIdx]))\n\t\t\t\t\t\tfullMatch && rgt2++;\n\t\t\t\t\telse {\n\t\t\t\t\t\tif (interRgt == 2) {\n\t\t\t\t\t\t\tdisc = true;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (withIntraBound && intraBound.test(mhstr[rgtCharIdx - 1] + mhstr[rgtCharIdx]))\n\t\t\t\t\t\t\tfullMatch && rgt1++;\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tif (interRgt == 1) {\n\t\t\t\t\t\t\t\tdisc = true;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tisSuf = false;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif (fullMatch) {\n\t\t\t\t\t\tchars += termLen;\n\n\t\t\t\t\t\tif (isPre && isSuf)\n\t\t\t\t\t\t\tterms++;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (groupLen > termLen)\n\t\t\t\t\tintra += groupLen - termLen; // intraFuzz\n\n\t\t\t\tif (j > 0)\n\t\t\t\t\tinter += m[k-1].length; // interFuzz\n\n\t\t\t\t// TODO: group here is lowercased, which is okay for length cmp, but not more case-sensitive filts\n\t\t\t\tif (!opts.intraFilt(term, group, idxAcc)) {\n\t\t\t\t\tdisc = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tif (j < partsLen - 1)\n\t\t\t\t\tidxAcc += groupLen + m[k+1].length;\n\t\t\t}\n\n\t\t\tif (!disc) {\n\t\t\t\tinfo.idx[ii] = idxs[i];\n\t\t\t\tinfo.interLft2[ii] = lft2;\n\t\t\t\tinfo.interLft1[ii] = lft1;\n\t\t\t\tinfo.interRgt2[ii] = rgt2;\n\t\t\t\tinfo.interRgt1[ii] = rgt1;\n\t\t\t\tinfo.chars[ii] = chars;\n\t\t\t\tinfo.terms[ii] = terms;\n\t\t\t\tinfo.interIns[ii] = inter;\n\t\t\t\tinfo.intraIns[ii] = intra;\n\n\t\t\t\tinfo.start[ii] = start;\n\t\t\t//\tinfo.span[ii] = span;\n\n\t\t\t\t// ranges\n\t\t\t\tlet m = mhstr.match(queryR);\n\t\t\t\tlet ranges = info.ranges[ii] = [];\n\n\t\t\t\tlet idxAcc = m.index + m[1].length;\n\t\t\t\tlet from = idxAcc;\n\t\t\t\tlet to = idxAcc;\n\n\t\t\t\tlet refLen = refine.length;\n\t\t\t\tlet ri = refLen > 0 ? 0 : Infinity;\n\t\t\t\tlet lastRi = refLen - 3;\n\n\t\t\t\tfor (let i = 2; i < m.length; i++) {\n\t\t\t\t\tlet len = m[i].length;\n\n\t\t\t\t\tif (ri <= lastRi && refine[ri] == idxAcc) {\n\t\t\t\t\t\tlet idxInNext = refine[ri+1];\n\t\t\t\t\t\tlet matchLen = refine[ri+2];\n\t\t\t\t\t\tlet offset = idxInNext + matchLen;\n\n\t\t\t\t\t\tidxAcc += len + offset;\n\t\t\t\t\t\tfrom = idxAcc - matchLen;\n\t\t\t\t\t\tm[i+1] = m[i+1].slice(offset);\n\n\t\t\t\t\t\tri+=3;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t\tidxAcc += len;\n\n\t\t\t\t\tif (i % 2 == 0)\n\t\t\t\t\t\tto = idxAcc;\n\t\t\t\t\telse if (len > 0) {\n\t\t\t\t\t\tranges.push(from, to);\n\t\t\t\t\t\tfrom = to = idxAcc;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (to > from)\n\t\t\t\t\tranges.push(from, to);\n\n\t\t\t\tii++;\n\t\t\t}\n\t\t}\n\n\t\t// trim arrays\n\t\tif (ii < idxs.length) {\n\t\t\tfor (let k in info)\n\t\t\t\tinfo[k] = info[k].slice(0, ii);\n\t\t}\n\n\t\treturn info;\n\t};\n\n\tconst refineMatch = (m, k, idxInNext, termLen) => {\n\t\t// shift the current group into the prior junk\n\t\tlet prepend = m[k] + m[k+1].slice(0, idxInNext);\n\t\tm[k-1] += prepend;\n\t\tm[k] = m[k+1].slice(idxInNext, idxInNext + termLen);\n\t\tm[k+1] = m[k+1].slice(idxInNext + termLen);\n\t\treturn prepend.length;\n\t};\n\n\t// returns [idxs, info, order]\n\tconst _search = (haystack, needle, outOfOrder = false, infoThresh = 1e3, preFiltered) => {\n\t\tlet needles = null;\n\t\tlet matches = null;\n\n\t\tlet negs = [];\n\n\t\tneedle = needle.replace(NEGS_RE, m => {\n\t\t\tnegs.push(m.trim().slice(1));\n\t\t\treturn '';\n\t\t});\n\n\t\tlet negsRe;\n\n\t\tif (negs.length > 0) {\n\t\t\tnegsRe = new RegExp(negs.join('|'), 'i');\n\n\t\t\tif (needle.trim() == '') {\n\t\t\t\tlet idxs = [];\n\n\t\t\t\tfor (let i = 0; i < haystack.length; i++) {\n\t\t\t\t\tif (!negsRe.test(haystack[i]))\n\t\t\t\t\t\tidxs.push(i);\n\t\t\t\t}\n\n\t\t\t\treturn [idxs, null, null];\n\t\t\t}\n\t\t}\n\n\t//\tconsole.log(negs);\n\t//\tconsole.log(needle);\n\n\t\tif (outOfOrder) {\n\t\t\t// since uFuzzy is an AND-based search, we can iteratively pre-reduce the haystack by searching\n\t\t\t// for each term in isolation before running permutations on what's left.\n\t\t\t// this is a major perf win. e.g. searching \"test man ger pp a\" goes from 570ms -> 14ms\n\t\t\tlet terms = split(needle);\n\n\t\t\tif (terms.length > 1) {\n\t\t\t\t// longest -> shortest\n\t\t\t\tlet terms2 = terms.slice().sort((a, b) => b.length - a.length);\n\n\t\t\t\tfor (let ti = 0; ti < terms2.length; ti++) {\n\t\t\t\t\t// no haystack item contained all terms\n\t\t\t\t\tif (preFiltered && preFiltered.length == 0)\n\t\t\t\t\t\treturn [[], null, null];\n\n\t\t\t\t\tpreFiltered = filter(haystack, terms2[ti], preFiltered);\n\t\t\t\t}\n\n\t\t\t\tneedles = permute(terms).map(perm => perm.join(' '));\n\n\t\t\t\t// filtered matches for each needle excluding same matches for prior needles\n\t\t\t\tmatches = [];\n\n\t\t\t\t// keeps track of already-matched idxs to skip in follow-up permutations\n\t\t\t\tlet matchedIdxs = new Set();\n\n\t\t\t\tfor (let ni = 0; ni < needles.length; ni++) {\n\t\t\t\t\tif (matchedIdxs.size < preFiltered.length) {\n\t\t\t\t\t\t// filter further for this needle, exclude already-matched\n\t\t\t\t\t\tlet preFiltered2 = preFiltered.filter(idx => !matchedIdxs.has(idx));\n\n\t\t\t\t\t\tlet matched = filter(haystack, needles[ni], preFiltered2);\n\n\t\t\t\t\t\tfor (let j = 0; j < matched.length; j++)\n\t\t\t\t\t\t\tmatchedIdxs.add(matched[j]);\n\n\t\t\t\t\t\tmatches.push(matched);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t\tmatches.push([]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// interOR\n\t//\tconsole.log(prepQuery(needle, 1, null, true));\n\n\t\t// non-ooo or ooo w/single term\n\t\tif (needles == null) {\n\t\t\tneedles = [needle];\n\t\t\tmatches = [preFiltered && preFiltered.length > 0 ? preFiltered : filter(haystack, needle)];\n\t\t}\n\n\t\tlet retInfo = null;\n\t\tlet retOrder = null;\n\n\t\tif (negs.length > 0)\n\t\t\tmatches = matches.map(idxs => idxs.filter(idx => !negsRe.test(haystack[idx])));\n\n\t\tlet matchCount = matches.reduce((acc, idxs) => acc + idxs.length, 0);\n\n\t\t// rank, sort, concat\n\t\tif (matchCount <= infoThresh) {\n\t\t\tretInfo = {};\n\t\t\tretOrder = [];\n\n\t\t\tfor (let ni = 0; ni < matches.length; ni++) {\n\t\t\t\tlet idxs = matches[ni];\n\n\t\t\t\tif (idxs == null || idxs.length == 0)\n\t\t\t\t\tcontinue;\n\n\t\t\t\tlet needle = needles[ni];\n\t\t\t\tlet _info = info(idxs, haystack, needle);\n\t\t\t\tlet order = opts.sort(_info, haystack, needle);\n\n\t\t\t\t// offset idxs for concat'ing infos\n\t\t\t\tif (ni > 0) {\n\t\t\t\t\tfor (let i = 0; i < order.length; i++)\n\t\t\t\t\t\torder[i] += retOrder.length;\n\t\t\t\t}\n\n\t\t\t\tfor (let k in _info) {\n\t\t\t\t\tretInfo[k] = (retInfo[k] ? retInfo[k] : []).concat(_info[k]);\n }\n\n\t\t\t\tretOrder = retOrder.concat(order);\n\t\t\t}\n\t\t}\n\n\t\treturn [\n\t\t\t[].concat(...matches),\n\t\t\tretInfo,\n\t\t\tretOrder,\n\t\t];\n\t};\n\n\treturn {\n\t\tsearch: (...args) => {\n\t\t\tlet out = _search(...args);\n\t\t\treturn out;\n\t\t},\n\t\tsplit,\n\t\tfilter,\n\t\tinfo,\n\t\tsort: opts.sort,\n\t};\n}\n\nconst latinize = (() => {\n\tlet accents = {\n\t\tA: 'ÁÀÃÂÄĄ',\n\t\ta: 'áàãâäą',\n\t\tE: 'ÉÈÊËĖ',\n\t\te: 'éèêëę',\n\t\tI: 'ÍÌÎÏĮ',\n\t\ti: 'íìîïį',\n\t\tO: 'ÓÒÔÕÖ',\n\t\to: 'óòôõö',\n\t\tU: 'ÚÙÛÜŪŲ',\n\t\tu: 'úùûüūų',\n\t\tC: 'ÇČ',\n\t\tc: 'çč',\n\t\tN: 'Ñ',\n\t\tn: 'ñ',\n\t\tS: 'Š',\n\t\ts: 'š'\n\t};\n\n\tlet accentsMap = new Map();\n\tlet accentsTpl = '';\n\n\tfor (let r in accents) {\n\t\taccents[r].split('').forEach(a => {\n\t\t\taccentsTpl += a;\n\t\t\taccentsMap.set(a, r);\n\t\t});\n\t}\n\n\tlet accentsRe = new RegExp(`[${accentsTpl}]`, 'g');\n\tlet replacer = m => accentsMap.get(m);\n\n\treturn strings => {\n\t\tif (typeof strings == 'string')\n\t\t\treturn strings.replace(accentsRe, replacer);\n\n\t\tlet out = Array(strings.length);\n\t\tfor (let i = 0; i < strings.length; i++)\n\t\t\tout[i] = strings[i].replace(accentsRe, replacer);\n\t\treturn out;\n\t};\n})();\n\n// https://stackoverflow.com/questions/9960908/permutations-in-javascript/37580979#37580979\nfunction permute(arr) {\n\tarr = arr.slice();\n\n\tlet length = arr.length,\n\t\tresult = [arr.slice()],\n\t\tc = new Array(length).fill(0),\n\t\ti = 1, k, p;\n\n\twhile (i < length) {\n\t\tif (c[i] < i) {\n\t\t\tk = i % 2 && c[i];\n\t\t\tp = arr[i];\n\t\t\tarr[i] = arr[k];\n\t\t\tarr[k] = p;\n\t\t\t++c[i];\n\t\t\ti = 1;\n\t\t\tresult.push(arr.slice());\n\t\t} else {\n\t\t\tc[i] = 0;\n\t\t\t++i;\n\t\t}\n\t}\n\n\treturn result;\n}\n\nconst _mark = (part, matched) => matched ? `${part}` : part;\nconst _append = (acc, part) => acc + part;\n\nfunction highlight(str, ranges, mark = _mark, accum = '', append = _append) {\n let tmp = append(accum, mark(str.substring(0, ranges[0]), false));\n\taccum = tmp !== null ? tmp : accum;\n\n\tfor (let i = 0; i < ranges.length; i+=2) {\n\t\tlet fr = ranges[i];\n\t\tlet to = ranges[i+1];\n\n tmp = append(accum, mark(str.substring(fr, to), true));\n\t\taccum = tmp !== null ? tmp : accum;\n\n\t\tif (i < ranges.length - 3) {\n tmp = append(accum, mark(str.substring(ranges[i + 1], ranges[i + 2]), false));\n accum = tmp !== null ? tmp : accum;\n }\n\t}\n\n tmp = append(accum, mark(str.substring(ranges[ranges.length - 1]), false));\n\taccum = tmp !== null ? tmp : accum;\n\n\treturn accum;\n}\n\nuFuzzy.latinize = latinize;\nuFuzzy.permute = arr => {\n\tlet idxs = permute([...Array(arr.length).keys()]).sort((a,b) => {\n\t\tfor (let i = 0; i < a.length; i++) {\n\t\t\tif (a[i] != b[i])\n\t\t\t\treturn a[i] - b[i];\n\t\t}\n\t\treturn 0;\n\t});\n\n\treturn idxs.map(pi => pi.map(i => arr[i]));\n};\nuFuzzy.highlight = highlight;\n\nexport { uFuzzy as default };\n","import uFuzzy from '@leeoniya/ufuzzy';\n\n// See https://github.com/leeoniya/uFuzzy#options\nconst uf = new uFuzzy({\n intraMode: 1,\n intraIns: 1,\n intraSub: 1,\n intraTrn: 1,\n intraDel: 1,\n});\n\nfunction sortCommands(\n a: ProcessedCommandItem,\n b: ProcessedCommandItem,\n favouriteCommands: CommandId[],\n recentCommands: CommandId[]\n): number {\n // Sort by recent first\n const aIsRecent = recentCommands.includes(a.id);\n const bIsRecent = recentCommands.includes(b.id);\n\n if (aIsRecent && !bIsRecent) {\n return -1;\n }\n\n if (!aIsRecent && bIsRecent) {\n return 1;\n }\n\n if (aIsRecent && bIsRecent) {\n return recentCommands.indexOf(a.id) - recentCommands.indexOf(b.id);\n }\n\n // Sort by favourites second\n const aIsFavourite = favouriteCommands.includes(a.id);\n const bIsFavourite = favouriteCommands.includes(b.id);\n\n if (aIsFavourite && !bIsFavourite) {\n return -1;\n }\n\n if (!aIsFavourite && bIsFavourite) {\n return 1;\n }\n\n // Sort by name third\n return a.name.localeCompare(b.name);\n}\n\nexport default function filterCommands(\n selectedCommandGroup: CommandId,\n searchWord: string,\n commands: FlatCommandList,\n favourites: CommandId[],\n recentCommands: CommandId[]\n): CommandId[] {\n // If there is a search word, return all commands to allow deep search\n // If no search word is given, return all commands in the currently selected group or all recent commands if no group is selected\n let availableCommands = Object.values(commands);\n availableCommands = searchWord\n ? availableCommands\n : availableCommands.filter(\n (command) =>\n command.parentId === selectedCommandGroup ||\n (!selectedCommandGroup && recentCommands.includes(command.id))\n );\n\n // If there is no search word, return all commands in the current context with favourites first, the recent commands will only be prioritised if we are at the top level\n if (!searchWord) {\n return availableCommands\n .sort((a, b) => sortCommands(a, b, favourites, selectedCommandGroup ? [] : recentCommands))\n .map((command) => command.id);\n }\n\n // Create a list of all available commands with their name and description as haystack for the search\n const availableCommandNames = availableCommands.map(({ name, description }) => name + ' ' + description);\n const [indices, , order] = uf.search(availableCommandNames, searchWord.toLowerCase());\n const matchingIds = order.map((i) => availableCommands[indices[i]].id);\n\n // Add all commands that can handle queries to the result, the Set removes duplicates\n return matchingIds;\n}\n","export default function assert(condition: unknown, message = 'Assertion failed'): asserts condition {\n if (condition === false) throw Error(message);\n}\n","export default function classnames(...args: Array): string {\n return args.filter(Boolean).join(' ');\n}\n","import { logger } from '../helpers';\n\nexport enum STATUS {\n COLLAPSED = 'collapsed',\n IDLE = 'idle',\n EXECUTING_COMMAND = 'executingCommand',\n DISPLAYING_RESULT = 'displayingResult',\n}\n\nexport enum TRANSITION {\n RESET_SEARCH = 'RESET_SEARCH',\n HIGHLIGHT_NEXT_ITEM = 'HIGHLIGHT_NEXT_ITEM',\n HIGHLIGHT_PREVIOUS_ITEM = 'HIGHLIGHT_PREVIOUS_ITEM',\n CANCEL = 'CANCEL',\n SELECT_GROUP = 'SELECT_GROUP',\n GO_TO_PARENT_GROUP = 'GO_TO_PARENT_GROUP',\n UPDATE_SEARCH = 'UPDATE_SEARCH',\n UPDATE_COMMAND_QUERY = 'UPDATE_COMMAND_QUERY',\n EXECUTE_COMMAND = 'EXECUTE_COMMAND',\n FINISH_COMMAND = 'FINISH_COMMAND',\n UPDATE_RESULT = 'UPDATE_RESULT',\n EXPAND = 'EXPAND',\n ADD_FAVOURITE = 'ADD_FAVOURITE',\n REMOVE_FAVOURITE = 'REMOVE_FAVOURITE',\n}\n\nexport enum ACTION {\n ADD_FAVOURITE = 'ADD_FAVOURITE',\n ADD_RECENTLY_USED = 'ADD_RECENTLY_USED',\n EXPAND = 'EXPAND',\n HIGHLIGHT_NEXT_COMMAND = 'HIGHLIGHT_NEXT_COMMAND',\n HIGHLIGHT_NEXT_OPTION = 'HIGHLIGHT_NEXT_OPTION',\n HIGHLIGHT_PREVIOUS_COMMAND = 'HIGHLIGHT_PREVIOUS_COMMAND',\n HIGHLIGHT_PREVIOUS_OPTION = 'HIGHLIGHT_PREVIOUS_OPTION',\n LEAVE_GROUP = 'LEAVE_GROUP',\n REFRESH_COMMANDS = 'REFRESH_COMMANDS',\n REMOVE_FAVOURITE = 'REMOVE_FAVOURITE',\n RESET_HIGHLIGHT = 'RESET_HIGHLIGHT',\n RESET_OPTION_HIGHLIGHT = 'RESET_OPTION_HIGHLIGHT',\n RESET_SEARCH = 'RESET_SEARCH',\n RESET_SEARCH_OR_LEAVE_GROUP = 'RESET_SEARCH_OR_LEAVE_GROUP',\n SET_ACTIVE_COMMAND = 'SET_ACTIVE_COMMAND',\n SET_COMMAND_QUERY = 'SET_COMMAND_QUERY',\n SET_GROUP = 'SET_GROUP',\n SET_SEARCH_WORD = 'SET_SEARCH_WORD',\n UNSET_ACTIVE_COMMAND = 'UNSET_ACTIVE_COMMAND',\n UNSET_RESULT = 'UNSET_RESULT',\n UPDATE_RESULT = 'UPDATE_RESULT',\n}\n\ninterface MachineDefinition {\n initial: STATUS;\n states: {\n [state in STATUS]: {\n on: {\n [transition in TRANSITION]?:\n | STATUS\n | {\n target: STATUS;\n actions?: ACTION[];\n };\n };\n };\n };\n}\n\nexport const machine: MachineDefinition = {\n initial: STATUS.COLLAPSED,\n states: {\n collapsed: {\n on: {\n UPDATE_SEARCH: {\n target: STATUS.IDLE,\n actions: [ACTION.EXPAND, ACTION.SET_SEARCH_WORD, ACTION.REFRESH_COMMANDS],\n },\n HIGHLIGHT_NEXT_ITEM: {\n target: STATUS.IDLE,\n actions: [ACTION.REFRESH_COMMANDS, ACTION.EXPAND],\n },\n EXPAND: {\n target: STATUS.IDLE,\n actions: [ACTION.REFRESH_COMMANDS, ACTION.EXPAND],\n },\n },\n },\n idle: {\n on: {\n UPDATE_SEARCH: {\n target: STATUS.IDLE,\n actions: [ACTION.SET_SEARCH_WORD, ACTION.RESET_HIGHLIGHT, ACTION.REFRESH_COMMANDS],\n },\n HIGHLIGHT_NEXT_ITEM: {\n target: STATUS.IDLE,\n actions: [ACTION.HIGHLIGHT_NEXT_COMMAND],\n },\n HIGHLIGHT_PREVIOUS_ITEM: {\n target: STATUS.IDLE,\n actions: [ACTION.HIGHLIGHT_PREVIOUS_COMMAND],\n },\n CANCEL: {\n target: STATUS.IDLE,\n actions: [ACTION.RESET_HIGHLIGHT, ACTION.RESET_SEARCH_OR_LEAVE_GROUP, ACTION.REFRESH_COMMANDS],\n },\n EXECUTE_COMMAND: {\n target: STATUS.EXECUTING_COMMAND,\n actions: [ACTION.ADD_RECENTLY_USED, ACTION.SET_ACTIVE_COMMAND, ACTION.REFRESH_COMMANDS],\n },\n GO_TO_PARENT_GROUP: {\n target: STATUS.IDLE,\n actions: [ACTION.RESET_HIGHLIGHT, ACTION.LEAVE_GROUP, ACTION.REFRESH_COMMANDS],\n },\n SELECT_GROUP: {\n target: STATUS.IDLE,\n actions: [ACTION.RESET_SEARCH, ACTION.RESET_HIGHLIGHT, ACTION.SET_GROUP, ACTION.REFRESH_COMMANDS],\n },\n ADD_FAVOURITE: {\n target: STATUS.IDLE,\n actions: [ACTION.ADD_FAVOURITE, ACTION.REFRESH_COMMANDS],\n },\n REMOVE_FAVOURITE: {\n target: STATUS.IDLE,\n actions: [ACTION.REMOVE_FAVOURITE, ACTION.REFRESH_COMMANDS],\n },\n },\n },\n executingCommand: {\n on: {\n UPDATE_RESULT: {\n target: STATUS.DISPLAYING_RESULT,\n actions: [ACTION.UPDATE_RESULT],\n },\n FINISH_COMMAND: {\n target: STATUS.IDLE,\n actions: [ACTION.UNSET_ACTIVE_COMMAND],\n },\n },\n },\n displayingResult: {\n on: {\n UPDATE_COMMAND_QUERY: {\n target: STATUS.DISPLAYING_RESULT,\n actions: [ACTION.SET_COMMAND_QUERY],\n },\n UPDATE_RESULT: {\n target: STATUS.DISPLAYING_RESULT,\n actions: [ACTION.UPDATE_RESULT, ACTION.RESET_OPTION_HIGHLIGHT],\n },\n HIGHLIGHT_NEXT_ITEM: {\n target: STATUS.DISPLAYING_RESULT,\n actions: [ACTION.HIGHLIGHT_NEXT_OPTION],\n },\n HIGHLIGHT_PREVIOUS_ITEM: {\n target: STATUS.DISPLAYING_RESULT,\n actions: [ACTION.HIGHLIGHT_PREVIOUS_OPTION],\n },\n EXECUTE_COMMAND: {\n target: STATUS.DISPLAYING_RESULT,\n actions: [ACTION.SET_ACTIVE_COMMAND],\n },\n CANCEL: {\n target: STATUS.IDLE,\n actions: [ACTION.UNSET_RESULT, ACTION.UNSET_ACTIVE_COMMAND, ACTION.RESET_OPTION_HIGHLIGHT],\n },\n FINISH_COMMAND: {\n target: STATUS.DISPLAYING_RESULT,\n actions: [ACTION.UNSET_ACTIVE_COMMAND],\n },\n },\n },\n },\n};\n\nexport interface MachineState {\n status: STATUS;\n}\n\ntype MachineEvent = {\n type: TRANSITION;\n payload?: any;\n};\n\nexport function transition(\n state: MachineState,\n event: MachineEvent,\n actionCallback?: (action: ACTION, nextState: MachineState, event: MachineEvent) => void\n): MachineState {\n let nextStateNode = machine.states[state.status].on?.[event.type] ?? null;\n\n if (!nextStateNode) {\n logger.error(`No transition found for event \"${event.type}\" in state \"${state.status}\"`);\n nextStateNode = { target: state.status };\n }\n\n const nextState = {\n ...state,\n status: typeof nextStateNode == 'string' ? nextStateNode : nextStateNode.target,\n } as MachineState;\n\n if (actionCallback && typeof nextStateNode == 'object') {\n nextStateNode.actions?.forEach((action) => actionCallback(action, nextState, event));\n }\n\n logger.debug(`Transitioned from \"${state.status}\" to \"${nextState.status}\" with event \"${event.type}\"`);\n\n return nextState;\n}\n","import { assert, clamp, filterCommands } from '../helpers';\nimport { ACTION, MachineState, TRANSITION, transition } from './commandBarMachine';\n\nexport type CommandBarEvent =\n | { type: TRANSITION.RESET_SEARCH }\n | { type: TRANSITION.HIGHLIGHT_NEXT_ITEM }\n | { type: TRANSITION.HIGHLIGHT_PREVIOUS_ITEM }\n | { type: TRANSITION.CANCEL }\n | { type: TRANSITION.SELECT_GROUP; commandId: string }\n | { type: TRANSITION.GO_TO_PARENT_GROUP }\n | { type: TRANSITION.UPDATE_SEARCH; searchWord: string }\n | { type: TRANSITION.UPDATE_COMMAND_QUERY; commandQuery: string }\n | { type: TRANSITION.EXECUTE_COMMAND; commandId: CommandId; message: string }\n | { type: TRANSITION.FINISH_COMMAND }\n | { type: TRANSITION.UPDATE_RESULT; result: CommandResult }\n | { type: TRANSITION.EXPAND }\n | { type: TRANSITION.ADD_FAVOURITE; commandId: CommandId }\n | { type: TRANSITION.REMOVE_FAVOURITE; commandId: CommandId };\n\nexport type CommandBarState = MachineState & {\n activeCommandId: CommandId;\n activeCommandMessage: string;\n availableCommandIds: CommandId[];\n commandQuery: string;\n commands: FlatCommandList;\n expanded: boolean;\n favouriteCommands: CommandId[];\n highlightedItem: number;\n highlightedOption: number;\n recentCommands: CommandId[];\n result: CommandResult | null;\n resultCommandId: CommandId;\n searchWord: string;\n selectedCommandGroup: CommandId;\n showBranding: boolean;\n};\n\nconst MAX_RECENTLY_USED = 5;\n\nfunction runAction(action: ACTION, nextState: CommandBarState, event: CommandBarEvent) {\n switch (action) {\n case ACTION.RESET_SEARCH:\n nextState.searchWord = '';\n break;\n case ACTION.RESET_HIGHLIGHT:\n nextState.highlightedItem = 0;\n break;\n case ACTION.REFRESH_COMMANDS:\n nextState.availableCommandIds = filterCommands(\n nextState.selectedCommandGroup,\n nextState.searchWord,\n nextState.commands,\n nextState.favouriteCommands,\n nextState.recentCommands\n );\n break;\n case ACTION.HIGHLIGHT_NEXT_COMMAND:\n nextState.highlightedItem = clamp(\n nextState.highlightedItem + 1,\n 0,\n nextState.availableCommandIds.length - 1\n );\n break;\n case ACTION.HIGHLIGHT_PREVIOUS_COMMAND:\n nextState.highlightedItem = clamp(\n nextState.highlightedItem - 1,\n 0,\n nextState.availableCommandIds.length - 1\n );\n break;\n case ACTION.HIGHLIGHT_NEXT_OPTION:\n nextState.highlightedOption = clamp(\n nextState.highlightedOption + 1,\n 0,\n Object.keys(nextState.result.options).length - 1\n );\n break;\n case ACTION.HIGHLIGHT_PREVIOUS_OPTION:\n nextState.highlightedOption = clamp(\n nextState.highlightedOption - 1,\n 0,\n Object.keys(nextState.result.options).length - 1\n );\n break;\n case ACTION.SET_SEARCH_WORD:\n assert(event.type === TRANSITION.UPDATE_SEARCH);\n nextState.searchWord = event.searchWord;\n break;\n case ACTION.SET_COMMAND_QUERY:\n assert(event.type === TRANSITION.UPDATE_COMMAND_QUERY);\n nextState.commandQuery = event.commandQuery;\n break;\n case ACTION.EXPAND:\n nextState.expanded = true;\n break;\n case ACTION.SET_ACTIVE_COMMAND:\n assert(event.type === TRANSITION.EXECUTE_COMMAND);\n nextState.activeCommandId = event.commandId;\n nextState.activeCommandMessage = event.message;\n break;\n case ACTION.UNSET_ACTIVE_COMMAND:\n nextState.activeCommandId = null;\n nextState.activeCommandMessage = null;\n break;\n case ACTION.UPDATE_RESULT:\n assert(event.type === TRANSITION.UPDATE_RESULT);\n assert(typeof event.result.success === 'boolean');\n nextState.result = {\n options: {},\n message: 'Command executed',\n view: null,\n success: false,\n ...event.result,\n };\n nextState.resultCommandId = nextState.activeCommandId;\n break;\n case ACTION.RESET_OPTION_HIGHLIGHT:\n nextState.highlightedOption = 0;\n break;\n case ACTION.RESET_SEARCH_OR_LEAVE_GROUP:\n if (nextState.commandQuery) {\n nextState.commandQuery = '';\n } else if (nextState.searchWord) {\n nextState.searchWord = '';\n } else {\n nextState.selectedCommandGroup = nextState.selectedCommandGroup\n ? nextState.commands[nextState.selectedCommandGroup].parentId\n : null;\n }\n break;\n case ACTION.UNSET_RESULT:\n nextState.result = null;\n nextState.resultCommandId = null;\n nextState.commandQuery = '';\n break;\n case ACTION.LEAVE_GROUP:\n nextState.selectedCommandGroup = nextState.selectedCommandGroup\n ? nextState.commands[nextState.selectedCommandGroup].parentId\n : null;\n break;\n case ACTION.SET_GROUP:\n assert(event.type === TRANSITION.SELECT_GROUP);\n nextState.selectedCommandGroup = event.commandId;\n break;\n case ACTION.ADD_FAVOURITE:\n assert(event.type === TRANSITION.ADD_FAVOURITE);\n if (!nextState.favouriteCommands.includes(event.commandId)) {\n nextState.favouriteCommands.push(event.commandId);\n }\n break;\n case ACTION.REMOVE_FAVOURITE:\n assert(event.type === TRANSITION.REMOVE_FAVOURITE);\n nextState.favouriteCommands = nextState.favouriteCommands.filter((id) => id !== event.commandId);\n break;\n case ACTION.ADD_RECENTLY_USED:\n assert(event.type === TRANSITION.EXECUTE_COMMAND);\n // Only add to recently used if the command has an action\n if (!nextState.commands[event.commandId].action) {\n break;\n }\n if (nextState.recentCommands.includes(event.commandId)) {\n nextState.recentCommands = nextState.recentCommands.filter((id) => id !== event.commandId);\n }\n nextState.recentCommands.unshift(event.commandId);\n if (nextState.recentCommands.length > MAX_RECENTLY_USED) {\n nextState.recentCommands.pop();\n }\n break;\n default:\n throw Error(`Action ${action} not implemented`);\n }\n}\n\nconst commandBarReducer = (state: CommandBarState, event: CommandBarEvent): CommandBarState => {\n return transition(state, event, runAction) as CommandBarState;\n};\n\nexport { commandBarReducer };\n","import React from 'react';\n\nimport * as styles from './IconWrapper.module.css';\n\ntype IconWrapperProps = {\n children: JSX.Element;\n};\n\nconst IconWrapper: React.FC = ({ children }) => {\n return {children};\n};\n\nexport default React.memo(IconWrapper);\n",".iconWrap {\n width: var(--icon-size);\n max-height: var(--icon-size);\n display: inline-block;\n text-align: center;\n}\n\n.iconWrap svg {\n max-width: 100%;\n max-height: inherit;\n display: inline-block;\n}\n","import React from 'react';\nimport { useCommandBarState, useIntl } from '../../state';\n\nimport * as styles from './Branding.module.css';\n\nconst Branding: React.FC = () => {\n const {\n state: { showBranding },\n } = useCommandBarState();\n const { translate } = useIntl();\n\n if (!showBranding) return null;\n\n return (\n \n {translate('CommandBarFooter.brandingSmall', 'Made with love by')}\n \n \n \n \n \n \n \n \n \n \n \n );\n};\n\nexport default React.memo(Branding);\n",".madeWithLove {\n display: flex;\n text-decoration: none;\n gap: 0.5rem;\n}\n\n.madeWithLove small {\n transition: color 0.1s ease-in-out;\n}\n\n.madeWithLove:hover small {\n color: var(--color-light-text-hover);\n}\n\n.madeWithLove svg {\n display: inline-block;\n width: var(--icon-size);\n height: auto;\n}\n","import React from 'react';\n\nexport function IconBack() {\n return (\n \n \n \n );\n}\n","import React from 'react';\n\nexport function IconNeos() {\n return (\n \n \n \n );\n}\n","import React from 'react';\n\nexport function IconSpinner() {\n return (\n \n \n \n );\n}\n","import React from 'react';\n\nexport function IconStar() {\n return (\n \n \n \n );\n}\n","import React from 'react';\n\nexport function IconPlay() {\n return (\n \n \n \n );\n}\n","import React from 'react';\nimport { useComputed } from '@preact/signals';\n\nimport { useCommandBarState } from '../../state';\nimport IconWrapper from '../IconWrapper/IconWrapper';\nimport Branding from './Branding';\nimport { IconNeos, IconSpinner } from '../Icons';\n\nimport * as styles from './CommandBarFooter.module.css';\n\nconst CommandBarFooter: React.FC = () => {\n const {\n state: { activeCommandId, activeCommandMessage, commands, result, selectedCommandGroup, expanded },\n Icon,\n } = useCommandBarState();\n\n const runningCommand = useComputed(() => {\n if (!activeCommandId.value) return null;\n // FIXME: This will not be correct when a command and an option in the result have the same id\n return activeCommandId.value\n ? commands.value[activeCommandId.value] ?? result.value.options[activeCommandId.value]\n : null;\n });\n\n if (!expanded.value) return null;\n\n return (\n
\n {activeCommandId.value ? (\n \n \n \n \n \n {runningCommand.value.name} ‒ {activeCommandMessage}\n \n \n ) : selectedCommandGroup.value ? (\n \n \n {commands.value[selectedCommandGroup.value].name}\n \n ) : (\n \n \n \n )}\n \n
\n );\n};\n\nexport default React.memo(CommandBarFooter);\n",".commandBarFooter {\n border-top: 1px solid var(--color-border);\n background-color: var(--footer-background);\n padding: 0.8rem 1rem;\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: 1rem;\n user-select: none;\n}\n\n.breadcrumb {\n display: flex;\n gap: 1rem;\n --icon-size: 0.875em;\n}\n\n.activity {\n display: flex;\n gap: 1rem;\n --icon-size: 0.875em;\n}\n","import React, { useCallback, useRef } from 'react';\nimport { useSignalEffect } from '@preact/signals';\n\nimport { useCommandBarState, STATUS, useIntl, useCommandExecutor } from '../../state';\nimport IconWrapper from '../IconWrapper/IconWrapper';\n\nimport * as styles from './SearchBox.module.css';\nimport { IconPlay } from '../Icons';\n\n// Timer helper for debouncing updates of command query results\nlet updateResultsTimer = null;\nconst RESULT_UPDATE_DEBOUNCE_TIME = 500;\n\nconst SearchBox: React.FC = () => {\n const { state, actions } = useCommandBarState();\n const { executeCommand } = useCommandExecutor();\n const { translate } = useIntl();\n const inputRef = useRef();\n\n const handleChange = useCallback((e) => {\n if (state.status.value === STATUS.DISPLAYING_RESULT) {\n actions.UPDATE_COMMAND_QUERY(e.target.value);\n\n // Execute command after a delay if it's not a manual command\n if (!state.commands.value[state.resultCommandId.value].executeManually) {\n if (updateResultsTimer) {\n clearTimeout(updateResultsTimer);\n }\n updateResultsTimer = setTimeout(\n () => executeCommand(state.resultCommandId.value),\n RESULT_UPDATE_DEBOUNCE_TIME\n );\n }\n } else {\n actions.UPDATE_SEARCH(e.target.value);\n }\n }, []);\n\n const handleKeyPress = useCallback(\n (e: React.KeyboardEvent) => {\n // Prevent escape event from bubbling up if the input is focused and the native reset should be used\n if (e.key === 'Escape') {\n if (inputRef.current.value) {\n e.preventDefault();\n e.stopPropagation();\n }\n }\n },\n [inputRef.current]\n );\n\n // Focus input when the command bar is ready for input\n useSignalEffect(() => {\n if (state.status.value !== STATUS.EXECUTING_COMMAND) {\n inputRef.current?.focus();\n }\n });\n\n return (\n <>\n \n {!state.expanded.value && (\n \n \n \n \n \n \n \n )}\n {state.status.value === STATUS.DISPLAYING_RESULT &&\n state.commands.value[state.resultCommandId.value]?.executeManually && (\n executeCommand(state.resultCommandId.value)}\n title={translate('SearchBox.execute.title', 'Execute the command')}\n >\n \n \n \n \n )}\n \n );\n};\n\nexport default React.memo(SearchBox);\n",".searchBox {\n appearance: none;\n background: none;\n border: none;\n color: currentColor;\n font-size: 1.1em !important; /* Fix to prevent Neos.UI css from forcing the font size to 14px */\n font-weight: 300;\n outline: none;\n padding: 0.5rem;\n flex: 1;\n}\n\n.searchBox:disabled {\n color: var(--color-light-text);\n cursor: not-allowed;\n}\n\n.expandButton {\n position: absolute;\n padding: 0 1rem;\n height: 100%;\n right: 0;\n display: block;\n background: none;\n border: none;\n cursor: pointer;\n}\n\n.expandButton svg {\n color: var(--grayLighter);\n transition: color 0.1s ease-in-out;\n}\n\n.expandButton:hover svg {\n color: var(--primaryBlue);\n}\n\n.executeButton {\n position: absolute;\n padding: 0 1rem;\n height: 100%;\n right: 0;\n display: block;\n background: none;\n border: none;\n cursor: pointer;\n}\n\n.executeButton {\n color: var(--grayLighter);\n transition: color 0.1s ease-in-out;\n}\n\n.executeButton:hover svg {\n color: var(--primaryBlue);\n}\n","import React from 'react';\nimport { useComputed } from '@preact/signals';\n\nimport { useCommandBarState, STATUS } from '../../state';\nimport IconWrapper from '../IconWrapper/IconWrapper';\nimport SearchBox from '../SearchBox/SearchBox';\nimport { IconBack } from '../Icons';\n\nimport * as styles from './CommandBarHeader.module.css';\n\nconst CommandBarHeader: React.FC = () => {\n const { state, actions } = useCommandBarState();\n const isDisplayingResults = useComputed(() => state.status.value == STATUS.DISPLAYING_RESULT);\n\n return (\n
\n {(isDisplayingResults.value || state.selectedCommandGroup.value) && (\n \n \n \n \n \n )}\n \n
\n );\n};\n\nexport default React.memo(CommandBarHeader);\n",".commandBarHeader {\n display: flex;\n align-items: center;\n gap: 1rem;\n padding: 0.3rem 0.5rem;\n border-bottom: 1px solid var(--color-border);\n position: relative;\n}\n\n.backButton {\n padding: 0.3rem;\n background-color: var(--color-icon-bg);\n border-radius: 50%;\n appearance: none;\n border: none;\n color: white;\n cursor: pointer;\n transition: background-color 0.1s ease-in-out;\n display: flex;\n}\n\n.backButton:hover {\n background-color: var(--color-icon-bg-hover);\n}\n","import React from 'react';\nimport { ReadonlySignal, useComputed } from '@preact/signals';\n\nimport { IconWrapper } from '../index';\nimport { classnames } from '../../helpers';\nimport { IconStar } from '../Icons';\n\nimport * as styles from './CommandListItem.module.css';\nimport { useCommandBarState, useIntl } from '../../state';\n\ntype CommandListItemProps = {\n command: ProcessedCommandItem;\n onItemSelect: (commandId: CommandId) => void;\n highlightedId: ReadonlySignal;\n onToggleFavourite?: (id: CommandId) => void;\n};\n\nfunction getCommandType(\n { subCommandIds, category, canHandleQueries, action }: ProcessedCommandItem,\n translate: TranslateFunction\n): string {\n let type = 'command';\n if (category) {\n return category;\n } else if (subCommandIds?.length > 0) {\n type = 'category';\n } else if (canHandleQueries) {\n type = 'query';\n } else if (typeof action == 'string') {\n type = 'link';\n }\n\n return translate(`CommandListItem.type.${type}`, type);\n}\n\nfunction CommandListItem({ command, onItemSelect, highlightedId, onToggleFavourite }: CommandListItemProps) {\n const {\n state: { favouriteCommands },\n Icon,\n } = useCommandBarState();\n const { translate } = useIntl();\n const { id, name, description, icon, action } = command;\n const commandType = getCommandType(command, translate);\n\n const isHighlighted = useComputed(() => highlightedId.value === id);\n const isFavourite = useComputed(() => favouriteCommands.value.includes(id));\n\n return (\n onItemSelect(id)}\n data-testid=\"CommandListItem\"\n >\n \n \n {name}\n {description && (\n \n {typeof description == 'string' ? description : description()}\n \n )}\n \n {onToggleFavourite && action && (\n {\n e.stopPropagation();\n onToggleFavourite(id);\n }}\n >\n \n \n \n \n )}\n {commandType}\n \n );\n}\n\n// Use memo to prevent rerendering of all items when the parent list is updated\nexport default React.memo(CommandListItem);\n",".commandListItem {\n cursor: pointer;\n display: flex !important; /* Necessary due to the neos header bar styling */\n gap: 1em;\n padding: 0.4rem 0.6rem;\n align-items: baseline;\n border-radius: var(--border-radius-item);\n transition: background-color 0.1s ease-in-out, opacity 0.1s ease-in-out;\n background-color: transparent;\n user-select: none;\n --icon-size: 0.875em;\n}\n\n.commandListItem:hover {\n background-color: var(--color-item-hover);\n}\n\n.highlighted {\n background-color: var(--color-item-highlighted);\n}\n\n.disabled {\n opacity: 0.5;\n cursor: not-allowed;\n}\n\n.label {\n display: flex;\n flex-wrap: wrap;\n flex: 1;\n gap: 0.2em 1em;\n align-items: baseline;\n}\n\n.description {\n white-space:pre-wrap;\n font-size: 0.9em;\n}\n\n.type {\n max-width: 30%;\n}\n\n.favouriteButton {\n visibility: hidden;\n border: none;\n background: none;\n cursor: pointer;\n transition: color 0.1s ease-in-out;\n color: var(--textSubtleLight);\n align-self: baseline;\n padding: 0 0.3rem;\n}\n.favouriteButton:hover {\n color: var(--primaryBlue);\n}\n\n.commandListItem:hover .favouriteButton {\n visibility: visible;\n}\n\n.isFavourite {\n display: block;\n color: var(--primaryBlue);\n visibility: visible;\n}\n","import React, { useCallback } from 'react';\nimport { useComputed, useSignalEffect } from '@preact/signals';\n\nimport CommandListItem from '../CommandListItem/CommandListItem';\nimport { useCommandBarState, useCommandExecutor, useIntl, STATUS } from '../../state';\nimport { classnames } from '../../helpers';\n\nimport * as styles from './CommandListing.module.css';\n\nconst CommandList: React.FC = () => {\n const {\n state: {\n commands,\n highlightedItem,\n availableCommandIds,\n status,\n searchWord,\n favouriteCommands,\n recentCommands,\n selectedCommandGroup,\n },\n actions: { ADD_FAVOURITE, REMOVE_FAVOURITE },\n } = useCommandBarState();\n const { translate } = useIntl();\n const { executeCommand } = useCommandExecutor();\n const navRef = React.useRef(null);\n\n useSignalEffect(() => {\n navRef.current\n ?.querySelector(`li:nth-child(${highlightedItem.value})`)\n ?.scrollIntoView({ behavior: 'smooth', block: 'center' });\n });\n\n const handleToggleFavourite = useCallback(\n (commandId: CommandId) => {\n if (favouriteCommands.value.includes(commandId)) {\n REMOVE_FAVOURITE(commandId);\n } else {\n ADD_FAVOURITE(commandId);\n }\n },\n [favouriteCommands]\n );\n\n const suggestions = useComputed(() => {\n return searchWord.value || selectedCommandGroup.value\n ? []\n : availableCommandIds.value.filter((commandId) => recentCommands.value.includes(commandId));\n });\n const availableCommands = useComputed(() => {\n return searchWord.value || selectedCommandGroup.value\n ? availableCommandIds.value\n : availableCommandIds.value.filter((commandId) => !recentCommands.value.includes(commandId));\n });\n const highlightedCommand = useComputed(() => availableCommandIds.value[highlightedItem.value]);\n\n return (\n \n {suggestions.value.length > 0 && (\n <>\n
{translate('CommandList.suggestions', 'Recently used')}
\n
    \n {suggestions.value.map((commandId) => (\n \n ))}\n
\n \n )}\n {availableCommands.value.length > 0 && (\n <>\n
{translate('CommandList.heading', 'Commands')}
\n
    \n {availableCommands.value.map((commandId) => (\n \n ))}\n
\n \n )}\n {availableCommandIds.value.length === 0 && (\n \n {translate('CommandList.noCommandsMessage', 'No matching commands found')}\n \n )}\n \n );\n};\n\nexport default React.memo(CommandList);\n",".results {\n min-height: 0;\n transition: opacity 0.3s ease-in;\n overflow-y: auto;\n max-height: 60vh;\n height: 100%;\n}\n\n.results h6 {\n color: var(--color-light-text);\n margin: 0.5rem;\n font-size: 0.9em;\n font-weight: normal;\n user-select: none;\n}\n\n.results ul {\n padding: 0;\n list-style: none;\n display: flex;\n flex-direction: column;\n gap: 0.5em;\n margin: 0;\n}\n\n.noResults {\n padding: 0.5rem;\n}\n\n.disabled {\n opacity: 0.5 !important;\n pointer-events: none;\n user-select: none;\n}\n","import React from 'react';\nimport { useComputed, useSignalEffect } from '@preact/signals';\n\nimport { useCommandBarState, useCommandExecutor } from '../../state';\nimport CommandListItem from '../CommandListItem/CommandListItem';\n\nimport * as styles from './CommandResultsView.module.css';\n\nconst CommandResultsView: React.FC = () => {\n const {\n state: { result, highlightedOption },\n } = useCommandBarState();\n const { executeCommand } = useCommandExecutor();\n const navRef = React.useRef(null);\n const highlightedId = useComputed(() =>\n result.value ? Object.values(result.value.options)[highlightedOption.value].id : null\n );\n\n useSignalEffect(() => {\n const highlightedIndex = highlightedOption.value;\n navRef.current\n ?.querySelector(`li:nth-child(${highlightedIndex})`)\n ?.scrollIntoView({ behavior: 'smooth', block: 'center' });\n });\n\n const { options, view, message } = result.value ?? {};\n\n return (\n
\n {message &&
{message}
}\n {view ?
{view}
: ''}\n {options && (\n \n )}\n
\n );\n};\n\nexport default CommandResultsView;\n",".commandResultsView {\n max-width: 100%;\n overflow: auto;\n}\n\n.message {\n font-size: 1em;\n}\n\n.results {\n min-height: 0;\n transition: opacity 0.3s ease-in;\n overflow-y: auto;\n max-height: 60vh;\n height: 100%;\n}\n\n.results h6 {\n color: var(--color-light-text);\n margin: 0.5rem;\n font-size: 0.9em;\n font-weight: normal;\n user-select: none;\n}\n\n.results ul {\n padding: 0;\n list-style: none;\n display: flex;\n flex-direction: column;\n gap: 0.5em;\n margin: 0;\n}\n\n.noResults {\n padding: 0.5rem;\n}\n\n.disabled {\n opacity: 0.5 !important;\n pointer-events: none;\n user-select: none;\n}\n","import React from 'react';\n\nimport * as styles from './ToggleButton.module.css';\n\ntype ToggleButtonProps = {\n handleToggle: () => void;\n disabled?: boolean;\n label: string;\n title: string;\n};\n\nconst ToggleButton: React.FC = ({ handleToggle, disabled = false, label, title }) => {\n return (\n \n );\n};\n\nexport default React.memo(ToggleButton);\n",".toggleButton {\n background-color: var(--grayDark);\n border: 1px solid var(--grayMedium);\n color: var(--textSubtleLight);\n border-radius: 6px;\n display: flex;\n align-items: center;\n gap: 0.5em;\n transition: 0.1s ease-out;\n user-select: none;\n padding: 2px 0.3rem 2px 0.5rem;\n cursor: pointer;\n line-height: 1.4em;\n}\n\n.toggleButton:disabled {\n opacity: 0.5;\n cursor: not-allowed;\n}\n\n.toggleButton:not(:disabled):hover {\n background-color: var(--grayLighter);\n color: var(--textOnWhite);\n}\n\n.buttonIcon {\n background-color: var(--gray);\n border-radius: 3px;\n color: var(--textOnGray);\n font-size: 80%;\n padding: 1px 4px;\n transition: background-color 0.1s ease-out;\n}\n\n.toggleButton:not(:disabled):hover .buttonIcon {\n background-color: var(--primaryBlue);\n}\n","import React, { createContext, useCallback, useContext, useMemo } from 'react';\nimport { signal, computed, ReadonlySignal } from '@preact/signals';\n\nimport { CommandBarEvent, commandBarReducer, CommandBarState } from './commandBarReducer';\nimport { flattenCommands, logger } from '../helpers';\nimport { STATUS, TRANSITION } from './commandBarMachine';\nimport { IconWrapper } from '../components';\n\ninterface CommandBarContextProps {\n commands: HierarchicalCommandList;\n children: JSX.Element;\n IconComponent: React.FC;\n userPreferences: UserPreferencesService;\n}\n\ninterface CommandBarContextValues {\n state: {\n activeCommandId: ReadonlySignal;\n activeCommandMessage: ReadonlySignal;\n availableCommandIds: ReadonlySignal;\n commandQuery: ReadonlySignal;\n commands: ReadonlySignal;\n expanded: ReadonlySignal;\n favouriteCommands: ReadonlySignal;\n highlightedItem: ReadonlySignal;\n highlightedOption: ReadonlySignal;\n recentCommands: ReadonlySignal;\n result: ReadonlySignal;\n resultCommandId: ReadonlySignal;\n searchWord: ReadonlySignal;\n selectedCommandGroup: ReadonlySignal;\n showBranding: ReadonlySignal;\n status: ReadonlySignal;\n };\n actions: Record void>;\n Icon: Renderable;\n}\n\nconst CommandBarContext = createContext({} as CommandBarContextValues);\nexport const useCommandBarState = (): CommandBarContextValues => useContext(CommandBarContext);\n\n/**\n * Create the app state and initialize it if it does not exist yet\n */\nfunction createAppState(initialState: CommandBarState) {\n // Define a signal to hold the state\n const commandBarState = signal(initialState);\n\n // Define a function to dispatch events to the reducer and its state machine and update the state with the result\n const dispatch = (event: CommandBarEvent) => {\n commandBarState.value = commandBarReducer(commandBarState.value, event);\n };\n\n // Derive readonly selectors for partial state values\n const activeCommandId = computed(() => commandBarState.value.activeCommandId);\n const activeCommandMessage = computed(() => commandBarState.value.activeCommandMessage);\n const availableCommandIds = computed(() => commandBarState.value.availableCommandIds);\n const commandQuery = computed(() => commandBarState.value.commandQuery);\n const commands = computed(() => commandBarState.value.commands);\n const expanded = computed(() => commandBarState.value.expanded);\n const favouriteCommands = computed(() => commandBarState.value.favouriteCommands);\n const highlightedItem = computed(() => commandBarState.value.highlightedItem);\n const highlightedOption = computed(() => commandBarState.value.highlightedOption);\n const recentCommands = computed(() => commandBarState.value.recentCommands);\n const result = computed(() => commandBarState.value.result);\n const resultCommandId = computed(() => commandBarState.value.resultCommandId);\n const searchWord = computed(() => commandBarState.value.searchWord);\n const selectedCommandGroup = computed(() => commandBarState.value.selectedCommandGroup);\n const showBranding = computed(() => commandBarState.value.showBranding);\n const status = computed(() => commandBarState.value.status);\n\n return {\n state: {\n activeCommandId,\n activeCommandMessage,\n availableCommandIds,\n commandQuery,\n commands,\n expanded,\n favouriteCommands,\n highlightedItem,\n highlightedOption,\n recentCommands,\n result,\n resultCommandId,\n searchWord,\n selectedCommandGroup,\n showBranding,\n status,\n },\n dispatch,\n };\n}\n\nexport const CommandBarStateProvider: React.FC = ({\n commands,\n children,\n IconComponent,\n userPreferences,\n}) => {\n const { state, dispatch } = useMemo(() => {\n return createAppState({\n activeCommandId: null,\n activeCommandMessage: null,\n availableCommandIds: Object.keys(commands),\n commandQuery: '',\n commands: flattenCommands(commands),\n expanded: false,\n favouriteCommands: userPreferences.favouriteCommands,\n highlightedItem: 0,\n highlightedOption: 0,\n recentCommands: userPreferences.recentCommands,\n result: null,\n resultCommandId: null,\n searchWord: '',\n selectedCommandGroup: null,\n showBranding: userPreferences.showBranding,\n status: STATUS.COLLAPSED,\n });\n }, []);\n\n // Provide all actions as shorthand functions\n const actions: Record void | Promise> = useMemo(() => {\n return {\n [TRANSITION.RESET_SEARCH]: () => dispatch({ type: TRANSITION.RESET_SEARCH }),\n [TRANSITION.HIGHLIGHT_NEXT_ITEM]: () => dispatch({ type: TRANSITION.HIGHLIGHT_NEXT_ITEM }),\n [TRANSITION.HIGHLIGHT_PREVIOUS_ITEM]: () => dispatch({ type: TRANSITION.HIGHLIGHT_PREVIOUS_ITEM }),\n [TRANSITION.CANCEL]: () => dispatch({ type: TRANSITION.CANCEL }),\n [TRANSITION.SELECT_GROUP]: (commandId: CommandId) => dispatch({ type: TRANSITION.SELECT_GROUP, commandId }),\n [TRANSITION.GO_TO_PARENT_GROUP]: () => dispatch({ type: TRANSITION.GO_TO_PARENT_GROUP }),\n [TRANSITION.UPDATE_SEARCH]: (searchWord: string) =>\n dispatch({ type: TRANSITION.UPDATE_SEARCH, searchWord }),\n [TRANSITION.UPDATE_COMMAND_QUERY]: (commandQuery: string) =>\n dispatch({ type: TRANSITION.UPDATE_COMMAND_QUERY, commandQuery }),\n [TRANSITION.EXECUTE_COMMAND]: async (commandId: CommandId, message: string) => {\n dispatch({\n type: TRANSITION.EXECUTE_COMMAND,\n commandId,\n message,\n });\n // Update recent commands in the user preferences when a command is executed\n return userPreferences\n .addRecentCommand(commandId)\n .catch((e) => logger.error('Could not add recent command', e));\n },\n [TRANSITION.FINISH_COMMAND]: () => dispatch({ type: TRANSITION.FINISH_COMMAND }),\n [TRANSITION.UPDATE_RESULT]: (result: CommandResult) => dispatch({ type: TRANSITION.UPDATE_RESULT, result }),\n [TRANSITION.EXPAND]: () => dispatch({ type: TRANSITION.EXPAND }),\n [TRANSITION.ADD_FAVOURITE]: (commandId: CommandId) => {\n dispatch({ type: TRANSITION.ADD_FAVOURITE, commandId });\n userPreferences\n .setFavouriteCommands(state.favouriteCommands.value)\n .catch((e) => logger.error('Could not update favourite commands', e));\n },\n [TRANSITION.REMOVE_FAVOURITE]: (commandId: CommandId) => {\n dispatch({ type: TRANSITION.REMOVE_FAVOURITE, commandId });\n userPreferences\n .setFavouriteCommands(state.favouriteCommands.value)\n .catch((e) => logger.error('Could not update favourite commands', e));\n },\n };\n }, []);\n\n const Icon: React.FC = useCallback(({ icon, spin = false }) => {\n return (\n \n \n \n );\n }, []);\n\n return {children};\n};\n","import React, { useCallback, useEffect } from 'react';\n\nimport useFunctionRef from '../hooks/useFunctionRef';\nimport { useCommandBarState } from './CommandBarStateProvider';\nimport { assert, logger } from '../helpers';\nimport { STATUS } from './commandBarMachine';\n\ninterface CommandInputContextProps {\n children: React.ReactElement | React.ReactElement[];\n toggleOpen: () => void;\n dialogRef: React.RefObject;\n open: boolean;\n}\n\ninterface CommandInputContextValues {\n executeCommand: (commandId: CommandId) => void;\n}\n\nconst CommandInputContext = React.createContext({} as CommandInputContextValues);\nexport const useCommandExecutor = (): CommandInputContextValues => React.useContext(CommandInputContext);\n\n/**\n * Context provider for the command bar input and command execution\n */\nexport const CommandBarExecutor: React.FC = ({ children, toggleOpen, dialogRef, open }) => {\n const { state, actions } = useCommandBarState();\n\n const handleKeyEnteredRef = useFunctionRef((e: KeyboardEvent | React.KeyboardEvent) => {\n if (!open || e.defaultPrevented) {\n return;\n }\n if (e.key === 'k' && e.metaKey && dialogRef?.current.contains(e.target as Node)) {\n // Close command bar\n toggleOpen();\n e.stopPropagation();\n e.preventDefault();\n } else if (e.key === 'Escape') {\n // Cancel search, or selection, or close command bar\n e.stopPropagation();\n e.preventDefault();\n if (state.selectedCommandGroup.value || state.searchWord.value || state.commandQuery.value) {\n actions.CANCEL();\n } else {\n // Close command bar if cancel is noop\n toggleOpen();\n }\n } else if (e.key === 'ArrowDown') {\n // Navigate to next command\n e.stopPropagation();\n e.preventDefault();\n actions.HIGHLIGHT_NEXT_ITEM();\n } else if (e.key === 'ArrowUp') {\n // Navigate to previous command\n e.stopPropagation();\n e.preventDefault();\n actions.HIGHLIGHT_PREVIOUS_ITEM();\n } else if (e.key === 'Enter') {\n // Execute highlighted command\n e.stopPropagation();\n e.preventDefault();\n\n // Select the highlighted command by default\n let commandId = state.availableCommandIds.value[state.highlightedItem.value];\n if (state.status.value === STATUS.DISPLAYING_RESULT) {\n // If there are options the command to execute is the highlighted option\n if (Object.values(state.result.value.options).length) {\n commandId = Object.keys(state.result.value.options)[state.highlightedOption.value];\n } else {\n // If there are no options we run the command which generated the result again\n commandId = state.resultCommandId.value;\n }\n }\n\n if (commandId) {\n void executeCommand(commandId);\n }\n }\n });\n\n const executeCommand = useCallback(\n async (commandId: CommandId) => {\n const command = state.result.value?.options[commandId] ?? state.commands.value[commandId];\n const { action, canHandleQueries, subCommandIds, name } = command;\n\n // If the command is a group, select it\n if (subCommandIds?.length > 0) {\n actions.SELECT_GROUP(commandId);\n return;\n }\n\n assert(action, `Command ${commandId} has no action`);\n\n // If the command is a url, open it\n if (typeof action == 'string') {\n // We wait for the state change to be finished before opening the url\n await actions.EXECUTE_COMMAND(commandId, 'Loading url');\n\n // We need to check if the url is in the same domain, otherwise we need to open it in a new tab\n // TODO: We should add another option to a link command to define its target\n if (action.indexOf('http') === 0 && action.indexOf(document.location.origin) !== 0) {\n window.open(action, '_blank', 'noopener,noreferrer')?.focus();\n } else {\n window.location.href = action;\n }\n return actions.FINISH_COMMAND();\n }\n\n // If the command is a function, execute it\n actions.EXECUTE_COMMAND(commandId, 'Running command');\n const actionResult = action(canHandleQueries ? state.commandQuery.value : undefined);\n if ((actionResult as AsyncCommandResult).then) {\n // Handle Promises\n (actionResult as AsyncCommandResult)\n .then((result) => {\n if (result && !result.success) {\n throw new Error(`The command \"${name}\" failed`);\n }\n })\n .catch((error) => {\n // TODO: Show an error message to the user\n logger.error('Command error', name, error);\n })\n .finally(() => {\n actions.FINISH_COMMAND();\n });\n } else if ((actionResult as CommandGeneratorResult).next) {\n // Handle generators\n const generator = actionResult as CommandGeneratorResult;\n // TODO: Handle errors / success === false\n for await (const result of generator) {\n actions.UPDATE_RESULT(result);\n }\n actions.FINISH_COMMAND();\n } else {\n logger.error('Command result is not a promise or generator', actionResult);\n }\n\n if (command.closeOnExecute) {\n toggleOpen();\n }\n },\n [state.searchWord, state.commands, state.result]\n );\n\n const executeCommandRef = useFunctionRef((commandId: CommandId) => {\n void executeCommand(commandId);\n });\n\n /**\n * Add key event handler, needs to be updated when any parameter for the key event handler changes\n */\n useEffect(() => {\n if (!open) return;\n\n // const guestFrame = document.getElementsByName('neos-content-main')[0] as HTMLIFrameElement;\n // guestFrame.contentWindow?.addEventListener('keyup', (e) => {\n // log.debug('keypress in guestframe', e);\n // });\n // log.debug('guestFrame', guestFrame.contentWindow);\n\n const windowKeyEventHandler = (e) => handleKeyEnteredRef.current(e);\n\n window.addEventListener('keydown', windowKeyEventHandler);\n return () => window.removeEventListener('keydown', windowKeyEventHandler);\n }, [open]);\n\n return (\n \n {children}\n \n );\n};\n","import React, { createContext, ReactNode, useContext } from 'react';\n\ntype IntlProviderProps = {\n children: ReactNode;\n translate: TranslateFunction;\n};\n\ntype IntlProviderValues = {\n translate: TranslateFunction;\n};\n\nexport const IntlContext = createContext({} as IntlProviderValues);\nexport const useIntl = (): IntlProviderValues => useContext(IntlContext);\n\nexport const IntlProvider = ({ translate, children }: IntlProviderProps) => {\n return {children};\n};\n","import React, { CSSProperties, DragEventHandler, useCallback, useEffect, useRef } from 'react';\nimport { batch, useComputed, useSignal } from '@preact/signals';\n\nimport { CommandBarFooter, CommandBarHeader, CommandList, CommandResultsView } from '../index';\nimport { CommandBarExecutor, useCommandBarState } from '../../state';\nimport { clamp, classnames } from '../../helpers';\n\nimport * as styles from './CommandBarDialog.module.css';\n\ninterface CommandBarDialogProps {\n onDrag?: (state: boolean) => void;\n open: boolean;\n toggleOpen: () => void;\n}\n\nconst CommandBarDialog: React.FC = ({ onDrag, open, toggleOpen }) => {\n const {\n state: { expanded, result },\n } = useCommandBarState();\n const dialogRef = useRef(null);\n\n const isDragging = useSignal(false);\n const dialogPosition = useSignal<{\n left: number;\n top: number;\n }>({\n left: window.innerWidth / 2 - 300,\n top: window.innerHeight / 2 - 20,\n });\n const dragStateOffset = useSignal<{\n offsetLeft: number;\n offsetTop: number;\n }>({\n offsetLeft: 0,\n offsetTop: 0,\n });\n const hasBeenDragged = useSignal(false);\n\n const dialogStyle = useComputed(() => {\n const { left, top } = dialogPosition.value;\n return (\n hasBeenDragged.value\n ? {\n left: left + 'px',\n top: top + 'px',\n translate: 'none',\n visibility: isDragging.value ? 'hidden' : 'visible',\n }\n : {}\n ) as CSSProperties;\n });\n\n const reposition = useCallback((left: number, top: number) => {\n const dialogSize = dialogRef.current.getBoundingClientRect();\n dialogPosition.value = {\n left: clamp(left, 0, window.innerWidth - dialogSize.width),\n top: clamp(top, 0, window.innerHeight - dialogSize.height),\n };\n }, []);\n\n const handleDragStart: DragEventHandler = useCallback(\n (e) => {\n // @ts-ignore\n if (e.target.tagName === 'INPUT') {\n return;\n }\n console.debug('dragstart');\n e.dataTransfer.setData('text/plain', 'CommandBar');\n e.dataTransfer.dropEffect = 'move';\n e.dataTransfer.effectAllowed = 'move';\n\n batch(() => {\n dragStateOffset.value = {\n offsetLeft: e.clientX - dialogRef.current.offsetLeft,\n offsetTop: e.clientY - dialogRef.current.offsetTop,\n };\n hasBeenDragged.value = true;\n });\n\n onDrag && onDrag(true);\n },\n [dialogRef.current]\n );\n\n const handleDragDrop = useCallback(\n (e: DragEvent) => {\n const { clientX, clientY } = e;\n console.debug('dragdrop', clientX, clientY, dragStateOffset.value);\n batch(() => {\n isDragging.value = false;\n reposition(clientX - dragStateOffset.value.offsetLeft, clientY - dragStateOffset.value.offsetTop);\n });\n onDrag && onDrag(false);\n },\n [dialogRef.current]\n );\n\n const onResize = useCallback(() => reposition(dialogPosition.value.left, dialogPosition.value.top), []);\n\n useEffect(() => {\n if (!open) return;\n dialogRef.current?.parentElement?.addEventListener('drop', handleDragDrop);\n window.addEventListener('resize', onResize);\n return () => {\n dialogRef.current?.parentElement?.removeEventListener('drop', handleDragDrop);\n window.removeEventListener('resize', onResize);\n };\n }, [open, onResize, handleDragDrop]);\n\n if (!open) {\n return null;\n }\n\n return (\n (isDragging.value = true)}\n style={dialogStyle.value}\n data-testid=\"CommandBarDialog\"\n >\n \n \n \n {expanded.value && }\n {result.value && }\n
\n \n \n \n );\n};\n\nexport default CommandBarDialog;\n",".commandBar {\n backdrop-filter: blur(var(--dialog-blur));\n background: var(--bar-background);\n border-radius: var(--border-radius-bar, 5);\n border: 1px solid var(--color-border);\n box-shadow: 0 3px 10px rgba(0, 0, 0, 0.5);\n color: white;\n display: flex;\n flex-direction: column;\n left: 50%;\n margin: 0;\n max-width: var(--bar-max-width);\n min-width: var(--bar-min-width);\n max-height: 90vh;\n overflow: hidden;\n position: absolute;\n padding: 0;\n top: 50%;\n translate: -50% -50%;\n width: var(--bar-width);\n pointer-events: all;\n transition: width 0.1s ease-out;\n}\n\n.commandBar.hasResults {\n width: var(--bar-width-expanded);\n}\n\n.commandBar small {\n color: var(--color-light-text);\n font-size: 90%;\n}\n\n.commandBar ::-webkit-scrollbar {\n width: 4px;\n height: 4px;\n}\n\n.commandBar ::-webkit-scrollbar-track {\n background-color: transparent;\n}\n\n.commandBar ::-webkit-scrollbar-thumb {\n background-color: var(--grayLight);\n}\n\n.commandBar ::-webkit-scrollbar-corner {\n background-color: var(--grayDark);\n}\n\n.resultsWrap {\n display: grid;\n grid-template-rows: 0fr;\n transform-origin: top center;\n transition: grid-template-rows 0.2s ease-in;\n overflow: auto;\n}\n\n.resultsWrap > * {\n opacity: 0;\n}\n\n.resultsWrap.expanded {\n grid-template-rows: 1fr;\n}\n\n.resultsWrap.expanded > * {\n opacity: 1;\n padding: 0.5rem;\n}\n.resultsWrap.split {\n grid-template-columns: 1fr 1fr;\n}\n","import React from 'react';\n\nimport { CommandBarStateProvider, IntlProvider } from './state';\nimport CommandBarDialog from './components/CommandBarDialog/CommandBarDialog';\n\nimport './Variables.module.css';\n\ntype CommandBarProps = {\n commands: HierarchicalCommandList;\n open: boolean;\n toggleOpen: () => void;\n onDrag?: (state: boolean) => void;\n IconComponent: React.FC;\n userPreferences: UserPreferencesService;\n translate: TranslateFunction;\n};\n\nconst CommandBar: React.FC = ({\n commands,\n open,\n toggleOpen,\n onDrag,\n IconComponent,\n userPreferences,\n translate,\n}) => {\n return (\n \n \n \n \n \n );\n};\n\nexport default CommandBar;\n","export async function fetchData(endpoint: string, params?: Record, method = 'GET'): Promise {\n if (params && method === 'GET') {\n endpoint = Object.keys(params).reduce((url, key) => {\n return url + '&' + key + '=' + encodeURIComponent(params[key]);\n }, endpoint + '?');\n }\n return fetch(endpoint, {\n method,\n credentials: 'include',\n body: params && method === 'POST' ? JSON.stringify(params) : undefined,\n headers: {\n // FIXME: Include CSRF Token\n // 'X-Flow-Csrftoken': csrfToken,\n 'Content-Type': 'application/json',\n Accept: 'application/json',\n },\n }).then((response: Response) => {\n if (response.status !== 200) {\n throw new Error(`The request failed with code ${response.status}: \"${response.statusText}\"`);\n }\n if (response.headers.get('Content-Type')?.includes('application/json')) {\n return response.json();\n }\n return response.text();\n }) as Promise;\n}\n","import { fetchData } from './fetch';\n\nconst ENDPOINT_GET_PREFERENCES = '/neos/shel-neos-commandbar/preferences/getpreferences';\nconst ENDPOINT_SET_FAVOURITE_COMMANDS = '/neos/shel-neos-commandbar/preferences/setfavourites';\nconst ENDPOINT_ADD_RECENT_COMMAND = '/neos/shel-neos-commandbar/preferences/addrecentcommand';\n\nasync function setPreference(endpoint: string, data: any): Promise {\n return fetchData(endpoint, data, 'POST');\n}\n\nexport async function getPreferences() {\n return fetchData(ENDPOINT_GET_PREFERENCES);\n}\n\nexport async function setFavouriteCommands(commandIds: CommandId[]) {\n return setPreference(ENDPOINT_SET_FAVOURITE_COMMANDS, { commandIds: commandIds });\n}\n\nexport async function addRecentCommand(commandId: CommandId) {\n // TODO: Check if sendBeacon is a better option here to reduce the impact on the user\n return setPreference(ENDPOINT_ADD_RECENT_COMMAND, { commandId: commandId });\n}\n","import { fetchData } from './fetch';\n\nconst ENDPOINT_COMMANDS = '/neos/service/data-source/shel-neos-commandbar-commands';\n\nexport async function getCommands() {\n return fetchData(ENDPOINT_COMMANDS);\n}\n","import { fetchData } from './fetch';\n\nconst ENDPOINT_SEARCH_NEOS_DOCS = '/neos/service/data-source/shel-neos-commandbar-search-neos-docs';\n\nexport async function searchNeosDocs(query: string): Promise {\n return query ? fetchData(ENDPOINT_SEARCH_NEOS_DOCS, { query }) : {};\n}\n","import { fetchData } from './fetch';\n\nconst ENDPOINT_SEARCH_NEOS_PACKAGES = '/neos/service/data-source/shel-neos-commandbar-search-neos-packages';\n\nexport async function searchNeosPackages(query: string): Promise {\n return query ? fetchData(ENDPOINT_SEARCH_NEOS_PACKAGES, { query }) : {};\n}\n",".pluginWrap {\n display: flex;\n align-items: center;\n height: 41px;\n font-size: 14px !important;\n line-height: 20px;\n margin: 0 1rem;\n}\n\n.fullScreenLayer {\n width: 100vw;\n height: 100vh;\n position: absolute;\n left: 0;\n top: 0;\n pointer-events: none;\n z-index: 9999;\n display: none;\n}\n\n.open {\n display: block;\n}\n\n@keyframes spin {\n 0% { transform: rotate(0deg); }\n 100% { transform: rotate(359deg); }\n}\n\n.spin {\n animation: spin 2s linear infinite;\n}\n","import React from 'preact/compat';\nimport * as styles from './ModulePlugin.module.css';\n\n/**\n * As we don't have font awesome in the shadow dom, we need to render a fallback icon for commands\n */\nconst IconComponent: React.FC = ({ spin = false }) => {\n return (\n \n \n \n );\n};\n\nexport default IconComponent;\n","import { Component } from 'preact';\nimport React from 'preact/compat';\n\nimport { CommandBar, logger, ToggleButton } from '@neos-commandbar/commandbar';\nimport { PreferencesApi, CommandsApi, DocumentationApi, PackagesApi } from '@neos-commandbar/neos-api';\nimport IconComponent from './IconComponent';\n\nimport * as styles from './ModulePlugin.module.css';\n\n/**\n * This is a custom element that is used to render the command bar inside a shadow dom to prevent Neos and module\n * styles from leaking into the component\n */\nexport default class App extends Component<\n {\n styleuri: string;\n },\n {\n initialized: boolean;\n open: boolean;\n dragging: boolean;\n commands: HierarchicalCommandList;\n preferences: {\n favouriteCommands: CommandId[];\n recentCommands: CommandId[];\n recentDocuments: NodeContextPath[];\n showBranding: boolean;\n };\n }\n> {\n static tagName = 'command-bar-container';\n static options = { shadow: true };\n private static i18nRegistry: NeosI18n;\n\n constructor() {\n super();\n App.i18nRegistry = (window as NeosModuleWindow).NeosCMS.I18n;\n this.state = {\n initialized: false,\n open: false,\n dragging: false,\n // TODO: Only load the search commands in dev context\n commands: {\n searchNeosDocs: {\n name: App.translate('CommandBarUiPlugin.command.documentation', 'Documentation'),\n description: App.translate(\n 'CommandBarUiPlugin.command.documentation.description',\n 'Browse or search the Neos documentation'\n ),\n icon: 'book',\n canHandleQueries: true,\n action: this.handleSearchNeosDocs.bind(this),\n },\n searchNeosPackages: {\n name: App.translate('CommandBarUiPlugin.command.packages', 'Packages'),\n description: App.translate(\n 'CommandBarUiPlugin.command.packages.description',\n 'Search for Neos packages'\n ),\n icon: 'boxes',\n canHandleQueries: true,\n action: this.handleSearchNeosPackages.bind(this),\n },\n },\n preferences: { favouriteCommands: [], recentCommands: [], recentDocuments: [], showBranding: true },\n };\n }\n\n /**\n * Wrapper for the Neos backend translation api\n */\n private static translate: TranslateFunction = (id, paramsOrFallback, fallback) => {\n if (typeof paramsOrFallback === 'string') {\n fallback = paramsOrFallback;\n paramsOrFallback = {};\n }\n return App.i18nRegistry.translate(id, fallback, 'Shel.Neos.CommandBar', 'Main', paramsOrFallback);\n };\n\n /**\n * Load the commands and preferences from the server and set the state to initialized\n */\n async componentDidMount() {\n try {\n const preferences = await PreferencesApi.getPreferences();\n const commands = await CommandsApi.getCommands();\n this.setState((prev) => ({ initialized: true, preferences, commands: { ...prev.commands, ...commands } }));\n\n document.addEventListener('keydown', (e) => {\n if (e.key === 'k' && e.metaKey) {\n e.stopPropagation();\n e.preventDefault();\n this.handleToggle();\n }\n });\n } catch (e) {\n logger.error(e);\n }\n }\n\n handleToggle = () => {\n this.setState(({ open }) => ({\n open: !open,\n }));\n };\n\n handleDrag = (dragging: boolean) => {\n this.setState({ dragging: dragging });\n };\n\n handleSearchNeosDocs = async function* (query: string): CommandGeneratorResult {\n yield {\n success: true,\n message: App.translate(\n 'CommandBarUiPlugin.command.documentation.searching',\n { query },\n `Search for \"${query}\"`\n ),\n };\n let error;\n const options = await DocumentationApi.searchNeosDocs(query).catch((e) => {\n logger.error('Could not search Neos docs', e);\n error = e.message;\n });\n if (error || !options) {\n yield {\n success: false,\n message: App.translate('CommandBarUiPlugin.command.documentation.error', 'Search failed'),\n view: error,\n };\n } else {\n yield {\n success: true,\n message: App.translate(\n 'CommandBarUiPlugin.command.documentation.matches',\n { matches: Object.keys(options).length },\n `${Object.values(options).length} options match your query`\n ),\n options,\n };\n }\n };\n\n handleSearchNeosPackages = async function* (query: string): CommandGeneratorResult {\n yield {\n success: true,\n message: App.translate('CommandBarUiPlugin.command.packages.searching', { query }, `Search for \"${query}\"`),\n };\n let error;\n const options = await PackagesApi.searchNeosPackages(query).catch((e) => {\n logger.error('Could not search Neos packages', e);\n error = e.message;\n });\n if (error || !options) {\n yield {\n success: false,\n message: App.translate('CommandBarUiPlugin.command.packages.error', 'Search failed'),\n view: error,\n };\n } else {\n yield {\n success: true,\n message: App.translate(\n 'CommandBarUiPlugin.command.packages.matches',\n { matches: Object.values(options).length },\n `${Object.values(options).length} options match your query`\n ),\n options,\n };\n }\n };\n\n render() {\n const { initialized, open, dragging, commands, preferences } = this.state;\n\n return (\n <>\n \n
\n \n {initialized && (\n e.preventDefault()}\n style={dragging ? { pointerEvents: 'all' } : null}\n >\n \n
\n )}\n \n \n );\n }\n}\n","import register from 'preact-custom-element';\n\nimport App from './App';\n\n// @ts-ignore\nif (process.env.NODE_ENV !== 'production') {\n // @ts-ignore\n require('preact/debug');\n}\n\n// Register & add the debug web component, tagName and attributes are automatically read from the component\nregister(App, null, null, App.options);\n\nwindow.addEventListener('neoscms-i18n-initialized', () => {\n // Get the top bar left container and create a custom element to render the command bar into\n const topBarLeft = document.querySelector('.neos-top-bar-left');\n const pluginContainer = document.createElement('command-bar-container');\n pluginContainer.id = 'shel-neos-commandbar';\n\n // Get the style tag of the command bar package from the HTML head to also load it inside the custom element\n const commandBarStyleTag = document.querySelector(\n 'link[rel=\"stylesheet\"][href*=\"Shel.Neos.CommandBar\"]'\n ) as HTMLLinkElement;\n pluginContainer.setAttribute('styleuri', commandBarStyleTag.href);\n\n topBarLeft.appendChild(pluginContainer);\n});\n"],"names":["slice","options","vnodeId","rerenderQueue","prevDebounce","defer","i","EMPTY_OBJ","EMPTY_ARR","IS_NON_DIMENSIONAL","assign","obj","props","removeNode","node","parentNode","removeChild","createElement","type","children","key","ref","normalizedProps","arguments","length","call","defaultProps","createVNode","original","vnode","__k","__","__b","__e","__d","__c","__h","constructor","__v","Fragment","Component","context","this","getDomSibling","childIndex","indexOf","sibling","updateParentDomPointers","child","base","enqueueRender","c","push","process","__r","debounceRendering","renderQueueLength","component","commitQueue","oldVNode","oldDom","parentDom","sort","a","b","shift","diff","ownerSVGElement","commitRoot","diffChildren","renderResult","newParentVNode","oldParentVNode","globalContext","isSvg","excessDomChildren","isHydrating","j","childVNode","newDom","firstChildDom","refs","oldChildren","oldChildrenLength","Array","isArray","reorderChildren","placeChild","getLastDom","nextSibling","unmount","applyRef","tmp","toChildArray","out","some","nextDom","sibDom","outer","appendChild","insertBefore","lastDom","setStyle","style","value","setProperty","test","dom","name","oldValue","useCapture","o","cssText","replace","toLowerCase","l","addEventListener","eventProxyCapture","eventProxy","removeEventListener","e","removeAttribute","setAttribute","event","newVNode","isNew","oldProps","oldState","snapshot","clearProcessingException","newProps","provider","componentContext","renderHook","count","newType","contextType","__E","prototype","render","doRender","sub","state","__n","_sb","__s","getDerivedStateFromProps","componentWillMount","componentDidMount","componentWillReceiveProps","shouldComponentUpdate","forEach","componentWillUpdate","componentDidUpdate","__P","getChildContext","getSnapshotBeforeUpdate","oldHtml","newHtml","nodeType","localName","document","createTextNode","createElementNS","is","data","childNodes","dangerouslySetInnerHTML","attributes","__html","innerHTML","diffProps","hydrate","checked","diffElementNodes","diffed","root","cb","current","parentVNode","skipRemove","r","componentWillUnmount","replaceNode","firstChild","cloneElement","createContext","defaultValue","contextId","Consumer","contextValue","Provider","subs","ctx","_props","old","splice","$8ce2b6e41a0de290$var$r","Object","t","n","hasOwnProperty","apply","ContextProvider","rest","connectedCallback","CustomEvent","detail","bubbles","cancelable","dispatchEvent","_vdom","h","toVdom","element","nodeName","cn","toCamelCase","slot","Slot","wrappedChildren","_vdomComponent","hasAttribute","_root","str","_","toUpperCase","attributeChangedCallback","newValue","disconnectedCallback","_this","_listener","stopPropagation","error","errorInfo","ctor","handled","getDerivedStateFromError","setState","componentDidCatch","update","callback","s","forceUpdate","Promise","then","bind","resolve","setTimeout","isStaticChildren","__source","__self","currentIndex","currentComponent","previousComponent","prevRaf","currentHook","afterPaintEffects","EMPTY","oldBeforeDiff","oldBeforeRender","oldAfterDiff","oldCommit","oldBeforeUnmount","getHookState","index","hooks","__H","__V","useState","initialState","useReducer","invokeOrReturn","reducer","init","hookState","_reducer","action","currentValue","__N","nextValue","_hasScuFromHooks","prevScu","p","stateHooks","filter","x","every","shouldUpdate","hookItem","useEffect","args","argsChanged","_pendingArgs","useLayoutEffect","useRef","initialValue","useMemo","factory","useCallback","useContext","flushAfterPaintEffects","invokeCleanup","invokeEffect","requestAnimationFrame","afterNextFrame","hasErrored","HAS_RAF","raf","done","clearTimeout","timeout","cancelAnimationFrame","hook","comp","cleanup","oldArgs","newArgs","arg","f","shallowDiffers","y","PureComponent","isPureReactComponent","oldDiffHook","__f","REACT_FORWARD_SYMBOL","Symbol","for","mapFn","fn","map","Children","only","normalized","toArray","oldCatchError","oldUnmount","detachedClone","detachedParent","effect","removeOriginal","originalParent","Suspense","__u","_suspenders","suspended","__a","SuspenseList","_next","_map","__R","promise","suspendingVNode","suspendingComponent","resolved","onResolved","onSuspensionComplete","suspendedVNode","pop","wasHydrating","detachedComponent","__O","fallback","list","delete","revealOrder","size","Portal","container","_container","_temp","before","delegated","get","unsuspend","wrappedUnsuspend","Map","reverse","set","REACT_ELEMENT_TYPE","CAMEL_PROPS","IS_DOM","onChangeInputType","isReactComponent","defineProperty","configurable","v","writable","oldEventHook","empty","isPropagationStopped","cancelBubble","isDefaultPrevented","defaultPrevented","persist","nativeEvent","classNameDescriptor","class","oldVNodeHook","nonCustomElement","multiple","selected","className","enumerable","$$typeof","oldDiffed","isValidElement","startTransition","useId","__m","mask","useInsertionEffect","useTransition","useDeferredValue","val","useSyncExternalStore","subscribe","getSnapshot","_useState","_instance","_getSnapshot","useImperativeHandle","createHandle","concat","useDebugValue","formatter","version","parent","textContent","preactRender","preactHydrate","unmountComponentAtNode","createPortal","el","containerInfo","createFactory","preactCloneElement","createRef","findDOMNode","memo","comparer","nextProps","updateRef","Memoed","displayName","forwardRef","Forwarded","clone","flushSync","unstable_batchedUpdates","StrictMode","lazy","loader","prom","Lazy","exports","default","__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED","ReactCurrentDispatcher","readContext","$1b06254f22bdd07e$export$2e2bcd8739ae039","fnRef","$d6bdfea1a1e13052$export$b8f5890fc79d6aca","cycleDetected","Error","endBatch","batchDepth","hasError","batchedEffect","_effect","batchIteration","next","_nextBatchedEffect","_flags","needsToRecompute","_callback","err","batch","evalContext","globalVersion","addDependency","signal","_node","_target","_version","_source","_prevSource","_sources","_nextSource","_prevTarget","_nextTarget","_rollbackNode","_subscribe","Signal","_value","_targets","target","_refresh","prepareSources","rollbackNode","cleanupSources","head","prev","_unsubscribe","Computed","compute","_compute","_globalVersion","computed","cleanupEffect","_cleanup","prevContext","disposeEffect","endEffect","Effect","_dispose","hookName","hookFn","setCurrentUpdater","updater","finishUpdate","_start","Text","_ref","currentSignal","useSignal","_updateFlags","_updater","peek","createPropUpdater","prop","propSignal","setAsProperty","changeSignal","_update","newSignal","useComputed","$compute","useSignalEffect","$edcc64b978b003b2$export$2e2bcd8739ae039","commands","parentId","keys","reduce","commandList","commandId","icon","description","subCommands","canHandleQueries","closeOnExecute","category","executeManually","absoluteCommandId","subCommandIds","subCommandId","id","flag","valueOf","toString","_notify","OUTDATED","finish","defineProperties","signalProps","__np","renderedProps","_updaters","updaters","_signal","_updater2","HAS_PENDING_UPDATE","_i","$ea926074f08a4cd5$var$PREFIX","$ea926074f08a4cd5$export$2e2bcd8739ae039","ok","message","console","log","warn","debug","$197034fc7f52566b$export$2e2bcd8739ae039","min","max","Math","$44ee2883445aae00$var$cmp","Intl","Collator","compare","$44ee2883445aae00$var$inf","Infinity","$44ee2883445aae00$var$NEGS_RE","$44ee2883445aae00$var$OPTS","interSplit","intraSplit","intraBound","interLft","interRgt","interChars","interIns","intraChars","intraIns","intraContr","intraMode","intraSlice","intraSub","intraTrn","intraDel","intraFilt","term","match","info","haystack","needle","idx","chars","terms","interLft2","interLft1","start","ia","ib","$44ee2883445aae00$var$lazyRepeat","limit","$44ee2883445aae00$var$mode2Tpl","$44ee2883445aae00$export$2e2bcd8739ae039","opts","_intraSplit","_interSplit","_intraBound","intraRules","_intraSlice","_intraIns","_intraSub","_intraTrn","_intraDel","plen","withIntraSplit","RegExp","trimRe","contrsRe","split","m","prepQuery","capt","interOR","parts","reTpl","contrs","fill","pi","lftIdx","rgtIdx","lftChar","rgtChar","numChars","variants","intraInsTpl","join","preTpl","sufTpl","interCharsTpl","idxs","query","withIntraBound","interBound","queryR","partsLen","len","field","interRgt2","interRgt1","ranges","mayDiscard","ii","mhstr","idxAcc","disc","lft2","lft1","rgt2","rgt1","inter","intra","refine","k","group","termLen","groupLen","fullMatch","idxOf","refineMatch","lftCharIdx","rgtCharIdx","isPre","isSuf","junk","junkIdx","m2","found","re","exec","charIdx","from","to","refLen","ri","lastRi","idxInNext","matchLen","offset","prepend","search","outOfOrder","infoThresh","preFiltered","negsRe","needles","matches","negs","trim","terms2","ti","$44ee2883445aae00$var$permute","perm","matchedIdxs","Set","ni","preFiltered2","has","matched","add","retInfo","retOrder","acc","_info","order","_search","$44ee2883445aae00$var$latinize","accents","A","E","I","O","U","u","C","N","S","accentsMap","accentsTpl","accentsRe","replacer","strings","arr","result","$44ee2883445aae00$var$_mark","part","$44ee2883445aae00$var$_append","latinize","permute","highlight","mark","accum","append","substring","fr","$f5323048963c3f50$var$uf","$f5323048963c3f50$export$2e2bcd8739ae039","selectedCommandGroup","searchWord","favourites","recentCommands","availableCommands","values","command","includes","favouriteCommands","aIsRecent","bIsRecent","aIsFavourite","bIsFavourite","localeCompare","$f5323048963c3f50$var$sortCommands","availableCommandNames","indices","$187cc7d792701051$export$2e2bcd8739ae039","condition","$4de6e96dcc9c5973$export$2e2bcd8739ae039","Boolean","$4327cc3088ca9bcc$export$e50006273435e7d4","STATUS","$4327cc3088ca9bcc$export$f2127cf693ff3edc","TRANSITION","$4327cc3088ca9bcc$export$9523889e0a5da4ba","ACTION","COLLAPSED","$4327cc3088ca9bcc$export$ea56d40cd27c3480","collapsed","on","UPDATE_SEARCH","IDLE","actions","EXPAND","SET_SEARCH_WORD","REFRESH_COMMANDS","HIGHLIGHT_NEXT_ITEM","idle","RESET_HIGHLIGHT","HIGHLIGHT_NEXT_COMMAND","HIGHLIGHT_PREVIOUS_ITEM","HIGHLIGHT_PREVIOUS_COMMAND","CANCEL","RESET_SEARCH_OR_LEAVE_GROUP","EXECUTE_COMMAND","EXECUTING_COMMAND","ADD_RECENTLY_USED","SET_ACTIVE_COMMAND","GO_TO_PARENT_GROUP","LEAVE_GROUP","SELECT_GROUP","RESET_SEARCH","SET_GROUP","ADD_FAVOURITE","REMOVE_FAVOURITE","executingCommand","UPDATE_RESULT","DISPLAYING_RESULT","FINISH_COMMAND","UNSET_ACTIVE_COMMAND","displayingResult","UPDATE_COMMAND_QUERY","SET_COMMAND_QUERY","RESET_OPTION_HIGHLIGHT","HIGHLIGHT_NEXT_OPTION","HIGHLIGHT_PREVIOUS_OPTION","UNSET_RESULT","$4327cc3088ca9bcc$export$66bb15e2994e6a26","actionCallback","nextStateNode","status","nextState","$3bdb7eb1bca92625$var$runAction","highlightedItem","availableCommandIds","highlightedOption","commandQuery","expanded","activeCommandId","activeCommandMessage","success","view","resultCommandId","unshift","$3bdb7eb1bca92625$export$9e3f7bba62d514d7","$5105b2e4b958e09e$export$2e2bcd8739ae039","$a35043596f133777$export$2e2bcd8739ae039","$1f5e800e7e637d25$export$2e2bcd8739ae039","showBranding","$c92c3390bd0178a7$export$53e25b3b0bb3833c","translate","$16998066b180f6ef$export$5aebe9a147f4d146","href","title","rel","xmlns","width","height","viewBox","gradientUnits","x1","y1","x2","y2","stopColor","d","transform","$a9d8acb8ffa4eae4$export$9f1a005b19e034c8","$04a90802deaf6510$export$1440ab2404307ace","$aa76484c3e1ffc63$export$bd96d8defd13d2a9","$5dcc0a8fea92bfd7$export$bfe304c803da70de","$d8d8e5123e381d27$export$4b2505a64d1f53bd","$2aa32f662e9078f8$export$2e2bcd8739ae039","Icon","runningCommand","$2f74d86b545ec476$export$e3d20747ab930783","$87c672bf702cb1a4$var$updateResultsTimer","$87c672bf702cb1a4$export$2e2bcd8739ae039","executeCommand","$1ea80d3c959bcb5f$export$40a06c0c5b3ff9aa","inputRef","handleChange","$d6bdfea1a1e13052$export$35808ee640e87ca7","handleKeyPress","preventDefault","$2f74d86b545ec476$export$ed99038c4a6f842a","focus","placeholder","autoFocus","onChange","onKeyUp","onClick","$937f9e11bd53a43f$export$2e2bcd8739ae039","isDisplayingResults","$b1dbce9614761190$var$CommandListItem","onItemSelect","highlightedId","onToggleFavourite","commandType","$b1dbce9614761190$var$getCommandType","isHighlighted","isFavourite","$b1dbce9614761190$export$2e2bcd8739ae039","$8564955bb37d770f$var$CommandList","navRef","querySelector","scrollIntoView","behavior","block","handleToggleFavourite","suggestions","highlightedCommand","$8564955bb37d770f$export$2e2bcd8739ae039","$798ea27d8acd4548$export$2e2bcd8739ae039","highlightedIndex","$2a001a2eafdc7fa7$export$2e2bcd8739ae039","handleToggle","disabled","label","$c92c3390bd0178a7$var$CommandBarContext","$450fc775b2f7950e$export$fd42f52fd3ae1109","$d6bdfea1a1e13052$export$fae74005e78b1a27","$c92c3390bd0178a7$export$8ffac7c47764ac1d","IconComponent","userPreferences","dispatch","$d6bdfea1a1e13052$export$1538c33de8887b59","commandBarState","$0ed7988ef29ac9ba$export$e2ef10f86a8d60e8","$0ed7988ef29ac9ba$export$2983e091f1a1e8e2","$c92c3390bd0178a7$var$createAppState","async","addRecentCommand","catch","setFavouriteCommands","spin","$1ea80d3c959bcb5f$var$CommandInputContext","$1ea80d3c959bcb5f$export$c67beff7acfe625","toggleOpen","dialogRef","open","handleKeyEnteredRef","metaKey","contains","location","origin","window","actionResult","undefined","finally","generator","executeCommandRef","$d6bdfea1a1e13052$export$6d9c69b0de29b591","windowKeyEventHandler","$16998066b180f6ef$export$9073ae457aa4b186","$16998066b180f6ef$export$480518999dfc4151","$e407a5ca25d14613$export$2e2bcd8739ae039","onDrag","isDragging","$2f74d86b545ec476$export$65d8bf213f6a4478","dialogPosition","left","innerWidth","top","innerHeight","dragStateOffset","offsetLeft","offsetTop","hasBeenDragged","dialogStyle","visibility","reposition","dialogSize","getBoundingClientRect","handleDragStart","tagName","dataTransfer","setData","dropEffect","effectAllowed","$0ed7988ef29ac9ba$export$712ea50be43a7858","clientX","clientY","handleDragDrop","onResize","parentElement","draggable","onDragStart","$0a82af2c679f148f$export$2e2bcd8739ae039","$6b9d0563b231bc8e$export$8134c072fddab6a5","endpoint","params","method","url","encodeURIComponent","fetch","credentials","body","JSON","stringify","headers","Accept","response","statusText","json","text","$524075ade96a5510$var$setPreference","$524075ade96a5510$export$1de6a888ae076ff8","$524075ade96a5510$export$df984a4ad36be2aa","commandIds","$524075ade96a5510$export$910806e2dc4fd6f4","$0c75c51914774a7a$export$7a6092e2ae7e1845","$a0088a67651538b4$export$e747fdfe1889f28d","$670219d361a1461f$export$6d49ca4503d8331","$0be707f3177806f3$export$27b1eaa2ed0d5a99","$0be707f3177806f3$export$c82e186cf428d56d","$83fa79e240d3a2bb$export$2e2bcd8739ae039","$563cc721c6a67067$export$34b9dba7ce09269b","$694b266eb137553d$export$2e2bcd8739ae039","$450fc775b2f7950e$export$16fa2f45be04daa8","static","shadow","super","i18nRegistry","NeosCMS","I18n","initialized","dragging","searchNeosDocs","handleSearchNeosDocs","searchNeosPackages","handleSearchNeosPackages","preferences","recentDocuments","paramsOrFallback","$524075ade96a5510$exports","getPreferences","$0c75c51914774a7a$exports","getCommands","handleDrag","$a0088a67651538b4$exports","$670219d361a1461f$exports","$450fc775b2f7950e$export$ffb0004e005737fa","styleuri","onDragOver","pointerEvents","propNames","PreactElement","inst","Reflect","construct","HTMLElement","attachShadow","mode","create","observedAttributes","propTypes","customElements","define","topBarLeft","pluginContainer","commandBarStyleTag"],"version":3,"file":"Module.js.map"} \ No newline at end of file diff --git a/Resources/Public/Plugin.js b/Resources/Public/Plugin.js index ba12d2f..6aa4e21 100644 --- a/Resources/Public/Plugin.js +++ b/Resources/Public/Plugin.js @@ -1,3 +1,3 @@ /*! For license information please see Plugin.js.LICENSE.txt */ -!function(e){var t={};function __webpack_require__(n){if(t[n])return t[n].exports;var r=t[n]={i:n,l:!1,exports:{}};return e[n].call(r.exports,r,r.exports,__webpack_require__),r.l=!0,r.exports}__webpack_require__.m=e,__webpack_require__.c=t,__webpack_require__.d=function(e,t,n){__webpack_require__.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},__webpack_require__.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},__webpack_require__.t=function(e,t){if(1&t&&(e=__webpack_require__(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(__webpack_require__.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)__webpack_require__.d(n,r,function(t){return e[t]}.bind(null,r));return n},__webpack_require__.n=function(e){var t=e&&e.__esModule?function getDefault(){return e.default}:function getModuleExports(){return e};return __webpack_require__.d(t,"a",t),t},__webpack_require__.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},__webpack_require__.p="",__webpack_require__(__webpack_require__.s=21)}([function(e,t,n){"use strict";var r=function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}(n(3));e.exports=(0,r.default)("vendor")().React},function(e,t,n){"use strict";var r=function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}(n(3));e.exports=(0,r.default)("vendor")().PropTypes},function(e,t,n){"use strict";var r=function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}(n(3));e.exports=(0,r.default)("NeosProjectPackages")().NeosUiReduxStore},function(e,t,n){"use strict";var __read=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,s=n.call(e),f=[];try{for(;(void 0===t||t-- >0)&&!(r=s.next()).done;)f.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=s.return)&&n.call(s)}finally{if(o)throw o.error}}return f},__spreadArray=function(e,t,n){if(n||2===arguments.length)for(var r,o=0,s=t.length;o{var n,r,o;return{...e,plugins:{...e.plugins,commandBar:{open:void 0!==(null===(n=t.payload)||void 0===n?void 0:n.open)?t.payload.open:!(null===(o=null===(r=e.plugins)||void 0===r?void 0:r.commandBar)||void 0===o?void 0:o.open)}}}}},{plugins:{commandBar:{open:!1}}}),E={commandBarOpen:e=>{var t,n;return null===(n=null===(t=e.plugins)||void 0===t?void 0:t.commandBar)||void 0===n?void 0:n.open},previewUrl:e=>{var t,n;return null===(n=null===(t=e.ui)||void 0===t?void 0:t.contentCanvas)||void 0===n?void 0:n.previewUrl}}},function(e,t,n){e.exports={commandBarFooter:"CommandBarFooter-module__commandBarFooter___2mcre",breadcrumb:"CommandBarFooter-module__breadcrumb___1Ul24",activity:"CommandBarFooter-module__activity___2GXJU"}},function(e,t,n){e.exports={searchBox:"SearchBox-module__searchBox___1SEtn",expandButton:"SearchBox-module__expandButton___B2jYv",executeButton:"SearchBox-module__executeButton___3hg_l"}},function(e,t,n){e.exports={results:"CommandListing-module__results___23Rve",noResults:"CommandListing-module__noResults___Mb89V",disabled:"CommandListing-module__disabled___6gpPj"}},function(e,t,n){e.exports={commandResultsView:"CommandResultsView-module__commandResultsView___xLqwb",message:"CommandResultsView-module__message___NhUkR",results:"CommandResultsView-module__results___1t6jB",noResults:"CommandResultsView-module__noResults___2ksIF",disabled:"CommandResultsView-module__disabled___OmNvX"}},function(e,t,n){e.exports={fullScreenLayer:"CommandBarUiPlugin-module__fullScreenLayer___1cUx4",open:"CommandBarUiPlugin-module__open___1Bjxj",commandBarToolbarComponent:"CommandBarUiPlugin-module__commandBarToolbarComponent___1agRY"}},function(e,t,n){"use strict";var r=function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}(n(3));e.exports=(0,r.default)("vendor")().reduxActions},function(e,t,n){"use strict";var r=function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}(n(3));e.exports=(0,r.default)("vendor")().reactRedux},function(e,t,n){e.exports={commandBarHeader:"CommandBarHeader-module__commandBarHeader___3Y2hR",backButton:"CommandBarHeader-module__backButton___1qIGu"}},function(e,t,n){e.exports={toggleButton:"ToggleButton-module__toggleButton___2wPs-",buttonIcon:"ToggleButton-module__buttonIcon___UjFjw"}},function(e,t,n){"use strict";var r,o=(r=function extendStatics(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function __(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)}),__importDefault=function(e){return e&&e.__esModule?e:{default:e}};t.__esModule=!0;var s=__importDefault(n(27)),f=__importDefault(n(28)),E=function(e){function SynchronousRegistry(t){var n=e.call(this,t)||this;return n._registry=[],n}return o(SynchronousRegistry,e),SynchronousRegistry.prototype.set=function(e,t,n){if(void 0===n&&(n=0),"string"!=typeof e)throw new Error("Key must be a string");if("string"!=typeof n&&"number"!=typeof n)throw new Error("Position must be a string or a number");var r={key:e,value:t};n&&(r.position=n);var o=this._registry.findIndex((function(t){return t.key===e}));return-1===o?this._registry.push(r):this._registry[o]=r,t},SynchronousRegistry.prototype.get=function(e){if("string"!=typeof e)return console.error("Key must be a string"),null;var t=this._registry.find((function(t){return t.key===e}));return t?t.value:null},SynchronousRegistry.prototype._getChildrenWrapped=function(e){var t=this._registry.filter((function(t){return 0===t.key.indexOf(e+"/")}));return(0,f.default)(t)},SynchronousRegistry.prototype.getChildrenAsObject=function(e){var t={};return this._getChildrenWrapped(e).forEach((function(e){t[e.key]=e.value})),t},SynchronousRegistry.prototype.getChildren=function(e){return this._getChildrenWrapped(e).map((function(e){return e.value}))},SynchronousRegistry.prototype.has=function(e){return"string"!=typeof e?(console.error("Key must be a string"),!1):Boolean(this._registry.find((function(t){return t.key===e})))},SynchronousRegistry.prototype._getAllWrapped=function(){return(0,f.default)(this._registry)},SynchronousRegistry.prototype.getAllAsObject=function(){var e={};return this._getAllWrapped().forEach((function(t){e[t.key]=t.value})),e},SynchronousRegistry.prototype.getAllAsList=function(){return this._getAllWrapped().map((function(e){return Object.assign({id:e.key},e.value)}))},SynchronousRegistry}(s.default);t.default=E},function(e,t,n){"use strict";var r=function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}(n(3));e.exports=(0,r.default)("NeosProjectPackages")().NeosUiDecorators},function(e,t,n){"use strict";var r=function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}(n(3));e.exports=(0,r.default)("NeosProjectPackages")().ReactUiComponents},function(e,t,n){e.exports={iconWrap:"IconWrapper-module__iconWrap___1Z3nD"}},function(e,t,n){e.exports={madeWithLove:"Branding-module__madeWithLove___2ibna"}},function(e,t,n){"use strict";n(22)},function(e,t,n){"use strict";var r=n(23),o=_interopRequireDefault(r),s=n(6),f=_interopRequireDefault(n(32));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}(0,o.default)("Shel.Neos.CommandBar:CommandBar",{},(function(e,t){var n=t.frontendConfiguration;if(n["Shel.Neos.CommandBar:CommandBar"].enabled&&(e.set("Shel.Neos.CommandBar",new r.SynchronousRegistry("\n # Shel.Neos.CommandBar 3rd party commands\n ")),e.get("containers").set("PrimaryToolbar/Middle/CommandBar",f.default),e.get("reducers").set("Shel.Neos.CommandBar",{reducer:s.reducer}),null!==n.hotkeys&&0!==n.hotkeys.length)){var o=e.get("hotkeys");o.set("Shel.Neos.CommandBar.toggle.CMD",{description:"Toggle command bar",action:s.actions.toggleCommandBar}),o.set("Shel.Neos.CommandBar.toggle.CTRL",{description:"Toggle command bar",action:s.actions.toggleCommandBar})}}))},function(e,t,n){"use strict";var __importDefault=function(e){return e&&e.__esModule?e:{default:e}};t.__esModule=!0,t.SynchronousMetaRegistry=t.SynchronousRegistry=t.readFromConsumerApi=t.createConsumerApi=void 0;var r=__importDefault(n(24));t.createConsumerApi=r.default;var o=__importDefault(n(3));t.readFromConsumerApi=o.default;var s=n(26);t.SynchronousRegistry=s.SynchronousRegistry,t.SynchronousMetaRegistry=s.SynchronousMetaRegistry,t.default=(0,o.default)("manifest")},function(e,t,n){"use strict";var __importDefault=function(e){return e&&e.__esModule?e:{default:e}};t.__esModule=!0;var r=__importDefault(n(25)),o=function createReadOnlyValue(e){return{value:e,writable:!1,enumerable:!1,configurable:!0}};t.default=function createConsumerApi(e,t){var n={};Object.keys(t).forEach((function(e){Object.defineProperty(n,e,o(t[e]))})),Object.defineProperty(n,"@manifest",o((0,r.default)(e))),Object.defineProperty(window,"@Neos:HostPluginAPI",o(n))}},function(e,t,n){"use strict";t.__esModule=!0,t.default=function(e){return function(t,n,r){var o;e.push(((o={})[t]={options:n,bootstrap:r},o))}}},function(e,t,n){"use strict";var __importDefault=function(e){return e&&e.__esModule?e:{default:e}};t.__esModule=!0,t.SynchronousMetaRegistry=t.SynchronousRegistry=void 0;var r=__importDefault(n(16));t.SynchronousRegistry=r.default;var o=__importDefault(n(30));t.SynchronousMetaRegistry=o.default},function(e,t,n){"use strict";t.__esModule=!0;var r=function r(e){this.SERIAL_VERSION_UID="d8a5aa78-978e-11e6-ae22-56b6b6499611",this.description=e};t.default=r},function(e,t,n){"use strict";t.__esModule=!0;var r=n(29);t.default=function positionalArraySorter(e,t,n){var o,s,f,E,C,I,R,S,O,T,A,P,N,D;void 0===t&&(t="position"),void 0===n&&(n="key");var M="string"==typeof t?function(e){return e[t]}:t,U={},L={},H={},x={},k={},B={};e.forEach((function(e,t){var r=e[n]?e[n]:String(t);U[r]=t;var o=M(e),s=String(o||t),f=!1;if(s.startsWith("start")){var E=(C=s.match(/start\s+(\d+)/))&&C[1]?Number(C[1]):0;H[E]||(H[E]=[]),H[E].push(r)}else if(s.startsWith("end")){var C;E=(C=s.match(/end\s+(\d+)/))&&C[1]?Number(C[1]):0;x[E]||(x[E]=[]),x[E].push(r)}else if(s.startsWith("before")){if(R=s.match(/before\s+(\S+)(\s+(\d+))?/)){var I=R[1];E=R[3]?Number(R[3]):0;k[I]||(k[I]={}),k[I][E]||(k[I][E]=[]),k[I][E].push(r)}else f=!0}else if(s.startsWith("after")){var R;if(R=s.match(/after\s+(\S+)(\s+(\d+))?/)){I=R[1],E=R[3]?Number(R[3]):0;B[I]||(B[I]={}),B[I][E]||(B[I][E]=[]),B[I][E].push(r)}else f=!0}else f=!0;if(f){var S=parseFloat(s);!isNaN(S)&&isFinite(S)||(S=t),L[S]||(L[S]=[]),L[S].push(r)}}));var G=[],F=[],V=[],W=[],q=function sortedWeights(e,t){var n=Object.keys(e).map((function(e){return Number(e)})).sort((function(e,t){return e-t}));return t?n:n.reverse()},X=function addToResults(e,t){e.forEach((function(e){var n,o,s,f;if(!(W.indexOf(e)>=0)){if(W.push(e),k[e]){var E=q(k[e],!0);try{for(var C=r.__values(E),I=C.next();!I.done;I=C.next()){var R=I.value;addToResults(k[e][R],t)}}catch(e){n={error:e}}finally{try{I&&!I.done&&(o=C.return)&&o.call(C)}finally{if(n)throw n.error}}}if(t.push(e),B[e]){var S=q(B[e],!1);try{for(var O=r.__values(S),T=O.next();!T.done;T=O.next()){R=T.value;addToResults(B[e][R],t)}}catch(e){s={error:e}}finally{try{T&&!T.done&&(f=O.return)&&f.call(O)}finally{if(s)throw s.error}}}}}))};try{for(var z=r.__values(q(H,!1)),Y=z.next();!Y.done;Y=z.next()){var Q=Y.value;X(H[Q],G)}}catch(e){o={error:e}}finally{try{Y&&!Y.done&&(s=z.return)&&s.call(z)}finally{if(o)throw o.error}}try{for(var $=r.__values(q(L,!0)),K=$.next();!K.done;K=$.next()){Q=K.value;X(L[Q],F)}}catch(e){f={error:e}}finally{try{K&&!K.done&&(E=$.return)&&E.call($)}finally{if(f)throw f.error}}try{for(var Z=r.__values(q(x,!0)),J=Z.next();!J.done;J=Z.next()){Q=J.value;X(x[Q],V)}}catch(e){C={error:e}}finally{try{J&&!J.done&&(I=Z.return)&&I.call(Z)}finally{if(C)throw C.error}}try{for(var ee=r.__values(Object.keys(k)),te=ee.next();!te.done;te=ee.next()){var ne=te.value;if(!(W.indexOf(ne)>=0))try{for(var re=(O=void 0,r.__values(q(k[ne],!1))),ae=re.next();!ae.done;ae=re.next()){Q=ae.value;X(k[ne][Q],G)}}catch(e){O={error:e}}finally{try{ae&&!ae.done&&(T=re.return)&&T.call(re)}finally{if(O)throw O.error}}}}catch(e){R={error:e}}finally{try{te&&!te.done&&(S=ee.return)&&S.call(ee)}finally{if(R)throw R.error}}try{for(var oe=r.__values(Object.keys(B)),ie=oe.next();!ie.done;ie=oe.next()){ne=ie.value;if(!(W.indexOf(ne)>=0))try{for(var se=(N=void 0,r.__values(q(B[ne],!1))),le=se.next();!le.done;le=se.next()){Q=le.value;X(B[ne][Q],F)}}catch(e){N={error:e}}finally{try{le&&!le.done&&(D=se.return)&&D.call(se)}finally{if(N)throw N.error}}}}catch(e){A={error:e}}finally{try{ie&&!ie.done&&(P=oe.return)&&P.call(oe)}finally{if(A)throw A.error}}return r.__spread(G,F,V).map((function(e){return U[e]})).map((function(t){return e[t]}))}},function(e,t,n){"use strict";n.r(t),n.d(t,"__extends",(function(){return __extends})),n.d(t,"__assign",(function(){return __assign})),n.d(t,"__rest",(function(){return __rest})),n.d(t,"__decorate",(function(){return __decorate})),n.d(t,"__param",(function(){return __param})),n.d(t,"__metadata",(function(){return __metadata})),n.d(t,"__awaiter",(function(){return __awaiter})),n.d(t,"__generator",(function(){return __generator})),n.d(t,"__createBinding",(function(){return __createBinding})),n.d(t,"__exportStar",(function(){return __exportStar})),n.d(t,"__values",(function(){return __values})),n.d(t,"__read",(function(){return __read})),n.d(t,"__spread",(function(){return __spread})),n.d(t,"__spreadArrays",(function(){return __spreadArrays})),n.d(t,"__await",(function(){return __await})),n.d(t,"__asyncGenerator",(function(){return __asyncGenerator})),n.d(t,"__asyncDelegator",(function(){return __asyncDelegator})),n.d(t,"__asyncValues",(function(){return __asyncValues})),n.d(t,"__makeTemplateObject",(function(){return __makeTemplateObject})),n.d(t,"__importStar",(function(){return __importStar})),n.d(t,"__importDefault",(function(){return __importDefault})),n.d(t,"__classPrivateFieldGet",(function(){return __classPrivateFieldGet})),n.d(t,"__classPrivateFieldSet",(function(){return __classPrivateFieldSet}));var extendStatics=function(e,t){return(extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)};function __extends(e,t){function __(){this.constructor=e}extendStatics(e,t),e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)}var __assign=function(){return(__assign=Object.assign||function __assign(e){for(var t,n=1,r=arguments.length;n=0;E--)(o=e[E])&&(f=(s<3?o(f):s>3?o(t,n,f):o(t,n))||f);return s>3&&f&&Object.defineProperty(t,n,f),f}function __param(e,t){return function(n,r){t(n,r,e)}}function __metadata(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}function __awaiter(e,t,n,r){return new(n||(n=Promise))((function(o,s){function fulfilled(e){try{step(r.next(e))}catch(e){s(e)}}function rejected(e){try{step(r.throw(e))}catch(e){s(e)}}function step(e){e.done?o(e.value):function adopt(e){return e instanceof n?e:new n((function(t){t(e)}))}(e.value).then(fulfilled,rejected)}step((r=r.apply(e,t||[])).next())}))}function __generator(e,t){var n,r,o,s,f={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return s={next:verb(0),throw:verb(1),return:verb(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function verb(s){return function(E){return function step(s){if(n)throw new TypeError("Generator is already executing.");for(;f;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return f.label++,{value:s[1],done:!1};case 5:f.label++,r=s[1],s=[0];continue;case 7:s=f.ops.pop(),f.trys.pop();continue;default:if(!(o=f.trys,(o=o.length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){f=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function __read(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,s=n.call(e),f=[];try{for(;(void 0===t||t-- >0)&&!(r=s.next()).done;)f.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=s.return)&&n.call(s)}finally{if(o)throw o.error}}return f}function __spread(){for(var e=[],t=0;t1||resume(e,t)}))})}function resume(e,t){try{!function step(e){e.value instanceof __await?Promise.resolve(e.value.v).then(fulfill,reject):settle(s[0][2],e)}(o[e](t))}catch(e){settle(s[0][3],e)}}function fulfill(e){resume("next",e)}function reject(e){resume("throw",e)}function settle(e,t){e(t),s.shift(),s.length&&resume(s[0][0],s[0][1])}}function __asyncDelegator(e){var t,n;return t={},verb("next"),verb("throw",(function(e){throw e})),verb("return"),t[Symbol.iterator]=function(){return this},t;function verb(r,o){t[r]=e[r]?function(t){return(n=!n)?{value:__await(e[r](t)),done:"return"===r}:o?o(t):t}:o}}function __asyncValues(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,n=e[Symbol.asyncIterator];return n?n.call(e):(e=__values(e),t={},verb("next"),verb("throw"),verb("return"),t[Symbol.asyncIterator]=function(){return this},t);function verb(n){t[n]=e[n]&&function(t){return new Promise((function(r,o){(function settle(e,t,n,r){Promise.resolve(r).then((function(t){e({value:t,done:n})}),t)})(r,o,(t=e[n](t)).done,t.value)}))}}}function __makeTemplateObject(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}function __importStar(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}function __importDefault(e){return e&&e.__esModule?e:{default:e}}function __classPrivateFieldGet(e,t){if(!t.has(e))throw new TypeError("attempted to get private field on non-instance");return t.get(e)}function __classPrivateFieldSet(e,t,n){if(!t.has(e))throw new TypeError("attempted to set private field on non-instance");return t.set(e,n),n}},function(e,t,n){"use strict";var r,o=(r=function extendStatics(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function __(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)}),__importDefault=function(e){return e&&e.__esModule?e:{default:e}};t.__esModule=!0;var s=function(e){function SynchronousMetaRegistry(){return null!==e&&e.apply(this,arguments)||this}return o(SynchronousMetaRegistry,e),SynchronousMetaRegistry.prototype.set=function(t,n){if("d8a5aa78-978e-11e6-ae22-56b6b6499611"!==n.SERIAL_VERSION_UID)throw new Error("You can only add registries to a meta registry");return e.prototype.set.call(this,t,n)},SynchronousMetaRegistry}(__importDefault(n(16)).default);t.default=s},function(e,t,n){},function(e,t,n){"use strict";n.r(t);var r={};n.r(r),n.d(r,"getPreferences",(function(){return getPreferences})),n.d(r,"setFavouriteCommands",(function(){return setFavouriteCommands})),n.d(r,"addRecentCommand",(function(){return addRecentCommand}));var o={};n.r(o),n.d(o,"getCommands",(function(){return getCommands}));var s={};n.r(s),n.d(s,"searchNeosDocs",(function(){return searchNeosDocs}));var f={};n.r(f),n.d(f,"searchNeosPackages",(function(){return searchNeosPackages}));var E={};n.r(E),n.d(E,"searchNodes",(function(){return searchNodes}));var C=n(0),I=n.n(C),R=n(13),S=n(1),O=n.n(S),T=n(17),A=n(2),P=n(18);function useFunctionRef(e){const t=Object(C.useRef)(e);return t.current=e,t}function i(){throw new Error("Cycle detected")}function signals_core_module_t(){if(M>1)M--;else{for(var e,t=!1;void 0!==D;){var n=D;for(D=void 0,U++;void 0!==n;){var r=n.o;if(n.o=void 0,n.f&=-3,!(8&n.f)&&d(n))try{n.c()}catch(n){t||(e=n,t=!0)}n=r}}if(U=0,M--,t)throw e}}function h(e){if(M>0)return e();M++;try{return e()}finally{signals_core_module_t()}}var N=void 0,D=void 0,M=0,U=0,L=0;function v(e){if(void 0!==N){var t=e.n;if(void 0===t||t.t!==N)return t={i:0,S:e,p:N.s,n:void 0,t:N,e:void 0,x:void 0,r:t},void 0!==N.s&&(N.s.n=t),N.s=t,e.n=t,32&N.f&&e.S(t),t;if(-1===t.i)return t.i=0,void 0!==t.n&&(t.n.p=t.p,void 0!==t.p&&(t.p.n=t.n),t.p=N.s,t.n=void 0,N.s.n=t,N.s=t),t}}function signals_core_module_e(e){this.v=e,this.i=0,this.n=void 0,this.t=void 0}function u(e){return new signals_core_module_e(e)}function d(e){for(var t=e.s;void 0!==t;t=t.n)if(t.S.i!==t.i||!t.S.h()||t.S.i!==t.i)return!0;return!1}function c(e){for(var t=e.s;void 0!==t;t=t.n){var n=t.S.n;if(void 0!==n&&(t.r=n),t.S.n=t,t.i=-1,void 0===t.n){e.s=t;break}}}function a(e){for(var t=e.s,n=void 0;void 0!==t;){var r=t.p;-1===t.i?(t.S.U(t),void 0!==r&&(r.n=t.n),void 0!==t.n&&(t.n.p=r)):n=t,t.S.n=t.r,void 0!==t.r&&(t.r=void 0),t=r}e.s=n}function l(e){signals_core_module_e.call(this,void 0),this.x=e,this.s=void 0,this.g=L-1,this.f=4}function w(e){return new l(e)}function y(e){var t=e.u;if(e.u=void 0,"function"==typeof t){M++;var n=N;N=void 0;try{t()}catch(t){throw e.f&=-2,e.f|=8,_(e),t}finally{N=n,signals_core_module_t()}}}function _(e){for(var t=e.s;void 0!==t;t=t.n)t.S.U(t);e.x=void 0,e.s=void 0,y(e)}function g(e){if(N!==this)throw new Error("Out-of-order effect");a(this),N=e,this.f&=-2,8&this.f&&_(this),signals_core_module_t()}function b(e){this.x=e,this.u=void 0,this.s=void 0,this.o=void 0,this.f=32}function p(e){var t=new b(e);try{t.c()}catch(e){throw t.d(),e}return t.d.bind(t)}signals_core_module_e.prototype.h=function(){return!0},signals_core_module_e.prototype.S=function(e){this.t!==e&&void 0===e.e&&(e.x=this.t,void 0!==this.t&&(this.t.e=e),this.t=e)},signals_core_module_e.prototype.U=function(e){if(void 0!==this.t){var t=e.e,n=e.x;void 0!==t&&(t.x=n,e.e=void 0),void 0!==n&&(n.e=t,e.x=void 0),e===this.t&&(this.t=n)}},signals_core_module_e.prototype.subscribe=function(e){var t=this;return p((function(){var n=t.value,r=32&this.f;this.f&=-33;try{e(n)}finally{this.f|=r}}))},signals_core_module_e.prototype.valueOf=function(){return this.value},signals_core_module_e.prototype.toString=function(){return this.value+""},signals_core_module_e.prototype.peek=function(){return this.v},Object.defineProperty(signals_core_module_e.prototype,"value",{get:function(){var e=v(this);return void 0!==e&&(e.i=this.i),this.v},set:function(e){if(e!==this.v){U>100&&i(),this.v=e,this.i++,L++,M++;try{for(var t=this.t;void 0!==t;t=t.x)t.t.N()}finally{signals_core_module_t()}}}}),(l.prototype=new signals_core_module_e).h=function(){if(this.f&=-3,1&this.f)return!1;if(32==(36&this.f))return!0;if(this.f&=-5,this.g===L)return!0;if(this.g=L,this.f|=1,this.i>0&&!d(this))return this.f&=-2,!0;var e=N;try{c(this),N=this;var t=this.x();(16&this.f||this.v!==t||0===this.i)&&(this.v=t,this.f&=-17,this.i++)}catch(e){this.v=e,this.f|=16,this.i++}return N=e,a(this),this.f&=-2,!0},l.prototype.S=function(e){if(void 0===this.t){this.f|=36;for(var t=this.s;void 0!==t;t=t.n)t.S.S(t)}signals_core_module_e.prototype.S.call(this,e)},l.prototype.U=function(e){if(void 0!==this.t&&(signals_core_module_e.prototype.U.call(this,e),void 0===this.t)){this.f&=-33;for(var t=this.s;void 0!==t;t=t.n)t.S.U(t)}},l.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(var e=this.t;void 0!==e;e=e.x)e.t.N()}},l.prototype.peek=function(){if(this.h()||i(),16&this.f)throw this.v;return this.v},Object.defineProperty(l.prototype,"value",{get:function(){1&this.f&&i();var e=v(this);if(this.h(),void 0!==e&&(e.i=this.i),16&this.f)throw this.v;return this.v}}),b.prototype.c=function(){var e=this.S();try{8&this.f||void 0===this.x||(this.u=this.x())}finally{e()}},b.prototype.S=function(){1&this.f&&i(),this.f|=1,this.f&=-9,y(this),c(this),M++;var e=N;return N=this,g.bind(this,e)},b.prototype.N=function(){2&this.f||(this.f|=2,this.o=D,D=this)},b.prototype.d=function(){this.f|=8,1&this.f||_(this)};var H,x=I.a.createElement;I.a.createElement=function(e,t){if("string"==typeof e&&t)for(var n in t){var r=t[n];"children"!==n&&r instanceof signals_core_module_e&&(t[n]=r.value)}return x.apply(this,arguments)};var k=new WeakMap;function signals_module_p(e){H&&H(),H=e&&e.S()}var B=x("a").$$typeof;Object.defineProperties(signals_core_module_e.prototype,{$$typeof:{configurable:!0,value:B},type:{configurable:!0,value:function(e){return e.data.value}},props:{configurable:!0,get:function(){return{data:this}}},ref:{configurable:!0,value:null}});var G,F=!1,m=function(){return{}};Object.defineProperty(C.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentDispatcher,"current",{get:function(){return G},set:function(e){if(G=e,!F)if(e&&!function(e){var t=V.get(e);if(void 0!==t)return t;var n=e.useCallback.length<2||/Invalid/.test(e.useCallback);return V.set(e,n),n}(e)){F=!0;var t=e.useReducer(m,{})[1];F=!1;var n=k.get(t);n?n.c=t:(n=function(e){var t;return p((function(){t=this})),t.c=e,t}(t),k.set(t,n)),signals_module_p(n)}else signals_module_p()}});var V=new Map;function signals_module_h(e){return Object(C.useMemo)((function(){return u(e)}),[])}function signals_module_y(e){var t=Object(C.useRef)(e);return t.current=e,Object(C.useMemo)((function(){return w((function(){return t.current()}))}),[])}function j(e){var t=Object(C.useRef)(e);t.current=e,Object(C.useEffect)((function(){return p((function(){return t.current()}))}),[])}function flattenCommands(e,t=null){return Object.keys(e).reduce((n,r)=>{const{icon:o,description:s,name:f,subCommands:E,action:C,canHandleQueries:I,closeOnExecute:R,category:S,executeManually:O}=e[r],T=t?`${t}.${r}`:r,A=E?Object.keys(E).map(e=>`${T}.${e}`):[];return n[T]={id:T,name:f,icon:o,description:s,action:C,canHandleQueries:I,subCommandIds:A,parentId:t,closeOnExecute:R,category:S,executeManually:O},A.length>0?{...n,...flattenCommands(E,T)}:n},{})}const W="%c[COMMANDBAR]";var q={ok:(e,...t)=>console.log(W,"color: green",e,...t),error:(e,...t)=>console.log(W,"color: red",e,...t),warn:(e,...t)=>console.warn(W,"color: orange",e,...t),debug:()=>null};function clamp(e,t,n){return Math.max(t,Math.min(n,e))}const X=new Intl.Collator("en").compare,z=/(?:\s+|^)-[a-z\d]+/gi,Y={interSplit:"[^A-Za-z0-9']+",intraSplit:"[a-z][A-Z]",intraBound:"[A-Za-z][0-9]|[0-9][A-Za-z]|[a-z][A-Z]",interLft:0,interRgt:0,interChars:".",interIns:1/0,intraChars:"[a-z\\d']",intraIns:0,intraContr:"'[a-z]{1,2}\\b",intraMode:0,intraSlice:[1,1/0],intraSub:0,intraTrn:0,intraDel:0,intraFilt:(e,t,n)=>!0,sort:(e,t,n)=>{let{idx:r,chars:o,terms:s,interLft2:f,interLft1:E,start:C,intraIns:I,interIns:R}=e;return r.map((e,t)=>t).sort((e,n)=>o[n]-o[e]||I[e]-I[n]||s[n]+f[n]+.5*E[n]-(s[e]+f[e]+.5*E[e])||R[e]-R[n]||C[e]-C[n]||X(t[r[e]],t[r[n]]))}},lazyRepeat=(e,t)=>0==t?"":1==t?e+"??":t==1/0?e+"*?":e+`{0,${t}}?`;function uFuzzy(e){e=Object.assign({},Y,e);const{interLft:t,interRgt:n,intraMode:r,intraSlice:o,intraIns:s,intraSub:f,intraTrn:E,intraDel:C,intraContr:I,intraSplit:R,interSplit:S,intraBound:O,intraChars:T}=e;let{intraRules:A}=e;null==A&&(A=e=>{let t=Y.intraSlice,n=0,r=0,I=0,R=0,S=e.length;return S<=4?S>=3&&(I=Math.min(E,1),4==S&&(n=Math.min(s,1))):(t=o,n=s,r=f,I=E,R=C),{intraSlice:t,intraIns:n,intraSub:r,intraTrn:I,intraDel:R}});let P=!!R,N=new RegExp(R,"g"),D=new RegExp(S,"g"),M=new RegExp("^"+S+"|"+S+"$","g"),U=new RegExp(I,"gi");const split=e=>(e=e.replace(M,"").toLowerCase(),P&&(e=e.replace(N,e=>e[0]+" "+e[1])),e.split(D).filter(e=>""!=e)),prepQuery=(o,f=0,E=!1)=>{let C=split(o);if(0==C.length)throw"Empty needle!";let I,R=Array(C.length).fill("");if(C=C.map((e,t)=>e.replace(U,e=>(R[t]=e,""))),1==r)I=C.map((e,t)=>{let{intraSlice:n,intraIns:r,intraSub:o,intraTrn:s,intraDel:f}=A(e);if(r+o+s+f==0)return e+R[t];let[E,C]=n,I=e.slice(0,E),S=e.slice(C),O=e.slice(E,C);1==r&&1==I.length&&I!=O[0]&&(I+="(?!"+I+")");let P=O.length,N=[];if(o)for(let e=0;e0&&(e=")("+e+")("),I=C.map((t,n)=>t.split("").map((e,t,n)=>(1==s&&0==t&&n.length>1&&e[t]!=e[t+1]&&(e+="(?!"+e+")"),e)).join(e)+R[n])}let S=2==t?"(?:\\b|_)":"",O=2==n?"(?:\\b|_)":"",P=O+lazyRepeat(e.interChars,e.interIns)+S;return f>0?E?I=S+"("+I.join(")"+O+"|"+S+"(")+")"+O:(I="("+I.join(")("+P+")(")+")",I="(.?"+S+")"+I+"("+O+".*)"):(I=I.join(P),I=S+I+O),[new RegExp(I,"i"),C,R]},filter=(e,t,n)=>{let r=[],[o]=prepQuery(t);if(null!=n)for(let t=0;t{let[f,E,C]=prepQuery(s,1),[I]=prepQuery(s,2),R=E.length,S=r.length,O=Array(S).fill(0),T={idx:Array(S),start:O.slice(),chars:O.slice(),terms:O.slice(),interIns:O.slice(),intraIns:O.slice(),interLft2:O.slice(),interRgt2:O.slice(),interLft1:O.slice(),interRgt1:O.slice(),ranges:Array(S)},A=1==t||1==n,P=0;for(let s=0;s=I){let e=O[o+1].toLowerCase().indexOf(f);e>-1&&(X.push(D,e,I),D+=refineMatch(O,o,e,I),s=f,T=I,P=!0,0==r&&(N=D))}if(A||P){let e=D-1,r=D+T,E=!0,C=!0;if(-1==e||H.test(S[e]))P&&U++;else{if(2==t){M=!0;break}if(L&&x.test(S[e]+S[e+1]))P&&k++;else{if(1==t){let e=O[o+1],t=D+T;if(e.length>=I){let n,r=0,E=!1,C=new RegExp(f,"ig");for(;n=C.exec(e);){r=n.index;let e=t+r,o=e-1;if(-1==o||H.test(S[o])){U++,E=!0;break}if(x.test(S[o]+S[e])){k++,E=!0;break}}if(E){X.push(D,r,I),D+=refineMatch(O,o,r,I),s=f,T=I,P=!0;break}}M=!0;break}E=!1}}if(r==S.length||H.test(S[r]))P&&B++;else{if(2==n){M=!0;break}if(L&&x.test(S[r-1]+S[r]))P&&G++;else{if(1==n){M=!0;break}C=!1}}P&&(F+=I,E&&C&&V++)}if(T>I&&(q+=T-I),r>0&&(W+=O[o-1].length),!e.intraFilt(f,s,D)){M=!0;break}r0?0:1/0,R=E-3;for(let r=2;r0&&(t.push(o,f),o=f=n)}f>o&&t.push(o,f),P++}}if(P{let o=e[t]+e[t+1].slice(0,n);return e[t-1]+=o,e[t]=e[t+1].slice(n,n+r),e[t+1]=e[t+1].slice(n+r),o.length};return{search:(...t)=>((t,n,r=!1,o=1e3,s)=>{let f,E=null,C=null,I=[];if(n=n.replace(z,e=>(I.push(e.trim().slice(1)),"")),I.length>0&&(f=new RegExp(I.join("|"),"i"),""==n.trim())){let e=[];for(let n=0;n1){let n=e.slice().sort((e,t)=>t.length-e.length);for(let e=0;ee.join(" ")),C=[];let r=new Set;for(let e=0;e!r.has(e)),o=filter(t,E[e],n);for(let e=0;e0?s:filter(t,n)]);let R=null,S=null;if(I.length>0&&(C=C.map(e=>e.filter(e=>!f.test(t[e])))),C.reduce((e,t)=>e+t.length,0)<=o){R={},S=[];for(let n=0;n0)for(let e=0;e{let e={A:"ÁÀÃÂÄĄ",a:"áàãâäą",E:"ÉÈÊËĖ",e:"éèêëę",I:"ÍÌÎÏĮ",i:"íìîïį",O:"ÓÒÔÕÖ",o:"óòôõö",U:"ÚÙÛÜŪŲ",u:"úùûüūų",C:"ÇČ",c:"çč",N:"Ñ",n:"ñ",S:"Š",s:"š"},t=new Map,n="";for(let r in e)e[r].split("").forEach(e=>{n+=e,t.set(e,r)});let r=new RegExp(`[${n}]`,"g"),replacer=e=>t.get(e);return e=>{if("string"==typeof e)return e.replace(r,replacer);let t=Array(e.length);for(let n=0;nt?`${e}`:e,_append=(e,t)=>e+t;uFuzzy.latinize=Q,uFuzzy.permute=e=>permute([...Array(e.length).keys()]).sort((e,t)=>{for(let n=0;nt.map(t=>e[t])),uFuzzy.highlight=function highlight(e,t,n=_mark,r="",o=_append){let s=o(r,n(e.substring(0,t[0]),!1));r=null!==s?s:r;for(let f=0;ft.parentId===e||!e&&o.includes(t.id)),!t)return s.sort((t,n)=>function sortCommands(e,t,n,r){const o=r.includes(e.id),s=r.includes(t.id);if(o&&!s)return-1;if(!o&&s)return 1;if(o&&s)return r.indexOf(e.id)-r.indexOf(t.id);const f=n.includes(e.id),E=n.includes(t.id);return f&&!E?-1:!f&&E?1:e.name.localeCompare(t.name)}(t,n,r,e?[]:o)).map(e=>e.id);const f=s.map(({name:e,description:t})=>e+" "+t),[E,,C]=$.search(f,t.toLowerCase());return C.map(e=>s[E[e]].id)}(t.selectedCommandGroup,t.searchWord,t.commands,t.favouriteCommands,t.recentCommands);break;case J.HIGHLIGHT_NEXT_COMMAND:t.highlightedItem=clamp(t.highlightedItem+1,0,t.availableCommandIds.length-1);break;case J.HIGHLIGHT_PREVIOUS_COMMAND:t.highlightedItem=clamp(t.highlightedItem-1,0,t.availableCommandIds.length-1);break;case J.HIGHLIGHT_NEXT_OPTION:t.highlightedOption=clamp(t.highlightedOption+1,0,Object.keys(t.result.options).length-1);break;case J.HIGHLIGHT_PREVIOUS_OPTION:t.highlightedOption=clamp(t.highlightedOption-1,0,Object.keys(t.result.options).length-1);break;case J.SET_SEARCH_WORD:assert(n.type===Z.UPDATE_SEARCH),t.searchWord=n.searchWord;break;case J.SET_COMMAND_QUERY:assert(n.type===Z.UPDATE_COMMAND_QUERY),t.commandQuery=n.commandQuery;break;case J.EXPAND:t.expanded=!0;break;case J.SET_ACTIVE_COMMAND:assert(n.type===Z.EXECUTE_COMMAND),t.activeCommandId=n.commandId,t.activeCommandMessage=n.message;break;case J.UNSET_ACTIVE_COMMAND:t.activeCommandId=null,t.activeCommandMessage=null;break;case J.UPDATE_RESULT:assert(n.type===Z.UPDATE_RESULT),assert("boolean"==typeof n.result.success),t.result={options:{},message:"Command executed",view:null,success:!1,...n.result},t.resultCommandId=t.activeCommandId;break;case J.RESET_OPTION_HIGHLIGHT:t.highlightedOption=0;break;case J.RESET_SEARCH_OR_LEAVE_GROUP:t.commandQuery?t.commandQuery="":t.searchWord?t.searchWord="":t.selectedCommandGroup=t.selectedCommandGroup?t.commands[t.selectedCommandGroup].parentId:null;break;case J.UNSET_RESULT:t.result=null,t.resultCommandId=null,t.commandQuery="";break;case J.LEAVE_GROUP:t.selectedCommandGroup=t.selectedCommandGroup?t.commands[t.selectedCommandGroup].parentId:null;break;case J.SET_GROUP:assert(n.type===Z.SELECT_GROUP),t.selectedCommandGroup=n.commandId;break;case J.ADD_FAVOURITE:assert(n.type===Z.ADD_FAVOURITE),t.favouriteCommands.includes(n.commandId)||t.favouriteCommands.push(n.commandId);break;case J.REMOVE_FAVOURITE:assert(n.type===Z.REMOVE_FAVOURITE),t.favouriteCommands=t.favouriteCommands.filter(e=>e!==n.commandId);break;case J.ADD_RECENTLY_USED:if(assert(n.type===Z.EXECUTE_COMMAND),!t.commands[n.commandId].action)break;t.recentCommands.includes(n.commandId)&&(t.recentCommands=t.recentCommands.filter(e=>e!==n.commandId)),t.recentCommands.unshift(n.commandId),t.recentCommands.length>5&&t.recentCommands.pop();break;default:throw Error(`Action ${e} not implemented`)}}const commandBarReducer=(e,t)=>function transition(e,t,n){var r,o,s;let f=null!==(o=null===(r=ee.states[e.status].on)||void 0===r?void 0:r[t.type])&&void 0!==o?o:null;f||(q.error(`No transition found for event "${t.type}" in state "${e.status}"`),f={target:e.status});const E={...e,status:"string"==typeof f?f:f.target};return n&&"object"==typeof f&&(null===(s=f.actions)||void 0===s||s.forEach(e=>n(e,E,t))),q.debug(`Transitioned from "${e.status}" to "${E.status}" with event "${t.type}"`),E}(e,t,runAction);var te=n(19);var ne=I.a.memo(({children:e})=>I.a.createElement("span",{className:te.iconWrap},e)),re=n(20);var ae=I.a.memo(()=>{const{state:{showBranding:e}}=useCommandBarState(),{translate:t}=useIntl();return e?I.a.createElement("a",{href:"https://helzle.it/projects",title:t("CommandBarFooter.branding","Made with love by Sebastian Helzle"),target:"_blank",rel:"noreferrer noopener",className:re.madeWithLove},I.a.createElement("small",null,t("CommandBarFooter.brandingSmall","Made with love by")),I.a.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 180 180"},I.a.createElement("defs",null,I.a.createElement("linearGradient",{id:"a",gradientUnits:"userSpaceOnUse",x1:"280.25",y1:"377.003",x2:"373.261",y2:"377.003"},I.a.createElement("stop",{offset:"0",stopColor:"#297AAC"}),I.a.createElement("stop",{offset:"1",stopColor:"#53AADA"}))),I.a.createElement("path",{d:"M0 180.017h37.287L71.35 52.898H34.061zM48.717 0l-9.083 33.898h36.675L85.392 0z",fill:"#B9B7B3"}),I.a.createElement("path",{d:"M335.972 313.444H288.25l-8 28.306h47.691l-28.03 98.813h39.287l34.063-127.119z",fill:"url(#a)",transform:"translate(-195.462 -260.325)"}))):null});function IconBack(){return I.a.createElement("svg",{viewBox:"0 0 448 512"},I.a.createElement("path",{fill:"currentColor",d:"m257.5 445.1-22.2 22.2c-9.4 9.4-24.6 9.4-33.9 0L7 273c-9.4-9.4-9.4-24.6 0-33.9L201.4 44.7c9.4-9.4 24.6-9.4 33.9 0l22.2 22.2c9.5 9.5 9.3 25-.4 34.3L136.6 216H424c13.3 0 24 10.7 24 24v32c0 13.3-10.7 24-24 24H136.6l120.5 114.8c9.8 9.3 10 24.8.4 34.3z"}))}function IconNeos(){return I.a.createElement("svg",{viewBox:"0 0 512 512"},I.a.createElement("path",{fill:"currentColor",d:"M415.44 512h-95.11L212.12 357.46v91.1L125.69 512H28V29.82L68.47 0h108.05l123.74 176.13V63.45L386.69 0h97.69v461.5zM38.77 35.27V496l72-52.88V194l215.5 307.64h84.79l52.35-38.17h-78.27L69 13zm82.54 466.61 80-58.78v-101l-79.76-114.4v220.94L49 501.89h72.34zM80.63 10.77l310.6 442.57h82.37V10.77h-79.75v317.56L170.91 10.77zM311 191.65l72 102.81V15.93l-72 53v122.72z"}))}function IconSpinner(){return I.a.createElement("svg",{viewBox:"0 0 512 512"},I.a.createElement("path",{fill:"currentColor",d:"M288 39.056v16.659c0 10.804 7.281 20.159 17.686 23.066C383.204 100.434 440 171.518 440 256c0 101.689-82.295 184-184 184-101.689 0-184-82.295-184-184 0-84.47 56.786-155.564 134.312-177.219C216.719 75.874 224 66.517 224 55.712V39.064c0-15.709-14.834-27.153-30.046-23.234C86.603 43.482 7.394 141.206 8.003 257.332c.72 137.052 111.477 246.956 248.531 246.667C393.255 503.711 504 392.788 504 256c0-115.633-79.14-212.779-186.211-240.236C302.678 11.889 288 23.456 288 39.056z"}))}function IconStar(){return I.a.createElement("svg",{viewBox:"0 0 576 512"},I.a.createElement("path",{fill:"currentColor",d:"M528.1 171.5 382 150.2 316.7 17.8c-11.7-23.6-45.6-23.9-57.4 0L194 150.2 47.9 171.5c-26.2 3.8-36.7 36.1-17.7 54.6l105.7 103-25 145.5c-4.5 26.3 23.2 46 46.4 33.7L288 439.6l130.7 68.7c23.2 12.2 50.9-7.4 46.4-33.7l-25-145.5 105.7-103c19-18.5 8.5-50.8-17.7-54.6zM388.6 312.3l23.7 138.4L288 385.4l-124.3 65.3 23.7-138.4-100.6-98 139-20.2 62.2-126 62.2 126 139 20.2-100.6 98z"}))}function IconPlay(){return I.a.createElement("svg",{viewBox:"0 0 512 512"},I.a.createElement("path",{fill:"currentColor",d:"M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm115.7 272l-176 101c-15.8 8.8-35.7-2.5-35.7-21V152c0-18.4 19.8-29.8 35.7-21l176 107c16.4 9.2 16.4 32.9 0 42z"}))}var oe=n(7);var ie=I.a.memo(()=>{const{state:{activeCommandId:e,activeCommandMessage:t,commands:n,result:r,selectedCommandGroup:o,expanded:s},Icon:f}=useCommandBarState(),E=signals_module_y(()=>{var t;return e.value&&e.value?null!==(t=n.value[e.value])&&void 0!==t?t:r.value.options[e.value]:null});return s.value?I.a.createElement("footer",{className:oe.commandBarFooter},e.value?I.a.createElement("span",{className:oe.activity},I.a.createElement(ne,null,I.a.createElement(IconSpinner,null)),I.a.createElement("em",null,E.value.name," ‒ ",t)):o.value?I.a.createElement("span",{className:oe.breadcrumb},I.a.createElement(f,{icon:n.value[o.value].icon}),I.a.createElement("small",null,n.value[o.value].name)):I.a.createElement(ne,null,I.a.createElement(IconNeos,null)),I.a.createElement(ae,null)):null}),se=n(8);let le=null;var ce=I.a.memo(()=>{var e;const{state:t,actions:n}=useCommandBarState(),{executeCommand:r}=useCommandExecutor(),{translate:o}=useIntl(),s=Object(C.useRef)(),f=Object(C.useCallback)(e=>{t.status.value===K.DISPLAYING_RESULT?(n.UPDATE_COMMAND_QUERY(e.target.value),t.commands.value[t.resultCommandId.value].executeManually||(le&&clearTimeout(le),le=setTimeout(()=>r(t.resultCommandId.value),500))):n.UPDATE_SEARCH(e.target.value)},[]),E=Object(C.useCallback)(e=>{"Escape"===e.key&&s.current.value&&(e.preventDefault(),e.stopPropagation())},[s.current]);return j(()=>{var e;t.status.value!==K.EXECUTING_COMMAND&&(null===(e=s.current)||void 0===e||e.focus())}),I.a.createElement(I.a.Fragment,null,I.a.createElement("input",{ref:s,className:se.searchBox,type:"search",placeholder:t.status.value===K.DISPLAYING_RESULT?o("SearchBox.commandQuery.placeholder","Enter the query for the command"):o("SearchBox.placeholder","What do you want to do today?"),autoFocus:!0,onChange:f,onKeyUp:E,value:t.status.value===K.DISPLAYING_RESULT?t.commandQuery:t.searchWord,"data-testid":"SearchBox"}),!t.expanded.value&&I.a.createElement("button",{className:se.expandButton,onClick:n.EXPAND,title:o("SearchBox.expand.title","Expand to show all commands")},I.a.createElement(ne,null,I.a.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 320 512"},I.a.createElement("path",{fill:"currentColor",d:"M31.3 192h257.3c17.8 0 26.7 21.5 14.1 34.1L174.1 354.8c-7.8 7.8-20.5 7.8-28.3 0L17.2 226.1C4.6 213.5 13.5 192 31.3 192z"})))),t.status.value===K.DISPLAYING_RESULT&&(null===(e=t.commands.value[t.resultCommandId.value])||void 0===e?void 0:e.executeManually)&&I.a.createElement("button",{className:se.executeButton,onClick:()=>r(t.resultCommandId.value),title:o("SearchBox.execute.title","Execute the command")},I.a.createElement(ne,null,I.a.createElement(IconPlay,null))))}),ue=n(14);var de=I.a.memo(()=>{const{state:e,actions:t}=useCommandBarState(),n=signals_module_y(()=>e.status.value==K.DISPLAYING_RESULT);return I.a.createElement("header",{className:ue.commandBarHeader},(n.value||e.selectedCommandGroup.value)&&I.a.createElement("button",{type:"button",onClick:n.value?t.CANCEL:t.GO_TO_PARENT_GROUP,className:ue.backButton,title:"Back"},I.a.createElement(ne,null,I.a.createElement(IconBack,null))),I.a.createElement(ce,null))}),me=n(4);var _e=I.a.memo((function CommandListItem({command:e,onItemSelect:t,highlightedId:n,onToggleFavourite:r}){const{state:{favouriteCommands:o},Icon:s}=useCommandBarState(),{translate:f}=useIntl(),{id:E,name:C,description:R,icon:S,action:O}=e,T=function getCommandType({subCommandIds:e,category:t,canHandleQueries:n,action:r},o){let s="command";return t||((null==e?void 0:e.length)>0?s="category":n?s="query":"string"==typeof r&&(s="link"),o("CommandListItem.type."+s,s))}(e,f),A=signals_module_y(()=>n.value===E),P=signals_module_y(()=>o.value.includes(E));return I.a.createElement("li",{className:classnames(me.commandListItem,A.value&&me.highlighted),onClick:()=>t(E),"data-testid":"CommandListItem"},I.a.createElement(s,{icon:S}),I.a.createElement("span",{className:me.label},I.a.createElement("span",null,C),R&&I.a.createElement("span",{className:me.description},"string"==typeof R?R:R())),r&&O&&I.a.createElement("button",{type:"button",className:classnames(me.favouriteButton,P.value&&me.isFavourite),title:f("CommandListItem.toggleFavourite","Toggle favourite"),onClick:e=>{e.stopPropagation(),r(E)}},I.a.createElement(ne,null,I.a.createElement(IconStar,null))),I.a.createElement("small",{className:me.type},T))})),fe=n(9);var he=I.a.memo(()=>{const{state:{commands:e,highlightedItem:t,availableCommandIds:n,status:r,searchWord:o,favouriteCommands:s,recentCommands:f,selectedCommandGroup:E},actions:{ADD_FAVOURITE:R,REMOVE_FAVOURITE:S}}=useCommandBarState(),{translate:O}=useIntl(),{executeCommand:T}=useCommandExecutor(),A=I.a.useRef(null);j(()=>{var e,n;null===(n=null===(e=A.current)||void 0===e?void 0:e.querySelector(`li:nth-child(${t.value})`))||void 0===n||n.scrollIntoView({behavior:"smooth",block:"center"})});const P=Object(C.useCallback)(e=>{s.value.includes(e)?S(e):R(e)},[s]),N=signals_module_y(()=>o.value||E.value?[]:n.value.filter(e=>f.value.includes(e))),D=signals_module_y(()=>o.value||E.value?n.value:n.value.filter(e=>!f.value.includes(e))),M=signals_module_y(()=>n.value[t.value]);return I.a.createElement("nav",{className:classnames(fe.results,r.value!==K.IDLE&&fe.disabled),"data-testid":"CommandList",ref:A},N.value.length>0&&I.a.createElement(I.a.Fragment,null,I.a.createElement("h6",null,O("CommandList.suggestions","Recently used")),I.a.createElement("ul",null,N.value.map(t=>I.a.createElement(_e,{key:t,command:e.value[t],onItemSelect:T,highlightedId:M,onToggleFavourite:P})))),D.value.length>0&&I.a.createElement(I.a.Fragment,null,I.a.createElement("h6",null,O("CommandList.heading","Commands")),I.a.createElement("ul",null,D.value.map(t=>I.a.createElement(_e,{key:t,command:e.value[t],onItemSelect:T,highlightedId:M,onToggleFavourite:P})))),0===n.value.length&&I.a.createElement("small",{className:fe.noResults},O("CommandList.noCommandsMessage","No matching commands found")))}),pe=n(10);var CommandResultsView_CommandResultsView=()=>{var e;const{state:{result:t,highlightedOption:n}}=useCommandBarState(),{executeCommand:r}=useCommandExecutor(),o=I.a.useRef(null),s=signals_module_y(()=>t.value?Object.values(t.value.options)[n.value].id:null);j(()=>{var e,t;const r=n.value;null===(t=null===(e=o.current)||void 0===e?void 0:e.querySelector(`li:nth-child(${r})`))||void 0===t||t.scrollIntoView({behavior:"smooth",block:"center"})});const{options:f,view:E,message:C}=null!==(e=t.value)&&void 0!==e?e:{};return I.a.createElement("div",{className:pe.commandResultsView},C&&I.a.createElement("h6",{className:pe.message},C),E?I.a.createElement("div",null,E):"",f&&I.a.createElement("nav",{className:pe.results,ref:o},I.a.createElement("ul",null,Object.keys(f).map(e=>I.a.createElement(_e,{key:e,command:f[e],onItemSelect:r,highlightedId:s})))))},ge=n(15);var ve=I.a.memo(({handleToggle:e,disabled:t=!1,label:n,title:r})=>I.a.createElement("button",{className:ge.toggleButton,onClick:e,disabled:t,title:r},I.a.createElement("span",null,n),I.a.createElement("span",{className:ge.buttonIcon},"⌘K")));const Ee=Object(C.createContext)({}),useCommandBarState=()=>Object(C.useContext)(Ee);const CommandBarStateProvider=({commands:e,children:t,IconComponent:n,userPreferences:r})=>{const{state:o,dispatch:s}=Object(C.useMemo)(()=>function createAppState(e){const t=u(e);return{state:{activeCommandId:w(()=>t.value.activeCommandId),activeCommandMessage:w(()=>t.value.activeCommandMessage),availableCommandIds:w(()=>t.value.availableCommandIds),commandQuery:w(()=>t.value.commandQuery),commands:w(()=>t.value.commands),expanded:w(()=>t.value.expanded),favouriteCommands:w(()=>t.value.favouriteCommands),highlightedItem:w(()=>t.value.highlightedItem),highlightedOption:w(()=>t.value.highlightedOption),recentCommands:w(()=>t.value.recentCommands),result:w(()=>t.value.result),resultCommandId:w(()=>t.value.resultCommandId),searchWord:w(()=>t.value.searchWord),selectedCommandGroup:w(()=>t.value.selectedCommandGroup),showBranding:w(()=>t.value.showBranding),status:w(()=>t.value.status)},dispatch:e=>{t.value=commandBarReducer(t.value,e)}}}({activeCommandId:null,activeCommandMessage:null,availableCommandIds:Object.keys(e),commandQuery:"",commands:flattenCommands(e),expanded:!1,favouriteCommands:r.favouriteCommands,highlightedItem:0,highlightedOption:0,recentCommands:r.recentCommands,result:null,resultCommandId:null,searchWord:"",selectedCommandGroup:null,showBranding:r.showBranding,status:K.COLLAPSED}),[]),f=Object(C.useMemo)(()=>({[Z.RESET_SEARCH]:()=>s({type:Z.RESET_SEARCH}),[Z.HIGHLIGHT_NEXT_ITEM]:()=>s({type:Z.HIGHLIGHT_NEXT_ITEM}),[Z.HIGHLIGHT_PREVIOUS_ITEM]:()=>s({type:Z.HIGHLIGHT_PREVIOUS_ITEM}),[Z.CANCEL]:()=>s({type:Z.CANCEL}),[Z.SELECT_GROUP]:e=>s({type:Z.SELECT_GROUP,commandId:e}),[Z.GO_TO_PARENT_GROUP]:()=>s({type:Z.GO_TO_PARENT_GROUP}),[Z.UPDATE_SEARCH]:e=>s({type:Z.UPDATE_SEARCH,searchWord:e}),[Z.UPDATE_COMMAND_QUERY]:e=>s({type:Z.UPDATE_COMMAND_QUERY,commandQuery:e}),[Z.EXECUTE_COMMAND]:async(e,t)=>(s({type:Z.EXECUTE_COMMAND,commandId:e,message:t}),r.addRecentCommand(e).catch(e=>q.error("Could not add recent command",e))),[Z.FINISH_COMMAND]:()=>s({type:Z.FINISH_COMMAND}),[Z.UPDATE_RESULT]:e=>s({type:Z.UPDATE_RESULT,result:e}),[Z.EXPAND]:()=>s({type:Z.EXPAND}),[Z.ADD_FAVOURITE]:e=>{s({type:Z.ADD_FAVOURITE,commandId:e}),r.setFavouriteCommands(o.favouriteCommands.value).catch(e=>q.error("Could not update favourite commands",e))},[Z.REMOVE_FAVOURITE]:e=>{s({type:Z.REMOVE_FAVOURITE,commandId:e}),r.setFavouriteCommands(o.favouriteCommands.value).catch(e=>q.error("Could not update favourite commands",e))}}),[]),E=Object(C.useCallback)(({icon:e,spin:t=!1})=>I.a.createElement(ne,null,I.a.createElement(n,{icon:e,spin:t})),[]);return I.a.createElement(Ee.Provider,{value:{state:o,actions:f,Icon:E}},t)},ye=I.a.createContext({}),useCommandExecutor=()=>I.a.useContext(ye),CommandBarExecutor=({children:e,toggleOpen:t,dialogRef:n,open:r})=>{const{state:o,actions:s}=useCommandBarState(),f=useFunctionRef(e=>{if(r&&!e.defaultPrevented)if("k"===e.key&&e.metaKey&&(null==n?void 0:n.current.contains(e.target)))t(),e.stopPropagation(),e.preventDefault();else if("Escape"===e.key)e.stopPropagation(),e.preventDefault(),o.selectedCommandGroup.value||o.searchWord.value||o.commandQuery.value?s.CANCEL():t();else if("ArrowDown"===e.key)e.stopPropagation(),e.preventDefault(),s.HIGHLIGHT_NEXT_ITEM();else if("ArrowUp"===e.key)e.stopPropagation(),e.preventDefault(),s.HIGHLIGHT_PREVIOUS_ITEM();else if("Enter"===e.key){e.stopPropagation(),e.preventDefault();let t=o.availableCommandIds.value[o.highlightedItem.value];o.status.value===K.DISPLAYING_RESULT&&(t=Object.values(o.result.value.options).length?Object.keys(o.result.value.options)[o.highlightedOption.value]:o.resultCommandId.value),t&&E(t)}}),E=Object(C.useCallback)(async e=>{var n,r,f;const E=null!==(r=null===(n=o.result.value)||void 0===n?void 0:n.options[e])&&void 0!==r?r:o.commands.value[e],{action:C,canHandleQueries:I,subCommandIds:R,name:S}=E;if((null==R?void 0:R.length)>0)return void s.SELECT_GROUP(e);if(assert(C,`Command ${e} has no action`),"string"==typeof C)return await s.EXECUTE_COMMAND(e,"Loading url"),0===C.indexOf("http")&&0!==C.indexOf(document.location.origin)?null===(f=window.open(C,"_blank","noopener,noreferrer"))||void 0===f||f.focus():window.location.href=C,s.FINISH_COMMAND();s.EXECUTE_COMMAND(e,"Running command");const O=C(I?o.commandQuery.value:void 0);if(O.then)O.then(e=>{if(e&&!e.success)throw new Error(`The command "${S}" failed`)}).catch(e=>{q.error("Command error",S,e)}).finally(()=>{s.FINISH_COMMAND()});else if(O.next){const e=O;for await(const t of e)s.UPDATE_RESULT(t);s.FINISH_COMMAND()}else q.error("Command result is not a promise or generator",O);E.closeOnExecute&&t()},[o.searchWord,o.commands,o.result]),R=useFunctionRef(e=>{E(e)});return Object(C.useEffect)(()=>{if(!r)return;const windowKeyEventHandler=e=>f.current(e);return window.addEventListener("keydown",windowKeyEventHandler),()=>window.removeEventListener("keydown",windowKeyEventHandler)},[r]),I.a.createElement(ye.Provider,{value:{executeCommand:R.current}},e)},Ce=Object(C.createContext)({}),useIntl=()=>Object(C.useContext)(Ce),IntlProvider=({translate:e,children:t})=>I.a.createElement(Ce.Provider,{value:{translate:e}},t);var be=n(5);var CommandBarDialog_CommandBarDialog=({onDrag:e,open:t,toggleOpen:n})=>{const{state:{expanded:r,result:o}}=useCommandBarState(),s=Object(C.useRef)(null),f=signals_module_h(!1),E=signals_module_h({left:window.innerWidth/2-300,top:window.innerHeight/2-20}),R=signals_module_h({offsetLeft:0,offsetTop:0}),S=signals_module_h(!1),O=signals_module_y(()=>{const{left:e,top:t}=E.value;return S?{left:e+"px",top:t+"px",translate:"none",visibility:f.value?"hidden":"visible"}:{}}),T=Object(C.useCallback)((e,t)=>{const n=s.current.getBoundingClientRect();E.value={left:clamp(e,0,window.innerWidth-n.width),top:clamp(t,0,window.innerHeight-n.height)}},[]),A=Object(C.useCallback)(t=>{"INPUT"!==t.target.tagName&&(console.debug("dragstart"),t.dataTransfer.setData("text/plain","CommandBar"),t.dataTransfer.dropEffect="move",t.dataTransfer.effectAllowed="move",h(()=>{R.value={offsetLeft:t.clientX-s.current.offsetLeft,offsetTop:t.clientY-s.current.offsetTop},S.value=!0}),e&&e(!0))},[s.current]),P=Object(C.useCallback)(t=>{const{clientX:n,clientY:r}=t;console.debug("dragdrop",n,r,R.value),h(()=>{f.value=!1,T(n-R.value.offsetLeft,r-R.value.offsetTop)}),e&&e(!1)},[s.current]),N=Object(C.useCallback)(()=>T(E.value.left,E.value.top),[]);return Object(C.useEffect)(()=>{if(t)return s.current.parentElement.addEventListener("drop",P),window.addEventListener("resize",N),()=>{s.current.parentElement.removeEventListener("drop",P),window.removeEventListener("resize",N)}},[t,N,P]),t?I.a.createElement("dialog",{ref:s,className:classnames(be.commandBar,o.value&&be.hasResults),open:t,draggable:!0,onDragStart:A,onDrag:()=>f.value=!0,style:O.value,"data-testid":"CommandBarDialog"},I.a.createElement(CommandBarExecutor,{toggleOpen:n,dialogRef:s,open:t},I.a.createElement(de,null),I.a.createElement("div",{className:classnames(be.resultsWrap,r.value&&be.expanded,o.value&&be.split)},r.value&&I.a.createElement(he,null),o.value&&I.a.createElement(CommandResultsView_CommandResultsView,null)),I.a.createElement(ie,null))):null};n(31);var src_CommandBar=({commands:e,open:t,toggleOpen:n,onDrag:r,IconComponent:o,userPreferences:s,translate:f})=>I.a.createElement(IntlProvider,{translate:f},I.a.createElement(CommandBarStateProvider,{commands:e,IconComponent:o,userPreferences:s},I.a.createElement(CommandBarDialog_CommandBarDialog,{onDrag:r,open:t,toggleOpen:n})));async function fetchData(e,t,n="GET"){return t&&"GET"===n&&(e=Object.keys(t).reduce((e,n)=>e+"&"+n+"="+encodeURIComponent(t[n]),e+"?")),fetch(e,{method:n,credentials:"include",body:t&&"POST"===n?JSON.stringify(t):void 0,headers:{"Content-Type":"application/json",Accept:"application/json"}}).then(e=>{var t;if(200!==e.status)throw new Error(`The request failed with code ${e.status}: "${e.statusText}"`);return(null===(t=e.headers.get("Content-Type"))||void 0===t?void 0:t.includes("application/json"))?e.json():e.text()})}async function setPreference(e,t){return fetchData(e,t,"POST")}async function getPreferences(){return fetchData("/neos/shel-neos-commandbar/preferences/getpreferences")}async function setFavouriteCommands(e){return setPreference("/neos/shel-neos-commandbar/preferences/setfavourites",{commandIds:e})}async function addRecentCommand(e){return setPreference("/neos/shel-neos-commandbar/preferences/addrecentcommand",{commandId:e})}async function getCommands(){return fetchData("/neos/service/data-source/shel-neos-commandbar-commands")}async function searchNeosDocs(e){return e?fetchData("/neos/service/data-source/shel-neos-commandbar-search-neos-docs",{query:e}):{}}async function searchNeosPackages(e){return e?fetchData("/neos/service/data-source/shel-neos-commandbar-search-neos-packages",{query:e}):{}}async function searchNodes(e,t){return e?fetchData("service/data-source/shel-neos-commandbar-search-nodes",{query:e,node:t}):[]}var Ie=n(6),Re=n(11);const CommandBarUiPlugin_IconComponent=({icon:e,spin:t=!1})=>C.createElement(P.Icon,{icon:e,spin:t});class CommandBarUiPlugin_CommandBarUiPlugin extends C.PureComponent{constructor(e){super(e),this.buildCommandsFromHotkeys=()=>{const{hotkeyRegistry:e,handleHotkeyAction:t,config:n}=this.props;return e.getAllAsList().reduce((e,{id:r,description:o,action:s})=>(n.hotkeys.filter.includes(r)||(e[r]={name:o,description:r,icon:this.mapHotkeyIdToIcon(r),action:async()=>{t(s())},closeOnExecute:!0}),e),{})},this.buildCommandsFromEditPreviewModes=()=>{const{setEditPreviewMode:e,editPreviewModes:t,i18nRegistry:n}=this.props;return Object.keys(t).reduce((r,o)=>{const{title:s,isEditingMode:f}=t[o];return r[o]={name:n.translate(s),description:()=>this.props.editPreviewMode===o?this.translate("CommandBarUiPlugin.command.switchEditPreviewMode.active","Currently active"):"",icon:f?"pencil":"eye",action:async()=>e(o)},r},{})},this.handleAddNode=async()=>{const{addNode:e,documentNode:t,focusedNodeContextPath:n,toggleCommandBar:r}=this.props;r(),e(n||t.contextPath,void 0,"after")},this.handleSearchNode=async function*(e){const{siteNode:t,setActiveContentCanvasSrc:n}=this.props;let r;yield{success:!0,message:this.translate("CommandBarUiPlugin.command.searchDocuments.searching",{query:e})};const o=await E.searchNodes(e,t.contextPath).catch(e=>{q.error("Could not search nodes",e),r=e.message});o?yield{success:!0,message:this.translate("CommandBarUiPlugin.command.searchDocuments.matches",{matches:o.length}),options:o.reduce((e,{name:t,nodetype:r,contextPath:o,uri:s,icon:f})=>s?(e[o]={id:o,name:t,category:r,action:async()=>{n(s)},closeOnExecute:!0,icon:f},e):e,{})}:yield{success:!1,message:this.translate("CommandBarUiPlugin.command.searchDocuments.searchFailed","Search failed"),view:r}},this.handleSearchNeosDocs=async function*(e){let t;yield{success:!0,message:this.translate("CommandBarUiPlugin.command.documentation.searching",{query:e},`Search for "${e}"`)};const n=await s.searchNeosDocs(e).catch(e=>{q.error("Could not search Neos docs",e),t=e.message});t||!n?yield{success:!1,message:this.translate("CommandBarUiPlugin.command.documentation.error","Search failed"),view:t}:yield{success:!0,message:this.translate("CommandBarUiPlugin.command.documentation.matches",{matches:Object.keys(n).length},Object.values(n).length+" options match your query"),options:n}},this.handleSearchNeosPackages=async function*(e){let t;yield{success:!0,message:this.translate("CommandBarUiPlugin.command.packages.searching",{query:e},`Search for "${e}"`)};const n=await f.searchNeosPackages(e).catch(e=>{q.error("Could not search Neos packages",e),t=e.message});t||!n?yield{success:!1,message:this.translate("CommandBarUiPlugin.command.packages.error","Search failed"),view:t}:yield{success:!0,message:this.translate("CommandBarUiPlugin.command.packages.matches",{matches:Object.values(n).length},Object.values(n).length+" options match your query"),options:n}},this.handlePublish=async()=>{const{publishableNodesInDocument:e,publishAction:t,baseWorkspace:n}=this.props;return t(e.map(e=>e.contextPath),n),{success:!0,message:this.translate("CommandBarUiPlugin.command.publish.success",{count:e.length},`Published ${e.length} changes`)}},this.handlePublishAll=async()=>{const{publishableNodes:e,publishAction:t,baseWorkspace:n}=this.props;return t(e.map(e=>e.contextPath),n),{success:!0,message:this.translate("CommandBarUiPlugin.command.publishAll.success",{count:e.length},`Published ${e.length} changes`)}},this.handleDiscard=async()=>{const{publishableNodesInDocument:e,discardAction:t}=this.props;return t(e.map(e=>e.contextPath)),{success:!0,message:this.translate("CommandBarUiPlugin.command.discard.success",{count:e.length},`Discarded ${e.length} changes`)}},this.handleDiscardAll=async()=>{const{publishableNodes:e,discardAction:t}=this.props;return t(e.map(e=>e.contextPath)),{success:!0,message:this.translate("CommandBarUiPlugin.command.discardAll.success",{count:e.length},`Discarded ${e.length} changes`)}},this.setDragging=e=>{this.setState({...this.state,dragging:e})},this.translate=(e,t,n)=>("string"==typeof t&&(n=t,t={}),this.props.i18nRegistry.translate(e,n,t,"Shel.Neos.CommandBar","Main")),this.state={loaded:!1,dragging:!1,favouriteCommands:[],recentCommands:[],recentDocuments:[],showBranding:!0,commands:{addNode:{name:this.translate("CommandBarUiPlugin.command.addNode","Add content"),icon:"plus",description:this.translate("CommandBarUiPlugin.command.addNode.description","Add new content"),action:this.handleAddNode},searchDocuments:{name:this.translate("CommandBarUiPlugin.command.searchDocuments","Search documents"),icon:"search",description:this.translate("CommandBarUiPlugin.command.searchDocuments.description","Search and navigate to documents"),action:this.handleSearchNode.bind(this),canHandleQueries:!0},publishDiscard:{name:this.translate("CommandBarUiPlugin.command.publishDiscard","Publish / discard"),description:this.translate("CommandBarUiPlugin.command.publishDiscard.description","Publish or discard changes"),icon:"check",subCommands:{publish:{name:this.translate("CommandBarUiPlugin.command.publish","Publish"),description:this.translate("CommandBarUiPlugin.command.publish.description","Publish changes in this document"),icon:"check",action:this.handlePublish},publishAll:{name:this.translate("CommandBarUiPlugin.command.publishAll","Publish all"),description:this.translate("CommandBarUiPlugin.command.publishAll.description","Publish changes in all documents"),icon:"check-double",action:this.handlePublishAll},discard:{name:this.translate("CommandBarUiPlugin.command.discard","Discard"),description:this.translate("CommandBarUiPlugin.command.discard.description","Discard changes in the current document"),icon:"ban",action:this.handleDiscard},discardAll:{name:this.translate("CommandBarUiPlugin.command.discardAll","Discard all"),description:this.translate("CommandBarUiPlugin.command.discardAll.description","Discard changes in all documents"),icon:"ban",action:this.handleDiscardAll}}},quickActions:{name:this.translate("CommandBarUiPlugin.command.quickActions","Quick actions"),icon:"keyboard",description:this.translate("CommandBarUiPlugin.command.quickActions.description","Execute hotkeys"),subCommands:this.buildCommandsFromHotkeys()},switchEditPreviewMode:{name:this.translate("CommandBarUiPlugin.command.switchEditPreviewMode","Switch edit/preview mode"),icon:"pencil",description:this.translate("CommandBarUiPlugin.command.switchEditPreviewMode.description","Switch between edit and preview modes"),subCommands:this.buildCommandsFromEditPreviewModes()},openPreview:{name:this.translate("CommandBarUiPlugin.command.openPreview","Open preview"),description:this.translate("CommandBarUiPlugin.command.openPreview.description","Open the preview for current document"),icon:"external-link-alt",action:async()=>{var e;this.props.previewUrl?null===(e=window.open(this.props.previewUrl,"_blank","noopener,noreferrer"))||void 0===e||e.focus():q.warn("No preview url to open")},closeOnExecute:!0}}},e.config.features.searchNeosDocs&&(this.state.commands.searchNeosDocs={name:this.translate("CommandBarUiPlugin.command.documentation","Documentation"),description:this.translate("CommandBarUiPlugin.command.documentation.description","Browse or search the Neos documentation"),icon:"book",canHandleQueries:!0,action:this.handleSearchNeosDocs.bind(this)}),e.config.features.searchNeosPackages&&(this.state.commands.searchNeosPackages={name:this.translate("CommandBarUiPlugin.command.packages","Packages"),description:this.translate("CommandBarUiPlugin.command.packages.description","Search for Neos packages"),icon:"boxes",canHandleQueries:!0,action:this.handleSearchNeosPackages.bind(this)})}mapHotkeyIdToIcon(e){let t=e.split(".").pop();switch(t.indexOf("toggle")>=0&&(t="toggle"),t){case"toggle":return"toggle-on";case"reload":return"redo";case"cancel":case"close":return"window-close";case"apply":return"check"}return"neos"}async componentDidMount(){const{plugins:e}=this.props;let t={};if(e)for(const n of Object.keys(e)){const r=e[n];try{const e=await r();t={...t,...e}}catch(e){q.warn("Could not load commands from plugin "+n,e)}}const n=await o.getCommands().catch(e=>{q.error("Failed to load commands",e)}),s=await r.getPreferences().catch(e=>{q.error("Failed to load user preferences",e)});s&&n&&this.setState(e=>({loaded:!0,...s,commands:{...e.commands,...n,...t}}))}render(){const{commandBarOpen:e,toggleCommandBar:t}=this.props,{commands:n,loaded:o,dragging:s,favouriteCommands:f,recentCommands:E,recentDocuments:I,showBranding:R}=this.state;return C.createElement("div",{className:Re.commandBarToolbarComponent},C.createElement(ve,{handleToggle:t,disabled:!o,label:this.translate("ToggleButton.label","Search…"),title:this.translate("ToggleButton.title","Search for commands")}),o&&C.createElement("div",{className:[Re.fullScreenLayer,e&&Re.open].join(" "),onDragOver:e=>e.preventDefault(),style:s?{pointerEvents:"all"}:null},C.createElement(src_CommandBar,{open:e,commands:n,toggleOpen:t,onDrag:this.setDragging,IconComponent:CommandBarUiPlugin_IconComponent,userPreferences:{favouriteCommands:f,recentCommands:E,recentDocuments:I,showBranding:R,addRecentCommand:r.addRecentCommand,setFavouriteCommands:r.setFavouriteCommands},translate:this.translate})))}}CommandBarUiPlugin_CommandBarUiPlugin.propTypes={addNode:O.a.func.isRequired,baseWorkspace:O.a.string.isRequired,commandBarOpen:O.a.bool,config:O.a.object.isRequired,discardAction:O.a.func.isRequired,documentNode:O.a.object,editPreviewMode:O.a.string.isRequired,editPreviewModes:O.a.object.isRequired,focusedNodeContextPath:O.a.string,handleHotkeyAction:O.a.func.isRequired,hotkeyRegistry:O.a.object.isRequired,i18nRegistry:O.a.object.isRequired,isWorkspaceReadOnly:O.a.bool,publishAction:O.a.func.isRequired,publishableNodes:O.a.array,publishableNodesInDocument:O.a.array,previewUrl:O.a.string,setActiveContentCanvasSrc:O.a.func.isRequired,setEditPreviewMode:O.a.func.isRequired,siteNode:O.a.object,toggleCommandBar:O.a.func.isRequired};const Se=Object(T.neos)(e=>({i18nRegistry:e.get("i18n"),hotkeyRegistry:e.get("hotkeys"),config:e.get("frontendConfiguration").get("Shel.Neos.CommandBar:CommandBar"),nodeTypesRegistry:e.get("@neos-project/neos-ui-contentrepository"),editPreviewModes:e.get("frontendConfiguration").get("editPreviewModes"),plugins:e.get("Shel.Neos.CommandBar").getChildrenAsObject("plugins")}));t.default=Object(R.connect)(()=>({}),{toggleCommandBar:Ie.actions.toggleCommandBar,addNode:A.actions.CR.Nodes.commenceCreation,setEditPreviewMode:A.actions.UI.EditPreviewMode.set,publishAction:A.actions.CR.Workspaces.publish,discardAction:A.actions.CR.Workspaces.commenceDiscard,setActiveContentCanvasSrc:A.actions.UI.ContentCanvas.setSrc})(Object(R.connect)(e=>({siteNode:A.selectors.CR.Nodes.siteNodeSelector(e),documentNode:A.selectors.CR.Nodes.documentNodeSelector(e),focusedNodeContextPath:A.selectors.CR.Nodes.focusedNodePathSelector(e),publishableNodes:A.selectors.CR.Workspaces.publishableNodesSelector(e),publishableNodesInDocument:A.selectors.CR.Workspaces.publishableNodesInDocumentSelector(e),isWorkspaceReadOnly:A.selectors.CR.Workspaces.isWorkspaceReadOnlySelector(e),baseWorkspace:A.selectors.CR.Workspaces.baseWorkspaceSelector(e),commandBarOpen:Ie.selectors.commandBarOpen(e),editPreviewMode:A.selectors.UI.EditPreviewMode.currentEditPreviewMode(e),previewUrl:Ie.selectors.previewUrl(e)}),e=>({handleHotkeyAction:e}))(Se(CommandBarUiPlugin_CommandBarUiPlugin)))}]); +!function(e){var t={};function __webpack_require__(n){if(t[n])return t[n].exports;var r=t[n]={i:n,l:!1,exports:{}};return e[n].call(r.exports,r,r.exports,__webpack_require__),r.l=!0,r.exports}__webpack_require__.m=e,__webpack_require__.c=t,__webpack_require__.d=function(e,t,n){__webpack_require__.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},__webpack_require__.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},__webpack_require__.t=function(e,t){if(1&t&&(e=__webpack_require__(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(__webpack_require__.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)__webpack_require__.d(n,r,function(t){return e[t]}.bind(null,r));return n},__webpack_require__.n=function(e){var t=e&&e.__esModule?function getDefault(){return e.default}:function getModuleExports(){return e};return __webpack_require__.d(t,"a",t),t},__webpack_require__.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},__webpack_require__.p="",__webpack_require__(__webpack_require__.s=21)}([function(e,t,n){"use strict";var r=function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}(n(3));e.exports=(0,r.default)("vendor")().React},function(e,t,n){"use strict";var r=function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}(n(3));e.exports=(0,r.default)("vendor")().PropTypes},function(e,t,n){"use strict";var r=function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}(n(3));e.exports=(0,r.default)("NeosProjectPackages")().NeosUiReduxStore},function(e,t,n){"use strict";var __read=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,s=n.call(e),f=[];try{for(;(void 0===t||t-- >0)&&!(r=s.next()).done;)f.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=s.return)&&n.call(s)}finally{if(o)throw o.error}}return f},__spreadArray=function(e,t,n){if(n||2===arguments.length)for(var r,o=0,s=t.length;o{var n,r,o;return{...e,plugins:{...e.plugins,commandBar:{open:void 0!==(null===(n=t.payload)||void 0===n?void 0:n.open)?t.payload.open:!(null===(o=null===(r=e.plugins)||void 0===r?void 0:r.commandBar)||void 0===o?void 0:o.open)}}}}},{plugins:{commandBar:{open:!1}}}),E={commandBarOpen:e=>{var t,n;return null===(n=null===(t=e.plugins)||void 0===t?void 0:t.commandBar)||void 0===n?void 0:n.open},previewUrl:e=>{var t,n;return null===(n=null===(t=e.ui)||void 0===t?void 0:t.contentCanvas)||void 0===n?void 0:n.previewUrl}}},function(e,t,n){e.exports={commandBarFooter:"CommandBarFooter-module__commandBarFooter___2mcre",breadcrumb:"CommandBarFooter-module__breadcrumb___1Ul24",activity:"CommandBarFooter-module__activity___2GXJU"}},function(e,t,n){e.exports={searchBox:"SearchBox-module__searchBox___1SEtn",expandButton:"SearchBox-module__expandButton___B2jYv",executeButton:"SearchBox-module__executeButton___3hg_l"}},function(e,t,n){e.exports={results:"CommandListing-module__results___23Rve",noResults:"CommandListing-module__noResults___Mb89V",disabled:"CommandListing-module__disabled___6gpPj"}},function(e,t,n){e.exports={commandResultsView:"CommandResultsView-module__commandResultsView___xLqwb",message:"CommandResultsView-module__message___NhUkR",results:"CommandResultsView-module__results___1t6jB",noResults:"CommandResultsView-module__noResults___2ksIF",disabled:"CommandResultsView-module__disabled___OmNvX"}},function(e,t,n){e.exports={fullScreenLayer:"CommandBarUiPlugin-module__fullScreenLayer___1cUx4",open:"CommandBarUiPlugin-module__open___1Bjxj",commandBarToolbarComponent:"CommandBarUiPlugin-module__commandBarToolbarComponent___1agRY"}},function(e,t,n){"use strict";var r=function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}(n(3));e.exports=(0,r.default)("vendor")().reduxActions},function(e,t,n){"use strict";var r=function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}(n(3));e.exports=(0,r.default)("vendor")().reactRedux},function(e,t,n){e.exports={commandBarHeader:"CommandBarHeader-module__commandBarHeader___3Y2hR",backButton:"CommandBarHeader-module__backButton___1qIGu"}},function(e,t,n){e.exports={toggleButton:"ToggleButton-module__toggleButton___2wPs-",buttonIcon:"ToggleButton-module__buttonIcon___UjFjw"}},function(e,t,n){"use strict";var r,o=(r=function extendStatics(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function __(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)}),__importDefault=function(e){return e&&e.__esModule?e:{default:e}};t.__esModule=!0;var s=__importDefault(n(27)),f=__importDefault(n(28)),E=function(e){function SynchronousRegistry(t){var n=e.call(this,t)||this;return n._registry=[],n}return o(SynchronousRegistry,e),SynchronousRegistry.prototype.set=function(e,t,n){if(void 0===n&&(n=0),"string"!=typeof e)throw new Error("Key must be a string");if("string"!=typeof n&&"number"!=typeof n)throw new Error("Position must be a string or a number");var r={key:e,value:t};n&&(r.position=n);var o=this._registry.findIndex((function(t){return t.key===e}));return-1===o?this._registry.push(r):this._registry[o]=r,t},SynchronousRegistry.prototype.get=function(e){if("string"!=typeof e)return console.error("Key must be a string"),null;var t=this._registry.find((function(t){return t.key===e}));return t?t.value:null},SynchronousRegistry.prototype._getChildrenWrapped=function(e){var t=this._registry.filter((function(t){return 0===t.key.indexOf(e+"/")}));return(0,f.default)(t)},SynchronousRegistry.prototype.getChildrenAsObject=function(e){var t={};return this._getChildrenWrapped(e).forEach((function(e){t[e.key]=e.value})),t},SynchronousRegistry.prototype.getChildren=function(e){return this._getChildrenWrapped(e).map((function(e){return e.value}))},SynchronousRegistry.prototype.has=function(e){return"string"!=typeof e?(console.error("Key must be a string"),!1):Boolean(this._registry.find((function(t){return t.key===e})))},SynchronousRegistry.prototype._getAllWrapped=function(){return(0,f.default)(this._registry)},SynchronousRegistry.prototype.getAllAsObject=function(){var e={};return this._getAllWrapped().forEach((function(t){e[t.key]=t.value})),e},SynchronousRegistry.prototype.getAllAsList=function(){return this._getAllWrapped().map((function(e){return Object.assign({id:e.key},e.value)}))},SynchronousRegistry}(s.default);t.default=E},function(e,t,n){"use strict";var r=function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}(n(3));e.exports=(0,r.default)("NeosProjectPackages")().NeosUiDecorators},function(e,t,n){"use strict";var r=function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}(n(3));e.exports=(0,r.default)("NeosProjectPackages")().ReactUiComponents},function(e,t,n){e.exports={iconWrap:"IconWrapper-module__iconWrap___1Z3nD"}},function(e,t,n){e.exports={madeWithLove:"Branding-module__madeWithLove___2ibna"}},function(e,t,n){"use strict";n(22)},function(e,t,n){"use strict";var r=n(23),o=_interopRequireDefault(r),s=n(6),f=_interopRequireDefault(n(32));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}(0,o.default)("Shel.Neos.CommandBar:CommandBar",{},(function(e,t){var n=t.frontendConfiguration;if(n["Shel.Neos.CommandBar:CommandBar"].enabled&&(e.set("Shel.Neos.CommandBar",new r.SynchronousRegistry("\n # Shel.Neos.CommandBar 3rd party commands\n ")),e.get("containers").set("PrimaryToolbar/Middle/CommandBar",f.default),e.get("reducers").set("Shel.Neos.CommandBar",{reducer:s.reducer}),null!==n.hotkeys&&0!==n.hotkeys.length)){var o=e.get("hotkeys");o.set("Shel.Neos.CommandBar.toggle.CMD",{description:"Toggle command bar",action:s.actions.toggleCommandBar}),o.set("Shel.Neos.CommandBar.toggle.CTRL",{description:"Toggle command bar",action:s.actions.toggleCommandBar})}}))},function(e,t,n){"use strict";var __importDefault=function(e){return e&&e.__esModule?e:{default:e}};t.__esModule=!0,t.SynchronousMetaRegistry=t.SynchronousRegistry=t.readFromConsumerApi=t.createConsumerApi=void 0;var r=__importDefault(n(24));t.createConsumerApi=r.default;var o=__importDefault(n(3));t.readFromConsumerApi=o.default;var s=n(26);t.SynchronousRegistry=s.SynchronousRegistry,t.SynchronousMetaRegistry=s.SynchronousMetaRegistry,t.default=(0,o.default)("manifest")},function(e,t,n){"use strict";var __importDefault=function(e){return e&&e.__esModule?e:{default:e}};t.__esModule=!0;var r=__importDefault(n(25)),o=function createReadOnlyValue(e){return{value:e,writable:!1,enumerable:!1,configurable:!0}};t.default=function createConsumerApi(e,t){var n={};Object.keys(t).forEach((function(e){Object.defineProperty(n,e,o(t[e]))})),Object.defineProperty(n,"@manifest",o((0,r.default)(e))),Object.defineProperty(window,"@Neos:HostPluginAPI",o(n))}},function(e,t,n){"use strict";t.__esModule=!0,t.default=function(e){return function(t,n,r){var o;e.push(((o={})[t]={options:n,bootstrap:r},o))}}},function(e,t,n){"use strict";var __importDefault=function(e){return e&&e.__esModule?e:{default:e}};t.__esModule=!0,t.SynchronousMetaRegistry=t.SynchronousRegistry=void 0;var r=__importDefault(n(16));t.SynchronousRegistry=r.default;var o=__importDefault(n(30));t.SynchronousMetaRegistry=o.default},function(e,t,n){"use strict";t.__esModule=!0;var r=function r(e){this.SERIAL_VERSION_UID="d8a5aa78-978e-11e6-ae22-56b6b6499611",this.description=e};t.default=r},function(e,t,n){"use strict";t.__esModule=!0;var r=n(29);t.default=function positionalArraySorter(e,t,n){var o,s,f,E,C,I,R,S,O,T,A,P,N,D;void 0===t&&(t="position"),void 0===n&&(n="key");var M="string"==typeof t?function(e){return e[t]}:t,U={},L={},H={},x={},k={},B={};e.forEach((function(e,t){var r=e[n]?e[n]:String(t);U[r]=t;var o=M(e),s=String(o||t),f=!1;if(s.startsWith("start")){var E=(C=s.match(/start\s+(\d+)/))&&C[1]?Number(C[1]):0;H[E]||(H[E]=[]),H[E].push(r)}else if(s.startsWith("end")){var C;E=(C=s.match(/end\s+(\d+)/))&&C[1]?Number(C[1]):0;x[E]||(x[E]=[]),x[E].push(r)}else if(s.startsWith("before")){if(R=s.match(/before\s+(\S+)(\s+(\d+))?/)){var I=R[1];E=R[3]?Number(R[3]):0;k[I]||(k[I]={}),k[I][E]||(k[I][E]=[]),k[I][E].push(r)}else f=!0}else if(s.startsWith("after")){var R;if(R=s.match(/after\s+(\S+)(\s+(\d+))?/)){I=R[1],E=R[3]?Number(R[3]):0;B[I]||(B[I]={}),B[I][E]||(B[I][E]=[]),B[I][E].push(r)}else f=!0}else f=!0;if(f){var S=parseFloat(s);!isNaN(S)&&isFinite(S)||(S=t),L[S]||(L[S]=[]),L[S].push(r)}}));var G=[],F=[],V=[],W=[],q=function sortedWeights(e,t){var n=Object.keys(e).map((function(e){return Number(e)})).sort((function(e,t){return e-t}));return t?n:n.reverse()},X=function addToResults(e,t){e.forEach((function(e){var n,o,s,f;if(!(W.indexOf(e)>=0)){if(W.push(e),k[e]){var E=q(k[e],!0);try{for(var C=r.__values(E),I=C.next();!I.done;I=C.next()){var R=I.value;addToResults(k[e][R],t)}}catch(e){n={error:e}}finally{try{I&&!I.done&&(o=C.return)&&o.call(C)}finally{if(n)throw n.error}}}if(t.push(e),B[e]){var S=q(B[e],!1);try{for(var O=r.__values(S),T=O.next();!T.done;T=O.next()){R=T.value;addToResults(B[e][R],t)}}catch(e){s={error:e}}finally{try{T&&!T.done&&(f=O.return)&&f.call(O)}finally{if(s)throw s.error}}}}}))};try{for(var z=r.__values(q(H,!1)),Y=z.next();!Y.done;Y=z.next()){var Q=Y.value;X(H[Q],G)}}catch(e){o={error:e}}finally{try{Y&&!Y.done&&(s=z.return)&&s.call(z)}finally{if(o)throw o.error}}try{for(var $=r.__values(q(L,!0)),K=$.next();!K.done;K=$.next()){Q=K.value;X(L[Q],F)}}catch(e){f={error:e}}finally{try{K&&!K.done&&(E=$.return)&&E.call($)}finally{if(f)throw f.error}}try{for(var Z=r.__values(q(x,!0)),J=Z.next();!J.done;J=Z.next()){Q=J.value;X(x[Q],V)}}catch(e){C={error:e}}finally{try{J&&!J.done&&(I=Z.return)&&I.call(Z)}finally{if(C)throw C.error}}try{for(var ee=r.__values(Object.keys(k)),te=ee.next();!te.done;te=ee.next()){var ne=te.value;if(!(W.indexOf(ne)>=0))try{for(var re=(O=void 0,r.__values(q(k[ne],!1))),ae=re.next();!ae.done;ae=re.next()){Q=ae.value;X(k[ne][Q],G)}}catch(e){O={error:e}}finally{try{ae&&!ae.done&&(T=re.return)&&T.call(re)}finally{if(O)throw O.error}}}}catch(e){R={error:e}}finally{try{te&&!te.done&&(S=ee.return)&&S.call(ee)}finally{if(R)throw R.error}}try{for(var oe=r.__values(Object.keys(B)),ie=oe.next();!ie.done;ie=oe.next()){ne=ie.value;if(!(W.indexOf(ne)>=0))try{for(var se=(N=void 0,r.__values(q(B[ne],!1))),le=se.next();!le.done;le=se.next()){Q=le.value;X(B[ne][Q],F)}}catch(e){N={error:e}}finally{try{le&&!le.done&&(D=se.return)&&D.call(se)}finally{if(N)throw N.error}}}}catch(e){A={error:e}}finally{try{ie&&!ie.done&&(P=oe.return)&&P.call(oe)}finally{if(A)throw A.error}}return r.__spread(G,F,V).map((function(e){return U[e]})).map((function(t){return e[t]}))}},function(e,t,n){"use strict";n.r(t),n.d(t,"__extends",(function(){return __extends})),n.d(t,"__assign",(function(){return __assign})),n.d(t,"__rest",(function(){return __rest})),n.d(t,"__decorate",(function(){return __decorate})),n.d(t,"__param",(function(){return __param})),n.d(t,"__metadata",(function(){return __metadata})),n.d(t,"__awaiter",(function(){return __awaiter})),n.d(t,"__generator",(function(){return __generator})),n.d(t,"__createBinding",(function(){return __createBinding})),n.d(t,"__exportStar",(function(){return __exportStar})),n.d(t,"__values",(function(){return __values})),n.d(t,"__read",(function(){return __read})),n.d(t,"__spread",(function(){return __spread})),n.d(t,"__spreadArrays",(function(){return __spreadArrays})),n.d(t,"__await",(function(){return __await})),n.d(t,"__asyncGenerator",(function(){return __asyncGenerator})),n.d(t,"__asyncDelegator",(function(){return __asyncDelegator})),n.d(t,"__asyncValues",(function(){return __asyncValues})),n.d(t,"__makeTemplateObject",(function(){return __makeTemplateObject})),n.d(t,"__importStar",(function(){return __importStar})),n.d(t,"__importDefault",(function(){return __importDefault})),n.d(t,"__classPrivateFieldGet",(function(){return __classPrivateFieldGet})),n.d(t,"__classPrivateFieldSet",(function(){return __classPrivateFieldSet}));var extendStatics=function(e,t){return(extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)};function __extends(e,t){function __(){this.constructor=e}extendStatics(e,t),e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)}var __assign=function(){return(__assign=Object.assign||function __assign(e){for(var t,n=1,r=arguments.length;n=0;E--)(o=e[E])&&(f=(s<3?o(f):s>3?o(t,n,f):o(t,n))||f);return s>3&&f&&Object.defineProperty(t,n,f),f}function __param(e,t){return function(n,r){t(n,r,e)}}function __metadata(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}function __awaiter(e,t,n,r){return new(n||(n=Promise))((function(o,s){function fulfilled(e){try{step(r.next(e))}catch(e){s(e)}}function rejected(e){try{step(r.throw(e))}catch(e){s(e)}}function step(e){e.done?o(e.value):function adopt(e){return e instanceof n?e:new n((function(t){t(e)}))}(e.value).then(fulfilled,rejected)}step((r=r.apply(e,t||[])).next())}))}function __generator(e,t){var n,r,o,s,f={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return s={next:verb(0),throw:verb(1),return:verb(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function verb(s){return function(E){return function step(s){if(n)throw new TypeError("Generator is already executing.");for(;f;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return f.label++,{value:s[1],done:!1};case 5:f.label++,r=s[1],s=[0];continue;case 7:s=f.ops.pop(),f.trys.pop();continue;default:if(!(o=f.trys,(o=o.length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){f=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function __read(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,s=n.call(e),f=[];try{for(;(void 0===t||t-- >0)&&!(r=s.next()).done;)f.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=s.return)&&n.call(s)}finally{if(o)throw o.error}}return f}function __spread(){for(var e=[],t=0;t1||resume(e,t)}))})}function resume(e,t){try{!function step(e){e.value instanceof __await?Promise.resolve(e.value.v).then(fulfill,reject):settle(s[0][2],e)}(o[e](t))}catch(e){settle(s[0][3],e)}}function fulfill(e){resume("next",e)}function reject(e){resume("throw",e)}function settle(e,t){e(t),s.shift(),s.length&&resume(s[0][0],s[0][1])}}function __asyncDelegator(e){var t,n;return t={},verb("next"),verb("throw",(function(e){throw e})),verb("return"),t[Symbol.iterator]=function(){return this},t;function verb(r,o){t[r]=e[r]?function(t){return(n=!n)?{value:__await(e[r](t)),done:"return"===r}:o?o(t):t}:o}}function __asyncValues(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,n=e[Symbol.asyncIterator];return n?n.call(e):(e=__values(e),t={},verb("next"),verb("throw"),verb("return"),t[Symbol.asyncIterator]=function(){return this},t);function verb(n){t[n]=e[n]&&function(t){return new Promise((function(r,o){(function settle(e,t,n,r){Promise.resolve(r).then((function(t){e({value:t,done:n})}),t)})(r,o,(t=e[n](t)).done,t.value)}))}}}function __makeTemplateObject(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}function __importStar(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}function __importDefault(e){return e&&e.__esModule?e:{default:e}}function __classPrivateFieldGet(e,t){if(!t.has(e))throw new TypeError("attempted to get private field on non-instance");return t.get(e)}function __classPrivateFieldSet(e,t,n){if(!t.has(e))throw new TypeError("attempted to set private field on non-instance");return t.set(e,n),n}},function(e,t,n){"use strict";var r,o=(r=function extendStatics(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function __(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)}),__importDefault=function(e){return e&&e.__esModule?e:{default:e}};t.__esModule=!0;var s=function(e){function SynchronousMetaRegistry(){return null!==e&&e.apply(this,arguments)||this}return o(SynchronousMetaRegistry,e),SynchronousMetaRegistry.prototype.set=function(t,n){if("d8a5aa78-978e-11e6-ae22-56b6b6499611"!==n.SERIAL_VERSION_UID)throw new Error("You can only add registries to a meta registry");return e.prototype.set.call(this,t,n)},SynchronousMetaRegistry}(__importDefault(n(16)).default);t.default=s},function(e,t,n){},function(e,t,n){"use strict";n.r(t);var r={};n.r(r),n.d(r,"getPreferences",(function(){return getPreferences})),n.d(r,"setFavouriteCommands",(function(){return setFavouriteCommands})),n.d(r,"addRecentCommand",(function(){return addRecentCommand}));var o={};n.r(o),n.d(o,"getCommands",(function(){return getCommands}));var s={};n.r(s),n.d(s,"searchNeosDocs",(function(){return searchNeosDocs}));var f={};n.r(f),n.d(f,"searchNeosPackages",(function(){return searchNeosPackages}));var E={};n.r(E),n.d(E,"searchNodes",(function(){return searchNodes}));var C=n(0),I=n.n(C),R=n(13),S=n(1),O=n.n(S),T=n(17),A=n(2),P=n(18);function useFunctionRef(e){const t=Object(C.useRef)(e);return t.current=e,t}function i(){throw new Error("Cycle detected")}function signals_core_module_t(){if(M>1)M--;else{for(var e,t=!1;void 0!==D;){var n=D;for(D=void 0,U++;void 0!==n;){var r=n.o;if(n.o=void 0,n.f&=-3,!(8&n.f)&&d(n))try{n.c()}catch(n){t||(e=n,t=!0)}n=r}}if(U=0,M--,t)throw e}}function h(e){if(M>0)return e();M++;try{return e()}finally{signals_core_module_t()}}var N=void 0,D=void 0,M=0,U=0,L=0;function v(e){if(void 0!==N){var t=e.n;if(void 0===t||t.t!==N)return t={i:0,S:e,p:N.s,n:void 0,t:N,e:void 0,x:void 0,r:t},void 0!==N.s&&(N.s.n=t),N.s=t,e.n=t,32&N.f&&e.S(t),t;if(-1===t.i)return t.i=0,void 0!==t.n&&(t.n.p=t.p,void 0!==t.p&&(t.p.n=t.n),t.p=N.s,t.n=void 0,N.s.n=t,N.s=t),t}}function signals_core_module_e(e){this.v=e,this.i=0,this.n=void 0,this.t=void 0}function u(e){return new signals_core_module_e(e)}function d(e){for(var t=e.s;void 0!==t;t=t.n)if(t.S.i!==t.i||!t.S.h()||t.S.i!==t.i)return!0;return!1}function c(e){for(var t=e.s;void 0!==t;t=t.n){var n=t.S.n;if(void 0!==n&&(t.r=n),t.S.n=t,t.i=-1,void 0===t.n){e.s=t;break}}}function a(e){for(var t=e.s,n=void 0;void 0!==t;){var r=t.p;-1===t.i?(t.S.U(t),void 0!==r&&(r.n=t.n),void 0!==t.n&&(t.n.p=r)):n=t,t.S.n=t.r,void 0!==t.r&&(t.r=void 0),t=r}e.s=n}function l(e){signals_core_module_e.call(this,void 0),this.x=e,this.s=void 0,this.g=L-1,this.f=4}function w(e){return new l(e)}function y(e){var t=e.u;if(e.u=void 0,"function"==typeof t){M++;var n=N;N=void 0;try{t()}catch(t){throw e.f&=-2,e.f|=8,_(e),t}finally{N=n,signals_core_module_t()}}}function _(e){for(var t=e.s;void 0!==t;t=t.n)t.S.U(t);e.x=void 0,e.s=void 0,y(e)}function g(e){if(N!==this)throw new Error("Out-of-order effect");a(this),N=e,this.f&=-2,8&this.f&&_(this),signals_core_module_t()}function b(e){this.x=e,this.u=void 0,this.s=void 0,this.o=void 0,this.f=32}function p(e){var t=new b(e);try{t.c()}catch(e){throw t.d(),e}return t.d.bind(t)}signals_core_module_e.prototype.h=function(){return!0},signals_core_module_e.prototype.S=function(e){this.t!==e&&void 0===e.e&&(e.x=this.t,void 0!==this.t&&(this.t.e=e),this.t=e)},signals_core_module_e.prototype.U=function(e){if(void 0!==this.t){var t=e.e,n=e.x;void 0!==t&&(t.x=n,e.e=void 0),void 0!==n&&(n.e=t,e.x=void 0),e===this.t&&(this.t=n)}},signals_core_module_e.prototype.subscribe=function(e){var t=this;return p((function(){var n=t.value,r=32&this.f;this.f&=-33;try{e(n)}finally{this.f|=r}}))},signals_core_module_e.prototype.valueOf=function(){return this.value},signals_core_module_e.prototype.toString=function(){return this.value+""},signals_core_module_e.prototype.peek=function(){return this.v},Object.defineProperty(signals_core_module_e.prototype,"value",{get:function(){var e=v(this);return void 0!==e&&(e.i=this.i),this.v},set:function(e){if(e!==this.v){U>100&&i(),this.v=e,this.i++,L++,M++;try{for(var t=this.t;void 0!==t;t=t.x)t.t.N()}finally{signals_core_module_t()}}}}),(l.prototype=new signals_core_module_e).h=function(){if(this.f&=-3,1&this.f)return!1;if(32==(36&this.f))return!0;if(this.f&=-5,this.g===L)return!0;if(this.g=L,this.f|=1,this.i>0&&!d(this))return this.f&=-2,!0;var e=N;try{c(this),N=this;var t=this.x();(16&this.f||this.v!==t||0===this.i)&&(this.v=t,this.f&=-17,this.i++)}catch(e){this.v=e,this.f|=16,this.i++}return N=e,a(this),this.f&=-2,!0},l.prototype.S=function(e){if(void 0===this.t){this.f|=36;for(var t=this.s;void 0!==t;t=t.n)t.S.S(t)}signals_core_module_e.prototype.S.call(this,e)},l.prototype.U=function(e){if(void 0!==this.t&&(signals_core_module_e.prototype.U.call(this,e),void 0===this.t)){this.f&=-33;for(var t=this.s;void 0!==t;t=t.n)t.S.U(t)}},l.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(var e=this.t;void 0!==e;e=e.x)e.t.N()}},l.prototype.peek=function(){if(this.h()||i(),16&this.f)throw this.v;return this.v},Object.defineProperty(l.prototype,"value",{get:function(){1&this.f&&i();var e=v(this);if(this.h(),void 0!==e&&(e.i=this.i),16&this.f)throw this.v;return this.v}}),b.prototype.c=function(){var e=this.S();try{8&this.f||void 0===this.x||(this.u=this.x())}finally{e()}},b.prototype.S=function(){1&this.f&&i(),this.f|=1,this.f&=-9,y(this),c(this),M++;var e=N;return N=this,g.bind(this,e)},b.prototype.N=function(){2&this.f||(this.f|=2,this.o=D,D=this)},b.prototype.d=function(){this.f|=8,1&this.f||_(this)};var H,x=I.a.createElement;I.a.createElement=function(e,t){if("string"==typeof e&&t)for(var n in t){var r=t[n];"children"!==n&&r instanceof signals_core_module_e&&(t[n]=r.value)}return x.apply(this,arguments)};var k=new WeakMap;function signals_module_p(e){H&&H(),H=e&&e.S()}var B=x("a").$$typeof;Object.defineProperties(signals_core_module_e.prototype,{$$typeof:{configurable:!0,value:B},type:{configurable:!0,value:function(e){return e.data.value}},props:{configurable:!0,get:function(){return{data:this}}},ref:{configurable:!0,value:null}});var G,F=!1,m=function(){return{}};Object.defineProperty(C.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentDispatcher,"current",{get:function(){return G},set:function(e){if(G=e,!F)if(e&&!function(e){var t=V.get(e);if(void 0!==t)return t;var n=e.useCallback.length<2||/Invalid/.test(e.useCallback);return V.set(e,n),n}(e)){F=!0;var t=e.useReducer(m,{})[1];F=!1;var n=k.get(t);n?n.c=t:(n=function(e){var t;return p((function(){t=this})),t.c=e,t}(t),k.set(t,n)),signals_module_p(n)}else signals_module_p()}});var V=new Map;function signals_module_h(e){return Object(C.useMemo)((function(){return u(e)}),[])}function signals_module_y(e){var t=Object(C.useRef)(e);return t.current=e,Object(C.useMemo)((function(){return w((function(){return t.current()}))}),[])}function j(e){var t=Object(C.useRef)(e);t.current=e,Object(C.useEffect)((function(){return p((function(){return t.current()}))}),[])}function flattenCommands(e,t=null){return Object.keys(e).reduce((n,r)=>{const{icon:o,description:s,name:f,subCommands:E,action:C,canHandleQueries:I,closeOnExecute:R,category:S,executeManually:O}=e[r],T=t?`${t}.${r}`:r,A=E?Object.keys(E).map(e=>`${T}.${e}`):[];return n[T]={id:T,name:f,icon:o,description:s,action:C,canHandleQueries:I,subCommandIds:A,parentId:t,closeOnExecute:R,category:S,executeManually:O},A.length>0?{...n,...flattenCommands(E,T)}:n},{})}const W="%c[COMMANDBAR]";var q={ok:(e,...t)=>console.log(W,"color: green",e,...t),error:(e,...t)=>console.log(W,"color: red",e,...t),warn:(e,...t)=>console.warn(W,"color: orange",e,...t),debug:()=>null};function clamp(e,t,n){return Math.max(t,Math.min(n,e))}const X=new Intl.Collator("en").compare,z=/(?:\s+|^)-[a-z\d]+/gi,Y={interSplit:"[^A-Za-z0-9']+",intraSplit:"[a-z][A-Z]",intraBound:"[A-Za-z][0-9]|[0-9][A-Za-z]|[a-z][A-Z]",interLft:0,interRgt:0,interChars:".",interIns:1/0,intraChars:"[a-z\\d']",intraIns:0,intraContr:"'[a-z]{1,2}\\b",intraMode:0,intraSlice:[1,1/0],intraSub:0,intraTrn:0,intraDel:0,intraFilt:(e,t,n)=>!0,sort:(e,t,n)=>{let{idx:r,chars:o,terms:s,interLft2:f,interLft1:E,start:C,intraIns:I,interIns:R}=e;return r.map((e,t)=>t).sort((e,n)=>o[n]-o[e]||I[e]-I[n]||s[n]+f[n]+.5*E[n]-(s[e]+f[e]+.5*E[e])||R[e]-R[n]||C[e]-C[n]||X(t[r[e]],t[r[n]]))}},lazyRepeat=(e,t)=>0==t?"":1==t?e+"??":t==1/0?e+"*?":e+`{0,${t}}?`;function uFuzzy(e){e=Object.assign({},Y,e);const{interLft:t,interRgt:n,intraMode:r,intraSlice:o,intraIns:s,intraSub:f,intraTrn:E,intraDel:C,intraContr:I,intraSplit:R,interSplit:S,intraBound:O,intraChars:T}=e;let{intraRules:A}=e;null==A&&(A=e=>{let t=Y.intraSlice,n=0,r=0,I=0,R=0,S=e.length;return S<=4?S>=3&&(I=Math.min(E,1),4==S&&(n=Math.min(s,1))):(t=o,n=s,r=f,I=E,R=C),{intraSlice:t,intraIns:n,intraSub:r,intraTrn:I,intraDel:R}});let P=!!R,N=new RegExp(R,"g"),D=new RegExp(S,"g"),M=new RegExp("^"+S+"|"+S+"$","g"),U=new RegExp(I,"gi");const split=e=>(e=e.replace(M,"").toLowerCase(),P&&(e=e.replace(N,e=>e[0]+" "+e[1])),e.split(D).filter(e=>""!=e)),prepQuery=(o,f=0,E=!1)=>{let C=split(o);if(0==C.length)throw"Empty needle!";let I,R=Array(C.length).fill("");if(C=C.map((e,t)=>e.replace(U,e=>(R[t]=e,""))),1==r)I=C.map((e,t)=>{let{intraSlice:n,intraIns:r,intraSub:o,intraTrn:s,intraDel:f}=A(e);if(r+o+s+f==0)return e+R[t];let[E,C]=n,I=e.slice(0,E),S=e.slice(C),O=e.slice(E,C);1==r&&1==I.length&&I!=O[0]&&(I+="(?!"+I+")");let P=O.length,N=[];if(o)for(let e=0;e0&&(e=")("+e+")("),I=C.map((t,n)=>t.split("").map((e,t,n)=>(1==s&&0==t&&n.length>1&&e[t]!=e[t+1]&&(e+="(?!"+e+")"),e)).join(e)+R[n])}let S=2==t?"(?:\\b|_)":"",O=2==n?"(?:\\b|_)":"",P=O+lazyRepeat(e.interChars,e.interIns)+S;return f>0?E?I=S+"("+I.join(")"+O+"|"+S+"(")+")"+O:(I="("+I.join(")("+P+")(")+")",I="(.?"+S+")"+I+"("+O+".*)"):(I=I.join(P),I=S+I+O),[new RegExp(I,"i"),C,R]},filter=(e,t,n)=>{let r=[],[o]=prepQuery(t);if(null!=n)for(let t=0;t{let[f,E,C]=prepQuery(s,1),[I]=prepQuery(s,2),R=E.length,S=r.length,O=Array(S).fill(0),T={idx:Array(S),start:O.slice(),chars:O.slice(),terms:O.slice(),interIns:O.slice(),intraIns:O.slice(),interLft2:O.slice(),interRgt2:O.slice(),interLft1:O.slice(),interRgt1:O.slice(),ranges:Array(S)},A=1==t||1==n,P=0;for(let s=0;s=I){let e=O[o+1].toLowerCase().indexOf(f);e>-1&&(X.push(D,e,I),D+=refineMatch(O,o,e,I),s=f,T=I,P=!0,0==r&&(N=D))}if(A||P){let e=D-1,r=D+T,E=!0,C=!0;if(-1==e||H.test(S[e]))P&&U++;else{if(2==t){M=!0;break}if(L&&x.test(S[e]+S[e+1]))P&&k++;else{if(1==t){let e=O[o+1],t=D+T;if(e.length>=I){let n,r=0,E=!1,C=new RegExp(f,"ig");for(;n=C.exec(e);){r=n.index;let e=t+r,o=e-1;if(-1==o||H.test(S[o])){U++,E=!0;break}if(x.test(S[o]+S[e])){k++,E=!0;break}}if(E){X.push(D,r,I),D+=refineMatch(O,o,r,I),s=f,T=I,P=!0;break}}M=!0;break}E=!1}}if(r==S.length||H.test(S[r]))P&&B++;else{if(2==n){M=!0;break}if(L&&x.test(S[r-1]+S[r]))P&&G++;else{if(1==n){M=!0;break}C=!1}}P&&(F+=I,E&&C&&V++)}if(T>I&&(q+=T-I),r>0&&(W+=O[o-1].length),!e.intraFilt(f,s,D)){M=!0;break}r0?0:1/0,R=E-3;for(let r=2;r0&&(t.push(o,f),o=f=n)}f>o&&t.push(o,f),P++}}if(P{let o=e[t]+e[t+1].slice(0,n);return e[t-1]+=o,e[t]=e[t+1].slice(n,n+r),e[t+1]=e[t+1].slice(n+r),o.length};return{search:(...t)=>((t,n,r=!1,o=1e3,s)=>{let f,E=null,C=null,I=[];if(n=n.replace(z,e=>(I.push(e.trim().slice(1)),"")),I.length>0&&(f=new RegExp(I.join("|"),"i"),""==n.trim())){let e=[];for(let n=0;n1){let n=e.slice().sort((e,t)=>t.length-e.length);for(let e=0;ee.join(" ")),C=[];let r=new Set;for(let e=0;e!r.has(e)),o=filter(t,E[e],n);for(let e=0;e0?s:filter(t,n)]);let R=null,S=null;if(I.length>0&&(C=C.map(e=>e.filter(e=>!f.test(t[e])))),C.reduce((e,t)=>e+t.length,0)<=o){R={},S=[];for(let n=0;n0)for(let e=0;e{let e={A:"ÁÀÃÂÄĄ",a:"áàãâäą",E:"ÉÈÊËĖ",e:"éèêëę",I:"ÍÌÎÏĮ",i:"íìîïį",O:"ÓÒÔÕÖ",o:"óòôõö",U:"ÚÙÛÜŪŲ",u:"úùûüūų",C:"ÇČ",c:"çč",N:"Ñ",n:"ñ",S:"Š",s:"š"},t=new Map,n="";for(let r in e)e[r].split("").forEach(e=>{n+=e,t.set(e,r)});let r=new RegExp(`[${n}]`,"g"),replacer=e=>t.get(e);return e=>{if("string"==typeof e)return e.replace(r,replacer);let t=Array(e.length);for(let n=0;nt?`${e}`:e,_append=(e,t)=>e+t;uFuzzy.latinize=Q,uFuzzy.permute=e=>permute([...Array(e.length).keys()]).sort((e,t)=>{for(let n=0;nt.map(t=>e[t])),uFuzzy.highlight=function highlight(e,t,n=_mark,r="",o=_append){let s=o(r,n(e.substring(0,t[0]),!1));r=null!==s?s:r;for(let f=0;ft.parentId===e||!e&&o.includes(t.id)),!t)return s.sort((t,n)=>function sortCommands(e,t,n,r){const o=r.includes(e.id),s=r.includes(t.id);if(o&&!s)return-1;if(!o&&s)return 1;if(o&&s)return r.indexOf(e.id)-r.indexOf(t.id);const f=n.includes(e.id),E=n.includes(t.id);return f&&!E?-1:!f&&E?1:e.name.localeCompare(t.name)}(t,n,r,e?[]:o)).map(e=>e.id);const f=s.map(({name:e,description:t})=>e+" "+t),[E,,C]=$.search(f,t.toLowerCase());return C.map(e=>s[E[e]].id)}(t.selectedCommandGroup,t.searchWord,t.commands,t.favouriteCommands,t.recentCommands);break;case J.HIGHLIGHT_NEXT_COMMAND:t.highlightedItem=clamp(t.highlightedItem+1,0,t.availableCommandIds.length-1);break;case J.HIGHLIGHT_PREVIOUS_COMMAND:t.highlightedItem=clamp(t.highlightedItem-1,0,t.availableCommandIds.length-1);break;case J.HIGHLIGHT_NEXT_OPTION:t.highlightedOption=clamp(t.highlightedOption+1,0,Object.keys(t.result.options).length-1);break;case J.HIGHLIGHT_PREVIOUS_OPTION:t.highlightedOption=clamp(t.highlightedOption-1,0,Object.keys(t.result.options).length-1);break;case J.SET_SEARCH_WORD:assert(n.type===Z.UPDATE_SEARCH),t.searchWord=n.searchWord;break;case J.SET_COMMAND_QUERY:assert(n.type===Z.UPDATE_COMMAND_QUERY),t.commandQuery=n.commandQuery;break;case J.EXPAND:t.expanded=!0;break;case J.SET_ACTIVE_COMMAND:assert(n.type===Z.EXECUTE_COMMAND),t.activeCommandId=n.commandId,t.activeCommandMessage=n.message;break;case J.UNSET_ACTIVE_COMMAND:t.activeCommandId=null,t.activeCommandMessage=null;break;case J.UPDATE_RESULT:assert(n.type===Z.UPDATE_RESULT),assert("boolean"==typeof n.result.success),t.result={options:{},message:"Command executed",view:null,success:!1,...n.result},t.resultCommandId=t.activeCommandId;break;case J.RESET_OPTION_HIGHLIGHT:t.highlightedOption=0;break;case J.RESET_SEARCH_OR_LEAVE_GROUP:t.commandQuery?t.commandQuery="":t.searchWord?t.searchWord="":t.selectedCommandGroup=t.selectedCommandGroup?t.commands[t.selectedCommandGroup].parentId:null;break;case J.UNSET_RESULT:t.result=null,t.resultCommandId=null,t.commandQuery="";break;case J.LEAVE_GROUP:t.selectedCommandGroup=t.selectedCommandGroup?t.commands[t.selectedCommandGroup].parentId:null;break;case J.SET_GROUP:assert(n.type===Z.SELECT_GROUP),t.selectedCommandGroup=n.commandId;break;case J.ADD_FAVOURITE:assert(n.type===Z.ADD_FAVOURITE),t.favouriteCommands.includes(n.commandId)||t.favouriteCommands.push(n.commandId);break;case J.REMOVE_FAVOURITE:assert(n.type===Z.REMOVE_FAVOURITE),t.favouriteCommands=t.favouriteCommands.filter(e=>e!==n.commandId);break;case J.ADD_RECENTLY_USED:if(assert(n.type===Z.EXECUTE_COMMAND),!t.commands[n.commandId].action)break;t.recentCommands.includes(n.commandId)&&(t.recentCommands=t.recentCommands.filter(e=>e!==n.commandId)),t.recentCommands.unshift(n.commandId),t.recentCommands.length>5&&t.recentCommands.pop();break;default:throw Error(`Action ${e} not implemented`)}}const commandBarReducer=(e,t)=>function transition(e,t,n){var r,o,s;let f=null!==(o=null===(r=ee.states[e.status].on)||void 0===r?void 0:r[t.type])&&void 0!==o?o:null;f||(q.error(`No transition found for event "${t.type}" in state "${e.status}"`),f={target:e.status});const E={...e,status:"string"==typeof f?f:f.target};return n&&"object"==typeof f&&(null===(s=f.actions)||void 0===s||s.forEach(e=>n(e,E,t))),q.debug(`Transitioned from "${e.status}" to "${E.status}" with event "${t.type}"`),E}(e,t,runAction);var te=n(19);var ne=I.a.memo(({children:e})=>I.a.createElement("span",{className:te.iconWrap},e)),re=n(20);var ae=I.a.memo(()=>{const{state:{showBranding:e}}=useCommandBarState(),{translate:t}=useIntl();return e?I.a.createElement("a",{href:"https://helzle.it/projects",title:t("CommandBarFooter.branding","Made with love by Sebastian Helzle"),target:"_blank",rel:"noreferrer noopener",className:re.madeWithLove},I.a.createElement("small",null,t("CommandBarFooter.brandingSmall","Made with love by")),I.a.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 180 180"},I.a.createElement("defs",null,I.a.createElement("linearGradient",{id:"a",gradientUnits:"userSpaceOnUse",x1:"280.25",y1:"377.003",x2:"373.261",y2:"377.003"},I.a.createElement("stop",{offset:"0",stopColor:"#297AAC"}),I.a.createElement("stop",{offset:"1",stopColor:"#53AADA"}))),I.a.createElement("path",{d:"M0 180.017h37.287L71.35 52.898H34.061zM48.717 0l-9.083 33.898h36.675L85.392 0z",fill:"#B9B7B3"}),I.a.createElement("path",{d:"M335.972 313.444H288.25l-8 28.306h47.691l-28.03 98.813h39.287l34.063-127.119z",fill:"url(#a)",transform:"translate(-195.462 -260.325)"}))):null});function IconBack(){return I.a.createElement("svg",{viewBox:"0 0 448 512"},I.a.createElement("path",{fill:"currentColor",d:"m257.5 445.1-22.2 22.2c-9.4 9.4-24.6 9.4-33.9 0L7 273c-9.4-9.4-9.4-24.6 0-33.9L201.4 44.7c9.4-9.4 24.6-9.4 33.9 0l22.2 22.2c9.5 9.5 9.3 25-.4 34.3L136.6 216H424c13.3 0 24 10.7 24 24v32c0 13.3-10.7 24-24 24H136.6l120.5 114.8c9.8 9.3 10 24.8.4 34.3z"}))}function IconNeos(){return I.a.createElement("svg",{viewBox:"0 0 512 512"},I.a.createElement("path",{fill:"currentColor",d:"M415.44 512h-95.11L212.12 357.46v91.1L125.69 512H28V29.82L68.47 0h108.05l123.74 176.13V63.45L386.69 0h97.69v461.5zM38.77 35.27V496l72-52.88V194l215.5 307.64h84.79l52.35-38.17h-78.27L69 13zm82.54 466.61 80-58.78v-101l-79.76-114.4v220.94L49 501.89h72.34zM80.63 10.77l310.6 442.57h82.37V10.77h-79.75v317.56L170.91 10.77zM311 191.65l72 102.81V15.93l-72 53v122.72z"}))}function IconSpinner(){return I.a.createElement("svg",{viewBox:"0 0 512 512"},I.a.createElement("path",{fill:"currentColor",d:"M288 39.056v16.659c0 10.804 7.281 20.159 17.686 23.066C383.204 100.434 440 171.518 440 256c0 101.689-82.295 184-184 184-101.689 0-184-82.295-184-184 0-84.47 56.786-155.564 134.312-177.219C216.719 75.874 224 66.517 224 55.712V39.064c0-15.709-14.834-27.153-30.046-23.234C86.603 43.482 7.394 141.206 8.003 257.332c.72 137.052 111.477 246.956 248.531 246.667C393.255 503.711 504 392.788 504 256c0-115.633-79.14-212.779-186.211-240.236C302.678 11.889 288 23.456 288 39.056z"}))}function IconStar(){return I.a.createElement("svg",{viewBox:"0 0 576 512"},I.a.createElement("path",{fill:"currentColor",d:"M528.1 171.5 382 150.2 316.7 17.8c-11.7-23.6-45.6-23.9-57.4 0L194 150.2 47.9 171.5c-26.2 3.8-36.7 36.1-17.7 54.6l105.7 103-25 145.5c-4.5 26.3 23.2 46 46.4 33.7L288 439.6l130.7 68.7c23.2 12.2 50.9-7.4 46.4-33.7l-25-145.5 105.7-103c19-18.5 8.5-50.8-17.7-54.6zM388.6 312.3l23.7 138.4L288 385.4l-124.3 65.3 23.7-138.4-100.6-98 139-20.2 62.2-126 62.2 126 139 20.2-100.6 98z"}))}function IconPlay(){return I.a.createElement("svg",{viewBox:"0 0 512 512"},I.a.createElement("path",{fill:"currentColor",d:"M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm115.7 272l-176 101c-15.8 8.8-35.7-2.5-35.7-21V152c0-18.4 19.8-29.8 35.7-21l176 107c16.4 9.2 16.4 32.9 0 42z"}))}var oe=n(7);var ie=I.a.memo(()=>{const{state:{activeCommandId:e,activeCommandMessage:t,commands:n,result:r,selectedCommandGroup:o,expanded:s},Icon:f}=useCommandBarState(),E=signals_module_y(()=>{var t;return e.value&&e.value?null!==(t=n.value[e.value])&&void 0!==t?t:r.value.options[e.value]:null});return s.value?I.a.createElement("footer",{className:oe.commandBarFooter},e.value?I.a.createElement("span",{className:oe.activity},I.a.createElement(ne,null,I.a.createElement(IconSpinner,null)),I.a.createElement("em",null,E.value.name," ‒ ",t)):o.value?I.a.createElement("span",{className:oe.breadcrumb},I.a.createElement(f,{icon:n.value[o.value].icon}),I.a.createElement("small",null,n.value[o.value].name)):I.a.createElement(ne,null,I.a.createElement(IconNeos,null)),I.a.createElement(ae,null)):null}),se=n(8);let le=null;var ce=I.a.memo(()=>{var e;const{state:t,actions:n}=useCommandBarState(),{executeCommand:r}=useCommandExecutor(),{translate:o}=useIntl(),s=Object(C.useRef)(),f=Object(C.useCallback)(e=>{t.status.value===K.DISPLAYING_RESULT?(n.UPDATE_COMMAND_QUERY(e.target.value),t.commands.value[t.resultCommandId.value].executeManually||(le&&clearTimeout(le),le=setTimeout(()=>r(t.resultCommandId.value),500))):n.UPDATE_SEARCH(e.target.value)},[]),E=Object(C.useCallback)(e=>{"Escape"===e.key&&s.current.value&&(e.preventDefault(),e.stopPropagation())},[s.current]);return j(()=>{var e;t.status.value!==K.EXECUTING_COMMAND&&(null===(e=s.current)||void 0===e||e.focus())}),I.a.createElement(I.a.Fragment,null,I.a.createElement("input",{ref:s,className:se.searchBox,type:"search",placeholder:t.status.value===K.DISPLAYING_RESULT?o("SearchBox.commandQuery.placeholder","Enter the query for the command"):o("SearchBox.placeholder","What do you want to do today?"),autoFocus:!0,onChange:f,onKeyUp:E,value:t.status.value===K.DISPLAYING_RESULT?t.commandQuery:t.searchWord,"data-testid":"SearchBox"}),!t.expanded.value&&I.a.createElement("button",{className:se.expandButton,onClick:n.EXPAND,title:o("SearchBox.expand.title","Expand to show all commands")},I.a.createElement(ne,null,I.a.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 320 512"},I.a.createElement("path",{fill:"currentColor",d:"M31.3 192h257.3c17.8 0 26.7 21.5 14.1 34.1L174.1 354.8c-7.8 7.8-20.5 7.8-28.3 0L17.2 226.1C4.6 213.5 13.5 192 31.3 192z"})))),t.status.value===K.DISPLAYING_RESULT&&(null===(e=t.commands.value[t.resultCommandId.value])||void 0===e?void 0:e.executeManually)&&I.a.createElement("button",{className:se.executeButton,onClick:()=>r(t.resultCommandId.value),title:o("SearchBox.execute.title","Execute the command")},I.a.createElement(ne,null,I.a.createElement(IconPlay,null))))}),ue=n(14);var de=I.a.memo(()=>{const{state:e,actions:t}=useCommandBarState(),n=signals_module_y(()=>e.status.value==K.DISPLAYING_RESULT);return I.a.createElement("header",{className:ue.commandBarHeader},(n.value||e.selectedCommandGroup.value)&&I.a.createElement("button",{type:"button",onClick:n.value?t.CANCEL:t.GO_TO_PARENT_GROUP,className:ue.backButton,title:"Back"},I.a.createElement(ne,null,I.a.createElement(IconBack,null))),I.a.createElement(ce,null))}),me=n(4);var _e=I.a.memo((function CommandListItem({command:e,onItemSelect:t,highlightedId:n,onToggleFavourite:r}){const{state:{favouriteCommands:o},Icon:s}=useCommandBarState(),{translate:f}=useIntl(),{id:E,name:C,description:R,icon:S,action:O}=e,T=function getCommandType({subCommandIds:e,category:t,canHandleQueries:n,action:r},o){let s="command";return t||((null==e?void 0:e.length)>0?s="category":n?s="query":"string"==typeof r&&(s="link"),o("CommandListItem.type."+s,s))}(e,f),A=signals_module_y(()=>n.value===E),P=signals_module_y(()=>o.value.includes(E));return I.a.createElement("li",{className:classnames(me.commandListItem,A.value&&me.highlighted),onClick:()=>t(E),"data-testid":"CommandListItem"},I.a.createElement(s,{icon:S}),I.a.createElement("span",{className:me.label},I.a.createElement("span",null,C),R&&I.a.createElement("span",{className:me.description},"string"==typeof R?R:R())),r&&O&&I.a.createElement("button",{type:"button",className:classnames(me.favouriteButton,P.value&&me.isFavourite),title:f("CommandListItem.toggleFavourite","Toggle favourite"),onClick:e=>{e.stopPropagation(),r(E)}},I.a.createElement(ne,null,I.a.createElement(IconStar,null))),I.a.createElement("small",{className:me.type},T))})),fe=n(9);var he=I.a.memo(()=>{const{state:{commands:e,highlightedItem:t,availableCommandIds:n,status:r,searchWord:o,favouriteCommands:s,recentCommands:f,selectedCommandGroup:E},actions:{ADD_FAVOURITE:R,REMOVE_FAVOURITE:S}}=useCommandBarState(),{translate:O}=useIntl(),{executeCommand:T}=useCommandExecutor(),A=I.a.useRef(null);j(()=>{var e,n;null===(n=null===(e=A.current)||void 0===e?void 0:e.querySelector(`li:nth-child(${t.value})`))||void 0===n||n.scrollIntoView({behavior:"smooth",block:"center"})});const P=Object(C.useCallback)(e=>{s.value.includes(e)?S(e):R(e)},[s]),N=signals_module_y(()=>o.value||E.value?[]:n.value.filter(e=>f.value.includes(e))),D=signals_module_y(()=>o.value||E.value?n.value:n.value.filter(e=>!f.value.includes(e))),M=signals_module_y(()=>n.value[t.value]);return I.a.createElement("nav",{className:classnames(fe.results,r.value!==K.IDLE&&fe.disabled),"data-testid":"CommandList",ref:A},N.value.length>0&&I.a.createElement(I.a.Fragment,null,I.a.createElement("h6",null,O("CommandList.suggestions","Recently used")),I.a.createElement("ul",null,N.value.map(t=>I.a.createElement(_e,{key:t,command:e.value[t],onItemSelect:T,highlightedId:M,onToggleFavourite:P})))),D.value.length>0&&I.a.createElement(I.a.Fragment,null,I.a.createElement("h6",null,O("CommandList.heading","Commands")),I.a.createElement("ul",null,D.value.map(t=>I.a.createElement(_e,{key:t,command:e.value[t],onItemSelect:T,highlightedId:M,onToggleFavourite:P})))),0===n.value.length&&I.a.createElement("small",{className:fe.noResults},O("CommandList.noCommandsMessage","No matching commands found")))}),pe=n(10);var CommandResultsView_CommandResultsView=()=>{var e;const{state:{result:t,highlightedOption:n}}=useCommandBarState(),{executeCommand:r}=useCommandExecutor(),o=I.a.useRef(null),s=signals_module_y(()=>t.value?Object.values(t.value.options)[n.value].id:null);j(()=>{var e,t;const r=n.value;null===(t=null===(e=o.current)||void 0===e?void 0:e.querySelector(`li:nth-child(${r})`))||void 0===t||t.scrollIntoView({behavior:"smooth",block:"center"})});const{options:f,view:E,message:C}=null!==(e=t.value)&&void 0!==e?e:{};return I.a.createElement("div",{className:pe.commandResultsView},C&&I.a.createElement("h6",{className:pe.message},C),E?I.a.createElement("div",null,E):"",f&&I.a.createElement("nav",{className:pe.results,ref:o},I.a.createElement("ul",null,Object.keys(f).map(e=>I.a.createElement(_e,{key:e,command:f[e],onItemSelect:r,highlightedId:s})))))},ge=n(15);var ve=I.a.memo(({handleToggle:e,disabled:t=!1,label:n,title:r})=>I.a.createElement("button",{className:ge.toggleButton,onClick:e,disabled:t,title:r},I.a.createElement("span",null,n),I.a.createElement("span",{className:ge.buttonIcon},"⌘K")));const Ee=Object(C.createContext)({}),useCommandBarState=()=>Object(C.useContext)(Ee);const CommandBarStateProvider=({commands:e,children:t,IconComponent:n,userPreferences:r})=>{const{state:o,dispatch:s}=Object(C.useMemo)(()=>function createAppState(e){const t=u(e);return{state:{activeCommandId:w(()=>t.value.activeCommandId),activeCommandMessage:w(()=>t.value.activeCommandMessage),availableCommandIds:w(()=>t.value.availableCommandIds),commandQuery:w(()=>t.value.commandQuery),commands:w(()=>t.value.commands),expanded:w(()=>t.value.expanded),favouriteCommands:w(()=>t.value.favouriteCommands),highlightedItem:w(()=>t.value.highlightedItem),highlightedOption:w(()=>t.value.highlightedOption),recentCommands:w(()=>t.value.recentCommands),result:w(()=>t.value.result),resultCommandId:w(()=>t.value.resultCommandId),searchWord:w(()=>t.value.searchWord),selectedCommandGroup:w(()=>t.value.selectedCommandGroup),showBranding:w(()=>t.value.showBranding),status:w(()=>t.value.status)},dispatch:e=>{t.value=commandBarReducer(t.value,e)}}}({activeCommandId:null,activeCommandMessage:null,availableCommandIds:Object.keys(e),commandQuery:"",commands:flattenCommands(e),expanded:!1,favouriteCommands:r.favouriteCommands,highlightedItem:0,highlightedOption:0,recentCommands:r.recentCommands,result:null,resultCommandId:null,searchWord:"",selectedCommandGroup:null,showBranding:r.showBranding,status:K.COLLAPSED}),[]),f=Object(C.useMemo)(()=>({[Z.RESET_SEARCH]:()=>s({type:Z.RESET_SEARCH}),[Z.HIGHLIGHT_NEXT_ITEM]:()=>s({type:Z.HIGHLIGHT_NEXT_ITEM}),[Z.HIGHLIGHT_PREVIOUS_ITEM]:()=>s({type:Z.HIGHLIGHT_PREVIOUS_ITEM}),[Z.CANCEL]:()=>s({type:Z.CANCEL}),[Z.SELECT_GROUP]:e=>s({type:Z.SELECT_GROUP,commandId:e}),[Z.GO_TO_PARENT_GROUP]:()=>s({type:Z.GO_TO_PARENT_GROUP}),[Z.UPDATE_SEARCH]:e=>s({type:Z.UPDATE_SEARCH,searchWord:e}),[Z.UPDATE_COMMAND_QUERY]:e=>s({type:Z.UPDATE_COMMAND_QUERY,commandQuery:e}),[Z.EXECUTE_COMMAND]:async(e,t)=>(s({type:Z.EXECUTE_COMMAND,commandId:e,message:t}),r.addRecentCommand(e).catch(e=>q.error("Could not add recent command",e))),[Z.FINISH_COMMAND]:()=>s({type:Z.FINISH_COMMAND}),[Z.UPDATE_RESULT]:e=>s({type:Z.UPDATE_RESULT,result:e}),[Z.EXPAND]:()=>s({type:Z.EXPAND}),[Z.ADD_FAVOURITE]:e=>{s({type:Z.ADD_FAVOURITE,commandId:e}),r.setFavouriteCommands(o.favouriteCommands.value).catch(e=>q.error("Could not update favourite commands",e))},[Z.REMOVE_FAVOURITE]:e=>{s({type:Z.REMOVE_FAVOURITE,commandId:e}),r.setFavouriteCommands(o.favouriteCommands.value).catch(e=>q.error("Could not update favourite commands",e))}}),[]),E=Object(C.useCallback)(({icon:e,spin:t=!1})=>I.a.createElement(ne,null,I.a.createElement(n,{icon:e,spin:t})),[]);return I.a.createElement(Ee.Provider,{value:{state:o,actions:f,Icon:E}},t)},ye=I.a.createContext({}),useCommandExecutor=()=>I.a.useContext(ye),CommandBarExecutor=({children:e,toggleOpen:t,dialogRef:n,open:r})=>{const{state:o,actions:s}=useCommandBarState(),f=useFunctionRef(e=>{if(r&&!e.defaultPrevented)if("k"===e.key&&e.metaKey&&(null==n?void 0:n.current.contains(e.target)))t(),e.stopPropagation(),e.preventDefault();else if("Escape"===e.key)e.stopPropagation(),e.preventDefault(),o.selectedCommandGroup.value||o.searchWord.value||o.commandQuery.value?s.CANCEL():t();else if("ArrowDown"===e.key)e.stopPropagation(),e.preventDefault(),s.HIGHLIGHT_NEXT_ITEM();else if("ArrowUp"===e.key)e.stopPropagation(),e.preventDefault(),s.HIGHLIGHT_PREVIOUS_ITEM();else if("Enter"===e.key){e.stopPropagation(),e.preventDefault();let t=o.availableCommandIds.value[o.highlightedItem.value];o.status.value===K.DISPLAYING_RESULT&&(t=Object.values(o.result.value.options).length?Object.keys(o.result.value.options)[o.highlightedOption.value]:o.resultCommandId.value),t&&E(t)}}),E=Object(C.useCallback)(async e=>{var n,r,f;const E=null!==(r=null===(n=o.result.value)||void 0===n?void 0:n.options[e])&&void 0!==r?r:o.commands.value[e],{action:C,canHandleQueries:I,subCommandIds:R,name:S}=E;if((null==R?void 0:R.length)>0)return void s.SELECT_GROUP(e);if(assert(C,`Command ${e} has no action`),"string"==typeof C)return await s.EXECUTE_COMMAND(e,"Loading url"),0===C.indexOf("http")&&0!==C.indexOf(document.location.origin)?null===(f=window.open(C,"_blank","noopener,noreferrer"))||void 0===f||f.focus():window.location.href=C,s.FINISH_COMMAND();s.EXECUTE_COMMAND(e,"Running command");const O=C(I?o.commandQuery.value:void 0);if(O.then)O.then(e=>{if(e&&!e.success)throw new Error(`The command "${S}" failed`)}).catch(e=>{q.error("Command error",S,e)}).finally(()=>{s.FINISH_COMMAND()});else if(O.next){const e=O;for await(const t of e)s.UPDATE_RESULT(t);s.FINISH_COMMAND()}else q.error("Command result is not a promise or generator",O);E.closeOnExecute&&t()},[o.searchWord,o.commands,o.result]),R=useFunctionRef(e=>{E(e)});return Object(C.useEffect)(()=>{if(!r)return;const windowKeyEventHandler=e=>f.current(e);return window.addEventListener("keydown",windowKeyEventHandler),()=>window.removeEventListener("keydown",windowKeyEventHandler)},[r]),I.a.createElement(ye.Provider,{value:{executeCommand:R.current}},e)},Ce=Object(C.createContext)({}),useIntl=()=>Object(C.useContext)(Ce),IntlProvider=({translate:e,children:t})=>I.a.createElement(Ce.Provider,{value:{translate:e}},t);var be=n(5);var CommandBarDialog_CommandBarDialog=({onDrag:e,open:t,toggleOpen:n})=>{const{state:{expanded:r,result:o}}=useCommandBarState(),s=Object(C.useRef)(null),f=signals_module_h(!1),E=signals_module_h({left:window.innerWidth/2-300,top:window.innerHeight/2-20}),R=signals_module_h({offsetLeft:0,offsetTop:0}),S=signals_module_h(!1),O=signals_module_y(()=>{const{left:e,top:t}=E.value;return S.value?{left:e+"px",top:t+"px",translate:"none",visibility:f.value?"hidden":"visible"}:{}}),T=Object(C.useCallback)((e,t)=>{const n=s.current.getBoundingClientRect();E.value={left:clamp(e,0,window.innerWidth-n.width),top:clamp(t,0,window.innerHeight-n.height)}},[]),A=Object(C.useCallback)(t=>{"INPUT"!==t.target.tagName&&(console.debug("dragstart"),t.dataTransfer.setData("text/plain","CommandBar"),t.dataTransfer.dropEffect="move",t.dataTransfer.effectAllowed="move",h(()=>{R.value={offsetLeft:t.clientX-s.current.offsetLeft,offsetTop:t.clientY-s.current.offsetTop},S.value=!0}),e&&e(!0))},[s.current]),P=Object(C.useCallback)(t=>{const{clientX:n,clientY:r}=t;console.debug("dragdrop",n,r,R.value),h(()=>{f.value=!1,T(n-R.value.offsetLeft,r-R.value.offsetTop)}),e&&e(!1)},[s.current]),N=Object(C.useCallback)(()=>T(E.value.left,E.value.top),[]);return Object(C.useEffect)(()=>{var e,n;if(t)return null===(n=null===(e=s.current)||void 0===e?void 0:e.parentElement)||void 0===n||n.addEventListener("drop",P),window.addEventListener("resize",N),()=>{var e,t;null===(t=null===(e=s.current)||void 0===e?void 0:e.parentElement)||void 0===t||t.removeEventListener("drop",P),window.removeEventListener("resize",N)}},[t,N,P]),t?I.a.createElement("dialog",{ref:s,className:classnames(be.commandBar,o.value&&be.hasResults),open:t,draggable:!0,onDragStart:A,onDrag:()=>f.value=!0,style:O.value,"data-testid":"CommandBarDialog"},I.a.createElement(CommandBarExecutor,{toggleOpen:n,dialogRef:s,open:t},I.a.createElement(de,null),I.a.createElement("div",{className:classnames(be.resultsWrap,r.value&&be.expanded,o.value&&be.split)},r.value&&I.a.createElement(he,null),o.value&&I.a.createElement(CommandResultsView_CommandResultsView,null)),I.a.createElement(ie,null))):null};n(31);var src_CommandBar=({commands:e,open:t,toggleOpen:n,onDrag:r,IconComponent:o,userPreferences:s,translate:f})=>I.a.createElement(IntlProvider,{translate:f},I.a.createElement(CommandBarStateProvider,{commands:e,IconComponent:o,userPreferences:s},I.a.createElement(CommandBarDialog_CommandBarDialog,{onDrag:r,open:t,toggleOpen:n})));async function fetchData(e,t,n="GET"){return t&&"GET"===n&&(e=Object.keys(t).reduce((e,n)=>e+"&"+n+"="+encodeURIComponent(t[n]),e+"?")),fetch(e,{method:n,credentials:"include",body:t&&"POST"===n?JSON.stringify(t):void 0,headers:{"Content-Type":"application/json",Accept:"application/json"}}).then(e=>{var t;if(200!==e.status)throw new Error(`The request failed with code ${e.status}: "${e.statusText}"`);return(null===(t=e.headers.get("Content-Type"))||void 0===t?void 0:t.includes("application/json"))?e.json():e.text()})}async function setPreference(e,t){return fetchData(e,t,"POST")}async function getPreferences(){return fetchData("/neos/shel-neos-commandbar/preferences/getpreferences")}async function setFavouriteCommands(e){return setPreference("/neos/shel-neos-commandbar/preferences/setfavourites",{commandIds:e})}async function addRecentCommand(e){return setPreference("/neos/shel-neos-commandbar/preferences/addrecentcommand",{commandId:e})}async function getCommands(){return fetchData("/neos/service/data-source/shel-neos-commandbar-commands")}async function searchNeosDocs(e){return e?fetchData("/neos/service/data-source/shel-neos-commandbar-search-neos-docs",{query:e}):{}}async function searchNeosPackages(e){return e?fetchData("/neos/service/data-source/shel-neos-commandbar-search-neos-packages",{query:e}):{}}async function searchNodes(e,t){return e?fetchData("service/data-source/shel-neos-commandbar-search-nodes",{query:e,node:t}):[]}var Ie=n(6),Re=n(11);const CommandBarUiPlugin_IconComponent=({icon:e,spin:t=!1})=>C.createElement(P.Icon,{icon:e,spin:t});class CommandBarUiPlugin_CommandBarUiPlugin extends C.PureComponent{constructor(e){super(e),this.buildCommandsFromHotkeys=()=>{const{hotkeyRegistry:e,handleHotkeyAction:t,config:n}=this.props;return e.getAllAsList().reduce((e,{id:r,description:o,action:s})=>(n.hotkeys.filter.includes(r)||(e[r]={name:o,description:r,icon:this.mapHotkeyIdToIcon(r),action:async()=>{t(s())},closeOnExecute:!0}),e),{})},this.buildCommandsFromEditPreviewModes=()=>{const{setEditPreviewMode:e,editPreviewModes:t,i18nRegistry:n}=this.props;return Object.keys(t).reduce((r,o)=>{const{title:s,isEditingMode:f}=t[o];return r[o]={name:n.translate(s),description:()=>this.props.editPreviewMode===o?this.translate("CommandBarUiPlugin.command.switchEditPreviewMode.active","Currently active"):"",icon:f?"pencil":"eye",action:async()=>e(o)},r},{})},this.handleAddNode=async()=>{const{addNode:e,documentNode:t,focusedNodeContextPath:n,toggleCommandBar:r}=this.props;r(),e(n||t.contextPath,void 0,"after")},this.handleSearchNode=async function*(e){const{siteNode:t,setActiveContentCanvasSrc:n}=this.props;let r;yield{success:!0,message:this.translate("CommandBarUiPlugin.command.searchDocuments.searching",{query:e})};const o=await E.searchNodes(e,t.contextPath).catch(e=>{q.error("Could not search nodes",e),r=e.message});o?yield{success:!0,message:this.translate("CommandBarUiPlugin.command.searchDocuments.matches",{matches:o.length}),options:o.reduce((e,{name:t,nodetype:r,contextPath:o,uri:s,icon:f})=>s?(e[o]={id:o,name:t,category:r,action:async()=>{n(s)},closeOnExecute:!0,icon:f},e):e,{})}:yield{success:!1,message:this.translate("CommandBarUiPlugin.command.searchDocuments.searchFailed","Search failed"),view:r}},this.handleSearchNeosDocs=async function*(e){let t;yield{success:!0,message:this.translate("CommandBarUiPlugin.command.documentation.searching",{query:e},`Search for "${e}"`)};const n=await s.searchNeosDocs(e).catch(e=>{q.error("Could not search Neos docs",e),t=e.message});t||!n?yield{success:!1,message:this.translate("CommandBarUiPlugin.command.documentation.error","Search failed"),view:t}:yield{success:!0,message:this.translate("CommandBarUiPlugin.command.documentation.matches",{matches:Object.keys(n).length},Object.values(n).length+" options match your query"),options:n}},this.handleSearchNeosPackages=async function*(e){let t;yield{success:!0,message:this.translate("CommandBarUiPlugin.command.packages.searching",{query:e},`Search for "${e}"`)};const n=await f.searchNeosPackages(e).catch(e=>{q.error("Could not search Neos packages",e),t=e.message});t||!n?yield{success:!1,message:this.translate("CommandBarUiPlugin.command.packages.error","Search failed"),view:t}:yield{success:!0,message:this.translate("CommandBarUiPlugin.command.packages.matches",{matches:Object.values(n).length},Object.values(n).length+" options match your query"),options:n}},this.handlePublish=async()=>{const{publishableNodesInDocument:e,publishAction:t,baseWorkspace:n}=this.props;return t(e.map(e=>e.contextPath),n),{success:!0,message:this.translate("CommandBarUiPlugin.command.publish.success",{count:e.length},`Published ${e.length} changes`)}},this.handlePublishAll=async()=>{const{publishableNodes:e,publishAction:t,baseWorkspace:n}=this.props;return t(e.map(e=>e.contextPath),n),{success:!0,message:this.translate("CommandBarUiPlugin.command.publishAll.success",{count:e.length},`Published ${e.length} changes`)}},this.handleDiscard=async()=>{const{publishableNodesInDocument:e,discardAction:t}=this.props;return t(e.map(e=>e.contextPath)),{success:!0,message:this.translate("CommandBarUiPlugin.command.discard.success",{count:e.length},`Discarded ${e.length} changes`)}},this.handleDiscardAll=async()=>{const{publishableNodes:e,discardAction:t}=this.props;return t(e.map(e=>e.contextPath)),{success:!0,message:this.translate("CommandBarUiPlugin.command.discardAll.success",{count:e.length},`Discarded ${e.length} changes`)}},this.setDragging=e=>{this.setState({...this.state,dragging:e})},this.translate=(e,t,n)=>("string"==typeof t&&(n=t,t={}),this.props.i18nRegistry.translate(e,n,t,"Shel.Neos.CommandBar","Main")),this.state={loaded:!1,dragging:!1,favouriteCommands:[],recentCommands:[],recentDocuments:[],showBranding:!0,commands:{addNode:{name:this.translate("CommandBarUiPlugin.command.addNode","Add content"),icon:"plus",description:this.translate("CommandBarUiPlugin.command.addNode.description","Add new content"),action:this.handleAddNode},searchDocuments:{name:this.translate("CommandBarUiPlugin.command.searchDocuments","Search documents"),icon:"search",description:this.translate("CommandBarUiPlugin.command.searchDocuments.description","Search and navigate to documents"),action:this.handleSearchNode.bind(this),canHandleQueries:!0},publishDiscard:{name:this.translate("CommandBarUiPlugin.command.publishDiscard","Publish / discard"),description:this.translate("CommandBarUiPlugin.command.publishDiscard.description","Publish or discard changes"),icon:"check",subCommands:{publish:{name:this.translate("CommandBarUiPlugin.command.publish","Publish"),description:this.translate("CommandBarUiPlugin.command.publish.description","Publish changes in this document"),icon:"check",action:this.handlePublish},publishAll:{name:this.translate("CommandBarUiPlugin.command.publishAll","Publish all"),description:this.translate("CommandBarUiPlugin.command.publishAll.description","Publish changes in all documents"),icon:"check-double",action:this.handlePublishAll},discard:{name:this.translate("CommandBarUiPlugin.command.discard","Discard"),description:this.translate("CommandBarUiPlugin.command.discard.description","Discard changes in the current document"),icon:"ban",action:this.handleDiscard},discardAll:{name:this.translate("CommandBarUiPlugin.command.discardAll","Discard all"),description:this.translate("CommandBarUiPlugin.command.discardAll.description","Discard changes in all documents"),icon:"ban",action:this.handleDiscardAll}}},quickActions:{name:this.translate("CommandBarUiPlugin.command.quickActions","Quick actions"),icon:"keyboard",description:this.translate("CommandBarUiPlugin.command.quickActions.description","Execute hotkeys"),subCommands:this.buildCommandsFromHotkeys()},switchEditPreviewMode:{name:this.translate("CommandBarUiPlugin.command.switchEditPreviewMode","Switch edit/preview mode"),icon:"pencil",description:this.translate("CommandBarUiPlugin.command.switchEditPreviewMode.description","Switch between edit and preview modes"),subCommands:this.buildCommandsFromEditPreviewModes()},openPreview:{name:this.translate("CommandBarUiPlugin.command.openPreview","Open preview"),description:this.translate("CommandBarUiPlugin.command.openPreview.description","Open the preview for current document"),icon:"external-link-alt",action:async()=>{var e;this.props.previewUrl?null===(e=window.open(this.props.previewUrl,"_blank","noopener,noreferrer"))||void 0===e||e.focus():q.warn("No preview url to open")},closeOnExecute:!0}}},e.config.features.searchNeosDocs&&(this.state.commands.searchNeosDocs={name:this.translate("CommandBarUiPlugin.command.documentation","Documentation"),description:this.translate("CommandBarUiPlugin.command.documentation.description","Browse or search the Neos documentation"),icon:"book",canHandleQueries:!0,action:this.handleSearchNeosDocs.bind(this)}),e.config.features.searchNeosPackages&&(this.state.commands.searchNeosPackages={name:this.translate("CommandBarUiPlugin.command.packages","Packages"),description:this.translate("CommandBarUiPlugin.command.packages.description","Search for Neos packages"),icon:"boxes",canHandleQueries:!0,action:this.handleSearchNeosPackages.bind(this)})}mapHotkeyIdToIcon(e){let t=e.split(".").pop();switch(t.indexOf("toggle")>=0&&(t="toggle"),t){case"toggle":return"toggle-on";case"reload":return"redo";case"cancel":case"close":return"window-close";case"apply":return"check"}return"neos"}async componentDidMount(){const{plugins:e}=this.props;let t={};if(e)for(const n of Object.keys(e)){const r=e[n];try{const e=await r();t={...t,...e}}catch(e){q.warn("Could not load commands from plugin "+n,e)}}const n=await o.getCommands().catch(e=>{q.error("Failed to load commands",e)}),s=await r.getPreferences().catch(e=>{q.error("Failed to load user preferences",e)});s&&n&&this.setState(e=>({loaded:!0,...s,commands:{...e.commands,...n,...t}}))}render(){const{commandBarOpen:e,toggleCommandBar:t}=this.props,{commands:n,loaded:o,dragging:s,favouriteCommands:f,recentCommands:E,recentDocuments:I,showBranding:R}=this.state;return C.createElement("div",{className:Re.commandBarToolbarComponent},C.createElement(ve,{handleToggle:t,disabled:!o,label:this.translate("ToggleButton.label","Search…"),title:this.translate("ToggleButton.title","Search for commands")}),o&&C.createElement("div",{className:[Re.fullScreenLayer,e&&Re.open].join(" "),onDragOver:e=>e.preventDefault(),style:s?{pointerEvents:"all"}:null},C.createElement(src_CommandBar,{open:e,commands:n,toggleOpen:t,onDrag:this.setDragging,IconComponent:CommandBarUiPlugin_IconComponent,userPreferences:{favouriteCommands:f,recentCommands:E,recentDocuments:I,showBranding:R,addRecentCommand:r.addRecentCommand,setFavouriteCommands:r.setFavouriteCommands},translate:this.translate})))}}CommandBarUiPlugin_CommandBarUiPlugin.propTypes={addNode:O.a.func.isRequired,baseWorkspace:O.a.string.isRequired,commandBarOpen:O.a.bool,config:O.a.object.isRequired,discardAction:O.a.func.isRequired,documentNode:O.a.object,editPreviewMode:O.a.string.isRequired,editPreviewModes:O.a.object.isRequired,focusedNodeContextPath:O.a.string,handleHotkeyAction:O.a.func.isRequired,hotkeyRegistry:O.a.object.isRequired,i18nRegistry:O.a.object.isRequired,isWorkspaceReadOnly:O.a.bool,publishAction:O.a.func.isRequired,publishableNodes:O.a.array,publishableNodesInDocument:O.a.array,previewUrl:O.a.string,setActiveContentCanvasSrc:O.a.func.isRequired,setEditPreviewMode:O.a.func.isRequired,siteNode:O.a.object,toggleCommandBar:O.a.func.isRequired};const Se=Object(T.neos)(e=>({i18nRegistry:e.get("i18n"),hotkeyRegistry:e.get("hotkeys"),config:e.get("frontendConfiguration").get("Shel.Neos.CommandBar:CommandBar"),nodeTypesRegistry:e.get("@neos-project/neos-ui-contentrepository"),editPreviewModes:e.get("frontendConfiguration").get("editPreviewModes"),plugins:e.get("Shel.Neos.CommandBar").getChildrenAsObject("plugins")}));t.default=Object(R.connect)(()=>({}),{toggleCommandBar:Ie.actions.toggleCommandBar,addNode:A.actions.CR.Nodes.commenceCreation,setEditPreviewMode:A.actions.UI.EditPreviewMode.set,publishAction:A.actions.CR.Workspaces.publish,discardAction:A.actions.CR.Workspaces.commenceDiscard,setActiveContentCanvasSrc:A.actions.UI.ContentCanvas.setSrc})(Object(R.connect)(e=>({siteNode:A.selectors.CR.Nodes.siteNodeSelector(e),documentNode:A.selectors.CR.Nodes.documentNodeSelector(e),focusedNodeContextPath:A.selectors.CR.Nodes.focusedNodePathSelector(e),publishableNodes:A.selectors.CR.Workspaces.publishableNodesSelector(e),publishableNodesInDocument:A.selectors.CR.Workspaces.publishableNodesInDocumentSelector(e),isWorkspaceReadOnly:A.selectors.CR.Workspaces.isWorkspaceReadOnlySelector(e),baseWorkspace:A.selectors.CR.Workspaces.baseWorkspaceSelector(e),commandBarOpen:Ie.selectors.commandBarOpen(e),editPreviewMode:A.selectors.UI.EditPreviewMode.currentEditPreviewMode(e),previewUrl:Ie.selectors.previewUrl(e)}),e=>({handleHotkeyAction:e}))(Se(CommandBarUiPlugin_CommandBarUiPlugin)))}]); //# sourceMappingURL=Plugin.js.map \ No newline at end of file diff --git a/Resources/Public/Plugin.js.map b/Resources/Public/Plugin.js.map index 3a680df..0ef4f26 100644 --- a/Resources/Public/Plugin.js.map +++ b/Resources/Public/Plugin.js.map @@ -1 +1 @@ -{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Plugins/Shel.Neos.CommandBar/node_modules/@neos-project/neos-ui-extensibility/src/shims/vendor/react/index.js","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Plugins/Shel.Neos.CommandBar/node_modules/@neos-project/neos-ui-extensibility/src/shims/vendor/prop-types/index.js","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Plugins/Shel.Neos.CommandBar/node_modules/@neos-project/neos-ui-extensibility/src/shims/neosProjectPackages/neos-ui-redux-store/index.js","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Plugins/Shel.Neos.CommandBar/node_modules/@neos-project/neos-ui-extensibility/dist/readFromConsumerApi.js","webpack:///../commandbar/src/components/CommandListItem/CommandListItem.module.css?2cbc","webpack:///../commandbar/src/components/CommandBarDialog/CommandBarDialog.module.css?2c4b","webpack:///./src/actions/index.ts","webpack:///../commandbar/src/components/CommandBarFooter/CommandBarFooter.module.css?f513","webpack:///../commandbar/src/components/SearchBox/SearchBox.module.css?4eb4","webpack:///../commandbar/src/components/CommandList/CommandListing.module.css?e8fd","webpack:///../commandbar/src/components/CommandResultsView/CommandResultsView.module.css?2734","webpack:///./src/CommandBarUiPlugin.module.css?7d3c","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Plugins/Shel.Neos.CommandBar/node_modules/@neos-project/neos-ui-extensibility/src/shims/vendor/redux-actions/index.js","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Plugins/Shel.Neos.CommandBar/node_modules/@neos-project/neos-ui-extensibility/src/shims/vendor/react-redux/index.js","webpack:///../commandbar/src/components/CommandBarHeader/CommandBarHeader.module.css?3168","webpack:///../commandbar/src/components/ToggleButton/ToggleButton.module.css?31b0","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Plugins/Shel.Neos.CommandBar/node_modules/@neos-project/neos-ui-extensibility/dist/registry/SynchronousRegistry.js","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Plugins/Shel.Neos.CommandBar/node_modules/@neos-project/neos-ui-extensibility/src/shims/neosProjectPackages/neos-ui-decorators/index.js","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Plugins/Shel.Neos.CommandBar/node_modules/@neos-project/neos-ui-extensibility/src/shims/neosProjectPackages/react-ui-components/index.js","webpack:///../commandbar/src/components/IconWrapper/IconWrapper.module.css?6d91","webpack:///../commandbar/src/components/CommandBarFooter/Branding.module.css?5e45","webpack:///./src/index.js","webpack:///./src/manifest.js","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Plugins/Shel.Neos.CommandBar/node_modules/@neos-project/neos-ui-extensibility/dist/index.js","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Plugins/Shel.Neos.CommandBar/node_modules/@neos-project/neos-ui-extensibility/dist/createConsumerApi.js","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Plugins/Shel.Neos.CommandBar/node_modules/@neos-project/neos-ui-extensibility/dist/manifest.js","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Plugins/Shel.Neos.CommandBar/node_modules/@neos-project/neos-ui-extensibility/dist/registry/index.js","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Plugins/Shel.Neos.CommandBar/node_modules/@neos-project/neos-ui-extensibility/dist/registry/AbstractRegistry.js","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Plugins/Shel.Neos.CommandBar/node_modules/@neos-project/positional-array-sorter/dist/positionalArraySorter.js","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Plugins/Shel.Neos.CommandBar/node_modules/tslib/tslib.es6.js","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Plugins/Shel.Neos.CommandBar/node_modules/@neos-project/neos-ui-extensibility/dist/registry/SynchronousMetaRegistry.js","webpack:///../commandbar/src/hooks/useFunctionRef.ts","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Plugins/Shel.Neos.CommandBar/node_modules/@preact/signals-core/dist/signals-core.module.js","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Plugins/Shel.Neos.CommandBar/node_modules/@preact/signals-react/dist/signals.module.js","webpack:///../commandbar/src/helpers/flattenCommands.ts","webpack:///../commandbar/src/helpers/logger.ts","webpack:///../commandbar/src/helpers/clamp.ts","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Plugins/Shel.Neos.CommandBar/node_modules/@leeoniya/ufuzzy/dist/uFuzzy.esm.js","webpack:///../commandbar/src/helpers/filterCommands.ts","webpack:///../commandbar/src/helpers/asset.ts","webpack:///../commandbar/src/helpers/classnames.ts","webpack:///../commandbar/src/state/commandBarMachine.ts","webpack:///../commandbar/src/state/commandBarReducer.ts","webpack:///../commandbar/src/components/IconWrapper/IconWrapper.tsx","webpack:///../commandbar/src/components/CommandBarFooter/Branding.tsx","webpack:///../commandbar/src/components/Icons/IconBack.tsx","webpack:///../commandbar/src/components/Icons/IconNeos.tsx","webpack:///../commandbar/src/components/Icons/IconSpinner.tsx","webpack:///../commandbar/src/components/Icons/IconStar.tsx","webpack:///../commandbar/src/components/Icons/IconPlay.tsx","webpack:///../commandbar/src/components/CommandBarFooter/CommandBarFooter.tsx","webpack:///../commandbar/src/components/SearchBox/SearchBox.tsx","webpack:///../commandbar/src/components/CommandBarHeader/CommandBarHeader.tsx","webpack:///../commandbar/src/components/CommandListItem/CommandListItem.tsx","webpack:///../commandbar/src/components/CommandList/CommandList.tsx","webpack:///../commandbar/src/components/CommandResultsView/CommandResultsView.tsx","webpack:///../commandbar/src/components/ToggleButton/ToggleButton.tsx","webpack:///../commandbar/src/state/CommandBarStateProvider.tsx","webpack:///../commandbar/src/state/CommandBarExecutor.tsx","webpack:///../commandbar/src/state/IntlProvider.tsx","webpack:///../commandbar/src/components/CommandBarDialog/CommandBarDialog.tsx","webpack:///../commandbar/src/CommandBar.tsx","webpack:///../neos-api/src/fetch.ts","webpack:///../neos-api/src/preferences.ts","webpack:///../neos-api/src/commands.ts","webpack:///../neos-api/src/documentation.ts","webpack:///../neos-api/src/packages.ts","webpack:///../neos-api/src/nodes.ts","webpack:///./src/CommandBarUiPlugin.tsx"],"names":["installedModules","__webpack_require__","moduleId","exports","module","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","getDefault","getModuleExports","object","property","prototype","hasOwnProperty","p","s","React","PropTypes","NeosUiReduxStore","__read","iterator","e","ar","next","done","push","error","__spreadArray","to","from","pack","arguments","length","Array","slice","concat","readFromConsumerApi","_a","args","_i","window","apply","Error","actionTypes","TOGGLE_COMMAND_BAR","actions","toggleCommandBar","reducer","state","action","_b","_c","plugins","commandBar","open","undefined","payload","selectors","commandBarOpen","previewUrl","ui","contentCanvas","reduxActions","reactRedux","extendStatics","__extends","b","setPrototypeOf","__proto__","TypeError","String","__","this","constructor","__importDefault","mod","AbstractRegistry_1","require","positional_array_sorter_1","SynchronousRegistry","_super","description","_this","_registry","set","position","entry","indexOfItemWithTheSameKey","findIndex","item","console","result","find","_getChildrenWrapped","searchKey","unsortedChildren","filter","indexOf","getChildrenAsObject","forEach","getChildren","map","has","Boolean","_getAllWrapped","getAllAsObject","getAllAsList","assign","id","NeosUiDecorators","ReactUiComponents","globalRegistry","frontendConfiguration","enabled","CommandBarUiPlugin","hotkeys","hotkeyRegistry","SynchronousMetaRegistry","createConsumerApi","createConsumerApi_1","readFromConsumerApi_1","index_1","manifest_1","createReadOnlyValue","writable","configurable","manifests","exposureMap","api","keys","identifier","options","bootstrap","SynchronousRegistry_1","SynchronousMetaRegistry_1","AbstractRegistry","SERIAL_VERSION_UID","tslib_1","positionalArraySorter","subject","idKey","e_1","e_2","e_3","e_4","_d","e_5","_e","e_6","_f","e_7","_g","positionAccessor","indexMapping","middleKeys","startKeys","endKeys","beforeKeys","afterKeys","index","positionValue","invalid","startsWith","weight","weightMatch","match","Number","reference","numberPosition","parseFloat","isNaN","isFinite","resultStart","resultMiddle","resultEnd","processedKeys","sortedWeights","dict","asc","weights","x","sort","a","reverse","addToResults","e_8","e_9","beforeWeights","beforeWeights_1","__values","beforeWeights_1_1","e_8_1","afterWeights","afterWeights_1","afterWeights_1_1","e_9_1","_h","_j","e_1_1","_k","_l","e_2_1","_m","_o","e_3_1","_p","_q","_r","_s","e_5_1","e_4_1","_t","_u","_v","_w","e_7_1","e_6_1","__spread","__assign","__rest","getOwnPropertySymbols","propertyIsEnumerable","__decorate","decorators","target","desc","getOwnPropertyDescriptor","Reflect","decorate","__param","paramIndex","decorator","__metadata","metadataKey","metadataValue","metadata","__awaiter","thisArg","_arguments","P","generator","Promise","resolve","reject","fulfilled","step","rejected","adopt","then","__generator","body","f","y","g","_","label","sent","trys","ops","verb","v","op","pop","__createBinding","k","k2","__exportStar","__spreadArrays","il","j","jl","__await","__asyncGenerator","asyncIterator","q","resume","fulfill","settle","shift","__asyncDelegator","__asyncValues","__makeTemplateObject","cooked","raw","__importStar","default","__classPrivateFieldGet","receiver","privateMap","__classPrivateFieldSet","useFunctionRef","fn","fnRef","current","h","S","u","U","w","subscribe","valueOf","toString","peek","N","createElement","WeakMap","$$typeof","defineProperties","type","data","props","ref","ReactCurrentDispatcher","useCallback","test","useReducer","Map","flattenCommands","commands","parentId","reduce","commandList","commandId","icon","subCommands","canHandleQueries","closeOnExecute","category","executeManually","absoluteCommandId","subCommandIds","subCommandId","PREFIX","ok","message","log","warn","debug","clamp","min","max","Math","cmp","Intl","Collator","compare","NEGS_RE","OPTS","interSplit","intraSplit","intraBound","interLft","interRgt","interChars","interIns","Infinity","intraChars","intraIns","intraContr","intraMode","intraSlice","intraSub","intraTrn","intraDel","intraFilt","term","info","haystack","needle","idx","chars","terms","interLft2","interLft1","start","ia","ib","lazyRepeat","limit","uFuzzy","opts","_intraSplit","_interSplit","_intraBound","intraRules","_intraSlice","_intraIns","_intraSub","_intraTrn","_intraDel","plen","withIntraSplit","RegExp","trimRe","contrsRe","split","replace","toLowerCase","prepQuery","capt","interOR","parts","reTpl","contrs","fill","pi","lftIdx","rgtIdx","lftChar","rgtChar","numChars","variants","intraInsTpl","join","preTpl","sufTpl","interCharsTpl","idxs","out","query","withIntraBound","interBound","queryR","partsLen","len","field","interRgt2","interRgt1","ranges","mayDiscard","ii","mhstr","idxAcc","disc","lft2","lft1","rgt2","rgt1","inter","intra","refine","group","termLen","groupLen","fullMatch","idxOf","refineMatch","lftCharIdx","rgtCharIdx","isPre","isSuf","junk","junkIdx","m2","found","re","exec","charIdx","refLen","ri","lastRi","idxInNext","matchLen","offset","prepend","search","outOfOrder","infoThresh","preFiltered","negsRe","needles","matches","negs","trim","terms2","ti","permute","perm","matchedIdxs","Set","ni","size","preFiltered2","matched","add","retInfo","retOrder","acc","_info","order","_search","latinize","accents","A","E","I","O","C","accentsMap","accentsTpl","accentsRe","replacer","strings","arr","_mark","part","_append","highlight","str","mark","accum","append","tmp","substring","fr","uf","assert","condition","classnames","STATUS","TRANSITION","ACTION","machine","initial","COLLAPSED","states","collapsed","on","UPDATE_SEARCH","IDLE","EXPAND","SET_SEARCH_WORD","REFRESH_COMMANDS","HIGHLIGHT_NEXT_ITEM","idle","RESET_HIGHLIGHT","HIGHLIGHT_NEXT_COMMAND","HIGHLIGHT_PREVIOUS_ITEM","HIGHLIGHT_PREVIOUS_COMMAND","CANCEL","RESET_SEARCH_OR_LEAVE_GROUP","EXECUTE_COMMAND","EXECUTING_COMMAND","ADD_RECENTLY_USED","SET_ACTIVE_COMMAND","GO_TO_PARENT_GROUP","LEAVE_GROUP","SELECT_GROUP","RESET_SEARCH","SET_GROUP","ADD_FAVOURITE","REMOVE_FAVOURITE","executingCommand","UPDATE_RESULT","DISPLAYING_RESULT","FINISH_COMMAND","UNSET_ACTIVE_COMMAND","displayingResult","UPDATE_COMMAND_QUERY","SET_COMMAND_QUERY","RESET_OPTION_HIGHLIGHT","HIGHLIGHT_NEXT_OPTION","HIGHLIGHT_PREVIOUS_OPTION","UNSET_RESULT","runAction","nextState","event","searchWord","highlightedItem","availableCommandIds","filterCommands","selectedCommandGroup","favourites","recentCommands","availableCommands","values","command","includes","sortCommands","favouriteCommands","aIsRecent","bIsRecent","aIsFavourite","bIsFavourite","localeCompare","availableCommandNames","indices","highlightedOption","commandQuery","expanded","activeCommandId","activeCommandMessage","success","view","resultCommandId","unshift","commandBarReducer","transition","actionCallback","nextStateNode","status","memo","children","className","showBranding","useCommandBarState","translate","useIntl","href","title","rel","xmlns","width","height","viewBox","gradientUnits","x1","y1","x2","y2","stopColor","transform","IconBack","IconNeos","IconSpinner","IconStar","IconPlay","Icon","runningCommand","updateResultsTimer","executeCommand","useCommandExecutor","inputRef","handleChange","clearTimeout","setTimeout","handleKeyPress","preventDefault","stopPropagation","focus","Fragment","placeholder","autoFocus","onChange","onKeyUp","onClick","isDisplayingResults","CommandListItem","onItemSelect","highlightedId","onToggleFavourite","commandType","getCommandType","isHighlighted","isFavourite","navRef","useRef","querySelector","scrollIntoView","behavior","block","handleToggleFavourite","suggestions","highlightedCommand","highlightedIndex","handleToggle","disabled","CommandBarContext","CommandBarStateProvider","IconComponent","userPreferences","dispatch","createAppState","initialState","commandBarState","async","addRecentCommand","catch","setFavouriteCommands","spin","Provider","CommandInputContext","createContext","useContext","CommandBarExecutor","toggleOpen","dialogRef","handleKeyEnteredRef","defaultPrevented","metaKey","contains","document","location","origin","actionResult","finally","executeCommandRef","windowKeyEventHandler","addEventListener","removeEventListener","IntlContext","IntlProvider","onDrag","isDragging","dialogPosition","left","innerWidth","top","innerHeight","dragStateOffset","offsetLeft","offsetTop","hasBeenDragged","dialogStyle","visibility","reposition","dialogSize","getBoundingClientRect","handleDragStart","tagName","dataTransfer","setData","dropEffect","effectAllowed","clientX","clientY","handleDragDrop","onResize","parentElement","draggable","onDragStart","style","fetchData","endpoint","params","method","url","encodeURIComponent","fetch","credentials","JSON","stringify","headers","Accept","response","statusText","json","text","setPreference","getPreferences","commandIds","getCommands","searchNeosDocs","searchNeosPackages","searchNodes","node","super","buildCommandsFromHotkeys","handleHotkeyAction","config","carry","mapHotkeyIdToIcon","buildCommandsFromEditPreviewModes","setEditPreviewMode","editPreviewModes","i18nRegistry","isEditingMode","editPreviewMode","handleAddNode","addNode","documentNode","focusedNodeContextPath","contextPath","handleSearchNode","siteNode","setActiveContentCanvasSrc","results","nodetype","uri","handleSearchNeosDocs","handleSearchNeosPackages","handlePublish","publishableNodesInDocument","publishAction","baseWorkspace","count","handlePublishAll","publishableNodes","handleDiscard","discardAction","handleDiscardAll","setDragging","dragging","setState","paramsOrFallback","fallback","loaded","recentDocuments","searchDocuments","publishDiscard","publish","publishAll","discard","discardAll","quickActions","switchEditPreviewMode","openPreview","features","actionName","pluginCommands","pluginName","plugin","pluginResult","preferences","prev","onDragOver","pointerEvents","propTypes","func","isRequired","string","bool","isWorkspaceReadOnly","array","mapGlobalRegistryToProps","nodeTypesRegistry","CR","Nodes","commenceCreation","UI","EditPreviewMode","Workspaces","commenceDiscard","ContentCanvas","setSrc","siteNodeSelector","documentNodeSelector","focusedNodePathSelector","publishableNodesSelector","publishableNodesInDocumentSelector","isWorkspaceReadOnlySelector","baseWorkspaceSelector","currentEditPreviewMode"],"mappings":";aACE,IAAIA,EAAmB,GAGvB,SAASC,oBAAoBC,GAG5B,GAAGF,EA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A6CyJ,GAAyB","file":"Plugin.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 21);\n","import readFromConsumerApi from '../../../../dist/readFromConsumerApi';\n\nmodule.exports = readFromConsumerApi('vendor')().React;\n","import readFromConsumerApi from '../../../../dist/readFromConsumerApi';\n\nmodule.exports = readFromConsumerApi('vendor')().PropTypes;\n","import readFromConsumerApi from '../../../../dist/readFromConsumerApi';\n\nmodule.exports = readFromConsumerApi('NeosProjectPackages')().NeosUiReduxStore;\n","\"use strict\";\nvar __read = (this && this.__read) || function (o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n};\nvar __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n};\nexports.__esModule = true;\nfunction readFromConsumerApi(key) {\n return function () {\n var _a;\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n if (window['@Neos:HostPluginAPI'] && window['@Neos:HostPluginAPI'][\"@\".concat(key)]) {\n return (_a = window['@Neos:HostPluginAPI'])[\"@\".concat(key)].apply(_a, __spreadArray([], __read(args), false));\n }\n throw new Error('You are trying to read from a consumer api that hasn\\'t been initialized yet!');\n };\n}\nexports[\"default\"] = readFromConsumerApi;\n//# sourceMappingURL=readFromConsumerApi.js.map","// extracted by mini-css-extract-plugin\nmodule.exports = {\"commandListItem\":\"CommandListItem-module__commandListItem___2u7xD\",\"highlighted\":\"CommandListItem-module__highlighted___1LR6R\",\"disabled\":\"CommandListItem-module__disabled___7wCym\",\"label\":\"CommandListItem-module__label___1bznO\",\"description\":\"CommandListItem-module__description___2RTG3\",\"type\":\"CommandListItem-module__type___1C7PR\",\"favouriteButton\":\"CommandListItem-module__favouriteButton___3n3yV\",\"isFavourite\":\"CommandListItem-module__isFavourite___KSM9p\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"commandBar\":\"CommandBarDialog-module__commandBar___1Hb5s\",\"hasResults\":\"CommandBarDialog-module__hasResults___3iM8B\",\"resultsWrap\":\"CommandBarDialog-module__resultsWrap___2gd3U\",\"expanded\":\"CommandBarDialog-module__expanded___jby7g\",\"split\":\"CommandBarDialog-module__split___66TVs\"};","import { createAction, handleActions } from 'redux-actions';\nexport const actionTypes = {\n TOGGLE_COMMAND_BAR: 'TOGGLE_COMMAND_BAR',\n};\nconst toggleCommandBar = createAction(actionTypes.TOGGLE_COMMAND_BAR);\nexport const actions = {\n toggleCommandBar,\n};\nexport const reducer = handleActions({\n TOGGLE_COMMAND_BAR: (state, action) => {\n var _a, _b, _c;\n return ({\n ...state,\n plugins: {\n ...state.plugins,\n commandBar: {\n open: ((_a = action.payload) === null || _a === void 0 ? void 0 : _a.open) !== undefined ? action.payload.open : !((_c = (_b = state.plugins) === null || _b === void 0 ? void 0 : _b.commandBar) === null || _c === void 0 ? void 0 : _c.open),\n },\n },\n });\n },\n}, {\n plugins: {\n commandBar: {\n open: false,\n },\n },\n});\nexport const selectors = {\n commandBarOpen: (state) => { var _a, _b; return (_b = (_a = state.plugins) === null || _a === void 0 ? void 0 : _a.commandBar) === null || _b === void 0 ? void 0 : _b.open; },\n previewUrl: (state) => { var _a, _b; return (_b = (_a = state.ui) === null || _a === void 0 ? void 0 : _a.contentCanvas) === null || _b === void 0 ? void 0 : _b.previewUrl; },\n};\n","// extracted by mini-css-extract-plugin\nmodule.exports = {\"commandBarFooter\":\"CommandBarFooter-module__commandBarFooter___2mcre\",\"breadcrumb\":\"CommandBarFooter-module__breadcrumb___1Ul24\",\"activity\":\"CommandBarFooter-module__activity___2GXJU\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"searchBox\":\"SearchBox-module__searchBox___1SEtn\",\"expandButton\":\"SearchBox-module__expandButton___B2jYv\",\"executeButton\":\"SearchBox-module__executeButton___3hg_l\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"results\":\"CommandListing-module__results___23Rve\",\"noResults\":\"CommandListing-module__noResults___Mb89V\",\"disabled\":\"CommandListing-module__disabled___6gpPj\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"commandResultsView\":\"CommandResultsView-module__commandResultsView___xLqwb\",\"message\":\"CommandResultsView-module__message___NhUkR\",\"results\":\"CommandResultsView-module__results___1t6jB\",\"noResults\":\"CommandResultsView-module__noResults___2ksIF\",\"disabled\":\"CommandResultsView-module__disabled___OmNvX\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"fullScreenLayer\":\"CommandBarUiPlugin-module__fullScreenLayer___1cUx4\",\"open\":\"CommandBarUiPlugin-module__open___1Bjxj\",\"commandBarToolbarComponent\":\"CommandBarUiPlugin-module__commandBarToolbarComponent___1agRY\"};","import readFromConsumerApi from '../../../../dist/readFromConsumerApi';\n\nmodule.exports = readFromConsumerApi('vendor')().reduxActions;\n","import readFromConsumerApi from '../../../../dist/readFromConsumerApi';\n\nmodule.exports = readFromConsumerApi('vendor')().reactRedux;\n","// extracted by mini-css-extract-plugin\nmodule.exports = {\"commandBarHeader\":\"CommandBarHeader-module__commandBarHeader___3Y2hR\",\"backButton\":\"CommandBarHeader-module__backButton___1qIGu\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"toggleButton\":\"ToggleButton-module__toggleButton___2wPs-\",\"buttonIcon\":\"ToggleButton-module__buttonIcon___UjFjw\"};","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nexports.__esModule = true;\nvar AbstractRegistry_1 = __importDefault(require(\"./AbstractRegistry\"));\nvar positional_array_sorter_1 = __importDefault(require(\"@neos-project/positional-array-sorter\"));\nvar SynchronousRegistry = (function (_super) {\n __extends(SynchronousRegistry, _super);\n function SynchronousRegistry(description) {\n var _this = _super.call(this, description) || this;\n _this._registry = [];\n return _this;\n }\n SynchronousRegistry.prototype.set = function (key, value, position) {\n if (position === void 0) { position = 0; }\n if (typeof key !== 'string') {\n throw new Error('Key must be a string');\n }\n if (typeof position !== 'string' && typeof position !== 'number') {\n throw new Error('Position must be a string or a number');\n }\n var entry = { key: key, value: value };\n if (position) {\n entry.position = position;\n }\n var indexOfItemWithTheSameKey = this._registry.findIndex(function (item) { return item.key === key; });\n if (indexOfItemWithTheSameKey === -1) {\n this._registry.push(entry);\n }\n else {\n this._registry[indexOfItemWithTheSameKey] = entry;\n }\n return value;\n };\n SynchronousRegistry.prototype.get = function (key) {\n if (typeof key !== 'string') {\n console.error('Key must be a string');\n return null;\n }\n var result = this._registry.find(function (item) { return item.key === key; });\n return result ? result.value : null;\n };\n SynchronousRegistry.prototype._getChildrenWrapped = function (searchKey) {\n var unsortedChildren = this._registry.filter(function (item) { return item.key.indexOf(searchKey + '/') === 0; });\n return (0, positional_array_sorter_1[\"default\"])(unsortedChildren);\n };\n SynchronousRegistry.prototype.getChildrenAsObject = function (searchKey) {\n var result = {};\n this._getChildrenWrapped(searchKey).forEach(function (item) {\n result[item.key] = item.value;\n });\n return result;\n };\n SynchronousRegistry.prototype.getChildren = function (searchKey) {\n return this._getChildrenWrapped(searchKey).map(function (item) { return item.value; });\n };\n SynchronousRegistry.prototype.has = function (key) {\n if (typeof key !== 'string') {\n console.error('Key must be a string');\n return false;\n }\n return Boolean(this._registry.find(function (item) { return item.key === key; }));\n };\n SynchronousRegistry.prototype._getAllWrapped = function () {\n return (0, positional_array_sorter_1[\"default\"])(this._registry);\n };\n SynchronousRegistry.prototype.getAllAsObject = function () {\n var result = {};\n this._getAllWrapped().forEach(function (item) {\n result[item.key] = item.value;\n });\n return result;\n };\n SynchronousRegistry.prototype.getAllAsList = function () {\n return this._getAllWrapped().map(function (item) { return Object.assign({ id: item.key }, item.value); });\n };\n return SynchronousRegistry;\n}(AbstractRegistry_1[\"default\"]));\nexports[\"default\"] = SynchronousRegistry;\n//# sourceMappingURL=SynchronousRegistry.js.map","import readFromConsumerApi from '../../../../dist/readFromConsumerApi';\n\nmodule.exports = readFromConsumerApi('NeosProjectPackages')().NeosUiDecorators;\n","import readFromConsumerApi from '../../../../dist/readFromConsumerApi';\n\nmodule.exports = readFromConsumerApi('NeosProjectPackages')().ReactUiComponents;\n","// extracted by mini-css-extract-plugin\nmodule.exports = {\"iconWrap\":\"IconWrapper-module__iconWrap___1Z3nD\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"madeWithLove\":\"Branding-module__madeWithLove___2ibna\"};","require('./manifest');\n","import manifest, { SynchronousRegistry } from '@neos-project/neos-ui-extensibility';\n\nimport { reducer, actions } from './actions';\nimport CommandBarUiPlugin from './CommandBarUiPlugin';\n\nmanifest('Shel.Neos.CommandBar:CommandBar', {}, (globalRegistry, { frontendConfiguration }) => {\n /** @type {{ enabled: boolean, features: { loadTestCommands: boolean } }} pluginConfig */\n const pluginConfig = frontendConfiguration['Shel.Neos.CommandBar:CommandBar'];\n const { enabled } = pluginConfig;\n\n if (!enabled) {\n return;\n }\n\n // Create our new registry for 3rd party command bar plugins\n globalRegistry.set(\n 'Shel.Neos.CommandBar',\n new SynchronousRegistry(`\n # Shel.Neos.CommandBar 3rd party commands\n `)\n );\n\n // Register commandbar component in the primary toolbar\n globalRegistry.get('containers').set('PrimaryToolbar/Middle/CommandBar', CommandBarUiPlugin);\n\n // Register reducer\n globalRegistry.get('reducers').set('Shel.Neos.CommandBar', { reducer });\n\n // Register hotkeys\n if (frontendConfiguration.hotkeys !== null && frontendConfiguration.hotkeys.length !== 0) {\n const hotkeyRegistry = globalRegistry.get('hotkeys');\n hotkeyRegistry.set('Shel.Neos.CommandBar.toggle.CMD', {\n description: 'Toggle command bar',\n action: actions.toggleCommandBar,\n });\n hotkeyRegistry.set('Shel.Neos.CommandBar.toggle.CTRL', {\n description: 'Toggle command bar',\n action: actions.toggleCommandBar,\n });\n }\n});\n","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nexports.__esModule = true;\nexports.SynchronousMetaRegistry = exports.SynchronousRegistry = exports.readFromConsumerApi = exports.createConsumerApi = void 0;\nvar createConsumerApi_1 = __importDefault(require(\"./createConsumerApi\"));\nexports.createConsumerApi = createConsumerApi_1[\"default\"];\nvar readFromConsumerApi_1 = __importDefault(require(\"./readFromConsumerApi\"));\nexports.readFromConsumerApi = readFromConsumerApi_1[\"default\"];\nvar index_1 = require(\"./registry/index\");\nexports.SynchronousRegistry = index_1.SynchronousRegistry;\nexports.SynchronousMetaRegistry = index_1.SynchronousMetaRegistry;\nexports[\"default\"] = (0, readFromConsumerApi_1[\"default\"])('manifest');\n//# sourceMappingURL=index.js.map","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nexports.__esModule = true;\nvar manifest_1 = __importDefault(require(\"./manifest\"));\nvar createReadOnlyValue = function (value) { return ({\n value: value,\n writable: false,\n enumerable: false,\n configurable: true\n}); };\nfunction createConsumerApi(manifests, exposureMap) {\n var api = {};\n Object.keys(exposureMap).forEach(function (key) {\n Object.defineProperty(api, key, createReadOnlyValue(exposureMap[key]));\n });\n Object.defineProperty(api, '@manifest', createReadOnlyValue((0, manifest_1[\"default\"])(manifests)));\n Object.defineProperty(window, '@Neos:HostPluginAPI', createReadOnlyValue(api));\n}\nexports[\"default\"] = createConsumerApi;\n//# sourceMappingURL=createConsumerApi.js.map","\"use strict\";\nexports.__esModule = true;\nexports[\"default\"] = (function (manifests) {\n return function (identifier, options, bootstrap) {\n var _a;\n manifests.push((_a = {},\n _a[identifier] = {\n options: options,\n bootstrap: bootstrap\n },\n _a));\n };\n});\n//# sourceMappingURL=manifest.js.map","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nexports.__esModule = true;\nexports.SynchronousMetaRegistry = exports.SynchronousRegistry = void 0;\nvar SynchronousRegistry_1 = __importDefault(require(\"./SynchronousRegistry\"));\nexports.SynchronousRegistry = SynchronousRegistry_1[\"default\"];\nvar SynchronousMetaRegistry_1 = __importDefault(require(\"./SynchronousMetaRegistry\"));\nexports.SynchronousMetaRegistry = SynchronousMetaRegistry_1[\"default\"];\n//# sourceMappingURL=index.js.map","\"use strict\";\nexports.__esModule = true;\nvar AbstractRegistry = (function () {\n function AbstractRegistry(description) {\n this.SERIAL_VERSION_UID = 'd8a5aa78-978e-11e6-ae22-56b6b6499611';\n this.description = description;\n }\n return AbstractRegistry;\n}());\nexports[\"default\"] = AbstractRegistry;\n//# sourceMappingURL=AbstractRegistry.js.map","\"use strict\";\nexports.__esModule = true;\nvar tslib_1 = require(\"tslib\");\nvar positionalArraySorter = function (subject, position, idKey) {\n var e_1, _a, e_2, _b, e_3, _c, e_4, _d, e_5, _e, e_6, _f, e_7, _g;\n if (position === void 0) { position = 'position'; }\n if (idKey === void 0) { idKey = 'key'; }\n var positionAccessor = typeof position === 'string' ? function (value) { return value[position]; } : position;\n var indexMapping = {};\n var middleKeys = {};\n var startKeys = {};\n var endKeys = {};\n var beforeKeys = {};\n var afterKeys = {};\n subject.forEach(function (item, index) {\n var key = item[idKey] ? item[idKey] : String(index);\n indexMapping[key] = index;\n var positionValue = positionAccessor(item);\n var position = String(positionValue ? positionValue : index);\n var invalid = false;\n if (position.startsWith('start')) {\n var weightMatch = position.match(/start\\s+(\\d+)/);\n var weight = weightMatch && weightMatch[1] ? Number(weightMatch[1]) : 0;\n if (!startKeys[weight]) {\n startKeys[weight] = [];\n }\n startKeys[weight].push(key);\n }\n else if (position.startsWith('end')) {\n var weightMatch = position.match(/end\\s+(\\d+)/);\n var weight = weightMatch && weightMatch[1] ? Number(weightMatch[1]) : 0;\n if (!endKeys[weight]) {\n endKeys[weight] = [];\n }\n endKeys[weight].push(key);\n }\n else if (position.startsWith('before')) {\n var match = position.match(/before\\s+(\\S+)(\\s+(\\d+))?/);\n if (!match) {\n invalid = true;\n }\n else {\n var reference = match[1];\n var weight = match[3] ? Number(match[3]) : 0;\n if (!beforeKeys[reference]) {\n beforeKeys[reference] = {};\n }\n if (!beforeKeys[reference][weight]) {\n beforeKeys[reference][weight] = [];\n }\n beforeKeys[reference][weight].push(key);\n }\n }\n else if (position.startsWith('after')) {\n var match = position.match(/after\\s+(\\S+)(\\s+(\\d+))?/);\n if (!match) {\n invalid = true;\n }\n else {\n var reference = match[1];\n var weight = match[3] ? Number(match[3]) : 0;\n if (!afterKeys[reference]) {\n afterKeys[reference] = {};\n }\n if (!afterKeys[reference][weight]) {\n afterKeys[reference][weight] = [];\n }\n afterKeys[reference][weight].push(key);\n }\n }\n else {\n invalid = true;\n }\n if (invalid) {\n var numberPosition = parseFloat(position);\n if (isNaN(numberPosition) || !isFinite(numberPosition)) {\n numberPosition = index;\n }\n if (!middleKeys[numberPosition]) {\n middleKeys[numberPosition] = [];\n }\n middleKeys[numberPosition].push(key);\n }\n });\n var resultStart = [];\n var resultMiddle = [];\n var resultEnd = [];\n var processedKeys = [];\n var sortedWeights = function (dict, asc) {\n var weights = Object.keys(dict).map(function (x) { return Number(x); }).sort(function (a, b) { return a - b; });\n return asc ? weights : weights.reverse();\n };\n var addToResults = function (keys, result) {\n keys.forEach(function (key) {\n var e_8, _a, e_9, _b;\n if (processedKeys.indexOf(key) >= 0) {\n return;\n }\n processedKeys.push(key);\n if (beforeKeys[key]) {\n var beforeWeights = sortedWeights(beforeKeys[key], true);\n try {\n for (var beforeWeights_1 = tslib_1.__values(beforeWeights), beforeWeights_1_1 = beforeWeights_1.next(); !beforeWeights_1_1.done; beforeWeights_1_1 = beforeWeights_1.next()) {\n var i = beforeWeights_1_1.value;\n addToResults(beforeKeys[key][i], result);\n }\n }\n catch (e_8_1) { e_8 = { error: e_8_1 }; }\n finally {\n try {\n if (beforeWeights_1_1 && !beforeWeights_1_1.done && (_a = beforeWeights_1[\"return\"])) _a.call(beforeWeights_1);\n }\n finally { if (e_8) throw e_8.error; }\n }\n }\n result.push(key);\n if (afterKeys[key]) {\n var afterWeights = sortedWeights(afterKeys[key], false);\n try {\n for (var afterWeights_1 = tslib_1.__values(afterWeights), afterWeights_1_1 = afterWeights_1.next(); !afterWeights_1_1.done; afterWeights_1_1 = afterWeights_1.next()) {\n var i = afterWeights_1_1.value;\n addToResults(afterKeys[key][i], result);\n }\n }\n catch (e_9_1) { e_9 = { error: e_9_1 }; }\n finally {\n try {\n if (afterWeights_1_1 && !afterWeights_1_1.done && (_b = afterWeights_1[\"return\"])) _b.call(afterWeights_1);\n }\n finally { if (e_9) throw e_9.error; }\n }\n }\n });\n };\n try {\n for (var _h = tslib_1.__values(sortedWeights(startKeys, false)), _j = _h.next(); !_j.done; _j = _h.next()) {\n var i = _j.value;\n addToResults(startKeys[i], resultStart);\n }\n }\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\n finally {\n try {\n if (_j && !_j.done && (_a = _h[\"return\"])) _a.call(_h);\n }\n finally { if (e_1) throw e_1.error; }\n }\n try {\n for (var _k = tslib_1.__values(sortedWeights(middleKeys, true)), _l = _k.next(); !_l.done; _l = _k.next()) {\n var i = _l.value;\n addToResults(middleKeys[i], resultMiddle);\n }\n }\n catch (e_2_1) { e_2 = { error: e_2_1 }; }\n finally {\n try {\n if (_l && !_l.done && (_b = _k[\"return\"])) _b.call(_k);\n }\n finally { if (e_2) throw e_2.error; }\n }\n try {\n for (var _m = tslib_1.__values(sortedWeights(endKeys, true)), _o = _m.next(); !_o.done; _o = _m.next()) {\n var i = _o.value;\n addToResults(endKeys[i], resultEnd);\n }\n }\n catch (e_3_1) { e_3 = { error: e_3_1 }; }\n finally {\n try {\n if (_o && !_o.done && (_c = _m[\"return\"])) _c.call(_m);\n }\n finally { if (e_3) throw e_3.error; }\n }\n try {\n for (var _p = tslib_1.__values(Object.keys(beforeKeys)), _q = _p.next(); !_q.done; _q = _p.next()) {\n var key = _q.value;\n if (processedKeys.indexOf(key) >= 0) {\n continue;\n }\n try {\n for (var _r = (e_5 = void 0, tslib_1.__values(sortedWeights(beforeKeys[key], false))), _s = _r.next(); !_s.done; _s = _r.next()) {\n var i = _s.value;\n addToResults(beforeKeys[key][i], resultStart);\n }\n }\n catch (e_5_1) { e_5 = { error: e_5_1 }; }\n finally {\n try {\n if (_s && !_s.done && (_e = _r[\"return\"])) _e.call(_r);\n }\n finally { if (e_5) throw e_5.error; }\n }\n }\n }\n catch (e_4_1) { e_4 = { error: e_4_1 }; }\n finally {\n try {\n if (_q && !_q.done && (_d = _p[\"return\"])) _d.call(_p);\n }\n finally { if (e_4) throw e_4.error; }\n }\n try {\n for (var _t = tslib_1.__values(Object.keys(afterKeys)), _u = _t.next(); !_u.done; _u = _t.next()) {\n var key = _u.value;\n if (processedKeys.indexOf(key) >= 0) {\n continue;\n }\n try {\n for (var _v = (e_7 = void 0, tslib_1.__values(sortedWeights(afterKeys[key], false))), _w = _v.next(); !_w.done; _w = _v.next()) {\n var i = _w.value;\n addToResults(afterKeys[key][i], resultMiddle);\n }\n }\n catch (e_7_1) { e_7 = { error: e_7_1 }; }\n finally {\n try {\n if (_w && !_w.done && (_g = _v[\"return\"])) _g.call(_v);\n }\n finally { if (e_7) throw e_7.error; }\n }\n }\n }\n catch (e_6_1) { e_6 = { error: e_6_1 }; }\n finally {\n try {\n if (_u && !_u.done && (_f = _t[\"return\"])) _f.call(_t);\n }\n finally { if (e_6) throw e_6.error; }\n }\n var sortedKeys = tslib_1.__spread(resultStart, resultMiddle, resultEnd);\n return sortedKeys.map(function (key) { return indexMapping[key]; }).map(function (i) { return subject[i]; });\n};\nexports[\"default\"] = positionalArraySorter;\n//# sourceMappingURL=positionalArraySorter.js.map","/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport function __createBinding(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n}\r\n\r\nexport function __exportStar(m, exports) {\r\n for (var p in m) if (p !== \"default\" && !exports.hasOwnProperty(p)) exports[p] = m[p];\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n};\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];\r\n result.default = mod;\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, privateMap) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to get private field on non-instance\");\r\n }\r\n return privateMap.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, privateMap, value) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to set private field on non-instance\");\r\n }\r\n privateMap.set(receiver, value);\r\n return value;\r\n}\r\n","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nexports.__esModule = true;\nvar SynchronousRegistry_1 = __importDefault(require(\"./SynchronousRegistry\"));\nvar SynchronousMetaRegistry = (function (_super) {\n __extends(SynchronousMetaRegistry, _super);\n function SynchronousMetaRegistry() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n SynchronousMetaRegistry.prototype.set = function (key, value) {\n if (value.SERIAL_VERSION_UID !== 'd8a5aa78-978e-11e6-ae22-56b6b6499611') {\n throw new Error('You can only add registries to a meta registry');\n }\n return _super.prototype.set.call(this, key, value);\n };\n return SynchronousMetaRegistry;\n}(SynchronousRegistry_1[\"default\"]));\nexports[\"default\"] = SynchronousMetaRegistry;\n//# sourceMappingURL=SynchronousMetaRegistry.js.map","import { useRef } from 'react';\n/**\n * A custom hook that creates a ref for a function, and updates it on every render.\n * The new value is always the same function, but the function's context changes on every render.\n */\nexport default function useFunctionRef(fn) {\n const fnRef = useRef(fn);\n fnRef.current = fn;\n return fnRef;\n}\n","function i(){throw new Error(\"Cycle detected\")}function t(){if(!(s>1)){var i,t=!1;while(void 0!==r){var h=r;r=void 0;n++;while(void 0!==h){var o=h.o;h.o=void 0;h.f&=-3;if(!(8&h.f)&&d(h))try{h.c()}catch(h){if(!t){i=h;t=!0}}h=o}}n=0;s--;if(t)throw i}else s--}function h(i){if(s>0)return i();s++;try{return i()}finally{t()}}var o=void 0,r=void 0,s=0,n=0,f=0;function v(i){if(void 0!==o){var t=i.n;if(void 0===t||t.t!==o){t={i:0,S:i,p:o.s,n:void 0,t:o,e:void 0,x:void 0,r:t};if(void 0!==o.s)o.s.n=t;o.s=t;i.n=t;if(32&o.f)i.S(t);return t}else if(-1===t.i){t.i=0;if(void 0!==t.n){t.n.p=t.p;if(void 0!==t.p)t.p.n=t.n;t.p=o.s;t.n=void 0;o.s.n=t;o.s=t}return t}}}function e(i){this.v=i;this.i=0;this.n=void 0;this.t=void 0}e.prototype.h=function(){return!0};e.prototype.S=function(i){if(this.t!==i&&void 0===i.e){i.x=this.t;if(void 0!==this.t)this.t.e=i;this.t=i}};e.prototype.U=function(i){if(void 0!==this.t){var t=i.e,h=i.x;if(void 0!==t){t.x=h;i.e=void 0}if(void 0!==h){h.e=t;i.x=void 0}if(i===this.t)this.t=h}};e.prototype.subscribe=function(i){var t=this;return p(function(){var h=t.value,o=32&this.f;this.f&=-33;try{i(h)}finally{this.f|=o}})};e.prototype.valueOf=function(){return this.value};e.prototype.toString=function(){return this.value+\"\"};e.prototype.peek=function(){return this.v};Object.defineProperty(e.prototype,\"value\",{get:function(){var i=v(this);if(void 0!==i)i.i=this.i;return this.v},set:function(h){if(h!==this.v){if(n>100)i();this.v=h;this.i++;f++;s++;try{for(var o=this.t;void 0!==o;o=o.x)o.t.N()}finally{t()}}}});function u(i){return new e(i)}function d(i){for(var t=i.s;void 0!==t;t=t.n)if(t.S.i!==t.i||!t.S.h()||t.S.i!==t.i)return!0;return!1}function c(i){for(var t=i.s;void 0!==t;t=t.n){var h=t.S.n;if(void 0!==h)t.r=h;t.S.n=t;t.i=-1;if(void 0===t.n){i.s=t;break}}}function a(i){var t=i.s,h=void 0;while(void 0!==t){var o=t.p;if(-1===t.i){t.S.U(t);if(void 0!==o)o.n=t.n;if(void 0!==t.n)t.n.p=o}else h=t;t.S.n=t.r;if(void 0!==t.r)t.r=void 0;t=o}i.s=h}function l(i){e.call(this,void 0);this.x=i;this.s=void 0;this.g=f-1;this.f=4}(l.prototype=new e).h=function(){this.f&=-3;if(1&this.f)return!1;if(32==(36&this.f))return!0;this.f&=-5;if(this.g===f)return!0;this.g=f;this.f|=1;if(this.i>0&&!d(this)){this.f&=-2;return!0}var i=o;try{c(this);o=this;var t=this.x();if(16&this.f||this.v!==t||0===this.i){this.v=t;this.f&=-17;this.i++}}catch(i){this.v=i;this.f|=16;this.i++}o=i;a(this);this.f&=-2;return!0};l.prototype.S=function(i){if(void 0===this.t){this.f|=36;for(var t=this.s;void 0!==t;t=t.n)t.S.S(t)}e.prototype.S.call(this,i)};l.prototype.U=function(i){if(void 0!==this.t){e.prototype.U.call(this,i);if(void 0===this.t){this.f&=-33;for(var t=this.s;void 0!==t;t=t.n)t.S.U(t)}}};l.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(var i=this.t;void 0!==i;i=i.x)i.t.N()}};l.prototype.peek=function(){if(!this.h())i();if(16&this.f)throw this.v;return this.v};Object.defineProperty(l.prototype,\"value\",{get:function(){if(1&this.f)i();var t=v(this);this.h();if(void 0!==t)t.i=this.i;if(16&this.f)throw this.v;return this.v}});function w(i){return new l(i)}function y(i){var h=i.u;i.u=void 0;if(\"function\"==typeof h){s++;var r=o;o=void 0;try{h()}catch(t){i.f&=-2;i.f|=8;_(i);throw t}finally{o=r;t()}}}function _(i){for(var t=i.s;void 0!==t;t=t.n)t.S.U(t);i.x=void 0;i.s=void 0;y(i)}function g(i){if(o!==this)throw new Error(\"Out-of-order effect\");a(this);o=i;this.f&=-2;if(8&this.f)_(this);t()}function b(i){this.x=i;this.u=void 0;this.s=void 0;this.o=void 0;this.f=32}b.prototype.c=function(){var i=this.S();try{if(!(8&this.f)&&void 0!==this.x)this.u=this.x()}finally{i()}};b.prototype.S=function(){if(1&this.f)i();this.f|=1;this.f&=-9;y(this);c(this);s++;var t=o;o=this;return g.bind(this,t)};b.prototype.N=function(){if(!(2&this.f)){this.f|=2;this.o=r;r=this}};b.prototype.d=function(){this.f|=8;if(!(1&this.f))_(this)};function p(i){var t=new b(i);try{t.c()}catch(i){t.d();throw i}return t.d.bind(t)}export{e as Signal,h as batch,w as computed,p as effect,u as signal};//# sourceMappingURL=signals-core.module.js.map\n","import n,{__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED as r,useMemo as t,useRef as e,useEffect as i}from\"react\";import{Signal as u,effect as f,signal as o,computed as a}from\"@preact/signals-core\";export{Signal,batch,computed,effect,signal}from\"@preact/signals-core\";var c,v=n.createElement;n.createElement=function(n,r){if(\"string\"==typeof n&&r)for(var t in r){var e=r[t];if(\"children\"!==t&&e instanceof u)r[t]=e.value}return v.apply(this,arguments)};var l=new WeakMap;function p(n){if(c)c();c=n&&n.S()}var s=v(\"a\").$$typeof;Object.defineProperties(u.prototype,{$$typeof:{configurable:!0,value:s},type:{configurable:!0,value:function(n){return n.data.value}},props:{configurable:!0,get:function(){return{data:this}}},ref:{configurable:!0,value:null}});var g,b=!1,m=function(){return{}};Object.defineProperty(r.ReactCurrentDispatcher,\"current\",{get:function(){return g},set:function(n){g=n;if(!b)if(n&&!function(n){var r=d.get(n);if(void 0!==r)return r;var t=n.useCallback.length<2||/Invalid/.test(n.useCallback);d.set(n,t);return t}(n)){b=!0;var r=n.useReducer(m,{})[1];b=!1;var t=l.get(r);if(!t){t=function(n){var r;f(function(){r=this});r.c=n;return r}(r);l.set(r,t)}else t.c=r;p(t)}else p()}});var d=new Map;function h(n){return t(function(){return o(n)},[])}function y(n){var r=e(n);r.current=n;return t(function(){return a(function(){return r.current()})},[])}function j(n){var r=e(n);r.current=n;i(function(){return f(function(){return r.current()})},[])}export{y as useComputed,h as useSignal,j as useSignalEffect};//# sourceMappingURL=signals.module.js.map\n","/**\n * This method converts the hierarchical command list into a flat list of commands which is more convenient\n * for internal processing, whereas the hierarchical command list is more convenient for the user.\n */\nexport default function flattenCommands(commands, parentId = null) {\n return Object.keys(commands).reduce((commandList, commandId) => {\n const { icon, description, name, subCommands, action, canHandleQueries, closeOnExecute, category, executeManually, } = commands[commandId];\n // Create an uniquely identifiable command id for the flat command list\n const absoluteCommandId = parentId ? `${parentId}.${commandId}` : commandId;\n // Create list of available subcommand names\n const subCommandIds = subCommands\n ? Object.keys(subCommands).map((subCommandId) => `${absoluteCommandId}.${subCommandId}`)\n : [];\n // Insert the processed command into the flat command list\n commandList[absoluteCommandId] = {\n id: absoluteCommandId,\n name,\n icon,\n description,\n action,\n canHandleQueries,\n subCommandIds,\n parentId,\n closeOnExecute,\n category,\n executeManually,\n };\n // Insert subcommands into the list\n if (subCommandIds.length > 0) {\n return {\n ...commandList,\n ...flattenCommands(subCommands, absoluteCommandId),\n };\n }\n return commandList;\n }, {});\n}\n","const PREFIX = '%c[COMMANDBAR]';\nconst logger = {\n ok: (message, ...args) => console.log(PREFIX, 'color: green', message, ...args),\n error: (message, ...args) => console.log(PREFIX, 'color: red', message, ...args),\n warn: (message, ...args) => console.warn(PREFIX, 'color: orange', message, ...args),\n debug: \n // @ts-ignore\n process.env.NODE_ENV === 'production'\n ? () => null\n : (message, ...args) => console.debug(PREFIX, 'color: lightblue', message, ...args),\n};\nexport default logger;\n","export default function clamp(value, min, max) {\n return Math.max(min, Math.min(max, value));\n}\n","/**\n* Copyright (c) 2023, Leon Sorokin\n* All rights reserved. (MIT Licensed)\n*\n* uFuzzy.js (μFuzzy)\n* A tiny, efficient fuzzy matcher that doesn't suck\n* https://github.com/leeoniya/uFuzzy (v1.0.3)\n*/\n\nconst cmp = new Intl.Collator('en').compare;\n\nconst inf = Infinity;\n\nconst NEGS_RE = /(?:\\s+|^)-[a-z\\d]+/ig;\n\nconst OPTS = {\n\t// term segmentation & punct/whitespace merging\n\tinterSplit: \"[^A-Za-z0-9']+\",\n\tintraSplit: '[a-z][A-Z]',\n\n\t// intra bounds that will be used to increase lft1/rgt1 info counters\n\tintraBound: '[A-Za-z][0-9]|[0-9][A-Za-z]|[a-z][A-Z]',\n\n\t// inter-bounds mode\n\t// 2 = strict (will only match 'man' on whitepace and punct boundaries: Mega Man, Mega_Man, mega.man)\n\t// 1 = loose (plus allowance for alpha-num and case-change boundaries: MegaMan, 0007man)\n\t// 0 = any (will match 'man' as any substring: megamaniac)\n\tinterLft: 0,\n\tinterRgt: 0,\n\n\t// allowance between terms\n\tinterChars: '.',\n\tinterIns: inf,\n\n\t// allowance between chars in terms\n\tintraChars: \"[a-z\\\\d']\", // internally case-insensitive\n\tintraIns: 0,\n\n\tintraContr: \"'[a-z]{1,2}\\\\b\",\n\n\t// multi-insert or single-error mode\n\tintraMode: 0,\n\n\t// single-error bounds for errors within terms, default requires exact first char\n\tintraSlice: [1, inf],\n\n\t// single-error tolerance toggles\n\tintraSub: 0,\n\tintraTrn: 0,\n\tintraDel: 0,\n\n\t// can post-filter matches that are too far apart in distance or length\n\t// (since intraIns is between each char, it can accum to nonsense matches)\n\tintraFilt: (term, match, index) => true, // should this also accept WIP info?\n\n\t// final sorting fn\n\tsort: (info, haystack, needle) => {\n\t\tlet {\n\t\t\tidx,\n\t\t\tchars,\n\t\t\tterms,\n\t\t\tinterLft2,\n\t\t\tinterLft1,\n\t\t//\tinterRgt2,\n\t\t//\tinterRgt1,\n\t\t\tstart,\n\t\t\tintraIns,\n\t\t\tinterIns,\n\t\t} = info;\n\n\t\treturn idx.map((v, i) => i).sort((ia, ib) => (\n\t\t\t// most contig chars matched\n\t\t\tchars[ib] - chars[ia] ||\n\t\t\t// least char intra-fuzz (most contiguous)\n\t\t\tintraIns[ia] - intraIns[ib] ||\n\t\t\t// most prefix bounds, boosted by full term matches\n\t\t\t(\n\t\t\t\t(terms[ib] + interLft2[ib] + 0.5 * interLft1[ib]) -\n\t\t\t\t(terms[ia] + interLft2[ia] + 0.5 * interLft1[ia])\n\t\t\t) ||\n\t\t\t// highest density of match (least span)\n\t\t//\tspan[ia] - span[ib] ||\n\t\t\t// highest density of match (least term inter-fuzz)\n\t\t\tinterIns[ia] - interIns[ib] ||\n\t\t\t// earliest start of match\n\t\t\tstart[ia] - start[ib] ||\n\t\t\t// alphabetic\n\t\t\tcmp(haystack[idx[ia]], haystack[idx[ib]])\n\t\t));\n\t},\n};\n\nconst lazyRepeat = (chars, limit) => (\n\tlimit == 0 ? '' :\n\tlimit == 1 ? chars + '??' :\n\tlimit == inf ? chars + '*?' :\n\t chars + `{0,${limit}}?`\n);\n\nconst mode2Tpl = '(?:\\\\b|_)';\n\nfunction uFuzzy(opts) {\n\topts = Object.assign({}, OPTS, opts);\n\n\tconst {\n\t\tinterLft,\n\t\tinterRgt,\n\t\tintraMode,\n\t\tintraSlice,\n\t\tintraIns,\n\t\tintraSub,\n\t\tintraTrn,\n\t\tintraDel,\n\t\tintraContr,\n\t\tintraSplit: _intraSplit,\n\t\tinterSplit: _interSplit,\n\t\tintraBound: _intraBound,\n\t\tintraChars,\n\t} = opts;\n\n\tlet { intraRules } = opts;\n\n\tif (intraRules == null) {\n\t\tintraRules = p => {\n\t\t\t// default is exact term matches only\n\t\t\tlet _intraSlice = OPTS.intraSlice, // requires first char\n\t\t\t\t_intraIns = 0,\n\t\t\t\t_intraSub = 0,\n\t\t\t\t_intraTrn = 0,\n\t\t\t\t_intraDel = 0;\n\n\t\t\tlet plen = p.length;\n\n\t\t\t// prevent junk matches by requiring stricter rules for short terms\n\t\t\tif (plen <= 4) {\n\t\t\t\tif (plen >= 3) {\n\t\t\t\t\t// one swap in non-first char when 3-4 chars\n\t\t\t\t\t_intraTrn = Math.min(intraTrn, 1);\n\n\t\t\t\t\t// or one insertion when 4 chars\n\t\t\t\t\tif (plen == 4)\n\t\t\t\t\t\t_intraIns = Math.min(intraIns, 1);\n\t\t\t\t}\n\t\t\t\t// else exact match when 1-2 chars\n\t\t\t}\n\t\t\t// use supplied opts\n\t\t\telse {\n\t\t\t\t_intraSlice = intraSlice;\n\t\t\t\t_intraIns = intraIns,\n\t\t\t\t_intraSub = intraSub,\n\t\t\t\t_intraTrn = intraTrn,\n\t\t\t\t_intraDel = intraDel;\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\tintraSlice: _intraSlice,\n\t\t\t\tintraIns: _intraIns,\n\t\t\t\tintraSub: _intraSub,\n\t\t\t\tintraTrn: _intraTrn,\n\t\t\t\tintraDel: _intraDel,\n\t\t\t};\n\t\t};\n\t}\n\n\tlet withIntraSplit = !!_intraSplit;\n\n\tlet intraSplit = new RegExp(_intraSplit, 'g');\n\tlet interSplit = new RegExp(_interSplit, 'g');\n\n\tlet trimRe = new RegExp('^' + _interSplit + '|' + _interSplit + '$', 'g');\n\tlet contrsRe = new RegExp(intraContr, 'gi');\n\n\tconst split = needle => {\n\t\tneedle = needle.replace(trimRe, '').toLowerCase();\n\n\t\tif (withIntraSplit)\n\t\t\tneedle = needle.replace(intraSplit, m => m[0] + ' ' + m[1]);\n\n\t\treturn needle.split(interSplit).filter(t => t != '');\n\t};\n\n\tconst prepQuery = (needle, capt = 0, interOR = false) => {\n\t\t// split on punct, whitespace, num-alpha, and upper-lower boundaries\n\t\tlet parts = split(needle);\n\n\t\tif (parts.length == 0)\n\t\t\tthrow `Empty needle!`;\n\n\t\t// split out any detected contractions for each term that become required suffixes\n\t\tlet contrs = Array(parts.length).fill('');\n\t\tparts = parts.map((p, pi) => p.replace(contrsRe, m => {\n\t\t\tcontrs[pi] = m;\n\t\t\treturn '';\n\t\t}));\n\n\t\t// array of regexp tpls for each term\n\t\tlet reTpl;\n\n\t\t// allows single mutations within each term\n\t\tif (intraMode == 1) {\n\t\t\treTpl = parts.map((p, pi) => {\n\t\t\t\tlet {\n\t\t\t\t\tintraSlice,\n\t\t\t\t\tintraIns,\n\t\t\t\t\tintraSub,\n\t\t\t\t\tintraTrn,\n\t\t\t\t\tintraDel,\n\t\t\t\t} = intraRules(p);\n\n\t\t\t\tif (intraIns + intraSub + intraTrn + intraDel == 0)\n\t\t\t\t\treturn p + contrs[pi];\n\n\t\t\t\tlet [lftIdx, rgtIdx] = intraSlice;\n\t\t\t\tlet lftChar = p.slice(0, lftIdx); // prefix\n\t\t\t\tlet rgtChar = p.slice(rgtIdx); // suffix\n\n\t\t\t\tlet chars = p.slice(lftIdx, rgtIdx);\n\n\t\t\t\t// neg lookahead to prefer matching 'Test' instead of 'tTest' in ManifestTest or fittest\n\t\t\t\t// but skip when search term contains leading repetition (aardvark, aaa)\n\t\t\t\tif (intraIns == 1 && lftChar.length == 1 && lftChar != chars[0])\n\t\t\t\t\tlftChar += '(?!' + lftChar + ')';\n\n\t\t\t\tlet numChars = chars.length;\n\n\t\t\t\tlet variants = [];\n\n\t\t\t\t// variants with single char substitutions\n\t\t\t\tif (intraSub) {\n\t\t\t\t\tfor (let i = 0; i < numChars; i++)\n\t\t\t\t\t\tvariants.push(lftChar + chars.slice(0, i) + intraChars + chars.slice(i + 1) + rgtChar);\n\t\t\t\t}\n\n\t\t\t\t// variants with single transpositions\n\t\t\t\tif (intraTrn) {\n\t\t\t\t\tfor (let i = 0; i < numChars - 1; i++) {\n\t\t\t\t\t\tif (chars[i] != chars[i+1])\n\t\t\t\t\t\t\tvariants.push(lftChar + chars.slice(0, i) + chars[i+1] + chars[i] + chars.slice(i + 2) + rgtChar);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// variants with single char omissions\n\t\t\t\tif (intraDel) {\n\t\t\t\t\tfor (let i = 0; i < numChars; i++)\n\t\t\t\t\t\tvariants.push(lftChar + chars.slice(0, i + 1) + '?' + chars.slice(i + 1) + rgtChar);\n\t\t\t\t}\n\n\t\t\t\t// variants with single char insertions\n\t\t\t\tif (intraIns) {\n\t\t\t\t\tlet intraInsTpl = lazyRepeat(intraChars, 1);\n\n\t\t\t\t\tfor (let i = 0; i < numChars; i++)\n\t\t\t\t\t\tvariants.push(lftChar + chars.slice(0, i) + intraInsTpl + chars.slice(i) + rgtChar);\n\t\t\t\t}\n\n\t\t\t\tlet reTpl = '(?:' + p + '|' + variants.join('|') + ')' + contrs[pi];\n\n\t\t\t//\tconsole.log(reTpl);\n\n\t\t\t\treturn reTpl;\n\t\t\t});\n\t\t}\n\t\telse {\n\t\t\tlet intraInsTpl = lazyRepeat(intraChars, intraIns);\n\n\t\t\t// capture at char level\n\t\t\tif (capt == 2 && intraIns > 0) {\n\t\t\t\t// sadly, we also have to capture the inter-term junk via parenth-wrapping .*?\n\t\t\t\t// to accum other capture groups' indices for \\b boosting during scoring\n\t\t\t\tintraInsTpl = ')(' + intraInsTpl + ')(';\n\t\t\t}\n\n\t\t\treTpl = parts.map((p, pi) => p.split('').map((c, i, chars) => {\n\t\t\t\t// neg lookahead to prefer matching 'Test' instead of 'tTest' in ManifestTest or fittest\n\t\t\t\t// but skip when search term contains leading repetition (aardvark, aaa)\n\t\t\t\tif (intraIns == 1 && i == 0 && chars.length > 1 && c[i] != c[i+1])\n\t\t\t\t\tc += '(?!' + c + ')';\n\n\t\t\t\treturn c;\n\t\t\t}).join(intraInsTpl) + contrs[pi]);\n\t\t}\n\n\t//\tconsole.log(reTpl);\n\n\t\t// this only helps to reduce initial matches early when they can be detected\n\t\t// TODO: might want a mode 3 that excludes _\n\t\tlet preTpl = interLft == 2 ? mode2Tpl : '';\n\t\tlet sufTpl = interRgt == 2 ? mode2Tpl : '';\n\n\t\tlet interCharsTpl = sufTpl + lazyRepeat(opts.interChars, opts.interIns) + preTpl;\n\n\t\t// capture at word level\n\t\tif (capt > 0) {\n\t\t\tif (interOR) {\n\t\t\t\t// this is basically for doing .matchAll() occurence counting and highlighting without needing permuted ooo needles\n\t\t\t\treTpl = preTpl + '(' + reTpl.join(')' + sufTpl + '|' + preTpl + '(') + ')' + sufTpl;\n\t\t\t}\n\t\t\telse {\n\t\t\t\t// sadly, we also have to capture the inter-term junk via parenth-wrapping .*?\n\t\t\t\t// to accum other capture groups' indices for \\b boosting during scoring\n\t\t\t\treTpl = '(' + reTpl.join(')(' + interCharsTpl + ')(') + ')';\n\t\t\t\treTpl = '(.?' + preTpl + ')' + reTpl + '(' + sufTpl + '.*)'; // nit: trailing capture here assumes interIns = Inf\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\treTpl = reTpl.join(interCharsTpl);\n\t\t\treTpl = preTpl + reTpl + sufTpl;\n\t\t}\n\n\t//\tconsole.log(reTpl);\n\n\t\treturn [new RegExp(reTpl, 'i'), parts, contrs];\n\t};\n\n\tconst filter = (haystack, needle, idxs) => {\n\n\t\tlet out = [];\n\t\tlet [query] = prepQuery(needle);\n\n\t\tif (idxs != null) {\n\t\t\tfor (let i = 0; i < idxs.length; i++) {\n\t\t\t\tlet idx = idxs[i];\n\t\t\t\tquery.test(haystack[idx]) && out.push(idx);\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\tfor (let i = 0; i < haystack.length; i++)\n\t\t\t\tquery.test(haystack[i]) && out.push(i);\n\t\t}\n\n\t\treturn out;\n\t};\n\n\tlet withIntraBound = !!_intraBound;\n\n\tlet interBound = new RegExp(_interSplit);\n\tlet intraBound = new RegExp(_intraBound);\n\n\tconst info = (idxs, haystack, needle) => {\n\n\t\tlet [query, parts, contrs] = prepQuery(needle, 1);\n\t\tlet [queryR] = prepQuery(needle, 2);\n\t\tlet partsLen = parts.length;\n\n\t\tlet len = idxs.length;\n\n\t\tlet field = Array(len).fill(0);\n\n\t\tlet info = {\n\t\t\t// idx in haystack\n\t\t\tidx: Array(len),\n\n\t\t\t// start of match\n\t\t\tstart: field.slice(),\n\t\t\t// length of match\n\t\t//\tspan: field.slice(),\n\n\t\t\t// contiguous chars matched\n\t\t\tchars: field.slice(),\n\n\t\t\t// contiguous (no fuzz) and bounded terms (intra=0, lft2/1, rgt2/1)\n\t\t\t// excludes terms that are contiguous but have < 2 bounds (substrings)\n\t\t\tterms: field.slice(),\n\n\t\t\t// cumulative length of unmatched chars (fuzz) within span\n\t\t\tinterIns: field.slice(), // between terms\n\t\t\tintraIns: field.slice(), // within terms\n\n\t\t\t// interLft/interRgt counters\n\t\t\tinterLft2: field.slice(),\n\t\t\tinterRgt2: field.slice(),\n\t\t\tinterLft1: field.slice(),\n\t\t\tinterRgt1: field.slice(),\n\n\t\t\tranges: Array(len),\n\t\t};\n\n\t\t// might discard idxs based on bounds checks\n\t\tlet mayDiscard = interLft == 1 || interRgt == 1;\n\n\t\tlet ii = 0;\n\n\t\tfor (let i = 0; i < idxs.length; i++) {\n\t\t\tlet mhstr = haystack[idxs[i]];\n\n\t\t\t// the matched parts are [full, junk, term, junk, term, junk]\n\t\t\tlet m = mhstr.match(query);\n\n\t\t\t// leading junk\n\t\t\tlet start = m.index + m[1].length;\n\n\t\t\tlet idxAcc = start;\n\t\t//\tlet span = m[0].length;\n\n\t\t\tlet disc = false;\n\t\t\tlet lft2 = 0;\n\t\t\tlet lft1 = 0;\n\t\t\tlet rgt2 = 0;\n\t\t\tlet rgt1 = 0;\n\t\t\tlet chars = 0;\n\t\t\tlet terms = 0;\n\t\t\tlet inter = 0;\n\t\t\tlet intra = 0;\n\n\t\t\tlet refine = [];\n\n\t\t\tfor (let j = 0, k = 2; j < partsLen; j++, k+=2) {\n\t\t\t\tlet group = m[k].toLowerCase();\n\t\t\t\tlet term = parts[j] + contrs[j];\n\t\t\t\tlet termLen = term.length;\n\t\t\t\tlet groupLen = group.length;\n\t\t\t\tlet fullMatch = group == term;\n\n\t\t\t\t// this won't handle the case when an exact match exists across the boundary of the current group and the next junk\n\t\t\t\t// e.g. blob,ob when searching for 'bob' but finding the earlier `blob` (with extra insertion)\n\t\t\t\tif (!fullMatch && m[k+1].length >= termLen) {\n\t\t\t\t\t// probe for exact match in inter junk\n\t\t\t\t\tlet idxOf = m[k+1].toLowerCase().indexOf(term);\n\n\t\t\t\t\tif (idxOf > -1) {\n\t\t\t\t\t\trefine.push(idxAcc, idxOf, termLen);\n\t\t\t\t\t\tidxAcc += refineMatch(m, k, idxOf, termLen);\n\t\t\t\t\t\tgroup = term;\n\t\t\t\t\t\tgroupLen = termLen;\n\t\t\t\t\t\tfullMatch = true;\n\n\t\t\t\t\t\tif (j == 0)\n\t\t\t\t\t\t\tstart = idxAcc;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (mayDiscard || fullMatch) {\n\t\t\t\t\t// does group's left and/or right land on \\b\n\t\t\t\t\tlet lftCharIdx = idxAcc - 1;\n\t\t\t\t\tlet rgtCharIdx = idxAcc + groupLen;\n\n\t\t\t\t\tlet isPre = true;\n\t\t\t\t\tlet isSuf = true;\n\n\t\t\t\t\t// prefix info\n\t\t\t\t\tif (lftCharIdx == -1 || interBound.test(mhstr[lftCharIdx]))\n\t\t\t\t\t\tfullMatch && lft2++;\n\t\t\t\t\telse {\n\t\t\t\t\t\tif (interLft == 2) {\n\t\t\t\t\t\t\tdisc = true;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (withIntraBound && intraBound.test(mhstr[lftCharIdx] + mhstr[lftCharIdx + 1]))\n\t\t\t\t\t\t\tfullMatch && lft1++;\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tif (interLft == 1) {\n\t\t\t\t\t\t\t\t// regexps are eager, so try to improve the match by probing forward inter junk for exact match at a boundary\n\t\t\t\t\t\t\t\tlet junk = m[k+1];\n\t\t\t\t\t\t\t\tlet junkIdx = idxAcc + groupLen;\n\n\t\t\t\t\t\t\t\tif (junk.length >= termLen) {\n\t\t\t\t\t\t\t\t\tlet idxOf = 0;\n\t\t\t\t\t\t\t\t\tlet found = false;\n\t\t\t\t\t\t\t\t\tlet re = new RegExp(term, 'ig');\n\n\t\t\t\t\t\t\t\t\tlet m2;\n\t\t\t\t\t\t\t\t\twhile (m2 = re.exec(junk)) {\n\t\t\t\t\t\t\t\t\t\tidxOf = m2.index;\n\n\t\t\t\t\t\t\t\t\t\tlet charIdx = junkIdx + idxOf;\n\t\t\t\t\t\t\t\t\t\tlet lftCharIdx = charIdx - 1;\n\n\n\t\t\t\t\t\t\t\t\t\tif (lftCharIdx == -1 || interBound.test(mhstr[lftCharIdx])) {\n\t\t\t\t\t\t\t\t\t\t\tlft2++;\n\t\t\t\t\t\t\t\t\t\t\tfound = true;\n\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\telse if (intraBound.test(mhstr[lftCharIdx] + mhstr[charIdx])) {\n\t\t\t\t\t\t\t\t\t\t\tlft1++;\n\t\t\t\t\t\t\t\t\t\t\tfound = true;\n\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tif (found) {\n\t\t\t\t\t\t\t\t\t\t// identical to exact term refinement pass above\n\t\t\t\t\t\t\t\t\t\trefine.push(idxAcc, idxOf, termLen);\n\t\t\t\t\t\t\t\t\t\tidxAcc += refineMatch(m, k, idxOf, termLen);\n\t\t\t\t\t\t\t\t\t\tgroup = term;\n\t\t\t\t\t\t\t\t\t\tgroupLen = termLen;\n\t\t\t\t\t\t\t\t\t\tfullMatch = true;\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tdisc = true;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tisPre = false;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// suffix info\n\t\t\t\t\tif (rgtCharIdx == mhstr.length || interBound.test(mhstr[rgtCharIdx]))\n\t\t\t\t\t\tfullMatch && rgt2++;\n\t\t\t\t\telse {\n\t\t\t\t\t\tif (interRgt == 2) {\n\t\t\t\t\t\t\tdisc = true;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (withIntraBound && intraBound.test(mhstr[rgtCharIdx - 1] + mhstr[rgtCharIdx]))\n\t\t\t\t\t\t\tfullMatch && rgt1++;\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tif (interRgt == 1) {\n\t\t\t\t\t\t\t\tdisc = true;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tisSuf = false;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif (fullMatch) {\n\t\t\t\t\t\tchars += termLen;\n\n\t\t\t\t\t\tif (isPre && isSuf)\n\t\t\t\t\t\t\tterms++;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (groupLen > termLen)\n\t\t\t\t\tintra += groupLen - termLen; // intraFuzz\n\n\t\t\t\tif (j > 0)\n\t\t\t\t\tinter += m[k-1].length; // interFuzz\n\n\t\t\t\t// TODO: group here is lowercased, which is okay for length cmp, but not more case-sensitive filts\n\t\t\t\tif (!opts.intraFilt(term, group, idxAcc)) {\n\t\t\t\t\tdisc = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tif (j < partsLen - 1)\n\t\t\t\t\tidxAcc += groupLen + m[k+1].length;\n\t\t\t}\n\n\t\t\tif (!disc) {\n\t\t\t\tinfo.idx[ii] = idxs[i];\n\t\t\t\tinfo.interLft2[ii] = lft2;\n\t\t\t\tinfo.interLft1[ii] = lft1;\n\t\t\t\tinfo.interRgt2[ii] = rgt2;\n\t\t\t\tinfo.interRgt1[ii] = rgt1;\n\t\t\t\tinfo.chars[ii] = chars;\n\t\t\t\tinfo.terms[ii] = terms;\n\t\t\t\tinfo.interIns[ii] = inter;\n\t\t\t\tinfo.intraIns[ii] = intra;\n\n\t\t\t\tinfo.start[ii] = start;\n\t\t\t//\tinfo.span[ii] = span;\n\n\t\t\t\t// ranges\n\t\t\t\tlet m = mhstr.match(queryR);\n\t\t\t\tlet ranges = info.ranges[ii] = [];\n\n\t\t\t\tlet idxAcc = m.index + m[1].length;\n\t\t\t\tlet from = idxAcc;\n\t\t\t\tlet to = idxAcc;\n\n\t\t\t\tlet refLen = refine.length;\n\t\t\t\tlet ri = refLen > 0 ? 0 : Infinity;\n\t\t\t\tlet lastRi = refLen - 3;\n\n\t\t\t\tfor (let i = 2; i < m.length; i++) {\n\t\t\t\t\tlet len = m[i].length;\n\n\t\t\t\t\tif (ri <= lastRi && refine[ri] == idxAcc) {\n\t\t\t\t\t\tlet idxInNext = refine[ri+1];\n\t\t\t\t\t\tlet matchLen = refine[ri+2];\n\t\t\t\t\t\tlet offset = idxInNext + matchLen;\n\n\t\t\t\t\t\tidxAcc += len + offset;\n\t\t\t\t\t\tfrom = idxAcc - matchLen;\n\t\t\t\t\t\tm[i+1] = m[i+1].slice(offset);\n\n\t\t\t\t\t\tri+=3;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t\tidxAcc += len;\n\n\t\t\t\t\tif (i % 2 == 0)\n\t\t\t\t\t\tto = idxAcc;\n\t\t\t\t\telse if (len > 0) {\n\t\t\t\t\t\tranges.push(from, to);\n\t\t\t\t\t\tfrom = to = idxAcc;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (to > from)\n\t\t\t\t\tranges.push(from, to);\n\n\t\t\t\tii++;\n\t\t\t}\n\t\t}\n\n\t\t// trim arrays\n\t\tif (ii < idxs.length) {\n\t\t\tfor (let k in info)\n\t\t\t\tinfo[k] = info[k].slice(0, ii);\n\t\t}\n\n\t\treturn info;\n\t};\n\n\tconst refineMatch = (m, k, idxInNext, termLen) => {\n\t\t// shift the current group into the prior junk\n\t\tlet prepend = m[k] + m[k+1].slice(0, idxInNext);\n\t\tm[k-1] += prepend;\n\t\tm[k] = m[k+1].slice(idxInNext, idxInNext + termLen);\n\t\tm[k+1] = m[k+1].slice(idxInNext + termLen);\n\t\treturn prepend.length;\n\t};\n\n\t// returns [idxs, info, order]\n\tconst _search = (haystack, needle, outOfOrder = false, infoThresh = 1e3, preFiltered) => {\n\t\tlet needles = null;\n\t\tlet matches = null;\n\n\t\tlet negs = [];\n\n\t\tneedle = needle.replace(NEGS_RE, m => {\n\t\t\tnegs.push(m.trim().slice(1));\n\t\t\treturn '';\n\t\t});\n\n\t\tlet negsRe;\n\n\t\tif (negs.length > 0) {\n\t\t\tnegsRe = new RegExp(negs.join('|'), 'i');\n\n\t\t\tif (needle.trim() == '') {\n\t\t\t\tlet idxs = [];\n\n\t\t\t\tfor (let i = 0; i < haystack.length; i++) {\n\t\t\t\t\tif (!negsRe.test(haystack[i]))\n\t\t\t\t\t\tidxs.push(i);\n\t\t\t\t}\n\n\t\t\t\treturn [idxs, null, null];\n\t\t\t}\n\t\t}\n\n\t//\tconsole.log(negs);\n\t//\tconsole.log(needle);\n\n\t\tif (outOfOrder) {\n\t\t\t// since uFuzzy is an AND-based search, we can iteratively pre-reduce the haystack by searching\n\t\t\t// for each term in isolation before running permutations on what's left.\n\t\t\t// this is a major perf win. e.g. searching \"test man ger pp a\" goes from 570ms -> 14ms\n\t\t\tlet terms = split(needle);\n\n\t\t\tif (terms.length > 1) {\n\t\t\t\t// longest -> shortest\n\t\t\t\tlet terms2 = terms.slice().sort((a, b) => b.length - a.length);\n\n\t\t\t\tfor (let ti = 0; ti < terms2.length; ti++) {\n\t\t\t\t\t// no haystack item contained all terms\n\t\t\t\t\tif (preFiltered && preFiltered.length == 0)\n\t\t\t\t\t\treturn [[], null, null];\n\n\t\t\t\t\tpreFiltered = filter(haystack, terms2[ti], preFiltered);\n\t\t\t\t}\n\n\t\t\t\tneedles = permute(terms).map(perm => perm.join(' '));\n\n\t\t\t\t// filtered matches for each needle excluding same matches for prior needles\n\t\t\t\tmatches = [];\n\n\t\t\t\t// keeps track of already-matched idxs to skip in follow-up permutations\n\t\t\t\tlet matchedIdxs = new Set();\n\n\t\t\t\tfor (let ni = 0; ni < needles.length; ni++) {\n\t\t\t\t\tif (matchedIdxs.size < preFiltered.length) {\n\t\t\t\t\t\t// filter further for this needle, exclude already-matched\n\t\t\t\t\t\tlet preFiltered2 = preFiltered.filter(idx => !matchedIdxs.has(idx));\n\n\t\t\t\t\t\tlet matched = filter(haystack, needles[ni], preFiltered2);\n\n\t\t\t\t\t\tfor (let j = 0; j < matched.length; j++)\n\t\t\t\t\t\t\tmatchedIdxs.add(matched[j]);\n\n\t\t\t\t\t\tmatches.push(matched);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t\tmatches.push([]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// interOR\n\t//\tconsole.log(prepQuery(needle, 1, null, true));\n\n\t\t// non-ooo or ooo w/single term\n\t\tif (needles == null) {\n\t\t\tneedles = [needle];\n\t\t\tmatches = [preFiltered && preFiltered.length > 0 ? preFiltered : filter(haystack, needle)];\n\t\t}\n\n\t\tlet retInfo = null;\n\t\tlet retOrder = null;\n\n\t\tif (negs.length > 0)\n\t\t\tmatches = matches.map(idxs => idxs.filter(idx => !negsRe.test(haystack[idx])));\n\n\t\tlet matchCount = matches.reduce((acc, idxs) => acc + idxs.length, 0);\n\n\t\t// rank, sort, concat\n\t\tif (matchCount <= infoThresh) {\n\t\t\tretInfo = {};\n\t\t\tretOrder = [];\n\n\t\t\tfor (let ni = 0; ni < matches.length; ni++) {\n\t\t\t\tlet idxs = matches[ni];\n\n\t\t\t\tif (idxs == null || idxs.length == 0)\n\t\t\t\t\tcontinue;\n\n\t\t\t\tlet needle = needles[ni];\n\t\t\t\tlet _info = info(idxs, haystack, needle);\n\t\t\t\tlet order = opts.sort(_info, haystack, needle);\n\n\t\t\t\t// offset idxs for concat'ing infos\n\t\t\t\tif (ni > 0) {\n\t\t\t\t\tfor (let i = 0; i < order.length; i++)\n\t\t\t\t\t\torder[i] += retOrder.length;\n\t\t\t\t}\n\n\t\t\t\tfor (let k in _info) {\n\t\t\t\t\tretInfo[k] = (retInfo[k] ? retInfo[k] : []).concat(_info[k]);\n }\n\n\t\t\t\tretOrder = retOrder.concat(order);\n\t\t\t}\n\t\t}\n\n\t\treturn [\n\t\t\t[].concat(...matches),\n\t\t\tretInfo,\n\t\t\tretOrder,\n\t\t];\n\t};\n\n\treturn {\n\t\tsearch: (...args) => {\n\t\t\tlet out = _search(...args);\n\t\t\treturn out;\n\t\t},\n\t\tsplit,\n\t\tfilter,\n\t\tinfo,\n\t\tsort: opts.sort,\n\t};\n}\n\nconst latinize = (() => {\n\tlet accents = {\n\t\tA: 'ÁÀÃÂÄĄ',\n\t\ta: 'áàãâäą',\n\t\tE: 'ÉÈÊËĖ',\n\t\te: 'éèêëę',\n\t\tI: 'ÍÌÎÏĮ',\n\t\ti: 'íìîïį',\n\t\tO: 'ÓÒÔÕÖ',\n\t\to: 'óòôõö',\n\t\tU: 'ÚÙÛÜŪŲ',\n\t\tu: 'úùûüūų',\n\t\tC: 'ÇČ',\n\t\tc: 'çč',\n\t\tN: 'Ñ',\n\t\tn: 'ñ',\n\t\tS: 'Š',\n\t\ts: 'š'\n\t};\n\n\tlet accentsMap = new Map();\n\tlet accentsTpl = '';\n\n\tfor (let r in accents) {\n\t\taccents[r].split('').forEach(a => {\n\t\t\taccentsTpl += a;\n\t\t\taccentsMap.set(a, r);\n\t\t});\n\t}\n\n\tlet accentsRe = new RegExp(`[${accentsTpl}]`, 'g');\n\tlet replacer = m => accentsMap.get(m);\n\n\treturn strings => {\n\t\tif (typeof strings == 'string')\n\t\t\treturn strings.replace(accentsRe, replacer);\n\n\t\tlet out = Array(strings.length);\n\t\tfor (let i = 0; i < strings.length; i++)\n\t\t\tout[i] = strings[i].replace(accentsRe, replacer);\n\t\treturn out;\n\t};\n})();\n\n// https://stackoverflow.com/questions/9960908/permutations-in-javascript/37580979#37580979\nfunction permute(arr) {\n\tarr = arr.slice();\n\n\tlet length = arr.length,\n\t\tresult = [arr.slice()],\n\t\tc = new Array(length).fill(0),\n\t\ti = 1, k, p;\n\n\twhile (i < length) {\n\t\tif (c[i] < i) {\n\t\t\tk = i % 2 && c[i];\n\t\t\tp = arr[i];\n\t\t\tarr[i] = arr[k];\n\t\t\tarr[k] = p;\n\t\t\t++c[i];\n\t\t\ti = 1;\n\t\t\tresult.push(arr.slice());\n\t\t} else {\n\t\t\tc[i] = 0;\n\t\t\t++i;\n\t\t}\n\t}\n\n\treturn result;\n}\n\nconst _mark = (part, matched) => matched ? `${part}` : part;\nconst _append = (acc, part) => acc + part;\n\nfunction highlight(str, ranges, mark = _mark, accum = '', append = _append) {\n let tmp = append(accum, mark(str.substring(0, ranges[0]), false));\n\taccum = tmp !== null ? tmp : accum;\n\n\tfor (let i = 0; i < ranges.length; i+=2) {\n\t\tlet fr = ranges[i];\n\t\tlet to = ranges[i+1];\n\n tmp = append(accum, mark(str.substring(fr, to), true));\n\t\taccum = tmp !== null ? tmp : accum;\n\n\t\tif (i < ranges.length - 3) {\n tmp = append(accum, mark(str.substring(ranges[i + 1], ranges[i + 2]), false));\n accum = tmp !== null ? tmp : accum;\n }\n\t}\n\n tmp = append(accum, mark(str.substring(ranges[ranges.length - 1]), false));\n\taccum = tmp !== null ? tmp : accum;\n\n\treturn accum;\n}\n\nuFuzzy.latinize = latinize;\nuFuzzy.permute = arr => {\n\tlet idxs = permute([...Array(arr.length).keys()]).sort((a,b) => {\n\t\tfor (let i = 0; i < a.length; i++) {\n\t\t\tif (a[i] != b[i])\n\t\t\t\treturn a[i] - b[i];\n\t\t}\n\t\treturn 0;\n\t});\n\n\treturn idxs.map(pi => pi.map(i => arr[i]));\n};\nuFuzzy.highlight = highlight;\n\nexport { uFuzzy as default };\n","import uFuzzy from '@leeoniya/ufuzzy';\n// See https://github.com/leeoniya/uFuzzy#options\nconst uf = new uFuzzy({\n intraMode: 1,\n intraIns: 1,\n intraSub: 1,\n intraTrn: 1,\n intraDel: 1,\n});\nfunction sortCommands(a, b, favouriteCommands, recentCommands) {\n // Sort by recent first\n const aIsRecent = recentCommands.includes(a.id);\n const bIsRecent = recentCommands.includes(b.id);\n if (aIsRecent && !bIsRecent) {\n return -1;\n }\n if (!aIsRecent && bIsRecent) {\n return 1;\n }\n if (aIsRecent && bIsRecent) {\n return recentCommands.indexOf(a.id) - recentCommands.indexOf(b.id);\n }\n // Sort by favourites second\n const aIsFavourite = favouriteCommands.includes(a.id);\n const bIsFavourite = favouriteCommands.includes(b.id);\n if (aIsFavourite && !bIsFavourite) {\n return -1;\n }\n if (!aIsFavourite && bIsFavourite) {\n return 1;\n }\n // Sort by name third\n return a.name.localeCompare(b.name);\n}\nexport default function filterCommands(selectedCommandGroup, searchWord, commands, favourites, recentCommands) {\n // If there is a search word, return all commands to allow deep search\n // If no search word is given, return all commands in the currently selected group or all recent commands if no group is selected\n let availableCommands = Object.values(commands);\n availableCommands = searchWord\n ? availableCommands\n : availableCommands.filter((command) => command.parentId === selectedCommandGroup ||\n (!selectedCommandGroup && recentCommands.includes(command.id)));\n // If there is no search word, return all commands in the current context with favourites first, the recent commands will only be prioritised if we are at the top level\n if (!searchWord) {\n return availableCommands\n .sort((a, b) => sortCommands(a, b, favourites, selectedCommandGroup ? [] : recentCommands))\n .map((command) => command.id);\n }\n // Create a list of all available commands with their name and description as haystack for the search\n const availableCommandNames = availableCommands.map(({ name, description }) => name + ' ' + description);\n const [indices, , order] = uf.search(availableCommandNames, searchWord.toLowerCase());\n const matchingIds = order.map((i) => availableCommands[indices[i]].id);\n // Add all commands that can handle queries to the result, the Set removes duplicates\n return matchingIds;\n}\n","export default function assert(condition, message = 'Assertion failed') {\n if (condition === false)\n throw Error(message);\n}\n","export default function classnames(...args) {\n return args.filter(Boolean).join(' ');\n}\n","import { logger } from '../helpers';\nexport var STATUS;\n(function (STATUS) {\n STATUS[\"COLLAPSED\"] = \"collapsed\";\n STATUS[\"IDLE\"] = \"idle\";\n STATUS[\"EXECUTING_COMMAND\"] = \"executingCommand\";\n STATUS[\"DISPLAYING_RESULT\"] = \"displayingResult\";\n})(STATUS || (STATUS = {}));\nexport var TRANSITION;\n(function (TRANSITION) {\n TRANSITION[\"RESET_SEARCH\"] = \"RESET_SEARCH\";\n TRANSITION[\"HIGHLIGHT_NEXT_ITEM\"] = \"HIGHLIGHT_NEXT_ITEM\";\n TRANSITION[\"HIGHLIGHT_PREVIOUS_ITEM\"] = \"HIGHLIGHT_PREVIOUS_ITEM\";\n TRANSITION[\"CANCEL\"] = \"CANCEL\";\n TRANSITION[\"SELECT_GROUP\"] = \"SELECT_GROUP\";\n TRANSITION[\"GO_TO_PARENT_GROUP\"] = \"GO_TO_PARENT_GROUP\";\n TRANSITION[\"UPDATE_SEARCH\"] = \"UPDATE_SEARCH\";\n TRANSITION[\"UPDATE_COMMAND_QUERY\"] = \"UPDATE_COMMAND_QUERY\";\n TRANSITION[\"EXECUTE_COMMAND\"] = \"EXECUTE_COMMAND\";\n TRANSITION[\"FINISH_COMMAND\"] = \"FINISH_COMMAND\";\n TRANSITION[\"UPDATE_RESULT\"] = \"UPDATE_RESULT\";\n TRANSITION[\"EXPAND\"] = \"EXPAND\";\n TRANSITION[\"ADD_FAVOURITE\"] = \"ADD_FAVOURITE\";\n TRANSITION[\"REMOVE_FAVOURITE\"] = \"REMOVE_FAVOURITE\";\n})(TRANSITION || (TRANSITION = {}));\nexport var ACTION;\n(function (ACTION) {\n ACTION[\"ADD_FAVOURITE\"] = \"ADD_FAVOURITE\";\n ACTION[\"ADD_RECENTLY_USED\"] = \"ADD_RECENTLY_USED\";\n ACTION[\"EXPAND\"] = \"EXPAND\";\n ACTION[\"HIGHLIGHT_NEXT_COMMAND\"] = \"HIGHLIGHT_NEXT_COMMAND\";\n ACTION[\"HIGHLIGHT_NEXT_OPTION\"] = \"HIGHLIGHT_NEXT_OPTION\";\n ACTION[\"HIGHLIGHT_PREVIOUS_COMMAND\"] = \"HIGHLIGHT_PREVIOUS_COMMAND\";\n ACTION[\"HIGHLIGHT_PREVIOUS_OPTION\"] = \"HIGHLIGHT_PREVIOUS_OPTION\";\n ACTION[\"LEAVE_GROUP\"] = \"LEAVE_GROUP\";\n ACTION[\"REFRESH_COMMANDS\"] = \"REFRESH_COMMANDS\";\n ACTION[\"REMOVE_FAVOURITE\"] = \"REMOVE_FAVOURITE\";\n ACTION[\"RESET_HIGHLIGHT\"] = \"RESET_HIGHLIGHT\";\n ACTION[\"RESET_OPTION_HIGHLIGHT\"] = \"RESET_OPTION_HIGHLIGHT\";\n ACTION[\"RESET_SEARCH\"] = \"RESET_SEARCH\";\n ACTION[\"RESET_SEARCH_OR_LEAVE_GROUP\"] = \"RESET_SEARCH_OR_LEAVE_GROUP\";\n ACTION[\"SET_ACTIVE_COMMAND\"] = \"SET_ACTIVE_COMMAND\";\n ACTION[\"SET_COMMAND_QUERY\"] = \"SET_COMMAND_QUERY\";\n ACTION[\"SET_GROUP\"] = \"SET_GROUP\";\n ACTION[\"SET_SEARCH_WORD\"] = \"SET_SEARCH_WORD\";\n ACTION[\"UNSET_ACTIVE_COMMAND\"] = \"UNSET_ACTIVE_COMMAND\";\n ACTION[\"UNSET_RESULT\"] = \"UNSET_RESULT\";\n ACTION[\"UPDATE_RESULT\"] = \"UPDATE_RESULT\";\n})(ACTION || (ACTION = {}));\nexport const machine = {\n initial: STATUS.COLLAPSED,\n states: {\n collapsed: {\n on: {\n UPDATE_SEARCH: {\n target: STATUS.IDLE,\n actions: [ACTION.EXPAND, ACTION.SET_SEARCH_WORD, ACTION.REFRESH_COMMANDS],\n },\n HIGHLIGHT_NEXT_ITEM: {\n target: STATUS.IDLE,\n actions: [ACTION.REFRESH_COMMANDS, ACTION.EXPAND],\n },\n EXPAND: {\n target: STATUS.IDLE,\n actions: [ACTION.REFRESH_COMMANDS, ACTION.EXPAND],\n },\n },\n },\n idle: {\n on: {\n UPDATE_SEARCH: {\n target: STATUS.IDLE,\n actions: [ACTION.SET_SEARCH_WORD, ACTION.RESET_HIGHLIGHT, ACTION.REFRESH_COMMANDS],\n },\n HIGHLIGHT_NEXT_ITEM: {\n target: STATUS.IDLE,\n actions: [ACTION.HIGHLIGHT_NEXT_COMMAND],\n },\n HIGHLIGHT_PREVIOUS_ITEM: {\n target: STATUS.IDLE,\n actions: [ACTION.HIGHLIGHT_PREVIOUS_COMMAND],\n },\n CANCEL: {\n target: STATUS.IDLE,\n actions: [ACTION.RESET_HIGHLIGHT, ACTION.RESET_SEARCH_OR_LEAVE_GROUP, ACTION.REFRESH_COMMANDS],\n },\n EXECUTE_COMMAND: {\n target: STATUS.EXECUTING_COMMAND,\n actions: [ACTION.ADD_RECENTLY_USED, ACTION.SET_ACTIVE_COMMAND, ACTION.REFRESH_COMMANDS],\n },\n GO_TO_PARENT_GROUP: {\n target: STATUS.IDLE,\n actions: [ACTION.RESET_HIGHLIGHT, ACTION.LEAVE_GROUP, ACTION.REFRESH_COMMANDS],\n },\n SELECT_GROUP: {\n target: STATUS.IDLE,\n actions: [ACTION.RESET_SEARCH, ACTION.RESET_HIGHLIGHT, ACTION.SET_GROUP, ACTION.REFRESH_COMMANDS],\n },\n ADD_FAVOURITE: {\n target: STATUS.IDLE,\n actions: [ACTION.ADD_FAVOURITE, ACTION.REFRESH_COMMANDS],\n },\n REMOVE_FAVOURITE: {\n target: STATUS.IDLE,\n actions: [ACTION.REMOVE_FAVOURITE, ACTION.REFRESH_COMMANDS],\n },\n },\n },\n executingCommand: {\n on: {\n UPDATE_RESULT: {\n target: STATUS.DISPLAYING_RESULT,\n actions: [ACTION.UPDATE_RESULT],\n },\n FINISH_COMMAND: {\n target: STATUS.IDLE,\n actions: [ACTION.UNSET_ACTIVE_COMMAND],\n },\n },\n },\n displayingResult: {\n on: {\n UPDATE_COMMAND_QUERY: {\n target: STATUS.DISPLAYING_RESULT,\n actions: [ACTION.SET_COMMAND_QUERY],\n },\n UPDATE_RESULT: {\n target: STATUS.DISPLAYING_RESULT,\n actions: [ACTION.UPDATE_RESULT, ACTION.RESET_OPTION_HIGHLIGHT],\n },\n HIGHLIGHT_NEXT_ITEM: {\n target: STATUS.DISPLAYING_RESULT,\n actions: [ACTION.HIGHLIGHT_NEXT_OPTION],\n },\n HIGHLIGHT_PREVIOUS_ITEM: {\n target: STATUS.DISPLAYING_RESULT,\n actions: [ACTION.HIGHLIGHT_PREVIOUS_OPTION],\n },\n EXECUTE_COMMAND: {\n target: STATUS.DISPLAYING_RESULT,\n actions: [ACTION.SET_ACTIVE_COMMAND],\n },\n CANCEL: {\n target: STATUS.IDLE,\n actions: [ACTION.UNSET_RESULT, ACTION.UNSET_ACTIVE_COMMAND, ACTION.RESET_OPTION_HIGHLIGHT],\n },\n FINISH_COMMAND: {\n target: STATUS.DISPLAYING_RESULT,\n actions: [ACTION.UNSET_ACTIVE_COMMAND],\n },\n },\n },\n },\n};\nexport function transition(state, event, actionCallback) {\n var _a, _b, _c;\n let nextStateNode = (_b = (_a = machine.states[state.status].on) === null || _a === void 0 ? void 0 : _a[event.type]) !== null && _b !== void 0 ? _b : null;\n if (!nextStateNode) {\n logger.error(`No transition found for event \"${event.type}\" in state \"${state.status}\"`);\n nextStateNode = { target: state.status };\n }\n const nextState = {\n ...state,\n status: typeof nextStateNode == 'string' ? nextStateNode : nextStateNode.target,\n };\n if (actionCallback && typeof nextStateNode == 'object') {\n (_c = nextStateNode.actions) === null || _c === void 0 ? void 0 : _c.forEach((action) => actionCallback(action, nextState, event));\n }\n logger.debug(`Transitioned from \"${state.status}\" to \"${nextState.status}\" with event \"${event.type}\"`);\n return nextState;\n}\n","import { assert, clamp, filterCommands } from '../helpers';\nimport { ACTION, TRANSITION, transition } from './commandBarMachine';\nconst MAX_RECENTLY_USED = 5;\nfunction runAction(action, nextState, event) {\n switch (action) {\n case ACTION.RESET_SEARCH:\n nextState.searchWord = '';\n break;\n case ACTION.RESET_HIGHLIGHT:\n nextState.highlightedItem = 0;\n break;\n case ACTION.REFRESH_COMMANDS:\n nextState.availableCommandIds = filterCommands(nextState.selectedCommandGroup, nextState.searchWord, nextState.commands, nextState.favouriteCommands, nextState.recentCommands);\n break;\n case ACTION.HIGHLIGHT_NEXT_COMMAND:\n nextState.highlightedItem = clamp(nextState.highlightedItem + 1, 0, nextState.availableCommandIds.length - 1);\n break;\n case ACTION.HIGHLIGHT_PREVIOUS_COMMAND:\n nextState.highlightedItem = clamp(nextState.highlightedItem - 1, 0, nextState.availableCommandIds.length - 1);\n break;\n case ACTION.HIGHLIGHT_NEXT_OPTION:\n nextState.highlightedOption = clamp(nextState.highlightedOption + 1, 0, Object.keys(nextState.result.options).length - 1);\n break;\n case ACTION.HIGHLIGHT_PREVIOUS_OPTION:\n nextState.highlightedOption = clamp(nextState.highlightedOption - 1, 0, Object.keys(nextState.result.options).length - 1);\n break;\n case ACTION.SET_SEARCH_WORD:\n assert(event.type === TRANSITION.UPDATE_SEARCH);\n nextState.searchWord = event.searchWord;\n break;\n case ACTION.SET_COMMAND_QUERY:\n assert(event.type === TRANSITION.UPDATE_COMMAND_QUERY);\n nextState.commandQuery = event.commandQuery;\n break;\n case ACTION.EXPAND:\n nextState.expanded = true;\n break;\n case ACTION.SET_ACTIVE_COMMAND:\n assert(event.type === TRANSITION.EXECUTE_COMMAND);\n nextState.activeCommandId = event.commandId;\n nextState.activeCommandMessage = event.message;\n break;\n case ACTION.UNSET_ACTIVE_COMMAND:\n nextState.activeCommandId = null;\n nextState.activeCommandMessage = null;\n break;\n case ACTION.UPDATE_RESULT:\n assert(event.type === TRANSITION.UPDATE_RESULT);\n assert(typeof event.result.success === 'boolean');\n nextState.result = {\n options: {},\n message: 'Command executed',\n view: null,\n success: false,\n ...event.result,\n };\n nextState.resultCommandId = nextState.activeCommandId;\n break;\n case ACTION.RESET_OPTION_HIGHLIGHT:\n nextState.highlightedOption = 0;\n break;\n case ACTION.RESET_SEARCH_OR_LEAVE_GROUP:\n if (nextState.commandQuery) {\n nextState.commandQuery = '';\n }\n else if (nextState.searchWord) {\n nextState.searchWord = '';\n }\n else {\n nextState.selectedCommandGroup = nextState.selectedCommandGroup\n ? nextState.commands[nextState.selectedCommandGroup].parentId\n : null;\n }\n break;\n case ACTION.UNSET_RESULT:\n nextState.result = null;\n nextState.resultCommandId = null;\n nextState.commandQuery = '';\n break;\n case ACTION.LEAVE_GROUP:\n nextState.selectedCommandGroup = nextState.selectedCommandGroup\n ? nextState.commands[nextState.selectedCommandGroup].parentId\n : null;\n break;\n case ACTION.SET_GROUP:\n assert(event.type === TRANSITION.SELECT_GROUP);\n nextState.selectedCommandGroup = event.commandId;\n break;\n case ACTION.ADD_FAVOURITE:\n assert(event.type === TRANSITION.ADD_FAVOURITE);\n if (!nextState.favouriteCommands.includes(event.commandId)) {\n nextState.favouriteCommands.push(event.commandId);\n }\n break;\n case ACTION.REMOVE_FAVOURITE:\n assert(event.type === TRANSITION.REMOVE_FAVOURITE);\n nextState.favouriteCommands = nextState.favouriteCommands.filter((id) => id !== event.commandId);\n break;\n case ACTION.ADD_RECENTLY_USED:\n assert(event.type === TRANSITION.EXECUTE_COMMAND);\n // Only add to recently used if the command has an action\n if (!nextState.commands[event.commandId].action) {\n break;\n }\n if (nextState.recentCommands.includes(event.commandId)) {\n nextState.recentCommands = nextState.recentCommands.filter((id) => id !== event.commandId);\n }\n nextState.recentCommands.unshift(event.commandId);\n if (nextState.recentCommands.length > MAX_RECENTLY_USED) {\n nextState.recentCommands.pop();\n }\n break;\n default:\n throw Error(`Action ${action} not implemented`);\n }\n}\nconst commandBarReducer = (state, event) => {\n return transition(state, event, runAction);\n};\nexport { commandBarReducer };\n","import React from 'react';\nimport * as styles from './IconWrapper.module.css';\nconst IconWrapper = ({ children }) => {\n return React.createElement(\"span\", { className: styles.iconWrap }, children);\n};\nexport default React.memo(IconWrapper);\n","import React from 'react';\nimport { useCommandBarState, useIntl } from '../../state';\nimport * as styles from './Branding.module.css';\nconst Branding = () => {\n const { state: { showBranding }, } = useCommandBarState();\n const { translate } = useIntl();\n if (!showBranding)\n return null;\n return (React.createElement(\"a\", { href: \"https://helzle.it/projects\", title: translate('CommandBarFooter.branding', 'Made with love by Sebastian Helzle'), target: \"_blank\", rel: \"noreferrer noopener\", className: styles.madeWithLove },\n React.createElement(\"small\", null, translate('CommandBarFooter.brandingSmall', 'Made with love by')),\n React.createElement(\"svg\", { xmlns: \"http://www.w3.org/2000/svg\", width: \"18\", height: \"18\", viewBox: \"0 0 180 180\" },\n React.createElement(\"defs\", null,\n React.createElement(\"linearGradient\", { id: \"a\", gradientUnits: \"userSpaceOnUse\", x1: \"280.25\", y1: \"377.003\", x2: \"373.261\", y2: \"377.003\" },\n React.createElement(\"stop\", { offset: \"0\", stopColor: \"#297AAC\" }),\n React.createElement(\"stop\", { offset: \"1\", stopColor: \"#53AADA\" }))),\n React.createElement(\"path\", { d: \"M0 180.017h37.287L71.35 52.898H34.061zM48.717 0l-9.083 33.898h36.675L85.392 0z\", fill: \"#B9B7B3\" }),\n React.createElement(\"path\", { d: \"M335.972 313.444H288.25l-8 28.306h47.691l-28.03 98.813h39.287l34.063-127.119z\", fill: \"url(#a)\", transform: \"translate(-195.462 -260.325)\" }))));\n};\nexport default React.memo(Branding);\n","import React from 'react';\nexport function IconBack() {\n return (React.createElement(\"svg\", { viewBox: \"0 0 448 512\" },\n React.createElement(\"path\", { fill: \"currentColor\", d: \"m257.5 445.1-22.2 22.2c-9.4 9.4-24.6 9.4-33.9 0L7 273c-9.4-9.4-9.4-24.6 0-33.9L201.4 44.7c9.4-9.4 24.6-9.4 33.9 0l22.2 22.2c9.5 9.5 9.3 25-.4 34.3L136.6 216H424c13.3 0 24 10.7 24 24v32c0 13.3-10.7 24-24 24H136.6l120.5 114.8c9.8 9.3 10 24.8.4 34.3z\" })));\n}\n","import React from 'react';\nexport function IconNeos() {\n return (React.createElement(\"svg\", { viewBox: \"0 0 512 512\" },\n React.createElement(\"path\", { fill: \"currentColor\", d: \"M415.44 512h-95.11L212.12 357.46v91.1L125.69 512H28V29.82L68.47 0h108.05l123.74 176.13V63.45L386.69 0h97.69v461.5zM38.77 35.27V496l72-52.88V194l215.5 307.64h84.79l52.35-38.17h-78.27L69 13zm82.54 466.61 80-58.78v-101l-79.76-114.4v220.94L49 501.89h72.34zM80.63 10.77l310.6 442.57h82.37V10.77h-79.75v317.56L170.91 10.77zM311 191.65l72 102.81V15.93l-72 53v122.72z\" })));\n}\n","import React from 'react';\nexport function IconSpinner() {\n return (React.createElement(\"svg\", { viewBox: \"0 0 512 512\" },\n React.createElement(\"path\", { fill: \"currentColor\", d: \"M288 39.056v16.659c0 10.804 7.281 20.159 17.686 23.066C383.204 100.434 440 171.518 440 256c0 101.689-82.295 184-184 184-101.689 0-184-82.295-184-184 0-84.47 56.786-155.564 134.312-177.219C216.719 75.874 224 66.517 224 55.712V39.064c0-15.709-14.834-27.153-30.046-23.234C86.603 43.482 7.394 141.206 8.003 257.332c.72 137.052 111.477 246.956 248.531 246.667C393.255 503.711 504 392.788 504 256c0-115.633-79.14-212.779-186.211-240.236C302.678 11.889 288 23.456 288 39.056z\" })));\n}\n","import React from 'react';\nexport function IconStar() {\n return (React.createElement(\"svg\", { viewBox: \"0 0 576 512\" },\n React.createElement(\"path\", { fill: \"currentColor\", d: \"M528.1 171.5 382 150.2 316.7 17.8c-11.7-23.6-45.6-23.9-57.4 0L194 150.2 47.9 171.5c-26.2 3.8-36.7 36.1-17.7 54.6l105.7 103-25 145.5c-4.5 26.3 23.2 46 46.4 33.7L288 439.6l130.7 68.7c23.2 12.2 50.9-7.4 46.4-33.7l-25-145.5 105.7-103c19-18.5 8.5-50.8-17.7-54.6zM388.6 312.3l23.7 138.4L288 385.4l-124.3 65.3 23.7-138.4-100.6-98 139-20.2 62.2-126 62.2 126 139 20.2-100.6 98z\" })));\n}\n","import React from 'react';\nexport function IconPlay() {\n return (React.createElement(\"svg\", { viewBox: \"0 0 512 512\" },\n React.createElement(\"path\", { fill: \"currentColor\", d: \"M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm115.7 272l-176 101c-15.8 8.8-35.7-2.5-35.7-21V152c0-18.4 19.8-29.8 35.7-21l176 107c16.4 9.2 16.4 32.9 0 42z\" })));\n}\n","import React from 'react';\nimport { useComputed } from '@preact/signals';\nimport { useCommandBarState } from '../../state';\nimport IconWrapper from '../IconWrapper/IconWrapper';\nimport Branding from './Branding';\nimport { IconNeos, IconSpinner } from '../Icons';\nimport * as styles from './CommandBarFooter.module.css';\nconst CommandBarFooter = () => {\n const { state: { activeCommandId, activeCommandMessage, commands, result, selectedCommandGroup, expanded }, Icon, } = useCommandBarState();\n const runningCommand = useComputed(() => {\n var _a;\n if (!activeCommandId.value)\n return null;\n // FIXME: This will not be correct when a command and an option in the result have the same id\n return activeCommandId.value\n ? (_a = commands.value[activeCommandId.value]) !== null && _a !== void 0 ? _a : result.value.options[activeCommandId.value]\n : null;\n });\n if (!expanded.value)\n return null;\n return (React.createElement(\"footer\", { className: styles.commandBarFooter },\n activeCommandId.value ? (React.createElement(\"span\", { className: styles.activity },\n React.createElement(IconWrapper, null,\n React.createElement(IconSpinner, null)),\n React.createElement(\"em\", null,\n runningCommand.value.name,\n \" \\u2012 \",\n activeCommandMessage))) : selectedCommandGroup.value ? (React.createElement(\"span\", { className: styles.breadcrumb },\n React.createElement(Icon, { icon: commands.value[selectedCommandGroup.value].icon }),\n React.createElement(\"small\", null, commands.value[selectedCommandGroup.value].name))) : (React.createElement(IconWrapper, null,\n React.createElement(IconNeos, null))),\n React.createElement(Branding, null)));\n};\nexport default React.memo(CommandBarFooter);\n","import React, { useCallback, useRef } from 'react';\nimport { useSignalEffect } from '@preact/signals';\nimport { useCommandBarState, STATUS, useIntl, useCommandExecutor } from '../../state';\nimport IconWrapper from '../IconWrapper/IconWrapper';\nimport * as styles from './SearchBox.module.css';\nimport { IconPlay } from '../Icons';\n// Timer helper for debouncing updates of command query results\nlet updateResultsTimer = null;\nconst RESULT_UPDATE_DEBOUNCE_TIME = 500;\nconst SearchBox = () => {\n var _a;\n const { state, actions } = useCommandBarState();\n const { executeCommand } = useCommandExecutor();\n const { translate } = useIntl();\n const inputRef = useRef();\n const handleChange = useCallback((e) => {\n if (state.status.value === STATUS.DISPLAYING_RESULT) {\n actions.UPDATE_COMMAND_QUERY(e.target.value);\n // Execute command after a delay if it's not a manual command\n if (!state.commands.value[state.resultCommandId.value].executeManually) {\n if (updateResultsTimer) {\n clearTimeout(updateResultsTimer);\n }\n updateResultsTimer = setTimeout(() => executeCommand(state.resultCommandId.value), RESULT_UPDATE_DEBOUNCE_TIME);\n }\n }\n else {\n actions.UPDATE_SEARCH(e.target.value);\n }\n }, []);\n const handleKeyPress = useCallback((e) => {\n // Prevent escape event from bubbling up if the input is focused and the native reset should be used\n if (e.key === 'Escape') {\n if (inputRef.current.value) {\n e.preventDefault();\n e.stopPropagation();\n }\n }\n }, [inputRef.current]);\n // Focus input when the command bar is ready for input\n useSignalEffect(() => {\n var _a;\n if (state.status.value !== STATUS.EXECUTING_COMMAND) {\n (_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.focus();\n }\n });\n return (React.createElement(React.Fragment, null,\n React.createElement(\"input\", { ref: inputRef, className: styles.searchBox, type: \"search\", placeholder: state.status.value === STATUS.DISPLAYING_RESULT\n ? translate('SearchBox.commandQuery.placeholder', 'Enter the query for the command')\n : translate('SearchBox.placeholder', 'What do you want to do today?'), autoFocus: true, onChange: handleChange, onKeyUp: handleKeyPress, value: (state.status.value === STATUS.DISPLAYING_RESULT\n ? state.commandQuery\n : state.searchWord), \"data-testid\": \"SearchBox\" }),\n !state.expanded.value && (React.createElement(\"button\", { className: styles.expandButton, onClick: actions.EXPAND, title: translate('SearchBox.expand.title', 'Expand to show all commands') },\n React.createElement(IconWrapper, null,\n React.createElement(\"svg\", { xmlns: \"http://www.w3.org/2000/svg\", viewBox: \"0 0 320 512\" },\n React.createElement(\"path\", { fill: \"currentColor\", d: \"M31.3 192h257.3c17.8 0 26.7 21.5 14.1 34.1L174.1 354.8c-7.8 7.8-20.5 7.8-28.3 0L17.2 226.1C4.6 213.5 13.5 192 31.3 192z\" }))))),\n state.status.value === STATUS.DISPLAYING_RESULT &&\n ((_a = state.commands.value[state.resultCommandId.value]) === null || _a === void 0 ? void 0 : _a.executeManually) && (React.createElement(\"button\", { className: styles.executeButton, onClick: () => executeCommand(state.resultCommandId.value), title: translate('SearchBox.execute.title', 'Execute the command') },\n React.createElement(IconWrapper, null,\n React.createElement(IconPlay, null))))));\n};\nexport default React.memo(SearchBox);\n","import React from 'react';\nimport { useComputed } from '@preact/signals';\nimport { useCommandBarState, STATUS } from '../../state';\nimport IconWrapper from '../IconWrapper/IconWrapper';\nimport SearchBox from '../SearchBox/SearchBox';\nimport { IconBack } from '../Icons';\nimport * as styles from './CommandBarHeader.module.css';\nconst CommandBarHeader = () => {\n const { state, actions } = useCommandBarState();\n const isDisplayingResults = useComputed(() => state.status.value == STATUS.DISPLAYING_RESULT);\n return (React.createElement(\"header\", { className: styles.commandBarHeader },\n (isDisplayingResults.value || state.selectedCommandGroup.value) && (React.createElement(\"button\", { type: \"button\", onClick: isDisplayingResults.value ? actions.CANCEL : actions.GO_TO_PARENT_GROUP, className: styles.backButton, title: \"Back\" },\n React.createElement(IconWrapper, null,\n React.createElement(IconBack, null)))),\n React.createElement(SearchBox, null)));\n};\nexport default React.memo(CommandBarHeader);\n","import React from 'react';\nimport { useComputed } from '@preact/signals';\nimport { IconWrapper } from '../index';\nimport { classnames } from '../../helpers';\nimport { IconStar } from '../Icons';\nimport * as styles from './CommandListItem.module.css';\nimport { useCommandBarState, useIntl } from '../../state';\nfunction getCommandType({ subCommandIds, category, canHandleQueries, action }, translate) {\n let type = 'command';\n if (category) {\n return category;\n }\n else if ((subCommandIds === null || subCommandIds === void 0 ? void 0 : subCommandIds.length) > 0) {\n type = 'category';\n }\n else if (canHandleQueries) {\n type = 'query';\n }\n else if (typeof action == 'string') {\n type = 'link';\n }\n return translate(`CommandListItem.type.${type}`, type);\n}\nfunction CommandListItem({ command, onItemSelect, highlightedId, onToggleFavourite }) {\n const { state: { favouriteCommands }, Icon, } = useCommandBarState();\n const { translate } = useIntl();\n const { id, name, description, icon, action } = command;\n const commandType = getCommandType(command, translate);\n const isHighlighted = useComputed(() => highlightedId.value === id);\n const isFavourite = useComputed(() => favouriteCommands.value.includes(id));\n return (React.createElement(\"li\", { className: classnames(styles.commandListItem, isHighlighted.value && styles.highlighted), onClick: () => onItemSelect(id), \"data-testid\": \"CommandListItem\" },\n React.createElement(Icon, { icon: icon }),\n React.createElement(\"span\", { className: styles.label },\n React.createElement(\"span\", null, name),\n description && (React.createElement(\"span\", { className: styles.description }, typeof description == 'string' ? description : description()))),\n onToggleFavourite && action && (React.createElement(\"button\", { type: \"button\", className: classnames(styles.favouriteButton, isFavourite.value && styles.isFavourite), title: translate('CommandListItem.toggleFavourite', 'Toggle favourite'), onClick: (e) => {\n e.stopPropagation();\n onToggleFavourite(id);\n } },\n React.createElement(IconWrapper, null,\n React.createElement(IconStar, null)))),\n React.createElement(\"small\", { className: styles.type }, commandType)));\n}\n// Use memo to prevent rerendering of all items when the parent list is updated\nexport default React.memo(CommandListItem);\n","import React, { useCallback } from 'react';\nimport { useComputed, useSignalEffect } from '@preact/signals';\nimport CommandListItem from '../CommandListItem/CommandListItem';\nimport { useCommandBarState, useCommandExecutor, useIntl, STATUS } from '../../state';\nimport { classnames } from '../../helpers';\nimport * as styles from './CommandListing.module.css';\nconst CommandList = () => {\n const { state: { commands, highlightedItem, availableCommandIds, status, searchWord, favouriteCommands, recentCommands, selectedCommandGroup, }, actions: { ADD_FAVOURITE, REMOVE_FAVOURITE }, } = useCommandBarState();\n const { translate } = useIntl();\n const { executeCommand } = useCommandExecutor();\n const navRef = React.useRef(null);\n useSignalEffect(() => {\n var _a, _b;\n (_b = (_a = navRef.current) === null || _a === void 0 ? void 0 : _a.querySelector(`li:nth-child(${highlightedItem.value})`)) === null || _b === void 0 ? void 0 : _b.scrollIntoView({ behavior: 'smooth', block: 'center' });\n });\n const handleToggleFavourite = useCallback((commandId) => {\n if (favouriteCommands.value.includes(commandId)) {\n REMOVE_FAVOURITE(commandId);\n }\n else {\n ADD_FAVOURITE(commandId);\n }\n }, [favouriteCommands]);\n const suggestions = useComputed(() => {\n return searchWord.value || selectedCommandGroup.value\n ? []\n : availableCommandIds.value.filter((commandId) => recentCommands.value.includes(commandId));\n });\n const availableCommands = useComputed(() => {\n return searchWord.value || selectedCommandGroup.value\n ? availableCommandIds.value\n : availableCommandIds.value.filter((commandId) => !recentCommands.value.includes(commandId));\n });\n const highlightedCommand = useComputed(() => availableCommandIds.value[highlightedItem.value]);\n return (React.createElement(\"nav\", { className: classnames(styles.results, status.value !== STATUS.IDLE && styles.disabled), \"data-testid\": \"CommandList\", ref: navRef },\n suggestions.value.length > 0 && (React.createElement(React.Fragment, null,\n React.createElement(\"h6\", null, translate('CommandList.suggestions', 'Recently used')),\n React.createElement(\"ul\", null, suggestions.value.map((commandId) => (React.createElement(CommandListItem, { key: commandId, command: commands.value[commandId], onItemSelect: executeCommand, highlightedId: highlightedCommand, onToggleFavourite: handleToggleFavourite })))))),\n availableCommands.value.length > 0 && (React.createElement(React.Fragment, null,\n React.createElement(\"h6\", null, translate('CommandList.heading', 'Commands')),\n React.createElement(\"ul\", null, availableCommands.value.map((commandId) => (React.createElement(CommandListItem, { key: commandId, command: commands.value[commandId], onItemSelect: executeCommand, highlightedId: highlightedCommand, onToggleFavourite: handleToggleFavourite })))))),\n availableCommandIds.value.length === 0 && (React.createElement(\"small\", { className: styles.noResults }, translate('CommandList.noCommandsMessage', 'No matching commands found')))));\n};\nexport default React.memo(CommandList);\n","import React from 'react';\nimport { useComputed, useSignalEffect } from '@preact/signals';\nimport { useCommandBarState, useCommandExecutor } from '../../state';\nimport CommandListItem from '../CommandListItem/CommandListItem';\nimport * as styles from './CommandResultsView.module.css';\nconst CommandResultsView = () => {\n var _a;\n const { state: { result, highlightedOption }, } = useCommandBarState();\n const { executeCommand } = useCommandExecutor();\n const navRef = React.useRef(null);\n const highlightedId = useComputed(() => result.value ? Object.values(result.value.options)[highlightedOption.value].id : null);\n useSignalEffect(() => {\n var _a, _b;\n const highlightedIndex = highlightedOption.value;\n (_b = (_a = navRef.current) === null || _a === void 0 ? void 0 : _a.querySelector(`li:nth-child(${highlightedIndex})`)) === null || _b === void 0 ? void 0 : _b.scrollIntoView({ behavior: 'smooth', block: 'center' });\n });\n const { options, view, message } = (_a = result.value) !== null && _a !== void 0 ? _a : {};\n return (React.createElement(\"div\", { className: styles.commandResultsView },\n message && React.createElement(\"h6\", { className: styles.message }, message),\n view ? React.createElement(\"div\", null, view) : '',\n options && (React.createElement(\"nav\", { className: styles.results, ref: navRef },\n React.createElement(\"ul\", null, Object.keys(options).map((commandId) => (React.createElement(CommandListItem, { key: commandId, command: options[commandId], onItemSelect: executeCommand, highlightedId: highlightedId }))))))));\n};\nexport default CommandResultsView;\n","import React from 'react';\nimport * as styles from './ToggleButton.module.css';\nconst ToggleButton = ({ handleToggle, disabled = false, label, title }) => {\n return (React.createElement(\"button\", { className: styles.toggleButton, onClick: handleToggle, disabled: disabled, title: title },\n React.createElement(\"span\", null, label),\n React.createElement(\"span\", { className: styles.buttonIcon }, \"\\u2318K\")));\n};\nexport default React.memo(ToggleButton);\n","import React, { createContext, useCallback, useContext, useMemo } from 'react';\nimport { signal, computed } from '@preact/signals';\nimport { commandBarReducer } from './commandBarReducer';\nimport { flattenCommands, logger } from '../helpers';\nimport { STATUS, TRANSITION } from './commandBarMachine';\nimport { IconWrapper } from '../components';\nconst CommandBarContext = createContext({});\nexport const useCommandBarState = () => useContext(CommandBarContext);\n/**\n * Create the app state and initialize it if it does not exist yet\n */\nfunction createAppState(initialState) {\n // Define a signal to hold the state\n const commandBarState = signal(initialState);\n // Define a function to dispatch events to the reducer and its state machine and update the state with the result\n const dispatch = (event) => {\n commandBarState.value = commandBarReducer(commandBarState.value, event);\n };\n // Derive readonly selectors for partial state values\n const activeCommandId = computed(() => commandBarState.value.activeCommandId);\n const activeCommandMessage = computed(() => commandBarState.value.activeCommandMessage);\n const availableCommandIds = computed(() => commandBarState.value.availableCommandIds);\n const commandQuery = computed(() => commandBarState.value.commandQuery);\n const commands = computed(() => commandBarState.value.commands);\n const expanded = computed(() => commandBarState.value.expanded);\n const favouriteCommands = computed(() => commandBarState.value.favouriteCommands);\n const highlightedItem = computed(() => commandBarState.value.highlightedItem);\n const highlightedOption = computed(() => commandBarState.value.highlightedOption);\n const recentCommands = computed(() => commandBarState.value.recentCommands);\n const result = computed(() => commandBarState.value.result);\n const resultCommandId = computed(() => commandBarState.value.resultCommandId);\n const searchWord = computed(() => commandBarState.value.searchWord);\n const selectedCommandGroup = computed(() => commandBarState.value.selectedCommandGroup);\n const showBranding = computed(() => commandBarState.value.showBranding);\n const status = computed(() => commandBarState.value.status);\n return {\n state: {\n activeCommandId,\n activeCommandMessage,\n availableCommandIds,\n commandQuery,\n commands,\n expanded,\n favouriteCommands,\n highlightedItem,\n highlightedOption,\n recentCommands,\n result,\n resultCommandId,\n searchWord,\n selectedCommandGroup,\n showBranding,\n status,\n },\n dispatch,\n };\n}\nexport const CommandBarStateProvider = ({ commands, children, IconComponent, userPreferences, }) => {\n const { state, dispatch } = useMemo(() => {\n return createAppState({\n activeCommandId: null,\n activeCommandMessage: null,\n availableCommandIds: Object.keys(commands),\n commandQuery: '',\n commands: flattenCommands(commands),\n expanded: false,\n favouriteCommands: userPreferences.favouriteCommands,\n highlightedItem: 0,\n highlightedOption: 0,\n recentCommands: userPreferences.recentCommands,\n result: null,\n resultCommandId: null,\n searchWord: '',\n selectedCommandGroup: null,\n showBranding: userPreferences.showBranding,\n status: STATUS.COLLAPSED,\n });\n }, []);\n // Provide all actions as shorthand functions\n const actions = useMemo(() => {\n return {\n [TRANSITION.RESET_SEARCH]: () => dispatch({ type: TRANSITION.RESET_SEARCH }),\n [TRANSITION.HIGHLIGHT_NEXT_ITEM]: () => dispatch({ type: TRANSITION.HIGHLIGHT_NEXT_ITEM }),\n [TRANSITION.HIGHLIGHT_PREVIOUS_ITEM]: () => dispatch({ type: TRANSITION.HIGHLIGHT_PREVIOUS_ITEM }),\n [TRANSITION.CANCEL]: () => dispatch({ type: TRANSITION.CANCEL }),\n [TRANSITION.SELECT_GROUP]: (commandId) => dispatch({ type: TRANSITION.SELECT_GROUP, commandId }),\n [TRANSITION.GO_TO_PARENT_GROUP]: () => dispatch({ type: TRANSITION.GO_TO_PARENT_GROUP }),\n [TRANSITION.UPDATE_SEARCH]: (searchWord) => dispatch({ type: TRANSITION.UPDATE_SEARCH, searchWord }),\n [TRANSITION.UPDATE_COMMAND_QUERY]: (commandQuery) => dispatch({ type: TRANSITION.UPDATE_COMMAND_QUERY, commandQuery }),\n [TRANSITION.EXECUTE_COMMAND]: async (commandId, message) => {\n dispatch({\n type: TRANSITION.EXECUTE_COMMAND,\n commandId,\n message,\n });\n // Update recent commands in the user preferences when a command is executed\n return userPreferences\n .addRecentCommand(commandId)\n .catch((e) => logger.error('Could not add recent command', e));\n },\n [TRANSITION.FINISH_COMMAND]: () => dispatch({ type: TRANSITION.FINISH_COMMAND }),\n [TRANSITION.UPDATE_RESULT]: (result) => dispatch({ type: TRANSITION.UPDATE_RESULT, result }),\n [TRANSITION.EXPAND]: () => dispatch({ type: TRANSITION.EXPAND }),\n [TRANSITION.ADD_FAVOURITE]: (commandId) => {\n dispatch({ type: TRANSITION.ADD_FAVOURITE, commandId });\n userPreferences\n .setFavouriteCommands(state.favouriteCommands.value)\n .catch((e) => logger.error('Could not update favourite commands', e));\n },\n [TRANSITION.REMOVE_FAVOURITE]: (commandId) => {\n dispatch({ type: TRANSITION.REMOVE_FAVOURITE, commandId });\n userPreferences\n .setFavouriteCommands(state.favouriteCommands.value)\n .catch((e) => logger.error('Could not update favourite commands', e));\n },\n };\n }, []);\n const Icon = useCallback(({ icon, spin = false }) => {\n return (React.createElement(IconWrapper, null,\n React.createElement(IconComponent, { icon: icon, spin: spin })));\n }, []);\n return React.createElement(CommandBarContext.Provider, { value: { state, actions, Icon } }, children);\n};\n","import React, { useCallback, useEffect } from 'react';\nimport useFunctionRef from '../hooks/useFunctionRef';\nimport { useCommandBarState } from './CommandBarStateProvider';\nimport { assert, logger } from '../helpers';\nimport { STATUS } from './commandBarMachine';\nconst CommandInputContext = React.createContext({});\nexport const useCommandExecutor = () => React.useContext(CommandInputContext);\n/**\n * Context provider for the command bar input and command execution\n */\nexport const CommandBarExecutor = ({ children, toggleOpen, dialogRef, open }) => {\n const { state, actions } = useCommandBarState();\n const handleKeyEnteredRef = useFunctionRef((e) => {\n if (!open || e.defaultPrevented) {\n return;\n }\n if (e.key === 'k' && e.metaKey && (dialogRef === null || dialogRef === void 0 ? void 0 : dialogRef.current.contains(e.target))) {\n // Close command bar\n toggleOpen();\n e.stopPropagation();\n e.preventDefault();\n }\n else if (e.key === 'Escape') {\n // Cancel search, or selection, or close command bar\n e.stopPropagation();\n e.preventDefault();\n if (state.selectedCommandGroup.value || state.searchWord.value || state.commandQuery.value) {\n actions.CANCEL();\n }\n else {\n // Close command bar if cancel is noop\n toggleOpen();\n }\n }\n else if (e.key === 'ArrowDown') {\n // Navigate to next command\n e.stopPropagation();\n e.preventDefault();\n actions.HIGHLIGHT_NEXT_ITEM();\n }\n else if (e.key === 'ArrowUp') {\n // Navigate to previous command\n e.stopPropagation();\n e.preventDefault();\n actions.HIGHLIGHT_PREVIOUS_ITEM();\n }\n else if (e.key === 'Enter') {\n // Execute highlighted command\n e.stopPropagation();\n e.preventDefault();\n // Select the highlighted command by default\n let commandId = state.availableCommandIds.value[state.highlightedItem.value];\n if (state.status.value === STATUS.DISPLAYING_RESULT) {\n // If there are options the command to execute is the highlighted option\n if (Object.values(state.result.value.options).length) {\n commandId = Object.keys(state.result.value.options)[state.highlightedOption.value];\n }\n else {\n // If there are no options we run the command which generated the result again\n commandId = state.resultCommandId.value;\n }\n }\n if (commandId) {\n void executeCommand(commandId);\n }\n }\n });\n const executeCommand = useCallback(async (commandId) => {\n var _a, _b, _c;\n const command = (_b = (_a = state.result.value) === null || _a === void 0 ? void 0 : _a.options[commandId]) !== null && _b !== void 0 ? _b : state.commands.value[commandId];\n const { action, canHandleQueries, subCommandIds, name } = command;\n // If the command is a group, select it\n if ((subCommandIds === null || subCommandIds === void 0 ? void 0 : subCommandIds.length) > 0) {\n actions.SELECT_GROUP(commandId);\n return;\n }\n assert(action, `Command ${commandId} has no action`);\n // If the command is a url, open it\n if (typeof action == 'string') {\n // We wait for the state change to be finished before opening the url\n await actions.EXECUTE_COMMAND(commandId, 'Loading url');\n // We need to check if the url is in the same domain, otherwise we need to open it in a new tab\n // TODO: We should add another option to a link command to define its target\n if (action.indexOf('http') === 0 && action.indexOf(document.location.origin) !== 0) {\n (_c = window.open(action, '_blank', 'noopener,noreferrer')) === null || _c === void 0 ? void 0 : _c.focus();\n }\n else {\n window.location.href = action;\n }\n return actions.FINISH_COMMAND();\n }\n // If the command is a function, execute it\n actions.EXECUTE_COMMAND(commandId, 'Running command');\n const actionResult = action(canHandleQueries ? state.commandQuery.value : undefined);\n if (actionResult.then) {\n // Handle Promises\n actionResult\n .then((result) => {\n if (result && !result.success) {\n throw new Error(`The command \"${name}\" failed`);\n }\n })\n .catch((error) => {\n // TODO: Show an error message to the user\n logger.error('Command error', name, error);\n })\n .finally(() => {\n actions.FINISH_COMMAND();\n });\n }\n else if (actionResult.next) {\n // Handle generators\n const generator = actionResult;\n // TODO: Handle errors / success === false\n for await (const result of generator) {\n actions.UPDATE_RESULT(result);\n }\n actions.FINISH_COMMAND();\n }\n else {\n logger.error('Command result is not a promise or generator', actionResult);\n }\n if (command.closeOnExecute) {\n toggleOpen();\n }\n }, [state.searchWord, state.commands, state.result]);\n const executeCommandRef = useFunctionRef((commandId) => {\n void executeCommand(commandId);\n });\n /**\n * Add key event handler, needs to be updated when any parameter for the key event handler changes\n */\n useEffect(() => {\n if (!open)\n return;\n // const guestFrame = document.getElementsByName('neos-content-main')[0] as HTMLIFrameElement;\n // guestFrame.contentWindow?.addEventListener('keyup', (e) => {\n // log.debug('keypress in guestframe', e);\n // });\n // log.debug('guestFrame', guestFrame.contentWindow);\n const windowKeyEventHandler = (e) => handleKeyEnteredRef.current(e);\n window.addEventListener('keydown', windowKeyEventHandler);\n return () => window.removeEventListener('keydown', windowKeyEventHandler);\n }, [open]);\n return (React.createElement(CommandInputContext.Provider, { value: { executeCommand: executeCommandRef.current } }, children));\n};\n","import React, { createContext, useContext } from 'react';\nexport const IntlContext = createContext({});\nexport const useIntl = () => useContext(IntlContext);\nexport const IntlProvider = ({ translate, children }) => {\n return React.createElement(IntlContext.Provider, { value: { translate } }, children);\n};\n","import React, { useCallback, useEffect, useRef } from 'react';\nimport { batch, useComputed, useSignal } from '@preact/signals';\nimport { CommandBarFooter, CommandBarHeader, CommandList, CommandResultsView } from '../index';\nimport { CommandBarExecutor, useCommandBarState } from '../../state';\nimport { clamp, classnames } from '../../helpers';\nimport * as styles from './CommandBarDialog.module.css';\nconst CommandBarDialog = ({ onDrag, open, toggleOpen }) => {\n const { state: { expanded, result }, } = useCommandBarState();\n const dialogRef = useRef(null);\n const isDragging = useSignal(false);\n const dialogPosition = useSignal({\n left: window.innerWidth / 2 - 300,\n top: window.innerHeight / 2 - 20,\n });\n const dragStateOffset = useSignal({\n offsetLeft: 0,\n offsetTop: 0,\n });\n const hasBeenDragged = useSignal(false);\n const dialogStyle = useComputed(() => {\n const { left, top } = dialogPosition.value;\n return (hasBeenDragged\n ? {\n left: left + 'px',\n top: top + 'px',\n translate: 'none',\n visibility: isDragging.value ? 'hidden' : 'visible',\n }\n : {});\n });\n const reposition = useCallback((left, top) => {\n const dialogSize = dialogRef.current.getBoundingClientRect();\n dialogPosition.value = {\n left: clamp(left, 0, window.innerWidth - dialogSize.width),\n top: clamp(top, 0, window.innerHeight - dialogSize.height),\n };\n }, []);\n const handleDragStart = useCallback((e) => {\n // @ts-ignore\n if (e.target.tagName === 'INPUT') {\n return;\n }\n console.debug('dragstart');\n e.dataTransfer.setData('text/plain', 'CommandBar');\n e.dataTransfer.dropEffect = 'move';\n e.dataTransfer.effectAllowed = 'move';\n batch(() => {\n dragStateOffset.value = {\n offsetLeft: e.clientX - dialogRef.current.offsetLeft,\n offsetTop: e.clientY - dialogRef.current.offsetTop,\n };\n hasBeenDragged.value = true;\n });\n onDrag && onDrag(true);\n }, [dialogRef.current]);\n const handleDragDrop = useCallback((e) => {\n const { clientX, clientY } = e;\n console.debug('dragdrop', clientX, clientY, dragStateOffset.value);\n batch(() => {\n isDragging.value = false;\n reposition(clientX - dragStateOffset.value.offsetLeft, clientY - dragStateOffset.value.offsetTop);\n });\n onDrag && onDrag(false);\n }, [dialogRef.current]);\n const onResize = useCallback(() => reposition(dialogPosition.value.left, dialogPosition.value.top), []);\n useEffect(() => {\n if (!open)\n return;\n dialogRef.current.parentElement.addEventListener('drop', handleDragDrop);\n window.addEventListener('resize', onResize);\n return () => {\n dialogRef.current.parentElement.removeEventListener('drop', handleDragDrop);\n window.removeEventListener('resize', onResize);\n };\n }, [open, onResize, handleDragDrop]);\n if (!open) {\n return null;\n }\n return (React.createElement(\"dialog\", { ref: dialogRef, className: classnames(styles.commandBar, result.value && styles.hasResults), open: open, draggable: true, onDragStart: handleDragStart, onDrag: () => (isDragging.value = true), style: dialogStyle.value, \"data-testid\": \"CommandBarDialog\" },\n React.createElement(CommandBarExecutor, { toggleOpen: toggleOpen, dialogRef: dialogRef, open: open },\n React.createElement(CommandBarHeader, null),\n React.createElement(\"div\", { className: classnames(styles.resultsWrap, expanded.value && styles.expanded, result.value && styles.split) },\n expanded.value && React.createElement(CommandList, null),\n result.value && React.createElement(CommandResultsView, null)),\n React.createElement(CommandBarFooter, null))));\n};\nexport default CommandBarDialog;\n","import React from 'react';\nimport { CommandBarStateProvider, IntlProvider } from './state';\nimport CommandBarDialog from './components/CommandBarDialog/CommandBarDialog';\nimport './Variables.module.css';\nconst CommandBar = ({ commands, open, toggleOpen, onDrag, IconComponent, userPreferences, translate, }) => {\n return (React.createElement(IntlProvider, { translate: translate },\n React.createElement(CommandBarStateProvider, { commands: commands, IconComponent: IconComponent, userPreferences: userPreferences },\n React.createElement(CommandBarDialog, { onDrag: onDrag, open: open, toggleOpen: toggleOpen }))));\n};\nexport default CommandBar;\n","export async function fetchData(endpoint, params, method = 'GET') {\n if (params && method === 'GET') {\n endpoint = Object.keys(params).reduce((url, key) => {\n return url + '&' + key + '=' + encodeURIComponent(params[key]);\n }, endpoint + '?');\n }\n return fetch(endpoint, {\n method,\n credentials: 'include',\n body: params && method === 'POST' ? JSON.stringify(params) : undefined,\n headers: {\n // FIXME: Include CSRF Token\n // 'X-Flow-Csrftoken': csrfToken,\n 'Content-Type': 'application/json',\n Accept: 'application/json',\n },\n }).then((response) => {\n var _a;\n if (response.status !== 200) {\n throw new Error(`The request failed with code ${response.status}: \"${response.statusText}\"`);\n }\n if ((_a = response.headers.get('Content-Type')) === null || _a === void 0 ? void 0 : _a.includes('application/json')) {\n return response.json();\n }\n return response.text();\n });\n}\n","import { fetchData } from './fetch';\nconst ENDPOINT_GET_PREFERENCES = '/neos/shel-neos-commandbar/preferences/getpreferences';\nconst ENDPOINT_SET_FAVOURITE_COMMANDS = '/neos/shel-neos-commandbar/preferences/setfavourites';\nconst ENDPOINT_ADD_RECENT_COMMAND = '/neos/shel-neos-commandbar/preferences/addrecentcommand';\nasync function setPreference(endpoint, data) {\n return fetchData(endpoint, data, 'POST');\n}\nexport async function getPreferences() {\n return fetchData(ENDPOINT_GET_PREFERENCES);\n}\nexport async function setFavouriteCommands(commandIds) {\n return setPreference(ENDPOINT_SET_FAVOURITE_COMMANDS, { commandIds: commandIds });\n}\nexport async function addRecentCommand(commandId) {\n // TODO: Check if sendBeacon is a better option here to reduce the impact on the user\n return setPreference(ENDPOINT_ADD_RECENT_COMMAND, { commandId: commandId });\n}\n","import { fetchData } from './fetch';\nconst ENDPOINT_COMMANDS = '/neos/service/data-source/shel-neos-commandbar-commands';\nexport async function getCommands() {\n return fetchData(ENDPOINT_COMMANDS);\n}\n","import { fetchData } from './fetch';\nconst ENDPOINT_SEARCH_NEOS_DOCS = '/neos/service/data-source/shel-neos-commandbar-search-neos-docs';\nexport async function searchNeosDocs(query) {\n return query ? fetchData(ENDPOINT_SEARCH_NEOS_DOCS, { query }) : {};\n}\n","import { fetchData } from './fetch';\nconst ENDPOINT_SEARCH_NEOS_PACKAGES = '/neos/service/data-source/shel-neos-commandbar-search-neos-packages';\nexport async function searchNeosPackages(query) {\n return query ? fetchData(ENDPOINT_SEARCH_NEOS_PACKAGES, { query }) : {};\n}\n","import { fetchData } from './fetch';\nconst ENDPOINT_SEARCH_NODES = 'service/data-source/shel-neos-commandbar-search-nodes';\nexport async function searchNodes(query, node) {\n return query\n ? fetchData(ENDPOINT_SEARCH_NODES, {\n query,\n node,\n })\n : [];\n}\n","import * as React from 'react';\nimport { connect } from 'react-redux';\nimport PropTypes from 'prop-types';\n// Neos dependencies are provided by the UI\n// @ts-ignore\nimport { neos } from '@neos-project/neos-ui-decorators';\n// @ts-ignore\nimport { selectors, actions } from '@neos-project/neos-ui-redux-store';\nimport { Icon } from '@neos-project/react-ui-components';\nimport { CommandBar, logger, ToggleButton } from '@neos-commandbar/commandbar';\nimport { CommandsApi, PreferencesApi, DocumentationApi, NodesApi, PackagesApi } from '@neos-commandbar/neos-api';\nimport { actions as commandBarActions, selectors as commandBarSelectors } from './actions';\nimport * as styles from './CommandBarUiPlugin.module.css';\nconst IconComponent = ({ icon, spin = false }) => React.createElement(Icon, { icon: icon, spin: spin });\nclass CommandBarUiPlugin extends React.PureComponent {\n constructor(props) {\n super(props);\n this.buildCommandsFromHotkeys = () => {\n const { hotkeyRegistry, handleHotkeyAction, config } = this.props;\n const hotkeys = hotkeyRegistry.getAllAsList();\n return hotkeys.reduce((carry, { id, description, action }) => {\n if (!config.hotkeys.filter.includes(id)) {\n carry[id] = {\n name: description,\n description: id,\n icon: this.mapHotkeyIdToIcon(id),\n action: async () => void handleHotkeyAction(action()),\n closeOnExecute: true,\n };\n }\n return carry;\n }, {});\n };\n this.buildCommandsFromEditPreviewModes = () => {\n const { setEditPreviewMode, editPreviewModes, i18nRegistry } = this.props;\n return Object.keys(editPreviewModes).reduce((carry, mode) => {\n const { title, isEditingMode } = editPreviewModes[mode];\n carry[mode] = {\n name: i18nRegistry.translate(title),\n description: () => this.props.editPreviewMode === mode\n ? this.translate('CommandBarUiPlugin.command.switchEditPreviewMode.active', 'Currently active')\n : '',\n icon: isEditingMode ? 'pencil' : 'eye',\n action: async () => setEditPreviewMode(mode),\n };\n return carry;\n }, {});\n };\n this.handleAddNode = async () => {\n const { addNode, documentNode, focusedNodeContextPath, toggleCommandBar } = this.props;\n toggleCommandBar();\n addNode(focusedNodeContextPath || documentNode.contextPath, undefined, 'after');\n };\n this.handleSearchNode = async function* (query) {\n const { siteNode, setActiveContentCanvasSrc } = this.props;\n yield {\n success: true,\n message: this.translate('CommandBarUiPlugin.command.searchDocuments.searching', { query }),\n };\n let error;\n const results = await NodesApi.searchNodes(query, siteNode.contextPath).catch((e) => {\n logger.error('Could not search nodes', e);\n error = e.message;\n });\n if (!results) {\n yield {\n success: false,\n message: this.translate('CommandBarUiPlugin.command.searchDocuments.searchFailed', 'Search failed'),\n view: error,\n };\n }\n else {\n yield {\n success: true,\n message: this.translate('CommandBarUiPlugin.command.searchDocuments.matches', {\n matches: results.length,\n }),\n options: results.reduce((carry, { name, nodetype, contextPath, uri, icon }) => {\n if (!uri) {\n // TODO: Show hint that document cannot be opened or filter them remotely already?\n return carry;\n }\n carry[contextPath] = {\n id: contextPath,\n name,\n category: nodetype,\n action: async () => {\n setActiveContentCanvasSrc(uri);\n },\n closeOnExecute: true,\n icon,\n };\n return carry;\n }, {}),\n };\n }\n };\n this.handleSearchNeosDocs = async function* (query) {\n yield {\n success: true,\n message: this.translate('CommandBarUiPlugin.command.documentation.searching', { query }, `Search for \"${query}\"`),\n };\n let error;\n const options = await DocumentationApi.searchNeosDocs(query).catch((e) => {\n logger.error('Could not search Neos docs', e);\n error = e.message;\n });\n if (error || !options) {\n yield {\n success: false,\n message: this.translate('CommandBarUiPlugin.command.documentation.error', 'Search failed'),\n view: error,\n };\n }\n else {\n yield {\n success: true,\n message: this.translate('CommandBarUiPlugin.command.documentation.matches', { matches: Object.keys(options).length }, `${Object.values(options).length} options match your query`),\n options,\n };\n }\n };\n this.handleSearchNeosPackages = async function* (query) {\n yield {\n success: true,\n message: this.translate('CommandBarUiPlugin.command.packages.searching', { query }, `Search for \"${query}\"`),\n };\n let error;\n const options = await PackagesApi.searchNeosPackages(query).catch((e) => {\n logger.error('Could not search Neos packages', e);\n error = e.message;\n });\n if (error || !options) {\n yield {\n success: false,\n message: this.translate('CommandBarUiPlugin.command.packages.error', 'Search failed'),\n view: error,\n };\n }\n else {\n yield {\n success: true,\n message: this.translate('CommandBarUiPlugin.command.packages.matches', { matches: Object.values(options).length }, `${Object.values(options).length} options match your query`),\n options,\n };\n }\n };\n this.handlePublish = async () => {\n const { publishableNodesInDocument, publishAction, baseWorkspace } = this.props;\n publishAction(publishableNodesInDocument.map((node) => node.contextPath), baseWorkspace);\n return {\n success: true,\n message: this.translate('CommandBarUiPlugin.command.publish.success', { count: publishableNodesInDocument.length }, `Published ${publishableNodesInDocument.length} changes`),\n };\n };\n this.handlePublishAll = async () => {\n const { publishableNodes, publishAction, baseWorkspace } = this.props;\n publishAction(publishableNodes.map((node) => node.contextPath), baseWorkspace);\n return {\n success: true,\n message: this.translate('CommandBarUiPlugin.command.publishAll.success', { count: publishableNodes.length }, `Published ${publishableNodes.length} changes`),\n };\n };\n this.handleDiscard = async () => {\n const { publishableNodesInDocument, discardAction } = this.props;\n discardAction(publishableNodesInDocument.map((node) => node.contextPath));\n return {\n success: true,\n message: this.translate('CommandBarUiPlugin.command.discard.success', { count: publishableNodesInDocument.length }, `Discarded ${publishableNodesInDocument.length} changes`),\n };\n };\n this.handleDiscardAll = async () => {\n const { publishableNodes, discardAction } = this.props;\n discardAction(publishableNodes.map((node) => node.contextPath));\n return {\n success: true,\n message: this.translate('CommandBarUiPlugin.command.discardAll.success', { count: publishableNodes.length }, `Discarded ${publishableNodes.length} changes`),\n };\n };\n this.setDragging = (dragging) => {\n this.setState({ ...this.state, dragging });\n };\n this.translate = (id, paramsOrFallback, fallback) => {\n if (typeof paramsOrFallback === 'string') {\n fallback = paramsOrFallback;\n paramsOrFallback = {};\n }\n return this.props.i18nRegistry.translate(id, fallback, paramsOrFallback, 'Shel.Neos.CommandBar', 'Main');\n };\n this.state = {\n loaded: false,\n dragging: false,\n favouriteCommands: [],\n recentCommands: [],\n recentDocuments: [],\n showBranding: true,\n commands: {\n addNode: {\n name: this.translate('CommandBarUiPlugin.command.addNode', 'Add content'),\n icon: 'plus',\n description: this.translate('CommandBarUiPlugin.command.addNode.description', 'Add new content'),\n action: this.handleAddNode,\n },\n searchDocuments: {\n name: this.translate('CommandBarUiPlugin.command.searchDocuments', 'Search documents'),\n icon: 'search',\n description: this.translate('CommandBarUiPlugin.command.searchDocuments.description', 'Search and navigate to documents'),\n action: this.handleSearchNode.bind(this),\n canHandleQueries: true,\n },\n publishDiscard: {\n name: this.translate('CommandBarUiPlugin.command.publishDiscard', 'Publish / discard'),\n description: this.translate('CommandBarUiPlugin.command.publishDiscard.description', 'Publish or discard changes'),\n icon: 'check',\n subCommands: {\n publish: {\n name: this.translate('CommandBarUiPlugin.command.publish', 'Publish'),\n description: this.translate('CommandBarUiPlugin.command.publish.description', 'Publish changes in this document'),\n icon: 'check',\n action: this.handlePublish,\n },\n publishAll: {\n name: this.translate('CommandBarUiPlugin.command.publishAll', 'Publish all'),\n description: this.translate('CommandBarUiPlugin.command.publishAll.description', 'Publish changes in all documents'),\n icon: 'check-double',\n action: this.handlePublishAll,\n },\n discard: {\n name: this.translate('CommandBarUiPlugin.command.discard', 'Discard'),\n description: this.translate('CommandBarUiPlugin.command.discard.description', 'Discard changes in the current document'),\n icon: 'ban',\n action: this.handleDiscard,\n },\n discardAll: {\n name: this.translate('CommandBarUiPlugin.command.discardAll', 'Discard all'),\n description: this.translate('CommandBarUiPlugin.command.discardAll.description', 'Discard changes in all documents'),\n icon: 'ban',\n action: this.handleDiscardAll,\n },\n },\n },\n quickActions: {\n name: this.translate('CommandBarUiPlugin.command.quickActions', 'Quick actions'),\n icon: 'keyboard',\n description: this.translate('CommandBarUiPlugin.command.quickActions.description', 'Execute hotkeys'),\n subCommands: this.buildCommandsFromHotkeys(),\n },\n switchEditPreviewMode: {\n name: this.translate('CommandBarUiPlugin.command.switchEditPreviewMode', 'Switch edit/preview mode'),\n icon: 'pencil',\n description: this.translate('CommandBarUiPlugin.command.switchEditPreviewMode.description', 'Switch between edit and preview modes'),\n subCommands: this.buildCommandsFromEditPreviewModes(),\n },\n openPreview: {\n name: this.translate('CommandBarUiPlugin.command.openPreview', 'Open preview'),\n description: this.translate('CommandBarUiPlugin.command.openPreview.description', 'Open the preview for current document'),\n icon: 'external-link-alt',\n action: async () => {\n var _a;\n if (this.props.previewUrl) {\n (_a = window.open(this.props.previewUrl, '_blank', 'noopener,noreferrer')) === null || _a === void 0 ? void 0 : _a.focus();\n }\n else {\n logger.warn('No preview url to open');\n }\n },\n closeOnExecute: true,\n },\n },\n };\n if (props.config.features.searchNeosDocs) {\n this.state.commands.searchNeosDocs = {\n name: this.translate('CommandBarUiPlugin.command.documentation', 'Documentation'),\n description: this.translate('CommandBarUiPlugin.command.documentation.description', 'Browse or search the Neos documentation'),\n icon: 'book',\n canHandleQueries: true,\n action: this.handleSearchNeosDocs.bind(this),\n };\n }\n if (props.config.features.searchNeosPackages) {\n this.state.commands.searchNeosPackages = {\n name: this.translate('CommandBarUiPlugin.command.packages', 'Packages'),\n description: this.translate('CommandBarUiPlugin.command.packages.description', 'Search for Neos packages'),\n icon: 'boxes',\n canHandleQueries: true,\n action: this.handleSearchNeosPackages.bind(this),\n };\n }\n }\n mapHotkeyIdToIcon(id) {\n let actionName = id.split('.').pop();\n // Some actions have the name 'toggle' with a suffix, e.g. 'toggleFullScreen'\n if (actionName.indexOf('toggle') >= 0) {\n actionName = 'toggle';\n }\n switch (actionName) {\n case 'toggle':\n return 'toggle-on';\n case 'reload':\n return 'redo';\n case 'cancel':\n case 'close':\n return 'window-close';\n case 'apply':\n return 'check';\n }\n return 'neos';\n }\n async componentDidMount() {\n const { plugins } = this.props;\n // Load 3rd party commands\n let pluginCommands = {};\n if (plugins) {\n for (const pluginName of Object.keys(plugins)) {\n const plugin = plugins[pluginName];\n try {\n const pluginResult = await plugin();\n pluginCommands = { ...pluginCommands, ...pluginResult };\n }\n catch (e) {\n logger.warn(`Could not load commands from plugin ${pluginName}`, e);\n }\n }\n }\n // Load commands from data source which are not available via the UI API\n const commands = await CommandsApi.getCommands().catch((error) => {\n logger.error('Failed to load commands', error);\n });\n // Load user preferences\n const preferences = await PreferencesApi.getPreferences().catch((error) => {\n logger.error('Failed to load user preferences', error);\n });\n if (!preferences || !commands)\n return;\n this.setState((prev) => ({\n loaded: true,\n ...preferences,\n commands: { ...prev.commands, ...commands, ...pluginCommands },\n }));\n }\n render() {\n const { commandBarOpen, toggleCommandBar } = this.props;\n const { commands, loaded, dragging, favouriteCommands, recentCommands, recentDocuments, showBranding } = this.state;\n return (React.createElement(\"div\", { className: styles.commandBarToolbarComponent },\n React.createElement(ToggleButton, { handleToggle: toggleCommandBar, disabled: !loaded, label: this.translate('ToggleButton.label', 'Search…'), title: this.translate('ToggleButton.title', 'Search for commands') }),\n loaded && (React.createElement(\"div\", { className: [styles.fullScreenLayer, commandBarOpen && styles.open].join(' '), onDragOver: (e) => e.preventDefault(), style: dragging ? { pointerEvents: 'all' } : null },\n React.createElement(CommandBar, { open: commandBarOpen, commands: commands, toggleOpen: toggleCommandBar, onDrag: this.setDragging, IconComponent: IconComponent, userPreferences: {\n favouriteCommands,\n recentCommands,\n recentDocuments,\n showBranding,\n addRecentCommand: PreferencesApi.addRecentCommand,\n setFavouriteCommands: PreferencesApi.setFavouriteCommands,\n }, translate: this.translate })))));\n }\n}\nCommandBarUiPlugin.propTypes = {\n addNode: PropTypes.func.isRequired,\n baseWorkspace: PropTypes.string.isRequired,\n commandBarOpen: PropTypes.bool,\n config: PropTypes.object.isRequired,\n discardAction: PropTypes.func.isRequired,\n documentNode: PropTypes.object,\n editPreviewMode: PropTypes.string.isRequired,\n editPreviewModes: PropTypes.object.isRequired,\n focusedNodeContextPath: PropTypes.string,\n handleHotkeyAction: PropTypes.func.isRequired,\n hotkeyRegistry: PropTypes.object.isRequired,\n i18nRegistry: PropTypes.object.isRequired,\n isWorkspaceReadOnly: PropTypes.bool,\n publishAction: PropTypes.func.isRequired,\n publishableNodes: PropTypes.array,\n publishableNodesInDocument: PropTypes.array,\n previewUrl: PropTypes.string,\n setActiveContentCanvasSrc: PropTypes.func.isRequired,\n setEditPreviewMode: PropTypes.func.isRequired,\n siteNode: PropTypes.object,\n toggleCommandBar: PropTypes.func.isRequired,\n};\nconst mapStateToProps = (state) => ({\n siteNode: selectors.CR.Nodes.siteNodeSelector(state),\n documentNode: selectors.CR.Nodes.documentNodeSelector(state),\n focusedNodeContextPath: selectors.CR.Nodes.focusedNodePathSelector(state),\n publishableNodes: selectors.CR.Workspaces.publishableNodesSelector(state),\n publishableNodesInDocument: selectors.CR.Workspaces.publishableNodesInDocumentSelector(state),\n isWorkspaceReadOnly: selectors.CR.Workspaces.isWorkspaceReadOnlySelector(state),\n baseWorkspace: selectors.CR.Workspaces.baseWorkspaceSelector(state),\n commandBarOpen: commandBarSelectors.commandBarOpen(state),\n editPreviewMode: selectors.UI.EditPreviewMode.currentEditPreviewMode(state),\n previewUrl: commandBarSelectors.previewUrl(state),\n});\nconst mapDispatchToProps = (dispatch) => ({\n handleHotkeyAction: dispatch,\n});\nconst mapGlobalRegistryToProps = neos((globalRegistry) => ({\n i18nRegistry: globalRegistry.get('i18n'),\n hotkeyRegistry: globalRegistry.get('hotkeys'),\n config: globalRegistry.get('frontendConfiguration').get('Shel.Neos.CommandBar:CommandBar'),\n nodeTypesRegistry: globalRegistry.get('@neos-project/neos-ui-contentrepository'),\n editPreviewModes: globalRegistry.get('frontendConfiguration').get('editPreviewModes'),\n plugins: globalRegistry.get('Shel.Neos.CommandBar').getChildrenAsObject('plugins'),\n}));\nexport default connect(() => ({}), {\n toggleCommandBar: commandBarActions.toggleCommandBar,\n addNode: actions.CR.Nodes.commenceCreation,\n setEditPreviewMode: actions.UI.EditPreviewMode.set,\n publishAction: actions.CR.Workspaces.publish,\n discardAction: actions.CR.Workspaces.commenceDiscard,\n setActiveContentCanvasSrc: actions.UI.ContentCanvas.setSrc,\n})(connect(mapStateToProps, mapDispatchToProps)(mapGlobalRegistryToProps(CommandBarUiPlugin)));\n"],"sourceRoot":""} \ No newline at end of file +{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Plugins/Shel.Neos.CommandBar/node_modules/@neos-project/neos-ui-extensibility/src/shims/vendor/react/index.js","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Plugins/Shel.Neos.CommandBar/node_modules/@neos-project/neos-ui-extensibility/src/shims/vendor/prop-types/index.js","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Plugins/Shel.Neos.CommandBar/node_modules/@neos-project/neos-ui-extensibility/src/shims/neosProjectPackages/neos-ui-redux-store/index.js","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Plugins/Shel.Neos.CommandBar/node_modules/@neos-project/neos-ui-extensibility/dist/readFromConsumerApi.js","webpack:///../commandbar/src/components/CommandListItem/CommandListItem.module.css?2cbc","webpack:///../commandbar/src/components/CommandBarDialog/CommandBarDialog.module.css?2c4b","webpack:///./src/actions/index.ts","webpack:///../commandbar/src/components/CommandBarFooter/CommandBarFooter.module.css?f513","webpack:///../commandbar/src/components/SearchBox/SearchBox.module.css?4eb4","webpack:///../commandbar/src/components/CommandList/CommandListing.module.css?e8fd","webpack:///../commandbar/src/components/CommandResultsView/CommandResultsView.module.css?2734","webpack:///./src/CommandBarUiPlugin.module.css?7d3c","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Plugins/Shel.Neos.CommandBar/node_modules/@neos-project/neos-ui-extensibility/src/shims/vendor/redux-actions/index.js","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Plugins/Shel.Neos.CommandBar/node_modules/@neos-project/neos-ui-extensibility/src/shims/vendor/react-redux/index.js","webpack:///../commandbar/src/components/CommandBarHeader/CommandBarHeader.module.css?3168","webpack:///../commandbar/src/components/ToggleButton/ToggleButton.module.css?31b0","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Plugins/Shel.Neos.CommandBar/node_modules/@neos-project/neos-ui-extensibility/dist/registry/SynchronousRegistry.js","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Plugins/Shel.Neos.CommandBar/node_modules/@neos-project/neos-ui-extensibility/src/shims/neosProjectPackages/neos-ui-decorators/index.js","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Plugins/Shel.Neos.CommandBar/node_modules/@neos-project/neos-ui-extensibility/src/shims/neosProjectPackages/react-ui-components/index.js","webpack:///../commandbar/src/components/IconWrapper/IconWrapper.module.css?6d91","webpack:///../commandbar/src/components/CommandBarFooter/Branding.module.css?5e45","webpack:///./src/index.js","webpack:///./src/manifest.js","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Plugins/Shel.Neos.CommandBar/node_modules/@neos-project/neos-ui-extensibility/dist/index.js","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Plugins/Shel.Neos.CommandBar/node_modules/@neos-project/neos-ui-extensibility/dist/createConsumerApi.js","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Plugins/Shel.Neos.CommandBar/node_modules/@neos-project/neos-ui-extensibility/dist/manifest.js","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Plugins/Shel.Neos.CommandBar/node_modules/@neos-project/neos-ui-extensibility/dist/registry/index.js","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Plugins/Shel.Neos.CommandBar/node_modules/@neos-project/neos-ui-extensibility/dist/registry/AbstractRegistry.js","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Plugins/Shel.Neos.CommandBar/node_modules/@neos-project/positional-array-sorter/dist/positionalArraySorter.js","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Plugins/Shel.Neos.CommandBar/node_modules/tslib/tslib.es6.js","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Plugins/Shel.Neos.CommandBar/node_modules/@neos-project/neos-ui-extensibility/dist/registry/SynchronousMetaRegistry.js","webpack:///../commandbar/src/hooks/useFunctionRef.ts","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Plugins/Shel.Neos.CommandBar/node_modules/@preact/signals-core/dist/signals-core.module.js","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Plugins/Shel.Neos.CommandBar/node_modules/@preact/signals-react/dist/signals.module.js","webpack:///../commandbar/src/helpers/flattenCommands.ts","webpack:///../commandbar/src/helpers/logger.ts","webpack:///../commandbar/src/helpers/clamp.ts","webpack:////Users/sebastianhelzle/Workspace/helzle.it/Packages/Plugins/Shel.Neos.CommandBar/node_modules/@leeoniya/ufuzzy/dist/uFuzzy.esm.js","webpack:///../commandbar/src/helpers/filterCommands.ts","webpack:///../commandbar/src/helpers/asset.ts","webpack:///../commandbar/src/helpers/classnames.ts","webpack:///../commandbar/src/state/commandBarMachine.ts","webpack:///../commandbar/src/state/commandBarReducer.ts","webpack:///../commandbar/src/components/IconWrapper/IconWrapper.tsx","webpack:///../commandbar/src/components/CommandBarFooter/Branding.tsx","webpack:///../commandbar/src/components/Icons/IconBack.tsx","webpack:///../commandbar/src/components/Icons/IconNeos.tsx","webpack:///../commandbar/src/components/Icons/IconSpinner.tsx","webpack:///../commandbar/src/components/Icons/IconStar.tsx","webpack:///../commandbar/src/components/Icons/IconPlay.tsx","webpack:///../commandbar/src/components/CommandBarFooter/CommandBarFooter.tsx","webpack:///../commandbar/src/components/SearchBox/SearchBox.tsx","webpack:///../commandbar/src/components/CommandBarHeader/CommandBarHeader.tsx","webpack:///../commandbar/src/components/CommandListItem/CommandListItem.tsx","webpack:///../commandbar/src/components/CommandList/CommandList.tsx","webpack:///../commandbar/src/components/CommandResultsView/CommandResultsView.tsx","webpack:///../commandbar/src/components/ToggleButton/ToggleButton.tsx","webpack:///../commandbar/src/state/CommandBarStateProvider.tsx","webpack:///../commandbar/src/state/CommandBarExecutor.tsx","webpack:///../commandbar/src/state/IntlProvider.tsx","webpack:///../commandbar/src/components/CommandBarDialog/CommandBarDialog.tsx","webpack:///../commandbar/src/CommandBar.tsx","webpack:///../neos-api/src/fetch.ts","webpack:///../neos-api/src/preferences.ts","webpack:///../neos-api/src/commands.ts","webpack:///../neos-api/src/documentation.ts","webpack:///../neos-api/src/packages.ts","webpack:///../neos-api/src/nodes.ts","webpack:///./src/CommandBarUiPlugin.tsx"],"names":["installedModules","__webpack_require__","moduleId","exports","module","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","getDefault","getModuleExports","object","property","prototype","hasOwnProperty","p","s","React","PropTypes","NeosUiReduxStore","__read","iterator","e","ar","next","done","push","error","__spreadArray","to","from","pack","arguments","length","Array","slice","concat","readFromConsumerApi","_a","args","_i","window","apply","Error","actionTypes","TOGGLE_COMMAND_BAR","actions","toggleCommandBar","reducer","state","action","_b","_c","plugins","commandBar","open","undefined","payload","selectors","commandBarOpen","previewUrl","ui","contentCanvas","reduxActions","reactRedux","extendStatics","__extends","b","setPrototypeOf","__proto__","TypeError","String","__","this","constructor","__importDefault","mod","AbstractRegistry_1","require","positional_array_sorter_1","SynchronousRegistry","_super","description","_this","_registry","set","position","entry","indexOfItemWithTheSameKey","findIndex","item","console","result","find","_getChildrenWrapped","searchKey","unsortedChildren","filter","indexOf","getChildrenAsObject","forEach","getChildren","map","has","Boolean","_getAllWrapped","getAllAsObject","getAllAsList","assign","id","NeosUiDecorators","ReactUiComponents","globalRegistry","frontendConfiguration","enabled","CommandBarUiPlugin","hotkeys","hotkeyRegistry","SynchronousMetaRegistry","createConsumerApi","createConsumerApi_1","readFromConsumerApi_1","index_1","manifest_1","createReadOnlyValue","writable","configurable","manifests","exposureMap","api","keys","identifier","options","bootstrap","SynchronousRegistry_1","SynchronousMetaRegistry_1","AbstractRegistry","SERIAL_VERSION_UID","tslib_1","positionalArraySorter","subject","idKey","e_1","e_2","e_3","e_4","_d","e_5","_e","e_6","_f","e_7","_g","positionAccessor","indexMapping","middleKeys","startKeys","endKeys","beforeKeys","afterKeys","index","positionValue","invalid","startsWith","weight","weightMatch","match","Number","reference","numberPosition","parseFloat","isNaN","isFinite","resultStart","resultMiddle","resultEnd","processedKeys","sortedWeights","dict","asc","weights","x","sort","a","reverse","addToResults","e_8","e_9","beforeWeights","beforeWeights_1","__values","beforeWeights_1_1","e_8_1","afterWeights","afterWeights_1","afterWeights_1_1","e_9_1","_h","_j","e_1_1","_k","_l","e_2_1","_m","_o","e_3_1","_p","_q","_r","_s","e_5_1","e_4_1","_t","_u","_v","_w","e_7_1","e_6_1","__spread","__assign","__rest","getOwnPropertySymbols","propertyIsEnumerable","__decorate","decorators","target","desc","getOwnPropertyDescriptor","Reflect","decorate","__param","paramIndex","decorator","__metadata","metadataKey","metadataValue","metadata","__awaiter","thisArg","_arguments","P","generator","Promise","resolve","reject","fulfilled","step","rejected","adopt","then","__generator","body","f","y","g","_","label","sent","trys","ops","verb","v","op","pop","__createBinding","k","k2","__exportStar","__spreadArrays","il","j","jl","__await","__asyncGenerator","asyncIterator","q","resume","fulfill","settle","shift","__asyncDelegator","__asyncValues","__makeTemplateObject","cooked","raw","__importStar","default","__classPrivateFieldGet","receiver","privateMap","__classPrivateFieldSet","useFunctionRef","fn","fnRef","current","h","S","u","U","w","subscribe","valueOf","toString","peek","N","createElement","WeakMap","$$typeof","defineProperties","type","data","props","ref","ReactCurrentDispatcher","useCallback","test","useReducer","Map","flattenCommands","commands","parentId","reduce","commandList","commandId","icon","subCommands","canHandleQueries","closeOnExecute","category","executeManually","absoluteCommandId","subCommandIds","subCommandId","PREFIX","ok","message","log","warn","debug","clamp","min","max","Math","cmp","Intl","Collator","compare","NEGS_RE","OPTS","interSplit","intraSplit","intraBound","interLft","interRgt","interChars","interIns","Infinity","intraChars","intraIns","intraContr","intraMode","intraSlice","intraSub","intraTrn","intraDel","intraFilt","term","info","haystack","needle","idx","chars","terms","interLft2","interLft1","start","ia","ib","lazyRepeat","limit","uFuzzy","opts","_intraSplit","_interSplit","_intraBound","intraRules","_intraSlice","_intraIns","_intraSub","_intraTrn","_intraDel","plen","withIntraSplit","RegExp","trimRe","contrsRe","split","replace","toLowerCase","prepQuery","capt","interOR","parts","reTpl","contrs","fill","pi","lftIdx","rgtIdx","lftChar","rgtChar","numChars","variants","intraInsTpl","join","preTpl","sufTpl","interCharsTpl","idxs","out","query","withIntraBound","interBound","queryR","partsLen","len","field","interRgt2","interRgt1","ranges","mayDiscard","ii","mhstr","idxAcc","disc","lft2","lft1","rgt2","rgt1","inter","intra","refine","group","termLen","groupLen","fullMatch","idxOf","refineMatch","lftCharIdx","rgtCharIdx","isPre","isSuf","junk","junkIdx","m2","found","re","exec","charIdx","refLen","ri","lastRi","idxInNext","matchLen","offset","prepend","search","outOfOrder","infoThresh","preFiltered","negsRe","needles","matches","negs","trim","terms2","ti","permute","perm","matchedIdxs","Set","ni","size","preFiltered2","matched","add","retInfo","retOrder","acc","_info","order","_search","latinize","accents","A","E","I","O","C","accentsMap","accentsTpl","accentsRe","replacer","strings","arr","_mark","part","_append","highlight","str","mark","accum","append","tmp","substring","fr","uf","assert","condition","classnames","STATUS","TRANSITION","ACTION","machine","initial","COLLAPSED","states","collapsed","on","UPDATE_SEARCH","IDLE","EXPAND","SET_SEARCH_WORD","REFRESH_COMMANDS","HIGHLIGHT_NEXT_ITEM","idle","RESET_HIGHLIGHT","HIGHLIGHT_NEXT_COMMAND","HIGHLIGHT_PREVIOUS_ITEM","HIGHLIGHT_PREVIOUS_COMMAND","CANCEL","RESET_SEARCH_OR_LEAVE_GROUP","EXECUTE_COMMAND","EXECUTING_COMMAND","ADD_RECENTLY_USED","SET_ACTIVE_COMMAND","GO_TO_PARENT_GROUP","LEAVE_GROUP","SELECT_GROUP","RESET_SEARCH","SET_GROUP","ADD_FAVOURITE","REMOVE_FAVOURITE","executingCommand","UPDATE_RESULT","DISPLAYING_RESULT","FINISH_COMMAND","UNSET_ACTIVE_COMMAND","displayingResult","UPDATE_COMMAND_QUERY","SET_COMMAND_QUERY","RESET_OPTION_HIGHLIGHT","HIGHLIGHT_NEXT_OPTION","HIGHLIGHT_PREVIOUS_OPTION","UNSET_RESULT","runAction","nextState","event","searchWord","highlightedItem","availableCommandIds","filterCommands","selectedCommandGroup","favourites","recentCommands","availableCommands","values","command","includes","sortCommands","favouriteCommands","aIsRecent","bIsRecent","aIsFavourite","bIsFavourite","localeCompare","availableCommandNames","indices","highlightedOption","commandQuery","expanded","activeCommandId","activeCommandMessage","success","view","resultCommandId","unshift","commandBarReducer","transition","actionCallback","nextStateNode","status","memo","children","className","showBranding","useCommandBarState","translate","useIntl","href","title","rel","xmlns","width","height","viewBox","gradientUnits","x1","y1","x2","y2","stopColor","transform","IconBack","IconNeos","IconSpinner","IconStar","IconPlay","Icon","runningCommand","updateResultsTimer","executeCommand","useCommandExecutor","inputRef","handleChange","clearTimeout","setTimeout","handleKeyPress","preventDefault","stopPropagation","focus","Fragment","placeholder","autoFocus","onChange","onKeyUp","onClick","isDisplayingResults","CommandListItem","onItemSelect","highlightedId","onToggleFavourite","commandType","getCommandType","isHighlighted","isFavourite","navRef","useRef","querySelector","scrollIntoView","behavior","block","handleToggleFavourite","suggestions","highlightedCommand","highlightedIndex","handleToggle","disabled","CommandBarContext","CommandBarStateProvider","IconComponent","userPreferences","dispatch","createAppState","initialState","commandBarState","async","addRecentCommand","catch","setFavouriteCommands","spin","Provider","CommandInputContext","createContext","useContext","CommandBarExecutor","toggleOpen","dialogRef","handleKeyEnteredRef","defaultPrevented","metaKey","contains","document","location","origin","actionResult","finally","executeCommandRef","windowKeyEventHandler","addEventListener","removeEventListener","IntlContext","IntlProvider","onDrag","isDragging","dialogPosition","left","innerWidth","top","innerHeight","dragStateOffset","offsetLeft","offsetTop","hasBeenDragged","dialogStyle","visibility","reposition","dialogSize","getBoundingClientRect","handleDragStart","tagName","dataTransfer","setData","dropEffect","effectAllowed","clientX","clientY","handleDragDrop","onResize","parentElement","draggable","onDragStart","style","fetchData","endpoint","params","method","url","encodeURIComponent","fetch","credentials","JSON","stringify","headers","Accept","response","statusText","json","text","setPreference","getPreferences","commandIds","getCommands","searchNeosDocs","searchNeosPackages","searchNodes","node","super","buildCommandsFromHotkeys","handleHotkeyAction","config","carry","mapHotkeyIdToIcon","buildCommandsFromEditPreviewModes","setEditPreviewMode","editPreviewModes","i18nRegistry","isEditingMode","editPreviewMode","handleAddNode","addNode","documentNode","focusedNodeContextPath","contextPath","handleSearchNode","siteNode","setActiveContentCanvasSrc","results","nodetype","uri","handleSearchNeosDocs","handleSearchNeosPackages","handlePublish","publishableNodesInDocument","publishAction","baseWorkspace","count","handlePublishAll","publishableNodes","handleDiscard","discardAction","handleDiscardAll","setDragging","dragging","setState","paramsOrFallback","fallback","loaded","recentDocuments","searchDocuments","publishDiscard","publish","publishAll","discard","discardAll","quickActions","switchEditPreviewMode","openPreview","features","actionName","pluginCommands","pluginName","plugin","pluginResult","preferences","prev","onDragOver","pointerEvents","propTypes","func","isRequired","string","bool","isWorkspaceReadOnly","array","mapGlobalRegistryToProps","nodeTypesRegistry","CR","Nodes","commenceCreation","UI","EditPreviewMode","Workspaces","commenceDiscard","ContentCanvas","setSrc","siteNodeSelector","documentNodeSelector","focusedNodePathSelector","publishableNodesSelector","publishableNodesInDocumentSelector","isWorkspaceReadOnlySelector","baseWorkspaceSelector","currentEditPreviewMode"],"mappings":";aACE,IAAIA,EAAmB,GAGvB,SAASC,oBAAoBC,GAG5B,GAAGF,EAAiBE,GACnB,OAAOF,EAAiBE,GAAUC,QAGnC,IAAIC,EAASJ,EAAiBE,GAAY,CACzCG,EAAGH,EACHI,GAAG,EACHH,QAAS,IAUV,OANAI,EAAQL,GAAUM,KAAKJ,EAAOD,QAASC,EAAQA,EAAOD,QAASF,qBAG/DG,EAAOE,GAAI,EAGJF,EAAOD,QAKfF,oBAAoBQ,EAAIF,EAGxBN,oBAAoBS,EAAIV,EAGxBC,oBAAoBU,EAAI,SAASR,EAASS,EAAMC,GAC3CZ,oBAAoBa,EAAEX,EAASS,IAClCG,OAAOC,eAAeb,EAASS,EAAM,CAAEK,YAAY,EAAMC,IAAKL,KAKhEZ,oBAAoBkB,EAAI,SAAShB,GACX,oBAAXiB,QAA0BA,OAAOC,aAC1CN,OAAOC,eAAeb,EAASiB,OAAOC,YAAa,CAAEC,MAAO,WAE7DP,OAAOC,eAAeb,EAAS,aAAc,CAAEmB,OAAO,KAQvDrB,oBAAoBsB,EAAI,SAASD,EAAOE,GAEvC,GADU,EAAPA,IAAUF,EAAQrB,oBAAoBqB,IAC/B,EAAPE,EAAU,OAAOF,EACpB,GAAW,EAAPE,GAA8B,iBAAVF,GAAsBA,GAASA,EAAMG,WAAY,OAAOH,EAChF,IAAII,EAAKX,OAAOY,OAAO,MAGvB,GAFA1B,oBAAoBkB,EAAEO,GACtBX,OAAOC,eAAeU,EAAI,UAAW,CAAET,YAAY,EAAMK,MAAOA,IACtD,EAAPE,GAA4B,iBAATF,EAAmB,IAAI,IAAIM,KAAON,EAAOrB,oBAAoBU,EAAEe,EAAIE,EAAK,SAASA,GAAO,OAAON,EAAMM,IAAQC,KAAK,KAAMD,IAC9I,OAAOF,GAIRzB,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xB,GACtDmtB,uBAAwB,YAAUuD,GAAGC,MAAMU,wBAAwBrxB,GACnEmuB,iBAAkB,YAAUuC,GAAGK,WAAWO,yBAAyBtxB,GACnE8tB,2BAA4B,YAAU4C,GAAGK,WAAWQ,mCAAmCvxB,GACvFswB,oBAAqB,YAAUI,GAAGK,WAAWS,4BAA4BxxB,GACzEguB,cAAe,YAAU0C,GAAGK,WAAWU,sBAAsBzxB,GAC7DU,eAAgB,aAAoBA,eAAeV,GACnD+sB,gBAAiB,YAAU8D,GAAGC,gBAAgBY,uBAAuB1xB,GACrEW,WAAY,aAAoBA,WAAWX,KAEnB+mB,IAAa,CACrCuF,mBAAoBvF,IAiBrB,CAA6CyJ,GAAyB","file":"Plugin.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 21);\n","import readFromConsumerApi from '../../../../dist/readFromConsumerApi';\n\nmodule.exports = readFromConsumerApi('vendor')().React;\n","import readFromConsumerApi from '../../../../dist/readFromConsumerApi';\n\nmodule.exports = readFromConsumerApi('vendor')().PropTypes;\n","import readFromConsumerApi from '../../../../dist/readFromConsumerApi';\n\nmodule.exports = readFromConsumerApi('NeosProjectPackages')().NeosUiReduxStore;\n","\"use strict\";\nvar __read = (this && this.__read) || function (o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n};\nvar __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n};\nexports.__esModule = true;\nfunction readFromConsumerApi(key) {\n return function () {\n var _a;\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n if (window['@Neos:HostPluginAPI'] && window['@Neos:HostPluginAPI'][\"@\".concat(key)]) {\n return (_a = window['@Neos:HostPluginAPI'])[\"@\".concat(key)].apply(_a, __spreadArray([], __read(args), false));\n }\n throw new Error('You are trying to read from a consumer api that hasn\\'t been initialized yet!');\n };\n}\nexports[\"default\"] = readFromConsumerApi;\n//# sourceMappingURL=readFromConsumerApi.js.map","// extracted by mini-css-extract-plugin\nmodule.exports = {\"commandListItem\":\"CommandListItem-module__commandListItem___2u7xD\",\"highlighted\":\"CommandListItem-module__highlighted___1LR6R\",\"disabled\":\"CommandListItem-module__disabled___7wCym\",\"label\":\"CommandListItem-module__label___1bznO\",\"description\":\"CommandListItem-module__description___2RTG3\",\"type\":\"CommandListItem-module__type___1C7PR\",\"favouriteButton\":\"CommandListItem-module__favouriteButton___3n3yV\",\"isFavourite\":\"CommandListItem-module__isFavourite___KSM9p\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"commandBar\":\"CommandBarDialog-module__commandBar___1Hb5s\",\"hasResults\":\"CommandBarDialog-module__hasResults___3iM8B\",\"resultsWrap\":\"CommandBarDialog-module__resultsWrap___2gd3U\",\"expanded\":\"CommandBarDialog-module__expanded___jby7g\",\"split\":\"CommandBarDialog-module__split___66TVs\"};","import { createAction, handleActions } from 'redux-actions';\nexport const actionTypes = {\n TOGGLE_COMMAND_BAR: 'TOGGLE_COMMAND_BAR',\n};\nconst toggleCommandBar = createAction(actionTypes.TOGGLE_COMMAND_BAR);\nexport const actions = {\n toggleCommandBar,\n};\nexport const reducer = handleActions({\n TOGGLE_COMMAND_BAR: (state, action) => {\n var _a, _b, _c;\n return ({\n ...state,\n plugins: {\n ...state.plugins,\n commandBar: {\n open: ((_a = action.payload) === null || _a === void 0 ? void 0 : _a.open) !== undefined ? action.payload.open : !((_c = (_b = state.plugins) === null || _b === void 0 ? void 0 : _b.commandBar) === null || _c === void 0 ? void 0 : _c.open),\n },\n },\n });\n },\n}, {\n plugins: {\n commandBar: {\n open: false,\n },\n },\n});\nexport const selectors = {\n commandBarOpen: (state) => { var _a, _b; return (_b = (_a = state.plugins) === null || _a === void 0 ? void 0 : _a.commandBar) === null || _b === void 0 ? void 0 : _b.open; },\n previewUrl: (state) => { var _a, _b; return (_b = (_a = state.ui) === null || _a === void 0 ? void 0 : _a.contentCanvas) === null || _b === void 0 ? void 0 : _b.previewUrl; },\n};\n","// extracted by mini-css-extract-plugin\nmodule.exports = {\"commandBarFooter\":\"CommandBarFooter-module__commandBarFooter___2mcre\",\"breadcrumb\":\"CommandBarFooter-module__breadcrumb___1Ul24\",\"activity\":\"CommandBarFooter-module__activity___2GXJU\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"searchBox\":\"SearchBox-module__searchBox___1SEtn\",\"expandButton\":\"SearchBox-module__expandButton___B2jYv\",\"executeButton\":\"SearchBox-module__executeButton___3hg_l\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"results\":\"CommandListing-module__results___23Rve\",\"noResults\":\"CommandListing-module__noResults___Mb89V\",\"disabled\":\"CommandListing-module__disabled___6gpPj\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"commandResultsView\":\"CommandResultsView-module__commandResultsView___xLqwb\",\"message\":\"CommandResultsView-module__message___NhUkR\",\"results\":\"CommandResultsView-module__results___1t6jB\",\"noResults\":\"CommandResultsView-module__noResults___2ksIF\",\"disabled\":\"CommandResultsView-module__disabled___OmNvX\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"fullScreenLayer\":\"CommandBarUiPlugin-module__fullScreenLayer___1cUx4\",\"open\":\"CommandBarUiPlugin-module__open___1Bjxj\",\"commandBarToolbarComponent\":\"CommandBarUiPlugin-module__commandBarToolbarComponent___1agRY\"};","import readFromConsumerApi from '../../../../dist/readFromConsumerApi';\n\nmodule.exports = readFromConsumerApi('vendor')().reduxActions;\n","import readFromConsumerApi from '../../../../dist/readFromConsumerApi';\n\nmodule.exports = readFromConsumerApi('vendor')().reactRedux;\n","// extracted by mini-css-extract-plugin\nmodule.exports = {\"commandBarHeader\":\"CommandBarHeader-module__commandBarHeader___3Y2hR\",\"backButton\":\"CommandBarHeader-module__backButton___1qIGu\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"toggleButton\":\"ToggleButton-module__toggleButton___2wPs-\",\"buttonIcon\":\"ToggleButton-module__buttonIcon___UjFjw\"};","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nexports.__esModule = true;\nvar AbstractRegistry_1 = __importDefault(require(\"./AbstractRegistry\"));\nvar positional_array_sorter_1 = __importDefault(require(\"@neos-project/positional-array-sorter\"));\nvar SynchronousRegistry = (function (_super) {\n __extends(SynchronousRegistry, _super);\n function SynchronousRegistry(description) {\n var _this = _super.call(this, description) || this;\n _this._registry = [];\n return _this;\n }\n SynchronousRegistry.prototype.set = function (key, value, position) {\n if (position === void 0) { position = 0; }\n if (typeof key !== 'string') {\n throw new Error('Key must be a string');\n }\n if (typeof position !== 'string' && typeof position !== 'number') {\n throw new Error('Position must be a string or a number');\n }\n var entry = { key: key, value: value };\n if (position) {\n entry.position = position;\n }\n var indexOfItemWithTheSameKey = this._registry.findIndex(function (item) { return item.key === key; });\n if (indexOfItemWithTheSameKey === -1) {\n this._registry.push(entry);\n }\n else {\n this._registry[indexOfItemWithTheSameKey] = entry;\n }\n return value;\n };\n SynchronousRegistry.prototype.get = function (key) {\n if (typeof key !== 'string') {\n console.error('Key must be a string');\n return null;\n }\n var result = this._registry.find(function (item) { return item.key === key; });\n return result ? result.value : null;\n };\n SynchronousRegistry.prototype._getChildrenWrapped = function (searchKey) {\n var unsortedChildren = this._registry.filter(function (item) { return item.key.indexOf(searchKey + '/') === 0; });\n return (0, positional_array_sorter_1[\"default\"])(unsortedChildren);\n };\n SynchronousRegistry.prototype.getChildrenAsObject = function (searchKey) {\n var result = {};\n this._getChildrenWrapped(searchKey).forEach(function (item) {\n result[item.key] = item.value;\n });\n return result;\n };\n SynchronousRegistry.prototype.getChildren = function (searchKey) {\n return this._getChildrenWrapped(searchKey).map(function (item) { return item.value; });\n };\n SynchronousRegistry.prototype.has = function (key) {\n if (typeof key !== 'string') {\n console.error('Key must be a string');\n return false;\n }\n return Boolean(this._registry.find(function (item) { return item.key === key; }));\n };\n SynchronousRegistry.prototype._getAllWrapped = function () {\n return (0, positional_array_sorter_1[\"default\"])(this._registry);\n };\n SynchronousRegistry.prototype.getAllAsObject = function () {\n var result = {};\n this._getAllWrapped().forEach(function (item) {\n result[item.key] = item.value;\n });\n return result;\n };\n SynchronousRegistry.prototype.getAllAsList = function () {\n return this._getAllWrapped().map(function (item) { return Object.assign({ id: item.key }, item.value); });\n };\n return SynchronousRegistry;\n}(AbstractRegistry_1[\"default\"]));\nexports[\"default\"] = SynchronousRegistry;\n//# sourceMappingURL=SynchronousRegistry.js.map","import readFromConsumerApi from '../../../../dist/readFromConsumerApi';\n\nmodule.exports = readFromConsumerApi('NeosProjectPackages')().NeosUiDecorators;\n","import readFromConsumerApi from '../../../../dist/readFromConsumerApi';\n\nmodule.exports = readFromConsumerApi('NeosProjectPackages')().ReactUiComponents;\n","// extracted by mini-css-extract-plugin\nmodule.exports = {\"iconWrap\":\"IconWrapper-module__iconWrap___1Z3nD\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"madeWithLove\":\"Branding-module__madeWithLove___2ibna\"};","require('./manifest');\n","import manifest, { SynchronousRegistry } from '@neos-project/neos-ui-extensibility';\n\nimport { reducer, actions } from './actions';\nimport CommandBarUiPlugin from './CommandBarUiPlugin';\n\nmanifest('Shel.Neos.CommandBar:CommandBar', {}, (globalRegistry, { frontendConfiguration }) => {\n /** @type {{ enabled: boolean, features: { loadTestCommands: boolean } }} pluginConfig */\n const pluginConfig = frontendConfiguration['Shel.Neos.CommandBar:CommandBar'];\n const { enabled } = pluginConfig;\n\n if (!enabled) {\n return;\n }\n\n // Create our new registry for 3rd party command bar plugins\n globalRegistry.set(\n 'Shel.Neos.CommandBar',\n new SynchronousRegistry(`\n # Shel.Neos.CommandBar 3rd party commands\n `)\n );\n\n // Register commandbar component in the primary toolbar\n globalRegistry.get('containers').set('PrimaryToolbar/Middle/CommandBar', CommandBarUiPlugin);\n\n // Register reducer\n globalRegistry.get('reducers').set('Shel.Neos.CommandBar', { reducer });\n\n // Register hotkeys\n if (frontendConfiguration.hotkeys !== null && frontendConfiguration.hotkeys.length !== 0) {\n const hotkeyRegistry = globalRegistry.get('hotkeys');\n hotkeyRegistry.set('Shel.Neos.CommandBar.toggle.CMD', {\n description: 'Toggle command bar',\n action: actions.toggleCommandBar,\n });\n hotkeyRegistry.set('Shel.Neos.CommandBar.toggle.CTRL', {\n description: 'Toggle command bar',\n action: actions.toggleCommandBar,\n });\n }\n});\n","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nexports.__esModule = true;\nexports.SynchronousMetaRegistry = exports.SynchronousRegistry = exports.readFromConsumerApi = exports.createConsumerApi = void 0;\nvar createConsumerApi_1 = __importDefault(require(\"./createConsumerApi\"));\nexports.createConsumerApi = createConsumerApi_1[\"default\"];\nvar readFromConsumerApi_1 = __importDefault(require(\"./readFromConsumerApi\"));\nexports.readFromConsumerApi = readFromConsumerApi_1[\"default\"];\nvar index_1 = require(\"./registry/index\");\nexports.SynchronousRegistry = index_1.SynchronousRegistry;\nexports.SynchronousMetaRegistry = index_1.SynchronousMetaRegistry;\nexports[\"default\"] = (0, readFromConsumerApi_1[\"default\"])('manifest');\n//# sourceMappingURL=index.js.map","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nexports.__esModule = true;\nvar manifest_1 = __importDefault(require(\"./manifest\"));\nvar createReadOnlyValue = function (value) { return ({\n value: value,\n writable: false,\n enumerable: false,\n configurable: true\n}); };\nfunction createConsumerApi(manifests, exposureMap) {\n var api = {};\n Object.keys(exposureMap).forEach(function (key) {\n Object.defineProperty(api, key, createReadOnlyValue(exposureMap[key]));\n });\n Object.defineProperty(api, '@manifest', createReadOnlyValue((0, manifest_1[\"default\"])(manifests)));\n Object.defineProperty(window, '@Neos:HostPluginAPI', createReadOnlyValue(api));\n}\nexports[\"default\"] = createConsumerApi;\n//# sourceMappingURL=createConsumerApi.js.map","\"use strict\";\nexports.__esModule = true;\nexports[\"default\"] = (function (manifests) {\n return function (identifier, options, bootstrap) {\n var _a;\n manifests.push((_a = {},\n _a[identifier] = {\n options: options,\n bootstrap: bootstrap\n },\n _a));\n };\n});\n//# sourceMappingURL=manifest.js.map","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nexports.__esModule = true;\nexports.SynchronousMetaRegistry = exports.SynchronousRegistry = void 0;\nvar SynchronousRegistry_1 = __importDefault(require(\"./SynchronousRegistry\"));\nexports.SynchronousRegistry = SynchronousRegistry_1[\"default\"];\nvar SynchronousMetaRegistry_1 = __importDefault(require(\"./SynchronousMetaRegistry\"));\nexports.SynchronousMetaRegistry = SynchronousMetaRegistry_1[\"default\"];\n//# sourceMappingURL=index.js.map","\"use strict\";\nexports.__esModule = true;\nvar AbstractRegistry = (function () {\n function AbstractRegistry(description) {\n this.SERIAL_VERSION_UID = 'd8a5aa78-978e-11e6-ae22-56b6b6499611';\n this.description = description;\n }\n return AbstractRegistry;\n}());\nexports[\"default\"] = AbstractRegistry;\n//# sourceMappingURL=AbstractRegistry.js.map","\"use strict\";\nexports.__esModule = true;\nvar tslib_1 = require(\"tslib\");\nvar positionalArraySorter = function (subject, position, idKey) {\n var e_1, _a, e_2, _b, e_3, _c, e_4, _d, e_5, _e, e_6, _f, e_7, _g;\n if (position === void 0) { position = 'position'; }\n if (idKey === void 0) { idKey = 'key'; }\n var positionAccessor = typeof position === 'string' ? function (value) { return value[position]; } : position;\n var indexMapping = {};\n var middleKeys = {};\n var startKeys = {};\n var endKeys = {};\n var beforeKeys = {};\n var afterKeys = {};\n subject.forEach(function (item, index) {\n var key = item[idKey] ? item[idKey] : String(index);\n indexMapping[key] = index;\n var positionValue = positionAccessor(item);\n var position = String(positionValue ? positionValue : index);\n var invalid = false;\n if (position.startsWith('start')) {\n var weightMatch = position.match(/start\\s+(\\d+)/);\n var weight = weightMatch && weightMatch[1] ? Number(weightMatch[1]) : 0;\n if (!startKeys[weight]) {\n startKeys[weight] = [];\n }\n startKeys[weight].push(key);\n }\n else if (position.startsWith('end')) {\n var weightMatch = position.match(/end\\s+(\\d+)/);\n var weight = weightMatch && weightMatch[1] ? Number(weightMatch[1]) : 0;\n if (!endKeys[weight]) {\n endKeys[weight] = [];\n }\n endKeys[weight].push(key);\n }\n else if (position.startsWith('before')) {\n var match = position.match(/before\\s+(\\S+)(\\s+(\\d+))?/);\n if (!match) {\n invalid = true;\n }\n else {\n var reference = match[1];\n var weight = match[3] ? Number(match[3]) : 0;\n if (!beforeKeys[reference]) {\n beforeKeys[reference] = {};\n }\n if (!beforeKeys[reference][weight]) {\n beforeKeys[reference][weight] = [];\n }\n beforeKeys[reference][weight].push(key);\n }\n }\n else if (position.startsWith('after')) {\n var match = position.match(/after\\s+(\\S+)(\\s+(\\d+))?/);\n if (!match) {\n invalid = true;\n }\n else {\n var reference = match[1];\n var weight = match[3] ? Number(match[3]) : 0;\n if (!afterKeys[reference]) {\n afterKeys[reference] = {};\n }\n if (!afterKeys[reference][weight]) {\n afterKeys[reference][weight] = [];\n }\n afterKeys[reference][weight].push(key);\n }\n }\n else {\n invalid = true;\n }\n if (invalid) {\n var numberPosition = parseFloat(position);\n if (isNaN(numberPosition) || !isFinite(numberPosition)) {\n numberPosition = index;\n }\n if (!middleKeys[numberPosition]) {\n middleKeys[numberPosition] = [];\n }\n middleKeys[numberPosition].push(key);\n }\n });\n var resultStart = [];\n var resultMiddle = [];\n var resultEnd = [];\n var processedKeys = [];\n var sortedWeights = function (dict, asc) {\n var weights = Object.keys(dict).map(function (x) { return Number(x); }).sort(function (a, b) { return a - b; });\n return asc ? weights : weights.reverse();\n };\n var addToResults = function (keys, result) {\n keys.forEach(function (key) {\n var e_8, _a, e_9, _b;\n if (processedKeys.indexOf(key) >= 0) {\n return;\n }\n processedKeys.push(key);\n if (beforeKeys[key]) {\n var beforeWeights = sortedWeights(beforeKeys[key], true);\n try {\n for (var beforeWeights_1 = tslib_1.__values(beforeWeights), beforeWeights_1_1 = beforeWeights_1.next(); !beforeWeights_1_1.done; beforeWeights_1_1 = beforeWeights_1.next()) {\n var i = beforeWeights_1_1.value;\n addToResults(beforeKeys[key][i], result);\n }\n }\n catch (e_8_1) { e_8 = { error: e_8_1 }; }\n finally {\n try {\n if (beforeWeights_1_1 && !beforeWeights_1_1.done && (_a = beforeWeights_1[\"return\"])) _a.call(beforeWeights_1);\n }\n finally { if (e_8) throw e_8.error; }\n }\n }\n result.push(key);\n if (afterKeys[key]) {\n var afterWeights = sortedWeights(afterKeys[key], false);\n try {\n for (var afterWeights_1 = tslib_1.__values(afterWeights), afterWeights_1_1 = afterWeights_1.next(); !afterWeights_1_1.done; afterWeights_1_1 = afterWeights_1.next()) {\n var i = afterWeights_1_1.value;\n addToResults(afterKeys[key][i], result);\n }\n }\n catch (e_9_1) { e_9 = { error: e_9_1 }; }\n finally {\n try {\n if (afterWeights_1_1 && !afterWeights_1_1.done && (_b = afterWeights_1[\"return\"])) _b.call(afterWeights_1);\n }\n finally { if (e_9) throw e_9.error; }\n }\n }\n });\n };\n try {\n for (var _h = tslib_1.__values(sortedWeights(startKeys, false)), _j = _h.next(); !_j.done; _j = _h.next()) {\n var i = _j.value;\n addToResults(startKeys[i], resultStart);\n }\n }\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\n finally {\n try {\n if (_j && !_j.done && (_a = _h[\"return\"])) _a.call(_h);\n }\n finally { if (e_1) throw e_1.error; }\n }\n try {\n for (var _k = tslib_1.__values(sortedWeights(middleKeys, true)), _l = _k.next(); !_l.done; _l = _k.next()) {\n var i = _l.value;\n addToResults(middleKeys[i], resultMiddle);\n }\n }\n catch (e_2_1) { e_2 = { error: e_2_1 }; }\n finally {\n try {\n if (_l && !_l.done && (_b = _k[\"return\"])) _b.call(_k);\n }\n finally { if (e_2) throw e_2.error; }\n }\n try {\n for (var _m = tslib_1.__values(sortedWeights(endKeys, true)), _o = _m.next(); !_o.done; _o = _m.next()) {\n var i = _o.value;\n addToResults(endKeys[i], resultEnd);\n }\n }\n catch (e_3_1) { e_3 = { error: e_3_1 }; }\n finally {\n try {\n if (_o && !_o.done && (_c = _m[\"return\"])) _c.call(_m);\n }\n finally { if (e_3) throw e_3.error; }\n }\n try {\n for (var _p = tslib_1.__values(Object.keys(beforeKeys)), _q = _p.next(); !_q.done; _q = _p.next()) {\n var key = _q.value;\n if (processedKeys.indexOf(key) >= 0) {\n continue;\n }\n try {\n for (var _r = (e_5 = void 0, tslib_1.__values(sortedWeights(beforeKeys[key], false))), _s = _r.next(); !_s.done; _s = _r.next()) {\n var i = _s.value;\n addToResults(beforeKeys[key][i], resultStart);\n }\n }\n catch (e_5_1) { e_5 = { error: e_5_1 }; }\n finally {\n try {\n if (_s && !_s.done && (_e = _r[\"return\"])) _e.call(_r);\n }\n finally { if (e_5) throw e_5.error; }\n }\n }\n }\n catch (e_4_1) { e_4 = { error: e_4_1 }; }\n finally {\n try {\n if (_q && !_q.done && (_d = _p[\"return\"])) _d.call(_p);\n }\n finally { if (e_4) throw e_4.error; }\n }\n try {\n for (var _t = tslib_1.__values(Object.keys(afterKeys)), _u = _t.next(); !_u.done; _u = _t.next()) {\n var key = _u.value;\n if (processedKeys.indexOf(key) >= 0) {\n continue;\n }\n try {\n for (var _v = (e_7 = void 0, tslib_1.__values(sortedWeights(afterKeys[key], false))), _w = _v.next(); !_w.done; _w = _v.next()) {\n var i = _w.value;\n addToResults(afterKeys[key][i], resultMiddle);\n }\n }\n catch (e_7_1) { e_7 = { error: e_7_1 }; }\n finally {\n try {\n if (_w && !_w.done && (_g = _v[\"return\"])) _g.call(_v);\n }\n finally { if (e_7) throw e_7.error; }\n }\n }\n }\n catch (e_6_1) { e_6 = { error: e_6_1 }; }\n finally {\n try {\n if (_u && !_u.done && (_f = _t[\"return\"])) _f.call(_t);\n }\n finally { if (e_6) throw e_6.error; }\n }\n var sortedKeys = tslib_1.__spread(resultStart, resultMiddle, resultEnd);\n return sortedKeys.map(function (key) { return indexMapping[key]; }).map(function (i) { return subject[i]; });\n};\nexports[\"default\"] = positionalArraySorter;\n//# sourceMappingURL=positionalArraySorter.js.map","/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport function __createBinding(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n}\r\n\r\nexport function __exportStar(m, exports) {\r\n for (var p in m) if (p !== \"default\" && !exports.hasOwnProperty(p)) exports[p] = m[p];\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n};\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];\r\n result.default = mod;\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, privateMap) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to get private field on non-instance\");\r\n }\r\n return privateMap.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, privateMap, value) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to set private field on non-instance\");\r\n }\r\n privateMap.set(receiver, value);\r\n return value;\r\n}\r\n","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nexports.__esModule = true;\nvar SynchronousRegistry_1 = __importDefault(require(\"./SynchronousRegistry\"));\nvar SynchronousMetaRegistry = (function (_super) {\n __extends(SynchronousMetaRegistry, _super);\n function SynchronousMetaRegistry() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n SynchronousMetaRegistry.prototype.set = function (key, value) {\n if (value.SERIAL_VERSION_UID !== 'd8a5aa78-978e-11e6-ae22-56b6b6499611') {\n throw new Error('You can only add registries to a meta registry');\n }\n return _super.prototype.set.call(this, key, value);\n };\n return SynchronousMetaRegistry;\n}(SynchronousRegistry_1[\"default\"]));\nexports[\"default\"] = SynchronousMetaRegistry;\n//# sourceMappingURL=SynchronousMetaRegistry.js.map","import { useRef } from 'react';\n/**\n * A custom hook that creates a ref for a function, and updates it on every render.\n * The new value is always the same function, but the function's context changes on every render.\n */\nexport default function useFunctionRef(fn) {\n const fnRef = useRef(fn);\n fnRef.current = fn;\n return fnRef;\n}\n","function i(){throw new Error(\"Cycle detected\")}function t(){if(!(s>1)){var i,t=!1;while(void 0!==r){var h=r;r=void 0;n++;while(void 0!==h){var o=h.o;h.o=void 0;h.f&=-3;if(!(8&h.f)&&d(h))try{h.c()}catch(h){if(!t){i=h;t=!0}}h=o}}n=0;s--;if(t)throw i}else s--}function h(i){if(s>0)return i();s++;try{return i()}finally{t()}}var o=void 0,r=void 0,s=0,n=0,f=0;function v(i){if(void 0!==o){var t=i.n;if(void 0===t||t.t!==o){t={i:0,S:i,p:o.s,n:void 0,t:o,e:void 0,x:void 0,r:t};if(void 0!==o.s)o.s.n=t;o.s=t;i.n=t;if(32&o.f)i.S(t);return t}else if(-1===t.i){t.i=0;if(void 0!==t.n){t.n.p=t.p;if(void 0!==t.p)t.p.n=t.n;t.p=o.s;t.n=void 0;o.s.n=t;o.s=t}return t}}}function e(i){this.v=i;this.i=0;this.n=void 0;this.t=void 0}e.prototype.h=function(){return!0};e.prototype.S=function(i){if(this.t!==i&&void 0===i.e){i.x=this.t;if(void 0!==this.t)this.t.e=i;this.t=i}};e.prototype.U=function(i){if(void 0!==this.t){var t=i.e,h=i.x;if(void 0!==t){t.x=h;i.e=void 0}if(void 0!==h){h.e=t;i.x=void 0}if(i===this.t)this.t=h}};e.prototype.subscribe=function(i){var t=this;return p(function(){var h=t.value,o=32&this.f;this.f&=-33;try{i(h)}finally{this.f|=o}})};e.prototype.valueOf=function(){return this.value};e.prototype.toString=function(){return this.value+\"\"};e.prototype.peek=function(){return this.v};Object.defineProperty(e.prototype,\"value\",{get:function(){var i=v(this);if(void 0!==i)i.i=this.i;return this.v},set:function(h){if(h!==this.v){if(n>100)i();this.v=h;this.i++;f++;s++;try{for(var o=this.t;void 0!==o;o=o.x)o.t.N()}finally{t()}}}});function u(i){return new e(i)}function d(i){for(var t=i.s;void 0!==t;t=t.n)if(t.S.i!==t.i||!t.S.h()||t.S.i!==t.i)return!0;return!1}function c(i){for(var t=i.s;void 0!==t;t=t.n){var h=t.S.n;if(void 0!==h)t.r=h;t.S.n=t;t.i=-1;if(void 0===t.n){i.s=t;break}}}function a(i){var t=i.s,h=void 0;while(void 0!==t){var o=t.p;if(-1===t.i){t.S.U(t);if(void 0!==o)o.n=t.n;if(void 0!==t.n)t.n.p=o}else h=t;t.S.n=t.r;if(void 0!==t.r)t.r=void 0;t=o}i.s=h}function l(i){e.call(this,void 0);this.x=i;this.s=void 0;this.g=f-1;this.f=4}(l.prototype=new e).h=function(){this.f&=-3;if(1&this.f)return!1;if(32==(36&this.f))return!0;this.f&=-5;if(this.g===f)return!0;this.g=f;this.f|=1;if(this.i>0&&!d(this)){this.f&=-2;return!0}var i=o;try{c(this);o=this;var t=this.x();if(16&this.f||this.v!==t||0===this.i){this.v=t;this.f&=-17;this.i++}}catch(i){this.v=i;this.f|=16;this.i++}o=i;a(this);this.f&=-2;return!0};l.prototype.S=function(i){if(void 0===this.t){this.f|=36;for(var t=this.s;void 0!==t;t=t.n)t.S.S(t)}e.prototype.S.call(this,i)};l.prototype.U=function(i){if(void 0!==this.t){e.prototype.U.call(this,i);if(void 0===this.t){this.f&=-33;for(var t=this.s;void 0!==t;t=t.n)t.S.U(t)}}};l.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(var i=this.t;void 0!==i;i=i.x)i.t.N()}};l.prototype.peek=function(){if(!this.h())i();if(16&this.f)throw this.v;return this.v};Object.defineProperty(l.prototype,\"value\",{get:function(){if(1&this.f)i();var t=v(this);this.h();if(void 0!==t)t.i=this.i;if(16&this.f)throw this.v;return this.v}});function w(i){return new l(i)}function y(i){var h=i.u;i.u=void 0;if(\"function\"==typeof h){s++;var r=o;o=void 0;try{h()}catch(t){i.f&=-2;i.f|=8;_(i);throw t}finally{o=r;t()}}}function _(i){for(var t=i.s;void 0!==t;t=t.n)t.S.U(t);i.x=void 0;i.s=void 0;y(i)}function g(i){if(o!==this)throw new Error(\"Out-of-order effect\");a(this);o=i;this.f&=-2;if(8&this.f)_(this);t()}function b(i){this.x=i;this.u=void 0;this.s=void 0;this.o=void 0;this.f=32}b.prototype.c=function(){var i=this.S();try{if(!(8&this.f)&&void 0!==this.x)this.u=this.x()}finally{i()}};b.prototype.S=function(){if(1&this.f)i();this.f|=1;this.f&=-9;y(this);c(this);s++;var t=o;o=this;return g.bind(this,t)};b.prototype.N=function(){if(!(2&this.f)){this.f|=2;this.o=r;r=this}};b.prototype.d=function(){this.f|=8;if(!(1&this.f))_(this)};function p(i){var t=new b(i);try{t.c()}catch(i){t.d();throw i}return t.d.bind(t)}export{e as Signal,h as batch,w as computed,p as effect,u as signal};//# sourceMappingURL=signals-core.module.js.map\n","import n,{__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED as r,useMemo as t,useRef as e,useEffect as i}from\"react\";import{Signal as u,effect as f,signal as o,computed as a}from\"@preact/signals-core\";export{Signal,batch,computed,effect,signal}from\"@preact/signals-core\";var c,v=n.createElement;n.createElement=function(n,r){if(\"string\"==typeof n&&r)for(var t in r){var e=r[t];if(\"children\"!==t&&e instanceof u)r[t]=e.value}return v.apply(this,arguments)};var l=new WeakMap;function p(n){if(c)c();c=n&&n.S()}var s=v(\"a\").$$typeof;Object.defineProperties(u.prototype,{$$typeof:{configurable:!0,value:s},type:{configurable:!0,value:function(n){return n.data.value}},props:{configurable:!0,get:function(){return{data:this}}},ref:{configurable:!0,value:null}});var g,b=!1,m=function(){return{}};Object.defineProperty(r.ReactCurrentDispatcher,\"current\",{get:function(){return g},set:function(n){g=n;if(!b)if(n&&!function(n){var r=d.get(n);if(void 0!==r)return r;var t=n.useCallback.length<2||/Invalid/.test(n.useCallback);d.set(n,t);return t}(n)){b=!0;var r=n.useReducer(m,{})[1];b=!1;var t=l.get(r);if(!t){t=function(n){var r;f(function(){r=this});r.c=n;return r}(r);l.set(r,t)}else t.c=r;p(t)}else p()}});var d=new Map;function h(n){return t(function(){return o(n)},[])}function y(n){var r=e(n);r.current=n;return t(function(){return a(function(){return r.current()})},[])}function j(n){var r=e(n);r.current=n;i(function(){return f(function(){return r.current()})},[])}export{y as useComputed,h as useSignal,j as useSignalEffect};//# sourceMappingURL=signals.module.js.map\n","/**\n * This method converts the hierarchical command list into a flat list of commands which is more convenient\n * for internal processing, whereas the hierarchical command list is more convenient for the user.\n */\nexport default function flattenCommands(commands, parentId = null) {\n return Object.keys(commands).reduce((commandList, commandId) => {\n const { icon, description, name, subCommands, action, canHandleQueries, closeOnExecute, category, executeManually, } = commands[commandId];\n // Create an uniquely identifiable command id for the flat command list\n const absoluteCommandId = parentId ? `${parentId}.${commandId}` : commandId;\n // Create list of available subcommand names\n const subCommandIds = subCommands\n ? Object.keys(subCommands).map((subCommandId) => `${absoluteCommandId}.${subCommandId}`)\n : [];\n // Insert the processed command into the flat command list\n commandList[absoluteCommandId] = {\n id: absoluteCommandId,\n name,\n icon,\n description,\n action,\n canHandleQueries,\n subCommandIds,\n parentId,\n closeOnExecute,\n category,\n executeManually,\n };\n // Insert subcommands into the list\n if (subCommandIds.length > 0) {\n return {\n ...commandList,\n ...flattenCommands(subCommands, absoluteCommandId),\n };\n }\n return commandList;\n }, {});\n}\n","const PREFIX = '%c[COMMANDBAR]';\nconst logger = {\n ok: (message, ...args) => console.log(PREFIX, 'color: green', message, ...args),\n error: (message, ...args) => console.log(PREFIX, 'color: red', message, ...args),\n warn: (message, ...args) => console.warn(PREFIX, 'color: orange', message, ...args),\n debug: \n // @ts-ignore\n process.env.NODE_ENV === 'production'\n ? () => null\n : (message, ...args) => console.debug(PREFIX, 'color: lightblue', message, ...args),\n};\nexport default logger;\n","export default function clamp(value, min, max) {\n return Math.max(min, Math.min(max, value));\n}\n","/**\n* Copyright (c) 2023, Leon Sorokin\n* All rights reserved. (MIT Licensed)\n*\n* uFuzzy.js (μFuzzy)\n* A tiny, efficient fuzzy matcher that doesn't suck\n* https://github.com/leeoniya/uFuzzy (v1.0.3)\n*/\n\nconst cmp = new Intl.Collator('en').compare;\n\nconst inf = Infinity;\n\nconst NEGS_RE = /(?:\\s+|^)-[a-z\\d]+/ig;\n\nconst OPTS = {\n\t// term segmentation & punct/whitespace merging\n\tinterSplit: \"[^A-Za-z0-9']+\",\n\tintraSplit: '[a-z][A-Z]',\n\n\t// intra bounds that will be used to increase lft1/rgt1 info counters\n\tintraBound: '[A-Za-z][0-9]|[0-9][A-Za-z]|[a-z][A-Z]',\n\n\t// inter-bounds mode\n\t// 2 = strict (will only match 'man' on whitepace and punct boundaries: Mega Man, Mega_Man, mega.man)\n\t// 1 = loose (plus allowance for alpha-num and case-change boundaries: MegaMan, 0007man)\n\t// 0 = any (will match 'man' as any substring: megamaniac)\n\tinterLft: 0,\n\tinterRgt: 0,\n\n\t// allowance between terms\n\tinterChars: '.',\n\tinterIns: inf,\n\n\t// allowance between chars in terms\n\tintraChars: \"[a-z\\\\d']\", // internally case-insensitive\n\tintraIns: 0,\n\n\tintraContr: \"'[a-z]{1,2}\\\\b\",\n\n\t// multi-insert or single-error mode\n\tintraMode: 0,\n\n\t// single-error bounds for errors within terms, default requires exact first char\n\tintraSlice: [1, inf],\n\n\t// single-error tolerance toggles\n\tintraSub: 0,\n\tintraTrn: 0,\n\tintraDel: 0,\n\n\t// can post-filter matches that are too far apart in distance or length\n\t// (since intraIns is between each char, it can accum to nonsense matches)\n\tintraFilt: (term, match, index) => true, // should this also accept WIP info?\n\n\t// final sorting fn\n\tsort: (info, haystack, needle) => {\n\t\tlet {\n\t\t\tidx,\n\t\t\tchars,\n\t\t\tterms,\n\t\t\tinterLft2,\n\t\t\tinterLft1,\n\t\t//\tinterRgt2,\n\t\t//\tinterRgt1,\n\t\t\tstart,\n\t\t\tintraIns,\n\t\t\tinterIns,\n\t\t} = info;\n\n\t\treturn idx.map((v, i) => i).sort((ia, ib) => (\n\t\t\t// most contig chars matched\n\t\t\tchars[ib] - chars[ia] ||\n\t\t\t// least char intra-fuzz (most contiguous)\n\t\t\tintraIns[ia] - intraIns[ib] ||\n\t\t\t// most prefix bounds, boosted by full term matches\n\t\t\t(\n\t\t\t\t(terms[ib] + interLft2[ib] + 0.5 * interLft1[ib]) -\n\t\t\t\t(terms[ia] + interLft2[ia] + 0.5 * interLft1[ia])\n\t\t\t) ||\n\t\t\t// highest density of match (least span)\n\t\t//\tspan[ia] - span[ib] ||\n\t\t\t// highest density of match (least term inter-fuzz)\n\t\t\tinterIns[ia] - interIns[ib] ||\n\t\t\t// earliest start of match\n\t\t\tstart[ia] - start[ib] ||\n\t\t\t// alphabetic\n\t\t\tcmp(haystack[idx[ia]], haystack[idx[ib]])\n\t\t));\n\t},\n};\n\nconst lazyRepeat = (chars, limit) => (\n\tlimit == 0 ? '' :\n\tlimit == 1 ? chars + '??' :\n\tlimit == inf ? chars + '*?' :\n\t chars + `{0,${limit}}?`\n);\n\nconst mode2Tpl = '(?:\\\\b|_)';\n\nfunction uFuzzy(opts) {\n\topts = Object.assign({}, OPTS, opts);\n\n\tconst {\n\t\tinterLft,\n\t\tinterRgt,\n\t\tintraMode,\n\t\tintraSlice,\n\t\tintraIns,\n\t\tintraSub,\n\t\tintraTrn,\n\t\tintraDel,\n\t\tintraContr,\n\t\tintraSplit: _intraSplit,\n\t\tinterSplit: _interSplit,\n\t\tintraBound: _intraBound,\n\t\tintraChars,\n\t} = opts;\n\n\tlet { intraRules } = opts;\n\n\tif (intraRules == null) {\n\t\tintraRules = p => {\n\t\t\t// default is exact term matches only\n\t\t\tlet _intraSlice = OPTS.intraSlice, // requires first char\n\t\t\t\t_intraIns = 0,\n\t\t\t\t_intraSub = 0,\n\t\t\t\t_intraTrn = 0,\n\t\t\t\t_intraDel = 0;\n\n\t\t\tlet plen = p.length;\n\n\t\t\t// prevent junk matches by requiring stricter rules for short terms\n\t\t\tif (plen <= 4) {\n\t\t\t\tif (plen >= 3) {\n\t\t\t\t\t// one swap in non-first char when 3-4 chars\n\t\t\t\t\t_intraTrn = Math.min(intraTrn, 1);\n\n\t\t\t\t\t// or one insertion when 4 chars\n\t\t\t\t\tif (plen == 4)\n\t\t\t\t\t\t_intraIns = Math.min(intraIns, 1);\n\t\t\t\t}\n\t\t\t\t// else exact match when 1-2 chars\n\t\t\t}\n\t\t\t// use supplied opts\n\t\t\telse {\n\t\t\t\t_intraSlice = intraSlice;\n\t\t\t\t_intraIns = intraIns,\n\t\t\t\t_intraSub = intraSub,\n\t\t\t\t_intraTrn = intraTrn,\n\t\t\t\t_intraDel = intraDel;\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\tintraSlice: _intraSlice,\n\t\t\t\tintraIns: _intraIns,\n\t\t\t\tintraSub: _intraSub,\n\t\t\t\tintraTrn: _intraTrn,\n\t\t\t\tintraDel: _intraDel,\n\t\t\t};\n\t\t};\n\t}\n\n\tlet withIntraSplit = !!_intraSplit;\n\n\tlet intraSplit = new RegExp(_intraSplit, 'g');\n\tlet interSplit = new RegExp(_interSplit, 'g');\n\n\tlet trimRe = new RegExp('^' + _interSplit + '|' + _interSplit + '$', 'g');\n\tlet contrsRe = new RegExp(intraContr, 'gi');\n\n\tconst split = needle => {\n\t\tneedle = needle.replace(trimRe, '').toLowerCase();\n\n\t\tif (withIntraSplit)\n\t\t\tneedle = needle.replace(intraSplit, m => m[0] + ' ' + m[1]);\n\n\t\treturn needle.split(interSplit).filter(t => t != '');\n\t};\n\n\tconst prepQuery = (needle, capt = 0, interOR = false) => {\n\t\t// split on punct, whitespace, num-alpha, and upper-lower boundaries\n\t\tlet parts = split(needle);\n\n\t\tif (parts.length == 0)\n\t\t\tthrow `Empty needle!`;\n\n\t\t// split out any detected contractions for each term that become required suffixes\n\t\tlet contrs = Array(parts.length).fill('');\n\t\tparts = parts.map((p, pi) => p.replace(contrsRe, m => {\n\t\t\tcontrs[pi] = m;\n\t\t\treturn '';\n\t\t}));\n\n\t\t// array of regexp tpls for each term\n\t\tlet reTpl;\n\n\t\t// allows single mutations within each term\n\t\tif (intraMode == 1) {\n\t\t\treTpl = parts.map((p, pi) => {\n\t\t\t\tlet {\n\t\t\t\t\tintraSlice,\n\t\t\t\t\tintraIns,\n\t\t\t\t\tintraSub,\n\t\t\t\t\tintraTrn,\n\t\t\t\t\tintraDel,\n\t\t\t\t} = intraRules(p);\n\n\t\t\t\tif (intraIns + intraSub + intraTrn + intraDel == 0)\n\t\t\t\t\treturn p + contrs[pi];\n\n\t\t\t\tlet [lftIdx, rgtIdx] = intraSlice;\n\t\t\t\tlet lftChar = p.slice(0, lftIdx); // prefix\n\t\t\t\tlet rgtChar = p.slice(rgtIdx); // suffix\n\n\t\t\t\tlet chars = p.slice(lftIdx, rgtIdx);\n\n\t\t\t\t// neg lookahead to prefer matching 'Test' instead of 'tTest' in ManifestTest or fittest\n\t\t\t\t// but skip when search term contains leading repetition (aardvark, aaa)\n\t\t\t\tif (intraIns == 1 && lftChar.length == 1 && lftChar != chars[0])\n\t\t\t\t\tlftChar += '(?!' + lftChar + ')';\n\n\t\t\t\tlet numChars = chars.length;\n\n\t\t\t\tlet variants = [];\n\n\t\t\t\t// variants with single char substitutions\n\t\t\t\tif (intraSub) {\n\t\t\t\t\tfor (let i = 0; i < numChars; i++)\n\t\t\t\t\t\tvariants.push(lftChar + chars.slice(0, i) + intraChars + chars.slice(i + 1) + rgtChar);\n\t\t\t\t}\n\n\t\t\t\t// variants with single transpositions\n\t\t\t\tif (intraTrn) {\n\t\t\t\t\tfor (let i = 0; i < numChars - 1; i++) {\n\t\t\t\t\t\tif (chars[i] != chars[i+1])\n\t\t\t\t\t\t\tvariants.push(lftChar + chars.slice(0, i) + chars[i+1] + chars[i] + chars.slice(i + 2) + rgtChar);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// variants with single char omissions\n\t\t\t\tif (intraDel) {\n\t\t\t\t\tfor (let i = 0; i < numChars; i++)\n\t\t\t\t\t\tvariants.push(lftChar + chars.slice(0, i + 1) + '?' + chars.slice(i + 1) + rgtChar);\n\t\t\t\t}\n\n\t\t\t\t// variants with single char insertions\n\t\t\t\tif (intraIns) {\n\t\t\t\t\tlet intraInsTpl = lazyRepeat(intraChars, 1);\n\n\t\t\t\t\tfor (let i = 0; i < numChars; i++)\n\t\t\t\t\t\tvariants.push(lftChar + chars.slice(0, i) + intraInsTpl + chars.slice(i) + rgtChar);\n\t\t\t\t}\n\n\t\t\t\tlet reTpl = '(?:' + p + '|' + variants.join('|') + ')' + contrs[pi];\n\n\t\t\t//\tconsole.log(reTpl);\n\n\t\t\t\treturn reTpl;\n\t\t\t});\n\t\t}\n\t\telse {\n\t\t\tlet intraInsTpl = lazyRepeat(intraChars, intraIns);\n\n\t\t\t// capture at char level\n\t\t\tif (capt == 2 && intraIns > 0) {\n\t\t\t\t// sadly, we also have to capture the inter-term junk via parenth-wrapping .*?\n\t\t\t\t// to accum other capture groups' indices for \\b boosting during scoring\n\t\t\t\tintraInsTpl = ')(' + intraInsTpl + ')(';\n\t\t\t}\n\n\t\t\treTpl = parts.map((p, pi) => p.split('').map((c, i, chars) => {\n\t\t\t\t// neg lookahead to prefer matching 'Test' instead of 'tTest' in ManifestTest or fittest\n\t\t\t\t// but skip when search term contains leading repetition (aardvark, aaa)\n\t\t\t\tif (intraIns == 1 && i == 0 && chars.length > 1 && c[i] != c[i+1])\n\t\t\t\t\tc += '(?!' + c + ')';\n\n\t\t\t\treturn c;\n\t\t\t}).join(intraInsTpl) + contrs[pi]);\n\t\t}\n\n\t//\tconsole.log(reTpl);\n\n\t\t// this only helps to reduce initial matches early when they can be detected\n\t\t// TODO: might want a mode 3 that excludes _\n\t\tlet preTpl = interLft == 2 ? mode2Tpl : '';\n\t\tlet sufTpl = interRgt == 2 ? mode2Tpl : '';\n\n\t\tlet interCharsTpl = sufTpl + lazyRepeat(opts.interChars, opts.interIns) + preTpl;\n\n\t\t// capture at word level\n\t\tif (capt > 0) {\n\t\t\tif (interOR) {\n\t\t\t\t// this is basically for doing .matchAll() occurence counting and highlighting without needing permuted ooo needles\n\t\t\t\treTpl = preTpl + '(' + reTpl.join(')' + sufTpl + '|' + preTpl + '(') + ')' + sufTpl;\n\t\t\t}\n\t\t\telse {\n\t\t\t\t// sadly, we also have to capture the inter-term junk via parenth-wrapping .*?\n\t\t\t\t// to accum other capture groups' indices for \\b boosting during scoring\n\t\t\t\treTpl = '(' + reTpl.join(')(' + interCharsTpl + ')(') + ')';\n\t\t\t\treTpl = '(.?' + preTpl + ')' + reTpl + '(' + sufTpl + '.*)'; // nit: trailing capture here assumes interIns = Inf\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\treTpl = reTpl.join(interCharsTpl);\n\t\t\treTpl = preTpl + reTpl + sufTpl;\n\t\t}\n\n\t//\tconsole.log(reTpl);\n\n\t\treturn [new RegExp(reTpl, 'i'), parts, contrs];\n\t};\n\n\tconst filter = (haystack, needle, idxs) => {\n\n\t\tlet out = [];\n\t\tlet [query] = prepQuery(needle);\n\n\t\tif (idxs != null) {\n\t\t\tfor (let i = 0; i < idxs.length; i++) {\n\t\t\t\tlet idx = idxs[i];\n\t\t\t\tquery.test(haystack[idx]) && out.push(idx);\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\tfor (let i = 0; i < haystack.length; i++)\n\t\t\t\tquery.test(haystack[i]) && out.push(i);\n\t\t}\n\n\t\treturn out;\n\t};\n\n\tlet withIntraBound = !!_intraBound;\n\n\tlet interBound = new RegExp(_interSplit);\n\tlet intraBound = new RegExp(_intraBound);\n\n\tconst info = (idxs, haystack, needle) => {\n\n\t\tlet [query, parts, contrs] = prepQuery(needle, 1);\n\t\tlet [queryR] = prepQuery(needle, 2);\n\t\tlet partsLen = parts.length;\n\n\t\tlet len = idxs.length;\n\n\t\tlet field = Array(len).fill(0);\n\n\t\tlet info = {\n\t\t\t// idx in haystack\n\t\t\tidx: Array(len),\n\n\t\t\t// start of match\n\t\t\tstart: field.slice(),\n\t\t\t// length of match\n\t\t//\tspan: field.slice(),\n\n\t\t\t// contiguous chars matched\n\t\t\tchars: field.slice(),\n\n\t\t\t// contiguous (no fuzz) and bounded terms (intra=0, lft2/1, rgt2/1)\n\t\t\t// excludes terms that are contiguous but have < 2 bounds (substrings)\n\t\t\tterms: field.slice(),\n\n\t\t\t// cumulative length of unmatched chars (fuzz) within span\n\t\t\tinterIns: field.slice(), // between terms\n\t\t\tintraIns: field.slice(), // within terms\n\n\t\t\t// interLft/interRgt counters\n\t\t\tinterLft2: field.slice(),\n\t\t\tinterRgt2: field.slice(),\n\t\t\tinterLft1: field.slice(),\n\t\t\tinterRgt1: field.slice(),\n\n\t\t\tranges: Array(len),\n\t\t};\n\n\t\t// might discard idxs based on bounds checks\n\t\tlet mayDiscard = interLft == 1 || interRgt == 1;\n\n\t\tlet ii = 0;\n\n\t\tfor (let i = 0; i < idxs.length; i++) {\n\t\t\tlet mhstr = haystack[idxs[i]];\n\n\t\t\t// the matched parts are [full, junk, term, junk, term, junk]\n\t\t\tlet m = mhstr.match(query);\n\n\t\t\t// leading junk\n\t\t\tlet start = m.index + m[1].length;\n\n\t\t\tlet idxAcc = start;\n\t\t//\tlet span = m[0].length;\n\n\t\t\tlet disc = false;\n\t\t\tlet lft2 = 0;\n\t\t\tlet lft1 = 0;\n\t\t\tlet rgt2 = 0;\n\t\t\tlet rgt1 = 0;\n\t\t\tlet chars = 0;\n\t\t\tlet terms = 0;\n\t\t\tlet inter = 0;\n\t\t\tlet intra = 0;\n\n\t\t\tlet refine = [];\n\n\t\t\tfor (let j = 0, k = 2; j < partsLen; j++, k+=2) {\n\t\t\t\tlet group = m[k].toLowerCase();\n\t\t\t\tlet term = parts[j] + contrs[j];\n\t\t\t\tlet termLen = term.length;\n\t\t\t\tlet groupLen = group.length;\n\t\t\t\tlet fullMatch = group == term;\n\n\t\t\t\t// this won't handle the case when an exact match exists across the boundary of the current group and the next junk\n\t\t\t\t// e.g. blob,ob when searching for 'bob' but finding the earlier `blob` (with extra insertion)\n\t\t\t\tif (!fullMatch && m[k+1].length >= termLen) {\n\t\t\t\t\t// probe for exact match in inter junk\n\t\t\t\t\tlet idxOf = m[k+1].toLowerCase().indexOf(term);\n\n\t\t\t\t\tif (idxOf > -1) {\n\t\t\t\t\t\trefine.push(idxAcc, idxOf, termLen);\n\t\t\t\t\t\tidxAcc += refineMatch(m, k, idxOf, termLen);\n\t\t\t\t\t\tgroup = term;\n\t\t\t\t\t\tgroupLen = termLen;\n\t\t\t\t\t\tfullMatch = true;\n\n\t\t\t\t\t\tif (j == 0)\n\t\t\t\t\t\t\tstart = idxAcc;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (mayDiscard || fullMatch) {\n\t\t\t\t\t// does group's left and/or right land on \\b\n\t\t\t\t\tlet lftCharIdx = idxAcc - 1;\n\t\t\t\t\tlet rgtCharIdx = idxAcc + groupLen;\n\n\t\t\t\t\tlet isPre = true;\n\t\t\t\t\tlet isSuf = true;\n\n\t\t\t\t\t// prefix info\n\t\t\t\t\tif (lftCharIdx == -1 || interBound.test(mhstr[lftCharIdx]))\n\t\t\t\t\t\tfullMatch && lft2++;\n\t\t\t\t\telse {\n\t\t\t\t\t\tif (interLft == 2) {\n\t\t\t\t\t\t\tdisc = true;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (withIntraBound && intraBound.test(mhstr[lftCharIdx] + mhstr[lftCharIdx + 1]))\n\t\t\t\t\t\t\tfullMatch && lft1++;\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tif (interLft == 1) {\n\t\t\t\t\t\t\t\t// regexps are eager, so try to improve the match by probing forward inter junk for exact match at a boundary\n\t\t\t\t\t\t\t\tlet junk = m[k+1];\n\t\t\t\t\t\t\t\tlet junkIdx = idxAcc + groupLen;\n\n\t\t\t\t\t\t\t\tif (junk.length >= termLen) {\n\t\t\t\t\t\t\t\t\tlet idxOf = 0;\n\t\t\t\t\t\t\t\t\tlet found = false;\n\t\t\t\t\t\t\t\t\tlet re = new RegExp(term, 'ig');\n\n\t\t\t\t\t\t\t\t\tlet m2;\n\t\t\t\t\t\t\t\t\twhile (m2 = re.exec(junk)) {\n\t\t\t\t\t\t\t\t\t\tidxOf = m2.index;\n\n\t\t\t\t\t\t\t\t\t\tlet charIdx = junkIdx + idxOf;\n\t\t\t\t\t\t\t\t\t\tlet lftCharIdx = charIdx - 1;\n\n\n\t\t\t\t\t\t\t\t\t\tif (lftCharIdx == -1 || interBound.test(mhstr[lftCharIdx])) {\n\t\t\t\t\t\t\t\t\t\t\tlft2++;\n\t\t\t\t\t\t\t\t\t\t\tfound = true;\n\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\telse if (intraBound.test(mhstr[lftCharIdx] + mhstr[charIdx])) {\n\t\t\t\t\t\t\t\t\t\t\tlft1++;\n\t\t\t\t\t\t\t\t\t\t\tfound = true;\n\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tif (found) {\n\t\t\t\t\t\t\t\t\t\t// identical to exact term refinement pass above\n\t\t\t\t\t\t\t\t\t\trefine.push(idxAcc, idxOf, termLen);\n\t\t\t\t\t\t\t\t\t\tidxAcc += refineMatch(m, k, idxOf, termLen);\n\t\t\t\t\t\t\t\t\t\tgroup = term;\n\t\t\t\t\t\t\t\t\t\tgroupLen = termLen;\n\t\t\t\t\t\t\t\t\t\tfullMatch = true;\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tdisc = true;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tisPre = false;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// suffix info\n\t\t\t\t\tif (rgtCharIdx == mhstr.length || interBound.test(mhstr[rgtCharIdx]))\n\t\t\t\t\t\tfullMatch && rgt2++;\n\t\t\t\t\telse {\n\t\t\t\t\t\tif (interRgt == 2) {\n\t\t\t\t\t\t\tdisc = true;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (withIntraBound && intraBound.test(mhstr[rgtCharIdx - 1] + mhstr[rgtCharIdx]))\n\t\t\t\t\t\t\tfullMatch && rgt1++;\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tif (interRgt == 1) {\n\t\t\t\t\t\t\t\tdisc = true;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tisSuf = false;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif (fullMatch) {\n\t\t\t\t\t\tchars += termLen;\n\n\t\t\t\t\t\tif (isPre && isSuf)\n\t\t\t\t\t\t\tterms++;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (groupLen > termLen)\n\t\t\t\t\tintra += groupLen - termLen; // intraFuzz\n\n\t\t\t\tif (j > 0)\n\t\t\t\t\tinter += m[k-1].length; // interFuzz\n\n\t\t\t\t// TODO: group here is lowercased, which is okay for length cmp, but not more case-sensitive filts\n\t\t\t\tif (!opts.intraFilt(term, group, idxAcc)) {\n\t\t\t\t\tdisc = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tif (j < partsLen - 1)\n\t\t\t\t\tidxAcc += groupLen + m[k+1].length;\n\t\t\t}\n\n\t\t\tif (!disc) {\n\t\t\t\tinfo.idx[ii] = idxs[i];\n\t\t\t\tinfo.interLft2[ii] = lft2;\n\t\t\t\tinfo.interLft1[ii] = lft1;\n\t\t\t\tinfo.interRgt2[ii] = rgt2;\n\t\t\t\tinfo.interRgt1[ii] = rgt1;\n\t\t\t\tinfo.chars[ii] = chars;\n\t\t\t\tinfo.terms[ii] = terms;\n\t\t\t\tinfo.interIns[ii] = inter;\n\t\t\t\tinfo.intraIns[ii] = intra;\n\n\t\t\t\tinfo.start[ii] = start;\n\t\t\t//\tinfo.span[ii] = span;\n\n\t\t\t\t// ranges\n\t\t\t\tlet m = mhstr.match(queryR);\n\t\t\t\tlet ranges = info.ranges[ii] = [];\n\n\t\t\t\tlet idxAcc = m.index + m[1].length;\n\t\t\t\tlet from = idxAcc;\n\t\t\t\tlet to = idxAcc;\n\n\t\t\t\tlet refLen = refine.length;\n\t\t\t\tlet ri = refLen > 0 ? 0 : Infinity;\n\t\t\t\tlet lastRi = refLen - 3;\n\n\t\t\t\tfor (let i = 2; i < m.length; i++) {\n\t\t\t\t\tlet len = m[i].length;\n\n\t\t\t\t\tif (ri <= lastRi && refine[ri] == idxAcc) {\n\t\t\t\t\t\tlet idxInNext = refine[ri+1];\n\t\t\t\t\t\tlet matchLen = refine[ri+2];\n\t\t\t\t\t\tlet offset = idxInNext + matchLen;\n\n\t\t\t\t\t\tidxAcc += len + offset;\n\t\t\t\t\t\tfrom = idxAcc - matchLen;\n\t\t\t\t\t\tm[i+1] = m[i+1].slice(offset);\n\n\t\t\t\t\t\tri+=3;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t\tidxAcc += len;\n\n\t\t\t\t\tif (i % 2 == 0)\n\t\t\t\t\t\tto = idxAcc;\n\t\t\t\t\telse if (len > 0) {\n\t\t\t\t\t\tranges.push(from, to);\n\t\t\t\t\t\tfrom = to = idxAcc;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (to > from)\n\t\t\t\t\tranges.push(from, to);\n\n\t\t\t\tii++;\n\t\t\t}\n\t\t}\n\n\t\t// trim arrays\n\t\tif (ii < idxs.length) {\n\t\t\tfor (let k in info)\n\t\t\t\tinfo[k] = info[k].slice(0, ii);\n\t\t}\n\n\t\treturn info;\n\t};\n\n\tconst refineMatch = (m, k, idxInNext, termLen) => {\n\t\t// shift the current group into the prior junk\n\t\tlet prepend = m[k] + m[k+1].slice(0, idxInNext);\n\t\tm[k-1] += prepend;\n\t\tm[k] = m[k+1].slice(idxInNext, idxInNext + termLen);\n\t\tm[k+1] = m[k+1].slice(idxInNext + termLen);\n\t\treturn prepend.length;\n\t};\n\n\t// returns [idxs, info, order]\n\tconst _search = (haystack, needle, outOfOrder = false, infoThresh = 1e3, preFiltered) => {\n\t\tlet needles = null;\n\t\tlet matches = null;\n\n\t\tlet negs = [];\n\n\t\tneedle = needle.replace(NEGS_RE, m => {\n\t\t\tnegs.push(m.trim().slice(1));\n\t\t\treturn '';\n\t\t});\n\n\t\tlet negsRe;\n\n\t\tif (negs.length > 0) {\n\t\t\tnegsRe = new RegExp(negs.join('|'), 'i');\n\n\t\t\tif (needle.trim() == '') {\n\t\t\t\tlet idxs = [];\n\n\t\t\t\tfor (let i = 0; i < haystack.length; i++) {\n\t\t\t\t\tif (!negsRe.test(haystack[i]))\n\t\t\t\t\t\tidxs.push(i);\n\t\t\t\t}\n\n\t\t\t\treturn [idxs, null, null];\n\t\t\t}\n\t\t}\n\n\t//\tconsole.log(negs);\n\t//\tconsole.log(needle);\n\n\t\tif (outOfOrder) {\n\t\t\t// since uFuzzy is an AND-based search, we can iteratively pre-reduce the haystack by searching\n\t\t\t// for each term in isolation before running permutations on what's left.\n\t\t\t// this is a major perf win. e.g. searching \"test man ger pp a\" goes from 570ms -> 14ms\n\t\t\tlet terms = split(needle);\n\n\t\t\tif (terms.length > 1) {\n\t\t\t\t// longest -> shortest\n\t\t\t\tlet terms2 = terms.slice().sort((a, b) => b.length - a.length);\n\n\t\t\t\tfor (let ti = 0; ti < terms2.length; ti++) {\n\t\t\t\t\t// no haystack item contained all terms\n\t\t\t\t\tif (preFiltered && preFiltered.length == 0)\n\t\t\t\t\t\treturn [[], null, null];\n\n\t\t\t\t\tpreFiltered = filter(haystack, terms2[ti], preFiltered);\n\t\t\t\t}\n\n\t\t\t\tneedles = permute(terms).map(perm => perm.join(' '));\n\n\t\t\t\t// filtered matches for each needle excluding same matches for prior needles\n\t\t\t\tmatches = [];\n\n\t\t\t\t// keeps track of already-matched idxs to skip in follow-up permutations\n\t\t\t\tlet matchedIdxs = new Set();\n\n\t\t\t\tfor (let ni = 0; ni < needles.length; ni++) {\n\t\t\t\t\tif (matchedIdxs.size < preFiltered.length) {\n\t\t\t\t\t\t// filter further for this needle, exclude already-matched\n\t\t\t\t\t\tlet preFiltered2 = preFiltered.filter(idx => !matchedIdxs.has(idx));\n\n\t\t\t\t\t\tlet matched = filter(haystack, needles[ni], preFiltered2);\n\n\t\t\t\t\t\tfor (let j = 0; j < matched.length; j++)\n\t\t\t\t\t\t\tmatchedIdxs.add(matched[j]);\n\n\t\t\t\t\t\tmatches.push(matched);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t\tmatches.push([]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// interOR\n\t//\tconsole.log(prepQuery(needle, 1, null, true));\n\n\t\t// non-ooo or ooo w/single term\n\t\tif (needles == null) {\n\t\t\tneedles = [needle];\n\t\t\tmatches = [preFiltered && preFiltered.length > 0 ? preFiltered : filter(haystack, needle)];\n\t\t}\n\n\t\tlet retInfo = null;\n\t\tlet retOrder = null;\n\n\t\tif (negs.length > 0)\n\t\t\tmatches = matches.map(idxs => idxs.filter(idx => !negsRe.test(haystack[idx])));\n\n\t\tlet matchCount = matches.reduce((acc, idxs) => acc + idxs.length, 0);\n\n\t\t// rank, sort, concat\n\t\tif (matchCount <= infoThresh) {\n\t\t\tretInfo = {};\n\t\t\tretOrder = [];\n\n\t\t\tfor (let ni = 0; ni < matches.length; ni++) {\n\t\t\t\tlet idxs = matches[ni];\n\n\t\t\t\tif (idxs == null || idxs.length == 0)\n\t\t\t\t\tcontinue;\n\n\t\t\t\tlet needle = needles[ni];\n\t\t\t\tlet _info = info(idxs, haystack, needle);\n\t\t\t\tlet order = opts.sort(_info, haystack, needle);\n\n\t\t\t\t// offset idxs for concat'ing infos\n\t\t\t\tif (ni > 0) {\n\t\t\t\t\tfor (let i = 0; i < order.length; i++)\n\t\t\t\t\t\torder[i] += retOrder.length;\n\t\t\t\t}\n\n\t\t\t\tfor (let k in _info) {\n\t\t\t\t\tretInfo[k] = (retInfo[k] ? retInfo[k] : []).concat(_info[k]);\n }\n\n\t\t\t\tretOrder = retOrder.concat(order);\n\t\t\t}\n\t\t}\n\n\t\treturn [\n\t\t\t[].concat(...matches),\n\t\t\tretInfo,\n\t\t\tretOrder,\n\t\t];\n\t};\n\n\treturn {\n\t\tsearch: (...args) => {\n\t\t\tlet out = _search(...args);\n\t\t\treturn out;\n\t\t},\n\t\tsplit,\n\t\tfilter,\n\t\tinfo,\n\t\tsort: opts.sort,\n\t};\n}\n\nconst latinize = (() => {\n\tlet accents = {\n\t\tA: 'ÁÀÃÂÄĄ',\n\t\ta: 'áàãâäą',\n\t\tE: 'ÉÈÊËĖ',\n\t\te: 'éèêëę',\n\t\tI: 'ÍÌÎÏĮ',\n\t\ti: 'íìîïį',\n\t\tO: 'ÓÒÔÕÖ',\n\t\to: 'óòôõö',\n\t\tU: 'ÚÙÛÜŪŲ',\n\t\tu: 'úùûüūų',\n\t\tC: 'ÇČ',\n\t\tc: 'çč',\n\t\tN: 'Ñ',\n\t\tn: 'ñ',\n\t\tS: 'Š',\n\t\ts: 'š'\n\t};\n\n\tlet accentsMap = new Map();\n\tlet accentsTpl = '';\n\n\tfor (let r in accents) {\n\t\taccents[r].split('').forEach(a => {\n\t\t\taccentsTpl += a;\n\t\t\taccentsMap.set(a, r);\n\t\t});\n\t}\n\n\tlet accentsRe = new RegExp(`[${accentsTpl}]`, 'g');\n\tlet replacer = m => accentsMap.get(m);\n\n\treturn strings => {\n\t\tif (typeof strings == 'string')\n\t\t\treturn strings.replace(accentsRe, replacer);\n\n\t\tlet out = Array(strings.length);\n\t\tfor (let i = 0; i < strings.length; i++)\n\t\t\tout[i] = strings[i].replace(accentsRe, replacer);\n\t\treturn out;\n\t};\n})();\n\n// https://stackoverflow.com/questions/9960908/permutations-in-javascript/37580979#37580979\nfunction permute(arr) {\n\tarr = arr.slice();\n\n\tlet length = arr.length,\n\t\tresult = [arr.slice()],\n\t\tc = new Array(length).fill(0),\n\t\ti = 1, k, p;\n\n\twhile (i < length) {\n\t\tif (c[i] < i) {\n\t\t\tk = i % 2 && c[i];\n\t\t\tp = arr[i];\n\t\t\tarr[i] = arr[k];\n\t\t\tarr[k] = p;\n\t\t\t++c[i];\n\t\t\ti = 1;\n\t\t\tresult.push(arr.slice());\n\t\t} else {\n\t\t\tc[i] = 0;\n\t\t\t++i;\n\t\t}\n\t}\n\n\treturn result;\n}\n\nconst _mark = (part, matched) => matched ? `${part}` : part;\nconst _append = (acc, part) => acc + part;\n\nfunction highlight(str, ranges, mark = _mark, accum = '', append = _append) {\n let tmp = append(accum, mark(str.substring(0, ranges[0]), false));\n\taccum = tmp !== null ? tmp : accum;\n\n\tfor (let i = 0; i < ranges.length; i+=2) {\n\t\tlet fr = ranges[i];\n\t\tlet to = ranges[i+1];\n\n tmp = append(accum, mark(str.substring(fr, to), true));\n\t\taccum = tmp !== null ? tmp : accum;\n\n\t\tif (i < ranges.length - 3) {\n tmp = append(accum, mark(str.substring(ranges[i + 1], ranges[i + 2]), false));\n accum = tmp !== null ? tmp : accum;\n }\n\t}\n\n tmp = append(accum, mark(str.substring(ranges[ranges.length - 1]), false));\n\taccum = tmp !== null ? tmp : accum;\n\n\treturn accum;\n}\n\nuFuzzy.latinize = latinize;\nuFuzzy.permute = arr => {\n\tlet idxs = permute([...Array(arr.length).keys()]).sort((a,b) => {\n\t\tfor (let i = 0; i < a.length; i++) {\n\t\t\tif (a[i] != b[i])\n\t\t\t\treturn a[i] - b[i];\n\t\t}\n\t\treturn 0;\n\t});\n\n\treturn idxs.map(pi => pi.map(i => arr[i]));\n};\nuFuzzy.highlight = highlight;\n\nexport { uFuzzy as default };\n","import uFuzzy from '@leeoniya/ufuzzy';\n// See https://github.com/leeoniya/uFuzzy#options\nconst uf = new uFuzzy({\n intraMode: 1,\n intraIns: 1,\n intraSub: 1,\n intraTrn: 1,\n intraDel: 1,\n});\nfunction sortCommands(a, b, favouriteCommands, recentCommands) {\n // Sort by recent first\n const aIsRecent = recentCommands.includes(a.id);\n const bIsRecent = recentCommands.includes(b.id);\n if (aIsRecent && !bIsRecent) {\n return -1;\n }\n if (!aIsRecent && bIsRecent) {\n return 1;\n }\n if (aIsRecent && bIsRecent) {\n return recentCommands.indexOf(a.id) - recentCommands.indexOf(b.id);\n }\n // Sort by favourites second\n const aIsFavourite = favouriteCommands.includes(a.id);\n const bIsFavourite = favouriteCommands.includes(b.id);\n if (aIsFavourite && !bIsFavourite) {\n return -1;\n }\n if (!aIsFavourite && bIsFavourite) {\n return 1;\n }\n // Sort by name third\n return a.name.localeCompare(b.name);\n}\nexport default function filterCommands(selectedCommandGroup, searchWord, commands, favourites, recentCommands) {\n // If there is a search word, return all commands to allow deep search\n // If no search word is given, return all commands in the currently selected group or all recent commands if no group is selected\n let availableCommands = Object.values(commands);\n availableCommands = searchWord\n ? availableCommands\n : availableCommands.filter((command) => command.parentId === selectedCommandGroup ||\n (!selectedCommandGroup && recentCommands.includes(command.id)));\n // If there is no search word, return all commands in the current context with favourites first, the recent commands will only be prioritised if we are at the top level\n if (!searchWord) {\n return availableCommands\n .sort((a, b) => sortCommands(a, b, favourites, selectedCommandGroup ? [] : recentCommands))\n .map((command) => command.id);\n }\n // Create a list of all available commands with their name and description as haystack for the search\n const availableCommandNames = availableCommands.map(({ name, description }) => name + ' ' + description);\n const [indices, , order] = uf.search(availableCommandNames, searchWord.toLowerCase());\n const matchingIds = order.map((i) => availableCommands[indices[i]].id);\n // Add all commands that can handle queries to the result, the Set removes duplicates\n return matchingIds;\n}\n","export default function assert(condition, message = 'Assertion failed') {\n if (condition === false)\n throw Error(message);\n}\n","export default function classnames(...args) {\n return args.filter(Boolean).join(' ');\n}\n","import { logger } from '../helpers';\nexport var STATUS;\n(function (STATUS) {\n STATUS[\"COLLAPSED\"] = \"collapsed\";\n STATUS[\"IDLE\"] = \"idle\";\n STATUS[\"EXECUTING_COMMAND\"] = \"executingCommand\";\n STATUS[\"DISPLAYING_RESULT\"] = \"displayingResult\";\n})(STATUS || (STATUS = {}));\nexport var TRANSITION;\n(function (TRANSITION) {\n TRANSITION[\"RESET_SEARCH\"] = \"RESET_SEARCH\";\n TRANSITION[\"HIGHLIGHT_NEXT_ITEM\"] = \"HIGHLIGHT_NEXT_ITEM\";\n TRANSITION[\"HIGHLIGHT_PREVIOUS_ITEM\"] = \"HIGHLIGHT_PREVIOUS_ITEM\";\n TRANSITION[\"CANCEL\"] = \"CANCEL\";\n TRANSITION[\"SELECT_GROUP\"] = \"SELECT_GROUP\";\n TRANSITION[\"GO_TO_PARENT_GROUP\"] = \"GO_TO_PARENT_GROUP\";\n TRANSITION[\"UPDATE_SEARCH\"] = \"UPDATE_SEARCH\";\n TRANSITION[\"UPDATE_COMMAND_QUERY\"] = \"UPDATE_COMMAND_QUERY\";\n TRANSITION[\"EXECUTE_COMMAND\"] = \"EXECUTE_COMMAND\";\n TRANSITION[\"FINISH_COMMAND\"] = \"FINISH_COMMAND\";\n TRANSITION[\"UPDATE_RESULT\"] = \"UPDATE_RESULT\";\n TRANSITION[\"EXPAND\"] = \"EXPAND\";\n TRANSITION[\"ADD_FAVOURITE\"] = \"ADD_FAVOURITE\";\n TRANSITION[\"REMOVE_FAVOURITE\"] = \"REMOVE_FAVOURITE\";\n})(TRANSITION || (TRANSITION = {}));\nexport var ACTION;\n(function (ACTION) {\n ACTION[\"ADD_FAVOURITE\"] = \"ADD_FAVOURITE\";\n ACTION[\"ADD_RECENTLY_USED\"] = \"ADD_RECENTLY_USED\";\n ACTION[\"EXPAND\"] = \"EXPAND\";\n ACTION[\"HIGHLIGHT_NEXT_COMMAND\"] = \"HIGHLIGHT_NEXT_COMMAND\";\n ACTION[\"HIGHLIGHT_NEXT_OPTION\"] = \"HIGHLIGHT_NEXT_OPTION\";\n ACTION[\"HIGHLIGHT_PREVIOUS_COMMAND\"] = \"HIGHLIGHT_PREVIOUS_COMMAND\";\n ACTION[\"HIGHLIGHT_PREVIOUS_OPTION\"] = \"HIGHLIGHT_PREVIOUS_OPTION\";\n ACTION[\"LEAVE_GROUP\"] = \"LEAVE_GROUP\";\n ACTION[\"REFRESH_COMMANDS\"] = \"REFRESH_COMMANDS\";\n ACTION[\"REMOVE_FAVOURITE\"] = \"REMOVE_FAVOURITE\";\n ACTION[\"RESET_HIGHLIGHT\"] = \"RESET_HIGHLIGHT\";\n ACTION[\"RESET_OPTION_HIGHLIGHT\"] = \"RESET_OPTION_HIGHLIGHT\";\n ACTION[\"RESET_SEARCH\"] = \"RESET_SEARCH\";\n ACTION[\"RESET_SEARCH_OR_LEAVE_GROUP\"] = \"RESET_SEARCH_OR_LEAVE_GROUP\";\n ACTION[\"SET_ACTIVE_COMMAND\"] = \"SET_ACTIVE_COMMAND\";\n ACTION[\"SET_COMMAND_QUERY\"] = \"SET_COMMAND_QUERY\";\n ACTION[\"SET_GROUP\"] = \"SET_GROUP\";\n ACTION[\"SET_SEARCH_WORD\"] = \"SET_SEARCH_WORD\";\n ACTION[\"UNSET_ACTIVE_COMMAND\"] = \"UNSET_ACTIVE_COMMAND\";\n ACTION[\"UNSET_RESULT\"] = \"UNSET_RESULT\";\n ACTION[\"UPDATE_RESULT\"] = \"UPDATE_RESULT\";\n})(ACTION || (ACTION = {}));\nexport const machine = {\n initial: STATUS.COLLAPSED,\n states: {\n collapsed: {\n on: {\n UPDATE_SEARCH: {\n target: STATUS.IDLE,\n actions: [ACTION.EXPAND, ACTION.SET_SEARCH_WORD, ACTION.REFRESH_COMMANDS],\n },\n HIGHLIGHT_NEXT_ITEM: {\n target: STATUS.IDLE,\n actions: [ACTION.REFRESH_COMMANDS, ACTION.EXPAND],\n },\n EXPAND: {\n target: STATUS.IDLE,\n actions: [ACTION.REFRESH_COMMANDS, ACTION.EXPAND],\n },\n },\n },\n idle: {\n on: {\n UPDATE_SEARCH: {\n target: STATUS.IDLE,\n actions: [ACTION.SET_SEARCH_WORD, ACTION.RESET_HIGHLIGHT, ACTION.REFRESH_COMMANDS],\n },\n HIGHLIGHT_NEXT_ITEM: {\n target: STATUS.IDLE,\n actions: [ACTION.HIGHLIGHT_NEXT_COMMAND],\n },\n HIGHLIGHT_PREVIOUS_ITEM: {\n target: STATUS.IDLE,\n actions: [ACTION.HIGHLIGHT_PREVIOUS_COMMAND],\n },\n CANCEL: {\n target: STATUS.IDLE,\n actions: [ACTION.RESET_HIGHLIGHT, ACTION.RESET_SEARCH_OR_LEAVE_GROUP, ACTION.REFRESH_COMMANDS],\n },\n EXECUTE_COMMAND: {\n target: STATUS.EXECUTING_COMMAND,\n actions: [ACTION.ADD_RECENTLY_USED, ACTION.SET_ACTIVE_COMMAND, ACTION.REFRESH_COMMANDS],\n },\n GO_TO_PARENT_GROUP: {\n target: STATUS.IDLE,\n actions: [ACTION.RESET_HIGHLIGHT, ACTION.LEAVE_GROUP, ACTION.REFRESH_COMMANDS],\n },\n SELECT_GROUP: {\n target: STATUS.IDLE,\n actions: [ACTION.RESET_SEARCH, ACTION.RESET_HIGHLIGHT, ACTION.SET_GROUP, ACTION.REFRESH_COMMANDS],\n },\n ADD_FAVOURITE: {\n target: STATUS.IDLE,\n actions: [ACTION.ADD_FAVOURITE, ACTION.REFRESH_COMMANDS],\n },\n REMOVE_FAVOURITE: {\n target: STATUS.IDLE,\n actions: [ACTION.REMOVE_FAVOURITE, ACTION.REFRESH_COMMANDS],\n },\n },\n },\n executingCommand: {\n on: {\n UPDATE_RESULT: {\n target: STATUS.DISPLAYING_RESULT,\n actions: [ACTION.UPDATE_RESULT],\n },\n FINISH_COMMAND: {\n target: STATUS.IDLE,\n actions: [ACTION.UNSET_ACTIVE_COMMAND],\n },\n },\n },\n displayingResult: {\n on: {\n UPDATE_COMMAND_QUERY: {\n target: STATUS.DISPLAYING_RESULT,\n actions: [ACTION.SET_COMMAND_QUERY],\n },\n UPDATE_RESULT: {\n target: STATUS.DISPLAYING_RESULT,\n actions: [ACTION.UPDATE_RESULT, ACTION.RESET_OPTION_HIGHLIGHT],\n },\n HIGHLIGHT_NEXT_ITEM: {\n target: STATUS.DISPLAYING_RESULT,\n actions: [ACTION.HIGHLIGHT_NEXT_OPTION],\n },\n HIGHLIGHT_PREVIOUS_ITEM: {\n target: STATUS.DISPLAYING_RESULT,\n actions: [ACTION.HIGHLIGHT_PREVIOUS_OPTION],\n },\n EXECUTE_COMMAND: {\n target: STATUS.DISPLAYING_RESULT,\n actions: [ACTION.SET_ACTIVE_COMMAND],\n },\n CANCEL: {\n target: STATUS.IDLE,\n actions: [ACTION.UNSET_RESULT, ACTION.UNSET_ACTIVE_COMMAND, ACTION.RESET_OPTION_HIGHLIGHT],\n },\n FINISH_COMMAND: {\n target: STATUS.DISPLAYING_RESULT,\n actions: [ACTION.UNSET_ACTIVE_COMMAND],\n },\n },\n },\n },\n};\nexport function transition(state, event, actionCallback) {\n var _a, _b, _c;\n let nextStateNode = (_b = (_a = machine.states[state.status].on) === null || _a === void 0 ? void 0 : _a[event.type]) !== null && _b !== void 0 ? _b : null;\n if (!nextStateNode) {\n logger.error(`No transition found for event \"${event.type}\" in state \"${state.status}\"`);\n nextStateNode = { target: state.status };\n }\n const nextState = {\n ...state,\n status: typeof nextStateNode == 'string' ? nextStateNode : nextStateNode.target,\n };\n if (actionCallback && typeof nextStateNode == 'object') {\n (_c = nextStateNode.actions) === null || _c === void 0 ? void 0 : _c.forEach((action) => actionCallback(action, nextState, event));\n }\n logger.debug(`Transitioned from \"${state.status}\" to \"${nextState.status}\" with event \"${event.type}\"`);\n return nextState;\n}\n","import { assert, clamp, filterCommands } from '../helpers';\nimport { ACTION, TRANSITION, transition } from './commandBarMachine';\nconst MAX_RECENTLY_USED = 5;\nfunction runAction(action, nextState, event) {\n switch (action) {\n case ACTION.RESET_SEARCH:\n nextState.searchWord = '';\n break;\n case ACTION.RESET_HIGHLIGHT:\n nextState.highlightedItem = 0;\n break;\n case ACTION.REFRESH_COMMANDS:\n nextState.availableCommandIds = filterCommands(nextState.selectedCommandGroup, nextState.searchWord, nextState.commands, nextState.favouriteCommands, nextState.recentCommands);\n break;\n case ACTION.HIGHLIGHT_NEXT_COMMAND:\n nextState.highlightedItem = clamp(nextState.highlightedItem + 1, 0, nextState.availableCommandIds.length - 1);\n break;\n case ACTION.HIGHLIGHT_PREVIOUS_COMMAND:\n nextState.highlightedItem = clamp(nextState.highlightedItem - 1, 0, nextState.availableCommandIds.length - 1);\n break;\n case ACTION.HIGHLIGHT_NEXT_OPTION:\n nextState.highlightedOption = clamp(nextState.highlightedOption + 1, 0, Object.keys(nextState.result.options).length - 1);\n break;\n case ACTION.HIGHLIGHT_PREVIOUS_OPTION:\n nextState.highlightedOption = clamp(nextState.highlightedOption - 1, 0, Object.keys(nextState.result.options).length - 1);\n break;\n case ACTION.SET_SEARCH_WORD:\n assert(event.type === TRANSITION.UPDATE_SEARCH);\n nextState.searchWord = event.searchWord;\n break;\n case ACTION.SET_COMMAND_QUERY:\n assert(event.type === TRANSITION.UPDATE_COMMAND_QUERY);\n nextState.commandQuery = event.commandQuery;\n break;\n case ACTION.EXPAND:\n nextState.expanded = true;\n break;\n case ACTION.SET_ACTIVE_COMMAND:\n assert(event.type === TRANSITION.EXECUTE_COMMAND);\n nextState.activeCommandId = event.commandId;\n nextState.activeCommandMessage = event.message;\n break;\n case ACTION.UNSET_ACTIVE_COMMAND:\n nextState.activeCommandId = null;\n nextState.activeCommandMessage = null;\n break;\n case ACTION.UPDATE_RESULT:\n assert(event.type === TRANSITION.UPDATE_RESULT);\n assert(typeof event.result.success === 'boolean');\n nextState.result = {\n options: {},\n message: 'Command executed',\n view: null,\n success: false,\n ...event.result,\n };\n nextState.resultCommandId = nextState.activeCommandId;\n break;\n case ACTION.RESET_OPTION_HIGHLIGHT:\n nextState.highlightedOption = 0;\n break;\n case ACTION.RESET_SEARCH_OR_LEAVE_GROUP:\n if (nextState.commandQuery) {\n nextState.commandQuery = '';\n }\n else if (nextState.searchWord) {\n nextState.searchWord = '';\n }\n else {\n nextState.selectedCommandGroup = nextState.selectedCommandGroup\n ? nextState.commands[nextState.selectedCommandGroup].parentId\n : null;\n }\n break;\n case ACTION.UNSET_RESULT:\n nextState.result = null;\n nextState.resultCommandId = null;\n nextState.commandQuery = '';\n break;\n case ACTION.LEAVE_GROUP:\n nextState.selectedCommandGroup = nextState.selectedCommandGroup\n ? nextState.commands[nextState.selectedCommandGroup].parentId\n : null;\n break;\n case ACTION.SET_GROUP:\n assert(event.type === TRANSITION.SELECT_GROUP);\n nextState.selectedCommandGroup = event.commandId;\n break;\n case ACTION.ADD_FAVOURITE:\n assert(event.type === TRANSITION.ADD_FAVOURITE);\n if (!nextState.favouriteCommands.includes(event.commandId)) {\n nextState.favouriteCommands.push(event.commandId);\n }\n break;\n case ACTION.REMOVE_FAVOURITE:\n assert(event.type === TRANSITION.REMOVE_FAVOURITE);\n nextState.favouriteCommands = nextState.favouriteCommands.filter((id) => id !== event.commandId);\n break;\n case ACTION.ADD_RECENTLY_USED:\n assert(event.type === TRANSITION.EXECUTE_COMMAND);\n // Only add to recently used if the command has an action\n if (!nextState.commands[event.commandId].action) {\n break;\n }\n if (nextState.recentCommands.includes(event.commandId)) {\n nextState.recentCommands = nextState.recentCommands.filter((id) => id !== event.commandId);\n }\n nextState.recentCommands.unshift(event.commandId);\n if (nextState.recentCommands.length > MAX_RECENTLY_USED) {\n nextState.recentCommands.pop();\n }\n break;\n default:\n throw Error(`Action ${action} not implemented`);\n }\n}\nconst commandBarReducer = (state, event) => {\n return transition(state, event, runAction);\n};\nexport { commandBarReducer };\n","import React from 'react';\nimport * as styles from './IconWrapper.module.css';\nconst IconWrapper = ({ children }) => {\n return React.createElement(\"span\", { className: styles.iconWrap }, children);\n};\nexport default React.memo(IconWrapper);\n","import React from 'react';\nimport { useCommandBarState, useIntl } from '../../state';\nimport * as styles from './Branding.module.css';\nconst Branding = () => {\n const { state: { showBranding }, } = useCommandBarState();\n const { translate } = useIntl();\n if (!showBranding)\n return null;\n return (React.createElement(\"a\", { href: \"https://helzle.it/projects\", title: translate('CommandBarFooter.branding', 'Made with love by Sebastian Helzle'), target: \"_blank\", rel: \"noreferrer noopener\", className: styles.madeWithLove },\n React.createElement(\"small\", null, translate('CommandBarFooter.brandingSmall', 'Made with love by')),\n React.createElement(\"svg\", { xmlns: \"http://www.w3.org/2000/svg\", width: \"18\", height: \"18\", viewBox: \"0 0 180 180\" },\n React.createElement(\"defs\", null,\n React.createElement(\"linearGradient\", { id: \"a\", gradientUnits: \"userSpaceOnUse\", x1: \"280.25\", y1: \"377.003\", x2: \"373.261\", y2: \"377.003\" },\n React.createElement(\"stop\", { offset: \"0\", stopColor: \"#297AAC\" }),\n React.createElement(\"stop\", { offset: \"1\", stopColor: \"#53AADA\" }))),\n React.createElement(\"path\", { d: \"M0 180.017h37.287L71.35 52.898H34.061zM48.717 0l-9.083 33.898h36.675L85.392 0z\", fill: \"#B9B7B3\" }),\n React.createElement(\"path\", { d: \"M335.972 313.444H288.25l-8 28.306h47.691l-28.03 98.813h39.287l34.063-127.119z\", fill: \"url(#a)\", transform: \"translate(-195.462 -260.325)\" }))));\n};\nexport default React.memo(Branding);\n","import React from 'react';\nexport function IconBack() {\n return (React.createElement(\"svg\", { viewBox: \"0 0 448 512\" },\n React.createElement(\"path\", { fill: \"currentColor\", d: \"m257.5 445.1-22.2 22.2c-9.4 9.4-24.6 9.4-33.9 0L7 273c-9.4-9.4-9.4-24.6 0-33.9L201.4 44.7c9.4-9.4 24.6-9.4 33.9 0l22.2 22.2c9.5 9.5 9.3 25-.4 34.3L136.6 216H424c13.3 0 24 10.7 24 24v32c0 13.3-10.7 24-24 24H136.6l120.5 114.8c9.8 9.3 10 24.8.4 34.3z\" })));\n}\n","import React from 'react';\nexport function IconNeos() {\n return (React.createElement(\"svg\", { viewBox: \"0 0 512 512\" },\n React.createElement(\"path\", { fill: \"currentColor\", d: \"M415.44 512h-95.11L212.12 357.46v91.1L125.69 512H28V29.82L68.47 0h108.05l123.74 176.13V63.45L386.69 0h97.69v461.5zM38.77 35.27V496l72-52.88V194l215.5 307.64h84.79l52.35-38.17h-78.27L69 13zm82.54 466.61 80-58.78v-101l-79.76-114.4v220.94L49 501.89h72.34zM80.63 10.77l310.6 442.57h82.37V10.77h-79.75v317.56L170.91 10.77zM311 191.65l72 102.81V15.93l-72 53v122.72z\" })));\n}\n","import React from 'react';\nexport function IconSpinner() {\n return (React.createElement(\"svg\", { viewBox: \"0 0 512 512\" },\n React.createElement(\"path\", { fill: \"currentColor\", d: \"M288 39.056v16.659c0 10.804 7.281 20.159 17.686 23.066C383.204 100.434 440 171.518 440 256c0 101.689-82.295 184-184 184-101.689 0-184-82.295-184-184 0-84.47 56.786-155.564 134.312-177.219C216.719 75.874 224 66.517 224 55.712V39.064c0-15.709-14.834-27.153-30.046-23.234C86.603 43.482 7.394 141.206 8.003 257.332c.72 137.052 111.477 246.956 248.531 246.667C393.255 503.711 504 392.788 504 256c0-115.633-79.14-212.779-186.211-240.236C302.678 11.889 288 23.456 288 39.056z\" })));\n}\n","import React from 'react';\nexport function IconStar() {\n return (React.createElement(\"svg\", { viewBox: \"0 0 576 512\" },\n React.createElement(\"path\", { fill: \"currentColor\", d: \"M528.1 171.5 382 150.2 316.7 17.8c-11.7-23.6-45.6-23.9-57.4 0L194 150.2 47.9 171.5c-26.2 3.8-36.7 36.1-17.7 54.6l105.7 103-25 145.5c-4.5 26.3 23.2 46 46.4 33.7L288 439.6l130.7 68.7c23.2 12.2 50.9-7.4 46.4-33.7l-25-145.5 105.7-103c19-18.5 8.5-50.8-17.7-54.6zM388.6 312.3l23.7 138.4L288 385.4l-124.3 65.3 23.7-138.4-100.6-98 139-20.2 62.2-126 62.2 126 139 20.2-100.6 98z\" })));\n}\n","import React from 'react';\nexport function IconPlay() {\n return (React.createElement(\"svg\", { viewBox: \"0 0 512 512\" },\n React.createElement(\"path\", { fill: \"currentColor\", d: \"M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm115.7 272l-176 101c-15.8 8.8-35.7-2.5-35.7-21V152c0-18.4 19.8-29.8 35.7-21l176 107c16.4 9.2 16.4 32.9 0 42z\" })));\n}\n","import React from 'react';\nimport { useComputed } from '@preact/signals';\nimport { useCommandBarState } from '../../state';\nimport IconWrapper from '../IconWrapper/IconWrapper';\nimport Branding from './Branding';\nimport { IconNeos, IconSpinner } from '../Icons';\nimport * as styles from './CommandBarFooter.module.css';\nconst CommandBarFooter = () => {\n const { state: { activeCommandId, activeCommandMessage, commands, result, selectedCommandGroup, expanded }, Icon, } = useCommandBarState();\n const runningCommand = useComputed(() => {\n var _a;\n if (!activeCommandId.value)\n return null;\n // FIXME: This will not be correct when a command and an option in the result have the same id\n return activeCommandId.value\n ? (_a = commands.value[activeCommandId.value]) !== null && _a !== void 0 ? _a : result.value.options[activeCommandId.value]\n : null;\n });\n if (!expanded.value)\n return null;\n return (React.createElement(\"footer\", { className: styles.commandBarFooter },\n activeCommandId.value ? (React.createElement(\"span\", { className: styles.activity },\n React.createElement(IconWrapper, null,\n React.createElement(IconSpinner, null)),\n React.createElement(\"em\", null,\n runningCommand.value.name,\n \" \\u2012 \",\n activeCommandMessage))) : selectedCommandGroup.value ? (React.createElement(\"span\", { className: styles.breadcrumb },\n React.createElement(Icon, { icon: commands.value[selectedCommandGroup.value].icon }),\n React.createElement(\"small\", null, commands.value[selectedCommandGroup.value].name))) : (React.createElement(IconWrapper, null,\n React.createElement(IconNeos, null))),\n React.createElement(Branding, null)));\n};\nexport default React.memo(CommandBarFooter);\n","import React, { useCallback, useRef } from 'react';\nimport { useSignalEffect } from '@preact/signals';\nimport { useCommandBarState, STATUS, useIntl, useCommandExecutor } from '../../state';\nimport IconWrapper from '../IconWrapper/IconWrapper';\nimport * as styles from './SearchBox.module.css';\nimport { IconPlay } from '../Icons';\n// Timer helper for debouncing updates of command query results\nlet updateResultsTimer = null;\nconst RESULT_UPDATE_DEBOUNCE_TIME = 500;\nconst SearchBox = () => {\n var _a;\n const { state, actions } = useCommandBarState();\n const { executeCommand } = useCommandExecutor();\n const { translate } = useIntl();\n const inputRef = useRef();\n const handleChange = useCallback((e) => {\n if (state.status.value === STATUS.DISPLAYING_RESULT) {\n actions.UPDATE_COMMAND_QUERY(e.target.value);\n // Execute command after a delay if it's not a manual command\n if (!state.commands.value[state.resultCommandId.value].executeManually) {\n if (updateResultsTimer) {\n clearTimeout(updateResultsTimer);\n }\n updateResultsTimer = setTimeout(() => executeCommand(state.resultCommandId.value), RESULT_UPDATE_DEBOUNCE_TIME);\n }\n }\n else {\n actions.UPDATE_SEARCH(e.target.value);\n }\n }, []);\n const handleKeyPress = useCallback((e) => {\n // Prevent escape event from bubbling up if the input is focused and the native reset should be used\n if (e.key === 'Escape') {\n if (inputRef.current.value) {\n e.preventDefault();\n e.stopPropagation();\n }\n }\n }, [inputRef.current]);\n // Focus input when the command bar is ready for input\n useSignalEffect(() => {\n var _a;\n if (state.status.value !== STATUS.EXECUTING_COMMAND) {\n (_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.focus();\n }\n });\n return (React.createElement(React.Fragment, null,\n React.createElement(\"input\", { ref: inputRef, className: styles.searchBox, type: \"search\", placeholder: state.status.value === STATUS.DISPLAYING_RESULT\n ? translate('SearchBox.commandQuery.placeholder', 'Enter the query for the command')\n : translate('SearchBox.placeholder', 'What do you want to do today?'), autoFocus: true, onChange: handleChange, onKeyUp: handleKeyPress, value: (state.status.value === STATUS.DISPLAYING_RESULT\n ? state.commandQuery\n : state.searchWord), \"data-testid\": \"SearchBox\" }),\n !state.expanded.value && (React.createElement(\"button\", { className: styles.expandButton, onClick: actions.EXPAND, title: translate('SearchBox.expand.title', 'Expand to show all commands') },\n React.createElement(IconWrapper, null,\n React.createElement(\"svg\", { xmlns: \"http://www.w3.org/2000/svg\", viewBox: \"0 0 320 512\" },\n React.createElement(\"path\", { fill: \"currentColor\", d: \"M31.3 192h257.3c17.8 0 26.7 21.5 14.1 34.1L174.1 354.8c-7.8 7.8-20.5 7.8-28.3 0L17.2 226.1C4.6 213.5 13.5 192 31.3 192z\" }))))),\n state.status.value === STATUS.DISPLAYING_RESULT &&\n ((_a = state.commands.value[state.resultCommandId.value]) === null || _a === void 0 ? void 0 : _a.executeManually) && (React.createElement(\"button\", { className: styles.executeButton, onClick: () => executeCommand(state.resultCommandId.value), title: translate('SearchBox.execute.title', 'Execute the command') },\n React.createElement(IconWrapper, null,\n React.createElement(IconPlay, null))))));\n};\nexport default React.memo(SearchBox);\n","import React from 'react';\nimport { useComputed } from '@preact/signals';\nimport { useCommandBarState, STATUS } from '../../state';\nimport IconWrapper from '../IconWrapper/IconWrapper';\nimport SearchBox from '../SearchBox/SearchBox';\nimport { IconBack } from '../Icons';\nimport * as styles from './CommandBarHeader.module.css';\nconst CommandBarHeader = () => {\n const { state, actions } = useCommandBarState();\n const isDisplayingResults = useComputed(() => state.status.value == STATUS.DISPLAYING_RESULT);\n return (React.createElement(\"header\", { className: styles.commandBarHeader },\n (isDisplayingResults.value || state.selectedCommandGroup.value) && (React.createElement(\"button\", { type: \"button\", onClick: isDisplayingResults.value ? actions.CANCEL : actions.GO_TO_PARENT_GROUP, className: styles.backButton, title: \"Back\" },\n React.createElement(IconWrapper, null,\n React.createElement(IconBack, null)))),\n React.createElement(SearchBox, null)));\n};\nexport default React.memo(CommandBarHeader);\n","import React from 'react';\nimport { useComputed } from '@preact/signals';\nimport { IconWrapper } from '../index';\nimport { classnames } from '../../helpers';\nimport { IconStar } from '../Icons';\nimport * as styles from './CommandListItem.module.css';\nimport { useCommandBarState, useIntl } from '../../state';\nfunction getCommandType({ subCommandIds, category, canHandleQueries, action }, translate) {\n let type = 'command';\n if (category) {\n return category;\n }\n else if ((subCommandIds === null || subCommandIds === void 0 ? void 0 : subCommandIds.length) > 0) {\n type = 'category';\n }\n else if (canHandleQueries) {\n type = 'query';\n }\n else if (typeof action == 'string') {\n type = 'link';\n }\n return translate(`CommandListItem.type.${type}`, type);\n}\nfunction CommandListItem({ command, onItemSelect, highlightedId, onToggleFavourite }) {\n const { state: { favouriteCommands }, Icon, } = useCommandBarState();\n const { translate } = useIntl();\n const { id, name, description, icon, action } = command;\n const commandType = getCommandType(command, translate);\n const isHighlighted = useComputed(() => highlightedId.value === id);\n const isFavourite = useComputed(() => favouriteCommands.value.includes(id));\n return (React.createElement(\"li\", { className: classnames(styles.commandListItem, isHighlighted.value && styles.highlighted), onClick: () => onItemSelect(id), \"data-testid\": \"CommandListItem\" },\n React.createElement(Icon, { icon: icon }),\n React.createElement(\"span\", { className: styles.label },\n React.createElement(\"span\", null, name),\n description && (React.createElement(\"span\", { className: styles.description }, typeof description == 'string' ? description : description()))),\n onToggleFavourite && action && (React.createElement(\"button\", { type: \"button\", className: classnames(styles.favouriteButton, isFavourite.value && styles.isFavourite), title: translate('CommandListItem.toggleFavourite', 'Toggle favourite'), onClick: (e) => {\n e.stopPropagation();\n onToggleFavourite(id);\n } },\n React.createElement(IconWrapper, null,\n React.createElement(IconStar, null)))),\n React.createElement(\"small\", { className: styles.type }, commandType)));\n}\n// Use memo to prevent rerendering of all items when the parent list is updated\nexport default React.memo(CommandListItem);\n","import React, { useCallback } from 'react';\nimport { useComputed, useSignalEffect } from '@preact/signals';\nimport CommandListItem from '../CommandListItem/CommandListItem';\nimport { useCommandBarState, useCommandExecutor, useIntl, STATUS } from '../../state';\nimport { classnames } from '../../helpers';\nimport * as styles from './CommandListing.module.css';\nconst CommandList = () => {\n const { state: { commands, highlightedItem, availableCommandIds, status, searchWord, favouriteCommands, recentCommands, selectedCommandGroup, }, actions: { ADD_FAVOURITE, REMOVE_FAVOURITE }, } = useCommandBarState();\n const { translate } = useIntl();\n const { executeCommand } = useCommandExecutor();\n const navRef = React.useRef(null);\n useSignalEffect(() => {\n var _a, _b;\n (_b = (_a = navRef.current) === null || _a === void 0 ? void 0 : _a.querySelector(`li:nth-child(${highlightedItem.value})`)) === null || _b === void 0 ? void 0 : _b.scrollIntoView({ behavior: 'smooth', block: 'center' });\n });\n const handleToggleFavourite = useCallback((commandId) => {\n if (favouriteCommands.value.includes(commandId)) {\n REMOVE_FAVOURITE(commandId);\n }\n else {\n ADD_FAVOURITE(commandId);\n }\n }, [favouriteCommands]);\n const suggestions = useComputed(() => {\n return searchWord.value || selectedCommandGroup.value\n ? []\n : availableCommandIds.value.filter((commandId) => recentCommands.value.includes(commandId));\n });\n const availableCommands = useComputed(() => {\n return searchWord.value || selectedCommandGroup.value\n ? availableCommandIds.value\n : availableCommandIds.value.filter((commandId) => !recentCommands.value.includes(commandId));\n });\n const highlightedCommand = useComputed(() => availableCommandIds.value[highlightedItem.value]);\n return (React.createElement(\"nav\", { className: classnames(styles.results, status.value !== STATUS.IDLE && styles.disabled), \"data-testid\": \"CommandList\", ref: navRef },\n suggestions.value.length > 0 && (React.createElement(React.Fragment, null,\n React.createElement(\"h6\", null, translate('CommandList.suggestions', 'Recently used')),\n React.createElement(\"ul\", null, suggestions.value.map((commandId) => (React.createElement(CommandListItem, { key: commandId, command: commands.value[commandId], onItemSelect: executeCommand, highlightedId: highlightedCommand, onToggleFavourite: handleToggleFavourite })))))),\n availableCommands.value.length > 0 && (React.createElement(React.Fragment, null,\n React.createElement(\"h6\", null, translate('CommandList.heading', 'Commands')),\n React.createElement(\"ul\", null, availableCommands.value.map((commandId) => (React.createElement(CommandListItem, { key: commandId, command: commands.value[commandId], onItemSelect: executeCommand, highlightedId: highlightedCommand, onToggleFavourite: handleToggleFavourite })))))),\n availableCommandIds.value.length === 0 && (React.createElement(\"small\", { className: styles.noResults }, translate('CommandList.noCommandsMessage', 'No matching commands found')))));\n};\nexport default React.memo(CommandList);\n","import React from 'react';\nimport { useComputed, useSignalEffect } from '@preact/signals';\nimport { useCommandBarState, useCommandExecutor } from '../../state';\nimport CommandListItem from '../CommandListItem/CommandListItem';\nimport * as styles from './CommandResultsView.module.css';\nconst CommandResultsView = () => {\n var _a;\n const { state: { result, highlightedOption }, } = useCommandBarState();\n const { executeCommand } = useCommandExecutor();\n const navRef = React.useRef(null);\n const highlightedId = useComputed(() => result.value ? Object.values(result.value.options)[highlightedOption.value].id : null);\n useSignalEffect(() => {\n var _a, _b;\n const highlightedIndex = highlightedOption.value;\n (_b = (_a = navRef.current) === null || _a === void 0 ? void 0 : _a.querySelector(`li:nth-child(${highlightedIndex})`)) === null || _b === void 0 ? void 0 : _b.scrollIntoView({ behavior: 'smooth', block: 'center' });\n });\n const { options, view, message } = (_a = result.value) !== null && _a !== void 0 ? _a : {};\n return (React.createElement(\"div\", { className: styles.commandResultsView },\n message && React.createElement(\"h6\", { className: styles.message }, message),\n view ? React.createElement(\"div\", null, view) : '',\n options && (React.createElement(\"nav\", { className: styles.results, ref: navRef },\n React.createElement(\"ul\", null, Object.keys(options).map((commandId) => (React.createElement(CommandListItem, { key: commandId, command: options[commandId], onItemSelect: executeCommand, highlightedId: highlightedId }))))))));\n};\nexport default CommandResultsView;\n","import React from 'react';\nimport * as styles from './ToggleButton.module.css';\nconst ToggleButton = ({ handleToggle, disabled = false, label, title }) => {\n return (React.createElement(\"button\", { className: styles.toggleButton, onClick: handleToggle, disabled: disabled, title: title },\n React.createElement(\"span\", null, label),\n React.createElement(\"span\", { className: styles.buttonIcon }, \"\\u2318K\")));\n};\nexport default React.memo(ToggleButton);\n","import React, { createContext, useCallback, useContext, useMemo } from 'react';\nimport { signal, computed } from '@preact/signals';\nimport { commandBarReducer } from './commandBarReducer';\nimport { flattenCommands, logger } from '../helpers';\nimport { STATUS, TRANSITION } from './commandBarMachine';\nimport { IconWrapper } from '../components';\nconst CommandBarContext = createContext({});\nexport const useCommandBarState = () => useContext(CommandBarContext);\n/**\n * Create the app state and initialize it if it does not exist yet\n */\nfunction createAppState(initialState) {\n // Define a signal to hold the state\n const commandBarState = signal(initialState);\n // Define a function to dispatch events to the reducer and its state machine and update the state with the result\n const dispatch = (event) => {\n commandBarState.value = commandBarReducer(commandBarState.value, event);\n };\n // Derive readonly selectors for partial state values\n const activeCommandId = computed(() => commandBarState.value.activeCommandId);\n const activeCommandMessage = computed(() => commandBarState.value.activeCommandMessage);\n const availableCommandIds = computed(() => commandBarState.value.availableCommandIds);\n const commandQuery = computed(() => commandBarState.value.commandQuery);\n const commands = computed(() => commandBarState.value.commands);\n const expanded = computed(() => commandBarState.value.expanded);\n const favouriteCommands = computed(() => commandBarState.value.favouriteCommands);\n const highlightedItem = computed(() => commandBarState.value.highlightedItem);\n const highlightedOption = computed(() => commandBarState.value.highlightedOption);\n const recentCommands = computed(() => commandBarState.value.recentCommands);\n const result = computed(() => commandBarState.value.result);\n const resultCommandId = computed(() => commandBarState.value.resultCommandId);\n const searchWord = computed(() => commandBarState.value.searchWord);\n const selectedCommandGroup = computed(() => commandBarState.value.selectedCommandGroup);\n const showBranding = computed(() => commandBarState.value.showBranding);\n const status = computed(() => commandBarState.value.status);\n return {\n state: {\n activeCommandId,\n activeCommandMessage,\n availableCommandIds,\n commandQuery,\n commands,\n expanded,\n favouriteCommands,\n highlightedItem,\n highlightedOption,\n recentCommands,\n result,\n resultCommandId,\n searchWord,\n selectedCommandGroup,\n showBranding,\n status,\n },\n dispatch,\n };\n}\nexport const CommandBarStateProvider = ({ commands, children, IconComponent, userPreferences, }) => {\n const { state, dispatch } = useMemo(() => {\n return createAppState({\n activeCommandId: null,\n activeCommandMessage: null,\n availableCommandIds: Object.keys(commands),\n commandQuery: '',\n commands: flattenCommands(commands),\n expanded: false,\n favouriteCommands: userPreferences.favouriteCommands,\n highlightedItem: 0,\n highlightedOption: 0,\n recentCommands: userPreferences.recentCommands,\n result: null,\n resultCommandId: null,\n searchWord: '',\n selectedCommandGroup: null,\n showBranding: userPreferences.showBranding,\n status: STATUS.COLLAPSED,\n });\n }, []);\n // Provide all actions as shorthand functions\n const actions = useMemo(() => {\n return {\n [TRANSITION.RESET_SEARCH]: () => dispatch({ type: TRANSITION.RESET_SEARCH }),\n [TRANSITION.HIGHLIGHT_NEXT_ITEM]: () => dispatch({ type: TRANSITION.HIGHLIGHT_NEXT_ITEM }),\n [TRANSITION.HIGHLIGHT_PREVIOUS_ITEM]: () => dispatch({ type: TRANSITION.HIGHLIGHT_PREVIOUS_ITEM }),\n [TRANSITION.CANCEL]: () => dispatch({ type: TRANSITION.CANCEL }),\n [TRANSITION.SELECT_GROUP]: (commandId) => dispatch({ type: TRANSITION.SELECT_GROUP, commandId }),\n [TRANSITION.GO_TO_PARENT_GROUP]: () => dispatch({ type: TRANSITION.GO_TO_PARENT_GROUP }),\n [TRANSITION.UPDATE_SEARCH]: (searchWord) => dispatch({ type: TRANSITION.UPDATE_SEARCH, searchWord }),\n [TRANSITION.UPDATE_COMMAND_QUERY]: (commandQuery) => dispatch({ type: TRANSITION.UPDATE_COMMAND_QUERY, commandQuery }),\n [TRANSITION.EXECUTE_COMMAND]: async (commandId, message) => {\n dispatch({\n type: TRANSITION.EXECUTE_COMMAND,\n commandId,\n message,\n });\n // Update recent commands in the user preferences when a command is executed\n return userPreferences\n .addRecentCommand(commandId)\n .catch((e) => logger.error('Could not add recent command', e));\n },\n [TRANSITION.FINISH_COMMAND]: () => dispatch({ type: TRANSITION.FINISH_COMMAND }),\n [TRANSITION.UPDATE_RESULT]: (result) => dispatch({ type: TRANSITION.UPDATE_RESULT, result }),\n [TRANSITION.EXPAND]: () => dispatch({ type: TRANSITION.EXPAND }),\n [TRANSITION.ADD_FAVOURITE]: (commandId) => {\n dispatch({ type: TRANSITION.ADD_FAVOURITE, commandId });\n userPreferences\n .setFavouriteCommands(state.favouriteCommands.value)\n .catch((e) => logger.error('Could not update favourite commands', e));\n },\n [TRANSITION.REMOVE_FAVOURITE]: (commandId) => {\n dispatch({ type: TRANSITION.REMOVE_FAVOURITE, commandId });\n userPreferences\n .setFavouriteCommands(state.favouriteCommands.value)\n .catch((e) => logger.error('Could not update favourite commands', e));\n },\n };\n }, []);\n const Icon = useCallback(({ icon, spin = false }) => {\n return (React.createElement(IconWrapper, null,\n React.createElement(IconComponent, { icon: icon, spin: spin })));\n }, []);\n return React.createElement(CommandBarContext.Provider, { value: { state, actions, Icon } }, children);\n};\n","import React, { useCallback, useEffect } from 'react';\nimport useFunctionRef from '../hooks/useFunctionRef';\nimport { useCommandBarState } from './CommandBarStateProvider';\nimport { assert, logger } from '../helpers';\nimport { STATUS } from './commandBarMachine';\nconst CommandInputContext = React.createContext({});\nexport const useCommandExecutor = () => React.useContext(CommandInputContext);\n/**\n * Context provider for the command bar input and command execution\n */\nexport const CommandBarExecutor = ({ children, toggleOpen, dialogRef, open }) => {\n const { state, actions } = useCommandBarState();\n const handleKeyEnteredRef = useFunctionRef((e) => {\n if (!open || e.defaultPrevented) {\n return;\n }\n if (e.key === 'k' && e.metaKey && (dialogRef === null || dialogRef === void 0 ? void 0 : dialogRef.current.contains(e.target))) {\n // Close command bar\n toggleOpen();\n e.stopPropagation();\n e.preventDefault();\n }\n else if (e.key === 'Escape') {\n // Cancel search, or selection, or close command bar\n e.stopPropagation();\n e.preventDefault();\n if (state.selectedCommandGroup.value || state.searchWord.value || state.commandQuery.value) {\n actions.CANCEL();\n }\n else {\n // Close command bar if cancel is noop\n toggleOpen();\n }\n }\n else if (e.key === 'ArrowDown') {\n // Navigate to next command\n e.stopPropagation();\n e.preventDefault();\n actions.HIGHLIGHT_NEXT_ITEM();\n }\n else if (e.key === 'ArrowUp') {\n // Navigate to previous command\n e.stopPropagation();\n e.preventDefault();\n actions.HIGHLIGHT_PREVIOUS_ITEM();\n }\n else if (e.key === 'Enter') {\n // Execute highlighted command\n e.stopPropagation();\n e.preventDefault();\n // Select the highlighted command by default\n let commandId = state.availableCommandIds.value[state.highlightedItem.value];\n if (state.status.value === STATUS.DISPLAYING_RESULT) {\n // If there are options the command to execute is the highlighted option\n if (Object.values(state.result.value.options).length) {\n commandId = Object.keys(state.result.value.options)[state.highlightedOption.value];\n }\n else {\n // If there are no options we run the command which generated the result again\n commandId = state.resultCommandId.value;\n }\n }\n if (commandId) {\n void executeCommand(commandId);\n }\n }\n });\n const executeCommand = useCallback(async (commandId) => {\n var _a, _b, _c;\n const command = (_b = (_a = state.result.value) === null || _a === void 0 ? void 0 : _a.options[commandId]) !== null && _b !== void 0 ? _b : state.commands.value[commandId];\n const { action, canHandleQueries, subCommandIds, name } = command;\n // If the command is a group, select it\n if ((subCommandIds === null || subCommandIds === void 0 ? void 0 : subCommandIds.length) > 0) {\n actions.SELECT_GROUP(commandId);\n return;\n }\n assert(action, `Command ${commandId} has no action`);\n // If the command is a url, open it\n if (typeof action == 'string') {\n // We wait for the state change to be finished before opening the url\n await actions.EXECUTE_COMMAND(commandId, 'Loading url');\n // We need to check if the url is in the same domain, otherwise we need to open it in a new tab\n // TODO: We should add another option to a link command to define its target\n if (action.indexOf('http') === 0 && action.indexOf(document.location.origin) !== 0) {\n (_c = window.open(action, '_blank', 'noopener,noreferrer')) === null || _c === void 0 ? void 0 : _c.focus();\n }\n else {\n window.location.href = action;\n }\n return actions.FINISH_COMMAND();\n }\n // If the command is a function, execute it\n actions.EXECUTE_COMMAND(commandId, 'Running command');\n const actionResult = action(canHandleQueries ? state.commandQuery.value : undefined);\n if (actionResult.then) {\n // Handle Promises\n actionResult\n .then((result) => {\n if (result && !result.success) {\n throw new Error(`The command \"${name}\" failed`);\n }\n })\n .catch((error) => {\n // TODO: Show an error message to the user\n logger.error('Command error', name, error);\n })\n .finally(() => {\n actions.FINISH_COMMAND();\n });\n }\n else if (actionResult.next) {\n // Handle generators\n const generator = actionResult;\n // TODO: Handle errors / success === false\n for await (const result of generator) {\n actions.UPDATE_RESULT(result);\n }\n actions.FINISH_COMMAND();\n }\n else {\n logger.error('Command result is not a promise or generator', actionResult);\n }\n if (command.closeOnExecute) {\n toggleOpen();\n }\n }, [state.searchWord, state.commands, state.result]);\n const executeCommandRef = useFunctionRef((commandId) => {\n void executeCommand(commandId);\n });\n /**\n * Add key event handler, needs to be updated when any parameter for the key event handler changes\n */\n useEffect(() => {\n if (!open)\n return;\n // const guestFrame = document.getElementsByName('neos-content-main')[0] as HTMLIFrameElement;\n // guestFrame.contentWindow?.addEventListener('keyup', (e) => {\n // log.debug('keypress in guestframe', e);\n // });\n // log.debug('guestFrame', guestFrame.contentWindow);\n const windowKeyEventHandler = (e) => handleKeyEnteredRef.current(e);\n window.addEventListener('keydown', windowKeyEventHandler);\n return () => window.removeEventListener('keydown', windowKeyEventHandler);\n }, [open]);\n return (React.createElement(CommandInputContext.Provider, { value: { executeCommand: executeCommandRef.current } }, children));\n};\n","import React, { createContext, useContext } from 'react';\nexport const IntlContext = createContext({});\nexport const useIntl = () => useContext(IntlContext);\nexport const IntlProvider = ({ translate, children }) => {\n return React.createElement(IntlContext.Provider, { value: { translate } }, children);\n};\n","import React, { useCallback, useEffect, useRef } from 'react';\nimport { batch, useComputed, useSignal } from '@preact/signals';\nimport { CommandBarFooter, CommandBarHeader, CommandList, CommandResultsView } from '../index';\nimport { CommandBarExecutor, useCommandBarState } from '../../state';\nimport { clamp, classnames } from '../../helpers';\nimport * as styles from './CommandBarDialog.module.css';\nconst CommandBarDialog = ({ onDrag, open, toggleOpen }) => {\n const { state: { expanded, result }, } = useCommandBarState();\n const dialogRef = useRef(null);\n const isDragging = useSignal(false);\n const dialogPosition = useSignal({\n left: window.innerWidth / 2 - 300,\n top: window.innerHeight / 2 - 20,\n });\n const dragStateOffset = useSignal({\n offsetLeft: 0,\n offsetTop: 0,\n });\n const hasBeenDragged = useSignal(false);\n const dialogStyle = useComputed(() => {\n const { left, top } = dialogPosition.value;\n return (hasBeenDragged.value\n ? {\n left: left + 'px',\n top: top + 'px',\n translate: 'none',\n visibility: isDragging.value ? 'hidden' : 'visible',\n }\n : {});\n });\n const reposition = useCallback((left, top) => {\n const dialogSize = dialogRef.current.getBoundingClientRect();\n dialogPosition.value = {\n left: clamp(left, 0, window.innerWidth - dialogSize.width),\n top: clamp(top, 0, window.innerHeight - dialogSize.height),\n };\n }, []);\n const handleDragStart = useCallback((e) => {\n // @ts-ignore\n if (e.target.tagName === 'INPUT') {\n return;\n }\n console.debug('dragstart');\n e.dataTransfer.setData('text/plain', 'CommandBar');\n e.dataTransfer.dropEffect = 'move';\n e.dataTransfer.effectAllowed = 'move';\n batch(() => {\n dragStateOffset.value = {\n offsetLeft: e.clientX - dialogRef.current.offsetLeft,\n offsetTop: e.clientY - dialogRef.current.offsetTop,\n };\n hasBeenDragged.value = true;\n });\n onDrag && onDrag(true);\n }, [dialogRef.current]);\n const handleDragDrop = useCallback((e) => {\n const { clientX, clientY } = e;\n console.debug('dragdrop', clientX, clientY, dragStateOffset.value);\n batch(() => {\n isDragging.value = false;\n reposition(clientX - dragStateOffset.value.offsetLeft, clientY - dragStateOffset.value.offsetTop);\n });\n onDrag && onDrag(false);\n }, [dialogRef.current]);\n const onResize = useCallback(() => reposition(dialogPosition.value.left, dialogPosition.value.top), []);\n useEffect(() => {\n var _a, _b;\n if (!open)\n return;\n (_b = (_a = dialogRef.current) === null || _a === void 0 ? void 0 : _a.parentElement) === null || _b === void 0 ? void 0 : _b.addEventListener('drop', handleDragDrop);\n window.addEventListener('resize', onResize);\n return () => {\n var _a, _b;\n (_b = (_a = dialogRef.current) === null || _a === void 0 ? void 0 : _a.parentElement) === null || _b === void 0 ? void 0 : _b.removeEventListener('drop', handleDragDrop);\n window.removeEventListener('resize', onResize);\n };\n }, [open, onResize, handleDragDrop]);\n if (!open) {\n return null;\n }\n return (React.createElement(\"dialog\", { ref: dialogRef, className: classnames(styles.commandBar, result.value && styles.hasResults), open: open, draggable: true, onDragStart: handleDragStart, onDrag: () => (isDragging.value = true), style: dialogStyle.value, \"data-testid\": \"CommandBarDialog\" },\n React.createElement(CommandBarExecutor, { toggleOpen: toggleOpen, dialogRef: dialogRef, open: open },\n React.createElement(CommandBarHeader, null),\n React.createElement(\"div\", { className: classnames(styles.resultsWrap, expanded.value && styles.expanded, result.value && styles.split) },\n expanded.value && React.createElement(CommandList, null),\n result.value && React.createElement(CommandResultsView, null)),\n React.createElement(CommandBarFooter, null))));\n};\nexport default CommandBarDialog;\n","import React from 'react';\nimport { CommandBarStateProvider, IntlProvider } from './state';\nimport CommandBarDialog from './components/CommandBarDialog/CommandBarDialog';\nimport './Variables.module.css';\nconst CommandBar = ({ commands, open, toggleOpen, onDrag, IconComponent, userPreferences, translate, }) => {\n return (React.createElement(IntlProvider, { translate: translate },\n React.createElement(CommandBarStateProvider, { commands: commands, IconComponent: IconComponent, userPreferences: userPreferences },\n React.createElement(CommandBarDialog, { onDrag: onDrag, open: open, toggleOpen: toggleOpen }))));\n};\nexport default CommandBar;\n","export async function fetchData(endpoint, params, method = 'GET') {\n if (params && method === 'GET') {\n endpoint = Object.keys(params).reduce((url, key) => {\n return url + '&' + key + '=' + encodeURIComponent(params[key]);\n }, endpoint + '?');\n }\n return fetch(endpoint, {\n method,\n credentials: 'include',\n body: params && method === 'POST' ? JSON.stringify(params) : undefined,\n headers: {\n // FIXME: Include CSRF Token\n // 'X-Flow-Csrftoken': csrfToken,\n 'Content-Type': 'application/json',\n Accept: 'application/json',\n },\n }).then((response) => {\n var _a;\n if (response.status !== 200) {\n throw new Error(`The request failed with code ${response.status}: \"${response.statusText}\"`);\n }\n if ((_a = response.headers.get('Content-Type')) === null || _a === void 0 ? void 0 : _a.includes('application/json')) {\n return response.json();\n }\n return response.text();\n });\n}\n","import { fetchData } from './fetch';\nconst ENDPOINT_GET_PREFERENCES = '/neos/shel-neos-commandbar/preferences/getpreferences';\nconst ENDPOINT_SET_FAVOURITE_COMMANDS = '/neos/shel-neos-commandbar/preferences/setfavourites';\nconst ENDPOINT_ADD_RECENT_COMMAND = '/neos/shel-neos-commandbar/preferences/addrecentcommand';\nasync function setPreference(endpoint, data) {\n return fetchData(endpoint, data, 'POST');\n}\nexport async function getPreferences() {\n return fetchData(ENDPOINT_GET_PREFERENCES);\n}\nexport async function setFavouriteCommands(commandIds) {\n return setPreference(ENDPOINT_SET_FAVOURITE_COMMANDS, { commandIds: commandIds });\n}\nexport async function addRecentCommand(commandId) {\n // TODO: Check if sendBeacon is a better option here to reduce the impact on the user\n return setPreference(ENDPOINT_ADD_RECENT_COMMAND, { commandId: commandId });\n}\n","import { fetchData } from './fetch';\nconst ENDPOINT_COMMANDS = '/neos/service/data-source/shel-neos-commandbar-commands';\nexport async function getCommands() {\n return fetchData(ENDPOINT_COMMANDS);\n}\n","import { fetchData } from './fetch';\nconst ENDPOINT_SEARCH_NEOS_DOCS = '/neos/service/data-source/shel-neos-commandbar-search-neos-docs';\nexport async function searchNeosDocs(query) {\n return query ? fetchData(ENDPOINT_SEARCH_NEOS_DOCS, { query }) : {};\n}\n","import { fetchData } from './fetch';\nconst ENDPOINT_SEARCH_NEOS_PACKAGES = '/neos/service/data-source/shel-neos-commandbar-search-neos-packages';\nexport async function searchNeosPackages(query) {\n return query ? fetchData(ENDPOINT_SEARCH_NEOS_PACKAGES, { query }) : {};\n}\n","import { fetchData } from './fetch';\nconst ENDPOINT_SEARCH_NODES = 'service/data-source/shel-neos-commandbar-search-nodes';\nexport async function searchNodes(query, node) {\n return query\n ? fetchData(ENDPOINT_SEARCH_NODES, {\n query,\n node,\n })\n : [];\n}\n","import * as React from 'react';\nimport { connect } from 'react-redux';\nimport PropTypes from 'prop-types';\n// Neos dependencies are provided by the UI\n// @ts-ignore\nimport { neos } from '@neos-project/neos-ui-decorators';\n// @ts-ignore\nimport { selectors, actions } from '@neos-project/neos-ui-redux-store';\nimport { Icon } from '@neos-project/react-ui-components';\nimport { CommandBar, logger, ToggleButton } from '@neos-commandbar/commandbar';\nimport { CommandsApi, PreferencesApi, DocumentationApi, NodesApi, PackagesApi } from '@neos-commandbar/neos-api';\nimport { actions as commandBarActions, selectors as commandBarSelectors } from './actions';\nimport * as styles from './CommandBarUiPlugin.module.css';\nconst IconComponent = ({ icon, spin = false }) => React.createElement(Icon, { icon: icon, spin: spin });\nclass CommandBarUiPlugin extends React.PureComponent {\n constructor(props) {\n super(props);\n this.buildCommandsFromHotkeys = () => {\n const { hotkeyRegistry, handleHotkeyAction, config } = this.props;\n const hotkeys = hotkeyRegistry.getAllAsList();\n return hotkeys.reduce((carry, { id, description, action }) => {\n if (!config.hotkeys.filter.includes(id)) {\n carry[id] = {\n name: description,\n description: id,\n icon: this.mapHotkeyIdToIcon(id),\n action: async () => void handleHotkeyAction(action()),\n closeOnExecute: true,\n };\n }\n return carry;\n }, {});\n };\n this.buildCommandsFromEditPreviewModes = () => {\n const { setEditPreviewMode, editPreviewModes, i18nRegistry } = this.props;\n return Object.keys(editPreviewModes).reduce((carry, mode) => {\n const { title, isEditingMode } = editPreviewModes[mode];\n carry[mode] = {\n name: i18nRegistry.translate(title),\n description: () => this.props.editPreviewMode === mode\n ? this.translate('CommandBarUiPlugin.command.switchEditPreviewMode.active', 'Currently active')\n : '',\n icon: isEditingMode ? 'pencil' : 'eye',\n action: async () => setEditPreviewMode(mode),\n };\n return carry;\n }, {});\n };\n this.handleAddNode = async () => {\n const { addNode, documentNode, focusedNodeContextPath, toggleCommandBar } = this.props;\n toggleCommandBar();\n addNode(focusedNodeContextPath || documentNode.contextPath, undefined, 'after');\n };\n this.handleSearchNode = async function* (query) {\n const { siteNode, setActiveContentCanvasSrc } = this.props;\n yield {\n success: true,\n message: this.translate('CommandBarUiPlugin.command.searchDocuments.searching', { query }),\n };\n let error;\n const results = await NodesApi.searchNodes(query, siteNode.contextPath).catch((e) => {\n logger.error('Could not search nodes', e);\n error = e.message;\n });\n if (!results) {\n yield {\n success: false,\n message: this.translate('CommandBarUiPlugin.command.searchDocuments.searchFailed', 'Search failed'),\n view: error,\n };\n }\n else {\n yield {\n success: true,\n message: this.translate('CommandBarUiPlugin.command.searchDocuments.matches', {\n matches: results.length,\n }),\n options: results.reduce((carry, { name, nodetype, contextPath, uri, icon }) => {\n if (!uri) {\n // TODO: Show hint that document cannot be opened or filter them remotely already?\n return carry;\n }\n carry[contextPath] = {\n id: contextPath,\n name,\n category: nodetype,\n action: async () => {\n setActiveContentCanvasSrc(uri);\n },\n closeOnExecute: true,\n icon,\n };\n return carry;\n }, {}),\n };\n }\n };\n this.handleSearchNeosDocs = async function* (query) {\n yield {\n success: true,\n message: this.translate('CommandBarUiPlugin.command.documentation.searching', { query }, `Search for \"${query}\"`),\n };\n let error;\n const options = await DocumentationApi.searchNeosDocs(query).catch((e) => {\n logger.error('Could not search Neos docs', e);\n error = e.message;\n });\n if (error || !options) {\n yield {\n success: false,\n message: this.translate('CommandBarUiPlugin.command.documentation.error', 'Search failed'),\n view: error,\n };\n }\n else {\n yield {\n success: true,\n message: this.translate('CommandBarUiPlugin.command.documentation.matches', { matches: Object.keys(options).length }, `${Object.values(options).length} options match your query`),\n options,\n };\n }\n };\n this.handleSearchNeosPackages = async function* (query) {\n yield {\n success: true,\n message: this.translate('CommandBarUiPlugin.command.packages.searching', { query }, `Search for \"${query}\"`),\n };\n let error;\n const options = await PackagesApi.searchNeosPackages(query).catch((e) => {\n logger.error('Could not search Neos packages', e);\n error = e.message;\n });\n if (error || !options) {\n yield {\n success: false,\n message: this.translate('CommandBarUiPlugin.command.packages.error', 'Search failed'),\n view: error,\n };\n }\n else {\n yield {\n success: true,\n message: this.translate('CommandBarUiPlugin.command.packages.matches', { matches: Object.values(options).length }, `${Object.values(options).length} options match your query`),\n options,\n };\n }\n };\n this.handlePublish = async () => {\n const { publishableNodesInDocument, publishAction, baseWorkspace } = this.props;\n publishAction(publishableNodesInDocument.map((node) => node.contextPath), baseWorkspace);\n return {\n success: true,\n message: this.translate('CommandBarUiPlugin.command.publish.success', { count: publishableNodesInDocument.length }, `Published ${publishableNodesInDocument.length} changes`),\n };\n };\n this.handlePublishAll = async () => {\n const { publishableNodes, publishAction, baseWorkspace } = this.props;\n publishAction(publishableNodes.map((node) => node.contextPath), baseWorkspace);\n return {\n success: true,\n message: this.translate('CommandBarUiPlugin.command.publishAll.success', { count: publishableNodes.length }, `Published ${publishableNodes.length} changes`),\n };\n };\n this.handleDiscard = async () => {\n const { publishableNodesInDocument, discardAction } = this.props;\n discardAction(publishableNodesInDocument.map((node) => node.contextPath));\n return {\n success: true,\n message: this.translate('CommandBarUiPlugin.command.discard.success', { count: publishableNodesInDocument.length }, `Discarded ${publishableNodesInDocument.length} changes`),\n };\n };\n this.handleDiscardAll = async () => {\n const { publishableNodes, discardAction } = this.props;\n discardAction(publishableNodes.map((node) => node.contextPath));\n return {\n success: true,\n message: this.translate('CommandBarUiPlugin.command.discardAll.success', { count: publishableNodes.length }, `Discarded ${publishableNodes.length} changes`),\n };\n };\n this.setDragging = (dragging) => {\n this.setState({ ...this.state, dragging });\n };\n this.translate = (id, paramsOrFallback, fallback) => {\n if (typeof paramsOrFallback === 'string') {\n fallback = paramsOrFallback;\n paramsOrFallback = {};\n }\n return this.props.i18nRegistry.translate(id, fallback, paramsOrFallback, 'Shel.Neos.CommandBar', 'Main');\n };\n this.state = {\n loaded: false,\n dragging: false,\n favouriteCommands: [],\n recentCommands: [],\n recentDocuments: [],\n showBranding: true,\n commands: {\n addNode: {\n name: this.translate('CommandBarUiPlugin.command.addNode', 'Add content'),\n icon: 'plus',\n description: this.translate('CommandBarUiPlugin.command.addNode.description', 'Add new content'),\n action: this.handleAddNode,\n },\n searchDocuments: {\n name: this.translate('CommandBarUiPlugin.command.searchDocuments', 'Search documents'),\n icon: 'search',\n description: this.translate('CommandBarUiPlugin.command.searchDocuments.description', 'Search and navigate to documents'),\n action: this.handleSearchNode.bind(this),\n canHandleQueries: true,\n },\n publishDiscard: {\n name: this.translate('CommandBarUiPlugin.command.publishDiscard', 'Publish / discard'),\n description: this.translate('CommandBarUiPlugin.command.publishDiscard.description', 'Publish or discard changes'),\n icon: 'check',\n subCommands: {\n publish: {\n name: this.translate('CommandBarUiPlugin.command.publish', 'Publish'),\n description: this.translate('CommandBarUiPlugin.command.publish.description', 'Publish changes in this document'),\n icon: 'check',\n action: this.handlePublish,\n },\n publishAll: {\n name: this.translate('CommandBarUiPlugin.command.publishAll', 'Publish all'),\n description: this.translate('CommandBarUiPlugin.command.publishAll.description', 'Publish changes in all documents'),\n icon: 'check-double',\n action: this.handlePublishAll,\n },\n discard: {\n name: this.translate('CommandBarUiPlugin.command.discard', 'Discard'),\n description: this.translate('CommandBarUiPlugin.command.discard.description', 'Discard changes in the current document'),\n icon: 'ban',\n action: this.handleDiscard,\n },\n discardAll: {\n name: this.translate('CommandBarUiPlugin.command.discardAll', 'Discard all'),\n description: this.translate('CommandBarUiPlugin.command.discardAll.description', 'Discard changes in all documents'),\n icon: 'ban',\n action: this.handleDiscardAll,\n },\n },\n },\n quickActions: {\n name: this.translate('CommandBarUiPlugin.command.quickActions', 'Quick actions'),\n icon: 'keyboard',\n description: this.translate('CommandBarUiPlugin.command.quickActions.description', 'Execute hotkeys'),\n subCommands: this.buildCommandsFromHotkeys(),\n },\n switchEditPreviewMode: {\n name: this.translate('CommandBarUiPlugin.command.switchEditPreviewMode', 'Switch edit/preview mode'),\n icon: 'pencil',\n description: this.translate('CommandBarUiPlugin.command.switchEditPreviewMode.description', 'Switch between edit and preview modes'),\n subCommands: this.buildCommandsFromEditPreviewModes(),\n },\n openPreview: {\n name: this.translate('CommandBarUiPlugin.command.openPreview', 'Open preview'),\n description: this.translate('CommandBarUiPlugin.command.openPreview.description', 'Open the preview for current document'),\n icon: 'external-link-alt',\n action: async () => {\n var _a;\n if (this.props.previewUrl) {\n (_a = window.open(this.props.previewUrl, '_blank', 'noopener,noreferrer')) === null || _a === void 0 ? void 0 : _a.focus();\n }\n else {\n logger.warn('No preview url to open');\n }\n },\n closeOnExecute: true,\n },\n },\n };\n if (props.config.features.searchNeosDocs) {\n this.state.commands.searchNeosDocs = {\n name: this.translate('CommandBarUiPlugin.command.documentation', 'Documentation'),\n description: this.translate('CommandBarUiPlugin.command.documentation.description', 'Browse or search the Neos documentation'),\n icon: 'book',\n canHandleQueries: true,\n action: this.handleSearchNeosDocs.bind(this),\n };\n }\n if (props.config.features.searchNeosPackages) {\n this.state.commands.searchNeosPackages = {\n name: this.translate('CommandBarUiPlugin.command.packages', 'Packages'),\n description: this.translate('CommandBarUiPlugin.command.packages.description', 'Search for Neos packages'),\n icon: 'boxes',\n canHandleQueries: true,\n action: this.handleSearchNeosPackages.bind(this),\n };\n }\n }\n mapHotkeyIdToIcon(id) {\n let actionName = id.split('.').pop();\n // Some actions have the name 'toggle' with a suffix, e.g. 'toggleFullScreen'\n if (actionName.indexOf('toggle') >= 0) {\n actionName = 'toggle';\n }\n switch (actionName) {\n case 'toggle':\n return 'toggle-on';\n case 'reload':\n return 'redo';\n case 'cancel':\n case 'close':\n return 'window-close';\n case 'apply':\n return 'check';\n }\n return 'neos';\n }\n async componentDidMount() {\n const { plugins } = this.props;\n // Load 3rd party commands\n let pluginCommands = {};\n if (plugins) {\n for (const pluginName of Object.keys(plugins)) {\n const plugin = plugins[pluginName];\n try {\n const pluginResult = await plugin();\n pluginCommands = { ...pluginCommands, ...pluginResult };\n }\n catch (e) {\n logger.warn(`Could not load commands from plugin ${pluginName}`, e);\n }\n }\n }\n // Load commands from data source which are not available via the UI API\n const commands = await CommandsApi.getCommands().catch((error) => {\n logger.error('Failed to load commands', error);\n });\n // Load user preferences\n const preferences = await PreferencesApi.getPreferences().catch((error) => {\n logger.error('Failed to load user preferences', error);\n });\n if (!preferences || !commands)\n return;\n this.setState((prev) => ({\n loaded: true,\n ...preferences,\n commands: { ...prev.commands, ...commands, ...pluginCommands },\n }));\n }\n render() {\n const { commandBarOpen, toggleCommandBar } = this.props;\n const { commands, loaded, dragging, favouriteCommands, recentCommands, recentDocuments, showBranding } = this.state;\n return (React.createElement(\"div\", { className: styles.commandBarToolbarComponent },\n React.createElement(ToggleButton, { handleToggle: toggleCommandBar, disabled: !loaded, label: this.translate('ToggleButton.label', 'Search…'), title: this.translate('ToggleButton.title', 'Search for commands') }),\n loaded && (React.createElement(\"div\", { className: [styles.fullScreenLayer, commandBarOpen && styles.open].join(' '), onDragOver: (e) => e.preventDefault(), style: dragging ? { pointerEvents: 'all' } : null },\n React.createElement(CommandBar, { open: commandBarOpen, commands: commands, toggleOpen: toggleCommandBar, onDrag: this.setDragging, IconComponent: IconComponent, userPreferences: {\n favouriteCommands,\n recentCommands,\n recentDocuments,\n showBranding,\n addRecentCommand: PreferencesApi.addRecentCommand,\n setFavouriteCommands: PreferencesApi.setFavouriteCommands,\n }, translate: this.translate })))));\n }\n}\nCommandBarUiPlugin.propTypes = {\n addNode: PropTypes.func.isRequired,\n baseWorkspace: PropTypes.string.isRequired,\n commandBarOpen: PropTypes.bool,\n config: PropTypes.object.isRequired,\n discardAction: PropTypes.func.isRequired,\n documentNode: PropTypes.object,\n editPreviewMode: PropTypes.string.isRequired,\n editPreviewModes: PropTypes.object.isRequired,\n focusedNodeContextPath: PropTypes.string,\n handleHotkeyAction: PropTypes.func.isRequired,\n hotkeyRegistry: PropTypes.object.isRequired,\n i18nRegistry: PropTypes.object.isRequired,\n isWorkspaceReadOnly: PropTypes.bool,\n publishAction: PropTypes.func.isRequired,\n publishableNodes: PropTypes.array,\n publishableNodesInDocument: PropTypes.array,\n previewUrl: PropTypes.string,\n setActiveContentCanvasSrc: PropTypes.func.isRequired,\n setEditPreviewMode: PropTypes.func.isRequired,\n siteNode: PropTypes.object,\n toggleCommandBar: PropTypes.func.isRequired,\n};\nconst mapStateToProps = (state) => ({\n siteNode: selectors.CR.Nodes.siteNodeSelector(state),\n documentNode: selectors.CR.Nodes.documentNodeSelector(state),\n focusedNodeContextPath: selectors.CR.Nodes.focusedNodePathSelector(state),\n publishableNodes: selectors.CR.Workspaces.publishableNodesSelector(state),\n publishableNodesInDocument: selectors.CR.Workspaces.publishableNodesInDocumentSelector(state),\n isWorkspaceReadOnly: selectors.CR.Workspaces.isWorkspaceReadOnlySelector(state),\n baseWorkspace: selectors.CR.Workspaces.baseWorkspaceSelector(state),\n commandBarOpen: commandBarSelectors.commandBarOpen(state),\n editPreviewMode: selectors.UI.EditPreviewMode.currentEditPreviewMode(state),\n previewUrl: commandBarSelectors.previewUrl(state),\n});\nconst mapDispatchToProps = (dispatch) => ({\n handleHotkeyAction: dispatch,\n});\nconst mapGlobalRegistryToProps = neos((globalRegistry) => ({\n i18nRegistry: globalRegistry.get('i18n'),\n hotkeyRegistry: globalRegistry.get('hotkeys'),\n config: globalRegistry.get('frontendConfiguration').get('Shel.Neos.CommandBar:CommandBar'),\n nodeTypesRegistry: globalRegistry.get('@neos-project/neos-ui-contentrepository'),\n editPreviewModes: globalRegistry.get('frontendConfiguration').get('editPreviewModes'),\n plugins: globalRegistry.get('Shel.Neos.CommandBar').getChildrenAsObject('plugins'),\n}));\nexport default connect(() => ({}), {\n toggleCommandBar: commandBarActions.toggleCommandBar,\n addNode: actions.CR.Nodes.commenceCreation,\n setEditPreviewMode: actions.UI.EditPreviewMode.set,\n publishAction: actions.CR.Workspaces.publish,\n discardAction: actions.CR.Workspaces.commenceDiscard,\n setActiveContentCanvasSrc: actions.UI.ContentCanvas.setSrc,\n})(connect(mapStateToProps, mapDispatchToProps)(mapGlobalRegistryToProps(CommandBarUiPlugin)));\n"],"sourceRoot":""} \ No newline at end of file diff --git a/packages/commandbar/src/components/CommandBarDialog/CommandBarDialog.tsx b/packages/commandbar/src/components/CommandBarDialog/CommandBarDialog.tsx index b55f304..0857224 100644 --- a/packages/commandbar/src/components/CommandBarDialog/CommandBarDialog.tsx +++ b/packages/commandbar/src/components/CommandBarDialog/CommandBarDialog.tsx @@ -39,7 +39,7 @@ const CommandBarDialog: React.FC = ({ onDrag, open, toggl const dialogStyle = useComputed(() => { const { left, top } = dialogPosition.value; return ( - hasBeenDragged + hasBeenDragged.value ? { left: left + 'px', top: top + 'px', @@ -99,10 +99,10 @@ const CommandBarDialog: React.FC = ({ onDrag, open, toggl useEffect(() => { if (!open) return; - dialogRef.current.parentElement.addEventListener('drop', handleDragDrop); + dialogRef.current?.parentElement?.addEventListener('drop', handleDragDrop); window.addEventListener('resize', onResize); return () => { - dialogRef.current.parentElement.removeEventListener('drop', handleDragDrop); + dialogRef.current?.parentElement?.removeEventListener('drop', handleDragDrop); window.removeEventListener('resize', onResize); }; }, [open, onResize, handleDragDrop]);