"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([["node_modules_jupyterlab_hub-extension_lib_index_js-_9dda1"],{

/***/ "../node_modules/@jupyterlab/hub-extension/lib/index.js":
/*!**************************************************************!*\
  !*** ../node_modules/@jupyterlab/hub-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 */   CommandIDs: () => (/* binding */ CommandIDs),\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_apputils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @jupyterlab/apputils */ \"webpack/sharing/consume/default/@jupyterlab/apputils/@jupyterlab/apputils\");\n/* harmony import */ var _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _jupyterlab_coreutils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @jupyterlab/coreutils */ \"webpack/sharing/consume/default/@jupyterlab/coreutils/@jupyterlab/coreutils\");\n/* harmony import */ var _jupyterlab_coreutils__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_coreutils__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _jupyterlab_translation__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @jupyterlab/translation */ \"webpack/sharing/consume/default/@jupyterlab/translation/@jupyterlab/translation\");\n/* harmony import */ var _jupyterlab_translation__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_translation__WEBPACK_IMPORTED_MODULE_3__);\n/* -----------------------------------------------------------------------------\n| Copyright (c) Jupyter Development Team.\n| Distributed under the terms of the Modified BSD License.\n|----------------------------------------------------------------------------*/\n/**\n * @packageDocumentation\n * @module hub-extension\n */\n\n\n\n\n/**\n * The command IDs used by the plugin.\n */\nvar CommandIDs;\n(function (CommandIDs) {\n    CommandIDs.controlPanel = 'hub:control-panel';\n    CommandIDs.logout = 'hub:logout';\n    CommandIDs.restart = 'hub:restart';\n})(CommandIDs || (CommandIDs = {}));\n/**\n * Activate the jupyterhub extension.\n */\nfunction activateHubExtension(app, paths, translator, palette) {\n    const trans = translator.load('jupyterlab');\n    const hubHost = paths.urls.hubHost || '';\n    const hubPrefix = paths.urls.hubPrefix || '';\n    const hubUser = paths.urls.hubUser || '';\n    const hubServerName = paths.urls.hubServerName || '';\n    const baseUrl = paths.urls.base;\n    // Bail if not running on JupyterHub.\n    if (!hubPrefix) {\n        return;\n    }\n    console.debug('hub-extension: Found configuration ', {\n        hubHost: hubHost,\n        hubPrefix: hubPrefix\n    });\n    // If hubServerName is set, use JupyterHub 1.0 URL.\n    const spawnBase = _jupyterlab_coreutils__WEBPACK_IMPORTED_MODULE_2__.URLExt.join(hubPrefix, 'spawn');\n    let restartUrl;\n    if (hubServerName) {\n        const suffix = _jupyterlab_coreutils__WEBPACK_IMPORTED_MODULE_2__.URLExt.join(spawnBase, hubUser, hubServerName);\n        if (!suffix.startsWith(spawnBase)) {\n            throw new Error('Can only be used for spawn requests');\n        }\n        restartUrl = hubHost + suffix;\n    }\n    restartUrl = hubHost + spawnBase;\n    const { commands } = app;\n    commands.addCommand(CommandIDs.restart, {\n        label: trans.__('Restart Server'),\n        caption: trans.__('Request that the Hub restart this server'),\n        execute: () => {\n            window.open(restartUrl, '_blank');\n        }\n    });\n    commands.addCommand(CommandIDs.controlPanel, {\n        label: trans.__('Hub Control Panel'),\n        caption: trans.__('Open the Hub control panel in a new browser tab'),\n        execute: () => {\n            window.open(hubHost + _jupyterlab_coreutils__WEBPACK_IMPORTED_MODULE_2__.URLExt.join(hubPrefix, 'home'), '_blank');\n        }\n    });\n    commands.addCommand(CommandIDs.logout, {\n        label: trans.__('Log Out'),\n        caption: trans.__('Log out of the Hub'),\n        execute: () => {\n            window.location.href = hubHost + _jupyterlab_coreutils__WEBPACK_IMPORTED_MODULE_2__.URLExt.join(baseUrl, 'logout');\n        }\n    });\n    // Add palette items.\n    if (palette) {\n        const category = trans.__('Hub');\n        palette.addItem({ category, command: CommandIDs.controlPanel });\n        palette.addItem({ category, command: CommandIDs.logout });\n    }\n}\n/**\n * Initialization data for the hub-extension.\n */\nconst hubExtension = {\n    activate: activateHubExtension,\n    id: '@jupyterlab/hub-extension:plugin',\n    description: 'Registers commands related to the hub server',\n    requires: [_jupyterlab_application__WEBPACK_IMPORTED_MODULE_0__.JupyterFrontEnd.IPaths, _jupyterlab_translation__WEBPACK_IMPORTED_MODULE_3__.ITranslator],\n    optional: [_jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1__.ICommandPalette],\n    autoStart: true\n};\n/**\n * Plugin to load menu description based on settings file\n */\nconst hubExtensionMenu = {\n    activate: () => void 0,\n    id: '@jupyterlab/hub-extension:menu',\n    description: 'Adds hub related commands to the menu.',\n    autoStart: true\n};\n/**\n * The default JupyterLab connection lost provider. This may be overridden\n * to provide custom behavior when a connection to the server is lost.\n *\n * If the application is being deployed within a JupyterHub context,\n * this will provide a dialog that prompts the user to restart the server.\n * Otherwise, it shows an error dialog.\n */\nconst connectionlost = {\n    id: '@jupyterlab/hub-extension:connectionlost',\n    description: 'Provides a service to be notified when the connection to the hub server is lost.',\n    requires: [_jupyterlab_application__WEBPACK_IMPORTED_MODULE_0__.JupyterFrontEnd.IPaths, _jupyterlab_translation__WEBPACK_IMPORTED_MODULE_3__.ITranslator],\n    optional: [_jupyterlab_application__WEBPACK_IMPORTED_MODULE_0__.JupyterLab.IInfo],\n    activate: (app, paths, translator, info) => {\n        const trans = translator.load('jupyterlab');\n        const hubPrefix = paths.urls.hubPrefix || '';\n        const baseUrl = paths.urls.base;\n        // Return the default error message if not running on JupyterHub.\n        if (!hubPrefix) {\n            return _jupyterlab_application__WEBPACK_IMPORTED_MODULE_0__.ConnectionLost;\n        }\n        // If we are running on JupyterHub, return a dialog\n        // that prompts the user to restart their server.\n        let showingError = false;\n        const onConnectionLost = async (manager, err) => {\n            if (showingError) {\n                return;\n            }\n            showingError = true;\n            if (info) {\n                info.isConnected = false;\n            }\n            const result = await (0,_jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1__.showDialog)({\n                title: trans.__('Server unavailable or unreachable'),\n                body: trans.__('Your server at %1 is not running.\\nWould you like to restart it?', baseUrl),\n                buttons: [\n                    _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1__.Dialog.okButton({ label: trans.__('Restart') }),\n                    _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1__.Dialog.cancelButton({ label: trans.__('Dismiss') })\n                ]\n            });\n            if (info) {\n                info.isConnected = true;\n            }\n            showingError = false;\n            if (result.button.accept) {\n                await app.commands.execute(CommandIDs.restart);\n            }\n        };\n        return onConnectionLost;\n    },\n    autoStart: true,\n    provides: _jupyterlab_application__WEBPACK_IMPORTED_MODULE_0__.IConnectionLost\n};\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ([\n    hubExtension,\n    hubExtensionMenu,\n    connectionlost\n]);\n//# sourceMappingURL=index.js.map\n\n//# sourceURL=webpack://_JUPYTERLAB.CORE_OUTPUT/../node_modules/@jupyterlab/hub-extension/lib/index.js?");

/***/ })

}]);