define("winControllerPlugin", ["viewBuilderApi", "componentmodelComponentApi", "translationmanagerApi", "clientkernelLoaderApi", "slotModelApi", "uiHelper", "winControllerApi", "displayEngineApi", "reelsApi", "commonTools", "PIXI", "BABYLON", "clientkernelEventbusApi", "clientkernelModulesApi", "clientkernelLoggerApi", "moneyApi"],
    function(viewBuilderApi, componentmodelComponentApi, translationmanagerApi, clientkernelLoaderApi, slotModelApi, uiHelper, winControllerApi, displayEngineApi, reelsApi, commonTools, PIXI, BABYLON, clientkernelEventbusApi, clientkernelModulesApi, clientkernelLoggerApi, 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 winControllerPlugin == 'undefined') {
            var winControllerPlugin = {};
        };
        winControllerPlugin.Activator = function(context) {};
        winControllerPlugin.Activator = ck_implements(winControllerPlugin.Activator, clientkernelModulesApi.IModuleActivator);
        winControllerPlugin.Activator.__interfaces__ = [clientkernelModulesApi.IModuleActivator];
        winControllerPlugin.Activator.__name__ = ["winControllerPlugin", "Activator"];
        winControllerPlugin.Activator.prototype.start = function(context) {
            context.getServiceTracker([viewBuilderApi.IViewBuilderFactory, clientkernelLoaderApi.IAssetRegistry, displayEngineApi.IDisplayProvider, winControllerApi.IWinControllerPluginService]).then($bind(this, this.initialize));
        };
        winControllerPlugin.Activator.prototype.initialize = function(context) {
            winControllerPlugin.ExternalService.initialize(context, function() {
                var assetRegistry = context.getAnyService(clientkernelLoaderApi.IAssetRegistry);
                var spaghettiWinControllerPlugin = new winControllerPlugin.SpaghettiWinControllerPlugin(assetRegistry, context);
                var winLinesAdaptationPlugin = new winControllerPlugin.WinLinesAdaptationPlugin(assetRegistry, context);
                var underWinSymbolsAnimationPlugin = new winControllerPlugin.AdditionalWinSymbolsAnimationPlugin(assetRegistry, context, false);
                var aboveWinSymbolsAnimationPlugin = new winControllerPlugin.AdditionalWinSymbolsAnimationPlugin(assetRegistry, context, true);
                var detailWinPlugin = new winControllerPlugin.DetailWinPlugin(assetRegistry, context);
                var anticipationPlugin = new winControllerPlugin.AnticipationAnimationPlugin(assetRegistry, context);
                var landingSymbolsPlugin = new winControllerPlugin.LandingSymbolsPlugin(assetRegistry, context);
                var winControllerPluginService = context.getAnyService(winControllerApi.IWinControllerPluginService);
                winControllerPluginService.registerPlugin("CUSTOM_SPAGHETTI", spaghettiWinControllerPlugin);
                winControllerPluginService.registerPlugin("WIN_LINES_ADAPTATION_PLUGIN", winLinesAdaptationPlugin);
                winControllerPluginService.registerPlugin("UNDER_WIN_SYMBOLS", underWinSymbolsAnimationPlugin);
                winControllerPluginService.registerPlugin("ABOVE_WIN_SYMBOLS", aboveWinSymbolsAnimationPlugin);
                winControllerPluginService.registerPlugin("DETAIL_WIN", detailWinPlugin);
                winControllerPluginService.registerPlugin("ANTICIPATION", anticipationPlugin);
                winControllerPluginService.registerPlugin("LANDING_SYMBOLS", landingSymbolsPlugin);
            });
        };
        winControllerPlugin.Activator.prototype.stop = function(context) {};
        winControllerPlugin.Activator.main = function() {};
        winControllerPlugin.Activator.prototype.__class__ = winControllerPlugin.Activator;
        winControllerPlugin.BaseWinControllerPlugin = function(assetRegistry, context) {
            this.scaleFactor = 1.0;
            this.linesIdStack = [];
            this.assetRegistry = assetRegistry;
            this.viewBuilderFactory = context.getAnyService(viewBuilderApi.IViewBuilderFactory, null);
            var bus = context.getAnyService(clientkernelEventbusApi.IEventBus, null);
            this.busChanel = bus.getChannel("GFBus");
            this.busChanel.subscribe("wincontroller:showWin", $bind(this, this.onWinShowFirstTimeOnly));
            this.reelCellsHelper = winControllerPlugin.ExternalService.reelCellsHelper;
        };
        winControllerPlugin.BaseWinControllerPlugin = ck_implements(winControllerPlugin.BaseWinControllerPlugin, winControllerApi.IWinControllerPlugin);
        winControllerPlugin.BaseWinControllerPlugin.__interfaces__ = [winControllerApi.IWinControllerPlugin];
        winControllerPlugin.BaseWinControllerPlugin.__name__ = ["winControllerPlugin", "BaseWinControllerPlugin"];
        winControllerPlugin.BaseWinControllerPlugin.prototype.linesIdStack = null;
        winControllerPlugin.BaseWinControllerPlugin.prototype.reelLayoutModel = null;
        winControllerPlugin.BaseWinControllerPlugin.prototype.winAnimationRulesModel = null;
        winControllerPlugin.BaseWinControllerPlugin.prototype.winSymbolsModel = null;
        winControllerPlugin.BaseWinControllerPlugin.prototype.summaryWins = null;
        winControllerPlugin.BaseWinControllerPlugin.prototype.currentWin = null;
        winControllerPlugin.BaseWinControllerPlugin.prototype.loadedAssets = null;
        winControllerPlugin.BaseWinControllerPlugin.prototype.viewBuilderFactory = null;
        winControllerPlugin.BaseWinControllerPlugin.prototype.assetRegistry = null;
        winControllerPlugin.BaseWinControllerPlugin.prototype.busChanel = null;
        winControllerPlugin.BaseWinControllerPlugin.prototype.container = null;
        winControllerPlugin.BaseWinControllerPlugin.prototype.currentOutcome = null;
        winControllerPlugin.BaseWinControllerPlugin.prototype.scaleFactor = null;
        winControllerPlugin.BaseWinControllerPlugin.prototype.viewBuilderContainerProvider = null;
        winControllerPlugin.BaseWinControllerPlugin.prototype.animationPool = null;
        winControllerPlugin.BaseWinControllerPlugin.prototype.reelCellsHelper = null;
        winControllerPlugin.BaseWinControllerPlugin.prototype._isHighWin = null;
        winControllerPlugin.BaseWinControllerPlugin.prototype.onWinShowFirstTimeOnly = function(e) {
            this.linesIdStack = [];
        };
        winControllerPlugin.BaseWinControllerPlugin.prototype.dispose = function() {};
        winControllerPlugin.BaseWinControllerPlugin.prototype.ready = function() {};
        winControllerPlugin.BaseWinControllerPlugin.prototype.setContainer = function(container) {
            this.container = container;
        };
        winControllerPlugin.BaseWinControllerPlugin.prototype.setCurrentWin = function(type, win) {
            this.currentWin = win;
        };
        winControllerPlugin.BaseWinControllerPlugin.prototype.setOutcome = function(outcome) {
            this.currentOutcome = outcome;
        };
        winControllerPlugin.BaseWinControllerPlugin.prototype.setReelLayoutModel = function(reelLayoutModel) {
            this.reelLayoutModel = reelLayoutModel;
        };
        winControllerPlugin.BaseWinControllerPlugin.prototype.setWinAnimationRulesModel = function(winAnimationRulesModel) {
            this.winAnimationRulesModel = winAnimationRulesModel;
        };
        winControllerPlugin.BaseWinControllerPlugin.prototype.setWinSymbolsModel = function(winSymbolsModel) {
            this.winSymbolsModel = winSymbolsModel;
        };
        winControllerPlugin.BaseWinControllerPlugin.prototype.setLoadedAssets = function(loadedAssets) {
            this.loadedAssets = loadedAssets;
            this.viewBuilderContainerProvider = new uiHelper.ViewBuilderContainerProvider(this.viewBuilderFactory, loadedAssets, winControllerPlugin.BaseWinControllerPlugin.viewBuilderCache);
            var animationProvider = new uiHelper.VBAnimationComponentProvider(this.viewBuilderContainerProvider);
            var autogenAnimationPool = new uiHelper.AutogenAnimationPool(animationProvider, winControllerPlugin.BaseWinControllerPlugin.pool);
            this.animationPool = new uiHelper.AnimationPool(autogenAnimationPool);
            this.setScaleFactorFromAsset(this.getAssetNameForScale());
        };
        winControllerPlugin.BaseWinControllerPlugin.prototype.setScaleFactorFromAsset = function(name) {
            if (name != null) {
                var vba = this.loadedAssets.get(name);
                this.scaleFactor = vba.getConfiguration().scalefactor;
            }
        };
        winControllerPlugin.BaseWinControllerPlugin.prototype.getAssetNameForScale = function() {
            return "WIN_SYMBOLS_MERGED_VB";
        };
        winControllerPlugin.BaseWinControllerPlugin.prototype.showSummery = function(wins) {
            this.summaryWins = wins;
        };
        winControllerPlugin.BaseWinControllerPlugin.prototype.checkFirstCycle = function(lineId) {
            if (_hcmn_.HxOverrides.indexOf(this.linesIdStack, lineId, 0) >= 0) return false;
            else {
                this.linesIdStack.push(lineId);
                return true;
            }
        };
        winControllerPlugin.BaseWinControllerPlugin.prototype.isFreeSpinsTriggered = function() {
            if (this.currentOutcome.customField == null) return false;
            return this.currentOutcome.customField.freeSpinsTriggered == true;
        };
        winControllerPlugin.BaseWinControllerPlugin.prototype.get_isHighWin = function() {
            return this._isHighWin;
        };
        winControllerPlugin.BaseWinControllerPlugin.prototype.set_isHighWin = function(value) {
            this._isHighWin = value;
        };
        winControllerPlugin.BaseWinControllerPlugin.prototype.__class__ = winControllerPlugin.BaseWinControllerPlugin;
        winControllerPlugin.AdditionalWinSymbolsAnimationPlugin = function(assetRegistry, context, isAbove) {
            this.vbAnimations = [];
            winControllerPlugin.BaseWinControllerPlugin.call(this, assetRegistry, context);
            this.winControllerPluginServiceHelper = new winControllerPlugin.WinControllerPluginServiceHelper(context.getAnyService(winControllerApi.IWinControllerPluginService));
            this.winControllerConfiguration = winControllerPlugin.ExternalService.reelCellsHelper.winControllerConfiguration;
            this.winSymbolsScale = this.winControllerConfiguration.winSymbolsScale;
            this.isAbove = isAbove;
        };
        winControllerPlugin.AdditionalWinSymbolsAnimationPlugin.__name__ = ["winControllerPlugin", "AdditionalWinSymbolsAnimationPlugin"];
        winControllerPlugin.AdditionalWinSymbolsAnimationPlugin.__super__ = winControllerPlugin.BaseWinControllerPlugin;
        for (var k in winControllerPlugin.BaseWinControllerPlugin.prototype) winControllerPlugin.AdditionalWinSymbolsAnimationPlugin.prototype[k] = winControllerPlugin.BaseWinControllerPlugin.prototype[k];
        winControllerPlugin.AdditionalWinSymbolsAnimationPlugin.prototype.winControllerPluginServiceHelper = null;
        winControllerPlugin.AdditionalWinSymbolsAnimationPlugin.prototype.winControllerConfiguration = null;
        winControllerPlugin.AdditionalWinSymbolsAnimationPlugin.prototype.winSymbolsScale = null;
        winControllerPlugin.AdditionalWinSymbolsAnimationPlugin.prototype.isAbove = null;
        winControllerPlugin.AdditionalWinSymbolsAnimationPlugin.prototype.vbAnimations = null;
        winControllerPlugin.AdditionalWinSymbolsAnimationPlugin.prototype.intervalAnimator = null;
        winControllerPlugin.AdditionalWinSymbolsAnimationPlugin.prototype.ready = function() {
            winControllerPlugin.BaseWinControllerPlugin.prototype.ready.call(this);
            var stage = winControllerPlugin.ExternalService.displayProvider.getDefaultStage();
            var winLineInterval = this.winAnimationRulesModel.winRules.winLineInterval;
            var enterFrameListener = new uiHelper.StageEnterFrameListener(stage);
            this.intervalAnimator = new uiHelper.IntervalAnimator(enterFrameListener, winLineInterval);
        };
        winControllerPlugin.AdditionalWinSymbolsAnimationPlugin.prototype.setCurrentWin = function(type, win) {
            winControllerPlugin.BaseWinControllerPlugin.prototype.setCurrentWin.call(this, type, win);
            this.dispose();
            if (!this.reelCellsHelper.checkIsBlank(win.winningSymbol)) this.showAboveWinSymbols(win.lineId);
        };
        winControllerPlugin.AdditionalWinSymbolsAnimationPlugin.prototype.showAboveWinSymbols = function(lineId) {
            var allWinSymbolsPerLine = this.winControllerPluginServiceHelper.getAllWinSymbolsPerLine();
            var winSymbolsPerWinLine = allWinSymbolsPerLine.h[lineId];
            var $it0 = allWinSymbolsPerLine.iterator();
            while ($it0.hasNext()) {
                var winSymbols = $it0.next();
                var _g = 0;
                while (_g < winSymbols.length) {
                    var winSymbol = winSymbols[_g];
                    ++_g;
                    var animationContent = winSymbol.animationContent;
                    var isActiveSymbol = _hcmn_.HxOverrides.indexOf(winSymbolsPerWinLine, winSymbol, 0) >= 0;
                    if (isActiveSymbol) {
                        var winSymbolDefinition = this.getWinSymbolDefinitionByAnimationId(winSymbol.symbolName);
                        var position = this.getWinSymbolPosition(winSymbol);
                        var winAnimationID;
                        if (this.isAbove) winAnimationID = winSymbolDefinition.aboveWinAnimationID;
                        else winAnimationID = winSymbolDefinition.underWinAnimationID;
                        if (winAnimationID != null && winAnimationID != "" && winAnimationID != "null") {
                            var cycleAmountPerInterval = this.getWinSymbolDefinitionByAnimationId(winAnimationID).cycleAmountPerInterval;
                            this.generateAndPlayAnimation(winAnimationID, position, cycleAmountPerInterval);
                        }
                    }
                }
            }
            if (this.intervalAnimator.hasAnimations() && winControllerPlugin.BaseWinControllerPlugin.prototype.get_isHighWin.call(this) == "true") this.intervalAnimator.runSynchronizedDrawer();
        };
        winControllerPlugin.AdditionalWinSymbolsAnimationPlugin.prototype.getWinSymbolPosition = function(winSymbol) {
            var parent = winSymbol.animationContent.getDisplayObject().getParent();
            return new displayEngineApi.Point(parent.getX(), parent.getY());
        };
        winControllerPlugin.AdditionalWinSymbolsAnimationPlugin.prototype.generateAndPlayAnimation = function(winAnimationID, position, cycleAmountPerInterval) {
            var animationContent = this.animationPool.getAnimationFromPool(winAnimationID);
            this.prepareAnimation(animationContent, position);
            this.vbAnimations.push(animationContent);
            this.intervalAnimator.addAnimation(animationContent, cycleAmountPerInterval);
        };
        winControllerPlugin.AdditionalWinSymbolsAnimationPlugin.prototype.prepareAnimation = function(animationContent, position) {
            var displayObject = animationContent.getDisplayObject();
            animationContent.gotoAndStop(false, "loop");
            displayObject.setX(position.x);
            displayObject.setY(position.y);
            displayObject.setScale(this.winSymbolsScale / this.scaleFactor);
            this.container.addChild(displayObject);
        };
        winControllerPlugin.AdditionalWinSymbolsAnimationPlugin.prototype.dispose = function() {
            this.intervalAnimator.stopSynchronizedDrawer();
            this.intervalAnimator.removeAnimations();
            var _g = 0;
            var _g1 = this.vbAnimations;
            while (_g < _g1.length) {
                var vbAnimation = _g1[_g];
                ++_g;
                this.animationPool.backAnimationToPool(vbAnimation.getDisplayObject().getName(), vbAnimation);
            }
            this.vbAnimations = [];
        };
        winControllerPlugin.AdditionalWinSymbolsAnimationPlugin.prototype.getWinSymbolDefinitionByAnimationId = function(symbolName) {
            return this.winControllerConfiguration.winSymbolsMap.filter(function(winSymbolDefinition) {
                return winSymbolDefinition.winAnimationID == symbolName;
            })[0];
        };
        winControllerPlugin.AdditionalWinSymbolsAnimationPlugin.prototype.__class__ = winControllerPlugin.AdditionalWinSymbolsAnimationPlugin;
        winControllerPlugin.AnticipationAnimationPlugin = function(assetRegistry, context) {
            this.vbAnimations = [];
            winControllerPlugin.BaseWinControllerPlugin.call(this, assetRegistry, context);
        };
        winControllerPlugin.AnticipationAnimationPlugin.__name__ = ["winControllerPlugin", "AnticipationAnimationPlugin"];
        winControllerPlugin.AnticipationAnimationPlugin.__super__ = winControllerPlugin.BaseWinControllerPlugin;
        for (var k in winControllerPlugin.BaseWinControllerPlugin.prototype) winControllerPlugin.AnticipationAnimationPlugin.prototype[k] = winControllerPlugin.BaseWinControllerPlugin.prototype[k];
        winControllerPlugin.AnticipationAnimationPlugin.prototype.config = null;
        winControllerPlugin.AnticipationAnimationPlugin.prototype.vbAnimations = null;
        winControllerPlugin.AnticipationAnimationPlugin.prototype.tensionReels = null;
        winControllerPlugin.AnticipationAnimationPlugin.prototype.ready = function() {
            var _g = this;
            this.assetRegistry.getAsset("DETAIL_WIN").getContent().then(function(data) {
                _g.init(data.anticipation);
            });
        };
        winControllerPlugin.AnticipationAnimationPlugin.prototype.getAssetNameForScale = function() {
            return "ANTICIPATION";
        };
        winControllerPlugin.AnticipationAnimationPlugin.prototype.init = function(config) {
            this.config = config;
            this.busChanel.subscribe("reels:stopSpin", $bind(this, this.onStopSpin));
            this.busChanel.subscribe("reels:reelStopped", $bind(this, this.onReelStopped));
            this.runInitializingCache();
        };
        winControllerPlugin.AnticipationAnimationPlugin.prototype.runInitializingCache = function() {
            var _g = this;
            var stage = winControllerPlugin.ExternalService.displayProvider.getDefaultStage();
            var assetId = this.config.assetId;
            var animationFromPool = this.animationPool.getAnimationFromPool(assetId);
            animationFromPool.getDisplayObject().setAlpha(0.001);
            stage.addChild(animationFromPool.getDisplayObject());
            animationFromPool.play(false);
            window.setTimeout(function() {
                animationFromPool.stop();
                animationFromPool.getDisplayObject().setAlpha(1);
                _g.animationPool.backAnimationToPool(assetId, animationFromPool);
                stage.removeChild(animationFromPool.getDisplayObject());
            }, 1000);
        };
        winControllerPlugin.AnticipationAnimationPlugin.prototype.onStopSpin = function(e) {
            this.tensionReels = e.getPayload().tensionReels;
        };
        winControllerPlugin.AnticipationAnimationPlugin.prototype.onReelStopped = function(e) {
            this.dispose();
            var nextReelId = e.getPayload() + 1;
            if (this.isAnticipationReel(nextReelId)) {
                this.showAnimation(nextReelId);
                winControllerPlugin.ExternalService.busChanel.publish("Anticipation:introAnimationStarted", null);
            }
        };
        winControllerPlugin.AnticipationAnimationPlugin.prototype.isAnticipationReel = function(reelId) {
            return this.tensionReels.length > reelId && this.tensionReels[reelId] == 1;
        };
        winControllerPlugin.AnticipationAnimationPlugin.prototype.showAnimation = function(reelId) {
            var position = this.reelLayoutModel.getCellPosition(0, reelId);
            this.generateAndPlayAnimation(this.config.assetId, position);
        };
        winControllerPlugin.AnticipationAnimationPlugin.prototype.generateAndPlayAnimation = function(winAnimationID, position) {
            if (winAnimationID != null && winAnimationID != "") {
                var animationContent = this.animationPool.getAnimationFromPool(winAnimationID);
                this.playAnimation(animationContent, position);
                this.vbAnimations.push(animationContent);
            }
        };
        winControllerPlugin.AnticipationAnimationPlugin.prototype.playAnimation = function(animationContent, position) {
            var displayObject = animationContent.getDisplayObject();
            animationContent.gotoAndPlay(false, "intro");
            animationContent.addEventListener(this.config.stopEvent, function() {
                animationContent.stop();
            });
            displayObject.setX(position.get_x() + this.config.offsetX);
            displayObject.setY(position.get_y() + this.config.offsetY);
            displayObject.setAlpha(this.config.alpha);
            displayObject.setScale(this.config.scale / this.scaleFactor);
            this.container.addChild(displayObject);
        };
        winControllerPlugin.AnticipationAnimationPlugin.prototype.dispose = function() {
            var _g = 0;
            var _g1 = this.vbAnimations;
            while (_g < _g1.length) {
                var vbAnimation = _g1[_g];
                ++_g;
                this.animationPool.backAnimationToPool(vbAnimation.getDisplayObject().getName(), vbAnimation);
            }
            this.vbAnimations = [];
        };
        winControllerPlugin.AnticipationAnimationPlugin.prototype.__class__ = winControllerPlugin.AnticipationAnimationPlugin;
        winControllerPlugin.DetailWinPlugin = function(assetRegistry, context) {
            winControllerPlugin.BaseWinControllerPlugin.call(this, assetRegistry, context);
            this.winControllerPluginService = context.getAnyService(winControllerApi.IWinControllerPluginService);
            this.winControllerPluginServiceHelper = new winControllerPlugin.WinControllerPluginServiceHelper(context.getAnyService(winControllerApi.IWinControllerPluginService));
            this.translationManager = context.getAnyService(translationmanagerApi.ITranslationManager);
        };
        winControllerPlugin.DetailWinPlugin.__name__ = ["winControllerPlugin", "DetailWinPlugin"];
        winControllerPlugin.DetailWinPlugin.__super__ = winControllerPlugin.BaseWinControllerPlugin;
        for (var k in winControllerPlugin.BaseWinControllerPlugin.prototype) winControllerPlugin.DetailWinPlugin.prototype[k] = winControllerPlugin.BaseWinControllerPlugin.prototype[k];
        winControllerPlugin.DetailWinPlugin.prototype.winControllerPluginService = null;
        winControllerPlugin.DetailWinPlugin.prototype.winControllerPluginServiceHelper = null;
        winControllerPlugin.DetailWinPlugin.prototype.text = null;
        winControllerPlugin.DetailWinPlugin.prototype.translationManager = null;
        winControllerPlugin.DetailWinPlugin.prototype.detailWinConfig = null;
        winControllerPlugin.DetailWinPlugin.prototype.previouseUniqueTextResult = null;
        winControllerPlugin.DetailWinPlugin.prototype.ready = function() {
            var _g = this;
            winControllerPlugin.BaseWinControllerPlugin.prototype.ready.call(this);
            this.assetRegistry.getAsset("DETAIL_WIN").getContent().then(function(data) {
                _g.init(data.detailWin);
            });
        };
        winControllerPlugin.DetailWinPlugin.prototype.init = function(detailWinConfig) {
            this.detailWinConfig = detailWinConfig;
            if (detailWinConfig.scale == null) this.detailWinConfig.scale = 1;
            var this1 = this.winControllerPluginService.getAllPlugins();
            this1.remove("DETAIL_WIN");
            var this2 = this.winControllerPluginService.getAllPlugins();
            this2.set("DETAIL_WIN", this);
            var textContainer = this.viewBuilderContainerProvider.provide("textContainer");
            var textFieldContainer = textContainer.getContainerById("text_field_container");
            this.text = textFieldContainer.getLabelById("text_field");
        };
        winControllerPlugin.DetailWinPlugin.prototype.setCurrentWin = function(type, win) {
            winControllerPlugin.BaseWinControllerPlugin.prototype.setCurrentWin.call(this, type, win);
            this.dispose();
            var isNotBlank = !this.reelCellsHelper.checkIsBlank(win.winningSymbol);
            var isNotScatter = !this.reelCellsHelper.checkIsScatter(win.winningSymbol);
            if (isNotBlank && (this.checkShowScatterPayout() || isNotScatter)) this.showDetailWin(win);
        };
        winControllerPlugin.DetailWinPlugin.prototype.checkShowScatterPayout = function() {
            return !this.isFreeSpinsTriggered();
        };
        winControllerPlugin.DetailWinPlugin.prototype.showDetailWin = function(win) {
            var detailLineStyle = this.getDetailLineStyle(win.lineId);
            var position = this.getWinSymbolPosition(this.getWinSymbolPerLine(win.lineId));
            this.text.getDisplayObject().setScale(this.detailWinConfig.scale);
            this.text.getDisplayObject().setX(position.x + detailLineStyle.offsetX);
            this.text.getDisplayObject().setY(position.y + detailLineStyle.offsetY);
            this.text.getDisplayObject().setRotation(detailLineStyle.rotation);
            var modernPrice = commonTools.FloatUtil.fixedFloat(parseFloat(win.payout) / win.multiplier, 2) + "";
            var detailWinText = this.getFormattedPrice(modernPrice, win.multiplier);
            this.container.addChild(this.text.getDisplayObject());
            var newUniqueTextResult = detailLineStyle.textStyle + "_" + detailWinText;
            if (newUniqueTextResult != this.previouseUniqueTextResult) {
                this.text.setText(detailWinText);
                this.applyStyle(detailLineStyle.textStyle);
                this.previouseUniqueTextResult = newUniqueTextResult;
            }
        };
        winControllerPlugin.DetailWinPlugin.prototype.applyStyle = function(textStyle) {
            var styleTable;
            var this1 = this.translationManager.getStyleTables();
            styleTable = this1.get("styletable_json");
            var style = styleTable.getAttributes(textStyle);
            var extendStyle = style.extendStyle;
            if (extendStyle != null) this.applyStyle(extendStyle);
            this.text.updateTo(null, style);
        };
        winControllerPlugin.DetailWinPlugin.prototype.getDetailLineStyle = function(lineId) {
            if (lineId == 0) return this.detailWinConfig.bonusScatterStyle;
            return this.detailWinConfig.lineStyles.filter(function(d) {
                return d.id == lineId;
            })[0];
        };
        winControllerPlugin.DetailWinPlugin.prototype.getFormattedPrice = function(price, multiplier) {
            if (multiplier == null) multiplier = 0;
            var moneyValue = winControllerPlugin.ExternalService.moneyValueProvider.provide(price);
            var formattedPrice = moneyValue.format();
            var translatedPrice = this.translationManager.stringLookup("detail_win_txt", [formattedPrice]);
            if (multiplier > 1) translatedPrice = this.translationManager.stringLookup("detail_win_with_multiplier_txt", [formattedPrice, multiplier]);
            return translatedPrice;
        };
        winControllerPlugin.DetailWinPlugin.prototype.getWinSymbolPerLine = function(lineId) {
            var allWinSymbolsPerLine = this.winControllerPluginServiceHelper.getAllWinSymbolsPerLine();
            var winSymbolsPerWinLine = allWinSymbolsPerLine.h[lineId];
            return winSymbolsPerWinLine[0];
        };
        winControllerPlugin.DetailWinPlugin.prototype.getWinSymbolPosition = function(winSymbol) {
            var parent = winSymbol.animationContent.getDisplayObject().getParent();
            return new displayEngineApi.Point(parent.getX(), parent.getY());
        };
        winControllerPlugin.DetailWinPlugin.prototype.dispose = function() {
            this.container.removeChild(this.text.getDisplayObject());
        };
        winControllerPlugin.DetailWinPlugin.prototype.__class__ = winControllerPlugin.DetailWinPlugin;
        winControllerPlugin.ExternalService = function() {};
        winControllerPlugin.ExternalService.__name__ = ["winControllerPlugin", "ExternalService"];
        winControllerPlugin.ExternalService.displayProvider = null;
        winControllerPlugin.ExternalService.assetRegistry = null;
        winControllerPlugin.ExternalService.variableRegistry = null;
        winControllerPlugin.ExternalService.bus = null;
        winControllerPlugin.ExternalService.busChanel = null;
        winControllerPlugin.ExternalService.logger = null;
        winControllerPlugin.ExternalService.viewBuilderFactory = null;
        winControllerPlugin.ExternalService.uiHelper = null;
        winControllerPlugin.ExternalService.reelCellsHelper = null;
        winControllerPlugin.ExternalService.moneyFormatter = null;
        winControllerPlugin.ExternalService.moneyValueProvider = null;
        winControllerPlugin.ExternalService.initialize = function(context, calbackFunction) {
            winControllerPlugin.ExternalService.displayProvider = context.getAnyService(displayEngineApi.IDisplayProvider, null);
            winControllerPlugin.ExternalService.assetRegistry = context.getAnyService(clientkernelLoaderApi.IAssetRegistry, null);
            winControllerPlugin.ExternalService.variableRegistry = context.getAnyService(clientkernelLoaderApi.IVariableRegistry, null);
            winControllerPlugin.ExternalService.bus = context.getAnyService(clientkernelEventbusApi.IEventBus, null);
            winControllerPlugin.ExternalService.busChanel = winControllerPlugin.ExternalService.bus.getChannel("GFBus");
            var loggerFactory = context.getAnyService(clientkernelLoggerApi.ILoggerFactory, null);
            winControllerPlugin.ExternalService.logger = loggerFactory.getLogger(context.getModule().getSymbolicName());
            winControllerPlugin.ExternalService.moneyFormatter = context.getAnyService(moneyApi.IMoneyFormatter, null);
            winControllerPlugin.ExternalService.moneyValueProvider = new commonTools.MoneyValueProvider(winControllerPlugin.ExternalService.moneyFormatter);
            winControllerPlugin.ExternalService.uiHelper = uiHelper.UiHelper.getUiHelper(winControllerPlugin.ExternalService.displayProvider);
            var assets = ["slot-definition_json", "reel-config_json", "win-controller-assets/win-controller-configuration"];
            winControllerPlugin.ExternalService.load(assets, function(data) {
                winControllerPlugin.ExternalService.reelCellsHelper = new winControllerPlugin.ReelCellsHelper(_hcmn_.__map_reserved["slot-definition_json"] != null ? data.getReserved("slot-definition_json") : data.h["slot-definition_json"], _hcmn_.__map_reserved["reel-config_json"] != null ? data.getReserved("reel-config_json") : data.h["reel-config_json"], _hcmn_.__map_reserved["win-controller-configuration"] != null ? data.getReserved("win-controller-configuration") : data.h["win-controller-configuration"]);
                calbackFunction();
            });
        };
        winControllerPlugin.ExternalService.load = function(assetsToBeLoaded, calbackFunction, timeoutToBeLoaded) {
            if (timeoutToBeLoaded == null) timeoutToBeLoaded = 60000;
            var timeoutId = window.setTimeout(function() {
                winControllerPlugin.ExternalService.logger.error("Would not loaded assets: " + _hcmn_.Std.string(assetsToBeLoaded) + " durin: " + timeoutToBeLoaded + " milliseconds");
            }, timeoutToBeLoaded);
            winControllerPlugin.ExternalService.assetRegistry.getAssetsContent(assetsToBeLoaded).then(function(loadedAssets) {
                window.clearTimeout(timeoutId);
                calbackFunction(loadedAssets);
            });
        };
        winControllerPlugin.ExternalService.publish = function(topic, data) {
            winControllerPlugin.ExternalService.busChanel.publish(topic, data);
        };
        winControllerPlugin.ExternalService.loadConfig = function(config_id, configCallback) {
            winControllerPlugin.ExternalService.assetRegistry.getAsset(config_id).getContent().then(function(data) {
                configCallback(data);
            });
        };
        winControllerPlugin.ExternalService.prototype.__class__ = winControllerPlugin.ExternalService;
        winControllerPlugin.LandingSymbolsPlugin = function(assetRegistry, context) {
            this.vbAnimations = [];
            winControllerPlugin.BaseWinControllerPlugin.call(this, assetRegistry, context);
        };
        winControllerPlugin.LandingSymbolsPlugin.__name__ = ["winControllerPlugin", "LandingSymbolsPlugin"];
        winControllerPlugin.LandingSymbolsPlugin.__super__ = winControllerPlugin.BaseWinControllerPlugin;
        for (var k in winControllerPlugin.BaseWinControllerPlugin.prototype) winControllerPlugin.LandingSymbolsPlugin.prototype[k] = winControllerPlugin.BaseWinControllerPlugin.prototype[k];
        winControllerPlugin.LandingSymbolsPlugin.prototype.landingSymbols = null;
        winControllerPlugin.LandingSymbolsPlugin.prototype.vbAnimations = null;
        winControllerPlugin.LandingSymbolsPlugin.prototype.stopSpinPayload = null;
        winControllerPlugin.LandingSymbolsPlugin.prototype.ready = function() {
            var _g = this;
            this.assetRegistry.getAsset("DETAIL_WIN").getContent().then(function(data) {
                _g.init(data.landingSymbols);
            });
        };
        winControllerPlugin.LandingSymbolsPlugin.prototype.init = function(landingSymbols) {
            this.landingSymbols = landingSymbols;
            this.busChanel.subscribe("reels:stopSpin", $bind(this, this.onStopSpin));
            this.busChanel.subscribe("reels:reelStopped", $bind(this, this.onReelStopped));
            this.busChanel.subscribe("reels:spinStopped", $bind(this, this.onSpinStopped));
        };
        winControllerPlugin.LandingSymbolsPlugin.prototype.onSpinStopped = function(e) {
            this.reelLayoutModel.resetReelVisibility();
            this.dispose();
        };
        winControllerPlugin.LandingSymbolsPlugin.prototype.onStopSpin = function(e) {
            this.stopSpinPayload = e.getPayload();
        };
        winControllerPlugin.LandingSymbolsPlugin.prototype.onReelStopped = function(e) {
            var reelId = e.getPayload();
            var _g = 0;
            var _g1 = this.landingSymbols;
            while (_g < _g1.length) {
                var landingSymbol = _g1[_g];
                ++_g;
                var isLandingReel = _hcmn_.HxOverrides.indexOf(landingSymbol.landingReels, reelId, 0) != -1;
                if (isLandingReel && this.hasSymbolOnPrevReels(reelId, landingSymbol.symbolId)) {
                    var cellId = this.getSymbolPositionOnTheReel(reelId, landingSymbol.symbolId, false);
                    this.showAnimation(reelId, cellId, landingSymbol.animationConfiguration);
                }
            }
        };
        winControllerPlugin.LandingSymbolsPlugin.prototype.hasSymbolOnPrevReels = function(reelId, symbolId) {
            var _g1 = 0;
            var _g = reelId + 1;
            while (_g1 < _g) {
                var i = _g1++;
                if (!this.hasSymbolOnTheReel(i, symbolId)) return false;
            }
            return true;
        };
        winControllerPlugin.LandingSymbolsPlugin.prototype.hasSymbolOnTheReel = function(reelId, symbolId) {
            return this.getSymbolPositionOnTheReel(reelId, symbolId) != -1;
        };
        winControllerPlugin.LandingSymbolsPlugin.prototype.getSymbolPositionOnTheReel = function(reelId, symbolId, inWinableZone) {
            if (inWinableZone == null) inWinableZone = true;
            var reel = this.stopSpinPayload.reelPicture[reelId];
            if (inWinableZone) reel = reel.slice(1, reel.length - 1);
            return _hcmn_.HxOverrides.indexOf(reel, symbolId, 0);
        };
        winControllerPlugin.LandingSymbolsPlugin.prototype.showAnimation = function(reelId, cellId, config) {
            var position = this.reelLayoutModel.getCellPosition(cellId, reelId);
            this.generateAndPlayAnimation(config, position);
            this.hideStaticReelSymbol(reelId, cellId + 1);
        };
        winControllerPlugin.LandingSymbolsPlugin.prototype.hideStaticReelSymbol = function(reelId, cellId) {
            var layoutContainer = this.getLayoutContainer();
            var symbolContainer = layoutContainer.getChildByName("R_" + reelId + "_C" + cellId);
            symbolContainer.setVisible(false);
            var isCacheAsBitmap = winControllerPlugin.ExternalService.uiHelper.isCacheAsBitmap(layoutContainer);
            if (isCacheAsBitmap) {
                uiHelper.DisplayObjectExtension.cacheAsBitmap(layoutContainer, false);
                uiHelper.DisplayObjectExtension.cacheAsBitmap(layoutContainer, true);
            }
        };
        winControllerPlugin.LandingSymbolsPlugin.prototype.getLayoutContainer = function() {
            var parent = this.container.getParent();
            var stage = parent.getParent();
            return stage.getChildByID("layout");
        };
        winControllerPlugin.LandingSymbolsPlugin.prototype.generateAndPlayAnimation = function(config, position) {
            var assetId = config.assetId;
            if (assetId != null && assetId != "") {
                var animationContent = this.animationPool.getAnimationFromPool(assetId);
                this.playAnimation(animationContent, position, config);
                animationContent.addEventListener(config.stopEvent, function() {
                    uiHelper.VBAnimationExtension.gotoAndStopOnLabel(animationContent, "loop");
                });
                this.vbAnimations.push(animationContent);
            }
        };
        winControllerPlugin.LandingSymbolsPlugin.prototype.playAnimation = function(animationContent, position, config) {
            var displayObject = animationContent.getDisplayObject();
            uiHelper.VBAnimationExtension.gotoAndPlayOnLabel(animationContent, "landing");
            displayObject.setX(position.get_x() + config.offsetX);
            displayObject.setY(position.get_y() + config.offsetY);
            displayObject.setAlpha(config.alpha);
            displayObject.setScale(config.scale / this.scaleFactor);
            this.container.addChild(displayObject);
        };
        winControllerPlugin.LandingSymbolsPlugin.prototype.dispose = function() {
            var _g = 0;
            var _g1 = this.vbAnimations;
            while (_g < _g1.length) {
                var vbAnimation = _g1[_g];
                ++_g;
                this.animationPool.backAnimationToPool(vbAnimation.getDisplayObject().getName(), vbAnimation);
            }
            this.vbAnimations = [];
        };
        winControllerPlugin.LandingSymbolsPlugin.prototype.__class__ = winControllerPlugin.LandingSymbolsPlugin;
        winControllerPlugin.ReelCellsHelper = function(slotsDefinitions, reelConfig, winControllerConfiguration) {
            this.winControllerConfiguration = winControllerConfiguration;
            this.slotsDefinitions = slotsDefinitions;
            this.linesAmount = slotsDefinitions.lines.length;
            this.reelsNum = slotsDefinitions.reelPictureSize.reelCount;
            this.cellsNum = slotsDefinitions.reelPictureSize.reelLength;
            this.symbolsAmount = slotsDefinitions.symbols.length;
            this.cellsWidth = reelConfig.defaultReelConfig.cellWidth;
            this.cellsHeight = reelConfig.defaultReelConfig.cellHeight;
            this.boundsCellWidth = reelConfig.defaultReelConfig.boundsCellWidth;
            this.boundsCellHeight = reelConfig.defaultReelConfig.boundsCellHeight;
            if (this.boundsCellWidth == null) this.boundsCellWidth = this.cellsWidth;
            if (this.boundsCellHeight == null) this.boundsCellHeight = this.cellsHeight;
            this.leftMergin = reelConfig.defaultReelConfig.leftMargin;
            this.cellSpacing = reelConfig.defaultReelConfig.cellSpacing;
            this.lines = [];
            var commonLineStyle = slotsDefinitions.commonLineStyle;
            components.winControllerPlugin.view.controls.LineStyle.mergeIfEmpty(commonLineStyle.strokeLineStyle, commonLineStyle);
            this.bonusScatterFrameStyle = slotsDefinitions.bonusScatterFrameStyle;
            components.winControllerPlugin.view.controls.LineStyle.mergeIfEmpty(this.bonusScatterFrameStyle, commonLineStyle);
            components.winControllerPlugin.view.controls.LineStyle.mergeIfEmpty(this.bonusScatterFrameStyle.strokeLineStyle, commonLineStyle.strokeLineStyle);
            components.winControllerPlugin.view.controls.LineStyle.mergeIfEmpty(this.bonusScatterFrameStyle.strokeLineStyle, commonLineStyle);
            var _g1 = 0;
            var _g = this.linesAmount;
            while (_g1 < _g) {
                var i = _g1++;
                var lineStyle = slotsDefinitions.lineStyles[i];
                components.winControllerPlugin.view.controls.LineStyle.mergeIfEmpty(lineStyle, commonLineStyle);
                components.winControllerPlugin.view.controls.LineWithStrokeStyle.makeCorection(lineStyle);
                components.winControllerPlugin.view.controls.LineStyle.mergeIfEmpty(lineStyle.strokeLineStyle, commonLineStyle.strokeLineStyle);
                components.winControllerPlugin.view.controls.LineStyle.mergeIfEmpty(lineStyle.strokeLineStyle, lineStyle);
                components.winControllerPlugin.view.controls.LineStyle.makeCorection(lineStyle.strokeLineStyle);
                var line = new winControllerPlugin.LineWithStyle(slotsDefinitions.lines[i].id, slotsDefinitions.lines[i].offsets, lineStyle);
                this.lines.push(line);
            }
            this.correctSlotDefinitionSymbols();
        };
        winControllerPlugin.ReelCellsHelper.__name__ = ["winControllerPlugin", "ReelCellsHelper"];
        winControllerPlugin.ReelCellsHelper.prototype.lines = null;
        winControllerPlugin.ReelCellsHelper.prototype.linesAmount = null;
        winControllerPlugin.ReelCellsHelper.prototype.symbolsAmount = null;
        winControllerPlugin.ReelCellsHelper.prototype.reelsNum = null;
        winControllerPlugin.ReelCellsHelper.prototype.cellsNum = null;
        winControllerPlugin.ReelCellsHelper.prototype.cellsWidth = null;
        winControllerPlugin.ReelCellsHelper.prototype.cellsHeight = null;
        winControllerPlugin.ReelCellsHelper.prototype.boundsCellWidth = null;
        winControllerPlugin.ReelCellsHelper.prototype.boundsCellHeight = null;
        winControllerPlugin.ReelCellsHelper.prototype.cellSpacing = null;
        winControllerPlugin.ReelCellsHelper.prototype.leftMergin = null;
        winControllerPlugin.ReelCellsHelper.prototype.slotsDefinitions = null;
        winControllerPlugin.ReelCellsHelper.prototype.winControllerConfiguration = null;
        winControllerPlugin.ReelCellsHelper.prototype.wildSymbol = null;
        winControllerPlugin.ReelCellsHelper.prototype.blankSymbol = null;
        winControllerPlugin.ReelCellsHelper.prototype.bonusScatterFrameStyle = null;
        winControllerPlugin.ReelCellsHelper.prototype.correctSlotDefinitionSymbols = function() {
            var _g = 0;
            var _g1 = this.slotsDefinitions.symbols;
            while (_g < _g1.length) {
                var symbol = _g1[_g];
                ++_g;
                if (symbol.isWild) this.wildSymbol = symbol;
                if (symbol.isBlank) this.blankSymbol = symbol;
                if (symbol.isScatter == null) symbol.isScatter = false;
                else symbol.isScatter = symbol.isScatter;
                if (symbol.isWild == null) symbol.isWild = false;
                else symbol.isWild = symbol.isWild;
                if (symbol.isBlank == null) symbol.isBlank = false;
                else symbol.isBlank = symbol.isBlank;
                if (symbol.isBleed == null) symbol.isBleed = false;
                else symbol.isBleed = symbol.isBleed;
            }
        };
        winControllerPlugin.ReelCellsHelper.prototype.getLineById = function(id) {
            return this.lines.filter(function(line) {
                return line.id == id;
            })[0];
        };
        winControllerPlugin.ReelCellsHelper.prototype.checkIsWild = function(symbolId) {
            return this.wildSymbol != null && this.wildSymbol.id == symbolId;
        };
        winControllerPlugin.ReelCellsHelper.prototype.checkIsBlank = function(symbolId) {
            return this.blankSymbol != null && this.blankSymbol.id == symbolId;
        };
        winControllerPlugin.ReelCellsHelper.prototype.checkIsScatter = function(symbolId) {
            var winSymbol = this.getWinSymbol(symbolId);
            return winSymbol != null && winSymbol.isScatter;
        };
        winControllerPlugin.ReelCellsHelper.prototype.getWinSymbol = function(symbolId) {
            return this.slotsDefinitions.symbols.filter(function(s) {
                return s.id == symbolId;
            })[0];
        };
        winControllerPlugin.ReelCellsHelper.prototype.doForAllCells = function(action) {
            var _g1 = 0;
            var _g = this.reelsNum;
            while (_g1 < _g) {
                var reel = _g1++;
                var _g3 = 0;
                var _g2 = this.cellsNum;
                while (_g3 < _g2) {
                    var cell = _g3++;
                    action(reel, cell);
                }
            }
        };
        winControllerPlugin.ReelCellsHelper.prototype.showAllCells = function() {
            this.doForAllCells($bind(this, this.showCell));
        };
        winControllerPlugin.ReelCellsHelper.prototype.hideAllCells = function() {
            this.doForAllCells($bind(this, this.hideCell));
        };
        winControllerPlugin.ReelCellsHelper.prototype.showCell = function(reel, cell) {
            this.setCellVisible(reel, cell, true);
        };
        winControllerPlugin.ReelCellsHelper.prototype.hideCell = function(reel, cell) {
            this.setCellVisible(reel, cell, false);
        };
        winControllerPlugin.ReelCellsHelper.prototype.setCellVisible = function(reel, cell, value) {};
        winControllerPlugin.ReelCellsHelper.prototype.getWinFrameCell = function(reelNumber, cellNumber, framePadding) {
            var framePosition = this.getFramePosition(reelNumber, cellNumber);
            framePosition.x += framePadding;
            framePosition.y += framePadding;
            var width = this.cellsWidth - framePadding * 2;
            var height = this.boundsCellHeight - framePadding * 2;
            return new winControllerPlugin.WinFrameCell(framePosition.x, framePosition.y, width, height);
        };
        winControllerPlugin.ReelCellsHelper.prototype.getFramePosition = function(reelNumber, cellNumber) {
            var x = (this.cellsWidth + this.leftMergin) * reelNumber;
            var y = this.cellsHeight * cellNumber;
            return new displayEngineApi.Point(x, y);
        };
        winControllerPlugin.ReelCellsHelper.prototype.__class__ = winControllerPlugin.ReelCellsHelper;
        winControllerPlugin.SpaghettiWinControllerPlugin = function(assetRegistry, context) {
            winControllerPlugin.BaseWinControllerPlugin.call(this, assetRegistry, context);
            this.busChanel.subscribe("betpanel:setStake", $bind(this, this.onBetPanelStakeChanged));
        };
        winControllerPlugin.SpaghettiWinControllerPlugin.__name__ = ["winControllerPlugin", "SpaghettiWinControllerPlugin"];
        winControllerPlugin.SpaghettiWinControllerPlugin.__super__ = winControllerPlugin.BaseWinControllerPlugin;
        for (var k in winControllerPlugin.BaseWinControllerPlugin.prototype) winControllerPlugin.SpaghettiWinControllerPlugin.prototype[k] = winControllerPlugin.BaseWinControllerPlugin.prototype[k];
        winControllerPlugin.SpaghettiWinControllerPlugin.prototype.animationFramesControl = null;
        winControllerPlugin.SpaghettiWinControllerPlugin.prototype.actualLineCount = null;
        winControllerPlugin.SpaghettiWinControllerPlugin.prototype.dispose = function() {
            this.animationFramesControl.dispose();
        };
        winControllerPlugin.SpaghettiWinControllerPlugin.prototype.ready = function() {
            this.animationFramesControl = new winControllerPlugin.LineWithFramesViewControl();
            this.animationFramesControl.init(this.container, this.reelLayoutModel);
        };
        winControllerPlugin.SpaghettiWinControllerPlugin.prototype.onBetPanelStakeChanged = function(e) {
            var lineCount = e.getPayload().stakeItems.lineCount;
            if (this.animationFramesControl != null && this.actualLineCount != lineCount) {
                var lineIds;
                var _g = [];
                var _g1 = 0;
                while (_g1 < lineCount) {
                    var i = _g1++;
                    _g.push(i + 1);
                }
                lineIds = _g;
                this.animationFramesControl.hideAll();
                this.animationFramesControl.showLines(lineIds);
            }
            this.actualLineCount = lineCount;
        };
        winControllerPlugin.SpaghettiWinControllerPlugin.prototype.setCurrentWin = function(type, win) {
            winControllerPlugin.BaseWinControllerPlugin.prototype.setCurrentWin.call(this, type, win);
            var showScatterFrames = this.checkShowScatterFrame();
            var isBlankWinLine = this.reelCellsHelper.checkIsBlank(win.winningSymbol);
            var isScatterWinLine = this.reelCellsHelper.checkIsScatter(win.winningSymbol);
            if (isScatterWinLine && !showScatterFrames) this.animationFramesControl.dispose();
            else if (isBlankWinLine) {
                var lineIds = this.currentOutcome.lineWins.filter($bind(this, this.checkIsNotBlankWinLine)).map($bind(this, this.getWinLineId));
                this.animationFramesControl.showLines(lineIds);
                this.container.bringToTop();
            } else {
                this.animationFramesControl.showPath(win, false, showScatterFrames);
                this.container.sendToBottom();
            }
        };
        winControllerPlugin.SpaghettiWinControllerPlugin.prototype.checkShowScatterFrame = function() {
            return !this.isFreeSpinsTriggered();
        };
        winControllerPlugin.SpaghettiWinControllerPlugin.prototype.checkIsNotBlankWinLine = function(lineWin) {
            return !this.reelCellsHelper.checkIsBlank(lineWin.winningSymbol);
        };
        winControllerPlugin.SpaghettiWinControllerPlugin.prototype.getWinLineId = function(lineWin) {
            return lineWin.lineId;
        };
        winControllerPlugin.SpaghettiWinControllerPlugin.prototype.__class__ = winControllerPlugin.SpaghettiWinControllerPlugin;
        winControllerPlugin.WinLinesAdaptationPlugin = function(assetRegistry, context) {
            winControllerPlugin.BaseWinControllerPlugin.call(this, assetRegistry, context);
            this.winControllerPluginService = context.getAnyService(winControllerApi.IWinControllerPluginService);
            this.winControllerPluginServiceHelper = new winControllerPlugin.WinControllerPluginServiceHelper(this.winControllerPluginService);
            this.winControllerConfiguration = winControllerPlugin.ExternalService.reelCellsHelper.winControllerConfiguration;
            this.winSymbolsScale = winControllerPlugin.ExternalService.reelCellsHelper.winControllerConfiguration.winSymbolsScale;
        };
        winControllerPlugin.WinLinesAdaptationPlugin.__name__ = ["winControllerPlugin", "WinLinesAdaptationPlugin"];
        winControllerPlugin.WinLinesAdaptationPlugin.__super__ = winControllerPlugin.BaseWinControllerPlugin;
        for (var k in winControllerPlugin.BaseWinControllerPlugin.prototype) winControllerPlugin.WinLinesAdaptationPlugin.prototype[k] = winControllerPlugin.BaseWinControllerPlugin.prototype[k];
        winControllerPlugin.WinLinesAdaptationPlugin.prototype.winControllerPluginService = null;
        winControllerPlugin.WinLinesAdaptationPlugin.prototype.winControllerPluginServiceHelper = null;
        winControllerPlugin.WinLinesAdaptationPlugin.prototype.winSymbolsScale = null;
        winControllerPlugin.WinLinesAdaptationPlugin.prototype.winControllerConfiguration = null;
        winControllerPlugin.WinLinesAdaptationPlugin.prototype.intervalAnimator = null;
        winControllerPlugin.WinLinesAdaptationPlugin.prototype.ready = function() {
            var this1 = this.winControllerPluginService.getAllPlugins();
            this1.remove("WIN_LINES_ADAPTATION_PLUGIN");
            var this2 = this.winControllerPluginService.getAllPlugins();
            this2.set("WIN_LINES_ADAPTATION_PLUGIN", this);
            var stage = winControllerPlugin.ExternalService.displayProvider.getDefaultStage();
            var winLineInterval = this.winAnimationRulesModel.winRules.winLineInterval;
            var enterFrameListener = new uiHelper.StageEnterFrameListener(stage);
            this.intervalAnimator = new uiHelper.IntervalAnimator(enterFrameListener, winLineInterval);
        };
        winControllerPlugin.WinLinesAdaptationPlugin.prototype.setCurrentWin = function(type, win) {
            if (win == null) winControllerPlugin.BaseWinControllerPlugin.prototype.set_isHighWin.call(this, type);
            else {
                winControllerPlugin.BaseWinControllerPlugin.prototype.setCurrentWin.call(this, type, win);
                this.hideInactiveWinSymbols(win.lineId, this.reelCellsHelper.checkIsBlank(win.winningSymbol));
            }
        };
        winControllerPlugin.WinLinesAdaptationPlugin.prototype.hideInactiveWinSymbols = function(lineId, isBlankLine) {
            this.intervalAnimator.stopSynchronizedDrawer();
            this.intervalAnimator.removeAnimations();
            var allWinSymbolsPerLine = this.winControllerPluginServiceHelper.getAllWinSymbolsPerLine();
            var winSymbolsPerWinLine = allWinSymbolsPerLine.h[lineId];
            var $it0 = allWinSymbolsPerLine.iterator();
            while ($it0.hasNext()) {
                var winSymbols = $it0.next();
                var _g = 0;
                while (_g < winSymbols.length) {
                    var winSymbol = winSymbols[_g];
                    ++_g;
                    var animationContent = winSymbol.animationContent;
                    var isInactiveSymbol = isBlankLine || _hcmn_.HxOverrides.indexOf(winSymbolsPerWinLine, winSymbol, 0) == -1;
                    var isBonus = winSymbol.symbolName == "b01";
                    if (isBlankLine || isInactiveSymbol) {
                        uiHelper.VBAnimationExtension.gotoAndStopOnLabel(animationContent, isBonus ? "loop" : "intro");
                        animationContent.hide();
                    } else {
                        animationContent.show();
                        if (winControllerPlugin.BaseWinControllerPlugin.prototype.get_isHighWin.call(this) == "true") uiHelper.VBAnimationExtension.gotoAndStopOnLabel(animationContent, "loop");
                        else uiHelper.VBAnimationExtension.gotoAndStopOnLabel(animationContent, "intro");
                        var cycleAmountPerInterval = this.getWinSymbolDefinitionByAnimationId(winSymbol.symbolName).cycleAmountPerInterval;
                        this.intervalAnimator.addAnimation(animationContent, cycleAmountPerInterval);
                    }
                    uiHelper.DisplayObjectExtension.cacheAsBitmap(animationContent.getDisplayObject(), isInactiveSymbol);
                    animationContent.getDisplayObject().setScale(this.winSymbolsScale / this.scaleFactor);
                }
            }
            this.reelLayoutModel.resetReelVisibility();
            if (!isBlankLine) this.reelLayoutModel.setCellVisibility(this.currentWin.winPath.reelsInfo);
            if (this.intervalAnimator.hasAnimations() && winControllerPlugin.BaseWinControllerPlugin.prototype.get_isHighWin.call(this) == "true") this.intervalAnimator.runSynchronizedDrawer();
        };
        winControllerPlugin.WinLinesAdaptationPlugin.prototype.dispose = function() {
            this.intervalAnimator.stopSynchronizedDrawer();
            this.intervalAnimator.removeAnimations();
            winControllerPlugin.BaseWinControllerPlugin.prototype.dispose.call(this);
        };
        winControllerPlugin.WinLinesAdaptationPlugin.prototype.getWinSymbolDefinitionByAnimationId = function(symbolName) {
            return this.winControllerConfiguration.winSymbolsMap.filter(function(winSymbolDefinition) {
                return winSymbolDefinition.winAnimationID == symbolName;
            })[0];
        };
        winControllerPlugin.WinLinesAdaptationPlugin.prototype.__class__ = winControllerPlugin.WinLinesAdaptationPlugin;
        winControllerPlugin.WinControllerPluginServiceHelper = function(winControllerPluginService) {
            this.winControllerPluginService = winControllerPluginService;
        };
        winControllerPlugin.WinControllerPluginServiceHelper.__name__ = ["winControllerPlugin", "WinControllerPluginServiceHelper"];
        winControllerPlugin.WinControllerPluginServiceHelper.prototype.winControllerPluginService = null;
        winControllerPlugin.WinControllerPluginServiceHelper.prototype.getAllWinSymbolsPerLine = function() {
            var result = new _hcmn_.haxe_ds_IntMap();
            var allWinSymbolsPerLine = this.getAllWinSymbolsPerLineFromWinSymbolsPlugin();
            var allScattersSymbolsPerLine = this.getAllWinSymbolsPerLineFromScatterSymbolsPlugin();
            var $it0 = allWinSymbolsPerLine.keys();
            while ($it0.hasNext()) {
                var key = $it0.next();
                var value = allWinSymbolsPerLine.h[key];
                result.h[key] = value;
            }
            var $it1 = allScattersSymbolsPerLine.keys();
            while ($it1.hasNext()) {
                var key1 = $it1.next();
                var value1 = allScattersSymbolsPerLine.h[key1];
                result.h[key1] = value1;
            }
            return result;
        };
        winControllerPlugin.WinControllerPluginServiceHelper.prototype.getAllWinSymbolsPerLineFromScatterSymbolsPlugin = function() {
            return this.getAllWinSymbolsPerLineFromSymbolsPlugin("SCATTER_SYMBOLS");
        };
        winControllerPlugin.WinControllerPluginServiceHelper.prototype.getAllWinSymbolsPerLineFromWinSymbolsPlugin = function() {
            return this.getAllWinSymbolsPerLineFromSymbolsPlugin("WIN_SYMBOLS");
        };
        winControllerPlugin.WinControllerPluginServiceHelper.prototype.getAllWinSymbolsPerLineFromSymbolsPlugin = function(pluginName) {
            var winSymbolsPlugin;
            winSymbolsPlugin = (function($this) {
                var $r;
                var this1 = $this.winControllerPluginService.getAllPlugins();
                $r = this1.get(pluginName);
                return $r;
            }(this));
            var lineAnimationHelper = winSymbolsPlugin.lineAnimationHelper;
            var allWinSymbolsPerLine = lineAnimationHelper.allWinSymbolsPerLine;
            return allWinSymbolsPerLine;
        };
        winControllerPlugin.WinControllerPluginServiceHelper.prototype.__class__ = winControllerPlugin.WinControllerPluginServiceHelper;
        winControllerPlugin.LineWithFramesViewControl = function() {
            this.winLinesContainers = [];
        };
        winControllerPlugin.LineWithFramesViewControl.__name__ = ["winControllerPlugin", "LineWithFramesViewControl"];
        winControllerPlugin.LineWithFramesViewControl.prototype.winLinesContainers = null;
        winControllerPlugin.LineWithFramesViewControl.prototype.reelLayoutModel = null;
        winControllerPlugin.LineWithFramesViewControl.prototype.reelCellsHelper = null;
        winControllerPlugin.LineWithFramesViewControl.prototype.container = null;
        winControllerPlugin.LineWithFramesViewControl.prototype.scatterFramesContainer = null;
        winControllerPlugin.LineWithFramesViewControl.prototype.linesRender = null;
        winControllerPlugin.LineWithFramesViewControl.prototype.init = function(container, reelLayoutModel) {
            this.reelLayoutModel = reelLayoutModel;
            this.reelCellsHelper = winControllerPlugin.ExternalService.reelCellsHelper;
            this.initialize(container);
        };
        winControllerPlugin.LineWithFramesViewControl.prototype.initialize = function(container) {
            var winControllerContainer = container.getParent();
            this.container = container;
            uiHelper.DisplayObjectExtension.cacheAsBitmap(container, true);
            this.linesRender = new winControllerPlugin.LineWithFramesRender();
            this.winLinesContainers = this.linesRender.createLines();
            var _g = 0;
            var _g1 = this.winLinesContainers;
            while (_g < _g1.length) {
                var line = _g1[_g];
                ++_g;
                container.addChild(line);
            }
            this.hideAll();
        };
        winControllerPlugin.LineWithFramesViewControl.prototype.showLines = function(lineIds) {
            this.hideAll();
            var _g = 0;
            while (_g < lineIds.length) {
                var lineId = lineIds[_g];
                ++_g;
                this.showWinLine(lineId, 0);
            }
            this.container.setVisible(true);
            uiHelper.DisplayObjectExtension.updateCacheAsBitmap(this.container);
        };
        winControllerPlugin.LineWithFramesViewControl.prototype.showPath = function(win, isNeedToBlink, framesOnScatter) {
            var _g = this;
            this.hideAll();
            var isScatterWin = this.reelCellsHelper.checkIsScatter(win.winningSymbol);
            if (isScatterWin && !framesOnScatter) return;
            var isWildLine = this.reelCellsHelper.checkIsWild(win.winningSymbol);
            if (isWildLine) this.showLineWithWild(win);
            else if (isScatterWin) this.showScatterFrames(win);
            else this.showWinLine(win.lineId, win.symbolCount);
            this.container.setVisible(true);
            if (isNeedToBlink) {
                var lineId = _hcmn_.Math.max(0, win.lineId - 1);
                var blinkIntervalDelay = this.reelCellsHelper.lines[lineId].style.blinkIntervalDelay;
                commonTools.TimeoutInvoker.setTimeout("framesAnimation", function() {
                    _g.container.setVisible(!_g.container.getVisible());
                    uiHelper.DisplayObjectExtension.updateCacheAsBitmap(_g.container);
                }, blinkIntervalDelay, true);
            }
            uiHelper.DisplayObjectExtension.updateCacheAsBitmap(this.container);
        };
        winControllerPlugin.LineWithFramesViewControl.prototype.showWinLine = function(lineId, symbolCount) {
            var linesContainer = this.winLinesContainers[lineId - 1];
            var winLine = linesContainer.getChildAt(symbolCount);
            linesContainer.setVisible(true);
            winLine.setVisible(true);
            uiHelper.DisplayObjectExtension.updateCacheAsBitmap(this.container);
        };
        winControllerPlugin.LineWithFramesViewControl.prototype.showLineWithWild = function(win) {
            this.scatterFramesContainer = this.createLineWithWild(win);
            this.container.addChild(this.scatterFramesContainer);
        };
        winControllerPlugin.LineWithFramesViewControl.prototype.createLineWithWild = function(win) {
            var lineId;
            if (win.lineId == 0) lineId = 1;
            else lineId = win.lineId;
            var line = this.reelCellsHelper.getLineById(lineId);
            return this.linesRender.createLineForWin(win, line);
        };
        winControllerPlugin.LineWithFramesViewControl.prototype.showScatterFrames = function(win) {
            this.scatterFramesContainer = this.linesRender.createFrames(win, this.reelCellsHelper.bonusScatterFrameStyle);
            this.container.addChild(this.scatterFramesContainer);
        };
        winControllerPlugin.LineWithFramesViewControl.prototype.dispose = function() {
            if (this.container != null) this.hideAll();
        };
        winControllerPlugin.LineWithFramesViewControl.prototype.showAll = function() {
            var _g1 = 0;
            var _g = winControllerPlugin.ExternalService.reelCellsHelper.linesAmount;
            while (_g1 < _g) {
                var i = _g1++;
                var lineFramesContainer = this.winLinesContainers[i];
                lineFramesContainer.setVisible(true);
                var _g3 = 0;
                var _g2 = lineFramesContainer.getNumChildren();
                while (_g3 < _g2) {
                    var j = _g3++;
                    var frame = lineFramesContainer.getChildAt(j);
                    frame.setVisible(true);
                }
            }
            uiHelper.DisplayObjectExtension.updateCacheAsBitmap(this.container);
        };
        winControllerPlugin.LineWithFramesViewControl.prototype.hideAll = function() {
            commonTools.TimeoutInvoker.clearTimeouts("framesAnimation");
            this.hideAllLines();
            this.hideScatters();
            uiHelper.DisplayObjectExtension.updateCacheAsBitmap(this.container);
        };
        winControllerPlugin.LineWithFramesViewControl.prototype.hideAllLines = function() {
            var _g = 0;
            var _g1 = this.winLinesContainers;
            while (_g < _g1.length) {
                var lineFramesContainer = _g1[_g];
                ++_g;
                lineFramesContainer.setVisible(false);
                var _g3 = 0;
                var _g2 = lineFramesContainer.getNumChildren();
                while (_g3 < _g2) {
                    var j = _g3++;
                    var frame = lineFramesContainer.getChildAt(j);
                    frame.setVisible(false);
                }
            }
        };
        winControllerPlugin.LineWithFramesViewControl.prototype.hideScatters = function() {
            if (this.scatterFramesContainer != null) {
                this.container.removeChild(this.scatterFramesContainer);
                this.scatterFramesContainer = null;
            }
        };
        winControllerPlugin.LineWithFramesViewControl.prototype.__class__ = winControllerPlugin.LineWithFramesViewControl;
        winControllerPlugin.LineWithStyle = function(id, offsets, style) {
            slotModelApi.Line.call(this, id, offsets);
            this.style = style;
        };
        winControllerPlugin.LineWithStyle.__name__ = ["winControllerPlugin", "LineWithStyle"];
        winControllerPlugin.LineWithStyle.__super__ = slotModelApi.Line;
        for (var k in slotModelApi.Line.prototype) winControllerPlugin.LineWithStyle.prototype[k] = slotModelApi.Line.prototype[k];
        winControllerPlugin.LineWithStyle.prototype.style = null;
        winControllerPlugin.LineWithStyle.prototype.__class__ = winControllerPlugin.LineWithStyle;
        if (typeof components == 'undefined') {
            var components = {};
        };
        if (!components.winControllerPlugin) {
            components.winControllerPlugin = {};
        };
        if (!components.winControllerPlugin.view) {
            components.winControllerPlugin.view = {};
        };
        if (!components.winControllerPlugin.view.controls) {
            components.winControllerPlugin.view.controls = {};
        };
        components.winControllerPlugin.view.controls.LineStyle = function(id, color, alpha, blendMode, lineAlignment, lineWidth, framePadding, topOffset, sideOffset, borderRadius) {
            this.id = id;
            this.color = color;
            this.alpha = alpha;
            this.blendMode = blendMode;
            this.lineAlignment = lineAlignment;
            this.lineWidth = lineWidth;
            this.framePadding = framePadding;
            this.topOffset = topOffset;
            this.sideOffset = sideOffset;
            this.borderRadius = borderRadius;
        };
        components.winControllerPlugin.view.controls.LineStyle.__name__ = ["components", "winControllerPlugin", "view", "controls", "LineStyle"];
        components.winControllerPlugin.view.controls.LineStyle.prototype.id = null;
        components.winControllerPlugin.view.controls.LineStyle.prototype.color = null;
        components.winControllerPlugin.view.controls.LineStyle.prototype.alpha = null;
        components.winControllerPlugin.view.controls.LineStyle.prototype.blendMode = null;
        components.winControllerPlugin.view.controls.LineStyle.prototype.lineAlignment = null;
        components.winControllerPlugin.view.controls.LineStyle.prototype.lineWidth = null;
        components.winControllerPlugin.view.controls.LineStyle.prototype.framePadding = null;
        components.winControllerPlugin.view.controls.LineStyle.prototype.blinkIntervalDelay = null;
        components.winControllerPlugin.view.controls.LineStyle.prototype.topOffset = null;
        components.winControllerPlugin.view.controls.LineStyle.prototype.sideOffset = null;
        components.winControllerPlugin.view.controls.LineStyle.prototype.borderRadius = null;
        components.winControllerPlugin.view.controls.LineStyle.makeCorection = function(style) {
            if (style.alpha == null) style.alpha = 1;
            if (style.lineAlignment == null) style.lineAlignment = .5;
            if (typeof(style.color) == "string") style.color = _hcmn_.Std.parseInt(style.color);
        };
        components.winControllerPlugin.view.controls.LineStyle.mergeIfEmpty = function(style1, style2) {
            if (style1.borderRadius == null || style1.borderRadius == 0) style1.borderRadius = style2.borderRadius;
            if (style1.sideOffset == null || style1.sideOffset == 0) style1.sideOffset = style2.sideOffset;
            if (style1.topOffset == null || style1.topOffset == 0) style1.topOffset = style2.topOffset;
            if (style1.color == null) style1.color = style2.color;
            if (style1.blinkIntervalDelay == null) style1.blinkIntervalDelay = style2.blinkIntervalDelay;
            if (style1.blendMode == null) style1.blendMode = style2.blendMode;
            if (style1.lineWidth == null) style1.lineWidth = style2.lineWidth;
            if (style1.alpha == null) style1.alpha = style2.alpha;
            if (style1.lineAlignment == null) style1.lineAlignment = style2.lineAlignment;
            if (style1.framePadding == null) style1.framePadding = style2.framePadding;
        };
        components.winControllerPlugin.view.controls.LineStyle.prototype.__class__ = components.winControllerPlugin.view.controls.LineStyle;
        components.winControllerPlugin.view.controls.LineWithStrokeStyle = function(id, color, alpha, blendMode, lineAlignment, lineWidth, framePadding, topOffset, sideOffset, borderRadius) {
            components.winControllerPlugin.view.controls.LineStyle.call(this, id, color, alpha, blendMode, lineAlignment, lineWidth, framePadding, topOffset, sideOffset, borderRadius);
        };
        components.winControllerPlugin.view.controls.LineWithStrokeStyle.__name__ = ["components", "winControllerPlugin", "view", "controls", "LineWithStrokeStyle"];
        components.winControllerPlugin.view.controls.LineWithStrokeStyle.__super__ = components.winControllerPlugin.view.controls.LineStyle;
        for (var k in components.winControllerPlugin.view.controls.LineStyle.prototype) components.winControllerPlugin.view.controls.LineWithStrokeStyle.prototype[k] = components.winControllerPlugin.view.controls.LineStyle.prototype[k];
        components.winControllerPlugin.view.controls.LineWithStrokeStyle.prototype.strokeLineStyle = null;
        components.winControllerPlugin.view.controls.LineWithStrokeStyle.makeCorection = function(style) {
            if (style.strokeLineStyle == null) style.strokeLineStyle = {};
            components.winControllerPlugin.view.controls.LineStyle.makeCorection(style);
        };
        components.winControllerPlugin.view.controls.LineWithStrokeStyle.prototype.__class__ = components.winControllerPlugin.view.controls.LineWithStrokeStyle;
        winControllerPlugin.LineWithFramesRender = function() {
            this.framesCache = new _hcmn_.haxe_ds_StringMap();
            this.reelCellsHelper = winControllerPlugin.ExternalService.reelCellsHelper;
        };
        winControllerPlugin.LineWithFramesRender.__name__ = ["winControllerPlugin", "LineWithFramesRender"];
        winControllerPlugin.LineWithFramesRender.prototype.reelCellsHelper = null;
        winControllerPlugin.LineWithFramesRender.prototype.framesCache = null;
        winControllerPlugin.LineWithFramesRender.prototype.createLines = function() {
            var result = [];
            var _g = 0;
            var _g1 = this.reelCellsHelper.lines;
            while (_g < _g1.length) {
                var line = _g1[_g];
                ++_g;
                var frameContainer = winControllerPlugin.ExternalService.displayProvider.getFactory().createDisplayObjectContainer();
                frameContainer.setName("Line_" + line.id);
                var _g3 = 0;
                var _g2 = this.reelCellsHelper.reelsNum + 1;
                while (_g3 < _g2) {
                    var amountOfWins = _g3++;
                    var winPath;
                    var _g4 = [];
                    var _g6 = 0;
                    var _g5 = this.reelCellsHelper.reelsNum;
                    while (_g6 < _g5) {
                        var i = _g6++;
                        _g4.push(amountOfWins > i);
                    }
                    winPath = _g4;
                    var lineRender = new winControllerPlugin.SpaghettiWinLineRender(line, winPath);
                    var frameWithLine = this.drawWithStroke($bind(lineRender, lineRender.drawLineWinFrames), line.style);
                    frameWithLine.setName("Wins_" + amountOfWins);
                    frameContainer.addChild(frameWithLine);
                    frameWithLine.setVisible(false);
                }
                frameContainer.setVisible(false);
                result.push(frameContainer);
            }
            return result;
        };
        winControllerPlugin.LineWithFramesRender.prototype.createLineForWin = function(win, line) {
            var winPathKey = this.getWinPathKey(win, line);
            if (this.framesCache.exists(winPathKey)) return this.framesCache.get(winPathKey);
            var reelsInfo = win.winPath.reelsInfo;
            var offsets = line.offsets;
            var reelsNum = this.reelCellsHelper.reelsNum;
            var winPath;
            var _g = [];
            var _g1 = 0;
            while (_g1 < reelsNum) {
                var i = _g1++;
                _g.push(reelsInfo[i][offsets[i] - 1] == 1 && reelsInfo[i][offsets[i]] == 2);
            }
            winPath = _g;
            var lineRender = new winControllerPlugin.SpaghettiWinLineRender(line, winPath);
            var result = this.drawWithStroke($bind(lineRender, lineRender.drawLineWinFrames), line.style);
            this.framesCache.set(winPathKey, result);
            return result;
        };
        winControllerPlugin.LineWithFramesRender.prototype.createFrames = function(win, style) {
            var winPathKey = this.getWinPathKey(win, style);
            if (this.framesCache.exists(winPathKey)) return this.framesCache.get(winPathKey);
            var reelsNum = this.reelCellsHelper.reelsNum;
            var cellsNum = this.reelCellsHelper.cellsNum;
            var winPath;
            var _g = [];
            var _g1 = 0;
            while (_g1 < reelsNum) {
                var i = _g1++;
                _g.push((function($this) {
                    var $r;
                    var _g2 = []; {
                        var _g3 = 0;
                        while (_g3 < cellsNum) {
                            var j = _g3++;
                            _g2.push(win.winPath.reelsInfo[i][j] == 1);
                        }
                    }
                    $r = _g2;
                    return $r;
                }(this)));
            }
            winPath = _g;
            var framesRender = new winControllerPlugin.ScatterFramesRender(winPath);
            var result = this.drawWithStroke($bind(framesRender, framesRender.drawFrames), style);
            this.framesCache.set(winPathKey, result);
            return result;
        };
        winControllerPlugin.LineWithFramesRender.prototype.getWinPathKey = function(win, style) {
            return win.winPath.reelsInfo.toString() + style.id;
        };
        winControllerPlugin.LineWithFramesRender.prototype.drawWithStroke = function(drawFunction, style) {
            drawFunction(style.strokeLineStyle);
            var result = drawFunction(style);
            winControllerPlugin.ExternalService.uiHelper.setBlendMode(result, uiHelper.BlendMode.getByValue(style.blendMode));
            uiHelper.DisplayObjectExtension.cacheAsBitmap(result, true);
            return result;
        };
        winControllerPlugin.LineWithFramesRender.prototype.__class__ = winControllerPlugin.LineWithFramesRender;
        winControllerPlugin.ScatterFramesRender = function(winPath) {
            this.winPath = winPath;
            this.reelCellsHelper = winControllerPlugin.ExternalService.reelCellsHelper;
            this.frameDrawer = winControllerPlugin.ExternalService.uiHelper.getGraphicsDrawer();
        };
        winControllerPlugin.ScatterFramesRender.__name__ = ["winControllerPlugin", "ScatterFramesRender"];
        winControllerPlugin.ScatterFramesRender.prototype.frameDrawer = null;
        winControllerPlugin.ScatterFramesRender.prototype.reelCellsHelper = null;
        winControllerPlugin.ScatterFramesRender.prototype.winPath = null;
        winControllerPlugin.ScatterFramesRender.prototype.drawFrames = function(style) {
            this.frameDrawer.clearPolygons();
            var _g1 = 0;
            var _g = this.reelCellsHelper.reelsNum;
            while (_g1 < _g) {
                var i = _g1++;
                var _g3 = 0;
                var _g2 = this.reelCellsHelper.cellsNum;
                while (_g3 < _g2) {
                    var j = _g3++;
                    if (this.winPath[i][j]) this.addFrame(i, j, style);
                }
            }
            return this.frameDrawer.draw();
        };
        winControllerPlugin.ScatterFramesRender.prototype.addFrame = function(reelNumber, cellNumber, style) {
            var winFrameCell = this.reelCellsHelper.getWinFrameCell(reelNumber, cellNumber, style.framePadding);
            this.frameDrawer.addRoundRect(winFrameCell.x, winFrameCell.y, winFrameCell.width, winFrameCell.height, style.borderRadius);
            this.frameDrawer.withLineStyle(style.lineWidth, style.color, style.alpha, style.lineAlignment);
            this.frameDrawer.breakPolygons();
        };
        winControllerPlugin.ScatterFramesRender.prototype.__class__ = winControllerPlugin.ScatterFramesRender;
        winControllerPlugin.SpaghettiWinLineRender = function(line, winPath) {
            this.line = line;
            this.winPath = winPath;
            this.reelCellsHelper = winControllerPlugin.ExternalService.reelCellsHelper;
            this.frameDrawer = winControllerPlugin.ExternalService.uiHelper.getGraphicsDrawer();
        };
        winControllerPlugin.SpaghettiWinLineRender.__name__ = ["winControllerPlugin", "SpaghettiWinLineRender"];
        winControllerPlugin.SpaghettiWinLineRender.prototype.frameDrawer = null;
        winControllerPlugin.SpaghettiWinLineRender.prototype.reelCellsHelper = null;
        winControllerPlugin.SpaghettiWinLineRender.prototype.line = null;
        winControllerPlugin.SpaghettiWinLineRender.prototype.winPath = null;
        winControllerPlugin.SpaghettiWinLineRender.prototype.currentStyle = null;
        winControllerPlugin.SpaghettiWinLineRender.prototype.drawLineWinFrames = function(style) {
            this.currentStyle = style;
            this.frameDrawer.clearPolygons();
            this.addInitialLine();
            var _g1 = 0;
            var _g = this.line.offsets.length;
            while (_g1 < _g) {
                var t = _g1++;
                var hasWinFrame = this.winPath[t];
                if (hasWinFrame) this.addFrame(t);
                this.addSegmentToNext(t, hasWinFrame, this.winPath[t + 1]);
            }
            return this.frameDrawer.draw();
        };
        winControllerPlugin.SpaghettiWinLineRender.prototype.addInitialLine = function() {
            var segmentToNext = this.getInitialSegment();
            var polygons = [segmentToNext.point1.x, segmentToNext.point1.y, segmentToNext.point2.x, segmentToNext.point2.y];
            this.frameDrawer.withLineStyle(this.currentStyle.lineWidth, this.currentStyle.color, this.currentStyle.alpha);
            this.frameDrawer.addPolygons(polygons);
        };
        winControllerPlugin.SpaghettiWinLineRender.prototype.getInitialSegment = function() {
            var x = this.currentStyle.framePadding;
            var reelNumber = 0;
            var point1 = this.getCellPoint(reelNumber, 0);
            point1.x = 0;
            var point2 = this.getCellPoint(reelNumber, -this.currentStyle.sideOffset);
            var result = new uiHelper.Segment(point1, point2);
            result.point2 = this.getWinFrameCell(reelNumber).getIntersectionWithSegment(result);
            return result;
        };
        winControllerPlugin.SpaghettiWinLineRender.prototype.addFrame = function(reelNumber) {
            var winFrameCell = this.getWinFrameCell(reelNumber);
            this.frameDrawer.addRoundRect(winFrameCell.x, winFrameCell.y, winFrameCell.width, winFrameCell.height, this.currentStyle.borderRadius);
            this.frameDrawer.withLineStyle(this.currentStyle.lineWidth, this.currentStyle.color, this.currentStyle.alpha, this.currentStyle.lineAlignment);
            this.frameDrawer.breakPolygons();
        };
        winControllerPlugin.SpaghettiWinLineRender.prototype.addSegmentToNext = function(reelNumber, isActualWin, isNextWin) {
            var segmentToNext = this.getSegmentToNextPoint(reelNumber, isActualWin, isNextWin);
            var polygons = [segmentToNext.point1.x, segmentToNext.point1.y, segmentToNext.point2.x, segmentToNext.point2.y];
            this.frameDrawer.withLineStyle(this.currentStyle.lineWidth, this.currentStyle.color, this.currentStyle.alpha);
            this.frameDrawer.addPolygons(polygons, isActualWin);
        };
        winControllerPlugin.SpaghettiWinLineRender.prototype.getSegmentToNextPoint = function(reelNumber, isActualWin, isNextWin) {
            var point1 = this.getCellPoint(reelNumber, isActualWin ? this.currentStyle.sideOffset : 0);
            var point2 = this.getCellPoint(reelNumber + 1, isNextWin ? -this.currentStyle.sideOffset : 0);
            var result = new uiHelper.Segment(point1, point2);
            if (isActualWin) result.point1 = this.getWinFrameCell(reelNumber).getIntersectionWithSegment(result);
            if (isNextWin) result.point2 = this.getWinFrameCell(reelNumber + 1).getIntersectionWithSegment(result);
            return result;
        };
        winControllerPlugin.SpaghettiWinLineRender.prototype.getWinFrameCell = function(reelNumber) {
            var framePadding = this.currentStyle.framePadding;
            var cellNumber = this.line.offsets[_hcmn_.Math.round(_hcmn_.Math.min(reelNumber, this.line.offsets.length))] - 1;
            return this.reelCellsHelper.getWinFrameCell(reelNumber, cellNumber, framePadding);
        };
        winControllerPlugin.SpaghettiWinLineRender.prototype.getCellPoint = function(reelNumber, sideOffset) {
            if (reelNumber == this.line.offsets.length) {
                reelNumber = reelNumber - 1;
                sideOffset = this.reelCellsHelper.cellsWidth * .5;
            }
            var framePosition = this.reelCellsHelper.getFramePosition(reelNumber, this.line.offsets[reelNumber] - 1);
            framePosition.x += this.reelCellsHelper.cellsWidth * .5 + sideOffset;
            framePosition.y += this.reelCellsHelper.boundsCellHeight * .5 + this.currentStyle.topOffset;
            return framePosition;
        };
        winControllerPlugin.SpaghettiWinLineRender.prototype.__class__ = winControllerPlugin.SpaghettiWinLineRender;
        winControllerPlugin.WinFrameCell = function(x, y, width, height) {
            this.x = x;
            this.y = y;
            this.width = width;
            this.height = height;
            this.topSegment = new uiHelper.Segment(new displayEngineApi.Point(x, y), new displayEngineApi.Point(x + width, y));
            this.rightSegment = new uiHelper.Segment(new displayEngineApi.Point(x + width, y), new displayEngineApi.Point(x + width, y + height));
            this.leftSegment = new uiHelper.Segment(new displayEngineApi.Point(x, y), new displayEngineApi.Point(x, y + height));
            this.bottomSegment = new uiHelper.Segment(new displayEngineApi.Point(x, y + height), new displayEngineApi.Point(x + width, y + height));
        };
        winControllerPlugin.WinFrameCell.__name__ = ["winControllerPlugin", "WinFrameCell"];
        winControllerPlugin.WinFrameCell.prototype.x = null;
        winControllerPlugin.WinFrameCell.prototype.y = null;
        winControllerPlugin.WinFrameCell.prototype.width = null;
        winControllerPlugin.WinFrameCell.prototype.height = null;
        winControllerPlugin.WinFrameCell.prototype.topSegment = null;
        winControllerPlugin.WinFrameCell.prototype.rightSegment = null;
        winControllerPlugin.WinFrameCell.prototype.leftSegment = null;
        winControllerPlugin.WinFrameCell.prototype.bottomSegment = null;
        winControllerPlugin.WinFrameCell.prototype.getIntersectionWithSegment = function(segment) {
            var result = uiHelper.GuiMath.getSegmentsIntersection(this.topSegment, segment);
            if (result == null) result = uiHelper.GuiMath.getSegmentsIntersection(this.rightSegment, segment);
            if (result == null) result = uiHelper.GuiMath.getSegmentsIntersection(this.leftSegment, segment);
            if (result == null) result = uiHelper.GuiMath.getSegmentsIntersection(this.bottomSegment, segment);
            return result;
        };
        winControllerPlugin.WinFrameCell.prototype.__class__ = winControllerPlugin.WinFrameCell;
        if (typeof haxe == 'undefined') {
            var haxe = {};
        };

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

            get: function(k) {
                return {
                    arguments: ["*"],
                    returns: "null"
                };
            },
            set: function(k, v) {
                return {
                    arguments: ["*", "*"],
                    returns: "void"
                };
            },
            remove: function(k) {
                return {
                    arguments: ["*"],
                    returns: "boolean"
                };
            }
        };
        winControllerPlugin.BaseWinControllerPlugin.WINFRAME_ASSETS_ID = "WIN_FRAME_ANIMATION_VB";;
        winControllerPlugin.BaseWinControllerPlugin.pool = new commonTools.Pool();;
        winControllerPlugin.BaseWinControllerPlugin.viewBuilderCache = new _hcmn_.haxe_ds_StringMap();;
        return {
            exports: winControllerPlugin,
            activator: winControllerPlugin.Activator
        };
    });