<?php
	$item = [];
	if (isset($payload)) {
		$images = [];
		$hovers = [];
		$buttons = [];
		foreach ($payload as $key => $value) {
			
			if (preg_match('/^image(\d+)$/', $key, $matches)) {
            $index = $matches[1]; // Captura o número da imagem
            $images[$index] = ['image' => $value]; // Armazena no array temporário
			}
			
			if (preg_match('/^hover(\d+)$/', $key, $matches)) {
				$index = $matches[1];
				$hovers[$index] = ['hover' => $value];
			}
			if (preg_match('/^btn(\d+)$/', $key, $matches)) {
				$index = $matches[1];
				$buttons[$index] = ['btn' => $value];
			}
		}

		foreach ($images as $index => $imgData) {
			$item[] = (object) array_merge(
				$imgData,
				$hovers[$index] ?? ['hover' => null],
				$buttons[$index] ?? ['btn' => null],
			);
		}

		$data = (object) [
			'title' => $payload->title->value ?? null,
			'team' => $item,
		];
	}
?>

<div class="<?php if(isset($path) && $path =='team'): ?> bg-dark <?php endif; ?>" >
    <div class="team-responsive <?php if(isset($path) && $path =='team'): ?> container container-botton <?php endif; ?> ">
        <div class="<?php if(isset($path) && $path =='team'): ?> header-counter  <?php else: ?> team <?php endif; ?>">
            <div class=" <?php if(isset($path) && $path =='team'): ?> header-bottom d-flex justify-content-between   <?php else: ?> m-auto  <?php endif; ?>" style="max-width: 85rem">
                <div class="">
                    <?php if(isset($data->title)): ?>
                        <div class="d-flex justify-content-start align-items-stretch" style="width:100%; ">
                            <div class="box-icon" style="width: 100%">
                                <?php if(isset($data->title)): ?>
                                    <h2 class="<?php if(isset($path) && $path =='home'): ?> team-white <?php endif; ?>" ><strong><?php echo e($data->title); ?></strong></h2>
                                <?php endif; ?>
                            </div>
                        </div>
                    <?php endif; ?>
                </div>
				<div class="row m-auto pb-5 justify-content-center">
					<?php $__currentLoopData = $data->team; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $item): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
						<?php if(isset($item->image)): ?>
							<div class="box-one d-flex <?php if(isset($item->btn)): ?> box-height <?php endif; ?>">
								<div class="box-icon d-flex flex-column justify-content-center">
									<div class="text-center box-text">
										<div class="main-icon">
											<img src="<?php echo e($item->image->src); ?>" alt="<?php echo e($item->image->alt); ?>">
										</div>
										<?php if(isset($item->hover)): ?>
										<div class="hover-icon">
											<p class="fs-5"><strong><?php echo e($item->image->alt); ?></strong></p>
											<img src="<?php echo e($item->hover->src); ?>" alt="<?php echo e($item->hover->alt); ?>">
										</div>
										<?php endif; ?>
									</div>
									<div class="text-center">
										<?php if(isset($item->btn)): ?>
											<a  href="<?php echo e($item->btn->href); ?>" class="btn soluti-btn" target="<?php echo e($item->btn->target ?? '_blank'); ?>"><?php echo e($item->btn->value); ?></a>
										<?php endif; ?>
									</div>
								</div>
							</div>
						<?php endif; ?>
					<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
					
				</div>
            </div>
        </div>
    </div>
</div>
	

	
<!-- End Header Counter Area -->
<?php /**PATH /home/gphostc1/public_html/mazfer/resources/views/site/components/team.blade.php ENDPATH**/ ?>