"use strict"; var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); Object.defineProperty(exports, "__esModule", { value: true }); exports.useIfMounted = exports.toMountPoint = exports.MountPointPortal = void 0; var _react = _interopRequireDefault(require("react")); var _rxjs = require("rxjs"); var _i18nReact = require("@kbn/i18n-react"); var _reactKibanaContextCommon = require("@kbn/react-kibana-context-common"); var _reactKibanaMount = require("@kbn/react-kibana-mount"); /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License * 2.0 and the Server Side Public License, v 1; you may not use this file except * in compliance with, at your election, the Elastic License 2.0 or the Server * Side Public License, v 1. */ // The `theme` start contract should always be included to ensure // dark mode is applied correctly. This code is for compatibility purposes, // and will be removed when the deprecated usages are removed. const themeStart = { theme$: new _rxjs.Observable(subscriber => subscriber.next(_reactKibanaContextCommon.defaultTheme)) }; // The `i18n` start contract should always be included to ensure // i18n strings are correct. This code is for compatibility purposes, and // will be removed when the deprecated usages are removed. const i18n = { Context: ({ children }) => /*#__PURE__*/_react.default.createElement(_i18nReact.I18nProvider, null, children) }; /** * @deprecated use `ToMountPointParams` from `@kbn/react-kibana-mount` */ /** * @deprecated use `toMountPoint` from `@kbn/react-kibana-mount` */ const toMountPoint = (node, { theme$ } = {}) => { const theme = theme$ ? { theme$ } : themeStart; return (0, _reactKibanaMount.toMountPoint)(node, { theme, i18n }); }; /** * @deprecated use `MountPointPortal` from `@kbn/react-kibana-mount` */ exports.toMountPoint = toMountPoint; const MountPointPortal = _reactKibanaMount.MountPointPortal; /** * @deprecated use `useIfMounted` from `@kbn/react-kibana-mount` */ exports.MountPointPortal = MountPointPortal; const useIfMounted = _reactKibanaMount.useIfMounted; exports.useIfMounted = useIfMounted;