"use strict";var c=Object.defineProperty;var T=Object.getOwnPropertyDescriptor;var V=Object.getOwnPropertyNames;var v=Object.prototype.hasOwnProperty;var S=(e,o)=>{for(var t in o)c(e,t,{get:o[t],enumerable:!0})},k=(e,o,t,m)=>{if(o&&typeof o=="object"||typeof o=="function")for(let r of V(o))!v.call(e,r)&&r!==t&&c(e,r,{get:()=>o[r],enumerable:!(m=T(o,r))||m.enumerable});return e};var K=e=>k(c({},"__esModule",{value:!0}),e);var A={};S(A,{basicSetup:()=>C,createEditor:()=>U});module.exports=K(A);var y=require("@codemirror/view");var u=require("@codemirror/state"),i=require("@codemirror/autocomplete"),a=require("@codemirror/commands"),d=require("@codemirror/language"),h=require("@codemirror/lint"),s=require("@codemirror/search"),n=require("@codemirror/view"),g=require("@chordbook/codemirror-lang-chordpro"),x=require("@codemirror/theme-one-dark");var l=require("@codemirror/view"),f=l.EditorView.baseTheme({"&":{minHeight:"100%"},".cm-editor":{minHeight:"100%"},".cm-scroller":{flex:"1"}});var E=[f,x.oneDark,(0,g.ChordPro)(),(0,n.lineNumbers)(),(0,n.highlightActiveLineGutter)(),(0,n.highlightSpecialChars)(),(0,a.history)(),(0,n.drawSelection)(),(0,i.autocompletion)(),u.EditorState.allowMultipleSelections.of(!0),(0,d.bracketMatching)(),(0,i.closeBrackets)(),(0,n.highlightActiveLine)(),(0,s.highlightSelectionMatches)(),n.keymap.of([...i.closeBracketsKeymap,...a.defaultKeymap,...s.searchKeymap,...a.historyKeymap,...i.completionKeymap,...h.lintKeymap,{key:"Tab",preventDefault:!0,run:e=>(0,i.completionStatus)(e.state)?(0,i.acceptCompletion)(e):!1}])];var b=require("@codemirror/view");function p(e,o,t={}){let m=new CustomEvent(o,{bubbles:!0,detail:{viewUpdate:e,...t}});e.view.dom.dispatchEvent(m)}var B=e=>{p(e,"change",{doc:e.state.doc.toString()})},F=e=>{p(e,"focus")},L=e=>{p(e,"blur")};function w({changeInterval:e=300}={}){let o=M(B,e);return[b.EditorView.updateListener.of(t=>{t.docChanged&&o(t),t.focusChanged&&(t.view.hasFocus?F(t):L(t))})]}function M(e,o=300){let t=0;return(...r)=>{clearTimeout(t),t=setTimeout(()=>e(...r),o)}}var C=[...E,...w()];function U(e={}){return new y.EditorView({...e,extensions:[...C,...e.extensions?[e.extensions]:[]].flat()})}0&&(module.exports={basicSetup,createEditor}); //# sourceMappingURL=index.cjs.map