"use strict";define(["app","handlebars","View","text!/v2/webapps/FirstAccess/AdminSettings/Templates/ChartLockMessageTemplate.html","utils"],function(d,f,e,a,b){var c=e.extend({ChartLockMessageTemplate:f.compile(a),events:{"click .chartLockDelete-btn":"onMsgClickDelete","click .chart-lock-message-addbtn":"onMsgClickAdd","click .chartLockEdit-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;}}});j.selectedChartLockMethod=j.ChartLockMethod;j.chartLockMethodList=_.map(["adminsetting.balanceforward","adminsetting.openitem"],function(k,l){return{val:1+l++,text:b.localize(this,[k])};});j.selectedChartLockAging=j.ChartLockAging;j.chartLockAgingList=_.map(["adminsetting.treatmentdate","adminsetting.claimdate"],function(k,l){return{val:l++,text:b.localize(this,[k])};});this.$el.html(this.ChartLockMessageTemplate(j));var i=_.map(j.CustomMessages.filter(function(k){return k.MessageType===1;}),function(k){return k.LangCd;});var g=b.getSupportedLanguages();var h=_.difference(g,i);this.$el.find(".chart-lock-message-addbtn").prop("disabled",h.length===0);return this;},onMsgClickDelete:function(h){h.preventDefault();var g=$(h.target).val().split(" ")[0];this.trigger("view:deleteChartLockMessage",g,10);},onMsgClickEdit:function(h){h.preventDefault();var g=$(h.target).val().split(" ")[0];this.trigger("view:editChartLockMessage",g,10);},onMsgClickAdd:function(g){g.preventDefault();this.trigger("view:addChartLockMessage");return false;}});return c;});