import { Component, Input, TemplateRef, ViewChild } from '@angular/core';
import { BsSnackbarService } from '@mintplayer/ng-bootstrap/snackbar';
import * as i0 from "@angular/core";
import * as i1 from "@mintplayer/ng-bootstrap/snackbar";
import * as i2 from "@mintplayer/ng-bootstrap/copy";
import * as i3 from "ngx-highlightjs";
export class BsCodeSnippetComponent {
    constructor(snackbarService) {
        this.snackbarService = snackbarService;
        this.htmlToCopy = '';
    }
    copiedHtml() {
        const snackbar = this.snackbarService.show(this.copiedTemplate);
        setTimeout(() => this.snackbarService.hide(snackbar), 3000);
    }
}
BsCodeSnippetComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: BsCodeSnippetComponent, deps: [{ token: i1.BsSnackbarService }], target: i0.ɵɵFactoryTarget.Component });
BsCodeSnippetComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.0.4", type: BsCodeSnippetComponent, selector: "bs-code-snippet", inputs: { htmlToCopy: "htmlToCopy" }, viewQueries: [{ propertyName: "copiedTemplate", first: true, predicate: ["copiedTemplate"], descendants: true }], ngImport: i0, template: "<div class=\"position-relative\">\n    <button #copyBtn [bsCopy]=\"htmlToCopy\" (bsCopied)=\"copiedHtml()\" class=\"btn btn-link rounded-0 text-light position-absolute copy-btn\">\n        Copy html\n    </button>\n    <pre class=\"white-space-normal\">\n        <code class=\"d-block white-space-pre\" [highlight]=\"htmlToCopy\"></code>\n    </pre>\n    <ng-template #copiedTemplate>\n        <div class=\"p-3\">Copied!</div>\n    </ng-template>\n</div>", styles: [".copy-btn{right:0}\n"], dependencies: [{ kind: "directive", type: i2.BsCopyDirective, selector: "[bsCopy]", inputs: ["bsCopy"], outputs: ["bsCopied"] }, { kind: "directive", type: i3.Highlight, selector: "[highlight]", inputs: ["highlight", "languages", "lineNumbers"], outputs: ["highlighted"] }] });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: BsCodeSnippetComponent, decorators: [{
            type: Component,
            args: [{ selector: 'bs-code-snippet', template: "<div class=\"position-relative\">\n    <button #copyBtn [bsCopy]=\"htmlToCopy\" (bsCopied)=\"copiedHtml()\" class=\"btn btn-link rounded-0 text-light position-absolute copy-btn\">\n        Copy html\n    </button>\n    <pre class=\"white-space-normal\">\n        <code class=\"d-block white-space-pre\" [highlight]=\"htmlToCopy\"></code>\n    </pre>\n    <ng-template #copiedTemplate>\n        <div class=\"p-3\">Copied!</div>\n    </ng-template>\n</div>", styles: [".copy-btn{right:0}\n"] }]
        }], ctorParameters: function () { return [{ type: i1.BsSnackbarService }]; }, propDecorators: { htmlToCopy: [{
                type: Input
            }], copiedTemplate: [{
                type: ViewChild,
                args: ['copiedTemplate']
            }] } });
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29kZS1zbmlwcGV0LmNvbXBvbmVudC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uL2xpYnMvbWludHBsYXllci1uZy1ib290c3RyYXAvY29kZS1zbmlwcGV0L3NyYy9jb2RlLXNuaXBwZXQuY29tcG9uZW50LnRzIiwiLi4vLi4vLi4vLi4vLi4vLi4vbGlicy9taW50cGxheWVyLW5nLWJvb3RzdHJhcC9jb2RlLXNuaXBwZXQvc3JjL2NvZGUtc25pcHBldC5jb21wb25lbnQuaHRtbCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUUsU0FBUyxFQUFFLEtBQUssRUFBRSxXQUFXLEVBQUUsU0FBUyxFQUFFLE1BQU0sZUFBZSxDQUFDO0FBQ3pFLE9BQU8sRUFBRSxpQkFBaUIsRUFBRSxNQUFNLG1DQUFtQyxDQUFDOzs7OztBQU90RSxNQUFNLE9BQU8sc0JBQXNCO0lBRWpDLFlBQW9CLGVBQWtDO1FBQWxDLG9CQUFlLEdBQWYsZUFBZSxDQUFtQjtRQUd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