/*
 * ATTENTION: The "eval" devtool has been used (maybe by default in mode: "development").
 * This devtool is neither made for production nor for readable output files.
 * It uses "eval()" calls to create a separate source file in the browser devtools.
 * If you are trying to read the output file, select a different devtool (https://webpack.js.org/configuration/devtool/)
 * or disable the default devtool with "devtool: false".
 * If you are looking for production-ready output files, see mode: "production" (https://webpack.js.org/configuration/mode/).
 */
(self["webpackChunk_JUPYTERLAB_CORE_OUTPUT"] = self["webpackChunk_JUPYTERLAB_CORE_OUTPUT"] || []).push([["vendors-node_modules_jupyterlab_codemirror-extension_lib_index_js"],{

/***/ "../node_modules/@jupyterlab/codemirror-extension/lib/index.js":
/*!*********************************************************************!*\
  !*** ../node_modules/@jupyterlab/codemirror-extension/lib/index.js ***!
  \*********************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   \"editorSyntaxStatus\": () => (/* binding */ editorSyntaxStatus),\n/* harmony export */   \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _jupyterlab_application__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @jupyterlab/application */ \"webpack/sharing/consume/default/@jupyterlab/application/@jupyterlab/application\");\n/* harmony import */ var _jupyterlab_application__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_application__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _jupyterlab_codeeditor__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @jupyterlab/codeeditor */ \"webpack/sharing/consume/default/@jupyterlab/codeeditor/@jupyterlab/codeeditor\");\n/* harmony import */ var _jupyterlab_codeeditor__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_codeeditor__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _jupyterlab_codemirror__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @jupyterlab/codemirror */ \"webpack/sharing/consume/default/@jupyterlab/codemirror/@jupyterlab/codemirror\");\n/* harmony import */ var _jupyterlab_codemirror__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_codemirror__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _jupyterlab_fileeditor__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @jupyterlab/fileeditor */ \"webpack/sharing/consume/default/@jupyterlab/fileeditor/@jupyterlab/fileeditor\");\n/* harmony import */ var _jupyterlab_fileeditor__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_fileeditor__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var _jupyterlab_mainmenu__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @jupyterlab/mainmenu */ \"webpack/sharing/consume/default/@jupyterlab/mainmenu/@jupyterlab/mainmenu\");\n/* harmony import */ var _jupyterlab_mainmenu__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_mainmenu__WEBPACK_IMPORTED_MODULE_4__);\n/* harmony import */ var _jupyterlab_settingregistry__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @jupyterlab/settingregistry */ \"webpack/sharing/consume/default/@jupyterlab/settingregistry/@jupyterlab/settingregistry\");\n/* harmony import */ var _jupyterlab_settingregistry__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_settingregistry__WEBPACK_IMPORTED_MODULE_5__);\n/* harmony import */ var _jupyterlab_statusbar__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @jupyterlab/statusbar */ \"webpack/sharing/consume/default/@jupyterlab/statusbar/@jupyterlab/statusbar\");\n/* harmony import */ var _jupyterlab_statusbar__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_statusbar__WEBPACK_IMPORTED_MODULE_6__);\n/* harmony import */ var _jupyterlab_translation__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @jupyterlab/translation */ \"webpack/sharing/consume/default/@jupyterlab/translation/@jupyterlab/translation\");\n/* harmony import */ var _jupyterlab_translation__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_translation__WEBPACK_IMPORTED_MODULE_7__);\n/* harmony import */ var codemirror__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! codemirror */ \"webpack/sharing/consume/default/codemirror/codemirror\");\n/* harmony import */ var codemirror__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(codemirror__WEBPACK_IMPORTED_MODULE_8__);\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/**\n * @packageDocumentation\n * @module codemirror-extension\n */\n\n\n\n\n\n\n\n\n\n/**\n * The command IDs used by the codemirror plugin.\n */\nvar CommandIDs;\n(function (CommandIDs) {\n    CommandIDs.changeKeyMap = 'codemirror:change-keymap';\n    CommandIDs.changeTheme = 'codemirror:change-theme';\n    CommandIDs.changeMode = 'codemirror:change-mode';\n    CommandIDs.find = 'codemirror:find';\n    CommandIDs.goToLine = 'codemirror:go-to-line';\n})(CommandIDs || (CommandIDs = {}));\n/** The CodeMirror singleton. */\nconst codemirrorSingleton = {\n    id: '@jupyterlab/codemirror-extension:codemirror',\n    provides: _jupyterlab_codemirror__WEBPACK_IMPORTED_MODULE_2__.ICodeMirror,\n    activate: activateCodeMirror\n};\n/**\n * The editor services.\n */\nconst services = {\n    id: '@jupyterlab/codemirror-extension:services',\n    provides: _jupyterlab_codeeditor__WEBPACK_IMPORTED_MODULE_1__.IEditorServices,\n    activate: activateEditorServices\n};\n/**\n * The editor commands.\n */\nconst commands = {\n    id: '@jupyterlab/codemirror-extension:commands',\n    requires: [_jupyterlab_fileeditor__WEBPACK_IMPORTED_MODULE_3__.IEditorTracker, _jupyterlab_settingregistry__WEBPACK_IMPORTED_MODULE_5__.ISettingRegistry, _jupyterlab_translation__WEBPACK_IMPORTED_MODULE_7__.ITranslator, _jupyterlab_codemirror__WEBPACK_IMPORTED_MODULE_2__.ICodeMirror],\n    optional: [_jupyterlab_mainmenu__WEBPACK_IMPORTED_MODULE_4__.IMainMenu],\n    activate: activateEditorCommands,\n    autoStart: true\n};\n/**\n * The JupyterLab plugin for the EditorSyntax status item.\n */\nconst editorSyntaxStatus = {\n    id: '@jupyterlab/codemirror-extension:editor-syntax-status',\n    autoStart: true,\n    requires: [_jupyterlab_fileeditor__WEBPACK_IMPORTED_MODULE_3__.IEditorTracker, _jupyterlab_application__WEBPACK_IMPORTED_MODULE_0__.ILabShell, _jupyterlab_translation__WEBPACK_IMPORTED_MODULE_7__.ITranslator],\n    optional: [_jupyterlab_statusbar__WEBPACK_IMPORTED_MODULE_6__.IStatusBar],\n    activate: (app, tracker, labShell, translator, statusBar) => {\n        if (!statusBar) {\n            // Automatically disable if statusbar missing\n            return;\n        }\n        const item = new _jupyterlab_codemirror__WEBPACK_IMPORTED_MODULE_2__.EditorSyntaxStatus({ commands: app.commands, translator });\n        labShell.currentChanged.connect(() => {\n            const current = labShell.currentWidget;\n            if (current && tracker.has(current) && item.model) {\n                item.model.editor = current.content.editor;\n            }\n        });\n        statusBar.registerStatusItem('@jupyterlab/codemirror-extension:editor-syntax-status', {\n            item,\n            align: 'left',\n            rank: 0,\n            isActive: () => !!labShell.currentWidget &&\n                !!tracker.currentWidget &&\n                labShell.currentWidget === tracker.currentWidget\n        });\n    }\n};\n/**\n * Export the plugins as default.\n */\nconst plugins = [\n    commands,\n    services,\n    editorSyntaxStatus,\n    codemirrorSingleton\n];\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (plugins);\n/**\n * The plugin ID used as the key in the setting registry.\n */\nconst id = commands.id;\n/**\n * Set up the editor services.\n */\nfunction activateEditorServices(app) {\n    (codemirror__WEBPACK_IMPORTED_MODULE_8___default().prototype.save) = () => {\n        void app.commands.execute('docmanager:save');\n    };\n    return _jupyterlab_codemirror__WEBPACK_IMPORTED_MODULE_2__.editorServices;\n}\n/**\n * Simplest implementation of the CodeMirror singleton provider.\n */\nclass CodeMirrorSingleton {\n    get CodeMirror() {\n        return (codemirror__WEBPACK_IMPORTED_MODULE_8___default());\n    }\n    async ensureVimKeymap() {\n        if (!('Vim' in (codemirror__WEBPACK_IMPORTED_MODULE_8___default()))) {\n            // @ts-expect-error\n            await Promise.all(/*! import() */[__webpack_require__.e(\"vendors-node_modules_codemirror_lib_codemirror_js\"), __webpack_require__.e(\"vendors-node_modules_codemirror_addon_dialog_dialog_js-node_modules_codemirror_addon_edit_mat-b0885c\"), __webpack_require__.e(\"vendors-node_modules_codemirror_keymap_vim_js\")]).then(__webpack_require__.t.bind(__webpack_require__, /*! codemirror/keymap/vim.js */ \"../node_modules/codemirror/keymap/vim.js\", 23));\n        }\n    }\n}\n/**\n * Set up the CodeMirror singleton.\n */\nfunction activateCodeMirror(app) {\n    return new CodeMirrorSingleton();\n}\n/**\n * Set up the editor widget menu and commands.\n */\nfunction activateEditorCommands(app, tracker, settingRegistry, translator, codeMirror, mainMenu) {\n    var _a;\n    const trans = translator.load('jupyterlab');\n    const { commands, restored } = app;\n    let { theme, keyMap, scrollPastEnd, styleActiveLine, styleSelectedText, selectionPointer, lineWiseCopyCut } = _jupyterlab_codemirror__WEBPACK_IMPORTED_MODULE_2__.CodeMirrorEditor.defaultConfig;\n    /**\n     * Update the setting values.\n     */\n    async function updateSettings(settings) {\n        var _a, _b, _c, _d, _e;\n        keyMap = settings.get('keyMap').composite || keyMap;\n        // Lazy loading of vim mode\n        if (keyMap === 'vim') {\n            await codeMirror.ensureVimKeymap();\n        }\n        theme = settings.get('theme').composite || theme;\n        // Lazy loading of theme stylesheets\n        if (theme !== 'jupyter' && theme !== 'default') {\n            const filename = theme === 'solarized light' || theme === 'solarized dark'\n                ? 'solarized'\n                : theme;\n            await __webpack_require__(\"../node_modules/codemirror/theme lazy recursive ^\\\\.\\\\/.*\\\\.css$\")(`./${filename}.css`);\n        }\n        scrollPastEnd = (_a = settings.get('scrollPastEnd').composite) !== null && _a !== void 0 ? _a : scrollPastEnd;\n        styleActiveLine = (_b = settings.get('styleActiveLine').composite) !== null && _b !== void 0 ? _b : styleActiveLine;\n        styleSelectedText = (_c = settings.get('styleSelectedText').composite) !== null && _c !== void 0 ? _c : styleSelectedText;\n        selectionPointer = (_d = settings.get('selectionPointer').composite) !== null && _d !== void 0 ? _d : selectionPointer;\n        lineWiseCopyCut = (_e = settings.get('lineWiseCopyCut').composite) !== null && _e !== void 0 ? _e : lineWiseCopyCut;\n    }\n    /**\n     * Update the settings of the current tracker instances.\n     */\n    function updateTracker() {\n        const editorOptions = {\n            keyMap,\n            theme,\n            scrollPastEnd,\n            styleActiveLine,\n            styleSelectedText,\n            selectionPointer,\n            lineWiseCopyCut\n        };\n        tracker.forEach(widget => {\n            if (widget.content.editor instanceof _jupyterlab_codemirror__WEBPACK_IMPORTED_MODULE_2__.CodeMirrorEditor) {\n                widget.content.editor.setOptions(editorOptions);\n            }\n        });\n    }\n    // Fetch the initial state of the settings.\n    Promise.all([settingRegistry.load(id), restored])\n        .then(async ([settings]) => {\n        await updateSettings(settings);\n        updateTracker();\n        settings.changed.connect(async () => {\n            await updateSettings(settings);\n            updateTracker();\n        });\n    })\n        .catch((reason) => {\n        console.error(reason.message);\n        updateTracker();\n    });\n    /**\n     * Handle the settings of new widgets.\n     */\n    tracker.widgetAdded.connect((sender, widget) => {\n        const editorOptions = {\n            keyMap,\n            theme,\n            scrollPastEnd,\n            styleActiveLine,\n            styleSelectedText,\n            selectionPointer,\n            lineWiseCopyCut\n        };\n        if (widget.content.editor instanceof _jupyterlab_codemirror__WEBPACK_IMPORTED_MODULE_2__.CodeMirrorEditor) {\n            widget.content.editor.setOptions(editorOptions);\n        }\n    });\n    /**\n     * A test for whether the tracker has an active widget.\n     */\n    function isEnabled() {\n        return (tracker.currentWidget !== null &&\n            tracker.currentWidget === app.shell.currentWidget);\n    }\n    /**\n     * Create a menu for the editor.\n     */\n    commands.addCommand(CommandIDs.changeTheme, {\n        label: args => {\n            var _a;\n            return args.theme === 'default'\n                ? trans.__('codemirror')\n                : trans.__((_a = args.theme) !== null && _a !== void 0 ? _a : theme);\n        },\n        execute: args => {\n            var _a;\n            const key = 'theme';\n            const value = (theme = (_a = args['theme']) !== null && _a !== void 0 ? _a : theme);\n            return settingRegistry.set(id, key, value).catch((reason) => {\n                console.error(`Failed to set ${id}:${key} - ${reason.message}`);\n            });\n        },\n        isToggled: args => args['theme'] === theme\n    });\n    commands.addCommand(CommandIDs.changeKeyMap, {\n        label: args => {\n            var _a;\n            const theKeyMap = (_a = args['keyMap']) !== null && _a !== void 0 ? _a : keyMap;\n            return theKeyMap === 'sublime'\n                ? trans.__('Sublime Text')\n                : trans.__(theKeyMap);\n        },\n        execute: args => {\n            var _a;\n            const key = 'keyMap';\n            const value = (keyMap = (_a = args['keyMap']) !== null && _a !== void 0 ? _a : keyMap);\n            return settingRegistry.set(id, key, value).catch((reason) => {\n                console.error(`Failed to set ${id}:${key} - ${reason.message}`);\n            });\n        },\n        isToggled: args => args['keyMap'] === keyMap\n    });\n    commands.addCommand(CommandIDs.find, {\n        label: trans.__('Find…'),\n        execute: () => {\n            const widget = tracker.currentWidget;\n            if (!widget) {\n                return;\n            }\n            const editor = widget.content.editor;\n            editor.execCommand('find');\n        },\n        isEnabled\n    });\n    commands.addCommand(CommandIDs.goToLine, {\n        label: trans.__('Go to Line…'),\n        execute: () => {\n            const widget = tracker.currentWidget;\n            if (!widget) {\n                return;\n            }\n            const editor = widget.content.editor;\n            editor.execCommand('jumpToLine');\n        },\n        isEnabled\n    });\n    commands.addCommand(CommandIDs.changeMode, {\n        label: args => args['name'],\n        execute: args => {\n            const name = args['name'];\n            const widget = tracker.currentWidget;\n            if (name && widget) {\n                const spec = _jupyterlab_codemirror__WEBPACK_IMPORTED_MODULE_2__.Mode.findByName(name);\n                if (spec) {\n                    widget.content.model.mimeType = spec.mime;\n                }\n            }\n        },\n        isEnabled,\n        isToggled: args => {\n            const widget = tracker.currentWidget;\n            if (!widget) {\n                return false;\n            }\n            const mime = widget.content.model.mimeType;\n            const spec = _jupyterlab_codemirror__WEBPACK_IMPORTED_MODULE_2__.Mode.findByMIME(mime);\n            const name = spec && spec.name;\n            return args['name'] === name;\n        }\n    });\n    if (mainMenu) {\n        const modeMenu = (_a = mainMenu.viewMenu.items.find(item => {\n            var _a;\n            return item.type === 'submenu' &&\n                ((_a = item.submenu) === null || _a === void 0 ? void 0 : _a.id) === 'jp-mainmenu-view-codemirror-theme';\n        })) === null || _a === void 0 ? void 0 : _a.submenu;\n        if (modeMenu) {\n            _jupyterlab_codemirror__WEBPACK_IMPORTED_MODULE_2__.Mode.getModeInfo()\n                .sort((a, b) => {\n                const aName = a.name || '';\n                const bName = b.name || '';\n                return aName.localeCompare(bName);\n            })\n                .forEach(spec => {\n                // Avoid mode name with a curse word.\n                if (spec.mode.indexOf('brainf') === 0) {\n                    return;\n                }\n                modeMenu.addItem({\n                    command: CommandIDs.changeMode,\n                    args: Object.assign({}, spec) // TODO: Casting to `any` until lumino typings are fixed\n                });\n            });\n        }\n        // Add go to line capabilities to the edit menu.\n        mainMenu.editMenu.goToLiners.add({\n            tracker,\n            goToLine: (widget) => {\n                const editor = widget.content.editor;\n                editor.execCommand('jumpToLine');\n            }\n        });\n    }\n}\n//# sourceMappingURL=index.js.map\n\n//# sourceURL=webpack://_JUPYTERLAB.CORE_OUTPUT/../node_modules/@jupyterlab/codemirror-extension/lib/index.js?");

/***/ })

}]);