package SGN::View::Mason::Commands;
use strict;
use vars qw($m $c);
HTML::Mason::Component::FileBased->new(
'code' => sub {
use utf8; local $SGN::View::Mason::Commands::m = $HTML::Mason::Commands::m;
HTML::Mason::Exception::Params->throw
    ( error =>
      "Odd number of parameters passed to component expecting name/value pairs"
    ) if @_ % 2;
my ( $map_id, $map_version_id, $hilite, $size, $map_items, $short_name, $long_name, $force, $physical, $referer, $abstract, $tempdir, $basepath, $map_url, $chr_url, $comp_maps_url, $default_map_id, $private, @hilite_markers, $marker_stats, $chromosome_stats, $message, $overview_image, $can_overlay, $parent1_stock_id, $parent1_stock_name, $parent2_stock_id, $parent2_stock_name );
{
    my %pos;
    for ( my $x = 0; $x < @_; $x += 2 )
    {
        $pos{ $_[$x] } = $x + 1;
    }

    foreach my $arg ( qw( map_items referer tempdir basepath map_url chr_url overview_image ) )
    {
        HTML::Mason::Exception::Params->throw
            ( error => "no value sent for required parameter '$arg'" )
                unless exists $pos{$arg};
    }
#line 103 "/home/production/cxgn/sgn/mason/cview/map/index.mas"
     $map_id = exists $pos{'map_id'} ? $_[ $pos{'map_id'} ] :  undef;
#line 104 "/home/production/cxgn/sgn/mason/cview/map/index.mas"
     $map_version_id = exists $pos{'map_version_id'} ? $_[ $pos{'map_version_id'} ] :  undef;
#line 105 "/home/production/cxgn/sgn/mason/cview/map/index.mas"
     $hilite = exists $pos{'hilite'} ? $_[ $pos{'hilite'} ] :  undef;
#line 106 "/home/production/cxgn/sgn/mason/cview/map/index.mas"
     $size = exists $pos{'size'} ? $_[ $pos{'size'} ] :  1;
#line 107 "/home/production/cxgn/sgn/mason/cview/map/index.mas"
    $map_items = $_[ $pos{'map_items'} ];
#line 108 "/home/production/cxgn/sgn/mason/cview/map/index.mas"
     $short_name = exists $pos{'short_name'} ? $_[ $pos{'short_name'} ] :  "untitled map";
#line 109 "/home/production/cxgn/sgn/mason/cview/map/index.mas"
     $long_name = exists $pos{'long_name'} ? $_[ $pos{'long_name'} ] :  "untitled map";
#line 110 "/home/production/cxgn/sgn/mason/cview/map/index.mas"
     $force = exists $pos{'force'} ? $_[ $pos{'force'} ] :  0;
#line 111 "/home/production/cxgn/sgn/mason/cview/map/index.mas"
     $physical = exists $pos{'physical'} ? $_[ $pos{'physical'} ] :  undef;
#line 112 "/home/production/cxgn/sgn/mason/cview/map/index.mas"
    $referer = $_[ $pos{'referer'} ];
#line 113 "/home/production/cxgn/sgn/mason/cview/map/index.mas"
     $abstract = exists $pos{'abstract'} ? $_[ $pos{'abstract'} ] :  '';
#line 114 "/home/production/cxgn/sgn/mason/cview/map/index.mas"
    $tempdir = $_[ $pos{'tempdir'} ];
#line 115 "/home/production/cxgn/sgn/mason/cview/map/index.mas"
    $basepath = $_[ $pos{'basepath'} ];
#line 116 "/home/production/cxgn/sgn/mason/cview/map/index.mas"
    $map_url = $_[ $pos{'map_url'} ];
#line 117 "/home/production/cxgn/sgn/mason/cview/map/index.mas"
    $chr_url = $_[ $pos{'chr_url'} ];
#line 118 "/home/production/cxgn/sgn/mason/cview/map/index.mas"
     $comp_maps_url = exists $pos{'comp_maps_url'} ? $_[ $pos{'comp_maps_url'} ] :  '';
#line 119 "/home/production/cxgn/sgn/mason/cview/map/index.mas"
     $default_map_id = exists $pos{'default_map_id'} ? $_[ $pos{'default_map_id'} ] :  9;
#line 120 "/home/production/cxgn/sgn/mason/cview/map/index.mas"
     $private = exists $pos{'private'} ? $_[ $pos{'private'} ] :  '';
#line 121 "/home/production/cxgn/sgn/mason/cview/map/index.mas"
     @hilite_markers = exists $pos{'hilite_markers'} ? HTML::Mason::Tools::coerce_to_array( $_[ $pos{'hilite_markers'} ], '@hilite_markers') :  ();
#line 122 "/home/production/cxgn/sgn/mason/cview/map/index.mas"
     $marker_stats = exists $pos{'marker_stats'} ? $_[ $pos{'marker_stats'} ] :  '';
#line 123 "/home/production/cxgn/sgn/mason/cview/map/index.mas"
     $chromosome_stats = exists $pos{'chromosome_stats'} ? $_[ $pos{'chromosome_stats'} ] :  '';
#line 124 "/home/production/cxgn/sgn/mason/cview/map/index.mas"
     $message = exists $pos{'message'} ? $_[ $pos{'message'} ] :  '';
#line 125 "/home/production/cxgn/sgn/mason/cview/map/index.mas"
    $overview_image = $_[ $pos{'overview_image'} ];
#line 126 "/home/production/cxgn/sgn/mason/cview/map/index.mas"
     $can_overlay = exists $pos{'can_overlay'} ? $_[ $pos{'can_overlay'} ] :  0;
#line 127 "/home/production/cxgn/sgn/mason/cview/map/index.mas"
     $parent1_stock_id = exists $pos{'parent1_stock_id'} ? $_[ $pos{'parent1_stock_id'} ] :  '';
#line 128 "/home/production/cxgn/sgn/mason/cview/map/index.mas"
     $parent1_stock_name = exists $pos{'parent1_stock_name'} ? $_[ $pos{'parent1_stock_name'} ] :  '(unknown)';
#line 129 "/home/production/cxgn/sgn/mason/cview/map/index.mas"
     $parent2_stock_id = exists $pos{'parent2_stock_id'} ? $_[ $pos{'parent2_stock_id'} ] :  '';
#line 130 "/home/production/cxgn/sgn/mason/cview/map/index.mas"
     $parent2_stock_name = exists $pos{'parent2_stock_name'} ? $_[ $pos{'parent2_stock_name'} ] :  '(unknown)';
}
$m->debug_hook( $m->current_comp->path ) if ( HTML::Mason::Compiler::IN_PERL_DB() );

#line 1 "/home/production/cxgn/sgn/mason/cview/map/index.mas"
$m->print( '
' );
#line 101 "/home/production/cxgn/sgn/mason/cview/map/index.mas"
$m->print( '
' );
#line 132 "/home/production/cxgn/sgn/mason/cview/map/index.mas"
$m->print( '
' );
#line 133 "/home/production/cxgn/sgn/mason/cview/map/index.mas"



# Historic Perl comment by Robert Ahrens, ca. 2003
#
# sub hack_abstract ($$$) {    
#     # Look.  This is a total hack and that's that.  Let's make no
#     # bones about it. There is doubtlessly a good way to handle this,
#     # but in the meantime this sub will allow us to swap in a decent
#     # abstract for the physical mapping project w/o having to redesign
#     # code.
#     my ($abstract, $map, $physical) = @_;

#line 147 "/home/production/cxgn/sgn/mason/cview/map/index.mas"
$m->print( '
' );
#line 148 "/home/production/cxgn/sgn/mason/cview/map/index.mas"
$m->comp(   '/page/page_title.mas', title=> $short_name   
); #line 148 "/home/production/cxgn/sgn/mason/cview/map/index.mas"
$m->print( '

<div class="container-fluid">

<div id="pagetitle2"><center><h3>' );
#line 152 "/home/production/cxgn/sgn/mason/cview/map/index.mas"
$m->print( $long_name );
#line 152 "/home/production/cxgn/sgn/mason/cview/map/index.mas"
$m->print( '</h3></center></div>

' );
#line 154 "/home/production/cxgn/sgn/mason/cview/map/index.mas"
 if ($private) {
 print $private;
 return;
} 
$m->print( '
' );
#line 159 "/home/production/cxgn/sgn/mason/cview/map/index.mas"
 if ($message) { 
    print "<div class=\"boxbgcolor5\"><b>NOTE:</b><br />$message</div>\n";
 }
$m->print( '
' );
#line 163 "/home/production/cxgn/sgn/mason/cview/map/index.mas"
$m->comp(   '/cview/map/overview.mas',
  map_version_id => $map_version_id,
  overview_image => $overview_image,
  size => $size,
  hilite_markers => [ @hilite_markers ],
  map_items=> $map_items,
  basepath => $basepath,
  tempdir => $tempdir,
  map_url => $map_url,
  chr_url => $chr_url,
  
); #line 173 "/home/production/cxgn/sgn/mason/cview/map/index.mas"
$m->print( '

' );
#line 175 "/home/production/cxgn/sgn/mason/cview/map/index.mas"
$m->comp(   '/cview/map/overlay_form.mas', 
  map_version_id => $map_version_id,
  can_overlay    => $can_overlay,
  map_items      => $map_items,
  size           => $size,
  hilite         => $hilite,
  map_url        => $map_url,
  
); #line 182 "/home/production/cxgn/sgn/mason/cview/map/index.mas"
$m->print( '


' );
#line 185 "/home/production/cxgn/sgn/mason/cview/map/index.mas"
 if ($abstract) { 
$m->print( '
' );
#line 187 "/home/production/cxgn/sgn/mason/cview/map/index.mas"
$m->comp( { content => sub {
#line 187 "/home/production/cxgn/sgn/mason/cview/map/index.mas"
$m->print( '
' );
#line 188 "/home/production/cxgn/sgn/mason/cview/map/index.mas"
$m->print(  $abstract  );
#line 188 "/home/production/cxgn/sgn/mason/cview/map/index.mas"
$m->print( '
' );
#line 189 "/home/production/cxgn/sgn/mason/cview/map/index.mas"
} }, '/page/info_section.mas', title=>"Abstract", collapsible=>1, collapsed=>0
 );
#line 189 "/home/production/cxgn/sgn/mason/cview/map/index.mas"
$m->print( '

' );
#line 191 "/home/production/cxgn/sgn/mason/cview/map/index.mas"
 }
$m->print( '
' );
#line 193 "/home/production/cxgn/sgn/mason/cview/map/index.mas"
 my ($stock1_link, $stock2_link) = ("", "");
 $parent1_stock_id ?  $stock1_link='' : $stock1_link = "/stock/$parent1_stock_id/view";
 $parent2_stock_id ?  $stock2_link='' : $stock2_link = "/stock/$parent2_stock_id/view";
$m->comp( { content => sub {
#line 196 "/home/production/cxgn/sgn/mason/cview/map/index.mas"
$m->print( '
<p>Parent 1 <a href="' );
#line 197 "/home/production/cxgn/sgn/mason/cview/map/index.mas"
$m->print(  $stock1_link  );
#line 197 "/home/production/cxgn/sgn/mason/cview/map/index.mas"
$m->print( '">' );
#line 197 "/home/production/cxgn/sgn/mason/cview/map/index.mas"
$m->print(  $parent1_stock_name  );
#line 197 "/home/production/cxgn/sgn/mason/cview/map/index.mas"
$m->print( '</a></p>
<p>Parent 2 <a href="' );
#line 198 "/home/production/cxgn/sgn/mason/cview/map/index.mas"
$m->print(  $stock2_link  );
#line 198 "/home/production/cxgn/sgn/mason/cview/map/index.mas"
$m->print( '">' );
#line 198 "/home/production/cxgn/sgn/mason/cview/map/index.mas"
$m->print(  $parent2_stock_name  );
#line 198 "/home/production/cxgn/sgn/mason/cview/map/index.mas"
$m->print( '</a></p>
' );
#line 199 "/home/production/cxgn/sgn/mason/cview/map/index.mas"
} }, '/page/info_section.mas', collapsible => 1, title=>"Parents of Mapping Population"
 );
#line 199 "/home/production/cxgn/sgn/mason/cview/map/index.mas"
$m->print( '


' );
#line 202 "/home/production/cxgn/sgn/mason/cview/map/index.mas"
 my $total = 0; 
 my $html = '<table class="table table-hover table-condensed table-bordered"><thead><tr class="info"><th>Chromosome</th><th>Markers</th></tr></thead><tbody>';
 foreach (@$chromosome_stats) { $html .= "<tr><td>$_->[0]</td><td>$_->[1]</td></tr>"; $total += $_->[2];  }
 $html .= '<tr><td><b>Total:</b></td><td>'.$total.'</td></tr></tbody>';
 $html .= '</table>';
$m->comp( { content => sub {
#line 211 "/home/production/cxgn/sgn/mason/cview/map/index.mas"
$m->print( '

<div class="row">
  <div class="col-sm-6 col-md-6 col-lg-6">
    ' );
#line 215 "/home/production/cxgn/sgn/mason/cview/map/index.mas"
$m->print(  $html  );
#line 215 "/home/production/cxgn/sgn/mason/cview/map/index.mas"
$m->print( '
  </div>
  <div class="col-sm-6 col-md-6 col-lg-6">
    <div class="panel panel-info">
      <div class="panel-heading">Overview</div>
      <div class="panel-body">
        ' );
#line 221 "/home/production/cxgn/sgn/mason/cview/map/index.mas"
$m->print(  $marker_stats  );
#line 221 "/home/production/cxgn/sgn/mason/cview/map/index.mas"
$m->print( '
      </div>
    </div>
  </div>
</div>
' );
#line 226 "/home/production/cxgn/sgn/mason/cview/map/index.mas"
} }, '/page/info_section.mas', 
  title => 'Map Statistics',
  collapsible => 1,
  collapsed => 0,
 );
#line 226 "/home/production/cxgn/sgn/mason/cview/map/index.mas"
$m->print( '

' );
#line 228 "/home/production/cxgn/sgn/mason/cview/map/index.mas"
$m->comp(   '/page/comments.mas', object_type=>"map", object_id => $map_version_id,  referer => $referer   
); #line 228 "/home/production/cxgn/sgn/mason/cview/map/index.mas"
$m->print( '

</div>
' );
;return;
},
'declared_args' => {
  '$abstract' => { default => ' \'\'' },
  '$basepath' => { default => undef },
  '$can_overlay' => { default => ' 0' },
  '$chr_url' => { default => undef },
  '$chromosome_stats' => { default => ' \'\'' },
  '$comp_maps_url' => { default => ' \'\'' },
  '$default_map_id' => { default => ' 9' },
  '$force' => { default => ' 0' },
  '$hilite' => { default => ' undef' },
  '$long_name' => { default => ' "untitled map"' },
  '$map_id' => { default => ' undef' },
  '$map_items' => { default => undef },
  '$map_url' => { default => undef },
  '$map_version_id' => { default => ' undef' },
  '$marker_stats' => { default => ' \'\'' },
  '$message' => { default => ' \'\'' },
  '$overview_image' => { default => undef },
  '$parent1_stock_id' => { default => ' \'\'' },
  '$parent1_stock_name' => { default => ' \'(unknown)\'' },
  '$parent2_stock_id' => { default => ' \'\'' },
  '$parent2_stock_name' => { default => ' \'(unknown)\'' },
  '$physical' => { default => ' undef' },
  '$private' => { default => ' \'\'' },
  '$referer' => { default => undef },
  '$short_name' => { default => ' "untitled map"' },
  '$size' => { default => ' 1' },
  '$tempdir' => { default => undef },
  '@hilite_markers' => { default => ' ()' }
},
'load_time' => 1763166043,

)
;