/**
 * WordPress dependencies
 */
import { privateApis as routerPrivateApis } from '@wordpress/router';

/**
 * Internal dependencies
 */
import Editor from '../editor';
import SidebarNavigationScreenNavigationMenus from '../sidebar-navigation-screen-navigation-menus';
import SidebarNavigationScreenUnsupported from '../sidebar-navigation-screen-unsupported';
import { unlock } from '../../lock-unlock';
import { jsx as _jsx } from "react/jsx-runtime";
const {
  useLocation
} = unlock(routerPrivateApis);
function MobileNavigationView() {
  const {
    query = {}
  } = useLocation();
  const {
    canvas = 'view'
  } = query;
  return canvas === 'edit' ? /*#__PURE__*/_jsx(Editor, {}) : /*#__PURE__*/_jsx(SidebarNavigationScreenNavigationMenus, {
    backPath: "/"
  });
}
export const navigationRoute = {
  name: 'navigation',
  path: '/navigation',
  areas: {
    sidebar({
      siteData
    }) {
      const isBlockTheme = siteData.currentTheme?.is_block_theme;
      return isBlockTheme ? /*#__PURE__*/_jsx(SidebarNavigationScreenNavigationMenus, {
        backPath: "/"
      }) : /*#__PURE__*/_jsx(SidebarNavigationScreenUnsupported, {});
    },
    preview({
      siteData
    }) {
      const isBlockTheme = siteData.currentTheme?.is_block_theme;
      return isBlockTheme ? /*#__PURE__*/_jsx(Editor, {}) : undefined;
    },
    mobile({
      siteData
    }) {
      const isBlockTheme = siteData.currentTheme?.is_block_theme;
      return isBlockTheme ? /*#__PURE__*/_jsx(MobileNavigationView, {}) : /*#__PURE__*/_jsx(SidebarNavigationScreenUnsupported, {});
    }
  }
};
//# sourceMappingURL=navigation.js.map