"use strict";define(["app","handlebars","View","text!/v2/webapps/FirstAccess/AdminSettings/Templates/SignInMessageTemplate.html","utils"],function(d,f,e,a,b){var c=e.extend({SignInMessageTemplate:f.compile(a),events:{"click .signInDelete-btn":"onMsgClickDelete","click .sign-in-message-addbtn":"onMsgClickAdd","click .signInEdit-btn":"onMsgClickEdit"},initialize:function(g){e.prototype.initialize.apply(this,arguments);this.options=g||{};},render:function(j){j.CustomMessages.forEach(function(k){if(k!=undefined){if(k.LangCd.length===3){k.LangCdx=b.getEnglishLanguageName(k.LangCd);}else{k.LangCdx=k.LangCd;}}});this.$el.html(this.SignInMessageTemplate(j));var i=_.map(j.CustomMessages.filter(function(k){return k.MessageType===0;}),function(k){return k.LangCd;});var g=b.getSupportedLanguages();var h=_.difference(g,i);this.$el.find(".sign-in-message-addbtn").prop("disabled",h.length===0);return this;},onMsgClickDelete:function(h){h.preventDefault();var g=$(h.target).val().split(" ")[0];this.trigger("view:deleteSignInMessage",g,10);},onMsgClickEdit:function(h){h.preventDefault();var g=$(h.target).val().split(" ")[0];this.trigger("view:editSignInMessage",g,10);},onMsgClickAdd:function(g){g.preventDefault();this.trigger("view:addSignInMessage");return false;}});return c;});