<?php
/**
 * Elementor WP Form Widget.
 *
 * Elementor widget that inserts an embbedable content into the page, from any given URL.
 *
 * @since 1.0.5
 */
class Elementor_WP_Form_Widget extends \Elementor\Widget_Base {

	/**
	 * Get widget name.
	 *
	 * Retrieve WP Form widget name.
	 *
	 * @since 1.0.5
	 * @access public
	 *
	 * @return string Widget name.
	 */
	public function get_name() {
		return 'wp-form';
	}

	/**
	 * Get widget title.
	 *
	 * Retrieve WP Form widget title.
	 *
	 * @since 1.0.5
	 * @access public
	 *
	 * @return string Widget title.
	 */
	public function get_title() {
		return __( 'WP Forms', 'endless-addons' );
	}

	/**
	 * Get widget icon.
	 *
	 * Retrieve WP Form widget icon.
	 *
	 * @since 1.0.5
	 * @access public
	 *
	 * @return string Widget icon.
	 */
	public function get_icon() {
		return 'fa fa-wpforms';
	}

	/**
	 * Get widget categories.
	 *
	 * Retrieve the list of categories the WP Form widget belongs to.
	 *
	 * @since 1.0.5
	 * @access public
	 *
	 * @return array Widget categories.
	 */
	public function get_categories() {
		return [ 'endless-elements' ];
	}

	/**
	 * Register WP Form widget controls.
	 *
	 * Adds different input fields to allow the user to change and customize the widget settings.
	 *
	 * @since 1.0.5
	 * @access protected
	 */
	protected function register_controls() {

		$this->start_controls_section(
			'default_section',
			[    
				'label' => __( 'Settings', 'endless-addons' ),
				'tab' => \Elementor\Controls_Manager::TAB_CONTENT
			]
		);

		$this->add_control(
			'show_wp_form',
			[
				'label' => __( 'Show/Hide WP Form Section', 'endless-addons' ),
				'type' => \Elementor\Controls_Manager::CHOOSE,
				'options' => [
					'show' => [
						'title' => __( 'Show', 'endless-addons' ),
						'icon' => 'fa fa-check'
					],
					'hide' => [
						'title' => __( 'Hide', 'endless-addons' ),
						'icon' => 'fa fa-close'
					]
				],
				'default' => 'show',
				'toggle' => true
			]
		);

		$this->add_control(
			'select_wp_form_style',
			[
				'label' => __( 'Select WP Form Style', 'endless-addons' ),
				'type' => \Elementor\Controls_Manager::SELECT,
				'input_type' => 'SELECT',
				'options' => [
					'style-01' => __( 'Style 01', 'endless-addons' ),
					'style-02' => __( 'Style 02', 'endless-addons' ),
					'style-03' => __( 'Style 03', 'endless-addons' ),
					'style-04' => __( 'Style 04', 'endless-addons' )
				],
				'default' => 'style-01'
			]
		);

		$this->end_controls_section();

		$this->start_controls_section(
			'wp_form_section',
			[
				'label' => __( 'WP Form Section', 'endless-addons' ),
				'tab' => \Elementor\Controls_Manager::TAB_CONTENT
			]
		);

		$this->add_control(
			'section_title',
			[
				'label' => __( 'Section Title', 'endless-addons' ),
				'type' => \Elementor\Controls_Manager::TEXT,
				'input_type' => 'text',
				'placeholder' => __( 'Title', 'endless-addons' ),
				'default'  => __( 'Design 01', 'endless-addons' )
			]
		);

		$this->add_control(
			'section_desc',
			[
				'label' => __( 'Section Description', 'endless-addons' ),
				'type' => \Elementor\Controls_Manager::WYSIWYG,
				'input_type' => 'WYSIWYG',
				'placeholder' => __( 'Description', 'endless-addons' ),
				'default' => __( 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt dolore magna aliqua. Quis ipsum suspendisse ultrices gravida.', 'endless-addons')
			]
		);

		$this->add_group_control(
			\Elementor\Group_Control_Background::get_type(),
			[
				'name' => 'section_background',
				'label' => __( 'Background', 'plugin-domain' ),
				'types' => [ 'classic', 'gradient', 'video' ],
				'selector' => '{{WRAPPER}} .ea-wp-contact-form-area',
			]
		);

		$this->end_controls_section();

		$this->start_controls_section(
			'wp_form_content',
			[
				'label' => __( 'WP Form Content', 'endless-addons' ),
				'tab' => \Elementor\Controls_Manager::TAB_CONTENT
			]
		);

		$this->add_control(
			'wp_form_type',
			[
				'label' => __( 'Form Type', 'endless-addons' ),
				'type' => \Elementor\Controls_Manager::SELECT,
				'input_type' => 'SELECT',
				'options' => [
					'dropdown' => __( 'Dropdown', 'endless-addons' ),
					'shortcode' => __( 'Shortcode', 'endless-addons' ),
				],
				'default' => 'dropdown'
			]
		);

		$this->add_control(
            'select_wp_form',
            [
                'label'             => esc_html__('Select Form', 'endless-addons'),
                'type'              => \Elementor\Controls_Manager::SELECT,
                'label_block'       => true,
                'options'           => endless_addons_get_wpforms_list(),
                'default'           => '0',
                'condition' => [
                    'wp_form_type' => 'dropdown'
                ]
            ]
        );

		$this->add_control(
			'wp_form_shortcode',
			[
				'label' => __( 'WP Form Shortcode', 'endless-addons' ),
				'type' => \Elementor\Controls_Manager::TEXTAREA,
				'input_type' => 'text',
				'placeholder' => __( 'Shortcode', 'endless-addons' ),
				'condition' => [
                    'wp_form_type' => 'shortcode'
                ]
			]
		);

		$this->add_control(
            'error_messages',
            [
                'label'                 => __('Error Messages', 'endless-addons'),
                'type'                  => \Elementor\Controls_Manager::SELECT,
                'default'               => 'show',
                'options'               => [
                    'show'          => __('Show', 'endless-addons'),
                    'hide'          => __('Hide', 'endless-addons'),
                ],
                'selectors_dictionary'  => [
                    'show'          => 'block',
                    'hide'          => 'none',
                ],
                'selectors'             => [
                    '{{WRAPPER}} .ea-wp-contact-form label.wpforms-error' => 'display: {{VALUE}} !important;',
                ],
            ]
        );

		$this->add_control(
			'wp_form_featured_img',
			[
				'label' => __( 'Featured Image', 'endless-addons' ),
				'type' => \Elementor\Controls_Manager::MEDIA,
				'show_label' => true,
				'default' => [
					'url' => plugin_dir_url( dirname( __FILE__ ) ) . '../public/img/wpforms/form-img-1.png'
				],
				'condition' => [
                    'select_wp_form_style' => array('style-01', 'style-02')
                ]
			]
		);

		$this->add_group_control(
			\Elementor\Group_Control_Image_Size::get_type(),
			[
				'name' => 'thumbnail',
				'default' => 'full',
				'separator' => 'none',
				'exclude' => [
					'full',
					'custom',
					'large',
					'shop_catalog',
					'shop_single',
					'shop_thumbnail'
				],
				'condition' => [
					'select_wp_form_style' => array('style-01', 'style-02')
				]
			]
		);

		$this->add_control(
			'wp_form_bg_img',
			[
				'label' => __( 'Background Image', 'endless-addons' ),
				'type' => \Elementor\Controls_Manager::MEDIA,
				'show_label' => true,
				'condition' => [
                    'select_wp_form_style' => 'style-03'
                ]
			]
		);

		$this->add_control(
			'wp_form_shape_img1',
			[
				'label' => __( 'Shape Image 1', 'endless-addons' ),
				'type' => \Elementor\Controls_Manager::MEDIA,
				'show_label' => true,
				'condition' => [
                    'select_wp_form_style' => 'style-02'
                ]
			]
		);

		$this->add_control(
			'wp_form_shape_img2',
			[
				'label' => __( 'Shape Image 2', 'endless-addons' ),
				'type' => \Elementor\Controls_Manager::MEDIA,
				'show_label' => true,
				'condition' => [
                    'select_wp_form_style' => 'style-02'
                ]
			]
		);

		$this->end_controls_section();

		$this->start_controls_section(
			'contact_info',
			[
				'label' => __( 'Contact Info', 'endless-addons' ),
				'tab' => \Elementor\Controls_Manager::TAB_CONTENT,
				'condition' => [
                    'select_wp_form_style' => 'style-04'
                ]
			]
		);

		$this->add_control(
			'contact_info_title',
			[
				'label' => __( 'Contact Info Title', 'endless-addons' ),
				'type' => \Elementor\Controls_Manager::TEXT,
				'input_type' => 'text',
				'placeholder' => __( 'Title', 'endless-addons' ),
				'default'  => __( 'Our Contact Information', 'endless-addons' )
			]
		);

		$repeater = new \Elementor\Repeater();

		$repeater->add_control(
			'icon_type',
			[
				'label' => __( 'Icon Type', 'endless-addons' ),
				'type' => \Elementor\Controls_Manager::SELECT,
				'input_type' => 'SELECT',
				'options' => [
					'general' => __( 'General', 'endless-addons' ),
					'library' => __( 'Library', 'endless-addons' ),
				],
				'default' => 'general'
			]
		);

		$repeater->add_control(
			'single_contact_icon1', [
				'label' => __( 'Icon', 'endless-addons' ),
				'type' => \Elementor\Controls_Manager::ICON,
				'show_label' => true,
				'options' => endless_addons_icons(),
				'default' => 'bx bx-location-plus',
				'condition' => [
                    'icon_type' => 'general'
                ]
			]
		);

		$repeater->add_control(
			'single_contact_icon2', [
				'label' => __( 'Icon', 'endless-addons' ),
				'type' => \Elementor\Controls_Manager::ICONS,
				'show_label' => true,
				'options' => endless_addons_icons(),
				'condition' => [
                    'icon_type' => 'library'
                ]
			]
		);

		$repeater->add_control(
			'single_contact_content', [
				'label' => __( 'Content', 'endless-addons' ),
				'type' => \Elementor\Controls_Manager::TEXTAREA,
				'input_type' => 'textarea',
				'placeholder' => __( 'Content', 'endless-addons' ),
				'default'  => __( 'Upper Level, Overseas Passenger Terminal, The Rocks, Sydney 2000.', 'endless-addons' )
			]
		);

		$this->add_control(
			'single_contact_info',
			[
				'label' => __( 'Single Contact Info', 'endless-addons' ),
				'type' => \Elementor\Controls_Manager::REPEATER,
				'fields' => $repeater->get_controls(),
				'default' => [
					[
						'list_title' => __( 'Single Contact #1', 'endless-addons' ),
						'list_content' => __( 'Single Contact Content', 'endless-addons' ),
					],
				
				],
			]
		);

		$this->end_controls_section();

		$this->start_controls_section(
			'section_style',
			[
				'label' => __( 'Section Style', 'endless-addons' ),
				'tab' => \Elementor\Controls_Manager::TAB_STYLE
			]
		);

		$this->add_control(
			'section_title_color',
			[
				'label' => __( 'Section Title Color', 'endless-addons' ),
				'type' => \Elementor\Controls_Manager::COLOR,
				'selectors' => [
                    '{{WRAPPER}} .ea-wp-contact-form-area .section-title h2' => 'color: {{VALUE}}'
                ]
			]
		);

		$this->add_group_control(
            \Elementor\Group_Control_Typography::get_type(),
            [
                'name' => 'section_title_typography',
                'label' => __( 'Section Title Typography', 'endless-addons' ),
                'scheme' => \Elementor\Core\Schemes\Typography::TYPOGRAPHY_1,
                'selector' => '{{WRAPPER}} .ea-wp-contact-form-area .section-title h2'
            ]
        );

        $this->add_control(
			'section_desc_color',
			[
				'label' => __( 'Section Description Color', 'endless-addons' ),
				'type' => \Elementor\Controls_Manager::COLOR,
				'selectors' => [
                    '{{WRAPPER}} .ea-wp-contact-form-area .section-title p' => 'color: {{VALUE}}'
                ]
			]
		);

        $this->add_group_control(
            \Elementor\Group_Control_Typography::get_type(),
            [
                'name' => 'section_desc_typography',
                'label' => __( 'Section Description Typography', 'endless-addons' ),
                'scheme' => \Elementor\Core\Schemes\Typography::TYPOGRAPHY_1,
                'selector' => '{{WRAPPER}} .ea-wp-contact-form-area .section-title p'
            ]
        );

		$this->end_controls_section();

		$this->start_controls_section(
			'wp_form_style',
			[
				'label' => __( 'WP Form Style', 'endless-addons' ),
				'tab' => \Elementor\Controls_Manager::TAB_STYLE
			]
		);

		$this->add_control(
            'wp_form_padding',
            [
                'label'         => esc_html__( 'Form Field Padding', 'endless-addons' ),
                'type'          => \Elementor\Controls_Manager::DIMENSIONS,
                'size_units'    => [ 'px', '%', 'em' ],
                'selectors'     => [
                    '{{WRAPPER}} .ea-wp-contact-form .wpforms-field .form-control' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
                ],
            ]
        );

        $this->add_control(
            'wp_form_margin',
            [
                'label'         => esc_html__( 'Form Field Margin', 'endless-addons' ),
                'type'          => \Elementor\Controls_Manager::DIMENSIONS,
                'size_units'    => [ 'px', '%', 'em' ],
                'selectors'     => [
                    '{{WRAPPER}} .ea-wp-contact-form .wpforms-field .form-control' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
                ],
            ]
        );

        $this->add_control(
			'wp_form_btn_bg_color',
			[
				'label' => __( 'Button Background Color', 'endless-addons' ),
				'type' => \Elementor\Controls_Manager::COLOR,
				'selectors' => [
                    '{{WRAPPER}} .ea-wp-contact-form .wpforms-submit' => 'background-color: {{VALUE}}'
                ]
			]
		);

		$this->add_control(
			'wp_form_btn_text_color',
			[
				'label' => __( 'Button Text Color', 'endless-addons' ),
				'type' => \Elementor\Controls_Manager::COLOR,
				'selectors' => [
                    '{{WRAPPER}} .ea-wp-contact-form .wpforms-submit' => 'color: {{VALUE}}'
                ]
			]
		);

		$this->add_control(
			'wp_form_btn_border_color',
			[
				'label' => __( 'Button Border Color', 'endless-addons' ),
				'type' => \Elementor\Controls_Manager::COLOR,
				'selectors' => [
                    '{{WRAPPER}} .ea-wp-contact-form .wpforms-submit' => 'border-color: {{VALUE}}'
                ]
			]
		);

		$this->add_control(
			'wp_form_btn_bg_hover_color',
			[
				'label' => __( 'Button Background Hover Color', 'endless-addons' ),
				'type' => \Elementor\Controls_Manager::COLOR,
				'selectors' => [
                    '{{WRAPPER}} .ea-wp-contact-form .wpforms-submit:hover' => 'background-color: {{VALUE}}'
                ]
			]
		);

		$this->add_control(
			'wp_form_btn_text_hover_color',
			[
				'label' => __( 'Button Text Hover Color', 'endless-addons' ),
				'type' => \Elementor\Controls_Manager::COLOR,
				'selectors' => [
                    '{{WRAPPER}} .ea-wp-contact-form .wpforms-submit:hover' => 'color: {{VALUE}}'
                ]
			]
		);

		$this->add_control(
			'wp_form_btn_border_hover_color',
			[
				'label' => __( 'Button Border Hover Color', 'endless-addons' ),
				'type' => \Elementor\Controls_Manager::COLOR,
				'selectors' => [
                    '{{WRAPPER}} .ea-wp-contact-form .wpforms-submit:hover' => 'border-color: {{VALUE}}'
                ]
			]
		);

		$this->end_controls_section();

		$this->start_controls_section(
			'_section_overlay_style',
			[
				'label' => __('Background Overlay', 'endless-addons'),
				'tab' => \Elementor\Controls_Manager::TAB_STYLE
			]
		);

		$this->start_controls_tabs('_tabs_overlay_style');

		$this->start_controls_tab(
			'_tab_overlay_normal',
			[
				'label' => __('Normal', 'endless-addons'),
			]
		);

		$this->add_group_control(
			\Elementor\Group_Control_Background::get_type(),
			[
				'name'     => 'hover_overlay_normal',
				'label' => __('Background', 'endless-addons'),
				'show_label' => true,
				'types' => ['classic', 'gradient'],
				'exclude' => [
					'classic' => 'image'
				],
				'selector' => '{{WRAPPER}} .ea-wp-contact-form-area',
			]
		);

		$this->end_controls_tab();

		$this->start_controls_tab(
			'_tab_overlay_hover',
			[
				'label' => __('Hover', 'endless-addons'),
			]
		);


		$this->add_group_control(
			\Elementor\Group_Control_Background::get_type(),
			[
				'name'     => 'hover_overlay_hover',
				'label' => __('Background', 'endless-addons'),
				'show_label' => true,
				'types' => ['classic', 'gradient'],
				'exclude' => [
					'classic' => 'image'
				],
				'selector' => '{{WRAPPER}} .ea-wp-contact-form-area:hover',
			]
		);

		$this->end_controls_tab();

		$this->end_controls_tabs();

		$this->end_controls_section();

		require plugin_dir_path( dirname( __FILE__ ) ) . 'floating/ea-wp-form-floating.php';

	}

	/**
	 * Render WP Form widget output on the frontend.
	 *
	 * Written in PHP and used to generate the final HTML.
	 *
	 * @since 1.0.5
	 * @access protected
	 */
	protected function render() {

		$settings = $this->get_settings_for_display(); 

		if( $settings['show_wp_form'] == 'show' ) :

			if( $settings['select_wp_form_style'] == 'style-01' ) : ?>
				<!-- Start EA WP Form Design One Area -->
		        <section class="ea-wp-contact-form-area ea-wp-form-style-one pb-100">
		            <div class="container">
		                <div class="section-title">
		                    <h2><?php echo esc_html($settings['section_title']); ?></h2>
		                    <p><?php echo wp_kses_post($settings['section_desc']); ?></p>
		                </div>
		                <div class="row align-items-center">
		                    <div class="col-lg-5">
		                    	<?php if( ! $settings['wp_form_featured_img']['url'] == '' ) : ?>
		                    		<div class="ea-wp-form-img ea-elementor-floating">
                                        <?php echo \Elementor\Group_Control_Image_Size::get_attachment_image_html( $settings, 'thumbnail', 'wp_form_featured_img' ); ?>
                                    </div>
                                <?php endif; ?>
		                    </div>
		                    <div class="col-lg-7">
                                <div class="ea-wp-contact-form ml-50">
                                	<?php if($settings['wp_form_type'] == 'dropdown' && !empty($settings['select_wp_form'])) :
	                                        echo wpforms_display($settings['select_wp_form']);
	                                else:
                                        echo do_shortcode($settings['wp_form_shortcode']); 
                                    endif; ?>
                                </div>
		                    </div>
		                </div>
		            </div>
		        </section>
		        <!-- End EA WP Form Design One Area -->
		    <?php elseif( $settings['select_wp_form_style'] == 'style-02' ) : ?>
		    	<!-- Start EA WP Form Design Two Area -->
		        <section class="ea-wp-contact-form-area ea-wp-form-style-two bg-color-f8faff pb-100">
		            <div class="container">
		                <div class="row align-items-end">
		                    <div class="col-lg-6 col-xl-6">
		                    	<div class="ea-wp-contact-form ea-wp-style-two mr-50">
		                    		<div class="section-title">
					                    <h2><?php echo esc_html($settings['section_title']); ?></h2>
					                    <p><?php echo wp_kses_post($settings['section_desc']); ?></p>
					                </div>
                                    <?php if($settings['wp_form_type'] == 'dropdown' && !empty($settings['select_wp_form'])) :
	                                        echo wpforms_display($settings['select_wp_form']);
	                                else:
                                        echo do_shortcode($settings['wp_form_shortcode']); 
                                    endif; ?>
                                </div>
		                    </div>
		                    <div class="col-lg-5 col-xl-5">
                                <?php if( ! $settings['wp_form_featured_img']['url'] == '' ) : ?>
		                    		<div class="ea-wp-form-img-2 ea-elementor-floating">
                                        <?php echo \Elementor\Group_Control_Image_Size::get_attachment_image_html( $settings, 'thumbnail', 'wp_form_featured_img' ); ?>
                                    </div>
                                <?php endif; ?>
		                    </div>
		                </div>
		            </div>
		            <?php if( ! $settings['wp_form_shape_img1']['url'] == '' ) : ?>
			            <div class="form-shape-1">
			                <img src="<?php echo esc_url( $settings['wp_form_shape_img1']['url'] ); ?>" alt="Image">
			            </div>
		            <?php endif; ?>
		            <?php if( ! $settings['wp_form_shape_img2']['url'] == '' ) : ?>
			            <div class="form-shape-2">
			                <img src="<?php echo esc_url( $settings['wp_form_shape_img2']['url'] ); ?>" alt="Image">
			            </div>
		            <?php endif; ?>
		        </section>
		        <!-- End EA WP Form Design Two Area -->
		    <?php elseif( $settings['select_wp_form_style'] == 'style-03' ) : ?>
		    	<!-- Start EA WP Form Design Three Area -->
		        <section class="ea-wp-contact-form-area ea-wp-form-style-three ptb-100">
		            <div class="container">
		                <div class="section-title">
		                    <h2><?php echo esc_html($settings['section_title']); ?></h2>
		                    <p><?php echo wp_kses_post($settings['section_desc']); ?></p>
		                </div>
		                <div class="row">
		                    <div class="col-lg-6 pr-0">
		                    	<?php if( ! $settings['wp_form_bg_img']['url'] == '' ) : ?>
		                    		<div class="ea-wp-form-img-3 ea-elementor-floating" style="background-image:url(<?php echo esc_url( $settings['wp_form_bg_img']['url'] ); ?>);">
		                    			<img src="<?php echo esc_url( $settings['wp_form_bg_img']['url'] ); ?>" alt="image">
                                    </div>
                                <?php endif; ?>
		                    </div>
		                    <div class="col-lg-6 pl-0">
                                <div class="ea-wp-contact-form ea-wp-style-three">
                                    <?php if($settings['wp_form_type'] == 'dropdown' && !empty($settings['select_wp_form'])) :
	                                        echo wpforms_display($settings['select_wp_form']);
	                                else:
                                        echo do_shortcode($settings['wp_form_shortcode']); 
                                    endif; ?>
                                </div>
		                    </div>
		                </div>
		            </div>
		        </section>
		        <!-- End EA WP Form Design Three Area -->
		    <?php elseif( $settings['select_wp_form_style'] == 'style-04' ) : ?>
		    	<!-- Start EA WP Form Design Four Area -->
		        <section class="ea-wp-contact-form-area ea-wp-form-style-four ea-wp-contact-form-bg bg-shape ptb-100">
		            <div class="container">
		                <div class="section-title">
		                    <h2><?php echo esc_html($settings['section_title']); ?></h2>
		                    <p><?php echo wp_kses_post($settings['section_desc']); ?></p>
		                </div>
			            <div class="row align-items-center">		                    	
			            	<div class="col-lg-5">
		                        <div class="ea-wp-form-get-in-touch">
		                            <h3><?php echo esc_html__($settings['contact_info_title']); ?></h3>
		                            <ul>
		                            	<?php foreach ( $settings['single_contact_info'] as $item ) : ?>
			                                <li>
			                                	<?php if( $item['icon_type'] == 'general' ) : ?>
			                                	    <i class="<?php echo wp_kses_post( $item['single_contact_icon1'] ); ?>"></i>
			                                	<?php else: 
			                                		endad_render_icon( $item, 'icon', 'single_contact_icon2' ); 
			                                	endif; ?>
			                                    <?php echo wp_kses_post($item['single_contact_content']); ?>
			                                </li>
		                                <?php endforeach; ?>
		                            </ul>
		                        </div>
		                    </div>
		                    <div class="col-lg-7">
		                    	<div class="ea-wp-contact-form ea-wp-style-four ml-50">
                                    <?php if($settings['wp_form_type'] == 'dropdown' && !empty($settings['select_wp_form'])) :
	                                        echo wpforms_display($settings['select_wp_form']);
	                                else:
                                        echo do_shortcode($settings['wp_form_shortcode']); 
                                    endif; ?>
                                </div> 
		                    </div>
		                </div>
		            </div>
		        </section>
		        <!-- End EA WP Form Design Four Area -->
		    <?php elseif( $settings['select_wp_form_style'] == 'style-04' ) : ?>
		    	<!-- Start EA WP Form Design Five Area -->
		        <section class="ea-wp-contact-form-area ea-wp-form-style-four ea-wp-contact-form-bg bg-shape ptb-100">
		            <div class="container">
		                <div class="section-title">
		                    <h2><?php echo esc_html($settings['section_title']); ?></h2>
		                    <p><?php echo wp_kses_post($settings['section_desc']); ?></p>
		                </div>
			            <div class="row align-items-center">		                    	
			            	<div class="col-lg-5">
		                        <div class="ea-wp-form-get-in-touch">
		                            <h3><?php echo esc_html__($settings['contact_info_title']); ?></h3>
		                            <ul>
		                            	<?php foreach ( $settings['single_contact_info'] as $item ) : ?>
			                                <li>
			                                	<?php if( $item['icon_type'] == 'general' ) : ?>
			                                	    <i class="<?php echo wp_kses_post( $item['single_contact_icon1'] ); ?>"></i>
			                                	<?php else: 
			                                		endad_render_icon( $item, 'icon', 'single_contact_icon2' ); 
			                                	endif; ?>
			                                    <?php echo wp_kses_post($item['single_contact_content']); ?>
			                                </li>
		                                <?php endforeach; ?>
		                            </ul>
		                        </div>
		                    </div>
		                    <div class="col-lg-7">
		                    	<div class="ea-wp-contact-form ea-wp-style-four ml-50">
                                    <?php if($settings['wp_form_type'] == 'dropdown' && !empty($settings['select_wp_form'])) :
	                                        echo wpforms_display($settings['select_wp_form']);
	                                else:
                                        echo do_shortcode($settings['wp_form_shortcode']); 
                                    endif; ?>
                                </div> 
		                    </div>
		                </div>
		            </div>
		        </section>
		        <!-- End EA WP Form Design Five Area -->
            <?php endif;

        endif;
        
    }

}
