/*
THIS INFRAGISTICS ULTIMATE SOFTWARE LICENSE  AGREEMENT ("AGREEMENT") LOCATED HERE:
https://www.infragistics.com/legal/license/igultimate-la
https://www.infragistics.com/legal/license/igultimate-eula
GOVERNS THE LICENSING, INSTALLATION AND USE OF INFRAGISTICS SOFTWARE. BY DOWNLOADING AND/OR INSTALLING AND USING INFRAGISTICS SOFTWARE:  you are indicating that you have read and understand this Agreement, and agree to be legally bound by it on behalf of the yourself and your company.
*/
import { Base, DomWrapper_$type, markType } from "igniteui-react-core/ES2015/type";
import { List$1 } from "igniteui-react-core/ES2015/List$1";
/**
 * @hidden
 */
export class TemplatedHtmlControl extends Base {
    constructor(a, b, c) {
        super();
        this.j = null;
        this.i = null;
        this.e = null;
        this.d = null;
        this.i = TemplatedHtmlControl.h(b, a, c);
        this.j = a;
    }
    static f(a, b) {
        for (let c = 0; c < a.getChildCount(); c++) {
            let d = a.getChildAt(c);
            if (d.getNativeElement() != null) {
                let ele_ = d.getNativeElement();
                if (b.toUpperCase() == (ele_.nodeName).toUpperCase()) {
                    return d;
                }
                let e = TemplatedHtmlControl.f(d, b);
                if (e != null) {
                    return e;
                }
            }
        }
        return null;
    }
    static a(a, b) {
        let c = new List$1(DomWrapper_$type, 0);
        for (let d = 0; d < a.getChildCount(); d++) {
            let e = a.getChildAt(d);
            if (e.getNativeElement() != null) {
                let ele_ = e.getNativeElement();
                if (b.toUpperCase() == (ele_.nodeName).toUpperCase()) {
                    c.add(e);
                }
                let f = TemplatedHtmlControl.a(e, b);
                if (f != null) {
                    c.o(f);
                }
            }
        }
        return c;
    }
    static h(a, b, c) {
        return a;
    }
    get g() {
        if (this.e == null && this.d != null) {
            return this.d.rootWrapper;
        }
        return this.e;
    }
    set g(a) {
        this.e = a;
    }
    l(a) {
        if (a == null) {
            if (this.g != null) {
                this.g.remove();
            }
            return;
        }
        this.d = a;
    }
    static c(a) {
        return null;
    }
    static n(a, b, c, d) {
        TemplatedHtmlControl.m(a, d.al(b), c);
    }
    static m(a, b, c) {
        if (c == null) {
            return;
        }
        let d = c.querySelector(a);
        if (d == null) {
            return;
        }
        d.setText(b);
    }
    b() {
        if (this.d == null || this.d.rootWrapper == null) {
            return NaN;
        }
        let a = this.d.rootWrapper.getOffset();
        return this.d.rootWrapper.width() + (a == null ? 0 : a.left);
    }
    k() {
        if (this.d == null || this.d.rootWrapper == null) {
            return;
        }
        this.d.rootWrapper.hide();
    }
}
TemplatedHtmlControl.$t = markType(TemplatedHtmlControl, 'TemplatedHtmlControl');
