Commit 021c10d174acf077dc6b4d47557344dd6e26d3d3

Authored by Rodrigo Gonçalves
1 parent 7a5b290b
Exists in master

Ajustes para funcionar o CAS diretamente

FixTemplateGenerator.diff 0 → 100644
... ... @@ -0,0 +1,11 @@
  1 +1264,1266c1264,1269
  2 +< $Data{$Attribute} = $Kernel::OM->Get('Kernel::System::HTMLUtils')->ToHTML(
  3 +< String => $Data{$Attribute},
  4 +< );
  5 +---
  6 +> # Fix to allow HTML text in body
  7 +> if (!($Attribute eq "Body")) {
  8 +> $Data{$Attribute} = $Kernel::OM->Get('Kernel::System::HTMLUtils')->ToHTML(
  9 +> String => $Data{$Attribute},
  10 +> );
  11 +> }
... ...
Kernel/Modules/NewTicketWizard.pm
... ... @@ -3,6 +3,7 @@
3 3 #
4 4 # Copyright (C) SeTIC - UFSC - http://setic.ufsc.br/
5 5 # Version 01/08/2015 - Support for OTRS 4.0.3
  6 +# Version 25/06/2015 - Support for HTML formatting of form fields
6 7 #
7 8 # --
8 9 # This software comes with ABSOLUTELY NO WARRANTY. For details, see
... ... @@ -206,12 +207,15 @@ sub GetFormJSON {
206 207 my $LayoutObject = $Kernel::OM->Get("Kernel::Output::HTML::Layout");
207 208 my $ParamObject = $Kernel::OM->Get("Kernel::System::Web::Request");
208 209  
209   - if ( $Param{ServiceID} ) {
210   - %serviceForm = $ServiceFormObject->GetServiceForm( ServiceID => $Param{ServiceID} );
211   - }
212   -
213 210 my $QueueID = $ParamObject->GetParam( Param => "QueueID" );
214 211  
  212 + if ( $Param{ServiceID} ) {
  213 + %serviceForm = $ServiceFormObject->GetServiceFormForQueue( ServiceID => $Param{ServiceID}, QueueID => $QueueID );
  214 + if (! $serviceForm{ServiceID}) {
  215 + %serviceForm = $ServiceFormObject->GetServiceForm( ServiceID => $Param{ServiceID} );
  216 + }
  217 + }
  218 +
215 219 my ( $schema, $fields, $introduction ) = $Self->GetForm( ServiceForm => \%serviceForm, QueueID => $QueueID );
216 220  
217 221 return $LayoutObject->Attachment(
... ... @@ -257,8 +261,13 @@ sub GetForm {
257 261 $schema =~ s/CF_SCHEMA/$schemaForm/g;
258 262 $fields =~ s/CF_FORM/$fieldsForm/g;
259 263 }
  264 +
  265 + # Ajusta campos fixos, se houver
  266 + if ($serviceForm{FixedValues}) {
  267 + ($schema, $fields) = $Self->AdjustFixedFields(Schema => $schema, Fields => $fields, FixedValues => $serviceForm{FixedValues});
  268 + }
260 269 }
261   -
  270 +
262 271 # Incluir campos dinâmicos no replace
263 272 ( $schema, $fields ) = $TicketWizard->ReplaceOTRSDynamicFields( Schema => $schema, Options => $fields );
264 273  
... ... @@ -350,17 +359,33 @@ sub CreateTicket {
350 359 UserID => $ConfigObject->Get('CustomerPanelUserID'),
351 360 );
352 361  
353   - my $MimeType = 'text/plain';
  362 + my $MimeType = 'text/html';
354 363 my $serviceFields = "";
355 364  
356 365 # Service Fields
357 366 for ( $ParamObject->GetParamNames() ) {
358 367 if ( substr( $_, 0, 3 ) eq "SF_" ) {
359   - $serviceFields .= substr( $_, 3 ) . ": " . $ParamObject->GetParam( Param => $_ ) . "\n";
  368 + if ($ParamObject->GetArray( Param => $_ )) {
  369 + my @paramVals = $ParamObject->GetArray( Param => $_ );
  370 + for my $paramValue (@paramVals) {
  371 + if (($paramValue) && (!($paramValue eq "-"))) {
  372 + $serviceFields .= "<B>" . $Self->breakWords(Text => substr( $_, 3 )) . ": </B>" . $paramValue . "<BR/>";
  373 + }
  374 + }
  375 +
  376 + } else {
  377 + my $paramValue = $ParamObject->GetParam( Param => $_ );
  378 +
  379 + if (($paramValue) && (!($paramValue eq "-"))) {
  380 + $serviceFields .= "<B>" . $Self->breakWords(Text => substr( $_, 3 )) . ": </B>" . $ParamObject->GetParam( Param => $_ ) . "<BR/>";
  381 + }
  382 + }
360 383 }
361 384 }
362   - $serviceFields .= "Login autenticado: " . $Self->{UserLogin} . "\n";
363   - $serviceFields .= "\n\n";
  385 +
  386 + $serviceFields .= "<B>Login autenticado: </B>" . $Self->{UserLogin} . "<BR/>";
  387 + $serviceFields .= "<B>IP: </B>" . $ENV{'REMOTE_ADDR'} . "<BR/>";
  388 + $serviceFields .= "<BR/><BR/>";
364 389  
365 390 # Dynamic Fields
366 391 for ( $ParamObject->GetParamNames() ) {
... ... @@ -397,7 +422,7 @@ sub CreateTicket {
397 422 From => $From,
398 423 To => $Queue,
399 424 Subject => $ParamObject->GetParam( Param => "subject" ),
400   - Body => $serviceFields . $ParamObject->GetParam( Param => "description" ),
  425 + Body => $serviceFields . $Self->lineBreakToHTML(Text => $ParamObject->GetParam( Param => "description" )),
401 426 },
402 427 Queue => $Queue,
403 428 );
... ... @@ -430,4 +455,57 @@ sub CreateTicket {
430 455  
431 456 }
432 457  
  458 +sub AdjustFixedFields {
  459 + my ( $Self, %Param ) = @_;
  460 + my $schema = $Param{Schema};
  461 + my $form = $Param{Fields};
  462 + my $fixedValues = $Param{FixedValues};
  463 +
  464 + my @values = split(/\n/, $fixedValues);
  465 +
  466 +
  467 + for my $value (@values) {
  468 + $value =~ s/\r//g;
  469 + my @data = split('=', $value);
  470 +
  471 + my $fieldKey = $data[0];
  472 + my $fixedValue = $data[1];
  473 +
  474 + my $key = '("' . $fieldKey . '"[\ ]?:[\ ]?{[^}]+})';
  475 + my $replace = '"' . $fieldKey . '"' . ': {"type": "string", "default": "' . $fixedValue . '"}';
  476 +
  477 + $schema =~ s/$key/$replace/;
  478 +
  479 + $key = '("' . $fieldKey . '"[\ ]?:[\ ]?{[^}]+})';
  480 + $replace = '"' . $fieldKey . '": {"type": "hidden"' . "\n}";
  481 + $form =~ s/$key/$replace/;
  482 + }
  483 +
  484 + return ($schema, $form);
  485 +
  486 +}
  487 +
  488 +sub lineBreakToHTML {
  489 + my ( $Self, %Param ) = @_;
  490 +
  491 + my $return = $Param{Text};
  492 + my $LINE_BREAK = "<BR/>";
  493 +
  494 + $return =~ s/\n/$LINE_BREAK/g;
  495 +
  496 + return $return;
  497 +
  498 +}
  499 +
  500 +sub breakWords {
  501 + my ( $Self, %Param ) = @_;
  502 +
  503 + my $return = $Param{Text};
  504 +
  505 + $return =~ s/(.)([A-Z][^A-Z])/$1 $2/g;
  506 + $return =~ s/([\w']+)/\u\L$1/g;
  507 +
  508 + return $return;
  509 +}
  510 +
433 511 1;
... ...
Kernel/Modules/NewTicketWizardPublic.pm
... ... @@ -3,6 +3,7 @@
3 3 #
4 4 # Copyright (C) SeTIC - UFSC - http://setic.ufsc.br/
5 5 # Version 01/08/2015 - Support for OTRS 4.0.3
  6 +# Version 25/06/2015 - Support for restricted services and HTML formatting of form fields
6 7 #
7 8 # --
8 9 # This software comes with ABSOLUTELY NO WARRANTY. For details, see
... ... @@ -34,7 +35,8 @@ our @ObjectDependencies = (
34 35 "Kernel::Output::HTML::Layout",
35 36 "KerneL::System::Log",
36 37 "Kernel::System::Queue",
37   -"Kernel::Config"
  38 +"Kernel::Config",
  39 +"Kernel::System::RestrictedService"
38 40 );
39 41  
40 42 sub new {
... ... @@ -55,6 +57,7 @@ sub BuildServices {
55 57 my $ConfigObject = $Kernel::OM->Get("Kernel::Config");
56 58 my $LayoutObject = $Kernel::OM->Get("Kernel::Output::HTML::Layout");
57 59 my $ServiceObject = $Kernel::OM->Get("Kernel::System::Service");
  60 + my $RestrictedObject = $Kernel::OM->Get("Kernel::System::RestrictedService");
58 61  
59 62 # Build service chooser
60 63 my %Services = ();
... ... @@ -67,25 +70,32 @@ sub BuildServices {
67 70 $QueueServiceObject->GetServiceList( QueueID => $ParamObject->GetParam( Param => "QueueID" ), );
68 71 }
69 72 my @ServicesCombo = ();
  73 +
  74 + my @restrictedServices = $RestrictedObject->GetRestrictedServices();
70 75  
71 76 for my $serviceID ( keys %Services ) {
72 77 if ( grep { index( $Services{$_}, $Services{$serviceID} . "::" ) >= 0 } ( keys %Services ) ) {
73   - my %serv = ();
74   - $serv{Value} = $Services{$serviceID};
75   - $serv{Key} = $serviceID;
76   - $serv{Disabled} = 1;
77   - push @ServicesCombo, \%serv;
  78 +
  79 + if (! ( $serviceID ~~ @restrictedServices ) ) {
  80 + my %serv = ();
  81 + $serv{Value} = $Services{$serviceID};
  82 + $serv{Key} = $serviceID;
  83 + $serv{Disabled} = 1;
  84 + push @ServicesCombo, \%serv;
  85 + }
78 86 }
79 87 else {
80   - my %serv = ();
81   - $serv{Value} = $Services{$serviceID};
82   - $serv{Key} = $serviceID;
83   - push @ServicesCombo, \%serv;
  88 + if (! ( $serviceID ~~ @restrictedServices ) ) {
  89 + my %serv = ();
  90 + $serv{Value} = $Services{$serviceID};
  91 + $serv{Key} = $serviceID;
  92 + push @ServicesCombo, \%serv;
  93 + }
84 94 }
85 95 }
86 96  
87 97 @ServicesCombo = sort { $a->{Value} . "::" cmp $b->{Value} . "::" } @ServicesCombo;
88   -
  98 +
89 99 my $retorno = $LayoutObject->BuildSelection(
90 100 Data => \@ServicesCombo,
91 101 Name => 'ServiceID',
... ... @@ -200,12 +210,16 @@ sub GetFormJSON {
200 210 my $LayoutObject = $Kernel::OM->Get("Kernel::Output::HTML::Layout");
201 211 my $ParamObject = $Kernel::OM->Get("Kernel::System::Web::Request");
202 212  
  213 + my $QueueID = $ParamObject->GetParam(Param => "QueueID");
  214 +
203 215 if ( $Param{ServiceID} ) {
204   - %serviceForm = $ServiceFormObject->GetServiceForm( ServiceID => $Param{ServiceID} );
  216 + %serviceForm = $ServiceFormObject->GetServiceFormForQueue( ServiceID => $Param{ServiceID}, QueueID => $QueueID );
  217 +
  218 + if (! $serviceForm{ServiceID}) {
  219 + %serviceForm = $ServiceFormObject->GetServiceForm( ServiceID => $Param{ServiceID} );
  220 + }
205 221 }
206 222  
207   - my $QueueID = $ParamObject->GetParam(Param => "QueueID");
208   -
209 223 my ( $schema, $fields, $introduction ) = $Self->GetForm( ServiceForm => \%serviceForm, QueueID => $QueueID );
210 224  
211 225 return $LayoutObject->Attachment(
... ... @@ -251,6 +265,12 @@ sub GetForm {
251 265 $schema =~ s/CF_SCHEMA/$schemaForm/g;
252 266 $fields =~ s/CF_FORM/$fieldsForm/g;
253 267 }
  268 +
  269 + # Ajusta campos fixos, se houver
  270 + if ($serviceForm{FixedValues}) {
  271 +
  272 + ($schema, $fields) = $Self->AdjustFixedFields(Schema => $schema, Fields => $fields, FixedValues => $serviceForm{FixedValues});
  273 + }
254 274 }
255 275  
256 276 # Incluir campos dinâmicos no replace
... ... @@ -373,17 +393,32 @@ sub CreateTicket {
373 393 UserID => $Self->{DefaultUserID},
374 394 );
375 395  
376   - my $MimeType = 'text/plain';
  396 + my $MimeType = 'text/html';
377 397 my $serviceFields = "";
378 398  
379 399 # Service Fields
380 400 for ( $ParamObject->GetParamNames() ) {
381 401 if ( substr( $_, 0, 3 ) eq "SF_" ) {
382   - $serviceFields .= substr( $_, 3 ) . ": " . $ParamObject->GetParam( Param => $_ ) . "\n";
  402 + if ($ParamObject->GetArray( Param => $_ )) {
  403 + my @paramVals = $ParamObject->GetArray( Param => $_ );
  404 + for my $paramValue (@paramVals) {
  405 + if (($paramValue) && (!($paramValue eq "-"))) {
  406 + $serviceFields .= "<B>" . $Self->breakWords(Text => substr( $_, 3 )) . ": </B>" . $paramValue . "<BR/>";
  407 + }
  408 + }
  409 +
  410 + } else {
  411 + my $paramValue = $ParamObject->GetParam( Param => $_ );
  412 +
  413 + if (($paramValue) && (!($paramValue eq "-"))) {
  414 + $serviceFields .= "<B>" . $Self->breakWords(Text => substr( $_, 3 )) . ": </B>" . $ParamObject->GetParam( Param => $_ ) . "<BR/>";
  415 + }
  416 + }
383 417 }
384 418 }
385 419  
386   - $serviceFields .= "\n\n";
  420 + $serviceFields .= "<B>IP: </B>" . $ENV{'REMOTE_ADDR'} . "<BR/>";
  421 + $serviceFields .= "<BR/><BR/>";
387 422  
388 423 # Dynamic Fields
389 424 for ( $ParamObject->GetParamNames() ) {
... ... @@ -421,7 +456,7 @@ sub CreateTicket {
421 456 From => $From,
422 457 To => $Queue,
423 458 Subject => $ParamObject->GetParam( Param => "subject" ),
424   - Body => $serviceFields . $ParamObject->GetParam( Param => "description" ),
  459 + Body => $serviceFields . $Self->lineBreakToHTML(Text => $ParamObject->GetParam( Param => "description" )),
425 460 },
426 461 Queue => $Queue,
427 462 );
... ... @@ -453,4 +488,58 @@ sub CreateTicket {
453 488  
454 489 }
455 490  
  491 +
  492 +sub AdjustFixedFields {
  493 + my ( $Self, %Param ) = @_;
  494 + my $schema = $Param{Schema};
  495 + my $form = $Param{Fields};
  496 + my $fixedValues = $Param{FixedValues};
  497 +
  498 + my @values = split(/\n/, $fixedValues);
  499 +
  500 + for my $value (@values) {
  501 +
  502 + $value =~ s/\r//g;
  503 + my @data = split('=', $value);
  504 +
  505 + my $fieldKey = $data[0];
  506 + my $fixedValue = $data[1];
  507 +
  508 + my $key = '("' . $fieldKey . '"[\ ]?:[\ ]?{[^}]+})';
  509 + my $replace = '"' . $fieldKey . '"' . ': {"type": "string", "default": "' . $fixedValue . '"}';
  510 +
  511 + $schema =~ s/$key/$replace/;
  512 +
  513 + $key = '("' . $fieldKey . '"[\ ]?:[\ ]?{[^}]+})';
  514 + $replace = '"' . $fieldKey . '": {"type": "hidden"' . "\n}";
  515 + $form =~ s/$key/$replace/;
  516 + }
  517 +
  518 + return ($schema, $form);
  519 +
  520 +}
  521 +
  522 +sub lineBreakToHTML {
  523 + my ( $Self, %Param ) = @_;
  524 +
  525 + my $return = $Param{Text};
  526 + my $LINE_BREAK = "<BR/>";
  527 +
  528 + $return =~ s/\n/$LINE_BREAK/g;
  529 +
  530 + return $return;
  531 +
  532 +}
  533 +
  534 +sub breakWords {
  535 + my ( $Self, %Param ) = @_;
  536 +
  537 + my $return = $Param{Text};
  538 +
  539 + $return =~ s/(.)([A-Z][^A-Z])/$1 $2/g;
  540 + $return =~ s/([\w']+)/\u\L$1/g;
  541 +
  542 + return $return;
  543 +}
  544 +
456 545 1;
... ...
Kernel/Modules/NewTicketWizardServiceForm.pm
... ... @@ -53,12 +53,22 @@ sub Run {
53 53 my $Output = $LayoutObject->Header();
54 54 $Output .= $LayoutObject->NavigationBar();
55 55  
56   - my %serviceForm = $ServiceFormObject->GetServiceForm( ServiceID => $ParamObject->GetParam( Param => "ServiceID" ) );
  56 + my %serviceForm;
  57 +
  58 + # if form specific for queue
  59 + if ($ParamObject->GetParam( Param => "QueueID" )) {
  60 + %serviceForm = $ServiceFormObject->GetServiceFormForQueue( ServiceID => $ParamObject->GetParam( Param => "ServiceID" ),
  61 + QueueID => $ParamObject->GetParam( Param => "QueueID" ) );
  62 + } else {
  63 + %serviceForm = $ServiceFormObject->GetServiceForm( ServiceID => $ParamObject->GetParam( Param => "ServiceID" ) );
  64 + }
57 65  
58 66 $Data{Introduction} = $serviceForm{Introduction};
59 67 $Data{Form} = $serviceForm{Form};
60 68 $Data{Schema} = $serviceForm{Schema};
  69 + $Data{FixedValues} = $serviceForm{FixedValues};
61 70 $Data{ServiceID} = $ParamObject->GetParam( Param => "ServiceID" );
  71 + $Data{QueueID} = $ParamObject->GetParam( Param => "QueueID" );
62 72  
63 73 $Output .= $LayoutObject->Output(
64 74 Data => \%Data,
... ... @@ -76,12 +86,25 @@ sub Run {
76 86 my $Output = $LayoutObject->Header();
77 87 $Output .= $LayoutObject->NavigationBar();
78 88  
79   - $ServiceFormObject->SaveServiceForm(
80   - ServiceID => $ParamObject->GetParam( Param => "ServiceID" ),
81   - Introduction => $ParamObject->GetParam( Param => "Introduction" ),
82   - Form => $ParamObject->GetParam( Param => "Form" ),
83   - Schema => $ParamObject->GetParam( Param => "Schema" ),
84   - );
  89 + # If form is specific for a queue
  90 + if ($ParamObject->GetParam( Param => "QueueID" )) {
  91 + $ServiceFormObject->SaveServiceFormForQueue(
  92 + ServiceID => $ParamObject->GetParam( Param => "ServiceID" ),
  93 + QueueID => $ParamObject->GetParam( Param => "QueueID" ),
  94 + Introduction => $ParamObject->GetParam( Param => "Introduction" ),
  95 + Form => $ParamObject->GetParam( Param => "Form" ),
  96 + Schema => $ParamObject->GetParam( Param => "Schema" ),
  97 + FixedValues => $ParamObject->GetParam( Param => "FixedValues" ),
  98 + );
  99 + } else {
  100 + $ServiceFormObject->SaveServiceForm(
  101 + ServiceID => $ParamObject->GetParam( Param => "ServiceID" ),
  102 + Introduction => $ParamObject->GetParam( Param => "Introduction" ),
  103 + Form => $ParamObject->GetParam( Param => "Form" ),
  104 + Schema => $ParamObject->GetParam( Param => "Schema" ),
  105 + FixedValues => $ParamObject->GetParam( Param => "FixedValues" ),
  106 + );
  107 + }
85 108  
86 109 return $Self->Overview();
87 110 }
... ...
Kernel/Output/HTML/Standard/NewTicketWizardServiceFormEdit.tt
... ... @@ -21,6 +21,7 @@
21 21 <input type="hidden" name="Action" value="[% Env("Action") %]"/>
22 22 <input type="hidden" name="Subaction" value="ServiceSave"/>
23 23 <input type="hidden" name="ServiceID" value="[% Data.ServiceID | html %]"/>
  24 + <input type="hidden" name="QueueID" value="[% Data.QueueID | html %]"/>
24 25  
25 26 <fieldset class="TableLike">
26 27  
... ... @@ -41,7 +42,13 @@
41 42 <textarea name="Schema" id="Schema" class="W50pc " rows="20">[% Data.Schema | html %]</textarea>
42 43 </div>
43 44 <div class="Clear"></div>
44   -
  45 +
  46 + <label for="FixedValues">[% Translate("Fixed values") | html %]: </label>
  47 + <div class="Field">
  48 + <textarea name="FixedValues" id="FixedValues" class="W50pc " rows="20">[% Data.FixedValues | html %]</textarea>
  49 + </div>
  50 + <div class="Clear"></div>
  51 +
45 52 <div class="Field SpacingTop">
46 53 <button class="Primary" type="submit" value="[% Translate("Submit") | html %]">[% Translate("Submit") | html %]</button>
47 54 [% Translate("or") | html %]
... ...
Kernel/System/RestrictedService.pm 0 → 100644
... ... @@ -0,0 +1,89 @@
  1 +# --
  2 +# Kernel/System/RestrictedService.pm - core module
  3 +#
  4 +# Copyright (C) SeTIC - UFSC - http://setic.ufsc.br/
  5 +# Version 2015-06-24 - First version
  6 +#
  7 +# Manages which services should only be allowed in the logged in interface for OTRS
  8 +#
  9 +# --
  10 +# This software comes with ABSOLUTELY NO WARRANTY. For details, see
  11 +# the enclosed file COPYING for license information (AGPL). If you
  12 +# did not receive this file, see http://www.gnu.org/licenses/agpl.txt.
  13 +# --
  14 +package Kernel::System::RestrictedService;
  15 +
  16 +use strict;
  17 +use warnings;
  18 +use utf8;
  19 +
  20 +our @ObjectDependencies = (
  21 +"Kernel::System::DB",
  22 +"Kernel::System::Log");
  23 +
  24 +
  25 +sub new {
  26 + my ( $Type, %Param ) = @_;
  27 +
  28 + # allocate new hash for object
  29 + my $Self = {%Param};
  30 + bless( $Self, $Type );
  31 +
  32 + return $Self;
  33 +}
  34 +
  35 +=head
  36 +
  37 +Returns a service form
  38 +
  39 +@IdsRestrictedServices
  40 +
  41 +=cut
  42 +
  43 +sub GetRestrictedServices {
  44 +
  45 + my ( $Self, %Param ) = @_;
  46 +
  47 + my $DBObject = $Kernel::OM->Get("Kernel::System::DB");
  48 +
  49 + # get service form from db
  50 + $DBObject->Prepare(
  51 + SQL => 'SELECT service_id from restricted_service order by service_id asc'
  52 + );
  53 +
  54 + # fetch the result
  55 + my @ServiceData;
  56 + while ( my @Row = $DBObject->FetchrowArray() ) {
  57 + push(@ServiceData,$Row[0]);
  58 + }
  59 +
  60 + return @ServiceData;
  61 +}
  62 +
  63 +=head
  64 +
  65 +@IdsList
  66 +
  67 +Sets the list of restricted services
  68 +
  69 +=cut
  70 +sub SetRestrictedServices {
  71 +
  72 + my ( $Self, @Param ) = @_;
  73 +
  74 + my $DBObject = $Kernel::OM->Get("Kernel::System::DB");
  75 + my $idsString = join(",", @Param);
  76 +
  77 + # delete old services
  78 + $DBObject->Do(SQL => 'DELETE FROM restricted_service where service_id NOT IN (' . $idsString . ')');
  79 +
  80 + # add new services
  81 + while (my $id = @Param) {
  82 + $DBObject->Do(SQL => 'REPLACE INTO restricted_service (service_id) VALUES (' . $id . ')');
  83 + }
  84 +
  85 + return 1;
  86 +}
  87 +
  88 +
  89 +1;
... ...
Kernel/System/ServiceForm.pm
... ... @@ -44,7 +44,7 @@ sub GetServiceForm {
44 44  
45 45 # get service form from db
46 46 $DBObject->Prepare(
47   - SQL => 'SELECT service_id, introduction, form, form_schema FROM service_form WHERE service_id = ?',
  47 + SQL => 'SELECT service_id, introduction, form, form_schema, fixed_values FROM service_form WHERE service_id = ? and queue_id is null',
48 48 Bind => [ \$Param{ServiceID} ],
49 49 Limit => 1,
50 50 );
... ... @@ -55,7 +55,40 @@ sub GetServiceForm {
55 55 $ServiceData{ServiceID} = $Row[0];
56 56 $ServiceData{Introduction} = $Row[1];
57 57 $ServiceData{Form} = $Row[2];
58   - $ServiceData{Schema} = $Row[3];
  58 + $ServiceData{Schema} = $Row[3];
  59 + $ServiceData{FixedValues} = $Row[4];
  60 + }
  61 +
  62 + return %ServiceData;
  63 +}
  64 +
  65 +=head
  66 +
  67 +Returns a service form for a give queue
  68 +
  69 +=cut
  70 +
  71 +sub GetServiceFormForQueue {
  72 +
  73 + my ( $Self, %Param ) = @_;
  74 +
  75 + my $DBObject = $Kernel::OM->Get("Kernel::System::DB");
  76 +
  77 + # get service form from db
  78 + $DBObject->Prepare(
  79 + SQL => 'SELECT service_id, introduction, form, form_schema, fixed_values FROM service_form WHERE service_id = ? and queue_id = ? ',
  80 + Bind => [ \$Param{ServiceID}, \$Param{QueueID} ],
  81 + Limit => 1,
  82 + );
  83 +
  84 + # fetch the result
  85 + my %ServiceData;
  86 + while ( my @Row = $DBObject->FetchrowArray() ) {
  87 + $ServiceData{ServiceID} = $Row[0];
  88 + $ServiceData{Introduction} = $Row[1];
  89 + $ServiceData{Form} = $Row[2];
  90 + $ServiceData{Schema} = $Row[3];
  91 + $ServiceData{FixedValues} = $Row[4];
59 92 }
60 93  
61 94 return %ServiceData;
... ... @@ -86,14 +119,55 @@ sub SaveServiceForm {
86 119 my $update = ($serviceForm{ServiceID});
87 120  
88 121 if ($update) {
89   - $DBObject->Do(SQL => 'UPDATE service_form SET introduction=?,form=?,form_schema=? where service_id=?',
  122 + $DBObject->Do(SQL => 'UPDATE service_form SET introduction=?,form=?,form_schema=?,fixed_values=? where service_id=? and queue_id is null',
  123 + Bind => [
  124 + \$Param{Introduction}, \$Param{Form}, \$Param{Schema}, \$Param{FixedValues}, \$Param{ServiceID}
  125 + ]);
  126 + } else {
  127 + $DBObject->Do(SQL => 'INSERT INTO service_form(service_id,introduction,form,form_schema,fixed_values) VALUES (?,?,?,?,?)',
  128 + Bind => [
  129 + \$Param{ServiceID}, \$Param{Introduction}, \$Param{Form}, \$Param{Schema}, \$Param{FixedValues}
  130 + ]);
  131 + }
  132 +
  133 + return 1;
  134 +
  135 +}
  136 +
  137 +
  138 +=head
  139 +
  140 +Saves a service form for a give queue.
  141 +
  142 +=cut
  143 +
  144 +sub SaveServiceFormForQueue {
  145 +
  146 + my ( $Self, %Param ) = @_;
  147 + my $DBObject = $Kernel::OM->Get("Kernel::System::DB");
  148 +
  149 + for my $Argument (qw(ServiceID Introduction)) {
  150 + if ( !$Param{$Argument} ) {
  151 + $Kernel::OM->Get("Kernel::System::Log")->Log(
  152 + Priority => 'error',
  153 + Message => "Need $Argument!",
  154 + );
  155 + return;
  156 + }
  157 + }
  158 +
  159 + my %serviceForm = $Self->GetServiceFormForQueue(ServiceID => $Param{ServiceID}, QueueID => $Param{QueueID});
  160 + my $update = ($serviceForm{ServiceID});
  161 +
  162 + if ($update) {
  163 + $DBObject->Do(SQL => 'UPDATE service_form SET introduction=?,form=?,form_schema=?,fixed_values=? where service_id=? and queue_id=? ',
90 164 Bind => [
91   - \$Param{Introduction}, \$Param{Form}, \$Param{Schema}, \$Param{ServiceID}
  165 + \$Param{Introduction}, \$Param{Form}, \$Param{Schema}, \$Param{FixedValues}, \$Param{ServiceID}, \$Param{QueueID}
92 166 ]);
93 167 } else {
94   - $DBObject->Do(SQL => 'INSERT INTO service_form(service_id,introduction,form,form_schema) VALUES (?,?,?,?)',
  168 + $DBObject->Do(SQL => 'INSERT INTO service_form(service_id,introduction,form,form_schema,queue_id,fixed_values) VALUES (?,?,?,?,?,?)',
95 169 Bind => [
96   - \$Param{ServiceID}, \$Param{Introduction}, \$Param{Form}, \$Param{Schema}
  170 + \$Param{ServiceID}, \$Param{Introduction}, \$Param{Form}, \$Param{Schema}, \$Param{QueueID}, \$Param{FixedValues}
97 171 ]);
98 172 }
99 173  
... ...
NewTicketWizard.sopm
1 1 <?xml version="1.0" encoding="utf-8" ?>
2 2 <otrs_package version="1.0">
3 3 <Name>NewTicketWizard</Name>
4   - <Version>1.5.3</Version>
  4 + <Version>1.7.7</Version>
5 5 <Framework>4.0.x</Framework>
6 6 <Vendor>SeTIC</Vendor>
7 7 <URL>http://www.setic.ufsc.br</URL>
... ... @@ -9,6 +9,11 @@
9 9 <Description>NewTicket Wizard Module</Description>
10 10 <ChangeLog version="1.5.0">Support for OTRS 4.0.3, QueuesPanel Module Separation</ChangeLog>
11 11 <ChangeLog version="1.5.0">AlpacaJS adjustment for OTRS 4.0.4</ChangeLog>
  12 + <ChangeLog version="1.6.1">Support for specific form per queue</ChangeLog>
  13 + <ChangeLog version="1.7.0">Support for fixed field values and IP in created ticket</ChangeLog>
  14 + <ChangeLog version="1.7.3">Support to set any field value</ChangeLog>
  15 + <ChangeLog version="1.7.4">Support for multi-value fields</ChangeLog>
  16 + <ChangeLog version="1.7.7">Support for restricted services</ChangeLog>
12 17 <IntroInstall Type="post" Title="Thank you">New Ticket Wizard module installed successfully!</IntroInstall>
13 18 <BuildDate>?</BuildDate>
14 19 <BuildHost>?</BuildHost>
... ... @@ -22,6 +27,7 @@
22 27 <File Permission="644" Location="Kernel/Modules/NewTicketWizard.pm"></File>
23 28 <File Permission="644" Location="Kernel/Modules/NewTicketWizardPublic.pm"></File>
24 29 <File Permission="644" Location="Kernel/Modules/NewTicketWizardServiceForm.pm"></File>
  30 + <File Permission="644" Location="Kernel/System/RestrictedService.pm"></File>
25 31  
26 32 <File Permission="644" Location="Kernel/Output/HTML/Standard/NewTicketWizard.tt"></File>
27 33 <File Permission="644" Location="Kernel/Output/HTML/Standard/NewTicketWizardPublic.tt"></File>
... ... @@ -58,9 +64,26 @@
58 64 <Column Name="introduction" Required="true" Type="text"/>
59 65 <Column Name="form" Required="true" Type="text"/>
60 66 <Column Name="form_schema" Required="true" Type="text"/>
  67 + <Column Name="queue_id" Required="false" Type="int"/>
61 68 <ForeignKey ForeignTable="service">
62 69 <Reference Local="service_id" Foreign="id"/>
63 70 </ForeignKey>
  71 + <ForeignKey ForeignTable="queue">
  72 + <Reference Local="queue_id" Foreign="id"/>
  73 + </ForeignKey>
64 74 </TableCreate>
65 75 </DatabaseInstall>
  76 + <DatabaseUpgrade Version="1.6.2">
  77 + <TableCreate Name="service_form">
  78 + <Column Name="queue_id" Required="false" Type="int"/>
  79 + <ForeignKey ForeignTable="queue">
  80 + <Reference Local="queue_id" Foreign="id"/>
  81 + </ForeignKey>
  82 + </TableCreate>
  83 + <TableCreate Name="restricted_service">
  84 + <Column Name="service_id" Required="true" Type="int" PrimaryKey="true"/>
  85 + </TableCreate>
  86 + </DatabaseUpgrade>
  87 +
  88 +
66 89 </otrs_package>
67 90 \ No newline at end of file
... ...
scripts/test/SchemaTest.t 0 → 100644
... ... @@ -0,0 +1,145 @@
  1 +# --
  2 +# Responsibility.t - Responsiblity tests
  3 +# Copyright (C) 2014 OTRS AG, http://otrs.com/
  4 +# --
  5 +# This software comes with ABSOLUTELY NO WARRANTY. For details, see
  6 +# the enclosed file COPYING for license information (AGPL). If you
  7 +# did not receive this file, see http://www.gnu.org/licenses/agpl.txt.
  8 +# --
  9 +# Autor: Rodrigo Gonçalves
  10 +# Data.: 04/08/2014 - versão inicial
  11 +#
  12 +
  13 +#
  14 +# alter table service_form add fixed_values text;
  15 +#
  16 +#
  17 +
  18 +use strict;
  19 +use warnings;
  20 +use vars (qw($Self));
  21 +
  22 +my $schema = '
  23 +"service": {
  24 + "type": "string",
  25 + "required": "true"
  26 + },
  27 + "DF_unidade": {
  28 + "type": "string",
  29 + "enum": [
  30 + DF_unidade_values
  31 + ],
  32 + "required": "true"
  33 + },
  34 + "DF_local": {
  35 + "type": "string",
  36 + "required": "true"
  37 + },
  38 + "DF_telefone": {
  39 + "type": "string",
  40 + "required": "true"
  41 + },
  42 + "type": {
  43 + "type": "string",
  44 + "enum": [
  45 + OTRS_type_values
  46 + ],
  47 + "required": "true"
  48 + }
  49 + CF_SCHEMA
  50 + ,
  51 + "subject": {
  52 + "type": "string",
  53 + "required": "true"
  54 + },
  55 + "description": {
  56 + "type": "string",
  57 + "required": "true"
  58 + },
  59 + "attachment": {
  60 + "type": "string",
  61 + "format": "uri"
  62 + },
  63 + "Action": {
  64 + "type": "string",
  65 + "default": "NewTicketWizard"
  66 + },
  67 + "Subaction": {
  68 + "type": "string",
  69 + "default": "CreateTicket"
  70 + }
  71 +';
  72 +
  73 +my $key = '("DF_telefone"[^}]+})';
  74 +my $replace = '"DF_telefone {' . "\n" . '"type": "string"' . "\n}";
  75 +
  76 +
  77 +$schema =~ s/$key/$replace/;
  78 +
  79 +print STDOUT $schema . "\n\n\n\n";
  80 +
  81 +
  82 +
  83 +
  84 +my $form = '
  85 +"DF_unidade": {
  86 + "type": "select",
  87 + "label": "Unidade:",
  88 + "optionLabels": [
  89 + DF_unidade_labels
  90 + ]
  91 + },
  92 + "DF_local": {
  93 + "type": "text",
  94 + "label": "Local:"
  95 + },
  96 + "DF_telefone": {
  97 + "type": "text",
  98 + "label": "Telefone:",
  99 + "control_width": 100
  100 + },
  101 + "type": {
  102 + "type": "select",
  103 + "label": "Motivo:",
  104 + "optionLabels": [
  105 + OTRS_type_labels
  106 + ]
  107 + },
  108 + "service": {
  109 + "type": "hidden"
  110 + }
  111 + CF_FORM,
  112 + "subject": {
  113 + "type": "text",
  114 + "label": "Assunto:",
  115 + "size": 80
  116 + },
  117 + "description": {
  118 + "type": "textarea",
  119 + "label": "Descrição:",
  120 + "cols": 80
  121 + },
  122 + "attachment": {
  123 + "type": "file",
  124 + "label": "Anexo:",
  125 + "helper": "Anexe um arquivo se necessário."
  126 + },
  127 + "Action": {
  128 + "type": "hidden"
  129 + },
  130 + "Subaction": {
  131 + "type": "hidden"
  132 + }
  133 +
  134 +';
  135 +
  136 +$key = '("DF_telefone"[^}]+})';
  137 +$replace = '"DF_telefone": {' . "\n" . '"type": "hidden"' . "\n}";
  138 +
  139 +
  140 +$form =~ s/$key/$replace/;
  141 +
  142 +print STDOUT $form ;
  143 +
  144 +
  145 +1;
0 146 \ No newline at end of file
... ...
sqls.sql 0 → 100644
... ... @@ -0,0 +1,5 @@
  1 +alter table service_form drop foreign key FK_service_form_service_id_id;
  2 +alter table service_form drop primary key;
  3 +alter table service_form add id int auto_increment not null primary key;
  4 +alter table service_form add fixed_values text;
  5 +alter table service_form add queue_id int;
... ...
var/httpd/htdocs/js/NewTicketWizard.js
... ... @@ -70,6 +70,7 @@ var postRenderCallback = function(form) {
70 70 if (form.isFormValid()) {
71 71 return true;
72 72 } else {
  73 + alert("Dados inválidos!");
73 74 return false;
74 75 }
75 76 e.stopPropagation();
... ...
var/httpd/htdocs/js/thirdparty/alpaca/.alpaca-full.min.js.swp 0 → 100644
No preview for this file type
var/httpd/htdocs/js/thirdparty/alpaca/alpaca-full.min.js
... ... @@ -728,6 +728,7 @@ if (typeof JSON !== &#39;object&#39;) {
728 728 path += path ? typeof i == 'number' ? '[' + i + ']' : typeof i == 'undefined' ? '' : '.' + i : i;
729 729 function addError(message) {
730 730 errors.push({property:path,message:message});
  731 + Alpaca.logDebug("Erro: " + message);
731 732 }
732 733  
733 734 if ((typeof schema != 'object' || schema instanceof Array) && (path || typeof schema != 'function') && !(schema && schema.type)) {
... ... @@ -2149,6 +2150,8 @@ var equiv = function () {
2149 2150 // Unless we want to load individual fields (other than the templates) using the provided
2150 2151 // loader, this should be good enough. The benefit is saving time on loader format checking.
2151 2152  
  2153 +
  2154 +
2152 2155 var loadAllConnector = connector;
2153 2156  
2154 2157 if (notTopLevel) {
... ... @@ -2163,6 +2166,8 @@ var equiv = function () {
2163 2166 if (Alpaca.isUndefined(options.focus)) {
2164 2167 options.focus = false;
2165 2168 }
  2169 +
  2170 +
2166 2171 var _renderedCallback = function(control)
2167 2172 {
2168 2173 // auto-set the focus?
... ... @@ -2195,6 +2200,9 @@ var equiv = function () {
2195 2200 }
2196 2201 };
2197 2202  
  2203 +
  2204 +
  2205 +
2198 2206 loadAllConnector.loadAll({
2199 2207 "data": data,
2200 2208 "schema": schema,
... ... @@ -2242,6 +2250,8 @@ var equiv = function () {
2242 2250 return null;
2243 2251 });
2244 2252  
  2253 +
  2254 +
2245 2255 // hand back the field
2246 2256 return $(el);
2247 2257 };
... ... @@ -4166,7 +4176,7 @@ var equiv = function () {
4166 4176  
4167 4177 // by default, logging only shows warnings and above
4168 4178 // to debug, set Alpaca.logLevel = Alpaca.DEBUG
4169   - Alpaca.logLevel = Alpaca.WARN;
  4179 + Alpaca.logLevel = Alpaca.INFO;
4170 4180  
4171 4181 Alpaca.logDebug = function(obj) {
4172 4182 Alpaca.log(Alpaca.DEBUG, obj);
... ... @@ -7035,6 +7045,7 @@ var equiv = function () {
7035 7045 }
7036 7046 }
7037 7047  
  7048 +
7038 7049 // hidden
7039 7050 if (this.options.hidden) {
7040 7051 this.getEl().hide();
... ... @@ -7046,19 +7057,25 @@ var equiv = function () {
7046 7057 var defaultHideInitValidationError = (this.view.type == 'create');
7047 7058 this.hideInitValidationError = Alpaca.isValEmpty(this.options.hideInitValidationError) ? defaultHideInitValidationError : this.options.hideInitValidationError;
7048 7059  
  7060 + Alpaca.logDebug("PreRender");
  7061 +
7049 7062 // final call to update validation state
7050 7063 if (this.view.type != 'view') {
  7064 + Alpaca.logDebug("PreRender2");
7051 7065 this.renderValidationState();
7052 7066 }
7053 7067  
7054 7068 // set to false after first validation (even if in CREATE mode, we only force init validation error false on first render)
7055 7069 this.hideInitValidationError = false;
7056 7070  
  7071 + Alpaca.logDebug("PreHiden");
7057 7072 // for create view, hide all readonly fields
7058 7073 if (!this.view.displayReadonly) {
7059 7074 $('.alpaca-field-readonly', this.getEl()).hide();
7060 7075 }
7061 7076  
  7077 + ////console.log(this);
  7078 + Alpaca.logDebug("PrePostRender");
7062 7079 // field level post render
7063 7080 if (this.options.postRender) {
7064 7081 this.options.postRender(this);
... ... @@ -7311,7 +7328,6 @@ var equiv = function () {
7311 7328 this._validateCustomValidator();
7312 7329 }
7313 7330 };
7314   -
7315 7331 _rvc.call(this, checkChildren, false);
7316 7332 },
7317 7333  
... ... @@ -7447,8 +7463,17 @@ var equiv = function () {
7447 7463 * @returns {Boolean} False if this field value is empty but required, true otherwise.
7448 7464 */
7449 7465 _validateOptional: function() {
7450   - if (this.schema.required && this.isEmpty()) {
7451   - return false;
  7466 + var id = this.id;
  7467 + var obj = $("span[alpaca-field-id='" + id + "']").css('display');
  7468 + //console.log("Display para" + "span[alpaca-field-id='" + this.id + "'] => " + obj);
  7469 + if (this.schema.required) {
  7470 + if ((obj == "none") || (obj == "undefined")) {
  7471 + console.log("alpaca-field-id='" + id + "' => OK");
  7472 + return true;
  7473 + } else if (this.isEmpty()) {
  7474 + console.log("alpaca-field-id='" + id + "' => NOT OK");
  7475 + return false;
  7476 + }
7452 7477 }
7453 7478 return true;
7454 7479 },
... ... @@ -8367,6 +8392,14 @@ var equiv = function () {
8367 8392 _validateEnum: function() {
8368 8393 if (this.schema["enum"]) {
8369 8394 var val = this.data;
  8395 +
  8396 + var id = this.id;
  8397 + var obj = $("span[alpaca-field-id='" + id + "']").css('display');
  8398 + if ((this.schema.required) && ((obj == "none") || (obj == "undefined"))) {
  8399 + console.log("alpaca-field-id='" + id + "' => OK");
  8400 + return true;
  8401 + }
  8402 +
8370 8403 /*this.getValue();*/
8371 8404 if (!this.schema.required && Alpaca.isValEmpty(val)) {
8372 8405 return true;
... ... @@ -9986,6 +10019,14 @@ var equiv = function () {
9986 10019 _validatePattern: function() {
9987 10020 if (this.schema.pattern) {
9988 10021 var val = this.getValue();
  10022 +
  10023 + var id = this.id;
  10024 + var obj = $("span[alpaca-field-id='" + id + "']").css('display');
  10025 + if ((this.schema.required) && ((obj == "none") || (obj == "undefined"))) {
  10026 + console.log("alpaca-field-id='" + id + "' => OK");
  10027 + return true;
  10028 + }
  10029 +
9989 10030 if (val === "" && this.options.allowOptionalEmpty && !this.schema.required) {
9990 10031 return true;
9991 10032 }
... ... @@ -10007,6 +10048,15 @@ var equiv = function () {
10007 10048 */
10008 10049 _validateMinLength: function() {
10009 10050 if (!Alpaca.isEmpty(this.schema.minLength)) {
  10051 +
  10052 +
  10053 + var id = this.id;
  10054 + var obj = $("span[alpaca-field-id='" + id + "']").css('display');
  10055 + if ((this.schema.required) && ((obj == "none") || (obj == "undefined"))) {
  10056 + console.log("alpaca-field-id='" + id + "' => OK");
  10057 + return true;
  10058 + }
  10059 +
10010 10060 var val = this.getValue();
10011 10061 if (val === "" && this.options.allowOptionalEmpty && !this.schema.required) {
10012 10062 return true;
... ... @@ -10028,6 +10078,15 @@ var equiv = function () {
10028 10078 */
10029 10079 _validateMaxLength: function() {
10030 10080 if (!Alpaca.isEmpty(this.schema.maxLength)) {
  10081 +
  10082 + var id = this.id;
  10083 + var obj = $("span[alpaca-field-id='" + id + "']").css('display');
  10084 + if ((this.schema.required) && ((obj == "none") || (obj == "undefined"))) {
  10085 + console.log("alpaca-field-id='" + id + "' => OK");
  10086 + return true;
  10087 + }
  10088 +
  10089 +
10031 10090 var val = this.getValue();
10032 10091 if (val === "" && this.options.allowOptionalEmpty && !this.schema.required) {
10033 10092 return true;
... ... @@ -11291,6 +11350,7 @@ var equiv = function () {
11291 11350  
11292 11351 var _this = this;
11293 11352  
  11353 +
11294 11354 if (this.schema["type"] && this.schema["type"] == "array") {
11295 11355 this.options.multiple = true;
11296 11356 }
... ... @@ -11320,7 +11380,6 @@ var equiv = function () {
11320 11380  
11321 11381 //$("select",this.field).val("0");
11322 11382 }
11323   -
11324 11383 this.injectField(this.field);
11325 11384  
11326 11385 // 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 () {
11353 11412 _validateEnum: function() {
11354 11413 if (this.schema["enum"]) {
11355 11414 var val = this.data;
  11415 +
  11416 + var id = this.id;
  11417 + var obj = $("span[alpaca-field-id='" + id + "']").css('display');
  11418 + if ((this.schema.required) && ((obj == "none") || (obj == "undefined"))) {
  11419 + console.log("alpaca-field-id='" + id + "' => OK");
  11420 + return true;
  11421 + }
  11422 +
11356 11423 if (!this.schema.required && Alpaca.isValEmpty(val)) {
11357 11424 return true;
11358 11425 }
... ... @@ -13393,6 +13460,10 @@ var equiv = function () {
13393 13460 }
13394 13461 else if (Alpaca.isArray(def.dependencies))
13395 13462 {
  13463 +s
  13464 +v
  13465 +t
  13466 +w
13396 13467 $.each(def.dependencies, function(index, value) {
13397 13468 if (value == propertyId)
13398 13469 {
... ... @@ -13506,7 +13577,9 @@ var equiv = function () {
13506 13577 else
13507 13578 {
13508 13579 // check object value
13509   - if (!Alpaca.isEmpty(conditionalDependencies[dependentOnPropertyId]) && conditionalDependencies[dependentOnPropertyId] != dependentOnData)
  13580 + if (!dependentOnData) {
  13581 + valid = false;
  13582 + } else if (!Alpaca.isEmpty(conditionalDependencies[dependentOnPropertyId]) && dependentOnData.indexOf(conditionalDependencies[dependentOnPropertyId]) == -1)
13510 13583 {
13511 13584 valid = false;
13512 13585 }
... ...
var/httpd/htdocs/js/thirdparty/alpaca/alpaca.min.js 0 → 100644
... ... @@ -0,0 +1,9 @@
  1 +!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+='<script type="text/x-handlebars-template">\n\n <div>\n\n ',o=i.each.call(t,t&&t.items,{hash:{},inverse:c.noop,fn:c.program(1,r,n),data:n}),(o||0===o)&&(l+=o),l+="\n\n </div>\n\n</script>"},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+='<script type="text/x-handlebars-template">\n\n <div>\n\n ',o=i.each.call(t,t&&t.items,{hash:{},inverse:c.noop,fn:c.program(1,r,n),data:n}),(o||0===o)&&(l+=o),l+="\n\n </div>\n\n</script>"},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 <legend class="',a=i["if"].call(e,(a=e&&e.options,null==a||a===!1?a:a.labelClass),{hash:{},inverse:g.noop,fn:g.program(2,s,t),data:t}),(a||0===a)&&(n+=a),n+=' alpaca-container-label">',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+="</legend>\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 <p class="alpaca-helper ',a=i["if"].call(e,(a=e&&e.options,null==a||a===!1?a:a.helperClass),{hash:{},inverse:g.noop,fn:g.program(5,l,t),data:t}),(a||0===a)&&(n+=a),n+='">\n <i class="alpaca-icon-helper"></i>\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 </p>\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+='<script type="text/x-handlebars-template">\n\n <div>\n\n ',d=i["if"].call(t,(d=t&&t.options,null==d||d===!1?d:d.label),{hash:{},inverse:g.noop,fn:g.program(1,r,n),data:n}),(d||0===d)&&(h+=d),h+="\n\n ",d=i["if"].call(t,(d=t&&t.options,null==d||d===!1?d:d.helper),{hash:{},inverse:g.noop,fn:g.program(4,o,n),data:n}),(d||0===d)&&(h+=d),h+="\n\n ",u={hash:{},inverse:g.noop,fn:g.program(7,c,n),data:n},(p=i.container)?d=p.call(t,u):(p=t&&t.container,d=typeof p===f?p.call(t,u):p),i.container||(d=v.call(t,d,{hash:{},inverse:g.noop,fn:g.program(7,c,n),data:n})),(d||0===d)&&(h+=d),h+="\n\n </div>\n\n</script>"},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+='<script type="text/x-handlebars-template">\n\n <div>',s=i.str||t&&t.str,o={hash:{},data:n},r=s?s.call(t,t&&t.data,o):c.call(t,"str",t&&t.data,o),(r||0===r)&&(l+=r),l+="</div>\n\n</script>"},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+='<script type="text/x-handlebars-template">\n\n <div>',s=i.str||t&&t.str,o={hash:{},data:n},r=s?s.call(t,t&&t.data,o):c.call(t,"str",t&&t.data,o),(r||0===r)&&(l+=r),l+="</div>\n\n</script>"},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+='<script type="text/x-handlebars-template">\n\n <div class="alpaca-image-display">\n <img id="',(s=i.id)?r=s.call(t,{hash:{},data:n}):(s=t&&t.id,r=typeof s===l?s.call(t,{hash:{},data:n}):s),o+=c(r)+'-image" src="',(s=i.data)?r=s.call(t,{hash:{},data:n}):(s=t&&t.data,r=typeof s===l?s.call(t,{hash:{},data:n}):s),o+=c(r)+'">\n </div>\n\n</script>'},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+='<script type="text/x-handlebars-template">\n\n <div>\n ',o=i.each.call(t,t&&t.selectOptions,{hash:{},inverse:d.noop,fn:d.programWithDepth(1,r,n,t),data:n}),(o||0===o)&&(l+=o),l+="\n </div>\n\n</script>\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+='<script type="text/x-handlebars-template">\n\n <div>\n ',o=i.each.call(t,t&&t.selectOptions,{hash:{},inverse:d.noop,fn:d.programWithDepth(1,r,n,t),data:n}),(o||0===o)&&(l+=o),l+="\n </div>\n\n</script>\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+='<script type="text/x-handlebars-template">\n\n <div>',(s=i.data)?r=s.call(t,{hash:{},data:n}):(s=t&&t.data,r=typeof s===l?s.call(t,{hash:{},data:n}):s),(r||0===r)&&(o+=r),o+="</div>\n\n</script>"},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+='<script type="text/x-handlebars-template">\n\n <p>\n ',(s=i.data)?r=s.call(t,{hash:{},data:n}):(s=t&&t.data,r=typeof s===l?s.call(t,{hash:{},data:n}):s),(r||0===r)&&(o+=r),o+="\n </p>\n\n</script>"},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+='<script type="text/x-handlebars-template">\n\n <a href="',(p=i.data)?d=p.call(t,{hash:{},data:n}):(p=t&&t.data,d=typeof p===h?p.call(t,{hash:{},data:n}):p),u+=f(d)+'" ',d=i["if"].call(t,(d=t&&t.options,null==d||d===!1?d:d.anchorTarget),{hash:{},inverse:m.noop,fn:m.program(1,r,n),data:n}),(d||0===d)&&(u+=d),u+=' title="',d=i["if"].call(t,(d=t&&t.options,null==d||d===!1?d:d.anchorTitle),{hash:{},inverse:m.program(5,o,n),fn:m.program(3,s,n),data:n}),(d||0===d)&&(u+=d),u+='">\n ',d=i["if"].call(t,(d=t&&t.options,null==d||d===!1?d:d.anchorTitle),{hash:{},inverse:m.program(9,c,n),fn:m.program(7,l,n),data:n}),(d||0===d)&&(u+=d),u+="\n </a>\n\n</script>"},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 <label class="',a=i["if"].call(e,(a=e&&e.options,null==a||a===!1?a:a.labelClass),{hash:{},inverse:g.noop,fn:g.program(2,s,t),data:t}),(a||0===a)&&(r+=a),r+=' alpaca-control-label" for="',(n=i.id)?a=n.call(e,{hash:{},data:t}):(n=e&&e.id,a=typeof n===f?n.call(e,{hash:{},data:t}):n),r+=m(a)+'">',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+="</label>\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 <p class="',a=i["if"].call(e,(a=e&&e.options,null==a||a===!1?a:a.helperClass),{hash:{},inverse:g.noop,fn:g.program(7,c,t),data:t}),(a||0===a)&&(n+=a),n+='">\n <i class="info-sign"></i>\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 </p>\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+='<script type="text/x-handlebars-template">\n\n <div>\n\n ',d=i["if"].call(t,(d=t&&t.options,null==d||d===!1?d:d.label),{hash:{},inverse:g.noop,fn:g.program(1,r,n),data:n}),(d||0===d)&&(h+=d),h+="\n\n ",u={hash:{},inverse:g.noop,fn:g.program(4,o,n),data:n},(p=i.control)?d=p.call(t,u):(p=t&&t.control,d=typeof p===f?p.call(t,u):p),i.control||(d=v.call(t,d,{hash:{},inverse:g.noop,fn:g.program(4,o,n),data:n})),(d||0===d)&&(h+=d),h+="\n\n ",d=i["if"].call(t,(d=t&&t.options,null==d||d===!1?d:d.helper),{hash:{},inverse:g.noop,fn:g.program(6,l,n),data:n}),(d||0===d)&&(h+=d),h+="\n\n </div>\n\n</script>\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 <button data-key="'+g((a=null==t||t===!1?t:t.key,typeof a===m?a.apply(e):a))+'" ',n=i.compare||e&&e.compare,r={hash:{},inverse:v.noop,fn:v.program(5,l,t),data:t},a=n?n.call(e,e&&e.type,"submit",r):y.call(e,"compare",e&&e.type,"submit",r),(a||0===a)&&(s+=a),s+=" ",n=i.compare||e&&e.compare,r={hash:{},inverse:v.noop,fn:v.program(7,c,t),data:t},a=n?n.call(e,e&&e.type,"reset",r):y.call(e,"compare",e&&e.type,"reset",r),(a||0===a)&&(s+=a),s+=' class="alpaca-form-button alpaca-form-button-'+g((a=null==t||t===!1?t:t.key,typeof a===m?a.apply(e):a))+' btn btn-default" ',a=i.each.call(e,e&&e.value,{hash:{},inverse:v.noop,fn:v.program(9,d,t),data:t}),(a||0===a)&&(s+=a),s+=">",(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+="</button>\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+='<script type="text/x-handlebars-template">\n\n <form role="form">\n\n ',h={hash:{},inverse:v.noop,fn:v.program(1,r,n),data:n},(u=i.formItems)?p=u.call(t,h):(u=t&&t.formItems,p=typeof u===m?u.call(t,h):u),i.formItems||(p=b.call(t,p,{hash:{},inverse:v.noop,fn:v.program(1,r,n),data:n})),(p||0===p)&&(f+=p),f+='\n\n <div class="alpaca-form-buttons-container">\n ',p=i["if"].call(t,(p=t&&t.options,null==p||p===!1?p:p.buttons),{hash:{},inverse:v.noop,fn:v.program(3,s,n),data:n}),(p||0===p)&&(f+=p),f+="\n </div>\n\n </form>\n\n</script>"},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 <button class="alpaca-array-actionbar-action btn btn-default btn-sm" data-alpaca-array-actionbar-action="',(n=i.action)?a=n.call(e,{hash:{},data:t}):(n=e&&e.action,a=typeof n===p?n.call(e,{hash:{},data:t}):n),r+=u(a)+'">\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 </button>\n "}function s(e){var t,i="";return i+='\n <i class="'+u((t=e&&e.iconClass,typeof t===p?t.apply(e):t))+'"></i>\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+='<script type="text/x-handlebars-template">\n\n <div class="alpaca-array-actionbar btn-group" data-alpaca-array-actionbar-field-id="',(c=i.fieldId)?l=c.call(t,{hash:{},data:n}):(c=t&&t.fieldId,l=typeof c===p?c.call(t,{hash:{},data:n}):c),d+=u(l)+'" data-alpaca-array-actionbar-item-index="',(c=i.itemIndex)?l=c.call(t,{hash:{},data:n}):(c=t&&t.itemIndex,l=typeof c===p?c.call(t,{hash:{},data:n}):c),d+=u(l)+'">\n ',l=i.each.call(t,t&&t.actions,{hash:{},inverse:h.noop,fn:h.program(1,r,n),data:n}),(l||0===l)&&(d+=l),d+="\n </div>\n\n</script>"},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 <a href="#" class="alpaca-array-toolbar-action" data-alpaca-array-toolbar-action="'+g((t=e&&e.action,typeof t===m?t.apply(e):t))+'">',t=e&&e.label,t=typeof t===m?t.apply(e):t,(t||0===t)&&(i+=t),i+="</a>\n "}function l(e,t){var a,n="";return n+='\n <button class="alpaca-array-toolbar-action btn btn-default btn-sm" data-alpaca-array-toolbar-action="'+g((a=e&&e.action,typeof a===m?a.apply(e):a))+'">\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 </button>\n "}function c(e){var t,i="";return i+='\n <i class="'+g((t=e&&e.iconClass,typeof t===m?t.apply(e):t))+'"></i>\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+='<script type="text/x-handlebars-template">\n\n <div class="alpaca-array-toolbar" data-alpaca-array-toolbar-field-id="',(u=i.fieldId)?p=u.call(t,{hash:{},data:n}):(u=t&&t.fieldId,p=typeof u===m?u.call(t,{hash:{},data:n}):u),f+=g(p)+'" ',u=i.compare||t&&t.compare,h={hash:{},inverse:v.noop,fn:v.program(1,r,n),data:n},p=u?u.call(t,(p=t&&t.options,null==p||p===!1?p:p.toolbarStyle),"button",h):y.call(t,"compare",(p=t&&t.options,null==p||p===!1?p:p.toolbarStyle),"button",h),(p||0===p)&&(f+=p),f+=">\n\n ",p=i.each.call(t,t&&t.actions,{hash:{},inverse:v.noop,fn:v.programWithDepth(3,s,n,t),data:n}),(p||0===p)&&(f+=p),f+="\n\n </div>\n\n</script>"},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+='<script type="text/x-handlebars-template">\n\n <div>\n\n ',o=i.each.call(t,t&&t.items,{hash:{},inverse:c.noop,fn:c.program(1,r,n),data:n}),(o||0===o)&&(l+=o),l+="\n\n </div>\n\n</script>"},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+='<script type="text/x-handlebars-template">\n\n <div>\n\n ',o=i.each.call(t,t&&t.items,{hash:{},inverse:c.noop,fn:c.program(1,r,n),data:n}),(o||0===o)&&(l+=o),l+="\n\n </div>\n\n</script>"},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 <a href="#" class="alpaca-array-toolbar-action" data-array-toolbar-action="'+F((t=e&&e.action,typeof t===w?t.apply(e):t))+'">',t=e&&e.label,t=typeof t===w?t.apply(e):t,(t||0===t)&&(i+=t),i+="</a>\n "}function l(e,t){var a,n="";return n+='\n <button class="alpaca-array-toolbar-action btn btn-default" data-array-toolbar-action="'+F((a=e&&e.action,typeof a===w?a.apply(e):a))+'">\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 </button>\n "}function c(e){var t,i="";return i+='\n <i class="'+F((t=e&&e.iconClass,typeof t===w?t.apply(e):t))+'"></i>\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 <th>",(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+="</th>\n "}function u(e,t,a){var n,r="";return r+="\n <tr>\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 <!-- actions cell -->\n <td>\n <div class="alpaca-array-item-actions btn-group">\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 </div>\n </td>\n </tr>\n "}function h(e){var t,i="";return i+="\n <td>",t=typeof e===w?e.apply(e):e,(t||0===t)&&(i+=t),i+="</td>\n "}function f(e,t){var a,n,r="";return r+='\n <button class="alpaca-array-item-action btn btn-default" data-array-item-action="',(n=i.action)?a=n.call(e,{hash:{},data:t}):(n=e&&e.action,a=typeof n===w?n.call(e,{hash:{},data:t}):n),r+=F(a)+'">\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 </button>\n "}function m(e){var t,i="";return i+='\n <i class="'+F((t=e&&e.iconClass,typeof t===w?t.apply(e):t))+'"></i>\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+='<script type="text/x-handlebars-template">\n\n <div>\n\n <div class="alpaca-array-toolbar" ',v=i.compare||t&&t.compare,y={hash:{},inverse:x.noop,fn:x.program(1,r,n),data:n},g=v?v.call(t,(g=t&&t.options,null==g||g===!1?g:g.toolbarStyle),"button",y):S.call(t,"compare",(g=t&&t.options,null==g||g===!1?g:g.toolbarStyle),"button",y),(g||0===g)&&(b+=g),b+=">\n\n ",g=i.each.call(t,t&&t.arrayToolbarActions,{hash:{},inverse:x.noop,fn:x.programWithDepth(3,s,n,t),data:n}),(g||0===g)&&(b+=g),b+="\n\n </div>\n\n <table>\n\n <!-- table headers -->\n <thead>\n <tr>\n ",g=i.each.call(t,(g=t&&t.options,null==g||g===!1?g:g.fields),{hash:{},inverse:x.noop,fn:x.program(11,p,n),data:n}),(g||0===g)&&(b+=g),b+="\n\n <th>Actions</th>\n </tr>\n </thead>\n\n <!-- table body -->\n <tbody>\n ",g=i.each.call(t,t&&t.items,{hash:{},inverse:x.noop,fn:x.programWithDepth(13,u,n,t),data:n}),(g||0===g)&&(b+=g),b+="\n </tbody>\n\n </table>\n </div>\n\n</script>"},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 <legend class="',a=i["if"].call(e,(a=e&&e.options,null==a||a===!1?a:a.labelClass),{hash:{},inverse:g.noop,fn:g.program(2,s,t),data:t}),(a||0===a)&&(n+=a),n+=' alpaca-container-label">',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+="</legend>\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 <p class="alpaca-helper ',a=i["if"].call(e,(a=e&&e.options,null==a||a===!1?a:a.helperClass),{hash:{},inverse:g.noop,fn:g.program(5,l,t),data:t}),(a||0===a)&&(n+=a),n+='">\n <i class="alpaca-icon-helper"></i>\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 </p>\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+='<script type="text/x-handlebars-template">\n\n <div>\n\n ',d=i["if"].call(t,(d=t&&t.options,null==d||d===!1?d:d.label),{hash:{},inverse:g.noop,fn:g.program(1,r,n),data:n}),(d||0===d)&&(h+=d),h+="\n\n ",d=i["if"].call(t,(d=t&&t.options,null==d||d===!1?d:d.helper),{hash:{},inverse:g.noop,fn:g.program(4,o,n),data:n}),(d||0===d)&&(h+=d),h+="\n\n ",u={hash:{},inverse:g.noop,fn:g.program(7,c,n),data:n},(p=i.container)?d=p.call(t,u):(p=t&&t.container,d=typeof p===f?p.call(t,u):p),i.container||(d=v.call(t,d,{hash:{},inverse:g.noop,fn:g.program(7,c,n),data:n})),(d||0===d)&&(h+=d),h+="\n\n </div>\n\n</script>"},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+='<script type="text/x-handlebars-template">\n\n <input type="text" id="',(c=i.id)?l=c.call(t,{hash:{},data:n}):(c=t&&t.id,l=typeof c===p?c.call(t,{hash:{},data:n}):c),d+=u(l)+'" size="40" ',l=i["if"].call(t,(l=t&&t.options,null==l||l===!1?l:l.readonly),{hash:{},inverse:h.noop,fn:h.program(1,r,n),data:n}),(l||0===l)&&(d+=l),d+=" ",l=i["if"].call(t,t&&t.name,{hash:{},inverse:h.noop,fn:h.program(3,s,n),data:n}),(l||0===l)&&(d+=l),d+=" ",l=i.each.call(t,(l=t&&t.options,null==l||l===!1?l:l.data),{hash:{},inverse:h.noop,fn:h.program(5,o,n),data:n}),(l||0===l)&&(d+=l),d+="/>\n\n</script>"},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 <div>\n\n <label>\n\n <input type="checkbox" data-checkbox-index="'+f((n=null==t||t===!1?t:t.index,typeof n===h?n.apply(e):n))+'" data-checkbox-value="',(r=i.value)?n=r.call(e,{hash:{},data:t}):(r=e&&e.value,n=typeof r===h?r.call(e,{hash:{},data:t}):r),s+=f(n)+'" ',n=i["if"].call(e,(n=a&&a.options,null==n||n===!1?n:n.readonly),{hash:{},inverse:m.noop,fn:m.program(3,o,t),data:t}),(n||0===n)&&(s+=n),s+=" ",n=i["if"].call(e,e&&e.name,{hash:{},inverse:m.noop,fn:m.program(5,l,t),data:t}),(n||0===n)&&(s+=n),s+=" ",n=i.each.call(e,(n=a&&a.options,null==n||n===!1?n:n.data),{hash:{},inverse:m.noop,fn:m.program(7,c,t),data:t}),(n||0===n)&&(s+=n),s+="/>\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 </label>\n </div>\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 <div>\n\n <label>\n\n <input type="checkbox" ',a=i["if"].call(e,(a=e&&e.options,null==a||a===!1?a:a.readonly),{hash:{},inverse:m.noop,fn:m.program(3,o,t),data:t}),(a||0===a)&&(n+=a),n+=" ",a=i["if"].call(e,e&&e.name,{hash:{},inverse:m.noop,fn:m.program(5,l,t),data:t}),(a||0===a)&&(n+=a),n+=" ",a=i.each.call(e,(a=e&&e.options,null==a||a===!1?a:a.data),{hash:{},inverse:m.noop,fn:m.program(7,c,t),data:t}),(a||0===a)&&(n+=a),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 </label>\n\n </div>\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;
  2 +return u+='<script type="text/x-handlebars-template">\n\n ',p=i["if"].call(t,(p=t&&t.options,null==p||p===!1?p:p.multiple),{hash:{},inverse:m.program(9,d,n),fn:m.programWithDepth(1,r,n,t),data:n}),(p||0===p)&&(u+=p),u+="\n\n</script>\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+='<script type="text/x-handlebars-template">\n\n <textarea id="',(s=i.id)?r=s.call(t,{hash:{},data:n}):(s=t&&t.id,r=typeof s===l?s.call(t,{hash:{},data:n}):s),o+=c(r)+'" cols="80" rows="10">\n </textarea>\n\n</script>'},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+='<script type="text/x-handlebars-template">\n\n <div id="',(s=i.id)?r=s.call(t,{hash:{},data:n}):(s=t&&t.id,r=typeof s===l?s.call(t,{hash:{},data:n}):s),o+=c(r)+'" class="control-field-editor-el"></div>\n\n</script>'},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+='<script type="text/x-handlebars-template">\n\n <input type="file" id="',(d=i.id)?c=d.call(t,{hash:{},data:n}):(d=t&&t.id,c=typeof d===u?d.call(t,{hash:{},data:n}):d),p+=h(c)+'" ',c=i["if"].call(t,(c=t&&t.options,null==c||c===!1?c:c.size),{hash:{},inverse:f.noop,fn:f.program(1,r,n),data:n}),(c||0===c)&&(p+=c),p+=" ",c=i["if"].call(t,(c=t&&t.options,null==c||c===!1?c:c.readonly),{hash:{},inverse:f.noop,fn:f.program(3,s,n),data:n}),(c||0===c)&&(p+=c),p+=" ",c=i["if"].call(t,t&&t.name,{hash:{},inverse:f.noop,fn:f.program(5,o,n),data:n}),(c||0===c)&&(p+=c),p+=" ",c=i.each.call(t,(c=t&&t.options,null==c||c===!1?c:c.data),{hash:{},inverse:f.noop,fn:f.program(7,l,n),data:n}),(c||0===c)&&(p+=c),p+="/>\n</script>"},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+='<script type="text/x-handlebars-template">\n\n <input type="hidden" id="',(l=i.id)?o=l.call(t,{hash:{},data:n}):(l=t&&t.id,o=typeof l===d?l.call(t,{hash:{},data:n}):l),c+=p(o)+'" ',o=i["if"].call(t,t&&t.name,{hash:{},inverse:u.noop,fn:u.program(1,r,n),data:n}),(o||0===o)&&(c+=o),c+=" ",o=i.each.call(t,(o=t&&t.options,null==o||o===!1?o:o.data),{hash:{},inverse:u.noop,fn:u.program(3,s,n),data:n}),(o||0===o)&&(c+=o),c+="/>\n\n</script>"},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+='<script type="text/x-handlebars-template">\n\n <input type="text" id="',(p=i.id)?d=p.call(t,{hash:{},data:n}):(p=t&&t.id,d=typeof p===h?p.call(t,{hash:{},data:n}):p),u+=f(d)+'" ',d=i["if"].call(t,(d=t&&t.options,null==d||d===!1?d:d.placeholder),{hash:{},inverse:m.noop,fn:m.program(1,r,n),data:n}),(d||0===d)&&(u+=d),u+=" ",d=i["if"].call(t,(d=t&&t.options,null==d||d===!1?d:d.size),{hash:{},inverse:m.noop,fn:m.program(3,s,n),data:n}),(d||0===d)&&(u+=d),u+=" ",d=i["if"].call(t,(d=t&&t.options,null==d||d===!1?d:d.readonly),{hash:{},inverse:m.noop,fn:m.program(5,o,n),data:n}),(d||0===d)&&(u+=d),u+=" ",d=i["if"].call(t,t&&t.name,{hash:{},inverse:m.noop,fn:m.program(7,l,n),data:n}),(d||0===d)&&(u+=d),u+=" ",d=i.each.call(t,(d=t&&t.options,null==d||d===!1?d:d.data),{hash:{},inverse:m.noop,fn:m.program(9,c,n),data:n}),(d||0===d)&&(u+=d),u+='/>\n\n <div class="alpaca-image-display">\n <h5>Preview</h5>\n <img id="',(p=i.id)?d=p.call(t,{hash:{},data:n}):(p=t&&t.id,d=typeof p===h?p.call(t,{hash:{},data:n}):p),u+=f(d)+'-image" src="',(p=i.data)?d=p.call(t,{hash:{},data:n}):(p=t&&t.data,d=typeof p===h?p.call(t,{hash:{},data:n}):p),u+=f(d)+'">\n </div>\n\n</script>'},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+='<script type="text/x-handlebars-template">\n\n <input type="password" id="',(p=i.id)?d=p.call(t,{hash:{},data:n}):(p=t&&t.id,d=typeof p===h?p.call(t,{hash:{},data:n}):p),u+=f(d)+'" ',d=i["if"].call(t,(d=t&&t.options,null==d||d===!1?d:d.placeholder),{hash:{},inverse:m.noop,fn:m.program(1,r,n),data:n}),(d||0===d)&&(u+=d),u+=" ",d=i["if"].call(t,(d=t&&t.options,null==d||d===!1?d:d.size),{hash:{},inverse:m.noop,fn:m.program(3,s,n),data:n}),(d||0===d)&&(u+=d),u+=" ",d=i["if"].call(t,(d=t&&t.options,null==d||d===!1?d:d.readonly),{hash:{},inverse:m.noop,fn:m.program(5,o,n),data:n}),(d||0===d)&&(u+=d),u+=" ",d=i["if"].call(t,t&&t.name,{hash:{},inverse:m.noop,fn:m.program(7,l,n),data:n}),(d||0===d)&&(u+=d),u+=" ",d=i.each.call(t,(d=t&&t.options,null==d||d===!1?d:d.data),{hash:{},inverse:m.noop,fn:m.program(9,c,n),data:n}),(d||0===d)&&(u+=d),u+="/>\n\n</script>"},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 <div class="radio">\n <label class="alpaca-controlfield-radio-label">\n <input type="radio" ',a=i["if"].call(e,(a=e&&e.options,null==a||a===!1?a:a.readonly),{hash:{},inverse:h.noop,fn:h.program(4,l,t),data:t}),(a||0===a)&&(r+=a),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)+'" value=""/>',(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 </label>\n </div>\n "}function l(){return'readonly="readonly"'}function c(e,t,a){var n,r,s,o="";return o+='\n <div class="radio">\n <label class="alpaca-controlfield-radio-label">\n <input type="radio" ',n=i["if"].call(e,(n=e&&e.options,null==n||n===!1?n:n.readonly),{hash:{},inverse:h.noop,fn:h.program(4,l,t),data:t}),(n||0===n)&&(o+=n),o+=' name="',(r=i.name)?n=r.call(e,{hash:{},data:t}):(r=e&&e.name,n=typeof r===f?r.call(e,{hash:{},data:t}):r),o+=m(n)+'" value="',(r=i.value)?n=r.call(e,{hash:{},data:t}):(r=e&&e.value,n=typeof r===f?r.call(e,{hash:{},data:t}):r),o+=m(n)+'" ',r=i.compare||e&&e.compare,s={hash:{},inverse:h.noop,fn:h.program(7,d,t),data:t},n=r?r.call(e,e&&e.value,a&&a.data,s):g.call(e,"compare",e&&e.value,a&&a.data,s),(n||0===n)&&(o+=n),o+="/>",(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 </label>\n </div>\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+='<script type="text/x-handlebars-template">\n\n ',p=i["if"].call(t,t&&t.hideNone,{hash:{},inverse:h.program(3,o,n),fn:h.program(1,s,n),data:n}),(p||0===p)&&(u+=p),u+="\n\n ",p=i.each.call(t,t&&t.selectOptions,{hash:{},inverse:h.noop,fn:h.programWithDepth(6,c,n,r),data:n}),(p||0===p)&&(u+=p),u+="\n\n</script>"},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 <option value="">',(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+="</option>\n "}function u(e,t,a){var n,r,s="";return s+='\n <option value="',(r=i.value)?n=r.call(e,{hash:{},data:t}):(r=e&&e.value,n=typeof r===w?r.call(e,{hash:{},data:t}):r),(n||0===n)&&(s+=n),s+='" ',n=i.each.call(e,a&&a.data,{hash:{},inverse:x.noop,fn:x.programWithDepth(15,h,t,a),data:t}),(n||0===n)&&(s+=n),s+=">",(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)+"</option>\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 <option value="',(r=i.value)?n=r.call(e,{hash:{},data:t}):(r=e&&e.value,n=typeof r===w?r.call(e,{hash:{},data:t}):r),(n||0===n)&&(o+=n),o+='" ',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.data,s):S.call(e,"compare",e&&e.value,a&&a.data,s),(n||0===n)&&(o+=n),o+=">",(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)+"</option>\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+='<script type="text/x-handlebars-template">\n\n <select id="',(y=i.id)?v=y.call(t,{hash:{},data:n}):(y=t&&t.id,v=typeof y===w?y.call(t,{hash:{},data:n}):y),b+=F(v)+'" ',v=i["if"].call(t,(v=t&&t.options,null==v||v===!1?v:v.readonly),{hash:{},inverse:x.noop,fn:x.program(1,r,n),data:n}),(v||0===v)&&(b+=v),b+=" ",v=i["if"].call(t,(v=t&&t.options,null==v||v===!1?v:v.multiple),{hash:{},inverse:x.noop,fn:x.program(3,s,n),data:n}),(v||0===v)&&(b+=v),b+=" ",v=i["if"].call(t,(v=t&&t.options,null==v||v===!1?v:v.size),{hash:{},inverse:x.noop,fn:x.program(5,o,n),data:n}),(v||0===v)&&(b+=v),b+=" ",v=i["if"].call(t,t&&t.name,{hash:{},inverse:x.noop,fn:x.program(7,l,n),data:n}),(v||0===v)&&(b+=v),b+=">\n\n ",v=i["if"].call(t,(v=t&&t.options,null==v||v===!1?v:v.multiple),{hash:{},inverse:x.programWithDepth(18,m,n,t),fn:x.program(9,c,n),data:n}),(v||0===v)&&(b+=v),b+="\n\n </select>\n\n</script>"},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+='<script type="text/x-handlebars-template">\n\n <input type="',(u=i.inputType)?p=u.call(t,{hash:{},data:n}):(u=t&&t.inputType,p=typeof u===f?u.call(t,{hash:{},data:n}):u),h+=m(p)+'" id="',(u=i.id)?p=u.call(t,{hash:{},data:n}):(u=t&&t.id,p=typeof u===f?u.call(t,{hash:{},data:n}):u),h+=m(p)+'" ',p=i["if"].call(t,(p=t&&t.options,null==p||p===!1?p:p.placeholder),{hash:{},inverse:g.noop,fn:g.program(1,r,n),data:n}),(p||0===p)&&(h+=p),h+=" ",p=i["if"].call(t,(p=t&&t.options,null==p||p===!1?p:p.size),{hash:{},inverse:g.noop,fn:g.program(3,s,n),data:n}),(p||0===p)&&(h+=p),h+=" ",p=i["if"].call(t,(p=t&&t.options,null==p||p===!1?p:p.readonly),{hash:{},inverse:g.noop,fn:g.program(5,o,n),data:n}),(p||0===p)&&(h+=p),h+=" ",p=i["if"].call(t,t&&t.name,{hash:{},inverse:g.noop,fn:g.program(7,l,n),data:n}),(p||0===p)&&(h+=p),h+=" ",p=i.each.call(t,(p=t&&t.options,null==p||p===!1?p:p.data),{hash:{},inverse:g.noop,fn:g.program(9,c,n),data:n}),(p||0===p)&&(h+=p),h+=" ",p=i.each.call(t,(p=t&&t.options,null==p||p===!1?p:p.attributes),{hash:{},inverse:g.noop,fn:g.program(11,d,n),data:n}),(p||0===p)&&(h+=p),h+="/>\n\n</script>"},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+='<script type="text/x-handlebars-template">\n\n <textarea id="',(u=i.id)?p=u.call(t,{hash:{},data:n}):(u=t&&t.id,p=typeof u===f?u.call(t,{hash:{},data:n}):u),h+=m(p)+'" ',p=i["if"].call(t,(p=t&&t.options,null==p||p===!1?p:p.placeholder),{hash:{},inverse:g.noop,fn:g.program(1,r,n),data:n}),(p||0===p)&&(h+=p),h+=" ",p=i["if"].call(t,(p=t&&t.options,null==p||p===!1?p:p.rows),{hash:{},inverse:g.noop,fn:g.program(3,s,n),data:n}),(p||0===p)&&(h+=p),h+=" ",p=i["if"].call(t,(p=t&&t.options,null==p||p===!1?p:p.cols),{hash:{},inverse:g.noop,fn:g.program(5,o,n),data:n}),(p||0===p)&&(h+=p),h+=" ",p=i["if"].call(t,(p=t&&t.options,null==p||p===!1?p:p.readonly),{hash:{},inverse:g.noop,fn:g.program(7,l,n),data:n}),(p||0===p)&&(h+=p),h+=" ",p=i["if"].call(t,t&&t.name,{hash:{},inverse:g.noop,fn:g.program(9,c,n),data:n}),(p||0===p)&&(h+=p),h+=" ",p=i.each.call(t,(p=t&&t.options,null==p||p===!1?p:p.data),{hash:{},inverse:g.noop,fn:g.program(11,d,n),data:n}),(p||0===p)&&(h+=p),h+="/>\n\n</script>"},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+='<script type="text/x-handlebars-template">\n\n <input type="text" id="',(p=i.id)?d=p.call(t,{hash:{},data:n}):(p=t&&t.id,d=typeof p===h?p.call(t,{hash:{},data:n}):p),u+=f(d)+'" ',d=i["if"].call(t,(d=t&&t.options,null==d||d===!1?d:d.placeholder),{hash:{},inverse:m.noop,fn:m.program(1,r,n),data:n}),(d||0===d)&&(u+=d),u+=" ",d=i["if"].call(t,(d=t&&t.options,null==d||d===!1?d:d.size),{hash:{},inverse:m.noop,fn:m.program(3,s,n),data:n}),(d||0===d)&&(u+=d),u+=" ",d=i["if"].call(t,(d=t&&t.options,null==d||d===!1?d:d.readonly),{hash:{},inverse:m.noop,fn:m.program(5,o,n),data:n}),(d||0===d)&&(u+=d),u+=" ",d=i["if"].call(t,t&&t.name,{hash:{},inverse:m.noop,fn:m.program(7,l,n),data:n}),(d||0===d)&&(u+=d),u+=" ",d=i.each.call(t,(d=t&&t.options,null==d||d===!1?d:d.data),{hash:{},inverse:m.noop,fn:m.program(9,c,n),data:n}),(d||0===d)&&(u+=d),u+="/>\n\n</script>"},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 <label class="',a=i["if"].call(e,(a=e&&e.options,null==a||a===!1?a:a.labelClass),{hash:{},inverse:g.noop,fn:g.program(2,s,t),data:t}),(a||0===a)&&(r+=a),r+=' alpaca-control-label" for="',(n=i.id)?a=n.call(e,{hash:{},data:t}):(n=e&&e.id,a=typeof n===f?n.call(e,{hash:{},data:t}):n),r+=m(a)+'">',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+="</label>\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 <p class="',a=i["if"].call(e,(a=e&&e.options,null==a||a===!1?a:a.helperClass),{hash:{},inverse:g.noop,fn:g.program(7,c,t),data:t}),(a||0===a)&&(n+=a),n+='">\n <i class="info-sign"></i>\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 </p>\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+='<script type="text/x-handlebars-template">\n\n <div>\n\n ',d=i["if"].call(t,(d=t&&t.options,null==d||d===!1?d:d.label),{hash:{},inverse:g.noop,fn:g.program(1,r,n),data:n}),(d||0===d)&&(h+=d),h+="\n\n ",u={hash:{},inverse:g.noop,fn:g.program(4,o,n),data:n},(p=i.control)?d=p.call(t,u):(p=t&&t.control,d=typeof p===f?p.call(t,u):p),i.control||(d=v.call(t,d,{hash:{},inverse:g.noop,fn:g.program(4,o,n),data:n})),(d||0===d)&&(h+=d),h+="\n\n ",d=i["if"].call(t,(d=t&&t.options,null==d||d===!1?d:d.helper),{hash:{},inverse:g.noop,fn:g.program(6,l,n),data:n}),(d||0===d)&&(h+=d),h+="\n\n </div>\n\n</script>"},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 <button data-key="'+f((a=null==t||t===!1?t:t.key,typeof a===h?a.apply(e):a))+'" type="',(n=i.type)?a=n.call(e,{hash:{},data:t}):(n=e&&e.type,a=typeof n===h?n.call(e,{hash:{},data:t}):n),r+=f(a)+'" class="alpaca-form-button alpaca-form-button-'+f((a=null==t||t===!1?t:t.key,typeof a===h?a.apply(e):a))+' btn btn-default" ',a=i.each.call(e,e&&e.value,{hash:{},inverse:m.noop,fn:m.program(5,l,t),data:t}),(a||0===a)&&(r+=a),r+=">",(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+="</button>\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+='<script type="text/x-handlebars-template">\n\n <form role="form">\n\n ',p={hash:{},inverse:m.noop,fn:m.program(1,r,n),data:n},(d=i.formItems)?c=d.call(t,p):(d=t&&t.formItems,c=typeof d===h?d.call(t,p):d),i.formItems||(c=g.call(t,c,{hash:{},inverse:m.noop,fn:m.program(1,r,n),data:n})),(c||0===c)&&(u+=c),u+='\n\n <div class="alpaca-form-buttons-container">\n ',c=i["if"].call(t,(c=t&&t.options,null==c||c===!1?c:c.buttons),{hash:{},inverse:m.noop,fn:m.program(3,s,n),data:n}),(c||0===c)&&(u+=c),u+="\n </div>\n\n </form>\n\n</script>"},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+='<script type="text/x-handlebars-template">\n\n <div class="alpaca-message alpaca-message-',(s=i.id)?r=s.call(t,{hash:{},data:n}):(s=t&&t.id,r=typeof s===l?s.call(t,{hash:{},data:n}):s),(r||0===r)&&(o+=r),o+='">\n ',(s=i.message)?r=s.call(t,{hash:{},data:n}):(s=t&&t.message,r=typeof s===l?s.call(t,{hash:{},data:n}):s),(r||0===r)&&(o+=r),o+="\n </div>\n\n</script>"},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 <div class="alpaca-wizard-nav">\n <nav class="navbar navbar-default" role="navigation">\n <div class="container-fluid alpaca-wizard-back">\n <ul class="nav navbar-nav">\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 </ul>\n </div>\n </nav>\n </div>\n "}function s(e,t){var a,n,r="";return r+='\n <li data-alpaca-wizard-step-index="'+g((a=null==t||t===!1?t:t.index,typeof a===m?a.apply(e):a))+'">\n <div class="holder">\n <div class="title">',(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+='</div>\n <div class="description">',(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+='</div>\n </div>\n <div class="chevron"></div>\n </li>\n '}function o(){return'\n <div class="alpaca-wizard-progress-bar">\n <div class="progress">\n <div class="progress-bar" role="progressbar" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100" style="width: 60%;">\n </div>\n </div>\n </div>\n '}function l(e,t){var a,n,r="";return r+="\n <h3>",(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+="</h3>\n "}function c(e,t){var a,n,r="";return r+="\n <h4>",(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+="</h4>\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 <button type="',(n=i.type)?a=n.call(e,{hash:{},data:t}):(n=e&&e.type,a=typeof n===m?n.call(e,{hash:{},data:t}):n),r+=g(a)+'" class="btn btn-default" data-alpaca-wizard-button-key="'+g((a=null==t||t===!1?t:t.key,typeof a===m?a.apply(e):a))+'">',(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+="</button>\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+='<script type="text/x-handlebars-template">\n\n <div class="alpaca-wizard">\n\n <!-- nav bar -->\n ',h=i["if"].call(t,t&&t.showSteps,{hash:{},inverse:v.noop,fn:v.program(1,r,n),data:n}),(h||0===h)&&(f+=h),f+="\n\n <!-- wizard progress bar -->\n ",h=i["if"].call(t,t&&t.showProgressBar,{hash:{},inverse:v.noop,fn:v.program(4,o,n),data:n}),(h||0===h)&&(f+=h),f+="\n\n ",h=i["if"].call(t,t&&t.wizardTitle,{hash:{},inverse:v.noop,fn:v.program(6,l,n),data:n}),(h||0===h)&&(f+=h),f+="\n ",h=i["if"].call(t,t&&t.wizardDescription,{hash:{},inverse:v.noop,fn:v.program(8,c,n),data:n}),(h||0===h)&&(f+=h),f+='\n\n <!-- wizard steps -->\n <div class="alpaca-wizard-steps">\n\n </div>\n\n <!-- wizard buttons -->\n <div class="alpaca-wizard-buttons">\n\n <div class="pull-left">\n ',h=i.each.call(t,t&&t.buttons,{hash:{},inverse:v.noop,fn:v.program(10,d,n),data:n}),(h||0===h)&&(f+=h),f+='\n </div>\n\n <div class="pull-right">\n ',h=i.each.call(t,t&&t.buttons,{hash:{},inverse:v.noop,fn:v.program(13,u,n),data:n}),(h||0===h)&&(f+=h),f+='\n </div>\n\n <div style="clear:both"></div>\n\n </div>\n\n </div>\n\n</script>'},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<o.length;l++){var c=o[l];t[c]!==s[c]&&r.call(this,c,t[c])}for(var d in t)s[d]||r.call(this,d,t[d])}return this}},e=e.extend({constructor:function(){this.extend(arguments[0])}},{ancestor:Object,version:"1.1",forEach:function(e,t,i){for(var a in e)void 0===this.prototype[a]&&t.call(i,e[a],a,e)},implement:function(){for(var e=0;e<arguments.length;e++)"function"==typeof arguments[e]?arguments[e](this.prototype):this.prototype.extend(arguments[e]);return this},toString:function(){return String(this.valueOf())}})}),function(e){var t=function(){var i=t.makeArray(arguments);if(0===i.length)return t.throwDefaultError("You must supply at least one argument which is the element against which to apply the Alpaca generated form");var a=i[0],n=null,r=null,s=null,o=null,l=null,c=null,d=null,p=null,u=!1,h={},f=null,m=null,g=null,v=null;if(1===i.length){for(var y=e(a).find(":first"),b=null,w=0;w<y.length;w++){var F=y[w],x=e(F).attr("alpaca-field-id");if(x){var S=t.fieldInstances[x];S&&(b=S)}}if(null!==b)return b;var E=e(a).html();e(a).html(""),n=E}if(i.length>=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");
  3 +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<e.children.length;i++)if(e.children[i].isControlField&&e.children[i].isAutoFocusable()&&!e.children[i].options.readonly){t(e.children[i]);break}}else if("string"==typeof s.focus){var a=e.getControlByPath(s.focus);a&&a.isControlField&&a.isAutoFocusable()&&t(a)}I(e)}},500):I(e),c&&c(e)};C.loadAll({data:n,schema:r,options:s,view:o,dataSource:f,schemaSource:m,optionsSource:g,viewSource:v},function(e,i,c,u){return e=e?e:n,c=c?c:r,i=i?i:s,u=u?u:o,t.isEmpty(e)&&t.isEmpty(c)&&(t.isEmpty(i)||t.isEmpty(i.type))&&(e="",t.isEmpty(i)?i="text":s&&t.isObject(s)&&(i.type="text")),i.view&&(u=i.view),t.init(a,e,i,c,u,h,l,k,p,d)},function(e){return d(e),null})};t.Fields={},t.Connectors={},t.Extend=e.extend,t.Create=function(){var t=Array.prototype.slice.call(arguments);return t.unshift({}),e.extend.apply(this,t)},t.Extend(t,{makeArray:function(e){return Array.prototype.slice.call(e)},isFunction:function(e){return"[object Function]"===Object.prototype.toString.call(e)},isString:function(e){return"string"==typeof e},isObject:function(e){return!t.isUndefined(e)&&"[object Object]"===Object.prototype.toString.call(e)},isPlainObject:function(t){return e.isPlainObject(t)},isNumber:function(e){return"number"==typeof e},isArray:function(e){return e instanceof Array},isBoolean:function(e){return"boolean"==typeof e},isUndefined:function(e){return"undefined"==typeof e},trim:function(e){var i=e;return i&&t.isString(i)&&(i=i.replace(/^\s+|\s+$/g,"")),i},safeDomParse:function(i){if(i&&t.isString(i)){i=t.trim(i);var a=null;try{a=e(i)}catch(n){i="<div>"+i+"</div>",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;n<i.length;n++)a.push(t.copyOf(i[n]))}else if(t.isObject(i)){if(i instanceof Date)return new Date(i.getTime());if(i instanceof RegExp)return new RegExp(i);if(i.nodeType&&"cloneNode"in i)a=i.cloneNode(!0);else if(e.isPlainObject(i)){a={};for(var r in i)i.hasOwnProperty(r)&&(a[r]=t.copyOf(i[r]))}}return a},cloneObject:function(e){return t.copyOf(e)},spliceIn:function(e,t,i){return e.substring(0,t)+i+e.substring(t,e.length)},compactArray:function(e){var t,i=[],a=e.length;for(t=0;a>t;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<n.length;r++){var s=n[r],o=t.TemplateEngineRegistry.find(s);if(o)for(var l=o.findCacheKeys(i),c=0;c<l.length;c++){var d=t.splitCacheKey(l[c]);e.templates[d.templateId]={type:s,template:!0,cacheKey:l[c]}}}}},getNormalizedView:function(e){return this.normalizedViews[e]},lookupNormalizedView:function(e,t){var i=null;for(var a in this.normalizedViews){var n=this.normalizedViews[a];if(n.ui===e&&n.type===t){i=a;break}}return i},registerTemplate:function(e,t,i){i||(i="base"),this.views[i]||(this.views[i]={},this.views[i].id=i),this.views[i].templates||(this.views[i].templates={}),this.views[i].templates[e]=t},registerTemplates:function(e,t){for(var i in e)this.registerTemplate(i,e[i],t)},registerMessage:function(e,t,i){i||(i="base"),this.views[i]||(this.views[i]={},this.views[i].id=i),this.views[i].messages||(this.views[i].messages={}),this.views[i].messages[e]=t},registerMessages:function(e,t){for(var i in e)e.hasOwnProperty(i)&&this.registerMessage(i,e[i],t)},defaultDateFormat:"MM/DD/YYYY",defaultTimeFormat:"HH:SS",regexps:{email:/^[a-z0-9!\#\$%&'\*\-\/=\?\+\-\^_`\{\|\}~]+(?:\.[a-z0-9!\#\$%&'\*\-\/=\?\+\-\^_`\{\|\}~]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z]{2,6}$/i,url:/^(http|https):\/\/[a-z0-9]+([\-\.]{1}[a-z0-9]+)*\.[a-z]{2,5}(\:[0-9]{1,5})?(([0-9]{1,5})?\/.*)?$/i,password:/^[0-9a-zA-Z\x20-\x7E]*$/,date:/^(0[1-9]|1[012])[- /.](0[1-9]|[12][0-9]|3[01])[- /.]\d\d$/,integer:/^([\+\-]?([1-9]\d*)|0)$/,number:/^([\+\-]?((([0-9]+(\.)?)|([0-9]*\.[0-9]+))([eE][+-]?[0-9]+)?))$/,phone:/^(\D?(\d{3})\D?\D?(\d{3})\D?(\d{4}))?$/,ipv4:/^(?:1\d?\d?|2(?:[0-4]\d?|[6789]|5[0-5]?)?|[3-9]\d?|0)(?:\.(?:1\d?\d?|2(?:[0-4]\d?|[6789]|5[0-5]?)?|[3-9]\d?|0)){3}$/,"zipcode-five":/^(\d{5})?$/,"zipcode-nine":/^(\d{5}(-\d{4})?)?$/},fieldInstances:{},fieldClassRegistry:{},registerFieldClass:function(e,t){this.fieldClassRegistry[e]=t},getFieldClass:function(e){return this.fieldClassRegistry[e]},getFieldClassType:function(e){for(var t in this.fieldClassRegistry)if(this.fieldClassRegistry.hasOwnProperty(t)&&this.fieldClassRegistry[t]===e)return t;return null},connectorClassRegistry:{},registerConnectorClass:function(e,t){this.connectorClassRegistry[e]=t},getConnectorClass:function(e){return this.connectorClassRegistry[e]},replaceAll:function(e,t,i){return e.replace(new RegExp(t,"g"),i)},element:function(t,i,a,n){var r=e("<"+t+"/>");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<e.length;a++)i.apply(e[a]);else if(t.isObject(e))for(var n in e)i.apply(e[n])},merge:function(e,i,a){e||(e={});for(var n in i){var r=!0;a&&(r=a(n)),r&&(t.isEmpty(i[n])?e[n]=i[n]:t.isObject(i[n])?(e[n]||(e[n]={}),e[n]=t.merge(e[n],i[n])):e[n]=i[n])}return e},mergeObject:function(e,t){return e||(e={}),t||(t={}),this.mergeObject2(t,e),e},mergeObject2:function(i,a){var n=t.isArray,r=t.isObject,s=t.isUndefined,o=t.copyOf,l=function(t,i){return n(t)?n(i)&&e.each(t,function(e){i.push(o(t[e]))}):r(t)?r(i)&&e.each(t,function(e){i[e]=s(i[e])?o(t[e]):l(t[e],i[e])}):i=o(t),i};return l(i,a),a},substituteTokens:function(e,i){if(!t.isEmpty(e))for(var a=0;a<i.length;a++){var n="{"+a+"}",r=e.indexOf(n);if(r>-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;f<u.errors.length;f++){var m=u.errors[f].view,g=u.errors[f].cacheKey,v=u.errors[f].err,y="The template with cache key: "+g+" for view: "+m+" failed to compile";v&&v.message&&(y+=", message: "+v.message,h.push(v.message)),v&&(y+=", err: "+JSON.stringify(v)),t.logError(y),delete p.normalizedViews[m],delete p.views[m]}return t.throwErrorWithCallback("View compilation failed, cannot initialize Alpaca. "+h.join(", "),d)}p._init(e,i,a,n,r,s,o,l,c,d)},d)},_init:function(i,a,n,r,s,o,l,c,d,p){var u=this,h=t.defaultView||null,f=null;e.mobile&&!h&&(h="jquerymobile");var m="function"==typeof e.fn.modal;m&&!h&&(h="bootstrap");var g="undefined"!=typeof e.ui;if(g&&!h&&(h="jqueryui"),h&&(f=a?"edit":"create"),!s){var v=o.ui,y=o.type;v||(h||(h=t.defaultUI),h&&(v=h)),v&&(y||(y=f?f:"edit"),t.logDebug("No view provided but found request for UI: "+v+" and type: "+y),s=this.lookupNormalizedView(v,y),t.logDebug(s?"Found view: "+s:"No view found for UI: "+v+" and type: "+y))}if(!s)return t.throwErrorWithCallback("A view was not specified and could not be automatically determined.",p);if(t.isString(s)&&!this.normalizedViews[s])return t.throwErrorWithCallback("The desired view: "+s+" could not be loaded. Please make sure it is loaded and not misspelled.",p);var b=t.createFieldInstance(i,a,n,r,s,d,p);if(b){e(i).addClass("alpaca-field-rendering"),e(i).addClass("alpaca-hidden"),t.fieldInstances[b.getId()]=b,b.allFieldInstances=function(){return t.fieldInstances},t.isEmpty(l)&&(l=b.view.render),t.isEmpty(c)&&(c=b.view.postRender);var w=function(){b.parent||b.getFieldEl().addClass("alpaca-"+u.getNormalizedView(s).type),b.parent||b.getFieldEl().addClass("alpaca-top"),e(i).removeClass("alpaca-field-rendering"),e(i).removeClass("alpaca-hidden"),b._oldFieldEl&&e(b._oldFieldEl).remove(),c(b)};t.isEmpty(l)?b.render(function(){w()}):l(b,function(){w()}),b.callback=l,b.renderedCallback=c}},createFieldInstance:function(e,i,a,n,r,s,o){if(t.isValEmpty(a)&&(a={}),t.isValEmpty(n)&&(n={}),a&&t.isString(a)){var l=a;a={},a.type=l}a.type||(n.type||(n.type=t.getSchemaType(i)),n.type||(n.type="object"),a.type=n&&n["enum"]?n["enum"].length>3?"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;c<t.length;c++)t[c](o)},d=function(){var e={},i=0;t.normalizedViews||(t.normalizedViews={}),n.normalizedViews=t.normalizedViews;for(var r in n.views)if(!t.normalizedViews[r]){var o=new t.NormalizedView(r);if(!o.normalize(n.views))return t.throwErrorWithCallback("View normalization failed, cannot initialize Alpaca. Please check the error logs.",a);e[r]=o,i++}i>0?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<c.length;d++){var p=c[d],u=t.TemplateEngineRegistry.find(p);if(u.isCached(s)){r=p;break}}r&&(n={engine:r,cacheKey:s})}return n},tmpl:function(e,i){var a=t.tmplHtml(e,i);return t.safeDomParse(a)},tmplHtml:function(e,i){i||(i={});var a=e.engine,n=t.TemplateEngineRegistry.find(a);if(!n)return t.throwDefaultError("Cannot find template engine for type: "+a);var r=e.cacheKey,s=n.execute(r,i,function(e){var i=JSON.stringify(e);return e.message&&(i=e.message),t.throwDefaultError("The compiled template: "+r+" failed to execute: "+i)});return s}}),t.DEBUG=0,t.INFO=1,t.WARN=2,t.ERROR=3,t.logLevel=t.WARN,t.logDebug=function(e){t.log(t.DEBUG,e)},t.logInfo=function(e){t.log(t.INFO,e)},t.logWarn=function(e){t.log(t.WARN,e)},t.logError=function(e){t.log(t.ERROR,e)},t.LOG_METHOD_MAP={0:"debug",1:"info",2:"warn",3:"error"},t.log=function(e,i){if(t.logLevel<=e){var a=t.LOG_METHOD_MAP[e];"undefined"!=typeof console&&console[a]&&("debug"===a?console.debug(i):"info"===a?console.info(i):"warn"===a?console.warn(i):"error"===a?console.error(i):console.log(i))}},t.checked=function(e,i){return t.attrProp(e,"checked",i)},t.attrProp=function(t,i,a){return"undefined"!=typeof a&&(e(t).prop?e(t).prop(i,a):a?e(t).attr(i,a):e(t).removeAttr(i)),e(t).prop?e(t).prop(i):e(t).attr(i)},t.loadRefSchemaOptions=function(e,i,a){if(i)if("#"===i)a(e.schema,e.options);else if(0===i.indexOf("#/")){for(var n=i.substring(2),r=n.split("/"),s=e.schema,o=0;o<r.length;o++){var l=r[o];if(s[l])s=s[l];else if(s.properties&&s.properties[l])s=s.properties[l];else{if(!s.definitions||!s.definitions[l]){s=null;break}s=s.definitions[l]}}for(var c=e.options,o=0;o<r.length;o++){var l=r[o];if(c[l])c=c[l];else if(c.fields&&c.fields[l])c=c.fields[l];else{if(!c.definitions||!c.definitions[l]){c=null;break}c=c.definitions[l]}}a(s,c)}else if(0===i.indexOf("#")){var d=t.resolveReference(e.schema,e.options,i);d?a(d.schema,d.options):a()}else{var p=t.pathParts(i);e.connector.loadReferenceSchema(p.path,function(i){e.connector.loadReferenceOptions(p.path,function(e){if(p.id){var n=t.resolveReference(i,e,p.id);n&&(i=n.schema,e=n.options)}a(i,e)},function(){a(i)})},function(){a()})}else a()},t.DEFAULT_ERROR_CALLBACK=function(e){if(e&&e.message)throw t.logError(JSON.stringify(e)),new Error("Alpaca caught an error with the default error handler: "+JSON.stringify(e))},t.defaultErrorCallback=t.DEFAULT_ERROR_CALLBACK,t.throwDefaultError=function(e){e&&t.isObject(e)&&(e=JSON.stringify(e));var i={message:e};t.defaultErrorCallback(i)},t.throwErrorWithCallback=function(e,i){e&&t.isObject(e)&&(e=JSON.stringify(e));var a={message:e};i?i(a):t.defaultErrorCallback(a)},t.resolveReference=function(e,i,a){if(e.id==a){var n={};return e&&(n.schema=e),i&&(n.options=i),n}if(e&&e.properties)for(var r in e.properties){var s=e.properties[r],o=null;i&&i.fields&&i.fields[r]&&(o=i.fields[r]);var l=t.resolveReference(s,o,a);if(l)return l}return null},e.alpaca=window.Alpaca=t,e.fn.alpaca=function(){var e=t.makeArray(arguments),i=[].concat(this,e);return t.apply(this,i),this},e.fn.outerHTML=function(t){return t?e("<div></div>").append(this).html():e("<div></div>").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;a<e.children.length;a++){var n=e.children[a],r=t.resolveFieldByReference(n,i);if(r)return r}return null},t.anyEquality=function(e,i){var a={};if("object"==typeof e||t.isArray(e))for(var n in e)a[e[n]]=!0;else a[e]=!0;var r=!1;if("object"==typeof i||t.isArray(i))for(var n in i){var s=i[n];if(a[s]){r=!0;break}}else r=a[i];return r},t.series=function(e,t){async.series(e,function(){t()})},t.parallel=function(e,t){async.parallel(e,function(){t()})},t.nextTick=function(e){async.nextTick(function(){e()})},t.compileValidationContext=function(e,t){var i=[],a=e;do a.isValidationParticipant()||(a=null),a&&i.push(a),a&&(a=a.parent);while(a);i.reverse();var n=[],r=function(e,t,i){if(!e||0===e.length)return void i();var a=e[0],n={};n.id=a.getId(),n.field=a,n.path=a.path;var s=a.isValid();a.isContainer()&&(s=a.isValid(!0)),n.before=s;var o=function(e,i,a){var n=e._previouslyValidated;e.validate(),e._validateCustomValidator(function(){var r=e.isValid();e.isContainer()&&(r=e.isValid(!0)),i.after=r,i.validated=!1,i.invalidated=!1,!s&&r?i.validated=!0:s&&!r?i.invalidated=!0:n||r||(i.invalidated=!0),i.container=e.isContainer(),i.valid=i.after,t.push(i),a()})};if(e.length>1){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;a<i.length;a++){var n=i[a],r=n.field;if(r.getFieldEl().removeClass("alpaca-invalid alpaca-invalid-hidden alpaca-valid"),r.fireCallback("clearValidity"),n.valid)r.getFieldEl().addClass("alpaca-field-valid"),r.fireCallback("valid");else if(r.options.readonly)t.logWarn("The field (id="+r.getId()+", title="+r.getTitle()+", path="+r.path+") is invalid and also read-only");else{var s=!1;r.hideInitValidationError&&(s=!0),r.fireCallback("invalid",s),r.getFieldEl().addClass("alpaca-invalid"),s&&r.getFieldEl().addClass("alpaca-invalid-hidden")}if(n.validated?t.later(25,this,function(){r.trigger("validated")}):n.invalidated&&t.later(25,this,function(){r.trigger("invalidated")}),r.options.showMessages&&!r.initializing&&!r.options.readonly){var o=[];for(var l in r.validation)r.validation[l].status||o.push({id:l,message:r.validation[l].message});r.displayMessage(o,r.valid)}}},t.fieldApplyChildren=function(e,t){var i=function(e,t){if(e.children&&e.children.length>0)for(var i=0;i<e.children.length;i++)t(e.children[i])};i(e,t)},t.fieldApplyFieldAndChildren=function(e,i){i(e),t.fieldApplyChildren(e,i)},t.replaceAll=function(e,t,i){return e.replace(new RegExp(t,"g"),i)},t.asArray=function(e){if(!t.isArray(e)){var i=[];return i.push(e),i}return e},function(){function e(e){var t=!1;return function(){if(t)throw new Error("Callback was already called.");t=!0,e.apply(a,arguments)}}function t(e){return e.constructor===String?"string":e.constructor===Boolean?"boolean":e.constructor===Number?isNaN(e)?"nan":"number":"undefined"==typeof e?"undefined":null===e?"null":e instanceof Array?"array":e instanceof Date?"date":e instanceof RegExp?"regexp":"object"==typeof e?"object":e instanceof Function?"function":void 0}function i(e,i,a){var n=t(e);return n?"function"===t(i[n])?i[n].apply(i,a):i[n]:void 0}var a,n,r={};a=this,null!=a&&(n=a.async),r.noConflict=function(){return a.async=n,r};var s=function(e,t){if(e.forEach)return e.forEach(t);for(var i=0;i<e.length;i+=1)t(e[i],i,e)},o=function(e,t){if(e.map)return e.map(t);var i=[];return s(e,function(e,a,n){i.push(t(e,a,n))}),i},l=function(e,t,i){return e.reduce?e.reduce(t,i):(s(e,function(e,a,n){i=t(i,e,a,n)}),i)},c=function(e){if(Object.keys)return Object.keys(e);var t=[];for(var i in e)e.hasOwnProperty(i)&&t.push(i);return t};"undefined"!=typeof process&&process.nextTick?(r.nextTick=process.nextTick,r.setImmediate="undefined"!=typeof setImmediate?function(e){setImmediate(e)}:r.nextTick):"function"==typeof setImmediate?(r.nextTick=function(e){setImmediate(e)},r.setImmediate=r.nextTick):(r.nextTick=function(e){setTimeout(e,0)},r.setImmediate=r.nextTick),r.each=function(t,i,a){if(a=a||function(){},!t.length)return a();var n=0;s(t,function(r){i(r,e(function(e){e?(a(e),a=function(){}):(n+=1,n>=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;)r+=1,s+=1,i(t[r-1],function(e){e?(a(e),a=function(){}):(n+=1,s-=1,n>=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;t<n.length;t+=1)if(n[t]===e)return void n.splice(t,1)},p=function(){s(n.slice(0),function(e){e()})};o(function(){c(a).length===i.length&&(t(null,a),t=function(){})}),s(i,function(i){var n=e[i]instanceof Function?[e[i]]:e[i],u=function(e){var n=Array.prototype.slice.call(arguments,1);if(n.length<=1&&(n=n[0]),e){var o={};s(c(a),function(e){o[e]=a[e]}),o[i]=n,t(e,o),t=function(){}}else a[i]=n,r.setImmediate(p)},h=n.slice(0,Math.abs(n.length-1))||[],f=function(){return l(h,function(e,t){return e&&a.hasOwnProperty(t)},!0)&&!a.hasOwnProperty(i)};if(f())n[n.length-1](u,a);else{var m=function(){f()&&(d(m),n[n.length-1](u,a))};o(m)}})},r.waterfall=function(e,t){if(t=t||function(){},e.constructor!==Array){var i=new Error("First argument to waterfall must be an array of functions");return t(i)}if(!e.length)return t();var a=function(e){return function(i){if(i)t.apply(null,arguments),t=function(){};else{var n=Array.prototype.slice.call(arguments,1),s=e.next();n.push(s?a(s):t),r.setImmediate(function(){e.apply(null,n)})}}};a(r.iterator(e))()};var b=function(e,t,i){if(i=i||function(){},t.constructor===Array)e.map(t,function(e,t){e&&e(function(e){var i=Array.prototype.slice.call(arguments,1);i.length<=1&&(i=i[0]),t.call(null,e,i)})},i);else{var a={};e.each(c(t),function(e,i){t[e](function(t){var n=Array.prototype.slice.call(arguments,1);n.length<=1&&(n=n[0]),a[e]=n,i(t)})},function(e){i(e,a)})}};r.parallel=function(e,t){b({map:r.map,each:r.each},e,t)},r.parallelLimit=function(e,t,i){b({map:m(t),each:d(t)},e,i)},r.series=function(e,t){if(t=t||function(){},e.constructor===Array)r.mapSeries(e,function(e,t){e&&e(function(e){var i=Array.prototype.slice.call(arguments,1);i.length<=1&&(i=i[0]),t.call(null,e,i)})},t);else{var i={};r.eachSeries(c(e),function(t,a){e[t](function(e){var n=Array.prototype.slice.call(arguments,1);n.length<=1&&(n=n[0]),i[t]=n,a(e)})},function(e){t(e,i)})}},r.iterator=function(e){var t=function(i){var a=function(){return e.length&&e[i].apply(null,arguments),a.next()};return a.next=function(){return i<e.length-1?t(i+1):null},a};return t(0)},r.apply=function(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t.concat(Array.prototype.slice.call(arguments)))}};var w=function(e,t,i,a){var n=[];e(t,function(e,t){i(e,function(e,i){n=n.concat(i||[]),t(e)})},function(e){a(e,n)})};r.concat=p(w),r.concatSeries=h(w),r.whilst=function(e,t,i){e()?t(function(a){return a?i(a):void r.whilst(e,t,i)}):i()},r.doWhilst=function(e,t,i){e(function(a){return a?i(a):void(t()?r.doWhilst(e,t,i):i())})},r.until=function(e,t,i){e()?i():t(function(a){return a?i(a):void r.until(e,t,i)})},r.doUntil=function(e,t,i){e(function(a){return a?i(a):void(t()?i():r.doUntil(e,t,i))})},r.queue=function(t,i){function a(e,t,a,n){t.constructor!==Array&&(t=[t]),s(t,function(t){var s={data:t,callback:"function"==typeof n?n:null};a?e.tasks.unshift(s):e.tasks.push(s),e.saturated&&e.tasks.length===i&&e.saturated(),r.setImmediate(e.process)})}void 0===i&&(i=1);var n=0,o={tasks:[],concurrency:i,saturated:null,empty:null,drain:null,push:function(e,t){a(o,e,!1,t)},unshift:function(e,t){a(o,e,!0,t)},process:function(){if(n<o.concurrency&&o.tasks.length){var i=o.tasks.shift();o.empty&&0===o.tasks.length&&o.empty(),n+=1;var a=function(){n-=1,i.callback&&i.callback.apply(i,arguments),o.drain&&o.tasks.length+n===0&&o.drain(),o.process()},r=e(a);t(i.data,r)}},length:function(){return o.tasks.length},running:function(){return n}};return o},r.cargo=function(e,t){var i=!1,a=[],n={tasks:a,payload:t,saturated:null,empty:null,drain:null,push:function(e,i){e.constructor!==Array&&(e=[e]),s(e,function(e){a.push({data:e,callback:"function"==typeof i?i:null}),n.saturated&&a.length===t&&n.saturated()}),r.setImmediate(n.process)},process:function l(){if(!i){if(0===a.length)return void(n.drain&&n.drain());var r="number"==typeof t?a.splice(0,t):a.splice(0),c=o(r,function(e){return e.data});n.empty&&n.empty(),i=!0,e(c,function(){i=!1;var e=arguments;s(r,function(t){t.callback&&t.callback.apply(null,e)}),l()})}},length:function(){return a.length},running:function(){return i}};return n};var F=function(e){return function(t){var i=Array.prototype.slice.call(arguments,1);t.apply(null,i.concat([function(t){var i=Array.prototype.slice.call(arguments,1);"undefined"!=typeof console&&(t?console.error&&console.error(t):console[e]&&s(i,function(t){console[e](t)}))}]))}};r.log=F("log"),r.dir=F("dir"),r.memoize=function(e,t){var i={},a={};t=t||function(e){return e};var n=function(){var n=Array.prototype.slice.call(arguments),r=n.pop(),s=t.apply(null,n);s in i?r.apply(null,i[s]):s in a?a[s].push(r):(a[s]=[r],e.apply(null,n.concat([function(){i[s]=arguments;var e=a[s];delete a[s];for(var t=0,n=e.length;n>t;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)
  4 +},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<n.length;r++)if(t.toLowerCase()===n[r].toLowerCase()){i=e[a];break}return i},ids:function(){var t=[];for(var i in e)t.push(i);return t}}}()}(),function(e){Alpaca.AbstractTemplateEngine=Base.extend({constructor:function(t){this.base(),this.id=t,this.cleanup=function(t){return t&&1===e(t).length&&"script"===e(t)[0].nodeName.toLowerCase()?e(t).html():t}},compile:function(t,i,a){var n=this,r="html";if(Alpaca.isString(i)){var s=i.toLowerCase();0===s.indexOf("http://")||0===s.indexOf("https://")||0===s.indexOf("./")||0===s.indexOf("/")||0===s.indexOf("../")?r="uri":(0===i.indexOf("#")||0===i.indexOf(".")||0===i.indexOf("["))&&(r="selector")}if("selector"===r)n._compile(t,i,function(e){a(e)});else if("uri"===r){var o=n.fileExtension(),l=i;-1===l.indexOf("."+o)&&(l+="."+o),e.ajax({url:l,dataType:"html",success:function(e){e=n.cleanup(e),n._compile(t,e,function(e){a(e)})},error:function(e,t){a({message:e.responseText,xhr:e,code:t},null)}})}else if("html"===r){var c=i;c instanceof jQuery&&(c=e(c).outerHTML()),n._compile(t,c,function(e){a(e)})}else a(new Error("Template engine cannot determine how to handle type: "+r))},_compile:function(e,t,i){Alpaca.isEmpty(t)&&(t=""),t=Alpaca.trim(t),0===t.toLowerCase().indexOf("<script")||(t="<script type='"+this.supportedMimetypes()[0]+"'>"+t+"</script>"),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"<div class='"+Alpaca.MARKER_CLASS_CONTROL_FIELD+"'></div>"},helpers.container=function(){return"<div class='"+Alpaca.MARKER_CLASS_CONTAINER_FIELD+"'></div>"},helpers.item=function(){return"<div class='"+Alpaca.MARKER_CLASS_CONTAINER_FIELD_ITEM+"' "+Alpaca.MARKER_DATA_CONTAINER_FIELD_ITEM_KEY+"='"+this.name+"'></div>"},helpers.formItems=function(){return"<div class='"+Alpaca.MARKER_CLASS_FORM_ITEMS_FIELD+"'></div>"},helpers.insert=function(e){return"<div class='"+Alpaca.MARKER_CLASS_INSERT+"' "+Alpaca.MARKER_DATA_INSERT_KEY+"='"+e+"'></div>"},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.length;d++){var p=a[d];o(this,p,"type"),o(this,p,"ui"),o(this,p,"displayReadonly"),l(this,p,"render"),l(this,p,"postRender"),c(this,p,"templates"),c(this,p,"fields"),c(this,p,"layout"),c(this,p,"styles"),c(this,p,"callbacks"),c(this,p,"messages"),o(this,p,"horizontal"),o(this,p,"collapsible"),o(this,p,"legendStyle"),o(this,p,"toolbarStyle"),o(this,p,"buttonStyle"),o(this,p,"toolbarSticky"),o(this,p,"globalTemplate"),c(this,p,"wizard")}return t.logDebug("View compilation complete for view: "+this.id),t.logDebug("Final view: "),t.logDebug(JSON.stringify(this,null," ")),!0}})}(jQuery),function(e){var t=e.alpaca;t.RuntimeView=Base.extend({constructor:function(e,t){this.field=t,this.setView(e)},setView:function(e){e||(e="web-edit");var i=t.getNormalizedView(e);if(!i)throw new Error("Runtime view for view id: "+e+" could not find a normalized view");for(var a in i)i.hasOwnProperty(a)&&(this[a]=i[a])},getWizard:function(){return this.getViewParam("wizard")},getGlobalTemplateDescriptor:function(){return this.getTemplateDescriptor("globalTemplate")},getLayout:function(){var e=this;return{templateDescriptor:this.getTemplateDescriptor("layoutTemplate",e),bindings:this.getViewParam(["layout","bindings"],!0)}},getTemplateDescriptor:function(e,i){return t.getTemplateDescriptor(this,e,i)},getMessage:function(e){var i=this.getViewParam(["messages",t.defaultLocale,e]);return t.isEmpty(i)?this.getViewParam(["messages",e]):i},getViewParam:function(e,i){var a=this.field.path;if(this.fields&&this.fields[a]){var n=this._getConfigVal(this.fields[a],e);if(!t.isEmpty(n))return n}if(a&&-1!==a.indexOf("[")&&-1!==a.indexOf("]")&&(a=a.replace(/\[\d+\]/g,"[*]"),this.fields&&this.fields[a])){var n=this._getConfigVal(this.fields[a],e);if(!t.isEmpty(n))return n}return!t.isEmpty(i)&&i&&"/"!==this.field.path?null:this._getConfigVal(this,e)},_getConfigVal:function(e,i){if(t.isArray(i))for(var a=0;a<i.length&&!t.isEmpty(e);a++)e=e[i[a]];else t.isEmpty(e)||(e=e[i]);return e},fireCallback:function(e,t,i,a,n,r,s){this.callbacks&&this.callbacks[t]&&this.callbacks[t].call(e,i,a,n,r,s)},applyStyle:function(t,i){var a=i;a&&a.getFieldEl&&(a=a.getFieldEl()),a&&this.styles&&this.styles[t]&&e(a).addClass(this.styles[t])},getStyle:function(e){return this.styles[e]?this.styles[e]:""}})}(jQuery),function(e){var t=e.alpaca;t.Field=Base.extend({constructor:function(e,i,a,n,r,s,o){var l=this;this.initializing=!0,this.domEl=e,this.parent=null,this.data=i,this.options=a,this.schema=n,this.connector=s,this.errorCallback=function(e){o?o(e):t.defaultErrorCallback.call(l,e)},this.singleLevelRendering=!1,this.view=new t.RuntimeView(r,this);var c=!1;this.options||(this.options={},c=!0),this.id=this.options.id,this.type=this.options.type,this.id||(this.id=t.generateId());var d=!1;this.schema||(this.schema={},d=!0),this.options.label||null===this.schema.title||(this.options.label=this.schema.title),t.isEmpty(this.options.readonly)&&!t.isEmpty(this.schema.readonly)&&(this.options.readonly=this.schema.readonly),t.isValEmpty(this.data)&&!t.isEmpty(this.schema["default"])&&(this.data=this.schema["default"],this.showingDefaultData=!0),this.path="/",this.validation={},this._events={},this.isDisplayOnly=function(){return"view"===l.view.type||"display"==l.view.type},this.schema&&this.schema.id&&0===this.schema.id.indexOf("#")&&(this.schema.id=this.schema.id.substring(1)),this._previouslyValidated=!1,this.updateObservable=function(){this.data?this.observable(this.path).set(this.data):this.observable(this.path).clear()},this.getObservableScope=function(){for(var e=this;!e.isTop();)e=e.parent;var t=e.observableScope;return t||(t="global"),t},this.ensureProperType=function(e){var i=this;return"undefined"!=typeof e&&(t.isString(e)?"number"===i.schema.type?e=parseFloat(e):"boolean"===i.schema.type&&(e=""===e||"false"===e.toLowerCase()?!1:!0):t.isNumber(e)&&("string"===i.schema.type?e=""+e:"boolean"===i.schema.type&&(e=-1===e||0===e?!1:!0))),e},this.onConstruct()},onConstruct:function(){},isTop:function(){return!this.parent},getTemplateDescriptorId:function(){throw new Error("Template descriptor ID was not specified")},initTemplateDescriptor:function(){var e=this,i=this.view.getTemplateDescriptor(this.getTemplateDescriptorId(),this),a=this.view.getGlobalTemplateDescriptor(),n=this.view.getLayout(),r=!1;this.isTop()&&(a?(this.setTemplateDescriptor(a),this.singleLevelRendering=!0,r=!0):n&&n.templateDescriptor&&(this.setTemplateDescriptor(n.templateDescriptor),r=!0)),!r&&i&&this.setTemplateDescriptor(i);var s=this.getTemplateDescriptor();return s?void 0:t.throwErrorWithCallback("Unable to find template descriptor for field: "+e.getFieldType())},setup:function(){this.initializing||(this.data=this.getValue()),this.initTemplateDescriptor(),t.isUndefined(this.schema.required)&&(this.schema.required=!1),t.isUndefined(this.options.validate)&&(this.options.validate=!0),t.isUndefined(this.options.disabled)&&(this.options.disabled=!1),t.isUndefined(this.options.showMessages)&&(this.options.showMessages=!0)},on:function(e,i){return t.logDebug("Adding listener for event: "+e),this._events[e]=i,this},triggerWithPropagation:function(e,t){this.trigger.call(this,e,t),this.parent&&this.parent.triggerWithPropagation.call(this.parent,e,t)},trigger:function(e,i){var a=this._events[e],n=null;if("function"==typeof a){t.logDebug("Firing event: "+e);try{n=a.call(this,i)}catch(r){t.logDebug("The event handler caught an exception: "+e)}}return n},bindData:function(){t.isEmpty(this.data)||this.setValue(this.data)},render:function(e,i){e&&(t.isString(e)||t.isObject(e))?this.view.setView(e):t.isEmpty(i)&&t.isFunction(e)&&(i=e),null===this.options.label&&this.propertyId&&(this.options.label=this.propertyId),this.options.name&&(this.name=this.options.name),this.calculateName(),this.setup(),this._render(i)},calculateName:function(){if(!this.name||this.name&&this.nameCalculated)if(this.parent&&this.parent.name&&this.path){var e=this.path.substring(this.path.lastIndexOf("/")+1);-1!==e.indexOf("[")&&-1!==e.indexOf("]")&&(e=e.substring(e.indexOf("[")+1,e.indexOf("]"))),e&&(this.name=this.parent.name+"_"+e,this.nameCalculated=!0)}else this.path&&(this.name=this.path.replace(/\//g,"").replace(/\[/g,"_").replace(/\]/g,""),this.nameCalculated=!0)},_render:function(i){var a=this;if(a.options.form&&t.isObject(a.options.form)){a.options.form.viewType=this.view.type;var n=a.form;n||(n=new t.Form(a.domEl,this.options.form,a.view.id,a.connector,a.errorCallback)),n.render(function(n){var r=e("<div></div>");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<i.length;a++)e.addClass(i[a]);else if(i.indexOf(",")>-1)for(n=i.split(","),a=0;a<n.length;a++)e.addClass(n[a]);else if(i.indexOf(" ")>-1)for(n=i.split(" "),a=0;a<n.length;a++)e.addClass(n[a]);else e.addClass(i)}};n(this.field,this.options.fieldClass),this.options.disabled&&(this.disable(),a.fireCallback("disable")),this.view.type&&"edit"===this.view.type?this.bindData():this.showingDefaultData&&this.bindData(),"create"===this.view.type&&t.logDebug("Skipping data binding for field: "+this.id+" since view mode is 'create'"),this.view.type&&"view"!==this.view.type&&this.initEvents()}this.options.hidden&&this.field.hide(),this.initializing=!1;var r="create"===this.view.type&&!this.refreshed;this.hideInitValidationError=t.isValEmpty(this.options.hideInitValidationError)?r:this.options.hideInitValidationError,this.view.displayReadonly||e(this.field).find(".alpaca-readonly").hide(),this.options.postRender?this.options.postRender.call(this,function(){i()}):i()},refresh:function(t){var i=this;i.refreshed=!0;var a=e("<div></div>");e(i.field).before(a),i.domEl=e("<div></div>"),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;i<e.children.length;i++)o(e.children[i],t);r.push(s(e,t))}};o(this,n)}r.push(s(this,n)),t.series(r,function(){for(var e={},r=[],s=0;s<n.length;s++)for(var o=n[s],l=r.length,c=0;c<o.length;c++){var d=o[c],p=e[d.id];if(p)d.validated&&!p.invalidated&&(p.validated=!0,p.invalidated=!1,p.valid=d.valid),d.invalidated&&(p.invalidated=!0,p.validated=!1,p.valid=d.valid);else{var u={};u.id=d.id,u.path=d.path,u.domEl=d.domEl,u.field=d.field,u.validated=d.validated,u.invalidated=d.invalidated,u.valid=d.valid,r.splice(l,0,u),e[u.id]=u}}r.reverse(),a.hideInitValidationError||t.updateValidationStateForContext(a.view,r),i&&i()})},validate:function(e){var i=!0;if(!this.initializing&&this.options.validate){if(this.children&&e)for(var a=0;a<this.children.length;a++){var n=this.children[a];n.isValidationParticipant()&&n.validate(e)}if(i=this.handleValidate(),!i&&t.logLevel==t.DEBUG){var r=[];for(var s in this.validation)this.validation[s].status||r.push(this.validation[s].message);t.logDebug("Validation failure for field (id="+this.getId()+", path="+this.path+"), messages: "+JSON.stringify(r))}}return this._previouslyValidated=!0,i},handleValidate:function(){var e=this.validation,i=this._validateOptional();return e.notOptional={message:i?"":this.view.getMessage("notOptional"),status:i},i=this._validateDisallow(),e.disallowValue={message:i?"":t.substituteTokens(this.view.getMessage("disallowValue"),[this.schema.disallow.join(", ")]),status:i},e.notOptional.status&&e.disallowValue.status},_validateCustomValidator:function(e){var i=this;this.options.validator&&t.isFunction(this.options.validator)?this.options.validator.call(this,function(t){i.validation.custom=t,e()}):e()},_validateOptional:function(){return this.isRequired()&&this.isEmpty()?!1:!0},_validateDisallow:function(){if(!t.isValEmpty(this.schema.disallow)){var i=this.getValue(),a=this.schema.disallow;if(t.isArray(a)){var n=!0;return e.each(a,function(e,a){(t.isObject(i)||t.isArray(i))&&t.isString(a)&&(a=t.parseJSON(a)),t.compareObject(i,a)&&(n=!1)}),n}return(t.isObject(i)||t.isArray(i))&&t.isString(a)&&(a=t.parseJSON(a)),!t.compareObject(i,a)}return!0},triggerUpdate:function(){e(this.field).trigger("fieldupdate")},disable:function(){},enable:function(){},focus:function(){},destroy:function(){t.observable(this.path).clear(),t&&t.fieldInstances&&t.fieldInstances[this.getId()]&&delete t.fieldInstances[this.getId()],e(this.field).remove()},show:function(){this.options&&this.options.hidden||(e(this.field).css({display:""}),this.onShow(),this.fireCallback("show"))},onShow:function(){},hide:function(){e(this.field).css({display:"none"}),this.onHide(),this.fireCallback("hide")},onHide:function(){},isValidationParticipant:function(){return this.isShown()},isShown:function(){return this.isVisible()},isVisible:function(){return!this.isHidden()},isHidden:function(){return"none"===e(this.field).css("display")},print:function(){this.getFieldEl().printArea&&this.getFieldEl().printArea()},onDependentReveal:function(){},onDependentConceal:function(){},reload:function(){this.initializing=!0,t.isEmpty(this.callback)?this.render(this.renderedCallback):this.callback(this,this.renderedCallback)},clear:function(){var e=null;this.data&&(e=this.data),this.setValue(e)},isEmpty:function(){return t.isValEmpty(this.getValue())},isValid:function(t){if(t&&this.children)for(var i=0;i<this.children.length;i++){var a=this.children[i];if(a.isValidationParticipant()&&!a.isValid(t))return!1}if(e.isEmptyObject(this.validation))return!0;for(var n in this.validation)if(!this.validation[n].status)return!1;return!0},initEvents:function(){var i=this;this.field&&(this.field.mouseover(function(e){i.onMouseOver.call(i,e),i.trigger("mouseover",e)}),this.field.mouseout(function(e){i.onMouseOut.call(i,e),i.trigger("mouseout",e)}),e.each(this.options,function(e,a){if(t.startsWith(e,"onField")&&t.isFunction(a)){var n=e.substring(7).toLowerCase();i.field.on(n,function(e){a.call(i,e)})}}),this.options&&this.options.events&&e.each(this.options.events,function(e,a){t.isFunction(a)&&i.field.on(e,function(e){a.call(i,e)})}))},onFocus:function(){e(this.field).removeClass("alpaca-field-empty"),e(this.field).addClass("alpaca-field-focused")},onBlur:function(){var t=e(this.field).hasClass("alpaca-field-focused");e(this.field).removeClass("alpaca-field-focused"),t&&this.refreshValidationState()},onChange:function(){this.data=this.getValue(),this.updateObservable(),this.triggerUpdate()},onMouseOver:function(){},onMouseOut:function(){},getControlByPath:function(e){var i=this;if(e){for(var a=e.split("/"),n=0;n<a.length;n++){if(t.isValEmpty(a[n]))return null;if(!i||!i.childrenByPropertyId)return null;if(!i.childrenByPropertyId[a[n]])return null;i=i.childrenByPropertyId[a[n]]}return i}},subscribe:function(){var e=t.makeArray(arguments);return e.unshift(this.getObservableScope()),t.subscribe.apply(this,e)},unsubscribe:function(){var e=t.makeArray(arguments);return e.unshift(this.getObservableScope()),t.unsubscribe.apply(this,e)},observable:function(){var e=t.makeArray(arguments);return e.unshift(this.getObservableScope()),t.observable.apply(this,e)},clearObservable:function(){var e=t.makeArray(arguments);return e.unshift(this.getObservableScope()),t.clearObservable.apply(this,e)},dependentObservable:function(){var e=t.makeArray(arguments);return e.unshift(this.getObservableScope()),t.dependentObservable.apply(this,e)},getType:function(){},getFieldType:function(){return""},getBaseFieldType:function(){var e=null,t=this.constructor.ancestor.prototype;return t&&t.getFieldType&&(e=t.getFieldType()),e},isContainer:function(){return!1},isRequired:function(){var e=!1;if("boolean"==typeof this.schema.required&&(e=this.schema.required),this.parent&&this.parent.schema.required&&t.isArray(this.parent.schema.required)){var i=this.parent.schema.required;if(i)for(var a=0;a<i.length;a++)if(i[a]===this.name){e=!0;break}}return e},getTitle:function(){},getDescription:function(){},getSchemaOfSchema:function(){var e={title:this.getTitle(),description:this.getDescription(),type:"object",properties:{title:{title:"Title",description:"Short description of the property.",type:"string"},description:{title:"Description",description:"Detailed description of the property.",type:"string"},readonly:{title:"Readonly",description:"Indicates that the field is read-only. A read-only field cannot have it's value changed. Read-only fields render in a grayed-out or disabled control. If the field is rendered using a view with the <code>displayReadonly</code> 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});
  5 +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;s<i.items.length;s++){var o=i.items[s].name;r[o]="[data-alpaca-layout-binding='"+o+"']"}}i.items.length>0?(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;s<i.items.length;s++){var l=i.items[s],c=e(n.container).find("["+t.MARKER_DATA_CONTAINER_FIELD_ITEM_KEY+"='"+l.name+"']");if(r){var d=r[l.name];if(d){var p=e(d,n.field);if(0==p.length)try{p=e("#"+d,n.field)}catch(u){}p.length>0&&(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;a<t.children.length;a++){var n=t.children[a],r=n.getFieldEl();n.path=t.path+"["+a+"]",n.calculateName(),e(r).removeClass("alpaca-container-item-first"),e(r).removeClass("alpaca-container-item-last"),e(r).removeClass("alpaca-container-item-index"),e(r).removeClass("alpaca-container-item-key"),e(r).addClass("alpaca-container-item"),0===a&&e(r).addClass("alpaca-container-item-first"),a+1===t.children.length&&e(r).addClass("alpaca-container-item-last"),e(r).attr("data-alpaca-container-item-index",a),e(r).attr("data-alpaca-container-item-name",n.name)}}},onDependentReveal:function(){for(var e=0;e<this.children.length;e++)this.children[e].onDependentReveal()},onDependentConceal:function(){for(var e=0;e<this.children.length;e++)this.children[e].onDependentConceal()},focus:function(){this.base();for(var e=-1,t=0;t<this.children.length;t++)if(!this.children[t].isValid(!0)){e=t;break}-1===e&&this.children.length>0&&(e=0),e>-1&&this.children[e].focus()},disable:function(){this.base();for(var e=0;e<this.children.length;e++)this.children[e].disable()},enable:function(){this.base();for(var e=0;e<this.children.length;e++)this.children[e].enable()},getSchemaOfOptions:function(){return t.merge(this.base(),{properties:{lazyLoading:{title:"Lazy Loading",description:"Child fields will only be rendered when the fieldset is expanded if this option is set true.",type:"boolean","default":!1},collapsible:{title:"Collapsible",description:"Field set is collapsible if true.",type:"boolean","default":!0},collapsed:{title:"Collapsed",description:"Field set is initially collapsed if true.",type:"boolean","default":!1},legendStyle:{title:"Legend Style",description:"Field set legend style.",type:"string","enum":["button","link"],"default":"button"},animate:{title:"Animate movements and transitions",description:"Up and down transitions will be animated",type:"boolean","default":!0}}})},getOptionsForOptions:function(){return t.merge(this.base(),{fields:{lazyLoading:{rightLabel:"Lazy loading child fields ?",helper:"Lazy loading will be enabled if checked.",type:"checkbox"},collapsible:{rightLabel:"Field set collapsible ?",helper:"Field set is collapsible if checked.",type:"checkbox"},collapsed:{rightLabel:"Field set initially collapsed ?",description:"Field set is initially collapsed if checked.",type:"checkbox"},legendStyle:{type:"select"},animate:{rightLabel:"Animate movements and transitions",type:"checkbox"}}})}})}(jQuery),function(e){var t=e.alpaca;t.Connector=Base.extend({constructor:function(e){this.id=e,this.isUri=function(e){return!t.isEmpty(e)&&t.isUri(e)};var a=36e5;this.cache=new i("URL",!0,a)},connect:function(e){e&&t.isFunction(e)&&e()},loadTemplate:function(e,i,a){t.isEmpty(e)?a({message:"Empty data source.",reason:"TEMPLATE_LOADING_ERROR"}):t.isUri(e)?this.loadUri(e,!1,function(e){i&&t.isFunction(i)&&i(e)},function(e){a&&t.isFunction(a)&&a(e)}):i(e)},loadData:function(e,t,i){return this._handleLoadJsonResource(e,t,i)},loadSchema:function(e,t,i){return this._handleLoadJsonResource(e,t,i)},loadOptions:function(e,t,i){return this._handleLoadJsonResource(e,t,i)},loadView:function(e,t,i){return this._handleLoadJsonResource(e,t,i)},loadAll:function(e,i,a){var n=e.dataSource,r=e.schemaSource,s=e.optionsSource,o=e.viewSource;r||(r=e.schema),s||(s=e.options),o||(o=e.view);var l={},c=0,d=0,p=function(){c===d&&i&&t.isFunction(i)&&i(l.data,l.options,l.schema,l.view)},u=function(e){a&&t.isFunction(a)&&a(e)};return n&&d++,r&&d++,s&&d++,o&&d++,0===d?void p():(n&&this.loadData(n,function(e){l.data=e,c++,p()},u),r&&this.loadSchema(r,function(e){l.schema=e,c++,p()},u),s&&this.loadOptions(s,function(e){l.options=e,c++,p()},u),void(o&&this.loadView(o,function(e){l.view=e,c++,p()},u)))},loadJson:function(e,t,i){this.loadUri(e,!0,t,i)},loadUri:function(i,a,n,r){var s=this,o={url:i,type:"get",success:function(e){s.cache.put(i,e),n&&t.isFunction(n)&&n(e)},error:function(e,a,n){r&&t.isFunction(r)&&r({message:"Unable to load data from uri : "+i,stage:"DATA_LOADING_ERROR",details:{jqXHR:e,textStatus:a,errorThrown:n}})}};o.dataType=a?"json":"text";var l=s.cache.get(i);l!==!1&&n&&t.isFunction(n)?n(l):e.ajax(o)},loadReferenceSchema:function(e,t,i){return this._handleLoadJsonResource(e,t,i)},loadReferenceOptions:function(e,t,i){return this._handleLoadJsonResource(e,t,i)},_handleLoadJsonResource:function(e,t,i){this.isUri(e)?this.loadJson(e,function(e){t(e)},i):t(e)}}),t.registerConnectorClass("default",t.Connector);var i=function(e,t,i){switch(this.on=t?!0:!1,null!=i&&(this.defaultLifetime=i),this.type=e,this.type){case"URL":this.put=this.put_url;break;case"GET":this.put=this.put_GET}};i.prototype.on=!1,i.prototype.type=void 0,i.prototype.defaultLifetime=18e5,i.prototype.items={},i.prototype.put_url=function(e,t,i){null==i&&(i=this.defaultLifetime);var a=this.make_key(e);return this.items[a]={},this.items[a].key=a,this.items[a].url=e,this.items[a].response=t,this.items[a].expire=(new Date).getTime()+i,!0},i.prototype.put_GET=function(e,t,i,a){null==a&&(a=this.defaultLifetime);var n=this.make_key(e,[t]);return this.items[n]={},this.items[n].key=n,this.items[n].url=e,this.items[n].data=t,this.items[n].response=i,this.items[n].expire=(new Date).getTime()+a,!0},i.prototype.get=function(e,t){var i=this.make_key(e,t);return null==this.items[i]?!1:this.items[i].expire<(new Date).getTime()?!1:this.items[i].response},i.prototype.make_key=function(e,t){var i=e;switch(this.type){case"URL":break;case"GET":i+=this.stringify(t[0])}return i},i.prototype.flush=function(){return cache.items={},!0},i.prototype.stringify=function(e,t,i){var a;if(gap="",indent="","number"==typeof i)for(a=0;i>a;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<n.source.length;l++){var c=n.source[l];"string"==typeof c&&(c={value:c}),o.push(c)}s.local=o}n.local&&(s.local=n.local)}"prefetch"===n.type&&(s.prefetch={url:n.source},n.filter&&(s.prefetch.filter=n.filter)),"remote"===n.type&&(s.remote={url:n.source},n.filter&&(s.remote.filter=n.filter),n.replace&&(s.remote.replace=n.replace));var d=new Bloodhound(s);d.initialize(),n.source=d.ttAdapter()}if(n.templates)for(var p in n.templates){var u=n.templates[p];"string"==typeof u&&(n.templates[p]=Handlebars.compile(u))}e(i.control).typeahead(a,n),e(i.control).on("typeahead:autocompleted",function(e,t){i.setValue(t.value)}),e(i.control).on("typeahead:selected",function(e,t){i.setValue(t.value)}),r&&(r.autocompleted&&e(i.control).on("typeahead:autocompleted",function(e,t){r.autocompleted(e,t)}),r.selected&&e(i.control).on("typeahead:selected",function(e,t){r.selected(e,t)}));var h=e(i.control);e(i.control).change(function(){var t=e(this).val(),i=e(h).typeahead("val");i!==t&&e(h).typeahead("val",i)})}},prepareControlModel:function(e){var t=this;this.base(function(i){i.inputType=t.inputType,e(i)})},updateMaxLengthIndicator:function(){var i=this,a=e(i.field).find(".alpaca-field-text-max-length-indicator");0===a.length&&(a=e("<p class='alpaca-field-text-max-length-indicator'></p>"),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.length<this.schema.minLength)return!1}return!0},_validateMaxLength:function(){if(!t.isEmpty(this.schema.maxLength)){var e=this.getValue();if(""===e&&this.options.allowOptionalEmpty&&!this.isRequired())return!0;if(t.isEmpty(e)&&(e=""),e.length>this.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"}}})
  6 +},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;n<a.length;n++)a[n]=e.trim(a[n])}for(var r in a)e(i.getFieldEl()).find("input:checkbox[data-checkbox-value='"+a[r]+"']").prop("checked",!0)}t()})},getValue:function(){var i=this,a=null;if(i.options.multiple){for(var n=[],r=0;r<i.checkboxOptions.length;r++){var s=e(i.getFieldEl()).find("input[data-checkbox-index='"+r+"']");if(t.checked(s)){var o=e(s).attr("data-checkbox-value");n.push(o)}}"array"===i.schema.type?a=n:"string"===i.schema.type&&(a=n.join(","))}else{var l=e(i.getFieldEl()).find("input");a=l.length>0?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;r<n.length;r++)n[r]=t.trim(n[r]);for(var s=0;s<n.length;s++){var o=e(a.getFieldEl()).find("input[data-checkbox-value='"+n[s]+"']");o.length>0&&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;n<e.length;n++)a.readAsDataURL(e[n])}},getTitle:function(){return"File Field"},getDescription:function(){return"Field for uploading files."},getSchemaOfOptions:function(){return t.merge(this.base(),{properties:{selectionHandler:{title:"Selection Handler",description:"Function that should be called when files are selected. Requires HTML5.",type:"boolean","default":!1}}})},getOptionsForOptions:function(){return t.merge(this.base(),{fields:{selectionHandler:{type:"checkbox"}}})}}),t.registerFieldClass("file",t.Fields.FileField)}(jQuery),function(e){var t=e.alpaca;t.Fields.ListField=t.ControlField.extend({setup:function(){var i=this;i.base(),i.selectOptions=[],i.getEnum()&&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.selectOptions.push({value:a,text:n})}),i.isRequired()&&!i.data&&i.options.removeDefaultNone===!0&&i.schema.enum&&i.schema.enum.length>0&&(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;e<n.selectOptions.length;e++)n.schema.enum.push(n.selectOptions[e].value),n.options.optionLabels.push(n.selectOptions[e].text);i.selectOptions=n.selectOptions,a()};if(t.isFunction(n.options.dataSource))n.options.dataSource.call(n,function(e){if(t.isArray(e)){for(var i=0;i<e.length;i++)"string"==typeof e[i]?n.selectOptions.push({text:e[i],value:e[i]}):t.isObject(e[i])&&n.selectOptions.push(e[i]);r()}else if(t.isObject(e)){for(var a in e)n.selectOptions.push({text:a,value:e[a]});r()}else r()});else if(t.isUri(n.options.dataSource))e.ajax({url:n.options.dataSource,type:"get",dataType:"json",success:function(i){var a=i;n.options.dsTransformer&&t.isFunction(n.options.dsTransformer)&&(a=n.options.dsTransformer(a)),a&&(t.isObject(a)?(e.each(a,function(e,t){n.selectOptions.push({value:e,text:t})}),r()):t.isArray(a)&&(e.each(a,function(e,t){n.selectOptions.push({value:t.value,text:t.text})}),r()))},error:function(e,t,i){n.errorCallback({message:"Unable to load data from uri : "+_this.options.dataSource,stage:"DATASOURCE_LOADING_ERROR",details:{jqXHR:e,textStatus:t,errorThrown:i}})}});else if(t.isArray(n.options.dataSource)){for(var s=0;s<n.options.dataSource.length;s++)"string"==typeof n.options.dataSource[s]?n.selectOptions.push({text:n.options.dataSource[s],value:n.options.dataSource[s]}):t.isObject(n.options.dataSource[s])&&n.selectOptions.push(n.options.dataSource[s]);r()}else a()}else a()})},getSchemaOfSchema:function(){return t.merge(this.base(),{properties:{"enum":{title:"Enumeration",description:"List of field value options",type:"array",required:!0}}})},getSchemaOfOptions:function(){return t.merge(this.base(),{properties:{optionLabels:{title:"Option Labels",description:"Labels for options. It can either be a map object or an array field that maps labels to items defined by enum schema property one by one.",type:"array"},dataSource:{title:"Option Datasource",description:"Datasource for generating list of options. This can be a string or a function. If a string, it is considered to be a URI to a service that produces a object containing key/value pairs or an array of elements of structure {'text': '', 'value': ''}. This can also be a function that is called to produce the same list.",type:"string"},removeDefaultNone:{title:"Remove Default None",description:"If true, the default 'None' option will not be shown.",type:"boolean","default":!1},noneLabel:{title:"None Label",description:"The label to use for the 'None' option in a list (select, radio or otherwise).",type:"string","default":"None"},hideNone:{title:"Hide None",description:"Whether to hide the None option from a list (select, radio or otherwise). This will be true if the field is required and false otherwise.",type:"boolean","default":!1}}})},getOptionsForOptions:function(){return t.merge(this.base(),{fields:{optionLabels:{itemLabel:"Label",type:"array"},dataSource:{type:"text"},removeDefaultNone:{type:"checkbox",rightLabel:"Remove Default None"},noneLabel:{type:"text"},hideNone:{type:"checkbox",rightLabel:"Hide the 'None' option from the list"}}})}})}(jQuery),function(e){var t=e.alpaca;t.Fields.RadioField=t.Fields.ListField.extend({getFieldType:function(){return"radio"},setup:function(){this.base(),this.options.name?this.name=this.options.name:this.name||(this.name=this.getId()+"-name"),t.isUndefined(this.options.emptySelectFirst)&&(this.options.emptySelectFirst=!1)},getValue:function(){var t=this,i=null;return e(this.control).find(":checked").each(function(){i=e(this).val(),i=t.ensureProperType(i)}),i},setValue:function(i){var a=this;e(this.control).find("input").each(function(){t.checked(e(this),null)}),"undefined"!=typeof i&&t.checked(e(a.control).find("input[value='"+i+"']"),"checked"),this.options.emptySelectFirst&&0===e(this.control).find("input:checked").length&&t.checked(e(a.control).find("input:radio").first(),"checked"),this.base(i)},initControlEvents:function(){var t=this;t.base();var i=e(this.control).find("input");i.focus(function(e){t.suspendBlurFocus||(t.onFocus.call(t,e),t.trigger("focus",e))}),i.blur(function(e){t.suspendBlurFocus||(t.onBlur.call(t,e),t.trigger("blur",e))})},prepareControlModel:function(e){var t=this;this.base(function(i){i.selectOptions=t.selectOptions,i.removeDefaultNone=t.options.removeDefaultNone,e(i)})},afterRenderControl:function(i,a){var n=this;this.base(i,function(){n.options.emptySelectFirst&&n.selectOptions&&n.selectOptions.length>0&&(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).length<this.schema.items.minItems?!1:!0},_validateMaxItems:function(){return this.schema.items&&this.schema.items.maxItems&&e(":selected",this.control).length>this.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(e<this.schema.minimum)return!1;if(!t.isEmpty(this.schema.exclusiveMinimum)&&e==this.schema.minimum&&this.schema.exclusiveMinimum)return!1}return!0},_validateMultipleOf:function(){var e=this.getValue();return!t.isEmpty(this.schema.multipleOf)&&e&&0!==this.schema.multipleOf?!1:!0},getType:function(){return"number"},getSchemaOfSchema:function(){return t.merge(this.base(),{properties:{multipleOf:{title:"Multiple Of",description:"Property value must be a multiple of the multipleOf schema property such that division by this value yields an interger (mod zero).",type:"number"},minimum:{title:"Minimum",description:"Minimum value of the property.",type:"number"},maximum:{title:"Maximum",description:"Maximum value of the property.",type:"number"},exclusiveMinimum:{title:"Exclusive Minimum",description:"Property value can not equal the number defined by the minimum schema property.",type:"boolean","default":!1},exclusiveMaximum:{title:"Exclusive Maximum",description:"Property value can not equal the number defined by the maximum schema property.",type:"boolean","default":!1}}})},getOptionsForSchema:function(){return t.merge(this.base(),{fields:{multipleOf:{title:"Multiple Of",description:"The value must be a integral multiple of the property",type:"number"},minimum:{title:"Minimum",description:"Minimum value of the property",type:"number"},maximum:{title:"Maximum",description:"Maximum value of the property",type:"number"},exclusiveMinimum:{rightLabel:"Exclusive minimum ?",helper:"Field value must be greater than but not equal to this number if checked",type:"checkbox"},exclusiveMaximum:{rightLabel:"Exclusive Maximum ?",helper:"Field value must be less than but not equal to this number if checked",type:"checkbox"}}})},getTitle:function(){return"Number Field"},getDescription:function(){return"Field for float numbers."}}),t.registerMessages({stringValueTooSmall:"The minimum value for this field is {0}",stringValueTooLarge:"The maximum value for this field is {0}",stringValueTooSmallExclusive:"Value of this field must be greater than {0}",stringValueTooLargeExclusive:"Value of this field must be less than {0}",stringDivisibleBy:"The value must be divisible by {0}",stringNotANumber:"This value is not a number.",stringValueNotMultipleOf:"This value is nu"}),t.registerFieldClass("number",t.Fields.NumberField),t.registerDefaultSchemaFieldMapping("number","number")}(jQuery),function(e){var t=e.alpaca;t.Fields.ArrayField=t.ContainerField.extend({getFieldType:function(){return"array"},setup:function(){var i=this;this.base(),this.options.toolbarStyle=t.isEmpty(this.view.toolbarStyle)?"button":this.view.toolbarStyle,this.options.actionbarStyle=t.isEmpty(this.view.actionbarStyle)?"top":this.view.actionbarStyle,this.options.rubyrails=!1,this.parent&&this.parent.options&&this.parent.options.form&&this.parent.options.form.attributes&&(t.isEmpty(this.parent.options.form.attributes.rubyrails)||(this.options.rubyrails=!0)),this.options.items||(this.options.items={});var a=!0;if(t.isEmpty(this.view.toolbarSticky)||(a=this.view.toolbarSticky),t.isEmpty(this.options.toolbarSticky)||(a=this.options.toolbarSticky),t.isEmpty(this.options.items.showMoveUpItemButton)&&(this.options.items.showMoveUpItemButton=!0),t.isEmpty(this.options.items.showMoveDownItemButton)&&(this.options.items.showMoveDownItemButton=!0),this.options.toolbarSticky=a,this.schema.items&&this.schema.uniqueItems&&t.mergeObject(this.options,{forceRevalidation:!0}),"undefined"==typeof this.data&&(this.data=[]),null==this.data&&(this.data=[]),""==this.data&&(this.data=[]),t.isString(this.data))try{var n=t.parseJSON(this.data);if(!t.isArray(n)&&!t.isObject(n))return void t.logWarn("ArrayField parsed string data but it was not an array: "+this.data);this.data=n}catch(r){this.data=[this.data]}if(!t.isArray(this.data)&&!t.isObject(this.data))return void t.logWarn("ArrayField data is not an array: "+JSON.stringify(this.data,null," "));if(i.toolbar={},i.options.toolbar)for(var s in i.options.toolbar)i.toolbar[s]=i.options.toolbar[s];if(i.toolbar.actions||(i.toolbar.actions=[],i.toolbar.actions.push({label:i.options.items&&i.options.items.addItemLabel?i.options.items.addItemLabel:"Add Item",action:"add",iconClass:i.addIcon,click:function(){i.resolveItemSchemaOptions(function(e,a){var n=t.createEmptyDataInstance(e);i.addItem(0,e,a,n,function(){})})}})),i.actionbar={},i.options.actionbar)for(var o in i.options.actionbar)i.actionbar[o]=i.options.actionbar[o];i.actionbar.actions||(i.actionbar.actions=[],i.actionbar.actions.push({action:"add",iconClass:i.addIcon,click:function(e,a,n){i.resolveItemSchemaOptions(function(e,a){var r=t.createEmptyDataInstance(e);i.addItem(n+1,e,a,r,function(){})})}}),i.actionbar.actions.push({action:"remove",iconClass:i.removeIcon,click:function(e,t,a){i.removeItem(a,function(){})}}),i.actionbar.actions.push({action:"up",iconClass:i.upIcon,click:function(e,t,a){i.moveItem(a,a-1,i.options.animate,function(){})}}),i.actionbar.actions.push({action:"down",iconClass:i.downIcon,click:function(e,t,a){i.moveItem(a,a+1,i.options.animate,function(){})}}));var l=this.data.length,c=e.extend(!0,{},this.data);c.length=l,this.data=Array.prototype.slice.call(c)},setValue:function(e){var i=this;if(e&&t.isArray(e)){var a=0;do if(a<i.children.length){var n=i.children[a];e.length>a?(n.setValue(e[a]),a++):i.removeItem(a)}while(a<i.children.length);a<e.length&&i.resolveItemSchemaOptions(function(n,r){n||t.logDebug("Unable to resolve schema for item: "+a);for(var s=[];a<e.length;){var o=function(e,a){return function(s){i.addItem(e,n,r,a[e],function(){t.nextTick(function(){s()})})}}(a,e[a]);s.push(o),a++}t.series(s,function(){})})}},getValue:function(){if(0!==this.children.length||this.isRequired()){for(var e=[],t=0;t<this.children.length;t++){var i=this.children[t].getValue();"undefined"!=typeof i&&e.push(i)}return e}},createItems:function(e){var i=this,a=[];i.data?i.resolveItemSchemaOptions(function(n,r){for(var s=[],o=0;o<i.data.length;o++){var l=i.data[o],c=function(e,s){return function(o){i.createItem(e,n,r,s,function(e){a.push(e),t.nextTick(function(){o()})})}}(o,l);s.push(c)}t.series(s,function(){e(a)})}):e(a)},createItem:function(i,a,n,r,s){var o=this;if(o._validateEqualMaxItems()){null===n&&o.options&&o.options.fields&&o.options.fields.item&&(n=o.options.fields.item);var l=e("<div></div>");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;s<o.length;s++)o[s].schema&&o[s].schema.id===r&&n++;var d=n>1,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.minItems?!1:!0},_validateMaxItems:function(){return this.schema.items&&this.schema.items.maxItems&&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)
  7 +}: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("<div class='tempMarker1'></div>");l.before(d);var p=e("<div class='tempMarker2'></div>");c.before(p);var u=function(){for(var t=[],n=0;n<s.children.length;n++)t[n]=n===i?s.children[a]:n===a?s.children[i]:s.children[n];s.children=t,d.replaceWith(c),p.replaceWith(l),s.updateChildDOMElements(),e(l).find("[data-alpaca-array-actionbar-item-index='"+i+"']").attr("data-alpaca-array-actionbar-item-index",a),e(c).find("[data-alpaca-array-actionbar-item-index='"+a+"']").attr("data-alpaca-array-actionbar-item-index",i),s.updateToolbars(),s.refreshValidationState(),s.triggerUpdate(),r&&r()};n?t.animatedSwap(l,c,500,function(){u()}):u()}}},getType:function(){return"array"},getTitle:function(){return"Array Field"},getDescription:function(){return"Field for list of items with same data type or structure."},getSchemaOfSchema:function(){var e={properties:{items:{title:"Array Items",description:"Schema for array items.",type:"object",properties:{minItems:{title:"Minimum Items",description:"Minimum number of items.",type:"number"},maxItems:{title:"Maximum Items",description:"Maximum number of items.",type:"number"},uniqueItems:{title:"Items Unique",description:"Item values should be unique if true.",type:"boolean","default":!1}}}}};return this.children&&this.children[0]&&t.merge(e.properties.items.properties,this.children[0].getSchemaOfSchema()),t.merge(this.base(),e)},getOptionsForSchema:function(){return t.merge(this.base(),{fields:{items:{type:"object",fields:{minItems:{type:"integer"},maxItems:{type:"integer"},uniqueItems:{type:"checkbox"}}}}})},getSchemaOfOptions:function(){var e={properties:{toolbarSticky:{title:"Sticky Toolbar",description:"Array item toolbar will be aways on if true.",type:"boolean","default":!1},items:{title:"Array Items",description:"Options for array items.",type:"object",properties:{extraToolbarButtons:{title:"Extra Toolbar buttons",description:"Buttons to be added next to add/remove/up/down, see examples",type:"array","default":void 0},moveUpItemLabel:{title:"Move Up Item Label",description:"The label to use for the toolbar's 'move up' button.",type:"string","default":"Move Up"},moveDownItemLabel:{title:"Move Down Item Label",description:"The label to use for the toolbar's 'move down' button.",type:"string","default":"Move Down"},removeItemLabel:{title:"Remove Item Label",description:"The label to use for the toolbar's 'remove item' button.",type:"string","default":"Remove Item"},addItemLabel:{title:"Add Item Label",description:"The label to use for the toolbar's 'add item' button.",type:"string","default":"Add Item"},showMoveDownItemButton:{title:"Show Move Down Item Button",description:"Whether to show to the 'Move Down' button on the toolbar.",type:"boolean","default":!0},showMoveUpItemButton:{title:"Show Move Up Item Button",description:"Whether to show the 'Move Up' button on the toolbar.",type:"boolean","default":!0}}}}};return this.children&&this.children[0]&&t.merge(e.properties.items.properties,this.children[0].getSchemaOfSchema()),t.merge(this.base(),e)},getOptionsForOptions:function(){return t.merge(this.base(),{fields:{toolbarSticky:{type:"checkbox"},items:{type:"object",fields:{}}}})}}),t.registerMessages({notEnoughItems:"The minimum number of items is {0}",tooManyItems:"The maximum number of items is {0}",valueNotUnique:"Values are not unique",notAnArray:"This value is not an Array"}),t.registerFieldClass("array",t.Fields.ArrayField),t.registerDefaultSchemaFieldMapping("array","array")}(jQuery),function(e){var t=e.alpaca;t.Fields.ObjectField=t.ContainerField.extend({getFieldType:function(){return"object"},setup:function(){if(this.base(),!t.isEmpty(this.data)&&""!==this.data&&!t.isObject(this.data)){if(!t.isString(this.data))return;try{if(this.data=t.parseJSON(this.data),!t.isObject(this.data))return void t.logWarn("ObjectField parsed data but it was not an object: "+JSON.stringify(this.data))}catch(e){return}}},setValue:function(e){if(e||(e={}),t.isObject(e)){var i={};for(var a in this.childrenById){var n=this.childrenById[a].propertyId;i[n]=this.childrenById[a]}var r={};for(var s in e)e.hasOwnProperty(s)&&(r[s]=e[s]);for(var n in r){var o=i[n];o&&(o.setValue(r[n]),delete i[n],delete r[n])}for(var n in i){var o=i[n];o.setValue(null)}}},getValue:function(){if(0===this.children.length&&!this.isRequired())return{};for(var e={},i=0;i<this.children.length;i++){var a=this.children[i].propertyId,n=this.children[i].getValue();if("undefined"!=typeof n&&this.determineAllDependenciesValid(a)){var r=null;"boolean"==typeof n?r=n?!0:!1:t.isArray(n)||t.isObject(n)?r=n:n&&(r=n),null!==r&&(e[a]=r)}}return e},afterRenderContainer:function(e,i){var a=this;this.base(e,function(){if(a.isTopLevel()&&a.view){a.wizardConfigs=a.view.getWizard(),"undefined"!=typeof a.wizardConfigs&&(a.wizardConfigs&&a.wizardConfigs!==!0||(a.wizardConfigs={}));var e=a.view.getLayout().templateDescriptor;a.wizardConfigs&&t.isObject(a.wizardConfigs)&&(!e||a.wizardConfigs.bindings?a.autoWizard():a.wizard())}i()})},createItems:function(e){var i=this,a=[],n={};for(var r in i.data)n[r]=r;var s=i.data;i.schema&&i.schema.properties&&(s=i.schema.properties);var o=function(){var i=[];for(var r in n)i.push(r);i.length>0&&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("<div></div>");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;r<l.length;r++)l[r].schema&&l[r].schema.id===s&&n++;var o=n>1,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;i<this.children.length;i++){var a=this.children[i].propertyId;if(a==e)return i}return-1},addItem:function(t,i,a,n,r,s){var o=this;this.createItem(t,i,a,n,r,function(t){var i=null;if(r&&o.childrenById[r])for(var a=0;a<o.children.length;a++)if(o.children[a].getId()==r){i=a;break}if(o.registerChild(t,null!=i?i+1:null),i){var n=o.getContainerEl().children("[data-alpaca-container-item-index='"+i+"']");n&&n.length>0&&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;i<t.length;i++)s.visits[i]=!0;s.visits[o]=!0;var t=e(a).find("[data-alpaca-wizard-step-index]");e(t).removeClass("disabled"),e(t).removeClass("completed"),e(t).removeClass("active"),e(t).removeClass("visited");for(var i=0;i<t.length;i++)o>i?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<l.length;p++)d.push(function(e){return function(t){e.refreshValidationState(!0,function(){t()})}}(l[p]));t.series(d,function(){for(var e=!0,t=0;t<l.length;t++)e=e&&l[t].isValid(!0);var n=s.buttons[a];n&&n.validate?n.validate.call(i,function(t){e=e&&t,r(e)}):r(e)})};e(l).click(function(e){if(e.preventDefault(),o>=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('<div data-alpaca-wizard-role="step"></div>'),e(this.field).append(s)):s=e(e(this.field).find("[data-alpaca-wizard-role='step']")[n-1]);for(var o=0;o<r.length;o++)e(s).append(r[o]);n++}}while(r.length>0);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("<div class='tempMarker1'></div>");l.before(d);var p=e("<div class='tempMarker2'></div>");c.before(p);var u=function(){for(var t=[],n=0;n<s.children.length;n++)t[n]=n===i?s.children[a]:n===a?s.children[i]:s.children[n];s.children=t,d.replaceWith(c),p.replaceWith(l),s.updateChildDOMElements(),e(l).find("[data-alpaca-array-actionbar-item-index='"+i+"']").attr("data-alpaca-array-actionbar-item-index",a),e(c).find("[data-alpaca-array-actionbar-item-index='"+a+"']").attr("data-alpaca-array-actionbar-item-index",i),s.refreshValidationState(),s.triggerUpdate(),r&&r()};n?t.animatedSwap(l,c,500,function(){u()}):u()}}},getTitle:function(){return"Object Field"},getDescription:function(){return"Object field for containing other fields"},getSchemaOfSchema:function(){var e={properties:{properties:{title:"Properties",description:"List of child properties.",type:"object"},maxProperties:{type:"number",title:"Maximum Number Properties",description:"The maximum number of properties that this object is allowed to have"},minProperties:{type:"number",title:"Minimum Number of Properties",description:"The minimum number of properties that this object is required to have"}}},i=e.properties.properties;if(i.properties={},this.children)for(var a=0;a<this.children.length;a++){var n=this.children[a].propertyId;i.properties[n]=this.children[a].getSchemaOfSchema(),i.properties[n].title=n+" :: "+i.properties[n].title}return t.merge(this.base(),e)},getSchemaOfOptions:function(){var e=t.merge(this.base(),{properties:{}}),i={properties:{fields:{title:"Field Options",description:"List of options for child fields.",type:"object"}}},a=i.properties.fields;if(a.properties={},this.children)for(var n=0;n<this.children.length;n++){var r=this.children[n].propertyId;a.properties[r]=this.children[n].getSchemaOfOptions(),a.properties[r].title=r+" :: "+a.properties[r].title}return t.merge(e,i)}}),t.registerMessages({tooManyProperties:"The maximum number of properties ({0}) has been exceeded.",tooFewProperties:"There are not enough properties ({0} are required)"}),t.registerFieldClass("object",t.Fields.ObjectField),t.registerDefaultSchemaFieldMapping("object","object")}(jQuery),function(e){var t=e.alpaca;t.Fields.AnyField=t.ControlField.extend({getFieldType:function(){return"any"},setup:function(){this.base()},getValue:function(){return this._getControlVal(!0)},setValue:function(e){this.control.val(t.isEmpty(e)?"":e),this.base(e)},disable:function(){this.control.disabled=!0},enable:function(){this.control.disabled=!1},focus:function(){this.control.focus()},getType:function(){return"any"},getTitle:function(){return"Any Field"},getDescription:function(){return"Any field."},getSchemaOfSchema:function(){return t.merge(this.base(),{properties:{}})},getOptionsForSchema:function(){return t.merge(this.base(),{fields:{}})},getSchemaOfOptions:function(){return t.merge(this.base(),{properties:{}})},getOptionsForOptions:function(){return t.merge(this.base(),{fields:{}})}}),t.registerFieldClass("any",t.Fields.AnyField),t.registerDefaultSchemaFieldMapping("any","any")}(jQuery),function(e){var t=e.alpaca;t.Fields.HiddenField=t.ControlField.extend({getFieldType:function(){return"hidden"},setup:function(){this.base()},getValue:function(){return this._getControlVal(!0)},setValue:function(e){this.getControlEl().val(t.isEmpty(e)?"":e),this.base(e)},getType:function(){return"string"},getTitle:function(){return"Hidden"},getDescription:function(){return"Field for a hidden HTML input"}}),t.registerFieldClass("hidden",t.Fields.HiddenField)}(jQuery),function(e){var t=e.alpaca;t.Fields.AddressField=t.Fields.ObjectField.extend({getFieldType:function(){return"address"},setup:function(){this.base(),void 0===this.data&&(this.data={street:["",""]}),this.schema={title:"Home Address",type:"object",properties:{street:{title:"Street",type:"array",items:{type:"string",maxLength:30,minItems:0,maxItems:3}},city:{title:"City",type:"string"},state:{title:"State",type:"string","enum":["AL","AK","AS","AZ","AR","CA","CO","CT","DE","DC","FM","FL","GA","GU","HI","ID","IL","IN","IA","KS","KY","LA","ME","MH","MD","MA","MI","MN","MS","MO","MT","NE","NV","NH","NJ","NM","NY","NC","ND","MP","OH","OK","OR","PW","PA","PR","RI","SC","SD","TN","TX","UT","VT","VI","VA","WA","WV","WI","WY"]},zip:{title:"Zip Code",type:"string",pattern:/^(\d{5}(-\d{4})?)?$/}}},t.merge(this.options,{fields:{zip:{maskString:"99999",size:5},state:{optionLabels:["ALABAMA","ALASKA","AMERICANSAMOA","ARIZONA","ARKANSAS","CALIFORNIA","COLORADO","CONNECTICUT","DELAWARE","DISTRICTOFCOLUMBIA","FEDERATEDSTATESOFMICRONESIA","FLORIDA","GEORGIA","GUAM","HAWAII","IDAHO","ILLINOIS","INDIANA","IOWA","KANSAS","KENTUCKY","LOUISIANA","MAINE","MARSHALLISLANDS","MARYLAND","MASSACHUSETTS","MICHIGAN","MINNESOTA","MISSISSIPPI","MISSOURI","MONTANA","NEBRASKA","NEVADA","NEWHAMPSHIRE","NEWJERSEY","NEWMEXICO","NEWYORK","NORTHCAROLINA","NORTHDAKOTA","NORTHERNMARIANAISLANDS","OHIO","OKLAHOMA","OREGON","PALAU","PENNSYLVANIA","PUERTORICO","RHODEISLAND","SOUTHCAROLINA","SOUTHDAKOTA","TENNESSEE","TEXAS","UTAH","VERMONT","VIRGINISLANDS","VIRGINIA","WASHINGTON","WESTVIRGINIA","WISCONSIN","WYOMING"]}}}),t.isEmpty(this.options.addressValidation)&&(this.options.addressValidation=!0)},isContainer:function(){return!1},getAddress:function(){var t=this.getValue();"view"===this.view.type&&(t=this.data);var i="";return t&&(t.street&&e.each(t.street,function(e,t){i+=t+" "}),t.city&&(i+=t.city+" "),t.state&&(i+=t.state+" "),t.zip&&(i+=t.zip)),i},afterRenderContainer:function(t,i){var a=this;this.base(t,function(){var t=a.getContainerEl();if(e(t).addClass("alpaca-addressfield"),a.options.addressValidation&&!a.isDisplayOnly()){e('<div style="clear:both;"></div>').appendTo(t);var n=e('<div class="alpaca-form-button">Show Google Map</div>').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("<div id='"+n+"' class='alpaca-field-address-mapcanvas'></div>").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("<small/>"),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;o<a.length;o++)r.push(isNaN(a[o])?a[o]:s[l++]||0);return r.join("")}return n}return a},getTitle:function(){return"Currency Field"},getDescription:function(){return"Provides an automatically formatted and configurable input for entering currency amounts."},getSchemaOfPriceFormatOptions:function(){return{properties:{allowNegative:{title:"Allow Negative",description:"Determines if negative numbers are allowed.",type:"boolean","default":!1},centsLimit:{title:"Cents Limit",description:"The limit of fractional digits.",type:"number","default":2,minimum:0},centsSeparator:{title:"Cents Separator",description:"The separator between whole and fractional amounts.",type:"text","default":"."},clearPrefix:{title:"Clear Prefix",description:"Determines if the prefix is cleared on blur.",type:"boolean","default":!1},clearSuffix:{title:"Clear Suffix",description:"Determines if the suffix is cleared on blur.",type:"boolean","default":!1},insertPlusSign:{title:"Plus Sign",description:"Determines if a plus sign should be inserted for positive values.",type:"boolean","default":!1},limit:{title:"Limit",description:"A limit of the length of the field.",type:"number","default":void 0,minimum:0},prefix:{title:"Prefix",description:"The prefix if any for the field.",type:"text","default":"$"},round:{title:"Round",description:"Determines if the field is rounded. (Rounding is done when getValue is called and is not reflected in the UI)",type:"string","enum":["up","down","nearest","none"],"default":"none"},suffix:{title:"Suffix",description:"The suffix if any for the field.",type:"text","default":""},thousandsSeparator:{title:"Thousands Separator",description:"The separator between thousands.",type:"string","default":","},unmask:{title:"Unmask",description:"If true then the resulting value for this field will be unmasked. That is, the resulting value will be a float instead of a string (with the prefix, suffix, etc. removed).",type:"boolean","default":!0}}}},getSchemaOfOptions:function(){return i.merge(this.base(),this.getSchemaOfPriceFormatOptions())},getOptionsForOptions:function(){return i.merge(this.base(),{fields:{allowNegative:{type:"checkbox"},centsLimit:{type:"number"},centsSeparator:{type:"text"},clearPrefix:{type:"checkbox"},clearSuffix:{type:"checkbox"},insertPlusSign:{type:"checkbox"},limit:{type:"number"},prefix:{type:"text"},round:{type:"select"},suffix:{type:"text"},thousandsSeparator:{type:"string"},unmask:{type:"checkbox"}}})
  8 +}}),i.registerFieldClass("currency",i.Fields.CurrencyField)}(jQuery),function(e){var t=e.alpaca;t.Fields.DateField=t.Fields.TextField.extend({getFieldType:function(){return"date"},setup:function(){var e=this;this.base(),e.options.picker||(e.options.picker={}),e.options.picker.pickDate=!0,e.options.picker.pickTime=!1,e.options.picker.useCurrent=!1},afterRenderControl:function(t,i){var a=this;this.base(t,function(){"display"!==a.view.type&&e.fn.datetimepicker&&(a.getControlEl().datetimepicker(a.options.picker),a.picker=a.getControlEl().data("DateTimePicker"),a.picker&&a.options.dateFormat&&(a.picker.format=a.options.dateFormat),a.picker&&(a.options.dateFormat=a.picker.format)),i()})},getDate:function(){try{return this.getControlEl().datetimepicker("getDate")}catch(e){return this.getValue()}},onChange:function(){this.base(),this.refreshValidationState()},isAutoFocusable:function(){return!1},handleValidate:function(){var e=this.base(),i=this.validation,a=this._validateDateFormat();return i.invalidDate={message:a?"":t.substituteTokens(this.view.getMessage("invalidDate"),[this.options.dateFormat]),status:a},e&&i.invalidDate.status},_validateDateFormat:function(){var e=this;if(e.options.dateFormat){var t=this.getControlEl().val();return t||e.isRequired()?moment(t,e.options.dateFormat,!0).isValid():!0}return!0},setValue:function(e){this.base(e),this.picker&&this.picker.setValue(e)},getValue:function(){var e=this.base();return this.picker&&this.picker.getDate()&&(e=this.picker.getDate()._i),e},destroy:function(){this.base(),this.picker=null},getTitle:function(){return"Date Field"},getDescription:function(){return"Date Field"},getSchemaOfSchema:function(){return t.merge(this.base(),{properties:{format:{title:"Format",description:"Property data format",type:"string","default":"date","enum":["date"],readonly:!0}}})},getOptionsForSchema:function(){return t.merge(this.base(),{fields:{format:{type:"text"}}})},getSchemaOfOptions:function(){return t.merge(this.base(),{properties:{dateFormat:{title:"Date Format",description:"Date format",type:"string"},picker:{title:"DatetimePicker options",description:"Options that are supported by the <a href='http://eonasdan.github.io/bootstrap-datetimepicker/'>Bootstrap DateTime Picker</a>.",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 <a href='http://trentrichardson.com/examples/timepicker/'>jQuery timepicker addon</a>."},getSchemaOfOptions:function(){return t.merge(this.base(),{properties:{picker:{title:"DatetimePicker options",description:"Options that are supported by the <a href='http://eonasdan.github.io/bootstrap-datetimepicker/'>Bootstrap DateTime Picker</a>.",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.data.length;l++){var c=[];for(var d in a.data[l])c.push(a.data[l][d]);t.push(c)}var p=e(a.container).find(".alpaca-container-grid-holder"),u=a.options.grid;u.data=t,e(p).handsontable(u),i()})},getType:function(){return"array"},getTitle:function(){return"Grid Field"},getDescription:function(){return"Renders array items into a grid"}}),t.registerFieldClass("grid",t.Fields.GridField)}(jQuery),function(e){var t=e.alpaca;t.Fields.ImageField=t.Fields.TextField.extend({getFieldType:function(){return"image"},getTitle:function(){return"Image Field"},getDescription:function(){return"Image Field."}}),t.registerFieldClass("image",t.Fields.ImageField)}(jQuery),function(e){var t=e.alpaca;t.Fields.IntegerField=t.Fields.NumberField.extend({getFieldType:function(){return"integer"},getValue:function(){var e=this.base();return"undefined"==typeof e||""==e?e:parseInt(e,10)},onChange:function(){this.base(),this.slider&&this.slider.slider("value",this.getValue())},postRender:function(i){var a=this;this.base(function(){a.options.slider&&(t.isEmpty(a.schema.maximum)||t.isEmpty(a.schema.minimum)||a.control&&(a.control.after('<div id="slider"></div>'),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;t<this.children.length;t++){var i=this.children[t].getValue(),a=i._key;a&&(delete i._key,e[a]=i)}return e}},handleValidate:function(){var e=this.base(),t=this.validation,i=this._validateMapKeysNotEmpty();t.keyMissing={message:i?"":this.view.getMessage("keyMissing"),status:i};var a=this._validateMapKeysUnique();return t.keyNotUnique={message:a?"":this.view.getMessage("keyNotUnique"),status:a},e&&t.keyMissing.status&&t.keyNotUnique.status},_validateMapKeysNotEmpty:function(){for(var e=!0,t=0;t<this.children.length;t++){var i=this.children[t].getValue(),a=i._key;if(!a){e=!1;break}}return e},_validateMapKeysUnique:function(){for(var e=!0,t={},i=0;i<this.children.length;i++){var a=this.children[i].getValue(),n=a._key;t[n]&&(e=!1),t[n]=n}return e},getTitle:function(){return"Map Field"},getDescription:function(){return"Field for objects with key/value pairs that share the same schema for values."}}),t.registerFieldClass("map",t.Fields.MapField),t.registerMessages({keyNotUnique:"Keys of map field are not unique.",keyMissing:"Map contains an empty key."})}(jQuery),function(e){var t=e.alpaca;t.Fields.PasswordField=t.Fields.TextField.extend({getFieldType:function(){return"password"},setup:function(){this.base(),this.schema.pattern||(this.schema.pattern=t.regexps.password)},handleValidate:function(){var e=this.base(),t=this.validation;return t.invalidPattern.status||(t.invalidPattern.message=this.view.getMessage("invalidPassword")),e},getTitle:function(){return"Password Field"},getDescription:function(){return"Password Field."},getSchemaOfSchema:function(){var e=this.schema&&this.schema.pattern?this.schema.pattern:/^[0-9a-zA-Z\x20-\x7E]*$/;return t.merge(this.base(),{properties:{pattern:{title:"Pattern",description:"Field Pattern in Regular Expression",type:"string","default":this.schema.pattern,"enum":[e],readonly:!0},format:{title:"Format",description:"Property data format",type:"string","default":"password","enum":["password"],readonly:!0}}})},getOptionsForSchema:function(){return t.merge(this.base(),{fields:{format:{type:"text"}}})}}),t.registerMessages({invalidPassword:"Invalid Password"}),t.registerFieldClass("password",t.Fields.PasswordField),t.registerDefaultFormatFieldMapping("password","password")}(jQuery),function(e){var t=e.alpaca;t.Fields.PersonalNameField=t.Fields.TextField.extend({getFieldType:function(){return"personalname"},setValue:function(e){for(var t="",i=0;i<e.length;i++)t+=0===i?e.charAt(i).toUpperCase():" "===e.charAt(i-1)||"-"===e.charAt(i-1)||"'"===e.charAt(i-1)?e.charAt(i).toUpperCase():e.charAt(i);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"Personal Name"},getDescription:function(){return"Text Field for personal name with captical letter for first letter & after hyphen, space or apostrophe."}}),t.registerFieldClass("personalname",t.Fields.PersonalNameField)}(jQuery),function(e){var t=e.alpaca;t.Fields.PhoneField=t.Fields.TextField.extend({setup:function(){this.inputType="tel",this.base(),this.schema.pattern||(this.schema.pattern=t.regexps.phone),t.isEmpty(this.options.maskString)&&(this.options.maskString="(999) 999-9999")},postRender:function(e){this.base(function(){e()})},handleValidate:function(){var e=this.base(),t=this.validation;return t.invalidPattern.status||(t.invalidPattern.message=this.view.getMessage("invalidPhone")),e},getFieldType:function(){return"phone"},getTitle:function(){return"Phone Field"},getDescription:function(){return"Phone Field."},getSchemaOfSchema:function(){var e=this.schema&&this.schema.pattern?this.schema.pattern:t.regexps.phone;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":"phone","enum":["phone"],readonly:!0}}})},getOptionsForSchema:function(){return t.merge(this.base(),{fields:{format:{type:"text"}}})},getSchemaOfOptions:function(){return t.merge(this.base(),{properties:{maskString:{title:"Field Mask String",description:"Expression for field mask",type:"string","default":"(999) 999-9999"}}})}}),t.registerMessages({invalidPhone:"Invalid Phone Number, e.g. (123) 456-9999"}),t.registerFieldClass("phone",t.Fields.PhoneField),t.registerDefaultFormatFieldMapping("phone","phone")}(jQuery),function(e){var t=e.alpaca;t.Fields.SearchField=t.Fields.TextField.extend({setup:function(){this.inputType="search",this.base(),this.options.attributes.results=5},getFieldType:function(){return"search"},getType:function(){return"string"},getTitle:function(){return"Search Field"},getDescription:function(){return"A search box field"}}),t.registerFieldClass("search",t.Fields.SearchField),t.registerDefaultSchemaFieldMapping("search","search")}(jQuery),function(e){var t=e.alpaca;t.Fields.StateField=t.Fields.SelectField.extend({getFieldType:function(){return"state"},setup:function(){t.isUndefined(this.options.capitalize)&&(this.options.capitalize=!1),t.isUndefined(this.options.includeStates)&&(this.options.includeStates=!0),t.isUndefined(this.options.includeTerritories)&&(this.options.includeTerritories=!0),t.isUndefined(this.options.format)&&(this.options.format="name"),"name"===this.options.format||"code"===this.options.format||(t.logError("The configured state format: "+this.options.format+" is not a legal value [name, code]"),this.options.format="name");var e=t.retrieveUSHoldings(this.options.includeStates,this.options.includeTerritories,"code"===this.options.format,this.options.capitalize);this.schema["enum"]=e.keys,this.options.optionLabels=e.values,this.base()},getTitle:function(){return"State Field"},getDescription:function(){return"Provides a dropdown selector of states and/or territories in the United States, keyed by their two-character code."},getSchemaOfOptions:function(){return t.merge(this.base(),{properties:{format:{title:"Format",description:"How to represent the state values in the selector",type:"string","default":"name","enum":["name","code"],readonly:!0},capitalize:{title:"Capitalize",description:"Whether the values should be capitalized",type:"boolean","default":!1,readonly:!0},includeStates:{title:"Include States",description:"Whether to include the states of the United States",type:"boolean","default":!0,readonly:!0},includeTerritories:{title:"Include Territories",description:"Whether to include the territories of the United States",type:"boolean","default":!0,readonly:!0}}})},getOptionsForOptions:function(){return t.merge(this.base(),{fields:{format:{type:"text"},capitalize:{type:"checkbox"},includeStates:{type:"checkbox"},includeTerritories:{type:"checkbox"}}})}}),t.registerFieldClass("state",t.Fields.StateField),t.registerDefaultFormatFieldMapping("state","state"),t.retrieveUSHoldings=function(){var e=[];return e.push({name:"Arkansas",code:"AK",state:!0,territory:!1}),e.push({name:"Alabama",code:"AL",state:!0,territory:!1}),e.push({name:"American Samoa",code:"AS",state:!1,territory:!0}),e.push({name:"Arizona",code:"AR",state:!0,territory:!1}),e.push({name:"California",code:"CA",state:!0,territory:!1}),e.push({name:"Colorado",code:"CO",state:!0,territory:!1}),e.push({name:"Connecticut",code:"CT",state:!0,territory:!1}),e.push({name:"Delaware",code:"DE",state:!0,territory:!1}),e.push({name:"Distict of Columbia",code:"DC",state:!1,territory:!0}),e.push({name:"Federated States of Micronesia",code:"FM",state:!1,territory:!0}),e.push({name:"Florida",code:"FL",state:!0,territory:!1}),e.push({name:"Georgia",code:"GA",state:!0,territory:!1}),e.push({name:"Guam",code:"GU",state:!1,territory:!0}),e.push({name:"Georgia",code:"GA",state:!0,territory:!1}),e.push({name:"Hawaii",code:"HI",state:!0,territory:!1}),e.push({name:"Idaho",code:"ID",state:!0,territory:!1}),e.push({name:"Illinois",code:"IL",state:!0,territory:!1}),e.push({name:"Indiana",code:"IN",state:!0,territory:!1}),e.push({name:"Iowa",code:"IA",state:!0,territory:!1}),e.push({name:"Kansas",code:"KS",state:!0,territory:!1}),e.push({name:"Kentucky",code:"KY",state:!0,territory:!1}),e.push({name:"Louisiana",code:"LA",state:!0,territory:!1}),e.push({name:"Maine",code:"ME",state:!0,territory:!1}),e.push({name:"Marshall Islands",code:"MH",state:!1,territory:!0}),e.push({name:"Maryland",code:"MD",state:!0,territory:!1}),e.push({name:"Massachusetts",code:"MA",state:!0,territory:!1}),e.push({name:"Michigan",code:"MI",state:!0,territory:!1}),e.push({name:"Minnesota",code:"MN",state:!0,territory:!1}),e.push({name:"Mississippi",code:"MS",state:!0,territory:!1}),e.push({name:"Missouri",code:"MO",state:!0,territory:!1}),e.push({name:"Montana",code:"MT",state:!0,territory:!1}),e.push({name:"Nebraska",code:"NE",state:!0,territory:!1}),e.push({name:"Nevada",code:"NV",state:!0,territory:!1}),e.push({name:"New Hampshire",code:"NH",state:!0,territory:!1}),e.push({name:"New Jersey",code:"NJ",state:!0,territory:!1}),e.push({name:"New Mexico",code:"NM",state:!0,territory:!1}),e.push({name:"New York",code:"NY",state:!0,territory:!1}),e.push({name:"North Carolina",code:"NC",state:!0,territory:!1}),e.push({name:"North Dakota",code:"ND",state:!0,territory:!1}),e.push({name:"Northern Mariana Islands",code:"MP",state:!0,territory:!1}),e.push({name:"Ohio",code:"OH",state:!0,territory:!1}),e.push({name:"Oklahoma",code:"OK",state:!0,territory:!1}),e.push({name:"Oregon",code:"OR",state:!0,territory:!1}),e.push({name:"Palau",code:"PW",state:!1,territory:!0}),e.push({name:"Pennsylvania",code:"PA",state:!0,territory:!1}),e.push({name:"Puerto Rico",code:"PR",state:!1,territory:!0}),e.push({name:"Rhode Island",code:"RI",state:!0,territory:!1}),e.push({name:"South Carolina",code:"SC",state:!0,territory:!1}),e.push({name:"South Dakota",code:"SD",state:!0,territory:!1}),e.push({name:"Tennessee",code:"TN",state:!0,territory:!1}),e.push({name:"Texas",code:"TX",state:!0,territory:!1}),e.push({name:"Utah",code:"UT",state:!0,territory:!1}),e.push({name:"Vermont",code:"VT",state:!0,territory:!1}),e.push({name:"Virgin Islands",code:"VI",state:!1,territory:!0}),e.push({name:"Virginia",code:"VA",state:!0,territory:!1}),e.push({name:"Washington",code:"WA",state:!0,territory:!1}),e.push({name:"West Virginia",code:"WV",state:!0,territory:!1}),e.push({name:"Wisconsin",code:"WI",state:!0,territory:!1}),e.push({name:"Wyoming",code:"WY",state:!0,territory:!1}),function(t,i,a,n){for(var r={keys:[],values:[]},s=0;s<e.length;s++){var o=!1;if(e[s].state&&t?o=!0:e[s].territory&&i&&(o=!0),o){var l=e[s].code,c=e[s].name;a&&(c=e[s].code),n&&(c=c.toUpperCase()),r.keys.push(l),r.values.push(c)}}return r}}()}(jQuery),function(e){var t=e.alpaca;t.Fields.TableField=t.Fields.ArrayField.extend({getFieldType:function(){return"table"},afterRenderContainer:function(t,i){var a=this;this.base(t,function(){e(a.container).find("table").dataTable({}),i()})},getType:function(){return"array"},getTitle:function(){return"Table Field"},getDescription:function(){return"Renders array items into a table"}}),t.registerFieldClass("table",t.Fields.TableField)}(jQuery),function(e){var t=e.alpaca;t.Fields.TagField=t.Fields.LowerCaseField.extend({getFieldType:function(){return"tag"},setup:function(){this.base(),this.options.separator||(this.options.separator=",")},getValue:function(){var e=this.base();return""===e?[]:e.split(this.options.separator)},setValue:function(e){return""!==e?e?void this.base(e.join(this.options.separator)):void this.base(""):void 0},onBlur:function(t){this.base(t);var i=this.getValue(),a=[];e.each(i,function(e,t){""!==t.trim()&&a.push(t.trim())}),this.setValue(a)},getTitle:function(){return"Tag Field"},getDescription:function(){return"Text field for entering list of tags separated by delimiter."},getSchemaOfOptions:function(){return t.merge(this.base(),{properties:{separator:{title:"Separator",description:"Separator used to split tags.",type:"string","default":","}}})},getOptionsForOptions:function(){return t.merge(this.base(),{fields:{separator:{type:"text"}}})}}),t.registerFieldClass("tag",t.Fields.TagField)}(jQuery),function(e){var t=e.alpaca;t.REGEX_TIME=/^((0?[1-9]|1[012])(:[0-5]\d){0,2}(\ [AP]M))$|^([01]\d|2[0-3])(:[0-5]\d){0,2}$/,t.Fields.TimeField=t.Fields.TextField.extend({getFieldType:function(){return"time"},setup:function(){var e=this;this.base(),e.options.picker||(e.options.picker={})},afterRenderControl:function(t,i){var a=this;this.base(t,function(){e.fn.timepicker&&a.getControlEl().timepicker(a.options.picker),i()})},onChange:function(){this.base(),this.refreshValidationState()},isAutoFocusable:function(){return!1},handleValidate:function(){var e=this.base(),t=this.validation,i=this._validateTime();return t.invalidTime={message:i?"":this.view.getMessage("invalidTime"),status:i},e&&t.invalidTime.status},_validateTime:function(){var e=this.getControlEl().val();return e||this.isRequired()?t.REGEX_TIME.test(e):!0},setValue:function(t){var i=this;this.base(t),e.fn.timepicker&&i.getControlEl().timepicker("setTime",t)},getTitle:function(){return"Time Field"},getDescription:function(){return"Time Field"
  9 +},getSchemaOfSchema:function(){return t.merge(this.base(),{properties:{format:{title:"Format",description:"Property data format",type:"string","default":"time","enum":["time"],readonly:!0}}})},getOptionsForSchema:function(){return t.merge(this.base(),{fields:{format:{type:"text"}}})},getSchemaOfOptions:function(){return t.merge(this.base(),{properties:{picker:{title:"DatetimePicker options",description:"Options that are supported by the <a href='https://github.com/m3wolf/bootstrap3-timepicker'>Bootstrap Time Picker</a>.",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<n.length;c++){var d={};d.options=l.options,d.file=t.cloneObject(n[c]),d.size=r(d.size),d.buttons=l.options.buttons;var p=t.tmpl(l.view.getTemplateDescriptor(i),d,l);o.push(p[0])}return o=e(o),e(o).each(function(){s.fileupload&&s.fileupload.autoUpload&&e(this).find("button.start").css("display","none"),l.handleWrapRow(this,s),e(this).find("button.delete").on("destroyed",function(){setTimeout(function(){l.refreshUIState(),l.onFileDelete(p),l.triggerWithPropagation("change")},250)})}),e(o)}}},getFieldType:function(){return"upload"},setup:function(){var e=this;this.base(),e.options.buttons||(e.options.buttons=[]),e.options.hideDeleteButton||e.options.buttons.push({key:"delete",isDelete:!0}),"undefined"==typeof e.options.multiple&&(e.options.multiple=!1),"undefined"==typeof e.options.showUploadPreview&&(e.options.showUploadPreview=!0),"undefined"==typeof e.options.showHeaders&&(e.options.showHeaders=!0),e.data||(e.data=[])},afterRenderControl:function(e,t){var i=this;this.base(e,function(){i.handlePostRender(function(){t()})})},getUploadTemplate:function(){return this.wrapTemplate("control-upload-partial-upload")},getDownloadTemplate:function(){return this.wrapTemplate("control-upload-partial-download")},handlePostRender:function(t){var i=this,a=this.control,n={};if(n.dataType="json",n.uploadTemplateId=null,n.uploadTemplate=this.getUploadTemplate(),n.downloadTemplateId=null,n.downloadTemplate=this.getDownloadTemplate(),n.filesContainer=e(a).find(".files"),n.dropZone=e(a).find(".fileupload-active-zone"),n.url="/",n.method="post",n.showUploadPreview=i.options.showUploadPreview,i.options.upload)for(var r in i.options.upload)n[r]=i.options.upload[r];i.options.multiple&&(e(a).find(".alpaca-fileupload-input").attr("multiple",!0),e(a).find(".alpaca-fileupload-input").attr("name",i.name+"_files[]")),e(a).find(".progress").css("display","none"),n.progressall=function(t,i){var n=!1;if(i.loaded<i.total&&(n=!0),n){e(a).find(".progress").css("display","block");var r=parseInt(i.loaded/i.total*100,10);e("#progress .progress-bar").css("width",r+"%")}else e(a).find(".progress").css("display","none")},i.applyConfiguration(n);var s=i.fileUpload=e(a).find(".alpaca-fileupload-input").fileupload(n);s.bindFirst("fileuploaddone",function(e,t){var a=i.options.enhanceFiles;a?a(n,t):i.enhanceFiles(n,t),t.files=t.result.files,setTimeout(function(){i.refreshUIState()},250)}),s.bindFirst("fileuploadsubmit",function(t,a){i.options.properties&&e.each(a.files,function(e,t){for(var n in i.options.properties){var r="property"+e+"__"+n,s=i.options.properties[n];s=i.applyTokenSubstitutions(s,e,t),a.formData||(a.formData={}),a.formData[r]=s}}),i.options.parameters&&e.each(a.files,function(e,t){for(var n in i.options.parameters){var r="param"+e+"__"+n,s=i.options.parameters[n];s=i.applyTokenSubstitutions(s,e,t),a.formData||(a.formData={}),a.formData[r]=s}})}),s.bind("fileuploaddone",function(e,t){var a=i.getValue(),n=function(e){return e==t.files.length?void i.setValue(a):void i.convertFileToDescriptor(t.files[e],function(t,i){i&&a.push(i),n(e+1)})};n(0)}),i.applyBindings(s,a),i.preload(s,a,function(n){if(n){var r=e(i.control).find(".alpaca-fileupload-input");e(r).fileupload("option","done").call(r,e.Event("done"),{result:{files:n}}),i.afterPreload(s,a,n,function(){t()})}else t()}),"undefined"!=typeof document&&e(document).bind("drop dragover",function(e){e.preventDefault()})},handleWrapRow:function(){},applyTokenSubstitutions:function(e,t,i){var a={index:t,name:i.name,size:i.size,url:i.url,thumbnailUrl:i.thumbnailUrl},n=-1,r=0;do if(n=e.indexOf("{",r),n>-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<i.length;a++)if(i[a].id==e){i.splice(a,1);break}t.setValue(i)},applyConfiguration:function(){},applyBindings:function(){},convertFileToDescriptor:function(e,t){var i={id:e.id,name:e.name,size:e.size,url:e.url,thumbnailUrl:e.thumbnailUrl,deleteUrl:e.deleteUrl,deleteType:e.deleteType};t(null,i)},convertDescriptorToFile:function(e,t){var i={id:e.id,name:e.name,size:e.size,url:e.url,thumbnailUrl:e.thumbnailUrl,deleteUrl:e.deleteUrl,deleteType:e.deleteType};t(null,i)},enhanceFiles:function(){},preload:function(e,t,i){var a=this,n=[],r=a.getValue(),s=function(e){return e==r.length?void i(n):void a.convertDescriptorToFile(r[e],function(t,i){i&&n.push(i),s(e+1)})};s(0)},afterPreload:function(e,t,i,a){a()},getValue:function(){return this.data},setValue:function(e){e||(e=[]),this.data=e,this.updateObservable(),this.triggerUpdate()},reload:function(t){var i=this,a=this.getValue(),n=[],r=function(s){if(s===a.length){var o=e(i.control).find(".alpaca-fileupload-input");return e(o).fileupload("option","done").call(o,e.Event("done"),{result:{files:n}}),void t()}i.convertDescriptorToFile(a[s],function(e,t){t&&n.push(t),r(s+1)})};r(0)},plugin:function(){var t=this;return e(t.control).find(".alpaca-fileupload-input").data().blueimpFileupload},refreshUIState:function(){var t=this,i=t.plugin();if(i){var a=99999;t.options.upload&&"undefined"!=typeof t.options.upload.maxNumberOfFiles&&(a=t.options.upload.maxNumberOfFiles),i.options.getNumberOfFiles&&i.options.getNumberOfFiles()>=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;t<r.length;++t){var a=e.trim(r[t]).match(/[^\.]+/i)[0];i(e(this),a,n)}})}var n=e.fn.jquery.split("."),r=parseInt(n[0]),s=parseInt(n[1]),o=1>r||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:"&#27492;&#22495;&#24517;&#39035;",invalid:"&#27492;&#22495;&#19981;&#21512;&#26684;",months:["&#19968;&#26376;","&#20108;&#26376;","&#19977;&#26376;","&#22235;&#26376;","&#20116;&#26376;","&#20845;&#26376;","&#19971;&#26376;","&#20843;&#26376;","&#20061;&#26376;","&#21313;&#26376;","&#21313;&#19968;&#26376;","&#21313;&#20108;&#26376;"],timeUnits:{SECOND:"&#31186;",MINUTE:"&#20998;",HOUR:"&#26102;",DAY:"&#26085;",MONTH:"&#26376;",YEAR:"&#24180;"},notOptional:"&#27492;&#22495;&#38750;&#20219;&#36873;",disallowValue:"&#38750;&#27861;&#36755;&#20837;&#21253;&#25324; {0}.",invalidValueOfEnum:"&#20801;&#35768;&#36755;&#20837;&#21253;&#25324; {0}. [{1}]",notEnoughItems:"&#26368;&#23567;&#20010;&#25968; {0}",tooManyItems:"&#26368;&#22823;&#20010;&#25968; {0}",valueNotUnique:"&#36755;&#20837;&#20540;&#19981;&#29420;&#29305;",notAnArray:"&#19981;&#26159;&#25968;&#32452;",invalidDate:"&#26085;&#26399;&#26684;&#24335;&#22240;&#35813;&#26159; {0}",invalidEmail:"&#20234;&#22969;&#20799;&#26684;&#24335;&#19981;&#23545;, ex: info@cloudcms.com",stringNotAnInteger:"&#19981;&#26159;&#25972;&#25968;.",invalidIPv4:"&#19981;&#26159;&#21512;&#27861;IP&#22320;&#22336;, ex: 192.168.0.1",stringValueTooSmall:"&#26368;&#23567;&#20540;&#26159; {0}",stringValueTooLarge:"&#26368;&#22823;&#20540;&#26159; {0}",stringValueTooSmallExclusive:"&#20540;&#24517;&#39035;&#22823;&#20110; {0}",stringValueTooLargeExclusive:"&#20540;&#24517;&#39035;&#23567;&#20110; {0}",stringDivisibleBy:"&#20540;&#24517;&#39035;&#33021;&#34987; {0} &#25972;&#38500;",stringNotANumber:"&#19981;&#26159;&#25968;&#23383;.",invalidPassword:"&#38750;&#27861;&#23494;&#30721;",invalidPhone:"&#38750;&#27861;&#30005;&#35805;&#21495;&#30721;, ex: (123) 456-9999",invalidPattern:"&#27492;&#22495;&#39035;&#26377;&#26684;&#24335; {0}",stringTooShort:"&#27492;&#22495;&#33267;&#23569;&#38271;&#24230; {0}",stringTooLong:"&#27492;&#22495;&#26368;&#22810;&#38271;&#24230; {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('<span class="alpaca-icon-required ui-icon ui-icon-star"></span>').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("<div></div>");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});
... ...
var/httpd/htdocs/js/thirdparty/alpaca/handlebars.min.js 0 → 100644
... ... @@ -0,0 +1,28 @@
  1 +/*!
  2 +
  3 + handlebars v1.3.0
  4 +
  5 +Copyright (C) 2011 by Yehuda Katz
  6 +
  7 +Permission is hereby granted, free of charge, to any person obtaining a copy
  8 +of this software and associated documentation files (the "Software"), to deal
  9 +in the Software without restriction, including without limitation the rights
  10 +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  11 +copies of the Software, and to permit persons to whom the Software is
  12 +furnished to do so, subject to the following conditions:
  13 +
  14 +The above copyright notice and this permission notice shall be included in
  15 +all copies or substantial portions of the Software.
  16 +
  17 +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  18 +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  19 +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  20 +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  21 +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  22 +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  23 +THE SOFTWARE.
  24 +
  25 +@license
  26 +*/
  27 +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]||"&amp;"}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={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","`":"&#x60;"},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;f<c.length;f++)this[c[f]]=e[c[f]];d&&(this.lineNumber=d,this.column=b.firstColumn)}var b,c=["description","fileName","lineNumber","message","name","number","stack"];return a.prototype=new Error,b=a}(),d=function(a,b){"use strict";function c(a,b){this.helpers=a||{},this.partials=b||{},d(this)}function d(a){a.registerHelper("helperMissing",function(a){if(2===arguments.length)return void 0;throw new h("Missing helper: '"+a+"'")}),a.registerHelper("blockHelperMissing",function(b,c){var d=c.inverse||function(){},e=c.fn;return m(b)&&(b=b.call(this)),b===!0?e(this):b===!1||null==b?d(this):l(b)?b.length>0?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;g<f.length&&(c=this._input.match(this.rules[f[g]]),!c||b&&!(c[0].length>b[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;h<a.args.length;h++)c=a.args[h],"string"==typeof c&&(c='"'+c.replace("\n","\\n")+'"'),b.push(c);e.push(a.opcode+" "+b.join(" "))}return e.join("\n")},equals:function(a){var b=this.opcodes.length;if(a.opcodes.length!==b)return!1;for(var c=0;b>c;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;f<d.args.length;f++)if(d.args[f]!==e.args[f])return!1}if(b=this.children.length,a.children.length!==b)return!1;for(c=0;b>c;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);
  28 +var e,f=a.opcodes;this.i=0;for(var g=f.length;this.i<g;this.i++)e=f[this.i],"DECLARE"===e.opcode?this[e.name]=e.value:this[e.opcode].apply(this,e.args),e.opcode!==this.stripNext&&(this.stripNext=!1);if(this.pushSource(""),this.stackSlot||this.inlineStack.length||this.compileStack.length)throw new i("Compile completed with content left on stack");return this.createFunctionContext(d)},preamble:function(){var a=[];if(this.isChild)a.push("");else{var b=this.namespace,c="helpers = this.merge(helpers, "+b+".helpers);";this.environment.usePartial&&(c=c+" partials = this.merge(partials, "+b+".partials);"),this.options.data&&(c+=" data = data || {};"),a.push(c)}this.environment.isSimple?a.push(""):a.push(", buffer = "+this.initializeBuffer()),this.lastContext=0,this.source=a},createFunctionContext:function(a){var b=this.stackVars.concat(this.registers.list);if(b.length>0&&(this.source[1]=this.source[1]+", "+b.join(", ")),!this.isChild)for(var c in this.context.aliases)this.context.aliases.hasOwnProperty(c)&&(this.source[1]=this.source[1]+", "+c+"="+this.context.aliases[c]);this.source[1]&&(this.source[1]="var "+this.source[1].substring(2)+";"),this.isChild||(this.source[1]+="\n"+this.context.programs.join("\n")+"\n"),this.environment.isSimple||this.pushSource("return buffer;");for(var d=this.isChild?["depth0","data"]:["Handlebars","depth0","helpers","partials","data"],e=0,f=this.environment.depths.list.length;f>e;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}();
0 29 \ No newline at end of file
... ...
var/httpd/htdocs/skins/Customer/default/css/alpaca/alpaca-jqueryui-newticketwizard.css
... ... @@ -40,4 +40,14 @@ address:
40 40 {
41 41 z-index: 100;
42 42 }
  43 +/*
  44 +fieldset div{padding:0px 8px 0px 0;}
43 45  
  46 +.alpaca-controlfield {padding-bottom: 0px}
  47 +
  48 +.alpaca-field {padding-top: 0px}*/
  49 +
  50 +
  51 +.alpaca-controlfield-label {
  52 + width: 280px;
  53 +}
... ...
var/httpd/htdocs/skins/Customer/default/css/alpaca/alpaca-newticketwizard.css
... ... @@ -52,7 +52,7 @@ address:
52 52 */
53 53 .alpaca-controlfield {
54 54 display: block;
55   - padding: 2px;
  55 + padding: 1px;
56 56 margin: 2px;
57 57 vertical-align: middle;
58 58 }
... ... @@ -63,8 +63,8 @@ address:
63 63  
64 64 .alpaca-controlfield-container {
65 65 display: block;
66   - padding-top: 4px;
67   - padding-bottom: 4px;
  66 + padding-top: 1px;
  67 + padding-bottom: 1px;
68 68 }
69 69  
70 70 .alpaca-controlfield-label
... ... @@ -74,7 +74,7 @@ address:
74 74 text-align: right;
75 75 margin-left: 1px;
76 76 float: left;
77   - width: 100px;
  77 + width: 200px;
78 78 padding-top: 0px;
79 79 padding-bottom: 0px;
80 80 vertical-align: middle;
... ... @@ -215,6 +215,10 @@ DIV.alpaca-controlfield-text .twitter-typeahead .tt-dropdown-menu P
215 215 line-height: 16px;
216 216 }
217 217  
  218 +.alpaca-controlfield-helper {
  219 + margin-left: 200px;
  220 +}
  221 +
218 222 /* END styles for Date Field, Phone Field, Password Field and Email Field */
219 223  
220 224 /* BEGIN styles for Address Map Field */
... ... @@ -416,7 +420,7 @@ legend.alpaca-fieldset-legend {
416 420  
417 421 .alpaca-fieldset-helper {
418 422 padding-top: 10px;
419   - padding-bottom: 5px;
  423 + padding-bottom: 0px;
420 424 clear: both;
421 425 }
422 426  
... ... @@ -776,7 +780,7 @@ fieldset.alpaca-view-web-edit-yaml.alpaca-fieldset {
776 780 border-radius: 5px;
777 781 margin: 1px 0 0 0;
778 782 padding-top: 4px;
779   - padding-bottom: 2px;
  783 + padding-bottom: 1px;
780 784 }
781 785  
782 786 /*hide the arrow icon before the fieldset name*/
... ... @@ -924,6 +928,12 @@ fieldset DIV {
924 928 vertical-align: middle !important;
925 929 }
926 930  
  931 +.alpaca-fieldset-item-container {
  932 + padding-bottom: 0px;
  933 + padding-top: 0px;
  934 +
  935 +}
  936 +
927 937  
928 938 /* To Remove up/down buttons on items
929 939  
... ...