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

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 wpmet
Plugin Icon 128x128 Metform Elementor Contact Form Builder – Flexible and Design-Friendly Contact Form builder plugin for WordPress
Version 2.1.5
Comparing to
See all releases

Code changes from version 2.1.4 to 2.1.5

core/admin/views/settings.php CHANGED
@@ -966,6 +966,8 @@ $settings = \MetForm\Core\Admin\Base::instance()->get_settings_option();
966
 
967
  <input type="hidden" name="mf_settings_page_action" value="save">
968
  <?php wp_nonce_field('metform-settings-page', 'metform-settings-page'); ?>
 
 
969
  </form>
970
  </div>
971
  </div>
966
 
967
  <input type="hidden" name="mf_settings_page_action" value="save">
968
  <?php wp_nonce_field('metform-settings-page', 'metform-settings-page'); ?>
969
+ <input type="hidden" id="mf_wp_rest_nonce" value="<?php echo wp_create_nonce('wp_rest'); ?>">
970
+
971
  </form>
972
  </div>
973
  </div>
core/entries/api.php CHANGED
@@ -18,10 +18,6 @@ class Api extends \MetForm\Base\Api
18
 
19
  public function post_insert()
20
  {
21
- /**
22
- * Get page id
23
- */
24
-
25
  $url = wp_get_referer();
26
  $post_id = url_to_postid($url);
27
  $post_id;
@@ -37,6 +33,9 @@ class Api extends \MetForm\Base\Api
37
 
38
  public function get_export()
39
  {
 
 
 
40
 
41
  $id = $this->request['id'];
42
 
@@ -45,6 +44,10 @@ class Api extends \MetForm\Base\Api
45
 
46
  public function get_get_response_list_id()
47
  {
 
 
 
 
48
  $post_id = $this->request['id'];
49
  return get_option('wpmet_get_response_list_' . $post_id);
50
  }
@@ -85,12 +88,19 @@ class Api extends \MetForm\Base\Api
85
 
86
  public function get_get_response_list()
87
  {
 
 
 
 
88
  $post_id = $this->request['id'];
89
  return get_option('wpmet_get_response_list_' . $post_id);
90
  }
91
 
92
  public function get_store_get_response_list()
93
  {
 
 
 
94
 
95
  if (class_exists('\MetForm_Pro\Core\Integrations\Email\Getresponse\Get_Response')) {
96
 
@@ -111,12 +121,18 @@ class Api extends \MetForm\Base\Api
111
 
112
  public function get_get_mailchimp_list()
113
  {
 
 
 
114
  $post_id = $this->request['id'];
115
  return get_option('wpmet_get_mailchimp_list_' . $post_id);
116
  }
117
 
118
  public function get_store_mailchimp_list()
119
  {
 
 
 
120
 
121
  $post_id = $this->request['id'];
122
  $data = \MetForm\Core\Forms\Action::instance()->get_all_data($post_id);
18
 
19
  public function post_insert()
20
  {
 
 
 
 
21
  $url = wp_get_referer();
22
  $post_id = url_to_postid($url);
23
  $post_id;
33
 
34
  public function get_export()
35
  {
36
+ if(!current_user_can('manage_options')) {
37
+ return;
38
+ }
39
 
40
  $id = $this->request['id'];
41
 
44
 
45
  public function get_get_response_list_id()
46
  {
47
+ if(!current_user_can('manage_options')) {
48
+ return;
49
+ }
50
+
51
  $post_id = $this->request['id'];
52
  return get_option('wpmet_get_response_list_' . $post_id);
53
  }
88
 
89
  public function get_get_response_list()
90
  {
91
+ if(!current_user_can('manage_options')) {
92
+ return;
93
+ }
94
+
95
  $post_id = $this->request['id'];
96
  return get_option('wpmet_get_response_list_' . $post_id);
97
  }
98
 
99
  public function get_store_get_response_list()
100
  {
101
+ if(!current_user_can('manage_options')) {
102
+ return;
103
+ }
104
 
105
  if (class_exists('\MetForm_Pro\Core\Integrations\Email\Getresponse\Get_Response')) {
106
 
121
 
122
  public function get_get_mailchimp_list()
123
  {
124
+ if(!current_user_can('manage_options')) {
125
+ return;
126
+ }
127
  $post_id = $this->request['id'];
128
  return get_option('wpmet_get_mailchimp_list_' . $post_id);
129
  }
130
 
131
  public function get_store_mailchimp_list()
132
  {
133
+ if(!current_user_can('manage_options')) {
134
+ return;
135
+ }
136
 
137
  $post_id = $this->request['id'];
138
  $data = \MetForm\Core\Forms\Action::instance()->get_all_data($post_id);
core/forms/action.php CHANGED
@@ -35,9 +35,6 @@ Class Action {
35
  }
36
 
37
  public function store($form_id, $form_setting) {
38
- if(!current_user_can('manage_options')) {
39
- return;
40
- }
41
 
42
  $this->fields = $this->get_fields();
43
  $this->sanitize($form_setting);
@@ -87,10 +84,6 @@ Class Action {
87
 
88
  public function insert() {
89
 
90
- if(!current_user_can('manage_options')) {
91
- return;
92
- }
93
-
94
  $this->title = ($this->form_setting['form_title'] != '') ? $this->form_setting['form_title'] : 'New Form # ' . time();
95
 
96
  $defaults = [
@@ -123,9 +116,6 @@ Class Action {
123
  }
124
 
125
  public function update() {
126
- if(!current_user_can('manage_options')) {
127
- return;
128
- }
129
 
130
  $this->title = ($this->form_setting['form_title'] != '') ? $this->form_setting['form_title'] : 'Form # ' . time();
131
 
@@ -184,10 +174,6 @@ Class Action {
184
  * @return array|null
185
  */
186
  public function get_all_data($post_id) {
187
-
188
- if(!current_user_can('manage_options')) {
189
- return;
190
- }
191
 
192
  $post = get_post($post_id);
193
 
@@ -256,10 +242,6 @@ Class Action {
256
 
257
  public function count_views($form_id) {
258
 
259
- if(current_user_can('manage_options')) {
260
- return;
261
- }
262
-
263
  $form_setting = $this->get_all_data($form_id);
264
  //return $form_setting;
265
 
35
  }
36
 
37
  public function store($form_id, $form_setting) {
 
 
 
38
 
39
  $this->fields = $this->get_fields();
40
  $this->sanitize($form_setting);
84
 
85
  public function insert() {
86
 
 
 
 
 
87
  $this->title = ($this->form_setting['form_title'] != '') ? $this->form_setting['form_title'] : 'New Form # ' . time();
88
 
89
  $defaults = [
116
  }
117
 
118
  public function update() {
 
 
 
119
 
120
  $this->title = ($this->form_setting['form_title'] != '') ? $this->form_setting['form_title'] : 'Form # ' . time();
121
 
174
  * @return array|null
175
  */
176
  public function get_all_data($post_id) {
 
 
 
 
177
 
178
  $post = get_post($post_id);
179
 
242
 
243
  public function count_views($form_id) {
244
 
 
 
 
 
245
  $form_setting = $this->get_all_data($form_id);
246
  //return $form_setting;
247
 
core/forms/api.php CHANGED
@@ -17,6 +17,10 @@ class Api extends \MetForm\Base\Api
17
 
18
  public function post_update()
19
  {
 
 
 
 
20
  $form_id = $this->request['id'];
21
 
22
  $form_setting = $this->request->get_params();
@@ -158,6 +162,10 @@ class Api extends \MetForm\Base\Api
158
 
159
  public function get_get()
160
  {
 
 
 
 
161
  $form_id = $this->request['id'];
162
 
163
  return Action::instance()->get_all_data($form_id);
@@ -171,12 +179,20 @@ class Api extends \MetForm\Base\Api
171
 
172
  public function get_form_content()
173
  {
 
 
 
 
174
  $form_id = $this->request['id'];
175
  return Builder::instance()->get_form_content($form_id);
176
  }
177
 
178
  public function get_builder_form_id()
179
  {
 
 
 
 
180
  $title = $this->request['title'];
181
  $template_id = $this->request['id'];
182
  return Builder::instance()->create_form($title, $template_id);
@@ -184,6 +200,10 @@ class Api extends \MetForm\Base\Api
184
 
185
  public function get_templates()
186
  {
 
 
 
 
187
  $form_id = $this->request['id'];
188
  $args = array(
189
  'post_type' => Base::instance()->form->get_name(),
@@ -212,6 +232,9 @@ class Api extends \MetForm\Base\Api
212
 
213
  public function get_hubspot_forms()
214
  {
 
 
 
215
 
216
  $form_id = $this->request['id'];
217
 
@@ -240,6 +263,10 @@ class Api extends \MetForm\Base\Api
240
 
241
  public function get_get_hubspot_forms()
242
  {
 
 
 
 
243
  $key = $form_id = $this->request['id'];
244
 
245
  $key = 'hubsopt_forms_' . $form_id . '_';
@@ -249,6 +276,10 @@ class Api extends \MetForm\Base\Api
249
 
250
  public function post_hubspot_form_fields()
251
  {
 
 
 
 
252
  $form_id = $this->request['id'];
253
 
254
  $form_guid = $this->request['guid'];
@@ -264,6 +295,9 @@ class Api extends \MetForm\Base\Api
264
 
265
  public function get_get_fields_data()
266
  {
 
 
 
267
 
268
  $form_id = $this->request['id'];
269
  $input_widgets = \Metform\Widgets\Manifest::instance()->get_input_widgets();
@@ -276,22 +310,37 @@ class Api extends \MetForm\Base\Api
276
 
277
  public function get_get_mailster_forms()
278
  {
 
 
 
 
279
  return (new \MetForm_Pro\Core\Integrations\Email\Mailster\Api())->get_forms();
280
  }
281
 
282
  public function get_get_mailster_form()
283
  {
 
 
 
 
284
  $form_id = $this->request['id'];
285
  return (new \MetForm_Pro\Core\Integrations\Email\Mailster\Api())->get_form($form_id);
286
  }
287
 
288
  public function get_get_mailster_form_data()
289
  {
 
 
 
 
290
  $form_id = $this->request['id'];
291
  return get_option('mf_mailster_form_data_' . $form_id);
292
  }
293
 
294
  public function get_get_helpscout_access_token(){
 
 
 
295
 
296
  $app_id = \MetForm\Utils\Util::get_form_settings('mf_helpscout_app_id');
297
  $app_secret = \MetForm\Utils\Util::get_form_settings('mf_helpscout_app_secret');
@@ -345,10 +394,17 @@ class Api extends \MetForm\Base\Api
345
  }
346
 
347
  public function get_get_helpscout_mailboxes(){
 
 
 
348
  return get_option('mf_helpscout_mailboxes');
349
  }
350
 
351
  public function get_get_helpscout_mailbox(){
 
 
 
 
352
  return \MetForm\Utils\Util::get_form_settings('mf_helpscout_mailbox');
353
  }
354
 
17
 
18
  public function post_update()
19
  {
20
+ if(!current_user_can('manage_options')) {
21
+ return;
22
+ }
23
+
24
  $form_id = $this->request['id'];
25
 
26
  $form_setting = $this->request->get_params();
162
 
163
  public function get_get()
164
  {
165
+ if(!current_user_can('manage_options')) {
166
+ return;
167
+ }
168
+
169
  $form_id = $this->request['id'];
170
 
171
  return Action::instance()->get_all_data($form_id);
179
 
180
  public function get_form_content()
181
  {
182
+ if(!current_user_can('manage_options')) {
183
+ return;
184
+ }
185
+
186
  $form_id = $this->request['id'];
187
  return Builder::instance()->get_form_content($form_id);
188
  }
189
 
190
  public function get_builder_form_id()
191
  {
192
+ if(!current_user_can('manage_options')) {
193
+ return;
194
+ }
195
+
196
  $title = $this->request['title'];
197
  $template_id = $this->request['id'];
198
  return Builder::instance()->create_form($title, $template_id);
200
 
201
  public function get_templates()
202
  {
203
+ if(!current_user_can('manage_options')) {
204
+ return;
205
+ }
206
+
207
  $form_id = $this->request['id'];
208
  $args = array(
209
  'post_type' => Base::instance()->form->get_name(),
232
 
233
  public function get_hubspot_forms()
234
  {
235
+ if(!current_user_can('manage_options')) {
236
+ return;
237
+ }
238
 
239
  $form_id = $this->request['id'];
240
 
263
 
264
  public function get_get_hubspot_forms()
265
  {
266
+ if(!current_user_can('manage_options')) {
267
+ return;
268
+ }
269
+
270
  $key = $form_id = $this->request['id'];
271
 
272
  $key = 'hubsopt_forms_' . $form_id . '_';
276
 
277
  public function post_hubspot_form_fields()
278
  {
279
+ if(!current_user_can('manage_options')) {
280
+ return;
281
+ }
282
+
283
  $form_id = $this->request['id'];
284
 
285
  $form_guid = $this->request['guid'];
295
 
296
  public function get_get_fields_data()
297
  {
298
+ if(!current_user_can('manage_options')) {
299
+ return;
300
+ }
301
 
302
  $form_id = $this->request['id'];
303
  $input_widgets = \Metform\Widgets\Manifest::instance()->get_input_widgets();
310
 
311
  public function get_get_mailster_forms()
312
  {
313
+ if(!current_user_can('manage_options')) {
314
+ return;
315
+ }
316
+
317
  return (new \MetForm_Pro\Core\Integrations\Email\Mailster\Api())->get_forms();
318
  }
319
 
320
  public function get_get_mailster_form()
321
  {
322
+ if(!current_user_can('manage_options')) {
323
+ return;
324
+ }
325
+
326
  $form_id = $this->request['id'];
327
  return (new \MetForm_Pro\Core\Integrations\Email\Mailster\Api())->get_form($form_id);
328
  }
329
 
330
  public function get_get_mailster_form_data()
331
  {
332
+ if(!current_user_can('manage_options')) {
333
+ return;
334
+ }
335
+
336
  $form_id = $this->request['id'];
337
  return get_option('mf_mailster_form_data_' . $form_id);
338
  }
339
 
340
  public function get_get_helpscout_access_token(){
341
+ if(!current_user_can('manage_options')) {
342
+ return;
343
+ }
344
 
345
  $app_id = \MetForm\Utils\Util::get_form_settings('mf_helpscout_app_id');
346
  $app_secret = \MetForm\Utils\Util::get_form_settings('mf_helpscout_app_secret');
394
  }
395
 
396
  public function get_get_helpscout_mailboxes(){
397
+ if(!current_user_can('manage_options')) {
398
+ return;
399
+ }
400
  return get_option('mf_helpscout_mailboxes');
401
  }
402
 
403
  public function get_get_helpscout_mailbox(){
404
+ if(!current_user_can('manage_options')) {
405
+ return;
406
+ }
407
+
408
  return \MetForm\Utils\Util::get_form_settings('mf_helpscout_mailbox');
409
  }
410
 
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.4\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/metform\n"
7
- "POT-Creation-Date: 2022-04-20 07:03:50+00:00\n"
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=utf-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
@@ -998,17 +998,17 @@ msgstr ""
998
  msgid "Total"
999
  msgstr ""
1000
 
1001
- #: core/forms/action.php:82 core/forms/action.php:108
1002
  msgid "Form settings inserted"
1003
  msgstr ""
1004
 
1005
- #: core/forms/action.php:112
1006
  msgid ""
1007
  "You must active at least one field of these fields \"store entry/ "
1008
  "Confirmation/ Notification/ MailChimp/ Zapier\". "
1009
  msgstr ""
1010
 
1011
- #: core/forms/action.php:116 core/forms/action.php:152
1012
  msgid "You must enable \"store entries\" for integrating payment method."
1013
  msgstr ""
1014
 
2
  # This file is distributed under the GPL-2.0+.
3
  msgid ""
4
  msgstr ""
5
+ "Project-Id-Version: MetForm 2.1.5\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/metform\n"
7
+ "POT-Creation-Date: 2022-04-20 10:01:26+00:00\n"
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=utf-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
998
  msgid "Total"
999
  msgstr ""
1000
 
1001
+ #: core/forms/action.php:79 core/forms/action.php:101
1002
  msgid "Form settings inserted"
1003
  msgstr ""
1004
 
1005
+ #: core/forms/action.php:105
1006
  msgid ""
1007
  "You must active at least one field of these fields \"store entry/ "
1008
  "Confirmation/ Notification/ MailChimp/ Zapier\". "
1009
  msgstr ""
1010
 
1011
+ #: core/forms/action.php:109 core/forms/action.php:142
1012
  msgid "You must enable \"store entries\" for integrating payment method."
1013
  msgstr ""
1014
 
metform.php CHANGED
@@ -3,7 +3,7 @@
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.4
7
  * Author: Wpmet
8
  * Author URI: https://wpmet.com
9
  * Text Domain: metform
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.5
7
  * Author: Wpmet
8
  * Author URI: https://wpmet.com
9
  * Text Domain: metform
plugin.php CHANGED
@@ -21,7 +21,7 @@ final class Plugin {
21
 
22
  public function version()
23
  {
24
- return '2.1.4';
25
  }
26
 
27
  public function package_type()
21
 
22
  public function version()
23
  {
24
+ return '2.1.5';
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"),m=e(this).parents(".column-title"),r=e("body").attr("data-metform-template-key");n.addClass("loading"),n.modal("show");if(m.length>0){o=e(this).attr("data-metform-form-id"),"undefined"!==r&&(o=r),o=o!==undefined?o:m.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,N(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{N({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",user_email_attach_submission_copy:"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 m='<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>",r='<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">'+m+'</div><div class="mf-input-group mf-input-group-inline">'+r+'</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"),m=e(this).attr("data-editor-url"),r=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":r},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=m+"?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"),m=e(".mf-input-rest-api-group"),r=e(".mf-mailchimp"),l=e(".mf-get_response"),c=e(".mf-zapier"),f=e(".mf-slack"),d=e(".mf-fluent"),p=e(".mf-sms"),_=e(".mf-sms-user"),u=e(".mf-sms-admin"),h=e(".mf-form-modalinput-sms"),v=e(".mf-form-modalinput-sms-user"),g=e(".mf-form-modalinput-sms-admin"),b=e(".mf-paypal"),k=e(".mf-stripe"),w=e(".mf-ckit"),y=e(".mf-aweber"),j=e(".mf-mail-poet"),x=e(".mf-form-email-verification");let A=".mf-active-campaign",C=e("input"+A),T=e("div"+A);function P(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 N(i){if(a.hide(),o.hide(),n.hide(),m.hide(),r.hide(),c.hide(),f.hide(),b.hide(),k.hide(),w.hide(),y.hide(),j.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 m=e(".mf-form-email-verification-enable");"1"==i.email_verification_enable?(m.attr("checked",!0),x.show()):(m.removeAttr("checked"),x.hide());let P=e(".mf_automizy_list_id");P&&P.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 A=e(".mf-form-modalinput-require_login");"1"==i.require_login?A.attr("checked",!0):A.removeAttr("checked");var N=e(".mf-form-modalinput-limit_status");"1"==i.limit_total_entries_status?N.attr("checked",!0):N.removeAttr("checked");var W=e(".mf-form-modalinput-count_views");"1"==i.count_views?W.attr("checked",!0):W.removeAttr("checked");var z=e(".mf-form-modalinput-stop_vertical_scrolling");"1"==i.mf_stop_vertical_scrolling?z.attr("checked",!0):z.removeAttr("checked");var X=e(".mf-form-modalinput-multiple_submission");"1"==i.multiple_submission?X.attr("checked",!0):X.removeAttr("checked");var E=e(".mf-form-modalinput-enable_recaptcha");"1"==i.enable_recaptcha?E.attr("checked",!0):E.removeAttr("checked");var S=e(".mf-form-modalinput-capture_user_browser_data");"1"==i.capture_user_browser_data?(S.attr("checked",!0),e("#multiple_submission").removeClass("hide_input"),e("#multiple_submission").addClass("show_input")):S.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 O=e(".mf-form-user-enable");"1"==i.enable_user_notification?(O.attr("checked",!0),o.show()):(O.removeAttr("checked"),o.hide());var D=e(".mf-form-user-submission-copy");"1"==i.user_email_attach_submission_copy?D.attr("checked",!0):D.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 I=e(".mf-form-admin-enable");"1"==i.enable_admin_notification?(I.attr("checked",!0),n.show()):(I.removeAttr("checked"),n.hide());var q=e(".mf-form-admin-submission-copy");"1"==i.admin_email_attach_submission_copy?q.attr("checked",!0):q.removeAttr("checked");var U=e(".mf-form-modalinput-rest_api");"1"==i.mf_rest_api?(U.attr("checked",!0),e(".mf-rest-api").show()):(U.removeAttr("checked"),e(".mf-rest-api").hide());var F=e(".mf-form-modalinput-mail_chimp");"1"==i.mf_mail_chimp?(F.attr("checked",!0),r.show()):(F.removeAttr("checked"),r.hide());var R=e(".mf-form-modal_input-google_sheet");"1"==i.mf_google_sheet?R.attr("checked",!0):R.removeAttr("checked");let me=e(".mf-form-modalinput-ckit"),re=e(".mf-form-modalinput-mail_aweber"),le=e(".mf-form-modalinput-mail_poet");if("1"==i.mf_convert_kit?(me.attr("checked",!0),w.show()):(me.removeAttr("checked"),w.hide()),"1"==i.mf_mail_aweber?(re.attr("checked",!0),y.show()):(re.removeAttr("checked"),y.hide()),"1"==i.mf_mail_poet?(le.attr("checked",!0),j.show()):(le.removeAttr("checked"),j.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){C.attr("checked",!0),T.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 C.removeAttr("checked"),T.hide();var G=e(".mf-form-modalinput-get_response");"1"==i.mf_get_response?(G.attr("checked",!0),e(".mf-get_response").show()):(G.removeAttr("checked"),e(".mf-get_response").hide());var L=e(".mf-hubsopt");"1"==i.mf_hubspot?L.attr("checked",!0):L.removeAttr("checked");var Q=e(".mf-hubspot-forms"),K=e(".hubspot_forms_section");"1"==i.mf_hubspot_forms?(Q.attr("checked",!0),K.show()):(Q.removeAttr("checked"),K.hide()),e(".mf_hubspot_form_portalId").val(i.mf_hubspot_form_portalId),e(".mf_hubspot_form_guid").val(i.mf_hubspot_form_guid);var M=e(".mf-zoho");"1"==i.mf_zoho?M.attr("checked",!0):M.removeAttr("checked");var B=e(".mf-helpscout");"1"==i.mf_helpscout?(B.attr("checked",!0),e(".helpscout_forms_section").show()):(B.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 H=e(".mf-form-modalinput-mailster"),J=e(".mf-mailster-settings-section");"1"==i.mf_mailster?(H.attr("checked",!0),J.show(),e(".mf-mailster-forms").show()):(H.removeAttr("checked"),J.hide(),e(".mf-mailster-forms").hide());var V=e(".mf-register");1==i.mf_registration?(V.attr("checked",!0),e(".mf_register_form_fields").show()):(V.removeAttr("checked"),e(".mf_register_form_fields").hide());var Y=e(".mf-login");1==i.mf_login?(Y.attr("checked",!0),e(".mf_login_form_fields").show()):(e(".mf_login_form_fields").hide(),Y.removeAttr("checked"));var Z=e(".mf-form-to-post"),$=e(".mf-form-to-post-fields");1==i.mf_form_to_post?(Z.attr("checked",!0),$.show()):(Z.removeAttr("checked"),$.hide());var ee=e(".mf-form-modalinput-zapier");"1"==i.mf_zapier?(ee.attr("checked",!0),c.show()):(ee.removeAttr("checked",!0),c.hide());var te=e(".mf-form-modalinput-slack");"1"==i.mf_slack?(te.attr("checked",!0),f.show()):(te.removeAttr("checked",!0),f.hide());var ie=e(".mf-form-modalinput-fluent");if("1"==i.mf_fluent?(ie.attr("checked",!0),d.show()):(ie.removeAttr("checked",!0),d.hide()),"1"==i.mf_sms_user_status?(v.attr("checked",!0),_.show()):(v.removeAttr("checked",!0),_.hide()),"1"==i.mf_sms_admin_status?(g.attr("checked",!0),u.show()):(g.removeAttr("checked",!0),u.hide()),"1"==i.mf_sms_status?(h.attr("checked",!0),p.show()):(h.removeAttr("checked",!0),p.hide(),v.removeAttr("checked",!0),_.hide(),g.removeAttr("checked",!0),u.hide()),i.mf_payment_currency){e("select.mf_payment_currency").val(i.mf_payment_currency)}let ce=e(".mf-form-modalinput-paypal");"1"==i.mf_paypal?(ce.attr("checked",!0),b.show()):(ce.removeAttr("checked",!0),b.hide());var se=e(".mf-form-modalinput-stripe");"1"==i.mf_stripe?(se.attr("checked",!0),k.show()):(se.removeAttr("checked",!0),k.hide());se=e(".mf-form-modalinput-stripe");"1"==i.mf_stripe?(se.attr("checked",!0),k.show()):(se.removeAttr("checked",!0),k.hide());var ae=e(".mf-form-modalinput-paypal_sandbox");"1"==i.mf_paypal_sandbox?ae.attr("checked",!0):ae.removeAttr("checked",!0);var oe=e(".mf-form-modalinput-stripe_sandbox");"1"==i.mf_stripe_sandbox?oe.attr("checked",!0):oe.removeAttr("checked",!0);var ne=i.mf_rest_api_method&&i.mf_rest_api_method.length?i.mf_rest_api_method:"POST";e('.mf-rest-api-method option[value="'+ne+'"]').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-sms-from").val(i.mf_sms_from),e(".mf-sms-twilio-account-sid").val(i.mf_sms_twilio_account_sid),e(".mf-sms-twilio-auth-token").val(i.mf_sms_twilio_auth_token),e(".mf-sms-user-body").val(i.mf_sms_user_body),e(".mf-sms-admin-body").val(i.mf_sms_admin_body),e(".mf-sms-admin-to").val(i.mf_sms_admin_to),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)&&P(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")?m.show():e(this).is(":not(:checked)")&&m.hide()})),e("input.mf-form-modalinput-mail_chimp").on("change",(function(){e(this).is(":checked")?r.show():e(this).is(":not(:checked)")&&r.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")?x.show():e(this).is(":not(:checked)")&&x.hide()})),C.on("change",(function(){e(this).is(":checked")?T.show():T.hide()})),e("input.mf-form-modalinput-mail_aweber").on("change",(function(){e(this).is(":checked")?y.show():e(this).is(":not(:checked)")&&y.hide()})),e("input.mf-form-modalinput-mail_poet").on("change",(function(){e(this).is(":checked")?j.show():e(this).is(":not(:checked)")&&j.hide()})),e("input.mf-form-modalinput-ckit").on("change",(function(){e(this).is(":checked")?w.show():e(this).is(":not(:checked)")&&w.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-sms-user").on("change",(function(){e(this).is(":checked")?_.show():e(this).is(":not(:checked)")&&_.hide()})),e("input.mf-form-modalinput-sms-admin").on("change",(function(){e(this).is(":checked")?u.show():e(this).is(":not(:checked)")&&u.hide()})),e("input.mf-form-modalinput-sms").on("change",(function(){e(this).is(":checked")?p.show():e(this).is(":not(:checked)")&&(p.hide(),v.removeAttr("checked",!0),_.hide(),g.removeAttr("checked",!0),u.hide())})),e("input.mf-form-modalinput-paypal").on("change",(function(){e(this).is(":checked")?b.show():e(this).is(":not(:checked)")&&b.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 W=e(".mf-settings-tab .mf-setting-nav-link").eq(1).attr("href");if(window.location.hash&&(W=window.location.hash),e('.mf-settings-tab .mf-setting-nav-link[href="'+W+'"]').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 z=e(".mf-setting-header").offset().top;e(window).scroll((function(){var t=e(".mf-setting-header");e(window).scrollTop()>=z?t.addClass("fixed").css({width:jQuery(".metform-admin-container").width()}):t.removeClass("fixed").css({width:"auto"})}))}function X(){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=X(),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=X(),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"),m=e(this).parents(".column-title"),r=e("body").attr("data-metform-template-key");n.addClass("loading"),n.modal("show");if(m.length>0){o=e(this).attr("data-metform-form-id"),"undefined"!==r&&(o=r),o=o!==undefined?o:m.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,N(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{N({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",user_email_attach_submission_copy:"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 m='<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>",r='<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">'+m+'</div><div class="mf-input-group mf-input-group-inline">'+r+'</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"),m=e(this).attr("data-editor-url"),r=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":r},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=m+"?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"),m=e(".mf-input-rest-api-group"),r=e(".mf-mailchimp"),l=e(".mf-get_response"),c=e(".mf-zapier"),f=e(".mf-slack"),d=e(".mf-fluent"),p=e(".mf-sms"),_=e(".mf-sms-user"),u=e(".mf-sms-admin"),h=e(".mf-form-modalinput-sms"),v=e(".mf-form-modalinput-sms-user"),g=e(".mf-form-modalinput-sms-admin"),b=e(".mf-paypal"),k=e(".mf-stripe"),w=e(".mf-ckit"),y=e(".mf-aweber"),j=e(".mf-mail-poet"),x=e(".mf-form-email-verification");let A=".mf-active-campaign",C=e("input"+A),T=e("div"+A);function P(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 N(i){if(a.hide(),o.hide(),n.hide(),m.hide(),r.hide(),c.hide(),f.hide(),b.hide(),k.hide(),w.hide(),y.hide(),j.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 m=e(".mf-form-email-verification-enable");"1"==i.email_verification_enable?(m.attr("checked",!0),x.show()):(m.removeAttr("checked"),x.hide());let P=e(".mf_automizy_list_id");P&&P.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 A=e(".mf-form-modalinput-require_login");"1"==i.require_login?A.attr("checked",!0):A.removeAttr("checked");var N=e(".mf-form-modalinput-limit_status");"1"==i.limit_total_entries_status?N.attr("checked",!0):N.removeAttr("checked");var W=e(".mf-form-modalinput-count_views");"1"==i.count_views?W.attr("checked",!0):W.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 z=e(".mf-form-modalinput-multiple_submission");"1"==i.multiple_submission?z.attr("checked",!0):z.removeAttr("checked");var E=e(".mf-form-modalinput-enable_recaptcha");"1"==i.enable_recaptcha?E.attr("checked",!0):E.removeAttr("checked");var S=e(".mf-form-modalinput-capture_user_browser_data");"1"==i.capture_user_browser_data?(S.attr("checked",!0),e("#multiple_submission").removeClass("hide_input"),e("#multiple_submission").addClass("show_input")):S.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 O=e(".mf-form-user-enable");"1"==i.enable_user_notification?(O.attr("checked",!0),o.show()):(O.removeAttr("checked"),o.hide());var D=e(".mf-form-user-submission-copy");"1"==i.user_email_attach_submission_copy?D.attr("checked",!0):D.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 I=e(".mf-form-admin-enable");"1"==i.enable_admin_notification?(I.attr("checked",!0),n.show()):(I.removeAttr("checked"),n.hide());var q=e(".mf-form-admin-submission-copy");"1"==i.admin_email_attach_submission_copy?q.attr("checked",!0):q.removeAttr("checked");var U=e(".mf-form-modalinput-rest_api");"1"==i.mf_rest_api?(U.attr("checked",!0),e(".mf-rest-api").show()):(U.removeAttr("checked"),e(".mf-rest-api").hide());var F=e(".mf-form-modalinput-mail_chimp");"1"==i.mf_mail_chimp?(F.attr("checked",!0),r.show()):(F.removeAttr("checked"),r.hide());var R=e(".mf-form-modal_input-google_sheet");"1"==i.mf_google_sheet?R.attr("checked",!0):R.removeAttr("checked");let me=e(".mf-form-modalinput-ckit"),re=e(".mf-form-modalinput-mail_aweber"),le=e(".mf-form-modalinput-mail_poet");if("1"==i.mf_convert_kit?(me.attr("checked",!0),w.show()):(me.removeAttr("checked"),w.hide()),"1"==i.mf_mail_aweber?(re.attr("checked",!0),y.show()):(re.removeAttr("checked"),y.hide()),"1"==i.mf_mail_poet?(le.attr("checked",!0),j.show()):(le.removeAttr("checked"),j.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){C.attr("checked",!0),T.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 C.removeAttr("checked"),T.hide();var G=e(".mf-form-modalinput-get_response");"1"==i.mf_get_response?(G.attr("checked",!0),e(".mf-get_response").show()):(G.removeAttr("checked"),e(".mf-get_response").hide());var L=e(".mf-hubsopt");"1"==i.mf_hubspot?L.attr("checked",!0):L.removeAttr("checked");var Q=e(".mf-hubspot-forms"),K=e(".hubspot_forms_section");"1"==i.mf_hubspot_forms?(Q.attr("checked",!0),K.show()):(Q.removeAttr("checked"),K.hide()),e(".mf_hubspot_form_portalId").val(i.mf_hubspot_form_portalId),e(".mf_hubspot_form_guid").val(i.mf_hubspot_form_guid);var M=e(".mf-zoho");"1"==i.mf_zoho?M.attr("checked",!0):M.removeAttr("checked");var B=e(".mf-helpscout");"1"==i.mf_helpscout?(B.attr("checked",!0),e(".helpscout_forms_section").show()):(B.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 H=e(".mf-form-modalinput-mailster"),J=e(".mf-mailster-settings-section");"1"==i.mf_mailster?(H.attr("checked",!0),J.show(),e(".mf-mailster-forms").show()):(H.removeAttr("checked"),J.hide(),e(".mf-mailster-forms").hide());var V=e(".mf-register");1==i.mf_registration?(V.attr("checked",!0),e(".mf_register_form_fields").show()):(V.removeAttr("checked"),e(".mf_register_form_fields").hide());var Y=e(".mf-login");1==i.mf_login?(Y.attr("checked",!0),e(".mf_login_form_fields").show()):(e(".mf_login_form_fields").hide(),Y.removeAttr("checked"));var Z=e(".mf-form-to-post"),$=e(".mf-form-to-post-fields");1==i.mf_form_to_post?(Z.attr("checked",!0),$.show()):(Z.removeAttr("checked"),$.hide());var ee=e(".mf-form-modalinput-zapier");"1"==i.mf_zapier?(ee.attr("checked",!0),c.show()):(ee.removeAttr("checked",!0),c.hide());var te=e(".mf-form-modalinput-slack");"1"==i.mf_slack?(te.attr("checked",!0),f.show()):(te.removeAttr("checked",!0),f.hide());var ie=e(".mf-form-modalinput-fluent");if("1"==i.mf_fluent?(ie.attr("checked",!0),d.show()):(ie.removeAttr("checked",!0),d.hide()),"1"==i.mf_sms_user_status?(v.attr("checked",!0),_.show()):(v.removeAttr("checked",!0),_.hide()),"1"==i.mf_sms_admin_status?(g.attr("checked",!0),u.show()):(g.removeAttr("checked",!0),u.hide()),"1"==i.mf_sms_status?(h.attr("checked",!0),p.show()):(h.removeAttr("checked",!0),p.hide(),v.removeAttr("checked",!0),_.hide(),g.removeAttr("checked",!0),u.hide()),i.mf_payment_currency){e("select.mf_payment_currency").val(i.mf_payment_currency)}let ce=e(".mf-form-modalinput-paypal");"1"==i.mf_paypal?(ce.attr("checked",!0),b.show()):(ce.removeAttr("checked",!0),b.hide());var se=e(".mf-form-modalinput-stripe");"1"==i.mf_stripe?(se.attr("checked",!0),k.show()):(se.removeAttr("checked",!0),k.hide());se=e(".mf-form-modalinput-stripe");"1"==i.mf_stripe?(se.attr("checked",!0),k.show()):(se.removeAttr("checked",!0),k.hide());var ae=e(".mf-form-modalinput-paypal_sandbox");"1"==i.mf_paypal_sandbox?ae.attr("checked",!0):ae.removeAttr("checked",!0);var oe=e(".mf-form-modalinput-stripe_sandbox");"1"==i.mf_stripe_sandbox?oe.attr("checked",!0):oe.removeAttr("checked",!0);var ne=i.mf_rest_api_method&&i.mf_rest_api_method.length?i.mf_rest_api_method:"POST";e('.mf-rest-api-method option[value="'+ne+'"]').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-sms-from").val(i.mf_sms_from),e(".mf-sms-twilio-account-sid").val(i.mf_sms_twilio_account_sid),e(".mf-sms-twilio-auth-token").val(i.mf_sms_twilio_auth_token),e(".mf-sms-user-body").val(i.mf_sms_user_body),e(".mf-sms-admin-body").val(i.mf_sms_admin_body),e(".mf-sms-admin-to").val(i.mf_sms_admin_to),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)&&P(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")?m.show():e(this).is(":not(:checked)")&&m.hide()})),e("input.mf-form-modalinput-mail_chimp").on("change",(function(){e(this).is(":checked")?r.show():e(this).is(":not(:checked)")&&r.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")?x.show():e(this).is(":not(:checked)")&&x.hide()})),C.on("change",(function(){e(this).is(":checked")?T.show():T.hide()})),e("input.mf-form-modalinput-mail_aweber").on("change",(function(){e(this).is(":checked")?y.show():e(this).is(":not(:checked)")&&y.hide()})),e("input.mf-form-modalinput-mail_poet").on("change",(function(){e(this).is(":checked")?j.show():e(this).is(":not(:checked)")&&j.hide()})),e("input.mf-form-modalinput-ckit").on("change",(function(){e(this).is(":checked")?w.show():e(this).is(":not(:checked)")&&w.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-sms-user").on("change",(function(){e(this).is(":checked")?_.show():e(this).is(":not(:checked)")&&_.hide()})),e("input.mf-form-modalinput-sms-admin").on("change",(function(){e(this).is(":checked")?u.show():e(this).is(":not(:checked)")&&u.hide()})),e("input.mf-form-modalinput-sms").on("change",(function(){e(this).is(":checked")?p.show():e(this).is(":not(:checked)")&&(p.hide(),v.removeAttr("checked",!0),_.hide(),g.removeAttr("checked",!0),u.hide())})),e("input.mf-form-modalinput-paypal").on("change",(function(){e(this).is(":checked")?b.show():e(this).is(":not(:checked)")&&b.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 W=e(".mf-settings-tab .mf-setting-nav-link").eq(1).attr("href");if(window.location.hash&&(W=window.location.hash),e('.mf-settings-tab .mf-setting-nav-link[href="'+W+'"]').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 z(){return e("#metform-form-modalinput-settings").attr("data-nonce")}function E(){return e("#mf_wp_rest_nonce").val()}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,headers:{"X-WP-Nonce":E()},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,headers:{"X-WP-Nonce":E()},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"},headers:{"X-WP-Nonce":z()},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"},headers:{"X-WP-Nonce":z()},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"},headers:{"X-WP-Nonce":z()},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=z(),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=z(),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",headers:{"X-WP-Nonce":E()},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, easin55474
3
  Tags: Form builder, contact form, Elementor contact form, contact form builder, elementor forms builder, drag and drop builder
4
  Requires at least: 4.8
5
  Tested up to: 5.9
6
- Stable tag: 2.1.4
7
  Requires PHP: 7.0
8
  License: GPLv2 or later
9
  License URI: https://www.gnu.org/licenses/gpl-2.0.html
@@ -229,8 +229,11 @@ Connect with Gmail, Slack, Mailchimp, and many more.
229
 
230
  == Changelog ==
231
 
 
 
 
232
  Version 2.1.4 // 2022-04-20
233
- Fixed: Secuirity issue.
234
  Tweaked: CSS and JS improved
235
 
236
  Version 2.1.3 // 2022-03-28
3
  Tags: Form builder, contact form, Elementor contact form, contact form builder, elementor forms builder, drag and drop builder
4
  Requires at least: 4.8
5
  Tested up to: 5.9
6
+ Stable tag: 2.1.5
7
  Requires PHP: 7.0
8
  License: GPLv2 or later
9
  License URI: https://www.gnu.org/licenses/gpl-2.0.html
229
 
230
  == Changelog ==
231
 
232
+ Version 2.1.5 // 2022-04-20
233
+ Fixed: Form view count was not working.
234
+
235
  Version 2.1.4 // 2022-04-20
236
+ Fixed: Security issue.
237
  Tweaked: CSS and JS improved
238
 
239
  Version 2.1.3 // 2022-03-28