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

/**
 * Internal dependencies
 */
import Editor from '../editor';
import SidebarNavigationScreenNavigationMenu from '../sidebar-navigation-screen-navigation-menu';
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 MobileNavigationItemView() {
  const {
    query = {}
  } = useLocation();
  const {
    canvas = 'view'
  } = query;
  return canvas === 'edit' ? /*#__PURE__*/_jsx(Editor, {}) : /*#__PURE__*/_jsx(SidebarNavigationScreenNavigationMenu, {
    backPath: "/navigation"
  });
}
export const navigationItemRoute = {
  name: 'navigation-item',
  path: '/wp_navigation/:postId',
  areas: {
    sidebar({
      siteData
    }) {
      const isBlockTheme = siteData.currentTheme?.is_block_theme;
      return isBlockTheme ? /*#__PURE__*/_jsx(SidebarNavigationScreenNavigationMenu, {
        backPath: "/navigation"
      }) : /*#__PURE__*/_jsx(SidebarNavigationScreenUnsupported, {});
    },
    preview({
      siteData
    }) {
      const isBlockTheme = siteData.currentTheme?.is_block_theme;
      return isBlockTheme ? /*#__PURE__*/_jsx(Editor, {}) : /*#__PURE__*/_jsx(SidebarNavigationScreenUnsupported, {});
    },
    mobile({
      siteData
    }) {
      const isBlockTheme = siteData.currentTheme?.is_block_theme;
      return isBlockTheme ? /*#__PURE__*/_jsx(MobileNavigationItemView, {}) : /*#__PURE__*/_jsx(SidebarNavigationScreenUnsupported, {});
    }
  }
};
//# sourceMappingURL=navigation-item.js.map