<?php
/**
 * Elementor Testimonial Widget.
 *
 * Elementor widget that inserts an embbedable content into the page, from any given URL.
 *
 * @since 1.0.5
 */

use \Elementor\Plugin;

class Elementor_Testimonial_Widget extends \Elementor\Widget_Base {

	/**
	 * Get widget name.
	 *
	 * Retrieve Testimonial widget name.
	 *
	 * @since 1.0.5
	 * @access public
	 *
	 * @return string Widget name.
	 */
	public function get_name() {
		return 'testimonial';
	}

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

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

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

	/**
	 * Register Testimonial 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_testimonial',
			[    
				'label' => __( 'Settings', 'endless-addons' ),
				'tab' => \Elementor\Controls_Manager::TAB_CONTENT
			]
		);

		$this->add_control(
			'show_testimonial',
			[
				'label' => __( 'Show/Hide Testimonial 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(
			'testimonial_style_select',
			[
				'label' => __( 'Testimonial 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' ),
					'style-05' => __( 'Style 05', 'endless-addons' ),
					'style-06' => __( 'Style 06', 'endless-addons' ),
					'style-07' => __( 'Style 07', 'endless-addons' )
				],
				'default' => 'style-01'
			]
		);

		$this->end_controls_section();

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

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

		$this->add_control(
			'testimonial_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 ut labore et 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-testimonial-area',
			]
		);

		$this->end_controls_section();

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

		$this->add_control(
			'testimonial_item_column',
			[
				'label' => __( 'Testimonial Column', 'endless-addons' ),
				'type' => \Elementor\Controls_Manager::SELECT,
				'input_type' => 'SELECT',
				'options' => [
					'columns-2' => __( '2', 'endless-addons' ),
					'columns-3' => __( '3', 'endless-addons' ),
					'columns-4' => __( '4', 'endless-addons' )
				],
				'default' => 'columns-2',
				'condition' => [
                    'testimonial_style_select' => 'style-02'
                ]
			]
		);

		$this->add_control(
			'testimonial_extra_desc',
			[
				'label' => __( 'Testimonial Additional 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 ut labore et dolore magna aliqua. Quis ipsum suspendisse ultrices gravida.', 'endless-addons'),
				'condition' => [
                    'testimonial_style_select' => 'style-04'
                ]
			]
		);

		$this->add_control(
			'single_testimonial_featured_img', [
				'label' => __( 'Featured Image', 'endless-addons' ),
				'type' => \Elementor\Controls_Manager::MEDIA,
				'default' => [
					'url' => plugin_dir_url( dirname( __FILE__ ) ) . '../public/img/testimonial/testimonial-img4.jpg'
				],
				'show_label' => true,
				'condition' => [
                    'testimonial_style_select' => array('style-01', 'style-04')
                ]
			]
		);

		$repeater = new \Elementor\Repeater();	

		$repeater->add_control(
			'single_testimonial_img', [
				'label' => __( 'Image', 'endless-addons' ),
				'type' => \Elementor\Controls_Manager::MEDIA,
				'default' => [
					'url' => plugin_dir_url( dirname( __FILE__ ) ) . '../public/img/user/user1.jpg'
				],
				'show_label' => true
			]
		);

		$repeater->add_control(
			'single_testimonial_name', [
				'label' => __( 'Name', 'endless-addons' ),
				'type' => \Elementor\Controls_Manager::TEXT,
				'input_type' => 'text',
				'placeholder' => __( 'Title', 'endless-addons' ),
				'default'  => __( 'Filip Luis', 'endless-addons' )
			]
		);

		$repeater->add_control(
			'single_testimonial_position', [
				'label' => __( 'Designation', 'endless-addons' ),
				'type' => \Elementor\Controls_Manager::TEXT,
				'input_type' => 'text',
				'placeholder' => __( 'Designation', 'endless-addons' ),
				'default'  => __( 'CEO & Founder', 'endless-addons' )
			]
		);

		$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_testimonial_icon1', [
				'label' => __( 'Icon', 'endless-addons' ),
				'type' => \Elementor\Controls_Manager::ICON,
				'default'  => 'fa fa-quote-right',
				'show_label' => true,
				'options' => endless_addons_icons(),
				'condition' => [
                    'icon_type' => 'general'
                ]
			]
		);

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

		$repeater->add_control(
            'ea_content_text_type',
            [
                'label' => __('Content Type', 'endless-addons'),
                'type' => \Elementor\Controls_Manager::SELECT,
                'options' => [
                    'content' => __('Content', 'endless-addons'),
                    'template' => __('Saved Templates', 'endless-addons'),
                ],
                'default' => 'content',
            ]
        );

		$repeater->add_control(
			'single_testimonial_comment',
			[
				'label' => __( 'Testimonial Comment', 'endless-addons' ),
				'type' => \Elementor\Controls_Manager::WYSIWYG,
				'input_type' => 'WYSIWYG',
				'placeholder' => __( 'Comment', 'endless-addons' ),
				'default' => __( 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Quis ipsum suspendisse ultrices gravida.', 'endless-addons'),
				'condition' => [
                    'ea_content_text_type' => 'content'
                ]
			]
		);

		$repeater->add_control(
            'ea_content_templates',
            [
                'label' => __('Choose Template', 'endless-addons'),
                'type' => \Elementor\Controls_Manager::SELECT,
                'options' => ea_get_elementor_templates(),
                'condition' => [
                    'ea_content_text_type' => 'template',
                ],
            ]
        );

		$this->add_control(
			'single_testimonial',
			[
				'label' => __( 'Single Testimonial', 'endless-addons' ),
				'type' => \Elementor\Controls_Manager::REPEATER,
				'fields' => $repeater->get_controls(),
				'default' => [
					[
						'list_title' => __( 'Single Testimonial #1', 'endless-addons' ),
						'list_content' => __( 'Single Testimonial 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-testimonial-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-testimonial-area .section-title h2'
            ]
        );

        $this->add_control(
			'section_desc_color',
			[
				'label' => __( 'Section Description Color', 'endless-addons' ),
				'type' => \Elementor\Controls_Manager::COLOR,
				'selectors' => [
                    '{{WRAPPER}} .ea-testimonial-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-testimonial-area .section-title p'
            ]
        );

		$this->end_controls_section();

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

		$this->add_control(
			'testimonial_box_bg_color',
			[
				'label' => __( 'Box Background Color', 'endless-addons' ),
				'type' => \Elementor\Controls_Manager::COLOR,
				'input_type' => 'color',
				'selectors' => [
                    '{{WRAPPER}} .ea-single-testimonial-box, .ea-single-testimonial-box.style-one::before, .ea-single-testimonial-box .testimonial-desc, .ea-single-testimonial-box .desc, .ea-single-testimonial-box.style-two .testimonial-desc, .ea-single-testimonial-box.style-four .desc, .ea-single-testimonial-box.style-five .desc' => 'background-color: {{VALUE}}'
                ],
			]
		);

		$this->add_control(
			'testimonial_comment_color',
			[
				'label' => __( 'Testimonial Comment Color', 'endless-addons' ),
				'type' => \Elementor\Controls_Manager::COLOR,
				'input_type' => 'color',
				'selectors' => [
                    '{{WRAPPER}} .ea-single-testimonial-box.style-one .content p, .ea-single-testimonial-box.style-two .testimonial-desc p, .ea-single-testimonial-box.style-three .testimonial-desc p, .ea-single-testimonial-box.style-four .desc p, .ea-single-testimonial-box.style-five .desc p, .ea-single-testimonial-box.style-six .desc p, .ea-single-testimonial-box.style-seven p' => 'color: {{VALUE}}'
                ],
			]
		);

        $this->add_group_control(
            \Elementor\Group_Control_Typography::get_type(),
            [
                'name' => 'testimonial_comment_typography',
                'label' => __( 'Testimonial Comment Typography', 'endless-addons' ),
                'scheme' => \Elementor\Core\Schemes\Typography::TYPOGRAPHY_1,
                'selector' => '{{WRAPPER}} .ea-single-testimonial-box.style-one .content p, .ea-single-testimonial-box.style-two .testimonial-desc p, .ea-single-testimonial-box.style-three .testimonial-desc p, .ea-single-testimonial-box.style-four .desc p, .ea-single-testimonial-box.style-five .desc p, .ea-single-testimonial-box.style-six .desc p, .ea-single-testimonial-box.style-seven p'
            ]
        );

		$this->add_control(
			'testimonial_name_color',
			[
				'label' => __( 'Testimonial Name Color', 'endless-addons' ),
				'type' => \Elementor\Controls_Manager::COLOR,
				'input_type' => 'color',
				'selectors' => [
                    '{{WRAPPER}} .ea-single-testimonial-box .content .client-info .title h3, .ea-single-testimonial-box.style-two .client-info .title h3, .ea-single-testimonial-box.style-three .testimonial-desc .client-info h3, .ea-single-testimonial-box.style-four .client-info .title h3, .ea-single-testimonial-box.style-five .client-info .title h3, .ea-single-testimonial-box.style-six .client-info .title h3, .ea-single-testimonial-box.style-seven .client-info h3' => 'color: {{VALUE}}'
                ],
			]
		);

        $this->add_group_control(
            \Elementor\Group_Control_Typography::get_type(),
            [
                'name' => 'testimonial_name_typography',
                'label' => __( 'Testimonial Name Typography', 'endless-addons' ),
                'scheme' => \Elementor\Core\Schemes\Typography::TYPOGRAPHY_1,
                'selector' => '{{WRAPPER}} .ea-single-testimonial-box .content .client-info .title h3, .ea-single-testimonial-box.style-two .client-info .title h3, .ea-single-testimonial-box.style-three .testimonial-desc .client-info h3, .ea-single-testimonial-box.style-four .client-info .title h3, .ea-single-testimonial-box.style-five .client-info .title h3, .ea-single-testimonial-box.style-six .client-info .title h3, .ea-single-testimonial-box.style-seven .client-info h3'
            ]
        );

        $this->add_control(
			'testimonial_position_color',
			[
				'label' => __( 'Testimonial Position Color', 'endless-addons' ),
				'type' => \Elementor\Controls_Manager::COLOR,
				'input_type' => 'color',
				'selectors' => [
                    '{{WRAPPER}} .ea-single-testimonial-box .content .client-info .title span, .ea-single-testimonial-box.style-two .client-info .title span, .ea-single-testimonial-box.style-three .testimonial-desc .client-info span, .ea-single-testimonial-box.style-four .client-info .title span, .ea-single-testimonial-box.style-five .client-info .title span, .ea-single-testimonial-box.style-six .client-info .title span, .ea-single-testimonial-box.style-seven .client-info span' => 'color: {{VALUE}}'
                ],
			]
		);

        $this->add_group_control(
            \Elementor\Group_Control_Typography::get_type(),
            [
                'name' => 'testimonial_position_typography',
                'label' => __( 'Testimonial Position Typography', 'endless-addons' ),
                'scheme' => \Elementor\Core\Schemes\Typography::TYPOGRAPHY_1,
                'selector' => '{{WRAPPER}} .ea-single-testimonial-box .content .client-info .title span, .ea-single-testimonial-box.style-two .client-info .title span, .ea-single-testimonial-box.style-three .testimonial-desc .client-info span, .ea-single-testimonial-box.style-four .client-info .title span, .ea-single-testimonial-box.style-five .client-info .title span, .ea-single-testimonial-box.style-six .client-info .title span, .ea-single-testimonial-box.style-seven .client-info span'
            ]
        );

		$this->add_control(
			'testimonial_quote_icon_size',
			[
				'label' => __( 'Quote Icon Size', 'endless-addons' ),
				'type' => \Elementor\Controls_Manager::SLIDER,
                'range' => [
                    'px' => [
                        'min' => 20,
                        'max' => 100,
                        'step' => 1,
                    ],
                ],
                'selectors' => [
                    '{{WRAPPER}} .ea-single-testimonial-box .quote-ico, .ea-single-testimonial-box.style-three .client-image::before' => 'font-size: {{SIZE}}px;'
                ],
			]
		);

		$this->add_control(
			'testimonial_quote_icon_bg_color',
			[
				'label' => __( 'Quote Icon Background Color', 'endless-addons' ),
				'type' => \Elementor\Controls_Manager::COLOR,
				'input_type' => 'color',
				'selectors' => [
                    '{{WRAPPER}} .ea-single-testimonial-box.style-two .quote-ico, .ea-single-testimonial-box.style-three .client-image::before' => 'background-color: {{VALUE}}'
                ],
                'condition' => [
                    'testimonial_style_select' => array('style-02', 'style-03')
                ]
			]
		);

		$this->add_control(
			'testimonial_quote_icon_color',
			[
				'label' => __( 'Quote Icon Color', 'endless-addons' ),
				'type' => \Elementor\Controls_Manager::COLOR,
				'input_type' => 'color',
				'selectors' => [
                    '{{WRAPPER}} .ea-single-testimonial-box .quote-ico, .ea-single-testimonial-box.style-three .client-image::before' => 'color: {{VALUE}}'
                ],
			]
		);

		$this->add_control(
			'testimonial_image_height',
			[
				'label' => __( 'Client Image Height', 'endless-addons' ),
				'type' => \Elementor\Controls_Manager::SLIDER,
				'range' => [
					'px' => [
						'min' => 100,
						'max' => 1000
					]
				],
				'selectors' => [
					'{{WRAPPER}} .ea-testimonial-area .client-info img, .ea-single-testimonial-box.style-three .client-image img, .owl-carousel .owl-item .ea-single-testimonial-box.style-seven img' => 'height: {{SIZE}}{{UNIT}}',
				],
			]
		);

		$this->add_control(
			'testimonial_image_width',
			[
				'label' => __( 'Client Image Width', 'endless-addons' ),
				'type' => \Elementor\Controls_Manager::SLIDER,
				'range' => [
					'px' => [
						'min' => 100,
						'max' => 1000
					]
				],
				'selectors' => [
					'{{WRAPPER}} .ea-testimonial-area .client-info img, .ea-single-testimonial-box.style-three .client-image img, .owl-carousel .owl-item .ea-single-testimonial-box.style-seven img' => 'width: {{SIZE}}{{UNIT}}',
				],
			]
		);

		$this->add_control(
            'testimonial_image_border_radius',
            [
                'label' => __( 'Border Radius', 'endless-addons' ),
                'type' => \Elementor\Controls_Manager::DIMENSIONS,
                'size_units' => [ 'px', '%' ],
                'separator' => 'after',
                'selectors' => [
                    '{{WRAPPER}} .ea-testimonial-area .client-info img, .ea-single-testimonial-box.style-three .client-image img, .owl-carousel .owl-item .ea-single-testimonial-box.style-seven img' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
                ],
            ]
        );

		$this->end_controls_section();

        $this->start_controls_section(
			'featured_img_style',
			[
				'label' => __( 'Featured Image Style', 'endless-addons' ),
				'tab' => \Elementor\Controls_Manager::TAB_STYLE,
				'condition' => [
					'testimonial_style_select' => array('style-01', 'style-04')
				]
			]
		);

		$this->add_group_control(
            \Elementor\Group_Control_Border::get_type(),
            [
                'name'     => 'single_testimonial_featured_img_border',
                'selector' => '{{WRAPPER}} .ea-single-testimonial-box.style-one .image img, .ea-testimonial-image.style-four img'
            ]
        );

		$this->add_group_control(
            \Elementor\Group_Control_Box_Shadow::get_type(),
            [
                'name'     => 'single_testimonial_featured_img_box_shadow',
                'selector' => '{{WRAPPER}} .ea-single-testimonial-box.style-one .image img, .ea-testimonial-image.style-four img'
            ]
        );

		$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'
				]
			]
		);

		$this->end_controls_section();

		$this->start_controls_section(
			'_section_overlay_style',
			[
				'label' => __('Background Overlay', 'endless-addons'),
				'tab' => \Elementor\Controls_Manager::TAB_STYLE,
				'condition' => [
                    'testimonial_style_select' => array('style-01', 'style-02', 'style-03', 'style-05', 'style-07'),
                ]
			]
		);

		$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-testimonial-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-testimonial-area:hover',
			]
		);

		$this->end_controls_tab();

		$this->end_controls_tabs();

		$this->end_controls_section();

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

	}

	/**
	 * Render Testimonial  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(); ?>

        <!-- Testimonial Column Style -->
	    <?php if( $settings['testimonial_item_column'] == 'columns-2' ) :
			$testimonial_column = 'col-lg-6 col-md-6 col-sm-6';
		elseif( $settings['testimonial_item_column'] == 'columns-3' ) :
			$testimonial_column = 'col-lg-4 col-md-6 col-sm-6';
		elseif( $settings['testimonial_item_column'] == 'columns-4' ) :
			$testimonial_column = 'col-lg-3 col-md-6 col-sm-6';
		endif; ?>

        <!-- Start Testimonial Area -->
        <?php if( $settings['show_testimonial'] == 'show' ) :

	        if( $settings['testimonial_style_select'] == 'style-01' ) : ?>
		        <div class="ea-testimonial-area pb-100">
		            <div class="container">
		                <div class="section-title">
		                    <h2><?php echo esc_html__($settings['testimonial_title']); ?></h2>
		                    <p><?php echo wp_kses_post($settings['testimonial_desc']); ?></p>
		                </div>
		            </div>  
		            <div class="container-fluid p-0">
		                <div class="ea-single-testimonial-box style-one">
		                    <div class="row align-items-center m-0">
		                    	<?php if( ! $settings['single_testimonial_featured_img']['url'] == '' ) : ?>
			                        <div class="col-lg-6 col-md-12 p-0">
			                            <div class="image ea-elementor-floating">
			                                <?php echo \Elementor\Group_Control_Image_Size::get_attachment_image_html( $settings, 'thumbnail', 'single_testimonial_featured_img' ); ?>
			                            </div>
			                        </div> 
		                        <?php endif; ?>
		                        <div class="col-lg-6 col-md-12 p-0">        
	                	            <?php foreach ( $settings['single_testimonial'] as $item ) : ?>		<div class="content">
	                	            	    <?php if($item['ea_content_text_type'] == 'content') : ?>
				                                <p><?php echo wp_kses_post($item['single_testimonial_comment']); ?></p>
				                            <?php elseif($item['ea_content_text_type'] == 'template') : ?>
				                            	<p>
				                            		<?php if (!empty($item['ea_content_templates'])) {
										                echo Plugin::$instance->frontend->get_builder_content($item['ea_content_templates'], true);
										            } ?>
				                            	</p>
				                            <?php endif; ?>
			                                <div class="client-info">
			                                    <div class="d-flex align-items-center">
			                                        <?php if( ! $item['single_testimonial_img']['url'] == '' ) : ?>
						                                <img src="<?php echo esc_url( $item['single_testimonial_img']['url'] ); ?>" alt="image">
					                                <?php endif; ?>
			                                        <div class="title">
			                                            <h3><?php echo esc_html__($item['single_testimonial_name']); ?></h3>
			                                            <span><?php echo esc_html__($item['single_testimonial_position']); ?></span>
			                                        </div>
			                                    </div>
			                                </div>
			                                <?php if(! $item['single_testimonial_icon1'] == '' || ! $item['single_testimonial_icon2'] == '') : ?>
				                                <?php if( $item['icon_type'] == 'general' ) : ?>
			                                	    <i class="quote-ico <?php echo wp_kses_post( $item['single_testimonial_icon1'] ); ?>"></i>
			                                	<?php else: 
			                                		endad_render_icon( $item, 'icon', 'single_testimonial_icon2' ); 
			                                	endif; ?>
				                            <?php endif; ?>
			                            </div>
				                    <?php endforeach; ?>
			                    </div>
                            </div>
			            </div>
			        </div>
		        </div>
		    <?php elseif( $settings['testimonial_style_select'] == 'style-02' ) : ?>
		    	<div class="ea-testimonial-area bg-f9f9f9 pt-100 pb-70">
		            <div class="container">
		                <div class="section-title">
		                    <h2><?php echo esc_html__($settings['testimonial_title']); ?></h2>
		                    <p><?php echo wp_kses_post($settings['testimonial_desc']); ?></p>
		                </div>
		                <div class="row justify-content-center">
		                    <?php foreach ( $settings['single_testimonial'] as $item ) : ?>
			                	<div class="testimonial-col <?php echo esc_attr( $testimonial_column ); ?>">
			                		<div class="ea-single-testimonial-box style-two">
			                			<?php if(! $item['single_testimonial_icon1'] == '' || ! $item['single_testimonial_icon2'] == '') : ?>
			                                <?php if( $item['icon_type'] == 'general' ) : ?>
		                                	    <i class="quote-ico <?php echo wp_kses_post( $item['single_testimonial_icon1'] ); ?>"></i>
		                                	<?php else: 
		                                		endad_render_icon( $item, 'icon', 'single_testimonial_icon2' ); 
		                                	endif; ?>
			                            <?php endif; ?>
			                            <div class="testimonial-desc">
			                                <?php if($item['ea_content_text_type'] == 'content') : ?>
				                                <p><?php echo wp_kses_post($item['single_testimonial_comment']); ?></p>
				                            <?php elseif($item['ea_content_text_type'] == 'template') : ?>
				                            	<p>
				                            		<?php if (!empty($item['ea_content_templates'])) {
										                echo Plugin::$instance->frontend->get_builder_content($item['ea_content_templates'], true);
										            } ?>
				                            	</p>
				                            <?php endif; ?>
			                            </div>
			                            <div class="client-info">
			                                <div class="d-flex align-items-center">
			                                    <?php if( ! $item['single_testimonial_img']['url'] == '' ) : ?>
					                                <img src="<?php echo esc_url( $item['single_testimonial_img']['url'] ); ?>" alt="image">
				                                <?php endif; ?>
			                                    <div class="title">
			                                        <h3><?php echo esc_html__($item['single_testimonial_name']); ?></h3>
		                                            <span><?php echo esc_html__($item['single_testimonial_position']); ?></span>
			                                    </div>
			                                </div>
			                            </div>
			                        </div>
			                	</div>
		                    <?php endforeach; ?>
		                </div>
		            </div>
		        </div>
		    <?php elseif( $settings['testimonial_style_select'] == 'style-03' ) : ?>
		    	<div class="ea-testimonial-area ptb-100">
		            <div class="container">
		                <div class="section-title">
		                    <h2><?php echo esc_html__($settings['testimonial_title']); ?></h2>
		                    <p><?php echo wp_kses_post($settings['testimonial_desc']); ?></p>
		                </div>
		                <div class="ea-testimonial-slides style-one owl-carousel owl-theme">
		                    <?php foreach ( $settings['single_testimonial'] as $item ) : ?>
		                		<div class="ea-single-testimonial-box style-three ea-elementor-floating">
	                            	<div class="client-image">
	                            		<?php if(! $item['single_testimonial_icon1'] == '' || ! $item['single_testimonial_icon2'] == '') : ?>
			                                <?php if( $item['icon_type'] == 'general' ) : ?>
		                                	    <i class="quote-ico <?php echo wp_kses_post( $item['single_testimonial_icon1'] ); ?>"></i>
		                                	<?php else: 
		                                		endad_render_icon( $item, 'icon', 'single_testimonial_icon2' ); 
		                                	endif; ?>
			                            <?php endif; ?>
		                                <?php if( ! $item['single_testimonial_img']['url'] == '' ) : ?>
			                                <img src="<?php echo esc_url( $item['single_testimonial_img']['url'] ); ?>" alt="image">
		                                <?php endif; ?>
	                                </div>	                                
	                                <div class="testimonial-desc">
	                                	<?php if($item['ea_content_text_type'] == 'content') : ?>
				                                <p><?php echo wp_kses_post($item['single_testimonial_comment']); ?></p>
				                            <?php elseif($item['ea_content_text_type'] == 'template') : ?>
				                            	<p>
				                            		<?php if (!empty($item['ea_content_templates'])) {
										                echo Plugin::$instance->frontend->get_builder_content($item['ea_content_templates'], true);
										            } ?>
				                            	</p>
				                            <?php endif; ?>
	                                    <div class="client-info">               
				                            <h3><?php echo esc_html__($item['single_testimonial_name']); ?></h3>
				                            <span class="position"><?php echo esc_html__($item['single_testimonial_position']); ?></span>
		                                </div>
	                                </div>
		                        </div>
		                    <?php endforeach; ?>
		                </div>
		            </div>
		        </div>
		    <?php elseif( $settings['testimonial_style_select'] == 'style-04' ) : ?>
		    	<div class="ea-testimonial-area ptb-100 bg-gradient-color">
		            <div class="container">
		                <div class="section-title">
		                    <h2><?php echo esc_html__($settings['testimonial_title']); ?></h2>
		                    <p><?php echo wp_kses_post($settings['testimonial_desc']); ?>
		                    </p>
		                </div>
		                <div class="row align-items-center">
		                	<div class="col-lg-6 col-md-12">
		                        <div class="ea-testimonial-image style-four ea-elementor-floating">
		                            <?php if( ! $settings['single_testimonial_featured_img']['url'] == '' ) : ?>
		                                <?php echo \Elementor\Group_Control_Image_Size::get_attachment_image_html( $settings, 'thumbnail', 'single_testimonial_featured_img' ); ?>
	                                <?php endif; ?>
		                        </div>
		                    </div>		                	
		                	<div class="col-lg-6 col-md-12">
		                		<div class="ea-testimonial-list">
		                			<?php echo wp_kses_post( $settings['testimonial_extra_desc'] ); ?>
		                			<div class="ea-testimonial-slides style-two owl-carousel owl-theme">
			                			<?php foreach ( $settings['single_testimonial'] as $item ) : ?>
					                		<div class="ea-single-testimonial-box style-four">
					                			<div class="desc">
					                				<?php if(! $item['single_testimonial_icon1'] == '' || ! $item['single_testimonial_icon2'] == '') : ?>
						                                <?php if( $item['icon_type'] == 'general' ) : ?>
					                                	    <i class="quote-ico <?php echo wp_kses_post( $item['single_testimonial_icon1'] ); ?>"></i>
					                                	<?php else: 
					                                		endad_render_icon( $item, 'icon', 'single_testimonial_icon2' ); 
					                                	endif; ?>
						                            <?php endif; ?>
			                                        <?php if($item['ea_content_text_type'] == 'content') : ?>
				                                <p><?php echo wp_kses_post($item['single_testimonial_comment']); ?></p>
				                            <?php elseif($item['ea_content_text_type'] == 'template') : ?>
				                            	<p>
				                            		<?php if (!empty($item['ea_content_templates'])) {
										                echo Plugin::$instance->frontend->get_builder_content($item['ea_content_templates'], true);
										            } ?>
				                            	</p>
				                            <?php endif; ?>
			                                    </div>
			                                    <div class="client-info">
			                                        <div class="d-flex align-items-center">
			                                            <?php if( ! $item['single_testimonial_img']['url'] == '' ) : ?>
							                                <img src="<?php echo esc_url( $item['single_testimonial_img']['url'] ); ?>" alt="image">
						                                <?php endif; ?>
			                                            <div class="title">
			                                                <h3><?php echo esc_html__($item['single_testimonial_name']); ?></h3>
							                                <span><?php echo esc_html__($item['single_testimonial_position']); ?></span>
			                                            </div>
			                                        </div>
			                                    </div>
					                        </div>
				                        <?php endforeach; ?>
			                        </div>
			                    </div>
		                	</div>			     		   	               
		                </div>
		            </div>
		        </div>
		    <?php elseif( $settings['testimonial_style_select'] == 'style-05' ) : ?>
		    	<div class="ea-testimonial-area ptb-100">
		            <div class="container">
		                <div class="section-title">
		                    <h2><?php echo esc_html__($settings['testimonial_title']); ?></h2>
		                    <p><?php echo wp_kses_post($settings['testimonial_desc']); ?></p>
		                </div>
		                <div class="ea-testimonial-slides style-three owl-carousel owl-theme">
		                    <?php foreach ( $settings['single_testimonial'] as $item ) : ?>
		                		<div class="ea-single-testimonial-box style-five ea-elementor-floating">
		                			<div class="desc">
		                				<?php if(! $item['single_testimonial_icon1'] == '' || ! $item['single_testimonial_icon2'] == '') : ?>
			                                <?php if( $item['icon_type'] == 'general' ) : ?>
		                                	    <i class="quote-ico <?php echo wp_kses_post( $item['single_testimonial_icon1'] ); ?>"></i>
		                                	<?php else: 
		                                		endad_render_icon( $item, 'icon', 'single_testimonial_icon2' ); 
		                                	endif; ?>
			                            <?php endif; ?>
				                        <?php if($item['ea_content_text_type'] == 'content') : ?>
				                                <p><?php echo wp_kses_post($item['single_testimonial_comment']); ?></p>
				                            <?php elseif($item['ea_content_text_type'] == 'template') : ?>
				                            	<p>
				                            		<?php if (!empty($item['ea_content_templates'])) {
										                echo Plugin::$instance->frontend->get_builder_content($item['ea_content_templates'], true);
										            } ?>
				                            	</p>
				                            <?php endif; ?>
				                    </div>
			                        <div class="client-info">
			                            <div class="d-flex align-items-center justify-content-center">
			                            	<?php if( ! $item['single_testimonial_img']['url'] == '' ) : ?>
				                                <img src="<?php echo esc_url( $item['single_testimonial_img']['url'] ); ?>" alt="image">
			                                <?php endif; ?>
			                                <div class="title">
			                                    <h3><?php echo esc_html__($item['single_testimonial_name']); ?></h3>
					                            <span class="position"><?php echo esc_html__($item['single_testimonial_position']); ?></span>
			                                </div>
			                            </div>
			                        </div>	                                
			                    </div>
		                    <?php endforeach; ?>
		                </div>
		            </div>
		        </div>
	        <?php elseif( $settings['testimonial_style_select'] == 'style-06' ) : ?>
	        	<?php if( ! $settings['section_bg_img']['url'] == '' ) : ?>
	        	    <div class="ea-testimonial-area ptb-100 bg-gradient-color2">
	        	<?php else: ?>
	        		<div class="ea-testimonial-area ptb-100 bg-gradient-color2">
	        	<?php endif; ?>
		            <div class="container">
		                <div class="section-title">
		                    <h2><?php echo esc_html__($settings['testimonial_title']); ?></h2>
		                    <p><?php echo wp_kses_post($settings['testimonial_desc']); ?></p>
		                </div>
		                <div class="ea-testimonial-slides style-four owl-carousel owl-theme">
		                    <?php foreach ( $settings['single_testimonial'] as $item ) : ?>
		                		<div class="ea-single-testimonial-box style-six ea-elementor-floating">
		                			<div class="desc">
				                        <?php if($item['ea_content_text_type'] == 'content') : ?>
				                                <p><?php echo wp_kses_post($item['single_testimonial_comment']); ?></p>
				                            <?php elseif($item['ea_content_text_type'] == 'template') : ?>
				                            	<p>
				                            		<?php if (!empty($item['ea_content_templates'])) {
										                echo Plugin::$instance->frontend->get_builder_content($item['ea_content_templates'], true);
										            } ?>
				                            	</p>
				                            <?php endif; ?>
				                    </div>
			                        <div class="client-info">
			                            <div class="d-flex align-items-center justify-content-center">
			                            	<?php if( ! $item['single_testimonial_img']['url'] == '' ) : ?>
				                                <img src="<?php echo esc_url( $item['single_testimonial_img']['url'] ); ?>" alt="image">
			                                <?php endif; ?>
			                                <div class="title">
			                                    <h3><?php echo esc_html__($item['single_testimonial_name']); ?></h3>
					                            <span class="position"><?php echo esc_html__($item['single_testimonial_position']); ?></span>
			                                </div>
			                            </div>
			                        </div>	
			                        <?php if(! $item['single_testimonial_icon1'] == '' || ! $item['single_testimonial_icon2'] == '') : ?>
		                                <?php if( $item['icon_type'] == 'general' ) : ?>
	                                	    <i class="quote-ico <?php echo wp_kses_post( $item['single_testimonial_icon1'] ); ?>"></i>
	                                	<?php else: 
	                                		endad_render_icon( $item, 'icon', 'single_testimonial_icon2' ); 
	                                	endif; ?>
		                            <?php endif; ?>                              
			                    </div>
		                    <?php endforeach; ?>
		                </div>
		            </div>
		        </div>
		    <?php elseif( $settings['testimonial_style_select'] == 'style-07' ) : ?>
		    	<div class="ea-testimonial-area pt-100 bg-shape">
		            <div class="container">
		                <div class="section-title">
		                    <h2><?php echo esc_html__($settings['testimonial_title']); ?></h2>
		                    <p><?php echo wp_kses_post($settings['testimonial_desc']); ?></p>
		                </div>
		                <div class="ea-testimonial-slides style-five owl-carousel owl-theme">
		                    <?php foreach ( $settings['single_testimonial'] as $item ) : ?>
		                		<div class="ea-single-testimonial-box style-seven ea-elementor-floating">
		                			<?php if( ! $item['single_testimonial_img']['url'] == '' ) : ?>
		                                <img class="shadow-sm" src="<?php echo esc_url( $item['single_testimonial_img']['url'] ); ?>" alt="image">
	                                <?php endif; ?>
			                        <?php if($item['ea_content_text_type'] == 'content') : ?>
				                                <p><?php echo wp_kses_post($item['single_testimonial_comment']); ?></p>
				                            <?php elseif($item['ea_content_text_type'] == 'template') : ?>
				                            	<p>
				                            		<?php if (!empty($item['ea_content_templates'])) {
										                echo Plugin::$instance->frontend->get_builder_content($item['ea_content_templates'], true);
										            } ?>
				                            	</p>
				                            <?php endif; ?>
			                        <div class="client-info">
			                            <h3><?php echo esc_html__($item['single_testimonial_name']); ?></h3>
			                            <span class="position"><?php echo esc_html__($item['single_testimonial_position']); ?></span>
			                        </div>	
			                        <?php if(! $item['single_testimonial_icon1'] == '' || ! $item['single_testimonial_icon2'] == '') : ?>
		                                <?php if( $item['icon_type'] == 'general' ) : ?>
	                                	    <i class="quote-ico <?php echo wp_kses_post( $item['single_testimonial_icon1'] ); ?>"></i>
	                                	<?php else: 
	                                		endad_render_icon( $item, 'icon', 'single_testimonial_icon2' ); 
	                                	endif; ?>
		                            <?php endif; ?>                                
			                    </div>
		                    <?php endforeach; ?>
		                </div>
		            </div>
		        </div>
		    <?php endif;

	    endif; ?>
	    <!-- End Testimonial Area -->

	<?php

    }
    
}
