disabled
      auto
  4   ˆl–Ðz¾”ªC]ŠqAàZ¸Ë*bÑ¿ŽþG*Î6\#->éóÂ175ÁÀ¿  5   	ˆl–Ãa¾”J_)â�~ãnÜmõ1hß�þB g�49_lEkùÃƒh¹ÂÁÀ  ¯        <   f      €   ƒ   ‡   Œ   �   ‘   ž   ¡   ¥   ©   %f%N%a%N%d%N%b%N%s %h %e %r%N%%z %T%N%c%N Þ‹Þ¨ÞˆÞ¬Þ€Þ¨ÞƒÞ§Þ‡Þ°Þ–Þ¬  MV MDV MV   Î   Þ‹Þ¨ÞˆÞ¬Þ€Þ¨ dv div div UTF-8       	auto
     ˆ¾�þB g�5Ð™gùÃƒh¹ÂÁÀ  @   ˆl–Ým_J	¥2ÛB‚ „ Cq¶nõ1hß�þBÈšY²´ôq¸ùHùüÿÄƒiðÃ_ˆI|¥�+V[(ÃÂ      disabled
 $    package Biber::Entry::Names;
use v5.24;
use strict;
use warnings;
use parent qw(Class::Accessor);
__PACKAGE__->follow_best_practice;
no autovivification;

use Data::Dump;
use Data::Uniqid qw (suniqid);
use Biber::Config;
use Log::Log4perl qw( :no_extra_logdie_message );
my $logger = Log::Log4perl::get_logger('main');

# Names of simple package accessor attributes for those not created automatically
# by the option scope in the .bcf
__PACKAGE__->mk_accessors(qw (
                              id
                              type
                            ));

=encoding utf-8

=head1 NAME

Biber::Entry::Names - Biber::Entry::Names objects

=head2 new

    Initialize a Biber::Entry::Names object

=cut

sub new {
  my ($class, %params) = @_;

  return bless {namelist => [],
                id       => suniqid,
                %params}, $class;
}


=head2 TO_JSON

   Serialiser for JSON::XS::encode

=cut

# sub TO_JSON {
#   my $self = shift;
#   foreach my $n ($self->@*){
#     $json->{$k} = $v;
#   }
#   return [ map {$_} $self->@* ];
# }

=head2 notnull

    Test for an empty object

=cut

sub notnull {
  my $self = shift;
  my @arr = $self->{namelist}->@*;
  return $#arr > -1 ? 1 : 0;
}

=head2 names

    Return ref to array of all Biber::Entry::Name objects
    in object

=cut

sub names {
  my $self = shift;
  return $self->{namelist};
}

=head2 add_name

    Add a Biber::Entry::Name object to the Biber::Entry::Names
    object

=cut

sub add_name {
  my $self = shift;
  my $name_obj = shift;
  push $self->{namelist}->@*, $name_obj;
  $name_obj->set_index($#{$self->{namelist}} + 1);
  return;
}

=head2 replace_name

    Replace a Biber::Entry::Name at a position (1-based)
    with a provided one

=cut

sub replace_name {
  my ($self, $name_obj, $position) = @_;
  $name_obj->set_index($position-1);
  $self->{namelist}->[$position-1] = $name_obj;
  return;
}

=head2 splice

    Splice a Biber::Entry::Names object into a Biber::Entry::Names object at a
    position (1-based)

=cut

sub splice {
  my ($self, $names, $position) = @_;
  splice($self->{namelist}->@*, $position-1, 1, $names->{namelist}->@*);
  # now re-index all names in list
  foreach (my $i=0;$i<$#{$self->{namelist}};$i++) {
    $self->{namelist}->[$i]->set_index($i);
  }
  return;
}

=head2 set_morenames

    Sets a flag to say that we had a "and others" in the data

=cut

sub set_morenames {
  my $self = shift;
  $self->{morenames} = 1;
  return;
}

=head2 get_morenames

    Gets the morenames flag

=cut

sub get_morenames {
  my $self = shift;
  return $self->{morenames} ? 1 : 0;
}

=head2 count

    Returns the number of Biber::Entry::Name objects in the object

=cut

sub count {
  my $self = shift;
  return scalar $self->{namelist}->@*;
}

=head2 is_nth_name

    Returns boolean to say of there is an nth name

=cut

sub is_nth_name {
  my ($self, $n) = @_;
  # name n is 1-based, don't go into negative indices
  return $self->{namelist}[($n == 0) ? 0 : $n-1];
}

=head2 nth_name

    Returns the nth Biber::Entry::Name object in the object or the last one
    if n > total names

=cut

sub nth_name {
  my ($self, $n) = @_;
  my $size = $self->{namelist}->@*;
  return $self->{namelist}[$n > $size ? $size-1 : $n-1];
}

=head2 first_n_names

    Returns an array ref of Biber::Entry::Name objects containing only
    the first n Biber::Entry::Name objects or all names if n > total names

=cut

sub first_n_names {
  my $self = shift;
  my $n = shift;
  my $size = $self->{namelist}->@*;
  return [ $self->{namelist}->@[0 .. ($n > $size ? $size-1 : $n-1)] ];
}

=head2 del_last_name

    Del