code: public function getMainVariation(array $variations)
      {
          $mainVariation = array_filter($variations, function ($variation) {
              return $variation['isMain'] === true;
          });
  
          if (empty($mainVariation)) {
              return [];
          }
  
          return reset($mainVariation);
      }
docs: @param array $variations
  
  @return array