define("pBWOFExoticFarEastViewManager", ["viewBuilderApi", "componentmodelComponentApi", "translationmanagerApi", "clientkernelLoaderApi", "displayEngineApi", "displayEngineUtils", "gameLayoutApi", "pBWOFExoticFarEastViewManagerApi", "PIXI", "BABYLON", "clientkernelEventbusApi", "clientkernelModulesApi"],
    function(viewBuilderApi, componentmodelComponentApi, translationmanagerApi, clientkernelLoaderApi, displayEngineApi, displayEngineUtils, gameLayoutApi, pBWOFExoticFarEastViewManagerApi, 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 pBWOFExoticFarEastViewManager == 'undefined') {
            var pBWOFExoticFarEastViewManager = {};
        };
        pBWOFExoticFarEastViewManager.Activator = function(context) {};
        pBWOFExoticFarEastViewManager.Activator = ck_implements(pBWOFExoticFarEastViewManager.Activator, clientkernelModulesApi.IModuleActivator);
        pBWOFExoticFarEastViewManager.Activator.__interfaces__ = [clientkernelModulesApi.IModuleActivator];
        pBWOFExoticFarEastViewManager.Activator.__name__ = ["pBWOFExoticFarEastViewManager", "Activator"];
        pBWOFExoticFarEastViewManager.Activator.prototype.start = function(context) {
            context.getServiceTracker([clientkernelLoaderApi.IAssetRegistry, viewBuilderApi.IViewBuilderFactory, displayEngineApi.IDisplayProvider]).then(function(context1) {
                pBWOFExoticFarEastViewManager.ExternalService.initialize(context1);
                var vbf = context1.getAnyService(viewBuilderApi.IViewBuilderFactory, null);
                pBWOFExoticFarEastViewManager.ExternalService.bus = context1.getAnyService(clientkernelEventbusApi.IEventBus, null);
                pBWOFExoticFarEastViewManager.ExternalService.viewBuilderFactory = vbf;
                context1.registerService(new pBWOFExoticFarEastViewManager.ViewManagerFactory(vbf, context1), pBWOFExoticFarEastViewManagerApi.ViewManagerDeclaration, null);
            });
        };
        pBWOFExoticFarEastViewManager.Activator.prototype.stop = function(context) {};
        pBWOFExoticFarEastViewManager.Activator.main = function() {};
        pBWOFExoticFarEastViewManager.Activator.prototype.__class__ = pBWOFExoticFarEastViewManager.Activator;
        pBWOFExoticFarEastViewManager.ExternalService = function() {};
        pBWOFExoticFarEastViewManager.ExternalService.__name__ = ["pBWOFExoticFarEastViewManager", "ExternalService"];
        pBWOFExoticFarEastViewManager.ExternalService.assetRegistry = null;
        pBWOFExoticFarEastViewManager.ExternalService.vbf = null;
        pBWOFExoticFarEastViewManager.ExternalService.displayProvider = null;
        pBWOFExoticFarEastViewManager.ExternalService.translationManager = null;
        pBWOFExoticFarEastViewManager.ExternalService.bus = null;
        pBWOFExoticFarEastViewManager.ExternalService.viewBuilderFactory = null;
        pBWOFExoticFarEastViewManager.ExternalService.initialize = function(context) {
            pBWOFExoticFarEastViewManager.ExternalService.assetRegistry = context.getAnyService(clientkernelLoaderApi.IAssetRegistry, null);
            pBWOFExoticFarEastViewManager.ExternalService.vbf = context.getAnyService(viewBuilderApi.IViewBuilderFactory, null);
            pBWOFExoticFarEastViewManager.ExternalService.displayProvider = context.getAnyService(displayEngineApi.IDisplayProvider, null);
        };
        pBWOFExoticFarEastViewManager.ExternalService.prototype.__class__ = pBWOFExoticFarEastViewManager.ExternalService;
        pBWOFExoticFarEastViewManager.ViewManager = function(context, vbf) {
            this.assets = new _hcmn_.haxe_ds_StringMap();
            this.assetsLoaded = false;
            this.initialized = false;
            this.layoutPayload = null;
            this.vba = null;
            this.cfgId = "view_manager_definition_config.json";
            this.vbAssetID = "view_manager.viewbuilder.json";
            this.vbf = vbf;
            this.context = context;
            this.baseEvents = new pBWOFExoticFarEastViewManager.BaseEvents();
            this.port = context.getImplementedPort(pBWOFExoticFarEastViewManagerApi.IViewManagerImplementationPort);
            this.layoutPort = context.getUsedPort(gameLayoutApi.IGameLayoutPort);
            this.layoutPort.getUpdateComponentLayout().subscribe($bind(this, this.updateLayout));
            this.loadConfigData();
        };
        pBWOFExoticFarEastViewManager.ViewManager.__name__ = ["pBWOFExoticFarEastViewManager", "ViewManager"];
        pBWOFExoticFarEastViewManager.ViewManager.prototype.vbAssetID = null;
        pBWOFExoticFarEastViewManager.ViewManager.prototype.cfgId = null;
        pBWOFExoticFarEastViewManager.ViewManager.prototype.view = null;
        pBWOFExoticFarEastViewManager.ViewManager.prototype.context = null;
        pBWOFExoticFarEastViewManager.ViewManager.prototype.vba = null;
        pBWOFExoticFarEastViewManager.ViewManager.prototype.vbf = null;
        pBWOFExoticFarEastViewManager.ViewManager.prototype.controller = null;
        pBWOFExoticFarEastViewManager.ViewManager.prototype.layoutPayload = null;
        pBWOFExoticFarEastViewManager.ViewManager.prototype.initialized = null;
        pBWOFExoticFarEastViewManager.ViewManager.prototype.assetsLoaded = null;
        pBWOFExoticFarEastViewManager.ViewManager.prototype.port = null;
        pBWOFExoticFarEastViewManager.ViewManager.prototype.layoutPort = null;
        pBWOFExoticFarEastViewManager.ViewManager.prototype.cfg = null;
        pBWOFExoticFarEastViewManager.ViewManager.prototype.assets = null;
        pBWOFExoticFarEastViewManager.ViewManager.prototype.vbView = null;
        pBWOFExoticFarEastViewManager.ViewManager.prototype.vmComponent = null;
        pBWOFExoticFarEastViewManager.ViewManager.prototype.baseEvents = null;
        pBWOFExoticFarEastViewManager.ViewManager.prototype.loadConfigData = function() {
            var _g = this;
            pBWOFExoticFarEastViewManager.ExternalService.assetRegistry.getAsset(this.cfgId).getContent().then(function(data) {
                _g.cfg = data;
                _g.loadMainAssets();
            });
        };
        pBWOFExoticFarEastViewManager.ViewManager.prototype.loadMainAssets = function() {
            var _g = this;
            pBWOFExoticFarEastViewManager.ExternalService.assetRegistry.getAsset(this.vbAssetID).getContent().then(function(vba) {
                _g.vba = vba;
                _g.assetsLoaded = true;
                _g.initialize();
            });
        };
        pBWOFExoticFarEastViewManager.ViewManager.prototype.updateLayout = function(e) {
            this.layoutPayload = e.getPayload();
            if (!this.initialized) this.initialize();
            else {
                this.controller.updateLayout(this.layoutPayload);
                this.layoutPort.getComponentLayoutUpdated().publish(this.context.getInstance());
            }
        };
        pBWOFExoticFarEastViewManager.ViewManager.prototype.initialize = function() {
            if (!this.initialized && this.vba != null && this.layoutPayload != null) {
                this.controller = new pBWOFExoticFarEastViewManager.ViewManagerController(this);
                this.vmComponent = new pBWOFExoticFarEastViewManager.ViewManagerComponent(this.cfg, this.port);
                this.view = this.vbf.createView(this.vba);
                this.controller.updateLayout(this.layoutPayload);
                this.layoutPort.getComponentLayoutUpdated().publish(this.context.getInstance());
                this.layoutPort.getGameLayoutUpdated().subscribe(($_ = this.controller, $bind($_, $_.onGameLayoutUpdateCompleted)));
                this.layoutPort.getGameLayoutUpdateStarted().subscribe(($_ = this.controller, $bind($_, $_.gameLayoutUpdateStarted)));
                this.port.getActivate().subscribe($bind(this, this.handleActivate));
                this.port.getDeActivate().subscribe($bind(this, this.handleDeActivate));
                this.port.getReset().subscribe($bind(this, this.handleReset));
                this.port.getShow().subscribe($bind(this, this.handleShow));
                this.port.getHide().subscribe($bind(this, this.handleHide));
                this.port.getShake().subscribe($bind(this, this.handleShake));
                this.initialized = true;
            }
        };
        pBWOFExoticFarEastViewManager.ViewManager.prototype.handleShow = function(e) {
            this.vmComponent.show(e.getPayload());
        };
        pBWOFExoticFarEastViewManager.ViewManager.prototype.handleHide = function(e) {
            this.vmComponent.hide(e.getPayload());
        };
        pBWOFExoticFarEastViewManager.ViewManager.prototype.handleShake = function(e) {
            this.vmComponent.initShake(e.getPayload());
        };
        pBWOFExoticFarEastViewManager.ViewManager.prototype.handleActivate = function(e) {
            this.vmComponent.activate(e.getPayload());
        };
        pBWOFExoticFarEastViewManager.ViewManager.prototype.handleDeActivate = function(e) {
            this.vmComponent.deactivate(e.getPayload());
        };
        pBWOFExoticFarEastViewManager.ViewManager.prototype.handleReset = function(e) {
            this.vmComponent.reset(e.getPayload());
        };
        pBWOFExoticFarEastViewManager.ViewManager.prototype.__class__ = pBWOFExoticFarEastViewManager.ViewManager;
        pBWOFExoticFarEastViewManager.ViewManagerController = function(viewManager) {
            this.flag_addedToStage = false;
            this.viewManager = viewManager;
        };
        pBWOFExoticFarEastViewManager.ViewManagerController.__name__ = ["pBWOFExoticFarEastViewManager", "ViewManagerController"];
        pBWOFExoticFarEastViewManager.ViewManagerController.prototype.flag_addedToStage = null;
        pBWOFExoticFarEastViewManager.ViewManagerController.prototype.viewManager = null;
        pBWOFExoticFarEastViewManager.ViewManagerController.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 = pBWOFExoticFarEastViewManager.ExternalService.displayProvider.getStages();
                stage = this1.get(layerPayload.stage);
                var container;
                container = (function($this) {
                    var $r;
                    var this2 = $this.viewManager.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);
                var cfg1 = layerPayload.configuration;
                this.viewManager.vmComponent.onLayoutUpdate(cfg1);
            }
            if (!this.flag_addedToStage) this.flag_addedToStage = true;
        };
        pBWOFExoticFarEastViewManager.ViewManagerController.prototype.onGameLayoutUpdateCompleted = function(e) {
            haxe.Log.trace("[ViewManagerController] [onGameLayoutUpdateCompleted]", {
                fileName: "ViewManagerController.hx",
                lineNumber: 55,
                className: "game.viewmanager.ViewManagerController",
                methodName: "onGameLayoutUpdateCompleted"
            });
            this.viewManager.vmComponent.onGameLayoutUpdateCompleted();
        };
        pBWOFExoticFarEastViewManager.ViewManagerController.prototype.gameLayoutUpdateStarted = function(e) {
            haxe.Log.trace("[ViewManagerController] [gameLayoutUpdateStarted]", {
                fileName: "ViewManagerController.hx",
                lineNumber: 61,
                className: "game.viewmanager.ViewManagerController",
                methodName: "gameLayoutUpdateStarted"
            });
            this.viewManager.vmComponent.onGameLayoutUpdateStarted();
        };
        pBWOFExoticFarEastViewManager.ViewManagerController.prototype.__class__ = pBWOFExoticFarEastViewManager.ViewManagerController;
        pBWOFExoticFarEastViewManager.ViewManagerFactory = function(vbf, context) {
            this.context = context;
            this.vbf = vbf;
        };
        pBWOFExoticFarEastViewManager.ViewManagerFactory = ck_implements(pBWOFExoticFarEastViewManager.ViewManagerFactory, clientkernelModulesApi.IService);
        pBWOFExoticFarEastViewManager.ViewManagerFactory = ck_implements(pBWOFExoticFarEastViewManager.ViewManagerFactory, componentmodelComponentApi.IComponentFactory);
        pBWOFExoticFarEastViewManager.ViewManagerFactory.__interfaces__ = [clientkernelModulesApi.IService, componentmodelComponentApi.IComponentFactory];
        pBWOFExoticFarEastViewManager.ViewManagerFactory.__name__ = ["pBWOFExoticFarEastViewManager", "ViewManagerFactory"];
        pBWOFExoticFarEastViewManager.ViewManagerFactory.prototype.context = null;
        pBWOFExoticFarEastViewManager.ViewManagerFactory.prototype.vbf = null;
        pBWOFExoticFarEastViewManager.ViewManagerFactory.prototype.getComponentDeclaration = function() {
            return pBWOFExoticFarEastViewManagerApi.ViewManagerDeclaration;
        };
        pBWOFExoticFarEastViewManager.ViewManagerFactory.prototype.createComponent = function(context) {
            new pBWOFExoticFarEastViewManager.ViewManager(context, this.vbf);
        };
        pBWOFExoticFarEastViewManager.ViewManagerFactory.prototype.__class__ = pBWOFExoticFarEastViewManager.ViewManagerFactory;
        pBWOFExoticFarEastViewManager.ViewManagerComponent = function(cfg, port) {
            this.implPort = port;
            this.maskSize = [];
            var this1 = pBWOFExoticFarEastViewManager.ExternalService.displayProvider.getStages();
            this.stage = this1.get("skgl_0");
            this.tweens = new _hcmn_.haxe_ds_StringMap();
            this.activeScenarios = new _hcmn_.haxe_ds_StringMap();
            this.scenarios = new _hcmn_.haxe_ds_StringMap();
            this.initProperties = new _hcmn_.haxe_ds_StringMap();
            var _g = 0;
            var _g1 = _hcmn_.Reflect.fields(cfg.scenarios);
            while (_g < _g1.length) {
                var scenarioId = _g1[_g];
                ++_g;
                var element = _hcmn_.Reflect.field(cfg.scenarios, scenarioId);
                var layerProps = [];
                var _g2 = 0;
                var _g3 = _hcmn_.Reflect.fields(element);
                while (_g2 < _g3.length) {
                    var properties = _g3[_g2];
                    ++_g2;
                    var props = _hcmn_.Reflect.field(element, properties);
                    var _g5 = 0;
                    var _g4 = props.length;
                    while (_g5 < _g4) {
                        var i = _g5++;
                        layerProps[i] = {
                            id: props[i].id,
                            x: props[i].x,
                            y: props[i].y,
                            rotation: props[i].r,
                            alpha: props[i].a,
                            time: props[i].time,
                            mask: props[i].mask,
                            type: props[i].type
                        };
                    }
                }
                var allLayers = {
                    layers: layerProps
                };
                this.activeScenarios.set(scenarioId, false);
                this.scenarios.set(scenarioId, allLayers);
            }
            haxe.Log.trace("VIEW_MANAGER.activate() " + this.activeScenarios.toString(), {
                fileName: "ViewManagerComponent.hx",
                lineNumber: 95,
                className: "game.viewmanager.components.ViewManagerComponent",
                methodName: "new"
            });
        };
        pBWOFExoticFarEastViewManager.ViewManagerComponent.__name__ = ["pBWOFExoticFarEastViewManager", "ViewManagerComponent"];
        pBWOFExoticFarEastViewManager.ViewManagerComponent.prototype.stage = null;
        pBWOFExoticFarEastViewManager.ViewManagerComponent.prototype.tweens = null;
        pBWOFExoticFarEastViewManager.ViewManagerComponent.prototype.activeScenarios = null;
        pBWOFExoticFarEastViewManager.ViewManagerComponent.prototype.scenarios = null;
        pBWOFExoticFarEastViewManager.ViewManagerComponent.prototype.initProperties = null;
        pBWOFExoticFarEastViewManager.ViewManagerComponent.prototype.implPort = null;
        pBWOFExoticFarEastViewManager.ViewManagerComponent.prototype.maskSize = null;
        pBWOFExoticFarEastViewManager.ViewManagerComponent.prototype.activate = function(scenarioId) {
            var _g2 = this;
            haxe.Log.trace("VIEW_MANAGER.activate() " + scenarioId, {
                fileName: "ViewManagerComponent.hx",
                lineNumber: 100,
                className: "game.viewmanager.components.ViewManagerComponent",
                methodName: "activate",
                customParams: [this.tweens.exists(scenarioId)]
            });
            if (!this.tweens.exists(scenarioId)) {
                var value = [];
                this.tweens.set(scenarioId, value);
                this.activeScenarios.set(scenarioId, true);
                var totalTweens = 0;
                var currentTween = 0;
                var viewManager = this.stage.getChildByID("VIEW_MANAGER");
                viewManager.setWidth(this.stage.getWidth());
                viewManager.setHeight(this.stage.getHeight());
                var _g1 = 0;
                var _g = this.scenarios.get(scenarioId).layers.length;
                while (_g1 < _g) {
                    var i = _g1++;
                    var layerProperties = this.scenarios.get(scenarioId).layers[i];
                    var layerId = layerProperties.id;
                    var dObj = this.stage.getChildByID(layerId);
                    viewManager.addChild(dObj);
                    var type = layerProperties.type;
                    var time = layerProperties.time;
                    var xPos = dObj.getX();
                    var yPos = dObj.getY();
                    this.tweens.get(scenarioId).push(displayEngineUtils.TweenX.to(dObj, {
                        x: xPos + layerProperties.x,
                        y: yPos + layerProperties.y,
                        rotation: layerProperties.rotation,
                        alpha: layerProperties.alpha
                    }, time, null, null, null, null, null, null, null, {
                        fileName: "ViewManagerComponent.hx",
                        lineNumber: 128,
                        className: "game.viewmanager.components.ViewManagerComponent",
                        methodName: "activate"
                    }).ease(displayEngineUtils.EaseX.sineIn).onFinish(function() {
                        currentTween++;
                        if (currentTween >= totalTweens) {
                            haxe.Log.trace("VIEW_MANAGER.activate.getCompleted " + _hcmn_.Std.string(_g2.activeScenarios.get(scenarioId)), {
                                fileName: "ViewManagerComponent.hx",
                                lineNumber: 141,
                                className: "game.viewmanager.components.ViewManagerComponent",
                                methodName: "activate",
                                customParams: [scenarioId]
                            });
                            _g2.reset(scenarioId);
                            _g2.implPort.getCompleted().publish(scenarioId);
                            _g2.activeScenarios.set(scenarioId, false);
                        }
                    }));
                }
                totalTweens = this.tweens.get(scenarioId).length;
                if (viewManager.getMask() != null) viewManager.setMask(null);
                var points = [this.maskSize[0], this.maskSize[1], this.maskSize[2], this.maskSize[3]];
                var mask = this.getMask(points);
                viewManager.setMask(mask);
            } else return;
        };
        pBWOFExoticFarEastViewManager.ViewManagerComponent.prototype.deactivate = function(scenarioId) {};
        pBWOFExoticFarEastViewManager.ViewManagerComponent.prototype.onLayoutUpdate = function(cfg) {
            haxe.Log.trace("VIEW_MANAGER.layoutUpdate() " + this.activeScenarios.toString(), {
                fileName: "ViewManagerComponent.hx",
                lineNumber: 174,
                className: "game.viewmanager.components.ViewManagerComponent",
                methodName: "onLayoutUpdate"
            });
            var viewManager = this.stage.getChildByID("VIEW_MANAGER");
            viewManager.setWidth(this.stage.getWidth());
            viewManager.setHeight(this.stage.getHeight());
            this.maskSize = cfg.mask;
            if (viewManager.getMask() != null) viewManager.setMask(null);
            var points = [this.maskSize[0], this.maskSize[1], this.maskSize[2], this.maskSize[3]];
            var mask = this.getMask(points);
            viewManager.setMask(mask);
        };
        pBWOFExoticFarEastViewManager.ViewManagerComponent.prototype.onGameLayoutUpdateStarted = function() {
            haxe.Log.trace("VIEW_MANAGER.onGameLayoutUpdateStarted() ", {
                fileName: "ViewManagerComponent.hx",
                lineNumber: 193,
                className: "game.viewmanager.components.ViewManagerComponent",
                methodName: "onGameLayoutUpdateStarted"
            });
            var $it0 = this.scenarios.keys();
            while ($it0.hasNext()) {
                var scenarioId = $it0.next();
                if (this.activeScenarios.get(scenarioId)) this.reset(scenarioId);
            }
        };
        pBWOFExoticFarEastViewManager.ViewManagerComponent.prototype.onGameLayoutUpdateCompleted = function() {
            var _g1 = 0;
            var _g = this.stage.getChildren().length;
            while (_g1 < _g) {
                var i = _g1++;
                var layerId = this.stage.getChildAt(i).getName();
                var dObj = this.stage.getChildByID(layerId);
                var props = {
                    x: dObj.getX(),
                    y: dObj.getY(),
                    rotation: dObj.getRotation(),
                    alpha: dObj.getAlpha()
                };
                this.initProperties.set(layerId, props);
            }
            this.implPort.getUpdated().publish(this.activeScenarios);
            var $it0 = this.activeScenarios.keys();
            while ($it0.hasNext()) {
                var scenarioId = $it0.next();
                this.activeScenarios.set(scenarioId, false);
            }
        };
        pBWOFExoticFarEastViewManager.ViewManagerComponent.prototype.show = function(scenarioId) {
            haxe.Log.trace("VIEW_MANAGER.show() " + scenarioId, {
                fileName: "ViewManagerComponent.hx",
                lineNumber: 230,
                className: "game.viewmanager.components.ViewManagerComponent",
                methodName: "show"
            });
            var len = this.scenarios.get(scenarioId).layers.length;
            var _g = 0;
            while (_g < len) {
                var i = _g++;
                var layerId = this.scenarios.get(scenarioId).layers[i].id;
                if (this.stage.getChildByID(layerId) != null) {
                    var dObj = this.stage.getChildByID(layerId);
                    dObj.setVisible(true);
                }
            }
        };
        pBWOFExoticFarEastViewManager.ViewManagerComponent.prototype.hide = function(scenarioId) {
            haxe.Log.trace("VIEW_MANAGER.hide() " + scenarioId, {
                fileName: "ViewManagerComponent.hx",
                lineNumber: 246,
                className: "game.viewmanager.components.ViewManagerComponent",
                methodName: "hide"
            });
            var len = this.scenarios.get(scenarioId).layers.length;
            var _g = 0;
            while (_g < len) {
                var i = _g++;
                var layerId = this.scenarios.get(scenarioId).layers[i].id;
                if (this.stage.getChildByID(layerId) != null) {
                    var dObj = this.stage.getChildByID(layerId);
                    dObj.setVisible(false);
                }
            }
        };
        pBWOFExoticFarEastViewManager.ViewManagerComponent.prototype.reset = function(scenarioId) {
            haxe.Log.trace("VIEW_MANAGER.reset() " + _hcmn_.Std.string(this.activeScenarios.get(scenarioId)), {
                fileName: "ViewManagerComponent.hx",
                lineNumber: 261,
                className: "game.viewmanager.components.ViewManagerComponent",
                methodName: "reset",
                customParams: [scenarioId]
            });
            var scenarioActive = this.activeScenarios.get(scenarioId);
            if (scenarioActive) {
                if (this.tweens.exists(scenarioId)) {
                    var _g1 = 0;
                    var _g = this.tweens.get(scenarioId).length;
                    while (_g1 < _g) {
                        var i = _g1++;
                        var tween = this.tweens.get(scenarioId)[i];
                        tween.onFinish(null);
                        tween.stop();
                        var totalTime = tween.get_totalTime();
                        tween["goto"](totalTime, false);
                        tween.onHead($bind(tween, tween.stop));
                        tween = null;
                    }
                    this.tweens.remove(scenarioId);
                }
            }
            var viewManager = this.stage.getChildByID("VIEW_MANAGER");
            viewManager.setWidth(this.stage.getWidth());
            viewManager.setHeight(this.stage.getHeight());
            var totalChildren = viewManager.getChildren().length;
            var len = viewManager.getChildren().length;
            var _g2 = 0;
            while (_g2 < len) {
                var i1 = _g2++;
                totalChildren--;
                var dObj = viewManager.getChildAt(totalChildren);
                this.stage.addChild(dObj);
            }
            if (viewManager.getMask() != null) viewManager.setMask(null);
            viewManager.setX(0);
            viewManager.setY(0);
        };
        pBWOFExoticFarEastViewManager.ViewManagerComponent.prototype.initShake = function(props) {
            var _g = this;
            var viewManager = this.stage.getChildByID("VIEW_MANAGER");
            var scenarioId = props.scenarioId;
            haxe.Log.trace("[ViewManagerComponent] [initShake] ", {
                fileName: "ViewManagerComponent.hx",
                lineNumber: 312,
                className: "game.viewmanager.components.ViewManagerComponent",
                methodName: "initShake",
                customParams: [props, this.tweens.exists(scenarioId)]
            });
            var rndX = 1;
            var rndY = 1;
            var multiplier = props.multiplier;
            var limit = props.limit;
            var step = props.step;
            var rndDestX = this.getRandomTanValue(-Math.PI / 4, _hcmn_.Math.PI / 4) * multiplier;
            var rndDestY = this.getRandomTanValue(-Math.PI / 4, _hcmn_.Math.PI / 4) * multiplier;
            var sumRndX = 0;
            var sumRndY = 0;
            var initX = viewManager.getX();
            var initY = viewManager.getY();
            var xPos = viewManager.getX();
            var yPos = viewManager.getY();
            viewManager.setX(0);
            viewManager.setY(0);
            if (!this.tweens.exists(scenarioId)) {
                var value = [];
                this.tweens.set(scenarioId, value);
                this.activeScenarios.set(scenarioId, true);
                viewManager.setWidth(this.stage.getWidth());
                viewManager.setHeight(this.stage.getHeight());
                var _g1 = 0;
                var _g2 = this.scenarios.get(scenarioId).layers.length;
                while (_g1 < _g2) {
                    var i = _g1++;
                    var layerProperties = this.scenarios.get(scenarioId).layers[i];
                    var layerId = layerProperties.id;
                    var dObj = this.stage.getChildByID(layerId);
                    viewManager.addChild(dObj);
                }
                this.tweens.get(scenarioId).push(displayEngineUtils.TweenX.to(viewManager, {}, props.time, null, null, null, null, null, null, null, {
                    fileName: "ViewManagerComponent.hx",
                    lineNumber: 352,
                    className: "game.viewmanager.components.ViewManagerComponent",
                    methodName: "initShake"
                }).ease(displayEngineUtils.EaseX.sineIn).onUpdate(function() {
                    xPos = initX + rndX;
                    yPos = initY + rndY;
                    sumRndX += rndX;
                    sumRndY += rndY;
                    viewManager.setX(xPos);
                    viewManager.setY(yPos);
                    if (_hcmn_.Math.abs(sumRndX) < _hcmn_.Math.abs(rndDestX)) rndX = _g.moveToDest(rndX, rndDestX, multiplier, step);
                    else {
                        rndX = _g.getTanValue(rndX, limit, multiplier, step);
                        if (rndX == 0) {
                            rndDestX = _g.getRandomTanValue(-Math.PI / 4, _hcmn_.Math.PI / 4) * multiplier;
                            sumRndX = 0;
                        }
                    }
                    if (_hcmn_.Math.abs(sumRndY) < _hcmn_.Math.abs(rndDestY)) rndY = _g.moveToDest(rndY, rndDestY, multiplier, step);
                    else {
                        rndY = _g.getTanValue(rndY, limit, multiplier, step);
                        if (rndY == 0) {
                            rndDestY = _g.getRandomTanValue(-Math.PI / 4, _hcmn_.Math.PI / 4) * multiplier;
                            sumRndY = 0;
                        }
                    }
                }).onFinish(function() {
                    _g.reset(scenarioId);
                    viewManager.setX(0);
                    viewManager.setY(0);
                    _g.activeScenarios.set(scenarioId, false);
                }));
                if (viewManager.getMask() != null) viewManager.setMask(null);
            }
        };
        pBWOFExoticFarEastViewManager.ViewManagerComponent.prototype.getRandomTanValue = function(min, max) {
            return _hcmn_.Math.tan(_hcmn_.Math.random() * (max - min) + min);
        };
        pBWOFExoticFarEastViewManager.ViewManagerComponent.prototype.getTanValue = function(input, limit, multiplier, step) {
            var value = input;
            if (value < -limit) value = this.getRandomTanValue(_hcmn_.Math.atan(value / multiplier), _hcmn_.Math.atan((value + step) / multiplier)) * multiplier;
            else if (value > limit) value = this.getRandomTanValue(_hcmn_.Math.atan(value / multiplier), _hcmn_.Math.atan((value - step) / multiplier)) * multiplier;
            else value = 0;
            return value;
        };
        pBWOFExoticFarEastViewManager.ViewManagerComponent.prototype.moveToDest = function(input, dest, multiplier, step) {
            var value = input;
            if (value < dest) value = this.getRandomTanValue(_hcmn_.Math.atan(value / multiplier), _hcmn_.Math.atan((value + step) / multiplier)) * multiplier;
            else value = this.getRandomTanValue(_hcmn_.Math.atan(value / multiplier), _hcmn_.Math.atan((value - step) / multiplier)) * multiplier;
            return value;
        };
        pBWOFExoticFarEastViewManager.ViewManagerComponent.prototype.getMask = function(points, paddingX, paddingY, alpha) {
            if (alpha == null) alpha = 0;
            if (paddingY == null) paddingY = 0;
            if (paddingX == null) paddingX = 0;
            var mask = this.getGraphics(points, 16711680, 0.2);
            mask.setX(paddingX);
            mask.setY(paddingY);
            return mask;
        };
        pBWOFExoticFarEastViewManager.ViewManagerComponent.prototype.getGraphics = function(points, colour, alpha) {
            if (alpha == null) alpha = 1;
            if (colour == null) colour = 16711680;
            var graphics = pBWOFExoticFarEastViewManager.ExternalService.displayProvider.getFactory().createGraphics();
            graphics.beginFill(colour, alpha);
            graphics.moveTo(points[0][0], points[0][1]);
            var _g = 0;
            while (_g < points.length) {
                var point = points[_g];
                ++_g;
                graphics.lineTo(point[0], point[1]);
            }
            graphics.endFill();
            return graphics;
        };
        pBWOFExoticFarEastViewManager.ViewManagerComponent.prototype.__class__ = pBWOFExoticFarEastViewManager.ViewManagerComponent;
        pBWOFExoticFarEastViewManager.BaseEvents = function() {
            this.choice = new _hcmn_.msignal_Signal1();
        };
        pBWOFExoticFarEastViewManager.BaseEvents.__name__ = ["pBWOFExoticFarEastViewManager", "BaseEvents"];
        pBWOFExoticFarEastViewManager.BaseEvents.prototype.choice = null;
        pBWOFExoticFarEastViewManager.BaseEvents.prototype.__class__ = pBWOFExoticFarEastViewManager.BaseEvents;
        if (typeof haxe == 'undefined') {
            var haxe = {};
        };

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

            get: function(k) {
                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 (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: pBWOFExoticFarEastViewManager,
            activator: pBWOFExoticFarEastViewManager.Activator
        };
    });
//# sourceURL=pbWofExoticFarEastViewManager.js