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 ( $trial_id );
{
    my %pos;
    for ( my $x = 0; $x < @_; $x += 2 )
    {
        $pos{ $_[$x] } = $x + 1;
    }

    foreach my $arg ( qw( trial_id ) )
    {
        HTML::Mason::Exception::Params->throw
            ( error => "no value sent for required parameter '$arg'" )
                unless exists $pos{$arg};
    }
#line 3 "/home/production/cxgn/sgn/mason/breeders_toolbox/data_agreement.mas"
    $trial_id = $_[ $pos{'trial_id'} ];
}
$m->debug_hook( $m->current_comp->path ) if ( HTML::Mason::Compiler::IN_PERL_DB() );

#line 1 "/home/production/cxgn/sgn/mason/breeders_toolbox/data_agreement.mas"
$m->print( '
' );
#line 5 "/home/production/cxgn/sgn/mason/breeders_toolbox/data_agreement.mas"
$m->print( '
<div id="data_agreement_div">

</div>

<script>

jQuery(document).ready(function () {

    get_data_agreement(' );
#line 14 "/home/production/cxgn/sgn/mason/breeders_toolbox/data_agreement.mas"
$m->print(  $trial_id  );
#line 14 "/home/production/cxgn/sgn/mason/breeders_toolbox/data_agreement.mas"
$m->print( ', \'data_agreement_div\');

    function get_data_agreement(project_id, div) { 
      jQuery.ajax( { 
        async: true,
        url: \'/breeders/trial/data_agreement/get\',
        data: { \'project_id\': project_id },
        success: function(response) {
           if (response.text) { 
             jQuery(\'#\'+div).html(response.text);
           }
           else { 
             jQuery(\'#\'+div).html(\'By default, trial data is provided under the Toronto agreement, as explained in the <a href="/usage_policy">data usage policy</a>.\');
           }
           if (response.message) { alert(response.message); }
        },
        error: function(response) { 
           alert(\'An error occurred fetching the data agreement data.\');
        }
      });
    }

});


</script>
' );
;return;
},
'declared_args' => {
  '$trial_id' => { default => undef }
},
'load_time' => 1763102299,

)
;