var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
/**
 * @fileoverview Duplicate Detection Kanban Board Resource Component
 *
 * Dashboard resource for reviewing duplicate detection results in a Kanban-style
 * board with three columns: Pending Review, Approved, and Rejected.
 * Loads data from MJ: Duplicate Runs, MJ: Duplicate Run Details, and
 * MJ: Duplicate Run Detail Matches entities.
 */
import { Component, ChangeDetectorRef, Input, inject } from '@angular/core';
import { Subject } from 'rxjs';
import { debounceTime, takeUntil } from 'rxjs/operators';
import { RunView } from '@memberjunction/core';
import { RegisterClass } from '@memberjunction/global';
import { BaseResourceComponent } from '@memberjunction/ng-shared';
import * as i0 from "@angular/core";
import * as i1 from "@angular/forms";
import * as i2 from "@memberjunction/ng-shared-generic";
const _forTrack0 = ($index, $item) => $item.DetailId;
function DuplicateDetectionResourceComponent_For_33_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "option", 16);
    i0.ɵɵtext(1);
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const name_r1 = ctx.$implicit;
    i0.ɵɵproperty("value", name_r1);
    i0.ɵɵadvance();
    i0.ɵɵtextInterpolate(name_r1);
} }
function DuplicateDetectionResourceComponent_Conditional_50_Template(rf, ctx) { if (rf & 1) {
    const _r2 = i0.ɵɵgetCurrentView();
    i0.ɵɵelementStart(0, "button", 26);
    i0.ɵɵlistener("click", function DuplicateDetectionResourceComponent_Conditional_50_Template_button_click_0_listener() { i0.ɵɵrestoreView(_r2); const ctx_r2 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r2.ClearFilters()); });
    i0.ɵɵelement(1, "i", 27);
    i0.ɵɵtext(2, " Clear Filters ");
    i0.ɵɵelementEnd();
} }
function DuplicateDetectionResourceComponent_Conditional_51_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "div", 22);
    i0.ɵɵelement(1, "mj-loading", 28);
    i0.ɵɵelementEnd();
} }
function DuplicateDetectionResourceComponent_Conditional_52_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "div", 23);
    i0.ɵɵelement(1, "i", 29);
    i0.ɵɵelementStart(2, "p", 30);
    i0.ɵɵtext(3, "No duplicate detection results found.");
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(4, "p", 31);
    i0.ɵɵtext(5, "Run a duplicate detection scan to see results here.");
    i0.ɵɵelementEnd()();
} }
function DuplicateDetectionResourceComponent_Conditional_53_For_10_Template(rf, ctx) { if (rf & 1) {
    const _r4 = i0.ɵɵgetCurrentView();
    i0.ɵɵelementStart(0, "div", 38)(1, "div", 44)(2, "span", 45);
    i0.ɵɵtext(3);
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(4, "span", 46);
    i0.ɵɵtext(5);
    i0.ɵɵelementEnd()();
    i0.ɵɵelementStart(6, "div", 47)(7, "div", 48);
    i0.ɵɵelement(8, "i", 49);
    i0.ɵɵelementStart(9, "span", 50);
    i0.ɵɵtext(10);
    i0.ɵɵelementEnd()();
    i0.ɵɵelementStart(11, "div", 48);
    i0.ɵɵelement(12, "i", 51);
    i0.ɵɵelementStart(13, "span", 52);
    i0.ɵɵtext(14);
    i0.ɵɵelementEnd()();
    i0.ɵɵelementStart(15, "div", 48);
    i0.ɵɵelement(16, "i", 53);
    i0.ɵɵelementStart(17, "span", 52);
    i0.ɵɵtext(18);
    i0.ɵɵelementEnd()()();
    i0.ɵɵelementStart(19, "div", 54)(20, "button", 55);
    i0.ɵɵlistener("click", function DuplicateDetectionResourceComponent_Conditional_53_For_10_Template_button_click_20_listener() { const group_r5 = i0.ɵɵrestoreView(_r4).$implicit; const ctx_r2 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r2.ApproveMatch(group_r5)); });
    i0.ɵɵelement(21, "i", 56);
    i0.ɵɵtext(22, " Approve ");
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(23, "button", 57);
    i0.ɵɵlistener("click", function DuplicateDetectionResourceComponent_Conditional_53_For_10_Template_button_click_23_listener() { const group_r5 = i0.ɵɵrestoreView(_r4).$implicit; const ctx_r2 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r2.RejectMatch(group_r5)); });
    i0.ɵɵelement(24, "i", 27);
    i0.ɵɵtext(25, " Reject ");
    i0.ɵɵelementEnd()()();
} if (rf & 2) {
    const group_r5 = ctx.$implicit;
    const ctx_r2 = i0.ɵɵnextContext(2);
    i0.ɵɵadvance(3);
    i0.ɵɵtextInterpolate(group_r5.EntityName);
    i0.ɵɵadvance();
    i0.ɵɵclassMap(ctx_r2.GetScoreClass(group_r5.HighestScore));
    i0.ɵɵadvance();
    i0.ɵɵtextInterpolate1(" ", (group_r5.HighestScore * 100).toFixed(0), "% ");
    i0.ɵɵadvance(4);
    i0.ɵɵproperty("title", group_r5.RecordId);
    i0.ɵɵadvance();
    i0.ɵɵtextInterpolate(group_r5.RecordId);
    i0.ɵɵadvance(4);
    i0.ɵɵtextInterpolate2("", group_r5.MatchCount, " match", group_r5.MatchCount !== 1 ? "es" : "");
    i0.ɵɵadvance(4);
    i0.ɵɵtextInterpolate(ctx_r2.FormatDate(group_r5.MatchedAt));
    i0.ɵɵadvance(2);
    i0.ɵɵproperty("disabled", ctx_r2.IsSaving);
    i0.ɵɵadvance(3);
    i0.ɵɵproperty("disabled", ctx_r2.IsSaving);
} }
function DuplicateDetectionResourceComponent_Conditional_53_Conditional_11_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "div", 39);
    i0.ɵɵelement(1, "i", 41);
    i0.ɵɵelementStart(2, "span");
    i0.ɵɵtext(3, "No pending items");
    i0.ɵɵelementEnd()();
} }
function DuplicateDetectionResourceComponent_Conditional_53_For_21_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "div", 38)(1, "div", 44)(2, "span", 45);
    i0.ɵɵtext(3);
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(4, "span", 46);
    i0.ɵɵtext(5);
    i0.ɵɵelementEnd()();
    i0.ɵɵelementStart(6, "div", 47)(7, "div", 48);
    i0.ɵɵelement(8, "i", 49);
    i0.ɵɵelementStart(9, "span", 50);
    i0.ɵɵtext(10);
    i0.ɵɵelementEnd()();
    i0.ɵɵelementStart(11, "div", 48);
    i0.ɵɵelement(12, "i", 51);
    i0.ɵɵelementStart(13, "span", 52);
    i0.ɵɵtext(14);
    i0.ɵɵelementEnd()();
    i0.ɵɵelementStart(15, "div", 48);
    i0.ɵɵelement(16, "i", 53);
    i0.ɵɵelementStart(17, "span", 52);
    i0.ɵɵtext(18);
    i0.ɵɵelementEnd()()()();
} if (rf & 2) {
    const group_r6 = ctx.$implicit;
    const ctx_r2 = i0.ɵɵnextContext(2);
    i0.ɵɵadvance(3);
    i0.ɵɵtextInterpolate(group_r6.EntityName);
    i0.ɵɵadvance();
    i0.ɵɵclassMap(ctx_r2.GetScoreClass(group_r6.HighestScore));
    i0.ɵɵadvance();
    i0.ɵɵtextInterpolate1(" ", (group_r6.HighestScore * 100).toFixed(0), "% ");
    i0.ɵɵadvance(4);
    i0.ɵɵproperty("title", group_r6.RecordId);
    i0.ɵɵadvance();
    i0.ɵɵtextInterpolate(group_r6.RecordId);
    i0.ɵɵadvance(4);
    i0.ɵɵtextInterpolate2("", group_r6.MatchCount, " match", group_r6.MatchCount !== 1 ? "es" : "");
    i0.ɵɵadvance(4);
    i0.ɵɵtextInterpolate(ctx_r2.FormatDate(group_r6.MatchedAt));
} }
function DuplicateDetectionResourceComponent_Conditional_53_Conditional_22_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "div", 39);
    i0.ɵɵelement(1, "i", 58);
    i0.ɵɵelementStart(2, "span");
    i0.ɵɵtext(3, "No approved items");
    i0.ɵɵelementEnd()();
} }
function DuplicateDetectionResourceComponent_Conditional_53_For_32_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "div", 38)(1, "div", 44)(2, "span", 45);
    i0.ɵɵtext(3);
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(4, "span", 46);
    i0.ɵɵtext(5);
    i0.ɵɵelementEnd()();
    i0.ɵɵelementStart(6, "div", 47)(7, "div", 48);
    i0.ɵɵelement(8, "i", 49);
    i0.ɵɵelementStart(9, "span", 50);
    i0.ɵɵtext(10);
    i0.ɵɵelementEnd()();
    i0.ɵɵelementStart(11, "div", 48);
    i0.ɵɵelement(12, "i", 51);
    i0.ɵɵelementStart(13, "span", 52);
    i0.ɵɵtext(14);
    i0.ɵɵelementEnd()();
    i0.ɵɵelementStart(15, "div", 48);
    i0.ɵɵelement(16, "i", 53);
    i0.ɵɵelementStart(17, "span", 52);
    i0.ɵɵtext(18);
    i0.ɵɵelementEnd()()()();
} if (rf & 2) {
    const group_r7 = ctx.$implicit;
    const ctx_r2 = i0.ɵɵnextContext(2);
    i0.ɵɵadvance(3);
    i0.ɵɵtextInterpolate(group_r7.EntityName);
    i0.ɵɵadvance();
    i0.ɵɵclassMap(ctx_r2.GetScoreClass(group_r7.HighestScore));
    i0.ɵɵadvance();
    i0.ɵɵtextInterpolate1(" ", (group_r7.HighestScore * 100).toFixed(0), "% ");
    i0.ɵɵadvance(4);
    i0.ɵɵproperty("title", group_r7.RecordId);
    i0.ɵɵadvance();
    i0.ɵɵtextInterpolate(group_r7.RecordId);
    i0.ɵɵadvance(4);
    i0.ɵɵtextInterpolate2("", group_r7.MatchCount, " match", group_r7.MatchCount !== 1 ? "es" : "");
    i0.ɵɵadvance(4);
    i0.ɵɵtextInterpolate(ctx_r2.FormatDate(group_r7.MatchedAt));
} }
function DuplicateDetectionResourceComponent_Conditional_53_Conditional_33_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "div", 39);
    i0.ɵɵelement(1, "i", 58);
    i0.ɵɵelementStart(2, "span");
    i0.ɵɵtext(3, "No rejected items");
    i0.ɵɵelementEnd()();
} }
function DuplicateDetectionResourceComponent_Conditional_53_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "div", 24)(1, "div", 32)(2, "div", 33);
    i0.ɵɵelement(3, "i", 34);
    i0.ɵɵelementStart(4, "span", 35);
    i0.ɵɵtext(5, "Pending Review");
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(6, "span", 36);
    i0.ɵɵtext(7);
    i0.ɵɵelementEnd()();
    i0.ɵɵelementStart(8, "div", 37);
    i0.ɵɵrepeaterCreate(9, DuplicateDetectionResourceComponent_Conditional_53_For_10_Template, 26, 11, "div", 38, _forTrack0);
    i0.ɵɵconditionalCreate(11, DuplicateDetectionResourceComponent_Conditional_53_Conditional_11_Template, 4, 0, "div", 39);
    i0.ɵɵelementEnd()();
    i0.ɵɵelementStart(12, "div", 32)(13, "div", 40);
    i0.ɵɵelement(14, "i", 41);
    i0.ɵɵelementStart(15, "span", 35);
    i0.ɵɵtext(16, "Approved");
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(17, "span", 36);
    i0.ɵɵtext(18);
    i0.ɵɵelementEnd()();
    i0.ɵɵelementStart(19, "div", 37);
    i0.ɵɵrepeaterCreate(20, DuplicateDetectionResourceComponent_Conditional_53_For_21_Template, 19, 9, "div", 38, _forTrack0);
    i0.ɵɵconditionalCreate(22, DuplicateDetectionResourceComponent_Conditional_53_Conditional_22_Template, 4, 0, "div", 39);
    i0.ɵɵelementEnd()();
    i0.ɵɵelementStart(23, "div", 32)(24, "div", 42);
    i0.ɵɵelement(25, "i", 43);
    i0.ɵɵelementStart(26, "span", 35);
    i0.ɵɵtext(27, "Rejected");
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(28, "span", 36);
    i0.ɵɵtext(29);
    i0.ɵɵelementEnd()();
    i0.ɵɵelementStart(30, "div", 37);
    i0.ɵɵrepeaterCreate(31, DuplicateDetectionResourceComponent_Conditional_53_For_32_Template, 19, 9, "div", 38, _forTrack0);
    i0.ɵɵconditionalCreate(33, DuplicateDetectionResourceComponent_Conditional_53_Conditional_33_Template, 4, 0, "div", 39);
    i0.ɵɵelementEnd()()();
} if (rf & 2) {
    const ctx_r2 = i0.ɵɵnextContext();
    i0.ɵɵadvance(7);
    i0.ɵɵtextInterpolate(ctx_r2.PendingCount);
    i0.ɵɵadvance(2);
    i0.ɵɵrepeater(ctx_r2.PendingGroups);
    i0.ɵɵadvance(2);
    i0.ɵɵconditional(ctx_r2.PendingGroups.length === 0 ? 11 : -1);
    i0.ɵɵadvance(7);
    i0.ɵɵtextInterpolate(ctx_r2.ApprovedCount);
    i0.ɵɵadvance(2);
    i0.ɵɵrepeater(ctx_r2.ApprovedGroups);
    i0.ɵɵadvance(2);
    i0.ɵɵconditional(ctx_r2.ApprovedGroups.length === 0 ? 22 : -1);
    i0.ɵɵadvance(7);
    i0.ɵɵtextInterpolate(ctx_r2.RejectedCount);
    i0.ɵɵadvance(2);
    i0.ɵɵrepeater(ctx_r2.RejectedGroups);
    i0.ɵɵadvance(2);
    i0.ɵɵconditional(ctx_r2.RejectedGroups.length === 0 ? 33 : -1);
} }
function DuplicateDetectionResourceComponent_Conditional_54_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "div", 25);
    i0.ɵɵelement(1, "mj-loading", 59);
    i0.ɵɵelementEnd();
} }
let DuplicateDetectionResourceComponent = class DuplicateDetectionResourceComponent extends BaseResourceComponent {
    cdr = inject(ChangeDetectorRef);
    destroy$ = new Subject();
    filterSubject = new Subject();
    // Loading state
    IsLoading = false;
    IsSaving = false;
    // Raw data
    Runs = [];
    Details = [];
    Matches = [];
    // Aggregated groups for display
    AllGroups = [];
    PendingGroups = [];
    ApprovedGroups = [];
    RejectedGroups = [];
    // Filter state
    Filters = {
        EntityName: '',
        MinScore: 0,
        MaxScore: 1,
        DateFrom: '',
        DateTo: ''
    };
    // Available entity names from loaded runs
    EntityNames = [];
    /** Whether this component is embedded inside the Knowledge Hub shell */
    EmbeddedMode = false;
    /** View mode: 'kanban' (card board) or 'table' (paged grid) */
    DisplayMode = 'kanban';
    /** Page size for table view */
    PageSize = 50;
    /** Current page (0-based) */
    CurrentPage = 0;
    /** Selected entity filter */
    SelectedEntityFilter = '';
    /** Currently selected group for merge panel */
    SelectedMergeGroup = null;
    /** Whether the merge panel is visible */
    ShowMergePanel = false;
    /** Auto-switch to table mode when groups exceed threshold */
    kanbanThreshold = 50;
    /** Toggle display mode */
    ToggleDisplayMode() {
        this.DisplayMode = this.DisplayMode === 'kanban' ? 'table' : 'kanban';
        this.CurrentPage = 0;
        this.cdr.detectChanges();
    }
    /** Filter by entity name */
    FilterByEntity(entityName) {
        this.SelectedEntityFilter = entityName;
        this.Filters.EntityName = entityName;
        this.autoSelectDisplayMode();
        this.cdr.detectChanges();
    }
    /** Get paged groups for table view */
    GetPagedGroups() {
        const start = this.CurrentPage * this.PageSize;
        return this.AllGroups.slice(start, start + this.PageSize);
    }
    /** Get total page count */
    get TotalPages() {
        return Math.ceil(this.AllGroups.length / this.PageSize);
    }
    /** Navigate to next page */
    NextPage() {
        if (this.CurrentPage < this.TotalPages - 1) {
            this.CurrentPage++;
            this.cdr.detectChanges();
        }
    }
    /** Navigate to previous page */
    PrevPage() {
        if (this.CurrentPage > 0) {
            this.CurrentPage--;
            this.cdr.detectChanges();
        }
    }
    /** Open the merge panel for a duplicate group */
    OpenMergePanel(group) {
        this.SelectedMergeGroup = group;
        this.ShowMergePanel = true;
        this.cdr.detectChanges();
    }
    /** Close the merge panel */
    CloseMergePanel() {
        this.SelectedMergeGroup = null;
        this.ShowMergePanel = false;
        this.cdr.detectChanges();
    }
    /** Auto-select display mode based on group count */
    autoSelectDisplayMode() {
        this.DisplayMode = this.AllGroups.length > this.kanbanThreshold ? 'table' : 'kanban';
    }
    // KPI values
    get TotalGroupCount() {
        return this.AllGroups.length;
    }
    get PendingCount() {
        return this.PendingGroups.length;
    }
    get ApprovedCount() {
        return this.ApprovedGroups.length;
    }
    get RejectedCount() {
        return this.RejectedGroups.length;
    }
    async ngAfterViewInit() {
        this.setupFilterDebounce();
        await this.LoadData();
        this.NotifyLoadComplete();
    }
    ngOnDestroy() {
        this.destroy$.next();
        this.destroy$.complete();
    }
    async GetResourceDisplayName(_data) {
        return 'Duplicate Detection';
    }
    async GetResourceIconClass(_data) {
        return 'fa-solid fa-clone';
    }
    /**
     * Loads all duplicate run data and builds the Kanban groups.
     */
    async LoadData() {
        this.IsLoading = true;
        this.cdr.detectChanges();
        try {
            const rv = new RunView();
            const [runsResult, detailsResult, matchesResult] = await rv.RunViews([
                {
                    EntityName: 'MJ: Duplicate Runs',
                    ExtraFilter: "ProcessingStatus = 'Complete'",
                    OrderBy: 'StartedAt DESC',
                    ResultType: 'entity_object'
                },
                {
                    EntityName: 'MJ: Duplicate Run Details',
                    ExtraFilter: "MatchStatus = 'Complete'",
                    OrderBy: '__mj_CreatedAt DESC',
                    ResultType: 'entity_object'
                },
                {
                    EntityName: 'MJ: Duplicate Run Detail Matches',
                    OrderBy: 'MatchProbability DESC',
                    ResultType: 'entity_object'
                }
            ]);
            if (runsResult.Success) {
                this.Runs = runsResult.Results;
            }
            if (detailsResult.Success) {
                this.Details = detailsResult.Results;
            }
            if (matchesResult.Success) {
                this.Matches = matchesResult.Results;
            }
            this.extractEntityNames();
            this.buildGroups();
            this.applyFilters();
        }
        catch (error) {
            console.error('Error loading duplicate detection data:', error);
        }
        finally {
            this.IsLoading = false;
            this.cdr.detectChanges();
        }
    }
    /**
     * Approves all matches within a duplicate group by updating each match's ApprovalStatus.
     */
    async ApproveMatch(group) {
        await this.updateGroupApprovalStatus(group, 'Approved');
    }
    /**
     * Rejects all matches within a duplicate group by updating each match's ApprovalStatus.
     */
    async RejectMatch(group) {
        await this.updateGroupApprovalStatus(group, 'Rejected');
    }
    /** Handle filter changes with debounce */
    OnFilterChange() {
        this.filterSubject.next();
    }
    /** Clear all filters */
    ClearFilters() {
        this.Filters = {
            EntityName: '',
            MinScore: 0,
            MaxScore: 1,
            DateFrom: '',
            DateTo: ''
        };
        this.applyFilters();
    }
    /** Returns the CSS class for a match score indicator */
    GetScoreClass(score) {
        if (score > 0.9)
            return 'score-high';
        if (score >= 0.7)
            return 'score-medium';
        return 'score-low';
    }
    /** Returns a human-readable label for a match score */
    GetScoreLabel(score) {
        if (score > 0.9)
            return 'High';
        if (score >= 0.7)
            return 'Medium';
        return 'Low';
    }
    /** Format a date for display */
    FormatDate(date) {
        if (!date)
            return '';
        const d = new Date(date);
        return d.toLocaleDateString(undefined, { month: 'short', day: 'numeric', year: 'numeric' });
    }
    /** Whether any filters are active */
    get HasActiveFilters() {
        return this.Filters.EntityName !== '' ||
            this.Filters.MinScore > 0 ||
            this.Filters.MaxScore < 1 ||
            this.Filters.DateFrom !== '' ||
            this.Filters.DateTo !== '';
    }
    // ---- Private Methods ----
    setupFilterDebounce() {
        this.filterSubject.pipe(debounceTime(300), takeUntil(this.destroy$)).subscribe(() => {
            this.applyFilters();
        });
    }
    /** Extract unique entity names from loaded runs */
    extractEntityNames() {
        const nameSet = new Set();
        for (const run of this.Runs) {
            if (run.Entity) {
                nameSet.add(run.Entity);
            }
        }
        this.EntityNames = Array.from(nameSet).sort();
    }
    /**
     * Build DuplicateGroup objects by joining details to their matches,
     * and resolving the entity name from the parent run.
     */
    buildGroups() {
        const runMap = new Map();
        for (const run of this.Runs) {
            runMap.set(run.ID, run);
        }
        const matchesByDetail = new Map();
        for (const match of this.Matches) {
            const key = match.DuplicateRunDetailID;
            const existing = matchesByDetail.get(key);
            if (existing) {
                existing.push(match);
            }
            else {
                matchesByDetail.set(key, [match]);
            }
        }
        this.AllGroups = [];
        for (const detail of this.Details) {
            const detailMatches = matchesByDetail.get(detail.ID);
            if (!detailMatches || detailMatches.length === 0) {
                continue; // Skip details with no matches
            }
            const run = runMap.get(detail.DuplicateRunID);
            const entityName = run?.Entity ?? 'Unknown';
            const highestScore = this.computeHighestScore(detailMatches);
            const dominantStatus = this.computeDominantApprovalStatus(detailMatches);
            const latestMatchDate = this.computeLatestMatchDate(detailMatches);
            this.AllGroups.push({
                DetailId: detail.ID,
                RunId: detail.DuplicateRunID,
                RecordId: detail.RecordID,
                EntityName: entityName,
                ApprovalStatus: dominantStatus,
                MatchCount: detailMatches.length,
                HighestScore: highestScore,
                Matches: detailMatches,
                MatchedAt: latestMatchDate
            });
        }
    }
    /** Find the highest match probability across a set of matches */
    computeHighestScore(matches) {
        let max = 0;
        for (const m of matches) {
            if (m.MatchProbability > max) {
                max = m.MatchProbability;
            }
        }
        return max;
    }
    /**
     * Determine the dominant approval status for a group of matches.
     * If any match is Pending, the group is Pending.
     * Otherwise, if all are Approved, the group is Approved.
     * If all are Rejected, the group is Rejected.
     * Mixed Approved/Rejected defaults to Pending.
     */
    computeDominantApprovalStatus(matches) {
        let hasApproved = false;
        let hasRejected = false;
        for (const m of matches) {
            if (m.ApprovalStatus === 'Pending')
                return 'Pending';
            if (m.ApprovalStatus === 'Approved')
                hasApproved = true;
            if (m.ApprovalStatus === 'Rejected')
                hasRejected = true;
        }
        if (hasApproved && !hasRejected)
            return 'Approved';
        if (hasRejected && !hasApproved)
            return 'Rejected';
        return 'Pending'; // mixed
    }
    /** Find the latest MatchedAt date across a set of matches */
    computeLatestMatchDate(matches) {
        let latest = new Date(0);
        for (const m of matches) {
            const d = new Date(m.MatchedAt);
            if (d > latest) {
                latest = d;
            }
        }
        return latest;
    }
    /** Apply filters and distribute groups into Kanban columns */
    applyFilters() {
        let filtered = [...this.AllGroups];
        if (this.Filters.EntityName) {
            filtered = filtered.filter(g => g.EntityName === this.Filters.EntityName);
        }
        if (this.Filters.MinScore > 0) {
            filtered = filtered.filter(g => g.HighestScore >= this.Filters.MinScore);
        }
        if (this.Filters.MaxScore < 1) {
            filtered = filtered.filter(g => g.HighestScore <= this.Filters.MaxScore);
        }
        if (this.Filters.DateFrom) {
            const from = new Date(this.Filters.DateFrom);
            filtered = filtered.filter(g => new Date(g.MatchedAt) >= from);
        }
        if (this.Filters.DateTo) {
            const to = new Date(this.Filters.DateTo);
            filtered = filtered.filter(g => new Date(g.MatchedAt) <= to);
        }
        this.PendingGroups = filtered.filter(g => g.ApprovalStatus === 'Pending');
        this.ApprovedGroups = filtered.filter(g => g.ApprovalStatus === 'Approved');
        this.RejectedGroups = filtered.filter(g => g.ApprovalStatus === 'Rejected');
        this.cdr.detectChanges();
    }
    /** Update the ApprovalStatus of all matches within a group and re-sort.
     *  Since this.Matches already contains entity_object instances, we update and save them directly
     *  instead of loading each one individually from the database.
     */
    async updateGroupApprovalStatus(group, status) {
        this.IsSaving = true;
        this.cdr.detectChanges();
        try {
            for (const match of group.Matches) {
                match.ApprovalStatus = status;
                await match.Save();
            }
            // Update the local group state
            group.ApprovalStatus = status;
            this.applyFilters();
        }
        catch (error) {
            console.error(`Error updating match approval status to ${status}:`, error);
        }
        finally {
            this.IsSaving = false;
            this.cdr.detectChanges();
        }
    }
    static ɵfac = /*@__PURE__*/ (() => { let ɵDuplicateDetectionResourceComponent_BaseFactory; return function DuplicateDetectionResourceComponent_Factory(__ngFactoryType__) { return (ɵDuplicateDetectionResourceComponent_BaseFactory || (ɵDuplicateDetectionResourceComponent_BaseFactory = i0.ɵɵgetInheritedFactory(DuplicateDetectionResourceComponent)))(__ngFactoryType__ || DuplicateDetectionResourceComponent); }; })();
    static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: DuplicateDetectionResourceComponent, selectors: [["app-duplicate-detection-resource"]], inputs: { EmbeddedMode: "EmbeddedMode" }, standalone: false, features: [i0.ɵɵInheritDefinitionFeature], decls: 55, vars: 12, consts: [[1, "duplicate-detection-container"], [1, "page-header"], [1, "header-left"], [1, "page-title"], [1, "fa-solid", "fa-clone"], [1, "kpi-strip"], [1, "kpi-card"], [1, "kpi-value"], [1, "kpi-label"], [1, "kpi-card", "kpi-pending"], [1, "kpi-card", "kpi-approved"], [1, "kpi-card", "kpi-rejected"], [1, "filter-bar"], [1, "filter-group"], [1, "filter-select", 3, "ngModelChange", "ngModel"], ["value", ""], [3, "value"], [1, "filter-range"], [1, "filter-label"], ["type", "number", "min", "0", "max", "1", "step", "0.05", 1, "filter-input", 3, "ngModelChange", "ngModel"], ["type", "date", 1, "filter-input", 3, "ngModelChange", "ngModel"], [1, "clear-filters-btn"], [1, "loading-container"], [1, "empty-state"], [1, "kanban-board"], [1, "saving-overlay"], [1, "clear-filters-btn", 3, "click"], [1, "fa-solid", "fa-times"], ["text", "Loading duplicate detection results..."], [1, "fa-solid", "fa-clone", "empty-icon"], [1, "empty-text"], [1, "empty-subtext"], [1, "kanban-column"], [1, "column-header", "column-header-pending"], [1, "fa-solid", "fa-clock"], [1, "column-title"], [1, "column-count"], [1, "column-body"], [1, "kanban-card"], [1, "column-empty"], [1, "column-header", "column-header-approved"], [1, "fa-solid", "fa-check-circle"], [1, "column-header", "column-header-rejected"], [1, "fa-solid", "fa-ban"], [1, "card-header"], [1, "entity-badge"], [1, "score-indicator"], [1, "card-body"], [1, "card-field"], [1, "fa-solid", "fa-fingerprint", "field-icon"], [1, "field-value", "record-id", 3, "title"], [1, "fa-solid", "fa-layer-group", "field-icon"], [1, "field-value"], [1, "fa-solid", "fa-calendar", "field-icon"], [1, "card-actions"], [1, "action-btn", "approve-btn", 3, "click", "disabled"], [1, "fa-solid", "fa-check"], [1, "action-btn", "reject-btn", 3, "click", "disabled"], [1, "fa-solid", "fa-inbox"], ["text", "Saving...", "size", "small"]], template: function DuplicateDetectionResourceComponent_Template(rf, ctx) { if (rf & 1) {
            i0.ɵɵelementStart(0, "div", 0)(1, "div", 1)(2, "div", 2)(3, "h2", 3);
            i0.ɵɵelement(4, "i", 4);
            i0.ɵɵtext(5, " Duplicate Detection ");
            i0.ɵɵelementEnd()()();
            i0.ɵɵelementStart(6, "div", 5)(7, "div", 6)(8, "div", 7);
            i0.ɵɵtext(9);
            i0.ɵɵelementEnd();
            i0.ɵɵelementStart(10, "div", 8);
            i0.ɵɵtext(11, "Total Groups");
            i0.ɵɵelementEnd()();
            i0.ɵɵelementStart(12, "div", 9)(13, "div", 7);
            i0.ɵɵtext(14);
            i0.ɵɵelementEnd();
            i0.ɵɵelementStart(15, "div", 8);
            i0.ɵɵtext(16, "Pending");
            i0.ɵɵelementEnd()();
            i0.ɵɵelementStart(17, "div", 10)(18, "div", 7);
            i0.ɵɵtext(19);
            i0.ɵɵelementEnd();
            i0.ɵɵelementStart(20, "div", 8);
            i0.ɵɵtext(21, "Approved");
            i0.ɵɵelementEnd()();
            i0.ɵɵelementStart(22, "div", 11)(23, "div", 7);
            i0.ɵɵtext(24);
            i0.ɵɵelementEnd();
            i0.ɵɵelementStart(25, "div", 8);
            i0.ɵɵtext(26, "Rejected");
            i0.ɵɵelementEnd()()();
            i0.ɵɵelementStart(27, "div", 12)(28, "div", 13)(29, "select", 14);
            i0.ɵɵtwoWayListener("ngModelChange", function DuplicateDetectionResourceComponent_Template_select_ngModelChange_29_listener($event) { i0.ɵɵtwoWayBindingSet(ctx.Filters.EntityName, $event) || (ctx.Filters.EntityName = $event); return $event; });
            i0.ɵɵlistener("ngModelChange", function DuplicateDetectionResourceComponent_Template_select_ngModelChange_29_listener() { return ctx.OnFilterChange(); });
            i0.ɵɵelementStart(30, "option", 15);
            i0.ɵɵtext(31, "All Entities");
            i0.ɵɵelementEnd();
            i0.ɵɵrepeaterCreate(32, DuplicateDetectionResourceComponent_For_33_Template, 2, 2, "option", 16, i0.ɵɵrepeaterTrackByIdentity);
            i0.ɵɵelementEnd();
            i0.ɵɵelementStart(34, "div", 17)(35, "label", 18);
            i0.ɵɵtext(36, "Min Score");
            i0.ɵɵelementEnd();
            i0.ɵɵelementStart(37, "input", 19);
            i0.ɵɵtwoWayListener("ngModelChange", function DuplicateDetectionResourceComponent_Template_input_ngModelChange_37_listener($event) { i0.ɵɵtwoWayBindingSet(ctx.Filters.MinScore, $event) || (ctx.Filters.MinScore = $event); return $event; });
            i0.ɵɵlistener("ngModelChange", function DuplicateDetectionResourceComponent_Template_input_ngModelChange_37_listener() { return ctx.OnFilterChange(); });
            i0.ɵɵelementEnd()();
            i0.ɵɵelementStart(38, "div", 17)(39, "label", 18);
            i0.ɵɵtext(40, "Max Score");
            i0.ɵɵelementEnd();
            i0.ɵɵelementStart(41, "input", 19);
            i0.ɵɵtwoWayListener("ngModelChange", function DuplicateDetectionResourceComponent_Template_input_ngModelChange_41_listener($event) { i0.ɵɵtwoWayBindingSet(ctx.Filters.MaxScore, $event) || (ctx.Filters.MaxScore = $event); return $event; });
            i0.ɵɵlistener("ngModelChange", function DuplicateDetectionResourceComponent_Template_input_ngModelChange_41_listener() { return ctx.OnFilterChange(); });
            i0.ɵɵelementEnd()();
            i0.ɵɵelementStart(42, "div", 17)(43, "label", 18);
            i0.ɵɵtext(44, "From");
            i0.ɵɵelementEnd();
            i0.ɵɵelementStart(45, "input", 20);
            i0.ɵɵtwoWayListener("ngModelChange", function DuplicateDetectionResourceComponent_Template_input_ngModelChange_45_listener($event) { i0.ɵɵtwoWayBindingSet(ctx.Filters.DateFrom, $event) || (ctx.Filters.DateFrom = $event); return $event; });
            i0.ɵɵlistener("ngModelChange", function DuplicateDetectionResourceComponent_Template_input_ngModelChange_45_listener() { return ctx.OnFilterChange(); });
            i0.ɵɵelementEnd()();
            i0.ɵɵelementStart(46, "div", 17)(47, "label", 18);
            i0.ɵɵtext(48, "To");
            i0.ɵɵelementEnd();
            i0.ɵɵelementStart(49, "input", 20);
            i0.ɵɵtwoWayListener("ngModelChange", function DuplicateDetectionResourceComponent_Template_input_ngModelChange_49_listener($event) { i0.ɵɵtwoWayBindingSet(ctx.Filters.DateTo, $event) || (ctx.Filters.DateTo = $event); return $event; });
            i0.ɵɵlistener("ngModelChange", function DuplicateDetectionResourceComponent_Template_input_ngModelChange_49_listener() { return ctx.OnFilterChange(); });
            i0.ɵɵelementEnd()()();
            i0.ɵɵconditionalCreate(50, DuplicateDetectionResourceComponent_Conditional_50_Template, 3, 0, "button", 21);
            i0.ɵɵelementEnd();
            i0.ɵɵconditionalCreate(51, DuplicateDetectionResourceComponent_Conditional_51_Template, 2, 0, "div", 22)(52, DuplicateDetectionResourceComponent_Conditional_52_Template, 6, 0, "div", 23)(53, DuplicateDetectionResourceComponent_Conditional_53_Template, 34, 6, "div", 24);
            i0.ɵɵconditionalCreate(54, DuplicateDetectionResourceComponent_Conditional_54_Template, 2, 0, "div", 25);
            i0.ɵɵelementEnd();
        } if (rf & 2) {
            i0.ɵɵadvance(9);
            i0.ɵɵtextInterpolate(ctx.TotalGroupCount);
            i0.ɵɵadvance(5);
            i0.ɵɵtextInterpolate(ctx.PendingCount);
            i0.ɵɵadvance(5);
            i0.ɵɵtextInterpolate(ctx.ApprovedCount);
            i0.ɵɵadvance(5);
            i0.ɵɵtextInterpolate(ctx.RejectedCount);
            i0.ɵɵadvance(5);
            i0.ɵɵtwoWayProperty("ngModel", ctx.Filters.EntityName);
            i0.ɵɵadvance(3);
            i0.ɵɵrepeater(ctx.EntityNames);
            i0.ɵɵadvance(5);
            i0.ɵɵtwoWayProperty("ngModel", ctx.Filters.MinScore);
            i0.ɵɵadvance(4);
            i0.ɵɵtwoWayProperty("ngModel", ctx.Filters.MaxScore);
            i0.ɵɵadvance(4);
            i0.ɵɵtwoWayProperty("ngModel", ctx.Filters.DateFrom);
            i0.ɵɵadvance(4);
            i0.ɵɵtwoWayProperty("ngModel", ctx.Filters.DateTo);
            i0.ɵɵadvance();
            i0.ɵɵconditional(ctx.HasActiveFilters ? 50 : -1);
            i0.ɵɵadvance();
            i0.ɵɵconditional(ctx.IsLoading ? 51 : ctx.TotalGroupCount === 0 ? 52 : 53);
            i0.ɵɵadvance(3);
            i0.ɵɵconditional(ctx.IsSaving ? 54 : -1);
        } }, dependencies: [i1.NgSelectOption, i1.ɵNgSelectMultipleOption, i1.DefaultValueAccessor, i1.NumberValueAccessor, i1.SelectControlValueAccessor, i1.NgControlStatus, i1.MinValidator, i1.MaxValidator, i1.NgModel, i2.LoadingComponent], styles: ["\n\n\n\n\n\n.duplicate-detection-container[_ngcontent-%COMP%] {\n    display: flex;\n    flex-direction: column;\n    height: 100%;\n    padding: 16px 20px;\n    background: var(--mj-bg-page);\n    position: relative;\n    overflow: hidden;\n}\n\n\n\n\n.page-header[_ngcontent-%COMP%] {\n    display: flex;\n    align-items: center;\n    justify-content: space-between;\n    margin-bottom: 16px;\n    flex-shrink: 0;\n}\n\n.page-title[_ngcontent-%COMP%] {\n    margin: 0;\n    font-size: 20px;\n    font-weight: 600;\n    color: var(--mj-text-primary);\n    display: flex;\n    align-items: center;\n    gap: 8px;\n}\n\n.page-title[_ngcontent-%COMP%]   i[_ngcontent-%COMP%] {\n    color: var(--mj-brand-primary);\n}\n\n\n\n\n.kpi-strip[_ngcontent-%COMP%] {\n    display: flex;\n    gap: 12px;\n    margin-bottom: 16px;\n    flex-shrink: 0;\n}\n\n.kpi-card[_ngcontent-%COMP%] {\n    flex: 1;\n    display: flex;\n    flex-direction: column;\n    align-items: center;\n    padding: 12px 16px;\n    background: var(--mj-bg-surface);\n    border: 1px solid var(--mj-border-default);\n    border-radius: 8px;\n}\n\n.kpi-value[_ngcontent-%COMP%] {\n    font-size: 28px;\n    font-weight: 700;\n    color: var(--mj-text-primary);\n    line-height: 1.2;\n}\n\n.kpi-label[_ngcontent-%COMP%] {\n    font-size: 12px;\n    font-weight: 500;\n    color: var(--mj-text-muted);\n    text-transform: uppercase;\n    letter-spacing: 0.5px;\n    margin-top: 2px;\n}\n\n.kpi-pending[_ngcontent-%COMP%]   .kpi-value[_ngcontent-%COMP%] {\n    color: var(--mj-status-warning);\n}\n\n.kpi-approved[_ngcontent-%COMP%]   .kpi-value[_ngcontent-%COMP%] {\n    color: var(--mj-status-success);\n}\n\n.kpi-rejected[_ngcontent-%COMP%]   .kpi-value[_ngcontent-%COMP%] {\n    color: var(--mj-status-error);\n}\n\n\n\n\n.filter-bar[_ngcontent-%COMP%] {\n    display: flex;\n    align-items: center;\n    justify-content: space-between;\n    gap: 12px;\n    margin-bottom: 16px;\n    flex-shrink: 0;\n}\n\n.filter-group[_ngcontent-%COMP%] {\n    display: flex;\n    align-items: flex-end;\n    gap: 12px;\n    flex-wrap: wrap;\n}\n\n.filter-select[_ngcontent-%COMP%] {\n    height: 34px;\n    padding: 4px 10px;\n    border: 1px solid var(--mj-border-default);\n    border-radius: 6px;\n    background: var(--mj-bg-surface);\n    color: var(--mj-text-primary);\n    font-size: 13px;\n    outline: none;\n    min-width: 160px;\n}\n\n.filter-select[_ngcontent-%COMP%]:focus {\n    border-color: var(--mj-border-focus);\n    box-shadow: 0 0 0 2px color-mix(in srgb, var(--mj-brand-primary) 15%, transparent);\n}\n\n.filter-range[_ngcontent-%COMP%] {\n    display: flex;\n    flex-direction: column;\n    gap: 2px;\n}\n\n.filter-label[_ngcontent-%COMP%] {\n    font-size: 11px;\n    font-weight: 500;\n    color: var(--mj-text-muted);\n    text-transform: uppercase;\n    letter-spacing: 0.3px;\n}\n\n.filter-input[_ngcontent-%COMP%] {\n    height: 34px;\n    padding: 4px 8px;\n    border: 1px solid var(--mj-border-default);\n    border-radius: 6px;\n    background: var(--mj-bg-surface);\n    color: var(--mj-text-primary);\n    font-size: 13px;\n    outline: none;\n    width: 100px;\n}\n\n.filter-input[_ngcontent-%COMP%]:focus {\n    border-color: var(--mj-border-focus);\n    box-shadow: 0 0 0 2px color-mix(in srgb, var(--mj-brand-primary) 15%, transparent);\n}\n\n.clear-filters-btn[_ngcontent-%COMP%] {\n    display: flex;\n    align-items: center;\n    gap: 4px;\n    height: 34px;\n    padding: 0 12px;\n    border: 1px solid var(--mj-border-default);\n    border-radius: 6px;\n    background: var(--mj-bg-surface);\n    color: var(--mj-text-secondary);\n    font-size: 13px;\n    cursor: pointer;\n    white-space: nowrap;\n}\n\n.clear-filters-btn[_ngcontent-%COMP%]:hover {\n    background: var(--mj-bg-surface-hover);\n    color: var(--mj-text-primary);\n}\n\n\n\n\n.loading-container[_ngcontent-%COMP%] {\n    display: flex;\n    align-items: center;\n    justify-content: center;\n    flex: 1;\n    min-height: 200px;\n}\n\n.empty-state[_ngcontent-%COMP%] {\n    display: flex;\n    flex-direction: column;\n    align-items: center;\n    justify-content: center;\n    flex: 1;\n    min-height: 200px;\n    gap: 8px;\n}\n\n.empty-icon[_ngcontent-%COMP%] {\n    font-size: 48px;\n    color: var(--mj-text-disabled);\n}\n\n.empty-text[_ngcontent-%COMP%] {\n    font-size: 16px;\n    font-weight: 500;\n    color: var(--mj-text-secondary);\n    margin: 0;\n}\n\n.empty-subtext[_ngcontent-%COMP%] {\n    font-size: 13px;\n    color: var(--mj-text-muted);\n    margin: 0;\n}\n\n\n\n\n.kanban-board[_ngcontent-%COMP%] {\n    display: flex;\n    gap: 16px;\n    flex: 1;\n    min-height: 0;\n    overflow-x: auto;\n}\n\n.kanban-column[_ngcontent-%COMP%] {\n    flex: 1;\n    min-width: 280px;\n    display: flex;\n    flex-direction: column;\n    background: var(--mj-bg-surface-card);\n    border: 1px solid var(--mj-border-subtle);\n    border-radius: 10px;\n    overflow: hidden;\n}\n\n.column-header[_ngcontent-%COMP%] {\n    display: flex;\n    align-items: center;\n    gap: 8px;\n    padding: 12px 16px;\n    font-size: 14px;\n    font-weight: 600;\n    color: var(--mj-text-primary);\n    border-bottom: 1px solid var(--mj-border-subtle);\n    flex-shrink: 0;\n}\n\n.column-header-pending[_ngcontent-%COMP%] {\n    background: color-mix(in srgb, var(--mj-status-warning) 8%, var(--mj-bg-surface));\n}\n\n.column-header-pending[_ngcontent-%COMP%]   i[_ngcontent-%COMP%] {\n    color: var(--mj-status-warning);\n}\n\n.column-header-approved[_ngcontent-%COMP%] {\n    background: color-mix(in srgb, var(--mj-status-success) 8%, var(--mj-bg-surface));\n}\n\n.column-header-approved[_ngcontent-%COMP%]   i[_ngcontent-%COMP%] {\n    color: var(--mj-status-success);\n}\n\n.column-header-rejected[_ngcontent-%COMP%] {\n    background: color-mix(in srgb, var(--mj-status-error) 8%, var(--mj-bg-surface));\n}\n\n.column-header-rejected[_ngcontent-%COMP%]   i[_ngcontent-%COMP%] {\n    color: var(--mj-status-error);\n}\n\n.column-title[_ngcontent-%COMP%] {\n    flex: 1;\n}\n\n.column-count[_ngcontent-%COMP%] {\n    display: inline-flex;\n    align-items: center;\n    justify-content: center;\n    min-width: 24px;\n    height: 24px;\n    padding: 0 6px;\n    border-radius: 12px;\n    font-size: 12px;\n    font-weight: 600;\n    background: var(--mj-bg-surface-sunken);\n    color: var(--mj-text-secondary);\n}\n\n.column-body[_ngcontent-%COMP%] {\n    flex: 1;\n    overflow-y: auto;\n    padding: 12px;\n    display: flex;\n    flex-direction: column;\n    gap: 10px;\n}\n\n.column-empty[_ngcontent-%COMP%] {\n    display: flex;\n    flex-direction: column;\n    align-items: center;\n    gap: 6px;\n    padding: 32px 16px;\n    color: var(--mj-text-disabled);\n    font-size: 13px;\n}\n\n.column-empty[_ngcontent-%COMP%]   i[_ngcontent-%COMP%] {\n    font-size: 24px;\n}\n\n\n\n\n.kanban-card[_ngcontent-%COMP%] {\n    background: var(--mj-bg-surface);\n    border: 1px solid var(--mj-border-default);\n    border-radius: 8px;\n    overflow: hidden;\n    transition: box-shadow 0.15s ease, border-color 0.15s ease;\n}\n\n.kanban-card[_ngcontent-%COMP%]:hover {\n    border-color: var(--mj-border-strong);\n    box-shadow: 0 2px 8px color-mix(in srgb, var(--mj-text-primary) 8%, transparent);\n}\n\n.card-header[_ngcontent-%COMP%] {\n    display: flex;\n    align-items: center;\n    justify-content: space-between;\n    padding: 10px 12px;\n    border-bottom: 1px solid var(--mj-border-subtle);\n}\n\n.entity-badge[_ngcontent-%COMP%] {\n    display: inline-flex;\n    align-items: center;\n    padding: 2px 8px;\n    border-radius: 4px;\n    font-size: 11px;\n    font-weight: 600;\n    background: color-mix(in srgb, var(--mj-brand-primary) 10%, var(--mj-bg-surface));\n    color: var(--mj-brand-primary);\n    text-transform: uppercase;\n    letter-spacing: 0.3px;\n    max-width: 160px;\n    overflow: hidden;\n    text-overflow: ellipsis;\n    white-space: nowrap;\n}\n\n\n\n\n.score-indicator[_ngcontent-%COMP%] {\n    display: inline-flex;\n    align-items: center;\n    justify-content: center;\n    min-width: 40px;\n    padding: 2px 8px;\n    border-radius: 12px;\n    font-size: 12px;\n    font-weight: 700;\n}\n\n.score-high[_ngcontent-%COMP%] {\n    background: var(--mj-status-success-bg);\n    color: var(--mj-status-success-text);\n    border: 1px solid var(--mj-status-success-border);\n}\n\n.score-medium[_ngcontent-%COMP%] {\n    background: var(--mj-status-warning-bg);\n    color: var(--mj-status-warning-text);\n    border: 1px solid var(--mj-status-warning-border);\n}\n\n.score-low[_ngcontent-%COMP%] {\n    background: var(--mj-status-error-bg);\n    color: var(--mj-status-error-text);\n    border: 1px solid var(--mj-status-error-border);\n}\n\n.card-body[_ngcontent-%COMP%] {\n    padding: 10px 12px;\n    display: flex;\n    flex-direction: column;\n    gap: 6px;\n}\n\n.card-field[_ngcontent-%COMP%] {\n    display: flex;\n    align-items: center;\n    gap: 8px;\n    font-size: 13px;\n    color: var(--mj-text-secondary);\n}\n\n.field-icon[_ngcontent-%COMP%] {\n    width: 14px;\n    text-align: center;\n    font-size: 12px;\n    color: var(--mj-text-muted);\n    flex-shrink: 0;\n}\n\n.field-value[_ngcontent-%COMP%] {\n    overflow: hidden;\n    text-overflow: ellipsis;\n    white-space: nowrap;\n}\n\n.record-id[_ngcontent-%COMP%] {\n    font-family: monospace;\n    font-size: 12px;\n    max-width: 180px;\n}\n\n.card-actions[_ngcontent-%COMP%] {\n    display: flex;\n    gap: 8px;\n    padding: 10px 12px;\n    border-top: 1px solid var(--mj-border-subtle);\n}\n\n.action-btn[_ngcontent-%COMP%] {\n    flex: 1;\n    display: flex;\n    align-items: center;\n    justify-content: center;\n    gap: 4px;\n    height: 32px;\n    padding: 0 12px;\n    border: 1px solid var(--mj-border-default);\n    border-radius: 6px;\n    font-size: 12px;\n    font-weight: 600;\n    cursor: pointer;\n    transition: background 0.15s ease, border-color 0.15s ease;\n}\n\n.action-btn[_ngcontent-%COMP%]:disabled {\n    opacity: 0.5;\n    cursor: not-allowed;\n}\n\n.approve-btn[_ngcontent-%COMP%] {\n    background: color-mix(in srgb, var(--mj-status-success) 10%, var(--mj-bg-surface));\n    color: var(--mj-status-success-text);\n    border-color: var(--mj-status-success-border);\n}\n\n.approve-btn[_ngcontent-%COMP%]:hover:not(:disabled) {\n    background: color-mix(in srgb, var(--mj-status-success) 20%, var(--mj-bg-surface));\n}\n\n.reject-btn[_ngcontent-%COMP%] {\n    background: color-mix(in srgb, var(--mj-status-error) 10%, var(--mj-bg-surface));\n    color: var(--mj-status-error-text);\n    border-color: var(--mj-status-error-border);\n}\n\n.reject-btn[_ngcontent-%COMP%]:hover:not(:disabled) {\n    background: color-mix(in srgb, var(--mj-status-error) 20%, var(--mj-bg-surface));\n}\n\n\n\n\n@media (max-width: 768px) {\n    .kanban-board[_ngcontent-%COMP%] {\n        flex-direction: column;\n    }\n\n    .kanban-column[_ngcontent-%COMP%] {\n        min-width: auto;\n        max-height: 400px;\n    }\n}\n\n@media (max-width: 480px) {\n    .kpi-strip[_ngcontent-%COMP%] {\n        flex-direction: column;\n    }\n\n    .filter-bar[_ngcontent-%COMP%] {\n        flex-wrap: wrap;\n    }\n\n    .filter-group[_ngcontent-%COMP%] {\n        flex-direction: column;\n        align-items: stretch;\n        width: 100%;\n    }\n\n    .filter-select[_ngcontent-%COMP%] {\n        min-width: auto;\n        width: 100%;\n    }\n\n    .filter-input[_ngcontent-%COMP%] {\n        width: 100%;\n    }\n\n    .card-actions[_ngcontent-%COMP%] {\n        flex-direction: column;\n    }\n\n    .action-btn[_ngcontent-%COMP%] {\n        width: 100%;\n    }\n}\n\n\n\n\n.saving-overlay[_ngcontent-%COMP%] {\n    position: absolute;\n    top: 0;\n    left: 0;\n    right: 0;\n    bottom: 0;\n    display: flex;\n    align-items: center;\n    justify-content: center;\n    background: var(--mj-bg-overlay);\n    z-index: 10;\n    border-radius: 8px;\n}"] });
};
DuplicateDetectionResourceComponent = __decorate([
    RegisterClass(BaseResourceComponent, 'DuplicateDetectionResource')
], DuplicateDetectionResourceComponent);
export { DuplicateDetectionResourceComponent };
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(DuplicateDetectionResourceComponent, [{
        type: Component,
        args: [{ standalone: false, selector: 'app-duplicate-detection-resource', template: "<div class=\"duplicate-detection-container\">\n    <!-- Header -->\n    <div class=\"page-header\">\n        <div class=\"header-left\">\n            <h2 class=\"page-title\">\n                <i class=\"fa-solid fa-clone\"></i> Duplicate Detection\n            </h2>\n        </div>\n    </div>\n\n    <!-- KPI Strip -->\n    <div class=\"kpi-strip\">\n        <div class=\"kpi-card\">\n            <div class=\"kpi-value\">{{ TotalGroupCount }}</div>\n            <div class=\"kpi-label\">Total Groups</div>\n        </div>\n        <div class=\"kpi-card kpi-pending\">\n            <div class=\"kpi-value\">{{ PendingCount }}</div>\n            <div class=\"kpi-label\">Pending</div>\n        </div>\n        <div class=\"kpi-card kpi-approved\">\n            <div class=\"kpi-value\">{{ ApprovedCount }}</div>\n            <div class=\"kpi-label\">Approved</div>\n        </div>\n        <div class=\"kpi-card kpi-rejected\">\n            <div class=\"kpi-value\">{{ RejectedCount }}</div>\n            <div class=\"kpi-label\">Rejected</div>\n        </div>\n    </div>\n\n    <!-- Filter Bar -->\n    <div class=\"filter-bar\">\n        <div class=\"filter-group\">\n            <select class=\"filter-select\"\n                    [(ngModel)]=\"Filters.EntityName\"\n                    (ngModelChange)=\"OnFilterChange()\">\n                <option value=\"\">All Entities</option>\n                @for (name of EntityNames; track name) {\n                    <option [value]=\"name\">{{ name }}</option>\n                }\n            </select>\n\n            <div class=\"filter-range\">\n                <label class=\"filter-label\">Min Score</label>\n                <input type=\"number\"\n                       class=\"filter-input\"\n                       min=\"0\" max=\"1\" step=\"0.05\"\n                       [(ngModel)]=\"Filters.MinScore\"\n                       (ngModelChange)=\"OnFilterChange()\">\n            </div>\n\n            <div class=\"filter-range\">\n                <label class=\"filter-label\">Max Score</label>\n                <input type=\"number\"\n                       class=\"filter-input\"\n                       min=\"0\" max=\"1\" step=\"0.05\"\n                       [(ngModel)]=\"Filters.MaxScore\"\n                       (ngModelChange)=\"OnFilterChange()\">\n            </div>\n\n            <div class=\"filter-range\">\n                <label class=\"filter-label\">From</label>\n                <input type=\"date\"\n                       class=\"filter-input\"\n                       [(ngModel)]=\"Filters.DateFrom\"\n                       (ngModelChange)=\"OnFilterChange()\">\n            </div>\n\n            <div class=\"filter-range\">\n                <label class=\"filter-label\">To</label>\n                <input type=\"date\"\n                       class=\"filter-input\"\n                       [(ngModel)]=\"Filters.DateTo\"\n                       (ngModelChange)=\"OnFilterChange()\">\n            </div>\n        </div>\n\n        @if (HasActiveFilters) {\n            <button class=\"clear-filters-btn\" (click)=\"ClearFilters()\">\n                <i class=\"fa-solid fa-times\"></i> Clear Filters\n            </button>\n        }\n    </div>\n\n    <!-- Content -->\n    @if (IsLoading) {\n        <div class=\"loading-container\">\n            <mj-loading text=\"Loading duplicate detection results...\"></mj-loading>\n        </div>\n    } @else if (TotalGroupCount === 0) {\n        <div class=\"empty-state\">\n            <i class=\"fa-solid fa-clone empty-icon\"></i>\n            <p class=\"empty-text\">No duplicate detection results found.</p>\n            <p class=\"empty-subtext\">Run a duplicate detection scan to see results here.</p>\n        </div>\n    } @else {\n        <!-- Kanban Board -->\n        <div class=\"kanban-board\">\n            <!-- Pending Column -->\n            <div class=\"kanban-column\">\n                <div class=\"column-header column-header-pending\">\n                    <i class=\"fa-solid fa-clock\"></i>\n                    <span class=\"column-title\">Pending Review</span>\n                    <span class=\"column-count\">{{ PendingCount }}</span>\n                </div>\n                <div class=\"column-body\">\n                    @for (group of PendingGroups; track group.DetailId) {\n                        <div class=\"kanban-card\">\n                            <div class=\"card-header\">\n                                <span class=\"entity-badge\">{{ group.EntityName }}</span>\n                                <span class=\"score-indicator\" [class]=\"GetScoreClass(group.HighestScore)\">\n                                    {{ (group.HighestScore * 100).toFixed(0) }}%\n                                </span>\n                            </div>\n                            <div class=\"card-body\">\n                                <div class=\"card-field\">\n                                    <i class=\"fa-solid fa-fingerprint field-icon\"></i>\n                                    <span class=\"field-value record-id\" [title]=\"group.RecordId\">{{ group.RecordId }}</span>\n                                </div>\n                                <div class=\"card-field\">\n                                    <i class=\"fa-solid fa-layer-group field-icon\"></i>\n                                    <span class=\"field-value\">{{ group.MatchCount }} match{{ group.MatchCount !== 1 ? 'es' : '' }}</span>\n                                </div>\n                                <div class=\"card-field\">\n                                    <i class=\"fa-solid fa-calendar field-icon\"></i>\n                                    <span class=\"field-value\">{{ FormatDate(group.MatchedAt) }}</span>\n                                </div>\n                            </div>\n                            <div class=\"card-actions\">\n                                <button class=\"action-btn approve-btn\"\n                                        [disabled]=\"IsSaving\"\n                                        (click)=\"ApproveMatch(group)\">\n                                    <i class=\"fa-solid fa-check\"></i> Approve\n                                </button>\n                                <button class=\"action-btn reject-btn\"\n                                        [disabled]=\"IsSaving\"\n                                        (click)=\"RejectMatch(group)\">\n                                    <i class=\"fa-solid fa-times\"></i> Reject\n                                </button>\n                            </div>\n                        </div>\n                    }\n                    @if (PendingGroups.length === 0) {\n                        <div class=\"column-empty\">\n                            <i class=\"fa-solid fa-check-circle\"></i>\n                            <span>No pending items</span>\n                        </div>\n                    }\n                </div>\n            </div>\n\n            <!-- Approved Column -->\n            <div class=\"kanban-column\">\n                <div class=\"column-header column-header-approved\">\n                    <i class=\"fa-solid fa-check-circle\"></i>\n                    <span class=\"column-title\">Approved</span>\n                    <span class=\"column-count\">{{ ApprovedCount }}</span>\n                </div>\n                <div class=\"column-body\">\n                    @for (group of ApprovedGroups; track group.DetailId) {\n                        <div class=\"kanban-card\">\n                            <div class=\"card-header\">\n                                <span class=\"entity-badge\">{{ group.EntityName }}</span>\n                                <span class=\"score-indicator\" [class]=\"GetScoreClass(group.HighestScore)\">\n                                    {{ (group.HighestScore * 100).toFixed(0) }}%\n                                </span>\n                            </div>\n                            <div class=\"card-body\">\n                                <div class=\"card-field\">\n                                    <i class=\"fa-solid fa-fingerprint field-icon\"></i>\n                                    <span class=\"field-value record-id\" [title]=\"group.RecordId\">{{ group.RecordId }}</span>\n                                </div>\n                                <div class=\"card-field\">\n                                    <i class=\"fa-solid fa-layer-group field-icon\"></i>\n                                    <span class=\"field-value\">{{ group.MatchCount }} match{{ group.MatchCount !== 1 ? 'es' : '' }}</span>\n                                </div>\n                                <div class=\"card-field\">\n                                    <i class=\"fa-solid fa-calendar field-icon\"></i>\n                                    <span class=\"field-value\">{{ FormatDate(group.MatchedAt) }}</span>\n                                </div>\n                            </div>\n                        </div>\n                    }\n                    @if (ApprovedGroups.length === 0) {\n                        <div class=\"column-empty\">\n                            <i class=\"fa-solid fa-inbox\"></i>\n                            <span>No approved items</span>\n                        </div>\n                    }\n                </div>\n            </div>\n\n            <!-- Rejected Column -->\n            <div class=\"kanban-column\">\n                <div class=\"column-header column-header-rejected\">\n                    <i class=\"fa-solid fa-ban\"></i>\n                    <span class=\"column-title\">Rejected</span>\n                    <span class=\"column-count\">{{ RejectedCount }}</span>\n                </div>\n                <div class=\"column-body\">\n                    @for (group of RejectedGroups; track group.DetailId) {\n                        <div class=\"kanban-card\">\n                            <div class=\"card-header\">\n                                <span class=\"entity-badge\">{{ group.EntityName }}</span>\n                                <span class=\"score-indicator\" [class]=\"GetScoreClass(group.HighestScore)\">\n                                    {{ (group.HighestScore * 100).toFixed(0) }}%\n                                </span>\n                            </div>\n                            <div class=\"card-body\">\n                                <div class=\"card-field\">\n                                    <i class=\"fa-solid fa-fingerprint field-icon\"></i>\n                                    <span class=\"field-value record-id\" [title]=\"group.RecordId\">{{ group.RecordId }}</span>\n                                </div>\n                                <div class=\"card-field\">\n                                    <i class=\"fa-solid fa-layer-group field-icon\"></i>\n                                    <span class=\"field-value\">{{ group.MatchCount }} match{{ group.MatchCount !== 1 ? 'es' : '' }}</span>\n                                </div>\n                                <div class=\"card-field\">\n                                    <i class=\"fa-solid fa-calendar field-icon\"></i>\n                                    <span class=\"field-value\">{{ FormatDate(group.MatchedAt) }}</span>\n                                </div>\n                            </div>\n                        </div>\n                    }\n                    @if (RejectedGroups.length === 0) {\n                        <div class=\"column-empty\">\n                            <i class=\"fa-solid fa-inbox\"></i>\n                            <span>No rejected items</span>\n                        </div>\n                    }\n                </div>\n            </div>\n        </div>\n    }\n\n    <!-- Saving overlay -->\n    @if (IsSaving) {\n        <div class=\"saving-overlay\">\n            <mj-loading text=\"Saving...\" size=\"small\"></mj-loading>\n        </div>\n    }\n</div>\n", styles: ["/* ============================================================\n   Duplicate Detection Kanban Board - Resource Component Styles\n   All colors use MJ design tokens (--mj-*) exclusively.\n   ============================================================ */\n\n.duplicate-detection-container {\n    display: flex;\n    flex-direction: column;\n    height: 100%;\n    padding: 16px 20px;\n    background: var(--mj-bg-page);\n    position: relative;\n    overflow: hidden;\n}\n\n/* ---- Page Header ---- */\n\n.page-header {\n    display: flex;\n    align-items: center;\n    justify-content: space-between;\n    margin-bottom: 16px;\n    flex-shrink: 0;\n}\n\n.page-title {\n    margin: 0;\n    font-size: 20px;\n    font-weight: 600;\n    color: var(--mj-text-primary);\n    display: flex;\n    align-items: center;\n    gap: 8px;\n}\n\n.page-title i {\n    color: var(--mj-brand-primary);\n}\n\n/* ---- KPI Strip ---- */\n\n.kpi-strip {\n    display: flex;\n    gap: 12px;\n    margin-bottom: 16px;\n    flex-shrink: 0;\n}\n\n.kpi-card {\n    flex: 1;\n    display: flex;\n    flex-direction: column;\n    align-items: center;\n    padding: 12px 16px;\n    background: var(--mj-bg-surface);\n    border: 1px solid var(--mj-border-default);\n    border-radius: 8px;\n}\n\n.kpi-value {\n    font-size: 28px;\n    font-weight: 700;\n    color: var(--mj-text-primary);\n    line-height: 1.2;\n}\n\n.kpi-label {\n    font-size: 12px;\n    font-weight: 500;\n    color: var(--mj-text-muted);\n    text-transform: uppercase;\n    letter-spacing: 0.5px;\n    margin-top: 2px;\n}\n\n.kpi-pending .kpi-value {\n    color: var(--mj-status-warning);\n}\n\n.kpi-approved .kpi-value {\n    color: var(--mj-status-success);\n}\n\n.kpi-rejected .kpi-value {\n    color: var(--mj-status-error);\n}\n\n/* ---- Filter Bar ---- */\n\n.filter-bar {\n    display: flex;\n    align-items: center;\n    justify-content: space-between;\n    gap: 12px;\n    margin-bottom: 16px;\n    flex-shrink: 0;\n}\n\n.filter-group {\n    display: flex;\n    align-items: flex-end;\n    gap: 12px;\n    flex-wrap: wrap;\n}\n\n.filter-select {\n    height: 34px;\n    padding: 4px 10px;\n    border: 1px solid var(--mj-border-default);\n    border-radius: 6px;\n    background: var(--mj-bg-surface);\n    color: var(--mj-text-primary);\n    font-size: 13px;\n    outline: none;\n    min-width: 160px;\n}\n\n.filter-select:focus {\n    border-color: var(--mj-border-focus);\n    box-shadow: 0 0 0 2px color-mix(in srgb, var(--mj-brand-primary) 15%, transparent);\n}\n\n.filter-range {\n    display: flex;\n    flex-direction: column;\n    gap: 2px;\n}\n\n.filter-label {\n    font-size: 11px;\n    font-weight: 500;\n    color: var(--mj-text-muted);\n    text-transform: uppercase;\n    letter-spacing: 0.3px;\n}\n\n.filter-input {\n    height: 34px;\n    padding: 4px 8px;\n    border: 1px solid var(--mj-border-default);\n    border-radius: 6px;\n    background: var(--mj-bg-surface);\n    color: var(--mj-text-primary);\n    font-size: 13px;\n    outline: none;\n    width: 100px;\n}\n\n.filter-input:focus {\n    border-color: var(--mj-border-focus);\n    box-shadow: 0 0 0 2px color-mix(in srgb, var(--mj-brand-primary) 15%, transparent);\n}\n\n.clear-filters-btn {\n    display: flex;\n    align-items: center;\n    gap: 4px;\n    height: 34px;\n    padding: 0 12px;\n    border: 1px solid var(--mj-border-default);\n    border-radius: 6px;\n    background: var(--mj-bg-surface);\n    color: var(--mj-text-secondary);\n    font-size: 13px;\n    cursor: pointer;\n    white-space: nowrap;\n}\n\n.clear-filters-btn:hover {\n    background: var(--mj-bg-surface-hover);\n    color: var(--mj-text-primary);\n}\n\n/* ---- Loading & Empty States ---- */\n\n.loading-container {\n    display: flex;\n    align-items: center;\n    justify-content: center;\n    flex: 1;\n    min-height: 200px;\n}\n\n.empty-state {\n    display: flex;\n    flex-direction: column;\n    align-items: center;\n    justify-content: center;\n    flex: 1;\n    min-height: 200px;\n    gap: 8px;\n}\n\n.empty-icon {\n    font-size: 48px;\n    color: var(--mj-text-disabled);\n}\n\n.empty-text {\n    font-size: 16px;\n    font-weight: 500;\n    color: var(--mj-text-secondary);\n    margin: 0;\n}\n\n.empty-subtext {\n    font-size: 13px;\n    color: var(--mj-text-muted);\n    margin: 0;\n}\n\n/* ---- Kanban Board ---- */\n\n.kanban-board {\n    display: flex;\n    gap: 16px;\n    flex: 1;\n    min-height: 0;\n    overflow-x: auto;\n}\n\n.kanban-column {\n    flex: 1;\n    min-width: 280px;\n    display: flex;\n    flex-direction: column;\n    background: var(--mj-bg-surface-card);\n    border: 1px solid var(--mj-border-subtle);\n    border-radius: 10px;\n    overflow: hidden;\n}\n\n.column-header {\n    display: flex;\n    align-items: center;\n    gap: 8px;\n    padding: 12px 16px;\n    font-size: 14px;\n    font-weight: 600;\n    color: var(--mj-text-primary);\n    border-bottom: 1px solid var(--mj-border-subtle);\n    flex-shrink: 0;\n}\n\n.column-header-pending {\n    background: color-mix(in srgb, var(--mj-status-warning) 8%, var(--mj-bg-surface));\n}\n\n.column-header-pending i {\n    color: var(--mj-status-warning);\n}\n\n.column-header-approved {\n    background: color-mix(in srgb, var(--mj-status-success) 8%, var(--mj-bg-surface));\n}\n\n.column-header-approved i {\n    color: var(--mj-status-success);\n}\n\n.column-header-rejected {\n    background: color-mix(in srgb, var(--mj-status-error) 8%, var(--mj-bg-surface));\n}\n\n.column-header-rejected i {\n    color: var(--mj-status-error);\n}\n\n.column-title {\n    flex: 1;\n}\n\n.column-count {\n    display: inline-flex;\n    align-items: center;\n    justify-content: center;\n    min-width: 24px;\n    height: 24px;\n    padding: 0 6px;\n    border-radius: 12px;\n    font-size: 12px;\n    font-weight: 600;\n    background: var(--mj-bg-surface-sunken);\n    color: var(--mj-text-secondary);\n}\n\n.column-body {\n    flex: 1;\n    overflow-y: auto;\n    padding: 12px;\n    display: flex;\n    flex-direction: column;\n    gap: 10px;\n}\n\n.column-empty {\n    display: flex;\n    flex-direction: column;\n    align-items: center;\n    gap: 6px;\n    padding: 32px 16px;\n    color: var(--mj-text-disabled);\n    font-size: 13px;\n}\n\n.column-empty i {\n    font-size: 24px;\n}\n\n/* ---- Kanban Cards ---- */\n\n.kanban-card {\n    background: var(--mj-bg-surface);\n    border: 1px solid var(--mj-border-default);\n    border-radius: 8px;\n    overflow: hidden;\n    transition: box-shadow 0.15s ease, border-color 0.15s ease;\n}\n\n.kanban-card:hover {\n    border-color: var(--mj-border-strong);\n    box-shadow: 0 2px 8px color-mix(in srgb, var(--mj-text-primary) 8%, transparent);\n}\n\n.card-header {\n    display: flex;\n    align-items: center;\n    justify-content: space-between;\n    padding: 10px 12px;\n    border-bottom: 1px solid var(--mj-border-subtle);\n}\n\n.entity-badge {\n    display: inline-flex;\n    align-items: center;\n    padding: 2px 8px;\n    border-radius: 4px;\n    font-size: 11px;\n    font-weight: 600;\n    background: color-mix(in srgb, var(--mj-brand-primary) 10%, var(--mj-bg-surface));\n    color: var(--mj-brand-primary);\n    text-transform: uppercase;\n    letter-spacing: 0.3px;\n    max-width: 160px;\n    overflow: hidden;\n    text-overflow: ellipsis;\n    white-space: nowrap;\n}\n\n/* Score indicator colors */\n\n.score-indicator {\n    display: inline-flex;\n    align-items: center;\n    justify-content: center;\n    min-width: 40px;\n    padding: 2px 8px;\n    border-radius: 12px;\n    font-size: 12px;\n    font-weight: 700;\n}\n\n.score-high {\n    background: var(--mj-status-success-bg);\n    color: var(--mj-status-success-text);\n    border: 1px solid var(--mj-status-success-border);\n}\n\n.score-medium {\n    background: var(--mj-status-warning-bg);\n    color: var(--mj-status-warning-text);\n    border: 1px solid var(--mj-status-warning-border);\n}\n\n.score-low {\n    background: var(--mj-status-error-bg);\n    color: var(--mj-status-error-text);\n    border: 1px solid var(--mj-status-error-border);\n}\n\n.card-body {\n    padding: 10px 12px;\n    display: flex;\n    flex-direction: column;\n    gap: 6px;\n}\n\n.card-field {\n    display: flex;\n    align-items: center;\n    gap: 8px;\n    font-size: 13px;\n    color: var(--mj-text-secondary);\n}\n\n.field-icon {\n    width: 14px;\n    text-align: center;\n    font-size: 12px;\n    color: var(--mj-text-muted);\n    flex-shrink: 0;\n}\n\n.field-value {\n    overflow: hidden;\n    text-overflow: ellipsis;\n    white-space: nowrap;\n}\n\n.record-id {\n    font-family: monospace;\n    font-size: 12px;\n    max-width: 180px;\n}\n\n.card-actions {\n    display: flex;\n    gap: 8px;\n    padding: 10px 12px;\n    border-top: 1px solid var(--mj-border-subtle);\n}\n\n.action-btn {\n    flex: 1;\n    display: flex;\n    align-items: center;\n    justify-content: center;\n    gap: 4px;\n    height: 32px;\n    padding: 0 12px;\n    border: 1px solid var(--mj-border-default);\n    border-radius: 6px;\n    font-size: 12px;\n    font-weight: 600;\n    cursor: pointer;\n    transition: background 0.15s ease, border-color 0.15s ease;\n}\n\n.action-btn:disabled {\n    opacity: 0.5;\n    cursor: not-allowed;\n}\n\n.approve-btn {\n    background: color-mix(in srgb, var(--mj-status-success) 10%, var(--mj-bg-surface));\n    color: var(--mj-status-success-text);\n    border-color: var(--mj-status-success-border);\n}\n\n.approve-btn:hover:not(:disabled) {\n    background: color-mix(in srgb, var(--mj-status-success) 20%, var(--mj-bg-surface));\n}\n\n.reject-btn {\n    background: color-mix(in srgb, var(--mj-status-error) 10%, var(--mj-bg-surface));\n    color: var(--mj-status-error-text);\n    border-color: var(--mj-status-error-border);\n}\n\n.reject-btn:hover:not(:disabled) {\n    background: color-mix(in srgb, var(--mj-status-error) 20%, var(--mj-bg-surface));\n}\n\n/* ---- Responsive ---- */\n\n@media (max-width: 768px) {\n    .kanban-board {\n        flex-direction: column;\n    }\n\n    .kanban-column {\n        min-width: auto;\n        max-height: 400px;\n    }\n}\n\n@media (max-width: 480px) {\n    .kpi-strip {\n        flex-direction: column;\n    }\n\n    .filter-bar {\n        flex-wrap: wrap;\n    }\n\n    .filter-group {\n        flex-direction: column;\n        align-items: stretch;\n        width: 100%;\n    }\n\n    .filter-select {\n        min-width: auto;\n        width: 100%;\n    }\n\n    .filter-input {\n        width: 100%;\n    }\n\n    .card-actions {\n        flex-direction: column;\n    }\n\n    .action-btn {\n        width: 100%;\n    }\n}\n\n/* ---- Saving Overlay ---- */\n\n.saving-overlay {\n    position: absolute;\n    top: 0;\n    left: 0;\n    right: 0;\n    bottom: 0;\n    display: flex;\n    align-items: center;\n    justify-content: center;\n    background: var(--mj-bg-overlay);\n    z-index: 10;\n    border-radius: 8px;\n}\n"] }]
    }], null, { EmbeddedMode: [{
            type: Input
        }] }); })();
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(DuplicateDetectionResourceComponent, { className: "DuplicateDetectionResourceComponent", filePath: "src/AI/components/duplicates/duplicate-detection-resource.component.ts", lineNumber: 54 }); })();
export function LoadDuplicateDetectionResource() {
    // Prevents tree-shaking
}
//# sourceMappingURL=duplicate-detection-resource.component.js.map