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

use \Elementor\Plugin;

class Elementor_Roadmap_Widget extends \Elementor\Widget_Base {

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

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

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

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

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

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

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

		$this->add_control(
			'select_roadmap_style',
			[
				'label' => __( 'Select Roadmap 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' )
				],
				'default' => 'style-01'
			]
		);

		$this->end_controls_section();

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

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

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

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

		$this->end_controls_section();

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

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

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

		$this->add_control(
			'roadmap_item_column',
			[
				'label' => __( 'Select Roadmap 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' ),
					'columns-6' => __( '6', 'endless-addons' ),
				],
				'default' => 'columns-3',
				'condition' => [
                    'select_roadmap_style' => array('style-01', 'style-03', 'style-04', 'style-05', 'style-06')
                ]
			]
		);

		$this->add_control(
            'roadmap_img_v_alignment',
            [
                'label' => esc_html__('Image Vertical Alignment', 'endless-addons'),
                'type' => \Elementor\Controls_Manager::CHOOSE,
                'label_block' => true,
                'options' => [
                    'top' => [
                        'title' => __('Top', 'endless-addons'),
                        'icon' => 'eicon-v-align-top',
                    ],
                    'bottom' => [
                        'title' => __('Bottom', 'endless-addons'),
                        'icon' => 'eicon-v-align-bottom',
                    ],
                ],
                'default' => 'top',
                'condition' => [
                    'select_roadmap_style' => array('style-01', 'style-04', 'style-05', 'style-06')
                ]
            ]
        );

        $this->add_control(
            'roadmap_img_h_alignment',
            [
                'label' => esc_html__('Image Horizontal Alignment', 'endless-addons'),
                'type' => \Elementor\Controls_Manager::CHOOSE,
                'label_block' => true,
                'options' => [
                    'left' => [
                        'title' => esc_html__('Left', 'endless-addons'),
                        'icon' => 'fa fa-align-left',
                    ],
                    'center' => [
                        'title' => esc_html__('Center', 'endless-addons'),
                        'icon' => 'fa fa-align-center',
                    ],
                    'right' => [
                        'title' => esc_html__('Right', 'endless-addons'),
                        'icon' => 'fa fa-align-right',
                    ],
                ],
                'condition' => [
                    'select_roadmap_style' => array('style-01', 'style-03', 'style-04', 'style-05', 'style-06')
                ]
            ]
        );

        $this->add_control(
            'roadmap_content_h_alignment',
            [
                'label' => esc_html__('Content Horizontal Alignment', 'endless-addons'),
                'type' => \Elementor\Controls_Manager::CHOOSE,
                'label_block' => true,
                'options' => [
                    'left' => [
                        'title' => esc_html__('Left', 'endless-addons'),
                        'icon' => 'fa fa-align-left',
                    ],
                    'center' => [
                        'title' => esc_html__('Center', 'endless-addons'),
                        'icon' => 'fa fa-align-center',
                    ],
                    'right' => [
                        'title' => esc_html__('Right', 'endless-addons'),
                        'icon' => 'fa fa-align-right',
                    ],
                ],
                'condition' => [
                    'select_roadmap_style' => array('style-01', 'style-03', 'style-04', 'style-05', 'style-06')
                ]
            ]
        );

		$repeater = new \Elementor\Repeater();

		$repeater->add_control(
			'roadmap_featured_img',
			[
				'label' => __( 'Featured Image', 'endless-addons' ),
				'type' => \Elementor\Controls_Manager::MEDIA,
				'show_label' => true
			]
		);

		$repeater->add_control(
			'roadmap_number', [
				'label' => __( 'Number', 'endless-addons' ),
				'type' => \Elementor\Controls_Manager::TEXT,
				'input_type' => 'text',
				'default'  => __( '1', 'endless-addons' )
			]
		);

		$repeater->add_control(
			'roadmap_title', [
				'label' => __( 'Title', 'endless-addons' ),
				'type' => \Elementor\Controls_Manager::TEXT,
				'input_type' => 'text',
				'default'  => __( 'Create Account', 'endless-addons' )
			]
		);

		$repeater->add_control(
			'ea_title_tag',
			[
				'label' => __( 'Title Tag', 'endless-addons' ),
				'type' => \Elementor\Controls_Manager::SELECT,
				'input_type' => 'SELECT',
				'options' => [
					'h1' => __( 'h1', 'endless-addons' ),
					'h2' => __( 'h2', 'endless-addons' ),
					'h3' => __( 'h3', 'endless-addons' ),
					'h4' => __( 'h4', 'endless-addons' ),
					'h5' => __( 'h5', 'endless-addons' ),
					'h6' => __( 'h6', 'endless-addons' )
				],
				'default' => 'h3'
			]
		);

		$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(
			'roadmap_desc', [
				'label' => __( 'Description', 'endless-addons' ),
				'type' => \Elementor\Controls_Manager::TEXTAREA,
				'input_type' => 'TEXTAREA',
				'default' => __( 'Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore.', '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',
                ],
            ]
        );

		$repeater->add_control(
            'ea_style_five_format',
            [
                'label' => __( 'Enable Format?', 'endless-addons' ),
                'type' => \Elementor\Controls_Manager::SWITCHER,
                'label_on' => __( 'Yes', 'endless-addons' ),
                'label_off' => __( 'No', 'endless-addons' ),
                'return_value' => 'yes',
                'default' => 'no',
                'description' => 'Used only for style-05'
            ]
        );

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

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

		$this->end_controls_section();

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

		$this->add_control(
			'roadmap_number_color',
			[
				'label' => __( 'Roadmap Number Color', 'endless-addons' ),
				'type' => \Elementor\Controls_Manager::COLOR,
				'selectors' => [
                    '{{WRAPPER}} .ea-road-map-content span, .ea-single-road-map-style-two span, .ea-single-road-map-three span, .ea-single-road-map-ea-style-five span, .ea-single-road-map-ea-style-six .ea-road-map-icon span' => 'color: {{VALUE}}'
                ],
                'condition' => [
                    'select_roadmap_style' => array('style-01', 'style-02', 'style-03', 'style-04', 'style-06')
                ]
			]
		);

		$this->add_group_control(
            \Elementor\Group_Control_Typography::get_type(),
            [
                'name' => 'roadmap_number_typography',
                'label' => __( 'Roadmap Number Typography', 'endless-addons' ),
                'scheme' => \Elementor\Core\Schemes\Typography::TYPOGRAPHY_1,
                'selector' => '{{WRAPPER}} .ea-road-map-content span, .ea-single-road-map-style-two span, .ea-single-road-map-three span, .ea-single-road-map-ea-style-five span, .ea-single-road-map-ea-style-six .ea-road-map-icon span',
                'condition' => [
	                'select_roadmap_style' => array('style-01', 'style-02', 'style-03', 'style-04', 'style-06')
	            ]
            ],
        );

		$this->add_control(
			'roadmap_title_color',
			[
				'label' => __( 'Roadmap Title Color', 'endless-addons' ),
				'type' => \Elementor\Controls_Manager::COLOR,
				'selectors' => [
                    '{{WRAPPER}} .ea-road-map-content .ea-title, .ea-single-road-map-style-two .ea-title, .ea-single-road-map-ea-style-five .ea-title, .ea-single-road-map-ea-style-six .ea-title' => 'color: {{VALUE}}'
                ]
			]
		);

		$this->add_group_control(
            \Elementor\Group_Control_Typography::get_type(),
            [
                'name' => 'roadmap_title_typography',
                'label' => __( 'Roadmap Title Typography', 'endless-addons' ),
                'scheme' => \Elementor\Core\Schemes\Typography::TYPOGRAPHY_1,
                'selector' => '{{WRAPPER}} .ea-road-map-content .ea-title, .ea-single-road-map-style-two .ea-title, .ea-single-road-map-ea-style-five .ea-title, .ea-single-road-map-ea-style-six .ea-title'
            ]
        );

        $this->add_control(
			'roadmap_desc_color',
			[
				'label' => __( 'Roadmap Description Color', 'endless-addons' ),
				'type' => \Elementor\Controls_Manager::COLOR,
				'selectors' => [
                    '{{WRAPPER}} .ea-road-map-content p, .ea-single-road-map-style-two p.desc, .ea-single-road-map-ea-style-five p, .ea-single-road-map-ea-style-six p' => 'color: {{VALUE}}'
                ]
			]
		);

        $this->add_group_control(
            \Elementor\Group_Control_Typography::get_type(),
            [
                'name' => 'roadmap_desc_typography',
                'label' => __( 'Roadmap Description Typography', 'endless-addons' ),
                'scheme' => \Elementor\Core\Schemes\Typography::TYPOGRAPHY_1,
                'selector' => '{{WRAPPER}} .ea-road-map-content p, .ea-single-road-map-style-two p.desc, .ea-single-road-map-ea-style-five p, .ea-single-road-map-ea-style-six p'
            ]
        );

        $this->add_control(
			'roadmap_img_height',
			[
				'label' => __( 'Roadmap Image Height', 'endless-addons' ),
				'type' => \Elementor\Controls_Manager::SLIDER,
				'range' => [
					'px' => [
						'min' => 50,
						'max' => 500
					]
				],
				'selectors' => [
					'{{WRAPPER}} .ea-roadmap-wrapper img' => 'height: {{SIZE}}{{UNIT}}',
				],
			]
		);

		$this->add_control(
			'roadmap_img_width',
			[
				'label' => __( 'Roadmap Image Width', 'endless-addons' ),
				'type' => \Elementor\Controls_Manager::SLIDER,
				'range' => [
					'px' => [
						'min' => 50,
						'max' => 500
					]
				],
				'selectors' => [
					'{{WRAPPER}} .ea-roadmap-wrapper img' => 'width: {{SIZE}}{{UNIT}}',
				],
			]
		);

        $this->add_control(
            'roadmap_img_border_radius',
            [
                'label' => __( 'Roadmap Image Border Radius', 'endless-addons' ),
                'type' => \Elementor\Controls_Manager::DIMENSIONS,
                'size_units' => [ 'px', '%' ],
                'separator' => 'after',
                'selectors' => [
                    '{{WRAPPER}} .ea-roadmap-wrapper img' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
                ],
            ]
        );

		$this->end_controls_section();

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

		$this->start_controls_tabs('_tabs_overlay_style');

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

		$this->add_group_control(
			\Elementor\Group_Control_Background::get_type(),
			[
				'name'     => 'hover_overlay_normal',
				'label' => __('Background', 'endless-addons'),
				'show_label' => true,
				'types' => ['classic', 'gradient'],
				'exclude' => [
					'classic' => 'image'
				],
				'selector' => '{{WRAPPER}} .ea-road-map-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-road-map-area:hover',
			]
		);

		$this->end_controls_tab();

		$this->end_controls_tabs();

		$this->end_controls_section();

	}

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

		$settings = $this->get_settings_for_display(); 

		if( $settings['roadmap_img_h_alignment'] == 'left' ) : 
		    $this->add_render_attribute('roadmap_img_align', 'class', 'roadmap-align is-img-left');
		elseif( $settings['roadmap_img_h_alignment'] == 'center' ) :
            $this->add_render_attribute('roadmap_img_align', 'class', 'roadmap-align is-img-center');
		elseif( $settings['roadmap_img_h_alignment'] == 'right' ) :
            $this->add_render_attribute('roadmap_img_align', 'class', 'roadmap-align is-img-right');
        endif;

        if( $settings['roadmap_content_h_alignment'] == 'left' ) : 
		    $this->add_render_attribute('roadmap_content_align', 'class', 'roadmap-align is-content-left');
		elseif( $settings['roadmap_content_h_alignment'] == 'center' ) :
            $this->add_render_attribute('roadmap_content_align', 'class', 'roadmap-align is-content-center');
		elseif( $settings['roadmap_content_h_alignment'] == 'right' ) :
            $this->add_render_attribute('roadmap_content_align', 'class', 'roadmap-align is-content-right');
        endif; ?>

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

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

			if( $settings['select_roadmap_style'] == 'style-01' ) : ?>
				<!-- Start EA Road Map One Area -->
		        <section class="ea-road-map-area ea-style-one pb-70">
		            <div class="container">
		                <div class="section-title">
		                    <h2><?php echo esc_html($settings['section_title']); ?></h2>
			                <p><?php echo wp_kses_post($settings['section_desc']); ?></p>
		                </div>
		                <div class="row justify-content-center ea-roadmap-wrapper">
		                	<?php foreach ( $settings['single_roadmap'] as $item ) : ?>
			                    <div class="<?php echo esc_attr( $roadmap_column ); ?>">
			                        <div class="ea-single-road-map">
			                        	<?php if( $settings['roadmap_img_v_alignment'] == 'top' ) : ?>
				                        	<div <?php echo $this->get_render_attribute_string('roadmap_img_align'); ?>>
					                            <?php if( ! $item['roadmap_featured_img']['url'] == '' ) : ?>
					                                <img src="<?php echo esc_url( $item['roadmap_featured_img']['url'] ); ?>" alt="image">
				                                <?php endif; ?>
				                            </div>
			                            <?php endif; ?>
			                            <div class="ea-road-map-content">
			                            	<div <?php echo $this->get_render_attribute_string('roadmap_content_align'); ?>>
			                                    <span><?php echo esc_html($item['roadmap_number']); ?></span>
			                                    <<?php echo esc_attr($item['ea_title_tag']); ?> class="ea-title"><?php echo wp_kses_post($item['roadmap_title']); ?></<?php echo esc_attr($item['ea_title_tag']); ?>>
			                                    <?php if($item['ea_content_text_type'] == 'content') : ?>
					                                <p><?php echo wp_kses_post($item['roadmap_desc']); ?></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>
			                            <?php if( $settings['roadmap_img_v_alignment'] == 'bottom' ) : ?>  <br/>
				                        	<div <?php echo $this->get_render_attribute_string('roadmap_img_align'); ?>>
					                            <?php if( ! $item['roadmap_featured_img']['url'] == '' ) : ?>
					                                <img src="<?php echo esc_url( $item['roadmap_featured_img']['url'] ); ?>" alt="image">
				                                <?php endif; ?>
				                            </div>
			                            <?php endif; ?>
			                        </div>
			                    </div>
		                    <?php endforeach; ?>
		                </div>
		            </div>
		        </section>
		        <!-- End EA Road Map One Area -->
		    <?php elseif( $settings['select_roadmap_style'] == 'style-02' ) : ?>
		    	<section class="ea-road-map-area ea-style-two pt-100 pb-70">
		            <div class="container">
		                <div class="section-title">
		                    <h2><?php echo esc_html($settings['section_title']); ?></h2>
			                <p><?php echo wp_kses_post($settings['section_desc']); ?></p>
		                </div>
		                <div class="row">
		                	<ul class="ddddddd ea-roadmap-wrapper">
			                	<?php foreach ( $settings['single_roadmap'] as $item ) : ?>
			                        <li class="ea-single-road-map-style-two">
	                                    <span><?php echo esc_html($item['roadmap_number']); ?></span>
	                                    <<?php echo esc_attr($item['ea_title_tag']); ?> class="ea-title"><?php echo wp_kses_post($item['roadmap_title']); ?></<?php echo esc_attr($item['ea_title_tag']); ?>>
	                                    <?php if($item['ea_content_text_type'] == 'content') : ?>
			                                <p class="desc"><?php echo wp_kses_post($item['roadmap_desc']); ?></p>
			                            <?php elseif($item['ea_content_text_type'] == 'template') : ?>
			                            	<p class="desc">
			                            		<?php if (!empty($item['ea_content_templates'])) {
									                echo Plugin::$instance->frontend->get_builder_content($item['ea_content_templates'], true);
									            } ?>
			                            	</p>
			                            <?php endif; ?>
	                                    <?php if( ! $item['roadmap_featured_img']['url'] == '' ) : ?>
			                                <img src="<?php echo esc_url( $item['roadmap_featured_img']['url'] ); ?>" alt="image">
		                                <?php endif; ?>
			                        </li>
			                    <?php endforeach; ?>
		                    </ul>
		                </div>
		            </div>
		            <div class="ea-shape-1">
		                <?php if( ! $settings['roadmap_shape_img1']['url'] == '' ) : ?>
		                    <img src="<?php echo esc_url( $settings['roadmap_shape_img1']['url'] ); ?>" alt="image">
		                <?php endif; ?>
		            </div>
		            <div class="ea-shape-2">
		                <?php if( ! $settings['roadmap_shape_img2']['url'] == '' ) : ?>
		                    <img src="<?php echo esc_url( $settings['roadmap_shape_img2']['url'] ); ?>" alt="image">
		                <?php endif; ?>
		            </div>
		        </section>
		    <?php elseif( $settings['select_roadmap_style'] == 'style-03' ) : ?>
		    	<section class="ea-road-map-area style-three pt-100">
		            <div class="container">
		                <div class="section-title">
		                    <h2><?php echo esc_html($settings['section_title']); ?></h2>
			                <p><?php echo wp_kses_post($settings['section_desc']); ?></p>
		                </div>
		                <div class="row ea-roadmap-wrapper">
		                	<?php foreach ( $settings['single_roadmap'] as $item ) : ?>
			                    <div class="roadmap-col <?php echo esc_attr( $roadmap_column ); ?>">
			                        <div class="ea-single-road-map-three">
			                        	<span class="ea-main-year"><?php echo esc_html($item['roadmap_number']); ?></span>
			                            <div class="ea-location-road-map">
				                        	<div <?php echo $this->get_render_attribute_string('roadmap_img_align'); ?>>
					                            <?php if( ! $item['roadmap_featured_img']['url'] == '' ) : ?>
					                                <img src="<?php echo esc_url( $item['roadmap_featured_img']['url'] ); ?>" alt="image">
				                                <?php endif; ?>
				                            </div>
			                                <span class="ea-map-year"><?php echo esc_html($item['roadmap_number']); ?></span>
			                            </div>
			                            <div class="ea-road-map-content">
			                            	<div <?php echo $this->get_render_attribute_string('roadmap_content_align'); ?>>
			                                    <<?php echo esc_attr($item['ea_title_tag']); ?> class="ea-title"><?php echo wp_kses_post($item['roadmap_title']); ?></<?php echo esc_attr($item['ea_title_tag']); ?>>
			                                    <?php if($item['ea_content_text_type'] == 'content') : ?>
					                                <p><?php echo wp_kses_post($item['roadmap_desc']); ?></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>
			                        </div>
			                    </div>
		                    <?php endforeach; ?>
		                </div>
		            </div>
		            <div class="ea-road-map-line">
		                <div class="ea-border-line">
		                    <div class="container">
		                        <div class="row">
		                            <div class="col-lg-2">
		                                <div class="ea-dots"></div>
		                            </div>
		                            <div class="col-lg-2">
		                                <div class="ea-dots"></div>
		                            </div>
		                            <div class="col-lg-2">
		                                <div class="ea-dots"></div>
		                            </div>
		                            <div class="col-lg-2">
		                                <div class="ea-dots"></div>
		                            </div>
		                            <div class="col-lg-2">
		                                <div class="ea-dots"></div>
		                            </div>
		                            <div class="col-lg-2">
		                                <div class="ea-dots"></div>
		                            </div>
		                        </div>
		                    </div>
		                </div>
		            </div>
		        </section>
		    <?php elseif( $settings['select_roadmap_style'] == 'style-04' ) : ?>
		    	<section class="ea-road-map-area ea-style-four pt-100 pb-70">
		            <div class="container">
		                <div class="section-title">
		                    <h2><?php echo esc_html($settings['section_title']); ?></h2>
			                <p><?php echo wp_kses_post($settings['section_desc']); ?></p>
		                </div>
		                <div class="row justify-content-center ea-roadmap-wrapper">
		                	<?php foreach ( $settings['single_roadmap'] as $item ) : ?>
			                    <div class="<?php echo esc_attr( $roadmap_column ); ?>">
			                        <div class="ea-single-road-map ea-style-four">
			                        	<?php if( $settings['roadmap_img_v_alignment'] == 'top' ) : ?>
				                        	<div <?php echo $this->get_render_attribute_string('roadmap_img_align'); ?>>
					                            <?php if( ! $item['roadmap_featured_img']['url'] == '' ) : ?>
					                                <img src="<?php echo esc_url( $item['roadmap_featured_img']['url'] ); ?>" alt="image">
				                                <?php endif; ?>
				                            </div>
			                            <?php endif; ?>
			                            <div class="ea-road-map-content">
			                            	<div <?php echo $this->get_render_attribute_string('roadmap_content_align'); ?>>
			                                    <span><?php echo esc_html($item['roadmap_number']); ?></span>
			                                    <<?php echo esc_attr($item['ea_title_tag']); ?> class="ea-title"><?php echo wp_kses_post($item['roadmap_title']); ?></<?php echo esc_attr($item['ea_title_tag']); ?>>
			                                    <?php if($item['ea_content_text_type'] == 'content') : ?>
					                                <p><?php echo wp_kses_post($item['roadmap_desc']); ?></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>
			                            <?php if( $settings['roadmap_img_v_alignment'] == 'bottom' ) : ?>  <br/>
				                        	<div <?php echo $this->get_render_attribute_string('roadmap_img_align'); ?>>
					                            <?php if( ! $item['roadmap_featured_img']['url'] == '' ) : ?>
					                                <img src="<?php echo esc_url( $item['roadmap_featured_img']['url'] ); ?>" alt="image">
				                                <?php endif; ?>
				                            </div>
			                            <?php endif; ?>
			                        </div>
			                    </div>
		                    <?php endforeach; ?>
		                </div>
		            </div>
		            <div class="ea-shape-1">
		                <?php if( ! $settings['roadmap_shape_img1']['url'] == '' ) : ?>
		                    <img src="<?php echo esc_url( $settings['roadmap_shape_img1']['url'] ); ?>" alt="image">
		                <?php endif; ?>
		            </div>
		            <div class="ea-shape-2">
		                <?php if( ! $settings['roadmap_shape_img2']['url'] == '' ) : ?>
		                    <img src="<?php echo esc_url( $settings['roadmap_shape_img2']['url'] ); ?>" alt="image">
		                <?php endif; ?>
		            </div>
		        </section>
		    <?php elseif( $settings['select_roadmap_style'] == 'style-05' ) : ?>
		    	<section class="ea-road-map-area ea-style-five pt-100 pb-70">
		            <div class="container">
		                <div class="section-title">
		                    <h2><?php echo esc_html($settings['section_title']); ?></h2>
			                <p><?php echo wp_kses_post($settings['section_desc']); ?></p>
		                </div>
		                <div class="row justify-content-center ea-roadmap-wrapper">
		                	<?php foreach ( $settings['single_roadmap'] as $item ) : ?>
			                    <div class="roadmap-col <?php echo esc_attr( $roadmap_column ); ?>">
			                        <div class="ea-single-road-map-ea-style-five">
			                        	<?php if( $settings['roadmap_img_v_alignment'] == 'top' ) : ?>
				                        	<div <?php echo $this->get_render_attribute_string('roadmap_img_align'); ?>>
					                            <?php if( ! $item['roadmap_featured_img']['url'] == '' ) : ?>
					                                <img src="<?php echo esc_url( $item['roadmap_featured_img']['url'] ); ?>" alt="image">
				                                <?php endif; ?>
				                            </div>
			                            <?php endif; ?>
		                                <div <?php echo $this->get_render_attribute_string('roadmap_content_align'); ?>>
		                                    <span class="ea-count-number"><?php echo esc_html($item['roadmap_number']); ?></span>
		                                    <<?php echo esc_attr($item['ea_title_tag']); ?> class="ea-title"><?php echo wp_kses_post($item['roadmap_title']); ?></<?php echo esc_attr($item['ea_title_tag']); ?>>
		                                    <?php if($item['ea_content_text_type'] == 'content') : ?>
					                                <p><?php echo wp_kses_post($item['roadmap_desc']); ?></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>
		                                <?php if( $settings['roadmap_img_v_alignment'] == 'bottom' ) : ?>  <br/> 
				                        	<div <?php echo $this->get_render_attribute_string('roadmap_img_align'); ?>>
					                            <?php if( ! $item['roadmap_featured_img']['url'] == '' ) : ?>
					                                <img src="<?php echo esc_url( $item['roadmap_featured_img']['url'] ); ?>" alt="image">
				                                <?php endif; ?>
				                            </div>
			                            <?php endif; ?>
			                        </div>
			                    </div>
			                    <?php if( $item['ea_style_five_format'] == 'yes'): ?> 
				                    <div class="col-12">
				                        <div class="ea-sabrit"></div>
				                    </div>
			                    <?php endif; ?>
		                    <?php endforeach; ?>
		                </div>
		            </div>
		        </section>
		    <?php elseif( $settings['select_roadmap_style'] == 'style-06' ) : ?>
		    	<div class="bg-shape pb-100">
			    	<section class="ea-road-map-area ea-style-six pt-100 pb-70">
			            <div class="container">
			                <div class="section-title">
			                    <h2><?php echo esc_html($settings['section_title']); ?></h2>
				                <p><?php echo wp_kses_post($settings['section_desc']); ?></p>
			                </div>
			                <div class="ea-roadmap-bg-shape">
				                <div class="row justify-content-center ea-roadmap-wrapper">
				                	<?php foreach ( $settings['single_roadmap'] as $item ) : ?>
					                    <div class="<?php echo esc_attr( $roadmap_column ); ?>">
					                        <div class="ea-single-road-map-ea-style-six">
					                        	<div class="ea-road-map-icon">
					                        		<?php if( $settings['roadmap_img_v_alignment'] == 'top' ) : ?>
							                        	<div <?php echo $this->get_render_attribute_string('roadmap_img_align'); ?>>
								                            <?php if( ! $item['roadmap_featured_img']['url'] == '' ) : ?>
								                                <img src="<?php echo esc_url( $item['roadmap_featured_img']['url'] ); ?>" alt="image">
							                                <?php endif; ?>
							                            </div>
						                            <?php endif; ?>
					                                <span><?php echo esc_html($item['roadmap_number']); ?></span>
					                            </div>
					                            <div <?php echo $this->get_render_attribute_string('roadmap_content_align'); ?>>
				                                    <<?php echo esc_attr($item['ea_title_tag']); ?> class="ea-title"><?php echo wp_kses_post($item['roadmap_title']); ?></<?php echo esc_attr($item['ea_title_tag']); ?>>
				                                    <?php if($item['ea_content_text_type'] == 'content') : ?>
					                                <p><?php echo wp_kses_post($item['roadmap_desc']); ?></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>
				                                <?php if( $settings['roadmap_img_v_alignment'] == 'bottom' ) : ?>
				                                	<br/>
						                        	<div <?php echo $this->get_render_attribute_string('roadmap_img_align'); ?>>
							                            <?php if( ! $item['roadmap_featured_img']['url'] == '' ) : ?>
							                                <img src="<?php echo esc_url( $item['roadmap_featured_img']['url'] ); ?>" alt="image">
						                                <?php endif; ?>
						                            </div>
					                            <?php endif; ?>
					                        </div>
					                    </div>
				                    <?php endforeach; ?>
				                </div>
				            </div>
			            </div>
			            <div class="ea-shape-1">
			                <?php if( ! $settings['roadmap_shape_img1']['url'] == '' ) : ?>
			                    <img src="<?php echo esc_url( $settings['roadmap_shape_img1']['url'] ); ?>" alt="image">
			                <?php endif; ?>
			            </div>
			            <div class="ea-shape-2">
			                <?php if( ! $settings['roadmap_shape_img2']['url'] == '' ) : ?>
			                    <img src="<?php echo esc_url( $settings['roadmap_shape_img2']['url'] ); ?>" alt="image">
			                <?php endif; ?>
			            </div>
			        </section>
			    </div>
            <?php endif;

        endif;
    
    }

}
