<?php

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

function ultimate_essential_sets(){
	$icons = array(
		'essential-add',
		'essential-add-1',
		'essential-add-2',
		'essential-add-3',
		'essential-agenda',
		'essential-alarm',
		'essential-alarm-1',
		'essential-alarm-clock',
		'essential-alarm-clock-1',
		'essential-albums',
		'essential-app',
		'essential-archive',
		'essential-archive-1',
		'essential-archive-2',
		'essential-archive-3',
		'essential-attachment',
		'essential-back',
		'essential-battery',
		'essential-battery-1',
		'essential-battery-2',
		'essential-battery-3',
		'essential-battery-4',
		'essential-battery-5',
		'essential-battery-6',
		'essential-battery-7',
		'essential-battery-8',
		'essential-battery-9',
		'essential-binoculars',
		'essential-blueprint',
		'essential-bluetooth',
		'essential-bluetooth-1',
		'essential-bookmark',
		'essential-bookmark-1',
		'essential-briefcase',
		'essential-broken-link',
		'essential-calculator',
		'essential-calculator-1',
		'essential-calendar',
		'essential-calendar-1',
		'essential-calendar-2',
		'essential-calendar-3',
		'essential-calendar-4',
		'essential-calendar-5',
		'essential-calendar-6',
		'essential-calendar-7',
		'essential-checked',
		'essential-checked-1',
		'essential-clock',
		'essential-clock-1',
		'essential-close',
		'essential-cloud',
		'essential-cloud-computing',
		'essential-cloud-computing-1',
		'essential-cloud-computing-2',
		'essential-cloud-computing-3',
		'essential-cloud-computing-4',
		'essential-cloud-computing-5',
		'essential-command',
		'essential-compact-disc',
		'essential-compact-disc-1',
		'essential-compact-disc-2',
		'essential-compass',
		'essential-compose',
		'essential-controls',
		'essential-controls-1',
		'essential-controls-2',
		'essential-controls-3',
		'essential-controls-4',
		'essential-controls-5',
		'essential-controls-6',
		'essential-controls-7',
		'essential-controls-8',
		'essential-controls-9',
		'essential-database',
		'essential-database-1',
		'essential-database-2',
		'essential-database-3',
		'essential-diamond',
		'essential-diploma',
		'essential-dislike',
		'essential-dislike-1',
		'essential-divide',
		'essential-divide-1',
		'essential-division',
		'essential-document',
		'essential-download',
		'essential-edit',
		'essential-edit-1',
		'essential-eject',
		'essential-eject-1',
		'essential-equal',
		'essential-equal-1',
		'essential-equal-2',
		'essential-error',
		'essential-exit',
		'essential-exit-1',
		'essential-exit-2',
		'essential-eyeglasses',
		'essential-fast-forward',
		'essential-fast-forward-1',
		'essential-fax',
		'essential-file',
		'essential-file-1',
		'essential-file-2',
		'essential-film',
		'essential-fingerprint',
		'essential-flag',
		'essential-flag-1',
		'essential-flag-2',
		'essential-flag-3',
		'essential-flag-4',
		'essential-focus',
		'essential-folder',
		'essential-folder-1',
		'essential-folder-10',
		'essential-folder-11',
		'essential-folder-12',
		'essential-folder-13',
		'essential-folder-14',
		'essential-folder-15',
		'essential-folder-16',
		'essential-folder-17',
		'essential-folder-18',
		'essential-folder-19',
		'essential-folder-2',
		'essential-folder-3',
		'essential-folder-4',
		'essential-folder-5',
		'essential-folder-6',
		'essential-folder-7',
		'essential-folder-8',
		'essential-folder-9',
		'essential-forbidden',
		'essential-funnel',
		'essential-garbage',
		'essential-garbage-1',
		'essential-garbage-2',
		'essential-gift',
		'essential-help',
		'essential-hide',
		'essential-hold',
		'essential-home',
		'essential-home-1',
		'essential-home-2',
		'essential-hourglass',
		'essential-hourglass-1',
		'essential-hourglass-2',
		'essential-hourglass-3',
		'essential-house',
		'essential-id-card',
		'essential-id-card-1',
		'essential-id-card-2',
		'essential-id-card-3',
		'essential-id-card-4',
		'essential-id-card-5',
		'essential-idea',
		'essential-incoming',
		'essential-infinity',
		'essential-info',
		'essential-internet',
		'essential-key',
		'essential-lamp',
		'essential-layers',
		'essential-layers-1',
		'essential-like',
		'essential-like-1',
		'essential-like-2',
		'essential-link',
		'essential-list',
		'essential-list-1',
		'essential-lock',
		'essential-lock-1',
		'essential-locked',
		'essential-locked-1',
		'essential-locked-2',
		'essential-locked-3',
		'essential-locked-4',
		'essential-locked-5',
		'essential-locked-6',
		'essential-login',
		'essential-magic-wand',
		'essential-magnet',
		'essential-magnet-1',
		'essential-magnet-2',
		'essential-map',
		'essential-map-1',
		'essential-map-2',
		'essential-map-location',
		'essential-megaphone',
		'essential-megaphone-1',
		'essential-menu',
		'essential-menu-1',
		'essential-menu-2',
		'essential-menu-3',
		'essential-menu-4',
		'essential-microphone',
		'essential-microphone-1',
		'essential-minus',
		'essential-minus-1',
		'essential-more',
		'essential-more-1',
		'essential-more-2',
		'essential-multiply',
		'essential-multiply-1',
		'essential-music-player',
		'essential-music-player-1',
		'essential-music-player-2',
		'essential-music-player-3',
		'essential-mute',
		'essential-muted',
		'essential-navigation',
		'essential-navigation-1',
		'essential-network',
		'essential-newspaper',
		'essential-next',
		'essential-note',
		'essential-notebook',
		'essential-notebook-1',
		'essential-notebook-2',
		'essential-notebook-3',
		'essential-notebook-4',
		'essential-notebook-5',
		'essential-notepad',
		'essential-notepad-1',
		'essential-notepad-2',
		'essential-notification',
		'essential-paper-plane',
		'essential-paper-plane-1',
		'essential-pause',
		'essential-pause-1',
		'essential-percent',
		'essential-percent-1',
		'essential-perspective',
		'essential-photo-camera',
		'essential-photo-camera-1',
		'essential-photos',
		'essential-picture',
		'essential-picture-1',
		'essential-picture-2',
		'essential-pin',
		'essential-placeholder',
		'essential-placeholder-1',
		'essential-placeholder-2',
		'essential-placeholder-3',
		'essential-placeholders',
		'essential-play-button',
		'essential-play-button-1',
		'essential-plus',
		'essential-power',
		'essential-previous',
		'essential-price-tag',
		'essential-print',
		'essential-push-pin',
		'essential-radar',
		'essential-reading',
		'essential-record',
		'essential-repeat',
		'essential-repeat-1',
		'essential-restart',
		'essential-resume',
		'essential-rewind',
		'essential-rewind-1',
		'essential-route',
		'essential-save',
		'essential-search',
		'essential-search-1',
		'essential-send',
		'essential-server',
		'essential-server-1',
		'essential-server-2',
		'essential-server-3',
		'essential-settings',
		'essential-settings-1',
		'essential-settings-2',
		'essential-settings-3',
		'essential-settings-4',
		'essential-settings-5',
		'essential-settings-6',
		'essential-settings-7',
		'essential-settings-8',
		'essential-settings-9',
		'essential-share',
		'essential-share-1',
		'essential-share-2',
		'essential-shuffle',
		'essential-shuffle-1',
		'essential-shutdown',
		'essential-sign',
		'essential-sign-1',
		'essential-skip',
		'essential-smartphone',
		'essential-smartphone-1',
		'essential-smartphone-10',
		'essential-smartphone-11',
		'essential-smartphone-2',
		'essential-smartphone-3',
		'essential-smartphone-4',
		'essential-smartphone-5',
		'essential-smartphone-6',
		'essential-smartphone-7',
		'essential-smartphone-8',
		'essential-smartphone-9',
		'essential-speaker',
		'essential-speaker-1',
		'essential-speaker-2',
		'essential-speaker-3',
		'essential-speaker-4',
		'essential-speaker-5',
		'essential-speaker-6',
		'essential-speaker-7',
		'essential-speaker-8',
		'essential-spotlight',
		'essential-star',
		'essential-star-1',
		'essential-stop',
		'essential-stop-1',
		'essential-stopwatch',
		'essential-stopwatch-1',
		'essential-stopwatch-2',
		'essential-stopwatch-3',
		'essential-stopwatch-4',
		'essential-street',
		'essential-street-1',
		'essential-substract',
		'essential-substract-1',
		'essential-success',
		'essential-switch',
		'essential-switch-1',
		'essential-switch-2',
		'essential-switch-3',
		'essential-switch-4',
		'essential-switch-5',
		'essential-switch-6',
		'essential-switch-7',
		'essential-tabs',
		'essential-tabs-1',
		'essential-target',
		'essential-television',
		'essential-television-1',
		'essential-time',
		'essential-trash',
		'essential-umbrella',
		'essential-unlink',
		'essential-unlocked',
		'essential-unlocked-1',
		'essential-unlocked-2',
		'essential-upload',
		'essential-user',
		'essential-user-1',
		'essential-user-2',
		'essential-user-3',
		'essential-user-4',
		'essential-user-5',
		'essential-user-6',
		'essential-user-7',
		'essential-users',
		'essential-users-1',
		'essential-video-camera',
		'essential-video-camera-1',
		'essential-video-player',
		'essential-video-player-1',
		'essential-video-player-2',
		'essential-view',
		'essential-view-1',
		'essential-view-2',
		'essential-volume-control',
		'essential-volume-control-1',
		'essential-warning',
		'essential-wifi',
		'essential-wifi-1',
		'essential-windows',
		'essential-windows-1',
		'essential-windows-2',
		'essential-windows-3',
		'essential-windows-4',
		'essential-wireless-internet',
		'essential-worldwide',
		'essential-worldwide-1',
		'essential-zoom-in',
		'essential-zoom-out',
	);
	return $icons;
}

class Ultimate_Add_Essential_Icons {
    
    public function __construct() { 
		add_action( 'elementor/editor/after_enqueue_styles', [ $this, 'ultimate_enqueue_essential' ] );
		add_action( 'elementor/frontend/after_enqueue_styles', [ $this, 'ultimate_enqueue_essential' ] );    
		add_filter( 'elementor/icons_manager/additional_tabs', [ $this, 'ultimate_elementor_essential_setup' ] );
	}
    
    public function ultimate_enqueue_essential(){
        wp_enqueue_style( 'essential', ULTIMATE_ADDONS_ROOT_ICON . 'essential/essential.css', array(), '1.0.0' );
    }

	public function ultimate_elementor_essential_setup( $tabs = array()){

		$new_icons = ultimate_essential_sets();

		$tabs['essential'] = array(
			'name'          => 'essential',
			'label'         => esc_html__( 'Essential Icons', 'ultimate' ),
			'labelIcon'     => 'essential-folder-14',
			'prefix'        => '',
			'displayPrefix' => 'essential',
			'url'           => ULTIMATE_ADDONS_ROOT_ICON . 'essential/essential.css',
			'icons'         => $new_icons,
			'ver'           => '1.0.0',
		);
		return $tabs;
	}

}
new Ultimate_Add_Essential_Icons();