<?php
/**
 * OrokuBlocks Pro Elementor Widget
 * 
 * @package OrokuBlocks
 * @author OrokuBlocks (https://orokublocks.com/)
 * 
 * @since 1.0.0
 * 
 */

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

if ( ! class_exists( 'OrokuBlocks_Elementor_Widget_Pro' ) ) {
  class OrokuBlocks_Elementor_Widget_Pro extends OrokuBlocks_Elementor_Widget_Base {
    /**
     * Returns the widget icon name for displaying to the user
     * 
     * @since 1.0.0
     */
    public function get_icon() {
      return parent::get_icon() . ' oroku-font-icon--pro';
    }

    /**
     * Define the widget controls (setting fields)
     * 
     * @since 1.0.0
     * 
     * @access protected
     */
    protected function register_controls() {
      $this->start_controls_section(
        'content',
        [
          'label' => __( 'Content', 'orokublocks' ),
          'tab'   => \Elementor\Controls_Manager::TAB_CONTENT
        ]
      );

      $this->end_controls_section();
    }

    /**
     * Get widget upsale data.
     *
     * @since 1.0.0
     */
    protected function get_upsale_data() {
      return [
        'condition'     => true,
        'image'         => esc_url( ELEMENTOR_ASSETS_URL . 'images/go-pro.svg' ),
        'image_alt'     => esc_attr__( 'Upgrade', 'orokublocks' ),
        'title'         => esc_html( $this->get_title() ),
        'description'   => esc_html__( 'Upgrade to the pro version of the plugin to get access to all the widgets!.', 'orokublocks' ),
        'upgrade_url'   => esc_url( orokublocks()->getUnlockProUrl() ),
        'upgrade_text'  => esc_html__( 'Upgrade Now', 'orokublocks' )
      ];
    }
  }
}