<?php

if ( ! empty( $condition ) ) :
	$arg->start_controls_section(
		'slider_options',
		[ 
			'label' => __( 'Slider Options', 'ostech-addon' ),
			'tab' => \Elementor\Controls_Manager::TAB_CONTENT,
			'condition' => [ 
				'layout_type' => $condition
			]
		]
	);
else :
	$arg->start_controls_section(
		'slider_options',
		[ 
			'label' => __( 'Slider Options', 'ostech-addon' ),
			'tab' => \Elementor\Controls_Manager::TAB_CONTENT,
		]
	);
endif;


$arg->add_control(
	'autoplay',
	[ 
		'label' => esc_html__( 'AutoPlay', 'ostech-addon' ),
		'type' => \Elementor\Controls_Manager::SWITCHER,
		'label_on' => esc_html__( 'Yes', 'ostech-addon' ),
		'label_off' => esc_html__( 'No', 'ostech-addon' ),
		'return_value' => 'yes',
		'default' => 'yes',
	]
);

$arg->add_control(
	'delay',
	[ 
		'label' => __( 'AutoPlay Delay', 'ostech-addon' ),
		'type' => \Elementor\Controls_Manager::SLIDER,
		'size_units' => [ 'count' ],

		'range' => [ 
			'count' => [ 
				'min' => 0,
				'max' => 10000,
				'step' => 1,
			],
		],
		'default' => [ 
			'unit' => 'count',
			'size' => 5000,
		],
	]
);

$arg->add_control(
	'custom_animation_status',
	[ 
		'label' => esc_html__( 'Enable Custom Animation?', 'ostech-addon' ),
		'type' => \Elementor\Controls_Manager::SWITCHER,
		'label_on' => esc_html__( 'Yes', 'ostech-addon' ),
		'label_off' => esc_html__( 'No', 'ostech-addon' ),
		'return_value' => 'yes',
		'default' => 'yes',
	]
);

$arg->add_control(
	'custom_animation_out',
	[ 
		'label' => esc_html__( 'Out Animation Class Name', 'ostech-addon' ),
		'type' => \Elementor\Controls_Manager::TEXT,
		'condition' => [ 
			'custom_animation_status' => 'yes'
		],
		'label_block' => true,
	]
);

$arg->add_control(
	'custom_animation_in',
	[ 
		'label' => esc_html__( 'In Animation Class Name', 'ostech-addon' ),
		'type' => \Elementor\Controls_Manager::TEXT,
		'condition' => [ 
			'custom_animation_status' => 'yes'
		],
		'label_block' => true,
	]
);

$arg->add_control(
	'hover_pause',
	[ 
		'label' => __( 'AutoPlay On Hover', 'pifoxen-addon' ),
		'type' => \Elementor\Controls_Manager::SWITCHER,
		'label_on' => esc_html__( 'Yes', 'pifoxen-addon' ),
		'label_off' => esc_html__( 'No', 'pifoxen-addon' ),
		'return_value' => 'yes',
		'default' => 'yes',
	]
);

$arg->add_control(
	'loop',
	[ 
		'label' => esc_html__( 'Loop', 'ostech-addon' ),
		'type' => \Elementor\Controls_Manager::SWITCHER,
		'label_on' => esc_html__( 'Yes', 'ostech-addon' ),
		'label_off' => esc_html__( 'No', 'ostech-addon' ),
		'return_value' => 'yes',
		'default' => 'yes',
	]
);

$arg->add_control(
	'enable_nav',
	[ 
		'label' => esc_html__( 'Display Nav', 'ostech-addon' ),
		'type' => \Elementor\Controls_Manager::SWITCHER,
		'label_on' => esc_html__( 'Yes', 'ostech-addon' ),
		'label_off' => esc_html__( 'No', 'ostech-addon' ),
		'return_value' => 'yes',
		'default' => 'yes',
	]
);

$arg->add_control(
	'nav_left_icon',
	[ 
		'label' => esc_html__( 'Nav Left Icon', 'ostech-addon' ),
		'type' => \Elementor\Controls_Manager::ICONS,
		'condition' => [ 
			'enable_nav' => 'yes'
		],
		'default' => [ 
			'value' => 'fa fa-angle-left',
			'library' => 'solid',
		],
	]
);

$arg->add_control(
	'nav_right_icon',
	[ 
		'label' => esc_html__( 'Nav Right Icon', 'ostech-addon' ),
		'type' => \Elementor\Controls_Manager::ICONS,
		'condition' => [ 
			'enable_nav' => 'yes'
		],
		'default' => [ 
			'value' => 'fa fa-angle-right',
			'library' => 'solid',
		],
	]
);

$arg->add_control(
	'enable_dots',
	[ 
		'label' => esc_html__( 'Display Dots', 'ostech-addon' ),
		'type' => \Elementor\Controls_Manager::SWITCHER,
		'label_on' => esc_html__( 'Yes', 'ostech-addon' ),
		'label_off' => esc_html__( 'No', 'ostech-addon' ),
		'return_value' => 'yes',
		'default' => 'yes',
	]
);

$arg->add_control(
	'center_status',
	[ 
		'label' => esc_html__( 'Is Centered?', 'ostech-addon' ),
		'type' => \Elementor\Controls_Manager::SWITCHER,
		'label_on' => esc_html__( 'Yes', 'ostech-addon' ),
		'label_off' => esc_html__( 'No', 'ostech-addon' ),
		'return_value' => 'yes',
		'default' => '',
	]
);

$arg->add_control(
	'url_hash_listner',
	[ 
		'label' => esc_html__( 'Enable URL Hash Listner?', 'ostech-addon' ),
		'type' => \Elementor\Controls_Manager::SWITCHER,
		'label_on' => esc_html__( 'Yes', 'ostech-addon' ),
		'label_off' => esc_html__( 'No', 'ostech-addon' ),
		'return_value' => 'yes',
		'default' => '',
	]
);


$arg->add_control(
	'smart_speed',
	[ 
		'label' => __( 'Smart Speed', 'ostech-addon' ),
		'type' => \Elementor\Controls_Manager::SLIDER,
		'size_units' => [ 'count' ],

		'range' => [ 
			'count' => [ 
				'min' => 0,
				'max' => 10000,
				'step' => 1,
			],
		],
		'default' => [ 
			'unit' => 'count',
			'size' => 700,
		],
	]
);


$arg->add_control(
	'items',
	[ 
		'label' => __( 'Slide Items', 'ostech-addon' ),
		'type' => \Elementor\Controls_Manager::SLIDER,
		'size_units' => [ 'count' ],
		'range' => [ 
			'count' => [ 
				'min' => 1,
				'max' => 10,
				'step' => 1,
			],
		],
		'default' => [ 
			'unit' => 'count',
			'size' => 1,
		],
	]
);

$arg->add_control(
	'margin',
	[ 
		'label' => __( 'Margin', 'ostech-addon' ),
		'type' => \Elementor\Controls_Manager::SLIDER,
		'size_units' => [ 'count' ],
		'range' => [ 
			'count' => [ 
				'min' => 1,
				'max' => 200,
				'step' => 1,
			],
		],
		'default' => [ 
			'unit' => 'count',
			'size' => 0,
		],
	]
);


$breakpoint = new \Elementor\Repeater();

$breakpoint->add_control(
	'screen_size',
	[ 
		'label' => __( 'Screen Size', 'ostech-addon' ),
		'type' => \Elementor\Controls_Manager::SLIDER,
		'size_units' => [ 'count' ],
		'range' => [ 
			'count' => [ 
				'min' => 0,
				'max' => 1920,
				'step' => 1,
			],
		],
		'default' => [ 
			'unit' => 'count',
			'size' => 0,
		],
	]
);

$breakpoint->add_control(
	'item',
	[ 
		'label' => __( 'Slide Item', 'ostech-addon' ),
		'type' => \Elementor\Controls_Manager::SLIDER,
		'size_units' => [ 'count' ],
		'range' => [ 
			'count' => [ 
				'min' => 1,
				'max' => 10,
				'step' => 1,
			],
		],
		'default' => [ 
			'unit' => 'count',
			'size' => 1,
		],
	]
);

$breakpoint->add_control(
	'margin',
	[ 
		'label' => __( 'Margin', 'ostech-addon' ),
		'type' => \Elementor\Controls_Manager::SLIDER,
		'size_units' => [ 'count' ],
		'range' => [ 
			'count' => [ 
				'min' => 1,
				'max' => 200,
				'step' => 1,
			],
		],
		'default' => [ 
			'unit' => 'count',
			'size' => 0,
		],
	]
);

$arg->add_control(
	'breakpoint',
	[ 
		'label' => __( 'Breakpoints', 'ostech-addon' ),
		'type' => \Elementor\Controls_Manager::REPEATER,
		'prevent_empty' => false,
		'fields' => $breakpoint->get_controls(),
	]
);

$arg->end_controls_section();