Formidable Forms – Form Builder for WordPress - Version 2.02.04

Version Description

  • Add field description margin option
  • Fixes for submitting forms in <IE10
  • Pro Features *
  • Prevent star styling conflict with some themes
  • Fix conditional logic dependent on numeric checkboxes
  • Allow arrays in Lookup checkbox field default value
  • Make sure Lookup fields load correctly with ajax in repeating section on form builder
  • Fix field errors showing on dependent Dynamic fields
  • Only validate on change when js validation is on
  • Make sure address field errors show up correctly
  • Include confirmation field classes for old HTML
  • Make repeating fields work with frm_date_field_js hook
  • Don't show long decimal for allowed file size
  • Fix conditional logic with ampersands
  • Fix left label with autocomplete dropdown
  • Don't allow switching between sections and HTML field types
  • Fix JS error when multi-select logic field has no options selected
  • Make sure WP errors are returned correctly in file upload field
  • Allow use of show_image, add_link, and show_filename with frm-field-value
  • Don't show date pop-up for read-only date field
  • Fix ordering by number fields mapped to a custom field
Download this release

Release Info

Developer sswells
Plugin Icon 128x128 Formidable Forms – Form Builder for WordPress
Version 2.02.04
Comparing to
See all releases

Code changes from version 2.02.03 to 2.02.04

classes/controllers/FrmFormsController.php CHANGED
@@ -612,7 +612,8 @@ class FrmFormsController {
612
 
613
  unset($end_section_values, $last_order, $open, $reset_fields);
614
 
615
- $values = FrmAppHelper::setup_edit_vars($form, 'forms', $fields, true);
 
616
 
617
  $edit_message = __( 'Form was Successfully Updated', 'formidable' );
618
  if ( $form->is_template && $message == $edit_message ) {
612
 
613
  unset($end_section_values, $last_order, $open, $reset_fields);
614
 
615
+ $args = array( 'parent_form_id' => $form->id );
616
+ $values = FrmAppHelper::setup_edit_vars( $form, 'forms', $fields, true, array(), $args );
617
 
618
  $edit_message = __( 'Form was Successfully Updated', 'formidable' );
619
  if ( $form->is_template && $message == $edit_message ) {
classes/helpers/FrmAppHelper.php CHANGED
@@ -10,7 +10,7 @@ class FrmAppHelper {
10
  /**
11
  * @since 2.0
12
  */
13
- public static $plug_version = '2.02.03';
14
 
15
  /**
16
  * @since 1.07.02
@@ -1720,7 +1720,6 @@ class FrmAppHelper {
1720
  'offset' => apply_filters( 'frm_scroll_offset', 4 ),
1721
  'nonce' => wp_create_nonce( 'frm_ajax' ),
1722
  'id' => __( 'ID', 'formidable' ),
1723
- 'loading_text' => __( 'Options are loading...', 'formidable' ),
1724
  ) );
1725
 
1726
  if ( $location == 'admin' ) {
10
  /**
11
  * @since 2.0
12
  */
13
+ public static $plug_version = '2.02.04';
14
 
15
  /**
16
  * @since 1.07.02
1720
  'offset' => apply_filters( 'frm_scroll_offset', 4 ),
1721
  'nonce' => wp_create_nonce( 'frm_ajax' ),
1722
  'id' => __( 'ID', 'formidable' ),
 
1723
  ) );
1724
 
1725
  if ( $location == 'admin' ) {
classes/helpers/FrmFieldsHelper.php CHANGED
@@ -617,6 +617,7 @@ DEFAULT_HTML;
617
  $hide_opt = rtrim( $hide_opt );
618
  }
619
 
 
620
  $hide_opt = wp_kses_post( $hide_opt );
621
 
622
  if ( is_array($observed_value) ) {
@@ -927,7 +928,7 @@ DEFAULT_HTML;
927
  'user_id', 'tag', 'password',
928
  );
929
  $multiple_input = array( 'radio', 'checkbox', 'select', 'scale', 'lookup' );
930
- $other_type = array( 'divider', 'html', 'break' );
931
 
932
  $field_selection = array_merge( FrmField::pro_field_selection(), FrmField::field_selection() );
933
 
617
  $hide_opt = rtrim( $hide_opt );
618
  }
619
 
620
+ $observed_value = wp_kses_post( $observed_value );
621
  $hide_opt = wp_kses_post( $hide_opt );
622
 
623
  if ( is_array($observed_value) ) {
928
  'user_id', 'tag', 'password',
929
  );
930
  $multiple_input = array( 'radio', 'checkbox', 'select', 'scale', 'lookup' );
931
+ $other_type = array( 'html', 'break' );
932
 
933
  $field_selection = array_merge( FrmField::pro_field_selection(), FrmField::field_selection() );
934
 
classes/models/FrmField.php CHANGED
@@ -608,6 +608,7 @@ class FrmField {
608
  $field['type'] == 'checkbox' ||
609
  $field['type'] == 'address' ||
610
  ( $field['type'] == 'data' && isset($field['data_type']) && $field['data_type'] == 'checkbox' ) ||
 
611
  self::is_multiple_select( $field )
612
  );
613
 
@@ -616,6 +617,7 @@ class FrmField {
616
  $field->type == 'checkbox' ||
617
  $field->type == 'address' ||
618
  ( $field->type == 'data' && isset( $field->field_options['data_type'] ) && $field->field_options['data_type'] == 'checkbox' ) ||
 
619
  self::is_multiple_select( $field )
620
  );
621
  }
608
  $field['type'] == 'checkbox' ||
609
  $field['type'] == 'address' ||
610
  ( $field['type'] == 'data' && isset($field['data_type']) && $field['data_type'] == 'checkbox' ) ||
611
+ ( $field['type'] == 'lookup' && isset($field['data_type']) && $field['data_type'] == 'checkbox' ) ||
612
  self::is_multiple_select( $field )
613
  );
614
 
617
  $field->type == 'checkbox' ||
618
  $field->type == 'address' ||
619
  ( $field->type == 'data' && isset( $field->field_options['data_type'] ) && $field->field_options['data_type'] == 'checkbox' ) ||
620
+ ( $field->type == 'lookup' && isset( $field->field_options['data_type'] ) && $field->field_options['data_type'] == 'checkbox' ) ||
621
  self::is_multiple_select( $field )
622
  );
623
  }
classes/models/FrmStyle.php CHANGED
@@ -312,6 +312,7 @@ class FrmStyle {
312
  'description_weight' => 'normal',
313
  'description_style' => 'normal',
314
  'description_align' => 'left',
 
315
 
316
  'field_font_size' => '14px',
317
  'field_height' => '32px',
312
  'description_weight' => 'normal',
313
  'description_style' => 'normal',
314
  'description_align' => 'left',
315
+ 'description_margin' => '0',
316
 
317
  'field_font_size' => '14px',
318
  'field_height' => '32px',
classes/views/frm-fields/input.php CHANGED
@@ -91,7 +91,7 @@ do_action('frm_field_input_html', $field);
91
  }
92
  }
93
  ?>
94
- <option value="<?php echo esc_attr($field_val) ?>" <?php echo $selected ? ' selected="selected"' : ''; ?><?php echo ( FrmFieldsHelper::is_other_opt( $opt_key ) ) ? ' class="frm_other_trigger"' : '';?>><?php echo ($opt == '') ? ' ' : $opt; ?></option>
95
  <?php
96
  } ?>
97
  </select>
91
  }
92
  }
93
  ?>
94
+ <option value="<?php echo esc_attr($field_val) ?>" <?php echo $selected ? ' selected="selected"' : ''; ?><?php echo ( FrmFieldsHelper::is_other_opt( $opt_key ) ) ? ' class="frm_other_trigger"' : '';?>><?php echo esc_html( $opt == '' ? ' ' : $opt ); ?></option>
95
  <?php
96
  } ?>
97
  </select>
classes/views/frm-fields/show-build.php CHANGED
@@ -55,7 +55,7 @@
55
  <?php
56
  } else if ( $field['type'] == 'captcha' ) {
57
  if ( empty($frm_settings->pubkey) ) { ?>
58
- <div class="howto frm_no_captcha_text"><?php printf(__( 'Your captcha will not appear on your form until you %1$sset up%2$s the Site and Private Keys', 'formidable' ), '<a href="?page=formidable-settings">', '</a>') ?></div>
59
  <?php
60
  } ?>
61
  <img src="<?php echo esc_url( FrmAppHelper::plugin_url() . '/images/recaptcha.png' ) ?>" class="recaptcha_placeholder" alt="reCaptcha"/>
55
  <?php
56
  } else if ( $field['type'] == 'captcha' ) {
57
  if ( empty($frm_settings->pubkey) ) { ?>
58
+ <div class="howto frm_no_captcha_text"><?php printf(__( 'Your captcha will not appear on your form until you %1$sset up%2$s the Site and Secret Keys', 'formidable' ), '<a href="?page=formidable-settings">', '</a>') ?></div>
59
  <?php
60
  } ?>
61
  <img src="<?php echo esc_url( FrmAppHelper::plugin_url() . '/images/recaptcha.png' ) ?>" class="recaptcha_placeholder" alt="reCaptcha"/>
classes/views/frm-settings/form.php CHANGED
@@ -80,7 +80,7 @@
80
  <p><label class="frm_left_label"><?php _e( 'Site Key', 'formidable' ) ?></label>
81
  <input type="text" name="frm_pubkey" id="frm_pubkey" size="42" value="<?php echo esc_attr($frm_settings->pubkey) ?>" placeholder="<?php esc_attr_e( 'Optional', 'formidable' ) ?>" /></p>
82
 
83
- <p><label class="frm_left_label"><?php _e( 'Private Key', 'formidable' ) ?></label>
84
  <input type="text" name="frm_privkey" id="frm_privkey" size="42" value="<?php echo esc_attr($frm_settings->privkey) ?>" placeholder="<?php esc_attr_e( 'Optional', 'formidable' ) ?>" /></p>
85
 
86
  <p><label class="frm_left_label"><?php _e( 'reCAPTCHA Language', 'formidable' ) ?></label>
80
  <p><label class="frm_left_label"><?php _e( 'Site Key', 'formidable' ) ?></label>
81
  <input type="text" name="frm_pubkey" id="frm_pubkey" size="42" value="<?php echo esc_attr($frm_settings->pubkey) ?>" placeholder="<?php esc_attr_e( 'Optional', 'formidable' ) ?>" /></p>
82
 
83
+ <p><label class="frm_left_label"><?php _e( 'Secret Key', 'formidable' ) ?></label>
84
  <input type="text" name="frm_privkey" id="frm_privkey" size="42" value="<?php echo esc_attr($frm_settings->privkey) ?>" placeholder="<?php esc_attr_e( 'Optional', 'formidable' ) ?>" /></p>
85
 
86
  <p><label class="frm_left_label"><?php _e( 'reCAPTCHA Language', 'formidable' ) ?></label>
classes/views/styles/_field-description.php CHANGED
@@ -17,11 +17,11 @@
17
  <option value="italic" <?php selected($style->post_content['description_style'], 'italic') ?>><?php _e( 'italic', 'formidable' ) ?></option>
18
  </select>
19
  </div>
 
20
  <div class="field-group clearfix">
21
  <label><?php _e( 'Size', 'formidable' ) ?></label>
22
  <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name('description_font_size') ) ?>" id="frm_description_font_size" value="<?php echo esc_attr( $style->post_content['description_font_size'] ) ?>" size="3" />
23
  </div>
24
-
25
  <div class="field-group clearfix">
26
  <label><?php _e( 'Align', 'formidable' ) ?></label>
27
  <select name="<?php echo esc_attr( $frm_style->get_field_name('description_align') ) ?>" id="frm_description_align">
@@ -29,4 +29,8 @@
29
  <option value="right" <?php selected($style->post_content['description_align'], 'right') ?>><?php _e( 'right', 'formidable' ) ?></option>
30
  </select>
31
  </div>
 
 
 
 
32
  <div class="clear"></div>
17
  <option value="italic" <?php selected($style->post_content['description_style'], 'italic') ?>><?php _e( 'italic', 'formidable' ) ?></option>
18
  </select>
19
  </div>
20
+
21
  <div class="field-group clearfix">
22
  <label><?php _e( 'Size', 'formidable' ) ?></label>
23
  <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name('description_font_size') ) ?>" id="frm_description_font_size" value="<?php echo esc_attr( $style->post_content['description_font_size'] ) ?>" size="3" />
24
  </div>
 
25
  <div class="field-group clearfix">
26
  <label><?php _e( 'Align', 'formidable' ) ?></label>
27
  <select name="<?php echo esc_attr( $frm_style->get_field_name('description_align') ) ?>" id="frm_description_align">
29
  <option value="right" <?php selected($style->post_content['description_align'], 'right') ?>><?php _e( 'right', 'formidable' ) ?></option>
30
  </select>
31
  </div>
32
+ <div class="field-group clearfix">
33
+ <label><?php _e( 'Margin', 'formidable' ) ?></label>
34
+ <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name('description_margin') ) ?>" id="frm_description_margin" value="<?php echo esc_attr( $style->post_content['description_margin'] ) ?>" size="3" />
35
+ </div>
36
  <div class="clear"></div>
css/_single_theme.css.php CHANGED
@@ -187,7 +187,7 @@ if ( ! isset( $center_form ) ) {
187
  .<?php echo esc_html( $style_class ) ?> div.frm_description,
188
  .<?php echo esc_html( $style_class ) ?> .frm-show-form > div.frm_description,
189
  .<?php echo esc_html( $style_class ) ?> .frm_error{
190
- margin:0;
191
  padding:0;
192
  font-family:<?php echo FrmAppHelper::kses( $font . $important ) ?>;
193
  font-size:<?php echo esc_html( $description_font_size . $important ) ?>;
@@ -230,12 +230,14 @@ if ( ! isset( $center_form ) ) {
230
  .<?php echo esc_html( $style_class ) ?> .frm_form_field.frm_left_container .frm_opt_container,
231
  .<?php echo esc_html( $style_class ) ?> .frm_form_field.frm_left_container .frm-g-recaptcha,
232
  .<?php echo esc_html( $style_class ) ?> .frm_form_field.frm_left_container .g-recaptcha,
 
233
  .<?php echo esc_html( $style_class ) ?> .frm_form_field.frm_right_container input:not([type=radio]):not([type=checkbox]),
234
  .<?php echo esc_html( $style_class ) ?> .frm_form_field.frm_right_container:not(.frm_dynamic_select_container) select,
235
  .<?php echo esc_html( $style_class ) ?> .frm_form_field.frm_right_container textarea,
236
  .<?php echo esc_html( $style_class ) ?> .frm_form_field.frm_right_container .frm_opt_container,
237
  .<?php echo esc_html( $style_class ) ?> .frm_form_field.frm_right_container .g-recaptcha,
238
- .<?php echo esc_html( $style_class ) ?> .frm_form_field.frm_right_container .frm-g-recaptcha{
 
239
  max-width:62%<?php echo esc_html( $important ) ?>;
240
  }
241
 
@@ -924,12 +926,14 @@ if ( ! $submit_style ) { ?>
924
  .<?php echo esc_html( $style_class ) ?> .frm_form_field.frm_half.frm_left_container .frm_opt_container,
925
  .<?php echo esc_html( $style_class ) ?> .frm_form_field.frm_half.frm_left_container.frm-g-recaptcha,
926
  .<?php echo esc_html( $style_class ) ?> .frm_form_field.frm_half.frm_left_container.g-recaptcha,
 
927
  .<?php echo esc_html( $style_class ) ?> .frm_form_field.frm_half.frm_right_container input:not([type=radio]):not([type=checkbox]),
928
  .<?php echo esc_html( $style_class ) ?> .frm_form_field.frm_half.frm_right_container select,
929
  .<?php echo esc_html( $style_class ) ?> .frm_form_field.frm_half.frm_right_container textarea,
930
  .<?php echo esc_html( $style_class ) ?> .frm_form_field.frm_half.frm_right_container .frm_opt_container,
931
  .<?php echo esc_html( $style_class ) ?> .frm_form_field.frm_half.frm_right_container.frm-g-recaptcha,
932
- .<?php echo esc_html( $style_class ) ?> .frm_form_field.frm_half.frm_right_container.g-recaptcha{
 
933
  max-width:100%<?php echo esc_html( $important ) ?>;
934
  }
935
  .<?php echo esc_html( $style_class ) ?> .frm_form_field.frm_left_half.frm_left_container .frm_primary_label,
@@ -986,12 +990,14 @@ if ( ! $submit_style ) { ?>
986
  .<?php echo esc_html( $style_class ) ?> .frm_form_field.frm_left_container .frm_opt_container,
987
  .<?php echo esc_html( $style_class ) ?> .frm_form_field.frm_left_container .frm-g-recaptcha,
988
  .<?php echo esc_html( $style_class ) ?> .frm_form_field.frm_left_container .g-recaptcha,
 
989
  .<?php echo esc_html( $style_class ) ?> .frm_form_field.frm_right_container input:not([type=radio]):not([type=checkbox]),
990
  .<?php echo esc_html( $style_class ) ?> .frm_form_field.frm_right_container:not(.frm_dynamic_select_container) select,
991
  .<?php echo esc_html( $style_class ) ?> .frm_form_field.frm_right_container textarea,
992
  .<?php echo esc_html( $style_class ) ?> .frm_form_field.frm_right_container .frm_opt_container,
993
  .<?php echo esc_html( $style_class ) ?> .frm_form_field.frm_right_container .frm-g-recaptcha,
994
  .<?php echo esc_html( $style_class ) ?> .frm_form_field.frm_right_container .g-recaptcha,
 
995
  .<?php echo esc_html( $style_class ) ?> .frm_left_container p.description,
996
  .<?php echo esc_html( $style_class ) ?> .frm_left_container div.description,
997
  .<?php echo esc_html( $style_class ) ?> .frm_left_container div.frm_description,
187
  .<?php echo esc_html( $style_class ) ?> div.frm_description,
188
  .<?php echo esc_html( $style_class ) ?> .frm-show-form > div.frm_description,
189
  .<?php echo esc_html( $style_class ) ?> .frm_error{
190
+ margin:<?php echo esc_html( $description_margin . $important ) ?>;
191
  padding:0;
192
  font-family:<?php echo FrmAppHelper::kses( $font . $important ) ?>;
193
  font-size:<?php echo esc_html( $description_font_size . $important ) ?>;
230
  .<?php echo esc_html( $style_class ) ?> .frm_form_field.frm_left_container .frm_opt_container,
231
  .<?php echo esc_html( $style_class ) ?> .frm_form_field.frm_left_container .frm-g-recaptcha,
232
  .<?php echo esc_html( $style_class ) ?> .frm_form_field.frm_left_container .g-recaptcha,
233
+ .<?php echo esc_html( $style_class ) ?> .frm_form_field.frm_left_container .chosen-container,
234
  .<?php echo esc_html( $style_class ) ?> .frm_form_field.frm_right_container input:not([type=radio]):not([type=checkbox]),
235
  .<?php echo esc_html( $style_class ) ?> .frm_form_field.frm_right_container:not(.frm_dynamic_select_container) select,
236
  .<?php echo esc_html( $style_class ) ?> .frm_form_field.frm_right_container textarea,
237
  .<?php echo esc_html( $style_class ) ?> .frm_form_field.frm_right_container .frm_opt_container,
238
  .<?php echo esc_html( $style_class ) ?> .frm_form_field.frm_right_container .g-recaptcha,
239
+ .<?php echo esc_html( $style_class ) ?> .frm_form_field.frm_right_container .frm-g-recaptcha,
240
+ .<?php echo esc_html( $style_class ) ?> .frm_form_field.frm_right_container .chosen-container{
241
  max-width:62%<?php echo esc_html( $important ) ?>;
242
  }
243
 
926
  .<?php echo esc_html( $style_class ) ?> .frm_form_field.frm_half.frm_left_container .frm_opt_container,
927
  .<?php echo esc_html( $style_class ) ?> .frm_form_field.frm_half.frm_left_container.frm-g-recaptcha,
928
  .<?php echo esc_html( $style_class ) ?> .frm_form_field.frm_half.frm_left_container.g-recaptcha,
929
+ .<?php echo esc_html( $style_class ) ?> .frm_form_field.frm_half.frm_left_container .chosen-container,
930
  .<?php echo esc_html( $style_class ) ?> .frm_form_field.frm_half.frm_right_container input:not([type=radio]):not([type=checkbox]),
931
  .<?php echo esc_html( $style_class ) ?> .frm_form_field.frm_half.frm_right_container select,
932
  .<?php echo esc_html( $style_class ) ?> .frm_form_field.frm_half.frm_right_container textarea,
933
  .<?php echo esc_html( $style_class ) ?> .frm_form_field.frm_half.frm_right_container .frm_opt_container,
934
  .<?php echo esc_html( $style_class ) ?> .frm_form_field.frm_half.frm_right_container.frm-g-recaptcha,
935
+ .<?php echo esc_html( $style_class ) ?> .frm_form_field.frm_half.frm_right_container.g-recaptcha,
936
+ .<?php echo esc_html( $style_class ) ?> .frm_form_field.frm_half.frm_right_container .chosen-container{
937
  max-width:100%<?php echo esc_html( $important ) ?>;
938
  }
939
  .<?php echo esc_html( $style_class ) ?> .frm_form_field.frm_left_half.frm_left_container .frm_primary_label,
990
  .<?php echo esc_html( $style_class ) ?> .frm_form_field.frm_left_container .frm_opt_container,
991
  .<?php echo esc_html( $style_class ) ?> .frm_form_field.frm_left_container .frm-g-recaptcha,
992
  .<?php echo esc_html( $style_class ) ?> .frm_form_field.frm_left_container .g-recaptcha,
993
+ .<?php echo esc_html( $style_class ) ?> .frm_form_field.frm_left_container .chosen-container,
994
  .<?php echo esc_html( $style_class ) ?> .frm_form_field.frm_right_container input:not([type=radio]):not([type=checkbox]),
995
  .<?php echo esc_html( $style_class ) ?> .frm_form_field.frm_right_container:not(.frm_dynamic_select_container) select,
996
  .<?php echo esc_html( $style_class ) ?> .frm_form_field.frm_right_container textarea,
997
  .<?php echo esc_html( $style_class ) ?> .frm_form_field.frm_right_container .frm_opt_container,
998
  .<?php echo esc_html( $style_class ) ?> .frm_form_field.frm_right_container .frm-g-recaptcha,
999
  .<?php echo esc_html( $style_class ) ?> .frm_form_field.frm_right_container .g-recaptcha,
1000
+ .<?php echo esc_html( $style_class ) ?> .frm_form_field.frm_right_container .chosen-container,
1001
  .<?php echo esc_html( $style_class ) ?> .frm_left_container p.description,
1002
  .<?php echo esc_html( $style_class ) ?> .frm_left_container div.description,
1003
  .<?php echo esc_html( $style_class ) ?> .frm_left_container div.frm_description,
css/custom_theme.css.php CHANGED
@@ -570,6 +570,7 @@ table.frmcal-calendar .frmcal-today .frmcal_date{
570
  display:block;
571
  background:transparent;
572
  overflow:hidden;
 
573
  }
574
 
575
  .frm_form_fields div.rating-cancel a:before{
@@ -639,6 +640,7 @@ table.frmcal-calendar .frmcal-today .frmcal_date{
639
  .frm_form_field.frm_left_container .frm_dropzone,
640
  .frm_form_field.frm_left_container .frm-g-recaptcha,
641
  .frm_form_field.frm_left_container .g-recaptcha,
 
642
  .frm_form_field.frm_right_container input:not([type=radio]):not([type=checkbox]),
643
  .frm_form_field.frm_right_container:not(.frm_dynamic_select_container) select,
644
  .frm_form_field.frm_right_container textarea,
@@ -646,7 +648,8 @@ table.frmcal-calendar .frmcal-today .frmcal_date{
646
  .frm_form_field.frm_right_container .frm_opt_container,
647
  .frm_form_field.frm_right_container .frm_dropzone,
648
  .frm_form_field.frm_right_container .frm-g-recaptcha,
649
- .frm_form_field.frm_right_container .g-recaptcha{
 
650
  max-width:62%;
651
  }
652
 
@@ -1260,7 +1263,8 @@ html[xmlns] .frm_clearfix{
1260
  -webkit-box-sizing:border-box;
1261
  -moz-box-sizing:border-box;
1262
  box-sizing:border-box;
1263
- width:100%;
 
1264
  height:auto;
1265
  background:white url('<?php echo FrmAppHelper::relative_plugin_url() ?>/pro/images/chosen-sprite.png') no-repeat 100% -20px;
1266
  background:url('<?php echo FrmAppHelper::relative_plugin_url() ?>/pro/images/chosen-sprite.png') no-repeat 100% -20px;
570
  display:block;
571
  background:transparent;
572
  overflow:hidden;
573
+ clear:none;
574
  }
575
 
576
  .frm_form_fields div.rating-cancel a:before{
640
  .frm_form_field.frm_left_container .frm_dropzone,
641
  .frm_form_field.frm_left_container .frm-g-recaptcha,
642
  .frm_form_field.frm_left_container .g-recaptcha,
643
+ .frm_form_field.frm_left_container .chosen-container,
644
  .frm_form_field.frm_right_container input:not([type=radio]):not([type=checkbox]),
645
  .frm_form_field.frm_right_container:not(.frm_dynamic_select_container) select,
646
  .frm_form_field.frm_right_container textarea,
648
  .frm_form_field.frm_right_container .frm_opt_container,
649
  .frm_form_field.frm_right_container .frm_dropzone,
650
  .frm_form_field.frm_right_container .frm-g-recaptcha,
651
+ .frm_form_field.frm_right_container .g-recaptcha,
652
+ .frm_form_field.frm_right_container .chosen-container{
653
  max-width:62%;
654
  }
655
 
1263
  -webkit-box-sizing:border-box;
1264
  -moz-box-sizing:border-box;
1265
  box-sizing:border-box;
1266
+ width:100% !important;
1267
+ max-width:100% !important;
1268
  height:auto;
1269
  background:white url('<?php echo FrmAppHelper::relative_plugin_url() ?>/pro/images/chosen-sprite.png') no-repeat 100% -20px;
1270
  background:url('<?php echo FrmAppHelper::relative_plugin_url() ?>/pro/images/chosen-sprite.png') no-repeat 100% -20px;
css/frm_admin.css CHANGED
@@ -1502,6 +1502,7 @@ span.howto{display:inline;}
1502
  /* Star Rating */
1503
  .frm_form_fields div.rating-cancel, .frm_form_fields div.star-rating{
1504
  float:left;width:17px;height:17px;cursor:pointer;display:block;background:transparent;overflow:hidden;
 
1505
  }
1506
  .frm_form_fields div.rating-cancel{display:none !important;}
1507
  .frm_form_fields div.rating-cancel a:before{font:16px/1 'dashicons';content:'\f460';color:#CDCDCD;}
1502
  /* Star Rating */
1503
  .frm_form_fields div.rating-cancel, .frm_form_fields div.star-rating{
1504
  float:left;width:17px;height:17px;cursor:pointer;display:block;background:transparent;overflow:hidden;
1505
+ clear:none;
1506
  }
1507
  .frm_form_fields div.rating-cancel{display:none !important;}
1508
  .frm_form_fields div.rating-cancel a:before{font:16px/1 'dashicons';content:'\f460';color:#CDCDCD;}
formidable.php CHANGED
@@ -2,7 +2,7 @@
2
  /*
3
  Plugin Name: Formidable
4
  Description: Quickly and easily create drag-and-drop forms
5
- Version: 2.02.03
6
  Plugin URI: http://formidablepro.com/
7
  Author URI: http://strategy11.com
8
  Author: Strategy11
2
  /*
3
  Plugin Name: Formidable
4
  Description: Quickly and easily create drag-and-drop forms
5
+ Version: 2.02.04
6
  Plugin URI: http://formidablepro.com/
7
  Author URI: http://strategy11.com
8
  Author: Strategy11
js/formidable.js CHANGED
@@ -325,7 +325,13 @@ function frmFrontFormJS(){
325
  var originalEvent = getOriginalEvent( e );
326
  checkFieldsWatchingLookup( field_id, jQuery(this), originalEvent );
327
  doCalculation(field_id, jQuery(this));
328
- validateField( field_id, this );
 
 
 
 
 
 
329
  }
330
 
331
  function getOriginalEvent( e ) {
@@ -703,6 +709,9 @@ function frmFrontFormJS(){
703
 
704
  if ( logicFieldInputs.length == 1 && logicFieldInputs[0].type != 'hidden' ) {
705
  selectedVals = jQuery( '[name^="' + inputName + '"]' ).val();
 
 
 
706
  } else {
707
  selectedVals = getValuesFromCheckboxInputs( logicFieldInputs );
708
  }
@@ -901,7 +910,7 @@ function frmFrontFormJS(){
901
  b = '';
902
  }
903
 
904
- if ( jQuery.isArray(b) && jQuery.inArray(a, b) > -1 ) {
905
  b = a;
906
  }
907
 
@@ -1702,7 +1711,7 @@ function frmFrontFormJS(){
1702
  function addLoadingTextToLookup( childSelect ) {
1703
  if ( ! childSelect.value ) {
1704
  childSelect.options.length = 1;
1705
- childSelect.options[1] = new Option(frm_js.loading_text, '', false, false);
1706
  }
1707
  }
1708
 
@@ -2034,7 +2043,7 @@ function frmFrontFormJS(){
2034
  if (html === '' || listVal === '') {
2035
  hideDynamicField(depFieldArgs);
2036
  } else {
2037
- showDynamicField(depFieldArgs, $fieldDiv, $listInputs);
2038
  }
2039
  } else {
2040
  updateHiddenDynamicListField( depFieldArgs, html );
@@ -2056,9 +2065,9 @@ function frmFrontFormJS(){
2056
  function updateDynamicFieldOptions( depFieldArgs, fieldElement ){
2057
  var $fieldDiv = jQuery( '#' + depFieldArgs.containerId );
2058
 
2059
- var hiddenInput = $fieldDiv.find('select[name^="item_meta"], textarea[name^="item_meta"], input[name^="item_meta"]');
2060
- var prevVal = getPrevFieldValue( hiddenInput );
2061
- var defaultVal = hiddenInput.data('frmval');
2062
 
2063
  addLoadingIcon( $fieldDiv );
2064
 
@@ -2072,26 +2081,32 @@ function frmFrontFormJS(){
2072
  field_id:depFieldArgs.fieldId,
2073
  default_value:defaultVal,
2074
  container_id:depFieldArgs.containerId,
2075
- prev_val:prevVal,
2076
  nonce:frm_js.nonce
2077
  },
2078
  success:function(html){
2079
  var $optContainer = $fieldDiv.find('.frm_opt_container');
2080
  $optContainer.html(html);
2081
- var $dynamicFieldInputs = $optContainer.find('select, input, textarea');
2082
 
2083
  removeLoadingIcon( $optContainer );
2084
 
2085
- if ( html === '' || ( $dynamicFieldInputs.length == 1 && $dynamicFieldInputs.attr('type') == 'hidden' ) ) {
2086
  hideDynamicField( depFieldArgs );
2087
  } else {
2088
- showDynamicField( depFieldArgs, $fieldDiv, $dynamicFieldInputs );
 
2089
  }
2090
  }
2091
  });
2092
 
2093
  }
2094
 
 
 
 
 
 
2095
  /**
2096
  * Update the value in a hidden Dynamic List field
2097
  *
@@ -2153,7 +2168,7 @@ function frmFrontFormJS(){
2153
 
2154
  // Remove the loading icon with jQuery
2155
  function removeLoadingIcon( $optContainer ) {
2156
- $optContainer.next( '.frm-loading-img' ).remove();
2157
  $optContainer.show();
2158
  }
2159
 
@@ -2167,28 +2182,28 @@ function frmFrontFormJS(){
2167
  optContainer.style.display = "block";
2168
  }
2169
 
2170
- // Get the previous field value in a Dynamic field
2171
- function getPrevFieldValue( inputs ) {
2172
- var prev = [];
2173
- var thisVal = '';
2174
- inputs.each(function(){
2175
- thisVal = this.value;
2176
  if ( this.type === 'radio' || this.type === 'checkbox' ) {
2177
  if ( this.checked === true ) {
2178
- prev.push( thisVal );
2179
  }
2180
  } else {
2181
- if ( thisVal !== '' ) {
2182
- prev.push( thisVal );
2183
  }
2184
  }
2185
  });
2186
 
2187
- if ( prev.length === 0 ) {
2188
- prev = '';
2189
  }
2190
 
2191
- return prev;
2192
  }
2193
 
2194
  // Hide and clear a Dynamic Field
@@ -2197,7 +2212,7 @@ function frmFrontFormJS(){
2197
  }
2198
 
2199
  // Show Dynamic field
2200
- function showDynamicField( depFieldArgs, $fieldDiv, $fieldInputs ) {
2201
  if ( isFieldConditionallyHidden( depFieldArgs.containerId, depFieldArgs.formId ) ) {
2202
  removeFromHideFields( depFieldArgs.containerId, depFieldArgs.formId );
2203
  $fieldDiv.show();
@@ -2207,7 +2222,9 @@ function frmFrontFormJS(){
2207
  loadChosen();
2208
  }
2209
 
2210
- triggerChange( $fieldInputs );
 
 
2211
  }
2212
 
2213
  /*************************************************
@@ -2837,7 +2854,7 @@ function frmFrontFormJS(){
2837
  var errors = [];
2838
 
2839
  var $fieldCont = jQuery(field).closest('.frm_form_field');
2840
- if ( $fieldCont.hasClass('.frm_required_field') && ! jQuery(field).hasClass('.frm_optional') ) {
2841
  errors = checkRequiredField( field, errors );
2842
  }
2843
 
@@ -3923,9 +3940,9 @@ function frmFrontFormJS(){
3923
  },
3924
 
3925
  submitFormManual: function(e, object){
3926
- var classList = object.classList;
3927
  if ( classList ) {
3928
- var isPro = classList.contains('frm_pro_form');
3929
  if ( ! isPro ) {
3930
  return;
3931
  }
@@ -3940,7 +3957,7 @@ function frmFrontFormJS(){
3940
 
3941
  if ( Object.keys(errors).length === 0 ) {
3942
  jQuery(object).find('.frm_ajax_loading').addClass('frm_loading_now');
3943
- if ( classList.contains('frm_ajax_submit') ) {
3944
  var hasFileFields = jQuery(object).find('input[type="file"]').length;
3945
  if ( hasFileFields < 1 ) {
3946
  action = jQuery(object).find('input[name="frm_action"]').val();
325
  var originalEvent = getOriginalEvent( e );
326
  checkFieldsWatchingLookup( field_id, jQuery(this), originalEvent );
327
  doCalculation(field_id, jQuery(this));
328
+ maybeValidateChange( field_id, this );
329
+ }
330
+
331
+ function maybeValidateChange( field_id, field ) {
332
+ if ( jQuery(field).closest('form').hasClass('frm_js_validate') ) {
333
+ validateField( field_id, field );
334
+ }
335
  }
336
 
337
  function getOriginalEvent( e ) {
709
 
710
  if ( logicFieldInputs.length == 1 && logicFieldInputs[0].type != 'hidden' ) {
711
  selectedVals = jQuery( '[name^="' + inputName + '"]' ).val();
712
+ if ( selectedVals === null ) {
713
+ selectedVals = '';
714
+ }
715
  } else {
716
  selectedVals = getValuesFromCheckboxInputs( logicFieldInputs );
717
  }
910
  b = '';
911
  }
912
 
913
+ if ( jQuery.isArray(b) && jQuery.inArray( String(a), b) > -1 ) {
914
  b = a;
915
  }
916
 
1711
  function addLoadingTextToLookup( childSelect ) {
1712
  if ( ! childSelect.value ) {
1713
  childSelect.options.length = 1;
1714
+ childSelect.options[1] = new Option(frm_js.loading, '', false, false);
1715
  }
1716
  }
1717
 
2043
  if (html === '' || listVal === '') {
2044
  hideDynamicField(depFieldArgs);
2045
  } else {
2046
+ showDynamicField( depFieldArgs, $fieldDiv, $listInputs, true );
2047
  }
2048
  } else {
2049
  updateHiddenDynamicListField( depFieldArgs, html );
2065
  function updateDynamicFieldOptions( depFieldArgs, fieldElement ){
2066
  var $fieldDiv = jQuery( '#' + depFieldArgs.containerId );
2067
 
2068
+ var $fieldInputs = $fieldDiv.find( 'select[name^="item_meta"], input[name^="item_meta"]' );
2069
+ var prevValue = getFieldValueFromInputs( $fieldInputs );
2070
+ var defaultVal = $fieldInputs.data('frmval');
2071
 
2072
  addLoadingIcon( $fieldDiv );
2073
 
2081
  field_id:depFieldArgs.fieldId,
2082
  default_value:defaultVal,
2083
  container_id:depFieldArgs.containerId,
2084
+ prev_val:prevValue,
2085
  nonce:frm_js.nonce
2086
  },
2087
  success:function(html){
2088
  var $optContainer = $fieldDiv.find('.frm_opt_container');
2089
  $optContainer.html(html);
2090
+ var $dynamicFieldInputs = $optContainer.find( 'select, input[type="checkbox"], input[type="radio"]' );
2091
 
2092
  removeLoadingIcon( $optContainer );
2093
 
2094
+ if ( html === '' || $dynamicFieldInputs.length < 1 ) {
2095
  hideDynamicField( depFieldArgs );
2096
  } else {
2097
+ var valueChanged = dynamicFieldValueChanged( depFieldArgs, $dynamicFieldInputs, prevValue );
2098
+ showDynamicField( depFieldArgs, $fieldDiv, $dynamicFieldInputs, valueChanged );
2099
  }
2100
  }
2101
  });
2102
 
2103
  }
2104
 
2105
+ function dynamicFieldValueChanged( depFieldArgs, $dynamicFieldInputs, prevValue ) {
2106
+ var newValue = getFieldValueFromInputs( $dynamicFieldInputs );
2107
+ return ( prevValue !== newValue );
2108
+ }
2109
+
2110
  /**
2111
  * Update the value in a hidden Dynamic List field
2112
  *
2168
 
2169
  // Remove the loading icon with jQuery
2170
  function removeLoadingIcon( $optContainer ) {
2171
+ $optContainer.parent().children( '.frm-loading-img').remove();
2172
  $optContainer.show();
2173
  }
2174
 
2182
  optContainer.style.display = "block";
2183
  }
2184
 
2185
+ // Get the field value from all the inputs
2186
+ function getFieldValueFromInputs( $inputs ) {
2187
+ var fieldValue = [];
2188
+ var currentValue = '';
2189
+ $inputs.each(function(){
2190
+ currentValue = this.value;
2191
  if ( this.type === 'radio' || this.type === 'checkbox' ) {
2192
  if ( this.checked === true ) {
2193
+ fieldValue.push( currentValue );
2194
  }
2195
  } else {
2196
+ if ( currentValue !== '' ) {
2197
+ fieldValue.push( currentValue );
2198
  }
2199
  }
2200
  });
2201
 
2202
+ if ( fieldValue.length === 0 ) {
2203
+ fieldValue = '';
2204
  }
2205
 
2206
+ return fieldValue;
2207
  }
2208
 
2209
  // Hide and clear a Dynamic Field
2212
  }
2213
 
2214
  // Show Dynamic field
2215
+ function showDynamicField( depFieldArgs, $fieldDiv, $fieldInputs, valueChanged ) {
2216
  if ( isFieldConditionallyHidden( depFieldArgs.containerId, depFieldArgs.formId ) ) {
2217
  removeFromHideFields( depFieldArgs.containerId, depFieldArgs.formId );
2218
  $fieldDiv.show();
2222
  loadChosen();
2223
  }
2224
 
2225
+ if ( valueChanged === true ) {
2226
+ triggerChange($fieldInputs);
2227
+ }
2228
  }
2229
 
2230
  /*************************************************
2854
  var errors = [];
2855
 
2856
  var $fieldCont = jQuery(field).closest('.frm_form_field');
2857
+ if ( $fieldCont.hasClass('frm_required_field') && ! jQuery(field).hasClass('frm_optional') ) {
2858
  errors = checkRequiredField( field, errors );
2859
  }
2860
 
3940
  },
3941
 
3942
  submitFormManual: function(e, object){
3943
+ var classList = object.className.trim().split(/\s+/gi);
3944
  if ( classList ) {
3945
+ var isPro = classList.indexOf('frm_pro_form') > -1;
3946
  if ( ! isPro ) {
3947
  return;
3948
  }
3957
 
3958
  if ( Object.keys(errors).length === 0 ) {
3959
  jQuery(object).find('.frm_ajax_loading').addClass('frm_loading_now');
3960
+ if ( classList.indexOf('frm_ajax_submit') > -1 ) {
3961
  var hasFileFields = jQuery(object).find('input[type="file"]').length;
3962
  if ( hasFileFields < 1 ) {
3963
  action = jQuery(object).find('input[name="frm_action"]').val();
js/formidable.min.js CHANGED
@@ -1,95 +1,95 @@
1
  function frmFrontFormJS(){function l(a){var b=jQuery(this),c=b.attr("type");"submit"!==c&&a.preventDefault();a=b.parents("form:first");var d=b="",e=this.name;if("frm_prev_page"===e||-1!==this.className.indexOf("frm_prev_page"))b=jQuery(a).find(".frm_next_page").attr("id").replace("frm_next_p_","");else if("frm_save_draft"===e||-1!==this.className.indexOf("frm_save_draft"))d=1;jQuery(".frm_next_page").val(b);jQuery(".frm_saving_draft").val(d);"submit"!==c&&a.trigger("submit")}function n(){jQuery(this).parent().children(".frm_toggle_container").slideToggle("fast");
2
- jQuery(this).toggleClass("active").children(".ui-icon-triangle-1-e, .ui-icon-triangle-1-s").toggleClass("ui-icon-triangle-1-s ui-icon-triangle-1-e")}function p(){for(var a=__frmUniqueTimes,b=0;b<a.length;b++)a[b].dateID==this.id&&frmFrontForm.removeUsedTimes(this,a[b].timeID)}function r(){if(-1===this.className.indexOf("frm_custom_date")&&"undefined"!==typeof __frmDatepicker){var a=__frmDatepicker,b=this.id,c=b.split("-");c.pop();c='input[id^="'+c.join("-")+'"]';jQuery.datepicker.setDefaults(jQuery.datepicker.regional[""]);
3
- for(var d=0,e=0;e<a.length;e++)if(a[e].triggerID=="#"+b||a[e].triggerID==c)d=e;""!==a[d].options.defaultDate&&(a[d].options.defaultDate=new Date(a[d].options.defaultDate));jQuery(this).datepicker(jQuery.extend(jQuery.datepicker.regional[a[d].locale],a[d].options))}}function v(a){if("undefined"!==typeof __frmDropzone)for(var b=__frmDropzone,c=0;c<b.length;c++)z(c,a)}function z(a,b){var c=__frmDropzone,d="#"+c[a].htmlID+"_dropzone",e=c[a].fieldName;"undefined"!==typeof b&&-1!==d.indexOf("-0_dropzone")&&
4
  (d=d.replace("-0_dropzone","-"+b+"_dropzone"),e=e.replace("[0]","["+b+"]"),delete c[a].mockFiles);d=jQuery(d);if(!(1>d.length||d.hasClass("dz-clickable"))){var f=c[a].maxFiles;if("undefined"!==typeof c[a].mockFiles){var h=c[a].mockFiles.length;0<f&&(f-=h)}var h=d.closest("form"),g=h.find('input[type="submit"], .frm_submit input[type="button"]'),k=h.find(".frm_ajax_loading");d.dropzone({url:frm_js.ajax_url,addRemoveLinks:!0,paramName:d.attr("id").replace("_dropzone",""),maxFilesize:c[a].maxFilesize,
5
- maxFiles:f,uploadMultiple:c[a].uploadMultiple,dictCancelUpload:c[a].cancel,dictCancelUploadConfirmation:c[a].cancelConfirm,dictRemoveFile:c[a].remove,dictMaxFilesExceeded:c[a].maxFilesExceeded,fallback:function(){jQuery(this.element).closest("form").removeClass("frm_ajax_submit")},init:function(){this.on("sending",function(b,d,e){e.append("action","frm_submit_dropzone");e.append("field_id",c[a].fieldID);e.append("form_id",c[a].formID)});this.on("success",function(b,d){for(var f=jQuery.parseJSON(d),
6
- g=0;g<f.length;g++)!0!==c[a].uploadMultiple&&jQuery('input[name="'+e+'"]').val(f[g])});this.on("successmultiple",function(b,d){for(var e=jQuery.parseJSON(d),f=0;f<b.length;f++)jQuery(b[f].previewElement).append(y(c[a],e[f]))});this.on("removedfile",function(b){!0!==c[a].uploadMultiple&&jQuery('input[name="'+e+'"]').val("")});this.on("complete",function(b){if("undefined"!==typeof b.mediaID){c[a].uploadMultiple&&jQuery(b.previewElement).append(y(c[a],b.mediaID));for(var d=b.previewElement.querySelectorAll("[data-dz-name]"),
7
- e=0,f=d.length;e<f;e++)d[e].innerHTML='<a href="'+b.url+'">'+b.name+"</a>"}});this.on("addedfile",function(){k.addClass("frm_loading_now");g.attr("disabled","disabled")});this.on("queuecomplete",function(){k.removeClass("frm_loading_now");g.removeAttr("disabled")});this.on("removedfile",function(b){"undefined"!==typeof b.mediaID&&(jQuery(b.previewElement).remove(),this.options.maxFiles=c[a].maxFiles-this.files.length)});if("undefined"!==typeof c[a].mockFiles)for(var b=0;b<c[a].mockFiles.length;b++){var d=
8
- {name:c[a].mockFiles[b].name,size:c[a].mockFiles[b].size,url:c[a].mockFiles[b].file_url,mediaID:c[a].mockFiles[b].id};this.emit("addedfile",d);this.emit("thumbnail",d,c[a].mockFiles[b].url);this.emit("complete",d);this.files.push(d)}}})}}function y(a,b){return'<input name="'+a.fieldName+'[]" type="hidden" value="'+b+'" data-frmfile="'+a.fieldID+'" />'}function w(){var a=jQuery(this).data("frm-remove");Na(jQuery(this).parent(".dz-preview"));a=jQuery('input[name="'+a+'"]');a.length&&a.val("")}function A(){var a=
9
- this.type,b=!1,c=!1;if("select-one"===a)c=!0,"frm_other_trigger"===this.options[this.selectedIndex].className&&(b=!0);else if("select-multiple"===a)for(var c=!0,d=this.options,b=!1,e=0;e<d.length;e++)if("frm_other_trigger"===d[e].className&&d[e].selected){b=!0;break}c?(a=jQuery(this).parent().children(".frm_other_input"),a.length&&(b?a[0].className=a[0].className.replace("frm_pos_none",""):(1>a[0].className.indexOf("frm_pos_none")&&(a[0].className+=" frm_pos_none"),a[0].value=""))):"radio"===a?jQuery(this).is(":checked")&&
10
  (jQuery(this).closest(".frm_radio").children(".frm_other_input").removeClass("frm_pos_none"),jQuery(this).closest(".frm_radio").siblings().children(".frm_other_input").addClass("frm_pos_none").val("")):"checkbox"===a&&(this.checked?jQuery(this).closest(".frm_checkbox").children(".frm_other_input").removeClass("frm_pos_none"):jQuery(this).closest(".frm_checkbox").children(".frm_other_input").addClass("frm_pos_none").val(""))}function F(a){var b=q(this,!1);if(b&&"undefined"!==typeof b&&(!a.frmTriggered||
11
- a.frmTriggered!=b)){ea(b,jQuery(this));a="undefined"!==typeof a.originalEvent||-1<a.currentTarget.className.indexOf("frm_chzn")?"value changed":"other";fa(b,jQuery(this),a);M(b,jQuery(this));b=[];a=jQuery(this).closest(".frm_form_field");a.hasClass(".frm_required_field")&&!jQuery(this).hasClass(".frm_optional")&&(b=ga(this,b));if(1>b.length)if("email"==this.type)var c=jQuery(this).closest("form").find("input[type=email]"),b=ha(this,b,c);else"number"==this.type?b=ia(this,b):null!==this.pattern&&(b=
12
- ja(this,b));a.removeClass("frm_blank_field");a.find(".frm_error").remove();if(0<Object.keys(b).length)for(var d in b)N(a,d,b)}}function q(a,b){var c="",c=a instanceof jQuery?a.attr("name"):a.name;if(""===c)return c=a instanceof jQuery?a.data("name"):a.getAttribute("data-name"),""!==c&&c?c:0;c=c.replace("item_meta[","").replace("[]","").split("]");if(1>c.length)return 0;var c=c.filter(function(a){return""!==a}),d=c[0],e=!1;if(1===c.length||"[form"==c[1]||"[id"==c[1])return d;if(jQuery('input[name="item_meta['+
13
- d+'][form]"]').length){if(2===c.length&&"[0"==c[1])return 0;d=c[2].replace("[","");e=!0}"other"===d&&(d=e?c[3].replace("[",""):c[1].replace("[",""));!0===b&&(d=d===c[0]?d+"-"+c[1].replace("[",""):d+"-"+c[0]+"-"+c[1].replace("[",""));return d}function ea(a,b){if(!("undefined"===typeof __FRMRULES||"undefined"===typeof __FRMRULES[a]||1>__FRMRULES[a].dependents.length||null===b||"undefined"===typeof b))for(var c=__FRMRULES[a],d=G(b[0].name),e=0,f=c.dependents.length;e<f;e++)H(c.dependents[e],d)}function H(a,
14
- b){var c=O(a);if(!(!1===c||1>c.conditions.length)){var d;d=[];if(c.isRepeating)if(""!==b.repeatingSection){var e="frm_field_"+c.fieldId+"-",e=e+(b.repeatingSection+"-"+b.repeatRow+"_container");d.push(e)}else if("0"!==c.inEmbedForm)d=P(c),d=["frm_field_"+c.fieldId+"-"+d+"-0_container"];else if(d=[],e=P(c),null!==document.getElementById("frm_field_"+e+"_container"))for(var e=document.querySelectorAll(".frm_field_"+c.fieldId+"_container"),f=0,h=e.length;f<h;f++)d.push(e[f].id);else if(d=[],e=P(c),e=
15
- "frm_field_"+c.fieldId+"-"+e+"-",f=document.querySelectorAll('[id^="field_'+c.inSectionKey+'-rowid-"]'),1>f.length)d.push(e+"0_container");else for(var g=0,k=f.length;g<k;g++)h=f[g].id.split("-"),3==h.length&&d.push(e+h[2]+"_container");else d.push("frm_field_"+c.fieldId+"_container");e=d.length;for(f=0;f<e;f++)c.containerId=d[f],ka(c,d[f]),la(c)}}function P(a){var b="";"0"!==a.inEmbedForm?b=a.inEmbedForm:"0"!==a.inSection&&(b=a.inSection);return b}function ka(a,b){if(a.isRepeating){var c=b.replace("_container",
16
- "").split("-");a.repeatRow=c[2]}else a.repeatRow=""}function la(a){for(var b=[],c=a.conditions.length,d=0;d<c;d++)b.push(Oa(a.conditions[d],a));c=C="any"==a.anyAll?-1<b.indexOf(!0)?a.showHide:ma(a.showHide):-1<b.indexOf(!1)?ma(a.showHide):a.showHide;b=null!==document.getElementById(a.containerId);"show"==c?"data"==a.fieldType&&a.hasOwnProperty("dataLogic")?(a={fieldId:a.fieldId,fieldKey:a.fieldKey,formId:a.formId,containerId:a.containerId,repeatRow:a.repeatRow,dataLogic:{actualValue:a.dataLogic.actualValue,
17
- fieldId:a.dataLogic.fieldId},children:"",inputType:a.inputType},"data"==a.inputType?Pa(a,b):b&&Qa(a)):!1!==B(a.containerId,a.formId)&&(I(a.containerId,a.formId),b?(b=na(a.containerId),oa(b,"divider"==a.fieldType||"form"==a.fieldType,a.formId),jQuery("#"+a.containerId).show()):(b=pa(a),oa(b,"divider"==a.fieldType||"form"==a.fieldType,a.formId))):Q(a,b)}function O(a){return"undefined"===typeof __FRMRULES||"undefined"===typeof __FRMRULES[a]?!1:__FRMRULES[a]}function Oa(a,b){var c=O(a.fieldId),d=qa(c,
18
- b);"data"==b.fieldType&&"data"==c.fieldType?(c=""===a.value?""===d||1==d.length&&""===d[0]?!1:!0:R(a.operator,a.value,d),b.dataLogic=a,b.dataLogic.actualValue=d,d=c):d=R(a.operator,a.value,d);return d}function qa(a,b){var c;if("radio"==a.inputType||"checkbox"==a.inputType)c=ra(a,b),c=document.querySelectorAll('input[name^="'+c+'"]'),c="checkbox"==a.inputType?S(c):sa(c);else if(c="",!0===a.isMultiSelect){c=ra(a,b);var d=document.querySelectorAll('[name^="'+c+'"]');c=1==d.length&&"hidden"!=d[0].type?
19
- jQuery('[name^="'+c+'"]').val():S(d)}else d="field_"+a.fieldKey,a.isRepeating&&(d+="-"+b.repeatRow),d=document.getElementById(d),null!==d&&(c=d.value);"undefined"===typeof c?c="":"string"===typeof c&&(c=c.trim());return c}function ra(a,b){return a.isRepeating?"item_meta["+("0"!==b.inEmbedForm?b.inEmbedForm:b.inSection)+"]["+b.repeatRow+"]["+a.fieldId+"]":"item_meta["+a.fieldId+"]"}function S(a){for(var b=[],c=0,d=a.length;c<d;c++)("hidden"==a[c].type||a[c].checked)&&b.push(a[c].value);0===b.length&&
20
- (b="");return b}function R(a,b,c){b=Ra(b);c=Sa(b,c);return"string"===typeof b&&"-1"!=b.indexOf("&quot;")&&R(a,b.replace("&quot;",'"'),c)?!0:{"==":function(a,b){return a==b},"!=":function(a,b){return a!=b},"<":function(a,b){return a>b},">":function(a,b){return a<b},LIKE:function(a,b){if(!b)return!1;b=J(b);a=J(a);return-1!=b.indexOf(a)},"not LIKE":function(a,b){if(!b)return!0;b=J(b);a=J(a);return-1==b.indexOf(a)}}[a](b,c)}function Ra(a){-1!==String(a).search(/^\s*(\+|-)?((\d+(\.\d+)?)|(\.\d+))\s*$/)?
21
- a=parseFloat(a):"string"===typeof a&&(a=a.trim());return a}function Sa(a,b){"undefined"===typeof b&&(b="");jQuery.isArray(b)&&-1<jQuery.inArray(a,b)&&(b=a);"number"===typeof a&&"string"===typeof b&&(b=parseFloat(b));"string"===typeof b&&(b=b.trim());return b}function J(a){"string"===typeof a?a=a.toLowerCase():"number"===typeof a&&(a=a.toString());return a}function ma(a){return"show"==a?"hide":"show"}function na(a){return document.getElementById(a).querySelectorAll('select[name^="item_meta"], textarea[name^="item_meta"], input[name^="item_meta"]')}
22
- function pa(a){if("divider"==a.fieldType){var b=[];"divider"==a.fieldType&&(b=document.querySelectorAll('[data-sectionid="'+a.fieldId+'"]'));a=b}else a="form"==a.fieldType?document.querySelectorAll('[id^="field_'+a.fieldKey+'-"]'):document.querySelectorAll('[name^="'+(a.isRepeating?"item_meta["+a.inSection+"]["+a.repeatRow+"]["+a.fieldId+"]":"item_meta["+a.fieldId+"]")+'"]');return a}function oa(a,b,c){if(a.length)for(var d,e=["checkbox","radio"],f=0;f<a.length;f++)if(!(0<f&&"undefined"!==typeof d&&
23
- d.name==a[f].name&&-1<e.indexOf(d.type)||b&&T(a[f],c))){d=a[f];var h=jQuery(d),g=h.data("frmval");if("undefined"!==typeof g){if("checkbox"==d.type||"radio"==d.type)for(var k=document.getElementsByName(d.name),m=0,l=k.length;m<l;m++)if("hidden"==k[m].type)jQuery.isArray(g)&&null!==g[m]?k[m].value=g[m]:k[m].value=g;else{if(k[m].value==g||jQuery.isArray(g)&&-1<g.indexOf(k[m].value))if(k[m].checked=!0,"radio"==k[m].type)break}else if(-1<d.name.indexOf("[]"))if(k=document.getElementsByName(d.name),jQuery.isArray(g))for(m=
24
- 0,l=g.length;m<l;m++)m in k&&(k[m].value=g[m]);else null!==k[0]&&(k[0].value=g);else g.constructor===Object&&(k=d.getAttribute("name").split("[").slice(-1)[0],null!==k&&(k=k.replace("]",""),g=g[k],"undefined"==typeof g&&(g=""))),d.value=g;"SELECT"==d.tagName&&U(d);u(h)}d=a[f];h=q(d,!1);h=V(h);!1!==h&&"lookup"!=h.fieldType&&(h.parentVals=W(h),ta(h,d));d=a[f];if(h="undefined"!==typeof __FRMCALC){h=d.type;g=!1;if("text"==h||"hidden"==h||"number"==h)g=!0;h=g}if(h){h=__FRMCALC;g=d.name;k=d.id.replace("field_",
25
- "");if(3<=g.split("][").length)for(g=k.split("-"),k="",m=0;m<g.length-1;m++)k=""===k?g[m]:k+"-"+g[m];g=k;k=null;3<=d.name.split("][").length&&(k="hidden"!=d.type?jQuery(d).closest(".frm_form_field"):jQuery(d));d=k;void 0!==h.calc[g]&&X(h,g,[],d)}d=a[f]}}function T(a,b){var c=q(a,!0);return B("frm_field_"+c+"_container",b)}function Q(a,b){if(!B(a.containerId,a.formId)){if(b){jQuery("#"+a.containerId).hide();var c=na(a.containerId)}else c=pa(a);Y(c);ua(a.containerId,a.formId)}}function Y(a){if(!(1>
26
- a.length)){for(var b,c=!0,d=0,e=a.length;d<e;d++)0<d&&b.name!=a[d].name&&!0===c&&u(jQuery(b)),c=!0,"radio"==a[d].type||"checkbox"==a[d].type?a[d].checked=!1:"SELECT"==a[d].tagName?(0===a[d].selectedIndex?c=!1:a[d].selectedIndex=0,null!==document.getElementById(a[d].id+"_chosen")&&jQuery(a[d]).trigger("chosen:updated")):a[d].value="",b=a[d];!0===c&&u(jQuery(b))}}function B(a,b){var c=!1;-1<D(b).indexOf(a)&&(c=!0);return c}function ua(a,b){var c=D(b);if(!(-1<c.indexOf(a))){c.push(a);var c=JSON.stringify(c),
27
- d=document.getElementById("frm_hide_fields_"+b);null!==d&&(d.value=c)}}function D(a){var b=[];a=document.getElementById("frm_hide_fields_"+a);return null===a?b:b=(b=a.value)?JSON.parse(b):[]}function I(a,b){var c=D(b),d=c.indexOf(a);-1<d&&(c.splice(d,1),c=JSON.stringify(c),document.getElementById("frm_hide_fields_"+b).value=c)}function fa(a,b,c){if(!("undefined"===typeof __FRMLOOKUP||"undefined"===typeof __FRMLOOKUP[a]||1>__FRMLOOKUP[a].dependents.length||null===b||"undefined"===typeof b)){a=__FRMLOOKUP[a];
28
- b=G(b[0].name);for(var d=0,e=a.dependents.length;d<e;d++)Z(a.dependents[d],b,c)}}function Z(a,b,c){a=V(a);if(!(!1===a||1>a.parents.length))if("lookup"==a.fieldType){if(""!==b.repeatRow){c=[];var d="frm_field_"+a.fieldId+"-",d=d+(b.repeatingSection+"-"+b.repeatRow+"_container");b=document.getElementById(d);null!==b&&c.push(b);b=c}else b=[],a.isRepeating?b=document.querySelectorAll(".frm_field_"+a.fieldId+"_container"):(c=document.getElementById("frm_field_"+a.fieldId+"_container"),null!==c&&b.push(c));
29
- c=0;for(d=b.length;c<d;c++){ka(a,b[c].id);var e=a,f=b[c];e.parentVals=W(e);if("select"==e.inputType)Ta(e,f);else if("radio"==e.inputType||"checkbox"==e.inputType)if(!1===e.parentVals){var h=f.getElementsByTagName("input");va(e,f);Y(h)}else Ua(e,f)}}else if("value changed"===c)for(c="field_"+a.fieldKey,c=a.isRepeating?""!==b.repeatingSection?'[id="'+c+"-"+b.repeatRow+'"]':'[id^="'+c+'-"]':'[id="'+c+'"]',b=document.querySelectorAll(c),c=0,d=b.length;c<d;c++)e=a,f=G(b[c].name),e.repeatRow=""!==f.repeatRow?
30
- f.repeatRow:"",e=a,f=b[c],e.parentVals=W(e),ta(e,f)}function V(a){return"undefined"===typeof __FRMLOOKUP||"undefined"===typeof __FRMLOOKUP[a]?!1:__FRMLOOKUP[a]}function W(a){for(var b=[],c=a.parents,d,e=0,f=c.length;e<f;e++){d=V(c[e]);d=qa(d,a);if(""===d||!1===d){b=!1;break}b[e]=d}return b}function sa(a){for(var b=!1,c=a.length,d=0;d<c;d++)if("hidden"==a[d].type||a[d].checked){b=a[d].value;break}return b}function Ta(a,b){var c=b.getElementsByTagName("SELECT")[0];if(null!==c){var d=c.value;!1===a.parentVals?
31
- (c.options.length=1,""!==d&&(c.value="",U(c),u(jQuery(c),a.fieldKey))):(Va(c),jQuery.ajax({type:"POST",url:frm_js.ajax_url,data:{action:"frm_replace_lookup_field_options",parent_fields:a.parents,parent_vals:a.parentVals,field_id:a.fieldId,nonce:frm_js.nonce},success:function(b){var d=a.fieldKey,h=c.value;b=JSON.parse(b);for(var g=c.options.length;0<g;g--)c.remove(g);for(var k=b.length,g=0;g<k;g++)c.options[g+1]=new Option(b[g],b[g],!1,!1);c.value=h;""===c.value&&(b=c.getAttribute("data-frmval"),null!==
32
- b&&(c.value=b));U(c);c.value!=h&&u(jQuery(c),d)}}))}}function U(a){-1<a.className.indexOf("frm_chzn")&&jQuery().chosen&&jQuery(a).trigger("chosen:updated")}function Va(a){a.value||(a.options.length=1,a.options[1]=new Option(frm_js.loading_text,"",!1,!1))}function Ua(a,b){var c=b.getElementsByClassName("frm_opt_container")[0],d=c.getElementsByTagName("input");Wa(b,c);var e="",e="radio"==a.inputType?sa(d):S(d);jQuery.ajax({type:"POST",url:frm_js.ajax_url,data:{action:"frm_replace_cb_radio_lookup_options",
33
- parent_fields:a.parents,parent_vals:a.parentVals,field_id:a.fieldId,row_index:a.repeatRow,current_value:e,nonce:frm_js.nonce},success:function(e){c.innerHTML=e;e=b.getElementsByClassName("frm-loading-img")[0];null!==e&&void 0!==e&&e.parentNode.removeChild(e);c.style.display="block";1==d.length&&""===d[0].value?va(a,b):!1!==B(b.id,a.formId)&&(e=O(a.fieldId),!1===e||1>e.conditions.length?(I(b.id,a.formId),jQuery("#"+b.id).show()):(e.containerId=b.id,e.repeatRow=a.repeatRow,la(e)));u(jQuery(d[0]),a.fieldKey)}})}
34
- function va(a,b){B(b.id,a.formId)||(jQuery("#"+b.id).hide(),ua(b.id,a.formId))}function ta(a,b){if(!T(b,a.formId))if(!1===a.parentVals){var c=b.getAttribute("data-frmval");null===c&&(c="");wa(a,b,c)}else jQuery.ajax({type:"POST",url:frm_js.ajax_url,data:{action:"frm_get_lookup_text_value",parent_fields:a.parents,parent_vals:a.parentVals,field_id:a.fieldId,nonce:frm_js.nonce},success:function(c){b.value!=c&&wa(a.fieldKey,b,c)}})}function wa(a,b,c){b.value=c;u(jQuery(b),a)}function Pa(a,b){if(b){var c=
35
- jQuery("#"+a.containerId);xa(c)}jQuery.ajax({type:"POST",url:frm_js.ajax_url,data:{action:"frm_fields_ajax_get_data",entry_id:a.dataLogic.actualValue,current_field:a.fieldId,hide_id:a.containerId,nonce:frm_js.nonce},success:function(d){if(b){var e=c.find(".frm_opt_container");e.html(d);var f=e.children("input"),h=f.val();ya(e);""===d||""===h?Q(a,!0):za(a,c,f)}else e="field_"+a.fieldKey,""!==a.repeatRow&&(e+="-"+a.repeatRow),e=document.getElementById(e),e.value=d,B(a.containerId,a.formId)&&I(a.containerId,
36
- a.formId),u(jQuery(e))}})}function Qa(a,b){var c=jQuery("#"+a.containerId),d=c.find('select[name^="item_meta"], textarea[name^="item_meta"], input[name^="item_meta"]'),e=Xa(d),d=d.data("frmval");xa(c);jQuery.ajax({type:"POST",url:frm_js.ajax_url,data:{action:"frm_fields_ajax_data_options",trigger_field_id:a.dataLogic.fieldId,entry_id:a.dataLogic.actualValue,field_id:a.fieldId,default_value:d,container_id:a.containerId,prev_val:e,nonce:frm_js.nonce},success:function(b){var d=c.find(".frm_opt_container");
37
- d.html(b);var e=d.find("select, input, textarea");ya(d);""===b||1==e.length&&"hidden"==e.attr("type")?Q(a,!0):za(a,c,e)}})}function xa(a){var b=a.html();-1<b.indexOf("frm-loading-img")||(a.html(b+'<span class="frm-loading-img"></span>'),a.find(".frm_opt_container").hide())}function Wa(a,b){if(!(-1<a.innerHTML.indexOf("frm-loading-img"))){b.style.display="none";var c=document.createElement("span");c.setAttribute("class","frm-loading-img");a.insertBefore(c,b.nextSibling)}}function ya(a){a.next(".frm-loading-img").remove();
38
- a.show()}function Xa(a){var b=[],c="";a.each(function(){c=this.value;"radio"===this.type||"checkbox"===this.type?!0===this.checked&&b.push(c):""!==c&&b.push(c)});0===b.length&&(b="");return b}function za(a,b,c){B(a.containerId,a.formId)&&(I(a.containerId,a.formId),b.show());c.hasClass("frm_chzn")&&aa();u(c)}function M(a,b){if("undefined"!==typeof __FRMCALC){var c=__FRMCALC,d=c.fields[a];if("undefined"!==typeof d)for(var d=d.total,e=[],f=0,h=d.length;f<h;f++){var g;g=c.calc[d[f]];var k=b.attr("name"),
39
- m=!1,l=g.field_id,n=D(g.form_id);1>n.length||("0"===g.inSection&&"0"===g.inEmbedForm?m=K(l,n):(k=G(k),K(l,n)?m=!0:Aa(l,k,n)?m=!0:"0"!==g.inSection&&"0"!==g.inEmbedForm?m=Aa(g.inSection,k,n):"0"!==g.inSection?m=K(g.inSection,n):"0"!==g.inEmbedForm&&(m=K(g.inEmbedForm,n))));g=m;!1===g&&X(c,d[f],e,b)}}}function K(a,b){return-1<b.indexOf("frm_field_"+a+"_container")}function Aa(a,b,c){var d=!1;b.repeatingSection&&(a="frm_field_"+a+"-"+b.repeatingSection,a+="-"+b.repeatRow+"_container",d=-1<c.indexOf(a));
40
- return d}function X(a,b,c,d){var e=a.calc[b],f=e.calc,h=jQuery(document.getElementById("field_"+b)),g={triggerField:d,inSection:!1,thisFieldCall:'input[id^="field_'+b+'-"]'};1>h.length&&"undefined"!==typeof d&&(g.inSection=!0,g.thisFieldId=Ya(a.fieldsWithCalc,b),h=Ba(g));if(!(1>h.length)){f=Za(e,f,a,c,g);if("text"!=e.calc_type){a=e.calc_dec;f.indexOf(").toFixed(")&&(c=f.split(").toFixed("),Ca(c[1])&&(a=c[1],f=f.replace(").toFixed("+a,"")));f=parseFloat(eval(f));if("undefined"===typeof f||isNaN(f))f=
41
- 0;Ca(a)&&(f=f.toFixed(a))}h.val()!=f&&(h.val(f),u(h,b))}}function Za(a,b,c,d,e){for(var f=0,h=a.fields.length;f<h;f++){var g={triggerField:e.triggerField,thisFieldId:a.fields[f],inSection:e.inSection,valKey:e.inSection+""+a.fields[f],thisField:c.fields[a.fields[f]],thisFieldCall:"input"+c.fieldKeys[a.fields[f]]},k=c;"checkbox"==g.thisField.type||"select"==g.thisField.type?g.thisFieldCall=g.thisFieldCall+":checked,select"+k.fieldKeys[g.thisFieldId]+" option:selected,"+g.thisFieldCall+"[type=hidden]":
42
- "radio"==g.thisField.type||"scale"==g.thisField.type?g.thisFieldCall=g.thisFieldCall+":checked,"+g.thisFieldCall+"[type=hidden]":"textarea"==g.thisField.type&&(g.thisFieldCall=g.thisFieldCall+",textarea"+k.fieldKeys[g.thisFieldId]);if("text"==a.calc_type)g.valKey="text"+g.valKey,d=$a(g,d),"undefined"===typeof d[g.valKey]&&(d[g.valKey]="");else{g.valKey="num"+g.valKey;d=ab(g,c,d);if("undefined"===typeof d[g.valKey]||isNaN(d[g.valKey]))d[g.valKey]=0;"date"==g.thisField.type&&0===d[g.valKey]&&(b="")}k=
43
- "["+g.thisFieldId+"]";k=k.replace(/([.*+?^=!:${}()|\[\]\/\\])/g,"\\$1");b=b.replace(new RegExp(k,"g"),d[g.valKey])}return b}function ab(a,b,c){if("undefined"!==typeof c[a.valKey]&&0!==c[a.valKey])return c;c[a.valKey]=0;var d=Da(a);if(!1===d)return c;d.each(function(){var d=Ea(a.thisField,this);if("date"==a.thisField.type){var f;f=b.date;var h=0;if(d)if("undefined"===typeof jQuery.datepicker){h="-";-1<f.indexOf("/")&&(h="/");f=f.split(h);var d=d.split(h),g,k;g=h=k="";for(var m=0;m<f.length;m++)if("y"==
44
- f[m])g=((new Date).getFullYear()+15).toString().substr(2,2),g=d[m]>g?"19"+d[m]:"20"+d[m];else if("yy"==f[m])g=d[m];else if("m"==f[m]||"mm"==f[m])h=d[m],2>h.length&&(h="0"+h);else if("d"==f[m]||"dd"==f[m])k=d[m],2>k.length&&(k="0"+k);h=Date.parse(g+"-"+h+"-"+k)}else h=jQuery.datepicker.parseDate(f,d);f=h;null!==f&&(c[a.valKey]=Math.ceil(f/864E5))}else{f=d;""!==f&&0!==f&&(f=f.trim(),f=parseFloat(f.replace(/,/g,"").match(/-?[\d\.]+$/)));if("undefined"===typeof f||isNaN(f)||""===f)f=0;c[a.valKey]+=f}});
45
- return c}function $a(a,b){if("undefined"!==typeof b[a.valKey]&&""!==b[a.valKey])return b;b[a.valKey]="";var c=Da(a);if(!1===c)return b;c.each(function(){var c=Ea(a.thisField,this),c=c.trim();b[a.valKey]+=c});return b}function Da(a){var b;if(!1===a.inSection)b=jQuery(a.thisFieldCall);else if(b=Ba(a),null===b||"undefined"===typeof b)b=jQuery(a.thisFieldCall);if(null===b||"undefined"===typeof b||1>b.length)b=!1;return b}function Ba(a){if("undefined"===typeof a.triggerField)return null;var b=a.triggerField.closest(".frm_repeat_sec, .frm_repeat_inline, .frm_repeat_grid");
46
- return b.length?(a=a.thisFieldCall.replace("[id=","[id^="),b.find(a)):null}function Ea(a,b){var c;c=!1;if("hidden"==b.type)""!==ba(b)&&(c=!0);else if("select"==a.type){var d=b.className;d&&-1<d.indexOf("frm_other_trigger")&&(c=!0)}else("checkbox"==a.type||"radio"==a.type)&&-1<b.id.indexOf("-other_")&&0>b.id.indexOf("-otext")&&(c=!0);c?(c=0,"select"==a.type?"hidden"==b.type?(d=!1,2<b.name.split("[").length&&(d=!0),d||(c=ba(b))):c=jQuery(b).closest(".frm_other_container").find(".frm_other_input").val():
47
- "checkbox"!=a.type&&"radio"!=a.type||"hidden"==b.type||(c=ba(b))):c="checkbox"!==b.type&&"radio"!==b.type||!b.checked?jQuery(b).val():b.value;"undefined"===typeof c&&(c="");return c}function ba(a){var b="";a=document.getElementById(a.id+"-otext");null!==a&&""!==a.value&&(b=a.value);return b}function Fa(a){var b=!1;a=jQuery(a).find(".frm_saving_draft");a.length&&(b=a.val());return b}function Ga(a){var b=!1,c=jQuery(a).find(".frm_next_page");if(c.length&&c.val()){var d=jQuery(a).find('input[name="form_id"]').val();
48
- a=jQuery(a).find('input[name="frm_page_order_'+d+'"]');a=a.length?a.val():0;if(!a||c.val()<a)b=!0}return b}function ga(a,b){var c=a.getAttribute("data-frmfile");if("hidden"==a.type&&null===c)return b;var d="",e="";if("checkbox"==a.type||"radio"==a.type)c=jQuery('input[name="'+a.name+'"]').closest(".frm_required_field").find("input:checked"),jQuery(c).each(function(){d=this.value});else if("file"==a.type||c)"undefined"===typeof c&&(c=q(a,!0),c=c.replace("file","")),"undefined"===typeof b[c]&&(d=bb(c)),
49
- e=c;else{e=a.className;if(-1!==e.indexOf("frm_pos_none"))return b;d=jQuery(a).val();if("string"!==typeof d)for(var c=d,d="",f=0;f<c.length;f++)""!==c[f]&&(d=c[f]);e=-1===e.indexOf("frm_other_input")?q(a,!0):q(a,!1)}""===d&&(""===e&&(e=q(a,!0)),e in b||(b[e]=E(a,"data-reqmsg")));return b}function bb(a){var b="";jQuery('input[name="file'+a+'"], input[name="file'+a+'[]"], input[name^="item_meta['+a+']"]').each(function(){""===b&&(b=this.value)});return b}function ha(a,b,c){var d=a.value,e=q(a,!0);if(e in
50
- b)return b;var f=0===e.indexOf("conf_");if(""!==d||f){var h=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/i,g=E(a,"data-invmsg");""!==d&&!1===h.test(d)?(b[e]=g,f&&(b[e.replace("conf_","")]="")):f&&(a=a.name.replace("conf_",""),c.filter('[name="'+a+'"]').val()!==d&&(b[e]="",b[e.replace("conf_","")]=""))}return b}function ia(a,b){var c=a.value;""!==c&&!1!==isNaN(c/1)&&(c=q(a,!0),c in b||(b[c]=E(a,
51
- "data-invmsg")));return b}function ja(a,b){var c=a.value,d=E(a,"pattern");if(""!==d&&""!==c){var e=q(a,!0);e in b||(d=new RegExp("^"+d+"$","i"),!1===d.test(c)&&(b[e]=E(a,"data-invmsg")))}return b}function E(a,b){var c=a.getAttribute(b);null===c&&(c="");return c}function cb(a,b){jQuery(a).find('input[type="submit"], input[type="button"]').attr("disabled","disabled");"undefined"==typeof b&&jQuery(a).find('input[name="frm_action"]').val();jQuery.ajax({type:"POST",url:frm_js.ajax_url,data:jQuery(a).serialize()+
52
- "&action=frm_entries_"+b+"&nonce="+frm_js.nonce,success:function(b){var d={content:"",errors:{},pass:!1};null===b&&(b=d);b=b.replace(/^\s+|\s+$/g,"");b=0===b.indexOf("{")?jQuery.parseJSON(b):d;if("undefined"!=typeof b.redirect)window.location=b.redirect;else if(""!==b.content){jQuery(a).find(".frm_ajax_loading").removeClass("frm_loading_now");var e=jQuery(a).find('input[name="form_id"]').val();jQuery(a).closest("#frm_form_"+e+"_container").replaceWith(b.content);frmFrontForm.scrollMsg(e);"function"==
53
- typeof frmThemeOverride_frmAfterSubmit&&(e=jQuery('input[name="frm_page_order_'+e+'"]').val(),d=jQuery(b.content).find('input[name="form_id"]').val(),frmThemeOverride_frmAfterSubmit(d,e,b.content,a));e=jQuery(a).find('input[name="id"]');e.length&&jQuery(document.getElementById("frm_edit_"+e.val())).find("a").addClass("frm_ajax_edited").click();jQuery(b.content).find(".frm_message").length&&ca("pageLoad");da()}else if(Object.keys(b.errors).length){jQuery(a).find('input[type="submit"], input[type="button"]').removeAttr("disabled");
54
- jQuery(a).find(".frm_ajax_loading").removeClass("frm_loading_now");d=!0;Ha();var f=!1,h;for(e in b.errors)if(h=jQuery(a).find("#frm_field_"+e+"_container"),h.length){if(!h.is(":visible")){var g=h.closest(".frm_toggle_container");g.length&&(g=g.prev(),g.hasClass("frm_trigger")||(g=g.prev(".frm_trigger")),g.click())}h.is(":visible")&&(N(h,e,b.errors),d=!1,h=jQuery(a).find("#frm_field_"+e+"_container .frm-g-recaptcha, #frm_field_"+e+"_container .g-recaptcha"),h.length&&(f=!0,h=h.data("rid"),jQuery().grecaptcha&&
55
- (h?grecaptcha.reset(h):grecaptcha.reset())))}Ia(a);!0!==f&&Ja(a,!1);d?a.submit():jQuery(a).prepend(b.error_message)}else db(a),Ja(a,!0),a.submit()},error:function(){jQuery(a).find('input[type="submit"], input[type="button"]').removeAttr("disabled");a.submit()}})}function N(a,b,c){a.length&&a.is(":visible")&&(a.addClass("frm_blank_field"),"function"==typeof frmThemeOverride_frmPlaceError?frmThemeOverride_frmPlaceError(b,c):a.append('<div class="frm_error">'+c[b]+"</div>"))}function Ha(){jQuery(".form-field").removeClass("frm_blank_field");
56
- jQuery(".form-field .frm_error").replaceWith("");jQuery(".frm_error_style").remove()}function Ia(a){var b=jQuery(a).find(".frm_blank_field:first");b.length&&frmFrontForm.scrollMsg(b,a,!0)}function db(a){var b=document.getElementById("frm_loading");null!==b&&(a=jQuery(a).find("input[type=file]").val(),"undefined"!=typeof a&&""!==a&&setTimeout(function(){jQuery(b).fadeIn("slow")},2E3))}function Ja(a,b){var c=jQuery(a).find(".frm-g-recaptcha, .g-recaptcha");c.length&&(!b||1>jQuery(a).find(".frm_next_page").length||
57
- 1>jQuery(a).find(".frm_next_page").val())&&c.closest(".frm_form_field").replaceWith('<input type="hidden" name="recaptcha_checked" value="'+frm_js.nonce+'">')}function eb(){Ka(jQuery(this),"clear")}function fb(){Ka(jQuery(this),"replace")}function Ka(a,b){var c=a.data("frmval").replace(/(\n|\r\n)/g,"\r");if(""===c||"undefined"==typeof c)return!1;var d=a.val().replace(/(\n|\r\n)/g,"\r");"replace"==b?""===d&&a.addClass("frm_default").val(c):d==c&&a.removeClass("frm_default").val("")}function gb(){var a=
58
- jQuery(this),b=a.data("eid"),c=a.data("fid");a.append('<span class="spinner" style="display:inline"></span>');jQuery.ajax({type:"POST",url:frm_js.ajax_url,data:{action:"frm_entries_send_email",entry_id:b,form_id:c,nonce:frm_js.nonce},success:function(b){a.replaceWith(b)}});return!1}function hb(a,b){google.load("visualization","1.0",{packages:[b],callback:function(){if("table"==b){var c=new google.visualization.DataTable,d=!1;-1!==jQuery.inArray("id",a.options.fields)&&(d=!0,c.addColumn("number",frm_js.id));
59
- for(var e=a.fields.length,f,h=0,g=e;h<g;h++){var k=a.fields[h];f=La(k);c.addColumn(f,k.name)}h=!1;a.options.edit_link&&(h=!0,c.addColumn("string",a.options.edit_link));g=!1;a.options.delete_link&&(g=!0,c.addColumn("string",a.options.delete_link));if(null!==a.entries){var m=a.entries.length;c.addRows(m);for(var l=0,n=0;n<m;n++){var k=0,p=a.entries[n];d&&(c.setCell(l,k,p.id),k++);for(var q=0,r=e;q<r;q++){var t=a.fields[q];f=La(t);t=p.metas[t.id];"number"!=f||null!==t&&""!==t?"boolean"==f&&(t=null===
60
- t||"false"==t||!1===t?!1:!0):t=0;c.setCell(l,k,t);k++}h&&("undefined"!==typeof p.editLink?c.setCell(l,k,'<a href="'+p.editLink+'">'+a.options.edit_link+"</a>"):c.setCell(l,k,""),k++);g&&("undefined"!==typeof p.deleteLink?c.setCell(l,k,'<a href="'+p.deleteLink+'" class="frm_delete_link" data-frmconfirm="'+a.options.confirm+'">'+a.options.delete_link+"</a>"):c.setCell(l,k,""));l++}}else for(c.addRows(1),h=k=0,g=e;h<g;h++)0<k?c.setCell(0,k,""):c.setCell(0,k,a.options.no_entries),k++;(new google.visualization.Table(document.getElementById("frm_google_table_"+
61
- a.options.form_id))).draw(c,a.graphOpts)}else ib(a)}})}function La(a){var b="string";if("number"==a.type)b="number";else if("checkbox"==a.type||"select"==a.type){var c=a.options.length;"select"==a.type&&""===a.options[0]&&(c="post_status"==a.field_options.post_field?3:c-1);1==c&&(b="boolean")}return b}function ib(a){var b=new google.visualization.DataTable,c=!1,d=!1,e=a.rows.length;if(0<e)if("table"==a.type){c=!0;b.addRows(a.rows[e-1][0]+1);for(var f=0;f<e;f++)b.setCell(a.rows[f])}else if("undefined"!=
62
- typeof a.rows[0].tooltip)for(var d=c=!0,h=0;h<e;h++){f=a.rows[h].tooltip;delete a.rows[h].tooltip;var g=Object.keys(a.rows[h]).map(function(b){return a.rows[h][b]});a.rows[h]=g;a.rows[h].push(f)}e=a.cols.length;if(c){if(0<e)for(c=0;c<e;c++)f=a.cols[c],b.addColumn(f.type,f.name);d&&(b.addColumn({type:"string",role:"tooltip"}),b.addRows(a.rows))}else{b=[[]];for(d=0;d<e;d++)b[0].push(a.cols[d].name);b=b.concat(a.rows);b=google.visualization.arrayToDataTable(b)}d=a.type.charAt(0).toUpperCase()+a.type.slice(1)+
63
- "Chart";(new google.visualization[d](document.getElementById("chart_"+a.graph_id))).draw(b,a.options)}function jb(){var a="frm_section_"+jQuery(this).data("parent")+"-"+jQuery(this).data("key"),b=jQuery(document.getElementById(a)),c=b.find("input, select, textarea");b.fadeOut("slow",function(){b.remove();c.each(function(){if("file"!=this.type){var a=q(this,!1);M(a,jQuery(this))}});"function"==typeof frmThemeOverride_frmRemoveRow&&frmThemeOverride_frmRemoveRow(a,b)});return!1}function kb(){if(!0===
64
- L)return!1;L=!0;var a=jQuery(this).data("parent"),b=0;if(0<jQuery(".frm_repeat_"+a).length)var c=jQuery(".frm_repeat_"+a+":last").attr("id").replace("frm_section_"+a+"-",""),b=-1<c.indexOf("i")?1:1+parseInt(c);jQuery.ajax({type:"POST",url:frm_js.ajax_url,dataType:"json",data:{action:"frm_add_form_row",field_id:a,i:b,nonce:frm_js.nonce},success:function(c){var e=c.html,f=jQuery(e).hide().fadeIn("slow");jQuery(".frm_repeat_"+a+":last").after(f);var h=["other"],g,k,m={repeatingSection:a.toString(),repeatRow:b.toString()};
65
- jQuery(e).find("input, select, textarea").each(function(){if("file"!=this.type){if(""===this.name)return!0;g=this.name.replace("item_meta[","").split("]")[2].replace("[","");-1==jQuery.inArray(g,h)&&!1!==this.id&&""!==this.id&&(k=jQuery("#"+this.id),h.push(g),H(g,m),Z(g,m,"value changed"),ea(g,k),fa(g,k,"value changed"),M(g,k))}});v(m.repeatRow);Ma();aa();"function"==typeof frmThemeOverride_frmAddRow&&frmThemeOverride_frmAddRow(a,c);L=!1},error:function(){L=!1}});return!1}function lb(){var a=jQuery(this),
66
- b=a.data("entryid"),c=a.data("prefix"),d=a.data("pageid"),e=a.data("formid"),f=a.data("cancel"),h=a.data("fields"),g=a.data("excludefields"),k=jQuery(document.getElementById(c+b)),m=k.html();k.html('<span class="frm-loading-img" id="'+c+b+'"></span><div class="frm_orig_content" style="display:none">'+m+"</div>");jQuery.ajax({type:"POST",url:frm_js.ajax_url,dataType:"html",data:{action:"frm_entries_edit_entry_ajax",post_id:d,entry_id:b,id:e,nonce:frm_js.nonce,fields:h,exclude_fields:g},success:function(b){k.children(".frm-loading-img").replaceWith(b);
67
- a.removeClass("frm_inplace_edit").addClass("frm_cancel_edit");a.html(f);ca("editInPlace");jQuery(document).on("change",'.frm-show-form input[name^="item_meta"], .frm-show-form select[name^="item_meta"], .frm-show-form textarea[name^="item_meta"]',F);da()}});return!1}function mb(){var a=jQuery(this),b=a.data("entryid"),c=a.data("prefix"),d=a.data("edit");a.hasClass("frm_ajax_edited")||(b=jQuery(document.getElementById(c+b)),b.children(".frm_forms").replaceWith(""),b.children(".frm_orig_content").fadeIn("slow").removeClass("frm_orig_content"));
68
- a.removeClass("frm_cancel_edit").addClass("frm_inplace_edit");a.html(d);return!1}function nb(){var a=jQuery(this),b=a.data("deleteconfirm");if(confirm(b)){var c=a.data("entryid"),d=a.data("prefix");a.replaceWith('<span class="frm-loading-img" id="frm_delete_'+c+'"></span>');jQuery.ajax({type:"POST",url:frm_js.ajax_url,data:{action:"frm_entries_destroy",entry:c,nonce:frm_js.nonce},success:function(a){"success"==a.replace(/^\s+|\s+$/g,"")?(jQuery(document.getElementById(d+c)).fadeOut("slow"),jQuery(document.getElementById("frm_delete_"+
69
- c)).fadeOut("slow")):jQuery(document.getElementById("frm_delete_"+c)).replaceWith(a)}})}return!1}function da(){"undefined"!==typeof __frmHideFields&&frmFrontForm.hidePreviouslyHiddenFields();jQuery(document).on("focusin",".frm_date",r);if("undefined"!==typeof __frmUniqueTimes)for(var a=__frmUniqueTimes,b=0;b<a.length;b++)jQuery(document.getElementById(a[b].dateID)).change(p);if("undefined"!==typeof __frmMasks)for(a=__frmMasks,b=0;b<a.length;b++)jQuery(a[b].trigger).attr("data-frmmask",a[b].mask);
70
- Ma();aa();"undefined"!==typeof __frmDepDynamicFields&&frmFrontForm.checkDependentDynamicFields(__frmDepDynamicFields);"undefined"!==typeof __frmDepLookupFields&&frmFrontForm.checkDependentLookupFields(__frmDepLookupFields);if("undefined"!==typeof __FRMCALC){(a=__FRMCALC.triggers)&&jQuery(a.join()).trigger({type:"change",selfTriggered:!0});var a=__FRMCALC.calc,b=[],c;for(c in a)if(1>a[c].fields.length){var d=document.getElementById("field_"+c);null===d||T(d,a[c].form_id)||X(__FRMCALC,c,b)}}v()}function aa(){if(jQuery().chosen){var a=
71
- {allow_single_deselect:!0};"undefined"!==typeof __frmChosen&&(a="{"+__frmChosen+"}");jQuery(".frm_chzn").chosen(a)}}function Ma(){if(jQuery().rating){var a=jQuery(".star");a.length&&a.rating()}}function ca(a){"undefined"!==typeof __frmHideOrShowFields&&frmFrontForm.hideOrShowFields(__frmHideOrShowFields,a)}function u(a,b){"undefined"===typeof b&&(b="dependent");1<a.length&&(a=a.eq(0));a.trigger({type:"change",selfTriggered:!0,frmTriggered:b})}function G(a){var b={repeatingSection:"",repeatRow:""};
72
- "undefined"!==typeof a&&3<=a.split("][").length&&(a=a.split("]["),b.repeatingSection=a[0].replace("item_meta[",""),b.repeatRow=a[1]);return b}function Na(a){a.fadeOut("slow",function(){a.remove()})}function ob(){var a=jQuery(this).data("frmconfirm");return confirm(a)}function pb(){var a=jQuery(this).data("frmtoggle");jQuery(a).is(":visible")?jQuery(a).slideUp("fast"):jQuery(a).slideDown("fast");return!1}function Ya(a,b){for(var c in a)if(a.hasOwnProperty(c)&&a[c]===b)return c;return null}function Ca(a){return!jQuery.isArray(a)&&
73
- 0<=a-parseFloat(a)+1}function qb(){Array.prototype.indexOf||(Array.prototype.indexOf=function(a,b){var c=this.length>>>0,d=Number(b)||0,d=0>d?Math.ceil(d):Math.floor(d);for(0>d&&(d+=c);d<c;d++)if(d in this&&this[d]===a)return d;return-1})}function rb(){"function"!==typeof String.prototype.trim&&(String.prototype.trim=function(){return this.replace(/^\s+|\s+$/g,"")})}function sb(){Array.prototype.filter||(Array.prototype.filter=function(a,b){if(void 0===this||null===this)throw new TypeError;var c=
74
- Object(this),d=c.length>>>0;if("function"!==typeof a)throw new TypeError;for(var e=[],f=0;f<d;f++)if(f in c){var h=c[f];a.call(b,h,f,c)&&e.push(h)}return e})}function tb(){Object.keys||(Object.keys=function(a){var b=[],c;for(c in a)a.hasOwnProperty(c)&&b.push(c);return b})}var L=!1,C="",x=[];return{init:function(){jQuery(document).off("submit.formidable",".frm-show-form");jQuery(document).on("submit.formidable",".frm-show-form",frmFrontForm.submitForm);jQuery(document).on("click",".frm_trigger",n);
75
- var a=jQuery(".frm_blank_field");a.length&&a.closest(".frm_toggle_container").prev(".frm_trigger").click();jQuery.isFunction(jQuery.fn.placeholder)?jQuery(".frm-show-form input, .frm-show-form textarea").placeholder():jQuery(".frm-show-form input[onblur], .frm-show-form textarea[onblur]").each(function(){""===jQuery(this).val()&&jQuery(this).blur()});jQuery(document).on("focus",".frm_toggle_default",eb);jQuery(document).on("blur",".frm_toggle_default",fb);jQuery(".frm_toggle_default").blur();jQuery(document.getElementById("frm_resend_email")).click(gb);
76
- jQuery(document).on("click",".frm_remove_link",w);jQuery(document).on("focusin","input[data-frmmask]",function(){jQuery(this).mask(jQuery(this).data("frmmask").toString())});jQuery(document).on("change",'.frm-show-form input[name^="item_meta"], .frm-show-form select[name^="item_meta"], .frm-show-form textarea[name^="item_meta"]',F);jQuery(document).on("click",'.frm-show-form input[type="submit"], .frm-show-form input[name="frm_prev_page"], .frm-show-form .frm_save_draft',l);jQuery(document).on("change",
77
- '.frm_other_container input[type="checkbox"], .frm_other_container input[type="radio"], .frm_other_container select',A);jQuery(document).on("click",".frm_remove_form_row",jb);jQuery(document).on("click",".frm_add_form_row",kb);jQuery(document).on("click","a[data-frmconfirm]",ob);jQuery("a[data-frmtoggle]").click(pb);jQuery(".frm_edit_link_container").on("click","a.frm_inplace_edit",lb);jQuery(".frm_edit_link_container").on("click","a.frm_cancel_edit",mb);jQuery(document).on("click",".frm_ajax_delete",
78
- nb);jQuery(".frm_month_heading, .frm_year_heading").click(function(){var a=jQuery(this).children(".ui-icon-triangle-1-e, .ui-icon-triangle-1-s");a.hasClass("ui-icon-triangle-1-e")?(a.addClass("ui-icon-triangle-1-s").removeClass("ui-icon-triangle-1-e"),jQuery(this).next(".frm_toggle_container").fadeIn("slow")):(a.addClass("ui-icon-triangle-1-e").removeClass("ui-icon-triangle-1-s"),jQuery(this).next(".frm_toggle_container").hide())});ca("pageLoad");da();qb();rb();sb();tb()},submitForm:function(a){frmFrontForm.submitFormManual(a,
79
- this)},submitFormManual:function(a,b){var c=b.classList;if((!c||c.contains("frm_pro_form"))&&!jQuery("body").hasClass("wp-admin")){a.preventDefault();var d=frmFrontForm.validateFormSubmit(b);0===Object.keys(d).length&&(jQuery(b).find(".frm_ajax_loading").addClass("frm_loading_now"),c.contains("frm_ajax_submit")?1>jQuery(b).find('input[type="file"]').length?(C=jQuery(b).find('input[name="frm_action"]').val(),frmFrontForm.checkFormErrors(b,C)):b.submit():b.submit())}},validateFormSubmit:function(a){"undefined"!=
80
- typeof tinyMCE&&jQuery(this).find(".wp-editor-wrap").length&&tinyMCE.triggerSave();x=[];var b=jQuery(a).hasClass("frm_js_validate");b&&(Fa(a)||Ga(a))&&(b=!1);b&&(frmFrontForm.getAjaxFormErrors(a),Object.keys(x).length&&frmFrontForm.addAjaxFormErrors(a));return x},getAjaxFormErrors:function(a){var b=[],c=jQuery(a).find(".frm_required_field:visible input, .frm_required_field:visible select, .frm_required_field:visible textarea").filter(":not(.frm_optional)");if(c.length)for(var d=0,e=c.length;d<e;d++)b=
81
- ga(c[d],b);c=jQuery(a).find("input[type=email]").filter(":visible");d=jQuery(a).find("input,select,textarea");if(d.length)for(var e=0,f=d.length;e<f;e++){var h=d[e];""!==h.value&&"hidden"!=h.type&&("number"==h.type?b=ia(h,b):"email"==h.type?b=ha(h,b,c):null!==h.pattern&&(b=ja(h,b)))}c=jQuery(a).find(".frm-g-recaptcha");c.length&&(d=c.data("rid"),0===grecaptcha.getResponse(d).length&&(c=c.closest(".frm_form_field").attr("id").replace("frm_field_","").replace("_container",""),b[c]=""));x=b;if("function"==
82
- typeof frmThemeOverride_jsErrors&&(C=jQuery(a).find('input[name="frm_action"]').val(),a=frmThemeOverride_jsErrors(C,a),Object.keys(a).length))for(var g in a)x[g]=a[g];return x},addAjaxFormErrors:function(a){Ha();for(var b in x){var c=jQuery(a).find("#frm_field_"+b+"_container");c.length?N(c,b,x):delete x[b]}Ia(a)},checkFormErrors:function(a,b){cb(a,b)},scrollToID:function(a){a=jQuery(document.getElementById(a));frmFrontForm.scrollMsg(a,!1)},scrollMsg:function(a,b,c){if(a=("undefined"==typeof b?jQuery(document.getElementById("frm_form_"+
83
- a+"_container")):"string"==typeof a?jQuery(b).find("#frm_field_"+a+"_container"):a).offset().top){a-=frm_js.offset;b=jQuery("html").css("margin-top");var d=jQuery("body").css("margin-top");if(b||d)a=a-parseInt(b)-parseInt(d);if(a&&window.innerHeight&&(b=document.documentElement.scrollTop||document.body.scrollTop,a>b+window.innerHeight||a<b))return"undefined"===typeof c?jQuery(window).scrollTop(a):jQuery("html,body").animate({scrollTop:a},500),!1}},savingDraft:function(a){return Fa(a)},goingToPreviousPage:function(a){return Ga(a)},
84
- hideOrShowFields:function(a,b){if("pageLoad"===b){var c=document.querySelectorAll('[id^="frm_hide_fields_"]');Y(c)}for(var c={repeatingSection:"",repeatRow:""},d=0,e=a.length;d<e;d++)H(a[d],c)},hidePreviouslyHiddenFields:function(){var a;a=[];for(var b=document.querySelectorAll('*[id^="frm_hide_fields_"]'),c=b.length,d,e=0;e<c;e++)d=b[e].id.replace("frm_hide_fields_",""),a=a.concat(D(d));b=0;for(c=a.length;b<c;b++)d=document.getElementById(a[b]),null!==d&&(d.style.display="none")},checkDependentDynamicFields:function(a){for(var b=
85
- {repeatingSection:"",repeatRow:""},c=0,d=a.length;c<d;c++)H(a[c],b)},checkDependentLookupFields:function(a){for(var b,c={repeatingSection:"",repeatRow:""},d=0,e=a.length;d<e;d++)b=a[d],Z(b,c,"value changed")},loadGoogle:function(){if("undefined"!==typeof google&&google&&google.load)for(var a=__FRMTABLES,b=Object.keys(a),c=0;c<b.length;c++)for(var d=a[b[c]],e=b[c],f=0;f<d.length;f++)hb(d[f],e);else setTimeout(frmFrontForm.loadGoogle,30)},removeUsedTimes:function(a,b){var c=jQuery(a).parents("form:first").find('input[name="id"]');
86
- jQuery.ajax({type:"POST",url:frm_js.ajax_url,dataType:"json",data:{action:"frm_fields_ajax_time_options",time_field:b,date_field:a.id,entry_id:c?c.val():"",date:jQuery(a).val(),nonce:frm_js.nonce},success:function(a){var c=jQuery(document.getElementById(b));c.find("option").removeAttr("disabled");if(a&&""!==a)for(var f in a)c.find('option[value="'+f+'"]').attr("disabled","disabled")}})},escapeHtml:function(a){return a.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,
87
- "&#039;")},invisible:function(a){jQuery(a).css("visibility","hidden")},visible:function(a){jQuery(a).css("visibility","visible")}}}var frmFrontForm=frmFrontFormJS();jQuery(document).ready(function(l){frmFrontForm.init()});function frmRecaptcha(){for(var l=jQuery(".frm-g-recaptcha"),n=0,p=l.length;n<p;n++){var r=grecaptcha.render(l[n].id,{sitekey:l[n].getAttribute("data-sitekey"),size:l[n].getAttribute("data-size"),theme:l[n].getAttribute("data-theme")});l[n].setAttribute("data-rid",r)}}
88
  function frmUpdateField(l,n,p,r,v){jQuery(document.getElementById("frm_update_field_"+l+"_"+n)).html('<span class="frm-loading-img"></span>');jQuery.ajax({type:"POST",url:frm_js.ajax_url,data:{action:"frm_entries_update_field_ajax",entry_id:l,field_id:n,value:p,nonce:frm_js.nonce},success:function(){""===r.replace(/^\s+|\s+$/g,"")?jQuery(document.getElementById("frm_update_field_"+l+"_"+n+"_"+v)).fadeOut("slow"):jQuery(document.getElementById("frm_update_field_"+l+"_"+n+"_"+v)).replaceWith(r)}})}
89
  function frmEditEntry(l,n,p,r,v,z){console.warn("DEPRECATED: function frmEditEntry in v2.0.13 use frmFrontForm.editEntry");var y=jQuery(document.getElementById("frm_edit_"+l)),w=y.html(),A=jQuery(document.getElementById(n+l)),F=A.html();A.html('<span class="frm-loading-img" id="'+n+l+'"></span><div class="frm_orig_content" style="display:none">'+F+"</div>");jQuery.ajax({type:"POST",url:frm_js.ajax_url,dataType:"html",data:{action:"frm_entries_edit_entry_ajax",post_id:p,entry_id:l,id:r,nonce:frm_js.nonce},
90
- success:function(q){A.children(".frm-loading-img").replaceWith(q);y.replaceWith('<span id="frm_edit_'+l+'"><a onclick="frmCancelEdit('+l+",'"+n+"','"+frmFrontForm.escapeHtml(w)+"',"+p+","+r+",'"+z+'\')" class="'+z+'">'+v+"</a></span>")}})}
91
  function frmCancelEdit(l,n,p,r,v,z){console.warn("DEPRECATED: function frmCancelEdit in v2.0.13 use frmFrontForm.cancelEdit");var y=jQuery(document.getElementById("frm_edit_"+l)),w=y.find("a"),A=w.html();w.hasClass("frm_ajax_edited")||(w=jQuery(document.getElementById(n+l)),w.children(".frm_forms").replaceWith(""),w.children(".frm_orig_content").fadeIn("slow").removeClass("frm_orig_content"));y.replaceWith('<a id="frm_edit_'+l+'" class="frm_edit_link '+z+'" href="javascript:frmEditEntry('+l+",'"+
92
- n+"',"+r+","+v+",'"+frmFrontForm.escapeHtml(A)+"','"+z+"')\">"+p+"</a>")}
93
  function frmDeleteEntry(l,n){console.warn("DEPRECATED: function frmDeleteEntry in v2.0.13 use frmFrontForm.deleteEntry");jQuery(document.getElementById("frm_delete_"+l)).replaceWith('<span class="frm-loading-img" id="frm_delete_'+l+'"></span>');jQuery.ajax({type:"POST",url:frm_js.ajax_url,data:{action:"frm_entries_destroy",entry:l,nonce:frm_js.nonce},success:function(p){"success"==p.replace(/^\s+|\s+$/g,"")?jQuery(document.getElementById(n+l)).fadeOut("slow"):jQuery(document.getElementById("frm_delete_"+
94
- l)).replaceWith(p)}})}function frmOnSubmit(l){console.warn("DEPRECATED: function frmOnSubmit in v2.0 use frmFrontForm.submitForm");frmFrontForm.submitForm(l,this)}
95
  function frm_resend_email(l,n){console.warn("DEPRECATED: function frm_resend_email in v2.0");$link=jQuery(document.getElementById("frm_resend_email"));$link.append('<span class="spinner" style="display:inline"></span>');jQuery.ajax({type:"POST",url:frm_js.ajax_url,data:{action:"frm_entries_send_email",entry_id:l,form_id:n,nonce:frm_js.nonce},success:function(l){$link.replaceWith(l)}})};
1
  function frmFrontFormJS(){function l(a){var b=jQuery(this),c=b.attr("type");"submit"!==c&&a.preventDefault();a=b.parents("form:first");var d=b="",e=this.name;if("frm_prev_page"===e||-1!==this.className.indexOf("frm_prev_page"))b=jQuery(a).find(".frm_next_page").attr("id").replace("frm_next_p_","");else if("frm_save_draft"===e||-1!==this.className.indexOf("frm_save_draft"))d=1;jQuery(".frm_next_page").val(b);jQuery(".frm_saving_draft").val(d);"submit"!==c&&a.trigger("submit")}function n(){jQuery(this).parent().children(".frm_toggle_container").slideToggle("fast");
2
+ jQuery(this).toggleClass("active").children(".ui-icon-triangle-1-e, .ui-icon-triangle-1-s").toggleClass("ui-icon-triangle-1-s ui-icon-triangle-1-e")}function p(){for(var a=__frmUniqueTimes,b=0;b<a.length;b++)a[b].dateID==this.id&&frmFrontForm.removeUsedTimes(this,a[b].timeID)}function r(){if(-1===this.className.indexOf("frm_custom_date")&&"undefined"!==typeof __frmDatepicker){var a=__frmDatepicker,b=this.id,c=b.split("-");c.pop();c='input[id^="'+c.join("-")+'"]';jQuery.datepicker.setDefaults(jQuery.datepicker.regional[""]);
3
+ for(var d=0,e=0;e<a.length;e++)if(a[e].triggerID=="#"+b||a[e].triggerID==c)d=e;""!==a[d].options.defaultDate&&(a[d].options.defaultDate=new Date(a[d].options.defaultDate));jQuery(this).datepicker(jQuery.extend(jQuery.datepicker.regional[a[d].locale],a[d].options))}}function v(a){if("undefined"!==typeof __frmDropzone)for(var b=__frmDropzone,c=0;c<b.length;c++)z(c,a)}function z(a,b){var c=__frmDropzone,d="#"+c[a].htmlID+"_dropzone",e=c[a].fieldName;"undefined"!==typeof b&&-1!==d.indexOf("-0_dropzone")&&
4
  (d=d.replace("-0_dropzone","-"+b+"_dropzone"),e=e.replace("[0]","["+b+"]"),delete c[a].mockFiles);d=jQuery(d);if(!(1>d.length||d.hasClass("dz-clickable"))){var f=c[a].maxFiles;if("undefined"!==typeof c[a].mockFiles){var h=c[a].mockFiles.length;0<f&&(f-=h)}var h=d.closest("form"),g=h.find('input[type="submit"], .frm_submit input[type="button"]'),k=h.find(".frm_ajax_loading");d.dropzone({url:frm_js.ajax_url,addRemoveLinks:!0,paramName:d.attr("id").replace("_dropzone",""),maxFilesize:c[a].maxFilesize,
5
+ maxFiles:f,uploadMultiple:c[a].uploadMultiple,dictCancelUpload:c[a].cancel,dictCancelUploadConfirmation:c[a].cancelConfirm,dictRemoveFile:c[a].remove,dictMaxFilesExceeded:c[a].maxFilesExceeded,fallback:function(){jQuery(this.element).closest("form").removeClass("frm_ajax_submit")},init:function(){this.on("sending",function(b,d,e){e.append("action","frm_submit_dropzone");e.append("field_id",c[a].fieldID);e.append("form_id",c[a].formID)});this.on("success",function(b,d){for(var f=jQuery.parseJSON(d),
6
+ g=0;g<f.length;g++)!0!==c[a].uploadMultiple&&jQuery('input[name="'+e+'"]').val(f[g])});this.on("successmultiple",function(b,d){for(var e=jQuery.parseJSON(d),f=0;f<b.length;f++)jQuery(b[f].previewElement).append(y(c[a],e[f]))});this.on("removedfile",function(b){!0!==c[a].uploadMultiple&&jQuery('input[name="'+e+'"]').val("")});this.on("complete",function(b){if("undefined"!==typeof b.mediaID){c[a].uploadMultiple&&jQuery(b.previewElement).append(y(c[a],b.mediaID));for(var d=b.previewElement.querySelectorAll("[data-dz-name]"),
7
+ e=0,f=d.length;e<f;e++)d[e].innerHTML='<a href="'+b.url+'">'+b.name+"</a>"}});this.on("addedfile",function(){k.addClass("frm_loading_now");g.attr("disabled","disabled")});this.on("queuecomplete",function(){k.removeClass("frm_loading_now");g.removeAttr("disabled")});this.on("removedfile",function(b){"undefined"!==typeof b.mediaID&&(jQuery(b.previewElement).remove(),this.options.maxFiles=c[a].maxFiles-this.files.length)});if("undefined"!==typeof c[a].mockFiles)for(var b=0;b<c[a].mockFiles.length;b++){var d=
8
+ {name:c[a].mockFiles[b].name,size:c[a].mockFiles[b].size,url:c[a].mockFiles[b].file_url,mediaID:c[a].mockFiles[b].id};this.emit("addedfile",d);this.emit("thumbnail",d,c[a].mockFiles[b].url);this.emit("complete",d);this.files.push(d)}}})}}function y(a,b){return'<input name="'+a.fieldName+'[]" type="hidden" value="'+b+'" data-frmfile="'+a.fieldID+'" />'}function w(){var a=jQuery(this).data("frm-remove");Oa(jQuery(this).parent(".dz-preview"));a=jQuery('input[name="'+a+'"]');a.length&&a.val("")}function A(){var a=
9
+ this.type,b=!1,c=!1;if("select-one"===a)c=!0,"frm_other_trigger"===this.options[this.selectedIndex].className&&(b=!0);else if("select-multiple"===a)for(var c=!0,d=this.options,b=!1,e=0;e<d.length;e++)if("frm_other_trigger"===d[e].className&&d[e].selected){b=!0;break}c?(a=jQuery(this).parent().children(".frm_other_input"),a.length&&(b?a[0].className=a[0].className.replace("frm_pos_none",""):(1>a[0].className.indexOf("frm_pos_none")&&(a[0].className+=" frm_pos_none"),a[0].value=""))):"radio"===a?jQuery(this).is(":checked")&&
10
  (jQuery(this).closest(".frm_radio").children(".frm_other_input").removeClass("frm_pos_none"),jQuery(this).closest(".frm_radio").siblings().children(".frm_other_input").addClass("frm_pos_none").val("")):"checkbox"===a&&(this.checked?jQuery(this).closest(".frm_checkbox").children(".frm_other_input").removeClass("frm_pos_none"):jQuery(this).closest(".frm_checkbox").children(".frm_other_input").addClass("frm_pos_none").val(""))}function F(a){var b=q(this,!1);if(b&&"undefined"!==typeof b&&(!a.frmTriggered||
11
+ a.frmTriggered!=b)&&(ea(b,jQuery(this)),a="undefined"!==typeof a.originalEvent||-1<a.currentTarget.className.indexOf("frm_chzn")?"value changed":"other",fa(b,jQuery(this),a),M(b,jQuery(this)),jQuery(this).closest("form").hasClass("frm_js_validate"))){b=[];a=jQuery(this).closest(".frm_form_field");a.hasClass("frm_required_field")&&!jQuery(this).hasClass("frm_optional")&&(b=ga(this,b));if(1>b.length)if("email"==this.type)var c=jQuery(this).closest("form").find("input[type=email]"),b=ha(this,b,c);else"number"==
12
+ this.type?b=ia(this,b):null!==this.pattern&&(b=ja(this,b));a.removeClass("frm_blank_field");a.find(".frm_error").remove();if(0<Object.keys(b).length)for(var d in b)N(a,d,b)}}function q(a,b){var c="",c=a instanceof jQuery?a.attr("name"):a.name;if(""===c)return c=a instanceof jQuery?a.data("name"):a.getAttribute("data-name"),""!==c&&c?c:0;c=c.replace("item_meta[","").replace("[]","").split("]");if(1>c.length)return 0;var c=c.filter(function(a){return""!==a}),d=c[0],e=!1;if(1===c.length||"[form"==c[1]||
13
+ "[id"==c[1])return d;if(jQuery('input[name="item_meta['+d+'][form]"]').length){if(2===c.length&&"[0"==c[1])return 0;d=c[2].replace("[","");e=!0}"other"===d&&(d=e?c[3].replace("[",""):c[1].replace("[",""));!0===b&&(d=d===c[0]?d+"-"+c[1].replace("[",""):d+"-"+c[0]+"-"+c[1].replace("[",""));return d}function ea(a,b){if(!("undefined"===typeof __FRMRULES||"undefined"===typeof __FRMRULES[a]||1>__FRMRULES[a].dependents.length||null===b||"undefined"===typeof b))for(var c=__FRMRULES[a],d=G(b[0].name),e=0,
14
+ f=c.dependents.length;e<f;e++)H(c.dependents[e],d)}function H(a,b){var c=O(a);if(!(!1===c||1>c.conditions.length)){var d;d=[];if(c.isRepeating)if(""!==b.repeatingSection){var e="frm_field_"+c.fieldId+"-",e=e+(b.repeatingSection+"-"+b.repeatRow+"_container");d.push(e)}else if("0"!==c.inEmbedForm)d=P(c),d=["frm_field_"+c.fieldId+"-"+d+"-0_container"];else if(d=[],e=P(c),null!==document.getElementById("frm_field_"+e+"_container"))for(var e=document.querySelectorAll(".frm_field_"+c.fieldId+"_container"),
15
+ f=0,h=e.length;f<h;f++)d.push(e[f].id);else if(d=[],e=P(c),e="frm_field_"+c.fieldId+"-"+e+"-",f=document.querySelectorAll('[id^="field_'+c.inSectionKey+'-rowid-"]'),1>f.length)d.push(e+"0_container");else for(var g=0,k=f.length;g<k;g++)h=f[g].id.split("-"),3==h.length&&d.push(e+h[2]+"_container");else d.push("frm_field_"+c.fieldId+"_container");e=d.length;for(f=0;f<e;f++)c.containerId=d[f],ka(c,d[f]),la(c)}}function P(a){var b="";"0"!==a.inEmbedForm?b=a.inEmbedForm:"0"!==a.inSection&&(b=a.inSection);
16
+ return b}function ka(a,b){if(a.isRepeating){var c=b.replace("_container","").split("-");a.repeatRow=c[2]}else a.repeatRow=""}function la(a){for(var b=[],c=a.conditions.length,d=0;d<c;d++)b.push(Pa(a.conditions[d],a));c=C="any"==a.anyAll?-1<b.indexOf(!0)?a.showHide:ma(a.showHide):-1<b.indexOf(!1)?ma(a.showHide):a.showHide;b=null!==document.getElementById(a.containerId);"show"==c?"data"==a.fieldType&&a.hasOwnProperty("dataLogic")?(a={fieldId:a.fieldId,fieldKey:a.fieldKey,formId:a.formId,containerId:a.containerId,
17
+ repeatRow:a.repeatRow,dataLogic:{actualValue:a.dataLogic.actualValue,fieldId:a.dataLogic.fieldId},children:"",inputType:a.inputType},"data"==a.inputType?Qa(a,b):b&&Ra(a)):!1!==B(a.containerId,a.formId)&&(I(a.containerId,a.formId),b?(b=na(a.containerId),oa(b,"divider"==a.fieldType||"form"==a.fieldType,a.formId),jQuery("#"+a.containerId).show()):(b=pa(a),oa(b,"divider"==a.fieldType||"form"==a.fieldType,a.formId))):Q(a,b)}function O(a){return"undefined"===typeof __FRMRULES||"undefined"===typeof __FRMRULES[a]?
18
+ !1:__FRMRULES[a]}function Pa(a,b){var c=O(a.fieldId),d=qa(c,b);"data"==b.fieldType&&"data"==c.fieldType?(c=""===a.value?""===d||1==d.length&&""===d[0]?!1:!0:R(a.operator,a.value,d),b.dataLogic=a,b.dataLogic.actualValue=d,d=c):d=R(a.operator,a.value,d);return d}function qa(a,b){var c;if("radio"==a.inputType||"checkbox"==a.inputType)c=ra(a,b),c=document.querySelectorAll('input[name^="'+c+'"]'),c="checkbox"==a.inputType?S(c):sa(c);else if(c="",!0===a.isMultiSelect){c=ra(a,b);var d=document.querySelectorAll('[name^="'+
19
+ c+'"]');1==d.length&&"hidden"!=d[0].type?(c=jQuery('[name^="'+c+'"]').val(),null===c&&(c="")):c=S(d)}else d="field_"+a.fieldKey,a.isRepeating&&(d+="-"+b.repeatRow),d=document.getElementById(d),null!==d&&(c=d.value);"undefined"===typeof c?c="":"string"===typeof c&&(c=c.trim());return c}function ra(a,b){return a.isRepeating?"item_meta["+("0"!==b.inEmbedForm?b.inEmbedForm:b.inSection)+"]["+b.repeatRow+"]["+a.fieldId+"]":"item_meta["+a.fieldId+"]"}function S(a){for(var b=[],c=0,d=a.length;c<d;c++)("hidden"==
20
+ a[c].type||a[c].checked)&&b.push(a[c].value);0===b.length&&(b="");return b}function R(a,b,c){b=Sa(b);c=Ta(b,c);return"string"===typeof b&&"-1"!=b.indexOf("&quot;")&&R(a,b.replace("&quot;",'"'),c)?!0:{"==":function(a,b){return a==b},"!=":function(a,b){return a!=b},"<":function(a,b){return a>b},">":function(a,b){return a<b},LIKE:function(a,b){if(!b)return!1;b=J(b);a=J(a);return-1!=b.indexOf(a)},"not LIKE":function(a,b){if(!b)return!0;b=J(b);a=J(a);return-1==b.indexOf(a)}}[a](b,c)}function Sa(a){-1!==
21
+ String(a).search(/^\s*(\+|-)?((\d+(\.\d+)?)|(\.\d+))\s*$/)?a=parseFloat(a):"string"===typeof a&&(a=a.trim());return a}function Ta(a,b){"undefined"===typeof b&&(b="");jQuery.isArray(b)&&-1<jQuery.inArray(String(a),b)&&(b=a);"number"===typeof a&&"string"===typeof b&&(b=parseFloat(b));"string"===typeof b&&(b=b.trim());return b}function J(a){"string"===typeof a?a=a.toLowerCase():"number"===typeof a&&(a=a.toString());return a}function ma(a){return"show"==a?"hide":"show"}function na(a){return document.getElementById(a).querySelectorAll('select[name^="item_meta"], textarea[name^="item_meta"], input[name^="item_meta"]')}
22
+ function pa(a){if("divider"==a.fieldType){var b=[];"divider"==a.fieldType&&(b=document.querySelectorAll('[data-sectionid="'+a.fieldId+'"]'));a=b}else a="form"==a.fieldType?document.querySelectorAll('[id^="field_'+a.fieldKey+'-"]'):document.querySelectorAll('[name^="'+(a.isRepeating?"item_meta["+a.inSection+"]["+a.repeatRow+"]["+a.fieldId+"]":"item_meta["+a.fieldId+"]")+'"]');return a}function oa(a,b,c){if(a.length)for(var d,e=["checkbox","radio"],f=0;f<a.length;f++)if(!(0<f&&"undefined"!==typeof d&&
23
+ d.name==a[f].name&&-1<e.indexOf(d.type)||b&&T(a[f],c))){d=a[f];var h=jQuery(d),g=h.data("frmval");if("undefined"!==typeof g){if("checkbox"==d.type||"radio"==d.type)for(var k=document.getElementsByName(d.name),m=0,l=k.length;m<l;m++)if("hidden"==k[m].type)jQuery.isArray(g)&&null!==g[m]?k[m].value=g[m]:k[m].value=g;else{if(k[m].value==g||jQuery.isArray(g)&&-1<g.indexOf(k[m].value))if(k[m].checked=!0,"radio"==k[m].type)break}else if(-1<d.name.indexOf("[]"))if(k=document.getElementsByName(d.name),jQuery.isArray(g))for(m=
24
+ 0,l=g.length;m<l;m++)m in k&&(k[m].value=g[m]);else null!==k[0]&&(k[0].value=g);else g.constructor===Object&&(k=d.getAttribute("name").split("[").slice(-1)[0],null!==k&&(k=k.replace("]",""),g=g[k],"undefined"==typeof g&&(g=""))),d.value=g;"SELECT"==d.tagName&&U(d);u(h)}d=a[f];h=q(d,!1);h=V(h);!1!==h&&"lookup"!=h.fieldType&&(h.parentVals=W(h),ta(h,d));d=a[f];if(h="undefined"!==typeof __FRMCALC){h=d.type;g=!1;if("text"==h||"hidden"==h||"number"==h)g=!0;h=g}if(h){h=__FRMCALC;g=d.name;k=d.id.replace("field_",
25
+ "");if(3<=g.split("][").length)for(g=k.split("-"),k="",m=0;m<g.length-1;m++)k=""===k?g[m]:k+"-"+g[m];g=k;k=null;3<=d.name.split("][").length&&(k="hidden"!=d.type?jQuery(d).closest(".frm_form_field"):jQuery(d));d=k;void 0!==h.calc[g]&&X(h,g,[],d)}d=a[f]}}function T(a,b){var c=q(a,!0);return B("frm_field_"+c+"_container",b)}function Q(a,b){if(!B(a.containerId,a.formId)){if(b){jQuery("#"+a.containerId).hide();var c=na(a.containerId)}else c=pa(a);Y(c);ua(a.containerId,a.formId)}}function Y(a){if(!(1>
26
+ a.length)){for(var b,c=!0,d=0,e=a.length;d<e;d++)0<d&&b.name!=a[d].name&&!0===c&&u(jQuery(b)),c=!0,"radio"==a[d].type||"checkbox"==a[d].type?a[d].checked=!1:"SELECT"==a[d].tagName?(0===a[d].selectedIndex?c=!1:a[d].selectedIndex=0,null!==document.getElementById(a[d].id+"_chosen")&&jQuery(a[d]).trigger("chosen:updated")):a[d].value="",b=a[d];!0===c&&u(jQuery(b))}}function B(a,b){var c=!1;-1<D(b).indexOf(a)&&(c=!0);return c}function ua(a,b){var c=D(b);if(!(-1<c.indexOf(a))){c.push(a);var c=JSON.stringify(c),
27
+ d=document.getElementById("frm_hide_fields_"+b);null!==d&&(d.value=c)}}function D(a){var b=[];a=document.getElementById("frm_hide_fields_"+a);return null===a?b:b=(b=a.value)?JSON.parse(b):[]}function I(a,b){var c=D(b),d=c.indexOf(a);-1<d&&(c.splice(d,1),c=JSON.stringify(c),document.getElementById("frm_hide_fields_"+b).value=c)}function fa(a,b,c){if(!("undefined"===typeof __FRMLOOKUP||"undefined"===typeof __FRMLOOKUP[a]||1>__FRMLOOKUP[a].dependents.length||null===b||"undefined"===typeof b)){a=__FRMLOOKUP[a];
28
+ b=G(b[0].name);for(var d=0,e=a.dependents.length;d<e;d++)Z(a.dependents[d],b,c)}}function Z(a,b,c){a=V(a);if(!(!1===a||1>a.parents.length))if("lookup"==a.fieldType){if(""!==b.repeatRow){c=[];var d="frm_field_"+a.fieldId+"-",d=d+(b.repeatingSection+"-"+b.repeatRow+"_container");b=document.getElementById(d);null!==b&&c.push(b);b=c}else b=[],a.isRepeating?b=document.querySelectorAll(".frm_field_"+a.fieldId+"_container"):(c=document.getElementById("frm_field_"+a.fieldId+"_container"),null!==c&&b.push(c));
29
+ c=0;for(d=b.length;c<d;c++){ka(a,b[c].id);var e=a,f=b[c];e.parentVals=W(e);if("select"==e.inputType)Ua(e,f);else if("radio"==e.inputType||"checkbox"==e.inputType)if(!1===e.parentVals){var h=f.getElementsByTagName("input");va(e,f);Y(h)}else Va(e,f)}}else if("value changed"===c)for(c="field_"+a.fieldKey,c=a.isRepeating?""!==b.repeatingSection?'[id="'+c+"-"+b.repeatRow+'"]':'[id^="'+c+'-"]':'[id="'+c+'"]',b=document.querySelectorAll(c),c=0,d=b.length;c<d;c++)e=a,f=G(b[c].name),e.repeatRow=""!==f.repeatRow?
30
+ f.repeatRow:"",e=a,f=b[c],e.parentVals=W(e),ta(e,f)}function V(a){return"undefined"===typeof __FRMLOOKUP||"undefined"===typeof __FRMLOOKUP[a]?!1:__FRMLOOKUP[a]}function W(a){for(var b=[],c=a.parents,d,e=0,f=c.length;e<f;e++){d=V(c[e]);d=qa(d,a);if(""===d||!1===d){b=!1;break}b[e]=d}return b}function sa(a){for(var b=!1,c=a.length,d=0;d<c;d++)if("hidden"==a[d].type||a[d].checked){b=a[d].value;break}return b}function Ua(a,b){var c=b.getElementsByTagName("SELECT")[0];if(null!==c){var d=c.value;!1===a.parentVals?
31
+ (c.options.length=1,""!==d&&(c.value="",U(c),u(jQuery(c),a.fieldKey))):(Wa(c),jQuery.ajax({type:"POST",url:frm_js.ajax_url,data:{action:"frm_replace_lookup_field_options",parent_fields:a.parents,parent_vals:a.parentVals,field_id:a.fieldId,nonce:frm_js.nonce},success:function(b){var d=a.fieldKey,h=c.value;b=JSON.parse(b);for(var g=c.options.length;0<g;g--)c.remove(g);for(var k=b.length,g=0;g<k;g++)c.options[g+1]=new Option(b[g],b[g],!1,!1);c.value=h;""===c.value&&(b=c.getAttribute("data-frmval"),null!==
32
+ b&&(c.value=b));U(c);c.value!=h&&u(jQuery(c),d)}}))}}function U(a){-1<a.className.indexOf("frm_chzn")&&jQuery().chosen&&jQuery(a).trigger("chosen:updated")}function Wa(a){a.value||(a.options.length=1,a.options[1]=new Option(frm_js.loading,"",!1,!1))}function Va(a,b){var c=b.getElementsByClassName("frm_opt_container")[0],d=c.getElementsByTagName("input");Xa(b,c);var e="",e="radio"==a.inputType?sa(d):S(d);jQuery.ajax({type:"POST",url:frm_js.ajax_url,data:{action:"frm_replace_cb_radio_lookup_options",
33
+ parent_fields:a.parents,parent_vals:a.parentVals,field_id:a.fieldId,row_index:a.repeatRow,current_value:e,nonce:frm_js.nonce},success:function(e){c.innerHTML=e;e=b.getElementsByClassName("frm-loading-img")[0];null!==e&&void 0!==e&&e.parentNode.removeChild(e);c.style.display="block";1==d.length&&""===d[0].value?va(a,b):!1!==B(b.id,a.formId)&&(e=O(a.fieldId),!1===e||1>e.conditions.length?(I(b.id,a.formId),jQuery("#"+b.id).show()):(e.containerId=b.id,e.repeatRow=a.repeatRow,la(e)));u(jQuery(d[0]),a.fieldKey)}})}
34
+ function va(a,b){B(b.id,a.formId)||(jQuery("#"+b.id).hide(),ua(b.id,a.formId))}function ta(a,b){if(!T(b,a.formId))if(!1===a.parentVals){var c=b.getAttribute("data-frmval");null===c&&(c="");wa(a,b,c)}else jQuery.ajax({type:"POST",url:frm_js.ajax_url,data:{action:"frm_get_lookup_text_value",parent_fields:a.parents,parent_vals:a.parentVals,field_id:a.fieldId,nonce:frm_js.nonce},success:function(c){b.value!=c&&wa(a.fieldKey,b,c)}})}function wa(a,b,c){b.value=c;u(jQuery(b),a)}function Qa(a,b){if(b){var c=
35
+ jQuery("#"+a.containerId);xa(c)}jQuery.ajax({type:"POST",url:frm_js.ajax_url,data:{action:"frm_fields_ajax_get_data",entry_id:a.dataLogic.actualValue,current_field:a.fieldId,hide_id:a.containerId,nonce:frm_js.nonce},success:function(d){if(b){var e=c.find(".frm_opt_container");e.html(d);var f=e.children("input"),h=f.val();ya(e);""===d||""===h?Q(a,!0):za(a,c,f,!0)}else e="field_"+a.fieldKey,""!==a.repeatRow&&(e+="-"+a.repeatRow),e=document.getElementById(e),e.value=d,B(a.containerId,a.formId)&&I(a.containerId,
36
+ a.formId),u(jQuery(e))}})}function Ra(a,b){var c=jQuery("#"+a.containerId),d=c.find('select[name^="item_meta"], input[name^="item_meta"]'),e=Aa(d),d=d.data("frmval");xa(c);jQuery.ajax({type:"POST",url:frm_js.ajax_url,data:{action:"frm_fields_ajax_data_options",trigger_field_id:a.dataLogic.fieldId,entry_id:a.dataLogic.actualValue,field_id:a.fieldId,default_value:d,container_id:a.containerId,prev_val:e,nonce:frm_js.nonce},success:function(b){var d=c.find(".frm_opt_container");d.html(b);var g=d.find('select, input[type="checkbox"], input[type="radio"]');
37
+ ya(d);""===b||1>g.length?Q(a,!0):(b=Aa(g),za(a,c,g,e!==b))}})}function xa(a){var b=a.html();-1<b.indexOf("frm-loading-img")||(a.html(b+'<span class="frm-loading-img"></span>'),a.find(".frm_opt_container").hide())}function Xa(a,b){if(!(-1<a.innerHTML.indexOf("frm-loading-img"))){b.style.display="none";var c=document.createElement("span");c.setAttribute("class","frm-loading-img");a.insertBefore(c,b.nextSibling)}}function ya(a){a.parent().children(".frm-loading-img").remove();a.show()}function Aa(a){var b=
38
+ [],c="";a.each(function(){c=this.value;"radio"===this.type||"checkbox"===this.type?!0===this.checked&&b.push(c):""!==c&&b.push(c)});0===b.length&&(b="");return b}function za(a,b,c,d){B(a.containerId,a.formId)&&(I(a.containerId,a.formId),b.show());c.hasClass("frm_chzn")&&aa();!0===d&&u(c)}function M(a,b){if("undefined"!==typeof __FRMCALC){var c=__FRMCALC,d=c.fields[a];if("undefined"!==typeof d)for(var d=d.total,e=[],f=0,h=d.length;f<h;f++){var g;g=c.calc[d[f]];var k=b.attr("name"),m=!1,l=g.field_id,
39
+ n=D(g.form_id);1>n.length||("0"===g.inSection&&"0"===g.inEmbedForm?m=K(l,n):(k=G(k),K(l,n)?m=!0:Ba(l,k,n)?m=!0:"0"!==g.inSection&&"0"!==g.inEmbedForm?m=Ba(g.inSection,k,n):"0"!==g.inSection?m=K(g.inSection,n):"0"!==g.inEmbedForm&&(m=K(g.inEmbedForm,n))));g=m;!1===g&&X(c,d[f],e,b)}}}function K(a,b){return-1<b.indexOf("frm_field_"+a+"_container")}function Ba(a,b,c){var d=!1;b.repeatingSection&&(a="frm_field_"+a+"-"+b.repeatingSection,a+="-"+b.repeatRow+"_container",d=-1<c.indexOf(a));return d}function X(a,
40
+ b,c,d){var e=a.calc[b],f=e.calc,h=jQuery(document.getElementById("field_"+b)),g={triggerField:d,inSection:!1,thisFieldCall:'input[id^="field_'+b+'-"]'};1>h.length&&"undefined"!==typeof d&&(g.inSection=!0,g.thisFieldId=Ya(a.fieldsWithCalc,b),h=Ca(g));if(!(1>h.length)){f=Za(e,f,a,c,g);if("text"!=e.calc_type){a=e.calc_dec;f.indexOf(").toFixed(")&&(c=f.split(").toFixed("),Da(c[1])&&(a=c[1],f=f.replace(").toFixed("+a,"")));f=parseFloat(eval(f));if("undefined"===typeof f||isNaN(f))f=0;Da(a)&&(f=f.toFixed(a))}h.val()!=
41
+ f&&(h.val(f),u(h,b))}}function Za(a,b,c,d,e){for(var f=0,h=a.fields.length;f<h;f++){var g={triggerField:e.triggerField,thisFieldId:a.fields[f],inSection:e.inSection,valKey:e.inSection+""+a.fields[f],thisField:c.fields[a.fields[f]],thisFieldCall:"input"+c.fieldKeys[a.fields[f]]},k=c;"checkbox"==g.thisField.type||"select"==g.thisField.type?g.thisFieldCall=g.thisFieldCall+":checked,select"+k.fieldKeys[g.thisFieldId]+" option:selected,"+g.thisFieldCall+"[type=hidden]":"radio"==g.thisField.type||"scale"==
42
+ g.thisField.type?g.thisFieldCall=g.thisFieldCall+":checked,"+g.thisFieldCall+"[type=hidden]":"textarea"==g.thisField.type&&(g.thisFieldCall=g.thisFieldCall+",textarea"+k.fieldKeys[g.thisFieldId]);if("text"==a.calc_type)g.valKey="text"+g.valKey,d=$a(g,d),"undefined"===typeof d[g.valKey]&&(d[g.valKey]="");else{g.valKey="num"+g.valKey;d=ab(g,c,d);if("undefined"===typeof d[g.valKey]||isNaN(d[g.valKey]))d[g.valKey]=0;"date"==g.thisField.type&&0===d[g.valKey]&&(b="")}k="["+g.thisFieldId+"]";k=k.replace(/([.*+?^=!:${}()|\[\]\/\\])/g,
43
+ "\\$1");b=b.replace(new RegExp(k,"g"),d[g.valKey])}return b}function ab(a,b,c){if("undefined"!==typeof c[a.valKey]&&0!==c[a.valKey])return c;c[a.valKey]=0;var d=Ea(a);if(!1===d)return c;d.each(function(){var d=Fa(a.thisField,this);if("date"==a.thisField.type){var f;f=b.date;var h=0;if(d)if("undefined"===typeof jQuery.datepicker){h="-";-1<f.indexOf("/")&&(h="/");f=f.split(h);var d=d.split(h),g,k;g=h=k="";for(var m=0;m<f.length;m++)if("y"==f[m])g=((new Date).getFullYear()+15).toString().substr(2,2),
44
+ g=d[m]>g?"19"+d[m]:"20"+d[m];else if("yy"==f[m])g=d[m];else if("m"==f[m]||"mm"==f[m])h=d[m],2>h.length&&(h="0"+h);else if("d"==f[m]||"dd"==f[m])k=d[m],2>k.length&&(k="0"+k);h=Date.parse(g+"-"+h+"-"+k)}else h=jQuery.datepicker.parseDate(f,d);f=h;null!==f&&(c[a.valKey]=Math.ceil(f/864E5))}else{f=d;""!==f&&0!==f&&(f=f.trim(),f=parseFloat(f.replace(/,/g,"").match(/-?[\d\.]+$/)));if("undefined"===typeof f||isNaN(f)||""===f)f=0;c[a.valKey]+=f}});return c}function $a(a,b){if("undefined"!==typeof b[a.valKey]&&
45
+ ""!==b[a.valKey])return b;b[a.valKey]="";var c=Ea(a);if(!1===c)return b;c.each(function(){var c=Fa(a.thisField,this),c=c.trim();b[a.valKey]+=c});return b}function Ea(a){var b;if(!1===a.inSection)b=jQuery(a.thisFieldCall);else if(b=Ca(a),null===b||"undefined"===typeof b)b=jQuery(a.thisFieldCall);if(null===b||"undefined"===typeof b||1>b.length)b=!1;return b}function Ca(a){if("undefined"===typeof a.triggerField)return null;var b=a.triggerField.closest(".frm_repeat_sec, .frm_repeat_inline, .frm_repeat_grid");
46
+ return b.length?(a=a.thisFieldCall.replace("[id=","[id^="),b.find(a)):null}function Fa(a,b){var c;c=!1;if("hidden"==b.type)""!==ba(b)&&(c=!0);else if("select"==a.type){var d=b.className;d&&-1<d.indexOf("frm_other_trigger")&&(c=!0)}else("checkbox"==a.type||"radio"==a.type)&&-1<b.id.indexOf("-other_")&&0>b.id.indexOf("-otext")&&(c=!0);c?(c=0,"select"==a.type?"hidden"==b.type?(d=!1,2<b.name.split("[").length&&(d=!0),d||(c=ba(b))):c=jQuery(b).closest(".frm_other_container").find(".frm_other_input").val():
47
+ "checkbox"!=a.type&&"radio"!=a.type||"hidden"==b.type||(c=ba(b))):c="checkbox"!==b.type&&"radio"!==b.type||!b.checked?jQuery(b).val():b.value;"undefined"===typeof c&&(c="");return c}function ba(a){var b="";a=document.getElementById(a.id+"-otext");null!==a&&""!==a.value&&(b=a.value);return b}function Ga(a){var b=!1;a=jQuery(a).find(".frm_saving_draft");a.length&&(b=a.val());return b}function Ha(a){var b=!1,c=jQuery(a).find(".frm_next_page");if(c.length&&c.val()){var d=jQuery(a).find('input[name="form_id"]').val();
48
+ a=jQuery(a).find('input[name="frm_page_order_'+d+'"]');a=a.length?a.val():0;if(!a||c.val()<a)b=!0}return b}function ga(a,b){var c=a.getAttribute("data-frmfile");if("hidden"==a.type&&null===c)return b;var d="",e="";if("checkbox"==a.type||"radio"==a.type)c=jQuery('input[name="'+a.name+'"]').closest(".frm_required_field").find("input:checked"),jQuery(c).each(function(){d=this.value});else if("file"==a.type||c)"undefined"===typeof c&&(c=q(a,!0),c=c.replace("file","")),"undefined"===typeof b[c]&&(d=bb(c)),
49
+ e=c;else{e=a.className;if(-1!==e.indexOf("frm_pos_none"))return b;d=jQuery(a).val();if("string"!==typeof d)for(var c=d,d="",f=0;f<c.length;f++)""!==c[f]&&(d=c[f]);e=-1===e.indexOf("frm_other_input")?q(a,!0):q(a,!1)}""===d&&(""===e&&(e=q(a,!0)),e in b||(b[e]=E(a,"data-reqmsg")));return b}function bb(a){var b="";jQuery('input[name="file'+a+'"], input[name="file'+a+'[]"], input[name^="item_meta['+a+']"]').each(function(){""===b&&(b=this.value)});return b}function ha(a,b,c){var d=a.value,e=q(a,!0);if(e in
50
+ b)return b;var f=0===e.indexOf("conf_");if(""!==d||f){var h=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/i,g=E(a,"data-invmsg");""!==d&&!1===h.test(d)?(b[e]=g,f&&(b[e.replace("conf_","")]="")):f&&(a=a.name.replace("conf_",""),c.filter('[name="'+a+'"]').val()!==d&&(b[e]="",b[e.replace("conf_","")]=""))}return b}function ia(a,b){var c=a.value;""!==c&&!1!==isNaN(c/1)&&(c=q(a,!0),c in b||(b[c]=E(a,
51
+ "data-invmsg")));return b}function ja(a,b){var c=a.value,d=E(a,"pattern");if(""!==d&&""!==c){var e=q(a,!0);e in b||(d=new RegExp("^"+d+"$","i"),!1===d.test(c)&&(b[e]=E(a,"data-invmsg")))}return b}function E(a,b){var c=a.getAttribute(b);null===c&&(c="");return c}function cb(a,b){jQuery(a).find('input[type="submit"], input[type="button"]').attr("disabled","disabled");"undefined"==typeof b&&jQuery(a).find('input[name="frm_action"]').val();jQuery.ajax({type:"POST",url:frm_js.ajax_url,data:jQuery(a).serialize()+
52
+ "&action=frm_entries_"+b+"&nonce="+frm_js.nonce,success:function(b){var d={content:"",errors:{},pass:!1};null===b&&(b=d);b=b.replace(/^\s+|\s+$/g,"");b=0===b.indexOf("{")?jQuery.parseJSON(b):d;if("undefined"!=typeof b.redirect)window.location=b.redirect;else if(""!==b.content){jQuery(a).find(".frm_ajax_loading").removeClass("frm_loading_now");var e=jQuery(a).find('input[name="form_id"]').val();jQuery(a).closest("#frm_form_"+e+"_container").replaceWith(b.content);frmFrontForm.scrollMsg(e);"function"==
53
+ typeof frmThemeOverride_frmAfterSubmit&&(e=jQuery('input[name="frm_page_order_'+e+'"]').val(),d=jQuery(b.content).find('input[name="form_id"]').val(),frmThemeOverride_frmAfterSubmit(d,e,b.content,a));e=jQuery(a).find('input[name="id"]');e.length&&jQuery(document.getElementById("frm_edit_"+e.val())).find("a").addClass("frm_ajax_edited").click();jQuery(b.content).find(".frm_message").length&&ca("pageLoad");da()}else if(Object.keys(b.errors).length){jQuery(a).find('input[type="submit"], input[type="button"]').removeAttr("disabled");
54
+ jQuery(a).find(".frm_ajax_loading").removeClass("frm_loading_now");d=!0;Ia();var f=!1,h;for(e in b.errors)if(h=jQuery(a).find("#frm_field_"+e+"_container"),h.length){if(!h.is(":visible")){var g=h.closest(".frm_toggle_container");g.length&&(g=g.prev(),g.hasClass("frm_trigger")||(g=g.prev(".frm_trigger")),g.click())}h.is(":visible")&&(N(h,e,b.errors),d=!1,h=jQuery(a).find("#frm_field_"+e+"_container .frm-g-recaptcha, #frm_field_"+e+"_container .g-recaptcha"),h.length&&(f=!0,h=h.data("rid"),jQuery().grecaptcha&&
55
+ (h?grecaptcha.reset(h):grecaptcha.reset())))}Ja(a);!0!==f&&Ka(a,!1);d?a.submit():jQuery(a).prepend(b.error_message)}else db(a),Ka(a,!0),a.submit()},error:function(){jQuery(a).find('input[type="submit"], input[type="button"]').removeAttr("disabled");a.submit()}})}function N(a,b,c){a.length&&a.is(":visible")&&(a.addClass("frm_blank_field"),"function"==typeof frmThemeOverride_frmPlaceError?frmThemeOverride_frmPlaceError(b,c):a.append('<div class="frm_error">'+c[b]+"</div>"))}function Ia(){jQuery(".form-field").removeClass("frm_blank_field");
56
+ jQuery(".form-field .frm_error").replaceWith("");jQuery(".frm_error_style").remove()}function Ja(a){var b=jQuery(a).find(".frm_blank_field:first");b.length&&frmFrontForm.scrollMsg(b,a,!0)}function db(a){var b=document.getElementById("frm_loading");null!==b&&(a=jQuery(a).find("input[type=file]").val(),"undefined"!=typeof a&&""!==a&&setTimeout(function(){jQuery(b).fadeIn("slow")},2E3))}function Ka(a,b){var c=jQuery(a).find(".frm-g-recaptcha, .g-recaptcha");c.length&&(!b||1>jQuery(a).find(".frm_next_page").length||
57
+ 1>jQuery(a).find(".frm_next_page").val())&&c.closest(".frm_form_field").replaceWith('<input type="hidden" name="recaptcha_checked" value="'+frm_js.nonce+'">')}function eb(){La(jQuery(this),"clear")}function fb(){La(jQuery(this),"replace")}function La(a,b){var c=a.data("frmval").replace(/(\n|\r\n)/g,"\r");if(""===c||"undefined"==typeof c)return!1;var d=a.val().replace(/(\n|\r\n)/g,"\r");"replace"==b?""===d&&a.addClass("frm_default").val(c):d==c&&a.removeClass("frm_default").val("")}function gb(){var a=
58
+ jQuery(this),b=a.data("eid"),c=a.data("fid");a.append('<span class="spinner" style="display:inline"></span>');jQuery.ajax({type:"POST",url:frm_js.ajax_url,data:{action:"frm_entries_send_email",entry_id:b,form_id:c,nonce:frm_js.nonce},success:function(b){a.replaceWith(b)}});return!1}function hb(a,b){google.load("visualization","1.0",{packages:[b],callback:function(){if("table"==b){var c=new google.visualization.DataTable,d=!1;-1!==jQuery.inArray("id",a.options.fields)&&(d=!0,c.addColumn("number",frm_js.id));
59
+ for(var e=a.fields.length,f,h=0,g=e;h<g;h++){var k=a.fields[h];f=Ma(k);c.addColumn(f,k.name)}h=!1;a.options.edit_link&&(h=!0,c.addColumn("string",a.options.edit_link));g=!1;a.options.delete_link&&(g=!0,c.addColumn("string",a.options.delete_link));if(null!==a.entries){var m=a.entries.length;c.addRows(m);for(var l=0,n=0;n<m;n++){var k=0,p=a.entries[n];d&&(c.setCell(l,k,p.id),k++);for(var q=0,r=e;q<r;q++){var t=a.fields[q];f=Ma(t);t=p.metas[t.id];"number"!=f||null!==t&&""!==t?"boolean"==f&&(t=null===
60
+ t||"false"==t||!1===t?!1:!0):t=0;c.setCell(l,k,t);k++}h&&("undefined"!==typeof p.editLink?c.setCell(l,k,'<a href="'+p.editLink+'">'+a.options.edit_link+"</a>"):c.setCell(l,k,""),k++);g&&("undefined"!==typeof p.deleteLink?c.setCell(l,k,'<a href="'+p.deleteLink+'" class="frm_delete_link" data-frmconfirm="'+a.options.confirm+'">'+a.options.delete_link+"</a>"):c.setCell(l,k,""));l++}}else for(c.addRows(1),h=k=0,g=e;h<g;h++)0<k?c.setCell(0,k,""):c.setCell(0,k,a.options.no_entries),k++;(new google.visualization.Table(document.getElementById("frm_google_table_"+
61
+ a.options.form_id))).draw(c,a.graphOpts)}else ib(a)}})}function Ma(a){var b="string";if("number"==a.type)b="number";else if("checkbox"==a.type||"select"==a.type){var c=a.options.length;"select"==a.type&&""===a.options[0]&&(c="post_status"==a.field_options.post_field?3:c-1);1==c&&(b="boolean")}return b}function ib(a){var b=new google.visualization.DataTable,c=!1,d=!1,e=a.rows.length;if(0<e)if("table"==a.type){c=!0;b.addRows(a.rows[e-1][0]+1);for(var f=0;f<e;f++)b.setCell(a.rows[f])}else if("undefined"!=
62
+ typeof a.rows[0].tooltip)for(var d=c=!0,h=0;h<e;h++){f=a.rows[h].tooltip;delete a.rows[h].tooltip;var g=Object.keys(a.rows[h]).map(function(b){return a.rows[h][b]});a.rows[h]=g;a.rows[h].push(f)}e=a.cols.length;if(c){if(0<e)for(c=0;c<e;c++)f=a.cols[c],b.addColumn(f.type,f.name);d&&(b.addColumn({type:"string",role:"tooltip"}),b.addRows(a.rows))}else{b=[[]];for(d=0;d<e;d++)b[0].push(a.cols[d].name);b=b.concat(a.rows);b=google.visualization.arrayToDataTable(b)}d=a.type.charAt(0).toUpperCase()+a.type.slice(1)+
63
+ "Chart";(new google.visualization[d](document.getElementById("chart_"+a.graph_id))).draw(b,a.options)}function jb(){var a="frm_section_"+jQuery(this).data("parent")+"-"+jQuery(this).data("key"),b=jQuery(document.getElementById(a)),c=b.find("input, select, textarea");b.fadeOut("slow",function(){b.remove();c.each(function(){if("file"!=this.type){var a=q(this,!1);M(a,jQuery(this))}});"function"==typeof frmThemeOverride_frmRemoveRow&&frmThemeOverride_frmRemoveRow(a,b)});return!1}function kb(){if(!0===
64
+ L)return!1;L=!0;var a=jQuery(this).data("parent"),b=0;if(0<jQuery(".frm_repeat_"+a).length)var c=jQuery(".frm_repeat_"+a+":last").attr("id").replace("frm_section_"+a+"-",""),b=-1<c.indexOf("i")?1:1+parseInt(c);jQuery.ajax({type:"POST",url:frm_js.ajax_url,dataType:"json",data:{action:"frm_add_form_row",field_id:a,i:b,nonce:frm_js.nonce},success:function(c){var e=c.html,f=jQuery(e).hide().fadeIn("slow");jQuery(".frm_repeat_"+a+":last").after(f);var h=["other"],g,k,m={repeatingSection:a.toString(),repeatRow:b.toString()};
65
+ jQuery(e).find("input, select, textarea").each(function(){if("file"!=this.type){if(""===this.name)return!0;g=this.name.replace("item_meta[","").split("]")[2].replace("[","");-1==jQuery.inArray(g,h)&&!1!==this.id&&""!==this.id&&(k=jQuery("#"+this.id),h.push(g),H(g,m),Z(g,m,"value changed"),ea(g,k),fa(g,k,"value changed"),M(g,k))}});v(m.repeatRow);Na();aa();"function"==typeof frmThemeOverride_frmAddRow&&frmThemeOverride_frmAddRow(a,c);L=!1},error:function(){L=!1}});return!1}function lb(){var a=jQuery(this),
66
+ b=a.data("entryid"),c=a.data("prefix"),d=a.data("pageid"),e=a.data("formid"),f=a.data("cancel"),h=a.data("fields"),g=a.data("excludefields"),k=jQuery(document.getElementById(c+b)),m=k.html();k.html('<span class="frm-loading-img" id="'+c+b+'"></span><div class="frm_orig_content" style="display:none">'+m+"</div>");jQuery.ajax({type:"POST",url:frm_js.ajax_url,dataType:"html",data:{action:"frm_entries_edit_entry_ajax",post_id:d,entry_id:b,id:e,nonce:frm_js.nonce,fields:h,exclude_fields:g},success:function(b){k.children(".frm-loading-img").replaceWith(b);
67
+ a.removeClass("frm_inplace_edit").addClass("frm_cancel_edit");a.html(f);ca("editInPlace");jQuery(document).on("change",'.frm-show-form input[name^="item_meta"], .frm-show-form select[name^="item_meta"], .frm-show-form textarea[name^="item_meta"]',F);da()}});return!1}function mb(){var a=jQuery(this),b=a.data("entryid"),c=a.data("prefix"),d=a.data("edit");a.hasClass("frm_ajax_edited")||(b=jQuery(document.getElementById(c+b)),b.children(".frm_forms").replaceWith(""),b.children(".frm_orig_content").fadeIn("slow").removeClass("frm_orig_content"));
68
+ a.removeClass("frm_cancel_edit").addClass("frm_inplace_edit");a.html(d);return!1}function nb(){var a=jQuery(this),b=a.data("deleteconfirm");if(confirm(b)){var c=a.data("entryid"),d=a.data("prefix");a.replaceWith('<span class="frm-loading-img" id="frm_delete_'+c+'"></span>');jQuery.ajax({type:"POST",url:frm_js.ajax_url,data:{action:"frm_entries_destroy",entry:c,nonce:frm_js.nonce},success:function(a){"success"==a.replace(/^\s+|\s+$/g,"")?(jQuery(document.getElementById(d+c)).fadeOut("slow"),jQuery(document.getElementById("frm_delete_"+
69
+ c)).fadeOut("slow")):jQuery(document.getElementById("frm_delete_"+c)).replaceWith(a)}})}return!1}function da(){"undefined"!==typeof __frmHideFields&&frmFrontForm.hidePreviouslyHiddenFields();jQuery(document).on("focusin",".frm_date",r);if("undefined"!==typeof __frmUniqueTimes)for(var a=__frmUniqueTimes,b=0;b<a.length;b++)jQuery(document.getElementById(a[b].dateID)).change(p);if("undefined"!==typeof __frmMasks)for(a=__frmMasks,b=0;b<a.length;b++)jQuery(a[b].trigger).attr("data-frmmask",a[b].mask);
70
+ Na();aa();"undefined"!==typeof __frmDepDynamicFields&&frmFrontForm.checkDependentDynamicFields(__frmDepDynamicFields);"undefined"!==typeof __frmDepLookupFields&&frmFrontForm.checkDependentLookupFields(__frmDepLookupFields);if("undefined"!==typeof __FRMCALC){(a=__FRMCALC.triggers)&&jQuery(a.join()).trigger({type:"change",selfTriggered:!0});var a=__FRMCALC.calc,b=[],c;for(c in a)if(1>a[c].fields.length){var d=document.getElementById("field_"+c);null===d||T(d,a[c].form_id)||X(__FRMCALC,c,b)}}v()}function aa(){if(jQuery().chosen){var a=
71
+ {allow_single_deselect:!0};"undefined"!==typeof __frmChosen&&(a="{"+__frmChosen+"}");jQuery(".frm_chzn").chosen(a)}}function Na(){if(jQuery().rating){var a=jQuery(".star");a.length&&a.rating()}}function ca(a){"undefined"!==typeof __frmHideOrShowFields&&frmFrontForm.hideOrShowFields(__frmHideOrShowFields,a)}function u(a,b){"undefined"===typeof b&&(b="dependent");1<a.length&&(a=a.eq(0));a.trigger({type:"change",selfTriggered:!0,frmTriggered:b})}function G(a){var b={repeatingSection:"",repeatRow:""};
72
+ "undefined"!==typeof a&&3<=a.split("][").length&&(a=a.split("]["),b.repeatingSection=a[0].replace("item_meta[",""),b.repeatRow=a[1]);return b}function Oa(a){a.fadeOut("slow",function(){a.remove()})}function ob(){var a=jQuery(this).data("frmconfirm");return confirm(a)}function pb(){var a=jQuery(this).data("frmtoggle");jQuery(a).is(":visible")?jQuery(a).slideUp("fast"):jQuery(a).slideDown("fast");return!1}function Ya(a,b){for(var c in a)if(a.hasOwnProperty(c)&&a[c]===b)return c;return null}function Da(a){return!jQuery.isArray(a)&&
73
+ 0<=a-parseFloat(a)+1}function qb(){Array.prototype.indexOf||(Array.prototype.indexOf=function(a,b){var c=this.length>>>0,d=Number(b)||0,d=0>d?Math.ceil(d):Math.floor(d);for(0>d&&(d+=c);d<c;d++)if(d in this&&this[d]===a)return d;return-1})}function rb(){"function"!==typeof String.prototype.trim&&(String.prototype.trim=function(){return this.replace(/^\s+|\s+$/g,"")})}function sb(){Array.prototype.filter||(Array.prototype.filter=function(a,b){if(void 0===this||null===this)throw new TypeError;var c=
74
+ Object(this),d=c.length>>>0;if("function"!==typeof a)throw new TypeError;for(var e=[],f=0;f<d;f++)if(f in c){var h=c[f];a.call(b,h,f,c)&&e.push(h)}return e})}function tb(){Object.keys||(Object.keys=function(a){var b=[],c;for(c in a)a.hasOwnProperty(c)&&b.push(c);return b})}var L=!1,C="",x=[];return{init:function(){jQuery(document).off("submit.formidable",".frm-show-form");jQuery(document).on("submit.formidable",".frm-show-form",frmFrontForm.submitForm);jQuery(document).on("click",".frm_trigger",n);
75
+ var a=jQuery(".frm_blank_field");a.length&&a.closest(".frm_toggle_container").prev(".frm_trigger").click();jQuery.isFunction(jQuery.fn.placeholder)?jQuery(".frm-show-form input, .frm-show-form textarea").placeholder():jQuery(".frm-show-form input[onblur], .frm-show-form textarea[onblur]").each(function(){""===jQuery(this).val()&&jQuery(this).blur()});jQuery(document).on("focus",".frm_toggle_default",eb);jQuery(document).on("blur",".frm_toggle_default",fb);jQuery(".frm_toggle_default").blur();jQuery(document.getElementById("frm_resend_email")).click(gb);
76
+ jQuery(document).on("click",".frm_remove_link",w);jQuery(document).on("focusin","input[data-frmmask]",function(){jQuery(this).mask(jQuery(this).data("frmmask").toString())});jQuery(document).on("change",'.frm-show-form input[name^="item_meta"], .frm-show-form select[name^="item_meta"], .frm-show-form textarea[name^="item_meta"]',F);jQuery(document).on("click",'.frm-show-form input[type="submit"], .frm-show-form input[name="frm_prev_page"], .frm-show-form .frm_save_draft',l);jQuery(document).on("change",
77
+ '.frm_other_container input[type="checkbox"], .frm_other_container input[type="radio"], .frm_other_container select',A);jQuery(document).on("click",".frm_remove_form_row",jb);jQuery(document).on("click",".frm_add_form_row",kb);jQuery(document).on("click","a[data-frmconfirm]",ob);jQuery("a[data-frmtoggle]").click(pb);jQuery(".frm_edit_link_container").on("click","a.frm_inplace_edit",lb);jQuery(".frm_edit_link_container").on("click","a.frm_cancel_edit",mb);jQuery(document).on("click",".frm_ajax_delete",
78
+ nb);jQuery(".frm_month_heading, .frm_year_heading").click(function(){var a=jQuery(this).children(".ui-icon-triangle-1-e, .ui-icon-triangle-1-s");a.hasClass("ui-icon-triangle-1-e")?(a.addClass("ui-icon-triangle-1-s").removeClass("ui-icon-triangle-1-e"),jQuery(this).next(".frm_toggle_container").fadeIn("slow")):(a.addClass("ui-icon-triangle-1-e").removeClass("ui-icon-triangle-1-s"),jQuery(this).next(".frm_toggle_container").hide())});ca("pageLoad");da();qb();rb();sb();tb()},submitForm:function(a){frmFrontForm.submitFormManual(a,
79
+ this)},submitFormManual:function(a,b){var c=b.className.trim().split(/\s+/gi);if((!c||-1<c.indexOf("frm_pro_form"))&&!jQuery("body").hasClass("wp-admin")){a.preventDefault();var d=frmFrontForm.validateFormSubmit(b);0===Object.keys(d).length&&(jQuery(b).find(".frm_ajax_loading").addClass("frm_loading_now"),-1<c.indexOf("frm_ajax_submit")?1>jQuery(b).find('input[type="file"]').length?(C=jQuery(b).find('input[name="frm_action"]').val(),frmFrontForm.checkFormErrors(b,C)):b.submit():b.submit())}},validateFormSubmit:function(a){"undefined"!=
80
+ typeof tinyMCE&&jQuery(this).find(".wp-editor-wrap").length&&tinyMCE.triggerSave();x=[];var b=jQuery(a).hasClass("frm_js_validate");b&&(Ga(a)||Ha(a))&&(b=!1);b&&(frmFrontForm.getAjaxFormErrors(a),Object.keys(x).length&&frmFrontForm.addAjaxFormErrors(a));return x},getAjaxFormErrors:function(a){var b=[],c=jQuery(a).find(".frm_required_field:visible input, .frm_required_field:visible select, .frm_required_field:visible textarea").filter(":not(.frm_optional)");if(c.length)for(var d=0,e=c.length;d<e;d++)b=
81
+ ga(c[d],b);c=jQuery(a).find("input[type=email]").filter(":visible");d=jQuery(a).find("input,select,textarea");if(d.length)for(var e=0,f=d.length;e<f;e++){var h=d[e];""!==h.value&&"hidden"!=h.type&&("number"==h.type?b=ia(h,b):"email"==h.type?b=ha(h,b,c):null!==h.pattern&&(b=ja(h,b)))}c=jQuery(a).find(".frm-g-recaptcha");c.length&&(d=c.data("rid"),0===grecaptcha.getResponse(d).length&&(c=c.closest(".frm_form_field").attr("id").replace("frm_field_","").replace("_container",""),b[c]=""));x=b;if("function"==
82
+ typeof frmThemeOverride_jsErrors&&(C=jQuery(a).find('input[name="frm_action"]').val(),a=frmThemeOverride_jsErrors(C,a),Object.keys(a).length))for(var g in a)x[g]=a[g];return x},addAjaxFormErrors:function(a){Ia();for(var b in x){var c=jQuery(a).find("#frm_field_"+b+"_container");c.length?N(c,b,x):delete x[b]}Ja(a)},checkFormErrors:function(a,b){cb(a,b)},scrollToID:function(a){a=jQuery(document.getElementById(a));frmFrontForm.scrollMsg(a,!1)},scrollMsg:function(a,b,c){if(a=("undefined"==typeof b?jQuery(document.getElementById("frm_form_"+
83
+ a+"_container")):"string"==typeof a?jQuery(b).find("#frm_field_"+a+"_container"):a).offset().top){a-=frm_js.offset;b=jQuery("html").css("margin-top");var d=jQuery("body").css("margin-top");if(b||d)a=a-parseInt(b)-parseInt(d);if(a&&window.innerHeight&&(b=document.documentElement.scrollTop||document.body.scrollTop,a>b+window.innerHeight||a<b))return"undefined"===typeof c?jQuery(window).scrollTop(a):jQuery("html,body").animate({scrollTop:a},500),!1}},savingDraft:function(a){return Ga(a)},goingToPreviousPage:function(a){return Ha(a)},
84
+ hideOrShowFields:function(a,b){if("pageLoad"===b){var c=document.querySelectorAll('[id^="frm_hide_fields_"]');Y(c)}for(var c={repeatingSection:"",repeatRow:""},d=0,e=a.length;d<e;d++)H(a[d],c)},hidePreviouslyHiddenFields:function(){var a;a=[];for(var b=document.querySelectorAll('*[id^="frm_hide_fields_"]'),c=b.length,d,e=0;e<c;e++)d=b[e].id.replace("frm_hide_fields_",""),a=a.concat(D(d));b=0;for(c=a.length;b<c;b++)d=document.getElementById(a[b]),null!==d&&(d.style.display="none")},checkDependentDynamicFields:function(a){for(var b=
85
+ {repeatingSection:"",repeatRow:""},c=0,d=a.length;c<d;c++)H(a[c],b)},checkDependentLookupFields:function(a){for(var b,c={repeatingSection:"",repeatRow:""},d=0,e=a.length;d<e;d++)b=a[d],Z(b,c,"value changed")},loadGoogle:function(){if("undefined"!==typeof google&&google&&google.load)for(var a=__FRMTABLES,b=Object.keys(a),c=0;c<b.length;c++)for(var d=a[b[c]],e=b[c],f=0;f<d.length;f++)hb(d[f],e);else setTimeout(frmFrontForm.loadGoogle,30)},removeUsedTimes:function(a,b){var c=jQuery(a).parents("form:first").find('input[name="id"]');
86
+ jQuery.ajax({type:"POST",url:frm_js.ajax_url,dataType:"json",data:{action:"frm_fields_ajax_time_options",time_field:b,date_field:a.id,entry_id:c?c.val():"",date:jQuery(a).val(),nonce:frm_js.nonce},success:function(a){var c=jQuery(document.getElementById(b));c.find("option").removeAttr("disabled");if(a&&""!==a)for(var f in a)c.find('option[value="'+f+'"]').attr("disabled","disabled")}})},escapeHtml:function(a){return a.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,
87
+ "&#039;")},invisible:function(a){jQuery(a).css("visibility","hidden")},visible:function(a){jQuery(a).css("visibility","visible")}}}var frmFrontForm=frmFrontFormJS();jQuery(document).ready(function(l){frmFrontForm.init()});function frmRecaptcha(){for(var l=jQuery(".frm-g-recaptcha"),n=0,p=l.length;n<p;n++){var r=grecaptcha.render(l[n].id,{sitekey:l[n].getAttribute("data-sitekey"),size:l[n].getAttribute("data-size"),theme:l[n].getAttribute("data-theme")});l[n].setAttribute("data-rid",r)}}
88
  function frmUpdateField(l,n,p,r,v){jQuery(document.getElementById("frm_update_field_"+l+"_"+n)).html('<span class="frm-loading-img"></span>');jQuery.ajax({type:"POST",url:frm_js.ajax_url,data:{action:"frm_entries_update_field_ajax",entry_id:l,field_id:n,value:p,nonce:frm_js.nonce},success:function(){""===r.replace(/^\s+|\s+$/g,"")?jQuery(document.getElementById("frm_update_field_"+l+"_"+n+"_"+v)).fadeOut("slow"):jQuery(document.getElementById("frm_update_field_"+l+"_"+n+"_"+v)).replaceWith(r)}})}
89
  function frmEditEntry(l,n,p,r,v,z){console.warn("DEPRECATED: function frmEditEntry in v2.0.13 use frmFrontForm.editEntry");var y=jQuery(document.getElementById("frm_edit_"+l)),w=y.html(),A=jQuery(document.getElementById(n+l)),F=A.html();A.html('<span class="frm-loading-img" id="'+n+l+'"></span><div class="frm_orig_content" style="display:none">'+F+"</div>");jQuery.ajax({type:"POST",url:frm_js.ajax_url,dataType:"html",data:{action:"frm_entries_edit_entry_ajax",post_id:p,entry_id:l,id:r,nonce:frm_js.nonce},
90
+ success:function(q){A.children(".frm-loading-img").replaceWith(q);y.replaceWith('<span id="frm_edit_'+l+'"><a onclick="frmCancelEdit('+l+",'"+n+"','"+frmFrontForm.escapeHtml(w)+"',"+p+","+r+",'"+z+'\')" class="'+z+'">'+v+"</a></span>")}})}
91
  function frmCancelEdit(l,n,p,r,v,z){console.warn("DEPRECATED: function frmCancelEdit in v2.0.13 use frmFrontForm.cancelEdit");var y=jQuery(document.getElementById("frm_edit_"+l)),w=y.find("a"),A=w.html();w.hasClass("frm_ajax_edited")||(w=jQuery(document.getElementById(n+l)),w.children(".frm_forms").replaceWith(""),w.children(".frm_orig_content").fadeIn("slow").removeClass("frm_orig_content"));y.replaceWith('<a id="frm_edit_'+l+'" class="frm_edit_link '+z+'" href="javascript:frmEditEntry('+l+",'"+
92
+ n+"',"+r+","+v+",'"+frmFrontForm.escapeHtml(A)+"','"+z+"')\">"+p+"</a>")}
93
  function frmDeleteEntry(l,n){console.warn("DEPRECATED: function frmDeleteEntry in v2.0.13 use frmFrontForm.deleteEntry");jQuery(document.getElementById("frm_delete_"+l)).replaceWith('<span class="frm-loading-img" id="frm_delete_'+l+'"></span>');jQuery.ajax({type:"POST",url:frm_js.ajax_url,data:{action:"frm_entries_destroy",entry:l,nonce:frm_js.nonce},success:function(p){"success"==p.replace(/^\s+|\s+$/g,"")?jQuery(document.getElementById(n+l)).fadeOut("slow"):jQuery(document.getElementById("frm_delete_"+
94
+ l)).replaceWith(p)}})}function frmOnSubmit(l){console.warn("DEPRECATED: function frmOnSubmit in v2.0 use frmFrontForm.submitForm");frmFrontForm.submitForm(l,this)}
95
  function frm_resend_email(l,n){console.warn("DEPRECATED: function frm_resend_email in v2.0");$link=jQuery(document.getElementById("frm_resend_email"));$link.append('<span class="spinner" style="display:inline"></span>');jQuery.ajax({type:"POST",url:frm_js.ajax_url,data:{action:"frm_entries_send_email",entry_id:l,form_id:n,nonce:frm_js.nonce},success:function(l){$link.replaceWith(l)}})};
languages/formidable-da_DK.mo ADDED
Binary file
languages/formidable-da_DK.po ADDED
@@ -0,0 +1,7743 @@