/**
 * sinks/slack/dashboard-links.ts
 *
 * Builds deep-links into the AILF dashboard for Slack notifications. The base
 * URL is the deployed app (org/appId from apps/dashboard/sanity.cli.ts) and may
 * be overridden via AILF_DASHBOARD_URL for local/staging. Route shapes mirror
 * apps/dashboard/src/lib/router-links.ts (a query-string router, D0044).
 *
 * `reportUrl` and `trendsUrl` are now the canonical implementations from
 * `@sanity/ailf-core`; they are re-exported here for backwards compatibility.
 */
import { reportUrl } from "../../_vendor/ailf-core/index.js";
export { reportUrl, trendsUrl } from "../../_vendor/ailf-core/index.js";
export const DEFAULT_DASHBOARD_BASE_URL = "https://www.sanity.io/@oSyH1iET5/application/l3gwk99w5xtv3dl8wxv94uny/";
/** Env override → default constant. Call only at composition/command roots. */
export function resolveDashboardBaseUrl(env = process.env) {
    const override = env.AILF_DASHBOARD_URL?.trim();
    return override ? override : DEFAULT_DASHBOARD_BASE_URL;
}
/**
 * Resolve the dashboard deep-link for a published report. Reads the env to
 * pick the base URL, so call only at command roots (eval-pipeline rule).
 * Returns null when no report id is available (e.g. a `--no-publish` run),
 * so callers never print a dead link.
 */
export function resolveReportUrl(reportId, env = process.env) {
    return reportId ? reportUrl(resolveDashboardBaseUrl(env), reportId) : null;
}
