<?php

namespace PWH_DCFH\App\Frontend\DiviContactForm;

use DOMException;
use ET_Builder_Element;
use PWH_DCFH\App\Frontend\DiviContactForm\Features\PWH_DCFH_Field_Layout;
use PWH_DCFH\App\Frontend\DiviContactForm\Features\PWH_DCFH_Field_File_Upload;
use PWH_DCFH\App\Frontend\DiviContactForm\Features\PWH_DCFH_Field_Date_Time;
use PWH_DCFH\App\Frontend\DiviContactForm\Features\PWH_DCFH_Field_Textarea_Validation;
use PWH_DCFH\App\Frontend\DiviContactForm\Features\PWH_DCFH_Field_Select;
use PWH_DCFH\App\Frontend\DiviContactForm\Features\PWH_DCFH_Field_HTML;
use PWH_DCFH\App\Frontend\DiviContactForm\Features\PWH_DCFH_Modify_Misc_Field;
use PWH_DCFH\App\Frontend\DiviContactForm\Features\PWH_DCFH_Signature_Pad;
use PWH_DCFH\App\Frontend\DiviContactForm\Features\PWH_DCFH_Star_Rating;

if (!defined('ABSPATH')) {
    exit;
}
if (!class_exists('PWH_DCFH_Filter_Contact_Form_Fields')) {
    class PWH_DCFH_Filter_Contact_Form_Fields
    {
        /**
         * Initializer Of The Class
         * Add/Remove Necessary Actions/Filters
         */
        public function init()
        {
            add_filter('et_builder_get_child_modules', [$this, 'maybe_add_toggles'], 10, 2);
            add_filter('et_pb_all_fields_unprocessed_et_pb_contact_field', [$this, 'maybe_add_fields']);
            add_filter('et_module_shortcode_output', [$this, 'maybe_filter_shortcode_output'], 10, 3);
        }

        /**
         * Add Custom Toggles
         *
         * @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_field' === $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;
                    // General Toggles
                    if (isset($settings_modal_toggles['general']) && !empty($settings_modal_toggles['general']['toggles'])) {
                        $settings_modal_toggles['general']['toggles']['fileupload_settings'] = [
                            'title' => __('File Upload Settings', 'pwh-dcfh'),
                            'priority' => 15,
                        ];
                        $settings_modal_toggles['general']['toggles']['datetime_settings'] = [
                            'title' => __('Date Time Settings', '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' => 15,
                        ];
                        $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_html_toggle'] = [
                            'title' => __('HTML Section', 'pwh-dcfh'),
                            'priority' => 30,
                            'tabbed_subtoggles' => true,
                            'sub_toggles' => [
                                'wrapper_toggle' => [
                                    'name' => __('Wrapper', 'pwh-dcfh')
                                ],
                                'heading_toggle' => [
                                    'name' => __('Heading', 'pwh-dcfh')
                                ],
                                'paragraph_toggle' => [
                                    'name' => __('Paragraph', 'pwh-dcfh')
                                ],
                                'link_toggle' => [
                                    'name' => __('Link', 'pwh-dcfh')
                                ],
                                'image_toggle' => [
                                    'name' => __('Image', 'pwh-dcfh')
                                ],
                                'divider_toggle' => [
                                    'name' => __('Divider', 'pwh-dcfh')
                                ],
                            ],
                        ];
                        $settings_modal_toggles['advanced']['toggles']['signature_pad_toggle'] = [
                            'title' => __('Signature Pad', 'pwh-dcfh'),
                            'priority' => 30,
                            'tabbed_subtoggles' => true,
                            'sub_toggles' => [
                                'pad_toggle' => [
                                    'name' => __('Pad', 'pwh-dcfh')
                                ],
                                'save_toggle' => [
                                    'name' => __('Save', 'pwh-dcfh')
                                ],
                                'clear_toggle' => [
                                    'name' => __('Clear', 'pwh-dcfh')
                                ],
                                'message_toggle' => [
                                    'name' => __('Message', 'pwh-dcfh')
                                ],
                            ],
                        ];
                        $settings_modal_toggles['advanced']['toggles']['star_rating_toggle'] = [
                            'title' => __('Star Rating', 'pwh-dcfh'),
                            'priority' => 30,
                        ];
                        $module->settings_modal_toggles = $settings_modal_toggles;
                    }
                }
            }
            $is_applied = true;

            return $modules;
        }

        /**
         * Filter Form Fields Fields
         *
         * @param $fields_unprocessed
         *
         * @return array
         */
        public function maybe_add_fields($fields_unprocessed)
        {
            $week_days = pwh_dcfh_module_helpers()::get_week_day_names();
            $custom_fields = [];
            //==================================================
            // Override Default
            //==================================================
            $fields_unprocessed['allowed_symbols']['show_if'] = [
                'use_file_upload' => 'off',
                'use_datetime' => 'off',
                'field_type' => ['input', 'email', 'text']
            ];
            $fields_unprocessed['min_length']['label'] = __('Minimum Character Count', 'pwh-dcfh');
            $fields_unprocessed['min_length']['description'] = __('Set the minimum number of characters allowed in the field.', 'pwh-dcfh');
            $fields_unprocessed['min_length']['show_if'] = [
                'use_file_upload' => 'off',
                'use_datetime' => 'off',
                'field_type' => ['input', 'email', 'text']
            ];
            $fields_unprocessed['max_length']['label'] = __('Maximum Character Count', 'pwh-dcfh');
            $fields_unprocessed['max_length']['description'] = __('Set the maximum number of characters allowed in the field.', 'pwh-dcfh');
            $fields_unprocessed['max_length']['show_if'] = [
                'use_file_upload' => 'off',
                'use_datetime' => 'off',
                'field_type' => ['input', 'email', 'text']
            ];
            $fields_unprocessed['field_type']['show_if'] = ['use_field_html' => 'off'];
            $fields_unprocessed['required_mark']['show_if'] = ['use_field_html' => 'off'];
            //==================================================
            // Field
            //==================================================
            $fields_unprocessed['field_title']['label'] = __('Label', 'pwh-dcfh');
            $fields_unprocessed['select_options']['radio'] = true;
            $custom_fields['use_field_label'] = [
                'label' => __('Show Label On Frontend', 'pwh-dcfh'),
                'description' => __('Choose to show or hide the field label on the frontend.', 'pwh-dcfh'),
                'type' => 'yes_no_button',
                'options' => [
                    'on' => et_builder_i18n('Yes'),
                    'off' => et_builder_i18n('No'),
                ],
                'show_if_not' => ['use_field_html' => 'on', 'field_type' => ['checkbox', 'radio']],
                'default' => 'off',
                'toggle_slug' => 'main_content',
                'option_category' => 'basic_option',
            ];
            $custom_fields['use_field_label_cr'] = [
                'label' => __('Show Label On Frontend', 'pwh-dcfh'),
                'description' => __('Choose to show or hide the field label on the frontend.', 'pwh-dcfh'),
                'type' => 'yes_no_button',
                'options' => [
                    'on' => et_builder_i18n('Yes'),
                    'off' => et_builder_i18n('No'),
                ],
                'show_if_not' => ['use_field_html' => 'on', 'field_type' => ['input', 'email', 'text', 'select']],
                'default' => 'on',
                'toggle_slug' => 'main_content',
                'option_category' => 'basic_option',
            ];
            $custom_fields['show_field_labels_left'] = [
                'label' => __('Show Label On Left Side', 'pwh-dcfh'),
                'description' => __('Choose to show the label text on the left side of the field instead of at the top.', 'pwh-dcfh'),
                'type' => 'yes_no_button',
                'options' => [
                    'on' => et_builder_i18n('Yes'),
                    'off' => et_builder_i18n('No'),
                ],
                'show_if' => ['use_field_label' => 'on', 'use_field_html' => 'off', 'field_type' => ['input', 'email', 'text', 'select']],
                'default' => 'off',
                'mobile_options' => true,
                'toggle_slug' => 'main_content',
                'option_category' => 'basic_option',
            ];
            $custom_fields['field_label_width'] = [
                'label' => __('Label Width', 'pwh-dcfh'),
                'type' => 'range',
                'description' => __('Set the width of the label text on the left side of the field.', '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' => '',
                'show_if' => ['show_field_labels_left' => 'on'],
                'mobile_options' => true,
                'toggle_slug' => 'main_content',
                'option_category' => 'basic_option',
            ];
            $custom_fields['use_field_placeholder'] = [
                'label' => __('Hide Placeholder', 'pwh-dcfh'),
                'description' => __('Choose to show or hide the field placeholder text.', 'pwh-dcfh'),
                'type' => 'yes_no_button',
                'options' => [
                    'on' => et_builder_i18n('Yes'),
                    'off' => et_builder_i18n('No'),
                ],
                'default' => 'off',
                'show_if' => ['use_field_html' => 'off', 'use_signature_pad' => 'off', 'field_type' => ['input', 'email', 'text', 'select']],
                'toggle_slug' => 'main_content',
                'option_category' => 'basic_option',
            ];
            $custom_fields['field_placeholder'] = [
                'label' => __('Placeholder', 'pwh-dcfh'),
                'type' => 'text',
                'description' => __('Enter custom placeholder text for the field.', 'pwh-dcfh'),
                'show_if' => ['use_field_html' => 'off', 'use_signature_pad' => 'off', 'field_type' => ['input', 'email', 'text', 'select'], 'use_field_placeholder' => 'off'],
                'toggle_slug' => 'main_content',
                'option_category' => 'basic_option',
            ];
            $custom_fields['field_description'] = [
                'label' => __('Description', 'pwh-dcfh'),
                'type' => 'text',
                'description' => __('Enter custom description text to help explain or describe the field. Allowed Tags:a,abbr,br,b,cite,del,em,img,span,strike,strong,small,svg,iframe,sub,sup,video,audio', 'pwh-dcfh'),
                'show_if' => ['use_field_html' => 'off'],
                'toggle_slug' => 'main_content',
                'option_category' => 'basic_option',
            ];
            $custom_fields['field_description_location'] = [
                'label' => __('Description Location', 'pwh-dcfh'),
                'type' => 'select',
                'options' => [
                    'above' => __('Above Field', 'pwh-dcfh'),
                    'below' => __('Below Field', 'pwh-dcfh'),
                ],
                'default' => 'below',
                'description' => __('Choose field description location.', 'pwh-dcfh'),
                'show_if' => ['use_field_html' => 'off'],
                'toggle_slug' => 'main_content',
                'option_category' => 'basic_option',
            ];
            $custom_fields['use_required_asterisk'] = [
                'label' => __('Show Asterisk On Frontend', 'pwh-dcfh'),
                'description' => __('Choose to show an asterisk on the frontend to indicate the required field.', 'pwh-dcfh'),
                'type' => 'yes_no_button',
                'options' => [
                    'on' => et_builder_i18n('Yes'),
                    'off' => et_builder_i18n('No'),
                ],
                'default' => 'on',
                'show_if' => ['required_mark' => 'on', 'use_field_html' => 'off'],
                'option_category' => 'field',
                'toggle_slug' => 'field_options',
            ];
            $custom_fields['use_field_html'] = [
                'label' => __('Use As HTML Field', 'pwh-dcfh'),
                'description' => __('Enable this option to change this input field into a free-for-all HTML field type.', 'pwh-dcfh'),
                'type' => 'yes_no_button',
                'options' => [
                    'on' => et_builder_i18n('Yes'),
                    'off' => et_builder_i18n('No'),
                ],
                'default' => 'off',
                'show_if' => ['field_type' => 'input', 'use_signature_pad' => 'off'],
                'toggle_slug' => 'field_options',
                'option_category' => 'basic_option',
            ];
            $custom_fields['field_htmlcontent'] = [
                'label' => __('HTML Field', 'pwh-dcfh'),
                'description' => __('Enter any HMTL or use the rich text editor to create section headings, paragraphs, formatted text, divider lines, images, videos, links, lists, and more anywhere in your form! Contents of the HTML field will display on the frontend of the form, but will not be saved in the submission entry data.', 'pwh-dcfh'),
                'type' => 'tiny_mce',
                'dynamic_content' => 'text',
                'show_if' => ['use_field_html' => 'on'],
                'toggle_slug' => 'field_options',
                'option_category' => 'basic_option',
            ];
            $custom_fields['use_signature_pad'] = [
                'label' => __('Use As Signature Pad', 'pwh-dcfh'),
                'description' => __('Enable this option to change this input field into a signature pad for digital signatures', 'pwh-dcfh'),
                'type' => 'yes_no_button',
                'options' => [
                    'on' => et_builder_i18n('Yes'),
                    'off' => et_builder_i18n('No'),
                ],
                'default' => 'off',
                'show_if' => ['field_type' => 'input', 'use_field_html' => 'off'],
                'toggle_slug' => 'field_options',
                'option_category' => 'basic_option',
            ];
            $custom_fields['use_star_rating'] = [
                'label' => __('Use As Star Rating', 'pwh-dcfh'),
                'description' => __('Enable this option to change this input field into a star rating.', 'pwh-dcfh'),
                'type' => 'yes_no_button',
                'options' => [
                    'on' => et_builder_i18n('Yes'),
                    'off' => et_builder_i18n('No'),
                ],
                'default' => 'off',
                'show_if' => ['field_type' => 'input', 'use_field_html' => 'off'],
                'toggle_slug' => 'field_options',
                'option_category' => 'basic_option',
            ];
            $custom_fields['use_custom_phone_format'] = [
                'label' => __('Custom Phone Number Formatting', 'pwh-dcfh'),
                'description' => __('Choose to enable custom phone number formatting for this input field.', 'pwh-dcfh'),
                'type' => 'yes_no_button',
                'options' => [
                    'on' => et_builder_i18n('Yes'),
                    'off' => et_builder_i18n('No'),
                ],
                'default' => 'off',
                'show_if' => ['use_field_html' => 'off', 'use_signature_pad' => 'off', 'field_type' => ['input']],
                'toggle_slug' => 'field_options',
                'option_category' => 'basic_option',
            ];
            $custom_fields['custom_phone_format'] = [
                'label' => __('Custom Phone Number Format', 'pwh-dcfh'),
                'description' => __('Enter the specific phone number format you want to use. Please follow a pattern such as +x-xxx-xxx-xxxx or (xxx) xxx-xxxx with each x representing a number. ', 'pwh-dcfh'),
                'type' => 'text',
                'default' => '',
                'show_if' => ['use_field_html' => 'off', 'use_signature_pad' => 'off', 'use_custom_phone_format' => 'on', 'field_type' => ['input']],
                'toggle_slug' => 'field_options',
                'option_category' => 'basic_option',
            ];
            $custom_fields['use_field_icon'] = [
                'label' => __('Use Icon', 'pwh-dcfh'),
                'description' => __('Enable this option to add an icon to the form field.', 'pwh-dcfh'),
                'type' => 'yes_no_button',
                'options' => [
                    'on' => et_builder_i18n('Yes'),
                    'off' => et_builder_i18n('No'),
                ],
                'default' => 'off',
                'show_if_not' => ['use_field_html' => 'on', 'use_file_upload' => 'on', 'use_field_label_cr' => 'off'],
                'option_category' => 'field',
                'toggle_slug' => 'field_options',
            ];
            $custom_fields['use_dropdown_search'] = [
                'label' => __('Use Dropdown Search', 'pwh-dcfh'),
                'description' => __('Choose to add a search bar to the dropdown items.', 'pwh-dcfh'),
                'type' => 'yes_no_button',
                'options' => [
                    'on' => et_builder_i18n('Yes'),
                    'off' => et_builder_i18n('No'),
                ],
                'default' => 'off',
                'show_if' => ['field_type' => 'select'],
                'option_category' => 'field',
                'toggle_slug' => 'field_options',
            ];
            $custom_fields['field_icon'] = [
                'label' => __('Icon', 'pwh-dcfh'),
                'description' => __('Choose an icon to display inside the form field.', 'pwh-dcfh'),
                'type' => 'select_icon',
                'default' => 'off',
                'show_if' => ['use_field_icon' => 'on'],
                'option_category' => 'field',
                'toggle_slug' => 'field_options',
            ];
            $custom_fields['field_icon_color'] = [
                'label' => __('Icon Color', 'pwh-dcfh'),
                'type' => 'color',
                'description' => __('By default, all icon colors in Divi will appear as white or dark gray. If you would like to change the color of your icon, choose your desired color from the color picker using this option.', 'pwh-dcfh'),
                'custom_color' => true,
                'default' => '',
                'show_if' => ['use_field_icon' => 'on'],
                'option_category' => 'field',
                'toggle_slug' => 'field_options',
            ];
            //==================================================
            // File Upload
            //==================================================
            $custom_fields['use_file_upload'] = [
                'label' => __('Use As File Upload Field', 'pwh-dcfh'),
                'description' => __('Enable this option to change this input field into a file upload field type for adding attachments to the form.', 'pwh-dcfh'),
                'type' => 'yes_no_button',
                'options' => [
                    'on' => et_builder_i18n('Yes'),
                    'off' => et_builder_i18n('No'),
                ],
                'default' => 'off',
                'show_if_not' => ['use_field_html' => 'on'],
                'show_if' => ['field_type' => 'input', 'use_datetime' => 'off'],
                'option_category' => 'configuration',
                'toggle_slug' => 'fileupload_settings',
            ];
            $custom_fields['file_size'] = [
                'label' => __('Maximum Upload File Size', 'pwh-dcfh'),
                'type' => 'number',
                'description' => __('Set an allowed maximum file size limit for the attachments uploaded to the form. The value is set in kb (kilobytes) and can be calculated easily online from megabits if needed.', 'pwh-dcfh'),
                'value_type' => 'integer',
                'default' => '1024',
                'default_on_front' => '1024',
                'show_if' => ['use_file_upload' => 'on', 'field_type' => 'input'],
                'option_category' => 'configuration',
                'toggle_slug' => 'fileupload_settings',
            ];
            $custom_fields['warning_file_size'] = [
                'type' => 'warning',
                'value' => true,
                'display_if' => true,
                'message' => sprintf(__('Default WordPress Max Upload Fize Size %1$s KB i.e. %2$s Convert your MB to KB (in binary) using <a href="%3$s">%3$s</a>', 'pwh-dcfh'),
                    round(wp_max_upload_size() / 1024), size_format(wp_max_upload_size()), 'https://www.gbmb.org/mb-to-kb'),
                'show_if' => ['use_file_upload' => 'on', 'field_type' => 'input'],
                'option_category' => 'configuration',
                'toggle_slug' => 'fileupload_settings',
            ];
            $custom_fields['files_limit'] = [
                'label' => __('Maximum Number Of Files', 'pwh-dcfh'),
                'description' => __('Set an allowed maximum number of files which can be attached to the contact form.', 'pwh-dcfh'),
                'type' => 'range',
                'range_settings' => [
                    'min' => '1',
                    'max' => pwh_dcfh_module_helpers()::max_number_files_allowed(),
                    'step' => '1',
                    'min_limit' => 1,
                    'max_limit' => pwh_dcfh_module_helpers()::max_number_files_allowed(),
                ],
                'unitless' => true,
                'show_if' => ['use_file_upload' => 'on', 'field_type' => 'input'],
                'default' => '2',
                'option_category' => 'basic_option',
                'toggle_slug' => 'fileupload_settings',
            ];
            $custom_fields['file_mime'] = [
                'label' => __('Allowed File Types', 'pwh-dcfh'),
                'type' => 'multiple_checkboxes',
                'description' => __('Select the types of files users are allowed to upload to the form.', 'pwh-dcfh'),
                'options' => pwh_dcfh_module_helpers()::get_mimes_with_ext(),
                'default' => 'on|on',
                'show_if' => ['use_file_upload' => 'on', 'field_type' => 'input'],
                'option_category' => 'configuration',
                'toggle_slug' => 'fileupload_settings',
            ];
            //==================================================
            // DateTime Picker
            //==================================================
            $custom_fields['use_datetime'] = [
                'label' => __('Use As DateTime Picker', 'pwh-dcfh'),
                'description' => __('Enable this option to change this input field into a date and time picker field type.', 'pwh-dcfh'),
                'type' => 'yes_no_button',
                'options' => [
                    'on' => et_builder_i18n('Yes'),
                    'off' => et_builder_i18n('No'),
                ],
                'default' => 'off',
                'show_if_not' => ['use_field_html' => 'on'],
                'show_if' => ['field_type' => 'input', 'use_file_upload' => 'off'],
                'option_category' => 'configuration',
                'toggle_slug' => 'datetime_settings',
                'sub_toggle' => 'default_toggle',
            ];
            $custom_fields['warning_toggle_date'] = [
                'label' => '',
                'type' => 'warning',
                'value' => true,
                'display_if' => true,
                'message' => __('Enable DateTime Picker', 'pwh-dcfh'),
                'show_if' => [
                    'use_datetime' => 'off',
                ],
                'toggle_slug' => 'datetime_settings',
                'sub_toggle' => 'date_toggle',
            ];
            $custom_fields['warning_toggle_time'] = [
                'label' => '',
                'type' => 'warning',
                'value' => true,
                'display_if' => true,
                'message' => __('Enable DateTime Picker', 'pwh-dcfh'),
                'show_if' => [
                    'use_datetime' => 'off',
                ],
                'toggle_slug' => 'datetime_settings',
                'sub_toggle' => 'time_toggle',
            ];
            $custom_fields['datetime_type'] = [
                'label' => __('DateTime Picker Type', 'pwh-dcfh'),
                'description' => __('Choose the type of date and/or time picker field to use.', 'pwh-dcfh'),
                'type' => 'select',
                'options' => [
                    'both' => __('Date & Time Picker', 'pwh-dcfh'),
                    'date' => __('Date Picker', 'pwh-dcfh'),
                    'time' => __('Time Picker', 'pwh-dcfh'),
                ],
                'default' => 'both',
                'show_if' => ['field_type' => 'input', 'use_datetime' => 'on'],
                'affects' => ['datetime_format', 'date_format', 'time_format', 'datetime_week_start'],
                'option_category' => 'basic_option',
                'toggle_slug' => 'datetime_settings',
                'sub_toggle' => 'default_toggle',
            ];
            $custom_fields['datetime_format'] = [
                'label' => __('DateTime Picker Format', 'pwh-dcfh'),
                'description' => __('Set the date and/or time format to use.', 'pwh-dcfh'),
                'type' => 'select',
                'options' => [
                    'Y/m/d_dt_h:i' => __('Y/m/d h:i (12-Hours Format)', 'pwh-dcfh'),
                    'Y/m/d_dt_h:ia' => __('Y/m/d h:ia (12-Hours Format am or pm)', 'pwh-dcfh'),
                    'Y-m-d_dt_h:i' => __('Y-m-d h:i (12-Hours Format)', 'pwh-dcfh'),
                    'Y-m-d_dt_h:ia' => __('Y-m-d h:ia (12-Hours Format am or pm)', 'pwh-dcfh'),
                    'Y/m/d_dt_H:i' => __('Y/m/d H:i (24-Hours Format)', 'pwh-dcfh'),
                    'Y/m/d_dt_H:ia' => __('Y/m/d H:ia (24-Hours Format am or pm)', 'pwh-dcfh'),
                    'Y-m-d_dt_H:i' => __('Y-m-d H:i (24-Hours Format)', 'pwh-dcfh'),
                    'Y-m-d_dt_H:ia' => __('Y-m-d H:ia (24-Hours Format am or pm)', 'pwh-dcfh'),
                    'F j, Y_dt_h:i' => __('F j, Y h:i (12-Hours Format)', 'pwh-dcfh'),
                    'F j, Y_dt_h:ia' => __('F j, Y h:ia (12-Hours Format am or pm)', 'pwh-dcfh'),
                    'F j, Y_dt_H:i' => __('F j, Y H:i (24-Hours Format)', 'pwh-dcfh'),
                    'F j, Y_dt_H:ia' => __('F j, Y H:ia (24-Hours Format am or pm)', 'pwh-dcfh'),
                ],
                'default' => 'Y/m/d_dt_h:ia',
                'depends_show_if' => 'both',
                'option_category' => 'basic_option',
                'toggle_slug' => 'datetime_settings',
                'sub_toggle' => 'default_toggle',
            ];
            $custom_fields['date_format'] = [
                'label' => __('Date Picker Format', 'pwh-dcfh'),
                'description' => __('Set the date format to use.', 'pwh-dcfh'),
                'type' => 'select',
                'options' => [
                    'Y-m-d' => esc_html('Y-m-d'),
                    'Y/m/d' => esc_html('Y/m/d'),
                    'F j, Y' => esc_html('F j, Y'),
                ],
                'default' => 'Y-m-d',
                'depends_show_if' => 'date',
                'option_category' => 'basic_option',
                'toggle_slug' => 'datetime_settings',
                'sub_toggle' => 'date_toggle',
            ];
            $custom_fields['custom_date_format'] = [
                'label' => __('Custom Date Format', 'pwh-dcfh'),
                'description' => __('Enter a custom time format using your preferred PHP parameters. This will override and take priority over any other time format you have selected.', 'pwh-dcfh'),
                'type' => 'text',
                'default' => '',
                'show_if' => [
                    'field_type' => 'input',
                    'use_datetime' => 'on',
                ],
                'show_if_not' => ['datetime_type' => 'time'],
                'option_category' => 'basic_option',
                'toggle_slug' => 'datetime_settings',
                'sub_toggle' => 'date_toggle',
            ];
            $custom_fields['time_format'] = [
                'label' => __('Time Picker Format', 'pwh-dcfh'),
                'description' => __('Set the time format to use.', 'pwh-dcfh'),
                'type' => 'select',
                'options' => [
                    'h:i' => __('h:i (12-Hours Format)', 'pwh-dcfh'),
                    'h:ia' => __('h:ia (12-Hours Format am or pm)', 'pwh-dcfh'),
                    'H:i' => __('H:i (24-Hours Format)', 'pwh-dcfh'),
                    'H:ia' => __('H:ia (24-Hours Format am or pm)', 'pwh-dcfh'),
                ],
                'default' => 'h:ia',
                'depends_show_if' => 'time',
                'option_category' => 'basic_option',
                'toggle_slug' => 'datetime_settings',
                'sub_toggle' => 'time_toggle',
            ];
            $custom_fields['custom_time_format'] = [
                'label' => __('Custom Time Format', 'pwh-dcfh'),
                'description' => __('Enter a custom time format using your preferred PHP parameters. This will override and take priority over any other time format you have selected.', 'pwh-dcfh'),
                'type' => 'text',
                'default' => '',
                'show_if' => [
                    'field_type' => 'input',
                    'use_datetime' => 'on',
                ],
                'show_if_not' => ['datetime_type' => 'date'],
                'option_category' => 'basic_option',
                'toggle_slug' => 'datetime_settings',
                'sub_toggle' => 'time_toggle',
            ];
            $custom_fields['disabled_past_times'] = [
                'label' => __('Disable Past Times', 'pwh-dcfh'),
                'description' => __('Choose to prevent past times from being selected.', 'pwh-dcfh'),
                'type' => 'yes_no_button',
                'options' => [
                    'on' => et_builder_i18n('Yes'),
                    'off' => et_builder_i18n('No'),
                ],
                'default' => 'off',
                'show_if' => ['field_type' => 'input', 'use_datetime' => 'on'],
                'show_if_not' => ['datetime_type' => 'date'],
                'option_category' => 'basic_option',
                'toggle_slug' => 'datetime_settings',
                'sub_toggle' => 'time_toggle',
            ];
            $custom_fields['datetime_week_start'] = [
                'label' => __('Week Start Day', 'pwh-dcfh'),
                'description' => __('Choose the first day of the week in the calendar.', 'pwh-dcfh'),
                'type' => 'select',
                'options' => $week_days,
                'default_on_front' => 'sunday',
                'default' => 'sunday',
                'depends_show_if_not' => 'time',
                'option_category' => 'basic_option',
                'toggle_slug' => 'datetime_settings',
                'sub_toggle' => 'date_toggle',
            ];
            $custom_fields['datetime_disabled_week_days'] = [
                'label' => __('Disable Week Days', 'pwh-dcfh'),
                'description' => __('Select days of the week to disable.', 'pwh-dcfh'),
                'type' => 'multiple_checkboxes',
                'options' => $week_days,
                'default' => 'on|off|off|off|off|off|on',
                'show_if' => ['use_datetime' => 'on'],
                'show_if_not' => ['datetime_type' => 'time'],
                'option_category' => 'configuration',
                'toggle_slug' => 'datetime_settings',
                'sub_toggle' => 'date_toggle',
            ];
            $custom_fields['datetime_disabled_weeks'] = [
                'label' => __('Disable Weeks Row Number Marker', 'pwh-dcfh'),
                'description' => __('Choose to hide the week number marker beside each row in the datepicker calendar.', 'pwh-dcfh'),
                'type' => 'yes_no_button',
                'options' => [
                    'on' => et_builder_i18n('Yes'),
                    'off' => et_builder_i18n('No'),
                ],
                'default' => 'on',
                'show_if' => ['field_type' => 'input', 'use_datetime' => 'on'],
                'show_if_not' => ['datetime_type' => 'time'],
                'option_category' => 'basic_option',
                'toggle_slug' => 'datetime_settings',
                'sub_toggle' => 'date_toggle',
            ];
            $custom_fields['datetime_disabled_past_days'] = [
                'label' => __('Disable Past Dates', 'pwh-dcfh'),
                'description' => __('Choose to prevent past dates from being selected.', 'pwh-dcfh'),
                'type' => 'yes_no_button',
                'options' => [
                    'on' => et_builder_i18n('Yes'),
                    'off' => et_builder_i18n('No'),
                ],
                'default' => 'off',
                'show_if' => ['field_type' => 'input', 'use_datetime' => 'on'],
                'show_if_not' => ['datetime_type' => 'time'],
                'option_category' => 'basic_option',
                'toggle_slug' => 'datetime_settings',
                'sub_toggle' => 'date_toggle',
            ];
            $custom_fields['datetime_disabled_current_date'] = [
                'label' => __('Disable Current Date', 'pwh-dcfh'),
                'description' => __('Choose to prevent the current date from being selected.', 'pwh-dcfh'),
                'type' => 'yes_no_button',
                'options' => [
                    'on' => et_builder_i18n('Yes'),
                    'off' => et_builder_i18n('No'),
                ],
                'default' => 'off',
                'show_if' => ['field_type' => 'input', 'use_datetime' => 'on'],
                'show_if_not' => ['datetime_type' => 'time'],
                'option_category' => 'basic_option',
                'toggle_slug' => 'datetime_settings',
                'sub_toggle' => 'date_toggle',
            ];
            $custom_fields['min_date_type'] = [
                'label' => __('Minimum Date Type', 'pwh-dcfh'),
                'description' => __('Choose whether to use a fixed or relative minimum date.', 'pwh-dcfh'),
                'type' => 'select',
                'options' => [
                    'off' => et_builder_i18n('None'),
                    'fixed' => et_builder_i18n('Fixed'),
                    'relative' => et_builder_i18n('Relative'),
                ],
                'default' => 'off',
                'show_if' => ['field_type' => 'input', 'use_datetime' => 'on'],
                'show_if_not' => ['datetime_type' => 'time'],
                'option_category' => 'basic_option',
                'toggle_slug' => 'datetime_settings',
                'sub_toggle' => 'date_toggle',
            ];
            $custom_fields['fixed_min_date'] = [
                'label' => __('Fixed Minimum Date', 'pwh-dcfh'),
                'description' => __('Enter a fixed date to set a limit for the minimum date that can be selected', 'pwh-dcfh'),
                'type' => 'text',
                'default' => '',
                'show_if' => [
                    'field_type' => 'input',
                    'use_datetime' => 'on',
                    'min_date_type' => 'fixed'
                ],
                'option_category' => 'basic_option',
                'toggle_slug' => 'datetime_settings',
                'sub_toggle' => 'date_toggle',
            ];
            $custom_fields['relative_min_date'] = [
                'label' => __('Relative Minimum Date', 'pwh-dcfh'),
                'description' => __('Enter a negative or positive number relevant to the current date to set a limit for the minimum date that can be selected.', 'pwh-dcfh'),
                'type' => 'text',
                'default' => '',
                'show_if' => [
                    'field_type' => 'input',
                    'use_datetime' => 'on',
                    'min_date_type' => 'relative'
                ],
                'option_category' => 'basic_option',
                'toggle_slug' => 'datetime_settings',
                'sub_toggle' => 'date_toggle',
            ];
            $custom_fields['max_date_type'] = [
                'label' => __('Maximum Date Type', 'pwh-dcfh'),
                'description' => __('Choose whether to use a fixed or relative maximum date.', 'pwh-dcfh'),
                'type' => 'select',
                'options' => [
                    'off' => et_builder_i18n('None'),
                    'fixed' => et_builder_i18n('Fixed'),
                    'relative' => et_builder_i18n('Relative'),
                ],
                'default' => 'off',
                'show_if' => ['field_type' => 'input', 'use_datetime' => 'on'],
                'show_if_not' => ['datetime_type' => 'time'],
                'option_category' => 'basic_option',
                'toggle_slug' => 'datetime_settings',
                'sub_toggle' => 'date_toggle',
            ];
            $custom_fields['fixed_max_date'] = [
                'label' => __('Fixed Maximum Date', 'pwh-dcfh'),
                'description' => __('Enter a fixed date to set a limit for the maximum date that can be selected.', 'pwh-dcfh'),
                'type' => 'text',
                'default' => '',
                'show_if' => [
                    'field_type' => 'input',
                    'use_datetime' => 'on',
                    'max_date_type' => 'fixed'
                ],
                'option_category' => 'basic_option',
                'toggle_slug' => 'datetime_settings',
                'sub_toggle' => 'date_toggle',
            ];
            $custom_fields['relative_max_date'] = [
                'label' => __('Relative Maximum Date', 'pwh-dcfh'),
                'description' => __('Enter a negative or positive number relevant to the current date to set a limit for the maximum date that can be selected.', 'pwh-dcfh'),
                'type' => 'text',
                'default' => '',
                'show_if' => [
                    'field_type' => 'input',
                    'use_datetime' => 'on',
                    'max_date_type' => 'relative'
                ],
                'option_category' => 'basic_option',
                'toggle_slug' => 'datetime_settings',
                'sub_toggle' => 'date_toggle',
            ];
            $custom_fields['available_dates'] = [
                'label' => __('Available Dates', 'pwh-dcfh'),
                'description' => __('Enter specific dates that are available to be selected.', 'pwh-dcfh'),
                'type' => 'text',
                'default' => '',
                'show_if' => [
                    'field_type' => 'input',
                    'use_datetime' => 'on',
                ],
                'show_if_not' => ['datetime_type' => 'time', 'use_datetime_icscalendar_sync' => 'on'],
                'option_category' => 'basic_option',
                'toggle_slug' => 'datetime_settings',
                'sub_toggle' => 'date_toggle',
            ];
            $custom_fields['unavailable_dates'] = [
                'label' => __('Unavailable Dates', 'pwh-dcfh'),
                'description' => __('Enter specific dates that are not available to be selected.', 'pwh-dcfh'),
                'type' => 'text',
                'default' => '',
                'show_if' => [
                    'field_type' => 'input',
                    'use_datetime' => 'on',
                ],
                'show_if_not' => ['datetime_type' => 'time', 'use_datetime_icscalendar_sync' => 'on'],
                'option_category' => 'basic_option',
                'toggle_slug' => 'datetime_settings',
                'sub_toggle' => 'date_toggle',
            ];
            $custom_fields['min_time'] = [
                'label' => __('Minimum Time', 'pwh-dcfh'),
                'description' => __('Enter the minimum time limit that can be selected. Set 0 to disabled past time.', 'pwh-dcfh'),
                'type' => 'text',
                'default' => '',
                'show_if' => [
                    'field_type' => 'input',
                    'use_datetime' => 'on',
                ],
                'show_if_not' => ['datetime_type' => 'date'],
                'option_category' => 'basic_option',
                'toggle_slug' => 'datetime_settings',
                'sub_toggle' => 'time_toggle',
            ];
            $custom_fields['max_time'] = [
                'label' => __('Maximum Time', 'pwh-dcfh'),
                'description' => __('Enter the maximum time limit that can be selected.', 'pwh-dcfh'),
                'type' => 'text',
                'default' => '',
                'show_if' => [
                    'field_type' => 'input',
                    'use_datetime' => 'on',
                ],
                'show_if_not' => ['datetime_type' => 'date'],
                'option_category' => 'basic_option',
                'toggle_slug' => 'datetime_settings',
                'sub_toggle' => 'time_toggle',
            ];
            $custom_fields['available_times'] = [
                'label' => __('Available Times (Global)', 'pwh-dcfh'),
                'description' => __('Enter specific times that are available to be selected for all days.', 'pwh-dcfh'),
                'type' => 'text',
                'default' => '',
                'show_if' => [
                    'field_type' => 'input',
                    'use_datetime' => 'on',
                ],
                'show_if_not' => ['datetime_type' => 'date', 'use_datetime_icscalendar_sync' => 'on'],
                'option_category' => 'basic_option',
                'toggle_slug' => 'datetime_settings',
                'sub_toggle' => 'time_toggle',
            ];
            $custom_fields['unavailable_times'] = [
                'label' => __('Unavailable Times (Global)', 'pwh-dcfh'),
                'description' => __('Enter specific times that are not available to be selected for all days.', 'pwh-dcfh'),
                'type' => 'text',
                'default' => '',
                'show_if' => [
                    'field_type' => 'input',
                    'use_datetime' => 'on',
                ],
                'show_if_not' => ['datetime_type' => 'date', 'use_datetime_icscalendar_sync' => 'on'],
                'option_category' => 'basic_option',
                'toggle_slug' => 'datetime_settings',
                'sub_toggle' => 'time_toggle',
            ];
            foreach ($week_days as $week_day) {
                $week_day_key = strtolower($week_day);
                $custom_fields["available_times_$week_day_key"] = [
                    'label' => sprintf(__('Available Times %s', 'pwh-dcfh'), $week_day),
                    'description' => sprintf(__('Enter specific times that are available to be selected on %s.', 'pwh-dcfh'), $week_day),
                    'type' => 'text',
                    'default' => '',
                    'show_if' => [
                        'field_type' => 'input',
                        'use_datetime' => 'on',
                    ],
                    'show_if_not' => ['datetime_type' => 'date'],
                    'option_category' => 'basic_option',
                    'toggle_slug' => 'datetime_settings',
                    'sub_toggle' => 'time_toggle',
                ];
                $custom_fields["unavailable_times_$week_day_key"] = [
                    'label' => sprintf(__('Unavailable Times %s', 'pwh-dcfh'), $week_day),
                    'description' => sprintf(__('Enter specific times that are not available to be selected on %s.', 'pwh-dcfh'), $week_day),
                    'type' => 'text',
                    'default' => '',
                    'show_if' => [
                        'field_type' => 'input',
                        'use_datetime' => 'on',
                    ],
                    'show_if_not' => ['datetime_type' => 'date'],
                    'option_category' => 'basic_option',
                    'toggle_slug' => 'datetime_settings',
                    'sub_toggle' => 'time_toggle',
                ];
            }
            $custom_fields['time_steps'] = [
                'label' => __('Time Steps', 'pwh-dcfh'),
                'description' => __('Enter the number of minutes to set the interval between the available times that can be selected.', 'pwh-dcfh'),
                'type' => 'text',
                'default' => '30',
                'show_if' => ['field_type' => 'input', 'use_datetime' => 'on'],
                'option_category' => 'basic_option',
                'toggle_slug' => 'datetime_settings',
                'sub_toggle' => 'time_toggle',
            ];
            $custom_fields['datetime_inline'] = [
                'label' => __('Show DateTime Picker Inline', 'pwh-dcfh'),
                'description' => __('Choose to show the date and time picker all the time by default without first clicking into the field to open it.', 'pwh-dcfh'),
                'type' => 'yes_no_button',
                'options' => [
                    'on' => et_builder_i18n('Yes'),
                    'off' => et_builder_i18n('No'),
                ],
                'default' => 'off',
                'show_if' => ['field_type' => 'input', 'use_datetime' => 'on'],
                'option_category' => 'basic_option',
                'toggle_slug' => 'datetime_settings',
                'sub_toggle' => 'default_toggle',
            ];
            $custom_fields['datetime_setcurrent_datetime'] = [
                'label' => __('Set Input With Current DateTime', 'pwh-dcfh'),
                'description' => __('Choose to set textbox with current date/time onload.', 'pwh-dcfh'),
                'type' => 'yes_no_button',
                'options' => [
                    'on' => et_builder_i18n('Yes'),
                    'off' => et_builder_i18n('No'),
                ],
                'default' => 'off',
                'show_if' => ['field_type' => 'input', 'use_datetime' => 'on', 'datetime_inline' => 'off', 'datetime_disabled_current_date' => 'off'],
                'option_category' => 'basic_option',
                'toggle_slug' => 'datetime_settings',
                'sub_toggle' => 'default_toggle',
            ];
            $custom_fields['datetime_locale'] = [
                'label' => __('DateTime Picker Language', 'pwh-dcfh'),
                'description' => __('Choose which language to use for the date and time picker text. NOTE: This automatically uses the Site Language set in WordPress General Settings, so there is usually no need to adjust this, but it can be overridden here if needed.', 'pwh-dcfh'),
                'type' => 'select',
                'options' => [
                    'en' => esc_html('English'),
                    'en-GB' => esc_html('English (British)'),
                    'ar' => esc_html('Arabic'),
                    'az' => esc_html('Azerbaijanian (Azeri)'),
                    'bg' => esc_html('Bulgarian'),
                    'bs' => esc_html('Bosanski'),
                    'ca' => esc_html('Català'),
                    'ch' => esc_html('Simplified Chinese'),
                    'cs' => esc_html('Čeština'),
                    'da' => esc_html('Dansk'),
                    'de' => esc_html('German'),
                    'el' => esc_html('Ελληνικά'),
                    'es' => esc_html('Spanish'),
                    'et' => esc_html('"Eesti"'),
                    'eu' => esc_html('Euskara'),
                    'fa' => esc_html('Persian'),
                    'fi' => esc_html('Finnish (Suomi)'),
                    'fr' => esc_html('French'),
                    'gl' => esc_html('Galego'),
                    'he' => esc_html('Hebrew (עברית)'),
                    'hr' => esc_html('Hrvatski'),
                    'hu' => esc_html('Hungarian'),
                    'id' => esc_html('Indonesian'),
                    'it' => esc_html('Italian'),
                    'ja' => esc_html('Japanese'),
                    'ko' => esc_html('Korean (한국어)'),
                    'kr' => esc_html('Korean'),
                    'lt' => esc_html('Lithuanian (lietuvių)'),
                    'lv' => esc_html('Latvian (Latviešu)'),
                    'mk' => esc_html('Macedonian (Македонски)'),
                    'mn' => esc_html('Mongolian (Монгол)'),
                    'nl' => esc_html('Dutch'),
                    'no' => esc_html('Norwegian'),
                    'pl' => esc_html('Polish'),
                    'pt' => esc_html('Portuguese'),
                    'pt-BR' => esc_html('Português(Brasil)'),
                    'ro' => esc_html('Romanian'),
                    'ru' => esc_html('Russian'),
                    'se' => esc_html('Swedish'),
                    'sk' => esc_html('Slovenčina'),
                    'sl' => esc_html('Slovenščina'),
                    'sq' => esc_html('Albanian (Shqip)'),
                    'sr' => esc_html('Serbian Cyrillic (Српски)'),
                    'sr-YU' => esc_html('Serbian (Srpski)'),
                    'sv' => esc_html('Svenska'),
                    'th' => esc_html('Thai'),
                    'tr' => esc_html('Turkish'),
                    'uk' => esc_html('Ukrainian'),
                    'vi' => esc_html('Vietnamese'),
                    'zh' => esc_html('Simplified Chinese (简体中文)'),
                    'zh-TW' => esc_html('Traditional Chinese (繁體中文)'),
                ],
                'default' => pwh_dcfh_wp_helpers()::get_wp_locale(),
                'show_if' => ['field_type' => 'input', 'use_datetime' => 'on'],
                'option_category' => 'basic_option',
                'toggle_slug' => 'datetime_settings',
                'sub_toggle' => 'default_toggle',
            ];
            $custom_fields['datetime_locale_direction'] = [
                'label' => __('Locale Direction RTL', 'pwh-dcfh'),
                'description' => __('Set current locale right-to-left (RTL).', 'pwh-dcfh'),
                'type' => 'yes_no_button',
                'options' => [
                    'on' => et_builder_i18n('Yes'),
                    'off' => et_builder_i18n('No'),
                ],
                'default' => is_rtl() ? 'on' : 'off',
                'show_if' => ['field_type' => 'input', 'use_datetime' => 'on'],
                'option_category' => 'basic_option',
                'toggle_slug' => 'datetime_settings',
                'sub_toggle' => 'default_toggle',
            ];
            $custom_fields['use_datetime_icscalendar_sync'] = [
                'label' => __('Enable ICS Calendar Sync', 'pwh-dcfh'),
                'description' => __('Choose to enable the feature to sync your ICS calendar feed with the date picker field.', 'pwh-dcfh'),
                'type' => 'yes_no_button',
                'options' => [
                    'on' => et_builder_i18n('Yes'),
                    'off' => et_builder_i18n('No'),
                ],
                'default' => 'off',
                'show_if' => ['field_type' => 'input', 'use_datetime' => 'on'],
                'show_if_not' => ['datetime_type' => 'time'],
                'option_category' => 'basic_option',
                'toggle_slug' => 'datetime_settings',
                'sub_toggle' => 'default_toggle',
            ];
            $custom_fields['datetime_ics_sync_url'] = [
                'label' => __('ICS Feed URL', 'pwh-dcfh'),
                'description' => __('Enter the URL of your .ics calendar feed to sync your calendar with the date picker field to automatically disable dates and times by syncing with other tools using the same .ics URL.', 'pwh-dcfh'),
                'type' => 'text',
                'default' => '',
                'show_if' => [
                    'field_type' => 'input',
                    'use_datetime' => 'on',
                    'use_datetime_icscalendar_sync' => 'on',
                ],
                'show_if_not' => ['datetime_type' => 'time'],
                'option_category' => 'basic_option',
                'toggle_slug' => 'datetime_settings',
                'sub_toggle' => 'default_toggle',
            ];
            /* $custom_fields['ics_url_sync_btn'] = [
                 'label' => __('Sync URL', 'pwh-dcfh'),
                 'type' => 'warning',
                 'value' => true,
                 'display_if' => true,
                 'message' => sprintf(__('<button class="ics_url_sync_btn" data-wpnonce="%s">Sync URL</button>', 'pwh-dcfh'), wp_create_nonce('sync_ics_url')),
                 'class' => 'ics_url_sync_btn',
                 'option_class' => 'iamhere et-pb-option-group--last-field',
                 'after' => [
                     [
                         'type' => 'button',
                         'class' => 'iamhere1',
                         'text' => 'Cancel',
                     ],
                     [
                         'type' => 'button',
                         'class' => 'iamhere2',
                         'text' => 'Submit',
                     ]
                 ],
                 'show_if' => [
                     'field_type' => 'input',
                     'use_datetime' => 'on',
                     'use_datetime_icscalendar_sync' => 'on',
                 ],
                 'option_category' => 'basic_option',
                 'toggle_slug' => 'datetime_settings',
                 'sub_toggle' => 'date_toggle',
             ];*/
            //==================================================
            // Checkbox Layout
            //==================================================
            $custom_fields['checkbox_layout'] = [
                'label' => __('Checkbox Layout', 'pwh-dcfh'),
                'description' => __('Choose how you want the checkboxes to display.', 'pwh-dcfh'),
                'type' => 'select',
                'options' => [
                    'column' => et_builder_i18n('Columns'),
                    'inline' => et_builder_i18n('Inline'),
                ],
                'default' => 'column',
                'show_if' => ['field_type' => 'checkbox'],
                'option_category' => 'field',
                'toggle_slug' => 'field_options',
            ];
            $custom_fields['checkbox_columns'] = [
                'label' => __('Number Of Checkbox Columns', 'pwh-dcfh'),
                'description' => __('Choose the number of columns for the checkboxes.', 'pwh-dcfh'),
                /*  'type' => 'select',
                  'options' => [
                      '1' => et_builder_i18n('1 Column'),
                      '2' => et_builder_i18n('2 Column'),
                      '3' => et_builder_i18n('3 Column'),
                      '4' => et_builder_i18n('4 Column'),
                  ],
                  'default' => '1',*/
                'type' => 'range',
                'range_settings' => [
                    'min' => '1',
                    'max' => '4',
                    'step' => '1',
                    'min_limit' => 1,
                    'max_limit' => 3,
                ],
                'unitless' => true,
                'fixed_range' => true,
                'default' => '1',
                'show_if' => ['field_type' => 'checkbox', 'checkbox_layout' => 'column'],
                'mobile_options' => true,
                'option_category' => 'field',
                'toggle_slug' => 'field_options',
            ];
            //==================================================
            // Radio Layout
            //==================================================
            $custom_fields['radio_layout'] = [
                'label' => __('Radio Button Layout', 'pwh-dcfh'),
                'description' => __('Choose how you want the radio buttons to display.', 'pwh-dcfh'),
                'type' => 'select',
                'options' => [
                    'column' => et_builder_i18n('Columns'),
                    'inline' => et_builder_i18n('Inline'),
                ],
                'default' => 'column',
                'show_if' => ['field_type' => 'radio'],
                'option_category' => 'field',
                'toggle_slug' => 'field_options',
            ];
            $custom_fields['radio_columns'] = [
                'label' => __('Number Of Radio Button Columns', 'pwh-dcfh'),
                'description' => __('Choose the number of columns for the radio buttons.', 'pwh-dcfh'),
                /* 'type' => 'select',
                 'options' => [
                     '1' => et_builder_i18n('1 Column'),
                     '2' => et_builder_i18n('2 Column'),
                     '3' => et_builder_i18n('3 Column'),
                     '4' => et_builder_i18n('4 Column'),
                 ],
                 'default' => '1',*/
                'type' => 'range',
                'range_settings' => [
                    'min' => '1',
                    'max' => '4',
                    'step' => '1',
                    'min_limit' => 1,
                    'max_limit' => 3,
                ],
                'unitless' => true,
                'fixed_range' => true,
                'default' => '1',
                'show_if' => ['field_type' => 'radio', 'radio_layout' => 'column'],
                'mobile_options' => true,
                'option_category' => 'field',
                'toggle_slug' => 'field_options',
            ];
            //==================================================
            // Message Box Height
            //==================================================
            $custom_fields['textarea_min_height'] = [
                'label' => __('Message Textarea Minimum Height', 'pwh-dcfh'),
                'description' => __('Choose to adjust the default height of the message box.', 'pwh-dcfh'),
                'type' => 'range',
                'range_settings' => [
                    'min' => '0',
                    'max' => '800',
                    'step' => '10',
                    'min_limit' => 0,
                    'max_limit' => 800,
                ],
                'fixed_unit' => 'px',
                'validate_unit' => true,
                'fixed_range' => true,
                'default' => '150px',
                'mobile_options' => true,
                'option_category' => 'basic_option',
                'show_if' => ['use_field_html' => 'off', 'field_type' => 'text'],
                'toggle_slug' => 'field_options',
            ];
            // HTML Field Design Settings
            $custom_fields['html_wrapper_margin'] = [
                'label' => __('Wrapper 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,
                'show_if' => ['use_field_html' => 'on'],
                'toggle_slug' => 'field_html_toggle',
                'sub_toggle' => 'wrapper_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['html_wrapper_padding'] = [
                'label' => __('Wrapper 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,
                'show_if' => ['use_field_html' => 'on'],
                'toggle_slug' => 'field_html_toggle',
                'sub_toggle' => 'wrapper_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['html_wrapper_background'] = [
                'label' => __('Wrapper 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,
                'show_if' => ['use_field_html' => 'on'],
                'toggle_slug' => 'field_html_toggle',
                'sub_toggle' => 'wrapper_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['html_wrapper_border'] = [
                'label' => __('Wrapper 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,
                'show_if' => ['use_field_html' => 'on'],
                'toggle_slug' => 'field_html_toggle',
                'sub_toggle' => 'wrapper_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['html_wrapper_border_color'] = [
                'label' => __('Wrapper 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,
                'show_if' => ['use_field_html' => 'on'],
                'toggle_slug' => 'field_html_toggle',
                'sub_toggle' => 'wrapper_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['html_wrapper_border_width'] = [
                'label' => __('Wrapper 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,
                'show_if' => ['use_field_html' => 'on'],
                'toggle_slug' => 'field_html_toggle',
                'sub_toggle' => 'wrapper_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['html_wrapper_border_style'] = [
                'label' => __('Wrapper 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,
                'show_if' => ['use_field_html' => 'on'],
                'toggle_slug' => 'field_html_toggle',
                'sub_toggle' => 'wrapper_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['html_wrapper_shadow'] = [
                'label' => __('Wrapper 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('html_wrapper'),
                'default' => 'none',
                'show_if' => ['use_field_html' => 'on'],
                'toggle_slug' => 'field_html_toggle',
                'sub_toggle' => 'wrapper_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['html_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' => [
                    'html_wrapper_shadow',
                    [
                        'none' => '',
                        'preset1' => '0px',
                        'preset2' => '6px',
                        'preset3' => '0px',
                        'preset4' => '10px',
                        'preset5' => '0px',
                        'preset6' => '0px',
                        'preset7' => '10px',
                    ]
                ],
                'show_if_not' => ['html_wrapper_shadow' => 'none'],
                'toggle_slug' => 'field_html_toggle',
                'sub_toggle' => 'wrapper_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['html_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' => [
                    'html_wrapper_shadow',
                    [
                        'none' => '',
                        'preset1' => '2px',
                        'preset2' => '6px',
                        'preset3' => '12px',
                        'preset4' => '10px',
                        'preset5' => '6px',
                        'preset6' => '0px',
                        'preset7' => '10px',
                    ]
                ],
                'show_if_not' => ['html_wrapper_shadow' => 'none'],
                'toggle_slug' => 'field_html_toggle',
                'sub_toggle' => 'wrapper_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['html_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' => 0,
                    'max_limit' => 80,
                ],
                'allowed_units' => et_builder_get_acceptable_css_string_values('font-size'),
                'default_unit' => 'px',
                'fixed_range' => true,
                'default' => [
                    'html_wrapper_shadow',
                    [
                        'none' => '',
                        'preset1' => '18px',
                        'preset2' => '18px',
                        'preset3' => '18px',
                        'preset4' => '0px',
                        'preset5' => '0px',
                        'preset6' => '18px',
                        'preset7' => '0px',
                    ]
                ],
                'show_if_not' => ['html_wrapper_shadow' => 'none'],
                'toggle_slug' => 'field_html_toggle',
                'sub_toggle' => 'wrapper_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['html_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' => [
                    'html_wrapper_shadow',
                    [
                        'none' => '',
                        'preset1' => '0px',
                        'preset2' => '0px',
                        'preset3' => '6px',
                        'preset4' => '0px',
                        'preset5' => '10px',
                        'preset6' => '0px',
                        'preset7' => '0px',
                    ]
                ],
                'show_if_not' => ['html_wrapper_shadow' => 'none'],
                'toggle_slug' => 'field_html_toggle',
                'sub_toggle' => 'wrapper_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['html_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' => ['html_wrapper_shadow' => 'none'],
                'toggle_slug' => 'field_html_toggle',
                'sub_toggle' => 'wrapper_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['html_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' => [
                    'html_wrapper_shadow',
                    [
                        'none' => '',
                        'preset1' => '',
                        'preset2' => '',
                        'preset3' => '',
                        'preset4' => '',
                        'preset5' => '',
                        'preset6' => 'inset',
                        'preset7' => 'inset',
                    ]
                ],
                'show_if_not' => ['html_wrapper_shadow' => 'none'],
                'toggle_slug' => 'field_html_toggle',
                'sub_toggle' => 'wrapper_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['html_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,
                'show_if' => ['use_field_html' => 'on'],
                'toggle_slug' => 'field_html_toggle',
                'sub_toggle' => 'heading_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['html_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,
                'show_if' => ['use_field_html' => 'on'],
                'toggle_slug' => 'field_html_toggle',
                'sub_toggle' => 'heading_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['html_heading_size'] = [
                'label' => __('Heading Text Size', 'pwh-dcfh'),
                'type' => 'range',
                'description' => __('Increase or decrease the size of the heading 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,
                'show_if' => ['use_field_html' => 'on'],
                'toggle_slug' => 'field_html_toggle',
                'sub_toggle' => 'heading_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['html_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,
                'show_if' => ['use_field_html' => 'on'],
                'toggle_slug' => 'field_html_toggle',
                'sub_toggle' => 'heading_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['html_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,
                'show_if' => ['use_field_html' => 'on'],
                'toggle_slug' => 'field_html_toggle',
                'sub_toggle' => 'heading_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['html_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,
                'show_if' => ['use_field_html' => 'on'],
                'toggle_slug' => 'field_html_toggle',
                'sub_toggle' => 'heading_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['html_heading_margin'] = [
                'label' => __('Heading 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,
                'show_if' => ['use_field_html' => 'on'],
                'toggle_slug' => 'field_html_toggle',
                'sub_toggle' => 'heading_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['html_heading_padding'] = [
                'label' => __('Heading 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,
                'show_if' => ['use_field_html' => 'on'],
                'toggle_slug' => 'field_html_toggle',
                'sub_toggle' => 'heading_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['html_heading_background'] = [
                'label' => __('Heading 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,
                'show_if' => ['use_field_html' => 'on'],
                'toggle_slug' => 'field_html_toggle',
                'sub_toggle' => 'heading_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['html_heading_border'] = [
                'label' => __('Heading 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,
                'show_if' => ['use_field_html' => 'on'],
                'toggle_slug' => 'field_html_toggle',
                'sub_toggle' => 'heading_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['html_heading_border_color'] = [
                'label' => __('Heading 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,
                'show_if' => ['use_field_html' => 'on'],
                'toggle_slug' => 'field_html_toggle',
                'sub_toggle' => 'heading_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['html_heading_border_width'] = [
                'label' => __('Heading 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,
                'show_if' => ['use_field_html' => 'on'],
                'toggle_slug' => 'field_html_toggle',
                'sub_toggle' => 'heading_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['html_heading_border_style'] = [
                'label' => __('Heading 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,
                'show_if' => ['use_field_html' => 'on'],
                'toggle_slug' => 'field_html_toggle',
                'sub_toggle' => 'heading_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['html_paragraph_font'] = [
                'label' => __('Paragraph Text', 'pwh-dcfh'),
                'type' => 'font',
                'description' => __('Choose a custom font to use for the paragraph. All Google web fonts are available, or you can upload your own custom font files.', 'pwh-dcfh'),
                'default' => '',
                'mobile_options' => true,
                'show_if' => ['use_field_html' => 'on'],
                'toggle_slug' => 'field_html_toggle',
                'sub_toggle' => 'paragraph_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['html_paragraph_color'] = [
                'label' => __('Paragraph Text Color', 'pwh-dcfh'),
                'type' => 'color-alpha',
                'description' => __('Pick a color to be used for the paragraph text.', 'pwh-dcfh'),
                'custom_color' => true,
                'default' => '',
                'mobile_options' => true,
                'show_if' => ['use_field_html' => 'on'],
                'toggle_slug' => 'field_html_toggle',
                'sub_toggle' => 'paragraph_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['html_paragraph_size'] = [
                'label' => __('Paragraph Text Size', 'pwh-dcfh'),
                'type' => 'range',
                'description' => __('Increase or decrease the size of the paragraph 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,
                'show_if' => ['use_field_html' => 'on'],
                'toggle_slug' => 'field_html_toggle',
                'sub_toggle' => 'paragraph_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['html_paragraph_letterspace'] = [
                'label' => __('Paragraph Text Letter Spacing', 'pwh-dcfh'),
                'type' => 'range',
                'description' => __('Letter spacing adjusts the distance between each letter in the paragraph.', '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,
                'show_if' => ['use_field_html' => 'on'],
                'toggle_slug' => 'field_html_toggle',
                'sub_toggle' => 'paragraph_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['html_paragraph_lineheight'] = [
                'label' => __('Paragraph Text Line Height', 'pwh-dcfh'),
                'type' => 'range',
                'description' => __('Line height adjusts the distance between each line of the paragraph text. This becomes noticeable if the paragraph 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,
                'show_if' => ['use_field_html' => 'on'],
                'toggle_slug' => 'field_html_toggle',
                'sub_toggle' => 'paragraph_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['html_paragraph_alignment'] = [
                'label' => __('Paragraph Alignment', 'pwh-dcfh'),
                'type' => 'align',
                'description' => __('Align the paragraph to the left, right, center or justify.', 'pwh-dcfh'),
                'options' => et_builder_get_text_orientation_options(),
                'advanced_fields' => true,
                'mobile_options' => true,
                'show_if' => ['use_field_html' => 'on'],
                'toggle_slug' => 'field_html_toggle',
                'sub_toggle' => 'paragraph_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['html_paragraph_margin'] = [
                'label' => __('Paragraph 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,
                'show_if' => ['use_field_html' => 'on'],
                'toggle_slug' => 'field_html_toggle',
                'sub_toggle' => 'paragraph_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['html_paragraph_padding'] = [
                'label' => __('Paragraph 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,
                'show_if' => ['use_field_html' => 'on'],
                'toggle_slug' => 'field_html_toggle',
                'sub_toggle' => 'paragraph_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['html_paragraph_background'] = [
                'label' => __('Paragraph 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,
                'show_if' => ['use_field_html' => 'on'],
                'toggle_slug' => 'field_html_toggle',
                'sub_toggle' => 'paragraph_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['html_paragraph_border'] = [
                'label' => __('Paragraph 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,
                'show_if' => ['use_field_html' => 'on'],
                'toggle_slug' => 'field_html_toggle',
                'sub_toggle' => 'paragraph_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['html_paragraph_border_color'] = [
                'label' => __('Paragraph 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,
                'show_if' => ['use_field_html' => 'on'],
                'toggle_slug' => 'field_html_toggle',
                'sub_toggle' => 'paragraph_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['html_paragraph_border_width'] = [
                'label' => __('Paragraph 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,
                'show_if' => ['use_field_html' => 'on'],
                'toggle_slug' => 'field_html_toggle',
                'sub_toggle' => 'paragraph_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['html_paragraph_border_style'] = [
                'label' => __('Paragraph 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,
                'show_if' => ['use_field_html' => 'on'],
                'toggle_slug' => 'field_html_toggle',
                'sub_toggle' => 'paragraph_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['html_link_font'] = [
                'label' => __('Link Text', 'pwh-dcfh'),
                'type' => 'font',
                'description' => __('Choose a custom font to use for the paragraph. All Google web fonts are available, or you can upload your own custom font files.', 'pwh-dcfh'),
                'default' => '',
                'mobile_options' => true,
                'show_if' => ['use_field_html' => 'on'],
                'toggle_slug' => 'field_html_toggle',
                'sub_toggle' => 'link_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['html_link_color'] = [
                'label' => __('Link Text Color', 'pwh-dcfh'),
                'type' => 'color-alpha',
                'description' => __('Pick a color to be used for the paragraph text.', 'pwh-dcfh'),
                'custom_color' => true,
                'default' => '',
                'mobile_options' => true,
                'hover' => 'tabs',
                'show_if' => ['use_field_html' => 'on'],
                'toggle_slug' => 'field_html_toggle',
                'sub_toggle' => 'link_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['html_link_size'] = [
                'label' => __('Link Text Size', 'pwh-dcfh'),
                'type' => 'range',
                'description' => __('Increase or decrease the size of the paragraph 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,
                'show_if' => ['use_field_html' => 'on'],
                'toggle_slug' => 'field_html_toggle',
                'sub_toggle' => 'link_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['html_link_letterspace'] = [
                'label' => __('Link Text Letter Spacing', 'pwh-dcfh'),
                'type' => 'range',
                'description' => __('Letter spacing adjusts the distance between each letter in the paragraph.', '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,
                'show_if' => ['use_field_html' => 'on'],
                'toggle_slug' => 'field_html_toggle',
                'sub_toggle' => 'link_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['html_link_lineheight'] = [
                'label' => __('Link Text Line Height', 'pwh-dcfh'),
                'type' => 'range',
                'description' => __('Line height adjusts the distance between each line of the paragraph text. This becomes noticeable if the paragraph 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,
                'show_if' => ['use_field_html' => 'on'],
                'toggle_slug' => 'field_html_toggle',
                'sub_toggle' => 'link_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['html_link_margin'] = [
                'label' => __('Link 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,
                'show_if' => ['use_field_html' => 'on'],
                'toggle_slug' => 'field_html_toggle',
                'sub_toggle' => 'link_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['html_link_padding'] = [
                'label' => __('Link 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,
                'show_if' => ['use_field_html' => 'on'],
                'toggle_slug' => 'field_html_toggle',
                'sub_toggle' => 'link_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['html_link_background'] = [
                'label' => __('Link 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',
                'show_if' => ['use_field_html' => 'on'],
                'toggle_slug' => 'field_html_toggle',
                'sub_toggle' => 'link_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['html_link_border'] = [
                'label' => __('Link 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,
                'show_if' => ['use_field_html' => 'on'],
                'toggle_slug' => 'field_html_toggle',
                'sub_toggle' => 'link_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['html_link_border_color'] = [
                'label' => __('Link 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,
                'show_if' => ['use_field_html' => 'on'],
                'toggle_slug' => 'field_html_toggle',
                'sub_toggle' => 'link_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['html_link_border_width'] = [
                'label' => __('Link 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,
                'show_if' => ['use_field_html' => 'on'],
                'toggle_slug' => 'field_html_toggle',
                'sub_toggle' => 'link_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['html_link_border_style'] = [
                'label' => __('Link 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,
                'show_if' => ['use_field_html' => 'on'],
                'toggle_slug' => 'field_html_toggle',
                'sub_toggle' => 'link_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['html_image_width'] = [
                'label' => __('Image Width', 'pwh-dcfh'),
                'description' => __('Set a custom width for the HTML field image.', 'pwh-dcfh'),
                'type' => 'range',
                'default' => '',
                'range_settings' => [
                    'min' => '0',
                    'max' => '1200',
                    'step' => '1',
                ],
                'mobile_options' => true,
                'validate_unit' => true,
                'allowed_units' => et_builder_get_acceptable_css_string_values('font-size'),
                'show_if' => ['use_field_html' => 'on'],
                'toggle_slug' => 'field_html_toggle',
                'sub_toggle' => 'image_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['html_image_height'] = [
                'label' => __('Image Height', 'pwh-dcfh'),
                'description' => __('Set a custom height for the HTML field image.', 'pwh-dcfh'),
                'type' => 'range',
                'default' => '',
                'range_settings' => [
                    'min' => '0',
                    'max' => '1200',
                    'step' => '1',
                ],
                'mobile_options' => true,
                'validate_unit' => true,
                'allowed_units' => et_builder_get_acceptable_css_string_values('font-size'),
                'show_if' => ['use_field_html' => 'on'],
                'toggle_slug' => 'field_html_toggle',
                'sub_toggle' => 'image_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['html_image_fit'] = [
                'label' => __('Image Fit', 'pwh-dcfh'),
                'type' => 'select',
                'description' => __('Choose how the image should fit within its container.', 'pwh-dcfh'),
                'options' => ['contain' => 'Contain', 'cover' => 'Cover'],
                'default' => 'contain',
                'mobile_options' => true,
                'show_if' => ['use_field_html' => 'on'],
                'toggle_slug' => 'field_html_toggle',
                'sub_toggle' => 'image_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['html_image_margin'] = [
                'label' => __('Image 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,
                'show_if' => ['use_field_html' => 'on'],
                'toggle_slug' => 'field_html_toggle',
                'sub_toggle' => 'image_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['html_image_padding'] = [
                'label' => __('Image 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,
                'show_if' => ['use_field_html' => 'on'],
                'toggle_slug' => 'field_html_toggle',
                'sub_toggle' => 'image_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['html_image_border'] = [
                'label' => __('Image 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,
                'show_if' => ['use_field_html' => 'on'],
                'toggle_slug' => 'field_html_toggle',
                'sub_toggle' => 'image_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['html_image_alignment'] = [
                'label' => __('Image Alignment', 'pwh-dcfh'),
                'type' => 'align',
                'description' => __('Align the image to the left, right or center.', 'pwh-dcfh'),
                'options' => et_builder_get_text_orientation_options(['justified']),
                'advanced_fields' => true,
                'mobile_options' => true,
                'show_if' => ['use_field_html' => 'on'],
                'toggle_slug' => 'field_html_toggle',
                'sub_toggle' => 'image_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['html_image_border_color'] = [
                'label' => __('Image 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,
                'show_if' => ['use_field_html' => 'on'],
                'toggle_slug' => 'field_html_toggle',
                'sub_toggle' => 'image_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['html_image_border_width'] = [
                'label' => __('Image 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,
                'show_if' => ['use_field_html' => 'on'],
                'toggle_slug' => 'field_html_toggle',
                'sub_toggle' => 'image_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['html_image_border_style'] = [
                'label' => __('Image 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,
                'show_if' => ['use_field_html' => 'on'],
                'toggle_slug' => 'field_html_toggle',
                'sub_toggle' => 'image_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['html_image_shadow'] = [
                'label' => __('Image 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('html_image'),
                'default' => 'none',
                'show_if' => ['use_field_html' => 'on'],
                'toggle_slug' => 'field_html_toggle',
                'sub_toggle' => 'image_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['html_image_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' => [
                    'html_image_shadow',
                    [
                        'none' => '',
                        'preset1' => '0px',
                        'preset2' => '6px',
                        'preset3' => '0px',
                        'preset4' => '10px',
                        'preset5' => '0px',
                        'preset6' => '0px',
                        'preset7' => '10px',
                    ]
                ],
                'show_if_not' => ['html_image_shadow' => 'none'],
                'toggle_slug' => 'field_html_toggle',
                'sub_toggle' => 'image_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['html_image_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' => [
                    'html_image_shadow',
                    [
                        'none' => '',
                        'preset1' => '2px',
                        'preset2' => '6px',
                        'preset3' => '12px',
                        'preset4' => '10px',
                        'preset5' => '6px',
                        'preset6' => '0px',
                        'preset7' => '10px',
                    ]
                ],
                'show_if_not' => ['html_image_shadow' => 'none'],
                'toggle_slug' => 'field_html_toggle',
                'sub_toggle' => 'image_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['html_image_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' => [
                    'html_image_shadow',
                    [
                        'none' => '',
                        'preset1' => '18px',
                        'preset2' => '18px',
                        'preset3' => '18px',
                        'preset4' => '0px',
                        'preset5' => '0px',
                        'preset6' => '18px',
                        'preset7' => '0px',
                    ]
                ],
                'show_if_not' => ['html_image_shadow' => 'none'],
                'toggle_slug' => 'field_html_toggle',
                'sub_toggle' => 'image_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['html_image_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' => [
                    'html_image_shadow',
                    [
                        'none' => '',
                        'preset1' => '0px',
                        'preset2' => '0px',
                        'preset3' => '6px',
                        'preset4' => '0px',
                        'preset5' => '10px',
                        'preset6' => '0px',
                        'preset7' => '0px',
                    ]
                ],
                'show_if_not' => ['html_image_shadow' => 'none'],
                'toggle_slug' => 'field_html_toggle',
                'sub_toggle' => 'image_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['html_image_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' => ['html_image_shadow' => 'none'],
                'toggle_slug' => 'field_html_toggle',
                'sub_toggle' => 'image_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['html_image_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' => [
                    'html_image_shadow',
                    [
                        'none' => '',
                        'preset1' => '',
                        'preset2' => '',
                        'preset3' => '',
                        'preset4' => '',
                        'preset5' => '',
                        'preset6' => 'inset',
                        'preset7' => 'inset',
                    ]
                ],
                'show_if_not' => ['html_image_shadow' => 'none'],
                'toggle_slug' => 'field_html_toggle',
                'sub_toggle' => 'image_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['html_divider_width'] = [
                'label' => __('Divider Width', 'pwh-dcfh'),
                'type' => 'range',
                'description' => __('Increasing the width of the border will increase its size/thickness.', 'pwh-dcfh'),
                'fixed_unit' => '%',
                'validate_unit' => true,
                'fixed_range' => true,
                'range_settings' => [
                    'min' => '1',
                    'max' => '100',
                    'step' => '1',
                    'min_limit' => 1,
                    'max_limit' => 100,
                ],
                'default' => '100%',
                'mobile_options' => true,
                'show_if' => ['use_field_html' => 'on'],
                'toggle_slug' => 'field_html_toggle',
                'sub_toggle' => 'divider_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['html_divider_height'] = [
                'label' => __('Divider Height', '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' => '100',
                    'step' => '1',
                    'min_limit' => 1,
                    'max_limit' => 100,
                ],
                'default' => '1px',
                'mobile_options' => true,
                'show_if' => ['use_field_html' => 'on'],
                'toggle_slug' => 'field_html_toggle',
                'sub_toggle' => 'divider_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['html_divider_color'] = [
                'label' => __('Divider Color', 'pwh-dcfh'),
                'type' => 'color',
                'description' => __('Pick a color to be used for the border.', 'pwh-dcfh'),
                'custom_color' => true,
                'default' => '#000000',
                'mobile_options' => true,
                'show_if' => ['use_field_html' => 'on'],
                'toggle_slug' => 'field_html_toggle',
                'sub_toggle' => 'divider_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['html_divider_margin'] = [
                'label' => __('Divider 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,
                'show_if' => ['use_field_html' => 'on'],
                'toggle_slug' => 'field_html_toggle',
                'sub_toggle' => 'divider_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['html_divider_padding'] = [
                'label' => __('Divider 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,
                'show_if' => ['use_field_html' => 'on'],
                'toggle_slug' => 'field_html_toggle',
                'sub_toggle' => 'divider_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['html_divider_shadow'] = [
                'label' => __('Divider 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('html_divider'),
                'default' => 'none',
                'toggle_slug' => 'field_html_toggle',
                'sub_toggle' => 'divider_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['html_divider_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' => [
                    'html_divider_shadow',
                    [
                        'none' => '',
                        'preset1' => '0px',
                        'preset2' => '6px',
                        'preset3' => '0px',
                        'preset4' => '10px',
                        'preset5' => '0px',
                        'preset6' => '0px',
                        'preset7' => '10px',
                    ]
                ],
                'show_if_not' => ['html_divider_shadow' => 'none'],
                'toggle_slug' => 'field_html_toggle',
                'sub_toggle' => 'divider_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['html_divider_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' => [
                    'html_divider_shadow',
                    [
                        'none' => '',
                        'preset1' => '2px',
                        'preset2' => '6px',
                        'preset3' => '12px',
                        'preset4' => '10px',
                        'preset5' => '6px',
                        'preset6' => '0px',
                        'preset7' => '10px',
                    ]
                ],
                'show_if_not' => ['html_divider_shadow' => 'none'],
                'toggle_slug' => 'field_html_toggle',
                'sub_toggle' => 'divider_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['html_divider_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' => [
                    'html_divider_shadow',
                    [
                        'none' => '',
                        'preset1' => '18px',
                        'preset2' => '18px',
                        'preset3' => '18px',
                        'preset4' => '0px',
                        'preset5' => '0px',
                        'preset6' => '18px',
                        'preset7' => '0px',
                    ]
                ],
                'show_if_not' => ['html_divider_shadow' => 'none'],
                'toggle_slug' => 'field_html_toggle',
                'sub_toggle' => 'divider_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['html_divider_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' => [
                    'html_divider_shadow',
                    [
                        'none' => '',
                        'preset1' => '0px',
                        'preset2' => '0px',
                        'preset3' => '6px',
                        'preset4' => '0px',
                        'preset5' => '10px',
                        'preset6' => '0px',
                        'preset7' => '0px',
                    ]
                ],
                'show_if_not' => ['html_divider_shadow' => 'none'],
                'toggle_slug' => 'field_html_toggle',
                'sub_toggle' => 'divider_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['html_divider_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' => ['html_divider_shadow' => 'none'],
                'toggle_slug' => 'field_html_toggle',
                'sub_toggle' => 'divider_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['html_divider_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' => [
                    'html_divider_shadow',
                    [
                        'none' => '',
                        'preset1' => '',
                        'preset2' => '',
                        'preset3' => '',
                        'preset4' => '',
                        'preset5' => '',
                        'preset6' => 'inset',
                        'preset7' => 'inset',
                    ]
                ],
                'show_if_not' => ['html_divider_shadow' => 'none'],
                'toggle_slug' => 'field_html_toggle',
                'sub_toggle' => 'divider_toggle',
                'tab_slug' => 'advanced',
            ];
            //==================================================
            // Signature Pad Design Settings
            //==================================================
            $custom_fields['sp_width'] = [
                'label' => __('Signature Pad Width', 'pwh-dcfh'),
                'type' => 'range',
                'description' => __('Set the width of the signature pad.', 'pwh-dcfh'),
                'fixed_unit' => 'px',
                'validate_unit' => true,
                'fixed_range' => true,
                'range_settings' => [
                    'min' => '1',
                    'max' => '1080',
                    'step' => '1',
                    'min_limit' => 1,
                    'max_limit' => 1080,
                ],
                'default' => '',
                'mobile_options' => false,
                'sub_toggle' => 'pad_toggle',
                'toggle_slug' => 'signature_pad_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['sp_height'] = [
                'label' => __('Signature Pad Height', 'pwh-dcfh'),
                'type' => 'range',
                'description' => __('Set the height of the signature pad.', 'pwh-dcfh'),
                'fixed_unit' => 'px',
                'validate_unit' => true,
                'fixed_range' => true,
                'range_settings' => [
                    'min' => '1',
                    'max' => '800',
                    'step' => '1',
                    'min_limit' => 1,
                    'max_limit' => 800,
                ],
                'default' => '150px',
                'mobile_options' => false,
                'sub_toggle' => 'pad_toggle',
                'toggle_slug' => 'signature_pad_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['sp_background_color'] = [
                'label' => __('Signature Pad Background Color', 'pwh-dcfh'),
                'type' => 'color-alpha',
                'description' => __('Set a color for the background of the signature pad.', 'pwh-dcfh'),
                'custom_color' => true,
                'default' => '#eee',
                'mobile_options' => false,
                'sub_toggle' => 'pad_toggle',
                'toggle_slug' => 'signature_pad_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['sp_pen_color'] = [
                'label' => __('Signature Pad Pen Color', 'pwh-dcfh'),
                'type' => 'color-alpha',
                'description' => __('Set a color for the signature pad pen.', 'pwh-dcfh'),
                'custom_color' => true,
                'default' => '#000000',
                'mobile_options' => false,
                'sub_toggle' => 'pad_toggle',
                'toggle_slug' => 'signature_pad_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['sp_pen_thickness'] = [
                'label' => __('Signature Pad Pen Thickness', 'pwh-dcfh'),
                'type' => 'range',
                'description' => __('Set a max thickness for the signature pad pen.', 'pwh-dcfh'),
                'fixed_unit' => 'px',
                'unitless' => true,
                'range_settings' => [
                    'min' => '1',
                    'max' => '12',
                    'step' => '1',
                    'min_limit' => 1,
                    'max_limit' => 12,
                ],
                'default' => '2',
                'mobile_options' => false,
                'sub_toggle' => 'pad_toggle',
                'toggle_slug' => 'signature_pad_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['sp_margin'] = [
                'label' => __('Signature Pad 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' => false,
                'sub_toggle' => 'pad_toggle',
                'toggle_slug' => 'signature_pad_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['sp_padding'] = [
                'label' => __('Signature Pad 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,
                'sub_toggle' => 'pad_toggle',
                'toggle_slug' => 'signature_pad_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['sp_border'] = [
                'label' => __('Signature Pad 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,
                'sub_toggle' => 'pad_toggle',
                'toggle_slug' => 'signature_pad_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['sp_border_color'] = [
                'label' => __('Signature Pad Border Color', 'pwh-dcfh'),
                'type' => 'color',
                'description' => __('Pick a color to be used for the border.', 'pwh-dcfh'),
                'custom_color' => true,
                'default' => '#fff',
                'mobile_options' => true,
                'sub_toggle' => 'pad_toggle',
                'toggle_slug' => 'signature_pad_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['sp_border_width'] = [
                'label' => __('Signature Pad 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' => '0px',
                'mobile_options' => true,
                'sub_toggle' => 'pad_toggle',
                'toggle_slug' => 'signature_pad_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['sp_border_style'] = [
                'label' => __('Signature Pad 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,
                'sub_toggle' => 'pad_toggle',
                'toggle_slug' => 'signature_pad_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['sp_shadow'] = [
                'label' => __('Signature Pad 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('sp'),
                'default' => 'none',
                'sub_toggle' => 'pad_toggle',
                'toggle_slug' => 'signature_pad_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['sp_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' => [
                    'sp_shadow',
                    [
                        'none' => '',
                        'preset1' => '0px',
                        'preset2' => '6px',
                        'preset3' => '0px',
                        'preset4' => '10px',
                        'preset5' => '0px',
                        'preset6' => '0px',
                        'preset7' => '10px',
                    ]
                ],
                'show_if_not' => ['sp_shadow' => 'none'],
                'sub_toggle' => 'pad_toggle',
                'toggle_slug' => 'signature_pad_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['sp_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' => [
                    'sp_shadow',
                    [
                        'none' => '',
                        'preset1' => '2px',
                        'preset2' => '6px',
                        'preset3' => '12px',
                        'preset4' => '10px',
                        'preset5' => '6px',
                        'preset6' => '0px',
                        'preset7' => '10px',
                    ]
                ],
                'show_if_not' => ['sp_shadow' => 'none'],
                'sub_toggle' => 'pad_toggle',
                'toggle_slug' => 'signature_pad_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['sp_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' => [
                    'sp_shadow',
                    [
                        'none' => '',
                        'preset1' => '18px',
                        'preset2' => '18px',
                        'preset3' => '18px',
                        'preset4' => '0px',
                        'preset5' => '0px',
                        'preset6' => '18px',
                        'preset7' => '0px',
                    ]
                ],
                'show_if_not' => ['sp_shadow' => 'none'],
                'sub_toggle' => 'pad_toggle',
                'toggle_slug' => 'signature_pad_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['sp_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' => [
                    'sp_shadow',
                    [
                        'none' => '',
                        'preset1' => '0px',
                        'preset2' => '0px',
                        'preset3' => '6px',
                        'preset4' => '0px',
                        'preset5' => '10px',
                        'preset6' => '0px',
                        'preset7' => '0px',
                    ]
                ],
                'show_if_not' => ['sp_shadow' => 'none'],
                'sub_toggle' => 'pad_toggle',
                'toggle_slug' => 'signature_pad_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['sp_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' => ['sp_shadow' => 'none'],
                'sub_toggle' => 'pad_toggle',
                'toggle_slug' => 'signature_pad_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['sp_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' => [
                    'sp_shadow',
                    [
                        'none' => '',
                        'preset1' => '',
                        'preset2' => '',
                        'preset3' => '',
                        'preset4' => '',
                        'preset5' => '',
                        'preset6' => 'inset',
                        'preset7' => 'inset',
                    ]
                ],
                'show_if_not' => ['sp_shadow' => 'none'],
                'sub_toggle' => 'pad_toggle',
                'toggle_slug' => 'signature_pad_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['sp_save_btn_font'] = [
                'label' => __('Save Button Font', 'pwh-dcfh'),
                'type' => 'font',
                'description' => __('Choose a custom font to use for the button. All Google web fonts are available, or you can upload your own custom font files.', 'pwh-dcfh'),
                'default' => '',
                'mobile_options' => true,
                'sub_toggle' => 'save_toggle',
                'toggle_slug' => 'signature_pad_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['sp_save_btn_font_size'] = [
                'label' => __('Save Button Font Size', 'pwh-dcfh'),
                'type' => 'range',
                'description' => __('Increase or decrease the size of the save button label.', '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' => '14px',
                'mobile_options' => true,
                'sub_toggle' => 'save_toggle',
                'toggle_slug' => 'signature_pad_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['sp_save_btn_background_color'] = [
                'label' => __('Save Button Background Color', 'pwh-dcfh'),
                'type' => 'color-alpha',
                'description' => __('Set a color for the background of the save button.', 'pwh-dcfh'),
                'custom_color' => true,
                'default' => '#2ea3f2',
                'hover' => 'tabs',
                'mobile_options' => false,
                'sub_toggle' => 'save_toggle',
                'toggle_slug' => 'signature_pad_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['sp_save_btn_color'] = [
                'label' => __('Save Button Color', 'pwh-dcfh'),
                'type' => 'color-alpha',
                'description' => __('Set a color for the save button pen.', 'pwh-dcfh'),
                'custom_color' => true,
                'default' => '#fff',
                'mobile_options' => false,
                'hover' => 'tabs',
                'sub_toggle' => 'save_toggle',
                'toggle_slug' => 'signature_pad_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['sp_save_btn_padding'] = [
                'label' => __('Save 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'),
                'advanced_fields' => true,
                'mobile_options' => true,
                'default' => '3px|10px|3px|10px|false|false',
                'sub_toggle' => 'save_toggle',
                'toggle_slug' => 'signature_pad_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['sp_clear_btn_font'] = [
                'label' => __('Clear Button Font', 'pwh-dcfh'),
                'type' => 'font',
                'description' => __('Choose a custom font to use for the button. All Google web fonts are available, or you can upload your own custom font files.', 'pwh-dcfh'),
                'default' => '',
                'mobile_options' => true,
                'sub_toggle' => 'clear_toggle',
                'toggle_slug' => 'signature_pad_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['sp_clear_btn_font_size'] = [
                'label' => __('Clear Button Font Size', 'pwh-dcfh'),
                'type' => 'range',
                'description' => __('Increase or decrease the size of the save button label.', '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' => '14px',
                'mobile_options' => true,
                'sub_toggle' => 'clear_toggle',
                'toggle_slug' => 'signature_pad_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['sp_clear_btn_background_color'] = [
                'label' => __('Clear Button Background Color', 'pwh-dcfh'),
                'type' => 'color-alpha',
                'description' => __('Set a color for the background of the save button.', 'pwh-dcfh'),
                'custom_color' => true,
                'default' => '#c00',
                'mobile_options' => false,
                'hover' => 'tabs',
                'sub_toggle' => 'clear_toggle',
                'toggle_slug' => 'signature_pad_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['sp_clear_btn_color'] = [
                'label' => __('Clear Button Color', 'pwh-dcfh'),
                'type' => 'color-alpha',
                'description' => __('Set a color for the save button pen.', 'pwh-dcfh'),
                'custom_color' => true,
                'default' => '#fff',
                'mobile_options' => false,
                'hover' => 'tabs',
                'sub_toggle' => 'clear_toggle',
                'toggle_slug' => 'signature_pad_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['sp_clear_btn_padding'] = [
                'label' => __('Clear 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'),
                'advanced_fields' => true,
                'mobile_options' => true,
                'default' => '3px|10px|3px|10px|false|false',
                'sub_toggle' => 'clear_toggle',
                'toggle_slug' => 'signature_pad_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['sp_message_font'] = [
                'label' => __('Message Font', 'pwh-dcfh'),
                'type' => 'font',
                'description' => __('Choose a custom font to use for the button. All Google web fonts are available, or you can upload your own custom font files.', 'pwh-dcfh'),
                'default' => '',
                'mobile_options' => true,
                'sub_toggle' => 'message_toggle',
                'toggle_slug' => 'signature_pad_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['sp_message_font_size'] = [
                'label' => __('Message Font Size', 'pwh-dcfh'),
                'type' => 'range',
                'description' => __('Increase or decrease the size of the message.', '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' => '15px',
                'mobile_options' => true,
                'sub_toggle' => 'message_toggle',
                'toggle_slug' => 'signature_pad_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['sp_message_color'] = [
                'label' => __('Message Color', 'pwh-dcfh'),
                'type' => 'color-alpha',
                'description' => __('Set a color for the message.', 'pwh-dcfh'),
                'custom_color' => true,
                'default' => '#666666',
                'mobile_options' => false,
                'sub_toggle' => 'message_toggle',
                'toggle_slug' => 'signature_pad_toggle',
                'tab_slug' => 'advanced',
            ];
            //==================================================
            // Star Rating Design Settings
            //==================================================
            $custom_fields['star_color'] = [
                'label' => __('Star Color', 'pwh-dcfh'),
                'type' => 'color-alpha',
                'description' => __('Set a color for the star.', 'pwh-dcfh'),
                'custom_color' => true,
                'default' => '#d3d3d3',
                'mobile_options' => false,
                'toggle_slug' => 'star_rating_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['star_checked_color'] = [
                'label' => __('Selected Star Color', 'pwh-dcfh'),
                'type' => 'color-alpha',
                'description' => __('Set a color for the selected star.', 'pwh-dcfh'),
                'custom_color' => true,
                'default' => '#ffa500',
                'mobile_options' => false,
                'toggle_slug' => 'star_rating_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['star_svg_width'] = [
                'label' => __('Star Width', 'pwh-dcfh'),
                'type' => 'range',
                'description' => __('Set the width of the star.', 'pwh-dcfh'),
                'fixed_unit' => 'rem',
                'validate_unit' => true,
                'fixed_range' => true,
                'range_settings' => [
                    'min' => '1',
                    'max' => '10',
                    'step' => '1',
                    'min_limit' => 1,
                    'max_limit' => 10,
                ],
                'default' => '1.8rem',
                'mobile_options' => true,
                'toggle_slug' => 'star_rating_toggle',
                'tab_slug' => 'advanced',
            ];
            $custom_fields['star_svg_height'] = [
                'label' => __('Star Height', 'pwh-dcfh'),
                'type' => 'range',
                'description' => __('Set the height of the star.', 'pwh-dcfh'),
                'fixed_unit' => 'rem',
                'validate_unit' => true,
                'fixed_range' => true,
                'range_settings' => [
                    'min' => '1',
                    'max' => '10',
                    'step' => '1',
                    'min_limit' => 1,
                    'max_limit' => 10,
                ],
                'default' => '1.5rem',
                'mobile_options' => true,
                'toggle_slug' => 'star_rating_toggle',
                'tab_slug' => 'advanced',
            ];

            return wp_parse_args($custom_fields, $fields_unprocessed);
        }

        /**
         * Filter Form Fields HTML Output
         *
         * @param $output
         * @param $render_slug
         * @param $module
         *
         * @throws DOMException
         * @return false|string
         */
        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_field' !== $render_slug) {
                return $output;
            }
            $props = $module->props;
            // Module Order Class
            $module_order_class = ET_Builder_Element::get_module_order_class($render_slug);
            // Field
            $field_type = $props['field_type'];
            $field_layout_obj = new PWH_DCFH_Field_Layout($render_slug, $output, $props);
            // Add Label For Hidden Conditional Input
            $field_layout_obj->add_conditional_hidden_input_label();
            // Field Layout
            $output = $field_layout_obj->field_desc_placeholder();
            $field_layout_obj->show_hide_field_label_placeholder();
            $use_field_icon = $props['use_field_icon'] ?? 'off';
            $field_icon = $props['field_icon'] ?? 'off';
            if ('off' !== $use_field_icon && 'off' !== $field_icon) {
                $output = $field_layout_obj->field_icon();
            }
            // TextArea Height CSS & Validation
            if ('text' === $field_type) {
                $field_textarea_obj = new PWH_DCFH_Field_Textarea_Validation($render_slug, $output, $props);
                $field_layout_obj->input_textarea_css();
                $output = $field_textarea_obj->output();
            }
            // Modify Checkboxes
            if ('checkbox' === $field_type) {
                $field_layout_obj->input_checkbox_css();
            }
            // Modify Radio
            if ('radio' === $field_type) {
                $field_layout_obj->input_radio_css();
            }
            // File Upload
            if ('input' === $field_type && isset($props['use_file_upload']) && 'on' === $props['use_file_upload']) {
                $field_upload_obj = new PWH_DCFH_Field_File_Upload($render_slug, $output, $props);
                $output = $field_upload_obj->output();
            }
            // Datetime Picker
            if ('input' === $field_type && isset($props['use_datetime']) && 'on' === $props['use_datetime']) {
                $field_datetime_obj = new PWH_DCFH_Field_Date_Time($render_slug, $output, $props);
                $field_datetime_obj->field_order_class = $module_order_class;
                $output = $field_datetime_obj->output();
            }
            // Select2
            if (isset($props['use_dropdown_search']) && 'on' === $props['use_dropdown_search']) {
                $field_select_obj = new PWH_DCFH_Field_Select($render_slug, $output, $props);
                $output = $field_select_obj->output();
            }
            // HTML Field
            if (isset($props['use_field_html']) && 'on' === $props['use_field_html']) {
                $field_html_obj = new PWH_DCFH_Field_HTML($render_slug, $output, $props);
                $output = $field_html_obj->output();
                $field_html_obj->css();
            }
            // Signature Pad
            if (isset($props['use_signature_pad']) && 'on' === $props['use_signature_pad']) {
                $signature_pad_obj = new PWH_DCFH_Signature_Pad($render_slug, $output, $props);
                $output = $signature_pad_obj->output();
                $signature_pad_obj->css();
            }
            // Star Rating
            if (isset($props['use_star_rating']) && 'on' === $props['use_star_rating']) {
                $star_rating_obj = new PWH_DCFH_Star_Rating($render_slug, $output, $props);
                $output = $star_rating_obj->output();
                $star_rating_obj->css();
            }
            // Misc Fields Modification
            $misc_field_obj = new PWH_DCFH_Modify_Misc_Field($render_slug, $output, $props);
            $output = $misc_field_obj->output();

            return $output;
        }
    }
}