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

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

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

      $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',
        'status_tag_enabled_icon_color'         => '#00d4cf',
        'status_tag_enabled_background_color'   => '#ffffff',
        'status_tag_disabled_icon_color'        => '#ff5775',
        'status_tag_disabled_background_color'  => '#ffffff',
        'progress_bar_color'                    => '#1200e3',
        'progress_bar_underline_color'          => '#c7cdd6',
        'progress_bar_gradient'                 => true,
        'progress_bar_gradient_start_color'     => '#1200e3',
        'progress_bar_gradient_end_color'       => '#00ceff',
        'use_plugin_font'                       => true,
        'font_scale'                            => 1,
        'card_border_radius'                    => 24,
        'card_image_border_radius'              => 14,
        'width'                                 => 0,
        'image_url'                             => '',
        'embed_url'                             => '',
        'title'                                 => 'Cyberpunk Angel, Part II',
        'title_link'                            => '',
        'subtitle'                              => 'ON CINEMAS: MAY 24TH',
        'summary'                               => '"This cyberpunk futuristic movie doesn\'t need to reinvent the wheel, but succeeds with a great plot and performances"',
        'score_value'                           => 7.5,
        'score_max_value'                       => 10,
        'decimal_points'                        => 0,
        'score_separator'                       => '/',
        'score_text'                            => 'FINAL SCORE',
        'progress_bar_width'                    => 258,
        'progress_bar_breakpoint_width'         => 680,
        'progress_bar_split_parts'              => 1,
        'animate_on_scroll'                     => true,
        'pros_icon'                             => '',
        'pros_status_tag_style'                 => 'outline',
        'pros_title'                            => 'PROS',
        'pros'                                  => [
          [
            'text'  => 'Incredible VFX'
          ],
          [
            'text'  => 'Superb Performances'
          ]
        ],
        'cons_icon'                             => '',
        'cons_status_tag_style'                 => 'outline',
        'cons_title'                            => 'CONS',
        'cons'                                  => [
          [
            'text'  => 'Too Long Runtime'
          ],
          [
            'text'  => 'Dave Character not Fleshed Out'
          ]
        ],
        'footer_left_title'                     => 'SHARE:',
        'share_facebook_enabled'                => true,
        'share_x_enabled'                       => true,
        'shortcode'                             => false
      ];

      $this->control_modules = [
        'content' => [],
        'media_content' => [],
        'score_rating_content' => [],
        'pros_cons_content' => [],
        'share_actions' => [],
        'theme' => [],
        'theme_light' => [],
        'theme_dark' => [],
        'font' => [],
        'card' => [],
        'media_style' => [],
        'progress_bars_style' => [],
        'pros_cons_style' => []
      ];

      $this->control_section_conditions = [
        'media_content' => [
          'controls'  => [
            'image_url'  => [
              'version'  => [ 'v1', 'v2', 'v4' ]
            ],
            'embed_url'  => [
              'version'  => [ 'v3' ]
            ]
          ]
        ],
        'score_rating_content' => [
          'controls'  => [
            'score_separator'  => [
              'version'  => [ 'v1', 'v3' ]
            ]
          ]
        ],
        'share_actions' => [
          'controls'  => [
            'footer_left_title'  => [
              'version'  =>  [ 'v1', 'v2', 'v3' ]
            ]
          ]
        ],
        'media_style' => [
          'condition' => [
            'version'  => [ 'v1', 'v2', 'v4' ]
          ]
        ],
        'progress_bars_style' => [
          'controls'  => [
            'progress_bar_width'  => [
              'version'  => [ 'v1', 'v3' ]
            ],
            'progress_bar_breakpoint_width'  => [
              'version'  => [ 'v1', 'v3' ]
            ],
            'progress_bar_split_parts'  => [
              'version'  => [ 'v1', 'v3' ]
            ]
          ]
        ]
      ];
    }
  }
}