"use strict";
/*
 * 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_tooltip-extension_lib_index_js"],{

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

eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _jupyterlab_console__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @jupyterlab/console */ \"webpack/sharing/consume/default/@jupyterlab/console/@jupyterlab/console\");\n/* harmony import */ var _jupyterlab_console__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_console__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _jupyterlab_coreutils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @jupyterlab/coreutils */ \"webpack/sharing/consume/default/@jupyterlab/coreutils/@jupyterlab/coreutils\");\n/* harmony import */ var _jupyterlab_coreutils__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_coreutils__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _jupyterlab_fileeditor__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @jupyterlab/fileeditor */ \"webpack/sharing/consume/default/@jupyterlab/fileeditor/@jupyterlab/fileeditor\");\n/* harmony import */ var _jupyterlab_fileeditor__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_fileeditor__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _jupyterlab_notebook__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @jupyterlab/notebook */ \"webpack/sharing/consume/default/@jupyterlab/notebook/@jupyterlab/notebook\");\n/* harmony import */ var _jupyterlab_notebook__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_notebook__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var _jupyterlab_rendermime__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @jupyterlab/rendermime */ \"webpack/sharing/consume/default/@jupyterlab/rendermime/@jupyterlab/rendermime\");\n/* harmony import */ var _jupyterlab_rendermime__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_rendermime__WEBPACK_IMPORTED_MODULE_4__);\n/* harmony import */ var _jupyterlab_tooltip__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @jupyterlab/tooltip */ \"webpack/sharing/consume/default/@jupyterlab/tooltip/@jupyterlab/tooltip\");\n/* harmony import */ var _jupyterlab_tooltip__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_tooltip__WEBPACK_IMPORTED_MODULE_5__);\n/* harmony import */ var _jupyterlab_translation__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @jupyterlab/translation */ \"webpack/sharing/consume/default/@jupyterlab/translation/@jupyterlab/translation\");\n/* harmony import */ var _jupyterlab_translation__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_translation__WEBPACK_IMPORTED_MODULE_6__);\n/* harmony import */ var _lumino_algorithm__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @lumino/algorithm */ \"webpack/sharing/consume/default/@lumino/algorithm/@lumino/algorithm\");\n/* harmony import */ var _lumino_algorithm__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_lumino_algorithm__WEBPACK_IMPORTED_MODULE_7__);\n/* harmony import */ var _lumino_widgets__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @lumino/widgets */ \"webpack/sharing/consume/default/@lumino/widgets/@lumino/widgets\");\n/* harmony import */ var _lumino_widgets__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_lumino_widgets__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 tooltip-extension\n */\n\n\n\n\n\n\n\n\n\n/**\n * The command IDs used by the tooltip plugin.\n */\nvar CommandIDs;\n(function (CommandIDs) {\n    CommandIDs.dismiss = 'tooltip:dismiss';\n    CommandIDs.launchConsole = 'tooltip:launch-console';\n    CommandIDs.launchNotebook = 'tooltip:launch-notebook';\n    CommandIDs.launchFile = 'tooltip:launch-file';\n})(CommandIDs || (CommandIDs = {}));\n/**\n * The main tooltip manager plugin.\n */\nconst manager = {\n    id: '@jupyterlab/tooltip-extension:manager',\n    description: 'Provides the tooltip manager.',\n    autoStart: true,\n    optional: [_jupyterlab_translation__WEBPACK_IMPORTED_MODULE_6__.ITranslator],\n    provides: _jupyterlab_tooltip__WEBPACK_IMPORTED_MODULE_5__.ITooltipManager,\n    activate: (app, translator) => {\n        const trans = (translator !== null && translator !== void 0 ? translator : _jupyterlab_translation__WEBPACK_IMPORTED_MODULE_6__.nullTranslator).load('jupyterlab');\n        let tooltip = null;\n        // Add tooltip dismiss command.\n        app.commands.addCommand(CommandIDs.dismiss, {\n            label: trans.__('Dismiss the tooltip'),\n            execute: () => {\n                if (tooltip) {\n                    tooltip.dispose();\n                    tooltip = null;\n                }\n            }\n        });\n        return {\n            invoke(options) {\n                const detail = 0;\n                const { anchor, editor, kernel, rendermime } = options;\n                if (tooltip) {\n                    tooltip.dispose();\n                    tooltip = null;\n                }\n                return Private.fetch({ detail, editor, kernel })\n                    .then(bundle => {\n                    tooltip = new _jupyterlab_tooltip__WEBPACK_IMPORTED_MODULE_5__.Tooltip({ anchor, bundle, editor, rendermime });\n                    _lumino_widgets__WEBPACK_IMPORTED_MODULE_8__.Widget.attach(tooltip, document.body);\n                })\n                    .catch(() => {\n                    /* Fails silently. */\n                });\n            }\n        };\n    }\n};\n/**\n * The console tooltip plugin.\n */\nconst consoles = {\n    // FIXME This should be in @jupyterlab/console-extension\n    id: '@jupyterlab/tooltip-extension:consoles',\n    description: 'Adds the tooltip capability to consoles.',\n    autoStart: true,\n    optional: [_jupyterlab_translation__WEBPACK_IMPORTED_MODULE_6__.ITranslator],\n    requires: [_jupyterlab_tooltip__WEBPACK_IMPORTED_MODULE_5__.ITooltipManager, _jupyterlab_console__WEBPACK_IMPORTED_MODULE_0__.IConsoleTracker],\n    activate: (app, manager, consoles, translator) => {\n        const trans = (translator !== null && translator !== void 0 ? translator : _jupyterlab_translation__WEBPACK_IMPORTED_MODULE_6__.nullTranslator).load('jupyterlab');\n        // Add tooltip launch command.\n        app.commands.addCommand(CommandIDs.launchConsole, {\n            label: trans.__('Open the tooltip'),\n            execute: () => {\n                var _a, _b;\n                const parent = consoles.currentWidget;\n                if (!parent) {\n                    return;\n                }\n                const anchor = parent.console;\n                const editor = (_a = anchor.promptCell) === null || _a === void 0 ? void 0 : _a.editor;\n                const kernel = (_b = anchor.sessionContext.session) === null || _b === void 0 ? void 0 : _b.kernel;\n                const rendermime = anchor.rendermime;\n                // If all components necessary for rendering exist, create a tooltip.\n                if (!!editor && !!kernel && !!rendermime) {\n                    return manager.invoke({ anchor, editor, kernel, rendermime });\n                }\n            }\n        });\n    }\n};\n/**\n * The notebook tooltip plugin.\n */\nconst notebooks = {\n    // FIXME This should be in @jupyterlab/notebook-extension\n    id: '@jupyterlab/tooltip-extension:notebooks',\n    description: 'Adds the tooltip capability to notebooks.',\n    autoStart: true,\n    optional: [_jupyterlab_translation__WEBPACK_IMPORTED_MODULE_6__.ITranslator],\n    requires: [_jupyterlab_tooltip__WEBPACK_IMPORTED_MODULE_5__.ITooltipManager, _jupyterlab_notebook__WEBPACK_IMPORTED_MODULE_3__.INotebookTracker],\n    activate: (app, manager, notebooks, translator) => {\n        const trans = (translator !== null && translator !== void 0 ? translator : _jupyterlab_translation__WEBPACK_IMPORTED_MODULE_6__.nullTranslator).load('jupyterlab');\n        // Add tooltip launch command.\n        app.commands.addCommand(CommandIDs.launchNotebook, {\n            label: trans.__('Open the tooltip'),\n            execute: () => {\n                var _a, _b;\n                const parent = notebooks.currentWidget;\n                if (!parent) {\n                    return;\n                }\n                const anchor = parent.content;\n                const editor = (_a = anchor.activeCell) === null || _a === void 0 ? void 0 : _a.editor;\n                const kernel = (_b = parent.sessionContext.session) === null || _b === void 0 ? void 0 : _b.kernel;\n                const rendermime = anchor.rendermime;\n                // If all components necessary for rendering exist, create a tooltip.\n                if (!!editor && !!kernel && !!rendermime) {\n                    return manager.invoke({ anchor, editor, kernel, rendermime });\n                }\n            }\n        });\n    }\n};\n/**\n * The file editor tooltip plugin.\n */\nconst files = {\n    // FIXME This should be in @jupyterlab/fileeditor-extension\n    id: '@jupyterlab/tooltip-extension:files',\n    description: 'Adds the tooltip capability to file editors.',\n    autoStart: true,\n    optional: [_jupyterlab_translation__WEBPACK_IMPORTED_MODULE_6__.ITranslator],\n    requires: [_jupyterlab_tooltip__WEBPACK_IMPORTED_MODULE_5__.ITooltipManager, _jupyterlab_fileeditor__WEBPACK_IMPORTED_MODULE_2__.IEditorTracker, _jupyterlab_rendermime__WEBPACK_IMPORTED_MODULE_4__.IRenderMimeRegistry],\n    activate: (app, manager, editorTracker, rendermime, translator) => {\n        const trans = (translator !== null && translator !== void 0 ? translator : _jupyterlab_translation__WEBPACK_IMPORTED_MODULE_6__.nullTranslator).load('jupyterlab');\n        // Keep a list of active ISessions so that we can\n        // clean them up when they are no longer needed.\n        const activeSessions = {};\n        const sessions = app.serviceManager.sessions;\n        // When the list of running sessions changes,\n        // check to see if there are any kernels with a\n        // matching path for the file editors.\n        const onRunningChanged = (sender, models) => {\n            editorTracker.forEach(file => {\n                const model = (0,_lumino_algorithm__WEBPACK_IMPORTED_MODULE_7__.find)(models, m => file.context.path === m.path);\n                if (model) {\n                    const oldSession = activeSessions[file.id];\n                    // If there is a matching path, but it is the same\n                    // session as we previously had, do nothing.\n                    if (oldSession && oldSession.id === model.id) {\n                        return;\n                    }\n                    // Otherwise, dispose of the old session and reset to\n                    // a new CompletionConnector.\n                    if (oldSession) {\n                        delete activeSessions[file.id];\n                        oldSession.dispose();\n                    }\n                    const session = sessions.connectTo({ model });\n                    activeSessions[file.id] = session;\n                }\n                else {\n                    const session = activeSessions[file.id];\n                    if (session) {\n                        session.dispose();\n                        delete activeSessions[file.id];\n                    }\n                }\n            });\n        };\n        onRunningChanged(sessions, sessions.running());\n        sessions.runningChanged.connect(onRunningChanged);\n        // Clean up after a widget when it is disposed\n        editorTracker.widgetAdded.connect((sender, widget) => {\n            widget.disposed.connect(w => {\n                const session = activeSessions[w.id];\n                if (session) {\n                    session.dispose();\n                    delete activeSessions[w.id];\n                }\n            });\n        });\n        // Add tooltip launch command.\n        app.commands.addCommand(CommandIDs.launchFile, {\n            label: trans.__('Open the tooltip'),\n            execute: async () => {\n                const parent = editorTracker.currentWidget;\n                const kernel = parent &&\n                    activeSessions[parent.id] &&\n                    activeSessions[parent.id].kernel;\n                if (!kernel) {\n                    return;\n                }\n                const anchor = parent.content;\n                const editor = anchor === null || anchor === void 0 ? void 0 : anchor.editor;\n                // If all components necessary for rendering exist, create a tooltip.\n                if (!!editor && !!kernel && !!rendermime) {\n                    return manager.invoke({ anchor, editor, kernel, rendermime });\n                }\n            }\n        });\n    }\n};\n/**\n * Export the plugins as default.\n */\nconst plugins = [\n    manager,\n    consoles,\n    notebooks,\n    files\n];\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (plugins);\n/**\n * A namespace for private data.\n */\nvar Private;\n(function (Private) {\n    /**\n     * A counter for outstanding requests.\n     */\n    let pending = 0;\n    /**\n     * Fetch a tooltip's content from the API server.\n     */\n    function fetch(options) {\n        const { detail, editor, kernel } = options;\n        const code = editor.model.sharedModel.getSource();\n        const position = editor.getCursorPosition();\n        const offset = _jupyterlab_coreutils__WEBPACK_IMPORTED_MODULE_1__.Text.jsIndexToCharIndex(editor.getOffsetAt(position), code);\n        // Clear hints if the new text value is empty or kernel is unavailable.\n        if (!code || !kernel) {\n            return Promise.reject(void 0);\n        }\n        const contents = {\n            code,\n            cursor_pos: offset,\n            detail_level: detail || 0\n        };\n        const current = ++pending;\n        return kernel.requestInspect(contents).then(msg => {\n            const value = msg.content;\n            // If a newer request is pending, bail.\n            if (current !== pending) {\n                return Promise.reject(void 0);\n            }\n            // If request fails or returns negative results, bail.\n            if (value.status !== 'ok' || !value.found) {\n                return Promise.reject(void 0);\n            }\n            return Promise.resolve(value.data);\n        });\n    }\n    Private.fetch = fetch;\n})(Private || (Private = {}));\n//# sourceMappingURL=index.js.map\n\n//# sourceURL=webpack://_JUPYTERLAB.CORE_OUTPUT/../node_modules/@jupyterlab/tooltip-extension/lib/index.js?");

/***/ })

}]);