define("scarabFxManager", ["viewBuilderApi", "componentmodelComponentApi", "translationmanagerApi", "clientkernelLoaderApi", "displayEngineApi", "scarabFxManagerApi", "gameLayoutApi", "PIXI", "BABYLON", "clientkernelEventbusApi", "clientkernelModulesApi"],
    function(viewBuilderApi, componentmodelComponentApi, translationmanagerApi, clientkernelLoaderApi, displayEngineApi, scarabFxManagerApi, gameLayoutApi, 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 scarabFxManager == 'undefined') {
            var scarabFxManager = {};
        };
        scarabFxManager.Activator = function(context) {};
        scarabFxManager.Activator = ck_implements(scarabFxManager.Activator, clientkernelModulesApi.IModuleActivator);
        scarabFxManager.Activator.__interfaces__ = [clientkernelModulesApi.IModuleActivator];
        scarabFxManager.Activator.__name__ = ["scarabFxManager", "Activator"];
        scarabFxManager.Activator.prototype.start = function(context) {
            context.getServiceTracker([clientkernelLoaderApi.IAssetRegistry, viewBuilderApi.IViewBuilderFactory, displayEngineApi.IDisplayProvider]).then(function(context1) {
                scarabFxManager.ExternalService.initialize(context1);
                var vbf = context1.getAnyService(viewBuilderApi.IViewBuilderFactory, null);
                scarabFxManager.ExternalService.bus = context1.getAnyService(clientkernelEventbusApi.IEventBus, null);
                scarabFxManager.ExternalService.viewBuilderFactory = vbf;
                context1.registerService(new scarabFxManager.FxManagerFactory(vbf, context1), scarabFxManagerApi.FxManagerDeclaration, null);
            });
        };
        scarabFxManager.Activator.prototype.stop = function(context) {};
        scarabFxManager.Activator.main = function() {};
        scarabFxManager.Activator.prototype.__class__ = scarabFxManager.Activator;
        scarabFxManager.ExternalService = function() {};
        scarabFxManager.ExternalService.__name__ = ["scarabFxManager", "ExternalService"];
        scarabFxManager.ExternalService.assetRegistry = null;
        scarabFxManager.ExternalService.vbf = null;
        scarabFxManager.ExternalService.displayProvider = null;
        scarabFxManager.ExternalService.translationManager = null;
        scarabFxManager.ExternalService.bus = null;
        scarabFxManager.ExternalService.viewBuilderFactory = null;
        scarabFxManager.ExternalService.assets = null;
        scarabFxManager.ExternalService.initialize = function(context) {
            haxe.Log.trace("[FXMANAGER] initialize() ", {
                fileName: "ExternalService.hx",
                lineNumber: 26,
                className: "game.fxmanager.ExternalService",
                methodName: "initialize"
            });
            scarabFxManager.ExternalService.assetRegistry = context.getAnyService(clientkernelLoaderApi.IAssetRegistry, null);
            scarabFxManager.ExternalService.vbf = context.getAnyService(viewBuilderApi.IViewBuilderFactory, null);
            scarabFxManager.ExternalService.displayProvider = context.getAnyService(displayEngineApi.IDisplayProvider, null);
        };
        scarabFxManager.ExternalService.prototype.__class__ = scarabFxManager.ExternalService;
        scarabFxManager.FxManager = function(context, vbf) {
            this.assetsLoaded = false;
            this.initialized = false;
            this.layoutPayload = null;
            this.vba = null;
            this.cfgId = "fx_manager_definition_config";
            this.vbAssetID = "fx_manager_layout";
            haxe.Log.trace("[FXMANAGER] loadConfigData() ", {
                fileName: "FxManager.hx",
                lineNumber: 45,
                className: "game.fxmanager.FxManager",
                methodName: "new"
            });
            this.vbf = vbf;
            this.context = context;
            this.components = new haxe.ds.EnumValueMap();
            this.baseEvents = new scarabFxManager.BaseEvents();
            this.port = context.getImplementedPort(scarabFxManagerApi.IFxManagerImplementationPort);
            this.layoutPort = context.getUsedPort(gameLayoutApi.IGameLayoutPort);
            this.layoutPort.getUpdateComponentLayout().subscribe($bind(this, this.updateLayout));
            this.loadConfigData();
        };
        scarabFxManager.FxManager.__name__ = ["scarabFxManager", "FxManager"];
        scarabFxManager.FxManager.prototype.vbAssetID = null;
        scarabFxManager.FxManager.prototype.cfgId = null;
        scarabFxManager.FxManager.prototype.view = null;
        scarabFxManager.FxManager.prototype.context = null;
        scarabFxManager.FxManager.prototype.vba = null;
        scarabFxManager.FxManager.prototype.vbf = null;
        scarabFxManager.FxManager.prototype.controller = null;
        scarabFxManager.FxManager.prototype.layoutPayload = null;
        scarabFxManager.FxManager.prototype.initialized = null;
        scarabFxManager.FxManager.prototype.assetsLoaded = null;
        scarabFxManager.FxManager.prototype.port = null;
        scarabFxManager.FxManager.prototype.layoutPort = null;
        scarabFxManager.FxManager.prototype.cfg = null;
        scarabFxManager.FxManager.prototype.vbView = null;
        scarabFxManager.FxManager.prototype.components = null;
        scarabFxManager.FxManager.prototype.baseEvents = null;
        scarabFxManager.FxManager.prototype.loadConfigData = function() {
            var _g = this;
            scarabFxManager.ExternalService.assetRegistry.getAsset(this.cfgId).getContent().then(function(data) {
                haxe.Log.trace("[FXMANAGER] loadConfigData() ", {
                    fileName: "FxManager.hx",
                    lineNumber: 84,
                    className: "game.fxmanager.FxManager",
                    methodName: "loadConfigData",
                    customParams: [_g.cfg]
                });
                _g.cfg = data;
                _g.loadVBAssets();
            });
        };
        scarabFxManager.FxManager.prototype.loadVBAssets = function() {
            var _g = this;
            haxe.Log.trace("[FXMANAGER] loadVBAssets() " + _hcmn_.Std.string(this.cfg.vbAssets), {
                fileName: "FxManager.hx",
                lineNumber: 93,
                className: "game.fxmanager.FxManager",
                methodName: "loadVBAssets"
            });
            scarabFxManager.ExternalService.assetRegistry.getAssetsContent(this.cfg.vbAssets).then(function(data) {
                scarabFxManager.ExternalService.assets = data;
                _g.loadMainAssets();
            });
        };
        scarabFxManager.FxManager.prototype.loadMainAssets = function() {
            var _g = this;
            haxe.Log.trace("[FXMANAGER] loadMainAssets()", {
                fileName: "FxManager.hx",
                lineNumber: 103,
                className: "game.fxmanager.FxManager",
                methodName: "loadMainAssets"
            });
            scarabFxManager.ExternalService.assetRegistry.getAsset(this.vbAssetID).getContent().then(function(vba) {
                _g.vba = vba;
                _g.assetsLoaded = true;
                _g.initialize();
            });
        };
        scarabFxManager.FxManager.prototype.updateLayout = function(e) {
            haxe.Log.trace("[FXMANAGER] updateLayout() ", {
                fileName: "FxManager.hx",
                lineNumber: 114,
                className: "game.fxmanager.FxManager",
                methodName: "updateLayout"
            });
            this.layoutPayload = e.getPayload();
            if (!this.initialized) this.initialize();
            else {
                this.controller.updateLayout(this.layoutPayload);
                this.layoutPort.getComponentLayoutUpdated().publish(this.context.getInstance());
            }
        };
        scarabFxManager.FxManager.prototype.initialize = function() {
            haxe.Log.trace("[FXMANAGER] initialize() " + _hcmn_.Std.string(this.initialized) + _hcmn_.Std.string(this.layoutPayload), {
                fileName: "FxManager.hx",
                lineNumber: 129,
                className: "game.fxmanager.FxManager",
                methodName: "initialize"
            });
            if (!this.initialized && this.vba != null && this.layoutPayload != null) {
                this.controller = new scarabFxManager.FxManagerController(this);
                this.view = this.vbf.createView(this.vba);
                this.registerAllComponents();
                this.controller.updateLayout(this.layoutPayload);
                this.layoutPort.getComponentLayoutUpdated().publish(this.context.getInstance());
                this.port.getHide().subscribe($bind(this, this.handleHide));
                this.port.getShow().subscribe($bind(this, this.handleShow));
                this.initialized = true;
            }
        };
        scarabFxManager.FxManager.prototype.registerAllComponents = function() {
            haxe.Log.trace("[FXMANAGER] registerAllComponents()", {
                fileName: "FxManager.hx",
                lineNumber: 148,
                className: "game.fxmanager.FxManager",
                methodName: "registerAllComponents"
            });
            var $it0 = (function($this) {
                var $r;
                var this1 = $this.view.getChildComponents();
                $r = this1.keys();
                return $r;
            }(this));
            while ($it0.hasNext()) {
                var compId = $it0.next();
                haxe.Log.trace("[FXMANAGER] registerAllComponents() " + compId, {
                    fileName: "FxManager.hx",
                    lineNumber: 151,
                    className: "game.fxmanager.FxManager",
                    methodName: "registerAllComponents"
                });
                var constructorIndex;
                var _this = _hcmn_.Type.getEnumConstructs(scarabFxManagerApi.FxManagerTypeEnum);
                constructorIndex = _hcmn_.HxOverrides.indexOf(_this, compId, 0);
                if (constructorIndex < 0) continue;
                var componentEnum = _hcmn_.Type.createEnum(scarabFxManagerApi.FxManagerTypeEnum, compId, null);
                this.registerComponent(componentEnum);
            }
        };
        scarabFxManager.FxManager.prototype.registerComponent = function(componentEnum) {
            haxe.Log.trace("[FXMANAGER] registerComponent", {
                fileName: "FxManager.hx",
                lineNumber: 162,
                className: "game.fxmanager.FxManager",
                methodName: "registerComponent",
                customParams: [componentEnum]
            });
            switch (componentEnum[1]) {
                case 0:
                    this.registerContainerComponent(scarabFxManagerApi.FxManagerTypeEnum.fx_basic, scarabFxManager.FxBasic);
                    break;
                case 1:
                    this.registerContainerComponent(scarabFxManagerApi.FxManagerTypeEnum.fx_back, scarabFxManager.FxBasic);
                    break;
            }
            return true;
        };
        scarabFxManager.FxManager.prototype.registerContainerComponent = function(componentEnum, componentClass) {
            haxe.Log.trace("[FXMANAGER] registerContainerComponent", {
                fileName: "FxManager.hx",
                lineNumber: 178,
                className: "game.fxmanager.FxManager",
                methodName: "registerContainerComponent"
            });
            var container = this.view.getContainerById(componentEnum[0]);
            if (container == null) return;
            var value = _hcmn_.Type.createInstance(componentClass, [container, this.cfg]);
            this.components.set(componentEnum, value);
        };
        scarabFxManager.FxManager.prototype.handleHide = function(e) {
            haxe.Log.trace("[FXMANAGER] hide", {
                fileName: "FxManager.hx",
                lineNumber: 187,
                className: "game.fxmanager.FxManager",
                methodName: "handleHide"
            });
        };
        scarabFxManager.FxManager.prototype.handleShow = function(e) {
            haxe.Log.trace("[FXMANAGER] hide", {
                fileName: "FxManager.hx",
                lineNumber: 193,
                className: "game.fxmanager.FxManager",
                methodName: "handleShow"
            });
            var fxType = e.getPayload().fxType;
            this.components.get(fxType).show(e.getPayload().id, e.getPayload().position);
        };
        scarabFxManager.FxManager.prototype.__class__ = scarabFxManager.FxManager;
        scarabFxManager.FxManagerController = function(fxManager) {
            this.flag_addedToStage = false;
            this.fxManager = fxManager;
        };
        scarabFxManager.FxManagerController.__name__ = ["scarabFxManager", "FxManagerController"];
        scarabFxManager.FxManagerController.prototype.flag_addedToStage = null;
        scarabFxManager.FxManagerController.prototype.fxManager = null;
        scarabFxManager.FxManagerController.prototype.updateLayout = function(layoutPayload) {
            haxe.Log.trace("[FXMANAGER] updateLayout() ", {
                fileName: "FxManagerController.hx",
                lineNumber: 26,
                className: "game.fxmanager.FxManagerController",
                methodName: "updateLayout"
            });
            var $it0 = layoutPayload.containers.keys();
            while ($it0.hasNext()) {
                var layerId = $it0.next();
                var layerPayload = layoutPayload.containers.get(layerId);
                var cfg = layerPayload.configuration;
                var stage;
                var this1 = scarabFxManager.ExternalService.displayProvider.getStages();
                stage = this1.get(layerPayload.stage);
                var container;
                container = (function($this) {
                    var $r;
                    var this2 = $this.fxManager.view.getChildComponents();
                    $r = this2.get(layerId);
                    return $r;
                }(this));
                var containerDO = container.getDisplayObject();
                if (!this.flag_addedToStage) stage.addChild(containerDO);
                containerDO.setX(layerPayload.left);
                containerDO.setY(layerPayload.top);
                containerDO.setScaleX(layerPayload.width / containerDO.getUserData().viewBuilderW);
                containerDO.setScaleY(layerPayload.height / containerDO.getUserData().viewBuilderH);
                containerDO.setZIndex(layerPayload.zIndex);
                if (cfg != null)((function($this) {
                    var $r;
                    var key = _hcmn_.Type.createEnum(scarabFxManagerApi.FxManagerTypeEnum, layerId, null);
                    $r = $this.fxManager.components.get(key);
                    return $r;
                }(this))).onLayoutUpdate(cfg);
            }
            if (!this.flag_addedToStage) this.flag_addedToStage = true;
        };
        scarabFxManager.FxManagerController.prototype.onGameLayoutUpdateCompleted = function(e) {};
        scarabFxManager.FxManagerController.prototype.gameLayoutUpdateStarted = function(e) {};
        scarabFxManager.FxManagerController.prototype.__class__ = scarabFxManager.FxManagerController;
        scarabFxManager.FxManagerFactory = function(vbf, context) {
            this.context = context;
            this.vbf = vbf;
        };
        scarabFxManager.FxManagerFactory = ck_implements(scarabFxManager.FxManagerFactory, clientkernelModulesApi.IService);
        scarabFxManager.FxManagerFactory = ck_implements(scarabFxManager.FxManagerFactory, componentmodelComponentApi.IComponentFactory);
        scarabFxManager.FxManagerFactory.__interfaces__ = [clientkernelModulesApi.IService, componentmodelComponentApi.IComponentFactory];
        scarabFxManager.FxManagerFactory.__name__ = ["scarabFxManager", "FxManagerFactory"];
        scarabFxManager.FxManagerFactory.prototype.context = null;
        scarabFxManager.FxManagerFactory.prototype.vbf = null;
        scarabFxManager.FxManagerFactory.prototype.getComponentDeclaration = function() {
            return scarabFxManagerApi.FxManagerDeclaration;
        };
        scarabFxManager.FxManagerFactory.prototype.createComponent = function(context) {
            new scarabFxManager.FxManager(context, this.vbf);
        };
        scarabFxManager.FxManagerFactory.prototype.__class__ = scarabFxManager.FxManagerFactory;

        scarabFxManager.IFx = function() {}
        scarabFxManager.IFx.prototype = {

            show: function(id, position) {
                return {
                    arguments: ["string", "*"],
                    returns: "void"
                };
            },
            hide: function() {
                return {
                    arguments: [],
                    returns: "void"
                };
            },
            onLayoutUpdate: function(layoutConfig) {
                return {
                    arguments: ["*"],
                    returns: "void"
                };
            }
        };
        scarabFxManager.FxBasic = function(container, config) {
            this.counter = 0;
            haxe.Log.trace("[FXMANAGER] [FXBASIC] ", {
                fileName: "FxBasic.hx",
                lineNumber: 20,
                className: "game.fxmanager.components.FxBasic",
                methodName: "new"
            });
            this.config = config;
            this.container = container;
            var animAssets = scarabFxManager.ExternalService.assets.get("fx_manager_animations");
            this.vbView = scarabFxManager.ExternalService.viewBuilderFactory.createView(animAssets);
            this.offsets = new _hcmn_.haxe_ds_StringMap();
            container.show();
        };
        scarabFxManager.FxBasic = ck_implements(scarabFxManager.FxBasic, scarabFxManager.IFx);
        scarabFxManager.FxBasic.__interfaces__ = [scarabFxManager.IFx];
        scarabFxManager.FxBasic.__name__ = ["scarabFxManager", "FxBasic"];
        scarabFxManager.FxBasic.prototype.container = null;
        scarabFxManager.FxBasic.prototype.config = null;
        scarabFxManager.FxBasic.prototype.vbView = null;
        scarabFxManager.FxBasic.prototype.counter = null;
        scarabFxManager.FxBasic.prototype.offsets = null;
        scarabFxManager.FxBasic.prototype.show = function(id, position) {
            haxe.Log.trace("[FXMANAGER] [FXBASIC] [SHOW] " + id, {
                fileName: "FxBasic.hx",
                lineNumber: 31,
                className: "game.fxmanager.components.FxBasic",
                methodName: "show",
                customParams: [position, this.counter]
            });
            var vbAnim = this.vbView.createContainerFromStoredConfig(id);
            var childId = id + this.counter;
            var vbAnimContent = vbAnim.getVBAnimationById("ANIMATION_CONTENT");
            vbAnim.show();
            var offset = new displayEngineApi.Point(0, 0);
            if (this.offsets.exists(id)) {
                offset.x = this.offsets.get(id).x;
                offset.y = this.offsets.get(id).y;
            }
            vbAnim.setX(position.x + offset.x | 0);
            vbAnim.setY(position.y + offset.y | 0);
            this.container.addChildComponent(vbAnim, childId);
            vbAnimContent.addEventListener("evtComplete", $bind(this, this.handleComplete), [childId]);
            this.counter++;
            vbAnimContent.gotoAndPlay(false, "intro");
        };
        scarabFxManager.FxBasic.prototype.dispose = function(childId) {
            this.container.disposeChildComponent(childId);
        };
        scarabFxManager.FxBasic.prototype.handleComplete = function(evt) {
            var _g = this;
            var childId = evt[0];
            var vbAnimHolder = this.container.getContainerById(childId);
            var vbAnimContent = vbAnimHolder.getVBAnimationById("ANIMATION_CONTENT");
            vbAnimContent.stop();
            _hcmn_.haxe_Timer.delay(function() {
                _g.dispose(childId);
            }, 100);
        };
        scarabFxManager.FxBasic.prototype.onLayoutUpdate = function(layoutConfig) {
            if (layoutConfig != null) {
                var _g = 0;
                var _g1 = _hcmn_.Reflect.fields(layoutConfig);
                while (_g < _g1.length) {
                    var element = _g1[_g];
                    ++_g;
                    var point = _hcmn_.Reflect.field(layoutConfig, element);
                    var v = new displayEngineApi.Point(point[0], point[1]);
                    this.offsets.set(element, v);
                    v;
                }
            }
        };
        scarabFxManager.FxBasic.prototype.hide = function() {};
        scarabFxManager.FxBasic.prototype.__class__ = scarabFxManager.FxBasic;
        scarabFxManager.BaseEvents = function() {
            this.choice = new _hcmn_.msignal_Signal1();
        };
        scarabFxManager.BaseEvents.__name__ = ["scarabFxManager", "BaseEvents"];
        scarabFxManager.BaseEvents.prototype.choice = null;
        scarabFxManager.BaseEvents.prototype.__class__ = scarabFxManager.BaseEvents;
        if (typeof haxe == 'undefined') {
            var haxe = {};
        };

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

            get: function(k) {
                return {
                    arguments: ["*"],
                    returns: "null"
                };
            },
            keys: function() {
                return {
                    arguments: [],
                    returns: "null"
                };
            }
        };
        haxe.Log = function() {};
        haxe.Log.__name__ = ["haxe", "Log"];
        haxe.Log.trace = function(v, infos) {
            _hcmn_.js_Boot.__trace(v, infos);
        };
        haxe.Log.prototype.__class__ = haxe.Log;
        if (!haxe.ds) {
            haxe.ds = {};
        };
        haxe.ds.BalancedTree = function() {};
        haxe.ds.BalancedTree.__name__ = ["haxe", "ds", "BalancedTree"];
        haxe.ds.BalancedTree.prototype.root = null;
        haxe.ds.BalancedTree.prototype.set = function(key, value) {
            this.root = this.setLoop(key, value, this.root);
        };
        haxe.ds.BalancedTree.prototype.get = function(key) {
            var node = this.root;
            while (node != null) {
                var c = this.compare(key, node.key);
                if (c == 0) return node.value;
                if (c < 0) node = node.left;
                else node = node.right;
            }
            return null;
        };
        haxe.ds.BalancedTree.prototype.keys = function() {
            var ret = [];
            this.keysLoop(this.root, ret);
            return _hcmn_.HxOverrides.iter(ret);
        };
        haxe.ds.BalancedTree.prototype.setLoop = function(k, v, node) {
            if (node == null) return new haxe.ds.TreeNode(null, k, v, null);
            var c = this.compare(k, node.key);
            if (c == 0) return new haxe.ds.TreeNode(node.left, k, v, node.right, node == null ? 0 : node._height);
            else if (c < 0) {
                var nl = this.setLoop(k, v, node.left);
                return this.balance(nl, node.key, node.value, node.right);
            } else {
                var nr = this.setLoop(k, v, node.right);
                return this.balance(node.left, node.key, node.value, nr);
            }
        };
        haxe.ds.BalancedTree.prototype.keysLoop = function(node, acc) {
            if (node != null) {
                this.keysLoop(node.left, acc);
                acc.push(node.key);
                this.keysLoop(node.right, acc);
            }
        };
        haxe.ds.BalancedTree.prototype.balance = function(l, k, v, r) {
            var hl;
            if (l == null) hl = 0;
            else hl = l._height;
            var hr;
            if (r == null) hr = 0;
            else hr = r._height;
            if (hl > hr + 2) {
                if ((function($this) {
                        var $r;
                        var _this = l.left;
                        $r = _this == null ? 0 : _this._height;
                        return $r;
                    }(this)) >= (function($this) {
                        var $r;
                        var _this1 = l.right;
                        $r = _this1 == null ? 0 : _this1._height;
                        return $r;
                    }(this))) return new haxe.ds.TreeNode(l.left, l.key, l.value, new haxe.ds.TreeNode(l.right, k, v, r));
                else return new haxe.ds.TreeNode(new haxe.ds.TreeNode(l.left, l.key, l.value, l.right.left), l.right.key, l.right.value, new haxe.ds.TreeNode(l.right.right, k, v, r));
            } else if (hr > hl + 2) {
                if ((function($this) {
                        var $r;
                        var _this2 = r.right;
                        $r = _this2 == null ? 0 : _this2._height;
                        return $r;
                    }(this)) > (function($this) {
                        var $r;
                        var _this3 = r.left;
                        $r = _this3 == null ? 0 : _this3._height;
                        return $r;
                    }(this))) return new haxe.ds.TreeNode(new haxe.ds.TreeNode(l, k, v, r.left), r.key, r.value, r.right);
                else return new haxe.ds.TreeNode(new haxe.ds.TreeNode(l, k, v, r.left.left), r.left.key, r.left.value, new haxe.ds.TreeNode(r.left.right, r.key, r.value, r.right));
            } else return new haxe.ds.TreeNode(l, k, v, r, (hl > hr ? hl : hr) + 1);
        };
        haxe.ds.BalancedTree.prototype.compare = function(k1, k2) {
            return _hcmn_.Reflect.compare(k1, k2);
        };
        haxe.ds.BalancedTree.prototype.__class__ = haxe.ds.BalancedTree;
        haxe.ds.TreeNode = function(l, k, v, r, h) {
            if (h == null) h = -1;
            this.left = l;
            this.key = k;
            this.value = v;
            this.right = r;
            if (h == -1) this._height = ((function($this) {
                var $r;
                var _this = $this.left;
                $r = _this == null ? 0 : _this._height;
                return $r;
            }(this)) > (function($this) {
                var $r;
                var _this1 = $this.right;
                $r = _this1 == null ? 0 : _this1._height;
                return $r;
            }(this)) ? (function($this) {
                var $r;
                var _this2 = $this.left;
                $r = _this2 == null ? 0 : _this2._height;
                return $r;
            }(this)) : (function($this) {
                var $r;
                var _this3 = $this.right;
                $r = _this3 == null ? 0 : _this3._height;
                return $r;
            }(this))) + 1;
            else this._height = h;
        };
        haxe.ds.TreeNode.__name__ = ["haxe", "ds", "TreeNode"];
        haxe.ds.TreeNode.prototype.left = null;
        haxe.ds.TreeNode.prototype.right = null;
        haxe.ds.TreeNode.prototype.key = null;
        haxe.ds.TreeNode.prototype.value = null;
        haxe.ds.TreeNode.prototype._height = null;
        haxe.ds.TreeNode.prototype.__class__ = haxe.ds.TreeNode;
        haxe.ds.EnumValueMap = function() {
            haxe.ds.BalancedTree.call(this);
        };
        haxe.ds.EnumValueMap.__interfaces__ = [haxe.IMap];
        haxe.ds.EnumValueMap.__name__ = ["haxe", "ds", "EnumValueMap"];
        haxe.ds.EnumValueMap.__super__ = haxe.ds.BalancedTree;
        for (var k in haxe.ds.BalancedTree.prototype) haxe.ds.EnumValueMap.prototype[k] = haxe.ds.BalancedTree.prototype[k];
        haxe.ds.EnumValueMap.prototype.compare = function(k1, k2) {
            var d = k1[1] - k2[1];
            if (d != 0) return d;
            var p1 = k1.slice(2);
            var p2 = k2.slice(2);
            if (p1.length == 0 && p2.length == 0) return 0;
            return this.compareArgs(p1, p2);
        };
        haxe.ds.EnumValueMap.prototype.compareArgs = function(a1, a2) {
            var ld = a1.length - a2.length;
            if (ld != 0) return ld;
            var _g1 = 0;
            var _g = a1.length;
            while (_g1 < _g) {
                var i = _g1++;
                var d = this.compareArg(a1[i], a2[i]);
                if (d != 0) return d;
            }
            return 0;
        };
        haxe.ds.EnumValueMap.prototype.compareArg = function(v1, v2) {
            if (_hcmn_.Reflect.isEnumValue(v1) && _hcmn_.Reflect.isEnumValue(v2)) return this.compare(v1, v2);
            else if ((v1 instanceof Array) && v1.__enum__ == null && ((v2 instanceof Array) && v2.__enum__ == null)) return this.compareArgs(v1, v2);
            else return _hcmn_.Reflect.compare(v1, v2);
        };
        haxe.ds.EnumValueMap.prototype.__class__ = haxe.ds.EnumValueMap;
        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;
        return {
            exports: scarabFxManager,
            activator: scarabFxManager.Activator
        };
    });
//# sourceURL=scarabFxManager.js