import{g as V}from"./index-91b358e1.js";function W(g,E){for(var c=0;cp[b]})}}}return Object.freeze(Object.defineProperty(g,Symbol.toStringTag,{value:"Module"}))}var N={exports:{}};(function(g,E){ace.define("ace/ext/command_bar",["require","exports","module","ace/tooltip","ace/lib/event_emitter","ace/lib/lang","ace/lib/dom","ace/lib/oop","ace/lib/useragent"],function(c,p,b){var $=this&&this.__values||function(o){var t=typeof Symbol=="function"&&Symbol.iterator,e=t&&o[t],i=0;if(e)return e.call(o);if(o&&typeof o.length=="number")return{next:function(){return o&&i>=o.length&&(o=void 0),{value:o&&o[i++],done:!o}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},x=c("../tooltip").Tooltip,I=c("../lib/event_emitter").EventEmitter,M=c("../lib/lang"),f=c("../lib/dom"),j=c("../lib/oop"),L=c("../lib/useragent"),a="command_bar_tooltip_button",w="command_bar_button_value",H="command_bar_button_caption",y="command_bar_keybinding",d="command_bar_tooltip",C="MoreOptionsButton",k=100,F=4,O=function(o,t){return t.row>o.row||t.row===o.row&&t.column>o.column?o:t},T={Ctrl:{mac:"^"},Option:{mac:"⌥"},Command:{mac:"⌘"},Cmd:{mac:"⌘"},Shift:"⇧",Left:"←",Right:"→",Up:"↑",Down:"↓"},P=function(){function o(t,e){var i,l;e=e||{},this.parentNode=t,this.tooltip=new x(this.parentNode),this.moreOptions=new x(this.parentNode),this.maxElementsOnTooltip=e.maxElementsOnTooltip||F,this.$alwaysShow=e.alwaysShow||!1,this.eventListeners={},this.elements={},this.commands={},this.tooltipEl=f.buildDom(["div",{class:d}],this.tooltip.getElement()),this.moreOptionsEl=f.buildDom(["div",{class:d+" tooltip_more_options"}],this.moreOptions.getElement()),this.$showTooltipTimer=M.delayedCall(this.$showTooltip.bind(this),e.showDelay||k),this.$hideTooltipTimer=M.delayedCall(this.$hideTooltip.bind(this),e.hideDelay||k),this.$tooltipEnter=this.$tooltipEnter.bind(this),this.$onMouseMove=this.$onMouseMove.bind(this),this.$onChangeScroll=this.$onChangeScroll.bind(this),this.$onEditorChangeSession=this.$onEditorChangeSession.bind(this),this.$scheduleTooltipForHide=this.$scheduleTooltipForHide.bind(this),this.$preventMouseEvent=this.$preventMouseEvent.bind(this);try{for(var s=$(["mousedown","mouseup","click"]),n=s.next();!n.done;n=s.next()){var r=n.value;this.tooltip.getElement().addEventListener(r,this.$preventMouseEvent),this.moreOptions.getElement().addEventListener(r,this.$preventMouseEvent)}}catch(u){i={error:u}}finally{try{n&&!n.done&&(l=s.return)&&l.call(s)}finally{if(i)throw i.error}}}return o.prototype.registerCommand=function(t,e){var i=Object.keys(this.commands).length=_.top&&n.top<=_.bottom&&n.left>=_.left+t.gutterWidth&&n.left<=_.right;if(!A&&this.isShown()){this.$hideTooltip();return}else if(A&&!this.isShown()&&this.getAlwaysShow()){this.$showTooltip();return}var m=n.top-r.offsetHeight,v=Math.min(u-r.offsetWidth,n.left),R=m>=0&&m+r.offsetHeight<=h&&v>=0&&v+r.offsetWidth<=u;if(!R){this.$hideTooltip();return}if(this.tooltip.setPosition(v,m),this.isMoreOptionsShown()){m=m+r.offsetHeight,v=this.elements[C].getBoundingClientRect().left;var S=this.moreOptions.getElement(),h=window.innerHeight;m+S.offsetHeight>h&&(m-=r.offsetHeight+S.offsetHeight),v+S.offsetWidth>u&&(v=u-S.offsetWidth),this.moreOptions.setPosition(v,m)}}}},o.prototype.update=function(){Object.keys(this.elements).forEach(this.$updateElement.bind(this))},o.prototype.detach=function(){this.tooltip.hide(),this.moreOptions.hide(),this.$updateOnHoverHandlers(!1),this.editor&&(this.editor.off("changeSession",this.$onEditorChangeSession),this.editor.session&&(this.editor.session.off("changeScrollLeft",this.$onChangeScroll),this.editor.session.off("changeScrollTop",this.$onChangeScroll))),this.$mouseInTooltip=!1,this.editor=null},o.prototype.destroy=function(){this.tooltip&&this.moreOptions&&(this.detach(),this.tooltip.destroy(),this.moreOptions.destroy()),this.eventListeners={},this.commands={},this.elements={},this.tooltip=this.moreOptions=this.parentNode=null},o.prototype.$createCommand=function(t,e,i){var l=i?this.tooltipEl:this.moreOptionsEl,s=[],n=e.bindKey;n&&(typeof n=="object"&&(n=L.isMac?n.mac:n.win),n=n.split("|")[0],s=n.split("-"),s=s.map(function(h){if(T[h]){if(typeof T[h]=="string")return T[h];if(L.isMac&&T[h].mac)return T[h].mac}return h}));var r;i&&e.iconCssClass?r=["div",{class:["ace_icon_svg",e.iconCssClass].join(" "),"aria-label":e.name+" ("+e.bindKey+")"}]:(r=[["div",{class:w}],["div",{class:H},e.name]],s.length&&r.push(["div",{class:y},s.map(function(h){return["div",h]})])),f.buildDom(["div",{class:[a,e.cssClass||""].join(" "),ref:t},r],l,this.elements),this.commands[t]=e;var u=function(h){this.editor&&this.editor.focus(),this.$shouldHideMoreOptions=this.isMoreOptionsShown(),!this.elements[t].disabled&&e.exec&&e.exec(this.editor),this.$shouldHideMoreOptions&&this.$setMoreOptionsVisibility(!1),this.update(),h.preventDefault()}.bind(this);this.eventListeners[t]=u,this.elements[t].addEventListener("click",u.bind(this)),this.$updateElement(t)},o.prototype.$setMoreOptionsVisibility=function(t){t?(this.moreOptions.setTheme(this.editor.renderer.theme),this.moreOptions.setClassName(d+"_wrapper"),this.moreOptions.show(),this.update(),this.updatePosition()):this.moreOptions.hide()},o.prototype.$onEditorChangeSession=function(t){t.oldSession&&(t.oldSession.off("changeScrollTop",this.$onChangeScroll),t.oldSession.off("changeScrollLeft",this.$onChangeScroll)),this.detach()},o.prototype.$onChangeScroll=function(){this.editor.renderer&&(this.isShown()||this.getAlwaysShow())&&this.editor.renderer.once("afterRender",this.updatePosition.bind(this))},o.prototype.$onMouseMove=function(t){if(!this.$mouseInTooltip){var e=this.editor.getCursorPosition(),i=this.editor.renderer.textToScreenCoordinates(e.row,e.column),l=this.editor.renderer.lineHeight,s=t.clientY>=i.pageY&&t.clientY