define("wildFuryJackpotInfoPanel", ["viewBuilderApi", "wildFuryJackpotInfoPanelApi", "componentmodelComponentApi", "translationmanagerApi", "clientkernelLoaderApi", "uiHelper", "displayEngineApi", "displayEngineUtils", "gameLayoutApi", "PIXI", "BABYLON", "clientkernelEventbusApi", "clientkernelModulesApi", "tools", "moneyApi"],
    function(viewBuilderApi, wildFuryJackpotInfoPanelApi, componentmodelComponentApi, translationmanagerApi, clientkernelLoaderApi, uiHelper, displayEngineApi, displayEngineUtils, gameLayoutApi, PIXI, BABYLON, clientkernelEventbusApi, clientkernelModulesApi, tools, 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 wildFuryJackpotInfoPanel == 'undefined') {
            var wildFuryJackpotInfoPanel = {};
        };
        wildFuryJackpotInfoPanel.Activator = function(context) {};
        wildFuryJackpotInfoPanel.Activator = ck_implements(wildFuryJackpotInfoPanel.Activator, clientkernelModulesApi.IModuleActivator);
        wildFuryJackpotInfoPanel.Activator.__interfaces__ = [clientkernelModulesApi.IModuleActivator];
        wildFuryJackpotInfoPanel.Activator.__name__ = ["wildFuryJackpotInfoPanel", "Activator"];
        wildFuryJackpotInfoPanel.Activator.prototype.start = function(context) {
            context.getServiceTracker([clientkernelLoaderApi.IAssetRegistry, viewBuilderApi.IViewBuilderFactory, displayEngineApi.IDisplayProvider, translationmanagerApi.ITranslationManager]).then(function(context1) {
                wildFuryJackpotInfoPanel.ExternalService.initialize(context1);
                var vbf = context1.getAnyService(viewBuilderApi.IViewBuilderFactory, null);
                wildFuryJackpotInfoPanel.ExternalService.viewBuilderFactory = vbf;
                context1.registerService(new wildFuryJackpotInfoPanel.JackpotInfoPanelFactory(context1), wildFuryJackpotInfoPanelApi.JackpotInfoPanelDeclaration, null);
            });
        };
        wildFuryJackpotInfoPanel.Activator.prototype.stop = function(context) {};
        wildFuryJackpotInfoPanel.Activator.main = function() {};
        wildFuryJackpotInfoPanel.Activator.prototype.__class__ = wildFuryJackpotInfoPanel.Activator;
        wildFuryJackpotInfoPanel.ExternalService = function() {};
        wildFuryJackpotInfoPanel.ExternalService.__name__ = ["wildFuryJackpotInfoPanel", "ExternalService"];
        wildFuryJackpotInfoPanel.ExternalService.bus = null;
        wildFuryJackpotInfoPanel.ExternalService.busChanel = null;
        wildFuryJackpotInfoPanel.ExternalService.assetRegistry = null;
        wildFuryJackpotInfoPanel.ExternalService.vbf = null;
        wildFuryJackpotInfoPanel.ExternalService.displayProvider = null;
        wildFuryJackpotInfoPanel.ExternalService.translationManager = null;
        wildFuryJackpotInfoPanel.ExternalService.moneyFormatter = null;
        wildFuryJackpotInfoPanel.ExternalService.viewBuilderFactory = null;
        wildFuryJackpotInfoPanel.ExternalService.loadedCallback = null;
        wildFuryJackpotInfoPanel.ExternalService.initialize = function(context) {
            wildFuryJackpotInfoPanel.ExternalService.assetRegistry = context.getAnyService(clientkernelLoaderApi.IAssetRegistry, null);
            wildFuryJackpotInfoPanel.ExternalService.vbf = context.getAnyService(viewBuilderApi.IViewBuilderFactory, null);
            wildFuryJackpotInfoPanel.ExternalService.displayProvider = context.getAnyService(displayEngineApi.IDisplayProvider, null);
            wildFuryJackpotInfoPanel.ExternalService.translationManager = context.getAnyService(translationmanagerApi.ITranslationManager, null);
            wildFuryJackpotInfoPanel.ExternalService.moneyFormatter = context.getAnyService(moneyApi.IMoneyFormatter, null);
            wildFuryJackpotInfoPanel.ExternalService.bus = context.getAnyService(clientkernelEventbusApi.IEventBus, null);
            wildFuryJackpotInfoPanel.ExternalService.busChanel = wildFuryJackpotInfoPanel.ExternalService.bus.getChannel("GFBus");
        };
        wildFuryJackpotInfoPanel.ExternalService.getAsset = function(id) {
            return wildFuryJackpotInfoPanel.ExternalService.assetRegistry.getAsset(id).getContent();
        };
        wildFuryJackpotInfoPanel.ExternalService.loadVBAssets = function(id, loadedCallback) {
            wildFuryJackpotInfoPanel.ExternalService.loadedCallback = loadedCallback;
            wildFuryJackpotInfoPanel.ExternalService.loading++;
            wildFuryJackpotInfoPanel.ExternalService.assetRegistry.getAsset(id).getContent().then(function(vba) {
                wildFuryJackpotInfoPanel.ExternalService.loadedAssets.set(id, vba);
                wildFuryJackpotInfoPanel.ExternalService.checkLoaded();
            });
        };
        wildFuryJackpotInfoPanel.ExternalService.checkLoaded = function() {
            wildFuryJackpotInfoPanel.ExternalService.totalLoaded++;
            if (wildFuryJackpotInfoPanel.ExternalService.totalLoaded == wildFuryJackpotInfoPanel.ExternalService.loading) wildFuryJackpotInfoPanel.ExternalService.loadedCallback();
        };
        wildFuryJackpotInfoPanel.ExternalService.prototype.__class__ = wildFuryJackpotInfoPanel.ExternalService;
        wildFuryJackpotInfoPanel.GameConfig = function() {};
        wildFuryJackpotInfoPanel.GameConfig.__name__ = ["wildFuryJackpotInfoPanel", "GameConfig"];
        wildFuryJackpotInfoPanel.GameConfig.prototype.jackpotPanelConfig = null;
        wildFuryJackpotInfoPanel.GameConfig.prototype.__class__ = wildFuryJackpotInfoPanel.GameConfig;
        wildFuryJackpotInfoPanel.JackpotInfoPanel = function(context, cfgId, config) {
            this.initialized = false;
            var _g = this;
            this.config = config;
            this.context = context;
            this.port = context.getImplementedPort(wildFuryJackpotInfoPanelApi.JackpotInfoPanelImplementationPort);
            this.port.getHide().subscribe($bind(this, this.onHide));
            this.port.getUpdateLevel().subscribe($bind(this, this.onUpdateJackpotPanel));
            this.port.getUpdateBattery().subscribe($bind(this, this.onUpdateBatteryJackpotPanel));
            this.port.getShowPanel().subscribe($bind(this, this.onShowJackpotPanel));
            this.port.getUpdateBetMultiplier().subscribe($bind(this, this.onUpdateBetMultiplier));
            this.layoutPort = context.getUsedPort(gameLayoutApi.IGameLayoutPort);
            this.layoutPort.getUpdateComponentLayout().subscribe($bind(this, this.handleUpdateLayout));
            this.container = wildFuryJackpotInfoPanel.ExternalService.displayProvider.getFactory().createDisplayObjectContainer();
            this.container.setName("jackpotPanel");
            wildFuryJackpotInfoPanel.ExternalService.assetRegistry.getAssetsContent(["jackpotinfopanel-assets/jackpotpanel_config", "jackpotinfopanel-assets/JACKPOT_PANEL", "jackpotinfopanel-assets/JACKPOT_PANEL_ANIMATION"]).then(function(data) {
                wildFuryJackpotInfoPanel.ExternalService.loadedAssets = data;
                _g.vba = wildFuryJackpotInfoPanel.ExternalService.loadedAssets.get("JACKPOT_PANEL");
                _g.initialize();
            });
        };
        wildFuryJackpotInfoPanel.JackpotInfoPanel.__name__ = ["wildFuryJackpotInfoPanel", "JackpotInfoPanel"];
        wildFuryJackpotInfoPanel.JackpotInfoPanel.prototype.port = null;
        wildFuryJackpotInfoPanel.JackpotInfoPanel.prototype.context = null;
        wildFuryJackpotInfoPanel.JackpotInfoPanel.prototype.layoutPort = null;
        wildFuryJackpotInfoPanel.JackpotInfoPanel.prototype.layoutPayload = null;
        wildFuryJackpotInfoPanel.JackpotInfoPanel.prototype.initialized = null;
        wildFuryJackpotInfoPanel.JackpotInfoPanel.prototype.vba = null;
        wildFuryJackpotInfoPanel.JackpotInfoPanel.prototype.fba = null;
        wildFuryJackpotInfoPanel.JackpotInfoPanel.prototype.container = null;
        wildFuryJackpotInfoPanel.JackpotInfoPanel.prototype.currentPanel = null;
        wildFuryJackpotInfoPanel.JackpotInfoPanel.prototype.config = null;
        wildFuryJackpotInfoPanel.JackpotInfoPanel.prototype.onHide = function(e) {
            if (this.currentPanel != null) this.currentPanel.hide();
        };
        wildFuryJackpotInfoPanel.JackpotInfoPanel.prototype.onShowJackpotPanel = function(e) {
            this.currentPanel.init(e.getPayload());
            this.displayJackpotPanel();
        };
        wildFuryJackpotInfoPanel.JackpotInfoPanel.prototype.onUpdateJackpotPanel = function(e) {
            this.currentPanel.updateLevel(e.getPayload());
        };
        wildFuryJackpotInfoPanel.JackpotInfoPanel.prototype.onUpdateBatteryJackpotPanel = function(e) {
            this.currentPanel.updateBattery(e.getPayload());
        };
        wildFuryJackpotInfoPanel.JackpotInfoPanel.prototype.onUpdateBetMultiplier = function(e) {
            this.currentPanel.updateBetMultiplier(e.getPayload());
        };
        wildFuryJackpotInfoPanel.JackpotInfoPanel.prototype.displayJackpotPanel = function() {
            this.currentPanel.show();
        };
        wildFuryJackpotInfoPanel.JackpotInfoPanel.prototype.handleUpdateLayout = function(e) {
            this.layoutPayload = e.getPayload();
            if (!this.initialized) this.initialize();
            else this.updateLayout();
        };
        wildFuryJackpotInfoPanel.JackpotInfoPanel.prototype.onAnimationCompleted = function() {
            this.port.getAnimationCompleted().publish(null);
        };
        wildFuryJackpotInfoPanel.JackpotInfoPanel.prototype.initialize = function() {
            if (this.layoutPayload != null && this.vba != null) {
                var view = wildFuryJackpotInfoPanel.ExternalService.vbf.createView(this.vba);
                this.currentPanel = new wildFuryJackpotInfoPanel.JackpotPanel(view.getContainerById("panel"), this.config);
                this.currentPanel.setAnimationCompletedHandler($bind(this, this.onAnimationCompleted));
                this.initialized = true;
                this.container.addChild(this.currentPanel.container.getDisplayObject());
                this.updateLayout();
            }
        };
        wildFuryJackpotInfoPanel.JackpotInfoPanel.prototype.updateLayout = function() {
            var layout = this.layoutPayload.containers.get("jackpotinfopanel");
            var stage;
            var this1 = wildFuryJackpotInfoPanel.ExternalService.displayProvider.getStages();
            stage = this1.get(layout.stage);
            stage.removeChild(this.container);
            this.container.setX(layout.left);
            this.container.setY(layout.top);
            this.container.setZIndex(layout.zIndex);
            this.container.setScaleX(layout.configuration.scaleX);
            this.container.setScaleY(layout.configuration.scaleY);
            stage.addChild(this.container);
            this.currentPanel.configure(layout.configuration);
            this.layoutPort.getComponentLayoutUpdated().publish(this.context.getInstance());
        };
        wildFuryJackpotInfoPanel.JackpotInfoPanel.prototype.__class__ = wildFuryJackpotInfoPanel.JackpotInfoPanel;
        wildFuryJackpotInfoPanel.JackpotInfoPanelFactory = function(context) {
            this.context = context;
        };
        wildFuryJackpotInfoPanel.JackpotInfoPanelFactory = ck_implements(wildFuryJackpotInfoPanel.JackpotInfoPanelFactory, clientkernelModulesApi.IService);
        wildFuryJackpotInfoPanel.JackpotInfoPanelFactory = ck_implements(wildFuryJackpotInfoPanel.JackpotInfoPanelFactory, componentmodelComponentApi.IComponentFactory);
        wildFuryJackpotInfoPanel.JackpotInfoPanelFactory.__interfaces__ = [clientkernelModulesApi.IService, componentmodelComponentApi.IComponentFactory];
        wildFuryJackpotInfoPanel.JackpotInfoPanelFactory.__name__ = ["wildFuryJackpotInfoPanel", "JackpotInfoPanelFactory"];
        wildFuryJackpotInfoPanel.JackpotInfoPanelFactory.prototype.context = null;
        wildFuryJackpotInfoPanel.JackpotInfoPanelFactory.prototype.getComponentDeclaration = function() {
            return wildFuryJackpotInfoPanelApi.JackpotInfoPanelDeclaration;
        };
        wildFuryJackpotInfoPanel.JackpotInfoPanelFactory.prototype.createComponent = function(context) {
            wildFuryJackpotInfoPanel.ExternalService.assetRegistry.getAsset("game-config_json").getContent().then(function(config) {
                var cfgId = context.getConfiguration();
                new wildFuryJackpotInfoPanel.JackpotInfoPanel(context, cfgId, config);
            });
        };
        wildFuryJackpotInfoPanel.JackpotInfoPanelFactory.prototype.__class__ = wildFuryJackpotInfoPanel.JackpotInfoPanelFactory;

        wildFuryJackpotInfoPanel.SwipeAnimator = function() {}
        wildFuryJackpotInfoPanel.SwipeAnimator.prototype = {

            runAnimation: function() {
                return {
                    arguments: [],
                    returns: "*"
                };
            }
        };
        wildFuryJackpotInfoPanel.AlphaSwipeAnimator = function(from, to, config) {
            this.from = from;
            this.to = to;
            this.config = config;
        };
        wildFuryJackpotInfoPanel.AlphaSwipeAnimator = ck_implements(wildFuryJackpotInfoPanel.AlphaSwipeAnimator, wildFuryJackpotInfoPanel.SwipeAnimator);
        wildFuryJackpotInfoPanel.AlphaSwipeAnimator.__interfaces__ = [wildFuryJackpotInfoPanel.SwipeAnimator];
        wildFuryJackpotInfoPanel.AlphaSwipeAnimator.__name__ = ["wildFuryJackpotInfoPanel", "AlphaSwipeAnimator"];
        wildFuryJackpotInfoPanel.AlphaSwipeAnimator.prototype.from = null;
        wildFuryJackpotInfoPanel.AlphaSwipeAnimator.prototype.to = null;
        wildFuryJackpotInfoPanel.AlphaSwipeAnimator.prototype.config = null;
        wildFuryJackpotInfoPanel.AlphaSwipeAnimator.prototype.runAnimation = function() {
            var _g = this;
            return new Promise(function(resolve, reject) {
                displayEngineUtils.TweenX.from(_g.to, {
                    alpha: 0
                }, null, null, null, null, {
                    fileName: "AlphaSwipeAnimator.hx",
                    lineNumber: 22,
                    className: "components.jackpotinfopanel.animations.AlphaSwipeAnimator",
                    methodName: "runAnimation"
                });
                displayEngineUtils.TweenX.to(_g.to, {
                    alpha: 1
                }, _g.config.durationOfAppearing, $bind(_g, _g.easyInFunction), null, null, null, null, null, null, {
                    fileName: "AlphaSwipeAnimator.hx",
                    lineNumber: 23,
                    className: "components.jackpotinfopanel.animations.AlphaSwipeAnimator",
                    methodName: "runAnimation"
                });
                window.setTimeout(function() {
                    displayEngineUtils.TweenX.from(_g.from, {
                        alpha: 1
                    }, null, null, null, null, {
                        fileName: "AlphaSwipeAnimator.hx",
                        lineNumber: 25,
                        className: "components.jackpotinfopanel.animations.AlphaSwipeAnimator",
                        methodName: "runAnimation"
                    });
                    displayEngineUtils.TweenX.to(_g.from, {
                        alpha: 0
                    }, _g.config.durationOfDisappearing, $bind(_g, _g.easyOutFunction), null, null, null, null, null, null, {
                        fileName: "AlphaSwipeAnimator.hx",
                        lineNumber: 26,
                        className: "components.jackpotinfopanel.animations.AlphaSwipeAnimator",
                        methodName: "runAnimation"
                    }).onFinish(function() {
                        resolve(null);
                    });
                }, _g.config.timeoutOfDisappearing);
            });
        };
        wildFuryJackpotInfoPanel.AlphaSwipeAnimator.prototype.easyInFunction = function(d) {
            return -Math.pow(d - 1, 2) + 1;
        };
        wildFuryJackpotInfoPanel.AlphaSwipeAnimator.prototype.easyOutFunction = function(d) {
            return _hcmn_.Math.pow(d, 2);
        };
        wildFuryJackpotInfoPanel.AlphaSwipeAnimator.prototype.__class__ = wildFuryJackpotInfoPanel.AlphaSwipeAnimator;
        wildFuryJackpotInfoPanel.RollSwipeAnimator = function(from, to, config) {
            this.from = from;
            this.to = to;
            this.config = config;
            this.stepTimeout = config.stepTimeout;
            this.duration = config.duration;
            this.initialX = this.to.getX();
            this.initialWidth = this.to.getWidth();
            this.stepsAmount = this.duration / this.stepTimeout | 0;
            this.expectedTimeoutOfEnd = this.stepTimeout * (this.stepsAmount + 1) | 0;
        };
        wildFuryJackpotInfoPanel.RollSwipeAnimator = ck_implements(wildFuryJackpotInfoPanel.RollSwipeAnimator, wildFuryJackpotInfoPanel.SwipeAnimator);
        wildFuryJackpotInfoPanel.RollSwipeAnimator.__interfaces__ = [wildFuryJackpotInfoPanel.SwipeAnimator];
        wildFuryJackpotInfoPanel.RollSwipeAnimator.__name__ = ["wildFuryJackpotInfoPanel", "RollSwipeAnimator"];
        wildFuryJackpotInfoPanel.RollSwipeAnimator.prototype.from = null;
        wildFuryJackpotInfoPanel.RollSwipeAnimator.prototype.to = null;
        wildFuryJackpotInfoPanel.RollSwipeAnimator.prototype.expectedTimeoutOfEnd = null;
        wildFuryJackpotInfoPanel.RollSwipeAnimator.prototype.stepTimeout = null;
        wildFuryJackpotInfoPanel.RollSwipeAnimator.prototype.stepsAmount = null;
        wildFuryJackpotInfoPanel.RollSwipeAnimator.prototype.duration = null;
        wildFuryJackpotInfoPanel.RollSwipeAnimator.prototype.initialX = null;
        wildFuryJackpotInfoPanel.RollSwipeAnimator.prototype.initialWidth = null;
        wildFuryJackpotInfoPanel.RollSwipeAnimator.prototype.config = null;
        wildFuryJackpotInfoPanel.RollSwipeAnimator.prototype.runAnimation = function() {
            var _g = this;
            var promize = new Promise(function(resolve, reject) {
                window.setTimeout(_g.getFinalFunctionApplierFor(_g.to, function() {
                    resolve(null);
                }), _g.expectedTimeoutOfEnd);
                _g.runMaiAnimation();
            });
            return promize;
        };
        wildFuryJackpotInfoPanel.RollSwipeAnimator.prototype.runMaiAnimation = function() {
            var _g2 = this;
            this.to.setWidth(0);
            this.to.setX(this.initialX + this.initialWidth);
            var _g1 = 0;
            var _g = this.stepsAmount;
            while (_g1 < _g) {
                var i = _g1++;
                var progressFactor = this.getProgressFactor(i, this.stepsAmount);
                window.setTimeout((function(progressFactor1) {
                    var antiFactor = 1 - progressFactor1;
                    return function() {
                        var width = progressFactor1 * _g2.initialWidth;
                        var antiWidth = antiFactor * _g2.initialWidth;
                        _g2.from.setWidth(width + antiWidth * _g2.config.widthPaddingForDisappearingObject);
                        _g2.from.setX(_g2.initialX + antiWidth * _g2.config.xPaddingForDisappearingObject);
                        _g2.to.setWidth(antiWidth + width * _g2.config.widthPaddingForAppearingObject);
                        _g2.to.setX(_g2.initialX + width - width * _g2.config.xPaddingForAppearingObject);
                    };
                })(progressFactor), this.stepTimeout * i | 0);
            }
        };
        wildFuryJackpotInfoPanel.RollSwipeAnimator.prototype.getFinalFunctionApplierFor = function(displayObject, calbackFunction) {
            var initialWidth = displayObject.getWidth();
            var initialX = displayObject.getX();
            return function() {
                calbackFunction();
                displayObject.setX(initialX);
                displayObject.setWidth(initialWidth);
            };
        };
        wildFuryJackpotInfoPanel.RollSwipeAnimator.prototype.getProgressFactor = function(actual, total) {
            var x = actual / total * _hcmn_.Math.PI;
            return (_hcmn_.Math.cos(x) + 1) / 2;
        };
        wildFuryJackpotInfoPanel.RollSwipeAnimator.prototype.__class__ = wildFuryJackpotInfoPanel.RollSwipeAnimator;
        wildFuryJackpotInfoPanel.SwipeAnimationsWaiter = function() {
            this.animations = [];
        };
        wildFuryJackpotInfoPanel.SwipeAnimationsWaiter.__name__ = ["wildFuryJackpotInfoPanel", "SwipeAnimationsWaiter"];
        wildFuryJackpotInfoPanel.SwipeAnimationsWaiter.prototype.animations = null;
        wildFuryJackpotInfoPanel.SwipeAnimationsWaiter.prototype.addAnimation = function(animation) {
            this.animations.push(animation);
            return this;
        };
        wildFuryJackpotInfoPanel.SwipeAnimationsWaiter.prototype.runAndWait = function(calback) {
            var promizesWaiter = new tools.PromizesWaiter();
            var _g = 0;
            var _g1 = this.animations;
            while (_g < _g1.length) {
                var animation = _g1[_g];
                ++_g;
                promizesWaiter.awaitPromise(animation.runAnimation());
            }
            promizesWaiter.await(calback);
        };
        wildFuryJackpotInfoPanel.SwipeAnimationsWaiter.prototype.__class__ = wildFuryJackpotInfoPanel.SwipeAnimationsWaiter;
        wildFuryJackpotInfoPanel.JackpotPanel = function(container, config) {
            this.container = container;
            var horizontalAnimation = config.jackpotPanelConfig.horizontalAnimation;
            var verticalAnimation = config.jackpotPanelConfig.verticalAnimation;
            var alphaAnimation = config.jackpotPanelConfig.alphaAnimation;
            this.horizontalJackpotPanelControl = new wildFuryJackpotInfoPanel.JackpotPanelControl(container, "horizontal", horizontalAnimation, alphaAnimation);
            this.verticalJackpotPanelControl = new wildFuryJackpotInfoPanel.JackpotPanelControl(container, "vertical", verticalAnimation, alphaAnimation);
        };
        wildFuryJackpotInfoPanel.JackpotPanel.__name__ = ["wildFuryJackpotInfoPanel", "JackpotPanel"];
        wildFuryJackpotInfoPanel.JackpotPanel.prototype.port = null;
        wildFuryJackpotInfoPanel.JackpotPanel.prototype.container = null;
        wildFuryJackpotInfoPanel.JackpotPanel.prototype.payload = null;
        wildFuryJackpotInfoPanel.JackpotPanel.prototype.horizontalJackpotPanelControl = null;
        wildFuryJackpotInfoPanel.JackpotPanel.prototype.verticalJackpotPanelControl = null;
        wildFuryJackpotInfoPanel.JackpotPanel.prototype.setAnimationCompletedHandler = function(animationCompletedHandler) {
            this.horizontalJackpotPanelControl.setAnimationCompletedHandler(animationCompletedHandler);
            this.verticalJackpotPanelControl.setAnimationCompletedHandler(animationCompletedHandler);
        };
        wildFuryJackpotInfoPanel.JackpotPanel.prototype.show = function() {
            this.container.show();
            this.displayJackpotData();
        };
        wildFuryJackpotInfoPanel.JackpotPanel.prototype.displayJackpotData = function() {
            this.horizontalJackpotPanelControl.setWildsLadder(this.payload.wildsLadder);
            this.horizontalJackpotPanelControl.displayJackpotData(this.payload.level, this.payload.values);
            this.verticalJackpotPanelControl.setWildsLadder(this.payload.wildsLadder);
            this.verticalJackpotPanelControl.displayJackpotData(this.payload.level, this.payload.values);
        };
        wildFuryJackpotInfoPanel.JackpotPanel.prototype.hide = function() {
            this.container.getDisplayObject().setVisible(false);
        };
        wildFuryJackpotInfoPanel.JackpotPanel.prototype.configure = function(config) {
            this.configureActualType(this.horizontalJackpotPanelControl, config.type);
            this.configureActualType(this.verticalJackpotPanelControl, config.type);
        };
        wildFuryJackpotInfoPanel.JackpotPanel.prototype.configureActualType = function(jackpotPanelControl, type) {
            jackpotPanelControl.setVisible(jackpotPanelControl.getType() == type);
        };
        wildFuryJackpotInfoPanel.JackpotPanel.prototype.init = function(data) {
            this.payload = data;
        };
        wildFuryJackpotInfoPanel.JackpotPanel.prototype.updateBetMultiplier = function(betMultiplier) {
            this.horizontalJackpotPanelControl.updateBetMultiplier(betMultiplier);
            this.verticalJackpotPanelControl.updateBetMultiplier(betMultiplier);
        };
        wildFuryJackpotInfoPanel.JackpotPanel.prototype.updateLevel = function(data) {
            this.payload = data;
            this.displayJackpotData();
        };
        wildFuryJackpotInfoPanel.JackpotPanel.prototype.updateBattery = function(data) {
            this.horizontalJackpotPanelControl.updateBattery(this.payload.level, data.wildNumber);
            this.verticalJackpotPanelControl.updateBattery(this.payload.level, data.wildNumber);
        };
        wildFuryJackpotInfoPanel.JackpotPanel.prototype.__class__ = wildFuryJackpotInfoPanel.JackpotPanel;
        wildFuryJackpotInfoPanel.JackpotPanelControl = function(container, type, swipeAnimationConfig, alphaAnimationConfig) {
            this.isBatteryChanged = true;
            this.previsousSegmentsLen = 0.0;
            this.initialPosition = new displayEngineApi.Point(0, 0);
            this.panelsCache = [];
            this.batteryLvl = -1;
            this.wildsCollected = -1;
            this.betMultiplier = 1;
            this.levelLabel = -1;
            this.type = type;
            this.container = container;
            this.swipeAnimationConfig = swipeAnimationConfig;
            this.alphaAnimationConfig = alphaAnimationConfig;
            this.currentPrefix = "JP_" + type + "_";
            this.uiHelper = uiHelper.UiHelper.getUiHelper(wildFuryJackpotInfoPanel.ExternalService.displayProvider);
            var configData = wildFuryJackpotInfoPanel.ExternalService.assetRegistry.getAsset("jackpotpanel_config");
            this.config = _hcmn_.Reflect.field(configData.content, type);
            this.cacheContainers();
        };
        wildFuryJackpotInfoPanel.JackpotPanelControl.__name__ = ["wildFuryJackpotInfoPanel", "JackpotPanelControl"];
        wildFuryJackpotInfoPanel.JackpotPanelControl.prototype.currentPrefix = null;
        wildFuryJackpotInfoPanel.JackpotPanelControl.prototype.type = null;
        wildFuryJackpotInfoPanel.JackpotPanelControl.prototype.panelContainer = null;
        wildFuryJackpotInfoPanel.JackpotPanelControl.prototype.contentViewBuilder = null;
        wildFuryJackpotInfoPanel.JackpotPanelControl.prototype.artifactContainer = null;
        wildFuryJackpotInfoPanel.JackpotPanelControl.prototype.container = null;
        wildFuryJackpotInfoPanel.JackpotPanelControl.prototype.actualContainer = null;
        wildFuryJackpotInfoPanel.JackpotPanelControl.prototype.isVisible = null;
        wildFuryJackpotInfoPanel.JackpotPanelControl.prototype.levelLabel = null;
        wildFuryJackpotInfoPanel.JackpotPanelControl.prototype.betMultiplier = null;
        wildFuryJackpotInfoPanel.JackpotPanelControl.prototype.wildsCollected = null;
        wildFuryJackpotInfoPanel.JackpotPanelControl.prototype.batteryLvl = null;
        wildFuryJackpotInfoPanel.JackpotPanelControl.prototype.valuesLabels = null;
        wildFuryJackpotInfoPanel.JackpotPanelControl.prototype.swipeAnimationConfig = null;
        wildFuryJackpotInfoPanel.JackpotPanelControl.prototype.alphaAnimationConfig = null;
        wildFuryJackpotInfoPanel.JackpotPanelControl.prototype.wildsLadder = null;
        wildFuryJackpotInfoPanel.JackpotPanelControl.prototype.panelsCache = null;
        wildFuryJackpotInfoPanel.JackpotPanelControl.prototype.initialPosition = null;
        wildFuryJackpotInfoPanel.JackpotPanelControl.prototype.animationCompletedHandler = null;
        wildFuryJackpotInfoPanel.JackpotPanelControl.prototype.uiHelper = null;
        wildFuryJackpotInfoPanel.JackpotPanelControl.prototype.config = null;
        wildFuryJackpotInfoPanel.JackpotPanelControl.prototype.previsousSegmentsLen = null;
        wildFuryJackpotInfoPanel.JackpotPanelControl.prototype.isBatteryChanged = null;
        wildFuryJackpotInfoPanel.JackpotPanelControl.prototype.getAnimation = function(holderID, animationID, assetID) {
            var animAssets = wildFuryJackpotInfoPanel.ExternalService.loadedAssets.get(assetID);
            var animView = wildFuryJackpotInfoPanel.ExternalService.viewBuilderFactory.createView(animAssets);
            var animHolder = animView.createContainerFromStoredConfig(holderID);
            return animHolder.getVBAnimationById(animationID);
        };
        wildFuryJackpotInfoPanel.JackpotPanelControl.prototype.cacheContainers = function() {
            while (this.panelsCache.length < 2) {
                var actualContainer = this.container.createContainerFromStoredConfig(this.type);
                var contentViewBuilder = actualContainer.getContainerById("content");
                var panelContainer = contentViewBuilder.getDisplayObject();
                var _g = 0;
                while (_g < 5) {
                    var i = _g++;
                    var animation = this.getAnimation("ANIMATION_HOLDER", "ANIMATION_CONTENT", "JACKPOT_PANEL_ANIMATION");
                    var animContainer = contentViewBuilder.getContainerById("Bat_anim_" + this.type + "_" + i);
                    animContainer.addChildComponent(animation, "BAT_ANIMATION_" + this.type + "_" + i);
                    animation.play(false);
                    animation.stop();
                }
                this.panelsCache.push(actualContainer);
                this.initialPosition.x = panelContainer.getX();
                this.initialPosition.y = panelContainer.getY();
            }
        };
        wildFuryJackpotInfoPanel.JackpotPanelControl.prototype.createNewContainer = function(level) {
            this.actualContainer = this.panelsCache.shift();
            this.contentViewBuilder = this.actualContainer.getContainerById("content");
            this.panelContainer = this.contentViewBuilder.getDisplayObject();
            this.panelContainer.setX(this.initialPosition.x);
            this.panelContainer.setY(this.initialPosition.y);
            this.panelContainer.setScale(1);
            this.panelsCache.push(this.actualContainer);
            if (this.container.getComponentById(this.type + level) == null) this.container.addChildComponent(this.actualContainer, this.type + level);
            this.actualContainer.show();
            this.actualContainer.getDisplayObject().bringToTop();
            var isArtifactPresent = this.actualContainer.getDisplayObject().getChildByName("artifact") != null;
            if (isArtifactPresent) this.artifactContainer = this.actualContainer.getContainerById("artifact").getDisplayObject();
            else this.artifactContainer = wildFuryJackpotInfoPanel.ExternalService.displayProvider.getFactory().createDisplayObjectContainer();
            this.setVisible(this.isVisible);
            this.updateWildMeter();
            this.showBatteryAndWildMeterOnDemand(-1);
            this.updateBg(level);
        };
        wildFuryJackpotInfoPanel.JackpotPanelControl.prototype.setAnimationCompletedHandler = function(animationCompletedHandler) {
            this.animationCompletedHandler = animationCompletedHandler;
        };
        wildFuryJackpotInfoPanel.JackpotPanelControl.prototype.swipePanel = function(levelLabel, timeoutStep) {
            if (timeoutStep == null) timeoutStep = 33.3333;
            var _g = this;
            this.showBatteryAndWildMeterOnDemand(-1);
            var panelContainer = this.panelContainer;
            var artifactContainer = this.artifactContainer;
            var actualContainer = this.actualContainer;
            this.createNewContainer(levelLabel);
            this.setJackpotData("" + levelLabel, this.valuesLabels);
            var rollSwipeAnimator = new wildFuryJackpotInfoPanel.RollSwipeAnimator(panelContainer, this.panelContainer, this.swipeAnimationConfig);
            var alphaSwipeAnimator = new wildFuryJackpotInfoPanel.AlphaSwipeAnimator(artifactContainer, this.artifactContainer, this.alphaAnimationConfig);
            new wildFuryJackpotInfoPanel.SwipeAnimationsWaiter().addAnimation(rollSwipeAnimator).addAnimation(alphaSwipeAnimator).runAndWait(function() {
                actualContainer.hide();
                _g.setVisible(_g.isVisible);
                if (_g.isVisible) {
                    _g.animationCompletedHandler();
                    _g.isBatteryChanged = true;
                    _g.showBatteryAndWildMeterOnDemand(_g.getBatteryLevelId());
                }
            });
        };
        wildFuryJackpotInfoPanel.JackpotPanelControl.prototype.updateBattery = function(levelLabel, wildNumber) {
            var prevWildsCollected = this.wildsCollected;
            if (levelLabel == "0") this.wildsCollected = -1;
            else this.wildsCollected = _hcmn_.Std.parseInt(wildNumber);
            var newBatLevel = this.getBatteryLevelId();
            if (newBatLevel >= 0 && newBatLevel < 4 && newBatLevel != this.batteryLvl) {
                wildFuryJackpotInfoPanel.ExternalService.busChanel.publish("JackpotInfoPanel:batteryUp", "");
                this.previsousSegmentsLen += this.getPrevSegmentsLen(newBatLevel);
            }
            this.batteryLvl = newBatLevel;
            this.isBatteryChanged = prevWildsCollected != this.wildsCollected;
            this.showBatteryAndWildMeterOnDemand(this.getBatteryLevelId());
        };
        wildFuryJackpotInfoPanel.JackpotPanelControl.prototype.getPrevSegmentsLen = function(newBatLevel) {
            var result = 0.0;
            if (this.batteryLvl >= 0) result = this.config.lengthPerSegment[this.wildsLadder.length - this.batteryLvl] + this.config.gapY;
            else {
                var segCount = this.wildsLadder.length - newBatLevel;
                result += this.config.lengthPerSegment[0];
                var _g = 1;
                while (_g < segCount) {
                    var i = _g++;
                    result += this.config.lengthPerSegment[i] + this.config.gapY;
                }
            }
            return result;
        };
        wildFuryJackpotInfoPanel.JackpotPanelControl.prototype.setWildsLadder = function(wildsLadder) {
            this.wildsLadder = wildsLadder;
        };
        wildFuryJackpotInfoPanel.JackpotPanelControl.prototype.displayJackpotData = function(levelLabel, valuesLabels) {
            if (this.levelLabel == _hcmn_.Std.parseInt(levelLabel)) return;
            if (this.levelLabel != -1) this.swipePanel(_hcmn_.Std.parseInt(levelLabel));
            else {
                this.createNewContainer(_hcmn_.Std.parseInt(levelLabel));
                this.setJackpotData(levelLabel, valuesLabels);
                this.isBatteryChanged = false;
                this.previsousSegmentsLen = 0;
            }
        };
        wildFuryJackpotInfoPanel.JackpotPanelControl.prototype.updateBetMultiplier = function(betMultiplier) {
            this.betMultiplier = betMultiplier;
            var correctedLevelLabel;
            correctedLevelLabel = "" + (this.levelLabel == 0 ? 1 : this.levelLabel);
            if (this.valuesLabels != null) this.setJackpotValues(correctedLevelLabel, this.valuesLabels);
        };
        wildFuryJackpotInfoPanel.JackpotPanelControl.prototype.setJackpotData = function(levelLabel, valuesLabels) {
            this.levelLabel = _hcmn_.Std.parseInt(levelLabel);
            this.valuesLabels = valuesLabels;
            var correctedLevelLabel;
            if (levelLabel == "0") correctedLevelLabel = "1";
            else correctedLevelLabel = levelLabel;
            var labelText = wildFuryJackpotInfoPanel.ExternalService.translationManager.stringLookup("Level_label", [correctedLevelLabel]);
            this.setLabelText("" + this.currentPrefix + "Level_label", labelText);
            this.setJackpotValues(correctedLevelLabel, valuesLabels);
            this.updateBg(this.levelLabel);
        };
        wildFuryJackpotInfoPanel.JackpotPanelControl.prototype.getBatteryLevelId = function() {
            if (this.wildsCollected >= this.wildsLadder[4]) return 0;
            else if (this.wildsCollected >= this.wildsLadder[3]) return 1;
            else if (this.wildsCollected >= this.wildsLadder[2]) return 2;
            else if (this.wildsCollected >= this.wildsLadder[1]) return 3;
            else if (this.wildsCollected >= 0) return 4;
            return -1;
        };
        wildFuryJackpotInfoPanel.JackpotPanelControl.prototype.showBatteryAndWildMeterOnDemand = function(batteryId) {
            if (batteryId < 0 && this.levelLabel <= 0) {
                this.isBatteryChanged = false;
                this.previsousSegmentsLen = 0;
            }
            this.showWildMeter(batteryId);
            this.showActiveBattery(batteryId);
        };
        wildFuryJackpotInfoPanel.JackpotPanelControl.prototype.showActiveBattery = function(batteryId) {
            var _g = 0;
            while (_g < 5) {
                var i = _g++;
                var batteryAnimation = this.getBatteryAnimation(i);
                if (batteryId != i) {
                    batteryAnimation.stop();
                    batteryAnimation.hide();
                } else if (!batteryAnimation.isPlaying()) batteryAnimation.gotoAndPlay(false, "spawn");
            }
        };
        wildFuryJackpotInfoPanel.JackpotPanelControl.prototype.getBatteryAnimation = function(batteryId) {
            var content = this.actualContainer.getContainerById("content");
            var batteryContainer = content.getContainerById("Bat_anim_" + this.type + "_" + batteryId);
            return batteryContainer.getVBAnimationById("BAT_ANIMATION_" + this.type + "_" + batteryId);
        };
        wildFuryJackpotInfoPanel.JackpotPanelControl.prototype.applyMask = function() {
            if (this.isBatteryChanged) {
                var maskedContainer = this.contentViewBuilder.getContainerById("line_wings_gold_" + this.type + "_on").getDisplayObject();
                if (this.batteryLvl >= 0) {
                    maskedContainer.setCacheAsBitmap(false);
                    var segmentIndex = this.wildsLadder.length - this.batteryLvl;
                    var wilds;
                    if (this.wildsCollected > 0) wilds = this.wildsCollected - this.wildsLadder[segmentIndex - 1];
                    else wilds = 0;
                    var wildsPerSector = this.wildsLadder[segmentIndex] - this.wildsLadder[segmentIndex - 1];
                    var lengthPerWild = this.config.lengthPerSegment[segmentIndex] / wildsPerSector;
                    var endY = _hcmn_.Math.round(this.config.startY - wilds * lengthPerWild - this.previsousSegmentsLen);
                    var paddingY;
                    if (this.wildsCollected >= this.wildsLadder[4]) paddingY = this.config.endY;
                    else paddingY = endY;
                    this.uiHelper.addRectMask(maskedContainer, this.config.width, this.config.height, this.config.paddingX, paddingY);
                    maskedContainer.setCacheAsBitmap(true);
                }
                this.isBatteryChanged = false;
            }
        };
        wildFuryJackpotInfoPanel.JackpotPanelControl.prototype.showWildMeter = function(batteryId) {
            var visible = batteryId != -1;
            var _g = 1;
            while (_g < 5) {
                var i = _g++;
                this.panelContainer.getChildByName("Wild_J_" + this.type + "_" + i).setVisible(visible);
                this.panelContainer.getChildByName("JP_WL_" + this.type + "_value" + i).setVisible(visible);
            }
            this.applyMask();
            this.panelContainer.getChildByName("line_wings_gold_" + this.type + "_on").setVisible(visible);
            this.panelContainer.getChildByName("line_wings_gold_" + this.type + "_off").setVisible(visible);
        };
        wildFuryJackpotInfoPanel.JackpotPanelControl.prototype.updateBg = function(level) {
            var bg = this.contentViewBuilder.getContainerById("bg").getDisplayObject();
            this.updateBgFor(bg, level);
            this.updateBgFor(this.artifactContainer, level);
        };
        wildFuryJackpotInfoPanel.JackpotPanelControl.prototype.updateBgFor = function(displayObject, level) {
            var _g1 = 0;
            var _g = displayObject.getNumChildren();
            while (_g1 < _g) {
                var i = _g1++;
                var child = displayObject.getChildAt(i);
                child.setVisible(child.getName() == "bg_level_" + level);
            }
        };
        wildFuryJackpotInfoPanel.JackpotPanelControl.prototype.setJackpotValues = function(levelLabel, labels) {
            var _g1 = 0;
            var _g = labels.length;
            while (_g1 < _g) {
                var i = _g1++;
                var label = "" + this.currentPrefix + "value" + i;
                var currentValue = tools.FloatUtil.correctMultiplication(parseFloat(labels[i]), _hcmn_.Std.parseInt(levelLabel) * this.betMultiplier);
                var text = wildFuryJackpotInfoPanel.ExternalService.moneyFormatter.format("" + currentValue);
                this.setLabelText(label, text);
            }
        };
        wildFuryJackpotInfoPanel.JackpotPanelControl.prototype.updateWildMeter = function() {
            var _g = 1;
            while (_g < 5) {
                var i = _g++;
                var label = "JP_WL_" + this.type + "_value" + i;
                var text = "" + this.wildsLadder[5 - i];
                this.setLabelText(label, text);
            }
        };
        wildFuryJackpotInfoPanel.JackpotPanelControl.prototype.setLabelText = function(labelId, textValue) {
            var label;
            label = this.contentViewBuilder.getLabelById(labelId);
            label.setText(textValue);
        };
        wildFuryJackpotInfoPanel.JackpotPanelControl.prototype.getType = function() {
            return this.type;
        };
        wildFuryJackpotInfoPanel.JackpotPanelControl.prototype.setVisible = function(value) {
            this.isVisible = value;
            if (this.panelContainer != null) {
                this.panelContainer.setVisible(value);
                this.artifactContainer.setVisible(value);
            }
        };
        wildFuryJackpotInfoPanel.JackpotPanelControl.prototype.__class__ = wildFuryJackpotInfoPanel.JackpotPanelControl;
        if (typeof haxe == 'undefined') {
            var haxe = {};
        };

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

            get: function(k) {
                return {
                    arguments: ["*"],
                    returns: "null"
                };
            }
        };
        wildFuryJackpotInfoPanel.ExternalService.loadedAssets = new _hcmn_.haxe_ds_StringMap();;
        wildFuryJackpotInfoPanel.ExternalService.loading = 0;;
        wildFuryJackpotInfoPanel.ExternalService.totalLoaded = 0;;
        return {
            exports: wildFuryJackpotInfoPanel,
            activator: wildFuryJackpotInfoPanel.Activator
        };
    });
//# sourceURL=wildFuryJackpotInfoPanel.js