"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.computeLinks = computeLinks;
const computeItemLinks_1 = require("../../core/_internal/computeItemLinks");
const internalContentUtils_1 = require("../../content/_internal/internalContentUtils");
const getItemIdentifier_1 = require("../../items/getItemIdentifier");
/**
 * Compute the links that get appended to a Hub Site
 * search result and entity
 *
 * @param item
 * @param requestOptions
 */
function computeLinks(item, requestOptions) {
    const links = (0, computeItemLinks_1.computeItemLinks)(item, requestOptions);
    // re-compute the site relative link to include the id
    // NOTE: when we expand this beyond pages we should drop this override
    // and just pass true to getItemIdentifier in computeItemLinks
    const siteRelative = (0, internalContentUtils_1.getHubRelativeUrl)(item.type, (0, getItemIdentifier_1.getItemIdentifier)(item, true), item.typeKeywords);
    return Object.assign(Object.assign({}, links), { 
        // add id to site relative link
        siteRelative, 
        // add the layout relative link
        layoutRelative: `/pages/${item.id}/edit` });
}
//# sourceMappingURL=computeLinks.js.map