<?php 
/**
 * MAIN NEWS SECTION SETTINGS
 */
Kirki::add_section( 'news_main_section', array(
	'title'    => esc_html__( 'News Main Section', 'newshit' ),
	'panel'    => 'newshit_front_page_options',
) );

Kirki::add_field( 'theme_config', [
	'type'        => 'switch',
	'settings'    => 'enable_news_main_section',
	'label'       => esc_html__( 'Enable News Main Section', 'newshit' ),
	'section'     => 'news_main_section',
	'default'     => 'on',
	'priority'        => 1,
	'choices'     => [
		'on'  => esc_html__( 'Enable', 'newshit' ),
		'off' => esc_html__( 'Disable', 'newshit' ),
	],
	'partial_refresh'    => [
		'enable_news_main_section_refresh' => [
			'selector'        => '.newshit-banner-slide-wrapper',
			'render_callback' => 'newshit_customizer_quickedit',
		],
	],
] );

new \Kirki\Field\Radio_Image(
	[
		'settings'    => 'select_news_main_section',
		'label'       => esc_html__( 'Select layout', 'newshit' ),
		'section'     => 'news_main_section',
		'default'     => 'one',
		'priority'        => 1,
		'choices'     => [
			'one'   => get_template_directory_uri() . '/assets/image/main-banner-1.jpg',
			'two' => get_template_directory_uri() . '/assets/image/main-banner-2.jpg',
			'three'  => get_template_directory_uri() . '/assets/image/main-banner-3.jpg',
		],
		'active_callback' => [
			[
				'setting'  => 'enable_news_main_section',
				'operator' => '===',
				'value'    => true,
			],
		], 
	]
);

//===========================================
//========== Main Section Slider Settings ============
//===========================================

new \Kirki\Field\Select(
	[
		'settings'    => 'slider_post_type',
		'label'       => esc_html__( 'Select Post Type', 'newshit' ),
		'section'     => 'news_main_section',
		'description' => esc_html__( 'Select Your Post Type Blog Post Or Web Stories', 'newshit' ),
		'default'     => 'post',
		'priority'        => 1,
		'choices'     => [
			'post' => esc_html__( 'Blog Post', 'newshit' ),
			'web-story' => esc_html__( 'Web Stories', 'newshit' ),
		],
		'active_callback' => [
			[
				'setting'  => 'enable_news_main_section',
				'operator' => '===',
				'value'    => true,
			],
		], 
	]
);

// Start Web Stories Filter

if ( is_plugin_active( 'web-stories/web-stories.php' ) ) {
	new \Kirki\Field\Radio_Image(
		[
			'settings'    => 'slider_story_pro',
			'label'       => esc_html__( 'This Featured For Pro', 'newshit' ),
			'description' => newshit_purchase_link(),
			'section'     => 'news_main_section',
			'default'     => '',
			'transport'   => 'auto',
			'priority'        => 1,
			'choices'     => [
				'sticker_pro_img'   => get_template_directory_uri() . '/assets/image/pro/story.jpg',
			],
			'active_callback' => [
				[
					'setting'  => 'enable_news_main_section',
					'operator' => '===',
					'value'    => true,
				],
				[
					'setting'  => 'slider_post_type',
					'operator' => '===',
					'value'    => 'web-story',
				],
			],
		]
	);
	
}else{
	new \Kirki\Field\Radio_Image(
		[
			'settings'    => 'news_slider_no_plugine',
			'label'       => esc_html__( 'You Have No Active Or Install Web Stories Plugin ', 'newshit' ),
			'section'     => 'news_main_section',
			'default'     => '',
			'transport'   => 'auto',
			'priority'        => 1,
			'active_callback' => [
				[
					'setting'  => 'enable_news_main_section',
					'operator' => '===',
					'value'    => true,
				],
				[
					'setting'  => 'slider_post_type',
					'operator' => '===',
					'value'    => 'web-story',
				],
			],
		]
	);
}
// End Web Stories Filter 

Kirki::add_field( 'theme_config', [
	'type'        => 'switch',
	'settings'    => 'enable_slider_filter',
	'label'       => esc_html__( 'Enable Slider Post Filter', 'newshit' ),
	'section'     => 'news_main_section',
	'default'     => 'off',
	'priority'        => 1,
	'choices'     => [
		'on'  => esc_html__( 'Enable', 'newshit' ),
		'off' => esc_html__( 'Disable', 'newshit' ),
	],
	'active_callback' => [
		[
			'setting'  => 'enable_news_main_section',
			'operator' => '===',
			'value'    => true,
		],
		[
			'setting'  => 'slider_post_type',
			'operator' => '===',
			'value'    => 'post',
		],
	], 
] );

new \Kirki\Field\Select(
	[
		'settings'    => 'main_slider_filter_select',
		'label'       => esc_html__( 'Select Category Or Tags', 'newshit' ),
		'section'     => 'news_main_section',
		'default'     => 'one',
		'priority'        => 1,
		'choices'     => [
			'one' => esc_html__( 'Category', 'newshit' ),
			'two' => esc_html__( 'Tags', 'newshit' ),
		],
		'active_callback' => [
			[
				'setting'  => 'enable_slider_filter',
				'operator' => '===',
				'value'    => true,
			],
			[
				'setting'  => 'enable_news_main_section',
				'operator' => '===',
				'value'    => true,
			],
			[
				'setting'  => 'slider_post_type',
				'operator' => '===',
				'value'    => 'post',
			],
		], 
	]
);

new Kirki\Field\Select(
	[
		'settings'    => 'main_slider_post_cat',
		'label'       => __( 'Select Categroy', 'newshit' ),
		'section'     => 'news_main_section',
		'default'     => '',
		'multiple'    => -1,
		'priority'        => 1,
		'placeholder' => __( 'Select an Categorys', 'newshit' ),
		'choices'     => Kirki\Util\Helper::get_terms(array('taxonomy' => 'category')),
		'active_callback' => [
			[
				'setting'  => 'main_slider_filter_select',
				'operator' => '===',
				'value'    => 'one',
			],
			[
				'setting'  => 'enable_slider_filter',
				'operator' => '===',
				'value'    => true,
			],
			[
				'setting'  => 'enable_news_main_section',
				'operator' => '===',
				'value'    => true,
			],
			[
				'setting'  => 'slider_post_type',
				'operator' => '===',
				'value'    => 'post',
			],
		], 
	]
);

new \Kirki\Field\Radio_Image(
	[
		'settings'    => 'main_slider_tags_pro',
		'label'       => esc_html__( 'Tags Is Pro Featured', 'newshit' ),
		'description' => newshit_purchase_link(),
		'section'     => 'news_main_section',
		'default'     => '',
		'transport'   => 'auto',
		'priority'        => 1,
		'choices'     => [
			'main_slider_tags_pro_img'   => get_template_directory_uri() . '/assets/image/pro/tags-pro.jpg',
		],
		'active_callback' => [
			[
				'setting'  => 'main_slider_filter_select',
				'operator' => '===',
				'value'    => 'two',
			],
			[
				'setting'  => 'enable_slider_filter',
				'operator' => '===',
				'value'    => true,
			],
			[
				'setting'  => 'enable_news_main_section',
				'operator' => '===',
				'value'    => true,
			],
			[
				'setting'  => 'slider_post_type',
				'operator' => '===',
				'value'    => 'post',
			],
		], 
	]
);

new \Kirki\Field\Select(
	[
		'settings'        => 'news_main_slider_order',
		'label'           => esc_html__( 'Post Order', 'newshit' ),
		'section'         => 'news_main_section',
		'default'         => 'ASC',
		'priority'        => 2,
		'placeholder'     => esc_html__( 'Choose an option', 'newshit' ),
		'choices'         => [
			'ASC'  => esc_html__( 'ASC', 'newshit' ),
			'DESE' => esc_html__( 'DESE', 'newshit' ),
		],
		'active_callback' => [
			[
				'setting'  => 'enable_news_main_section',
				'operator' => '===',
				'value'    => true,
			],
		], 
	]
);

new \Kirki\Field\Select(
	[
		'settings'        => 'news_main_slider_postby',
		'label'           => esc_html__( 'Post Order By', 'newshit' ),
		'section'         => 'news_main_section',
		'default'         => 'rand',
		'priority'        => 2,
		'placeholder'     => esc_html__( 'Choose an option', 'newshit' ),
		'choices'         => [
			'none'          => esc_html__( 'None', 'newshit' ),
			'ID'            => esc_html__( 'ID', 'newshit' ),
			'date'          => esc_html__( 'Date', 'newshit' ),
			'name'          => esc_html__( 'Name', 'newshit' ),
			'title'         => esc_html__( 'Title', 'newshit' ),
			'comment_count' => esc_html__( 'Comment count', 'newshit' ),
			'rand'          => esc_html__( 'Random', 'newshit' ),
		],
		'active_callback' => [
			[
				'setting'  => 'enable_news_main_section',
				'operator' => '===',
				'value'    => true,
			],
		],
	]
);

new \Kirki\Field\Number(
	[
		'settings' => 'main_slider_post_number',
		'label'    => esc_html__( 'Slide Item', 'newshit' ),
		'section'  => 'news_main_section',
		'default'  => 10,
		'choices'  => [
			'min'  => 1,
			'max'  => 10,
			'step' => 1,
		],
		'priority'        => 2,
		'active_callback' => [
			[
				'setting'  => 'enable_news_main_section',
				'operator' => '===',
				'value'    => true,
			],
		],
	]
);

new \Kirki\Field\Radio_Image(
	[
		'settings'    => 'main_slider_post_number_pro',
		'label'       => esc_html__( 'Purchase Pro Featured To Add Unlimited Item', 'newshit' ),
		'description' => newshit_purchase_link(),
		'section'     => 'news_main_section',
		'default'     => '',
		'transport'   => 'auto',
		'priority'        => 2,
		'active_callback' => [
			[
				'setting'  => 'enable_news_main_section',
				'operator' => '===',
				'value'    => true,
			],
		], 
	]
);

new \Kirki\Field\Number(
	[
		'settings' => 'main_slider_title_lanth',
		'label'    => esc_html__( 'Title Length', 'newshit' ),
		'section'  => 'news_main_section',
		'default'  => 20,
		'priority'        => 2,
		'choices'  => [
			'min'  => 1,
			'max'  => 50,
			'step' => 1,
		],
		'active_callback' => [
			[
				'setting'  => 'enable_news_main_section',
				'operator' => '===',
				'value'    => true,
			],
		],
	]
);


//===========================================
//========== SLIDER ITEM SETTING ============
//===========================================

new \Kirki\Field\Radio_Image(
	[
		'settings'    => 'main_slider_cat_title_pro',
		'label'       => esc_html__( 'Enable For Free Version', 'newshit' ),
		'description' => newshit_purchase_link(),
		'section'     => 'news_main_section',
		'default'     => '',
		'transport'   => 'auto',
		'priority'        => 2,
		'choices'     => [
			'main_slider_cat_title_pro_img'   => get_template_directory_uri() . '/assets/image/pro/cat-title.jpg',
			'main_slider_cat_meta_img'   => get_template_directory_uri() . '/assets/image/pro/post-meta.jpg',
		],
		'active_callback' => [
			[
				'setting'  => 'enable_news_main_section',
				'operator' => '===',
				'value'    => true,
			],
		], 
	]
);


//===========================================
//=========== Tab Item Settings =============
//===========================================

new \Kirki\Field\Radio_Buttonset(
	[
		'settings'    => 'main_section_tab_options',
		'label'       => esc_html__( 'Tab Item Options', 'newshit' ),
		'section'     => 'news_main_section',
		'default'     => 'one',
		'transport'       => 'auto',
		'priority'        => 3,
		'choices'     => [
			'one'   => esc_html__( 'Tranding', 'newshit' ),
			'two' => esc_html__( 'Most View', 'newshit' ),
		],
		'active_callback' => [
			[
				'setting'  => 'enable_news_main_section',
				'operator' => '===',
				'value'    => true,
			],
		],
	]
);

// Tranding Item Options

new \Kirki\Field\Text(
	[
		'settings' => 'main_section_tab_one_title',
		'label'    => esc_html__( 'Tab Title', 'newshit' ),
		'section'  => 'news_main_section',
		'default'  => esc_html__( 'Tranding', 'newshit' ),
		'priority'        => 3,
		'active_callback' => [
			[
				'setting'  => 'enable_news_main_section',
				'operator' => '===',
				'value'    => true,
			],
			[
				'setting'  => 'main_section_tab_options',
				'operator' => '===',
				'value'    => 'one',
			],
		], 
		'partial_refresh'    => [
			'main_section_tab_options_refresh' => [
				'selector'        => '.newshit-banner-section-wrapper .banner-post-tab-item',
				'render_callback' => 'newshit_customizer_quickedit',
			],
		],
	]
);



new \Kirki\Field\Select(
	[
		'settings'    => 'tab1_post_type',
		'label'       => esc_html__( 'Select Post Type', 'newshit' ),
		'section'     => 'news_main_section',
		'description' => esc_html__( 'Select Your Post Type Blog Post Or Web Stories', 'newshit' ),
		'default'     => 'post',
		'priority'        => 3,
		'choices'     => [
			'post' => esc_html__( 'Blog Post', 'newshit' ),
			'web-story' => esc_html__( 'Web Stories', 'newshit' ),
		],
		'active_callback' => [
			[
				'setting'  => 'enable_news_main_section',
				'operator' => '===',
				'value'    => true,
			],
			[
				'setting'  => 'main_section_tab_options',
				'operator' => '===',
				'value'    => 'one',
			],
		], 
	]
);

// Start Web Stories Filter

if ( is_plugin_active( 'web-stories/web-stories.php' ) ) {
	
	new \Kirki\Field\Radio_Image(
		[
			'settings'    => 'tab1_story_pro',
			'label'       => esc_html__( 'This Featured For Pro', 'newshit' ),
			'description' => newshit_purchase_link(),
			'section'     => 'news_main_section',
			'default'     => '',
			'transport'   => 'auto',
			'priority'        => 3,
			'choices'     => [
				'sticker_pro_img'   => get_template_directory_uri() . '/assets/image/pro/story.jpg',
			],
			'active_callback' => [
				[
					'setting'  => 'enable_news_main_section',
					'operator' => '===',
					'value'    => true,
				],
				[
					'setting'  => 'tab1_post_type',
					'operator' => '===',
					'value'    => 'web-story',
				],
			],
		]
	);
	
}else{
	new \Kirki\Field\Radio_Image(
		[
			'settings'    => 'news_tab1_no_plugine',
			'label'       => esc_html__( 'You Have No Active Or Install Web Stories Plugin ', 'newshit' ),
			'section'     => 'news_main_section',
			'default'     => '',
			'transport'   => 'auto',
			'priority'        => 3,
			'active_callback' => [
				[
					'setting'  => 'enable_news_main_section',
					'operator' => '===',
					'value'    => true,
				],
				[
					'setting'  => 'tab1_post_type',
					'operator' => '===',
					'value'    => 'web-story',
				],
				[
					'setting'  => 'main_section_tab_options',
					'operator' => '===',
					'value'    => 'one',
				],
			],
		]
	);
}

Kirki::add_field( 'theme_config', [
	'type'        => 'switch',
	'settings'    => 'enable_tab1_post_filter',
	'label'       => esc_html__( 'Enable Post Filter', 'newshit' ),
	'section'     => 'news_main_section',
	'default'     => 'off',
	'priority'        => 3,
	'choices'     => [
		'on'  => esc_html__( 'Enable', 'newshit' ),
		'off' => esc_html__( 'Disable', 'newshit' ),
	],
	'active_callback' => [
		[
			'setting'  => 'enable_news_main_section',
			'operator' => '===',
			'value'    => true,
		],
		[
			'setting'  => 'main_section_tab_options',
			'operator' => '===',
			'value'    => 'one',
		],
		[
			'setting'  => 'tab1_post_type',
			'operator' => '===',
			'value'    => 'post',
		],
	], 
] );

new \Kirki\Field\Select(
	[
		'settings'    => 'tab1_post_filter',
		'label'       => esc_html__( 'Select Category Or Tags', 'newshit' ),
		'section'     => 'news_main_section',
		'default'     => 'one',
		'priority'        => 3,
		'choices'     => [
			'one' => esc_html__( 'Category', 'newshit' ),
			'two' => esc_html__( 'Tags', 'newshit' ),
		],
		'active_callback' => [
			[
				'setting'  => 'enable_tab1_post_filter',
				'operator' => '===',
				'value'    => true,
			],
			[
				'setting'  => 'enable_news_main_section',
				'operator' => '===',
				'value'    => true,
			],
			[
				'setting'  => 'main_section_tab_options',
				'operator' => '===',
				'value'    => 'one',
			],
			[
				'setting'  => 'tab1_post_type',
				'operator' => '===',
				'value'    => 'post',
			],
		], 
	]
);

new Kirki\Field\Select(
	[
		'settings'    => 'tab1_post_cat',
		'label'       => __( 'Select Categroy', 'newshit' ),
		'section'     => 'news_main_section',
		'default'     => '',
		'multiple'    => -1,
		'priority'        => 3,
		'placeholder' => __( 'Select an Categorys', 'newshit' ),
		'choices'     => Kirki\Util\Helper::get_terms(array('taxonomy' => 'category')),
		'active_callback' => [
			[
				'setting'  => 'tab1_post_filter',
				'operator' => '===',
				'value'    => 'one',
			], 
			[
				'setting'  => 'enable_tab1_post_filter',
				'operator' => '===',
				'value'    => true,
			],
			[
				'setting'  => 'enable_news_main_section',
				'operator' => '===',
				'value'    => true,
			],
			[
				'setting'  => 'main_section_tab_options',
				'operator' => '===',
				'value'    => 'one',
			],
			[
				'setting'  => 'tab1_post_type',
				'operator' => '===',
				'value'    => 'post',
			],
		], 
	]
);

new \Kirki\Field\Radio_Image(
	[
		'settings'    => 'tab1_post_tag_pro',
		'label'       => esc_html__( 'Tags Is Pro Featured', 'newshit' ),
		'description' => newshit_purchase_link(),
		'section'     => 'news_main_section',
		'default'     => '',
		'transport'   => 'auto',
		'priority'        => 3,
		'choices'     => [
			'main_slider_tags_pro_img'   => get_template_directory_uri() . '/assets/image/pro/tags-pro.jpg',
		],
		'active_callback' => [
			[
				'setting'  => 'tab1_post_filter',
				'operator' => '===',
				'value'    => 'two',
			],
			[
				'setting'  => 'enable_tab1_post_filter',
				'operator' => '===',
				'value'    => true,
			],
			[
				'setting'  => 'enable_news_main_section',
				'operator' => '===',
				'value'    => true,
			],
			[
				'setting'  => 'main_section_tab_options',
				'operator' => '===',
				'value'    => 'one',
			],
			[
				'setting'  => 'tab1_post_type',
				'operator' => '===',
				'value'    => 'post',
			],
		],
	]
);


new \Kirki\Field\Select(
	[
		'settings'        => 'tab1_post_order',
		'label'           => esc_html__( 'Post Order', 'newshit' ),
		'section'         => 'news_main_section',
		'default'         => 'ASC',
		'priority'        => 4,
		'placeholder'     => esc_html__( 'Choose an option', 'newshit' ),
		'choices'         => [
			'ASC'  => esc_html__( 'ASC', 'newshit' ),
			'DESE' => esc_html__( 'DESE', 'newshit' ),
		],
		'active_callback' => [
			[
				'setting'  => 'enable_news_main_section',
				'operator' => '===',
				'value'    => true,
			],
			[
				'setting'  => 'main_section_tab_options',
				'operator' => '===',
				'value'    => 'one',
			],
		], 
	]
);

new \Kirki\Field\Select(
	[
		'settings'        => 'tab1_post_orderby',
		'label'           => esc_html__( 'Post Order By', 'newshit' ),
		'section'         => 'news_main_section',
		'default'         => 'rand',
		'priority'        => 4,
		'placeholder'     => esc_html__( 'Choose an option', 'newshit' ),
		'choices'         => [
			'none'          => esc_html__( 'None', 'newshit' ),
			'ID'            => esc_html__( 'ID', 'newshit' ),
			'date'          => esc_html__( 'Date', 'newshit' ),
			'name'          => esc_html__( 'Name', 'newshit' ),
			'title'         => esc_html__( 'Title', 'newshit' ),
			'comment_count' => esc_html__( 'Comment count', 'newshit' ),
			'rand'          => esc_html__( 'Random', 'newshit' ),
		],
		'active_callback' => [
			[
				'setting'  => 'enable_news_main_section',
				'operator' => '===',
				'value'    => true,
			],
			[
				'setting'  => 'main_section_tab_options',
				'operator' => '===',
				'value'    => 'one',
			],
		],
	]
);

Kirki::add_field( 'theme_config', [
	'type'        => 'switch',
	'settings'    => 'enable_tab1_meta_items',
	'label'       => esc_html__( 'Enable Post meta', 'newshit' ),
	'section'     => 'news_main_section',
	'default'     => 'on',
	'priority'        => 4,
	'choices'     => [
		'on'  => esc_html__( 'Enable', 'newshit' ),
		'off' => esc_html__( 'Disable', 'newshit' ),
	],
	'active_callback' => [
		[
			'setting'  => 'enable_news_main_section',
			'operator' => '===',
			'value'    => true,
		],
		[
			'setting'  => 'main_section_tab_options',
			'operator' => '===',
			'value'    => 'one',
		],
	], 
] );

new Kirki\Field\Select(
	[
		'settings'    => 'tab1_meta_items',
		'label'       => __( 'Select item Meta', 'newshit' ),
		'section'     => 'news_main_section',
		'default'     => array( 'author', 'date', 'cats'),
		'multiple'    => 3,
		'priority'        => 4,
		'choices'         => [
			'author'  => esc_html__( 'Author', 'newshit' ),
			'cats' => esc_html__( 'Category', 'newshit' ),
			'date' => esc_html__( 'Date', 'newshit' ),
		],
		'active_callback' => [
			[
				'setting'  => 'enable_news_main_section',
				'operator' => '===',
				'value'    => true,
			],
			[
				'setting'  => 'main_section_tab_options',
				'operator' => '===',
				'value'    => 'one',
			],
			[
				'setting'  => 'enable_tab1_meta_items',
				'operator' => '===',
				'value'    => true,
			],
		],
	]
);

new \Kirki\Field\Number(
	[
		'settings' => 'tab1_title_lanth',
		'label'    => esc_html__( 'Title Length', 'newshit' ),
		'section'  => 'news_main_section',
		'default'  => 7,
		'priority'        => 4,
		'choices'  => [
			'min'  => 1,
			'max'  => 50,
			'step' => 1,
		],
		'active_callback' => [
			[
				'setting'  => 'enable_news_main_section',
				'operator' => '===',
				'value'    => true,
			],
			[
				'setting'  => 'main_section_tab_options',
				'operator' => '===',
				'value'    => 'one',
			],
		],
	]
);

new \Kirki\Field\Number(
	[
		'settings' => 'tab1_dispaly_item',
		'label'    => esc_html__( 'Dispaly Item', 'newshit' ),
		'section'  => 'news_main_section',
		'default'  => 10,
		'priority'        => 4,
		'choices'  => [
			'min'  => 1,
			'max'  => 10,
			'step' => 1,
		],
		'active_callback' => [
			[
				'setting'  => 'enable_news_main_section',
				'operator' => '===',
				'value'    => true,
			],
			[
				'setting'  => 'main_section_tab_options',
				'operator' => '===',
				'value'    => 'one',
			],
		],
	]
);

new \Kirki\Field\Radio_Image(
	[
		'settings'    => 'tab1_dispaly_item_pro',
		'label'       => esc_html__( 'Dispaly 10 Item for Free Version', 'newshit' ),
		'description' => newshit_purchase_link(),
		'section'     => 'news_main_section',
		'default'     => '',
		'transport'   => 'auto',
		'priority'        => 4,
		'active_callback' => [
			[
				'setting'  => 'enable_news_main_section',
				'operator' => '===',
				'value'    => true,
			],
			[
				'setting'  => 'main_section_tab_options',
				'operator' => '===',
				'value'    => 'one',
			],
		],
	]
);

/// Most Popular 

new \Kirki\Field\Text(
	[
		'settings' => 'main_section_tab_two_title',
		'label'    => esc_html__( 'Tab Title', 'newshit' ),
		'section'  => 'news_main_section',
		'default'  => esc_html__( 'Most popular', 'newshit' ),
		'priority'        => 5,
		'active_callback' => [
			[
				'setting'  => 'enable_news_main_section',
				'operator' => '===',
				'value'    => true,
			],
			[
				'setting'  => 'main_section_tab_options',
				'operator' => '===',
				'value'    => 'two',
			],
		], 
	]
);

new \Kirki\Field\Select(
	[
		'settings'    => 'tab2_post_type',
		'label'       => esc_html__( 'Select Post Type', 'newshit' ),
		'section'     => 'news_main_section',
		'description' => esc_html__( 'Select Your Post Type Blog Post Or Web Stories', 'newshit' ),
		'default'     => 'post',
		'priority'        => 5,
		'choices'     => [
			'post' => esc_html__( 'Blog Post', 'newshit' ),
			'web-story' => esc_html__( 'Web Stories', 'newshit' ),
		],
		'active_callback' => [
			[
				'setting'  => 'enable_news_main_section',
				'operator' => '===',
				'value'    => true,
			],
			[
				'setting'  => 'main_section_tab_options',
				'operator' => '===',
				'value'    => 'two',
			],
		], 
	]
);

// Start Web Stories Filter

if ( is_plugin_active( 'web-stories/web-stories.php' ) ) {
	
	new \Kirki\Field\Radio_Image(
		[
			'settings'    => 'tab2_story_pro',
			'label'       => esc_html__( 'This Featured For Pro', 'newshit' ),
			'description' => newshit_purchase_link(),
			'section'     => 'news_main_section',
			'default'     => '',
			'transport'   => 'auto',
			'priority'        => 5,
			'choices'     => [
				'sticker_pro_img'   => get_template_directory_uri() . '/assets/image/pro/story.jpg',
			],
			'active_callback' => [
				[
					'setting'  => 'enable_news_main_section',
					'operator' => '===',
					'value'    => true,
				],
				[
					'setting'  => 'tab2_post_type',
					'operator' => '===',
					'value'    => 'web-story',
				],
				[
					'setting'  => 'main_section_tab_options',
					'operator' => '===',
					'value'    => 'two',
				],
			],
		]
	);
	
	
}else{
	new \Kirki\Field\Radio_Image(
		[
			'settings'    => 'news_tab2_no_plugine',
			'label'       => esc_html__( 'You Have No Active Or Install Web Stories Plugin ', 'newshit' ),
			'section'     => 'news_main_section',
			'default'     => '',
			'transport'   => 'auto',
			'priority'        => 5,
			'active_callback' => [
				[
					'setting'  => 'enable_news_main_section',
					'operator' => '===',
					'value'    => true,
				],
				[
					'setting'  => 'tab2_post_type',
					'operator' => '===',
					'value'    => 'web-story',
				],
				[
					'setting'  => 'main_section_tab_options',
					'operator' => '===',
					'value'    => 'two',
				],
			],
		]
	);
}

Kirki::add_field( 'theme_config', [
	'type'        => 'switch',
	'settings'    => 'enable_tab2_post_filter',
	'label'       => esc_html__( 'Enable Post Filter', 'newshit' ),
	'section'     => 'news_main_section',
	'default'     => 'off',
	'priority'        => 5,
	'choices'     => [
		'on'  => esc_html__( 'Enable', 'newshit' ),
		'off' => esc_html__( 'Disable', 'newshit' ),
	],
	'active_callback' => [
		[
			'setting'  => 'enable_news_main_section',
			'operator' => '===',
			'value'    => true,
		],
		[
			'setting'  => 'main_section_tab_options',
			'operator' => '===',
			'value'    => 'two',
		],
		[
			'setting'  => 'tab2_post_type',
			'operator' => '===',
			'value'    => 'post',
		],
	], 
] );

new \Kirki\Field\Select(
	[
		'settings'    => 'tab2_post_filter',
		'label'       => esc_html__( 'Select Category Or Tags', 'newshit' ),
		'section'     => 'news_main_section',
		'default'     => 'one',
		'priority'        => 5,
		'choices'     => [
			'one' => esc_html__( 'Category', 'newshit' ),
			'two' => esc_html__( 'Tags', 'newshit' ),
		],
		'active_callback' => [
			[
				'setting'  => 'enable_tab2_post_filter',
				'operator' => '===',
				'value'    => true,
			],
			[
				'setting'  => 'enable_news_main_section',
				'operator' => '===',
				'value'    => true,
			],
			[
				'setting'  => 'main_section_tab_options',
				'operator' => '===',
				'value'    => 'two',
			],
			[
				'setting'  => 'tab2_post_type',
				'operator' => '===',
				'value'    => 'post',
			],
		], 
	]
);

new Kirki\Field\Select(
	[
		'settings'    => 'tab2_post_cat',
		'label'       => __( 'Select Categroy', 'newshit' ),
		'section'     => 'news_main_section',
		'default'     => '',
		'multiple'    => -1,
		'priority'        => 5,
		'placeholder' => __( 'Select an Categorys', 'newshit' ),
		'choices'     => Kirki\Util\Helper::get_terms(array('taxonomy' => 'category')),
		'active_callback' => [
			[
				'setting'  => 'tab2_post_filter',
				'operator' => '===',
				'value'    => 'one',
			], 
			[
				'setting'  => 'enable_tab2_post_filter',
				'operator' => '===',
				'value'    => true,
			],
			[
				'setting'  => 'enable_news_main_section',
				'operator' => '===',
				'value'    => true,
			],
			[
				'setting'  => 'main_section_tab_options',
				'operator' => '===',
				'value'    => 'two',
			],
			[
				'setting'  => 'tab2_post_type',
				'operator' => '===',
				'value'    => 'post',
			],
		], 
	]
);


new \Kirki\Field\Radio_Image(
	[
		'settings'    => 'tab2_post_tag_pro',
		'label'       => esc_html__( 'Tags Is Pro Featured', 'newshit' ),
		'description' => newshit_purchase_link(),
		'section'     => 'news_main_section',
		'default'     => '',
		'transport'   => 'auto',
		'priority'        => 5,
		'choices'     => [
			'1'   => get_template_directory_uri() . '/assets/image/pro/tags-pro.jpg',
		],
		'active_callback' => [
			[
				'setting'  => 'tab2_post_filter',
				'operator' => '===',
				'value'    => 'two',
			],
			[
				'setting'  => 'enable_tab2_post_filter',
				'operator' => '===',
				'value'    => true,
			],
			[
				'setting'  => 'enable_news_main_section',
				'operator' => '===',
				'value'    => true,
			],
			[
				'setting'  => 'main_section_tab_options',
				'operator' => '===',
				'value'    => 'two',
			],
			[
				'setting'  => 'tab2_post_type',
				'operator' => '===',
				'value'    => 'post',
			],
		], 
	]
);


new \Kirki\Field\Select(
	[
		'settings'        => 'tab2_post_order',
		'label'           => esc_html__( 'Post Order', 'newshit' ),
		'section'         => 'news_main_section',
		'default'         => 'ASC',
		'priority'        => 6,
		'placeholder'     => esc_html__( 'Choose an option', 'newshit' ),
		'choices'         => [
			'ASC'  => esc_html__( 'ASC', 'newshit' ),
			'DESE' => esc_html__( 'DESE', 'newshit' ),
		],
		'active_callback' => [
			[
				'setting'  => 'enable_news_main_section',
				'operator' => '===',
				'value'    => true,
			],
			[
				'setting'  => 'main_section_tab_options',
				'operator' => '===',
				'value'    => 'two',
			],
		], 
	]
);

new \Kirki\Field\Select(
	[
		'settings'        => 'tab2_post_orderby',
		'label'           => esc_html__( 'Post Order By', 'newshit' ),
		'section'         => 'news_main_section',
		'default'         => 'rand',
		'priority'        => 6,
		'placeholder'     => esc_html__( 'Choose an option', 'newshit' ),
		'choices'         => [
			'none'          => esc_html__( 'None', 'newshit' ),
			'ID'            => esc_html__( 'ID', 'newshit' ),
			'date'          => esc_html__( 'Date', 'newshit' ),
			'name'          => esc_html__( 'Name', 'newshit' ),
			'title'         => esc_html__( 'Title', 'newshit' ),
			'comment_count' => esc_html__( 'Comment count', 'newshit' ),
			'rand'          => esc_html__( 'Random', 'newshit' ),
		],
		'active_callback' => [
			[
				'setting'  => 'enable_news_main_section',
				'operator' => '===',
				'value'    => true,
			],
			[
				'setting'  => 'main_section_tab_options',
				'operator' => '===',
				'value'    => 'two',
			],
		],
	]
);

Kirki::add_field( 'theme_config', [
	'type'        => 'switch',
	'settings'    => 'enable_tab2_meta_items',
	'label'       => esc_html__( 'Enable Post meta', 'newshit' ),
	'section'     => 'news_main_section',
	'default'     => 'on',
	'priority'        => 6,
	'choices'     => [
		'on'  => esc_html__( 'Enable', 'newshit' ),
		'off' => esc_html__( 'Disable', 'newshit' ),
	],
	'active_callback' => [
		[
			'setting'  => 'enable_news_main_section',
			'operator' => '===',
			'value'    => true,
		],
		[
			'setting'  => 'main_section_tab_options',
			'operator' => '===',
			'value'    => 'two',
		],
	], 
] );

new Kirki\Field\Select(
	[
		'settings'    => 'tab2_meta_items',
		'label'       => __( 'Select item Meta', 'newshit' ),
		'section'     => 'news_main_section',
		'default'     => array( 'author', 'date', 'cats'),
		'multiple'    => 3,
		'priority'        => 6,
		'choices'     => [
			'author'  => esc_html__( 'Author', 'newshit' ),
			'cats' => esc_html__( 'Category', 'newshit' ),
			'date' => esc_html__( 'Date', 'newshit' ),
		],
		'active_callback' => [
			[
				'setting'  => 'enable_news_main_section',
				'operator' => '===',
				'value'    => true,
			],
			[
				'setting'  => 'main_section_tab_options',
				'operator' => '===',
				'value'    => 'two',
			],
			[
				'setting'  => 'enable_tab2_meta_items',
				'operator' => '===',
				'value'    => true,
			],
		],
	]
);

new \Kirki\Field\Number(
	[
		'settings' => 'tab2_title_lanth',
		'label'    => esc_html__( 'Title Length', 'newshit' ),
		'section'  => 'news_main_section',
		'priority'        =>6,
		'default'  => 7,
		'choices'  => [
			'min'  => 1,
			'max'  => 50,
			'step' => 1,
		],
		'active_callback' => [
			[
				'setting'  => 'enable_news_main_section',
				'operator' => '===',
				'value'    => true,
			],
			[
				'setting'  => 'main_section_tab_options',
				'operator' => '===',
				'value'    => 'two',
			],
		],
	]
);

new \Kirki\Field\Number(
	[
		'settings' => 'tab2_dispaly_item',
		'label'    => esc_html__( 'Slide Item', 'newshit' ),
		'section'  => 'news_main_section',
		'default'  => 10,
		'priority'        => 6,
		'choices'  => [
			'min'  => 1,
			'max'  => 10,
			'step' => 1,
		],
		'active_callback' => [
			[
				'setting'  => 'enable_news_main_section',
				'operator' => '===',
				'value'    => true,
			],
			[
				'setting'  => 'main_section_tab_options',
				'operator' => '===',
				'value'    => 'two',
			],
		],
	]
);

new \Kirki\Field\Radio_Image(
	[
		'settings'    => 'tab2_post_dispaly_pro',
		'label'       => esc_html__( 'Dispaly 10 items For free', 'newshit' ),
		'description' => newshit_purchase_link(),
		'section'     => 'news_main_section',
		'default'     => '',
		'transport'   => 'auto',
		'priority'        => 6,
		'active_callback' => [
			[
				'setting'  => 'enable_news_main_section',
				'operator' => '===',
				'value'    => true,
			],
			[
				'setting'  => 'main_section_tab_options',
				'operator' => '===',
				'value'    => 'two',
			],
		], 
	]
);


//====================================================
//======== News Main Section Ads Settings ============
//====================================================

Kirki::add_field( 'theme_config', [
	'type'        => 'switch',
	'settings'    => 'news_main_section_ads_enable',
	'label'       => esc_html__( 'Enable Ads Banner', 'newshit' ),
	'description' => esc_html__( 'Enable Ads Banner For News Main Section', 'newshit' ),
	'section'     => 'news_main_section',
	'default'     => 'on',
	'choices'     => [
		'on'  => esc_html__( 'Enable', 'newshit' ),
		'off' => esc_html__( 'Disable', 'newshit' ),
	],
	'active_callback' => [
		[
			'setting'  => 'select_news_main_section',
			'operator' => '===',
			'value'    => 'three',
		]
	],
	'partial_refresh'    => [
		'news_main_section_ads_refresh' => [
			'selector'        => '.newshit-banner-section-wrapper .newshit-news-ads-wrapper',
			'render_callback' => 'newshit_customizer_quickedit',
		],
	],
] );



new \Kirki\Field\Select(
	[
		'settings'    => 'news_main_section_ads_type',
		'label'       => esc_html__( 'Select Ads Type', 'newshit' ),
		'section'     => 'news_main_section',
		'default'     => 'link',
		'active_callback' => [
			[
				'setting'  => 'select_news_main_section',
				'operator' => '===',
				'value'    => 'three',
			],
			[
				'setting'  => 'news_main_section_ads_enable',
				'operator' => '===',
				'value'    => true,
			]
		],
		'choices'     => [
			'link' => esc_html__( 'Link', 'newshit' ),
			'code' => esc_html__( 'Code', 'newshit' ),
		],
	]
);

new \Kirki\Field\Image(
	[
		'settings'    => 'news_main_section_ads_image',
		'label'       => esc_html__( 'Upload Ads image', 'newshit' ),
		'section'     => 'news_main_section',
        'active_callback' => [
			[
				'setting'  => 'news_main_section_ads_type',
				'operator' => '===',
				'value'    => 'link',
			],
			[
				'setting'  => 'select_news_main_section',
				'operator' => '===',
				'value'    => 'three',
			],
			[
				'setting'  => 'news_main_section_ads_enable',
				'operator' => '===',
				'value'    => true,
			]
		],
        'choices'     => [
			'save_as' => 'array',
		],
	]
);

new \Kirki\Field\URL(
	[
		'settings' => 'news_main_section_ads_url',
		'label'    => esc_html__( 'Ads URL', 'newshit' ),
		'section'  => 'news_main_section',
		'default'  => '#',
        'active_callback' => [
			[
				'setting'  => 'news_main_section_ads_type',
				'operator' => '===',
				'value'    => 'link',
			],
			[
				'setting'  => 'select_news_main_section',
				'operator' => '===',
				'value'    => 'three',
			],
			[
				'setting'  => 'news_main_section_ads_enable',
				'operator' => '===',
				'value'    => true,
			]
		], 
	]
);

new \Kirki\Field\Radio_Image(
	[
		'settings'    => 'news_main_section_ads_pro',
		'label'       => esc_html__( 'Code Is Pro Featured', 'newshit' ),
		'description' => newshit_purchase_link(),
		'section'     => 'news_main_section',
		'default'     => '',
		'transport'   => 'auto',
		'choices'     => [
			'1'   => get_template_directory_uri() . '/assets/image/pro/ads-code.jpg',
		],
		'active_callback' => [
			[
				'setting'  => 'news_main_section_ads_type',
				'operator' => '===',
				'value'    => 'code',
			],
			[
				'setting'  => 'select_news_main_section',
				'operator' => '===',
				'value'    => 'three',
			],
			[
				'setting'  => 'news_main_section_ads_enable',
				'operator' => '===',
				'value'    => true,
			]
		],
	]
);