(function( $ ) {
	wp.customize.bind( 'ready', function() {

		var optPrefix = '#customize-control-ai_services_options-';
		
		// Label
		function ai_services_customizer_label( id, title ) {

			// Site Identity

			if ( id === 'custom_logo' || id === 'site_icon' ) {
				$( '#customize-control-'+ id ).before('<li class="tab-title customize-control">'+ title  +'</li>');
			} else {
				$( '#customize-control-ai_services_options-'+ id ).before('<li class="tab-title customize-control">'+ title +'</li>');
			}

			// Global Color Setting

			if ( id === 'ai_services_first_color' || id === 'ai_services_heading_color' || id === 'ai_services_paragraph_color') {
				$( '#customize-control-'+ id ).before('<li class="tab-title customize-control">'+ title  +'</li>');
			} else {
				$( '#customize-control-ai_services_options-'+ id ).before('<li class="tab-title customize-control">'+ title +'</li>');
			}

			// General Setting

			if ( id === 'ai_services_scroll_hide' || id === 'ai_services_preloader_hide' || id === 'ai_services_sticky_header' || id === 'ai_services_products_per_row' || id === 'ai_services_scroll_top_position' || id === 'ai_services_products_per_row' || id === 'ai_services_width_option' || id === 'ai_services_nav_menu_text_transform')  {
				$( '#customize-control-'+ id ).before('<li class="tab-title customize-control">'+ title  +'</li>');
			} else {
				$( '#customize-control-ai_services_options-'+ id ).before('<li class="tab-title customize-control">'+ title +'</li>');
			}

			// Colors

			if ( id === 'ai_services_theme_color' || id === 'background_color' || id === 'background_image' ) {
				$( '#customize-control-'+ id ).before('<li class="tab-title customize-control">'+ title  +'</li>');
			} else {
				$( '#customize-control-ai_services_options-'+ id ).before('<li class="tab-title customize-control">'+ title +'</li>');
			}

			// Header Image

			if ( id === 'header_image' ) {
				$( '#customize-control-'+ id ).before('<li class="tab-title customize-control">'+ title  +'</li>');
			} else {
				$( '#customize-control-ai_services_options-'+ id ).before('<li class="tab-title customize-control">'+ title +'</li>');
			}


			// Banner

			if ( id === 'ai_services_banner_section_setting' || id === 'ai_services_banner_review_head' || id === 'ai_services_banner_image1' ) {
				$( '#customize-control-'+ id ).before('<li class="tab-title customize-control">'+ title  +'</li>');
			} else {
				$( '#customize-control-ai_services_options-'+ id ).before('<li class="tab-title customize-control">'+ title +'</li>');
			}

			// Products

			if ( id === 'ai_services_activities_section_setting' ) {
				$( '#customize-control-'+ id ).before('<li class="tab-title customize-control">'+ title  +'</li>');
			} else {
				$( '#customize-control-ai_services_options-'+ id ).before('<li class="tab-title customize-control">'+ title +'</li>');
			}

			// Footer

			if ( id === 'ai_services_footer_widget_content_alignment' || id === 'ai_services_show_hide_copyright') {
				$( '#customize-control-'+ id ).before('<li class="tab-title customize-control">'+ title  +'</li>');
			} else {
				$( '#customize-control-ai_services_options-'+ id ).before('<li class="tab-title customize-control">'+ title +'</li>');
			}

			// Post Settings

			if ( id === 'ai_services_post_page_title' ) {
				$( '#customize-control-'+ id ).before('<li class="tab-title customize-control">'+ title  +'</li>');
			} else {
				$( '#customize-control-ai_services_options-'+ id ).before('<li class="tab-title customize-control">'+ title +'</li>');
			}

			// Single Post Settings

			if ( id === 'ai_services_single_post_page_content' ) {
				$( '#customize-control-'+ id ).before('<li class="tab-title customize-control">'+ title  +'</li>');
			} else {
				$( '#customize-control-ai_services_options-'+ id ).before('<li class="tab-title customize-control">'+ title +'</li>');
			}
			
		}

	    // Site Identity
		ai_services_customizer_label( 'custom_logo', 'Logo Setup' );
		ai_services_customizer_label( 'site_icon', 'Favicon' );

		// Global Color Setting
		ai_services_customizer_label( 'ai_services_first_color', 'Global Color' );
		ai_services_customizer_label( 'ai_services_heading_color', 'Heading Typography' );
		ai_services_customizer_label( 'ai_services_paragraph_color', 'Paragraph Typography' );

		// General Setting
		ai_services_customizer_label( 'ai_services_preloader_hide', 'Preloader' );
		ai_services_customizer_label( 'ai_services_scroll_hide', 'Scroll To Top' );
		ai_services_customizer_label( 'ai_services_scroll_top_position', 'Scroll to top Position' );
		ai_services_customizer_label( 'ai_services_products_per_row', 'woocommerce Setting' );
		ai_services_customizer_label( 'ai_services_width_option', 'Site Width Layouts' );
		ai_services_customizer_label( 'ai_services_nav_menu_text_transform', 'Nav Menus Text Transform' );

		// Colors
		ai_services_customizer_label( 'ai_services_theme_color', 'Theme Color' );
		ai_services_customizer_label( 'background_color', 'Colors' );
		ai_services_customizer_label( 'background_image', 'Image' );

		//Header Image
		ai_services_customizer_label( 'header_image', 'Header Image' );

		//Slider
		ai_services_customizer_label( 'ai_services_banner_section_setting', 'Banner' );
		ai_services_customizer_label( 'ai_services_banner_review_head', 'Client Review' );
		ai_services_customizer_label( 'ai_services_banner_image1', 'Banner Images' );

		//Products
		ai_services_customizer_label( 'ai_services_service_section', 'Service Section' );

		//Footer
		ai_services_customizer_label( 'ai_services_footer_widget_content_alignment', 'Footer' );
		ai_services_customizer_label( 'ai_services_show_hide_copyright', 'Copyright' );

		//Post setting
		ai_services_customizer_label( 'ai_services_post_page_title', 'Post Settings' );

		//Single post setting
		ai_services_customizer_label( 'ai_services_single_post_page_content', 'Single Post Settings' );
	

	});

})( jQuery );
