text: var address,array,classCSS,checklist,content,control,data,exitAfterSave,field,fieldID,form,functionName,id,newAfterSave,options,page,pageTitle,pre_text,ref,rowid,text,url,userid,value,zipControl;!function($){$.unserialize=function(serializedString){for(var str,pairs=decodeURI(serializedString).split("&"),obj={},p,idx,val,i=0,n=pairs.length;i<n;i++)if((idx=(p=pairs[i].split("="))[0]).indexOf("[]")==idx.length-2){var ind=idx.substring(0,idx.length-2);void 0===obj[ind]&&(obj[ind]=[]),obj[ind].push(p[1])}else obj[idx]=p[1];return obj}}(jQuery);var count,exito,margin,percent,price,price_min,price_org,qtd,result,sum,sumMG,sumPC,sumTT,total,valor=0,prefix="R$ ",thousands=".",decimal=",",precision=2,allowNegative=!0,translate=new Array,icon;function checkNotNull(term){return"undefined"!==(term=(term=$.trim(term)).replace(/\s+/g,""))&&void 0!==term&&"NaN"!==term&&""!==term&&" "!==term&&!1!==term&&null!==term&&0!=term}function checkIsNull(term){return"undefined"===(term=(term=$.trim(term)).replace(/\s+/g,""))||void 0===term||"NaN"===term||""===term||" "===term||!1===term||null===term||0==term}function sa(type,title,text,timer,callbackFunction,callbackParams,showProgressbar){"success"===type&&(icon="fas fa-check-circle"),"danger"!==type&&"error"!==type||(icon="fas fa-exclamation-circle","error"===type&&(type="danger")),"warning"===type&&(icon="fas fa-exclamation-triangle"),"info"===type&&(icon="fas fa-info-circle"),$.notify({title:"<strong>"+title+"</strong>",message:"<br />"+text,icon:icon},{element:"body",type:type,allow_dismiss:!0,newest_on_top:!1,showProgressbar:showProgressbar,placement:{from:"top",align:"right"},offset:20,spacing:10,z_index:1031,delay:3300,timer:timer,url_target:"_blank",mouse_over:null,animate:{enter:"animated zoomInDown",exit:"animated zoomOutUp"},onShow:null,onShown:null,onClose:null,onClosed:null,icon_type:"class"}),"string"==typeof callbackFunction&&"function"==typeof window[callbackFunction]&&window[callbackFunction](callbackParams)}translate.confirmButtonText="OK",translate.cancelButtonText="Cancelar",translate.titles_error="Erro",translate.titles_success="Sucesso",translate.titles_warning="Cuidado",translate.label_yes="Sim",translate.label_no="Não",translate.global_neterror="Houve um erro de rede durante o processamento da sua solicitação.",translate.error_fill_filed="Todos os campos devem ser preenchidos.",translate.error_formsubmit="Houve um erro ao processar seu formulário.",translate.login_error="Houve um erro ao processar seu login.",translate.save_error="Houve um erro ao salvar seus dados.",translate.txt_pwdSuccess="E-mail de recuperação de senha enviado com sucesso.<br />Por favor, verifique sua caixa de entrada para obter instruções.",translate.txt_pwdError="Houve um erro ao enviar o email de recuperação de senha. Por favor, <a href='#' class='recoverPWD abortDT'>tente novamente</a>.";const swalBootstrapButtons=Swal.mixin({customClass:{confirmButton:"btn btn-success btn-js",cancelButton:"btn btn-danger btn-js"},buttonsStyling:!1});function sad(type,title,text,confirmButtonText,cancelButtonText,callbackFunction,callbackParams){checkIsNull(confirmButtonText)&&(confirmButtonText="OK"),checkIsNull(cancelButtonText)&&(cancelButtonText="Cancelar"),swalBootstrapButtons.fire({title:title,text:text,type:type,showCancelButton:!0,confirmButtonText:confirmButtonText,cancelButtonText:cancelButtonText,reverseButtons:!1}).then((function(result){return result.value?("sendForm"===callbackFunction?window[callbackFunction](callbackParams[0],callbackParams[1],callbackParams[2],callbackParams[3],callbackParams[4],callbackParams[5]):checkNotNull(callbackFunction)&&window[callbackFunction](callbackParams),!0):result.dismiss!==Swal.DismissReason.cancel&&void 0}))}function humanFileSize(bytes,si=!1,dp=1){const thresh=si?1e3:1024;if(Math.abs(bytes)<thresh)return bytes+" B";const units=si?["kB","MB","GB","TB","PB","EB","ZB","YB"]:["KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"];let u=-1;const r=10**dp;do{bytes/=thresh,++u}while(Math.round(Math.abs(bytes)*r)/r>=thresh&&u<units.length-1);return bytes.toFixed(dp)+" "+units[u]}function sendForm(form,path,target,allertSuccess,allertError,validate,type){if(form=$.trim(form),path=$.trim(path),checkIsNull(type)&&(type="POST"),checkNotNull(form)&&checkNotNull(path))if(!0===(validate=!validate||validate_form(form))){var formData=new FormData($(form)[0]);$.ajax({url:basePath+path,type:type,typeData:"json",data:formData,contentType:!1,cache:!1,processData:!1,success:function(data){console.log(data),"success"===data.status?(!0===allertSuccess?"download"!==target&&sa("success",translate.titles_success,data.message,1e3,"succesReturn",[target,data]):succesReturn([target,data]),setTimeout((function(){$(form).removeClass("was-validated")}),1100)):"download"!=target&&("error"===data.status&&!0===data.warning?sa("warning",translate.titles_warning,data.message,2e3,"errorReturn",[target,data]):"error"===data.status?sa("error",translate.titles_error,data.message,2e3,"errorReturn",[target,data]):sa("error",translate.titles_error,translate.global_neterror,3500))},error:function(data){document.title=pageTitle,"download"!=target&&sa("error",translate.titles_error,translate.save_error,3500)}}).fail((function(){document.title=pageTitle,"download"!=target&&sa("error",translate.titles_error,translate.global_neterror,3500)}))}else"download"!=target&&sa("error",translate.titles_error,translate.error_fill_filed,2e3);else"download"!=target&&sa("error",translate.titles_error,translate.error_formsubmit,3500)}function validate_form(form){var result=new Array,i=0,itemiD,returned;return $("input").hasClass("validate")||$("select").hasClass("validate")||$("textarea").hasClass("validate")?($(form+" .validate").each((function(){itemiD=$(this).attr("id"),content=$.trim($("#"+itemiD).val()),$(form).addClass("was-validated"),result[i]=""!==content&&null!==content,checkNotNull(content)?result[i]=!0:result[i]=!1,i++})),$.each(result,(function(i,e){!1===e&&(returned=!1),!1!==returned&&(returned=!0)}))):returned=!0,returned}function reset_form(form){$("#"+form).each((function(){this.reset()}))}function succesReturn(params,sweetReturn){switch(target=params[0].split("#"),functionName=target[1],target=target[0],parameters=params[1],console.log("S.target",target),console.log("S.functionName",functionName),console.log("S.parameters",parameters),console.log("S.sweetReturn",sweetReturn),target){case"use_function":window[functionName](parameters.data,parameters.status,sweetReturn);break;case"generateSummary":CKEDITOR.instances.summary.setData(parameters.text),void 0===parameters.newtext&&null===parameters.newtext||CKEDITOR.instances.content.setData(parameters.newtext);break;case"getcnpj":zipPrefix=parameters.data.zipPrefix?parameters.data.zipPrefix:"",zipControl=parameters.data.zipControl?parameters.data.zipControl:"",$("#"+zipPrefix+"company"+zipControl).val(parameters.data.nome_fantasia),$("#"+zipPrefix+"zipcode"+zipControl).val(parameters.data.cep),$("#"+zipPrefix+"number").val(parameters.data.numero),$("#"+zipPrefix+"complement").val(parameters.data.complemento),searchZipcode(parameters.data.cep,zipPrefix,zipControl,country_id);break;case"zipcode":zipPrefix=parameters.data.zipPrefix?parameters.data.zipPrefix:"",zipControl=parameters.data.zipControl?parameters.data.zipControl:"",$("#"+zipPrefix+"ibge"+zipControl).val(parameters.data.ibge),$("#"+zipPrefix+"siafi"+zipControl).val(parameters.data.siafi),$("#"+zipPrefix+"public_place"+zipControl).val(parameters.data.public_place),$("#"+zipPrefix+"address"+zipControl).val(parameters.data.address),$("#"+zipPrefix+"district"+zipControl).val(parameters.data.district),$("#"+zipPrefix+"city"+zipControl).val(parameters.data.city),$("#"+zipPrefix+"state"+zipControl).val(parameters.data.state),$("#"+zipPrefix+"address_number"+zipControl).focus();break;case"modalInsert":$("#modalTemplateBody").html(parameters.data),$("#modalTemplateTitle").html(parameters.modal_title),$("#modalTemplate .modal-content").replaceClass("md-","md-135x7"),$("#modalTemplate").show();break;case"societe_business_sales":$("#fk_soc").val(parameters.data.lastid),$("#search_fk_soc").val(parameters.data.name),$("#modalTemplate").hide();break;case"contact_business_sales":$("#fk_cnt").val(parameters.data.lastid),$("#search_fk_cnt").val(parameters.data.name),$("#modalTemplate").hide();break;default:return!1}}function use_function_tpl(data,status,sweetReturn){return"success"==status}function errorReturn(params,sweetReturn){switch(target=params[0].split("#"),functionName=target[1],target=target[0],parameters=params[1],target){case"use_function":window[functionName](parameters.data,parameters.status,sweetReturn);break;case"singup":$("#nsReturn").html(parameters.messageLink),$("#singupModal").modal("hide");break;default:return $(parameters.focus).focus(),!1}}function clearAjaxForm(){$("#methodAjaxForm").val("openModal"),$("#fieldsAjaxForm").html("")}function convertFormToJSON(form){return $.each(array,(function(){json[this.name]=this.value})),json}function closeModal(id){checkNotNull(id)?reset_form(id):($("#methodAjaxForm").val("openModal"),$("#modalTemplate .modal-content").replaceClass("md-","md-7x5"),$("#genericButtonView").addClass("hidden"),$("#genericLinkView").addClass("hidden"),$("#genericLinkModalTemplate").addClass("abortDT"),$("#genericLinkModalTemplate").removeAttr("target"),$("#genericLinkModalTemplate").attr("href","#").attr("title","").html(""),$("#genericButtonModalTemplate").html(""),$("#saveButtonView").removeClass("hidden")),$("#_method").remove(),$(".modal").modal("hide")}function abortDTAjax(){if("undefined"!=typeof $&&$.fn.dataTable)for(var all_settings=$($.fn.dataTable.tables()).DataTable().settings(),i=0,settings;settings=all_settings[i];++i)settings.jqXHR&&settings.jqXHR.abort()}function ucFirst(str){var text,parts=str.split(" "),len=parts.length,i,words=[];for(i=0;i<len;i++){var part=parts[i],first,rest,word=part[0].toUpperCase()+part.substring(1,part.length);words.push(word)}return words.join(" ")}function check_cnpj(cnpj,field){var cnpj,digit,dv,result;if(checkIsNull(cnpj=cnpj.replace(/[^\d]+/g,"")))return sa("warning","Cuidado!","CNPJ embranco, preencha-o"),$(field).val("").focus(),!1;if("00000000000000"==cnpj||"11111111111111"==cnpj||"22222222222222"==cnpj||"33333333333333"==cnpj||"44444444444444"==cnpj||"55555555555555"==cnpj||"66666666666666"==cnpj||"77777777777777"==cnpj||"88888888888888"==cnpj||"99999999999999"==cnpj)return sa("warning","Cuidado!","CNPJ inválido"),$(field).val("").focus(),!1;for(digit=cnpj.substr(0,12),dv=cnpj.substr(12,2),result=0,i=0;i<12;i++)result+=digit.charAt(11-i)*(2+i%8);if(0==result)return sa("error","Erro","Erro ao validar este CNPJ"),!1;if((result=11-result%11)>9&&(result=0),dv.charAt(0)!=result)return sa("warning","Cuidado!","CNPJ inválidoCNPJ inválido"),$(field).val("").focus(),!1;for(result*=2,i=0;i<12;i++)result+=digit.charAt(11-i)*(2+(i+1)%8);return(result=11-result%11)>9&&(result=0),dv.charAt(1)==result||(sa("warning","Cuidado!","CNPJ inválido"),$(field).val("").focus(),!1)}function check_cpf(cpf,field){var position,result,dv,dv_informed,digit=new Array(10);for(zipPrefix="",zipControl="",dv_informed=(cpf=cpf.replace(/\D/g,"")).substr(9,2),i=0;i<=8;i++)digit[i]=cpf.substr(i,1);for(position=10,result=0,i=0;i<=8;i++)result+=digit[i]*position,position-=1;for(digit[9]=result%11,digit[9]<2?digit[9]=0:digit[9]=11-digit[9],position=11,result=0,i=0;i<=9;i++)result+=digit[i]*position,position-=1;if(digit[10]=result%11,digit[10]<2?digit[10]=0:digit[10]=11-digit[10],(dv=10*digit[9]+digit[10])!=dv_informed)return sa("warning","Cuidado!","CPF inválido"),$(field).val("").focus(),!1}function searchCNPJ(cnpj,zipPrefix,zipControl,country_id){checkNotNull(cnpj)?($("#methodAjaxForm").val("zipcode"),$("#fieldsAjaxForm").html(`${generate_input(cnpj,{name:"cnpj",type:"hidden"})}\n${generate_input(country_id,{name:"country_id",type:"hidden"})}\n${generate_input(zipPrefix,{name:"zipPrefix",type:"hidden"})}${generate_input(zipControl,{name:"zipControl",type:"hidden"})}`),sendForm("#sendAjaxForm","api/search/getCNPJ","getcnpj",!0,!0,!1)):sa("error","","Você deve informar um CEP para prosseguir com a busca",1500)}function searchZipcode(zipcode,zipPrefix,zipControl,country_id){checkNotNull(zipcode)?($("#methodAjaxForm").val("zipcode"),$("#fieldsAjaxForm").html(`${generate_input(zipcode,{name:"zipcode",type:"hidden"})}\n${generate_input(country_id,{name:"country_id",type:"hidden"})}\n${generate_input(zipPrefix,{name:"zipPrefix",type:"hidden"})}${generate_input(zipControl,{name:"zipControl",type:"hidden"})}`),sendForm("#sendAjaxForm","api/search/getCEP","zipcode",!0,!0,!1)):sa("error","","Você deve informar um CEP para prosseguir com a busca",1500)}function floatValue(val,prefix){var res;return prefix&&checkNotNull(val)&&(val=val.replace(prefix,"")),checkIsNull(val%1)&&checkNotNull(val)&&(val=(val=val.replace(".","")).replace(",",".")),Number(val)}function unfloatValue(val,csDecimal){return val=val.replace(".",",")}function sumValue(vA,vB,csDecimal){return checkIsNull(vA)&&(vA=0),checkIsNull(vB)&&(vB=0),vA=floatValue(vA,prefix),vB=floatValue(vB,prefix),total=vA+vB,csDecimal&&(total=total.toFixed(csDecimal)),unfloatValue(total,csDecimal)}function subtractValue(vA,vB,csDecimal){return checkIsNull(vA)&&(vA=0),checkIsNull(vB)&&(vB=0),vA=floatValue(vA,prefix),vB=floatValue(vB,prefix),total=vA-vB,csDecimal&&(total=total.toFixed(csDecimal)),unfloatValue(total,csDecimal)}function multiplyValue(vA,vB,csDecimal){return checkIsNull(vA)&&(vA=0),checkIsNull(vB)&&(vB=0),vA=floatValue(vA,prefix),vB=floatValue(vB,prefix),total=vA*vB,csDecimal&&(total=total.toFixed(csDecimal)),unfloatValue(total,csDecimal)}function divisionValue(vA,vB,csDecimal){return checkIsNull(vA)&&(vA=0),checkIsNull(vB)&&(vB=0),vA=floatValue(vA,prefix),vB=floatValue(vB,prefix),total=vA/vB,csDecimal&&(total=total.toFixed(csDecimal)),unfloatValue(total,csDecimal)}function getPercentage(vA,vB,csDecimal){return checkIsNull(vA)&&(vA=0),checkIsNull(vB)&&(vB=0),vA=floatValue(vA,prefix),vB=floatValue(vB,prefix),total=100*vB/vA,csDecimal&&(total=total.toFixed(csDecimal)),unfloatValue(total,csDecimal)}function getValuePercent(vA,vB,csDecimal){return checkIsNull(vA)&&(vA=0),checkIsNull(vB)&&(vB=0),vA=floatValue(vA,prefix),vB=floatValue(vB,prefix),total=vA*vB/100,csDecimal&&(total=total.toFixed(csDecimal)),unfloatValue(total,csDecimal)}function checkISbigger(vA,vB){return(vA=floatValue(vA,prefix))>(vB=floatValue(vB,prefix))}function checkISsmall(vA,vB){return(vA=floatValue(vA,prefix))<(vB=floatValue(vB,prefix))}function checkType(nr){return"string"==typeof nr&&nr.match(/(\d+[,.]\d+)/)?"decimal":"string"==typeof nr&&nr.match(/(\d+)/)?"integer":"number"==typeof nr&&(nr%1==0?"integer":"decimal")}function setMaskMoney(){setTimeout((function(){$(".double").trigger("mask.maskMoney"),$(".value").trigger("mask.maskMoney"),$(".price").trigger("mask.maskMoney")}),150)}function generate_input(data,field,label){return content="",checkIsNull(data)&&(data=""),checkIsNull(field.attribute)&&(field.attribute=""),checkNotNull(field.label)&&(content+='<label for="'+field.name+'">'+field.label+"</label>"),content+='<input type="'+field.type+'" id="'+field.name+'" name="'+field.name+'" value="'+data+'"'+field.attribute+" />\n"}function generate_input_array(data,field,label){return content="",$.each(data,(function(i,v){checkIsNull(v)&&(v=""),checkIsNull(field.attribute)&&(field.attribute=""),checkNotNull(field.label)&&(content+='<label for="'+field.name+"_"+i+'">'+field.label+"</label>"),content+='<input type="'+field.type+'" id="'+field.name+"_"+i+'" name="'+field.name+"["+i+']" value="'+v+'"'+field.attribute+" />\n"})),content}function generate_input_array_multi(data,field,label){return content="",checkIsNull(field.attribute)&&(field.attribute=""),$.each(data,(function(k,d){$.each(d,(function(i,v){$.each(v,(function(c,r){checkIsNull(r)&&(r=""),checkNotNull(field.label)&&(content+='<label for="'+field.name+"_"+k+"_"+i+"_"+c+'">'+field.label+"</label>"),content+='<input type="'+field.type+'" id="'+field.name+"_"+k+"_"+i+"_"+c+'" name="'+field.name+"["+k+"]["+i+"]["+c+']" value="'+r+'"'+field.attribute+" />\n"}))}))})),content}function generate_input_array_table(data,field,label){return content="",$.each(data,(function(i,v){checkIsNull(v)&&(v=""),checkIsNull(field.attribute)&&(field.attribute=""),content+="<tr>",content+="<td>",content+='<label for="'+field.name+"_"+i+'">'+label[i]+"</label>",content+="</td>",content+="<td>",content+='<input type="'+field.type+'" id="'+field.name+"_"+i+'" name="'+field.name+"["+i+']" value="'+v+'"'+field.attribute+" />\n",content+="</td></tr>"})),content}function generate_select(data,field,options,label){return content="",checkIsNull(field.attribute)&&(field.attribute=""),checkNotNull(field.label)&&(content+='<label for="'+field.name+'">'+field.label+"</label>"),content+='<select id="'+field.name+'" name="'+field.name+'" '+field.attribute+">",$.each(options,(function(i,v){checkNotNull(v)&&(checkIsNull(v.attribute)&&(v.attribute=""),content+="<option value="+v.value+" "+v.attribute+">"+v.text+"</option>")})),content+="</select>"}function generate_select_table(data,field,options,label){return content="",checkIsNull(field.attribute)&&(field.attribute=""),content+="<tr>",checkNotNull(field.label)&&(content+="<td>",content+='<label for="'+field.name+'">'+field.label+"</label>",content+="</td>"),content+="<td>",content+='<select id="'+field.name+'" name="'+field.name+'" '+field.attribute+">",$.each(options,(function(i,v){checkNotNull(v)&&(checkIsNull(v.attribute)&&(v.attribute=""),content+="<option value="+v.value+" "+v.attribute+">"+v.text+"</option>")})),content+="</select>",content+="</td></tr>"}$.fn.removeClassRegex=function(regex,nClass){return this.removeClass((function(index,css){return(css.match(new RegExp("\\b("+regex+"\\S*)\\b","g"))||[]).join("")}))},$.fn.replaceClass=function(oldClass,newClass){this.removeClass((function(index,css){return(css.match(new RegExp("\\b("+oldClass+"\\S*)\\b","g"))||[]).join("")})),this.addClass(newClass)},$(document).ready((function(){var triggerTabList;$(document).on("click",".abortDT",(function(e){e.preventDefault(),abortDTAjax()})),$(document).on("click",".resetForm",(function(){reset_form($(this).attr("data-form"))})),$(".select2").select2({theme:"bootstrap"}),$(".no_enter").keypress((function(e){if("key"in evt){if("Enter"===e.key||"enter"===e.key)return!1}else if(13==e.which||13==e.keyCode)return!1})),$(document).on("keyup",(function(e){isEscape="key"in e?"Escape"===e.key||"Esc"===e.key:27==e.keyCode,isEscape&&closeModal()})),$(document).on("click",".submitForm",(function(){$("#"+$(this).attr("data-form")).submit()})),$(document).on("click",".openModal",(function(){$("#modalTitle").html($(this).attr("data-title")),$("#"+$(this).attr("data-modal")).modal("show"),reset_form($(this).attr("data-form"))})),$(document).on("click",".close,  .dismiss-modal .modal-close",(function(e){e.preventDefault(),closeModal($(this).attr("data-id"))})),$(document).on("click","#saveFormModalTemplate",(function(){checkIsNull(form=$(this).attr("data-form"))&&(form="modalInsertForm"),sendForm("#"+form,"/custom/lyosolutions/autocomplete.php",$("#modalFormTarget").val(),!1,!0,!0)})),$(document).on("click",".saveFormModal",(function(){form=$(this).attr("data-form"),url=$(this).attr("data-url"),checkIsNull(form)&&(form="modalInsertForm"),sendForm("#"+form,url,$("#modalFormTarget").val(),!1,!0,!0)})),[].slice.call(document.querySelectorAll("#formTab button")).forEach((function(triggerEl){var tabTrigger=new bootstrap.Tab(triggerEl);triggerEl.addEventListener("click",(function(event){event.preventDefault(),tabTrigger.show()}))})),$(".price").maskMoney({prefix:prefix,thousands:thousands,decimal:decimal,precision:precision,allowNegative:allowNegative}),$(".value").maskMoney({thousands:thousands,decimal:decimal,precision:precision,allowNegative:allowNegative}),$(".double").maskMoney({thousands:"",decimal:decimal,precision:precision,allowNegative:allowNegative}),$(document).on("keyup",".cpfMask",(function(){var cpfMaskBehavior=function(val){return val.replace(/\D/g,"").length,"000.000.000-009"},cpfOptions={onKeyPress:function(val,e,field,options){field.mask(cpfMaskBehavior.apply({},arguments),options),14==cpfMaskBehavior.length&&(console.log("CPF",cpfMaskBehavior),check_cpf(cpfMaskBehavior,"#"+$(this).attr("id")))}};$(this).mask(cpfMaskBehavior,cpfOptions)})),$(document).on("keyup",".cnpjMask",(function(){var cnpjMaskBehavior=function(val){return val.replace(/\D/g,"").length,"00.000.000/0000-00"},cnpjpOptions={onKeyPress:function(val,e,field,options){field.mask(cnpjMaskBehavior.apply({},arguments),options),18==cnpjMaskBehavior.length&&(console.log("CNPJ",cpfMaskBehavior),check_cnpj(cnpjMaskBehavior,"#"+$(this).attr("id")))}};$(this).mask(cnpjMaskBehavior,cnpjpOptions)})),$(document).on("keyup",".cepMask",(function(){var zipcodeMaskBehavior=function(val){return"00000-000"},zipcodeOptions={onKeyPress:function(val,e,field,options){field.mask(zipcodeMaskBehavior.apply({},arguments),options)}};$(this).mask(zipcodeMaskBehavior,zipcodeOptions),text=$(this).val()})),$(document).on("keyup",".dateMask",(function(){var dateMaskBehavior=function(val){return"00/00/0000"},dateOptions={onKeyPress:function(val,e,field,options){field.mask(dateMaskBehavior.apply({},arguments),options)}};$(this).mask(dateMaskBehavior,dateOptions)})),$(document).on("keyup",".phoneMask",(function(){var phoneMaskBehavior=function(val){return"99 9999-9999"},phoneOptions={onKeyPress:function(val,e,field,options){field.mask(phoneMaskBehavior.apply({},arguments),options)}};$(this).mask(phoneMaskBehavior,phoneOptions)})),$(document).on("keyup",".cellphoneMask",(function(){var cellphoneMaskBehavior=function(val){return"99 99999-9999"},cellphoneOptions={onKeyPress:function(val,e,field,options){field.mask(cellphoneMaskBehavior.apply({},arguments),options)}};$(this).mask(cellphoneMaskBehavior,cellphoneOptions)})),$(document).on("keyup",".contabilIDMask",(function(){var contMaskBehavior=function(val){return"9.99.99.99.99999"},contOptions={onKeyPress:function(val,e,field,options){field.mask(contMaskBehavior.apply({},arguments),options)}};$(this).mask(contMaskBehavior,contOptions)})),$(document).on("blur",".checkEmail",(function(){id=$(this).attr("id"),checkNotNull($("#"+id).val())&&console.log("Validar email "+$("#"+id).val())})),$(document).on("click",".getCNPJ",(function(){zipPrefix=$(this).attr("zip-prefix"),zipControl=$(this).attr("zip-control"),country_id="3469034",searchCNPJ($("#"+zipPrefix+"cnpj"+zipControl).val(),zipPrefix,zipControl,country_id)})),$(document).on("click",".getCEP",(function(){zipPrefix=$(this).attr("zip-prefix"),zipControl=$(this).attr("zip-control"),country_id="3469034",searchZipcode($("#"+zipPrefix+"zipcode"+zipControl).val(),zipPrefix,zipControl,country_id)})),$(document).on("click",".modalFilemanage",(function(){$("#modalTemplate").show()})),$(document).on("click","#generateSummary",(function(){content='<input type="hidden" name="content" value="'+encodeURI(CKEDITOR.instances.content.getData())+'" />',$("#methodAjaxForm").val("generateSummary"),$("#fieldsAjaxForm").html(content),sendForm("#sendAjaxForm",$(this).attr("data-url"),$(this).attr("data-target"),!1,!0,!1)})),$(document).on("click",".getHelpTextTag",(function(){$("#getHelpTextTag").show()})),$(".modalInsert").on("click",(function(){ref=$(this).attr("data-target"),$("#methodAjaxForm").val("modalInsert"),$("#fieldsAjaxForm").html('        <input type="hidden" name="location" value="'+ref+'" />\n        <input type="hidden" name="module" value="'+$(this).attr("data-module")+'" />'),sendForm("#sendAjaxForm",urlBase,"modalInsert",!1,!0,!1)})),$(document).on("click",".viewerDocument",(function(){$("#sendAjaxForm").attr("action",$(this).attr("data-url")).attr("target","_blank"),content=generate_input($(this).attr("data-path"),{name:"file",type:"hidden"}),$("#fieldsAjaxForm").html(content),$("#sendAjaxForm").submit(),"modalClose"===$(this).attr("data-manage")&&closeModal()}))}));