"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.navigationItemRoute = void 0;
var _router = require("@wordpress/router");
var _constants = require("../../utils/constants");
var _editor = _interopRequireDefault(require("../editor"));
var _sidebarNavigationScreenNavigationMenu = _interopRequireDefault(require("../sidebar-navigation-screen-navigation-menu"));
var _lockUnlock = require("../../lock-unlock");
var _jsxRuntime = require("react/jsx-runtime");
/**
 * WordPress dependencies
 */

/**
 * Internal dependencies
 */

const {
  useLocation
} = (0, _lockUnlock.unlock)(_router.privateApis);
function MobileNavigationItemView() {
  const {
    query = {}
  } = useLocation();
  const {
    canvas = 'view'
  } = query;
  return canvas === 'edit' ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_editor.default, {}) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_sidebarNavigationScreenNavigationMenu.default, {
    backPath: {
      postType: _constants.NAVIGATION_POST_TYPE
    }
  });
}
const navigationItemRoute = exports.navigationItemRoute = {
  name: 'navigation-item',
  path: '/wp_navigation/:postId',
  areas: {
    sidebar: /*#__PURE__*/(0, _jsxRuntime.jsx)(_sidebarNavigationScreenNavigationMenu.default, {
      backPath: "/navigation"
    }),
    preview: /*#__PURE__*/(0, _jsxRuntime.jsx)(_editor.default, {}),
    mobile: /*#__PURE__*/(0, _jsxRuntime.jsx)(MobileNavigationItemView, {})
  }
};
//# sourceMappingURL=navigation-item.js.map