"use strict";
/*---------------------------------------------------------------------------------------------
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
* See LICENSE.md in the project root for license terms and full copyright notice.
*--------------------------------------------------------------------------------------------*/
/** @packageDocumentation
 * @module State
 */
Object.defineProperty(exports, "__esModule", { value: true });
exports.withSafeArea = exports.SafeAreaContext = void 0;
const React = require("react");
const appui_layout_react_1 = require("@itwin/appui-layout-react");
/**
 * Context used to manage safe area (feature used by devices with non-rectangular screens).
 * @public
 */
// eslint-disable-next-line @typescript-eslint/naming-convention
exports.SafeAreaContext = React.createContext(appui_layout_react_1.SafeAreaInsets.None); // eslint-disable-line deprecation/deprecation
/** HOC that injects SafeAreaInsets.
 * @deprecated in 3.6. Use [[SafeAreaContext]] instead.
 * @public
 */
const withSafeArea = (
// eslint-disable-next-line @typescript-eslint/naming-convention
Component) => {
    return class WithSafeArea extends React.PureComponent {
        render() {
            const { ...props } = this.props;
            return (React.createElement(exports.SafeAreaContext.Consumer, null, (safeAreaInsets) => (React.createElement(Component, { ...props, safeAreaInsets: safeAreaInsets }))));
        }
    };
};
exports.withSafeArea = withSafeArea;
//# sourceMappingURL=SafeAreaContext.js.map