text: !function($){"use strict";$.WS_Form=function(e){$.WS_Form.this=this,this.is_admin=this.set_is_admin(),this.user_roles=ws_form_settings.user_roles,this.form_interface=!1,this.group_data_cache=[],this.section_data_cache=[],this.field_data_cache=[],this.action_data_cache=[],this.invalid_feedback_cache=[],this.object_cache=[],this.object_cache.condition=[],this.object_cache.then=[],this.object_cache.else=[],this.action=!1,this.object_data_scratch=!1,this.form_history=[],this.history_index=0,this.framework="",this.column_resize_obj=!1,this.column_size_value=0,this.column_size_value_old=0,this.offset_value=0,this.offset_value_old=0,this.dragged_field=null,this.section_field_being_dragged=!1,this.next_sibling_id_old=null,this.section_id_old=null,this.group_id_old=null,this.section_repeatable_dragged=!1,this.section_repeatable_indexes={},this.checksum=!1,this.checksum_setTimeout=!1,this.published_checksum="",this.conditional=!1,this.conditional_data=!1,this.conditional_index_dragged_from=!1,this.conditional_actions_run_save=[],this.conditional_actions_run_submit=[],this.conditional_cache=!1,this.recaptchas=[],this.recaptchas_v2_default=[],this.recaptchas_v2_invisible=[],this.recaptchas_v3_default=[],this.recaptchas_conditions=[],this.timeout_recaptcha=5e3,this.signatures=[],this.signatures_by_name=[],this.timeout_signature=5e3,this.analytics_google=!1,this.timeout_analytics_google=5e3,this.analytics_function=[],this.debug_height=0,this.text_editor_index=1,this.code_editor_index=1,this.keydown=[],this.timeout_interval=100,this.api_call_queue=[],this.api_call_queue_running=!1,this.number_to_word=["nought","one","two","three","four","five","six","seven","eight","nine","ten","eleven","twelve","thirteen","fourteen","fifteen","sixteen","seventeen","eighteen","nineteen","twenty"],this.label_old="",this.submit=!1,this.action_js=[],this.form_draft=!1,this.submit_auto_populate=!1,this.form_id_prefix="wsf-",this.field_name_prefix=ws_form_settings.field_prefix,this.meta_key_options_cache=[],this.options_action_objects=[],this.options_action_cache=[],this.sidebar_conditions=[],this.sidebar_conditions_events_added=!1,this.sidebar_expanded_obj=!1,this.touch_device="ontouchend"in document,this.hash="",this.form_post_locked=!1,this.field_required_bypass=[],this.form_valid=!1,this.form_valid_old=null,this.form_validation_real_time_hooks=[],this.ecommerce_cart_price_type=[],this.has_ecommerce=!1,this.form_ecommerce_calculate_enabled=!0,this.progress=0,this.progress_percent="0%",this.progress_array=[],this.progress_class_complete="",this.progress_class_incomplete="";var t=document.createElement("input");t.setAttribute("type","date"),this.native_date="date"==t.type,this.timeout_datetimepicker=5e3;var i=document.createElement("input");i.setAttribute("type","color"),this.native_color="color"==i.type,this.timeout_minicolors=5e3,this.form_action_custom=!1,this.form_ajax=!0,this.object_focus=!1,this.field_type_click_drag_check=!1,this.password_strength_status=0,this.cascade_select_cache=[],this.select_ajax_cache=[],this.preview_window=void 0,this.calc=[]},$.WS_Form.prototype.render=function(e){var t=this;void 0===e&&this.error("error_attributes"),void 0===e.obj&&this.error("error_attributes_obj"),void 0===e.form_id&&this.error("error_attributes_form_id"),this.form_canvas_obj=e.obj instanceof $?e.obj:$(e.obj),this.form_obj_id=this.form_canvas_obj.attr("id"),this.form_id=e.form_id,this.form_instance_id=this.form_canvas_obj.attr("data-instance-id"),this.form_id_prefix=this.is_admin?"wsf-":"wsf-"+this.form_instance_id+"-",this.form_id_prefix_function=this.is_admin?"wsf_":"wsf_"+this.form_instance_id+"_",this.form_obj=this.form_canvas_obj.closest("form"),this.form_obj.length?this.form_obj.attr("novalidate",""):this.form_obj=this.form_canvas_obj,this.form_obj[0]!=this.form_canvas_obj[0]&&(this.form_obj.hasClass("wsf-form")||this.form_obj.addClass("wsf-form"),this.form_canvas_obj.hasClass("wsf-form")&&this.form_canvas_obj.removeClass("wsf-form")),this.get_configuration(function(){t.get_form(function(){t.init()})})},$.WS_Form.configured=!1,$.WS_Form.css_rendered=!1,$.WS_Form.debug,$.WS_Form.debug_rendered=!1,$.WS_Form.analytics,$.WS_Form.tracking,$.WS_Form.external,$.WS_Form.ecommerce,$.WS_Form.calc,$.WS_Form.settings_plugin,$.WS_Form.settings_form=null,$.WS_Form.frameworks,$.WS_Form.parse_variables,$.WS_Form.parse_variable_help,$.WS_Form.actions,$.WS_Form.field_types,$.WS_Form.field_type_cache=[],$.WS_Form.file_types,$.WS_Form.meta_keys,$.WS_Form.meta_keys_required_setting=[],$.WS_Form.breakpoints,$.WS_Form.data_sources,$.WS_Form.prototype.get_configuration=function(e,t,i){if(void 0===t)t=!1;if(void 0===i)i=!1;if(this.options_action_cache=[],i||this.loader_on(),!$.WS_Form.configured||t)if("undefined"==typeof wsf_form_json_config){var a=this;this.api_call("config","GET",!1,function(t){a.set_configuration(t.data),window.wsf_form_json_config=t.data,"function"==typeof e&&e()},!1,i)}else this.set_configuration(wsf_form_json_config),"function"==typeof e&&e();else"function"==typeof e&&e()},$.WS_Form.prototype.set_configuration=function(e){if($.WS_Form.settings_plugin=e.settings_plugin,$.WS_Form.settings_form=e.settings_form,$.WS_Form.frameworks=e.frameworks,$.WS_Form.field_types=e.field_types,$.WS_Form.file_types=e.file_types,$.WS_Form.meta_keys=e.meta_keys,$.WS_Form.parse_variables=e.parse_variables,$.WS_Form.parse_variable_help=e.parse_variable_help,$.WS_Form.actions=e.actions,$.WS_Form.calc=e.calc,$.WS_Form.external=e.external,$.WS_Form.analytics=e.analytics,$.WS_Form.tracking=e.tracking,$.WS_Form.ecommerce=e.ecommerce,$.WS_Form.data_sources=e.data_sources,void 0!==$.WS_Form.parse_variables){var t=[];for(var i in $.WS_Form.parse_variables)$.WS_Form.parse_variables.hasOwnProperty(i)&&t.push([i,$.WS_Form.parse_variables[i].priority]);t.sort(function(e,t){var i=void 0!==e[1]?e[1]:0;return(void 0!==t[1]?t[1]:0)-i});var a={};for(var i in t)if(t.hasOwnProperty(i)){var r=t[i][0];a[r]=$.WS_Form.parse_variables[r]}$.WS_Form.parse_variables=a}void 0!==e.debug&&($.WS_Form.debug=e.debug),this.field_type_cache_build(),$.WS_Form.configured=!0},$.WS_Form.prototype.get_form=function(e){if(0==this.form_id)return this.error("error_form_id"),void this.loader_off();if($("#"+this.form_obj_id).attr("data-id",this.form_id),"undefined"==typeof wsf_form_json||void 0===wsf_form_json[this.form_id]){var t=this;this.api_call("form/"+this.form_id+"/full","GET",!1,function(i){t.form=i.form,void 0===window.wsf_form_json&&(window.wsf_form_json=[]),window.wsf_form_json[t.form_id]=i.form,t.data_cache_build(),"function"==typeof e&&e(),t.loader_off()})}else this.form=wsf_form_json[this.form_id],this.data_cache_build(),"function"==typeof e&&e(),this.loader_off()},$.WS_Form.prototype.form_build=function(){this.timer_start=new Date;var e=this.get_form_html(this.form);if(this.form_canvas_obj.html(e),!this.is_admin){var t=this.get_object_meta_value(this.form,"class_form_wrapper","");if(""!=t){var i=this.form_canvas_obj.attr("class");i+=" "+$.trim(t),this.form_canvas_obj.attr("class",i)}}this.form_render(),this.timer_duration=new Date-this.timer_start,$.WS_Form.debug_rendered&&this.debug_info("debug_info_duration",this.timer_duration+"ms")},$.WS_Form.prototype.get_form_html=function(e){if(void 0===e)return"";if(void 0===e.groups)return"";var t=this.is_admin?ws_form_settings.framework_admin:$.WS_Form.settings_plugin.framework,i=$.WS_Form.frameworks.types[t].form[this.is_admin?"admin":"public"],a=this.html_encode(e.label);if(!this.is_admin&&"on"==this.get_object_meta_value(e,"label_render","on"))var r=this.is_admin?"":this.get_object_meta_value(this.form,"label_mask_form",""),s=""!=r?r:void 0!==i.mask_label?i.mask_label:"",o={label:a},_=this.mask_parse(s,o);else _="";var l=this.get_tabs_html(e.groups);l+=this.get_groups_html(e.groups);s=i.mask_single,o={form:l,id:this.form_id_prefix+"tabs",label:_};return this.comment_html("Form: "+a)+this.mask_parse(s,o)+this.comment_html("Form: "+a,!0)},$.WS_Form.prototype.get_tabs_html=function(e){if(1==e.length&&!this.is_admin)return"";var t="",i=this.is_admin?ws_form_settings.framework_admin:$.WS_Form.settings_plugin.framework,a=$.WS_Form.frameworks.types[i].tabs[this.is_admin?"admin":"public"],r=this.get_object_meta_value(this.form,"cookie_tab_index")?this.cookie_get("tab_index",0):0;if(void 0===e)return"";if(e.length>1||this.is_admin){for(var s=0;s<e.length;s++){var o=e[s];t+=this.get_tab_html(o,s,r==s)}var _=a.mask_wrapper,l={tabs:t,id:this.form_id_prefix+"tabs"},n=this.comment_html(this.language("comment_group_tabs"))+this.mask_parse(_,l)+this.comment_html(this.language("comment_group_tabs"),!0)}return n},$.WS_Form.prototype.get_tab_html=function(e,t,i){if(void 0===t)t=0;if(void 0===i)i=!1;var a=this.is_admin?ws_form_settings.framework_admin:$.WS_Form.settings_plugin.framework,r=$.WS_Form.frameworks.types[a].tabs[this.is_admin?"admin":"public"],s=this.html_encode(e.label),o=r.mask_single,_={class:"wsf-tab",data_id:e.id,href:"#"+this.form_id_prefix+"tab-content-"+e.id,label:s};return i&&void 0!==r.active?_.active=r.active:_.active="",this.mask_parse(o,_)},$.WS_Form.prototype.get_groups_html=function(e){if(void 0===e)return"";for(var t=this.is_admin?ws_form_settings.framework_admin:$.WS_Form.settings_plugin.framework,i=$.WS_Form.frameworks.types[t].groups[this.is_admin?"admin":"public"],a=this.get_object_meta_value(this.form,"cookie_tab_index")?this.cookie_get("tab_index",0):0,r="",s=this.is_admin||e.length>1,o=0;o<e.length;o++){var _=e[o];r+=this.get_group_html(_,o==a,s,o)}var l=s?i.mask_wrapper:"#groups",n={class:["wsf-groups"].join(" "),groups:r,id:this.form_id_prefix+"tabs"};return(s?this.comment_html(this.language("comment_groups")):"")+this.mask_parse(l,n)+(s?this.comment_html(this.language("comment_groups"),!0):"")},$.WS_Form.prototype.get_group_html=function(e,t,i,a){if(void 0===t)t=!1;if(void 0===i)i=!0;var r=this.is_admin?ws_form_settings.framework_admin:$.WS_Form.settings_plugin.framework,s=$.WS_Form.frameworks.types[r].groups[this.is_admin?"admin":"public"],o=this.html_encode(e.id),_=this.html_encode(e.label);if(!this.is_admin&&"on"==this.get_object_meta_value(e,"label_render","on"))var l=this.is_admin?"":this.get_object_meta_value(this.form,"label_mask_group",""),n=""!=l?l:void 0!==s.mask_label?s.mask_label:"",c={label:_},d=this.mask_parse(n,c);else d="";var f,u=this.get_sections_html(e),p=[];(void 0!==s.class&&p.push(s.class),this.is_admin)||(""!=(f=this.get_object_meta_value(this.form,"class_group_wrapper",""))&&p.push($.trim(f)),""!=(f=this.get_object_meta_value(e,"class_group_wrapper",""))&&p.push($.trim(f)));t&&void 0!==s.class_active&&p.push(s.class_active);n=i?s.mask_single:"#group",c={class:p.join(" "),id:this.form_id_prefix+"tab-content-"+o,data_id:e.id,data_group_index:a,group:u,label:d};return(i?this.comment_html(this.language("comment_group")+": "+_):"")+this.mask_parse(n,c)+(i?this.comment_html(this.language("comment_group")+": "+_,!0):"")},$.WS_Form.prototype.get_sections_html=function(e){var t="",i=this.is_admin?ws_form_settings.framework_admin:$.WS_Form.settings_plugin.framework,a=$.WS_Form.frameworks.types[i].sections[this.is_admin?"admin":"public"],r=(e.id,e.sections),s={};if("object"==typeof this.submit?void 0!==this.submit.section_repeatable&&(s=this.submit.section_repeatable):!1!==this.submit_auto_populate&&void 0!==this.submit_auto_populate.section_repeatable&&(s=this.submit_auto_populate.section_repeatable),void 0===r)return"";for(var o=0;o<r.length;o++){var _=r[o],l="section_"+_.id,n=!1!==s&&void 0!==s[l]&&void 0!==s[l].index?s[l].index:[!1];for(var c in n)if(n.hasOwnProperty(c)){var d=n[c];t+=this.get_section_html(_,d)}}var f=a.mask_wrapper,u={class:"wsf-sections",id:this.form_id_prefix+"sections-"+e.id,data_id:e.id,sections:t};return this.comment_html(this.language("comment_sections"))+this.mask_parse(f,u)+this.comment_html(this.language("comment_sections"),!0)},$.WS_Form.prototype.get_section_html=function(e,t){if(void 0===t)t=!1;var i=!1;if(!this.is_admin&&((i="on"==this.get_object_meta_value(e,"section_repeatable",""))&&!1===t)){t=0;do{t++}while($("#"+this.form_id_prefix+"section-"+e.id+"-repeat-"+t).length)}var a=[],r=this.is_admin?ws_form_settings.framework_admin:$.WS_Form.settings_plugin.framework,s=$.WS_Form.frameworks.types[r].sections[this.is_admin?"admin":"public"],o=this.column_class_array(e);if(i&&!this.is_admin&&(a.push("data-repeatable"),a.push('data-repeatable-index="'+t+'"')),void 0!==s.class_single&&(o=o.concat(s.class_single)),!this.is_admin){var _;""!=(_=this.get_object_meta_value(this.form,"class_section_wrapper",""))&&o.push($.trim(_)),""!=(_=this.get_object_meta_value(e,"class_section_wrapper",""))&&o.push($.trim(_));var l=this.get_object_meta_value(e,"class_single_vertical_align","");if(l){var n=this.get_field_value_fallback(!1,!1,"class_single_vertical_align",!1);void 0!==n[l]&&o.push(n[l])}}var c=this.html_encode(e.label);if(this.is_admin||"on"==this.get_object_meta_value(e,"label_render","on"))var d=this.is_admin?"":this.get_object_meta_value(this.form,"label_mask_section",""),f=""!=d?d:void 0!==s.mask_label?s.mask_label:"",u={label:c},p=this.mask_parse(f,u);else p="";this.is_admin||("on"==this.get_object_meta_value(e,"disabled_section","")&&a.push("disabled"),"on"==this.get_object_meta_value(e,"hidden_section","")&&a.push('style="display:none;"'));if(0==e.child_count)var h=this.get_fields_html(e,t);else h=this.get_sections_html(e.children);f=s.mask_single,u={attributes:(a.length>0?" ":"")+a.join(" "),class:o.join(" "),id:this.form_id_prefix+"section-"+e.id+(t?"-repeat-"+t:""),data_id:e.id,section:h,label:p,section_id:$.WS_Form.settings_plugin.helper_section_id?'<span class="wsf-section-id">'+this.language("id")+": "+e.id+"</span>":""};return this.comment_html(this.language("comment_section")+": "+c)+this.mask_parse(f,u)+this.comment_html(this.language("comment_section")+": "+c,!0)},$.WS_Form.prototype.get_fields_html=function(e,t){var i="on"==this.get_object_meta_value(e,"section_repeatable","");if(void 0===t)t=!!i&&0;var a="",r=this.is_admin?ws_form_settings.framework_admin:$.WS_Form.settings_plugin.framework,s=$.WS_Form.frameworks.types[r].fields[this.is_admin?"admin":"public"],o=(e.id,e.fields),_=this.html_encode(e.label);if(!this.is_admin&&"on"==this.get_object_meta_value(e,"label_render","on"))var l=this.is_admin?"":this.get_object_meta_value(this.form,"label_mask_section",""),n=""!=l?l:void 0!==s.mask_wrapper_label?s.mask_wrapper_label:"",c={label:_},d=this.mask_parse(n,c);else d="";if(void 0===o)return"";for(var f=0;f<o.length;f++){var u=o[f];a+=this.get_field_html(u,t)}n=s.mask_wrapper,c={id:this.form_id_prefix+"fields-"+e.id,data_id:e.id,fields:a,label:d};return this.comment_html(this.language("comment_fields"))+this.mask_parse(n,c)+this.comment_html(this.language("comment_fields"),!0)},$.WS_Form.prototype.value_populate_process=function(e,t){switch(t.type){case"datetime":return void 0!==e.presentation_full?e.presentation_full:e;case"select":case"checkbox":case"radio":case"price_select":case"price_checkbox":case"price_radio":return"object"==typeof e?e.map(e=>e.toString()):e;default:return e}},$.WS_Form.prototype.get_field_html=function(e,t){if(void 0===t)t=!1;var i=[];!1!==t&&i.push('data-repeatable-index="'+t+'"');var a=this.is_admin?ws_form_settings.framework_admin:$.WS_Form.settings_plugin.framework,r=$.WS_Form.frameworks.types[a].fields[this.is_admin?"admin":"public"];this.is_admin||"on"==this.get_object_meta_value(e,"hidden","")&&i.push('style="display:none;"');var s=this.column_class_array(e),o=this.get_field_value_fallback(e.type,!1,"class_single",!1,r);if(!1!==o&&(s=s.concat(o)),!this.is_admin){var _;""!=(_=this.get_object_meta_value(this.form,"class_field_wrapper",""))&&s.push($.trim(_)),""!=(_=this.get_object_meta_value(e,"class_field_wrapper",""))&&s.push($.trim(_));var l=this.get_object_meta_value(e,"class_single_vertical_align","");if(l){var n=this.get_field_value_fallback(e.type,!1,"class_single_vertical_align",!1);void 0!==n[l]&&s.push(n[l])}}var c=!1!==t?"_"+t:"";if("object"==typeof this.submit){if(void 0!==this.submit.meta&&void 0!==this.submit.meta[ws_form_settings.field_prefix+e.id+c]&&void 0!==this.submit.meta[ws_form_settings.field_prefix+e.id+c].value){var d=this.submit.meta[ws_form_settings.field_prefix+e.id+c].value;d=this.value_populate_process(d,e)}}else if(!1!==this.submit_auto_populate&&void 0!==this.submit_auto_populate.data&&void 0!==this.submit_auto_populate.data[ws_form_settings.field_prefix+e.id+c]){d=this.submit_auto_populate.data[ws_form_settings.field_prefix+e.id+c];d=this.value_populate_process(d,e)}var f=this.is_admin?"":this.get_field_html_single(e,d,!1,t),u=this.html_encode(e.label);if(void 0===$.WS_Form.field_type_cache[e.type])return"";var p=$.WS_Form.field_type_cache[e.type];if(void 0!==p.pro_required&&p.pro_required)return"";var h=!this.is_admin&&(void 0!==p.mask_wrappers_drop&&p.mask_wrappers_drop);if("recaptcha"!=e.type||this.is_admin||"invisible"!=this.get_object_meta_value(e,"recaptcha_recaptcha_type","default")||(h=!0),h)var m="#field";else m=this.get_field_value_fallback(e.type,!1,"mask_single",!1,r);switch(e.type){case"checkbox":case"price_checkbox":var v=this.get_object_meta_value(e,"checkbox_min",!1),b=this.get_object_meta_value(e,"checkbox_max",!1);if(!1===v&&!1===b)break;!1!==v&&(v=parseInt(v))>0&&i.push('data-checkbox-min="'+v+'"'),!1!==b&&(b=parseInt(b))>=0&&i.push('data-checkbox-max="'+b+'"')}var g={attributes:(i.length>0?" ":"")+i.join(" "),class:s.join(" "),id:this.get_part_id(e.id,t,"field-wrapper"),data_id:e.id,type:e.type,field:f};return this.comment_html(this.language("comment_field")+": "+u)+this.mask_parse(m,g)+this.comment_html(this.language("comment_field")+": "+u,!0)},$.WS_Form.prototype.field_type_cache_build=function(){if(this.is_admin||($.WS_Form.field_type_cache=$.WS_Form.field_types),$.WS_Form.field_type_cache.length>0)return!0;for(var e in $.WS_Form.field_types){var t=$.WS_Form.field_types[e].types;for(var i in t)$.WS_Form.field_type_cache[i]=t[i]}},$.WS_Form.prototype.html_encode=function(e){if("string"!=typeof e)return e;var t=this.replace_all(e,"&","&#38;");return t=this.replace_all(t,"<","&lt;"),t=this.replace_all(t,">","&gt;"),t=this.replace_all(t,'"',"&quot;")},$.WS_Form.prototype.js_string_encode=function(e){return"string"!=typeof e?e:this.replace_all(e,"'","\\'")},$.WS_Form.prototype.loader_on=function(){$("#wsf-loader").addClass("wsf-loader-on")},$.WS_Form.prototype.loader_off=function(){$("#wsf-loader").removeClass("wsf-loader-on")},$.WS_Form.prototype.comment_html=function(e,t){if(void 0===t)t=!1;return $.WS_Form.settings_plugin.comments_html?"\x3c!-- "+(t?"/":"")+e+" --\x3e\n"+(t?"\n":""):""},$.WS_Form.prototype.comment_css=function(e){return $.WS_Form.settings_plugin.comments_css?"\t/* "+e+" */\n":""},$.WS_Form.prototype.get_object_value=function(e,t,i){if(void 0===i)i=!1;return void 0===e?i:void 0===e[t]?i:e[t]},$.WS_Form.prototype.get_field_value_fallback=function(e,t,i,a,r){if(void 0===a)a=!1;if(void 0===r)r=this.framework_fields;var s=r,o=$.WS_Form.field_type_cache[e];if(!1!==t){if(!(void 0===s||void 0===s[t]||void 0===s[t].field_types||void 0===s[t].field_types[e]||void 0===s[t].field_types[e][i]))return s[t].field_types[e][i];if(!(void 0===s||void 0===s[t]||void 0===s[t][i]))return s[t][i]}return void 0===s||void 0===s.field_types||void 0===s.field_types[e]||void 0===s.field_types[e][i]?void 0===s||void 0===s[i]?void 0===o?a:void 0===o[i]?a:o[i]:s[i]:s.field_types[e][i]},$.WS_Form.prototype.get_object_data=function(e,t,i){if(void 0===i)i=!1;switch(e){case"form":return i?this.object_data_scratch:this.form;case"group":return i?this.object_data_scratch:this.group_data_cache[t];case"section":return i?this.object_data_scratch:this.section_data_cache[t];case"field":return i?this.object_data_scratch:this.field_data_cache[t];case"conditional":return this.conditional;case"action":return this.action}return!1},$.WS_Form.prototype.get_object_meta=function(e,t){switch(e){case"form":var i=$.WS_Form.settings_form.sidebars.form.meta;break;case"group":i=$.WS_Form.settings_form.sidebars.group.meta;break;case"section":i=$.WS_Form.settings_form.sidebars.section.meta;break;case"field":var a=this.field_data_cache[t];i=$.WS_Form.field_type_cache[a.type]}return i},$.WS_Form.prototype.get_object_meta_value=function(e,t,i,a,r){if(void 0===i)i=!1;if(void 0===a)a=!1;if(void 0===r)r=!1;if(void 0===e)return i;if(void 0===e.meta)return i;if(void 0===e.meta[t]){if(!a)return i;this.set_object_meta_value(e,t,i)}return r&&"string"==typeof e.meta[t]?this.parse_variables_process(e.meta[t]).output:e.meta[t]},$.WS_Form.prototype.has_object_meta_key=function(e,t){return void 0!==e&&void 0!==e.meta&&void 0!==e.meta[t]&&""!=e.meta[t]},$.WS_Form.prototype.parse_variables_process=function(e,t,i,a,r,s){if("string"!=typeof e)return this.parse_variables_process_error(e);if(-1==e.indexOf("#"))return this.parse_variables_process_error(e);if(void 0===t)t=!1;if(void 0===i)i=!1;if(void 0===a)a=!1;if(void 0===s)s=1;var o={},_={},l=[];if(s>100)return this.error("error_parse_variable_syntax_error_depth","","parse_variables"),this.parse_variables_process_error(this.language("error_parse_variable_syntax_error_depth"));for(var n in $.WS_Form.parse_variables)if($.WS_Form.parse_variables.hasOwnProperty(n)){var c=$.WS_Form.parse_variables[n];if((c.ignore_prefix,c.ignore_prefix)||-1!==e.indexOf("#"+n))for(var d in c.variables)if(c.variables.hasOwnProperty(d)&&-1!==e.indexOf("#"+d,m)){var f=c.variables[d],u=void 0!==f.value&&f.value,p="object"==typeof f.attributes&&f.attributes,h=void 0!==f.single_parse&&f.single_parse;if(!1!==p||!1===u){if(("object"==typeof f.attributes?f.attributes.length:0)>0){var m=0;do{var v=e.indexOf("#"+d,m);if(-1!==v){var b=-1,g=-1,y=e.substring(v+d.length+1);if("("===y.substring(0,1)&&(b=v+d.length+1,-1!==(g=this.get_bracket_finish_index(y))&&(g+=b)),-1===b||-1===g){m+=d.length+1,S="#"+d;var k=[]}else{m=g;var w=e.substr(b+1,g-1-b),S=e.substr(v,g+1-v);k=this.string_to_attributes(w)}for(var F in p)if(p.hasOwnProperty(F)){var x=p[F],W=x.id,j=void 0!==k[F];if((x.required,x.required)&&!j)return this.error("error_parse_variable_syntax_error_attribute","#"+d+" (Expected "+W+")","parse-variables"),this.parse_variables_process_error(this.language("error_parse_variable_syntax_error_attribute","#"+d+" (Expected "+W+")"));var O=(x.default,x.default);!1===O||j||(k[F]=O);var M=void 0!==x.valid&&x.valid;if(!1!==M&&!M.includes(k[F]))return this.error("error_parse_variable_syntax_error_attribute_invalid","#"+d+" (Expected "+M.join(", ")+")","parse-variables"),this.parse_variables_process_error(this.language("error_parse_variable_syntax_error_attribute_invalid","#"+d+" (Expected "+M.join(", ")+")"))}var C="";switch(d){case"calc":var E=(me=this.parse_variables_process(k[0],t,!0,a,r,s+1)).output;if("object"==typeof me.fields&&(l=l.concat(me.fields)),C=this.eval_process(E),!1!==a&&void 0!==a&&1==s&&!i){var P=me.fields,D=[],T=[];for(var q in P)if(P.hasOwnProperty(q)){var I=P[q];-1===T.indexOf(I)&&(T.push(I),D.push(I))}this.calc.push({field:a,type:r,value:e,field_ids_touched:D,section_repeatable_index:t}),this.log("log_calc_registered",a.label+" - "+e+" ("+this.language("log_calc_registered_triggered",D.join(", "))+")","calc")}break;case"field":case"ecommerce_field_price":if(isNaN(k[0]))return this.error("error_parse_variable_syntax_error_field_id",k[0],"parse-variables"),this.parse_variables_process_error(this.language("error_parse_variable_syntax_error_field_id",k[0]));if((V=parseInt(k[0]))===parseInt(a.id))return this.error("error_parse_variable_syntax_error_calc_loop",S,"parse-variables"),this.parse_variables_process_error(this.language("error_parse_variable_syntax_error_calc_loop",S));if(void 0===this.field_data_cache[V])return this.error("error_parse_variable_syntax_error_field_id",k[0],"parse-variables"),this.parse_variables_process_error(this.language("error_parse_variable_syntax_error_field_id",k[0]));l.push(V);var N=this.field_data_cache[V];if(void 0===$.WS_Form.field_type_cache[N.type])break;var z=$.WS_Form.field_type_cache[N.type],R=void 0!==z.submit_array&&z.submit_array,A=void 0!==N.section_repeatable_section_id&&N.section_repeatable_section_id,L=void 0!==a.section_repeatable_section_id&&a.section_repeatable_section_id,Y=t;C=!1;if(!1!==A&&!1!==L)C=this.get_field_value(N,Y,R);if(!1!==A&&!1===L)C=this.get_field_value(N,!0,R);if(!1===A)C=this.get_field_value(N,!1,R);if(!1===C)switch(N.type){case"price_select":case"price_checkbox":case"price_radio":case"select":case"checkbox":case"radio":var U=this.get_data_source(N);C=!1!==U.default_value?U.default_value:[];break;default:var H=this.get_object_meta_value(N,"default_value","");"object"==typeof(me=this.parse_variables_process(H,t,i,N,r,s+1)).fields&&(l=l.concat(me.fields)),C=[me.output]}if(i&&C.length){if(!(z.calc_out,z.calc_out))return void this.error("error_parse_variable_syntax_error_calc_out","ID: "+i.field.id,"parse-variables");var J=0;switch(N.type){case"price_select":case"price_checkbox":case"price_radio":case"price":case"price_subtotal":case"cart_price":for(var G in C)C.hasOwnProperty(G)&&(J+=this.get_number(C[G],0));C=J;break;case"datetime":C=1===C.length&&!1!==(C=""!=C[0]&&this.get_number(new Date(C[0]).getTime()))?C/1e3:"";break;default:for(var G in C)C.hasOwnProperty(G)&&(J+=this.get_number(C[G],0,!1));C=J}}else C=C.join(",");if("ecommerce_field_price"==d)C=this.get_price(C);break;case"select_option_text":if(isNaN(k[0]))return this.error("error_parse_variable_syntax_error_field_id",k[0],"parse-variables"),this.parse_variables_process_error(this.language("error_parse_variable_syntax_error_field_id",k[0]));var V=k[0];(Q=k[1])||(Q=", ");var Z=ws_form_settings.field_prefix+parseInt(V)+(t?"["+t+"]":"");if((K=$('[name="'+Z+'[]"] option:selected',this.form_canvas_obj)).length)C=$.map(K,function(e,t){return $(e).text()}).join(Q);break;case"query_var":C=this.get_query_var(k[0]);break;case"section_row_count":if(isNaN(k[0]))return this.error("error_parse_variable_syntax_error_section_id",k[0],"parse-variables"),this.parse_variables_process_error(this.language("error_parse_variable_syntax_error_section_id",k[0]));var B=k[0];if(void 0===this.section_data_cache[B])return this.error("error_parse_variable_syntax_error_section_id",k[0],"parse-variables"),this.parse_variables_process_error(this.language("error_parse_variable_syntax_error_section_id",k[0]));var X=$('[data-repeatable][data-id="'+B+'"]',this.form_canvas_obj);C=X.length?X.length:0;break;case"checkbox_label":case"radio_label":if(isNaN(k[0]))return this.error("error_parse_variable_syntax_error_field_id",k[0],"parse-variables"),this.parse_variables_process_error(this.language("error_parse_variable_syntax_error_field_id",k[0]));var Q;V=k[0];(Q=k[1])||(Q=", ");var K;Z=ws_form_settings.field_prefix+parseInt(V)+(t?"["+t+"]":"");if((K=$('[name="'+Z+'[]"]:checked',this.form_canvas_obj)).length)C=$.map(K,function(e,t){return $('label[for="'+$(e).attr("id")+'"]').text()}).join(Q);break;case"post_date_custom":case"server_date_custom":case"blog_date_custom":var ee=new Date(u);C=this.date_format(ee,k[0]);break;case"client_date_custom":ee=new Date;C=this.date_format(ee,k[0]);break;case"random_number":var te=parseInt(this.get_number(k[0])),ie=parseInt(this.get_number(k[1]));C=Math.floor(Math.random()*(ie-te+1))+te;break;case"random_string":var ae=parseInt(this.get_number(k[0])),re=k[1],se=re.length;C="";for(var oe=0;oe<ae;oe++)C+=re[Math.floor(Math.random()*se)];break;case"abs":"object"==typeof(me=this.parse_variables_process(k[0],t,i,a,r,s)).fields&&(l=l.concat(me.fields));var _e=this.eval_process(me.output);C=Math.abs(_e);break;case"ceil":"object"==typeof(me=this.parse_variables_process(k[0],t,i,a,r,s)).fields&&(l=l.concat(me.fields));_e=this.eval_process(me.output);C=Math.ceil(_e);break;case"cos":"object"==typeof(me=this.parse_variables_process(k[0],t,i,a,r,s)).fields&&(l=l.concat(me.fields));_e=this.eval_process(me.output);C=Math.cos(_e);break;case"exp":"object"==typeof(me=this.parse_variables_process(k[0],t,i,a,r,s)).fields&&(l=l.concat(me.fields));_e=this.eval_process(me.output);C=Math.exp(_e);break;case"floor":"object"==typeof(me=this.parse_variables_process(k[0],t,i,a,r,s)).fields&&(l=l.concat(me.fields));_e=this.eval_process(me.output);C=Math.floor(_e);break;case"log":"object"==typeof(me=this.parse_variables_process(k[0],t,i,a,r,s)).fields&&(l=l.concat(me.fields));_e=this.eval_process(me.output);C=Math.log(_e);break;case"round":var le=this.get_number(k[1],0,!1);"object"==typeof(me=this.parse_variables_process(k[0],t,i,a,r,s)).fields&&(l=l.concat(me.fields));C=this.eval_process(me.output,le);break;case"sin":"object"==typeof(me=this.parse_variables_process(k[0],t,i,a,r,s)).fields&&(l=l.concat(me.fields));_e=this.eval_process(me.output);C=Math.sin(_e);break;case"sqrt":"object"==typeof(me=this.parse_variables_process(k[0],t,i,a,r,s)).fields&&(l=l.concat(me.fields));_e=this.eval_process(me.output);C=Math.sqrt(_e);break;case"tan":"object"==typeof(me=this.parse_variables_process(k[0],t,i,a,r,s)).fields&&(l=l.concat(me.fields));_e=this.eval_process(me.output);C=Math.tan(_e);break;case"avg":J=0;if(1===k.length)"object"==typeof(me=this.parse_variables_process(k[0],t,i,a,r,s)).fields&&(l=l.concat(me.fields)),k=this.string_to_attributes(me.output);for(var ne in k){if(k.hasOwnProperty(ne))"object"==typeof(me=this.parse_variables_process(k[ne],t,i,a,r,s)).fields&&(l=l.concat(me.fields)),J+=_e=this.eval_process(me.output)}C=J/k.length}h?_[S.substring(1)]=this.html_encode(C):o[S.substring(1)]=this.html_encode(C)}}while(-1!==v)}}else o[d]=u}}if(-1!=e.indexOf("form")&&(o.form_id=this.form_id,o.form_instance_id=this.form_instance_id,o.form_obj_id=this.form_obj_id,o.form_label=this.form.label,o.form_checksum=this.form.published_checksum,o.form_framework=this.framework.name),-1!=e.indexOf("submit")&&(o.submit_hash=this.hash),-1!=e.indexOf("client")){var ce=new Date;o.client_time=this.date_format(ce,ws_form_settings.time_format),o.client_date=this.date_format(ce,ws_form_settings.date_format)}var de=this.get_currency();if(-1!=e.indexOf("ecommerce"))for(var fe in void 0===this.ecommerce_cart_price_type.total&&(this.ecommerce_cart_price_type.total={float:0,string:this.get_price(0,de,!1),currency:this.get_price(0,de)}),o.ecommerce_cart_total_float=this.ecommerce_cart_price_type.total.float,o.ecommerce_cart_total_currency=this.ecommerce_cart_price_type.total.currency,o.ecommerce_cart_total=this.ecommerce_cart_price_type.total.string,$.WS_Form.ecommerce.cart_price_types)$.WS_Form.ecommerce.cart_price_types.hasOwnProperty(fe)&&(void 0===this.ecommerce_cart_price_type[fe]&&(this.ecommerce_cart_price_type[fe]={float:0,string:this.get_price(0,de,!1),currency:this.get_price(0,de)}),o["ecommerce_cart_"+fe+"_float"]=this.ecommerce_cart_price_type[fe].float,o["ecommerce_cart_"+fe+"_currency"]=this.ecommerce_cart_price_type[fe].currency,o["ecommerce_cart_"+fe]=this.ecommerce_cart_price_type[fe].string);var ue=[],pe=Object.keys(o);pe.sort(),pe.reverse();for(var he=0;he<pe.length;he++)ue[pe[he]]=o[pe[he]];o=ue;var me,ve=e;(e=this.mask_parse(e,o),(e=this.mask_parse(e,_,!0))!==ve&&-1!==e.indexOf("#"))&&(e=(me=this.parse_variables_process(e,t,i,a,r,s+1)).output,"object"==typeof me.fields&&(l=l.concat(me.fields)));return{output:e,fields:l}},$.WS_Form.prototype.eval_process=function(eval_input,decimals){try{var eval_output=eval(eval_input);return eval_output===1/0&&(eval_output=0),this.get_number(eval_output,0,!1,decimals)}catch(e){return 0}},$.WS_Form.prototype.string_to_attributes=function(e){if("string"!=typeof e)return[];if(""==e)return[];var t=1,i=0,a=!1,r="",s=[];for(e.replace("“",'"'),e.replace("”",'"');t>0||i<e.length;){var o=e[i];if(null==o)break;if(","!==o||1!==t||a)if('"'!==o){if(!a){switch(o){case"(":t++;break;case")":t--}if(0===t)break}r+=o,i++}else a=!a,i++;else s.push(r),r="",i++}return r.length&&s.push(r),s.length&&(s=s.map(function(e){return e=(e=$.trim(e)).replace(/^"(.+(?="$))"$/,"$1")})),s},$.WS_Form.prototype.get_bracket_finish_index=function(e){if(""===e)return-1;e.replace("“",'"'),e.replace("”",'"');for(var t=1,i=1,a=!1;t>0||i<e.length;){var r=e[i];if(void 0===r)break;if('"'!==r){if(!a){switch(r){case"(":t++;break;case")":t--}if(0===t)break}i++}else a=!a,i++}return 0===t?i:(this.error("error_parse_variable_syntax_error_bracket_closing",e,"parse-variables"),-1)},$.WS_Form.prototype.parse_variables_process_error=function(e){return{output:e,functions:[],fields:[]}},$.WS_Form.prototype.get_field_value=function(e,t,i){if(void 0===t)t=!1;if(void 0===i)i=!1;if(!1===t){var a='[name="'+ws_form_settings.field_prefix+e.id;i&&(a+="[]")}else if(!0===t)a='[name^="'+ws_form_settings.field_prefix+e.id+"[";else{a='[name="'+ws_form_settings.field_prefix+e.id+"["+t+"]";i&&(a+="[]")}if(!$(a+='"]').length)return!1;switch(e.type){case"checkbox":case"radio":case"price_checkbox":case"price_radio":a+=":checked"}var r=[];return $(a,this.form_canvas_ob).each(function(){r.push($(this).val())}),r},$.WS_Form.prototype.get_data_source=function(e){var t={default_value:[]};e=this.field_data_cache[e.id];if(void 0===$.WS_Form.field_type_cache[e.type])return!1;var i=$.WS_Form.field_type_cache[e.type];if(void 0===i.data_source)return!1;var a=i.data_source;if(void 0===a.type)return!1;switch(t.type=a.type,t.type){case"data_grid":if(void 0===a.id)return!1;t.meta_key_data_grid=a.id,t.meta_key_value_column=(i.datagrid_column_value,i.datagrid_column_value),t.data_grid=this.get_object_meta_value(e,t.meta_key_data_grid,!1),t.value_column_id=this.get_object_meta_value(e,t.meta_key_value_column,!1);var r=(t.data_grid.columns,t.data_grid.columns);for(var s in t.value_column_index=!1,r)if(r.hasOwnProperty(s)){var o=r[s];if(void 0!==o.id&&o.id==t.value_column_id){t.value_column_index=s;break}}if(!1!==t.value_column_id&&void 0!==t.data_grid.groups){var _=t.data_grid.groups;for(var l in _)if(_.hasOwnProperty(l)){var n=_[l];if(void 0!==n.rows){var c=n.rows;for(var d in c)if(c.hasOwnProperty(d)){var f=c[d];if(void 0!==f.default&&"on"===f.default){if(void 0===f.data)continue;if(void 0===f.data[t.value_column_index])continue;t.default_value.push(f.data[t.value_column_index])}}}}}}return t},$.WS_Form.prototype.get_query_var=function(e){var t=window.location.href;if(!t)return"";try{e=e.replace(/[\[\]]/g,"\\$&");var i=new RegExp("[?&]"+e+"(=([^&#]*)|&|#|$)").exec(t);return i&&i[2]?decodeURIComponent(i[2].replace(/\+/g," ")):""}catch(e){return""}},$.WS_Form.prototype.set_object_meta_value=function(e,t,i){return void 0===e?i:void 0===e.meta?i:void(e.meta[t]=i)},$.WS_Form.prototype.column_class_array=function(e,t){if(void 0===t)t="breakpoint";var i=[],a=this.framework.breakpoints,r=this.framework.columns.column_class,s=this.framework.columns.offset_class,o=0,_=0;for(var l in a)if(a.hasOwnProperty(l)){var n=a[l],c=this.get_object_meta_value(e,t+"_size_"+l,"");if(""==c&&(c="0"),0==(c=parseInt(c))){if(void 0!==n.column_size_default)switch(n.column_size_default){case"column_count":c=parseInt($.WS_Form.settings_plugin.framework_column_count);break;default:c=parseInt(n.column_size_default)}}else c=parseInt(c);if(c>0&&c!=o){var d={id:n.id,size_word:void 0===this.number_to_word[c]?c:this.number_to_word[c],size:c};if(void 0!==n.column_class)var f=n.column_class;else f=r;var u=this.mask_parse(f,d);i.push(u),o=c}var p=this.get_object_meta_value(e,t+"_offset_"+l,""),h=!1;if(""!==p&&p!=_){d={id:n.id,offset_word:void 0===this.number_to_word[p]?p:this.number_to_word[p],offset:p};if(void 0!==n.offset_class)var m=n.offset_class;else m=s;u=this.mask_parse(m,d);i.push(u),_=p,h=!0}h&&i.push("wsf-has-offset")}return i},$.WS_Form.prototype.column_classes_render=function(e,t,i){if(void 0===i)i=!0;for(var a=this.column_class_array(t),r=0;r<a.length;r++)i?e.addClass(a[r]):e.removeClass(a[r])},$.WS_Form.prototype.mask_parse=function(e,t,i){if("string"!=typeof e)return"";if(void 0===i)i=!1;var a=[];for(var r in t)if(t.hasOwnProperty(r)){var s=t[r];a.push({key:r,value:s})}for(var o in a.sort(function(e,t){return e.key<t.key?1:-1}),a)if(a.hasOwnProperty(o)){var _=a[o];r=_.key,s=_.value;e=i?e.replace("#"+r,s):this.replace_all(e,"#"+r,s)}return e},$.WS_Form.prototype.get_field_label=function(e){return this.field_data_cache[e].label},$.WS_Form.prototype.get_section_label=function(e){return this.section_data_cache[e].label},$.WS_Form.prototype.language=function(e,t,i){if(void 0===t)t=!1;if(void 0===i)i=!0;var a="",r="";if("error_language"==e)a="Language reference not found: %s";else if(null!==$.WS_Form.settings_form&&void 0!==$.WS_Form.settings_form.language&&void 0!==$.WS_Form.settings_form.language[e])a=$.WS_Form.settings_form.language[e];return""!=a&&(!1!==t&&(a=this.replace_all(a,"%s",t)),r=i?this.html_encode(a):a),""==r&&(r=""==t?"[LANGUAGE NOT FOUND: "+e+"]":t,null!==$.WS_Form.settings_form&&this.error("error_language",e)),r},$.WS_Form.prototype.cookie_set=function(e,t,i,a){if(void 0===i)i=!0;if(void 0===a)a=!0;var r=this.get_object_value($.WS_Form.settings_plugin,"cookie_prefix");if(!r)return!1;if(i){var s=this.get_object_value($.WS_Form.settings_plugin,"cookie_timeout");if(!s)return!1;var o=new Date;o.setTime(o.getTime()+1e3*s);var _="expires="+o.toUTCString()+";"}else _="";var l=r+"_"+(a?this.form_id+"_":"")+e+"="+t+";"+_+"path=/";return document.cookie=l,!0},$.WS_Form.prototype.cookie_get=function(e,t,i){if(void 0===i)i=!0;var a=this.get_object_value($.WS_Form.settings_plugin,"cookie_prefix");if(!a)return t;for(var r=a+"_"+(i?this.form_id+"_":"")+e+"=",s=decodeURIComponent(document.cookie).split(";"),o=0;o<s.length;o++){for(var _=s[o];" "==_.charAt(0);)_=_.substring(1);if(0==_.indexOf(r))return _.substring(r.length,_.length)}return void 0!==t?t:""},$.WS_Form.prototype.cookie_clear=function(e,t){if(void 0===t)t=!0;var i=this.get_object_value($.WS_Form.settings_plugin,"cookie_prefix");if(!i)return!1;var a=new Date;a.setTime(a.getTime()-36e5);var r="expires="+a.toUTCString(),s=i+"_"+(t?this.form_id+"_":"")+e+"='';"+r+";path=/";return document.cookie=s,!0},$.WS_Form.prototype.set_caret_at_end=function(e){var t=e.value.length;if(document.selection){e.focus();var i=document.selection.createRange();i.moveStart("character",-t),i.moveStart("character",t),i.moveEnd("character",0),i.select()}else(e.selectionStart||"0"==e.selectionStart)&&(e.selectionStart=t,e.selectionEnd=t,e.focus())},$.WS_Form.prototype.tabs=function(e,t){if(void 0===t)t={};var i=void 0!==t.selector?t.selector:"li",a=void 0!==t.active?t.active:0,r=void 0!==t.activate&&t.activate,s=this,o=0;e.addClass("wsf-tabs"),$(i,e).each(function(){var e=$(this);e.find('a[href*="#"]:not([href="#"])').each(function(){$(this).attr("data-tab-index",o),$(this).off("click").on("click",function(t){t.preventDefault(),t.stopPropagation(),t.stopImmediatePropagation(),s.tab_show($(this),e,r)}),o==a&&s.tab_show($(this),e)}),o++})},$.WS_Form.prototype.tabs_destroy=function(e,t){if(void 0===t)t={};var i=void 0!==t.selector?t.selector:"li";$(i,e).each(function(){$(this).find("a").each(function(){$(this).removeAttr("data-tab-index"),$(this).off("click")})}),e.removeClass("wsf-tabs")},$.WS_Form.prototype.tab_show=function(e,t,i){var a=this;t.siblings().each(function(){var e=$(this).find("a").first();a.tab_hide(e,$(this))}),t.addClass("wsf-tab-active");var r=e.attr("href");($(r).show(),"function"==typeof i)&&i(e.attr("data-tab-index"));e.trigger("tab_show")},$.WS_Form.prototype.tab_hide=function(e,t){t.removeClass("wsf-tab-active");var i=e.attr("href");$(i).hide()},$.WS_Form.prototype.data_cache_build=function(){if(void 0===this.form)return!1;if(void 0===this.form.groups)return!1;this.group_data_cache=[],this.section_data_cache=[],this.field_data_cache=[],this.action_data_cache=[];for(var e=0;e<this.form.groups.length;e++){var t=this.form.groups[e];this.data_cache_build_group(t)}var i=this.get_object_meta_value(this.form,"action",!1);if(!1!==i&&void 0!==i.groups&&void 0!==i.groups[0]&&"object"==typeof i.groups[0].rows&&0!=i.groups[0].rows.length){var a=i.groups[0].rows;for(var r in a)if(a.hasOwnProperty(r)){var s=a[r];void 0!==s.data&&0!=s.data.length&&(this.action_data_cache[s.id]={label:s.data[0]})}}return!0},$.WS_Form.prototype.data_cache_build_group=function(e){this.group_data_cache[e.id]=e;for(var t=0;t<e.sections.length;t++){var i=e.sections[t];this.data_cache_build_section(i)}return!0},$.WS_Form.prototype.data_cache_build_section=function(e){this.section_data_cache[e.id]=e;var t=void 0!==e.meta&&void 0!==e.meta.section_repeatable&&"on"==e.meta.section_repeatable;if(0==e.child_count)for(var i=0;i<e.fields.length;i++){var a=e.fields[i];t&&(a.section_repeatable_section_id=e.id),void 0!==$.WS_Form.field_type_cache[a.type]&&(this.field_data_cache[a.id]=a)}else this.data_cache_build_section(e.children);return!0},$.WS_Form.prototype.array_randomize=function(e){for(var t=e.length-1;t>0;t--){var i=Math.floor(Math.random()*(t+1)),a=e[t];e[t]=e[i],e[i]=a}return e},$.WS_Form.prototype.get_nice_duration=function(e){if(0==e)return"-";var t=~~(e/3600),i=~~(e%3600/60),a=e%60,r="";return t>0&&(r+=t+" "+this.language("submit_duration_hours")+" "),i>0&&(r+=i+" "+this.language("submit_duration_minutes")+" "),r+=a+" "+this.language("submit_duration_seconds")},$.WS_Form.prototype.get_field_html_single=function(e,t,i,a){if(void 0===i)i=!1;if(void 0===a)a=!1;var r=[],s=void 0!==t,o=!1!==a?"-repeat-"+a:"",_=this.get_part_id(e.id,a),l=this.get_field_name(e.id,a),n=["default","class","input_type_datetime","multiple","min","max","step"],c=["class"];if(void 0===$.WS_Form.field_type_cache[e.type])return"";var d=$.WS_Form.field_type_cache[e.type];if(d.pro_required)return this.language("error_pro_required");if(i)var f=!0;else f=this.get_object_meta_value(e,"label_render",!0);if(this.get_field_value_fallback(e.type,u,"label_disabled",!1)&&(f=!1),void 0!==d.submit_array&&d.submit_array&&(l+="[]"),f&&!i){var u=this.get_object_meta_value(e,"label_position","default");"default"==(u=this.get_field_value_fallback(e.type,!1,"label_position_force",u))&&(u=this.get_object_meta_value(this.form,"label_position_form","top"))}else u="top";var p=void 0!==d.mask_wrappers_drop&&d.mask_wrappers_drop;"recaptcha"==e.type&&"invisible"==this.get_object_meta_value(e,"recaptcha_recaptcha_type","default")&&(p=!0);var h=p?"#field":this.get_field_value_fallback(e.type,u,"mask","#field"),m=this.get_field_value_fallback(e.type,u,"mask_field",""),v=f?this.get_field_value_fallback(e.type,u,"mask_field_label",""):"",b=this.get_field_value_fallback(e.type,u,"mask_field_label_hide_group",!1),g=this.get_field_value_fallback(e.type,u,"mask_help",""),y=this.get_field_value_fallback(e.type,u,"mask_help_append",""),k=this.get_field_value_fallback(e.type,u,"mask_help_append_separator",""),w=this.get_field_value_fallback(e.type,u,"mask_invalid_feedback",""),S=this.get_object_meta_value(e,"default_value","",!1,!1),F=this.parse_variables_process(S,a,!1,e,"field_value").output,x=this.get_object_meta_value(e,"text_editor","",!1,!1),W=this.parse_variables_process(x,a,!1,e,"field_text_editor").output,j=this.get_object_meta_value(e,"html_editor","",!1,!1),O=this.parse_variables_process(j,a,!1,e,"field_html").output;if(!s){t="";""!=F&&(t=this.html_encode(F)),""!=W&&(t=W),""!=O&&(t=O)}if(s&&"price_range"==e.type&&(t=this.get_number(t)),!i){var M=this.get_object_meta_value(this.form,"class_field","",!1,!0),C=this.get_object_meta_value(e,"class_field","",!1,!0);if(""!=M&&(C+=(""==C?"":" ")+M),!this.get_object_meta_value(e,"class_field_full_button_remove","")){var E=this.get_field_value_fallback(e.type,u,"class_field_full_button","");"object"==typeof E&&(C+=" "+E.join(" "))}if(!(P=this.get_object_meta_value(e,"class_field_button_type",!1)))var P=this.get_field_value_fallback(e.type,u,"class_field_button_type_fallback",!1);if(P){var D=this.get_field_value_fallback(e.type,u,"class_field_button_type","");void 0!==D[P]&&(C+=""!==D[P]?" "+D[P]:"")}var T=this.get_object_meta_value(e,"class_field_message_type",!1);if(T){var q=this.get_field_value_fallback(e.type,u,"class_field_message_type","");void 0!==q[T]&&(C+=""!==q[T]?" "+q[T]:"")}C.trim()}var I=parseInt($.WS_Form.settings_plugin.framework_column_count),N=parseInt(this.get_object_meta_value(this.form,"label_column_width_form",3)),z=this.get_object_meta_value(e,"label_column_width","default");switch(z){case"default":case"":z=N;break;default:z=parseInt(z)}z>=I&&(z=I-1);var R=I-z,A={id:_,form_id_prefix:this.form_id_prefix,form_id:this.form_id,form_instance_id:this.form_instance_id,field_id:e.id,name:l,label:this.parse_variables_process(e.label,a,!1,e,"field_label").output,value:t,required:this.get_object_meta_value(this.form,"label_required")?'<span class="wsf-required-wrapper"></span>':"",column_width_label:z,column_width_field:R,max_upload_size:ws_form_settings.max_upload_size,locale:ws_form_settings.locale,currency:$.WS_Form.settings_plugin.currency};"datetime"==e.type&&("on"==$.WS_Form.settings_plugin.ui_datepicker||"native"==$.WS_Form.settings_plugin.ui_datepicker&&!this.native_date?A.datetime_type="text":A.datetime_type=this.get_object_meta_value(e,"input_type_datetime","date")),"color"==e.type&&("on"==$.WS_Form.settings_plugin.ui_color||"native"==$.WS_Form.settings_plugin.ui_color&&!this.native_color?A.color_type="text":A.color_type="color");var L=this.get_field_value_fallback(e.type,u,"meta_key_parse_variables",[]);for(var Y in L)if(L.hasOwnProperty(Y)){var U=L[Y],H=void 0!==$.WS_Form.meta_keys[U]&&$.WS_Form.meta_keys[U],J=!1!==H?void 0===H.d?"":H.d:"",G=this.get_object_meta_value(e,U,J);"object"==typeof G&&(G=JSON.stringify(G)),G=this.replace_all(G,"'","&#39;"),A[U]=G}var V=$.extend(!0,{},A);V.label_id=this.get_part_id(e.id,a,"label");var Z=[],B=this.get_part_id(e.id,a,"help"),X=i?"":this.get_object_meta_value(e,"help","",!1,!1);X=this.parse_variables_process(X,a,!1,e,"field_help").output;if(i)switch(e.type){case"range":X="#value"}var Q=this.get_field_value_fallback(e.type,u,"class_help",[]);Z.help_id=B,Z.help_class=Q.join(" "),Z.help=X,A.help_class=Q.join(" ");var K=!i&&this.get_object_meta_value(e,"invalid_feedback_render",!1,!1,!0),ee=!1;if(K){var te=$.extend(!0,{},A),ie=this.form_id_prefix+"invalid-feedback-"+e.id+o,ae=this.get_field_value_fallback(e.type,u,"class_invalid_feedback",[]);ee=this.get_field_value_fallback(e.type,u,"invalid_feedback_last_row",!1);if(""==(se=this.get_object_meta_value(e,"invalid_feedback","",!1,!0))&&""!=this.invalid_feedback_mask_placeholder){var re=e.label,se=this.replace_all(this.invalid_feedback_mask_placeholder,"#label_lowercase",re.toLowerCase());se=this.replace_all(se,"#label",re)}te.invalid_feedback_id=ie,te.invalid_feedback_class=ae.join(" "),te.invalid_feedback=se;var oe=this.mask_parse(w,te)}else ie=!1,oe="";A.invalid_feedback=oe,V.invalid_feedback=oe,A.attributes="";var _e=$.extend(!0,[],this.get_field_value_fallback(e.type,u,"mask_field_attributes",[]));if(i)_e=n.filter(function(e){return-1!=_e.indexOf(e)});if(_e.length>0){var le=this.get_attributes(e,_e,!1,a);A.attributes+=" "+le.attributes,_e=le.mask_attributes,r=le.attribute_values}var ne=!1;switch(e.type){case"select":case"price_select":case"radio":case"price_radio":if(this.get_object_meta_value(e,e.type+"_cascade",!1)){var ce=parseInt(this.get_object_meta_value(e,e.type+"_cascade_field_id",!1));ce>0&&(A.attributes+=' data-cascade-field-id="'+ce+'"');ne=parseInt(this.get_object_meta_value(e,e.type+"_cascade_field_filter",!1))}}var de=this.get_object_meta_value(e,"custom_attributes",!1);if(!1!==de&&"object"==typeof de&&de.length>0)for(var fe in de)if(de.hasOwnProperty(fe)){var ue=de[fe];""!=ue.custom_attribute_name&&(A.attributes=this.attribute_modify(A.attributes,ue.custom_attribute_name,ue.custom_attribute_value,!0))}var pe=this.get_object_meta_value(e,"orientation",!1);if("grid"==pe)var he=this.get_field_value_fallback(e.type,u,"class_orientation_wrapper",[]),me=this.get_field_value_fallback(e.type,u,"class_orientation_row",[]),ve=he.join(" "),be=this.column_class_array(e,"orientation_breakpoint"),ge=(be=me.concat(be)).join(" ");V.attributes="";var ye=$.extend(!0,[],this.get_field_value_fallback(e.type,u,"mask_field_label_attributes",[]));if(i)ye=c.filter(function(e){return-1!=ye.indexOf(e)});if(ye.length>0){le=this.get_attributes(e,ye,!1,a);V.attributes+=le.attributes,ye=le.mask_attributes}var ke="",$e=this.get_object_value(d,"data_source",!1),we=0,Se=!1!==$e;if(Se){if(void 0===$e.type)Se=!1;else var Fe=$e.type;if(void 0===$e.id)Se=!1;else var xe=$e.id}if(Se){switch(Fe){case"data_grid":var We=this.get_object_meta_value(e,xe,!1)}if(!1===We&&(Se=!1),void 0===We.columns)Se=!1;else var je=We.columns}if(Se){var Oe=this.get_field_value_fallback(e.type,u,"mask_group",""),Me=this.get_field_value_fallback(e.type,u,"mask_group_wrapper",""),Ce=this.get_field_value_fallback(e.type,u,"mask_group_label",""),Ee=this.get_field_value_fallback(e.type,u,"mask_group_always",!1),Pe=this.get_field_value_fallback(e.type,u,"mask_row",""),De=this.get_field_value_fallback(e.type,u,"mask_row_placeholder",""),Te=this.get_field_value_fallback(e.type,u,"mask_row_field",""),qe=this.get_field_value_fallback(e.type,u,"mask_row_label",""),Ie=this.get_field_value_fallback(e.type,u,"mask_row_lookups",[]),Ne=this.get_field_value_fallback(e.type,u,"datagrid_column_value",!1),ze=this.get_field_value_fallback(e.type,u,"mask_row_default",""),Re=this.get_field_value_fallback(e.type,u,"mask_row_required"," required data-required"),Ae=this.get_field_value_fallback(e.type,u,"mask_row_disabled"," disabled"),Le=(this.get_field_value_fallback(e.type,u,"mask_row_visible"," visible"),this.get_object_meta_value(e,"data_grid_rows_randomize","",!1,!0)),Ye=this.get_object_meta_value(e,"placeholder_row","",!1,!0);if(""!=Ye){var Ue=$.extend(!0,{},A);Ue.value=Ye,ke+=this.mask_parse(De,Ue)}s&&"object"!=typeof t&&(t=[t]);var He=[];for(var Je in Ie)if(Ie.hasOwnProperty(Je)){var Ge=Ie[Je];if(!1!==(ht=this.get_object_meta_value(e,Ge,!1,!1,!0))){var Ve=!1;for(var Ze in je){if(je.hasOwnProperty(Ze))if(je[Ze].id==ht){Ve=Ze;break}}Ve&&(He[Ge]=Ve)}}var Be=!1;if(!1!==ne){Ve=!1;for(var Ze in je){if(je.hasOwnProperty(Ze))if(je[Ze].id==ne){Be=Ze;break}}}if(void 0===We.groups)return this.error("error_data_source_groups"),"";var Xe=We.groups;Xe.length;for(var Qe in Le&&(Xe=this.array_randomize(Xe)),Xe)if(Xe.hasOwnProperty(Qe)){var Ke=$.extend(!0,{},A);Ke.group_id=this.form_id_prefix+"datagrid-"+e.id+"-group-"+Qe+o;var et=Xe[Qe];if(void 0===et.label)return this.error("error_data_group_label"),"";if(void 0===et.label_render||et.label_render){var tt=$.extend(!0,{},A);tt.group_label=this.html_encode(et.label),tt.label_row_id=this.form_id_prefix+"label-"+e.id+"-group-"+Qe+o,Ke.group_label=this.mask_parse(Ce,tt)}else Ke.group_label="";Ke.disabled=void 0!==et.disabled&&"on"==et.disabled?" disabled":"";var it=void 0!==et.mask_group&&"on"==et.mask_group||Ee;it&&b&&(v="");var at="";if(void 0!==et.rows){var rt=JSON.parse(JSON.stringify(et.rows)),st=this.get_object_meta_value(e,"select_all","");if(("checkbox"==e.type||"price_checkbox"==e.type)&&"on"==st){var ot=!1,_t=!1;for(var Ge in He)if(He.hasOwnProperty(Ge)){var lt=He[Ge];if("checkbox_field_value"==Ge)ot=lt;if("checkbox_field_label"==Ge)_t=lt;if("checkbox_price_field_value"==Ge)ot=lt;if("checkbox_price_field_label"==Ge)_t=lt}st={id:0,default:"",required:"",hidden:"",disabled:"",select_all:!0,data:[]};var nt=this.get_object_meta_value(e,"select_all_label","");""==nt&&(nt=this.language("select_all_label")),st.data[ot]=nt,st.data[_t]=nt,rt.unshift(st)}for(var ct in Le&&(rt=this.array_randomize(rt)),rt)if(rt.hasOwnProperty(ct)){var dt=rt[ct],ft=!1;if(!1!==Be)ft=void 0!==dt.data[Be]&&dt.data[Be];var ut=!ee||ct==rt.length-1,pt=$.extend(!0,{},A);for(var Ge in He)if(He.hasOwnProperty(Ge)){Ve=He[Ge];var ht=dt.data[Ve];ht=this.parse_variables_process(ht.toString()).output;pt[Ge+"_html"]=this.html_encode(ht);var mt=!1;if(void 0!==$.WS_Form.meta_keys[Ge]){var vt=$.WS_Form.meta_keys[Ge];void 0!==vt.h&&vt.h&&(ht=this.html_encode(ht));mt=void 0!==vt.pr&&vt.pr}if(mt){var bt=this.get_number(ht);pt[Ge+"_currency"]=this.get_price(bt),pt[Ge]=bt}else pt[Ge]=ht}void 0!==d.mask_row_value&&(pt.row_value=this.mask_parse(d.mask_row_value,pt)),pt.row_id=this.form_id_prefix+"field-"+e.id+"-row-"+dt.id+o,pt.data_id=dt.id;var gt=$.extend(!0,{},pt),yt=$.extend(!0,{},pt);yt.label_id=this.form_id_prefix+"label-"+e.id+o,yt.label_row_id=this.form_id_prefix+"label-"+e.id+"-row-"+dt.id+o;var kt=[];(!s&&dt.default||s&&!1!==Ne&&t.indexOf(pt[Ne])>-1||s&&void 0!==pt.row_value&&t.indexOf(pt.row_value)>-1)&&(kt.default=ze),dt.disabled&&(kt.disabled=Ae),dt.required&&(kt.required=Re),pt.attributes="",yt.attributes="",gt.attributes="";var $t=$.extend(!0,[],kt);if(!i){var wt="horizontal"==pe&&this.get_field_value_fallback(e.type,u,"class_inline",!1);!1!==wt&&($t.class=wt.join(" "));var St=this.get_field_value_fallback(e.type,u,"class_row",!1);if(!1!==St&&($t.class=!1!==wt?$t.class+" "+St.join(" "):St.join(" ")),dt.disabled){var Ft=this.get_field_value_fallback(e.type,u,"class_row_disabled",!1);!1!==Ft&&($t.class+=" "+Ft.join(" "))}}var xt=$.extend(!0,[],this.get_field_value_fallback(e.type,u,"mask_row_attributes",[]));if(xt.length>0){le=this.get_attributes(e,xt,$t,a);pt.attributes+=" "+le.attributes}if(!1!==ft&&(pt.attributes+=' data-cascade-value="'+this.html_encode(ft)+'"'),void 0!==dt.hidden&&dt.hidden&&!i)switch(e.type){case"select":continue;default:pt.attributes+=' style="display:none;"'}"grid"==pe&&""!=ge&&(pt.attributes=this.attribute_modify(pt.attributes,"class",ge,!0));$t=$.extend(!0,[],kt);var Wt=this.get_field_value_fallback(e.type,u,"class_row_field_label",!1);!1!==Wt&&($t.class=Wt.join(" "));var jt=$.extend(!0,[],this.get_field_value_fallback(e.type,u,"mask_row_label_attributes",[]));if(i)jt=c.filter(function(e){return-1!=jt.indexOf(e)});if(jt.length>0){le=this.get_attributes(e,jt,$t,a);yt.attributes+=" "+le.attributes}$t=$.extend(!0,[],kt);var Ot=this.get_field_value_fallback(e.type,u,"class_row_field",!1);!1!==Ot&&($t.class=Ot.join(" ")),i||""==C||($t.class+=" "+$.trim(C)),$t.aria_labelledby=yt.label_row_id,(!s&&dt.default||s&&!1!==Ne&&t.indexOf(pt[Ne])>-1)&&($t.default=ze),dt.disabled&&($t.disabled=Ae),dt.required&&($t.required=Re),$t.required_row=r.required;var Mt=$.extend(!0,[],this.get_field_value_fallback(e.type,u,"mask_row_field_attributes",[]));if(i)Mt=n.filter(function(e){return-1!=Mt.indexOf(e)});if(Mt.length>0){le=this.get_attributes(e,Mt,$t,a);gt.attributes+=" "+le.attributes}if(""!=gt.attributes&&(gt.attributes=" "+gt.attributes),void 0!==dt.select_all&&(gt.attributes+=" data-select-all"),K&&!ee)if(ie=this.form_id_prefix+"invalid-feedback-"+e.id+"-row-"+dt.id+o,te.invalid_feedback_id=ie,K)oe=this.mask_parse(w,te);else oe="";gt.invalid_feedback=ut?oe:"",yt.invalid_feedback=ut?oe:"";var Ct=this.mask_parse(Te,gt);yt.row_field=Ct,pt.row_field=Ct;var Et=this.mask_parse(qe,yt);pt.row_label=Et,at+=this.mask_parse(Pe,pt),we++}}if(""!=Me){var Pt={group:at};"grid"==pe&&""!=ve&&(Pt.attributes=' class="'+ve+'"'),at=this.mask_parse(Me,Pt)}!1!==Oe&&it?(Ke.group=at,ke+=this.mask_parse(Oe,Ke)):ke+=at}}if(A.data=we>0?ke:"",_e.length>0){$t=[];void 0!==Ke&&void 0!==Ke.group_id&&we>0&&($t.list=Ke.group_id),""===this.get_object_meta_value(e,"aria_label",!1,!1,!0)&&(f&&-1!==v.indexOf("#attributes")?$t.aria_labelledby=this.form_id_prefix+"label-"+e.id+o:$t.aria_label=e.label),""!==X&&($t.aria_describedby=B);var Dt=this.get_field_value_fallback(e.type,u,"class_field",!1);!1!==Dt&&($t.class=Dt.join(" ")),""!=C&&($t.class+=" "+$.trim(C)),""!=(le=this.get_attributes(e,_e,$t,a)).attributes&&(A.attributes+=" "+le.attributes)}if(ye.length>0){$t=[];var Tt=this.get_field_value_fallback(e.type,u,"class_field_label",!1);!1!==Tt&&($t.class=Tt.join(" ")),""!=(le=this.get_attributes(e,ye,$t,a)).attributes&&(V.attributes+=" "+le.attributes)}if(Z.help_append_separator=""!=X?this.mask_parse(k,Z):"",""!=y)var qt=this.mask_parse(y,Z);else qt="";Z.help_append=qt;var It=""!=X||""!=qt?this.mask_parse(g,Z):"";A.help=It,V.help=It,""!=A.attributes&&(A.attributes=" "+A.attributes.trim()),""!=V.attributes&&(V.attributes=" "+V.attributes.trim());var Nt=this.mask_parse(m,A),zt=this.mask_parse(v,V);if(-1!==v.indexOf("#field")&&(V.field=Nt,zt=this.mask_parse(v,V),Nt="",V.field=""),-1!==m.indexOf("#label")&&(A.label=zt,Nt=this.mask_parse(m,A),zt="",A.label=""),""!=Nt&&!p){var Rt=this.get_field_value_fallback(e.type,u,"mask_field_wrapper",!1);if(!1!==Rt){var At={field:Nt};Nt=this.mask_parse(Rt,At)}}if(""!=zt&&!p){var Lt=this.get_field_value_fallback(e.type,u,"mask_field_label_wrapper",!1);if(!1!==Lt){var Yt={label:zt};zt=this.mask_parse(Lt,Yt)}}switch(e="",u){case"bottom":case"right":e+=Nt+zt;break;default:e+=zt+Nt}return A.field=e,this.mask_parse(h,A)},$.WS_Form.prototype.field_type_meta_keys=function(e,t){if(void 0===t)t=!1;var i=[],a=e.fieldsets;for(var r in a)if(a.hasOwnProperty(r)){var s=a[r];if(void 0!==s.meta_keys)for(var r in s.meta_keys)if(s.meta_keys.hasOwnProperty(r)){var o=s.meta_keys[r];if(t){if(void 0===$.WS_Form.meta_keys[o])continue;var _=$.WS_Form.meta_keys[o];void 0!==_[t]&&_[t]&&i.push(o)}else i.push(o)}if(void 0!==s.fieldsets){var l=this.field_type_meta_keys(s,t);l.length>0&&(i=i.concat(l))}}return i},$.WS_Form.prototype.attribute_modify=function(e,t,i,a){var r=!1,s="";return $("<div "+e+" />").each(function(){$.each(this.attributes,function(){if(this.specified){var e=this.name,o=this.value;e==t&&(a?o+=" "+i:o=i,o.trim(),r=!0),s+=" "+e,""!==o&&(s+='="'+o+'"')}})}),r||(s+=" "+t,""!==i&&(s+='="'+i+'"')),s},$.WS_Form.prototype.form_input_range=function(e){var t=this;if(void 0===e)e=this.form_canvas_obj;$('input[type="range"]:not([data-init-input-range])',e).each(function(){t.form_input_range_render($(this))&&($(this).attr("data-init-input-range",""),$(this).on("input change",function(){t.form_input_range_render($(this))}))})},$.WS_Form.prototype.form_input_range_render=function(e){var t=e.attr("id"),i=e.closest("[data-type]"),a=i.attr("data-id"),r=i.attr("data-repeatable-index"),s=void 0!==r?"-repeat-"+r:"",o=this.field_data_cache[a],_=this.get_object_meta_value(o,"help","",!1,!0);if(void 0!==e.attr("data-fill-lower-track")){var l=parseFloat(e[0].min||"0"),n=parseFloat(e[0].max||"100"),c=parseFloat(e[0].value||l),d=n-l,f=d>0?(c-l)/d*100+"%":"0%";$("#"+t).get(0).style.setProperty("--fill-lower-track",f),!0}if(-1!==_.indexOf("#value")){var u={value:e.val()},p=this.mask_parse(_,u),h=this.form_id_prefix+"help-"+a+s;$("#"+h).html(p),!0}return!0},$.WS_Form.prototype.set_invalid_feedback=function(e,t,i,a,r){if(void 0===r)r=0;e.length&&e[0].setCustomValidity(i),t.length&&(void 0===this.invalid_feedback_cache[a]&&(this.invalid_feedback_cache[a]=[]),""==i?void 0!==this.invalid_feedback_cache[a][r]&&t.html(this.invalid_feedback_cache[a]):(void 0===this.invalid_feedback_cache[a][r]&&(this.invalid_feedback_cache[a][r]=t.html()),t.html(i)))},$.WS_Form.prototype.get_attributes=function(e,t,i,a){if("object"!=typeof i)i=!1;var r=[],s=[];if(!1!==t)for(var o in t)if(t.hasOwnProperty(o)){var _=t[o];if(void 0!==$.WS_Form.meta_keys[_]){var l=$.WS_Form.meta_keys[_];if(this.is_admin)var n=void 0!==l.mask?l.mask:"",c=void 0!==l.mask_disregard_on_empty&&l.mask_disregard_on_empty,d=void 0!==l.mask_disregard_on_zero&&l.mask_disregard_on_zero;else n=void 0!==l.m?l.m:"",c=void 0!==l.e&&l.e,d=void 0!==l.z&&l.z;if(!1!==i)if(void 0!==i[_])var f=i[_].trim();else f="";else{if(this.is_admin)var u=void 0!==l.key?l.key:_;else u=void 0!==l.k?l.k:_;var p=void 0!==l.c&&l.c;if(!1!==p){f=this.get_object_meta_value(e,u,"",!1,!1);f=this.parse_variables_process(f,a,!1,e,p).output}else f=this.get_object_meta_value(e,u,"",!1,!0);s[u]=f}f=this.html_encode(f);var h=this.mask_parse(n,{value:f});(c&&""!=f||!c)&&(d&&0!=parseInt(f)||!d)&&(r.push(h),delete t[o])}}return t=$.grep(t,function(e){return 0==e||e}),{attributes:r.join(" "),mask_attributes:t,attribute_values:s}},$.WS_Form.prototype.get_tel=function(e){return e.replace(/[^+\d]+/g,"")},$.WS_Form.prototype.get_number=function(e,t,i,a){if(void 0===t&&(t=0),void 0===i&&(i=!0),void 0===a&&(a=!1),"number"==typeof e&&(e=e.toString()),"string"!=typeof e)return 0;if(e=$.trim(e),i){var r=$.WS_Form.settings_plugin.price_decimal_separator,s=$.WS_Form.settings_plugin.price_thousand_separator,o=new RegExp("[^0-9-"+r+"]","g");if(e=e.replace(o,""),r===s){if(e.substr(-3,1)===r){var _=e.length-3;e=e.substr(0,_)+"[dec]"+e.substr(_+1)}e=(e=e.replace(s,"")).replace("[dec]",".")}else e=e.replace(r,".")}var l=""===$.trim(e)?t:isNaN(e)?t:parseFloat(e);return!1!==a&&(l=this.get_number_rounded(parseFloat(l),a)),l},$.WS_Form.prototype.get_number_rounded=function(e,t){return Number(Math.round(e+"e"+t)+"e-"+t)},$.WS_Form.prototype.get_number_to_step=function(e,t){t||(t=1);var i=1/t;return Math.round(e*i)/i},$.WS_Form.prototype.get_currency=function(){var e={},t=parseInt($.WS_Form.settings_plugin.price_decimals);switch(e.prefix=ws_form_settings.currency_symbol,e.suffix="",$.WS_Form.settings_plugin.currency_position){case"right":e.prefix="",e.suffix=ws_form_settings.currency_symbol;break;case"left_space":e.prefix=ws_form_settings.currency_symbol+" ";break;case"right_space":e.prefix="",e.suffix=" "+ws_form_settings.currency_symbol}return e.decimals=t<0?0:t,e.decimal_separator=$.WS_Form.settings_plugin.price_decimal_separator,e.thousand_separator=$.WS_Form.settings_plugin.price_thousand_separator,e},$.WS_Form.prototype.get_price=function(e,t,i){if(void 0===t)t=this.get_currency();if(void 0===i)i=!0;return"number"!=typeof e&&(e=parseFloat(e)),(i?t.prefix:"")+this.replace_all(this.replace_all(e.toFixed(t.decimals).replace(/\B(?=(\d{3})+(?!\d))/g,"[thousand]"),".",t.decimal_separator),"[thousand]",t.thousand_separator)+(i?t.suffix:"")},$.WS_Form.prototype.input_insert_text=function(e,t){switch(e.attr("data-meta-key-type")){case"text_editor":tinymce.activeEditor.execCommand("mceInsertContent",!1,t);break;case"html_editor":var i=$(".CodeMirror")[0].CodeMirror,a=i.getDoc(),r=a.getCursor();a.replaceRange(t,r);var s=i.getValue(),o=i.getTextArea();$(o).val(s).trigger("keyup");break;default:var _=e[0].selectionStart,l=e[0].selectionEnd,n=e.val();e.val(n.substring(0,_)+t+n.substring(l)),e.focus();var c=_+t.length;null!==e.prop("selectionStart")&&e.prop("selectionStart",c),null!==e.prop("selectionEnd")&&e.prop("selectionEnd",c)}},$.WS_Form.prototype.input_insert_function=function(e,t,i,a){if(void 0===i)i=!1;var r=e.val(),s=""==r,o=e.attr("data-meta-key-type");if(!i||s){if(-1===(g=t.indexOf("(")))_=0,a=!1;else{y=t.substring(g);var _=(b=g+this.get_bracket_finish_index(y))-g-1}switch(o){case"text_editor":if(tinymce.activeEditor.execCommand("mceInsertContent",!1,t),s){var l=tinymce.activeEditor.selection.getNode();tinymce.activeEditor.selection.setCursorLocation(l.firstChild,t.length-1)}break;case"html_editor":var n=$(".CodeMirror")[0].CodeMirror,c=n.getDoc(),d=c.getCursor();c.replaceRange(t,d);var f=n.getValue(),u=n.getTextArea();$(u).val(f).trigger("keyup"),(d=c.getCursor()).ch--,n.focus(),c.setCursor(d);break;default:var p=e[0].selectionStart,h=e[0].selectionEnd,m=e.val();e.val(m.substring(0,p)+t+m.substring(h)),e.focus();k=p+t.length-(a?1:0);null!==e.prop("selectionStart")&&e.prop("selectionStart",k-(a?_:0)),null!==e.prop("selectionEnd")&&e.prop("selectionEnd",k)}}else{var v=r.indexOf(t.slice(0,-1));if(-1!==v){var b,g=v+t.length-2,y=r.substring(g);if(-1!==(b=this.get_bracket_finish_index(y))){var k=g+b;switch(o){case"text_editor":case"html_editor":break;default:e.focus(),null!==e.prop("selectionStart")&&e.prop("selectionStart",k),null!==e.prop("selectionEnd")&&e.prop("selectionEnd",k)}}}}},$.WS_Form.prototype.input_delete=function(e){switch(e.attr("data-meta-key-type")){case"text_editor":var t=tinymce.activeEditor.selection.getRng();if(0==t.endOffset)break;var i=t.commonAncestorContainer,a=document.createRange();a.selectNodeContents(i),a.setStart(i,t.endOffset-1),a.setEnd(i,t.endOffset),a.deleteContents(),tinymce.activeEditor.focus();break;case"html_editor":var r=$(".CodeMirror")[0].CodeMirror,s=r.getDoc(),o=$.extend(!0,{},s.getCursor()),_=$.extend(!0,{},s.getCursor());o.ch=o.ch-1,_.ch=_.ch,s.replaceRange("",o,_),r.focus(),s.setCursor(o);break;default:var l=e[0].selectionStart,n=e.val();e.val(n.substring(0,l-1)+n.substring(l-0)),e.focus();var c=l-1;null!==e.prop("selectionStart")&&e.prop("selectionStart",c),null!==e.prop("selectionEnd")&&e.prop("selectionEnd",c)}},$.WS_Form.prototype.input_clear=function(e){switch(e.attr("data-meta-key-type")){case"text_editor":tinymce.activeEditor.setContent(""),tinymce.activeEditor.focus();break;case"html_editor":var t=$(".CodeMirror")[0].CodeMirror;t.setValue(""),t.focus();t.getValue();var i=t.getTextArea();$(i).val("").trigger("keyup");break;default:e.val(""),e.focus()}},$.WS_Form.prototype.menu_highlight=function(e){if(void 0===e)e="ws-form";$("#toplevel_page_"+e).removeClass("wp-not-current-submenu").addClass("wp-has-current-submenu current").addClass("selected"),$('[href="admin.php?page='+e+'"]',$("#toplevel_page_"+e)).closest("li").addClass("wp-menu-open current")},$.WS_Form.prototype.get_plugin_website_url=function(e,t){if(void 0===e)e="";return"https://wsform.com"+e+"?utm_source=ws_form_pro"+(void 0===t?"":"&utm_medium="+t)},$.WS_Form.prototype.form_add_hidden_input=function(e,t,i,a,r){var s=$('input[name="'+e+'"]',this.form_canvas_obj);if(s.length&&-1===e.indexOf("[]"))s.val(t);else{if(void 0===t)t="";if(void 0===i)i=!1;if(void 0===a)a=!1;if(void 0===r)r=!1;this.form_canvas_obj.append('<input type="hidden" name="'+e+'" value='+(r?"'":'"')+t+(r?"'":'"')+(!1!==i?' id="'+i+'"':"")+(!1!==a?" "+a:"")+" />")}},$.WS_Form.prototype.mod_security_fix=function(e){var t=this.replace_all(e,"#","~WSF%23~");return t=this.replace_all(t,"<","~WSF%60~"),t=this.replace_all(t,">","~WSF%62~"),t=this.replace_all(t,"SELECT","~WSFTCELES~"),t=this.replace_all(t,"select","~WSFtceles~"),t=this.replace_all(t,"Select","~WSFtceleS~"),t=this.replace_all(t,"style","~WSFelyts~"),t=this.replace_all(t,"STYLE","~WSFELYTS~"),t=this.replace_all(t,"src","~WSFCRS"),t=this.replace_all(t,"SRC","~WSFcrs~"),t=this.replace_all(t,"xmlns","~WSFsnlmx"),t=this.replace_all(t,"XMLNS","~WSFSNLMX~"),t=this.replace_all(t,"object_id","~WSFid_tcejbo~")},$.WS_Form.prototype.wpautop=function(e,t){void 0===t&&(t=!0);var i=new Map;if(""===e.trim())return"";if((e+="\n").indexOf("<pre")>-1){var a=e.split("</pre>"),r=a.pop();e="",a.forEach(function(t,a){var r=t.indexOf("<pre");if(-1!==r){var s="<pre wp-pre-tag-"+a+"></pre>";i[s]=t.substr(r)+"</pre>",e+=t.substr(0,r)+s}else e+=t}),e+=r}var s="(?:table|thead|tfoot|caption|col|colgroup|tbody|tr|td|th|div|dl|dd|dt|ul|ol|li|pre|form|map|area|blockquote|address|math|style|p|h[1-6]|hr|fieldset|legend|section|article|aside|hgroup|header|footer|nav|figure|figcaption|details|menu|summary)";(e=(e=(e=(e=e.replace(/<br \/>\s*<br \/>/,"\n\n")).replace(new RegExp("(<"+s+"[^>]*>)","gmi"),"\n$1")).replace(new RegExp("(</"+s+">)","gmi"),"$1\n\n")).replace(/\r\n|\r/,"\n")).indexOf("<option")>-1&&(e=(e=e.replace(/\s*<option'/gim,"<option")).replace(/<\/option>\s*/gim,"</option>")),e.indexOf("</object>")>-1&&(e=(e=(e=e.replace(/(<object[^>]*>)\s*/gim,"$1")).replace(/\s*<\/object>/gim,"</object>")).replace(/\s*(<\/?(?:param|embed)[^>]*>)\s*/gim,"$1")),(e.indexOf("<source")>-1||e.indexOf("<track")>-1)&&(e=(e=(e=e.replace(/([<\[](?:audio|video)[^>\]]*[>\]])\s*/gim,"$1")).replace(/\s*([<\[]\/(?:audio|video)[>\]])/gim,"$1")).replace(/\s*(<(?:source|track)[^>]*>)\s*/gim,"$1"));var o=(e=e.replace(/\n\n+/gim,"\n\n")).split(/\n\s*\n/);return e="",o.forEach(function(t){e+="<p>"+t.replace(/^\s+|\s+$/g,"")+"</p>\n"}),e=(e=(e=(e=(e=(e=(e=(e=e.replace(/<p>\s*<\/p>/gim,"")).replace(/<p>([^<]+)<\/(div|address|form)>/gim,"<p>$1</p></$2>")).replace(new RegExp("<p>s*(</?"+s+"[^>]*>)s*</p>","gmi"),"$1",e)).replace(/<p>(<li.+?)<\/p>/gim,"$1")).replace(/<p><blockquote([^>]*)>/gim,"<blockquote$1><p>")).replace(/<\/blockquote><\/p>/gim,"</p></blockquote>")).replace(new RegExp("<p>s*(</?"+s+"[^>]*>)","gmi"),"$1")).replace(new RegExp("(</?"+s+"[^>]*>)s*</p>","gmi"),"$1"),t&&(e=(e=(e=e.replace(/<(script|style)(?:.|\n)*?<\/\\1>/gim,function(e){return e[0].replace("\n","<WPPreserveNewline />")})).replace(/(<br \/>)?\s*\n/gim,"<br />\n")).replace("<WPPreserveNewline />","\n")),e=(e=(e=e.replace(new RegExp("(</?"+s+"[^>]*>)s*<br />","gmi"),"$1")).replace(/<br \/>(\s*<\/?(?:p|li|div|dl|dd|dt|th|pre|td|ul|ol)[^>]*>)/gim,"$1")).replace(/\n<\/p>$/gim,"</p>"),Object.keys(i).length&&(e=e.replace(new RegExp(Object.keys(i).join("|"),"gi"),function(e){return i[e]})),e},$.WS_Form.prototype.get_part_id=function(e,t,i){void 0===t&&(t=!1),void 0===i&&(i="field");var a=!1!==t?"-repeat-"+t:"";return this.form_id_prefix+i+"-"+e+a},$.WS_Form.prototype.get_field_name=function(e,t,i){void 0===t&&(t=!1),void 0===i&&(i=!1);return this.field_name_prefix+e+(!1!==t?i?"_"+t:"["+t+"]":"")},$.WS_Form.prototype.score=function(e,t,i){if(e===t)return 1;if(""===t)return 0;var a,r,s,o,_,l=0,n=e,c=n.toLowerCase(),d=n.length,f=t.toLowerCase(),u=t.length,p=0,h=1;if(i&&(o=1-i),i)for(_=0;_<u;_+=1)-1===(s=c.indexOf(f[_],p))?h+=o:(p===s?a=.7:(a=.1," "===n[s-1]&&(a+=.8)),n[s]===t[_]&&(a+=.1),l+=a,p=s+1);else for(_=0;_<u;_+=1){if(-1===(s=c.indexOf(f[_],p)))return 0;p===s?a=.7:(a=.1," "===n[s-1]&&(a+=.8)),n[s]===t[_]&&(a+=.1),l+=a,p=s+1}return r=.5*(l/d+l/u)/h,f[0]===c[0]&&r<.85&&(r+=.15),r},$.WS_Form.prototype.replace_all=function(e,t,i){return void 0===i?e.toString():e.split(t).join(i)},$.WS_Form.prototype.date_format=function(e,t){var i=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],a=["January","February","March","April","May","June","July","August","September","October","November","December"],r=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],s=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],o={d:function(){var e=this.getDate();return(e<10?"0":"")+e},D:function(){return r[this.getDay()]},j:function(){return this.getDate()},l:function(){return s[this.getDay()]},N:function(){var e=this.getDay();return 0===e?7:e},S:function(){var e=this.getDate();return e%10==1&&11!==e?"st":e%10==2&&12!==e?"nd":e%10==3&&13!==e?"rd":"th"},w:function(){return this.getDay()},z:function(){var e=new Date(this.getFullYear(),0,1);return Math.ceil((this-e)/864e5)},W:function(){var e=new Date(this.valueOf()),t=(this.getDay()+6)%7;e.setDate(e.getDate()-t+3);var i=e.valueOf();e.setMonth(0,1),4!==e.getDay()&&e.setMonth(0,1+(4-e.getDay()+7)%7);var a=1+Math.ceil((i-e)/6048e5);return a<10?"0"+a:a},F:function(){return a[this.getMonth()]},m:function(){var e=this.getMonth();return(e<9?"0":"")+(e+1)},M:function(){return i[this.getMonth()]},n:function(){return this.getMonth()+1},t:function(){var e=this.getFullYear(),t=this.getMonth()+1;return 12===t&&(e=e++,t=0),new Date(e,t,0).getDate()},L:function(){var e=this.getFullYear();return e%400==0||e%100!=0&&e%4==0},o:function(){var e=new Date(this.valueOf());return e.setDate(e.getDate()-(this.getDay()+6)%7+3),e.getFullYear()},Y:function(){return this.getFullYear()},y:function(){return(""+this.getFullYear()).substr(2)},a:function(){return this.getHours()<12?"am":"pm"},A:function(){return this.getHours()<12?"AM":"PM"},B:function(){return Math.floor(1e3*((this.getUTCHours()+1)%24+this.getUTCMinutes()/60+this.getUTCSeconds()/3600)/24)},g:function(){return this.getHours()%12||12},G:function(){return this.getHours()},h:function(){var e=this.getHours();return((e%12||12)<10?"0":"")+(e%12||12)},H:function(){var e=this.getHours();return(e<10?"0":"")+e},i:function(){var e=this.getMinutes();return(e<10?"0":"")+e},s:function(){var e=this.getSeconds();return(e<10?"0":"")+e},v:function(){var e=this.getMilliseconds();return(e<10?"00":e<100?"0":"")+e},e:function(){return Intl.DateTimeFormat().resolvedOptions().timeZone},I:function(){for(var e=null,t=0;t<12;++t){var i=new Date(this.getFullYear(),t,1).getTimezoneOffset();if(null===e)e=i;else{if(i<e){e=i;break}if(i>e)break}}return this.getTimezoneOffset()===e|0},O:function(){var e=this.getTimezoneOffset();return(-e<0?"-":"+")+(Math.abs(e/60)<10?"0":"")+Math.floor(Math.abs(e/60))+(0===Math.abs(e%60)?"00":(Math.abs(e%60)<10?"0":"")+Math.abs(e%60))},P:function(){var e=this.getTimezoneOffset();return(-e<0?"-":"+")+(Math.abs(e/60)<10?"0":"")+Math.floor(Math.abs(e/60))+":"+(0===Math.abs(e%60)?"00":(Math.abs(e%60)<10?"0":"")+Math.abs(e%60))},T:function(){var e=this.toLocaleTimeString(navigator.language,{timeZoneName:"short"}).split(" ");return e[e.length-1]},Z:function(){return 60*-this.getTimezoneOffset()},c:function(){return this.format("Y-m-d\\TH:i:sP")},r:function(){return this.toString()},U:function(){return Math.floor(this.getTime()/1e3)}};return t.replace(/(\\?)(.)/g,function(t,i,a){return""===i&&o[a]?o[a].call(e):a})}}(jQuery);