From 021c10d174acf077dc6b4d47557344dd6e26d3d3 Mon Sep 17 00:00:00 2001
From: Rodrigo Goncalves
Date: Fri, 14 Aug 2015 09:44:07 -0300
Subject: [PATCH] Ajustes para funcionar o CAS diretamente
---
FixTemplateGenerator.diff | 11 +++++++++++
Kernel/Modules/NewTicketWizard.pm | 98 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++----------
Kernel/Modules/NewTicketWizardPublic.pm | 125 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++------------------
Kernel/Modules/NewTicketWizardServiceForm.pm | 37 ++++++++++++++++++++++++++++++-------
Kernel/Output/HTML/Standard/NewTicketWizardServiceFormEdit.tt | 9 ++++++++-
Kernel/System/RestrictedService.pm | 89 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Kernel/System/ServiceForm.pm | 86 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++------
NewTicketWizard.sopm | 25 ++++++++++++++++++++++++-
scripts/test/SchemaTest.t | 145 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
sqls.sql | 5 +++++
var/httpd/htdocs/js/NewTicketWizard.js | 1 +
var/httpd/htdocs/js/thirdparty/alpaca/.alpaca-full.min.js.swp | Bin 0 -> 778240 bytes
var/httpd/htdocs/js/thirdparty/alpaca/alpaca-full.min.js | 85 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++------
var/httpd/htdocs/js/thirdparty/alpaca/alpaca.min.js | 9 +++++++++
var/httpd/htdocs/js/thirdparty/alpaca/handlebars.min.js | 28 ++++++++++++++++++++++++++++
var/httpd/htdocs/skins/Customer/default/css/alpaca/alpaca-jqueryui-newticketwizard.css | 10 ++++++++++
var/httpd/htdocs/skins/Customer/default/css/alpaca/alpaca-newticketwizard.css | 22 ++++++++++++++++------
17 files changed, 730 insertions(+), 55 deletions(-)
create mode 100644 FixTemplateGenerator.diff
create mode 100644 Kernel/System/RestrictedService.pm
create mode 100644 scripts/test/SchemaTest.t
create mode 100644 sqls.sql
create mode 100644 var/httpd/htdocs/js/thirdparty/alpaca/.alpaca-full.min.js.swp
create mode 100644 var/httpd/htdocs/js/thirdparty/alpaca/alpaca.min.js
create mode 100644 var/httpd/htdocs/js/thirdparty/alpaca/handlebars.min.js
diff --git a/FixTemplateGenerator.diff b/FixTemplateGenerator.diff
new file mode 100644
index 0000000..36417a7
--- /dev/null
+++ b/FixTemplateGenerator.diff
@@ -0,0 +1,11 @@
+1264,1266c1264,1269
+< $Data{$Attribute} = $Kernel::OM->Get('Kernel::System::HTMLUtils')->ToHTML(
+< String => $Data{$Attribute},
+< );
+---
+> # Fix to allow HTML text in body
+> if (!($Attribute eq "Body")) {
+> $Data{$Attribute} = $Kernel::OM->Get('Kernel::System::HTMLUtils')->ToHTML(
+> String => $Data{$Attribute},
+> );
+> }
diff --git a/Kernel/Modules/NewTicketWizard.pm b/Kernel/Modules/NewTicketWizard.pm
index dfa5823..eee86c7 100644
--- a/Kernel/Modules/NewTicketWizard.pm
+++ b/Kernel/Modules/NewTicketWizard.pm
@@ -3,6 +3,7 @@
#
# Copyright (C) SeTIC - UFSC - http://setic.ufsc.br/
# Version 01/08/2015 - Support for OTRS 4.0.3
+# Version 25/06/2015 - Support for HTML formatting of form fields
#
# --
# This software comes with ABSOLUTELY NO WARRANTY. For details, see
@@ -206,12 +207,15 @@ sub GetFormJSON {
my $LayoutObject = $Kernel::OM->Get("Kernel::Output::HTML::Layout");
my $ParamObject = $Kernel::OM->Get("Kernel::System::Web::Request");
- if ( $Param{ServiceID} ) {
- %serviceForm = $ServiceFormObject->GetServiceForm( ServiceID => $Param{ServiceID} );
- }
-
my $QueueID = $ParamObject->GetParam( Param => "QueueID" );
+ if ( $Param{ServiceID} ) {
+ %serviceForm = $ServiceFormObject->GetServiceFormForQueue( ServiceID => $Param{ServiceID}, QueueID => $QueueID );
+ if (! $serviceForm{ServiceID}) {
+ %serviceForm = $ServiceFormObject->GetServiceForm( ServiceID => $Param{ServiceID} );
+ }
+ }
+
my ( $schema, $fields, $introduction ) = $Self->GetForm( ServiceForm => \%serviceForm, QueueID => $QueueID );
return $LayoutObject->Attachment(
@@ -257,8 +261,13 @@ sub GetForm {
$schema =~ s/CF_SCHEMA/$schemaForm/g;
$fields =~ s/CF_FORM/$fieldsForm/g;
}
+
+ # Ajusta campos fixos, se houver
+ if ($serviceForm{FixedValues}) {
+ ($schema, $fields) = $Self->AdjustFixedFields(Schema => $schema, Fields => $fields, FixedValues => $serviceForm{FixedValues});
+ }
}
-
+
# Incluir campos dinâmicos no replace
( $schema, $fields ) = $TicketWizard->ReplaceOTRSDynamicFields( Schema => $schema, Options => $fields );
@@ -350,17 +359,33 @@ sub CreateTicket {
UserID => $ConfigObject->Get('CustomerPanelUserID'),
);
- my $MimeType = 'text/plain';
+ my $MimeType = 'text/html';
my $serviceFields = "";
# Service Fields
for ( $ParamObject->GetParamNames() ) {
if ( substr( $_, 0, 3 ) eq "SF_" ) {
- $serviceFields .= substr( $_, 3 ) . ": " . $ParamObject->GetParam( Param => $_ ) . "\n";
+ if ($ParamObject->GetArray( Param => $_ )) {
+ my @paramVals = $ParamObject->GetArray( Param => $_ );
+ for my $paramValue (@paramVals) {
+ if (($paramValue) && (!($paramValue eq "-"))) {
+ $serviceFields .= "" . $Self->breakWords(Text => substr( $_, 3 )) . ": " . $paramValue . " ";
+ }
+ }
+
+ } else {
+ my $paramValue = $ParamObject->GetParam( Param => $_ );
+
+ if (($paramValue) && (!($paramValue eq "-"))) {
+ $serviceFields .= "" . $Self->breakWords(Text => substr( $_, 3 )) . ": " . $ParamObject->GetParam( Param => $_ ) . " ";
+ }
+ }
}
}
- $serviceFields .= "Login autenticado: " . $Self->{UserLogin} . "\n";
- $serviceFields .= "\n\n";
+
+ $serviceFields .= "Login autenticado: " . $Self->{UserLogin} . " ";
+ $serviceFields .= "IP: " . $ENV{'REMOTE_ADDR'} . " ";
+ $serviceFields .= " ";
# Dynamic Fields
for ( $ParamObject->GetParamNames() ) {
@@ -397,7 +422,7 @@ sub CreateTicket {
From => $From,
To => $Queue,
Subject => $ParamObject->GetParam( Param => "subject" ),
- Body => $serviceFields . $ParamObject->GetParam( Param => "description" ),
+ Body => $serviceFields . $Self->lineBreakToHTML(Text => $ParamObject->GetParam( Param => "description" )),
},
Queue => $Queue,
);
@@ -430,4 +455,57 @@ sub CreateTicket {
}
+sub AdjustFixedFields {
+ my ( $Self, %Param ) = @_;
+ my $schema = $Param{Schema};
+ my $form = $Param{Fields};
+ my $fixedValues = $Param{FixedValues};
+
+ my @values = split(/\n/, $fixedValues);
+
+
+ for my $value (@values) {
+ $value =~ s/\r//g;
+ my @data = split('=', $value);
+
+ my $fieldKey = $data[0];
+ my $fixedValue = $data[1];
+
+ my $key = '("' . $fieldKey . '"[\ ]?:[\ ]?{[^}]+})';
+ my $replace = '"' . $fieldKey . '"' . ': {"type": "string", "default": "' . $fixedValue . '"}';
+
+ $schema =~ s/$key/$replace/;
+
+ $key = '("' . $fieldKey . '"[\ ]?:[\ ]?{[^}]+})';
+ $replace = '"' . $fieldKey . '": {"type": "hidden"' . "\n}";
+ $form =~ s/$key/$replace/;
+ }
+
+ return ($schema, $form);
+
+}
+
+sub lineBreakToHTML {
+ my ( $Self, %Param ) = @_;
+
+ my $return = $Param{Text};
+ my $LINE_BREAK = " ";
+
+ $return =~ s/\n/$LINE_BREAK/g;
+
+ return $return;
+
+}
+
+sub breakWords {
+ my ( $Self, %Param ) = @_;
+
+ my $return = $Param{Text};
+
+ $return =~ s/(.)([A-Z][^A-Z])/$1 $2/g;
+ $return =~ s/([\w']+)/\u\L$1/g;
+
+ return $return;
+}
+
1;
diff --git a/Kernel/Modules/NewTicketWizardPublic.pm b/Kernel/Modules/NewTicketWizardPublic.pm
index 1416ea6..96e2421 100644
--- a/Kernel/Modules/NewTicketWizardPublic.pm
+++ b/Kernel/Modules/NewTicketWizardPublic.pm
@@ -3,6 +3,7 @@
#
# Copyright (C) SeTIC - UFSC - http://setic.ufsc.br/
# Version 01/08/2015 - Support for OTRS 4.0.3
+# Version 25/06/2015 - Support for restricted services and HTML formatting of form fields
#
# --
# This software comes with ABSOLUTELY NO WARRANTY. For details, see
@@ -34,7 +35,8 @@ our @ObjectDependencies = (
"Kernel::Output::HTML::Layout",
"KerneL::System::Log",
"Kernel::System::Queue",
-"Kernel::Config"
+"Kernel::Config",
+"Kernel::System::RestrictedService"
);
sub new {
@@ -55,6 +57,7 @@ sub BuildServices {
my $ConfigObject = $Kernel::OM->Get("Kernel::Config");
my $LayoutObject = $Kernel::OM->Get("Kernel::Output::HTML::Layout");
my $ServiceObject = $Kernel::OM->Get("Kernel::System::Service");
+ my $RestrictedObject = $Kernel::OM->Get("Kernel::System::RestrictedService");
# Build service chooser
my %Services = ();
@@ -67,25 +70,32 @@ sub BuildServices {
$QueueServiceObject->GetServiceList( QueueID => $ParamObject->GetParam( Param => "QueueID" ), );
}
my @ServicesCombo = ();
+
+ my @restrictedServices = $RestrictedObject->GetRestrictedServices();
for my $serviceID ( keys %Services ) {
if ( grep { index( $Services{$_}, $Services{$serviceID} . "::" ) >= 0 } ( keys %Services ) ) {
- my %serv = ();
- $serv{Value} = $Services{$serviceID};
- $serv{Key} = $serviceID;
- $serv{Disabled} = 1;
- push @ServicesCombo, \%serv;
+
+ if (! ( $serviceID ~~ @restrictedServices ) ) {
+ my %serv = ();
+ $serv{Value} = $Services{$serviceID};
+ $serv{Key} = $serviceID;
+ $serv{Disabled} = 1;
+ push @ServicesCombo, \%serv;
+ }
}
else {
- my %serv = ();
- $serv{Value} = $Services{$serviceID};
- $serv{Key} = $serviceID;
- push @ServicesCombo, \%serv;
+ if (! ( $serviceID ~~ @restrictedServices ) ) {
+ my %serv = ();
+ $serv{Value} = $Services{$serviceID};
+ $serv{Key} = $serviceID;
+ push @ServicesCombo, \%serv;
+ }
}
}
@ServicesCombo = sort { $a->{Value} . "::" cmp $b->{Value} . "::" } @ServicesCombo;
-
+
my $retorno = $LayoutObject->BuildSelection(
Data => \@ServicesCombo,
Name => 'ServiceID',
@@ -200,12 +210,16 @@ sub GetFormJSON {
my $LayoutObject = $Kernel::OM->Get("Kernel::Output::HTML::Layout");
my $ParamObject = $Kernel::OM->Get("Kernel::System::Web::Request");
+ my $QueueID = $ParamObject->GetParam(Param => "QueueID");
+
if ( $Param{ServiceID} ) {
- %serviceForm = $ServiceFormObject->GetServiceForm( ServiceID => $Param{ServiceID} );
+ %serviceForm = $ServiceFormObject->GetServiceFormForQueue( ServiceID => $Param{ServiceID}, QueueID => $QueueID );
+
+ if (! $serviceForm{ServiceID}) {
+ %serviceForm = $ServiceFormObject->GetServiceForm( ServiceID => $Param{ServiceID} );
+ }
}
- my $QueueID = $ParamObject->GetParam(Param => "QueueID");
-
my ( $schema, $fields, $introduction ) = $Self->GetForm( ServiceForm => \%serviceForm, QueueID => $QueueID );
return $LayoutObject->Attachment(
@@ -251,6 +265,12 @@ sub GetForm {
$schema =~ s/CF_SCHEMA/$schemaForm/g;
$fields =~ s/CF_FORM/$fieldsForm/g;
}
+
+ # Ajusta campos fixos, se houver
+ if ($serviceForm{FixedValues}) {
+
+ ($schema, $fields) = $Self->AdjustFixedFields(Schema => $schema, Fields => $fields, FixedValues => $serviceForm{FixedValues});
+ }
}
# Incluir campos dinâmicos no replace
@@ -373,17 +393,32 @@ sub CreateTicket {
UserID => $Self->{DefaultUserID},
);
- my $MimeType = 'text/plain';
+ my $MimeType = 'text/html';
my $serviceFields = "";
# Service Fields
for ( $ParamObject->GetParamNames() ) {
if ( substr( $_, 0, 3 ) eq "SF_" ) {
- $serviceFields .= substr( $_, 3 ) . ": " . $ParamObject->GetParam( Param => $_ ) . "\n";
+ if ($ParamObject->GetArray( Param => $_ )) {
+ my @paramVals = $ParamObject->GetArray( Param => $_ );
+ for my $paramValue (@paramVals) {
+ if (($paramValue) && (!($paramValue eq "-"))) {
+ $serviceFields .= "" . $Self->breakWords(Text => substr( $_, 3 )) . ": " . $paramValue . " ";
+ }
+ }
+
+ } else {
+ my $paramValue = $ParamObject->GetParam( Param => $_ );
+
+ if (($paramValue) && (!($paramValue eq "-"))) {
+ $serviceFields .= "" . $Self->breakWords(Text => substr( $_, 3 )) . ": " . $ParamObject->GetParam( Param => $_ ) . " ";
+ }
+ }
}
}
- $serviceFields .= "\n\n";
+ $serviceFields .= "IP: " . $ENV{'REMOTE_ADDR'} . " ";
+ $serviceFields .= " ";
# Dynamic Fields
for ( $ParamObject->GetParamNames() ) {
@@ -421,7 +456,7 @@ sub CreateTicket {
From => $From,
To => $Queue,
Subject => $ParamObject->GetParam( Param => "subject" ),
- Body => $serviceFields . $ParamObject->GetParam( Param => "description" ),
+ Body => $serviceFields . $Self->lineBreakToHTML(Text => $ParamObject->GetParam( Param => "description" )),
},
Queue => $Queue,
);
@@ -453,4 +488,58 @@ sub CreateTicket {
}
+
+sub AdjustFixedFields {
+ my ( $Self, %Param ) = @_;
+ my $schema = $Param{Schema};
+ my $form = $Param{Fields};
+ my $fixedValues = $Param{FixedValues};
+
+ my @values = split(/\n/, $fixedValues);
+
+ for my $value (@values) {
+
+ $value =~ s/\r//g;
+ my @data = split('=', $value);
+
+ my $fieldKey = $data[0];
+ my $fixedValue = $data[1];
+
+ my $key = '("' . $fieldKey . '"[\ ]?:[\ ]?{[^}]+})';
+ my $replace = '"' . $fieldKey . '"' . ': {"type": "string", "default": "' . $fixedValue . '"}';
+
+ $schema =~ s/$key/$replace/;
+
+ $key = '("' . $fieldKey . '"[\ ]?:[\ ]?{[^}]+})';
+ $replace = '"' . $fieldKey . '": {"type": "hidden"' . "\n}";
+ $form =~ s/$key/$replace/;
+ }
+
+ return ($schema, $form);
+
+}
+
+sub lineBreakToHTML {
+ my ( $Self, %Param ) = @_;
+
+ my $return = $Param{Text};
+ my $LINE_BREAK = " ";
+
+ $return =~ s/\n/$LINE_BREAK/g;
+
+ return $return;
+
+}
+
+sub breakWords {
+ my ( $Self, %Param ) = @_;
+
+ my $return = $Param{Text};
+
+ $return =~ s/(.)([A-Z][^A-Z])/$1 $2/g;
+ $return =~ s/([\w']+)/\u\L$1/g;
+
+ return $return;
+}
+
1;
diff --git a/Kernel/Modules/NewTicketWizardServiceForm.pm b/Kernel/Modules/NewTicketWizardServiceForm.pm
index 2abdb79..e48e762 100644
--- a/Kernel/Modules/NewTicketWizardServiceForm.pm
+++ b/Kernel/Modules/NewTicketWizardServiceForm.pm
@@ -53,12 +53,22 @@ sub Run {
my $Output = $LayoutObject->Header();
$Output .= $LayoutObject->NavigationBar();
- my %serviceForm = $ServiceFormObject->GetServiceForm( ServiceID => $ParamObject->GetParam( Param => "ServiceID" ) );
+ my %serviceForm;
+
+ # if form specific for queue
+ if ($ParamObject->GetParam( Param => "QueueID" )) {
+ %serviceForm = $ServiceFormObject->GetServiceFormForQueue( ServiceID => $ParamObject->GetParam( Param => "ServiceID" ),
+ QueueID => $ParamObject->GetParam( Param => "QueueID" ) );
+ } else {
+ %serviceForm = $ServiceFormObject->GetServiceForm( ServiceID => $ParamObject->GetParam( Param => "ServiceID" ) );
+ }
$Data{Introduction} = $serviceForm{Introduction};
$Data{Form} = $serviceForm{Form};
$Data{Schema} = $serviceForm{Schema};
+ $Data{FixedValues} = $serviceForm{FixedValues};
$Data{ServiceID} = $ParamObject->GetParam( Param => "ServiceID" );
+ $Data{QueueID} = $ParamObject->GetParam( Param => "QueueID" );
$Output .= $LayoutObject->Output(
Data => \%Data,
@@ -76,12 +86,25 @@ sub Run {
my $Output = $LayoutObject->Header();
$Output .= $LayoutObject->NavigationBar();
- $ServiceFormObject->SaveServiceForm(
- ServiceID => $ParamObject->GetParam( Param => "ServiceID" ),
- Introduction => $ParamObject->GetParam( Param => "Introduction" ),
- Form => $ParamObject->GetParam( Param => "Form" ),
- Schema => $ParamObject->GetParam( Param => "Schema" ),
- );
+ # If form is specific for a queue
+ if ($ParamObject->GetParam( Param => "QueueID" )) {
+ $ServiceFormObject->SaveServiceFormForQueue(
+ ServiceID => $ParamObject->GetParam( Param => "ServiceID" ),
+ QueueID => $ParamObject->GetParam( Param => "QueueID" ),
+ Introduction => $ParamObject->GetParam( Param => "Introduction" ),
+ Form => $ParamObject->GetParam( Param => "Form" ),
+ Schema => $ParamObject->GetParam( Param => "Schema" ),
+ FixedValues => $ParamObject->GetParam( Param => "FixedValues" ),
+ );
+ } else {
+ $ServiceFormObject->SaveServiceForm(
+ ServiceID => $ParamObject->GetParam( Param => "ServiceID" ),
+ Introduction => $ParamObject->GetParam( Param => "Introduction" ),
+ Form => $ParamObject->GetParam( Param => "Form" ),
+ Schema => $ParamObject->GetParam( Param => "Schema" ),
+ FixedValues => $ParamObject->GetParam( Param => "FixedValues" ),
+ );
+ }
return $Self->Overview();
}
diff --git a/Kernel/Output/HTML/Standard/NewTicketWizardServiceFormEdit.tt b/Kernel/Output/HTML/Standard/NewTicketWizardServiceFormEdit.tt
index 2329ef5..6377634 100644
--- a/Kernel/Output/HTML/Standard/NewTicketWizardServiceFormEdit.tt
+++ b/Kernel/Output/HTML/Standard/NewTicketWizardServiceFormEdit.tt
@@ -21,6 +21,7 @@
+
@@ -41,7 +42,13 @@
-
+
+ [% Translate("Fixed values") | html %]:
+
+
+
+
+
[% Translate("Submit") | html %]
[% Translate("or") | html %]
diff --git a/Kernel/System/RestrictedService.pm b/Kernel/System/RestrictedService.pm
new file mode 100644
index 0000000..5180556
--- /dev/null
+++ b/Kernel/System/RestrictedService.pm
@@ -0,0 +1,89 @@
+# --
+# Kernel/System/RestrictedService.pm - core module
+#
+# Copyright (C) SeTIC - UFSC - http://setic.ufsc.br/
+# Version 2015-06-24 - First version
+#
+# Manages which services should only be allowed in the logged in interface for OTRS
+#
+# --
+# This software comes with ABSOLUTELY NO WARRANTY. For details, see
+# the enclosed file COPYING for license information (AGPL). If you
+# did not receive this file, see http://www.gnu.org/licenses/agpl.txt.
+# --
+package Kernel::System::RestrictedService;
+
+use strict;
+use warnings;
+use utf8;
+
+our @ObjectDependencies = (
+"Kernel::System::DB",
+"Kernel::System::Log");
+
+
+sub new {
+ my ( $Type, %Param ) = @_;
+
+ # allocate new hash for object
+ my $Self = {%Param};
+ bless( $Self, $Type );
+
+ return $Self;
+}
+
+=head
+
+Returns a service form
+
+@IdsRestrictedServices
+
+=cut
+
+sub GetRestrictedServices {
+
+ my ( $Self, %Param ) = @_;
+
+ my $DBObject = $Kernel::OM->Get("Kernel::System::DB");
+
+ # get service form from db
+ $DBObject->Prepare(
+ SQL => 'SELECT service_id from restricted_service order by service_id asc'
+ );
+
+ # fetch the result
+ my @ServiceData;
+ while ( my @Row = $DBObject->FetchrowArray() ) {
+ push(@ServiceData,$Row[0]);
+ }
+
+ return @ServiceData;
+}
+
+=head
+
+@IdsList
+
+Sets the list of restricted services
+
+=cut
+sub SetRestrictedServices {
+
+ my ( $Self, @Param ) = @_;
+
+ my $DBObject = $Kernel::OM->Get("Kernel::System::DB");
+ my $idsString = join(",", @Param);
+
+ # delete old services
+ $DBObject->Do(SQL => 'DELETE FROM restricted_service where service_id NOT IN (' . $idsString . ')');
+
+ # add new services
+ while (my $id = @Param) {
+ $DBObject->Do(SQL => 'REPLACE INTO restricted_service (service_id) VALUES (' . $id . ')');
+ }
+
+ return 1;
+}
+
+
+1;
diff --git a/Kernel/System/ServiceForm.pm b/Kernel/System/ServiceForm.pm
index cf3c5b8..fb5cbb7 100644
--- a/Kernel/System/ServiceForm.pm
+++ b/Kernel/System/ServiceForm.pm
@@ -44,7 +44,7 @@ sub GetServiceForm {
# get service form from db
$DBObject->Prepare(
- SQL => 'SELECT service_id, introduction, form, form_schema FROM service_form WHERE service_id = ?',
+ SQL => 'SELECT service_id, introduction, form, form_schema, fixed_values FROM service_form WHERE service_id = ? and queue_id is null',
Bind => [ \$Param{ServiceID} ],
Limit => 1,
);
@@ -55,7 +55,40 @@ sub GetServiceForm {
$ServiceData{ServiceID} = $Row[0];
$ServiceData{Introduction} = $Row[1];
$ServiceData{Form} = $Row[2];
- $ServiceData{Schema} = $Row[3];
+ $ServiceData{Schema} = $Row[3];
+ $ServiceData{FixedValues} = $Row[4];
+ }
+
+ return %ServiceData;
+}
+
+=head
+
+Returns a service form for a give queue
+
+=cut
+
+sub GetServiceFormForQueue {
+
+ my ( $Self, %Param ) = @_;
+
+ my $DBObject = $Kernel::OM->Get("Kernel::System::DB");
+
+ # get service form from db
+ $DBObject->Prepare(
+ SQL => 'SELECT service_id, introduction, form, form_schema, fixed_values FROM service_form WHERE service_id = ? and queue_id = ? ',
+ Bind => [ \$Param{ServiceID}, \$Param{QueueID} ],
+ Limit => 1,
+ );
+
+ # fetch the result
+ my %ServiceData;
+ while ( my @Row = $DBObject->FetchrowArray() ) {
+ $ServiceData{ServiceID} = $Row[0];
+ $ServiceData{Introduction} = $Row[1];
+ $ServiceData{Form} = $Row[2];
+ $ServiceData{Schema} = $Row[3];
+ $ServiceData{FixedValues} = $Row[4];
}
return %ServiceData;
@@ -86,14 +119,55 @@ sub SaveServiceForm {
my $update = ($serviceForm{ServiceID});
if ($update) {
- $DBObject->Do(SQL => 'UPDATE service_form SET introduction=?,form=?,form_schema=? where service_id=?',
+ $DBObject->Do(SQL => 'UPDATE service_form SET introduction=?,form=?,form_schema=?,fixed_values=? where service_id=? and queue_id is null',
+ Bind => [
+ \$Param{Introduction}, \$Param{Form}, \$Param{Schema}, \$Param{FixedValues}, \$Param{ServiceID}
+ ]);
+ } else {
+ $DBObject->Do(SQL => 'INSERT INTO service_form(service_id,introduction,form,form_schema,fixed_values) VALUES (?,?,?,?,?)',
+ Bind => [
+ \$Param{ServiceID}, \$Param{Introduction}, \$Param{Form}, \$Param{Schema}, \$Param{FixedValues}
+ ]);
+ }
+
+ return 1;
+
+}
+
+
+=head
+
+Saves a service form for a give queue.
+
+=cut
+
+sub SaveServiceFormForQueue {
+
+ my ( $Self, %Param ) = @_;
+ my $DBObject = $Kernel::OM->Get("Kernel::System::DB");
+
+ for my $Argument (qw(ServiceID Introduction)) {
+ if ( !$Param{$Argument} ) {
+ $Kernel::OM->Get("Kernel::System::Log")->Log(
+ Priority => 'error',
+ Message => "Need $Argument!",
+ );
+ return;
+ }
+ }
+
+ my %serviceForm = $Self->GetServiceFormForQueue(ServiceID => $Param{ServiceID}, QueueID => $Param{QueueID});
+ my $update = ($serviceForm{ServiceID});
+
+ if ($update) {
+ $DBObject->Do(SQL => 'UPDATE service_form SET introduction=?,form=?,form_schema=?,fixed_values=? where service_id=? and queue_id=? ',
Bind => [
- \$Param{Introduction}, \$Param{Form}, \$Param{Schema}, \$Param{ServiceID}
+ \$Param{Introduction}, \$Param{Form}, \$Param{Schema}, \$Param{FixedValues}, \$Param{ServiceID}, \$Param{QueueID}
]);
} else {
- $DBObject->Do(SQL => 'INSERT INTO service_form(service_id,introduction,form,form_schema) VALUES (?,?,?,?)',
+ $DBObject->Do(SQL => 'INSERT INTO service_form(service_id,introduction,form,form_schema,queue_id,fixed_values) VALUES (?,?,?,?,?,?)',
Bind => [
- \$Param{ServiceID}, \$Param{Introduction}, \$Param{Form}, \$Param{Schema}
+ \$Param{ServiceID}, \$Param{Introduction}, \$Param{Form}, \$Param{Schema}, \$Param{QueueID}, \$Param{FixedValues}
]);
}
diff --git a/NewTicketWizard.sopm b/NewTicketWizard.sopm
index 5d6d42c..a37c9be 100755
--- a/NewTicketWizard.sopm
+++ b/NewTicketWizard.sopm
@@ -1,7 +1,7 @@
NewTicketWizard
- 1.5.3
+ 1.7.7
4.0.x
SeTIC
http://www.setic.ufsc.br
@@ -9,6 +9,11 @@
NewTicket Wizard Module
Support for OTRS 4.0.3, QueuesPanel Module Separation
AlpacaJS adjustment for OTRS 4.0.4
+ Support for specific form per queue
+ Support for fixed field values and IP in created ticket
+ Support to set any field value
+ Support for multi-value fields
+ Support for restricted services
New Ticket Wizard module installed successfully!
?
?
@@ -22,6 +27,7 @@
+
@@ -58,9 +64,26 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/scripts/test/SchemaTest.t b/scripts/test/SchemaTest.t
new file mode 100644
index 0000000..fabd021
--- /dev/null
+++ b/scripts/test/SchemaTest.t
@@ -0,0 +1,145 @@
+# --
+# Responsibility.t - Responsiblity tests
+# Copyright (C) 2014 OTRS AG, http://otrs.com/
+# --
+# This software comes with ABSOLUTELY NO WARRANTY. For details, see
+# the enclosed file COPYING for license information (AGPL). If you
+# did not receive this file, see http://www.gnu.org/licenses/agpl.txt.
+# --
+# Autor: Rodrigo Gonçalves
+# Data.: 04/08/2014 - versão inicial
+#
+
+#
+# alter table service_form add fixed_values text;
+#
+#
+
+use strict;
+use warnings;
+use vars (qw($Self));
+
+my $schema = '
+"service": {
+ "type": "string",
+ "required": "true"
+ },
+ "DF_unidade": {
+ "type": "string",
+ "enum": [
+ DF_unidade_values
+ ],
+ "required": "true"
+ },
+ "DF_local": {
+ "type": "string",
+ "required": "true"
+ },
+ "DF_telefone": {
+ "type": "string",
+ "required": "true"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ OTRS_type_values
+ ],
+ "required": "true"
+ }
+ CF_SCHEMA
+ ,
+ "subject": {
+ "type": "string",
+ "required": "true"
+ },
+ "description": {
+ "type": "string",
+ "required": "true"
+ },
+ "attachment": {
+ "type": "string",
+ "format": "uri"
+ },
+ "Action": {
+ "type": "string",
+ "default": "NewTicketWizard"
+ },
+ "Subaction": {
+ "type": "string",
+ "default": "CreateTicket"
+ }
+';
+
+my $key = '("DF_telefone"[^}]+})';
+my $replace = '"DF_telefone {' . "\n" . '"type": "string"' . "\n}";
+
+
+$schema =~ s/$key/$replace/;
+
+print STDOUT $schema . "\n\n\n\n";
+
+
+
+
+my $form = '
+"DF_unidade": {
+ "type": "select",
+ "label": "Unidade:",
+ "optionLabels": [
+ DF_unidade_labels
+ ]
+ },
+ "DF_local": {
+ "type": "text",
+ "label": "Local:"
+ },
+ "DF_telefone": {
+ "type": "text",
+ "label": "Telefone:",
+ "control_width": 100
+ },
+ "type": {
+ "type": "select",
+ "label": "Motivo:",
+ "optionLabels": [
+ OTRS_type_labels
+ ]
+ },
+ "service": {
+ "type": "hidden"
+ }
+ CF_FORM,
+ "subject": {
+ "type": "text",
+ "label": "Assunto:",
+ "size": 80
+ },
+ "description": {
+ "type": "textarea",
+ "label": "Descrição:",
+ "cols": 80
+ },
+ "attachment": {
+ "type": "file",
+ "label": "Anexo:",
+ "helper": "Anexe um arquivo se necessário."
+ },
+ "Action": {
+ "type": "hidden"
+ },
+ "Subaction": {
+ "type": "hidden"
+ }
+
+';
+
+$key = '("DF_telefone"[^}]+})';
+$replace = '"DF_telefone": {' . "\n" . '"type": "hidden"' . "\n}";
+
+
+$form =~ s/$key/$replace/;
+
+print STDOUT $form ;
+
+
+1;
\ No newline at end of file
diff --git a/sqls.sql b/sqls.sql
new file mode 100644
index 0000000..6e0f973
--- /dev/null
+++ b/sqls.sql
@@ -0,0 +1,5 @@
+alter table service_form drop foreign key FK_service_form_service_id_id;
+alter table service_form drop primary key;
+alter table service_form add id int auto_increment not null primary key;
+alter table service_form add fixed_values text;
+alter table service_form add queue_id int;
diff --git a/var/httpd/htdocs/js/NewTicketWizard.js b/var/httpd/htdocs/js/NewTicketWizard.js
index bf62eb0..ce46cfa 100644
--- a/var/httpd/htdocs/js/NewTicketWizard.js
+++ b/var/httpd/htdocs/js/NewTicketWizard.js
@@ -70,6 +70,7 @@ var postRenderCallback = function(form) {
if (form.isFormValid()) {
return true;
} else {
+ alert("Dados inválidos!");
return false;
}
e.stopPropagation();
diff --git a/var/httpd/htdocs/js/thirdparty/alpaca/.alpaca-full.min.js.swp b/var/httpd/htdocs/js/thirdparty/alpaca/.alpaca-full.min.js.swp
new file mode 100644
index 0000000..1ed6558
Binary files /dev/null and b/var/httpd/htdocs/js/thirdparty/alpaca/.alpaca-full.min.js.swp differ
diff --git a/var/httpd/htdocs/js/thirdparty/alpaca/alpaca-full.min.js b/var/httpd/htdocs/js/thirdparty/alpaca/alpaca-full.min.js
index 556650d..b0be7f1 100644
--- a/var/httpd/htdocs/js/thirdparty/alpaca/alpaca-full.min.js
+++ b/var/httpd/htdocs/js/thirdparty/alpaca/alpaca-full.min.js
@@ -728,6 +728,7 @@ if (typeof JSON !== 'object') {
path += path ? typeof i == 'number' ? '[' + i + ']' : typeof i == 'undefined' ? '' : '.' + i : i;
function addError(message) {
errors.push({property:path,message:message});
+ Alpaca.logDebug("Erro: " + message);
}
if ((typeof schema != 'object' || schema instanceof Array) && (path || typeof schema != 'function') && !(schema && schema.type)) {
@@ -2149,6 +2150,8 @@ var equiv = function () {
// Unless we want to load individual fields (other than the templates) using the provided
// loader, this should be good enough. The benefit is saving time on loader format checking.
+
+
var loadAllConnector = connector;
if (notTopLevel) {
@@ -2163,6 +2166,8 @@ var equiv = function () {
if (Alpaca.isUndefined(options.focus)) {
options.focus = false;
}
+
+
var _renderedCallback = function(control)
{
// auto-set the focus?
@@ -2195,6 +2200,9 @@ var equiv = function () {
}
};
+
+
+
loadAllConnector.loadAll({
"data": data,
"schema": schema,
@@ -2242,6 +2250,8 @@ var equiv = function () {
return null;
});
+
+
// hand back the field
return $(el);
};
@@ -4166,7 +4176,7 @@ var equiv = function () {
// by default, logging only shows warnings and above
// to debug, set Alpaca.logLevel = Alpaca.DEBUG
- Alpaca.logLevel = Alpaca.WARN;
+ Alpaca.logLevel = Alpaca.INFO;
Alpaca.logDebug = function(obj) {
Alpaca.log(Alpaca.DEBUG, obj);
@@ -7035,6 +7045,7 @@ var equiv = function () {
}
}
+
// hidden
if (this.options.hidden) {
this.getEl().hide();
@@ -7046,19 +7057,25 @@ var equiv = function () {
var defaultHideInitValidationError = (this.view.type == 'create');
this.hideInitValidationError = Alpaca.isValEmpty(this.options.hideInitValidationError) ? defaultHideInitValidationError : this.options.hideInitValidationError;
+ Alpaca.logDebug("PreRender");
+
// final call to update validation state
if (this.view.type != 'view') {
+ Alpaca.logDebug("PreRender2");
this.renderValidationState();
}
// set to false after first validation (even if in CREATE mode, we only force init validation error false on first render)
this.hideInitValidationError = false;
+ Alpaca.logDebug("PreHiden");
// for create view, hide all readonly fields
if (!this.view.displayReadonly) {
$('.alpaca-field-readonly', this.getEl()).hide();
}
+ ////console.log(this);
+ Alpaca.logDebug("PrePostRender");
// field level post render
if (this.options.postRender) {
this.options.postRender(this);
@@ -7311,7 +7328,6 @@ var equiv = function () {
this._validateCustomValidator();
}
};
-
_rvc.call(this, checkChildren, false);
},
@@ -7447,8 +7463,17 @@ var equiv = function () {
* @returns {Boolean} False if this field value is empty but required, true otherwise.
*/
_validateOptional: function() {
- if (this.schema.required && this.isEmpty()) {
- return false;
+ var id = this.id;
+ var obj = $("span[alpaca-field-id='" + id + "']").css('display');
+ //console.log("Display para" + "span[alpaca-field-id='" + this.id + "'] => " + obj);
+ if (this.schema.required) {
+ if ((obj == "none") || (obj == "undefined")) {
+ console.log("alpaca-field-id='" + id + "' => OK");
+ return true;
+ } else if (this.isEmpty()) {
+ console.log("alpaca-field-id='" + id + "' => NOT OK");
+ return false;
+ }
}
return true;
},
@@ -8367,6 +8392,14 @@ var equiv = function () {
_validateEnum: function() {
if (this.schema["enum"]) {
var val = this.data;
+
+ var id = this.id;
+ var obj = $("span[alpaca-field-id='" + id + "']").css('display');
+ if ((this.schema.required) && ((obj == "none") || (obj == "undefined"))) {
+ console.log("alpaca-field-id='" + id + "' => OK");
+ return true;
+ }
+
/*this.getValue();*/
if (!this.schema.required && Alpaca.isValEmpty(val)) {
return true;
@@ -9986,6 +10019,14 @@ var equiv = function () {
_validatePattern: function() {
if (this.schema.pattern) {
var val = this.getValue();
+
+ var id = this.id;
+ var obj = $("span[alpaca-field-id='" + id + "']").css('display');
+ if ((this.schema.required) && ((obj == "none") || (obj == "undefined"))) {
+ console.log("alpaca-field-id='" + id + "' => OK");
+ return true;
+ }
+
if (val === "" && this.options.allowOptionalEmpty && !this.schema.required) {
return true;
}
@@ -10007,6 +10048,15 @@ var equiv = function () {
*/
_validateMinLength: function() {
if (!Alpaca.isEmpty(this.schema.minLength)) {
+
+
+ var id = this.id;
+ var obj = $("span[alpaca-field-id='" + id + "']").css('display');
+ if ((this.schema.required) && ((obj == "none") || (obj == "undefined"))) {
+ console.log("alpaca-field-id='" + id + "' => OK");
+ return true;
+ }
+
var val = this.getValue();
if (val === "" && this.options.allowOptionalEmpty && !this.schema.required) {
return true;
@@ -10028,6 +10078,15 @@ var equiv = function () {
*/
_validateMaxLength: function() {
if (!Alpaca.isEmpty(this.schema.maxLength)) {
+
+ var id = this.id;
+ var obj = $("span[alpaca-field-id='" + id + "']").css('display');
+ if ((this.schema.required) && ((obj == "none") || (obj == "undefined"))) {
+ console.log("alpaca-field-id='" + id + "' => OK");
+ return true;
+ }
+
+
var val = this.getValue();
if (val === "" && this.options.allowOptionalEmpty && !this.schema.required) {
return true;
@@ -11291,6 +11350,7 @@ var equiv = function () {
var _this = this;
+
if (this.schema["type"] && this.schema["type"] == "array") {
this.options.multiple = true;
}
@@ -11320,7 +11380,6 @@ var equiv = function () {
//$("select",this.field).val("0");
}
-
this.injectField(this.field);
// do this little trick so that if we have a default value, it gets set during first render
@@ -11353,6 +11412,14 @@ var equiv = function () {
_validateEnum: function() {
if (this.schema["enum"]) {
var val = this.data;
+
+ var id = this.id;
+ var obj = $("span[alpaca-field-id='" + id + "']").css('display');
+ if ((this.schema.required) && ((obj == "none") || (obj == "undefined"))) {
+ console.log("alpaca-field-id='" + id + "' => OK");
+ return true;
+ }
+
if (!this.schema.required && Alpaca.isValEmpty(val)) {
return true;
}
@@ -13393,6 +13460,10 @@ var equiv = function () {
}
else if (Alpaca.isArray(def.dependencies))
{
+s
+v
+t
+w
$.each(def.dependencies, function(index, value) {
if (value == propertyId)
{
@@ -13506,7 +13577,9 @@ var equiv = function () {
else
{
// check object value
- if (!Alpaca.isEmpty(conditionalDependencies[dependentOnPropertyId]) && conditionalDependencies[dependentOnPropertyId] != dependentOnData)
+ if (!dependentOnData) {
+ valid = false;
+ } else if (!Alpaca.isEmpty(conditionalDependencies[dependentOnPropertyId]) && dependentOnData.indexOf(conditionalDependencies[dependentOnPropertyId]) == -1)
{
valid = false;
}
diff --git a/var/httpd/htdocs/js/thirdparty/alpaca/alpaca.min.js b/var/httpd/htdocs/js/thirdparty/alpaca/alpaca.min.js
new file mode 100644
index 0000000..5d5c87a
--- /dev/null
+++ b/var/httpd/htdocs/js/thirdparty/alpaca/alpaca.min.js
@@ -0,0 +1,9 @@
+!function(e,t){var i=!0;e&&"undefined"!=typeof e.umd&&(i=e.umd),i&&"object"==typeof exports?module.exports=t(require("jquery"),require("handlebars"),require("jquery-ui")):i&&"function"==typeof define&&define.amd?define("alpaca",["jquery","handlebars","jquery-ui"],t):e.Alpaca=t(e.jQuery,e.Handlebars,e.jQueryUI)}(this,function($,Handlebars,jQueryUI){return this.HandlebarsPrecompiled=this.HandlebarsPrecompiled||{},this.HandlebarsPrecompiled["web-display"]=this.HandlebarsPrecompiled["web-display"]||{},this.HandlebarsPrecompiled["web-display"]["container-array"]=function(e,t,i,a,n){function r(e,t){var a,n,r,o="";return o+="\n\n ",r={hash:{},inverse:c.noop,fn:c.program(2,s,t),data:t},(n=i.item)?a=n.call(e,r):(n=e&&e.item,a=typeof n===d?n.call(e,r):n),i.item||(a=p.call(e,a,{hash:{},inverse:c.noop,fn:c.program(2,s,t),data:t})),(a||0===a)&&(o+=a),o+="\n\n "}function s(){var e="";return e}this.compilerInfo=[4,">= 1.0.0"],i=this.merge(i,e.helpers),n=n||{};var o,l="",c=this,d="function",p=i.blockHelperMissing;return l+='"},this.HandlebarsPrecompiled=this.HandlebarsPrecompiled||{},this.HandlebarsPrecompiled["web-display"]=this.HandlebarsPrecompiled["web-display"]||{},this.HandlebarsPrecompiled["web-display"]["container-object"]=function(e,t,i,a,n){function r(e,t){var a,n,r,o="";return o+="\n\n ",r={hash:{},inverse:c.noop,fn:c.program(2,s,t),data:t},(n=i.item)?a=n.call(e,r):(n=e&&e.item,a=typeof n===d?n.call(e,r):n),i.item||(a=p.call(e,a,{hash:{},inverse:c.noop,fn:c.program(2,s,t),data:t})),(a||0===a)&&(o+=a),o+="\n\n "}function s(){var e="";return e}this.compilerInfo=[4,">= 1.0.0"],i=this.merge(i,e.helpers),n=n||{};var o,l="",c=this,d="function",p=i.blockHelperMissing;return l+='"},this.HandlebarsPrecompiled=this.HandlebarsPrecompiled||{},this.HandlebarsPrecompiled["web-display"]=this.HandlebarsPrecompiled["web-display"]||{},this.HandlebarsPrecompiled["web-display"].container=function(e,t,i,a,n){function r(e,t){var a,n="";return n+='\n
',a=e&&e.options,a=null==a||a===!1?a:a.label,a=typeof a===f?a.apply(e):a,(a||0===a)&&(n+=a),n+=" \n "}function s(e){var t;return m((t=e&&e.options,t=null==t||t===!1?t:t.labelClass,typeof t===f?t.apply(e):t))}function o(e,t){var a,n="";return n+='\n
\n \n ',a=e&&e.options,a=null==a||a===!1?a:a.helper,a=typeof a===f?a.apply(e):a,(a||0===a)&&(n+=a),n+="\n
\n "}function l(e){var t;return m((t=e&&e.options,t=null==t||t===!1?t:t.helperClass,typeof t===f?t.apply(e):t))}function c(){var e="";return e}this.compilerInfo=[4,">= 1.0.0"],i=this.merge(i,e.helpers),n=n||{};var d,p,u,h="",f="function",m=this.escapeExpression,g=this,v=i.blockHelperMissing;return h+='"},this.HandlebarsPrecompiled=this.HandlebarsPrecompiled||{},this.HandlebarsPrecompiled["web-display"]=this.HandlebarsPrecompiled["web-display"]||{},this.HandlebarsPrecompiled["web-display"]["control-any"]=function(e,t,i,a,n){this.compilerInfo=[4,">= 1.0.0"],i=this.merge(i,e.helpers),n=n||{};var r,s,o,l="",c=i.helperMissing;return l+='"},this.HandlebarsPrecompiled=this.HandlebarsPrecompiled||{},this.HandlebarsPrecompiled["web-display"]=this.HandlebarsPrecompiled["web-display"]||{},this.HandlebarsPrecompiled["web-display"]["control-checkbox"]=function(e,t,i,a,n){this.compilerInfo=[4,">= 1.0.0"],i=this.merge(i,e.helpers),n=n||{};var r,s,o,l="",c=i.helperMissing;return l+='"},this.HandlebarsPrecompiled=this.HandlebarsPrecompiled||{},this.HandlebarsPrecompiled["web-display"]=this.HandlebarsPrecompiled["web-display"]||{},this.HandlebarsPrecompiled["web-display"]["control-image"]=function(e,t,i,a,n){this.compilerInfo=[4,">= 1.0.0"],i=this.merge(i,e.helpers),n=n||{};var r,s,o="",l="function",c=this.escapeExpression;return o+=''},this.HandlebarsPrecompiled=this.HandlebarsPrecompiled||{},this.HandlebarsPrecompiled["web-display"]=this.HandlebarsPrecompiled["web-display"]||{},this.HandlebarsPrecompiled["web-display"]["control-radio"]=function(e,t,i,a,n){function r(e,t,a){var n,r,o,l="";return l+="\n ",r=i.compare||e&&e.compare,o={hash:{},inverse:d.noop,fn:d.program(2,s,t),data:t},n=r?r.call(e,e&&e.value,a&&a.data,o):p.call(e,"compare",e&&e.value,a&&a.data,o),(n||0===n)&&(l+=n),l+="\n "}function s(e,t){var a,n,r="";return r+="\n ",(n=i.text)?a=n.call(e,{hash:{},data:t}):(n=e&&e.text,a=typeof n===c?n.call(e,{hash:{},data:t}):n),(a||0===a)&&(r+=a),r+="\n "}this.compilerInfo=[4,">= 1.0.0"],i=this.merge(i,e.helpers),n=n||{};var o,l="",c="function",d=this,p=i.helperMissing;return l+='\n"},this.HandlebarsPrecompiled=this.HandlebarsPrecompiled||{},this.HandlebarsPrecompiled["web-display"]=this.HandlebarsPrecompiled["web-display"]||{},this.HandlebarsPrecompiled["web-display"]["control-select"]=function(e,t,i,a,n){function r(e,t,a){var n,r,o,l="";return l+="\n ",r=i.compare||e&&e.compare,o={hash:{},inverse:d.noop,fn:d.program(2,s,t),data:t},n=r?r.call(e,e&&e.value,a&&a.data,o):p.call(e,"compare",e&&e.value,a&&a.data,o),(n||0===n)&&(l+=n),l+="\n "}function s(e,t){var a,n,r="";return r+="\n ",(n=i.text)?a=n.call(e,{hash:{},data:t}):(n=e&&e.text,a=typeof n===c?n.call(e,{hash:{},data:t}):n),(a||0===a)&&(r+=a),r+="\n "}this.compilerInfo=[4,">= 1.0.0"],i=this.merge(i,e.helpers),n=n||{};var o,l="",c="function",d=this,p=i.helperMissing;return l+='\n"},this.HandlebarsPrecompiled=this.HandlebarsPrecompiled||{},this.HandlebarsPrecompiled["web-display"]=this.HandlebarsPrecompiled["web-display"]||{},this.HandlebarsPrecompiled["web-display"]["control-text"]=function(e,t,i,a,n){this.compilerInfo=[4,">= 1.0.0"],i=this.merge(i,e.helpers),n=n||{};var r,s,o="",l="function";return o+='"},this.HandlebarsPrecompiled=this.HandlebarsPrecompiled||{},this.HandlebarsPrecompiled["web-display"]=this.HandlebarsPrecompiled["web-display"]||{},this.HandlebarsPrecompiled["web-display"]["control-textarea"]=function(e,t,i,a,n){this.compilerInfo=[4,">= 1.0.0"],i=this.merge(i,e.helpers),n=n||{};var r,s,o="",l="function";return o+='"},this.HandlebarsPrecompiled=this.HandlebarsPrecompiled||{},this.HandlebarsPrecompiled["web-display"]=this.HandlebarsPrecompiled["web-display"]||{},this.HandlebarsPrecompiled["web-display"]["control-url"]=function(e,t,i,a,n){function r(e){var t,i="";return i+='target="'+f((t=e&&e.options,t=null==t||t===!1?t:t.anchorTarget,typeof t===h?t.apply(e):t))+'"'}function s(e){var t;return f((t=e&&e.options,t=null==t||t===!1?t:t.anchorTitle,typeof t===h?t.apply(e):t))}function o(e,t){var a,n;return(n=i.data)?a=n.call(e,{hash:{},data:t}):(n=e&&e.data,a=typeof n===h?n.call(e,{hash:{},data:t}):n),f(a)}function l(e){var t,i="";return i+="\n "+f((t=e&&e.options,t=null==t||t===!1?t:t.anchorTitle,typeof t===h?t.apply(e):t))+"\n "}function c(e,t){var a,n,r="";return r+="\n ",(n=i.data)?a=n.call(e,{hash:{},data:t}):(n=e&&e.data,a=typeof n===h?n.call(e,{hash:{},data:t}):n),r+=f(a)+"\n "}this.compilerInfo=[4,">= 1.0.0"],i=this.merge(i,e.helpers),n=n||{};var d,p,u="",h="function",f=this.escapeExpression,m=this;return u+='"},this.HandlebarsPrecompiled=this.HandlebarsPrecompiled||{},this.HandlebarsPrecompiled["web-display"]=this.HandlebarsPrecompiled["web-display"]||{},this.HandlebarsPrecompiled["web-display"].control=function(e,t,i,a,n){function r(e,t){var a,n,r="";return r+='\n
',a=e&&e.options,a=null==a||a===!1?a:a.label,a=typeof a===f?a.apply(e):a,(a||0===a)&&(r+=a),r+=" \n "}function s(e){var t;return m((t=e&&e.options,t=null==t||t===!1?t:t.labelClass,typeof t===f?t.apply(e):t))}function o(){var e="";return e}function l(e,t){var a,n="";return n+='\n
\n \n ',a=e&&e.options,a=null==a||a===!1?a:a.helper,a=typeof a===f?a.apply(e):a,(a||0===a)&&(n+=a),n+="\n
\n "}function c(e){var t;return m((t=e&&e.options,t=null==t||t===!1?t:t.helperClass,typeof t===f?t.apply(e):t))}this.compilerInfo=[4,">= 1.0.0"],i=this.merge(i,e.helpers),n=n||{};var d,p,u,h="",f="function",m=this.escapeExpression,g=this,v=i.blockHelperMissing;return h+='\n"},this.HandlebarsPrecompiled=this.HandlebarsPrecompiled||{},this.HandlebarsPrecompiled["web-display"]=this.HandlebarsPrecompiled["web-display"]||{},this.HandlebarsPrecompiled["web-display"].form=function(e,t,i,a,n){function r(){var e="";return e}function s(e,t){var a,n="";return n+="\n ",a=i.each.call(e,(a=e&&e.options,null==a||a===!1?a:a.buttons),{hash:{},inverse:v.noop,fn:v.program(4,o,t),data:t}),(a||0===a)&&(n+=a),n+="\n "}function o(e,t){var a,n,r,s="";return s+='\n
",(n=i.value)?a=n.call(e,{hash:{},data:t}):(n=e&&e.value,a=typeof n===m?n.call(e,{hash:{},data:t}):n),(a||0===a)&&(s+=a),s+=" \n "}function l(){return'type="submit"'}function c(){return'type="reset"'}function d(e,t){var a,n,r="";return r+=g((a=null==t||t===!1?t:t.key,typeof a===m?a.apply(e):a))+'="',(n=i.value)?a=n.call(e,{hash:{},data:t}):(n=e&&e.value,a=typeof n===m?n.call(e,{hash:{},data:t}):n),r+=g(a)+'"'}this.compilerInfo=[4,">= 1.0.0"],i=this.merge(i,e.helpers),n=n||{};var p,u,h,f="",m="function",g=this.escapeExpression,v=this,y=i.helperMissing,b=i.blockHelperMissing;return f+='"},this.HandlebarsPrecompiled=this.HandlebarsPrecompiled||{},this.HandlebarsPrecompiled["web-edit"]=this.HandlebarsPrecompiled["web-edit"]||{},this.HandlebarsPrecompiled["web-edit"]["container-array-actionbar"]=function(e,t,i,a,n){function r(e,t){var a,n,r="";return r+='\n
\n ',a=i["if"].call(e,e&&e.iconClass,{hash:{},inverse:h.noop,fn:h.program(2,s,t),data:t}),(a||0===a)&&(r+=a),r+="\n ",a=i["if"].call(e,e&&e.label,{hash:{},inverse:h.noop,fn:h.program(4,o,t),data:t}),(a||0===a)&&(r+=a),r+="\n \n "}function s(e){var t,i="";return i+='\n
\n '}function o(e,t){var a,n;return(n=i.label)?a=n.call(e,{hash:{},data:t}):(n=e&&e.label,a=typeof n===p?n.call(e,{hash:{},data:t}):n),a||0===a?a:""}this.compilerInfo=[4,">= 1.0.0"],i=this.merge(i,e.helpers),n=n||{};var l,c,d="",p="function",u=this.escapeExpression,h=this;return d+='"},this.HandlebarsPrecompiled=this.HandlebarsPrecompiled||{},this.HandlebarsPrecompiled["web-edit"]=this.HandlebarsPrecompiled["web-edit"]||{},this.HandlebarsPrecompiled["web-edit"]["container-array-toolbar"]=function(e,t,i,a,n){function r(){return" btn-group"}function s(e,t,a){var n,r,s,c="";return c+="\n\n ",r=i.compare||a&&a.compare,s={hash:{},inverse:v.noop,fn:v.program(4,o,t),data:t},n=r?r.call(e,a&&a.toolbarStyle,"link",s):y.call(e,"compare",a&&a.toolbarStyle,"link",s),(n||0===n)&&(c+=n),c+="\n\n ",r=i.compare||a&&a.compare,s={hash:{},inverse:v.noop,fn:v.program(6,l,t),data:t},n=r?r.call(e,a&&a.toolbarStyle,"button",s):y.call(e,"compare",a&&a.toolbarStyle,"button",s),(n||0===n)&&(c+=n),c+="\n\n "}function o(e){var t,i="";return i+='\n
',t=e&&e.label,t=typeof t===m?t.apply(e):t,(t||0===t)&&(i+=t),i+=" \n "}function l(e,t){var a,n="";return n+='\n
\n ',a=i["if"].call(e,e&&e.iconClass,{hash:{},inverse:v.noop,fn:v.program(7,c,t),data:t}),(a||0===a)&&(n+=a),n+="\n ",a=i["if"].call(e,e&&e.label,{hash:{},inverse:v.noop,fn:v.program(9,d,t),data:t}),(a||0===a)&&(n+=a),n+="\n \n "}function c(e){var t,i="";return i+='\n
\n '}function d(e,t){var a,n;return(n=i.label)?a=n.call(e,{hash:{},data:t}):(n=e&&e.label,a=typeof n===m?n.call(e,{hash:{},data:t}):n),a||0===a?a:""}this.compilerInfo=[4,">= 1.0.0"],i=this.merge(i,e.helpers),n=n||{};var p,u,h,f="",m="function",g=this.escapeExpression,v=this,y=i.helperMissing;return f+='"},this.HandlebarsPrecompiled=this.HandlebarsPrecompiled||{},this.HandlebarsPrecompiled["web-edit"]=this.HandlebarsPrecompiled["web-edit"]||{},this.HandlebarsPrecompiled["web-edit"]["container-array"]=function(e,t,i,a,n){function r(e,t){var a,n,r,o="";return o+="\n\n ",r={hash:{},inverse:c.noop,fn:c.program(2,s,t),data:t},(n=i.item)?a=n.call(e,r):(n=e&&e.item,a=typeof n===d?n.call(e,r):n),i.item||(a=p.call(e,a,{hash:{},inverse:c.noop,fn:c.program(2,s,t),data:t})),(a||0===a)&&(o+=a),o+="\n\n "}function s(){var e="";return e}this.compilerInfo=[4,">= 1.0.0"],i=this.merge(i,e.helpers),n=n||{};var o,l="",c=this,d="function",p=i.blockHelperMissing;return l+='"},this.HandlebarsPrecompiled=this.HandlebarsPrecompiled||{},this.HandlebarsPrecompiled["web-edit"]=this.HandlebarsPrecompiled["web-edit"]||{},this.HandlebarsPrecompiled["web-edit"]["container-object"]=function(e,t,i,a,n){function r(e,t){var a,n,r,o="";return o+="\n\n ",r={hash:{},inverse:c.noop,fn:c.program(2,s,t),data:t},(n=i.item)?a=n.call(e,r):(n=e&&e.item,a=typeof n===d?n.call(e,r):n),i.item||(a=p.call(e,a,{hash:{},inverse:c.noop,fn:c.program(2,s,t),data:t})),(a||0===a)&&(o+=a),o+="\n\n "}function s(){var e="";return e}this.compilerInfo=[4,">= 1.0.0"],i=this.merge(i,e.helpers),n=n||{};var o,l="",c=this,d="function",p=i.blockHelperMissing;return l+='"},this.HandlebarsPrecompiled=this.HandlebarsPrecompiled||{},this.HandlebarsPrecompiled["web-edit"]=this.HandlebarsPrecompiled["web-edit"]||{},this.HandlebarsPrecompiled["web-edit"]["container-table"]=function(e,t,i,a,n){function r(){return" btn-group"}function s(e,t,a){var n,r,s,c="";return c+="\n\n ",r=i.compare||a&&a.compare,s={hash:{},inverse:x.noop,fn:x.program(4,o,t),data:t},n=r?r.call(e,(n=a&&a.options,null==n||n===!1?n:n.toolbarStyle),"link",s):S.call(e,"compare",(n=a&&a.options,null==n||n===!1?n:n.toolbarStyle),"link",s),(n||0===n)&&(c+=n),c+="\n\n ",r=i.compare||a&&a.compare,s={hash:{},inverse:x.noop,fn:x.program(6,l,t),data:t},n=r?r.call(e,(n=a&&a.options,null==n||n===!1?n:n.toolbarStyle),"button",s):S.call(e,"compare",(n=a&&a.options,null==n||n===!1?n:n.toolbarStyle),"button",s),(n||0===n)&&(c+=n),c+="\n\n "}function o(e){var t,i="";return i+='\n
',t=e&&e.label,t=typeof t===w?t.apply(e):t,(t||0===t)&&(i+=t),i+=" \n "}function l(e,t){var a,n="";return n+='\n
\n ',a=i["if"].call(e,e&&e.iconClass,{hash:{},inverse:x.noop,fn:x.program(7,c,t),data:t}),(a||0===a)&&(n+=a),n+="\n ",a=i["if"].call(e,e&&e.label,{hash:{},inverse:x.noop,fn:x.program(9,d,t),data:t}),(a||0===a)&&(n+=a),n+="\n \n "}function c(e){var t,i="";return i+='\n
\n '}function d(e,t){var a,n;return(n=i.label)?a=n.call(e,{hash:{},data:t}):(n=e&&e.label,a=typeof n===w?n.call(e,{hash:{},data:t}):n),a||0===a?a:""}function p(e,t){var a,n,r="";return r+="\n
",(n=i.label)?a=n.call(e,{hash:{},data:t}):(n=e&&e.label,a=typeof n===w?n.call(e,{hash:{},data:t}):n),(a||0===a)&&(r+=a),r+=" \n "}function u(e,t,a){var n,r="";return r+="\n
\n ",n=i.each.call(e,e&&e.data,{hash:{},inverse:x.noop,fn:x.program(14,h,t),data:t}),(n||0===n)&&(r+=n),r+='\n\n \n \n \n ',n=i.each.call(e,a&&a.arrayItemActions,{hash:{},inverse:x.noop,fn:x.program(16,f,t),data:t}),(n||0===n)&&(r+=n),r+="\n
\n \n \n "}function h(e){var t,i="";return i+="\n
",t=typeof e===w?e.apply(e):e,(t||0===t)&&(i+=t),i+=" \n "}function f(e,t){var a,n,r="";return r+='\n
\n ',a=i["if"].call(e,e&&e.iconClass,{hash:{},inverse:x.noop,fn:x.program(17,m,t),data:t}),(a||0===a)&&(r+=a),r+="\n ",a=i["if"].call(e,e&&e.label,{hash:{},inverse:x.noop,fn:x.program(9,d,t),data:t}),(a||0===a)&&(r+=a),r+="\n \n "}function m(e){var t,i="";return i+='\n
\n '}this.compilerInfo=[4,">= 1.0.0"],i=this.merge(i,e.helpers),n=n||{};var g,v,y,b="",w="function",F=this.escapeExpression,x=this,S=i.helperMissing;return b+='"},this.HandlebarsPrecompiled=this.HandlebarsPrecompiled||{},this.HandlebarsPrecompiled["web-edit"]=this.HandlebarsPrecompiled["web-edit"]||{},this.HandlebarsPrecompiled["web-edit"].container=function(e,t,i,a,n){function r(e,t){var a,n="";return n+='\n
',a=e&&e.options,a=null==a||a===!1?a:a.label,a=typeof a===f?a.apply(e):a,(a||0===a)&&(n+=a),n+=" \n "}function s(e){var t;return m((t=e&&e.options,t=null==t||t===!1?t:t.labelClass,typeof t===f?t.apply(e):t))}function o(e,t){var a,n="";return n+='\n
\n \n ',a=e&&e.options,a=null==a||a===!1?a:a.helper,a=typeof a===f?a.apply(e):a,(a||0===a)&&(n+=a),n+="\n
\n "}function l(e){var t;return m((t=e&&e.options,t=null==t||t===!1?t:t.helperClass,typeof t===f?t.apply(e):t))}function c(){var e="";return e}this.compilerInfo=[4,">= 1.0.0"],i=this.merge(i,e.helpers),n=n||{};var d,p,u,h="",f="function",m=this.escapeExpression,g=this,v=i.blockHelperMissing;return h+='"},this.HandlebarsPrecompiled=this.HandlebarsPrecompiled||{},this.HandlebarsPrecompiled["web-edit"]=this.HandlebarsPrecompiled["web-edit"]||{},this.HandlebarsPrecompiled["web-edit"]["control-any"]=function(e,t,i,a,n){function r(){return'readonly="readonly"'}function s(e,t){var a,n,r="";return r+='name="',(n=i.name)?a=n.call(e,{hash:{},data:t}):(n=e&&e.name,a=typeof n===p?n.call(e,{hash:{},data:t}):n),r+=u(a)+'"'}function o(e,t){var i,a="";return a+="data-"+u((i=null==t||t===!1?t:t.key,typeof i===p?i.apply(e):i))+'="'+u(typeof e===p?e.apply(e):e)+'"'}this.compilerInfo=[4,">= 1.0.0"],i=this.merge(i,e.helpers),n=n||{};var l,c,d="",p="function",u=this.escapeExpression,h=this;return d+='"},this.HandlebarsPrecompiled=this.HandlebarsPrecompiled||{},this.HandlebarsPrecompiled["web-edit"]=this.HandlebarsPrecompiled["web-edit"]||{},this.HandlebarsPrecompiled["web-edit"]["control-checkbox"]=function(e,t,i,a,n){function r(e,t,a){var n,r="";return r+="\n\n ",n=i.each.call(e,e&&e.checkboxOptions,{hash:{},inverse:m.noop,fn:m.programWithDepth(2,s,t,a),data:t}),(n||0===n)&&(r+=n),r+="\n\n "}function s(e,t,a){var n,r,s="";return s+='\n\n
\n\n \n\n \n ",(r=i.text)?n=r.call(e,{hash:{},data:t}):(r=e&&e.text,n=typeof r===h?r.call(e,{hash:{},data:t}):r),(n||0===n)&&(s+=n),s+="\n\n \n
\n\n "}function o(){return'readonly="readonly"'}function l(e,t){var a,n,r="";return r+='name="',(n=i.name)?a=n.call(e,{hash:{},data:t}):(n=e&&e.name,a=typeof n===h?n.call(e,{hash:{},data:t}):n),r+=f(a)+'"'}function c(e,t){var a,n,r="";return r+="data-"+f((a=null==t||t===!1?t:t.key,typeof a===h?a.apply(e):a))+'="',(n=i.value)?a=n.call(e,{hash:{},data:t}):(n=e&&e.value,a=typeof n===h?n.call(e,{hash:{},data:t}):n),r+=f(a)+'"'}function d(e,t){var a,n="";return n+='\n\n
\n\n \n\n \n\n ",a=e&&e.options,a=null==a||a===!1?a:a.rightLabel,a=typeof a===h?a.apply(e):a,(a||0===a)&&(n+=a),n+="\n \n\n
\n\n "}this.compilerInfo=[4,">= 1.0.0"],i=this.merge(i,e.helpers),n=n||{};var p,u="",h="function",f=this.escapeExpression,m=this;
+return u+='\n"},this.HandlebarsPrecompiled=this.HandlebarsPrecompiled||{},this.HandlebarsPrecompiled["web-edit"]=this.HandlebarsPrecompiled["web-edit"]||{},this.HandlebarsPrecompiled["web-edit"]["control-ckeditor"]=function(e,t,i,a,n){this.compilerInfo=[4,">= 1.0.0"],i=this.merge(i,e.helpers),n=n||{};var r,s,o="",l="function",c=this.escapeExpression;return o+=''},this.HandlebarsPrecompiled=this.HandlebarsPrecompiled||{},this.HandlebarsPrecompiled["web-edit"]=this.HandlebarsPrecompiled["web-edit"]||{},this.HandlebarsPrecompiled["web-edit"]["control-editor"]=function(e,t,i,a,n){this.compilerInfo=[4,">= 1.0.0"],i=this.merge(i,e.helpers),n=n||{};var r,s,o="",l="function",c=this.escapeExpression;return o+=''},this.HandlebarsPrecompiled=this.HandlebarsPrecompiled||{},this.HandlebarsPrecompiled["web-edit"]=this.HandlebarsPrecompiled["web-edit"]||{},this.HandlebarsPrecompiled["web-edit"]["control-file"]=function(e,t,i,a,n){function r(e){var t,i="";return i+='size="'+h((t=e&&e.options,t=null==t||t===!1?t:t.size,typeof t===u?t.apply(e):t))+'"'}function s(){return'readonly="readonly"'}function o(e,t){var a,n,r="";return r+='name="',(n=i.name)?a=n.call(e,{hash:{},data:t}):(n=e&&e.name,a=typeof n===u?n.call(e,{hash:{},data:t}):n),r+=h(a)+'"'}function l(e,t){var i,a="";return a+="data-"+h((i=null==t||t===!1?t:t.key,typeof i===u?i.apply(e):i))+'="'+h(typeof e===u?e.apply(e):e)+'"'}this.compilerInfo=[4,">= 1.0.0"],i=this.merge(i,e.helpers),n=n||{};var c,d,p="",u="function",h=this.escapeExpression,f=this;return p+='"},this.HandlebarsPrecompiled=this.HandlebarsPrecompiled||{},this.HandlebarsPrecompiled["web-edit"]=this.HandlebarsPrecompiled["web-edit"]||{},this.HandlebarsPrecompiled["web-edit"]["control-hidden"]=function(e,t,i,a,n){function r(e,t){var a,n,r="";return r+='name="',(n=i.name)?a=n.call(e,{hash:{},data:t}):(n=e&&e.name,a=typeof n===d?n.call(e,{hash:{},data:t}):n),r+=p(a)+'"'}function s(e,t){var i,a="";return a+="data-"+p((i=null==t||t===!1?t:t.key,typeof i===d?i.apply(e):i))+'="'+p(typeof e===d?e.apply(e):e)+'"'}this.compilerInfo=[4,">= 1.0.0"],i=this.merge(i,e.helpers),n=n||{};var o,l,c="",d="function",p=this.escapeExpression,u=this;return c+='"},this.HandlebarsPrecompiled=this.HandlebarsPrecompiled||{},this.HandlebarsPrecompiled["web-edit"]=this.HandlebarsPrecompiled["web-edit"]||{},this.HandlebarsPrecompiled["web-edit"]["control-image"]=function(e,t,i,a,n){function r(e){var t,i="";return i+='placeholder="'+f((t=e&&e.options,t=null==t||t===!1?t:t.placeholder,typeof t===h?t.apply(e):t))+'"'}function s(e){var t,i="";return i+='size="'+f((t=e&&e.options,t=null==t||t===!1?t:t.size,typeof t===h?t.apply(e):t))+'"'}function o(){return'readonly="readonly"'}function l(e,t){var a,n,r="";return r+='name="',(n=i.name)?a=n.call(e,{hash:{},data:t}):(n=e&&e.name,a=typeof n===h?n.call(e,{hash:{},data:t}):n),r+=f(a)+'"'}function c(e,t){var i,a="";return a+="data-"+f((i=null==t||t===!1?t:t.key,typeof i===h?i.apply(e):i))+'="'+f(typeof e===h?e.apply(e):e)+'"'}this.compilerInfo=[4,">= 1.0.0"],i=this.merge(i,e.helpers),n=n||{};var d,p,u="",h="function",f=this.escapeExpression,m=this;return u+=''},this.HandlebarsPrecompiled=this.HandlebarsPrecompiled||{},this.HandlebarsPrecompiled["web-edit"]=this.HandlebarsPrecompiled["web-edit"]||{},this.HandlebarsPrecompiled["web-edit"]["control-password"]=function(e,t,i,a,n){function r(e){var t,i="";return i+='placeholder="'+f((t=e&&e.options,t=null==t||t===!1?t:t.placeholder,typeof t===h?t.apply(e):t))+'"'}function s(e){var t,i="";return i+='size="'+f((t=e&&e.options,t=null==t||t===!1?t:t.size,typeof t===h?t.apply(e):t))+'"'}function o(){return'readonly="readonly"'}function l(e,t){var a,n,r="";return r+='name="',(n=i.name)?a=n.call(e,{hash:{},data:t}):(n=e&&e.name,a=typeof n===h?n.call(e,{hash:{},data:t}):n),r+=f(a)+'"'}function c(e,t){var i,a="";return a+="data-"+f((i=null==t||t===!1?t:t.key,typeof i===h?i.apply(e):i))+'="'+f(typeof e===h?e.apply(e):e)+'"'}this.compilerInfo=[4,">= 1.0.0"],i=this.merge(i,e.helpers),n=n||{};var d,p,u="",h="function",f=this.escapeExpression,m=this;return u+='"},this.HandlebarsPrecompiled=this.HandlebarsPrecompiled||{},this.HandlebarsPrecompiled["web-edit"]=this.HandlebarsPrecompiled["web-edit"]||{},this.HandlebarsPrecompiled["web-edit"]["control-radio"]=function(e,t,i,a,n,r){function s(){return"\n "}function o(e,t){var a,n,r="";return r+='\n
\n \n ',(n=i.noneLabel)?a=n.call(e,{hash:{},data:t}):(n=e&&e.noneLabel,a=typeof n===f?n.call(e,{hash:{},data:t}):n),(a||0===a)&&(r+=a),r+="\n \n
\n "}function l(){return'readonly="readonly"'}function c(e,t,a){var n,r,s,o="";return o+='\n
\n \n ",(r=i.text)?n=r.call(e,{hash:{},data:t}):(r=e&&e.text,n=typeof r===f?r.call(e,{hash:{},data:t}):r),(n||0===n)&&(o+=n),o+="\n \n
\n "}function d(){return'checked="checked"'}this.compilerInfo=[4,">= 1.0.0"],i=this.merge(i,e.helpers),n=n||{};var p,u="",h=this,f="function",m=this.escapeExpression,g=i.helperMissing;return u+='"},this.HandlebarsPrecompiled=this.HandlebarsPrecompiled||{},this.HandlebarsPrecompiled["web-edit"]=this.HandlebarsPrecompiled["web-edit"]||{},this.HandlebarsPrecompiled["web-edit"]["control-select"]=function(e,t,i,a,n){function r(){return'readonly="readonly"'}function s(){return'multiple="multiple"'}function o(e){var t,i="";return i+='size="'+F((t=e&&e.options,t=null==t||t===!1?t:t.size,typeof t===w?t.apply(e):t))+'"'}function l(e,t){var a,n,r="";return r+='name="',(n=i.name)?a=n.call(e,{hash:{},data:t}):(n=e&&e.name,a=typeof n===w?n.call(e,{hash:{},data:t}):n),r+=F(a)+'"'}function c(e,t){var a,n="";return n+="\n\n ",a=i["if"].call(e,e&&e.hideNone,{hash:{},inverse:x.program(12,p,t),fn:x.program(10,d,t),data:t}),(a||0===a)&&(n+=a),n+="\n\n ",a=i.each.call(e,e&&e.selectOptions,{hash:{},inverse:x.noop,fn:x.programWithDepth(14,u,t,e),data:t}),(a||0===a)&&(n+=a),n+="\n\n "}function d(){return"\n "}function p(e,t){var a,n,r="";return r+='\n
',(n=i.noneLabel)?a=n.call(e,{hash:{},data:t}):(n=e&&e.noneLabel,a=typeof n===w?n.call(e,{hash:{},data:t}):n),(a||0===a)&&(r+=a),r+=" \n "}function u(e,t,a){var n,r,s="";return s+='\n
",(r=i.text)?n=r.call(e,{hash:{},data:t}):(r=e&&e.text,n=typeof r===w?r.call(e,{hash:{},data:t}):r),s+=F(n)+" \n "}function h(e,t,a){var n,r,s;return r=i.compare||e&&e.compare,s={hash:{},inverse:x.noop,fn:x.program(16,f,t),data:t},n=r?r.call(e,e&&e.value,a&&a.value,s):S.call(e,"compare",e&&e.value,a&&a.value,s),n||0===n?n:""}function f(){return'selected="selected"'}function m(e,t,a){var n,r="";return r+="\n\n ",n=i["if"].call(e,e&&e.hideNone,{hash:{},inverse:x.program(12,p,t),fn:x.program(10,d,t),data:t}),(n||0===n)&&(r+=n),r+="\n\n ",n=i.each.call(e,e&&e.selectOptions,{hash:{},inverse:x.noop,fn:x.programWithDepth(19,g,t,a),data:t}),(n||0===n)&&(r+=n),r+="\n\n "}function g(e,t,a){var n,r,s,o="";return o+='\n
",(r=i.text)?n=r.call(e,{hash:{},data:t}):(r=e&&e.text,n=typeof r===w?r.call(e,{hash:{},data:t}):r),o+=F(n)+" \n "}this.compilerInfo=[4,">= 1.0.0"],i=this.merge(i,e.helpers),n=n||{};var v,y,b="",w="function",F=this.escapeExpression,x=this,S=i.helperMissing;return b+='"},this.HandlebarsPrecompiled=this.HandlebarsPrecompiled||{},this.HandlebarsPrecompiled["web-edit"]=this.HandlebarsPrecompiled["web-edit"]||{},this.HandlebarsPrecompiled["web-edit"]["control-text"]=function(e,t,i,a,n){function r(e){var t,i="";return i+='placeholder="'+m((t=e&&e.options,t=null==t||t===!1?t:t.placeholder,typeof t===f?t.apply(e):t))+'"'}function s(e){var t,i="";return i+='size="'+m((t=e&&e.options,t=null==t||t===!1?t:t.size,typeof t===f?t.apply(e):t))+'"'}function o(){return'readonly="readonly"'}function l(e,t){var a,n,r="";return r+='name="',(n=i.name)?a=n.call(e,{hash:{},data:t}):(n=e&&e.name,a=typeof n===f?n.call(e,{hash:{},data:t}):n),r+=m(a)+'"'}function c(e,t){var i,a="";return a+="data-"+m((i=null==t||t===!1?t:t.key,typeof i===f?i.apply(e):i))+'="'+m(typeof e===f?e.apply(e):e)+'"'}function d(e,t){var i,a="";return a+=m((i=null==t||t===!1?t:t.key,typeof i===f?i.apply(e):i))+'="'+m(typeof e===f?e.apply(e):e)+'"'}this.compilerInfo=[4,">= 1.0.0"],i=this.merge(i,e.helpers),n=n||{};var p,u,h="",f="function",m=this.escapeExpression,g=this;return h+='"},this.HandlebarsPrecompiled=this.HandlebarsPrecompiled||{},this.HandlebarsPrecompiled["web-edit"]=this.HandlebarsPrecompiled["web-edit"]||{},this.HandlebarsPrecompiled["web-edit"]["control-textarea"]=function(e,t,i,a,n){function r(e){var t,i="";return i+='placeholder="'+m((t=e&&e.options,t=null==t||t===!1?t:t.placeholder,typeof t===f?t.apply(e):t))+'"'}function s(e){var t,i="";return i+='rows="'+m((t=e&&e.options,t=null==t||t===!1?t:t.rows,typeof t===f?t.apply(e):t))+'"'}function o(e){var t,i="";return i+='cols="'+m((t=e&&e.options,t=null==t||t===!1?t:t.cols,typeof t===f?t.apply(e):t))+'"'}function l(){return'readonly="readonly"'}function c(e,t){var a,n,r="";return r+='name="',(n=i.name)?a=n.call(e,{hash:{},data:t}):(n=e&&e.name,a=typeof n===f?n.call(e,{hash:{},data:t}):n),r+=m(a)+'"'}function d(e,t){var a,n,r="";return r+="data-",(n=i.fieldId)?a=n.call(e,{hash:{},data:t}):(n=e&&e.fieldId,a=typeof n===f?n.call(e,{hash:{},data:t}):n),r+=m(a)+'="',(n=i.value)?a=n.call(e,{hash:{},data:t}):(n=e&&e.value,a=typeof n===f?n.call(e,{hash:{},data:t}):n),(a||0===a)&&(r+=a),r+='"'}this.compilerInfo=[4,">= 1.0.0"],i=this.merge(i,e.helpers),n=n||{};var p,u,h="",f="function",m=this.escapeExpression,g=this;return h+='"},this.HandlebarsPrecompiled=this.HandlebarsPrecompiled||{},this.HandlebarsPrecompiled["web-edit"]=this.HandlebarsPrecompiled["web-edit"]||{},this.HandlebarsPrecompiled["web-edit"]["control-url"]=function(e,t,i,a,n){function r(e){var t,i="";return i+='placeholder="'+f((t=e&&e.options,t=null==t||t===!1?t:t.placeholder,typeof t===h?t.apply(e):t))+'"'}function s(e){var t,i="";return i+='size="'+f((t=e&&e.options,t=null==t||t===!1?t:t.size,typeof t===h?t.apply(e):t))+'"'}function o(){return'readonly="readonly"'}function l(e,t){var a,n,r="";return r+='name="',(n=i.name)?a=n.call(e,{hash:{},data:t}):(n=e&&e.name,a=typeof n===h?n.call(e,{hash:{},data:t}):n),r+=f(a)+'"'}function c(e,t){var i,a="";return a+="data-"+f((i=null==t||t===!1?t:t.key,typeof i===h?i.apply(e):i))+'="'+f(typeof e===h?e.apply(e):e)+'"'}this.compilerInfo=[4,">= 1.0.0"],i=this.merge(i,e.helpers),n=n||{};var d,p,u="",h="function",f=this.escapeExpression,m=this;return u+='"},this.HandlebarsPrecompiled=this.HandlebarsPrecompiled||{},this.HandlebarsPrecompiled["web-edit"]=this.HandlebarsPrecompiled["web-edit"]||{},this.HandlebarsPrecompiled["web-edit"].control=function(e,t,i,a,n){function r(e,t){var a,n,r="";return r+='\n
',a=e&&e.options,a=null==a||a===!1?a:a.label,a=typeof a===f?a.apply(e):a,(a||0===a)&&(r+=a),r+=" \n "}function s(e){var t;return m((t=e&&e.options,t=null==t||t===!1?t:t.labelClass,typeof t===f?t.apply(e):t))}function o(){var e="";return e}function l(e,t){var a,n="";return n+='\n
\n \n ',a=e&&e.options,a=null==a||a===!1?a:a.helper,a=typeof a===f?a.apply(e):a,(a||0===a)&&(n+=a),n+="\n
\n "}function c(e){var t;return m((t=e&&e.options,t=null==t||t===!1?t:t.helperClass,typeof t===f?t.apply(e):t))}this.compilerInfo=[4,">= 1.0.0"],i=this.merge(i,e.helpers),n=n||{};var d,p,u,h="",f="function",m=this.escapeExpression,g=this,v=i.blockHelperMissing;return h+='"},this.HandlebarsPrecompiled=this.HandlebarsPrecompiled||{},this.HandlebarsPrecompiled["web-edit"]=this.HandlebarsPrecompiled["web-edit"]||{},this.HandlebarsPrecompiled["web-edit"].form=function(e,t,i,a,n){function r(){var e="";return e}function s(e,t){var a,n="";return n+="\n ",a=i.each.call(e,(a=e&&e.options,null==a||a===!1?a:a.buttons),{hash:{},inverse:m.noop,fn:m.program(4,o,t),data:t}),(a||0===a)&&(n+=a),n+="\n "}function o(e,t){var a,n,r="";return r+='\n
",(n=i.value)?a=n.call(e,{hash:{},data:t}):(n=e&&e.value,a=typeof n===h?n.call(e,{hash:{},data:t}):n),(a||0===a)&&(r+=a),r+=" \n "}function l(e,t){var a,n,r="";return r+=f((a=null==t||t===!1?t:t.key,typeof a===h?a.apply(e):a))+'="',(n=i.value)?a=n.call(e,{hash:{},data:t}):(n=e&&e.value,a=typeof n===h?n.call(e,{hash:{},data:t}):n),r+=f(a)+'"'}this.compilerInfo=[4,">= 1.0.0"],i=this.merge(i,e.helpers),n=n||{};var c,d,p,u="",h="function",f=this.escapeExpression,m=this,g=i.blockHelperMissing;return u+='"},this.HandlebarsPrecompiled=this.HandlebarsPrecompiled||{},this.HandlebarsPrecompiled["web-edit"]=this.HandlebarsPrecompiled["web-edit"]||{},this.HandlebarsPrecompiled["web-edit"].message=function(e,t,i,a,n){this.compilerInfo=[4,">= 1.0.0"],i=this.merge(i,e.helpers),n=n||{};var r,s,o="",l="function";return o+='"},this.HandlebarsPrecompiled=this.HandlebarsPrecompiled||{},this.HandlebarsPrecompiled["web-edit"]=this.HandlebarsPrecompiled["web-edit"]||{},this.HandlebarsPrecompiled["web-edit"].wizard=function(e,t,i,a,n){function r(e,t){var a,n="";return n+='\n
\n
\n \n
\n ',a=i.each.call(e,e&&e.steps,{hash:{},inverse:v.noop,fn:v.program(2,s,t),data:t}),(a||0===a)&&(n+=a),n+="\n \n
\n \n
\n "}function s(e,t){var a,n,r="";return r+='\n
\n \n
',(n=i.title)?a=n.call(e,{hash:{},data:t}):(n=e&&e.title,a=typeof n===m?n.call(e,{hash:{},data:t}):n),(a||0===a)&&(r+=a),r+='
\n
',(n=i.description)?a=n.call(e,{hash:{},data:t}):(n=e&&e.description,a=typeof n===m?n.call(e,{hash:{},data:t}):n),(a||0===a)&&(r+=a),r+='
\n
\n
\n \n '}function o(){return'\n
\n '}function l(e,t){var a,n,r="";return r+="\n
",(n=i.wizardTitle)?a=n.call(e,{hash:{},data:t}):(n=e&&e.wizardTitle,a=typeof n===m?n.call(e,{hash:{},data:t}):n),(a||0===a)&&(r+=a),r+=" \n "}function c(e,t){var a,n,r="";return r+="\n
",(n=i.wizardDescription)?a=n.call(e,{hash:{},data:t}):(n=e&&e.wizardDescription,a=typeof n===m?n.call(e,{hash:{},data:t}):n),(a||0===a)&&(r+=a),r+=" \n "}function d(e,t){var a,n,r,s="";return s+="\n ",n=i.compare||e&&e.compare,r={hash:{},inverse:v.noop,fn:v.program(11,p,t),data:t},a=n?n.call(e,e&&e.align,"left",r):y.call(e,"compare",e&&e.align,"left",r),(a||0===a)&&(s+=a),s+="\n "}function p(e,t){var a,n,r="";return r+='\n
',(n=i.title)?a=n.call(e,{hash:{},data:t}):(n=e&&e.title,a=typeof n===m?n.call(e,{hash:{},data:t}):n),(a||0===a)&&(r+=a),r+=" \n "}function u(e,t){var a,n,r,s="";return s+="\n ",n=i.compare||e&&e.compare,r={hash:{},inverse:v.noop,fn:v.program(11,p,t),data:t},a=n?n.call(e,e&&e.align,"right",r):y.call(e,"compare",e&&e.align,"right",r),(a||0===a)&&(s+=a),s+="\n "}this.compilerInfo=[4,">= 1.0.0"],i=this.merge(i,e.helpers),n=n||{};var h,f="",m="function",g=this.escapeExpression,v=this,y=i.helperMissing;return f+=''},function(e,t,i){t[e]=i()}("Base",this,function(){var e=function(){};return e.extend=function(t,i){var a=e.prototype.extend;e._prototyping=!0;var n=new this;a.call(n,t),n.base=function(){},delete e._prototyping;var r=n.constructor,s=n.constructor=function(){if(!e._prototyping)if(this._constructing||this.constructor===s)this._constructing=!0,r.apply(this,arguments),delete this._constructing;else if(null!==arguments[0])return(arguments[0].extend||a).call(arguments[0],n)};return s.ancestor=this,s.extend=this.extend,s.forEach=this.forEach,s.implement=this.implement,s.prototype=n,s.toString=this.toString,s.valueOf=function(e){return"object"===e?s:r.valueOf()},a.call(s,i),"function"==typeof s.init&&s.init(),s},e.prototype={extend:function(t,i){if(arguments.length>1){var a=this[t];if(a&&"function"==typeof i&&(!a.valueOf||a.valueOf()!==i.valueOf())&&/\bbase\b/.test(i)){var n=i.valueOf();i=function(){var t=this.base||e.prototype.base;this.base=a;var i=n.apply(this,arguments);return this.base=t,i},i.valueOf=function(e){return"object"===e?i:n},i.toString=e.toString}this[t]=i}else if(t){var r=e.prototype.extend;e._prototyping||"function"==typeof this||(r=this.extend||r);for(var s={toSource:null},o=["constructor","toString","valueOf"],l=e._prototyping?0:1;l
=2&&(t.isObject(i[1])?(n=i[1].data,r=i[1].schema,s=i[1].options,o=i[1].view,l=i[1].render,c=i[1].postRender,d=i[1].error,p=i[1].connector,f=i[1].dataSource,m=i[1].schemaSource,g=i[1].optionsSource,v=i[1].viewSource,i[1].ui&&(h.ui=i[1].ui),i[1].type&&(h.type=i[1].type),t.isEmpty(i[1].notTopLevel)||(u=i[1].notTopLevel)):(n=i[1],t.isFunction(n)&&(n=n()))),t.isEmpty(d)&&(d=t.defaultErrorCallback),t.isEmpty(p)){var T=t.getConnectorClass("default");
+p=new T("default")}a&&t.isString(a)&&(a=e("#"+a));var C=p;if(u){var O=t.getConnectorClass("default");C=new O("default")}s||(s={});var I=function(e){e.parent||(e.hideInitValidationError||e.refreshValidationState(!0),"view"!==e.view.type&&t.fieldApplyFieldAndChildren(e,function(e){e.hideInitValidationError=!1}))},k=function(e){e.parent||(e.observableScope=t.generateId()),t.isUndefined(s.focus)&&!e.parent&&(s.focus=t.defaultFocus),s&&s.focus?window.setTimeout(function(){var t=function(e){e.suspendBlurFocus=!0,e.focus(),e.suspendBlurFocus=!1};if(s.focus){if(e.isControlField&&e.isAutoFocusable())t(e);else if(e.isContainerField)if(s.focus===!0){if(e.children&&e.children.length>0)for(var i=0;i"+i+" ",a=e(i).children()}return a}return i},isEmpty:function(e){var i=this;if(t.isUndefined(e))return!0;if(null===e)return!0;if(e&&t.isObject(e)){var a=i.countProperties(e);if(0===a)return!0}return!1},countProperties:function(e){var i=0;if(e&&t.isObject(e))for(var a in e)e.hasOwnProperty(a)&&"function"!=typeof e[a]&&i++;return i},copyOf:function(i){var a=i;if(t.isArray(i)){a=[];for(var n=0;nt;t++)lang.isNull(e[t])||lang.isUndefined(e[t])||i.push(e[t]);return i},removeAccents:function(e){return e.replace(/[àáâãäå]/g,"a").replace(/[èéêë]/g,"e").replace(/[ìíîï]/g,"i").replace(/[òóôõö]/g,"o").replace(/[ùúûü]/g,"u").replace(/[ýÿ]/g,"y").replace(/[ñ]/g,"n").replace(/[ç]/g,"c").replace(/[œ]/g,"oe").replace(/[æ]/g,"ae")},indexOf:function(e,i,a){var n,r=i.length;for(t.isFunction(a)||(a=function(e,t){return e===t}),n=0;r>n;n++)if(a.call({},e,i[n]))return n;return-1},uniqueIdCounter:0,defaultLocale:"en_US",defaultFocus:!0,setDefaultLocale:function(e){this.defaultLocale=e},defaultSchemaFieldMapping:{},registerDefaultSchemaFieldMapping:function(e,t){e&&t&&(this.defaultSchemaFieldMapping[e]=t)},defaultFormatFieldMapping:{},registerDefaultFormatFieldMapping:function(e,t){e&&t&&(this.defaultFormatFieldMapping[e]=t)},getSchemaType:function(e){var i=null;return t.isEmpty(e)&&(i="string"),t.isObject(e)&&(i="object"),t.isString(e)&&(i="string"),t.isNumber(e)&&(i="number"),t.isArray(e)&&(i="array"),t.isBoolean(e)&&(i="boolean"),"object"==typeof e&&(i="object"),i},views:{},generateViewId:function(){return"view-"+this.generateId()},registerView:function(e){var i=e.id;if(!i)return t.throwDefaultError("Cannot register view with missing view id: "+i);var a=this.views[i];if(a)t.mergeObject(a,e);else{this.views[i]=e,e.templates||(e.templates={});for(var n=t.TemplateEngineRegistry.ids(),r=0;r");if(i&&r.attr(i),a&&r.css(a),n)for(var s in n)r.addClass(s)},elementFromTemplate:function(i,a){var n=i;if(a)for(var r in a)n=t.replaceAll(n,"${"+r+"}",a[r]);return e(n)},generateId:function(){return t.uniqueIdCounter++,"alpaca"+t.uniqueIdCounter},later:function(t,i,a,n,r){t=t||0,i=i||{};var s,o,l=a,c=e.makeArray(n);if("string"==typeof a&&(l=i[a]),!l)throw{name:"TypeError",message:"The function is undefined."};return s=function(){l.apply(i,c)},o=r?setInterval(s,t):setTimeout(s,t),{id:o,interval:r,cancel:function(){this.interval?clearInterval(o):clearTimeout(o)}}},endsWith:function(e,t){return-1!==e.indexOf(t,e.length-t.length)},startsWith:function(e,t){return e.substr(0,t.length)===t},isUri:function(e){return t.isString(e)&&(t.startsWith(e,"http://")||t.startsWith(e,"https://")||t.startsWith(e,"/")||t.startsWith(e,"./")||t.startsWith(e,"../"))},traverseObject:function(e,i,a){t.isString(i)&&(i=i.split("."));var n=null,r=e,s=null;do s=i.shift(),a&&s===a&&(s=i.shift()),t.isEmpty(r[s])?i=[]:(r=r[s],0===i.length&&(n=r));while(i.length>0);return n},each:function(e,i){if(t.isArray(e))for(var a=0;a-1){var s=e.substring(0,r)+i[a]+e.substring(r+3);e=s}}return e},compareObject:function(e,t){return equiv(e,t)},compareArrayContent:function(t,i){var a=t&&i&&t.length===i.length;if(a)for(var n=t.length-1;n>=0;n--){var r=t[n];if(e.inArray(r,i)<0)return!1}return a},testRegex:function(e,t){var i=new RegExp(e);return i.test(t)},isValEmpty:function(i){var a=!1;return t.isEmpty(i)?a=!0:(t.isString(i)&&""===i&&(a=!0),t.isObject(i)&&e.isEmptyObject(i)&&(a=!0),t.isArray(i)&&0===i.length&&(a=!0),t.isNumber(i)&&isNaN(i)&&(a=!0)),a},init:function(e,i,a,n,r,s,o,l,c,d){var p=this;if(t.isObject(r)){var u=r.id;u||(r.id=this.generateViewId());var h=r.parent;h||(r.parent="web-edit"),this.registerView(r),r=r.id}this.compile(function(u){if(u.errors&&u.errors.length>0){for(var h=[],f=0;f3?"select":"radio":t.defaultSchemaFieldMapping[n.type],n.format&&t.defaultFormatFieldMapping[n.format]&&(a.type=t.defaultFormatFieldMapping[n.format]));var c=t.getFieldClass(a.type);return c?new c(e,i,a,n,r,s,o):(o({message:"Unable to find field class for type: "+a.type,reason:"FIELD_INSTANTIATION_ERROR"}),null)},parseJSON:function(t){return t?e.parseJSON(t):null},compile:function(i,a){var n=this,r={errors:[],count:0,successCount:0},s=function(e){if(0===r.errors.length)for(var t in e)n.normalizedViews[t]=e[t];i(r)},o=function(e,t,i,a,n){var o=i.id;r.count++,t?r.errors.push({view:o,cacheKey:a,err:t}):r.successCount++,r.count==n&&s(e)},l=function(i,a,n,r,s,l,c){var d=t.makeCacheKey(a.id,n,r,s),p="text/x-handlebars-template";if(l&&t.isObject(l)&&(p=l.type,l.cacheKey&&(d=l.cacheKey),l=l.template),l&&"string"==typeof l){var u=l.toLowerCase();if(0===u.indexOf("http://")||0===u.indexOf("https://")||0===u.indexOf("/")||0===u.indexOf("./"));else if(!l||0!==l.indexOf("#")&&0!==l.indexOf(".")){if(l){var h=a.templates[l];h&&(l=h)}}else{var f=e(l);p=e(f).attr("type"),l=e(f).html()}}if(!p){t.logError("Engine type was empty");var m=new Error("Engine type was empty");return void o(i,m,a,d,c)}var g=t.TemplateEngineRegistry.find(p);if(!g){t.logError("Cannot find template engine for type: "+type);var m=new Error("Cannot find template engine for type: "+type);return void o(i,m,a,d,c)}if(l===!0){if(g.isCached(d))return void o(i,null,a,d,c);var v="View configuration for view: "+a.id+" claims to have precompiled template for cacheKey: "+d+" but it could not be found";return t.logError(v),void o(i,new Error(v),a,d,c)}return g.isCached(d)?void o(i,null,a,d,c):void g.compile(d,l,function(e){o(i,e,a,d,c)})},c=function(e){var t=[];for(var i in e){var a=e[i];if(a.templates)for(var n in a.templates){var r=a.templates[n];t.push(function(e,t,i,a,n,r){return function(s){l(e,t,i,a,n,r,s)}}(e,a,"view",a.id,n,r))}if(a.fields)for(var s in a.fields)if(a.fields[s].templates)for(var n in a.fields[s].templates){var r=a.fields[s].templates[n];t.push(function(e,t,i,a,n,r){return function(s){l(e,t,i,a,n,r,s)}}(e,a,"field",s,n,r))}if(a.layout&&a.layout.template){var r=a.layout.template;t.push(function(e,t,i,a,n,r){return function(s){l(e,t,i,a,n,r,s)}}(e,a,"layout","layout","layoutTemplate",r))}if(a.globalTemplate){var r=a.globalTemplate;t.push(function(e,t,i,a,n,r){return function(s){l(e,t,i,a,n,r,s)}}(e,a,"global","global","globalTemplate",r))}}for(var o=t.length,c=0;c0?c(e):s(e)};d()},getTemplateDescriptor:function(e,i,a){var n=null,r=null,s=null;if(e.templates&&e.templates[i]){s=t.makeCacheKey(e.id,"view",e.id,i);var o=e.templates[i];t.isObject(o)&&o.cacheKey&&(s=o.cacheKey)}if(a&&a.path){var l=a.path;e&&e.fields&&e.fields[l]&&e.fields[l].templates&&e.fields[l].templates[i]&&(s=t.makeCacheKey(e.id,"field",l,i))}if(("globalTemplate"===i||"global"===i)&&(s=t.makeCacheKey(e.id,"global","global","globalTemplate")),("layoutTemplate"===i||"layout"===i)&&(s=t.makeCacheKey(e.id,"layout","layout","layoutTemplate")),s){for(var c=t.TemplateEngineRegistry.ids(),d=0;d").append(this).html():e("
").append(this.clone()).html()},e.fn.swapWith=function(t){return this.each(function(){var i=e(t).clone(),a=e(this).clone();e(t).replaceWith(a),e(this).replaceWith(i)})},e.fn.attrProp=function(i,a){return t.attrProp(e(this),i,a)},e.event.special.destroyed={remove:function(e){e.handler&&e.handler()}},t.pathParts=function(e){if("string"!=typeof e)return e;var i=e,a=null,n=i.indexOf("#");n>-1&&(a=i.substring(n+1),i=i.substring(0,n)),t.endsWith(i,"/")&&(i=i.substring(0,i.length-1));var r={};return r.path=i,a&&(r.id=a),r},t.resolveField=function(e,i){var a=null;if("string"==typeof i)if(0===i.indexOf("#/")&&propertyId.length>2);else if("#"===i||"#/"===i)a=e;else if(0===i.indexOf("#")){for(var n=e;n.parent;)n=n.parent;var r=i.substring(1);a=t.resolveFieldByReference(n,r)}else a=e.childrenByPropertyId[i];return a},t.resolveFieldByReference=function(e,i){if(e.schema&&e.schema.id==i)return e;if(e.children&&e.children.length>0)for(var a=0;a1){var l=e.slice(0);l.shift(),r(l,t,function(){o(a,n,function(){i()})})}else o(a,n,function(){i()})};r(i,n,function(){t(n)})},t.updateValidationStateForContext=function(e,i){for(var a=0;a0)for(var i=0;i=t.length&&a(null))}))})},r.forEach=r.each,r.eachSeries=function(e,t,i){if(i=i||function(){},!e.length)return i();var a=0,n=function(){t(e[a],function(t){t?(i(t),i=function(){}):(a+=1,a>=e.length?i(null):n())})};n()},r.forEachSeries=r.eachSeries,r.eachLimit=function(e,t,i,a){var n=d(t);n.apply(null,[e,i,a])},r.forEachLimit=r.eachLimit;var d=function(e){return function(t,i,a){if(a=a||function(){},!t.length||0>=e)return a();var n=0,r=0,s=0;!function o(){if(n>=t.length)return a();for(;e>s&&r=t.length?a():o())})}()}},p=function(e){return function(){var t=Array.prototype.slice.call(arguments);return e.apply(null,[r.each].concat(t))}},u=function(e,t){return function(){var i=Array.prototype.slice.call(arguments);return t.apply(null,[d(e)].concat(i))}},h=function(e){return function(){var t=Array.prototype.slice.call(arguments);return e.apply(null,[r.eachSeries].concat(t))}},f=function(e,t,i,a){var n=[];t=o(t,function(e,t){return{index:t,value:e}}),e(t,function(e,t){i(e.value,function(i,a){n[e.index]=a,t(i)})},function(e){a(e,n)})};r.map=p(f),r.mapSeries=h(f),r.mapLimit=function(e,t,i,a){return m(t)(e,i,a)};var m=function(e){return u(e,f)};r.reduce=function(e,t,i,a){r.eachSeries(e,function(e,a){i(t,e,function(e,i){t=i,a(e)})},function(e){a(e,t)})},r.inject=r.reduce,r.foldl=r.reduce,r.reduceRight=function(e,t,i,a){var n=o(e,function(e){return e}).reverse();r.reduce(n,t,i,a)},r.foldr=r.reduceRight;var g=function(e,t,i,a){var n=[];t=o(t,function(e,t){return{index:t,value:e}}),e(t,function(e,t){i(e.value,function(i){i&&n.push(e),t()})},function(){a(o(n.sort(function(e,t){return e.index-t.index}),function(e){return e.value}))})};r.filter=p(g),r.filterSeries=h(g),r.select=r.filter,r.selectSeries=r.filterSeries;var v=function(e,t,i,a){var n=[];t=o(t,function(e,t){return{index:t,value:e}}),e(t,function(e,t){i(e.value,function(i){i||n.push(e),t()})},function(){a(o(n.sort(function(e,t){return e.index-t.index}),function(e){return e.value}))})};r.reject=p(v),r.rejectSeries=h(v);var y=function(e,t,i,a){e(t,function(e,t){i(e,function(i){i?(a(e),a=function(){}):t()})},function(){a()})};r.detect=p(y),r.detectSeries=h(y),r.some=function(e,t,i){r.each(e,function(e,a){t(e,function(e){e&&(i(!0),i=function(){}),a()})},function(){i(!1)})},r.any=r.some,r.every=function(e,t,i){r.each(e,function(e,a){t(e,function(e){e||(i(!1),i=function(){}),a()})},function(){i(!0)})},r.all=r.every,r.sortBy=function(e,t,i){r.map(e,function(e,i){t(e,function(t,a){t?i(t):i(null,{value:e,criteria:a})})},function(e,t){if(e)return i(e);var a=function(e,t){var i=e.criteria,a=t.criteria;return a>i?-1:i>a?1:0};i(null,o(t.sort(a),function(e){return e.value}))})},r.auto=function(e,t){t=t||function(){};var i=c(e);if(!i.length)return t(null);var a={},n=[],o=function(e){n.unshift(e)},d=function(e){for(var t=0;tt;t++)e[t].apply(null,arguments)}])))};return n.memo=i,n.unmemoized=e,n},r.unmemoize=function(e){return function(){return(e.unmemoized||e).apply(null,arguments)}},r.times=function(e,t,i){for(var a=[],n=0;e>n;n++)a.push(n);return r.map(a,t,i)},r.timesSeries=function(e,t,i){for(var a=[],n=0;e>n;n++)a.push(n);return r.mapSeries(a,t,i)},r.compose=function(){var e=Array.prototype.reverse.call(arguments);return function(){var t=this,i=Array.prototype.slice.call(arguments),a=i.pop();r.reduce(e,i,function(e,i,a){i.apply(t,e.concat([function(){var e=arguments[0],t=Array.prototype.slice.call(arguments,1);a(e,t)}]))},function(e,i){a.apply(t,[e].concat(i))})}};var x=function(e,t){var i=function(){var i=this,a=Array.prototype.slice.call(arguments),n=a.pop();return e(t,function(e,t){e.apply(i,a.concat([t]))},n)};if(arguments.length>2){var a=Array.prototype.slice.call(arguments,2);return i.apply(this,a)}return i};r.applyEach=p(x),r.applyEachSeries=h(x),r.forever=function(e,t){function i(a){if(a){if(t)return t(a);throw a}e(i)}i()},a.async=r;!function(){var e,a=[],n=function(){function i(e,t){return e instanceof t.constructor||t instanceof e.constructor?t==e:t===e}return{string:i,"boolean":i,number:i,"null":i,undefined:i,nan:function(e){return isNaN(e)
+},date:function(e,i){return"date"===t(e)&&i.valueOf()===e.valueOf()},regexp:function(e,i){return"regexp"===t(e)&&i.source===e.source&&i.global===e.global&&i.ignoreCase===e.ignoreCase&&i.multiline===e.multiline},"function":function(){var e=a[a.length-1];return e!==Object&&"undefined"!=typeof e},array:function(i,a){var n,r;if("array"!==t(i))return!1;if(r=a.length,r!==i.length)return!1;for(n=0;r>n;n++)if(!e(a[n],i[n]))return!1;return!0},object:function(t,i){var n,r=!0,s=[],o=[];if(i.constructor!==t.constructor)return!1;a.push(i.constructor);for(n in i)s.push(n),e(i[n],t[n])||(r=!1);a.pop();for(n in t)o.push(n);return r&&e(s.sort(),o.sort())}}}();return e=function(){var e=Array.prototype.slice.apply(arguments);return e.length<2?!0:function(e,a){return e===a?!0:null===e||null===a||"undefined"==typeof e||"undefined"==typeof a||t(e)!==t(a)?!1:i(e,n,[a,e])}(e[0],e[1])&&arguments.callee.apply(this,e.splice(1,e.length-1))}}()}(),t.MARKER_CLASS_CONTROL_FIELD="alpaca-marker-control-field",t.MARKER_CLASS_CONTAINER_FIELD="alpaca-marker-container-field",t.MARKER_CLASS_CONTAINER_FIELD_ITEM="alpaca-marker-control-field-item",t.MARKER_DATA_CONTAINER_FIELD_ITEM_KEY="data-alpaca-container-field-item-key",t.MARKER_CLASS_FORM_ITEMS_FIELD="alpaca-marker-form-items-field",t.CLASS_CONTAINER="alpaca-container",t.CLASS_CONTROL="alpaca-control",t.MARKER_CLASS_INSERT="alpaca-marker-insert",t.MARKER_DATA_INSERT_KEY="data-alpaca-marker-insert-key",t.makeCacheKey=function(e,t,i,a){return e+":"+t+":"+i+":"+a},t.splitCacheKey=function(e){var t={},i=e.indexOf(":"),a=e.lastIndexOf(":");t.viewId=e.substring(0,i),t.templateId=e.substring(a+1);var n=e.substring(i+1,a),r=n.indexOf(":");return t.scopeType=n.substring(0,r),t.scopeId=n.substring(r+1),t},t.createEmptyDataInstance=function(){return""},t.animatedSwap=function(t,i,a,n){"function"==typeof a&&(n=a,a=500);var r=function(t,i,a,n){var r=e(t),s=e(i),o=r.offset(),l=s.offset(),c=r.clone(),d=s.clone(),p=l.top+s.height()-o.top,u=0,h=0,f=l.left+s.width()-o.left,m=0,g=0;r.css("opacity",0),s.css("opacity",0),c.insertAfter(r).css({position:"absolute",width:r.outerWidth(),height:r.outerHeight()}).offset(o).css("z-index","999"),d.insertAfter(s).css({position:"absolute",width:s.outerWidth(),height:s.outerHeight()}).offset(l).css("z-index","999"),o.top!==l.top&&(u=p-r.height()),h=p-s.height(),o.left!==l.left&&(m=f-r.width()),g=f-s.width(),c.animate({top:"+="+u+"px",left:"+="+m+"px"},a,function(){s.css("opacity",1),e(this).remove()}),d.animate({top:"-="+h+"px",left:"-="+g+"px"},a,function(){r.css("opacity",1),e(this).remove()}),window.setTimeout(function(){c.remove(),d.remove(),n()},a+1)};r(t,i,a,n)}}(jQuery),function(e){var t=e.alpaca;t.listenerId=function(){var e=0;return function(){return"listener-"+e++}}(),t.subscribe=function(){var e=t.makeArray(arguments),i=null,a=null,n=null;if(2==e.length?(i="global",a=e.shift(),n=e.shift()):(i=e.shift(),a=e.shift(),n=e.shift()),a&&t.isObject(a)&&(a=a.path),!a)return t.logError("Missing observable subscribe id: "+a),null;var r=n._lfid;r||(r=t.listenerId(),n._lfid=r);var s=function(e){return function(){return n.apply(e,arguments)}}(this);s._lfid=n._lfid;var o=t.ScopedObservables.get(i),l=o.observable(a);return l.subscribe(r,s),{scope:i,id:a,listenerId:r}},t.unsubscribe=function(){var e=t.makeArray(arguments),i=null,a=null,n=null;2==e.length?(i="global",a=e.shift(),n=e.shift()):3==e.length&&(i=e.shift(),a=e.shift(),n=e.shift());var r=n;if(t.isFunction(r)&&(r=r._lfid),a&&t.isObject(a)&&(a=a.path),!a)return t.logError("Missing observable id: "+a),null;var s=t.ScopedObservables.get(i),o=s.observable(a);return o.unsubscribe(r),{scope:i,id:a,listenerId:r}},t.observable=function(){var e,i,a=t.makeArray(arguments);if(1==a.length?(e="global",i=a.shift()):2==a.length&&(e=a.shift(),i=a.shift()),i&&t.isObject(i)&&(i=i.path),i){var n=t.ScopedObservables.get(e);observable=n.observable(i)}else t.logError("Missing observable id: "+JSON.stringify(a));return observable},t.clearObservable=function(){var e,i,a=t.makeArray(arguments);1==a.length?(e="global",i=a.shift()):2==a.length&&(e=a.shift(),i=a.shift()),i&&t.isObject(i)&&(i=i.path),i||t.logError("Missing observable id: "+JSON.stringify(a));var n=t.ScopedObservables.get(e),r=n.observable(i);r.clear()},t.dependentObservable=function(){var e=null,i=null,a=null,n=t.makeArray(arguments);if(2==n.length)e="global",i=n.shift(),a=n.shift();else{if(3!=n.length)return void t.error("Wrong number of arguments");e=n.shift(),i=n.shift(),a=n.shift()}i&&t.isObject(i)&&(i=i.path),i||t.logError("Missing observable id: "+JSON.stringify(n));var r=t.ScopedObservables.get(e);return r.dependentObservable(i,a)}}(jQuery),function(e){var t=e.alpaca;t.Observables=Base.extend({constructor:function(e){this.base(),this.scope=e,this.observables={}},observable:function(e,i){if(!this.observables[e]){var a=new t.Observable(this.scope,e);i&&a.set(i),this.observables[e]=a}return this.observables[e]},dependentObservable:function(e,i){var a=this;if(!this.observables[e]){var n=this.observable(e),r=new t.Observables(this.scope);r.observable=function(e,t){var i=a.observable(e,t);return i.markDependentOnUs(n),i};var s=function(){return i.call(r)};n.setValueFunction(s)}return this.observables[e]},observables:function(){return this.observables}})}(jQuery),function(e){var t=e.alpaca;t.Observable=Base.extend({constructor:function(t,i){this.base(),this.id=t+"-"+i,this.value=null,this.subscribers={},this.dependentOnUs={},this.notifySubscribers=function(t){var i=this;e.each(this.subscribers,function(e,a){a(i.value,t)})},this.notifyDependents=function(){e.each(this.dependentOnUs,function(e,t){t.onDependencyChange()})},this.valueFunction=null},setValueFunction:function(e){this.valueFunction=e,this.onDependencyChange()},subscribe:function(e,t){this.isSubscribed(e)||(this.subscribers[e]=t)},unsubscribe:function(e){delete this.subscribers[e]},isSubscribed:function(e){return this.subscribers[e]?!0:!1},markDependentOnUs:function(e){this.dependentOnUs[e.id]=e},onDependencyChange:function(){var e=this.get();if(this.valueFunction){var t=this.valueFunction();e!=t&&this.set(t)}},set:function(e){var t=this.value;this.value=e,this.notifyDependents(t),this.notifySubscribers(t)},get:function(e){var t=this.value;return t||(t=e),t},clear:function(){var e=this.value;delete this.value,this.notifyDependents(e),this.notifySubscribers(e)}})}(jQuery),function(e){var t=e.alpaca;t.ScopedObservables={},t.ScopedObservables.map={},t.ScopedObservables.get=function(e){return t.ScopedObservables.map[e]||(t.ScopedObservables.map[e]=new t.Observables(e)),t.ScopedObservables.map[e]}}(jQuery),function(){Alpaca.TemplateEngineRegistry=function(){var e={};return{register:function(t,i){e[t]=i,i.init()},find:function(t){var i=null;if(e[t])i=e[t];else for(var a in e)for(var n=e[a].supportedMimetypes(),r=0;r"+t+""),Alpaca.logDebug("Compiling template: "+this.id+", cacheKey: "+e+", template: "+t),this.doCompile(e,t,i)},doCompile:function(){},execute:function(e,t,i){Alpaca.logDebug("Executing template for cache key: "+e);var a=this.doExecute(e,t,i);return a=this.cleanup(a)},doExecute:function(){return null},fileExtension:function(){return"html"},supportedMimetypes:function(){return[]},isCached:function(){return!1},findCacheKeys:function(){return[]}})}(jQuery),function($,Handlebars,HandlebarsPrecompiled){var COMPILED_TEMPLATES={},helpers={};helpers.compare=function(e,t,i){if(arguments.length<3)throw new Error("Handlerbars Helper 'compare' needs 2 parameters");var a=i.hash.operator||"==",n={"==":function(e,t){return e==t},"===":function(e,t){return e===t},"!=":function(e,t){return e!=t},"!==":function(e,t){return e!==t},"<":function(e,t){return t>e},">":function(e,t){return e>t},"<=":function(e,t){return t>=e},">=":function(e,t){return e>=t},"typeof":function(e,t){return typeof e==t}};if(!n[a])throw new Error("Handlerbars Helper 'compare' doesn't know the operator "+a);var r=n[a](e,t);return r?i.fn(this):i.inverse(this)},helpers.times=function(e,t){for(var i="",a=0;e>a;++a)i+=t.fn(a);return i},helpers.control=function(){return"
"},helpers.container=function(){return"
"},helpers.item=function(){return"
"},helpers.formItems=function(){return"
"},helpers.insert=function(e){return"
"},helpers.str=function(e){return e===!1?"false":e===!0?"true":0===e?"0":"undefined"==typeof e?"":null===e?"":Alpaca.isString(e)?e:Alpaca.isNumber(e)?e:Alpaca.isObject(e)?JSON.stringify(e,null," "):Alpaca.isArray(e)?JSON.stringify(e,null," "):e},Handlebars.registerHelper("setIndex",function(e){this.index=Number(e)}),Handlebars.registerHelper("uploadErrorMessage",function(e){var t=e;return 1===e?t="File exceeds upload_max_filesize":2===e?t="File exceeds MAX_FILE_SIZE":3===e?t="File was only partially uploaded":4===e?t="No File was uploaded":5===e?t="Missing a temporary folder":6===e?t="Failed to write file to disk":7===e?t="File upload stopped by extension":"maxFileSize"===e?t="File is too big":"minFileSize"===e?t="File is too small":"acceptFileTypes"===e?t="Filetype not allowed":"maxNumberOfFiles"===e?t="Max number of files exceeded":"uploadedBytes"===e?t="Uploaded bytes exceed file size":"emptyResult"===e&&(t="Empty file upload result"),t}),Handlebars.registerHelper("compare",helpers.compare),Handlebars.registerHelper("control",helpers.control),Handlebars.registerHelper("container",helpers.container),Handlebars.registerHelper("item",helpers.item),Handlebars.registerHelper("formItems",helpers.formItems),Handlebars.registerHelper("times",helpers.times),Handlebars.registerHelper("str",helpers.str),Handlebars.registerHelper("with",function(e,t){return t.fn(e)});var partials={};Alpaca.HandlebarsTemplateEngine=Alpaca.AbstractTemplateEngine.extend({fileExtension:function(){return"html"},supportedMimetypes:function(){return["text/x-handlebars-template","text/x-handlebars-tmpl"]},init:function(){if(HandlebarsPrecompiled)for(var e in HandlebarsPrecompiled){var t=HandlebarsPrecompiled[e];for(var i in t){var a=t[i];if("function"==typeof a){var n=Alpaca.makeCacheKey(e,"view",e,i);COMPILED_TEMPLATES[n]=a}}}},doCompile:function(cacheKey,html,callback){var self=this,template=null;try{var functionString=Handlebars.precompile(html);template=eval("("+functionString+")"),COMPILED_TEMPLATES[cacheKey]=template}catch(e){return void callback(e)}callback()},doExecute:function(e,t,i){var a=COMPILED_TEMPLATES[e];if(!a)return void i(new Error("Could not find handlebars cached template for key: "+e));var n=null;try{n=Handlebars.template(a)(t)}catch(r){return i(r),null}return n},isCached:function(e){return COMPILED_TEMPLATES[e]?!0:!1},findCacheKeys:function(e){var t=[];for(var i in COMPILED_TEMPLATES)0===i.indexOf(e+":")&&t.push(i);return t}}),Alpaca.TemplateEngineRegistry.register("handlebars",new Alpaca.HandlebarsTemplateEngine("handlebars"))}(jQuery,"undefined"!=typeof Handlebars?Handlebars:window.Handlebars,"undefined"!=typeof HandlebarsPrecompiled?HandlebarsPrecompiled:window.HandlebarsPrecompiled),function(e){var t=e.alpaca;t.NormalizedView=Base.extend({constructor:function(e){this.id=e},normalize:function(e){var i=e[this.id];if(!i)return t.logError("View compilation failed - view not found: "+this.id),!1;for(var a=[],n=i;n;){a.push(n);var r=n.parent;if(r){var s=e[n.parent];if(!s)return t.logError("View compilation failed - cannot find parent view: "+r+" for view: "+n.id),!1;n=s}else n=null}a=a.reverse();for(var o=function(e,i,a){var n=i[a],r=e[a];t.isUndefined(r)||t.isUndefined(n)||t.logDebug("View property: "+a+" already has value: "+r+" and overwriting to: "+n),t.isUndefined(n)||(e[a]=n)},l=function(e,i,a){var n=i[a],r=e[a];t.isUndefined(r)||t.isUndefined(n)||t.logDebug("View property: "+a+" already has function, overwriting"),t.isUndefined(n)||(e[a]=n)},c=function(e,i,a){var n=i[a];n&&(e[a]||(e[a]={}),t.mergeObject2(n,e[a]))},d=0;d");a._processRender(r,function(){n.formFieldsContainer.before(a.field),n.formFieldsContainer.remove(),n.topControl=a,a.view.type&&"view"!==a.view.type&&n.initEvents(),a.form=n,a.postRender(function(){i&&t.isFunction(i)&&i(a)})})})}else this._processRender(a.domEl,function(){a.postRender(function(){i&&t.isFunction(i)&&i(a)})})},_processRender:function(e,t){var i=this;i.renderField(e,function(){i.fireCallback("field"),i.renderFieldElements(function(){t()})})},renderField:function(e,i){var a=this,n=this.getTemplateDescriptor(),r=this.data;this.isDisplayOnly()&&"object"==typeof r&&(r=JSON.stringify(r));var s=t.tmpl(n,{id:this.getId(),options:this.options,schema:this.schema,data:r,view:this.view,path:this.path,name:this.name});a._oldFieldEl=a.field,this.field=s,this.field.appendTo(e),i()},renderFieldElements:function(e){e()},postRender:function(i){var a=this;if(this.field.addClass("alpaca-field"),this.field.addClass("alpaca-field-"+this.getFieldType()),this.field.attr("data-alpaca-field-id",this.getId()),"view"!==this.view.type){this.isRequired()?(e(this.field).addClass("alpaca-required"),a.fireCallback("required")):(e(this.field).addClass("alpaca-optional"),a.fireCallback("optional")),this.options.readonly&&(e(this.field).addClass("alpaca-readonly"),e(":input",this.field).attr("readonly","readonly"),e("select",this.field).attr("disabled","disabled"),e(":radio",this.field).attr("disabled","disabled"),e(":checkbox",this.field).attr("disabled","disabled"),a.fireCallback("readonly"));var n=function(e,i){if(i){var a=0,n=null;if(t.isArray(i))for(a=0;a-1)for(n=i.split(","),a=0;a-1)for(n=i.split(" "),a=0;a");e(i.field).before(a),i.domEl=e("
"),i.setup(),i._render(function(){e(a).before(i.domEl.children()),e(a).remove(),i._oldFieldEl&&e(i._oldFieldEl).remove(),t&&t()})},applyStyle:function(e,t){this.view.applyStyle(e,t)},fireCallback:function(e,t,i,a,n,r){this.view.fireCallback(this,e,t,i,a,n,r)},getFieldEl:function(){return this.field},getId:function(){return this.id},getParent:function(){return this.parent},isTopLevel:function(){return t.isEmpty(this.parent)},getValue:function(){var e=this,t=this.data;return t=e.ensureProperType(t)},setValue:function(e){this.data=e,this.updateObservable(),this.triggerUpdate()},setDefault:function(){},getTemplateDescriptor:function(){return this.templateDescriptor},setTemplateDescriptor:function(e){this.templateDescriptor=e},displayMessage:function(i){var a=this;i&&t.isObject(i)&&(i=[i]),i&&t.isString(i)&&(i=[{id:"custom",message:i}]),e(this.getFieldEl()).children(".alpaca-message").remove(),a.fireCallback("removeMessages"),i&&i.length>0&&e.each(i,function(i,n){var r=!1;a.hideInitValidationError&&(r=!0);var s=a.view.getTemplateDescriptor("message");if(s){var o=t.tmpl(s,{id:n.id,message:n.message});o.addClass("alpaca-message"),r&&o.addClass("alpaca-message-hidden"),e(a.getFieldEl()).append(o)}a.fireCallback("addMessage",i,n.id,n.message,r)})},refreshValidationState:function(e,i){var a=this,n=[],r=[],s=function(e,i){return function(a){t.compileValidationContext(e,function(e){i.push(e),a()})}};if(e){var o=function(e,t){if(e.isValidationParticipant()){if(e.children&&e.children.length>0)for(var i=0;idisplayReadonly attribute set to false, the read-only field will not appear.",type:"boolean","default":!1},required:{title:"Required",description:"Indicates whether the field's value is required. If set to true, the field must take on a valid value and cannnot be left empty or unassigned.",type:"boolean","default":!1},"default":{title:"Default",description:"The default value to be assigned for this property. If the data for the field is empty or not provided, this default value will be plugged in for you. Specify a default value when you want to pre-populate the field's value ahead of time.",type:"any"},type:{title:"Type",description:"Data type of the property.",type:"string",readonly:!0},format:{title:"Format",description:"Data format of the property.",type:"string"},disallow:{title:"Disallowed Values",description:"List of disallowed values for the property.",type:"array"},dependencies:{title:"Dependencies",description:"List of property dependencies.",type:"array"}}};return this.getType&&!t.isValEmpty(this.getType())&&(e.properties.type["default"]=this.getType(),e.properties.type["enum"]=[this.getType()]),e},getOptionsForSchema:function(){return{fields:{title:{helper:"Field short description",type:"text"},description:{helper:"Field detailed description",type:"textarea"},readonly:{helper:"Field will be read only if checked",rightLabel:"This field is read-only",type:"checkbox"},required:{helper:"Field value must be set if checked",rightLabel:"This field is required",type:"checkbox"},"default":{helper:"Field default value",type:"textarea"},type:{helper:"Field data type",type:"text"},format:{type:"select",dataSource:function(e){for(var i in t.defaultFormatFieldMapping)this.selectOptions.push({value:i,text:i});
+e()}},disallow:{helper:"Disallowed values for the field",itemLabel:"Value",type:"array"},dependencies:{helper:"Field Dependencies",multiple:!0,size:3,type:"select",dataSource:function(e,t){if(e.parent&&e.parent.schemaParent&&e.parent.schemaParent.parent)for(var i in e.parent.schemaParent.parent.childrenByPropertyId)i!=e.parent.schemaParent.propertyId&&e.selectOptions.push({value:i,text:i});t&&t()}}}}},getSchemaOfOptions:function(){var e={title:"Options for "+this.getTitle(),description:this.getDescription()+" (Options)",type:"object",properties:{form:{},id:{title:"Field Id",description:"Unique field id. Auto-generated if not provided.",type:"string"},type:{title:"Field Type",description:"Field type.",type:"string","default":this.getFieldType(),readonly:!0},validate:{title:"Validation",description:"Field validation is required if true.",type:"boolean","default":!0},showMessages:{title:"Show Messages",description:"Display validation messages if true.",type:"boolean","default":!0},disabled:{title:"Disabled",description:"Field will be disabled if true.",type:"boolean","default":!1},readonly:{title:"Readonly",description:"Field will be readonly if true.",type:"boolean","default":!1},hidden:{title:"Hidden",description:"Field will be hidden if true.",type:"boolean","default":!1},label:{title:"Label",description:"Field label.",type:"string"},helper:{title:"Helper",description:"Field help message.",type:"string"},fieldClass:{title:"CSS class",description:"Specifies one or more CSS classes that should be applied to the dom element for this field once it is rendered. Supports a single value, comma-delimited values, space-delimited values or values passed in as an array.",type:"string"},hideInitValidationError:{title:"Hide Initial Validation Errors",description:"Hide initial validation errors if true.",type:"boolean","default":!1},focus:{title:"Focus",description:"If true, the initial focus for the form will be set to the first child element (usually the first field in the form). If a field name or path is provided, then the specified child field will receive focus. For example, you might set focus to 'name' (selecting the 'name' field) or you might set it to 'client/name' which picks the 'name' field on the 'client' object.",type:"checkbox","default":!0},optionLabels:{title:"Enumerated Value Labels",description:"An array of string labels for items in the enum array",type:"array"},view:{title:"Override of the view for this field",description:"Allows for this field to be rendered with a different view (such as 'display' or 'create')",type:"string"}}};return this.isTopLevel()?e.properties.form={title:"Form",description:"Options for rendering the FORM tag.",type:"object",properties:{attributes:{title:"Form Attributes",description:"List of attributes for the FORM tag.",type:"object",properties:{id:{title:"Id",description:"Unique form id. Auto-generated if not provided.",type:"string"},action:{title:"Action",description:"Form submission endpoint",type:"string"},method:{title:"Method",description:"Form submission method","enum":["post","get"],type:"string"},rubyrails:{title:"Ruby On Rails",description:"Ruby on Rails Name Standard","enum":["true","false"],type:"string"},name:{title:"Name",description:"Form name",type:"string"},focus:{title:"Focus",description:"Focus Setting",type:"any"}}},buttons:{title:"Form Buttons",description:"Configuration for form-bound buttons",type:"object",properties:{submit:{type:"object",title:"Submit Button",required:!1},reset:{type:"object",title:"Reset button",required:!1}}},toggleSubmitValidState:{title:"Toggle Submit Valid State",description:"Toggle the validity state of the Submit button",type:"boolean","default":!0}}}:delete e.properties.form,e},getOptionsForOptions:function(){var e={type:"object",fields:{id:{type:"text",readonly:!0},type:{type:"text"},validate:{rightLabel:"Enforce validation",type:"checkbox"},showMessages:{rightLabel:"Show validation messages",type:"checkbox"},disabled:{rightLabel:"Disable this field",type:"checkbox"},hidden:{type:"checkbox",rightLabel:"Hide this field"},label:{type:"text"},helper:{type:"textarea"},fieldClass:{type:"text"},hideInitValidationError:{rightLabel:"Hide initial validation errors",type:"checkbox"},focus:{type:"checkbox",rightLabel:"Auto-focus first child field"},optionLabels:{type:"array",items:{type:"string"}},view:{type:"text"}}};return this.isTopLevel()&&(e.fields.form={type:"object",fields:{attributes:{type:"object",fields:{id:{type:"text",readonly:!0},action:{type:"text"},method:{type:"select"},name:{type:"text"}}}}}),e}}),t.registerMessages({disallowValue:"{0} are disallowed values.",notOptional:"This field is not optional."})}(jQuery),function(e){var t=e.alpaca;t.ControlField=t.Field.extend({onConstruct:function(){var t=this;this.isControlField=!0,this._getControlVal=function(i){var a=null;return this.control&&(a=e(this.control).val(),i&&(a=t.ensureProperType(a))),a}},setup:function(){var e=this;this.base();var i=e.resolveControlTemplateType();return i?void(this.controlDescriptor=this.view.getTemplateDescriptor("control-"+i,e)):t.throwErrorWithCallback("Unable to find template descriptor for control: "+e.getFieldType())},getControlEl:function(){return this.control},resolveControlTemplateType:function(){var e=this,t=!1,i=null,a=this;do if(a.getFieldType){var n=this.view.getTemplateDescriptor("control-"+a.getFieldType(),e);n?(i=a.getFieldType(),t=!0):a=a.constructor.ancestor.prototype}else t=!0;while(!t);return i},onSetup:function(){},isAutoFocusable:function(){return!0},getTemplateDescriptorId:function(){return"control"},renderFieldElements:function(i){var a=this;this.control=e(this.field).find("."+t.MARKER_CLASS_CONTROL_FIELD),this.control.removeClass(t.MARKER_CLASS_CONTROL_FIELD),a.prepareControlModel(function(e){a.beforeRenderControl(e,function(){a.renderControl(e,function(n){n&&(a.control.replaceWith(n),a.control=n,a.control.addClass(t.CLASS_CONTROL)),a.fireCallback("control"),a.afterRenderControl(e,function(){i()})})})})},prepareControlModel:function(e){var t={};t.id=this.getId(),t.name=this.name,t.options=this.options,t.schema=this.schema,t.data=this.data,t.required=this.isRequired(),e(t)},beforeRenderControl:function(e,t){t()},afterRenderControl:function(e,t){var i=this;i.firstUpdateObservableFire||"undefined"==typeof i.data||null==i.data||(i.firstUpdateObservableFire=!0,i.updateObservable()),t()},renderControl:function(e,i){var a=null;this.controlDescriptor&&(a=t.tmpl(this.controlDescriptor,e)),i(a)},postRender:function(e){this.base(function(){e()})},setDefault:function(){var e=t.isEmpty(this.schema["default"])?"":this.schema["default"];this.setValue(e)},_validateEnum:function(){if(this.schema["enum"]){var i=this.data;return i=this.getValue(),!this.isRequired()&&t.isValEmpty(i)?!0:e.inArray(i,this.schema["enum"])>-1?!0:!1}return!0},handleValidate:function(){var e=this.base(),i=this.validation,a=this._validateEnum();return i.invalidValueOfEnum={message:a?"":t.substituteTokens(this.view.getMessage("invalidValueOfEnum"),[this.schema["enum"].join(", "),this.data]),status:a},e&&i.invalidValueOfEnum.status},initEvents:function(){this.base(),this.control&&this.control.length>0&&this.initControlEvents()},initControlEvents:function(){var e=this,t=this.control;t.click(function(t){e.onClick.call(e,t),e.trigger("click",t)}),t.change(function(t){setTimeout(function(){e.onChange.call(e,t),e.triggerWithPropagation("change",t)},250)}),t.focus(function(t){e.suspendBlurFocus||(e.onFocus.call(e,t),e.trigger("focus",t))}),t.blur(function(t){e.suspendBlurFocus||(e.onBlur.call(e,t),e.trigger("blur",t))}),t.keypress(function(t){e.onKeyPress.call(e,t),e.trigger("keypress",t)}),t.keyup(function(t){e.onKeyUp.call(e,t),e.trigger("keyup",t)}),t.keydown(function(t){e.onKeyDown.call(e,t),e.trigger("keydown",t)})},onKeyPress:function(){var e=this,t=this.isValid();t||window.setTimeout(function(){e.refreshValidationState()},50)},onKeyDown:function(){},onKeyUp:function(){},onClick:function(){},disable:function(){this.base(),this.control&&this.control.length>0&&e(this.control).prop("disabled",!0)},enable:function(){this.base(),this.control&&this.control.length>0&&e(this.control).prop("disabled",!1)},getSchemaOfSchema:function(){return t.merge(this.base(),{properties:{"enum":{title:"Enumerated Values",description:"List of specific values for this property",type:"array"}}})},getOptionsForSchema:function(){return t.merge(this.base(),{fields:{"enum":{itemLabel:"Value",type:"array"}}})},getSchemaOfOptions:function(){return t.merge(this.base(),{properties:{name:{title:"Field Name",description:"Field Name.",type:"string"}}})},getOptionsForOptions:function(){return t.merge(this.base(),{fields:{name:{type:"text"}}})}}),t.registerMessages({invalidValueOfEnum:"This field should have one of the values in {0}. Current value is: {1}"})}(jQuery),function(e){var t=e.alpaca;t.ContainerField=t.Field.extend({onConstruct:function(){this.isContainerField=!0},isContainer:function(){return!0},getContainerEl:function(){return this.container},getTemplateDescriptorId:function(){return"container"},resolveContainerTemplateType:function(){var e=!1,t=null,i=this;do if(i.getFieldType){var a=this.view.getTemplateDescriptor("container-"+i.getFieldType(),this);a?(t=i.getFieldType(),e=!0):i=i.constructor.ancestor.prototype}else e=!0;while(!e);return t},setup:function(){var e=this;this.base();var i=e.resolveContainerTemplateType();if(!i)return t.throwErrorWithCallback("Unable to find template descriptor for container: "+e.getFieldType());this.containerDescriptor=this.view.getTemplateDescriptor("container-"+i,e);var a=!0;t.isEmpty(this.view.collapsible)||(a=this.view.collapsible),t.isEmpty(this.options.collapsible)||(a=this.options.collapsible),this.options.collapsible=a;var n="button";t.isEmpty(this.view.legendStyle)||(n=this.view.legendStyle),t.isEmpty(this.options.legendStyle)||(n=this.options.legendStyle),this.options.legendStyle=n,this.lazyLoading=!1,t.isEmpty(this.options.lazyLoading)||(this.lazyLoading=this.options.lazyLoading,this.lazyLoading&&(this.options.collapsed=!0)),this.children=[],this.childrenById={},this.childrenByPropertyId={},this.expandedIcon=this.view.getStyle("expandedIcon"),this.collapsedIcon=this.view.getStyle("collapsedIcon"),this.commonIcon=this.view.getStyle("commonIcon"),this.addIcon=this.view.getStyle("addIcon"),this.removeIcon=this.view.getStyle("removeIcon"),this.upIcon=this.view.getStyle("upIcon"),this.downIcon=this.view.getStyle("downIcon")},destroy:function(){this.form&&(this.form.destroy(!0),delete this.form),t.each(this.children,function(){this.destroy()}),this.base()},renderFieldElements:function(i){var a=this;this.container=e(this.field).find("."+t.MARKER_CLASS_CONTAINER_FIELD),this.container.removeClass(t.MARKER_CLASS_CONTAINER_FIELD),a.prepareContainerModel(function(e){a.beforeRenderContainer(e,function(){a.renderContainer(e,function(n){n&&(a.container.replaceWith(n),a.container=n,a.container.addClass(t.CLASS_CONTAINER)),a.container.addClass(a.view.horizontal?"alpaca-horizontal":"alpaca-vertical"),a.fireCallback("container"),a.afterRenderContainer(e,function(){i()})})})})},prepareContainerModel:function(e){var t=this,i={id:this.getId(),name:this.name,options:this.options};t.createItems(function(t){t||(t=[]),i.items=t,e(i)})},beforeRenderContainer:function(e,t){t()},renderContainer:function(e,i){var a=null;this.containerDescriptor&&(a=t.tmpl(this.containerDescriptor,e)),i(a)},afterRenderContainer:function(e,t){var i=this;i.applyCreatedItems(e,function(){i.afterApplyCreatedItems(e,function(){t()})})},postRender:function(e){this.base(function(){e()})},initEvents:function(){this.base()},createItems:function(e){e()},applyCreatedItems:function(i,a){var n=this,r=null;if(n.isTopLevel()&&n.view.getLayout()&&(r=n.view.getLayout().bindings,!r&&n.view.getLayout().templateDescriptor&&i.items.length>0)){r={};for(var s=0;s0?(e(n.container).addClass("alpaca-container-has-items"),e(n.container).attr("data-alpaca-container-item-count",i.items.length)):(e(n.container).removeClass("alpaca-container-has-items"),e(n.container).removeAttr("data-alpaca-container-item-count"));for(var s=0;s0&&(e(l.field).appendTo(p),l.domEl=p)}e(c).remove()}else{var p=e(c).parent();e(c).replaceWith(l.field),l.domEl=p}e(l.field).addClass("alpaca-container-item"),0===s&&e(l.field).addClass("alpaca-container-item-first"),s+1===i.items.length&&e(l.field).addClass("alpaca-container-item-last"),e(l.field).attr("data-alpaca-container-item-index",s),e(l.field).attr("data-alpaca-container-item-name",l.name),n.registerChild(l,s)}n.options.collapsible&&n.fireCallback("collapsible"),n.triggerUpdate(),a()},afterApplyCreatedItems:function(e,t){t()},registerChild:function(e,i){t.isEmpty(i)?this.children.push(e):this.children.splice(i,0,e),this.childrenById[e.getId()]=e,e.propertyId&&(this.childrenByPropertyId[e.propertyId]=e),e.parent=this},unregisterChild:function(e){var i=this.children[e];i&&(t.isEmpty(e)||this.children.splice(e,1),delete this.childrenById[i.getId()],i.propertyId&&delete this.childrenByPropertyId[i.propertyId],i.parent=null)},updateChildDOMElements:function(){var t=this,i=null;if(t.view.getLayout()&&(i=t.view.getLayout().bindings),!i){t.children.length>0?(e(t.getContainerEl()).addClass("alpaca-container-has-items"),e(t.getContainerEl()).attr("data-alpaca-container-item-count",t.children.length)):(e(t.getContainerEl()).removeClass("alpaca-container-has-items"),e(t.getContainerEl()).removeAttr("data-alpaca-container-item-count"));for(var a=0;a0&&(e=0),e>-1&&this.children[e].focus()},disable:function(){this.base();for(var e=0;ea;a+=1)indent+=" ";else"string"==typeof i&&(indent=i);if(rep=t,t&&"function"!=typeof t&&("object"!=typeof t||"number"!=typeof t.length))throw new Error("JSON.stringify");return this.str("",{"":e})},i.prototype.quote=function(e){var t=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g;return t.lastIndex=0,t.test(e)?'"'+e.replace(t,function(e){var t=meta[e];return"string"==typeof t?t:"\\u"+("0000"+e.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+e+'"'},i.prototype.str=function(e,t){var i,a,n,r,s,o=gap,l=t[e];switch(l&&"object"==typeof l&&"function"==typeof l.toJSON&&(l=l.toJSON(e)),"function"==typeof rep&&(l=rep.call(t,e,l)),typeof l){case"string":return this.quote(l);case"number":return isFinite(l)?String(l):"null";case"boolean":case"null":return String(l);case"object":if(!l)return"null";if(gap+=indent,s=[],"[object Array]"===Object.prototype.toString.apply(l)){for(r=l.length,i=0;r>i;i+=1)s[i]=this.str(i,l)||"null";return n=0===s.length?"[]":gap?"[\n"+gap+s.join(",\n"+gap)+"\n"+o+"]":"["+s.join(",")+"]",gap=o,n}if(rep&&"object"==typeof rep)for(r=rep.length,i=0;r>i;i+=1)a=rep[i],"string"==typeof a&&(n=this.str(a,l),n&&s.push(this.quote(a)+(gap?": ":":")+n));else for(a in l)Object.hasOwnProperty.call(l,a)&&(n=this.str(a,l),n&&s.push(this.quote(a)+(gap?": ":":")+n));return n=0===s.length?"{}":gap?"{\n"+gap+s.join(",\n"+gap)+"\n"+o+"}":"{"+s.join(",")+"}",gap=o,n}}}(jQuery),function(e){var t=e.alpaca;t.Form=Base.extend({constructor:function(e,i,a,n,r){if(this.domEl=e,this.parent=null,this.connector=n,this.errorCallback=r,this.options=i,this.attributes=this.options.attributes?this.options.attributes:{},this.options.buttons){this.options.buttons.submit&&(this.options.buttons.submit.type||(this.options.buttons.submit.type="submit"),this.options.buttons.submit.name||(this.options.buttons.submit.name="submit"),this.options.buttons.submit.value||(this.options.buttons.submit.value="Submit")),this.options.buttons.reset&&(this.options.buttons.reset.type||(this.options.buttons.reset.type="reset"),this.options.buttons.reset.name||(this.options.buttons.reset.name="reset"),this.options.buttons.reset.value||(this.options.buttons.reset.value="Reset"));for(var s in this.options.buttons)this.options.buttons[s].label&&(this.options.buttons[s].value=this.options.buttons[s].label),this.options.buttons[s].title&&(this.options.buttons[s].value=this.options.buttons[s].title),this.options.buttons[s].type||(this.options.buttons[s].type="button")}this.attributes.id?this.id=this.attributes.id:(this.id=t.generateId(),this.attributes.id=this.id),this.options.buttons&&this.options.buttons.submit&&t.isUndefined(this.options.toggleSubmitValidState)&&(this.options.toggleSubmitValidState=!0),this.viewType=i.viewType,this.view=new t.RuntimeView(a,this)},render:function(e){var t=this;this.form&&this.form.remove(),this.processRender(this.domEl,function(){t.form.appendTo(t.container),t.form.addClass("alpaca-form"),t.fireCallback("form"),e(t)})},isFormValid:function(){this.topControl.validate(!0);var e=this.topControl.isValid(!0);return e},isValid:function(){return this.isFormValid()},validate:function(e){return this.topControl.validate(e)},enableSubmitButton:function(){if(e(".alpaca-form-button-submit").attrProp("disabled",!1),e.mobile)try{e(".alpaca-form-button-submit").button("refresh")}catch(t){}},disableSubmitButton:function(){if(e(".alpaca-form-button-submit").attrProp("disabled",!0),e.mobile)try{e(".alpaca-form-button-submit").button("refresh")}catch(t){}},adjustSubmitButtonState:function(){this.disableSubmitButton(),this.isFormValid()&&this.enableSubmitButton()},processRender:function(i,a){var n=this;if(this.formDescriptor=this.view.getTemplateDescriptor("form"),!this.formDescriptor)return t.throwErrorWithCallback("Could not find template descriptor: form");var r=t.tmpl(this.formDescriptor,{id:this.getId(),options:this.options,view:this.view});r.appendTo(i),this.form=r,this.formFieldsContainer=e(this.form).find("."+t.MARKER_CLASS_FORM_ITEMS_FIELD),this.formFieldsContainer.removeClass(t.MARKER_CLASS_FORM_ITEMS_FIELD),t.isEmpty(this.form.attr("id"))&&this.form.attr("id",this.getId()+"-form-outer"),t.isEmpty(this.form.attr("alpaca-field-id"))&&this.form.attr("alpaca-field-id",this.getId()),i.find("form").attr(this.attributes),this.buttons={},e(i).find(".alpaca-form-button").each(function(){e(this).click(function(){e(this).attr("button-pushed",!0)});var t=e(this).attr("data-key");if(t){var i=n.options.buttons[t];i&&i.click&&e(this).click(function(e,t){return function(i){i.preventDefault(),t.call(e,i)}}(n,i.click))}}),a()},getId:function(){return this.id},getType:function(){return this.type},getParent:function(){return this.parent},getValue:function(){return this.topControl.getValue()},setValue:function(e){this.topControl.setValue(e)},initEvents:function(){var t=this,i=e(this.domEl).find("form"),a=this.getValue();e(i).submit(a,function(e){return t.onSubmit(e,t)}),this.options.toggleSubmitValidState&&(e(t.topControl.getFieldEl()).bind("fieldupdate",function(){t.adjustSubmitButtonState()}),this.adjustSubmitButtonState())},getButtonEl:function(t){return e(this.domEl).find(".alpaca-form-button-"+t)},onSubmit:function(e,i){if(this.submitHandler){e.stopPropagation();var a=this.submitHandler(e,i);return t.isUndefined(a)&&(a=!1),a}},registerSubmitHandler:function(e){t.isFunction(e)&&(this.submitHandler=e)},refreshValidationState:function(e,t){this.topControl.refreshValidationState(e,t)},disable:function(){this.topControl.disable()},enable:function(){this.topControl.enable()},focus:function(){this.topControl.focus()},destroy:function(e){this.getFieldEl().remove(),!e&&this.parent&&this.parent.destroy()},show:function(){this.getFieldEl().css({display:""})},hide:function(){this.getFieldEl().css({display:"none"})},clear:function(e){this.topControl.clear(e)},isEmpty:function(){return this.topControl.isEmpty()},fireCallback:function(e,t,i,a,n,r){this.view.fireCallback(this,e,t,i,a,n,r)},getFormEl:function(){return this.form},submit:function(){this.form.submit()},ajaxSubmit:function(){var t=this;return e.ajax({data:this.getValue(),url:t.options.attributes.action,type:t.options.attributes.method,dataType:"json"})}})}(jQuery),function(e){var t=e.alpaca;t.Fields.TextField=t.ControlField.extend({getFieldType:function(){return"text"},setup:function(){this.base(),this.options.size||(this.options.size=40),this.inputType||(this.inputType="text"),this.options.inputType&&(this.inputType=this.options.inputType),this.options.data||(this.options.data={}),this.options.attributes||(this.options.attributes={}),"undefined"==typeof this.options.allowOptionalEmpty&&(this.options.allowOptionalEmpty=!0)},destroy:function(){this.base(),this.control&&this.control.typeahead&&this.options.typeahead&&e(this.control).typeahead("destroy")},postRender:function(e){var t=this;this.base(function(){t.control&&(t.applyMask(),t.applyTypeAhead(),t.updateMaxLengthIndicator()),e()})},applyMask:function(){var e=this;e.control.mask&&e.options.maskString&&e.control.mask(e.options.maskString)},applyTypeAhead:function(){var i=this;if(i.control.typeahead&&i.options.typeahead&&!t.isEmpty(i.options.typeahead)){var a=i.options.typeahead.config;a||(a={});var n=i.options.typeahead.datasets;n||(n={}),n.name||(n.name=i.getId());var r=i.options.typeahead.events;if(r||(r={}),"local"===n.type||"remote"===n.type||"prefetch"===n.type){var s={datumTokenizer:function(e){return Bloodhound.tokenizers.whitespace(e.value)},queryTokenizer:Bloodhound.tokenizers.whitespace};if("local"===n.type){var o=[];if("function"==typeof n.source)s.local=n.source;else{for(var l=0;l
"),e(i.control).after(a));var n=!1,r="";if(!t.isEmpty(i.schema.maxLength)&&i.options.showMaxLengthIndicator){var s=i.getValue()||"",o=i.schema.maxLength-s.length;o>=0?r="You have "+o+" characters remaining":(r="Your message is too long by "+-1*o+" characters",n=!0),e(a).html(r),e(a).removeClass("err"),n&&e(a).addClass("err")}},getValue:function(){var t=this,i=null;if(!this.isDisplayOnly()&&this.control&&this.control.length>0){if(i=this._getControlVal(!0),t.control.mask&&t.options.maskString){var a=e(this.control).data(e.mask.dataName);a&&(i=a(),i=t.ensureProperType(i))}}else i=this.base();return i},setValue:function(e){this.control&&this.control.length>0&&this.control.val(t.isEmpty(e)?"":e),this.base(e),this.updateMaxLengthIndicator()},handleValidate:function(){var e=this.base(),i=this.validation,a=this._validatePattern();return i.invalidPattern={message:a?"":t.substituteTokens(this.view.getMessage("invalidPattern"),[this.schema.pattern]),status:a},a=this._validateMaxLength(),i.stringTooLong={message:a?"":t.substituteTokens(this.view.getMessage("stringTooLong"),[this.schema.maxLength]),status:a},a=this._validateMinLength(),i.stringTooShort={message:a?"":t.substituteTokens(this.view.getMessage("stringTooShort"),[this.schema.minLength]),status:a},e&&i.invalidPattern.status&&i.stringTooLong.status&&i.stringTooShort.status},_validatePattern:function(){if(this.schema.pattern){var e=this.getValue();if(""===e&&this.options.allowOptionalEmpty&&!this.isRequired())return!0;if(t.isEmpty(e)&&(e=""),!e.match(this.schema.pattern))return!1}return!0},_validateMinLength:function(){if(!t.isEmpty(this.schema.minLength)){var e=this.getValue();if(""===e&&this.options.allowOptionalEmpty&&!this.isRequired())return!0;if(t.isEmpty(e)&&(e=""),e.lengththis.schema.maxLength)return!1}return!0},focus:function(){if(this.control&&this.control.length>0){var t=e(this.control).get(0);try{var i=t.value?t.value.length:0;t.selectionStart=i,t.selectionEnd=i}catch(a){}t.focus()}},getType:function(){return"string"},onKeyDown:function(e){var i=this;if(8===e.keyCode){if(!t.isEmpty(i.schema.minLength)&&(i.options.constrainLengths||i.options.constrainMinLength)){var a=i.getValue()||"";a.length<=i.schema.minLength&&(e.preventDefault(),e.stopImmediatePropagation())}}else if(!t.isEmpty(i.schema.maxLength)&&(i.options.constrainLengths||i.options.constrainMaxLength)){var a=i.getValue()||"";a.length>=i.schema.maxLength&&(e.preventDefault(),e.stopImmediatePropagation())}},onKeyUp:function(){var e=this;e.updateMaxLengthIndicator()},getTitle:function(){return"Single-Line Text"},getDescription:function(){return"Text field for single-line text."},getSchemaOfSchema:function(){return t.merge(this.base(),{properties:{minLength:{title:"Minimal Length",description:"Minimal length of the property value.",type:"number"},maxLength:{title:"Maximum Length",description:"Maximum length of the property value.",type:"number"},pattern:{title:"Pattern",description:"Regular expression for the property value.",type:"string"}}})},getOptionsForSchema:function(){return t.merge(this.base(),{fields:{"default":{helper:"Field default value",type:"text"},minLength:{type:"integer"},maxLength:{type:"integer"},pattern:{type:"text"}}})},getSchemaOfOptions:function(){return t.merge(this.base(),{properties:{size:{title:"Field Size",description:"Field size.",type:"number","default":40},maskString:{title:"Mask Expression",description:"Expression for the field mask. Field masking will be enabled if not empty.",type:"string"},placeholder:{title:"Field Placeholder",description:"Field placeholder.",type:"string"},typeahead:{title:"Type Ahead",description:"Provides configuration for the $.typeahead plugin if it is available. For full configuration options, see: https://github.com/twitter/typeahead.js"},allowOptionalEmpty:{title:"Allow Optional Empty",description:"Allows this non-required field to validate when the value is empty"},inputType:{title:"HTML5 Input Type",description:"Allows for the override of the underlying HTML5 input type. If not specified, an assumed value is provided based on the kind of input control (i.e. 'text', 'date', 'email' and so forth)",type:"string"},data:{title:"Data attributes for the underlying DOM input control",description:"Allows you to specify a key/value map of data attributes that will be added as DOM attribuets for the underlying input control. The data attributes will be added as data-{name}='{value}'.",type:"object"}}})
+},getOptionsForOptions:function(){return t.merge(this.base(),{fields:{size:{type:"integer"},maskString:{helper:"a - an alpha character;9 - a numeric character;* - an alphanumeric character",type:"text"},typeahead:{type:"object"},allowOptionalEmpty:{type:"checkbox"},inputType:{type:"string"},data:{type:"object"}}})}}),t.registerMessages({invalidPattern:"This field should have pattern {0}",stringTooShort:"This field should contain at least {0} numbers or characters",stringTooLong:"This field should contain at most {0} numbers or characters"}),t.registerFieldClass("text",t.Fields.TextField),t.registerDefaultSchemaFieldMapping("string","text")}(jQuery),function(e){var t=e.alpaca;t.Fields.TextAreaField=t.Fields.TextField.extend({getFieldType:function(){return"textarea"},setup:function(){this.base(),this.options.rows||(this.options.rows=5),this.options.cols||(this.options.cols=40)},handleValidate:function(){var e=this.base(),i=this.validation,a=this._validateWordCount();return i.wordLimitExceeded={message:a?"":t.substituteTokens(this.view.getMessage("wordLimitExceeded"),[this.options.wordlimit]),status:a},e&&i.wordLimitExceeded.status},_validateWordCount:function(){if(this.options.wordlimit&&this.options.wordlimit>-1){var e=this.data;if(e){var t=e.split(" ").length;if(t>this.options.wordlimit)return!1}}return!0},getTitle:function(){return"Multi-Line Text"},getDescription:function(){return"Textarea field for multiple line text."},getSchemaOfOptions:function(){return t.merge(this.base(),{properties:{rows:{title:"Rows",description:"Number of rows",type:"number","default":5},cols:{title:"Columns",description:"Number of columns",type:"number","default":40},wordlimit:{title:"Word Limit",description:"Limits the number of words allowed in the text area.",type:"number","default":-1}}})},getOptionsForOptions:function(){return t.merge(this.base(),{fields:{rows:{type:"integer"},cols:{type:"integer"},wordlimit:{type:"integer"}}})}}),t.registerMessages({wordLimitExceeded:"The maximum word limit of {0} has been exceeded."}),t.registerFieldClass("textarea",t.Fields.TextAreaField)}(jQuery),function(e){var t=e.alpaca;t.Fields.CheckBoxField=t.ControlField.extend({getFieldType:function(){return"checkbox"},setup:function(){var i=this;i.base(),this.options.rightLabel||(this.options.rightLabel=""),"undefined"==typeof i.options.multiple&&("array"===i.schema.type?i.options.multiple=!0:"undefined"!=typeof i.schema["enum"]&&(i.options.multiple=!0)),i.checkboxOptions=[],i.options.multiple&&e.each(i.getEnum(),function(e,a){var n=a;i.options.optionLabels&&(t.isEmpty(i.options.optionLabels[e])?t.isEmpty(i.options.optionLabels[a])||(n=i.options.optionLabels[a]):n=i.options.optionLabels[e]),i.checkboxOptions.push({value:a,text:n})})},getEnum:function(){var e=[];return this.schema&&this.schema["enum"]&&(e=this.schema["enum"]),e},onClick:function(){this.refreshValidationState()},prepareControlModel:function(e){var t=this;this.base(function(i){i.checkboxOptions=t.checkboxOptions,e(i)})},postRender:function(t){var i=this;this.base(function(){if(i.data&&"undefined"!=typeof i.data&&i.setValue(i.data),e(i.getFieldEl()).find("input:checkbox").change(function(){i.triggerWithPropagation("change")}),i.options.multiple&&(e(i.getFieldEl()).find("input:checkbox").prop("checked",!1),i.data)){var a=i.data;if("string"==typeof i.data){a=i.data.split(",");for(var n=0;n0?t.checked(e(l[0])):!1}return a},setValue:function(i){var a=this,n=function(i){t.isString(i)&&(i="true"===i);var n=e(a.getFieldEl()).find("input");n.length>0&&t.checked(e(n[0]),i)},r=function(n){"string"==typeof n&&(n=n.split(","));for(var r=0;r0&&t.checked(e(o[0]),i)}},s=!1;a.options.multiple?"string"==typeof i?(r(i),s=!0):t.isArray(i)&&(r(i),s=!0):"boolean"==typeof i?(n(i),s=!0):"string"==typeof i&&(n(i),s=!0),!s&&i&&t.logError("CheckboxField cannot set value for schema.type="+a.schema.type+" and value="+i),this.base(i)},_validateEnum:function(){var e=this;if(!e.options.multiple)return!0;var i=e.getValue();return!e.isRequired()&&t.isValEmpty(i)?!0:("string"==typeof i&&(i=i.split(",")),t.anyEquality(i,e.schema["enum"]))},disable:function(){e(this.control).find("input").each(function(){e(this).disabled=!0})},enable:function(){e(this.control).find("input").each(function(){e(this).disabled=!1})},getType:function(){return"boolean"},getTitle:function(){return"Checkbox Field"},getDescription:function(){return"Checkbox Field for boolean (true/false), string ('true', 'false' or comma-delimited string of values) or data array."},getSchemaOfOptions:function(){return t.merge(this.base(),{properties:{rightLabel:{title:"Option Label",description:"Optional right-hand side label for single checkbox field.",type:"string"},multiple:{title:"Multiple",description:"Whether to render multiple checkboxes for multi-valued type (such as an array or a comma-delimited string)",type:"boolean"}}})},getOptionsForOptions:function(){return t.merge(this.base(),{fields:{rightLabel:{type:"text"},multiple:{type:"checkbox"}}})}}),t.registerFieldClass("checkbox",t.Fields.CheckBoxField),t.registerDefaultSchemaFieldMapping("boolean","checkbox")}(jQuery),function(e){var t=e.alpaca;t.Fields.FileField=t.Fields.TextField.extend({getFieldType:function(){return"file"},setValue:function(e){this.data=e,this.data=e,this.updateObservable(),this.triggerUpdate()},getValue:function(){return this.data},onChange:function(e){this.base(e),this.options.selectionHandler&&this.processSelectionHandler(e.target.files)},processSelectionHandler:function(e){if(e&&e.length>0&&"undefined"!=typeof FileReader){var t=[],i=0,a=new FileReader;a.onload=function(){var a=this;return function(n){var r=n.target.result;t.push(r),i++,i===e.length&&a.options.selectionHandler.call(a,e,t)}}.call(this);for(var n=0;n0&&(i.data=i.schema.enum[0])},prepareControlModel:function(e){var t=this;this.base(function(i){i.noneLabel="-","undefined"!=typeof t.options.noneLabel&&(i.noneLabel=t.options.noneLabel),i.hideNone=t.isRequired(),"undefined"!=typeof t.options.removeDefaultNone&&(i.hideNone=t.options.removeDefaultNone),e(i)})},getEnum:function(){return this.schema&&this.schema["enum"]?this.schema["enum"]:void 0},getValue:function(i){var a=this;return t.isArray(i)?e.each(i,function(t,n){e.each(a.selectOptions,function(e,a){a.value===n&&(i[t]=a.value)})}):e.each(this.selectOptions,function(e,t){t.value===i&&(i=t.value)}),i},beforeRenderControl:function(i,a){var n=this;this.base(i,function(){if(n.options.dataSource){n.selectOptions=[];var r=function(){n.schema.enum=[],n.options.optionLabels=[];for(var e=0;e0&&(n.data=n.selectOptions[0].value,0===e("input:radio:checked",n.control).length&&t.checked(e(n.control).find("input:radio").first(),"checked")),n.options.vertical&&e(".alpaca-controlfield-radio-item",n.control).css("display","block"),a()})},onClick:function(t){this.base(t);var i=this,a=e(t.currentTarget).find("input").val();"undefined"!=typeof a&&(i.setValue(a),i.refreshValidationState())},getTitle:function(){return"Radio Group Field"},getDescription:function(){return"Radio Group Field with list of options."},getSchemaOfOptions:function(){return t.merge(this.base(),{properties:{name:{title:"Field name",description:"Field name.",type:"string"},emptySelectFirst:{title:"Empty Select First",description:"If the data is empty, then automatically select the first item in the list.",type:"boolean","default":!1},vertical:{title:"Position the radio selector items vertically",description:"When true, the radio selector items will be stacked vertically and not horizontally",type:"boolean","default":!1}}})}}),t.registerFieldClass("radio",t.Fields.RadioField)}(jQuery),function(e){var t=e.alpaca;t.Fields.SelectField=t.Fields.ListField.extend({getFieldType:function(){return"select"},setup:function(){this.base(),t.isUndefined(this.options.emptySelectFirst)&&(this.options.emptySelectFirst=!1)},getValue:function(){if(this.control&&this.control.length>0){var e=this._getControlVal(!0);return"undefined"==typeof e&&(e=this.data),this.base(e)}},setValue:function(e){t.isArray(e)?t.compareArrayContent(e,this.getValue())||(!t.isEmpty(e)&&this.control&&this.control.val(e),this.base(e)):e!==this.getValue()&&(this.control&&"undefined"!=typeof e&&null!=e&&this.control.val(e),this.base(e))},getEnum:function(){if(this.schema){if(this.schema["enum"])return this.schema["enum"];if(this.schema.type&&"array"===this.schema.type&&this.schema.items&&this.schema.items["enum"])return this.schema.items["enum"]}},initControlEvents:function(){var e=this;if(e.base(),e.options.multiple){var t=this.control.parent().find("button.multiselect");t.focus(function(t){e.suspendBlurFocus||(e.onFocus.call(e,t),e.trigger("focus",t))}),t.blur(function(t){e.suspendBlurFocus||(e.onBlur.call(e,t),e.trigger("blur",t))})}},beforeRenderControl:function(e,t){var i=this;this.base(e,function(){i.schema.type&&"array"===i.schema.type&&(i.options.multiple=!0),t()})},prepareControlModel:function(e){var t=this;this.base(function(i){i.selectOptions=t.selectOptions,e(i)})},afterRenderControl:function(i,a){var n=this;this.base(i,function(){if(t.isUndefined(n.data)&&n.options.emptySelectFirst&&n.selectOptions&&n.selectOptions.length>0&&(n.data=n.selectOptions[0].value),n.data&&n.setValue(n.data),n.options.multiple&&e.fn.multiselect){var i=null;i=n.options.multiselect?n.options.multiselect:{},i.nonSelectedText||(i.nonSelectedText="None",n.options.noneLabel&&(i.nonSelectedText=n.options.noneLabel)),n.options.hideNone&&delete i.nonSelectedText,e(n.getControlEl()).multiselect(i)}a()})},_validateEnum:function(){var i=this;if(this.schema["enum"]){var a=this.data;if(!this.isRequired()&&t.isValEmpty(a))return!0;if(this.options.multiple){var n=!0;return a||(a=[]),t.isArray(a)||t.isObject(a)||(a=[a]),e.each(a,function(t,a){return e.inArray(a,i.schema["enum"])<=-1?(n=!1,!1):void 0}),n}return e.inArray(a,this.schema["enum"])>-1}return!0},onChange:function(e){this.base(e);var i=this;t.later(25,this,function(){var e=i.getValue();i.setValue(e),i.refreshValidationState()})},_validateMinItems:function(){return this.schema.items&&this.schema.items.minItems&&e(":selected",this.control).lengththis.schema.items.maxItems?!1:!0},handleValidate:function(){var e=this.base(),i=this.validation,a=this._validateMaxItems();return i.tooManyItems={message:a?"":t.substituteTokens(this.view.getMessage("tooManyItems"),[this.schema.items.maxItems]),status:a},a=this._validateMinItems(),i.notEnoughItems={message:a?"":t.substituteTokens(this.view.getMessage("notEnoughItems"),[this.schema.items.minItems]),status:a},e&&i.tooManyItems.status&&i.notEnoughItems.status},getTitle:function(){return"Select Field"},getDescription:function(){return"Select Field"},getSchemaOfOptions:function(){return t.merge(this.base(),{properties:{multiple:{title:"Mulitple Selection",description:"Allow multiple selection if true.",type:"boolean","default":!1},size:{title:"Displayed Options",description:"Number of options to be shown.",type:"number"},emptySelectFirst:{title:"Empty Select First",description:"If the data is empty, then automatically select the first item in the list.",type:"boolean","default":!1},multiselect:{title:"Multiselect Plugin Settings",description:"Multiselect plugin properties - http://davidstutz.github.io/bootstrap-multiselect",type:"any"}}})},getOptionsForOptions:function(){return t.merge(this.base(),{fields:{multiple:{rightLabel:"Allow multiple selection ?",helper:"Allow multiple selection if checked",type:"checkbox"},size:{type:"integer"},emptySelectFirst:{type:"checkbox",rightLabel:"Empty Select First"},multiselect:{type:"object",rightLabel:"Multiselect plugin properties - http://davidstutz.github.io/bootstrap-multiselect"}}})}}),t.registerFieldClass("select",t.Fields.SelectField)}(jQuery),function(e){var t=e.alpaca;t.Fields.NumberField=t.Fields.TextField.extend({setup:function(){this.base()},getFieldType:function(){return"number"},getValue:function(){var e=this._getControlVal(!0);return"undefined"==typeof e||""==e?e:parseFloat(e)},handleValidate:function(){var e=this.base(),i=this.validation,a=this._validateNumber();return i.stringNotANumber={message:a?"":this.view.getMessage("stringNotANumber"),status:a},a=this._validateDivisibleBy(),i.stringDivisibleBy={message:a?"":t.substituteTokens(this.view.getMessage("stringDivisibleBy"),[this.schema.divisibleBy]),status:a},a=this._validateMaximum(),i.stringValueTooLarge={message:"",status:a},a||(i.stringValueTooLarge.message=this.schema.exclusiveMaximum?t.substituteTokens(this.view.getMessage("stringValueTooLargeExclusive"),[this.schema.maximum]):t.substituteTokens(this.view.getMessage("stringValueTooLarge"),[this.schema.maximum])),a=this._validateMinimum(),i.stringValueTooSmall={message:"",status:a},a||(i.stringValueTooSmall.message=this.schema.exclusiveMinimum?t.substituteTokens(this.view.getMessage("stringValueTooSmallExclusive"),[this.schema.minimum]):t.substituteTokens(this.view.getMessage("stringValueTooSmall"),[this.schema.minimum])),a=this._validateMultipleOf(),i.stringValueNotMultipleOf={message:"",status:a},a||(i.stringValueNotMultipleOf.message=t.substituteTokens(this.view.getMessage("stringValueNotMultipleOf"),[this.schema.multipleOf])),e&&i.stringNotANumber.status&&i.stringDivisibleBy.status&&i.stringValueTooLarge.status&&i.stringValueTooSmall.status&&i.stringValueNotMultipleOf.status},_validateNumber:function(){var e=this._getControlVal();if("number"==typeof e&&(e=""+e),t.isValEmpty(e))return!0;var i=t.testRegex(t.regexps.number,e);if(!i)return!1;var a=this.getValue();return isNaN(a)?!1:!0},_validateDivisibleBy:function(){var e=this.getValue();return t.isEmpty(this.schema.divisibleBy)||e%this.schema.divisibleBy===0?!0:!1},_validateMaximum:function(){var e=this.getValue();if(!t.isEmpty(this.schema.maximum)){if(e>this.schema.maximum)return!1;if(!t.isEmpty(this.schema.exclusiveMaximum)&&e==this.schema.maximum&&this.schema.exclusiveMaximum)return!1}return!0},_validateMinimum:function(){var e=this.getValue();if(!t.isEmpty(this.schema.minimum)){if(ea?(n.setValue(e[a]),a++):i.removeItem(a)}while(a");return l.alpaca({data:r,options:n,schema:a,view:this.view.id?this.view.id:this.view,connector:this.connector,error:function(e){o.destroy(),o.errorCallback.call(_this,e)},notTopLevel:!0,render:function(e,t){e.parent=o,e.path=o.path+"["+i+"]",e.render(null,function(){o.refreshValidationState(),o.updatePathAndName(),o.triggerUpdate(),t&&t()})},postRender:function(e){t.isFunction(o.options.items.postRender)&&o.options.items.postRender(l),s&&s(e)}}),l}},resolveItemSchemaOptions:function(e){var i,a=this;a.options&&a.options.fields&&a.options.fields.item&&(i=a.options.fields.item);var n;if(a.schema&&a.schema.items&&(n=a.schema.items),n&&n.$ref){for(var r=n.$ref,s=this,o=[s];s.parent;)s=s.parent,o.push(s);var l=n,c=i;t.loadRefSchemaOptions(s,r,function(i,a){for(var n=0,s=0;s1,p={};l&&t.mergeObject(p,l),i&&t.mergeObject(p,i),delete p.id;var u={};c&&t.mergeObject(u,c),a&&t.mergeObject(u,a),e(p,u,d)})}else e(n,i)},handleValidate:function(){var e=this.base(),i=this.validation,a=this._validateUniqueItems();return i.valueNotUnique={message:a?"":this.view.getMessage("valueNotUnique"),status:a},a=this._validateMaxItems(),i.tooManyItems={message:a?"":t.substituteTokens(this.view.getMessage("tooManyItems"),[this.schema.items.maxItems]),status:a},a=this._validateMinItems(),i.notEnoughItems={message:a?"":t.substituteTokens(this.view.getMessage("notEnoughItems"),[this.schema.items.minItems]),status:a},e&&i.valueNotUnique.status&&i.tooManyItems.status&&i.notEnoughItems.status},_validateEqualMaxItems:function(){return this.schema.items&&this.schema.items.maxItems&&this.getSize()>=this.schema.items.maxItems?!1:!0},_validateEqualMinItems:function(){return this.schema.items&&this.schema.items.minItems&&this.getSize()<=this.schema.items.minItems?!1:!0},_validateMinItems:function(){return this.schema.items&&this.schema.items.minItems&&this.getSize()this.schema.items.maxItems?!1:!0},_validateUniqueItems:function(){if(this.schema.items&&this.schema.uniqueItems)for(var e={},t=0,i=this.children.length;i>t;++t){if(e.hasOwnProperty(this.children[t]))return!1;e[this.children[t]]=!0}return!0},findAction:function(t,i){var a=null;return e.each(t,function(e,t){t.action==i&&(a=t)}),a},postRender:function(e){var t=this;this.base(function(){t.updateToolbars(),e()})},getSize:function(){return this.children.length},updatePathAndName:function(){var i=function(a){a.children&&e.each(a.children,function(n,r){a.prePath&&t.startsWith(r.path,a.prePath)&&(r.prePath=r.path,r.path=r.path.replace(a.prePath,a.path)),a.preName&&t.startsWith(r.name,a.preName)&&(r.preName=r.name,r.name=r.name.replace(a.preName,a.name),r.field&&e(r.field).attr("name",r.name)),i(r)})};this.children&&this.children.length>0&&e.each(this.children,function(t,a){var n=a.path.lastIndexOf("/"),r=a.path.substring(n+1);r.indexOf("[")<0&&r.indexOf("]")<0&&(r=r.substring(r.indexOf("[")+1,r.indexOf("]"))),r!==t&&(a.prePath=a.path,a.path=a.path.substring(0,n)+"/["+t+"]"),a.nameCalculated&&(a.preName=a.name,a.parent&&a.parent.name&&a.path?a.name=a.parent.name+"_"+t:a.path&&(a.name=a.path.replace(/\//g,"").replace(/\[/g,"_").replace(/\]/g,"")),this.parent.options.rubyrails?e(a.field).attr("name",a.parent.name):e(a.field).attr("name",a.name)),a.prePath||(a.prePath=a.path),i(a)})},updateToolbars:function(){var t=this;if("display"!==this.view.type&&!this.schema.readonly){t.toolbar&&(t.fireCallback("arrayToolbar",!0),t.fireCallback("arrayToolbar")),t.actionbar&&(t.fireCallback("arrayActionbars",!0),t.fireCallback("arrayActionbars"));var i=e(this.getFieldEl()).find(".alpaca-array-toolbar[data-alpaca-array-toolbar-field-id='"+t.getId()+"']");if(this.children.length>0?e(i).hide():(e(i).show(),e(i).find("[data-alpaca-array-toolbar-action]").each(function(){var i=e(this).attr("data-alpaca-array-toolbar-action"),a=t.findAction(t.toolbar.actions,i);a&&e(this).off().click(function(e){e.preventDefault(),a.click.call(t,i,a)})})),this.options.toolbarSticky)e(t.getFieldEl()).find(".alpaca-array-actionbar[data-alpaca-array-actionbar-field-id='"+t.getId()+"']").show();else{var a=this.getFieldEl().find(".alpaca-container-item");e(a).each(function(i){var a=e(t.getFieldEl()).find(".alpaca-array-actionbar[data-alpaca-array-actionbar-field-id='"+t.getId()+"'][data-alpaca-array-actionbar-item-index='"+i+"']");a&&a.length>0&&(e(this).hover(function(){e(a).show()},function(){e(a).hide()}),e(a).hide())})}var n=e(this.getFieldEl()).find(".alpaca-array-actionbar[data-alpaca-array-actionbar-field-id='"+t.getId()+"']");e(n).each(function(){var i=e(this).attr("data-alpaca-array-actionbar-item-index");"string"==typeof i&&(i=parseInt(i,10)),e(this).find("[data-alpaca-array-actionbar-action]").each(function(){var a=e(this).attr("data-alpaca-array-actionbar-action"),n=t.findAction(t.actionbar.actions,a);n&&e(this).off().click(function(e){e.preventDefault(),n.click.call(t,a,n,i)})}),e(this).find("[data-alpaca-array-actionbar-action='add']").each(t._validateEqualMaxItems()?function(){e(this).removeClass("alpaca-button-disabled"),t.fireCallback("enableButton",this)}:function(){e(this).addClass("alpaca-button-disabled"),t.fireCallback("disableButton",this)}),e(this).find("[data-alpaca-array-actionbar-action='remove']").each(t._validateEqualMinItems()?function(){e(this).removeClass("alpaca-button-disabled"),t.fireCallback("enableButton",this)
+}:function(){e(this).addClass("alpaca-button-disabled"),t.fireCallback("disableButton",this)})}),e(n).first().find("[data-alpaca-array-actionbar-action='up']").each(function(){e(this).addClass("alpaca-button-disabled"),t.fireCallback("disableButton",this)}),e(n).last().find("[data-alpaca-array-actionbar-action='down']").each(function(){e(this).addClass("alpaca-button-disabled"),t.fireCallback("disableButton",this)})}},addItem:function(t,i,a,n,r){var s=this;s._validateEqualMaxItems()&&s.createItem(t,i,a,n,function(i){if(s.registerChild(i,t),0===t)e(s.container).append(i.getFieldEl());else{var a=s.getContainerEl().children("[data-alpaca-container-item-index='"+(t-1)+"']");a&&a.length>0&&a.after(i.getFieldEl())}s.updateChildDOMElements(),s.updateToolbars(),s.refreshValidationState(),s.triggerUpdate(),r&&r()})},removeItem:function(e,t){var i=this;this._validateEqualMinItems()&&(i.unregisterChild(e),i.getContainerEl().children("[data-alpaca-container-item-index='"+e+"']").remove(),i.updateChildDOMElements(),i.updateToolbars(),i.refreshValidationState(),i.triggerUpdate(),t&&t())},moveItem:function(i,a,n,r){var s=this;if("function"==typeof n&&(r=n,n=s.options.animate),"undefined"==typeof n&&(n=s.options.animate?s.options.animate:!0),"string"==typeof i&&(i=parseInt(i,10)),"string"==typeof a&&(a=parseInt(a,10)),0>a&&(a=0),a>=s.children.length&&(a=s.children.length-1),-1!==a&&i!==a){var o=s.children[a];if(o){var l=s.getContainerEl().children("[data-alpaca-container-item-index='"+i+"']"),c=s.getContainerEl().children("[data-alpaca-container-item-index='"+a+"']"),d=e("
");l.before(d);var p=e("
");c.before(p);var u=function(){for(var t=[],n=0;n0&&t.logDebug("There were "+i.length+" extra data keys that were not part of the schema "+JSON.stringify(i)),e(a)},l=[];for(var c in s){var d=null;i.data&&(d=i.data[c]);var p=function(e,n,r){return function(s){i.resolvePropertySchemaOptions(e,function(o,l,c){return c?t.throwErrorWithCallback("Circular reference detected for schema: "+o,i.errorCallback):(o||t.logDebug("Unable to resolve schema for property: "+e),void i.createItem(e,o,l,n,null,function(i){a.push(i),delete r[e],t.nextTick(function(){s()})}))})}}(c,d,n);l.push(p)}t.series(l,function(){o()})},createItem:function(t,i,a,n,r,s){var o=this,l=e("
");l.alpaca({data:n,options:a,schema:i,view:this.view.id?this.view.id:this.view,connector:this.connector,error:function(e){o.destroy(),o.errorCallback.call(o,e)},notTopLevel:!0,render:function(e,i){e.parent=o,e.propertyId=t,e.path="/"!==o.path?o.path+"/"+t:o.path+t,e.render(null,function(){i()})},postRender:function(e){s&&s(e)}})},resolvePropertySchemaOptions:function(e,i){var a=this,n=null;a.schema&&a.schema.properties&&a.schema.properties[e]&&(n=a.schema.properties[e]);var r={};if(a.options&&a.options.fields&&a.options.fields[e]&&(r=a.options.fields[e]),n&&n.$ref){for(var s=n.$ref,o=this,l=[o];o.parent;)o=o.parent,l.push(o);var c=n,d=r;t.loadRefSchemaOptions(o,s,function(e,a){for(var n=0,r=0;r1,p={};c&&t.mergeObject(p,c),e&&t.mergeObject(p,e),c&&c.id&&(p.id=c.id);var u={};d&&t.mergeObject(u,d),a&&t.mergeObject(u,a),t.nextTick(function(){i(p,u,o)})})}else t.nextTick(function(){i(n,r)})},applyCreatedItems:function(e,t){var i=this;this.base(e,function(){var a=function(n){if(n===e.items.length)return void t();var r=e.items[n],s=r.propertyId;i.showOrHidePropertyBasedOnDependencies(s),i.bindDependencyFieldUpdateEvent(s),i.refreshDependentFieldStates(s),a(n+1)};a(0)})},handleValidate:function(){var e=this.base(),i=this.validation,a=this._validateMaxProperties();return i.tooManyProperties={message:a?"":t.substituteTokens(this.view.getMessage("tooManyProperties"),[this.schema.maxProperties]),status:a},a=this._validateMinProperties(),i.tooFewProperties={message:a?"":t.substituteTokens(this.view.getMessage("tooManyItems"),[this.schema.items.minProperties]),status:a},e&&i.tooManyProperties.status&&i.tooFewProperties.status},_validateMaxProperties:function(){if("undefined"==typeof this.schema.maxProperties)return!0;var e=this.schema.maxProperties,t=0;for(var i in this.data)t++;return e>=t},_validateMinProperties:function(){if("undefined"==typeof this.schema.minProperties)return!0;var e=this.schema.minProperties,t=0;for(var i in this.data)t++;return t>=e},showOrHidePropertyBasedOnDependencies:function(e){var i=this,a=this.childrenByPropertyId[e];if(!a)return t.throwErrorWithCallback("Missing property: "+e,i.errorCallback);var n=this.determineAllDependenciesValid(e);n?(a.show(),a.onDependentReveal()):(a.hide(),a.onDependentConceal()),a.getFieldEl().trigger("fieldupdate")},determineAllDependenciesValid:function(i){var a=this,n=this.childrenByPropertyId[i];if(!n)return t.throwErrorWithCallback("Missing property: "+i,a.errorCallback);var r=n.schema.dependencies;if(!r)return!0;var s=!0;return t.isString(r)?s=a.determineSingleDependencyValid(i,r):t.isArray(r)&&e.each(r,function(e,t){s=s&&a.determineSingleDependencyValid(i,t)}),s},bindDependencyFieldUpdateEvent:function(i){var a=this,n=this.childrenByPropertyId[i];if(!n)return t.throwErrorWithCallback("Missing property: "+i,a.errorCallback);var r=n.schema.dependencies;if(!r)return!0;var s=function(e,i){var r=t.resolveField(a,i);r&&(r.getFieldEl().bind("fieldupdate",function(e,t,i){return function(){a.showOrHidePropertyBasedOnDependencies(i),e.getFieldEl().trigger("fieldupdate")}}(n,r,e,i)),r.getFieldEl().trigger("fieldupdate"))};t.isString(r)?s(i,r):t.isArray(r)&&e.each(r,function(e,t){s(i,t)})},refreshDependentFieldStates:function(i){var a=this,n=this.childrenByPropertyId[i];if(!n)return t.throwErrorWithCallback("Missing property: "+i,a.errorCallback);var r=n.schema.dependencies;if(!r)return!0;var s=function(e){var i=t.resolveField(a,e);i&&i.getFieldEl().trigger("fieldupdate")};t.isString(r)?s(r):t.isArray(r)&&e.each(r,function(e,t){s(t)})},determineSingleDependencyValid:function(e,i){var a=this,n=t.resolveField(a,i);if(!n)return!1;var r=n.data,s=!1,o=this.childrenByPropertyId[e].options.dependencies;if(o&&0!==o.length){"boolean"!==n.getType()||r||(r=!1);var l=o[i];!t.isEmpty(l)&&t.isFunction(l)?s=l.call(this,r):(s=!0,t.isArray(l)?t.anyEquality(r,l)&&(s=!1):t.isEmpty(l)||t.anyEquality(l,r)||(s=!1))}else s="boolean"!==n.getType()||this.childrenByPropertyId[e].options.dependencies||r?!t.isValEmpty(n.data):!1;return n&&n.isHidden()&&(s=!1),s},getIndex:function(e){if(t.isEmpty(e))return-1;for(var i=0;i0&&n.after(t.getFieldEl())}else e(o.container).append(t.getFieldEl());o.updateChildDOMElements(),o.refreshValidationState(!0,function(){o.triggerUpdate(),s&&s()})})},removeItem:function(t,i){var a=this;this.children=e.grep(this.children,function(e){return e.getId()!=t});var n=this.childrenById[t];delete this.childrenById[t],n.propertyId&&delete this.childrenByPropertyId[n.propertyId],n.destroy(),this.refreshValidationState(!0,function(){a.triggerUpdate(),i&&i()})},wizard:function(){var i=this,a=this.wizardConfigs.steps;a||(a=[]);var n=this.wizardConfigs.title,r=this.wizardConfigs.description,s=this.wizardConfigs.buttons;s||(s={}),s.previous||(s.previous={}),s.previous.title||(s.previous.title="Previous"),s.previous.align||(s.previous.align="left"),s.previous.type||(s.previous.type="button"),s.next||(s.next={}),s.next.title||(s.next.title="Next"),s.next.align||(s.next.align="right"),s.next.type||(s.next.type="button"),this.wizardConfigs.hideSubmitButton||(s.submit||(s.submit={}),s.submit.title||(s.submit.title="Submit"),s.submit.align||(s.submit.align="right"),s.submit.type||(s.submit.type="button"));for(var o in s)s[o].type||(s[o].type="button");var l=this.wizardConfigs.showSteps;"undefined"==typeof l&&(l=!0);var c=this.wizardConfigs.showProgressBar,d=this.wizardConfigs.validation;"undefined"==typeof d&&(d=!0);var n=e(this.field).attr("data-alpaca-wizard-title"),r=e(this.field).attr("data-alpaca-wizard-description"),p=e(this.field).attr("data-alpaca-wizard-validation");"undefined"!=typeof p&&(d=p?!0:!1);var u=e(this.field).attr("data-alpaca-wizard-show-steps");"undefined"!=typeof u&&(l=u?!0:!1);var h=e(this.field).attr("data-alpaca-wizard-show-progress-bar");"undefined"!=typeof h&&(c=h?!0:!1);var f=e(this.field).find("[data-alpaca-wizard-role='step']");0==a.length&&f.each(function(t){var i={},n=e(this).attr("data-alpaca-wizard-step-title");"undefined"!=typeof n&&(i.title=n),i.title||(i.title="Step "+t);var r=e(this).attr("data-alpaca-wizard-step-description");"undefined"!=typeof r&&(i.description=r),i.description||(i.description="Step "+t),a.push(i)}),"undefined"==typeof c&&a.length>1&&(c=!0);var m={};m.wizardTitle=n,m.wizardDescription=r,m.showSteps=l,m.performValidation=d,m.steps=a,m.buttons=s,m.schema=i.schema,m.options=i.options,m.data=i.data,m.showProgressBar=c,m.markAllStepsVisited=this.wizardConfigs.markAllStepsVisited;var g=i.view.getTemplateDescriptor("wizard",i);if(g){var v=t.tmpl(g,m);e(i.field).append(v);var y=e(v).find(".alpaca-wizard-nav"),b=e(v).find(".alpaca-wizard-steps"),w=e(v).find(".alpaca-wizard-buttons"),F=e(v).find(".alpaca-wizard-progress-bar");e(b).append(f),function(a,n,r,s){var o=0,l=e(r).find("[data-alpaca-wizard-button-key='previous']"),c=e(r).find("[data-alpaca-wizard-button-key='next']"),d=e(r).find("[data-alpaca-wizard-button-key='submit']"),p=function(){if(s.showSteps){if(s.visits||(s.visits={}),s.markAllStepsVisited)for(var t=e(a).find("[data-alpaca-wizard-step-index]"),i=0;ii?e(a).find("[data-alpaca-wizard-step-index='"+i+"']").addClass("completed"):i===o?e(a).find("[data-alpaca-wizard-step-index='"+i+"']").addClass("active"):s.visits&&s.visits[i]||e(a).find("[data-alpaca-wizard-step-index='"+i+"']").addClass("disabled"),s.visits&&s.visits[i]&&e(a).find("[data-alpaca-wizard-step-index='"+i+"']").addClass("visited")}if(s.showProgressBar){var r=o+1,p=s.steps.length+1,u=parseInt(r/p*100,10)+"%";e(F).find(".progress-bar").attr("aria-valuemax",p),e(F).find(".progress-bar").attr("aria-valuenow",r),e(F).find(".progress-bar").css("width",u)}l.hide(),c.hide(),d.hide(),1==s.steps.length?d.show():s.steps.length>1&&(o>0&&l.show(),c.show(),0==o?c.show():o==s.steps.length-1&&(c.hide(),d.show())),e(n).find("[data-alpaca-wizard-role='step']").hide(),e(e(n).find("[data-alpaca-wizard-role='step']")[o]).show()},u=function(a,r){if(!s.performValidation)return void r(!0);var l=[],c=e(e(n).find("[data-alpaca-wizard-role='step']")[o]);e(c).find(".alpaca-field").each(function(){var t=e(this).attr("data-alpaca-field-id");if(t){var a=i.childrenById[t];a&&l.push(a)}});for(var d=[],p=0;p=1){var t=s.buttons.previous;t&&t.click&&t.click.call(i,e),o--,p()}}),e(c).click(function(e){e.preventDefault(),o+1<=s.steps.length-1&&u("next",function(t){if(t){var a=s.buttons.next;a&&a.click&&a.click.call(i,e),o++,p()}})}),e(d).click(function(e){e.preventDefault(),o===s.steps.length-1&&u("submit",function(t){if(t){var a=s.buttons.submit;a&&(a.click?a.click.call(i,e):i.form&&i.form.submit())}})}),e(r).find("[data-alpaca-wizard-button-key]").each(function(){var t=e(this).attr("data-alpaca-wizard-button-key");if("submit"!=t&&"next"!=t&&"previous"!=t){var a=s.buttons[t];a&&a.click&&e(this).click(function(e){return function(t){e.click.call(i,t)}}(a))}}),e(a).find("[data-alpaca-wizard-step-index]").click(function(t){t.preventDefault();var i=e(this).attr("data-alpaca-wizard-step-index");i&&(i=parseInt(i,10),(i==o||s.visits&&s.visits[i])&&(o>i?(o=i,p()):i>o&&u(null,function(e){e&&(o=i,p())})))}),i.on("moveToStep",function(e){var t=e.index,i=e.skipValidation;"undefined"!=typeof t&&t<=s.steps.length-1&&(i?(o=t,p()):u(null,function(e){e&&(o=t,p())}))}),i.on("advanceOrSubmit",function(){u(null,function(t){t&&(o===s.steps.length-1?e(d).click():e(c).click())})}),p()}(y,b,w,m)}},autoWizard:function(){var t=this.wizardConfigs.bindings;t||(t={});for(var i in this.childrenByPropertyId)t.hasOwnProperty(i)||(t[i]=1);var a=!0;e(this.field).find("[data-alpaca-wizard-role='step']").length>0&&(a=!1);var n=1,r=[];do{r=[];for(var i in t)t[i]==n&&this.childrenByPropertyId&&this.childrenByPropertyId[i]&&r.push(this.childrenByPropertyId[i].field);if(r.length>0){var s=null;a?(s=e('
'),e(this.field).append(s)):s=e(e(this.field).find("[data-alpaca-wizard-role='step']")[n-1]);for(var o=0;o0);this.wizard()},getType:function(){return"object"},moveItem:function(i,a,n,r){var s=this;if("function"==typeof n&&(r=n,n=s.options.animate),"undefined"==typeof n&&(n=s.options.animate?s.options.animate:!0),"string"==typeof i&&(i=parseInt(i,10)),"string"==typeof a&&(a=parseInt(a,10)),0>a&&(a=0),a>=s.children.length&&(a=s.children.length-1),-1!==a){var o=s.children[a];if(o){var l=s.getContainerEl().children("[data-alpaca-container-item-index='"+i+"']"),c=s.getContainerEl().children("[data-alpaca-container-item-index='"+a+"']"),d=e("
");l.before(d);var p=e("
");c.before(p);var u=function(){for(var t=[],n=0;n').appendTo(t);var n=e('Show Google Map
').appendTo(t);n.button&&n.button({text:!0}),n.click(function(){if(google&&google.maps){var t=new google.maps.Geocoder,i=a.getAddress();t&&t.geocode({address:i},function(t,i){if(i===google.maps.GeocoderStatus.OK){var n=a.getId()+"-map-canvas";0===e("#"+n).length&&e("
").appendTo(a.getFieldEl());{var r=new google.maps.Map(document.getElementById(a.getId()+"-map-canvas"),{zoom:10,center:t[0].geometry.location,mapTypeId:google.maps.MapTypeId.ROADMAP});new google.maps.Marker({map:r,position:t[0].geometry.location})}}else a.displayMessage("Geocoding failed: "+i)})}else a.displayMessage("Google Map API is not installed.")}).wrap(" "),a.options.showMapOnLoad&&n.click()}i()})},getType:function(){return"any"},getTitle:function(){return"Address"},getDescription:function(){return"Standard US Address with Street, City, State and Zip. Also comes with support for Google map."},getSchemaOfOptions:function(){return t.merge(this.base(),{properties:{validateAddress:{title:"Address Validation",description:"Enable address validation if true",type:"boolean","default":!0},showMapOnLoad:{title:"Whether to show the map when first loaded",type:"boolean"}}})},getOptionsForOptions:function(){return t.merge(this.base(),{fields:{validateAddress:{helper:"Address validation if checked",rightLabel:"Enable Google Map for address validation?",type:"checkbox"}}})}}),t.registerFieldClass("address",t.Fields.AddressField)}(jQuery),function(e){var t=e.alpaca;t.Fields.CKEditorField=t.Fields.TextAreaField.extend({getFieldType:function(){return"ckeditor"},setup:function(){this.data||(this.data=""),this.base(),"undefined"==typeof this.options.ckeditor&&(this.options.ckeditor={})},afterRenderControl:function(t,i){var a=this;this.base(t,function(){!a.isDisplayOnly()&&a.control&&e.fn.ckeditor&&(a.plugin=e(a.control).ckeditor(a.options.ckeditor)),i()})},getTitle:function(){return"CK Editor"},getDescription:function(){return"Provides an instance of a CK Editor control for use in editing HTML."},getSchemaOfOptions:function(){return t.merge(this.base(),{properties:{ckeditor:{title:"CK Editor options",description:"Use this entry to provide configuration options to the underlying CKEditor plugin.",type:"any"}}})},getOptionsForOptions:function(){return t.merge(this.base(),{fields:{wysiwyg:{type:"any"}}})}}),t.registerFieldClass("ckeditor",t.Fields.CKEditorField)}(jQuery),function(e){var t=e.alpaca;t.Fields.ColorField=t.Fields.TextField.extend({setup:function(){this.inputType="color",this.base()},getFieldType:function(){return"color"},getType:function(){return"string"},getTitle:function(){return"Color Field"},getDescription:function(){return"A color picker for selecting hexadecimal color values"}}),t.registerFieldClass("color",t.Fields.ColorField),t.registerDefaultSchemaFieldMapping("color","color")}(jQuery),function(e){var t=e.alpaca;t.Fields.CountryField=t.Fields.SelectField.extend({getFieldType:function(){return"country"},setup:function(){t.isUndefined(this.options.capitalize)&&(this.options.capitalize=!1),this.schema["enum"]=[],this.options.optionLabels=[];var e=this.view.getMessage("countries");if(e)for(var i in e){this.schema["enum"].push(i);var a=e[i];this.options.capitalize&&(a=a.toUpperCase()),this.options.optionLabels.push(a)}this.base()},getTitle:function(){return"Country Field"},getDescription:function(){return"Provides a dropdown selector of countries keyed by their ISO3 code. The names of the countries are read from the I18N bundle for the current locale."},getSchemaOfOptions:function(){return t.merge(this.base(),{properties:{capitalize:{title:"Capitalize",description:"Whether the values should be capitalized",type:"boolean","default":!1,readonly:!0}}})},getOptionsForOptions:function(){return t.merge(this.base(),{fields:{capitalize:{type:"checkbox"}}})}}),t.registerFieldClass("country",t.Fields.CountryField),t.registerDefaultFormatFieldMapping("country","country")}(jQuery),function(e){var t=function(){var e={up:Math.ceil,down:function(e){return~~e},nearest:Math.round};return function(t){return e[t]}}(),i=e.alpaca;i.Fields.CurrencyField=i.Fields.TextField.extend({constructor:function(e,t,i,a,n,r,s){i=i||{};var o=this.getSchemaOfPriceFormatOptions().properties;for(var l in o){var c=o[l];l in i||(i[l]=c["default"]||void 0)}"undefined"!=typeof t&&(t=""+parseFloat(t).toFixed(i.centsLimit)),this.base(e,t,i,a,n,r,s)},getFieldType:function(){return"currency"},afterRenderControl:function(t,i){var a=this,n=this.getControlEl();this.base(t,function(){e(n).priceFormat(a.options),i()})},getValue:function(){var i=this.getControlEl(),a=e(i).is("input")?i.val():i.hmtl();if(this.options.unmask||"none"!==this.options.round){var n=function(){var e="";for(var t in a){var i=a[t];isNaN(i)?i===this.options.centsSeparator&&(e+="."):e+=i}return parseFloat(e)}.bind(this)();if("none"!==this.options.round&&(n=t(this.options.round)(n),!this.options.unmask)){for(var r=[],s=""+n,o=0,l=0;oBootstrap DateTime Picker.",type:"any"}}})},getOptionsForOptions:function(){return t.merge(this.base(),{fields:{dateFormat:{type:"text"},picker:{type:"any"}}})}}),t.registerMessages({invalidDate:"Invalid date for format {0}"}),t.registerFieldClass("date",t.Fields.DateField),t.registerDefaultFormatFieldMapping("date","date")}(jQuery),function(e){var t=e.alpaca;t.Fields.DatetimeField=t.Fields.DateField.extend({getFieldType:function(){return"datetime"},setup:function(){var e=this;this.base(),e.options.picker.pickDate=!0,e.options.picker.pickTime=!0,"undefined"==typeof e.options.picker.sideBySide&&(e.options.picker.sideBySide=!0)},setValue:function(e){e?(t.isNumber()&&(e=new Date(e)),this.base("[object Date]"===Object.prototype.toString.call(e)?e.getMonth()+1+"/"+e.getDate()+"/"+e.getFullYear()+" "+e.getHours()+":"+e.getMinutes():e)):this.base(e)},getDatetime:function(){return this.getDate()},getTitle:function(){return"Datetime Field"},getDescription:function(){return"Datetime Field based on Trent Richardson's jQuery timepicker addon ."},getSchemaOfOptions:function(){return t.merge(this.base(),{properties:{picker:{title:"DatetimePicker options",description:"Options that are supported by the Bootstrap DateTime Picker .",type:"any"}}})},getOptionsForOptions:function(){return t.merge(this.base(),{fields:{picker:{type:"any"}}})}}),t.registerFieldClass("datetime",t.Fields.DatetimeField),t.registerDefaultFormatFieldMapping("datetime","datetime"),t.registerDefaultFormatFieldMapping("date-time","datetime")}(jQuery),function(e){var t=e.alpaca;t.Fields.EditorField=t.Fields.TextField.extend({getFieldType:function(){return"editor"},setup:function(){var e=this;this.base(),e.options.aceTheme||(e.options.aceTheme="ace/theme/chrome"),e.options.aceMode||(e.options.aceMode="ace/mode/json"),"undefined"==typeof e.options.beautify&&(e.options.beautify=!0),e.options.beautify&&this.data&&("ace/mode/json"===e.options.aceMode&&(t.isObject(this.data)?this.data=JSON.stringify(this.data,null," "):t.isString(this.data)&&(this.data=JSON.stringify(JSON.parse(this.data),null," "))),"ace/mode/html"===e.options.aceMode&&"undefined"!=typeof html_beautify&&(this.data=html_beautify(this.data)),"ace/mode/css"===e.options.aceMode&&"undefined"!=typeof css_beautify&&(this.data=css_beautify(this.data)),"ace/mode/javascript"===e.options.aceMode&&"undefined"!=typeof js_beautify&&(this.data=js_beautify(this.data))),"ace/mode/json"===e.options.aceMode&&(this.data&&"{}"!==this.data||(this.data="{\n \n}"))},afterRenderControl:function(i,a){var n=this;this.base(i,function(){if(n.control){var i=n.options.aceHeight;i&&e(n.control).css("height",i);var r=n.options.aceWidth;r||(r="100%"),e(n.control).css("width",r)}var s=e(n.control)[0];if(!ace&&window.ace&&(ace=window.ace),ace){n.editor=ace.edit(s),n.editor.setOptions({maxLines:1/0}),n.editor.getSession().setUseWrapMode(!0);var o=n.options.aceTheme;n.editor.setTheme(o);var l=n.options.aceMode;if(n.editor.getSession().setMode(l),n.editor.renderer.setHScrollBarAlwaysVisible(!1),n.editor.setShowPrintMargin(!1),n.editor.setValue(n.data),n.editor.clearSelection(),n.editor.getSession().getUndoManager().reset(),n.options.aceFitContentHeight){var c=function(){var t=!1;0===n.editor.renderer.lineHeight&&(t=!0,n.editor.renderer.lineHeight=16);var i=n.editor.getSession().getScreenLength()*n.editor.renderer.lineHeight+n.editor.renderer.scrollBar.getWidth();e(n.control).height(i.toString()+"px"),n.editor.resize(),t&&window.setTimeout(function(){n.editor.clearSelection()},100)};c(),n.editor.getSession().on("change",c)}n.schema.readonly&&n.editor.setReadOnly(!0),e(s).bind("destroyed",function(){n.editor&&(n.editor.destroy(),n.editor=null)})}else t.logError("Editor Field is missing the 'ace' Cloud 9 Editor");a()})},destroy:function(){this.editor&&(this.editor.destroy(),this.editor=null),this.base()},getEditor:function(){return this.editor},handleValidate:function(){var e=this.base(),i=this.validation,a=this._validateWordCount();i.wordLimitExceeded={message:a?"":t.substituteTokens(this.view.getMessage("wordLimitExceeded"),[this.options.wordlimit]),status:a};var n=this._validateEditorAnnotations();return i.editorAnnotationsExist={message:n?"":this.view.getMessage("editorAnnotationsExist"),status:n},e&&i.wordLimitExceeded.status&&i.editorAnnotationsExist.status},_validateEditorAnnotations:function(){if(this.editor){var e=this.editor.getSession().getAnnotations();if(e&&e.length>0)return!1}return!0},_validateWordCount:function(){if(this.options.wordlimit&&this.options.wordlimit>-1){var e=this.editor.getValue();if(e){var t=e.split(" ").length;if(t>this.options.wordlimit)return!1}}return!0},onDependentReveal:function(){this.editor&&this.editor.resize()},setValue:function(e){var i=this;this.editor&&("object"==i.schema.type&&t.isObject(e)&&(e=JSON.stringify(e,null," ")),this.editor.setValue(e),i.editor.clearSelection()),this.base(e)},getValue:function(){var e=null;return this.editor&&(e=this.editor.getValue()),"object"==this.schema.type&&(e=e?JSON.parse(e):{}),e},getTitle:function(){return"Editor"},getDescription:function(){return"Editor"},getSchemaOfOptions:function(){return t.merge(this.base(),{properties:{aceTheme:{title:"ACE Editor Theme",description:"Specifies the theme to set onto the editor instance",type:"string","default":"ace/theme/twilight"},aceMode:{title:"ACE Editor Mode",description:"Specifies the mode to set onto the editor instance",type:"string","default":"ace/mode/javascript"},aceWidth:{title:"ACE Editor Height",description:"Specifies the width of the wrapping div around the editor",type:"string","default":"100%"},aceHeight:{title:"ACE Editor Height",description:"Specifies the height of the wrapping div around the editor",type:"string","default":"300px"},aceFitContentHeight:{title:"ACE Fit Content Height",description:"Configures the ACE Editor to auto-fit its height to the contents of the editor",type:"boolean","default":!1},wordlimit:{title:"Word Limit",description:"Limits the number of words allowed in the text area.",type:"number","default":-1}}})},getOptionsForOptions:function(){return t.merge(this.base(),{fields:{aceTheme:{type:"text"},aceMode:{type:"text"},wordlimit:{type:"integer"}}})}}),t.registerMessages({wordLimitExceeded:"The maximum word limit of {0} has been exceeded.",editorAnnotationsExist:"The editor has errors in it that must be corrected"}),t.registerFieldClass("editor",t.Fields.EditorField)}(jQuery),function(e){var t=e.alpaca;t.Fields.EmailField=t.Fields.TextField.extend({getFieldType:function(){return"email"},setup:function(){this.inputType="email",this.base(),this.schema.pattern||(this.schema.pattern=t.regexps.email)},handleValidate:function(){var e=this.base(),t=this.validation;return t.invalidPattern.status||(t.invalidPattern.message=this.view.getMessage("invalidEmail")),e},getTitle:function(){return"Email Field"},getDescription:function(){return"Email Field."},getSchemaOfSchema:function(){var e=this.schema&&this.schema.pattern?this.schema.pattern:t.regexps.email;return t.merge(this.base(),{properties:{pattern:{title:"Pattern",description:"Field Pattern in Regular Expression",type:"string","default":e,"enum":[e],readonly:!0},format:{title:"Format",description:"Property data format",type:"string","default":"email","enum":["email"],readonly:!0}}})},getOptionsForSchema:function(){return t.merge(this.base(),{fields:{format:{type:"text"}}})}}),t.registerMessages({invalidEmail:"Invalid Email address e.g. info@cloudcms.com"}),t.registerFieldClass("email",t.Fields.EmailField),t.registerDefaultFormatFieldMapping("email","email")}(jQuery),function(e){var t=e.alpaca;t.Fields.GridField=t.Fields.ArrayField.extend({getFieldType:function(){return"grid"},setup:function(){this.base(),"undefined"==typeof this.options.grid&&(this.options.grid={})},afterRenderContainer:function(t,i){var a=this;this.base(t,function(){var t=[],n=[];for(var r in a.options.fields){var s=a.options.fields[r],o=r;s.label&&(o=s.label),n.push(o)}t.push(n);for(var l=0;l'),a.slider=e("#slider",a.control.parent()).slider({value:a.getValue(),min:a.schema.minimum,max:a.schema.maximum,slide:function(e,t){a.setValue(t.value),a.refreshValidationState()}}))),i()})},handleValidate:function(){var e=this.base(),t=this.validation,i=this._validateInteger();return t.stringNotANumber={message:i?"":this.view.getMessage("stringNotAnInteger"),status:i},e},_validateInteger:function(){var e=this._getControlVal();if("number"==typeof e&&(e=""+e),t.isValEmpty(e))return!0;var i=t.testRegex(t.regexps.integer,e);if(!i)return!1;var a=this.getValue();return isNaN(a)?!1:!0},getType:function(){return"integer"},getTitle:function(){return"Integer Field"},getDescription:function(){return"Field for integers."},getSchemaOfSchema:function(){return t.merge(this.base(),{properties:{minimum:{title:"Minimum",description:"Minimum value of the property.",type:"integer"},maximum:{title:"Maximum",description:"Maximum value of the property.",type:"integer"},divisibleBy:{title:"Divisible By",description:"Property value must be divisible by this number.",type:"integer"}}})},getOptionsForSchema:function(){return t.merge(this.base(),{fields:{minimum:{helper:"Minimum value of the field.",type:"integer"},maximum:{helper:"Maximum value of the field.",type:"integer"},divisibleBy:{helper:"Property value must be divisible by this number.",type:"integer"}}})},getSchemaOfOptions:function(){return t.merge(this.base(),{properties:{slider:{title:"Slider",description:"Generate jQuery UI slider control with the field if true.",type:"boolean","default":!1}}})},getOptionsForOptions:function(){return t.merge(this.base(),{fields:{slider:{rightLabel:"Slider control ?",helper:"Generate slider control if selected.",type:"checkbox"}}})}}),t.registerMessages({stringNotAnInteger:"This value is not an integer."}),t.registerFieldClass("integer",t.Fields.IntegerField),t.registerDefaultSchemaFieldMapping("integer","integer")}(jQuery),function(e){var t=e.alpaca;t.Fields.IPv4Field=t.Fields.TextField.extend({getFieldType:function(){return"ipv4"},setup:function(){this.base(),this.schema.pattern||(this.schema.pattern=t.regexps.ipv4)},handleValidate:function(){var e=this.base(),t=this.validation;return t.invalidPattern.status||(t.invalidPattern.message=this.view.getMessage("invalidIPv4")),e},getTitle:function(){return"IP Address Field"},getDescription:function(){return"IP Address Field."},getSchemaOfSchema:function(){var e=this.schema&&this.schema.pattern?this.schema.pattern:t.regexps.ipv4;return t.merge(this.base(),{properties:{pattern:{title:"Pattern",description:"Field Pattern in Regular Expression",type:"string","default":e,readonly:!0},format:{title:"Format",description:"Property data format",type:"string","enum":["ip-address"],"default":"ip-address",readonly:!0}}})},getOptionsForSchema:function(){return t.merge(this.base(),{fields:{format:{type:"text"}}})}}),t.registerMessages({invalidIPv4:"Invalid IPv4 address, e.g. 192.168.0.1"}),t.registerFieldClass("ipv4",t.Fields.IPv4Field),t.registerDefaultFormatFieldMapping("ip-address","ipv4")}(jQuery),function(e){function t(e){if("string"==typeof e.data){var t=e.handler,i=e.data.toLowerCase().split(" ");e.handler=function(e){if(this===e.target||!/textarea|select/i.test(e.target.nodeName)&&"text"!==e.target.type){var a="keypress"!==e.type&&jQuery.hotkeys.specialKeys[e.which],n=String.fromCharCode(e.which).toLowerCase(),r="",s={};e.altKey&&"alt"!==a&&(r+="alt+"),e.ctrlKey&&"ctrl"!==a&&(r+="ctrl+"),e.metaKey&&!e.ctrlKey&&"meta"!==a&&(r+="meta+"),e.shiftKey&&"shift"!==a&&(r+="shift+"),a?s[r+a]=!0:(s[r+n]=!0,s[r+jQuery.hotkeys.shiftNums[n]]=!0,"shift+"===r&&(s[jQuery.hotkeys.shiftNums[n]]=!0));for(var o=0,l=i.length;l>o;o++)if(s[i[o]])return t.apply(this,arguments)}}}}var i=e.alpaca;i.Fields.JSONField=i.Fields.TextAreaField.extend({getFieldType:function(){return"json"},setValue:function(e){(i.isObject(e)||"object"==typeof e)&&(e=JSON.stringify(e,null,3)),this.base(e)},getValue:function(){var e=this.base();return e&&i.isString(e)&&(e=JSON.parse(e)),e},handleValidate:function(){var e=this.base(),t=this.validation,i=this._validateJSON();return t.stringNotAJSON={message:i.status?"":this.view.getMessage("stringNotAJSON")+" "+i.message,status:i.status},e&&t.stringNotAJSON.status},_validateJSON:function(){var e=this.control.val();if(i.isValEmpty(e))return{status:!0};try{var t=JSON.parse(e);return this.setValue(JSON.stringify(t,null,3)),{status:!0}}catch(a){return{status:!1,message:a.message}}},afterRenderControl:function(e,t){var i=this;this.base(e,function(){i.control&&(i.control.bind("keypress",function(e){var t=e.keyCode||e.wich;34===t&&i.control.insertAtCaret('"'),123===t&&i.control.insertAtCaret("}"),91===t&&i.control.insertAtCaret("]")}),i.control.bind("keypress","Ctrl+l",function(){i.getFieldEl().removeClass("alpaca-field-focused"),i.refreshValidationState()}),i.control.attr("title","Type Ctrl+L to format and validate the JSON string.")),t()})},getTitle:function(){return"JSON Editor"},getDescription:function(){return"Editor for JSON objects with basic validation and formatting."}}),i.registerMessages({stringNotAJSON:"This value is not a valid JSON string."}),i.registerFieldClass("json",i.Fields.JSONField),e.fn.insertAtCaret=function(e){return this.each(function(){if(document.selection)this.focus(),sel=document.selection.createRange(),sel.text=e,this.focus();else if(this.selectionStart||"0"==this.selectionStart){var t=this.selectionStart,i=this.selectionEnd,a=this.scrollTop;this.value=this.value.substring(0,t)+e+this.value.substring(i,this.value.length),this.focus(),this.selectionStart=t,this.selectionEnd=t,this.scrollTop=a}else this.value+=e,this.focus()})},jQuery.hotkeys={version:"0.8",specialKeys:{8:"backspace",9:"tab",13:"return",16:"shift",17:"ctrl",18:"alt",19:"pause",20:"capslock",27:"esc",32:"space",33:"pageup",34:"pagedown",35:"end",36:"home",37:"left",38:"up",39:"right",40:"down",45:"insert",46:"del",96:"0",97:"1",98:"2",99:"3",100:"4",101:"5",102:"6",103:"7",104:"8",105:"9",106:"*",107:"+",109:"-",110:".",111:"/",112:"f1",113:"f2",114:"f3",115:"f4",116:"f5",117:"f6",118:"f7",119:"f8",120:"f9",121:"f10",122:"f11",123:"f12",144:"numlock",145:"scroll",191:"/",224:"meta"},shiftNums:{"`":"~",1:"!",2:"@",3:"#",4:"$",5:"%",6:"^",7:"&",8:"*",9:"(",0:")","-":"_","=":"+",";":": ","'":'"',",":"<",".":">","/":"?","\\":"|"}},jQuery.each(["keydown","keyup","keypress"],function(){jQuery.event.special[this]={add:t}})}(jQuery),function(e){var t=e.alpaca;t.Fields.LowerCaseField=t.Fields.TextField.extend({getFieldType:function(){return"lowercase"},setValue:function(e){var t=e.toLowerCase();t!=this.getValue()&&this.base(t)},onKeyPress:function(e){this.base(e);var i=this;t.later(25,this,function(){var e=i.getValue();i.setValue(e)})},getTitle:function(){return"Lowercase Text"},getDescription:function(){return"Text field for lowercase text."}}),t.registerFieldClass("lowercase",t.Fields.LowerCaseField),t.registerDefaultFormatFieldMapping("lowercase","lowercase")}(jQuery),function(e){var t=e.alpaca;t.Fields.MapField=t.Fields.ArrayField.extend({getFieldType:function(){return"map"},getType:function(){return"object"},setup:function(){if(this.data&&t.isObject(this.data)){var i=[];e.each(this.data,function(e,a){var n=t.copyOf(a);n._key=e,i.push(n)}),this.data=i}this.base(),t.mergeObject(this.options,{forceRevalidation:!0}),t.isEmpty(this.data)},getValue:function(){if(0!==this.children.length||this.isRequired()){for(var e={},t=0;tBootstrap Time Picker.",type:"any"}}})},getOptionsForOptions:function(){return t.merge(this.base(),{fields:{picker:{type:"any"}}})}}),t.registerMessages({invalidTime:"Invalid time"}),t.registerFieldClass("time",t.Fields.TimeField),t.registerDefaultFormatFieldMapping("time","time")}(jQuery),function(e){var t=e.alpaca;t.Fields.UploadField=t.Fields.TextField.extend({constructor:function(i,a,n,r,s,o){var l=this;this.base(i,a,n,r,s,o),this.wrapTemplate=function(i){return function(a){for(var n=a.files,r=a.formatFileSize,s=a.options,o=[],c=0;c-1){var s=e.indexOf("}",n);if(s>-1){var o=e.substring(n+car.length,s),l=a[o];l&&(e=e.substring(0,n)+l+e.substring(s+1)),r=s+1}}while(n>-1);return e},removeValue:function(e){for(var t=this,i=t.getValue(),a=0;a=a?(e(t.control).find("span.btn.fileinput-button").prop("disabled",!0),e(t.control).find("span.btn.fileinput-button").attr("disabled","disabled"),e(t.control).find(".fileupload-active-zone p.dropzone-message").css("display","none")):(e(t.control).find("span.btn.fileinput-button").prop("disabled",!1),e(t.control).find("span.btn.fileinput-button").attr("disabled",null),e(t.control).find(".fileupload-active-zone p.dropzone-message").css("display","block"))}},onFileDelete:function(){},getTitle:function(){return"Upload Field"},getDescription:function(){return"Provides an upload field with support for thumbnail preview"},getType:function(){return"array"}}),t.registerFieldClass("upload",t.Fields.UploadField),function(e){function t(t){return o?t.data("events"):e._data(t[0]).events}function i(e,i,a){var n=t(e),r=n[i];if(!o){var s=a?r.splice(r.delegateCount-1,1)[0]:r.pop();return void r.splice(a?0:r.delegateCount||0,0,s)}a?n.live.unshift(n.live.pop()):r.unshift(r.pop())}function a(t,a,n){var r=a.split(/\s+/);t.each(function(){for(var t=0;tr||1===r&&7>s;e.fn.bindFirst=function(){var t=e.makeArray(arguments),i=t.shift();return i&&(e.fn.bind.apply(this,arguments),a(this,i)),this}}(e)}(jQuery),function(e){var t=e.alpaca;t.Fields.UpperCaseField=t.Fields.TextField.extend({getFieldType:function(){return"uppercase"},setValue:function(e){var t=e.toUpperCase();t!=this.getValue()&&this.base(t)},onKeyPress:function(e){this.base(e);var i=this;t.later(25,this,function(){var e=i.getValue();i.setValue(e)})},getTitle:function(){return"Uppercase Text"},getDescription:function(){return"Text field for uppercase text."}}),t.registerFieldClass("uppercase",t.Fields.UpperCaseField),t.registerDefaultFormatFieldMapping("uppercase","uppercase")}(jQuery),function(e){var t=e.alpaca;t.Fields.URLField=t.Fields.TextField.extend({getFieldType:function(){return"url"},setup:function(){this.inputType="url",this.base(),this.schema.pattern=t.regexps.url,this.schema.format="uri"},handleValidate:function(){var e=this.base(),t=this.validation;return t.invalidPattern.status||(t.invalidPattern.message=this.view.getMessage("invalidURLFormat")),e},getTitle:function(){return"URL Field"},getDescription:function(){return"Provides a text control with validation for an internet web address."}}),t.registerMessages({invalidURLFormat:"The URL provided is not a valid web address."}),t.registerFieldClass("url",t.Fields.URLField),t.registerDefaultFormatFieldMapping("url","url")}(jQuery),function(e){var t=e.alpaca;t.Fields.ZipcodeField=t.Fields.TextField.extend({getFieldType:function(){return"zipcode"},setup:function(){this.base(),this.options.format=this.options.format?this.options.format:"nine","nine"===this.options.format?this.schema.pattern=t.regexps["zipcode-nine"]:"five"===this.options.format?this.schema.pattern=t.regexps["zipcode-five"]:(t.logError("The configured zipcode format: "+this.options.format+" is not a legal value [five, nine]"),this.options.format="nine",this.schema.pattern=t.regexps["zipcode-nine"]),"nine"===this.options.format?this.options.maskString="99999-9999":"five"===this.options.format&&(this.options.maskString="99999")},handleValidate:function(){var e=this.base(),t=this.validation;return t.invalidPattern.status||("nine"===this.options.format?t.invalidPattern.message=this.view.getMessage("invalidZipcodeFormatNine"):"five"===this.options.format&&(t.invalidPattern.message=this.view.getMessage("invalidZipcodeFormatFive"))),e},getSchemaOfOptions:function(){return t.merge(this.base(),{properties:{format:{title:"Format",description:"How to represent the zipcode field",type:"string","default":"five","enum":["five","nine"],readonly:!0}}})},getOptionsForOptions:function(){return t.merge(this.base(),{fields:{format:{type:"text"}}})},getTitle:function(){return"Zipcode Field"},getDescription:function(){return"Provides a five or nine-digital US zipcode control with validation."}}),t.registerMessages({invalidZipcodeFormatFive:"Invalid Five-Digit Zipcode (#####)",invalidZipcodeFormatNine:"Invalid Nine-Digit Zipcode (#####-####)"}),t.registerFieldClass("zipcode",t.Fields.ZipcodeField),t.registerDefaultFormatFieldMapping("zipcode","zipcode")}(jQuery),function(e){var t=e.alpaca;t.registerView({id:"base",title:"Abstract base view",messages:{countries:{afg:"Afghanistan",ala:"Aland Islands",alb:"Albania",dza:"Algeria",asm:"American Samoa",and:"Andorra",ago:"Angola",aia:"Anguilla",ata:"Antarctica",atg:"Antigua and Barbuda",arg:"Argentina",arm:"Armenia",abw:"Aruba",aus:"Australia",aut:"Austria",aze:"Azerbaijan",bhs:"Bahamas",bhr:"Bahrain",bgd:"Bangladesh",brb:"Barbados",blr:"Belarus",bel:"Belgium",blz:"Belize",ben:"Benin",bmu:"Bermuda",btn:"Bhutan",bol:"Bolivia",bih:"Bosnia and Herzegovina",bwa:"Botswana",bvt:"Bouvet Island",bra:"Brazil",iot:"British Indian Ocean Territory",brn:"Brunei Darussalam",bgr:"Bulgaria",bfa:"Burkina Faso",bdi:"Burundi",khm:"Cambodia",cmr:"Cameroon",can:"Canada",cpv:"Cape Verde",cym:"Cayman Islands",caf:"Central African Republic",tcd:"Chad",chl:"Chile",chn:"China",cxr:"Christmas Island",cck:"Cocos (Keeling), Islands",col:"Colombia",com:"Comoros",cog:"Congo",cod:"Congo, the Democratic Republic of the",cok:"Cook Islands",cri:"Costa Rica",hrv:"Croatia",cub:"Cuba",cyp:"Cyprus",cze:"Czech Republic",civ:"Cote d'Ivoire",dnk:"Denmark",dji:"Djibouti",dma:"Dominica",dom:"Dominican Republic",ecu:"Ecuador",egy:"Egypt",slv:"El Salvador",gnq:"Equatorial Guinea",eri:"Eritrea",est:"Estonia",eth:"Ethiopia",flk:"Falkland Islands (Malvinas),",fro:"Faroe Islands",fji:"Fiji",fin:"Finland",fra:"France",guf:"French Guiana",pyf:"French Polynesia",atf:"French Southern Territories",gab:"Gabon",gmb:"Gambia",geo:"Georgia",deu:"Germany",gha:"Ghana",gib:"Gibraltar",grc:"Greece",grl:"Greenland",grd:"Grenada",glp:"Guadeloupe",gum:"Guam",gtm:"Guatemala",ggy:"Guernsey",gin:"Guinea",gnb:"Guinea-Bissau",guy:"Guyana",hti:"Haiti",hmd:"Heard Island and McDonald Islands",vat:"Holy See (Vatican City State),",hnd:"Honduras",hkg:"Hong Kong",hun:"Hungary",isl:"Iceland",ind:"India",idn:"Indonesia",irn:"Iran, Islamic Republic of",irq:"Iraq",irl:"Ireland",imn:"Isle of Man",isr:"Israel",ita:"Italy",jam:"Jamaica",jpn:"Japan",jey:"Jersey",jor:"Jordan",kaz:"Kazakhstan",ken:"Kenya",kir:"Kiribati",prk:"Korea, Democratic People's Republic of",kor:"Korea, Republic of",kwt:"Kuwait",kgz:"Kyrgyzstan",lao:"Lao People's Democratic Republic",lva:"Latvia",lbn:"Lebanon",lso:"Lesotho",lbr:"Liberia",lby:"Libyan Arab Jamahiriya",lie:"Liechtenstein",ltu:"Lithuania",lux:"Luxembourg",mac:"Macao",mkd:"Macedonia, the former Yugoslav Republic of",mdg:"Madagascar",mwi:"Malawi",mys:"Malaysia",mdv:"Maldives",mli:"Mali",mlt:"Malta",mhl:"Marshall Islands",mtq:"Martinique",mrt:"Mauritania",mus:"Mauritius",myt:"Mayotte",mex:"Mexico",fsm:"Micronesia, Federated States of",mda:"Moldova, Republic of",mco:"Monaco",mng:"Mongolia",mne:"Montenegro",msr:"Montserrat",mar:"Morocco",moz:"Mozambique",mmr:"Myanmar",nam:"Namibia",nru:"Nauru",npl:"Nepal",nld:"Netherlands",ant:"Netherlands Antilles",ncl:"New Caledonia",nzl:"New Zealand",nic:"Nicaragua",ner:"Niger",nga:"Nigeria",niu:"Niue",nfk:"Norfolk Island",mnp:"Northern Mariana Islands",nor:"Norway",omn:"Oman",pak:"Pakistan",plw:"Palau",pse:"Palestinian Territory, Occupied",pan:"Panama",png:"Papua New Guinea",pry:"Paraguay",per:"Peru",phl:"Philippines",pcn:"Pitcairn",pol:"Poland",prt:"Portugal",pri:"Puerto Rico",qat:"Qatar",rou:"Romania",rus:"Russian Federation",rwa:"Rwanda",reu:"Reunion",blm:"Saint Barthelemy",shn:"Saint Helena",kna:"Saint Kitts and Nevis",lca:"Saint Lucia",maf:"Saint Martin (French part)",spm:"Saint Pierre and Miquelon",vct:"Saint Vincent and the Grenadines",wsm:"Samoa",smr:"San Marino",stp:"Sao Tome and Principe",sau:"Saudi Arabia",sen:"Senegal",srb:"Serbia",syc:"Seychelles",sle:"Sierra Leone",sgp:"Singapore",svk:"Slovakia",svn:"Slovenia",slb:"Solomon Islands",som:"Somalia",zaf:"South Africa",sgs:"South Georgia and the South Sandwich Islands",esp:"Spain",lka:"Sri Lanka",sdn:"Sudan",sur:"Suriname",sjm:"Svalbard and Jan Mayen",swz:"Swaziland",swe:"Sweden",che:"Switzerland",syr:"Syrian Arab Republic",twn:"Taiwan, Province of China",tjk:"Tajikistan",tza:"Tanzania, United Republic of",tha:"Thailand",tls:"Timor-Leste",tgo:"Togo",tkl:"Tokelau",ton:"Tonga",tto:"Trinidad and Tobago",tun:"Tunisia",tur:"Turkey",tkm:"Turkmenistan",tca:"Turks and Caicos Islands",tuv:"Tuvalu",uga:"Uganda",ukr:"Ukraine",are:"United Arab Emirates",gbr:"United Kingdom",usa:"United States",umi:"United States Minor Outlying Islands",ury:"Uruguay",uzb:"Uzbekistan",vut:"Vanuatu",ven:"Venezuela",vnm:"Viet Nam",vgb:"Virgin Islands, British",vir:"Virgin Islands, U.S.",wlf:"Wallis and Futuna",esh:"Western Sahara",yem:"Yemen",zmb:"Zambia",zwe:"Zimbabwe"},empty:"",required:"This field is required",valid:"",invalid:"This field is invalid",months:["January","February","March","April","May","June","July","August","September","October","November","December"],timeUnits:{SECOND:"seconds",MINUTE:"minutes",HOUR:"hours",DAY:"days",MONTH:"months",YEAR:"years"}}})}(jQuery),function(e){var t=e.alpaca;t.registerView({id:"base",messages:{zh_CN:{required:"此域必须",invalid:"此域不合格",months:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],timeUnits:{SECOND:"秒",MINUTE:"分",HOUR:"时",DAY:"日",MONTH:"月",YEAR:"年"},notOptional:"此域非任选",disallowValue:"非法输入包括 {0}.",invalidValueOfEnum:"允许输入包括 {0}. [{1}]",notEnoughItems:"最小个数 {0}",tooManyItems:"最大个数 {0}",valueNotUnique:"输入值不独特",notAnArray:"不是数组",invalidDate:"日期格式因该是 {0}",invalidEmail:"伊妹儿格式不对, ex: info@cloudcms.com",stringNotAnInteger:"不是整数.",invalidIPv4:"不是合法IP地址, ex: 192.168.0.1",stringValueTooSmall:"最小值是 {0}",stringValueTooLarge:"最大值是 {0}",stringValueTooSmallExclusive:"值必须大于 {0}",stringValueTooLargeExclusive:"值必须小于 {0}",stringDivisibleBy:"值必须能被 {0} 整除",stringNotANumber:"不是数字.",invalidPassword:"非法密码",invalidPhone:"非法电话号码, ex: (123) 456-9999",invalidPattern:"此域须有格式 {0}",stringTooShort:"此域至少长度 {0}",stringTooLong:"此域最多长度 {0}"}}})}(jQuery),function(e){var t=e.alpaca;t.registerView({id:"base",messages:{es_ES:{required:"Este campo es obligatorio",invalid:"Este campo es inválido",months:["Enero","Febrero","Marzo","Abril","Mayo","Junio","Julio","Agosto","Septiembre","Octubre","Noviembre","Diciembre"],timeUnits:{SECOND:"segundos",MINUTE:"minutos",HOUR:"horas",DAY:"días",MONTH:"meses",YEAR:"años"},notOptional:"Este campo no es opcional.",disallowValue:"{0} son los valores rechazados.",invalidValueOfEnum:"Este campo debe tener uno de los valores adentro {0}. [{1}]",notEnoughItems:"El número mínimo de artículos es {0}",tooManyItems:"El número máximo de artículos es {0}",valueNotUnique:"Los valores no son únicos",notAnArray:"Este valor no es un arsenal",invalidDate:"Fecha inválida para el formato {0}",invalidEmail:"Email address inválido, ex: info@cloudcms.com",stringNotAnInteger:"Este valor no es un número entero.",invalidIPv4:"Dirección inválida IPv4, ex: 192.168.0.1",stringValueTooSmall:"El valor mínimo para este campo es {0}",stringValueTooLarge:"El valor míximo para este campo es {0}",stringValueTooSmallExclusive:"El valor de este campo debe ser mayor que {0}",stringValueTooLargeExclusive:"El valor de este campo debe ser menos que {0}",stringDivisibleBy:"El valor debe ser divisible cerca {0}",stringNotANumber:"Este valor no es un número.",invalidPassword:"Contraseña inválida",invalidPhone:"Número de teléfono inválido, ex: (123) 456-9999",invalidPattern:"Este campo debe tener patrón {0}",stringTooShort:"Este campo debe contener por lo menos {0} números o caracteres",stringTooLong:"Este campo debe contener a lo más {0} números o caracteres"}}})}(jQuery),function(e){var t=e.alpaca;t.registerView({id:"base",messages:{fr_FR:{required:"Ce champ est requis",invalid:"Ce champ est invalide",months:["Janvier","Février","Mars","Avril","Mai","Juin","Juillet","Août","Septembre","Octobre","Novembre","Décembre"],timeUnits:{SECOND:"secondes",MINUTE:"minutes",HOUR:"heures",DAY:"jours",MONTH:"mois",YEAR:"années"},notOptional:"Ce champ n'est pas optionnel.",disallowValue:"{0} sont des valeurs interdites.",invalidValueOfEnum:"Ce champ doit prendre une des valeurs suivantes : {0}. [{1}]",notEnoughItems:"Le nombre minimum d'éléments est {0}",tooManyItems:"Le nombre maximum d'éléments est {0}",valueNotUnique:"Les valeurs sont uniques",notAnArray:"Cette valeur n'est pas une liste",invalidDate:"Cette date ne correspond pas au format {0}",invalidEmail:"Adresse de courriel invalide, ex: info@cloudcms.com",stringNotAnInteger:"Cette valeur n'est pas un nombre entier.",invalidIPv4:"Adresse IPv4 invalide, ex: 192.168.0.1",stringValueTooSmall:"La valeur minimale pour ce champ est {0}",stringValueTooLarge:"La valeur maximale pour ce champ est {0}",stringValueTooSmallExclusive:"La valeur doit-être supérieure à {0}",stringValueTooLargeExclusive:"La valeur doit-être inférieure à {0}",stringDivisibleBy:"La valeur doit-être divisible par {0}",stringNotANumber:"Cette valeur n'est pas un nombre.",invalidPassword:"Mot de passe invalide",invalidPhone:"Numéro de téléphone invalide, ex: (123) 456-9999",invalidPattern:"Ce champ doit correspondre au motif {0}",stringTooShort:"Ce champ doit contenir au moins {0} caractères",stringTooLong:"Ce champ doit contenir au plus {0} caractères"}}})}(jQuery),function(e){var t=e.alpaca;t.registerView({id:"base",messages:{pl_PL:{required:"To pole jest wymagane",invalid:"To pole jest nieprawidłowe",months:["Styczeń","Luty","Marzec","Kwiecień","Maj","Czerwiec","Lipiec","Sierpień","Wrzesień","Październik","Listopad","Grudzień"],timeUnits:{SECOND:"sekundy",MINUTE:"minuty",HOUR:"godziny",DAY:"dni",MONTH:"miesiące",YEAR:"lata"},notOptional:"To pole nie jest opcjonalne",disallowValue:"Ta wartość nie jest dozwolona: {0}",invalidValueOfEnum:"To pole powinno zawierać jedną z następujących wartości: {0}. [{1}]",notEnoughItems:"Minimalna liczba elementów wynosi {0}",tooManyItems:"Maksymalna liczba elementów wynosi {0}",valueNotUnique:"Te wartości nie są unikalne",notAnArray:"Ta wartość nie jest tablicą",invalidDate:"Niepoprawny format daty: {0}",invalidEmail:"Niepoprawny adres email, n.p.: info@cloudcms.com",stringNotAnInteger:"Ta wartość nie jest liczbą całkowitą",invalidIPv4:"Niepoprawny adres IPv4, n.p.: 192.168.0.1",stringValueTooSmall:"Minimalna wartość dla tego pola wynosi {0}",stringValueTooLarge:"Maksymalna wartość dla tego pola wynosi {0}",stringValueTooSmallExclusive:"Wartość dla tego pola musi być większa niż {0}",stringValueTooLargeExclusive:"Wartość dla tego pola musi być mniejsza niż {0}",stringDivisibleBy:"Wartość musi być podzielna przez {0}",stringNotANumber:"Wartość nie jest liczbą",invalidPassword:"Niepoprawne hasło",invalidPhone:"Niepoprawny numer telefonu, n.p.: (123) 456-9999",invalidPattern:"To pole powinno mieć format {0}",stringTooShort:"To pole powinno zawierać co najmniej {0} znaków",stringTooLong:"To pole powinno zawierać najwyżej {0} znaków"}}})}(jQuery),function(e){var t=e.alpaca;t.registerView({id:"base",messages:{pt_BR:{required:"Este campo é obrigatório",invalid:"Este campo é inválido",months:["Janeiro","Fevereiro","Março","Abril","Maio","Junho","Julho","Agosto","Setembro","Outubro","Novembro","Dezembro"],timeUnits:{SECOND:"segundos",MINUTE:"minutos",HOUR:"horas",DAY:"dias",MONTH:"meses",YEAR:"anos"},notOptional:"Este campo não é opcional.",disallowValue:"{0} são valores proibidas.",invalidValueOfEnum:"Este campo deve ter um dos seguintes valores: {0}. [{1}]",notEnoughItems:"O número mínimo de elementos é {0}",tooManyItems:"O número máximo de elementos é {0}",valueNotUnique:"Os valores não são únicos",notAnArray:"Este valor não é uma lista",invalidDate:"Esta data não tem o formato {0}",invalidEmail:"Endereço de email inválida, ex: info@cloudcms.com",stringNotAnInteger:"Este valor não é um número inteiro.",invalidIPv4:"Endereço IPv4 inválida, ex: 192.168.0.1",stringValueTooSmall:"O valor mínimo para este campo é {0}",stringValueTooLarge:"O valor máximo para este campo é {0}",stringValueTooSmallExclusive:"O valor deste campo deve ser maior que {0}",stringValueTooLargeExclusive:"O valor deste campo deve ser menor que {0}",stringDivisibleBy:"O valor deve ser divisível por {0}",stringNotANumber:"Este valor não é um número.",invalidPassword:"Senha inválida",invalidPhone:"Número de telefone inválido, ex: (123) 456-9999",invalidPattern:"Este campo deve ter o padrão {0}",stringTooShort:"Este campo deve incluir pelo menos {0} caracteres",stringTooLong:"Este campo pode incluir no máximo {0} caracteres"}}})}(jQuery),function(e){var t=e.alpaca;t.registerView({id:"base",messages:{de_AT:{required:"Eingabe erforderlich",invalid:"Eingabe invalid",months:["Jänner","Februar","März","April","Mai","Juni","Juli","August","September","Oktober","November","Dezember"],timeUnits:{SECOND:"Sekunden",MINUTE:"Minuten",HOUR:"Stunden",DAY:"Tage",MONTH:"Monate",YEAR:"Jahre"},notOptional:"Dieses Feld ist nicht optional",disallowValue:"Diese Werte sind nicht erlaubt: {0}",invalidValueOfEnum:"Diese Feld sollte einen der folgenden Werte enthalten: {0}. [{1}]",notEnoughItems:"Die Mindestanzahl von Elementen ist {0}",tooManyItems:"Die Maximalanzahl von Elementen ist {0}",valueNotUnique:"Diese Werte sind nicht eindeutig",notAnArray:"Keine Liste von Werten",invalidDate:"Falsches Datumsformat: {0}",invalidEmail:"Ungültige e-Mail Adresse, z.B.: info@cloudcms.com",stringNotAnInteger:"Eingabe ist keine Ganz Zahl.",invalidIPv4:"Ungültige IPv4 Adresse, z.B.: 192.168.0.1",stringValueTooSmall:"Die Mindestanzahl von Zeichen ist {0}",stringValueTooLarge:"Die Maximalanzahl von Zeichen ist {0}",stringValueTooSmallExclusive:"Die Anzahl der Zeichen muss größer sein als {0}",stringValueTooLargeExclusive:"Die Anzahl der Zeichen muss kleiner sein als {0}",stringDivisibleBy:"Der Wert muss durch {0} dividierbar sein",stringNotANumber:"Die Eingabe ist keine Zahl",invalidPassword:"Ungültiges Passwort.",invalidPhone:"Ungültige Telefonnummer, z.B.: (123) 456-9999",invalidPattern:"Diese Feld stimmt nicht mit folgender Vorgabe überein {0}",stringTooShort:"Dieses Feld sollte mindestens {0} Zeichen enthalten",stringTooLong:"Dieses Feld sollte höchstens {0} Zeichen enthalten"}}})}(jQuery),function(e){var t=e.alpaca,i={};i.field=function(){},i.control=function(){},i.container=function(){},i.form=function(){},i.required=function(){},i.optional=function(){},i.readonly=function(){},i.disabled=function(){},i.enabled=function(){},i.clearValidity=function(){},i.invalid=function(){},i.valid=function(){},i.addMessage=function(){},i.removeMessages=function(){},i.enableButton=function(){},i.disableButton=function(){},i.arrayToolbar=function(i){var a=this,n=this.getId();if(i)e(this.getFieldEl()).find(".alpaca-array-toolbar[data-alpaca-array-toolbar-field-id='"+n+"']").remove();else{var r=this.view.getTemplateDescriptor("container-array-toolbar",a),s=t.tmpl(r,{actions:a.toolbar.actions,fieldId:a.getId(),toolbarStyle:a.options.toolbarStyle});e(this.getContainerEl()).before(s)}},i.arrayActionbars=function(i){var a=this,n=this.getId();if(i)e(this.getFieldEl()).find(".alpaca-array-actionbar[data-alpaca-array-actionbar-field-id='"+n+"']").remove();else{var r=this.view.getTemplateDescriptor("container-array-actionbar",a),s=this.getContainerEl().children(".alpaca-container-item");e(s).each(function(i){var n=t.tmpl(r,{actions:a.actionbar.actions,fieldId:a.getId(),itemIndex:i,actionbarStyle:a.options.actionbarStyle});"top"==a.options.actionbarStyle?e(this).children().first().before(n):"bottom"==a.options.actionbarStyle&&e(this).children().last().after(n)})}};var a={};a.commonIcon="",a.addIcon="",a.removeIcon="",a.upIcon="",a.downIcon="",a.containerExpandedIcon="",a.containerCollapsedIcon="",t.registerView({id:"web-display",parent:"base",type:"display",ui:"web",title:"Default HTML5 display view",displayReadonly:!0,templates:{},callbacks:i,styles:a,horizontal:!1}),t.registerView({id:"web-display-horizontal",parent:"web-display",horizontal:!0}),t.registerView({id:"web-edit",parent:"base",type:"edit",ui:"web",title:"Default HTML5 edit view",displayReadonly:!0,templates:{},callbacks:i,styles:a,horizontal:!1}),t.registerView({id:"web-edit-horizontal",parent:"web-edit",horizontal:!0}),t.registerView({id:"web-create",parent:"web-edit",type:"create",title:"Default HTML5 create view",displayReadonly:!1,templates:{},horizontal:!1}),t.registerView({id:"web-create-horizontal",parent:"web-create",horizontal:!0})}(jQuery),function(e){var t=e.alpaca,i={};i.field=function(){this.getFieldEl().addClass("ui-widget")},i.required=function(){var t=this.getFieldEl(),i=e(t).find("label.alpaca-control-label");e(' ').prependTo(i)},i.invalid=function(){this.getFieldEl().addClass("ui-state-error")},i.valid=function(){this.getFieldEl().removeClass("ui-state-error")},i.control=function(){var t=this.getFieldEl(),i=this.getControlEl();if(this.view.horizontal){e(t).find("label.alpaca-control-label").addClass("col span_2");var a=e("
");a.addClass("col span_10"),e(i).after(a),a.append(i)}},i.container=function(){},i.form=function(){var t=this.getFormEl();this.view.horizontal&&e(t).addClass("form-horizontal"),e(t).find(".alpaca-form-buttons-container").addClass("alpaca-float-right")},i.hide=function(){this.getFieldEl().addClass("ui-helper-hidden ui-helper-hidden-accessible")},i.show=function(){this.getFieldEl().removeClass("ui-helper-hidden"),this.getFieldEl().removeClass("ui-helper-hidden-accessible")};var a={};a.containerExpandedIcon="ui-icon-circle-arrow-s",a.containerCollapsedIcon="ui-icon-circle-arrow-e",a.commonIcon="ui-icon",a.addIcon="ui-icon-circle-plus",a.removeIcon="ui-icon-circle-minus",a.upIcon="ui-icon-circle-arrow-n",a.downIcon="ui-icon-circle-arrow-s",t.registerView({id:"jqueryui-display",parent:"web-display",type:"display",ui:"jqueryui",title:"Display View for jQuery UI",displayReadonly:!0,callbacks:i,styles:a,templates:{}}),t.registerView({id:"jqueryui-display-horizontal",parent:"jqueryui-display",horizontal:!0}),t.registerView({id:"jqueryui-edit",parent:"web-edit",type:"edit",ui:"jqueryui",title:"Edit view for jQuery UI",displayReadonly:!0,callbacks:i,styles:a,templates:{}}),t.registerView({id:"jqueryui-edit-horizontal",parent:"jqueryui-edit",horizontal:!0}),t.registerView({id:"jqueryui-create",parent:"jqueryui-edit",type:"create",title:"Create view for jQuery UI",displayReadonly:!1}),t.registerView({id:"jqueryui-create-horizontal",parent:"jqueryui-create",horizontal:!0})}(jQuery),Alpaca.defaultView="jqueryui",Alpaca});
diff --git a/var/httpd/htdocs/js/thirdparty/alpaca/handlebars.min.js b/var/httpd/htdocs/js/thirdparty/alpaca/handlebars.min.js
new file mode 100644
index 0000000..06e9c01
--- /dev/null
+++ b/var/httpd/htdocs/js/thirdparty/alpaca/handlebars.min.js
@@ -0,0 +1,28 @@
+/*!
+
+ handlebars v1.3.0
+
+Copyright (C) 2011 by Yehuda Katz
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
+
+@license
+*/
+var Handlebars=function(){var a=function(){"use strict";function a(a){this.string=a}var b;return a.prototype.toString=function(){return""+this.string},b=a}(),b=function(a){"use strict";function b(a){return h[a]||"&"}function c(a,b){for(var c in b)Object.prototype.hasOwnProperty.call(b,c)&&(a[c]=b[c])}function d(a){return a instanceof g?a.toString():a||0===a?(a=""+a,j.test(a)?a.replace(i,b):a):""}function e(a){return a||0===a?m(a)&&0===a.length?!0:!1:!0}var f={},g=a,h={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},i=/[&<>"'`]/g,j=/[&<>"'`]/;f.extend=c;var k=Object.prototype.toString;f.toString=k;var l=function(a){return"function"==typeof a};l(/x/)&&(l=function(a){return"function"==typeof a&&"[object Function]"===k.call(a)});var l;f.isFunction=l;var m=Array.isArray||function(a){return a&&"object"==typeof a?"[object Array]"===k.call(a):!1};return f.isArray=m,f.escapeExpression=d,f.isEmpty=e,f}(a),c=function(){"use strict";function a(a,b){var d;b&&b.firstLine&&(d=b.firstLine,a+=" - "+d+":"+b.firstColumn);for(var e=Error.prototype.constructor.call(this,a),f=0;f0?a.helpers.each(b,c):d(this):e(b)}),a.registerHelper("each",function(a,b){var c,d=b.fn,e=b.inverse,f=0,g="";if(m(a)&&(a=a.call(this)),b.data&&(c=q(b.data)),a&&"object"==typeof a)if(l(a))for(var h=a.length;h>f;f++)c&&(c.index=f,c.first=0===f,c.last=f===a.length-1),g+=d(a[f],{data:c});else for(var i in a)a.hasOwnProperty(i)&&(c&&(c.key=i,c.index=f,c.first=0===f),g+=d(a[i],{data:c}),f++);return 0===f&&(g=e(this)),g}),a.registerHelper("if",function(a,b){return m(a)&&(a=a.call(this)),!b.hash.includeZero&&!a||g.isEmpty(a)?b.inverse(this):b.fn(this)}),a.registerHelper("unless",function(b,c){return a.helpers["if"].call(this,b,{fn:c.inverse,inverse:c.fn,hash:c.hash})}),a.registerHelper("with",function(a,b){return m(a)&&(a=a.call(this)),g.isEmpty(a)?void 0:b.fn(a)}),a.registerHelper("log",function(b,c){var d=c.data&&null!=c.data.level?parseInt(c.data.level,10):1;a.log(d,b)})}function e(a,b){p.log(a,b)}var f={},g=a,h=b,i="1.3.0";f.VERSION=i;var j=4;f.COMPILER_REVISION=j;var k={1:"<= 1.0.rc.2",2:"== 1.0.0-rc.3",3:"== 1.0.0-rc.4",4:">= 1.0.0"};f.REVISION_CHANGES=k;var l=g.isArray,m=g.isFunction,n=g.toString,o="[object Object]";f.HandlebarsEnvironment=c,c.prototype={constructor:c,logger:p,log:e,registerHelper:function(a,b,c){if(n.call(a)===o){if(c||b)throw new h("Arg not supported with multiple helpers");g.extend(this.helpers,a)}else c&&(b.not=c),this.helpers[a]=b},registerPartial:function(a,b){n.call(a)===o?g.extend(this.partials,a):this.partials[a]=b}};var p={methodMap:{0:"debug",1:"info",2:"warn",3:"error"},DEBUG:0,INFO:1,WARN:2,ERROR:3,level:3,log:function(a,b){if(p.level<=a){var c=p.methodMap[a];"undefined"!=typeof console&&console[c]&&console[c].call(console,b)}}};f.logger=p,f.log=e;var q=function(a){var b={};return g.extend(b,a),b};return f.createFrame=q,f}(b,c),e=function(a,b,c){"use strict";function d(a){var b=a&&a[0]||1,c=m;if(b!==c){if(c>b){var d=n[c],e=n[b];throw new l("Template was precompiled with an older version of Handlebars than the current runtime. Please update your precompiler to a newer version ("+d+") or downgrade your runtime to an older version ("+e+").")}throw new l("Template was precompiled with a newer version of Handlebars than the current runtime. Please update your runtime to a newer version ("+a[1]+").")}}function e(a,b){if(!b)throw new l("No environment passed to template");var c=function(a,c,d,e,f,g){var h=b.VM.invokePartial.apply(this,arguments);if(null!=h)return h;if(b.compile){var i={helpers:e,partials:f,data:g};return f[c]=b.compile(a,{data:void 0!==g},b),f[c](d,i)}throw new l("The partial "+c+" could not be compiled when running in runtime-only mode")},d={escapeExpression:k.escapeExpression,invokePartial:c,programs:[],program:function(a,b,c){var d=this.programs[a];return c?d=g(a,b,c):d||(d=this.programs[a]=g(a,b)),d},merge:function(a,b){var c=a||b;return a&&b&&a!==b&&(c={},k.extend(c,b),k.extend(c,a)),c},programWithDepth:b.VM.programWithDepth,noop:b.VM.noop,compilerInfo:null};return function(c,e){e=e||{};var f,g,h=e.partial?e:b;e.partial||(f=e.helpers,g=e.partials);var i=a.call(d,h,c,f,g,e.data);return e.partial||b.VM.checkRevision(d.compilerInfo),i}}function f(a,b,c){var d=Array.prototype.slice.call(arguments,3),e=function(a,e){return e=e||{},b.apply(this,[a,e.data||c].concat(d))};return e.program=a,e.depth=d.length,e}function g(a,b,c){var d=function(a,d){return d=d||{},b(a,d.data||c)};return d.program=a,d.depth=0,d}function h(a,b,c,d,e,f){var g={partial:!0,helpers:d,partials:e,data:f};if(void 0===a)throw new l("The partial "+b+" could not be found");return a instanceof Function?a(c,g):void 0}function i(){return""}var j={},k=a,l=b,m=c.COMPILER_REVISION,n=c.REVISION_CHANGES;return j.checkRevision=d,j.template=e,j.programWithDepth=f,j.program=g,j.invokePartial=h,j.noop=i,j}(b,c,d),f=function(a,b,c,d,e){"use strict";var f,g=a,h=b,i=c,j=d,k=e,l=function(){var a=new g.HandlebarsEnvironment;return j.extend(a,g),a.SafeString=h,a.Exception=i,a.Utils=j,a.VM=k,a.template=function(b){return k.template(b,a)},a},m=l();return m.create=l,f=m}(d,a,c,b,e),g=function(a){"use strict";function b(a){a=a||{},this.firstLine=a.first_line,this.firstColumn=a.first_column,this.lastColumn=a.last_column,this.lastLine=a.last_line}var c,d=a,e={ProgramNode:function(a,c,d,f){var g,h;3===arguments.length?(f=d,d=null):2===arguments.length&&(f=c,c=null),b.call(this,f),this.type="program",this.statements=a,this.strip={},d?(h=d[0],h?(g={first_line:h.firstLine,last_line:h.lastLine,last_column:h.lastColumn,first_column:h.firstColumn},this.inverse=new e.ProgramNode(d,c,g)):this.inverse=new e.ProgramNode(d,c),this.strip.right=c.left):c&&(this.strip.left=c.right)},MustacheNode:function(a,c,d,f,g){if(b.call(this,g),this.type="mustache",this.strip=f,null!=d&&d.charAt){var h=d.charAt(3)||d.charAt(2);this.escaped="{"!==h&&"&"!==h}else this.escaped=!!d;this.sexpr=a instanceof e.SexprNode?a:new e.SexprNode(a,c),this.sexpr.isRoot=!0,this.id=this.sexpr.id,this.params=this.sexpr.params,this.hash=this.sexpr.hash,this.eligibleHelper=this.sexpr.eligibleHelper,this.isHelper=this.sexpr.isHelper},SexprNode:function(a,c,d){b.call(this,d),this.type="sexpr",this.hash=c;var e=this.id=a[0],f=this.params=a.slice(1),g=this.eligibleHelper=e.isSimple;this.isHelper=g&&(f.length||c)},PartialNode:function(a,c,d,e){b.call(this,e),this.type="partial",this.partialName=a,this.context=c,this.strip=d},BlockNode:function(a,c,e,f,g){if(b.call(this,g),a.sexpr.id.original!==f.path.original)throw new d(a.sexpr.id.original+" doesn't match "+f.path.original,this);this.type="block",this.mustache=a,this.program=c,this.inverse=e,this.strip={left:a.strip.left,right:f.strip.right},(c||e).strip.left=a.strip.right,(e||c).strip.right=f.strip.left,e&&!c&&(this.isInverse=!0)},ContentNode:function(a,c){b.call(this,c),this.type="content",this.string=a},HashNode:function(a,c){b.call(this,c),this.type="hash",this.pairs=a},IdNode:function(a,c){b.call(this,c),this.type="ID";for(var e="",f=[],g=0,h=0,i=a.length;i>h;h++){var j=a[h].part;if(e+=(a[h].separator||"")+j,".."===j||"."===j||"this"===j){if(f.length>0)throw new d("Invalid path: "+e,this);".."===j?g++:this.isScoped=!0}else f.push(j)}this.original=e,this.parts=f,this.string=f.join("."),this.depth=g,this.isSimple=1===a.length&&!this.isScoped&&0===g,this.stringModeValue=this.string},PartialNameNode:function(a,c){b.call(this,c),this.type="PARTIAL_NAME",this.name=a.original},DataNode:function(a,c){b.call(this,c),this.type="DATA",this.id=a},StringNode:function(a,c){b.call(this,c),this.type="STRING",this.original=this.string=this.stringModeValue=a},IntegerNode:function(a,c){b.call(this,c),this.type="INTEGER",this.original=this.integer=a,this.stringModeValue=Number(a)},BooleanNode:function(a,c){b.call(this,c),this.type="BOOLEAN",this.bool=a,this.stringModeValue="true"===a},CommentNode:function(a,c){b.call(this,c),this.type="comment",this.comment=a}};return c=e}(c),h=function(){"use strict";var a,b=function(){function a(a,b){return{left:"~"===a.charAt(2),right:"~"===b.charAt(0)||"~"===b.charAt(1)}}function b(){this.yy={}}var c={trace:function(){},yy:{},symbols_:{error:2,root:3,statements:4,EOF:5,program:6,simpleInverse:7,statement:8,openInverse:9,closeBlock:10,openBlock:11,mustache:12,partial:13,CONTENT:14,COMMENT:15,OPEN_BLOCK:16,sexpr:17,CLOSE:18,OPEN_INVERSE:19,OPEN_ENDBLOCK:20,path:21,OPEN:22,OPEN_UNESCAPED:23,CLOSE_UNESCAPED:24,OPEN_PARTIAL:25,partialName:26,partial_option0:27,sexpr_repetition0:28,sexpr_option0:29,dataName:30,param:31,STRING:32,INTEGER:33,BOOLEAN:34,OPEN_SEXPR:35,CLOSE_SEXPR:36,hash:37,hash_repetition_plus0:38,hashSegment:39,ID:40,EQUALS:41,DATA:42,pathSegments:43,SEP:44,$accept:0,$end:1},terminals_:{2:"error",5:"EOF",14:"CONTENT",15:"COMMENT",16:"OPEN_BLOCK",18:"CLOSE",19:"OPEN_INVERSE",20:"OPEN_ENDBLOCK",22:"OPEN",23:"OPEN_UNESCAPED",24:"CLOSE_UNESCAPED",25:"OPEN_PARTIAL",32:"STRING",33:"INTEGER",34:"BOOLEAN",35:"OPEN_SEXPR",36:"CLOSE_SEXPR",40:"ID",41:"EQUALS",42:"DATA",44:"SEP"},productions_:[0,[3,2],[3,1],[6,2],[6,3],[6,2],[6,1],[6,1],[6,0],[4,1],[4,2],[8,3],[8,3],[8,1],[8,1],[8,1],[8,1],[11,3],[9,3],[10,3],[12,3],[12,3],[13,4],[7,2],[17,3],[17,1],[31,1],[31,1],[31,1],[31,1],[31,1],[31,3],[37,1],[39,3],[26,1],[26,1],[26,1],[30,2],[21,1],[43,3],[43,1],[27,0],[27,1],[28,0],[28,2],[29,0],[29,1],[38,1],[38,2]],performAction:function(b,c,d,e,f,g){var h=g.length-1;switch(f){case 1:return new e.ProgramNode(g[h-1],this._$);case 2:return new e.ProgramNode([],this._$);case 3:this.$=new e.ProgramNode([],g[h-1],g[h],this._$);break;case 4:this.$=new e.ProgramNode(g[h-2],g[h-1],g[h],this._$);break;case 5:this.$=new e.ProgramNode(g[h-1],g[h],[],this._$);break;case 6:this.$=new e.ProgramNode(g[h],this._$);break;case 7:this.$=new e.ProgramNode([],this._$);break;case 8:this.$=new e.ProgramNode([],this._$);break;case 9:this.$=[g[h]];break;case 10:g[h-1].push(g[h]),this.$=g[h-1];break;case 11:this.$=new e.BlockNode(g[h-2],g[h-1].inverse,g[h-1],g[h],this._$);break;case 12:this.$=new e.BlockNode(g[h-2],g[h-1],g[h-1].inverse,g[h],this._$);break;case 13:this.$=g[h];break;case 14:this.$=g[h];break;case 15:this.$=new e.ContentNode(g[h],this._$);break;case 16:this.$=new e.CommentNode(g[h],this._$);break;case 17:this.$=new e.MustacheNode(g[h-1],null,g[h-2],a(g[h-2],g[h]),this._$);break;case 18:this.$=new e.MustacheNode(g[h-1],null,g[h-2],a(g[h-2],g[h]),this._$);break;case 19:this.$={path:g[h-1],strip:a(g[h-2],g[h])};break;case 20:this.$=new e.MustacheNode(g[h-1],null,g[h-2],a(g[h-2],g[h]),this._$);break;case 21:this.$=new e.MustacheNode(g[h-1],null,g[h-2],a(g[h-2],g[h]),this._$);break;case 22:this.$=new e.PartialNode(g[h-2],g[h-1],a(g[h-3],g[h]),this._$);break;case 23:this.$=a(g[h-1],g[h]);break;case 24:this.$=new e.SexprNode([g[h-2]].concat(g[h-1]),g[h],this._$);break;case 25:this.$=new e.SexprNode([g[h]],null,this._$);break;case 26:this.$=g[h];break;case 27:this.$=new e.StringNode(g[h],this._$);break;case 28:this.$=new e.IntegerNode(g[h],this._$);break;case 29:this.$=new e.BooleanNode(g[h],this._$);break;case 30:this.$=g[h];break;case 31:g[h-1].isHelper=!0,this.$=g[h-1];break;case 32:this.$=new e.HashNode(g[h],this._$);break;case 33:this.$=[g[h-2],g[h]];break;case 34:this.$=new e.PartialNameNode(g[h],this._$);break;case 35:this.$=new e.PartialNameNode(new e.StringNode(g[h],this._$),this._$);break;case 36:this.$=new e.PartialNameNode(new e.IntegerNode(g[h],this._$));break;case 37:this.$=new e.DataNode(g[h],this._$);break;case 38:this.$=new e.IdNode(g[h],this._$);break;case 39:g[h-2].push({part:g[h],separator:g[h-1]}),this.$=g[h-2];break;case 40:this.$=[{part:g[h]}];break;case 43:this.$=[];break;case 44:g[h-1].push(g[h]);break;case 47:this.$=[g[h]];break;case 48:g[h-1].push(g[h])}},table:[{3:1,4:2,5:[1,3],8:4,9:5,11:6,12:7,13:8,14:[1,9],15:[1,10],16:[1,12],19:[1,11],22:[1,13],23:[1,14],25:[1,15]},{1:[3]},{5:[1,16],8:17,9:5,11:6,12:7,13:8,14:[1,9],15:[1,10],16:[1,12],19:[1,11],22:[1,13],23:[1,14],25:[1,15]},{1:[2,2]},{5:[2,9],14:[2,9],15:[2,9],16:[2,9],19:[2,9],20:[2,9],22:[2,9],23:[2,9],25:[2,9]},{4:20,6:18,7:19,8:4,9:5,11:6,12:7,13:8,14:[1,9],15:[1,10],16:[1,12],19:[1,21],20:[2,8],22:[1,13],23:[1,14],25:[1,15]},{4:20,6:22,7:19,8:4,9:5,11:6,12:7,13:8,14:[1,9],15:[1,10],16:[1,12],19:[1,21],20:[2,8],22:[1,13],23:[1,14],25:[1,15]},{5:[2,13],14:[2,13],15:[2,13],16:[2,13],19:[2,13],20:[2,13],22:[2,13],23:[2,13],25:[2,13]},{5:[2,14],14:[2,14],15:[2,14],16:[2,14],19:[2,14],20:[2,14],22:[2,14],23:[2,14],25:[2,14]},{5:[2,15],14:[2,15],15:[2,15],16:[2,15],19:[2,15],20:[2,15],22:[2,15],23:[2,15],25:[2,15]},{5:[2,16],14:[2,16],15:[2,16],16:[2,16],19:[2,16],20:[2,16],22:[2,16],23:[2,16],25:[2,16]},{17:23,21:24,30:25,40:[1,28],42:[1,27],43:26},{17:29,21:24,30:25,40:[1,28],42:[1,27],43:26},{17:30,21:24,30:25,40:[1,28],42:[1,27],43:26},{17:31,21:24,30:25,40:[1,28],42:[1,27],43:26},{21:33,26:32,32:[1,34],33:[1,35],40:[1,28],43:26},{1:[2,1]},{5:[2,10],14:[2,10],15:[2,10],16:[2,10],19:[2,10],20:[2,10],22:[2,10],23:[2,10],25:[2,10]},{10:36,20:[1,37]},{4:38,8:4,9:5,11:6,12:7,13:8,14:[1,9],15:[1,10],16:[1,12],19:[1,11],20:[2,7],22:[1,13],23:[1,14],25:[1,15]},{7:39,8:17,9:5,11:6,12:7,13:8,14:[1,9],15:[1,10],16:[1,12],19:[1,21],20:[2,6],22:[1,13],23:[1,14],25:[1,15]},{17:23,18:[1,40],21:24,30:25,40:[1,28],42:[1,27],43:26},{10:41,20:[1,37]},{18:[1,42]},{18:[2,43],24:[2,43],28:43,32:[2,43],33:[2,43],34:[2,43],35:[2,43],36:[2,43],40:[2,43],42:[2,43]},{18:[2,25],24:[2,25],36:[2,25]},{18:[2,38],24:[2,38],32:[2,38],33:[2,38],34:[2,38],35:[2,38],36:[2,38],40:[2,38],42:[2,38],44:[1,44]},{21:45,40:[1,28],43:26},{18:[2,40],24:[2,40],32:[2,40],33:[2,40],34:[2,40],35:[2,40],36:[2,40],40:[2,40],42:[2,40],44:[2,40]},{18:[1,46]},{18:[1,47]},{24:[1,48]},{18:[2,41],21:50,27:49,40:[1,28],43:26},{18:[2,34],40:[2,34]},{18:[2,35],40:[2,35]},{18:[2,36],40:[2,36]},{5:[2,11],14:[2,11],15:[2,11],16:[2,11],19:[2,11],20:[2,11],22:[2,11],23:[2,11],25:[2,11]},{21:51,40:[1,28],43:26},{8:17,9:5,11:6,12:7,13:8,14:[1,9],15:[1,10],16:[1,12],19:[1,11],20:[2,3],22:[1,13],23:[1,14],25:[1,15]},{4:52,8:4,9:5,11:6,12:7,13:8,14:[1,9],15:[1,10],16:[1,12],19:[1,11],20:[2,5],22:[1,13],23:[1,14],25:[1,15]},{14:[2,23],15:[2,23],16:[2,23],19:[2,23],20:[2,23],22:[2,23],23:[2,23],25:[2,23]},{5:[2,12],14:[2,12],15:[2,12],16:[2,12],19:[2,12],20:[2,12],22:[2,12],23:[2,12],25:[2,12]},{14:[2,18],15:[2,18],16:[2,18],19:[2,18],20:[2,18],22:[2,18],23:[2,18],25:[2,18]},{18:[2,45],21:56,24:[2,45],29:53,30:60,31:54,32:[1,57],33:[1,58],34:[1,59],35:[1,61],36:[2,45],37:55,38:62,39:63,40:[1,64],42:[1,27],43:26},{40:[1,65]},{18:[2,37],24:[2,37],32:[2,37],33:[2,37],34:[2,37],35:[2,37],36:[2,37],40:[2,37],42:[2,37]},{14:[2,17],15:[2,17],16:[2,17],19:[2,17],20:[2,17],22:[2,17],23:[2,17],25:[2,17]},{5:[2,20],14:[2,20],15:[2,20],16:[2,20],19:[2,20],20:[2,20],22:[2,20],23:[2,20],25:[2,20]},{5:[2,21],14:[2,21],15:[2,21],16:[2,21],19:[2,21],20:[2,21],22:[2,21],23:[2,21],25:[2,21]},{18:[1,66]},{18:[2,42]},{18:[1,67]},{8:17,9:5,11:6,12:7,13:8,14:[1,9],15:[1,10],16:[1,12],19:[1,11],20:[2,4],22:[1,13],23:[1,14],25:[1,15]},{18:[2,24],24:[2,24],36:[2,24]},{18:[2,44],24:[2,44],32:[2,44],33:[2,44],34:[2,44],35:[2,44],36:[2,44],40:[2,44],42:[2,44]},{18:[2,46],24:[2,46],36:[2,46]},{18:[2,26],24:[2,26],32:[2,26],33:[2,26],34:[2,26],35:[2,26],36:[2,26],40:[2,26],42:[2,26]},{18:[2,27],24:[2,27],32:[2,27],33:[2,27],34:[2,27],35:[2,27],36:[2,27],40:[2,27],42:[2,27]},{18:[2,28],24:[2,28],32:[2,28],33:[2,28],34:[2,28],35:[2,28],36:[2,28],40:[2,28],42:[2,28]},{18:[2,29],24:[2,29],32:[2,29],33:[2,29],34:[2,29],35:[2,29],36:[2,29],40:[2,29],42:[2,29]},{18:[2,30],24:[2,30],32:[2,30],33:[2,30],34:[2,30],35:[2,30],36:[2,30],40:[2,30],42:[2,30]},{17:68,21:24,30:25,40:[1,28],42:[1,27],43:26},{18:[2,32],24:[2,32],36:[2,32],39:69,40:[1,70]},{18:[2,47],24:[2,47],36:[2,47],40:[2,47]},{18:[2,40],24:[2,40],32:[2,40],33:[2,40],34:[2,40],35:[2,40],36:[2,40],40:[2,40],41:[1,71],42:[2,40],44:[2,40]},{18:[2,39],24:[2,39],32:[2,39],33:[2,39],34:[2,39],35:[2,39],36:[2,39],40:[2,39],42:[2,39],44:[2,39]},{5:[2,22],14:[2,22],15:[2,22],16:[2,22],19:[2,22],20:[2,22],22:[2,22],23:[2,22],25:[2,22]},{5:[2,19],14:[2,19],15:[2,19],16:[2,19],19:[2,19],20:[2,19],22:[2,19],23:[2,19],25:[2,19]},{36:[1,72]},{18:[2,48],24:[2,48],36:[2,48],40:[2,48]},{41:[1,71]},{21:56,30:60,31:73,32:[1,57],33:[1,58],34:[1,59],35:[1,61],40:[1,28],42:[1,27],43:26},{18:[2,31],24:[2,31],32:[2,31],33:[2,31],34:[2,31],35:[2,31],36:[2,31],40:[2,31],42:[2,31]},{18:[2,33],24:[2,33],36:[2,33],40:[2,33]}],defaultActions:{3:[2,2],16:[2,1],50:[2,42]},parseError:function(a){throw new Error(a)},parse:function(a){function b(){var a;return a=c.lexer.lex()||1,"number"!=typeof a&&(a=c.symbols_[a]||a),a}var c=this,d=[0],e=[null],f=[],g=this.table,h="",i=0,j=0,k=0;this.lexer.setInput(a),this.lexer.yy=this.yy,this.yy.lexer=this.lexer,this.yy.parser=this,"undefined"==typeof this.lexer.yylloc&&(this.lexer.yylloc={});var l=this.lexer.yylloc;f.push(l);var m=this.lexer.options&&this.lexer.options.ranges;"function"==typeof this.yy.parseError&&(this.parseError=this.yy.parseError);for(var n,o,p,q,r,s,t,u,v,w={};;){if(p=d[d.length-1],this.defaultActions[p]?q=this.defaultActions[p]:((null===n||"undefined"==typeof n)&&(n=b()),q=g[p]&&g[p][n]),"undefined"==typeof q||!q.length||!q[0]){var x="";if(!k){v=[];for(s in g[p])this.terminals_[s]&&s>2&&v.push("'"+this.terminals_[s]+"'");x=this.lexer.showPosition?"Parse error on line "+(i+1)+":\n"+this.lexer.showPosition()+"\nExpecting "+v.join(", ")+", got '"+(this.terminals_[n]||n)+"'":"Parse error on line "+(i+1)+": Unexpected "+(1==n?"end of input":"'"+(this.terminals_[n]||n)+"'"),this.parseError(x,{text:this.lexer.match,token:this.terminals_[n]||n,line:this.lexer.yylineno,loc:l,expected:v})}}if(q[0]instanceof Array&&q.length>1)throw new Error("Parse Error: multiple actions possible at state: "+p+", token: "+n);switch(q[0]){case 1:d.push(n),e.push(this.lexer.yytext),f.push(this.lexer.yylloc),d.push(q[1]),n=null,o?(n=o,o=null):(j=this.lexer.yyleng,h=this.lexer.yytext,i=this.lexer.yylineno,l=this.lexer.yylloc,k>0&&k--);break;case 2:if(t=this.productions_[q[1]][1],w.$=e[e.length-t],w._$={first_line:f[f.length-(t||1)].first_line,last_line:f[f.length-1].last_line,first_column:f[f.length-(t||1)].first_column,last_column:f[f.length-1].last_column},m&&(w._$.range=[f[f.length-(t||1)].range[0],f[f.length-1].range[1]]),r=this.performAction.call(w,h,j,i,this.yy,q[1],e,f),"undefined"!=typeof r)return r;t&&(d=d.slice(0,-1*t*2),e=e.slice(0,-1*t),f=f.slice(0,-1*t)),d.push(this.productions_[q[1]][0]),e.push(w.$),f.push(w._$),u=g[d[d.length-2]][d[d.length-1]],d.push(u);break;case 3:return!0}}return!0}},d=function(){var a={EOF:1,parseError:function(a,b){if(!this.yy.parser)throw new Error(a);this.yy.parser.parseError(a,b)},setInput:function(a){return this._input=a,this._more=this._less=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var a=this._input[0];this.yytext+=a,this.yyleng++,this.offset++,this.match+=a,this.matched+=a;var b=a.match(/(?:\r\n?|\n).*/g);return b?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),a},unput:function(a){var b=a.length,c=a.split(/(?:\r\n?|\n)/g);this._input=a+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-b-1),this.offset-=b;var d=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),c.length-1&&(this.yylineno-=c.length-1);var e=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:c?(c.length===d.length?this.yylloc.first_column:0)+d[d.length-c.length].length-c[0].length:this.yylloc.first_column-b},this.options.ranges&&(this.yylloc.range=[e[0],e[0]+this.yyleng-b]),this},more:function(){return this._more=!0,this},less:function(a){this.unput(this.match.slice(a))},pastInput:function(){var a=this.matched.substr(0,this.matched.length-this.match.length);return(a.length>20?"...":"")+a.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var a=this.match;return a.length<20&&(a+=this._input.substr(0,20-a.length)),(a.substr(0,20)+(a.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var a=this.pastInput(),b=new Array(a.length+1).join("-");return a+this.upcomingInput()+"\n"+b+"^"},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0);var a,b,c,d,e;this._more||(this.yytext="",this.match="");for(var f=this._currentRules(),g=0;gb[0].length)||(b=c,d=g,this.options.flex));g++);return b?(e=b[0].match(/(?:\r\n?|\n).*/g),e&&(this.yylineno+=e.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:e?e[e.length-1].length-e[e.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+b[0].length},this.yytext+=b[0],this.match+=b[0],this.matches=b,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._input=this._input.slice(b[0].length),this.matched+=b[0],a=this.performAction.call(this,this.yy,this,f[d],this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),a?a:void 0):""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var a=this.next();return"undefined"!=typeof a?a:this.lex()},begin:function(a){this.conditionStack.push(a)},popState:function(){return this.conditionStack.pop()},_currentRules:function(){return this.conditions[this.conditionStack[this.conditionStack.length-1]].rules},topState:function(){return this.conditionStack[this.conditionStack.length-2]},pushState:function(a){this.begin(a)}};return a.options={},a.performAction=function(a,b,c,d){function e(a,c){return b.yytext=b.yytext.substr(a,b.yyleng-c)}switch(c){case 0:if("\\\\"===b.yytext.slice(-2)?(e(0,1),this.begin("mu")):"\\"===b.yytext.slice(-1)?(e(0,1),this.begin("emu")):this.begin("mu"),b.yytext)return 14;break;case 1:return 14;case 2:return this.popState(),14;case 3:return e(0,4),this.popState(),15;case 4:return 35;case 5:return 36;case 6:return 25;case 7:return 16;case 8:return 20;case 9:return 19;case 10:return 19;case 11:return 23;case 12:return 22;case 13:this.popState(),this.begin("com");break;case 14:return e(3,5),this.popState(),15;case 15:return 22;case 16:return 41;case 17:return 40;case 18:return 40;case 19:return 44;case 20:break;case 21:return this.popState(),24;case 22:return this.popState(),18;case 23:return b.yytext=e(1,2).replace(/\\"/g,'"'),32;case 24:return b.yytext=e(1,2).replace(/\\'/g,"'"),32;case 25:return 42;case 26:return 34;case 27:return 34;case 28:return 33;case 29:return 40;case 30:return b.yytext=e(1,2),40;case 31:return"INVALID";case 32:return 5}},a.rules=[/^(?:[^\x00]*?(?=(\{\{)))/,/^(?:[^\x00]+)/,/^(?:[^\x00]{2,}?(?=(\{\{|\\\{\{|\\\\\{\{|$)))/,/^(?:[\s\S]*?--\}\})/,/^(?:\()/,/^(?:\))/,/^(?:\{\{(~)?>)/,/^(?:\{\{(~)?#)/,/^(?:\{\{(~)?\/)/,/^(?:\{\{(~)?\^)/,/^(?:\{\{(~)?\s*else\b)/,/^(?:\{\{(~)?\{)/,/^(?:\{\{(~)?&)/,/^(?:\{\{!--)/,/^(?:\{\{![\s\S]*?\}\})/,/^(?:\{\{(~)?)/,/^(?:=)/,/^(?:\.\.)/,/^(?:\.(?=([=~}\s\/.)])))/,/^(?:[\/.])/,/^(?:\s+)/,/^(?:\}(~)?\}\})/,/^(?:(~)?\}\})/,/^(?:"(\\["]|[^"])*")/,/^(?:'(\\[']|[^'])*')/,/^(?:@)/,/^(?:true(?=([~}\s)])))/,/^(?:false(?=([~}\s)])))/,/^(?:-?[0-9]+(?=([~}\s)])))/,/^(?:([^\s!"#%-,\.\/;->@\[-\^`\{-~]+(?=([=~}\s\/.)]))))/,/^(?:\[[^\]]*\])/,/^(?:.)/,/^(?:$)/],a.conditions={mu:{rules:[4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32],inclusive:!1},emu:{rules:[2],inclusive:!1},com:{rules:[3],inclusive:!1},INITIAL:{rules:[0,1,32],inclusive:!0}},a}();return c.lexer=d,b.prototype=c,c.Parser=b,new b}();return a=b}(),i=function(a,b){"use strict";function c(a){return a.constructor===f.ProgramNode?a:(e.yy=f,e.parse(a))}var d={},e=a,f=b;return d.parser=e,d.parse=c,d}(h,g),j=function(a){"use strict";function b(){}function c(a,b,c){if(null==a||"string"!=typeof a&&a.constructor!==c.AST.ProgramNode)throw new f("You must pass a string or Handlebars AST to Handlebars.precompile. You passed "+a);b=b||{},"data"in b||(b.data=!0);var d=c.parse(a),e=(new c.Compiler).compile(d,b);return(new c.JavaScriptCompiler).compile(e,b)}function d(a,b,c){function d(){var d=c.parse(a),e=(new c.Compiler).compile(d,b),f=(new c.JavaScriptCompiler).compile(e,b,void 0,!0);return c.template(f)}if(null==a||"string"!=typeof a&&a.constructor!==c.AST.ProgramNode)throw new f("You must pass a string or Handlebars AST to Handlebars.compile. You passed "+a);b=b||{},"data"in b||(b.data=!0);var e;return function(a,b){return e||(e=d()),e.call(this,a,b)}}var e={},f=a;return e.Compiler=b,b.prototype={compiler:b,disassemble:function(){for(var a,b,c,d=this.opcodes,e=[],f=0,g=d.length;g>f;f++)if(a=d[f],"DECLARE"===a.opcode)e.push("DECLARE "+a.name+"="+a.value);else{b=[];for(var h=0;hc;c++){var d=this.opcodes[c],e=a.opcodes[c];if(d.opcode!==e.opcode||d.args.length!==e.args.length)return!1;for(var f=0;fc;c++)if(!this.children[c].equals(a.children[c]))return!1;return!0},guid:0,compile:function(a,b){this.opcodes=[],this.children=[],this.depths={list:[]},this.options=b;var c=this.options.knownHelpers;if(this.options.knownHelpers={helperMissing:!0,blockHelperMissing:!0,each:!0,"if":!0,unless:!0,"with":!0,log:!0},c)for(var d in c)this.options.knownHelpers[d]=c[d];return this.accept(a)},accept:function(a){var b,c=a.strip||{};return c.left&&this.opcode("strip"),b=this[a.type](a),c.right&&this.opcode("strip"),b},program:function(a){for(var b=a.statements,c=0,d=b.length;d>c;c++)this.accept(b[c]);return this.isSimple=1===d,this.depths.list=this.depths.list.sort(function(a,b){return a-b}),this},compileProgram:function(a){var b,c=(new this.compiler).compile(a,this.options),d=this.guid++;this.usePartial=this.usePartial||c.usePartial,this.children[d]=c;for(var e=0,f=c.depths.list.length;f>e;e++)b=c.depths.list[e],2>b||this.addDepth(b-1);return d},block:function(a){var b=a.mustache,c=a.program,d=a.inverse;c&&(c=this.compileProgram(c)),d&&(d=this.compileProgram(d));var e=b.sexpr,f=this.classifySexpr(e);"helper"===f?this.helperSexpr(e,c,d):"simple"===f?(this.simpleSexpr(e),this.opcode("pushProgram",c),this.opcode("pushProgram",d),this.opcode("emptyHash"),this.opcode("blockValue")):(this.ambiguousSexpr(e,c,d),this.opcode("pushProgram",c),this.opcode("pushProgram",d),this.opcode("emptyHash"),this.opcode("ambiguousBlockValue")),this.opcode("append")},hash:function(a){var b,c,d=a.pairs;this.opcode("pushHash");for(var e=0,f=d.length;f>e;e++)b=d[e],c=b[1],this.options.stringParams?(c.depth&&this.addDepth(c.depth),this.opcode("getContext",c.depth||0),this.opcode("pushStringParam",c.stringModeValue,c.type),"sexpr"===c.type&&this.sexpr(c)):this.accept(c),this.opcode("assignToHash",b[0]);this.opcode("popHash")},partial:function(a){var b=a.partialName;this.usePartial=!0,a.context?this.ID(a.context):this.opcode("push","depth0"),this.opcode("invokePartial",b.name),this.opcode("append")},content:function(a){this.opcode("appendContent",a.string)},mustache:function(a){this.sexpr(a.sexpr),a.escaped&&!this.options.noEscape?this.opcode("appendEscaped"):this.opcode("append")},ambiguousSexpr:function(a,b,c){var d=a.id,e=d.parts[0],f=null!=b||null!=c;this.opcode("getContext",d.depth),this.opcode("pushProgram",b),this.opcode("pushProgram",c),this.opcode("invokeAmbiguous",e,f)},simpleSexpr:function(a){var b=a.id;"DATA"===b.type?this.DATA(b):b.parts.length?this.ID(b):(this.addDepth(b.depth),this.opcode("getContext",b.depth),this.opcode("pushContext")),this.opcode("resolvePossibleLambda")},helperSexpr:function(a,b,c){var d=this.setupFullMustacheParams(a,b,c),e=a.id.parts[0];if(this.options.knownHelpers[e])this.opcode("invokeKnownHelper",d.length,e);else{if(this.options.knownHelpersOnly)throw new f("You specified knownHelpersOnly, but used the unknown helper "+e,a);this.opcode("invokeHelper",d.length,e,a.isRoot)}},sexpr:function(a){var b=this.classifySexpr(a);"simple"===b?this.simpleSexpr(a):"helper"===b?this.helperSexpr(a):this.ambiguousSexpr(a)},ID:function(a){this.addDepth(a.depth),this.opcode("getContext",a.depth);var b=a.parts[0];b?this.opcode("lookupOnContext",a.parts[0]):this.opcode("pushContext");for(var c=1,d=a.parts.length;d>c;c++)this.opcode("lookup",a.parts[c])},DATA:function(a){if(this.options.data=!0,a.id.isScoped||a.id.depth)throw new f("Scoped data references are not supported: "+a.original,a);this.opcode("lookupData");for(var b=a.id.parts,c=0,d=b.length;d>c;c++)this.opcode("lookup",b[c])},STRING:function(a){this.opcode("pushString",a.string)},INTEGER:function(a){this.opcode("pushLiteral",a.integer)},BOOLEAN:function(a){this.opcode("pushLiteral",a.bool)},comment:function(){},opcode:function(a){this.opcodes.push({opcode:a,args:[].slice.call(arguments,1)})},declare:function(a,b){this.opcodes.push({opcode:"DECLARE",name:a,value:b})},addDepth:function(a){0!==a&&(this.depths[a]||(this.depths[a]=!0,this.depths.list.push(a)))},classifySexpr:function(a){var b=a.isHelper,c=a.eligibleHelper,d=this.options;if(c&&!b){var e=a.id.parts[0];d.knownHelpers[e]?b=!0:d.knownHelpersOnly&&(c=!1)}return b?"helper":c?"ambiguous":"simple"},pushParams:function(a){for(var b,c=a.length;c--;)b=a[c],this.options.stringParams?(b.depth&&this.addDepth(b.depth),this.opcode("getContext",b.depth||0),this.opcode("pushStringParam",b.stringModeValue,b.type),"sexpr"===b.type&&this.sexpr(b)):this[b.type](b)},setupFullMustacheParams:function(a,b,c){var d=a.params;return this.pushParams(d),this.opcode("pushProgram",b),this.opcode("pushProgram",c),a.hash?this.hash(a.hash):this.opcode("emptyHash"),d}},e.precompile=c,e.compile=d,e}(c),k=function(a,b){"use strict";function c(a){this.value=a}function d(){}var e,f=a.COMPILER_REVISION,g=a.REVISION_CHANGES,h=a.log,i=b;d.prototype={nameLookup:function(a,b){var c,e;return 0===a.indexOf("depth")&&(c=!0),e=/^[0-9]+$/.test(b)?a+"["+b+"]":d.isValidJavaScriptVariableName(b)?a+"."+b:a+"['"+b+"']",c?"("+a+" && "+e+")":e},compilerInfo:function(){var a=f,b=g[a];return"this.compilerInfo = ["+a+",'"+b+"'];\n"},appendToBuffer:function(a){return this.environment.isSimple?"return "+a+";":{appendToBuffer:!0,content:a,toString:function(){return"buffer += "+a+";"}}},initializeBuffer:function(){return this.quotedString("")},namespace:"Handlebars",compile:function(a,b,c,d){this.environment=a,this.options=b||{},h("debug",this.environment.disassemble()+"\n\n"),this.name=this.environment.name,this.isChild=!!c,this.context=c||{programs:[],environments:[],aliases:{}},this.preamble(),this.stackSlot=0,this.stackVars=[],this.registers={list:[]},this.hashes=[],this.compileStack=[],this.inlineStack=[],this.compileChildren(a,b);
+var e,f=a.opcodes;this.i=0;for(var g=f.length;this.ie;e++)d.push("depth"+this.environment.depths.list[e]);var g=this.mergeSource();if(this.isChild||(g=this.compilerInfo()+g),a)return d.push(g),Function.apply(this,d);var i="function "+(this.name||"")+"("+d.join(",")+") {\n "+g+"}";return h("debug",i+"\n\n"),i},mergeSource:function(){for(var a,b="",c=0,d=this.source.length;d>c;c++){var e=this.source[c];e.appendToBuffer?a=a?a+"\n + "+e.content:e.content:(a&&(b+="buffer += "+a+";\n ",a=void 0),b+=e+"\n ")}return b},blockValue:function(){this.context.aliases.blockHelperMissing="helpers.blockHelperMissing";var a=["depth0"];this.setupParams(0,a),this.replaceStack(function(b){return a.splice(1,0,b),"blockHelperMissing.call("+a.join(", ")+")"})},ambiguousBlockValue:function(){this.context.aliases.blockHelperMissing="helpers.blockHelperMissing";var a=["depth0"];this.setupParams(0,a);var b=this.topStack();a.splice(1,0,b),this.pushSource("if (!"+this.lastHelper+") { "+b+" = blockHelperMissing.call("+a.join(", ")+"); }")},appendContent:function(a){this.pendingContent&&(a=this.pendingContent+a),this.stripNext&&(a=a.replace(/^\s+/,"")),this.pendingContent=a},strip:function(){this.pendingContent&&(this.pendingContent=this.pendingContent.replace(/\s+$/,"")),this.stripNext="strip"},append:function(){this.flushInline();var a=this.popStack();this.pushSource("if("+a+" || "+a+" === 0) { "+this.appendToBuffer(a)+" }"),this.environment.isSimple&&this.pushSource("else { "+this.appendToBuffer("''")+" }")},appendEscaped:function(){this.context.aliases.escapeExpression="this.escapeExpression",this.pushSource(this.appendToBuffer("escapeExpression("+this.popStack()+")"))},getContext:function(a){this.lastContext!==a&&(this.lastContext=a)},lookupOnContext:function(a){this.push(this.nameLookup("depth"+this.lastContext,a,"context"))},pushContext:function(){this.pushStackLiteral("depth"+this.lastContext)},resolvePossibleLambda:function(){this.context.aliases.functionType='"function"',this.replaceStack(function(a){return"typeof "+a+" === functionType ? "+a+".apply(depth0) : "+a})},lookup:function(a){this.replaceStack(function(b){return b+" == null || "+b+" === false ? "+b+" : "+this.nameLookup(b,a,"context")})},lookupData:function(){this.pushStackLiteral("data")},pushStringParam:function(a,b){this.pushStackLiteral("depth"+this.lastContext),this.pushString(b),"sexpr"!==b&&("string"==typeof a?this.pushString(a):this.pushStackLiteral(a))},emptyHash:function(){this.pushStackLiteral("{}"),this.options.stringParams&&(this.push("{}"),this.push("{}"))},pushHash:function(){this.hash&&this.hashes.push(this.hash),this.hash={values:[],types:[],contexts:[]}},popHash:function(){var a=this.hash;this.hash=this.hashes.pop(),this.options.stringParams&&(this.push("{"+a.contexts.join(",")+"}"),this.push("{"+a.types.join(",")+"}")),this.push("{\n "+a.values.join(",\n ")+"\n }")},pushString:function(a){this.pushStackLiteral(this.quotedString(a))},push:function(a){return this.inlineStack.push(a),a},pushLiteral:function(a){this.pushStackLiteral(a)},pushProgram:function(a){null!=a?this.pushStackLiteral(this.programExpression(a)):this.pushStackLiteral(null)},invokeHelper:function(a,b,c){this.context.aliases.helperMissing="helpers.helperMissing",this.useRegister("helper");var d=this.lastHelper=this.setupHelper(a,b,!0),e=this.nameLookup("depth"+this.lastContext,b,"context"),f="helper = "+d.name+" || "+e;d.paramsInit&&(f+=","+d.paramsInit),this.push("("+f+",helper ? helper.call("+d.callParams+") : helperMissing.call("+d.helperMissingParams+"))"),c||this.flushInline()},invokeKnownHelper:function(a,b){var c=this.setupHelper(a,b);this.push(c.name+".call("+c.callParams+")")},invokeAmbiguous:function(a,b){this.context.aliases.functionType='"function"',this.useRegister("helper"),this.emptyHash();var c=this.setupHelper(0,a,b),d=this.lastHelper=this.nameLookup("helpers",a,"helper"),e=this.nameLookup("depth"+this.lastContext,a,"context"),f=this.nextStack();c.paramsInit&&this.pushSource(c.paramsInit),this.pushSource("if (helper = "+d+") { "+f+" = helper.call("+c.callParams+"); }"),this.pushSource("else { helper = "+e+"; "+f+" = typeof helper === functionType ? helper.call("+c.callParams+") : helper; }")},invokePartial:function(a){var b=[this.nameLookup("partials",a,"partial"),"'"+a+"'",this.popStack(),"helpers","partials"];this.options.data&&b.push("data"),this.context.aliases.self="this",this.push("self.invokePartial("+b.join(", ")+")")},assignToHash:function(a){var b,c,d=this.popStack();this.options.stringParams&&(c=this.popStack(),b=this.popStack());var e=this.hash;b&&e.contexts.push("'"+a+"': "+b),c&&e.types.push("'"+a+"': "+c),e.values.push("'"+a+"': ("+d+")")},compiler:d,compileChildren:function(a,b){for(var c,d,e=a.children,f=0,g=e.length;g>f;f++){c=e[f],d=new this.compiler;var h=this.matchExistingProgram(c);null==h?(this.context.programs.push(""),h=this.context.programs.length,c.index=h,c.name="program"+h,this.context.programs[h]=d.compile(c,b,this.context),this.context.environments[h]=c):(c.index=h,c.name="program"+h)}},matchExistingProgram:function(a){for(var b=0,c=this.context.environments.length;c>b;b++){var d=this.context.environments[b];if(d&&d.equals(a))return b}},programExpression:function(a){if(this.context.aliases.self="this",null==a)return"self.noop";for(var b,c=this.environment.children[a],d=c.depths.list,e=[c.index,c.name,"data"],f=0,g=d.length;g>f;f++)b=d[f],1===b?e.push("depth0"):e.push("depth"+(b-1));return(0===d.length?"self.program(":"self.programWithDepth(")+e.join(", ")+")"},register:function(a,b){this.useRegister(a),this.pushSource(a+" = "+b+";")},useRegister:function(a){this.registers[a]||(this.registers[a]=!0,this.registers.list.push(a))},pushStackLiteral:function(a){return this.push(new c(a))},pushSource:function(a){this.pendingContent&&(this.source.push(this.appendToBuffer(this.quotedString(this.pendingContent))),this.pendingContent=void 0),a&&this.source.push(a)},pushStack:function(a){this.flushInline();var b=this.incrStack();return a&&this.pushSource(b+" = "+a+";"),this.compileStack.push(b),b},replaceStack:function(a){var b,d,e,f="",g=this.isInline();if(g){var h=this.popStack(!0);if(h instanceof c)b=h.value,e=!0;else{d=!this.stackSlot;var i=d?this.incrStack():this.topStackName();f="("+this.push(i)+" = "+h+"),",b=this.topStack()}}else b=this.topStack();var j=a.call(this,b);return g?(e||this.popStack(),d&&this.stackSlot--,this.push("("+f+j+")")):(/^stack/.test(b)||(b=this.nextStack()),this.pushSource(b+" = ("+f+j+");")),b},nextStack:function(){return this.pushStack()},incrStack:function(){return this.stackSlot++,this.stackSlot>this.stackVars.length&&this.stackVars.push("stack"+this.stackSlot),this.topStackName()},topStackName:function(){return"stack"+this.stackSlot},flushInline:function(){var a=this.inlineStack;if(a.length){this.inlineStack=[];for(var b=0,d=a.length;d>b;b++){var e=a[b];e instanceof c?this.compileStack.push(e):this.pushStack(e)}}},isInline:function(){return this.inlineStack.length},popStack:function(a){var b=this.isInline(),d=(b?this.inlineStack:this.compileStack).pop();if(!a&&d instanceof c)return d.value;if(!b){if(!this.stackSlot)throw new i("Invalid stack pop");this.stackSlot--}return d},topStack:function(a){var b=this.isInline()?this.inlineStack:this.compileStack,d=b[b.length-1];return!a&&d instanceof c?d.value:d},quotedString:function(a){return'"'+a.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")+'"'},setupHelper:function(a,b,c){var d=[],e=this.setupParams(a,d,c),f=this.nameLookup("helpers",b,"helper");return{params:d,paramsInit:e,name:f,callParams:["depth0"].concat(d).join(", "),helperMissingParams:c&&["depth0",this.quotedString(b)].concat(d).join(", ")}},setupOptions:function(a,b){var c,d,e,f=[],g=[],h=[];f.push("hash:"+this.popStack()),this.options.stringParams&&(f.push("hashTypes:"+this.popStack()),f.push("hashContexts:"+this.popStack())),d=this.popStack(),e=this.popStack(),(e||d)&&(e||(this.context.aliases.self="this",e="self.noop"),d||(this.context.aliases.self="this",d="self.noop"),f.push("inverse:"+d),f.push("fn:"+e));for(var i=0;a>i;i++)c=this.popStack(),b.push(c),this.options.stringParams&&(h.push(this.popStack()),g.push(this.popStack()));return this.options.stringParams&&(f.push("contexts:["+g.join(",")+"]"),f.push("types:["+h.join(",")+"]")),this.options.data&&f.push("data:data"),f},setupParams:function(a,b,c){var d="{"+this.setupOptions(a,b).join(",")+"}";return c?(this.useRegister("options"),b.push("options"),"options="+d):(b.push(d),"")}};for(var j="break else new var case finally return void catch for switch while continue function this with default if throw delete in try do instanceof typeof abstract enum int short boolean export interface static byte extends long super char final native synchronized class float package throws const goto private transient debugger implements protected volatile double import public let yield".split(" "),k=d.RESERVED_WORDS={},l=0,m=j.length;m>l;l++)k[j[l]]=!0;return d.isValidJavaScriptVariableName=function(a){return!d.RESERVED_WORDS[a]&&/^[a-zA-Z_$][0-9a-zA-Z_$]*$/.test(a)?!0:!1},e=d}(d,c),l=function(a,b,c,d,e){"use strict";var f,g=a,h=b,i=c.parser,j=c.parse,k=d.Compiler,l=d.compile,m=d.precompile,n=e,o=g.create,p=function(){var a=o();return a.compile=function(b,c){return l(b,c,a)},a.precompile=function(b,c){return m(b,c,a)},a.AST=h,a.Compiler=k,a.JavaScriptCompiler=n,a.Parser=i,a.parse=j,a};return g=p(),g.create=p,f=g}(f,g,i,j,k);return l}();
\ No newline at end of file
diff --git a/var/httpd/htdocs/skins/Customer/default/css/alpaca/alpaca-jqueryui-newticketwizard.css b/var/httpd/htdocs/skins/Customer/default/css/alpaca/alpaca-jqueryui-newticketwizard.css
index 6a05f83..4f96e3c 100644
--- a/var/httpd/htdocs/skins/Customer/default/css/alpaca/alpaca-jqueryui-newticketwizard.css
+++ b/var/httpd/htdocs/skins/Customer/default/css/alpaca/alpaca-jqueryui-newticketwizard.css
@@ -40,4 +40,14 @@ address:
{
z-index: 100;
}
+/*
+fieldset div{padding:0px 8px 0px 0;}
+.alpaca-controlfield {padding-bottom: 0px}
+
+.alpaca-field {padding-top: 0px}*/
+
+
+.alpaca-controlfield-label {
+ width: 280px;
+}
diff --git a/var/httpd/htdocs/skins/Customer/default/css/alpaca/alpaca-newticketwizard.css b/var/httpd/htdocs/skins/Customer/default/css/alpaca/alpaca-newticketwizard.css
index 695e629..e65ac73 100644
--- a/var/httpd/htdocs/skins/Customer/default/css/alpaca/alpaca-newticketwizard.css
+++ b/var/httpd/htdocs/skins/Customer/default/css/alpaca/alpaca-newticketwizard.css
@@ -52,7 +52,7 @@ address:
*/
.alpaca-controlfield {
display: block;
- padding: 2px;
+ padding: 1px;
margin: 2px;
vertical-align: middle;
}
@@ -63,8 +63,8 @@ address:
.alpaca-controlfield-container {
display: block;
- padding-top: 4px;
- padding-bottom: 4px;
+ padding-top: 1px;
+ padding-bottom: 1px;
}
.alpaca-controlfield-label
@@ -74,7 +74,7 @@ address:
text-align: right;
margin-left: 1px;
float: left;
- width: 100px;
+ width: 200px;
padding-top: 0px;
padding-bottom: 0px;
vertical-align: middle;
@@ -215,6 +215,10 @@ DIV.alpaca-controlfield-text .twitter-typeahead .tt-dropdown-menu P
line-height: 16px;
}
+.alpaca-controlfield-helper {
+ margin-left: 200px;
+}
+
/* END styles for Date Field, Phone Field, Password Field and Email Field */
/* BEGIN styles for Address Map Field */
@@ -416,7 +420,7 @@ legend.alpaca-fieldset-legend {
.alpaca-fieldset-helper {
padding-top: 10px;
- padding-bottom: 5px;
+ padding-bottom: 0px;
clear: both;
}
@@ -776,7 +780,7 @@ fieldset.alpaca-view-web-edit-yaml.alpaca-fieldset {
border-radius: 5px;
margin: 1px 0 0 0;
padding-top: 4px;
- padding-bottom: 2px;
+ padding-bottom: 1px;
}
/*hide the arrow icon before the fieldset name*/
@@ -924,6 +928,12 @@ fieldset DIV {
vertical-align: middle !important;
}
+.alpaca-fieldset-item-container {
+ padding-bottom: 0px;
+ padding-top: 0px;
+
+}
+
/* To Remove up/down buttons on items
--
libgit2 0.21.2