function pleaseWaitModal(){$("#pleaseWaitModal").modal("show")}function confirmDeleteModal(n,t,i,r){r.preventDefault();bootbox.confirm(i,function(i){var r=$(n).attr("value"),u=$("<input>").attr("type","hidden").attr("name","action").val(r);i&&($(t).append($(u)),$(t).submit(),pleaseWaitModal())})}function displayDataTable(n){$(n).dataTable({stateSave:!0,pagingType:"simple_numbers",order:[[0,"asc"]],columnDefs:[{targets:["no_sort"],sortable:!1}],language:{infoEmpty:"No records available"},filter:!0})}function displayDataTableCustom(n,t,i,r,u,f){t==undefined&&(t=0);i==undefined&&(i="asc");r==undefined&&(r=10);u==undefined&&(u="no_sort");f==undefined&&(f=!0);$(n).length>0&&$(n).dataTable({stateSave:f,pagingType:"simple_numbers",displayLength:r,order:[[t,i]],columnDefs:[{bSortable:!1,aTargets:[u]}],language:{infoEmpty:"No records available"},filter:!0,mark:!0})}function getCurrentDate(){var n=new Date,t=n.getDate(),i=n.getMonth()+1,r=t<10?"0"+t:""+t,u=i<10?"0"+i:""+i,f=n.getFullYear();return u+"/"+r+"/"+f}function getCurrentDateAsDate(){return new Date(getCurrentDate())}function clearFutureDate(){var n=$("#selecteddate");new Date(n.val())>getCurrentDateAsDate()&&$("#selecteddate").val("")}function handleEnterPressed(n,t){n.preventDefault();n.key=="Enter"&&($("#"+t).val("1").prop("checked",!0).trigger("click"),$("#"+t).change())}function getFormattedDate(n){var i=n.getFullYear(),t=n.getMonth()+1,r=t<10?"0"+t:t,u=n.getDate()<10?"0"+n.getDate():n.getDate();return r+"/"+u+"/"+i}function getAdjustedDate(n,t,i){var r=getCurrentDateAsDate(),u=r.getFullYear()-n,f=r.getMonth()-t;return new Date(u,f,i.getDate())}function passFailAgeCap(n,t){return n<=119&&t<=11||n<=120&&t===0?!0:!1}function SetAgeFields(n){var f=$('input[name="DateOfBirth"]'),t=$('input[name="Age"]'),i=$('input[name="AgeMonth"]'),u=new Date,c,e=!1,o=0,r=0,l=$('input[name="DateOfBirth"]').is(":focus"),s,h;Date.parse(f.val())&&(u=new Date(f.val()),e=!0);n!=="dob"||l?n==="ageYear"?(e&&(c=new Date(getAdjustedDate(t.val(),i.val(),u)),f.val(getFormattedDate(c))),t.val()===""&&t.val("0")):n==="ageMonth"&&(i.val()>11&&(t.val(0),s=new Date(getAdjustedDate(t.val(),i.val(),getCurrentDateAsDate())),o=getCurrentDateAsDate().getFullYear()-s.getFullYear(),r=getCurrentDateAsDate().getMonth()-s.getMonth(),r>=0?(t.val(o),i.val(r)):(t.val(o-1),i.val(r+12))),i.val()===""&&i.val("0")):e===!0&&(u=new Date(f.val()),o=getCurrentDateAsDate().getFullYear()-u.getFullYear(),r=getCurrentDateAsDate().getMonth()-u.getMonth(),r>=0?(t.val(o),i.val(r)):(t.val(o-1),i.val(r+12)),$("#Gender").focus(),$("#selecteddate").datepicker("hide"));e&&(n==="ageYear"||n==="ageMonth")&&(h=new Date(getAdjustedDate(t.val(),i.val(),getCurrentDateAsDate())),(h.getFullYear()!=u.getFullYear()||h.getMonth()!==u.getMonth())&&(f.val(""),e=!1));(e||i.val()>0||t.val()>0)&&(f.parent().removeClass("has-error"),$("#selecteddate-error").remove())}function calculateAge(n){SetAgeFields(n)}function checkAnotherPerpetrator(){var n=$("#yesAnotherPerpetratorInvolved");$(n).is(":checked")?$("#otherperpetratordata").show():$("#otherperpetratordata").hide()}function checkOtherAdultsInHome(){var n=$("#yesotheradultsinhome");$(n).is(":checked")?$("#otheradultscount").show():$("#otheradultscount").hide()}function checkHasPhone(){var n=$("#yesotherperpetratorphone");$(n).is(":checked")?$("#otherperpetratorphonenumberdata").show():$("#otherperpetratorphonenumberdata").hide()}function checkPrimaryAddressKnown(){var n=$("#yesotherperpetratorknownaddress");$(n).is(":checked")?$("#knownotherperpetratorprimaryaddressdata").show():$("#knownotherperpetratorprimaryaddressdata").hide()}function checkAtPrimaryAddress(){var n=$("#noatprimaryaddress");$(n).is(":checked")?$("#otherperpetratorcurrentaddressdata").show():$("#otherperpetratorcurrentaddressdata").hide()}function checkHasAlias(){var n=$("#yesotherPerpetratoralias");$(n).is(":checked")?$("#otherperpetratoraliasnamedata").show():$("#otherperpetratoraliasnamedata").hide()}function UpdateOtherAdultsInHome(){var n=$("#OtherPerpetratorForm").serialize(),t=$(this);$.ajax({url:urlAdultsInvolvedCount,type:"POST",cache:!1,data:n,success:function(n){$("#otheradultsinhomedata").empty().append(n);OtherPerpetratorAdult.Initialize()}})}function PostOtherAdultInHome(){$.ajax({type:"POST",url:"/OtherPerpetrator/CreateAdultsInHomeCount",data:formData,dataType:"html",contentType:!1,success:function(){UpdateOtherAdultsInHome()}})}function showHideIncidentInfoAddress(){($("#yesincidentatprimaryaddress").is(":checked")||$("#yesincidentatfacility").is(":checked"))&&($("#incidentdetails").show(),$("#indicidentlocationdata").hide());($("#noincidentatprimaryaddress").is(":checked")||$("#noincidentatfacility").is(":checked"))&&($("#incidentdetails").show(),$("#indicidentlocationdata").show());($("#unknownincidentatprimaryaddress").is(":checked")||$("#unknownincidentatfacility").is(":checked"))&&($("#incidentdetails").show(),$("#indicidentlocationdata").hide())}function fillDivisionTypes(n){if($(n).val()==""){$("#DivisionType").hide();return}$("#DivisionType").show();var i=parseInt($(n).val()),t=$(n).attr("dependentctrlid");$.ajax({url:"../Lookup/GetReportTypes?reportGroupId="+i,type:"GET",cache:!1,success:function(n){$("#"+t).empty();for(var i=0;i<n.length;i++)n[i].Id==="0"&&(n[i].Id=""),$("#"+t).append(new Option(n[i].Name,n[i].Id,!0))}})}function autoSetUnknownAge(){$('input[name="Age"]').length>0&&$('input[name="Age"]').val()===""&&$('input[name="Age"]').val("0");$('input[name="AgeMonth"]').length>0&&$('input[name="AgeMonth"]').val()===""&&$('input[name="AgeMonth"]').val("0")}function checkKey(n){return n.keyCode=="38"?!1:n.keyCode=="40"?!1:!0}function DisplayClientSideValidationErrors(n){if($("#clientErrorMessageList").empty(),n.length>0){$("#clientErrorMessage").removeClass("hidden");var t=$("<p>").text("Please review and fix the following errors: ");$("#clientErrorMessageList").append(t)}n.forEach(n=>{var t=$("<div>"),i=$("<ul>").addClass("list"),r=$("<li>").addClass("list-item"),u=$("<a>").attr("href",n.element).text("").click(function(t){t.preventDefault();n.element.focus()}),f=$("<p>").text(n.message);u.append(f);r.append(u);i.append(r);t.append(i);$("#clientErrorMessageList").append(t);$("#clientErrorMessageList").find("a").first().focus()})}function ValidateAndSubmit(){if(autoSetUnknownAge(),postedToServer++,!(postedToServer>1)){setTimeout(function(){$(this).attr("disabled","disabled")},0);setTimeout(function(){$(this).removeAttr("disabled")},5e3);var n=$(this).parents("form").validate();return n.form()?(postedToServer--,!0):(console.log(n.errorList),DisplayClientSideValidationErrors(n.errorList),postedToServer--,!1)}}function autoRequiredFields(n,t){switch(t){case!0:document.getElementById(n).value===""&&$(`#${n}`).rules("add","required");break;case!1:document.getElementById(n).value===""&&$(`#${n}`).rules("remove","required")}}function SetDynamicQuestionAnswerTextAreaVisibility(n,t){t?$(n).show():$(n).hide()}function handleRadioButtonEnterPressed(n,t){n.preventDefault();n.key=="Enter"&&$("#"+t).val("1").prop("checked",!0).trigger("click")}function handleCheckBoxEnterPressed(n,t){if(n.preventDefault(),n.key=="Enter"){var i=$("#"+t).is(":checked");i?($("#"+t).prop("checked",!1),populateIsNameUnknown(!1)):($("#"+t).prop("checked",!0),populateIsNameUnknown(!0))}}function handleDateTimeEnterPressed(n,t){if(n.preventDefault(),n.key=="Enter"){$('input[name="Age"]').val("");$('input[name="AgeMonth"]').val("");var r=$(".datepicker-days tbody td.focused").text(),u=$(".datepicker-days thead th.datepicker-switch").text(),i=u.split(" "),f=monthMap[i[0]],e=i[1];$("#"+t).val(f+"/"+r+"/"+e)}}function setTabIndexAutomatically(){const n=document.querySelectorAll("input,button,a,select,textarea");n.forEach((n,t)=>{n.setAttribute("tabindex",t+1)})}function populateIsNameUnknown(n){n?($('input[name="FirstName"]').focus(),$('input[name="FirstName"]').val("Unknown"),$('input[name="LastName"]').focus(),$('input[name="LastName"]').val("Unknown")):($('input[name="FirstName"]').val(""),$('input[name="LastName"]').val(""));$("#IsNameUnknown").focus()}function _classCallCheck(n,t){if(!(n instanceof t))throw new TypeError("Cannot call a class as a function");}function _classCallCheck(n,t){if(!(n instanceof t))throw new TypeError("Cannot call a class as a function");}var Toggle,OtherPerpetratorAdult,postedToServer,_createClass,_typeof;let focusByKeyboard=!1;$(document).on("visibilitychange",n=>{n.preventDefault(),$("#DialogConfirmSubmit").modal("hide")});$(document).ready(function(){$("#selecteddate").datepicker({todayHighlight:!0,todayBtn:!0,startDate:"-120y",endDate:moment().format("MM/DD/YYYY"),defaultDate:"01/01/0001",orientation:"bottom left",format:"mm/dd/yyyy",container:".selectdatepicker",autoclose:!0,forceParse:!1});$(document).ready(function(){$.validator.addMethod("dobValid",function(n,t){var r=$(t).val(),e;if(r==""||/^\01\/01\/0001$/.test(r))return!0;if(!/^\d{1,2}\/\d{1,2}\/\d{4}$/.test(r))return!1;var u=r.split("/"),o=parseInt(u[1],10),f=parseInt(u[0],10),i=parseInt(u[2],10);return i<1e3||i>3e3||f==0||f>12?!1:(e=[31,28,31,30,31,30,31,31,30,31,30,31],(i%400==0||i%100!=0&&i%4==0)&&(e[1]=29),o>0&&o<=e[f-1])},"Invalid date");$.validator.addMethod("pastDate",function(n,t){var i=$(t).val(),r,u;return/^\d{1,2}\/\d{1,2}\/\d{4}$/.test(i)?(r=moment(i,"MM/DD/YYYY"),u=moment(),u.diff(r,"years")>120?!1:!0):!0},"Date must be lesser then 120 years.");$.validator.addMethod("futureDate",function(n,t){var i=$(t).val();return/^\d{1,2}\/\d{1,2}\/\d{4}$/.test(i)?new Date(i)>new Date?!1:!0:!0},"Date can't be future date.");$.validator.addMethod("sameRace",function(){var n=$("#Race").val(),t=$("#OtherRace").val();return n!=t||n==""||t==""?!0:!1},"Cannot select the same race twice. Please select a different race for 'Other Race' or no secondary race.");$("#selecteddate").rules("add",{dobValid:!0,futureDate:!0,pastDate:!0});$("#OtherRace").rules("add",{sameRace:!0})});$("#selecteddate").mask("99/99/9999")});$(document).ready(function(){var n=$("#selecteddate").val();n==="01/01/0001"&&($("#selecteddate").datepicker("setDate",getCurrentDate()),$("#selecteddate").val(""))});$(document).ready(function(){$("#selectedtime").datetimepicker({format:"LT"})});$(document).ready(function(){$("#selectedtimeicon").on("click",function(){$(this).datetimepicker({format:"LT"})});$('input[type="radio"]').each(function(){var n=$(this),t=n.attr("id");n.on("focus keypress",function(n){handleEnterPressed(n,t)})})});Toggle={OnTrue:function(){var n=$(this).is(":checked");n&&$(this).val()==="True"?$(this).parents(".row").next(".panel-default").show():$(this).parents(".row").next(".panel-default").hide()},OnFalse:function(){var n=$(this).is(":checked");n&&!1?$(this).parents(".row").next(".panel-default").show():$(this).parents(".row").next(".panel-default").hide()},OnAnswerOptionsEnumTrue:function(){var t=$(this).is(":checked"),n=$(this).val();t&&n===!0||n==="True"||n==="1"||n==="Yes"?$(this).parents(".row").next(".panel-default").show():$(this).parents(".row").next(".panel-default").hide()},OnAnswerOptionsEnumFalse:function(){var t=$(this).is(":checked"),n=$(this).val();t&&n===!1||n==="False"||n==="2"||n==="3"||n==="Unknown"||n==="No"?$(this).parents(".row").next(".panel-default").show():$(this).parents(".row").next(".panel-default").hide()}};$(document).ready(function(){$('input:radio[name="HasPhone"]').change(function(){var n=$("#yeshasphone").is(":checked");n?$("#perpetratorphonenumberdata").show():$("#perpetratorphonenumberdata").hide()})});$(document).ready(function(){$('input:radio[name="PrimaryAddressKnown"]').click(function(){var n=$("#yesknownaddress").is(":checked");n?$("#knownperpetratorprimaryaddressdata").show():$("#knownperpetratorprimaryaddressdata").hide()})});$(document).ready(function(){$('input[name="AtPrimaryAddress"]').click(function(){var n=$("#noatprimaryaddress").is(":checked");n?$("#perpetratorcurrentaddressdata").show():$("#perpetratorcurrentaddressdata").hide()})});$(document).ready(function(){$('input:radio[name="HasAlias"]').click(function(){var n=$("#yesalias").is(":checked");n?$("#perpetratorothernamedata").show():$("#perpetratorothernamedata").hide()})});$(document).ready(function(){var n=$('input:radio[name$=".AnotherPerpetratorInvolved"]');$(n).change(function(){checkAnotherPerpetrator($(n))});checkAnotherPerpetrator($(n))});$(document).ready(function(){var n=$('input:radio[name$=".OtherAdultsInHome"]');$(n).change(function(){checkOtherAdultsInHome($(n))});checkOtherAdultsInHome($(n))});$(document).ready(function(){$("[name$=AdultCount]").change(function(n){n.preventDefault();var t=$("[name$=AdultCount] option:selected").text();UpdateOtherAdultsInHome(t);t>0?$("#otheradultsinhomedata").show():$("#otheradultsinhomedata").hide()})});OtherPerpetratorAdult={Initialize:function(){$('input:radio[name$="HasPhone"]').each(function(n,t){$(t).click(Toggle.OnTrue)});$('input:radio[name$="PrimaryAddressKnown"]').each(function(n,t){$(t).click(Toggle.OnTrue)});$('input:radio[name$="AtPrimaryAddress"]').each(function(n,t){$(t).click(Toggle.OnFalse)});$('input:radio[name$="HasAlias"]').each(function(n,t){$(t).click(Toggle.OnTrue)});$('input:radio[name$="AnotherPerpetratorInvolved"]').each(function(n,t){$(t).click(Toggle.OnTrue)});$('input:radio[name$="OtherAdultsInHome"]').each(function(n,t){$(t).click(Toggle.OnTrue)})}};$(document).ready(function(){$("#OtherPerpetratorForm,#CreateOtherPerpetratorForm,#EditOtherPerpetratorForm").length&&OtherPerpetratorAdult.Initialize()});$(document).ready(function(){showHideIncidentInfoAddress();$("input[name='IncidentAtChildPrimary']").click(showHideIncidentInfoAddress);$("input[name='IncidentAtFacility']").click(showHideIncidentInfoAddress)});$(document).ready(function(){$('input:radio[name="DetailsFromAnotherPerson"]').click(function(){var n=$("#yesdetailsfromfromanother").is(":checked");n?$("#additionalinfoheardfromdata").show():$("#additionalinfoheardfromdata").hide()})});$(document).ready(function(){$('input[type="number"]').each(function(n,t){$(t).keydown(checkKey);$(t).keyup(checkKey)})});postedToServer=0;const monthMap={January:"01",February:"02",March:"03",April:"04",May:"05",June:"06",July:"07",August:"08",September:"09",October:"10",November:"11",December:"12"};$(document).ready(function(){$("#selecteddate").change(function(){calculateAge("dob")});$("#IsNameUnknown").on("click",function(){var n=$("#IsNameUnknown").is(":checked");populateIsNameUnknown(n)});$('input[name="FirstName"]').on("input",function(){$("#IsNameUnknown").prop("checked",!1)});$('input[name="LastName"]').on("input",function(){$("#IsNameUnknown").prop("checked",!1)});$('input[name="PrimaryZip"]').on("input",function(){var n=$(this).val();n=n.replace(/^(\d{5})(\d{1,4})$/,"$1-$2");$(this).val(n);$(this).attr("maxlength",10)});$('input[name="PhoneExtension"]').on("input",function(){var n=6,t=$(this).val();t.length>n&&$(this).val(t.slice(0,n))});$('input[name="AdditionalPhoneExtension"]').on("input",function(){var n=6,t=$(this).val();t.length>n&&$(this).val(t.slice(0,n))});$('input[name="CurrentZip"]').on("input",function(){var n=$(this).val();n=n.replace(/^(\d{5})(\d{1,4})$/,"$1-$2");$(this).val(n)});$('input[name="IncidentZip"]').on("input",function(){var n=$(this).val();n=n.replace(/^(\d{5})(\d{1,4})$/,"$1-$2");$(this).val(n)});$('input[name="Zip"]').on("input",function(){var n=$(this).val();n=n.replace(/^(\d{5})(\d{1,4})$/,"$1-$2");$(this).val(n)});$('input[type="radio"]').each(function(){var n=$(this),t=n.attr("id");n.on("focus keypress",function(n){handleRadioButtonEnterPressed(n,t)})});$('input[type="checkbox"]').each(function(){var n=$(this),t=n.attr("id");n.on("focus keypress",function(n){handleCheckBoxEnterPressed(n,t)})});$('input[name="DateOfBirth"]').each(function(){var n=$(this),t=n.attr("id");n.on("focus keypress",function(n){handleDateTimeEnterPressed(n,t)})});$("#AdminSubmissions").attr("title","Admin Submissions");document.readyState!=="loading"?setTabIndexAutomatically():document.addEventListener("DOMContentLoaded",setTabIndexAutomatically);setTimeout(function(){$("#IsNameUnknown").focus()},0)}),function(n){var t={validClass:"has-success",errorClass:"has-error",highlight:function(t,i,r){n(t).closest(".form-group").removeClass(r).addClass(i)},unhighlight:function(t,i){n(t).closest(".form-group").removeClass(i)}};n.validator.setDefaults(t);n.validator.unobtrusive!=undefined&&(n.validator.unobtrusive.options={errorClass:t.errorClass,validClass:t.validClass})}(jQuery),function(n){n.fn.resetValidation=function(){var t=this.closest("form");return t.validate().resetForm(),t.find("[data-valmsg-summary=true]").removeClass("validation-summary-errors").addClass("validation-summary-valid").find("ul").empty(),t.find("[data-valmsg-replace]").removeClass("field-validation-error").addClass("field-validation-valid").empty(),n(".form-group").removeClass("has-error"),t};n.fn.formReset=function(n){var t=this.closest("form");return t[0].reset(),(n==undefined||n)&&t.resetValidation(),t}}(jQuery);"use strict";var _extends=Object.assign||function(n){for(var i,r,t=1;t<arguments.length;t++){i=arguments[t];for(r in i)Object.prototype.hasOwnProperty.call(i,r)&&(n[r]=i[r])}return n},_createClass=function(){function n(n,t){for(var i,r=0;r<t.length;r++)i=t[r],i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(n,i.key,i)}return function(t,i,r){return i&&n(t.prototype,i),r&&n(t,r),t}}(),_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(n){return typeof n}:function(n){return n&&"function"==typeof Symbol&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n};!function(n,t,i){"function"==typeof define&&define.amd?define(["jquery"],function(r){return n(t,i,r)}):"object"===("undefined"==typeof module?"undefined":_typeof(module))&&module.exports?module.exports=n(t,i,require("jquery")):n(t,i,jQuery)}(function(n,t,i){var r=function(){function i(t){_classCallCheck(this,i);this.ctx=t;this.ie=!1;var r=n.navigator.userAgent;(r.indexOf("MSIE")>-1||r.indexOf("Trident")>-1)&&(this.ie=!0)}return _createClass(i,[{key:"log",value:function(n){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"debug",t=this.opt.log;this.opt.debug&&"object"===("undefined"==typeof t?"undefined":_typeof(t))&&"function"==typeof t[i]&&t[i]("mark.js: "+n)}},{key:"escapeStr",value:function(n){return n.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}},{key:"createRegExp",value:function(n){return n=this.escapeStr(n),Object.keys(this.opt.synonyms).length&&(n=this.createSynonymsRegExp(n)),this.opt.ignoreJoiners&&(n=this.setupIgnoreJoinersRegExp(n)),this.opt.diacritics&&(n=this.createDiacriticsRegExp(n)),n=this.createMergedBlanksRegExp(n),this.opt.ignoreJoiners&&(n=this.createIgnoreJoinersRegExp(n)),n=this.createAccuracyRegExp(n)}},{key:"createSynonymsRegExp",value:function(n){var t=this.opt.synonyms,f=this.opt.caseSensitive?"":"i";for(var i in t)if(t.hasOwnProperty(i)){var e=t[i],r=this.escapeStr(i),u=this.escapeStr(e);""!==r&&""!==u&&(n=n.replace(new RegExp("("+r+"|"+u+")","gm"+f),"("+r+"|"+u+")"))}return n}},{key:"setupIgnoreJoinersRegExp",value:function(n){return n.replace(/[^(|)\\]/g,function(n,t,i){var r=i.charAt(t+1);return/[(|)\\]/.test(r)||""===r?n:n+"\0"})}},{key:"createIgnoreJoinersRegExp",value:function(n){return n.split("\0").join("[\\u00ad|\\u200b|\\u200c|\\u200d]?")}},{key:"createDiacriticsRegExp",value:function(n){var i=this.opt.caseSensitive?"":"i",r=this.opt.caseSensitive?["aàáâãäåāąă","AÀÁÂÃÄÅĀĄĂ","cçćč","CÇĆČ","dđď","DĐĎ","eèéêëěēę","EÈÉÊËĚĒĘ","iìíîïī","IÌÍÎÏĪ","lł","LŁ","nñňń","NÑŇŃ","oòóôõöøō","OÒÓÔÕÖØŌ","rř","RŘ","sšśșş","SŠŚȘŞ","tťțţ","TŤȚŢ","uùúûüůū","UÙÚÛÜŮŪ","yÿý","YŸÝ","zžżź","ZŽŻŹ"]:["aàáâãäåāąăAÀÁÂÃÄÅĀĄĂ","cçćčCÇĆČ","dđďDĐĎ","eèéêëěēęEÈÉÊËĚĒĘ","iìíîïīIÌÍÎÏĪ","lłLŁ","nñňńNÑŇŃ","oòóôõöøōOÒÓÔÕÖØŌ","rřRŘ","sšśșşSŠŚȘŞ","tťțţTŤȚŢ","uùúûüůūUÙÚÛÜŮŪ","yÿýYŸÝ","zžżźZŽŻŹ"],t=[];return n.split("").forEach(function(u){r.every(function(r){if(r.indexOf(u)!==-1){if(t.indexOf(r)>-1)return!1;n=n.replace(new RegExp("["+r+"]","gm"+i),"["+r+"]");t.push(r)}return!0})}),n}},{key:"createMergedBlanksRegExp",value:function(n){return n.replace(/[\s]+/gim,"[\\s]+")}},{key:"createAccuracyRegExp",value:function(n){var r=this,i=this.opt.accuracy,u="string"==typeof i?i:i.value,f="string"==typeof i?[]:i.limiters,t="";switch(f.forEach(function(n){t+="|"+r.escapeStr(n)}),u){case"partially":default:return"()("+n+")";case"complementary":return t="\\s"+(t?t:this.escapeStr("!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~¡¿")),"()([^"+t+"]*"+n+"[^"+t+"]*)";case"exactly":return"(^|\\s"+t+")("+n+")(?=$|\\s"+t+")"}}},{key:"getSeparatedKeywords",value:function(n){var i=this,t=[];return n.forEach(function(n){i.opt.separateWordSearch?n.split(" ").forEach(function(n){n.trim()&&t.indexOf(n)===-1&&t.push(n)}):n.trim()&&t.indexOf(n)===-1&&t.push(n)}),{keywords:t.sort(function(n,t){return t.length-n.length}),length:t.length}}},{key:"getTextNodes",value:function(n){var r=this,t="",i=[];this.iterator.forEachNode(NodeFilter.SHOW_TEXT,function(n){i.push({start:t.length,end:(t+=n.textContent).length,node:n})},function(n){return r.matchesExclude(n.parentNode)?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT},function(){n({value:t,nodes:i})})}},{key:"matchesExclude",value:function(n){return u.matches(n,this.opt.exclude.concat(["script","style","title","head","html"]))}},{key:"wrapRangeInTextNode",value:function(n,i,r){var e=this.opt.element?this.opt.element:"mark",u=n.splitText(i),o=u.splitText(r-i),f=t.createElement(e);return f.setAttribute("data-markjs","true"),this.opt.className&&f.setAttribute("class",this.opt.className),f.textContent=u.textContent,u.parentNode.replaceChild(f,u),o}},{key:"wrapRangeInMappedTextNode",value:function(n,t,i,r,u){var f=this;n.nodes.every(function(e,o){var h=n.nodes[o+1],s;return("undefined"==typeof h||h.start>t)&&(s=function(){if(!r(e.node))return{v:!1};var h=t-e.start,s=(i>e.end?e.end:i)-e.start,c=n.value.substr(0,e.start),l=n.value.substr(s+e.start);return e.node=f.wrapRangeInTextNode(e.node,h,s),n.value=c+l,n.nodes.forEach(function(t,i){i>=o&&(n.nodes[i].start>0&&i!==o&&(n.nodes[i].start-=s),n.nodes[i].end-=s)}),i-=s,u(e.node.previousSibling,e.start),i>e.end?void(t=e.end):{v:!1}}(),"object"===("undefined"==typeof s?"undefined":_typeof(s)))?s.v:!0})}},{key:"wrapMatches",value:function(n,t,i,r,u){var e=this,f=0===t?0:t+1;this.getTextNodes(function(t){t.nodes.forEach(function(t){var u,o,s;for(t=t.node,u=void 0;null!==(u=n.exec(t.textContent))&&""!==u[f];)if(i(u[f],t)){if(o=u.index,0!==f)for(s=1;s<f;s++)o+=u[s].length;t=e.wrapRangeInTextNode(t,o,o+u[f].length);r(t.previousSibling);n.lastIndex=0}});u()})}},{key:"wrapMatchesAcrossElements",value:function(n,t,i,r,u){var e=this,f=0===t?0:t+1;this.getTextNodes(function(t){for(var s,h,c,o=void 0;null!==(o=n.exec(t.value))&&""!==o[f];){if(s=o.index,0!==f)for(h=1;h<f;h++)s+=o[h].length;c=s+o[f].length;e.wrapRangeInMappedTextNode(t,s,c,function(n){return i(o[f],n)},function(t,i){n.lastIndex=i;r(t)})}u()})}},{key:"unwrapMatches",value:function(n){for(var i=n.parentNode,r=t.createDocumentFragment();n.firstChild;)r.appendChild(n.removeChild(n.firstChild));i.replaceChild(r,n);this.ie?this.normalizeTextNode(i):i.normalize()}},{key:"normalizeTextNode",value:function(n){if(n){if(3===n.nodeType)for(;n.nextSibling&&3===n.nextSibling.nodeType;)n.nodeValue+=n.nextSibling.nodeValue,n.parentNode.removeChild(n.nextSibling);else this.normalizeTextNode(n.firstChild);this.normalizeTextNode(n.nextSibling)}}},{key:"markRegExp",value:function(n,t){var i=this;this.opt=t;this.log('Searching with expression "'+n+'"');var r=0,u="wrapMatches",f=function(n){r++;i.opt.each(n)};this.opt.acrossElements&&(u="wrapMatchesAcrossElements");this[u](n,this.opt.ignoreGroups,function(n,t){return i.opt.filter(t,n,r)},f,function(){0===r&&i.opt.noMatch(n);i.opt.done(r)})}},{key:"mark",value:function(n,t){var i=this;this.opt=t;var r=0,f="wrapMatches",e=this.getSeparatedKeywords("string"==typeof n?[n]:n),u=e.keywords,o=e.length,s=this.opt.caseSensitive?"":"i",h=function n(t){var h=new RegExp(i.createRegExp(t),"gm"+s),e=0;i.log('Searching with expression "'+h+'"');i[f](h,1,function(n,u){return i.opt.filter(u,t,r,e)},function(n){e++;r++;i.opt.each(n)},function(){0===e&&i.opt.noMatch(t);u[o-1]===t?i.opt.done(r):n(u[u.indexOf(t)+1])})};this.opt.acrossElements&&(f="wrapMatchesAcrossElements");0===o?this.opt.done(r):h(u[0])}},{key:"unmark",value:function(n){var i=this,t;this.opt=n;t=this.opt.element?this.opt.element:"*";t+="[data-markjs]";this.opt.className&&(t+="."+this.opt.className);this.log('Removal selector "'+t+'"');this.iterator.forEachNode(NodeFilter.SHOW_ELEMENT,function(n){i.unwrapMatches(n)},function(n){var r=u.matches(n,t),f=i.matchesExclude(n);return!r||f?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT},this.opt.done)}},{key:"opt",set:function(t){this._opt=_extends({},{element:"",className:"",exclude:[],iframes:!1,iframesTimeout:5e3,separateWordSearch:!0,diacritics:!0,synonyms:{},accuracy:"partially",acrossElements:!1,caseSensitive:!1,ignoreJoiners:!1,ignoreGroups:0,each:function(){},noMatch:function(){},filter:function(){return!0},done:function(){},debug:!1,log:n.console},t)},get:function(){return this._opt}},{key:"iterator",get:function(){return this._iterator||(this._iterator=new u(this.ctx,this.opt.iframes,this.opt.exclude,this.opt.iframesTimeout)),this._iterator}}]),i}(),u=function(){function n(t){var i=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],u=arguments.length>3&&void 0!==arguments[3]?arguments[3]:5e3;_classCallCheck(this,n);this.ctx=t;this.iframes=i;this.exclude=r;this.iframesTimeout=u}return _createClass(n,[{key:"getContexts",value:function(){var i=void 0,n=[];return i="undefined"!=typeof this.ctx&&this.ctx?NodeList.prototype.isPrototypeOf(this.ctx)?Array.prototype.slice.call(this.ctx):Array.isArray(this.ctx)?this.ctx:"string"==typeof this.ctx?Array.prototype.slice.call(t.querySelectorAll(this.ctx)):[this.ctx]:[],i.forEach(function(t){var i=n.filter(function(n){return n.contains(t)}).length>0;n.indexOf(t)!==-1||i||n.push(t)}),n}},{key:"getIframeContents",value:function(n,t){var u=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){},i=void 0,r;try{if(r=n.contentWindow,i=r.document,!r||!i)throw new Error("iframe inaccessible");}catch(n){u()}i&&t(i)}},{key:"isIframeBlank",value:function(n){var t="about:blank",i=n.getAttribute("src").trim(),r=n.contentWindow.location.href;return r===t&&i!==t&&i}},{key:"observeIframeLoad",value:function(n,t,i){var u=this,f=!1,e=null,r=function r(){if(!f){f=!0;clearTimeout(e);try{u.isIframeBlank(n)||(n.removeEventListener("load",r),u.getIframeContents(n,t,i))}catch(n){i()}}};n.addEventListener("load",r);e=setTimeout(r,this.iframesTimeout)}},{key:"onIframeReady",value:function(n,t,i){try{"complete"===n.contentWindow.document.readyState?this.isIframeBlank(n)?this.observeIframeLoad(n,t,i):this.getIframeContents(n,t,i):this.observeIframeLoad(n,t,i)}catch(n){i()}}},{key:"waitForIframes",value:function(n,t){var r=this,i=0;this.forEachIframe(n,function(){return!0},function(n){i++;r.waitForIframes(n.querySelector("html"),function(){--i||t()})},function(n){n||t()})}},{key:"forEachIframe",value:function(t,i,r){var e=this,h=arguments.length>3&&void 0!==arguments[3]?arguments[3]:function(){},f=t.querySelectorAll("iframe"),o=f.length,s=0,u;f=Array.prototype.slice.call(f);u=function(){--o<=0&&h(s)};o||u();f.forEach(function(t){n.matches(t,e.exclude)?u():e.onIframeReady(t,function(n){i(t)&&(s++,r(n));u()},u)})}},{key:"createIterator",value:function(n,i,r){return t.createNodeIterator(n,i,r,!1)}},{key:"createInstanceOnIframe",value:function(t){return new n(t.querySelector("html"),this.iframes)}},{key:"compareNodeIframe",value:function(n,t,i){var f=n.compareDocumentPosition(i),e=Node.DOCUMENT_POSITION_PRECEDING,r,u;return f&e&&(null===t||(r=t.compareDocumentPosition(i),u=Node.DOCUMENT_POSITION_FOLLOWING,r&u))?!0:!1}},{key:"getIteratorNode",value:function(n){var t=n.previousNode(),i=void 0;return i=null===t?n.nextNode():n.nextNode()&&n.nextNode(),{prevNode:t,node:i}}},{key:"checkIframeFilter",value:function(n,t,i,r){var u=!1,f=!1;return r.forEach(function(n,t){n.val===i&&(u=t,f=n.handled)}),this.compareNodeIframe(n,t,i)?(u!==!1||f?u===!1||f||(r[u].handled=!0):r.push({val:i,handled:!0}),!0):(u===!1&&r.push({val:i,handled:!1}),!1)}},{key:"handleOpenIframes",value:function(n,t,i,r){var u=this;n.forEach(function(n){n.handled||u.getIframeContents(n.val,function(n){u.createInstanceOnIframe(n).forEachNode(t,i,r)})})}},{key:"iterateThroughNodes",value:function(n,t,i,r,u){for(var f=this,c=this.createIterator(t,n,r),o=[],s=[],e=void 0,h=void 0,l=function(){var n=f.getIteratorNode(c);return h=n.prevNode,e=n.node};l();)this.iframes&&this.forEachIframe(t,function(n){return f.checkIframeFilter(e,h,n,o)},function(t){f.createInstanceOnIframe(t).forEachNode(n,i,r)}),s.push(e);s.forEach(function(n){i(n)});this.iframes&&this.handleOpenIframes(o,n,i,r);u()}},{key:"forEachNode",value:function(n,t,i){var r=this,u=arguments.length>3&&void 0!==arguments[3]?arguments[3]:function(){},f=this.getContexts(),e=f.length;e||u();f.forEach(function(f){var o=function(){r.iterateThroughNodes(n,f,t,i,function(){--e<=0&&u()})};r.iframes?r.waitForIframes(f,o):o()})}}],[{key:"matches",value:function(n,t){var u="string"==typeof t?[t]:t,r=n.matches||n.matchesSelector||n.msMatchesSelector||n.mozMatchesSelector||n.oMatchesSelector||n.webkitMatchesSelector,i;return r?(i=!1,u.every(function(t){return!r.call(n,t)||(i=!0,!1)}),i):!1}}]),n}();return i.fn.mark=function(n,t){return new r(this.get()).mark(n,t),this},i.fn.markRegExp=function(n,t){return new r(this.get()).markRegExp(n,t),this},i.fn.unmark=function(n){return new r(this.get()).unmark(n),this},i},window,document);_createClass=function(){function n(n,t){for(var i,r=0;r<t.length;r++)i=t[r],i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(n,i.key,i)}return function(t,i,r){return i&&n(t.prototype,i),r&&n(t,r),t}}();_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(n){return typeof n}:function(n){return n&&"function"==typeof Symbol&&n.constructor===Symbol?"symbol":typeof n};!function(n,t,i){"function"==typeof define&&define.amd?define(["jquery","datatables.net","markjs"],function(r){return n(t,i,r)}):"object"===("undefined"==typeof exports?"undefined":_typeof(exports))?(require("datatables.net"),require("markjs"),n(t,i,require("jquery"))):n(t,i,jQuery)}(function(n,t,i){var r=function(){function n(t,r){if(_classCallCheck(this,n),"function"!=typeof i.fn.mark||"function"!=typeof i.fn.unmark)throw new Error("jquery.mark.js is necessary for datatables.mark.js");this.instance=t;this.options="object"===("undefined"==typeof r?"undefined":_typeof(r))?r:{};this.intervalThreshold=49;this.intervalMs=300;this.initMarkListener()}return _createClass(n,[{key:"initMarkListener",value:function(){var n=this,t="draw.dt.dth column-visibility.dt.dth column-reorder.dt.dth",i=null;this.instance.on(t,function(){var t=n.instance.rows({filter:"applied",page:"current"}).nodes().length;t>n.intervalThreshold?(clearTimeout(i),i=setTimeout(function(){n.mark()},n.intervalMs)):n.mark()});this.instance.on("destroy",function(){n.instance.off(t)});this.mark()}},{key:"mark",value:function(){var n=this,t=this.instance.search();i(this.instance.table().body()).unmark(this.options);this.instance.columns({search:"applied",page:"current"}).nodes().each(function(r,u){var e=n.instance.column(u).search(),f=e||t;f&&r.forEach(function(t){i(t).mark(f,n.options)})})}}]),n}();i(t).on("init.dt.dth",function(n,t){if("dt"===n.namespace){var f=i.fn.dataTable.Api(t),u=null;f.init().mark?u=f.init().mark:i.fn.dataTable.defaults.mark&&(u=i.fn.dataTable.defaults.mark);null!==u&&new r(f,u)}})},window,document)