/*
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, Delegate_$type, runOn, delegateCombine, fromEnum, typeCast, Array_$type, delegateRemove, markType, INotifyPropertyChanged_$type, PropertyChangedEventArgs, enumGetBox, String_$type } from "igniteui-webcomponents-core";
import { Popup } from "igniteui-webcomponents-layouts";
import { Suffix } from "igniteui-webcomponents-inputs";
import { InputGroup } from "igniteui-webcomponents-inputs";
import { Label } from "igniteui-webcomponents-inputs";
import { Input } from "igniteui-webcomponents-inputs";
import { List$1 } from "igniteui-webcomponents-core";
import { Icon } from "igniteui-webcomponents-inputs";
import { GridCellPosition } from "./GridCellPosition";
import { Rect } from "igniteui-webcomponents-core";
import { GotFocusEventArgs } from "./GotFocusEventArgs";
import { LostFocusEventArgs } from "./LostFocusEventArgs";
import { FilterFactory } from "igniteui-webcomponents-core";
import { ColumnComparisonFilterCondition } from "./ColumnComparisonFilterCondition";
import { NativeUI } from "igniteui-webcomponents-core";
import { FontInfo } from "igniteui-webcomponents-core";
import { MultiColumnComboBoxUtilities } from "./MultiColumnComboBoxUtilities";
import { ColumnWidth } from "./ColumnWidth";
import { SortMode_$type } from "./SortMode";
import { IDataSourceUpdateNotifier_$type } from "igniteui-webcomponents-core";
import { MultipleDataSourceNotifier } from "./MultipleDataSourceNotifier";
import { TextHeaderCellModel } from "./TextHeaderCellModel";
import { CornerRadius } from "igniteui-webcomponents-core";
import { stringEmpty, stringIsNullOrEmpty } from "igniteui-webcomponents-core";
import { stringFormat } from "igniteui-webcomponents-core";
import { BaseControlTheme_$type } from "igniteui-webcomponents-core";
import { Thickness } from "igniteui-webcomponents-core";
import { ControlDisplayDensity_$type } from "igniteui-webcomponents-core";
import { StringComparer } from "igniteui-webcomponents-core";
import { ThemeResolver } from "igniteui-webcomponents-inputs";
import { MultiColumnComboBoxTextChangedEventArgs } from "./MultiColumnComboBoxTextChangedEventArgs";
import { MultiColumnComboBoxValueChangedEventArgs } from "./MultiColumnComboBoxValueChangedEventArgs";
import { FastReflectionHelper } from "igniteui-webcomponents-core";
import { MultiColumnComboVisualModelExport } from "./MultiColumnComboVisualModelExport";
import { AppearanceHelper } from "igniteui-webcomponents-core";
import { FontUtil } from "igniteui-webcomponents-core";
import { BrushUtil } from "igniteui-webcomponents-core";
import { isNaN_ } from "igniteui-webcomponents-core";
/**
 * @hidden
 */
export let MultiColumnComboBoxView = /*@__PURE__*/ (() => {
    class MultiColumnComboBoxView extends Base {
        constructor() {
            super(...arguments);
            this.ac = null;
            this.ak = null;
            this.f = null;
            this.ai = null;
            this.k = null;
            this.ah = null;
            this.j = null;
            this.aj = null;
            this.l = null;
            this.h = null;
            this.ae = null;
            this.i = null;
            this.af = null;
            this.m = null;
            this.ag = null;
            this.d = null;
            this.aq = null;
            this.ab = new List$1(Delegate_$type, 0);
            this.au = null;
            this.aa = true;
            this.ap = 0;
            this.x = false;
            this.a = null;
            this.c = 0;
            this.w = false;
            this.s = false;
            this.r = false;
            this.p = false;
            this.an = null;
            this.am = null;
            this.v = false;
            this.ao = -1;
            this.z = false;
            this.t = false;
        }
        get e() {
            return this.d;
        }
        get y() {
            return this.ap == 46;
        }
        get n() {
            return this.m;
        }
        bf(a) {
            this.ak = a;
            this.b1();
        }
        bg(a) {
            this.f = a;
        }
        bp() {
        }
        b1() {
            this.ag = this.ac.createElement("div");
            this.cs();
            this.a1();
            this.a0();
            this.ak.append(this.ai);
            this.ck();
            this.cm();
            document.addEventListener("click", runOn(this, this.a2), false);
            window.addEventListener("resize", runOn(this, this.cy), false);
        }
        aw(a) {
            let b = this.g.n();
            if (null == b) {
                return;
            }
            this.p = false;
            if (b.eo != a) {
                b.eo = a;
                this.p = true;
            }
            else {
                this.a3();
            }
        }
        ay() {
            let a = this.e;
            a.c1 = null;
        }
        az() {
            let a = this.n;
            if (null != a) {
                a.ao();
            }
            this.cm();
            let b = this.g.n();
            if (null != b) {
                let c = b.eo;
                if (null != c) {
                    b.eo = null;
                }
            }
        }
        u(a) {
            if (null == a) {
                return false;
            }
            let b = this.ai.getNativeElement();
            let c = this.ag.getNativeElement();
            let d = this.am.getNativeElement();
            return b.contains(a) || c.contains(a) || d.contains(a);
        }
        a0() {
            let a = this.ad;
            let b = this.g;
            this.ai = a.createElement("div");
            this.ai.setStyleProperty("display", "flex");
            this.ai.setStyleProperty("height", "100%");
            this.ai.setAttribute("tabIndex", "0");
            this.ai.setAttribute("outline", "none !important");
            this.ai.listen("focusin", runOn(this, this.bm));
            this.ai.listen("focusout", runOn(this, this.bn));
            let c = a.getSubRenderer(this.ai);
            this.k = new InputGroup();
            this.k.provideContainer(c);
            this.k.k = 2;
            this.aj = a.createElement("div");
            let d = a.getSubRenderer(this.aj);
            this.l = new Label();
            this.l.provideContainer(d);
            if (this.f.actualLabelVisible) {
                this.cv();
            }
            this.ah = a.createElement("div");
            this.ah.addClass("ig-input");
            this.ah.setRawStyleProperty("flex-grow", "1");
            let e = a.getSubRenderer(this.ah);
            this.j = new Input();
            this.j.provideContainer(e);
            a.getExternal(this.j, a.rootWrapper, a.getExternal(b, null, null));
            this.j.b1 = "text";
            this.j.cg = b.fc;
            let f = this.j;
            f.changing = delegateCombine(f.changing, runOn(this, this.bh));
            let g = this.j;
            g.compositionEnd = delegateCombine(g.compositionEnd, runOn(this, this.bi));
            let h = this.j;
            h.keyDown = delegateCombine(h.keyDown, runOn(this, this.bk));
            let i = this.j;
            i.gotFocus = delegateCombine(i.gotFocus, runOn(this, this.bj));
            let j = this.j;
            j.mouseDown = delegateCombine(j.mouseDown, runOn(this, this.bl));
            this.k.appendContentChild(this.ah);
            this.k.inputs.add(this.j);
            this.a5(this.g.a7);
            let k = a.createElement("div");
            let l = a.getSubRenderer(k);
            let m = new Suffix();
            m.provideContainer(l);
            this.ae = a.createElement("div");
            this.h = new Icon();
            let n = a.getSubRenderer(this.ae);
            this.h.provideContainer(n);
            this.h.svgPath = MultiColumnComboBoxView.ar;
            this.ae.setStyleProperty("height", "16px");
            this.ae.setStyleProperty("width", "16px");
            m.appendContentChild(this.ae);
            this.k.appendContentChild(k);
            this.k.inputs.add(m);
            this.ch();
            let o = a.createElement("div");
            let p = a.getSubRenderer(o);
            let q = new Suffix();
            q.provideContainer(p);
            this.af = a.createElement("div");
            this.i = new Icon();
            let r = a.getSubRenderer(this.af);
            this.i.provideContainer(r);
            this.i.svgPath = MultiColumnComboBoxView.at;
            q.appendContentChild(this.af);
            this.k.appendContentChild(o);
            this.k.inputs.add(q);
            this.ae.listen("click", runOn(this, this.ax));
            this.af.listen("click", runOn(this, this.a4));
        }
        a1() {
            let a = this.ac.createElement("div");
            let b = this.ac.getSubRenderer(a);
            this.m = new Popup();
            this.m.provideRenderer(b);
            this.am = this.ac.createElement("div");
            this.am.setStyleProperty("padding", "4px");
            this.am.setStyleProperty("white-space", "nowrap");
            this.an = this.ac.createElement("div");
            this.an.append(this.am);
            this.an.append(this.ag);
            this.m.appendPopupContent(this.an);
        }
        bt(a, b) {
        }
        bw(a, b, c) {
        }
        bs() {
            switch (this.c) {
                case 2:
                case 1:
                    if (null == this.a) {
                        this.c = 0;
                    }
                    break;
            }
            let a = null;
            switch (this.c) {
                case 2:
                    {
                        let b = this.a.actualCount;
                        if (b == 0) {
                            this.g.c1 = null;
                        }
                        else {
                            if (b > 1) {
                            }
                            a = this.a.getItemAtIndex(0);
                            let c = this.g.i();
                            let d = new List$1(Base.$, 0);
                            for (let f = 0; f < c.length; f++) {
                                let e = c[f];
                                let g = this.a.getItemProperty(a, e);
                                d.add1(g);
                            }
                            this.g.c1 = d.count == 1 ? d._inner[0] : d.toArray();
                        }
                    }
                    break;
                case 1:
                    {
                        let h = this.a.actualCount;
                        if (h == 0) {
                            this.g.fc = stringEmpty();
                        }
                        else {
                            if (h > 1) {
                            }
                            let i = this.g.eq();
                            a = this.a.getItemAtIndex(0);
                            let j = this.a.getItemProperty(a, i).toString();
                            this.g.fc = j;
                        }
                        let k = this.b();
                        let l = k.indexOfItem(a);
                        this.cg(l);
                    }
                    break;
                case 0:
                default: return;
            }
            if (null != a) {
                let m = this.b();
                let n = m.indexOfItem(a);
                this.cg(n);
            }
            else {
                this.cg(-1);
            }
            if (this.a != null) {
                this.a.updateNotifier = null;
                this.a = null;
            }
            this.c = 0;
        }
        bu(a, b) {
        }
        bv(a, b) {
        }
        bz(a, b) {
            let c = this.e;
            if (null != c) {
                let d = c.c1;
                if (null != d) {
                    if (d.b >= a && d.b <= b) {
                        this.ce(d.b);
                        this.ct();
                    }
                }
            }
        }
        b4(a, b, c) {
        }
        br() {
            this.b7();
            if (this.w) {
                let a = this.b();
                let b = a.actualCount;
                if (this.aa && b > 0) {
                    this.b9();
                }
                else {
                    this.ca();
                }
            }
            else {
                this.cr();
            }
        }
        b0(a, b) {
        }
        b2(a, b) {
        }
        o() {
            let a = document.activeElement;
            return this.u(a);
        }
        a3() {
            this.cw();
            this.bo();
            let a = this.n;
            if (a.t) {
                return;
            }
            let b = this.cz();
            a.q = !this.w;
            a.showRelativeToExclusionRect(b, 1, 1);
            this.cm();
        }
        cz() {
            let a = this.ac.rootWrapper.getNativeElement();
            let b = (a.getBoundingClientRect());
            return new Rect(0, b.left + window.pageXOffset, b.top + window.pageYOffset, b.width, b.height);
        }
        b() {
            let a = this.e;
            if (null != a) {
                return a.actualDataSource;
            }
            return null;
        }
        q(a) {
            let b = this.d.ad;
            let c = b.count;
            if (0 == c) {
                a = null;
                return {
                    ret: true,
                    p0: a
                };
            }
            else if (1 == c) {
                a = b._inner[0];
            }
            else {
                a = b._inner[0];
            }
            return {
                ret: null != a,
                p0: a
            };
        }
        a8(a) {
            let b = null != a ? a.b : -1;
            this.ce(b);
        }
        bc() {
            if (this.v) {
                return;
            }
            let a = this.g;
            let b;
            let c = ((() => { let d = this.q(b); b = d.p0; return d.ret; })());
            if (!c) {
                return;
            }
            if (b == null) {
                return;
            }
            a.f0(b);
        }
        bo() {
            this.n.ar();
        }
        bq() {
            let a = this.n;
            if (a.t) {
                this.az();
                let b = this.j;
                b.focus();
                let c = b.cg;
                let d = null != c ? b.cg.length : 0;
                b.df(d, d);
            }
        }
        bx() {
            this.k.ah = true;
            this.j.dd();
            let a = new GotFocusEventArgs();
            this.g.fw(a);
        }
        by() {
            this.az();
            this.k.mj();
            let a = new LostFocusEventArgs();
            this.g.fy(a);
        }
        b3(a) {
            if (a == null) {
                this.ac = null;
                for (let b of fromEnum(this.ab)) {
                    b();
                }
                this.ab.clear();
                return;
            }
            this.ac = a;
            let c = a.rootWrapper;
            this.bf(c);
        }
        b5(a, b) {
            let c = this.b();
            if (null == c) {
                return;
            }
            if (null != this.a) {
                if (a != this.c) {
                }
                this.a.updateNotifier = null;
                this.a = null;
            }
            this.c = a;
            let d = new FilterFactory();
            let e = null;
            let f = null;
            switch (a) {
                case 2:
                    {
                        let g = this.g.eq();
                        if (stringIsNullOrEmpty(g)) {
                            return;
                        }
                        e = b.toString();
                        let h = d.property(g);
                        f = h.isEqualTo(e);
                    }
                    break;
                case 1:
                    {
                        let i = this.g.i();
                        if (i == null || i.length < 1) {
                            return;
                        }
                        let j = typeCast(Array_$type, b) !== null ? b : [b];
                        if (i.length != j.length) {
                            return;
                        }
                        for (let k = 0; k < i.length; k++) {
                            let l = i[k];
                            e = j[k];
                            let m = d.property(l);
                            let n = m.isEqualTo(e);
                            if (null == f) {
                                f = n;
                            }
                            else {
                                f.and(n);
                            }
                        }
                    }
                    break;
                case 0:
                default: return;
            }
            this.a = c.clone();
            this.a.filterExpressions.clear();
            this.a.updateNotifier = new MultiColumnComboBoxDataSourceNotificationHandler(this, true);
            this.a.filterExpressions.add(f);
            if (!this.a.isVirtual) {
                this.a.flushAutoRefresh();
            }
        }
        b6() {
            this.cp();
            let a = this.f.fc;
            let b = this.au.length;
            let c = !stringIsNullOrEmpty(a) ? a.length : 0;
            if (this.x && !stringIsNullOrEmpty(this.au) && b > 0) {
                b--;
            }
            this.j.df(b, c);
        }
        b7() {
            if (this.p) {
                this.p = false;
                this.a3();
            }
        }
        b8(a) {
            this.au = a;
            this.aa = !this.y;
            this.cb();
            this.ch();
        }
        b9() {
            if (stringIsNullOrEmpty(this.au)) {
                this.ay();
            }
            else {
                this.cg(0);
            }
            this.b6();
            this.w = false;
        }
        ch() {
            if (this.ae != null && this.j != null) {
                if (this.g.be == false) {
                    this.ae.setStyleProperty("display", "none");
                }
                else if ((this.g.c1 != null && this.g.c1 != "") || (this.j.cg != null && this.j.cg != "")) {
                    this.ae.show();
                }
                else {
                    this.ae.setStyleProperty("display", "none");
                }
            }
        }
        a5(a) {
            if (this.j != null) {
                this.j.disabled = !a;
            }
        }
        ca() {
            let a = this.d;
            a.selectedItemsChanged = delegateRemove(a.selectedItemsChanged, runOn(this, this.bd));
            this.v = true;
            try {
                this.g.f7(this.au);
            }
            finally {
                this.v = false;
                let b = this.d;
                b.selectedItemsChanged = delegateCombine(b.selectedItemsChanged, runOn(this, this.bd));
            }
            this.w = false;
        }
        cb() {
            let a = this.g.n();
            if (null == a) {
                return;
            }
            this.w = true;
            if (stringIsNullOrEmpty(this.au)) {
                if (null != a.eo) {
                    this.aw(null);
                }
                else {
                    this.ca();
                }
            }
            else {
                let b = new ColumnComparisonFilterCondition();
                b.e = 11;
                b.j = this.au;
                b.g = false;
                this.aw(b);
            }
        }
        cc() {
            this.ap = 0;
            this.x = false;
        }
        ce(a) {
            let b = this.b();
            let c = b.isPlaceholderItem(a);
            if (c) {
            }
            else {
                let d = this.e;
                if (a < 0) {
                    this.s = false;
                    d.ad.clear();
                    if (!this.s) {
                        this.bc();
                    }
                    return;
                }
                d.selectedItemsChanged = delegateRemove(d.selectedItemsChanged, runOn(this, this.bd));
                try {
                    d.ad.clear();
                }
                finally {
                    d.selectedItemsChanged = delegateCombine(d.selectedItemsChanged, runOn(this, this.bd));
                }
                if (a >= 0) {
                    let e = b.getItemAtIndex(a);
                    this.s = false;
                    d.ad.add1(e);
                    if (!this.s) {
                        this.bc();
                    }
                }
            }
        }
        cg(a) {
            let b = this.e;
            if (-1 == a) {
                b.c1 = null;
                return;
            }
            let c = b.c1;
            let d = new GridCellPosition();
            let e;
            if (null != c) {
                e = c.d;
            }
            else {
                if (b.actualColumns.count == 0) {
                    this.ao = a;
                    return;
                }
                let f = this.g;
                let g = this.g.n();
                e = g.h6();
            }
            d.d = e;
            d.b = a;
            this.r = false;
            b.c1 = d;
            if (!this.r) {
                this.a8(b.c1);
            }
            this.ct();
        }
        cj(a) {
            this.b5(2, a);
        }
        ci(a) {
            this.b5(1, a);
        }
        ck() {
            let a = this.g;
            if (null != this.k) {
                this.k.h = a.density;
                this.k.d = a.ab;
                this.k.oy = a.g2;
                this.k.oz = a.g3;
                this.k.cu = a.bz;
                this.k.tj = a.h1;
                this.k.m3 = a.gd;
                this.k.h = a.ag;
                this.k.sq = a.g4;
                this.k.hc = a.b0;
                this.k.sr = a.g5;
                this.k.hd = a.b1;
                this.k.he = a.b2;
                this.k.ss = a.g6;
                this.k.hf = a.b3;
                this.k.hg = a.b4;
                this.k.s7 = a.hb;
                this.k.h1 = a.b5;
                this.k.s8 = a.hc;
                this.k.h2 = a.b6;
                this.k.h3 = a.b7;
                this.k.h4 = a.b8;
            }
            if (null != this.j) {
                this.j.dv = a.ha;
                this.j.ac = a.au;
                this.j.b8 = a.e6;
            }
            if (null != this.l) {
                this.l.text = a.ev;
                this.l.dc = a.g7;
                this.l.y = a.as;
            }
            if (null != this.am) {
                NativeUI.n(this.am, a.g9);
                NativeUI.j(this.am, a.g8);
                if (null != a.at) {
                    this.am.setStyleProperty("font", a.at.fontString);
                }
                this.am.setRawText(a.actualNoMatchesFoundLabel);
                this.bo();
            }
            if (null != this.d) {
                this.d.fl = a.density;
                let b = a.columnHeadersVisible;
                this.d.lt = b ? -1 : 0;
                this.d.l3 = a.rowSeparatorsVisible ? 1 : 0;
            }
            if (null != this.af) {
                let c = a.dropDownButtonVisible;
                MultiColumnComboBoxUtilities.c(this.af, c);
            }
        }
        cp() {
            if (!this.v) {
                if (null != this.j) {
                    let a = this.f.fc;
                    this.j.cg = a;
                }
            }
        }
        cm() {
            let a = this.n;
            let b = null != a ? a.t : false;
            this.i.svgPath = b ? MultiColumnComboBoxView.as : MultiColumnComboBoxView.at;
        }
        co() {
            let a = this.d.k7 + 3;
            let b = this.d.k8 + this.d.l3;
            let c = this.d.actualDataSource;
            let d = null != c ? c.actualCount : 0;
            if (d > 8) {
                d = 8;
            }
            let e = d * b;
            e += a;
            let f = stringFormat("{0}px", e);
            this.ag.setStyleProperty("height", f);
            let g = 0;
            let h = this.d.actualColumns.count;
            let i = 100;
            if (this.d.defaultColumnWidth != null) {
                i = this.d.defaultColumnWidth.f;
            }
            g = h * i;
            g += 2;
            let j = stringFormat("{0}px", g);
            this.ag.setStyleProperty("width", j);
            if (null != this.am) {
                let k = this.g;
                let l = MultiColumnComboBoxUtilities.e(this.ad, k.actualNoMatchesFoundLabel, k.as);
                let m = l.width;
                let n = l.height;
                let o = stringFormat("{0}px", m);
                let p = stringFormat("{0}px", n);
                this.am.setStyleProperty("width", o);
                this.am.setStyleProperty("height", p);
            }
        }
        cq() {
            if (this.w) {
                return;
            }
            this.au = null;
            let a = this.g.n();
            if (null != a) {
                let b = a.eo;
                if (null != b) {
                    a.eo = null;
                }
                else {
                    this.cr();
                }
            }
        }
        cr() {
            let a = this.g;
            if (null != a.c1) {
                let b = this.g.c1;
                let c = typeCast(Array_$type, b) !== null ? b : [b];
                let d = this.b();
                let e = d.indexOfKey(c);
                if (-1 != e) {
                    this.cg(e);
                }
            }
        }
        cs() {
            if (null == this.d) {
                this.ac.getPortal(this.ag, "DataGrid", (a) => {
                    this.aq = a.componentRef;
                    this.aq.height = '100%';
                    this.aq.width = '100%';
                    this.d = (this.aq.i);
                    this.cu();
                    this.d.dy = 1;
                    this.d.dw = 0;
                    this.d.cm = 1;
                    this.d.defaultColumnWidth = this.f.defaultColumnWidth;
                    this.cn();
                    this.d.cg = 0;
                    this.d.hx = false;
                    this.d.ho = false;
                    this.d.u1 = new CornerRadius(0, 0);
                    this.d.ha = false;
                    let b = this.d;
                    b.activeCellChanged = delegateCombine(b.activeCellChanged, runOn(this, this.a7));
                    let c = this.d;
                    c.selectedItemsChanged = delegateCombine(c.selectedItemsChanged, runOn(this, this.bd));
                    let d = this.d;
                    d.cellClicked = delegateCombine(d.cellClicked, runOn(this, this.ba));
                    let e = this.d;
                    e.sizeChanged = delegateCombine(e.sizeChanged, runOn(this, this.be));
                    let f = this.d;
                    f.actualColumnsChanged = delegateCombine(f.actualColumnsChanged, runOn(this, this.a9));
                    let g = this.d;
                    g.columnWidthChanged = delegateCombine(g.columnWidthChanged, runOn(this, this.bb));
                    this.ck();
                }, false);
            }
        }
        cl(a) {
            if (this.d != null) {
                this.d.defaultColumnWidth = a;
                this.co();
            }
        }
        cn() {
            if (this.d != null) {
                let a = 0;
                switch (this.f.x) {
                    case 0:
                        a = 0;
                        break;
                    case 1:
                        a = 1;
                        break;
                    case 2:
                        a = 2;
                        break;
                    case 3:
                        a = 3;
                        break;
                    case 4:
                        a = 4;
                        break;
                }
                this.d.d5 = a;
            }
        }
        ct() {
            if (!this.t) {
                return;
            }
            let a = this.d;
            let b = a.c1;
            if (null != b) {
                let c = this.b();
                if (null != c) {
                    let d = c.getItemAtIndex(b.b);
                    if (null == d) {
                        return;
                    }
                    a.i6(d);
                }
            }
            else {
                a.t5(0);
            }
        }
        cu() {
            if (null != this.aq) {
                let a = this.g;
                let b = a.itemsSource;
                this.d.ad.clear();
                if (this.d.actualDataSource != null) {
                    let c = this.d.actualDataSource;
                    c.schemaChanged = delegateRemove(c.schemaChanged, runOn(this, this.av));
                }
                this.aq.dataSource = b;
                this.aq.autoGenerateDesiredProperties = a.g;
                this.d.l = a.i();
                this.ao = -1;
                let d = this.b();
                if (null != d) {
                    let e = d.updateNotifier;
                    let f = new MultiColumnComboBoxDataSourceNotificationHandler(this, false);
                    let g = new MultipleDataSourceNotifier(1, [e, f]);
                    d.updateNotifier = g;
                    d.propertiesRequested = a.f;
                    d.schemaChanged = delegateCombine(d.schemaChanged, runOn(this, this.av));
                    if (this.g.c1 != null) {
                        this.b5(1, this.g.c1);
                    }
                }
                this.a = null;
            }
        }
        av(a, b) {
            if (this.ao != -1) {
                this.cg(this.ao);
                this.ao = -1;
            }
        }
        cv() {
            if (null != this.aj) {
                let a = this.f.actualLabelVisible;
                if (a) {
                    this.k.appendContentChild(this.aj);
                    this.k.inputs.add(this.l);
                }
                else {
                    this.k.mi(this.aj);
                    this.k.inputs.remove(this.l);
                }
            }
        }
        cf(a) {
            if (this.j != null) {
                this.j.disabled = !a;
            }
            if (this.k != null) {
                this.k.disabled = !a;
            }
        }
        cw() {
            this.co();
            if (!this.w) {
                this.z = false;
            }
            else {
                let a = this.b();
                this.z = a.actualCount == 0;
            }
            MultiColumnComboBoxUtilities.c(this.am, this.z);
            MultiColumnComboBoxUtilities.c(this.ag, !this.z);
        }
        a6(a) {
            if (this.j != null) {
                this.j.focus(a);
            }
        }
        cd() {
            if (this.j != null) {
                this.j.dd();
            }
        }
        get al() {
            return this.ak;
        }
        get g() {
            return this.f;
        }
        get ad() {
            return this.ac;
        }
        cx() {
            if (null != this.al) {
                this.al.setStyleProperty("box-sizing", "border-box");
            }
        }
        a2(a) {
            let b = a.target;
            if (!this.o()) {
                this.by();
            }
            else if (!this.u(b)) {
                this.by();
            }
        }
        ax(a) {
            this.d.ad.clear();
            this.j.cg = "";
            this.g.fc = "";
            this.g.c1 = null;
        }
        a4(a) {
            let b = this.n;
            if (b.t) {
                this.az();
            }
            else {
                this.aw(null);
            }
            if (null != this.j) {
                this.j.focus();
                this.j.dd();
            }
        }
        a7(a, b) {
            let c = b.newActiveCell;
            this.a8(c);
            this.r = true;
        }
        a9(a, b) {
            this.cq();
        }
        ba(a, b) {
            if (typeCast(TextHeaderCellModel.$, b.cellInfo) !== null) {
                return;
            }
            this.bq();
        }
        bb(a, b) {
            this.co();
            this.bo();
        }
        bd(a, b) {
            this.bc();
            this.s = true;
            this.ch();
        }
        be(a, b) {
            this.t = b.b != 0 && b.a != 0;
            this.ct();
        }
        bh(a, b) {
            if (b.isCompositionInProgress) {
                return;
            }
            this.f.fv(b);
            let c = b.value;
            this.b8(c);
        }
        bi(a, b) {
            let c = this.j.cg;
            this.b8(c);
        }
        bj(a, b) {
            this.cc();
        }
        bk(a, b) {
            this.f.fx(b);
            if (b.defaultPrevented) {
                return;
            }
            let c = b.keyCode;
            this.ap = c;
            this.x = false;
            let d = b.modifiers;
            switch (c) {
                case 8:
                    let e = this.j.selectionStart;
                    if (0 == e) {
                        break;
                    }
                    let f = this.j.cg;
                    if (stringIsNullOrEmpty(f)) {
                        break;
                    }
                    let g = f.length;
                    let h = this.j.selectionEnd;
                    let i = h - e;
                    if (i > 0 && i < g && h == g) {
                        this.x = true;
                    }
                    break;
                case 40:
                    if (d == 1) {
                        this.a3();
                        this.cq();
                        b.preventDefault();
                    }
                    else {
                        let j = this.e;
                        if (null == j) {
                            return;
                        }
                        let k = this.e.c1;
                        if (null != j.c1) {
                            this.d.ik(false, false);
                            b.preventDefault();
                        }
                        else {
                            let l = this.b();
                            if (null != l) {
                                let m = l.actualCount;
                                if (m > 0) {
                                    this.cg(0);
                                    b.preventDefault();
                                }
                            }
                        }
                    }
                    break;
                case 38:
                    if (d == 1) {
                        this.az();
                        b.preventDefault();
                    }
                    else {
                        let n = this.e;
                        if (null == n) {
                            return;
                        }
                        let o = this.e.c1;
                        if (null != n.c1) {
                            this.d.iy(false, false);
                            b.preventDefault();
                        }
                        else {
                            let p = this.b();
                            if (null != p) {
                                let q = p.actualCount;
                                if (q > 0) {
                                    this.cg(q - 1);
                                    b.preventDefault();
                                }
                            }
                        }
                    }
                    break;
                case 13:
                    if (this.n.t) {
                        b.stopPropagation();
                    }
                    this.bq();
                    break;
                case 27:
                    this.az();
                    break;
            }
        }
        bl(a, b) {
            if (false == this.o()) {
                this.j.dd();
                b.handled = true;
            }
        }
        bm(a) {
            this.j.focus();
            let b = (a.originalEvent.relatedTarget);
            if (!this.u(b)) {
                this.bx();
            }
        }
        bn(a) {
            let b = (a.originalEvent.relatedTarget);
            if (!this.u(b)) {
                this.by();
            }
        }
        cy(a) {
            let b = this.n;
            if (null == b || false == b.t) {
                return;
            }
            let c = this.cz();
            this.m.as(c);
        }
    }
    MultiColumnComboBoxView.$t = /*@__PURE__*/ markType(MultiColumnComboBoxView, 'MultiColumnComboBoxView');
    MultiColumnComboBoxView.ar = "M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z";
    MultiColumnComboBoxView.at = "M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6z";
    MultiColumnComboBoxView.as = "M12 8l-6 6 1.41 1.41L12 10.83l4.59 4.58L18 14z";
    return MultiColumnComboBoxView;
})();
/**
 * @hidden
 */
export let MultiColumnComboBox = /*@__PURE__*/ (() => {
    class MultiColumnComboBox extends Base {
        constructor() {
            super();
            this.c0 = null;
            this.hi = ThemeResolver.e(MultiColumnComboBox.aa, InputGroup.r6, InputGroup.qq);
            this.hj = ThemeResolver.e(MultiColumnComboBox.aa, InputGroup.r7, InputGroup.qr);
            this.cb = ThemeResolver.b(MultiColumnComboBox.aa, InputGroup.gk, InputGroup.er);
            this.h3 = ThemeResolver.f(MultiColumnComboBox.aa, InputGroup.tx, InputGroup.tr);
            this.gf = ThemeResolver.d(MultiColumnComboBox.aa, InputGroup.nh, InputGroup.nb);
            this.hk = ThemeResolver.e(MultiColumnComboBox.aa, InputGroup.r8, InputGroup.qs);
            this.cc = ThemeResolver.b(MultiColumnComboBox.aa, InputGroup.gl, InputGroup.es);
            this.hl = ThemeResolver.e(MultiColumnComboBox.aa, InputGroup.sa, InputGroup.qu);
            this.cd = ThemeResolver.b(MultiColumnComboBox.aa, InputGroup.gm, InputGroup.et);
            this.ce = ThemeResolver.b(MultiColumnComboBox.aa, InputGroup.gn, InputGroup.eu);
            this.hm = ThemeResolver.e(MultiColumnComboBox.aa, InputGroup.sb, InputGroup.qv);
            this.cf = ThemeResolver.b(MultiColumnComboBox.aa, InputGroup.go, InputGroup.ev);
            this.cg = ThemeResolver.b(MultiColumnComboBox.aa, InputGroup.gp, InputGroup.ew);
            this.hn = ThemeResolver.e(MultiColumnComboBox.aa, InputGroup.sc, InputGroup.qw);
            this.ch = ThemeResolver.b(MultiColumnComboBox.aa, InputGroup.gq, InputGroup.ex);
            this.ho = ThemeResolver.e(MultiColumnComboBox.aa, InputGroup.sd, InputGroup.qx);
            this.ci = ThemeResolver.b(MultiColumnComboBox.aa, InputGroup.gr, InputGroup.ey);
            this.cj = ThemeResolver.b(MultiColumnComboBox.aa, InputGroup.gs, InputGroup.ez);
            this.ck = ThemeResolver.b(MultiColumnComboBox.aa, InputGroup.gt, InputGroup.e0);
            this.ax = null;
            this.v = null;
            this.a4 = true;
            this.c = null;
            this.o = ColumnWidth.a;
            this.gr = null;
            this.gg = ThemeResolver.e(MultiColumnComboBox.aa, InputGroup.rc, InputGroup.pw);
            this.z = 0;
            this.y = 1;
            this.gs = null;
            this.gh = ThemeResolver.e(MultiColumnComboBox.aa, InputGroup.rd, InputGroup.px);
            this.bp = NaN;
            this.bf = ThemeResolver.b(MultiColumnComboBox.aa, InputGroup.fu, InputGroup.d1);
            this.a8 = true;
            this.h0 = new Thickness(1, NaN, NaN, NaN, NaN);
            this.hz = ThemeResolver.f(MultiColumnComboBox.aa, InputGroup.tv, InputGroup.tp);
            this.gc = new CornerRadius(1, NaN, NaN, NaN, NaN);
            this.gb = ThemeResolver.d(MultiColumnComboBox.aa, InputGroup.nf, InputGroup.m9);
            this.b = null;
            this.af = 0;
            this.ae = 0;
            this.ba = true;
            this.gt = null;
            this.gi = ThemeResolver.e(MultiColumnComboBox.aa, InputGroup.ru, InputGroup.qe);
            this.bq = NaN;
            this.bg = ThemeResolver.b(MultiColumnComboBox.aa, InputGroup.f5, InputGroup.ec);
            this.gu = null;
            this.gj = ThemeResolver.e(MultiColumnComboBox.aa, InputGroup.rw, InputGroup.qg);
            this.br = NaN;
            this.bh = ThemeResolver.b(MultiColumnComboBox.aa, InputGroup.f6, InputGroup.ed);
            this.bs = NaN;
            this.bi = ThemeResolver.b(MultiColumnComboBox.aa, InputGroup.f7, InputGroup.ee);
            this.gv = null;
            this.gk = ThemeResolver.e(MultiColumnComboBox.aa, InputGroup.rx, InputGroup.qh);
            this.bt = NaN;
            this.bj = ThemeResolver.b(MultiColumnComboBox.aa, InputGroup.f8, InputGroup.ef);
            this.bu = NaN;
            this.bk = ThemeResolver.b(MultiColumnComboBox.aa, InputGroup.f9, InputGroup.eg);
            this.cu = null;
            this.ex = null;
            this.gw = null;
            this.gl = MultiColumnComboBox.hf;
            this.ap = null;
            this.am = null;
            this.a5 = false;
            this.e0 = null;
            this.dn = "No Matches Found";
            this.gx = null;
            this.gm = MultiColumnComboBox.hg;
            this.gy = null;
            this.gn = MultiColumnComboBox.hh;
            this.aq = null;
            this.an = null;
            this.e7 = "";
            this.a3 = true;
            this.gz = MultiColumnComboBox.hp;
            this.go = MultiColumnComboBox.hp;
            this.ar = null;
            this.ao = null;
            this.g0 = null;
            this.gp = ThemeResolver.e(MultiColumnComboBox.aa, InputGroup.se, InputGroup.qy);
            this.bv = NaN;
            this.bl = ThemeResolver.b(MultiColumnComboBox.aa, InputGroup.gu, InputGroup.e1);
            this.g1 = null;
            this.gq = ThemeResolver.e(MultiColumnComboBox.aa, InputGroup.sf, InputGroup.qz);
            this.bw = NaN;
            this.bm = ThemeResolver.b(MultiColumnComboBox.aa, InputGroup.gv, InputGroup.e2);
            this.bx = NaN;
            this.bn = ThemeResolver.b(MultiColumnComboBox.aa, InputGroup.gw, InputGroup.e3);
            this.by = NaN;
            this.bo = ThemeResolver.b(MultiColumnComboBox.aa, InputGroup.gx, InputGroup.e4);
            this.a2 = true;
            this.w = 0;
            this.c3 = null;
            this.c2 = null;
            this.d = null;
            this.a = null;
            this.cv = null;
            this.bc = false;
            this.gotFocus = null;
            this.lostFocus = null;
            this.textChanged = null;
            this.valueChanged = null;
            this.keyDown = null;
            this.change = null;
            this.changing = null;
            this.propertyChanged = null;
            this.o = new ColumnWidth();
            this.o.f = 100;
            let a = this.u();
            this.v = a;
            a.bg(this);
        }
        u() {
            return new MultiColumnComboBoxView();
        }
        f4(a, b, c) {
            switch (a) {
                case "BackgroundColor":
                    this.g2 = this.hd != null ? this.hd : this.hi;
                    break;
                case "BorderColor":
                    this.g3 = this.he != null ? this.he : this.hj;
                    break;
                case "BorderWidth":
                    this.bz = !isNaN_(this.b9) ? this.b9 : this.cb;
                    break;
                case "ContentPadding":
                    this.h1 = InputGroup.ti(this.h2, this.h3);
                    break;
                case "CornerRadius":
                    this.gd = InputGroup.m2(this.ge, this.gf);
                    break;
                case "FocusBorderColor":
                    this.g4 = this.hq != null ? this.hq : this.hk;
                    break;
                case "FocusBorderWidth":
                    this.b0 = !isNaN_(this.cl) ? this.cl : this.cc;
                    break;
                case "FocusUnderlineColor":
                    this.g5 = this.hr != null ? this.hr : this.hl;
                    break;
                case "FocusUnderlineOpacity":
                    this.b1 = !isNaN_(this.cm) ? this.cm : this.cd;
                    break;
                case "FocusUnderlineRippleOpacity":
                    this.b2 = !isNaN_(this.cn) ? this.cn : this.ce;
                    break;
                case "HoverUnderlineColor":
                    this.g6 = this.hs != null ? this.hs : this.hm;
                    break;
                case "HoverUnderlineOpacity":
                    this.b3 = !isNaN_(this.co) ? this.co : this.cf;
                    break;
                case "HoverUnderlineWidth":
                    this.b4 = !isNaN_(this.cp) ? this.cp : this.cg;
                    break;
                case "ItemsSource":
                case "ValueField":
                case "DataSourceDesiredProperties":
                case "Fields":
                    this.v.cu();
                    break;
                case "DefaultColumnWidth":
                    this.v.cl(this.defaultColumnWidth);
                    break;
                case "LabelTextColor":
                    this.g7 = this.ht != null ? this.ht : MultiColumnComboBox.hf;
                    break;
                case "LabelTextStyle":
                    this.as = this.az != null ? this.az : MultiColumnComboBox.av;
                    break;
                case "NoMatchesFoundLabelTextColor":
                    this.g9 = this.hv != null ? this.hv : MultiColumnComboBox.hh;
                    break;
                case "NoMatchesFoundLabelBackgroundColor":
                    this.g8 = this.hu != null ? this.hu : MultiColumnComboBox.hg;
                    break;
                case "NoMatchesFoundLabelTextStyle":
                    this.at = this.a0 != null ? this.a0 : MultiColumnComboBox.aw;
                    break;
                case "UnderlineColor":
                    this.hb = this.hx != null ? this.hx : this.hn;
                    break;
                case "UnderlineOpacity":
                    this.b5 = !isNaN_(this.cq) ? this.cq : this.ch;
                    break;
                case "UnderlineRippleColor":
                    this.hc = this.hy != null ? this.hy : this.ho;
                    break;
                case "UnderlineRippleOpacity":
                    this.b6 = !isNaN_(this.cr) ? this.cr : this.ci;
                    break;
                case "UnderlineRippleWidth":
                    this.b7 = !isNaN_(this.cs) ? this.cs : this.cj;
                    break;
                case "UnderlineWidth":
                    this.b8 = !isNaN_(this.ct) ? this.ct : this.ck;
                    break;
                case "BaseTheme":
                    this.ab = this.ac == 0 ? 1 : this.ac;
                    break;
                case "Density":
                    this.ag = this.density == 0 ? 0 : this.density;
                    break;
                case "TextColor":
                    this.ha = this.hw != null ? this.hw : MultiColumnComboBox.hp;
                    break;
                case "TextStyle":
                    this.au = this.a1 != null ? this.a1 : null;
                    break;
                case "ActualDensity":
                case "ActualBaseTheme":
                case "ActualTextColor":
                case "ActualTextStyle":
                case "ActualBackgroundColor":
                case "ActualBorderColor":
                case "ActualBorderWidth":
                case "ActualContentPadding":
                case "ActualCornerRadius":
                case "ActualFocusBorderColor":
                case "ActualFocusBorderWidth":
                case "ActualFocusUnderlineColor":
                case "ActualFocusUnderlineOpacity":
                case "ActualFocusUnderlineRippleOpacity":
                case "ActualHoverUnderlineColor":
                case "ActualHoverUnderlineOpacity":
                case "ActualHoverUnderlineWidth":
                case "ActualLabelTextColor":
                case "ActualLabelTextStyle":
                case "ActualUnderlineColor":
                case "ActualUnderlineOpacity":
                case "ActualUnderlineRippleColor":
                case "ActualUnderlineRippleOpacity":
                case "ActualUnderlineRippleWidth":
                case "ActualUnderlineWidth":
                case "DropDownButtonVisible":
                case "ColumnHeadersVisible":
                case "RowSeparatorsVisible":
                case "ActualNoMatchesFoundLabel":
                case "ActualNoMatchesFoundLabelTextColor":
                case "ActualNoMatchesFoundLabelTextStyle":
                case MultiColumnComboBox.dq:
                    this.v.ck();
                    break;
                case "NoMatchesFoundLabel":
                    this.actualNoMatchesFoundLabel = stringIsNullOrEmpty(this.e1) ? "No Matches Found" : this.e1;
                    break;
                case "ActualLabelVisible":
                    this.v.cv();
                    break;
                case "Label":
                case "PlaceholderText":
                    this.v.ck();
                    this.actualLabelVisible = !stringIsNullOrEmpty(this.ex);
                    break;
                case "Text":
                    this.v.cp();
                    let d = b != null ? b.toString() : null;
                    let e = c != null ? c.toString() : null;
                    this.f1(new MultiColumnComboBoxTextChangedEventArgs(d, e));
                    this.f3(1, e);
                    break;
                case "Value":
                    this.f2(new MultiColumnComboBoxValueChangedEventArgs(b, c));
                    this.f3(0, c);
                    break;
                case "ShowClearButton":
                    this.v.ch();
                    break;
                case "AllowFilter":
                    this.v.a5(this.a7);
                    break;
                case "SortMode":
                    this.v.cn();
                    break;
            }
        }
        ga() {
            this.v.cx();
        }
        get ay() {
            if (null == this.ax) {
                this.ax = new FontInfo();
                this.ax.n = "'Segoe UI', Verdana";
                this.ax.d = 16;
            }
            return this.ax;
        }
        focus(a) {
            this.v.a6(a);
        }
        get be() {
            return this.a4;
        }
        set be(a) {
            let b = this.a4;
            this.a4 = a;
            if (b != this.a4) {
                this.fz("ShowClearButton", b, this.a4);
            }
        }
        get g() {
            return this.c;
        }
        set g(a) {
            let b = this.c;
            this.c = a;
            if (b != this.c) {
                this.fz("Fields", b, this.c);
            }
        }
        get defaultColumnWidth() {
            return this.o;
        }
        set defaultColumnWidth(a) {
            let b = this.o;
            this.o = a;
            if (b != this.o) {
                this.fz("DefaultColumnWidth", b, this.o);
            }
        }
        get hd() {
            return this.gr;
        }
        set hd(a) {
            let b = this.gr;
            this.gr = a;
            if (b != this.gr) {
                this.fz("BackgroundColor", b, a);
            }
        }
        get g2() {
            return this.gg;
        }
        set g2(a) {
            let b = this.gg;
            this.gg = a;
            if (b != this.gg) {
                this.fz("ActualBackgroundColor", b, a);
            }
        }
        get ac() {
            return this.z;
        }
        set ac(a) {
            let b = this.z;
            this.z = a;
            if (b != this.z) {
                this.fz("BaseTheme", enumGetBox(BaseControlTheme_$type, b), enumGetBox(BaseControlTheme_$type, a));
            }
        }
        get ab() {
            return this.y;
        }
        set ab(a) {
            let b = this.y;
            this.y = a;
            if (b != this.y) {
                this.fz("ActualBaseTheme", enumGetBox(BaseControlTheme_$type, b), enumGetBox(BaseControlTheme_$type, a));
            }
        }
        get he() {
            return this.gs;
        }
        set he(a) {
            let b = this.gs;
            this.gs = a;
            if (b != this.gs) {
                this.fz("BorderColor", b, a);
            }
        }
        get g3() {
            return this.gh;
        }
        set g3(a) {
            let b = this.gh;
            this.gh = a;
            if (b != this.gh) {
                this.fz("ActualBorderColor", b, a);
            }
        }
        get b9() {
            return this.bp;
        }
        set b9(a) {
            let b = this.bp;
            this.bp = a;
            if (b != this.bp) {
                this.fz("BorderWidth", b, a);
            }
        }
        get bz() {
            return this.bf;
        }
        set bz(a) {
            let b = this.bf;
            this.bf = a;
            if (b != this.bf) {
                this.fz("ActualBorderWidth", b, a);
            }
        }
        get columnHeadersVisible() {
            return this.a8;
        }
        set columnHeadersVisible(a) {
            let b = this.a8;
            this.a8 = a;
            if (b != this.a8) {
                this.fz("ColumnHeadersVisible", b, a);
            }
        }
        get h2() {
            return this.h0;
        }
        set h2(a) {
            let b = this.h0;
            this.h0 = a;
            if (b != this.h0) {
                this.fz("ContentPadding", b, a);
            }
        }
        get h1() {
            return this.hz;
        }
        set h1(a) {
            let b = this.hz;
            this.hz = a;
            if (b != this.hz) {
                this.fz("ActualContentPadding", b, a);
            }
        }
        get ge() {
            return this.gc;
        }
        set ge(a) {
            let b = this.gc;
            this.gc = a;
            if (b != this.gc) {
                this.fz("CornerRadius", b, a);
            }
        }
        get gd() {
            return this.gb;
        }
        set gd(a) {
            let b = this.gb;
            this.gb = a;
            if (b != this.gb) {
                this.fz("ActualCornerRadius", b, a);
            }
        }
        get f() {
            return this.b;
        }
        set f(a) {
            let b = this.b;
            this.b = a;
            if (b != this.b) {
                this.fz("DataSourceDesiredProperties", b, this.b);
            }
        }
        get density() {
            return this.af;
        }
        set density(a) {
            let b = this.af;
            this.af = a;
            if (b != this.af) {
                this.fz("Density", enumGetBox(ControlDisplayDensity_$type, b), enumGetBox(ControlDisplayDensity_$type, a));
            }
        }
        get ag() {
            return this.ae;
        }
        set ag(a) {
            let b = this.ae;
            this.ae = a;
            if (b != this.ae) {
                this.fz("ActualDensity", enumGetBox(ControlDisplayDensity_$type, b), enumGetBox(ControlDisplayDensity_$type, a));
            }
        }
        get dropDownButtonVisible() {
            return this.ba;
        }
        set dropDownButtonVisible(a) {
            let b = this.ba;
            this.ba = a;
            if (b != this.ba) {
                this.fz("DropDownButtonVisible", b, a);
            }
        }
        get hq() {
            return this.gt;
        }
        set hq(a) {
            let b = this.gt;
            this.gt = a;
            if (b != this.gt) {
                this.fz("FocusBorderColor", b, a);
            }
        }
        get g4() {
            return this.gi;
        }
        set g4(a) {
            let b = this.gi;
            this.gi = a;
            if (b != this.gi) {
                this.fz("ActualFocusBorderColor", b, a);
            }
        }
        get cl() {
            return this.bq;
        }
        set cl(a) {
            let b = this.bq;
            this.bq = a;
            if (b != this.bq) {
                this.fz("FocusBorderWidth", b, a);
            }
        }
        get b0() {
            return this.bg;
        }
        set b0(a) {
            let b = this.bg;
            this.bg = a;
            if (b != this.bg) {
                this.fz("ActualFocusBorderWidth", b, a);
            }
        }
        get hr() {
            return this.gu;
        }
        set hr(a) {
            let b = this.gu;
            this.gu = a;
            if (b != this.gu) {
                this.fz("FocusUnderlineColor", b, a);
            }
        }
        get g5() {
            return this.gj;
        }
        set g5(a) {
            let b = this.gj;
            this.gu = a;
            if (b != this.gj) {
                this.fz("ActualFocusUnderlineColor", b, a);
            }
        }
        get cm() {
            return this.br;
        }
        set cm(a) {
            let b = this.br;
            this.br = a;
            if (b != this.br) {
                this.fz("FocusUnderlineOpacity", b, a);
            }
        }
        get b1() {
            return this.bh;
        }
        set b1(a) {
            let b = this.bh;
            this.bh = a;
            if (b != this.bh) {
                this.fz("ActualFocusUnderlineOpacity", b, a);
            }
        }
        get cn() {
            return this.bs;
        }
        set cn(a) {
            let b = this.bs;
            this.bs = a;
            if (b != this.bs) {
                this.fz("FocusUnderlineRippleOpacity", b, a);
            }
        }
        get b2() {
            return this.bi;
        }
        set b2(a) {
            let b = this.bi;
            this.bi = a;
            if (b != this.bi) {
                this.fz("ActualFocusUnderlineRippleOpacity", b, a);
            }
        }
        get hs() {
            return this.gv;
        }
        set hs(a) {
            let b = this.gv;
            this.gv = a;
            if (b != this.gv) {
                this.fz("HoverUnderlineColor", b, a);
            }
        }
        get g6() {
            return this.gk;
        }
        set g6(a) {
            let b = this.gk;
            this.gk = a;
            if (b != this.gk) {
                this.fz("ActualHoverUnderlineColor", b, a);
            }
        }
        get co() {
            return this.bt;
        }
        set co(a) {
            let b = this.bt;
            this.bt = a;
            if (b != this.bt) {
                this.fz("HoverUnderlineOpacity", b, a);
            }
        }
        get b3() {
            return this.bj;
        }
        set b3(a) {
            let b = this.bj;
            this.bj = a;
            if (b != this.bj) {
                this.fz("ActualHoverUnderlineOpacity", b, a);
            }
        }
        get cp() {
            return this.bu;
        }
        set cp(a) {
            let b = this.bu;
            this.bu = a;
            if (b != this.bu) {
                this.fz("HoverUnderlineWidth", b, a);
            }
        }
        get b4() {
            return this.bk;
        }
        set b4(a) {
            let b = this.bk;
            this.bk = a;
            if (b != this.bk) {
                this.fz("ActualHoverUnderlineWidth", b, a);
            }
        }
        get itemsSource() {
            return this.cu;
        }
        set itemsSource(a) {
            let b = this.cu;
            this.cu = a;
            if (b != this.cu) {
                this.fz("ItemsSource", b, this.cu);
            }
        }
        get actualDataSource() {
            return this.v.b();
        }
        get ev() {
            return this.ex;
        }
        set ev(a) {
            let b = this.ev;
            if (0 == StringComparer.b.compare(a, b)) {
                return;
            }
            this.ex = a;
            this.fz("Label", b, this.ex);
        }
        get ht() {
            return this.gw;
        }
        set ht(a) {
            let b = this.gw;
            this.gw = a;
            if (b != this.gw) {
                this.fz("LabelTextColor", b, a);
            }
        }
        get g7() {
            return this.gl;
        }
        set g7(a) {
            let b = this.gl;
            this.gl = a;
            if (b != this.gl) {
                this.fz("ActualLabelTextColor", b, a);
            }
        }
        get az() {
            return this.ap;
        }
        set az(a) {
            let b = this.ap;
            this.ap = a;
            if (b != this.ap) {
                this.fz("LabelTextStyle", b, this.ap);
            }
        }
        get as() {
            return this.am;
        }
        set as(a) {
            let b = this.am;
            this.am = a;
            if (this.am != b) {
                this.fz("ActualLabelTextStyle", b, this.am);
            }
        }
        get actualLabelVisible() {
            return this.a5;
        }
        set actualLabelVisible(a) {
            let b = this.a5;
            this.a5 = a;
            if (b != this.a5) {
                this.fz("ActualLabelVisible", b, a);
            }
        }
        get e1() {
            return this.e0;
        }
        set e1(a) {
            let b = this.e0;
            if (0 == StringComparer.b.compare(a, b)) {
                return;
            }
            this.e0 = a;
            this.fz("NoMatchesFoundLabel", b, this.e0);
        }
        get actualNoMatchesFoundLabel() {
            return this.dn;
        }
        set actualNoMatchesFoundLabel(a) {
            let b = this.dn;
            this.dn = a;
            if (b != this.dn) {
                this.fz("ActualNoMatchesFoundLabel", b, a);
            }
        }
        get hu() {
            return this.gx;
        }
        set hu(a) {
            let b = this.gx;
            this.gx = a;
            if (b != this.gx) {
                this.fz("NoMatchesFoundLabelBackgroundColor", b, a);
            }
        }
        get g8() {
            return this.gm;
        }
        set g8(a) {
            let b = this.gm;
            this.gm = a;
            if (b != this.gm) {
                this.fz(MultiColumnComboBox.dq, b, a);
            }
        }
        get hv() {
            return this.gy;
        }
        set hv(a) {
            let b = this.gy;
            this.gy = a;
            if (b != this.gy) {
                this.fz("NoMatchesFoundLabelTextColor", b, a);
            }
        }
        get g9() {
            return this.gn;
        }
        set g9(a) {
            let b = this.gn;
            this.gn = a;
            if (b != this.gn) {
                this.fz("ActualNoMatchesFoundLabelTextColor", b, a);
            }
        }
        get a0() {
            return this.aq;
        }
        set a0(a) {
            let b = this.aq;
            this.aq = a;
            if (b != this.aq) {
                this.fz("NoMatchesFoundLabelTextStyle", b, this.aq);
            }
        }
        get at() {
            return this.an;
        }
        set at(a) {
            let b = this.an;
            this.an = a;
            if (this.an != b) {
                this.fz("ActualNoMatchesFoundLabelTextStyle", b, this.an);
            }
        }
        get e6() {
            return this.e7;
        }
        set e6(a) {
            let b = this.e6;
            if (0 == StringComparer.b.compare(a, b)) {
                return;
            }
            this.e7 = a;
            this.fz("PlaceholderText", b, this.e7);
        }
        get rowSeparatorsVisible() {
            return this.a3;
        }
        set rowSeparatorsVisible(a) {
            let b = this.a3;
            this.a3 = a;
            if (b != this.a3) {
                this.fz("RowSeparatorsVisible", b, a);
            }
        }
        get hw() {
            return this.gz;
        }
        set hw(a) {
            let b = this.gz;
            this.gz = a;
            if (b != this.gz) {
                this.fz("TextColor", b, a);
            }
        }
        get ha() {
            return this.go;
        }
        set ha(a) {
            let b = this.go;
            this.go = a;
            if (b != this.go) {
                this.fz("ActualTextColor", b, a);
            }
        }
        get a1() {
            return this.ar;
        }
        set a1(a) {
            let b = this.ar;
            this.ar = a;
            if (b != this.ar) {
                this.fz("TextStyle", b, this.ar);
            }
        }
        get au() {
            return this.ao;
        }
        set au(a) {
            let b = this.ao;
            this.ao = a;
            if (this.ao != b) {
                this.fz("ActualTextStyle", b, this.ao);
            }
        }
        get hx() {
            return this.g0;
        }
        set hx(a) {
            let b = this.g0;
            this.g0 = a;
            if (b != this.g0) {
                this.fz("UnderlineColor", b, a);
            }
        }
        get hb() {
            return this.gp;
        }
        set hb(a) {
            let b = this.gp;
            this.gp = a;
            if (b != this.gp) {
                this.fz("ActualUnderlineColor", b, a);
            }
        }
        get cq() {
            return this.bv;
        }
        set cq(a) {
            let b = this.bv;
            this.bv = a;
            if (b != this.bv) {
                this.fz("UnderlineOpacity", b, a);
            }
        }
        get b5() {
            return this.bl;
        }
        set b5(a) {
            let b = this.bl;
            this.bl = a;
            if (b != this.bl) {
                this.fz("ActualUnderlineOpacity", b, a);
            }
        }
        get hy() {
            return this.g1;
        }
        set hy(a) {
            let b = this.g1;
            this.g1 = a;
            if (b != this.g1) {
                this.fz("UnderlineRippleColor", b, a);
            }
        }
        get hc() {
            return this.gq;
        }
        set hc(a) {
            let b = this.gq;
            this.gq = a;
            if (b != this.gq) {
                this.fz("ActualUnderlineRippleColor", b, a);
            }
        }
        get cr() {
            return this.bw;
        }
        set cr(a) {
            let b = this.bw;
            this.bw = a;
            if (b != this.bw) {
                this.fz("UnderlineRippleOpacity", b, a);
            }
        }
        get b6() {
            return this.bm;
        }
        set b6(a) {
            let b = this.bm;
            this.bm = a;
            if (b != this.bm) {
                this.fz("ActualUnderlineRippleOpacity", b, a);
            }
        }
        get cs() {
            return this.bx;
        }
        set cs(a) {
            let b = this.bx;
            this.bx = a;
            if (b != this.bx) {
                this.fz("UnderlineRippleWidth", b, a);
            }
        }
        get b7() {
            return this.bn;
        }
        set b7(a) {
            let b = this.bn;
            this.bn = a;
            if (b != this.bn) {
                this.fz("ActualUnderlineRippleWidth", b, a);
            }
        }
        get ct() {
            return this.by;
        }
        set ct(a) {
            let b = this.by;
            this.by = a;
            if (b != this.by) {
                this.fz("UnderlineWidth", b, a);
            }
        }
        get b8() {
            return this.bo;
        }
        set b8(a) {
            let b = this.bo;
            this.bo = a;
            if (b != this.bo) {
                this.fz("ActualUnderlineWidth", b, a);
            }
        }
        get a7() {
            return this.a2;
        }
        set a7(a) {
            let b = this.a2;
            this.a2 = a;
            if (b != this.a2) {
                this.fz("AllowFilter", b, a);
            }
        }
        get x() {
            return this.w;
        }
        set x(a) {
            let b = this.w;
            this.w = a;
            if (b != this.w) {
                this.fz("SortMode", enumGetBox(SortMode_$type, b), enumGetBox(SortMode_$type, this.w));
            }
        }
        get fe() {
            return this.c3;
        }
        set fe(a) {
            let b = this.c3;
            this.c3 = a;
            if (b != this.c3) {
                this.fz("TextField", b, a);
            }
        }
        get fc() {
            return this.c2;
        }
        set fc(a) {
            let b = this.c2;
            this.c2 = a;
            if (b != this.c2) {
                this.fz("Text", b, a);
            }
        }
        get j() {
            return this.d;
        }
        set j(a) {
            let b = this.d;
            this.d = a;
            if (b != this.d) {
                this.fz("ValueField", b, a);
            }
        }
        get e() {
            return this.a;
        }
        set e(a) {
            let b = this.a;
            this.a = a;
            if (b != this.a) {
                this.fz("ActualValueField", b, a);
            }
        }
        get c1() {
            return this.cv;
        }
        set c1(a) {
            let b = this.cv;
            this.cv = a;
            if (b != this.cv) {
                this.fz("Value", b, a);
            }
        }
        cx(a, b) {
            let c = new FastReflectionHelper(false, b);
            return c.getPropertyValue(a);
        }
        n() {
            let a = this.eq();
            return this.m(a);
        }
        eq() {
            return this.ep(this.fe);
        }
        cy(a) {
            let b = this.i();
            if (null == b || b.length == 0) {
                return null;
            }
            let c = new List$1(Base.$, 0);
            for (let e = 0; e < b.length; e++) {
                let d = b[e];
                let f = this.cx(a, d);
                c.add1(f);
            }
            if (c.count == 1) {
                return c._inner[0];
            }
            return c.toArray();
        }
        eo(a) {
            let b = this.eq();
            let c;
            if (null != b) {
                let d = this.cx(a, b);
                c = null != d ? d.toString() : null;
            }
            else {
                c = null;
            }
            return c;
        }
        m(a) {
            let b = this.v.e;
            if (null == b) {
                return null;
            }
            let c = b.actualColumns;
            if (null == c || 0 == c.count) {
                return null;
            }
            if (stringIsNullOrEmpty(a)) {
                return c._inner[0];
            }
            for (let d of fromEnum(c)) {
                if (0 == StringComparer.b.compare(d.h4, a)) {
                    return d;
                }
            }
            return null;
        }
        ep(a) {
            if (stringIsNullOrEmpty(a)) {
                let b = this.actualDataSource;
                if (null == b) {
                    return null;
                }
                let c = b.actualSchema;
                if (null == c) {
                    return null;
                }
                let d = c.propertyNames;
                if (0 == d.length) {
                    return null;
                }
                return d[0];
            }
            return a;
        }
        h(a) {
            let b = new List$1(String_$type, 0);
            if (null == a || a.length == 0) {
                let c = this.ep(null);
                if (stringIsNullOrEmpty(c)) {
                    return null;
                }
                b.add(c);
                return b.toArray();
            }
            for (let e = 0; e < a.length; e++) {
                let d = a[e];
                let f = this.ep(d);
                if (null != f) {
                    b.add(f);
                }
            }
            if (b.count > 0) {
                return b.toArray();
            }
            return null;
        }
        i() {
            let a = this.j;
            return this.h(a);
        }
        f0(a) {
            this.f3(2, a);
        }
        f3(a, b) {
            if (this.bc) {
                return;
            }
            this.bc = true;
            try {
                switch (a) {
                    case 2:
                        {
                            let c = b;
                            let d;
                            let e;
                            if (null != c) {
                                d = this.eo(c);
                                e = this.cy(c);
                            }
                            else {
                                d = stringEmpty();
                                e = null;
                            }
                            if (this.fc != d) {
                                this.fc = d;
                            }
                            if (this.c1 != e) {
                                this.c1 = e;
                            }
                        }
                        break;
                    case 1:
                        this.v.cj(b.toString());
                        break;
                    case 0:
                        this.v.ci(b);
                        break;
                }
            }
            finally {
                this.bc = false;
            }
            this.v.ch();
        }
        f7(a) {
            this.fc = a;
        }
        f9() {
            this.au = (null == this.a1) ? this.ay : this.a1;
            this.as = (null == this.az) ? this.ay : this.az;
        }
        f8() {
        }
        closeUp() {
            this.v.az();
        }
        destroy() {
            this.provideRenderer(null);
        }
        dropDown() {
            this.v.a3();
        }
        select() {
            this.v.cd();
        }
        notifySizeChanged() {
            this.v.bp();
        }
        provideRenderer(a) {
            this.v.b3(a);
        }
        cw() {
            return this.l();
        }
        eh() {
            let a = this.l();
            return a.am();
        }
        l() {
            let a = new MultiColumnComboVisualModelExport();
            a.a = AppearanceHelper.a(this.g2);
            a.j = this.ab;
            a.b = AppearanceHelper.a(this.g3);
            a.p = this.bz;
            a.columnHeadersVisible = this.columnHeadersVisible;
            a.au = this.h1;
            a.at = this.gd;
            a.k = this.ag;
            a.dropDownButtonVisible = this.dropDownButtonVisible;
            a.q = this.b1;
            a.aa = this.ev;
            a.c = AppearanceHelper.a(this.g7);
            a.actualLabelVisible = this.actualLabelVisible;
            a.actualNoMatchesFoundLabel = this.actualNoMatchesFoundLabel;
            a.d = AppearanceHelper.a(this.g8);
            a.e = AppearanceHelper.a(this.g9);
            a.al = this.e6;
            a.rowSeparatorsVisible = this.rowSeparatorsVisible;
            a.f = AppearanceHelper.a(this.ha);
            a.g = AppearanceHelper.a(this.hb);
            a.r = this.b5;
            a.h = AppearanceHelper.a(this.hc);
            a.s = this.b6;
            a.t = this.b7;
            a.u = this.b8;
            a.an = this.fc;
            a.y = this.c1;
            a.i = this.v.e.mc();
            if (this.as != null) {
                let b = this.as;
                if (this.v != null && b.n == null) {
                    let c = this.v.ad;
                    let d = FontUtil.getFontInfoFromString(c, b.fontString);
                    b.n = d.n;
                    b.d = d.d;
                    b.o = d.o;
                    b.q = d.q;
                    b.r = d.r;
                    b.s = d.s;
                }
                if (b.n != null) {
                    a.ab = b.n;
                }
                if (!isNaN_(b.d)) {
                    a.v = b.d;
                }
                if (b.s != null) {
                    a.af = b.s;
                }
                if (b.q != null) {
                    a.ad = b.q;
                }
                if (b.o != null) {
                    a.ac = b.q;
                }
            }
            if (this.at != null) {
                let e = this.at;
                if (this.v != null && e.n == null) {
                    let f = this.v.ad;
                    let g = FontUtil.getFontInfoFromString(f, e.fontString);
                    e.n = g.n;
                    e.d = g.d;
                    e.o = g.o;
                    e.q = g.q;
                    e.r = g.r;
                    e.s = g.s;
                }
                if (e.n != null) {
                    a.ag = e.n;
                }
                if (!isNaN_(e.d)) {
                    a.w = e.d;
                }
                if (e.s != null) {
                    a.ak = e.s;
                }
                if (e.q != null) {
                    a.ai = e.q;
                }
                if (e.o != null) {
                    a.ah = e.q;
                }
            }
            if (this.au != null) {
                let h = this.au;
                if (this.v != null && h.n == null) {
                    let i = this.v.ad;
                    let j = FontUtil.getFontInfoFromString(i, h.fontString);
                    h.n = j.n;
                    h.d = j.d;
                    h.o = j.o;
                    h.q = j.q;
                    h.r = j.r;
                    h.s = j.s;
                }
                if (h.n != null) {
                    a.ao = h.n;
                }
                if (!isNaN_(h.d)) {
                    a.x = h.d;
                }
                if (h.s != null) {
                    a.as = h.s;
                }
                if (h.q != null) {
                    a.aq = h.q;
                }
                if (h.o != null) {
                    a.ap = h.q;
                }
            }
            return a;
        }
        fw(a) {
            if (null != this.gotFocus) {
                this.gotFocus(this, a);
            }
        }
        fy(a) {
            if (null != this.lostFocus) {
                this.lostFocus(this, a);
            }
        }
        f1(a) {
            if (null != this.textChanged) {
                this.textChanged(this, a);
            }
        }
        f2(a) {
            if (null != this.valueChanged) {
                this.valueChanged(this, a);
            }
        }
        fz(a, b, c) {
            if (this.propertyChanged != null) {
                this.propertyChanged(this, new PropertyChangedEventArgs(a));
            }
            this.f4(a, b, c);
        }
        fx(a) {
            if (null != this.keyDown) {
                this.keyDown(this, a);
            }
        }
        fv(a) {
            if (null != this.changing) {
                this.changing(this, a);
            }
        }
    }
    MultiColumnComboBox.$t = /*@__PURE__*/ markType(MultiColumnComboBox, 'MultiColumnComboBox', Base.$, [INotifyPropertyChanged_$type]);
    MultiColumnComboBox.aa = 1;
    MultiColumnComboBox.hf = /*@__PURE__*/ ThemeResolver.e(MultiColumnComboBox.aa, Label.c7, Label.c0);
    MultiColumnComboBox.hh = /*@__PURE__*/ ThemeResolver.e(MultiColumnComboBox.aa, Label.c7, Label.c0);
    MultiColumnComboBox.hg = /*@__PURE__*/ BrushUtil.g(255, 255, 255, 255);
    MultiColumnComboBox.av = null;
    MultiColumnComboBox.dq = "ActualNoMatchesFoundLabelBackgroundColor";
    MultiColumnComboBox.aw = null;
    MultiColumnComboBox.hp = /*@__PURE__*/ BrushUtil.g(221, 0, 0, 0);
    return MultiColumnComboBox;
})();
/**
 * @hidden
 */
export let MultiColumnComboBoxDataSourceNotificationHandler = /*@__PURE__*/ (() => {
    class MultiColumnComboBoxDataSourceNotificationHandler extends Base {
        constructor(a, b) {
            super();
            this.a = null;
            this.b = false;
            this.a = a;
            this.b = b;
        }
        rangeActualized(a, b) {
            if (!this.b) {
                this.a.bz(a, b);
            }
            else {
                this.a.bt(a, b);
            }
        }
        notifySetItem(a, b, c) {
            if (!this.b) {
                this.a.b4(a, b, c);
            }
            else {
                this.a.bw(a, b, c);
            }
        }
        notifyClearItems() {
            if (!this.b) {
                this.a.br();
            }
            else {
                this.a.bs();
            }
        }
        notifyInsertItem(a, b) {
            if (!this.b) {
                this.a.b0(a, b);
            }
            else {
                this.a.bu(a, b);
            }
        }
        notifyRemoveItem(a, b) {
            if (!this.b) {
                this.a.b2(a, b);
            }
            else {
                this.a.bv(a, b);
            }
        }
    }
    MultiColumnComboBoxDataSourceNotificationHandler.$t = /*@__PURE__*/ markType(MultiColumnComboBoxDataSourceNotificationHandler, 'MultiColumnComboBoxDataSourceNotificationHandler', Base.$, [IDataSourceUpdateNotifier_$type]);
    return MultiColumnComboBoxDataSourceNotificationHandler;
})();
//# sourceMappingURL=MultiColumnComboBoxView_combined.js.map
