<?php
pxl_add_custom_widget(
    array(
        'name' => 'pxl_heading',
        'title' => esc_html__('BR Heading', 'breeza' ),
        'icon' => 'eicon-heading',
        'categories' => array('pxltheme-core'),
        'params' => array(
            'sections' => array(
                array(
                    'name' => 'section_content',
                    'label' => esc_html__('Content', 'breeza' ),
                    'tab' => \Elementor\Controls_Manager::TAB_CONTENT,
                    'controls' => array(
                        array(
                            'name' => 'source_type',
                            'label' => esc_html__('Source Type', 'breeza' ),
                            'type' => \Elementor\Controls_Manager::SELECT,
                            'options' => [
                                'text' => 'Text',
                                'title' => 'Page Title',
                            ],
                            'default' => 'text',
                        ),
                        array(
                            'name' => 'title',
                            'label' => esc_html__('Title', 'breeza' ),
                            'type' => \Elementor\Controls_Manager::TEXTAREA,
                            'label_block' => true,
                            'description' => 'Create highlight text width shortcode: [highlight text="Text Demo"],[line text="Text Demo"],[outline text="Text Demo"]',
                            'condition' => [
                                'source_type' => ['text'],
                            ],
                        ),
                        array(
                            'name' => 'sub_title',
                            'label' => esc_html__('Sub Title', 'breeza' ),
                            'type' => \Elementor\Controls_Manager::TEXT,
                            'label_block' => true,
                        ),
                        array(
                          'name' => 'align',
                          'label' => esc_html__( 'Alignment', 'breeza' ),
                          'type' => \Elementor\Controls_Manager::CHOOSE,
                          'control_type' => 'responsive',
                          'options' => [
                            'left' => [
                                'title' => esc_html__( 'Left', 'breeza' ),
                                'icon' => 'eicon-text-align-left',
                            ],
                            'center' => [
                                'title' => esc_html__( 'Center', 'breeza' ),
                                'icon' => 'eicon-text-align-center',
                            ],
                            'right' => [
                                'title' => esc_html__( 'Right', 'breeza' ),
                                'icon' => 'eicon-text-align-right',
                            ],
                            'justify' => [
                                'title' => esc_html__( 'Justified', 'breeza' ),
                                'icon' => 'eicon-text-align-justify',
                            ],
                        ],
                        'selectors' => [
                            '{{WRAPPER}} .pxl-heading' => 'text-align: {{VALUE}};',
                            '{{WRAPPER}} .pxl-heading .icon-heading' => 'justify-content: {{VALUE}};',
                        ],
                    ),
                        array(
                            'name' => 'h_width',
                            'label' => esc_html__('Max Width', 'breeza' ),
                            'type' => \Elementor\Controls_Manager::SLIDER,
                            'control_type' => 'responsive',
                            'size_units' => [ 'px', '%' ],
                            'range' => [
                                'px' => [
                                    'min' => 0,
                                    'max' => 3000,
                                ],
                            ],
                            'selectors' => [
                                '{{WRAPPER}} .pxl-heading .pxl-heading--inner' => 'max-width: {{SIZE}}{{UNIT}};',
                            ],
                        ),
                    ),
                ),
                array(
                    'name' => 'section_style_title',
                    'label' => esc_html__('Title', 'breeza' ),
                    'tab' => \Elementor\Controls_Manager::TAB_STYLE,
                    'controls' => array(
                        array(
                            'name' => 'title_tag',
                            'label' => esc_html__('HTML Tag', 'breeza' ),
                            'type' => \Elementor\Controls_Manager::SELECT,
                            'options' => [
                                'h1' => 'H1',
                                'h2' => 'H2',
                                'h3' => 'H3',
                                'h4' => 'H4',
                                'h5' => 'H5',
                                'h6' => 'H6',               
                                'h7' => 'H7',               
                                'h8' => 'H8',               
                                'div' => 'div',
                                'span' => 'span',
                                'p' => 'p',
                            ],
                            'default' => 'h3',
                        ),
                        array(
                            'name' => 'title_color',
                            'label' => esc_html__('Title Color', 'breeza' ),
                            'type' => \Elementor\Controls_Manager::COLOR,
                            'selectors' => [
                                '{{WRAPPER}} .pxl-heading .pxl-item--title' => 'color: {{VALUE}};',
                            ],
                        ),
                        array(
                            'name' => 'title_typography',
                            'label' => esc_html__('Typography', 'breeza' ),
                            'type' => \Elementor\Group_Control_Typography::get_type(),
                            'control_type' => 'group',
                            'selector' => '{{WRAPPER}} .pxl-heading .pxl-item--title',
                        ),
                        array(
                            'name'         => 'title_box_shadow',
                            'label' => esc_html__( 'Title Shadow', 'breeza' ),
                            'type'         => \Elementor\Group_Control_Text_Shadow::get_type(),
                            'control_type' => 'group',
                            'selector'     => '{{WRAPPER}} .pxl-heading .pxl-item--title'
                        ),
                        array(
                            'name' => 'title_space_bottom',
                            'label' => esc_html__('Bottom Spacer', 'breeza' ),
                            'type' => \Elementor\Controls_Manager::SLIDER,
                            'control_type' => 'responsive',
                            'size_units' => [ 'px' ],
                            'default' => [
                                'size' => 0,
                            ],
                            'range' => [
                                'px' => [
                                    'min' => 0,
                                    'max' => 300,
                                ],
                            ],
                            'selectors' => [
                                '{{WRAPPER}} .pxl-heading .pxl-heading--inner' => 'margin-bottom: {{SIZE}}{{UNIT}};',
                            ],
                            'separator' => 'after',
                        ),
                        array(
                            'name' => 'divider',
                            'label' => esc_html__('Divider Position', 'breeza' ),
                            'type' => \Elementor\Controls_Manager::SELECT,
                            'options' => [
                                'divider-none' => esc_html__( 'None', 'breeza' ),
                                'divider-left' => esc_html__( 'Top', 'breeza' ),
                                'divider-right' => esc_html__( 'Bottom', 'breeza' ),
                            ],
                            'default' => 'divider-none',
                        ),
                        array(
                            'name' => 'divider_bottom',
                            'label' => esc_html__('Divider Bottom', 'breeza' ),
                            'type' => \Elementor\Controls_Manager::SLIDER,
                            'control_type' => 'responsive',
                            'size_units' => [ 'px' ],
                            'range' => [
                                'px' => [
                                    'min' => 0,
                                    'max' => 100,
                                ],
                            ],
                            'selectors' => [
                                '{{WRAPPER}} .pxl-heading .pxl-heading--inner .pxl-item--title:after' => 'bottom: {{SIZE}}{{UNIT}};',
                            ],
                        ),
                        array(
                          'name' => 'align_divider',
                          'label' => esc_html__( 'Alignment', 'breeza' ),
                          'type' => \Elementor\Controls_Manager::CHOOSE,
                          'control_type' => 'responsive',
                          'options' => [
                            '0' => [
                                'title' => esc_html__( 'Left', 'breeza' ),
                                'icon' => 'eicon-text-align-left',
                            ],
                            '50%' => [
                                'title' => esc_html__( 'Center', 'breeza' ),
                                'icon' => 'eicon-text-align-center',
                            ],
                        ],
                        'selectors' => [
                            '{{WRAPPER}} .pxl-heading .pxl-heading--inner .pxl-item--title:after' => 'left: {{VALUE}};transform: translateX(-50%);',
                        ],
                    ),
                        array(
                            'name' => 'divider_color',
                            'label' => esc_html__('Divider Color', 'breeza' ),
                            'type' => \Elementor\Controls_Manager::COLOR,
                            'selectors' => [
                                '{{WRAPPER}} .pxl-heading .pxl-heading--inner .pxl-item--title:after' => 'background-color: {{VALUE}};',
                            ],
                            'condition' => [
                                'divider' => ['divider-left', 'divider-right'],
                            ],
                        ),
                        array(
                            'name' => 'pxl_animate',
                            'label' => esc_html__('BR Animate', 'breeza' ),
                            'type' => \Elementor\Controls_Manager::SELECT,
                            'options' => breeza_widget_animate_v2(),
                            'default' => '',
                        ),
                        array(
                            'name' => 'pxl_animate_delay',
                            'label' => esc_html__('Animate Delay', 'breeza' ),
                            'type' => \Elementor\Controls_Manager::TEXT,
                            'default' => '0',
                            'description' => 'Enter number. Default 0ms',
                        ),
                    ),
),
array(
    'name' => 'section_style_title_sub',
    'label' => esc_html__('Sub Title', 'breeza' ),
    'tab' => \Elementor\Controls_Manager::TAB_STYLE,
    'controls' => array_merge(
        array(
            array(
                'name' => 'sub_title_style',
                'label' => esc_html__('Style', 'breeza' ),
                'type' => \Elementor\Controls_Manager::SELECT,
                'options' => [
                    'px-sub-title-default' => 'Default',                    
                    'px-sub-title-style2' => 'Style2',                   
                    'px-sub-title-style3' => 'Border',                   
                    'px-sub-title-style4' => 'Divider',                   
                ],
                'default' => 'px-sub-title-default',
            ),
            array(
                'name' => 'show_dot',
                'label' => esc_html__('Show Dot', 'breeza' ),
                'type' => \Elementor\Controls_Manager::SWITCHER,
                'default' => 'true',
                'condition' => [
                    'sub_title_style' => ['px-sub-title-default','px-sub-title-style3'],
                ],
            ),
            array(
                'name' => 'sub_title_dot_color',
                'label' => esc_html__('Dot Color', 'breeza' ),
                'type' => \Elementor\Controls_Manager::COLOR,
                'selectors' => [
                    '{{WRAPPER}} .pxl-heading .pxl-item--subtitle .dot' => 'background-color: {{VALUE}};',
                ],
                'condition' => [
                    'show_dot' => 'true',                    
                ],
            ),
            array(
                'name' => 'sub_title_color',
                'label' => esc_html__('Color', 'breeza' ),
                'type' => \Elementor\Controls_Manager::COLOR,
                'selectors' => [
                    '{{WRAPPER}} .pxl-heading .pxl-item--subtitle,{{WRAPPER}} .pxl-heading .pxl-item--subtitle .pxl-item--subtext' => 'color: {{VALUE}};',
                ],
            ),
            array(
                'name'         => 'sub_title_gradient',
                'label' => esc_html__( 'Background Type', 'breeza' ),
                'type'         => \Elementor\Group_Control_Background::get_type(),
                'control_type' => 'group',
                'types' => [ 'gradient' ],
                'selector'     => '{{WRAPPER}} .pxl-heading .pxl-item--subtitle .pxl-item--subtext',
            ),
            array(
                'name' => 'sub_title_typography',
                'label' => esc_html__('Typography', 'breeza' ),
                'type' => \Elementor\Group_Control_Typography::get_type(),
                'control_type' => 'group',
                'selector' => '{{WRAPPER}} .pxl-heading .pxl-item--subtitle, {{WRAPPER}} .pxl-heading .pxl-item--subtitle span',
            ),
            array(
                'name'         => 'sub_title_shadow',
                'label' => esc_html__( 'Sub Title Shadow', 'breeza' ),
                'type'         => \Elementor\Group_Control_Box_Shadow::get_type(),
                'control_type' => 'group',
                'selector'     => '{{WRAPPER}} .pxl-heading .pxl-item--subtitle .pxl-item--subtext',
            ),
            array(
                'name' => 'sub_title_space_margin_top',
                'label' => esc_html__('Top Spacer', 'breeza' ),
                'type' => \Elementor\Controls_Manager::SLIDER,
                'control_type' => 'responsive',
                'size_units' => [ 'px' ],
                'range' => [
                    'px' => [
                        'min' => 0,
                        'max' => 300,
                    ],
                ],
                'selectors' => [
                    '{{WRAPPER}} .pxl-heading .pxl-item--subtitle' => 'margin-top: {{SIZE}}{{UNIT}};',
                ],
            ),
            array(
                'name' => 'sub_title_space_bottom',
                'label' => esc_html__('Bottom Spacer', 'breeza' ),
                'type' => \Elementor\Controls_Manager::SLIDER,
                'control_type' => 'responsive',
                'size_units' => [ 'px' ],
                'range' => [
                    'px' => [
                        'min' => 0,
                        'max' => 300,
                    ],
                ],
                'selectors' => [
                    '{{WRAPPER}} .pxl-heading .pxl-item--subtitle' => 'margin-bottom: {{SIZE}}{{UNIT}};',
                ],
            ),
            array(
                'name' => 'btn_padding',
                'label' => esc_html__('Padding', 'breeza' ),
                'type' => \Elementor\Controls_Manager::DIMENSIONS,
                'size_units' => [ 'px' ],
                'selectors' => [
                    '{{WRAPPER}} .pxl-heading .pxl-item--subtitle .pxl-item--subtext' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
                ],
                'control_type' => 'responsive',
            ),
            array(
                'name' => 'border_type',
                'label' => esc_html__( 'Border Type', 'breeza' ),
                'type' => \Elementor\Controls_Manager::SELECT,
                'options' => [
                    '' => esc_html__( 'None', 'breeza' ),
                    'solid' => esc_html__( 'Solid', 'breeza' ),
                    'double' => esc_html__( 'Double', 'breeza' ),
                    'dotted' => esc_html__( 'Dotted', 'breeza' ),
                    'dashed' => esc_html__( 'Dashed', 'breeza' ),
                    'groove' => esc_html__( 'Groove', 'breeza' ),
                ],
                'selectors' => [
                    '{{WRAPPER}} .pxl-heading .pxl-item--subtitle .pxl-item--subtext' => 'border-style: {{VALUE}} !important;',
                ],
            ),
            array(
                'name' => 'border_width',
                'label' => esc_html__( 'Border Width', 'breeza' ),
                'type' => \Elementor\Controls_Manager::DIMENSIONS,
                'selectors' => [
                    '{{WRAPPER}} .pxl-heading .pxl-item--subtitle .pxl-item--subtext' => 'border-width: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}} !important;',
                ],
                'condition' => [
                    'border_type!' => '',
                ],
                'responsive' => true,
            ),
            array(
                'name' => 'border_color',
                'label' => esc_html__( 'Border Color', 'breeza' ),
                'type' => \Elementor\Controls_Manager::COLOR,
                'default' => '',
                'selectors' => [
                    '{{WRAPPER}} .pxl-heading .pxl-item--subtitle .pxl-item--subtext' => 'border-color: {{VALUE}} !important;',
                ],
                'condition' => [
                    'border_type!' => '',
                ],
            ),
            array(
                'name' => 'btn_border_radius',
                'label' => esc_html__('Border Radius', 'breeza' ),
                'type' => \Elementor\Controls_Manager::DIMENSIONS,
                'size_units' => [ 'px' ],
                'selectors' => [
                    '{{WRAPPER}} .pxl-heading .pxl-item--subtitle .pxl-item--subtext' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
                ],
            ),
            array(
                'name' => 'pxl_animate_sub',
                'label' => esc_html__('BR Animate', 'breeza' ),
                'type' => \Elementor\Controls_Manager::SELECT,
                'options' => breeza_widget_animate(),
                'default' => '',
            ),
            array(
                'name' => 'pxl_animate_delay_sub',
                'label' => esc_html__('Animate Delay', 'breeza' ),
                'type' => \Elementor\Controls_Manager::TEXT,
                'default' => '0',
                'description' => 'Enter number. Default 0ms',
            ),
        )
),
),
array(
    'name' => 'section_style_title_highlight',
    'label' => esc_html__('Highlight', 'breeza' ),
    'tab' => \Elementor\Controls_Manager::TAB_STYLE,
    'controls' => array(
        array(
            'name' => 'show_image',
            'label' => esc_html__('Show Image', 'breeza' ),
            'type' => \Elementor\Controls_Manager::SWITCHER,
            'default' => 'false',
        ),
        array(
            'name' => 'highlight_image_color',
            'label' => esc_html__('Image Color', 'breeza' ),
            'type' => \Elementor\Controls_Manager::COLOR,
            'selectors' => [
                '{{WRAPPER}} .pxl-heading.pxl-highlight-after .pxl-title--highlight:before' => 'background-color: {{VALUE}};',
            ],
            'condition' =>['show_image' => 'true']
        ),
        array(
            'name' => 'highlight_color',
            'label' => esc_html__('Color', 'breeza' ),
            'type' => \Elementor\Controls_Manager::COLOR,
            'selectors' => [
                '{{WRAPPER}} .pxl-heading .pxl-title--highlight' => 'color: {{VALUE}};',
            ],
        ),
        array(
            'name' => 'line_color',
            'label' => esc_html__('Line Color', 'breeza' ),
            'type' => \Elementor\Controls_Manager::COLOR,
            'selectors' => [
                '{{WRAPPER}} .pxl-heading .pxl-title--line .pxl-item--after' => 'background-color: {{VALUE}};',
            ],
        ),
        array(
            'name' => 'highlight_box_color',
            'label' => esc_html__('Box Color', 'breeza' ),
            'type' => \Elementor\Controls_Manager::COLOR,
            'selectors' => [
                '{{WRAPPER}} .pxl-heading .pxl-title--highlight' => 'background-color: {{VALUE}};',
            ],
        ),
        array(
            'name'         => 'highlight_box_shadow',
            'label' => esc_html__( 'Box Shadow', 'breeza' ),
            'type'         => \Elementor\Group_Control_Text_Shadow::get_type(),
            'control_type' => 'group',
            'selector'     => '{{WRAPPER}} .pxl-heading .pxl-title--highlight',   
        ),
        array(
            'name' => 'highlight_typography',
            'label' => esc_html__('Typography', 'breeza' ),
            'type' => \Elementor\Group_Control_Typography::get_type(),
            'control_type' => 'group',
            'selector' => '{{WRAPPER}} .pxl-heading .pxl-title--highlight',
        ),
    ),
),
array(
    'name' => 'section_style_title_outline',
    'label' => esc_html__('Outline', 'breeza' ),
    'tab' => \Elementor\Controls_Manager::TAB_STYLE,
    'controls' => array(
        array(
            'name' => 'outline_color',
            'label' => esc_html__('Color', 'breeza' ),
            'type' => \Elementor\Controls_Manager::COLOR,
            'selectors' => [
                '{{WRAPPER}} .pxl-heading .pxl-title--outline' => '-webkit-text-stroke-color: {{VALUE}};',
            ],
        ),
        array(
            'name' => 'outline_typography',
            'label' => esc_html__('Typography', 'breeza' ),
            'type' => \Elementor\Group_Control_Typography::get_type(),
            'control_type' => 'group',
            'selector' => '{{WRAPPER}} .pxl-heading .pxl-title--outline',
        ),
        array(
            'name' => 'outline_width',
            'label' => esc_html__('Outline Width', 'breeza' ),
            'type' => \Elementor\Controls_Manager::SLIDER,
            'control_type' => 'responsive',
            'size_units' => [ 'px' ],
            'range' => [
                'px' => [
                    'min' => 0,
                    'max' => 10,
                ],
            ],
            'selectors' => [
                '{{WRAPPER}} .pxl-heading .pxl-title--outline' => '-webkit-text-stroke-width: {{SIZE}}{{UNIT}};',
            ],
        ),
    ),
),
),
),
),
breeza_get_class_widget_path()
);