/**
 * @fileoverview Classify · Tag Health tab.
 *
 * Self-contained sub-page that surfaces the REAL taxonomy-quality signals the
 * server-side TagHealthJob produces as `MJ: Tag Suggestions` rows with
 * `Reason ∈ {MergeCandidate, LowUsage, WideNode}`. The Suggestions Inbox tab
 * deliberately EXCLUDES these 3 reasons; the Health tab OWNS them.
 *
 * NOTE: the underlying signals (which tags are merge candidates, which are
 * low-usage, which are wide nodes) are computed SERVER-SIDE by the TagHealthJob
 * — this tab does not recompute them. It triages the resulting suggestion rows:
 * grouping them into the 3 signal buckets and applying human decisions
 * (Merge / Deprecate / Review-in-Taxonomy / Dismiss) as client-side entity
 * mutations on the suggestion (and, for Deprecate, on the subject Tag).
 *
 * Data is TRANSACTIONAL and grows over time — loaded via RunView (NOT cached),
 * grouped into the 3 buckets in memory. Loads lazily on first activation.
 */
import { EventEmitter } from '@angular/core';
import { BaseAngularComponent } from '@memberjunction/ng-base-types';
import { MJTagSuggestionEntity } from '@memberjunction/core-entities';
import * as i0 from "@angular/core";
/** The three health-signal reasons this tab owns. */
type HealthReason = 'MergeCandidate' | 'LowUsage' | 'WideNode';
/** Static descriptor for one of the 3 signal cards. */
interface SignalCardMeta {
    Reason: HealthReason;
    Title: string;
    Icon: string;
    /** Semantic status variant driving the card accent color. */
    Variant: 'info' | 'warning' | 'error';
    /** One-line explanation of what the signal means. */
    Explanation: string;
    /** Noun for the headline count (e.g. "pairs", "tags", "nodes"). */
    CountNoun: string;
}
/** A signal card's live view-model: its meta + the suggestions in its bucket. */
interface SignalCard {
    Meta: SignalCardMeta;
    Items: MJTagSuggestionEntity[];
}
export declare class ClassifyHealthTabComponent extends BaseAngularComponent {
    private cdr;
    readonly PreviewLimit = 5;
    readonly HighConfidenceThreshold = 0.9;
    private allSuggestions;
    Cards: SignalCard[];
    IsLoading: boolean;
    private hasLoaded;
    /** ID of the suggestion currently being acted on (disables its row controls). */
    ActingID: string | null;
    /** True while a bulk action is in flight. */
    IsBulkActing: boolean;
    /** Emitted after any action so the host can refresh its pending/health badge. */
    Resolved: EventEmitter<void>;
    /** Emitted with a tag ID so the host can switch to the Taxonomy tab for review. */
    OpenInTaxonomyRequested: EventEmitter<string>;
    /** Lazy-load on first activation (host calls this when the tab becomes active). */
    EnsureLoaded(): Promise<void>;
    /** Public refresh — re-pull the health suggestions and rebuild buckets. */
    Refresh(): Promise<void>;
    private ensureTagEngine;
    private loadSuggestions;
    /** Group the loaded suggestions into the 3 signal buckets, preserving card order. */
    private buildCards;
    FormatScore(score: number | null): string;
    /** Count of high-confidence merge candidates eligible for the bulk merge. */
    HighConfidenceCount(card: SignalCard): number;
    /** Whether a given suggestion's row controls should be disabled. */
    IsRowBusy(suggestion: MJTagSuggestionEntity): boolean;
    private stampReviewFields;
    /** Merge candidate → Merge: resolve the suggestion onto its best-match tag. */
    Merge(suggestion: MJTagSuggestionEntity): Promise<void>;
    /** Bulk: merge every high-confidence (score ≥ 0.9) merge candidate at once. */
    MergeAllHighConfidence(card: SignalCard): Promise<void>;
    /** Stamp + resolve a single merge suggestion. Returns Save() success. */
    private resolveMerge;
    /** Low usage → Deprecate: flip the subject Tag to Deprecated, then resolve. */
    Deprecate(suggestion: MJTagSuggestionEntity): Promise<void>;
    /**
     * Resolve the subject Tag for a low-usage suggestion: prefer the best-match
     * tag (that IS the low-usage tag here), else fall back to the already-resolved
     * tag, else look up by proposed name via the cached TagEngineBase tags.
     */
    private resolveSubjectTag;
    /** Case-insensitive name → tag ID lookup against the cached tag set. */
    private lookupTagIDByName;
    /**
     * Wide node → Review in Taxonomy: bubble the tag ID up so the host can switch
     * to the Taxonomy tab. The suggestion stays Pending — review happens there.
     */
    ReviewInTaxonomy(suggestion: MJTagSuggestionEntity): void;
    /** Dismiss any signal: mark the suggestion Rejected. */
    Dismiss(suggestion: MJTagSuggestionEntity): Promise<void>;
    /** Remove a resolved suggestion, rebuild buckets, notify the host. */
    private finishAction;
    private notifyFailure;
    private notifyError;
    static ɵfac: i0.ɵɵFactoryDeclaration<ClassifyHealthTabComponent, never>;
    static ɵcmp: i0.ɵɵComponentDeclaration<ClassifyHealthTabComponent, "classify-health-tab", never, {}, { "Resolved": "Resolved"; "OpenInTaxonomyRequested": "OpenInTaxonomyRequested"; }, never, never, false, never>;
}
export {};
//# sourceMappingURL=health-tab.component.d.ts.map