;var $uifm_prev=jQuery;;var $uifm=jQuery.noConflict();if(typeof($uifm)==='undefined'){$uifm=jQuery;}
var flmbkp_back_helper=flmbkp_back_helper||null;if(!$uifm.isFunction(flmbkp_back_helper)){(function($,window){"use strict";var flmbkp_back_helper=function(){var flmbkp_variable=[];flmbkp_variable.innerVars={};flmbkp_variable.externalVars={};this.initialize=function(){}
this.length_obj=function(obj){var count=0;for(var p in obj){obj.hasOwnProperty(p)&&count++;}
return count;}
this.generateUniqueID=function(nrodec){var number=Math.random()
number.toString(36);var id=number.toString(36).substr(2,nrodec);return id;};this.versionCompare=function(v1,v2,options){var lexicographical=options&&options.lexicographical,zeroExtend=options&&options.zeroExtend,v1parts=v1.split('.'),v2parts=v2.split('.');function isValidPart(x){return(lexicographical?/^\d+[A-Za-z]*$/:/^\d+$/).test(x);}
if(!v1parts.every(isValidPart)||!v2parts.every(isValidPart)){return NaN;}
if(zeroExtend){while(v1parts.length<v2parts.length)v1parts.push("0");while(v2parts.length<v1parts.length)v2parts.push("0");}
if(!lexicographical){v1parts=v1parts.map(Number);v2parts=v2parts.map(Number);}
for(var i=0;i<v1parts.length;++i){if(v2parts.length==i){return 1;}
if(v1parts[i]==v2parts[i]){continue;}
else if(v1parts[i]>v2parts[i]){return 1;}
else{return-1;}}
if(v1parts.length!=v2parts.length){return-1;}
return 0;}
this.getData=function(mainarr,name){return mainarr[name];};this.setData=function(mainarr,name,value){mainarr[name]=value;};this.getData2=function(mainarr,name,index){try{return mainarr[name][index];}
catch(err){console.log('error getUiData2: '+err.message);}};this.setData2=function(mainarr,name,index,value){if(!mainarr.hasOwnProperty(name)){mainarr[name]={};}
if(!mainarr[name].hasOwnProperty(index)){mainarr[name][index]={};}
mainarr[name][index]=value;};this.getData3=function(mainarr,name,index,key){try{return mainarr[name][index][key];}
catch(err){console.log('error getUiData3: '+err.message);}};this.delData3=function(mainarr,name,index,key){delete mainarr[name][index][key];};this.setData3=function(mainarr,name,index,key,value){if(!mainarr.hasOwnProperty(name)){mainarr[name]={};}
if(!mainarr[name].hasOwnProperty(index)){mainarr[name][index]={};}
mainarr[name][index][key]=value;};this.setData4=function(mainarr,name,index,key,option,value){if(!mainarr.hasOwnProperty(name)){mainarr[name]={};}
if(!mainarr[name].hasOwnProperty(index)){mainarr[name][index]={};}
if(!mainarr[name][index].hasOwnProperty(key)){mainarr[name][index][key]={};}
mainarr[name][index][key][option]=value;};this.getData4=function(mainarr,name,index,key,option){try{return mainarr[name][index][key][option];}
catch(err){console.log('error getUiData4: '+err.message);}};this.getData5=function(mainarr,name,index,key,section,option){try{if(typeof mainarr[name][index]=='undefined'){return'';}else{return mainarr[name][index][key][section][option];}}
catch(err){console.log('error getUiData5: '+err.message);return'';}};this.setData5=function(mainarr,name,index,key,section,option,value){if(!mainarr.hasOwnProperty(name)){mainarr[name]={};}
if(!mainarr[name].hasOwnProperty(index)){mainarr[name][index]={};}
if(!mainarr[name][index].hasOwnProperty(key)){mainarr[name][index][key]={};}
if(!mainarr[name][index][key].hasOwnProperty(section)){mainarr[name][index][key][section]={};}
mainarr[name][index][key][section][option]=value;};this.addIndexData5=function(mainarr,name,index,key,section,option,value){if(typeof mainarr[name][index][key][section][option]=='undefined'){}else{mainarr[name][index][key][section][option][value]={};}};this.getData6=function(mainarr,name,index,key,section,option,option2){try{if(typeof mainarr[name][index][key][section][option][option2]=='undefined'){return'';}else{return mainarr[name][index][key][section][option][option2];}}
catch(err){console.log('error handled - getUiData6: '+err.message);return'';}};this.setData6=function(mainarr,name,index,key,section,option,option2,value){if(!mainarr.hasOwnProperty(name)){mainarr[name]={};}
if(!mainarr[name].hasOwnProperty(index)){mainarr[name][index]={};}
if(!mainarr[name][index].hasOwnProperty(key)){mainarr[name][index][key]={};}
if(!mainarr[name][index][key].hasOwnProperty(section)){mainarr[name][index][key][section]={};}
if(!mainarr[name][index][key][section].hasOwnProperty(option)){mainarr[name][index][key][section][option]={};}
mainarr[name][index][key][section][option][option2]=value;};this.delData6=function(mainarr,name,index,key,section,option,option2){delete mainarr[name][index][key][section][option][option2];};};window.flmbkp_back_helper=flmbkp_back_helper=$.flmbkp_back_helper=new flmbkp_back_helper();})($uifm,window);}if(typeof($uifm)==='undefined'){$uifm=jQuery;}
var flmbkp_back_tools=flmbkp_back_tools||null;if(!$uifm.isFunction(flmbkp_back_tools)){(function($,window){"use strict";var flmbkp_back_tools=function(){var flmbkp_variable=[];flmbkp_variable.innerVars={};flmbkp_variable.externalVars={};this.initialize=function(){}
this.pdf_showsample=function(type){var editor,email_template_pdf_msg;var pdf_fullpage=($('#uifm_frm_main_pdf_htmlfullpage').bootstrapSwitchZgpb('state'))?1:0;switch(String(type)){case'pdf_email_attach':if(typeof tinymce!="undefined"){editor=tinymce.get("uifm_frm_email_usr_tmpl_pdf");if(editor&&editor instanceof tinymce.Editor){email_template_pdf_msg=tinymce.get("uifm_frm_email_usr_tmpl_pdf").getContent();}else{email_template_pdf_msg=($('#uifm_frm_email_usr_tmpl_pdf').val())?$('#uifm_frm_email_usr_tmpl_pdf').val():'';}}
break;}
this.pdf_processSample(email_template_pdf_msg,pdf_fullpage);};this.pdf_processSample=function(message,whole_control){$.ajax({type:'POST',url:ajaxurl,data:{'action':'rocket_fbuilder_pdf_showsample','page':'flmbkp_file_manager','flmbkp_security':flmbkp_vars.ajax_nonce,'full_page':whole_control,'message':encodeURIComponent(message)},success:function(msg){try{if(parseInt(msg.status)===1){if(msg.pdf_name){var a=document.createElement("a");if(typeof a.download==='undefined'){window.location=msg.pdf_url;}else{a.href=msg.pdf_url;a.download=msg.pdf_name;document.body.appendChild(a);a.target="_blank";a.click();}}else{window.location=msg.pdf_url;}}else{alert('Error! PDf was not generated');}}catch(ex){alert('Error! PDf was not generated');}}});};this.email_sendsample=function(type){var editor,email_template_msg;var html_wholecont=($('#uifm_frm_main_email_htmlfullpage').bootstrapSwitchZgpb('state'))?1:0;var tmp_type;var email=$('#uifm_frm_from_email').val()||'';var filter=/^[\w\-\.\+]+\@[a-zA-Z0-9\.\-]+\.[a-zA-z0-9]{2,8}$/;if(filter.test(email)){}else
{alert('Email address needed. Fill "From mail" option.');return false;}
switch(String(type)){case'email_admin_tmpl':if(typeof tinymce!="undefined"){editor=tinymce.get("uifm_frm_email_tmpl");if(editor&&editor instanceof tinymce.Editor){email_template_msg=tinymce.get("uifm_frm_email_tmpl").getContent();}else{email_template_msg=($('#uifm_frm_email_tmpl').val())?$('#uifm_frm_email_tmpl').val():'';}}
tmp_type=1;break;case'email_client_tmpl':if(typeof tinymce!="undefined"){editor=tinymce.get("uifm_frm_email_usr_tmpl");if(editor&&editor instanceof tinymce.Editor){email_template_msg=tinymce.get("uifm_frm_email_usr_tmpl").getContent();}else{email_template_msg=($('#uifm_frm_email_usr_tmpl').val())?$('#uifm_frm_email_usr_tmpl').val():'';}}
tmp_type=2;break;}
this.email_processSample(email_template_msg,html_wholecont,email);};this.email_processSample=function(message,whole_control,email_to){$.ajax({type:'POST',url:ajaxurl,data:{'action':'rocket_fbuilder_email_sendsample','page':'flmbkp_file_manager','flmbkp_security':flmbkp_vars.ajax_nonce,'full_page':whole_control,'message':encodeURIComponent(message),'email_to':email_to},success:function(msg){if(parseInt(msg.status)===1){alert('Email test was sent to : '+email_to);}else{alert('Error! Email test was not sent because of an error.');}}});};};window.flmbkp_back_tools=flmbkp_back_tools=$.flmbkp_back_tools=new flmbkp_back_tools();})($uifm,window);}if(typeof($uifm)==='undefined'){$uifm=jQuery;}
var flmbkp_back_upgrade=flmbkp_back_upgrade||null;if(!$uifm.isFunction(flmbkp_back_upgrade)){(function($,window){"use strict";var flmbkp_back_upgrade=function(){var flmbkp_variable=[];flmbkp_variable.innerVars={};flmbkp_variable.externalVars={};this.initialize=function(){let cur_core_arr=rocketform.getUiData('app_ver');switch(flmbkp_back_helper.versionCompare(String(cur_core_arr),"3.4.1")){case 1:break;case-1:case 0:this.upgrade_prev_3_4_1();break;}}
this.upgrade_prev_3_4_1=function(){}};window.flmbkp_back_upgrade=flmbkp_back_upgrade=$.flmbkp_back_upgrade=new flmbkp_back_upgrade();})($uifm,window);}if(typeof($uifm)==='undefined'){$uifm=jQuery;}
var flmbkp_back_err=flmbkp_back_err||null;if(!$uifm.isFunction(flmbkp_back_err)){(function($,window){"use strict";var flmbkp_back_err=function(){var flmbkp_variable=[];flmbkp_variable.innerVars={};flmbkp_variable.externalVars={};this.initialize=function(){}
this.integrity_check=function(){if(this.error_is_found()){this.error_openModal();}else{}}
this.error_is_found=function(){var result;result=false;var result_err=[];var tmp_arr=rocketform.getUiData('steps_src');var tmp_fld_exist;for(var i in tmp_arr){for(var i2 in tmp_arr[i]){tmp_fld_exist=$('#zgpb-editor-container').find('#'+tmp_arr[i][i2]['id']).length;if(tmp_fld_exist==0){result_err.push(tmp_arr[i][i2]['id']);}}}
if(result_err.length){result=true;}
result_err=[];var tmp_arr2=$('#zgpb-editor-container').find('.uiform-main-form .uiform-items-container .zgpb-field-template');$.each(tmp_arr2,function(index,element){if(flmbkp_back_err.check_IdIsInArray(tmp_arr,$(element).attr('id'))){}else{result_err.push($(element).attr('id'));}});if(result_err.length){result=true;}
tmp_arr=null;return result;}
this.check_IdIsInArray=function(tmp_arr,id){var result=false;for(var i in tmp_arr){for(var i2 in tmp_arr[i]){if(String(tmp_arr[i][i2]['id'])===String(id)){result=true;break;}else{}}}
return result;}
this.error_openModal=function(){try{rocketform.fields_showModalOptions();$.ajax({type:'POST',url:flmbkp_vars.uifm_siteurl+"formbuilder/forms/ajax_integrity_openmodal",data:{'action':'rocket_fbuilder_integrity_openmodal','page':'flmbkp_file_manager','flmbkp_security':flmbkp_vars.ajax_nonce,'csrf_field_name':flmbkp_vars.csrf_field_name},success:function(msg){$("#zgpb-modal1").find('.sfdc-modal-dialog').find('.zgpb-modal-header-inner').html(msg.modal_header);$("#zgpb-modal1").find('.sfdc-modal-dialog').find('.sfdc-modal-body').html(msg.modal_body);$("#zgpb-modal1").find('.sfdc-modal-dialog').find('.zgpb-modal-footer-wrap').html(msg.modal_footer);}});}
catch(ex){console.error("flmbkp_back_err error_openModal ",ex.message);}}};window.flmbkp_back_err=flmbkp_back_err=$.flmbkp_back_err=new flmbkp_back_err();})($uifm,window);}if(typeof($uifm)==='undefined'){$uifm=jQuery;}
var flmbkp_back_general=flmbkp_back_general||null;if(!$uifm.isFunction(flmbkp_back_general)){(function($,window){"use strict";var flmbkp_back_general=function(){var flmbkp_variable=[];flmbkp_variable.innerVars={};flmbkp_variable.externalVars={};this.initialize=function(){}
this.formslist_search_refresh=function(){this.formslist_search_process(0);};this.formslist_search_refresh_save=function(){this.formslist_search_process(1);alert('Filter paramaters saved');}
this.formslist_search_process=function(opt_save){var tmp_params=$('#zgfm-listform-filter-panel-form').serialize();$.ajax({type:'POST',url:ajaxurl,data:{'action':'flmbkp_fbuilder_formlist_filter','page':'flmbkp_file_manager','flmbkp_security':flmbkp_vars.ajax_nonce,'data_filter':tmp_params,'opt_save':opt_save,'opt_offset':$('#uifm_listform_offset_val').val()},success:function(msg){$('#zgfm-back-listform-maintable-container').html(msg['content']);$(".uiform-confirmation-func-action").click(function(e){e.preventDefault();var targetUrl=$(this).attr("href");var tmp_callback=$(this).data('dialog-callback');$("#uiform-confirmation-func-action-dialog").dialog({autoOpen:false,title:'Confirmation',modal:true,buttons:{"OK":function(){$(this).dialog("close");eval(tmp_callback);},"Cancel":function(){$(this).dialog("close");}}});$("#uiform-confirmation-func-action-dialog").dialog('option','title',$(this).data('dialog-title'));$("#uiform-confirmation-func-action-dialog").dialog("open");});}});}};window.flmbkp_back_general=flmbkp_back_general=$.flmbkp_back_general=new flmbkp_back_general();})($uifm,window);}$uifm(document).ready(function($){$.fn.removeCss=function(){var removedCss=$.makeArray(arguments);return this.each(function(){var e$=$(this);var style=e$.attr('style');if(typeof style!=='string')return;style=$.trim(style);var styles=style.split(/;+/);var sl=styles.length;for(var l=removedCss.length,i=0;i<l;i++){var r=removedCss[i];if(!r)continue;for(var j=0;j<sl;){var sp=$.trim(styles[j]);if(!sp||(sp.indexOf(r)===0&&$.trim(sp.substring(r.length)).indexOf(':')===0)){styles.splice(j,1);sl--;}else{j++;}}}
if(styles.length===0){e$.removeAttr('style');}else{e$.attr('style',styles.join(';'));}});};});;(function($){String.prototype.cleanup=function(){return this.toLowerCase().replace(/[^a-zA-Z0-9]+/g,"_");}
var setfield_tab_active;$('.uiform-editing-main').ColumnToggle();$('.uiform-builder-data a[data-toggle="sfdc-tab"]').on('shown.bs.sfdc-tab',function(e){e.preventDefault();var target=$(e.target).attr("href");});function testAnim(target,x,duration){$(target).addClass(x+' animated '+duration).one('webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend',function(){$(target).removeClass(x+' animated '+duration);});}
$('[data-toggle="tooltip"]').tooltip({container:"body"});$('.uifm-custom-color').colorpicker();$("#uifm_frm_wiz_theme_typ").on("change",function(e){var f_val=$(e.target).val();rocketform.wizardtab_changeTheme(f_val);});$(".chzn-select").chosen({width:"100%",search_contains:true});$(".uifm_main_spinner_1").TouchSpin({verticalbuttons:true,min:0,max:200,stepinterval:1,verticalupclass:'sfdc-glyphicon sfdc-glyphicon-plus',verticaldownclass:'sfdc-glyphicon sfdc-glyphicon-minus'});$(".tooltip-option-enable input").tooltip({title:'Enable',container:"body"});$(".tooltip-val-demo").tooltip({title:'Validator text',container:"body"});$(".autogrow").autogrow();$(".wp-media-buttons").find('#insert-media-button').siblings().hide();$("#uifm-close-setting-tab").on("click",function(){rocketform.closeSettingTab();});$(document).on("click","a.uiform-fields-qopt-select",function(e){var tmp_input=$(this).find('input');var id_field=tmp_input.closest('.uiform-field').attr('id');if(e.target.tagName!="INPUT"){if(tmp_input.is(':checked')){tmp_input.prop("checked",false);}else{tmp_input.prop("checked",true);}}else{}
rocketform.fieldQuickOptions_selectField(id_field);});$(document).on("change keyup focus keypress",".uifm_frm_skin_tab_title_evt",function(e){var tabnro=$(e.target).closest('.uifm_frm_skin_tab_content').data('tab-nro');rocketform.wizardtab_changeTabTitle(tabnro);});var uifm_obj_txtarea_editors=[$('#uifm_frm_summbox_skintxt_txt')];$(document).on("keyup focus",uifm_obj_txtarea_editors,function(e){rocketform.captureEventTinyMCE2(e);});$(document).on("change keyup focus keypress",".uifm-f-option",function(e){var pickfield=$(e.target).closest('.uiform-field');var f_step=$(e.target).closest('.uiform-step-pane').data('uifm-step');var store=$(this).data('field-store');var f_store=store.split("-");var f_sec=f_store[0];var f_opt=f_store[1];var f_val=$(this).val();var f_id=pickfield.attr("id");rocketform.setDataOptToCoreData(f_step,f_id,store,f_val);var idselected=$('#uifm-field-selected-id').val();if(f_id===idselected){var tabobject=$('#uifm-field-selected-id').parent();rocketform.setDataOptToSetTab(tabobject,store,f_val);}});$(document).on("change keyup focus keypress","#uifm-popup-setfname",function(e){var f_val=$(this).val();$('#uifm_frm_main_title').val(f_val);});$('.uiform-opt-slider').bootstrapSlider();$(".uifm_frm_form_skin_spinner").on("change",function(e){var store=$(e.target).data('form-store');var f_store=store.split("-");var f_sec=f_store[0];var f_opt=f_store[1];var f_val=$(e.target).val();rocketform.setUiData3('skin',f_sec,f_opt,f_val);var obj_field=$('.uiform-preview-base');if(obj_field){rocketform.setDataOptToPrevForm(obj_field,'skin',f_sec+'-'+f_opt,f_val);}});$(".uifm_frm_form_skin_spinner").TouchSpin({verticalbuttons:true,min:0,max:10000,stepinterval:1,verticalupclass:'sfdc-glyphicon sfdc-glyphicon-plus',verticaldownclass:'sfdc-glyphicon sfdc-glyphicon-minus'});$(".uifm_frm_form_skin_spinner").TouchSpin({verticalbuttons:true,min:0,max:10000,stepinterval:1,verticalupclass:'sfdc-glyphicon sfdc-glyphicon-plus',verticaldownclass:'sfdc-glyphicon sfdc-glyphicon-minus'});$(document).on("change",".uifm-formskin-setoption-st",function(e){var store=$(this).data('form-store');var f_store=store.split("-");var f_sec=f_store[0];var f_opt=f_store[1];var f_val=$(this).filter(':checked').val();f_val=(f_val)?f_val:0;rocketform.setUiData3('skin',f_sec,f_opt,f_val);var obj_field=$('.uiform-preview-base');if(obj_field){rocketform.setDataOptToPrevForm(obj_field,'skin',f_sec+'-'+f_opt,f_val);}});$(document).on("click",".uifm-fmskin-setoption-btn",function(e){var store=$(this).data('form-store');var f_store=store.split("-");var f_sec=f_store[0];var f_opt=f_store[1];var f_val=$(this).find('input').val();rocketform.setUiData3('skin',f_sec,f_opt,f_val);rocketform.setDataOptToSetFormTab($('#uiform-build-form-tab'),'skin',f_sec+'-'+f_opt,f_val);var obj_field=$('.uiform-preview-base');if(obj_field){rocketform.setDataOptToPrevForm(obj_field,'skin',f_sec+'-'+f_opt,f_val);}});$('#uiform-set-form-wizard .uifm-custom-color').colorpicker().on('changeColor',function(ev){rocketform.wizardtab_saveChangesToMdata();rocketform.wizardtab_refreshPreview();});$('#uiform-settings-tab3-2,#uiform-settings-tab3-4').find('.uifm-custom-color').colorpicker().on('changeColor',function(ev){var store=$(this).data('form-store');var main_sec=$(this).data('form-msec');var f_store=store.split("-");var f_sec=f_store[0];var f_opt=f_store[1];var f_val=$(this).find('input').val();if(f_val){rocketform.setUiData3(main_sec,f_sec,f_opt,f_val);var obj_field=$('.uiform-preview-base');if(obj_field){rocketform.setDataOptToPrevForm(obj_field,main_sec,f_sec+'-'+f_opt,f_val);}}});$('#uifm_frm_main_ajaxmode').on('switchChange.bootstrapSwitchZgpb',function(event,state){var f_val=(state)?1:0;rocketform.setUiData2('main','submit_ajax',f_val);});$('.uifm_frm_skin_bgst_event').on('switchChange.bootstrapSwitchZgpb',function(event,state){rocketform.loadForm_tab_skin_updateBG();});$('.uifm_frm_skin_bgcolor_event').colorpicker().on('changeColor',function(ev){rocketform.loadForm_tab_skin_updateBG();});$('.uifm_frm_wiz_st_event').on('switchChange.bootstrapSwitchZgpb',function(event,state){rocketform.guidedtour_showTextOnPreviewPane(false);rocketform.wizardtab_enableStatus();});$('#uiform-settings-tab3-2 .switch-field,#uiform-settings-tab3-4 .switch-field').on('switchChange.bootstrapSwitchZgpb',function(event,state){var store=$(this).data('form-store');var main_sec=$(this).data('form-msec');var f_store=store.split("-");var f_sec=f_store[0];var f_opt=f_store[1];var f_val=(state)?1:0;switch(main_sec){case'skin':rocketform.setUiData3(main_sec,f_sec,f_opt,f_val);break;case'summbox':rocketform.setUiData3(main_sec,f_sec,f_opt,f_val);break;}
var obj_field=$('.uiform-preview-base');if(obj_field){rocketform.setDataOptToPrevForm(obj_field,main_sec,f_sec+'-'+f_opt,f_val);}});$('.switch-field').bootstrapSwitchZgpb();$("#uiform-settings-tab3-2  .uiform-opt-slider").on('slide',function(slideEvt){var store=$(this).data('form-store');var main_sec=$(this).data('form-msec');var f_store=store.split("-");var f_sec=f_store[0];var f_opt=f_store[1];var f_val=slideEvt.value;rocketform.setUiData3(main_sec,f_sec,f_opt,f_val);var obj_field=$('.uiform-preview-base');if(obj_field){rocketform.setDataOptToPrevForm(obj_field,main_sec,f_sec+'-'+f_opt,f_val);}});$("#uiform-set-form-summbox  .uiform-opt-slider").on('slide',function(slideEvt){var store=$(this).data('form-store');var main_sec=$(this).data('form-msec');var f_store=store.split("-");var f_sec=f_store[0];var f_opt=f_store[1];var f_val=slideEvt.value;rocketform.setUiData3(main_sec,f_sec,f_opt,f_val);var obj_field=$('.uiform-preview-base');if(obj_field){rocketform.setDataOptToPrevForm(obj_field,main_sec,f_sec+'-'+f_opt,f_val);}});$('.unknown ul.dropdown-menu.selectpicker li').on('click',function(){var obj_option=$(this).parent().parent().parent().parent().find('select');var selectedValue=$($(obj_option).find('option')[parseInt($(this).index())]).val();var store=obj_option.data('field-store');var f_store=store.split("-");var f_sec=f_store[0];var f_opt=f_store[1];var f_id=$('#uifm-field-selected-id').val();var f_step;var field_Checked=$('.uiform-main-form .uiform-fields-qopt-select input:checked');if(parseInt(field_Checked.length)>1){obj_field=field_Checked.closest('.uiform-field');$.each(obj_field,function(index2,value2){f_id=$(this).attr('id');f_step=$('#'+f_id).closest('.uiform-step-pane').data('uifm-step');rocketform.setDataOptToCoreData(f_step,f_id,store,selectedValue);if($(this)){rocketform.setDataOptToPrevField($(this),store,selectedValue);}});}else{f_step=$('#'+f_id).closest('.uiform-step-pane').data('uifm-step');rocketform.setDataOptToCoreData(f_step,f_id,store,selectedValue);var obj_field=$('#'+f_id);if(obj_field){rocketform.setDataOptToPrevField(obj_field,store,selectedValue);}}});$('#uifm_frm_skin_fmbg_type_1').on('click',function(){$('#uifm_frm_skin_fmbg_color_1').closest('.row').show();$('#uifm_frm_skin_fmbg_color_2').closest('.row').hide();$('#uifm_frm_skin_fmbg_color_3').closest('.row').hide();});$('#uifm_frm_skin_fmbg_type_2').on('click',function(){$('#uifm_frm_skin_fmbg_color_1').closest('.row').hide();$('#uifm_frm_skin_fmbg_color_2').closest('.row').show();$('#uifm_frm_skin_fmbg_color_3').closest('.row').show();});$('#uifm_frm_inp18_fmbg_type_1').on('click',function(){$('#uifm_frm_inp18_fmbg_color_1').closest('.row').show();$('#uifm_frm_inp18_fmbg_color_2').closest('.row').hide();$('#uifm_frm_inp18_fmbg_color_3').closest('.row').hide();});$('#uifm_frm_inp18_fmbg_type_2').on('click',function(){$('#uifm_frm_inp18_fmbg_color_1').closest('.row').hide();$('#uifm_frm_inp18_fmbg_color_2').closest('.row').show();$('#uifm_frm_inp18_fmbg_color_3').closest('.row').show();});$('#uifm_fld_val_reqicon_img').on('change',function(e){var f_id=$('#uifm-field-selected-id').val();var store=$(this).data('field-store');var f_store=store.split("-");var f_sec=f_store[0];var f_opt=f_store[1];var f_val=e.icon;var f_step=$('#'+f_id).closest('.uiform-step-pane').data('uifm-step');rocketform.setDataOptToCoreData(f_step,f_id,store,f_val);var obj_field=$('#'+f_id);if(obj_field){rocketform.setDataOptToPrevField(obj_field,store,f_val);}});$('.uiform-set-options-tabs ul.sfdc-nav-tabs').on('shown.bs.sfdc-tab',function(e){setfield_tab_active=$(e.target).data('uifm-title');rocketform.setInnerVariable('setfield_tab_active',setfield_tab_active);rocketform.previewfield_hidePopOver();rocketform.previewfield_helpblock_hidetooltip();})
$('.uiformc-menu-wrap ul.sfdc-nav-tabs a[data-toggle="sfdc-tab"],.uiform-set-options-tabs ul.sfdc-nav-tabs a[data-toggle="sfdc-tab"]').on('shown.bs.sfdc-tab',function(e){if(!$(e.target).hasClass('uifm-tab-fld-validation')){$('.sfdc-popover').popover('hide');}})
$('.uiformc-menu-wrap ul.sfdc-nav-tabs a[data-toggle="sfdc-tab"],.uiform-set-options-tabs ul.sfdc-nav-tabs a[data-toggle="sfdc-tab"]').on('shown.bs.sfdc-tab',function(e){setfield_tab_active=$(e.target).data('uifm-title');if(String(setfield_tab_active)==='helpb'){rocketform.setInnerVariable('setfield_tab_active',setfield_tab_active);var id=$('#uifm-field-selected-id').val();rocketform.previewfield_elementTextarea($('#'+id),"help_block");}else{$('body').find('.sfdc-tooltip').tooltip("hide");}});var formfield;$('#uifm_frm_skin_bg_btnadd').click(function(){window.restore_send_to_editor=window.send_to_editor;window.send_to_editor=function(html){var imgurl=$('img',html).attr('src')||$(html).attr('src');$('#'+formfield).val(imgurl);$('#uifm_frm_skin_bg_srcimg_wrap').html('<img class="sfdc-img-thumbnail" src="'+imgurl+'" />');tb_remove();window.send_to_editor=window.restore_send_to_editor;rocketform.loadForm_tab_skin_updateBG();}
formfield=$('#uifm_frm_skin_bg_imgurl').attr('id');tb_show('','media-upload.php?type=image&amp;TB_iframe=true');return false;});rocketform.wizardtab_tabManageEvt();$('.uiform-wrap a[data-toggle="sfdc-tab"]').on('shown.bs.sfdc-tab',function(e){rocketform.previewfield_hideAllPopOver();});$('.uiform-wrap .uiform-settings-invoice').on('shown.bs.sfdc-tab',function(e){rocketform.invoiceoptions_genListToIntMem();});$('.uiform-wrap .flmbkp_gsettings_additional').on('shown.bs.sfdc-tab',function(e){var cminst=$('#uifm_frm_main_addjs').data('CodeMirrorInstance');cminst.refresh();cminst=$('#uifm_frm_main_addcss').data('CodeMirrorInstance');cminst.refresh();});$('#uifm_frm_email_usr_recipient').on('change',function(e){var optionSelected=$("option:selected",this);var valueSelected=this.value;rocketform.setUiData2('onsubm','mail_recipient',valueSelected);});$('.uifm_frm_inv_to_text_src').on('change',function(e){var optionSelected=$("option:selected",this);var valueSelected=this.value;var nro=$(this).attr('data-uifm-nro');rocketform.setUiData2('invoice','to_text'+nro,valueSelected);});$("#uiform-clogicgraph").dialog({autoOpen:false,height:800,scrollable:true,width:800,show:{effect:"blind",duration:1000},hide:{effect:"explode",duration:1000},buttons:{"OK":function(){$(this).dialog("close");}}});$("#uiform-clogicgraph").dialog({autoOpen:false,height:800,scrollable:true,width:800,show:{effect:"blind",duration:1000},hide:{effect:"explode",duration:1000},buttons:{"OK":function(){$(this).dialog("close");}}});$(".uiform-confirmation-func-action").click(function(e){e.preventDefault();var targetUrl=$(this).attr("href");var tmp_callback=$(this).data('dialog-callback');$("#uiform-confirmation-func-action-dialog").dialog({autoOpen:false,title:'Confirmation',modal:true,buttons:{"OK":function(){$(this).dialog("close");eval(tmp_callback);},"Cancel":function(){$(this).dialog("close");}}});$("#uiform-confirmation-func-action-dialog").dialog('option','title',$(this).data('dialog-title'));$("#uiform-confirmation-func-action-dialog").dialog("open");});})($uifm);jQuery(function($){$.fn.removeCss=function(){var removedCss=$.makeArray(arguments);return this.each(function(){var e$=$(this);var style=e$.attr('style');if(typeof style!=='string')return;style=$.trim(style);var styles=style.split(/;+/);var sl=styles.length;for(var l=removedCss.length,i=0;i<l;i++){var r=removedCss[i];if(!r)continue;for(var j=0;j<sl;){var sp=$.trim(styles[j]);if(!sp||(sp.indexOf(r)===0&&$.trim(sp.substring(r.length)).indexOf(':')===0)){styles.splice(j,1);sl--;}else{j++;}}}
if(styles.length===0){e$.removeAttr('style');}else{e$.attr('style',styles.join(';'));}});};rocketform.initPanel();});function uiformUpdateFontSelect(id,val){jQuery(function($){var objsel=$('#'+id);if(objsel.data('stylesFontMenu')){objsel.data('stylesFontMenu').uifm_load_font(val);objsel.data('selected',val);objsel.chosen().val(val);objsel.chosen().trigger("chosen:updated");}});}
function uiformRefreshFontMenu(){jQuery('#uiform-build-field-tab select.sfm').stylesFontMenu();}
function flmbkp_input17_onChangeLayout(){jQuery(function($){var f_val=$('#uifm_fld_inp17_thopt_mode').val();rocketform.input17settings_showOptionbyLayMode(f_val);var store="input17-thopt_mode";var f_id=$('#uifm-field-selected-id').val();var f_step=$('#'+f_id).closest('.uiform-step-pane').data('uifm-step');rocketform.setDataOptToCoreData(f_step,f_id,store,f_val);var tabobject=$('#uifm-field-selected-id').parent();rocketform.setDataOptToSetTab(tabobject,store,f_val);rocketform.input17settings_tabeditor_generateAllOptions();rocketform.input17settings_preview_genAllOptions($('#'+f_id),'input17');});}
function uifm_loadScript(url,id,callback){var script=document.createElement("script")
script.type="text/javascript";script.id=id;script.async=false;if(script.readyState){script.onreadystatechange=function(){if(script.readyState=="loaded"||script.readyState=="complete"){script.onreadystatechange=null;callback();}};}else{script.onload=function(){callback();};}
script.src=url;document.getElementsByTagName("head")[0].appendChild(script);}
function uifm_stripHTML(dirtyString){var html=dirtyString;var div=document.createElement("div");div.innerHTML=html;return div.innerText;}
function uifm_validate_field(arr1,arr2){var arr3={},arr3_2;for(var name in arr1){if(arr1.hasOwnProperty(name)){arr3_2={}
for(var name2 in arr1[name]){if(arr1[name].hasOwnProperty(name2)&&arr2[name].hasOwnProperty(name2)){arr3_2[name2]=arr1[name][name2];}}
arr3[name]=arr3_2;}else{}}
return arr3;}(function($){var zgpbld_grid=function(element,options){var elem=$(element);var obj=this;var drag=null;var ID=elem.attr('id');var t;var M=Math;var cur_side=null;var defaults={data:{}};var settings=$.extend(true,{},defaults,options);this.publicMethod=function(){};this.events_trigger=function(){};this.drag_init=function(e){try{var target=$(e.target).closest('.zgpb-fl-gs-block-style');var o=target.data(ID);g=t.g[o.i];g.ox=e.pageX;g.l=target.position().left;$(e.target).closest('.zgpb-fl-gridsystem-opt').css('display','block');$(e.target).closest('.zgpb-fl-gridsystem').find('.zgpb-fl-gd-opt-icon-handler').removeCss('background','#CEFBF8');$(e.target).closest('.zgpb-fl-gridsystem-opt').find('.zgpb-fl-gd-opt-icon-handler').css('background','#CEFBF8');$(document).bind('mousemove.'+ID,obj.drag_move).bind('mouseup.'+ID,obj.drag_over);$("head").append("<style id='zgpb-grid-head-css' type='text/css'>*{cursor:e-resize!important;   -webkit-touch-callout: none;-webkit-user-select: none;-khtml-user-select: none;-moz-user-select: none;-ms-user-select: none;user-select: none;}</style>");drag=g;paint_variables();}
catch(ex){console.error(" error drag_init ",ex.message);}}
this.drag_move=function(e){try{if(!drag)return;var x=e.pageX-drag.ox+drag.l;var i=drag.i;drag.x=x;if(parseFloat(e.pageX)>parseFloat(drag.ox)){syncCols(t,i,true);}else{syncCols(t,i,false);}
paint_variables();return false;}
catch(ex){console.error(" error drag_move ",ex.message);}}
var syncCols=function(t,i,right){try{var inc,possible_index=[1,2,3,4,5,6,7,8,9,10,11,12],w,box_min_width,temp_col2,c=t.c[i],c2=t.c[i+1];if(right===true){inc=drag.x-drag.l;w=c.w+inc;var w2=c2.w-inc;box_min_width=parseFloat(t.width())*(8.333)/100;temp_col2=parseFloat(c.width())+parseFloat(box_min_width)/2;}else{inc=drag.l-drag.x;w=c.w-inc;var w2=c2.w+inc;box_min_width=parseFloat(t.width())*(8.333)/100;temp_col2=parseFloat(c2.width())+parseFloat(box_min_width)/2;}
if(right===true){if(parseFloat(w)>temp_col2){var c_new_igrid=parseInt(c.cur_igrid)+1;var c2_new_igrid=parseInt(c2.cur_igrid)-1;if(($.inArray(c_new_igrid,possible_index)>-1)&&($.inArray(c2_new_igrid,possible_index)>-1)){c.attr('class','zgpb-fl-gs-block-style sfdc-col-md-'+c_new_igrid);c2.attr('class','zgpb-fl-gs-block-style sfdc-col-md-'+c2_new_igrid);c.cur_igrid=parseInt(c.cur_igrid)+1;c2.cur_igrid=parseInt(c2.cur_igrid)-1;c.attr('data-zgpb-width',c.width());c2.attr('data-zgpb-width',c2.width());c.attr('data-zgpb-blockcol',c.cur_igrid);c2.attr('data-zgpb-blockcol',c2.cur_igrid);}}}else{if(parseFloat(w2)>temp_col2){var c_new_igrid=parseInt(c.cur_igrid)-1;var c2_new_igrid=parseInt(c2.cur_igrid)+1;if(($.inArray(c_new_igrid,possible_index)>-1)&&($.inArray(c2_new_igrid,possible_index)>-1)){c.attr('class','zgpb-fl-gs-block-style sfdc-col-md-'+c_new_igrid);c2.attr('class','zgpb-fl-gs-block-style sfdc-col-md-'+c2_new_igrid);c.cur_igrid=parseInt(c.cur_igrid)-1;c2.cur_igrid=parseInt(c2.cur_igrid)+1;c.attr('data-zgpb-width',c.width());c2.attr('data-zgpb-width',c2.width());c.attr('data-zgpb-blockcol',c.cur_igrid);c2.attr('data-zgpb-blockcol',c2.cur_igrid);}}}}
catch(ex){console.error(" error syncCols ",ex.message);}}
this.drag_over=function(e){try{$(document).unbind('mousemove.'+ID).unbind('mouseup.'+ID);$('#zgpb-grid-head-css').remove();drag=null;var c_tmp;$.each(t.c,function(index,element){t.c[index].w=t.c[index].width();});$(e.target).closest('.zgpb-fl-gridsystem-opt').removeCss('display');$(e.target).closest('.zgpb-fl-gridsystem-opt').find('.zgpb-fl-gd-opt-icon-handler').removeCss('background','#CEFBF8');paint_variables();}
catch(ex){console.error(" error drag_over ",ex.message);}}
var paint_variables=function(){try{return;var output='<ul>'
$.each(t.c,function(index,element){output+='<li>index: '+index+' <=> w: '+t.c[index].w+'</li>';});output+='</ul>'
$('#table-variables').html(output);}
catch(ex){console.error(" error drag_over ",ex.message);}}
this.drag_cancel=function(){}
this.onHover=function(e){try{if(e){e.stopPropagation();e.preventDefault();}
var tmp_target_id=$(e.target).closest('.zgpb-field-template').attr('id');var tmp_target_type=$(e.target).closest('.zgpb-field-template').attr('data-typefield');switch(parseInt(tmp_target_type)){case 1:case 2:case 3:case 4:case 5:case 6:var tmp_tmpl=wp.template("zgpb-quick-options");if(parseInt($(this).find('.zgpb-fields-quick-options').length)===0){$(this).append(tmp_tmpl({type:tmp_target_type,id:tmp_target_id}));}
break;default:var tmp_tmpl=wp.template("zgpb-quick-options");if(parseInt($(this).find('.zgpb-fields-quick-options').length)===0){$(this).append(tmp_tmpl({type:$('#'+ID).attr('data-typefield'),id:tmp_target_id}));}
break;}
var tmp_tmpl2=wp.template("zgpb-field-hover-hlight");if(parseInt($(this).find('.zgpb-fields-hover-hlight-box').length)===0){$(this).append(tmp_tmpl2());}
if(drag)return;if($('#zgpb-editor-container').find('.zgpb-fl-gs-block-style-hover').length){$('#zgpb-editor-container').find('.zgpb-fl-gs-block-style-hover').removeClass('zgpb-fl-gs-block-style-hover');}
$(e.target).closest('.zgpb-fl-gs-block-style').addClass('zgpb-fl-gs-block-style-hover');}
catch(ex){console.error(" error onHover ",ex.message);}}
this.offHover=function(e){try{if(e){e.stopPropagation();e.preventDefault();}
if(parseInt($(this).find('.zgpb-fields-quick-options').length)>0){$(this).find('.zgpb-fields-quick-options').remove();}
if(parseInt($(this).find('.zgpb-fields-hover-hlight-box').length)>0){$(this).find('.zgpb-fields-hover-hlight-box').remove();}
if(drag)return;$(e.target).closest('.zgpb-fl-gs-block-style').removeClass('zgpb-fl-gs-block-style-hover');}
catch(ex){console.error(" error offHover ",ex.message);}}
this.onWholeHover=function(e){try{var tmp_tmpl=wp.template("zgpb-quick-options-2");if(parseInt($(this).find('.zgpb-fields-quick-options2').length)===0){$(this).append(tmp_tmpl({type:$('#'+ID).attr('data-typefield'),id:ID}));}}
catch(ex){console.error(" error offHover ",ex.message);}}
this.offWholeHover=function(e){try{if(parseInt($(this).find('.zgpb-fields-quick-options2').length)>0){$(this).find('.zgpb-fields-quick-options2').remove();}}
catch(ex){console.error(" error offWholeHover ",ex.message);}}
this.init=function(){this.events_trigger();t=elem;t.g=[];t.c=[];t.w=t.width();createGrips();};var createGrips=function(){try{var cols=t.find(" .sfdc-row > .zgpb-fl-gs-block-style");t.cols=cols;t.ln=cols.length;cols.each(function(i){var c=$(this);var g=$(this);g.t=t;g.i=i;g.c=c;g.w=g.width();c.w=c.width();c.blocks=c.attr('data-blocks');c.attr('data-zgpb-width',c.width());g.cur_igrid=g.attr('class').match(/\d+/)[0];c.cur_igrid=c.attr('class').match(/\d+/)[0];c.mpercent=c.attr('data-maxpercent');t.g.push(g);t.c.push(c);g.find('.zgpb-fl-gd-drag-line').mousedown(obj.drag_init).mouseup(obj.drag_cancel);g.data(ID,{i:i,t:t.attr(ID)});$(this).on("mouseenter",obj.onHover);$(this).on("mouseleave",obj.offHover);})}
catch(ex){console.error(" error createGrips ",ex.message);}}
this.init();};$.fn.zgpbld_grid=function(options){return this.each(function(){var element=$(this);if(element.data('zgpbld_grid'))return;var myplugin=new zgpbld_grid(this,options);element.data('zgpbld_grid',myplugin);});};})($uifm);