define("ace/ext/spellcheck",["require","exports","module","ace/lib/event","ace/editor","ace/config"],function(e,t,n){"use strict";var c=e("../lib/event");t.contextMenuHandler=function(e){var n,o,s,i=e.target,l=i.textInput.getElement();i.selection.isEmpty()&&(e=i.getCursorPosition(),n=i.session.getWordRange(e.row,e.column),e=i.session.getTextRange(n),i.session.tokenRe.lastIndex=0,i.session.tokenRe.test(e)&&(l.value=o=e+" ",l.setSelectionRange(e.length,e.length+1),l.setSelectionRange(0,0),l.setSelectionRange(0,e.length),s=!1,c.addListener(l,"keydown",function e(){c.removeListener(l,"keydown",e),s=!0}),i.textInput.setInputHandler(function(e){if(console.log(e,o,l.selectionStart,l.selectionEnd),e==o)return"";if(0===e.lastIndexOf(o,0))return e.slice(o.length);if(e.substr(l.selectionEnd)==o)return e.slice(0,-o.length);if(""==e.slice(-2)){var t=e.slice(0,-2);if(" "==t.slice(-1))return s?t.substring(0,l.selectionEnd):(t=t.slice(0,-1),i.session.replace(n,t),"")}return e})))};var o=e("../editor").Editor;e("../config").defineOptions(o.prototype,"editor",{spellcheck:{set:function(e){this.textInput.getElement().spellcheck=!!e,e?this.on("nativecontextmenu",t.contextMenuHandler):this.removeListener("nativecontextmenu",t.contextMenuHandler)},value:!0}})}),window.require(["ace/ext/spellcheck"],function(e){"object"==typeof module&&"object"==typeof exports&&module&&(module.exports=e)});