define("pbWofExoticFarEastGrandMajorJackpot", ["viewBuilderApi", "componentmodelComponentApi", "translationmanagerApi", "clientkernelLoaderApi", "displayEngineApi", "displayEngineUtils", "gameLayoutApi", "PIXI", "BABYLON", "clientkernelEventbusApi", "clientkernelModulesApi", "pbWofExoticFarEastGrandMajorJackpotApi"],
    function(viewBuilderApi, componentmodelComponentApi, translationmanagerApi, clientkernelLoaderApi, displayEngineApi, displayEngineUtils, gameLayoutApi, PIXI, BABYLON, clientkernelEventbusApi, clientkernelModulesApi, pbWofExoticFarEastGrandMajorJackpotApi) {
        "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 pbWofExoticFarEastGrandMajorJackpot == 'undefined') {
            var pbWofExoticFarEastGrandMajorJackpot = {};
        };
        pbWofExoticFarEastGrandMajorJackpot.Activator = function(context) {};
        pbWofExoticFarEastGrandMajorJackpot.Activator = ck_implements(pbWofExoticFarEastGrandMajorJackpot.Activator, clientkernelModulesApi.IModuleActivator);
        pbWofExoticFarEastGrandMajorJackpot.Activator.__interfaces__ = [clientkernelModulesApi.IModuleActivator];
        pbWofExoticFarEastGrandMajorJackpot.Activator.__name__ = ["pbWofExoticFarEastGrandMajorJackpot", "Activator"];
        pbWofExoticFarEastGrandMajorJackpot.Activator.prototype.start = function(context) {
            context.getServiceTracker([clientkernelLoaderApi.IAssetRegistry, viewBuilderApi.IViewBuilderFactory, displayEngineApi.IDisplayProvider, translationmanagerApi.ITranslationManager]).then(function(context1) {
                pbWofExoticFarEastGrandMajorJackpot.ExternalService.initialize(context1);
                context1.registerService(new pbWofExoticFarEastGrandMajorJackpot.GrandMajorJackpotFactory(context1), pbWofExoticFarEastGrandMajorJackpotApi.GrandMajorJackpotDeclaration, null);
            });
        };
        pbWofExoticFarEastGrandMajorJackpot.Activator.prototype.stop = function(context) {};
        pbWofExoticFarEastGrandMajorJackpot.Activator.main = function() {};
        pbWofExoticFarEastGrandMajorJackpot.Activator.prototype.__class__ = pbWofExoticFarEastGrandMajorJackpot.Activator;
        pbWofExoticFarEastGrandMajorJackpot.ExternalService = function() {};
        pbWofExoticFarEastGrandMajorJackpot.ExternalService.__name__ = ["pbWofExoticFarEastGrandMajorJackpot", "ExternalService"];
        pbWofExoticFarEastGrandMajorJackpot.ExternalService.assetRegistry = null;
        pbWofExoticFarEastGrandMajorJackpot.ExternalService.vbf = null;
        pbWofExoticFarEastGrandMajorJackpot.ExternalService.displayProvider = null;
        pbWofExoticFarEastGrandMajorJackpot.ExternalService.translationManager = null;
        pbWofExoticFarEastGrandMajorJackpot.ExternalService.bus = null;
        pbWofExoticFarEastGrandMajorJackpot.ExternalService.initialize = function(context) {
            pbWofExoticFarEastGrandMajorJackpot.ExternalService.assetRegistry = context.getAnyService(clientkernelLoaderApi.IAssetRegistry, null);
            pbWofExoticFarEastGrandMajorJackpot.ExternalService.vbf = context.getAnyService(viewBuilderApi.IViewBuilderFactory, null);
            pbWofExoticFarEastGrandMajorJackpot.ExternalService.displayProvider = context.getAnyService(displayEngineApi.IDisplayProvider, null);
            pbWofExoticFarEastGrandMajorJackpot.ExternalService.translationManager = context.getAnyService(translationmanagerApi.ITranslationManager, null);
            pbWofExoticFarEastGrandMajorJackpot.ExternalService.bus = context.getAnyService(clientkernelEventbusApi.IEventBus, null);
        };
        pbWofExoticFarEastGrandMajorJackpot.ExternalService.getAsset = function(id) {
            return pbWofExoticFarEastGrandMajorJackpot.ExternalService.assetRegistry.getAsset(id).getContent();
        };
        pbWofExoticFarEastGrandMajorJackpot.ExternalService.prototype.__class__ = pbWofExoticFarEastGrandMajorJackpot.ExternalService;
        pbWofExoticFarEastGrandMajorJackpot.GrandMajorJackpot = function(context, cfgId) {
            this.initialized = false;
            var _g = this;
            this.context = context;
            this.port = context.getImplementedPort(pbWofExoticFarEastGrandMajorJackpotApi.IGrandMajorJackpotImplementationPort);
            this.layoutPort = context.getUsedPort(gameLayoutApi.IGameLayoutPort);
            this.layoutPort.getUpdateComponentLayout().subscribe($bind(this, this.handleUpdateLayout));
            pbWofExoticFarEastGrandMajorJackpot.ExternalService.assetRegistry.getAsset("grand-major-jackpot-assets/grand_major_jackpot.viewbuilder.json").getContent().then(function(vba) {
                _g.vba = vba;
                _g.initialize();
            });
            this.port.getUpdateLabels().subscribe($bind(this, this.handleUpdateLabels));
        };
        pbWofExoticFarEastGrandMajorJackpot.GrandMajorJackpot.__name__ = ["pbWofExoticFarEastGrandMajorJackpot", "GrandMajorJackpot"];
        pbWofExoticFarEastGrandMajorJackpot.GrandMajorJackpot.prototype.port = null;
        pbWofExoticFarEastGrandMajorJackpot.GrandMajorJackpot.prototype.context = null;
        pbWofExoticFarEastGrandMajorJackpot.GrandMajorJackpot.prototype.layoutPort = null;
        pbWofExoticFarEastGrandMajorJackpot.GrandMajorJackpot.prototype.layoutPayload = null;
        pbWofExoticFarEastGrandMajorJackpot.GrandMajorJackpot.prototype.initialized = null;
        pbWofExoticFarEastGrandMajorJackpot.GrandMajorJackpot.prototype.vba = null;
        pbWofExoticFarEastGrandMajorJackpot.GrandMajorJackpot.prototype.view = null;
        pbWofExoticFarEastGrandMajorJackpot.GrandMajorJackpot.prototype.handleUpdateLabels = function(e) {
            var grandJackpotLabel = this.view.getContainerById("grand_major_jackpot_layer1").getContainerById("grand").getLabelById("grandValueLabel");
            var majorJackpotLabel = this.view.getContainerById("grand_major_jackpot_layer1").getContainerById("major").getLabelById("majorValueLabel");
            grandJackpotLabel.setText(e.getPayload()[0]);
            majorJackpotLabel.setText(e.getPayload()[1]);
        };
        pbWofExoticFarEastGrandMajorJackpot.GrandMajorJackpot.prototype.handleUpdateLayout = function(e) {
            this.layoutPayload = e.getPayload();
            if (!this.initialized) this.initialize();
            else this.updateLayout();
        };
        pbWofExoticFarEastGrandMajorJackpot.GrandMajorJackpot.prototype.initialize = function() {
            if (this.layoutPayload != null && this.vba != null) {
                this.initialized = true;
                this.view = pbWofExoticFarEastGrandMajorJackpot.ExternalService.vbf.createView(this.vba);
                this.updateLayout();
                this.doSomethingWithTheView();
            }
        };
        pbWofExoticFarEastGrandMajorJackpot.GrandMajorJackpot.prototype.doSomethingWithTheView = function() {};
        pbWofExoticFarEastGrandMajorJackpot.GrandMajorJackpot.prototype.updateLayout = function() {
            var layoutPayload_GM = this.layoutPayload.containers.get("grand_major_jackpot_layer1");
            var containerRoot = this.view.getContainerById("grand_major_jackpot_layer1");
            var containerDisplayObject = this.view.getContainerById("grand_major_jackpot_layer1").getDisplayObject();
            var containerGrand = containerRoot.getContainerById("grand").getDisplayObject();
            var containerMajor = containerRoot.getContainerById("major").getDisplayObject();
            var stage;
            var this1 = pbWofExoticFarEastGrandMajorJackpot.ExternalService.displayProvider.getStages();
            stage = this1.get(layoutPayload_GM.stage);
            stage.removeChild(containerGrand);
            stage.addChild(containerGrand);
            stage.removeChild(containerMajor);
            stage.addChild(containerMajor);
            var layoutPayloadGrand = this.layoutPayload.containers.get("grand");
            containerGrand.setX(layoutPayloadGrand.left);
            containerGrand.setY(layoutPayloadGrand.top);
            containerGrand.setZIndex(layoutPayloadGrand.zIndex);
            containerGrand.setScaleX(layoutPayloadGrand.width / containerGrand.getUserData().viewBuilderW);
            containerGrand.setScaleY(layoutPayloadGrand.height / containerGrand.getUserData().viewBuilderH);
            var layoutPayloadMajor = this.layoutPayload.containers.get("major");
            containerMajor.setX(layoutPayloadMajor.left);
            containerMajor.setY(layoutPayloadMajor.top);
            containerMajor.setZIndex(layoutPayloadMajor.zIndex);
            containerMajor.setScaleX(layoutPayloadMajor.width / containerMajor.getUserData().viewBuilderW);
            containerMajor.setScaleY(layoutPayloadMajor.height / containerMajor.getUserData().viewBuilderH);
            this.layoutPort.getComponentLayoutUpdated().publish(this.context.getInstance());
        };
        pbWofExoticFarEastGrandMajorJackpot.GrandMajorJackpot.prototype.__class__ = pbWofExoticFarEastGrandMajorJackpot.GrandMajorJackpot;
        pbWofExoticFarEastGrandMajorJackpot.GrandMajorJackpotFactory = function(context) {
            this.context = context;
        };
        pbWofExoticFarEastGrandMajorJackpot.GrandMajorJackpotFactory = ck_implements(pbWofExoticFarEastGrandMajorJackpot.GrandMajorJackpotFactory, clientkernelModulesApi.IService);
        pbWofExoticFarEastGrandMajorJackpot.GrandMajorJackpotFactory = ck_implements(pbWofExoticFarEastGrandMajorJackpot.GrandMajorJackpotFactory, componentmodelComponentApi.IComponentFactory);
        pbWofExoticFarEastGrandMajorJackpot.GrandMajorJackpotFactory.__interfaces__ = [clientkernelModulesApi.IService, componentmodelComponentApi.IComponentFactory];
        pbWofExoticFarEastGrandMajorJackpot.GrandMajorJackpotFactory.__name__ = ["pbWofExoticFarEastGrandMajorJackpot", "GrandMajorJackpotFactory"];
        pbWofExoticFarEastGrandMajorJackpot.GrandMajorJackpotFactory.prototype.context = null;
        pbWofExoticFarEastGrandMajorJackpot.GrandMajorJackpotFactory.prototype.getComponentDeclaration = function() {
            return pbWofExoticFarEastGrandMajorJackpotApi.GrandMajorJackpotDeclaration;
        };
        pbWofExoticFarEastGrandMajorJackpot.GrandMajorJackpotFactory.prototype.createComponent = function(context) {
            var cfgId = context.getConfiguration();
            new pbWofExoticFarEastGrandMajorJackpot.GrandMajorJackpot(context, cfgId);
        };
        pbWofExoticFarEastGrandMajorJackpot.GrandMajorJackpotFactory.prototype.__class__ = pbWofExoticFarEastGrandMajorJackpot.GrandMajorJackpotFactory;
        if (typeof haxe == 'undefined') {
            var haxe = {};
        };

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

            get: function(k) {
                return {
                    arguments: ["*"],
                    returns: "null"
                };
            }
        };
        pbWofExoticFarEastGrandMajorJackpot.GrandMajorJackpot.vbAssetID = "grand-major-jackpot-assets/grand_major_jackpot.viewbuilder.json";;
        return {
            exports: pbWofExoticFarEastGrandMajorJackpot,
            activator: pbWofExoticFarEastGrandMajorJackpot.Activator
        };
    });
//# sourceURL=pbWofExoticFarEastGrandMajorJackpot.js