define("Popup", ["viewBuilderApi", "componentmodelComponentApi", "translationmanagerApi", "clientkernelLoaderApi", "displayEngineApi", "displayEngineUtils", "gameLayoutApi", "PIXI", "BABYLON", "PopupApi", "clientkernelEventbusApi", "clientkernelModulesApi"],
    function(viewBuilderApi, componentmodelComponentApi, translationmanagerApi, clientkernelLoaderApi, displayEngineApi, displayEngineUtils, gameLayoutApi, PIXI, BABYLON, PopupApi, clientkernelEventbusApi, clientkernelModulesApi) {
        "use strict";

        function $iterator(o) {
            if (o instanceof Array) return function() {
                return {
                    cur: 0,
                    arr: o,
                    hasNext: function() {
                        return this.cur < this.arr.length;
                    },
                    next: function() {
                        return this.arr[this.cur++];
                    }
                };
            };
            return typeof(o.iterator) == 'function' ? $bind(o, o.iterator) : o.iterator;
        };;
        var $fid = 0;

        function $bind(o, m) {
            if (m == null) return null;
            if (m.__id__ == null) m.__id__ = $fid++;
            var f;
            if (o.hx__closures__ == null) o.hx__closures__ = {};
            else f = o.hx__closures__[m.__id__];
            if (f == null) {
                f = function() {
                    return f.method.apply(f.scope, arguments);
                };
                f.scope = o;
                f.method = m;
                o.hx__closures__[m.__id__] = f;
            }
            return f;
        };
        var $_;
        var $estr = function() {
            return _hcmn_.js_Boot.__string_rec(this, '');
        };
        if (typeof Popup == 'undefined') {
            var Popup = {};
        };
        Popup.Activator = function(context) {};
        Popup.Activator = ck_implements(Popup.Activator, clientkernelModulesApi.IModuleActivator);
        Popup.Activator.__interfaces__ = [clientkernelModulesApi.IModuleActivator];
        Popup.Activator.__name__ = ["Popup", "Activator"];
        Popup.Activator.prototype.start = function(context) {
            context.getServiceTracker([viewBuilderApi.IViewBuilderFactory, clientkernelLoaderApi.IAssetRegistry, displayEngineApi.IDisplayProvider, translationmanagerApi.ITranslationManager]).then(function(context1) {
                Popup.ExternalService.initialize(context1);
                context1.registerService(new Popup.PopupFactory(context1), PopupApi.PopupDeclaration, null);
            });
        };
        Popup.Activator.prototype.stop = function(context) {};
        Popup.Activator.main = function() {};
        Popup.Activator.prototype.__class__ = Popup.Activator;
        Popup.ExternalService = function() {};
        Popup.ExternalService.__name__ = ["Popup", "ExternalService"];
        Popup.ExternalService.bus = null;
        Popup.ExternalService.busChannel = null;
        Popup.ExternalService.assetRegistry = null;
        Popup.ExternalService.displayProvider = null;
        Popup.ExternalService.viewBuilderFactory = null;
        Popup.ExternalService.translationManager = null;
        Popup.ExternalService.context = null;
        Popup.ExternalService.variableRegistry = null;
        Popup.ExternalService.initialize = function(cntxt) {
            Popup.ExternalService.context = cntxt;
            Popup.ExternalService.assetRegistry = Popup.ExternalService.context.getAnyService(clientkernelLoaderApi.IAssetRegistry, null);
            Popup.ExternalService.displayProvider = Popup.ExternalService.context.getAnyService(displayEngineApi.IDisplayProvider, null);
            Popup.ExternalService.viewBuilderFactory = Popup.ExternalService.context.getAnyService(viewBuilderApi.IViewBuilderFactory, null);
            Popup.ExternalService.translationManager = Popup.ExternalService.context.getAnyService(translationmanagerApi.ITranslationManager, null);
            Popup.ExternalService.variableRegistry = Popup.ExternalService.context.getAnyService(clientkernelLoaderApi.IVariableRegistry, null);
            Popup.ExternalService.bus = Popup.ExternalService.context.getAnyService(clientkernelEventbusApi.IEventBus, null);
            Popup.ExternalService.busChannel = Popup.ExternalService.bus.getChannel("GFBus");
        };
        Popup.ExternalService.getAsset = function(id) {
            return Popup.ExternalService.assetRegistry.getAsset(id).getContent();
        };
        Popup.ExternalService.loadAsset = function(id, index, loadCallback) {
            Popup.ExternalService.assetRegistry.getAsset(id).getContent().then(function(data) {
                loadCallback(data);
            });
        };
        Popup.ExternalService.getStageFromComponentLayout = function(container, componentLayout) {
            var stage = componentLayout.containers.get(container).stage;
            var this1 = Popup.ExternalService.displayProvider.getStages();
            return this1.get(stage);
        };
        Popup.ExternalService.getStage = function(stageName) {
            var this1 = Popup.ExternalService.displayProvider.getStages();
            return this1.get(stageName);
        };
        Popup.ExternalService.getTextById = function(textId, fillIn) {
            return Popup.ExternalService.translationManager.stringLookup(textId, fillIn);
        };
        Popup.ExternalService.isMobile = function() {
            return Popup.ExternalService.variableRegistry.get("skin") == "mobile" || Popup.ExternalService.variableRegistry.get("assetPack") == "mobile";
        };
        Popup.ExternalService.prototype.__class__ = Popup.ExternalService;
        Popup.Popup = function(context, cfgId) {
            this.context = context;
            this.layoutPort = context.getUsedPort(gameLayoutApi.IGameLayoutPort);
            this.layoutPort.getUpdateComponentLayout().subscribe($bind(this, this.onLayoutUpdate));
            this.popupImplPort = context.getImplementedPort(PopupApi.IPopupImplementationPort);
            this.popupImplPort.getShowMaxAwardCap().subscribe($bind(this, this.onShowMaxAwardCap));
            this.popupImplPort.getShowBonusAwardCap().subscribe($bind(this, this.onShowBonusAwardCap));
            this.popupImplPort.getShowMaxFreeSpinOrJackpot().subscribe($bind(this, this.showMaxFreeSpinOrJackpot));
            this.popupImplPort.getShowJackpotLevelUp().subscribe($bind(this, this.onShowJackpotLevelUp));
            this.popupImplPort.getShowBonusOutro().subscribe($bind(this, this.onShowBonusOutro));
            this.popupImplPort.getHide().subscribe($bind(this, this.onHidePopup));
            this.builder = new Popup.PopupBuilder();
        };
        Popup.Popup.__name__ = ["Popup", "Popup"];
        Popup.Popup.prototype.context = null;
        Popup.Popup.prototype.layoutPayload = null;
        Popup.Popup.prototype.layoutPort = null;
        Popup.Popup.prototype.popupImplPort = null;
        Popup.Popup.prototype.builder = null;
        Popup.Popup.prototype.publishPopupFinished = null;
        Popup.Popup.prototype.onHidePopup = function(e) {
            this.hide();
        };
        Popup.Popup.prototype.hide = function() {
            if (Popup.Popup.popupScreen != null) Popup.Popup.popupScreen.hide();
        };
        Popup.Popup.prototype.getPopupShower = function(initData) {
            var _g = this;
            return function(popup) {
                _g.showPopup(popup, initData);
            };
        };
        Popup.Popup.prototype.showPopup = function(popup, initData) {
            this.hide();
            Popup.Popup.popupScreen = popup;
            Popup.Popup.popupScreen.getEvent().add($bind(this, this.onPopupAnimated));
            this.show(initData);
        };
        Popup.Popup.prototype.show = function(initData) {
            if (Popup.Popup.popupScreen == null) return;
            this.setStageVisible(true);
            Popup.Popup.popupScreen.init(initData);
            Popup.Popup.popupScreen.show();
            Popup.Popup.popupScreen.updateLayout(this.layoutPayload);
        };
        Popup.Popup.prototype.onPopupAnimated = function(data) {
            this.popupImplPort.getPopupShown().publish(data);
            this.hide();
        };
        Popup.Popup.prototype.showMaxFreeSpinOrJackpot = function(e) {
            var popupShower = this.getPopupShower(e.getPayload());
            this.builder.createAnimationPopup(Popup.Popup.POPUP_ID, Popup.Popup.POPUP_ANIM_ID, Popup.MaxFreeSpinOrJackpot, "MAX_FREESPIN_JACKPOT", popupShower);
        };
        Popup.Popup.prototype.onShowMaxAwardCap = function(e) {
            var popupShower = this.getPopupShower(e.getPayload());
            this.builder.createAnimationPopup(Popup.Popup.POPUP_ID, Popup.Popup.POPUP_ANIM_ID, Popup.MaxAwardCap, "MAX_AWARD_CAP", popupShower);
        };
        Popup.Popup.prototype.onShowBonusAwardCap = function(e) {
            var popupShower = this.getPopupShower(e.getPayload());
            this.builder.createAnimationPopup(Popup.Popup.POPUP_ID, Popup.Popup.POPUP_ANIM_ID, Popup.BonusAwardCap, "BONUS_AWARD_CAP", popupShower);
        };
        Popup.Popup.prototype.onShowJackpotLevelUp = function(e) {
            var popupShower = this.getPopupShower(e.getPayload());
            this.builder.createAnimationPopup(Popup.Popup.POPUP_ID, Popup.Popup.POPUP_ANIM_ID, Popup.JackpotLevelUp, "JACKPOT_LEVEL_UP", popupShower);
        };
        Popup.Popup.prototype.onShowBonusOutro = function(e) {
            var popupShower = this.getPopupShower(e.getPayload());
            this.builder.createAnimationPopup(Popup.Popup.POPUP_ID, Popup.Popup.OUTRO_POPUP_ANIMATION_ID, Popup.BonusOutro, "BONUS_OUTRO", popupShower);
        };
        Popup.Popup.prototype.onLayoutUpdate = function(e) {
            if (this.layoutPayload == null) this.layoutPayload = e.getPayload();
            this.layoutPayload = e.getPayload();
            this.builder.setLayout(this.layoutPayload);
            if (Popup.Popup.popupScreen != null) Popup.Popup.popupScreen.updateLayout(this.layoutPayload);
            this.layoutPort.getComponentLayoutUpdated().publish(this.context.getInstance());
        };
        Popup.Popup.prototype.setStageVisible = function(visible) {
            var stage = Popup.ExternalService.getStageFromComponentLayout(Popup.Popup.POPUP_ID, this.layoutPayload);
            stage.setVisible(visible);
        };
        Popup.Popup.prototype.cacheInitialPopups = function() {
            var _g = this;
            var getPopupShower = function(initData, showEnd) {
                return function(popup) {
                    _g.showPopup(popup, initData);
                    Popup.Popup.popupScreen.getEvent().removeAll();
                    _g.hide();
                    if (showEnd != null) showEnd();
                };
            };
            this.builder.createAnimationPopup(Popup.Popup.POPUP_ID, Popup.Popup.OUTRO_POPUP_ANIMATION_ID, Popup.BonusOutro, "BONUS_OUTRO", getPopupShower("0", function() {
                _g.builder.createAnimationPopup(Popup.Popup.POPUP_ID, Popup.Popup.POPUP_ANIM_ID, Popup.BonusAwardCap, "BONUS_AWARD_CAP", getPopupShower(["1", "2", "3"]));
            }));
        };
        Popup.Popup.popupScreen = null;
        Popup.Popup.prototype.__class__ = Popup.Popup;
        Popup.PopupFactory = function(context) {
            this.context = context;
        };
        Popup.PopupFactory = ck_implements(Popup.PopupFactory, clientkernelModulesApi.IService);
        Popup.PopupFactory = ck_implements(Popup.PopupFactory, componentmodelComponentApi.IComponentFactory);
        Popup.PopupFactory.__interfaces__ = [clientkernelModulesApi.IService, componentmodelComponentApi.IComponentFactory];
        Popup.PopupFactory.__name__ = ["Popup", "PopupFactory"];
        Popup.PopupFactory.prototype.context = null;
        Popup.PopupFactory.prototype.getComponentDeclaration = function() {
            return PopupApi.PopupDeclaration;
        };
        Popup.PopupFactory.prototype.createComponent = function(context) {
            var cfgId = context.getConfiguration();
            new Popup.Popup(context, cfgId);
        };
        Popup.PopupFactory.prototype.__class__ = Popup.PopupFactory;
        Popup.PopupBase = function(id, view, stage, layerId) {
            this.labels = [];
            this.animationCache = new _hcmn_.haxe_ds_StringMap();
            var _g = this;
            this.stage = stage;
            this.id = id;
            this.layerId = layerId;
            this.view = view.getComponentById(id);
            this.viewContent = this.view.getContainerById("Content").getContainerById(layerId);
            this.initEvent();
            this.showDuration = 0;
            Popup.ExternalService.assetRegistry.getAsset("game-config_json").getContent().then(function(data) {
                _g.config = data.popup;
            });
        };
        Popup.PopupBase.__name__ = ["Popup", "PopupBase"];
        Popup.PopupBase.prototype.animation = null;
        Popup.PopupBase.prototype.animationCache = null;
        Popup.PopupBase.prototype.viewContent = null;
        Popup.PopupBase.prototype.stage = null;
        Popup.PopupBase.prototype.animAssets = null;
        Popup.PopupBase.prototype.event = null;
        Popup.PopupBase.prototype.labelsContainer = null;
        Popup.PopupBase.prototype.id = null;
        Popup.PopupBase.prototype.layerId = null;
        Popup.PopupBase.prototype.config = null;
        Popup.PopupBase.prototype.showDuration = null;
        Popup.PopupBase.prototype.view = null;
        Popup.PopupBase.prototype.labels = null;
        Popup.PopupBase.prototype.init = function(data) {};
        Popup.PopupBase.prototype.isContentInit = function() {
            return this.animAssets != null;
        };
        Popup.PopupBase.prototype.setAnimAssets = function(animAssets) {
            if (!this.isContentInit()) {
                this.animAssets = animAssets;
                this.initContent();
            }
        };
        Popup.PopupBase.prototype.initContent = function() {
            this.animation = this.getAnimation("POPUP_ANIMATION_HOLDER", "POPUP_ANIMATION_CONTENT");
            this.animation.addEventListener("POPUP::ANIMATION_COMPLETE", $bind(this, this.onBackgroundShown));
            this.addAnimationToPlaceholder("ANIMATION_PLACE", "POPUP_BACKGROUND_ANIMATION");
            this.initLabels();
            this.play();
        };
        Popup.PopupBase.prototype.addAnimationToPlaceholder = function(placeholderID, animationID) {
            var placeHolder = this.viewContent.getContainerById(placeholderID);
            if (placeHolder.getComponentById(animationID) == null) placeHolder.addChildComponent(this.animation, animationID);
        };
        Popup.PopupBase.prototype.initLabels = function() {
            this.labelsContainer = this.viewContent.getContainerById("LABELS_CONTAINER");
            this.labelsContainer.getDisplayObject().setAlpha(0);
        };
        Popup.PopupBase.prototype.onBackgroundShown = function() {};
        Popup.PopupBase.prototype.showText = function() {
            displayEngineUtils.TweenX.to(this.labelsContainer.getDisplayObject(), {
                alpha: 1
            }, this.config.showTextDuration, null, null, null, null, null, null, null, {
                fileName: "PopupBase.hx",
                lineNumber: 83,
                className: "components.popup.screen.PopupBase",
                methodName: "showText"
            });
        };
        Popup.PopupBase.prototype.getAnimation = function(holderID, animationID) {
            var cacheKey = holderID + animationID;
            if (this.animationCache.exists(cacheKey)) return this.animationCache.get(cacheKey);
            var animView = Popup.ExternalService.viewBuilderFactory.createView(this.animAssets);
            var animHolder = animView.createContainerFromStoredConfig(holderID);
            var result = animHolder.getVBAnimationById(animationID);
            this.animationCache.set(cacheKey, result);
            return result;
        };
        Popup.PopupBase.prototype.show = function() {
            this.stage.addChild(this.viewContent.getDisplayObject());
            this.initLabels();
            this.viewContent.show();
            this.play();
        };
        Popup.PopupBase.prototype.play = function() {
            this.animation.gotoAndPlay(false, "start");
            window.setTimeout($bind(this, this.showText), this.config.popupAnimationDuration);
        };
        Popup.PopupBase.prototype.stop = function() {
            this.animation.gotoAndStop(false, "start");
        };
        Popup.PopupBase.prototype.hide = function() {
            this.stage.removeChild(this.viewContent.getDisplayObject());
        };
        Popup.PopupBase.prototype.updateLayout = function(componentLayout) {
            var layout = componentLayout.containers.get(this.id);
            var container = this.viewContent.getDisplayObject();
            var userData = container.getUserData();
            container.setX(layout.left);
            container.setY(layout.top);
            container.setScaleX(layout.width / userData.viewBuilderW);
            container.setScaleY(layout.height / userData.viewBuilderH);
            try {
                container.setZIndex(layout.zIndex);
            } catch (e) {
                if (e instanceof js._Boot.HaxeError) e = e.val;
            }
        };
        Popup.PopupBase.prototype.setLabelTextTranslated = function(labelId) {
            var textValue = Popup.ExternalService.translationManager.stringLookup(labelId);
            this.setLabelText(labelId, textValue);
        };
        Popup.PopupBase.prototype.translateLabels = function() {
            this.doForAllLabels($bind(this, this.setLabelTextTranslated));
        };
        Popup.PopupBase.prototype.setLabelText = function(labelId, textValue) {
            var label = this.viewContent.getLabelById(labelId);
            label.setText(textValue);
        };
        Popup.PopupBase.prototype.hideLabel = function(labelId) {
            var label = this.viewContent.getComponentById(labelId);
            label.hide();
        };
        Popup.PopupBase.prototype.showLabel = function(labelId) {
            var label = this.viewContent.getComponentById(labelId);
            label.show();
        };
        Popup.PopupBase.prototype.hideAllLabels = function() {
            this.doForAllLabels($bind(this, this.hideLabel));
        };
        Popup.PopupBase.prototype.showAllLabels = function() {
            this.doForAllLabels($bind(this, this.showLabel));
        };
        Popup.PopupBase.prototype.doForAllLabels = function(actionOnLabel) {
            var _g = 0;
            var _g1 = this.labels;
            while (_g < _g1.length) {
                var lab = _g1[_g];
                ++_g;
                actionOnLabel(lab);
            }
        };
        Popup.PopupBase.prototype.initEvent = function() {
            this.event = new _hcmn_.msignal_Signal1();
        };
        Popup.PopupBase.prototype.getEvent = function() {
            return this.event;
        };
        Popup.PopupBase.prototype.__class__ = Popup.PopupBase;
        Popup.BonusAwardCap = function(id, view, stage, layerId) {
            Popup.PopupBase.call(this, id, view, stage, layerId);
        };
        Popup.BonusAwardCap.__name__ = ["Popup", "BonusAwardCap"];
        Popup.BonusAwardCap.__super__ = Popup.PopupBase;
        for (var k in Popup.PopupBase.prototype) Popup.BonusAwardCap.prototype[k] = Popup.PopupBase.prototype[k];
        Popup.BonusAwardCap.prototype.initLabels = function() {
            this.setLabelTextById("congratulationLabelShadow", "congratulationLabelShadow", "Congratulations");
            this.setLabelTextById("congratulationLabel", "congratulationLabel", "Congratulations");
            this.setLabelTextById("freegamesWinLabel", "freegamesWinLabel", "freeSpinsColon");
            this.setLabelTextById("freegamesWinLabel", "freegamesWinLabel_shadow", "freeSpinsColon");
            this.setLabelTextById("jacpotWinLabel", "jacpotWinLabel", "jackpot");
            this.setLabelTextById("jacpotWinLabel", "jacpotWinLabel_shadow", "jackpot");
            this.setLabelTextById("totalWinLabel", "totalWinLabel", "totalWin");
            this.setLabelTextById("totalWinLabel", "totalWinLabel_shadow", "totalWin");
        };
        Popup.BonusAwardCap.prototype.setLabelTextById = function(containerId, labelId, textId) {
            var label = this.animation.getContainerById(containerId).getLabelById(labelId);
            var text = this.getTextById(textId);
            label.setText(text);
        };
        Popup.BonusAwardCap.prototype.getTextById = function(textId) {
            return Popup.ExternalService.translationManager.stringLookup(textId);
        };
        Popup.BonusAwardCap.prototype.initContent = function() {
            this.animation = this.getAnimation("BONUS_AWARD_ANIMATION_HOLDER", "POPUP_ANIMATION_CONTENT");
            this.animation.addEventListener("POPUP::ANIMATION_COMPLETE", $bind(this, this.onBackgroundShown));
            this.addAnimationToPlaceholder("ANIMATION_PLACE", "POPUP_BACKGROUND_ANIMATION");
            this.initLabels();
            this.play();
        };
        Popup.BonusAwardCap.prototype.play = function() {
            this.animation.gotoAndPlay(false, "start");
        };
        Popup.BonusAwardCap.prototype.onBackgroundShown = function() {
            this.animation.stop();
        };
        Popup.BonusAwardCap.prototype.init = function(data) {
            this.setLabelTextById("freegamesWinValue", "winValueLabel", data[1]);
            this.setLabelTextById("freegamesWinValue", "winValueLabel_shadow", data[1]);
            this.setLabelTextById("jacpotWinValue", "winValueLabel", data[0]);
            this.setLabelTextById("jacpotWinValue", "winValueLabel_shadow", data[0]);
            this.setLabelTextById("bonusTotalWinValue", "winValueLabel", data[2]);
            this.setLabelTextById("bonusTotalWinValue", "winValueLabel_shadow", data[2]);
        };
        Popup.BonusAwardCap.prototype.__class__ = Popup.BonusAwardCap;
        Popup.BonusOutro = function(id, view, stage, layerId) {
            this.isReadyToShow = false;
            this.isInitialized = false;
            this.isShown = false;
            Popup.PopupBase.call(this, id, view, stage, layerId);
        };
        Popup.BonusOutro.__name__ = ["Popup", "BonusOutro"];
        Popup.BonusOutro.__super__ = Popup.PopupBase;
        for (var k in Popup.PopupBase.prototype) Popup.BonusOutro.prototype[k] = Popup.PopupBase.prototype[k];
        Popup.BonusOutro.prototype.fsValue = null;
        Popup.BonusOutro.prototype.orientation = null;
        Popup.BonusOutro.prototype.showingDurationInterval = null;
        Popup.BonusOutro.prototype.isShown = null;
        Popup.BonusOutro.prototype.isInitialized = null;
        Popup.BonusOutro.prototype.isReadyToShow = null;
        Popup.BonusOutro.prototype.currentAnimation = null;
        Popup.BonusOutro.prototype.init = function(data) {
            Popup.PopupBase.prototype.init.call(this, data);
            this.showDuration = this.config.fsOutroDuration;
            this.fsValue = data;
        };
        Popup.BonusOutro.prototype.clearAnimation = function() {
            if (this.animation != null) {
                this.animation.removeEventListener("POPUP::ANIMATION_COMPLETE");
                this.animation.stop();
                this.animation.hide();
            }
        };
        Popup.BonusOutro.prototype.showContent = function() {
            this.clearAnimation();
            this.animation = this.animationCache.get("POPUP_BACKGROUND_ANIMATION" + this.orientation);
            this.animation.addEventListener("POPUP::ANIMATION_COMPLETE", $bind(this, this.onBackgroundShown));
            this.initFSValue("fs_value");
            this.initFSValue("fs_value_shadow");
            this.play();
        };
        Popup.BonusOutro.prototype.initContent = function() {
            var _g = 0;
            while (_g < 2) {
                var i = _g++;
                var anim = this.getAnimation("PICKER_SUMMARY_HOLDER_" + i, "PICKER_SUMMARY_ANIMATION_CONTENT");
                var cacheKey = "POPUP_BACKGROUND_ANIMATION" + i;
                this.addToPlaceholder("ANIMATION_PLACE", cacheKey, anim);
                this.animationCache.set(cacheKey, anim);
                anim.stop();
                anim.hide();
            }
        };
        Popup.BonusOutro.prototype.getAnimation = function(holderID, animationID) {
            var animView = Popup.ExternalService.viewBuilderFactory.createView(this.animAssets);
            var animHolder = animView.createContainerFromStoredConfig(holderID);
            var result = animHolder.getVBAnimationById(animationID);
            return result;
        };
        Popup.BonusOutro.prototype.onBackgroundShown = function() {
            this.animation.stop();
            if (!this.isShown) {
                this.showingDurationInterval = window.setTimeout($bind(this, this.onShowingCompleted), this.showDuration);
                this.isShown = true;
            }
        };
        Popup.BonusOutro.prototype.addToPlaceholder = function(placeholderID, animationID, anim) {
            var placeHolder = this.viewContent.getContainerById(placeholderID);
            placeHolder.addChildComponent(anim, animationID);
        };
        Popup.BonusOutro.prototype.show = function() {
            this.stage.addChild(this.viewContent.getDisplayObject());
            this.viewContent.show();
            this.isReadyToShow = true;
        };
        Popup.BonusOutro.prototype.onShowingCompleted = function() {
            this.event.dispatch(this.layerId);
        };
        Popup.BonusOutro.prototype.play = function() {
            this.animation.show();
            this.animation.gotoAndPlay(false, "start");
        };
        Popup.BonusOutro.prototype.initFSValue = function(labelId) {
            var fsLabelContainer = this.animation.getContainerById("fs_value");
            var label = fsLabelContainer.getLabelById(labelId + "_label");
            label.setText(this.fsValue);
        };
        Popup.BonusOutro.prototype.setAnimAssets = function(animAssets) {
            if (this.animAssets == null) {
                this.animAssets = animAssets;
                this.initContent();
            }
        };
        Popup.BonusOutro.prototype.updateLayout = function(componentLayout) {
            Popup.PopupBase.prototype.updateLayout.call(this, componentLayout);
            var layout = componentLayout.containers.get(this.id);
            this.orientation = layout.configuration.orientation;
            if (this.isReadyToShow) this.showContent();
        };
        Popup.BonusOutro.prototype.hide = function() {
            Popup.PopupBase.prototype.hide.call(this);
            this.clearAnimation();
            this.isShown = false;
            this.isReadyToShow = false;
        };
        Popup.BonusOutro.prototype.__class__ = Popup.BonusOutro;
        Popup.JackpotLevelUp = function(id, view, stage, layerId) {
            Popup.PopupBase.call(this, id, view, stage, layerId);
        };
        Popup.JackpotLevelUp.__name__ = ["Popup", "JackpotLevelUp"];
        Popup.JackpotLevelUp.__super__ = Popup.PopupBase;
        for (var k in Popup.PopupBase.prototype) Popup.JackpotLevelUp.prototype[k] = Popup.PopupBase.prototype[k];
        Popup.JackpotLevelUp.prototype.valueLabel = null;
        Popup.JackpotLevelUp.prototype.jackpotLabel = null;
        Popup.JackpotLevelUp.prototype.increasingLabel = null;
        Popup.JackpotLevelUp.prototype.initLabels = function() {
            this.labelsContainer = this.viewContent.getContainerById("LABELS_CONTAINER");
            this.valueLabel = this.labelsContainer.getContainerById("valueLabel");
            this.jackpotLabel = this.labelsContainer.getContainerById("jackpotLabel");
            this.increasingLabel = this.labelsContainer.getContainerById("increasingLabel");
            this.setDefaultlabelsState();
        };
        Popup.JackpotLevelUp.prototype.initContent = function() {
            this.animation = this.getAnimation("ANIMATION_HOLDER", "ANIMATION_CONTENT");
            this.playBackground();
        };
        Popup.JackpotLevelUp.prototype.playBackground = function() {
            this.animation.addEventListener("POPUP::ANIMATION_COMPLETE", $bind(this, this.onBackgroundShown));
            this.addAnimationToPlaceholder("ANIMATION_PLACE", "POPUP_BACKGROUND_ANIMATION");
            this.initLabels();
            this.play();
            this.showDuration = this.config.tweenDuration;
        };
        Popup.JackpotLevelUp.prototype.show = function() {
            this.playBackground();
            this.stage.addChild(this.viewContent.getDisplayObject());
            this.viewContent.show();
            displayEngineUtils.TweenX.serial([displayEngineUtils.TweenX.to(this.increasingLabel.getDisplayObject(), {
                alpha: 1
            }, 1, null, null, null, null, null, null, null, {
                fileName: "JackpotLevelUp.hx",
                lineNumber: 41,
                className: "components.popup.screen.JackpotLevelUp",
                methodName: "show"
            }), displayEngineUtils.TweenX.to(this.increasingLabel.getDisplayObject(), {
                scaleX: 1.5,
                scaleY: 1.5
            }, 200, null, null, null, null, null, null, null, {
                fileName: "JackpotLevelUp.hx",
                lineNumber: 42,
                className: "components.popup.screen.JackpotLevelUp",
                methodName: "show"
            }), displayEngineUtils.TweenX.to(this.increasingLabel.getDisplayObject(), {
                scaleX: 1,
                scaleY: 1
            }, 50, null, null, null, null, null, null, null, {
                fileName: "JackpotLevelUp.hx",
                lineNumber: 43,
                className: "components.popup.screen.JackpotLevelUp",
                methodName: "show"
            }), displayEngineUtils.TweenX.wait(0.2, {
                fileName: "JackpotLevelUp.hx",
                lineNumber: 44,
                className: "components.popup.screen.JackpotLevelUp",
                methodName: "show"
            }), displayEngineUtils.TweenX.to(this.jackpotLabel.getDisplayObject(), {
                alpha: 1
            }, 1, null, null, null, null, null, null, null, {
                fileName: "JackpotLevelUp.hx",
                lineNumber: 45,
                className: "components.popup.screen.JackpotLevelUp",
                methodName: "show"
            }), displayEngineUtils.TweenX.to(this.jackpotLabel.getDisplayObject(), {
                scaleX: 2,
                scaleY: 2
            }, 200, null, null, null, null, null, null, null, {
                fileName: "JackpotLevelUp.hx",
                lineNumber: 46,
                className: "components.popup.screen.JackpotLevelUp",
                methodName: "show"
            }).ease(displayEngineUtils.EaseX.bounceInOut), displayEngineUtils.TweenX.wait(0.2, {
                fileName: "JackpotLevelUp.hx",
                lineNumber: 47,
                className: "components.popup.screen.JackpotLevelUp",
                methodName: "show"
            }), displayEngineUtils.TweenX.to(this.jackpotLabel.getDisplayObject(), {
                scaleX: 1,
                scaleY: 1
            }, 50, null, null, null, null, null, null, null, {
                fileName: "JackpotLevelUp.hx",
                lineNumber: 48,
                className: "components.popup.screen.JackpotLevelUp",
                methodName: "show"
            }), displayEngineUtils.TweenX.wait(0.2, {
                fileName: "JackpotLevelUp.hx",
                lineNumber: 49,
                className: "components.popup.screen.JackpotLevelUp",
                methodName: "show"
            }), displayEngineUtils.TweenX.to(this.valueLabel.getDisplayObject(), {
                alpha: 1
            }, 200, null, null, null, null, null, null, null, {
                fileName: "JackpotLevelUp.hx",
                lineNumber: 50,
                className: "components.popup.screen.JackpotLevelUp",
                methodName: "show"
            }), displayEngineUtils.TweenX.to(this.valueLabel.getDisplayObject(), {
                scaleX: 1.2,
                scaleY: 1.2
            }, 200, null, null, null, null, null, null, null, {
                fileName: "JackpotLevelUp.hx",
                lineNumber: 51,
                className: "components.popup.screen.JackpotLevelUp",
                methodName: "show"
            }), displayEngineUtils.TweenX.to(this.valueLabel.getDisplayObject(), {
                scaleX: 1,
                scaleY: 1
            }, 50, null, null, null, null, null, null, null, {
                fileName: "JackpotLevelUp.hx",
                lineNumber: 52,
                className: "components.popup.screen.JackpotLevelUp",
                methodName: "show"
            }), displayEngineUtils.TweenX.wait(0.2, {
                fileName: "JackpotLevelUp.hx",
                lineNumber: 53,
                className: "components.popup.screen.JackpotLevelUp",
                methodName: "show"
            })], null, {
                fileName: "JackpotLevelUp.hx",
                lineNumber: 40,
                className: "components.popup.screen.JackpotLevelUp",
                methodName: "show"
            }).onFinish($bind(this, this.onTweenComplete));
        };
        Popup.JackpotLevelUp.prototype.onTweenComplete = function() {
            window.setTimeout($bind(this, this.onShowingCompleted), this.showDuration);
        };
        Popup.JackpotLevelUp.prototype.onShowingCompleted = function() {
            this.event.dispatch(this.layerId);
        };
        Popup.JackpotLevelUp.prototype.hide = function() {
            Popup.PopupBase.prototype.hide.call(this);
            this.animation.stop();
            this.animation.hide();
            this.setDefaultlabelsState();
        };
        Popup.JackpotLevelUp.prototype.setDefaultlabelsState = function() {
            this.valueLabel.getDisplayObject().setAlpha(0);
            this.jackpotLabel.getDisplayObject().setAlpha(0);
            this.increasingLabel.getDisplayObject().setAlpha(0);
            this.valueLabel.getDisplayObject().setScale(0.5);
            this.jackpotLabel.getDisplayObject().setScale(0.5);
            this.increasingLabel.getDisplayObject().setScale(0.5);
        };
        Popup.JackpotLevelUp.prototype.__class__ = Popup.JackpotLevelUp;
        Popup.MaxAwardCap = function(id, view, stage, layerId) {
            this.bonusSpinNumber = null;
            Popup.PopupBase.call(this, id, view, stage, layerId);
        };
        Popup.MaxAwardCap.__name__ = ["Popup", "MaxAwardCap"];
        Popup.MaxAwardCap.__super__ = Popup.PopupBase;
        for (var k in Popup.PopupBase.prototype) Popup.MaxAwardCap.prototype[k] = Popup.PopupBase.prototype[k];
        Popup.MaxAwardCap.prototype.awardValue = null;
        Popup.MaxAwardCap.prototype.bonusSpinNumber = null;
        Popup.MaxAwardCap.prototype.onBackgroundShown = function() {
            this.animation.stop();
            this.labelsContainer.getDisplayObject().setAlpha(1);
        };
        Popup.MaxAwardCap.prototype.init = function(data) {
            var stringData = data;
            var amountData = stringData.split("+");
            this.awardValue = amountData[0];
            if (amountData[1] != null) this.bonusSpinNumber = amountData[1];
        };
        Popup.MaxAwardCap.prototype.show = function() {
            var awardValueLabel = this.labelsContainer.getLabelById("AwardWinValueLabel");
            var totalWinLabel = this.labelsContainer.getLabelById("Outro_YouWon");
            var maxAwardCongratulationsLabel = this.labelsContainer.getLabelById("Outro_Congrats");
            var endFSLabel = this.labelsContainer.getLabelById("FS_end");
            maxAwardCongratulationsLabel.setText(Popup.ExternalService.translationManager.stringLookup("AwardCap_Congrats"));
            totalWinLabel.setText(Popup.ExternalService.translationManager.stringLookup("AwardCapText"));
            if (this.bonusSpinNumber == null) endFSLabel.setText("");
            else endFSLabel.setText(Popup.ExternalService.translationManager.stringLookup("AwardCapFreeSpins"));
            awardValueLabel.setText(this.awardValue);
            Popup.PopupBase.prototype.show.call(this);
        };
        Popup.MaxAwardCap.prototype.__class__ = Popup.MaxAwardCap;
        Popup.MaxFreeSpinOrJackpot = function(id, view, stage, layerId) {
            Popup.PopupBase.call(this, id, view, stage, layerId);
        };
        Popup.MaxFreeSpinOrJackpot.__name__ = ["Popup", "MaxFreeSpinOrJackpot"];
        Popup.MaxFreeSpinOrJackpot.__super__ = Popup.PopupBase;
        for (var k in Popup.PopupBase.prototype) Popup.MaxFreeSpinOrJackpot.prototype[k] = Popup.PopupBase.prototype[k];
        Popup.MaxFreeSpinOrJackpot.prototype.initLabels = function() {
            this.labelsContainer = this.viewContent.getContainerById("LABELS_CONTAINER");
        };
        Popup.MaxFreeSpinOrJackpot.prototype.init = function(data) {
            this.initLabels();
            var max = this.getTextById(data);
            this.setLabelTextById("middleLabel", "middleLabel_shadow", "MaxValue", [max]);
        };
        Popup.MaxFreeSpinOrJackpot.prototype.show = function() {
            this.stage.addChild(this.viewContent.getDisplayObject());
            this.viewContent.show();
        };
        Popup.MaxFreeSpinOrJackpot.prototype.setLabelTextById = function(labelId, labelShadowId, textId, fillIn) {
            var label = this.labelsContainer.getLabelById(labelId);
            var labelShadow = this.labelsContainer.getLabelById(labelShadowId);
            var text = this.getTextById(textId, fillIn);
            var labelText;
            if (text == null) labelText = textId;
            else labelText = this.getTextById(textId, fillIn);
            label.setText(text);
            labelShadow.setText(text);
        };
        Popup.MaxFreeSpinOrJackpot.prototype.getTextById = function(textId, fillIn) {
            return Popup.ExternalService.translationManager.stringLookup(textId, fillIn);
        };
        Popup.MaxFreeSpinOrJackpot.prototype.__class__ = Popup.MaxFreeSpinOrJackpot;
        Popup.PopupBuilder = function() {};
        Popup.PopupBuilder.__name__ = ["Popup", "PopupBuilder"];
        Popup.PopupBuilder.prototype.layoutPayload = null;
        Popup.PopupBuilder.prototype.createAnimationPopup = function(id, animId, popupClass, layerId, callbackFunction) {
            var _g = this;
            this.getPromiserForCreatingPopup(id, popupClass, layerId).then(function(popup) {
                if (popup.isContentInit()) callbackFunction(popup);
                else _g.getAssetsPromiser(animId).then(function(vbAssets) {
                    popup.setAnimAssets(vbAssets);
                    callbackFunction(popup);
                });
            });
        };
        Popup.PopupBuilder.prototype.getPromiserForCreatingPopup = function(id, popupClass, layerId) {
            if (Popup.PopupBuilder.containers.exists(id)) return this.getExistingPopupPromiser(id, popupClass, layerId);
            return this.getNewPopupPromiser(id, popupClass, layerId);
        };
        Popup.PopupBuilder.prototype.getExistingPopupPromiser = function(id, popupClass, layerId) {
            var _g = this;
            var popupId = id + _hcmn_.Type.getClassName(popupClass);
            var promiseInitFunction = function(resolve, reject) {
                if (!Popup.PopupBuilder.popups.exists(popupId)) {
                    var popup = _hcmn_.Type.createInstance(popupClass, [id, Popup.PopupBuilder.containers.get(id), _g.getStage(id), layerId]);
                    Popup.PopupBuilder.popups.set(popupId, popup);
                }
                resolve(Popup.PopupBuilder.popups.get(popupId));
            };
            return new Promise(promiseInitFunction);
        };
        Popup.PopupBuilder.prototype.getNewPopupPromiser = function(id, popupClass, layerId) {
            var _g = this;
            var popupId = id + _hcmn_.Type.getClassName(popupClass);
            return new Promise(function(resolve, reject) {
                _g.createView(id).then(function(view) {
                    var popup = _hcmn_.Type.createInstance(popupClass, [id, view, _g.getStage(id), layerId]);
                    resolve(popup);
                    Popup.PopupBuilder.popups.set(popupId, popup);
                    Popup.PopupBuilder.containers.set(id, view);
                });
            });
        };
        Popup.PopupBuilder.prototype.createView = function(id) {
            var _g = this;
            var promise = new Promise(function(resolve, reject) {
                _g.getAssetsPromiser(id).then(function(vbAssets) {
                    var view = Popup.ExternalService.viewBuilderFactory.createView(vbAssets);
                    resolve(view);
                });
            });
            return promise;
        };
        Popup.PopupBuilder.prototype.getAssetsPromiser = function(id) {
            var assetId = "popup-assets/" + id;
            return Popup.ExternalService.getAsset(assetId);
        };
        Popup.PopupBuilder.prototype.setLayout = function(layoutPayload) {
            this.layoutPayload = layoutPayload;
        };
        Popup.PopupBuilder.prototype.getStage = function(container) {
            return Popup.ExternalService.getStageFromComponentLayout(container, this.layoutPayload);
        };
        Popup.PopupBuilder.prototype.__class__ = Popup.PopupBuilder;
        if (typeof haxe == 'undefined') {
            var haxe = {};
        };

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

            get: function(k) {
                return {
                    arguments: ["*"],
                    returns: "null"
                };
            }
        };
        if (typeof js == 'undefined') {
            var js = {};
        };
        if (!js._Boot) {
            js._Boot = {};
        };
        js._Boot.HaxeError = function(val) {
            Error.call(this);
            this.val = val;
            this.message = String(val);
            if (Error.captureStackTrace) Error.captureStackTrace(this, js._Boot.HaxeError);
        };
        js._Boot.HaxeError.__name__ = ["js", "_Boot", "HaxeError"];
        js._Boot.HaxeError.__super__ = Error;
        for (var k in Error.prototype) js._Boot.HaxeError.prototype[k] = Error.prototype[k];
        js._Boot.HaxeError.prototype.val = null;
        js._Boot.HaxeError.prototype.__class__ = js._Boot.HaxeError;
        Popup.Popup.POPUP_ID = "POPUP";;
        Popup.Popup.POPUP_ANIM_ID = "POPUP_ANIMATION";;
        Popup.Popup.OUTRO_POPUP_ANIMATION_ID = "OUTRO_POPUP_ANIMATION";;
        Popup.PopupBuilder.popups = new _hcmn_.haxe_ds_StringMap();;
        Popup.PopupBuilder.containers = new _hcmn_.haxe_ds_StringMap();;
        return {
            exports: Popup,
            activator: Popup.Activator
        };
    });
//# sourceURL=wildFuryPopup.js