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

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

class OrokuBlocks_TestimonialRecommendation_Widget extends OrokuBlocks_Widget {
  /**
   * Initialize property values
   * 
   * @since 1.0.0
   * 
   * @access protected
   */
  protected function initialize() {
    $this->widget_id = 'testimonial_recommendation';

    $this->defaults = [
      'theme'                                 => 'light',
      'light_primary_color'                   => '#8c56ff',
      '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',
      'rating_color'                          => '#ff4370',
      'rating_underline_color'                => '#d9d9d9',
      'user_avatar_border_color'              => '#ff2654',
      'user_avatar_gradient'                  => true,
      'user_avatar_gradient_start_color'      => '#ff2654',
      'user_avatar_gradient_end_color'        => '#ffc700',
      'verified_user_color'                   => '#0084ff',
      'use_plugin_font'                       => true,
      'font_scale'                            => 1,
      'card_border_radius'                    => 24,
      'card_image_border_radius'              => 14,
      'width'                                 => 0,
      'image_url'                             => '',
      'embed_url'                             => '',
      'title'                                 => 'Donut Heaven has the best donuts in the world!',
      'title_link'                            => '',
      'avatar_url'                            => '',
      'user_text'                             => 'By',
      'user_name'                             => 'SweetReviews',
      'user_link'                             => '#',
      'verified_user'                         => true,
      'timestamp'                             => 'JANUARY 14, 2024',
      'recommendation_title'                  => 'RECOMMENDS',
      'recommendation_text'                   => 'Caramel Filled Donut',
      'recommendation_image_url'              => '',
      'score_value'                           => 4.5,
      'score_max_value'                       => 5,
      'summary'                               => '"No joke, these are the best donuts I\'ve ever tasted! You should specially try their new caramel filled ones!"',
      'footer_left_title'                     => 'SHARE:',
      'share_facebook_enabled'                => true,
      'share_x_enabled'                       => true,
      'shortcode'                             => false
    ];

    $this->control_modules = [
      'content' => [ 'title', 'title_link', 'summary' ],
      'media_content' => [],
      'user_content' => [ 'avatar_url', 'user_text', 'user_name', 'verified_user' ],
      'meta_content' => [ 'timestamp' ],
      'score_rating_content' => [ 'score_value' ],
      'recommendation_content'  => [],
      'share_actions' => [],
      'theme' => [],
      'theme_light' => [],
      'theme_dark' => [],
      'font' => [],
      'card' => [],
      'user_style' => [],
      'rating_style' => []
    ];

    $this->control_section_conditions = [
      'media_content' => [
        'controls'  => [
          'image_url'  => [
            'version'  => [ 'v3' ]
          ],
          'embed_url'  => [
            'version'  => [ 'v1', 'v2', 'v4' ]
          ]
        ]
      ],
      'share_actions' => [
        'controls'  => [
          'footer_left_title'  => [
            'version'  =>  [ 'v2' ]
          ]
        ]
      ]
    ];
  }
}