%PDF- %PDF-
Direktori : /var/www/tif-dev/wp-content/plugins/gravityforms/js/ |
Current File : //var/www/tif-dev/wp-content/plugins/gravityforms/js/form_editor.min.js |
function handleStatus(){jQuery(".gf_editor_error").length&&jQuery(".error_dismiss").on("click",function(e){jQuery(".gf_editor_error").animate({opacity:"0"},500)}),jQuery(".gf_editor_status").length&&(jQuery(".gf_editor_status").animate({opacity:"1",bottom:"16px"},1e3),jQuery(".gf_editor_status").on("click",function(e){jQuery(this).animate({opacity:"0"},500)}),setTimeout(function(){jQuery(".gf_editor_status").animate({opacity:"0"},500)},25e3))}function InitializeFieldSettings(){gform.addFilter("gform_editor_field_settings","hideDefaultMarginOnTopLabelAlignment"),jQuery("#field_max_file_size").on("input propertychange",function(){var e=jQuery(this),t=parseInt(e.val());SetFieldProperty("maxFileSize",t||"")}).on("change",function(){var e=GetSelectedField(),t=e.maxFileSize?e.maxFileSize:"",i=""===t?"":t+"MB";this.value=i}),jQuery(document).on("input propertychange",".field_default_value",function(){SetFieldDefaultValue(this.value)}),jQuery(document).on("input propertychange",".field_placeholder, .field_placeholder_textarea",function(){SetFieldPlaceholder(this.value),""===GetSelectedField().label&&(setFieldError("label_setting","below"),""!==this.value&&resetFieldError("label_setting"))}),jQuery("#field_choices").on("change",".field-choice-price",function(){var e=GetSelectedField(),t=jQuery(this).parent("li").index(),i=e.choices[t].price;this.value=i}),jQuery(".field_input_choices").on("input propertychange","input",function(){var e=jQuery(this).closest("li"),t=e.data("index");SetInputChoice(e.data("input_id"),t,e.find(".field-choice-value").val(),e.find(".field-choice-text").val())}).on("click keypress","input:radio, input:checkbox",function(){var e=jQuery(this).closest("li"),t=e.data("index");SetInputChoice(e.data("input_id"),t,e.find(".field-choice-value").val(),e.find(".field-choice-text").val())}).on("click keypress",".field-input-insert-choice",function(){var e=jQuery(this).closest("li"),t=e.closest("ul"),i=e.data("index");InsertInputChoice(t,e.data("input_id"),i+1)}).on("click keypress",".field-input-delete-choice",function(){var e=jQuery(this).closest("li"),t=e.closest("ul"),i=e.data("index");DeleteInputChoice(t,e.data("input_id"),i)}),jQuery(".field_input_choice_values_enabled").on("click keypress",function(){var e=jQuery(this).parent().siblings(".gfield_settings_input_choices_container");ToggleInputChoiceValue(e,this.checked),SetInputChoices(e.find("ul"))}),jQuery(".input_placeholders_setting").on("input propertychange",".input_placeholder",function(){var e=jQuery(this).closest(".input_placeholder_row").data("input_id");SetInputPlaceholder(this.value,e)}).on("input propertychange","#field_single_placeholder",function(){SetFieldPlaceholder(this.value)}),jQuery("#field_rich_text_editor").on("click keypress",function(){var e=GetSelectedField();if(this.checked){var t=!0;HasConditionalLogicDependency(e.id,e.value)&&(confirm(gf_vars.conditionalLogicRichTextEditorWarning)||(jQuery("#field_rich_text_editor").prop("checked",!1),t=!1)),t&&(jQuery("#field_placeholder, #field_placeholder_textarea").prop("disabled",!0),jQuery("span#placeholder_warning").css("display","block"))}else jQuery("#field_placeholder, #field_placeholder_textarea").prop("disabled",!1),jQuery("span#placeholder_warning").css("display","none")}),jQuery(".prepopulate_field_setting").on("input propertychange",".field_input_name",function(){var e=jQuery(this).closest(".field_input_name_row").data("input_id");SetInputName(this.value,e)}).on("input propertychange","#field_input_name",function(){SetInputName(this.value)}),jQuery(".custom_inputs_setting, .custom_inputs_sub_setting, .sub_labels_setting").on("change",".gform-field__toggle-input",function(){var e=jQuery(this).closest(".gform-field__toggle").data("input_id");ToggleInputHidden(jQuery(this),e)}).on("click","#field_password_fields_container .gform-field__toggle",function(){var e=jQuery(this).data("input_id"),t=jQuery(this).find(".gform-field__toggle-input");t[0].focus(),t[0].checked=!t[0].checked,ToggleInputHidden(t,e)}).on("input propertychange",".field_custom_input_default_label",function(){var e=jQuery(this).closest(".field_custom_input_row").data("input_id");SetInputCustomLabel(this.value,e)}).on("input propertychange",".field_single_custom_label",function(){SetInputCustomLabel(this.value)}),jQuery(".default_input_values_setting").on("input propertychange",".default_input_value",function(){var e=jQuery(this).closest(".default_input_value_row").data("input_id");SetInputDefaultValue(this.value,e)}).on("input","#field_single_default_value",function(){SetFieldDefaultValue(this.value)}),jQuery(".choices_setting, .columns_setting").on("input propertychange",".field-choice-input",function(e){var t=jQuery(this),i=t.closest("li.field-choice-row");SetFieldChoice(i.data("input_type"),i.data("index")),(t.hasClass("field-choice-text")||t.hasClass("field-choice-value"))&&(CheckChoiceConditionalLogicDependency(this),e.stopPropagation())}),jQuery("#field_enable_copy_values_option").on("click keypress",function(){SetCopyValuesOptionProperties(this.checked),ToggleCopyValuesOption(!1),0==this.checked&&ToggleCopyValuesActivated(!1)}),jQuery("#field_copy_values_option_label").on("input propertychange",function(){SetCopyValuesOptionLabel(this.value)}),jQuery("#field_copy_values_option_field").on("change",function(){SetFieldProperty("copyValuesOptionField",jQuery(this).val())}),jQuery("#field_copy_values_option_default").on("change",function(){SetFieldProperty("copyValuesOptionDefault",1==this.checked?1:0),ToggleCopyValuesActivated(this.checked)}),jQuery("#field_label").on("input propertychange",function(){SetFieldLabel(this.value),SetAriaLabel(this.value),""!==this.value&&(resetFieldError("label_setting"),ResetFieldAccessibilityWarning("label_setting"))}).on("blur",function(){""===this.value&&setFieldError("label_setting","below")}),jQuery("#field_description").on("blur",function(){var e=GetSelectedField();e.description!=this.value&&(SetFieldDescription(this.value),RefreshSelectedFieldPreview()),""===e.label&&(setFieldError("label_setting","below"),""!==this.value&&resetFieldError("label_setting"))}),jQuery('input[ name="field_visibility" ]').on("DOMSubTreeModified change",function(){var e=GetSelectedField();SetFieldProperty("visibility",this.value);var t='<div class="admin-hidden-markup"><i class="gform-icon gform-icon--hidden"></i><span>Hidden</span></div>';"hidden"===e.visibility?(jQuery("#field_"+e.id).addClass("admin-hidden"),jQuery("#field_"+e.id+" .gfield_label").before(t),jQuery("#field_"+e.id+" .gsection_title").before(t)):(jQuery("#field_"+e.id).removeClass("admin-hidden"),jQuery("#field_"+e.id+" .admin-hidden-markup").remove())}),jQuery("#field_checkbox_label").on("input propertychange",function(){GetSelectedField().checkboxLabel!=this.value&&(SetFieldCheckboxLabel(this.value),RefreshSelectedFieldPreview())}),jQuery("#field_content").on("input propertychange",function(){SetFieldProperty("content",this.value)}),jQuery("#next_button_text_input, #next_button_image_url").on("input propertychange",function(){SetPageButton("next")}),jQuery("#previous_button_image_url, #previous_button_text_input").on("input propertychange",function(){SetPageButton("previous")}),jQuery("#field_custom_field_name_text").on("input propertychange",function(){SetFieldProperty("postCustomFieldName",this.value)}),jQuery("#field_customfield_content_template").on("input propertychange",function(){SetCustomFieldTemplate()}),jQuery("#gfield_calendar_icon_url").on("input propertychange",function(){SetFieldProperty("calendarIconUrl",this.value)}),jQuery("#field_max_files").on("input propertychange",function(){SetFieldProperty("maxFiles",this.value)}),jQuery("#field_maxrows").on("input propertychange",function(){SetFieldProperty("maxRows",this.value)}),jQuery("#field_mask_text").on("input propertychange",function(){SetFieldProperty("inputMaskValue",this.value)}),jQuery("#field_file_extension").on("input propertychange",function(){SetFieldProperty("allowedExtensions",this.value)}),jQuery("#field_maxlen").on("keypress",function(e){return ValidateKeyPress(e,GetMaxLengthPattern(),!1)}).on("change keyup",function(){SetMaxLength(this)}),jQuery("#field_range_min").on("input propertychange",function(){SetFieldProperty("rangeMin",this.value)}),jQuery("#field_range_max").on("input propertychange",function(){SetFieldProperty("rangeMax",this.value)}),jQuery("#field_calculation_formula").on("input propertychange",function(){SetFieldProperty("calculationFormula",this.value.trim())}),jQuery("#field_error_message").on("input propertychange",function(){SetFieldProperty("errorMessage",this.value)}),jQuery("#field_css_class").on("focus",function(){jQuery(this).data("previousClass",this.value)}).on("change",function(){SetFieldProperty("cssClass",this.value),previousClass=jQuery(this).data("previousClass"),jQuery("#field_"+field.id).removeClass(previousClass).addClass(this.value),CheckDeprecatedReadyClass(field)}),jQuery("#field_admin_label").on("input propertychange",function(){SetFieldProperty("adminLabel",this.value)}),jQuery(".autocomplete_setting").on("input propertychange",".input_autocomplete",function(){var e=jQuery(this).closest(".input_autocomplete_row").data("input_id");SetInputAutocomplete(this.value,e)}).on("input propertychange","#field_autocomplete_attribute",function(){SetFieldProperty("autocompleteAttribute",this.value)}),jQuery("#field_add_icon_url").on("input propertychange",function(){SetFieldProperty("addIconUrl",this.value)}),jQuery("#field_delete_icon_url").on("input propertychange",function(){SetFieldProperty("deleteIconUrl",this.value)})}function hideDefaultMarginOnTopLabelAlignment(e,t){if("top_label"!==form.labelPlacement)return e;for(var i in e)if(".disable_margins_setting"===e[i]){e.splice(i,1);break}return e}function InitializeForm(e){e.lastPageButton&&"image"===e.lastPageButton.type?jQuery("#last_page_button_image").prop("checked",!0):e.lastPageButton&&"image"===e.lastPageButton.type||jQuery("#last_page_button_text").prop("checked",!0),jQuery("#last_page_button_text_input").val(e.lastPageButton?e.lastPageButton.text:gf_vars.previousLabel),jQuery("#last_page_button_image_url").val(e.lastPageButton?e.lastPageButton.imageUrl:""),TogglePageButton("last_page",!0),e.postStatus&&jQuery("#field_post_status").val(e.postStatus),e.postAuthor&&jQuery("#field_post_author").val(e.postAuthor),void 0===e.useCurrentUserAsAuthor&&(e.useCurrentUserAsAuthor=!0),jQuery("#gfield_current_user_as_author").prop("checked",!!e.useCurrentUserAsAuthor),e.postCategory&&jQuery("#field_post_category").val(e.postCategory),e.postFormat&&jQuery("#field_post_format").val(e.postFormat),e.postContentTemplateEnabled?(jQuery("#gfield_post_content_enabled").prop("checked",!0),jQuery("#field_post_content_template").val(e.postContentTemplate)):(jQuery("#gfield_post_content_enabled").prop("checked",!1),jQuery("#field_post_content_template").val("")),TogglePostContentTemplate(!0),e.postTitleTemplateEnabled?(jQuery("#gfield_post_title_enabled").prop("checked",!0),jQuery("#field_post_title_template").val(e.postTitleTemplate)):(jQuery("#gfield_post_title_enabled").prop("checked",!1),jQuery("#field_post_title_template").val("")),TogglePostTitleTemplate(!0),jQuery("#gform_pagination, #gform_last_page_settings").on("click",function(e){FieldClick(this),e.stopPropagation()}),jQuery("#gform_fields").on("click",".gfield",function(e){FieldClick(this),e.stopPropagation()});var t=e.pagination&&e.pagination.type?e.pagination.type:"percentage",i="percentage"===t,l="none"===t;"steps"===t?jQuery("#pagination_type_steps").prop("checked",!0):i?jQuery("#pagination_type_percentage").prop("checked",!0):l&&jQuery("#pagination_type_none").prop("checked",!0),jQuery("#first_page_css_class").val(e.firstPageCssClass),TogglePageBreakSettings(),InitPaginationOptions(!0),InitializeFields()}function LoadFieldSettings(){field=GetSelectedField();var e=GetInputType(field);resetAllFieldAccessibilityWarnings(),resetAllFieldErrors(),resetDeprecatedReadyClassNotice(),jQuery("#field_label").val(field.label),"html"==field.type?(jQuery(".label_setting .gf_tooltip:first-child").hide(),jQuery(".label_setting .gf_tooltip:last-child").show()):(jQuery(".label_setting .gf_tooltip:first-child").show(),jQuery(".label_setting .gf_tooltip:last-child").hide()),jQuery("#field_admin_label").val(field.adminLabel),jQuery("#field_content").val(null==field.content?"":field.content),jQuery("#post_custom_field_type").val(field.inputType),jQuery("#post_tag_type").val(field.inputType),jQuery("#field_size").val(field.size),jQuery("#field_required").prop("checked",1==field.isRequired),jQuery("#field_margins").prop("checked",1==field.disableMargins),jQuery("#field_no_duplicates").prop("checked",1==field.noDuplicates),jQuery("#field_default_value").val(null==field.defaultValue?"":field.defaultValue),jQuery("#field_default_value_textarea").val(null==field.defaultValue?"":field.defaultValue),jQuery("#field_autocomplete_attribute").val(field.autocompleteAttribute),jQuery("#field_description").val(null==field.description?"":field.description),jQuery("#field_description").attr("placeholder",null==field.descriptionPlaceholder?"":field.descriptionPlaceholder),jQuery("#field_checkbox_label").val(null==field.checkboxLabel?"":field.checkboxLabel),jQuery("#field_css_class").val(null==field.cssClass?"":field.cssClass),jQuery("#field_range_min").val(null==field.rangeMin||!1===field.rangeMin?"":field.rangeMin),jQuery("#field_range_max").val(null==field.rangeMax||!1===field.rangeMax?"":field.rangeMax),jQuery("#field_name_format").val(field.nameFormat),jQuery("#field_force_ssl").prop("checked",!!field.forceSSL),""!==field.cssClass&&CheckDeprecatedReadyClass(field),field.useRichTextEditor?(jQuery("#field_placeholder, #field_placeholder_textarea").prop("disabled",!0),jQuery("span#placeholder_warning").css("display","block")):(jQuery("#field_placeholder, #field_placeholder_textarea").prop("disabled",!1),jQuery("span#placeholder_warning").css("display","none")),void 0===field.labelPlacement&&(field.labelPlacement=""),void 0===field.descriptionPlacement&&(field.descriptionPlacement=""),void 0===field.subLabelPlacement&&(field.subLabelPlacement=""),jQuery("#field_label_placement").val(field.labelPlacement),jQuery("#field_description_placement").val(field.descriptionPlacement),jQuery("#field_sub_label_placement").val(field.subLabelPlacement),"left_label"==field.labelPlacement||"right_label"==field.labelPlacement||""==field.labelPlacement&&"top_label"!=form.labelPlacement?jQuery("#field_description_placement_container").hide():jQuery("#field_description_placement_container").show(),SetFieldVisibility(field.visibility,!0),void 0===field.placeholder&&(field.placeholder=""),jQuery("#field_placeholder, #field_placeholder_textarea").val(field.placeholder),jQuery("#field_file_extension").val(null==field.allowedExtensions?"":field.allowedExtensions),jQuery("#field_multiple_files").prop("checked",!!field.multipleFiles),jQuery("#field_max_files").val(field.maxFiles?field.maxFiles:""),jQuery("#field_max_file_size").val(field.maxFileSize?field.maxFileSize+"MB":""),ToggleMultiFile(!0),jQuery("#field_phone_format").val(field.phoneFormat),jQuery("#field_error_message").val(field.errorMessage),jQuery("#field_select_all_choices").prop("checked",!!field.enableSelectAll),jQuery("#field_other_choice").prop("checked",!!field.enableOtherChoice),jQuery("#field_add_icon_url").val(field.addIconUrl?field.addIconUrl:""),jQuery("#field_delete_icon_url").val(field.deleteIconUrl?field.deleteIconUrl:""),jQuery("#gfield_enable_enhanced_ui").prop("checked",!!field.enableEnhancedUI),jQuery("#gfield_password_strength_enabled").prop("checked",1==field.passwordStrengthEnabled),jQuery("#gfield_password_visibility_enabled").prop("checked",1==field.passwordVisibilityEnabled),TogglePasswordVisibility(!0),jQuery("#gfield_min_strength").val(null==field.minPasswordStrength?"":field.minPasswordStrength),TogglePasswordStrength(!0),jQuery("#gfield_email_confirm_enabled").prop("checked",1==field.emailConfirmEnabled),field.numberFormat?jQuery("#field_number_format_blank").remove():0==jQuery("#field_number_format #field_number_format_blank").length&&jQuery("#field_number_format").prepend("<option id='field_number_format_blank' value=''>"+gf_vars.selectFormat+"</option>"),jQuery("#field_number_format").val(field.numberFormat?field.numberFormat:""),"product"==field.type&&"calculation"==field.inputType?(field.enableCalculation=!0,jQuery(".field_calculation_rounding").hide(),jQuery(".field_enable_calculation").hide()):(jQuery(".field_enable_calculation").show(),"number"==field.type&&"currency"==field.numberFormat?jQuery(".field_calculation_rounding").hide():jQuery(".field_calculation_rounding").show()),jQuery("#field_enable_calculation").prop("checked",!!field.enableCalculation),ToggleCalculationOptions(field.enableCalculation,field),jQuery("#field_calculation_formula").val(field.calculationFormula);var t=gformIsNumber(field.calculationRounding)?field.calculationRounding:"norounding";jQuery("#field_calculation_rounding").val(t),jQuery("#option_field_type").val(field.inputType);var i=jQuery("#product_field_type");if(i.val(field.inputType),has_entry(field.id)?i.prop("disabled",!0):i.prop("disabled",!1),jQuery("#donation_field_type").val(field.inputType),jQuery("#quantity_field_type").val(field.inputType),"hiddenproduct"==field.inputType||"singleproduct"==field.inputType||"singleshipping"==field.inputType||"calculation"==field.inputType){var l=null==field.basePrice?"":field.basePrice;jQuery("#field_base_price").val(null==field.basePrice?"":field.basePrice),SetBasePrice(l)}jQuery("#shipping_field_type").val(field.inputType),jQuery("#field_disable_quantity").prop("checked",1==field.disableQuantity),SetDisableQuantity(1==field.disableQuantity);var d=!!field.enablePasswordInput;jQuery("#field_password").prop("checked",d),jQuery("#field_maxlen").val(void 0===field.maxLength?"":field.maxLength),jQuery("#field_maxrows").val(void 0===field.maxRows?"":field.maxRows);var a=null==field.addressType?"international":field.addressType;jQuery("#field_address_type").val(a),"address"==field.type&&(field=UpgradeAddressField(field)),"email"!=field.type&&"email"!=field.inputType||(field=UpgradeEmailField(field)),"consent"===field.type&&(field=UpgradeConsentField(field));var r=null==field.defaultState?"":field.defaultState,o=null==field.defaultProvince?"":field.defaultProvince,n="canadian"==a&&""==r?o:r;jQuery("#field_address_default_state_"+a).val(n),jQuery("#field_address_default_country_"+a).val(null==field.defaultCountry?"":field.defaultCountry),SetAddressType(!0),jQuery("#gfield_display_alt").prop("checked",1==field.displayAlt),jQuery("#gfield_display_title").prop("checked",1==field.displayTitle),jQuery("#gfield_display_caption").prop("checked",1==field.displayCaption),jQuery("#gfield_display_description").prop("checked",1==field.displayDescription);var s=CustomFieldExists(field.postCustomFieldName);jQuery("#field_custom_field_name_select")[0].selectedIndex=0,jQuery("#field_custom_field_name_text").val(""),s?jQuery("#field_custom_field_name_select").val(field.postCustomFieldName):jQuery("#field_custom_field_name_text").val(field.postCustomFieldName),s?jQuery("#field_custom_existing").prop("checked",!0):jQuery("#field_custom_new").prop("checked",!0),ToggleCustomField(!0),jQuery("#gfield_customfield_content_enabled").prop("checked",!!field.customFieldTemplateEnabled),jQuery("#field_customfield_content_template").val(field.customFieldTemplateEnabled?field.customFieldTemplate:""),ToggleCustomFieldTemplate(!0),field.displayAllCategories?jQuery("#gfield_category_all").prop("checked",!0):jQuery("#gfield_category_select").prop("checked",!0),ToggleCategory(!0),jQuery("#gfield_post_category_initial_item_enabled").prop("checked",!!field.categoryInitialItemEnabled),jQuery("#field_post_category_initial_item").val(field.categoryInitialItemEnabled?field.categoryInitialItem:""),TogglePostCategoryInitialItem(!0);var c=!!field.postFeaturedImage;jQuery("#gfield_featured_image").prop("checked",c),"boolean"!=typeof field.inputMaskIsCustom&&(field.inputMaskIsCustom=!IsStandardMask(field.inputMaskValue));var u=!field.inputMaskIsCustom;if(jQuery("#field_input_mask").prop("checked",!!field.inputMask),u?(jQuery("#field_mask_standard").prop("checked",!0),jQuery("#field_mask_select").val(field.inputMaskValue)):(jQuery("#field_mask_custom").prop("checked",!0),jQuery("#field_mask_text").val(field.inputMaskValue)),ToggleInputMask(!0),ToggleInputMaskOptions(!0),InitAutocompleteOptions(!0),"creditcard"==e)for(y in field=UpgradeCreditCardField(field),(!field.creditCards||field.creditCards.length<=0)&&(field.creditCards=["amex","visa","discover","mastercard"]),field.creditCards)field.creditCards.hasOwnProperty(y)&&jQuery("#field_credit_card_"+field.creditCards[y]).prop("checked",!0);"date"==e&&(field=UpgradeDateField(field)),"time"==e&&(field=UpgradeTimeField(field)),CreateDefaultValuesUI(field),CreatePlaceholdersUI(field),CreateAutocompleteUI(field),CreateCustomizeInputsUI(field),CreateInputLabelsUI(field),field.dateType||"date"!=e||(field.dateType="datepicker"),jQuery("#field_date_input_type").val(field.dateType),jQuery("#gfield_calendar_icon_url").val(null==field.calendarIconUrl?"":field.calendarIconUrl),jQuery("#field_date_format").val(null==field.dateFormat?"mdy":field.dateFormat),jQuery("#field_time_format").val("24"==field.timeFormat?"24":"12"),SetCalendarIconType(field.calendarIconType,!0),ToggleDateCalendar(!0),LoadDateInputs(),LoadTimeInputs(),field.allowsPrepopulate=!!field.allowsPrepopulate,field.useRichTextEditor=!!field.useRichTextEditor,jQuery("#field_prepopulate").prop("checked",!!field.allowsPrepopulate),jQuery("#field_rich_text_editor").prop("checked",!!field.useRichTextEditor),has_entry(field.id)?jQuery("#field_rich_text_editor").prop("disabled",!0):jQuery("#field_rich_text_editor").prop("disabled",!1),CreateInputNames(field),ToggleInputName(!0);var f=0<GetFirstRuleField();"page"==field.type?(LoadFieldConditionalLogic(f,"next_button"),LoadFieldConditionalLogic(f,"page")):LoadFieldConditionalLogic(f,"field"),jQuery("#field_enable_copy_values_option").prop("checked",1==field.enableCopyValuesOption),jQuery("#field_copy_values_option_default").prop("checked",1==field.copyValuesOptionDefault);var p=GetCopyValuesFieldsOptions(field.copyValuesOptionField,field);0<p.length?(jQuery("#field_enable_copy_values_option").prop("disabled",!1),jQuery("#field_copy_values_disabled").hide(),jQuery("#field_copy_values_option_field").html(p)):(jQuery("#field_enable_copy_values_option").prop("disabled",!0),jQuery("#field_copy_values_disabled").show()),ToggleCopyValuesOption(field.enableCopyValuesOption,!0),field.nextButton&&("image"==field.nextButton.type?jQuery("#next_button_image").prop("checked",!0):jQuery("#next_button_text").prop("checked",!0),jQuery("#next_button_text_input").val(field.nextButton.text),jQuery("#next_button_image_url").val(field.nextButton.imageUrl)),field.previousButton&&("image"==field.previousButton.type?jQuery("#previous_button_image").prop("checked",!0):jQuery("#previous_button_text").prop("checked",!0),jQuery("#previous_button_text_input").val(field.previousButton.text),jQuery("#previous_button_image_url").val(field.previousButton.imageUrl)),TogglePageButton("next",!0),TogglePageButton("previous",!0),jQuery(".gfield_category_checkbox").each(function(){if(field.choices)for(var e=0;e<field.choices.length;e++)if(this.value==field.choices[e].value)return void(this.checked=!0);this.checked=!1}),has_entry(field.id)?jQuery("#field_type, #field_multiple_files").prop("disabled",!0):jQuery("#field_type, #field_multiple_files").prop("disabled",!1),jQuery("#field_custom_field_name").val(field.postCustomFieldName),jQuery("#field_columns_enabled").prop("checked",Boolean(field.enableColumns)).prop("disabled",has_entry(field.id)),LoadFieldChoices(field),jQuery(".field_setting").hide();var _=getAllFieldSettings(field);jQuery(_).show();for(var y=0;y<form.fields.length;y++)if("post_category"==form.fields[y].type){jQuery(".post_category_setting").hide();break}if("post_category"==field.type&&"select"!=e&&(jQuery(".post_category_initial_item_setting").hide(),jQuery("#gfield_post_category_initial_item_enabled").prop("checked",!1),SetCategoryInitialItem()),"post_tags"===field.type||"post_category"===field.type){var g="post_tags"===field.type?jQuery("#post_tag_type"):jQuery("#post_category_field_type");if("multiselect"==field.inputType){g.data("multiselect")&&(g.append('<option value="multiselect">'+g.data("multiselect")+"</option>"),g.val("multiselect"),g.data("multiselect",null));var h="post_tags"===field.type?"post_tag_type_setting":"post_category_field_type_setting";SetFieldAccessibilityWarning(h,"below")}}"quantity"==field.type&&jQuery(".calculation_setting").hide(),jQuery("#post_category_field_type").val(field.inputType);var m=null==field.simpleCaptchaFontColor?"":field.simpleCaptchaFontColor;jQuery("#field_captcha_fg").val(m),SetColorPickerColor("field_captcha_fg",m);var b=null==field.simpleCaptchaBackgroundColor?"":field.simpleCaptchaBackgroundColor;if(jQuery("#field_captcha_bg").val(b),SetColorPickerColor("field_captcha_bg",b),jQuery("#field_captcha_type").val(null==field.captchaType?"captcha":field.captchaType),jQuery("#field_captcha_badge").val(null==field.captchaBadge?"bottomright":field.captchaBadge),jQuery("#field_captcha_size").val(null==field.simpleCaptchaSize?"medium":field.simpleCaptchaSize),"captcha"==field.type){SetFieldAccessibilityWarning("captcha","above");var j=".captcha_language_setting, .captcha_theme_setting",v=".captcha_size_setting, .captcha_fg_setting, .captcha_bg_setting";"simple_captcha"==field.captchaType||"math"==field.captchaType?(jQuery(v).show(),jQuery(j).hide()):(jQuery(v).hide(),jQuery(j).show());var Q=null==field.captchaTheme||["blackglass","dark"].indexOf(field.captchaTheme)<0?"light":"dark";jQuery("#field_captcha_theme").val(Q).show();var k=null==field.captchaLanguage?"en":field.captchaLanguage;jQuery("#field_captcha_language").val(k).show(),jQuery('#field_captcha_type option[value="captcha"]').length<1&&jQuery("#field_captcha_type").prepend('<option value="captcha">reCAPTCHA</option>')}if("post_custom_field"!=field.type||"textarea"!=field.inputType&&"text"!=field.inputType||jQuery(".customfield_content_template_setting").show(),"name"==field.type&&(void 0===field.nameFormat||"advanced"!=field.nameFormat?field=MaybeUpgradeNameField(field):SetUpAdvancedNameField(),"simple"==field.nameFormat?(jQuery(".default_value_setting").show(),jQuery(".size_setting").show(),jQuery("#field_name_fields_container").html("").hide(),jQuery(".sub_label_placement_setting").hide(),jQuery(".name_prefix_choices_setting").hide(),jQuery(".name_format_setting").hide(),jQuery(".name_setting").hide(),jQuery(".default_input_values_setting").hide(),jQuery(".default_value_setting").show()):"extended"==field.nameFormat&&(jQuery(".name_format_setting").show(),jQuery(".name_prefix_choices_setting").hide(),jQuery(".name_setting").hide(),jQuery(".default_input_values_setting").hide(),jQuery(".input_placeholders_setting").hide())),-1!=jQuery.inArray(field.type,["product","option","shipping"])&&jQuery(".other_choice_setting").hide(),field.enableCalculation&&jQuery("li.range_setting").hide(),"text"==field.type&&(field.inputMask?jQuery(".maxlen_setting").hide():jQuery(".maxlen_setting").show()),"date"==e&&ToggleDateSettings(field),"email"==e&&ToggleEmailSettings(field),"password"===field.type||"password"===field.inputType){field=UpgradePasswordField(field);var F=GetCustomizeInputsUI(field);jQuery("#field_password_fields_container").html(F),jQuery("#field_password_fields_container table tr:eq(1) td:eq(0) div").remove(),"undefined"!=field.inputs[1].isHidden&&field.inputs[1].isHidden||jQuery(".size_setting").hide(),jQuery(".password_setting .custom_inputs_setting ").on("click keypress",".gform-field__toggle",function(){var e=GetSelectedField(),t=!e.inputs[1].isHidden,i=jQuery('label[for="input_'+e.id+'"]');t?(i.show(),jQuery(".size_setting").hide()):(i.hide(),jQuery(".size_setting").show())})}"multiselect"!==field.type&&"select"!==field.type||!field.enableEnhancedUI||SetFieldAccessibilityWarning("enable_enhanced_ui_setting","below"),"multiselect"===field.type&&SetFieldAccessibilityWarning("multiselect","above"),"hidden_label"===field.labelPlacement&&SetFieldAccessibilityWarning("label_placement_setting","above"),""===field.label&&setFieldError("label_setting","below"),"datepicker"===field.dateType&&SetFieldAccessibilityWarning("date_input_type_setting","above"),jQuery(document).trigger("gform_load_field_settings",[field,form]),gform.doAction("gform_post_load_field_settings",[field,form]),SetProductField(field),Placeholders.enable()}function getAllFieldSettings(e){var t=fieldSettings[e.type];if(e.inputType&&"post_category"!=e.type){var i=fieldSettings[e.inputType];0<i.length&&(t+=", "+i)}var l=t.split(", ");return(l=gform.applyFilters("gform_editor_field_settings",l,e)).join(", ")}function ToggleDateSettings(e){var t="datefield"==e.dateType,i="datepicker"==e.dateType,l="datedropdown"==e.dateType;jQuery(".placeholder_setting").toggle(i),jQuery(".default_value_setting").toggle(i),jQuery(".sub_label_placement_setting").toggle(t),jQuery(".sub_labels_setting").toggle(t),jQuery(".default_input_values_setting").toggle(l||t),jQuery(".input_placeholders_setting").toggle(l||t)}function SetUpAdvancedNameField(){field=GetSelectedField(),jQuery(".name_format_setting").hide(),jQuery(".name_setting").show(),jQuery(".name_prefix_choices_setting").show();var e=GetCustomizeInputsUI(field);jQuery("#field_name_fields_container").html(e).show();var t=GetInput(field,field.id+".2"),i=GetInputChoices(t);jQuery("#field_prefix_choices").html(i),ToggleNamePrefixUI(!t.isHidden),jQuery(".name_setting .custom_inputs_setting").on("click",".gform-field__toggle",function(){0<=jQuery(this).data("input_id").toString().indexOf(".2")&&ToggleNamePrefixUI(jQuery(this).find(".gform-field__toggle-input").is(":checked"))}),jQuery(".default_value_setting").hide(),jQuery(".default_input_values_setting").show(),jQuery(".input_placeholders_setting").show(),CreateDefaultValuesUI(field),CreatePlaceholdersUI(field),CreateAutocompleteUI(field),CreateInputNames(field)}function GetCopyValuesFieldsOptions(e,t){for(var i,l,d,a,r=[],o=GetInputType(t),n=0;n<form.fields.length;n++)(l=form.fields[n]).id==t.id||GetInputType(l)!=o||l.enableCopyValuesOption||(i=GetLabel(l),a=e==l.id?'selected="selected"':"",d='<option value="'+l.id+'" '+a+">"+i+"</option>",r.push(d));return r.join("")}function ToggleNamePrefixUI(e){jQuery(".name_prefix_choices_setting").toggle(e)}function TogglePageBreakSettings(){HasPageBreak()?(jQuery("#gform_last_page_settings").show(),jQuery("#gform_pagination").show()):(jQuery("#gform_last_page_settings").hide(),jQuery("#gform_pagination").hide())}function SetDisableQuantity(e){SetFieldProperty("disableQuantity",e),e?jQuery(".field_selected .ginput_quantity_label, .field_selected .ginput_quantity").hide():jQuery(".field_selected .ginput_quantity_label, .field_selected .ginput_quantity").show()}function SetBasePrice(e){e=e||0;var t=GetCurrentCurrency().toMoney(e);0==t&&(t=0),jQuery("#field_base_price").val(t),SetFieldProperty("basePrice",t),jQuery(".field_selected .ginput_product_price, .field_selected .ginput_shipping_price").html(t),jQuery(".field_selected .ginput_amount").val(t)}function ChangeAddressType(){if(field=GetSelectedField(),"address"==field.type){var e=jQuery("#field_address_type").val(),t=GetInput(field,field.id+".6"),i=jQuery("#field_address_country_"+e).val();t.isHidden=""!=i,SetAddressType(!1)}}function SetAddressType(e){field=GetSelectedField(),"address"==field.type&&(SetAddressProperties(),jQuery(".gfield_address_type_container").hide(),jQuery("#address_type_container_"+jQuery("#field_address_type").val()).show(),CreatePlaceholdersUI(field),CreateAutocompleteUI(field))}function UpdateAddressFields(){var e=jQuery("#field_address_type").val();field=GetSelectedField();var t=GetCustomizeInputsUI(field);jQuery("#field_address_fields_container").html(t);var i=GetInput(field,field.id+".5"),l=jQuery("#field_address_zip_label_"+e).val();jQuery("#field_custom_input_default_label_"+field.id+"_5").text(l),jQuery("#field_custom_input_label_"+field.id+"\\.5").attr("placeholder",l),i.customLabel||jQuery(".field_selected #input_"+field.id+"_5_label").html(l);var d=GetInput(field,field.id+".4"),a=jQuery("#field_address_state_label_"+e).val();if(jQuery("#field_custom_input_default_label_"+field.id+"_4").text(a),jQuery("#field_custom_input_label_"+field.id+"\\.4").attr("placeholder",a),d.customLabel||jQuery(".field_selected #input_"+field.id+"_4_label").html(a),""!=jQuery("#field_address_country_"+e).val()?(jQuery(".field_selected #input_"+field.id+"_6_container").hide(),jQuery(".field_custom_input_row_input_"+field.id+"_6").hide()):(jQuery(".field_selected #input_"+field.id+"_6").val(jQuery("#field_address_default_country_"+e).val()),jQuery(".field_selected #input_"+field.id+"_6_container").show(),jQuery(".field_selected .field_custom_input_row_input_"+field.id+"_6").show()),""!=jQuery("#field_address_has_states_"+e).val()){jQuery(".field_selected .state_text").hide();var r=jQuery("#field_address_default_state_"+e).val(),o=jQuery(".field_selected .state_dropdown");o.append(jQuery("<option></option>").val(r).html(r)),o.val(r).show()}else jQuery(".field_selected .state_dropdown").hide(),jQuery(".field_selected .state_text").show()}function SetAddressProperties(){field=GetSelectedField();var e=jQuery("#field_address_type").val();SetFieldProperty("addressType",e),SetFieldProperty("defaultState",jQuery("#field_address_default_state_"+e).val()),SetFieldProperty("defaultProvince","");var t=jQuery("#field_address_country_"+e).val();""==t&&(t=jQuery("#field_address_default_country_"+e).val()),SetFieldProperty("defaultCountry",t),UpdateAddressFields()}function MaybeUpgradeNameField(e){return void 0!==e.nameFormat&&""!=e.nameFormat&&"normal"!=e.nameFormat&&("simple"!=e.nameFormat||has_entry(e.id))||(e=UpgradeNameField(e,!0,!0,!0)),e}function UpgradeNameField(e,t,i,l){return e.nameFormat="advanced",e.inputs=MergeInputArrays(GetAdvancedNameFieldInputs(e,t,i,l),e.inputs),RefreshSelectedFieldPreview(function(){SetUpAdvancedNameField()}),e}function UpgradeDateField(e){return"date"!=e.type&&"date"!=e.inputType||void 0===e.dateType||"datepicker"==e.dateType||e.inputs||(e.inputs=GetDateFieldInputs(e)),e}function UpgradeTimeField(e){return"time"!=e.type&&"time"!=e.inputType||e.inputs||(e.inputs=GetTimeFieldInputs(e)),e}function UpgradeEmailField(e){return"email"!=e.type&&"email"!=e.inputType||e.emailConfirmEnabled&&!e.inputs&&(e.inputs=GetEmailFieldInputs(e),e.inputs[0].placeholder=e.placeholder),e}function UpgradePasswordField(e){return"password"!=e.type&&"password"!=e.inputType||e.inputs||(e.inputs=GetPasswordFieldInputs(e),e.inputs[0].placeholder=e.placeholder),e}function UpgradeAddressField(e){e.hideCountry&&(GetInput(e,e.id+".6").isHidden=!0);delete e.hideCountry,e.hideAddress2&&(GetInput(e,e.id+".2").isHidden=!0);delete e.hideAddress2,e.hideState&&(GetInput(e,e.id+".4").isHidden=!0);return delete e.hideState,e}function UpgradeConsentField(e){return"consent"!==e.type||e.choices[1]&&"0"===e.choices[1].value&&e.choices.pop(),e}function TogglePasswordVisibility(e){jQuery("#gfield_password_visibility_enabled").is(":checked")?jQuery(".gfield.field_selected .ginput_container_password span button").show():jQuery(".gfield.field_selected .ginput_container_password span button").hide()}function TogglePasswordStrength(e){jQuery("#gfield_password_strength_enabled").is(":checked")?jQuery("#gfield_min_strength_container").show():jQuery("#gfield_min_strength_container").hide()}function ToggleCategory(e){jQuery("#gfield_category_all").is(":checked")?(jQuery("#gfield_settings_category_container").hide(),SetFieldProperty("displayAllCategories",!0),SetFieldProperty("choices",new Array)):(jQuery("#gfield_settings_category_container").show(),SetFieldProperty("displayAllCategories",!1))}function SetCopyValuesOptionLabel(e){SetFieldProperty("copyValuesOptionLabel",e),jQuery(".field_selected .copy_values_option_label").html(e)}function SetCustomFieldTemplate(){var e=jQuery("#gfield_customfield_content_enabled").is(":checked");SetFieldProperty("customFieldTemplate",e?jQuery("#field_customfield_content_template").val():null),SetFieldProperty("customFieldTemplateEnabled",e)}function SetCategoryInitialItem(){var e=jQuery("#gfield_post_category_initial_item_enabled").is(":checked");SetFieldProperty("categoryInitialItem",e?jQuery("#field_post_category_initial_item").val():null),SetFieldProperty("categoryInitialItemEnabled",e)}function PopulateContentTemplate(e){if(0==jQuery("#"+e).val().length){var t=GetSelectedField();jQuery("#"+e).val("{"+t.label+":"+t.id+"}")}}function TogglePostContentTemplate(e){jQuery("#gfield_post_content_enabled").is(":checked")?(jQuery("#gfield_post_content_container").show(),e||PopulateContentTemplate("field_post_content_template")):jQuery("#gfield_post_content_container").hide()}function TogglePostTitleTemplate(e){jQuery("#gfield_post_title_enabled").is(":checked")?(jQuery("#gfield_post_title_container").show(),e||PopulateContentTemplate("field_post_title_template")):jQuery("#gfield_post_title_container").hide()}function ToggleCustomFieldTemplate(e){jQuery("#gfield_customfield_content_enabled").is(":checked")?(jQuery("#gfield_customfield_content_container").show(),e||PopulateContentTemplate("field_customfield_content_template")):jQuery("#gfield_customfield_content_container").hide()}function ToggleInputName(e){jQuery("#field_prepopulate").is(":checked")?jQuery("#field_input_name_container").show():(jQuery("#field_input_name_container").hide(),jQuery("#field_input_name").val(""))}function SetFieldColumns(){SetFieldChoices()}function ToggleChoiceValue(e){var t=GetSelectedField(),i=t.enablePrice?"_and_price":"",l=jQuery("#gfield_settings_choices_container");l.removeClass("choice_with_price choice_with_value choice_with_value_and_price"),jQuery("#field_choice_values_enabled").is(":checked")?l.addClass("choice_with_value"+i):t.enablePrice&&l.addClass("choice_with_price")}function ToggleInputChoiceValue(e,t){void 0===t&&(t=!1);var i=GetSelectedField(),l=e.find("li").data("input_id");GetInput(i,l).enableChoiceValue=t,e.removeClass("choice_with_value"),t&&e.addClass("choice_with_value")}function ToggleCopyValuesActivated(e){jQuery(".field_selected .copy_values_activated").prop("checked",e);var t=GetSelectedField();jQuery("#input_"+t.id).toggle(!e)}function TogglePageButton(e,t){var i=jQuery("#"+e+"_button_text").is(":checked");show_element=i?"#"+e+"_button_text_container":"#"+e+"_button_image_container",hide_element=i?"#"+e+"_button_image_container":"#"+e+"_button_text_container",t?(jQuery(hide_element).hide(),jQuery(show_element).show()):(jQuery(hide_element).hide(),jQuery(show_element).fadeIn(800))}function SetPageButton(e){field=GetSelectedField();var t=jQuery("#"+e+"_button_image").is(":checked")?"image":"text";"image"==(field[e+"Button"].type=t)?(field[e+"Button"].text="",field[e+"Button"].imageUrl=jQuery("#"+e+"_button_image_url").val()):(field[e+"Button"].text=jQuery("#"+e+"_button_text_input").val(),field[e+"Button"].imageUrl="")}function ToggleCustomField(e){var t=jQuery("#field_custom_existing").is(":checked");show_element=t?"#field_custom_field_name_select":"#field_custom_field_name_text",hide_element=t?"#field_custom_field_name_text":"#field_custom_field_name_select",jQuery(hide_element).hide(),jQuery(show_element).show()}function ToggleInputMask(e){jQuery("#field_input_mask").is(":checked")?(jQuery("#gform_input_mask").show(),jQuery(".maxlen_setting").hide(),SetFieldProperty("inputMask",!0),jQuery("#field_maxlen").val(""),SetFieldProperty("maxLength","")):(jQuery("#gform_input_mask").hide(),jQuery(".maxlen_setting").show(),SetFieldProperty("inputMask",!1),SetFieldProperty("inputMaskValue",""),SetFieldProperty("inputMaskIsCustom",!1))}function ToggleInputMaskOptions(e){var t=jQuery("#field_mask_standard").is(":checked"),i=t?"#field_mask_select":"#field_mask_text, .mask_text_description";jQuery(t?"#field_mask_text, .mask_text_description":"#field_mask_select").val("").hide(),jQuery(i).show(),e||(SetFieldProperty("inputMaskValue",""),SetFieldProperty("inputMaskIsCustom",!t))}function ToggleAutoresponder(){jQuery("#form_autoresponder_enabled").is(":checked")?jQuery("#form_autoresponder_container").show("slow"):jQuery("#form_autoresponder_container").hide("slow")}function ToggleMultiFile(e){if(jQuery("#field_multiple_files").prop("checked")){jQuery("#gform_multiple_files_options").show();var t=jQuery(".gform_fileupload_multifile").data("settings");t&&void 0!==t.chunk_size&&jQuery("#gform_server_max_file_size_notice").hide(),SetFieldProperty("multipleFiles",!0)}else jQuery("#gform_multiple_files_options").hide(),SetFieldProperty("multipleFiles",!1),jQuery("#field_max_files").val(""),SetFieldProperty("maxFiles","");if(!e){var i=GetSelectedField();StartChangeInputType("fileupload",i)}}function SetAutocompleteProperty(e,t){SetFieldProperty("enableAutocomplete",t),ToggleAutocompleteAttribute(e)}function ToggleAutocompleteAttribute(e){jQuery("#field_enable_autocomplete").is(":checked")?jQuery("#autocomplete_attribute_container").show():jQuery("#autocomplete_attribute_container").hide()}function InitAutocompleteOptions(e){jQuery("#field_enable_autocomplete").prop("checked",!!field.enableAutocomplete),ToggleAutocompleteAttribute(!0)}function HasPostContentField(){for(var e=0;e<form.fields.length;e++){if("post_content"==form.fields[e].type)return!0}return!1}function HasPostTitleField(){for(var e=0;e<form.fields.length;e++){if("post_title"==form.fields[e].type)return!0}return!1}function HasCustomField(){for(var e=0;e<form.fields.length;e++){if("post_custom_field"==form.fields[e].type)return!0}return!1}function HasPageBreak(){for(var e=0;e<form.fields.length;e++){if("page"==form.fields[e].type)return!0}return!1}function SetNextButtonConditionalLogic(e){GetSelectedField().nextButton.conditionalLogic=e?new ConditionalLogic:null}function UpdateFormObject(){if(form.postContentTemplateEnabled=!1,form.postTitleTemplateEnabled=!1,form.postTitleTemplate="",form.postContentTemplate="",HasPostField()&&(form.postAuthor=jQuery("#field_post_author").val()?jQuery("#field_post_author").val():"",form.useCurrentUserAsAuthor=jQuery("#gfield_current_user_as_author").is(":checked"),form.postCategory=jQuery("#field_post_category").val(),form.postFormat=0!=jQuery("#field_post_format").length?jQuery("#field_post_format").val():0,form.postStatus=jQuery("#field_post_status").val()),jQuery("#gfield_post_content_enabled").is(":checked")&&HasPostContentField()&&(form.postContentTemplateEnabled=!0,form.postContentTemplate=jQuery("#field_post_content_template").val()),jQuery("#gfield_post_title_enabled").is(":checked")&&HasPostTitleField()&&(form.postTitleTemplateEnabled=!0,form.postTitleTemplate=jQuery("#field_post_title_template").val()),jQuery("#gform_last_page_settings").is(":visible")?(form.lastPageButton=new Button,form.lastPageButton.type=jQuery("#last_page_button_text").is(":checked")?"text":"image","image"==form.lastPageButton.type?(form.lastPageButton.text="",form.lastPageButton.imageUrl=jQuery("#last_page_button_image_url").val()):(form.lastPageButton.text=jQuery("#last_page_button_text_input").val(),form.lastPageButton.imageUrl="")):form.lastPageButton=null,jQuery("#gform_pagination").is(":visible")){form.pagination=new Object;var e=jQuery('input[name="pagination_type"]:checked').val();form.pagination.type=e;var t=jQuery(".gform_page_names input");form.pagination.pages=new Array;for(var i=0;i<t.length;i++)form.pagination.pages.push(jQuery(t[i]).val());"percentage"==e?(form.pagination.style=jQuery("#percentage_style").val(),form.pagination.backgroundColor="custom"==form.pagination.style?jQuery("#percentage_style_custom_bgcolor").val():null,form.pagination.color="custom"==form.pagination.style?jQuery("#percentage_style_custom_color").val():null,form.pagination.display_progressbar_on_confirmation=jQuery("#percentage_confirmation_display").is(":checked"),form.pagination.progressbar_completion_text=jQuery("#percentage_confirmation_display").is(":checked")?jQuery("#percentage_confirmation_page_name").val():null):(form.pagination.backgroundColor=null,form.pagination.color=null,form.pagination.display_progressbar_on_confirmation=null,form.pagination.progressbar_completion_text=null),form.firstPageCssClass=jQuery("#first_page_css_class").val()}else form.pagination=null,form.firstPageCssClass=null;SortFields(),window.gform_before_update&&(form=window.gform_before_update(form),window.console&&console.log('"gform_before_update" is deprecated since version 1.7! Use the "gform_pre_form_editor_save" filter instead.')),form=gform.applyFilters("gform_pre_form_editor_save",form)}function SortFields(){var e=new Array;jQuery(".gfield:not(.spacer)").each(function(){id=this.id.substr(6),e.push(GetFieldById(id))}),form.fields=e}function EditField(e){if(event.stopPropagation(),27!==event.keyCode){FieldClick(gform.tools.getClosest(e,".gfield"));var t=gform.tools.getNodes(".sidebar__panel--settings",!1,document,!0)[0],i=gform.tools.getFocusable(t);i[0]&&setTimeout(function(){i[0].focus()},50)}}function DeleteField(e){event.stopPropagation();var t=jQuery(e)[0].id.split("_")[2];if((HasConditionalLogicDependency(t)||confirm(gf_vars.confirmationDeleteField))&&(!HasConditionalLogicDependency(t)||confirm(gf_vars.conditionalLogicDependency))){form.deletedFields||(form.deletedFields=[]),form.deletedFields.push(t);for(var i=0;i<form.fields.length;i++)if(form.fields[i].id==t){form.fields.splice(i,1),jQuery("#field_"+t).fadeOut("slow",function(){jQuery("#field_"+t).remove(),0===form.fields.length&&jQuery("#no-fields").show(),gform.doAction("gform_after_field_removed",form,t)}),HideSettings("field_settings");break}jQuery(".sidebar").tabs("option","active",0),TogglePageBreakSettings(),jQuery(document).trigger("gform_field_deleted",[form,t])}}function HasConditionalLogicDependencyLegwork(e,t){if(form.button&&ObjectHasConditionalLogicDependency(form.button,e,t))return!0;for(i in form.confirmations)if(form.confirmations.hasOwnProperty(i)&&ObjectHasConditionalLogicDependency(form.confirmations[i],e,t))return!0;for(i in form.notifications)if(form.notifications.hasOwnProperty(i)&&ObjectHasConditionalLogicDependency(form.notifications[i],e,t))return!0;for(i in form.fields)if(form.fields.hasOwnProperty(i)){var l=form.fields[i];if(ObjectHasConditionalLogicDependency(l,e,t))return!0;if("page"==GetInputType(l)&&ObjectHasConditionalLogicDependency(l.nextButton,e,t))return!0}return!1}function HasConditionalLogicDependency(e,t){var i=HasConditionalLogicDependencyLegwork(e,t);return gform.applyFilters("gform_has_conditional_logic_dependency",i,e,t)}function ObjectHasConditionalLogicDependency(e,t,l){if(!e.conditionalLogic)return!1;if(void 0===l)l=!1;var d=e.conditionalLogic.rules;for(i in d)if(d.hasOwnProperty(i)){var a=d[i];if(a.fieldId==t&&(!1===l||a.value==l)){if(!l&&!a.value){var r=GetFieldById(t);if(r&&r.choices&&r.placeholder)continue}return!0}}return!1}function HasDependentRule(e,t,l){for(i in void 0===l&&(l=!1),e)if(e.hasOwnProperty(i)){var d=e[i];if(d.fieldId==t&&(!1===l||d.value==l))return!0}return!1}function CheckChoiceConditionalLogicDependency(e){var t=GetSelectedField(),i=jQuery(e).data("previousValue");if(null==i&&(i=""),HasConditionalLogicDependency(t.id,i)){if(confirm(gf_vars.conditionalLogicDependencyChoiceEdit))return;jQuery(e).val(i).trigger("keyup"),jQuery(e).data("previousValue",i)}}function StartDuplicateField(e){var t=jQuery(e)[0].id.split("_")[2];for(fieldIndex in gform.doAction("gform_before_field_duplicated",t),form.fields)if(form.fields.hasOwnProperty(fieldIndex)&&form.fields[fieldIndex].id==t){var i=Copy(form.fields[fieldIndex]);if(i.id=GetNextFieldId(),null!=i.inputs)for(inputIndex in i.inputs)if(i.inputs.hasOwnProperty(inputIndex)){var l=i.inputs[inputIndex].id+"",d=l==t?i.id:l.replace(/(\d+\.)/,i.id+".");i.inputs[inputIndex].id=d}return i=gform.applyFilters("gform_duplicate_field",i,form),i=gform.applyFilters("gform_duplicate_field_{0}".format(GetInputType(i)),i,form),form.fields.splice(fieldIndex,0,i),void DuplicateField(i,t)}}function EndDuplicateField(e,t,i){gform.doAction("gform_field_duplicated",form,e,jQuery(t),i)}function GetFieldsByType(e){for(var t=new Array,i=0;i<form.fields.length;i++)0<=IndexOf(e,form.fields[i].type)&&t.push(form.fields[i]);return t}function GetNextFieldId(){var e;if(void 0===form.nextFieldId){for(var t=0,i=0;i<form.fields.length;i++)parseFloat(form.fields[i].id)>t&&(t=parseFloat(form.fields[i].id));if(form.deletedFields)for(i=0;i<form.deletedFields.length;i++)parseFloat(form.deletedFields[i])>t&&(t=parseFloat(form.deletedFields[i]));e=parseFloat(t)+1}else e=parseInt(form.nextFieldId);return form.nextFieldId=e+1,e}function GetFirstField(){var e=0;if(e<form.fields.length)return form.fields[e].id}function EndAddField(e,t,i){gf_vars.currentlyAddingField=!1,jQuery("#no-fields").hide(),jQuery("#gform_adding_field_spinner").remove(),void 0!==i?(form.fields.splice(i,0,e),0===i?jQuery("#gform_fields").prepend(t):jQuery("#gform_fields").children().eq(i-1).after(t)):(jQuery("#gform_fields").append(t),form.fields.push(e));var l=jQuery("#field_"+e.id);l.animate({backgroundColor:"#FFFBCC"},"fast",function(){jQuery(this).animate({backgroundColor:"#FFF"},"fast",function(){jQuery(this).css("background-color","")})}),jQuery(".selectable").removeClass("field_selected"),HideSettings("field_settings"),HideSettings("form_settings"),HideSettings("last_page_settings"),l.addClass("field_selected"),SetFieldSize(e.size),SetFieldEnhancedUI(e.enableEnhancedUI),TogglePageBreakSettings(),InitializeFields(),l.removeClass("field_selected"),jQuery(document).trigger("gform_field_added",[form,e])}function StartChangeNameFormat(e){field=GetSelectedField(),UpgradeNameField(field,!1,!0,!1)}function StartChangeCaptchaType(e){field=GetSelectedField(),SetFieldProperty("captchaType",field.captchaType=e),StartChangeInputType(field.type,field),ResetRecaptcha()}function ResetRecaptcha(){field=GetSelectedField(),field.captchaLanguage="en",field.captchaTheme="light"}function StartChangeProductType(e){return field=GetSelectedField(),"radio"===e||"select"===e?field.enablePrice=!0:(field.enablePrice=null,field.choices=null),"calculation"!==e&&(field.enableCalculation=!1,field.calculationFormula=""),StartChangeInputType(e,field)}function StartChangeDonationType(e){return field=GetSelectedField(),field.enablePrice="donation"!=e||null,StartChangeInputType(e,field)}function StartChangeShippingType(e){return field=GetSelectedField(),"singleshipping"!==e?field.enablePrice=!0:(field.enablePrice=null,field.choices=null),StartChangeInputType(e,field)}function StartChangePostCategoryType(e){return"dropdown"==e?jQuery(".post_category_initial_item_setting").hide():jQuery(".post_category_initial_item_setting").show(),field=GetSelectedField(),StartChangeInputType(e,field)}function StartChangePostCustomFieldType(e){return-1===jQuery.inArray(e,["radio","select","checkbox","multiselect"])&&(field.choices=null),StartChangeInputType(e,field)}function EndChangeInputType(e){var t=e.id,i=e.type,l=e.fieldString;jQuery("#field_"+t).html(l);var d=GetFieldById(t);d.inputType=d.type!=i?i:"",SetDefaultValues(d),SetFieldLabel(d.label),SetAriaLabel(d.label),SetFieldSize(d.size),SetFieldDefaultValue(d.defaultValue),SetFieldDescription(d.description),SetFieldCheckboxLabel(d.checkboxLabel),SetFieldRequired(d.isRequired),InitializeFields(),jQuery(".field_settings").css("opacity","1"),ShowSettings(d)}function InitializeFields(){jQuery(".selectable").hover(function(){jQuery(this).addClass("field_hover")},function(){jQuery(this).removeClass("field_hover")}).focus(function(){jQuery(this).hasClass("field_selected")||(jQuery(".field_hover").removeClass("field_hover"),jQuery(".field_selected").removeClass("field_selected"),jQuery(this).addClass("field_hover"),jQuery(this).addClass("field_selected"))}).on("keypress",this,function(e){13==e.which&&jQuery("#general_tab_toggle").focus()}),jQuery(".field_delete_icon, .field_duplicate_icon").click(function(e){e.stopPropagation()}),jQuery(".field_settings, #form_settings, #last_page_settings, #pagination_settings, .form_delete_icon, .all-merge-tags").click(function(e){gform.doAction("formEditorNullClick",e),e.stopPropagation()})}function FieldClick(e){if(gforms_dragging!=e.id){jQuery("input#gform_force_focus").focus(),jQuery(".selectable").removeClass("field_selected"),jQuery(e).removeClass("field_hover").addClass("field_selected");var t=jQuery("#field_settings_container");if(t.length){var i=jQuery(e).data("field-class"),l=t.data("active-field-class");t.removeClass(l),t.data("active-field-class",i),t.addClass(i)}ShowSettings(e)}else gforms_dragging=0}function ShowSettings(e){if("gform_last_page_settings"===e.id){jQuery(".field_setting").hide(),jQuery(".pagination_setting").hide(),jQuery(".last_pagination_setting").show();var t=jQuery("#gform_last_page_settings").data("title"),i=jQuery("#gform_last_page_settings").data("description"),l="button-icon dashicons-media-text"}else if("gform_pagination"===e.id){fieldObject="undefined"!=typeof fieldObject?fieldObject:GetFirstField(),jQuery(".field_setting").hide(),jQuery(".last_pagination_setting").hide(),jQuery(".pagination_setting").show(),jQuery("#gfield_post_category_initial_item_container").hide(),jQuery("#gfield_min_strength_container").hide(),InitPaginationOptions();t=jQuery("#gform_pagination").data("title"),i=jQuery("#gform_pagination").data("description"),l="button-icon dashicons-media-text"}else{jQuery(".pagination_setting").hide(),jQuery(".last_pagination_setting").hide(),LoadFieldSettings(),fieldObject=GetSelectedField();var d=jQuery("#add_fields button[data-type="+fieldObject.type+"]"),a=(t=d.find(".button-text").text(),i=d.data("description"),d.find(".button-icon")),r=a.find("img");l=a.children().attr("class")}jQuery("#nothing_selected").hide(),jQuery("#sidebar_field_label").text(t).attr("data-fieldId-label",gf_vars.idString).attr("data-fieldId",fieldObject.id),jQuery("#sidebar_field_text").text(i),jQuery(" #sidebar_field_icon").attr("class",""),jQuery(" #sidebar_field_icon img").remove(),r&&r.length?jQuery("#sidebar_field_icon").append('<img src="'+r.attr("src")+'" />'):jQuery("#sidebar_field_icon").addClass(l),jQuery(".panel-block-tabs__body--settings").each(function(e,t){var i=jQuery(t).attr("id");0===jQuery("#"+i+" > li").filter(function(){return"none"!==jQuery(this).css("display")}).length?(jQuery("#"+i+"_toggle").hide(),jQuery("#"+i).hide()):jQuery("#"+i+"_toggle").show()}),jQuery("#sidebar_field_info").removeClass("panel-block--hidden"),jQuery("#sidebar_field_info").addClass("panel-block--flex"),jQuery(".field_settings").show(),jQuery(".sidebar").tabs("option","active",1)}function TogglePercentageStyle(e){"custom"==jQuery("#percentage_style").val()?jQuery(".percentage_custom_container").show():jQuery(".percentage_custom_container").hide()}function TogglePercentageConfirmationText(e){jQuery("#percentage_confirmation_display").is(":checked")?jQuery(".percentage_confirmation_page_name_setting").show():jQuery(".percentage_confirmation_page_name_setting").hide()}function CustomFieldExists(e){if(!e)return!0;for(var t=jQuery("#field_custom_field_name_select option"),i=0;i<t.length;i++)if(t[i].value==e)return!0;return!1}function IsStandardMask(e){if(!e)return!0;for(var t=jQuery("#field_mask_select option"),i=0;i<t.length;i++)if(t[i].value==e)return!0;return!1}function LoadFieldChoices(e){jQuery("#field_choice_values_enabled").prop("checked",!!e.enableChoiceValue),ToggleChoiceValue();var t="list"==GetInputType(e)?"field_columns":"field_choices";jQuery("#"+t).html(GetFieldChoices(e)),LoadBulkChoices(e),jQuery(document).trigger("gform_load_field_choices",[e]),gform.doAction("gform_load_field_choices",[e])}function LoadInputChoices(e,t){var i=e.parent();i.find(".field_input_choice_values_enabled").prop("checked",!!t.enableChoiceValue),ToggleInputChoiceValue(i,t.enableChoiceValue),jQuery(e).html(GetInputChoices(t))}function LoadBulkChoices(e){if(LoadCustomChoices(),e.choices){for(var t,i=new Array,l=0;l<e.choices.length;l++)t=e.choices[l].text==e.choices[l].value?e.choices[l].text:e.choices[l].text+"|"+e.choices[l].value,e.enablePrice&&""!=e.choices[l].price&&(t+="|:"+e.choices[l].price),t=gform.applyFilters("gform_load_bulk_choices_choice",t,e.choices[l],e),i.push(t);i=gform.applyFilters("gform_choices_post_bulk_load",i,e.choices),jQuery("#gfield_bulk_add_input").val(i.join("\n"))}}function DisplayCustomMessage(e){jQuery("#bulk_custom_message").html(e).slideDown(),setTimeout(function(){jQuery("#bulk_custom_message").slideUp()},2e3)}function LoadCustomChoices(){if(jQuery(".choice_section_header, .bulk_custom_choice").remove(),!IsEmpty(gform_custom_choices)){var e="<li class='choice_section_header'>"+gf_vars.customChoices+"</li>";for(key in gform_custom_choices)if(gform_custom_choices.hasOwnProperty(key)){var t='SelectCustomChoice( jQuery(this).data("key") );';e+="<li class='bulk_custom_choice'><a href='javascript:void(0);' data-key='"+escapeAttr(key)+"' onclick='"+t+"' onkeypress='"+t+"' class='bulk-choice bulk_custom_choice'>"+escapeHtml(key)+"</a></li>"}e+="<li class='choice_section_header'>"+gf_vars.predefinedChoices+"</li>",jQuery("#bulk_items").prepend(e)}}function SelectCustomChoice(e){jQuery("#gfield_bulk_add_input").val(gform_custom_choices[e].join("\n")),gform_selected_custom_choice=e,InitBulkCustomPanel()}function SelectPredefinedChoice(e){jQuery("#gfield_bulk_add_input").val(gform_predefined_choices[e].join("\n")),gform_selected_custom_choice="",InitBulkCustomPanel()}function InsertBulkChoices(e){field=GetSelectedField(),field.choices=new Array;for(var t=!1,i=0;i<e.length;i++){if(text_price=e[i].split("|:"),text_value=text_price[0],price="",1<text_price.length){var l=GetCurrentCurrency();price=l.toMoney(text_price[1])}text_value=text_value.split("|"),1<text_value.length&&(t=!0),choice=new Choice(jQuery.trim(text_value[0]),jQuery.trim(text_value[text_value.length-1]),jQuery.trim(price)),choice=gform.applyFilters("gform_insert_bulk_choices_choice",choice,e[i],field),field.choices.push(choice)}gform.doAction("gform_bulk_insert_choices",field),t&&(field.enableChoiceValue=!0,jQuery("#field_choice_values_enabled").prop("checked",!0),ToggleChoiceValue()),LoadFieldChoices(field),UpdateFieldChoices(GetInputType(field))}function InitBulkCustomPanel(){(0==gform_selected_custom_choice.length?CloseCustomChoicesPanel:LoadCustomChoicesPanel)()}function LoadCustomChoicesPanel(e,t){e?(jQuery("#custom_choice_name").val(""),jQuery("#bulk_save_button").html(gf_vars.save),jQuery("#bulk_cancel_link").show(),jQuery("#bulk_delete_link").hide()):(jQuery("#custom_choice_name").val(gform_selected_custom_choice),jQuery("#bulk_save_button").html(gf_vars.update),jQuery("#bulk_cancel_link").hide(),jQuery("#bulk_delete_link").show()),jQuery("#bulk_save_as").hide(),jQuery("#bulk_custom_edit").show()}function CloseCustomChoicesPanel(){jQuery("#bulk_save_as").show(),jQuery("#bulk_custom_edit").hide()}function IsEmpty(e){var t;for(t in e)if(e.hasOwnProperty(t))return!1;return!0}function SetFieldChoice(e,t){var i=jQuery("#"+e+"_choice_text_"+t).val(),l=jQuery("#"+e+"_choice_value_"+t).val(),d=jQuery("#"+e+"_choice_price_"+t).val();field=GetSelectedField(),field.choices[t].text=i,field.choices[t].value=field.enableChoiceValue?l:i,field.enablePrice&&(d=(d=GetCurrentCurrency().toMoney(d))||"",field.choices[t].price=d);jQuery("#field_choices :radio, #field_choices :checkbox").each(function(e){field.choices[e].isSelected=this.checked}),LoadBulkChoices(field),UpdateFieldChoices(GetInputType(field))}function SetInputChoice(e,t,i,l){var d=GetSelectedField(),a=GetInput(d,e);e=e.toString().replace(".","_"),a.choices[t].text=l,a.choices[t].value=a.enableChoiceValue?i:l,jQuery(".field-input-choice-"+e+":radio, .field-input-choice-"+e+":checkbox").each(function(e){a.choices[e].isSelected=this.checked}),UpdateInputChoices(a)}function UpdateFieldChoices(e){var t,i="",l="1"===gf_legacy.is_legacy?"li":"div";"checkbox"==e&&(field.inputs=new Array);var d=0;switch("multiselect"===e&&(e="select"),e){case"select":for(var a=0;a<field.choices.length;a++){selected=field.choices[a].isSelected?"selected='selected'":"",i+="<option value='"+(field.choices[a].value?field.choices[a].value:field.choices[a].text).replace(/'/g,"'")+"' "+selected+">"+field.choices[a].text+"</option>"}break;case"checkbox":for(a=0;a<field.choices.length;a++){(a+1+d)%10==0&&d++;var r=field.id+"."+(a+1+d);field.inputs.push(new Input(r,field.choices[a].text)),t="gchoice g"+(o="choice_"+field.id+"_"+(a+1)),checked=field.choices[a].isSelected?"checked":"",a<5&&(i+="<"+l+" class='"+t+"'><input name='input_"+field.inputs[a].id+"' type='"+e+"' "+checked+" value='"+field.choices[a].value+"' id='"+o+"' disabled='disabled'><label for='"+o+"'>"+field.choices[a].text+"</label></"+l+">")}5<field.choices.length&&(i+="<"+l+" class='gchoice_total'>"+gf_vars.editToViewAll.replace("%d",field.choices.length)+"</"+l+">"),field.enableSelectAll&&(i+='<button type="button" id="button_'+o+'_select_all" disabled="disabled">'+gf_vars.selectAll+"</button>");break;case"radio":for(a=0;a<field.choices.length;a++){var o;t="gchoice g"+(o="choice_"+field.id+"_"+(a+1)),checked=field.choices[a].isSelected?"checked":"",a<5&&(i+="<"+l+" class='"+t+"'><input name='input_"+field.id+"' type='"+e+"' "+checked+" value='"+field.choices[a].value+"' id='"+o+"' disabled='disabled'><label for='"+o+"'>"+field.choices[a].text+"</label></"+l+">")}i+=field.enableOtherChoice?"<"+l+"><input type='"+e+"' "+checked+" id='"+o+"' disabled='disabled'><input type='text' value='"+gf_vars.otherChoiceValue+"' disabled='disabled' /></"+l+">":"",5<field.choices.length&&(i+="<"+l+" class='gchoice_total'>"+gf_vars.editToViewAll.replace("%d",field.choices.length)+"</"+l+">");break;case"list":RefreshSelectedFieldPreview()}jQuery(".field_selected "+(".gfield_"+e)).html(i)}function UpdateInputChoices(e){for(var t="",i=0;i<e.choices.length;i++){var l=e.choices[i].isSelected?"selected='selected'":"";t+="<option value='"+(e.choices[i].value?e.choices[i].value:e.choices[i].text).replace(/'/g,"'")+"' "+l+">"+e.choices[i].text+"</option>"}var d=e.id.toString().replace(".","_");jQuery(".field_selected #input_"+d).html(t)}function InsertFieldChoice(e){field=GetSelectedField();var t=GetInputType(field),i="",l="",d=field.enablePrice?"0.00":"";"list"===t&&(i=window.gf_vars.column+" "+(e+1),l=window.gf_vars.column+" "+(e+1));var a=new Choice(i,l,d);window["gform_new_choice_"+field.type]&&(a=window["gform_new_choice_"+field.type](field,a)),"object"!=typeof field.choices&&(field.choices=[]),field.choices.splice(e,0,a),LoadFieldChoices(field),UpdateFieldChoices(t)}function InsertInputChoice(e,t,i){var l=GetSelectedField(),d=GetInput(l,t),a=new Choice("","");d.choices.splice(i,0,a),LoadInputChoices(e,d),UpdateInputChoices(d)}function DeleteFieldChoice(e){field=GetSelectedField();var t=jQuery("#"+GetInputType(field)+"_choice_value_"+e).val();HasConditionalLogicDependency(field.id,t)&&!confirm(gf_vars.conditionalLogicDependencyChoice)||(field.choices.splice(e,1),LoadFieldChoices(field),UpdateFieldChoices(GetInputType(field)))}function DeleteInputChoice(e,t,i){var l=GetSelectedField(),d=GetInput(l,t);d.choices.splice(i,1),LoadInputChoices(e,d),UpdateInputChoices(d)}function MoveFieldChoice(e,t){field=GetSelectedField();var i=field.choices[e];field.choices.splice(e,1),field.choices.splice(t,0,i),LoadFieldChoices(field),UpdateFieldChoices(GetInputType(field))}function MoveInputChoice(e,t,i,l){var d=GetSelectedField(),a=GetInput(d,t),r=a.choices[i];a.choices.splice(i,1),a.choices.splice(l,0,r),LoadInputChoices(e,a),UpdateInputChoices(a)}function GetFieldType(e){return e.substr(0,e.lastIndexOf("_"))}function GetSelectedField(){var e=jQuery(".field_selected");if(e.length<=0)return!1;var t=e[0].id.substr(6);return GetFieldById(t)}function SetPasswordProperty(e){SetFieldProperty("enablePasswordInput",e)}function ToggleDateCalendar(e){var t=jQuery("#field_date_input_type").val();"datefield"==t||"datedropdown"==t?(jQuery("#date_picker_container").hide(),SetCalendarIconType("none")):jQuery("#date_picker_container").show()}function ToggleCalendarIconUrl(e){jQuery("#gsetting_icon_custom").is(":checked")?jQuery("#gfield_icon_url_container").show():(jQuery("#gfield_icon_url_container").hide(),jQuery("#gfield_calendar_icon_url").val(""),SetFieldProperty("calendarIconUrl",""))}function SetTimeFormat(e){SetFieldProperty("timeFormat",e),LoadTimeInputs()}function LoadTimeInputs(){var e=GetSelectedField();"time"!=e.type&&"time"!=e.inputType||("24"==jQuery("#field_time_format").val()?(jQuery("#input_default_value_row_input_"+e.id+"_3").hide(),jQuery(".field_selected .gfield_time_ampm").hide()):(jQuery("#input_default_value_row_input_"+e.id+"_3").show(),jQuery(".field_selected .gfield_time_ampm").show()),jQuery("#input_placeholder_row_input_"+e.id+"_3").hide(),jQuery(".field_custom_input_row_"+e.id+"_3").hide())}function SetDateFormat(e){SetFieldProperty("dateFormat",e);var t=GetSelectedField();if("datepicker"===t.dateType){var i=jQuery("#field_date_format option:selected").text();""===t.placeholder&&jQuery('.field_selected input[name="ginput_datepicker"]').attr("placeholder",i)}LoadDateInputs()}function LoadDateInputs(){var e=jQuery("#field_date_input_type").val(),t=jQuery("#field_date_format").val(),i=t?t.substr(0,3):"mdy";if("datefield"==e){switch(i){case"ymd":jQuery(".field_selected #gfield_input_date_month").remove().insertBefore(".field_selected #gfield_input_date_day"),jQuery(".field_selected #gfield_input_date_year").remove().insertBefore(".field_selected #gfield_input_date_month");break;case"mdy":jQuery(".field_selected #gfield_input_date_day").remove().insertBefore(".field_selected #gfield_input_date_year"),jQuery(".field_selected #gfield_input_date_month").remove().insertBefore(".field_selected #gfield_input_date_day");break;case"dmy":jQuery(".field_selected #gfield_input_date_month").remove().insertBefore(".field_selected #gfield_input_date_year"),jQuery(".field_selected #gfield_input_date_day").remove().insertBefore(".field_selected #gfield_input_date_month")}jQuery(".field_selected [id^='gfield_input_date']").show(),jQuery(".field_selected [id^='gfield_dropdown_date']").hide(),jQuery(".field_selected #gfield_input_datepicker").hide(),jQuery(".field_selected #gfield_input_datepicker_icon").hide()}else if("datedropdown"==e){switch(i){case"ymd":jQuery(".field_selected #gfield_dropdown_date_month").remove().insertBefore(".field_selected #gfield_dropdown_date_day"),jQuery(".field_selected #gfield_dropdown_date_year").remove().insertBefore(".field_selected #gfield_dropdown_date_month");break;case"mdy":jQuery(".field_selected #gfield_dropdown_date_day").remove().insertBefore(".field_selected #gfield_dropdown_date_year"),jQuery(".field_selected #gfield_dropdown_date_month").remove().insertBefore(".field_selected #gfield_dropdown_date_day");break;case"dmy":jQuery(".field_selected #gfield_dropdown_date_month").remove().insertBefore(".field_selected #gfield_dropdown_date_year"),jQuery(".field_selected #gfield_dropdown_date_day").remove().insertBefore(".field_selected #gfield_dropdown_date_month")}jQuery(".field_selected [id^='gfield_dropdown_date']").css("display","inline"),jQuery(".field_selected [id^='gfield_input_date']").hide(),jQuery(".field_selected #gfield_input_datepicker").hide(),jQuery(".field_selected #gfield_input_datepicker_icon").hide()}else jQuery(".field_selected [id^='gfield_input_date']").hide(),jQuery(".field_selected [id^='gfield_dropdown_date']").hide(),jQuery(".field_selected #gfield_input_datepicker").show(),jQuery("#gsetting_icon_calendar").is(":checked")?jQuery(".field_selected #gfield_input_datepicker_icon").show():jQuery(".field_selected #gfield_input_datepicker_icon").hide()}function SetCalendarIconType(e,t){field=GetSelectedField(),"date"==GetInputType(field)&&(null==e&&(e="none"),"none"==e?jQuery("#gsetting_icon_none").prop("checked",!0):"calendar"==e?jQuery("#gsetting_icon_calendar").prop("checked",!0):"custom"==e&&jQuery("#gsetting_icon_custom").prop("checked",!0),SetFieldProperty("calendarIconType",e),ToggleCalendarIconUrl(t),LoadDateInputs())}function SetDateInputType(e){field=GetSelectedField(),"date"==GetInputType(field)&&("datepicker"===e?SetFieldAccessibilityWarning("date_input_type_setting","above"):resetAllFieldAccessibilityWarnings(),field.dateType=e,field.inputs=GetDateFieldInputs(field),CreateDefaultValuesUI(field),CreatePlaceholdersUI(field),CreateInputLabelsUI(field),ToggleDateSettings(field),ResetDefaultInputValues(field),ToggleDateCalendar(),LoadDateInputs())}function SetPostImageMeta(){var e=jQuery("#gfield_display_alt").is(":checked"),t=jQuery("#gfield_display_title").is(":checked"),i=jQuery("#gfield_display_caption").is(":checked"),l=jQuery("#gfield_display_description").is(":checked"),d=e||t||i||l;SetFieldProperty("displayAlt",e),SetFieldProperty("displayTitle",t),SetFieldProperty("displayCaption",i),SetFieldProperty("displayDescription",l),jQuery(".field_selected .ginput_post_image_alt").css("display",e?"block":"none"),jQuery(".field_selected .ginput_post_image_title").css("display",t?"block":"none"),jQuery(".field_selected .ginput_post_image_caption").css("display",i?"block":"none"),jQuery(".field_selected .ginput_post_image_description").css("display",l?"block":"none"),jQuery(".field_selected .ginput_post_image_file").css("display",d?"block":"none")}function SetFeaturedImage(){if(jQuery("#gfield_featured_image").is(":checked")){for(i in form.fields)form.fields.hasOwnProperty(i)&&(form.fields[i].postFeaturedImage=!1);SetFieldProperty("postFeaturedImage",!0)}else SetFieldProperty("postFeaturedImage",!1)}function SetFieldProperty(e,t){null==t&&(t=""),GetSelectedField()[e]=t}function SetInputName(e,t){var i=GetSelectedField();if(e=e&&e.trim(),t){for(var l=0;l<i.inputs.length;l++)if(i.inputs[l].id==t)return void(i.inputs[l].name=e)}else i.inputName=e}function SetInputDefaultValue(e,t){var i,l=GetSelectedField();e=e&&e.trim();for(var d=0;d<l.inputs.length;d++)if(l.inputs[d].id==t)return l.inputs[d].defaultValue=e,void jQuery('[name="input_'+t+'"], #input_'+t.toString().replace(".","_")).each(function(){"INPUT"==this.nodeName?jQuery(this).val(e):(i=jQuery(this),e=e.toLowerCase(),i.val("").children().each(function(){if(this.value.toLowerCase()==e)return i.val(this.value),!1}))})}function SetInputPlaceholder(t,e){var i=GetSelectedField();t=t&&t.trim();for(var l=0;l<i.inputs.length;l++)if(i.inputs[l].id==e)return i.inputs[l].placeholder=t,void jQuery('[name="input_'+e+'"], #input_'+e.toString().replace(".","_")).each(function(){var e=this.nodeName;"INPUT"==e?jQuery(this).prop("placeholder",t):"SELECT"==e&&jQuery(this).find('option[value=""]').text(t)})}function ResetInputPlaceholders(e){(e=e||GetSelectedField()).inputs&&jQuery(e.inputs).each(function(){SetInputPlaceholder(void 0!==this.placeholder?this.placeholder:"",this.id)})}function SetInputAutocomplete(e,t){var i=GetSelectedField();e=e&&e.trim();for(var l=0;l<i.inputs.length;l++)if(i.inputs[l].id==t)return i.inputs[l].autocompleteAttribute=e,void jQuery('[name="input_'+t+'"], #input_'+t.toString().replace(".","_")).each(function(){i.inputs[l].autocompleteAttribute=e})}function ResetDefaultInputValues(e){(e=e||GetSelectedField()).inputs&&jQuery(e.inputs).each(function(){SetInputDefaultValue(void 0!==this.defaultValue?this.defaultValue:"",this.id)})}function SetInputCustomLabel(e,t){var i,l,d,a=GetSelectedField();e=e&&e.trim();for(var r=0;r<a.inputs.length;r++)if((d=a.inputs[r]).id==t)return l=""==e?(delete d.customLabel,void 0!==d.defaultLabel?d.defaultLabel:d.label):d.customLabel=e,i=".ginput_container label[for="+(i=(i="input_"+a.inputs[r].id).replace(".","_"))+"]",jQuery(i).text(l),void("date"!==a.type&&"time"!==a.type||jQuery(i).toggleClass("screen-reader-text",!d.hasOwnProperty("customLabel")))}function SetInputHidden(e,t){for(var i=GetSelectedField(),l=0;l<i.inputs.length;l++)if(i.inputs[l].id==t)return i.inputs[l].isHidden=e,t=t.toString().replace(".","_"),void jQuery("#input_"+t+"_container").toggle(!e)}function SetSelectedCategories(){var e=GetSelectedField();e.choices=new Array,jQuery(".gfield_category_checkbox").each(function(){this.checked&&e.choices.push(new Choice(this.name,this.value))}),e.choices.sort(function(e,t){return e.text.toLowerCase()>t.text.toLowerCase()})}function SetFieldLabel(e){var t=jQuery(".field_selected .gfield_required")[0];jQuery(".field_selected .gfield_label, .field_selected .gsection_title").text(e).append(t),SetFieldProperty("label",e)}function SetAriaLabel(e){var t=jQuery(".field_selected")[0].id.split("_")[1],i=GetFieldById(t),l=window.gf_vars.fieldLabelAriaLabel.replace("{field_label}",e).replace("{field_type}",i.type);jQuery(".field_selected .gfield-edit").attr("aria-label",l)}function SetCaptchaTheme(e,t){jQuery(".field_selected .gfield_captcha").attr("src",t),SetFieldProperty("captchaTheme",e)}function SetCaptchaSize(e){var t=jQuery("#field_captcha_type").val();SetFieldProperty("simpleCaptchaSize",e),RedrawCaptcha(),jQuery(".field_selected .gfield_captcha_input_container").removeClass(t+"_small").removeClass(t+"_medium").removeClass(t+"_large").addClass(t+"_"+e)}function SetCaptchaFontColor(e){SetFieldProperty("simpleCaptchaFontColor",e),RedrawCaptcha()}function SetCaptchaBackgroundColor(e){SetFieldProperty("simpleCaptchaBackgroundColor",e),RedrawCaptcha()}function RedrawCaptcha(){"math"==jQuery("#field_captcha_type").val()?(url_1=GetCaptchaUrl(1),url_2=GetCaptchaUrl(2),url_3=GetCaptchaUrl(3),jQuery(".field_selected .gfield_captcha:eq(0)").attr("src",url_1),jQuery(".field_selected .gfield_captcha:eq(1)").attr("src",url_2),jQuery(".field_selected .gfield_captcha:eq(2)").attr("src",url_3)):(url=GetCaptchaUrl(),jQuery(".field_selected .gfield_captcha").attr("src",url))}function SetFieldEnhancedUI(e){SetFieldProperty("enableEnhancedUI",e?1:0),e?SetFieldAccessibilityWarning("enable_enhanced_ui_setting","below"):resetAllFieldAccessibilityWarnings()}function SetFieldSize(e){jQuery(".field_selected .small, .field_selected .medium, .field_selected .large").removeClass("small").removeClass("medium").removeClass("large").addClass(e),SetFieldProperty("size",e)}function SetFieldLabelPlacement(e){var t=e||form.labelPlacement;SetFieldProperty("labelPlacement",e),jQuery(".field_selected").removeClass("top_label").removeClass("right_label").removeClass("left_label").removeClass("hidden_label").addClass(t),"left_label"==field.labelPlacement||"right_label"==field.labelPlacement||""==field.labelPlacement&&"top_label"!=form.labelPlacement?(jQuery("#field_description_placement").val(""),SetFieldProperty("descriptionPlacement",""),jQuery("#field_description_placement_container").hide("slow")):jQuery("#field_description_placement_container").show("slow"),"hidden_label"==field.labelPlacement?SetFieldAccessibilityWarning("label_placement_setting","above"):resetAllFieldAccessibilityWarnings(),SetFieldProperty("labelPlacement",e),SetFieldRequired(field.isRequired),RefreshSelectedFieldPreview()}function SetFieldDescriptionPlacement(e){var t="above"==e||""==e&&"above)"==form.descriptionPlacement;SetFieldProperty("descriptionPlacement",e),RefreshSelectedFieldPreview(function(){t?jQuery(".field_selected").addClass("description_above"):jQuery(".field_selected").removeClass("description_above")})}function SetFieldSubLabelPlacement(e){SetFieldProperty("subLabelPlacement",e),RefreshSelectedFieldPreview(function(){"above"===e?jQuery(".field_selected").addClass("field_sublabel_above").removeClass("field_sublabel_below"):jQuery(".field_selected").addClass("field_sublabel_below").removeClass("field_sublabel_above")})}function SetFieldVisibility(e,t,i){if(!i&&"administrative"==e&&HasConditionalLogicDependency(field.id)&&!confirm(gf_vars.conditionalLogicDependencyAdminOnly))return!1;for(var l=!1,d=0;d<gf_vars.visibilityOptions.length;d++)if(gf_vars.visibilityOptions[d].value==e){l=!0;break}if(l||(e="visible"),SetFieldProperty("visibility",e),t){var a=jQuery('input[name="field_visibility"]');a.prop("checked",!1),a.filter('[value="'+e+'"]').prop("checked",!0)}}function SetFieldDefaultValue(e){jQuery(".field_selected > div > input:visible, .field_selected > div > textarea:visible, .field_selected > div > select:visible").val(e),SetFieldProperty("defaultValue",e)}function SetFieldPlaceholder(l){jQuery(".field_selected > div > input:visible, .field_selected > div > textarea:visible, .field_selected > div > select:visible").each(function(){var e=this.nodeName,t=jQuery(this);if("INPUT"==e||"TEXTAREA"==e)jQuery(this).prop("placeholder",l);else if("SELECT"==e){var i=t.find('option[value=""]');0<i.length?0<l.length?i.text(l):i.remove():(t.prepend('<option value="">'+l+"</option>"),t.val(""))}}),SetFieldProperty("placeholder",l)}function SetFieldDescription(e){null==e&&(e=""),SetFieldProperty("description",e)}function SetFieldCheckboxLabel(e){null==e&&(e=""),SetFieldProperty("checkboxLabel",e)}function SetPasswordStrength(e){e?jQuery(".field_selected .gfield_password_strength").show():(jQuery(".field_selected .gfield_password_strength").hide(),jQuery("#gfield_min_strength").val(""),SetFieldProperty("minPasswordStrength","")),SetFieldProperty("passwordStrengthEnabled",e)}function ToggleEmailSettings(e){var t=void 0!==e.emailConfirmEnabled&&1==e.emailConfirmEnabled;jQuery(".placeholder_setting").toggle(!t),jQuery(".default_value_setting").toggle(!t),jQuery(".sub_label_placement_setting").toggle(t),jQuery(".sub_labels_setting").toggle(t),jQuery(".default_input_values_setting").toggle(t),jQuery(".input_placeholders_setting").toggle(t)}function SetEmailConfirmation(e){var t=GetSelectedField();e?(jQuery(".field_selected .ginput_single_email").hide(),jQuery(".field_selected .ginput_confirm_email").show()):(jQuery(".field_selected .ginput_confirm_email").hide(),jQuery(".field_selected .ginput_single_email").show()),t.emailConfirmEnabled=e,t.inputs=GetEmailFieldInputs(t),CreateDefaultValuesUI(t),CreatePlaceholdersUI(t),CreateAutocompleteUI(t),CreateCustomizeInputsUI(t),CreateInputLabelsUI(t),ToggleEmailSettings(t)}function SetCardType(e,t){var i=GetSelectedField().creditCards?GetSelectedField().creditCards:new Array;if(jQuery(e).is(":checked"))-1==jQuery.inArray(t,i)&&(jQuery(".gform_card_icon_"+t).fadeIn(),i[i.length]=t);else{var l=jQuery.inArray(t,i);-1!=l&&(jQuery(".gform_card_icon_"+t).fadeOut(),i.splice(l,1))}SetFieldProperty("creditCards",i)}function SetFieldRequired(e){var t=gform_form_strings.requiredIndicator,i=".field_selected .gfield_required",l=!1;if("consent"===field.type?(jQuery(i).remove(),e&&(l=!0)):0<jQuery(i).length?e?jQuery(i).html(t):jQuery(i).remove():e&&(l=!0),l){var d="consent"===field.type&&"hidden_label"===field.labelPlacement?".gfield_consent_label":".gfield_label";jQuery(".field_selected "+d).append('<span class="gfield_required">'+t+"</span>")}SetFieldProperty("isRequired",e)}function SetMaxLength(e){var t=GetMaxLengthPattern(),l="",d=e.value.split("");for(i in d)d.hasOwnProperty(i)&&(t.test(d[i])||(l+=d[i]));SetFieldProperty("maxLength",e.value=l)}function GetMaxLengthPattern(){return/[a-zA-Z\-!@#$%^&*();'":_+=<,>.~`?\/|\[\]\{\}\\]/}function ValidateKeyPress(e,t,i){i=void 0===i||i;var l=e.which?e.which:e.keyCode,d=t.test(String.fromCharCode(l));return!!e.ctrlKey||(i?d:!d)}function IndexOf(e,t){for(var i=0;i<e.length;i++)if(e[i]==t)return i;return-1}function ToggleCalculationOptions(e,t){e?(jQuery("#calculation_options").show(),"product"!=t.type&&jQuery("li.range_setting").hide()):(jQuery("#calculation_options").hide(),"product"!=t.type&&jQuery("li.range_setting").show(),SetFieldProperty("calculationFormula",""),SetFieldProperty("calculationRounding","")),SetFieldProperty("enableCalculation",e)}function FormulaContentCallback(){SetFieldProperty("calculationFormula",jQuery("#field_calculation_formula").val().trim())}function SetupUnsavedChangesWarning(){UpdateFormObject(),gforms_original_json=jQuery.toJSON(form),window.onbeforeunload=function(){if(UpdateFormObject(),gforms_original_json!=jQuery.toJSON(form)&&!gf_vars.isFormTrash)return"You have unsaved changes."}}function ToggleRichTextEditor(e){var t=GetSelectedField(),i=jQuery("#input_"+t.id),l=jQuery("#input_"+t.id+"_rte_preview");e?(i.hide(),l.show()):(l.hide(),i.show()),SetFieldProperty("useRichTextEditor",e)}function SetHTMLMargins(e){var t=GetSelectedField();jQuery("#field_"+t.id).toggleClass("gfield_html_formatted"),SetFieldProperty("disableMargins",e)}function iColorShow(e,t,l,d){jQuery("#iColorPicker").css({top:t-150+"px",left:e+"px",position:"absolute"}).fadeIn("fast"),jQuery("#iColorPickerBg").css({position:"absolute",top:0,left:0,width:"100%",height:"100%"}).fadeIn("fast");var a=jQuery("#"+l).val();jQuery("#colorPreview span").text(a),jQuery("#colorPreview").css("background",a),jQuery("#color").val(a);var r=jQuery("#iColorPicker");for(i=0;i<r.length;i++){var o=document.getElementById("hexSection"+i).childNodes;for(j=0;j<o.length;j++){var n=o[j].childNodes;for(k=0;k<n.length;k++)jQuery(o[j].childNodes[k]).unbind().mouseover(function(e){var t="#"+jQuery(this).attr("hx");jQuery("#colorPreview").css("background",t),jQuery("#colorPreview span").text(t)}).click(function(){var e="#"+jQuery(this).attr("hx");jQuery("#"+l).val(e),jQuery("#chip_"+l).css("background-color",e),jQuery("#iColorPickerBg").hide(),jQuery("#iColorPicker").fadeOut(),d&&window[d](e),jQuery(this)})}}}function SetColorPickerColor(e,t,i){jQuery("#chip_"+e).css("background-color",t),i&&window[i](t)}function SetFieldChoices(){for(var e=GetSelectedField(),t=0;t<e.choices.length;t++)SetFieldChoice(GetInputType(e),t)}function SetInputChoices(e){var t,i,l,d;GetSelectedField();e.find("li").each(function(e){t=jQuery(this),d=t.data("input_id"),i=t.find(".field-choice-value").val(),l=t.find(".field-choice-text").val(),SetInputChoice(d,e,i,l)})}function MergeInputArrays(e,t){for(var i,l,d=0;d<e.length;++d)i=e[d],(l=GetInput({inputs:t},i.id))&&(e[d]=jQuery.extend(i,l));return e}function FieldSearch(e){var i=jQuery(e).val().toLowerCase();""==i?(jQuery(".add-buttons button").parent().css("display","block"),ResetFieldAccordions()):ShowAllFieldAccordions(),jQuery(".add-buttons").each(function(e,t){SearchWithinFieldGroup(t,i)})}function addClearButton(e){""===jQuery(e).val()?(jQuery(".search-button").removeClass("clearable"),jQuery(".search-button span").removeClass("clear-button")):(jQuery(".search-button").addClass("clearable"),jQuery(".search-button span").addClass("clear-button"))}function clearInput(e){jQuery(e).parent().children("input").val(""),jQuery(e).removeClass("clear-button"),FieldSearch(e)}function ResetFieldAccordions(){jQuery("#add_fields_menu .panel-block-tabs__wrapper").accordion("option",{active:!1}),jQuery("#add_fields_menu .panel-block-tabs__wrapper").first().accordion("option",{active:0})}function ShowAllFieldAccordions(){jQuery("#add_fields_menu .panel-block-tabs__wrapper").accordion("option",{active:0})}function SearchWithinFieldGroup(e,i){var l=!1;jQuery(e).find("button").each(function(e,t){-1==jQuery(t).val().toLowerCase().indexOf(i)?jQuery(t).parent().css("display","none"):(jQuery(t).parent().css("display","block"),l=!0)});var t=l?"none":"block";jQuery(e).parent().find(".gf-field-group__no-results").css("display",t)}function IsValidFormula(formula){if(""==formula)return!0;for(var patt=/{([^}]+)}/i,exprPatt=/^[0-9 -/*\(\)]+$/i,expr=formula.replace(/(\r\n|\n|\r)/gm,""),match,result=!1;match=patt.exec(expr);)expr=expr.replace(match[0],1);if(exprPatt.test(expr))try{var r=eval(expr);result=!isNaN(parseFloat(r))&&isFinite(r)}catch(e){result=!1}return gform.applyFilters("gform_is_valid_formula_form_editor",result,formula)}function ResetFieldAccessibilityWarning(e){void 0!==e&&jQuery("."+e).nextAll(".gform-alert--accessibility").remove().prevAll(".gform-alert--accessibility").remove()}function resetAllFieldAccessibilityWarnings(){jQuery(".editor-sidebar").find(".gform-alert--accessibility").length&&jQuery(".editor-sidebar").find(".gform-alert--accessibility").remove()}function setFieldError(e,t,i){var l=GetSelectedField();if("page"!=l.type&&"section"!=l.type&&"html"!=l.type){var d=[e];if("label_setting"===e){var a=l.hasOwnProperty("placeholder")?l.placeholder:"",r=l.hasOwnProperty("description")?l.description:"";if(""!==a||""!==r)return SetFieldAccessibilityWarning("label_setting","below"),void resetFieldError("label_setting");ResetFieldAccessibilityWarning("label_setting")}l.hasOwnProperty("errors")&&!l.errors.includes(e)&&(d=d.concat(l.errors)),SetFieldProperty("errors",d),void 0===i&&(i=getFieldErrorMessage(e));var o='<div class="gform-alert gform-alert--error gform-alert--inline">';o+='<span class="gform-alert__icon gform-icon gform-icon--circle-close" aria-hidden="true"></span>',o+='<div class="gform-alert__message-wrap">'+i+"</div>",o+="</div>",(e=jQuery("."+e)).addClass("error"),"above"===t?(e.prevAll(".gform-alert--error").remove(),e.before(o)):(e.nextAll(".gform-alert--error").remove(),e.after(o))}}function resetFieldError(e){var t=GetSelectedField(),i=t.hasOwnProperty("errors")?t.errors:[];if(void 0!==e){jQuery("."+e).nextAll(".gform-alert--error").remove().prevAll(".gform-alert--error").remove(),jQuery("."+e).removeClass("error");var l=i.indexOf(e);-1<l&&(1<i.length?delete i[l]:i=[])}SetFieldProperty("errors",i)}function resetAllFieldErrors(){jQuery(".field_setting").hasClass("error")&&(jQuery(".editor-sidebar .gform-alert--error").remove(),jQuery(".field_setting").filter(".error").removeClass("error"),0<form.fields.length&&form.fields.forEach(function(e){e.hasOwnProperty("errors")&&0<e.errors.length&&(e.errors=[])}))}function fieldHasError(e){return void 0===e&&(e=GetSelectedField()),!!(e.hasOwnProperty("errors")&&0<e.errors.length)}jQuery(document).ready(function(){if(handleStatus(),jQuery(".search-button > input").on("keyup change click paste",function(e){FieldSearch(this),addClearButton(this)}),jQuery(".search-button > input").on("keyup paste",function(e){jQuery(".sidebar").tabs({active:0})}),jQuery(".clear-button").on("click",function(e){clearInput(this)}),jQuery(".gf-topmenu-dynamic").on("click",function(e){var t=jQuery(this).position();jQuery(".gf-popover").css("left",t.left+jQuery(this).width()/2+6+"px");var i=jQuery(".gf-popover").css("display");jQuery(".gf-popover").css("display","block"===i?"none":"block")}),jQuery(".gf-popover__button").on("click",function(){var e=jQuery(this).data("url");""!==e&&(window.location.href=e)}),jQuery(document).on("click",function(e){var t=jQuery(".gf-topmenu-dynamic");t.is(e.target)||0!==t.has(e.target).length||jQuery(".gf-popover").hide()}),jQuery(".add-buttons button").each(function(){var e=jQuery(this),t=e.data("type"),i=e.attr("onclick");void 0===t&&(-1<i.indexOf("StartAddField")&&/StartAddField\([ ]?'(.*?)[ ]?'/.test(i)&&(t=i.match(/'(.*?)'/)[1],e.data("type",t)),window.console&&console.log("Deprecated button for the "+this.value+' field. Since v1.9 the field type must be specified in the "type" data attribute.')),void 0===t||void 0!==i&&""!=i||jQuery(this).click(function(){StartAddField(t)})}),jQuery("#field_choices, #field_columns").sortable({axis:"y",handle:".field-choice-handle",update:function(e,t){MoveFieldChoice(t.item.data("index"),t.item.index())}}),jQuery(".field_input_choices").sortable({axis:"y",handle:".field-choice-handle",update:function(e,t){var i=t.item.data("index"),l=t.item.index(),d=t.item.data("input_id");MoveInputChoice(t.item.parent(),d,i,l)}}),void 0!==gf_global.view&&"settings"==gf_global.view||InitializeForm(form),jQuery(document).trigger("gform_load_form_settings",[form]),SetupUnsavedChangesWarning(),window.console){var e=jQuery(document)[0],t=jQuery.hasData(e)&&jQuery._data(e);if(t){var i=new Array("gform_load_form_settings");for(var l in t.events)-1!==jQuery.inArray(l,i)&&console.log('Gravity Forms API warning: The jQuery event "'+l+'" is deprecated on this page since version 1.7')}}jQuery(document).on("focus","#field_choices input.field-choice-text, #field_choices input.field-choice-value",function(){jQuery(this).data("previousValue",jQuery(this).val())}),InitializeFieldSettings(),jQuery(".sidebar").tabs({activate:function(e,t){t.newPanel.css("display","flex")}}),jQuery("#field_settings").tabs(),jQuery(".field_settings").accordion(gform.options.jqEditorAccordions),jQuery("#add_fields_menu .panel-block-tabs__wrapper").accordion(gform.options.jqEditorAccordions),jQuery(".panel-block-tabs").find(".panel-block-tabs__toggle").each(function(e,t){jQuery(t).append("<i></i>")}),ResetFieldAccordions(),jQuery(".panel-block.field_settings").on("keydown",function(e){if(27!==e.keyCode){if(9===e.keyCode){var t=gform.tools.getFocusable(this),i=t[0],l=t[t.length-1];e.shiftKey?document.activeElement===i&&(l.focus(),e.preventDefault()):document.activeElement===l&&(i.focus(),e.preventDefault())}}else jQuery(".gfield.field_selected .gfield-edit").focus()})}),this.iColorPicker=function(){jQuery("input.iColorPicker").each(function(e){0==e&&(jQuery(document.createElement("div")).attr("id","iColorPicker").css("display","none").html('<table class="pickerTable" id="pickerTable0"><thead id="hexSection0"><tr><td style="background:#f00;" hx="f00"></td><td style="background:#ff0" hx="ff0"></td><td style="background:#0f0" hx="0f0"></td><td style="background:#0ff" hx="0ff"></td><td style="background:#00f" hx="00f"></td><td style="background:#f0f" hx="f0f"></td><td style="background:#fff" hx="fff"></td><td style="background:#ebebeb" hx="ebebeb"></td><td style="background:#e1e1e1" hx="e1e1e1"></td><td style="background:#d7d7d7" hx="d7d7d7"></td><td style="background:#cccccc" hx="cccccc"></td><td style="background:#c2c2c2" hx="c2c2c2"></td><td style="background:#b7b7b7" hx="b7b7b7"></td><td style="background:#acacac" hx="acacac"></td><td style="background:#a0a0a0" hx="a0a0a0"></td><td style="background:#959595" hx="959595"></td></tr><tr><td style="background:#ee1d24" hx="ee1d24"></td><td style="background:#fff100" hx="fff100"></td><td style="background:#00a650" hx="00a650"></td><td style="background:#00aeef" hx="00aeef"></td><td style="background:#2f3192" hx="2f3192"></td><td style="background:#ed008c" hx="ed008c"></td><td style="background:#898989" hx="898989"></td><td style="background:#7d7d7d" hx="7d7d7d"></td><td style="background:#707070" hx="707070"></td><td style="background:#626262" hx="626262"></td><td style="background:#555" hx="555"></td><td style="background:#464646" hx="464646"></td><td style="background:#363636" hx="363636"></td><td style="background:#262626" hx="262626"></td><td style="background:#111" hx="111"></td><td style="background:#000" hx="000"></td></tr><tr><td style="background:#f7977a" hx="f7977a"></td><td style="background:#fbad82" hx="fbad82"></td><td style="background:#fdc68c" hx="fdc68c"></td><td style="background:#fff799" hx="fff799"></td><td style="background:#c6df9c" hx="c6df9c"></td><td style="background:#a4d49d" hx="a4d49d"></td><td style="background:#81ca9d" hx="81ca9d"></td><td style="background:#7bcdc9" hx="7bcdc9"></td><td style="background:#6ccff7" hx="6ccff7"></td><td style="background:#7ca6d8" hx="7ca6d8"></td><td style="background:#8293ca" hx="8293ca"></td><td style="background:#8881be" hx="8881be"></td><td style="background:#a286bd" hx="a286bd"></td><td style="background:#bc8cbf" hx="bc8cbf"></td><td style="background:#f49bc1" hx="f49bc1"></td><td style="background:#f5999d" hx="f5999d"></td></tr><tr><td style="background:#f16c4d" hx="f16c4d"></td><td style="background:#f68e54" hx="f68e54"></td><td style="background:#fbaf5a" hx="fbaf5a"></td><td style="background:#fff467" hx="fff467"></td><td style="background:#acd372" hx="acd372"></td><td style="background:#7dc473" hx="7dc473"></td><td style="background:#39b778" hx="39b778"></td><td style="background:#16bcb4" hx="16bcb4"></td><td style="background:#00bff3" hx="00bff3"></td><td style="background:#438ccb" hx="438ccb"></td><td style="background:#5573b7" hx="5573b7"></td><td style="background:#5e5ca7" hx="5e5ca7"></td><td style="background:#855fa8" hx="855fa8"></td><td style="background:#a763a9" hx="a763a9"></td><td style="background:#ef6ea8" hx="ef6ea8"></td><td style="background:#f16d7e" hx="f16d7e"></td></tr><tr><td style="background:#ee1d24" hx="ee1d24"></td><td style="background:#f16522" hx="f16522"></td><td style="background:#f7941d" hx="f7941d"></td><td style="background:#fff100" hx="fff100"></td><td style="background:#8fc63d" hx="8fc63d"></td><td style="background:#37b44a" hx="37b44a"></td><td style="background:#00a650" hx="00a650"></td><td style="background:#00a99e" hx="00a99e"></td><td style="background:#00aeef" hx="00aeef"></td><td style="background:#0072bc" hx="0072bc"></td><td style="background:#0054a5" hx="0054a5"></td><td style="background:#2f3192" hx="2f3192"></td><td style="background:#652c91" hx="652c91"></td><td style="background:#91278f" hx="91278f"></td><td style="background:#ed008c" hx="ed008c"></td><td style="background:#ee105a" hx="ee105a"></td></tr><tr><td style="background:#9d0a0f" hx="9d0a0f"></td><td style="background:#a1410d" hx="a1410d"></td><td style="background:#a36209" hx="a36209"></td><td style="background:#aba000" hx="aba000"></td><td style="background:#588528" hx="588528"></td><td style="background:#197b30" hx="197b30"></td><td style="background:#007236" hx="007236"></td><td style="background:#00736a" hx="00736a"></td><td style="background:#0076a4" hx="0076a4"></td><td style="background:#004a80" hx="004a80"></td><td style="background:#003370" hx="003370"></td><td style="background:#1d1363" hx="1d1363"></td><td style="background:#450e61" hx="450e61"></td><td style="background:#62055f" hx="62055f"></td><td style="background:#9e005c" hx="9e005c"></td><td style="background:#9d0039" hx="9d0039"></td></tr><tr><td style="background:#790000" hx="790000"></td><td style="background:#7b3000" hx="7b3000"></td><td style="background:#7c4900" hx="7c4900"></td><td style="background:#827a00" hx="827a00"></td><td style="background:#3e6617" hx="3e6617"></td><td style="background:#045f20" hx="045f20"></td><td style="background:#005824" hx="005824"></td><td style="background:#005951" hx="005951"></td><td style="background:#005b7e" hx="005b7e"></td><td style="background:#003562" hx="003562"></td><td style="background:#002056" hx="002056"></td><td style="background:#0c004b" hx="0c004b"></td><td style="background:#30004a" hx="30004a"></td><td style="background:#4b0048" hx="4b0048"></td><td style="background:#7a0045" hx="7a0045"></td><td style="background:#7a0026" hx="7a0026"></td></tr></thead><tbody><tr><td style="border:1px solid #000;background:#fff;cursor:pointer;height:60px;-moz-background-clip:-moz-initial;-moz-background-origin:-moz-initial;-moz-background-inline-policy:-moz-initial;" colspan="16" align="center" id="colorPreview"><span style="color:#000;border:1px solid rgb(0, 0, 0);padding:5px;background-color:#fff;font:11px Arial, Helvetica, sans-serif;"></span></td></tr></tbody></table><style>#iColorPicker input{margin:2px}</style>').appendTo("body"),jQuery(document.createElement("div")).attr("id","iColorPickerBg").click(function(){jQuery("#iColorPickerBg").hide(),jQuery("#iColorPicker").fadeOut()}).appendTo("body"),jQuery("table.pickerTable td").css({width:"12px",height:"14px",border:"1px solid #000",cursor:"pointer"}),jQuery("#iColorPicker table.pickerTable").css({"border-collapse":"collapse"}),jQuery("#iColorPicker").css({border:"1px solid #ccc",background:"#333",padding:"5px",color:"#fff","z-index":9999})),jQuery("#colorPreview").css({height:"50px"})})},jQuery(function(){iColorPicker()}),jQuery(document).mouseup(function(e){var t=jQuery("#iColorPicker");t.is(e.target)||0!==t.has(e.target).length||(jQuery("#iColorPickerBg").hide(),jQuery("#iColorPicker").fadeOut())}),jQuery.fn.gfSlide=function(e){var t=jQuery(".field_settings").is(":visible");return"up"==e?t?this.slideUp():this.hide():t?this.slideDown():this.show(),this},gform.addFilter("gform_is_conditional_logic_field",function(e,t){return"administrative"!=t.visibility&&t.id!=GetSelectedField().id||(e=!1),e});