"use strict";define(["app","handlebars","View","text!/v2/webapps/FirstAccess/Home/Templates/WelcomeTemplate.html","webapps/FirstAccess/CommonControls/Localization/Views/LanguageButtonsView","webapps/FirstAccess/CommonControls/Localization/Model/SetCurrentLanguageModel","utils"],function(e,g,f,c,h,d,b){var a=f.extend({id:"welcome",overlay:null,callback:null,welcomeTemplate:g.compile(c),events:{"click #splashScreen":"clicked"},close:function(){e.instance().sessionTimeout.disabled=false;this.trigger("view:closed");if(this.callback){this.callback.apply(this,"");}},clicked:function(i){if(i){e.instance().Cache.LanguageSettings.CurrentLanguage=e.instance().Cache.profileSettingsModel.DefaultLanguage;e.instance().resetLanguage(_.bind(function(){var j=new d();j.fetch({data:{language:e.instance().Cache.profileSettingsModel.DefaultLanguage},success:_.bind(function(){this.close();},this)});},this));this.close();}},initialize:function(i){f.prototype.initialize.apply(this,arguments);this.options=i||{};this.overlay=this.options.parent;},onLanguageSelected:function(){this.close();},render:function(i,j){f.prototype.render.apply(this,arguments);this.setParent(i.parent);this.callback=j;this.$el.html(this.welcomeTemplate({}));this.overlay.render().$el.find("#overlay").html(this.$el);this.languageButtonsView=new h({parentView:this});this.languageButtonsView.render(e.instance().Cache.LanguageSettings.Languages,e.instance().Cache.LanguageSettings.CurrentLanguage,b.getLanguageName);this.$el.find("#btns-language").html(this.languageButtonsView.$el);i.parent.$el.append(this.overlay.$el);$(window).keypress(_.bind(function(){this.clicked();},this));return this;}});return a;});