// source --> https://freightlined.com/wp-content/plugins/gravityformschainedselects/js/frontend.min.js?ver=1.8.1 
(d=>{function f(e,t,i,n=0){t=void 0===t?"/images/ajax-loader.gif":t,i=void 0!==i?i:"";return this.elem=e,this.formId=e.parents("form").data("formid"),this.image='<img class="gfspinner" src="'+t+'" style="'+i+'" />',this.init=function(){if("function"!=typeof gformInitializeSpinner||!this.formUsesFramework(this.formId))return this.spinner=jQuery(this.image),jQuery(this.elem).after(this.spinner),this;var e=this.elem.closest("span");gformInitializeSpinner(this.formId,e,"gform-chainedselect-spinner-"+n)},this.destroy=function(){"function"==typeof gformRemoveSpinner&&this.formUsesFramework(this.formId)?gformRemoveSpinner("gform-chainedselect-spinner-"+n):jQuery(this.spinner).remove()},this.formUsesFramework=function(e){return jQuery("#gform_wrapper_"+e).hasClass("gform-theme--framework")},this.init()}window.GFChainedSelects=function(e,t,i,n){var c=this,e=(c.formId=e,c.fieldId=t,c.hideInactive=i,c.alignment=n,d("#field_"+c.formId+"_"+c.fieldId));c.$selects=e.find("select"),c.$complete=e.find(".gf_chain_complete"),c.isDoingConditionalLogic=!1,c.init=function(){gform.addAction("gform_input_change",function(e,t,i){var n;-1!=c.$selects.index(e)&&(n=d(e).attr("name").split("_")[1],c.populateNextChoices(n,e.value,d(e)))},9),c.$selects.filter(function(){var e=d(this);return e.hasClass("gf_no_options")||e.find("option").length<=1}).toggleSelect(!0,c.hideInactive),gform.addFilter("gform_is_value_match",function(e,t,i){return c.isValueMatch(e,t,i)})},c.populateNextChoices=function(e,t,i){var s,r,n,a,o=c.getNextInputId(e),l=c.$selects.filter('[name="input_'+o+'"]');l.length<=0?(c.resetSelects(i,!0),c.resizeSelects()):(c.resetSelects(i),t&&(c.hideInactive?s=new f(c.$selects.filter('[name="input_'+e+'" ]'),gformChainedSelectData.spinner,"display:inline-block;vertical-align:middle;margin:-1px 0 0 6px;",e):(r=d('<option value="">'+gformChainedSelectData.strings.loading+"...</option>"),n=2,a=setInterval(function(){r.text(gformChainedSelectData.strings.loading+new Array(n).join(".")),n=3<n?0:n+1},250),r.prependTo(l).prop("selected",!0),l.css({minWidth:l.width()}),r.text(gformChainedSelectData.strings.loading+".")),d.post(gformChainedSelectData.ajaxUrl,{action:"gform_get_next_chained_select_choices",input_id:e,form_id:c.formId,field_id:c.fieldId,value:c.getChainedSelectsValue(),nonce:gformChainedSelectData.nonce},function(e){var n,o,t;c.hideInactive?s.destroy():(clearInterval(a),r.remove()),e&&(e=d.parseJSON(e),n="",l.find("option:not(:first)").remove(),e.length<=0?c.resetSelects(i,!0):(o=!1,d.each(e,function(e,t){var i=t.isSelected?'selected="selected"':"";i&&(o=!0),n+='<option value="'+t.value+'"'+i+">"+t.text+"</option>"}),l.show().append(n),e[0].noOptions?(e=l.find("option:last-child").clone(),(t=l.parents("span").nextAll().find("select")).append(e),t.add(l).addClass("gf_no_options").find("option:last-child").prop("selected",!0)):(l.removeClass("gf_no_options").toggleSelect(!1,c),o&&l.change())),c.resizeSelects())})))},c.getChainedSelectsValue=function(){var t={};return c.$selects.each(function(){var e=d(this).attr("name").split("_")[1];t[e]=d(this).val()}),t},c.getNextInputId=function(e){var t=parseInt(e.split(".")[1])+1;return t%10==0&&t++,parseInt(e)+"."+t},c.resetSelects=function(e,t){e=c.$selects.index(e);c.$selects.filter(":gt("+e+")").toggleSelect(!0,c.hideInactive).find("option:not(:first)").remove().val("").change()},c.resizeSelects=function(){var e;"vertical"==c.alignment&&(c.$selects.width("auto"),e=0,c.$selects.each(function(){d(this).width()>e&&(e=d(this).width())}),c.$selects.width(e+"px"))},c.toggleCompleted=function(e){e?c.$complete.fadeIn():c.$complete.fadeOut()},c.isValueMatch=function(e,t,i){if(t==c.formId&&i.fieldId==c.fieldId&&!c.isDoingConditionalLogic){c.isDoingConditionalLogic=!0,i=d.extend({},i);for(var n=c.getChainedSelectsValue(),o=Object.keys(n).map(function(e){return n[e]}),s=i.value.split("/"),r=0;r<s.length;r++)"*"==s[r]&&(s[r]=o[r]);s=s.join("/"),o=o.join("/"),e=gf_matches_operation(s,o,i.operator),c.isDoingConditionalLogic=!1}return e},d.fn.toggleSelect=function(e,t){return this.prop("disabled",e),void 0!==t&&t&&(e?this.parent().children().hide():this.parent().children().show()),this},c.init()}})(jQuery);