1var e=Object.defineProperty,t=(t,i,n)=>(((t,i,n)=>{i in t?e(t,i,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[i]=n})(t,"symbol"!=typeof i?i+"":i,n),n);import{W as i,C as n,L as o,V as a,_ as s,n as r}from"./index.5c4cb14.js";import{m as d}from"./marked.esm.5c4cb14.js";var l=Object.defineProperty,c=Object.getOwnPropertyDescriptor,h=(e,t,i,n)=>{for(var o,a=n>1?void 0:n?c(t,i):t,s=e.length-1;s>=0;s--)(o=e[s])&&(a=(n?o(t,i,a):o(a))||a);return n&&a&&l(t,i,a),a};let u=class extends a{constructor(){super(...arguments),t(this,"value"),t(this,"editorInstance"),t(this,"minimal"),t(this,"autofocus"),t(this,"isLoaded",!1),t(this,"isLoading",!1)}get preview(){return d(this.value)}onValueChange(e){e!==this.editorInstance.getValue()&&this.editorInstance.setValue(e)}onShowPreviewChange(){this.resize()}async mounted(){await this.loadMonaco()}beforeDestroy(){this.editorInstance.dispose()}async loadMonaco(){this.isLoading=!0;try{const{default:e}=await s(()=>import("./editor.5c4cb142.js").then(e=>e.a),["editor.5c4cb142.js","index.5c4cb14.js","index.5c4cb14.css","options.5c4cb14.js","editor.5c4cb142.css"]);this.isLoaded=!0,await this.$nextTick(),this.createEditor(e),await this.$nextTick()}catch(e){}finally{this.isLoading=!1}}async resize(){this.editorInstance.layout({width:0,height:0}),await this.$nextTick(),this.editorInstance.layout()}getDefaultOptions(){return{padding:{top:8,bottom:8},value:this.value,tabSize:2,insertSpaces:!0,fontSize:12,lineNumbers:"off",overviewRulerLanes:0,overviewRulerBorder:!1,contextmenu:!1,theme:"aggr",minimap:{enabled:!1},glyphMargin:!1,folding:!1,lineNumbersMinChars:3,renderLineHighlight:"none",renderIndentGuides:!1,renderLineHighlightOnlyWhenFocus:!0,renderValidationDecorations:"off",renderWhitespace:"none",rulers:[],language:"markdown",scrollBeyondLastLine:!1,automaticLayout:!1,scrollbar:{vertical:"hidden",horizontal:"auto"}}}async createEditor(e){this.editorInstance=e.create(this.$refs.editor,this.getDefaultOptions());const t=this.$refs.editor;let i=0;if(this.editorInstance.onDidContentSizeChange(()=>{const e=this.editorInstance.getContentHeight();e!==i&&(i=e,t.style.height=`${e}px`,this.editorInstance.layout())}),this.editorInstance.onDidChangeModelContent(()=>{this.$emit("input",this.editorInstance.getValue())}),this.autofocus){await this.$nextTick(),this.editorInstance.focus();const e=this.editorInstance.getModel(),t=e.getLineCount(),i=e.getLineMaxColumn(t);this.editorInstance.setPosition({lineNumber:t,column:i})}window.instance=this.editorInstance,await this.$nextTick(),this.editorInstance.layout()}};h([i("value")],u.prototype,"onValueChange",1),h([i("showPreview")],u.prototype,"onShowPreviewChange",1),u=h([n({name:"MarkdownEditor",components:{Loader:o},props:{value:{type:String,default:""},minimal:{type:Boolean,default:!1},autofocus:{type:Boolean,default:!1},showPreview:{type:Boolean,default:!1}}})],u);const m=r(u,function(){var e=this,t=e._self._c;return e._self._setupProxy,t("div",{staticClass:"markdown-editor form-control"},[e.isLoading?t("Loader",{staticClass:"markdown-editor__loader",attrs:{small:""}}):e._e(),e.isLoaded?[t("div",{ref:"editor",staticClass:"markdown-editor__monaco"}),e.showPreview?[e._m(0),t("div",{staticClass:"markdown-editor__preview",domProps:{innerHTML:e._s(e.preview)}})]:e._e()]:e._e()],2)},[function(){var e=this,t=e._self._c;return e._self._setupProxy,t("div",{staticClass:"markdown-editor__divider"},[t("span",{staticClass:"markdown-editor__divider-badge badge ml4"},[e._v(" preview ")])])}],!1,null,"faf8b437",null,null).exports;export{m as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.