"use strict";define(["app","handlebars","View","text!/v2/webapps/FirstAccess/AdminSettings/Templates/ClinicExceptionTemplate.html","utils"],function(d,f,e,c,b){var a=e.extend({clinicExceptionTemplate:f.compile(c),events:{"click .clinic-exception-addbtn":"onClinicClickAddRemove","click .edit-btn":"onExcpClickEdit","change #languagesClinic":"onChangeClinicLang","click #message":"onExpandMessage"},selectedClinicLang:"ENG",initialize:function(g){e.prototype.initialize.apply(this,arguments);this.options=g||{};},render:function(j){var k=b.getSupportedLanguages();if(j.language===undefined){j.language=j.DefaultLanguage;}var g=$.map(k,function(l){return{langCd:l,name:"adminsetting.languagesView.language."+l,selected:j.language===l};});var i=_.map(j.ClinicExceptions,function(m,l){return{LangCd:m.LangCd,ClinicDescription:m.ClinicDescription,ClinicId:m.ClinicId,Message:m.Message,ExceptionId:m.ExceptionId,VisibleLang:m.LangCd===j.language};});var h={ClinicExceptions:i};_.extend(h,{languagesClinic:g});this.$el.html(this.clinicExceptionTemplate(h));return this;},onExcpClickEdit:function(h){h.preventDefault();var g=$(h.target).val().split(" ")[0];this.trigger("view:editClinicException",parseInt(g,10),this.selectedClinicLang);},onExcpClickAdd:function(g){g.preventDefault();this.trigger("view:addClinicException");return false;},onChangeClinicLang:function(g){g.preventDefault();this.selectedClinicLang=$(g.target).val();this.trigger("view:rerenderClExcp");},onClinicClickAddRemove:function(g){g.preventDefault();this.trigger("view:addRemoveBlockedClinic");return false;},onExpandMessage:function(g){g.preventDefault();if($(g.target).hasClass("text-one-line")){$(g.target).removeClass("text-one-line");$(g.target).addClass("text-multi-line");}else{$(g.target).removeClass("text-multi-line");$(g.target).addClass("text-one-line");}}});return a;});