<?php 

$image_url1 = "";
if ( $instance['image1'] != '' ){
    $image_url1 = wp_get_attachment_image_src($instance['image1'],"swap-whychoose",false);
}

$image1 = $image_url1[0];
?>

<section class="funfact pos-rel z-1 radius-20"  style="background-color: rgb(138 142 117);">
            <div class="container-fluid">
                <div class="row align-items-center">
                    <div class="col-lg-6">
                        <div class="funfact-image">
						
						
                          
                            <div class="funfact-image-inner">
								<?php $i = 0;
        foreach( $instance['a_repeater'] as $item ){
            
            $i++;
            //visibility
            if ( $item['visibility'] == '' ){ 

              $text= 0;
                 $image_url = "";
                if ( $item['image'] != '' ){
                    $image_url = wp_get_attachment_image_src( $item['image'], "swap-whychoose", false );
                }
             
                ?>  
						      <div class="xb-item--img borderimg">
                                  <img class="borderimg" src="<?php echo esc_url( $image_url[0] ); ?>" alt="">
                                </div>
									<?php 
				    
				}
				}
         ?>      
		 
		 
                                
                            </div>
							
						
		 
		 
                            <div class="funfact-image-inner marquee-2">
							 <?php $i = 0;
        foreach( $instance['a_repeater1'] as $item ){
            
            $i++;
            //visibility
            if ( $item['visibility'] == '' ){ 

              $text= 0;
                 $image_url2 = "";
                if ( $item['image2'] != '' ){
                    $image_url2 = wp_get_attachment_image_src( $item['image2'], "swap-whychoose", false );
                }
             
                ?> 
                                <div class="xb-item--img">
                                    <img class="borderimg" src="<?php echo esc_url( $image_url2[0] ); ?>" alt="">
                                </div>
                                <?php 
				    
				}
				}
         ?>
							
                            </div>
							  
                        </div>
                    </div>
					
					
					
					
					
                    <div class="col-lg-6">
                        <div class="funfact-content pt-150 pb-150 wow fadeIn" data-wow-duration="400ms">
                            <div class="sec-title sec-title--white mb-55">
                                <span class="xb-item--subtitle"><?php echo esc_attr( $instance['tagline'] ); ?></span>
                                <h2 class="xb-item--title mb-20" data-cursor="-opaque"><?php echo esc_attr( $instance['title'] ); ?></h2>
                                <div class="xb-item--content"><?php echo wp_kses_post( $instance['content'] ); ?></div>
                            </div>
							<ul class="funfact-list list-unstyled mt-50">
							<?php $i = 0;
        foreach( $instance['a_repeater2'] as $item ){
            
            $i++;
            //visibility
            if ( $item['visibility'] == '' ){ 

              $text= 0;
                 $image_url3 = "";
                if ( $item['image3'] != '' ){
                    $image_url3 = wp_get_attachment_image_src( $item['image3'], "swap-whychoose", false );
                }
             
                ?>  
							
                            
                                <li><span><img src="<?php echo esc_url( $image_url3[0] ); ?>" alt=""></span><?php echo esc_attr( $item['title1'] ); ?></li>
                                
                      
							
							  <?php 
				    
				}
				}
         ?>
          
                            </ul>            
			<div class="funfact-btn mt-60" >
                                <a href="<?php echo sow_esc_url_raw( $instance['button_url'] ); ?>" class="thm-btn" style="background-color: var(--color-secondary);">
                                    <span><?php echo esc_attr( $instance['button_text'] ); ?></span>
                                </a>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="funfact-shape">
                <img  class="whyimg"src="<?php echo esc_url( $image_url1[0] ); ?>" alt="" style="filter: brightness(0) invert(1) grayscale(1);">
            </div>
        </section>