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

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

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

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

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

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

		$this->add_control(
			'show_team',
			[
				'label' => __( 'Show/Hide Team Member 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(
			'show_social',
			[
				'label' => __( 'Show/Hide Social Area', '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(
			'team_style_select',
			[
				'label' => __( 'Select Team Member 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(
			'team_section',
			[
				'label' => __( 'Team Member Section', 'endless-addons' ),
				'tab' => \Elementor\Controls_Manager::TAB_CONTENT,
			]
		);

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

		$this->add_control(
			'team_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-team-member-area',
			]
		);

		$this->end_controls_section();

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

		$this->add_control(
			'team_item_column',
			[
				'label' => __( 'Team Member 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-4'
			]
		);

		$repeater = new \Elementor\Repeater();

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

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

		$repeater->add_control(
			'single_team_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' ),
				],
				'description' => __('Used only for Style 03 & Style 05', 'endless-addons'),
				'default' => 'general'
			]
		);

		$repeater->add_control(
			'single_team_icon1', [
				'label' => __( 'Icon', 'endless-addons' ),
				'type' => \Elementor\Controls_Manager::ICON,
				'default'  => 'bx bx-share-alt',
				'show_label' => true,
				'description' => __('Used only for Style 03 & Style 05', 'endless-addons'),
				'options' => endless_addons_icons(),
				'condition' => [
                    'icon_type' => 'general'
                ]
			]
		);

		$repeater->add_control(
			'single_team_icon2', [
				'label' => __( 'Icon', 'endless-addons' ),
				'type' => \Elementor\Controls_Manager::ICONS,
				'show_label' => true,
				'description' => __('Used only for Style 03 & Style 05', 'endless-addons'),
				'condition' => [
                    'icon_type' => 'library'
                ]
			]
		);

		$repeater->add_control(
			'single_team_extra_desc', [
				'label' => __( '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'),
				'description' => __('Used only for Style 06', 'endless-addons'),
			]
		);

		$repeater->add_control(
			'single_team_btn_text', [
				'label' => __( 'Button Text', 'endless-addons' ),
				'type' => \Elementor\Controls_Manager::TEXT,
				'input_type' => 'text',
				'description' => __('Used only for Style 03', 'endless-addons'),
				'default'  => __( 'View Profile', 'endless-addons' )
			]
		);

		$repeater->add_control(
			'single_team_btn_link', [
				'label' => __( 'Button Link', 'endless-addons' ),
				'type' => \Elementor\Controls_Manager::URL,
				'input_type' => 'url',
				'description' => __('Used only for Style 03', 'endless-addons'),
				'default' => [
					'url' => '#',
					'is_external' => true,
					'nofollow' => true
				]
			]
		);

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

		$this->end_controls_section();

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

		$repeater = new \Elementor\Repeater();

		$repeater->add_control(
			'social_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_social_icon1', 
			[
				'label' => __( 'Icon', 'endless-addons' ),
				'type' => \Elementor\Controls_Manager::ICON,
				'input_type' => 'icon',
				'default'  => 'bx bxl-facebook',
				'show_label' => true,
				'options' => endless_addons_icons(),
				'condition' => [
                    'social_icon_type' => 'general'
                ]
			]
		);

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

		$repeater->add_control(
			'single_social_link',
			[
				'label' => __( 'Link', 'endless-addons' ),
				'type' => \Elementor\Controls_Manager::URL,
				'input_type' => 'url',
				'default' => [
					'url' => '#',
					'is_external' => true,
					'nofollow' => true
				]
			]
		);

		$repeater->add_control(
            'want_to_customize',
            [
                'label' => __( 'Want to customize?', 'endless-addons' ),
                'type' => \Elementor\Controls_Manager::SWITCHER,
                'label_on' => __( 'Yes', 'endless-addons' ),
                'label_off' => __( 'No', 'endless-addons' ),
                'return_value' => 'yes',
                'default' => 'no'
            ]
        );

        $repeater->add_control(
			'team_social_icon_bg_color',
			[
				'label' => __( 'Social Icon Background Color', 'endless-addons' ),
				'type' => \Elementor\Controls_Manager::COLOR,
				'input_type' => 'color',
                'condition' => [
                    'want_to_customize' => 'yes'
                ]
			]
		);

		$repeater->add_control(
			'team_social_icon_color',
			[
				'label' => __( 'Social Icon Color', 'endless-addons' ),
				'type' => \Elementor\Controls_Manager::COLOR,
				'input_type' => 'color',
                'condition' => [
                    'want_to_customize' => 'yes'
                ]
			]
		);

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

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

		$this->end_controls_section();

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

		$this->add_control(
			'team_name_color',
			[
				'label' => __( 'Team Name Color', 'endless-addons' ),
				'type' => \Elementor\Controls_Manager::COLOR,
				'input_type' => 'color',
				'selectors' => [
                    '{{WRAPPER}} .ea-single-team-box h3' => 'color: {{VALUE}}'
                ]
			]
		);

        $this->add_group_control(
            \Elementor\Group_Control_Typography::get_type(),
            [
                'name' => 'team_name_typography',
                'label' => __( 'Team Name Typography', 'endless-addons' ),
                'scheme' => \Elementor\Core\Schemes\Typography::TYPOGRAPHY_1,
                'selector' => '{{WRAPPER}} .ea-single-team-box h3'
            ]
        );

        $this->add_control(
			'team_designation_color',
			[
				'label' => __( 'Team Designation Color', 'endless-addons' ),
				'type' => \Elementor\Controls_Manager::COLOR,
				'input_type' => 'color',
				'selectors' => [
                    '{{WRAPPER}} .ea-single-team-box .designation' => 'color: {{VALUE}}'
                ]
			]
		);

        $this->add_group_control(
            \Elementor\Group_Control_Typography::get_type(),
            [
                'name' => 'team_designation_typography',
                'label' => __( 'Team Designation Typography', 'endless-addons' ),
                'scheme' => \Elementor\Core\Schemes\Typography::TYPOGRAPHY_1,
                'selector' => '{{WRAPPER}} .ea-single-team-box .designation'
            ]
        );

        $this->add_control(
			'team_image_height',
			[
				'label' => __( 'Team Image Height', 'endless-addons' ),
				'type' => \Elementor\Controls_Manager::SLIDER,
				'range' => [
					'px' => [
						'min' => 100,
						'max' => 1000
					]
				],
				'selectors' => [
					'{{WRAPPER}} .ea-single-team-box img' => 'height: {{SIZE}}{{UNIT}}',
				],
			]
		);

		$this->add_control(
			'team_image_width',
			[
				'label' => __( 'Team Image Width', 'endless-addons' ),
				'type' => \Elementor\Controls_Manager::SLIDER,
				'range' => [
					'px' => [
						'min' => 100,
						'max' => 1000
					]
				],
				'selectors' => [
					'{{WRAPPER}} .ea-single-team-box img' => 'width: {{SIZE}}{{UNIT}}',
				],
			]
		);

		$this->end_controls_section();

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

		$this->add_control(
			'social_icon_bg_color',
			[
				'label' => __( 'Social Icon Background Color', 'endless-addons' ),
				'type' => \Elementor\Controls_Manager::COLOR,
				'input_type' => 'color',
				'selectors' => [
                    '{{WRAPPER}} .ea-single-team-box ul li a' => 'background: {{VALUE}}'
                ],
                'condition' => [
                    'team_style_select' => array('style-01', 'style-02', 'style-04', 'style-05', 'style-06', 'style-07')
                ]
			]
		);

		$this->add_control(
			'social_icon_color',
			[
				'label' => __( 'Social Icon Color', 'endless-addons' ),
				'type' => \Elementor\Controls_Manager::COLOR,
				'input_type' => 'color',
				'selectors' => [
                    '{{WRAPPER}} .ea-single-team-box ul li a' => 'color: {{VALUE}}'
                ],
                'condition' => [
                    'team_style_select' => array('style-01', 'style-02', 'style-04', 'style-05', 'style-06', 'style-07')
                ]
			]
		);

		$this->add_control(
			'social_icon_bg_hover_color',
			[
				'label' => __( 'Social Icon Background Hover Color', 'endless-addons' ),
				'type' => \Elementor\Controls_Manager::COLOR,
				'input_type' => 'color',
				'selectors' => [
                    '{{WRAPPER}} .ea-single-team-box ul li a:hover' => 'background: {{VALUE}}'
                ],
                'condition' => [
                    'team_style_select' => array('style-01', 'style-02', 'style-04', 'style-05', 'style-06', 'style-07')
                ]
			]
		);

		$this->add_control(
			'social_icon_hover_color',
			[
				'label' => __( 'Social Icon Hover Color', 'endless-addons' ),
				'type' => \Elementor\Controls_Manager::COLOR,
				'input_type' => 'color',
				'selectors' => [
                    '{{WRAPPER}} .ea-single-team-box ul li a:hover' => 'color: {{VALUE}}'
                ],
                'condition' => [
                    'team_style_select' => array('style-01', 'style-02', 'style-04', 'style-05', 'style-06', 'style-07')
                ]
			]
		);

		$this->add_control(
			'team_share_icon_bg_color',
			[
				'label' => __( 'Share Icon Background Color', 'endless-addons' ),
				'type' => \Elementor\Controls_Manager::COLOR,
				'input_type' => 'color',
				'selectors' => [
                    '{{WRAPPER}} .ea-single-team-box.style-one .image .share-btn, .ea-single-team-box.style-five .content i' => 'background-color: {{VALUE}}'
                ],
                'condition' => [
                    'team_style_select' => array('style-01', 'style-05')
                ]
			]
		);

		$this->add_control(
			'team_share_icon_color',
			[
				'label' => __( 'Share Icon Color', 'endless-addons' ),
				'type' => \Elementor\Controls_Manager::COLOR,
				'input_type' => 'color',
				'selectors' => [
                    '{{WRAPPER}} .ea-single-team-box.style-one .image .share-btn, .ea-single-team-box.style-five .content i' => 'color: {{VALUE}}'
                ],
                'condition' => [
                    'team_style_select' => array('style-01', 'style-05')
                ]
			]
		);

		$this->add_control(
			'team_share_icon_bg_hover_color',
			[
				'label' => __( 'Share Icon Background Hover Color', 'endless-addons' ),
				'type' => \Elementor\Controls_Manager::COLOR,
				'input_type' => 'color',
				'selectors' => [
                    '{{WRAPPER}} .ea-single-team-box.style-one:hover .share-btn, .ea-single-team-box.style-five:hover .content i' => 'background-color: {{VALUE}}'
                ],
                'condition' => [
                    'team_style_select' => array('style-01', 'style-05')
                ]
			]
		);

		$this->add_control(
			'team_share_icon_hover_color',
			[
				'label' => __( 'Share Icon Hover Color', 'endless-addons' ),
				'type' => \Elementor\Controls_Manager::COLOR,
				'input_type' => 'color',
				'selectors' => [
                    '{{WRAPPER}} .ea-single-team-box.style-one:hover .share-btn, .ea-single-team-box.style-five:hover .content i' => 'color: {{VALUE}}'
                ],
                'condition' => [
                    'team_style_select' => array('style-01', 'style-05')
                ]
			]
		);

		$this->add_control(
			'button_bg_color',
			[
				'label' => __( 'Button Background Color', 'endless-addons' ),
				'type' => \Elementor\Controls_Manager::COLOR,
				'selectors' => [
                    '{{WRAPPER}} .ea-single-team-box.style-three .link-btn::after' => 'background: {{VALUE}}'
                ],
                'condition' => [
                    'team_style_select' => 'style-03'
                ]
			]
		);

		$this->add_control(
			'button_color',
			[
				'label' => __( 'Button Color', 'endless-addons' ),
				'type' => \Elementor\Controls_Manager::COLOR,
				'selectors' => [
                    '{{WRAPPER}} .ea-single-team-box.style-three .link-btn' => 'color: {{VALUE}}'
                ],
                'condition' => [
                    'team_style_select' => 'style-03'
                ]
			]
		);

		$this->add_control(
			'button_bg_hover_color',
			[
				'label' => __( 'Button Background Hover Color', 'endless-addons' ),
				'type' => \Elementor\Controls_Manager::COLOR,
				'selectors' => [
                    '{{WRAPPER}} .ea-single-team-box.style-three .link-btn:hover' => 'background: {{VALUE}}'
                ],
                'condition' => [
                    'team_style_select' => 'style-03'
                ]
			]
		);

		$this->add_control(
			'button_hover_color',
			[
				'label' => __( 'Button Hover Color', 'endless-addons' ),
				'type' => \Elementor\Controls_Manager::COLOR,
				'selectors' => [
                    '{{WRAPPER}} .ea-single-team-box.style-three .link-btn:hover' => 'color: {{VALUE}}'
                ],
                'condition' => [
                    'team_style_select' => 'style-03'
                ]
			]
		);

		$this->end_controls_section();

		$this->start_controls_section(
			'_section_overlay_style',
			[
				'label' => __('Background Overlay', 'endless-addons'),
				'tab' => \Elementor\Controls_Manager::TAB_STYLE,
				'condition' => [
                    'team_style_select' => array('style-01', 'style-02', 'style-03', 'style-05', 'style-06', '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-team-member-area, .ea-team-member-area.bg-f9f9f9',
			]
		);

		$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-team-member-area:hover, .ea-team-member-area.bg-f9f9f9:hover',
			]
		);

		$this->end_controls_tab();

		$this->end_controls_tabs();

		$this->end_controls_section();

	}

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

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

		<?php if( $settings['team_item_column'] == 'columns-2' ) :
			$team_column_style3 = 'col-lg-5 col-md-6 col-sm-6';
		elseif( $settings['team_item_column'] == 'columns-3' ) :
			$team_column_style3 = 'col-lg-4 col-md-6 col-sm-6';
		elseif( $settings['team_item_column'] == 'columns-4' ) :
			$team_column_style3 = 'col-lg-3 col-md-6 col-sm-6';
		endif; ?>

        <!-- Start Team Member Area -->
        <?php if( $settings['show_team'] == 'show' ) :

	        if( $settings['team_style_select'] == 'style-01' ) : ?>
		        <div class="ea-team-member-area pb-70">
		            <div class="container">
		                <div class="section-title">
		                    <h2><?php echo esc_html__($settings['team_title']); ?></h2>
		                    <p><?php echo wp_kses_post($settings['team_desc']); ?></p>
		                </div>                          
		                <div class="row justify-content-center">
		                	<?php foreach ( $settings['single_team'] as $item ) : ?>
			                	<div class="team-col <?php echo esc_attr( $team_column ); ?>">
			                		<div class="ea-single-team-box style-one">
			                            <div class="image">
			                                <?php if( ! $item['single_team_img']['url'] == '' ) : ?>
				                                <img src="<?php echo esc_url( $item['single_team_img']['url'] ); ?>" alt="image">
			                                <?php endif; ?>
			                                <?php if( $settings['show_social'] == 'show' ) : ?>
				                                <?php if(! $item['single_team_icon1'] == '' || ! $item['single_team_icon2'] == '') : ?>
						                            <span class="share-btn">
						                                <?php if( $item['icon_type'] == 'general' ) : ?>
					                                	    <i class="<?php echo wp_kses_post( $item['single_team_icon1'] ); ?>"></i>
					                                	<?php else: 
					                                		endad_render_icon( $item, 'icon', 'single_team_icon2' ); 
					                                	endif; ?>
						                            </span>
					                            <?php endif; ?>
				                                <ul class="social">
				                                	<?php foreach ( $settings['single_social'] as $social ) : 
				                                		$target = $social['single_social_link']['is_external'] ? ' target="_blank"' : '';
				                                        $nofollow = $social['single_social_link']['nofollow'] ? ' rel="nofollow"' : ''; ?>
					                                    <li>
					                                    	<a style="background-color:<?php echo esc_attr($social['team_social_icon_bg_color']); ?>;color:<?php echo esc_attr($social['team_social_icon_color']); ?>" href="<?php echo esc_url($social['single_social_link']['url']); ?>" <?php echo wp_kses_post( $target ); ?> <?php echo wp_kses_post( $nofollow ); ?>>
					                                    		<?php if( $social['social_icon_type'] == 'general' ) : ?>
							                                	    <i class="<?php echo wp_kses_post( $social['single_social_icon1'] ); ?>"></i>
							                                	<?php else: 
							                                		endad_render_icon( $social, 'icon', 'single_social_icon2' ); 
							                                	endif; ?>
					                                    	</a>
					                                    </li>
					                                <?php endforeach; ?>
				                                </ul>
			                                <?php endif; ?>
			                            </div>
			                            <div class="content">
			                                <h3><?php echo esc_html__($item['single_team_name']); ?></h3>
			                                <span class="designation"><?php echo esc_html__($item['single_team_position']); ?></span>
			                            </div>
			                        </div>
			                	</div>
		                    <?php endforeach; ?>
		                </div>
		            </div>
		        </div>
		    <?php elseif( $settings['team_style_select'] == 'style-02' ) : ?>
		    	<div class="ea-team-member-area pt-100 pb-70 bg-f9f9f9">
		            <div class="container">
		                <div class="section-title">
		                    <h2><?php echo esc_html__($settings['team_title']); ?></h2>
		                    <p><?php echo wp_kses_post($settings['team_desc']); ?></p>
		                </div>
		                <div class="row justify-content-center">
		                    <?php foreach ( $settings['single_team'] as $item ) : ?>
			                	<div class="team-col <?php echo esc_attr( $team_column ); ?>">
			                		<div class="ea-single-team-box style-two">
			                			<?php if( ! $item['single_team_img']['url'] == '' ) : ?>
			                                <img src="<?php echo esc_url( $item['single_team_img']['url'] ); ?>" alt="image">
		                                <?php endif; ?>                         
			                            <div class="name">
			                                <h3><?php echo esc_html__($item['single_team_name']); ?></h3>
			                            </div>
			                            <span class="designation"><?php echo esc_html__($item['single_team_position']); ?></span>
			                            <?php if( $settings['show_social'] == 'show' ) : ?>	
			                                <ul class="social">
			                                	<?php foreach ( $settings['single_social'] as $social ) : 
			                                		$target = $social['single_social_link']['is_external'] ? ' target="_blank"' : '';
			                                        $nofollow = $social['single_social_link']['nofollow'] ? ' rel="nofollow"' : ''; ?>
				                                    <li>
				                                    	<a style="background-color:<?php echo esc_attr($social['team_social_icon_bg_color']); ?>;color:<?php echo esc_attr($social['team_social_icon_color']); ?>" href="<?php echo esc_url($social['single_social_link']['url']); ?>" <?php echo wp_kses_post( $target ); ?> <?php echo wp_kses_post( $nofollow ); ?>>
				                                    		<?php if( $social['social_icon_type'] == 'general' ) : ?>
						                                	    <i class="<?php echo wp_kses_post( $social['single_social_icon1'] ); ?>"></i>
						                                	<?php else: 
						                                		endad_render_icon( $social, 'icon', 'single_social_icon2' ); 
						                                	endif; ?>
				                                    	</a>
				                                    </li>
				                                <?php endforeach; ?>
			                                </ul>
		                                <?php endif; ?> 				                
		                            </div>
			                	</div>
		                    <?php endforeach; ?>
		                </div>
		            </div>
		        </div>
		    <?php elseif( $settings['team_style_select'] == 'style-03' ) : ?>
		    	<div class="ea-team-member-area pt-100 pb-70">
		            <div class="container">
		                <div class="section-title">
		                    <h2><?php echo esc_html__($settings['team_title']); ?></h2>
		                    <p><?php echo wp_kses_post($settings['team_desc']); ?></p>
		                </div>
		                <div class="row justify-content-center">
		                    <?php foreach ( $settings['single_team'] as $item ) : 
		                    	$target = $item['single_team_btn_link']['is_external'] ? ' target="_blank"' : '';
	                            $nofollow = $item['single_team_btn_link']['nofollow'] ? ' rel="nofollow"' : ''; ?>
			                	<div class="team-col <?php echo esc_attr( $team_column_style3 ); ?>">
			                		<div class="ea-single-team-box style-three">
			                            <?php if( ! $item['single_team_img']['url'] == '' ) : ?>
			                                <img src="<?php echo esc_url( $item['single_team_img']['url'] ); ?>" alt="image">
		                                <?php endif; ?>                           
			                            <h3><?php echo esc_html__($item['single_team_name']); ?></h3>
			                            <a href="<?php echo esc_url( $item['single_team_btn_link']['url'] ); ?>" <?php echo wp_kses_post( $target ); ?> <?php echo wp_kses_post( $nofollow ); ?>  class="link-btn"><?php echo esc_html__($item['single_team_btn_text']); ?></a>
			                        </div>
			                	</div>
		                    <?php endforeach; ?>
		                </div>
		            </div>
		        </div>
		    <?php elseif( $settings['team_style_select'] == 'style-04' ) : ?>
		    	<div class="ea-team-member-area pt-100 pb-70 bg-gradient-color">
		            <div class="container">
		                <div class="section-title">
		                    <h2><?php echo esc_html__($settings['team_title']); ?></h2>
		                    <p><?php echo wp_kses_post($settings['team_desc']); ?>
		                    </p>
		                </div>
		                <div class="row justify-content-center">
		                	<?php foreach ( $settings['single_team'] as $item ) : ?>
			                	<div class="team-col <?php echo esc_attr( $team_column ); ?>">
			                		<div class="ea-single-team-box style-four">
			                            <div class="image">
			                                <?php if( ! $item['single_team_img']['url'] == '' ) : ?>
				                                <img src="<?php echo esc_url( $item['single_team_img']['url'] ); ?>" alt="image">
			                                <?php endif; ?>
			                                <?php if( $settings['show_social'] == 'show' ) : ?>
				                                <ul class="social">
				                                	<?php foreach ( $settings['single_social'] as $social ) : 
				                                		$target = $social['single_social_link']['is_external'] ? ' target="_blank"' : '';
				                                        $nofollow = $social['single_social_link']['nofollow'] ? ' rel="nofollow"' : ''; ?>
					                                    <li>
					                                    	<a style="background-color:<?php echo esc_attr($social['team_social_icon_bg_color']); ?>;color:<?php echo esc_attr($social['team_social_icon_color']); ?>" href="<?php echo esc_url($social['single_social_link']['url']); ?>" <?php echo wp_kses_post( $target ); ?> <?php echo wp_kses_post( $nofollow ); ?>>
					                                    		<?php if( $social['social_icon_type'] == 'general' ) : ?>
							                                	    <i class="<?php echo wp_kses_post( $social['single_social_icon1'] ); ?>"></i>
							                                	<?php else: 
							                                		endad_render_icon( $social, 'icon', 'single_social_icon2' ); 
							                                	endif; ?>
					                                    	</a>
					                                    </li>
					                                <?php endforeach; ?>
				                                </ul>
			                                <?php endif; ?>
			                            </div>
			                            <div class="content">
			                                <h3><?php echo esc_html__($item['single_team_name']); ?></h3>
			                                <span class="designation"><?php echo esc_html__($item['single_team_position']); ?></span>
			                            </div>
			                        </div>
			                	</div>			       
		                    <?php endforeach; ?>			               
		                </div>
		            </div>
		        </div>
		    <?php elseif( $settings['team_style_select'] == 'style-05' ) : ?>
		    	<div class="ea-team-member-area pt-100 pb-70">
		            <div class="container">
		                <div class="section-title">
		                    <h2><?php echo esc_html__($settings['team_title']); ?></h2>
		                    <p><?php echo wp_kses_post($settings['team_desc']); ?></p>
		                </div>
		                <div class="row justify-content-center">
		                	<?php foreach ( $settings['single_team'] as $item ) : ?>
			                	<div class="team-col <?php echo esc_attr( $team_column ); ?>">
			                		<div class="ea-single-team-box style-five">
			                            <div class="image">
			                                <?php if( ! $item['single_team_img']['url'] == '' ) : ?>
				                                <img src="<?php echo esc_url( $item['single_team_img']['url'] ); ?>" alt="image">
			                                <?php endif; ?>
			                                <?php if( $settings['show_social'] == 'show' ) : ?>
				                                <ul class="social-link">
				                                	<?php foreach ( $settings['single_social'] as $social ) : 
				                                		$target = $social['single_social_link']['is_external'] ? ' target="_blank"' : '';
				                                        $nofollow = $social['single_social_link']['nofollow'] ? ' rel="nofollow"' : ''; ?>
					                                    <li>
					                                    	<a class="d-block" style="background-color:<?php echo esc_attr($social['team_social_icon_bg_color']); ?>;color:<?php echo esc_attr($social['team_social_icon_color']); ?>" href="<?php echo esc_url($social['single_social_link']['url']); ?>" <?php echo wp_kses_post( $target ); ?> <?php echo wp_kses_post( $nofollow ); ?>>
					                                    		<?php if( $social['social_icon_type'] == 'general' ) : ?>
							                                	    <i class="<?php echo wp_kses_post( $social['single_social_icon1'] ); ?>"></i>
							                                	<?php else: 
							                                		endad_render_icon( $social, 'icon', 'single_social_icon2' ); 
							                                	endif; ?>
					                                    	</a>
					                                    </li>
					                                <?php endforeach; ?>
				                                </ul>
			                                <?php endif; ?>
			                            </div>
			                            <div class="content">
			                                <h3><?php echo esc_html__($item['single_team_name']); ?></h3>
			                                <span class="designation"><?php echo esc_html__($item['single_team_position']); ?></span>
			                                <?php if(! $item['single_team_icon1'] == '' || ! $item['single_team_icon2'] == '') : ?>
					                            <span class="share-btn">
					                                <?php if( $item['icon_type'] == 'general' ) : ?>
				                                	    <i class="<?php echo wp_kses_post( $item['single_team_icon1'] ); ?>"></i>
				                                	<?php else: 
				                                		endad_render_icon( $item, 'icon', 'single_team_icon2' ); 
				                                	endif; ?>
					                            </span>
				                            <?php endif; ?>
			                            </div>
			                        </div>
			                	</div>
		                    <?php endforeach; ?>
		                </div>
		            </div>
		        </div>
	        <?php elseif( $settings['team_style_select'] == 'style-06' ) : ?>
	        	<div class="ea-team-member-area pt-100 pb-70 bg-f9f9f9">
		            <div class="container">
		                <div class="section-title">
		                    <h2><?php echo esc_html__($settings['team_title']); ?></h2>
		                    <p><?php echo wp_kses_post($settings['team_desc']); ?></p>
		                </div>

		                <div class="row justify-content-center">
		                	<?php foreach ( $settings['single_team'] as $item ) : ?>
		                	<div class="team-col <?php echo esc_attr( $team_column ); ?>">
		                		<div class="ea-single-team-box style-six">
		                			<div class="row align-items-center">
			                            <div class="col-lg-4 col-md-4">
		                            		<div class="advisor-image">
				                                <?php if( ! $item['single_team_img']['url'] == '' ) : ?>
					                                <img src="<?php echo esc_url( $item['single_team_img']['url'] ); ?>" alt="image">
				                                <?php endif; ?>
		                                    </div>
		                                </div>
			                            <div class="col-lg-8 col-md-8">
				                            <div class="advisor-content">
				                                <h3><?php echo esc_html__($item['single_team_name']); ?></h3>
				                                <span class="designation sub-title"><?php echo esc_html__($item['single_team_position']); ?></span>
				                                <p><?php echo wp_kses_post($item['single_team_extra_desc']); ?></p>
				                                <?php if( $settings['show_social'] == 'show' ) : ?>
					                                <ul class="social-link">
					                                	<?php foreach ( $settings['single_social'] as $social ) : 
					                                		$target = $social['single_social_link']['is_external'] ? ' target="_blank"' : '';
					                                        $nofollow = $social['single_social_link']['nofollow'] ? ' rel="nofollow"' : ''; ?>
						                                    <li>
						                                    	<a class="d-block" style="background-color:<?php echo esc_attr($social['team_social_icon_bg_color']); ?>;color:<?php echo esc_attr($social['team_social_icon_color']); ?>" href="<?php echo esc_url($social['single_social_link']['url']); ?>" <?php echo wp_kses_post( $target ); ?> <?php echo wp_kses_post( $nofollow ); ?>>
						                                    		<?php if( $social['social_icon_type'] == 'general' ) : ?>
								                                	    <i class="<?php echo wp_kses_post( $social['single_social_icon1'] ); ?>"></i>
								                                	<?php else: 
								                                		endad_render_icon( $social, 'icon', 'single_social_icon2' ); 
								                                	endif; ?>
						                                    	</a>
						                                    </li>
						                                <?php endforeach; ?>
					                                </ul>
				                                <?php endif; ?>
				                            </div>
			                            </div>
			                        </div>
		                        </div>
		                	</div>
	                        <?php endforeach; ?>
			            </div>
		            </div>
		        </div>
		    <?php elseif( $settings['team_style_select'] == 'style-07' ) : ?>
		    	<div class="ea-team-member-area pt-100 bg-shape">
		            <div class="container">
		                <div class="section-title">
		                    <h2><?php echo esc_html__($settings['team_title']); ?></h2>
		                    <p><?php echo wp_kses_post($settings['team_desc']); ?></p>
		                </div>
		                <div class="row justify-content-center">
		                	<?php foreach ( $settings['single_team'] as $item ) : ?>
			                	<div class="team-col <?php echo esc_attr( $team_column ); ?>">
			                		<div class="ea-single-team-box style-seven">
			                            <div class="image">
			                                <?php if( ! $item['single_team_img']['url'] == '' ) : ?>
				                                <img src="<?php echo esc_url( $item['single_team_img']['url'] ); ?>" alt="image">
			                                <?php endif; ?>
			                                <?php if( $settings['show_social'] == 'show' ) : ?>
				                                <ul class="social-link">
				                                	<?php foreach ( $settings['single_social'] as $social ) : 
				                                		$target = $social['single_social_link']['is_external'] ? ' target="_blank"' : '';
				                                        $nofollow = $social['single_social_link']['nofollow'] ? ' rel="nofollow"' : ''; ?>
					                                    <li>
					                                    	<a style="background-color:<?php echo esc_attr($social['team_social_icon_bg_color']); ?>;color:<?php echo esc_attr($social['team_social_icon_color']); ?>" href="<?php echo esc_url($social['single_social_link']['url']); ?>" <?php echo wp_kses_post( $target ); ?> <?php echo wp_kses_post( $nofollow ); ?>>
					                                    		<?php if( $social['social_icon_type'] == 'general' ) : ?>
							                                	    <i class="<?php echo wp_kses_post( $social['single_social_icon1'] ); ?>"></i>
							                                	<?php else: 
							                                		endad_render_icon( $social, 'icon', 'single_social_icon2' ); 
							                                	endif; ?>
					                                    	</a>
					                                    </li>
					                                <?php endforeach; ?>
				                                </ul>
			                                <?php endif; ?>
			                            </div>
			                            <div class="content">
			                                <h3><?php echo esc_html__($item['single_team_name']); ?></h3>
			                                <span class="designation"><?php echo esc_html__($item['single_team_position']); ?></span>
			                            </div>
			                        </div>
			                	</div>
		                    <?php endforeach; ?>
		                </div>
		            </div>
		        </div>
		    <?php endif;

	    endif; ?>
	    <!-- End Team Member Area -->
    <?php

	}

}
