define(function(require,exports,module){const Commands=require("command/Commands"),EventDispatcher=require("utils/EventDispatcher"),WorkspaceManager=require("view/WorkspaceManager"),PreferencesManager=require("preferences/PreferencesManager"),CommandManager=require("command/CommandManager"),DocumentManager=require("document/DocumentManager"),MainViewManager=require("view/MainViewManager"),ViewStateManager=require("view/ViewStateManager"),PerfUtils=require("utils/PerfUtils"),Editor=require("editor/Editor").Editor,InlineTextEditor=require("editor/InlineTextEditor").InlineTextEditor,MultiRangeInlineEditor=require("editor/MultiRangeInlineEditor").MultiRangeInlineEditor,Strings=require("strings"),LanguageManager=require("language/LanguageManager"),DeprecationWarning=require("utils/DeprecationWarning"),EVENT_ACTIVE_EDITOR_CHANGED="activeEditorChange";var _lastFocusedEditor=null,_inlineEditProviders=[],_inlineDocsProviders=[],_$hiddenEditorsContainer;function getCurrentFullEditor(){var currentPath=MainViewManager.getCurrentlyViewedPath(MainViewManager.ACTIVE_PANE),doc=currentPath&&DocumentManager.getOpenDocumentForPath(currentPath);return doc&&doc._masterEditor}function _saveEditorViewState(editor){ViewStateManager.updateViewState(editor)}function _restoreEditorViewState(editor){var viewState=ViewStateManager.getViewState(editor.document.file);viewState&&editor.restoreViewState(viewState)}function _notifyActiveEditorChanged(current){if(_lastFocusedEditor!==current){var previous=_lastFocusedEditor;_lastFocusedEditor=current,exports.trigger(EVENT_ACTIVE_EDITOR_CHANGED,current,previous)}}function _handleCurrentFileChange(e,file){var doc=file&&DocumentManager.getOpenDocumentForPath(file.fullPath);_notifyActiveEditorChanged(doc&&doc._masterEditor)}function _createEditorForDocument(doc,makeMasterEditor,container,range,editorOptions){var editor=new Editor(doc,makeMasterEditor,container,range,editorOptions);return editor.on("focus",function(){_notifyActiveEditorChanged(editor)}),editor.on("beforeDestroy",function(){editor.$el.is(":visible")&&_saveEditorViewState(editor)}),editor}function _openInlineWidget(editor,providers,defaultErrorMsg){PerfUtils.markStart(PerfUtils.INLINE_WIDGET_OPEN);var pos=editor.getCursorPos(),inlinePromise,i,result=new $.Deferred,errorMsg,providerRet;for(i=0;i=offset.left&&mousePos.clientX<=offset.left+$div.width()&&mousePos.clientY>=offset.top&&mousePos.clientY<=offset.top+$div.height()}let fullEditor=getCurrentFullEditor();if(!fullEditor||!mousePos)return;let inlines=fullEditor.getInlineWidgets(),i,editor;for(i=0;i