/**
 * @module entity-review-panel.component
 * @description Read-only schema review table — mirrors the prototype table the
 * Database Designer agent produces in chat.  Used in wizard Step 4 (Review) and
 * in the Modify view's "Review Changes" tab.
 *
 * In `alter` mode, new or changed columns are highlighted in green and
 * existing-but-hidden columns are dimmed to show the diff.
 */
import { Component, Input, ChangeDetectionStrategy, } from '@angular/core';
import * as i0 from "@angular/core";
const _forTrack0 = ($index, $item) => $item.ColumnName;
function EntityReviewPanelComponent_Conditional_0_Conditional_8_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "span", 7);
    i0.ɵɵtext(1, "NEW");
    i0.ɵɵelementEnd();
} }
function EntityReviewPanelComponent_Conditional_0_Conditional_9_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "span", 8);
    i0.ɵɵtext(1, "ALTER");
    i0.ɵɵelementEnd();
} }
function EntityReviewPanelComponent_Conditional_0_Conditional_10_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "p", 9);
    i0.ɵɵtext(1);
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const ctx_r0 = i0.ɵɵnextContext(2);
    i0.ɵɵadvance();
    i0.ɵɵtextInterpolate(ctx_r0.TableDefinition.Description);
} }
function EntityReviewPanelComponent_Conditional_0_For_80_Conditional_4_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "span", 26);
    i0.ɵɵtext(1, "+NEW");
    i0.ɵɵelementEnd();
} }
function EntityReviewPanelComponent_Conditional_0_For_80_Conditional_9_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelement(0, "i", 18);
} }
function EntityReviewPanelComponent_Conditional_0_For_80_Conditional_10_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "span", 27);
    i0.ɵɵtext(1, "No");
    i0.ɵɵelementEnd();
} }
function EntityReviewPanelComponent_Conditional_0_For_80_Conditional_12_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "code", 20);
    i0.ɵɵtext(1);
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const row_r2 = i0.ɵɵnextContext().$implicit;
    i0.ɵɵadvance();
    i0.ɵɵtextInterpolate(row_r2.column.DefaultValue);
} }
function EntityReviewPanelComponent_Conditional_0_For_80_Conditional_13_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "span", 28);
    i0.ɵɵtext(1, "\u2014");
    i0.ɵɵelementEnd();
} }
function EntityReviewPanelComponent_Conditional_0_For_80_Conditional_15_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "span", 29);
    i0.ɵɵtext(1);
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const row_r2 = i0.ɵɵnextContext().$implicit;
    i0.ɵɵadvance();
    i0.ɵɵtextInterpolate(row_r2.column.Description);
} }
function EntityReviewPanelComponent_Conditional_0_For_80_Conditional_16_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "span", 28);
    i0.ɵɵtext(1, "\u2014");
    i0.ɵɵelementEnd();
} }
function EntityReviewPanelComponent_Conditional_0_For_80_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "tr")(1, "td", 13)(2, "code");
    i0.ɵɵtext(3);
    i0.ɵɵelementEnd();
    i0.ɵɵconditionalCreate(4, EntityReviewPanelComponent_Conditional_0_For_80_Conditional_4_Template, 2, 0, "span", 26);
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(5, "td", 16)(6, "code");
    i0.ɵɵtext(7);
    i0.ɵɵelementEnd()();
    i0.ɵɵelementStart(8, "td", 17);
    i0.ɵɵconditionalCreate(9, EntityReviewPanelComponent_Conditional_0_For_80_Conditional_9_Template, 1, 0, "i", 18)(10, EntityReviewPanelComponent_Conditional_0_For_80_Conditional_10_Template, 2, 0, "span", 27);
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(11, "td", 19);
    i0.ɵɵconditionalCreate(12, EntityReviewPanelComponent_Conditional_0_For_80_Conditional_12_Template, 2, 1, "code", 20)(13, EntityReviewPanelComponent_Conditional_0_For_80_Conditional_13_Template, 2, 0, "span", 28);
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(14, "td", 21);
    i0.ɵɵconditionalCreate(15, EntityReviewPanelComponent_Conditional_0_For_80_Conditional_15_Template, 2, 1, "span", 29)(16, EntityReviewPanelComponent_Conditional_0_For_80_Conditional_16_Template, 2, 0, "span", 28);
    i0.ɵɵelementEnd()();
} if (rf & 2) {
    const row_r2 = ctx.$implicit;
    i0.ɵɵclassProp("row-new", row_r2.diffState === "new");
    i0.ɵɵadvance(3);
    i0.ɵɵtextInterpolate(row_r2.column.Name);
    i0.ɵɵadvance();
    i0.ɵɵconditional(row_r2.diffState === "new" ? 4 : -1);
    i0.ɵɵadvance(3);
    i0.ɵɵtextInterpolate(row_r2.sqlType);
    i0.ɵɵadvance(2);
    i0.ɵɵconditional(!row_r2.column.IsNullable ? 9 : 10);
    i0.ɵɵadvance(3);
    i0.ɵɵconditional(row_r2.column.DefaultValue ? 12 : 13);
    i0.ɵɵadvance(3);
    i0.ɵɵconditional(row_r2.column.Description ? 15 : 16);
} }
function EntityReviewPanelComponent_Conditional_0_Conditional_81_For_6_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "li", 33)(1, "code");
    i0.ɵɵtext(2);
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(3, "span", 34);
    i0.ɵɵtext(4, "\u2192");
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(5, "code");
    i0.ɵɵtext(6);
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(7, "span", 35);
    i0.ɵɵtext(8);
    i0.ɵɵelementEnd()();
} if (rf & 2) {
    const fk_r3 = ctx.$implicit;
    i0.ɵɵadvance(2);
    i0.ɵɵtextInterpolate(fk_r3.ColumnName);
    i0.ɵɵadvance(4);
    i0.ɵɵtextInterpolate3("", fk_r3.ReferencedSchema, ".", fk_r3.ReferencedTable, ".", fk_r3.ReferencedColumn);
    i0.ɵɵadvance();
    i0.ɵɵclassProp("soft", fk_r3.IsSoft);
    i0.ɵɵadvance();
    i0.ɵɵtextInterpolate1(" ", fk_r3.IsSoft ? "soft FK" : "hard FK", " ");
} }
function EntityReviewPanelComponent_Conditional_0_Conditional_81_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "div", 25)(1, "h4", 30);
    i0.ɵɵelement(2, "i", 31);
    i0.ɵɵtext(3, " Relationships ");
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(4, "ul", 32);
    i0.ɵɵrepeaterCreate(5, EntityReviewPanelComponent_Conditional_0_Conditional_81_For_6_Template, 9, 7, "li", 33, _forTrack0);
    i0.ɵɵelementEnd()();
} if (rf & 2) {
    const ctx_r0 = i0.ɵɵnextContext(2);
    i0.ɵɵadvance(5);
    i0.ɵɵrepeater(ctx_r0.ForeignKeys);
} }
function EntityReviewPanelComponent_Conditional_0_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "div", 0)(1, "div", 2)(2, "div", 3);
    i0.ɵɵelement(3, "i", 4);
    i0.ɵɵelementStart(4, "span", 5);
    i0.ɵɵtext(5);
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(6, "span", 6);
    i0.ɵɵtext(7);
    i0.ɵɵelementEnd();
    i0.ɵɵconditionalCreate(8, EntityReviewPanelComponent_Conditional_0_Conditional_8_Template, 2, 0, "span", 7)(9, EntityReviewPanelComponent_Conditional_0_Conditional_9_Template, 2, 0, "span", 8);
    i0.ɵɵelementEnd();
    i0.ɵɵconditionalCreate(10, EntityReviewPanelComponent_Conditional_0_Conditional_10_Template, 2, 1, "p", 9);
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(11, "table", 10)(12, "thead")(13, "tr")(14, "th", 11);
    i0.ɵɵtext(15, "Column");
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(16, "th", 11);
    i0.ɵɵtext(17, "SQL Type");
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(18, "th", 11);
    i0.ɵɵtext(19, "Required");
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(20, "th", 11);
    i0.ɵɵtext(21, "Default");
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(22, "th", 11);
    i0.ɵɵtext(23, "Description");
    i0.ɵɵelementEnd()()();
    i0.ɵɵelementStart(24, "tbody")(25, "tr", 12)(26, "td", 13);
    i0.ɵɵelement(27, "i", 14);
    i0.ɵɵelementStart(28, "code");
    i0.ɵɵtext(29, "ID");
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(30, "span", 15);
    i0.ɵɵtext(31, "PK");
    i0.ɵɵelementEnd()();
    i0.ɵɵelementStart(32, "td", 16)(33, "code");
    i0.ɵɵtext(34, "UNIQUEIDENTIFIER");
    i0.ɵɵelementEnd()();
    i0.ɵɵelementStart(35, "td", 17);
    i0.ɵɵelement(36, "i", 18);
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(37, "td", 19)(38, "code", 20);
    i0.ɵɵtext(39, "NEWSEQUENTIALID()");
    i0.ɵɵelementEnd()();
    i0.ɵɵelementStart(40, "td", 21)(41, "span", 22);
    i0.ɵɵtext(42, "Primary key \u2014 always present");
    i0.ɵɵelementEnd()()();
    i0.ɵɵelementStart(43, "tr", 12)(44, "td", 13);
    i0.ɵɵelement(45, "i", 14);
    i0.ɵɵelementStart(46, "code");
    i0.ɵɵtext(47, "__mj_CreatedAt");
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(48, "span", 15);
    i0.ɵɵtext(49, "AUTO");
    i0.ɵɵelementEnd()();
    i0.ɵɵelementStart(50, "td", 16)(51, "code");
    i0.ɵɵtext(52, "DATETIMEOFFSET");
    i0.ɵɵelementEnd()();
    i0.ɵɵelementStart(53, "td", 17);
    i0.ɵɵelement(54, "i", 18);
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(55, "td", 19)(56, "code", 20);
    i0.ɵɵtext(57, "GETUTCDATE()");
    i0.ɵɵelementEnd()();
    i0.ɵɵelementStart(58, "td", 21)(59, "span", 22);
    i0.ɵɵtext(60, "Record creation timestamp");
    i0.ɵɵelementEnd()()();
    i0.ɵɵelementStart(61, "tr", 23)(62, "td", 13);
    i0.ɵɵelement(63, "i", 14);
    i0.ɵɵelementStart(64, "code");
    i0.ɵɵtext(65, "__mj_UpdatedAt");
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(66, "span", 15);
    i0.ɵɵtext(67, "AUTO");
    i0.ɵɵelementEnd()();
    i0.ɵɵelementStart(68, "td", 16)(69, "code");
    i0.ɵɵtext(70, "DATETIMEOFFSET");
    i0.ɵɵelementEnd()();
    i0.ɵɵelementStart(71, "td", 17);
    i0.ɵɵelement(72, "i", 18);
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(73, "td", 19)(74, "code", 20);
    i0.ɵɵtext(75, "GETUTCDATE()");
    i0.ɵɵelementEnd()();
    i0.ɵɵelementStart(76, "td", 21)(77, "span", 22);
    i0.ɵɵtext(78, "Last update timestamp");
    i0.ɵɵelementEnd()()();
    i0.ɵɵrepeaterCreate(79, EntityReviewPanelComponent_Conditional_0_For_80_Template, 17, 8, "tr", 24, i0.ɵɵcomponentInstance().TrackByName, true);
    i0.ɵɵelementEnd()();
    i0.ɵɵconditionalCreate(81, EntityReviewPanelComponent_Conditional_0_Conditional_81_Template, 7, 0, "div", 25);
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const ctx_r0 = i0.ɵɵnextContext();
    i0.ɵɵadvance(5);
    i0.ɵɵtextInterpolate(ctx_r0.TableDefinition.EntityName);
    i0.ɵɵadvance(2);
    i0.ɵɵtextInterpolate2(" ", ctx_r0.TableDefinition.SchemaName, ".", ctx_r0.TableDefinition.TableName, " ");
    i0.ɵɵadvance();
    i0.ɵɵconditional(ctx_r0.ModificationType === "create" ? 8 : 9);
    i0.ɵɵadvance(2);
    i0.ɵɵconditional(ctx_r0.TableDefinition.Description ? 10 : -1);
    i0.ɵɵadvance(69);
    i0.ɵɵrepeater(ctx_r0.Rows);
    i0.ɵɵadvance(2);
    i0.ɵɵconditional(ctx_r0.ForeignKeys.length > 0 ? 81 : -1);
} }
function EntityReviewPanelComponent_Conditional_1_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "div", 1);
    i0.ɵɵelement(1, "i", 36);
    i0.ɵɵelementStart(2, "p");
    i0.ɵɵtext(3, "No schema defined yet. Complete the previous steps to see a review.");
    i0.ɵɵelementEnd()();
} }
export class EntityReviewPanelComponent {
    /** The table / entity definition being reviewed. */
    set TableDefinition(v) {
        this._tableDefinition = v;
        this.rebuildRows();
    }
    get TableDefinition() { return this._tableDefinition; }
    _tableDefinition = null;
    /** 'create' (all rows are new) vs 'alter' (diff against existingColumns). */
    set ModificationType(v) {
        this._modificationType = v;
        this.rebuildRows();
    }
    get ModificationType() { return this._modificationType; }
    _modificationType = 'create';
    /** Columns already in the DB — used in alter mode to compute the diff. */
    set ExistingColumns(v) {
        this._existingColumns = v;
        this.rebuildRows();
    }
    get ExistingColumns() { return this._existingColumns; }
    _existingColumns = [];
    /** Prepared rows ready for the template. */
    Rows = [];
    /** Convenient accessor for the template. */
    get ForeignKeys() {
        return this._tableDefinition?.ForeignKeys ?? [];
    }
    TrackByName(_, row) {
        return row.column.Name;
    }
    // ─── Helpers ───────────────────────────────────────────────────────────
    rebuildRows() {
        if (!this._tableDefinition) {
            this.Rows = [];
            return;
        }
        const existingNames = new Set(this._existingColumns.map(c => c.Name.toLowerCase()));
        this.Rows = this._tableDefinition.Columns.map(col => ({
            column: col,
            diffState: this.diffState(col, existingNames),
            sqlType: this.resolveSqlType(col),
        }));
    }
    diffState(col, existingNames) {
        if (this._modificationType === 'create')
            return 'unchanged';
        return existingNames.has(col.Name.toLowerCase()) ? 'existing' : 'new';
    }
    /** Resolve a human-readable SQL type from the ColumnSpec. */
    resolveSqlType(col) {
        if (col.RawSqlType)
            return col.RawSqlType;
        switch (col.Type) {
            case 'string': return col.MaxLength ? `NVARCHAR(${col.MaxLength})` : 'NVARCHAR(200)';
            case 'text':
            case 'json': return 'NVARCHAR(MAX)';
            case 'integer': return 'INT';
            case 'bigint': return 'BIGINT';
            case 'decimal': return `DECIMAL(${col.Precision ?? 18},${col.Scale ?? 2})`;
            case 'boolean': return 'BIT';
            case 'datetime': return 'DATETIMEOFFSET';
            case 'date': return 'DATE';
            case 'time': return 'TIME';
            case 'uuid': return 'UNIQUEIDENTIFIER';
            case 'float': return 'FLOAT';
            default: return col.Type ?? 'NVARCHAR(200)';
        }
    }
    static ɵfac = function EntityReviewPanelComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || EntityReviewPanelComponent)(); };
    static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: EntityReviewPanelComponent, selectors: [["mj-database-review-panel"]], inputs: { TableDefinition: "TableDefinition", ModificationType: "ModificationType", ExistingColumns: "ExistingColumns" }, standalone: false, decls: 2, vars: 1, consts: [[1, "review-panel"], [1, "review-empty"], [1, "review-header"], [1, "entity-badge"], [1, "fa-solid", "fa-table-cells-large"], [1, "entity-name"], [1, "schema-path"], [1, "mode-tag", "new"], [1, "mode-tag", "alter"], [1, "entity-description"], ["aria-label", "Column definitions", 1, "review-table"], ["scope", "col"], [1, "auto-col-row"], [1, "col-name"], ["title", "Auto-managed", 1, "fa-solid", "fa-lock-keyhole", "auto-lock"], [1, "auto-badge"], [1, "col-type"], [1, "col-req"], ["title", "Required", 1, "fa-solid", "fa-check", "req-yes"], [1, "col-default"], [1, "default-val"], [1, "col-desc"], [1, "desc-text", "auto-desc"], [1, "auto-col-row", "auto-col-divider"], [3, "row-new"], [1, "fk-section"], ["title", "New column", 1, "diff-badge", "new"], [1, "req-no"], [1, "empty-val"], [1, "desc-text"], [1, "fk-title"], [1, "fa-solid", "fa-link"], [1, "fk-list"], [1, "fk-item"], [1, "fk-arrow"], [1, "fk-type"], [1, "fa-regular", "fa-rectangle-list"]], template: function EntityReviewPanelComponent_Template(rf, ctx) { if (rf & 1) {
            i0.ɵɵconditionalCreate(0, EntityReviewPanelComponent_Conditional_0_Template, 82, 6, "div", 0)(1, EntityReviewPanelComponent_Conditional_1_Template, 4, 0, "div", 1);
        } if (rf & 2) {
            i0.ɵɵconditional(ctx.TableDefinition ? 0 : 1);
        } }, styles: [".review-panel[_ngcontent-%COMP%] {\n  display: flex;\n  flex-direction: column;\n  gap: 0;\n}\n\n\n\n\n.review-header[_ngcontent-%COMP%] {\n  padding: 16px 20px;\n  border-bottom: 1px solid var(--mj-border-subtle);\n  background: var(--mj-bg-surface-card);\n}\n\n.entity-badge[_ngcontent-%COMP%] {\n  display: flex;\n  align-items: center;\n  gap: 10px;\n  flex-wrap: wrap;\n}\n\n.entity-badge[_ngcontent-%COMP%]   i[_ngcontent-%COMP%] {\n  color: var(--mj-brand-primary);\n}\n\n.entity-name[_ngcontent-%COMP%] {\n  font-weight: 700;\n  font-size: 1rem;\n  color: var(--mj-text-primary);\n}\n\n.schema-path[_ngcontent-%COMP%] {\n  font-family: monospace;\n  font-size: 0.8rem;\n  color: var(--mj-text-secondary);\n}\n\n.mode-tag[_ngcontent-%COMP%] {\n  display: inline-block;\n  font-size: 0.7rem;\n  font-weight: 700;\n  text-transform: uppercase;\n  letter-spacing: 0.06em;\n  padding: 2px 7px;\n  border-radius: 10px;\n}\n\n.mode-tag.new[_ngcontent-%COMP%] {\n  background: color-mix(in srgb, var(--mj-status-success) 15%, var(--mj-bg-surface));\n  color: var(--mj-status-success);\n  border: 1px solid color-mix(in srgb, var(--mj-status-success) 30%, transparent);\n}\n\n.mode-tag.alter[_ngcontent-%COMP%] {\n  background: color-mix(in srgb, var(--mj-status-warning) 15%, var(--mj-bg-surface));\n  color: var(--mj-status-warning-text);\n  border: 1px solid color-mix(in srgb, var(--mj-status-warning) 30%, transparent);\n}\n\n.entity-description[_ngcontent-%COMP%] {\n  margin: 8px 0 4px;\n  font-size: 0.875rem;\n  color: var(--mj-text-secondary);\n  line-height: 1.5;\n}\n\n\n\n\n.review-table[_ngcontent-%COMP%] {\n  width: 100%;\n  border-collapse: collapse;\n  font-size: 0.875rem;\n}\n\n.review-table[_ngcontent-%COMP%]   thead[_ngcontent-%COMP%]   tr[_ngcontent-%COMP%] {\n  border-bottom: 2px solid var(--mj-border-default);\n}\n\n.review-table[_ngcontent-%COMP%]   th[_ngcontent-%COMP%] {\n  padding: 10px 14px;\n  text-align: left;\n  font-weight: 600;\n  color: var(--mj-text-secondary);\n  font-size: 0.8rem;\n  text-transform: uppercase;\n  letter-spacing: 0.03em;\n}\n\n.review-table[_ngcontent-%COMP%]   td[_ngcontent-%COMP%] {\n  padding: 10px 14px;\n  border-bottom: 1px solid var(--mj-border-subtle);\n  vertical-align: middle;\n  color: var(--mj-text-primary);\n}\n\n.review-table[_ngcontent-%COMP%]   tr.row-new[_ngcontent-%COMP%]   td[_ngcontent-%COMP%] {\n  background: var(--mj-status-success-bg);\n}\n\n\n\n\n.col-name[_ngcontent-%COMP%]   code[_ngcontent-%COMP%], \n.col-type[_ngcontent-%COMP%]   code[_ngcontent-%COMP%] {\n  font-family: monospace;\n  font-size: 0.8125rem;\n  background: var(--mj-bg-surface-sunken);\n  padding: 2px 6px;\n  border-radius: 3px;\n  word-break: break-all;\n  overflow-wrap: break-word;\n}\n\n.diff-badge[_ngcontent-%COMP%] {\n  display: inline-block;\n  font-size: 0.65rem;\n  font-weight: 700;\n  text-transform: uppercase;\n  padding: 1px 5px;\n  border-radius: 3px;\n  margin-left: 6px;\n  vertical-align: middle;\n}\n\n.diff-badge.new[_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.req-yes[_ngcontent-%COMP%] {\n  color: var(--mj-status-success);\n}\n\n.req-no[_ngcontent-%COMP%] {\n  color: var(--mj-text-muted);\n}\n\n.default-val[_ngcontent-%COMP%] {\n  font-family: monospace;\n  font-size: 0.8125rem;\n  color: var(--mj-text-secondary);\n}\n\n.empty-val[_ngcontent-%COMP%] {\n  color: var(--mj-text-muted);\n}\n\n.desc-text[_ngcontent-%COMP%] {\n  color: var(--mj-text-secondary);\n  font-size: 0.875rem;\n}\n\n\n\n\n.auto-col-row[_ngcontent-%COMP%]   td[_ngcontent-%COMP%] {\n  background: var(--mj-bg-surface-sunken);\n  opacity: 0.75;\n}\n\n.auto-col-divider[_ngcontent-%COMP%]   td[_ngcontent-%COMP%] {\n  border-bottom: 2px solid var(--mj-border-default);\n}\n\n.auto-lock[_ngcontent-%COMP%] {\n  font-size: 0.7rem;\n  color: var(--mj-text-muted);\n  margin-right: 5px;\n}\n\n.auto-badge[_ngcontent-%COMP%] {\n  display: inline-block;\n  font-size: 0.6rem;\n  font-weight: 700;\n  text-transform: uppercase;\n  letter-spacing: 0.05em;\n  padding: 1px 5px;\n  border-radius: 3px;\n  margin-left: 5px;\n  vertical-align: middle;\n  background: var(--mj-bg-surface-card);\n  color: var(--mj-text-muted);\n  border: 1px solid var(--mj-border-default);\n}\n\n.auto-desc[_ngcontent-%COMP%] {\n  font-style: italic;\n  color: var(--mj-text-muted);\n}\n\n\n\n\n.fk-section[_ngcontent-%COMP%] {\n  padding: 16px 20px;\n  border-top: 1px solid var(--mj-border-subtle);\n}\n\n.fk-title[_ngcontent-%COMP%] {\n  margin: 0 0 10px;\n  font-size: 0.875rem;\n  font-weight: 600;\n  color: var(--mj-text-secondary);\n  display: flex;\n  align-items: center;\n  gap: 7px;\n  text-transform: uppercase;\n  letter-spacing: 0.04em;\n}\n\n.fk-title[_ngcontent-%COMP%]   i[_ngcontent-%COMP%] {\n  color: var(--mj-text-muted);\n}\n\n.fk-list[_ngcontent-%COMP%] {\n  list-style: none;\n  margin: 0;\n  padding: 0;\n  display: flex;\n  flex-direction: column;\n  gap: 8px;\n}\n\n.fk-item[_ngcontent-%COMP%] {\n  display: flex;\n  align-items: center;\n  gap: 8px;\n  font-size: 0.875rem;\n  color: var(--mj-text-primary);\n}\n\n.fk-item[_ngcontent-%COMP%]   code[_ngcontent-%COMP%] {\n  font-family: monospace;\n  font-size: 0.8125rem;\n  background: var(--mj-bg-surface-sunken);\n  padding: 2px 6px;\n  border-radius: 3px;\n}\n\n.fk-arrow[_ngcontent-%COMP%] {\n  color: var(--mj-text-muted);\n}\n\n.fk-type[_ngcontent-%COMP%] {\n  font-size: 0.75rem;\n  font-weight: 600;\n  padding: 2px 8px;\n  border-radius: 4px;\n  text-transform: uppercase;\n  letter-spacing: 0.04em;\n  background: color-mix(in srgb, var(--mj-brand-primary) 10%, var(--mj-bg-surface));\n  color: var(--mj-brand-primary);\n}\n\n.fk-type.soft[_ngcontent-%COMP%] {\n  background: var(--mj-bg-surface-sunken);\n  color: var(--mj-text-secondary);\n}\n\n\n\n\n.review-empty[_ngcontent-%COMP%] {\n  display: flex;\n  flex-direction: column;\n  align-items: center;\n  justify-content: center;\n  gap: 12px;\n  padding: 48px 24px;\n  text-align: center;\n  color: var(--mj-text-muted);\n}\n\n.review-empty[_ngcontent-%COMP%]   i[_ngcontent-%COMP%] {\n  font-size: 3rem;\n}\n\n.review-empty[_ngcontent-%COMP%]   p[_ngcontent-%COMP%] {\n  margin: 0;\n  font-size: 0.9rem;\n}"], changeDetection: 0 });
}
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(EntityReviewPanelComponent, [{
        type: Component,
        args: [{ standalone: false, selector: 'mj-database-review-panel', changeDetection: ChangeDetectionStrategy.OnPush, template: "@if (TableDefinition) {\n  <div class=\"review-panel\">\n\n    <!-- \u2500\u2500 Entity header \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 -->\n    <div class=\"review-header\">\n      <div class=\"entity-badge\">\n        <i class=\"fa-solid fa-table-cells-large\"></i>\n        <span class=\"entity-name\">{{ TableDefinition.EntityName }}</span>\n        <span class=\"schema-path\">\n          {{ TableDefinition.SchemaName }}.{{ TableDefinition.TableName }}\n        </span>\n        @if (ModificationType === 'create') {\n          <span class=\"mode-tag new\">NEW</span>\n        } @else {\n          <span class=\"mode-tag alter\">ALTER</span>\n        }\n      </div>\n      @if (TableDefinition.Description) {\n        <p class=\"entity-description\">{{ TableDefinition.Description }}</p>\n      }\n    </div>\n\n    <!-- \u2500\u2500 Column table \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 -->\n    <table class=\"review-table\" aria-label=\"Column definitions\">\n      <thead>\n        <tr>\n          <th scope=\"col\">Column</th>\n          <th scope=\"col\">SQL Type</th>\n          <th scope=\"col\">Required</th>\n          <th scope=\"col\">Default</th>\n          <th scope=\"col\">Description</th>\n        </tr>\n      </thead>\n      <tbody>\n        <!-- \u2500\u2500 Auto-managed columns \u2014 always injected, cannot be removed \u2500\u2500 -->\n        <tr class=\"auto-col-row\">\n          <td class=\"col-name\">\n            <i class=\"fa-solid fa-lock-keyhole auto-lock\" title=\"Auto-managed\"></i>\n            <code>ID</code>\n            <span class=\"auto-badge\">PK</span>\n          </td>\n          <td class=\"col-type\"><code>UNIQUEIDENTIFIER</code></td>\n          <td class=\"col-req\"><i class=\"fa-solid fa-check req-yes\" title=\"Required\"></i></td>\n          <td class=\"col-default\"><code class=\"default-val\">NEWSEQUENTIALID()</code></td>\n          <td class=\"col-desc\"><span class=\"desc-text auto-desc\">Primary key \u2014 always present</span></td>\n        </tr>\n        <tr class=\"auto-col-row\">\n          <td class=\"col-name\">\n            <i class=\"fa-solid fa-lock-keyhole auto-lock\" title=\"Auto-managed\"></i>\n            <code>__mj_CreatedAt</code>\n            <span class=\"auto-badge\">AUTO</span>\n          </td>\n          <td class=\"col-type\"><code>DATETIMEOFFSET</code></td>\n          <td class=\"col-req\"><i class=\"fa-solid fa-check req-yes\" title=\"Required\"></i></td>\n          <td class=\"col-default\"><code class=\"default-val\">GETUTCDATE()</code></td>\n          <td class=\"col-desc\"><span class=\"desc-text auto-desc\">Record creation timestamp</span></td>\n        </tr>\n        <tr class=\"auto-col-row auto-col-divider\">\n          <td class=\"col-name\">\n            <i class=\"fa-solid fa-lock-keyhole auto-lock\" title=\"Auto-managed\"></i>\n            <code>__mj_UpdatedAt</code>\n            <span class=\"auto-badge\">AUTO</span>\n          </td>\n          <td class=\"col-type\"><code>DATETIMEOFFSET</code></td>\n          <td class=\"col-req\"><i class=\"fa-solid fa-check req-yes\" title=\"Required\"></i></td>\n          <td class=\"col-default\"><code class=\"default-val\">GETUTCDATE()</code></td>\n          <td class=\"col-desc\"><span class=\"desc-text auto-desc\">Last update timestamp</span></td>\n        </tr>\n\n        <!-- \u2500\u2500 User-defined columns \u2500\u2500 -->\n        @for (row of Rows; track TrackByName($index, row)) {\n          <tr [class.row-new]=\"row.diffState === 'new'\">\n            <td class=\"col-name\">\n              <code>{{ row.column.Name }}</code>\n              @if (row.diffState === 'new') {\n                <span class=\"diff-badge new\" title=\"New column\">+NEW</span>\n              }\n            </td>\n            <td class=\"col-type\">\n              <code>{{ row.sqlType }}</code>\n            </td>\n            <td class=\"col-req\">\n              @if (!row.column.IsNullable) {\n                <i class=\"fa-solid fa-check req-yes\" title=\"Required\"></i>\n              } @else {\n                <span class=\"req-no\">No</span>\n              }\n            </td>\n            <td class=\"col-default\">\n              @if (row.column.DefaultValue) {\n                <code class=\"default-val\">{{ row.column.DefaultValue }}</code>\n              } @else {\n                <span class=\"empty-val\">\u2014</span>\n              }\n            </td>\n            <td class=\"col-desc\">\n              @if (row.column.Description) {\n                <span class=\"desc-text\">{{ row.column.Description }}</span>\n              } @else {\n                <span class=\"empty-val\">\u2014</span>\n              }\n            </td>\n          </tr>\n        }\n      </tbody>\n    </table>\n\n    <!-- \u2500\u2500 Foreign key section \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 -->\n    @if (ForeignKeys.length > 0) {\n      <div class=\"fk-section\">\n        <h4 class=\"fk-title\">\n          <i class=\"fa-solid fa-link\"></i>\n          Relationships\n        </h4>\n        <ul class=\"fk-list\">\n          @for (fk of ForeignKeys; track fk.ColumnName) {\n            <li class=\"fk-item\">\n              <code>{{ fk.ColumnName }}</code>\n              <span class=\"fk-arrow\">\u2192</span>\n              <code>{{ fk.ReferencedSchema }}.{{ fk.ReferencedTable }}.{{ fk.ReferencedColumn }}</code>\n              <span class=\"fk-type\" [class.soft]=\"fk.IsSoft\">\n                {{ fk.IsSoft ? 'soft FK' : 'hard FK' }}\n              </span>\n            </li>\n          }\n        </ul>\n      </div>\n    }\n\n  </div>\n} @else {\n  <div class=\"review-empty\">\n    <i class=\"fa-regular fa-rectangle-list\"></i>\n    <p>No schema defined yet. Complete the previous steps to see a review.</p>\n  </div>\n}\n", styles: [".review-panel {\n  display: flex;\n  flex-direction: column;\n  gap: 0;\n}\n\n/* \u2500\u2500 Header \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */\n\n.review-header {\n  padding: 16px 20px;\n  border-bottom: 1px solid var(--mj-border-subtle);\n  background: var(--mj-bg-surface-card);\n}\n\n.entity-badge {\n  display: flex;\n  align-items: center;\n  gap: 10px;\n  flex-wrap: wrap;\n}\n\n.entity-badge i {\n  color: var(--mj-brand-primary);\n}\n\n.entity-name {\n  font-weight: 700;\n  font-size: 1rem;\n  color: var(--mj-text-primary);\n}\n\n.schema-path {\n  font-family: monospace;\n  font-size: 0.8rem;\n  color: var(--mj-text-secondary);\n}\n\n.mode-tag {\n  display: inline-block;\n  font-size: 0.7rem;\n  font-weight: 700;\n  text-transform: uppercase;\n  letter-spacing: 0.06em;\n  padding: 2px 7px;\n  border-radius: 10px;\n}\n\n.mode-tag.new {\n  background: color-mix(in srgb, var(--mj-status-success) 15%, var(--mj-bg-surface));\n  color: var(--mj-status-success);\n  border: 1px solid color-mix(in srgb, var(--mj-status-success) 30%, transparent);\n}\n\n.mode-tag.alter {\n  background: color-mix(in srgb, var(--mj-status-warning) 15%, var(--mj-bg-surface));\n  color: var(--mj-status-warning-text);\n  border: 1px solid color-mix(in srgb, var(--mj-status-warning) 30%, transparent);\n}\n\n.entity-description {\n  margin: 8px 0 4px;\n  font-size: 0.875rem;\n  color: var(--mj-text-secondary);\n  line-height: 1.5;\n}\n\n/* \u2500\u2500 Review table \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */\n\n.review-table {\n  width: 100%;\n  border-collapse: collapse;\n  font-size: 0.875rem;\n}\n\n.review-table thead tr {\n  border-bottom: 2px solid var(--mj-border-default);\n}\n\n.review-table th {\n  padding: 10px 14px;\n  text-align: left;\n  font-weight: 600;\n  color: var(--mj-text-secondary);\n  font-size: 0.8rem;\n  text-transform: uppercase;\n  letter-spacing: 0.03em;\n}\n\n.review-table td {\n  padding: 10px 14px;\n  border-bottom: 1px solid var(--mj-border-subtle);\n  vertical-align: middle;\n  color: var(--mj-text-primary);\n}\n\n.review-table tr.row-new td {\n  background: var(--mj-status-success-bg);\n}\n\n/* \u2500\u2500 Cell content \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */\n\n.col-name code,\n.col-type code {\n  font-family: monospace;\n  font-size: 0.8125rem;\n  background: var(--mj-bg-surface-sunken);\n  padding: 2px 6px;\n  border-radius: 3px;\n  word-break: break-all;\n  overflow-wrap: break-word;\n}\n\n.diff-badge {\n  display: inline-block;\n  font-size: 0.65rem;\n  font-weight: 700;\n  text-transform: uppercase;\n  padding: 1px 5px;\n  border-radius: 3px;\n  margin-left: 6px;\n  vertical-align: middle;\n}\n\n.diff-badge.new {\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.req-yes {\n  color: var(--mj-status-success);\n}\n\n.req-no {\n  color: var(--mj-text-muted);\n}\n\n.default-val {\n  font-family: monospace;\n  font-size: 0.8125rem;\n  color: var(--mj-text-secondary);\n}\n\n.empty-val {\n  color: var(--mj-text-muted);\n}\n\n.desc-text {\n  color: var(--mj-text-secondary);\n  font-size: 0.875rem;\n}\n\n/* \u2500\u2500 Auto-managed columns \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */\n\n.auto-col-row td {\n  background: var(--mj-bg-surface-sunken);\n  opacity: 0.75;\n}\n\n.auto-col-divider td {\n  border-bottom: 2px solid var(--mj-border-default);\n}\n\n.auto-lock {\n  font-size: 0.7rem;\n  color: var(--mj-text-muted);\n  margin-right: 5px;\n}\n\n.auto-badge {\n  display: inline-block;\n  font-size: 0.6rem;\n  font-weight: 700;\n  text-transform: uppercase;\n  letter-spacing: 0.05em;\n  padding: 1px 5px;\n  border-radius: 3px;\n  margin-left: 5px;\n  vertical-align: middle;\n  background: var(--mj-bg-surface-card);\n  color: var(--mj-text-muted);\n  border: 1px solid var(--mj-border-default);\n}\n\n.auto-desc {\n  font-style: italic;\n  color: var(--mj-text-muted);\n}\n\n/* \u2500\u2500 Foreign keys \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */\n\n.fk-section {\n  padding: 16px 20px;\n  border-top: 1px solid var(--mj-border-subtle);\n}\n\n.fk-title {\n  margin: 0 0 10px;\n  font-size: 0.875rem;\n  font-weight: 600;\n  color: var(--mj-text-secondary);\n  display: flex;\n  align-items: center;\n  gap: 7px;\n  text-transform: uppercase;\n  letter-spacing: 0.04em;\n}\n\n.fk-title i {\n  color: var(--mj-text-muted);\n}\n\n.fk-list {\n  list-style: none;\n  margin: 0;\n  padding: 0;\n  display: flex;\n  flex-direction: column;\n  gap: 8px;\n}\n\n.fk-item {\n  display: flex;\n  align-items: center;\n  gap: 8px;\n  font-size: 0.875rem;\n  color: var(--mj-text-primary);\n}\n\n.fk-item code {\n  font-family: monospace;\n  font-size: 0.8125rem;\n  background: var(--mj-bg-surface-sunken);\n  padding: 2px 6px;\n  border-radius: 3px;\n}\n\n.fk-arrow {\n  color: var(--mj-text-muted);\n}\n\n.fk-type {\n  font-size: 0.75rem;\n  font-weight: 600;\n  padding: 2px 8px;\n  border-radius: 4px;\n  text-transform: uppercase;\n  letter-spacing: 0.04em;\n  background: color-mix(in srgb, var(--mj-brand-primary) 10%, var(--mj-bg-surface));\n  color: var(--mj-brand-primary);\n}\n\n.fk-type.soft {\n  background: var(--mj-bg-surface-sunken);\n  color: var(--mj-text-secondary);\n}\n\n/* \u2500\u2500 Empty state \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */\n\n.review-empty {\n  display: flex;\n  flex-direction: column;\n  align-items: center;\n  justify-content: center;\n  gap: 12px;\n  padding: 48px 24px;\n  text-align: center;\n  color: var(--mj-text-muted);\n}\n\n.review-empty i {\n  font-size: 3rem;\n}\n\n.review-empty p {\n  margin: 0;\n  font-size: 0.9rem;\n}\n"] }]
    }], null, { TableDefinition: [{
            type: Input
        }], ModificationType: [{
            type: Input
        }], ExistingColumns: [{
            type: Input
        }] }); })();
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(EntityReviewPanelComponent, { className: "EntityReviewPanelComponent", filePath: "src/DatabaseDesigner/components/shared/entity-review-panel.component.ts", lineNumber: 31 }); })();
//# sourceMappingURL=entity-review-panel.component.js.map