/*
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, Type, enumGetBox, EnumUtil, markType } from "./type";
import { BaseControlTheme_$type } from "./BaseControlTheme";
import { INativeUIElementFactory_$type } from "./INativeUIElementFactory";
import { List$1 } from "./List$1";
import { NativeUI } from "./NativeUI";
/**
 * @hidden
 */
export let INativeUIElementBridge_$type = /*@__PURE__*/ new Type(null, 'INativeUIElementBridge');
/**
 * @hidden
 */
export let NativeUIComponent = /*@__PURE__*/ (() => {
    class NativeUIComponent extends Base {
        constructor() {
            super(...arguments);
            this.y = null;
            this.d = null;
            this.x = null;
        }
        au(a) {
            return this.d.getDesiredSize(this.w, a);
        }
        get_e() {
            return 8;
        }
        get e() {
            return this.get_e();
        }
        get w() {
            return this.d.getMethodTarget(this.x);
        }
        static ab(a) {
            if (!NativeUIComponent.h.contains(a)) {
                NativeUIComponent.h.add(a);
            }
        }
        static a(a, b) {
            let c = new List$1(INativeUIElementFactory_$type, 0);
            let d = new List$1(INativeUIElementFactory_$type, 0);
            for (let e = 0; e < a.length; e++) {
                let f = a[e];
                let g = b[e];
                for (let h = 0; h < NativeUIComponent.h.count; h++) {
                    if (NativeUIComponent.h._inner[h].flavor == g) {
                        d.add(NativeUIComponent.h._inner[h]);
                    }
                }
                for (let i = 0; i < d.count; i++) {
                    if (d._inner[i].supportsComponent(f)) {
                        c.add(d._inner[i]);
                        break;
                    }
                }
                if (c.count - 1 == e) {
                    d.clear();
                    continue;
                }
                for (let j = 0; j < NativeUIComponent.h.count; j++) {
                    if (NativeUIComponent.h._inner[j].supportsComponent(f)) {
                        c.add(NativeUIComponent.h._inner[j]);
                        break;
                    }
                }
                if (c.count - 1 != e) {
                    c.add(null);
                }
                d.clear();
            }
            return c.toArray();
        }
        static ac(a, b, c, d) {
            let e = NativeUIComponent.a([b], [c]);
            if (e.length > 0 && e[0] != null) {
                e[0].createComponent(a, b, d);
            }
        }
        static ad(a, b, c) {
            NativeUIComponent.ac(a, b, 0, c);
        }
        static ae(a, b, c, d) {
            let e = 0;
            let f = new Array(b.length);
            let g = NativeUIComponent.a(b, c);
            for (let h = 0; h < g.length; h++) {
                let i = g[h];
                let j = b[h];
                if (i != null) {
                    i.createComponent(a, j, (k) => {
                        f[h] = k;
                        e++;
                        if (e == b.length) {
                            d(f);
                        }
                    });
                }
                else {
                    f[h] = null;
                    e++;
                    if (e == b.length) {
                        d(f);
                    }
                }
            }
        }
        static af(a, b, c) {
            let d = new Array(b.length);
            for (let e = 0; e < d.length; e++) {
                d[e] = 0;
            }
            NativeUIComponent.ae(a, b, d, c);
        }
        static ag(a, b, c, d) {
            let e = NativeUIComponent.a([b], [c]);
            if (e.length > 0 && e[0] != null) {
                e[0].createComponentSync(a, b, d);
            }
        }
        static ah(a, b, c) {
            NativeUIComponent.ag(a, b, 0, c);
        }
        v(a) {
            return this.d.getTargetForProperty(a, this.x);
        }
        s(a) {
            let b = this.v(a);
            return NativeUI.j(a, b);
        }
        am(a, b) {
            let c = this.v(a);
            NativeUI.ac(a, c, b);
        }
        q(a) {
            let b = this.u(a);
            return this.r(b, a);
        }
        ak(a, b) {
            let c = this.u(a);
            this.al(c, a, b);
        }
        z(a, b) {
            let c = this.t(a);
            this.aa(c, this, a, b);
        }
        aa(a, b, c, d) {
            this.d.addHandler(a, b, c, d);
        }
        ai(a, b) {
            let c = this.t(a);
            this.aj(c, this, a, b);
        }
        aj(a, b, c, d) {
            this.d.removeHandler(a, b, c, d);
        }
        r(a, b) {
            return this.d.getValue(a, b);
        }
        al(a, b, c) {
            this.d.setValue(a, b, c);
        }
        u(a) {
            let b = this.x;
            b = this.d.getTargetForBuildInProperty(b, a);
            return b;
        }
        t(a) {
            let b = this.x;
            b = this.d.getTargetForBuildInEvent(b, a);
            return b;
        }
        get p() {
            return this.s(9);
        }
        set p(a) {
            this.am(9, a);
        }
        get j() {
            return this.s(10);
        }
        set j(a) {
            this.am(10, a);
        }
        get l() {
            return this.s(1);
        }
        set l(a) {
            this.am(1, a);
        }
        get c() {
            let a = this.q(16);
            return EnumUtil.getEnumValue(BaseControlTheme_$type, a);
        }
        set c(a) {
            this.ak(16, enumGetBox(BaseControlTheme_$type, a));
        }
        get ao() {
            return this.s(2);
        }
        set ao(a) {
            this.am(2, a);
        }
        get ap() {
            return this.s(3);
        }
        set ap(a) {
            this.am(3, a);
        }
        get av() {
            return this.s(4);
        }
        set av(a) {
            this.am(4, a);
        }
        get an() {
            return this.s(5);
        }
        set an(a) {
            this.am(5, a);
        }
        get ax() {
            return this.s(6);
        }
        set ax(a) {
            this.am(6, a);
        }
        get aq() {
            return this.s(7);
        }
        set aq(a) {
            this.am(7, a);
        }
        get i() {
            return this.s(8);
        }
        set i(a) {
            this.am(8, a);
        }
        get k() {
            return this.s(11);
        }
        set k(a) {
            this.am(11, a);
        }
        get o() {
            return this.s(12);
        }
        set o(a) {
            this.am(12, a);
        }
        get aw() {
            return this.s(13);
        }
        set aw(a) {
            this.am(13, a);
        }
        get at() {
            return this.s(14);
        }
        set at(a) {
            this.am(14, a);
        }
        get as() {
            return this.s(15);
        }
        set as(a) {
            this.am(15, a);
        }
        get ar() {
            return this.s(16);
        }
        set ar(a) {
            this.am(16, a);
        }
        get n() {
            return this.s(17);
        }
        set n(a) {
            this.am(17, a);
        }
        get b() {
            return this.s(18);
        }
        set b(a) {
            this.am(18, a);
        }
        get m() {
            return this.s(19);
        }
        set m(a) {
            this.am(19, a);
        }
        get f() {
            return this.d.getHorizontalAlignment(this.x);
        }
        set f(a) {
            this.d.setHorizontalAlignment(this.x, a);
        }
        get g() {
            return this.d.getVerticalAlignment(this.x);
        }
        set g(a) {
            this.d.setVerticalAlignment(this.x, a);
        }
    }
    NativeUIComponent.$t = /*@__PURE__*/ markType(NativeUIComponent, 'NativeUIComponent');
    NativeUIComponent.h = /*@__PURE__*/ new List$1(INativeUIElementFactory_$type, 0);
    return NativeUIComponent;
})();
