<?php

namespace PWH_DCFH\App\Frontend\DiviContactForm;

use ET_Builder_Element;
use PWH_DCFH\App\Frontend\Request\PWH_DCFH_Confirmation_Email_Request;
use PWH_DCFH\App\Frontend\Request\PWH_DCFH_Post_Repository;
use PWH_DCFH\App\Frontend\Request\PWH_DCFH_Post_Request;
use PWH_DCFH\App\Frontend\DiviContactForm\Features\PWH_DCFH_Submit_Button;
use PWH_DCFH\App\Frontend\DiviContactForm\Features\PWH_DCFH_Success_Button;
use PWH_DCFH\App\Frontend\DiviContactForm\Features\PWH_DCFH_Success_Message;
use PWH_DCFH\App\Frontend\DiviContactForm\Features\PWH_DCFH_Field_Layout;
use PWH_DCFH\App\Frontend\DiviContactForm\Features\PWH_DCFH_Modify_Form;
use PWH_DCFH\App\Frontend\DiviContactForm\Features\PWH_DCFH_Field_Date_Time;
use PWH_DCFH\App\Frontend\DiviContactForm\Features\PWH_DCFH_Field_Select;
use PWH_DCFH\App\Frontend\DiviContactForm\Features\PWH_DCFH_Field_File_Upload;
use PWH_DCFH\App\Frontend\DiviContactForm\Features\PWH_DCFH_Error_Message;
use PWH_DCFH\App\Frontend\Controllers\PWH_DCFH_Email_Handler;

if (!defined('ABSPATH')) {
    exit;
}
if (!class_exists('PWH_DCFH_Filter_Contact_Form')) {
    class PWH_DCFH_Filter_Contact_Form
    {
        private $props;

        private $contact_form_num;

        private $is_threshold_reached;

        /**
         * Initializer Of The Class
         * Add/Remove Necessary Actions/Filters
         */
        public function init()
        {
            add_filter('et_builder_get_parent_modules', [$this, 'maybe_add_toggles'], 10, 2);
            add_filter('et_pb_all_fields_unprocessed_et_pb_contact_form', [$this, 'maybe_add_fields']);
            add_filter('et_pb_module_shortcode_attributes', [$this, 'maybe_filter_shortcode_attributes'], 10, 5);
            add_filter('et_module_shortcode_output', [$this, 'maybe_filter_shortcode_output'], 10, 3);
            add_filter('et_builder_custom_dynamic_content_fields', [$this, 'maybe_custom_dynamic_content_fields'], 10, 3);
            add_shortcode('pwh_dcfh_email_template', [$this, 'maybe_add_email_template_shortcode']);
            add_filter('upload_mimes', [$this, 'maybe_add_custom_mimetypes'], 999);
            add_action('wp_footer', [$this, 'maybe_add_scripts']);
            add_filter('wp_check_filetype_and_ext', [$this, 'maybe_fix_mime_type_ext'], 10, 4);
            add_filter('et_fb_tinymce_plugins', [$this, 'maybe_add_tinymc_buttons']);
            add_filter('et_pb_contact_form_css_selector', [$this, 'maybe_filter_css_selector']);

        }

        /**
         * Filter et_builder_get_parent_modules
         *
         * @param $modules
         * @param $post_type
         *
         * @return mixed
         */
        public function maybe_add_toggles($modules, $post_type)
        {
            static $is_applied = false;
            if ($is_applied) {
                return $modules;
            }
            if (empty($modules)) {
                return $modules;
            }
            foreach ($modules as $module_slug => $module) {
                if ('et_pb_contact_form' === $module_slug) {
                    if (!isset($module->settings_modal_toggles, $module->advanced_fields, $module->fields_unprocessed)) {
                        continue;
                    }
                    $settings_modal_toggles = $module->settings_modal_toggles;
                    $advanced_fields_toggles = $module->advanced_fields;
                    // Change Priority main_content toggle
                    if (isset($settings_modal_toggles['general']['toggles']['main_content'])) {
                        $settings_modal_toggles['general']['toggles']['main_content'] = [
                            'title' => et_builder_i18n('Title'),
                            'priority' => 5,
                        ];
                    }
                    // Rename Email Toggle To Admin Email Toggle
                    if (isset($settings_modal_toggles['general']['toggles']['email'])) {
                        $settings_modal_toggles['general']['toggles']['email'] = [
                            'title' => et_builder_i18n('Admin Email'),
                            'priority' => 5,
                        ];
                    }
                    // Rename Toggle Button To Submit Button Toggle
                    if (isset($settings_modal_toggles['advanced']['toggles']['button'])) {
                        $settings_modal_toggles['advanced']['toggles']['button'] = [
                            'title' => et_builder_i18n('Submit Button'),
                            'priority' => 70,
                        ];
                    }
                    // Rename Redirect Toggle To After Submission Behavior Toggle
                    if (isset($settings_modal_toggles['general']['toggles']['redirect'])) {
                        $settings_modal_toggles['general']['toggles']['redirect'] = [
                            'title' => __('After Submission Behavior', 'pwh-dcfh'),
                        ];
                    }
                    // General Toggles
                    if (isset($settings_modal_toggles['general']) && !empty($settings_modal_toggles['general']['toggles'])) {
                        $settings_modal_toggles['general']['toggles']['confirmation_settings_toggle'] = [
                            'title' => __('Confirmation Email', 'pwh-dcfh'),
                            'priority' => 5,
                        ];
                        $settings_modal_toggles['general']['toggles']['submission_toggle'] = [
                            'title' => __('Entry Preferences', 'pwh-dcfh'),
                            'priority' => 5,
                        ];
                        $settings_modal_toggles['general']['toggles']['error_message_toggle'] = [
                            'title' => __('Error Message', 'pwh-dcfh'),
                            'priority' => 5,
                        ];
                        $settings_modal_toggles['general']['toggles']['submit_button_toggle'] = [
                            'title' => __('Submit Button', 'pwh-dcfh'),
                            'priority' => 5,
                        ];
                        $settings_modal_toggles['general']['toggles']['integrations_toggle'] = [
                            'title' => __('Integrations', 'pwh-dcfh'),
                            'priority' => 5,
                        ];
                        $module->settings_modal_toggles = $settings_modal_toggles;
                    }
                    // Advanced Toggles
                    if (isset($settings_modal_toggles['advanced']) && !empty($settings_modal_toggles['advanced']['toggles'])) {
                        $settings_modal_toggles['advanced']['toggles']['field_label_toggle'] = [
                            'title' => __('Field Label Text', 'pwh-dcfh'),
                            'priority' => 30,
                        ];
                        $settings_modal_toggles['advanced']['toggles']['field_desc_toggle'] = [
                            'title' => __('Field Description Text', 'pwh-dcfh'),
                            'priority' => 31,
                        ];
                        $settings_modal_toggles['advanced']['toggles']['success_button_toggle'] = [
                            'title' => __('Success Button', 'pwh-dcfh'),
                            'priority' => 70,
                        ];
                        $settings_modal_toggles['advanced']['toggles']['file_upload_design_toggle'] = [
                            'title' => __('File Upload', 'pwh-dcfh'),
                            'tabbed_subtoggles' => true,
                            'sub_toggles' => [
                                'container_toggle' => [
                                    'name' => __('Container', 'pwh-dcfh')
                                ],
                                'description_toggle' => [
                                    'name' => __('Descriptions', 'pwh-dcfh')
                                ],
                                'button_toggle' => [
                                    'name' => __('Upload Button', 'pwh-dcfh')
                                ],
                            ],
                            'priority' => 70,
                        ];
                        $settings_modal_toggles['advanced']['toggles']['datetimepicker_design_toggle'] = [
                            'title' => __('Date/Time Picker', 'pwh-dcfh'),
                            'tabbed_subtoggles' => true,
                            'sub_toggles' => [
                                'default_toggle' => [
                                    'name' => __('General', 'pwh-dcfh')
                                ],
                                'date_toggle' => [
                                    'name' => __('Date', 'pwh-dcfh')
                                ],
                                'time_toggle' => [
                                    'name' => __('Time', 'pwh-dcfh')
                                ],
                            ],
                            'priority' => 70,
                        ];
                        $settings_modal_toggles['advanced']['toggles']['error_message_toggle'] = [
                            'title' => __('Error Message Text', 'pwh-dcfh'),
                            'tabbed_subtoggles' => true,
                            'sub_toggles' => [
                                'container_toggle' => [
                                    'name' => __('Container', 'pwh-dcfh')
                                ],
                                'fillmessage_toggle' => [
                                    'name' => __('Message', 'pwh-dcfh')
                                ],
                                'error_toggle' => [
                                    'name' => __('Errors List', 'pwh-dcfh')
                                ],
                            ],
                            'priority' => 70,
                        ];
                        $settings_modal_toggles['advanced']['toggles']['success_message_toggle'] = [
                            'title' => __('Success Message Text', 'pwh-dcfh'),
                            'priority' => 70,
                            'tabbed_subtoggles' => true,
                            'sub_toggles' => [
                                'wrapper_toggle' => [
                                    'name' => __('Wrapper', 'pwh-dcfh')
                                ],
                                'heading_toggle' => [
                                    'name' => __('Heading', 'pwh-dcfh')
                                ],
                                'paragraph_toggle' => [
                                    'name' => __('Paragraph', 'pwh-dcfh')
                                ],
                            ],
                        ];
                        $module->settings_modal_toggles = $settings_modal_toggles;
                    }
                }
            }
            $is_applied = true;

            return $modules;
        }

        /**
         * Filter Form Fields
         *
         * @param $fields_unprocessed
         *
         * @return array
         */
        public function maybe_add_fields($fields_unprocessed)
        {
            //==================================================
            // Contact Form Unique ID
            //==================================================
            $custom_fields['_unique_id'] = [
                'label' => __('Contact Form Unique ID', 'pwh-dcfh'),
                'type' => 'text',
                'description' => sprintf(__('This field can be used to give the contact form a unique identification number which will be shown in the database and other admin areas. You can generate a new ID <a href="%1$s" target="_blank">%2$s</a>', 'pwh-dcfh'),
                    'https://www.guidgenerator.com/online-guid-generator.aspx', __('here', 'pwh-dcfh')),
                'toggle_slug' => 'admin_label',
            ];
            //==================================================
            // Override Default Fields
            //==================================================
            $fields_unprocessed['submit_button_text']['toggle_slug'] = 'submit_button_toggle';
            $fields_unprocessed['success_message']['show_if'] = ['hide_success_message' => 'off'];
            $fields_unprocessed['success_message']['type'] = 'tiny_mce';
            $fields_unprocessed['success_message']['toggle_slug'] = 'redirect';
            //==================================================
            // Admin Email
            //==================================================
            $fields_unprocessed['email']['dynamic_content'] = 'text';
            $fields_unprocessed['email']['show_if'] = ['use_send_admin_email' => 'on', 'use_conditional_emails' => 'off'];
            $fields_unprocessed['email']['label'] = __('Admin Email Address', 'pwh-dcfh');
            $fields_unprocessed['custom_message']['label'] = __('Admin Email Message', 'pwh-dcfh');
            $fields_unprocessed['custom_message']['show_if'] = ['use_send_admin_email' => 'on', 'use_custom_message_richtext' => 'off'];
            $custom_fields['use_send_admin_email'] = [
                'label' => __('Send Admin Email', 'pwh-dcfh'),
                'type' => 'yes_no_button',
                'description' => __('Choose to enable or disable the admin email message.', 'pwh-dcfh'),
                'options' => [
                    'on' => et_builder_i18n('Yes'),
                    'off' => et_builder_i18n('No'),
                ],
                'default' => 'on',
                'option_category' => 'configuration',
                'toggle_slug' => 'email',
            ];
            $custom_fields['use_custom_message_richtext'] = [
                'label' => __('Use Rich Text Formatting For Admin Email Message', 'pwh-dcfh'),
                'type' => 'yes_no_button',
                'description' => __('Choose to enable a rich text editor for customizing the admin email message with HTML.', 'pwh-dcfh'),
                'options' => [
                    'on' => et_builder_i18n('Yes'),
                    'off' => et_builder_i18n('No'),
                ],
                'show_if' => ['use_send_admin_email' => 'on'],
                'default' => 'off',
                'option_category' => 'configuration',
                'toggle_slug' => 'email',
            ];
            $custom_fields['custom_message_richtext'] = [
                'label' => __('Admin Email Message', 'pwh-dcfh'),
                'type' => 'tiny_mce',
                'description' => et_get_safe_localization(__('Here you can define the custom pattern for the email Message. Fields should be included in the following format - <strong>%%field_id%%</strong>. For example, if you want to include the field with id = <strong>phone</strong> and field with id = <strong>message</strong>, then you can use the following pattern: <strong>My message is %%message%% and phone number is %%phone%%</strong>. Leave blank for default.', 'pwh-dcfh')),
                'show_if' => ['use_send_admin_email' => 'on', 'use_custom_message_richtext' => 'on'],
                'dynamic_content' => 'text',
                'option_category' => 'configuration',
                'toggle_slug' => 'email',
            ];
            $custom_fields['use_conditional_emails'] = [
                'label' => __('Use Conditional Email Address Routing', 'pwh-dcfh'),
                'type' => 'yes_no_button',
                'description' => __('Choose to route the form to specific admin email addresses based on conditional logic.', 'pwh-dcfh'),
                'options' => [
                    'on' => et_builder_i18n('Yes'),
                    'off' => et_builder_i18n('No'),
                ],
                'show_if' => ['use_send_admin_email' => 'on'],
                'default' => 'off',
                'option_category' => 'configuration',
                'toggle_slug' => 'email',
            ];
            $custom_fields['conditional_email_pattern'] = [
                'label' => __('Conditional Email Address Routing Logic', 'pwh-dcfh'),
                'type' => 'textarea',
                'description' => sprintf(__('Set up the logic of the conditional email address routing using the field IDs and field options. Please refer to our <a href="%s" target="_blank">documentation</a> for instructions about how to set this up.', 'pwh-dcfh'),
                    'https://www.peeayecreative.com/docs/divi-contact-form-helper/admin-email-settings/'),
                'show_if' => ['use_send_admin_email' => 'on', 'use_conditional_emails' => 'on'],
                'option_category' => 'configuration',
                'toggle_slug' => 'email',
            ];
            $custom_fields['admin_email_subject'] = [
                'label' => __('Admin Email Subject', 'pwh-dcfh'),
                'type' => 'text',
                'description' => __('Enter a custom subject line for the admin email.', 'pwh-dcfh'),
                'show_if' => ['use_send_admin_email' => 'on'],
                'option_category' => 'configuration',
                'toggle_slug' => 'email',
            ];
            $custom_fields['admin_email_from_name'] = [
                'label' => __('Admin Email From Name', 'pwh-dcfh'),
                'type' => 'text',
                'description' => __('Enter a custom from name for the admin email message. The default is the name of the person submitting the form.', 'pwh-dcfh'),
                'show_if' => ['use_send_admin_email' => 'on'],
                'option_category' => 'configuration',
                'toggle_slug' => 'email',
            ];
            $custom_fields['admin_email_cc'] = [
                'label' => __('Admin Email Address CC', 'pwh-dcfh'),
                'type' => 'text',
                'description' => __('Input a carbon copy email address for the admin message. Multiple email addresses can be added separated by a comma.', 'pwh-dcfh'),
                'option_category' => 'configuration',
                'show_if' => ['use_send_admin_email' => 'on'],
                'toggle_slug' => 'email',
            ];
            $custom_fields['admin_email_bcc'] = [
                'label' => __('Admin Email Address BCC', 'pwh-dcfh'),
                'type' => 'text',
                'description' => __('Input a blind carbon copy email address for the admin message. Multiple email addresses can be added separated by a comma.', 'pwh-dcfh'),
                'option_category' => 'configuration',
                'show_if' => ['use_send_admin_email' => 'on'],
                'toggle_slug' => 'email',
            ];
            $custom_fields['use_admin_email_submitter_email'] = [
                'label' => __('Use Submitter Admin From Email Address', 'pwh-dcfh'),
                'type' => 'yes_no_button',
                'description' => __('Choose to make the admin email from email address the same as the email address field %%email%% of the person submitting the form.', 'pwh-dcfh'),
                'options' => [
                    'on' => et_builder_i18n('Yes'),
                    'off' => et_builder_i18n('No'),
                ],
                'show_if' => ['use_send_admin_email' => 'on'],
                'default' => 'off',
                'option_category' => 'configuration',
                'toggle_slug' => 'email',
            ];
            //==================================================
            // Database Settings
            //==================================================
            $custom_fields['save_entries_to_db'] = [
                'label' => __('Save Entries To Database', 'pwh-dcfh'),
                'type' => 'yes_no_button',
                'description' => __('Choose to save all form entries to the website database. This is helpful to retain a copy in case there are delivery problems. Entries can be viewed by going to your WordPress Dashboard to Contact Form > Entries.', 'pwh-dcfh'),
                'options' => [
                    'on' => et_builder_i18n('Yes'),
                    'off' => et_builder_i18n('No'),
                ],
                'default' => 'on',
                'option_category' => 'configuration',
                'toggle_slug' => 'submission_toggle',
            ];
            $custom_fields['save_files_to_db'] = [
                'label' => __('Save File Uploads To Database', 'pwh-dcfh'),
                'type' => 'yes_no_button',
                'description' => __('Choose to save all file uploads with the form entry in the website database.', 'pwh-dcfh'),
                'options' => [
                    'on' => et_builder_i18n('Yes'),
                    'off' => et_builder_i18n('No'),
                ],
                'default' => 'on',
                'show_if' => ['save_entries_to_db' => 'on'],
                'option_category' => 'configuration',
                'toggle_slug' => 'submission_toggle',
            ];
            $custom_fields['save_files_to_media'] = [
                'label' => __('Save File Uploads To Media Library', 'pwh-dcfh'),
                'type' => 'yes_no_button',
                'description' => __('Choose to add all file uploads from the form submissions to the WordPress Media Library.', 'pwh-dcfh'),
                'options' => [
                    'on' => et_builder_i18n('Yes'),
                    'off' => et_builder_i18n('No'),
                ],
                'default' => 'off',
                'show_if' => ['save_entries_to_db' => 'on', 'save_files_to_db' => 'on'],
                'option_category' => 'configuration',
                'toggle_slug' => 'submission_toggle',
            ];
            $custom_fields['send_files_as_attachment'] = [
                'label' => __('Send File Uploads As Attachments With Emails', 'pwh-dcfh'),
                'type' => 'yes_no_button',
                'description' => __('Choose to attach all file uploads to the admin email.', 'pwh-dcfh'),
                'options' => [
                    'on' => et_builder_i18n('Yes'),
                    'off' => et_builder_i18n('No'),
                ],
                'default' => 'on',
                'option_category' => 'configuration',
                'toggle_slug' => 'submission_toggle',
            ];
            $custom_fields['collect_ip_useragent_details'] = [
                'label' => __('Collect User Agent Details', 'pwh-dcfh'),
                'type' => 'yes_no_button',
                'description' => __('Choose to collect information such as IP Address, Browser, and OS.', 'pwh-dcfh'),
                'options' => [
                    'on' => et_builder_i18n('Yes'),
                    'off' => et_builder_i18n('No'),
                ],
                'default' => 'off',
                'show_if' => ['save_entries_to_db' => 'on'],
                'option_category' => 'configuration',
                'toggle_slug' => 'submission_toggle',
            ];
            $custom_fields['unique_views_cookie'] = [
                'label' => __('Use Cookies For Tracking Unique Form Views', 'pwh-dcfh'),
                'type' => 'yes_no_button',
                'description' => __('Choose to enable or disable cookies for tracking the number of unique form views.', 'pwh-dcfh'),
                'options' => [
                    'on' => et_builder_i18n('Yes'),
                    'off' => et_builder_i18n('No'),
                ],
                'default' => 'off',
                'show_if' => ['save_entries_to_db' => 'on'],
                'option_category' => 'configuration',
                'toggle_slug' => 'submission_toggle',
            ];
            $custom_fields['save_queryparams_to_db'] = [
                'label' => __('Save URL Parameters To Database', 'pwh-dcfh'),
                'type' => 'yes_no_button',
                'description' => __('Choose to save any URL parameters to the website database.', 'pwh-dcfh'),
                'options' => [
                    'on' => et_builder_i18n('Yes'),
                    'off' => et_builder_i18n('No'),
                ],
                'default' => 'off',
                'show_if' => ['save_entries_to_db' => 'on'],
                'option_category' => 'configuration',
                'toggle_slug' => 'submission_toggle',
            ];
            $custom_fields['entries_threshold_enabled'] = [
                'label' => __('Limit Maximum Number Of Entries', 'pwh-dcfh'),
                'type' => 'yes_no_button',
                'description' => __('Choose to set a limit for the total number of entries that can be submitted with this form.', 'pwh-dcfh'),
                'options' => [
                    'on' => et_builder_i18n('Yes'),
                    'off' => et_builder_i18n('No'),
                ],
                'default' => 'off',
                'show_if' => ['save_entries_to_db' => 'on'],
                'option_category' => 'configuration',
                'toggle_slug' => 'submission_toggle',
            ];
            $custom_fields['entries_threshold'] = [
                'label' => __('Maximum Number Of Entries', 'pwh-dcfh'),
                'type' => 'text',
                'description' => __('Enter the total number of entries that can be submitted with this form. If the total number is reached, the form will hide and a message will appear on the frontend.', 'pwh-dcfh'),
                'default' => '',
                'show_if' => ['send_files_as_attachment' => 'on', 'entries_threshold_enabled' => 'on'],
                'option_category' => 'configuration',
                'toggle_slug' => 'submission_toggle',
            ];
            $custom_fields['entries_threshold_message'] = [
                'label' => __('Maximum Number Of Entries Reached Message', 'pwh-dcfh'),
                'type' => 'tiny_mce',
                'description' => __('Enter a custom message to display on the frontend in place of the form when the maximum number of entries have already been submitted for this form.', 'pwh-dcfh'),
                'default' => '',
                'show_if' => ['send_files_as_attachment' => 'on', 'entries_threshold_enabled' => 'on'],
                'option_category' => 'configuration',
                'toggle_slug' => 'submission_toggle',
            ];
            $custom_fields['attached_files_message'] = [
                'label' => __('Change Attachments Custom Message', 'pwh-dcfh'),
                'type' => 'text',
                'description' => __('Choose to enter custom text for the message that automatically displays in the footer of any email with files added to prompt the recipient to view the attachments.', 'pwh-dcfh'),
                'default' => '',
                'show_if' => ['send_files_as_attachment' => 'on'],
                'option_category' => 'configuration',
                'toggle_slug' => 'submission_toggle',
            ];
            //==================================================
            // Email Copy To Sender
            //==================================================
            $custom_fields['use_confirmation_email'] = [
                'label' => __('Send A Confirmation Email To Sender', 'pwh-dcfh'),
                'type' => 'yes_no_button',
                'description' => __('Choose to send a confirmation email to the form submitter.', 'pwh-dcfh'),
                'options' => [
                    'on' => et_builder_i18n('Yes'),
                    'off' => et_builder_i18n('No'),
                ],
                'default' => 'off',
                'option_category' => 'configuration',
                'toggle_slug' => 'confirmation_settings_toggle',
            ];
            $custom_fields['confirmation_email_field_id'] = [
                'label' => __('Confirmation Email Address Field ID', 'pwh-dcfh'),
                'type' => 'text',
                'description' => __('Enter the field ID of the email address field where you want to send the confirmation message.', 'pwh-dcfh'),
                'show_if' => ['use_confirmation_email' => 'on'],
                'dynamic_content' => 'text',
                'option_category' => 'configuration',
                'toggle_slug' => 'confirmation_settings_toggle'
            ];
            $custom_fields['confirmation_email_subject'] = [
                'label' => __('Confirmation Email Subject', 'pwh-dcfh'),
                'type' => 'text',
                'description' => __('Enter a custom subject line for the confirmation email.', 'pwh-dcfh'),
                'show_if' => ['use_confirmation_email' => 'on'],
                'dynamic_content' => 'text',
                'option_category' => 'configuration',
                'toggle_slug' => 'confirmation_settings_toggle'
            ];
            $custom_fields['confirmation_email_from_name'] = [
                'label' => __('Confirmation Email From Name', 'pwh-dcfh'),
                'type' => 'text',
                'description' => __('Enter a custom from name for the confirmation email message. The default is the site name.', 'pwh-dcfh'),
                'show_if' => ['use_confirmation_email' => 'on'],
                'option_category' => 'configuration',
                'toggle_slug' => 'confirmation_settings_toggle',
            ];
            $custom_fields['confirmation_email_from'] = [
                'label' => __('Confirmation Email From Email Address', 'pwh-dcfh'),
                'type' => 'text',
                'description' => __('Enter a custom from email address for the confirmation email message.', 'pwh-dcfh'),
                'show_if' => ['use_confirmation_email' => 'on'],
                'option_category' => 'configuration',
                'toggle_slug' => 'confirmation_settings_toggle',
            ];
            $custom_fields['confirmation_email_message'] = [
                'label' => __('Confirmation Email Message', 'pwh-dcfh'),
                'type' => 'textarea',
                'description' => et_get_safe_localization(__('Here you can define the custom pattern for the email Message. Fields should be included in the following format - <strong>%%field_id%%</strong>. For example, if you want to include the field with id = <strong>phone</strong> and field with id = <strong>message</strong>, then you can use the following pattern: <strong>My message is %%message%% and phone number is %%phone%%</strong>',
                    'pwh-dcfh')),
                'show_if' => ['use_confirmation_email' => 'on', 'use_confirmation_message_richtext' => 'off'],
                'dynamic_content' => 'text',
                'option_category' => 'configuration',
                'toggle_slug' => 'confirmation_settings_toggle'
            ];
            $custom_fields['use_confirmation_message_richtext'] = [
                'label' => __('Use Rich Text Formatting For Confirmation Email Message', 'pwh-dcfh'),
                'type' => 'yes_no_button',
                'description' => __('Choose to enable a rich text editor for customizing the confirmation email message with HTML.', 'pwh-dcfh'),
                'options' => [
                    'on' => et_builder_i18n('Yes'),
                    'off' => et_builder_i18n('No'),
                ],
                'default' => 'off',
                'show_if' => ['use_confirmation_email' => 'on'],
                'option_category' => 'configuration',
                'toggle_slug' => 'confirmation_settings_toggle'
            ];
            $custom_fields['confirmation_message_richtext'] = [
                'label' => __('Confirmation Email Message', 'pwh-dcfh'),
                'type' => 'tiny_mce',
                'description' => et_get_safe_localization(__('Here you can define the custom pattern for the email Message. Fields should be included in the following format - <strong>%%field_id%%</strong>. For example, if you want to include the field with id = <strong>phone</strong> and field with id = <strong>message</strong>, then you can use the following pattern: <strong>My message is %%message%% and phone number is %%phone%%</strong>. Leave blank for default.', 'pwh-dcfh')),
                'show_if' => ['use_confirmation_email' => 'on', 'use_confirmation_message_richtext' => 'on'],
                'dynamic_content' => 'text',
                'option_category' => 'configuration',
                'toggle_slug' => 'confirmation_settings_toggle'
            ];
            //==================================================
            // Zapier
            //==================================================
            $custom_fields['use_zapier'] = [
                'label' => __('Use Zapier Email Parser', 'pwh-dcfh'),
                'type' => 'yes_no_button',
                'description' => __('Enable the Zapier integration settings.', 'pwh-dcfh'),
                'options' => [
                    'on' => et_builder_i18n('Yes'),
                    'off' => et_builder_i18n('No'),
                ],
                'default' => 'off',
                'option_category' => 'configuration',
                'toggle_slug' => 'integrations_toggle',
            ];
            $custom_fields['zapier_mailbox_address'] = [
                'label' => __('Zapier Email Parser Mailbox Address', 'pwh-dcfh'),
                'type' => 'text',
                'description' => __('Enter the Email Parser by Zapier mailbox email address to send emails to Zapier to be integrated with hundreds of other tools and services.', 'pwh-dcfh'),
                'show_if' => ['use_zapier' => 'on'],
                'option_category' => 'configuration',
                'toggle_slug' => 'integrations_toggle'
            ];
            //==================================================
            // Pabbly
            //==================================================
            $custom_fields['use_pabbly'] = [
                'label' => __('Use Pabbly Email Parser', 'pwh-dcfh'),
                'type' => 'yes_no_button',
                'description' => __('Enable the Pabbly integration settings.', 'pwh-dcfh'),
                'options' => [
                    'on' => et_builder_i18n('Yes'),
                    'off' => et_builder_i18n('No'),
                ],
                'default' => 'off',
                'option_category' => 'configuration',
                'toggle_slug' => 'integrations_toggle',
            ];
            $custom_fields['pabbly_mailbox_address'] = [
                'label' => __('Pabbly Email Parser Mailbox Address', 'pwh-dcfh'),
                'type' => 'text',
                'description' => __('Enter the Email Parser by Pabbly mailbox email address to send emails to Pabbly to be integrated with hundreds of other tools and services.', 'pwh-dcfh'),
                'show_if' => ['use_pabbly' => 'on'],
                'option_category' => 'configuration',
                'toggle_slug' => 'integrations_toggle'
            ];
            //==================================================
            // Submit Button Wait Text
            //==================================================
            $custom_fields['submit_button_wait_text'] = [
                'label' => __('Submit Button Wait Text', 'pwh-dcfh'),
                'type' => 'text',
                'default' => __('Please wait...', 'pwh-dcfh'),
                'description' => __('Enter custom text for the submit button which will show while files are being uploaded.', 'pwh-dcfh'),
                'option_category' => 'configuration',
                'toggle_slug' => 'submit_button_toggle'
            ];
            //==================================================
            // Submit Button Alignment And Width
            //==================================================
            $custom_fields['submit_button_alignment'] = [
                'label' => __('Button Alignment', 'pwh-dcfh'),
                'type' => 'align',
                'description' => __('Choose to align the submit button to the left, center, or right.', 'pwh-dcfh'),
                'options' => et_builder_get_text_orientation_options(['justified']),
                'default' => 'right',
                'show_if' => ['custom_button' => 'on'],
                'mobile_options' => true,
                'toggle_slug' => 'button',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['submit_button_full_width'] = [
                'label' => __('Button Full Width', 'pwh-dcfh'),
                'type' => 'yes_no_button',
                'description' => __('If enabled, the field will take 100% of the width of the content area.', 'pwh-dcfh'),
                'options' => [
                    'on' => et_builder_i18n('Yes'),
                    'off' => et_builder_i18n('No'),
                ],
                'default' => 'off',
                'show_if' => ['custom_button' => 'on'],
                'mobile_options' => true,
                'toggle_slug' => 'button',
                'tab_slug' => 'advanced',
            ];
            //==================================================
            // Hide Form Message
            //==================================================
            $custom_fields['hide_success_message'] = [
                'label' => __('Hide Success Message', 'pwh-dcfh'),
                'type' => 'yes_no_button',
                'description' => __('Choose to hide a success message after the form is submitted.', 'pwh-dcfh'),
                'options' => [
                    'on' => et_builder_i18n('Yes'),
                    'off' => et_builder_i18n('No'),
                ],
                'default' => 'off',
                'option_category' => 'configuration',
                'toggle_slug' => 'redirect',
            ];
            //==================================================
            // Show Loading Icon
            //==================================================
            $custom_fields['show_loading_icon'] = [
                'label' => __('Show Loading Icon', 'pwh-dcfh'),
                'type' => 'yes_no_button',
                'description' => __('Choose to show an animated loading icon when submitting the contact form.', 'pwh-dcfh'),
                'options' => [
                    'on' => et_builder_i18n('Yes'),
                    'off' => et_builder_i18n('No'),
                ],
                'default' => 'on',
                'option_category' => 'configuration',
                'toggle_slug' => 'redirect',
            ];
            //==================================================
            // Hide Form Title
            //==================================================
            $custom_fields['hide_form_title'] = [
                'label' => __('Hide Form Title', 'pwh-dcfh'),
                'type' => 'yes_no_button',
                'description' => __('Choose to hide the contact form title after submitting form.', 'pwh-dcfh'),
                'options' => [
                    'on' => et_builder_i18n('Yes'),
                    'off' => et_builder_i18n('No'),
                ],
                'default' => 'off',
                'option_category' => 'configuration',
                'toggle_slug' => 'redirect',
            ];
            //==================================================
            // Success Button
            //==================================================
            $custom_fields['use_success_button'] = [
                'label' => __('Use Success Button', 'pwh-dcfh'),
                'type' => 'yes_no_button',
                'description' => __('Choose to add a button to the success message after a successful form submission.', 'pwh-dcfh'),
                'options' => [
                    'on' => et_builder_i18n('Yes'),
                    'off' => et_builder_i18n('No'),
                ],
                'default' => 'off',
                'option_category' => 'configuration',
                'toggle_slug' => 'redirect',
            ];
            $custom_fields['success_button_text'] = [
                'label' => __('Success Button Custom Text', 'pwh-dcfh'),
                'type' => 'text',
                'description' => __('Enter custom text for the success button.', 'pwh-dcfh'),
                'default' => __('Go Back To Home', 'pwh-dcfh'),
                'show_if' => ['use_success_button' => 'on'],
                'dynamic_content' => 'text',
                'option_category' => 'configuration',
                'toggle_slug' => 'redirect',
            ];
            $custom_fields['success_button_type'] = [
                'label' => __('Success Button Link Type', 'pwh-dcfh'),
                'description' => __('Choose the type of link to use for the success button.', 'pwh-dcfh'),
                'type' => 'select',
                'options' => [
                    'url' => __('Custom URL', 'pwh-dcfh'),
                    'page' => __('Page', 'pwh-dcfh'),
                ],
                'default' => 'url',
                'show_if' => ['use_success_button' => 'on'],
                'affects' => ['success_button_url', 'success_button_page'],
                'option_category' => 'configuration',
                'toggle_slug' => 'redirect',
            ];
            $custom_fields['success_button_url'] = [
                'label' => __('Success Button Custom URL', 'pwh-dcfh'),
                'type' => 'text',
                'description' => __('Enter a custom URL to use for the success button link.', 'pwh-dcfh'),
                'depends_show_if' => 'url',
                'default' => home_url(),
                'option_category' => 'configuration',
                'toggle_slug' => 'redirect',
            ];
            $custom_fields['success_button_page'] = [
                'label' => __('Success Button Page Link', 'pwh-dcfh'),
                'type' => 'select',
                'description' => __('Select a page for the success button link.', 'pwh-dcfh'),
                'options' => pwh_dcfh_wp_helpers()::get_pages(),
                'depends_show_if' => 'page',
                'option_category' => 'configuration',
                'toggle_slug' => 'redirect',
            ];
            $custom_fields['success_button_target'] = [
                'label' => __('Success Button Link Target', 'pwh-dcfh'),
                'description' => __('Choose whether the button link opens in the same window or new tab.', 'pwh-dcfh'),
                'type' => 'select',
                'options' => [
                    '_self' => __('In The Same Tab', 'pwh-dcfh'),
                    '_blank' => __('In A New Tab', 'pwh-dcfh'),
                ],
                'default' => '_self',
                'show_if' => ['use_success_button' => 'on'],
                'option_category' => 'configuration',
                'toggle_slug' => 'redirect',
            ];
            $custom_fields['success_button_font'] = [
                'label' => __('Button Text', 'pwh-dcfh'),
                'type' => 'font',
                'description' => __('Choose a custom font to use for the Title. All Google web fonts are available, or you can upload your own custom font files.', 'pwh-dcfh'),
                'default' => '',
                'mobile_options' => true,
                'toggle_slug' => 'success_button_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['success_button_color'] = [
                'label' => __('Button Text Color', 'pwh-dcfh'),
                'type' => 'color-alpha',
                'description' => __('Pick a color to be used for the Title text.', 'pwh-dcfh'),
                'custom_color' => true,
                'default' => '',
                'mobile_options' => true,
                'toggle_slug' => 'success_button_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['success_button_size'] = [
                'label' => __('Button Text Size', 'pwh-dcfh'),
                'type' => 'range',
                'description' => __('Increase or decrease the size of the Title text.', 'pwh-dcfh'),
                // 'fixed_unit' => 'px',
                // 'validate_unit' => true,
                'allowed_units' => et_builder_get_acceptable_css_string_values('font-size'),
                'fixed_range' => true,
                'range_settings' => [
                    'min' => '1',
                    'max' => '100',
                    'step' => '1',
                    'min_limit' => 1,
                    'max_limit' => 100,
                ],
                'default' => '',
                'mobile_options' => true,
                'toggle_slug' => 'success_button_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['success_button_letter_space'] = [
                'label' => __('Button Text Letter Spacing', 'pwh-dcfh'),
                'type' => 'range',
                'description' => __('Letter spacing adjusts the distance between each letter in the Title.', 'pwh-dcfh'),
                'fixed_unit' => 'px',
                'validate_unit' => true,
                'fixed_range' => true,
                'range_settings' => [
                    'min' => '1',
                    'max' => '100',
                    'step' => '1',
                    'min_limit' => 1,
                    'max_limit' => 100,
                ],
                'default' => '',
                'mobile_options' => true,
                'toggle_slug' => 'success_button_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['success_button_line_height'] = [
                'label' => __('Button Text Line Height', 'pwh-dcfh'),
                'type' => 'range',
                'description' => __('Line height adjusts the distance between each line of the Title text. This becomes noticeable if the Title is long and wraps onto multiple lines.', 'pwh-dcfh'),
                'fixed_unit' => 'em',
                'validate_unit' => true,
                'fixed_range' => true,
                'range_settings' => [
                    'min' => '1',
                    'max' => '3',
                    'step' => '0.1',
                    'min_limit' => 1,
                    'max_limit' => 3,
                ],
                'default' => '',
                'mobile_options' => true,
                'toggle_slug' => 'success_button_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['success_button_alignment'] = [
                'label' => __('Button Alignment', 'pwh-dcfh'),
                'type' => 'align',
                'description' => __('Align the Title to the left, right, center or justify.', 'pwh-dcfh'),
                'options' => et_builder_get_text_orientation_options(['justified']),
                'advanced_fields' => true,
                'mobile_options' => true,
                'toggle_slug' => 'success_button_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['success_button_margin'] = [
                'label' => __('Button Margin', 'pwh-dcfh'),
                'type' => 'custom_margin',
                'description' => __('Margin adds extra space to the outside of the element, increasing the distance between the element and other items on the page.', 'pwh-dcfh'),
                'responsive' => true,
                'mobile_options' => true,
                'toggle_slug' => 'success_button_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['success_button_padding'] = [
                'label' => __('Button Padding', 'pwh-dcfh'),
                'type' => 'custom_padding',
                'description' => __('Padding adds extra space to the inside of the element, increasing the distance between the edge of the element and its inner contents.', 'pwh-dcfh'),
                'options' => et_builder_get_text_orientation_options(['justified'], ['justify' => 'Justified']),
                'advanced_fields' => true,
                'mobile_options' => true,
                'toggle_slug' => 'success_button_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['success_button_background'] = [
                'label' => __('Button Background Color', 'pwh-dcfh'),
                'type' => 'color-alpha',
                'description' => __('Adjust the background style of this element by customizing the background color, gradient, image and video.', 'pwh-dcfh'),
                'custom_color' => true,
                'default' => '',
                'mobile_options' => true,
                'toggle_slug' => 'success_button_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['success_button_border'] = [
                'label' => __('Button Border Radius', 'pwh-dcfh'),
                'type' => 'border-radius',
                'description' => __('Here you can control the corner radius of this element. Enable the link icon to control all four corners at once, or disable to define custom values for each.', 'pwh-dcfh'),
                'default' => '',
                'option_category' => 'border',
                'mobile_options' => true,
                'toggle_slug' => 'success_button_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['success_button_border_color'] = [
                'label' => __('Button Border Color', 'pwh-dcfh'),
                'type' => 'color',
                'description' => __('Pick a color to be used for the border.', 'pwh-dcfh'),
                'custom_color' => true,
                'default' => '',
                'mobile_options' => true,
                'toggle_slug' => 'success_button_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['success_button_border_width'] = [
                'label' => __('Button Border Width', 'pwh-dcfh'),
                'type' => 'range',
                'description' => __('Increasing the width of the border will increase its size/thickness.', 'pwh-dcfh'),
                'fixed_unit' => 'px',
                'validate_unit' => true,
                'fixed_range' => true,
                'range_settings' => [
                    'min' => '1',
                    'max' => '50',
                    'step' => '1',
                    'min_limit' => 1,
                    'max_limit' => 50,
                ],
                'default' => '',
                'mobile_options' => true,
                'toggle_slug' => 'success_button_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['success_button_border_style'] = [
                'label' => __('Button Border Style', 'pwh-dcfh'),
                'type' => 'select',
                'description' => __('Borders support various different styles, each of which will change the shape of the border element.', 'pwh-dcfh'),
                'options' => et_builder_get_border_styles(),
                'default' => 'solid',
                'mobile_options' => true,
                'toggle_slug' => 'success_button_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['success_button_shadow'] = [
                'label' => __('Button Shadow', 'pwh-dcfh'),
                'type' => 'select_box_shadow',
                'description' => __('Pick a box shadow style to enable box shadow for this element. Once enabled, you will be able to customize your box shadow style further. To disable custom box shadow style, choose the None option.', 'pwh-dcfh'),
                'presets' => pwh_dcfh_module_helpers()::get_shadow_presets('success_button'),
                'default' => 'none',
                'className' => 'et_pb_success_button',
                'toggle_slug' => 'success_button_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['success_button_shadow_horizontal'] = [
                'type' => 'range',
                'label' => __('Shadow Horizontal Position', 'pwh-dcfh'),
                'description' => __('Shadow\'s horizontal distance from the element. A negative value places the shadow to the left of the element.', 'pwh-dcfh'),
                'range_settings' => [
                    'min' => -80,
                    'max' => 80,
                    'step' => 1,
                    'min_limit' => -80,
                    'max_limit' => 80,
                ],
                'allowed_units' => et_builder_get_acceptable_css_string_values('font-size'),
                'default_unit' => 'px',
                'fixed_range' => true,
                'default' => [
                    'success_button_shadow',
                    [
                        'none' => '',
                        'preset1' => '0px',
                        'preset2' => '6px',
                        'preset3' => '0px',
                        'preset4' => '10px',
                        'preset5' => '0px',
                        'preset6' => '0px',
                        'preset7' => '10px',
                    ]
                ],
                'show_if_not' => ['success_button_shadow' => 'none'],
                'toggle_slug' => 'success_button_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['success_button_shadow_vertical'] = [
                'type' => 'range',
                'label' => __('Shadow Vertical Position', 'pwh-dcfh'),
                'description' => __('Shadow\'s vertical distance from the element. A negative value places the shadow above the element.', 'pwh-dcfh'),
                'range_settings' => [
                    'min' => -80,
                    'max' => 80,
                    'step' => 1,
                    'min_limit' => -80,
                    'max_limit' => 80,
                ],
                'allowed_units' => et_builder_get_acceptable_css_string_values('font-size'),
                'default_unit' => 'px',
                'fixed_range' => true,
                'default' => [
                    'success_button_shadow',
                    [
                        'none' => '',
                        'preset1' => '2px',
                        'preset2' => '6px',
                        'preset3' => '12px',
                        'preset4' => '10px',
                        'preset5' => '6px',
                        'preset6' => '0px',
                        'preset7' => '10px',
                    ]
                ],
                'show_if_not' => ['success_button_shadow' => 'none'],
                'toggle_slug' => 'success_button_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['success_button_shadow_blur'] = [
                'type' => 'range',
                'label' => __('Shadow Blur Strength', 'pwh-dcfh'),
                'description' => __('The higher the value, the bigger the blur, the shadow becomes wider and lighter.', 'pwh-dcfh'),
                'range_settings' => [
                    'min' => 0,
                    'max' => 80,
                    'step' => 1,
                    'min_limit' => -80,
                    'max_limit' => 80,
                ],
                'allowed_units' => et_builder_get_acceptable_css_string_values('font-size'),
                'default_unit' => 'px',
                'fixed_range' => true,
                'default' => [
                    'success_button_shadow',
                    [
                        'none' => '',
                        'preset1' => '18px',
                        'preset2' => '18px',
                        'preset3' => '18px',
                        'preset4' => '0px',
                        'preset5' => '0px',
                        'preset6' => '18px',
                        'preset7' => '0px',
                    ]
                ],
                'show_if_not' => ['success_button_shadow' => 'none'],
                'toggle_slug' => 'success_button_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['success_button_shadow_spread'] = [
                'type' => 'range',
                'label' => __('Shadow Spread Strength', 'pwh-dcfh'),
                'description' => __('Increasing the spread strength will increase the density of the box shadow. Higher density results in a more intense shadow.', 'pwh-dcfh'),
                'range_settings' => [
                    'min' => -80,
                    'max' => 80,
                    'step' => 1,
                    'min_limit' => -80,
                    'max_limit' => 80,
                ],
                'allowed_units' => et_builder_get_acceptable_css_string_values('font-size'),
                'default_unit' => 'px',
                'fixed_range' => true,
                'default' => [
                    'success_button_shadow',
                    [
                        'none' => '',
                        'preset1' => '0px',
                        'preset2' => '0px',
                        'preset3' => '6px',
                        'preset4' => '0px',
                        'preset5' => '10px',
                        'preset6' => '0px',
                        'preset7' => '0px',
                    ]
                ],
                'show_if_not' => ['success_button_shadow' => 'none'],
                'toggle_slug' => 'success_button_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['success_button_shadow_color'] = [
                'type' => 'color-alpha',
                'label' => __('Shadow Color', 'pwh-dcfh'),
                'description' => __('The color of the shadow.', 'pwh-dcfh'),
                'default' => 'rgba(0,0,0,0.3)',
                'field_template' => 'color',
                'show_if_not' => ['success_button_shadow' => 'none'],
                'toggle_slug' => 'success_button_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['success_button_shadow_position'] = [
                'type' => 'select',
                'label' => __('Shadow Position', 'pwh-dcfh'),
                'description' => __('Choose whether you would like the shadow to appear outside your module, lifting the module up from the page, or inside the module, setting the module downwards within the page.', 'pwh-dcfh'),
                'options' => [
                    '' => __('Outer Shadow', 'pwh-dcfh'),
                    'inset' => __('Inner Shadow', 'pwh-dcfh'),
                ],
                'default' => [
                    'success_button_shadow',
                    [
                        'none' => '',
                        'preset1' => '',
                        'preset2' => '',
                        'preset3' => '',
                        'preset4' => '',
                        'preset5' => '',
                        'preset6' => 'inset',
                        'preset7' => 'inset',
                    ]
                ],
                'show_if_not' => ['success_button_shadow' => 'none'],
                'toggle_slug' => 'success_button_toggle',
                'tab_slug' => 'advanced',
            ];
            //==================================================
            // Success Message Text
            //==================================================
            $custom_fields['success_message_background'] = [
                'label' => __('Success Message Background Color', 'pwh-dcfh'),
                'type' => 'color-alpha',
                'description' => __('Adjust the background style by customizing the background color.', 'pwh-dcfh'),
                'custom_color' => true,
                'default' => '',
                'mobile_options' => true,
                'toggle_slug' => 'success_message_toggle',
                'sub_toggle' => 'wrapper_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['success_message_margin'] = [
                'label' => __('Success Message Margin', 'pwh-dcfh'),
                'type' => 'custom_margin',
                'description' => __('Margin adds extra space to the outside of the element, increasing the distance between the element and other items on the page.', 'pwh-dcfh'),
                'responsive' => true,
                'mobile_options' => true,
                'toggle_slug' => 'success_message_toggle',
                'sub_toggle' => 'wrapper_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['success_message_padding'] = [
                'label' => __('Success Message Padding', 'pwh-dcfh'),
                'type' => 'custom_padding',
                'description' => __('Padding adds extra space to the inside of the element, increasing the distance between the edge of the element and its inner contents.', 'pwh-dcfh'),
                'advanced_fields' => true,
                'mobile_options' => true,
                'toggle_slug' => 'success_message_toggle',
                'sub_toggle' => 'wrapper_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['success_message_border'] = [
                'label' => __('Success Message Border Radius', 'pwh-dcfh'),
                'type' => 'border-radius',
                'description' => __('Here you can control the corner radius of this element. Enable the link icon to control all four corners at once, or disable to define custom values for each.', 'pwh-dcfh'),
                'default' => '',
                'option_category' => 'border',
                'mobile_options' => true,
                'toggle_slug' => 'success_message_toggle',
                'sub_toggle' => 'wrapper_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['success_message_border_color'] = [
                'label' => __('Success Message Border Color', 'pwh-dcfh'),
                'type' => 'color',
                'description' => __('Pick a color to be used for the border.', 'pwh-dcfh'),
                'custom_color' => true,
                'default' => '',
                'mobile_options' => true,
                'toggle_slug' => 'success_message_toggle',
                'sub_toggle' => 'wrapper_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['success_message_border_width'] = [
                'label' => __('Success Message Border Width', 'pwh-dcfh'),
                'type' => 'range',
                'description' => __('Increasing the width of the border will increase its size/thickness.', 'pwh-dcfh'),
                'fixed_unit' => 'px',
                'validate_unit' => true,
                'fixed_range' => true,
                'range_settings' => [
                    'min' => '1',
                    'max' => '50',
                    'step' => '1',
                    'min_limit' => -80,
                    'max_limit' => 80,
                ],
                'default' => '',
                'mobile_options' => true,
                'toggle_slug' => 'success_message_toggle',
                'sub_toggle' => 'wrapper_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['success_message_border_style'] = [
                'label' => __('Success Message Border Style', 'pwh-dcfh'),
                'type' => 'select',
                'description' => __('Borders support various different styles, each of which will change the shape of the border element.', 'pwh-dcfh'),
                'options' => et_builder_get_border_styles(),
                'default' => 'solid',
                'mobile_options' => true,
                'toggle_slug' => 'success_message_toggle',
                'sub_toggle' => 'wrapper_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['success_message_shadow'] = [
                'label' => __('Success Message Shadow', 'pwh-dcfh'),
                'type' => 'select_box_shadow',
                'description' => __('Pick a box shadow style to enable box shadow for this element. Once enabled, you will be able to customize your box shadow style further. To disable custom box shadow style, choose the None option.', 'pwh-dcfh'),
                'presets' => pwh_dcfh_module_helpers()::get_shadow_presets('success_message'),
                'default' => 'none',
                'className' => 'et_pb_success_message',
                'toggle_slug' => 'success_message_toggle',
                'sub_toggle' => 'wrapper_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['success_message_shadow_horizontal'] = [
                'type' => 'range',
                'label' => __('Shadow Horizontal Position', 'pwh-dcfh'),
                'description' => __('Shadow\'s horizontal distance from the element. A negative value places the shadow to the left of the element.', 'pwh-dcfh'),
                'range_settings' => [
                    'min' => -80,
                    'max' => 80,
                    'step' => 1,
                    'min_limit' => -80,
                    'max_limit' => 80,
                ],
                'allowed_units' => et_builder_get_acceptable_css_string_values('font-size'),
                'default_unit' => 'px',
                'fixed_range' => true,
                'default' => [
                    'success_message_shadow',
                    [
                        'none' => '',
                        'preset1' => '0px',
                        'preset2' => '6px',
                        'preset3' => '0px',
                        'preset4' => '10px',
                        'preset5' => '0px',
                        'preset6' => '0px',
                        'preset7' => '10px',
                    ]
                ],
                'show_if_not' => ['success_message_shadow' => 'none'],
                'toggle_slug' => 'success_message_toggle',
                'sub_toggle' => 'wrapper_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['success_message_shadow_vertical'] = [
                'type' => 'range',
                'label' => __('Shadow Vertical Position', 'pwh-dcfh'),
                'description' => __('Shadow\'s vertical distance from the element. A negative value places the shadow above the element.', 'pwh-dcfh'),
                'range_settings' => [
                    'min' => -80,
                    'max' => 80,
                    'step' => 1,
                    'min_limit' => -80,
                    'max_limit' => 80,
                ],
                'allowed_units' => et_builder_get_acceptable_css_string_values('font-size'),
                'default_unit' => 'px',
                'fixed_range' => true,
                'default' => [
                    'success_message_shadow',
                    [
                        'none' => '',
                        'preset1' => '2px',
                        'preset2' => '6px',
                        'preset3' => '12px',
                        'preset4' => '10px',
                        'preset5' => '6px',
                        'preset6' => '0px',
                        'preset7' => '10px',
                    ]
                ],
                'show_if_not' => ['success_message_shadow' => 'none'],
                'toggle_slug' => 'success_message_toggle',
                'sub_toggle' => 'wrapper_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['success_message_shadow_blur'] = [
                'type' => 'range',
                'label' => __('Shadow Blur Strength', 'pwh-dcfh'),
                'description' => __('The higher the value, the bigger the blur, the shadow becomes wider and lighter.', 'pwh-dcfh'),
                'range_settings' => [
                    'min' => 0,
                    'max' => 80,
                    'step' => 1,
                    'min_limit' => 0,
                    'max_limit' => 80,
                ],
                'allowed_units' => et_builder_get_acceptable_css_string_values('font-size'),
                'default_unit' => 'px',
                'fixed_range' => true,
                'default' => [
                    'success_message_shadow',
                    [
                        'none' => '',
                        'preset1' => '18px',
                        'preset2' => '18px',
                        'preset3' => '18px',
                        'preset4' => '0px',
                        'preset5' => '0px',
                        'preset6' => '18px',
                        'preset7' => '0px',
                    ]
                ],
                'show_if_not' => ['success_message_shadow' => 'none'],
                'toggle_slug' => 'success_message_toggle',
                'sub_toggle' => 'wrapper_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['success_message_shadow_spread'] = [
                'type' => 'range',
                'label' => __('Shadow Spread Strength', 'pwh-dcfh'),
                'description' => __('Increasing the spread strength will increase the density of the box shadow. Higher density results in a more intense shadow.', 'pwh-dcfh'),
                'range_settings' => [
                    'min' => -80,
                    'max' => 80,
                    'step' => 1,
                    'min_limit' => -80,
                    'max_limit' => 80,
                ],
                'allowed_units' => et_builder_get_acceptable_css_string_values('font-size'),
                'default_unit' => 'px',
                'fixed_range' => true,
                'default' => [
                    'success_message_shadow',
                    [
                        'none' => '',
                        'preset1' => '0px',
                        'preset2' => '0px',
                        'preset3' => '6px',
                        'preset4' => '0px',
                        'preset5' => '10px',
                        'preset6' => '0px',
                        'preset7' => '0px',
                    ]
                ],
                'show_if_not' => ['success_message_shadow' => 'none'],
                'toggle_slug' => 'success_message_toggle',
                'sub_toggle' => 'wrapper_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['success_message_shadow_color'] = [
                'type' => 'color-alpha',
                'label' => __('Shadow Color', 'pwh-dcfh'),
                'description' => __('The color of the shadow.', 'pwh-dcfh'),
                'default' => 'rgba(0,0,0,0.3)',
                'field_template' => 'color',
                'show_if_not' => ['success_message_shadow' => 'none'],
                'toggle_slug' => 'success_message_toggle',
                'sub_toggle' => 'wrapper_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['success_message_shadow_position'] = [
                'type' => 'select',
                'label' => __('Shadow Position', 'pwh-dcfh'),
                'description' => __('Choose whether you would like the shadow to appear outside your module, lifting the module up from the page, or inside the module, setting the module downwards within the page.', 'pwh-dcfh'),
                'options' => [
                    '' => __('Outer Shadow', 'pwh-dcfh'),
                    'inset' => __('Inner Shadow', 'pwh-dcfh'),
                ],
                'default' => [
                    'success_message_shadow',
                    [
                        'none' => '',
                        'preset1' => '',
                        'preset2' => '',
                        'preset3' => '',
                        'preset4' => '',
                        'preset5' => '',
                        'preset6' => 'inset',
                        'preset7' => 'inset',
                    ]
                ],
                'show_if_not' => ['success_message_shadow' => 'none'],
                'toggle_slug' => 'success_message_toggle',
                'sub_toggle' => 'wrapper_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['success_message_heading_font'] = [
                'label' => __('Heading Text', 'pwh-dcfh'),
                'type' => 'font',
                'description' => __('Choose a custom font to use for the heading. All Google web fonts are available, or you can upload your own custom font files.', 'pwh-dcfh'),
                'default' => '',
                'mobile_options' => true,
                'toggle_slug' => 'success_message_toggle',
                'sub_toggle' => 'heading_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['success_message_heading_color'] = [
                'label' => __('Heading Text Color', 'pwh-dcfh'),
                'type' => 'color-alpha',
                'description' => __('Pick a color to be used for the heading text.', 'pwh-dcfh'),
                'custom_color' => true,
                'default' => '',
                'mobile_options' => true,
                'toggle_slug' => 'success_message_toggle',
                'sub_toggle' => 'heading_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['success_message_heading_size'] = [
                'label' => __('Heading Text Size', 'pwh-dcfh'),
                'type' => 'range',
                'description' => __('Increase or decrease the size of the heading text.', 'pwh-dcfh'),
                'validate_unit' => true,
                'allowed_units' => et_builder_get_acceptable_css_string_values('font-size'),
                'fixed_range' => true,
                'range_settings' => [
                    'min' => '1',
                    'max' => '100',
                    'step' => '1',
                    'min_limit' => 1,
                    'max_limit' => 100,
                ],
                'default' => '',
                'mobile_options' => true,
                'toggle_slug' => 'success_message_toggle',
                'sub_toggle' => 'heading_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['success_message_heading_letterspace'] = [
                'label' => __('Heading Text Letter Spacing', 'pwh-dcfh'),
                'type' => 'range',
                'description' => __('Letter spacing adjusts the distance between each letter in the heading.', 'pwh-dcfh'),
                'fixed_unit' => 'px',
                'validate_unit' => true,
                'fixed_range' => true,
                'range_settings' => [
                    'min' => '1',
                    'max' => '100',
                    'step' => '1',
                    'min_limit' => 1,
                    'max_limit' => 100,
                ],
                'default' => '',
                'mobile_options' => true,
                'toggle_slug' => 'success_message_toggle',
                'sub_toggle' => 'heading_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['success_message_heading_lineheight'] = [
                'label' => __('Heading Text Line Height', 'pwh-dcfh'),
                'type' => 'range',
                'description' => __('Line height adjusts the distance between each line of the heading text. This becomes noticeable if the heading is long and wraps onto multiple lines.', 'pwh-dcfh'),
                'fixed_unit' => 'em',
                'validate_unit' => true,
                'fixed_range' => true,
                'range_settings' => [
                    'min' => '1',
                    'max' => '3',
                    'step' => '0.1',
                    'min_limit' => 1,
                    'max_limit' => 3,
                ],
                'default' => '',
                'mobile_options' => true,
                'toggle_slug' => 'success_message_toggle',
                'sub_toggle' => 'heading_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['success_message_heading_alignment'] = [
                'label' => __('Heading Alignment', 'pwh-dcfh'),
                'type' => 'align',
                'description' => __('Align the heading to the left, right, center or justify.', 'pwh-dcfh'),
                'options' => et_builder_get_text_orientation_options(),
                'advanced_fields' => true,
                'mobile_options' => true,
                'toggle_slug' => 'success_message_toggle',
                'sub_toggle' => 'heading_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['success_message_font'] = [
                'label' => __('Paragraph Font', 'pwh-dcfh'),
                'type' => 'font',
                'description' => __('Choose a custom font to use for the Title. All Google web fonts are available, or you can upload your own custom font files.', 'pwh-dcfh'),
                'default' => '',
                'mobile_options' => true,
                'toggle_slug' => 'success_message_toggle',
                'sub_toggle' => 'paragraph_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['success_message_font_color'] = [
                'label' => __('Paragraph Color', 'pwh-dcfh'),
                'type' => 'color-alpha',
                'description' => __('Pick a color to be used for the Title text.', 'pwh-dcfh'),
                'custom_color' => true,
                'default' => '',
                'mobile_options' => true,
                'toggle_slug' => 'success_message_toggle',
                'sub_toggle' => 'paragraph_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['success_message_font_size'] = [
                'label' => __('Paragraph Font Size', 'pwh-dcfh'),
                'type' => 'range',
                'description' => __('Increase or decrease the size of the Title text.', 'pwh-dcfh'),
                'validate_unit' => true,
                'allowed_units' => et_builder_get_acceptable_css_string_values('font-size'),
                'fixed_range' => true,
                'range_settings' => [
                    'min' => '1',
                    'max' => '100',
                    'step' => '1',
                    'min_limit' => 1,
                    'max_limit' => 100,
                ],
                'default' => '',
                'mobile_options' => true,
                'toggle_slug' => 'success_message_toggle',
                'sub_toggle' => 'paragraph_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['success_message_letterspace'] = [
                'label' => __('Paragraph Letter Spacing', 'pwh-dcfh'),
                'type' => 'range',
                'description' => __('Letter spacing adjusts the distance between each letter in the Title.', 'pwh-dcfh'),
                'fixed_unit' => 'px',
                'validate_unit' => true,
                'fixed_range' => true,
                'range_settings' => [
                    'min' => '1',
                    'max' => '100',
                    'step' => '1',
                ],
                'default' => '',
                'mobile_options' => true,
                'toggle_slug' => 'success_message_toggle',
                'sub_toggle' => 'paragraph_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['success_message_lineheight'] = [
                'label' => __('Paragraph Line Height', 'pwh-dcfh'),
                'type' => 'range',
                'description' => __('Line height adjusts the distance between each line of the Title text. This becomes noticeable if the Title is long and wraps onto multiple lines.', 'pwh-dcfh'),
                'fixed_unit' => 'em',
                'validate_unit' => true,
                'fixed_range' => true,
                'range_settings' => [
                    'min' => '1',
                    'max' => '3',
                    'step' => '0.1',
                    'min_limit' => 1,
                    'max_limit' => 3,
                ],
                'default' => '',
                'mobile_options' => true,
                'toggle_slug' => 'success_message_toggle',
                'sub_toggle' => 'paragraph_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['success_message_alignment'] = [
                'label' => __('Paragraph Alignment', 'pwh-dcfh'),
                'type' => 'text_align',
                'description' => __('Align the Title to the left, right, center or justify.', 'pwh-dcfh'),
                'options' => et_builder_get_text_orientation_options(['justified'], ['justify' => 'Justified']),
                'advanced_fields' => true,
                'mobile_options' => true,
                'toggle_slug' => 'success_message_toggle',
                'sub_toggle' => 'paragraph_toggle',
                'tab_slug' => 'advanced',
            ];
            //==================================================
            // Redirect
            //==================================================
            if (isset($fields_unprocessed['use_redirect'])) {
                $fields_unprocessed['use_redirect'] = [];
            }
            if (isset($fields_unprocessed['redirect_url'])) {
                $fields_unprocessed['redirect_url'] = [];
            }
            $custom_fields['custom_use_redirect'] = [
                'label' => __('Enable Redirect URL', 'pwh-dcfh'),
                'type' => 'yes_no_button',
                'option_category' => 'configuration',
                'options' => [
                    'off' => et_builder_i18n('No'),
                    'on' => et_builder_i18n('Yes'),
                ],
                'affects' => [
                    'redirect_url',
                ],
                'toggle_slug' => 'redirect',
                'description' => __('Redirect users after successful form submission.', 'pwh-dcfh'),
                'default_on_front' => 'off',
            ];
            $custom_fields['custom_redirect_to'] = [
                'label' => __('Redirect To', 'pwh-dcfh'),
                'description' => __('Choose the type of redirect link.', 'pwh-dcfh'),
                'type' => 'select',
                'options' => [
                    'url' => __('Custom URL', 'pwh-dcfh'),
                    'page' => __('Page', 'pwh-dcfh'),
                ],
                'default' => 'url',
                'show_if' => [
                    'custom_use_redirect' => 'on',
                ],
                'toggle_slug' => 'redirect',
            ];
            $custom_fields['custom_redirect_url'] = [
                'label' => __('Custom URL', 'pwh-dcfh'),
                'type' => 'text',
                'description' => __('Enter a custom URL to redirect to after a successful form submission.', 'pwh-dcfh'),
                'default' => home_url(),
                'show_if' => [
                    'custom_use_redirect' => 'on',
                    'custom_redirect_to' => 'url',
                ],
                'toggle_slug' => 'redirect',
            ];
            $custom_fields['custom_redirect_page'] = [
                'label' => __('Select Page', 'pwh-dcfh'),
                'type' => 'select',
                'description' => __('Select a page for the redirect link.', 'pwh-dcfh'),
                'options' => pwh_dcfh_wp_helpers()::get_pages(),
                'show_if' => [
                    'custom_use_redirect' => 'on',
                    'custom_redirect_to' => 'page',
                ],
                'toggle_slug' => 'redirect',
            ];
            $custom_fields['custom_redirect_delay'] = [
                'label' => __('Redirect Delay', 'pwh-dcfh'),
                'type' => 'range',
                'description' => __('Set the amount of time in milliseconds for the redirect to wait after a successful form submission.', 'pwh-dcfh'),
                'unitless' => true,
                'range_settings' => [
                    'min' => '0',
                    'max' => '100000',
                    'step' => '10',
                    'min_limit' => 0,
                    'max_limit' => 100000,
                ],
                'default' => '3000',
                'show_if' => ['custom_use_redirect' => 'on'],
                'toggle_slug' => 'redirect',
            ];
            //==================================================
            // API Endpoint URL
            //==================================================
            $custom_fields['api_endpoint_url'] = [
                'label' => __('API Endpoint URL', 'pwh-dcfh'),
                'type' => 'text',
                'description' => __('Enter the API endpoint URL into the input field for the destination where the form data should be sent using the POST method when a form entry is submitted.', 'pwh-dcfh'),
                'default' => '',
                'toggle_slug' => 'redirect',
            ];
            //==================================================
            // JS CODE
            //==================================================
            $custom_fields['custom_js_code'] = [
                'label' => __('JavaScript Code To Run When Form Submitted', 'pwh-dcfh'),
                'type' => 'codemirror',
                //'mode' => 'html',
                'description' => __('Choose to add custom JavaScript to run when the form is successfully submitted.', 'pwh-dcfh'),
                'default' => '',
                'toggle_slug' => 'redirect',
            ];
            //==================================================
            // Field Input Focus Border
            //==================================================
            $custom_fields['input_focus_border'] = [
                'label' => __('Input Focus Border Radius', 'pwh-dcfh'),
                'type' => 'border-radius',
                'description' => __('Here you can control the corner radius of this element. Enable the link icon to control all four corners at once, or disable to define custom values for each.', 'pwh-dcfh'),
                'default' => '',
                'option_category' => 'border',
                'mobile_options' => true,
                'toggle_slug' => 'border',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['input_focus_border_color'] = [
                'label' => __('Input Focus Border Color', 'pwh-dcfh'),
                'type' => 'color',
                'description' => __('Pick a color to be used for the border.', 'pwh-dcfh'),
                'custom_color' => true,
                'default' => '',
                'mobile_options' => true,
                'toggle_slug' => 'border',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['input_focus_border_width'] = [
                'label' => __('Input Focus Border Width', 'pwh-dcfh'),
                'type' => 'range',
                'description' => __('Increasing the width of the border will increase its size/thickness.', 'pwh-dcfh'),
                'fixed_unit' => 'px',
                'validate_unit' => true,
                'fixed_range' => true,
                'range_settings' => [
                    'min' => '1',
                    'max' => '50',
                    'step' => '1',
                    'min_limit' => -80,
                    'max_limit' => 80,
                ],
                'default' => '',
                'mobile_options' => true,
                'toggle_slug' => 'border',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['input_focus_border_style'] = [
                'label' => __('Input Focus Border Style', 'pwh-dcfh'),
                'type' => 'select',
                'description' => __('Borders support various different styles, each of which will change the shape of the border element.', 'pwh-dcfh'),
                'options' => et_builder_get_border_styles(),
                'default' => 'solid',
                'mobile_options' => true,
                'toggle_slug' => 'border',
                'tab_slug' => 'advanced',
            ];
            //==================================================
            // Field Label Text
            //==================================================
            $custom_fields['field_label_font'] = [
                'label' => __('Label Text', 'pwh-dcfh'),
                'type' => 'font',
                'description' => __('Choose a custom font to use for the Title. All Google web fonts are available, or you can upload your own custom font files.', 'pwh-dcfh'),
                'default' => '',
                'mobile_options' => true,
                'toggle_slug' => 'field_label_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['field_label_color'] = [
                'label' => __('Label Text Color', 'pwh-dcfh'),
                'type' => 'color-alpha',
                'description' => __('Pick a color to be used for the Title text.', 'pwh-dcfh'),
                'custom_color' => true,
                'default' => '',
                'mobile_options' => true,
                'toggle_slug' => 'field_label_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['field_label_size'] = [
                'label' => __('Label Text Size', 'pwh-dcfh'),
                'type' => 'range',
                'description' => __('Increase or decrease the size of the Title text.', 'pwh-dcfh'),
                'validate_unit' => true,
                'allowed_units' => et_builder_get_acceptable_css_string_values('font-size'),
                'fixed_range' => true,
                'range_settings' => [
                    'min' => '1',
                    'max' => '100',
                    'step' => '1',
                    'min_limit' => 1,
                    'max_limit' => 100,
                ],
                'default' => '',
                'mobile_options' => true,
                'toggle_slug' => 'field_label_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['field_label_letter_space'] = [
                'label' => __('Label Text Letter Spacing', 'pwh-dcfh'),
                'type' => 'range',
                'description' => __('Letter spacing adjusts the distance between each letter in the Title.', 'pwh-dcfh'),
                'fixed_unit' => 'px',
                'validate_unit' => true,
                'fixed_range' => true,
                'range_settings' => [
                    'min' => '1',
                    'max' => '100',
                    'step' => '1',
                    'min_limit' => 1,
                    'max_limit' => 100,
                ],
                'default' => '',
                'mobile_options' => true,
                'toggle_slug' => 'field_label_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['field_label_line_height'] = [
                'label' => __('Label Text Line Height', 'pwh-dcfh'),
                'type' => 'range',
                'description' => __('Line height adjusts the distance between each line of the Title text. This becomes noticeable if the Title is long and wraps onto multiple lines.', 'pwh-dcfh'),
                'fixed_unit' => 'em',
                'validate_unit' => true,
                'fixed_range' => true,
                'range_settings' => [
                    'min' => '1',
                    'max' => '3',
                    'step' => '0.1',
                    'min_limit' => 1,
                    'max_limit' => 3,
                ],
                'default' => '',
                'mobile_options' => true,
                'toggle_slug' => 'field_label_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['field_label_alignment'] = [
                'label' => __('Label Alignment', 'pwh-dcfh'),
                'type' => 'align',
                'description' => __('Align the Title to the left, right, center or justify.', 'pwh-dcfh'),
                'options' => et_builder_get_text_orientation_options(['justified']),
                'advanced_fields' => true,
                'mobile_options' => true,
                'toggle_slug' => 'field_label_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['field_label_margin'] = [
                'label' => __('Label Margin', 'pwh-dcfh'),
                'type' => 'custom_margin',
                'description' => __('Margin adds extra space to the outside of the element, increasing the distance between the element and other items on the page.', 'pwh-dcfh'),
                'responsive' => true,
                'mobile_options' => true,
                'toggle_slug' => 'field_label_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['field_label_padding'] = [
                'label' => __('Label Padding', 'pwh-dcfh'),
                'type' => 'custom_padding',
                'description' => __('Padding adds extra space to the inside of the element, increasing the distance between the edge of the element and its inner contents.', 'pwh-dcfh'),
                'options' => et_builder_get_text_orientation_options(['justified'], ['justify' => 'Justified']),
                'advanced_fields' => true,
                'mobile_options' => true,
                'toggle_slug' => 'field_label_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['field_label_background'] = [
                'label' => __('Label Background Color', 'pwh-dcfh'),
                'type' => 'color-alpha',
                'description' => __('Adjust the background style of this element by customizing the background color, gradient, image and video.', 'pwh-dcfh'),
                'custom_color' => true,
                'default' => '',
                'mobile_options' => true,
                'toggle_slug' => 'field_label_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['field_label_border'] = [
                'label' => __('Label Border Radius', 'pwh-dcfh'),
                'type' => 'border-radius',
                'description' => __('Here you can control the corner radius of this element. Enable the link icon to control all four corners at once, or disable to define custom values for each.', 'pwh-dcfh'),
                'default' => '',
                'option_category' => 'border',
                'mobile_options' => true,
                'toggle_slug' => 'field_label_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['field_label_border_color'] = [
                'label' => __('Label Border Color', 'pwh-dcfh'),
                'type' => 'color',
                'description' => __('Pick a color to be used for the border.', 'pwh-dcfh'),
                'custom_color' => true,
                'default' => '',
                'mobile_options' => true,
                'toggle_slug' => 'field_label_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['field_label_border_width'] = [
                'label' => __('Label Border Width', 'pwh-dcfh'),
                'type' => 'range',
                'description' => __('Increasing the width of the border will increase its size/thickness.', 'pwh-dcfh'),
                'fixed_unit' => 'px',
                'validate_unit' => true,
                'fixed_range' => true,
                'range_settings' => [
                    'min' => '1',
                    'max' => '50',
                    'step' => '1',
                    'min_limit' => 1,
                    'max_limit' => 50,
                ],
                'default' => '',
                'mobile_options' => true,
                'toggle_slug' => 'field_label_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['field_label_border_style'] = [
                'label' => __('Label Border Style', 'pwh-dcfh'),
                'type' => 'select',
                'description' => __('Borders support various different styles, each of which will change the shape of the border element.', 'pwh-dcfh'),
                'options' => et_builder_get_border_styles(),
                'default' => 'solid',
                'mobile_options' => true,
                'toggle_slug' => 'field_label_toggle',
                'tab_slug' => 'advanced',
            ];
            /* $custom_fields['field_label_shadow'] = [
                 'label' => __('Label Shadow', 'pwh-dcfh'),
                 'type' => 'select_box_shadow',
                 'description' => __('Pick a box shadow style to enable box shadow for this element. Once enabled, you will be able to customize your box shadow style further. To disable custom box shadow style, choose the None option.', 'pwh-dcfh'),
                 'presets' => pwh_dcfh_module_helpers()::get_shadow_presets('field_label'),
                 'default' => 'none',
                 'className' => 'et_pb_success_button',
                 'toggle_slug' => 'field_label_toggle',
                 'tab_slug' => 'advanced',
             ];
             $custom_fields['field_label_shadow_horizontal'] = [
                 'type' => 'range',
                 'label' => __('Shadow Horizontal Position', 'pwh-dcfh'),
                 'description' => __('Shadow\'s horizontal distance from the element. A negative value places the shadow to the left of the element.', 'pwh-dcfh'),
                 'range_settings' => [
                     'min' => -80,
                     'max' => 80,
                     'step' => 1,
                     'min_limit' => -80,
                     'max_limit' => 80,
                 ],
                 'allowed_units' => et_builder_get_acceptable_css_string_values('font-size'),
                 'default_unit' => 'px',
                 'fixed_range' => true,
                 'default' => [
                     'field_label_shadow',
                     [
                         'none' => '',
                         'preset1' => '0px',
                         'preset2' => '6px',
                         'preset3' => '0px',
                         'preset4' => '10px',
                         'preset5' => '0px',
                         'preset6' => '0px',
                         'preset7' => '10px',
                     ]
                 ],
                 'show_if_not' => ['field_label_shadow' => 'none'],
                 'toggle_slug' => 'field_label_toggle',
                 'tab_slug' => 'advanced',
             ];
             $custom_fields['field_label_shadow_vertical'] = [
                 'type' => 'range',
                 'label' => __('Shadow Vertical Position', 'pwh-dcfh'),
                 'description' => __('Shadow\'s vertical distance from the element. A negative value places the shadow above the element.', 'pwh-dcfh'),
                 'range_settings' => [
                     'min' => -80,
                     'max' => 80,
                     'step' => 1,
                     'min_limit' => -80,
                     'max_limit' => 80,
                 ],
                 'allowed_units' => et_builder_get_acceptable_css_string_values('font-size'),
                 'default_unit' => 'px',
                 'fixed_range' => true,
                 'default' => [
                     'field_label_shadow',
                     [
                         'none' => '',
                         'preset1' => '2px',
                         'preset2' => '6px',
                         'preset3' => '12px',
                         'preset4' => '10px',
                         'preset5' => '6px',
                         'preset6' => '0px',
                         'preset7' => '10px',
                     ]
                 ],
                 'show_if_not' => ['field_label_shadow' => 'none'],
                 'toggle_slug' => 'field_label_toggle',
                 'tab_slug' => 'advanced',
             ];
             $custom_fields['field_label_shadow_blur'] = [
                 'type' => 'range',
                 'label' => __('Shadow Blur Strength', 'pwh-dcfh'),
                 'description' => __('The higher the value, the bigger the blur, the shadow becomes wider and lighter.', 'pwh-dcfh'),
                 'range_settings' => [
                     'min' => 0,
                     'max' => 80,
                     'step' => 1,
                     'min_limit' => -80,
                     'max_limit' => 80,
                 ],
                 'allowed_units' => et_builder_get_acceptable_css_string_values('font-size'),
                 'default_unit' => 'px',
                 'fixed_range' => true,
                 'default' => [
                     'field_label_shadow',
                     [
                         'none' => '',
                         'preset1' => '18px',
                         'preset2' => '18px',
                         'preset3' => '18px',
                         'preset4' => '0px',
                         'preset5' => '0px',
                         'preset6' => '18px',
                         'preset7' => '0px',
                     ]
                 ],
                 'show_if_not' => ['field_label_shadow' => 'none'],
                 'toggle_slug' => 'field_label_toggle',
                 'tab_slug' => 'advanced',
             ];
             $custom_fields['field_label_shadow_spread'] = [
                 'type' => 'range',
                 'label' => __('Shadow Spread Strength', 'pwh-dcfh'),
                 'description' => __('Increasing the spread strength will increase the density of the box shadow. Higher density results in a more intense shadow.', 'pwh-dcfh'),
                 'range_settings' => [
                     'min' => -80,
                     'max' => 80,
                     'step' => 1,
                     'min_limit' => -80,
                     'max_limit' => 80,
                 ],
                 'allowed_units' => et_builder_get_acceptable_css_string_values('font-size'),
                 'default_unit' => 'px',
                 'fixed_range' => true,
                 'default' => [
                     'field_label_shadow',
                     [
                         'none' => '',
                         'preset1' => '0px',
                         'preset2' => '0px',
                         'preset3' => '6px',
                         'preset4' => '0px',
                         'preset5' => '10px',
                         'preset6' => '0px',
                         'preset7' => '0px',
                     ]
                 ],
                 'show_if_not' => ['field_label_shadow' => 'none'],
                 'toggle_slug' => 'field_label_toggle',
                 'tab_slug' => 'advanced',
             ];
             $custom_fields['field_label_shadow_color'] = [
                 'type' => 'color-alpha',
                 'label' => __('Shadow Color', 'pwh-dcfh'),
                 'description' => __('The color of the shadow.', 'pwh-dcfh'),
                 'default' => 'rgba(0,0,0,0.3)',
                 'field_template' => 'color',
                 'show_if_not' => ['field_label_shadow' => 'none'],
                 'toggle_slug' => 'field_label_toggle',
                 'tab_slug' => 'advanced',
             ];
             $custom_fields['field_label_shadow_position'] = [
                 'type' => 'select',
                 'label' => __('Shadow Position', 'pwh-dcfh'),
                 'description' => __('Choose whether you would like the shadow to appear outside your module, lifting the module up from the page, or inside the module, setting the module downwards within the page.', 'pwh-dcfh'),
                 'options' => [
                     '' => __('Outer Shadow', 'pwh-dcfh'),
                     'inset' => __('Inner Shadow', 'pwh-dcfh'),
                 ],
                 'default' => [
                     'field_label_shadow',
                     [
                         'none' => '',
                         'preset1' => '',
                         'preset2' => '',
                         'preset3' => '',
                         'preset4' => '',
                         'preset5' => '',
                         'preset6' => 'inset',
                         'preset7' => 'inset',
                     ]
                 ],
                 'show_if_not' => ['field_label_shadow' => 'none'],
                 'toggle_slug' => 'field_label_toggle',
                 'tab_slug' => 'advanced',
             ];*/
            //==================================================
            // Desc Label Text
            //==================================================
            $custom_fields['field_desc_font'] = [
                'label' => __('Description Text', 'pwh-dcfh'),
                'type' => 'font',
                'description' => __('Choose a custom font to use for the Title. All Google web fonts are available, or you can upload your own custom font files.', 'pwh-dcfh'),
                'default' => '',
                'mobile_options' => true,
                'toggle_slug' => 'field_desc_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['field_desc_color'] = [
                'label' => __('Description Text Color', 'pwh-dcfh'),
                'type' => 'color-alpha',
                'description' => __('Pick a color to be used for the Title text.', 'pwh-dcfh'),
                'custom_color' => true,
                'default' => '',
                'mobile_options' => true,
                'toggle_slug' => 'field_desc_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['field_desc_size'] = [
                'label' => __('Description Text Size', 'pwh-dcfh'),
                'type' => 'range',
                'description' => __('Increase or decrease the size of the Title text.', 'pwh-dcfh'),
                'validate_unit' => true,
                'allowed_units' => et_builder_get_acceptable_css_string_values('font-size'),
                'fixed_range' => true,
                'range_settings' => [
                    'min' => '1',
                    'max' => '100',
                    'step' => '1',
                    'min_limit' => 1,
                    'max_limit' => 100,
                ],
                'default' => '',
                'mobile_options' => true,
                'toggle_slug' => 'field_desc_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['field_desc_letter_space'] = [
                'label' => __('Description Text Letter Spacing', 'pwh-dcfh'),
                'type' => 'range',
                'description' => __('Letter spacing adjusts the distance between each letter in the Title.', 'pwh-dcfh'),
                'fixed_unit' => 'px',
                'validate_unit' => true,
                'fixed_range' => true,
                'range_settings' => [
                    'min' => '1',
                    'max' => '100',
                    'step' => '1',
                    'min_limit' => 1,
                    'max_limit' => 100,
                ],
                'default' => '',
                'mobile_options' => true,
                'toggle_slug' => 'field_desc_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['field_desc_line_height'] = [
                'label' => __('Description Text Line Height', 'pwh-dcfh'),
                'type' => 'range',
                'description' => __('Line height adjusts the distance between each line of the Title text. This becomes noticeable if the Title is long and wraps onto multiple lines.', 'pwh-dcfh'),
                'fixed_unit' => 'em',
                'validate_unit' => true,
                'fixed_range' => true,
                'range_settings' => [
                    'min' => '1',
                    'max' => '3',
                    'step' => '0.1',
                    'min_limit' => 1,
                    'max_limit' => 3,
                ],
                'default' => '',
                'mobile_options' => true,
                'toggle_slug' => 'field_desc_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['field_desc_alignment'] = [
                'label' => __('Description Alignment', 'pwh-dcfh'),
                'type' => 'align',
                'description' => __('Align the Title to the left, right, center or justify.', 'pwh-dcfh'),
                'options' => et_builder_get_text_orientation_options(['justified']),
                'advanced_fields' => true,
                'mobile_options' => true,
                'toggle_slug' => 'field_desc_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['field_desc_margin'] = [
                'label' => __('Description Margin', 'pwh-dcfh'),
                'type' => 'custom_margin',
                'description' => __('Margin adds extra space to the outside of the element, increasing the distance between the element and other items on the page.', 'pwh-dcfh'),
                'responsive' => true,
                'mobile_options' => true,
                'toggle_slug' => 'field_desc_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['field_desc_padding'] = [
                'label' => __('Description Padding', 'pwh-dcfh'),
                'type' => 'custom_padding',
                'description' => __('Padding adds extra space to the inside of the element, increasing the distance between the edge of the element and its inner contents.', 'pwh-dcfh'),
                'options' => et_builder_get_text_orientation_options(['justified'], ['justify' => 'Justified']),
                'advanced_fields' => true,
                'mobile_options' => true,
                'toggle_slug' => 'field_desc_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['field_desc_background'] = [
                'label' => __('Description Background Color', 'pwh-dcfh'),
                'type' => 'color-alpha',
                'description' => __('Adjust the background style of this element by customizing the background color, gradient, image and video.', 'pwh-dcfh'),
                'custom_color' => true,
                'default' => '',
                'mobile_options' => true,
                'toggle_slug' => 'field_desc_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['field_desc_border'] = [
                'label' => __('Description Border Radius', 'pwh-dcfh'),
                'type' => 'border-radius',
                'description' => __('Here you can control the corner radius of this element. Enable the link icon to control all four corners at once, or disable to define custom values for each.', 'pwh-dcfh'),
                'default' => '',
                'option_category' => 'border',
                'mobile_options' => true,
                'toggle_slug' => 'field_desc_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['field_desc_border_color'] = [
                'label' => __('Description Border Color', 'pwh-dcfh'),
                'type' => 'color',
                'description' => __('Pick a color to be used for the border.', 'pwh-dcfh'),
                'custom_color' => true,
                'default' => '',
                'mobile_options' => true,
                'toggle_slug' => 'field_desc_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['field_desc_border_width'] = [
                'label' => __('Description Border Width', 'pwh-dcfh'),
                'type' => 'range',
                'description' => __('Increasing the width of the border will increase its size/thickness.', 'pwh-dcfh'),
                'fixed_unit' => 'px',
                'validate_unit' => true,
                'fixed_range' => true,
                'range_settings' => [
                    'min' => '1',
                    'max' => '50',
                    'step' => '1',
                    'min_limit' => 1,
                    'max_limit' => 50,
                ],
                'default' => '',
                'mobile_options' => true,
                'toggle_slug' => 'field_desc_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['field_desc_border_style'] = [
                'label' => __('Description Border Style', 'pwh-dcfh'),
                'type' => 'select',
                'description' => __('Borders support various different styles, each of which will change the shape of the border element.', 'pwh-dcfh'),
                'options' => et_builder_get_border_styles(),
                'default' => 'solid',
                'mobile_options' => true,
                'toggle_slug' => 'field_desc_toggle',
                'tab_slug' => 'advanced',
            ];
            /*$custom_fields['field_desc_shadow'] = [
                'label' => __('Description Shadow', 'pwh-dcfh'),
                'type' => 'select_box_shadow',
                'description' => __('Pick a box shadow style to enable box shadow for this element. Once enabled, you will be able to customize your box shadow style further. To disable custom box shadow style, choose the None option.', 'pwh-dcfh'),
                'presets' => pwh_dcfh_module_helpers()::get_shadow_presets('field_desc'),
                'default' => 'none',
                'className' => 'et_pb_success_button',
                'toggle_slug' => 'field_desc_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['field_desc_shadow_horizontal'] = [
                'type' => 'range',
                'label' => __('Shadow Horizontal Position', 'pwh-dcfh'),
                'description' => __('Shadow\'s horizontal distance from the element. A negative value places the shadow to the left of the element.', 'pwh-dcfh'),
                'range_settings' => [
                    'min' => -80,
                    'max' => 80,
                    'step' => 1,
                    'min_limit' => -80,
                    'max_limit' => 80,
                ],
                'allowed_units' => et_builder_get_acceptable_css_string_values('font-size'),
                'default_unit' => 'px',
                'fixed_range' => true,
                'default' => [
                    'field_desc_shadow',
                    [
                        'none' => '',
                        'preset1' => '0px',
                        'preset2' => '6px',
                        'preset3' => '0px',
                        'preset4' => '10px',
                        'preset5' => '0px',
                        'preset6' => '0px',
                        'preset7' => '10px',
                    ]
                ],
                'show_if_not' => ['field_desc_shadow' => 'none'],
                'toggle_slug' => 'field_desc_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['field_desc_shadow_vertical'] = [
                'type' => 'range',
                'label' => __('Shadow Vertical Position', 'pwh-dcfh'),
                'description' => __('Shadow\'s vertical distance from the element. A negative value places the shadow above the element.', 'pwh-dcfh'),
                'range_settings' => [
                    'min' => -80,
                    'max' => 80,
                    'step' => 1,
                    'min_limit' => -80,
                    'max_limit' => 80,
                ],
                'allowed_units' => et_builder_get_acceptable_css_string_values('font-size'),
                'default_unit' => 'px',
                'fixed_range' => true,
                'default' => [
                    'field_desc_shadow',
                    [
                        'none' => '',
                        'preset1' => '2px',
                        'preset2' => '6px',
                        'preset3' => '12px',
                        'preset4' => '10px',
                        'preset5' => '6px',
                        'preset6' => '0px',
                        'preset7' => '10px',
                    ]
                ],
                'show_if_not' => ['field_desc_shadow' => 'none'],
                'toggle_slug' => 'field_desc_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['field_desc_shadow_blur'] = [
                'type' => 'range',
                'label' => __('Shadow Blur Strength', 'pwh-dcfh'),
                'description' => __('The higher the value, the bigger the blur, the shadow becomes wider and lighter.', 'pwh-dcfh'),
                'range_settings' => [
                    'min' => 0,
                    'max' => 80,
                    'step' => 1,
                    'min_limit' => -80,
                    'max_limit' => 80,
                ],
                'allowed_units' => et_builder_get_acceptable_css_string_values('font-size'),
                'default_unit' => 'px',
                'fixed_range' => true,
                'default' => [
                    'field_desc_shadow',
                    [
                        'none' => '',
                        'preset1' => '18px',
                        'preset2' => '18px',
                        'preset3' => '18px',
                        'preset4' => '0px',
                        'preset5' => '0px',
                        'preset6' => '18px',
                        'preset7' => '0px',
                    ]
                ],
                'show_if_not' => ['field_desc_shadow' => 'none'],
                'toggle_slug' => 'field_desc_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['field_desc_shadow_spread'] = [
                'type' => 'range',
                'label' => __('Shadow Spread Strength', 'pwh-dcfh'),
                'description' => __('Increasing the spread strength will increase the density of the box shadow. Higher density results in a more intense shadow.', 'pwh-dcfh'),
                'range_settings' => [
                    'min' => -80,
                    'max' => 80,
                    'step' => 1,
                    'min_limit' => -80,
                    'max_limit' => 80,
                ],
                'allowed_units' => et_builder_get_acceptable_css_string_values('font-size'),
                'default_unit' => 'px',
                'fixed_range' => true,
                'default' => [
                    'field_desc_shadow',
                    [
                        'none' => '',
                        'preset1' => '0px',
                        'preset2' => '0px',
                        'preset3' => '6px',
                        'preset4' => '0px',
                        'preset5' => '10px',
                        'preset6' => '0px',
                        'preset7' => '0px',
                    ]
                ],
                'show_if_not' => ['field_desc_shadow' => 'none'],
                'toggle_slug' => 'field_desc_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['field_desc_shadow_color'] = [
                'type' => 'color-alpha',
                'label' => __('Shadow Color', 'pwh-dcfh'),
                'description' => __('The color of the shadow.', 'pwh-dcfh'),
                'default' => 'rgba(0,0,0,0.3)',
                'field_template' => 'color',
                'show_if_not' => ['field_desc_shadow' => 'none'],
                'toggle_slug' => 'field_desc_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['field_desc_shadow_position'] = [
                'type' => 'select',
                'label' => __('Shadow Position', 'pwh-dcfh'),
                'description' => __('Choose whether you would like the shadow to appear outside your module, lifting the module up from the page, or inside the module, setting the module downwards within the page.', 'pwh-dcfh'),
                'options' => [
                    '' => __('Outer Shadow', 'pwh-dcfh'),
                    'inset' => __('Inner Shadow', 'pwh-dcfh'),
                ],
                'default' => [
                    'field_desc_shadow',
                    [
                        'none' => '',
                        'preset1' => '',
                        'preset2' => '',
                        'preset3' => '',
                        'preset4' => '',
                        'preset5' => '',
                        'preset6' => 'inset',
                        'preset7' => 'inset',
                    ]
                ],
                'show_if_not' => ['field_desc_shadow' => 'none'],
                'toggle_slug' => 'field_desc_toggle',
                'tab_slug' => 'advanced',
            ];*/
            //==================================================
            // File Upload Design
            //==================================================
            $custom_fields['files_container_background'] = [
                'label' => __('Container Background Color', 'pwh-dcfh'),
                'type' => 'color-alpha',
                'description' => __('Adjust the background style by customizing the background color.', 'pwh-dcfh'),
                'custom_color' => true,
                'default' => '#eee',
                'mobile_options' => true,
                'hover' => 'tabs',
                'toggle_slug' => 'file_upload_design_toggle',
                'sub_toggle' => 'container_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['files_container_margin'] = [
                'label' => __('Container Margin', 'pwh-dcfh'),
                'type' => 'custom_margin',
                'description' => __('Margin adds extra space to the outside of the element, increasing the distance between the element and other items on the page.', 'pwh-dcfh'),
                'default' => '',
                'responsive' => true,
                'mobile_options' => true,
                'toggle_slug' => 'file_upload_design_toggle',
                'sub_toggle' => 'container_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['files_container_padding'] = [
                'label' => __('Container Padding', 'pwh-dcfh'),
                'type' => 'custom_padding',
                'description' => __('Padding adds extra space to the inside of the element, increasing the distance between the edge of the element and its inner contents.', 'pwh-dcfh'),
                'default' => '20px|20px|0px|20px',
                'advanced_fields' => true,
                'mobile_options' => true,
                'toggle_slug' => 'file_upload_design_toggle',
                'sub_toggle' => 'container_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['files_container_border'] = [
                'label' => __('Container Border Radius', 'pwh-dcfh'),
                'type' => 'border-radius',
                'description' => __('Here you can control the corner radius of this element. Enable the link icon to control all four corners at once, or disable to define custom values for each.', 'pwh-dcfh'),
                'default' => '',
                'option_category' => 'border',
                'mobile_options' => true,
                'toggle_slug' => 'file_upload_design_toggle',
                'sub_toggle' => 'container_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['files_container_border_color'] = [
                'label' => __('Container Border Color', 'pwh-dcfh'),
                'type' => 'color',
                'description' => __('Pick a color to be used for the border.', 'pwh-dcfh'),
                'custom_color' => true,
                'default' => '',
                'mobile_options' => true,
                'hover' => 'tabs',
                'toggle_slug' => 'file_upload_design_toggle',
                'sub_toggle' => 'container_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['files_container_border_width'] = [
                'label' => __('Container Border Width', 'pwh-dcfh'),
                'type' => 'range',
                'description' => __('Increasing the width of the border will increase its size/thickness.', 'pwh-dcfh'),
                'fixed_unit' => 'px',
                'validate_unit' => true,
                'fixed_range' => true,
                'range_settings' => [
                    'min' => '1',
                    'max' => '50',
                    'step' => '1',
                    'min_limit' => -80,
                    'max_limit' => 80,
                ],
                'default' => '',
                'mobile_options' => true,
                'toggle_slug' => 'file_upload_design_toggle',
                'sub_toggle' => 'container_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['files_container_border_style'] = [
                'label' => __('Container Border Style', 'pwh-dcfh'),
                'type' => 'select',
                'description' => __('Borders support various different styles, each of which will change the shape of the border element.', 'pwh-dcfh'),
                'options' => et_builder_get_border_styles(),
                'default' => 'solid',
                'mobile_options' => true,
                'toggle_slug' => 'file_upload_design_toggle',
                'sub_toggle' => 'container_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['files_container_shadow'] = [
                'label' => __('Container Shadow', 'pwh-dcfh'),
                'type' => 'select_box_shadow',
                'description' => __('Pick a box shadow style to enable box shadow for this element. Once enabled, you will be able to customize your box shadow style further. To disable custom box shadow style, choose the None option.', 'pwh-dcfh'),
                'presets' => pwh_dcfh_module_helpers()::get_shadow_presets('files_container'),
                'default' => 'none',
                'toggle_slug' => 'file_upload_design_toggle',
                'sub_toggle' => 'container_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['files_container_shadow_horizontal'] = [
                'type' => 'range',
                'label' => __('Shadow Horizontal Position', 'pwh-dcfh'),
                'description' => __('Shadow\'s horizontal distance from the element. A negative value places the shadow to the left of the element.', 'pwh-dcfh'),
                'range_settings' => [
                    'min' => -80,
                    'max' => 80,
                    'step' => 1,
                    'min_limit' => -80,
                    'max_limit' => 80,
                ],
                'allowed_units' => et_builder_get_acceptable_css_string_values('font-size'),
                'default_unit' => 'px',
                'fixed_range' => true,
                'default' => [
                    'files_container_shadow',
                    [
                        'none' => '',
                        'preset1' => '0px',
                        'preset2' => '6px',
                        'preset3' => '0px',
                        'preset4' => '10px',
                        'preset5' => '0px',
                        'preset6' => '0px',
                        'preset7' => '10px',
                    ]
                ],
                'show_if_not' => ['files_container_shadow' => 'none'],
                'toggle_slug' => 'file_upload_design_toggle',
                'sub_toggle' => 'container_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['files_container_shadow_vertical'] = [
                'type' => 'range',
                'label' => __('Shadow Vertical Position', 'pwh-dcfh'),
                'description' => __('Shadow\'s vertical distance from the element. A negative value places the shadow above the element.', 'pwh-dcfh'),
                'range_settings' => [
                    'min' => -80,
                    'max' => 80,
                    'step' => 1,
                    'min_limit' => -80,
                    'max_limit' => 80,
                ],
                'allowed_units' => et_builder_get_acceptable_css_string_values('font-size'),
                'default_unit' => 'px',
                'fixed_range' => true,
                'default' => [
                    'files_container_shadow',
                    [
                        'none' => '',
                        'preset1' => '2px',
                        'preset2' => '6px',
                        'preset3' => '12px',
                        'preset4' => '10px',
                        'preset5' => '6px',
                        'preset6' => '0px',
                        'preset7' => '10px',
                    ]
                ],
                'show_if_not' => ['files_container_shadow' => 'none'],
                'toggle_slug' => 'file_upload_design_toggle',
                'sub_toggle' => 'container_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['files_container_shadow_blur'] = [
                'type' => 'range',
                'label' => __('Shadow Blur Strength', 'pwh-dcfh'),
                'description' => __('The higher the value, the bigger the blur, the shadow becomes wider and lighter.', 'pwh-dcfh'),
                'range_settings' => [
                    'min' => 0,
                    'max' => 80,
                    'step' => 1,
                    'min_limit' => 0,
                    'max_limit' => 80,
                ],
                'allowed_units' => et_builder_get_acceptable_css_string_values('font-size'),
                'default_unit' => 'px',
                'fixed_range' => true,
                'default' => [
                    'files_container_shadow',
                    [
                        'none' => '',
                        'preset1' => '18px',
                        'preset2' => '18px',
                        'preset3' => '18px',
                        'preset4' => '0px',
                        'preset5' => '0px',
                        'preset6' => '18px',
                        'preset7' => '0px',
                    ]
                ],
                'show_if_not' => ['files_container_shadow' => 'none'],
                'toggle_slug' => 'file_upload_design_toggle',
                'sub_toggle' => 'container_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['files_container_shadow_spread'] = [
                'type' => 'range',
                'label' => __('Shadow Spread Strength', 'pwh-dcfh'),
                'description' => __('Increasing the spread strength will increase the density of the box shadow. Higher density results in a more intense shadow.', 'pwh-dcfh'),
                'range_settings' => [
                    'min' => -80,
                    'max' => 80,
                    'step' => 1,
                    'min_limit' => -80,
                    'max_limit' => 80,
                ],
                'allowed_units' => et_builder_get_acceptable_css_string_values('font-size'),
                'default_unit' => 'px',
                'fixed_range' => true,
                'default' => [
                    'files_container_shadow',
                    [
                        'none' => '',
                        'preset1' => '0px',
                        'preset2' => '0px',
                        'preset3' => '6px',
                        'preset4' => '0px',
                        'preset5' => '10px',
                        'preset6' => '0px',
                        'preset7' => '0px',
                    ]
                ],
                'show_if_not' => ['files_container_shadow' => 'none'],
                'toggle_slug' => 'file_upload_design_toggle',
                'sub_toggle' => 'container_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['files_container_shadow_color'] = [
                'type' => 'color-alpha',
                'label' => __('Shadow Color', 'pwh-dcfh'),
                'description' => __('The color of the shadow.', 'pwh-dcfh'),
                'default' => 'rgba(0,0,0,0.3)',
                'field_template' => 'color',
                'show_if_not' => ['files_container_shadow' => 'none'],
                'toggle_slug' => 'file_upload_design_toggle',
                'sub_toggle' => 'container_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['files_container_shadow_position'] = [
                'type' => 'select',
                'label' => __('Shadow Position', 'pwh-dcfh'),
                'description' => __('Choose whether you would like the shadow to appear outside your module, lifting the module up from the page, or inside the module, setting the module downwards within the page.', 'pwh-dcfh'),
                'options' => [
                    '' => __('Outer Shadow', 'pwh-dcfh'),
                    'inset' => __('Inner Shadow', 'pwh-dcfh'),
                ],
                'default' => [
                    'files_container_shadow',
                    [
                        'none' => '',
                        'preset1' => '',
                        'preset2' => '',
                        'preset3' => '',
                        'preset4' => '',
                        'preset5' => '',
                        'preset6' => 'inset',
                        'preset7' => 'inset',
                    ]
                ],
                'show_if_not' => ['files_container_shadow' => 'none'],
                'toggle_slug' => 'file_upload_design_toggle',
                'sub_toggle' => 'container_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['files_container_list_color'] = [
                'label' => __('Attached List Color', 'pwh-dcfh'),
                'type' => 'color-alpha',
                'description' => __('Adjust the color style by customizing the color color.', 'pwh-dcfh'),
                'custom_color' => true,
                'default' => '#808080',
                'mobile_options' => true,
                'hover' => 'tabs',
                'toggle_slug' => 'file_upload_design_toggle',
                'sub_toggle' => 'container_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['accepted_file_text_color'] = [
                'label' => __('Accepted File Types Text Color', 'pwh-dcfh'),
                'type' => 'color-alpha',
                'description' => __('Adjust the color style by customizing the color color.', 'pwh-dcfh'),
                'custom_color' => true,
                'default' => '#999',
                'mobile_options' => true,
                'hover' => 'tabs',
                'toggle_slug' => 'file_upload_design_toggle',
                'sub_toggle' => 'description_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['accepted_file_text_size'] = [
                'label' => __('Accepted File Types Text Size', 'pwh-dcfh'),
                'type' => 'range',
                'description' => __('Increase or decrease the size of the accepted file text.', 'pwh-dcfh'),
                'validate_unit' => true,
                'allowed_units' => et_builder_get_acceptable_css_string_values('font-size'),
                'fixed_range' => true,
                'range_settings' => [
                    'min' => '1',
                    'max' => '100',
                    'step' => '1',
                    'min_limit' => 1,
                    'max_limit' => 100,
                ],
                'default' => '',
                'mobile_options' => true,
                'toggle_slug' => 'file_upload_design_toggle',
                'sub_toggle' => 'description_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['accepted_file_text_font'] = [
                'label' => __('Accepted File Types Text', 'pwh-dcfh'),
                'type' => 'font',
                'description' => __('Choose a custom font to use for the Title. All Google web fonts are available, or you can upload your own custom font files.', 'pwh-dcfh'),
                'default' => '',
                'mobile_options' => true,
                'toggle_slug' => 'file_upload_design_toggle',
                'sub_toggle' => 'description_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['accepted_file_text_letterspace'] = [
                'label' => __('Accepted File Types Letter Spacing', 'pwh-dcfh'),
                'type' => 'range',
                'description' => __('Letter spacing adjusts the distance between each letter in the Title.', 'pwh-dcfh'),
                'fixed_unit' => 'px',
                'validate_unit' => true,
                'fixed_range' => true,
                'range_settings' => [
                    'min' => '1',
                    'max' => '100',
                    'step' => '1',
                    'min_limit' => 1,
                    'max_limit' => 100,
                ],
                'default' => '',
                'mobile_options' => true,
                'toggle_slug' => 'file_upload_design_toggle',
                'sub_toggle' => 'description_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['accepted_file_text_lineheight'] = [
                'label' => __('Accepted File Types Text Line Height', 'pwh-dcfh'),
                'type' => 'range',
                'description' => __('Line height adjusts the distance between each line of the Title text. This becomes noticeable if the Title is long and wraps onto multiple lines.', 'pwh-dcfh'),
                'fixed_unit' => 'em',
                'validate_unit' => true,
                'fixed_range' => true,
                'range_settings' => [
                    'min' => '1',
                    'max' => '3',
                    'step' => '0.1',
                    'min_limit' => 1,
                    'max_limit' => 3,
                ],
                'default' => '',
                'mobile_options' => true,
                'toggle_slug' => 'file_upload_design_toggle',
                'sub_toggle' => 'description_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['accepted_file_text_alignment'] = [
                'label' => __('Accepted File Types Alignment', 'pwh-dcfh'),
                'type' => 'align',
                'description' => __('Align the Title to the left, right, center or justify.', 'pwh-dcfh'),
                'options' => et_builder_get_text_orientation_options(['justified']),
                'advanced_fields' => true,
                'mobile_options' => true,
                'toggle_slug' => 'file_upload_design_toggle',
                'sub_toggle' => 'description_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['accepted_file_text_margin'] = [
                'label' => __('Accepted File Types Margin', 'pwh-dcfh'),
                'type' => 'custom_margin',
                'description' => __('Margin adds extra space to the outside of the element, increasing the distance between the element and other items on the page.', 'pwh-dcfh'),
                'responsive' => true,
                'mobile_options' => true,
                'toggle_slug' => 'file_upload_design_toggle',
                'sub_toggle' => 'description_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['accepted_file_text_padding'] = [
                'label' => __('Accepted File Types Padding', 'pwh-dcfh'),
                'type' => 'custom_padding',
                'description' => __('Padding adds extra space to the inside of the element, increasing the distance between the edge of the element and its inner contents.', 'pwh-dcfh'),
                'options' => et_builder_get_text_orientation_options(['justified'], ['justify' => 'Justified']),
                'default' => '10px|0|10px|0',
                'advanced_fields' => true,
                'mobile_options' => true,
                'toggle_slug' => 'file_upload_design_toggle',
                'sub_toggle' => 'description_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['chosen_file_text_color'] = [
                'label' => __('File Chosen Text Color', 'pwh-dcfh'),
                'type' => 'color-alpha',
                'description' => __('Adjust the color style by customizing the color color.', 'pwh-dcfh'),
                'custom_color' => true,
                'default' => '#999',
                'mobile_options' => true,
                'hover' => 'tabs',
                'toggle_slug' => 'file_upload_design_toggle',
                'sub_toggle' => 'description_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['chosen_file_text_size'] = [
                'label' => __('File Chosen Text Size', 'pwh-dcfh'),
                'type' => 'range',
                'description' => __('Increase or decrease the size of the accepted file text.', 'pwh-dcfh'),
                'validate_unit' => true,
                'allowed_units' => et_builder_get_acceptable_css_string_values('font-size'),
                'fixed_range' => true,
                'range_settings' => [
                    'min' => '1',
                    'max' => '100',
                    'step' => '1',
                    'min_limit' => 1,
                    'max_limit' => 100,
                ],
                'default' => '',
                'mobile_options' => true,
                'toggle_slug' => 'file_upload_design_toggle',
                'sub_toggle' => 'description_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['chosen_file_text_font'] = [
                'label' => __('File Chosen Text', 'pwh-dcfh'),
                'type' => 'font',
                'description' => __('Choose a custom font to use for the Title. All Google web fonts are available, or you can upload your own custom font files.', 'pwh-dcfh'),
                'default' => '',
                'mobile_options' => true,
                'toggle_slug' => 'file_upload_design_toggle',
                'sub_toggle' => 'description_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['chosen_file_text_letterspace'] = [
                'label' => __('File Chosen Letter Spacing', 'pwh-dcfh'),
                'type' => 'range',
                'description' => __('Letter spacing adjusts the distance between each letter in the Title.', 'pwh-dcfh'),
                'fixed_unit' => 'px',
                'validate_unit' => true,
                'fixed_range' => true,
                'range_settings' => [
                    'min' => '1',
                    'max' => '100',
                    'step' => '1',
                    'min_limit' => 1,
                    'max_limit' => 100,
                ],
                'default' => '',
                'mobile_options' => true,
                'toggle_slug' => 'file_upload_design_toggle',
                'sub_toggle' => 'description_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['chosen_file_text_lineheight'] = [
                'label' => __('File Chosen Text Line Height', 'pwh-dcfh'),
                'type' => 'range',
                'description' => __('Line height adjusts the distance between each line of the Title text. This becomes noticeable if the Title is long and wraps onto multiple lines.', 'pwh-dcfh'),
                'fixed_unit' => 'em',
                'validate_unit' => true,
                'fixed_range' => true,
                'range_settings' => [
                    'min' => '1',
                    'max' => '3',
                    'step' => '0.1',
                    'min_limit' => 1,
                    'max_limit' => 3,
                ],
                'default' => '',
                'mobile_options' => true,
                'toggle_slug' => 'file_upload_design_toggle',
                'sub_toggle' => 'description_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['file_button_font'] = [
                'label' => __('Button Text', 'pwh-dcfh'),
                'type' => 'font',
                'description' => __('Choose a custom font to use for the Title. All Google web fonts are available, or you can upload your own custom font files.', 'pwh-dcfh'),
                'default' => '',
                'mobile_options' => true,
                'toggle_slug' => 'file_upload_design_toggle',
                'sub_toggle' => 'button_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['file_button_background'] = [
                'label' => __('Button Background Color', 'pwh-dcfh'),
                'type' => 'color-alpha',
                'description' => __('Adjust the background style of this element by customizing the background color, gradient, image and video.', 'pwh-dcfh'),
                'custom_color' => true,
                'default' => '',
                'mobile_options' => true,
                'hover' => 'tabs',
                'toggle_slug' => 'file_upload_design_toggle',
                'sub_toggle' => 'button_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['file_button_color'] = [
                'label' => __('Button Text Color', 'pwh-dcfh'),
                'type' => 'color-alpha',
                'description' => __('Pick a color to be used for the Title text.', 'pwh-dcfh'),
                'custom_color' => true,
                'default' => '#2ea3f2',
                'mobile_options' => true,
                'hover' => 'tabs',
                'toggle_slug' => 'file_upload_design_toggle',
                'sub_toggle' => 'button_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['file_button_size'] = [
                'label' => __('Button Text Size', 'pwh-dcfh'),
                'type' => 'range',
                'description' => __('Increase or decrease the size of the Title text.', 'pwh-dcfh'),
                'validate_unit' => true,
                'allowed_units' => et_builder_get_acceptable_css_string_values('font-size'),
                'fixed_range' => true,
                'hover' => 'tabs',
                'range_settings' => [
                    'min' => '1',
                    'max' => '100',
                    'step' => '1',
                    'min_limit' => 1,
                    'max_limit' => 100,
                ],
                'default' => '20px',
                'mobile_options' => true,
                'toggle_slug' => 'file_upload_design_toggle',
                'sub_toggle' => 'button_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['file_button_letter_space'] = [
                'label' => __('Button Text Letter Spacing', 'pwh-dcfh'),
                'type' => 'range',
                'description' => __('Letter spacing adjusts the distance between each letter in the Title.', 'pwh-dcfh'),
                'fixed_unit' => 'px',
                'validate_unit' => true,
                'fixed_range' => true,
                'hover' => 'tabs',
                'range_settings' => [
                    'min' => '1',
                    'max' => '100',
                    'step' => '1',
                    'min_limit' => 1,
                    'max_limit' => 100,
                ],
                'default' => '',
                'mobile_options' => true,
                'toggle_slug' => 'file_upload_design_toggle',
                'sub_toggle' => 'button_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['file_button_line_height'] = [
                'label' => __('Button Text Line Height', 'pwh-dcfh'),
                'type' => 'range',
                'description' => __('Line height adjusts the distance between each line of the Title text. This becomes noticeable if the Title is long and wraps onto multiple lines.', 'pwh-dcfh'),
                'fixed_unit' => 'em',
                'validate_unit' => true,
                'fixed_range' => true,
                'hover' => 'tabs',
                'range_settings' => [
                    'min' => '1',
                    'max' => '3',
                    'step' => '0.1',
                    'min_limit' => 1,
                    'max_limit' => 3,
                ],
                'default' => '2em',
                'mobile_options' => true,
                'toggle_slug' => 'file_upload_design_toggle',
                'sub_toggle' => 'button_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['file_button_margin'] = [
                'label' => __('Button Margin', 'pwh-dcfh'),
                'type' => 'custom_margin',
                'description' => __('Margin adds extra space to the outside of the element, increasing the distance between the element and other items on the page.', 'pwh-dcfh'),
                'responsive' => true,
                'mobile_options' => true,
                'hover' => 'tabs',
                'toggle_slug' => 'file_upload_design_toggle',
                'sub_toggle' => 'button_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['file_button_padding'] = [
                'label' => __('Button Padding', 'pwh-dcfh'),
                'type' => 'custom_padding',
                'description' => __('Padding adds extra space to the inside of the element, increasing the distance between the edge of the element and its inner contents.', 'pwh-dcfh'),
                'options' => et_builder_get_text_orientation_options(['justified'], ['justify' => 'Justified']),
                'advanced_fields' => true,
                'mobile_options' => true,
                'hover' => 'tabs',
                'toggle_slug' => 'file_upload_design_toggle',
                'sub_toggle' => 'button_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['file_button_border'] = [
                'label' => __('Button Border Radius', 'pwh-dcfh'),
                'type' => 'border-radius',
                'description' => __('Here you can control the corner radius of this element. Enable the link icon to control all four corners at once, or disable to define custom values for each.', 'pwh-dcfh'),
                'default' => '3px|3px|3px|3px',
                'option_category' => 'border',
                'mobile_options' => true,
                'toggle_slug' => 'file_upload_design_toggle',
                'sub_toggle' => 'button_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['file_button_border_color'] = [
                'label' => __('Button Border Color', 'pwh-dcfh'),
                'type' => 'color',
                'description' => __('Pick a color to be used for the border.', 'pwh-dcfh'),
                'custom_color' => true,
                'default' => '#2ea3f2',
                'mobile_options' => true,
                'hover' => 'tabs',
                'toggle_slug' => 'file_upload_design_toggle',
                'sub_toggle' => 'button_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['file_button_border_width'] = [
                'label' => __('Button Border Width', 'pwh-dcfh'),
                'type' => 'range',
                'description' => __('Increasing the width of the border will increase its size/thickness.', 'pwh-dcfh'),
                'fixed_unit' => 'px',
                'validate_unit' => true,
                'fixed_range' => true,
                'range_settings' => [
                    'min' => '0',
                    'max' => '50',
                    'step' => '1',
                    'min_limit' => 0,
                    'max_limit' => 50,
                ],
                'default' => '2px',
                'mobile_options' => true,
                'hover' => 'tabs',
                'toggle_slug' => 'file_upload_design_toggle',
                'sub_toggle' => 'button_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['file_button_border_style'] = [
                'label' => __('Button Border Style', 'pwh-dcfh'),
                'type' => 'select',
                'description' => __('Borders support various different styles, each of which will change the shape of the border element.', 'pwh-dcfh'),
                'options' => et_builder_get_border_styles(),
                'default' => 'solid',
                'mobile_options' => true,
                'toggle_slug' => 'file_upload_design_toggle',
                'sub_toggle' => 'button_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['use_file_button_icon'] = [
                'label' => __('Show Button Icon', 'pwh-dcfh'),
                'description' => __('When enabled, this will add a custom icon within the button.', 'pwh-dcfh'),
                'type' => 'yes_no_button',
                'option_category' => 'configuration',
                'options' => [
                    'on' => et_builder_i18n('Yes'),
                    'off' => et_builder_i18n('No'),
                ],
                'default' => 'on',
                'toggle_slug' => 'file_upload_design_toggle',
                'sub_toggle' => 'button_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['file_button_icon'] = [
                'label' => __('Button Icon', 'pwh-dcfh'),
                'type' => 'select_icon',
                'description' => __('Choose an icon for the button.', 'pwh-dcfh'),
                'default' => '',
                'show_if' => ['use_file_button_icon' => 'on'],
                'toggle_slug' => 'file_upload_design_toggle',
                'sub_toggle' => 'button_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['file_button_icon_color'] = [
                'label' => __('Button Icon Color', 'pwh-dcfh'),
                'type' => 'color',
                'description' => __('Pick a color to be used for the icon.', 'pwh-dcfh'),
                'custom_color' => true,
                'default' => '',
                'mobile_options' => true,
                'hover' => 'tabs',
                'show_if' => ['use_file_button_icon' => 'on'],
                'toggle_slug' => 'file_upload_design_toggle',
                'sub_toggle' => 'button_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['file_button_icon_placement'] = [
                'label' => __('Button Icon Placement', 'pwh-dcfh'),
                'type' => 'select',
                'description' => __('Choose where the button icon should be displayed within the button.', 'pwh-dcfh'),
                'options' => [
                    'right' => 'Right',
                    'left' => 'Left'
                ],
                'default' => 'right',
                'mobile_options' => true,
                'show_if' => ['use_file_button_icon' => 'on'],
                'toggle_slug' => 'file_upload_design_toggle',
                'sub_toggle' => 'button_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['file_button_icon_on_hover'] = [
                'label' => __('Only Show Icon On Hover for Button', 'pwh-dcfh'),
                'description' => __('By default, button icons are displayed on hover. If you would like button icons to always be displayed, then you can enable this option.', 'pwh-dcfh'),
                'type' => 'yes_no_button',
                'default' => 'on',
                'options' => [
                    'off' => et_builder_i18n('No'),
                    'on' => et_builder_i18n('Yes'),
                ],
                'show_if' => ['use_file_button_icon' => 'on'],
                'toggle_slug' => 'file_upload_design_toggle',
                'sub_toggle' => 'button_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['file_button_shadow'] = [
                'label' => __('Button Shadow', 'pwh-dcfh'),
                'type' => 'select_box_shadow',
                'description' => __('Pick a box shadow style to enable box shadow for this element. Once enabled, you will be able to customize your box shadow style further. To disable custom box shadow style, choose the None option.', 'pwh-dcfh'),
                'presets' => pwh_dcfh_module_helpers()::get_shadow_presets('file_button'),
                'default' => 'none',
                'className' => 'et_pb_file_upload_button',
                'toggle_slug' => 'file_upload_design_toggle',
                'sub_toggle' => 'button_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['file_button_shadow_horizontal'] = [
                'type' => 'range',
                'label' => __('Shadow Horizontal Position', 'pwh-dcfh'),
                'description' => __('Shadow\'s horizontal distance from the element. A negative value places the shadow to the left of the element.', 'pwh-dcfh'),
                'range_settings' => [
                    'min' => -80,
                    'max' => 80,
                    'step' => 1,
                    'min_limit' => -80,
                    'max_limit' => 80,
                ],
                'allowed_units' => et_builder_get_acceptable_css_string_values('font-size'),
                'default_unit' => 'px',
                'fixed_range' => true,
                'default' => [
                    'file_button_shadow',
                    [
                        'none' => '',
                        'preset1' => '0px',
                        'preset2' => '6px',
                        'preset3' => '0px',
                        'preset4' => '10px',
                        'preset5' => '0px',
                        'preset6' => '0px',
                        'preset7' => '10px',
                    ]
                ],
                'show_if_not' => ['file_button_shadow' => 'none'],
                'toggle_slug' => 'file_upload_design_toggle',
                'sub_toggle' => 'button_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['file_button_shadow_vertical'] = [
                'type' => 'range',
                'label' => __('Shadow Vertical Position', 'pwh-dcfh'),
                'description' => __('Shadow\'s vertical distance from the element. A negative value places the shadow above the element.', 'pwh-dcfh'),
                'range_settings' => [
                    'min' => -80,
                    'max' => 80,
                    'step' => 1,
                    'min_limit' => -80,
                    'max_limit' => 80,
                ],
                'allowed_units' => et_builder_get_acceptable_css_string_values('font-size'),
                'default_unit' => 'px',
                'fixed_range' => true,
                'default' => [
                    'file_button_shadow',
                    [
                        'none' => '',
                        'preset1' => '2px',
                        'preset2' => '6px',
                        'preset3' => '12px',
                        'preset4' => '10px',
                        'preset5' => '6px',
                        'preset6' => '0px',
                        'preset7' => '10px',
                    ]
                ],
                'show_if_not' => ['file_button_shadow' => 'none'],
                'toggle_slug' => 'file_upload_design_toggle',
                'sub_toggle' => 'button_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['file_button_shadow_blur'] = [
                'type' => 'range',
                'label' => __('Shadow Blur Strength', 'pwh-dcfh'),
                'description' => __('The higher the value, the bigger the blur, the shadow becomes wider and lighter.', 'pwh-dcfh'),
                'range_settings' => [
                    'min' => 0,
                    'max' => 80,
                    'step' => 1,
                    'min_limit' => -80,
                    'max_limit' => 80,
                ],
                'allowed_units' => et_builder_get_acceptable_css_string_values('font-size'),
                'default_unit' => 'px',
                'fixed_range' => true,
                'default' => [
                    'file_button_shadow',
                    [
                        'none' => '',
                        'preset1' => '18px',
                        'preset2' => '18px',
                        'preset3' => '18px',
                        'preset4' => '0px',
                        'preset5' => '0px',
                        'preset6' => '18px',
                        'preset7' => '0px',
                    ]
                ],
                'show_if_not' => ['file_button_shadow' => 'none'],
                'toggle_slug' => 'file_upload_design_toggle',
                'sub_toggle' => 'button_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['file_button_shadow_spread'] = [
                'type' => 'range',
                'label' => __('Shadow Spread Strength', 'pwh-dcfh'),
                'description' => __('Increasing the spread strength will increase the density of the box shadow. Higher density results in a more intense shadow.', 'pwh-dcfh'),
                'range_settings' => [
                    'min' => -80,
                    'max' => 80,
                    'step' => 1,
                    'min_limit' => -80,
                    'max_limit' => 80,
                ],
                'allowed_units' => et_builder_get_acceptable_css_string_values('font-size'),
                'default_unit' => 'px',
                'fixed_range' => true,
                'default' => [
                    'file_button_shadow',
                    [
                        'none' => '',
                        'preset1' => '0px',
                        'preset2' => '0px',
                        'preset3' => '6px',
                        'preset4' => '0px',
                        'preset5' => '10px',
                        'preset6' => '0px',
                        'preset7' => '0px',
                    ]
                ],
                'show_if_not' => ['file_button_shadow' => 'none'],
                'toggle_slug' => 'file_upload_design_toggle',
                'sub_toggle' => 'button_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['file_button_shadow_color'] = [
                'type' => 'color-alpha',
                'label' => __('Shadow Color', 'pwh-dcfh'),
                'description' => __('The color of the shadow.', 'pwh-dcfh'),
                'default' => 'rgba(0,0,0,0.3)',
                'field_template' => 'color',
                'show_if_not' => ['file_button_shadow' => 'none'],
                'toggle_slug' => 'file_upload_design_toggle',
                'sub_toggle' => 'button_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['file_button_shadow_position'] = [
                'type' => 'select',
                'label' => __('Shadow Position', 'pwh-dcfh'),
                'description' => __('Choose whether you would like the shadow to appear outside your module, lifting the module up from the page, or inside the module, setting the module downwards within the page.', 'pwh-dcfh'),
                'options' => [
                    '' => __('Outer Shadow', 'pwh-dcfh'),
                    'inset' => __('Inner Shadow', 'pwh-dcfh'),
                ],
                'default' => [
                    'file_button_shadow',
                    [
                        'none' => '',
                        'preset1' => '',
                        'preset2' => '',
                        'preset3' => '',
                        'preset4' => '',
                        'preset5' => '',
                        'preset6' => 'inset',
                        'preset7' => 'inset',
                    ]
                ],
                'show_if_not' => ['file_button_shadow' => 'none'],
                'toggle_slug' => 'file_upload_design_toggle',
                'sub_toggle' => 'button_toggle',
                'tab_slug' => 'advanced',
            ];
            //==================================================
            // Datetime Picker Design
            //==================================================
            $custom_fields['datetimepicker_background'] = [
                'label' => __('Background Color', 'pwh-dcfh'),
                'type' => 'color-alpha',
                'description' => __('Adjust the background style by customizing the background color.', 'pwh-dcfh'),
                'custom_color' => true,
                'default' => '',
                'mobile_options' => true,
                'toggle_slug' => 'datetimepicker_design_toggle',
                'sub_toggle' => 'default_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['datetimepicker_margin'] = [
                'label' => __('Margin', 'pwh-dcfh'),
                'type' => 'custom_margin',
                'description' => __('Margin adds extra space to the outside of the element, increasing the distance between the element and other items on the page.', 'pwh-dcfh'),
                'responsive' => true,
                'mobile_options' => true,
                'toggle_slug' => 'datetimepicker_design_toggle',
                'sub_toggle' => 'default_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['datetimepicker_padding'] = [
                'label' => __('Padding', 'pwh-dcfh'),
                'type' => 'custom_padding',
                'description' => __('Padding adds extra space to the inside of the element, increasing the distance between the edge of the element and its inner contents.', 'pwh-dcfh'),
                'advanced_fields' => true,
                'mobile_options' => true,
                'toggle_slug' => 'datetimepicker_design_toggle',
                'sub_toggle' => 'default_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['datetimepicker_border'] = [
                'label' => __('Border Radius', 'pwh-dcfh'),
                'type' => 'border-radius',
                'description' => __('Here you can control the corner radius of this element. Enable the link icon to control all four corners at once, or disable to define custom values for each.', 'pwh-dcfh'),
                'default' => '',
                'option_category' => 'border',
                'mobile_options' => true,
                'toggle_slug' => 'datetimepicker_design_toggle',
                'sub_toggle' => 'default_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['datetimepicker_border_color'] = [
                'label' => __('Border Color', 'pwh-dcfh'),
                'type' => 'color',
                'description' => __('Pick a color to be used for the border.', 'pwh-dcfh'),
                'custom_color' => true,
                'default' => '',
                'mobile_options' => true,
                'toggle_slug' => 'datetimepicker_design_toggle',
                'sub_toggle' => 'default_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['datetimepicker_border_width'] = [
                'label' => __('Border Width', 'pwh-dcfh'),
                'type' => 'range',
                'description' => __('Increasing the width of the border will increase its size/thickness.', 'pwh-dcfh'),
                'fixed_unit' => 'px',
                'validate_unit' => true,
                'fixed_range' => true,
                'range_settings' => [
                    'min' => '1',
                    'max' => '50',
                    'step' => '1',
                    'min_limit' => -80,
                    'max_limit' => 80,
                ],
                'default' => '',
                'mobile_options' => true,
                'toggle_slug' => 'datetimepicker_design_toggle',
                'sub_toggle' => 'default_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['datetimepicker_border_style'] = [
                'label' => __('Border Style', 'pwh-dcfh'),
                'type' => 'select',
                'description' => __('Borders support various different styles, each of which will change the shape of the border element.', 'pwh-dcfh'),
                'options' => et_builder_get_border_styles(),
                'default' => 'solid',
                'mobile_options' => true,
                'toggle_slug' => 'datetimepicker_design_toggle',
                'sub_toggle' => 'default_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['datetimepicker_shadow'] = [
                'label' => __('Datetime Picker Shadow', 'pwh-dcfh'),
                'type' => 'select_box_shadow',
                'description' => __('Pick a box shadow style to enable box shadow for this element. Once enabled, you will be able to customize your box shadow style further. To disable custom box shadow style, choose the None option.', 'pwh-dcfh'),
                'presets' => pwh_dcfh_module_helpers()::get_shadow_presets('datetimepicker'),
                'default' => 'none',
                'toggle_slug' => 'datetimepicker_design_toggle',
                'sub_toggle' => 'default_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['datetimepicker_shadow_horizontal'] = [
                'type' => 'range',
                'label' => __('Shadow Horizontal Position', 'pwh-dcfh'),
                'description' => __('Shadow\'s horizontal distance from the element. A negative value places the shadow to the left of the element.', 'pwh-dcfh'),
                'range_settings' => [
                    'min' => -80,
                    'max' => 80,
                    'step' => 1,
                    'min_limit' => -80,
                    'max_limit' => 80,
                ],
                'allowed_units' => et_builder_get_acceptable_css_string_values('font-size'),
                'default_unit' => 'px',
                'fixed_range' => true,
                'default' => [
                    'datetimepicker_shadow',
                    [
                        'none' => '',
                        'preset1' => '0px',
                        'preset2' => '6px',
                        'preset3' => '0px',
                        'preset4' => '10px',
                        'preset5' => '0px',
                        'preset6' => '0px',
                        'preset7' => '10px',
                    ]
                ],
                'show_if_not' => ['datetimepicker_shadow' => 'none'],
                'toggle_slug' => 'datetimepicker_design_toggle',
                'sub_toggle' => 'default_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['datetimepicker_shadow_vertical'] = [
                'type' => 'range',
                'label' => __('Shadow Vertical Position', 'pwh-dcfh'),
                'description' => __('Shadow\'s vertical distance from the element. A negative value places the shadow above the element.', 'pwh-dcfh'),
                'range_settings' => [
                    'min' => -80,
                    'max' => 80,
                    'step' => 1,
                    'min_limit' => -80,
                    'max_limit' => 80,
                ],
                'allowed_units' => et_builder_get_acceptable_css_string_values('font-size'),
                'default_unit' => 'px',
                'fixed_range' => true,
                'default' => [
                    'datetimepicker_shadow',
                    [
                        'none' => '',
                        'preset1' => '2px',
                        'preset2' => '6px',
                        'preset3' => '12px',
                        'preset4' => '10px',
                        'preset5' => '6px',
                        'preset6' => '0px',
                        'preset7' => '10px',
                    ]
                ],
                'show_if_not' => ['datetimepicker_shadow' => 'none'],
                'toggle_slug' => 'datetimepicker_design_toggle',
                'sub_toggle' => 'default_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['datetimepicker_shadow_blur'] = [
                'type' => 'range',
                'label' => __('Shadow Blur Strength', 'pwh-dcfh'),
                'description' => __('The higher the value, the bigger the blur, the shadow becomes wider and lighter.', 'pwh-dcfh'),
                'range_settings' => [
                    'min' => 0,
                    'max' => 80,
                    'step' => 1,
                    'min_limit' => 0,
                    'max_limit' => 80,
                ],
                'allowed_units' => et_builder_get_acceptable_css_string_values('font-size'),
                'default_unit' => 'px',
                'fixed_range' => true,
                'default' => [
                    'datetimepicker_shadow',
                    [
                        'none' => '',
                        'preset1' => '18px',
                        'preset2' => '18px',
                        'preset3' => '18px',
                        'preset4' => '0px',
                        'preset5' => '0px',
                        'preset6' => '18px',
                        'preset7' => '0px',
                    ]
                ],
                'show_if_not' => ['datetimepicker_shadow' => 'none'],
                'toggle_slug' => 'datetimepicker_design_toggle',
                'sub_toggle' => 'default_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['datetimepicker_shadow_spread'] = [
                'type' => 'range',
                'label' => __('Shadow Spread Strength', 'pwh-dcfh'),
                'description' => __('Increasing the spread strength will increase the density of the box shadow. Higher density results in a more intense shadow.', 'pwh-dcfh'),
                'range_settings' => [
                    'min' => -80,
                    'max' => 80,
                    'step' => 1,
                    'min_limit' => -80,
                    'max_limit' => 80,
                ],
                'allowed_units' => et_builder_get_acceptable_css_string_values('font-size'),
                'default_unit' => 'px',
                'fixed_range' => true,
                'default' => [
                    'datetimepicker_shadow',
                    [
                        'none' => '',
                        'preset1' => '0px',
                        'preset2' => '0px',
                        'preset3' => '6px',
                        'preset4' => '0px',
                        'preset5' => '10px',
                        'preset6' => '0px',
                        'preset7' => '0px',
                    ]
                ],
                'show_if_not' => ['datetimepicker_shadow' => 'none'],
                'toggle_slug' => 'datetimepicker_design_toggle',
                'sub_toggle' => 'default_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['datetimepicker_shadow_color'] = [
                'type' => 'color-alpha',
                'label' => __('Shadow Color', 'pwh-dcfh'),
                'description' => __('The color of the shadow.', 'pwh-dcfh'),
                'default' => 'rgba(0,0,0,0.3)',
                'field_template' => 'color',
                'show_if_not' => ['datetimepicker_shadow' => 'none'],
                'toggle_slug' => 'datetimepicker_design_toggle',
                'sub_toggle' => 'default_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['datetimepicker_shadow_position'] = [
                'type' => 'select',
                'label' => __('Shadow Position', 'pwh-dcfh'),
                'description' => __('Choose whether you would like the shadow to appear outside your module, lifting the module up from the page, or inside the module, setting the module downwards within the page.', 'pwh-dcfh'),
                'options' => [
                    '' => __('Outer Shadow', 'pwh-dcfh'),
                    'inset' => __('Inner Shadow', 'pwh-dcfh'),
                ],
                'default' => [
                    'datetimepicker_shadow',
                    [
                        'none' => '',
                        'preset1' => '',
                        'preset2' => '',
                        'preset3' => '',
                        'preset4' => '',
                        'preset5' => '',
                        'preset6' => 'inset',
                        'preset7' => 'inset',
                    ]
                ],
                'show_if_not' => ['datetimepicker_shadow' => 'none'],
                'toggle_slug' => 'datetimepicker_design_toggle',
                'sub_toggle' => 'default_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['datepicker_width'] = [
                'label' => __('Datepicker Width', 'pwh-dcfh'),
                'description' => __('Here you can choose datepicker width.', 'pwh-dcfh'),
                'type' => 'range',
                'range_settings' => [
                    'min' => '1',
                    'max' => '1000',
                    'step' => '1',],
                'default' => '224px',
                'mobile_options' => true,
                'validate_unit' => true,
                'allowed_units' => et_builder_get_acceptable_css_string_values('font-size'),
                'toggle_slug' => 'datetimepicker_design_toggle',
                'sub_toggle' => 'date_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['datepicker_height'] = [
                'label' => __('Datepicker Height', 'pwh-dcfh'),
                'description' => __('Here you can choose datepicker height.', 'pwh-dcfh'),
                'type' => 'range',
                'range_settings' => [
                    'min' => '1',
                    'max' => '1000',
                    'step' => '1',],
                'default' => '',
                'mobile_options' => true,
                'validate_unit' => true,
                'allowed_units' => et_builder_get_acceptable_css_string_values('font-size'),
                'toggle_slug' => 'datetimepicker_design_toggle',
                'sub_toggle' => 'date_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['datepicker_yearmonth_alignment'] = [
                'label' => __('Month/Year Text Alignment', 'pwh-dcfh'),
                'type' => 'align',
                'description' => __('Align the text to the left, right, center or justify.', 'pwh-dcfh'),
                'options' => et_builder_get_text_orientation_options(['justified']),
                'advanced_fields' => true,
                'mobile_options' => true,
                'toggle_slug' => 'datetimepicker_design_toggle',
                'sub_toggle' => 'date_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['datepicker_yearmonth_text_color'] = [
                'label' => __('Month/Year Text Color', 'pwh-dcfh'),
                'type' => 'color-alpha',
                'description' => __('Pick a color to be used for the text.', 'pwh-dcfh'),
                'custom_color' => true,
                'default' => '',
                'mobile_options' => true,
                'toggle_slug' => 'datetimepicker_design_toggle',
                'sub_toggle' => 'date_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['datepicker_yearmonth_background'] = [
                'label' => __('Month/Year Background Color', 'pwh-dcfh'),
                'type' => 'color-alpha',
                'description' => __('Pick a color to be used for the background.', 'pwh-dcfh'),
                'custom_color' => true,
                'default' => '',
                'mobile_options' => true,
                'hover' => 'tabs',
                'toggle_slug' => 'datetimepicker_design_toggle',
                'sub_toggle' => 'date_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['datepicker_yearmonth_size'] = [
                'label' => __('Month/Year Text Size', 'pwh-dcfh'),
                'type' => 'range',
                'description' => __('Increase or decrease the size of the text.', 'pwh-dcfh'),
                'validate_unit' => true,
                'allowed_units' => et_builder_get_acceptable_css_string_values('font-size'),
                'fixed_range' => true,
                'range_settings' => [
                    'min' => '1',
                    'max' => '100',
                    'step' => '1',
                    'min_limit' => 1,
                    'max_limit' => 100,
                ],
                'default' => '',
                'mobile_options' => true,
                'toggle_slug' => 'datetimepicker_design_toggle',
                'sub_toggle' => 'date_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['datepicker_yearmonth_letter_space'] = [
                'label' => __('Month/Year Text Letter Spacing', 'pwh-dcfh'),
                'type' => 'range',
                'description' => __('Letter spacing adjusts the distance between each letter in the text.', 'pwh-dcfh'),
                'fixed_unit' => 'px',
                'validate_unit' => true,
                'fixed_range' => true,
                'range_settings' => [
                    'min' => '1',
                    'max' => '100',
                    'step' => '1',
                    'min_limit' => 1,
                    'max_limit' => 100,
                ],
                'default' => '',
                'mobile_options' => true,
                'toggle_slug' => 'datetimepicker_design_toggle',
                'sub_toggle' => 'date_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['datepicker_yearmonth_line_height'] = [
                'label' => __('Month/Year Text Line Height', 'pwh-dcfh'),
                'type' => 'range',
                'description' => __('Line height adjusts the distance between each line of the text. This becomes noticeable if the text is long and wraps onto multiple lines.', 'pwh-dcfh'),
                'fixed_unit' => 'em',
                'validate_unit' => true,
                'fixed_range' => true,
                'range_settings' => [
                    'min' => '1',
                    'max' => '3',
                    'step' => '0.1',
                    'min_limit' => 1,
                    'max_limit' => 3,
                ],
                'default' => '',
                'mobile_options' => true,
                'toggle_slug' => 'datetimepicker_design_toggle',
                'sub_toggle' => 'date_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['datepicker_weekdays_font'] = [
                'label' => __('Days Of Week Text', 'pwh-dcfh'),
                'type' => 'font',
                'description' => __('Choose a custom font to use for the text. All Google web fonts are available, or you can upload your own custom font files.', 'pwh-dcfh'),
                'default' => '',
                'toggle_slug' => 'datetimepicker_design_toggle',
                'sub_toggle' => 'date_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['datepicker_weekdays_alignment'] = [
                'label' => __('Days Of Week Text Alignment', 'pwh-dcfh'),
                'type' => 'align',
                'description' => __('Align the text to the left, right, center or justify.', 'pwh-dcfh'),
                'options' => et_builder_get_text_orientation_options(['justified']),
                'advanced_fields' => true,
                'mobile_options' => true,
                'toggle_slug' => 'datetimepicker_design_toggle',
                'sub_toggle' => 'date_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['datepicker_weekdays_text_color'] = [
                'label' => __('Days Of Week Text Color', 'pwh-dcfh'),
                'type' => 'color-alpha',
                'description' => __('Pick a color to be used for the text.', 'pwh-dcfh'),
                'custom_color' => true,
                'default' => '',
                'mobile_options' => true,
                'toggle_slug' => 'datetimepicker_design_toggle',
                'sub_toggle' => 'date_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['datepicker_weekdays_size'] = [
                'label' => __('Days Of Week Text Size', 'pwh-dcfh'),
                'type' => 'range',
                'description' => __('Increase or decrease the size of the text.', 'pwh-dcfh'),
                'validate_unit' => true,
                'allowed_units' => et_builder_get_acceptable_css_string_values('font-size'),
                'fixed_range' => true,
                'range_settings' => [
                    'min' => '1',
                    'max' => '100',
                    'step' => '1',
                    'min_limit' => 1,
                    'max_limit' => 100,
                ],
                'default' => '',
                'mobile_options' => true,
                'toggle_slug' => 'datetimepicker_design_toggle',
                'sub_toggle' => 'date_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['datepicker_weekdays_letter_space'] = [
                'label' => __('Days Of Week Text Letter Spacing', 'pwh-dcfh'),
                'type' => 'range',
                'description' => __('Letter spacing adjusts the distance between each letter in the text.', 'pwh-dcfh'),
                'fixed_unit' => 'px',
                'validate_unit' => true,
                'fixed_range' => true,
                'range_settings' => [
                    'min' => '1',
                    'max' => '100',
                    'step' => '1',
                    'min_limit' => 1,
                    'max_limit' => 100,
                ],
                'default' => '',
                'mobile_options' => true,
                'toggle_slug' => 'datetimepicker_design_toggle',
                'sub_toggle' => 'date_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['datepicker_weekdays_line_height'] = [
                'label' => __('Days Of Week Text Line Height', 'pwh-dcfh'),
                'type' => 'range',
                'description' => __('Line height adjusts the distance between each line of the text. This becomes noticeable if the text is long and wraps onto multiple lines.', 'pwh-dcfh'),
                'fixed_unit' => 'em',
                'validate_unit' => true,
                'fixed_range' => true,
                'range_settings' => [
                    'min' => '1',
                    'max' => '3',
                    'step' => '0.1',
                    'min_limit' => 1,
                    'max_limit' => 3,
                ],
                'default' => '',
                'mobile_options' => true,
                'toggle_slug' => 'datetimepicker_design_toggle',
                'sub_toggle' => 'date_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['datepicker_dates_font'] = [
                'label' => __('Calendar Dates Text', 'pwh-dcfh'),
                'type' => 'font',
                'description' => __('Choose a custom font to use for the text. All Google web fonts are available, or you can upload your own custom font files.', 'pwh-dcfh'),
                'default' => '',
                'toggle_slug' => 'datetimepicker_design_toggle',
                'sub_toggle' => 'date_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['datepicker_dates_alignment'] = [
                'label' => __('Calendar Dates Text Alignment', 'pwh-dcfh'),
                'type' => 'align',
                'description' => __('Align the text to the left, right, center or justify.', 'pwh-dcfh'),
                'options' => et_builder_get_text_orientation_options(['justified']),
                'advanced_fields' => true,
                'mobile_options' => true,
                'toggle_slug' => 'datetimepicker_design_toggle',
                'sub_toggle' => 'date_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['datepicker_dates_text_color'] = [
                'label' => __('Calendar Dates Text Color', 'pwh-dcfh'),
                'type' => 'color-alpha',
                'description' => __('Pick a color to be used for the text.', 'pwh-dcfh'),
                'custom_color' => true,
                'default' => '',
                'mobile_options' => true,
                'toggle_slug' => 'datetimepicker_design_toggle',
                'sub_toggle' => 'date_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['datepicker_dates_size'] = [
                'label' => __('Calendar Dates Text Size', 'pwh-dcfh'),
                'type' => 'range',
                'description' => __('Increase or decrease the size of the text.', 'pwh-dcfh'),
                'validate_unit' => true,
                'allowed_units' => et_builder_get_acceptable_css_string_values('font-size'),
                'fixed_range' => true,
                'range_settings' => [
                    'min' => '1',
                    'max' => '100',
                    'step' => '1',
                    'min_limit' => 1,
                    'max_limit' => 100,
                ],
                'default' => '',
                'mobile_options' => true,
                'toggle_slug' => 'datetimepicker_design_toggle',
                'sub_toggle' => 'date_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['datepicker_dates_letter_space'] = [
                'label' => __('Calendar Dates Text Letter Spacing', 'pwh-dcfh'),
                'type' => 'range',
                'description' => __('Letter spacing adjusts the distance between each letter in the text.', 'pwh-dcfh'),
                'fixed_unit' => 'px',
                'validate_unit' => true,
                'fixed_range' => true,
                'range_settings' => [
                    'min' => '1',
                    'max' => '100',
                    'step' => '1',
                    'min_limit' => 1,
                    'max_limit' => 100,
                ],
                'default' => '',
                'mobile_options' => true,
                'toggle_slug' => 'datetimepicker_design_toggle',
                'sub_toggle' => 'date_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['datepicker_dates_line_height'] = [
                'label' => __('Calendar Dates Text Line Height', 'pwh-dcfh'),
                'type' => 'range',
                'description' => __('Line height adjusts the distance between each line of the text. This becomes noticeable if the text is long and wraps onto multiple lines.', 'pwh-dcfh'),
                'fixed_unit' => 'em',
                'validate_unit' => true,
                'fixed_range' => true,
                'range_settings' => [
                    'min' => '1',
                    'max' => '3',
                    'step' => '0.1',
                    'min_limit' => 1,
                    'max_limit' => 3,
                ],
                'default' => '',
                'mobile_options' => true,
                'toggle_slug' => 'datetimepicker_design_toggle',
                'sub_toggle' => 'date_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['datepicker_current_date_background'] = [
                'label' => __('Current Date Background Color', 'pwh-dcfh'),
                'type' => 'color-alpha',
                'description' => __('Pick a background color to be used for the current date.', 'pwh-dcfh'),
                'custom_color' => true,
                'default' => '',
                'mobile_options' => true,
                'hover' => 'tabs',
                'toggle_slug' => 'datetimepicker_design_toggle',
                'sub_toggle' => 'date_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['datepicker_current_date_color'] = [
                'label' => __('Current Date Text Color', 'pwh-dcfh'),
                'type' => 'color-alpha',
                'description' => __('Pick a text color to be used for the current date.', 'pwh-dcfh'),
                'custom_color' => true,
                'default' => '',
                'mobile_options' => true,
                'toggle_slug' => 'datetimepicker_design_toggle',
                'sub_toggle' => 'date_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['datepicker_selected_date_background'] = [
                'label' => __('Selected Date Background Color', 'pwh-dcfh'),
                'type' => 'color-alpha',
                'description' => __('Pick a background color to be used for the selected date.', 'pwh-dcfh'),
                'custom_color' => true,
                'default' => '',
                'mobile_options' => true,
                'hover' => 'tabs',
                'toggle_slug' => 'datetimepicker_design_toggle',
                'sub_toggle' => 'date_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['datepicker_selected_date_color'] = [
                'label' => __('Selected Date Text Color', 'pwh-dcfh'),
                'type' => 'color-alpha',
                'description' => __('Pick a text color to be used for the selected date.', 'pwh-dcfh'),
                'custom_color' => true,
                'default' => '',
                'mobile_options' => true,
                'toggle_slug' => 'datetimepicker_design_toggle',
                'sub_toggle' => 'date_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['datepicker_available_dates_background'] = [
                'label' => __('Available Dates Background Color', 'pwh-dcfh'),
                'type' => 'color-alpha',
                'description' => __('Pick a background color to be used for the available dates.', 'pwh-dcfh'),
                'custom_color' => true,
                'default' => '',
                'mobile_options' => true,
                'toggle_slug' => 'datetimepicker_design_toggle',
                'sub_toggle' => 'date_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['datepicker_available_dates_text_color'] = [
                'label' => __('Available Date Text Color', 'pwh-dcfh'),
                'type' => 'color-alpha',
                'description' => __('Pick a text color to be used for the available date.', 'pwh-dcfh'),
                'custom_color' => true,
                'default' => '',
                'mobile_options' => true,
                'toggle_slug' => 'datetimepicker_design_toggle',
                'sub_toggle' => 'date_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['datepicker_unavailable_dates_background'] = [
                'label' => __('Unavailable Dates Background Color', 'pwh-dcfh'),
                'type' => 'color-alpha',
                'description' => __('Pick a background color to be used for the unavailable dates.', 'pwh-dcfh'),
                'custom_color' => true,
                'default' => '',
                'mobile_options' => true,
                'toggle_slug' => 'datetimepicker_design_toggle',
                'sub_toggle' => 'date_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['datepicker_unavailable_dates_text_color'] = [
                'label' => __('Unavailable Dates Text Color', 'pwh-dcfh'),
                'type' => 'color-alpha',
                'description' => __('Pick a text color to be used for the unavailable dates.', 'pwh-dcfh'),
                'custom_color' => true,
                'default' => '',
                'mobile_options' => true,
                'toggle_slug' => 'datetimepicker_design_toggle',
                'sub_toggle' => 'date_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['timepicker_width'] = [
                'label' => __('Timepicker Width', 'pwh-dcfh'),
                'description' => __('Here you can choose timepicker width.', 'pwh-dcfh'),
                'type' => 'range',
                'range_settings' => [
                    'min' => '1',
                    'max' => '1000',
                    'step' => '1',],
                'default' => '58px',
                'mobile_options' => true,
                'validate_unit' => true,
                'allowed_units' => et_builder_get_acceptable_css_string_values('font-size'),
                'toggle_slug' => 'datetimepicker_design_toggle',
                'sub_toggle' => 'time_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['timepicker_height'] = [
                'label' => __('Timepicker Height', 'pwh-dcfh'),
                'description' => __('Here you can choose timepicker height.', 'pwh-dcfh'),
                'type' => 'range',
                'range_settings' => [
                    'min' => '1',
                    'max' => '1000',
                    'step' => '1',],
                'default' => '151px',
                'mobile_options' => true,
                'validate_unit' => true,
                'allowed_units' => et_builder_get_acceptable_css_string_values('font-size'),
                'toggle_slug' => 'datetimepicker_design_toggle',
                'sub_toggle' => 'time_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['timepicker_time_font'] = [
                'label' => __('Time Text', 'pwh-dcfh'),
                'type' => 'font',
                'description' => __('Choose a custom font to use for the text. All Google web fonts are available, or you can upload your own custom font files.', 'pwh-dcfh'),
                'default' => '',
                'toggle_slug' => 'datetimepicker_design_toggle',
                'sub_toggle' => 'time_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['timepicker_time_alignment'] = [
                'label' => __('Time Text Alignment', 'pwh-dcfh'),
                'type' => 'align',
                'description' => __('Align the text to the left, right, center or justify.', 'pwh-dcfh'),
                'options' => et_builder_get_text_orientation_options(['justified']),
                'advanced_fields' => true,
                'mobile_options' => true,
                'toggle_slug' => 'datetimepicker_design_toggle',
                'sub_toggle' => 'time_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['timepicker_time_text_color'] = [
                'label' => __('Time Text Color', 'pwh-dcfh'),
                'type' => 'color-alpha',
                'description' => __('Pick a color to be used for the text.', 'pwh-dcfh'),
                'custom_color' => true,
                'default' => '',
                'mobile_options' => true,
                'toggle_slug' => 'datetimepicker_design_toggle',
                'sub_toggle' => 'time_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['timepicker_time_size'] = [
                'label' => __('Time Text Size', 'pwh-dcfh'),
                'type' => 'range',
                'description' => __('Increase or decrease the size of the text.', 'pwh-dcfh'),
                'validate_unit' => true,
                'allowed_units' => et_builder_get_acceptable_css_string_values('font-size'),
                'fixed_range' => true,
                'range_settings' => [
                    'min' => '1',
                    'max' => '100',
                    'step' => '1',
                ],
                'default' => '',
                'mobile_options' => true,
                'toggle_slug' => 'datetimepicker_design_toggle',
                'sub_toggle' => 'time_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['timepicker_time_letter_space'] = [
                'label' => __('Time Text Letter Spacing', 'pwh-dcfh'),
                'type' => 'range',
                'description' => __('Letter spacing adjusts the distance between each letter in the text.', 'pwh-dcfh'),
                'fixed_unit' => 'px',
                'validate_unit' => true,
                'fixed_range' => true,
                'range_settings' => [
                    'min' => '1',
                    'max' => '100',
                    'step' => '1',
                    'min_limit' => 1,
                    'max_limit' => 100,
                ],
                'default' => '',
                'mobile_options' => true,
                'toggle_slug' => 'datetimepicker_design_toggle',
                'sub_toggle' => 'time_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['timepicker_time_line_height'] = [
                'label' => __('Time Text Line Height', 'pwh-dcfh'),
                'type' => 'range',
                'description' => __('Line height adjusts the distance between each line of the text. This becomes noticeable if the text is long and wraps onto multiple lines.', 'pwh-dcfh'),
                'fixed_unit' => 'em',
                'validate_unit' => true,
                'fixed_range' => true,
                'range_settings' => [
                    'min' => '1',
                    'max' => '3',
                    'step' => '0.1',
                    'min_limit' => 1,
                    'max_limit' => 3,
                ],
                'default' => '',
                'mobile_options' => true,
                'toggle_slug' => 'datetimepicker_design_toggle',
                'sub_toggle' => 'time_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['timpicker_selected_time_background'] = [
                'label' => __('Selected Time Background Color', 'pwh-dcfh'),
                'type' => 'color-alpha',
                'description' => __('Pick a background color to be used for the current time.', 'pwh-dcfh'),
                'custom_color' => true,
                'default' => '',
                'mobile_options' => true,
                'hover' => 'tabs',
                'toggle_slug' => 'datetimepicker_design_toggle',
                'sub_toggle' => 'time_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['timpicker_selected_time_color'] = [
                'label' => __('Selected Time Text Color', 'pwh-dcfh'),
                'type' => 'color-alpha',
                'description' => __('Pick a text color to be used for the current time.', 'pwh-dcfh'),
                'custom_color' => true,
                'default' => '',
                'mobile_options' => true,
                'toggle_slug' => 'datetimepicker_design_toggle',
                'sub_toggle' => 'time_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['timpicker_available_times_background'] = [
                'label' => __('Available Times Background Color', 'pwh-dcfh'),
                'type' => 'color-alpha',
                'description' => __('Pick a background color to be used for the available times.', 'pwh-dcfh'),
                'custom_color' => true,
                'default' => '',
                'mobile_options' => true,
                'toggle_slug' => 'datetimepicker_design_toggle',
                'sub_toggle' => 'time_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['timpicker_available_times_text_color'] = [
                'label' => __('Available Times Text Color', 'pwh-dcfh'),
                'type' => 'color-alpha',
                'description' => __('Pick a text color to be used for the available times.', 'pwh-dcfh'),
                'custom_color' => true,
                'default' => '',
                'mobile_options' => true,
                'toggle_slug' => 'datetimepicker_design_toggle',
                'sub_toggle' => 'time_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['timpicker_unavailable_times_background'] = [
                'label' => __('Unavailable Times Background Color', 'pwh-dcfh'),
                'type' => 'color-alpha',
                'description' => __('Pick a background color to be used for the unavailable times.', 'pwh-dcfh'),
                'custom_color' => true,
                'default' => '',
                'mobile_options' => true,
                //'affects' => ['timpicker_unavailable_times_text_color'],
                'toggle_slug' => 'datetimepicker_design_toggle',
                'sub_toggle' => 'time_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['timpicker_unavailable_times_text_color'] = [
                'label' => __('Unavailable Times Text Color', 'pwh-dcfh'),
                'type' => 'color-alpha',
                'description' => __('Pick a text color to be used for the unavailable times.', 'pwh-dcfh'),
                'custom_color' => true,
                'default' => '',
                'mobile_options' => true,
                //'depends_show_if_not' => '',
                'toggle_slug' => 'datetimepicker_design_toggle',
                'sub_toggle' => 'time_toggle',
                'tab_slug' => 'advanced',
            ];
            //==================================================
            // Error Message
            //==================================================
            $custom_fields['contact_message_location'] = [
                'label' => __('Error Message Location', 'pwh-dcfh'),
                'type' => 'select',
                'description' => __('Choose to show the error message at the top or bottom of the form.', 'pwh-dcfh'),
                'options' => [
                    'top' => __('Top', 'pwh-dcfh'),
                    'bottom' => __('Bottom', 'pwh-dcfh'),
                ],
                'default' => 'top',
                'mobile_options' => true,
                'option_category' => 'configuration',
                'toggle_slug' => 'error_message_toggle',
            ];
            $custom_fields['errormessage_wrapper_background'] = [
                'label' => __('Container Background Color', 'pwh-dcfh'),
                'type' => 'color-alpha',
                'description' => __('Adjust the background style by customizing the background color.', 'pwh-dcfh'),
                'custom_color' => true,
                'default' => '',
                'mobile_options' => true,
                'hover' => 'tabs',
                'toggle_slug' => 'error_message_toggle',
                'sub_toggle' => 'container_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['errormessage_wrapper_margin'] = [
                'label' => __('Container Margin', 'pwh-dcfh'),
                'type' => 'custom_margin',
                'description' => __('Margin adds extra space to the outside of the element, increasing the distance between the element and other items on the page.', 'pwh-dcfh'),
                'responsive' => true,
                'mobile_options' => true,
                'toggle_slug' => 'error_message_toggle',
                'sub_toggle' => 'container_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['errormessage_wrapper_padding'] = [
                'label' => __('Container Padding', 'pwh-dcfh'),
                'type' => 'custom_padding',
                'description' => __('Padding adds extra space to the inside of the element, increasing the distance between the edge of the element and its inner contents.', 'pwh-dcfh'),
                'options' => et_builder_get_text_orientation_options(['justified'], ['justify' => 'Justified']),
                'advanced_fields' => true,
                'mobile_options' => true,
                'toggle_slug' => 'error_message_toggle',
                'sub_toggle' => 'container_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['errormessage_wrapper_border'] = [
                'label' => __('Container Border Radius', 'pwh-dcfh'),
                'type' => 'border-radius',
                'description' => __('Here you can control the corner radius of this element. Enable the link icon to control all four corners at once, or disable to define custom values for each.', 'pwh-dcfh'),
                'default' => '',
                'option_category' => 'border',
                'mobile_options' => true,
                'toggle_slug' => 'error_message_toggle',
                'sub_toggle' => 'container_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['errormessage_wrapper_border_color'] = [
                'label' => __('Container Border Color', 'pwh-dcfh'),
                'type' => 'color',
                'description' => __('Pick a color to be used for the border.', 'pwh-dcfh'),
                'custom_color' => true,
                'default' => '',
                'mobile_options' => true,
                'toggle_slug' => 'error_message_toggle',
                'sub_toggle' => 'container_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['errormessage_wrapper_border_width'] = [
                'label' => __('Container Border Width', 'pwh-dcfh'),
                'type' => 'range',
                'description' => __('Increasing the width of the border will increase its size/thickness.', 'pwh-dcfh'),
                'fixed_unit' => 'px',
                'validate_unit' => true,
                'fixed_range' => true,
                'range_settings' => [
                    'min' => '1',
                    'max' => '50',
                    'step' => '1',
                    'min_limit' => 1,
                    'max_limit' => 50,
                ],
                'default' => '',
                'mobile_options' => true,
                'toggle_slug' => 'error_message_toggle',
                'sub_toggle' => 'container_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['errormessage_wrapper_border_style'] = [
                'label' => __('Container Border Style', 'pwh-dcfh'),
                'type' => 'select',
                'description' => __('Borders support various different styles, each of which will change the shape of the border element.', 'pwh-dcfh'),
                'options' => et_builder_get_border_styles(),
                'default' => 'solid',
                'mobile_options' => true,
                'toggle_slug' => 'error_message_toggle',
                'sub_toggle' => 'container_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['errormessage_wrapper_shadow'] = [
                'label' => __('Container Shadow', 'pwh-dcfh'),
                'type' => 'select_box_shadow',
                'description' => __('Pick a box shadow style to enable box shadow for this element. Once enabled, you will be able to customize your box shadow style further. To disable custom box shadow style, choose the None option.', 'pwh-dcfh'),
                'presets' => pwh_dcfh_module_helpers()::get_shadow_presets('errormessage_wrapper'),
                'default' => 'none',
                'className' => 'et_pb_error_message',
                'toggle_slug' => 'error_message_toggle',
                'sub_toggle' => 'container_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['errormessage_wrapper_shadow_horizontal'] = [
                'type' => 'range',
                'label' => __('Shadow Horizontal Position', 'pwh-dcfh'),
                'description' => __('Shadow\'s horizontal distance from the element. A negative value places the shadow to the left of the element.', 'pwh-dcfh'),
                'range_settings' => [
                    'min' => -80,
                    'max' => 80,
                    'step' => 1,
                    'min_limit' => -80,
                    'max_limit' => 80,
                ],
                'allowed_units' => et_builder_get_acceptable_css_string_values('font-size'),
                'default_unit' => 'px',
                'fixed_range' => true,
                'default' => [
                    'errormessage_wrapper_shadow',
                    [
                        'none' => '',
                        'preset1' => '0px',
                        'preset2' => '6px',
                        'preset3' => '0px',
                        'preset4' => '10px',
                        'preset5' => '0px',
                        'preset6' => '0px',
                        'preset7' => '10px',
                    ]
                ],
                'show_if_not' => ['errormessage_wrapper_shadow' => 'none'],
                'toggle_slug' => 'error_message_toggle',
                'sub_toggle' => 'container_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['errormessage_wrapper_shadow_vertical'] = [
                'type' => 'range',
                'label' => __('Shadow Vertical Position', 'pwh-dcfh'),
                'description' => __('Shadow\'s vertical distance from the element. A negative value places the shadow above the element.', 'pwh-dcfh'),
                'range_settings' => [
                    'min' => -80,
                    'max' => 80,
                    'step' => 1,
                    'min_limit' => -80,
                    'max_limit' => 80,
                ],
                'allowed_units' => et_builder_get_acceptable_css_string_values('font-size'),
                'default_unit' => 'px',
                'fixed_range' => true,
                'default' => [
                    'errormessage_wrapper_shadow',
                    [
                        'none' => '',
                        'preset1' => '2px',
                        'preset2' => '6px',
                        'preset3' => '12px',
                        'preset4' => '10px',
                        'preset5' => '6px',
                        'preset6' => '0px',
                        'preset7' => '10px',
                    ]
                ],
                'show_if_not' => ['errormessage_wrapper_shadow' => 'none'],
                'toggle_slug' => 'error_message_toggle',
                'sub_toggle' => 'container_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['errormessage_wrapper_shadow_blur'] = [
                'type' => 'range',
                'label' => __('Shadow Blur Strength', 'pwh-dcfh'),
                'description' => __('The higher the value, the bigger the blur, the shadow becomes wider and lighter.', 'pwh-dcfh'),
                'range_settings' => [
                    'min' => 0,
                    'max' => 80,
                    'step' => 1,
                    'min_limit' => -80,
                    'max_limit' => 80,
                ],
                'allowed_units' => et_builder_get_acceptable_css_string_values('font-size'),
                'default_unit' => 'px',
                'fixed_range' => true,
                'default' => [
                    'errormessage_wrapper_shadow',
                    [
                        'none' => '',
                        'preset1' => '18px',
                        'preset2' => '18px',
                        'preset3' => '18px',
                        'preset4' => '0px',
                        'preset5' => '0px',
                        'preset6' => '18px',
                        'preset7' => '0px',
                    ]
                ],
                'show_if_not' => ['errormessage_wrapper_shadow' => 'none'],
                'toggle_slug' => 'error_message_toggle',
                'sub_toggle' => 'container_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['errormessage_wrapper_shadow_spread'] = [
                'type' => 'range',
                'label' => __('Shadow Spread Strength', 'pwh-dcfh'),
                'description' => __('Increasing the spread strength will increase the density of the box shadow. Higher density results in a more intense shadow.', 'pwh-dcfh'),
                'range_settings' => [
                    'min' => -80,
                    'max' => 80,
                    'step' => 1,
                    'min_limit' => -80,
                    'max_limit' => 80,
                ],
                'allowed_units' => et_builder_get_acceptable_css_string_values('font-size'),
                'default_unit' => 'px',
                'fixed_range' => true,
                'default' => [
                    'errormessage_wrapper_shadow',
                    [
                        'none' => '',
                        'preset1' => '0px',
                        'preset2' => '0px',
                        'preset3' => '6px',
                        'preset4' => '0px',
                        'preset5' => '10px',
                        'preset6' => '0px',
                        'preset7' => '0px',
                    ]
                ],
                'show_if_not' => ['errormessage_wrapper_shadow' => 'none'],
                'toggle_slug' => 'error_message_toggle',
                'sub_toggle' => 'container_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['errormessage_wrapper_shadow_color'] = [
                'type' => 'color-alpha',
                'label' => __('Shadow Color', 'pwh-dcfh'),
                'description' => __('The color of the shadow.', 'pwh-dcfh'),
                'default' => 'rgba(0,0,0,0.3)',
                'field_template' => 'color',
                'show_if_not' => ['errormessage_wrapper_shadow' => 'none'],
                'toggle_slug' => 'error_message_toggle',
                'sub_toggle' => 'container_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['errormessage_wrapper_shadow_position'] = [
                'type' => 'select',
                'label' => __('Shadow Position', 'pwh-dcfh'),
                'description' => __('Choose whether you would like the shadow to appear outside your module, lifting the module up from the page, or inside the module, setting the module downwards within the page.', 'pwh-dcfh'),
                'options' => [
                    '' => __('Outer Shadow', 'pwh-dcfh'),
                    'inset' => __('Inner Shadow', 'pwh-dcfh'),
                ],
                'default' => [
                    'errormessage_wrapper_shadow',
                    [
                        'none' => '',
                        'preset1' => '',
                        'preset2' => '',
                        'preset3' => '',
                        'preset4' => '',
                        'preset5' => '',
                        'preset6' => 'inset',
                        'preset7' => 'inset',
                    ]
                ],
                'show_if_not' => ['errormessage_wrapper_shadow' => 'none'],
                'toggle_slug' => 'error_message_toggle',
                'sub_toggle' => 'container_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['errormessage_fill_font'] = [
                'label' => __('Font', 'pwh-dcfh'),
                'type' => 'font',
                'description' => __('Choose a custom font to use for the warning. All Google web fonts are available, or you can upload your own custom font files.', 'pwh-dcfh'),
                'default' => '',
                'mobile_options' => true,
                'toggle_slug' => 'error_message_toggle',
                'sub_toggle' => 'fillmessage_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['errormessage_fill_fontcolor'] = [
                'label' => __('Font Color', 'pwh-dcfh'),
                'type' => 'color-alpha',
                'description' => __('Pick a color to be used for the fill message text.', 'pwh-dcfh'),
                'custom_color' => true,
                'default' => '',
                'mobile_options' => true,
                'toggle_slug' => 'error_message_toggle',
                'sub_toggle' => 'fillmessage_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['errormessage_fill_fontsize'] = [
                'label' => __('Font Size', 'pwh-dcfh'),
                'type' => 'range',
                'description' => __('Increase or decrease the size of the fill message text.', 'pwh-dcfh'),
                'fixed_unit' => 'px',
                'validate_unit' => true,
                'fixed_range' => true,
                'range_settings' => [
                    'min' => '1',
                    'max' => '100',
                    'step' => '1',
                    'min_limit' => 1,
                    'max_limit' => 100,
                ],
                'default' => '',
                'mobile_options' => true,
                'toggle_slug' => 'error_message_toggle',
                'sub_toggle' => 'fillmessage_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['errormessage_fill_letterspace'] = [
                'label' => __('Font Letter Spacing', 'pwh-dcfh'),
                'type' => 'range',
                'description' => __('Letter spacing adjusts the distance between each letter in the fill message.', 'pwh-dcfh'),
                'fixed_unit' => 'px',
                'validate_unit' => true,
                'fixed_range' => true,
                'range_settings' => [
                    'min' => '1',
                    'max' => '100',
                    'step' => '1',
                ],
                'default' => '',
                'mobile_options' => true,
                'toggle_slug' => 'error_message_toggle',
                'sub_toggle' => 'fillmessage_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['errormessage_fill_lineheight'] = [
                'label' => __('Font Line Height', 'pwh-dcfh'),
                'type' => 'range',
                'description' => __('Line height adjusts the distance between each line of the fill message text. This becomes noticeable if the fill message is long and wraps onto multiple lines.', 'pwh-dcfh'),
                'fixed_unit' => 'em',
                'validate_unit' => true,
                'fixed_range' => true,
                'range_settings' => [
                    'min' => '1',
                    'max' => '3',
                    'step' => '0.1',
                    'min_limit' => 1,
                    'max_limit' => 3,
                ],
                'default' => '',
                'mobile_options' => true,
                'toggle_slug' => 'error_message_toggle',
                'sub_toggle' => 'fillmessage_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['errormessage_fill_alignment'] = [
                'label' => __('Font Alignment', 'pwh-dcfh'),
                'type' => 'text_align',
                'description' => __('Align the fill message to the left, right, center or justify.', 'pwh-dcfh'),
                'options' => et_builder_get_text_orientation_options(['justified']),
                'advanced_fields' => true,
                'mobile_options' => true,
                'toggle_slug' => 'error_message_toggle',
                'sub_toggle' => 'fillmessage_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['errormessage_errors_font'] = [
                'label' => __('Font', 'pwh-dcfh'),
                'type' => 'font',
                'description' => __('Choose a custom font to use for the warning. All Google web fonts are available, or you can upload your own custom font files.', 'pwh-dcfh'),
                'default' => '',
                'mobile_options' => true,
                'toggle_slug' => 'error_message_toggle',
                'sub_toggle' => 'error_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['errormessage_errors_fontcolor'] = [
                'label' => __('Font Color', 'pwh-dcfh'),
                'type' => 'color-alpha',
                'description' => __('Pick a color to be used for the fill message text.', 'pwh-dcfh'),
                'custom_color' => true,
                'default' => '',
                'mobile_options' => true,
                'toggle_slug' => 'error_message_toggle',
                'sub_toggle' => 'error_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['errormessage_errors_fontsize'] = [
                'label' => __('Font Size', 'pwh-dcfh'),
                'type' => 'range',
                'description' => __('Increase or decrease the size of the fill message text.', 'pwh-dcfh'),
                'fixed_unit' => 'px',
                'validate_unit' => true,
                'fixed_range' => true,
                'range_settings' => [
                    'min' => '1',
                    'max' => '100',
                    'step' => '1',
                    'min_limit' => 1,
                    'max_limit' => 100,
                ],
                'default' => '',
                'mobile_options' => true,
                'toggle_slug' => 'error_message_toggle',
                'sub_toggle' => 'error_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['errormessage_errors_letterspace'] = [
                'label' => __('Font Letter Spacing', 'pwh-dcfh'),
                'type' => 'range',
                'description' => __('Letter spacing adjusts the distance between each letter in the fill message.', 'pwh-dcfh'),
                'fixed_unit' => 'px',
                'validate_unit' => true,
                'fixed_range' => true,
                'range_settings' => [
                    'min' => '1',
                    'max' => '100',
                    'step' => '1',
                ],
                'default' => '',
                'mobile_options' => true,
                'toggle_slug' => 'error_message_toggle',
                'sub_toggle' => 'error_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['errormessage_errors_lineheight'] = [
                'label' => __('Font Line Height', 'pwh-dcfh'),
                'type' => 'range',
                'description' => __('Line height adjusts the distance between each line of the fill message text. This becomes noticeable if the fill message is long and wraps onto multiple lines.', 'pwh-dcfh'),
                'fixed_unit' => 'em',
                'validate_unit' => true,
                'fixed_range' => true,
                'range_settings' => [
                    'min' => '1',
                    'max' => '3',
                    'step' => '0.1',
                    'min_limit' => 1,
                    'max_limit' => 3,
                ],
                'default' => '',
                'mobile_options' => true,
                'toggle_slug' => 'error_message_toggle',
                'sub_toggle' => 'error_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['errormessage_errors_alignment'] = [
                'label' => __('Font Alignment', 'pwh-dcfh'),
                'type' => 'text_align',
                'description' => __('Align the fill message to the left, right, center or justify.', 'pwh-dcfh'),
                'options' => et_builder_get_text_orientation_options(['justified']),
                'advanced_fields' => true,
                'mobile_options' => true,
                'toggle_slug' => 'error_message_toggle',
                'sub_toggle' => 'error_toggle',
                'tab_slug' => 'advanced',
            ];
            //==================================================
            // Spam Protection
            //==================================================
            $custom_fields['use_honeypot'] = [
                'label' => __('Use Honeypot', 'pwh-dcfh'),
                'type' => 'yes_no_button',
                'description' => __('Add an invisible honeypot field to prevent bots from completing the form.', 'pwh-dcfh'),
                'options' => [
                    'on' => et_builder_i18n('Yes'),
                    'off' => et_builder_i18n('No'),
                ],
                'default' => 'off',
                'option_category' => 'configuration',
                'toggle_slug' => 'spam',
            ];
            $custom_fields['use_googlerecaptcha_v2'] = [
                'label' => __('Use Google reCAPTCHA V2', 'pwh-dcfh'),
                'type' => 'yes_no_button',
                'description' => __('Choose to enable the Google reCAPTCHA V2 spam prevention service for this contact form. Be sure to add the Google reCAPTCHA Site Key and Secret Key in the Theme Options settings first.', 'pwh-dcfh'),// TODO ADD IT
                'options' => [
                    'on' => et_builder_i18n('Yes'),
                    'off' => et_builder_i18n('No'),
                ],
                'default' => 'off',
                'option_category' => 'configuration',
                'toggle_slug' => 'spam',
            ];
            $custom_fields['use_cloudflare_turnstile'] = [
                'label' => __('Use Cloudflare Turnstile', 'pwh-dcfh'),
                'type' => 'yes_no_button',
                'description' => __('Choose to enable the Cloudflare Turnstile spam prevention service for this contact form. Be sure to add the Cloudflare Site Key and Secret Key in the Theme Options settings first.', 'pwh-dcfh'),
                'options' => [
                    'on' => et_builder_i18n('Yes'),
                    'off' => et_builder_i18n('No'),
                ],
                'default' => 'off',
                'option_category' => 'configuration',
                'toggle_slug' => 'spam',
            ];

            return wp_parse_args($custom_fields, $fields_unprocessed);
        }

        /**
         * Filter Form Props
         *
         * @param $props
         * @param $attrs
         * @param $render_slug
         * @param $_address
         * @param $content
         *
         * @return mixed
         */
        public function maybe_filter_shortcode_attributes($props, $attrs, $render_slug, $_address, $content)
        {
            // Return If Frontend Builder
            if (function_exists('et_fb_is_enabled') && et_fb_is_enabled()) {
                return $props;
            }
            // Return If Backend Builder
            if (function_exists('et_builder_bfb_enabled') && et_builder_bfb_enabled()) {
                return $props;
            }
            // Return If Admin/Ajax
            if (is_admin() || wp_doing_ajax()) {
                return $props;
            }
            // Return If Not Slug Match
            if ('et_pb_contact_form' !== $render_slug) {
                return $props;
            }
            $this->props = $props;
            $post_repository = PWH_DCFH_Post_Repository::instance();
            $email_handler = PWH_DCFH_Email_Handler::instance();
            $_unique_id = !empty($props['_unique_id']) ? $props['_unique_id'] : '';
            $admin_label = !empty($props['admin_label']) ? $props['admin_label'] : '';
            $entries_threshold = !empty($props['entries_threshold']) ? (int)$props['entries_threshold'] : '-1';
            $title = !empty($props['title']) ? $props['title'] : $_unique_id;
            $contact_form_title = !empty($admin_label) ? $admin_label : $title;
            $post_repository->contact_form_id = $_unique_id;
            $contact_form_id = $_unique_id;
            $post_repository->contact_form_title = $contact_form_title;
            $post_repository->is_threshold_reached = false;
            $post_repository->save_entry_to_db = false;
            $post_repository->save_files_to_db = false;
            $post_repository->save_files_to_media = false;
            $post_repository->send_files_as_attachment = false;
            $post_repository->collect_ip_useragent_details = false;
            $post_repository->save_queryparams_to_db = false;
            $post_repository->is_zapier_enabled = false;
            $post_repository->is_pabbly_enabled = false;
            $post_repository->is_custom_message_richtext = false;
            $post_repository->is_admin_email_enabled = false;
            $post_repository->is_admin_email_from_submitter_email = false;
            $post_repository->is_googlerecaptcha_v2_enabled = false;
            $post_repository->is_cloudflare_turnstile_enabled = false;
            $this->is_threshold_reached = false;
            /**
             * Check if the entry threshold feature is enabled and active.
             * If enabled, compare the total entries of the contact form with the specified threshold.
             * If the threshold is reached, set the 'is_threshold_reached'
             * flag to true for both the post-repository and the current instance.
             * Return the updated properties array.
             */
            if (isset($props['entries_threshold_enabled']) && 'on' === $props['entries_threshold_enabled']) {
                $contact_form_entries = pwh_dcfh_db()::get_contact_form_total_entries($contact_form_id);
                if ('-1' !== $entries_threshold && $entries_threshold === $contact_form_entries) {
                    $post_repository->is_threshold_reached = true;
                    $this->is_threshold_reached = true;

                    return $props;
                }
            }
            if (!empty($_unique_id)) {
                // Update Contact Form Details
                pwh_dcfh_db()::update_contact_form_details($_unique_id, ['title' => $contact_form_title, 'threshold' => $entries_threshold]);
                // Save Submission
                $save_entries_to_db = $props['save_entries_to_db'] ?? 'on';
                if ('on' === $save_entries_to_db) {
                    $post_repository->save_entry_to_db = true;
                }
                // Save Files To Database
                if ('on' === $save_entries_to_db && isset($props['save_files_to_db']) && 'on' === $props['save_files_to_db']) {
                    $post_repository->save_files_to_db = true;
                }
                // Save Files To Media Library
                if ('on' === $save_entries_to_db && isset($props['save_files_to_media']) && 'on' === $props['save_files_to_media']) {
                    $post_repository->save_files_to_media = true;
                }
                // Save Query Params
                if (isset($props['save_queryparams_to_db']) && 'on' === $props['save_queryparams_to_db']) {
                    $post_repository->save_queryparams_to_db = true;
                }
            }
            // Send Files To Email
            if (isset($props['send_files_as_attachment']) && 'on' === $props['send_files_as_attachment']) {
                $post_repository->send_files_as_attachment = true;
                $post_repository->attached_files_message = !empty($props['attached_files_message']) ? $props['attached_files_message'] : '';
            }
            // Collect User Agent Details
            if (isset($props['collect_ip_useragent_details']) && 'on' === $props['collect_ip_useragent_details']) {
                $post_repository->collect_ip_useragent_details = true;
            }
            // Admin Email
            if (isset($props['use_send_admin_email']) && 'on' === $props['use_send_admin_email']) {
                $post_repository->is_admin_email_enabled = true;
                $post_repository->module_admin_email = !empty($props['email']) ? sanitize_email($props['email']) : null;
                // Admin Subject
                $post_repository->admin_email_subject = $props['admin_email_subject'] ?? null;
                // Admin Email From Name
                $post_repository->admin_email_from_name = $props['admin_email_from_name'] ?? null;
                // Admin Conditional Emails
                $conditional_email_pattern = $props['conditional_email_pattern'] ?? '';
                if (isset($props['use_conditional_emails']) && 'on' === $props['use_conditional_emails']) {
                    $email_handler->set_admin_emails_routing($conditional_email_pattern);
                }
                // Admin Formatted Message
                $custom_message_richtext = $props['custom_message_richtext'] ?? '';
                if (isset($props['use_custom_message_richtext']) && 'on' === $props['use_custom_message_richtext'] && !empty($custom_message_richtext)) {
                    $post_repository->is_custom_message_richtext = true;
                    $custom_message_richtext = force_balance_tags(do_shortcode($custom_message_richtext));
                    $custom_message_richtext = html_entity_decode($custom_message_richtext, ENT_QUOTES, 'utf-8');
                    // $custom_message_richtext = nl2br($custom_message_richtext);
                    $custom_message_richtext = str_replace(['<p>', '</p>'], ['', "<br>"], $custom_message_richtext);
                    $props['custom_message'] = $custom_message_richtext;
                }
                // Admin Email CC
                $post_repository->admin_email_cc = $props['admin_email_cc'] ?? null;
                // Admin Email Bcc
                $post_repository->admin_email_bcc = $props['admin_email_bcc'] ?? null;
                // Admin Email From Submitter Email
                $post_repository->is_admin_email_from_submitter_email = (isset($props['use_admin_email_submitter_email']) && 'on' === $props['use_admin_email_submitter_email']);
            }
            // Confirmation Email
            $confirmation_request = PWH_DCFH_Confirmation_Email_Request::instance();
            $confirmation_request->is_confirmation_email_enabled = false;
            if (isset($props['use_confirmation_email']) && 'on' === $props['use_confirmation_email']) {
                $confirmation_request->is_confirmation_email_enabled = true;
                $confirmation_request->is_confirmation_message_richtext = false;
                $confirmation_email_field_id = $props['confirmation_email_field_id'] ?? null;
                $confirmation_email_subject = $props['confirmation_email_subject'] ?? null;
                $confirmation_email_from = $props['confirmation_email_from'] ?? null;
                $confirmation_email_from_name = $props['confirmation_email_from_name'] ?? null;
                $confirmation_email_message = $props['confirmation_email_message'] ?? null;
                $use_confirmation_message_richtext = $props['use_confirmation_message_richtext'] ?? 'off';
                $confirmation_message_richtext = $props['confirmation_message_richtext'] ?? null;
                // Check is Rich Text Editor
                if ('on' === $use_confirmation_message_richtext && !empty($confirmation_message_richtext)) {
                    $confirmation_request->is_confirmation_message_richtext = true;
                    $confirmation_email_message = $confirmation_message_richtext;
                }
                $confirmation_request->confirmation_email_field_id = $confirmation_email_field_id;
                $confirmation_request->confirmation_email_subject = $confirmation_email_subject;
                $confirmation_request->confirmation_email_from = $confirmation_email_from;
                $confirmation_request->confirmation_email_from_name = $confirmation_email_from_name;
                $confirmation_request->confirmation_email_message = $confirmation_email_message;
            }
            // Zapier Mailbox
            $zapier_mailbox_address = $props['zapier_mailbox_address'] ?? null;
            if (isset($props['use_zapier']) && 'on' === $props['use_zapier'] && !empty($zapier_mailbox_address)) {
                $post_repository->is_zapier_enabled = true;
                $post_repository->zapier_mailbox_address = $zapier_mailbox_address;
            }
            // Pabbly Mailbox
            $pabbly_mailbox_address = $props['pabbly_mailbox_address'] ?? null;
            if (isset($props['use_pabbly']) && 'on' === $props['use_pabbly'] && !empty($pabbly_mailbox_address)) {
                $post_repository->is_pabbly_enabled = true;
                $post_repository->pabbly_mailbox_address = $pabbly_mailbox_address;
            }
            // Add Redirect Settings To New Settings
            if (isset($props['use_redirect']) && 'on' === $props['use_redirect'] && !empty($props['redirect_url'])) {
                $props['custom_use_redirect'] = 'on';
            }
            if (!empty($props['redirect_url'])) {
                $props['custom_redirect_url'] = $props['redirect_url'];
                $props['redirect_url'] = '';
            }
            // Add Redirect Settings To New Settings
            if (!empty($props['api_endpoint_url']) && filter_var($props['api_endpoint_url'], FILTER_VALIDATE_URL)) {
                $post_repository->post_payload_endpoint = $props['api_endpoint_url'];
            }
            // Google reCAPTCHA V2
            if (isset($props['use_googlerecaptcha_v2']) && 'on' === $props['use_googlerecaptcha_v2']) {
                $post_repository->is_googlerecaptcha_v2_enabled = true;
                wp_enqueue_script('divi-contact-form-helper-google-recaptcha-v2');
            }
            // Cloudflare Turnstile
            if (isset($props['use_cloudflare_turnstile']) && 'on' === $props['use_cloudflare_turnstile']) {
                $post_repository->is_cloudflare_turnstile_enabled = true;
                wp_enqueue_script('divi-contact-form-helper-cloudflare-turnstile');
            }

            return $props;
        }

        /**
         * Filter Form HTML Output
         *
         * @param $output
         * @param $render_slug
         * @param $module
         *
         * @throws @import DOMException
         * @return array|false|mixed|string|string[]|null
         */
        public function maybe_filter_shortcode_output($output, $render_slug, $module)
        {
            // Return If Frontend Builder
            if (function_exists('et_fb_is_enabled') && et_fb_is_enabled()) {
                return $output;
            }
            // Return If Backend Builder
            if (function_exists('et_builder_bfb_enabled') && et_builder_bfb_enabled()) {
                return $output;
            }
            // Return If Admin/Ajax and Output Array/Empty
            if (is_admin() || wp_doing_ajax() || is_array($output) || empty($output)) {
                return $output;
            }
            // Return If Not Slug Match
            if ('et_pb_contact_form' !== $render_slug) {
                return $output;
            }
            global $et_pb_contact_form_num;
            $props = $module->props;
            $this->contact_form_num = $et_pb_contact_form_num;
            $contact_form_order_class = ET_Builder_Element::get_module_order_class($render_slug);
            $contact_form_index = $et_pb_contact_form_num;
            $post_request = new PWH_DCFH_Post_Request(false);
            $misc_obj = new PWH_DCFH_Modify_Form($render_slug, $output, $props);
            $misc_obj->contact_form_order_class = $contact_form_order_class;
            $misc_obj->contact_form_index = $contact_form_index;
            // Update Form Container DOM
            $output = $misc_obj->filter_form_container_dom();
            if ($this->is_threshold_reached) {
                return $output;
            }
            // Update Form DOM
            $output = $misc_obj->filter_form_dom();
            // Submit Wait Text
            if (!empty($props['submit_button_wait_text'])) {
                $submit_btn_obj = new PWH_DCFH_Submit_Button($render_slug, $output, $props);
                $output = $submit_btn_obj->add_wait_text_attr();
            }
            // Submit Button
            if (isset($props['custom_button']) && 'on' === $props['custom_button']) {
                $submit_btn_obj = new PWH_DCFH_Submit_Button($render_slug, $output, $props);
                $submit_btn_obj->css();
            }
            // File Upload
            if (str_contains($output, "et_pb_files_container")) {
                $field_upload_obj = new PWH_DCFH_Field_File_Upload($render_slug, $output, $props);
                $field_upload_obj->css();
            }
            // Datetime Picker
            if (str_contains($output, "et_pb_datetimepicker_input")) {
                $field_datetime_obj = new PWH_DCFH_Field_Date_Time($render_slug, $output, $props);
                $field_datetime_obj->contact_form_order_class = $contact_form_order_class;
                $field_datetime_obj->css();
                wp_enqueue_style('divi-contact-form-helper-datetimepicker');
                wp_enqueue_script('divi-contact-form-helper-datetimepicker');
            }
            // Select2
            if (str_contains($output, "et_pb_contact_select2")) {
                wp_enqueue_style('divi-contact-form-helper-select2');
                wp_enqueue_script('divi-contact-form-helper-select2');
                $field_select_obj = new PWH_DCFH_Field_Select($render_slug, $output, $props);
                $field_select_obj->css();
            }
            // Signature Pad
            if (str_contains($output, "et_pb_signature_pad_container")) {
                wp_enqueue_script('divi-contact-form-helper-signature-pad');
            }
            // Phone Mask Scripts
            if (str_contains($output, "et_pb_phone_format")) {
                wp_enqueue_script('divi-contact-form-helper-inputmask');
            }
            // Hide Form Title
            if ((isset($props['hide_form_title']) && 'on' === $props['hide_form_title']) && $post_request->is_contact_form_processed()) {
                $output = preg_replace('/\bet_pb_contact_main_title\b/', 'et_pb_d_none', $output);
            }
            // Error Message
            $error_message_obj = new PWH_DCFH_Error_Message($render_slug, $output, $props);
            $error_message_obj->contact_form_order_class = $contact_form_order_class;
            $error_message_obj->css();
            $output = $error_message_obj->output();
            // Success Message
            $hide_success_message = $props['hide_success_message'] ?? 'off';
            if ('on' === $hide_success_message && $post_request->is_contact_form_processed()) {
                $output = preg_replace('/\bet-pb-contact-message\b/', 'et_pb_d_none', $output);
            }
            if ('off' === $hide_success_message) {
                $success_message_obj = new PWH_DCFH_Success_Message($render_slug, $output, $props);
                $success_message_obj->css();
                if ($post_request->is_contact_form_processed()) {
                    $output = $success_message_obj->output();
                }
            }
            // Success Button
            if (isset($props['use_success_button']) && 'on' === $props['use_success_button']) {
                $success_btn_obj = new PWH_DCFH_Success_Button($render_slug, $output, $props, $contact_form_order_class);
                $success_btn_obj->css();
                if ($post_request->is_contact_form_processed()) {
                    $output = $success_btn_obj->output();
                }
            }
            // Field Focus Design Css
            $field_layout_obj = new PWH_DCFH_Field_Layout($render_slug, $output, $props);
            $field_layout_obj->field_focus_css();
            $field_layout_obj->field_label_css();
            $field_layout_obj->field_desc_css();

            return do_shortcode($output);
        }

        /**
         * Filter Custom Dynamic Fields
         *
         * @param $custom_fields
         * @param $post_id
         * @param $raw_custom_fields
         *
         * @return mixed
         */
        public function maybe_custom_dynamic_content_fields($custom_fields, $post_id, $raw_custom_fields)
        {
            // Return If Not Logged In
            if (!is_user_logged_in()) {
                return $custom_fields;
            }
            /*static $is_queried = false;
            if ($is_queried) {
                return $custom_fields;
            }*/
            global $wpdb;
            $options = $wpdb->get_results($wpdb->prepare("SELECT * FROM $wpdb->options WHERE option_name LIKE %s ", '%'.'_pwh_dcfh_email_tpl_'.'%'));//db call ok no-cache ok
            if (!empty($options)) {
                foreach ($options as $option) {
                    $option_value = $option->option_value;
                    if (is_serialized($option_value)) {
                        $data = maybe_unserialize($option_value);
                        $data = (object)$data;
                        if (!empty($data) && is_object($data) && (isset($data->tpl_type) && in_array($data->tpl_type, ['general', 'admin', 'confirmation']))) {
                            $tpl_id = $option->option_name;
                            $tpl_name = $data->tpl_name;
                            $custom_fields["pwh_dcfh_email_template$tpl_id"] = [
                                'label' => $tpl_name,
                                'type' => 'any',
                                'fields' => [
                                    'before' => [
                                        'label' => $tpl_name,
                                        'type' => 'text',
                                        'default' => "[pwh_dcfh_email_template tpl_id='$tpl_id']",
                                        'value' => "[pwh_dcfh_email_template tpl_id='$tpl_id']",
                                        'show_on' => 'text',
                                    ],
                                ],
                                'meta_key' => "pwh_dcfh_email_template_meta_key$tpl_id", // phpcs:ignore
                                'group' => __('Email Templates - Divi Contact Form Helper', 'pwh-dcfh'),
                            ];
                        }
                    }
                }
            }

            // $is_queried = true;
            return $custom_fields;
        }

        /**
         * Add Scripts
         * @return void
         */
        public function maybe_add_scripts()
        {
            $custom_js_code = !empty($this->props['custom_js_code']) ? trim(html_entity_decode(wp_strip_all_tags($this->props['custom_js_code']))) : '';
            if (!empty($custom_js_code)) { ?>
                <script type="text/javascript" id="divi-contact-form-helper-inline-js-<?php echo esc_attr($this->contact_form_num); ?>">
                    let dynamicCustomJSCode = `<?php echo $custom_js_code; // phpcs:ignore  ?>`;
                </script>
                <?php
            }
        }

        /**
         * Add Email Template Shortcode
         *
         * @param $atts
         *
         * @return mixed|string
         */
        public function maybe_add_email_template_shortcode($atts)
        {
            $atts = shortcode_atts(['tpl_id' => ''], $atts, 'pwh_dcfh_email_template');
            $tpl_id = $atts['tpl_id'];
            if (!empty($tpl_id)) {
                $option = get_option($tpl_id);
                if (!empty($option['email_body'])) {
                    return $option['email_body'];
                }
            }

            return '';
        }

        /**
         * Add Custom Mime Types
         *
         * @param $t
         *
         * @return mixed
         */
        public function maybe_add_custom_mimetypes($t)
        {
            $custom_mimes_types = pwh_dcfh_db()::get_setting('pwh_dcfh_custom_mimes_types', 'psd|image/vnd.adobe.photoshop,rar|application/x-rar');
            if (!empty($custom_mimes_types) && is_string($custom_mimes_types)) {
                $custom_mimes_types = preg_replace('/\s*,\s*/', ',', $custom_mimes_types);
                $mimestypes_arr = explode(',', $custom_mimes_types);
                if (!empty($mimestypes_arr)) {
                    foreach ($mimestypes_arr as $val) {
                        $mimetype = explode('|', $val);
                        if (isset($mimetype[0], $mimetype[1])) {
                            $t[$mimetype[0]] = $mimetype[1];
                        }
                    }
                }
            }

            return $t;
        }

        /**
         * Fixes the issue in WordPress 4.7.1 being unable to correctly identify a type
         *
         * @param $file
         * @param $tmp_file
         * @param $filename
         * @param $mimes
         *
         * @return array|mixed|null
         */
        public function maybe_fix_mime_type_ext($file, $tmp_file, $filename, $mimes)
        {
            if (isset($file['ext']) && empty($file['ext'])) {
                $file_ext = strtolower(pathinfo($filename, PATHINFO_EXTENSION));
                $custom_mimes_types = pwh_dcfh_db()::get_setting('pwh_dcfh_custom_mimes_types', 'psd|image/vnd.adobe.photoshop,rar|application/x-rar');
                if (!empty($custom_mimes_types) && is_string($custom_mimes_types)) {
                    $custom_mimes_types = preg_replace('/\s*,\s*/', ',', $custom_mimes_types);
                    $mimestypes_arr = explode(',', $custom_mimes_types);
                    if (!empty($mimestypes_arr)) {
                        foreach ($mimestypes_arr as $val) {
                            $mimetype = explode('|', $val);
                            if (isset($mimetype[0], $mimetype[1]) && $mimetype[0] === $file_ext) {
                                $file['ext'] = $mimetype[0];
                                $file['type'] = $mimetype[1];
                            }
                        }
                    }
                }
            }

            return $file;
        }

        /**
         * Add Tiny MCE Buttons
         *
         * @param $buttons
         *
         * @return mixed
         */
        public function maybe_add_tinymc_buttons($buttons)
        {
            $buttons[] = 'hr';

            return $buttons;
        }

        /**
         * Filter CSS Selector
         *
         * @param $selector
         *
         * @return array|mixed|string|string[]
         */
        public function maybe_filter_css_selector($selector)
        {
            $original_selector = 'body #page-container .et_pb_section %%order_class%%.et_pb_contact_form_container.et_pb_module .et_pb_button';
            if (str_contains($selector, $original_selector)) {
                $selector = str_replace(
                    $original_selector,
                    'body #page-container .et_pb_section %%order_class%%.et_pb_contact_form_container.et_pb_module .et_pb_button:not(.et_pb_file_upload_button)',
                    $selector
                );
            }

            return $selector;
        }
    }
}