/**
 * @fileoverview Classify · Content Item Detail slide-in dialog.
 *
 * Presentational slide-in panel showing a content item's details, tags, text,
 * metadata, and actions. Opened from multiple tabs, so it is rendered by the
 * HOST (the data orchestrator), which builds the `ContentItemDetail` and toggles
 * visibility. This component is purely presentational: data DOWN via `[Item]` /
 * `[Show]`, intents UP via `(Closed)` / `(OpenRecordRequested)`.
 */
import { Component, Input, Output, EventEmitter } from '@angular/core';
import { BaseAngularComponent } from '@memberjunction/ng-base-types';
import { formatWeight, tagFontSize } from '../shared/classify.format';
import * as i0 from "@angular/core";
const _forTrack0 = ($index, $item) => $item.Tag;
function ClassifyItemDetailDialogComponent_Conditional_0_Conditional_15_Conditional_2_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "span", 23);
    i0.ɵɵelement(1, "i", 24);
    i0.ɵɵtext(2);
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const ctx_r1 = i0.ɵɵnextContext(3);
    i0.ɵɵadvance(2);
    i0.ɵɵtextInterpolate1(" ", ctx_r1.Item.FileTypeName);
} }
function ClassifyItemDetailDialogComponent_Conditional_0_Conditional_15_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "span", 22);
    i0.ɵɵtext(1);
    i0.ɵɵelementEnd();
    i0.ɵɵconditionalCreate(2, ClassifyItemDetailDialogComponent_Conditional_0_Conditional_15_Conditional_2_Template, 3, 1, "span", 23);
} if (rf & 2) {
    const ctx_r1 = i0.ɵɵnextContext(2);
    i0.ɵɵadvance();
    i0.ɵɵtextInterpolate(ctx_r1.Item.ContentTypeName);
    i0.ɵɵadvance();
    i0.ɵɵconditional(ctx_r1.Item.FileTypeName ? 2 : -1);
} }
function ClassifyItemDetailDialogComponent_Conditional_0_Conditional_16_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "div", 11)(1, "div", 12);
    i0.ɵɵtext(2, "URL");
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(3, "a", 25);
    i0.ɵɵtext(4);
    i0.ɵɵelement(5, "i", 26);
    i0.ɵɵelementEnd()();
} if (rf & 2) {
    const ctx_r1 = i0.ɵɵnextContext(2);
    i0.ɵɵadvance(3);
    i0.ɵɵproperty("href", ctx_r1.Item.URL, i0.ɵɵsanitizeUrl);
    i0.ɵɵadvance();
    i0.ɵɵtextInterpolate1(" ", ctx_r1.Item.URL, " ");
} }
function ClassifyItemDetailDialogComponent_Conditional_0_Conditional_17_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "div", 11)(1, "div", 12);
    i0.ɵɵtext(2, "Content Preview");
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(3, "div", 27);
    i0.ɵɵtext(4);
    i0.ɵɵelementEnd()();
} if (rf & 2) {
    const ctx_r1 = i0.ɵɵnextContext(2);
    i0.ɵɵadvance(4);
    i0.ɵɵtextInterpolate(ctx_r1.Item.TextContent);
} }
function ClassifyItemDetailDialogComponent_Conditional_0_Conditional_18_For_5_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "span", 30);
    i0.ɵɵtext(1);
    i0.ɵɵelementStart(2, "span", 31);
    i0.ɵɵtext(3);
    i0.ɵɵelementEnd()();
} if (rf & 2) {
    const wt_r3 = ctx.$implicit;
    const ctx_r1 = i0.ɵɵnextContext(3);
    i0.ɵɵstyleProp("font-size", ctx_r1.TagFontSize(wt_r3.Weight));
    i0.ɵɵadvance();
    i0.ɵɵtextInterpolate1(" ", wt_r3.Tag, " ");
    i0.ɵɵadvance(2);
    i0.ɵɵtextInterpolate(ctx_r1.FormatWeight(wt_r3.Weight));
} }
function ClassifyItemDetailDialogComponent_Conditional_0_Conditional_18_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "div", 11)(1, "div", 12);
    i0.ɵɵtext(2);
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(3, "div", 28);
    i0.ɵɵrepeaterCreate(4, ClassifyItemDetailDialogComponent_Conditional_0_Conditional_18_For_5_Template, 4, 4, "span", 29, _forTrack0);
    i0.ɵɵelementEnd()();
} if (rf & 2) {
    const ctx_r1 = i0.ɵɵnextContext(2);
    i0.ɵɵadvance(2);
    i0.ɵɵtextInterpolate1("Tags (", ctx_r1.Item.Tags.length, ")");
    i0.ɵɵadvance(2);
    i0.ɵɵrepeater(ctx_r1.Item.Tags);
} }
function ClassifyItemDetailDialogComponent_Conditional_0_Conditional_23_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "div", 14)(1, "span", 15);
    i0.ɵɵtext(2, "Checksum");
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(3, "span", 32);
    i0.ɵɵtext(4);
    i0.ɵɵelementEnd()();
} if (rf & 2) {
    const ctx_r1 = i0.ɵɵnextContext(2);
    i0.ɵɵadvance(4);
    i0.ɵɵtextInterpolate(ctx_r1.Item.Checksum);
} }
function ClassifyItemDetailDialogComponent_Conditional_0_Template(rf, ctx) { if (rf & 1) {
    const _r1 = i0.ɵɵgetCurrentView();
    i0.ɵɵelementStart(0, "div", 0);
    i0.ɵɵlistener("click", function ClassifyItemDetailDialogComponent_Conditional_0_Template_div_click_0_listener() { i0.ɵɵrestoreView(_r1); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.Closed.emit()); });
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(1, "div", 1)(2, "div", 2)(3, "h3");
    i0.ɵɵelement(4, "i", 3);
    i0.ɵɵtext(5, " Content Item");
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(6, "button", 4);
    i0.ɵɵlistener("click", function ClassifyItemDetailDialogComponent_Conditional_0_Template_button_click_6_listener() { i0.ɵɵrestoreView(_r1); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.Closed.emit()); });
    i0.ɵɵelement(7, "i", 5);
    i0.ɵɵelementEnd()();
    i0.ɵɵelementStart(8, "div", 6)(9, "div", 7)(10, "h4", 8);
    i0.ɵɵtext(11);
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(12, "div", 9)(13, "span", 10);
    i0.ɵɵtext(14);
    i0.ɵɵelementEnd();
    i0.ɵɵconditionalCreate(15, ClassifyItemDetailDialogComponent_Conditional_0_Conditional_15_Template, 3, 2);
    i0.ɵɵelementEnd()();
    i0.ɵɵconditionalCreate(16, ClassifyItemDetailDialogComponent_Conditional_0_Conditional_16_Template, 6, 2, "div", 11);
    i0.ɵɵconditionalCreate(17, ClassifyItemDetailDialogComponent_Conditional_0_Conditional_17_Template, 5, 1, "div", 11);
    i0.ɵɵconditionalCreate(18, ClassifyItemDetailDialogComponent_Conditional_0_Conditional_18_Template, 6, 1, "div", 11);
    i0.ɵɵelementStart(19, "div", 11)(20, "div", 12);
    i0.ɵɵtext(21, "Metadata");
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(22, "div", 13);
    i0.ɵɵconditionalCreate(23, ClassifyItemDetailDialogComponent_Conditional_0_Conditional_23_Template, 5, 1, "div", 14);
    i0.ɵɵelementStart(24, "div", 14)(25, "span", 15);
    i0.ɵɵtext(26, "Created");
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(27, "span", 16);
    i0.ɵɵtext(28);
    i0.ɵɵelementEnd()();
    i0.ɵɵelementStart(29, "div", 14)(30, "span", 15);
    i0.ɵɵtext(31, "Updated");
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(32, "span", 16);
    i0.ɵɵtext(33);
    i0.ɵɵelementEnd()()()();
    i0.ɵɵelementStart(34, "div", 17)(35, "button", 18);
    i0.ɵɵlistener("click", function ClassifyItemDetailDialogComponent_Conditional_0_Template_button_click_35_listener() { i0.ɵɵrestoreView(_r1); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.OpenRecordRequested.emit(ctx_r1.Item)); });
    i0.ɵɵelement(36, "i", 19);
    i0.ɵɵtext(37, " Open Record ");
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(38, "button", 20);
    i0.ɵɵelement(39, "i", 21);
    i0.ɵɵtext(40, " See Similar Items ");
    i0.ɵɵelementEnd()()()();
} if (rf & 2) {
    const ctx_r1 = i0.ɵɵnextContext();
    i0.ɵɵadvance(11);
    i0.ɵɵtextInterpolate(ctx_r1.Item.Name);
    i0.ɵɵadvance(3);
    i0.ɵɵtextInterpolate(ctx_r1.Item.SourceName);
    i0.ɵɵadvance();
    i0.ɵɵconditional(ctx_r1.Item.RequiresContentType ? 15 : -1);
    i0.ɵɵadvance();
    i0.ɵɵconditional(ctx_r1.Item.URL ? 16 : -1);
    i0.ɵɵadvance();
    i0.ɵɵconditional(ctx_r1.Item.TextContent ? 17 : -1);
    i0.ɵɵadvance();
    i0.ɵɵconditional(ctx_r1.Item.Tags.length > 0 ? 18 : -1);
    i0.ɵɵadvance(5);
    i0.ɵɵconditional(ctx_r1.Item.Checksum ? 23 : -1);
    i0.ɵɵadvance(5);
    i0.ɵɵtextInterpolate(ctx_r1.Item.CreatedAt);
    i0.ɵɵadvance(5);
    i0.ɵɵtextInterpolate(ctx_r1.Item.UpdatedAt);
} }
export class ClassifyItemDetailDialogComponent extends BaseAngularComponent {
    /** The content item to display, built and supplied by the host orchestrator. */
    Item = null;
    /** Whether the slide-in is visible. */
    Show = false;
    /** Emitted when the user dismisses the panel (overlay/close button). */
    Closed = new EventEmitter();
    /** Emitted when the user requests to open the underlying record. */
    OpenRecordRequested = new EventEmitter();
    // Template-facing formatters
    FormatWeight = formatWeight;
    TagFontSize = tagFontSize;
    static ɵfac = /*@__PURE__*/ (() => { let ɵClassifyItemDetailDialogComponent_BaseFactory; return function ClassifyItemDetailDialogComponent_Factory(__ngFactoryType__) { return (ɵClassifyItemDetailDialogComponent_BaseFactory || (ɵClassifyItemDetailDialogComponent_BaseFactory = i0.ɵɵgetInheritedFactory(ClassifyItemDetailDialogComponent)))(__ngFactoryType__ || ClassifyItemDetailDialogComponent); }; })();
    static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: ClassifyItemDetailDialogComponent, selectors: [["classify-item-detail-dialog"]], inputs: { Item: "Item", Show: "Show" }, outputs: { Closed: "Closed", OpenRecordRequested: "OpenRecordRequested" }, standalone: false, features: [i0.ɵɵInheritDefinitionFeature], decls: 1, vars: 1, consts: [[1, "at-slide-overlay", 3, "click"], [1, "at-slide-panel", "at-detail-panel"], [1, "at-slide-header"], [1, "fa-solid", "fa-file-lines"], ["aria-label", "Close item detail", 1, "at-slide-close", 3, "click"], [1, "fa-solid", "fa-times"], [1, "at-slide-body"], [1, "at-detail-item-header"], [1, "at-detail-item-name"], [1, "at-detail-badges"], [1, "at-detail-badge", "at-detail-badge-source"], [1, "at-detail-section"], [1, "at-detail-section-label"], [1, "at-detail-meta-grid"], [1, "at-detail-meta-row"], [1, "at-detail-meta-key"], [1, "at-detail-meta-value"], [1, "at-detail-actions"], [1, "at-action-btn", "at-primary-btn", 3, "click"], [1, "fa-solid", "fa-external-link-alt"], ["disabled", "", 1, "at-action-btn", "at-secondary-btn"], [1, "fa-solid", "fa-magnifying-glass"], [1, "at-detail-badge", "at-detail-badge-type"], [1, "at-detail-badge", "at-detail-badge-file"], [1, "fa-solid", "fa-file"], ["target", "_blank", 1, "at-detail-link", 3, "href"], [1, "fa-solid", "fa-external-link-alt", 2, "font-size", "0.65rem", "margin-left", "4px"], [1, "at-detail-text-preview"], [1, "at-detail-tags"], [1, "at-tag-pill", "at-tag-weighted", 3, "font-size"], [1, "at-tag-pill", "at-tag-weighted"], [1, "at-tag-weight"], [1, "at-detail-meta-value", "at-detail-meta-mono"]], template: function ClassifyItemDetailDialogComponent_Template(rf, ctx) { if (rf & 1) {
            i0.ɵɵconditionalCreate(0, ClassifyItemDetailDialogComponent_Conditional_0_Template, 41, 9);
        } if (rf & 2) {
            i0.ɵɵconditional(ctx.Show && ctx.Item ? 0 : -1);
        } }, encapsulation: 2 });
}
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(ClassifyItemDetailDialogComponent, [{
        type: Component,
        args: [{ standalone: false, selector: 'classify-item-detail-dialog', template: "<!-- \u2550\u2550\u2550\u2550\u2550\u2550 ITEM DETAIL SLIDE-IN \u2550\u2550\u2550\u2550\u2550\u2550 -->\n@if (Show && Item) {\n    <div class=\"at-slide-overlay\" (click)=\"Closed.emit()\"></div>\n    <div class=\"at-slide-panel at-detail-panel\">\n        <div class=\"at-slide-header\">\n            <h3><i class=\"fa-solid fa-file-lines\"></i> Content Item</h3>\n            <button class=\"at-slide-close\" aria-label=\"Close item detail\" (click)=\"Closed.emit()\"><i class=\"fa-solid fa-times\"></i></button>\n        </div>\n        <div class=\"at-slide-body\">\n            <!-- Header -->\n            <div class=\"at-detail-item-header\">\n                <h4 class=\"at-detail-item-name\">{{ Item.Name }}</h4>\n                <div class=\"at-detail-badges\">\n                    <span class=\"at-detail-badge at-detail-badge-source\">{{ Item.SourceName }}</span>\n                    @if (Item.RequiresContentType) {\n                        <span class=\"at-detail-badge at-detail-badge-type\">{{ Item.ContentTypeName }}</span>\n                        @if (Item.FileTypeName) {\n                            <span class=\"at-detail-badge at-detail-badge-file\"><i class=\"fa-solid fa-file\"></i> {{ Item.FileTypeName }}</span>\n                        }\n                    }\n                </div>\n            </div>\n\n            <!-- URL -->\n            @if (Item.URL) {\n                <div class=\"at-detail-section\">\n                    <div class=\"at-detail-section-label\">URL</div>\n                    <a [href]=\"Item.URL\" target=\"_blank\" class=\"at-detail-link\">\n                        {{ Item.URL }}\n                        <i class=\"fa-solid fa-external-link-alt\" style=\"font-size: 0.65rem; margin-left: 4px;\"></i>\n                    </a>\n                </div>\n            }\n\n            <!-- Text Preview -->\n            @if (Item.TextContent) {\n                <div class=\"at-detail-section\">\n                    <div class=\"at-detail-section-label\">Content Preview</div>\n                    <div class=\"at-detail-text-preview\">{{ Item.TextContent }}</div>\n                </div>\n            }\n\n            <!-- Tags (weighted) -->\n            @if (Item.Tags.length > 0) {\n                <div class=\"at-detail-section\">\n                    <div class=\"at-detail-section-label\">Tags ({{ Item.Tags.length }})</div>\n                    <div class=\"at-detail-tags\">\n                        @for (wt of Item.Tags; track wt.Tag) {\n                            <span class=\"at-tag-pill at-tag-weighted\" [style.font-size]=\"TagFontSize(wt.Weight)\">\n                                {{ wt.Tag }}\n                                <span class=\"at-tag-weight\">{{ FormatWeight(wt.Weight) }}</span>\n                            </span>\n                        }\n                    </div>\n                </div>\n            }\n\n            <!-- Metadata -->\n            <div class=\"at-detail-section\">\n                <div class=\"at-detail-section-label\">Metadata</div>\n                <div class=\"at-detail-meta-grid\">\n                    @if (Item.Checksum) {\n                        <div class=\"at-detail-meta-row\">\n                            <span class=\"at-detail-meta-key\">Checksum</span>\n                            <span class=\"at-detail-meta-value at-detail-meta-mono\">{{ Item.Checksum }}</span>\n                        </div>\n                    }\n                    <div class=\"at-detail-meta-row\">\n                        <span class=\"at-detail-meta-key\">Created</span>\n                        <span class=\"at-detail-meta-value\">{{ Item.CreatedAt }}</span>\n                    </div>\n                    <div class=\"at-detail-meta-row\">\n                        <span class=\"at-detail-meta-key\">Updated</span>\n                        <span class=\"at-detail-meta-value\">{{ Item.UpdatedAt }}</span>\n                    </div>\n                </div>\n            </div>\n\n            <!-- Actions -->\n            <div class=\"at-detail-actions\">\n                <button class=\"at-action-btn at-primary-btn\" (click)=\"OpenRecordRequested.emit(Item)\">\n                    <i class=\"fa-solid fa-external-link-alt\"></i> Open Record\n                </button>\n                <button class=\"at-action-btn at-secondary-btn\" disabled>\n                    <i class=\"fa-solid fa-magnifying-glass\"></i> See Similar Items\n                </button>\n            </div>\n        </div>\n    </div>\n}\n", styles: ["/*\n * Content Item Detail slide-in dialog styles.\n *\n * The host (AutotaggingPipelineResourceComponent) uses ViewEncapsulation.None,\n * so its `.at-*` rules are global and already style this dialog's markup while\n * it renders inside the host shell. No dialog-specific rules are needed today.\n */\n"] }]
    }], null, { Item: [{
            type: Input
        }], Show: [{
            type: Input
        }], Closed: [{
            type: Output
        }], OpenRecordRequested: [{
            type: Output
        }] }); })();
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(ClassifyItemDetailDialogComponent, { className: "ClassifyItemDetailDialogComponent", filePath: "src/AI/components/autotagging/dialogs/item-detail.dialog.component.ts", lineNumber: 21 }); })();
//# sourceMappingURL=item-detail.dialog.component.js.map