define("viewbuilderImpl", ["viewBuilderApi", "translationmanagerApi", "clientkernelLoaderApi", "displayEngineApi", "PIXI", "BABYLON", "clientkernelEventbusApi", "clientkernelModulesApi"],
    function(viewBuilderApi, translationmanagerApi, clientkernelLoaderApi, displayEngineApi, PIXI, BABYLON, clientkernelEventbusApi, clientkernelModulesApi) {
        "use strict";

        function $iterator(o) {
            if (o instanceof Array) return function() {
                return {
                    cur: 0,
                    arr: o,
                    hasNext: function() {
                        return this.cur < this.arr.length;
                    },
                    next: function() {
                        return this.arr[this.cur++];
                    }
                };
            };
            return typeof(o.iterator) == 'function' ? $bind(o, o.iterator) : o.iterator;
        };;
        var $fid = 0;

        function $bind(o, m) {
            if (m == null) return null;
            if (m.__id__ == null) m.__id__ = $fid++;
            var f;
            if (o.hx__closures__ == null) o.hx__closures__ = {};
            else f = o.hx__closures__[m.__id__];
            if (f == null) {
                f = function() {
                    return f.method.apply(f.scope, arguments);
                };
                f.scope = o;
                f.method = m;
                o.hx__closures__[m.__id__] = f;
            }
            return f;
        };
        var $_;
        var $estr = function() {
            return _hcmn_.js_Boot.__string_rec(this, '');
        };
        if (typeof haxe == 'undefined') {
            var haxe = {};
        };

        haxe.IMap = function() {}
        haxe.IMap.prototype = {

            get: function(k) {
                return {
                    arguments: ["*"],
                    returns: "null"
                };
            },
            set: function(k, v) {
                return {
                    arguments: ["*", "*"],
                    returns: "void"
                };
            },
            remove: function(k) {
                return {
                    arguments: ["*"],
                    returns: "boolean"
                };
            },
            keys: function() {
                return {
                    arguments: [],
                    returns: "null"
                };
            },
            iterator: function() {
                return {
                    arguments: [],
                    returns: "null"
                };
            }
        };
        if (!haxe.ds) {
            haxe.ds = {};
        };
        if (!haxe.ds._StringMap) {
            haxe.ds._StringMap = {};
        };
        haxe.ds._StringMap.StringMapIterator = function(map, keys) {
            this.map = map;
            this.keys = keys;
            this.index = 0;
            this.count = keys.length;
        };
        haxe.ds._StringMap.StringMapIterator.__name__ = ["haxe", "ds", "_StringMap", "StringMapIterator"];
        haxe.ds._StringMap.StringMapIterator.prototype.map = null;
        haxe.ds._StringMap.StringMapIterator.prototype.keys = null;
        haxe.ds._StringMap.StringMapIterator.prototype.index = null;
        haxe.ds._StringMap.StringMapIterator.prototype.count = null;
        haxe.ds._StringMap.StringMapIterator.prototype.hasNext = function() {
            return this.index < this.count;
        };
        haxe.ds._StringMap.StringMapIterator.prototype.next = function() {
            return this.map.get(this.keys[this.index++]);
        };
        haxe.ds._StringMap.StringMapIterator.prototype.__class__ = haxe.ds._StringMap.StringMapIterator;
        if (typeof js == 'undefined') {
            var js = {};
        };
        if (!js._Boot) {
            js._Boot = {};
        };
        js._Boot.HaxeError = function(val) {
            Error.call(this);
            this.val = val;
            this.message = String(val);
            if (Error.captureStackTrace) Error.captureStackTrace(this, js._Boot.HaxeError);
        };
        js._Boot.HaxeError.__name__ = ["js", "_Boot", "HaxeError"];
        js._Boot.HaxeError.__super__ = Error;
        for (var k in Error.prototype) js._Boot.HaxeError.prototype[k] = Error.prototype[k];
        js._Boot.HaxeError.prototype.val = null;
        js._Boot.HaxeError.prototype.__class__ = js._Boot.HaxeError;
        if (typeof viewbuilderImpl == 'undefined') {
            var viewbuilderImpl = {};
        };
        viewbuilderImpl.Activator = function() {};
        viewbuilderImpl.Activator = ck_implements(viewbuilderImpl.Activator, clientkernelModulesApi.IModuleActivator);
        viewbuilderImpl.Activator.__interfaces__ = [clientkernelModulesApi.IModuleActivator];
        viewbuilderImpl.Activator.__name__ = ["viewbuilderImpl", "Activator"];
        viewbuilderImpl.Activator.prototype.start = function(context) {
            context.getServiceTracker([displayEngineApi.IDisplayProvider, translationmanagerApi.ITranslationManager, clientkernelLoaderApi.IAssetRegistry, clientkernelLoaderApi.IVariableRegistry]).then(function(context1) {
                viewbuilderImpl.ExternalService.initialize(context1);
                viewbuilderImpl.ExternalService.assetRegistry.getAsset("multilanguage_assets").getAllContent().then(function(multilanguageData) {
                    var mlAssets = [];
                    var $it0 = multilanguageData.keys();
                    while ($it0.hasNext()) {
                        var k = $it0.next();
                        if (k.indexOf("multilanguage-gfx") != -1) {
                            mlAssets.push(viewbuilderImpl.ExternalService.assetRegistry.getAsset(k + "-json").getContent());
                            mlAssets.push(viewbuilderImpl.ExternalService.assetRegistry.getAsset(k + "-img").getContent());
                        }
                    }
                    if (mlAssets.length > 0) {
                        var prom = Promise.all(mlAssets);
                        prom.then(function(assets) {
                            var vbFactory = viewbuilderImpl.ViewBuilderFactory.getInstance();
                            var assetPair = new _hcmn_.haxe_ds_StringMap();
                            var _g1 = 0;
                            var _g = assets.length;
                            while (_g1 < _g) {
                                var i = _g1++;
                                if (i % 2 == 0) {
                                    assetPair = new _hcmn_.haxe_ds_StringMap();
                                    assetPair.set("json", assets[i]);
                                } else {
                                    assetPair.set("img", assets[i]);
                                    vbFactory.multilanguageAssets.push(assetPair);
                                }
                            }
                            context1.registerService(vbFactory, viewBuilderApi.IViewBuilderFactory, null);
                        });
                    } else context1.registerService(viewbuilderImpl.ViewBuilderFactory.getInstance(), viewBuilderApi.IViewBuilderFactory, null);
                });
            });
        };
        viewbuilderImpl.Activator.prototype.stop = function(context) {};
        viewbuilderImpl.Activator.main = function() {};
        viewbuilderImpl.Activator.prototype.__class__ = viewbuilderImpl.Activator;
        viewbuilderImpl.ExternalService = function() {};
        viewbuilderImpl.ExternalService.__name__ = ["viewbuilderImpl", "ExternalService"];
        viewbuilderImpl.ExternalService.displayProvider = null;
        viewbuilderImpl.ExternalService.assetRegistry = null;
        viewbuilderImpl.ExternalService.translationManager = null;
        viewbuilderImpl.ExternalService.variableRegistry = null;
        viewbuilderImpl.ExternalService.initialize = function(context) {
            viewbuilderImpl.ExternalService.displayProvider = context.getAnyService(displayEngineApi.IDisplayProvider, null);
            viewbuilderImpl.ExternalService.assetRegistry = context.getAnyService(clientkernelLoaderApi.IAssetRegistry, null);
            viewbuilderImpl.ExternalService.translationManager = context.getAnyService(translationmanagerApi.ITranslationManager, null);
            viewbuilderImpl.ExternalService.variableRegistry = context.getAnyService(clientkernelLoaderApi.IVariableRegistry);
            var stringBool = viewbuilderImpl.ExternalService.variableRegistry.get("viewBuilder.flashLikeAnimations", "false");
            if (stringBool == "true") viewbuilderImpl.ExternalService.FLASH_LIKE_ANIMATIONS = true;
            else viewbuilderImpl.ExternalService.FLASH_LIKE_ANIMATIONS = false;
        };
        viewbuilderImpl.ExternalService.prototype.__class__ = viewbuilderImpl.ExternalService;
        viewbuilderImpl.ViewBuilderComponent = function(displayObject) {
            this.frameCount = 0;
            this.playingState = true;
            this.hasActions = false;
            this.hasFrames = false;
            this.maskedID = "";
            this.maskID = "";
            this.containerFlag = false;
            this.displayObject = displayObject;
        };
        viewbuilderImpl.ViewBuilderComponent = ck_implements(viewbuilderImpl.ViewBuilderComponent, viewBuilderApi.IViewBuilderComponent);
        viewbuilderImpl.ViewBuilderComponent.__interfaces__ = [viewBuilderApi.IViewBuilderComponent];
        viewbuilderImpl.ViewBuilderComponent.__name__ = ["viewbuilderImpl", "ViewBuilderComponent"];
        viewbuilderImpl.ViewBuilderComponent.prototype.displayObject = null;
        viewbuilderImpl.ViewBuilderComponent.prototype.componentType = null;
        viewbuilderImpl.ViewBuilderComponent.prototype.id = null;
        viewbuilderImpl.ViewBuilderComponent.prototype.containerFlag = null;
        viewbuilderImpl.ViewBuilderComponent.prototype.maskID = null;
        viewbuilderImpl.ViewBuilderComponent.prototype.maskedID = null;
        viewbuilderImpl.ViewBuilderComponent.prototype.frames = null;
        viewbuilderImpl.ViewBuilderComponent.prototype.hasFrames = null;
        viewbuilderImpl.ViewBuilderComponent.prototype.frameLabels = null;
        viewbuilderImpl.ViewBuilderComponent.prototype.actions = null;
        viewbuilderImpl.ViewBuilderComponent.prototype.hasActions = null;
        viewbuilderImpl.ViewBuilderComponent.prototype.frameLabelActions = null;
        viewbuilderImpl.ViewBuilderComponent.prototype.playingState = null;
        viewbuilderImpl.ViewBuilderComponent.prototype.frameCount = null;
        viewbuilderImpl.ViewBuilderComponent.prototype.extractCommonProperties = function(cfg) {
            this.id = cfg.id;
            if (cfg.x != null) this.displayObject.setX(cfg.x);
            if (cfg.y != null) this.displayObject.setY(cfg.y);
            if (cfg.rotation != null) this.displayObject.setRotation(_hcmn_.Std.parseFloat(cfg.rotation));
            var scaleX;
            if (cfg.inVBAnimation == true) scaleX = cfg.scaleX;
            else scaleX = this.displayObject.getScaleX() * cfg.scaleX;
            var scaleY;
            if (cfg.inVBAnimation == true) scaleY = cfg.scaleY;
            else scaleY = this.displayObject.getScaleY() * cfg.scaleY;
            if (cfg.scaleX != null) this.displayObject.setScaleX(scaleX);
            if (cfg.scaleY != null) this.displayObject.setScaleY(scaleY);
            if (cfg.visible != null) this.displayObject.setVisible(cfg.visible);
            if (cfg.alpha != null) this.displayObject.setAlpha(cfg.alpha);
            if (cfg.mask != null && cfg.mask != "") this.maskID = cfg.mask;
            if (cfg.masked != null && cfg.masked != "") this.maskedID = cfg.masked;
            if (cfg.r != null) this.displayObject.setRotation(_hcmn_.Std.parseFloat(cfg.r));
            var scaleX1;
            if (cfg.inVBAnimation == true) scaleX1 = cfg.sX;
            else scaleX1 = this.displayObject.getScaleX() * cfg.sX;
            var scaleY1;
            if (cfg.inVBAnimation == true) scaleY1 = cfg.sY;
            else scaleY1 = this.displayObject.getScaleY() * cfg.sY;
            if (cfg.sX != null) this.displayObject.setScaleX(scaleX1);
            if (cfg.sY != null) this.displayObject.setScaleY(scaleY1);
            if (cfg.v != null) this.displayObject.setVisible(cfg.v);
            if (cfg.a != null) this.displayObject.setAlpha(cfg.a);
            if (cfg.m != null && cfg.m != "") this.maskID = cfg.m;
            if (cfg.md != null && cfg.md != "") this.maskedID = cfg.md;
            this.getDisplayObject().getUserData().viewBuilderID = cfg.id;
            this.getDisplayObject().getUserData().viewBuilderW = cfg.w;
            this.getDisplayObject().getUserData().viewBuilderH = cfg.h;
            this.frames = cfg.frames;
            this.hasFrames = this.frames != null && this.frames.length > 0;
            if (cfg.labels) this.setLabelsData(cfg.labels);
            if (cfg.actions) this.setFrameActions(cfg.actions);
        };
        viewbuilderImpl.ViewBuilderComponent.prototype.setLabelsData = function(data) {
            if (this.frameLabels == null) this.frameLabels = new _hcmn_.haxe_ds_StringMap();
            if (this.frameLabelActions == null) this.frameLabelActions = new _hcmn_.haxe_ds_IntMap();
            var _g1 = 0;
            var _g = data.length;
            while (_g1 < _g) {
                var i = _g1++;
                this.frameLabels.set(data[i].frame, data[i].index);
                this.frameLabelActions.h[data[i].index] = {
                    command: "dispatchEvent",
                    frame: data[i].index,
                    event: "frame:" + data[i].frame
                };
            }
        };
        viewbuilderImpl.ViewBuilderComponent.prototype.setFrameActions = function(data) {
            if (this.actions == null) this.actions = new _hcmn_.haxe_ds_IntMap();
            if (this.actions != null) this.hasActions = true;
            var _g1 = 0;
            var _g = data.length;
            while (_g1 < _g) {
                var i = _g1++;
                var actionData = data[i].action.replace("\"", "'");
                var command = actionData.split("(")[0];
                var frame = actionData.split("(")[1].split(")")[0];
                var event = null;
                if (command == "dispatchEvent") event = actionData.split("(")[2].split(")")[0];
                if (!_hcmn_.Std["is"](_hcmn_.Std.parseInt(frame), _hcmn_.Int)) {
                    if (event != null) {
                        event = _hcmn_.StringTools.replace(event, "'", "");
                        frame = data[i].index;
                    } else if (this.frameLabels != null) {
                        var key = _hcmn_.StringTools.replace(frame, "'", "");
                        frame = this.frameLabels.get(key);
                    } else frame = data[i].index;
                }
                this.actions.h[data[i].index] = {
                    command: command,
                    frame: frame,
                    event: event
                };
            }
        };
        viewbuilderImpl.ViewBuilderComponent.prototype.getLastFullFrameInfo = function(currentFrame) {
            if (this.frames != null) {
                var len = currentFrame;
                while (len > 0) {
                    if (this.frames[len] != null && this.frames[len].length > 0) return this.frames[len];
                    len--;
                }
                return this.frames[0];
            }
            return null;
        };
        viewbuilderImpl.ViewBuilderComponent.prototype.disable = function() {};
        viewbuilderImpl.ViewBuilderComponent.prototype.enable = function() {};
        viewbuilderImpl.ViewBuilderComponent.prototype.getDisplayObject = function() {
            return this.displayObject;
        };
        viewbuilderImpl.ViewBuilderComponent.prototype.hide = function() {
            this.displayObject.setVisible(false);
        };
        viewbuilderImpl.ViewBuilderComponent.prototype.init = function() {};
        viewbuilderImpl.ViewBuilderComponent.prototype.isContainer = function() {
            return this.containerFlag;
        };
        viewbuilderImpl.ViewBuilderComponent.prototype.setX = function(x) {
            this.displayObject.setX(x);
        };
        viewbuilderImpl.ViewBuilderComponent.prototype.setY = function(y) {
            this.displayObject.setY(y);
        };
        viewbuilderImpl.ViewBuilderComponent.prototype.show = function() {
            this.displayObject.setVisible(true);
        };
        viewbuilderImpl.ViewBuilderComponent.prototype.dispose = function() {
            try {
                this.displayObject.dispose();
            } catch (e) {
                if (e instanceof js._Boot.HaxeError) e = e.val;
                if (_hcmn_.js_Boot.__instanceof(e, Error)) {
                    null;
                } else throw (e);
            }
            this.displayObject = null;
        };
        viewbuilderImpl.ViewBuilderComponent.prototype.__class__ = viewbuilderImpl.ViewBuilderComponent;
        viewbuilderImpl.ViewBuilderContainer = function(cfg, assets) {
            this.rootContainer = viewbuilderImpl.ExternalService.displayProvider.getFactory().createDisplayObjectContainer();
            viewbuilderImpl.ViewBuilderComponent.call(this, this.rootContainer);
            this.containerFlag = true;
            this.assets = assets;
            this.childComponents = new _hcmn_.haxe_ds_StringMap();
            this.storedConfigs = new _hcmn_.haxe_ds_StringMap();
            this.extractCommonProperties(cfg);
            this.extractSubComponents(cfg);
        };
        viewbuilderImpl.ViewBuilderContainer = ck_implements(viewbuilderImpl.ViewBuilderContainer, viewBuilderApi.IViewBuilderContainer);
        viewbuilderImpl.ViewBuilderContainer.__interfaces__ = [viewBuilderApi.IViewBuilderContainer];
        viewbuilderImpl.ViewBuilderContainer.__name__ = ["viewbuilderImpl", "ViewBuilderContainer"];
        viewbuilderImpl.ViewBuilderContainer.__super__ = viewbuilderImpl.ViewBuilderComponent;
        for (var k in viewbuilderImpl.ViewBuilderComponent.prototype) viewbuilderImpl.ViewBuilderContainer.prototype[k] = viewbuilderImpl.ViewBuilderComponent.prototype[k];
        viewbuilderImpl.ViewBuilderContainer.prototype.rootContainer = null;
        viewbuilderImpl.ViewBuilderContainer.prototype.childComponents = null;
        viewbuilderImpl.ViewBuilderContainer.prototype.storedConfigs = null;
        viewbuilderImpl.ViewBuilderContainer.prototype.assets = null;
        viewbuilderImpl.ViewBuilderContainer.prototype.enable = function() {
            var $it0 = this.childComponents.iterator();
            while ($it0.hasNext()) {
                var component = $it0.next();
                component.enable();
                if (component.isContainer()) {
                    var component1;
                    component1 = _hcmn_.js_Boot.__cast(component, viewbuilderImpl.ViewBuilderContainer);
                    var $it1 = (function($this) {
                        var $r;
                        var this1 = component1.getChildComponents();
                        $r = this1.iterator();
                        return $r;
                    }(this));
                    while ($it1.hasNext()) {
                        var subComponent = $it1.next();
                        subComponent.enable();
                    }
                }
            }
        };
        viewbuilderImpl.ViewBuilderContainer.prototype.disable = function() {
            var $it0 = this.childComponents.iterator();
            while ($it0.hasNext()) {
                var component = $it0.next();
                component.disable();
                if (component.isContainer()) {
                    var component1;
                    component1 = _hcmn_.js_Boot.__cast(component, viewbuilderImpl.ViewBuilderContainer);
                    var $it1 = (function($this) {
                        var $r;
                        var this1 = component1.getChildComponents();
                        $r = this1.iterator();
                        return $r;
                    }(this));
                    while ($it1.hasNext()) {
                        var subComponent = $it1.next();
                        subComponent.disable();
                    }
                }
            }
        };
        viewbuilderImpl.ViewBuilderContainer.prototype.getDisplayObject = function() {
            return this.rootContainer;
        };
        viewbuilderImpl.ViewBuilderContainer.prototype.addChildComponent = function(child, childId) {
            child.getDisplayObject().setName(childId);
            if ((function($this) {
                    var $r;
                    var this1 = $this.getChildComponents();
                    $r = this1.get(childId);
                    return $r;
                }(this)) != null && childId != "") throw new Error("[VB][ERROR] Child with same ID collision! - Component with (" + childId + ") already exist. IDs must be unique within same parent container!");
            this.getDisplayObject().addChild(child.getDisplayObject());
            var this2 = this.getChildComponents();
            this2.set(childId, child);
        };
        viewbuilderImpl.ViewBuilderContainer.prototype.removeChildComponent = function(childId) {
            var vbc;
            var this1 = this.getChildComponents();
            vbc = this1.get(childId);
            this.getDisplayObject().removeChild(vbc.getDisplayObject());
            var this2 = this.getChildComponents();
            this2.remove(childId);
        };
        viewbuilderImpl.ViewBuilderContainer.prototype.removeAllChildComponents = function() {
            var $it0 = (function($this) {
                var $r;
                var this1 = $this.getChildComponents();
                $r = this1.keys();
                return $r;
            }(this));
            while ($it0.hasNext()) {
                var key = $it0.next();
                var vbc;
                var this2 = this.getChildComponents();
                vbc = this2.get(key);
                this.getDisplayObject().removeChild(vbc.getDisplayObject());
                var this3 = this.getChildComponents();
                this3.remove(key);
            }
        };
        viewbuilderImpl.ViewBuilderContainer.prototype.extractSubComponents = function(cfg) {
            if (cfg.components == null) return;
            var len = _hcmn_.Lambda.count(_hcmn_.js_Boot.__cast(cfg.components, Array));
            var vbFactory = viewbuilderImpl.ViewBuilderFactory.getInstance();
            var _g = 0;
            try {
                while (_g < len) {
                    var k = _g++;
                    var subCfg = cfg.components[k];
                    subCfg.inVBAnimation = cfg.inVBAnimation;
                    subCfg.fps = cfg.fps;
                    var typeString;
                    typeString = _hcmn_.js_Boot.__cast(subCfg.t != null ? subCfg.t : subCfg.type, String);
                    var type;
                    var constr = typeString.toUpperCase();
                    type = _hcmn_.Type.createEnum(viewbuilderImpl.ComponentTypesEnum, constr, null);
                    if (subCfg.createOnDemand == true || subCfg.cod == true) {
                        this.storeConfig(subCfg);
                        continue;
                    }
                    if (subCfg.subType == viewbuilderImpl.ComponentTypesEnum.VBANIMATION[0].toLowerCase()) type = viewbuilderImpl.ComponentTypesEnum.VBANIMATION;
                    switch (type[1]) {
                        case 0:
                            var el = new viewbuilderImpl.ViewBuilderContainer(subCfg, this.assets);
                            this.addChildComponent(el, subCfg.id);
                            break;
                        default:
                            if (!vbFactory.factories.exists(type[0])) throw "__break__";
                            var el1 = vbFactory.factories.get(type[0]).create(subCfg, this.assets, vbFactory.multilanguageAssets);
                            if (el1 == null) continue;
                            if (subCfg.subType == "vbanimation")(_hcmn_.js_Boot.__cast(el1, viewbuilderImpl.VBAnimationComponent)).appendAnimId(cfg.id);
                            this.addChildComponent(el1, subCfg.id);
                            if (type[0] == viewbuilderImpl.ComponentTypesEnum.LABEL[0]) {
                                var label;
                                label = _hcmn_.js_Boot.__cast(el1, viewbuilderImpl.LabelComponent);
                                if (subCfg.id != label.getDisplayObject().getName() + viewbuilderImpl.LabelComponent.SHADOW_SUFFIX) label.tryAddShadow(this);
                            }
                    }
                }
            } catch (e) {
                if (e != "__break__") throw e;
            }
            this.applyMasks(cfg.inVBAnimation == true);
        };
        viewbuilderImpl.ViewBuilderContainer.prototype.applyMasks = function(inVBAnim) {
            if (inVBAnim == null) inVBAnim = false;
            var masksShapes = new _hcmn_.haxe_ds_StringMap();
            var maskedContents = new _hcmn_.haxe_ds_StringMap();
            var $it0 = this.childComponents.iterator();
            while ($it0.hasNext()) {
                var vbchild = $it0.next();
                var child = vbchild;
                if (child.maskID != "") {
                    var maskShape;
                    maskShape = _hcmn_.js_Boot.__cast(child.getDisplayObject(), displayEngineApi.IGraphics);
                    var clonedShape = maskShape.clone();
                    if (inVBAnim && this.assets.getConfiguration().scalefactor != 1) clonedShape.setScale(this.assets.getConfiguration().scalefactor);
                    var value = {
                        shape: clonedShape,
                        zIndex: child.getDisplayObject().getZOrder()
                    };
                    masksShapes.set(child.maskID, value);
                    child.getDisplayObject().getParent().removeChild(child.getDisplayObject());
                }
                if (child.maskedID != "") {
                    var maskedArr = maskedContents.get(child.maskedID);
                    if (maskedArr == null) maskedArr = [];
                    maskedArr.push(child.getDisplayObject());
                    maskedContents.set(child.maskedID, maskedArr);
                }
            }
            var $it1 = masksShapes.keys();
            while ($it1.hasNext()) {
                var mkey = $it1.next();
                var mask;
                mask = (_hcmn_.__map_reserved[mkey] != null ? masksShapes.getReserved(mkey) : masksShapes.h[mkey]).shape;
                var maskZIndex;
                maskZIndex = (_hcmn_.__map_reserved[mkey] != null ? masksShapes.getReserved(mkey) : masksShapes.h[mkey]).zIndex;
                var maskedObjs;
                maskedObjs = _hcmn_.__map_reserved[mkey] != null ? maskedContents.getReserved(mkey) : maskedContents.h[mkey];
                if (maskedObjs != null) {
                    var maskedCont = viewbuilderImpl.ExternalService.displayProvider.getFactory().createDisplayObjectContainer();
                    this.getDisplayObject().addChildAt(maskedCont, maskZIndex - 1);
                    var _g1 = 0;
                    var _g = maskedObjs.length;
                    while (_g1 < _g) {
                        var i = _g1++;
                        maskedCont.addChild(maskedObjs[i]);
                        this.getDisplayObject().removeChild(maskedObjs[i]);
                    }
                    maskedCont.setMask(mask);
                }
            }
        };
        viewbuilderImpl.ViewBuilderContainer.prototype.storeConfig = function(cfg) {
            var key = cfg.id;
            var value = cfg;
            this.storedConfigs.set(key, value);
        };
        viewbuilderImpl.ViewBuilderContainer.prototype.disposeChildComponent = function(childId) {
            var component = this.childComponents.get(childId);
            if (component != null) {
                if (component.isContainer()) component = _hcmn_.js_Boot.__cast(component, viewBuilderApi.IViewBuilderContainer);
                if (component.getDisplayObject() != null) this.getDisplayObject().removeChild(component.getDisplayObject());
                component.dispose();
                this.childComponents.set(childId, null);
                this.childComponents.remove(childId);
                component = null;
            }
        };
        viewbuilderImpl.ViewBuilderContainer.prototype.dispose = function() {
            var $it0 = (function($this) {
                var $r;
                var this1 = $this.getChildComponents();
                $r = this1.keys();
                return $r;
            }(this));
            while ($it0.hasNext()) {
                var cid = $it0.next();
                this.disposeChildComponent(cid);
            }
            this.rootContainer = null;
        };
        viewbuilderImpl.ViewBuilderContainer.prototype.createContainerFromStoredConfig = function(id) {
            var cfg = this.storedConfigs.get(id);
            if (cfg == null) return null;
            var cont = new viewbuilderImpl.ViewBuilderContainer(cfg, this.assets);
            return cont;
        };
        viewbuilderImpl.ViewBuilderContainer.prototype.getChildComponents = function() {
            return this.childComponents;
        };
        viewbuilderImpl.ViewBuilderContainer.prototype.getComponentById = function(id) {
            var cont = this.childComponents.get(id);
            return cont;
        };
        viewbuilderImpl.ViewBuilderContainer.prototype.getContainerById = function(id) {
            var cont = null;
            cont = this.childComponents.get(id);
            if (cont == null) throw new Error("[VB][ERROR] Container not found - Container with (" + id + ") cannot be found.");
            return cont;
        };
        viewbuilderImpl.ViewBuilderContainer.prototype.getButtonById = function(id) {
            var cmp = null;
            cmp = this.childComponents.get(id);
            if (cmp == null) throw new Error("[VB][ERROR] Component not found - Button with (" + id + ") cannot be found.");
            return cmp;
        };
        viewbuilderImpl.ViewBuilderContainer.prototype.getButtonContainerById = function(id) {
            var cmp = null;
            cmp = this.childComponents.get(id);
            if (cmp == null) throw new Error("[VB][ERROR] Container not found - ButtonContainer with (" + id + ") cannot be found.");
            return cmp;
        };
        viewbuilderImpl.ViewBuilderContainer.prototype.getComboBoxById = function(id) {
            var cmp = null;
            cmp = this.childComponents.get(id);
            if (cmp == null) throw new Error("[VB][ERROR] Container not found - ComboBox with (" + id + ") cannot be found.");
            return cmp;
        };
        viewbuilderImpl.ViewBuilderContainer.prototype.getLabelById = function(id) {
            var cmp = null;
            cmp = this.childComponents.get(id);
            if (cmp == null) throw new Error("[VB][ERROR] Component not found - Label with (" + id + ") cannot be found.");
            return cmp;
        };
        viewbuilderImpl.ViewBuilderContainer.prototype.getParticleAnimationById = function(id) {
            var cmp = null;
            cmp = this.childComponents.get(id);
            if (cmp == null) throw new Error("[VB][ERROR] Component not found - ParticleAnimationComponent with (" + id + ") cannot be found.");
            return cmp;
        };
        viewbuilderImpl.ViewBuilderContainer.prototype.getSlideButtonContainerById = function(id) {
            var cmp = null;
            cmp = this.childComponents.get(id);
            if (cmp == null) throw new Error("[VB][ERROR] Container not found - SlideButtonContainer with (" + id + ") cannot be found.");
            return cmp;
        };
        viewbuilderImpl.ViewBuilderContainer.prototype.getStepperBoxById = function(id) {
            var cmp = null;
            cmp = this.childComponents.get(id);
            if (cmp == null) throw new Error("[VB][ERROR] Container not found - StepperBox with (" + id + ") cannot be found.");
            return cmp;
        };
        viewbuilderImpl.ViewBuilderContainer.prototype.getVBAnimationById = function(id) {
            var cmp = null;
            cmp = this.childComponents.get(id);
            if (cmp == null) throw new Error("[VB][ERROR] Component not found - VBAnimation with (" + id + ") cannot be found.");
            return cmp;
        };
        viewbuilderImpl.ViewBuilderContainer.prototype.getVBComponent = function(type, id) {
            var cmp;
            cmp = this.childComponents.get(id);
            if (cmp == null) throw new Error("[VB][ERROR] Component of not found with (" + id + ") cannot be found.");
            return cmp;
        };
        viewbuilderImpl.ViewBuilderContainer.prototype.gotoAndPlay = function(offScreen, frame, callBack, delay) {
            if (frame == null) frame = "0";
            this.jumpToFrame(frame);
            this.playingState = true;
        };
        viewbuilderImpl.ViewBuilderContainer.prototype.gotoAndStop = function(offScreen, frame) {
            if (frame == null) frame = "0";
            this.playingState = false;
            this.jumpToFrame(frame);
        };
        viewbuilderImpl.ViewBuilderContainer.prototype.play = function(offScreen, callBack, delay) {
            if (delay == null) delay = 5;
            this.playingState = true;
        };
        viewbuilderImpl.ViewBuilderContainer.prototype.stop = function() {
            this.playingState = false;
        };
        viewbuilderImpl.ViewBuilderContainer.prototype.jumpToFrame = function(frame) {
            var frmCount;
            if (this.frameLabels.get(frame) == null) frmCount = _hcmn_.Std.parseInt(frame);
            else frmCount = this.frameLabels.get(frame);
            var $it0 = this.childComponents.iterator();
            while ($it0.hasNext()) {
                var comp = $it0.next();
                var com;
                com = _hcmn_.js_Boot.__cast(comp, viewbuilderImpl.ViewBuilderComponent);
                if (com.hasFrames) {
                    var frm = com.frames[frmCount];
                    com.frameCount = frmCount;
                    if (frm != null) {
                        var dObj = com.getDisplayObject();
                        if (frm == 0) {
                            if (dObj.getVisible()) dObj.setVisible(false);
                        } else if (frm == 1) {
                            if (!dObj.getVisible()) dObj.setVisible(true);
                        } else {
                            dObj.setScaleX(frm[2]);
                            dObj.setScaleY(frm[3]);
                            dObj.setAlpha(frm[4]);
                            dObj.setRotation(frm[5]);
                            dObj.setX(frm[0]);
                            dObj.setY(frm[1]);
                            if (!dObj.getVisible()) dObj.setVisible(true);
                        }
                        if (frm == 1) {
                            frm = com.getLastFullFrameInfo(com.frameCount);
                            dObj.setScaleX(frm[2]);
                            dObj.setScaleY(frm[3]);
                            dObj.setAlpha(frm[4]);
                            dObj.setRotation(frm[5]);
                            dObj.setX(frm[0]);
                            dObj.setY(frm[1]);
                            if (!dObj.getVisible()) dObj.setVisible(true);
                        }
                    }
                }
            }
        };
        viewbuilderImpl.ViewBuilderContainer.prototype.__class__ = viewbuilderImpl.ViewBuilderContainer;
        viewbuilderImpl.ViewBuilderFactory = function() {
            this.assets = new _hcmn_.haxe_ds_StringMap();
            this.factories = new _hcmn_.haxe_ds_StringMap();
            this.multilanguageAssets = [];
            this.registerComponentFactory(new viewbuilderImpl.ImageFactory(), viewbuilderImpl.ComponentTypesEnum.BITMAP[0]);
            this.registerComponentFactory(new viewbuilderImpl.ButtonFactory(), viewbuilderImpl.ComponentTypesEnum.BUTTON[0]);
            this.registerComponentFactory(new viewbuilderImpl.AnimationFactory(), viewbuilderImpl.ComponentTypesEnum.MOVIECLIP[0]);
            this.registerComponentFactory(new viewbuilderImpl.LabelFactory(), viewbuilderImpl.ComponentTypesEnum.LABEL[0]);
            this.registerComponentFactory(new viewbuilderImpl.ShapeFactory(), viewbuilderImpl.ComponentTypesEnum.SHAPE[0]);
            this.registerComponentFactory(new viewbuilderImpl.SlideButtonFactory(), viewbuilderImpl.ComponentTypesEnum.SLIDEBUTTON[0]);
            this.registerComponentFactory(new viewbuilderImpl.ComboBoxFactory(), viewbuilderImpl.ComponentTypesEnum.COMBOBOX[0]);
            this.registerComponentFactory(new viewbuilderImpl.ButtonContainerFactory(), viewbuilderImpl.ComponentTypesEnum.BUTTONCONTAINER[0]);
            this.registerComponentFactory(new viewbuilderImpl.ParticleAnimationFactory(), viewbuilderImpl.ComponentTypesEnum.PARTICLE[0]);
            this.registerComponentFactory(new viewbuilderImpl.VBAnimationFactory(), viewbuilderImpl.ComponentTypesEnum.VBANIMATION[0]);
            this.registerComponentFactory(new viewbuilderImpl.StepperBoxFactory(), viewbuilderImpl.ComponentTypesEnum.STEPPERBOX[0]);
            this.registerComponentFactory(new viewbuilderImpl.CardDeckFactory(), viewbuilderImpl.ComponentTypesEnum.CARDDECK[0]);
        };
        viewbuilderImpl.ViewBuilderFactory = ck_implements(viewbuilderImpl.ViewBuilderFactory, clientkernelModulesApi.IService);
        viewbuilderImpl.ViewBuilderFactory = ck_implements(viewbuilderImpl.ViewBuilderFactory, viewBuilderApi.IViewBuilderFactory);
        viewbuilderImpl.ViewBuilderFactory.__interfaces__ = [clientkernelModulesApi.IService, viewBuilderApi.IViewBuilderFactory];
        viewbuilderImpl.ViewBuilderFactory.__name__ = ["viewbuilderImpl", "ViewBuilderFactory"];
        viewbuilderImpl.ViewBuilderFactory.prototype.assets = null;
        viewbuilderImpl.ViewBuilderFactory.prototype.factories = null;
        viewbuilderImpl.ViewBuilderFactory.prototype.multilanguageAssets = null;
        viewbuilderImpl.ViewBuilderFactory.prototype.createView = function(assetspack) {
            var config = assetspack.getConfiguration();
            var configId = config.id;
            if (this.assets.get(configId) != null) null;
            this.assets.set(configId, assetspack);
            var container = new viewbuilderImpl.ViewBuilderContainer(config, assetspack);
            return container;
        };
        viewbuilderImpl.ViewBuilderFactory.prototype.registerComponentFactory = function(factory, type) {
            var value = factory;
            this.factories.set(type, value);
        };
        viewbuilderImpl.ViewBuilderFactory.getInstance = function() {
            if (viewbuilderImpl.ViewBuilderFactory.instance == null) viewbuilderImpl.ViewBuilderFactory.instance = new viewbuilderImpl.ViewBuilderFactory();
            return viewbuilderImpl.ViewBuilderFactory.instance;
        };
        viewbuilderImpl.ViewBuilderFactory.prototype.__class__ = viewbuilderImpl.ViewBuilderFactory;
        viewbuilderImpl.AnimationComponent = function(displayObject) {
            viewbuilderImpl.ViewBuilderComponent.call(this, displayObject);
            this.componentType = viewbuilderImpl.ComponentTypesEnum.MOVIECLIP[0];
        };
        viewbuilderImpl.AnimationComponent.__name__ = ["viewbuilderImpl", "AnimationComponent"];
        viewbuilderImpl.AnimationComponent.__super__ = viewbuilderImpl.ViewBuilderComponent;
        for (var k in viewbuilderImpl.ViewBuilderComponent.prototype) viewbuilderImpl.AnimationComponent.prototype[k] = viewbuilderImpl.ViewBuilderComponent.prototype[k];
        viewbuilderImpl.AnimationComponent.prototype.__class__ = viewbuilderImpl.AnimationComponent;
        viewbuilderImpl.ButtonComponent = function(mc) {
            this._enabled = false;
            viewbuilderImpl.ViewBuilderComponent.call(this, mc);
            this._movieClip = mc;
            mc.stop();
            this._events = new viewbuilderImpl.ButtonEvents();
            this.displayObject.on(displayEngineApi.DisplayObjectEvents.MOUSE_OVER, $bind(this, this.onOver));
            this.displayObject.on(displayEngineApi.DisplayObjectEvents.MOUSE_OUT, $bind(this, this.onOut));
            this.displayObject.on(displayEngineApi.DisplayObjectEvents.MOUSE_DOWN, $bind(this, this.onDown));
            this.displayObject.on(displayEngineApi.DisplayObjectEvents.MOUSE_UP, $bind(this, this.onUp));
            this.displayObject.on("touchstart", $bind(this, this.onTouchDown));
            this.displayObject.on("touchend", $bind(this, this.onOut));
        };
        viewbuilderImpl.ButtonComponent = ck_implements(viewbuilderImpl.ButtonComponent, viewBuilderApi.IButton);
        viewbuilderImpl.ButtonComponent.__interfaces__ = [viewBuilderApi.IButton];
        viewbuilderImpl.ButtonComponent.__name__ = ["viewbuilderImpl", "ButtonComponent"];
        viewbuilderImpl.ButtonComponent.__super__ = viewbuilderImpl.ViewBuilderComponent;
        for (var k in viewbuilderImpl.ViewBuilderComponent.prototype) viewbuilderImpl.ButtonComponent.prototype[k] = viewbuilderImpl.ViewBuilderComponent.prototype[k];
        viewbuilderImpl.ButtonComponent.prototype._movieClip = null;
        viewbuilderImpl.ButtonComponent.prototype._events = null;
        viewbuilderImpl.ButtonComponent.prototype._enabled = null;
        viewbuilderImpl.ButtonComponent.prototype.onOut = function(e) {
            if (!this._enabled) return;
            this._movieClip.gotoAndPlayReversed(viewbuilderImpl.ButtonComponent.DEFAULT_STATE_NAME, this._movieClip.getStateFrameCount(viewbuilderImpl.ButtonComponent.DEFAULT_STATE_NAME) - this._movieClip.getCurrentFrame());
            this._events.eventOut.dispatch(this._movieClip);
        };
        viewbuilderImpl.ButtonComponent.prototype.onOver = function(e) {
            if (!this._enabled) return;
            this._movieClip.gotoAndPlay(viewbuilderImpl.ButtonComponent.OVER_STATE_NAME);
            this._events.eventOver.dispatch(this._movieClip);
        };
        viewbuilderImpl.ButtonComponent.prototype.onDown = function(e) {
            if (e.data.originalEvent.button != 0) return;
            this.handlePointerDown(e);
        };
        viewbuilderImpl.ButtonComponent.prototype.onTouchDown = function(e) {
            this.handlePointerDown(e);
        };
        viewbuilderImpl.ButtonComponent.prototype.handlePointerDown = function(e) {
            if (!this._enabled) return;
            e.stopPropagation();
            this._movieClip.gotoAndStop(viewbuilderImpl.ButtonComponent.DOWN_STATE_NAME);
            this._events.eventDown.dispatch(this._movieClip);
        };
        viewbuilderImpl.ButtonComponent.prototype.onUp = function(e) {
            if (!this._enabled) return;
            e.stopPropagation();
            this._movieClip.gotoAndStop(viewbuilderImpl.ButtonComponent.DEFAULT_STATE_NAME);
            this._events.eventUp.dispatch();
        };
        viewbuilderImpl.ButtonComponent.prototype.enable = function() {
            if (this._enabled) return;
            this._enabled = true;
            this.displayObject.setButtonMode(true);
            if (this.isPointerOverButton()) {
                this._movieClip.gotoAndPlay(viewbuilderImpl.ButtonComponent.OVER_STATE_NAME);
                this._events.eventOver.dispatch();
            } else this._movieClip.gotoAndStop(viewbuilderImpl.ButtonComponent.DEFAULT_STATE_NAME);
        };
        viewbuilderImpl.ButtonComponent.prototype.isPointerOverButton = function() {
            var pointerPos = viewbuilderImpl.ExternalService.displayProvider.getDefaultStage().getMouse();
            var localPointerPos = this.displayObject.globalToLocal(pointerPos.x, pointerPos.y);
            var doX = this.displayObject.getBounds().x;
            var doY = this.displayObject.getBounds().y;
            var doW = this.displayObject.getBounds().w;
            var doH = this.displayObject.getBounds().h;
            if (pointerPos.x > doX && pointerPos.x < doX + doW && pointerPos.y > doY && pointerPos.y < doY + doH) return true;
            else return false;
        };
        viewbuilderImpl.ButtonComponent.prototype.disable = function() {
            if (!this._enabled) return;
            this._enabled = false;
            this._movieClip.gotoAndStop(viewbuilderImpl.ButtonComponent.DISABLED_STATE_NAME);
            this.displayObject.setButtonMode(false);
        };
        viewbuilderImpl.ButtonComponent.prototype.getMainMovieClip = function() {
            return this._movieClip;
        };
        viewbuilderImpl.ButtonComponent.prototype.getEvents = function() {
            return this._events;
        };
        viewbuilderImpl.ButtonComponent.prototype.__class__ = viewbuilderImpl.ButtonComponent;
        viewbuilderImpl.ButtonContainer = function(cfg, assets) {
            this.isEnabled = true;
            this.isPointerDown = false;
            viewbuilderImpl.ViewBuilderContainer.call(this, cfg, assets);
            this._events = new viewbuilderImpl.ButtonEvents();
        };
        viewbuilderImpl.ButtonContainer = ck_implements(viewbuilderImpl.ButtonContainer, viewBuilderApi.IButtonContainer);
        viewbuilderImpl.ButtonContainer.__interfaces__ = [viewBuilderApi.IButtonContainer];
        viewbuilderImpl.ButtonContainer.__name__ = ["viewbuilderImpl", "ButtonContainer"];
        viewbuilderImpl.ButtonContainer.__super__ = viewbuilderImpl.ViewBuilderContainer;
        for (var k in viewbuilderImpl.ViewBuilderContainer.prototype) viewbuilderImpl.ButtonContainer.prototype[k] = viewbuilderImpl.ViewBuilderContainer.prototype[k];
        viewbuilderImpl.ButtonContainer.prototype._events = null;
        viewbuilderImpl.ButtonContainer.prototype.baseButton = null;
        viewbuilderImpl.ButtonContainer.prototype.isPointerDown = null;
        viewbuilderImpl.ButtonContainer.prototype.isEnabled = null;
        viewbuilderImpl.ButtonContainer.prototype._baseButtonMovieClip = null;
        viewbuilderImpl.ButtonContainer.prototype.hitAreaPoints = null;
        viewbuilderImpl.ButtonContainer.prototype.init = function() {
            this.baseButton = _hcmn_.js_Boot.__cast(this.getComponentById(viewbuilderImpl.ButtonContainer.BASE_BUTTON_ID), viewbuilderImpl.ButtonComponent);
            this.baseButton.getEvents().DOWN().addListener($bind(this, this.onDown));
            this.baseButton.getEvents().UP().addListener($bind(this, this.onUp));
            this.baseButton.getEvents().OVER().addListener($bind(this, this.onOver));
            this.baseButton.getEvents().OUT().addListener($bind(this, this.onOut));
            if (this.baseButton != null && this.hitAreaPoints != null) this.baseButton.getDisplayObject().setHitArea(this.hitAreaPoints);
            var $it0 = (function($this) {
                var $r;
                var this1 = $this.getChildComponents();
                $r = this1.iterator();
                return $r;
            }(this));
            while ($it0.hasNext()) {
                var comp = $it0.next();
                var mc = comp.getDisplayObject();
                var stateFrameCount;
                try {
                    stateFrameCount = mc.getStateFrameCount(viewbuilderImpl.ButtonContainer.LOOP_SUFIX_ID);
                } catch (e) {
                    if (e instanceof js._Boot.HaxeError) e = e.val;
                    if (_hcmn_.js_Boot.__instanceof(e, Error)) {
                        continue;
                    } else throw (e);
                }
                if (stateFrameCount >= 1) {
                    mc.gotoAndPlay(viewbuilderImpl.ButtonContainer.LOOP_SUFIX_ID);
                    mc.setLoop(true);
                }
            }
        };
        viewbuilderImpl.ButtonContainer.prototype.setState = function(stateName) {
            var $it0 = (function($this) {
                var $r;
                var this1 = $this.getChildComponents();
                $r = this1.iterator();
                return $r;
            }(this));
            while ($it0.hasNext()) {
                var comp = $it0.next();
                var mc = comp.getDisplayObject();
                var stateFrameCount;
                var stateLabelName = stateName;
                try {
                    stateFrameCount = mc.getStateFrameCount(stateLabelName);
                    if (stateFrameCount <= 0) {
                        stateLabelName = stateName + ":" + viewbuilderImpl.ButtonContainer.LOOP_SUFIX_ID;
                        stateFrameCount = mc.getStateFrameCount(stateLabelName);
                        mc.setLoop(true);
                    }
                } catch (e) {
                    if (e instanceof js._Boot.HaxeError) e = e.val;
                    if (_hcmn_.js_Boot.__instanceof(e, Error)) {
                        continue;
                    } else throw (e);
                }
                if (stateFrameCount <= 0) continue;
                if (stateFrameCount == 1) mc.gotoAndStop(stateLabelName);
                else mc.gotoAndPlay(stateLabelName);
            }
        };
        viewbuilderImpl.ButtonContainer.prototype.onOver = function(e) {
            this.setState(viewbuilderImpl.ButtonContainer.OVER_STATE_NAME);
            this._events.eventOver.dispatch();
        };
        viewbuilderImpl.ButtonContainer.prototype.onOut = function(e) {
            this.setState(viewbuilderImpl.ButtonContainer.DEFAULT_STATE_NAME);
            this._events.eventOut.dispatch();
        };
        viewbuilderImpl.ButtonContainer.prototype.onDown = function(e) {
            if (this.isEnabled) {
                this.setState(viewbuilderImpl.ButtonContainer.DOWN_STATE_NAME);
                this._events.eventDown.dispatch(this._baseButtonMovieClip);
            }
        };
        viewbuilderImpl.ButtonContainer.prototype.onUp = function(e) {
            if (this.isEnabled) {
                this.setState(viewbuilderImpl.ButtonContainer.DEFAULT_STATE_NAME);
                this._events.eventUp.dispatch(this._baseButtonMovieClip);
            }
        };
        viewbuilderImpl.ButtonContainer.prototype.enable = function() {
            this.isEnabled = true;
            this.setState(viewbuilderImpl.ButtonContainer.DEFAULT_STATE_NAME);
            this.baseButton.enable();
        };
        viewbuilderImpl.ButtonContainer.prototype.disable = function() {
            this.isEnabled = false;
            this.setState(viewbuilderImpl.ButtonContainer.DISABLED_STATE_NAME);
            this.baseButton.disable();
        };
        viewbuilderImpl.ButtonContainer.prototype.getEvents = function() {
            return this._events;
        };
        viewbuilderImpl.ButtonContainer.prototype.getBaseButton = function() {
            return this.baseButton;
        };
        viewbuilderImpl.ButtonContainer.prototype.setHitArea = function(hitAreaPoints) {
            this.hitAreaPoints = hitAreaPoints;
        };
        viewbuilderImpl.ButtonContainer.prototype.__class__ = viewbuilderImpl.ButtonContainer;
        viewbuilderImpl.CardDeckComponent = function(cfg, assets) {
            this.cardFronts = new _hcmn_.haxe_ds_StringMap();
            this.cardsCont = new viewbuilderImpl.ViewBuilderContainer(cfg, assets);
            viewbuilderImpl.ViewBuilderContainer.call(this, cfg, assets);
            this.extractBack();
            this.extractFronts();
        };
        viewbuilderImpl.CardDeckComponent = ck_implements(viewbuilderImpl.CardDeckComponent, viewBuilderApi.ICardDeck);
        viewbuilderImpl.CardDeckComponent.__interfaces__ = [viewBuilderApi.ICardDeck];
        viewbuilderImpl.CardDeckComponent.__name__ = ["viewbuilderImpl", "CardDeckComponent"];
        viewbuilderImpl.CardDeckComponent.__super__ = viewbuilderImpl.ViewBuilderContainer;
        for (var k in viewbuilderImpl.ViewBuilderContainer.prototype) viewbuilderImpl.CardDeckComponent.prototype[k] = viewbuilderImpl.ViewBuilderContainer.prototype[k];
        viewbuilderImpl.CardDeckComponent.prototype.cardFronts = null;
        viewbuilderImpl.CardDeckComponent.prototype.cardBack = null;
        viewbuilderImpl.CardDeckComponent.prototype.cardsCont = null;
        viewbuilderImpl.CardDeckComponent.prototype.extractBack = function() {
            var cardBackVB = this.cardsCont.createContainerFromStoredConfig("card_back");
            this.cardBack = cardBackVB.getDisplayObject();
            this.cardBack.setX(0);
            this.cardBack.setY(0);
            this.cardBack.setCacheAsBitmap(true);
        };
        viewbuilderImpl.CardDeckComponent.prototype.extractFronts = function() {
            var cardFrontsVB = this.cardsCont.createContainerFromStoredConfig("card");
            var $it0 = cardFrontsVB.storedConfigs.keys();
            while ($it0.hasNext()) {
                var k = $it0.next();
                var cardVB = cardFrontsVB.createContainerFromStoredConfig(k);
                var cardFront = cardVB.getDisplayObject();
                cardFront.setX(cardFront.getWidth());
                cardFront.setY(0);
                cardFront.setCacheAsBitmap(true);
                this.cardFronts.set(k, cardFront);
            }
        };
        viewbuilderImpl.CardDeckComponent.prototype.makeCard = function(id, options) {
            if (options == null) options = {
                width: this.cardBack.getWidth() / 50,
                height: this.cardBack.getHeight() / 50
            };
            var cardFront = this.cardFronts.get(id);
            var card;
            try {
                card = viewbuilderImpl.ExternalService.displayProvider.getFactory().createCard3D("VBCardDeckCard", this.cardBack, cardFront, options);
            } catch (e) {
                if (e instanceof js._Boot.HaxeError) e = e.val;
                if (_hcmn_.js_Boot.__instanceof(e, Error)) {
                    throw new Error("ERROR CREATING 3D CARD " + id + " " + _hcmn_.Std.string(e));
                } else throw (e);
            }
            return card;
        };
        viewbuilderImpl.CardDeckComponent.prototype.updateCard = function(instance, id) {
            var cardFront = this.cardFronts.get(id);
            instance.update(this.cardBack, cardFront);
            return instance;
        };
        viewbuilderImpl.CardDeckComponent.prototype.test3dCard = function() {
            var card = this.makeCard("HK");
            var deBMP = viewbuilderImpl.ExternalService.displayProvider.getFactory().createBitmap(card.get_display());
            deBMP.on(displayEngineApi.DisplayObjectEvents.CLICK, function() {
                card.flip();
            });
            deBMP.setX(250);
            deBMP.setY(250);
            this.getDisplayObject().addChild(deBMP);
            var card2 = this.makeCard("SK");
            var deBMP2 = viewbuilderImpl.ExternalService.displayProvider.getFactory().createBitmap(card2.get_display());
            deBMP2.on(displayEngineApi.DisplayObjectEvents.CLICK, function() {
                card2.flip();
            });
            deBMP2.setX(100);
            deBMP2.setY(100);
            this.getDisplayObject().addChild(deBMP2);
        };
        viewbuilderImpl.CardDeckComponent.prototype.init = function() {};
        viewbuilderImpl.CardDeckComponent.prototype.addChildComponent = function(child, childId) {};
        viewbuilderImpl.CardDeckComponent.prototype.__class__ = viewbuilderImpl.CardDeckComponent;
        viewbuilderImpl.ComboBoxComponent = function(cfg, assets) {
            this._enabled = false;
            viewbuilderImpl.ViewBuilderContainer.call(this, cfg, assets);
            this._events = new viewbuilderImpl.ComboBoxEvents();
        };
        viewbuilderImpl.ComboBoxComponent = ck_implements(viewbuilderImpl.ComboBoxComponent, viewBuilderApi.IComboBox);
        viewbuilderImpl.ComboBoxComponent.__interfaces__ = [viewBuilderApi.IComboBox];
        viewbuilderImpl.ComboBoxComponent.__name__ = ["viewbuilderImpl", "ComboBoxComponent"];
        viewbuilderImpl.ComboBoxComponent.__super__ = viewbuilderImpl.ViewBuilderContainer;
        for (var k in viewbuilderImpl.ViewBuilderContainer.prototype) viewbuilderImpl.ComboBoxComponent.prototype[k] = viewbuilderImpl.ViewBuilderContainer.prototype[k];
        viewbuilderImpl.ComboBoxComponent.prototype._events = null;
        viewbuilderImpl.ComboBoxComponent.prototype._enabled = null;
        viewbuilderImpl.ComboBoxComponent.prototype.vanityBarMask = null;
        viewbuilderImpl.ComboBoxComponent.prototype.contentViewBuilderContainer = null;
        viewbuilderImpl.ComboBoxComponent.prototype.contentContainer = null;
        viewbuilderImpl.ComboBoxComponent.prototype.valuesArray = null;
        viewbuilderImpl.ComboBoxComponent.prototype.selectedValue = null;
        viewbuilderImpl.ComboBoxComponent.prototype.vanityBarWidth = null;
        viewbuilderImpl.ComboBoxComponent.prototype.contentId = null;
        viewbuilderImpl.ComboBoxComponent.prototype.init = function() {
            this.contentViewBuilderContainer = this.getComponentById("ContentContainer");
            this.contentContainer = this.contentViewBuilderContainer.getDisplayObject();
            this.vanityBarMask = viewbuilderImpl.ExternalService.displayProvider.getFactory().createGraphics();
            this.getComponentById("VanityBarFill").getDisplayObject().setMask(this.vanityBarMask);
            var scaleFactor = 1;
            if (this.assets.getConfiguration().scalefactor != null) scaleFactor = _hcmn_.Std.parseFloat(this.assets.getConfiguration().scalefactor);
            this.vanityBarWidth = _hcmn_.Std["int"](this.getComponentById("VanityBarFill").getDisplayObject().getWidth() * scaleFactor);
        };
        viewbuilderImpl.ComboBoxComponent.prototype.onContentDown = function(e) {
            var element = e;
            element.gotoAndStop("enabled");
            var elementId = _hcmn_.Std["int"](e.getName());
            this._events.selectionSet.dispatch(elementId);
            if (this.contentViewBuilderContainer.getComponentById(this.contentId + "_" + elementId) != null) {
                var contentContainer = this.contentViewBuilderContainer.getComponentById(this.contentId + "_" + elementId);
                if (contentContainer.getComponentById("ContentLabel") != null) {
                    var lbl = contentContainer.getComponentById("ContentLabel");
                    lbl.updateTo("ContentLabelOut", "ContentLabelOut");
                }
            }
        };
        viewbuilderImpl.ComboBoxComponent.prototype.onContentOver = function(e) {
            var elementId = _hcmn_.Std["int"](e.getName());
            if (this.contentViewBuilderContainer.getComponentById(this.contentId + "_" + elementId) != null) {
                var contentContainer = this.contentViewBuilderContainer.getComponentById(this.contentId + "_" + elementId);
                if (contentContainer.getComponentById("ContentLabel") != null) {
                    var lbl = contentContainer.getComponentById("ContentLabel");
                    lbl.updateTo("ContentLabelOver", "ContentLabelOver");
                }
            }
        };
        viewbuilderImpl.ComboBoxComponent.prototype.onContentOut = function(e) {
            var elementId = _hcmn_.Std["int"](e.getName());
            if (this.contentViewBuilderContainer.getComponentById(this.contentId + "_" + elementId) != null) {
                var contentContainer = this.contentViewBuilderContainer.getComponentById(this.contentId + "_" + elementId);
                if (contentContainer.getComponentById("ContentLabel") != null) {
                    var lbl = contentContainer.getComponentById("ContentLabel");
                    lbl.updateTo("ContentLabelOut", "ContentLabelOut");
                }
            }
        };
        viewbuilderImpl.ComboBoxComponent.prototype.setMask = function(maskWidth) {
            this.vanityBarMask.clear();
            this.vanityBarMask.drawRect(0, 0, maskWidth, 3);
        };
        viewbuilderImpl.ComboBoxComponent.prototype.setComboBoxValues = function(valuesArray) {
            this.valuesArray = valuesArray;
            var comboBoxContentHeight = 0;
            var cfg = this.storedConfigs.get("ComboBoxContent");
            var _g1 = 0;
            var _g = valuesArray.length;
            while (_g1 < _g) {
                var i = _g1++;
                var comboBoxContent = this.contentViewBuilderContainer.getComponentById(_hcmn_.Std.string(cfg.id) + "_" + i);
                if (comboBoxContent != null) {
                    var label1 = comboBoxContent.getComponentById("ContentLabel");
                    label1.setText(_hcmn_.Std.string(valuesArray[i]));
                    var height1 = comboBoxContent.getDisplayObject().getHeight();
                    comboBoxContentHeight = height1 * i | 0;
                    continue;
                }
                var comboBoxContent1 = new viewbuilderImpl.ViewBuilderContainer(cfg, this.assets);
                comboBoxContent1.getDisplayObject().setName(_hcmn_.Std.string(cfg.id) + "_" + i);
                var btn = comboBoxContent1.getComponentById("BtnContent");
                var label = comboBoxContent1.getComponentById("ContentLabel");
                btn.getMainMovieClip().setName(i == null ? "null" : "" + i);
                label.setText(_hcmn_.Std.string(valuesArray[i]));
                var btnHeight = btn.getDisplayObject().getHeight();
                var labelHeight = label.getDisplayObject().getHeight();
                var height = comboBoxContent1.getDisplayObject().getHeight();
                btn.getDisplayObject().setHeight(height);
                btn.getEvents().DOWN().addListener($bind(this, this.onContentDown));
                btn.getEvents().OVER().addListener($bind(this, this.onContentOver));
                btn.getEvents().OUT().addListener($bind(this, this.onContentOut));
                comboBoxContentHeight = (height - 1) * i | 0;
                comboBoxContent1.setY(-comboBoxContentHeight);
                this.contentId = cfg.id;
                this.contentViewBuilderContainer.addChildComponent(comboBoxContent1, _hcmn_.Std.string(cfg.id) + "_" + i);
            }
            var topLine = this.contentViewBuilderContainer.getComponentById("TopLine");
            topLine.setY(-comboBoxContentHeight - topLine.getDisplayObject().getHeight() + valuesArray.length);
        };
        viewbuilderImpl.ComboBoxComponent.prototype.colapse = function() {
            var sign;
            sign = _hcmn_.js_Boot.__cast(this.getComponentById("ExpandColapsSign").getDisplayObject(), displayEngineApi.IMovieClip);
            sign.gotoAndStop("enabled");
            this.contentContainer.setVisible(false);
        };
        viewbuilderImpl.ComboBoxComponent.prototype.expand = function() {
            var sign;
            sign = _hcmn_.js_Boot.__cast(this.getComponentById("ExpandColapsSign").getDisplayObject(), displayEngineApi.IMovieClip);
            sign.gotoAndStop("disabled");
            this.contentContainer.setVisible(true);
        };
        viewbuilderImpl.ComboBoxComponent.prototype.getEvents = function() {
            return this._events;
        };
        viewbuilderImpl.ComboBoxComponent.prototype.setSelectedValue = function(value) {
            var index = _hcmn_.HxOverrides.indexOf(this.valuesArray, value, 0);
            this.setMask((index + 1) * (this.vanityBarWidth / this.valuesArray.length) | 0);
            this.selectedValue = value;
        };
        viewbuilderImpl.ComboBoxComponent.prototype.getSelectedValue = function() {
            return this.selectedValue;
        };
        viewbuilderImpl.ComboBoxComponent.prototype.getSelectedValueIndex = function() {
            return _hcmn_.HxOverrides.indexOf(this.valuesArray, this.selectedValue, 0);
        };
        viewbuilderImpl.ComboBoxComponent.prototype.setVanityBarVisible = function(visible) {
            if (visible) {
                this.getComponentById("VanityBarFill").show();
                this.getComponentById("VanityBarBg").show();
            } else {
                this.getComponentById("VanityBarFill").hide();
                this.getComponentById("VanityBarBg").hide();
            }
        };
        viewbuilderImpl.ComboBoxComponent.prototype.isExpanded = function() {
            return this.contentContainer.getVisible();
        };
        viewbuilderImpl.ComboBoxComponent.prototype.enable = function() {
            var sign;
            sign = _hcmn_.js_Boot.__cast(this.getComponentById("ExpandColapsSign").getDisplayObject(), displayEngineApi.IMovieClip);
            sign.gotoAndStop("enabled");
        };
        viewbuilderImpl.ComboBoxComponent.prototype.disable = function() {
            var sign;
            sign = _hcmn_.js_Boot.__cast(this.getComponentById("ExpandColapsSign").getDisplayObject(), displayEngineApi.IMovieClip);
            try {
                sign.gotoAndStop("inactive");
            } catch (e) {
                if (e instanceof js._Boot.HaxeError) e = e.val;
                if (_hcmn_.js_Boot.__instanceof(e, Error)) {
                    null;
                } else throw (e);
            }
        };
        viewbuilderImpl.ComboBoxComponent.prototype.__class__ = viewbuilderImpl.ComboBoxComponent;
        viewbuilderImpl.ImageComponent = function(bmp) {
            viewbuilderImpl.ViewBuilderComponent.call(this, bmp);
        };
        viewbuilderImpl.ImageComponent.__name__ = ["viewbuilderImpl", "ImageComponent"];
        viewbuilderImpl.ImageComponent.__super__ = viewbuilderImpl.ViewBuilderComponent;
        for (var k in viewbuilderImpl.ViewBuilderComponent.prototype) viewbuilderImpl.ImageComponent.prototype[k] = viewbuilderImpl.ViewBuilderComponent.prototype[k];
        viewbuilderImpl.ImageComponent.prototype.__class__ = viewbuilderImpl.ImageComponent;
        viewbuilderImpl.LabelComponent = function(messageId, text, style) {
            this.fontSizeChangedCount = 0;
            this.text = "";
            this.multiNewLineDelimiter = "​";
            this.mlOriginalFontSize = -1;
            this.lineHeight = 0;
            this.opts = {};
            this.defaults = {
                font: "18px Arial",
                sizeToFill: true,
                maxFontSizeToFill: false,
                lineHeight: 5,
                allowNewLine: true,
                lineBreak: "auto",
                textAlign: "left",
                verticalAlign: "top",
                justifyLines: false,
                paddingX: 0,
                paddingY: 0,
                fitParent: false,
                strokeText: false
            };
            this._linesNum = 1;
            this._forceUpdate = false;
            this._maxWidth = -1;
            this._minFontSize = -1;
            this._originalFontSize = 0;
            this._text = "";
            this._oldText = "";
            this.topOffset = 0;
            this.shouldUpdateTopOffset = true;
            this.messageID = messageId;
            this.style = new viewbuilderImpl.LabelStyle(style);
            this._originalFontSize = this.style.getFontSize();
            var _this = window.document;
            this.canvas = _this.createElement("canvas");
            this.canvas.style.backgroundColor = "transparent";
            this.ctx = this.canvas.getContext("2d", null);
            if (viewbuilderImpl.LabelComponent.tocanvas == null) {
                var _this1 = window.document;
                viewbuilderImpl.LabelComponent.tocanvas = _this1.createElement("canvas");
                viewbuilderImpl.LabelComponent.tocanvas.style.backgroundColor = "transparent";
                viewbuilderImpl.LabelComponent.toctx = viewbuilderImpl.LabelComponent.tocanvas.getContext("2d", null);
            }
            this.displayObject = viewbuilderImpl.ExternalService.displayProvider.getFactory().createBitmap(this.canvas);
            viewbuilderImpl.ViewBuilderComponent.call(this, this.displayObject);
            if (this._text.indexOf("\n") != -1) this._linesNum = this._text.split("\n").length;
            else this._linesNum = this._linesNum;
            if (this._linesNum > 1) {
                this.style.setForceSingleLine(false);
                if (this.style.getWidth() == -1) this.style.setWidth(400);
            }
            this.setText(text);
            this.setAlpha();
            this.setFromStringTable();
            this.setFromStyleTable();
        };
        viewbuilderImpl.LabelComponent = ck_implements(viewbuilderImpl.LabelComponent, viewBuilderApi.ILabel);
        viewbuilderImpl.LabelComponent.__interfaces__ = [viewBuilderApi.ILabel];
        viewbuilderImpl.LabelComponent.__name__ = ["viewbuilderImpl", "LabelComponent"];
        viewbuilderImpl.LabelComponent.__super__ = viewbuilderImpl.ViewBuilderComponent;
        for (var k in viewbuilderImpl.ViewBuilderComponent.prototype) viewbuilderImpl.LabelComponent.prototype[k] = viewbuilderImpl.ViewBuilderComponent.prototype[k];
        viewbuilderImpl.LabelComponent.prototype.messageID = null;
        viewbuilderImpl.LabelComponent.prototype.defaultStyle = null;
        viewbuilderImpl.LabelComponent.prototype.canvas = null;
        viewbuilderImpl.LabelComponent.prototype.ctx = null;
        viewbuilderImpl.LabelComponent.prototype.style = null;
        viewbuilderImpl.LabelComponent.prototype.shouldUpdateTopOffset = null;
        viewbuilderImpl.LabelComponent.prototype.topOffset = null;
        viewbuilderImpl.LabelComponent.prototype._oldText = null;
        viewbuilderImpl.LabelComponent.prototype._text = null;
        viewbuilderImpl.LabelComponent.prototype._originalFontSize = null;
        viewbuilderImpl.LabelComponent.prototype._minFontSize = null;
        viewbuilderImpl.LabelComponent.prototype._maxWidth = null;
        viewbuilderImpl.LabelComponent.prototype._forceUpdate = null;
        viewbuilderImpl.LabelComponent.prototype._linesNum = null;
        viewbuilderImpl.LabelComponent.prototype.componentHolder = null;
        viewbuilderImpl.LabelComponent.prototype.shadowReference = null;
        viewbuilderImpl.LabelComponent.prototype.setWidth = function(value) {
            this.style.setWidth(value);
            this._forceUpdate = true;
            this.canvas.width = value | 0;
            this.forceRenderText();
            this.displayObject.update(this.canvas, this.canvas.width, this.canvas.height);
        };
        viewbuilderImpl.LabelComponent.prototype.setHeight = function(value) {
            this.style.setHeight(value);
            this._forceUpdate = true;
            this.canvas.height = value | 0;
            this.forceRenderText();
            this.displayObject.update(this.canvas, this.canvas.width, this.canvas.height);
        };
        viewbuilderImpl.LabelComponent.prototype.toIntColor = function(hexStr) {
            return _hcmn_.Std.parseInt("0x" + hexStr.substring(1));
        };
        viewbuilderImpl.LabelComponent.prototype.setFromStyleTable = function() {
            if (viewbuilderImpl.ExternalService.translationManager == null) return;
            var styleTableStyle = viewbuilderImpl.ExternalService.translationManager.styleLookup(this.messageID);
            if (styleTableStyle == null) {
                if (this.defaultStyle == null) this.defaultStyle = viewbuilderImpl.ExternalService.translationManager.styleLookup("defaultStyle");
            } else {
                if (styleTableStyle.extendStyle != null) {
                    var extendedStyle = viewbuilderImpl.ExternalService.translationManager.styleLookup(styleTableStyle.extendStyle);
                    this.style.applyStyle(extendedStyle, $bind(this, this.forceRenderText));
                }
                this.style._styleID = this.messageID;
                this.style.applyStyle(styleTableStyle, $bind(this, this.forceRenderText));
            }
            this._originalFontSize = this.style.getFontSize();
            this.forceRenderText();
        };
        viewbuilderImpl.LabelComponent.prototype.setFromStringTable = function() {
            var message = this._text + "*";
            if (viewbuilderImpl.ExternalService.translationManager != null) message = viewbuilderImpl.ExternalService.translationManager.stringLookup(this.messageID);
            if (message != null) this.setText(message);
        };
        viewbuilderImpl.LabelComponent.prototype.getStyle = function() {
            return this.style;
        };
        viewbuilderImpl.LabelComponent.prototype.updateTo = function(stringId, style) {
            var styleById = null;
            if (stringId != null) styleById = viewbuilderImpl.ExternalService.translationManager.styleLookup(stringId);
            if (styleById != null) this.style.applyStyle(styleById);
            if (style != null) this.style.applyStyle(style);
            this._originalFontSize = this.style.getFontSize();
            this.forceRenderText();
        };
        viewbuilderImpl.LabelComponent.prototype.getText = function() {
            return this._text;
        };
        viewbuilderImpl.LabelComponent.prototype.setText = function(text) {
            if (this.shadowReference != null) this.shadowReference.setText(text);
            if (_hcmn_.StringTools.trim(text) == "") {
                if (this.displayObject.getVisible()) this.displayObject.setVisible(false);
            } else this.displayObject.setVisible(true);
            this._text = text;
            if (this._text.indexOf("\n") != -1) this._linesNum = this._text.split("\n").length;
            else this._linesNum = this._linesNum;
            this.forceRenderText();
        };
        viewbuilderImpl.LabelComponent.prototype.setAlpha = function() {
            if (this.style.getFontColor() != null && this.style.getFontColor().length == 9) {
                var alphaStr = this.style.getFontColor().substring(this.style.getFontColor().length - 2);
                var value = _hcmn_.Std.parseInt("0x000000" + alphaStr);
                var alpha = value / 255;
                this.style.setFontColor(this.style.getFontColor().substring(0, this.style.getFontColor().length - 2));
                this.displayObject.setAlpha(alpha);
            }
        };
        viewbuilderImpl.LabelComponent.prototype.forceRenderText = function() {
            this._forceUpdate = true;
            var tmpScaleX = this.displayObject.getScaleX();
            var tmpScaleY = this.displayObject.getScaleY();
            this.displayObject.setWidth(this.style.getWidth());
            this.displayObject.setHeight(this.style.getHeight());
            if (this.style._lineHeightNotSet) {
                if (this.style.getLineHeight() < this.style.getFontSize() + 1) this.style.setLineHeight(this.style.getFontSize() + 1);
            }
            this.renderText();
            this.displayObject.setScaleX(tmpScaleX);
            this.displayObject.setScaleY(tmpScaleY);
        };
        viewbuilderImpl.LabelComponent.prototype.renderText = function() {
            if (this._text != this._oldText || this._forceUpdate) {
                this.shouldUpdateTopOffset = true;
                this._forceUpdate = false;
                this._oldText = this._text;
                var characters = this._text.split("");
                var index = 0;
                var current = "";
                var currentPosition = 0;
                var y = 0;
                var x = 0;
                var isMultiLine = _hcmn_.StringTools.replace(this._text, "\r", "\n").split("\n").length > 1;
                if (isMultiLine && this.style.getAutoSize()) {
                    this.renderMultiLine();
                    return;
                }
                if (this.style.getKerning() == 0 && this.style.getMonospaceLetters().length == 0) {
                    if (!isMultiLine || this.style.getForceSingleLine()) {
                        if (this.style.getWidth() > -1) {
                            this.style.setFontSize(this._originalFontSize);
                            this.prepareSingleLine();
                            this.adjustFontSizeAccordingToLabelSize((function(f, a1) {
                                return function() {
                                    return f(a1);
                                };
                            })($bind(this, this.getLabelWidth), characters));
                        } else this.prepareSingleLine();
                        var labelPosition = this.getLabelPosition(this._text);
                        y = labelPosition.y;
                        x = labelPosition.x;
                        this.ctx.lineJoin = "round";
                        if (this.shouldUpdateTopOffset) {
                            this.topOffset = this.getTopOffset(this._text);
                            if (this.style.getGradientType() != viewBuilderApi.LabelGradientType.NONE && this.style.getFillPatternImage() == null) this.updateGradient(y);
                        }
                        if (this.style.getOuterStroke()) this.fillOuterStrokeText(this._text, x, y - this.topOffset);
                        else this.fillInnerStrokeText(this._text, x, y - this.topOffset);
                    } else this.renderMultiLine();
                } else {
                    this.style.setFontSize(this._originalFontSize);
                    this.style.setMonospaceLetterWidth(0);
                    this.drawBounds();
                    this.adjustFontSizeAccordingToLabelSize((function(f1, a11) {
                        return function() {
                            return f1(a11);
                        };
                    })($bind(this, this.getLabelWidth), characters));
                    var labelPosition1 = this.getLabelPosition(this._text);
                    y = labelPosition1.y;
                    x = labelPosition1.x;
                    while (index < characters.length) {
                        current = characters[index++];
                        var originalLetterWidth = this.ctx.measureText(current).width;
                        var actualLetterWidth = this.getLabelWidth([current]);
                        var currentPosition1 = x + (actualLetterWidth - originalLetterWidth) * .5;
                        if (this.style.getOuterStroke()) this.fillOuterStrokeText(current, currentPosition1, y);
                        else this.fillInnerStrokeText(current, currentPosition1, y);
                        x += actualLetterWidth;
                    }
                }
                this.displayObject.update(this.canvas, this.style.getWidth(), this.style.getHeight());
            }
        };
        viewbuilderImpl.LabelComponent.prototype.adjustFontSizeAccordingToLabelSize = function(labelWidthProvider) {
            var labelWidth = labelWidthProvider();
            var isNeedToDrawBounds = false;
            while (labelWidth >= this.style.getWidth()) {
                isNeedToDrawBounds = true;
                this.style.setFontSize(this.style.getFontSize() - 1);
                this.style.setMonospaceLetterWidth(0);
                this.prepareSingleLine();
                labelWidth = labelWidthProvider();
            }
            if (isNeedToDrawBounds) this.drawBounds();
        };
        viewbuilderImpl.LabelComponent.prototype.getLabelPosition = function(text, lineNumber) {
            if (lineNumber == null) lineNumber = 0;
            var x;
            var y;
            var labelWidth = this.getLabelWidth(text.split(""));
            if (this.style.getTop() < 0) {
                if (this._linesNum > 1) {
                    y = _hcmn_.Math.floor(this.style.getFontSize() + (this.style.getHeight() - this.style.getLineHeight() * this._linesNum) / 2);
                    if (y < this.style.getLineHeight()) y = this.style.getLineHeight();
                } else y = _hcmn_.Math.floor(this.style.getFontSize() + (this.style.getHeight() - this.style.getFontSize()) / 2);
            } else y = this.style.getFontSize() + this.style.getTop();
            y += lineNumber * this.style.getLineHeight();
            if (this.style.getAlign() == viewBuilderApi.LabelTextAlign.RIGHT) {
                x = _hcmn_.Std["int"](this.style.getWidth() - labelWidth);
                x += this.style.getLeft();
            } else if (this.style.getAlign() == viewBuilderApi.LabelTextAlign.CENTER) {
                x = _hcmn_.Std["int"]((this.style.getWidth() - labelWidth) / 2);
                x += this.style.getLeft();
            } else x = 1 + this.style.getLeft();
            return new displayEngineApi.Point(x, y);
        };
        viewbuilderImpl.LabelComponent.prototype.getLabelWidth = function(characters) {
            if (characters == null) characters = this._text.split("");
            else characters = characters;
            var result = 0.0;
            var index = 0;
            this.adjustMonospaceEffect();
            while (index < characters.length) {
                var current = characters[index++];
                var currentLetterWidth = this.getLetterWidth(current);
                result += currentLetterWidth;
            }
            return result;
        };
        viewbuilderImpl.LabelComponent.prototype.adjustMonospaceEffect = function() {
            if (this.style.getMonospaceLetterWidth() > 0) return;
            var monospaceLetters = this.style.getMonospaceLetters();
            if (monospaceLetters.length > 0) {
                var letterWidth = 0;
                var _g = 0;
                var _g1 = monospaceLetters.split("");
                while (_g < _g1.length) {
                    var character = _g1[_g];
                    ++_g;
                    letterWidth = _hcmn_.Math.max(letterWidth, this.ctx.measureText(character).width);
                }
                this.style.setMonospaceLetterWidth(letterWidth);
            }
        };
        viewbuilderImpl.LabelComponent.prototype.getLetterWidth = function(character) {
            var result = null;
            if (this.style.getMonospaceLetters().indexOf(character) >= 0) result = this.style.getMonospaceLetterWidth();
            else result = this.ctx.measureText(character).width;
            return result + this.style.getKerning();
        };
        viewbuilderImpl.LabelComponent.prototype.fillOuterStrokeText = function(text, x, y) {
            if (this.style.getStrokeThickness() > 0) {
                this.ctx.lineJoin = "round";
                this.ctx.strokeText(text, x, y);
            }
            this.ctx.fillText(text, x, y);
        };
        viewbuilderImpl.LabelComponent.prototype.fillInnerStrokeText = function(text, x, y) {
            this.ctx.fillText(text, x, y);
            if (this.style.getStrokeThickness() > 0) {
                this.ctx.lineJoin = "round";
                this.ctx.strokeText(text, x, y);
            }
        };
        viewbuilderImpl.LabelComponent.prototype.getTopOffset = function(text) {
            this.shouldUpdateTopOffset = false;
            var _w = this.canvas.width | 0;
            viewbuilderImpl.LabelComponent.tocanvas.width = _w;
            viewbuilderImpl.LabelComponent.tocanvas.height = this.canvas.height;
            viewbuilderImpl.LabelComponent.toctx.clearRect(0, 0, _w, this.canvas.height);
            viewbuilderImpl.LabelComponent.toctx.font = this.ctx.font;
            viewbuilderImpl.LabelComponent.toctx.fillStyle = this.ctx.fillStyle;
            viewbuilderImpl.LabelComponent.toctx.fillText(text, 0, this.style.getFontSize());
            var data = viewbuilderImpl.LabelComponent.toctx.getImageData(0, 0, _w, this.canvas.height).data;
            var _g1 = 0;
            var _g = this.canvas.height;
            while (_g1 < _g) {
                var i = _g1++;
                var _g2 = 0;
                while (_g2 < _w) {
                    var j = _g2++;
                    var pixel = data[i * _w * 4 + j * 4 + 3];
                    if (pixel > 20)
                        if (this.style.getTop() < 0) return (i / 2 | 0) + _hcmn_.Std["int"](this.style.getStrokeThickness());
                        else return i - _hcmn_.Std["int"](this.style.getStrokeThickness());
                }
            }
            return 0;
        };
        viewbuilderImpl.LabelComponent.prototype.updateGradient = function(y) {
            var gradient;
            if (this.style.getFillRotation() == 90) gradient = this.ctx.createLinearGradient(0, y == 0 ? 0 : this.topOffset, 0, y == 0 ? this.canvas.height - this.topOffset * 2 : y);
            else gradient = this.ctx.createLinearGradient(0, 0, this.getWidth(), 0);
            if (gradient != null) {
                var i = 0;
                while (i < this.style.getGradientColorStops().length) {
                    gradient.addColorStop(this.style.getGradientColorStops()[i].pos, this.style.getGradientColorStops()[i].color);
                    i++;
                }
            }
            this.ctx.fillStyle = gradient;
        };
        viewbuilderImpl.LabelComponent.prototype.drawBounds = function() {
            if (this.style.getHeight() <= 0) this.style.setHeight(_hcmn_.Std["int"](this._linesNum * this.style.getLineHeight() - (this.style.getLineHeight() - this.style.getFontSize() + 1)));
            this.canvas.setAttribute("height", this.style.getHeight() + "px");
            this.canvas.setAttribute("width", this.style.getWidth() + "px");
            if (this.style.getBackgroundColor() != "transparent") {
                this.ctx.fillStyle = this.style.getBackgroundColor();
                this.ctx.fillRect(0, 0, this.style.getWidth() - 1, this.style.getHeight());
            }
            if (this.style.getBorderColor() != "transparent") {
                this.ctx.strokeStyle = this.style.getBorderColor();
                this.ctx.strokeRect(0, 0, this.style.getWidth(), _hcmn_.Math.floor(this.style.getHeight()));
            }
            this.ctx.font = this.getStyleString();
        };
        viewbuilderImpl.LabelComponent.prototype.prepareSingleLine = function() {
            this.ctx.clearRect(0, 0, 1000, 1000);
            this.ctx.font = this.getStyleString();
            var metrics = this.ctx.measureText(this._text);
            var testWidth = metrics.width;
            var fSize = this.style.getFontSize();
            this.drawBounds();
            if (this.style.getGroup() != "#__NO_GROUP__#") {
                ((function($this) {
                    var $r;
                    var key = $this.style.getGroup();
                    $r = viewbuilderImpl.LabelComponent.groups.get(key);
                    return $r;
                }(this))).fontSize = this.style.getFontSize();
                var _g = 0;
                var _g1;
                _g1 = ((function($this) {
                    var $r;
                    var key1 = $this.style.getGroup();
                    $r = viewbuilderImpl.LabelComponent.groups.get(key1);
                    return $r;
                }(this))).labels;
                while (_g < _g1.length) {
                    var lbl = _g1[_g];
                    ++_g;
                    lbl.getStyle().setFontSize(this.style.getFontSize());
                }
            }
        };
        viewbuilderImpl.LabelComponent.prototype.renderMultiLine = function() {
            if (this.style.getAutoSize()) {
                this.text = this.handleMultipleNewline(this._text);
                this.validate();
                this.render();
            } else {
                var reg = new _hcmn_.EReg("^\\s+", "i");
                var lines = _hcmn_.StringTools.replace(this._text, "\r", "\n").split("\n");
                var finalLines = [];
                var _g1 = 0;
                var _g = lines.length;
                while (_g1 < _g) {
                    var i = _g1++;
                    lines[i] = reg.replace(lines[i], "");
                    var words = lines[i].split(" ");
                    var line = "";
                    var _g3 = 0;
                    var _g2 = words.length;
                    while (_g3 < _g2) {
                        var n = _g3++;
                        var testLine = line + words[n] + " ";
                        var metrics = this.ctx.measureText(testLine);
                        var testWidth = metrics.width;
                        if (testWidth > this.style.getWidth() && n > 0) {
                            finalLines.push(line);
                            line = words[n] + " ";
                        } else line = testLine;
                    }
                    finalLines.push(line);
                }
                this._linesNum = finalLines.length;
                this.drawBounds();
                var _g11 = 0;
                var _g4 = finalLines.length;
                while (_g11 < _g4) {
                    var i1 = _g11++;
                    var line1 = finalLines[i1];
                    var position = this.getLabelPosition(line1, i1);
                    if (this.style.getOuterStroke()) this.fillOuterStrokeText(line1, position.x, position.y);
                    else this.fillInnerStrokeText(line1, position.x, position.y);
                }
            }
        };
        viewbuilderImpl.LabelComponent.prototype.getStyleString = function(fSize) {
            if (fSize == null) fSize = -1;
            this.ctx.fillStyle = this.style.getFontColor();
            if (this.style.getStrokeThickness() > 0) {
                this.ctx.lineJoin = "round";
                this.ctx.lineWidth = this.style.getStrokeThickness() + (this.style.getOuterStroke() ? 2 : 0);
                this.ctx.strokeStyle = this.style.getStrokeColor();
            }
            if (this.style.getGradientType() == viewBuilderApi.LabelGradientType.LINEAR && this.style.getGradientColorStops().length > 0) this.updateGradient(0);
            var fillPattern = this.style.getFillPatternImage();
            if (fillPattern != null) {
                var pat = this.ctx.createPattern(fillPattern, this.style.getFillPatternRepetition().value);
                this.ctx.fillStyle = pat;
            }
            if (this.style.getShadowColor() != "") {
                this.ctx.shadowColor = this.style.getShadowColor();
                this.ctx.shadowBlur = this.style.getShadowBlur();
                this.ctx.shadowOffsetX = this.style.getShadowOffsetX();
                this.ctx.shadowOffsetY = this.style.getShadowOffsetY();
            }
            if (fSize != -1) fSize = fSize;
            else fSize = this.style.getFontSize();
            return this.style.getFontStyle() + " " + this.style.getFontWeight() + " " + fSize + "px " + this.style.getFontFamily();
        };
        viewbuilderImpl.LabelComponent.prototype.getBounds = function() {
            var bnds = new displayEngineApi.Rectangle(this.displayObject.getX(), this.displayObject.getY(), 0.0, this._linesNum * this.style.getLineHeight() - (this.style.getLineHeight() - this.style.getFontSize() + 1));
            this.ctx.font = this.getStyleString();
            if (this.style.getKerning() == 0 && this.style.getMonospaceLetters().length == 0) bnds.w = this.ctx.measureText(_hcmn_.StringTools.trim(this._text) != "" ? this._text : "|").width;
            else if (this.style.getMonospaceLetters().length > 0 || this.style.getKerning() > 0) {
                bnds.w = 0;
                var characters = this._text.split("");
                var _g1 = 0;
                var _g = this._text.length;
                while (_g1 < _g) {
                    var index = _g1++;
                    var current = characters[index];
                    bnds.w = bnds.w + this.getLabelWidth(characters);
                }
            }
            return bnds;
        };
        viewbuilderImpl.LabelComponent.prototype.tryAddShadow = function(container) {
            if (container != null) this.componentHolder = container;
            else container = this.componentHolder;
            var displayObject = this.getDisplayObject();
            var shadowName = _hcmn_.Std.string(displayObject.getName()) + viewbuilderImpl.LabelComponent.SHADOW_SUFFIX;
            var shadow;
            if (container != null && container.getComponentById(shadowName) != null) {
                shadow = _hcmn_.js_Boot.__cast(container.getComponentById(shadowName), viewBuilderApi.IViewBuilderComponent);
                if (shadow != null) {
                    if (shadow.getDisplayObject().getParent() != container.getDisplayObject()) this.shadowReference = null;
                    if (this.shadowReference == null) {
                        var parent = displayObject.getParent();
                        var zOrder = displayObject.getZOrder();
                        parent.addChildAt(shadow.getDisplayObject(), zOrder > 0 ? zOrder - 1 : 0);
                        this.shadowReference = _hcmn_.js_Boot.__cast(shadow, viewbuilderImpl.LabelComponent);
                    }
                }
            }
        };
        viewbuilderImpl.LabelComponent.prototype.getWidth = function() {
            if (this.style.getWidth() != -1) return this.style.getWidth();
            else return this.getBounds().w;
        };
        viewbuilderImpl.LabelComponent.prototype.getHeight = function() {
            if (this.style.getHeight() != -1) return this.style.getHeight();
            else return this.getBounds().h;
        };
        viewbuilderImpl.LabelComponent.prototype.defaults = null;
        viewbuilderImpl.LabelComponent.prototype.opts = null;
        viewbuilderImpl.LabelComponent.prototype.EL_WIDTH = null;
        viewbuilderImpl.LabelComponent.prototype.EL_HEIGHT = null;
        viewbuilderImpl.LabelComponent.prototype.MAX_TXT_WIDTH = null;
        viewbuilderImpl.LabelComponent.prototype.MAX_TXT_HEIGHT = null;
        viewbuilderImpl.LabelComponent.prototype.fontSize = null;
        viewbuilderImpl.LabelComponent.prototype.textBlockHeight = null;
        viewbuilderImpl.LabelComponent.prototype.lines = null;
        viewbuilderImpl.LabelComponent.prototype.newLineIndexes = null;
        viewbuilderImpl.LabelComponent.prototype.textPos = null;
        viewbuilderImpl.LabelComponent.prototype.lineHeight = null;
        viewbuilderImpl.LabelComponent.prototype.mlOriginalFontSize = null;
        viewbuilderImpl.LabelComponent.prototype.multiNewLineDelimiter = null;
        viewbuilderImpl.LabelComponent.prototype.text = null;
        viewbuilderImpl.LabelComponent.prototype.handleMultipleNewline = function(text) {
            this.canvas.width = this.style.getWidth();
            this.canvas.height = this.style.getHeight();
            this.displayObject.update(this.canvas, this.canvas.width, this.canvas.height);
            this.displayObject._obj.width = this.canvas.width;
            this.displayObject._obj.height = this.canvas.height;
            var _g = 0;
            var _g1 = _hcmn_.Reflect.fields(this.defaults);
            while (_g < _g1.length) {
                var key = _g1[_g];
                ++_g;
                this.opts[key] = this.defaults[key];
            }
            this.opts.font = this.getStyleString();
            this.opts.textAlign = _hcmn_.Std.string(this.style.getAlign()).toLowerCase();
            this.opts.lineHeight = this.lineHeight = this.style.getLineHeight();
            this.opts.paddingX = this.style.getLeft();
            this.opts.paddingY = this.style.getTop();
            this.EL_WIDTH = this.canvas.width;
            this.EL_HEIGHT = this.canvas.height;
            this.MAX_TXT_WIDTH = this.EL_WIDTH - (this.opts.paddingX * 2 | 0);
            this.MAX_TXT_HEIGHT = this.EL_HEIGHT - (this.opts.paddingY * 2 | 0);
            if (this.mlOriginalFontSize < 0) this.mlOriginalFontSize = this._originalFontSize;
            this.opts.maxFontSizeToFill = this.mlOriginalFontSize;
            this.setFontSize(this.mlOriginalFontSize);
            this.textBlockHeight = 0;
            this.lines = [];
            this.newLineIndexes = [];
            this.textPos = {
                x: 0,
                y: 0
            };
            var regex = new _hcmn_.EReg("\n\n", "g");
            do text = text.replace(/\n\n/g, "\n" + this.multiNewLineDelimiter + "\n"); while (text.indexOf("\n\n") > -1);
            return text;
        };
        viewbuilderImpl.LabelComponent.prototype.setFontSize = function(fontSize) {
            this.fontSize = fontSize;
            this.opts.font = this.ctx.font = this.getStyleString(fontSize);
        };
        viewbuilderImpl.LabelComponent.prototype.setLineHeight = function() {
            if (!(function($this) {
                    var $r;
                    var f = $this.opts.lineHeight;
                    $r = isNaN(f);
                    return $r;
                }(this))) this.lineHeight = this.fontSize * this.opts.lineHeight | 0;
            else if (_hcmn_.Std.string(this.opts.lineHeight).indexOf("px") != -1) this.lineHeight = _hcmn_.Std.parseInt(this.opts.lineHeight);
            else if (_hcmn_.Std.string(this.opts.lineHeight).indexOf("%") != -1) this.lineHeight = _hcmn_.Std["int"](_hcmn_.Std.parseInt(this.opts.lineHeight) / 100 * this.fontSize);
        };
        viewbuilderImpl.LabelComponent.prototype.render = function() {
            var splitRegEx = new _hcmn_.EReg("\\s+", "");
            if (this.opts.sizeToFill) {
                var wordsCount = this.text.trim().split(/\s+/).length;
                var newFontSize = 0;
                var fontSizeHasLimit = this.opts.maxFontSizeToFill != false;
                fontSizeHasLimit = true;
                do
                    if (fontSizeHasLimit) {
                        if (++newFontSize <= this.opts.maxFontSizeToFill) this.adjustFontSize(newFontSize);
                        else break;
                    } else this.adjustFontSize(++newFontSize); while (this.textBlockHeight < this.MAX_TXT_HEIGHT && this.lines.join(" ").split(/\s+/).length == wordsCount);
                this.adjustFontSize(--newFontSize);
            } else this.wrap();
            if (this.opts.justifyLines && this.opts.lineBreak == "auto") this.justify();
            this.setVertAlign();
            this.setHorizAlign();
            this.drawText();
        };
        viewbuilderImpl.LabelComponent.prototype.fontSizeChangedCount = null;
        viewbuilderImpl.LabelComponent.prototype.adjustFontSize = function(size) {
            this.setFontSize(size);
            this.wrap();
        };
        viewbuilderImpl.LabelComponent.prototype.wrap = function() {
            var splitRegEx = new _hcmn_.EReg("\\s+", "");
            if (this.opts.allowNewLine) {
                var newLines = _hcmn_.StringTools.trim(this.text).split("\n");
                var idx = 0;
                var _g1 = 0;
                var _g = newLines.length - 1;
                while (_g1 < _g) {
                    var i = _g1++;
                    idx += newLines[i].trim().split(/\s+/).length;
                    this.newLineIndexes.push(idx);
                }
            }
            var words = this.text.trim().split(/\s+/);
            this.checkLength(words);
            this.breakText(words);
            this.textBlockHeight = this.lines.length * this.lineHeight;
        };
        viewbuilderImpl.LabelComponent.prototype.checkLength = function(words) {
            var testString = "";
            var tokenLen = 0;
            var sliced = "";
            var leftover = "";
            var index = 0;
            var _g = 0;
            while (_g < words.length) {
                var word = words[_g];
                ++_g;
                testString = "";
                tokenLen = this.ctx.measureText(word).width;
                var k = 0;
                if (tokenLen > this.MAX_TXT_WIDTH) {
                    while (k < word.length) {
                        if (this.ctx.measureText(testString + word.charAt(k)).width <= this.MAX_TXT_WIDTH) testString += word.charAt(k);
                        ++k;
                    }
                    sliced = _hcmn_.HxOverrides.substr(word, 0, k);
                    leftover = _hcmn_.HxOverrides.substr(word, k, null);
                    words.splice(index, 1);
                    words.splice(index, 0, sliced);
                    words.splice(index + 1, 0, leftover);
                }
                ++index;
            }
        };
        viewbuilderImpl.LabelComponent.prototype.breakText = function(words) {
            this.lines = [];
            var i = 0;
            var j = 0;
            while (i < words.length) {
                this.lines[j] = "";
                if (this.opts.lineBreak == "auto") {
                    if (this.ctx.measureText(this.lines[j] + words[i]).width > this.MAX_TXT_WIDTH) break;
                    else
                        while (this.ctx.measureText(this.lines[j] + words[i]).width <= this.MAX_TXT_WIDTH && i < words.length) {
                            this.lines[j] += words[i] + " ";
                            i++;
                            if (this.opts.allowNewLine) {
                                var _g1 = 0;
                                var _g = this.newLineIndexes.length;
                                while (_g1 < _g) {
                                    var k = _g1++;
                                    if (this.newLineIndexes[k] == i) {
                                        j++;
                                        this.lines[j] = "";
                                        break;
                                    }
                                }
                            }
                        }
                    this.lines[j] = _hcmn_.StringTools.trim(this.lines[j]);
                } else {
                    this.lines[j] = words[i];
                    i++;
                }
                ++j;
            }
        };
        viewbuilderImpl.LabelComponent.prototype.justify = function() {
            var splitRegEx = new _hcmn_.EReg("\\s+", "");
            var maxLen = -1;
            var longestLineIndex = 0;
            var tokenLen = 0;
            var _g1 = 0;
            var _g = this.lines.length;
            while (_g1 < _g) {
                var i = _g1++;
                tokenLen = this.ctx.measureText(this.lines[i]).width;
                if (maxLen == -1 || tokenLen > maxLen) {
                    maxLen = tokenLen;
                    longestLineIndex = i;
                }
            }
            var numWords;
            var spaceLength;
            var numOfSpaces;
            var num;
            var filler;
            var delimiter = " ";
            var _g11 = 0;
            var _g2 = this.lines.length;
            while (_g11 < _g2) {
                var i1 = _g11++;
                if (i1 == longestLineIndex) continue;
                numWords = this.lines[i].trim().split(/\s+/).length;
                if (numWords <= 1) continue;
                this.lines[i1] = this.lines[i].trim().split(/\s+/).join(delimiter);
                spaceLength = this.ctx.measureText(delimiter).width;
                numOfSpaces = _hcmn_.Std["int"]((maxLen - this.ctx.measureText(this.lines[i1]).width) / spaceLength);
                num = numOfSpaces / (numWords - 1) | 0;
                filler = "";
                var _g21 = 0;
                while (_g21 < num) {
                    var j = _g21++;
                    filler += delimiter;
                }
                this.lines[i1] = _hcmn_.StringTools.trim(this.lines[i1]).split(delimiter).join(filler);
            }
        };
        viewbuilderImpl.LabelComponent.prototype.drawText = function() {
            var skipLineOnMatch = this.multiNewLineDelimiter + " ";
            var _g1 = 0;
            var _g = this.lines.length;
            while (_g1 < _g) {
                var i = _g1++;
                this.textPos.y = _hcmn_.Std["int"](this.textPos.y) + this.lineHeight;
                if (this.lines[i] != skipLineOnMatch) {
                    if (this.style.getOuterStroke()) this.fillOuterStrokeText(this.lines[i], this.textPos.x, this.textPos.y);
                    else this.fillInnerStrokeText(this.lines[i], this.textPos.x, this.textPos.y);
                }
            }
        };
        viewbuilderImpl.LabelComponent.prototype.setHorizAlign = function() {
            this.ctx.textAlign = this.opts.textAlign;
            if (this.opts.textAlign == "center") this.textPos.x = this.EL_WIDTH / 2;
            else if (this.opts.textAlign == "right") this.textPos.x = this.EL_WIDTH - this.opts.paddingX;
            else this.textPos.x = this.opts.paddingX;
        };
        viewbuilderImpl.LabelComponent.prototype.setVertAlign = function() {
            if (this.opts.verticalAlign == "middle") this.textPos.y = (this.EL_HEIGHT - this.textBlockHeight) / 2;
            else if (this.opts.verticalAlign == "bottom") this.textPos.y = this.EL_HEIGHT - this.textBlockHeight - this.opts.paddingY;
            else this.textPos.y = this.opts.paddingY;
        };
        viewbuilderImpl.LabelComponent.prototype.validate = function() {
            if (!(typeof(this.text) == "string")) throw new js._Boot.HaxeError("The second parameter must be a String.");
            if (isNaN(this.fontSize)) throw new js._Boot.HaxeError("Cannot parse \"font\".");
            if (isNaN(this.lineHeight)) throw new js._Boot.HaxeError("Cannot parse \"lineHeight\".");
            if (this.opts.textAlign.toLocaleLowerCase() != "left" && this.opts.textAlign.toLocaleLowerCase() != "center" && this.opts.textAlign.toLocaleLowerCase() != "right") throw new js._Boot.HaxeError("Property \"textAlign\" must be set to either \"left\", \"center\", or \"right\".");
            if (this.opts.verticalAlign.toLocaleLowerCase() != "top" && this.opts.verticalAlign.toLocaleLowerCase() != "middle" && this.opts.verticalAlign.toLocaleLowerCase() != "bottom") throw new js._Boot.HaxeError("Property \"verticalAlign\" must be set to either \"top\", \"middle\", or \"bottom\".");
            if (!(typeof(this.opts.justifyLines) == "boolean")) throw new js._Boot.HaxeError("Property \"justifyLines\" must be a _hcmn_.Boolean.");
            if ((function($this) {
                    var $r;
                    var f = $this.opts.paddingX;
                    $r = isNaN(f);
                    return $r;
                }(this))) throw new js._Boot.HaxeError("Property \"paddingX\" must be a Number.");
            if ((function($this) {
                    var $r;
                    var f1 = $this.opts.paddingY;
                    $r = isNaN(f1);
                    return $r;
                }(this))) throw new js._Boot.HaxeError("Property \"paddingY\" must be a Number.");
            if (!(typeof(this.opts.fitParent) == "boolean")) throw new js._Boot.HaxeError("Property \"fitParent\" must be a _hcmn_.Boolean.");
            if (this.opts.lineBreak.toLocaleLowerCase() != "auto" && this.opts.lineBreak.toLocaleLowerCase() != "word") throw new js._Boot.HaxeError("Property \"lineBreak\" must be set to either \"auto\" or \"word\".");
            if (!(typeof(this.opts.sizeToFill) == "boolean")) throw new js._Boot.HaxeError("Property \"sizeToFill\" must be a _hcmn_.Boolean.");
            if (!(typeof(this.opts.strokeText) == "boolean")) throw new js._Boot.HaxeError("Property \"strokeText\" must be a _hcmn_.Boolean.");
            return this.lines;
        };
        viewbuilderImpl.LabelComponent.tocanvas = null;
        viewbuilderImpl.LabelComponent.toctx = null;
        viewbuilderImpl.LabelComponent.updateAllLabels = function() {
            var _g = 0;
            var _g1 = viewbuilderImpl.LabelComponent.allLabels;
            while (_g < _g1.length) {
                var l = _g1[_g];
                ++_g;
                l.forceRenderText();
            }
        };
        viewbuilderImpl.LabelComponent.prototype.__class__ = viewbuilderImpl.LabelComponent;
        viewbuilderImpl.LabelStyle = function(style) {
            this._lineHeightNotSet = true;
            this._monospaceletterWidth = 0;
            this._monospaceLetters = "";
            this._shadowOffsetY = 0;
            this._shadowOffsetX = 0;
            this._shadowBlur = 0;
            this._shadowColor = "";
            this._autoSize = false;
            this._left = 0;
            this._top = -1;
            this._fillRotation = 0;
            this._gradientColorStops = [];
            this._gradientType = viewBuilderApi.LabelGradientType.NONE;
            this._outerStroke = false;
            this._strokeColor = "#00ff00";
            this._strokeThickness = 0;
            this._kerning = 0;
            this._borderColor = "transparent";
            this._backgroundColor = "transparent";
            this._lineHeight = -987654321;
            this._group = "#__NO_GROUP__#";
            this._forceSingleLine = true;
            this._height = -1;
            this._width = -1;
            this._align = viewBuilderApi.LabelTextAlign.LEFT;
            this._fontStyle = "normal";
            this._fontWeight = "normal";
            this._fontSize = 20;
            this._fontColor = "#000000";
            this._fontFamily = "Arial";
            this._styleID = "";
            if (style != null) this.applyStyle(style);
        };
        viewbuilderImpl.LabelStyle = ck_implements(viewbuilderImpl.LabelStyle, viewBuilderApi.ILabelStyle);
        viewbuilderImpl.LabelStyle.__interfaces__ = [viewBuilderApi.ILabelStyle];
        viewbuilderImpl.LabelStyle.__name__ = ["viewbuilderImpl", "LabelStyle"];
        viewbuilderImpl.LabelStyle.prototype._styleID = null;
        viewbuilderImpl.LabelStyle.prototype._fontFamily = null;
        viewbuilderImpl.LabelStyle.prototype._fontColor = null;
        viewbuilderImpl.LabelStyle.prototype._fontSize = null;
        viewbuilderImpl.LabelStyle.prototype._fontWeight = null;
        viewbuilderImpl.LabelStyle.prototype._fontStyle = null;
        viewbuilderImpl.LabelStyle.prototype._align = null;
        viewbuilderImpl.LabelStyle.prototype._width = null;
        viewbuilderImpl.LabelStyle.prototype._height = null;
        viewbuilderImpl.LabelStyle.prototype._forceSingleLine = null;
        viewbuilderImpl.LabelStyle.prototype._group = null;
        viewbuilderImpl.LabelStyle.prototype._lineHeight = null;
        viewbuilderImpl.LabelStyle.prototype._backgroundColor = null;
        viewbuilderImpl.LabelStyle.prototype._borderColor = null;
        viewbuilderImpl.LabelStyle.prototype._kerning = null;
        viewbuilderImpl.LabelStyle.prototype._strokeThickness = null;
        viewbuilderImpl.LabelStyle.prototype._strokeColor = null;
        viewbuilderImpl.LabelStyle.prototype._outerStroke = null;
        viewbuilderImpl.LabelStyle.prototype._gradientType = null;
        viewbuilderImpl.LabelStyle.prototype._gradientColorStops = null;
        viewbuilderImpl.LabelStyle.prototype._fillRotation = null;
        viewbuilderImpl.LabelStyle.prototype._top = null;
        viewbuilderImpl.LabelStyle.prototype._left = null;
        viewbuilderImpl.LabelStyle.prototype._autoSize = null;
        viewbuilderImpl.LabelStyle.prototype._shadowColor = null;
        viewbuilderImpl.LabelStyle.prototype._shadowBlur = null;
        viewbuilderImpl.LabelStyle.prototype._shadowOffsetX = null;
        viewbuilderImpl.LabelStyle.prototype._shadowOffsetY = null;
        viewbuilderImpl.LabelStyle.prototype._fillPatternImage = null;
        viewbuilderImpl.LabelStyle.prototype._fillPatternRepetition = null;
        viewbuilderImpl.LabelStyle.prototype._monospaceLetters = null;
        viewbuilderImpl.LabelStyle.prototype._monospaceletterWidth = null;
        viewbuilderImpl.LabelStyle.prototype._lineHeightNotSet = null;
        viewbuilderImpl.LabelStyle.prototype.applyStyle = function(style, callback) {
            var _g = this;
            if (style.styleID != null) this._styleID = style.styleID;
            else this._styleID = this._styleID;
            if (style.fontFamily != null) this._fontFamily = style.fontFamily;
            else this._fontFamily = this._fontFamily;
            if (style.color != null) this._fontColor = style.color;
            else this._fontColor = this._fontColor;
            if (style.fontColor != null) this._fontColor = style.fontColor;
            else this._fontColor = this._fontColor;
            if (style.fontSize != null) this._fontSize = _hcmn_.Std.parseInt(style.fontSize);
            else this._fontSize = this._fontSize;
            if (style.fontWeight != null) this._fontWeight = style.fontWeight;
            else this._fontWeight = this._fontWeight;
            if (style.fontStyle != null) this._fontStyle = style.fontStyle;
            else this._fontStyle = this._fontStyle;
            if (style.align != null) this._align = style.align;
            else this._align = this._align;
            if (style.width != null) this._width = style.width;
            else this._width = this._width;
            if (style.height != null) this._height = style.height;
            else this._height = this._height;
            if (style.forceSingleLine != null) this._forceSingleLine = style.forceSingleLine;
            else this._forceSingleLine = this._forceSingleLine;
            if (style.group != null) this._group = style.group;
            else this._group = this._group;
            if (style.lineHeight != null) this._lineHeight = style.lineHeight;
            else this._lineHeight = this._fontSize + this._fontSize / 8 | 0;
            if (style.backgroundColor != null) this._backgroundColor = style.backgroundColor;
            else this._backgroundColor = this._backgroundColor;
            if (style.borderColor != null) this._borderColor = style.borderColor;
            else this._borderColor = this._borderColor;
            if (style.kerning != null) this._kerning = style.kerning;
            else this._kerning = this._kerning;
            if (style.top != null) this._top = style.top;
            else this._top = this._top;
            if (style.left != null) this._left = style.left;
            else this._left = this._left;
            if (style.autoSize != null) this._autoSize = style.autoSize;
            else this._autoSize = this._autoSize;
            if (style.monospaceLetters != null) this._monospaceLetters = style.monospaceLetters;
            else this._monospaceLetters = this._monospaceLetters;
            if (this._lineHeight == -987654321) {
                if (this._lineHeight < this._fontSize + 1) this._lineHeight = this._fontSize + 1;
            } else this._lineHeightNotSet = false;
            if (style.patternFill != null) {
                var imageId = style.patternFill.imageId;
                viewbuilderImpl.ExternalService.assetRegistry.getAsset(style.patternFill.imageId).getContent().then(function(data) {
                    _g.setFillPattern(data, viewBuilderApi.ImagePatternRepetition.getByValue(style.patternFill.repetition));
                    if (callback != null) callback();
                });
            }
            if (style.textfillDef != null) {
                if (style.textfillDef.stroke != null) {
                    if (style.textfillDef.stroke.color != null) this._strokeColor = style.textfillDef.stroke.color;
                    else this._strokeColor = this._strokeColor;
                    if (style.textfillDef.stroke.weight != null && style.textfillDef.stroke.weight != "") this._strokeThickness = _hcmn_.Std.parseFloat(style.textfillDef.stroke.weight);
                    else this._strokeThickness = this._strokeThickness;
                    if (style.textfillDef.stroke.outerStroke != null) this._outerStroke = style.textfillDef.stroke.outerStroke;
                    else this._outerStroke = this._outerStroke;
                }
                if (style.textfillDef.gradient != null) {
                    if (style.textfillDef.gradient.stops != null) this._gradientColorStops = style.textfillDef.gradient.stops;
                    else this._gradientColorStops = this._gradientColorStops;
                    if (style.textfillDef.gradient.type != null) this._gradientType = style.textfillDef.gradient.type;
                    else this._gradientType = viewBuilderApi.LabelGradientType.NONE;
                    if (style.textfillDef.gradient.rotation != null) this._fillRotation = _hcmn_.Std.parseFloat(style.textfillDef.gradient.rotation);
                    else this._fillRotation = this._fillRotation;
                }
            }
            if (style.shadow != null) {
                if (style.shadow.color != null) this._shadowColor = style.shadow.color;
                else this._shadowColor = this._shadowColor;
                if (style.shadow.blur != null) this._shadowBlur = style.shadow.blur;
                else this._shadowBlur = this._shadowBlur;
                if (style.shadow.offsetX != null) this._shadowOffsetX = style.shadow.offsetX;
                else this._shadowOffsetX = this._shadowOffsetX;
                if (style.shadow.offsetY != null) this._shadowOffsetY = style.shadow.offsetY;
                else this._shadowOffsetY = this._shadowOffsetY;
            }
        };
        viewbuilderImpl.LabelStyle.prototype.getShadowColor = function() {
            return this._shadowColor;
        };
        viewbuilderImpl.LabelStyle.prototype.setShadowColor = function(val) {
            this._shadowColor = val;
        };
        viewbuilderImpl.LabelStyle.prototype.getShadowBlur = function() {
            return this._shadowBlur;
        };
        viewbuilderImpl.LabelStyle.prototype.setShadowBlur = function(val) {
            this._shadowBlur = val;
        };
        viewbuilderImpl.LabelStyle.prototype.getShadowOffsetX = function() {
            return this._shadowOffsetX;
        };
        viewbuilderImpl.LabelStyle.prototype.setShadowOffsetX = function(val) {
            this._shadowOffsetX = val;
        };
        viewbuilderImpl.LabelStyle.prototype.getShadowOffsetY = function() {
            return this._shadowOffsetY;
        };
        viewbuilderImpl.LabelStyle.prototype.setShadowOffsetY = function(val) {
            this._shadowOffsetY = val;
        };
        viewbuilderImpl.LabelStyle.prototype.getFontFamily = function() {
            return this._fontFamily;
        };
        viewbuilderImpl.LabelStyle.prototype.setFontFamily = function(val) {
            this._fontFamily = val;
        };
        viewbuilderImpl.LabelStyle.prototype.getFontSize = function() {
            return this._fontSize;
        };
        viewbuilderImpl.LabelStyle.prototype.setFontSize = function(val) {
            this._fontSize = val;
        };
        viewbuilderImpl.LabelStyle.prototype.getFontWeight = function() {
            return this._fontWeight;
        };
        viewbuilderImpl.LabelStyle.prototype.setFontWeight = function(val) {
            this._fontWeight = val;
        };
        viewbuilderImpl.LabelStyle.prototype.getFontColor = function() {
            return this._fontColor;
        };
        viewbuilderImpl.LabelStyle.prototype.setFontColor = function(val) {
            this._fontColor = val;
        };
        viewbuilderImpl.LabelStyle.prototype.getFontStyle = function() {
            return this._fontStyle;
        };
        viewbuilderImpl.LabelStyle.prototype.setFontStyle = function(val) {
            this._fontStyle = val;
        };
        viewbuilderImpl.LabelStyle.prototype.getGradientType = function() {
            return this._gradientType;
        };
        viewbuilderImpl.LabelStyle.prototype.setGradientType = function(val) {
            this._gradientType = val;
        };
        viewbuilderImpl.LabelStyle.prototype.getGradientColorStops = function() {
            return this._gradientColorStops;
        };
        viewbuilderImpl.LabelStyle.prototype.setGradientColorStops = function(val) {
            this._gradientColorStops = val;
        };
        viewbuilderImpl.LabelStyle.prototype.getStrokeThickness = function() {
            return this._strokeThickness;
        };
        viewbuilderImpl.LabelStyle.prototype.setStrokeThickness = function(val) {
            this._strokeThickness = val;
        };
        viewbuilderImpl.LabelStyle.prototype.getOuterStroke = function() {
            return this._outerStroke;
        };
        viewbuilderImpl.LabelStyle.prototype.setOuterStroke = function(val) {
            this._outerStroke = val;
        };
        viewbuilderImpl.LabelStyle.prototype.getStrokeColor = function() {
            return this._strokeColor;
        };
        viewbuilderImpl.LabelStyle.prototype.setStrokeColor = function(val) {
            this._strokeColor = val;
        };
        viewbuilderImpl.LabelStyle.prototype.getKerning = function() {
            return this._kerning;
        };
        viewbuilderImpl.LabelStyle.prototype.setKerning = function(val) {
            this._kerning = val;
        };
        viewbuilderImpl.LabelStyle.prototype.getLineHeight = function() {
            return this._lineHeight;
        };
        viewbuilderImpl.LabelStyle.prototype.setLineHeight = function(val) {
            this._lineHeight = val;
        };
        viewbuilderImpl.LabelStyle.prototype.getWidth = function() {
            return this._width;
        };
        viewbuilderImpl.LabelStyle.prototype.setWidth = function(value) {
            this._width = value;
        };
        viewbuilderImpl.LabelStyle.prototype.getHeight = function() {
            return this._height;
        };
        viewbuilderImpl.LabelStyle.prototype.setHeight = function(value) {
            this._height = value;
        };
        viewbuilderImpl.LabelStyle.prototype.getBackgroundColor = function() {
            return this._backgroundColor;
        };
        viewbuilderImpl.LabelStyle.prototype.setBackgroundColor = function(val) {
            this._backgroundColor = val;
        };
        viewbuilderImpl.LabelStyle.prototype.getBorderColor = function() {
            return this._borderColor;
        };
        viewbuilderImpl.LabelStyle.prototype.setBorderColor = function(val) {
            this._borderColor = val;
        };
        viewbuilderImpl.LabelStyle.prototype.getForceSingleLine = function() {
            return this._forceSingleLine;
        };
        viewbuilderImpl.LabelStyle.prototype.setForceSingleLine = function(val) {
            this._forceSingleLine = val;
        };
        viewbuilderImpl.LabelStyle.prototype.getGroup = function() {
            return this._group;
        };
        viewbuilderImpl.LabelStyle.prototype.setGroup = function(val) {
            this._group = val;
        };
        viewbuilderImpl.LabelStyle.prototype.getAlign = function() {
            return this._align;
        };
        viewbuilderImpl.LabelStyle.prototype.setAlign = function(val) {
            this._align = val;
        };
        viewbuilderImpl.LabelStyle.prototype.getFillRotation = function() {
            return this._fillRotation;
        };
        viewbuilderImpl.LabelStyle.prototype.setFillRotation = function(val) {
            this._fillRotation = val;
        };
        viewbuilderImpl.LabelStyle.prototype.getLeft = function() {
            return this._left;
        };
        viewbuilderImpl.LabelStyle.prototype.setLeft = function(val) {
            this._left = val;
        };
        viewbuilderImpl.LabelStyle.prototype.getTop = function() {
            return this._top;
        };
        viewbuilderImpl.LabelStyle.prototype.setTop = function(val) {
            this._top = val;
        };
        viewbuilderImpl.LabelStyle.prototype.getAutoSize = function() {
            return this._autoSize;
        };
        viewbuilderImpl.LabelStyle.prototype.setAutoSize = function(val) {
            this._autoSize = val;
        };
        viewbuilderImpl.LabelStyle.prototype.setFillPattern = function(image, repetition) {
            this._fillPatternImage = image;
            if (repetition == null) this._fillPatternRepetition = viewBuilderApi.ImagePatternRepetition.DEFAULT;
            else this._fillPatternRepetition = repetition;
        };
        viewbuilderImpl.LabelStyle.prototype.getFillPatternImage = function() {
            return this._fillPatternImage;
        };
        viewbuilderImpl.LabelStyle.prototype.getFillPatternRepetition = function() {
            return this._fillPatternRepetition;
        };
        viewbuilderImpl.LabelStyle.prototype.getMonospaceLetters = function() {
            return this._monospaceLetters;
        };
        viewbuilderImpl.LabelStyle.prototype.setMonospaceLetters = function(letters) {
            if (letters == null) this._monospaceLetters = "";
            else this._monospaceLetters = letters;
        };
        viewbuilderImpl.LabelStyle.prototype.setMonospaceLetterWidth = function(letterWidth) {
            this._monospaceletterWidth = letterWidth;
        };
        viewbuilderImpl.LabelStyle.prototype.getMonospaceLetterWidth = function() {
            return this._monospaceletterWidth;
        };
        viewbuilderImpl.LabelStyle.prototype.__class__ = viewbuilderImpl.LabelStyle;
        viewbuilderImpl.ParticleAnimationComponent = function(particleSystem, animation, id, fps) {
            this.alreadyOffScreened = false;
            this.offScreenFPS = 24;
            viewbuilderImpl.ViewBuilderComponent.call(this, particleSystem);
            if (fps != null) this.offScreenFPS = fps;
            this.animID = id;
            this.particleSystem = particleSystem;
            this.animation = animation;
            this.w = _hcmn_.Std["int"](this.getDisplayObject().getWidth());
            this.h = _hcmn_.Std["int"](this.getDisplayObject().getHeight());
            this.playingState = false;
            this.componentType = viewbuilderImpl.ComponentTypesEnum.PARTICLE[0];
        };
        viewbuilderImpl.ParticleAnimationComponent = ck_implements(viewbuilderImpl.ParticleAnimationComponent, viewBuilderApi.IParticleAnimationComponent);
        viewbuilderImpl.ParticleAnimationComponent.__interfaces__ = [viewBuilderApi.IParticleAnimationComponent];
        viewbuilderImpl.ParticleAnimationComponent.__name__ = ["viewbuilderImpl", "ParticleAnimationComponent"];
        viewbuilderImpl.ParticleAnimationComponent.__super__ = viewbuilderImpl.ViewBuilderComponent;
        for (var k in viewbuilderImpl.ViewBuilderComponent.prototype) viewbuilderImpl.ParticleAnimationComponent.prototype[k] = viewbuilderImpl.ViewBuilderComponent.prototype[k];
        viewbuilderImpl.ParticleAnimationComponent.prototype.offScreenFPS = null;
        viewbuilderImpl.ParticleAnimationComponent.prototype.animation = null;
        viewbuilderImpl.ParticleAnimationComponent.prototype.particleSystem = null;
        viewbuilderImpl.ParticleAnimationComponent.prototype.offScreenBitmapHolder = null;
        viewbuilderImpl.ParticleAnimationComponent.prototype.alreadyOffScreened = null;
        viewbuilderImpl.ParticleAnimationComponent.prototype.w = null;
        viewbuilderImpl.ParticleAnimationComponent.prototype.h = null;
        viewbuilderImpl.ParticleAnimationComponent.prototype.animID = null;
        viewbuilderImpl.ParticleAnimationComponent.prototype.getParticleSystem = function() {
            return this.particleSystem;
        };
        viewbuilderImpl.ParticleAnimationComponent.prototype.getAnimation = function() {
            return this.animation;
        };
        viewbuilderImpl.ParticleAnimationComponent.prototype.createOffscreenAnimation = function() {
            if (!this.alreadyOffScreened) {
                var parent = this.getDisplayObject().getParent();
                parent.removeChild(this.getDisplayObject());
                if (this.w == 0 || this.w == null) this.w = this.getDisplayObject().getUserData().viewBuilderW;
                if (this.h == 0 || this.h == null) this.h = this.getDisplayObject().getUserData().viewBuilderH;
                var x = this.getDisplayObject().getX();
                var y = this.getDisplayObject().getY();
                this.getDisplayObject().setX(0);
                this.getDisplayObject().setY(0);
                if (viewbuilderImpl.ParticleAnimationComponent.offScreenStages.get(this.animID) == null) {
                    var osStage = viewbuilderImpl.ExternalService.displayProvider.getFactory().createOffscreenStage(_hcmn_.Math.ceil(this.w), _hcmn_.Math.ceil(this.h), false, null, this.offScreenFPS);
                    osStage.getStage().addChild(this.getDisplayObject());
                    this.getDisplayObject().setVisible(true);
                    viewbuilderImpl.ParticleAnimationComponent.offScreenStages.set(this.animID, {
                        stage: osStage,
                        playing: false,
                        particleAnimSrc: this
                    });
                }
                this.offScreenBitmapHolder = viewbuilderImpl.ExternalService.displayProvider.getFactory().createDisplayObjectContainer();
                this.offScreenBitmapHolder.setName("OFFSCREEN_BITMAP_HOLDER");
                var bitmap = viewbuilderImpl.ExternalService.displayProvider.getFactory().createBitmap(viewbuilderImpl.ParticleAnimationComponent.offScreenStages.get(this.animID).stage, new displayEngineApi.Rectangle(0, 0, this.w, this.h));
                bitmap.setX(x);
                bitmap.setY(y);
                this.offScreenBitmapHolder.addChild(bitmap);
                parent.addChild(this.offScreenBitmapHolder);
                this.alreadyOffScreened = true;
            }
        };
        viewbuilderImpl.ParticleAnimationComponent.prototype.play = function(offScreen) {
            var parent = this.getDisplayObject().getParent();
            if (!this.playingState) {
                if (offScreen) this.createOffscreenAnimation();
                if (viewbuilderImpl.ParticleAnimationComponent.offScreenStages.get(this.animID) != null) {
                    var offScreen1 = viewbuilderImpl.ParticleAnimationComponent.offScreenStages.get(this.animID);
                    if (offScreen1.playing == false) {
                        var particleAnimSrc = offScreen1.particleAnimSrc;
                        if (particleAnimSrc.particleSystem != null) {
                            particleAnimSrc.particleSystem.start(offScreen1.stage.getStage());
                            if (particleAnimSrc.animation != null) particleAnimSrc.animation.start();
                            this.playingState = offScreen1.playing = true;
                        }
                    }
                } else if (this.particleSystem != null) {
                    this.particleSystem.start(viewbuilderImpl.ExternalService.displayProvider.getDefaultStage());
                    if (this.animation != null) this.animation.start();
                    this.playingState = true;
                }
            }
        };
        viewbuilderImpl.ParticleAnimationComponent.prototype.stop = function() {
            if (this.playingState) {
                if (viewbuilderImpl.ParticleAnimationComponent.offScreenStages.get(this.animID) != null) {
                    var offScreen = viewbuilderImpl.ParticleAnimationComponent.offScreenStages.get(this.animID);
                    if (offScreen.playing == true) {
                        var particleAnimSrc = offScreen.particleAnimSrc;
                        if (particleAnimSrc.particleSystem != null) {
                            particleAnimSrc.particleSystem.stop();
                            if (particleAnimSrc.animation != null) particleAnimSrc.animation.stop();
                            this.playingState = offScreen.playing = false;
                        }
                    }
                } else if (this.particleSystem != null) {
                    this.particleSystem.stop();
                    if (this.animation != null) this.animation.stop();
                    this.playingState = false;
                }
            }
        };
        viewbuilderImpl.ParticleAnimationComponent.prototype.dispose = function() {
            if (viewbuilderImpl.ParticleAnimationComponent.offScreenStages.get(this.animID) != null) {
                var offStage = viewbuilderImpl.ParticleAnimationComponent.offScreenStages.get(this.animID).stage;
                if (offStage != null) {
                    offStage.getStage().offAll();
                    offStage.getStage().removeAllChildren();
                    if (offStage != null && $bind(offStage, offStage.dispose) != null) offStage.dispose();
                    offStage = null;
                }
                viewbuilderImpl.ParticleAnimationComponent.offScreenStages.get(this.animID).particleAnimSrcs = null;
                viewbuilderImpl.ParticleAnimationComponent.offScreenStages.get(this.animID).playing = false;
                viewbuilderImpl.ParticleAnimationComponent.offScreenStages.set(this.animID, null);
                viewbuilderImpl.ParticleAnimationComponent.offScreenStages.remove(this.animID);
                this.alreadyOffScreened = false;
                if (this.offScreenBitmapHolder != null && ($_ = this.offScreenBitmapHolder, $bind($_, $_.dispose)) != null) this.offScreenBitmapHolder.dispose();
                this.offScreenBitmapHolder = null;
            }
            if (this.playingState) {
                this.stop();
                if (this.particleSystem != null && ($_ = this.particleSystem, $bind($_, $_.dispose)) != null) this.particleSystem.dispose();
            }
            viewbuilderImpl.ViewBuilderComponent.prototype.dispose.call(this);
        };
        viewbuilderImpl.ParticleAnimationComponent.prototype.show = function() {
            if (this.offScreenBitmapHolder != null) {
                this.offScreenBitmapHolder.setVisible(true);
                this.showOffScreen();
            } else viewbuilderImpl.ViewBuilderComponent.prototype.show.call(this);
        };
        viewbuilderImpl.ParticleAnimationComponent.prototype.showOffScreen = function() {
            if (viewbuilderImpl.ParticleAnimationComponent.offScreenStages.get(this.animID) != null) {
                var offScreen = viewbuilderImpl.ParticleAnimationComponent.offScreenStages.get(this.animID);
                if (offScreen.particleAnimSrc != null) offScreen.particleAnimSrc.getDisplayObject().setVisible(true);
            }
        };
        viewbuilderImpl.ParticleAnimationComponent.prototype.hide = function() {
            if (this.offScreenBitmapHolder != null) this.offScreenBitmapHolder.setVisible(false);
            else viewbuilderImpl.ViewBuilderComponent.prototype.hide.call(this);
        };
        viewbuilderImpl.ParticleAnimationComponent.prototype.hideOffScreen = function() {
            if (viewbuilderImpl.ParticleAnimationComponent.offScreenStages.get(this.animID) != null) {
                var offScreen = viewbuilderImpl.ParticleAnimationComponent.offScreenStages.get(this.animID);
                if (offScreen.particleAnimSrc != null) offScreen.particleAnimSrc.getDisplayObject().setVisible(false);
            }
        };
        viewbuilderImpl.ParticleAnimationComponent.prototype.setOffSCreenFSP = function(value) {
            this.offScreenFPS = value;
        };
        viewbuilderImpl.ParticleAnimationComponent.prototype.__class__ = viewbuilderImpl.ParticleAnimationComponent;
        viewbuilderImpl.SlideButtonContainer = function(cfg, assets) {
            this.isEnabled = true;
            this.isPointerDown = false;
            this.pointerId = null;
            viewbuilderImpl.ViewBuilderContainer.call(this, cfg, assets);
            this._events = new viewbuilderImpl.SlideButtonEvents();
        };
        viewbuilderImpl.SlideButtonContainer = ck_implements(viewbuilderImpl.SlideButtonContainer, viewBuilderApi.ISlideButtonContainer);
        viewbuilderImpl.SlideButtonContainer.__interfaces__ = [viewBuilderApi.ISlideButtonContainer];
        viewbuilderImpl.SlideButtonContainer.__name__ = ["viewbuilderImpl", "SlideButtonContainer"];
        viewbuilderImpl.SlideButtonContainer.__super__ = viewbuilderImpl.ViewBuilderContainer;
        for (var k in viewbuilderImpl.ViewBuilderContainer.prototype) viewbuilderImpl.SlideButtonContainer.prototype[k] = viewbuilderImpl.ViewBuilderContainer.prototype[k];
        viewbuilderImpl.SlideButtonContainer.prototype._events = null;
        viewbuilderImpl.SlideButtonContainer.prototype.baseButton = null;
        viewbuilderImpl.SlideButtonContainer.prototype.baseButtonMovieClip = null;
        viewbuilderImpl.SlideButtonContainer.prototype.pointerId = null;
        viewbuilderImpl.SlideButtonContainer.prototype.isPointerDown = null;
        viewbuilderImpl.SlideButtonContainer.prototype.isEnabled = null;
        viewbuilderImpl.SlideButtonContainer.prototype.hitAreaPoints = null;
        viewbuilderImpl.SlideButtonContainer.prototype.init = function() {
            this.baseButton = _hcmn_.js_Boot.__cast(this.getComponentById(viewbuilderImpl.SlideButtonContainer.BASE_BUTTON_ID), viewbuilderImpl.ButtonComponent);
            this.baseButtonMovieClip = this.baseButton.getMainMovieClip();
            this.baseButtonMovieClip.setMouseEnabled(true);
            this.baseButtonMovieClip.setButtonMode(true);
            this.baseButtonMovieClip.on(displayEngineApi.DisplayObjectEvents.MOUSE_DOWN, $bind(this, this.onDown));
            this.baseButtonMovieClip.on(displayEngineApi.DisplayObjectEvents.TOUCH_START, $bind(this, this.onDown));
            this.baseButtonMovieClip.on(displayEngineApi.DisplayObjectEvents.MOUSE_UP, $bind(this, this.onUp));
            this.baseButtonMovieClip.on(displayEngineApi.DisplayObjectEvents.TOUCH_END, $bind(this, this.onUp));
            if (this.baseButton != null && this.hitAreaPoints != null) this.baseButton.getDisplayObject().setHitArea(this.hitAreaPoints);
            var $it0 = (function($this) {
                var $r;
                var this1 = $this.getChildComponents();
                $r = this1.iterator();
                return $r;
            }(this));
            while ($it0.hasNext()) {
                var comp = $it0.next();
                var mc = comp.getDisplayObject();
                var stateFrameCount;
                try {
                    stateFrameCount = mc.getStateFrameCount(viewbuilderImpl.SlideButtonContainer.LOOP_SUFIX_ID);
                } catch (e) {
                    if (e instanceof js._Boot.HaxeError) e = e.val;
                    if (_hcmn_.js_Boot.__instanceof(e, Error)) {
                        continue;
                    } else throw (e);
                }
                if (stateFrameCount >= 1) {
                    mc.gotoAndPlay(viewbuilderImpl.SlideButtonContainer.LOOP_SUFIX_ID);
                    mc.setLoop(true);
                }
            }
            try {
                Visibility.change($bind(this, this.handleVisibilityChange));
            } catch (e1) {
                if (e1 instanceof js._Boot.HaxeError) e1 = e1.val;
                if (_hcmn_.js_Boot.__instanceof(e1, Error)) {
                    null;
                } else throw (e1);
            }
        };
        viewbuilderImpl.SlideButtonContainer.prototype.handleVisibilityChange = function(e, state) {
            if (this.isPointerDown) this.onUp(null);
        };
        viewbuilderImpl.SlideButtonContainer.prototype.onOver = function(e) {
            this.setState(viewbuilderImpl.SlideButtonContainer.OVER_STATE_NAME);
        };
        viewbuilderImpl.SlideButtonContainer.prototype.setState = function(stateName) {
            var $it0 = (function($this) {
                var $r;
                var this1 = $this.getChildComponents();
                $r = this1.iterator();
                return $r;
            }(this));
            while ($it0.hasNext()) {
                var comp = $it0.next();
                var mc = comp.getDisplayObject();
                var stateFrameCount;
                var stateLabelName = stateName;
                try {
                    stateFrameCount = mc.getStateFrameCount(stateLabelName);
                    if (stateFrameCount <= 0) {
                        stateLabelName = stateName + ":" + viewbuilderImpl.SlideButtonContainer.LOOP_SUFIX_ID;
                        stateFrameCount = mc.getStateFrameCount(stateLabelName);
                        mc.setLoop(true);
                    }
                } catch (e) {
                    if (e instanceof js._Boot.HaxeError) e = e.val;
                    if (_hcmn_.js_Boot.__instanceof(e, Error)) {
                        continue;
                    } else throw (e);
                }
                if (stateFrameCount <= 0) continue;
                if (stateFrameCount == 1) mc.gotoAndStop(stateLabelName);
                else mc.gotoAndPlay(stateLabelName);
            }
        };
        viewbuilderImpl.SlideButtonContainer.prototype.onDown = function(e) {
            if (this.isEnabled) {
                try {
                    this.pointerId = e.data.originalEvent.targetTouches[0].identifier;
                } catch (e1) {
                    if (e1 instanceof js._Boot.HaxeError) e1 = e1.val;
                    if (_hcmn_.js_Boot.__instanceof(e1, Error)) {} else throw (e1);
                }
                this.isPointerDown = true;
                this._events.eventDown.dispatch(e.data.global);
                window.document.body.addEventListener(displayEngineApi.DisplayObjectEvents.MOUSE_UP, $bind(this, this.onUp));
                window.document.body.addEventListener(displayEngineApi.DisplayObjectEvents.TOUCH_END, $bind(this, this.onUp));
                this.baseButtonMovieClip.on(displayEngineApi.DisplayObjectEvents.MOUSE_MOVE, $bind(this, this.onMove));
                this.baseButtonMovieClip.on(displayEngineApi.DisplayObjectEvents.TOUCH_MOVE, $bind(this, this.onMove));
                this.setState(viewbuilderImpl.SlideButtonContainer.DOWN_STATE_NAME);
            }
        };
        viewbuilderImpl.SlideButtonContainer.prototype.onUp = function(e) {
            if (this.isEnabled) {
                try {
                    if (e.changedTouches != null) {
                        if (e.changedTouches[0].identifier != this.pointerId) return;
                    } else if (e.data.originalEvent.changedTouches != null) {
                        if (e.data.originalEvent.changedTouches[0].identifier != this.pointerId) return;
                    }
                } catch (error) {
                    if (error instanceof js._Boot.HaxeError) error = error.val;
                    if (_hcmn_.js_Boot.__instanceof(error, Error)) {} else throw (error);
                }
                this.isPointerDown = false;
                this.pointerId = null;
                this._events.eventUp.dispatch(e);
                window.document.body.removeEventListener(displayEngineApi.DisplayObjectEvents.MOUSE_UP, $bind(this, this.onUp));
                window.document.body.removeEventListener(displayEngineApi.DisplayObjectEvents.TOUCH_END, $bind(this, this.onUp));
                this.baseButtonMovieClip.off(displayEngineApi.DisplayObjectEvents.MOUSE_MOVE, $bind(this, this.onMove));
                this.baseButtonMovieClip.off(displayEngineApi.DisplayObjectEvents.TOUCH_MOVE, $bind(this, this.onMove));
                this.setState(viewbuilderImpl.SlideButtonContainer.DEFAULT_STATE_NAME);
            }
        };
        viewbuilderImpl.SlideButtonContainer.prototype.onMove = function(e) {
            var movedPointerId;
            try {
                movedPointerId = e.data.originalEvent.changedTouches[0].identifier;
                if (movedPointerId != this.pointerId) return;
            } catch (e1) {
                if (e1 instanceof js._Boot.HaxeError) e1 = e1.val;
                if (_hcmn_.js_Boot.__instanceof(e1, Error)) {} else throw (e1);
            }
            if (this.isEnabled && this.isPointerDown) this._events.eventMove.dispatch(e.data.global);
        };
        viewbuilderImpl.SlideButtonContainer.prototype.enable = function() {
            this.isEnabled = true;
            this.baseButtonMovieClip.setMouseEnabled(true);
            this.baseButtonMovieClip.setButtonMode(true);
            this.setState(viewbuilderImpl.SlideButtonContainer.DEFAULT_STATE_NAME);
        };
        viewbuilderImpl.SlideButtonContainer.prototype.disable = function() {
            this.isEnabled = false;
            this.baseButtonMovieClip.setButtonMode(false);
            this.baseButtonMovieClip.setMouseEnabled(false);
            this.setState(viewbuilderImpl.SlideButtonContainer.DISABLED_STATE_NAME);
        };
        viewbuilderImpl.SlideButtonContainer.prototype.setHitArea = function(hitAreaPoints) {
            this.hitAreaPoints = hitAreaPoints;
        };
        viewbuilderImpl.SlideButtonContainer.prototype.getEvents = function() {
            return this._events;
        };
        viewbuilderImpl.SlideButtonContainer.prototype.getBaseButton = function() {
            return this.baseButton;
        };
        viewbuilderImpl.SlideButtonContainer.prototype.__class__ = viewbuilderImpl.SlideButtonContainer;
        viewbuilderImpl.StepperBoxComponent = function(cfg, assets) {
            this.selectedIndex = 0;
            this.valuesArray = [];
            this.VANITY_BAR_BG_ID = "VanityBarBg";
            this.VANITY_BAR_FILL_ID = "VanityBarFill";
            viewbuilderImpl.ViewBuilderContainer.call(this, cfg, assets);
            this._events = new viewbuilderImpl.StepperBoxEvents();
        };
        viewbuilderImpl.StepperBoxComponent = ck_implements(viewbuilderImpl.StepperBoxComponent, viewBuilderApi.IStepperBox);
        viewbuilderImpl.StepperBoxComponent.__interfaces__ = [viewBuilderApi.IStepperBox];
        viewbuilderImpl.StepperBoxComponent.__name__ = ["viewbuilderImpl", "StepperBoxComponent"];
        viewbuilderImpl.StepperBoxComponent.__super__ = viewbuilderImpl.ViewBuilderContainer;
        for (var k in viewbuilderImpl.ViewBuilderContainer.prototype) viewbuilderImpl.StepperBoxComponent.prototype[k] = viewbuilderImpl.ViewBuilderContainer.prototype[k];
        viewbuilderImpl.StepperBoxComponent.prototype.VANITY_BAR_FILL_ID = null;
        viewbuilderImpl.StepperBoxComponent.prototype.VANITY_BAR_BG_ID = null;
        viewbuilderImpl.StepperBoxComponent.prototype._events = null;
        viewbuilderImpl.StepperBoxComponent.prototype.valuesArray = null;
        viewbuilderImpl.StepperBoxComponent.prototype.selectedValue = null;
        viewbuilderImpl.StepperBoxComponent.prototype.selectedIndex = null;
        viewbuilderImpl.StepperBoxComponent.prototype.vanityBarVisible = null;
        viewbuilderImpl.StepperBoxComponent.prototype.valueLabel = null;
        viewbuilderImpl.StepperBoxComponent.prototype.plusButton = null;
        viewbuilderImpl.StepperBoxComponent.prototype.minusButton = null;
        viewbuilderImpl.StepperBoxComponent.prototype.vanityBarMask = null;
        viewbuilderImpl.StepperBoxComponent.prototype.vanityBarFill = null;
        viewbuilderImpl.StepperBoxComponent.prototype.vanityBarBg = null;
        viewbuilderImpl.StepperBoxComponent.prototype.vanityBarWidth = null;
        viewbuilderImpl.StepperBoxComponent.prototype.init = function() {
            this.valueLabel = _hcmn_.js_Boot.__cast(this.getComponentById("StepperValueLabel"), viewBuilderApi.ILabel);
            this.plusButton = _hcmn_.js_Boot.__cast(this.getComponentById("PlusButton"), viewBuilderApi.IButton);
            this.minusButton = _hcmn_.js_Boot.__cast(this.getComponentById("MinusButton"), viewBuilderApi.IButton);
            this.vanityBarMask = viewbuilderImpl.ExternalService.displayProvider.getFactory().createGraphics();
            this.plusButton.enable();
            this.minusButton.enable();
            this.plusButton.getEvents().DOWN().addListener($bind(this, this.plusButtonDown));
            this.minusButton.getEvents().DOWN().addListener($bind(this, this.minusButtonDown));
            var scaleFactor = 1;
            if (this.assets.getConfiguration().scalefactor != null) scaleFactor = _hcmn_.Std.parseFloat(this.assets.getConfiguration().scalefactor);
            this.vanityBarWidth = _hcmn_.Std["int"](this.getComponentById(this.VANITY_BAR_FILL_ID).getDisplayObject().getWidth() * scaleFactor);
            this.vanityBarBg = this.getComponentById(this.VANITY_BAR_BG_ID).getDisplayObject();
            this.vanityBarFill = this.getComponentById(this.VANITY_BAR_FILL_ID).getDisplayObject();
            this.vanityBarFill.setMask(this.vanityBarMask);
            this.setVanityBarVisible(false);
        };
        viewbuilderImpl.StepperBoxComponent.prototype.plusButtonDown = function(e) {
            var oldIndex = this.selectedIndex;
            this.setSelectedIndex(this.selectedIndex + 1);
            if (this.selectedIndex != oldIndex) this._events.selectionSet.dispatch(this.selectedIndex);
        };
        viewbuilderImpl.StepperBoxComponent.prototype.minusButtonDown = function(e) {
            var oldIndex = this.selectedIndex;
            this.setSelectedIndex(this.selectedIndex - 1);
            if (this.selectedIndex != oldIndex) this._events.selectionSet.dispatch(this.selectedIndex);
        };
        viewbuilderImpl.StepperBoxComponent.prototype.getEvents = function() {
            return this._events;
        };
        viewbuilderImpl.StepperBoxComponent.prototype.getSelectedValue = function() {
            return this.selectedValue;
        };
        viewbuilderImpl.StepperBoxComponent.prototype.setSelectedIndex = function(value) {
            if (value < this.valuesArray.length && value >= 0) {
                this.selectedIndex = value;
                this.selectedValue = this.valuesArray[this.selectedIndex];
                this.updateView();
            }
        };
        viewbuilderImpl.StepperBoxComponent.prototype.setSelectedValue = function(value) {
            var selValueIndex = this.checkSelectedValue(value);
            if (selValueIndex > -1) {
                this.selectedValue = value;
                this.selectedIndex = selValueIndex;
                this.updateView();
            }
        };
        viewbuilderImpl.StepperBoxComponent.prototype.setMask = function() {
            if (!this.vanityBarVisible) return;
            var maskWidth = (this.selectedIndex + 1) * (this.vanityBarWidth / this.valuesArray.length) | 0;
            this.vanityBarMask.clear();
            this.vanityBarMask.drawRect(0, 0, maskWidth, 3);
        };
        viewbuilderImpl.StepperBoxComponent.prototype.updateView = function() {
            if (this.selectedValue == null) return;
            this.valueLabel.setText(this.selectedValue);
            this.setMask();
            if (this.valuesArray.length == 1) {
                this.minusButton.disable();
                this.plusButton.disable();
                return;
            }
            if (this.selectedIndex >= this.valuesArray.length - 1) {
                this.minusButton.enable();
                this.plusButton.disable();
            } else if (this.selectedIndex <= 0) {
                this.minusButton.disable();
                this.plusButton.enable();
            } else {
                this.plusButton.enable();
                this.minusButton.enable();
            }
        };
        viewbuilderImpl.StepperBoxComponent.prototype.checkSelectedValue = function(value) {
            var _g1 = 0;
            var _g = this.valuesArray.length;
            while (_g1 < _g) {
                var i = _g1++;
                var comparedValue = this.valuesArray[i];
                if (comparedValue == value) return i;
            }
            return -1;
        };
        viewbuilderImpl.StepperBoxComponent.prototype.setStepperBoxValues = function(newValues, selectedIndex, selectedValue) {
            this.valuesArray = newValues;
            if (this.valuesArray.length == 1) this.hideStepperButtons();
            if (selectedIndex != null) this.setSelectedIndex(selectedIndex);
            if (selectedValue != null) this.setSelectedValue(selectedValue);
        };
        viewbuilderImpl.StepperBoxComponent.prototype.getSelectedIndex = function() {
            return this.selectedIndex;
        };
        viewbuilderImpl.StepperBoxComponent.prototype.enable = function() {
            this.updateView();
        };
        viewbuilderImpl.StepperBoxComponent.prototype.disable = function() {
            this.plusButton.disable();
            this.minusButton.disable();
        };
        viewbuilderImpl.StepperBoxComponent.prototype.hideStepperButtons = function() {
            this.plusButton.hide();
            this.minusButton.hide();
        };
        viewbuilderImpl.StepperBoxComponent.prototype.setVanityBarVisible = function(visible) {
            this.vanityBarVisible = visible;
            this.updateView();
            this.vanityBarFill.setVisible(visible);
            this.vanityBarBg.setVisible(visible);
        };
        viewbuilderImpl.StepperBoxComponent.prototype.__class__ = viewbuilderImpl.StepperBoxComponent;
        viewbuilderImpl.VBAnimationComponent = function(cfg, assetspack, fps) {
            if (fps == null) fps = 30;
            this.playParticles = true;
            this.offScreen = true;
            this.alreadyOffScreened = false;
            this.playNestedAnimationsOnStop = false;
            this.fpsDel = 0;
            this.fps = fps;
            cfg.inVBAnimation = true;
            viewbuilderImpl.ViewBuilderContainer.call(this, cfg, assetspack);
            this.playNestedAnimationsOnStop = viewbuilderImpl.ExternalService.FLASH_LIKE_ANIMATIONS;
            this.componentType = viewbuilderImpl.ComponentTypesEnum.VBANIMATION[0];
            this.animID = assetspack.getConfiguration().spritesheets[0];
            var scaleFactor = 1;
            if (assetspack.getConfiguration().scalefactor != null) {
                scaleFactor = 1 / _hcmn_.Std.parseFloat(assetspack.getConfiguration().scalefactor);
                this.getDisplayObject().setScale(scaleFactor);
            }
            this.playingState = false;
            this.hide();
        };
        viewbuilderImpl.VBAnimationComponent = ck_implements(viewbuilderImpl.VBAnimationComponent, viewBuilderApi.IVBAnimationComponent);
        viewbuilderImpl.VBAnimationComponent.__interfaces__ = [viewBuilderApi.IVBAnimationComponent];
        viewbuilderImpl.VBAnimationComponent.__name__ = ["viewbuilderImpl", "VBAnimationComponent"];
        viewbuilderImpl.VBAnimationComponent.__super__ = viewbuilderImpl.ViewBuilderContainer;
        for (var k in viewbuilderImpl.ViewBuilderContainer.prototype) viewbuilderImpl.VBAnimationComponent.prototype[k] = viewbuilderImpl.ViewBuilderContainer.prototype[k];
        viewbuilderImpl.VBAnimationComponent.prototype.animID = null;
        viewbuilderImpl.VBAnimationComponent.prototype.fps = null;
        viewbuilderImpl.VBAnimationComponent.prototype.fpsDel = null;
        viewbuilderImpl.VBAnimationComponent.prototype.playNestedAnimationsOnStop = null;
        viewbuilderImpl.VBAnimationComponent.prototype.particlesPlaying = null;
        viewbuilderImpl.VBAnimationComponent.prototype.alreadyOffScreened = null;
        viewbuilderImpl.VBAnimationComponent.prototype.offScreen = null;
        viewbuilderImpl.VBAnimationComponent.prototype.offScreenBitmapHolder = null;
        viewbuilderImpl.VBAnimationComponent.prototype.events = null;
        viewbuilderImpl.VBAnimationComponent.prototype.callback = null;
        viewbuilderImpl.VBAnimationComponent.prototype.timingMode = null;
        viewbuilderImpl.VBAnimationComponent.prototype.playParticles = null;
        viewbuilderImpl.VBAnimationComponent.prototype.appendAnimId = function(parentId) {
            if (parentId != null) this.animID = this.animID + "_" + parentId;
        };
        viewbuilderImpl.VBAnimationComponent.prototype.toOffScreen = function(isWebGL) {
            if (isWebGL == null) isWebGL = false;
            this.createOffscreenAnimation(isWebGL);
        };
        viewbuilderImpl.VBAnimationComponent.prototype.createOffscreenAnimation = function(isWebGL) {
            if (isWebGL == null) isWebGL = false;
            if (!this.alreadyOffScreened) {
                var parent = this.getDisplayObject().getParent();
                parent.removeChild(this.getDisplayObject());
                var w = _hcmn_.Math.round(this.getDisplayObject().getWidth());
                var h = _hcmn_.Math.round(this.getDisplayObject().getHeight());
                if (viewbuilderImpl.VBAnimationComponent.offScreenAnims.get(this.animID) == null) {
                    var osStage = viewbuilderImpl.ExternalService.displayProvider.getFactory().createOffscreenStage(w, h, isWebGL, null, this.fps);
                    this.timingMode = osStage.getStage().getTimingMode();
                    this.getDisplayObject().setVisible(false);
                    osStage.getStage().addChild(this.getDisplayObject());
                    viewbuilderImpl.VBAnimationComponent.offScreenAnims.set(this.animID, {
                        stage: osStage,
                        playing: false,
                        vbAnimSrc: this
                    });
                }
                this.offScreenBitmapHolder = viewbuilderImpl.ExternalService.displayProvider.getFactory().createDisplayObjectContainer();
                this.offScreenBitmapHolder.setName("OFFSCREEN_BITMAP_HOLDER");
                var bitmap = viewbuilderImpl.ExternalService.displayProvider.getFactory().createBitmap(viewbuilderImpl.VBAnimationComponent.offScreenAnims.get(this.animID).stage, new displayEngineApi.Rectangle(0, 0, w, h));
                this.offScreenBitmapHolder.addChild(bitmap);
                parent.addChild(this.offScreenBitmapHolder);
                this.offScreenBitmapHolder.setVisible(this.playingState);
                this.alreadyOffScreened = true;
            }
        };
        viewbuilderImpl.VBAnimationComponent.prototype.gotoAndPlay = function(offScreen, frame, callBack, delay) {
            if (frame == null) frame = "0";
            if (offScreen != null) this.offScreen = offScreen;
            this.play(this.offScreen, callBack, delay);
            this.jumpToFrameAndUpdate(frame);
        };
        viewbuilderImpl.VBAnimationComponent.prototype.gotoAndStop = function(offScreen, frame) {
            if (frame == null) frame = "0";
            if (offScreen != null) this.offScreen = offScreen;
            this.jumpToFrameAndUpdate(frame);
            this.stop();
        };
        viewbuilderImpl.VBAnimationComponent.prototype.jumpToFrameAndUpdate = function(frame) {
            var animSrc = this;
            if (this.offScreen && viewbuilderImpl.VBAnimationComponent.offScreenAnims.get(this.animID)) animSrc = viewbuilderImpl.VBAnimationComponent.offScreenAnims.get(this.animID).vbAnimSrc;
            var frmCount;
            if ((function($this) {
                    var $r;
                    var key = frame;
                    $r = $this.frameLabels.get(key);
                    return $r;
                }(this)) == null) frmCount = _hcmn_.Std.parseInt(frame);
            else {
                var key1 = frame;
                frmCount = this.frameLabels.get(key1);
            }
            if (frmCount != null) animSrc.frameCount = frmCount;
            if (animSrc.events != null) {
                var action = null;
                if (animSrc.frameLabelActions != null) action = animSrc.frameLabelActions.h[animSrc.frameCount];
                if (action != null && (function($this) {
                        var $r;
                        var key2 = action.event;
                        $r = animSrc.events.get(key2);
                        return $r;
                    }(this)) != null) {
                    var event;
                    var key3 = action.event;
                    event = animSrc.events.get(key3);
                    event.method(event.args);
                }
            }
            var $it0 = animSrc.childComponents.iterator();
            while ($it0.hasNext()) {
                var comp = $it0.next();
                var cmp;
                cmp = _hcmn_.js_Boot.__cast(comp, viewbuilderImpl.ViewBuilderComponent);
                cmp.frameCount = animSrc.frameCount;
                if (cmp.hasFrames) {
                    var frm = cmp.frames[cmp.frameCount];
                    if (frm == 1) frm = cmp.getLastFullFrameInfo(cmp.frameCount);
                    var dObj = cmp.getDisplayObject();
                    if (frm != null && frm != 0) {
                        dObj.setScaleX(frm[2]);
                        dObj.setScaleY(frm[3]);
                        dObj.setAlpha(frm[4]);
                        dObj.setRotation(frm[5]);
                        dObj.setX(frm[0]);
                        dObj.setY(frm[1]);
                        if (!dObj.getVisible()) dObj.setVisible(true);
                    } else dObj.setVisible(false);
                }
            }
        };
        viewbuilderImpl.VBAnimationComponent.prototype.play = function(offScreen, callBack, delay) {
            if (delay == null) delay = 5;
            if (!this.playingState) {
                if (offScreen != null) this.offScreen = offScreen;
                if (offScreen) this.createOffscreenAnimation();
                if (viewbuilderImpl.VBAnimationComponent.offScreenAnims.get(this.animID) != null) {
                    if (viewbuilderImpl.VBAnimationComponent.offScreenAnims.get(this.animID).playing == false) {
                        viewbuilderImpl.VBAnimationComponent.offScreenAnims.get(this.animID).playing = true;
                        var offStage = viewbuilderImpl.VBAnimationComponent.offScreenAnims.get(this.animID).stage;
                        if (offStage != null) {
                            this.fpsDel = 0;
                            this.playingState = true;
                            var vbAnim = viewbuilderImpl.VBAnimationComponent.offScreenAnims.get(this.animID).vbAnimSrc;
                            vbAnim.playingState = true;
                            offStage.getStage().off(displayEngineApi.DisplayObjectEvents.ENTER_FRAME, $bind(vbAnim, vbAnim.animationUpdateOffScreen));
                            offStage.getStage().on(displayEngineApi.DisplayObjectEvents.ENTER_FRAME, $bind(vbAnim, vbAnim.animationUpdateOffScreen));
                            this.setUpCallBack(callBack, true);
                        }
                    } else this.setUpCallBack(callBack, false);
                } else {
                    this.fpsDel = 0;
                    this.playingState = true;
                    viewbuilderImpl.ExternalService.displayProvider.getDefaultStage().off(displayEngineApi.DisplayObjectEvents.ENTER_FRAME, $bind(this, this.animationUpdateOnScreen));
                    viewbuilderImpl.ExternalService.displayProvider.getDefaultStage().on(displayEngineApi.DisplayObjectEvents.ENTER_FRAME, $bind(this, this.animationUpdateOnScreen));
                    this.setUpCallBack(callBack, false);
                }
                this.show();
            }
        };
        viewbuilderImpl.VBAnimationComponent.prototype.setUpCallBack = function(callBack, waitForOffScreenStage) {
            this.callback = callBack;
            if (waitForOffScreenStage) {
                var offStage = viewbuilderImpl.VBAnimationComponent.offScreenAnims.get(this.animID).stage;
                offStage.getStage().on(displayEngineApi.DisplayObjectEvents.ENTER_FRAME, $bind(this, this.onOffscreenStageFirstFrame));
            } else this.executeCallback();
        };
        viewbuilderImpl.VBAnimationComponent.prototype.onOffscreenStageFirstFrame = function() {
            var offStage = viewbuilderImpl.VBAnimationComponent.offScreenAnims.get(this.animID).stage;
            offStage.getStage().off(displayEngineApi.DisplayObjectEvents.ENTER_FRAME, $bind(this, this.onOffscreenStageFirstFrame));
            viewbuilderImpl.ExternalService.displayProvider.getDefaultStage().on(displayEngineApi.DisplayObjectEvents.ENTER_FRAME, $bind(this, this.executeCallback));
        };
        viewbuilderImpl.VBAnimationComponent.prototype.executeCallback = function() {
            viewbuilderImpl.ExternalService.displayProvider.getDefaultStage().off(displayEngineApi.DisplayObjectEvents.ENTER_FRAME, $bind(this, this.executeCallback));
            if (this.callback != null) this.callback();
        };
        viewbuilderImpl.VBAnimationComponent.prototype.stop = function() {
            if (this.playingState) {
                this.jumpToFrameAndUpdate();
                if (viewbuilderImpl.VBAnimationComponent.offScreenAnims.get(this.animID) != null) {
                    if (viewbuilderImpl.VBAnimationComponent.offScreenAnims.get(this.animID).playing == true) {
                        viewbuilderImpl.VBAnimationComponent.offScreenAnims.get(this.animID).playing = false;
                        var offStage = viewbuilderImpl.VBAnimationComponent.offScreenAnims.get(this.animID).stage;
                        if (offStage != null) {
                            var vbAnim = viewbuilderImpl.VBAnimationComponent.offScreenAnims.get(this.animID).vbAnimSrc;
                            if (!this.playNestedAnimationsOnStop) offStage.getStage().off(displayEngineApi.DisplayObjectEvents.ENTER_FRAME, $bind(vbAnim, vbAnim.animationUpdateOffScreen));
                            vbAnim.playingState = false;
                            this.playingState = false;
                        }
                    }
                } else {
                    this.fpsDel = 0;
                    if (!this.playNestedAnimationsOnStop) viewbuilderImpl.ExternalService.displayProvider.getDefaultStage().off(displayEngineApi.DisplayObjectEvents.ENTER_FRAME, $bind(this, this.animationUpdateOnScreen));
                }
                this.playingState = false;
                var anim;
                if (this.offScreen && viewbuilderImpl.VBAnimationComponent.offScreenAnims.get(this.animID)) anim = viewbuilderImpl.VBAnimationComponent.offScreenAnims.get(this.animID).vbAnimSrc;
                else anim = this;
                this.updateMovieClipAnimation(false, anim);
            }
        };
        viewbuilderImpl.VBAnimationComponent.prototype.updateMovieClipAnimation = function(play, cmp) {
            if (cmp.isContainer()) {
                var cmp1;
                cmp1 = _hcmn_.js_Boot.__cast(cmp, viewbuilderImpl.ViewBuilderContainer);
                var len = cmp1.getDisplayObject().getNumChildren();
                var $it0 = cmp1.childComponents.iterator();
                while ($it0.hasNext()) {
                    var comp = $it0.next();
                    if (comp.componentType != null && comp.componentType == viewbuilderImpl.ComponentTypesEnum.MOVIECLIP[0]) {
                        var mc = comp.getDisplayObject();
                        if (play) mc.play();
                        else mc.gotoAndStop(null, 0);
                    }
                    this.updateMovieClipAnimation(play, comp);
                }
            }
        };
        viewbuilderImpl.VBAnimationComponent.prototype.animationUpdateOffScreen = function() {
            this.animationUpdate(true);
        };
        viewbuilderImpl.VBAnimationComponent.prototype.animationUpdateOnScreen = function() {
            this.animationUpdate(false);
        };
        viewbuilderImpl.VBAnimationComponent.prototype.animationUpdate = function(off) {
            var deltaTime = viewbuilderImpl.ExternalService.displayProvider.getDefaultStage().getDeltaTime();
            if (off == true) {
                var vbAnim = viewbuilderImpl.VBAnimationComponent.offScreenAnims.get(this.animID).vbAnimSrc;
                if (deltaTime > 1000 / this.fps) {
                    if (deltaTime > 4 * (1000 / this.fps)) deltaTime = 4 * (1000 / this.fps);
                    var playCount = _hcmn_.Math.floor(deltaTime / (1000 / this.fps));
                    var _g = 0;
                    while (_g < playCount) {
                        var i = _g++;
                        this.playAnimationContainer(vbAnim, vbAnim, true, i == playCount - 1 ? false : true);
                    }
                } else this.playAnimationContainer(vbAnim, vbAnim, true);
            } else {
                if (this.fpsDel % _hcmn_.Math.floor(60 / this.fps) == 0) {
                    if (deltaTime > 1000 / this.fps) {
                        if (deltaTime > 4 * (1000 / this.fps)) deltaTime = 4 * (1000 / this.fps);
                        var playCount1 = _hcmn_.Math.floor(deltaTime / (1000 / this.fps));
                        playCount1 = _hcmn_.Math.floor(playCount1 * _hcmn_.Math.floor(60 / this.fps));
                        var _g1 = 0;
                        while (_g1 < playCount1) {
                            var i1 = _g1++;
                            this.playAnimationContainer(this, this, true, i1 == playCount1 - 1 ? false : true);
                        }
                    } else this.playAnimationContainer(this, this, true);
                }
                this.fpsDel++;
            }
        };
        viewbuilderImpl.VBAnimationComponent.prototype.playAnimationContainer = function(cmp, parentCmp, playEvents, checkForEventsOnly) {
            if (checkForEventsOnly == null) checkForEventsOnly = false;
            if (playEvents == null) playEvents = false;
            if (this.playParticles && cmp.componentType && cmp.componentType == viewbuilderImpl.ComponentTypesEnum.PARTICLE[0]) this.startParticles(cmp);
            if (cmp.hasFrames) {
                var frm = cmp.frames[cmp.frameCount];
                if (frm != null) {
                    var dObj = cmp.getDisplayObject();
                    if (frm == 0) {
                        if (dObj.getVisible()) dObj.setVisible(false);
                    } else if (frm == 1) {
                        if (!dObj.getVisible()) dObj.setVisible(true);
                    } else {
                        dObj.setScaleX(frm[2]);
                        dObj.setScaleY(frm[3]);
                        dObj.setAlpha(frm[4]);
                        dObj.setRotation(frm[5]);
                        dObj.setX(frm[0]);
                        dObj.setY(frm[1]);
                        if (!dObj.getVisible()) dObj.setVisible(true);
                    }
                }
            }
            if (cmp.isContainer()) {
                var cmp1;
                cmp1 = _hcmn_.js_Boot.__cast(cmp, viewbuilderImpl.ViewBuilderContainer);
                var len = cmp1.getDisplayObject().getNumChildren();
                var c = 0;
                var $it0 = cmp1.childComponents.iterator();
                while ($it0.hasNext()) {
                    var comp = $it0.next();
                    if (cmp1.playingState || this.playNestedAnimationsOnStop) this.playAnimationContainer(comp, cmp1, ++c == len, checkForEventsOnly);
                    if (comp.componentType != null && comp.componentType == viewbuilderImpl.ComponentTypesEnum.MOVIECLIP[0]) {
                        var mc = comp.getDisplayObject();
                        if (cmp1.playingState || this.playNestedAnimationsOnStop) {
                            if (mc.getUserData().init != true) {
                                var newFrame;
                                if (mc.getCurrentFrame() + 1 > mc.getStateFrameCount()) newFrame = 1;
                                else newFrame = mc.getCurrentFrame() + 1;
                                mc.gotoAndStop(null, newFrame);
                                mc.stop();
                            } else mc.getUserData().init = false;
                        } else {}
                    }
                }
            }
            if (cmp.hasFrames) {
                if (playEvents && parentCmp.events != null) {
                    parentCmp.frameCount = cmp.frameCount;
                    var action = null;
                    if (parentCmp.actions != null) action = parentCmp.actions.get(cmp.frameCount);
                    if (action != null && parentCmp.events.get(action.event) != null) {
                        var event = parentCmp.events.get(action.event);
                        event.method(event.args);
                    }
                    action = null;
                    if (parentCmp.frameLabelActions != null) action = parentCmp.frameLabelActions.get(cmp.frameCount);
                    if (action != null && parentCmp.events.get(action.event) != null) {
                        var event1 = parentCmp.events.get(action.event);
                        event1.method(event1.args);
                    }
                }
                if (parentCmp.actions != null && parentCmp.actions.get(cmp.frameCount) != null) cmp.frameCount = this.calcFrameAfterAction(parentCmp, cmp);
                else if (parentCmp.playingState) {
                    cmp.frameCount++;
                    if (cmp.frameCount >= cmp.frames.length) cmp.frameCount = 0;
                }
                if (parentCmp.componentType == viewbuilderImpl.ComponentTypesEnum.VBANIMATION[0]) parentCmp.frameCount = cmp.frameCount;
            }
        };
        viewbuilderImpl.VBAnimationComponent.prototype.addEventListener = function(id, listener, args) {
            if (this.events == null) this.events = new _hcmn_.haxe_ds_StringMap();
            this.events.set(id, {
                method: listener,
                args: args
            });
        };
        viewbuilderImpl.VBAnimationComponent.prototype.removeEventListener = function(id) {
            if (this.events != null) {
                if (this.events.get(id) != null) this.events.remove(id);
            }
        };
        viewbuilderImpl.VBAnimationComponent.prototype.startParticles = function(particleAnimComponent) {
            if (this.particlesPlaying == null) this.particlesPlaying = new _hcmn_.haxe_ds_StringMap();
            if (this.particlesPlaying.get(this.animID) == null) {
                var stage;
                if (viewbuilderImpl.VBAnimationComponent.offScreenAnims.get(this.animID) != null && viewbuilderImpl.VBAnimationComponent.offScreenAnims.get(this.animID).stage != null) stage = viewbuilderImpl.VBAnimationComponent.offScreenAnims.get(this.animID).stage.getStage();
                else stage = viewbuilderImpl.ExternalService.displayProvider.getDefaultStage();
                particleAnimComponent.getAnimation().start();
                particleAnimComponent.getParticleSystem().start(stage);
                particleAnimComponent.getDisplayObject().setVisible(true);
                this.particlesPlaying.set(this.animID, particleAnimComponent);
            }
        };
        viewbuilderImpl.VBAnimationComponent.prototype.calcFrameAfterAction = function(parentCmp, cmp) {
            var frame = cmp.frameCount;
            var action = parentCmp.actions.get(frame);
            var actionStr = action.command.toLowerCase();
            if (actionStr.indexOf("play") != -1) {
                parentCmp.playingState = true;
                if (action.frame != null) return action.frame;
                else return frame + 1;
            }
            if (actionStr.indexOf("stop") != -1) {
                parentCmp.playingState = false;
                if (action.frame != null) return action.frame;
                else return frame;
            }
            if (parentCmp.playingState && actionStr == "dispatchevent") {
                frame++;
                if (frame >= cmp.frames.length) frame = 0;
            }
            return frame;
        };
        viewbuilderImpl.VBAnimationComponent.prototype.dispose = function() {
            if (viewbuilderImpl.VBAnimationComponent.offScreenAnims.get(this.animID) != null) {
                var offStage = viewbuilderImpl.VBAnimationComponent.offScreenAnims.get(this.animID).stage;
                if (offStage != null) {
                    offStage.getStage().off(displayEngineApi.DisplayObjectEvents.ENTER_FRAME, $bind(this, this.animationUpdateOffScreen));
                    offStage.getStage().offAll();
                    offStage.getStage().removeAllChildren();
                    if (offStage != null && $bind(offStage, offStage.dispose) != null) offStage.dispose();
                    offStage = null;
                }
                viewbuilderImpl.VBAnimationComponent.offScreenAnims.get(this.animID).vbAnimSrc = null;
                viewbuilderImpl.VBAnimationComponent.offScreenAnims.get(this.animID).playing = false;
                viewbuilderImpl.VBAnimationComponent.offScreenAnims.set(this.animID, null);
                viewbuilderImpl.VBAnimationComponent.offScreenAnims.remove(this.animID);
                this.alreadyOffScreened = false;
                if (this.offScreenBitmapHolder != null && ($_ = this.offScreenBitmapHolder, $bind($_, $_.dispose)) != null) this.offScreenBitmapHolder.dispose();
                this.offScreenBitmapHolder = null;
            }
            viewbuilderImpl.ExternalService.displayProvider.getDefaultStage().off(displayEngineApi.DisplayObjectEvents.ENTER_FRAME, $bind(this, this.animationUpdateOnScreen));
            viewbuilderImpl.ExternalService.displayProvider.getDefaultStage().off(displayEngineApi.DisplayObjectEvents.ENTER_FRAME, $bind(this, this.animationUpdateOffScreen));
            if (this.playingState) this.stop();
            if (this.offScreenBitmapHolder != null) {
                if (($_ = this.offScreenBitmapHolder, $bind($_, $_.dispose)) != null) this.offScreenBitmapHolder.dispose();
                this.offScreenBitmapHolder = null;
            }
            this.playingState = false;
            viewbuilderImpl.ViewBuilderContainer.prototype.dispose.call(this);
        };
        viewbuilderImpl.VBAnimationComponent.prototype.show = function() {
            if (this.offScreenBitmapHolder != null) {
                this.offScreenBitmapHolder.setVisible(true);
                this.showOffScreen();
            } else viewbuilderImpl.ViewBuilderContainer.prototype.show.call(this);
        };
        viewbuilderImpl.VBAnimationComponent.prototype.showOffScreen = function() {
            if (viewbuilderImpl.VBAnimationComponent.offScreenAnims.get(this.animID) != null) {
                var offScreen = viewbuilderImpl.VBAnimationComponent.offScreenAnims.get(this.animID);
                if (offScreen.vbAnimSrc != null) offScreen.vbAnimSrc.getDisplayObject().setVisible(true);
            }
        };
        viewbuilderImpl.VBAnimationComponent.prototype.hide = function() {
            if (this.offScreenBitmapHolder != null) this.offScreenBitmapHolder.setVisible(false);
            else viewbuilderImpl.ViewBuilderContainer.prototype.hide.call(this);
        };
        viewbuilderImpl.VBAnimationComponent.prototype.hideOffScreen = function() {
            if (viewbuilderImpl.VBAnimationComponent.offScreenAnims.get(this.animID) != null) {
                var offScreen = viewbuilderImpl.VBAnimationComponent.offScreenAnims.get(this.animID);
                if (offScreen.vbAnimSrc != null) offScreen.vbAnimSrc.getDisplayObject().setVisible(false);
            }
        };
        viewbuilderImpl.VBAnimationComponent.prototype.isPlaying = function() {
            return this.playingState;
        };
        viewbuilderImpl.VBAnimationComponent.prototype.isOffscreen = function() {
            return this.offScreen;
        };
        viewbuilderImpl.VBAnimationComponent.prototype.getOffScreenBitmap = function() {
            if (this.offScreenBitmapHolder != null) return this.offScreenBitmapHolder;
            else return viewbuilderImpl.ViewBuilderContainer.prototype.getDisplayObject.call(this);
        };
        viewbuilderImpl.VBAnimationComponent.prototype.__class__ = viewbuilderImpl.VBAnimationComponent;
        viewbuilderImpl.AnimationFactory = function() {};
        viewbuilderImpl.AnimationFactory = ck_implements(viewbuilderImpl.AnimationFactory, viewBuilderApi.IComponentFactory);
        viewbuilderImpl.AnimationFactory.__interfaces__ = [viewBuilderApi.IComponentFactory];
        viewbuilderImpl.AnimationFactory.__name__ = ["viewbuilderImpl", "AnimationFactory"];
        viewbuilderImpl.AnimationFactory.prototype.create = function(cfg, assetspack, multilanguageAssets) {
            var libName;
            if (cfg.ln != null) libName = cfg.ln;
            else libName = cfg.libraryName;
            if (libName == null) throw new Error("MovieClip config must have property \"libraryName\" or \"ln\"!");
            var scaleFactor = 1;
            if (assetspack.getConfiguration().scalefactor != null) scaleFactor = 1 / _hcmn_.Std.parseFloat(assetspack.getConfiguration().scalefactor);
            var defState;
            if (cfg.ds != null) defState = cfg.ds;
            else defState = cfg.defaultState;
            if (defState == null) defState = "enabled";
            var ssId;
            if (cfg.spritesheet == null) ssId = assetspack.getConfiguration().spritesheets[0];
            else ssId = cfg.spritesheet;
            var mcDef = new displayEngineApi.MCDef();
            mcDef.name = libName;
            var this1 = assetspack.getSpritesheetJSONs();
            mcDef.animeDef = this1.get(ssId);
            var this2 = assetspack.getSpritesheetImages();
            mcDef.animationBitmap = this2.get(ssId);
            mcDef.animDefState = defState;
            if (multilanguageAssets != null) {
                var _g1 = 0;
                var _g = multilanguageAssets.length;
                while (_g1 < _g) {
                    var i = _g1++;
                    var assetJson = multilanguageAssets[i].get("json");
                    var translatedElem = assetJson[ssId + "-" + libName];
                    if (translatedElem != null) {
                        mcDef.name = ssId + "-" + libName;
                        mcDef.animeDef = multilanguageAssets[i].get("json");
                        mcDef.animationBitmap = multilanguageAssets[i].get("img");
                        mcDef.animDefState = defState;
                        break;
                    }
                }
            }
            var btnMovieClip = viewbuilderImpl.ExternalService.displayProvider.getFactory().createMovieClip(mcDef);
            btnMovieClip.setScale(scaleFactor);
            btnMovieClip.setLoop(true);
            btnMovieClip.getUserData().init = true;
            var animation = new viewbuilderImpl.AnimationComponent(btnMovieClip);
            animation.extractCommonProperties(cfg);
            return animation;
        };
        viewbuilderImpl.AnimationFactory.prototype.__class__ = viewbuilderImpl.AnimationFactory;
        viewbuilderImpl.ButtonContainerFactory = function() {};
        viewbuilderImpl.ButtonContainerFactory = ck_implements(viewbuilderImpl.ButtonContainerFactory, viewBuilderApi.IComponentFactory);
        viewbuilderImpl.ButtonContainerFactory.__interfaces__ = [viewBuilderApi.IComponentFactory];
        viewbuilderImpl.ButtonContainerFactory.__name__ = ["viewbuilderImpl", "ButtonContainerFactory"];
        viewbuilderImpl.ButtonContainerFactory.prototype.create = function(cfg, assetspack, multilanguageAssets) {
            var buttonContainer = new viewbuilderImpl.ButtonContainer(cfg, assetspack);
            var scaleFactor = 1;
            if (assetspack.getConfiguration().scalefactor != null) scaleFactor = _hcmn_.Std.parseFloat(assetspack.getConfiguration().scalefactor);
            buttonContainer.setHitArea(this.extraxtHitArea(cfg, scaleFactor));
            buttonContainer.init();
            return buttonContainer;
        };
        viewbuilderImpl.ButtonContainerFactory.prototype.extraxtHitArea = function(cfg, scaleFactor) {
            if (scaleFactor == null) scaleFactor = 1;
            var i = 0;
            while (cfg.components[i]) {
                if (cfg.components[i].id == "hitArea") {
                    var hitAreaData = cfg.components[i];
                    var allData = hitAreaData.shapeDef;
                    var poligonPoints = [];
                    var _g1 = 0;
                    var _g = allData.length;
                    while (_g1 < _g) {
                        var j = _g1++;
                        poligonPoints.push(allData[j][0][0] * scaleFactor - hitAreaData.x * scaleFactor);
                        poligonPoints.push(allData[j][0][1] * scaleFactor - hitAreaData.y * scaleFactor);
                    }
                    return poligonPoints;
                }
                i++;
            }
            return null;
        };
        viewbuilderImpl.ButtonContainerFactory.prototype.__class__ = viewbuilderImpl.ButtonContainerFactory;
        viewbuilderImpl.ButtonFactory = function() {};
        viewbuilderImpl.ButtonFactory = ck_implements(viewbuilderImpl.ButtonFactory, viewBuilderApi.IComponentFactory);
        viewbuilderImpl.ButtonFactory.__interfaces__ = [viewBuilderApi.IComponentFactory];
        viewbuilderImpl.ButtonFactory.__name__ = ["viewbuilderImpl", "ButtonFactory"];
        viewbuilderImpl.ButtonFactory.prototype.create = function(cfg, assetspack, multilanguageAssets) {
            var libName;
            if (cfg.ln != null) libName = cfg.ln;
            else libName = cfg.libraryName;
            if (libName == null) throw new Error("Button config must have property \"libraryName\" or \"ln\"!");
            var scaleFactor = 1;
            if (assetspack.getConfiguration().scalefactor != null) scaleFactor = 1 / _hcmn_.Std.parseFloat(assetspack.getConfiguration().scalefactor);
            var defState;
            if (cfg.ds != null) defState = cfg.ds;
            else defState = cfg.defaultState;
            if (defState == null) defState = "enabled";
            var ssId;
            if (cfg.spritesheet == null) ssId = assetspack.getConfiguration().spritesheets[0];
            else ssId = cfg.spritesheet;
            var mcDef = new displayEngineApi.MCDef();
            mcDef.name = libName;
            var this1 = assetspack.getSpritesheetJSONs();
            mcDef.animeDef = this1.get(ssId);
            var this2 = assetspack.getSpritesheetImages();
            mcDef.animationBitmap = this2.get(ssId);
            mcDef.animDefState = "enabled";
            if (multilanguageAssets != null) {
                var _g1 = 0;
                var _g = multilanguageAssets.length;
                while (_g1 < _g) {
                    var i = _g1++;
                    var assetJson = multilanguageAssets[i].get("json");
                    var translatedElem = assetJson[ssId + "-" + libName];
                    if (translatedElem != null) {
                        mcDef.name = ssId + "-" + libName;
                        mcDef.animeDef = multilanguageAssets[i].get("json");
                        mcDef.animationBitmap = multilanguageAssets[i].get("img");
                        mcDef.animDefState = defState;
                        break;
                    }
                }
            }
            var btnMovieClip = viewbuilderImpl.ExternalService.displayProvider.getFactory().createMovieClip(mcDef);
            btnMovieClip.setScale(scaleFactor);
            var btn = new viewbuilderImpl.ButtonComponent(btnMovieClip);
            if (cfg.enabled || cfg.enabled == null) btn.enable();
            else btn.disable();
            btn.extractCommonProperties(cfg);
            btn.init();
            return btn;
        };
        viewbuilderImpl.ButtonFactory.prototype.__class__ = viewbuilderImpl.ButtonFactory;
        viewbuilderImpl.CardDeckFactory = function() {};
        viewbuilderImpl.CardDeckFactory = ck_implements(viewbuilderImpl.CardDeckFactory, viewBuilderApi.IComponentFactory);
        viewbuilderImpl.CardDeckFactory.__interfaces__ = [viewBuilderApi.IComponentFactory];
        viewbuilderImpl.CardDeckFactory.__name__ = ["viewbuilderImpl", "CardDeckFactory"];
        viewbuilderImpl.CardDeckFactory.prototype.create = function(cfg, assetspack, multilanguageAssets) {
            var cardDeck = new viewbuilderImpl.CardDeckComponent(cfg, assetspack);
            cardDeck.init();
            return cardDeck;
        };
        viewbuilderImpl.CardDeckFactory.prototype.__class__ = viewbuilderImpl.CardDeckFactory;
        viewbuilderImpl.ComboBoxFactory = function() {};
        viewbuilderImpl.ComboBoxFactory = ck_implements(viewbuilderImpl.ComboBoxFactory, viewBuilderApi.IComponentFactory);
        viewbuilderImpl.ComboBoxFactory.__interfaces__ = [viewBuilderApi.IComponentFactory];
        viewbuilderImpl.ComboBoxFactory.__name__ = ["viewbuilderImpl", "ComboBoxFactory"];
        viewbuilderImpl.ComboBoxFactory.prototype.create = function(cfg, assetspack, multilanguageAssets) {
            var combobox = new viewbuilderImpl.ComboBoxComponent(cfg, assetspack);
            combobox.init();
            return combobox;
        };
        viewbuilderImpl.ComboBoxFactory.prototype.__class__ = viewbuilderImpl.ComboBoxFactory;
        viewbuilderImpl.ImageFactory = function() {};
        viewbuilderImpl.ImageFactory = ck_implements(viewbuilderImpl.ImageFactory, viewBuilderApi.IComponentFactory);
        viewbuilderImpl.ImageFactory.__interfaces__ = [viewBuilderApi.IComponentFactory];
        viewbuilderImpl.ImageFactory.__name__ = ["viewbuilderImpl", "ImageFactory"];
        viewbuilderImpl.ImageFactory.prototype.create = function(cfg, assetspack, multilanguageAssets) {
            var scaleFactor = 1;
            if (assetspack.getConfiguration().scalefactor != null) scaleFactor = 1 / _hcmn_.Std.parseFloat(assetspack.getConfiguration().scalefactor);
            var ssId;
            if (cfg.spritesheet == null) ssId = assetspack.getConfiguration().spritesheets[0];
            else ssId = cfg.spritesheet;
            var ssheet;
            var this1 = assetspack.getSpritesheetJSONs();
            ssheet = this1.get(ssId);
            var image;
            var this2 = assetspack.getSpritesheetImages();
            image = this2.get(ssId);
            var libName;
            if (cfg.ln != null) libName = cfg.ln;
            else libName = cfg.libraryName;
            var elem = ssheet[libName].frames[0].rect;
            if (multilanguageAssets != null) {
                var _g1 = 0;
                var _g = multilanguageAssets.length;
                while (_g1 < _g) {
                    var i = _g1++;
                    var assetJson = multilanguageAssets[i].get("json");
                    var translatedElem = assetJson[ssId + "-" + libName];
                    if (translatedElem != null) {
                        elem = translatedElem.frames[0].rect;
                        image = multilanguageAssets[i].get("img");
                        break;
                    }
                }
            }
            var rect = new displayEngineApi.Rectangle(_hcmn_.Std.parseFloat(elem.x), _hcmn_.Std.parseFloat(elem.y), _hcmn_.Std.parseFloat(elem.w), _hcmn_.Std.parseFloat(elem.h));
            var bmp = viewbuilderImpl.ExternalService.displayProvider.getFactory().createBitmap(image, rect);
            bmp.setScale(scaleFactor);
            var image1 = new viewbuilderImpl.ImageComponent(bmp);
            image1.extractCommonProperties(cfg);
            return image1;
        };
        viewbuilderImpl.ImageFactory.prototype.__class__ = viewbuilderImpl.ImageFactory;
        viewbuilderImpl.LabelFactory = function() {};
        viewbuilderImpl.LabelFactory = ck_implements(viewbuilderImpl.LabelFactory, viewBuilderApi.IComponentFactory);
        viewbuilderImpl.LabelFactory.__interfaces__ = [viewBuilderApi.IComponentFactory];
        viewbuilderImpl.LabelFactory.__name__ = ["viewbuilderImpl", "LabelFactory"];
        viewbuilderImpl.LabelFactory.prototype.create = function(cfg, assetspack, multilanguageAssets) {
            if (cfg.style == null) {
                cfg.style = {};
                cfg.text = "";
                if (cfg.txt != null) {
                    cfg.text = cfg.txt[0];
                    cfg.style.fontFamily = cfg.txt[1];
                    cfg.style.fontColor = cfg.txt[2];
                    cfg.style.width = cfg.txt[3];
                }
            }
            if (!cfg.inVBAnimation) {
                if (cfg.w != null) cfg.style.width = cfg.w;
                if (cfg.h != null) cfg.style.height = cfg.h;
            }
            var label = new viewbuilderImpl.LabelComponent(cfg.id, cfg.text, cfg.style);
            label.extractCommonProperties(cfg);
            if (cfg.inVBAnimation) {
                if (assetspack.getConfiguration().scalefactor != null) {
                    var scaleFactor = _hcmn_.Std.parseFloat(assetspack.getConfiguration().scalefactor);
                    if (cfg.x != null && cfg.y != null) {
                        cfg.x = cfg.x * scaleFactor;
                        cfg.y = cfg.y * scaleFactor;
                    }
                    label.getDisplayObject().setScale(scaleFactor);
                }
            }
            var bnds = new displayEngineApi.Rectangle(0, 0, 0, 0);
            label.getDisplayObject().setHitArea([0, 0, 0, 0]);
            return label;
        };
        viewbuilderImpl.LabelFactory.prototype.__class__ = viewbuilderImpl.LabelFactory;
        viewbuilderImpl.ParticleAnimationFactory = function() {};
        viewbuilderImpl.ParticleAnimationFactory = ck_implements(viewbuilderImpl.ParticleAnimationFactory, viewBuilderApi.IComponentFactory);
        viewbuilderImpl.ParticleAnimationFactory.__interfaces__ = [viewBuilderApi.IComponentFactory];
        viewbuilderImpl.ParticleAnimationFactory.__name__ = ["viewbuilderImpl", "ParticleAnimationFactory"];
        viewbuilderImpl.ParticleAnimationFactory.prototype.create = function(cfg, assetspack, multilanguageAssets) {
            var id = cfg.id;
            var ssId;
            if (cfg.spritesheet == null) ssId = assetspack.getConfiguration().spritesheets[0];
            else ssId = cfg.spritesheet;
            var len = _hcmn_.Lambda.count(_hcmn_.js_Boot.__cast(cfg.components, Array));
            var particleBitmaps = [];
            var _g = 0;
            while (_g < len) {
                var k = _g++;
                var subCfg = cfg.components[k];
                var ssheet;
                var this1 = assetspack.getSpritesheetJSONs();
                ssheet = this1.get(ssId);
                var image;
                var this2 = assetspack.getSpritesheetImages();
                image = this2.get(ssId);
                var libName;
                if (subCfg.ln != null) libName = subCfg.ln;
                else libName = subCfg.libraryName;
                var elem = ssheet[libName].frames[0].rect;
                var rect = new displayEngineApi.Rectangle(_hcmn_.Std.parseFloat(elem.x), _hcmn_.Std.parseFloat(elem.y), _hcmn_.Std.parseFloat(elem.w), _hcmn_.Std.parseFloat(elem.h));
                particleBitmaps.push(viewbuilderImpl.ExternalService.displayProvider.getFactory().createBitmap(image, rect));
            }
            var particlesJSON;
            var this3 = assetspack.getParticlesJSONs();
            particlesJSON = this3.get(id);
            var particlesAnimJSON;
            var this4 = assetspack.getParticlesAnimationJSONs();
            particlesAnimJSON = this4.get(id);
            var particleSystem = viewbuilderImpl.ExternalService.displayProvider.getFactory().createParticleSystem(particleBitmaps, "", particlesJSON);
            var animation = viewbuilderImpl.ExternalService.displayProvider.getFactory().createAnimation(id, particleSystem, particlesAnimJSON);
            var particleAnimationComponent = new viewbuilderImpl.ParticleAnimationComponent(particleSystem, animation, id, particlesJSON.fps);
            if (cfg.x != null && cfg.y != null) particleSystem.setPos(cfg.x, cfg.y);
            particleAnimationComponent.extractCommonProperties(cfg);
            return particleAnimationComponent;
        };
        viewbuilderImpl.ParticleAnimationFactory.prototype.__class__ = viewbuilderImpl.ParticleAnimationFactory;
        viewbuilderImpl.ShapeFactory = function() {
            this.RADIAL_GRADIENT = "RADIAL";
            this.LINEAR_GRADIENT = "LINEAR";
        };
        viewbuilderImpl.ShapeFactory = ck_implements(viewbuilderImpl.ShapeFactory, viewBuilderApi.IComponentFactory);
        viewbuilderImpl.ShapeFactory.__interfaces__ = [viewBuilderApi.IComponentFactory];
        viewbuilderImpl.ShapeFactory.__name__ = ["viewbuilderImpl", "ShapeFactory"];
        viewbuilderImpl.ShapeFactory.prototype.LINEAR_GRADIENT = null;
        viewbuilderImpl.ShapeFactory.prototype.RADIAL_GRADIENT = null;
        viewbuilderImpl.ShapeFactory.prototype.create = function(cfg, assetspack, multilanguageAssets) {
            if (cfg.id == "hitArea") return null;
            var shapeComponent = new viewbuilderImpl.ViewBuilderComponent(this.createShape(cfg));
            if (cfg.mask) shapeComponent.maskID = cfg.mask;
            if (cfg.m) shapeComponent.maskID = cfg.m;
            if (assetspack.getConfiguration().scalefactor != null && cfg.inVBAnimation == true) {
                var scaleFactor = _hcmn_.Std.parseFloat(assetspack.getConfiguration().scalefactor);
                shapeComponent.getDisplayObject().setScale(scaleFactor);
            }
            return shapeComponent;
        };
        viewbuilderImpl.ShapeFactory.prototype.toIntColor = function(hexStr) {
            return _hcmn_.Std.parseInt("0x" + hexStr.substring(1, 7));
        };
        viewbuilderImpl.ShapeFactory.prototype.toFloatAlpha = function(hexStr) {
            if (hexStr == null) return null;
            if (hexStr.length > "#000000".length) {
                var alphaVal = _hcmn_.Std.parseInt("0x" + hexStr.substring(7, 9)) / 255;
                alphaVal *= _hcmn_.Math.pow(10, 2);
                return _hcmn_.Math.round(alphaVal) / _hcmn_.Math.pow(10, 2);
            } else return null;
        };
        viewbuilderImpl.ShapeFactory.prototype.createShape = function(cfg) {
            var isMask = cfg.mask != null || cfg.m != null;
            var shape = viewbuilderImpl.ExternalService.displayProvider.getFactory().createGraphics(true);
            shape.setVisible(!isMask);
            shape.moveTo(0, 0);
            var shapeColor = 0;
            var strokeWeight = 0;
            var strokeColor = 0;
            var gradientTexture = null;
            if (cfg.shapeFill != null) {
                if (cfg.shapeFill.stroke != null) {
                    strokeWeight = cfg.shapeFill.stroke.weight;
                    strokeColor = this.toIntColor(cfg.shapeFill.stroke.color);
                }
                if (cfg.shapeFill.gradient != null) {
                    if (cfg.shapeFill.gradient.type == this.LINEAR_GRADIENT) gradientTexture = this.createGradient(cfg.w, cfg.h, cfg.shapeFill.gradient.type, cfg.shapeFill.gradient.rotation, cfg.shapeFill.gradient.stops);
                    else if (cfg.shapeFill.gradient.type == this.RADIAL_GRADIENT) {} else {}
                } else shapeColor = this.toIntColor(cfg.shapeFill.color);
            }
            var shapeFillAlpha = 1.0;
            if (cfg.alpha != null) {
                shapeFillAlpha = _hcmn_.Std.parseFloat(cfg.alpha);
                if (isNaN(shapeFillAlpha)) shapeFillAlpha = 1.0;
            }
            var shapeFillAlphaFromRGBA;
            shapeFillAlphaFromRGBA = this.toFloatAlpha(cfg.shapeFill.color);
            if (shapeFillAlphaFromRGBA != null) shapeFillAlpha = shapeFillAlphaFromRGBA;
            shape.beginFill(shapeColor, shapeFillAlpha);
            if (strokeWeight != 0 || strokeColor != 0) shape.lineStyle(strokeWeight, strokeColor);
            var shapePoints = cfg.shapeDef;
            var simpleShape = true;
            if (simpleShape) {
                shape.moveTo(shapePoints[0][0][0], shapePoints[0][0][1]);
                var _g1 = 1;
                var _g = shapePoints.length;
                while (_g1 < _g) {
                    var i = _g1++;
                    var points = shapePoints[i];
                    shape.lineTo(points[0][0], points[0][1]);
                }
            } else {
                shape.moveTo(shapePoints[0][0][0], shapePoints[0][0][1]);
                var _g11 = 1;
                var _g2 = shapePoints.length;
                while (_g11 < _g2) {
                    var i1 = _g11++;
                    var points1 = shapePoints[i1];
                    var _g3 = 0;
                    var _g21 = points1.length;
                    while (_g3 < _g21) {
                        var j = _g3++;
                        shape.quadraticCurveTo(points1[1][0], points1[1][1], points1[2][0], points1[2][1]);
                    }
                }
            }
            if (gradientTexture != null) {
                gradientTexture.setPos(shape.getX(), shape.getY());
                gradientTexture.setMask(shape);
                return gradientTexture;
            }
            return shape;
        };
        viewbuilderImpl.ShapeFactory.prototype.createGradient = function(width, height, type, rotation, gradientColorStops) {
            var offCanvas;
            var _this = window.document;
            offCanvas = _this.createElement("canvas");
            offCanvas.width = width | 0;
            offCanvas.height = height | 0;
            if (width == null) offCanvas.style.width = "null";
            else offCanvas.style.width = "" + width;
            if (height == null) offCanvas.style.height = "null";
            else offCanvas.style.height = "" + height;
            var ctx = offCanvas.getContext("2d", null);
            var gradient = null;
            if (type == this.LINEAR_GRADIENT) {
                if (rotation == 90) gradient = ctx.createLinearGradient(0, 0, 0, height);
                else gradient = ctx.createLinearGradient(0, 0, width, 0);
                if (gradient != null) {
                    var i = 0;
                    while (i < gradientColorStops.length) {
                        gradient.addColorStop(gradientColorStops[i].pos, gradientColorStops[i].color);
                        i++;
                    }
                }
            } else if (type == this.RADIAL_GRADIENT) {}
            ctx.fillStyle = gradient;
            ctx.fillRect(0, 0, width, height);
            var shapeBitmap = viewbuilderImpl.ExternalService.displayProvider.getFactory().createBitmap(offCanvas);
            return shapeBitmap;
        };
        viewbuilderImpl.ShapeFactory.prototype.__class__ = viewbuilderImpl.ShapeFactory;
        viewbuilderImpl.SlideButtonFactory = function() {};
        viewbuilderImpl.SlideButtonFactory = ck_implements(viewbuilderImpl.SlideButtonFactory, viewBuilderApi.IComponentFactory);
        viewbuilderImpl.SlideButtonFactory.__interfaces__ = [viewBuilderApi.IComponentFactory];
        viewbuilderImpl.SlideButtonFactory.__name__ = ["viewbuilderImpl", "SlideButtonFactory"];
        viewbuilderImpl.SlideButtonFactory.prototype.create = function(cfg, assetspack, multilanguageAssets) {
            var slideButtonContainer = new viewbuilderImpl.SlideButtonContainer(cfg, assetspack);
            var scaleFactor = 1;
            if (assetspack.getConfiguration().scalefactor != null) scaleFactor = _hcmn_.Std.parseFloat(assetspack.getConfiguration().scalefactor);
            slideButtonContainer.setHitArea(this.extraxtHitArea(cfg, scaleFactor));
            slideButtonContainer.init();
            return slideButtonContainer;
        };
        viewbuilderImpl.SlideButtonFactory.prototype.extraxtHitArea = function(cfg, scaleFactor) {
            if (scaleFactor == null) scaleFactor = 1;
            var i = 0;
            while (cfg.components[i]) {
                if (cfg.components[i].id == "hitArea") {
                    var hitAreaData = cfg.components[i];
                    var allData = hitAreaData.shapeDef;
                    var poligonPoints = [];
                    var _g1 = 0;
                    var _g = allData.length;
                    while (_g1 < _g) {
                        var j = _g1++;
                        poligonPoints.push(allData[j][0][0] * scaleFactor - hitAreaData.x * scaleFactor);
                        poligonPoints.push(allData[j][0][1] * scaleFactor - hitAreaData.y * scaleFactor);
                    }
                    return poligonPoints;
                }
                i++;
            }
            return null;
        };
        viewbuilderImpl.SlideButtonFactory.prototype.__class__ = viewbuilderImpl.SlideButtonFactory;
        viewbuilderImpl.StepperBoxFactory = function() {};
        viewbuilderImpl.StepperBoxFactory = ck_implements(viewbuilderImpl.StepperBoxFactory, viewBuilderApi.IComponentFactory);
        viewbuilderImpl.StepperBoxFactory.__interfaces__ = [viewBuilderApi.IComponentFactory];
        viewbuilderImpl.StepperBoxFactory.__name__ = ["viewbuilderImpl", "StepperBoxFactory"];
        viewbuilderImpl.StepperBoxFactory.prototype.create = function(cfg, assetspack, multilanguageAssets) {
            var stepperbox = new viewbuilderImpl.StepperBoxComponent(cfg, assetspack);
            stepperbox.init();
            return stepperbox;
        };
        viewbuilderImpl.StepperBoxFactory.prototype.__class__ = viewbuilderImpl.StepperBoxFactory;
        viewbuilderImpl.VBAnimationFactory = function() {};
        viewbuilderImpl.VBAnimationFactory = ck_implements(viewbuilderImpl.VBAnimationFactory, viewBuilderApi.IComponentFactory);
        viewbuilderImpl.VBAnimationFactory.__interfaces__ = [viewBuilderApi.IComponentFactory];
        viewbuilderImpl.VBAnimationFactory.__name__ = ["viewbuilderImpl", "VBAnimationFactory"];
        viewbuilderImpl.VBAnimationFactory.prototype.create = function(cfg, assetspack, multilanguageAssets) {
            var id = cfg.id;
            var fps = cfg.fps;
            var vbAnimationContainer = new viewbuilderImpl.VBAnimationComponent(cfg, assetspack, fps);
            vbAnimationContainer.init();
            return vbAnimationContainer;
        };
        viewbuilderImpl.VBAnimationFactory.prototype.__class__ = viewbuilderImpl.VBAnimationFactory;
        viewbuilderImpl.ComponentTypesEnum = {
            __ename__: ["viewbuilderImpl", "ComponentTypesEnum"],
            __constructs__: ["CONTAINER", "BUTTON", "BUTTONCONTAINER", "SLIDEBUTTON", "COMBOBOX", "STEPPERBOX", "LABEL", "CARDDECK", "BITMAP", "MOVIECLIP", "DRAGONBONES", "SHAPE", "PARTICLE", "VBANIMATION"]
        };
        viewbuilderImpl.ComponentTypesEnum.DRAGONBONES = ["DRAGONBONES", 10];
        viewbuilderImpl.ComponentTypesEnum.DRAGONBONES.toString = $estr;
        viewbuilderImpl.ComponentTypesEnum.DRAGONBONES.__enum__ = viewbuilderImpl.ComponentTypesEnum;
        viewbuilderImpl.ComponentTypesEnum.BITMAP = ["BITMAP", 8];
        viewbuilderImpl.ComponentTypesEnum.BITMAP.toString = $estr;
        viewbuilderImpl.ComponentTypesEnum.BITMAP.__enum__ = viewbuilderImpl.ComponentTypesEnum;
        viewbuilderImpl.ComponentTypesEnum.MOVIECLIP = ["MOVIECLIP", 9];
        viewbuilderImpl.ComponentTypesEnum.MOVIECLIP.toString = $estr;
        viewbuilderImpl.ComponentTypesEnum.MOVIECLIP.__enum__ = viewbuilderImpl.ComponentTypesEnum;
        viewbuilderImpl.ComponentTypesEnum.PARTICLE = ["PARTICLE", 12];
        viewbuilderImpl.ComponentTypesEnum.PARTICLE.toString = $estr;
        viewbuilderImpl.ComponentTypesEnum.PARTICLE.__enum__ = viewbuilderImpl.ComponentTypesEnum;
        viewbuilderImpl.ComponentTypesEnum.VBANIMATION = ["VBANIMATION", 13];
        viewbuilderImpl.ComponentTypesEnum.VBANIMATION.toString = $estr;
        viewbuilderImpl.ComponentTypesEnum.VBANIMATION.__enum__ = viewbuilderImpl.ComponentTypesEnum;
        viewbuilderImpl.ComponentTypesEnum.BUTTON = ["BUTTON", 1];
        viewbuilderImpl.ComponentTypesEnum.BUTTON.toString = $estr;
        viewbuilderImpl.ComponentTypesEnum.BUTTON.__enum__ = viewbuilderImpl.ComponentTypesEnum;
        viewbuilderImpl.ComponentTypesEnum.COMBOBOX = ["COMBOBOX", 4];
        viewbuilderImpl.ComponentTypesEnum.COMBOBOX.toString = $estr;
        viewbuilderImpl.ComponentTypesEnum.COMBOBOX.__enum__ = viewbuilderImpl.ComponentTypesEnum;
        viewbuilderImpl.ComponentTypesEnum.BUTTONCONTAINER = ["BUTTONCONTAINER", 2];
        viewbuilderImpl.ComponentTypesEnum.BUTTONCONTAINER.toString = $estr;
        viewbuilderImpl.ComponentTypesEnum.BUTTONCONTAINER.__enum__ = viewbuilderImpl.ComponentTypesEnum;
        viewbuilderImpl.ComponentTypesEnum.SHAPE = ["SHAPE", 11];
        viewbuilderImpl.ComponentTypesEnum.SHAPE.toString = $estr;
        viewbuilderImpl.ComponentTypesEnum.SHAPE.__enum__ = viewbuilderImpl.ComponentTypesEnum;
        viewbuilderImpl.ComponentTypesEnum.LABEL = ["LABEL", 6];
        viewbuilderImpl.ComponentTypesEnum.LABEL.toString = $estr;
        viewbuilderImpl.ComponentTypesEnum.LABEL.__enum__ = viewbuilderImpl.ComponentTypesEnum;
        viewbuilderImpl.ComponentTypesEnum.CONTAINER = ["CONTAINER", 0];
        viewbuilderImpl.ComponentTypesEnum.CONTAINER.toString = $estr;
        viewbuilderImpl.ComponentTypesEnum.CONTAINER.__enum__ = viewbuilderImpl.ComponentTypesEnum;
        viewbuilderImpl.ComponentTypesEnum.SLIDEBUTTON = ["SLIDEBUTTON", 3];
        viewbuilderImpl.ComponentTypesEnum.SLIDEBUTTON.toString = $estr;
        viewbuilderImpl.ComponentTypesEnum.SLIDEBUTTON.__enum__ = viewbuilderImpl.ComponentTypesEnum;
        viewbuilderImpl.ComponentTypesEnum.CARDDECK = ["CARDDECK", 7];
        viewbuilderImpl.ComponentTypesEnum.CARDDECK.toString = $estr;
        viewbuilderImpl.ComponentTypesEnum.CARDDECK.__enum__ = viewbuilderImpl.ComponentTypesEnum;
        viewbuilderImpl.ComponentTypesEnum.STEPPERBOX = ["STEPPERBOX", 5];
        viewbuilderImpl.ComponentTypesEnum.STEPPERBOX.toString = $estr;
        viewbuilderImpl.ComponentTypesEnum.STEPPERBOX.__enum__ = viewbuilderImpl.ComponentTypesEnum;
        viewbuilderImpl.ButtonEvents = function() {
            this.eventDown = new viewbuilderImpl.ViewBuilderEvent();
            this.eventOver = new viewbuilderImpl.ViewBuilderEvent();
            this.eventUp = new viewbuilderImpl.ViewBuilderEvent();
            this.eventOut = new viewbuilderImpl.ViewBuilderEvent();
        };
        viewbuilderImpl.ButtonEvents = ck_implements(viewbuilderImpl.ButtonEvents, viewBuilderApi.IButtonEvents);
        viewbuilderImpl.ButtonEvents.__interfaces__ = [viewBuilderApi.IButtonEvents];
        viewbuilderImpl.ButtonEvents.__name__ = ["viewbuilderImpl", "ButtonEvents"];
        viewbuilderImpl.ButtonEvents.prototype.eventDown = null;
        viewbuilderImpl.ButtonEvents.prototype.eventOver = null;
        viewbuilderImpl.ButtonEvents.prototype.eventUp = null;
        viewbuilderImpl.ButtonEvents.prototype.eventOut = null;
        viewbuilderImpl.ButtonEvents.prototype.DOWN = function() {
            return this.eventDown;
        };
        viewbuilderImpl.ButtonEvents.prototype.OVER = function() {
            return this.eventOver;
        };
        viewbuilderImpl.ButtonEvents.prototype.UP = function() {
            return this.eventUp;
        };
        viewbuilderImpl.ButtonEvents.prototype.OUT = function() {
            return this.eventOut;
        };
        viewbuilderImpl.ButtonEvents.prototype.__class__ = viewbuilderImpl.ButtonEvents;
        viewbuilderImpl.ComboBoxEvents = function() {
            this.selectionSet = new viewbuilderImpl.ViewBuilderEvent();
        };
        viewbuilderImpl.ComboBoxEvents = ck_implements(viewbuilderImpl.ComboBoxEvents, viewBuilderApi.IComboBoxEvents);
        viewbuilderImpl.ComboBoxEvents.__interfaces__ = [viewBuilderApi.IComboBoxEvents];
        viewbuilderImpl.ComboBoxEvents.__name__ = ["viewbuilderImpl", "ComboBoxEvents"];
        viewbuilderImpl.ComboBoxEvents.prototype.selectionSet = null;
        viewbuilderImpl.ComboBoxEvents.prototype.SELECTION_SET = function() {
            return this.selectionSet;
        };
        viewbuilderImpl.ComboBoxEvents.prototype.__class__ = viewbuilderImpl.ComboBoxEvents;
        viewbuilderImpl.SlideButtonEvents = function() {
            this.eventDown = new viewbuilderImpl.ViewBuilderEvent();
            this.eventOver = new viewbuilderImpl.ViewBuilderEvent();
            this.eventUp = new viewbuilderImpl.ViewBuilderEvent();
            this.eventMove = new viewbuilderImpl.ViewBuilderEvent();
            this.eventOut = new viewbuilderImpl.ViewBuilderEvent();
        };
        viewbuilderImpl.SlideButtonEvents = ck_implements(viewbuilderImpl.SlideButtonEvents, viewBuilderApi.ISlideButtonEvents);
        viewbuilderImpl.SlideButtonEvents.__interfaces__ = [viewBuilderApi.ISlideButtonEvents];
        viewbuilderImpl.SlideButtonEvents.__name__ = ["viewbuilderImpl", "SlideButtonEvents"];
        viewbuilderImpl.SlideButtonEvents.prototype.eventDown = null;
        viewbuilderImpl.SlideButtonEvents.prototype.eventOver = null;
        viewbuilderImpl.SlideButtonEvents.prototype.eventUp = null;
        viewbuilderImpl.SlideButtonEvents.prototype.eventMove = null;
        viewbuilderImpl.SlideButtonEvents.prototype.eventOut = null;
        viewbuilderImpl.SlideButtonEvents.prototype.DOWN = function() {
            return this.eventDown;
        };
        viewbuilderImpl.SlideButtonEvents.prototype.OVER = function() {
            return this.eventOver;
        };
        viewbuilderImpl.SlideButtonEvents.prototype.UP = function() {
            return this.eventUp;
        };
        viewbuilderImpl.SlideButtonEvents.prototype.MOVE = function() {
            return this.eventMove;
        };
        viewbuilderImpl.SlideButtonEvents.prototype.OUT = function() {
            return this.eventOut;
        };
        viewbuilderImpl.SlideButtonEvents.prototype.__class__ = viewbuilderImpl.SlideButtonEvents;
        viewbuilderImpl.StepperBoxEvents = function() {
            this.selectionSet = new viewbuilderImpl.ViewBuilderEvent();
        };
        viewbuilderImpl.StepperBoxEvents = ck_implements(viewbuilderImpl.StepperBoxEvents, viewBuilderApi.IStepperBoxEvents);
        viewbuilderImpl.StepperBoxEvents.__interfaces__ = [viewBuilderApi.IStepperBoxEvents];
        viewbuilderImpl.StepperBoxEvents.__name__ = ["viewbuilderImpl", "StepperBoxEvents"];
        viewbuilderImpl.StepperBoxEvents.prototype.selectionSet = null;
        viewbuilderImpl.StepperBoxEvents.prototype.SELECTION_SET = function() {
            return this.selectionSet;
        };
        viewbuilderImpl.StepperBoxEvents.prototype.__class__ = viewbuilderImpl.StepperBoxEvents;
        viewbuilderImpl.ViewBuilderEvent = function() {
            this._signal = new _hcmn_.msignal_Signal1();
        };
        viewbuilderImpl.ViewBuilderEvent = ck_implements(viewbuilderImpl.ViewBuilderEvent, viewBuilderApi.IViewBuilderEvent);
        viewbuilderImpl.ViewBuilderEvent.__interfaces__ = [viewBuilderApi.IViewBuilderEvent];
        viewbuilderImpl.ViewBuilderEvent.__name__ = ["viewbuilderImpl", "ViewBuilderEvent"];
        viewbuilderImpl.ViewBuilderEvent.prototype._signal = null;
        viewbuilderImpl.ViewBuilderEvent.prototype.addListener = function(listener) {
            this._signal.add(listener);
        };
        viewbuilderImpl.ViewBuilderEvent.prototype.removeListener = function(listener) {
            this._signal.remove(listener);
        };
        viewbuilderImpl.ViewBuilderEvent.prototype.dispatch = function(data) {
            this._signal.dispatch(data);
        };
        viewbuilderImpl.ViewBuilderEvent.prototype.__class__ = viewbuilderImpl.ViewBuilderEvent;
        viewbuilderImpl.ExternalService.FLASH_LIKE_ANIMATIONS = false;;
        viewbuilderImpl.ViewBuilderFactory.instance = null;;
        viewbuilderImpl.ButtonComponent.OVER_STATE_NAME = "over";;
        viewbuilderImpl.ButtonComponent.DOWN_STATE_NAME = "down";;
        viewbuilderImpl.ButtonComponent.DEFAULT_STATE_NAME = "enabled";;
        viewbuilderImpl.ButtonComponent.DISABLED_STATE_NAME = "disabled";;
        viewbuilderImpl.ButtonContainer.BASE_BUTTON_ID = "btn";;
        viewbuilderImpl.ButtonContainer.LOOP_SUFIX_ID = "loop";;
        viewbuilderImpl.ButtonContainer.OVER_STATE_NAME = "over";;
        viewbuilderImpl.ButtonContainer.DOWN_STATE_NAME = "down";;
        viewbuilderImpl.ButtonContainer.DEFAULT_STATE_NAME = "enabled";;
        viewbuilderImpl.ButtonContainer.DISABLED_STATE_NAME = "disabled";;
        viewbuilderImpl.ComboBoxComponent.VANITY_BAR_FILL_ID = "VanityBarFill";;
        viewbuilderImpl.ComboBoxComponent.VANITY_BAR_BG_ID = "VanityBarBg";;
        viewbuilderImpl.LabelComponent.__meta__ = {
            obj: {
                globnative: null
            }
        };;
        viewbuilderImpl.LabelComponent.groups = new _hcmn_.haxe_ds_StringMap();;
        viewbuilderImpl.LabelComponent.allLabels = [];;
        viewbuilderImpl.LabelComponent.SHADOW_SUFFIX = "_shadow";;
        viewbuilderImpl.ParticleAnimationComponent.offScreenStages = new _hcmn_.haxe_ds_StringMap();;
        viewbuilderImpl.SlideButtonContainer.BASE_BUTTON_ID = "btn";;
        viewbuilderImpl.SlideButtonContainer.LOOP_SUFIX_ID = "loop";;
        viewbuilderImpl.SlideButtonContainer.OVER_STATE_NAME = "over";;
        viewbuilderImpl.SlideButtonContainer.DOWN_STATE_NAME = "down";;
        viewbuilderImpl.SlideButtonContainer.DEFAULT_STATE_NAME = "enabled";;
        viewbuilderImpl.SlideButtonContainer.DISABLED_STATE_NAME = "disabled";;
        viewbuilderImpl.StepperBoxComponent.VALUE_LABEL_ID = "StepperValueLabel";;
        viewbuilderImpl.StepperBoxComponent.PLUS_LABEL_ID = "PlusButton";;
        viewbuilderImpl.StepperBoxComponent.MINUS_LABEL_ID = "MinusButton";;
        viewbuilderImpl.VBAnimationComponent.offScreenAnims = new _hcmn_.haxe_ds_StringMap();;
        return {
            exports: viewbuilderImpl,
            activator: viewbuilderImpl.Activator
        };
    });