function GetQueryStringParams(n){for(var i,u=window.location.search.substring(1),r=u.split("&"),t=0;t0&&(t.firedElem==="btnRegen"&&$("#divKeyAlert").toggleClass("hide",!1),$("#divKeyResult").html(n))},onFailure:function(t){$("#confirmDeleteModal").modal("hide");$("#confirmRegenModal").modal("hide");n.showResponseError("divKeyError","errlist",t)}}},AppApproveECards=function(){$.ajaxSetup({async:!0,cache:!1});var n=new AppCommon;return{init:function(){var n=this},callAPI:function(n,t,i,r,u){n==="get"?$.get(t,i,r).error(function(n){u(n)}):$.post(t,i,r).error(function(n){u(n)})},onSuccess:function(n){n&&($("#resendEmailModal").modal("hide"),$("#resendSMSModal").modal("hide"),$("#divAlert").toggleClass("hide",!1),$("#btnSearchCards").trigger({type:"click",canShowMsg:!0}))},onFail:function(t){n.showResponseError("resendError","emailErr",t)},editECard:function(n){n.preventDefault();$("#divEditError").toggleClass("hide",!0);$("#divEditAlert").toggleClass("hide",!0);var t=this,i=$(n.target.parentElement),r=i.data("url"),u={eCardGuid:i.data("eid"),isInstructorCard:i.data("isinstsrc")};t.callAPI("post",r,u,$.proxy(t.onLoadingEditCard,t),t.onFailSearch)},onLoadingEditCard:function(t){var i=this;if(t&&t.length>0&&($("#divSearch").toggleClass("hide",!0),$("#divEditCard").toggleClass("hide",!1).html(t),n.initDatePicker(!0),n.focusMessage(),$("#blockeCard").length>0)){$("#blockeCard").off("change");$("#blockeCard").on("change",i.changeStatus);$("#notes").prop("disabled",!$("#blockeCard").is(":checked"))}},getPendingRequest:function(){var t=$("#hdnUrl").val(),n=this;n.callAPI("get",t,"",n.onLoad,n.onLoadFailed)},onLoad:function(n){n&&($("#pendingList").html(n),$("#tblPendingRequest").dataTable({columnDefs:[{targets:"no-sort",orderable:!1}]}),$("#chkSelectAll").focus())},onApproveSuccess:function(n){n&&($("#pendingList").html(n),$("#tblPendingRequest").DataTable(),$("#divAlert").toggleClass("hide",!1),$("#divMessage").text(window.resources.TextApprovedRequest))},onDenySuccess:function(n){n&&($("#pendingList").html(n),$("#tblPendingRequest").DataTable(),$("#divAlert").toggleClass("hide",!1),$("#divMessage").text(window.resources.TextDenyRequest))},onLoadFailed:function(t){n.showResponseError("divError","emailErr",t)},selectAll:function(n){$("#tblPendingRequest").find("input:checkbox").each(function(){this.checked=n.checked})},approveRequest:function(t){var i=this,f=$(t.target),e=f.data("url"),u=f.data("status"),r=[];if($("#tblPendingRequest").find("tr").each(function(n){if(n!=0){var t=$(this).find("input");t.is(":checked")&&r.push(t.val())}}),r.length==0){n.showResponseError("divError","emailErr",window.resources.TextPleaseSelectOneOrMoreRecords);return}u==1?i.callAPI("post",e,{ids:r,status:u},i.onApproveSuccess,i.onLoadFailed):i.callAPI("post",e,{ids:r,status:u},i.onDenySuccess,i.onLoadFailed)},open_lookup:function(){var n=this,t;$("#tcError").html("").addClass("hide");t=$("#tcModal").data("url");n.callAPI("get",t,null,function(t){$(".modal-body").html(t);$("#tcModal").modal("show");$("#countryCode").off("click");$("#search").off("click");$("#countryCode").on("change",n.toggleState);$("#search").on("click",$.proxy(n.searchTC,n))},n.onEditCardFailed)}}},AppBlockECard=function(){$.ajaxSetup({async:!0,cache:!1});var n=new AppCommon,t=function(){var i,t,r;return($("#blockError").html("").addClass("hide"),i=$("#uploadFile")[0].files,t=[],i.length==0?t.push(window.resources.TextFileNameRequired):(r=i[0].name.substr(i[0].name.lastIndexOf(".")+1).toLowerCase(),r!="xls"&&r!="xlsx"&&t.push(window.resources.TextFileShouldBeExcel)),$("#Comments").val()==""&&$("input[name=bType]:checked").val()==2&&t.push(window.resources.TextCommentsRequiredPleaseReview),t.length>0)?n.showResponseError("blockError","errlist",t):!0};return{init:function(){$("#divComment").hide();$("input[name=bType]:radio").on("change",function(n){var t=$(n.target);$("#EcardsActionId").val(t.val());t.val()=="2"?$("#divComment").show():$("#divComment").hide()})},moveNext:function(){var i,u,r,f,e;if(!t())return!1;for(i=new FormData,i.append("Comments",$("#Comments").val()),i.append("IsReturnEcard",$("#IsReturnEcard:checked").val()),i.append("EcardsActionId",$("input[name=bType]:checked").val()),u=$("#uploadFile")[0].files,r=0;r1){var i=[];return i=$("#assignErrorstep2").html().split("\n").filter(function(n){return n.length!=0}),$("#btnConfirm").prop("disabled",!0),n.showResponseError("assignErrorstep2","errlist",i)}},error:function(t){$("#success").html("");n.showResponseError("blockError","errlist",t);$("#uploadFile").val("");n.focusMessage()}}),!1},movePrevious:function(n){return $(n).toggleClass("hide",!1),$("#index").toggleClass("hide",!1),$("#confirmBlockEcards").toggleClass("hide",!0),!1},validateStudentSelection:function(){var t=[],i=$("input:checked").length;return(i<1&&t.push(window.resources.TextPleaseSelectAtLeastOneUnblocked),n.showResponseError("assignErrorstep2","errlist",t),t.length===0)?!0:!1},Submit:function(t){var r=this,i;if(r.validateStudentSelection()){i="assignErrorstep2";$("#btnConfirm").submit();var u=$("#btnConfirm").data("url"),e=$(t).data("url"),f=$("#frmConfirm").serializeArray();return jQuery.post(u,f,function(n){$("#completeBlockEcards").html(n);$("#completeBlockEcards").removeClass("hide");$("#confirmBlockEcards").addClass("hide");$("#index").addClass("hide")}).fail(function(t){n.showResponseError(i,"errlist",t)}).always(function(){}),!1}}}},AppEcardClosureReport=function(){$.ajaxSetup({async:!0,cache:!1});var n=new AppCommon,t=function(){$("#assignError").html("");$("#assignError").addClass("hide");var t=[],i=$("#ddlTC option:selected").val(),r=$("#TcId").val(),u=$("#ddlReportType option:selected").val();return i<=0&&!r&&(t[t.length]=window.resources.TextAtleastOneValue),i>0&&r!=""&&(t[t.length]=window.resources.TextTcORTcId),u==0&&(t[t.length]=window.resources.TextReportTypeRequired),n.showResponseError("assignError","errlist",t)};return{init:function(){var n=this;$("input[type=radio][name=rdbTcStatus]").on("change",function(t){var i=$(t.target);filterBy=i.val();n.getTrainingcenters(filterBy)})},getTrainingcenters:function(t){var i=$("#activeTCUrl").data("url"),r={isTcActive:t=="1"};jQuery.get(i,r,function(n){var t=[];t.push($("