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

		var optPrefix = '#customize-control-social_media_marketing_options-';
		
		// Label
		function social_media_marketing_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-social_media_marketing_options-'+ id ).before('<li class="tab-title customize-control">'+ title +'</li>');
			}

			// Global Color Setting

			if ( id === 'social_media_marketing_global_color' || id === 'social_media_marketing_heading_color' || id === 'social_media_marketing_paragraph_color') {
				$( '#customize-control-'+ id ).before('<li class="tab-title customize-control">'+ title  +'</li>');
			} else {
				$( '#customize-control-social_media_marketing_options-'+ id ).before('<li class="tab-title customize-control">'+ title +'</li>');
			}

			// General Setting

			if ( id === 'social_media_marketing_scroll_hide' || id === 'social_media_marketing_preloader_hide' || id === 'social_media_marketing_sticky_header' || id === 'social_media_marketing_products_per_row' || id === 'social_media_marketing_scroll_top_position' || id === 'social_media_marketing_products_per_row' || id === 'social_media_marketing_width_option' || id === 'social_media_marketing_nav_menu_text_transform')  {
				$( '#customize-control-'+ id ).before('<li class="tab-title customize-control">'+ title  +'</li>');
			} else {
				$( '#customize-control-social_media_marketing_options-'+ id ).before('<li class="tab-title customize-control">'+ title +'</li>');
			}

			// Colors

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

			// Header Image

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

			//  Header
			
			if ( id === 'social_media_marketing_topbar_email' || id === 'social_media_marketing_topbar_timing' || id === 'social_media_marketing_phone_number' || id === 'social_media_marketing_topbar_terms_link' || id === 'social_media_marketing_topbar_privacylink' ) {
				$( '#customize-control-'+ id ).before('<li class="tab-title customize-control">'+ title  +'</li>');
			} else {
				$( '#customize-control-social_media_marketing_options-'+ id ).before('<li class="tab-title customize-control">'+ title +'</li>');
			}


			// Banner

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

			// Products

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

			// Footer

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

			// Post Settings

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

			// Single Post Settings

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

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

		// Global Color Setting
		social_media_marketing_customizer_label( 'social_media_marketing_global_color', 'Global Color' );
		social_media_marketing_customizer_label( 'social_media_marketing_heading_color', 'Heading Typography' );
		social_media_marketing_customizer_label( 'social_media_marketing_paragraph_color', 'Paragraph Typography' );

		// General Setting
		social_media_marketing_customizer_label( 'social_media_marketing_preloader_hide', 'Preloader' );
		social_media_marketing_customizer_label( 'social_media_marketing_scroll_hide', 'Scroll To Top' );
		social_media_marketing_customizer_label( 'social_media_marketing_scroll_top_position', 'Scroll to top Position' );
		social_media_marketing_customizer_label( 'social_media_marketing_products_per_row', 'woocommerce Setting' );
		social_media_marketing_customizer_label( 'social_media_marketing_width_option', 'Site Width Layouts' );
		social_media_marketing_customizer_label( 'social_media_marketing_nav_menu_text_transform', 'Nav Menus Text Transform' );

		// Colors
		social_media_marketing_customizer_label( 'social_media_marketing_theme_color', 'Theme Color' );
		social_media_marketing_customizer_label( 'background_color', 'Colors' );
		social_media_marketing_customizer_label( 'background_image', 'Image' );

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

		social_media_marketing_customizer_label( 'social_media_marketing_post_layout', 'Post Layouts Settings' );

		social_media_marketing_customizer_label( 'social_media_marketing_404_page_main_heading', '404 Page Settings' );

		

		// Social Icon
		social_media_marketing_customizer_label( 'social_media_marketing_facebook_icon', 'Facebook' );
		social_media_marketing_customizer_label( 'social_media_marketing_twitter_icon', 'Twitter' );
		social_media_marketing_customizer_label( 'social_media_marketing_intagram_icon', 'Intagram' );
		social_media_marketing_customizer_label( 'social_media_marketing_linkedin_icon', 'Linkedin' );
		social_media_marketing_customizer_label( 'social_media_marketing_pintrest_icon', 'Pintrest' );

		// Header 
		social_media_marketing_customizer_label( 'social_media_marketing_topbar_location', 'Location' );
		social_media_marketing_customizer_label( 'social_media_marketing_topbar_timing', 'Timing' );
		social_media_marketing_customizer_label( 'social_media_marketing_phone_number', 'Phone Number' );
		social_media_marketing_customizer_label( 'social_media_marketing_topbar_terms_link', 'Terms & Condition URL' );
		social_media_marketing_customizer_label( 'social_media_marketing_topbar_privacylink', 'Privacy Policy URL' );

		//Slider
		social_media_marketing_customizer_label( 'social_media_marketing_banner_section_setting', 'Banner' );
		social_media_marketing_customizer_label( 'social_media_marketing_contact_form_shortcode', 'Contact Form' );

		//Products
		social_media_marketing_customizer_label( 'social_media_marketing_categories_section_setting', 'Service Section' );

		//Footer
		social_media_marketing_customizer_label( 'social_media_marketing_footer_widget_content_alignment', 'Footer' );
		social_media_marketing_customizer_label( 'social_media_marketing_show_hide_copyright', 'Copyright' );

		//Post setting
		social_media_marketing_customizer_label( 'social_media_marketing_post_page_title', 'Post Settings' );

		//Single post setting
		social_media_marketing_customizer_label( 'social_media_marketing_single_post_thumb', 'Single Post Settings' );
	

	});

})( jQuery );
