<?php
/**
 * OrokuBlocks Promo Discount
 * 
 * @package OrokuBlocks
 * @author OrokuBlocks (https://orokublocks.com/)
 * 
 * @since 1.0.0
 * 
 */

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

if ( ! class_exists( 'OrokuBlocks_PromoDiscount_Widget' ) ) {
  class OrokuBlocks_PromoDiscount_Widget extends OrokuBlocks_Widget {
    /**
     * Initialize property values
     * 
     * @since 1.0.0
     * 
     * @access protected
     */
    protected function initialize() {
      $this->widget_id = 'promo_discount';

      $this->defaults = [
        'theme'                                     => 'light',
        'light_primary_color'                       => '#09dfb9',
        'light_background_color'                    => '#ffffff',
        'light_background_alt_color'                => '#f7f7f9',
        'light_line_color'                          => '#c7cdd6',
        'light_text_color'                          => '#22212c',
        'dark_primary_color'                        => '#09dfb9',
        'dark_background_color'                     => '#2b2a3b',
        'dark_background_alt_color'                 => '#21202e',
        'dark_line_color'                           => '#38374b',
        'dark_text_color'                           => '#ffffff',
        'promo_discount_text_gradient_color'        => '#7000ff',
        'promo_discount_text_gradient'              => true,
        'promo_discount_text_gradient_start_color'  => '#7000ff',
        'promo_discount_text_gradient_end_color'    => '#00e3ad',
        'use_plugin_font'                           => true,
        'font_scale'                                => 1,
        'card_border_radius'                        => 24,
        'card_image_border_radius'                  => 14,
        'width'                                     => 0,
        'image_url'                                 => '',
        'title'                                     => 'The Eye Olympus',
        'title_link'                                => '',
        'subtitle'                                  => 'Sunglasses Boutique',
        'summary'                                   => 'On your first digital store purchase, using the promo code <strong>"JENFRAMES"</strong>',
        'button_text'                               => 'Go to the Store',
        'button_link'                               => '#',
        'promo_title'                               => 'PROMO CODE',
        'promo_text'                                => 'ENERGYINFINIT',
        'promo_discount_text'                       => '40% OFF',
        'countdown_enabled'                         => true,
        'countdown_target_date'                     => '',
        'countdown_expiration_text'                 => '',
        'countdown_days_text'                       => 'Days',
        'countdown_hours_text'                      => 'Hours',
        'countdown_minutes_text'                    => 'Mins',
        'countdown_seconds_text'                    => 'Secs',
        'footer_left_title'                         => 'SHARE:',
        'share_facebook_enabled'                    => true,
        'share_x_enabled'                           => true,
        'shortcode'                                 => false
      ];

      $this->control_modules = [
        'content' => [],
        'media_content' => [ 'image_url' ],
        'button_content' => [],
        'meta_content'  => [ 'promo_title', 'promo_text', 'promo_discount_text' ],
        'countdown_content' => [],
        'share_actions' => [],
        'theme' => [],
        'theme_light' => [],
        'theme_dark' => [],
        'font' => [],
        'card' => [],
        'media_style' => [],
        'meta_style'  => []
      ];

      $this->control_section_conditions = [
        'content' => [
          'controls'  => [
            'title'     => [
              'version' => [ 'v1' ]
            ],
            'title_link'     => [
              'version' => [ 'v1' ]
            ],
            'subtitle'  => [
              'version' => [ 'v1' ]
            ]
          ]
        ],
        'meta_content' => [
          'controls'  => [
            'promo_title' => [
              'version'  => [ 'v2', 'v3', 'v4' ]
            ],
            'promo_text' => [
              'version'  => [ 'v2', 'v3', 'v4' ]
            ]
          ]
        ],
        'share_actions' => [
          'condition'  => [
            'version'  =>  [ 'v2', 'v3', 'v4' ]
          ]
        ]
      ];
    }
  }
}