define("scarabWinManager", ["viewBuilderApi", "componentmodelComponentApi", "translationmanagerApi", "clientkernelLoaderApi", "displayEngineApi", "displayEngineUtils", "gameLayoutApi", "PIXI", "BABYLON", "clientkernelEventbusApi", "clientkernelModulesApi", "scarabWinManagerApi"],
    function(viewBuilderApi, componentmodelComponentApi, translationmanagerApi, clientkernelLoaderApi, displayEngineApi, displayEngineUtils, gameLayoutApi, PIXI, BABYLON, clientkernelEventbusApi, clientkernelModulesApi, scarabWinManagerApi) {
        "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 scarabWinManager == 'undefined') {
            var scarabWinManager = {};
        };
        scarabWinManager.Activator = function(context) {};
        scarabWinManager.Activator = ck_implements(scarabWinManager.Activator, clientkernelModulesApi.IModuleActivator);
        scarabWinManager.Activator.__interfaces__ = [clientkernelModulesApi.IModuleActivator];
        scarabWinManager.Activator.__name__ = ["scarabWinManager", "Activator"];
        scarabWinManager.Activator.prototype.start = function(context) {
            context.getServiceTracker([clientkernelLoaderApi.IAssetRegistry, viewBuilderApi.IViewBuilderFactory, displayEngineApi.IDisplayProvider]).then(function(context1) {
                scarabWinManager.ExternalService.initialize(context1);
                var vbf = context1.getAnyService(viewBuilderApi.IViewBuilderFactory, null);
                scarabWinManager.ExternalService.bus = context1.getAnyService(clientkernelEventbusApi.IEventBus, null);
                scarabWinManager.ExternalService.viewBuilderFactory = vbf;
                context1.registerService(new scarabWinManager.WinManagerFactory(vbf, context1), scarabWinManagerApi.WinManagerDeclaration, null);
            });
        };
        scarabWinManager.Activator.prototype.stop = function(context) {};
        scarabWinManager.Activator.main = function() {};
        scarabWinManager.Activator.prototype.__class__ = scarabWinManager.Activator;
        scarabWinManager.ExternalService = function() {};
        scarabWinManager.ExternalService.__name__ = ["scarabWinManager", "ExternalService"];
        scarabWinManager.ExternalService.assetRegistry = null;
        scarabWinManager.ExternalService.vbf = null;
        scarabWinManager.ExternalService.displayProvider = null;
        scarabWinManager.ExternalService.translationManager = null;
        scarabWinManager.ExternalService.bus = null;
        scarabWinManager.ExternalService.viewBuilderFactory = null;
        scarabWinManager.ExternalService.assets = null;
        scarabWinManager.ExternalService.initialize = function(context) {
            scarabWinManager.ExternalService.assetRegistry = context.getAnyService(clientkernelLoaderApi.IAssetRegistry, null);
            scarabWinManager.ExternalService.vbf = context.getAnyService(viewBuilderApi.IViewBuilderFactory, null);
            scarabWinManager.ExternalService.displayProvider = context.getAnyService(displayEngineApi.IDisplayProvider, null);
        };
        scarabWinManager.ExternalService.prototype.__class__ = scarabWinManager.ExternalService;
        scarabWinManager.WinManager = function(context, vbf) {
            this.assetsLoaded = false;
            this.initialized = false;
            this.layoutPayload = null;
            this.vba = null;
            this.cfgId = "win_manager_definition_config";
            this.vbAssetID = "win_manager_layout";
            this.vbf = vbf;
            this.context = context;
            this.components = new haxe.ds.EnumValueMap();
            this.baseEvents = new scarabWinManager.BaseEvents();
            this.port = context.getImplementedPort(scarabWinManagerApi.IWinManagerImplementationPort);
            this.layoutPort = context.getUsedPort(gameLayoutApi.IGameLayoutPort);
            this.layoutPort.getUpdateComponentLayout().subscribe($bind(this, this.updateLayout));
            haxe.Log.trace("[WinManager] loadConfigData() ", {
                fileName: "WinManager.hx",
                lineNumber: 55,
                className: "game.winmanager.WinManager",
                methodName: "new"
            });
            this.loadConfigData();
        };
        scarabWinManager.WinManager.__name__ = ["scarabWinManager", "WinManager"];
        scarabWinManager.WinManager.prototype.vbAssetID = null;
        scarabWinManager.WinManager.prototype.cfgId = null;
        scarabWinManager.WinManager.prototype.view = null;
        scarabWinManager.WinManager.prototype.context = null;
        scarabWinManager.WinManager.prototype.vba = null;
        scarabWinManager.WinManager.prototype.vbf = null;
        scarabWinManager.WinManager.prototype.controller = null;
        scarabWinManager.WinManager.prototype.layoutPayload = null;
        scarabWinManager.WinManager.prototype.initialized = null;
        scarabWinManager.WinManager.prototype.assetsLoaded = null;
        scarabWinManager.WinManager.prototype.port = null;
        scarabWinManager.WinManager.prototype.layoutPort = null;
        scarabWinManager.WinManager.prototype.cfg = null;
        scarabWinManager.WinManager.prototype.vbView = null;
        scarabWinManager.WinManager.prototype.components = null;
        scarabWinManager.WinManager.prototype.baseEvents = null;
        scarabWinManager.WinManager.prototype.loadConfigData = function() {
            var _g = this;
            scarabWinManager.ExternalService.assetRegistry.getAsset(this.cfgId).getContent().then(function(data) {
                _g.cfg = data;
                haxe.Log.trace("[WinManager] loadConfigData() ", {
                    fileName: "WinManager.hx",
                    lineNumber: 81,
                    className: "game.winmanager.WinManager",
                    methodName: "loadConfigData",
                    customParams: [_g.cfg]
                });
                _g.loadVBAssets();
            });
        };
        scarabWinManager.WinManager.prototype.loadVBAssets = function() {
            var _g = this;
            haxe.Log.trace("[WinManager] loadVBAssets() " + _hcmn_.Std.string(this.cfg.vbAssets), {
                fileName: "WinManager.hx",
                lineNumber: 89,
                className: "game.winmanager.WinManager",
                methodName: "loadVBAssets"
            });
            scarabWinManager.ExternalService.assetRegistry.getAssetsContent(this.cfg.vbAssets).then(function(data) {
                scarabWinManager.ExternalService.assets = data;
                _g.loadMainAssets();
                haxe.Log.trace("[WinManager] vbAssetsLoaded() " + _hcmn_.Std.string(_g.cfg.vbAssets), {
                    fileName: "WinManager.hx",
                    lineNumber: 93,
                    className: "game.winmanager.WinManager",
                    methodName: "loadVBAssets"
                });
            });
        };
        scarabWinManager.WinManager.prototype.loadMainAssets = function() {
            var _g = this;
            haxe.Log.trace("[WinManager] loadMainAssets()", {
                fileName: "WinManager.hx",
                lineNumber: 100,
                className: "game.winmanager.WinManager",
                methodName: "loadMainAssets"
            });
            scarabWinManager.ExternalService.assetRegistry.getAsset(this.vbAssetID).getContent().then(function(vba) {
                haxe.Log.trace("[WinManager] mainAssetsLoaded()", {
                    fileName: "WinManager.hx",
                    lineNumber: 103,
                    className: "game.winmanager.WinManager",
                    methodName: "loadMainAssets"
                });
                _g.vba = vba;
                _g.assetsLoaded = true;
                _g.initialize();
            });
        };
        scarabWinManager.WinManager.prototype.updateLayout = function(e) {
            haxe.Log.trace("[WinManager] updateLayout() ", {
                fileName: "WinManager.hx",
                lineNumber: 112,
                className: "game.winmanager.WinManager",
                methodName: "updateLayout"
            });
            this.layoutPayload = e.getPayload();
            if (!this.initialized) this.initialize();
            else {
                this.controller.updateLayout(this.layoutPayload);
                this.layoutPort.getComponentLayoutUpdated().publish(this.context.getInstance());
            }
        };
        scarabWinManager.WinManager.prototype.initialize = function() {
            haxe.Log.trace("[WinManager] initialize() " + _hcmn_.Std.string(this.initialized) + _hcmn_.Std.string(this.layoutPayload), {
                fileName: "WinManager.hx",
                lineNumber: 127,
                className: "game.winmanager.WinManager",
                methodName: "initialize"
            });
            if (!this.initialized && this.vba != null && this.layoutPayload != null) {
                this.controller = new scarabWinManager.WinManagerController(this);
                this.view = this.vbf.createView(this.vba);
                this.registerAllComponents();
                this.controller.updateLayout(this.layoutPayload);
                this.layoutPort.getComponentLayoutUpdated().publish(this.context.getInstance());
                this.port.getShow().subscribe($bind(this, this.handleShow));
                this.port.getHide().subscribe($bind(this, this.handleHide));
                this.initialized = true;
            }
        };
        scarabWinManager.WinManager.prototype.registerAllComponents = function() {
            haxe.Log.trace("[WinManager] registerAllComponents()", {
                fileName: "WinManager.hx",
                lineNumber: 146,
                className: "game.winmanager.WinManager",
                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("[WinManager] registerAllComponents() " + compId, {
                    fileName: "WinManager.hx",
                    lineNumber: 149,
                    className: "game.winmanager.WinManager",
                    methodName: "registerAllComponents"
                });
                var constructorIndex;
                var _this = _hcmn_.Type.getEnumConstructs(scarabWinManagerApi.WinManagerTypeEnum);
                constructorIndex = _hcmn_.HxOverrides.indexOf(_this, compId, 0);
                if (constructorIndex < 0) continue;
                var componentEnum = _hcmn_.Type.createEnum(scarabWinManagerApi.WinManagerTypeEnum, compId, null);
                this.registerComponent(componentEnum);
            }
        };
        scarabWinManager.WinManager.prototype.registerComponent = function(componentEnum) {
            haxe.Log.trace("[WinManager] registerComponent", {
                fileName: "WinManager.hx",
                lineNumber: 160,
                className: "game.winmanager.WinManager",
                methodName: "registerComponent",
                customParams: [componentEnum]
            });
            this.registerContainerComponent(scarabWinManagerApi.WinManagerTypeEnum.wm_win_frames, scarabWinManager.WinFrames);
            return true;
        };
        scarabWinManager.WinManager.prototype.registerContainerComponent = function(componentEnum, componentClass) {
            haxe.Log.trace("[WinManager] registerContainerComponent", {
                fileName: "WinManager.hx",
                lineNumber: 174,
                className: "game.winmanager.WinManager",
                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);
        };
        scarabWinManager.WinManager.prototype.handleHide = function(e) {
            haxe.Log.trace("[WinManager] hide", {
                fileName: "WinManager.hx",
                lineNumber: 183,
                className: "game.winmanager.WinManager",
                methodName: "handleHide"
            });
            ((function($this) {
                var $r;
                var key = e.getPayload();
                $r = $this.components.get(key);
                return $r;
            }(this))).hide();
        };
        scarabWinManager.WinManager.prototype.handleShow = function(e) {
            ((function($this) {
                var $r;
                var key = e.getPayload().type;
                $r = $this.components.get(key);
                return $r;
            }(this))).show(e.getPayload());
        };
        scarabWinManager.WinManager.prototype.__class__ = scarabWinManager.WinManager;
        scarabWinManager.WinManagerController = function(winmanager) {
            this.flag_addedToStage = false;
            this.winmanager = winmanager;
        };
        scarabWinManager.WinManagerController.__name__ = ["scarabWinManager", "WinManagerController"];
        scarabWinManager.WinManagerController.prototype.flag_addedToStage = null;
        scarabWinManager.WinManagerController.prototype.winmanager = null;
        scarabWinManager.WinManagerController.prototype.updateLayout = function(layoutPayload) {
            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 = scarabWinManager.ExternalService.displayProvider.getStages();
                stage = this1.get(layerPayload.stage);
                var container;
                container = (function($this) {
                    var $r;
                    var this2 = $this.winmanager.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) {}
            }
            if (!this.flag_addedToStage) this.flag_addedToStage = true;
        };
        scarabWinManager.WinManagerController.prototype.__class__ = scarabWinManager.WinManagerController;
        scarabWinManager.WinManagerFactory = function(vbf, context) {
            this.context = context;
            this.vbf = vbf;
        };
        scarabWinManager.WinManagerFactory = ck_implements(scarabWinManager.WinManagerFactory, clientkernelModulesApi.IService);
        scarabWinManager.WinManagerFactory = ck_implements(scarabWinManager.WinManagerFactory, componentmodelComponentApi.IComponentFactory);
        scarabWinManager.WinManagerFactory.__interfaces__ = [clientkernelModulesApi.IService, componentmodelComponentApi.IComponentFactory];
        scarabWinManager.WinManagerFactory.__name__ = ["scarabWinManager", "WinManagerFactory"];
        scarabWinManager.WinManagerFactory.prototype.context = null;
        scarabWinManager.WinManagerFactory.prototype.vbf = null;
        scarabWinManager.WinManagerFactory.prototype.getComponentDeclaration = function() {
            return scarabWinManagerApi.WinManagerDeclaration;
        };
        scarabWinManager.WinManagerFactory.prototype.createComponent = function(context) {
            new scarabWinManager.WinManager(context, this.vbf);
        };
        scarabWinManager.WinManagerFactory.prototype.__class__ = scarabWinManager.WinManagerFactory;

        scarabWinManager.IWinManager = function() {}
        scarabWinManager.IWinManager.prototype = {

            show: function(payload) {
                return {
                    arguments: ["*"],
                    returns: "void"
                };
            },
            hide: function() {
                return {
                    arguments: [],
                    returns: "void"
                };
            }
        };
        scarabWinManager.WinFrames = function(container, config) {
            this.config = config;
            this.container = container;
            var assetId = "win_manager_animations";
            this.vbAnimView = scarabWinManager.ExternalService.viewBuilderFactory.createView(scarabWinManager.ExternalService.assets.get(assetId));
            this.symbolRect = new displayEngineApi.Point(config.rect[0], config.rect[1]);
        };
        scarabWinManager.WinFrames.__name__ = ["scarabWinManager", "WinFrames"];
        scarabWinManager.WinFrames.prototype.container = null;
        scarabWinManager.WinFrames.prototype.vbAnimView = null;
        scarabWinManager.WinFrames.prototype.config = null;
        scarabWinManager.WinFrames.prototype.wildView = null;
        scarabWinManager.WinFrames.prototype.tweens = null;
        scarabWinManager.WinFrames.prototype.rect = null;
        scarabWinManager.WinFrames.prototype.symbolContainer = null;
        scarabWinManager.WinFrames.prototype.symbolRect = null;
        scarabWinManager.WinFrames.prototype.show = function(payload) {
            this.container.show();
            var _g1 = 0;
            var _g = payload.content.length;
            while (_g1 < _g) {
                var i = _g1++;
                var _g3 = 0;
                var _g2 = payload.content[i].length;
                while (_g3 < _g2) {
                    var j = _g3++;
                    if (payload.content[i][j] == 1) {
                        var animationHolder = this.vbAnimView.createContainerFromStoredConfig("win_frame");
                        var vbAnimId = "win_frame_" + i + "_" + j;
                        var exists;
                        var this1 = this.container.getChildComponents();
                        exists = this1.exists(vbAnimId);
                        if (!exists) this.container.addChildComponent(animationHolder, vbAnimId);
                        var vbAnimContent = animationHolder.getVBAnimationById("ANIMATION_CONTENT");
                        vbAnimContent.show();
                        if (payload.state[i][j] == 2) vbAnimContent.stop();
                        else vbAnimContent.gotoAndPlay(false, "loop");
                        animationHolder.setX(this.symbolRect.x * i | 0);
                        animationHolder.setY(this.symbolRect.y * j | 0);
                    }
                }
            }
            haxe.Log.trace("[WinManager] [WinFrames] [show] ", {
                fileName: "WinFrames.hx",
                lineNumber: 60,
                className: "game.winmanager.components.WinFrames",
                methodName: "show",
                customParams: [payload]
            });
        };
        scarabWinManager.WinFrames.prototype.hide = function() {
            haxe.Log.trace("[WinManager] [WinFrames] [hide] ", {
                fileName: "WinFrames.hx",
                lineNumber: 65,
                className: "game.winmanager.components.WinFrames",
                methodName: "hide"
            });
            this.container.hide();
            var $it0 = (function($this) {
                var $r;
                var this1 = $this.container.getChildComponents();
                $r = this1.keys();
                return $r;
            }(this));
            while ($it0.hasNext()) {
                var key = $it0.next();
                this.container.disposeChildComponent(key);
            }
        };
        scarabWinManager.WinFrames.prototype.__class__ = scarabWinManager.WinFrames;
        scarabWinManager.BaseEvents = function() {
            this.choice = new _hcmn_.msignal_Signal1();
        };
        scarabWinManager.BaseEvents.__name__ = ["scarabWinManager", "BaseEvents"];
        scarabWinManager.BaseEvents.prototype.choice = null;
        scarabWinManager.BaseEvents.prototype.__class__ = scarabWinManager.BaseEvents;
        if (typeof haxe == 'undefined') {
            var haxe = {};
        };

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

            get: function(k) {
                return {
                    arguments: ["*"],
                    returns: "null"
                };
            },
            exists: function(k) {
                return {
                    arguments: ["*"],
                    returns: "boolean"
                };
            },
            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.exists = function(key) {
            var node = this.root;
            while (node != null) {
                var c = this.compare(key, node.key);
                if (c == 0) return true;
                else if (c < 0) node = node.left;
                else node = node.right;
            }
            return false;
        };
        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: scarabWinManager,
            activator: scarabWinManager.Activator
        };
    });
//# sourceURL=scarabWinManager.js