Metform Elementor Contact Form Builder – Flexible and Design-Friendly Contact Form builder plugin for WordPress - Version 2.1.1

Version Description

Metform 1.3.0-beta1 is a major update. We have reconstructed the widgets with react and huge optimization for future proof. If you faced any issue please contact our support team from here https://wpmet.com/support-ticket

Download this release

Release Info

Developer ataurr
Plugin Icon 128x128 Metform Elementor Contact Form Builder – Flexible and Design-Friendly Contact Form builder plugin for WordPress
Version 2.1.1
Comparing to
See all releases

Code changes from version 2.1.0 to 2.1.1

core/entries/action.php CHANGED
@@ -451,6 +451,12 @@ class Action
451
  }
452
  }
453
 
 
 
 
 
 
 
454
 
455
  // sanitize form submitted data
456
  $this->sanitize($form_data);
451
  }
452
  }
453
 
454
+ if (class_exists('Metform_Pro\Core\Integrations\Fluent_Crm')) {
455
+ if (isset($this->form_settings['mf_fluent']) && $this->form_settings['mf_fluent'] == '1' && $this->email_name != null && !empty($form_data[$this->email_name])) {
456
+
457
+ \Metform_Pro\Core\Integrations\Fluent_Crm::send_data($this->form_settings['mf_fluent_webhook'], $form_data, $this->email_name);
458
+ }
459
+ }
460
 
461
  // sanitize form submitted data
462
  $this->sanitize($form_data);
core/forms/cpt.php CHANGED
@@ -168,6 +168,12 @@ class Cpt extends \MetForm\Base\Cpt
168
  'mf_slack_webhook' => [
169
  'name' => 'mf_slack_webhook',
170
  ],
 
 
 
 
 
 
171
 
172
  'mf_thank_you_page' => [
173
  'name' => 'mf_thank_you_page'
168
  'mf_slack_webhook' => [
169
  'name' => 'mf_slack_webhook',
170
  ],
171
+ 'mf_fluent' => [
172
+ 'name' => 'mf_fluent',
173
+ ],
174
+ 'mf_fluent_webhook' => [
175
+ 'name' => 'mf_fluent_webhook',
176
+ ],
177
 
178
  'mf_thank_you_page' => [
179
  'name' => 'mf_thank_you_page'
core/forms/views/modal-editor.php CHANGED
@@ -538,6 +538,8 @@
538
 
539
  <?php endif ?>
540
 
 
 
541
  </div>
542
 
543
  </div>
538
 
539
  <?php endif ?>
540
 
541
+ <?php do_action('metform_fluent_crm_editor_markup') ?>
542
+
543
  </div>
544
 
545
  </div>
languages/metform.pot CHANGED
@@ -2,9 +2,9 @@
2
  # This file is distributed under the GPL-2.0+.
3
  msgid ""
4
  msgstr ""
5
- "Project-Id-Version: MetForm 2.1.0\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/metform\n"
7
- "POT-Creation-Date: 2022-01-09 13:59:21+00:00\n"
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=utf-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
@@ -737,27 +737,27 @@ msgstr ""
737
  msgid "Form submission limit execed."
738
  msgstr ""
739
 
740
- #: core/entries/action.php:524
741
  msgid " Please wait... Redirecting to paypal."
742
  msgstr ""
743
 
744
- #: core/entries/action.php:566
745
  msgid " Please wait... Open a Stripe Popup Box."
746
  msgstr ""
747
 
748
- #: core/entries/action.php:669
749
  msgid "ssl certificate or google oauth credentials problem"
750
  msgstr ""
751
 
752
- #: core/entries/action.php:749
753
  msgid "Mail not found."
754
  msgstr ""
755
 
756
- #: core/entries/action.php:791
757
  msgid "Admin mail not found to send email."
758
  msgstr ""
759
 
760
- #: core/entries/action.php:880
761
  msgid "There was an error uploading your file. The error is: "
762
  msgstr ""
763
 
@@ -773,7 +773,7 @@ msgstr ""
773
  msgid "Entry Attributes"
774
  msgstr ""
775
 
776
- #: core/entries/cpt.php:20 core/forms/cpt.php:424
777
  msgid "Parent Item:"
778
  msgstr ""
779
 
@@ -785,7 +785,7 @@ msgstr ""
785
  msgid "Add New Item"
786
  msgstr ""
787
 
788
- #: core/entries/cpt.php:23 core/forms/cpt.php:427
789
  msgid "Add New"
790
  msgstr ""
791
 
@@ -813,27 +813,27 @@ msgstr ""
813
  msgid "Search Item"
814
  msgstr ""
815
 
816
- #: core/entries/cpt.php:30 core/forms/cpt.php:434
817
  msgid "Not found"
818
  msgstr ""
819
 
820
- #: core/entries/cpt.php:31 core/forms/cpt.php:435
821
  msgid "Not found in Trash"
822
  msgstr ""
823
 
824
- #: core/entries/cpt.php:32 core/forms/cpt.php:436
825
  msgid "Featured Image"
826
  msgstr ""
827
 
828
- #: core/entries/cpt.php:33 core/forms/cpt.php:437
829
  msgid "Set featured image"
830
  msgstr ""
831
 
832
- #: core/entries/cpt.php:34 core/forms/cpt.php:438
833
  msgid "Remove featured image"
834
  msgstr ""
835
 
836
- #: core/entries/cpt.php:35 core/forms/cpt.php:439
837
  msgid "Use as featured image"
838
  msgstr ""
839
 
@@ -971,71 +971,71 @@ msgstr ""
971
  msgid "You must enable \"store entries\" for integrating payment method."
972
  msgstr ""
973
 
974
- #: core/forms/cpt.php:420 core/forms/cpt.php:421 widgets/form.php:47
975
  msgid "Form"
976
  msgstr ""
977
 
978
- #: core/forms/cpt.php:422
979
  msgid "Form Archives"
980
  msgstr ""
981
 
982
- #: core/forms/cpt.php:423
983
  msgid "Form Attributes"
984
  msgstr ""
985
 
986
- #: core/forms/cpt.php:425 core/forms/cpt.php:453
987
  msgid "Forms"
988
  msgstr ""
989
 
990
- #: core/forms/cpt.php:426
991
  msgid "Add New Form"
992
  msgstr ""
993
 
994
- #: core/forms/cpt.php:428
995
  msgid "New Form"
996
  msgstr ""
997
 
998
- #: core/forms/cpt.php:429
999
  msgid "Edit Form"
1000
  msgstr ""
1001
 
1002
- #: core/forms/cpt.php:430
1003
  msgid "Update Form"
1004
  msgstr ""
1005
 
1006
- #: core/forms/cpt.php:431
1007
  msgid "View Form"
1008
  msgstr ""
1009
 
1010
- #: core/forms/cpt.php:432
1011
  msgid "View Forms"
1012
  msgstr ""
1013
 
1014
- #: core/forms/cpt.php:433
1015
  msgid "Search Forms"
1016
  msgstr ""
1017
 
1018
- #: core/forms/cpt.php:440
1019
  msgid "Insert into form"
1020
  msgstr ""
1021
 
1022
- #: core/forms/cpt.php:441
1023
  msgid "Uploaded to this form"
1024
  msgstr ""
1025
 
1026
- #: core/forms/cpt.php:442
1027
  msgid "Forms list"
1028
  msgstr ""
1029
 
1030
- #: core/forms/cpt.php:443
1031
  msgid "Forms list navigation"
1032
  msgstr ""
1033
 
1034
- #: core/forms/cpt.php:444
1035
  msgid "Filter froms list"
1036
  msgstr ""
1037
 
1038
- #: core/forms/cpt.php:454
1039
  msgid "metform form"
1040
  msgstr ""
1041
 
@@ -1534,111 +1534,111 @@ msgstr ""
1534
  msgid "create from here"
1535
  msgstr ""
1536
 
1537
- #: core/forms/views/modal-editor.php:550
1538
  msgid "Success url:"
1539
  msgstr ""
1540
 
1541
- #: core/forms/views/modal-editor.php:553
1542
  msgid "Success url"
1543
  msgstr ""
1544
 
1545
- #: core/forms/views/modal-editor.php:555
1546
  msgid ""
1547
  "Users will be redirected to the this link after successfully form "
1548
  "submission."
1549
  msgstr ""
1550
 
1551
- #: core/forms/views/modal-editor.php:560
1552
  msgid "Failed/ Cancel url:"
1553
  msgstr ""
1554
 
1555
- #: core/forms/views/modal-editor.php:563
1556
  msgid "Failed/Cancel url"
1557
  msgstr ""
1558
 
1559
- #: core/forms/views/modal-editor.php:565
1560
  msgid ""
1561
  "Users will be redirected to the this link after any failure/ cancelation of "
1562
  "form submission."
1563
  msgstr ""
1564
 
1565
- #: core/forms/views/modal-editor.php:571
1566
  msgid "Paypal:"
1567
  msgstr ""
1568
 
1569
- #: core/forms/views/modal-editor.php:573
1570
  msgid "Integrate paypal payment with this form."
1571
  msgstr ""
1572
 
1573
- #: core/forms/views/modal-editor.php:573
1574
  msgid "Configure paypal payment."
1575
  msgstr ""
1576
 
1577
- #: core/forms/views/modal-editor.php:582
1578
  msgid "Stripe:"
1579
  msgstr ""
1580
 
1581
- #: core/forms/views/modal-editor.php:584
1582
  msgid "Integrate stripe payment with this form. "
1583
  msgstr ""
1584
 
1585
- #: core/forms/views/modal-editor.php:584
1586
  msgid "Configure stripe payment."
1587
  msgstr ""
1588
 
1589
- #: core/forms/views/modal-editor.php:600
1590
  msgid "Hubspot Contact:"
1591
  msgstr ""
1592
 
1593
- #: core/forms/views/modal-editor.php:602
1594
  msgid "Integrate hubspot with this form. "
1595
  msgstr ""
1596
 
1597
- #: core/forms/views/modal-editor.php:602
1598
  msgid "Configure Hubspot."
1599
  msgstr ""
1600
 
1601
- #: core/forms/views/modal-editor.php:609
1602
  msgid "Hubspot Forms:"
1603
  msgstr ""
1604
 
1605
- #: core/forms/views/modal-editor.php:617
1606
  msgid "Fetch hubspot forms"
1607
  msgstr ""
1608
 
1609
- #: core/forms/views/modal-editor.php:640
1610
  msgid "Zoho Contact:"
1611
  msgstr ""
1612
 
1613
- #: core/forms/views/modal-editor.php:642
1614
  msgid "Integrate Zoho contacts with this form. "
1615
  msgstr ""
1616
 
1617
- #: core/forms/views/modal-editor.php:642
1618
  msgid "Configure Zoho."
1619
  msgstr ""
1620
 
1621
- #: core/forms/views/modal-editor.php:652
1622
  msgid "Helpscout"
1623
  msgstr ""
1624
 
1625
- #: core/forms/views/modal-editor.php:654
1626
  msgid "Integrate Helpscout with this form. "
1627
  msgstr ""
1628
 
1629
- #: core/forms/views/modal-editor.php:654
1630
  msgid "Configure Helpscout."
1631
  msgstr ""
1632
 
1633
- #: core/forms/views/modal-editor.php:659
1634
  msgid "Available Mailboxes"
1635
  msgstr ""
1636
 
1637
- #: core/forms/views/modal-editor.php:696
1638
  msgid "Edit content"
1639
  msgstr ""
1640
 
1641
- #: core/forms/views/modal-editor.php:698
1642
  msgid "Save changes"
1643
  msgstr ""
1644
 
@@ -3736,7 +3736,7 @@ msgctxt "Post Type General Name"
3736
  msgid "Entries"
3737
  msgstr ""
3738
 
3739
- #: core/forms/cpt.php:418
3740
  msgctxt "Post Type General Name"
3741
  msgid "Forms"
3742
  msgstr ""
@@ -3746,7 +3746,7 @@ msgctxt "Post Type Singular Name"
3746
  msgid "Entry"
3747
  msgstr ""
3748
 
3749
- #: core/forms/cpt.php:419
3750
  msgctxt "Post Type Singular Name"
3751
  msgid "Form"
3752
  msgstr ""
2
  # This file is distributed under the GPL-2.0+.
3
  msgid ""
4
  msgstr ""
5
+ "Project-Id-Version: MetForm 2.1.1\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/metform\n"
7
+ "POT-Creation-Date: 2022-01-23 11:55:10+00:00\n"
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=utf-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
737
  msgid "Form submission limit execed."
738
  msgstr ""
739
 
740
+ #: core/entries/action.php:530
741
  msgid " Please wait... Redirecting to paypal."
742
  msgstr ""
743
 
744
+ #: core/entries/action.php:572
745
  msgid " Please wait... Open a Stripe Popup Box."
746
  msgstr ""
747
 
748
+ #: core/entries/action.php:675
749
  msgid "ssl certificate or google oauth credentials problem"
750
  msgstr ""
751
 
752
+ #: core/entries/action.php:755
753
  msgid "Mail not found."
754
  msgstr ""
755
 
756
+ #: core/entries/action.php:797
757
  msgid "Admin mail not found to send email."
758
  msgstr ""
759
 
760
+ #: core/entries/action.php:886
761
  msgid "There was an error uploading your file. The error is: "
762
  msgstr ""
763
 
773
  msgid "Entry Attributes"
774
  msgstr ""
775
 
776
+ #: core/entries/cpt.php:20 core/forms/cpt.php:430
777
  msgid "Parent Item:"
778
  msgstr ""
779
 
785
  msgid "Add New Item"
786
  msgstr ""
787
 
788
+ #: core/entries/cpt.php:23 core/forms/cpt.php:433
789
  msgid "Add New"
790
  msgstr ""
791
 
813
  msgid "Search Item"
814
  msgstr ""
815
 
816
+ #: core/entries/cpt.php:30 core/forms/cpt.php:440
817
  msgid "Not found"
818
  msgstr ""
819
 
820
+ #: core/entries/cpt.php:31 core/forms/cpt.php:441
821
  msgid "Not found in Trash"
822
  msgstr ""
823
 
824
+ #: core/entries/cpt.php:32 core/forms/cpt.php:442
825
  msgid "Featured Image"
826
  msgstr ""
827
 
828
+ #: core/entries/cpt.php:33 core/forms/cpt.php:443
829
  msgid "Set featured image"
830
  msgstr ""
831
 
832
+ #: core/entries/cpt.php:34 core/forms/cpt.php:444
833
  msgid "Remove featured image"
834
  msgstr ""
835
 
836
+ #: core/entries/cpt.php:35 core/forms/cpt.php:445
837
  msgid "Use as featured image"
838
  msgstr ""
839
 
971
  msgid "You must enable \"store entries\" for integrating payment method."
972
  msgstr ""
973
 
974
+ #: core/forms/cpt.php:426 core/forms/cpt.php:427 widgets/form.php:47
975
  msgid "Form"
976
  msgstr ""
977
 
978
+ #: core/forms/cpt.php:428
979
  msgid "Form Archives"
980
  msgstr ""
981
 
982
+ #: core/forms/cpt.php:429
983
  msgid "Form Attributes"
984
  msgstr ""
985
 
986
+ #: core/forms/cpt.php:431 core/forms/cpt.php:459
987
  msgid "Forms"
988
  msgstr ""
989
 
990
+ #: core/forms/cpt.php:432
991
  msgid "Add New Form"
992
  msgstr ""
993
 
994
+ #: core/forms/cpt.php:434
995
  msgid "New Form"
996
  msgstr ""
997
 
998
+ #: core/forms/cpt.php:435
999
  msgid "Edit Form"
1000
  msgstr ""
1001
 
1002
+ #: core/forms/cpt.php:436
1003
  msgid "Update Form"
1004
  msgstr ""
1005
 
1006
+ #: core/forms/cpt.php:437
1007
  msgid "View Form"
1008
  msgstr ""
1009
 
1010
+ #: core/forms/cpt.php:438
1011
  msgid "View Forms"
1012
  msgstr ""
1013
 
1014
+ #: core/forms/cpt.php:439
1015
  msgid "Search Forms"
1016
  msgstr ""
1017
 
1018
+ #: core/forms/cpt.php:446
1019
  msgid "Insert into form"
1020
  msgstr ""
1021
 
1022
+ #: core/forms/cpt.php:447
1023
  msgid "Uploaded to this form"
1024
  msgstr ""
1025
 
1026
+ #: core/forms/cpt.php:448
1027
  msgid "Forms list"
1028
  msgstr ""
1029
 
1030
+ #: core/forms/cpt.php:449
1031
  msgid "Forms list navigation"
1032
  msgstr ""
1033
 
1034
+ #: core/forms/cpt.php:450
1035
  msgid "Filter froms list"
1036
  msgstr ""
1037
 
1038
+ #: core/forms/cpt.php:460
1039
  msgid "metform form"
1040
  msgstr ""
1041
 
1534
  msgid "create from here"
1535
  msgstr ""
1536
 
1537
+ #: core/forms/views/modal-editor.php:552
1538
  msgid "Success url:"
1539
  msgstr ""
1540
 
1541
+ #: core/forms/views/modal-editor.php:555
1542
  msgid "Success url"
1543
  msgstr ""
1544
 
1545
+ #: core/forms/views/modal-editor.php:557
1546
  msgid ""
1547
  "Users will be redirected to the this link after successfully form "
1548
  "submission."
1549
  msgstr ""
1550
 
1551
+ #: core/forms/views/modal-editor.php:562
1552
  msgid "Failed/ Cancel url:"
1553
  msgstr ""
1554
 
1555
+ #: core/forms/views/modal-editor.php:565
1556
  msgid "Failed/Cancel url"
1557
  msgstr ""
1558
 
1559
+ #: core/forms/views/modal-editor.php:567
1560
  msgid ""
1561
  "Users will be redirected to the this link after any failure/ cancelation of "
1562
  "form submission."
1563
  msgstr ""
1564
 
1565
+ #: core/forms/views/modal-editor.php:573
1566
  msgid "Paypal:"
1567
  msgstr ""
1568
 
1569
+ #: core/forms/views/modal-editor.php:575
1570
  msgid "Integrate paypal payment with this form."
1571
  msgstr ""
1572
 
1573
+ #: core/forms/views/modal-editor.php:575
1574
  msgid "Configure paypal payment."
1575
  msgstr ""
1576
 
1577
+ #: core/forms/views/modal-editor.php:584
1578
  msgid "Stripe:"
1579
  msgstr ""
1580
 
1581
+ #: core/forms/views/modal-editor.php:586
1582
  msgid "Integrate stripe payment with this form. "
1583
  msgstr ""
1584
 
1585
+ #: core/forms/views/modal-editor.php:586
1586
  msgid "Configure stripe payment."
1587
  msgstr ""
1588
 
1589
+ #: core/forms/views/modal-editor.php:602
1590
  msgid "Hubspot Contact:"
1591
  msgstr ""
1592
 
1593
+ #: core/forms/views/modal-editor.php:604
1594
  msgid "Integrate hubspot with this form. "
1595
  msgstr ""
1596
 
1597
+ #: core/forms/views/modal-editor.php:604
1598
  msgid "Configure Hubspot."
1599
  msgstr ""
1600
 
1601
+ #: core/forms/views/modal-editor.php:611
1602
  msgid "Hubspot Forms:"
1603
  msgstr ""
1604
 
1605
+ #: core/forms/views/modal-editor.php:619
1606
  msgid "Fetch hubspot forms"
1607
  msgstr ""
1608
 
1609
+ #: core/forms/views/modal-editor.php:642
1610
  msgid "Zoho Contact:"
1611
  msgstr ""
1612
 
1613
+ #: core/forms/views/modal-editor.php:644
1614
  msgid "Integrate Zoho contacts with this form. "
1615
  msgstr ""
1616
 
1617
+ #: core/forms/views/modal-editor.php:644
1618
  msgid "Configure Zoho."
1619
  msgstr ""
1620
 
1621
+ #: core/forms/views/modal-editor.php:654
1622
  msgid "Helpscout"
1623
  msgstr ""
1624
 
1625
+ #: core/forms/views/modal-editor.php:656
1626
  msgid "Integrate Helpscout with this form. "
1627
  msgstr ""
1628
 
1629
+ #: core/forms/views/modal-editor.php:656
1630
  msgid "Configure Helpscout."
1631
  msgstr ""
1632
 
1633
+ #: core/forms/views/modal-editor.php:661
1634
  msgid "Available Mailboxes"
1635
  msgstr ""
1636
 
1637
+ #: core/forms/views/modal-editor.php:698
1638
  msgid "Edit content"
1639
  msgstr ""
1640
 
1641
+ #: core/forms/views/modal-editor.php:700
1642
  msgid "Save changes"
1643
  msgstr ""
1644
 
3736
  msgid "Entries"
3737
  msgstr ""
3738
 
3739
+ #: core/forms/cpt.php:424
3740
  msgctxt "Post Type General Name"
3741
  msgid "Forms"
3742
  msgstr ""
3746
  msgid "Entry"
3747
  msgstr ""
3748
 
3749
+ #: core/forms/cpt.php:425
3750
  msgctxt "Post Type Singular Name"
3751
  msgid "Form"
3752
  msgstr ""
metform.php CHANGED
@@ -1,11 +1,9 @@
1
  <?php
2
- defined( 'ABSPATH' ) || exit;
3
-
4
  /**
5
  * Plugin Name: MetForm
6
  * Plugin URI: http://products.wpmet.com/metform/
7
  * Description: Most flexible and design friendly form builder for Elementor
8
- * Version: 2.1.0
9
  * Author: Wpmet
10
  * Author URI: https://wpmet.com
11
  * Text Domain: metform
@@ -14,6 +12,8 @@ defined( 'ABSPATH' ) || exit;
14
  * License URI: http://www.gnu.org/licenses/gpl-2.0.txt
15
  */
16
 
 
 
17
  require_once plugin_dir_path( __FILE__ ) . '/utils/notice/notice.php';
18
  require_once plugin_dir_path( __FILE__ ) . '/utils/banner/banner.php';
19
 
1
  <?php
 
 
2
  /**
3
  * Plugin Name: MetForm
4
  * Plugin URI: http://products.wpmet.com/metform/
5
  * Description: Most flexible and design friendly form builder for Elementor
6
+ * Version: 2.1.1
7
  * Author: Wpmet
8
  * Author URI: https://wpmet.com
9
  * Text Domain: metform
12
  * License URI: http://www.gnu.org/licenses/gpl-2.0.txt
13
  */
14
 
15
+ defined( 'ABSPATH' ) || exit;
16
+
17
  require_once plugin_dir_path( __FILE__ ) . '/utils/notice/notice.php';
18
  require_once plugin_dir_path( __FILE__ ) . '/utils/banner/banner.php';
19
 
plugin.php CHANGED
@@ -21,7 +21,7 @@ final class Plugin {
21
 
22
  public function version()
23
  {
24
- return '2.1.0';
25
  }
26
 
27
  public function package_type()
21
 
22
  public function version()
23
  {
24
+ return '2.1.1';
25
  }
26
 
27
  public function package_type()
public/assets/js/admin-script.js CHANGED
@@ -1 +1 @@
1
- jQuery(document).ready((function(e){"use strict";function t(){var t=e(".mf-mailchimp-list-id").val();e(".mailchimp_list option").each(((i,s)=>{e(s).attr("selected",!1),s.value===t&&e(s).attr("selected",!0)}))}function i(){e(".mf-btn-del-singl-field").click((function(){e(this).parent(".mf-cf-single-field").remove()}))}function s(e,t="",i=""){return'<div id="mf-cf-single-field" class="mf-cf-single-field"">\n <div class="mf-cf-single-field-input">\n <label>Name</label>\n <input type="text" name="mf_post_submission_custom_fields_name[]" class="attr-form-control" value="'+t+'">\n </div>\n <div class="mf-cf-single-field-input">\n <label>Select Field</label>\n <select data-selected="'+i+'" name="mf_post_submission_mf_field_name[]" class="attr-form-control">'+e+'</select>\n </div>\n <a href="#" class="mf-btn-del-singl-field">Delete</a>\n </div>'}e(".metfrom-btn-refresh-get-response-list").click((function(){var t=e(this);t.addClass("mf-setting-spin");var i,s=e("#metform_form_modal"),a=e("#metform-form-modalinput-settings").attr("data-nonce"),o=e(".get-response-campaign-list");i=s.find("form").attr("data-mf-id"),e.ajax({url:window.metform_api.resturl+"metform/v1/entries/store_get_response_list/"+i,type:"get",headers:{"X-WP-Nonce":a},dataType:"json",success:function(e){o.empty(),e.forEach((e=>{o.append('<option value="'+e.campaignId+'">'+e.description+"</option>")})),t.removeClass("mf-setting-spin")},error:function(e){t.removeClass("mf-setting-spin")}})})),e(".metfrom-btn-refresh-mailchimp-list").on("click",(function(){var i=e(this);i.addClass("mf-setting-spin");var s,a=e("#metform_form_modal"),o=e("#metform-form-modalinput-settings").attr("data-nonce"),n=e(".mailchimp_list");s=a.find("form").attr("data-mf-id"),e.ajax({url:window.metform_api.resturl+"metform/v1/entries/store_mailchimp_list/"+s,type:"get",headers:{"X-WP-Nonce":o},dataType:"json",success:function(s){try{n.empty(),s.lists.forEach((e=>{n.append("<option value="+e.id+">"+e.name+"</option>")})),1===s.lists.length?e(".mf-mailchimp-list-id").attr("value",s.lists[0].id):(t(),e(".mailchimp_list").on("change",(t=>{e(".mf-mailchimp-list-id").attr("value",t.target.value)})))}catch(a){}i.removeClass("mf-setting-spin")},error:function(e){i.removeClass("mf-setting-spin")}})})),e(".metfrom-btn-refresh-hubsopt-list").click((function(){var t=e(this);t.addClass("mf-setting-spin");var i,s=e("#metform_form_modal"),a=e("#metform-form-modalinput-settings").attr("data-nonce"),o=e(".hubspot_forms");i=s.find("form").attr("data-mf-id"),e.ajax({url:window.metform_api.resturl+"metform/v1/forms/hubspot_forms/"+i,type:"get",headers:{"X-WP-Nonce":a},dataType:"json",success:function(e){try{o.empty(),o.append('<option value="select">Select a form</option>'),e.forEach((e=>{o.append("<option value="+e.portalId+" guid="+e.guid+">"+e.name+"</option>")}))}catch(i){}t.removeClass("mf-setting-spin")},error:function(e){t.removeClass("mf-setting-spin")}})})),e(".hubspot_forms").on("change",(function(){var t=e("option:selected",this).attr("guid"),i=e("option:selected",this).val();e(".mf_hubspot_form_guid").val(t),e(".mf_hubspot_form_portalId").val(i);var s,a=e("#metform_form_modal"),o=e("#metform-form-modalinput-settings").attr("data-nonce");s=a.find("form").attr("data-mf-id"),e("#mf-hubsopt-fileds").html("Please wait....");var n="";e.ajax({url:window.metform_api.resturl+"metform/v1/forms/get_fields_data/"+s,type:"get",headers:{"X-WP-Nonce":o},dataType:"json",success:function(i){n=i,e.ajax({url:window.metform_api.resturl+"metform/v1/forms/hubspot_form_fields/"+s,type:"post",headers:{"X-WP-Nonce":o},dataType:"json",data:{guid:t},success:function(t){var i="",s="";Object.keys(n).map((function(e){return[n[e]]})).map((e=>{s+="<option value="+e[0].mf_input_name+">"+e[0].mf_input_label+"</option>"}));t.forEach((e=>{i+="<tr><td>"+e.label+"</td><td><select name=mf_hubspot_form_field_name_"+e.name+' class="attr-form-control">'+s+"</select></td></tr>"})),e("#mf-hubsopt-fileds").html('<table width="100%">'+i+"</table>")},error:function(t){e("#mf-hubsopt-fileds").html("Sorry ! Something went wrong")}})},error:function(t){e("#mf-hubsopt-fileds").html("Sorry ! Something went wrong")}})})),e(".mf-mailchimp-list-id").attr("value",""),e(".row-actions .edit a, .page-title-action, .metform-form-edit-btn, body.post-type-metform-form a.row-title").on("click",(function(a){a.preventDefault();var o=0,n=e("#metform_form_modal"),r=e(this).parents(".column-title"),m=e("body").attr("data-metform-template-key");n.addClass("loading"),n.modal("show");if(r.length>0){o=e(this).attr("data-metform-form-id"),"undefined"!==m&&(o=m),o=o!==undefined?o:r.find(".hidden").attr("id").split("_")[1];var l=e("#metform-form-modalinput-settings").attr("data-nonce");e.ajax({url:window.metform_api.resturl+"metform/v1/forms/get/"+o,type:"get",headers:{"X-WP-Nonce":l},dataType:"json",success:function(t){t,y(t),n.removeClass("loading");const i=new CustomEvent("metform-integration-settings-event",{detail:{data:t},bubbles:!0,cancelable:!0,composed:!1});document.querySelector("#metform-form-modalinput-settings").dispatchEvent(i),function(t,i,s){e(".mf-helpscout").length&&e.ajax({url:window.metform_api.resturl+"metform/v1/forms/get_fields_data/"+t,type:"get",headers:{"X-WP-Nonce":i},dataType:"json",success:function(t){var i=t,a="";Object.keys(i).map((function(e){return[i[e]]})).map((e=>{a+="<option value="+e[0].mf_input_name+">"+e[0].mf_input_label+"</option>"}));var o='<div class="mf-input-group mf-input-group-inline">'+('<label class="attr-input-label">Subject*</label><div class="mf-inputs"><select class="attr-form-control" id="mf_helpscout_conversation_subject" name="mf_helpscout_conversation_subject">'+a+"</select></div>")+'</div><div class="mf-input-group mf-input-group-inline">'+('<label class="attr-input-label">Customer Email*</label><div class="mf-inputs"><select class="attr-form-control" id="mf_helpscout_conversation_customer_email" name="mf_helpscout_conversation_customer_email">'+a+"</select></div>")+'</div><div class="mf-input-group mf-input-group-inline">'+('<label class="attr-input-label">Customer First Name*</label><div class="mf-inputs"><select class="attr-form-control" id="mf_helpscout_conversation_customer_first_name" name="mf_helpscout_conversation_customer_first_name">'+a+"</select></div>")+'</div><div class="mf-input-group mf-input-group-inline">'+('<label class="attr-input-label">Customer Last Name*</label><div class="mf-inputs"><select class="attr-form-control" id="mf_helpscout_conversation_customer_last_name" name="mf_helpscout_conversation_customer_last_name">'+a+"</select></div>")+'</div><div class="mf-input-group mf-input-group-inline">'+('<label class="attr-input-label">Message*</label><div class="mf-inputs"><select class="attr-form-control" id="mf_helpscout_conversation_customer_message" name="mf_helpscout_conversation_customer_message">'+a+"</select></div>")+"</div>";e("#mf-helpscout-fileds").html(o),s.mf_helpscout_conversation_subject&&(e('#mf_helpscout_conversation_subject option[value="'+s.mf_helpscout_conversation_subject+'"]').prop("selected",!0),e('#mf_helpscout_conversation_customer_email option[value="'+s.mf_helpscout_conversation_customer_email+'"]').prop("selected",!0),e('#mf_helpscout_conversation_customer_first_name option[value="'+s.mf_helpscout_conversation_customer_first_name+'"]').prop("selected",!0),e('#mf_helpscout_conversation_customer_last_name option[value="'+s.mf_helpscout_conversation_customer_last_name+'"]').prop("selected",!0),e('#mf_helpscout_conversation_customer_message option[value="'+s.mf_helpscout_conversation_customer_message+'"]').prop("selected",!0))},error:function(e){}})}(o,l,t)}})}else{y({form_title:e(".mf-form-modalinput-title").attr("data-default-value"),admin_email_body:"",admin_email_from:"",admin_email_reply_to:"",admin_email_subject:"",capture_user_browser_data:"",enable_admin_notification:"",limit_total_entries_status:"",limit_total_entries:"0",redirect_to:"",success_url:"",failed_cancel_url:"",require_login:"",store_entries:"1",entry_title:"",success_message:e(".mf-form-modalinput-success_message").attr("data-default-value"),user_email_body:"",user_email_from:"",user_email_reply_to:"",user_email_subject:"",input_names:"Example: [mf-inputname]"}),n.removeClass("loading")}function c(e,t=""){let i="";return Array.isArray(e)&&e.map((e=>{const s=t===e[0].mf_input_name?" selected":"";i+="<option value="+e[0].mf_input_name+s+">"+e[0].mf_input_label+"</option>"})),i}e(".mf-register").length&&e.ajax({url:window.metform_api.resturl+"metform/v1/forms/get_fields_data/"+o,type:"get",headers:{"X-WP-Nonce":l},dataType:"json",success:function(t){var i=t,s="";e.ajax({url:window.metform_api.resturl+"xs/register/settings/"+o,type:"get",headers:{"X-WP-Nonce":l},dataType:"json",success:function(t){Object.keys(i).map((function(e){return[i[e]]})).map((e=>{s+="<option value="+e[0].mf_input_name+">"+e[0].mf_input_label+"</option>"}));var a='<div class="mf-input-group mf-input-group-inline">'+('<label class="attr-input-label">User Name</label><div class="mf-inputs"><select class="attr-form-control" id="mf_auth_reg_user_name" name="mf_auth_reg_user_name">'+s+"</select></div>")+'</div><div class="mf-input-group mf-input-group-inline">'+('<label class="attr-input-label">User Email</label><div class="mf-inputs"><select class="attr-form-control" id="mf_auth_reg_user_email" name="mf_auth_reg_user_email">'+s+"</select></div>")+'</div><div class="mf-input-group mf-input-group-inline"><label class="attr-input-label">Role</label><div class="mf-inputs"><select class="attr-form-control" id="mf_auth_reg_role" name="mf_auth_reg_role"><option value="administrator">Administrator</option><option value="editor">Editor</option><option value="author">Author</option><option value="contributor">Contributor</option><option selected="selected" value="subscriber">Subscriber</option></select></div></div>';e(".mf_register_form_fields").html(a),0!=t&&(e('#mf_auth_reg_user_name option[value="'+t.mf_auth_reg_user_name+'"]').prop("selected",!0),e('#mf_auth_reg_user_email option[value="'+t.mf_auth_reg_user_email+'"]').prop("selected",!0),e('#mf_auth_reg_role option[value="'+t.mf_auth_reg_role+'"]').prop("selected",!0))},error:function(e){}})},error:function(e){}}),e(".mf-login").length&&e.ajax({url:window.metform_api.resturl+"metform/v1/forms/get_fields_data/"+o,type:"get",headers:{"X-WP-Nonce":l},dataType:"json",success:function(t){var i=t,s="";e.ajax({url:window.metform_api.resturl+"xs/login/settings/"+o,type:"get",headers:{"X-WP-Nonce":l},dataType:"json",success:function(t){Object.keys(i).map((function(e){return[i[e]]})).map((e=>{s+="<option value="+e[0].mf_input_name+">"+e[0].mf_input_label+"</option>"}));var a='<div class="mf-input-group mf-input-group-inline">'+('<label class="attr-input-label">User Name</label><div class="mf-inputs"><select class="attr-form-control" id="mf_auth_login_user_name" name="mf_auth_login_user_name">'+s+"</select></div>")+'</div><div class="mf-input-group mf-input-group-inline">'+('<label class="attr-input-label">User Password</label><div class="mf-inputs"><select class="attr-form-control" id="mf_auth_login_user_password" name="mf_auth_login_user_password">'+s+"</select></div>")+"</div>";e(".mf_login_form_fields").html(a),0!=t&&(e('#mf_auth_login_user_name option[value="'+t.mf_auth_login_user_name+'"]').prop("selected",!0),e('#mf_auth_login_user_password option[value="'+t.mf_auth_login_user_password+'"]').prop("selected",!0))},error:function(e){}})},error:function(e){}}),e(".mf-form-to-post").length&&e.ajax({url:window.metform_api.resturl+"metform/v1/forms/get_fields_data/"+o,type:"get",headers:{"X-WP-Nonce":l},dataType:"json",success:function(t){var a=t,n="";e.ajax({url:window.metform_api.resturl+"xs/post/settings/"+o,type:"get",headers:{"X-WP-Nonce":l},dataType:"json",success:function(t){var o=Object.keys(a).map((function(e){return[a[e]]}));o.map((e=>{n+="<option value="+e[0].mf_input_name+">"+e[0].mf_input_label+"</option>"}));var r='<label class="attr-input-label">Title</label><div class="mf-inputs"><select class="attr-form-control mf_post_submission_title" id="mf_post_submission_title" name="mf_post_submission_title">'+n+"</select></div>",m='<label class="attr-input-label">Content</label><div class="mf-inputs"><select class="attr-form-control mf_post_submission_content" id="mf_post_submission_content" name="mf_post_submission_content">'+n+"</select></div>",l='<label class="attr-input-label">Featured Image</label><div class="mf-inputs"><select class="attr-form-control mf_post_submission_featured_image" id="mf_post_submission_featured_image" name="mf_post_submission_featured_image">'+n+"</select></div>",f=s(n);if(0!=t.custom_fields_settings){f="";var d=Object.entries(t.custom_fields_settings);for(const[e,t]of d)f+=s(c(o,t),e,t)}var p='<div class="mf-input-group mf-input-group-inline">'+r+'</div><div class="mf-input-group mf-input-group-inline">'+m+'</div></div><div class="mf-input-group mf-input-group-inline">'+l+'</div><div class="mf-input-group mf-input-group-inline">'+function(e,t){return'<label class="attr-input-label">Custom Fields</label>\n <div class="mf-inputs mf-cf-fields">\n <div style="display:none">\n <div id="mf-cf-single-field" class="mf-cf-single-field"">\n <div class="mf-cf-single-field-input">\n <label>Name</label>\n <input type="text" name="mf_post_submission_custom_fields_name[]" class="attr-form-control" >\n </div>\n <div class="mf-cf-single-field-input">\n <label>Select Field</label>\n <select name="mf_post_submission_mf_field_name[]" class="attr-form-control">'+t+'</select>\n </div>\n <a href="#" class="mf-btn-del-singl-field">Delete</a>\n </div>\n </div>\n <div class="repeaterResult">'+e+'</div>\n <button class="mf-add-cf" type="button"><span>+</span></button>\n </div>'}(f,n)+"</div>";e(".mf-post-submission-fields-section").html(p);var _=0;e(".mf-add-cf").click((function(){var t=e("#mf-cf-single-field").clone();_++,t.attr("id","mf-repeater-field-"+_),e(".mf-btn-del-singl-field",t).attr("data-id",_),t.appendTo(e(".repeaterResult")),i()})),i(),0!=t.fields_settings&&(e('.mf_post_submission_post_type option[value="'+t.fields_settings.mf_post_submission_post_type+'"]').prop("selected",!0),e('.mf_post_submission_title option[value="'+t.fields_settings.mf_post_submission_title+'"]').prop("selected",!0),e('.mf_post_submission_content option[value="'+t.fields_settings.mf_post_submission_content+'"]').prop("selected",!0),e('.mf_post_submission_featured_image option[value="'+t.fields_settings.mf_post_submission_featured_image+'"]').prop("selected",!0),e('.mf_post_submission_author option[value="'+t.fields_settings.mf_post_submission_author+'"]').prop("selected",!0))},error:function(e){}})},error:function(e){}}),function(t){var i=e("#metform-form-modalinput-settings").attr("data-nonce"),s=e(".get-response-campaign-list");e.ajax({url:window.metform_api.resturl+"metform/v1/entries/get_response_list/"+t,type:"get",headers:{"X-WP-Nonce":i},dataType:"json",success:function(e){s.empty(),e.length&&e.forEach((e=>{s.append("<option value="+e.campaignId+">"+e.description+"</option>")}))},error:function(e){}})}(o),function(t){var i=e(".metfrom-btn-refresh-hubsopt-list");i.addClass("mf-setting-spin");var s=e("#metform-form-modalinput-settings").attr("data-nonce"),a=e(".hubspot_forms"),o=t;e.ajax({url:window.metform_api.resturl+"metform/v1/forms/get_hubspot_forms/"+o,type:"get",headers:{"X-WP-Nonce":s},dataType:"json",success:function(e){try{a.empty(),a.append('<option value="select">Select a form</option>'),e.forEach((e=>{a.append("<option value="+e.portalId+" guid="+e.guid+">"+e.name+"</option>")}))}catch(t){}i.removeClass("mf-setting-spin")},error:function(e){i.removeClass("mf-setting-spin")}})}(o),function(i){e("#metform_form_modal");var s,a=e("#metform-form-modalinput-settings").attr("data-nonce"),o=e(".mailchimp_list");s=i,e.ajax({url:window.metform_api.resturl+"metform/v1/entries/get_mailchimp_list/"+s,type:"get",headers:{"X-WP-Nonce":a},dataType:"json",success:function(i){try{o.empty(),i.lists.forEach((e=>{o.append("<option value="+e.id+">"+e.name+"</option>")})),1===i.lists.length?e(".mf-mailchimp-list-id").attr("value",i.lists[0].id):(t(),e(".mailchimp_list").on("change",(t=>{e(".mf-mailchimp-list-id").attr("value",t.target.value)})))}catch(s){}},error:function(e){}})}(o),n.find("form").attr("data-mf-id",o),n.find(".get-response-campaign-list").attr("get-response-list-id",o)})),e(".metform-form-save-btn-editor").on("click",(function(){e(".metform-form-save-btn-editor").attr("disabled",!0);var t=e("#metform-form-modalinput-settings");t.attr("data-open-editor","1"),t.trigger("submit")})),e("#metform-form-modalinput-settings").on("submit",(function(t){t.preventDefault();var i=e("#metform-form-modal"),s=e(this);i.addClass("loading"),e(".metform-form-save-btn-editor").attr("disabled",!0),e(".metform-form-save-btn").attr("disabled",!0);var a=e(this).serialize(),o=e(this).attr("data-mf-id"),n=e(this).attr("data-open-editor"),r=e(this).attr("data-editor-url"),m=e(this).attr("data-nonce");e.ajax({url:window.metform_api.resturl+"metform/v1/forms/update/"+o,type:"post",data:a,headers:{"X-WP-Nonce":m},dataType:"json",success:function(t){e("#message").css("display","block"),1==t.saved?(e("#post-"+t.data.id).find(".row-title").html(t.data.title),e("#message").removeClass("attr-alert-warning").addClass("attr-alert-success").html(t.status)):e("#message").removeClass("attr-alert-success").addClass("attr-alert-warning").html(t.status),setTimeout((function(){e("#message").css("display","none"),s.find(".attr-close").trigger("click")}),1e3),i.removeClass("loading"),"1"==n&&1==t.saved?setTimeout((function(){window.location.href=r+"?post="+t.data.id+"&action=elementor"}),1e3):"0"!=o?(e(".metform-form-save-btn-editor").removeAttr("disabled"),e(".metform-form-save-btn").removeAttr("disabled")):"0"==o&&setTimeout((function(){location.reload()}),1e3)}})}));var a=e(".mf-entry-title"),o=e(".mf-form-user-confirmation"),n=e(".mf-form-admin-notification"),r=e(".mf-input-rest-api-group"),m=e(".mf-mailchimp"),l=e(".mf-get_response"),c=e(".mf-zapier"),f=e(".mf-slack"),d=e(".mf-paypal"),p=e(".mf-stripe"),_=e(".mf-ckit"),u=e(".mf-aweber"),h=e(".mf-mail-poet"),v=e(".mf-form-email-verification");let g=".mf-active-campaign",b=e("input"+g),k=e("div"+g);function w(t,i=null){var s=e("#metform-form-modalinput-settings").attr("data-nonce");e('.mf-mailster-list-id option[value="'+t+'"]').prop("selected",!0),e.ajax({url:window.metform_api.resturl+"metform/v1/forms/get_fields_data/"+i,type:"get",headers:{"X-WP-Nonce":s},dataType:"json",success:function(s){var a=s,o="";Object.keys(a).map((function(e){return[a[e]]})).map((e=>{o+="<option value="+e[0].mf_input_name+">"+e[0].mf_input_label+"</option>"})),function(t,i,s){var a=e("#metform-form-modalinput-settings").attr("data-nonce");e.ajax({url:window.metform_api.resturl+"metform/v1/forms/get_mailster_form/"+t,type:"get",headers:{"X-WP-Nonce":a},dataType:"json",success:function(t){var a="";for(const[e,s]of Object.entries(t))if("fields"==e)for(const[e,t]of Object.entries(s))a+='<div class="mf-input-group mf-input-group-inline"><label class="attr-input-label">'+t.name+'</label><div class="mf-inputs"><select class="attr-form-control" id="mailster_field_'+e+'" name="mailster_field_'+e+'">'+i+"</select></div></div>";e(".mf-mailster-settings-section").html(a),function(t,i){var s=window.mf_mailster_list_id;if(e(".mf-mailster-list-id").val()==s){var a=e("#metform-form-modalinput-settings").attr("data-nonce");e.ajax({url:window.metform_api.resturl+"metform/v1/forms/get_mailster_form_data/"+i,type:"get",headers:{"X-WP-Nonce":a},dataType:"json",success:function(t){for(const[i,s]of Object.entries(t))for(const[t,i]of Object.entries(s))e("#"+t+' option[value="'+i+'"]').prop("selected",!0)},error:function(e){}})}}(0,s)},error:function(e){}})}(t,o,i)},error:function(e){}})}function y(i){if(a.hide(),o.hide(),n.hide(),r.hide(),m.hide(),c.hide(),f.hide(),d.hide(),p.hide(),_.hide(),u.hide(),h.hide(),""!=i.form_title){e(".mf-form-modalinput-title").val(i.form_title),e(".mf-form-modalinput-success_message").val(i.success_message),e(".mf-entry-title-input").val("undefined"!=typeof i.entry_title&&""!=i.entry_title?i.entry_title:"undefined"==typeof i.entry_title||""==i.entry_title?"Entry # [mf_id]":""),e(".mf-form-modalinput-redirect_to").val(i.redirect_to),e(".mf-form-modalinput-success_url").val(i.success_url),e(".mf-form-modalinput-failed_cancel_url").val(i.failed_cancel_url),e(".mf-form-modalinput-limit_total_entries").val(i.limit_total_entries),e(".mf-form-email-verification-email-subject").val(i.email_verification_email_subject),e(".mf-form-email-verification-email-redirect").val(i.email_verification_confirm_redirect),e(".mf-form-email-verification-heading").val(i.email_verification_heading),e(".mf-form-email-verification-paragraph").val(i.email_verification_paragraph);let r=e(".mf-form-email-verification-enable");"1"==i.email_verification_enable?(r.attr("checked",!0),v.show()):(r.removeAttr("checked"),v.hide());let w=e(".mf_automizy_list_id");w&&w.val(i.mf_automizy_list_id);var s=e(".mf-form-modalinput-store_entries");"1"==i.store_entries?(s.attr("checked",!0),a.show()):(s.removeAttr("checked"),a.hide());var l=e(".mf-form-modalinput-hide_form_after_submission");"1"==i.hide_form_after_submission?l.attr("checked",!0):l.removeAttr("checked");var g=e(".mf-form-modalinput-require_login");"1"==i.require_login?g.attr("checked",!0):g.removeAttr("checked");var y=e(".mf-form-modalinput-limit_status");"1"==i.limit_total_entries_status?y.attr("checked",!0):y.removeAttr("checked");var j=e(".mf-form-modalinput-count_views");"1"==i.count_views?j.attr("checked",!0):j.removeAttr("checked");var x=e(".mf-form-modalinput-stop_vertical_scrolling");"1"==i.mf_stop_vertical_scrolling?x.attr("checked",!0):x.removeAttr("checked");var A=e(".mf-form-modalinput-multiple_submission");"1"==i.multiple_submission?A.attr("checked",!0):A.removeAttr("checked");var C=e(".mf-form-modalinput-enable_recaptcha");"1"==i.enable_recaptcha?C.attr("checked",!0):C.removeAttr("checked");var T=e(".mf-form-modalinput-capture_user_browser_data");"1"==i.capture_user_browser_data?(T.attr("checked",!0),e("#multiple_submission").removeClass("hide_input"),e("#multiple_submission").addClass("show_input")):T.removeAttr("checked"),e(".mf-form-user-email-subject").val(i.user_email_subject),e(".mf-form-user-email-from").val(i.user_email_from),e(".mf-form-user-reply-to").val(i.user_email_reply_to),e(".mf-form-user-email-body").val(i.user_email_body);var P=e(".mf-form-user-enable");"1"==i.enable_user_notification?(P.attr("checked",!0),o.show()):(P.removeAttr("checked"),o.hide());var N=e(".mf-form-user-submission-copy");"1"==i.user_email_attach_submission_copy?N.attr("checked",!0):N.removeAttr("checked"),e(".mf-form-admin-email-subject").val(i.admin_email_subject),e(".mf-form-admin-email-from").val(i.admin_email_from),e(".mf-form-admin-email-to").val(i.admin_email_to),e(".mf-form-admin-reply-to").val(i.admin_email_reply_to),e(".mf-form-admin-email-body").val(i.admin_email_body);var W=e(".mf-form-admin-enable");"1"==i.enable_admin_notification?(W.attr("checked",!0),n.show()):(W.removeAttr("checked"),n.hide());var z=e(".mf-form-admin-submission-copy");"1"==i.admin_email_attach_submission_copy?z.attr("checked",!0):z.removeAttr("checked");var X=e(".mf-form-modalinput-rest_api");"1"==i.mf_rest_api?(X.attr("checked",!0),e(".mf-rest-api").show()):(X.removeAttr("checked"),e(".mf-rest-api").hide());var E=e(".mf-form-modalinput-mail_chimp");"1"==i.mf_mail_chimp?(E.attr("checked",!0),m.show()):(E.removeAttr("checked"),m.hide());var S=e(".mf-form-modal_input-google_sheet");"1"==i.mf_google_sheet?S.attr("checked",!0):S.removeAttr("checked");let ee=e(".mf-form-modalinput-ckit"),te=e(".mf-form-modalinput-mail_aweber"),ie=e(".mf-form-modalinput-mail_poet");if("1"==i.mf_convert_kit?(ee.attr("checked",!0),_.show()):(ee.removeAttr("checked"),_.hide()),"1"==i.mf_mail_aweber?(te.attr("checked",!0),u.show()):(te.removeAttr("checked"),u.hide()),"1"==i.mf_mail_poet?(ie.attr("checked",!0),h.show()):(ie.removeAttr("checked"),h.hide()),i.ckit_opt){let t=e("select.mf-ckit-list-id").first(),s=i.mf_ckit_list_id||"";t.html(),i.ckit_opt.forEach((function(e){t.append('<option value="'+e.id+'">'+e.name+"</option>")})),t.val(s)}if(i.aweber_opt){let t=e("select.mf-aweber-list-id").first(),s=i.mf_aweber_list_id||"";t.html();for(let e in i.aweber_opt)t.append('<option value="'+i.aweber_opt[e].id+'">'+i.aweber_opt[e].name+"</option>");t.val(s)}if(i.mp_opt){let t=e("select.mf-mail-poet-list-id").first(),s=i.mf_mail_poet_list_id||"";t.html();for(let e in i.mp_opt)t.append('<option value="'+i.mp_opt[e].id+'">'+i.mp_opt[e].name+"</option>");t.val(s)}if("1"===i.mf_active_campaign){b.attr("checked",!0),k.show();let t=i.mf_active_campaign_list_id||"",s=i.mf_active_campaign_tag_id||"";e("select[name=mf_active_campaign_list_id]").val(t),e("select[name=mf_active_campaign_tag_id]").val(s)}else b.removeAttr("checked"),k.hide();var O=e(".mf-form-modalinput-get_response");"1"==i.mf_get_response?(O.attr("checked",!0),e(".mf-get_response").show()):(O.removeAttr("checked"),e(".mf-get_response").hide());var D=e(".mf-hubsopt");"1"==i.mf_hubspot?D.attr("checked",!0):D.removeAttr("checked");var I=e(".mf-hubspot-forms"),q=e(".hubspot_forms_section");"1"==i.mf_hubspot_forms?(I.attr("checked",!0),q.show()):(I.removeAttr("checked"),q.hide()),e(".mf_hubspot_form_portalId").val(i.mf_hubspot_form_portalId),e(".mf_hubspot_form_guid").val(i.mf_hubspot_form_guid);var U=e(".mf-zoho");"1"==i.mf_zoho?U.attr("checked",!0):U.removeAttr("checked");var F=e(".mf-helpscout");"1"==i.mf_helpscout?(F.attr("checked",!0),e(".helpscout_forms_section").show()):(F.removeAttr("chekced"),e(".helpscout_forms_section").hide()),i.mf_helpscout_mailbox&&e('#mf_helpscout_mailbox option[value="'+i.mf_helpscout_mailbox+'"]').prop("selected",!0);var R=e(".mf-form-modalinput-mailster"),G=e(".mf-mailster-settings-section");"1"==i.mf_mailster?(R.attr("checked",!0),G.show(),e(".mf-mailster-forms").show()):(R.removeAttr("checked"),G.hide(),e(".mf-mailster-forms").hide());var L=e(".mf-register");1==i.mf_registration?(L.attr("checked",!0),e(".mf_register_form_fields").show()):(L.removeAttr("checked"),e(".mf_register_form_fields").hide());var Q=e(".mf-login");1==i.mf_login?(Q.attr("checked",!0),e(".mf_login_form_fields").show()):(e(".mf_login_form_fields").hide(),Q.removeAttr("checked"));var K=e(".mf-form-to-post"),M=e(".mf-form-to-post-fields");1==i.mf_form_to_post?(K.attr("checked",!0),M.show()):(K.removeAttr("checked"),M.hide());var B=e(".mf-form-modalinput-zapier");"1"==i.mf_zapier?(B.attr("checked",!0),c.show()):(B.removeAttr("checked",!0),c.hide());var H=e(".mf-form-modalinput-slack");"1"==i.mf_slack?(H.attr("checked",!0),f.show()):(H.removeAttr("checked",!0),f.hide());var J=e(".mf-form-modalinput-paypal");"1"==i.mf_paypal?(J.attr("checked",!0),d.show()):(J.removeAttr("checked",!0),d.hide());var V=e(".mf-form-modalinput-stripe");"1"==i.mf_stripe?(V.attr("checked",!0),p.show()):(V.removeAttr("checked",!0),p.hide());V=e(".mf-form-modalinput-stripe");"1"==i.mf_stripe?(V.attr("checked",!0),p.show()):(V.removeAttr("checked",!0),p.hide());var Y=e(".mf-form-modalinput-paypal_sandbox");"1"==i.mf_paypal_sandbox?Y.attr("checked",!0):Y.removeAttr("checked",!0);var Z=e(".mf-form-modalinput-stripe_sandbox");"1"==i.mf_stripe_sandbox?Z.attr("checked",!0):Z.removeAttr("checked",!0);var $=i.mf_rest_api_method&&i.mf_rest_api_method.length?i.mf_rest_api_method:"POST";e('.mf-rest-api-method option[value="'+$+'"]').prop("selected",!0),e(".mf-rest-api-url").val(i.mf_rest_api_url),e(".mf-mailchimp-api-key").val(i.mf_mailchimp_api_key),e(".mf-mailchimp-list-id").val(i.mf_mailchimp_list_id),""==i.mf_mailchimp_list_id&&e(".mf-mailchimp-list-id").val(e(".mailchimp_list").find(":selected").val()),0!=i.mf_mailchimp_list_id&&e('.mailchimp_list option[value="'+i.mf_get_response_list_id+'"]').prop("selected",!0),t(),e(".mf-get_response-list-id").val(i.mf_get_response_list_id),0!=i.mf_get_response_list_id&&e('.get-response-campaign-list option[value="'+i.mf_get_response_list_id+'"]').prop("selected",!0),e(".mf-zapier-web-hook").val(i.mf_zapier_webhook),e(".mf-slack-web-hook").val(i.mf_slack_webhook),e(".mf-paypal-email").val(i.mf_paypal_email),e(".mf-paypal-token").val(i.mf_paypal_token),e(".mf-stripe-image-url").val(i.mf_stripe_image_url),e(".mf-stripe-live-publishiable-key").val(i.mf_stripe_live_publishiable_key),e(".mf-stripe-live-secret-key").val(i.mf_stripe_live_secret_key),e(".mf-stripe-test-publishiable-key").val(i.mf_stripe_test_publishiable_key),e(".mf-stripe-test-secret-key").val(i.mf_stripe_test_secret_key),e(".mf-recaptcha-site-key").val(i.mf_recaptcha_site_key),e(".mf-recaptcha-secret-key").val(i.mf_recaptcha_secret_key),e("input.mf-form-modalinput-limit_status, .mf-form-modalinput-rest_api").trigger("change")}(window.mf_mailster_list_id=i.mf_mailster_list_id,e('.mf-mailster-list-id option[value="'+i.mf_mailster_list_id+'"]').prop("selected",!0),e(".mf-form-modalinput-mailster").length)&&w(e(".mf-mailster-list-id").find(":selected").val(),e("#metform_form_modal").find("form").attr("data-mf-id"))}e("input.mf-form-modalinput-store_entries").on("change",(function(){e(this).is(":checked")?a.show():e(this).is(":not(:checked)")&&a.hide()})),e("input.mf-form-modalinput-limit_status").on("change",(function(){e(this).is(":checked")?e("#limit_status").find("input").removeAttr("disabled"):e(this).is(":not(:checked)")&&e("#limit_status").find("input").attr("disabled","disabled")})),e("input.mf-form-user-enable").on("change",(function(){e(this).is(":checked")?o.show():e(this).is(":not(:checked)")&&o.hide()})),e("input.mf-form-admin-enable").on("change",(function(){e(this).is(":checked")?n.show():e(this).is(":not(:checked)")&&n.hide()})),e("input.mf-form-modalinput-rest_api").on("change",(function(){e(this).is(":checked")?r.show():e(this).is(":not(:checked)")&&r.hide()})),e("input.mf-form-modalinput-mail_chimp").on("change",(function(){e(this).is(":checked")?m.show():e(this).is(":not(:checked)")&&m.hide()})),e(".mf-form-modalinput-get_response").on("change",(function(){e(this).is(":checked")?l.show():l.hide()})),e("input.mf-form-email-verification-enable").on("change",(function(){e(this).is(":checked")?v.show():e(this).is(":not(:checked)")&&v.hide()})),b.on("change",(function(){e(this).is(":checked")?k.show():k.hide()})),e("input.mf-form-modalinput-mail_aweber").on("change",(function(){e(this).is(":checked")?u.show():e(this).is(":not(:checked)")&&u.hide()})),e("input.mf-form-modalinput-mail_poet").on("change",(function(){e(this).is(":checked")?h.show():e(this).is(":not(:checked)")&&h.hide()})),e("input.mf-form-modalinput-ckit").on("change",(function(){e(this).is(":checked")?_.show():e(this).is(":not(:checked)")&&_.hide()})),e("input.mf-form-modalinput-zapier").on("change",(function(){e(this).is(":checked")?c.show():e(this).is(":not(:checked)")&&c.hide()})),e("input.mf-form-modalinput-slack").on("change",(function(){e(this).is(":checked")?f.show():e(this).is(":not(:checked)")&&f.hide()})),e("input.mf-form-modalinput-paypal").on("change",(function(){e(this).is(":checked")?d.show():e(this).is(":not(:checked)")&&d.hide()})),e("input.mf-form-modalinput-stripe").on("change",(function(){e(this).is(":checked")?stripe.show():e(this).is(":not(:checked)")&&stripe.hide()})),e("input.mf-form-modalinput-stripe_sandbox").on("change",(function(){e(this).is(":checked")?e(".mf_stripe_sandbox").show():e(this).is(":not(:checked)")&&e(".mf_stripe_sandbox").hide()})),e(".mf-hubspot-forms").on("change",(function(){e(this).is(":checked")?e(".hubspot_forms_section").show():e(".hubspot_forms_section").hide()})),e(".mf-register").on("change",(function(){e(this).is(":checked")?e(".mf_register_form_fields").show():e(".mf_register_form_fields").hide()})),e(".mf-login").on("change",(function(){e(this).is(":checked")?e(".mf_login_form_fields").show():e(".mf_login_form_fields").hide()})),e(".mf-form-to-post").on("change",(function(){e(this).is(":checked")?e(".mf-form-to-post-fields").show():e(".mf-form-to-post-fields").hide()})),e(".mf-helpscout").on("change",(function(){e(this).is(":checked")?e(".helpscout_forms_section").show():e(".helpscout_forms_section").hide()})),e(".mf-form-modalinput-mailster").on("change",(function(){e(this).is(":checked")?(e(".mf-mailster-settings-section").show(),e(".mf-mailster-forms").show()):(e(".mf-mailster-settings-section").hide(),e(".mf-mailster-forms").hide())})),e(".mf-mailster-list-id").on("change",(function(){e(this).val(),e("#metform-form-modalinput-settings").attr("data-mf-id")})),e(".get-response-campaign-list").on("change",(function(){e(".mf-get_response-list-id ").val(e(this).val())})),e("input.mf-form-modalinput-capture_user_browser_data").click((function(){e(this).is(":checked")?(e("#multiple_submission").removeClass("hide_input"),e("#multiple_submission").addClass("show_input")):e(this).is(":not(:checked)")&&(e("#multiple_submission").removeClass("show_input"),e("#multiple_submission").addClass("hide_input"))})),e(".mf-settings-tab .mf-setting-nav-link").on("click",(function(t){if(!e(this).hasClass("mf-setting-nav-hidden")){t.preventDefault();var i=e(this).attr("href");window.location.hash=i,e(this).parent().addClass("nav-tab-active").siblings().removeClass("nav-tab-active"),e(i).addClass("active").siblings().removeClass("active")}})),e(".mf-setting-nav-link").on("click",(function(t){e(this).hasClass("mf-setting-nav-hidden")?t.preventDefault():(e(this).parents(".nav-tab-wrapper").find("a").removeClass("top").removeClass("bottom"),e(this).parents("li").prev().find("a").addClass("top"),e(this).parents("li").next().find("a").addClass("bottom"))}));var j=e(".mf-settings-tab .mf-setting-nav-link").eq(1).attr("href");if(window.location.hash&&(j=window.location.hash),e('.mf-settings-tab .mf-setting-nav-link[href="'+j+'"]').trigger("click"),e(window).on("resize.mfSettings",(function(){e(".mf-setting-sidebar").css("width",e(".mf-setting-sidebar-column").width())})).trigger("resize.mfSettings"),e(".mf-setting-header").length>0){var x=e(".mf-setting-header").offset().top;e(window).scroll((function(){var t=e(".mf-setting-header");e(window).scrollTop()>=x?t.addClass("fixed").css({width:jQuery(".metform-admin-container").width()}):t.removeClass("fixed").css({width:"auto"})}))}function A(){return e("#metform-form-modalinput-settings").attr("data-nonce")}e(".mf-admin-single-accordion").on("click",".mf-admin-single-accordion--heading",(function(){e(this).next().slideToggle().parent().toggleClass("active").siblings().removeClass("active").find(".mf-admin-single-accordion--body").slideUp()})),e(".mf-admin-single-accordion:first-child .mf-admin-single-accordion--heading").trigger("click"),e(".mf-recaptcha-version").on("change",(function(){var t=e(this).val();e("#mf-"+t).fadeIn().siblings().hide()})),e(".mf-recaptcha-version").trigger("change"),e(".mf-form-modalinput-stripe_sandbox").on("change",(function(){var t=e(this).parents(".attr-form-group").eq(0).next(".mf-form-modalinput-stripe_sandbox_keys");e(this).is(":checked")?t.fadeIn():t.fadeOut()})),e(".mf-form-modalinput-stripe_sandbox").trigger("change"),e(document).on("click","#met_pro_aweber_authorize",(function(t){t.preventDefault();let i=e(this).closest("p.description");i.html("<span>Wait....</span>");var s=metform_api.admin_url+"admin-ajax.php",a={action:"get_aweber_authorization_url",api_key:e("#mf_aweber_dev_api_key").val(),api_sec:e("#mf_aweber_dev_api_sec").val()};e.ajax({url:s,method:"POST",data:a,dataType:"json",success:function(e){if(!0===e.success){let t='<a class=" button mf-setting-btn-link" href="'+e.data.url+'">Authorize The App </a>';i.html(t)}else if(e.data){let t=e.data;i.html('<span style="background-color: red; padding: 1px 5px;">'+t.msg+"</span>")}},error:function(e){i.html('<span style="color: red"> ajax error occurred, please check your internet connection..</span>')},complete:function(){}})})),e(document).on("click","#met_pro_aweber_propmpt_re_auth",(function(t){t.preventDefault(),e("#mf_aweber_dev_api_key").val("").prop("disabled",!1),e("#mf_aweber_dev_api_sec").val("").prop("disabled",!1),e(this).closest("p.description").html('<a class="button mf-setting-btn-link" id="met_pro_aweber_re_authorize"> Get Re - Authorization URL </a>')})),e(document).on("click","#met_pro_aweber_re_authorize",(function(t){t.preventDefault();let i=e(this).closest("p.description");i.html("<span>Wait....</span>");let s=e("#mf_aweber_dev_api_key").val();if(!s||s.length<1)return i.html('<span style="color: red">API Key can not be empty..</span>'),!1;var a=metform_api.admin_url+"admin-ajax.php",o={action:"get_aweber_re_authorization_url",api_key:s,api_sec:e("#mf_aweber_dev_api_sec").val()};e.ajax({url:a,method:"POST",data:o,dataType:"json",success:function(e){if(!0===e.success){let t=e.data;if("ok"==t.result){let e='<a class="mf-setting-btn-link" href="'+t.url+'">Authorize The App </a>';i.html(e)}else i.html("<span>"+t.msg+"</span>")}else if(e.data){let t=e.data;i.html('<span style="background-color: red; padding: 1px 5px;">'+t.msg+"</span>")}},error:function(e){i.html('<span style="color: red"> ajax error occurred, please check your internet connection..</span>')},complete:function(){}})})),e(document).on("click","#met_form_aweber_get_list",(function(t){t.preventDefault();let i=e(this),s=e("#mf_aweber_info"),a=metform_api.admin_url+"admin-ajax.php";e.ajax({url:a,method:"POST",data:{action:"get_list_lists"},dataType:"json",success:function(e){if(!0===e.success){let t=e.data,a=i.closest("div.mf-aweber").find("select");if(a.html(""),t.lists)for(let e in t.lists)a.append('<option value="'+t.lists[e].id+'">'+t.lists[e].name+"</option>");s.html("")}else if(e.data){let t=e.data;s.html('<span style="background-color: red; padding: 1px 5px;">'+t.msg+"</span>")}},error:function(e){s.html('<span style="color: red"> ajax error occurred, please check your internet connection..</span>')},complete:function(){}})})),e(document).on("click","#met_form_mail_poet_get_list",(function(t){t.preventDefault();let i=e(this),s=e("#mf_mail_poet_info"),a=metform_api.admin_url+"admin-ajax.php";e.ajax({url:a,method:"POST",data:{action:"mail_poet_get_email_list_lists"},dataType:"json",success:function(e){if(!0===e.success){let t=e.data,a=i.closest("div.mf-mail-poet").find("select");if(a.html(""),t.lists)for(let e in t.lists)a.append('<option value="'+t.lists[e].id+'">'+t.lists[e].name+"</option>");s.html("")}else if(e.data){let t=e.data;s.html('<span style="background-color: red; padding: 1px 5px;">'+t.msg+"</span>")}},error:function(e){s.html('<span style="color: red"> ajax error occurred, please check your internet connection..</span>')},complete:function(){}})})),e(document).on("click","#met_form_ckit_get_list",(function(t){t.preventDefault();var i=metform_api.admin_url+"admin-ajax.php";let s=e(this);e.ajax({url:i,method:"POST",data:{action:"get_form_lists"},dataType:"json",success:function(e){if(!0===e.success){let t=e.data,i=s.closest("div.mf-ckit").find("select");i.html(""),t.forms&&t.forms.forEach((function(e){i.append('<option value="'+e.id+'">'+e.name+"</option>")}))}else alert("Error occurred when trying to check for aweber authorization.")},error:function(e){},complete:function(){}})})),e(document).on("click","#met_form_act_camp_get_list",(function(t){t.preventDefault();let i=window.metform_api.resturl+"metform-pro/v1/active-campaign/email_lists",s=A(),a=e(this),o=e("#mf_act_camp_info");e.ajax({url:i,method:"GET",data:[],headers:{"X-WP-Nonce":s},dataType:"json",success:function(e){if(!0===e.success){let t=e.data,i=a.closest("div.mf-input-group").find("select");i.html(""),t.list&&t.list.forEach((function(e){i.append('<option value="'+e.sid+'">'+e.name+"</option>")})),o.html(e.data.msg)}else o.html(e.data.msg)},error:function(e){o.html('<span style="color: red"> ajax error occurred, please check your internet connection..</span>')},complete:function(){}})})),e(document).on("click","#met_form_act_camp_get_tags",(function(t){t.preventDefault();let i=window.metform_api.resturl+"metform-pro/v1/active-campaign/tag_lists",s=A(),a=e(this),o=e("#mf_act_camp_tag_info");e.ajax({url:i,method:"GET",data:[],headers:{"X-WP-Nonce":s},dataType:"json",success:function(e){if(!0===e.success){let t=e.data,i=a.closest("div.mf-input-group").find("select");i.html(""),t.list&&t.list.forEach((function(e){i.append('<option value="'+e.sid+'">'+e.name+"</option>")})),o.html(e.data.msg)}else o.html(e.data.msg)},error:function(e){o.html('<span style="color: red"> ajax error occurred, please check your internet connection..</span>')},complete:function(){}})})),e("#mf-helpscout-btn-token").click((function(){let t=window.metform_api.resturl+"metform/v1/forms/get_helpscout_access_token/123";e.ajax({url:t,type:"get",success:function(e){200==e.status&&location.reload()},error:function(e){alert("Something went wrong")}})}))}));
1
+ jQuery(document).ready((function(e){"use strict";function t(){var t=e(".mf-mailchimp-list-id").val();e(".mailchimp_list option").each(((i,s)=>{e(s).attr("selected",!1),s.value===t&&e(s).attr("selected",!0)}))}function i(){e(".mf-btn-del-singl-field").click((function(){e(this).parent(".mf-cf-single-field").remove()}))}function s(e,t="",i=""){return'<div id="mf-cf-single-field" class="mf-cf-single-field"">\n <div class="mf-cf-single-field-input">\n <label>Name</label>\n <input type="text" name="mf_post_submission_custom_fields_name[]" class="attr-form-control" value="'+t+'">\n </div>\n <div class="mf-cf-single-field-input">\n <label>Select Field</label>\n <select data-selected="'+i+'" name="mf_post_submission_mf_field_name[]" class="attr-form-control">'+e+'</select>\n </div>\n <a href="#" class="mf-btn-del-singl-field">Delete</a>\n </div>'}e(".metfrom-btn-refresh-get-response-list").click((function(){var t=e(this);t.addClass("mf-setting-spin");var i,s=e("#metform_form_modal"),a=e("#metform-form-modalinput-settings").attr("data-nonce"),o=e(".get-response-campaign-list");i=s.find("form").attr("data-mf-id"),e.ajax({url:window.metform_api.resturl+"metform/v1/entries/store_get_response_list/"+i,type:"get",headers:{"X-WP-Nonce":a},dataType:"json",success:function(e){o.empty(),e.forEach((e=>{o.append('<option value="'+e.campaignId+'">'+e.description+"</option>")})),t.removeClass("mf-setting-spin")},error:function(e){t.removeClass("mf-setting-spin")}})})),e(".metfrom-btn-refresh-mailchimp-list").on("click",(function(){var i=e(this);i.addClass("mf-setting-spin");var s,a=e("#metform_form_modal"),o=e("#metform-form-modalinput-settings").attr("data-nonce"),n=e(".mailchimp_list");s=a.find("form").attr("data-mf-id"),e.ajax({url:window.metform_api.resturl+"metform/v1/entries/store_mailchimp_list/"+s,type:"get",headers:{"X-WP-Nonce":o},dataType:"json",success:function(s){try{n.empty(),s.lists.forEach((e=>{n.append("<option value="+e.id+">"+e.name+"</option>")})),1===s.lists.length?e(".mf-mailchimp-list-id").attr("value",s.lists[0].id):(t(),e(".mailchimp_list").on("change",(t=>{e(".mf-mailchimp-list-id").attr("value",t.target.value)})))}catch(a){}i.removeClass("mf-setting-spin")},error:function(e){i.removeClass("mf-setting-spin")}})})),e(".metfrom-btn-refresh-hubsopt-list").click((function(){var t=e(this);t.addClass("mf-setting-spin");var i,s=e("#metform_form_modal"),a=e("#metform-form-modalinput-settings").attr("data-nonce"),o=e(".hubspot_forms");i=s.find("form").attr("data-mf-id"),e.ajax({url:window.metform_api.resturl+"metform/v1/forms/hubspot_forms/"+i,type:"get",headers:{"X-WP-Nonce":a},dataType:"json",success:function(e){try{o.empty(),o.append('<option value="select">Select a form</option>'),e.forEach((e=>{o.append("<option value="+e.portalId+" guid="+e.guid+">"+e.name+"</option>")}))}catch(i){}t.removeClass("mf-setting-spin")},error:function(e){t.removeClass("mf-setting-spin")}})})),e(".hubspot_forms").on("change",(function(){var t=e("option:selected",this).attr("guid"),i=e("option:selected",this).val();e(".mf_hubspot_form_guid").val(t),e(".mf_hubspot_form_portalId").val(i);var s,a=e("#metform_form_modal"),o=e("#metform-form-modalinput-settings").attr("data-nonce");s=a.find("form").attr("data-mf-id"),e("#mf-hubsopt-fileds").html("Please wait....");var n="";e.ajax({url:window.metform_api.resturl+"metform/v1/forms/get_fields_data/"+s,type:"get",headers:{"X-WP-Nonce":o},dataType:"json",success:function(i){n=i,e.ajax({url:window.metform_api.resturl+"metform/v1/forms/hubspot_form_fields/"+s,type:"post",headers:{"X-WP-Nonce":o},dataType:"json",data:{guid:t},success:function(t){var i="",s="";Object.keys(n).map((function(e){return[n[e]]})).map((e=>{s+="<option value="+e[0].mf_input_name+">"+e[0].mf_input_label+"</option>"}));t.forEach((e=>{i+="<tr><td>"+e.label+"</td><td><select name=mf_hubspot_form_field_name_"+e.name+' class="attr-form-control">'+s+"</select></td></tr>"})),e("#mf-hubsopt-fileds").html('<table width="100%">'+i+"</table>")},error:function(t){e("#mf-hubsopt-fileds").html("Sorry ! Something went wrong")}})},error:function(t){e("#mf-hubsopt-fileds").html("Sorry ! Something went wrong")}})})),e(".mf-mailchimp-list-id").attr("value",""),e(".row-actions .edit a, .page-title-action, .metform-form-edit-btn, body.post-type-metform-form a.row-title").on("click",(function(a){a.preventDefault();var o=0,n=e("#metform_form_modal"),r=e(this).parents(".column-title"),m=e("body").attr("data-metform-template-key");n.addClass("loading"),n.modal("show");if(r.length>0){o=e(this).attr("data-metform-form-id"),"undefined"!==m&&(o=m),o=o!==undefined?o:r.find(".hidden").attr("id").split("_")[1];var l=e("#metform-form-modalinput-settings").attr("data-nonce");e.ajax({url:window.metform_api.resturl+"metform/v1/forms/get/"+o,type:"get",headers:{"X-WP-Nonce":l},dataType:"json",success:function(t){t,j(t),n.removeClass("loading");const i=new CustomEvent("metform-integration-settings-event",{detail:{data:t},bubbles:!0,cancelable:!0,composed:!1});document.querySelector("#metform-form-modalinput-settings").dispatchEvent(i),function(t,i,s){e(".mf-helpscout").length&&e.ajax({url:window.metform_api.resturl+"metform/v1/forms/get_fields_data/"+t,type:"get",headers:{"X-WP-Nonce":i},dataType:"json",success:function(t){var i=t,a="";Object.keys(i).map((function(e){return[i[e]]})).map((e=>{a+="<option value="+e[0].mf_input_name+">"+e[0].mf_input_label+"</option>"}));var o='<div class="mf-input-group mf-input-group-inline">'+('<label class="attr-input-label">Subject*</label><div class="mf-inputs"><select class="attr-form-control" id="mf_helpscout_conversation_subject" name="mf_helpscout_conversation_subject">'+a+"</select></div>")+'</div><div class="mf-input-group mf-input-group-inline">'+('<label class="attr-input-label">Customer Email*</label><div class="mf-inputs"><select class="attr-form-control" id="mf_helpscout_conversation_customer_email" name="mf_helpscout_conversation_customer_email">'+a+"</select></div>")+'</div><div class="mf-input-group mf-input-group-inline">'+('<label class="attr-input-label">Customer First Name*</label><div class="mf-inputs"><select class="attr-form-control" id="mf_helpscout_conversation_customer_first_name" name="mf_helpscout_conversation_customer_first_name">'+a+"</select></div>")+'</div><div class="mf-input-group mf-input-group-inline">'+('<label class="attr-input-label">Customer Last Name*</label><div class="mf-inputs"><select class="attr-form-control" id="mf_helpscout_conversation_customer_last_name" name="mf_helpscout_conversation_customer_last_name">'+a+"</select></div>")+'</div><div class="mf-input-group mf-input-group-inline">'+('<label class="attr-input-label">Message*</label><div class="mf-inputs"><select class="attr-form-control" id="mf_helpscout_conversation_customer_message" name="mf_helpscout_conversation_customer_message">'+a+"</select></div>")+"</div>";e("#mf-helpscout-fileds").html(o),s.mf_helpscout_conversation_subject&&(e('#mf_helpscout_conversation_subject option[value="'+s.mf_helpscout_conversation_subject+'"]').prop("selected",!0),e('#mf_helpscout_conversation_customer_email option[value="'+s.mf_helpscout_conversation_customer_email+'"]').prop("selected",!0),e('#mf_helpscout_conversation_customer_first_name option[value="'+s.mf_helpscout_conversation_customer_first_name+'"]').prop("selected",!0),e('#mf_helpscout_conversation_customer_last_name option[value="'+s.mf_helpscout_conversation_customer_last_name+'"]').prop("selected",!0),e('#mf_helpscout_conversation_customer_message option[value="'+s.mf_helpscout_conversation_customer_message+'"]').prop("selected",!0))},error:function(e){}})}(o,l,t)}})}else{j({form_title:e(".mf-form-modalinput-title").attr("data-default-value"),admin_email_body:"",admin_email_from:"",admin_email_reply_to:"",admin_email_subject:"",capture_user_browser_data:"",enable_admin_notification:"",limit_total_entries_status:"",limit_total_entries:"0",redirect_to:"",success_url:"",failed_cancel_url:"",require_login:"",store_entries:"1",entry_title:"",success_message:e(".mf-form-modalinput-success_message").attr("data-default-value"),user_email_body:"",user_email_from:"",user_email_reply_to:"",user_email_subject:"",input_names:"Example: [mf-inputname]"}),n.removeClass("loading")}function c(e,t=""){let i="";return Array.isArray(e)&&e.map((e=>{const s=t===e[0].mf_input_name?" selected":"";i+="<option value="+e[0].mf_input_name+s+">"+e[0].mf_input_label+"</option>"})),i}e(".mf-register").length&&e.ajax({url:window.metform_api.resturl+"metform/v1/forms/get_fields_data/"+o,type:"get",headers:{"X-WP-Nonce":l},dataType:"json",success:function(t){var i=t,s="";e.ajax({url:window.metform_api.resturl+"xs/register/settings/"+o,type:"get",headers:{"X-WP-Nonce":l},dataType:"json",success:function(t){Object.keys(i).map((function(e){return[i[e]]})).map((e=>{s+="<option value="+e[0].mf_input_name+">"+e[0].mf_input_label+"</option>"}));var a='<div class="mf-input-group mf-input-group-inline">'+('<label class="attr-input-label">User Name</label><div class="mf-inputs"><select class="attr-form-control" id="mf_auth_reg_user_name" name="mf_auth_reg_user_name">'+s+"</select></div>")+'</div><div class="mf-input-group mf-input-group-inline">'+('<label class="attr-input-label">User Email</label><div class="mf-inputs"><select class="attr-form-control" id="mf_auth_reg_user_email" name="mf_auth_reg_user_email">'+s+"</select></div>")+'</div><div class="mf-input-group mf-input-group-inline"><label class="attr-input-label">Role</label><div class="mf-inputs"><select class="attr-form-control" id="mf_auth_reg_role" name="mf_auth_reg_role"><option value="administrator">Administrator</option><option value="editor">Editor</option><option value="author">Author</option><option value="contributor">Contributor</option><option selected="selected" value="subscriber">Subscriber</option></select></div></div>';e(".mf_register_form_fields").html(a),0!=t&&(e('#mf_auth_reg_user_name option[value="'+t.mf_auth_reg_user_name+'"]').prop("selected",!0),e('#mf_auth_reg_user_email option[value="'+t.mf_auth_reg_user_email+'"]').prop("selected",!0),e('#mf_auth_reg_role option[value="'+t.mf_auth_reg_role+'"]').prop("selected",!0))},error:function(e){}})},error:function(e){}}),e(".mf-login").length&&e.ajax({url:window.metform_api.resturl+"metform/v1/forms/get_fields_data/"+o,type:"get",headers:{"X-WP-Nonce":l},dataType:"json",success:function(t){var i=t,s="";e.ajax({url:window.metform_api.resturl+"xs/login/settings/"+o,type:"get",headers:{"X-WP-Nonce":l},dataType:"json",success:function(t){Object.keys(i).map((function(e){return[i[e]]})).map((e=>{s+="<option value="+e[0].mf_input_name+">"+e[0].mf_input_label+"</option>"}));var a='<div class="mf-input-group mf-input-group-inline">'+('<label class="attr-input-label">User Name</label><div class="mf-inputs"><select class="attr-form-control" id="mf_auth_login_user_name" name="mf_auth_login_user_name">'+s+"</select></div>")+'</div><div class="mf-input-group mf-input-group-inline">'+('<label class="attr-input-label">User Password</label><div class="mf-inputs"><select class="attr-form-control" id="mf_auth_login_user_password" name="mf_auth_login_user_password">'+s+"</select></div>")+"</div>";e(".mf_login_form_fields").html(a),0!=t&&(e('#mf_auth_login_user_name option[value="'+t.mf_auth_login_user_name+'"]').prop("selected",!0),e('#mf_auth_login_user_password option[value="'+t.mf_auth_login_user_password+'"]').prop("selected",!0))},error:function(e){}})},error:function(e){}}),e(".mf-form-to-post").length&&e.ajax({url:window.metform_api.resturl+"metform/v1/forms/get_fields_data/"+o,type:"get",headers:{"X-WP-Nonce":l},dataType:"json",success:function(t){var a=t,n="";e.ajax({url:window.metform_api.resturl+"xs/post/settings/"+o,type:"get",headers:{"X-WP-Nonce":l},dataType:"json",success:function(t){var o=Object.keys(a).map((function(e){return[a[e]]}));o.map((e=>{n+="<option value="+e[0].mf_input_name+">"+e[0].mf_input_label+"</option>"}));var r='<label class="attr-input-label">Title</label><div class="mf-inputs"><select class="attr-form-control mf_post_submission_title" id="mf_post_submission_title" name="mf_post_submission_title">'+n+"</select></div>",m='<label class="attr-input-label">Content</label><div class="mf-inputs"><select class="attr-form-control mf_post_submission_content" id="mf_post_submission_content" name="mf_post_submission_content">'+n+"</select></div>",l='<label class="attr-input-label">Featured Image</label><div class="mf-inputs"><select class="attr-form-control mf_post_submission_featured_image" id="mf_post_submission_featured_image" name="mf_post_submission_featured_image">'+n+"</select></div>",f=s(n);if(0!=t.custom_fields_settings){f="";var d=Object.entries(t.custom_fields_settings);for(const[e,t]of d)f+=s(c(o,t),e,t)}var p='<div class="mf-input-group mf-input-group-inline">'+r+'</div><div class="mf-input-group mf-input-group-inline">'+m+'</div></div><div class="mf-input-group mf-input-group-inline">'+l+'</div><div class="mf-input-group mf-input-group-inline">'+function(e,t){return'<label class="attr-input-label">Custom Fields</label>\n <div class="mf-inputs mf-cf-fields">\n <div style="display:none">\n <div id="mf-cf-single-field" class="mf-cf-single-field"">\n <div class="mf-cf-single-field-input">\n <label>Name</label>\n <input type="text" name="mf_post_submission_custom_fields_name[]" class="attr-form-control" >\n </div>\n <div class="mf-cf-single-field-input">\n <label>Select Field</label>\n <select name="mf_post_submission_mf_field_name[]" class="attr-form-control">'+t+'</select>\n </div>\n <a href="#" class="mf-btn-del-singl-field">Delete</a>\n </div>\n </div>\n <div class="repeaterResult">'+e+'</div>\n <button class="mf-add-cf" type="button"><span>+</span></button>\n </div>'}(f,n)+"</div>";e(".mf-post-submission-fields-section").html(p);var _=0;e(".mf-add-cf").click((function(){var t=e("#mf-cf-single-field").clone();_++,t.attr("id","mf-repeater-field-"+_),e(".mf-btn-del-singl-field",t).attr("data-id",_),t.appendTo(e(".repeaterResult")),i()})),i(),0!=t.fields_settings&&(e('.mf_post_submission_post_type option[value="'+t.fields_settings.mf_post_submission_post_type+'"]').prop("selected",!0),e('.mf_post_submission_title option[value="'+t.fields_settings.mf_post_submission_title+'"]').prop("selected",!0),e('.mf_post_submission_content option[value="'+t.fields_settings.mf_post_submission_content+'"]').prop("selected",!0),e('.mf_post_submission_featured_image option[value="'+t.fields_settings.mf_post_submission_featured_image+'"]').prop("selected",!0),e('.mf_post_submission_author option[value="'+t.fields_settings.mf_post_submission_author+'"]').prop("selected",!0))},error:function(e){}})},error:function(e){}}),function(t){var i=e("#metform-form-modalinput-settings").attr("data-nonce"),s=e(".get-response-campaign-list");e.ajax({url:window.metform_api.resturl+"metform/v1/entries/get_response_list/"+t,type:"get",headers:{"X-WP-Nonce":i},dataType:"json",success:function(e){s.empty(),e.length&&e.forEach((e=>{s.append("<option value="+e.campaignId+">"+e.description+"</option>")}))},error:function(e){}})}(o),function(t){var i=e(".metfrom-btn-refresh-hubsopt-list");i.addClass("mf-setting-spin");var s=e("#metform-form-modalinput-settings").attr("data-nonce"),a=e(".hubspot_forms"),o=t;e.ajax({url:window.metform_api.resturl+"metform/v1/forms/get_hubspot_forms/"+o,type:"get",headers:{"X-WP-Nonce":s},dataType:"json",success:function(e){try{a.empty(),a.append('<option value="select">Select a form</option>'),e.forEach((e=>{a.append("<option value="+e.portalId+" guid="+e.guid+">"+e.name+"</option>")}))}catch(t){}i.removeClass("mf-setting-spin")},error:function(e){i.removeClass("mf-setting-spin")}})}(o),function(i){e("#metform_form_modal");var s,a=e("#metform-form-modalinput-settings").attr("data-nonce"),o=e(".mailchimp_list");s=i,e.ajax({url:window.metform_api.resturl+"metform/v1/entries/get_mailchimp_list/"+s,type:"get",headers:{"X-WP-Nonce":a},dataType:"json",success:function(i){try{o.empty(),i.lists.forEach((e=>{o.append("<option value="+e.id+">"+e.name+"</option>")})),1===i.lists.length?e(".mf-mailchimp-list-id").attr("value",i.lists[0].id):(t(),e(".mailchimp_list").on("change",(t=>{e(".mf-mailchimp-list-id").attr("value",t.target.value)})))}catch(s){}},error:function(e){}})}(o),n.find("form").attr("data-mf-id",o),n.find(".get-response-campaign-list").attr("get-response-list-id",o)})),e(".metform-form-save-btn-editor").on("click",(function(){e(".metform-form-save-btn-editor").attr("disabled",!0);var t=e("#metform-form-modalinput-settings");t.attr("data-open-editor","1"),t.trigger("submit")})),e("#metform-form-modalinput-settings").on("submit",(function(t){t.preventDefault();var i=e("#metform-form-modal"),s=e(this);i.addClass("loading"),e(".metform-form-save-btn-editor").attr("disabled",!0),e(".metform-form-save-btn").attr("disabled",!0);var a=e(this).serialize(),o=e(this).attr("data-mf-id"),n=e(this).attr("data-open-editor"),r=e(this).attr("data-editor-url"),m=e(this).attr("data-nonce");e.ajax({url:window.metform_api.resturl+"metform/v1/forms/update/"+o,type:"post",data:a,headers:{"X-WP-Nonce":m},dataType:"json",success:function(t){e("#message").css("display","block"),1==t.saved?(e("#post-"+t.data.id).find(".row-title").html(t.data.title),e("#message").removeClass("attr-alert-warning").addClass("attr-alert-success").html(t.status)):e("#message").removeClass("attr-alert-success").addClass("attr-alert-warning").html(t.status),setTimeout((function(){e("#message").css("display","none"),s.find(".attr-close").trigger("click")}),1e3),i.removeClass("loading"),"1"==n&&1==t.saved?setTimeout((function(){window.location.href=r+"?post="+t.data.id+"&action=elementor"}),1e3):"0"!=o?(e(".metform-form-save-btn-editor").removeAttr("disabled"),e(".metform-form-save-btn").removeAttr("disabled")):"0"==o&&setTimeout((function(){location.reload()}),1e3)}})}));var a=e(".mf-entry-title"),o=e(".mf-form-user-confirmation"),n=e(".mf-form-admin-notification"),r=e(".mf-input-rest-api-group"),m=e(".mf-mailchimp"),l=e(".mf-get_response"),c=e(".mf-zapier"),f=e(".mf-slack"),d=e(".mf-fluent"),p=e(".mf-paypal"),_=e(".mf-stripe"),u=e(".mf-ckit"),h=e(".mf-aweber"),v=e(".mf-mail-poet"),g=e(".mf-form-email-verification");let b=".mf-active-campaign",k=e("input"+b),w=e("div"+b);function y(t,i=null){var s=e("#metform-form-modalinput-settings").attr("data-nonce");e('.mf-mailster-list-id option[value="'+t+'"]').prop("selected",!0),e.ajax({url:window.metform_api.resturl+"metform/v1/forms/get_fields_data/"+i,type:"get",headers:{"X-WP-Nonce":s},dataType:"json",success:function(s){var a=s,o="";Object.keys(a).map((function(e){return[a[e]]})).map((e=>{o+="<option value="+e[0].mf_input_name+">"+e[0].mf_input_label+"</option>"})),function(t,i,s){var a=e("#metform-form-modalinput-settings").attr("data-nonce");e.ajax({url:window.metform_api.resturl+"metform/v1/forms/get_mailster_form/"+t,type:"get",headers:{"X-WP-Nonce":a},dataType:"json",success:function(t){var a="";for(const[e,s]of Object.entries(t))if("fields"==e)for(const[e,t]of Object.entries(s))a+='<div class="mf-input-group mf-input-group-inline"><label class="attr-input-label">'+t.name+'</label><div class="mf-inputs"><select class="attr-form-control" id="mailster_field_'+e+'" name="mailster_field_'+e+'">'+i+"</select></div></div>";e(".mf-mailster-settings-section").html(a),function(t,i){var s=window.mf_mailster_list_id;if(e(".mf-mailster-list-id").val()==s){var a=e("#metform-form-modalinput-settings").attr("data-nonce");e.ajax({url:window.metform_api.resturl+"metform/v1/forms/get_mailster_form_data/"+i,type:"get",headers:{"X-WP-Nonce":a},dataType:"json",success:function(t){for(const[i,s]of Object.entries(t))for(const[t,i]of Object.entries(s))e("#"+t+' option[value="'+i+'"]').prop("selected",!0)},error:function(e){}})}}(0,s)},error:function(e){}})}(t,o,i)},error:function(e){}})}function j(i){if(a.hide(),o.hide(),n.hide(),r.hide(),m.hide(),c.hide(),f.hide(),p.hide(),_.hide(),u.hide(),h.hide(),v.hide(),""!=i.form_title){e(".mf-form-modalinput-title").val(i.form_title),e(".mf-form-modalinput-success_message").val(i.success_message),e(".mf-entry-title-input").val("undefined"!=typeof i.entry_title&&""!=i.entry_title?i.entry_title:"undefined"==typeof i.entry_title||""==i.entry_title?"Entry # [mf_id]":""),e(".mf-form-modalinput-redirect_to").val(i.redirect_to),e(".mf-form-modalinput-success_url").val(i.success_url),e(".mf-form-modalinput-failed_cancel_url").val(i.failed_cancel_url),e(".mf-form-modalinput-limit_total_entries").val(i.limit_total_entries),e(".mf-form-email-verification-email-subject").val(i.email_verification_email_subject),e(".mf-form-email-verification-email-redirect").val(i.email_verification_confirm_redirect),e(".mf-form-email-verification-heading").val(i.email_verification_heading),e(".mf-form-email-verification-paragraph").val(i.email_verification_paragraph);let r=e(".mf-form-email-verification-enable");"1"==i.email_verification_enable?(r.attr("checked",!0),g.show()):(r.removeAttr("checked"),g.hide());let y=e(".mf_automizy_list_id");y&&y.val(i.mf_automizy_list_id);var s=e(".mf-form-modalinput-store_entries");"1"==i.store_entries?(s.attr("checked",!0),a.show()):(s.removeAttr("checked"),a.hide());var l=e(".mf-form-modalinput-hide_form_after_submission");"1"==i.hide_form_after_submission?l.attr("checked",!0):l.removeAttr("checked");var b=e(".mf-form-modalinput-require_login");"1"==i.require_login?b.attr("checked",!0):b.removeAttr("checked");var j=e(".mf-form-modalinput-limit_status");"1"==i.limit_total_entries_status?j.attr("checked",!0):j.removeAttr("checked");var x=e(".mf-form-modalinput-count_views");"1"==i.count_views?x.attr("checked",!0):x.removeAttr("checked");var A=e(".mf-form-modalinput-stop_vertical_scrolling");"1"==i.mf_stop_vertical_scrolling?A.attr("checked",!0):A.removeAttr("checked");var C=e(".mf-form-modalinput-multiple_submission");"1"==i.multiple_submission?C.attr("checked",!0):C.removeAttr("checked");var T=e(".mf-form-modalinput-enable_recaptcha");"1"==i.enable_recaptcha?T.attr("checked",!0):T.removeAttr("checked");var P=e(".mf-form-modalinput-capture_user_browser_data");"1"==i.capture_user_browser_data?(P.attr("checked",!0),e("#multiple_submission").removeClass("hide_input"),e("#multiple_submission").addClass("show_input")):P.removeAttr("checked"),e(".mf-form-user-email-subject").val(i.user_email_subject),e(".mf-form-user-email-from").val(i.user_email_from),e(".mf-form-user-reply-to").val(i.user_email_reply_to),e(".mf-form-user-email-body").val(i.user_email_body);var N=e(".mf-form-user-enable");"1"==i.enable_user_notification?(N.attr("checked",!0),o.show()):(N.removeAttr("checked"),o.hide());var W=e(".mf-form-user-submission-copy");"1"==i.user_email_attach_submission_copy?W.attr("checked",!0):W.removeAttr("checked"),e(".mf-form-admin-email-subject").val(i.admin_email_subject),e(".mf-form-admin-email-from").val(i.admin_email_from),e(".mf-form-admin-email-to").val(i.admin_email_to),e(".mf-form-admin-reply-to").val(i.admin_email_reply_to),e(".mf-form-admin-email-body").val(i.admin_email_body);var z=e(".mf-form-admin-enable");"1"==i.enable_admin_notification?(z.attr("checked",!0),n.show()):(z.removeAttr("checked"),n.hide());var X=e(".mf-form-admin-submission-copy");"1"==i.admin_email_attach_submission_copy?X.attr("checked",!0):X.removeAttr("checked");var E=e(".mf-form-modalinput-rest_api");"1"==i.mf_rest_api?(E.attr("checked",!0),e(".mf-rest-api").show()):(E.removeAttr("checked"),e(".mf-rest-api").hide());var S=e(".mf-form-modalinput-mail_chimp");"1"==i.mf_mail_chimp?(S.attr("checked",!0),m.show()):(S.removeAttr("checked"),m.hide());var O=e(".mf-form-modal_input-google_sheet");"1"==i.mf_google_sheet?O.attr("checked",!0):O.removeAttr("checked");let ie=e(".mf-form-modalinput-ckit"),se=e(".mf-form-modalinput-mail_aweber"),ae=e(".mf-form-modalinput-mail_poet");if("1"==i.mf_convert_kit?(ie.attr("checked",!0),u.show()):(ie.removeAttr("checked"),u.hide()),"1"==i.mf_mail_aweber?(se.attr("checked",!0),h.show()):(se.removeAttr("checked"),h.hide()),"1"==i.mf_mail_poet?(ae.attr("checked",!0),v.show()):(ae.removeAttr("checked"),v.hide()),i.ckit_opt){let t=e("select.mf-ckit-list-id").first(),s=i.mf_ckit_list_id||"";t.html(),i.ckit_opt.forEach((function(e){t.append('<option value="'+e.id+'">'+e.name+"</option>")})),t.val(s)}if(i.aweber_opt){let t=e("select.mf-aweber-list-id").first(),s=i.mf_aweber_list_id||"";t.html();for(let e in i.aweber_opt)t.append('<option value="'+i.aweber_opt[e].id+'">'+i.aweber_opt[e].name+"</option>");t.val(s)}if(i.mp_opt){let t=e("select.mf-mail-poet-list-id").first(),s=i.mf_mail_poet_list_id||"";t.html();for(let e in i.mp_opt)t.append('<option value="'+i.mp_opt[e].id+'">'+i.mp_opt[e].name+"</option>");t.val(s)}if("1"===i.mf_active_campaign){k.attr("checked",!0),w.show();let t=i.mf_active_campaign_list_id||"",s=i.mf_active_campaign_tag_id||"";e("select[name=mf_active_campaign_list_id]").val(t),e("select[name=mf_active_campaign_tag_id]").val(s)}else k.removeAttr("checked"),w.hide();var D=e(".mf-form-modalinput-get_response");"1"==i.mf_get_response?(D.attr("checked",!0),e(".mf-get_response").show()):(D.removeAttr("checked"),e(".mf-get_response").hide());var I=e(".mf-hubsopt");"1"==i.mf_hubspot?I.attr("checked",!0):I.removeAttr("checked");var q=e(".mf-hubspot-forms"),U=e(".hubspot_forms_section");"1"==i.mf_hubspot_forms?(q.attr("checked",!0),U.show()):(q.removeAttr("checked"),U.hide()),e(".mf_hubspot_form_portalId").val(i.mf_hubspot_form_portalId),e(".mf_hubspot_form_guid").val(i.mf_hubspot_form_guid);var F=e(".mf-zoho");"1"==i.mf_zoho?F.attr("checked",!0):F.removeAttr("checked");var R=e(".mf-helpscout");"1"==i.mf_helpscout?(R.attr("checked",!0),e(".helpscout_forms_section").show()):(R.removeAttr("chekced"),e(".helpscout_forms_section").hide()),i.mf_helpscout_mailbox&&e('#mf_helpscout_mailbox option[value="'+i.mf_helpscout_mailbox+'"]').prop("selected",!0);var G=e(".mf-form-modalinput-mailster"),L=e(".mf-mailster-settings-section");"1"==i.mf_mailster?(G.attr("checked",!0),L.show(),e(".mf-mailster-forms").show()):(G.removeAttr("checked"),L.hide(),e(".mf-mailster-forms").hide());var Q=e(".mf-register");1==i.mf_registration?(Q.attr("checked",!0),e(".mf_register_form_fields").show()):(Q.removeAttr("checked"),e(".mf_register_form_fields").hide());var K=e(".mf-login");1==i.mf_login?(K.attr("checked",!0),e(".mf_login_form_fields").show()):(e(".mf_login_form_fields").hide(),K.removeAttr("checked"));var M=e(".mf-form-to-post"),B=e(".mf-form-to-post-fields");1==i.mf_form_to_post?(M.attr("checked",!0),B.show()):(M.removeAttr("checked"),B.hide());var H=e(".mf-form-modalinput-zapier");"1"==i.mf_zapier?(H.attr("checked",!0),c.show()):(H.removeAttr("checked",!0),c.hide());var J=e(".mf-form-modalinput-slack");"1"==i.mf_slack?(J.attr("checked",!0),f.show()):(J.removeAttr("checked",!0),f.hide());var V=e(".mf-form-modalinput-fluent");"1"==i.mf_fluent?(V.attr("checked",!0),d.show()):(V.removeAttr("checked",!0),d.hide());var Y=e(".mf-form-modalinput-paypal");"1"==i.mf_paypal?(Y.attr("checked",!0),p.show()):(Y.removeAttr("checked",!0),p.hide());var Z=e(".mf-form-modalinput-stripe");"1"==i.mf_stripe?(Z.attr("checked",!0),_.show()):(Z.removeAttr("checked",!0),_.hide());Z=e(".mf-form-modalinput-stripe");"1"==i.mf_stripe?(Z.attr("checked",!0),_.show()):(Z.removeAttr("checked",!0),_.hide());var $=e(".mf-form-modalinput-paypal_sandbox");"1"==i.mf_paypal_sandbox?$.attr("checked",!0):$.removeAttr("checked",!0);var ee=e(".mf-form-modalinput-stripe_sandbox");"1"==i.mf_stripe_sandbox?ee.attr("checked",!0):ee.removeAttr("checked",!0);var te=i.mf_rest_api_method&&i.mf_rest_api_method.length?i.mf_rest_api_method:"POST";e('.mf-rest-api-method option[value="'+te+'"]').prop("selected",!0),e(".mf-rest-api-url").val(i.mf_rest_api_url),e(".mf-mailchimp-api-key").val(i.mf_mailchimp_api_key),e(".mf-mailchimp-list-id").val(i.mf_mailchimp_list_id),""==i.mf_mailchimp_list_id&&e(".mf-mailchimp-list-id").val(e(".mailchimp_list").find(":selected").val()),0!=i.mf_mailchimp_list_id&&e('.mailchimp_list option[value="'+i.mf_get_response_list_id+'"]').prop("selected",!0),t(),e(".mf-get_response-list-id").val(i.mf_get_response_list_id),0!=i.mf_get_response_list_id&&e('.get-response-campaign-list option[value="'+i.mf_get_response_list_id+'"]').prop("selected",!0),e(".mf-zapier-web-hook").val(i.mf_zapier_webhook),e(".mf-slack-web-hook").val(i.mf_slack_webhook),e(".mf-fluent-web-hook").val(i.mf_fluent_webhook),e(".mf-paypal-email").val(i.mf_paypal_email),e(".mf-paypal-token").val(i.mf_paypal_token),e(".mf-stripe-image-url").val(i.mf_stripe_image_url),e(".mf-stripe-live-publishiable-key").val(i.mf_stripe_live_publishiable_key),e(".mf-stripe-live-secret-key").val(i.mf_stripe_live_secret_key),e(".mf-stripe-test-publishiable-key").val(i.mf_stripe_test_publishiable_key),e(".mf-stripe-test-secret-key").val(i.mf_stripe_test_secret_key),e(".mf-recaptcha-site-key").val(i.mf_recaptcha_site_key),e(".mf-recaptcha-secret-key").val(i.mf_recaptcha_secret_key),e("input.mf-form-modalinput-limit_status, .mf-form-modalinput-rest_api").trigger("change")}(window.mf_mailster_list_id=i.mf_mailster_list_id,e('.mf-mailster-list-id option[value="'+i.mf_mailster_list_id+'"]').prop("selected",!0),e(".mf-form-modalinput-mailster").length)&&y(e(".mf-mailster-list-id").find(":selected").val(),e("#metform_form_modal").find("form").attr("data-mf-id"))}e("input.mf-form-modalinput-store_entries").on("change",(function(){e(this).is(":checked")?a.show():e(this).is(":not(:checked)")&&a.hide()})),e("input.mf-form-modalinput-limit_status").on("change",(function(){e(this).is(":checked")?e("#limit_status").find("input").removeAttr("disabled"):e(this).is(":not(:checked)")&&e("#limit_status").find("input").attr("disabled","disabled")})),e("input.mf-form-user-enable").on("change",(function(){e(this).is(":checked")?o.show():e(this).is(":not(:checked)")&&o.hide()})),e("input.mf-form-admin-enable").on("change",(function(){e(this).is(":checked")?n.show():e(this).is(":not(:checked)")&&n.hide()})),e("input.mf-form-modalinput-rest_api").on("change",(function(){e(this).is(":checked")?r.show():e(this).is(":not(:checked)")&&r.hide()})),e("input.mf-form-modalinput-mail_chimp").on("change",(function(){e(this).is(":checked")?m.show():e(this).is(":not(:checked)")&&m.hide()})),e(".mf-form-modalinput-get_response").on("change",(function(){e(this).is(":checked")?l.show():l.hide()})),e("input.mf-form-email-verification-enable").on("change",(function(){e(this).is(":checked")?g.show():e(this).is(":not(:checked)")&&g.hide()})),k.on("change",(function(){e(this).is(":checked")?w.show():w.hide()})),e("input.mf-form-modalinput-mail_aweber").on("change",(function(){e(this).is(":checked")?h.show():e(this).is(":not(:checked)")&&h.hide()})),e("input.mf-form-modalinput-mail_poet").on("change",(function(){e(this).is(":checked")?v.show():e(this).is(":not(:checked)")&&v.hide()})),e("input.mf-form-modalinput-ckit").on("change",(function(){e(this).is(":checked")?u.show():e(this).is(":not(:checked)")&&u.hide()})),e("input.mf-form-modalinput-zapier").on("change",(function(){e(this).is(":checked")?c.show():e(this).is(":not(:checked)")&&c.hide()})),e("input.mf-form-modalinput-slack").on("change",(function(){e(this).is(":checked")?f.show():e(this).is(":not(:checked)")&&f.hide()})),e("input.mf-form-modalinput-fluent").on("change",(function(){e(this).is(":checked")?d.show():e(this).is(":not(:checked)")&&d.hide()})),e("input.mf-form-modalinput-paypal").on("change",(function(){e(this).is(":checked")?p.show():e(this).is(":not(:checked)")&&p.hide()})),e("input.mf-form-modalinput-stripe").on("change",(function(){e(this).is(":checked")?stripe.show():e(this).is(":not(:checked)")&&stripe.hide()})),e("input.mf-form-modalinput-stripe_sandbox").on("change",(function(){e(this).is(":checked")?e(".mf_stripe_sandbox").show():e(this).is(":not(:checked)")&&e(".mf_stripe_sandbox").hide()})),e(".mf-hubspot-forms").on("change",(function(){e(this).is(":checked")?e(".hubspot_forms_section").show():e(".hubspot_forms_section").hide()})),e(".mf-register").on("change",(function(){e(this).is(":checked")?e(".mf_register_form_fields").show():e(".mf_register_form_fields").hide()})),e(".mf-login").on("change",(function(){e(this).is(":checked")?e(".mf_login_form_fields").show():e(".mf_login_form_fields").hide()})),e(".mf-form-to-post").on("change",(function(){e(this).is(":checked")?e(".mf-form-to-post-fields").show():e(".mf-form-to-post-fields").hide()})),e(".mf-helpscout").on("change",(function(){e(this).is(":checked")?e(".helpscout_forms_section").show():e(".helpscout_forms_section").hide()})),e(".mf-form-modalinput-mailster").on("change",(function(){e(this).is(":checked")?(e(".mf-mailster-settings-section").show(),e(".mf-mailster-forms").show()):(e(".mf-mailster-settings-section").hide(),e(".mf-mailster-forms").hide())})),e(".mf-mailster-list-id").on("change",(function(){e(this).val(),e("#metform-form-modalinput-settings").attr("data-mf-id")})),e(".get-response-campaign-list").on("change",(function(){e(".mf-get_response-list-id ").val(e(this).val())})),e("input.mf-form-modalinput-capture_user_browser_data").click((function(){e(this).is(":checked")?(e("#multiple_submission").removeClass("hide_input"),e("#multiple_submission").addClass("show_input")):e(this).is(":not(:checked)")&&(e("#multiple_submission").removeClass("show_input"),e("#multiple_submission").addClass("hide_input"))})),e(".mf-settings-tab .mf-setting-nav-link").on("click",(function(t){if(!e(this).hasClass("mf-setting-nav-hidden")){t.preventDefault();var i=e(this).attr("href");window.location.hash=i,e(this).parent().addClass("nav-tab-active").siblings().removeClass("nav-tab-active"),e(i).addClass("active").siblings().removeClass("active")}})),e(".mf-setting-nav-link").on("click",(function(t){e(this).hasClass("mf-setting-nav-hidden")?t.preventDefault():(e(this).parents(".nav-tab-wrapper").find("a").removeClass("top").removeClass("bottom"),e(this).parents("li").prev().find("a").addClass("top"),e(this).parents("li").next().find("a").addClass("bottom"))}));var x=e(".mf-settings-tab .mf-setting-nav-link").eq(1).attr("href");if(window.location.hash&&(x=window.location.hash),e('.mf-settings-tab .mf-setting-nav-link[href="'+x+'"]').trigger("click"),e(window).on("resize.mfSettings",(function(){e(".mf-setting-sidebar").css("width",e(".mf-setting-sidebar-column").width())})).trigger("resize.mfSettings"),e(".mf-setting-header").length>0){var A=e(".mf-setting-header").offset().top;e(window).scroll((function(){var t=e(".mf-setting-header");e(window).scrollTop()>=A?t.addClass("fixed").css({width:jQuery(".metform-admin-container").width()}):t.removeClass("fixed").css({width:"auto"})}))}function C(){return e("#metform-form-modalinput-settings").attr("data-nonce")}e(".mf-admin-single-accordion").on("click",".mf-admin-single-accordion--heading",(function(){e(this).next().slideToggle().parent().toggleClass("active").siblings().removeClass("active").find(".mf-admin-single-accordion--body").slideUp()})),e(".mf-admin-single-accordion:first-child .mf-admin-single-accordion--heading").trigger("click"),e(".mf-recaptcha-version").on("change",(function(){var t=e(this).val();e("#mf-"+t).fadeIn().siblings().hide()})),e(".mf-recaptcha-version").trigger("change"),e(".mf-form-modalinput-stripe_sandbox").on("change",(function(){var t=e(this).parents(".attr-form-group").eq(0).next(".mf-form-modalinput-stripe_sandbox_keys");e(this).is(":checked")?t.fadeIn():t.fadeOut()})),e(".mf-form-modalinput-stripe_sandbox").trigger("change"),e(document).on("click","#met_pro_aweber_authorize",(function(t){t.preventDefault();let i=e(this).closest("p.description");i.html("<span>Wait....</span>");var s=metform_api.admin_url+"admin-ajax.php",a={action:"get_aweber_authorization_url",api_key:e("#mf_aweber_dev_api_key").val(),api_sec:e("#mf_aweber_dev_api_sec").val()};e.ajax({url:s,method:"POST",data:a,dataType:"json",success:function(e){if(!0===e.success){let t='<a class=" button mf-setting-btn-link" href="'+e.data.url+'">Authorize The App </a>';i.html(t)}else if(e.data){let t=e.data;i.html('<span style="background-color: red; padding: 1px 5px;">'+t.msg+"</span>")}},error:function(e){i.html('<span style="color: red"> ajax error occurred, please check your internet connection..</span>')},complete:function(){}})})),e(document).on("click","#met_pro_aweber_propmpt_re_auth",(function(t){t.preventDefault(),e("#mf_aweber_dev_api_key").val("").prop("disabled",!1),e("#mf_aweber_dev_api_sec").val("").prop("disabled",!1),e(this).closest("p.description").html('<a class="button mf-setting-btn-link" id="met_pro_aweber_re_authorize"> Get Re - Authorization URL </a>')})),e(document).on("click","#met_pro_aweber_re_authorize",(function(t){t.preventDefault();let i=e(this).closest("p.description");i.html("<span>Wait....</span>");let s=e("#mf_aweber_dev_api_key").val();if(!s||s.length<1)return i.html('<span style="color: red">API Key can not be empty..</span>'),!1;var a=metform_api.admin_url+"admin-ajax.php",o={action:"get_aweber_re_authorization_url",api_key:s,api_sec:e("#mf_aweber_dev_api_sec").val()};e.ajax({url:a,method:"POST",data:o,dataType:"json",success:function(e){if(!0===e.success){let t=e.data;if("ok"==t.result){let e='<a class="mf-setting-btn-link" href="'+t.url+'">Authorize The App </a>';i.html(e)}else i.html("<span>"+t.msg+"</span>")}else if(e.data){let t=e.data;i.html('<span style="background-color: red; padding: 1px 5px;">'+t.msg+"</span>")}},error:function(e){i.html('<span style="color: red"> ajax error occurred, please check your internet connection..</span>')},complete:function(){}})})),e(document).on("click","#met_form_aweber_get_list",(function(t){t.preventDefault();let i=e(this),s=e("#mf_aweber_info"),a=metform_api.admin_url+"admin-ajax.php";e.ajax({url:a,method:"POST",data:{action:"get_list_lists"},dataType:"json",success:function(e){if(!0===e.success){let t=e.data,a=i.closest("div.mf-aweber").find("select");if(a.html(""),t.lists)for(let e in t.lists)a.append('<option value="'+t.lists[e].id+'">'+t.lists[e].name+"</option>");s.html("")}else if(e.data){let t=e.data;s.html('<span style="background-color: red; padding: 1px 5px;">'+t.msg+"</span>")}},error:function(e){s.html('<span style="color: red"> ajax error occurred, please check your internet connection..</span>')},complete:function(){}})})),e(document).on("click","#met_form_mail_poet_get_list",(function(t){t.preventDefault();let i=e(this),s=e("#mf_mail_poet_info"),a=metform_api.admin_url+"admin-ajax.php";e.ajax({url:a,method:"POST",data:{action:"mail_poet_get_email_list_lists"},dataType:"json",success:function(e){if(!0===e.success){let t=e.data,a=i.closest("div.mf-mail-poet").find("select");if(a.html(""),t.lists)for(let e in t.lists)a.append('<option value="'+t.lists[e].id+'">'+t.lists[e].name+"</option>");s.html("")}else if(e.data){let t=e.data;s.html('<span style="background-color: red; padding: 1px 5px;">'+t.msg+"</span>")}},error:function(e){s.html('<span style="color: red"> ajax error occurred, please check your internet connection..</span>')},complete:function(){}})})),e(document).on("click","#met_form_ckit_get_list",(function(t){t.preventDefault();var i=metform_api.admin_url+"admin-ajax.php";let s=e(this);e.ajax({url:i,method:"POST",data:{action:"get_form_lists"},dataType:"json",success:function(e){if(!0===e.success){let t=e.data,i=s.closest("div.mf-ckit").find("select");i.html(""),t.forms&&t.forms.forEach((function(e){i.append('<option value="'+e.id+'">'+e.name+"</option>")}))}else alert("Error occurred when trying to check for aweber authorization.")},error:function(e){},complete:function(){}})})),e(document).on("click","#met_form_act_camp_get_list",(function(t){t.preventDefault();let i=window.metform_api.resturl+"metform-pro/v1/active-campaign/email_lists",s=C(),a=e(this),o=e("#mf_act_camp_info");e.ajax({url:i,method:"GET",data:[],headers:{"X-WP-Nonce":s},dataType:"json",success:function(e){if(!0===e.success){let t=e.data,i=a.closest("div.mf-input-group").find("select");i.html(""),t.list&&t.list.forEach((function(e){i.append('<option value="'+e.sid+'">'+e.name+"</option>")})),o.html(e.data.msg)}else o.html(e.data.msg)},error:function(e){o.html('<span style="color: red"> ajax error occurred, please check your internet connection..</span>')},complete:function(){}})})),e(document).on("click","#met_form_act_camp_get_tags",(function(t){t.preventDefault();let i=window.metform_api.resturl+"metform-pro/v1/active-campaign/tag_lists",s=C(),a=e(this),o=e("#mf_act_camp_tag_info");e.ajax({url:i,method:"GET",data:[],headers:{"X-WP-Nonce":s},dataType:"json",success:function(e){if(!0===e.success){let t=e.data,i=a.closest("div.mf-input-group").find("select");i.html(""),t.list&&t.list.forEach((function(e){i.append('<option value="'+e.sid+'">'+e.name+"</option>")})),o.html(e.data.msg)}else o.html(e.data.msg)},error:function(e){o.html('<span style="color: red"> ajax error occurred, please check your internet connection..</span>')},complete:function(){}})})),e("#mf-helpscout-btn-token").click((function(){let t=window.metform_api.resturl+"metform/v1/forms/get_helpscout_access_token/123";e.ajax({url:t,type:"get",success:function(e){200==e.status&&location.reload()},error:function(e){alert("Something went wrong")}})}))}));
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: ataurr, wpmet, emranio, atiqsu, easin55474, enamulhoquemohon, ashr
3
  Tags: Form builder, Elementor form builder, contact form, custom form, forms, drag & drop form builder
4
  Requires at least: 4.8
5
  Tested up to: 5.9
6
- Stable tag: 2.1.0
7
  Requires PHP: 7.0
8
  License: GPLv2 or later
9
  License URI: https://www.gnu.org/licenses/gpl-2.0.html
@@ -25,7 +25,7 @@ Metform built with elementor. Every field is an elementor widget.
25
 
26
 
27
  ###USEFUL LINKS###
28
- > **[Landing Page + Form Demo](https://products.wpmet.com/metform/)** | **[Need Support?](http://wpmet.com/support-help/)** | **[Documentation](https://wpmet.com/docs/docs/non-knowledgebase/metform/)** | **[Video Tutorials](https://www.youtube.com/watch?v=zg1QIouKO_Q&list=PL3t2OjZ6gY8NoB_48DwWKUDRtBEuBOxSc&ab_channel=Wpmet)** | [ **Buy Pro** ](https://products.wpmet.com/metform/pricing/) | **[Request a Feature](https://wpmet.com/plugin/metform/roadmaps#ideas)**
29
 
30
 
31
  Metform allows you to create any beautiful contact forms, feedback form, subscription forms, and other types of forms for your site in minutes, not hours! Full flexibility on your own hand.
@@ -227,6 +227,10 @@ Connect with Gmail, Slack, Mailchimp, and many more.
227
 
228
 
229
  == Changelog ==
 
 
 
 
230
  Version 2.1.0 // 2022-01-06
231
  Added: New button added for ask for rating library
232
  Improved: Added icon for rating
3
  Tags: Form builder, Elementor form builder, contact form, custom form, forms, drag & drop form builder
4
  Requires at least: 4.8
5
  Tested up to: 5.9
6
+ Stable tag: 2.1.1
7
  Requires PHP: 7.0
8
  License: GPLv2 or later
9
  License URI: https://www.gnu.org/licenses/gpl-2.0.html
25
 
26
 
27
  ###USEFUL LINKS###
28
+ > **[Landing Page + Form Demo](https://products.wpmet.com/metform/)** | **[Need Support?](http://wpmet.com/support-help/)** | **[Documentation](https://wpmet.com/knowledgebase/metform/)** | **[Video Tutorials](https://www.youtube.com/watch?v=zg1QIouKO_Q&list=PL3t2OjZ6gY8NoB_48DwWKUDRtBEuBOxSc&ab_channel=Wpmet)** | [ **Buy Pro** ](https://products.wpmet.com/metform/pricing/) | **[Request a Feature](https://wpmet.com/plugin/metform/roadmaps#ideas)**
29
 
30
 
31
  Metform allows you to create any beautiful contact forms, feedback form, subscription forms, and other types of forms for your site in minutes, not hours! Full flexibility on your own hand.
227
 
228
 
229
  == Changelog ==
230
+ Version 2.1.1 // 2022-01-22
231
+ Added: Fluent CRM Integration.
232
+ Tweaked: CSS and JS improved.
233
+
234
  Version 2.1.0 // 2022-01-06
235
  Added: New button added for ask for rating library
236
  Improved: Added icon for rating