!function(e){"use strict";e.WS_Form.prototype.form_conditional=function(t){var a=this;if(void 0===t&&(t=!1),!1===this.conditional_cache){if(void 0===(u=this.get_object_meta_value(this.form,"conditional",!1)).groups)return!1;if(void 0===u.groups[0])return!1;if(void 0===u.groups[0].rows)return!1;for(var i in u.groups[0].rows)if(u.groups[0].rows.hasOwnProperty(i)){var s=u.groups[0].rows[i];if(null!==s&&"object"==typeof s&&(void 0===s.disabled||!s.disabled)&&void 0!==s.data&&void 0!==s.data[1]){var o=s.data[1];try{o=JSON.parse(o)}catch(e){o=!1}!1!==o&&(o.last_state=[],this.conditional_events(o,t),!1===this.conditional_cache&&(this.conditional_cache=[]),this.conditional_cache.push(o))}}}else for(var i in this.conditional_cache){if(this.conditional_cache.hasOwnProperty(i))(o=this.conditional_cache[i]).last_state=[],this.conditional_events(o,t)}var r=[];for(var c in this.conditional_event_selector_to_condition)if(this.conditional_event_selector_to_condition.hasOwnProperty(c)){var _=this.conditional_event_selector_to_condition[c];for(var n in _)if(_.hasOwnProperty(n)){var d=_[n],l=d.object_event_selector,h=d.object_event_obj,u=d.conditionals;if(t){"null"===c&&(c=null);h.each(function(){e(this).on(n,c,{conditionals:u},function(t,i,s,o){if(void 0===s||void 0===o||a.form_id===s||a.form_instance_id===o){var r=e(this).closest("[data-repeatable-index]"),c=r.length?r.attr("data-repeatable-index"):0;for(var _ in t.data.conditionals)if(t.data.conditionals.hasOwnProperty(_)){var n=t.data.conditionals[_];a.conditional_process(n,!1,e(this),c,t)}}}),a.form_events_reset.push({obj:e(this),event:n})}),this.log("log_conditional_event",(null===c?this.language("debug_form"):c)+" ("+n+")","conditional")}var v=e(l,this.form_canvas_obj),f=[],b=[];for(var p in v.each(function(){if(void 0!==e(this).attr("name")){var t=e(this).attr("name");b.includes(t)||(b.push(t),f.push(e(this)))}}),f)if(f.hasOwnProperty(p)){var m=f[p];if(void 0===m.attr("data-wsf-conditional-initialize-once")){var g=m.closest("[data-repeatable-index]"),k=g.length?g.attr("data-repeatable-index"):0,w=!1;for(var i in u)if(u.hasOwnProperty(i)){o=u[i];if(a.conditional_destination_repeatable(o))w=!0;a.conditional_process(o,!0,m,k,!1)}w||r.includes(m)||r.push(m)}}}}for(var y in r){if(r.hasOwnProperty(y))r[y].attr("data-wsf-conditional-initialize-once","")}},e.WS_Form.prototype.conditional_destination_repeatable=function(e){return this.conditional_destination_repeatable_then_else(e,"then")||this.conditional_destination_repeatable_then_else(e,"else")},e.WS_Form.prototype.conditional_destination_repeatable_then_else=function(e,t){var a=e[t];for(var i in a)if(a.hasOwnProperty(i)){var s=a[i];if(this.conditional_action_check(s)){var o=s.object,r=s.object_id;switch(o){case"section":if(void 0===this.section_data_cache[r])continue;var c=this.section_data_cache[r];break;case"field":if(void 0===this.field_data_cache[r])continue;var _=this.field_data_cache[r].section_id;if(void 0===this.section_data_cache[_])continue;c=this.section_data_cache[_]}if(this.get_object_meta_value(c,"section_repeatable"))return!0}}return!1},e.WS_Form.prototype.conditional_events=function(t,a){void 0===a&&(a=!0);var i=this,s=void 0!==this.framework.tabs.public.selector_href?this.framework.tabs.public.selector_href:"href";for(var o in t.if)if(t.if.hasOwnProperty(o)){var r=t.if[o];if(void 0!==r.conditions)for(var c in r.conditions)if(r.conditions.hasOwnProperty(c)){var _=r.conditions[c];if(this.conditional_condition_check(_)){var n=_.object,d=_.object_id,l=!!_.object_row_id&&parseInt(_.object_row_id,10),h=_.logic,u=_.value,v=[];switch(n){case"form":v.push(this.conditional_event_get(n,this.form_id,0,this.form,h));break;case"group":if(void 0===this.group_data_cache[d])break;var f=this.group_data_cache[d];v.push(this.conditional_event_get(n,d,l,f,h));break;case"section":if(void 0===this.section_data_cache[d])break;f=this.section_data_cache[d];v.push(this.conditional_event_get(n,d,l,f,h));break;case"field":if(void 0===this.field_data_cache[d])break;f=this.field_data_cache[d];var b=e.WS_Form.field_type_cache[f.type],p=void 0!==f.section_repeatable_section_id;v.push(this.conditional_event_get(n,d,l,f,h,p));var m=[];switch(h){case"field_match":case"field_match_not":var g=u;if(0==parseInt(g,10))break;if(void 0===this.field_data_cache[g])break;var k=this.field_data_cache[g];p=void 0!==k.section_repeatable_section_id;v.push(this.conditional_event_get("field",g,!1,k,h,p)),m.field_match_id=this.form_id_prefix+"field-"+g}var w=this.get_field_value_fallback(b,!1,"attribute_"+h,!1);if("object"==typeof w){var y="#"+this.form_id_prefix+n+"-"+d;for(var j in w)if(w.hasOwnProperty(j)){var x=w[j];x=this.mask_parse(x,m),e(y,this.form_canvas_obj).attr(j,x)}}break;case"submit":v.push(this.conditional_event_get(n,0,0,this.submit,h));break;case"user":v.push(this.conditional_event_get(n,0,0,!1,h))}for(var q in v)if(v.hasOwnProperty(q)){var O=v[q],A=(y=null,O.repeatable);if("wsf-group-index"==O.event||"wsf-section-repeatable"==O.event||"wsf-validate"==O.event||"wsf-validate-silent"==O.event){if(!a)continue;"wsf-section-repeatable"==O.event&&(O.event="wsf-section-repeatable-"+d);var S=this.form_canvas_obj;y=null}else if("wsf-rendered"==O.event||"wsf-submit"==O.event||"wsf-save"==O.event||"wsf-submit wsf-save"==O.event||"wsf-submit-complete"==O.event||"wsf-save-complete"==O.event||"wsf-complete"==O.event||"wsf-submit-error"==O.event||"wsf-save-error"==O.event||"wsf-error"==O.event||"wsf-submit-success"==O.event||"wsf-save-success"==O.event||"wsf-success"==O.event)S=e(document),y=null;else{S=this.form_canvas_obj;switch(O.object){case"form":y=null;break;case"group":y="["+s+'="#'+this.form_id_prefix+"group-"+d+'"]';break;case"section":y='[id^="'+this.esc_selector(this.form_id_prefix+O.object+"-"+O.object_id)+'"][data-id="'+this.esc_selector(O.object_id)+'"]';break;case"field":var F=this.field_data_cache[d];switch(F.type){case"radio":case"price_radio":case"checkbox":case"price_checkbox":y='[name^="'+this.esc_selector(ws_form_settings.field_prefix+d)+'["],[name^="'+this.esc_selector(ws_form_settings.field_prefix+d)+'["] ~ label';break;case"select":case"price_select":if(this.get_object_meta_value(F,"select2",!1)&&-1!==["click","mousedown","mouseup","mouseover","mouseout","touchstart","touchmove","touchend","touchcancel"].indexOf(O.event))if(A)y='[id^="'+this.esc_selector(this.form_id_prefix+O.object+"-wrapper-"+O.object_id)+'-repeat-"] .select2';else y="#"+this.esc_selector(this.form_id_prefix+O.object+"-wrapper-"+O.object_id)+" .select2";else if(A)y='[id^="'+this.esc_selector(this.form_id_prefix+O.object+"-"+O.object_id)+'-repeat-"]';else y="#"+this.esc_selector(this.form_id_prefix+O.object+"-"+O.object_id);break;default:if(A)y='[id^="'+this.esc_selector(this.form_id_prefix+O.object+"-"+O.object_id+(!1!==O.object_row_id?"-row-"+O.object_row_id:""))+'-repeat-"]';else y="#"+this.esc_selector(this.form_id_prefix+O.object+"-"+O.object_id+(!1!==O.object_row_id?"-row-"+O.object_row_id:""))}}}if(O.create&&!1!==O.event&&!1!==y){var W=0,I=e(y);if(I.each(function(){e(this).attr("data-init-conditional")&&W++}),0===W)switch(O.event){case"recaptcha":this.recaptchas_conditions.push(function(){i.conditional_process(t,!1,I,0,!1)});break;case"hcaptcha":this.hcaptchas_conditions.push(function(){i.conditional_process(t,!1,I,0,!1)});break;case"turnstile":this.turnstiles_conditions.push(function(){i.conditional_process(t,!1,I,0,!1)});break;default:if(null===y&&(y="null"),void 0===this.conditional_event_selector_to_condition[y]&&(this.conditional_event_selector_to_condition[y]=[]),void 0===this.conditional_event_selector_to_condition[y][O.event]&&(this.conditional_event_selector_to_condition[y][O.event]={object_event_selector:y,object_event_obj:S,conditionals:[],event_processed:!1}),-1===this.conditional_event_selector_to_condition[y][O.event].conditionals.indexOf(t)&&this.conditional_event_selector_to_condition[y][O.event].conditionals.push(t),ws_form_settings.debug){var P=e(y,this.form_canvas_obj).attr("data-populate-event"),D=P?P.split(" "):[];D.push(O.event),P=(D=D.filter(function(e,t,a){return a.indexOf(e)===t})).join(" "),e(y,this.form_canvas_obj).attr("data-populate-event",P)}}}}}}}},e.WS_Form.prototype.conditional_event_get=function(t,a,i,s,o,r){void 0===r&&(r=!1);var c={object:t,object_id:a,object_row_id:i,create:!0,event:!1,row:!1,repeatable:r};switch(t){case"field":var _=e.WS_Form.field_type_cache[s.type];void 0!==_.conditional&&(void 0!==_.conditional.exclude_condition&&(c.create=!_.conditional.exclude_condition),void 0!==_.conditional.condition_event&&(c.event=_.conditional.condition_event),void 0!==_.conditional["object_event.row"]&&_.conditional["object_event.row"]&&!1!==i&&(c.row=!0))}var n=e.WS_Form.settings_form.conditional.objects[t].logic;return void 0!==n[o]&&void 0!==n[o].event&&(c.event=n[o].event),c},e.WS_Form.prototype.conditional_process=function(t,a,i,s,o){if(void 0===t.if)return!1;if(void 0===t.then)return!1;if(void 0===t.else)return!1;var r=!1;for(var c in t.if)if(t.if.hasOwnProperty(c)){var _=t.if[c];if(void 0!==_.conditions){var n=!1,d="";for(var l in _.conditions)if(_.conditions.hasOwnProperty(l)){var h=_.conditions[l];if(this.conditional_condition_check(h)){var u=h.object,v=h.object_id;if("object"==typeof(f=void 0!==h.object_row_id&&h.object_row_id))(f=f.map(function(e){return parseInt(e,10)})).length||(f=!1);else var f=""!==f&&[parseInt(f,10)];var b=h.logic,p=h.value,m=void 0===h.case_sensitive||h.case_sensitive,g=l>0?void 0===h.logic_previous?"||":h.logic_previous:"||",k=ws_form_settings.field_prefix+v,w=void 0===h.force_result?null:h.force_result;if(e.WS_Form.debug_rendered){switch(u){case"form":var y=this.form_obj;break;case"group":y=this.group_data_cache[v];break;case"section":y=this.section_data_cache[v];break;case"field":y=this.field_data_cache[v]}if(void 0!==y){var j=e.WS_Form.settings_form.conditional,x=j.logic_previous,q=j.objects[u].logic;if(void 0!==q[b])var O=q[b].text.toUpperCase();else O="";if(void 0!==x[g])var A=x[g].text.toUpperCase();else A="";d=""+(l>0?A+" ":"")+"IF ["+this.esc_html(y.label)+"] "+O+(""!=p?" '"+p+"'":"")+" ("+(void 0!==y.type?"Type: "+y.type+" | ":"")+"ID: "+v+(f?" | Row ID: "+f.join(", "):"")+") "}}switch(u){case"form":var S="#"+this.esc_selector(this.form_obj_id);break;case"group":S="#"+this.esc_selector(this.form_id_prefix+"group-"+v);break;case"section":S="#"+this.esc_selector(this.form_id_prefix+u+"-"+v);break;case"field":if(!s){var F=this.field_data_cache[v];if("object"==typeof F&&void 0!==F.section_id&&"object"==typeof this.section_data_cache[F.section_id]){var W=this.section_data_cache[F.section_id];if(this.get_object_meta_value(W,"section_repeatable"))return}}var I=s>0?"-repeat-"+s:"",P=(S="#"+this.esc_selector(this.form_id_prefix+u+"-"+v+I),e('[data-type][data-id="'+this.esc_selector(v)+'"]'+(s>0?'[data-repeatable-index="'+this.esc_selector(s)+'"]':""),this.form_canvas_obj))}var D=e(S,this.form_canvas_obj),C=D.length?D.val():"";!m&&C&&("string"==typeof C&&(C=C.toLowerCase()),"string"==typeof p&&(p=p.toLowerCase()));if(-1!==["r==","r!=","r>","r<","r>=","r<="].indexOf(b)){var z=e('[data-repeatable][data-id="'+this.esc_selector(v)+'"]',this.form_canvas_obj);if(!z.length)continue;C=z.length}p=this.parse_variables_process(p).output;switch(b){case"d==":case"d!=":case"d>":case"d<":case"d>=":case"d<=":if(!1!==(Z=void 0!==this.field_data_cache[v]&&this.field_data_cache[v])){var N=this.get_object_meta_value(Z,"input_type_datetime","date"),T=this.get_object_meta_value(Z,"format_date",ws_form_settings.date_format);T||(T=ws_form_settings.date_format),p=this.get_date(p,N,T),C=this.get_date(C,N,T)}break;case"==":case"!=":case">":case"<":case">=":case"<=":var Z;if(!1!==(Z=void 0!==this.field_data_cache[v]&&this.field_data_cache[v])){switch(Z.type){case"price":case"price_subtotal":case"cart_price":case"cart_total":C=this.get_number(C,0,!0);break;default:C=this.get_number(C,0,!1)}p=parseFloat(p)}}var E=!1;switch(b){case"==":E=C==p;break;case"!=":E=C!=p;break;case">":E=C>p;break;case"<":E=C
=":E=C>=p;break;case"<=":E=C<=p;break;case"d==":""!=C&&""!=p&&(E=Date.parse(C)==Date.parse(p));break;case"d!=":""!=C&&""!=p&&(E=Date.parse(C)!=Date.parse(p));break;case"d>":""!=C&&""!=p&&(E=Date.parse(C)>Date.parse(p));break;case"d<":""!=C&&""!=p&&(E=Date.parse(C)=":""!=C&&""!=p&&(E=Date.parse(C)>=Date.parse(p));break;case"d<=":""!=C&&""!=p&&(E=Date.parse(C)<=Date.parse(p));break;case"rc==":case"rc!=":E=(C=e('input[type="checkbox"]:not([data-wsf-select-all]):checked',P).length)==this.get_number(p),"rc!="==b&&(E=!E);break;case"rc>":E=(C=e('input[type="checkbox"]:not([data-wsf-select-all]):checked',P).length)>this.get_number(p);break;case"rc<":E=(C=e('input[type="checkbox"]:not([data-wsf-select-all]):checked',P).length)":E=(C=e("option:not([data-placeholder]):selected",P).length)>this.get_number(p);break;case"rs<":E=(C=e("option:not([data-placeholder]):selected",P).length)":""!=C&&(E=this.get_number(C)>this.get_number(p));break;case"r<":""!=C&&(E=this.get_number(C)=":""!=C&&(E=this.get_number(C)>=this.get_number(p));break;case"r<=":""!=C&&(E=this.get_number(C)<=this.get_number(p));break;case"section_repeatable":t.last_state[s]="",E=o.type=="wsf-section-repeatable-"+v;break;case"equals":case"c==":E=C==p;break;case"equals_not":case"c!=":E=C!=p;break;case"contains":case"contains_not":E=-1!=C.indexOf(p),"contains_not"==b&&(E=!E);break;case"starts":case"starts_not":E=C.startsWith(p),"starts_not"==b&&(E=!E);break;case"ends":case"ends_not":E=C.endsWith(p),"ends_not"==b&&(E=!E);break;case"blank":case"blank_not":E=""==C,"blank_not"==b&&(E=!E);break;case"checked":case"checked_not":E=!1;for(var L in f)if(f.hasOwnProperty(L)){var R=f[L],U="#"+this.esc_selector(this.form_id_prefix+u+"-"+v+"-row-"+R+I);E|=e(U,this.form_canvas_obj).is(":checked")}"checked_not"==b&&(E=!E);break;case"checked_any":case"checked_any_not":E=e("input:checked",P).length>0,"checked_any_not"==b&&(E=!E);break;case"checked_value_equals":case"checked_value_equals_not":E=e('input[value="'+this.esc_selector(p)+'"]:checked',P).length;"checked_value_equals_not"==b&&(E=!E);break;case"selected":case"selected_not":E=!1;for(var L in f)if(f.hasOwnProperty(L)){R=f[L];E|=e('option[data-id="'+this.esc_selector(R)+'"]',e(S,this.form_canvas_obj)).prop("selected")}"selected_not"==b&&(E=!E);break;case"selected_any":case"selected_any_not":E=e("option:not([data-placeholder]):selected",e(S,this.form_canvas_obj)).length>0;"selected_any_not"==b&&(E=!E);break;case"selected_value_equals":case"selected_value_equals_not":E=e('option[value="'+this.esc_selector(p)+'"]',e(S,this.form_canvas_obj)).prop("selected");"selected_value_equals_not"==b&&(E=!E);break;case"regex_email":case"regex_email_not":E=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(C),"regex_email_not"==b&&(E=!E);break;case"regex_url":case"regex_url_not":E=/[-a-zA-Z0-9@:%_\+.~#?&\/\/=]{2,256}\.[a-z]{2,4}\b(\/[-a-zA-Z0-9@:%_\+.~#?&\/\/=]*)?/gi.test(C),"regex_url_not"==b&&(E=!E);break;case"regex":case"regex_not":E=new RegExp(p).test(C),"regex_not"==b&&(E=!E);break;case"wsf-rendered":case"wsf-submit":case"wsf-submit-complete":case"wsf-submit-success":case"wsf-submit-error":case"wsf-save":case"wsf-save-complete":case"wsf-save-success":case"wsf-save-error":case"wsf-submit-save":case"wsf-complete":case"wsf-success":case"wsf-error":case"click":case"mousedown":case"mouseup":case"mouseover":case"mouseout":case"touchstart":case"touchmove":case"touchend":case"touchcancel":case"focus":case"blur":case"change":case"change_input":case"input":case"keyup":case"keydown":t.last_state[s]="",E=b==o.type||void 0!==o.handleObj&&void 0!==o.handleObj.origType&&b==o.handleObj.origType||"wsf-"+b==o.type||"change_input"==b&&-1!=["change","input"].indexOf(o.type)||"wsf-submit-save"==b&&-1!=["wsf-submit","wsf-save"].indexOf(o.type);break;case"token_validated":case"token_validated_not":E=!1!==this.submit&&void 0!==this.submit.token_validated&&this.submit.token_validated,"token_validated_not"==b&&(E=!E);break;case"user_logged_in":case"user_logged_in_not":case"user_role":case"user_role_not":case"user_capability":case"user_capability_not":E=w;break;case"ch>":E=360*this.hex_to_hsl(C).h>p;break;case"ch<":E=360*this.hex_to_hsl(C).h":E=100*this.hex_to_hsl(C).s>p;break;case"cs<":E=100*this.hex_to_hsl(C).s
":E=100*this.hex_to_hsl(C).l>p;break;case"cl<":E=100*this.hex_to_hsl(C).l
0,"recaptcha_not"==b&&(E=!E);break;case"hcaptcha":case"hcaptcha_not":this.hcaptcha_get_response_by_name,E="string"==typeof(Q=this.hcaptcha_get_response_by_name(k))&&Q.length>0,"hcaptcha_not"==b&&(E=!E);break;case"turnstile":case"turnstile_not":var Q;this.turnstile_get_response_by_name,E="string"==typeof(Q=this.turnstile_get_response_by_name(k))&&Q.length>0,"turnstile_not"==b&&(E=!E);break;case"signature":case"signature_not":this.signature_get_response_by_name,E=this.signature_get_response_by_name(k),"signature_not"==b&&(E=!E);break;case"file":case"file_not":this.file_get_count_by_field_id,E=this.file_get_count_by_field_id(v)>0,"file_not"==b&&(E=!E);break;case"f>":this.file_get_count_by_field_id,E=this.file_get_count_by_field_id(v)>p;break;case"f<":this.file_get_count_by_field_id,E=this.file_get_count_by_field_id(v)
0){var J="#"+this.form_id_prefix+"field-"+$+(s>0?"-repeat-"+s:"");E=e(J,this.form_canvas_obj).val()==C,"field_match_not"==b&&(E=!E)}break;case"cc==":E=C.length==parseInt(p,10);break;case"cc!=":E=C.length!=parseInt(p,10);break;case"cc>":E=C.length>parseInt(p,10);break;case"cc<":E=C.length":E=this.get_word_count(C)>parseInt(p,10);break;case"cw<":E=this.get_word_count(C)0?void 0===_.logic_previous?"||":_.logic_previous:"||";r=this.conditional_logic_previous(r,n,g)}}var K=!1;if(r?!0===t.last_state[s]&&void 0!==t.last_state[s]||(K="then",t.last_state[s]=!0):!1===t.last_state[s]&&void 0!==t.last_state[s]||(K="else",t.last_state[s]=!1),!1!==K){var B=t[K];B.length&&(this.log("log_conditional_fired_"+K,d,"conditional"),this.conditional_process_actions(B,K,i,s))}!a&&this.has_ecommerce&&"function"==typeof this.form_ecommerce_calculate&&this.form_ecommerce_calculate()},e.WS_Form.prototype.conditional_process_actions=function(t,a,i,s){var o=0,r=!1,c=!1,_=!1,n=this;for(var d in t)if(t.hasOwnProperty(d)){var l=t[d];if(this.conditional_action_check(l)){var h=l.object,u=l.object_id,v=void 0!==l.object_row_id&&l.object_row_id,f=l.action;switch(h){case"form":var b=n.form_obj,p=n.form_obj,m=void 0!==l.value&&this.parse_variables_process(l.value,!1,!1,!1,!1,!1).output,g=this.conditional_process_action(a,f,b,p,h,u,v,m,!1);r=r||g.process_required,c=c||g.process_bypass,_=_||g.process_navigation;break;case"group":var k="#"+this.esc_selector(this.form_id_prefix+"group-"+u);b=p=e(k,this.form_canvas_obj),m=void 0!==l.value&&this.parse_variables_process(l.value,!1,!1,!1,!1,!1).output,g=this.conditional_process_action(a,f,b,p,h,u,v,m,!1);r=r||g.process_required,c=c||g.process_bypass,_=_||g.process_navigation;break;case"section":var w=this.get_section_id(i);if(!(j=e('[id^="'+this.esc_selector(this.form_id_prefix)+'section-"][data-id="'+this.esc_selector(u)+'"]',this.form_canvas_obj)).length)break;var y=j.first();w===parseInt(u,10)&&y.attr("data-repeatable-index")&&(j=j.filter('[data-repeatable-index="'+this.esc_selector(s)+'"]')),j.each(function(){var t=void 0!==e(this).attr("data-repeatable-index")&&e(this).attr("data-repeatable-index"),i=void 0!==l.value&&n.parse_variables_process(l.value,t,!1,!1,!1,!1,!1).output,s=n.conditional_process_action(a,f,e(this),e(this),h,u,v,i,t);r=r||s.process_required,c=c||s.process_bypass,_=_||s.process_navigation});break;case"field":var j;w=this.get_section_id(i);if(!(j=e('[id^="'+this.esc_selector(this.form_id_prefix)+'field-wrapper-"][data-id="'+this.esc_selector(u)+'"],input[type="hidden"][data-id-hidden="'+this.esc_selector(u)+'"]',this.form_canvas_obj)).length)break;y=j.first();w===this.get_section_id(y.first())&&y.attr("data-repeatable-index")&&(j=j.filter('[data-repeatable-index="'+this.esc_selector(s)+'"]')),j.each(function(){var t=void 0!==e(this).attr("data-repeatable-index")&&e(this).attr("data-repeatable-index"),i=!1!==t?"-repeat-"+t:"";if("object"==typeof v){var s=[];for(var o in v)if(v.hasOwnProperty(o)){var d=v[o];s.push("#"+n.esc_selector(n.form_id_prefix+"field-"+u+"-row-"+d+i))}var b=s.join(", ")}else b="#"+n.esc_selector(n.form_id_prefix+"field-"+u+(v?"-row-"+v:"")+i);var p=e(b,n.form_canvas_obj),m=void 0!==n.field_data_cache[u]&&n.field_data_cache[u],g=void 0!==l.value&&n.parse_variables_process(l.value,t,!1,m,!1,!1,!1).output,k=n.conditional_process_action(a,f,e(this),p,h,u,v,g,t);r=r||k.process_required,c=c||k.process_bypass,_=_||k.process_navigation});break;case"action":m=void 0!==l.value&&n.parse_variables_process(l.value,!1,!1,!1,!1,!1).output,g=n.conditional_process_action(a,f,e(this),!1,h,u,v,m,!1);r=r||g.process_required,c=c||g.process_bypass,_=_||g.process_navigation}o++}}return r&&("function"==typeof this.form_progress&&this.form_progress(),this.form_required()),c&&this.form_bypass(!0)&&"function"==typeof this.form_tab_validation_process&&this.form_tab_validation_process(),_&&this.form_navigation(),o},e.WS_Form.prototype.conditional_process_action=function(t,a,i,s,o,r,c,_,n){void 0===_&&(_="");var d=void 0!==this.framework.tabs.public.selector_href?this.framework.tabs.public.selector_href:"href",l=ws_form_settings.field_prefix+r+(n?"["+n+"]":""),h=_,u=!1,v=!1,f=!1,b=!1;switch(a){case"value":case"value_number":case"value_datetime":case"value_tel":case"value_email":case"value_textarea":case"value_url":case"value_range":case"value_rating":case"value_color":case"html":case"text_editor":case"button_html":this.field_value_set(i,s,_);break;case"class_add_wrapper":i.addClass(_),u="debug_action_added";break;case"class_remove_wrapper":i.removeClass(_),u="debug_action_removed";break;case"class_add_field":s.addClass(_),u="debug_action_added";break;case"class_remove_field":s.removeClass(_),u="debug_action_removed";break;case"reset_signature":"function"==typeof this.signature_clear_by_name&&(this.signature_clear_by_name(l),u="debug_action_reset");break;case"value_row_select":case"value_row_deselect":s.each(function(){if(e(this).is(":enabled")){var t=e(this).prop("selected")!==("value_row_select"==a);e(this).prop("selected",!1).prop("selected","value_row_select"==a),t&&e(this).closest("select").trigger("change")}}),u="debug_action_"+("value_row_select"==a?"selected":"deselected");break;case"value_row_select_value":case"value_row_deselect_value":var p="value_row_select_value"==a;this.field_value_set(i,s,_,p),u="debug_action_"+(p?"selected_value":"deselected_value");break;case"value_row_select_all":case"value_row_deselect_all":e("option",i).each(function(){if(e(this).is(":enabled")){var t=e(this).prop("selected")!==("value_row_select_all"==a);e(this).prop("selected",!1).prop("selected","value_row_select_all"==a),t&&e(this).closest("select").trigger("change"),u="debug_action_"+("value_row_select_all"==a?"selected":"deselected")}});break;case"value_row_reset":e("option:selected:enabled",i).prop("selected",!1).trigger("change"),u="debug_action_reset";break;case"value_row_check":case"value_row_uncheck":s.each(function(){if(e(this).is(":enabled")){var t=e(this).prop("checked")!==("value_row_check"==a);e(this).prop("checked","value_row_check"==a),t&&e(this).trigger("change")}}),u="debug_action_"+("value_row_check"==a?"checked":"unchecked");break;case"value_row_check_value":case"value_row_uncheck_value":p="value_row_check_value"==a;this.field_value_set(i,s,_,p),u="debug_action_"+(p?"checked":"unchecked");break;case"value_row_check_all":case"value_row_uncheck_all":e('input[type="checkbox"]',i).each(function(){if(e(this).is(":enabled")){var t=e(this).prop("checked")!==("value_row_check_all"==a);e(this).prop("checked","value_row_check_all"==a),t&&e(this).trigger("change"),u="debug_action_"+("value_row_check_all"==a?"checked":"unchecked")}});break;case"value_row_required":case"value_row_not_required":s.prop("required","value_row_required"==a).removeAttr("data-init-required"),"value_row_required"==a?s.attr("data-required","").attr("aria-required","true").removeAttr("data-conditional-logic-bypass"):s.removeAttr("data-required").removeAttr("aria-required").attr("data-conditional-logic-bypass",""),u="debug_action_"+("value_row_required"==a?"required":"not_required"),v=!0,f=!0;break;case"value_row_disabled":case"value_row_not_disabled":s.attr("disabled","value_row_disabled"==a),void 0!==s.parent().attr("data-wsf-select2")&&"function"==typeof this.form_select2&&this.form_select2(s.parent()),u="debug_action_"+("value_row_disabled"==a?"disabled":"enabled");break;case"value_row_visible":case"value_row_not_visible":"value_row_not_visible"===a?s.parent().hide():s.parent().show(),u="debug_action_"+("value_row_not_visible"==a?"hide":"show");break;case"value_row_focus":s.trigger("focus"),u="debug_action_focussed";break;case"value_row_class_add":s.addClass(_),u="debug_action_added";break;case"value_row_class_remove":s.removeClass(_),u="debug_action_removed";break;case"value_row_set_custom_validity":this.set_invalid_feedback(s,_,c),f=!0;break;case"min":case"max":case"step":case"low":case"high":case"optimum":_=""!=_&&this.get_float(_,0),this.obj_set_attribute(s,a,_);break;case"min_int":case"max_int":case"step_int":var m=a.replace("_int","");_=""!=_&&this.get_number(_,0,!1),this.obj_set_attribute(s,m,_);break;case"min_date":case"max_date":case"min_time":case"max_time":if("function"==typeof s.datetimepicker)switch(a){case"min_date":s.datetimepicker("setOptions",{minDate:_});break;case"max_date":s.datetimepicker("setOptions",{maxDate:_});break;case"min_time":s.datetimepicker("setOptions",{minTime:_});break;case"max_time":s.datetimepicker("setOptions",{maxTime:_})}break;case"ecommerce_price_min":case"ecommerce_price_max":_=""!=_&&this.get_float(_,0);var g=s.val();this.obj_set_attribute(s,"data-ecommerce-"+("ecommerce_price_min"===a?"min":"max"),_),"function"==typeof this.form_ecommerce_input_mask_currency&&this.form_ecommerce_input_mask_currency(s),s.val()!==g&&s.trigger("change");break;case"select_min":case"select_max":var k="select_min"===a?"min":"max";_=""!=_&&this.get_number(_,0,!1);var w=void 0===i.attr("data-select-min-max-init");if(!1!==_?i.attr("data-select-"+k,_):i.removeAttr("data-select-"+k),w)"function"==typeof this.form_select_min_max&&this.form_select_min_max();else{var y=e('input[type="number"]',i);this.obj_set_attribute(y,k,_)}break;case"checkbox_min":case"checkbox_max":k="checkbox_min"===a?"min":"max";_=""!=_&&this.get_number(_,0,!1);var j=void 0===i.attr("data-checkbox-min-max-init");if(!1!==_?i.attr("data-checkbox-"+k,_):i.removeAttr("data-checkbox-"+k),j)"function"==typeof this.form_checkbox_min_max&&this.form_checkbox_min_max();else{y=e('input[type="number"]',i);this.obj_set_attribute(y,k,_)}break;case"visibility":switch(o){case"group":var x=e("["+d+'="#'+this.esc_selector(this.form_id_prefix+"group-"+r)+'"]',this.form_canvas_obj).parent();if("off"===_){if(i.is(":visible")){var q=e('[id^="'+this.esc_selector(this.form_id_prefix)+'group-"]:not([data-wsf-group-hidden])');if(q.length){var O=q.first().attr("id");e("["+d+'="#'+this.esc_selector(O)+'"]').trigger("click")}}x.attr("data-wsf-group-hidden","").hide().attr("aria-live","polite").attr("aria-hidden","true"),i.attr("data-wsf-group-hidden","").attr("aria-live","polite").attr("aria-hidden","true"),u="debug_action_hide"}else x.removeAttr("data-wsf-group-hidden").show().removeAttr("aria-hidden"),i.removeAttr("data-wsf-group-hidden").removeAttr("aria-hidden"),u="debug_action_show";f=!0,b=!0;break;case"section":case"field":"off"===_?(i.hide().attr("aria-live","polite").attr("aria-hidden","true"),f=!0,u="debug_action_hide"):(i.show().removeAttr("aria-hidden"),f=!0,"function"==typeof this.signatures_redraw&&("section"==o&&this.signatures_redraw(!1,r),"field"==o&&this.signatures_redraw(!1,!1,r)),u="debug_action_show")}break;case"set_row_count":if(!(T=e('[data-repeatable][data-id="'+this.esc_selector(r)+'"]',this.form_canvas_obj)).length)break;var A=T.length;if(isNaN(_))break;var S=parseInt(_,10),F=this.section_data_cache[r],W=this.get_object_meta_value(F,"section_repeat_min",1);(W=""==W||isNaN(W)?1:parseInt(W,10))<1&&(W=1);var I=this.get_object_meta_value(F,"section_repeat_max",!1);if(SI&&(S=I),AS){for(var z=A-S,N=0;N ("+this.language("debug_action_type")+": "+B+" | ID: "+r+(c?" | "+this.language("debug_action_row")+" ID: "+c:"")+")";this.log("log_conditional_action_"+t,X,"conditional")}}return{process_required:v,process_bypass:f,process_navigation:b}},e.WS_Form.prototype.obj_set_attribute=function(e,t,a){void 0!==e.attr("data-"+t+"-bypass")?!1!==a?e.attr("data-"+t+"-bypass",a).trigger("change"):e.removeAttr("data-"+t+"-bypass").trigger("change"):!1!==a?e.attr(t,a).trigger("change"):e.removeAttr(t).trigger("change")},e.WS_Form.prototype.conditional_logic_previous=function(e,t,a){switch(a){case"||":e|=t;break;case"&&":e&=t}return e},e.WS_Form.prototype.conditional_condition_check=function(e){return!(null===e||"object"!=typeof e||void 0===e.id||void 0===e.object||void 0===e.object_id||void 0===e.object_row_id||void 0===e.logic||void 0===e.value||void 0===e.case_sensitive||void 0===e.logic_previous||""==e.id||0==e.id||""==e.object||""==e.object_id||""==e.logic)},e.WS_Form.prototype.conditional_action_check=function(e){return!(null===e||"object"!=typeof e||void 0===e.object||void 0===e.object_id||void 0===e.action||""==e.object||""==e.object_id||""==e.action)}}(jQuery);