import { Component, EventEmitter } from '@angular/core';
import { BsModalRef } from 'ngx-bootstrap/modal';
import * as i0 from "@angular/core";
import * as i1 from "ngx-bootstrap/modal";
import * as i2 from "./command-templates.directive";
/* https://stackoverflow.com/a/65290658 */
export function rootScopeCommandTemplateFactory($injector) {
    return $injector.get('$rootScope').$new();
}
export class CommandTemplatesComponent {
    constructor(modalRef) {
        this.modalRef = modalRef;
        this.onTemplateSelected = new EventEmitter();
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.9", ngImport: i0, type: CommandTemplatesComponent, deps: [{ token: i1.BsModalRef }], target: i0.ɵɵFactoryTarget.Component }); }
    static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.9", type: CommandTemplatesComponent, selector: "c8y-command-templates", providers: [
            {
                deps: ['$injector'],
                provide: '$scope',
                useFactory: rootScopeCommandTemplateFactory
            }
        ], ngImport: i0, template: `<c8y-command-templates-directive
    (close)="modalRef.hide(); onTemplateSelected.next($event)"
    (dismiss)="modalRef.hide()"
  ></c8y-command-templates-directive>`, isInline: true, dependencies: [{ kind: "directive", type: i2.CommandTemplates, selector: "c8y-command-templates-directive", outputs: ["close", "dismiss"] }] }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.9", ngImport: i0, type: CommandTemplatesComponent, decorators: [{
            type: Component,
            args: [{
                    selector: 'c8y-command-templates',
                    template: `<c8y-command-templates-directive
    (close)="modalRef.hide(); onTemplateSelected.next($event)"
    (dismiss)="modalRef.hide()"
  ></c8y-command-templates-directive>`,
                    providers: [
                        {
                            deps: ['$injector'],
                            provide: '$scope',
                            useFactory: rootScopeCommandTemplateFactory
                        }
                    ]
                }]
        }], ctorParameters: () => [{ type: i1.BsModalRef }] });
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29tbWFuZC10ZW1wbGF0ZXMuY29tcG9uZW50LmpzIiwic291cmNl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