<?php

namespace Unlockafe_addons\Widgets;

use Unlockafe_addons\Traits\Utils as UnlockafeUtils;
use Unlockafe_addons\Traits\Widget_helper;
use Elementor\Widget_Base;
use Elementor\Controls_Manager;
use \Elementor\Utils;
use \Elementor\Control_Media;
use \Elementor\Group_Control_Image_Size;
use \Elementor\Group_Control_Border;
use \Elementor\Group_Control_Box_Shadow;
use \Elementor\Group_Control_Text_Shadow;
use \Elementor\Group_Control_Typography;
use \Elementor\Group_Control_Background;

if (!defined('ABSPATH'))
	exit; // Exit if accessed directly

/**
 * Video Play MP4 Widget
 *
 * @since 1.0.0
 */
class Video_Play_Mp4 extends Widget_Base
{

	use Widget_helper, UnlockafeUtils;

	/**
	 * Retrieve the widget name.
	 *
	 * @since 1.0.0
	 *
	 * @access public
	 *
	 * @return string Widget name.
	 */
	public function get_name()
	{
		return 'unlockafe-video-play-mp4';
	}

	/**
	 * Retrieve the widget title.
	 *
	 * @since 1.0.0
	 *
	 * @access public
	 *
	 * @return string Widget title.
	 */
	public function get_title()
	{
		return __('WPRealizer - Video Play (MP4)', 'unlock-addons-for-elementor');
	}

	/**
	 * Retrieve the widget icon.
	 *
	 * @since 1.0.0
	 *
	 * @access public
	 *
	 * @return string Widget icon.
	 */
	public function get_icon()
	{
		return 'eicon-video-playlist ulicon';
	}

	/**
	 * Retrieve the list of categories the widget belongs to.
	 *
	 * Used to determine where to display the widget in the editor.
	 *
	 * Note that currently Elementor supports only one category.
	 * When multiple categories passed, Elementor uses the first one.
	 *
	 * @since 1.0.0
	 *
	 * @access public
	 *
	 * @return array Widget categories.
	 */
	public function get_categories()
	{
		return ['unlockafe-addons'];
	}

	/**
	 * Retrieve the list of scripts the widget depended on.
	 *
	 * Used to set scripts dependencies required to run the widget.
	 *
	 * @since 1.0.0
	 *
	 * @access public
	 *
	 * @return array Widget scripts dependencies.
	 */
	public function get_script_depends()
	{
		return [];
	}

	public function get_style_depends()
	{
		return ['unlockafe-global'];
	}

	/**
	 * Register the widget controls.
	 *
	 * Adds different input fields to allow the user to change and customize the widget settings.
	 *
	 * @since 1.0.0
	 *
	 * @access protected
	 */

	protected function register_controls()
	{
		$this->register_controls_section();
		$this->style_tab_content();
	}

	protected function register_controls_section()
	{
		// layout Panel
		$this->start_controls_section(
			'wpr_layout',
			[
				'label' => esc_html__('Design Layout', 'unlock-addons-for-elementor'),
			]
		);

		$this->add_control(
			'wpr_design_style',
			[
				'label' => esc_html__('Select Layout', 'unlock-addons-for-elementor'),
				'type' => Controls_Manager::SELECT,
				'options' => [
					'layout-1' => esc_html__('Layout 1', 'unlock-addons-for-elementor'),
					'layout-2' => esc_html__('Layout 2', 'unlock-addons-for-elementor'),
					'layout-3' => esc_html__('Layout 3', 'unlock-addons-for-elementor'),
					'layout-4' => esc_html__('Layout 4', 'unlock-addons-for-elementor'),
					'layout-5' => esc_html__('Layout 5', 'unlock-addons-for-elementor'),
					'layout-6' => esc_html__('Layout 6', 'unlock-addons-for-elementor'),
				],
				'default' => 'layout-1',
			]
		);

		$this->end_controls_section();

		// testimonial content section
		$this->start_controls_section(
			'wpr_heading_content_section',
			[
				'label' => __('Section Content', 'unlock-addons-for-elementor'),
				'tab' => Controls_Manager::TAB_CONTENT,
			]
		);

		$this->add_control(
			'wpr_sub_title',
			[
				'label' => esc_html__('Section Sub Title', 'unlock-addons-for-elementor'),
				'type' => Controls_Manager::TEXT,
				'default' => esc_html__('Section Sub Title', 'unlock-addons-for-elementor'),
				'label_block' => true,
				'condition' => [
					'wpr_design_style' => ['layout-4']
				],
			]
		);

		$this->add_control(
			'wpr_title',
			[
				'label' => esc_html__('Section Title', 'unlock-addons-for-elementor'),
				'type' => Controls_Manager::TEXT,
				'default' => esc_html__('Section Title', 'unlock-addons-for-elementor'),
				'label_block' => true,
				'condition' => [
					'wpr_design_style' => ['layout-3', 'layout-4', 'layout-6']
				],
			]
		);

		$this->add_control(
			'wpr_description',
			[
				'label' => esc_html__('Section Description', 'unlock-addons-for-elementor'),
				'type' => Controls_Manager::TEXTAREA,
				'default' => esc_html__('Description', 'unlock-addons-for-elementor'),
				'label_block' => true,
				'condition' => [
					'wpr_design_style' => ['layout-10'],
				]
			]
		);

		$this->add_control(
			'video_button_text',
			[
				'label' => esc_html__('Video Button Text', 'unlock-addons-for-elementor'),
				'type' => Controls_Manager::TEXT,
				'default' => esc_html__('Play intro video', 'unlock-addons-for-elementor'),
				'label_block' => true,
				'placeholder' => esc_html__('Video Button Text', 'unlock-addons-for-elementor'),
				'condition' => [
					'wpr_design_style' => 'layout-4'
				]
			]
		);

		$this->add_control(
			'wpr_button_img',
			[
				'label' => esc_html__('Button Image', 'unlock-addons-for-elementor'),
				'type' => \Elementor\Controls_Manager::MEDIA,
				'default' => [
					'url' => \Elementor\Utils::get_placeholder_image_src(),
				],
				'condition'   => ['wpr_design_style'   => ['layout-5']]

			]
		);


		$this->add_control(
			'wpr_video_button_url',
			[
				'label' => esc_html__('Video Button URL', 'unlock-addons-for-elementor'),
				'type' => Controls_Manager::TEXTAREA,
				'default' => 'Url Here',
				'label_block' => true,
				'description' => __("We recommended to put 'mp4' format video.", 'unlock-addons-for-elementor'),
				'condition' => [
					'wpr_design_style' => ['layout-4', 'layout-5']
				],
			]
		);

		$this->add_control(
			'wpr_number',
			[
				'label' => esc_html__('Number', 'unlock-addons-for-elementor'),
				'type' => Controls_Manager::TEXT,
				'default' => esc_html__('15+', 'unlock-addons-for-elementor'),
				'label_block' => true,
				'condition' => [
					'wpr_design_style' => ['layout-4']
				],
			]
		);

		$this->add_control(
			'wpr_number_desc',
			[
				'label' => esc_html__('Number Description', 'unlock-addons-for-elementor'),
				'type' => Controls_Manager::TEXTAREA,
				'default' => esc_html__('Years experience of creating', 'unlock-addons-for-elementor'),
				'label_block' => true,
				'condition' => [
					'wpr_design_style' => ['layout-4']
				],
			]
		);

		$this->add_control(
			'wpr_designation',
			[
				'label' => esc_html__('Designation', 'unlock-addons-for-elementor'),
				'type' => Controls_Manager::TEXT,
				'default' => esc_html__('FOUNDER AND CEO', 'unlock-addons-for-elementor'),
				'label_block' => true,
				'condition' => [
					'wpr_design_style' => ['layout-4']
				],
			]
		);

		$this->add_control(
			'wpr_brand_logo',
			[
				'label' => esc_html__('Choose Brand Logo', 'unlock-addons-for-elementor'),
				'type' => \Elementor\Controls_Manager::MEDIA,
				'default' => [
					'url' => \Elementor\Utils::get_placeholder_image_src(),
				],
				'condition'   => ['wpr_design_style'   => ['layout-4']]

			]
		);

		$this->add_control(
			'wpr_avatar',
			[
				'label' => esc_html__('Choose Avatar', 'unlock-addons-for-elementor'),
				'type' => \Elementor\Controls_Manager::MEDIA,
				'default' => [
					'url' => \Elementor\Utils::get_placeholder_image_src(),
				],
				'condition'   => ['wpr_design_style'   => ['layout-4']]

			]
		);

		$this->end_controls_section();

		// Content
		$this->start_controls_section(
			'video_content',
			[
				'label' => esc_html__('Video Content', 'unlock-addons-for-elementor'),
			]
		);

		$this->add_control(
			'wpr_video_url',
			[
				'label' => esc_html__('Video URL', 'unlock-addons-for-elementor'),
				'type' => Controls_Manager::TEXTAREA,
				'default' => 'Url Here',
				'label_block' => true,
				'description' => __("We recommended to put 'mp4' format video.", 'unlock-addons-for-elementor')
			]
		);

		$this->add_control(
			'wpr_tag_icon_type',
			[
				'label' => esc_html__('Video Icon Type', 'unlock-addons-for-elementor'),
				'type' => Controls_Manager::CHOOSE,
				'label_block' => false,
				'options' => [
					'icon' => [
						'title' => esc_html__('Icon', 'unlock-addons-for-elementor'),
						'icon' => 'eicon-nerd-wink',
					],
					'image' => [
						'title' => esc_html__('Image', 'unlock-addons-for-elementor'),
						'icon' => 'fa fa-image',
					],
					'svg' => [
						'title' => esc_html__('Svg', 'unlock-addons-for-elementor'),
						'icon' => 'fas fa-code',
					],
				],
				'default' => 'icon',
				'toggle' => false,
				'style_transfer' => true,
				'condition' => [
					'wpr_design_style' => ['layout-20', 'layout-30', 'layout-40']
				]
			]
		);

		$this->add_control(
			'image',
			[
				'label' => esc_html__('Image', 'unlock-addons-for-elementor'),
				'type' => Controls_Manager::MEDIA,
				'default' => [
					'url' => Utils::get_placeholder_image_src(),
				],
				'condition' => [
					'wpr_tag_icon_type' => 'image',
					'wpr_design_style' => ['layout-20', 'layout-30', 'layout-40']
				],
			]
		);

		$this->add_control(
			'icon',
			[
				'label' => esc_html__('Icon', 'unlock-addons-for-elementor'),
				'type' => Controls_Manager::ICONS,
				'default' => [
					'value' => 'fas fa-play',
					'library' => 'solid',

				],
				'condition' => [
					'wpr_tag_icon_type' => 'icon',
					'wpr_design_style' => ['layout-10']
				]
			]
		);

		$this->add_control(
			'svg',
			[
				'type' => Controls_Manager::TEXTAREA,
				'label_block' => true,
				'label' => __('Svg Code', 'unlock-addons-for-elementor'),
				'default' => __('Svg Code Here', 'unlock-addons-for-elementor'),
				'placeholder' => __('Type Svg Code here', 'unlock-addons-for-elementor'),
				'dynamic' => [
					'active' => true,
				],
				'condition' => [
					'wpr_tag_icon_type' => 'svg',
				],
			]
		);

		$this->add_control(
			'video_text',
			[
				'label' => esc_html__('Video Title', 'unlock-addons-for-elementor'),
				'type' => Controls_Manager::TEXT,
				'default' => esc_html__('Video Text', 'unlock-addons-for-elementor'),
				'label_block' => true,
				'placeholder' => esc_html__('Video Text', 'unlock-addons-for-elementor'),
				'condition' => [
					'wpr_design_style' => 'layout-20'
				]
			]
		);

		$this->end_controls_section();
	}

	protected function style_tab_content()
	{
		$this->tp_section_style_controls('section', 'Section - Style', '.wpr-el-section');
		$this->tp_basic_style_controls('wpr_video_sub_title', 'Video Sub Title', '.wpr-el-subtitle', ['layout-3']);
		$this->tp_basic_style_controls('wpr_video_title', 'Video Title', '.wpr-el-title', ['layout-3', 'layout-4']);
		$this->tp_basic_style_controls('wpr_video_number', 'Number', '.wpr-el-number', ['layout-4']);
		$this->tp_basic_style_controls('wpr_video_number_desc', ' Number Description', '.wpr-el-number-desc', ['layout-4']);
		$this->tp_link_controls_style('wpr_video_btn_style', 'Video Button', '.wpr-el-btn', ['layout-4']);

		$this->start_controls_section(
			'wpr_v_p_btn_section',
			[
				'label' => esc_html__('Play Button Style', 'unlock-addons-for-elementor'),
				'tab'   => \Elementor\Controls_Manager::TAB_STYLE,
				'condition' => [
					'wpr_design_style' => ['layout-2']
				]
			]
		);

		$this->add_group_control(
			\Elementor\Group_Control_Typography::get_type(),
			[
				'name' => 'wpr_v_p_btn_text_typo',
				'label'   => esc_html__('Button Typography', 'unlock-addons-for-elementor'),
				'selector' => '{{WRAPPER}} .wpr_v_p_btn_text',
			]
		);

		$this->add_control(
			'wpr_v_p_btn_text_color',
			[
				'label'       => esc_html__('Text Color', 'unlock-addons-for-elementor'),
				'type'     => \Elementor\Controls_Manager::COLOR,
				'selectors' => [
					'{{WRAPPER}} .wpr_v_p_btn_text' => 'color: {{VALUE}}',
				],
			]
		);

		$this->add_control(
			'wpr_v_p_btn_icon_bg_color',
			[
				'label'       => esc_html__('Background Color', 'unlock-addons-for-elementor'),
				'type'     => \Elementor\Controls_Manager::COLOR,
				'selectors' => [
					'{{WRAPPER}} .wpr__play_btn' => 'background: {{VALUE}}',
				],
			]
		);

		$this->add_control(
			'wpr_v_p_btn_icon_w',
			[
				'label' => esc_html__('Icon width', 'unlock-addons-for-elementor'),
				'type' => \Elementor\Controls_Manager::SLIDER,
				'size_units' => ['px',],
				'range' => [
					'px' => [
						'min' => 0,
						'step' => 1,
					],
				],
				'selectors' => [
					'{{WRAPPER}} .wpr__play_btn' => 'width: {{SIZE}}{{UNIT}};',
				],
			]
		);

		$this->add_control(
			'wpr_v_p_btn_icon_h',
			[
				'label' => esc_html__('Icon Height', 'unlock-addons-for-elementor'),
				'type' => \Elementor\Controls_Manager::SLIDER,
				'size_units' => ['px',],
				'range' => [
					'px' => [
						'min' => 0,
						'step' => 1,
					],
				],
				'selectors' => [
					'{{WRAPPER}} .wpr__play_btn' => 'Height: {{SIZE}}{{UNIT}};',
				],
			]
		);

		$this->add_control(
			'wpr_v_p_btn_icon_margin',
			[
				'label'      => esc_html__('Icon margin', 'unlock-addons-for-elementor'),
				'type'       => \Elementor\Controls_Manager::DIMENSIONS,
				'size_units' => ['px'],
				'selectors'  => [
					'{{WRAPPER}} .wpr__play_btn' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
				],
			]
		);

		$this->end_controls_section();

		// image 
		$this->start_controls_section(
			'wpr_video_image_tab',
			[
				'label' => esc_html__('Image Style', 'unlock-addons-for-elementor'),
				'condition' => [
					'wpr_design_style' => ['layout-20', 'layout-30']
				]
			]
		);

		$this->add_control(
			'wpr_video_image_w',
			[
				'type' => \Elementor\Controls_Manager::SLIDER,
				'label' => esc_html__('Image Width', 'unlock-addons-for-elementor'),
				'size_units' => ['px', '%'],
				'range' => [
					'px' => [
						'min' => 1,
						'max' => 2000,
					],
				],
				'selectors' => [
					'{{WRAPPER}} .wpr-el-video-img img' => 'min-width: {{SIZE}}{{UNIT}};',
				],
			]
		);

		$this->add_control(
			'wpr_video_image_h',
			[
				'type' => \Elementor\Controls_Manager::SLIDER,
				'label' => esc_html__('Image Height', 'unlock-addons-for-elementor'),
				'size_units' => ['px', '%'],
				'range' => [
					'px' => [
						'min' => 1,
						'max' => 2000,
					],
				],
				'selectors' => [
					'{{WRAPPER}} .wpr-el-video-img img' => 'height: {{SIZE}}{{UNIT}};',
				],
			]
		);


		$this->add_control(
			'wpr_image_object_style',
			[
				'label' => esc_html__('Object Fit', 'unlock-addons-for-elementor'),
				'type' => \Elementor\Controls_Manager::SELECT,
				'default' => 'cover',
				'options' => [
					'none' => esc_html__('None', 'unlock-addons-for-elementor'),
					'contain'  => esc_html__('Contain', 'unlock-addons-for-elementor'),
					'cover' => esc_html__('Cover', 'unlock-addons-for-elementor'),
					'fill' => esc_html__('fill', 'unlock-addons-for-elementor'),
				],
				'selectors' => [
					'{{WRAPPER}} .wpr-el-video-img img' => 'object-fit: {{VALUE}};',
				],
			]
		);

		$this->end_controls_section();
	}

	/**
	 * Render the widget output on the frontend.
	 *
	 * Written in PHP and used to generate the final HTML.
	 *
	 * @since 1.0.0
	 *
	 * @access protected
	 */
	protected function render()
	{
		$settings = $this->get_settings_for_display();
?>

		<?php if ($settings['wpr_design_style'] == 'layout-2'): ?>

			<?php if (!empty($settings['wpr_video_url'])): ?>
				<div class="footer-three__bottom">
					<video autoplay loop muted playsinline class="w-100 d-block row-padding-top">
						<source src="<?php echo esc_url($settings['wpr_video_url']); ?>" type="video/mp4" />
						<?php esc_html__('Your browser does not support the video tag.', 'unlock-addons-for-elementor'); ?>
					</video>
				</div>
			<?php endif; ?>

		<?php elseif ($settings['wpr_design_style'] == 'layout-3') : ?>

			<?php if (!empty($settings['wpr_video_url'])): ?>
				<div class="about-since-year fade-anim" data-offset="200">
					<video autoplay loop muted playsinline>
						<source src="<?php echo esc_url($settings['wpr_video_url']); ?>" type="video/mp4" />
						<?php esc_html__('Your browser does not support the video tag.', 'unlock-addons-for-elementor'); ?>
					</video>

					<?php if (!empty($settings['wpr_title'])): ?>
						<h3 class="year wpr-el-title">
							<?php echo $this->tp_kses($settings['wpr_title']); ?>
						</h3>
					<?php endif; ?>
				</div>
			<?php endif; ?>


		<?php elseif ($settings['wpr_design_style'] == 'layout-4') : ?>

			<!--================= introduction section start =================-->
			<section id="introduction-section" class="introduction section">
				<div class="container">
					<div class="row justify-content-center">
						<div class="col-md-11 col-lg-10 col-xl-8">
							<div class="section-header introduction__header">
								<?php if (!empty($settings['wpr_sub_title'])): ?>
									<span class="section-sub-title wpr-el-subtitle">
										<?php echo $this->tp_kses($settings['wpr_sub_title']); ?>
									</span>
								<?php endif; ?>
								<?php if (!empty($settings['wpr_title'])): ?>
									<h2 class="section-title tp_text_invert wpr-el-title">
										<?php echo $this->tp_kses($settings['wpr_title']); ?>
									</h2>
								<?php endif; ?>
								<span class="has-line"></span>
							</div>
						</div>
					</div>
					<div class="row row-padding-bottom">
						<div class="col-12">
							<div class="introduction__content">
								<?php if (!empty($settings['wpr_video_button_url'])): ?>
									<a href="<?php echo esc_url($settings['wpr_video_button_url']); ?>" class="orvio-btn5 wpr-el-btn">
										<span class="text"><?php echo $this->tp_kses($settings['video_button_text']); ?></span>
										<span class="icon">
											<svg
												xmlns="http://www.w3.org/2000/svg"
												width="22"
												height="17"
												viewBox="0 0 22 17"
												fill="none">
												<path
													d="M0 8.50002H21C18.9737 7.78574 15.0316 5.28573 15.4737 1"
													stroke="currentColor"
													stroke-width="1.5" />
												<path
													d="M4.42105 8.49998H21C18.9737 9.21426 15.0316 11.7143 15.4737 16"
													stroke="currentColor"
													stroke-width="1.5" />
											</svg>
										</span>
									</a>
								<?php endif; ?>

								<?php if (!empty($settings['wpr_number'])): ?>
									<div class="total-year-info">
										<span class="total-year t-counter wpr-el-number">
											<?php echo $this->tp_kses($settings['wpr_number']); ?>
										</span>
										<p class="text"><?php echo $this->tp_kses($settings['wpr_number_desc']); ?></p>
									</div>
								<?php endif; ?>

								<div class="founder">
									<?php if (!empty($settings['wpr_avatar'])) : ?>
										<div class="founder-avatar">
											<?php echo wp_get_attachment_image($settings['wpr_avatar']['id'], 'full', '', ['class' => '']) ?>
										</div>
									<?php endif; ?>

									<?php if (!empty($settings['wpr_designation'])): ?>
										<h6 class="title">
											<?php echo $this->tp_kses($settings['wpr_designation']); ?>
										</h6>
									<?php endif; ?>
								</div>
							</div>
						</div>
					</div>
				</div>
				<div class="container large-container">
					<div class="row">
						<div class="col-12">
							<div class="introduction__video">
								<div class="color-shape">
									<svg
										xmlns="http://www.w3.org/2000/svg"
										width="1845"
										height="1157"
										viewBox="0 0 1845 1157"
										fill="none">
										<g filter="url(#filter0_f_2020_33)">
											<path
												d="M1544.08 578.5C1544.08 732.311 1265.79 857 922.5 857C579.211 857 300.921 732.311 300.921 578.5C300.921 424.689 249.123 300 922.5 300C1595.88 300 1544.08 424.689 1544.08 578.5Z"
												fill="currentColor" />
										</g>
										<defs>
											<filter
												id="filter0_f_2020_33"
												x="0"
												y="0"
												filterUnits="userSpaceOnUse"
												color-interpolation-filters="sRGB">
												<feFlood
													flood-opacity="0"
													result="BackgroundImageFix" />
												<feBlend
													mode="normal"
													in="SourceGraphic"
													in2="BackgroundImageFix"
													result="shape" />
												<feGaussianBlur
													result="effect1_foregroundBlur_2020_33" />
											</filter>
										</defs>
									</svg>
								</div>

								<?php if (!empty($settings['wpr_video_url'])): ?>
									<video autoplay muted loop class="d-block intro_video">
										<source src="<?php echo esc_url($settings['wpr_video_url']); ?>" type="video/mp4" />
									</video>
								<?php endif; ?>

								<?php if (!empty($settings['wpr_brand_logo'])) : ?>
									<div class="video-info">
										<?php echo wp_get_attachment_image($settings['wpr_brand_logo']['id'], 'full', '', ['class' => '']) ?>
									</div>
								<?php endif; ?>
							</div>
						</div>
					</div>
				</div>
			</section>
			<!--================= introduction section end =================-->


		<?php elseif ($settings['wpr_design_style'] == 'layout-5') : ?>

			<?php if (!empty($settings['wpr_video_url'])): ?>
				<!--================= video section start =================-->
				<div class="video-5 section">
					<?php if (!empty($settings['wpr_button_img'])) : ?>
						<?php if (!empty($settings['wpr_video_button_url'])): ?>
							<a href="<?php echo esc_url($settings['wpr_video_button_url']); ?>" class="learn-more">
								<?php echo wp_get_attachment_image($settings['wpr_button_img']['id'], 'full', '', ['class' => '']) ?>
							</a>
						<?php endif; ?>
					<?php endif; ?>

					<video muted autoplay loop preload="auto" class="video-5__video">
						<source src="<?php echo esc_url($settings['wpr_video_url']); ?>" type="video/webm" />
					</video>
				</div>
				<!--================= video section end =================-->
			<?php endif; ?>

		<?php elseif ($settings['wpr_design_style'] == 'layout-6') : ?>

			<div class="section-header v2 about-7__content right-content">
				<div class="since-year">
					<video autoplay loop muted playsinline>
						<source
							src="<?php echo esc_url($settings['wpr_video_url']); ?>"
							type="video/mp4" />
						<?php esc_html__('Your browser does not support the video tag.', 'unlock-addons-for-elementor'); ?>
					</video>
					<h3 class="year wpr-el-title">
						<svg>
							<defs>
								<mask id="text-mask">
									<rect width="100%" height="100%" fill="white" />
									<text
										class="svg-mask-text"
										dominant-baseline="middle"
										text-anchor="middle"
										fill="black">
										<?php echo $this->tp_kses($settings['wpr_title']); ?>
									</text>
								</mask>
							</defs>
							<rect
								width="100%"
								height="100%"
								fill="currentColor"
								mask="url(#text-mask)" />
						</svg>
					</h3>
				</div>
			</div>

		<?php else: ?>

			<?php if (!empty($settings['wpr_video_url'])): ?>
				<div class="service-2__video">
					<video autoplay loop muted playsinline>
						<source src="<?php echo esc_url($settings['wpr_video_url']); ?>" type="video/mp4" />
						<?php esc_html__('Your browser does not support the video tag.', 'unlock-addons-for-elementor'); ?>
					</video>
				</div>
			<?php endif; ?>


<?php endif;
	}
}


