/*
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, EnumUtil, fromEnum, markType } from "./type";
import { CodeGenerationTargetPlatforms_$type } from "./CodeGenerationTargetPlatforms";
import { stringContains, stringEndsWith, stringStartsWith } from "./string";
/**
 * @hidden
 */
export let WebImportsHalper = /*@__PURE__*/ (() => {
    class WebImportsHalper extends Base {
        static a(a, b, c, d, e, f, g) {
            for (let h of fromEnum(f)) {
                let i = h;
                let j = h;
                let k = null;
                if (stringContains(i, ":")) {
                    let l = i.split(':');
                    i = l[0];
                    k = l[1];
                    j = i;
                }
                if (stringEndsWith(i, "Component")) {
                    i = i.substr(0, i.length - ("Component").length);
                }
                if (stringStartsWith(i, d)) {
                    i = i.substr(d.length);
                }
                if (e.getMetadata(i, "__importTypes" + EnumUtil.getName(CodeGenerationTargetPlatforms_$type, a.platform)) != null) {
                    g.addPackageImport(e.getMetadata(i, "__importTypes" + EnumUtil.getName(CodeGenerationTargetPlatforms_$type, a.platform)).specificExternalType, j);
                }
                else if (e.getMetadata("Web" + i, "__importTypes" + EnumUtil.getName(CodeGenerationTargetPlatforms_$type, a.platform)) != null) {
                    g.addPackageImport(e.getMetadata("Web" + i, "__importTypes" + EnumUtil.getName(CodeGenerationTargetPlatforms_$type, a.platform)).specificExternalType, j);
                }
                else {
                    if (k != null) {
                        g.addPackageImport(k, j);
                    }
                    else {
                        g.addPackageImport("igniteui-" + b + "-" + c, j);
                    }
                }
            }
        }
    }
    WebImportsHalper.$t = markType(WebImportsHalper, 'WebImportsHalper');
    return WebImportsHalper;
})();
