var PERSONAL_INFO=[],SELECTED_ASSOC="",PRIVACY_GUARD_RESULTS=[];function replaceAll(e,t,a){return e.replace(new RegExp(t,"g"),a)}function getMatchIndex(r,e){var n=3;return $.each(e,function(e,t){r=$.trim(r);var a=$.trim(t.bank_name);if(r==a)return n=t.index,!1}),n}function count_array_values(e,a){var r=0;return $.each(e,function(e,t){t==a&&r++}),r}function getKeyIndex(e,t,a){var r=count_array_values(a,e);return""==t||""==a||r<2?"":"-"+count_array_values(t,e)}function getInquiriesAndPublicSelectedInfo(e,t){var a=$("select[name=client_id]").val();if(""==a||a<=0)return!1;setInquiriesDropDown(e,t),setPublicInfoDropDown(e,t)}function getHtmlInfo(e){var t=$("textarea[name=html_content]").val(),a=$("select[name=source_type]").val();if(""!=t)return!1;$("#client-loader").show();var r=$(e).val(),n=$("#token").val();$.ajax({type:"POST",data:{action:"htmlinfo",client_id:r,source_type:a,_token:n},url:saveIdentityID,success:function(e){var t=JSON.parse(e);$("textarea[name=html_content]").val(t),$("#client-loader").hide()},error:function(){$("#client-loader").hide()}})}function setSelectedBankDropDown(e){var t=$(".crPrint"),n=(getBankAdditionalInfo(),[]),i=[],l=[];t.find("tr").each(function(e,t){var a="";a=(a=(a=(a=(a=(a=(a=$(this).find("td").eq(0).children("ng-include").children(".sub_header").clone().children().remove().end().text().replace(/<(?:.|\n)*?>/gm,"")).replace(/\r?\n|\r/g,"")).replace("_","")).replace("-","")).replace(/\s+/g," ")).trim()).replace("updatenegativepositive",""),""!=(a=$.trim(a))&&l.push(a)}),$(".sub_header").each(function(e,t){$(this).find("td");var a="";if(a=(a=(a=(a=(a=(a=(a=$(this).clone().children().remove().end().text().replace(/<(?:.|\n)*?>/gm,"")).replace(/\r?\n|\r/g,"")).replace("_","")).replace("-","")).replace(/\s+/g," ")).trim()).replace("updatenegativepositive",""),""!=(a=$.trim(a))){i.push(a);var r={index:e,bank_name:a+getKeyIndex(a,i,l)};$(this).nextAll("table").first().find("th.headerTUC").children("select").attr("id","selectiq_tuc_"+e),$(this).nextAll("table").first().find("th.headerEXP").children("select").attr("id","selectiq_exp_"+e),$(this).nextAll("table").first().find("th.headerEQF").children("select").attr("id","selectiq_eqf_"+e),$(this).children("select").attr("class","banks review_type"),n.push(r)}}),console.log("data"),console.log(e.DI),$.each(e.DI,function(e,t){var a=getMatchIndex(t.data_key,n);console.log(a),$("#selectiq_tuc_"+a).val(t.type).trigger("change"),$("#selectiq_exp_"+a).val(t.type2).trigger("change"),$("#selectiq_eqf_"+a).val(t.type3).trigger("change")})}function pushPrivacyGuardValues(e,t){PRIVACY_GUARD_RESULTS.push({bank_name:t,bank_info:e})}function getPrivacyGuardBankTableInfo(){var e=$("#FtgCrTabContent5 .FtgCrContentRowTable"),x={},q=[];return e.find("tr").each(function(e,t){var a={},i=[],r=($(this).find("td"),$(this).find("th")),l="",c="",s="",n=r.eq(0).clone().children().remove().end().text(),o="";if(""!=n&&r.hasClass("FtgCrDarkTradeHead")){o=n;var p=r.parent(),d=r.parent().next("tr").children("th.FtgCrXPNHead"),u=r.parent().next("tr").children("th.FtgCrEFXHead"),h=r.parent().next("tr").children("th.FtgCrTUCHead"),v=3,f=3,m=3;d.children().has("select")&&(v=d.children("select").val()),u.children().has("select")&&(f=u.children("select").val()),h.children().has("select")&&(m=h.children("select").val());var g=r.parent().next("tr").children("th.FtgCrXPNHead"),_=r.parent().next("tr").children("th.FtgCrEFXHead"),y=r.parent().next("tr").children("th.FtgCrTUCHead");g.children().has("select")&&(v=g.children("select").val()),_.children().has("select")&&(f=_.children("select").val()),y.children().has("select")&&(m=y.children("select").val()),x={Experian:v,Equifax:f,TransUnion:m},p.next("tr").each(function(){var e=$(this),t=e.children("th").eq(0).text(),a=$.trim(e.children("td").eq(0).clone().children().remove().end().text()),r=$.trim(e.children("td").eq(1).clone().children().remove().end().text()),n=$.trim(e.children("td").eq(2).clone().children().remove().end().text());l=a,c=r,s=n,"Date:"!=t&&""!=t&&i.push({Experian:{account:l,key_name:t},Equifax:{account:c,key_name:t},TransUnion:{account:s,key_name:t}})}),""!=i&&(a={bank_name:$.trim(o),address:"",phone:"",bank_info:i,type:x},q.push(a))}}),q}function getStatusByDataKey1(a,e){var r="";return $.each(e.DB,function(e,t){if(t.data_key==a)return r=t,!1}),r}function setDropDownPrivacyGuardPersonalInfo(p,d){$(".FtgCrContentRowTable").first().find("tr").each(function(e,t){var a=$(this).find("th").eq(0),r=a.text(),n=a.parent().children("td");r=(r=(r=(r=(r=r.replace(/\r?\n|\r/g,"")).replace("_","")).replace("-","")).replace(/\s+/g," ")).replace(":",""),r=$.trim(r);var i="";i=(i=(i=(i=(i=(i=(i=n.eq(0).text().replace(/<(?:.|\n)*?>/gm,"")).replace(/\r?\n|\r/g,"")).replace("_","")).replace("-","")).replace(/\s+/g," ")).replace("updatenegativepositive","")).trim();var l=getStatusByDataKey1(r,d);if(""!=i){n.eq(0).append(p);var c=3;""!=l&&(c=l.status3),n.eq(0).children("select").val(c).trigger("change"),n.eq(0).children("select").attr("class","all-select review_type")}if(""!=(i=(i=(i=(i=(i=(i=(i=n.eq(1).text().replace(/<(?:.|\n)*?>/gm,"")).replace(/\r?\n|\r/g,"")).replace("_","")).replace("-","")).replace(/\s+/g," ")).replace("updatenegativepositive","")).trim())){n.eq(1).append(p);var s=3;""!=l&&(s=l.status1),n.eq(1).children("select").val(s).trigger("change"),n.eq(1).children("select").attr("class","all-select review_type")}if(""!=(i=(i=(i=(i=(i=(i=(i=n.eq(2).text().replace(/<(?:.|\n)*?>/gm,"")).replace(/\r?\n|\r/g,"")).replace("_","")).replace("-","")).replace(/\s+/g," ")).replace("updatenegativepositive","")).trim())){n.eq(2).append(p);var o=3;""!=l&&(o=l.status2),n.eq(2).children("select").val(o).trigger("change"),n.eq(2).children("select").attr("class","all-select review_type")}})}function getDropDownPrivacyGuardPersonalInfo(){var e=$(".FtgCrContentRowTable").first(),h=[];return e.find("tr").each(function(e,t){var a=$(this).find("th").eq(0),r=a.text(),n="",i=3,l="",c=3,s="",o=3,p={},d=a.parent().children("td");r=(r=(r=(r=(r=r.replace(/\r?\n|\r/g,"")).replace("_","")).replace("-","")).replace(/\s+/g," ")).replace(":",""),r=$.trim(r);var u="";u=(u=(u=(u=(u=d.eq(0).clone().children().remove().end().text().replace(/<(?:.|\n)*?>/gm,"")).replace(/\r?\n|\r/g,"")).replace("_","")).replace("-","")).replace(/\s+/g," "),""!=(u=(u=$.trim(u)).replace("updatenegativepositive",""))&&(n=$.trim(u),i=d.eq(0).children("select").val()),""!=(u=(u=(u=(u=(u=(u=(u=d.eq(1).clone().children().remove().end().text().replace(/<(?:.|\n)*?>/gm,"")).replace(/\r?\n|\r/g,"")).replace("_","")).replace("-","")).replace(/\s+/g," ")).trim()).replace("updatenegativepositive",""))&&(l=$.trim(u),c=d.eq(1).children("select").val()),""!=(u=(u=(u=(u=(u=(u=(u=d.eq(2).clone().children().remove().end().text().replace(/<(?:.|\n)*?>/gm,"")).replace(/\r?\n|\r/g,"")).replace("_","")).replace("-","")).replace(/\s+/g," ")).trim()).replace("updatenegativepositive",""))&&(s=$.trim(u),o=d.eq(2).children("select").val()),""!=r&&(p={Experian:{data:n,key_name:r,type:i},Equifax:{data:l,key_name:r,type:c},TransUnion:{data:s,key_name:r,type:o}},h.push(p))}),h}function getBankTableInfo(){var e=$(".crPrint"),h=getBankAdditionalInfo(),v=[];e.find("tr").each(function(e,t){var a=$(this).find("td"),r="",n=a.eq(0).children("ng-include").children(".sub_header"),i=n.next("table").find("th.headerTUC").children("select").val(),l=n.next("table").find("th.headerEXP").children("select").val(),c=n.next("table").find("th.headerEQF").children("select").val();r=(r=(r=(r=(r=(r=(r=n.clone().children().remove().end().text().replace(/<(?:.|\n)*?>/gm,"")).replace(/\r?\n|\r/g,"")).replace("_","")).replace("-","")).replace(/\s+/g," ")).trim()).replace("updatenegativepositive","");var s=a.eq(0).children("ng-include").children(".rpt_content_table");if(""!=r){var o=[];s.find("tr").each(function(e,t){var a={},r=$(this).find("td"),n=r.eq(0).text(),i=n.replace(/<(?:.|\n)*?>/gm,"");if(i=n.replace(/\r?\n|\r/g,""),i=n.replace(":"," "),i=n.replace(/\s+/g," "),i=n.replace(" ",""),""!=(i=n.trim())){var l=r.eq(1).text().replace(/<(?:.|\n)*?>/gm,"");l=(l=(l=(l=(l=(l=l.replace(/\r?\n|\r/g,"")).replace("_","")).replace("-","")).replace(/\s+/g," ")).trim()).replace("updatenegativepositive","");var c=r.eq(2).text().replace(/<(?:.|\n)*?>/gm,"");c=(c=(c=(c=(c=(c=c.replace(/\r?\n|\r/g,"")).replace("_","")).replace("-","")).replace(/\s+/g," ")).trim()).replace("updatenegativepositive","");var s=r.eq(3).text().replace(/<(?:.|\n)*?>/gm,"");s=(s=(s=(s=(s=(s=s.replace(/\r?\n|\r/g,"")).replace("_","")).replace("-","")).replace(/\s+/g," ")).trim()).replace("updatenegativepositive",""),a={TransUnion:{account:l,key_name:$.trim(i.replace(":",""))},Experian:{account:c,key_name:$.trim(i.replace(":",""))},Equifax:{account:s,key_name:$.trim(i.replace(":",""))}},o.push(a)}});var p=getInfoByKey(r,h),d="",u="";null!=p.bank_name&&p.bank_name,null!=p.address&&(d=p.address),null!=p.phone&&(u=p.phone),v.push({bank_name:r,address:d,phone:u,type:{TransUnion:i,Experian:l,Equifax:c},bank_info:o})}});var s=[];return $.each(v,function(e,t){var a={},r=isInfoExist($.trim(t.bank_name),h,v),n=3,i="",l="",c="";""!=t.address&&(i=t.address),""!=t.phone&&(l=t.phone),isEmpty(t.type)||(n=t.type),null!=t.bank_info&&(c=t.bank_info),a={bank_name:t.bank_name,address:i,phone:l,bank_info:c,type:n},1==r.status&&(0/gm,"")).replace(/\r?\n|\r/g,"")).replace("_","")).replace("-","")).replace(/\s+/g," ")).trim())){(r=$(this).find("td")).eq(0).text();var r,n=r.eq(1).text().replace(/<(?:.|\n)*?>/gm,"");n=(n=(n=(n=(n=(n=n.replace(/\r?\n|\r/g,"")).replace("_","")).replace("-","")).replace(/\s+/g," ")).trim()).replace("updatenegativepositive","");var i=r.eq(2).text().replace(/<(?:.|\n)*?>/gm,"");i=(i=(i=(i=(i=(i=i.replace(/\r?\n|\r/g,"")).replace("_","")).replace("-","")).replace(/\s+/g," ")).trim()).replace("updatenegativepositive","");var l=r.eq(3).text().replace(/<(?:.|\n)*?>/gm,"");l=(l=(l=(l=(l=(l=l.replace(/\r?\n|\r/g,"")).replace("_","")).replace("-","")).replace(/\s+/g," ")).trim()).replace("updatenegativepositive",""),s={bank_name:a,address:n,phone:i},c.push(s)}}),c}function getTypeByDataKey(r,e){var n="";return $.each(e.DI,function(e,t){var a=getBankRealName(t.data_key);if(-1!=$.trim(r).indexOf(a))return n=t,!1}),n}function getBankRealName(r){var n="",e=r.split("-");return null==e&&(n=r),$.each(e,function(e,t){var a=t;if(null!=a&&1<=a&&a<=100)return n=r.replace("-"+a,""),!1}),n}function setInquiriesDropDown(l,c){$(".rpt_fullReport_header").each(function(){var e=$(this).text();"Inquiries"==(e=$.trim(e))&&($(this).children("select").remove(),$(this).append(allSelectDropDown("inquiries")),$(this).nextAll("table.rpt_content_table").first().find("tr").each(function(e,t){var a=$(this).find("td"),r=$.trim(a.eq(0).text()),n=$.trim(a.eq(2).text());if(""!=$.trim(a.eq(3).text())){var i=getInquiryTypeByDataKey(r+"_"+n,c);a.eq(3).append(l),0'}function pinfoDropDown(e){return"'}function setAllGlobalDropdown(){$(".rpt_fullReport_header").each(function(){var e=$(this).text();"Personal Information"==(e=$.trim(e))&&$(this).append(pinfoDropDown("all-select")),"Public Information"==e&&$(this).append(allSelectDropDown("publicrecord")),"Account History"==e&&$(this).append(allSelectDropDown("banks"))}),$(".FtgFullReportHeader").each(function(){var e=$.trim($(this).text());"Personal Profile"==e&&$(this).append(allSelectDropDown("all-select")),"Credit Inquiries"==e&&$(this).append(allSelectDropDown("inquries")),"Public Records"==e&&$(this).append(allSelectDropDown("public-records")),"Account History"==e&&$(this).append(allSelectDropDown("banks"))})}$(document).ready(function(){function s(f){$("table.rpt_content_table:eq(1)").find("tr").each(function(e,t){var a,r,n,i=$(this).find("td"),l=i.eq(0).text();if(""!=(l=i.eq(0).text())){var c=i.eq(1).text().replace(/<(?:.|\n)*?>/gm,"");c=(c=(c=(c=(c=(c=c.replace(/\r?\n|\r/g,"")).replace("_","")).replace("-","")).replace(/\s+/g," ")).trim()).replace("updatenegativepositive","");var s=i.eq(2).text().replace(/<(?:.|\n)*?>/gm,"");s=(s=(s=(s=(s=(s=s.replace(/\r?\n|\r/g,"")).replace("_","")).replace("-","")).replace(/\s+/g," ")).trim()).replace("updatenegativepositive","");var o=i.eq(3).text().replace(/<(?:.|\n)*?>/gm,"");o=(o=(o=(o=(o=(o=o.replace(/\r?\n|\r/g,"")).replace("_","")).replace("-","")).replace(/\s+/g," ")).trim()).replace("updatenegativepositive","");var p=l.replace(/<(?:.|\n)*?>/gm,"");p=l.replace(/\r?\n|\r/g,""),p=l.replace(":"," "),p=l.replace(/\s+/g," "),p=l.trim();var d=(a=p.replace(":",""),r=f,n="",$.each(r.DB,function(e,t){if(t.data_key==a)return n=t,!1}),n);if(""!=c){i.eq(1).append(m());var u=3;""!=d&&(u=d.status3),i.eq(1).children("select").val(u).trigger("change"),i.eq(1).children("select").attr("class","all-select review_type")}if(""!=s){i.eq(2).append(m());var h=3;""!=d&&(h=d.status1),i.eq(2).children("select").val(h).trigger("change"),i.eq(2).children("select").attr("class","all-select review_type")}if(""!=o){i.eq(3).append(m());var v=3;""!=d&&(v=d.status2),i.eq(3).children("select").val(v).trigger("change"),i.eq(3).children("select").attr("class","all-select review_type")}}})}function m(){return''}$("button[name=checkConsole], button[name=credit_btn]").click(function(){var i=document.getElementById("client_id").value,l=$("select[name=source_type]").val(),c=$(this).attr("name");"credit_btn"==c?$("#credit-loader").show():$("#save-loader").show();var e={};if(""==i)alert("Please select Client"),$("select[name=client_id]").parent().addClass("has-error");else{var t="",a=(i=document.getElementById("client_id").value,document.getElementsByClassName("rpt_content_table"),0);if($("input[name=delete_all]").prop("checked")&&(a=1),t=(t=$("textarea[name=html_content]").val()).replace(/]*>(?:(?!<\/script>)[^])*<\/script>/g,""),$.parseHTML(t),console.log("html"),console.log(t),1==l){var r=function(){PERSONAL_INFO=[];var o=[],e=$("table.rpt_content_table:eq(1)");return e.find("tr").each(function(e,t){var a=$(this).find("td"),r=a.eq(0).text(),n={};if(""!=r){var i=a.eq(1).text().replace(/<(?:.|\n)*?>/gm,"");i=(i=(i=(i=(i=(i=(i=(i=(i=i.replace(/\r?\n|\r/g,"")).replace("_","")).replace("-","")).replace(/\s+/g," ")).trim()).replace("updatenegativepositive","")).replace("Send To Both EVcrm for Attacks And Audit","")).replace("Send To Only EVcrm Attack","")).replace("Send To Only EVcrm Audit","");var l=a.eq(2).text().replace(/<(?:.|\n)*?>/gm,"");l=(l=(l=(l=(l=(l=l.replace(/\r?\n|\r/g,"")).replace("_","")).replace("-","")).replace(/\s+/g," ")).trim()).replace("updatenegativepositive",""),l=i.replace("Send To Both EVcrm for Attacks And Audit",""),l=i.replace("Send To Only EVcrm Attack",""),l=i.replace("Send To Only EVcrm Audit","");var c=a.eq(3).text().replace(/<(?:.|\n)*?>/gm,"");c=(c=(c=(c=(c=(c=c.replace(/\r?\n|\r/g,"")).replace("_","")).replace("-","")).replace(/\s+/g," ")).trim()).replace("updatenegativepositive",""),c=i.replace("Send To Both EVcrm for Attacks And Audit",""),c=i.replace("Send To Only EVcrm Attack",""),c=i.replace("Send To Only EVcrm Audit","");var s=r.replace(/<(?:.|\n)*?>/gm,"");s=r.replace(/\r?\n|\r/g,""),s=r.replace(":"," "),s=r.replace(/\s+/g," "),s=r.trim(),n={TransUnion:{data:i,type:a.eq(1).children("select").val(),key_name:s.replace(":","")},Experian:{data:l,type:a.eq(2).children("select").val(),key_name:s.replace(":","")},Equifax:{data:c,type:a.eq(3).children("select").val(),key_name:s.replace(":","")}},PERSONAL_INFO.push(n),o.push(n)}}),o}(),n=getBankTableInfo(),s=getSelectedInquiries(),o=getSelectedPublicInfo();e={_token:$("#token").val(),client_id:i,delete_all:a,source_type:l,PERSONAL_INFO_DATA:r,inquiries:s,publicInfo:o,html_content:t,outputBankAcc:n,outputBankInfo:n}}else if(2==l){var p=getPrivacyGuardBankTableInfo(),d=getDropDownPrivacyGuardPersonalInfo();s=getDropDownInquiryPrivacyGuard(),o=getDropDownPublicRecordPrivacyGuard();e={_token:$("#token").val(),client_id:i,delete_all:a,source_type:l,inquiries:s,publicInfo:o,html_content:t,privacyGuardBank:p,PERSONAL_INFO_DATA:d}}}console.log(e),$.ajax({type:"POST",data:e,url:saveIdentityID,success:function(e){if($("#save-loader").hide(),$("#credit-loader").hide(),console.log(e),"success"==e)if("credit_btn"==c){var t=$("select[name=client_id]").children("option:selected").data("name");$("input[name=f_l_name]").val(t);var a=new Date,r=moment(a).format("YYYY-MM-DD");$("input[name=date_audit]").val(r),$("input[name=credit_client_id]").val(i),$("input[name=credit_source_type]").val(l);var n="";1==l?n="Identitiy IQ":2==l&&(n="Privacy Guard"),$("input[name=credit_report_and_date]").val(n+" report dated "+r+" per "+n),$("#credit-analaysis").css({display:"block",overflow:"auto"}).addClass("in")}else alert("Report has been processed successfully!");else alert("Failed. Try again later.")},error:function(){alert("Failed. Try again later.111")}})}),$("button[name=process_html]").click(function(){var e=$("textarea[name=html_content]").val(),t=document.getElementById("search").value,a=$("select[name=client_id]").val();if($("button[name=credit_btn]").hide(),""==t)$("select[name=source_type]").parent().addClass("has-error");else if(0==a)$("select[name=client_id]").parent().addClass("has-error"),alert("Please select client");else if(0