define("wildFuryGameController", ["BonusInfoPanelApi", "wildFuryJackpotInfoPanelApi", "componentmodelComponentApi", "translationmanagerApi", "clientkernelLoaderApi", "slotModelApi", "winMeterApi", "PickerApi", "reelsApi", "soundManagerApi", "gameLayoutApi", "wildFuryAnimationPort", "wildFuryWinLinesApi", "PopupApi", "clientkernelEventbusApi", "stateMachineEngine", "infoBarApi", "backgroundApi", "clientkernelModulesApi", "tools", "wildFuryPluginApi", "paytableApi", "betPanelApi", "clientkernelLoggerApi", "wildFuryComponentsGameControllerDeclaration", "moneyApi"],
    function(BonusInfoPanelApi, wildFuryJackpotInfoPanelApi, componentmodelComponentApi, translationmanagerApi, clientkernelLoaderApi, slotModelApi, winMeterApi, PickerApi, reelsApi, soundManagerApi, gameLayoutApi, wildFuryAnimationPort, wildFuryWinLinesApi, PopupApi, clientkernelEventbusApi, stateMachineEngine, infoBarApi, backgroundApi, clientkernelModulesApi, tools, wildFuryPluginApi, paytableApi, betPanelApi, clientkernelLoggerApi, wildFuryComponentsGameControllerDeclaration, moneyApi) {
        "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 _List == 'undefined') {
            var _List = {};
        };
        _List.ListIterator = function(head) {
            this.head = head;
            this.val = null;
        };
        _List.ListIterator.__name__ = ["_List", "ListIterator"];
        _List.ListIterator.prototype.head = null;
        _List.ListIterator.prototype.val = null;
        _List.ListIterator.prototype.hasNext = function() {
            return this.head != null;
        };
        _List.ListIterator.prototype.next = function() {
            this.val = this.head[0];
            this.head = this.head[1];
            return this.val;
        };
        _List.ListIterator.prototype.__class__ = _List.ListIterator;
        if (typeof wildFuryGameController == 'undefined') {
            var wildFuryGameController = {};
        };
        wildFuryGameController.Activator = function() {};
        wildFuryGameController.Activator = ck_implements(wildFuryGameController.Activator, clientkernelModulesApi.IModuleActivator);
        wildFuryGameController.Activator.__interfaces__ = [clientkernelModulesApi.IModuleActivator];
        wildFuryGameController.Activator.__name__ = ["wildFuryGameController", "Activator"];
        wildFuryGameController.Activator.prototype.start = function(context) {
            context.getServiceTracker([translationmanagerApi.ITranslationManager, moneyApi.IMoneyFormatter]).then(function(context1) {
                wildFuryGameController.ExternalService.initialize(context1);
                context1.registerService(new wildFuryGameController.Factory(), wildFuryComponentsGameControllerDeclaration.GameControllerDeclaration, null);
            });
        };
        wildFuryGameController.Activator.prototype.stop = function(context) {};
        wildFuryGameController.Activator.main = function() {};
        wildFuryGameController.Activator.prototype.__class__ = wildFuryGameController.Activator;
        wildFuryGameController.AnimationConditions = function() {};
        wildFuryGameController.AnimationConditions.__name__ = ["wildFuryGameController", "AnimationConditions"];
        wildFuryGameController.AnimationConditions.prototype.__class__ = wildFuryGameController.AnimationConditions;
        wildFuryGameController.AutoplayController = function(infoBarControl, betPanelControl, slotModelPort) {
            this.settingsOpened = false;
            this.stopAvailable = false;
            this.startAvailable = false;
            this.lastSpin = false;
            this.active = false;
            this.infoBarControl = infoBarControl;
            this.betPanelControl = betPanelControl;
            this.slotModelPort = slotModelPort;
            slotModelPort.getStages().getIdleStage().getAutoSpinStarted().subscribe($bind(this, this.onAutoSpinStartedListener));
            slotModelPort.getStages().getIdleStage().getAutoSpinsStopped().subscribe($bind(this, this.onAutoSpinStoppedListener));
            slotModelPort.getGameCommands().getStartAutoSpinsCommandAvailable().subscribe($bind(this, this.onEnableAutoSpinListener));
            slotModelPort.getGameCommands().getStopAutoSpinsCommandAvailable().subscribe($bind(this, this.onStopAvailableListener));
            betPanelControl.onButtonPressed($bind(this, this.onAutoplayPressed), betPanelApi.EButton.AUTO_PLAY_BUTTON_PLAY);
        };
        wildFuryGameController.AutoplayController.__name__ = ["wildFuryGameController", "AutoplayController"];
        wildFuryGameController.AutoplayController.prototype.active = null;
        wildFuryGameController.AutoplayController.prototype.lastSpin = null;
        wildFuryGameController.AutoplayController.prototype.startAvailable = null;
        wildFuryGameController.AutoplayController.prototype.stopAvailable = null;
        wildFuryGameController.AutoplayController.prototype.settingsOpened = null;
        wildFuryGameController.AutoplayController.prototype.infoBarControl = null;
        wildFuryGameController.AutoplayController.prototype.betPanelControl = null;
        wildFuryGameController.AutoplayController.prototype.slotModelPort = null;
        wildFuryGameController.AutoplayController.prototype.autoSpinsCommandAvailableCallback = null;
        wildFuryGameController.AutoplayController.prototype.onAutoplayPressed = function(e) {
            this.settingsOpened = true;
        };
        wildFuryGameController.AutoplayController.prototype.onEnableAutoSpinListener = function(e) {
            if (this.autoSpinsCommandAvailableCallback != null) this.autoSpinsCommandAvailableCallback(e);
            this.startAvailable = e.getPayload();
            if (this.settingsOpened && this.startAvailable) {
                wildFuryGameController.ExternalService.busChanel.publish("autospin:onCloseClicked", "");
                this.settingsOpened = false;
            }
            this.updateButtonState();
        };
        wildFuryGameController.AutoplayController.prototype.onAutoSpinStartedListener = function(e) {
            this.settingsOpened = false;
            this.infoBarControl.hideAll();
            var autoSpinInfo = e.getPayload();
            this.active = true;
            this.lastSpin = autoSpinInfo.current == autoSpinInfo.total;
            var firstSpin = autoSpinInfo.current == 1;
            this.updateButtonState();
            this.betPanelControl.setNumberOffAutoSpinsLeft(autoSpinInfo.current + " / " + autoSpinInfo.total);
            if (firstSpin) wildFuryGameController.ExternalService.busChanel.publish("game::autoSpinStart", null);
        };
        wildFuryGameController.AutoplayController.prototype.onAutoSpinsCommandAvailable = function(callback) {
            this.autoSpinsCommandAvailableCallback = callback;
        };
        wildFuryGameController.AutoplayController.prototype.onAutoSpinStoppedListener = function(e) {
            wildFuryGameController.ExternalService.busChanel.publish("game::autoSpinEnd", null);
            this.active = false;
            this.lastSpin = false;
            this.updateButtonState();
        };
        wildFuryGameController.AutoplayController.prototype.onStopAvailableListener = function(e) {
            this.stopAvailable = e.getPayload();
            this.updateButtonState();
        };
        wildFuryGameController.AutoplayController.prototype.updateButtonState = function() {
            var isNeedShowAutoPlayBtn = this.active && this.stopAvailable || !this.active && this.startAvailable;
            this.setPlayStopButtonState(this.active);
            this.showAutoPlayBtn(isNeedShowAutoPlayBtn);
        };
        wildFuryGameController.AutoplayController.prototype.showAutoPlayBtn = function(value) {
            this.betPanelControl.enableButton(betPanelApi.EButton.AUTO_PLAY_BUTTON, value);
        };
        wildFuryGameController.AutoplayController.prototype.setPlayStopButtonState = function(active) {
            var autoplayButtonState;
            if (active) autoplayButtonState = betPanelApi.SetAutoPlayButtonState.STOP_BUTTON_STATE;
            else autoplayButtonState = betPanelApi.SetAutoPlayButtonState.PLAY_BUTTON_STATE;
            this.betPanelControl.setAutoPlayButtonState(autoplayButtonState);
        };
        wildFuryGameController.AutoplayController.prototype.enableAutoplayButton = function() {
            if (this.startAvailable) this.betPanelControl.enableButton(betPanelApi.EButton.AUTO_PLAY_BUTTON);
        };
        wildFuryGameController.AutoplayController.prototype.stopAutoSpins = function() {
            if (this.active) this.slotModelPort.getGameCommands().getStopAutoSpinsCommandExecuted().publish(null);
        };
        wildFuryGameController.AutoplayController.prototype.isActive = function() {
            return this.active;
        };
        wildFuryGameController.AutoplayController.prototype.isLastSpin = function() {
            return this.lastSpin;
        };
        wildFuryGameController.AutoplayController.prototype.forceStopAutoSpins = function() {
            if (this.active) {
                this.slotModelPort.getGameCommands().getStopAutoSpinsCommandExecuted().publish(null);
                this.active = false;
                this.updateButtonState();
            }
        };
        wildFuryGameController.AutoplayController.prototype.__class__ = wildFuryGameController.AutoplayController;
        wildFuryGameController.ExternalService = function() {};
        wildFuryGameController.ExternalService.__name__ = ["wildFuryGameController", "ExternalService"];
        wildFuryGameController.ExternalService.bus = null;
        wildFuryGameController.ExternalService.busChanel = null;
        wildFuryGameController.ExternalService.gameChanel = null;
        wildFuryGameController.ExternalService.assetRegistry = null;
        wildFuryGameController.ExternalService.moneyFormatter = null;
        wildFuryGameController.ExternalService.moneyValueProvider = null;
        wildFuryGameController.ExternalService.variableRegistry = null;
        wildFuryGameController.ExternalService.logger = null;
        wildFuryGameController.ExternalService.moduleContext = null;
        wildFuryGameController.ExternalService.initialize = function(context) {
            wildFuryGameController.ExternalService.moduleContext = context;
            wildFuryGameController.ExternalService.bus = context.getAnyService(clientkernelEventbusApi.IEventBus, null);
            wildFuryGameController.ExternalService.busChanel = wildFuryGameController.ExternalService.bus.getChannel("GFBus");
            wildFuryGameController.ExternalService.assetRegistry = context.getAnyService(clientkernelLoaderApi.IAssetRegistry, null);
            wildFuryGameController.ExternalService.moneyFormatter = context.getAnyService(moneyApi.IMoneyFormatter, null);
            wildFuryGameController.ExternalService.moneyValueProvider = new tools.MoneyValueProvider(wildFuryGameController.ExternalService.moneyFormatter);
            wildFuryGameController.ExternalService.variableRegistry = context.getAnyService(clientkernelLoaderApi.IVariableRegistry, null);
            var loggerFactory = context.getAnyService(clientkernelLoggerApi.ILoggerFactory, null);
            wildFuryGameController.ExternalService.logger = loggerFactory.getDefaultLogger();
        };
        wildFuryGameController.ExternalService.getTranslationService = function() {
            return wildFuryGameController.ExternalService.moduleContext.getAnyService(translationmanagerApi.ITranslationManager);
        };
        wildFuryGameController.ExternalService.isMobile = function() {
            return wildFuryGameController.ExternalService.variableRegistry.get("skin") == "mobile" || wildFuryGameController.ExternalService.variableRegistry.get("assetPack") == "mobile";
        };
        wildFuryGameController.ExternalService.prototype.__class__ = wildFuryGameController.ExternalService;
        wildFuryGameController.Factory = function() {};
        wildFuryGameController.Factory = ck_implements(wildFuryGameController.Factory, clientkernelModulesApi.IService);
        wildFuryGameController.Factory = ck_implements(wildFuryGameController.Factory, componentmodelComponentApi.IComponentFactory);
        wildFuryGameController.Factory.__interfaces__ = [clientkernelModulesApi.IService, componentmodelComponentApi.IComponentFactory];
        wildFuryGameController.Factory.__name__ = ["wildFuryGameController", "Factory"];
        wildFuryGameController.Factory.prototype.stateMachine = null;
        wildFuryGameController.Factory.prototype.smDispatcher = null;
        wildFuryGameController.Factory.prototype.smContext = null;
        wildFuryGameController.Factory.prototype.createComponent = function(context) {
            var _g = this;
            var gameController;
            this.setupStateMachineContext();
            gameController = new wildFuryGameController.GameController(context, wildFuryGameController.ExternalService.logger, this.stateMachine, this.smDispatcher, this.smContext);
            new wildFuryGameController.SoundController(context, wildFuryGameController.ExternalService.assetRegistry, wildFuryGameController.ExternalService.logger, [wildFuryGameController.ExternalService.busChanel]);
            this.smContext.setupContextData(gameController);
            new components.gamecontroller.impl.GameLoader(context).load(function(loader) {
                loader.apply(gameController);
                _g.setupStateMachine();
            });
        };
        wildFuryGameController.Factory.prototype.getComponentDeclaration = function() {
            return wildFuryComponentsGameControllerDeclaration.GameControllerDeclaration;
        };
        wildFuryGameController.Factory.prototype.setupStateMachineContext = function() {
            this.smDispatcher = new stateMachineEngine.EventDispatcher();
            this.smContext = new wildFuryGameController.StateMachineContext(this.smDispatcher);
            this.stateMachine = new stateMachineEngine.StateMachine(this.smDispatcher, wildFuryGameController.StateMachineDef.ID);
            this.stateMachine.logLevel = 3;
            this.stateMachine.logPrefix = "[GAME_CONTROLLER]";
            this.stateMachine.dispatchGlobalStateChange = false;
        };
        wildFuryGameController.Factory.prototype.setupStateMachine = function() {
            this.stateMachine.setContext(this.smContext);
            stateMachineEngine.StateMachine.logger = wildFuryGameController.ExternalService.logger;
            stateMachineEngine.FSMInjector.registerSM(this.stateMachine, wildFuryGameController.StateMachineDef.FSM);
        };
        wildFuryGameController.Factory.prototype.__class__ = wildFuryGameController.Factory;
        if (typeof components == 'undefined') {
            var components = {};
        };
        if (!components.gamecontroller) {
            components.gamecontroller = {};
        };
        if (!components.gamecontroller.impl) {
            components.gamecontroller.impl = {};
        };
        components.gamecontroller.impl.GameLoader = function(context) {
            this.winAnimationsCollector = new wildFuryGameController.StringsConditionsCollector();
            this.gameLoadingCollector = new wildFuryGameController.EnumConditionsCollector(wildFuryGameController.GameLoadCriteria);
            this.context = context;
            var betPanelPort = context.getUsedPort(betPanelApi.IBetPanelPort);
            var reelsPort = context.getUsedPort(reelsApi.IReelsPort);
            this.slotModelPort = context.getUsedPort(slotModelApi.ISlotModelPort);
            this.jackpotPanelPort = context.getUsedPort(wildFuryJackpotInfoPanelApi.JackpotInfoPanelPort);
            var infoBarPort = context.getUsedPort(infoBarApi.IInfoBarPort);
            this.infoBarControl = new wildFuryGameController.InfoBarControl(infoBarPort);
            this.reelsControl = new wildFuryGameController.ReelsControl(reelsPort);
            this.betPanelControl = new wildFuryGameController.BetPanelControl(betPanelPort);
            this.animationsPort = context.getUsedPort(wildFuryAnimationPort.IAnimationPort);
            this.winLinesPort = context.getUsedPort(wildFuryWinLinesApi.IWinLinesPort);
            this.popupPort = context.getUsedPort(PopupApi.IPopupPort);
            this.pickerPort = context.getUsedPort(PickerApi.IPickerPort);
            this.bonusInfoPanel = context.getUsedPort(BonusInfoPanelApi.IBonusInfoPanelPort);
            var winMeterPort = context.getUsedPort(winMeterApi.IWinMeterPort);
            var paytablePort = context.getUsedPort(paytableApi.IPaytablePort);
            this.paytableControl = new wildFuryGameController.PaytableControl(paytablePort);
            var backgroundPort = context.getUsedPort(backgroundApi.IBackgroundPort);
            this.backgroundControl = new wildFuryGameController.BackgroundControl(backgroundPort);
            this.model = new wildFuryGameController.GameModel();
            this.winMeterControl = new wildFuryGameController.WinMeterControl(winMeterPort, this.model);
        };
        components.gamecontroller.impl.GameLoader.__name__ = ["components", "gamecontroller", "impl", "GameLoader"];
        components.gamecontroller.impl.GameLoader.prototype.winMeterControl = null;
        components.gamecontroller.impl.GameLoader.prototype.winParticleControl = null;
        components.gamecontroller.impl.GameLoader.prototype.popupPort = null;
        components.gamecontroller.impl.GameLoader.prototype.pickerPort = null;
        components.gamecontroller.impl.GameLoader.prototype.animationsPort = null;
        components.gamecontroller.impl.GameLoader.prototype.paytableControl = null;
        components.gamecontroller.impl.GameLoader.prototype.winLinesPort = null;
        components.gamecontroller.impl.GameLoader.prototype.jackpotPanelPort = null;
        components.gamecontroller.impl.GameLoader.prototype.slotModelPort = null;
        components.gamecontroller.impl.GameLoader.prototype.infoBarControl = null;
        components.gamecontroller.impl.GameLoader.prototype.reelsControl = null;
        components.gamecontroller.impl.GameLoader.prototype.betPanelControl = null;
        components.gamecontroller.impl.GameLoader.prototype.bonusInfoPanel = null;
        components.gamecontroller.impl.GameLoader.prototype.backgroundControl = null;
        components.gamecontroller.impl.GameLoader.prototype.model = null;
        components.gamecontroller.impl.GameLoader.prototype.gameLoadingCollector = null;
        components.gamecontroller.impl.GameLoader.prototype.winAnimationsCollector = null;
        components.gamecontroller.impl.GameLoader.prototype.context = null;
        components.gamecontroller.impl.GameLoader.prototype.load = function(callbackFunction) {
            var _g = this;
            this.gameLoadingCollector.then(function() {
                _g.slotModelPort.getStages().getInitStage().getGameLoaded().publish(null);
                callbackFunction(_g);
            });
            this.context.getStarted().then(function(a) {
                _g.gameLoadingCollector.resolveCondition(wildFuryGameController.GameLoadCriteria.ASSEMBLY_STARTED);
            });
            wildFuryGameController.ExternalService.assetRegistry.getAsset("game-config_json").getContent().then(function(data) {
                _g.gameLoadingCollector.resolveCondition(wildFuryGameController.GameLoadCriteria.CONFIG_LOADED);
                _g.model.setGameConfig(data.gameControllerConfig);
                _g.winParticleControl = new wildFuryGameController.WinParticlesControl(_g.winMeterControl, _g.animationsPort, _g.model.config.winParticlesConfig);
            });
            var gameLayoutPort = this.context.getUsedPort(gameLayoutApi.IGameLayoutPort);
            gameLayoutPort.getGameLayoutUpdated().subscribe($bind(this, this.onGameLayoutUpdated));
        };
        components.gamecontroller.impl.GameLoader.prototype.apply = function(controller) {
            controller.applyComponent(this.model, this.bonusInfoPanel, this.pickerPort, this.popupPort, this.animationsPort, this.winLinesPort, this.slotModelPort, this.backgroundControl, this.paytableControl, this.infoBarControl, this.reelsControl, this.betPanelControl, this.jackpotPanelPort, this.winMeterControl, this.winParticleControl, this.winAnimationsCollector);
        };
        components.gamecontroller.impl.GameLoader.prototype.onGameLayoutUpdated = function(event) {
            this.gameLoadingCollector.resolveCondition(wildFuryGameController.GameLoadCriteria.LAYOUT_UPDATED);
        };
        components.gamecontroller.impl.GameLoader.prototype.__class__ = components.gamecontroller.impl.GameLoader;
        wildFuryGameController.BaseGameController = function(logger, stateMachine, smDispatcher, smContext) {
            this.winAnimationsCollector = new wildFuryGameController.StringsConditionsCollector();
            this.stateMachine = stateMachine;
            this.smDispatcher = smDispatcher;
            this.smContext = smContext;
            this.logger = logger;
        };
        wildFuryGameController.BaseGameController.__name__ = ["wildFuryGameController", "BaseGameController"];
        wildFuryGameController.BaseGameController.prototype.model = null;
        wildFuryGameController.BaseGameController.prototype.translationManager = null;
        wildFuryGameController.BaseGameController.prototype.moneyFormatter = null;
        wildFuryGameController.BaseGameController.prototype.stateMachine = null;
        wildFuryGameController.BaseGameController.prototype.smDispatcher = null;
        wildFuryGameController.BaseGameController.prototype.smContext = null;
        wildFuryGameController.BaseGameController.prototype.logger = null;
        wildFuryGameController.BaseGameController.prototype.winLinesPort = null;
        wildFuryGameController.BaseGameController.prototype.animationsPort = null;
        wildFuryGameController.BaseGameController.prototype.popupPort = null;
        wildFuryGameController.BaseGameController.prototype.pickerPort = null;
        wildFuryGameController.BaseGameController.prototype.bonusInfoPanel = null;
        wildFuryGameController.BaseGameController.prototype.slotModelPort = null;
        wildFuryGameController.BaseGameController.prototype.paytableControl = null;
        wildFuryGameController.BaseGameController.prototype.infoBarControl = null;
        wildFuryGameController.BaseGameController.prototype.winMeterControl = null;
        wildFuryGameController.BaseGameController.prototype.winParticleControl = null;
        wildFuryGameController.BaseGameController.prototype.winAnimationsCollector = null;
        wildFuryGameController.BaseGameController.prototype.reelsControl = null;
        wildFuryGameController.BaseGameController.prototype.betPanelControl = null;
        wildFuryGameController.BaseGameController.prototype.backgroundControl = null;
        wildFuryGameController.BaseGameController.prototype.reelMaskFlowControl = null;
        wildFuryGameController.BaseGameController.prototype.jackpotPanelPort = null;
        wildFuryGameController.BaseGameController.prototype.applyComponent = function(model, bonusInfoPanel, pickerPort, popupPort, animationsPort, winLinesPort, slotModelPort, backgroundControl, paytableControl, infoBarControl, reelsControl, betPanelControl, jackpotPanelPort, winMeterControl, winParticleControl, winAnimationsCollector) {
            this.model = model;
            this.backgroundControl = backgroundControl;
            this.bonusInfoPanel = bonusInfoPanel;
            this.pickerPort = pickerPort;
            this.popupPort = popupPort;
            this.animationsPort = animationsPort;
            this.winLinesPort = winLinesPort;
            this.slotModelPort = slotModelPort;
            this.paytableControl = paytableControl;
            this.infoBarControl = infoBarControl;
            this.reelsControl = reelsControl;
            this.betPanelControl = betPanelControl;
            this.jackpotPanelPort = jackpotPanelPort;
            this.winMeterControl = winMeterControl;
            this.winParticleControl = winParticleControl;
            this.winAnimationsCollector = winAnimationsCollector;
            this.translationManager = wildFuryGameController.ExternalService.getTranslationService();
            this.moneyFormatter = wildFuryGameController.ExternalService.moneyFormatter;
            this.reelMaskFlowControl = new wildFuryGameController.ReelMaskFlowControl(animationsPort, model);
        };
        wildFuryGameController.BaseGameController.prototype.dispatchEvent = function(action) {
            this.smDispatcher.dispatchEvent(new stateMachineEngine.StateEvent(wildFuryGameController.StateMachineDef.ID + stateMachineEngine.StateEvent.ACTION, action));
        };
        wildFuryGameController.BaseGameController.prototype.displayWin = function(instanShow) {
            if (instanShow == null) instanShow = false;
            var payout = this.model.getPayout();
            if (payout.isZero()) {
                this.winMeterControl.clear();
                this.winAnimationsCollector.resolveCondition("meterFinished");
            } else {
                this.winAnimationsCollector.addCondition("meterFinished");
                this.winMeterControl.displayWin(payout.asString(), this.model.getWinSegments(), instanShow, null);
            }
        };
        wildFuryGameController.BaseGameController.prototype.showGamePaysMessage = function() {
            var payout = this.model.getPayout().format();
            var message = this.translationManager.stringLookup("InfoBarGamePays", [payout]);
            this.infoBarControl.showRightLabel(message);
        };
        wildFuryGameController.BaseGameController.prototype.publishSpinOutcomePresented = function() {
            this.slotModelPort.getStages().getSpinStage().getOutcomePhase().getSpinOutcomePresented().publish(null);
        };
        wildFuryGameController.BaseGameController.prototype.showSkipButton = function(isEnable) {
            if (isEnable == null) isEnable = true;
            this.betPanelControl.showButton(betPanelApi.EButton.SKIP);
            this.betPanelControl.enableButton(betPanelApi.EButton.SKIP, isEnable);
            this.betPanelControl.hideButton(betPanelApi.EButton.SPIN);
        };
        wildFuryGameController.BaseGameController.prototype.showSpinButton = function(isEnable) {
            if (isEnable == null) isEnable = true;
            this.betPanelControl.showButton(betPanelApi.EButton.SPIN);
            this.betPanelControl.enableButton(betPanelApi.EButton.SPIN, isEnable);
            this.betPanelControl.hideButton(betPanelApi.EButton.SKIP);
        };
        wildFuryGameController.BaseGameController.prototype.hideWinAnimation = function(resetMask) {
            if (resetMask == null) resetMask = true;
            this.winLinesPort.hide();
            if (resetMask) this.reelMaskFlowControl.resetMask();
        };
        wildFuryGameController.BaseGameController.prototype.__class__ = wildFuryGameController.BaseGameController;
        wildFuryGameController.GameController = function(context, logger, stateMachine, smDispatcher, smContext) {
            this.betPanelStakeChangedTimeoutId = 0;
            this.winLinesWaitingToShow = false;
            this.paytableOpened = false;
            this.resultPresentedPublished = false;
            wildFuryGameController.BaseGameController.call(this, logger, stateMachine, smDispatcher, smContext);
            logger.info("[GAME_CONTROLLER] STARTED");
            this.context = context;
        };
        wildFuryGameController.GameController.__name__ = ["wildFuryGameController", "GameController"];
        wildFuryGameController.GameController.__super__ = wildFuryGameController.BaseGameController;
        for (var k in wildFuryGameController.BaseGameController.prototype) wildFuryGameController.GameController.prototype[k] = wildFuryGameController.BaseGameController.prototype[k];
        wildFuryGameController.GameController.prototype.context = null;
        wildFuryGameController.GameController.prototype.resultPresentedPublished = null;
        wildFuryGameController.GameController.prototype.stopSpinRecieved = null;
        wildFuryGameController.GameController.prototype.paytableOpened = null;
        wildFuryGameController.GameController.prototype.winLinesWaitingToShow = null;
        wildFuryGameController.GameController.prototype.autoplayController = null;
        wildFuryGameController.GameController.prototype.promoSpinsControl = null;
        wildFuryGameController.GameController.prototype.betPanelStakeChangedTimeoutId = null;
        wildFuryGameController.GameController.prototype.promoTimeout = null;
        wildFuryGameController.GameController.prototype.publishGameLoaded = function() {
            this.slotModelPort.getStages().getInitStage().getGameLoaded().publish(null);
        };
        wildFuryGameController.GameController.prototype.attachComponents = function() {
            this.logger.info(this.stateMachine.logPrefix + " attachComponents");
            this.autoplayController = new wildFuryGameController.AutoplayController(this.infoBarControl, this.betPanelControl, this.slotModelPort);
            this.promoSpinsControl = new wildFuryGameController.PromoFreeSpinsFlowControl(this.infoBarControl, this.betPanelControl, this.translationManager);
            this.slotModelPort.getGameContext().getBalance().subscribe($bind(this, this.onBalanceUpdate));
            this.slotModelPort.getStages().getInitStage().getInitializeGamePhase().getInitializeGame().subscribe($bind(this, this.onSlotModelInitGame));
            this.slotModelPort.getStages().getResumeStage().getPrepareResume().subscribe($bind(this, this.onPrepareResume));
            this.slotModelPort.getStages().getIdleStage().getConfirmSelectedStake().subscribe($bind(this, this.onConfirmSelectedStake));
            this.slotModelPort.getStages().getIdleStage().getOpenPaytable().subscribe($bind(this, this.onOpenPaytable));
            this.slotModelPort.getStages().getIdleStage().getOpenHelp().subscribe($bind(this, this.onOpenHelp));
            this.slotModelPort.getStages().getSpinStage().getStartReelSpin().subscribe($bind(this, this.onModelSpinStart));
            this.slotModelPort.getStages().getSpinStage().getOutcomePhase().getSpinOutcome().subscribe($bind(this, this.onSpinOutcome));
            this.slotModelPort.getStages().getSpinStage().getStopReelSpin().subscribe($bind(this, this.onModelSpinStop));
            this.slotModelPort.getStages().getSpinStage().getOutcomePhase().getPresentSpinOutcome().subscribe($bind(this, this.onSpinOutcomePresent));
            this.slotModelPort.getStages().getAbortStage().getAbortSpin().subscribe($bind(this, this.onAbortSpin));
            this.slotModelPort.getStages().getPickerBonusStage().getSelectPickerBonus().subscribe($bind(this, this.onSelectPickerBonus));
            this.slotModelPort.getStages().getPickerBonusStage().getSetPickerIdle().subscribe($bind(this, this.onSetPickerIdle));
            this.slotModelPort.getStages().getResultStage().getPresentResult().subscribe($bind(this, this.onPresentResult));
            this.slotModelPort.getGameCommands().getSpinCommandAvailable().subscribe($bind(this, this.onSpinCommandAvailable));
            this.slotModelPort.getGameCommands().getContinueCommandAvailable().subscribe($bind(this, this.onContinueCommandAvailable));
            this.slotModelPort.getGameCommands().getStakeCommandAvailable().subscribe($bind(this, this.onStakeCommandAvailable));
            this.autoplayController.onAutoSpinsCommandAvailable($bind(this, this.onAutoSpinsCommandAvailable));
            this.betPanelControl.onButtonPressed($bind(this, this.onAutoplayPressed), betPanelApi.EButton.AUTO_PLAY_BUTTON_PLAY);
            this.betPanelControl.onButtonPressed($bind(this, this.onAutoplayStopPressed), betPanelApi.EButton.AUTO_PLAY_BUTTON_STOP);
            this.betPanelControl.onButtonPressed($bind(this, this.onSpinButtonPressed), betPanelApi.EButton.SPIN);
            this.betPanelControl.onButtonPressed($bind(this, this.onSkipButtonPressed), betPanelApi.EButton.SKIP);
            this.betPanelControl.onButtonPressed($bind(this, this.onSoundButtonPressed), betPanelApi.EButton.SOUND_OFF);
            this.betPanelControl.onButtonPressed($bind(this, this.onSoundButtonPressed), betPanelApi.EButton.SOUND_ON);
            this.betPanelControl.onButtonPressed($bind(this, this.onPaytableButtonPressed), betPanelApi.EButton.PAYTABLE);
            wildFuryGameController.ExternalService.busChanel.subscribe("betpanel:uiClicked", $bind(this, this.onBetButtonPressed));
            this.betPanelControl.onStakeChanged($bind(this, this.onBetPanelStakeChanged));
            this.reelsControl.onReelStopped($bind(this, this.onReelStopped));
            this.reelsControl.onSpinStopped($bind(this, this.onSpinStopped));
            this.reelsControl.onStartSpinReelPictureExit($bind(this, this.onStartSpinReelPictureExit));
            this.winLinesPort.getWinLineShown().subscribe($bind(this, this.onHideReels));
            this.winLinesPort.getWinLineShow().subscribe($bind(this, this.onShowReels));
            this.winLinesPort.getWinPresent().subscribe($bind(this, this.onWinLinesWinPresent));
            this.winLinesPort.getWinLineCyclePlayed().subscribe($bind(this, this.onWinLineCyclePlayed));
            this.winLinesPort.getExpandsShown().subscribe($bind(this, this.onExpandsShown));
            this.winLinesPort.getExpandCompleted().subscribe($bind(this, this.onExpandsShown));
            this.jackpotPanelPort.getAnimationCompleted().subscribe($bind(this, this.onJackpotAnimationCompleted));
            this.winMeterControl.onDisplayWinFinished($bind(this, this.onDisplayWinMeterFinished));
            this.winMeterControl.onBigAnimationStart($bind(this, this.onBigWinMeterStart));
            this.winMeterControl.onMediumAnimationStart($bind(this, this.onMediumAnimationStart));
            this.paytableControl.onPaytableClose($bind(this, this.onPaytableCloseBtn));
            this.popupPort.getPopupShown().subscribe($bind(this, this.onPopupShown));
            this.pickerPort.getWheelStopped().subscribe($bind(this, this.onWheelStopped));
            this.pickerPort.getWheelStarted().subscribe($bind(this, this.onWheelStarted));
            this.pickerPort.onSpinPressed(($_ = this.pickerPort, $bind($_, $_.start)));
            this.animationsPort.getAllSymbolsFlightComplete().subscribe($bind(this, this.onCounterUpdated));
        };
        wildFuryGameController.GameController.prototype.init = function() {
            this.initHotKeys();
            this.betPanelControl.hideButton(betPanelApi.EButton.SKIP);
            var freespinWheelStrip = wildFuryPluginApi.WheelStripsData.getWheelStrips();
            this.pickerPort.initWheelStrips(freespinWheelStrip);
        };
        wildFuryGameController.GameController.prototype.initGame = function() {
            this.init();
            this.slotModelPort.getStages().getInitStage().getGameInitialized().publish(null);
            this.model.resetJackpotLevel();
            this.jackpotPanelPort.show(this.model.getJackpotPanelPayload(false));
            this.showPromoWithDelay();
        };
        wildFuryGameController.GameController.prototype.resumePromoMessages = function() {
            this.promoTimeout = window.setTimeout($bind(this, this.resumePromo), this.model.config.delayBeforePromo);
        };
        wildFuryGameController.GameController.prototype.showPromo = function() {
            window.clearTimeout(this.promoTimeout);
            this.animationsPort.showPromo();
        };
        wildFuryGameController.GameController.prototype.handlePromoInSpin = function() {
            if (this.model.isBonusGame()) this.hidePromo();
            else this.pausePromo();
        };
        wildFuryGameController.GameController.prototype.pausePromo = function() {
            window.clearTimeout(this.promoTimeout);
            this.animationsPort.pausePromo();
        };
        wildFuryGameController.GameController.prototype.resumePromo = function() {
            window.clearTimeout(this.promoTimeout);
            this.animationsPort.resumePromo();
        };
        wildFuryGameController.GameController.prototype.hidePromo = function() {
            window.clearTimeout(this.promoTimeout);
            this.animationsPort.hidePromo();
        };
        wildFuryGameController.GameController.prototype.onSetPickerIdle = function(e) {
            if (this.model.abortSpinPayload == null) this.dispatchEvent(wildFuryGameController.StateMachineDef.SET_PICKER_IDLE);
        };
        wildFuryGameController.GameController.prototype.prepareResume = function() {
            this.showSpinButton(false);
            this.betPanelControl.disableButton(betPanelApi.EButton.AUTO_PLAY_BUTTON);
            this.betPanelControl.disableButton(betPanelApi.EButton.TOTAL_BET);
            this.updateReelPicture();
            if (this.model.getCurrentFreespinIndex() == 0) this.winMeterControl.displayWin(this.model.getBaseGameTotalPayout().asString(), [], true);
            else this.winMeterControl.displayWin(this.model.getAccumulatedPayout().asString(), [], true);
            if (this.model.isBonusGame() || this.model.bonusIsNext()) {
                var level = this.model.jackpotData.jackpotLevel;
                this.backgroundControl.show(this.model.getGameBackgroung(level + ""));
                this.jackpotPanelPort.show(this.model.getJackpotPanelPayload(false));
                this.bonusInfoPanel.updateJackpotLevel(_hcmn_.Std.parseInt(level));
                this.bonusInfoPanel.show([this.model.freeSpinsCountDown, this.model.wildsCollected]);
            } else this.switchJackpotPanelToBase();
            this.promoSpinsControl.deactivate();
            this.slotModelPort.getStages().getResumeStage().getResumePrepared().publish(null);
        };
        wildFuryGameController.GameController.prototype.onBaseGameIdle = function() {
            this.showSpinButton();
            this.resultPresentedPublished = false;
            if (!this.autoplayController.isActive()) this.showCentralLabel("InfoBarIdle");
        };
        wildFuryGameController.GameController.prototype.updateBetPanel = function() {
            this.updateCentralLabelVisibility();
            this.hideNoCenterLabels();
        };
        wildFuryGameController.GameController.prototype.hideNoCenterLabels = function() {
            this.infoBarControl.hideWinLineSummary();
            this.infoBarControl.hideLeftLabel();
            this.infoBarControl.hideRightLabel();
        };
        wildFuryGameController.GameController.prototype.clearAllWins = function() {
            this.model.abortSpinPayload = null;
            this.resultPresentedPublished = false;
            this.showSpinButton(false);
            this.updateWinMeterValue();
            this.stopSpinRecieved = false;
        };
        wildFuryGameController.GameController.prototype.startSpin = function() {
            if (this.paytableOpened) this.onOpenPaytable(null);
            this.bonusInfoPanel.updateFreeSpinsCounter(this.model.freeSpinsCountDown);
            this.handlePromoInSpin();
            this.hidePopup();
            this.hideWinAnimation();
            this.forcePaytableClose();
            this.reelsControl.startSpin(this.model.startSpinPayload);
            this.showCentralLabel("GoodLuck");
            this.model.isBonusSummary = false;
            this.betPanelControl.setCustomButtonState(betPanelApi.EButton.SPIN, betPanelApi.CustomButtonStatePayload.CONNECTING_STATE);
        };
        wildFuryGameController.GameController.prototype.collectExpandingConditions = function() {
            this.winAnimationsCollector = new wildFuryGameController.StringsConditionsCollector().then($bind(this, this.publishPresentSpinOutcome));
            if (this.model.hasExpand()) {
                this.winAnimationsCollector.addCondition("REELS_STOPPED");
                var _g = 0;
                while (_g < 5) {
                    var i = _g++;
                    this.winAnimationsCollector.addCondition("expanding_animatorFinished" + i);
                }
            } else this.winAnimationsCollector.addCondition("expanding_animatorFinished", true);
        };
        wildFuryGameController.GameController.prototype.checkForStopOrAbort = function() {
            if (this.model.abortSpinPayload != null) this.dispatchEvent(wildFuryGameController.StateMachineDef.ABORT_SPIN);
            else if (this.stopSpinRecieved) this.dispatchEvent(wildFuryGameController.StateMachineDef.STOP_REEL_SPIN);
        };
        wildFuryGameController.GameController.prototype.applyAbortData = function() {
            this.betPanelControl.setCustomButtonState(betPanelApi.EButton.SPIN, betPanelApi.CustomButtonStatePayload.CONNECTED_STATE);
            this.applyStakeItemsWithTotalBet(this.model.abortSpinPayload.stake);
            this.betPanelControl.disableButton(betPanelApi.EButton.TOTAL_BET);
            this.setReelPicture(this.model.abortSpinPayload.stake.outcome.reelStop.reels);
            this.publishSpinAborted();
        };
        wildFuryGameController.GameController.prototype.stopReels = function() {
            this.reelsControl.stopSpin(this.model.getReels(), this.model.tensionReels);
        };
        wildFuryGameController.GameController.prototype.showBaseGameWins = function() {
            this.winAnimationsCollector = new wildFuryGameController.StringsConditionsCollector().then($bind(this, this.publishSpinOutcomePresented));
            if (this.smContext.isBonuEnd()) {
                this.showIdleAfterBonus();
                this.showScatterBonusWinToLeftLine();
            }
            this.showWins();
        };
        wildFuryGameController.GameController.prototype.showIdleAfterBonus = function() {
            this.hideWinAnimation(false);
            var _g = 0;
            while (_g < 5) {
                var i = _g++;
                this.showIdleOnReel(i);
            }
        };
        wildFuryGameController.GameController.prototype.displayDragons = function() {
            if (this.model.hasLevelUpSymbols()) this.stopReels();
            else if (this.model.hasTauntGoldDragonAnimation()) this.displayTauntGoldDragons($bind(this, this.stopReels));
            else if (this.model.hasTauntBlueDragonAnimation()) this.displayTauntBlueDragons($bind(this, this.stopReels));
            else if (this.model.hasRegularGoldDragonAnimation()) {
                this.displayRegularDragons();
                _hcmn_.haxe_Timer.delay($bind(this, this.stopReels), this.model.config.regularDragonTimeoutBeforeStopSpin);
            } else this.stopReels();
        };
        wildFuryGameController.GameController.prototype.displayRegularDragons = function() {
            var type;
            if (_hcmn_.Std.random(2) == 1) type = wildFuryAnimationPort.DragonType.BLUE;
            else type = wildFuryAnimationPort.DragonType.GOLD;
            if (type == wildFuryAnimationPort.DragonType.BLUE) this.animationsPort.showFrozenFrameAnimation();
            this.animationsPort.showDragons(type);
        };
        wildFuryGameController.GameController.prototype.hideFrozenFrameAnimation = function() {
            this.animationsPort.hideFrozenFrameAnimation();
        };
        wildFuryGameController.GameController.prototype.displayTauntBlueDragons = function(calbackFunction) {
            this.animationsPort.showFrozenFrameAnimation();
            this.animationsPort.showDragons(wildFuryAnimationPort.DragonType.TAUNT_BLUE, function(dragonType) {
                if (dragonType == wildFuryAnimationPort.DragonType.TAUNT_BLUE) calbackFunction();
            });
        };
        wildFuryGameController.GameController.prototype.displayTauntGoldDragons = function(calbackFunction) {
            this.animationsPort.showDragons(wildFuryAnimationPort.DragonType.TAUNT_GOLD, function(dragonType) {
                if (dragonType == wildFuryAnimationPort.DragonType.TAUNT_GOLD) calbackFunction();
            });
        };
        wildFuryGameController.GameController.prototype.showExpandsAndWilds = function(reelId) {
            this.winLinesPort.showExpands(this.model.getExpandOnReel(reelId));
        };
        wildFuryGameController.GameController.prototype.displayBaseGameWin = function() {
            this.displayWin();
        };
        wildFuryGameController.GameController.prototype.displayTotalWin = function() {
            this.hidePopup();
            this.showIdleAfterBonus();
            this.winAnimationsCollector = new wildFuryGameController.StringsConditionsCollector().then($bind(this, this.handleBonusTotalWinShown));
            this.winAnimationsCollector.addCondition("meterFinished", false);
            this.winMeterControl.displayWin(this.model.resultPayload.totalWin, this.model.resultPayload.bigWin.winSegments);
            this.showSkipButton();
        };
        wildFuryGameController.GameController.prototype.showPromoWithDelay = function() {
            this.promoTimeout = window.setTimeout($bind(this, this.showPromo), this.model.config.delayBeforePromo);
        };
        wildFuryGameController.GameController.prototype.handleBonusTotalWinShown = function() {
            this.showPromoWithDelay();
            this.showBaseGameWins();
        };
        wildFuryGameController.GameController.prototype.collectWinAnimationsConditions = function(hasWin) {
            this.winAnimationsCollector.addCondition("meterFinished", !hasWin);
            if (hasWin) {
                if (this.autoplayController.isActive() && !this.autoplayController.isLastSpin() || !this.model.isBaseGame()) this.winAnimationsCollector.addCondition("animatorFinished");
                this.showSpinButton(false);
            } else this.winAnimationsCollector.resolveAll();
        };
        wildFuryGameController.GameController.prototype.showWins = function(freeSpins) {
            if (freeSpins == null) freeSpins = false;
            var hasWin = this.model.hasWin();
            this.collectWinAnimationsConditions(hasWin);
            if (hasWin) {
                this.winLinesWaitingToShow = this.model.isMediumOrBigWin();
                if (!this.winLinesWaitingToShow) this.showWinLinesOutcome();
                if (freeSpins) this.showBonusGamePaysMessage();
                else this.showGamePaysMessage();
                this.showSkipButton();
            } else this.resolveWinAnimator();
        };
        wildFuryGameController.GameController.prototype.showBonusGamePaysMessage = function() {
            var payout = this.model.getBonusPayout().format();
            var message = this.translationManager.stringLookup("FreeSpinPays", [payout]);
            this.infoBarControl.showRightLabel(message);
        };
        wildFuryGameController.GameController.prototype.showWinLinesOutcome = function() {
            this.winLinesWaitingToShow = false;
            this.winLinesPort.show(new wildFuryWinLinesApi.OutcomePayload(this.model.outcome, this.model.isLowWin()));
        };
        wildFuryGameController.GameController.prototype.resolveWinAnimator = function() {
            this.winAnimationsCollector.resolveCondition("animatorFinished");
        };
        wildFuryGameController.GameController.prototype.showScatterWins = function() {
            this.winAnimationsCollector = new wildFuryGameController.StringsConditionsCollector().then($bind(this, this.startTransitionToBonus));
            this.winAnimationsCollector.addCondition("animatorFinished");
            this.winMeterControl.displayWin(this.model.outcome.totalPayout, [], true);
            this.winLinesPort.show(new wildFuryWinLinesApi.OutcomePayload(this.model.getScatterWinOutcome(), this.model.isLowWin()));
            this.hidePromo();
        };
        wildFuryGameController.GameController.prototype.startTransitionToBonus = function() {
            this.popupPort.hide();
            this.dispatchEvent(wildFuryGameController.StateMachineDef.START_BONUS_INTRO);
        };
        wildFuryGameController.GameController.prototype.showBonusSplashAnimation = function() {
            this.pickerPort.deactivateSpin();
            this.winParticleControl.showFlame();
            this.animationsPort.showDragons(wildFuryAnimationPort.DragonType.GOLD, $bind(this, this.onDragonCompleted));
            window.setTimeout($bind(this, this.onSplashComplete), this.model.config.delayBeforePicker);
        };
        wildFuryGameController.GameController.prototype.onDragonCompleted = function(type) {
            this.pickerPort.activateSpin();
            this.winParticleControl.stop();
        };
        wildFuryGameController.GameController.prototype.onPopupShown = function(e) {
            var popupName = e.getPayload();
            switch (popupName) {
                case "BONUS_OUTRO":
                    this.prepareFreeSpin();
                    break;
                case "JACKPOT_LEVEL_UP":
                    if (this.model.levelUpType == wildFuryGameController.GameModel.LEVEL_UP) this.updateJackpotLevel($bind(this, this.collectWildSymbols), false);
                    else this.handleNextLevelUp();
                    break;
            }
        };
        wildFuryGameController.GameController.prototype.handleNextLevelUp = function() {
            if (this.model.isMaxJackpotLevel) this.handleMaxLevelExceeded();
            else {
                var callback;
                if (this.model.totalUps == 1) callback = $bind(this, this.collectWildSymbols);
                else callback = $bind(this, this.doubleUpdateJackpotLevel);
                this.updateJackpotLevel(callback, this.model.totalUps > 1);
                this.model.totalUps--;
            }
        };
        wildFuryGameController.GameController.prototype.onSplashComplete = function(dragonType) {
            var _g = this.stateMachine.currentState.get_name();
            switch (_g) {
                case "BONUS_INTRO_STATE":
                    this.transitionToPicker();
                    break;
                case "FS_SUMMARY":
                    this.winParticleControl.stop();
                    this.bonusGameComplete();
                    break;
                default:
                    this.winParticleControl.stop();
                    this.bonusInfoPanel.show([this.model.freespinsAwarded, this.model.wildsCollected]);
                    this.publishSpinOutcomePresented();
            }
        };
        wildFuryGameController.GameController.prototype.bonusGameComplete = function() {
            this.dispatchEvent(wildFuryGameController.StateMachineDef.FS_ENDED);
        };
        wildFuryGameController.GameController.prototype.transitionToPicker = function() {
            this.dispatchEvent(wildFuryGameController.StateMachineDef.BONUS_INTRO_FINISHED);
        };
        wildFuryGameController.GameController.prototype.publishPickerRequest = function() {
            this.slotModelPort.getStages().getPickerBonusStage().getPickerBonusSelected().publish(new slotModelApi.Pair("0", "0"));
        };
        wildFuryGameController.GameController.prototype.hideGame = function() {
            var gameLayoutPort = this.context.getUsedPort(gameLayoutApi.IGameLayoutPort);
            gameLayoutPort.getHideLayers().publish("picker");
        };
        wildFuryGameController.GameController.prototype.showGame = function() {
            var gameLayoutPort = this.context.getUsedPort(gameLayoutApi.IGameLayoutPort);
            gameLayoutPort.getUnhideLayers().publish(null);
        };
        wildFuryGameController.GameController.prototype.showPicker = function() {
            this.animationsPort.activatePromo(false);
            this.backgroundControl.show(this.model.getGameBackgroung("12"));
            this.hideWinAnimation();
            this.showSpinButton(false);
            this.betPanelControl.disableButton(betPanelApi.EButton.TOTAL_BET);
            this.betPanelControl.disableButton(betPanelApi.EButton.AUTO_PLAY_BUTTON);
            this.popupPort.hide();
            this.hideGame();
            this.pickerPort.show();
        };
        wildFuryGameController.GameController.prototype.stopPickerWheel = function() {
            this.pickerPort.stop(this.model.wheelStopIndex);
        };
        wildFuryGameController.GameController.prototype.onWheelStopped = function(e) {
            var _g = this;
            _hcmn_.haxe_Timer.delay(function() {
                _g.popupPort.showBonusOutro(_g.model.freespinsAwarded + "");
            }, this.model.config.fs_PickerResultDuration);
        };
        wildFuryGameController.GameController.prototype.onWheelStarted = function(e) {
            this.publishPickerRequest();
        };
        wildFuryGameController.GameController.prototype.prepareFreeSpin = function() {
            this.winParticleControl.showFlame();
            this.showGame();
            this.pickerPort.hide();
            this.reelsControl.show();
            this.model.switchToFreeSpinOutcome();
            this.updateReelPicture();
            var jackpotPayload = this.model.getJackpotPanelPayload(false);
            this.updateLevel(jackpotPayload);
            var dragonType = this.getRandomDragonType();
            this.animationsPort.showDragons(dragonType, $bind(this, this.onSplashComplete));
        };
        wildFuryGameController.GameController.prototype.updateLevel = function(jackpotPayload) {
            this.jackpotPanelPort.updateLevel(jackpotPayload);
            this.bonusInfoPanel.updateJackpotLevel(_hcmn_.Std.parseInt(jackpotPayload.level));
            this.backgroundControl.show(this.model.getGameBackgroung(jackpotPayload.level));
        };
        wildFuryGameController.GameController.prototype.presentFreeSpinOutcome = function() {
            if (wildFuryPluginApi.JackpotDataStorage.jackpotData.isMaxLevel && this.model.hasLevelUpSymbols()) this.handleMaxLevelExceeded();
            else this.jackpotLevelUp();
        };
        wildFuryGameController.GameController.prototype.handleMaxLevelExceeded = function() {
            var _g = this;
            this.popupPort.showMaxFreeSpinOrJackpot("txt_jackpot");
            window.setTimeout(function() {
                _g.popupPort.hide();
                _g.collectWildSymbols();
                _hcmn_.haxe_Timer.delay(function() {
                    var symbols = [];
                    var _g2 = 0;
                    var _g1 = _g.model.outcome.reelStop.reels.length;
                    while (_g2 < _g1) {
                        var i = _g2++;
                        symbols[i] = [];
                        var _g4 = 0;
                        var _g3 = _g.model.outcome.reelStop.reels[i].length;
                        while (_g4 < _g3) {
                            var j = _g4++;
                            symbols[i][j] = 0;
                        }
                    }
                    _g.setReelCellsVisibility(symbols);
                }, 0);
                _g.winLinesPort.hide();
            }, this.model.config.maxFreeSpinOrJackpotDuration);
        };
        wildFuryGameController.GameController.prototype.jackpotLevelUp = function() {
            if (this.model.hasLevelUpSymbols()) {
                this.winAnimationsCollector = new wildFuryGameController.StringsConditionsCollector().then($bind(this, this.onLevelUpSymbolCompleted));
                var dragonsCallback;
                if (this.model.isMaxJackpotLevel) dragonsCallback = null;
                else dragonsCallback = $bind(this, this.showJackpotLevelUpMessage);
                this.animationsPort.showDragons(this.getRandomDragonType(), dragonsCallback);
                this.winAnimationsCollector.addCondition("animatorFinished");
                this.winLinesPort.show(new wildFuryWinLinesApi.OutcomePayload(this.model.getScatterWinOutcome(), this.model.isLowWin()));
            } else this.collectWildSymbols();
        };
        wildFuryGameController.GameController.prototype.onLevelUpSymbolCompleted = function() {
            if (this.model.isMaxJackpotLevel) this.collectWildSymbols();
        };
        wildFuryGameController.GameController.prototype.showJackpotLevelUpMessage = function(dragonType) {
            this.popupPort.showJackpotLevelUp();
        };
        wildFuryGameController.GameController.prototype.doubleUpdateJackpotLevel = function() {
            this.popupPort.showJackpotLevelUp();
        };
        wildFuryGameController.GameController.prototype.updateJackpotLevel = function(callback, doubleUp) {
            this.winAnimationsCollector = new wildFuryGameController.StringsConditionsCollector().then(callback);
            this.winAnimationsCollector.addCondition(wildFuryGameController.GameModel.LEVEL_UP, false);
            if (this.model.startSpinPayload[0] == 1) {
                var jackpotPayload = this.model.getJackpotPanelPayload(doubleUp);
                this.updateLevel(jackpotPayload);
            }
        };
        wildFuryGameController.GameController.prototype.collectWildSymbols = function() {
            this.model.isLevelUpCompleted = true;
            if (this.model.hasBonusWilds()) {
                this.winAnimationsCollector.then($bind(this, this.collectFreeSpinSymbols));
                this.winAnimationsCollector.addCondition("WILD_COUNTER_FINISHED");
                this.animationsPort.showFlyingSymbols(this.model.getBonusWildsForShowing());
            } else this.collectFreeSpinSymbols();
        };
        wildFuryGameController.GameController.prototype.handleMaxFreeSpinsExceded = function() {
            var _g = this;
            this.popupPort.showMaxFreeSpinOrJackpot("FreeGames");
            window.setTimeout(function() {
                _g.popupPort.hide();
                _g.displayFreeSpinWin();
            }, this.model.config.maxFreeSpinOrJackpotDuration);
        };
        wildFuryGameController.GameController.prototype.freeSpinSymbolsCollected = function() {
            this.updateInfoBarFreeSpinsCounter();
            if (this.model.isMaxFreespinsAwarded() && this.model.freespinsAwarded != 0) this.handleMaxFreeSpinsExceded();
            else this.displayFreeSpinWin();
        };
        wildFuryGameController.GameController.prototype.collectFreeSpinSymbols = function() {
            this.model.isWildCollected = true;
            if (this.model.hasFreespinSymbols()) {
                if (this.model.isMaxFreespinsAwarded() && this.model.freespinsAwarded == 0) this.handleMaxFreeSpinsExceded();
                else {
                    this.winAnimationsCollector.then($bind(this, this.freeSpinSymbolsCollected));
                    this.winAnimationsCollector.addCondition("FREESPIN_COUNTER_FINISHED");
                    this.animationsPort.showFlyingSymbols(this.model.getFreeSpinsForShowing());
                }
            } else this.displayFreeSpinWin();
        };
        wildFuryGameController.GameController.prototype.onCounterUpdated = function(e) {
            var counterType = e.getPayload();
            this.winAnimationsCollector.resolveCondition(counterType + "_COUNTER_FINISHED");
        };
        wildFuryGameController.GameController.prototype.displayFreeSpinWin = function() {
            this.model.isAdditionalFreespinsCollected = true;
            var accumulatedPayout = this.model.getAccumulatedPayout().asString();
            var payout = this.model.getBonusPayout();
            var jackpotPayload = this.model.getJackpotPanelPayload(false);
            this.jackpotPanelPort.updateBattery(jackpotPayload);
            if (this.model.allSpecialSymbolsCompleted() && (function($this) {
                    var $r;
                    var this1 = $this.smContext.get_contextValues();
                    $r = this1.get("awardCapExceeded");
                    return $r;
                }(this))) {
                this.showAwardCapScreen();
                return;
            }
            if (payout.isNotZero()) {
                this.winAnimationsCollector = new wildFuryGameController.StringsConditionsCollector().then($bind(this, this.dispatchContinueAction));
                this.winMeterControl.displayWin(accumulatedPayout, [new slotModelApi.BigWinSegment(2, payout.asString())], false, this.model.lastAccumulatedPayout);
                this.showWins(true);
            } else {
                if (this.model.getAccumulatedPayout().isNotZero()) this.winMeterControl.displayWin(accumulatedPayout, [], true, this.model.lastAccumulatedPayout);
                this.dispatchContinueAction();
            }
            this.model.lastAccumulatedPayout = accumulatedPayout;
        };
        wildFuryGameController.GameController.prototype.setBaseGameOutcome = function() {
            this.model.lastAccumulatedPayout = "";
            if (this.model.allSpecialSymbolsCompleted()) this.hideWinAnimation();
        };
        wildFuryGameController.GameController.prototype.executeContinueCommand = function() {
            haxe.Log.trace("[GAME_CONTROLLER] executeContinueCommand:stage:" + this.model.spinOutcome.stage, {
                fileName: "GameController.hx",
                lineNumber: 689,
                className: "components.gamecontroller.impl.GameController",
                methodName: "executeContinueCommand"
            });
            var delay = this.model.getDelayForExecuteContinueCommand();
            var continueCommandExecuted = this.slotModelPort.getGameCommands().getContinueCommandExecuted();
            _hcmn_.haxe_Timer.delay(function() {
                continueCommandExecuted.publish(null);
            }, delay);
        };
        wildFuryGameController.GameController.prototype.publishResultPresented = function() {
            var isAwardCapExceeded;
            isAwardCapExceeded = (function($this) {
                var $r;
                var this1 = $this.smContext.get_contextValues();
                $r = this1.get("awardCapExceeded");
                return $r;
            }(this)) == true;
            var isWinZero = this.model.getResultPayout().isZero();
            var iswinAnimationsFinished = this.winAnimationsCollector.isFinished();
            if (isAwardCapExceeded || isWinZero || this.autoplayController.isActive() || iswinAnimationsFinished) this.dispatchResultPresentedEvent();
        };
        wildFuryGameController.GameController.prototype.dispatchResultPresentedEvent = function() {
            if (!this.resultPresentedPublished) {
                this.slotModelPort.getStages().getResultStage().getResultPresented().publish(null);
                this.resultPresentedPublished = true;
            }
        };
        wildFuryGameController.GameController.prototype.showAwardCapScreen = function() {
            if (this.model.isBaseGame() || this.model.allSpecialSymbolsCompleted()) {
                this.autoplayController.stopAutoSpins();
                var totalWin = this.model.getResultPayout();
                this.popupPort.showMaxAwardCap(this.model.getMaxAwardMessage());
                this.model.switchToBaseGameOutcome();
                this.updateReelPicture();
                this.winMeterControl.displayWin(totalWin.asString(), [], true);
                this.switchJackpotPanelToBase();
                this.infoBarControl.hideAll();
                this.bonusInfoPanel.hide();
                this.hideWinAnimation();
                this.promoTimeout = window.setTimeout($bind(this, this.showPromo), this.model.config.delayBeforePromo);
                _hcmn_.haxe_Timer.delay($bind(this, this.dispatchContinueAction), this.model.config.maxAwardSpinEnabledDelay);
            } else this.jackpotLevelUp();
        };
        wildFuryGameController.GameController.prototype.dispatchContinueAction = function() {
            this.dispatchEvent(wildFuryGameController.StateMachineDef.CONTINUE);
        };
        wildFuryGameController.GameController.prototype.hidePopup = function() {
            this.popupPort.hide();
        };
        wildFuryGameController.GameController.prototype.onBalanceUpdate = function(e) {
            var payload = e.getPayload();
            if (payload.freespin != null) {
                this.promoSpinsControl.setActualPromoFreeSpinsCount(payload.freespin);
                this.logger.info("GAME_CONTROLLER -> PROMOFREESPINS AWARDED:" + payload.freespin);
            } else {
                this.promoSpinsControl.deactivate();
                this.betPanelControl.setBalance(payload.balance);
            }
        };
        wildFuryGameController.GameController.prototype.onSlotModelInitGame = function(e) {
            this.applyPresentationInitialization(e.getPayload());
            this.updateReelPicture();
            this.model.rgPresentation = e.getPayload().riskControlSettings.rgPresentation;
            this.betPanelControl.hideButton(betPanelApi.EButton.SKIP);
            this.dispatchEvent(wildFuryGameController.StateMachineDef.INIT_ACTION);
        };
        wildFuryGameController.GameController.prototype.onPrepareResume = function(e) {
            this.pickerPort.isResume().publish(true);
            this.init();
            var resumePayload = e.getPayload();
            this.model.rgPresentation = e.getPayload().initializationProperties.riskControlSettings.rgPresentation;
            this.applyPresentationInitialization(resumePayload.initializationProperties);
            this.model.initJackpotData();
            this.model.setSpinOutcome(resumePayload.spinOutcome);
            this.applyStakeItemsWithTotalBet(resumePayload.stake);
            this.dispatchEvent(wildFuryGameController.StateMachineDef.PREPARE_RESUME);
        };
        wildFuryGameController.GameController.prototype.applyPresentationInitialization = function(payload) {
            this.model.setDenomination(payload.riskControlSettings.denomination);
            this.applyStakeItemsWithTotalBet(payload.defaultStake);
            this.model.defaultSideBet = payload.defaultStake.stakeItems.sideBet;
        };
        wildFuryGameController.GameController.prototype.clearWinPresentation = function() {
            this.hideWinAnimation();
            this.hideNoCenterLabels();
            this.hidePopup();
            this.winMeterControl.clear();
        };
        wildFuryGameController.GameController.prototype.onConfirmSelectedStake = function(e) {
            this.clearWinPresentation();
            this.applyStake(e.getPayload());
        };
        wildFuryGameController.GameController.prototype.applyStake = function(stakeState) {
            this.model.setCurrentStake(stakeState);
            this.betPanelControl.setStake(stakeState);
            this.jackpotPanelPort.updateBetMultiplier(this.model.getJackpotBetMultiplier(stakeState));
        };
        wildFuryGameController.GameController.prototype.applyStakeItemsWithTotalBet = function(stakeState) {
            this.model.setOutcome(stakeState.outcome);
            this.applyStake(stakeState);
            this.winMeterControl.clear();
            this.model.resultPayload = null;
        };
        wildFuryGameController.GameController.prototype.onSpinCommandAvailable = function(e) {
            if (e.getPayload()) {
                var command = this.getAvailableSpinCommand();
                this.dispatchEvent(command);
            } else this.betPanelControl.disableButton(betPanelApi.EButton.SPIN);
        };
        wildFuryGameController.GameController.prototype.getAvailableSpinCommand = function() {
            if (this.autoplayController.isActive()) return wildFuryGameController.StateMachineDef.START_REEL_SPIN;
            else return wildFuryGameController.StateMachineDef.SPIN_ENABLED;
        };
        wildFuryGameController.GameController.prototype.onStakeCommandAvailable = function(e) {
            if (e.getPayload()) this.betPanelControl.enableButton(betPanelApi.EButton.TOTAL_BET, !this.promoSpinsControl.isActive);
            else this.betPanelControl.disableButton(betPanelApi.EButton.TOTAL_BET);
        };
        wildFuryGameController.GameController.prototype.onAutoSpinsCommandAvailable = function(e) {
            if (e.getPayload()) {
                this.showSpinButton(true);
                if (!this.autoplayController.isActive()) this.showCentralLabel("InfoBarIdle");
            } else this.showCentralLabel("");
        };
        wildFuryGameController.GameController.prototype.onModelSpinStart = function(e) {
            this.model.startSpinPayload = e.getPayload();
            this.dispatchEvent(wildFuryGameController.StateMachineDef.START_REEL_SPIN);
        };
        wildFuryGameController.GameController.prototype.onSpinOutcome = function(e) {
            this.model.setSpinOutcome(e.getPayload());
            this.promoSpinsControl.setActualPromoFreeSpinsCount(this.model.spinOutcome.customData.freeSpinsCount);
            haxe.Log.trace("jdskadj", {
                fileName: "GameController.hx",
                lineNumber: 844,
                className: "components.gamecontroller.impl.GameController",
                methodName: "onSpinOutcome",
                customParams: [this.model.spinOutcome.customData.payLines]
            });
            if (this.stateMachine.isInState(wildFuryGameController.StateMachineDef.PICKER_STATE)) this.dispatchEvent(wildFuryGameController.StateMachineDef.BONUS_OUTRO_STATE);
            else this.collectExpandingConditions();
            var this1 = this.smContext.get_contextValues();
            var value = this.model.hasWinInSpin();
            this1.set("hasWin", value);
            this.smContext.setContextValue("Stage", e.getPayload().stage);
            this.smContext.setContextValue("NextStage", e.getPayload().nextStage);
            this.smContext.setContextValue("awardCapExceeded", e.getPayload().awardCapExceeded);
            this.betPanelControl.setCustomButtonState(betPanelApi.EButton.SPIN, betPanelApi.CustomButtonStatePayload.CONNECTED_STATE);
        };
        wildFuryGameController.GameController.prototype.onModelSpinStop = function(e) {
            if (this.stateMachine.isInState(wildFuryGameController.StateMachineDef.SPINNING_STATE)) this.dispatchEvent(wildFuryGameController.StateMachineDef.STOP_REEL_SPIN);
            else this.stopSpinRecieved = true;
        };
        wildFuryGameController.GameController.prototype.abortPicker = function() {
            this.publishSpinAborted();
        };
        wildFuryGameController.GameController.prototype.publishSpinAborted = function() {
            this.slotModelPort.getStages().getAbortStage().getSpinAborted().publish(null);
        };
        wildFuryGameController.GameController.prototype.onAbortSpin = function(e) {
            this.model.abortSpinPayload = e.getPayload();
            if (this.stateMachine.isInState(wildFuryGameController.StateMachineDef.SPINNING_STATE) || this.stateMachine.isInState(wildFuryGameController.StateMachineDef.PICKER_STATE)) this.dispatchEvent(wildFuryGameController.StateMachineDef.ABORT_SPIN);
        };
        wildFuryGameController.GameController.prototype.onSelectPickerBonus = function(e) {
            if (this.model.abortSpinPayload != null) {
                this.model.abortSpinPayload = null;
                this.pickerPort.setIdle();
                this.dispatchEvent(wildFuryGameController.StateMachineDef.SET_PICKER_IDLE);
            }
        };
        wildFuryGameController.GameController.prototype.onSpinOutcomePresent = function(e) {
            if (this.winAnimationsCollector.isFinished()) this.winAnimationsCollector.resolveAll();
        };
        wildFuryGameController.GameController.prototype.publishPresentSpinOutcome = function() {
            this.dispatchEvent(wildFuryGameController.StateMachineDef.PRESENT_SPIN_OUTCOME);
        };
        wildFuryGameController.GameController.prototype.onPresentResult = function(e) {
            this.model.resultPayload = e.getPayload();
            this.dispatchEvent(wildFuryGameController.StateMachineDef.PRESENT_RESULT);
        };
        wildFuryGameController.GameController.prototype.onContinueCommandAvailable = function(e) {
            var jackpotPayload = this.model.getJackpotPanelPayload(false);
            this.jackpotPanelPort.updateBattery(jackpotPayload);
            if (e.getPayload()) this.dispatchEvent(wildFuryGameController.StateMachineDef.CONTINUE_ENABLED);
        };
        wildFuryGameController.GameController.prototype.onOpenPaytable = function(e) {
            if (this.paytableOpened) {
                this.onPaytableClose();
                return;
            }
            this.hidePopup();
            this.paytableOpened = true;
            this.paytableControl.show();
            this.reelsControl.hide();
            window.addEventListener("closePaytable", $bind(this, this.forcePaytableClose));
        };
        wildFuryGameController.GameController.prototype.onPaytableButtonPressed = function(e) {
            this.slotModelPort.getGameCommands().getPaytableCommandExecuted().publish(null);
        };
        wildFuryGameController.GameController.prototype.onBetButtonPressed = function(e) {
            if (e.getPayload() == "OpenTotalBetButton") this.clearWinPresentation();
        };
        wildFuryGameController.GameController.prototype.onSpinButtonPressed = function(e) {
            this.betPanelControl.disableButton(betPanelApi.EButton.AUTO_PLAY_BUTTON);
            this.showSpinButton(false);
            this.hidePopup();
            this.slotModelPort.getGameCommands().getSpinCommandExecuted().publish(null);
            this.winMeterControl.clear();
        };
        wildFuryGameController.GameController.prototype.onSoundButtonPressed = function(e) {
            var button = e.getPayload();
            var soundStatus;
            if (button == betPanelApi.EButton.SOUND_ON) soundStatus = "1";
            else soundStatus = "0";
            this.slotModelPort.getGameContext().getGameOptionChangedFromGf().publish(new slotModelApi.Pair("sound", soundStatus));
        };
        wildFuryGameController.GameController.prototype.onSkipButtonPressed = function(e) {
            this.showSpinButton(false);
            this.stopBigWinParticles();
            var animationConditions = ["animatorFinished", "meterFinished"];
            var _g = this.stateMachine.get_currentStateName();
            switch (_g) {
                case "BASEGAME_OUTCOME":
                case "BET_CONFIRM":
                    this.winAnimationsCollector.resolveConditions(animationConditions);
                    this.winMeterControl.stop();
                    this.dispatchResultPresentedEvent();
                    break;
                case "SHOW_WIN_STATE":
                    this.winAnimationsCollector.resolveConditions(animationConditions);
                    this.winMeterControl.stop();
                    this.dispatchEvent(wildFuryGameController.StateMachineDef.CONTINUE);
                    break;
                default:
                    this.logger.warn("Unexpected state: [" + this.stateMachine.currentState.get_name() + "] to skip something");
            }
            if (this.winLinesWaitingToShow) this.showWinLinesOutcome();
        };
        wildFuryGameController.GameController.prototype.onAutoplayStopPressed = function(e) {
            this.slotModelPort.getGameCommands().getStopAutoSpinsCommandExecuted().publish(null);
            this.betPanelControl.disableButton(betPanelApi.EButton.AUTO_PLAY_BUTTON);
        };
        wildFuryGameController.GameController.prototype.onAutoplayPressed = function(e) {
            this.clearWinPresentation();
            this.betPanelControl.disableButton(betPanelApi.EButton.SPIN);
            var autoSpinPayload = new slotModelApi.AutospinCommandPayload(null, null, null);
            this.slotModelPort.getGameCommands().getStartAutoSpinsCommandExecuted().publish(autoSpinPayload);
        };
        wildFuryGameController.GameController.prototype.onPaytableCloseBtn = function(e) {
            this.dispatchPaytableClose();
            this.onPaytableClose();
        };
        wildFuryGameController.GameController.prototype.dispatchPaytableClose = function() {
            if (this.paytableOpened) {
                var closePaytableEvt = window.document.createEvent("Event");
                closePaytableEvt.initEvent("closePaytable", false, false);
                window.dispatchEvent(closePaytableEvt);
            }
        };
        wildFuryGameController.GameController.prototype.onPaytableClose = function() {
            this.paytableOpened = false;
            this.paytableControl.hide();
            this.reelsControl.show();
            this.showCentralLabel("InfoBarIdle");
        };
        wildFuryGameController.GameController.prototype.onOpenHelp = function(event) {
            this.onPaytableClose();
            this.dispatchPaytableClose();
        };
        wildFuryGameController.GameController.prototype.forcePaytableClose = function() {
            this.paytableOpened = false;
            this.paytableControl.hide();
            this.reelsControl.show();
        };
        wildFuryGameController.GameController.prototype.onMediumAnimationStart = function(e) {
            this.winParticleControl.showSparks();
        };
        wildFuryGameController.GameController.prototype.onBigWinMeterStart = function(e) {
            this.winParticleControl.showExplosions();
        };
        wildFuryGameController.GameController.prototype.onDisplayWinMeterFinished = function(e) {
            if (this.stateMachine.isInState(wildFuryGameController.StateMachineDef.BET_CONFIRM)) this.dispatchResultPresentedEvent();
            this.winAnimationsCollector.resolveCondition("meterFinished");
            this.stopBigWinParticles();
            if (this.winLinesWaitingToShow) this.showWinLinesOutcome();
            if (this.model.isLowWin()) {
                var channel = wildFuryGameController.ExternalService.busChanel;
                channel.publish("playTier1", null);
            }
        };
        wildFuryGameController.GameController.prototype.onJackpotAnimationCompleted = function(e) {
            if (this.model.isMaxJackpotLevel) {
                this.winAnimationsCollector.clearAll();
                this.handleMaxLevelExceeded();
            } else this.winAnimationsCollector.resolveCondition(wildFuryGameController.GameModel.LEVEL_UP);
        };
        wildFuryGameController.GameController.prototype.stopBigWinParticles = function() {
            this.winParticleControl.stop();
        };
        wildFuryGameController.GameController.prototype.onBetPanelStakeChanged = function(e) {
            var _g = this;
            var stakeItems = new slotModelApi.StakeItems(e.getPayload().lineCount, e.getPayload().betPerLine, this.model.defaultSideBet);
            window.clearTimeout(this.betPanelStakeChangedTimeoutId);
            var isLittleBitTimeout = this.betPanelStakeChangedTimeoutId == 0;
            var timeout;
            if (isLittleBitTimeout) timeout = 200;
            else timeout = 500;
            if (!isLittleBitTimeout) {
                this.showSpinButton(false);
                wildFuryGameController.ExternalService.busChanel.publish("betpanel:uiClicked", "");
            }
            this.betPanelStakeChangedTimeoutId = window.setTimeout(function() {
                _g.handleBetPanelStakeChanged(stakeItems);
                _g.showSpinButton(true);
                _g.betPanelStakeChangedTimeoutId = 0;
            }, timeout);
        };
        wildFuryGameController.GameController.prototype.handleBetPanelStakeChanged = function(stakeItems) {
            var channel = wildFuryGameController.ExternalService.busChanel;
            var topic = this.model.getBetPanelTopicForNewStakeItems(stakeItems);
            channel.publish(topic, null);
            this.model.stakeItems = stakeItems;
            this.slotModelPort.getGameCommands().getStakeCommandExecuted().publish(stakeItems);
        };
        wildFuryGameController.GameController.prototype.onHideReels = function(e) {
            this.updateReelCellsVisibility(e.getPayload());
        };
        wildFuryGameController.GameController.prototype.onShowReels = function(e) {
            this.updateReelCellsVisibility(e.getPayload());
        };
        wildFuryGameController.GameController.prototype.updateReelCellsVisibility = function(reelCellsVisibility) {
            var symbols;
            var _g = [];
            var _g1 = 0;
            while (_g1 < 5) {
                var i = _g1++;
                _g.push((function($this) {
                    var $r;
                    var _g2 = []; {
                        var _g3 = 0;
                        while (_g3 < 6) {
                            var j = _g3++;
                            _g2.push(reelCellsVisibility[i][j] ? 0 : 1);
                        }
                    }
                    $r = _g2;
                    return $r;
                }(this)));
            }
            symbols = _g;
            if (!this.model.isLowWin()) this.setReelCellsVisibility(symbols);
            var hasLevelUp = false;
            var _g21 = 0;
            var _g11 = this.model.outcome.reelStop.reels.length;
            while (_g21 < _g11) {
                var i1 = _g21++;
                var _g4 = 1;
                var _g31 = this.model.outcome.reelStop.reels[i1].length - 1;
                while (_g4 < _g31) {
                    var j1 = _g4++;
                    if (this.model.outcome.reelStop.reels[i1][j1] == wildFuryGameController.GameModel.DOUBLE_LEVELUP_SYMBOL_ID || this.model.outcome.reelStop.reels[i1][j1] == this.model.LEVELUP_SYMBOL_ID) {
                        hasLevelUp = true;
                        symbols[i1][j1] = 1;
                    } else symbols[i1][j1] = 0;
                }
            }
            if (hasLevelUp) this.setReelCellsVisibility(symbols);
        };
        wildFuryGameController.GameController.prototype.setReelCellsVisibility = function(symbols) {
            this.updateReelPicture();
            this.reelsControl.setReelCellsVisibility(symbols);
        };
        wildFuryGameController.GameController.prototype.onReelStopped = function(e) {
            this.logger.info("[GAME_CONTROLLER] onReelStopped");
            var reelId = e.getPayload();
            var channel = wildFuryGameController.ExternalService.busChanel;
            if (this.model.hasTension()) {
                if (reelId == 2) this.animationsPort.showTensionFrame(reelId + 1);
                else if (reelId == 3) this.animationsPort.hide(wildFuryAnimationPort.AnimationComponent.TENSION);
            }
            if (this.model.isBonusSymbolPresentsOnReel(reelId)) {
                channel.publish("reels:SmartSymbolLands", reelId);
                this.reelMaskFlowControl.showMaskForReel(reelId);
            }
            if (this.model.isExpanding(reelId)) channel.publish("reels:burnAnimation", reelId);
            else if (this.model.isWildSymbolPresentsOnReel(reelId)) channel.publish("reels:wildAnimation", null);
            if (this.model.isDoubleLvlUpSymbolPresentsOnReel(reelId)) channel.publish("reels:doubleLvlUpSymbolLands", reelId);
            if (this.model.islvlUpSymbolPresentsOnReel(reelId)) channel.publish("reels:LvlUpSymbolLands", reelId);
            if (this.model.abortSpinPayload == null) this.handleReelStopping(reelId);
        };
        wildFuryGameController.GameController.prototype.handleReelStopping = function(reelId) {
            if (this.model.isExpanding(reelId)) this.showExpandsAndWilds(reelId);
            else {
                this.winAnimationsCollector.resolveCondition("expanding_animatorFinished" + reelId);
                this.showIdleOnReel(reelId);
            }
        };
        wildFuryGameController.GameController.prototype.showIdleOnReel = function(reelId) {
            var idleAnimationsOnReel = this.model.getIdleSymbolsOnReel(reelId);
            if (idleAnimationsOnReel != null) this.winLinesPort.showIdleAnimation(new wildFuryWinLinesApi.IdleAnimationPayload(reelId, idleAnimationsOnReel, this.model.isLowWin()));
        };
        wildFuryGameController.GameController.prototype.onStartSpinReelPictureExit = function(e) {
            if (e.getPayload() == 0) this.dispatchEvent(wildFuryGameController.StateMachineDef.SPIN_STARTING_ENDED);
        };
        wildFuryGameController.GameController.prototype.onSpinStopped = function(e) {
            this.logger.info("GAME CONTROLLER --> onReelSpinStopped -->");
            this.updateCentralLabelVisibility();
            this.promoSpinsControl.showPromoSpinsLeft();
            this.hideFrozenFrameAnimation();
            if (this.stateMachine.isInState(wildFuryGameController.StateMachineDef.STOPPING_STATE)) {
                this.slotModelPort.getStages().getSpinStage().getReelSpinFinished().publish(null);
                this.checkAutoplayFinished();
                this.updateReelCellsVisibility(this.model.idleReelsVisibility);
                this.winAnimationsCollector.resolveCondition("REELS_STOPPED");
            } else this.publishSpinAborted();
        };
        wildFuryGameController.GameController.prototype.updateCentralLabelVisibility = function() {
            if (!this.promoSpinsControl.isActive) this.infoBarControl.hideCentralLabel();
        };
        wildFuryGameController.GameController.prototype.onWinLineCyclePlayed = function(e) {
            this.winAnimationsCollector.resolveCondition("animatorFinished");
            if (this.model.isLowWin()) {
                this.winLinesPort.hide();
                this.hideWinAnimation();
                this.infoBarControl.hideWinLineSummary();
                this.winAnimationsCollector.resolveCondition("meterFinished");
            }
        };
        wildFuryGameController.GameController.prototype.onWinLinesWinPresent = function(e) {
            var channel = wildFuryGameController.ExternalService.busChanel;
            if (!this.model.isLowWin()) {
                if (this.model.isDragonSymbolPresentsInWin(e.getPayload())) channel.publish("winlines:dragonAnimation", null);
                if (this.model.isSevenSymbolPresentsInWin(e.getPayload())) channel.publish("winlines:7Animation", null);
            }
            this.showWinLineSummary(e.getPayload());
        };
        wildFuryGameController.GameController.prototype.onExpandsShown = function(e) {
            var reelId = e.getPayload();
            this.showIdleOnReel(reelId);
            this.winAnimationsCollector.resolveCondition("expanding_animatorFinished" + reelId);
        };
        wildFuryGameController.GameController.prototype.showScatterBonusWinToLeftLine = function() {
            var payout = this.model.getScatterAndBonusTotalWin().format();
            var text = this.translationManager.stringLookup("ScatterBonusWinPays", [payout]);
            this.infoBarControl.showLeftLabel(text);
        };
        wildFuryGameController.GameController.prototype.showWinLineSummary = function(win) {
            var linePicture = this.model.getLinePictureForWin(win);
            if (win.type == "Scatter") {
                this.infoBarControl.hideWinLineSummary();
                if (this.model.isBonusSummary) this.showScatterBonusWinToLeftLine();
            } else this.infoBarControl.showWinLineSummary(linePicture, win.lineId == null ? "null" : "" + win.lineId, this.moneyFormatter.format(win.payout));
        };
        wildFuryGameController.GameController.prototype.showCentralLabel = function(messageID) {
            if (this.promoSpinsControl.isActive) this.promoSpinsControl.showPromoSpinsLeft();
            else if (this.model.isBaseGame() || this.model.isBaseGameNext()) {
                var message = this.translationManager.stringLookup(messageID);
                this.infoBarControl.showCentralLabel(message);
            } else this.infoBarControl.showCentralLabel("");
        };
        wildFuryGameController.GameController.prototype.setReelPicture = function(reels) {
            this.reelsControl.setReelPicture(reels);
            this.reelMaskFlowControl.updateMaskForAllReels();
        };
        wildFuryGameController.GameController.prototype.checkAutoplayFinished = function() {
            if (this.promoSpinsControl.isActive && !this.promoSpinsControl.freeSpinsAvaliable()) this.autoplayController.forceStopAutoSpins();
        };
        wildFuryGameController.GameController.prototype.updateReelPicture = function() {
            this.setReelPicture(this.model.getReels());
        };
        wildFuryGameController.GameController.prototype.updateWinMeterValue = function() {
            if (this.model.isBaseGame()) this.winMeterControl.clear();
        };
        wildFuryGameController.GameController.prototype.showBonusGameSummary = function() {
            this.infoBarControl.hideAll();
            this.bonusInfoPanel.hide();
            this.hideWinAnimation(false);
            var jackpotWin = this.model.getJackpotCreditsWin().format();
            var freespinsWin = this.model.getFreeSpinsWin().format();
            var totalWin = this.model.getBonusTotalWin().format();
            this.showSpinButton(false);
            this.popupPort.showBonusAwardCap([jackpotWin, freespinsWin, totalWin]);
            window.setTimeout($bind(this, this.showFreespinEndingSplash), this.model.config.fs_bonusAwardCapDuration);
            this.model.isBonusSummary = true;
        };
        wildFuryGameController.GameController.prototype.showFreespinEndingSplash = function() {
            this.model.switchToBaseGameOutcome();
            this.updateReelPicture();
            this.winParticleControl.showFlame();
            this.animationsPort.showDragons(wildFuryAnimationPort.DragonType.GOLD, $bind(this, this.onSplashComplete));
            this.switchJackpotPanelToBase();
        };
        wildFuryGameController.GameController.prototype.switchJackpotPanelToBase = function() {
            this.model.resetJackpotLevel();
            var jackpotPayload = this.model.getJackpotPanelPayload(false);
            this.updateLevel(jackpotPayload);
            this.jackpotPanelPort.updateBattery(jackpotPayload);
            this.backgroundControl.show(this.model.getGameBackgroung("0"));
        };
        wildFuryGameController.GameController.prototype.updateInfoBarFreeSpinsCounter = function() {
            var current = this.model.getCurrentFreespinIndex() + 1;
            var total = this.model.spinOutcome.freeSpin.total;
            var text = this.translationManager.stringLookup("FreeSpinsOfTotal", [current, total]);
            this.infoBarControl.showLeftLabel(text);
            this.infoBarControl.hideRightLabel();
        };
        wildFuryGameController.GameController.prototype.getRandomDragonType = function() {
            if (_hcmn_.Std.random(2) == 1) return wildFuryAnimationPort.DragonType.BLUE;
            else return wildFuryAnimationPort.DragonType.GOLD;
        };
        wildFuryGameController.GameController.prototype.initHotKeys = function() {};
        wildFuryGameController.GameController.prototype.__class__ = wildFuryGameController.GameController;
        wildFuryGameController.GameControllerConfig = function() {};
        wildFuryGameController.GameControllerConfig.__name__ = ["wildFuryGameController", "GameControllerConfig"];
        wildFuryGameController.GameControllerConfig.prototype.winlineInterval = null;
        wildFuryGameController.GameControllerConfig.prototype.playingLinesAtBetMessageDelay = null;
        wildFuryGameController.GameControllerConfig.prototype.delayBeforePicker = null;
        wildFuryGameController.GameControllerConfig.prototype.maxFreeSpinOrJackpotDuration = null;
        wildFuryGameController.GameControllerConfig.prototype.tauntBlueDragonWinProbability = null;
        wildFuryGameController.GameControllerConfig.prototype.minAmountOfWildsToShowTauntGoldDragon = null;
        wildFuryGameController.GameControllerConfig.prototype.displayRegularDragonProbability = null;
        wildFuryGameController.GameControllerConfig.prototype.regularDragonTimeoutBeforeStopSpin = null;
        wildFuryGameController.GameControllerConfig.prototype.delayBeforePromo = null;
        wildFuryGameController.GameControllerConfig.prototype.fs_winlineInterval = null;
        wildFuryGameController.GameControllerConfig.prototype.fs_IntroScreenDuration = null;
        wildFuryGameController.GameControllerConfig.prototype.fs_FirstSpinDelay = null;
        wildFuryGameController.GameControllerConfig.prototype.fs_WinSpinDelay = null;
        wildFuryGameController.GameControllerConfig.prototype.fs_NoWinSpinDelay = null;
        wildFuryGameController.GameControllerConfig.prototype.fs_RetriggerScreenDuration = null;
        wildFuryGameController.GameControllerConfig.prototype.fs_MaxRetriggerScreenDuration = null;
        wildFuryGameController.GameControllerConfig.prototype.fs_SummaryDuration = null;
        wildFuryGameController.GameControllerConfig.prototype.fs_PickerResultDuration = null;
        wildFuryGameController.GameControllerConfig.prototype.fs_bonusAwardCapDuration = null;
        wildFuryGameController.GameControllerConfig.prototype.maxAwardSpinEnabledDelay = null;
        wildFuryGameController.GameControllerConfig.prototype.idleAnimation = null;
        wildFuryGameController.GameControllerConfig.prototype.backgrounds = null;
        wildFuryGameController.GameControllerConfig.prototype.freeSpinInitialReels = null;
        wildFuryGameController.GameControllerConfig.prototype.winParticlesConfig = null;
        wildFuryGameController.GameControllerConfig.prototype.__class__ = wildFuryGameController.GameControllerConfig;
        components.gamecontroller.impl.GameConfig = function() {};
        components.gamecontroller.impl.GameConfig.__name__ = ["components", "gamecontroller", "impl", "GameConfig"];
        components.gamecontroller.impl.GameConfig.prototype.gameControllerConfig = null;
        components.gamecontroller.impl.GameConfig.prototype.__class__ = components.gamecontroller.impl.GameConfig;
        wildFuryGameController.GameLoadCriteria = {
            __ename__: ["wildFuryGameController", "GameLoadCriteria"],
            __constructs__: ["ASSEMBLY_STARTED", "CONFIG_LOADED", "LAYOUT_UPDATED"]
        };
        wildFuryGameController.GameLoadCriteria.ASSEMBLY_STARTED = ["ASSEMBLY_STARTED", 0];
        wildFuryGameController.GameLoadCriteria.ASSEMBLY_STARTED.toString = $estr;
        wildFuryGameController.GameLoadCriteria.ASSEMBLY_STARTED.__enum__ = wildFuryGameController.GameLoadCriteria;
        wildFuryGameController.GameLoadCriteria.CONFIG_LOADED = ["CONFIG_LOADED", 1];
        wildFuryGameController.GameLoadCriteria.CONFIG_LOADED.toString = $estr;
        wildFuryGameController.GameLoadCriteria.CONFIG_LOADED.__enum__ = wildFuryGameController.GameLoadCriteria;
        wildFuryGameController.GameLoadCriteria.LAYOUT_UPDATED = ["LAYOUT_UPDATED", 2];
        wildFuryGameController.GameLoadCriteria.LAYOUT_UPDATED.toString = $estr;
        wildFuryGameController.GameLoadCriteria.LAYOUT_UPDATED.__enum__ = wildFuryGameController.GameLoadCriteria;
        wildFuryGameController.GameModel = function() {
            this.rgPresentation = false;
            this.isMaxJackpotLevel = false;
            this.FREESPIN_TYPE = "FREESPIN";
            this.BONUS_WILD_TYPE = "WILD";
            this.FREE_SPIN_NO_IDLE_SYMBOL_ID = "-13";
            this.FREE_SPIN_SYMBOL_ID = "13";
            this.WILD_SYMBOL_ID = "1";
            this.BLUE_DRAGON_SYMBOL_ID = "5";
            this.ORANGE_DRAGON_SYMBOL_ID = "4";
            this.BLUE7_SYMBOL_ID = "3";
            this.ORANGE7_SYMBOL_ID = "2";
            this.LEVELUP_SYMBOL_ID = "14";
            this.BONUS_SYMBOL_ID = "12";
            this.denomination = 1.0;
            this.moneyValueProvider = wildFuryGameController.ExternalService.moneyValueProvider;
        };
        wildFuryGameController.GameModel.__name__ = ["wildFuryGameController", "GameModel"];
        wildFuryGameController.GameModel.prototype.spinOutcome = null;
        wildFuryGameController.GameModel.prototype.outcome = null;
        wildFuryGameController.GameModel.prototype.abortSpinPayload = null;
        wildFuryGameController.GameModel.prototype.startSpinPayload = null;
        wildFuryGameController.GameModel.prototype.tensionReels = null;
        wildFuryGameController.GameModel.prototype.landingSymbols = null;
        wildFuryGameController.GameModel.prototype.scatterWinMatrix = null;
        wildFuryGameController.GameModel.prototype.lineWinMatrix = null;
        wildFuryGameController.GameModel.prototype.bonusWinMatrix = null;
        wildFuryGameController.GameModel.prototype.wildReels = null;
        wildFuryGameController.GameModel.prototype.oldWildReels = null;
        wildFuryGameController.GameModel.prototype.hasAnnouncement = null;
        wildFuryGameController.GameModel.prototype.config = null;
        wildFuryGameController.GameModel.prototype.resultPayload = null;
        wildFuryGameController.GameModel.prototype.denomination = null;
        wildFuryGameController.GameModel.prototype.defaultSideBet = null;
        wildFuryGameController.GameModel.prototype.BONUS_SYMBOL_ID = null;
        wildFuryGameController.GameModel.prototype.LEVELUP_SYMBOL_ID = null;
        wildFuryGameController.GameModel.prototype.ORANGE7_SYMBOL_ID = null;
        wildFuryGameController.GameModel.prototype.BLUE7_SYMBOL_ID = null;
        wildFuryGameController.GameModel.prototype.ORANGE_DRAGON_SYMBOL_ID = null;
        wildFuryGameController.GameModel.prototype.BLUE_DRAGON_SYMBOL_ID = null;
        wildFuryGameController.GameModel.prototype.WILD_SYMBOL_ID = null;
        wildFuryGameController.GameModel.prototype.FREE_SPIN_SYMBOL_ID = null;
        wildFuryGameController.GameModel.prototype.FREE_SPIN_NO_IDLE_SYMBOL_ID = null;
        wildFuryGameController.GameModel.prototype.BONUS_WILD_TYPE = null;
        wildFuryGameController.GameModel.prototype.FREESPIN_TYPE = null;
        wildFuryGameController.GameModel.prototype.stakeState = null;
        wildFuryGameController.GameModel.prototype.stakeItems = null;
        wildFuryGameController.GameModel.prototype.lastAccumulatedPayout = null;
        wildFuryGameController.GameModel.prototype.jackpotData = null;
        wildFuryGameController.GameModel.prototype.idleReelsVisibility = null;
        wildFuryGameController.GameModel.prototype.visibilityForAllWins = null;
        wildFuryGameController.GameModel.prototype.idleAnimationMap = null;
        wildFuryGameController.GameModel.prototype.backgroundOfLevel = null;
        wildFuryGameController.GameModel.prototype.expandRows = null;
        wildFuryGameController.GameModel.prototype.freeSpinsCountDown = null;
        wildFuryGameController.GameModel.prototype.freespinsAwarded = null;
        wildFuryGameController.GameModel.prototype.wildsCollected = null;
        wildFuryGameController.GameModel.prototype.wheelStopIndex = null;
        wildFuryGameController.GameModel.prototype.levelUpType = null;
        wildFuryGameController.GameModel.prototype.totalUps = null;
        wildFuryGameController.GameModel.prototype.isBonusSummary = null;
        wildFuryGameController.GameModel.prototype.isMaxJackpotLevel = null;
        wildFuryGameController.GameModel.prototype.moneyValueProvider = null;
        wildFuryGameController.GameModel.prototype.additionalFreespinsAmount = null;
        wildFuryGameController.GameModel.prototype.isWildCollected = null;
        wildFuryGameController.GameModel.prototype.isLevelUpCompleted = null;
        wildFuryGameController.GameModel.prototype.isAdditionalFreespinsCollected = null;
        wildFuryGameController.GameModel.prototype.totalBet = null;
        wildFuryGameController.GameModel.prototype.rgPresentation = null;
        wildFuryGameController.GameModel.prototype.getCurrentFreespinIndex = function() {
            if (this.spinOutcome == null || this.spinOutcome.freeSpin == null) return -1;
            return this.spinOutcome.freeSpin.current;
        };
        wildFuryGameController.GameModel.prototype.setGameConfig = function(config) {
            this.config = config;
            this.idleAnimationMap = new _hcmn_.haxe_ds_StringMap();
            var _g = 0;
            var _g1 = _hcmn_.Reflect.fields(config.idleAnimation);
            while (_g < _g1.length) {
                var symbolKey = _g1[_g];
                ++_g;
                var value = _hcmn_.Reflect.field(config.idleAnimation, symbolKey);
                this.idleAnimationMap.set(symbolKey, value);
            }
            this.backgroundOfLevel = new _hcmn_.haxe_ds_StringMap();
            var _g2 = 0;
            var _g11 = _hcmn_.Reflect.fields(config.backgrounds);
            while (_g2 < _g11.length) {
                var symbolKey1 = _g11[_g2];
                ++_g2;
                var value1 = _hcmn_.Reflect.field(config.backgrounds, symbolKey1);
                this.backgroundOfLevel.set(symbolKey1, value1);
            }
        };
        wildFuryGameController.GameModel.prototype.setDenomination = function(denomValue) {
            this.denomination = parseFloat(denomValue);
        };
        wildFuryGameController.GameModel.prototype.resetJackpotLevel = function() {
            if (this.jackpotData == null) this.initJackpotData();
            this.jackpotData.setJackpotLevel("0");
        };
        wildFuryGameController.GameModel.prototype.getJackpotBetMultiplier = function(stakeState) {
            var betPerLine = parseFloat(stakeState.stakeItems.betPerLine);
            return _hcmn_.Std["int"](tools.FloatUtil.correctDivision(betPerLine, this.denomination));
        };
        wildFuryGameController.GameModel.prototype.getJackpotPanelPayload = function(doubleUp) {
            if (this.jackpotData == null) this.initJackpotData();
            var levelInt = _hcmn_.Std.parseInt(this.jackpotData.jackpotLevel);
            this.isMaxJackpotLevel = levelInt >= 11;
            var level;
            if (doubleUp && !this.isMaxJackpotLevel) level = levelInt - 1;
            else level = levelInt;
            return new wildFuryJackpotInfoPanelApi.JackpotInfoPanelPayload(level + "", this.jackpotData.jackpotCredits, this.jackpotData.wildNumber, this.jackpotData.jackpotWildsLadder);
        };
        wildFuryGameController.GameModel.prototype.getMaxAwardMessage = function() {
            var maxAwardMessage;
            var totalWin = this.getResultPayout();
            if (this.isBonusGame()) {
                var lastBonusGameSpin = this.freeSpinsCountDown;
                maxAwardMessage = totalWin.format() + "+" + this.freeSpinsCountDown;
            } else maxAwardMessage = totalWin.format();
            return maxAwardMessage;
        };
        wildFuryGameController.GameModel.prototype.getDelayForExecuteContinueCommand = function() {
            if (this.spinOutcome.stage == "FreeSpin") {
                if (this.hasBonusPayout() && this.abortSpinPayload == null) return 0;
                else return this.config.fs_NoWinSpinDelay;
            } else return this.config.fs_FirstSpinDelay;
        };
        wildFuryGameController.GameModel.prototype.initJackpotData = function() {
            this.jackpotData = wildFuryPluginApi.JackpotDataStorage.jackpotData;
        };
        wildFuryGameController.GameModel.prototype.getGameBackgroung = function(level) {
            return this.backgroundOfLevel.get(level);
        };
        wildFuryGameController.GameModel.prototype.setFreespinsAwarded = function() {
            this.freeSpinsCountDown = this.spinOutcome.freeSpin.total - this.spinOutcome.freeSpin.current - 1;
            this.freespinsAwarded = this.spinOutcome.freeSpin.awarded;
            this.wildsCollected = _hcmn_.Std.parseInt(wildFuryPluginApi.JackpotDataStorage.jackpotData.getWildNumber());
            this.wheelStopIndex = this.spinOutcome.baseGame.outcome.customField.stripStopIndex;
        };
        wildFuryGameController.GameModel.prototype.setSpinOutcome = function(spinOutcome) {
            this.spinOutcome = spinOutcome;
            this.additionalFreespinsAmount = 0;
            this.idleReelsVisibility = this.getDefaultVisibilityMatrix();
            this.isMaxJackpotLevel = wildFuryPluginApi.JackpotDataStorage.jackpotData.isMaxLevel;
            if (this.spinOutcome.stage == "BaseGame") {
                this.setOutcome(this.spinOutcome.baseGame.outcome);
                this.checkForTension();
            } else {
                this.setFreespinsAwarded();
                this.setOutcome(this.spinOutcome.freeSpin.outcome);
            }
            this.visibilityForAllWins = this.getVisibilityForAllWins();
        };
        wildFuryGameController.GameModel.prototype.allSpecialSymbolsCompleted = function() {
            return this.isWildCollected && this.isLevelUpCompleted && this.isAdditionalFreespinsCollected;
        };
        wildFuryGameController.GameModel.prototype.setOutcome = function(outcome) {
            this.isWildCollected = this.isLevelUpCompleted = this.isAdditionalFreespinsCollected = false;
            this.outcome = outcome;
            var _g = [];
            var _g1 = 0;
            while (_g1 < 5) {
                var i = _g1++;
                _g.push(0);
            }
            this.tensionReels = _g;
            this.expandRows = this.getTotalExpandsCount(outcome.reelStop.reels);
        };
        wildFuryGameController.GameModel.prototype.hasTension = function() {
            return this.tensionReels[3] == 1;
        };
        wildFuryGameController.GameModel.prototype.checkForTension = function() {
            if (this.isBonusSymbolPresentsOnReel(2) && this.isBonusSymbolPresentsOnReel(1)) this.tensionReels[3] = 1;
        };
        wildFuryGameController.GameModel.prototype.getExpandOnReel = function(reelId) {
            var result = null;
            if (this.isExpanding(reelId)) result = new wildFuryWinLinesApi.ExpandinWildsPayload(this.expandRows, reelId, this.isLowWin());
            return result;
        };
        wildFuryGameController.GameModel.prototype.getTotalExpandsCount = function(reels) {
            var result = 0;
            var _g = 0;
            while (_g < 5) {
                var i = _g++;
                if (this.isExpanding(i)) result++;
            }
            return result;
        };
        wildFuryGameController.GameModel.prototype.getVisibilityForAllWins = function() {
            var result = this.getDefaultVisibilityMatrix(false);
            return result;
        };
        wildFuryGameController.GameModel.prototype.getVisibilityForScatterWins = function() {
            return this.scatterWinMatrix;
        };
        wildFuryGameController.GameModel.prototype.setCurrentStake = function(stakeState) {
            this.stakeState = stakeState;
            this.totalBet = stakeState.totalBet;
        };
        wildFuryGameController.GameModel.prototype.getDefaultVisibilityMatrix = function(defaultValue) {
            if (defaultValue == null) defaultValue = true;
            var visibility;
            var _g = [];
            var _g1 = 0;
            while (_g1 < 5) {
                var i = _g1++;
                _g.push((function($this) {
                    var $r;
                    var _g2 = []; {
                        var _g3 = 0;
                        while (_g3 < 6) {
                            var j = _g3++;
                            _g2.push(defaultValue);
                        }
                    }
                    $r = _g2;
                    return $r;
                }(this)));
            }
            visibility = _g;
            return visibility;
        };
        wildFuryGameController.GameModel.prototype.hasWin = function() {
            return this.hasWinInSpin() || this.spinOutcome.acumulatedPayout != "0";
        };
        wildFuryGameController.GameModel.prototype.hasWinInSpin = function() {
            return this.outcome.totalPayout != "0";
        };
        wildFuryGameController.GameModel.prototype.getResultPayout = function() {
            return this.moneyValueProvider.provide(this.resultPayload == null ? "0" : this.resultPayload.totalWin);
        };
        wildFuryGameController.GameModel.prototype.getPayout = function() {
            if (this.isBonusSummary) return this.getResultPayout();
            var totalPayout = this.spinOutcome.baseGame.outcome.totalPayout;
            return this.moneyValueProvider.provide(totalPayout);
        };
        wildFuryGameController.GameModel.prototype.hasBonusPayout = function() {
            return this.getBonusPayout().isNotZero();
        };
        wildFuryGameController.GameModel.prototype.getBonusPayout = function() {
            return this.moneyValueProvider.provide(this.spinOutcome.freeSpin.outcome.totalPayout);
        };
        wildFuryGameController.GameModel.prototype.getAccumulatedPayout = function() {
            return this.moneyValueProvider.provide(this.spinOutcome.acumulatedPayout);
        };
        wildFuryGameController.GameModel.prototype.getBaseGameTotalPayout = function() {
            return this.moneyValueProvider.provide(this.spinOutcome.baseGame.outcome.totalPayout);
        };
        wildFuryGameController.GameModel.prototype.hasRegularGoldDragonAnimation = function() {
            return _hcmn_.Math.random() < this.config.displayRegularDragonProbability;
        };
        wildFuryGameController.GameModel.prototype.hasTauntGoldDragonAnimation = function() {
            var winProbability = this.config.minAmountOfWildsToShowTauntGoldDragon;
            return this.getWildAmountsOnReels() >= winProbability;
        };
        wildFuryGameController.GameModel.prototype.hasTauntBlueDragonAnimation = function() {
            var winProbability = this.config.tauntBlueDragonWinProbability;
            var totalBet = parseFloat(this.stakeState.totalBet);
            if (this.isBaseGame()) return this.getPayout().asFloat() / totalBet > winProbability;
            return this.getBonusPayout().asFloat() / totalBet > winProbability;
        };
        wildFuryGameController.GameModel.prototype.getWinSegments = function() {
            if (this.outcome.bigWin != null) return this.outcome.bigWin.winSegments;
            else return [new slotModelApi.BigWinSegment(1, this.getPayout().asString())];
        };
        wildFuryGameController.GameModel.prototype.getLinePictureForWin = function(win) {
            var result;
            var _g = [];
            var _g1 = 0;
            while (_g1 < 5) {
                var i = _g1++;
                _g.push("-");
            }
            result = _g;
            var reelsInfo = win.winPath.reelsInfo;
            var reels = this.outcome.reelStop.reels;
            var _g2 = 0;
            var _g11 = win.symbolCount;
            while (_g2 < _g11) {
                var k = _g2++;
                var _g4 = 0;
                var _g3 = reelsInfo[k].length;
                while (_g4 < _g3) {
                    var i1 = _g4++;
                    if (win.winPath.reelsInfo[k][i1] == 1) {
                        result[k] = reels[k][i1];
                        break;
                    }
                }
            }
            return result;
        };
        wildFuryGameController.GameModel.prototype.isMaxBet = function(bet) {
            var length = this.stakeState.totalBetsForSelectedLines.length;
            var lastBet = parseFloat(this.stakeState.totalBetsForSelectedLines[length - 1].value);
            return lastBet == bet;
        };
        wildFuryGameController.GameModel.prototype.getBetPanelTopicForNewStakeItems = function(stakeItems) {
            var result;
            if (this.stakeItems != null) {
                var newBet = parseFloat(stakeItems.betPerLine);
                var prevBet = parseFloat(this.stakeItems.betPerLine);
                if (newBet < prevBet) result = "betpanel:previousBet";
                else if (this.isMaxBet(newBet)) result = "betpanel:maxBet";
                else result = "betpanel:nextBet";
            } else result = "betpanel:nextBet";
            return result;
        };
        wildFuryGameController.GameModel.prototype.isDragonSymbolPresentsInWin = function(win) {
            return this.checkSymbolInWinLine(this.ORANGE_DRAGON_SYMBOL_ID, win) || this.checkSymbolInWinLine(this.BLUE_DRAGON_SYMBOL_ID, win);
        };
        wildFuryGameController.GameModel.prototype.isSevenSymbolPresentsInWin = function(win) {
            return this.checkSymbolInWinLine(this.ORANGE7_SYMBOL_ID, win) || this.checkSymbolInWinLine(this.BLUE7_SYMBOL_ID, win);
        };
        wildFuryGameController.GameModel.prototype.getWildAmountsOnReels = function() {
            var result = 0;
            var _g = 0;
            while (_g < 5) {
                var i = _g++;
                result += this.getSymbolAmountOnReel(this.WILD_SYMBOL_ID, this.outcome.reelStop.reels[i]);
            }
            return result;
        };
        wildFuryGameController.GameModel.prototype.isWildSymbolPresentsOnReel = function(reelId) {
            return this.checkSymbolOnReel(this.WILD_SYMBOL_ID, this.outcome.reelStop.reels[reelId]);
        };
        wildFuryGameController.GameModel.prototype.isDoubleLvlUpSymbolPresentsOnReel = function(reelId) {
            return this.checkSymbolOnReel(wildFuryGameController.GameModel.DOUBLE_LEVELUP_SYMBOL_ID, this.outcome.reelStop.reels[reelId]);
        };
        wildFuryGameController.GameModel.prototype.islvlUpSymbolPresentsOnReel = function(reelId) {
            return this.checkSymbolOnReel(this.LEVELUP_SYMBOL_ID, this.outcome.reelStop.reels[reelId]);
        };
        wildFuryGameController.GameModel.prototype.isBonusSymbolPresentsOnReel = function(reelId) {
            return this.checkSymbolOnReel(this.BONUS_SYMBOL_ID, this.outcome.reelStop.reels[reelId]);
        };
        wildFuryGameController.GameModel.prototype.getBonusSymbolIndexOnReel = function(reelId) {
            return this.getSymbolIndexOnReel(this.BONUS_SYMBOL_ID, this.outcome.reelStop.reels[reelId]);
        };
        wildFuryGameController.GameModel.prototype.checkSymbolOnReel = function(symbolId, reelDataArray, checkInVisibleRange) {
            if (checkInVisibleRange == null) checkInVisibleRange = true;
            return this.getSymbolIndexOnReel(symbolId, reelDataArray, checkInVisibleRange) > -1;
        };
        wildFuryGameController.GameModel.prototype.getSymbolIndexOnReel = function(symbolId, reelDataArray, isInVisibleRange) {
            if (isInVisibleRange == null) isInVisibleRange = true;
            var _this;
            if (isInVisibleRange) _this = reelDataArray.slice(1, 5);
            else _this = reelDataArray;
            return _hcmn_.HxOverrides.indexOf(_this, symbolId, 0);
        };
        wildFuryGameController.GameModel.prototype.getSymbolAmountOnReel = function(symbolId, reelDataArray, isInVisibleRange) {
            if (isInVisibleRange == null) isInVisibleRange = true;
            return _hcmn_.Lambda.filter(isInVisibleRange ? reelDataArray.slice(1, 5) : reelDataArray, function(s) {
                return s == symbolId;
            }).length;
        };
        wildFuryGameController.GameModel.prototype.checkSymbolInWinLine = function(symbolId, win) {
            var reelsInfo = win.winPath.reelsInfo;
            var reels = this.outcome.reelStop.reels;
            var _g1 = 0;
            var _g = win.symbolCount;
            while (_g1 < _g) {
                var i = _g1++;
                var _g3 = 0;
                var _g2 = reelsInfo[i].length;
                while (_g3 < _g2) {
                    var j = _g3++;
                    if (reelsInfo[i][j] == 1 && reels[i][j] == symbolId) return true;
                }
            }
            return false;
        };
        wildFuryGameController.GameModel.prototype.isMediumOrBigWin = function() {
            var bigWin = this.outcome.bigWin;
            return this.isBaseGame() && bigWin != null && bigWin.winSegments.length > 3;
        };
        wildFuryGameController.GameModel.prototype.getReels = function() {
            return this.outcome.reelStop.reels;
        };
        wildFuryGameController.GameModel.prototype.getIdleSymbolsOnReel = function(reelIndex) {
            var result = this.outcome.reelStop.reels[reelIndex].slice();
            var _g1 = 1;
            var _g = result.length - 1;
            while (_g1 < _g) {
                var i = _g1++;
                if (this.hasIdleAnimation(result[i])) this.idleReelsVisibility[reelIndex][i] = this.isGlowSymbol(result[i]);
            }
            this.mapFreespinSymbols(result);
            return result;
        };
        wildFuryGameController.GameModel.prototype.mapFreespinSymbols = function(reel) {
            if (this.isMaxFreespinsAwarded()) {
                this.additionalFreespinsAmount += this.getSymbolAmountOnReel(this.FREE_SPIN_SYMBOL_ID, reel);
                if (this.freespinsAwarded > 0) {
                    var symbolsAmount;
                    if (this.additionalFreespinsAmount <= this.freespinsAwarded) symbolsAmount = this.additionalFreespinsAmount;
                    else symbolsAmount = this.additionalFreespinsAmount - this.freespinsAwarded;
                    var counter = 0;
                    var _g1 = 1;
                    var _g = reel.length - 1;
                    while (_g1 < _g) {
                        var i = _g1++;
                        if (reel[i] == this.FREE_SPIN_SYMBOL_ID) {
                            counter++;
                            if (symbolsAmount > this.freespinsAwarded || counter > symbolsAmount) reel[i] = this.FREE_SPIN_NO_IDLE_SYMBOL_ID;
                            else reel[i] = reel[i];
                        }
                    }
                } else {
                    var _g2 = [];
                    var _g21 = 1;
                    var _g11 = reel.length - 1;
                    while (_g21 < _g11) {
                        var i1 = _g21++;
                        _g2.push(reel[i1] == this.FREE_SPIN_SYMBOL_ID ? reel[i1] = this.FREE_SPIN_NO_IDLE_SYMBOL_ID : reel[i1] = reel[i1]);
                    }
                    _g2;
                }
            }
        };
        wildFuryGameController.GameModel.prototype.isLevelUpSymbol = function(symbolId) {
            return symbolId == wildFuryGameController.GameModel.DOUBLE_LEVELUP_SYMBOL_ID || symbolId == this.LEVELUP_SYMBOL_ID;
        };
        wildFuryGameController.GameModel.prototype.isGlowSymbol = function(id) {
            return id == this.BONUS_SYMBOL_ID || id == this.LEVELUP_SYMBOL_ID || id == wildFuryGameController.GameModel.DOUBLE_LEVELUP_SYMBOL_ID;
        };
        wildFuryGameController.GameModel.prototype.hasIdleAnimation = function(symbol) {
            return this.idleAnimationMap.exists(symbol) && this.isFreeSpinAnimationAvailable(symbol);
        };
        wildFuryGameController.GameModel.prototype.isFreeSpinAnimationAvailable = function(symbol) {
            return this.spinOutcome.freeSpin == null || symbol == this.FREE_SPIN_SYMBOL_ID && !this.isMaxFreespinsAwarded();
        };
        wildFuryGameController.GameModel.prototype.isExpanding = function(reelId) {
            var reel = this.outcome.reelStop.reels[reelId];
            var isExpand = true;
            var _g1 = 1;
            var _g = 5;
            while (_g1 < _g) {
                var i = _g1++;
                if (reel[i] != this.WILD_SYMBOL_ID) {
                    isExpand = false;
                    break;
                }
            }
            return isExpand;
        };
        wildFuryGameController.GameModel.prototype.hasExpand = function() {
            return this.expandRows > 0;
        };
        wildFuryGameController.GameModel.prototype.switchToBaseGameOutcome = function() {
            this.setOutcome(this.spinOutcome.baseGame.outcome);
        };
        wildFuryGameController.GameModel.prototype.isBaseGame = function() {
            return this.spinOutcome == null || new _hcmn_.EReg("BaseGame$", "").match(this.spinOutcome.stage);
        };
        wildFuryGameController.GameModel.prototype.isBonusGame = function() {
            return this.spinOutcome != null && new _hcmn_.EReg("FreeSpin$", "").match(this.spinOutcome.stage);
        };
        wildFuryGameController.GameModel.prototype.isBaseGameNext = function() {
            return this.spinOutcome != null && new _hcmn_.EReg("BaseGame$", "").match(this.spinOutcome.nextStage);
        };
        wildFuryGameController.GameModel.prototype.bonusIsNext = function() {
            return this.spinOutcome != null && new _hcmn_.EReg("FreeSpin$", "").match(this.spinOutcome.nextStage);
        };
        wildFuryGameController.GameModel.prototype.hasBonusWilds = function() {
            return this.getBonusWildsForShowing().length > 0;
        };
        wildFuryGameController.GameModel.prototype.hasFreespinSymbols = function() {
            return this.getFreeSpinsForShowing().length > 0;
        };
        wildFuryGameController.GameModel.prototype.hasLevelUpSymbols = function() {
            return this.getLevelUps().length > 0;
        };
        wildFuryGameController.GameModel.prototype.getLevelUps = function() {
            var result = [];
            if (this.outcome.scatterWins != null) {
                var _g = 0;
                var _g1 = this.outcome.scatterWins;
                while (_g < _g1.length) {
                    var win = _g1[_g];
                    ++_g;
                    if (win.name == wildFuryGameController.GameModel.LEVEL_UP || win.name == wildFuryGameController.GameModel.LEVEL_DOUBLE_UP) {
                        this.levelUpType = win.name;
                        result.push(win);
                    }
                }
            }
            if (this.levelUpType == wildFuryGameController.GameModel.LEVEL_UP) this.totalUps = 1;
            else this.totalUps = 2;
            return result;
        };
        wildFuryGameController.GameModel.prototype.getBonusWildsForShowing = function() {
            return this.filterBonusWinsByType(this.BONUS_WILD_TYPE);
        };
        wildFuryGameController.GameModel.prototype.getFreeSpinsForShowing = function() {
            var result = this.filterBonusWinsByType(this.FREESPIN_TYPE);
            if (this.freespinsAwarded != 0) return result.slice(0, this.freespinsAwarded);
            else return result;
        };
        wildFuryGameController.GameModel.prototype.filterBonusWinsByType = function(type) {
            var bonusWins;
            if (this.outcome.bonusWins == null) bonusWins = [];
            else bonusWins = this.outcome.bonusWins;
            return _hcmn_.Lambda.array(_hcmn_.Lambda.filter(bonusWins, this.getBonusWinByTypeFilter(type)));
        };
        wildFuryGameController.GameModel.prototype.getBonusWinByTypeFilter = function(type) {
            return function(bonusWin) {
                return bonusWin.type == type;
            };
        };
        wildFuryGameController.GameModel.prototype.getScatterAndBonusTotalWin = function() {
            var scatterPayout = 0.0;
            var scatterWins = this.spinOutcome.baseGame.outcome.scatterWins;
            if (scatterWins != null) scatterPayout = parseFloat(scatterWins[0].payout);
            var totalBonusWin = _hcmn_.Std.parseFloat(this.spinOutcome.baseGame.outcome.customField.bonusTotalWin);
            var res = tools.FloatUtil.fixedFloat(scatterPayout + totalBonusWin);
            return this.moneyValueProvider.provide(res == null ? "null" : "" + res);
        };
        wildFuryGameController.GameModel.prototype.getJackpotCreditsWin = function() {
            return this.moneyValueProvider.provide(this.outcome.customField.jackpotCreditsWin);
        };
        wildFuryGameController.GameModel.prototype.getFreeSpinsWin = function() {
            var win;
            if (this.outcome.customField.freeSpinTotalWin == null) win = "0";
            else win = this.outcome.customField.freeSpinTotalWin;
            return this.moneyValueProvider.provide(this.outcome.customField.freeSpinTotalWin);
        };
        wildFuryGameController.GameModel.prototype.getBonusTotalWin = function() {
            return this.moneyValueProvider.provide(this.outcome.customField.bonusTotalWin);
        };
        wildFuryGameController.GameModel.prototype.isMaxFreespinsAwarded = function() {
            return this.spinOutcome.freeSpin != null && this.spinOutcome.freeSpin.isMaxAwarded;
        };
        wildFuryGameController.GameModel.prototype.getScatterWinOutcome = function() {
            return new slotModelApi.Outcome(this.outcome.reelStop, this.outcome.reelStopAdditional, null, this.outcome.scatterWins, null, null, this.outcome.totalPayout, this.outcome.bigWin, this.outcome.customField);
        };
        wildFuryGameController.GameModel.prototype.switchToFreeSpinOutcome = function() {
            var reelPictures = new slotModelApi.ReelPicture(this.config.freeSpinInitialReels);
            var outcome = this.spinOutcome.freeSpin.outcome;
            var freespinOutcome = new slotModelApi.Outcome(reelPictures, outcome.reelStopAdditional, null, null, null, null, outcome.totalPayout, outcome.bigWin, outcome.customField);
            this.setOutcome(freespinOutcome);
            this.lastAccumulatedPayout = this.spinOutcome.baseGame.outcome.totalPayout;
        };
        wildFuryGameController.GameModel.prototype.isHighWin = function() {
            if (this.spinOutcome != null) {
                var totalPayout = parseFloat(this.spinOutcome.baseGame.outcome.totalPayout);
                if (this.spinOutcome.stage == "FreeSpin" && this.spinOutcome.nextStage == "BaseGame" && this.isBonusSummary) totalPayout = parseFloat(this.spinOutcome.acumulatedPayout);
                else if (this.spinOutcome.stage == "FreeSpin" && this.spinOutcome.nextStage == "BaseGame" && !this.isBonusSummary) totalPayout = parseFloat(this.spinOutcome.freeSpin.outcome.totalPayout);
                else if (this.spinOutcome.stage == "FreeSpin" && this.spinOutcome.nextStage == "FreeSpin") totalPayout = parseFloat(this.spinOutcome.freeSpin.outcome.totalPayout);
                var totalBetValue = parseFloat(this.totalBet);
                if (totalPayout > totalBetValue || totalPayout == 0) return true;
            }
            return false;
        };
        wildFuryGameController.GameModel.prototype.isLowWin = function() {
            var isLowWin = false;
            if (this.rgPresentation) {
                if (!this.isHighWin()) isLowWin = true;
            }
            return isLowWin;
        };
        wildFuryGameController.GameModel.prototype.__class__ = wildFuryGameController.GameModel;
        wildFuryGameController.StateMachineContext = function(dispatcher) {
            stateMachineEngine.SMContext.call(this, dispatcher);
        };
        wildFuryGameController.StateMachineContext.__name__ = ["wildFuryGameController", "StateMachineContext"];
        wildFuryGameController.StateMachineContext.__super__ = stateMachineEngine.SMContext;
        for (var k in stateMachineEngine.SMContext.prototype) wildFuryGameController.StateMachineContext.prototype[k] = stateMachineEngine.SMContext.prototype[k];
        wildFuryGameController.StateMachineContext.prototype.setupContextData = function(game) {
            this.set_contextValues(new _hcmn_.haxe_ds_StringMap());
            var this1 = this.get_contextValues();
            this1.set("Stage", "");
            var this2 = this.get_contextValues();
            this2.set("NextStage", "");
            var this3 = this.get_contextValues();
            this3.set("awardCapExceeded", false);
            var this4 = this.get_contextValues();
            this4.set("hasWin", false);
            this.set_contextMethods(new _hcmn_.haxe_ds_StringMap());
            this.setupBaseGameContextData(game);
            this.setupBonusGameContextData(game);
            var this5 = this.get_contextMethods();
            this5.set("attachComponents", function() {
                game.attachComponents();
            });
        };
        wildFuryGameController.StateMachineContext.prototype.setupBonusGameContextData = function(game) {
            var this1 = this.get_contextMethods();
            this1.set("showScatterWins", $bind(game, game.showScatterWins));
            var this2 = this.get_contextMethods();
            this2.set("showBonusIntroAnimation", $bind(game, game.showBonusSplashAnimation));
            var this3 = this.get_contextMethods();
            this3.set("prepareFreeSpin", $bind(game, game.prepareFreeSpin));
            var this4 = this.get_contextMethods();
            this4.set("showPicker", $bind(game, game.showPicker));
            var this5 = this.get_contextMethods();
            this5.set("stopPickerWheel", $bind(game, game.stopPickerWheel));
            var this6 = this.get_contextMethods();
            this6.set("executeContinueCommand", $bind(game, game.executeContinueCommand));
            var this7 = this.get_contextMethods();
            this7.set("presentFreeSpinOutcome", $bind(game, game.presentFreeSpinOutcome));
            var this8 = this.get_contextMethods();
            this8.set("showBonusGameSummary", $bind(game, game.showBonusGameSummary));
            var this9 = this.get_contextMethods();
            this9.set("updateInfoBarFreeSpinsCounter", $bind(game, game.updateInfoBarFreeSpinsCounter));
            var this10 = this.get_contextMethods();
            this10.set("displayTotalWin", $bind(game, game.displayTotalWin));
            var this11 = this.get_contextMethods();
            this11.set("abortPicker", $bind(game, game.abortPicker));
        };
        wildFuryGameController.StateMachineContext.prototype.setupBaseGameContextData = function(game) {
            var this1 = this.get_contextMethods();
            this1.set("initGame", $bind(game, game.initGame));
            var this2 = this.get_contextMethods();
            this2.set("prepareResume", $bind(game, game.prepareResume));
            var this3 = this.get_contextMethods();
            this3.set("onBaseGameIdle", $bind(game, game.onBaseGameIdle));
            var this4 = this.get_contextMethods();
            this4.set("startSpin", $bind(game, game.startSpin));
            var this5 = this.get_contextMethods();
            this5.set("clearAllWins", $bind(game, game.clearAllWins));
            var this6 = this.get_contextMethods();
            this6.set("checkForStopOrAbort", $bind(game, game.checkForStopOrAbort));
            var this7 = this.get_contextMethods();
            this7.set("applyAbortData", $bind(game, game.applyAbortData));
            var this8 = this.get_contextMethods();
            this8.set("stopReels", $bind(game, game.stopReels));
            var this9 = this.get_contextMethods();
            this9.set("displayDragons", $bind(game, game.displayDragons));
            var this10 = this.get_contextMethods();
            this10.set("showBaseGameWins", $bind(game, game.showBaseGameWins));
            var this11 = this.get_contextMethods();
            this11.set("displayBaseGameWin", $bind(game, game.displayBaseGameWin));
            var this12 = this.get_contextMethods();
            this12.set("updateBetPanel", $bind(game, game.updateBetPanel));
            var this13 = this.get_contextMethods();
            this13.set("setBaseGameOutcome", $bind(game, game.setBaseGameOutcome));
            var this14 = this.get_contextMethods();
            this14.set("showAwardCapScreen", $bind(game, game.showAwardCapScreen));
            var this15 = this.get_contextMethods();
            this15.set("publishSpinOutcomePresented", $bind(game, game.publishSpinOutcomePresented));
            var this16 = this.get_contextMethods();
            this16.set("publishResultPresented", $bind(game, game.publishResultPresented));
            var this17 = this.get_contextMethods();
            this17.set("resumePromoMessages", $bind(game, game.resumePromoMessages));
        };
        wildFuryGameController.StateMachineContext.prototype.isBonuEnd = function() {
            return this.isStage("FreeSpin") && this.isNextStage("BaseGame");
        };
        wildFuryGameController.StateMachineContext.prototype.isStage = function(value) {
            return this.isContextValue("Stage", value);
        };
        wildFuryGameController.StateMachineContext.prototype.isNextStage = function(value) {
            return this.isContextValue("NextStage", value);
        };
        wildFuryGameController.StateMachineContext.prototype.isContextValue = function(contextKey, value) {
            return (function($this) {
                var $r;
                var this1 = $this.get_contextValues();
                $r = this1.get(contextKey);
                return $r;
            }(this)) == value;
        };
        wildFuryGameController.StateMachineContext.prototype.__class__ = wildFuryGameController.StateMachineContext;
        wildFuryGameController.StateMachineDef = function() {};
        wildFuryGameController.StateMachineDef.__name__ = ["wildFuryGameController", "StateMachineDef"];
        wildFuryGameController.StateMachineDef.prototype.__class__ = wildFuryGameController.StateMachineDef;
        wildFuryGameController.BackgroundControl = function(port) {
            this.backgroundPort = port;
        };
        wildFuryGameController.BackgroundControl.__name__ = ["wildFuryGameController", "BackgroundControl"];
        wildFuryGameController.BackgroundControl.prototype.backgroundPort = null;
        wildFuryGameController.BackgroundControl.prototype.show = function(id) {
            this.backgroundPort.showBackground().publish(id);
        };
        wildFuryGameController.BackgroundControl.prototype.__class__ = wildFuryGameController.BackgroundControl;
        wildFuryGameController.BetPanelControl = function(betPanelPort) {
            this.betPanelPort = betPanelPort;
        };
        wildFuryGameController.BetPanelControl.__name__ = ["wildFuryGameController", "BetPanelControl"];
        wildFuryGameController.BetPanelControl.prototype.betPanelPort = null;
        wildFuryGameController.BetPanelControl.prototype.disableButton = function(button, isDisable) {
            if (isDisable == null) isDisable = true;
            if (isDisable) this.betPanelPort.disableButton().publish(button);
            else this.enableButton(button);
        };
        wildFuryGameController.BetPanelControl.prototype.enableButton = function(button, isEnable) {
            if (isEnable == null) isEnable = true;
            if (isEnable) this.betPanelPort.enableButton().publish(button);
            else this.disableButton(button);
        };
        wildFuryGameController.BetPanelControl.prototype.hideBetPanell = function() {
            this.betPanelPort.hideBetPanell().publish(null);
        };
        wildFuryGameController.BetPanelControl.prototype.hideButton = function(button) {
            this.betPanelPort.hideButton().publish(button);
        };
        wildFuryGameController.BetPanelControl.prototype.hidePaytableControl = function() {
            this.betPanelPort.hidePaytableControl().publish(null);
        };
        wildFuryGameController.BetPanelControl.prototype.onButtonPressed = function(callback, button) {
            var _g = this;
            if (button != null) return this.betPanelPort.onButtonPressed().subscribe(function(e) {
                if (_g.isEButtonEquals(button, e.getPayload())) callback(e);
            });
            return this.betPanelPort.onButtonPressed().subscribe(callback);
        };
        wildFuryGameController.BetPanelControl.prototype.onStakeChanged = function(callback) {
            return this.betPanelPort.onStakeChanged().subscribe(callback);
        };
        wildFuryGameController.BetPanelControl.prototype.setAutoPlayButtonState = function(state) {
            this.betPanelPort.setAutoPlayButtonState().publish(state);
        };
        wildFuryGameController.BetPanelControl.prototype.setBalance = function(balance) {
            this.betPanelPort.setBalance().publish(balance);
        };
        wildFuryGameController.BetPanelControl.prototype.setContent = function(win, stake, balance) {
            this.betPanelPort.setContent().publish(new betPanelApi.BetPanelContentPayload(win, stake, balance));
        };
        wildFuryGameController.BetPanelControl.prototype.setCustomButtonState = function(button, state) {
            this.betPanelPort.setCustomButtonState().publish(new betPanelApi.CustomButtonStatePayload(button, state));
        };
        wildFuryGameController.BetPanelControl.prototype.setNumberOffAutoSpinsLeft = function(value) {
            this.betPanelPort.setNumberOffAutoSpinsLeft().publish(value);
        };
        wildFuryGameController.BetPanelControl.prototype.setStake = function(stake) {
            this.betPanelPort.setStake().publish(stake);
        };
        wildFuryGameController.BetPanelControl.prototype.showBetPanell = function() {
            this.betPanelPort.showBetPanell().publish(null);
        };
        wildFuryGameController.BetPanelControl.prototype.showButton = function(button) {
            this.betPanelPort.showButton().publish(button);
        };
        wildFuryGameController.BetPanelControl.prototype.showPaytableControl = function(value) {
            this.betPanelPort.showPaytableControl().publish(value);
        };
        wildFuryGameController.BetPanelControl.prototype.isEButtonEquals = function(eButton1, eButton2) {
            return _hcmn_.Type.enumEq(eButton1, eButton2) || eButton1.toLocaleString() == eButton2.toLocaleString();
        };
        wildFuryGameController.BetPanelControl.prototype.__class__ = wildFuryGameController.BetPanelControl;
        wildFuryGameController.InfoBarControl = function(infoBarPort) {
            this.infoBarPort = infoBarPort;
        };
        wildFuryGameController.InfoBarControl.__name__ = ["wildFuryGameController", "InfoBarControl"];
        wildFuryGameController.InfoBarControl.prototype.infoBarPort = null;
        wildFuryGameController.InfoBarControl.prototype.hideAll = function() {
            this.hideAllLabels();
            this.hideWinLineSummary();
        };
        wildFuryGameController.InfoBarControl.prototype.hideAllLabels = function() {
            this.hideLabel(infoBarApi.InfoBarLabelEnum.RIGHT);
            this.hideLabel(infoBarApi.InfoBarLabelEnum.LEFT);
            this.hideLabel(infoBarApi.InfoBarLabelEnum.CENTRAL);
        };
        wildFuryGameController.InfoBarControl.prototype.hideRightLabel = function() {
            this.hideLabel(infoBarApi.InfoBarLabelEnum.RIGHT);
        };
        wildFuryGameController.InfoBarControl.prototype.hideLeftLabel = function() {
            this.hideLabel(infoBarApi.InfoBarLabelEnum.LEFT);
        };
        wildFuryGameController.InfoBarControl.prototype.hideCentralLabel = function() {
            this.hideLabel(infoBarApi.InfoBarLabelEnum.CENTRAL);
        };
        wildFuryGameController.InfoBarControl.prototype.hideLabel = function(infoBarLabel) {
            this.infoBarPort.hideLabel().publish(infoBarLabel);
        };
        wildFuryGameController.InfoBarControl.prototype.hideWinLineSummary = function() {
            this.infoBarPort.hideWinLineSummary().publish(null);
        };
        wildFuryGameController.InfoBarControl.prototype.showRightLabel = function(value) {
            this.showLabel(infoBarApi.InfoBarLabelEnum.RIGHT, value);
        };
        wildFuryGameController.InfoBarControl.prototype.showLeftLabel = function(value) {
            this.showLabel(infoBarApi.InfoBarLabelEnum.LEFT, value);
        };
        wildFuryGameController.InfoBarControl.prototype.showCentralLabel = function(value) {
            this.showLabel(infoBarApi.InfoBarLabelEnum.CENTRAL, value);
        };
        wildFuryGameController.InfoBarControl.prototype.showLabel = function(infoBarLabel, value) {
            this.infoBarPort.showLabel().publish(new infoBarApi.LabelContentPayload(infoBarLabel, value));
        };
        wildFuryGameController.InfoBarControl.prototype.showWinLineSummary = function(linePicture, winId, winSum) {
            this.infoBarPort.showWinLineSummary().publish(new infoBarApi.WinLineSummaryPayload(linePicture, winId, winSum));
        };
        wildFuryGameController.InfoBarControl.prototype.__class__ = wildFuryGameController.InfoBarControl;
        wildFuryGameController.PaytableControl = function(paytablePort) {
            this.paytablePort = paytablePort;
        };
        wildFuryGameController.PaytableControl.__name__ = ["wildFuryGameController", "PaytableControl"];
        wildFuryGameController.PaytableControl.prototype.paytablePort = null;
        wildFuryGameController.PaytableControl.prototype.hide = function() {
            this.paytablePort.hide().publish(null);
        };
        wildFuryGameController.PaytableControl.prototype.show = function() {
            this.paytablePort.show().publish(null);
        };
        wildFuryGameController.PaytableControl.prototype.onPaytableClose = function(callback) {
            return this.paytablePort.onCloseButtonPressed().subscribe(callback);
        };
        wildFuryGameController.PaytableControl.prototype.__class__ = wildFuryGameController.PaytableControl;
        wildFuryGameController.PromoFreeSpinsFlowControl = function(infoBarControl, betPanelControl, translationManager) {
            this.isActive = false;
            this.infoBarControl = infoBarControl;
            this.betPanelControl = betPanelControl;
            this.translationManager = translationManager;
            this.promotionalSpinsCount = 0;
        };
        wildFuryGameController.PromoFreeSpinsFlowControl.__name__ = ["wildFuryGameController", "PromoFreeSpinsFlowControl"];
        wildFuryGameController.PromoFreeSpinsFlowControl.prototype.infoBarControl = null;
        wildFuryGameController.PromoFreeSpinsFlowControl.prototype.betPanelControl = null;
        wildFuryGameController.PromoFreeSpinsFlowControl.prototype.promotionalSpinsCount = null;
        wildFuryGameController.PromoFreeSpinsFlowControl.prototype.remainMessage = null;
        wildFuryGameController.PromoFreeSpinsFlowControl.prototype.translationManager = null;
        wildFuryGameController.PromoFreeSpinsFlowControl.prototype.isActive = null;
        wildFuryGameController.PromoFreeSpinsFlowControl.prototype.setActualPromoFreeSpinsCount = function(promotionalSpinsCount) {
            if (promotionalSpinsCount != null && !this.isActive) this.init(promotionalSpinsCount);
            else this.promotionalSpinsCount = promotionalSpinsCount;
        };
        wildFuryGameController.PromoFreeSpinsFlowControl.prototype.init = function(promotionalSpinsCount) {
            this.promotionalSpinsCount = promotionalSpinsCount;
            if (!this.isActive) {
                this.isActive = true;
                var balanceText = this.translationManager.stringLookup("BalanceValueNotAvailable");
                this.remainMessage = this.translationManager.stringLookup("PromotionalSpinsLeft");
                this.betPanelControl.setBalance(balanceText);
                this.showPromoSpinsLeft();
            }
        };
        wildFuryGameController.PromoFreeSpinsFlowControl.prototype.showPromoSpinsLeft = function() {
            if (this.isActive) {
                var label = "" + this.remainMessage + " " + this.promotionalSpinsCount;
                this.infoBarControl.showCentralLabel(label);
            }
        };
        wildFuryGameController.PromoFreeSpinsFlowControl.prototype.deactivate = function() {
            this.isActive = false;
        };
        wildFuryGameController.PromoFreeSpinsFlowControl.prototype.freeSpinsAvaliable = function() {
            return this.promotionalSpinsCount > 0;
        };
        wildFuryGameController.PromoFreeSpinsFlowControl.prototype.__class__ = wildFuryGameController.PromoFreeSpinsFlowControl;
        wildFuryGameController.ReelMaskFlowControl = function(animationPort, model) {
            this.reelMask = (function($this) {
                var $r;
                var _g = []; {
                    var _g1 = 0;
                    while (_g1 < 5) {
                        var i = _g1++;
                        _g.push((function($this) {
                            var $r;
                            var _g2 = []; {
                                var _g3 = 0;
                                while (_g3 < 2) {
                                    var j = _g3++;
                                    _g2.push(false);
                                }
                            }
                            $r = _g2;
                            return $r;
                        }($this)));
                    }
                }
                $r = _g;
                return $r;
            }(this));
            this.animationPort = animationPort;
            this.model = model;
            this.resetMask();
        };
        wildFuryGameController.ReelMaskFlowControl.__name__ = ["wildFuryGameController", "ReelMaskFlowControl"];
        wildFuryGameController.ReelMaskFlowControl.prototype.animationPort = null;
        wildFuryGameController.ReelMaskFlowControl.prototype.model = null;
        wildFuryGameController.ReelMaskFlowControl.prototype.reelMask = null;
        wildFuryGameController.ReelMaskFlowControl.prototype.updateMaskForAllReels = function() {
            var _g = 0;
            while (_g < 5) {
                var reelId = _g++;
                this.updateMaskForReel(reelId);
            }
            this.updateReelMask();
        };
        wildFuryGameController.ReelMaskFlowControl.prototype.showMaskForReel = function(reelId) {
            if (this.updateMaskForReel(reelId)) this.updateReelMask();
        };
        wildFuryGameController.ReelMaskFlowControl.prototype.updateMaskForReel = function(reelId) {
            var bonusSymbolIndexOnReel = this.model.getBonusSymbolIndexOnReel(reelId);
            if (bonusSymbolIndexOnReel > -1) {
                if (bonusSymbolIndexOnReel == 0 || bonusSymbolIndexOnReel == 3) {
                    this.reelMask[reelId][_hcmn_.Math.min(1, bonusSymbolIndexOnReel)] = true;
                    return true;
                }
            }
            return false;
        };
        wildFuryGameController.ReelMaskFlowControl.prototype.updateReelMask = function() {
            this.animationPort.updateReelMask(this.reelMask);
        };
        wildFuryGameController.ReelMaskFlowControl.prototype.resetMask = function() {
            var _g = [];
            var _g1 = 0;
            while (_g1 < 5) {
                var i = _g1++;
                _g.push((function($this) {
                    var $r;
                    var _g2 = []; {
                        var _g3 = 0;
                        while (_g3 < 2) {
                            var j = _g3++;
                            _g2.push(false);
                        }
                    }
                    $r = _g2;
                    return $r;
                }(this)));
            }
            this.reelMask = _g;
            this.animationPort.updateReelMask(this.reelMask);
        };
        wildFuryGameController.ReelMaskFlowControl.prototype.__class__ = wildFuryGameController.ReelMaskFlowControl;
        wildFuryGameController.ReelsControl = function(reelsPort) {
            this.reelsPort = reelsPort;
        };
        wildFuryGameController.ReelsControl.__name__ = ["wildFuryGameController", "ReelsControl"];
        wildFuryGameController.ReelsControl.prototype.reelsPort = null;
        wildFuryGameController.ReelsControl.prototype.onReelStopped = function(callback) {
            return this.reelsPort.onReelStopped().subscribe(callback);
        };
        wildFuryGameController.ReelsControl.prototype.onSpinStopped = function(callback) {
            return this.reelsPort.onSpinStopped().subscribe(callback);
        };
        wildFuryGameController.ReelsControl.prototype.onStartSpinReelPictureExit = function(callback) {
            return this.reelsPort.onStartSpinReelPictureExit().subscribe(callback);
        };
        wildFuryGameController.ReelsControl.prototype.onStoppingStarted = function(callback) {
            return this.reelsPort.onStoppingStarted().subscribe(callback);
        };
        wildFuryGameController.ReelsControl.prototype.setReelCellsVisibility = function(symbols) {
            this.reelsPort.setReelCellsVisibility().publish(symbols);
        };
        wildFuryGameController.ReelsControl.prototype.setReelPicture = function(reels) {
            this.reelsPort.setReelPicture().publish(reels);
        };
        wildFuryGameController.ReelsControl.prototype.setReelSkin = function(skin) {
            this.reelsPort.setReelSkin().publish(skin);
        };
        wildFuryGameController.ReelsControl.prototype.show = function() {
            this.reelsPort.show().publish(null);
        };
        wildFuryGameController.ReelsControl.prototype.hide = function() {
            this.reelsPort.hide().publish(null);
        };
        wildFuryGameController.ReelsControl.prototype.startSpin = function(startSpinPayload) {
            this.reelsPort.startSpin().publish(new reelsApi.StartSpinPayload(startSpinPayload));
        };
        wildFuryGameController.ReelsControl.prototype.stopSpin = function(reelPicture, tensionReels) {
            this.reelsPort.stopSpin().publish(new reelsApi.StopSpinPayload(reelPicture, tensionReels));
        };
        wildFuryGameController.ReelsControl.prototype.__class__ = wildFuryGameController.ReelsControl;
        wildFuryGameController.WinMeterControl = function(reelsPort, model) {
            this.winMeterPort = reelsPort;
            this.model = model;
        };
        wildFuryGameController.WinMeterControl.__name__ = ["wildFuryGameController", "WinMeterControl"];
        wildFuryGameController.WinMeterControl.prototype.winMeterPort = null;
        wildFuryGameController.WinMeterControl.prototype.displayingValue = null;
        wildFuryGameController.WinMeterControl.prototype.model = null;
        wildFuryGameController.WinMeterControl.prototype.displayWin = function(winAmount, winSegments, instantShow, startingAmount) {
            if (instantShow == null) instantShow = false;
            this.displayingValue = winAmount;
            var instShow = instantShow;
            if (this.model.isLowWin()) instShow = true;
            this.winMeterPort.displayWin().publish(new winMeterApi.WinMeterPayload(winAmount, winSegments, instShow, startingAmount));
        };
        wildFuryGameController.WinMeterControl.prototype.onBigAnimationStart = function(callback) {
            return this.winMeterPort.onBigAnimationStart().subscribe(callback);
        };
        wildFuryGameController.WinMeterControl.prototype.onCountUpFinished = function(callback) {
            return this.winMeterPort.onCountUpFinished().subscribe(callback);
        };
        wildFuryGameController.WinMeterControl.prototype.onCountUpStarted = function(callback) {
            return this.winMeterPort.onCountUpStarted().subscribe(callback);
        };
        wildFuryGameController.WinMeterControl.prototype.onDisplayWinFinished = function(callback) {
            this.displayingValue = "";
            return this.winMeterPort.onDisplayWinFinished().subscribe(callback);
        };
        wildFuryGameController.WinMeterControl.prototype.onInterruptAvailable = function(callback) {
            return this.winMeterPort.onInterruptAvailable().subscribe(callback);
        };
        wildFuryGameController.WinMeterControl.prototype.onMediumAnimationStart = function(callback) {
            return this.winMeterPort.onMediumAnimationStart().subscribe(callback);
        };
        wildFuryGameController.WinMeterControl.prototype.clear = function() {
            this.displayingValue = "";
            this.showMessage("");
        };
        wildFuryGameController.WinMeterControl.prototype.showMessage = function(message) {
            this.winMeterPort.showMessage().publish(message);
        };
        wildFuryGameController.WinMeterControl.prototype.stop = function() {
            this.displayWin(this.displayingValue, [], true);
            this.displayingValue = "";
        };
        wildFuryGameController.WinMeterControl.prototype.__class__ = wildFuryGameController.WinMeterControl;
        wildFuryGameController.WinParticlesControl = function(winMeterControl, animationsPort, winParticlesConfig) {
            this.particlTimeoutId = 0;
            this.winMeterControl = winMeterControl;
            this.animationsPort = animationsPort;
            this.winParticlesConfig = winParticlesConfig;
        };
        wildFuryGameController.WinParticlesControl.__name__ = ["wildFuryGameController", "WinParticlesControl"];
        wildFuryGameController.WinParticlesControl.prototype.winMeterControl = null;
        wildFuryGameController.WinParticlesControl.prototype.animationsPort = null;
        wildFuryGameController.WinParticlesControl.prototype.particlTimeoutId = null;
        wildFuryGameController.WinParticlesControl.prototype.winParticlesConfig = null;
        wildFuryGameController.WinParticlesControl.prototype.showSparks = function() {
            this.animationsPort.showParticle("sparks", this.winParticlesConfig.sparksPosition, null, null, null, true, this.winParticlesConfig.sparksZIndex);
        };
        wildFuryGameController.WinParticlesControl.prototype.showFlame = function() {
            this.animationsPort.showParticle("flame", this.winParticlesConfig.flamePosition, null, null, null, false, this.winParticlesConfig.flameZIndex);
        };
        wildFuryGameController.WinParticlesControl.prototype.showExplosions = function() {
            var _g = this;
            window.clearInterval(this.particlTimeoutId);
            var colors = this.winParticlesConfig.colors;
            this.particlTimeoutId = window.setInterval(function() {
                var randomIndex = _hcmn_.Std.random(colors.length);
                var colorStart = colors[randomIndex];
                var colorEnd = colors[_hcmn_.Std.random(colors.length)];
                var iOS = eval("/iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream");
                if (iOS) colorEnd = colors[randomIndex];
                var explozionBound = _g.winParticlesConfig.explosionBound;
                var randomPosition = {
                    x: _hcmn_.Std.random(explozionBound.width),
                    y: _hcmn_.Std.random(explozionBound.height)
                };
                _g.animationsPort.showParticle("explosion", randomPosition, colorStart, colorEnd, "explosion" + randomIndex, true, _g.winParticlesConfig.explosionZIndex);
            }, this.winParticlesConfig.explosionInterval);
        };
        wildFuryGameController.WinParticlesControl.prototype.stop = function() {
            window.clearInterval(this.particlTimeoutId);
            this.animationsPort.hideParticle("sparks");
            this.animationsPort.hideParticle("flame");
            var _g1 = 0;
            var _g = this.winParticlesConfig.colors.length;
            while (_g1 < _g) {
                var i = _g1++;
                this.animationsPort.hideParticle("explosion" + i);
            }
        };
        wildFuryGameController.WinParticlesControl.prototype.stopFlameParticle = function() {
            this.animationsPort.hideParticle("flame");
        };
        wildFuryGameController.WinParticlesControl.prototype.__class__ = wildFuryGameController.WinParticlesControl;
        wildFuryGameController.SoundAction = function(obj) {
            this.id = obj.id;
            this.action = obj.action;
            this.isLocked = obj.status == "locked";
            if (obj.volume == null) this.volume = 1;
            else this.volume = _hcmn_.Std.parseFloat(obj.volume);
            if (obj.timeout == null) this.timeout = -1;
            else this.timeout = _hcmn_.Std.parseInt(obj.timeout);
            this.value = obj.value;
            this.lastPlayedTime = 0;
        };
        wildFuryGameController.SoundAction.__name__ = ["wildFuryGameController", "SoundAction"];
        wildFuryGameController.SoundAction.prototype.id = null;
        wildFuryGameController.SoundAction.prototype.action = null;
        wildFuryGameController.SoundAction.prototype.value = null;
        wildFuryGameController.SoundAction.prototype.lastPlayedTime = null;
        wildFuryGameController.SoundAction.prototype.volume = null;
        wildFuryGameController.SoundAction.prototype.isLocked = null;
        wildFuryGameController.SoundAction.prototype.timeout = null;
        wildFuryGameController.SoundAction.prototype.__class__ = wildFuryGameController.SoundAction;
        wildFuryGameController.SoundConfig = function() {};
        wildFuryGameController.SoundConfig.__name__ = ["wildFuryGameController", "SoundConfig"];
        wildFuryGameController.SoundConfig.prototype.events = null;
        wildFuryGameController.SoundConfig.prototype.actions = null;
        wildFuryGameController.SoundConfig.prototype.mapOfSoundList = null;
        wildFuryGameController.SoundConfig.prototype.reflectionMap = null;
        wildFuryGameController.SoundConfig.prototype.config = null;
        wildFuryGameController.SoundConfig.prototype.initialize = function(config) {
            if (config == null) throw new Error("SoundConfig: config is null");
            this.config = config;
            this.events = new _hcmn_.haxe_ds_StringMap();
            this.actions = new _hcmn_.haxe_ds_StringMap();
            this.mapOfSoundList = new _hcmn_.haxe_ds_StringMap();
            this.reflectionMap = new _hcmn_.haxe_ds_StringMap();
            var _g = 0;
            var _g1 = _hcmn_.Reflect.fields(config.soundList);
            while (_g < _g1.length) {
                var listName = _g1[_g];
                ++_g;
                var value = _hcmn_.Reflect.field(config.soundList, listName);
                this.mapOfSoundList.set(listName, value);
            }
            if (Object.prototype.hasOwnProperty.call(config, "reflectionMap")) {
                var reflectionMap = _hcmn_.Reflect.field(config, "reflectionMap");
                var _g2 = 0;
                var _g11 = _hcmn_.Reflect.fields(reflectionMap);
                while (_g2 < _g11.length) {
                    var soundMapField = _g11[_g2];
                    ++_g2;
                    var value1 = _hcmn_.Reflect.field(reflectionMap, soundMapField);
                    this.reflectionMap.set(soundMapField, value1);
                }
            }
            var _g3 = 0;
            var _g12 = _hcmn_.Reflect.fields(config.events);
            while (_g3 < _g12.length) {
                var eventName = _g12[_g3];
                ++_g3;
                var arr = _hcmn_.Reflect.field(config.events, eventName);
                var actions = [];
                var _g31 = 0;
                var _g21 = arr.length;
                while (_g31 < _g21) {
                    var i = _g31++;
                    var soundAction = new wildFuryGameController.SoundAction(arr[i]);
                    actions.push(soundAction);
                    this.addSoundAction(soundAction);
                    this.addSoundActionWithCustomId(eventName, soundAction);
                }
                this.events.set(eventName, actions);
            }
            var _g4 = 0;
            var _g13 = _hcmn_.Reflect.fields(config.additionalSoundActions);
            while (_g4 < _g13.length) {
                var eventName1 = _g13[_g4];
                ++_g4;
                var arr1 = _hcmn_.Reflect.field(config.additionalSoundActions, eventName1);
                var actions1 = [];
                var _g32 = 0;
                var _g22 = arr1.length;
                while (_g32 < _g22) {
                    var i1 = _g32++;
                    var soundAction1 = new wildFuryGameController.SoundAction(arr1[i1]);
                    actions1.push(soundAction1);
                    this.addSoundAction(soundAction1);
                    this.addSoundActionWithCustomId(eventName1, soundAction1);
                }
                this.events.set(eventName1, actions1);
            }
        };
        wildFuryGameController.SoundConfig.prototype.getReflectionSound = function(id, data) {
            var sound = this.getFieldFromObject(id, data);
            var reflectionMap = this.getReflectionSoundFromConfig(id, sound);
            if (reflectionMap != null) return reflectionMap;
            return sound;
        };
        wildFuryGameController.SoundConfig.prototype.getFieldFromObject = function(id, data) {
            if (id.indexOf(".") == -1) return _hcmn_.Reflect.field(data, id);
            var result = data;
            var _g = 0;
            var _g1 = id.split(".");
            while (_g < _g1.length) {
                var c = _g1[_g];
                ++_g;
                result = this.getFieldFromObject(c, result);
                if (result == null) throw new Error("SoundConfig::getFieldFromObject: result is null when id: " + id);
            }
            return result;
        };
        wildFuryGameController.SoundConfig.prototype.getReflectionSoundFromConfig = function(soundMapId, soundId) {
            if (this.reflectionMap.exists(soundMapId)) {
                var soundsMap = this.reflectionMap.get(soundMapId);
                if (Object.prototype.hasOwnProperty.call(soundsMap, soundId)) return _hcmn_.Reflect.field(soundsMap, soundId);
            }
            return null;
        };
        wildFuryGameController.SoundConfig.prototype.getSoundMap = function(id) {
            var soundMap = new _hcmn_.haxe_ds_StringMap();
            var dynamicSoundMap = _hcmn_.Reflect.field(this.config, id);
            var _g = 0;
            var _g1 = _hcmn_.Reflect.fields(dynamicSoundMap);
            while (_g < _g1.length) {
                var field = _g1[_g];
                ++_g;
                var fieldValue = _hcmn_.Reflect.field(dynamicSoundMap, field);
                if (_hcmn_.__map_reserved[field] != null) soundMap.setReserved(field, fieldValue);
                else soundMap.h[field] = fieldValue;
            }
            return soundMap;
        };
        wildFuryGameController.SoundConfig.prototype.getRadomSoundFromList = function(id) {
            var soundList = this.mapOfSoundList.get(id);
            var sound = soundList[_hcmn_.Std.random(soundList.length)];
            return sound;
        };
        wildFuryGameController.SoundConfig.prototype.addSoundAction = function(soundAction) {
            this.addSoundActionWithCustomId(soundAction.id, soundAction);
        };
        wildFuryGameController.SoundConfig.prototype.addSoundActionWithCustomId = function(id, soundAction) {
            if (!this.actions.exists(id)) this.actions.set(id, []);
            this.actions.get(id).push(soundAction);
        };
        wildFuryGameController.SoundConfig.prototype.__class__ = wildFuryGameController.SoundConfig;
        wildFuryGameController.SoundController = function(context, assetRegistry, logger, chanels) {
            this.timeouts = new _hcmn_.haxe_ds_StringMap();
            var _g = this;
            this.soundPort = context.getUsedPort(soundManagerApi.ISoundManagerPort);
            this.soundPortHelper = new wildFuryGameController.SoundPortHelper(this.soundPort, 100.);
            var _g1 = 0;
            while (_g1 < chanels.length) {
                var chanel = chanels[_g1];
                ++_g1;
                chanel.subscribe("*", $bind(this, this.onAllEvents));
            }
            assetRegistry.getAsset("soundplayer-assets/soundevents").getContent().then(function(data) {
                _g.cfg = new wildFuryGameController.SoundConfig();
                _g.cfg.initialize(data);
            });
            this.logger = logger;
        };
        wildFuryGameController.SoundController.__name__ = ["wildFuryGameController", "SoundController"];
        wildFuryGameController.SoundController.prototype.cfg = null;
        wildFuryGameController.SoundController.prototype.soundPort = null;
        wildFuryGameController.SoundController.prototype.soundPortHelper = null;
        wildFuryGameController.SoundController.prototype.logger = null;
        wildFuryGameController.SoundController.prototype.timeouts = null;
        wildFuryGameController.SoundController.prototype.onAllEvents = function(e) {
            var topic = e.getTopic();
            var payload = e.getPayload();
            this.onEvent(topic, payload);
        };
        wildFuryGameController.SoundController.prototype.onEvent = function(topic, payload) {
            if (this.cfg == null) {
                this.logger.warn("SoundEvent not loaded yeat: topic: " + topic + " ignored");
                return;
            }
            if (this.cfg.events.exists(topic)) {
                var arr = this.cfg.events.get(topic);
                var _g1 = 0;
                var _g = arr.length;
                while (_g1 < _g) {
                    var i = _g1++;
                    this.executeAction(arr[i], payload);
                }
            }
            if (payload != null && payload.key == "sound") {
                if (payload.value == "1") this.soundPortHelper.turnOffSounds();
                else this.soundPortHelper.turnOnSounds();
            }
        };
        wildFuryGameController.SoundController.prototype.executeAction = function(action, payload, checkTimeout) {
            if (checkTimeout == null) checkTimeout = true;
            if (action.isLocked) return;
            this.clearTimeouts(action.id + action.value);
            if (checkTimeout && action.timeout > 0) {
                this.executeTimeoutedAction(action, payload);
                return;
            }
            var _g = action.action;
            switch (_g) {
                case "executeAction":
                    var actionId = action.value;
                    var soundActions = this.cfg.actions.get(actionId);
                    this.executeActions(soundActions, actionId, payload);
                    break;
                case "executePlayPayloadAction":
                    var actionId1 = this.cfg.getReflectionSound(action.id, payload);
                    var soundActions1 = this.cfg.actions.get(actionId1);
                    this.executeActions(soundActions1, actionId1, payload);
                    break;
                case "playPayload":
                    var soundMap = this.cfg.getSoundMap(action.id);
                    if ((function($this) {
                            var $r;
                            var key = payload;
                            $r = _hcmn_.__map_reserved[key] != null ? soundMap.existsReserved(key) : soundMap.h.hasOwnProperty(key);
                            return $r;
                        }(this))) {
                        var sound;
                        var key1 = payload;
                        sound = _hcmn_.__map_reserved[key1] != null ? soundMap.getReserved(key1) : soundMap.h[key1];
                        this.soundPortHelper.playSound(sound, action.volume);
                    }
                    break;
                case "invokePayloadActionMap":
                    var soundMap1 = this.cfg.getSoundMap(action.id);
                    if ((function($this) {
                            var $r;
                            var key2 = payload;
                            $r = _hcmn_.__map_reserved[key2] != null ? soundMap1.existsReserved(key2) : soundMap1.h.hasOwnProperty(key2);
                            return $r;
                        }(this))) {
                        var actionId2;
                        var key3 = payload;
                        actionId2 = _hcmn_.__map_reserved[key3] != null ? soundMap1.getReserved(key3) : soundMap1.h[key3];
                        var soundActions2 = this.cfg.actions.get(actionId2);
                        this.executeActions(soundActions2, actionId2, payload);
                    }
                    break;
                case "unlockAction":
                    this.unlockActions(action.value);
                    break;
                case "lockAction":
                    this.lockActions(action.value);
                    break;
                case "playRandom":
                    var sound1 = this.cfg.getRadomSoundFromList(action.id);
                    this.soundPortHelper.playSound(sound1, action.volume);
                    break;
                case "fadeOut":
                    this.soundPortHelper.fadeOut(action.id, _hcmn_.Std.parseInt(action.value), false);
                    break;
                case "fadeIn":
                    this.soundPortHelper.fadeIn(action.id, _hcmn_.Std.parseInt(action.value));
                    break;
                case "stop":
                    this.soundPortHelper.stopSound(action.id);
                    break;
                case "mute":
                    this.soundPortHelper.setVolume(action.id, 0);
                    break;
                case "play":
                    var currentTime = new _hcmn_.Date().getTime();
                    if (currentTime - action.lastPlayedTime > 50) {
                        this.soundPortHelper.playSound(action.id, action.volume);
                        action.lastPlayedTime = currentTime;
                    }
                    break;
                case "playOnce":
                    this.soundPortHelper.playSoundOnce(action.id, action.volume);
                    break;
            }
        };
        wildFuryGameController.SoundController.prototype.executeTimeoutedAction = function(action, payload) {
            var _g = this;
            var timeoutId = window.setTimeout(function() {
                _g.executeAction(action, payload, false);
            }, action.timeout);
            var actionId = action.id + action.value;
            if (!this.timeouts.exists(actionId)) this.timeouts.set(actionId, [timeoutId]);
            else this.timeouts.get(actionId).push(timeoutId);
        };
        wildFuryGameController.SoundController.prototype.clearTimeouts = function(id) {
            if (this.timeouts.exists(id)) {
                var _g = 0;
                var _g1 = this.timeouts.get(id);
                while (_g < _g1.length) {
                    var timeoutId = _g1[_g];
                    ++_g;
                    window.clearTimeout(timeoutId);
                }
                this.timeouts.remove(id);
            }
        };
        wildFuryGameController.SoundController.prototype.unlockActions = function(id) {
            this.setLockStatusToActions(id, false);
        };
        wildFuryGameController.SoundController.prototype.lockActions = function(id) {
            this.setLockStatusToActions(id, true);
        };
        wildFuryGameController.SoundController.prototype.executeActions = function(soundActions, actionId, payload) {
            if (soundActions == null) soundActions = [];
            else soundActions = soundActions;
            if (soundActions.length == 0) this.logger.warn("sound actionId: " + actionId + " is not present");
            var _g = 0;
            while (_g < soundActions.length) {
                var soundAction = soundActions[_g];
                ++_g;
                if (soundAction.id == actionId) throw new js._Boot.HaxeError("soundAction: " + actionId + " wanted to play similar action; Possible stack overflow;");
                this.executeAction(soundAction, payload);
            }
        };
        wildFuryGameController.SoundController.prototype.setLockStatusToActions = function(id, value) {
            var actions = this.cfg.actions.get(id);
            if (actions == null) {
                this.logger.warn("action " + id + " is not declared in config file");
                return;
            }
            var _g = 0;
            while (_g < actions.length) {
                var action = actions[_g];
                ++_g;
                action.isLocked = value;
            }
        };
        wildFuryGameController.SoundController.prototype.__class__ = wildFuryGameController.SoundController;
        wildFuryGameController.SoundPortHelper = function(soundPort, frameRate) {
            this.soundsMap = new _hcmn_.haxe_ds_StringMap();
            this.fadeSoundsMap = new _hcmn_.haxe_ds_StringMap();
            this.soundsMuted = false;
            this.soundPort = soundPort;
            this.frameRate = frameRate;
            window.setInterval($bind(this, this.intervalHandler), null, frameRate);
            this.time = new _hcmn_.Date().getTime();
        };
        wildFuryGameController.SoundPortHelper.__name__ = ["wildFuryGameController", "SoundPortHelper"];
        wildFuryGameController.SoundPortHelper.prototype.soundsMuted = null;
        wildFuryGameController.SoundPortHelper.prototype.soundPort = null;
        wildFuryGameController.SoundPortHelper.prototype.fadeSoundsMap = null;
        wildFuryGameController.SoundPortHelper.prototype.soundsMap = null;
        wildFuryGameController.SoundPortHelper.prototype.time = null;
        wildFuryGameController.SoundPortHelper.prototype.frameRate = null;
        wildFuryGameController.SoundPortHelper.prototype.fadeIn = function(soundId, fadeTimeout) {
            if (!this.fadeSoundsMap.exists(soundId)) {
                this.playSound(soundId, this.getSound(soundId).volume);
                var value = new components.gamecontroller.impl.sound.FadeValue(soundId, fadeTimeout, 0);
                this.fadeSoundsMap.set(soundId, value);
            }
            var fadedSoundValue = this.fadeSoundsMap.get(soundId);
            fadedSoundValue.stopAfterComplete = false;
            fadedSoundValue.timeout = fadeTimeout;
            if (fadedSoundValue.volume < 0) fadedSoundValue.volume = 0;
            fadedSoundValue.volumeOFsset = (1 - fadedSoundValue.volume) / (fadeTimeout / this.frameRate);
        };
        wildFuryGameController.SoundPortHelper.prototype.fadeOut = function(soundId, fadeTimeout, stopAfterComplete) {
            if (stopAfterComplete == null) stopAfterComplete = true;
            if (!this.fadeSoundsMap.exists(soundId)) {
                this.playSoundOnce(soundId, this.getSound(soundId).volume);
                var value = new components.gamecontroller.impl.sound.FadeValue(soundId, fadeTimeout);
                this.fadeSoundsMap.set(soundId, value);
            }
            var fadedSoundValue = this.fadeSoundsMap.get(soundId);
            if (fadedSoundValue.volume > 1) fadedSoundValue.volume = 1;
            fadedSoundValue.stopAfterComplete = stopAfterComplete;
            fadedSoundValue.timeout = fadeTimeout;
            fadedSoundValue.volumeOFsset = -(fadedSoundValue.volume / (fadeTimeout / this.frameRate));
        };
        wildFuryGameController.SoundPortHelper.prototype.stopSound = function(sound) {
            if (this.isSoundValid(sound)) {
                this.getSound(sound).isPlayed = false;
                this.soundPort.stop().publish(sound);
                this.fadeSoundsMap.remove(sound);
            }
        };
        wildFuryGameController.SoundPortHelper.prototype.playSoundOnce = function(sound, volume) {
            if (volume == null) volume = 1;
            if (this.isSoundValid(sound) && !this.getSound(sound).isPlayed) this.playSound(sound, volume);
            else {
                this.setVolume(sound, volume);
                this.fadeSoundsMap.remove(sound);
            }
        };
        wildFuryGameController.SoundPortHelper.prototype.playSound = function(sound, volume) {
            if (volume == null) volume = 1;
            if (this.isSoundValid(sound)) {
                this.fadeSoundsMap.remove(sound);
                this.soundPort.play().publish(sound);
                this.getSound(sound).isPlayed = true;
                if (volume != 1) this.setVolume(sound, volume);
                if (this.soundsMuted) this.soundPort.mute().publish(sound);
            }
        };
        wildFuryGameController.SoundPortHelper.prototype.setVolume = function(sound, volume) {
            if (volume == null) volume = 1;
            this.soundPort.volume().publish(new soundManagerApi.SoundVolumeData(sound, volume));
            this.getSound(sound).volume = volume;
        };
        wildFuryGameController.SoundPortHelper.prototype.isSoundsMuted = function() {
            return this.soundsMuted;
        };
        wildFuryGameController.SoundPortHelper.prototype.isSoundValid = function(sound) {
            return sound != null && sound.length > 0;
        };
        wildFuryGameController.SoundPortHelper.prototype.turnOnSounds = function() {
            this.soundPort.unmuteAll().publish(null);
            this.soundsMuted = false;
        };
        wildFuryGameController.SoundPortHelper.prototype.turnOffSounds = function() {
            this.soundPort.muteAll().publish(null);
            this.soundsMuted = true;
        };
        wildFuryGameController.SoundPortHelper.prototype.intervalHandler = function() {
            var currentTime = new _hcmn_.Date().getTime();
            var dt = currentTime - this.time;
            this.time = currentTime;
            var $it0 = this.fadeSoundsMap.iterator();
            while ($it0.hasNext()) {
                var soundValue = $it0.next();
                if (soundValue.timeout <= 0) {
                    if (soundValue.stopAfterComplete) {
                        this.soundPort.stop().publish(soundValue.sound);
                        this.fadeSoundsMap.remove(soundValue.sound);
                        this.getSound(soundValue.sound).isPlayed = soundValue.volume == 1;
                    }
                    continue;
                }
                soundValue.timeout -= dt;
                if (soundValue.volumeOFsset == 0) continue;
                var isFadeOut = soundValue.volumeOFsset < 0;
                if (isFadeOut && soundValue.volume == 0 || !isFadeOut && soundValue.volume == 1) continue;
                soundValue.volume += soundValue.volumeOFsset * (dt / this.frameRate);
                if (soundValue.volume < .005) soundValue.volume = 0;
                else if (soundValue.volume > 1) soundValue.volume = 1;
                this.setVolume(soundValue.sound, soundValue.volume);
            }
        };
        wildFuryGameController.SoundPortHelper.prototype.getSound = function(sound) {
            if (!this.soundsMap.exists(sound)) {
                var value = new components.gamecontroller.impl.sound.Sound(sound);
                this.soundsMap.set(sound, value);
            }
            return this.soundsMap.get(sound);
        };
        wildFuryGameController.SoundPortHelper.prototype.__class__ = wildFuryGameController.SoundPortHelper;
        if (!components.gamecontroller.impl.sound) {
            components.gamecontroller.impl.sound = {};
        };
        components.gamecontroller.impl.sound.FadeValue = function(sound, timeout, volume) {
            if (volume == null) volume = 1;
            this.volumeOFsset = 0;
            this.volume = 1;
            this.sound = sound;
            this.timeout = timeout;
            this.volume = volume;
        };
        components.gamecontroller.impl.sound.FadeValue.__name__ = ["components", "gamecontroller", "impl", "sound", "FadeValue"];
        components.gamecontroller.impl.sound.FadeValue.prototype.sound = null;
        components.gamecontroller.impl.sound.FadeValue.prototype.timeout = null;
        components.gamecontroller.impl.sound.FadeValue.prototype.volume = null;
        components.gamecontroller.impl.sound.FadeValue.prototype.stopAfterComplete = null;
        components.gamecontroller.impl.sound.FadeValue.prototype.volumeOFsset = null;
        components.gamecontroller.impl.sound.FadeValue.prototype.__class__ = components.gamecontroller.impl.sound.FadeValue;
        components.gamecontroller.impl.sound.Sound = function(sound) {
            this.isLocked = false;
            this.isPlayed = false;
            this.volume = 1;
        };
        components.gamecontroller.impl.sound.Sound.__name__ = ["components", "gamecontroller", "impl", "sound", "Sound"];
        components.gamecontroller.impl.sound.Sound.prototype.sound = null;
        components.gamecontroller.impl.sound.Sound.prototype.volume = null;
        components.gamecontroller.impl.sound.Sound.prototype.isPlayed = null;
        components.gamecontroller.impl.sound.Sound.prototype.isLocked = null;
        components.gamecontroller.impl.sound.Sound.prototype.__class__ = components.gamecontroller.impl.sound.Sound;
        wildFuryGameController.ConditionsCollector = function(map, conditions) {
            this.map = map;
            var $it0 = map.keys();
            while ($it0.hasNext()) {
                var condition = $it0.next();
                this.addCondition(condition);
            }
            if (conditions != null) {
                var _g = 0;
                while (_g < conditions.length) {
                    var condition1 = conditions[_g];
                    ++_g;
                    this.addCondition(condition1);
                }
            }
        };
        wildFuryGameController.ConditionsCollector.__name__ = ["wildFuryGameController", "ConditionsCollector"];
        wildFuryGameController.ConditionsCollector.prototype.callback = null;
        wildFuryGameController.ConditionsCollector.prototype.map = null;
        wildFuryGameController.ConditionsCollector.prototype.addCondition = function(id, status) {
            if (status == null) status = false;
            this.map.set(id, status);
        };
        wildFuryGameController.ConditionsCollector.prototype.getStatus = function(id) {
            return !this.map.exists(id) || this.map.get(id);
        };
        wildFuryGameController.ConditionsCollector.prototype.resolveConditions = function(conditions) {
            var _g = 0;
            while (_g < conditions.length) {
                var condition = conditions[_g];
                ++_g;
                this.resolveCondition(condition);
            }
        };
        wildFuryGameController.ConditionsCollector.prototype.resolveCondition = function(id) {
            if (this.map.exists(id)) {
                this.map.set(id, true);
                if (this.isFinished()) {
                    this.clearAll();
                    this.callback();
                }
            }
        };
        wildFuryGameController.ConditionsCollector.prototype.isFinished = function() {
            var out = true;
            var $it0 = this.map.iterator();
            while ($it0.hasNext()) {
                var value = $it0.next();
                out = out && value;
            }
            return out;
        };
        wildFuryGameController.ConditionsCollector.prototype.clearAll = function() {
            var $it0 = this.map.keys();
            while ($it0.hasNext()) {
                var key = $it0.next();
                this.map.remove(key);
            }
        };
        wildFuryGameController.ConditionsCollector.prototype.resolveAll = function() {
            if (_hcmn_.Lambda.array(this.map).length > 0) {
                this.clearAll();
                this.callback();
            }
        };
        wildFuryGameController.ConditionsCollector.prototype.then = function(callback) {
            this.callback = callback;
            return this;
        };
        wildFuryGameController.ConditionsCollector.prototype.__class__ = wildFuryGameController.ConditionsCollector;
        wildFuryGameController.EnumConditionsCollector = function(value) {
            var values = _hcmn_.Lambda.array(_hcmn_.Lambda.map(_hcmn_.Type.getEnumConstructs(value), function(e) {
                return _hcmn_.Type.createEnum(value, e, null);
            }));
            wildFuryGameController.ConditionsCollector.call(this, new haxe.ds.EnumValueMap(), values);
        };
        wildFuryGameController.EnumConditionsCollector.__name__ = ["wildFuryGameController", "EnumConditionsCollector"];
        wildFuryGameController.EnumConditionsCollector.__super__ = wildFuryGameController.ConditionsCollector;
        for (var k in wildFuryGameController.ConditionsCollector.prototype) wildFuryGameController.EnumConditionsCollector.prototype[k] = wildFuryGameController.ConditionsCollector.prototype[k];
        wildFuryGameController.EnumConditionsCollector.prototype.__class__ = wildFuryGameController.EnumConditionsCollector;
        wildFuryGameController.StringsConditionsCollector = function(conditions) {
            wildFuryGameController.ConditionsCollector.call(this, new _hcmn_.haxe_ds_StringMap(), conditions);
        };
        wildFuryGameController.StringsConditionsCollector.__name__ = ["wildFuryGameController", "StringsConditionsCollector"];
        wildFuryGameController.StringsConditionsCollector.__super__ = wildFuryGameController.ConditionsCollector;
        for (var k in wildFuryGameController.ConditionsCollector.prototype) wildFuryGameController.StringsConditionsCollector.prototype[k] = wildFuryGameController.ConditionsCollector.prototype[k];
        wildFuryGameController.StringsConditionsCollector.prototype.__class__ = wildFuryGameController.StringsConditionsCollector;
        if (typeof haxe == 'undefined') {
            var haxe = {};
        };

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

            get: function(k) {
                return {
                    arguments: ["*"],
                    returns: "null"
                };
            },
            set: function(k, v) {
                return {
                    arguments: ["*", "*"],
                    returns: "void"
                };
            },
            exists: function(k) {
                return {
                    arguments: ["*"],
                    returns: "boolean"
                };
            },
            remove: function(k) {
                return {
                    arguments: ["*"],
                    returns: "boolean"
                };
            },
            keys: function() {
                return {
                    arguments: [],
                    returns: "null"
                };
            },
            iterator: 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.remove = function(key) {
            try {
                this.root = this.removeLoop(key, this.root);
                return true;
            } catch (e) {
                if (e instanceof js._Boot.HaxeError) e = e.val;
                if (_hcmn_.js_Boot.__instanceof(e, String)) {
                    return false;
                } else throw (e);
            }
        };
        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.iterator = function() {
            var ret = [];
            this.iteratorLoop(this.root, ret);
            return _hcmn_.HxOverrides.iter(ret);
        };
        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.removeLoop = function(k, node) {
            if (node == null) throw new js._Boot.HaxeError("Not_found");
            var c = this.compare(k, node.key);
            if (c == 0) return this.merge(node.left, node.right);
            else if (c < 0) return this.balance(this.removeLoop(k, node.left), node.key, node.value, node.right);
            else return this.balance(node.left, node.key, node.value, this.removeLoop(k, node.right));
        };
        haxe.ds.BalancedTree.prototype.iteratorLoop = function(node, acc) {
            if (node != null) {
                this.iteratorLoop(node.left, acc);
                acc.push(node.value);
                this.iteratorLoop(node.right, acc);
            }
        };
        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.merge = function(t1, t2) {
            if (t1 == null) return t2;
            if (t2 == null) return t1;
            var t = this.minBinding(t2);
            return this.balance(t1, t.key, t.value, this.removeMinBinding(t2));
        };
        haxe.ds.BalancedTree.prototype.minBinding = function(t) {
            if (t == null) throw new js._Boot.HaxeError("Not_found");
            else if (t.left == null) return t;
            else return this.minBinding(t.left);
        };
        haxe.ds.BalancedTree.prototype.removeMinBinding = function(t) {
            if (t.left == null) return t.right;
            else return this.balance(this.removeMinBinding(t.left), t.key, t.value, t.right);
        };
        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 (!haxe.ds._StringMap) {
            haxe.ds._StringMap = {};
        };
        haxe.ds._StringMap.StringMapIterator = function(map, keys) {
            this.map = map;
            this.keys = keys;
            this.index = 0;
            this.count = keys.length;
        };
        haxe.ds._StringMap.StringMapIterator.__name__ = ["haxe", "ds", "_StringMap", "StringMapIterator"];
        haxe.ds._StringMap.StringMapIterator.prototype.map = null;
        haxe.ds._StringMap.StringMapIterator.prototype.keys = null;
        haxe.ds._StringMap.StringMapIterator.prototype.index = null;
        haxe.ds._StringMap.StringMapIterator.prototype.count = null;
        haxe.ds._StringMap.StringMapIterator.prototype.hasNext = function() {
            return this.index < this.count;
        };
        haxe.ds._StringMap.StringMapIterator.prototype.next = function() {
            return this.map.get(this.keys[this.index++]);
        };
        haxe.ds._StringMap.StringMapIterator.prototype.__class__ = haxe.ds._StringMap.StringMapIterator;
        if (typeof js == 'undefined') {
            var js = {};
        };
        if (!js._Boot) {
            js._Boot = {};
        };
        js._Boot.HaxeError = function(val) {
            Error.call(this);
            this.val = val;
            this.message = String(val);
            if (Error.captureStackTrace) Error.captureStackTrace(this, js._Boot.HaxeError);
        };
        js._Boot.HaxeError.__name__ = ["js", "_Boot", "HaxeError"];
        js._Boot.HaxeError.__super__ = Error;
        for (var k in Error.prototype) js._Boot.HaxeError.prototype[k] = Error.prototype[k];
        js._Boot.HaxeError.prototype.val = null;
        js._Boot.HaxeError.prototype.__class__ = js._Boot.HaxeError;
        wildFuryGameController.AnimationConditions.EXPANDING_FINISHED = "expanding_animatorFinished";;
        wildFuryGameController.AnimationConditions.ANIMATOR_FINISHED = "animatorFinished";;
        wildFuryGameController.AnimationConditions.METER_FINISHED = "meterFinished";;
        wildFuryGameController.AnimationConditions.WILD_COUNTER_FINISHED = "WILD_COUNTER_FINISHED";;
        wildFuryGameController.AnimationConditions.FREESPIN_COUNTER_FINISHED = "FREESPIN_COUNTER_FINISHED";;
        wildFuryGameController.AnimationConditions.REELS_STOPPED = "REELS_STOPPED";;
        wildFuryGameController.GameModel.LEVELUP_SYMBOLS_REEL_INDEX = 2;;
        wildFuryGameController.GameModel.MAX_JACKPOT_LEVEL_VALUE = 11;;
        wildFuryGameController.GameModel.CELLS_NUM = 6;;
        wildFuryGameController.GameModel.REELS_NUM = 5;;
        wildFuryGameController.GameModel.LEVEL_UP = "LevelUp";;
        wildFuryGameController.GameModel.LEVEL_DOUBLE_UP = "LevelDoubleUp";;
        wildFuryGameController.GameModel.DOUBLE_LEVELUP_SYMBOL_ID = "15";;
        wildFuryGameController.StateMachineDef.ID = "GAMECONTROLLERSM_";;
        wildFuryGameController.StateMachineDef.FS_INTRO_ENDED = "FS_INTRO_ENDED";;
        wildFuryGameController.StateMachineDef.START_REEL_SPIN = "START_REEL_SPIN";;
        wildFuryGameController.StateMachineDef.PRESENT_SPIN_OUTCOME = "PRESENT_SPIN_OUTCOME";;
        wildFuryGameController.StateMachineDef.FS_ENDED = "FS_ENDED";;
        wildFuryGameController.StateMachineDef.CONTINUE_ENABLED = "CONTINUE_ENABLED";;
        wildFuryGameController.StateMachineDef.ABORT_SPIN = "ABORT_SPIN";;
        wildFuryGameController.StateMachineDef.SPIN_ENABLED = "SPIN_ENABLED";;
        wildFuryGameController.StateMachineDef.PRESENT_RESULT = "PRESENT_RESULT";;
        wildFuryGameController.StateMachineDef.INIT_ACTION = "INIT_ACTION";;
        wildFuryGameController.StateMachineDef.STOP_REEL_SPIN = "STOP_REEL_SPIN";;
        wildFuryGameController.StateMachineDef.PREPARE_RESUME = "PREPARE_RESUME";;
        wildFuryGameController.StateMachineDef.FS_WIN_SHOWN = "FS_WIN_SHOWN";;
        wildFuryGameController.StateMachineDef.CONTINUE = "CONTINUE";;
        wildFuryGameController.StateMachineDef.SPIN_STARTING_ENDED = "SPIN_STARTING_ENDED";;
        wildFuryGameController.StateMachineDef.LOADING_STATE = "LOADING_STATE";;
        wildFuryGameController.StateMachineDef.PREPARE_RESUME_STATE = "PREPARE_RESUME_STATE";;
        wildFuryGameController.StateMachineDef.INIT_STATE = "INIT_STATE";;
        wildFuryGameController.StateMachineDef.IDLE_STATE = "IDLE_STATE";;
        wildFuryGameController.StateMachineDef.SPINNING_STATE = "SPINNING_STATE";;
        wildFuryGameController.StateMachineDef.FS_IDLE = "FS_IDLE";;
        wildFuryGameController.StateMachineDef.ABORT_SPIN_STATE = "ABORT_SPIN_STATE";;
        wildFuryGameController.StateMachineDef.STOPPING_STATE = "STOPPING_STATE";;
        wildFuryGameController.StateMachineDef.AWARD_CAP_STATE = "AWARD_CAP_STATE";;
        wildFuryGameController.StateMachineDef.AWARD_CAP_PREPARE = "AWARD_CAP_PREPARE";;
        wildFuryGameController.StateMachineDef.SHOW_SCATTERS_WIN = "SHOW_SCATTERS_WIN";;
        wildFuryGameController.StateMachineDef.BASEGAME_OUTCOME = "BASEGAME_OUTCOME";;
        wildFuryGameController.StateMachineDef.FS_OUTCOME = "FS_OUTCOME";;
        wildFuryGameController.StateMachineDef.FS_INTRO = "FS_ENTRY";;
        wildFuryGameController.StateMachineDef.FS_OUTCOME_PRESENTED = "FS_OUTCOME_PRESENTED";;
        wildFuryGameController.StateMachineDef.FS_SUMMARY = "FS_SUMMARY";;
        wildFuryGameController.StateMachineDef.BET_CONFIRM = "BET_CONFIRM";;
        wildFuryGameController.StateMachineDef.SHOW_WIN_STATE = "SHOW_WIN_STATE";;
        wildFuryGameController.StateMachineDef.SPIN_STARTING_STATE = "SPIN_STARTING_STATE";;
        wildFuryGameController.StateMachineDef.START_BONUS_INTRO = "START_BONUS_INTRO";;
        wildFuryGameController.StateMachineDef.PICKER_STATE = "PICKER_STATE";;
        wildFuryGameController.StateMachineDef.ABORT_PICKER_STATE = "ABORT_PICKER_STATE";;
        wildFuryGameController.StateMachineDef.SET_PICKER_IDLE = "SET_PICKER_IDLE";;
        wildFuryGameController.StateMachineDef.BONUS_INTRO_FINISHED = "BONUS_INTRO_FINISHED";;
        wildFuryGameController.StateMachineDef.BONUS_OUTRO_STATE = "BONUS_OUTRO_STATE";;
        wildFuryGameController.StateMachineDef.BONUS_INTRO_STATE = "BONUS_INTRO_STATE";;
        wildFuryGameController.StateMachineDef.FSM = "<fsm initial='LOADING_STATE'>\r\n  <state name='LOADING_STATE'>\r\n    <transition target='PREPARE_RESUME_STATE' action='PREPARE_RESUME'/>\r\n    <transition target='INIT_STATE' action='INIT_ACTION'/>\r\n    <operation type='do' method='attachComponents'/>\r\n  </state>\r\n  <state name='PREPARE_RESUME_STATE'>\r\n    <transition target='FS_IDLE' action='CONTINUE_ENABLED'/>\r\n    <transition target='PICKER_STATE' action='SET_PICKER_IDLE'/>\r\n    <operation type='do' method='prepareResume'/>\r\n  </state>\r\n  <state name='INIT_STATE'>\r\n    <transition target='IDLE_STATE' action='SPIN_ENABLED'/>\r\n    <operation type='do' method='initGame'/>\r\n  </state>\r\n  <state name='IDLE_STATE'>\r\n    <transition target='SPIN_STARTING_STATE' action='START_REEL_SPIN'/>\r\n    <operation type='do' method='onBaseGameIdle'/>\r\n    <operation type='exit' method='updateBetPanel'/>\r\n  </state>\r\n  <state name='SPIN_STARTING_STATE'>\r\n    <transition target='SPINNING_STATE' action='SPIN_STARTING_ENDED'/>\r\n    <operation type='do' method='clearAllWins'/>\r\n    <operation type='do' method='startSpin'/>\r\n  </state>\r\n  <state name='SPINNING_STATE'>\r\n    <transition target='STOPPING_STATE' action='STOP_REEL_SPIN'/>\r\n    <transition target='ABORT_SPIN_STATE' action='ABORT_SPIN'/>\r\n    <operation type='do' method='checkForStopOrAbort'/>\r\n  </state>\r\n  <state name='FS_IDLE'>\r\n    <transition target='SPIN_STARTING_STATE' action='START_REEL_SPIN'/>\r\n    <operation type='do' method='executeContinueCommand'/>\r\n    <operation type='exit' method='updateInfoBarFreeSpinsCounter'/>\r\n  </state>\r\n  <state name='ABORT_SPIN_STATE'>\r\n    <transition target='IDLE_STATE' action='SPIN_ENABLED'/>\r\n    <transition target='FS_IDLE' action='CONTINUE_ENABLED'/>\r\n    <operation type='entry' method='applyAbortData'/>\r\n  </state>\r\n  <state name='STOPPING_STATE'>\r\n    <transition target='SHOW_SCATTERS_WIN' condition='!awardCapExceeded,Stage==BaseGame,NextStage==PickerWheelBonus' action='PRESENT_SPIN_OUTCOME'/>\r\n    <transition target='BASEGAME_OUTCOME' condition='!awardCapExceeded,Stage==BaseGame,NextStage==BaseGame' action='PRESENT_SPIN_OUTCOME'/>\r\n    <transition target='SHOW_WIN_STATE' condition='!awardCapExceeded,Stage==FreeSpin' action='PRESENT_SPIN_OUTCOME'/>\r\n    <transition target='AWARD_CAP_PREPARE' condition='awardCapExceeded' action='PRESENT_SPIN_OUTCOME'/>\r\n    <operation type='entry' method='displayDragons'/>\r\n  </state>\r\n  <state name='AWARD_CAP_PREPARE'>\r\n    <transition target='AWARD_CAP_STATE' action='PRESENT_RESULT'/>\r\n    <operation type='do' method='publishSpinOutcomePresented'/>\r\n    <operation type='do' method='setBaseGameOutcome'/>\r\n  </state>\r\n  <state name='AWARD_CAP_STATE'>\r\n    <transition target='BET_CONFIRM' action='CONTINUE'/>\r\n    <operation type='do' method='showAwardCapScreen'/>\r\n  </state>\r\n  <state name='BASEGAME_OUTCOME'>\r\n    <transition target='BET_CONFIRM' action='PRESENT_RESULT'/>\r\n    <operation type='entry' method='showBaseGameWins'/>\r\n    <operation type='entry' method='displayBaseGameWin'/>\r\n    <operation type='exit' method='resumePromoMessages'/>\r\n  </state>\r\n  <state name='SHOW_WIN_STATE'>\r\n    <transition target='FS_OUTCOME_PRESENTED' action='CONTINUE'/>\r\n    <operation type='do' method='presentFreeSpinOutcome'/>\r\n  </state>\r\n  <state name='FS_OUTCOME_PRESENTED'>\r\n    <transition target='FS_IDLE' action='CONTINUE_ENABLED'/>\r\n    <transition target='FS_SUMMARY' action='PRESENT_RESULT'/>\r\n    <operation type='do' method='publishSpinOutcomePresented'/>\r\n  </state>\r\n  <state name='FS_SUMMARY'>\r\n    <transition target='BET_CONFIRM' action='FS_ENDED'/>\r\n    <operation type='do' method='showBonusGameSummary'/>\r\n    <operation type='entry' method='setBaseGameOutcome'/>\r\n    <operation type='exit' method='displayTotalWin'/>\r\n  </state>\r\n  <state name='BET_CONFIRM'>\r\n    <transition target='IDLE_STATE' action='SPIN_ENABLED'/>\r\n    <transition target='SPIN_STARTING_STATE' action='START_REEL_SPIN'/>\r\n    <operation type='do' method='publishResultPresented'/>\r\n  </state>\r\n\r\n  <state name='SHOW_SCATTERS_WIN'>\r\n    <transition target='BONUS_INTRO_STATE' action='START_BONUS_INTRO'/>\r\n    <operation type='do' method='showScatterWins'/>\r\n    <operation type='do' method='publishSpinOutcomePresented'/>\r\n  </state>\r\n  <state name='BONUS_OUTRO_STATE'>\r\n    <transition target='FS_IDLE' action='CONTINUE_ENABLED'/>\r\n    <operation type='do' method = 'stopPickerWheel' />\r\n  </state>\r\n  <state name='BONUS_INTRO_STATE'>\r\n    <transition target='PICKER_STATE' action='BONUS_INTRO_FINISHED'/>\r\n    <operation type='do' method='showBonusIntroAnimation'/>\r\n  </state>\r\n\r\n  <state name='PICKER_STATE'>\r\n    <transition target='BONUS_OUTRO_STATE' action='BONUS_OUTRO_STATE'/>\r\n    <transition target='ABORT_PICKER_STATE' action='ABORT_SPIN'/>\r\n    <operation type='do' method='showPicker'/>\r\n  </state>\r\n\r\n  <state name='ABORT_PICKER_STATE'>\r\n    <transition target='PICKER_STATE' action='SET_PICKER_IDLE'/>\r\n    <operation type='do' method='abortPicker'/>\r\n  </state>\r\n\r\n</fsm>";;
        return {
            exports: wildFuryGameController,
            activator: wildFuryGameController.Activator
        };
    });
//# sourceURL=wildFuryGameController.js