<?php

namespace ThemesflatAddons\Widgets;

use  Elementor\Widget_Base;
use  Elementor\Controls_Manager;
use  Elementor\Scheme_Color;
use  Elementor\Group_Control_Typography;
use  Elementor\Scheme_Typography;

if (!defined('ABSPATH')) {
    exit;
}

// Exit if accessed directly
class TFL_Service_Widget extends TFL_Widget_Base
{
    public function get_name()
    {
        return 'tfl-service';
    }

    public function get_title()
    {
        return __('Service', 'themesflat');
    }

    public function get_icon()
    {
        return 'tfl-icon-briefcase';
    }

    public function get_categories()
    {
        return array('themesflat-addons');
    }

    public function get_custom_help_url()
    {
        return 'https://themesflatelementor.com/docs/themesflat-addons/core-addons/service-addon/';
    }

    public function get_script_depends()
    {
        return ['tfl-waypoints', 'tfl-frontend-scripts'];
    }

    public function get_style_depends()
    {
        return ['tfl-animate-styles', 'tfl-frontend-styles', 'tfl-service-styles','tfl-services-styles'];
    }

    protected function register_controls()
    {
        $this->start_controls_section('section_service', [
            'label' => __('Service', 'themesflat'),
        ]);

        $this->add_control( 'items', [
            'label'   => __( 'Items', 'themesflat' ),
            'type'    => Controls_Manager::NUMBER,
            'min'     => 1,
            'max'     => 25,
            'step'    => 1,
            'default' => 3,
        ] );

        $this->add_control('widget_animation', [
            "type" => Controls_Manager::SELECT,
            "label" => __("Animation Type", "themesflat"),
            'options' => tfl_get_animation_options(),
            'default' => 'none',
        ]);

        $this->end_controls_section();

    }

    protected function render()
    {
        $settings = $this->get_settings_for_display();
        $settings = apply_filters('tfl_service_' . $this->get_id() . '_settings', $settings);
        $args['settings'] = $settings;
        $args['widget_instance'] = $this;
        tfl_get_template_part("addons/service/loop", $args);
    }

    protected function content_template()
    {
    }

}