var NextGen=NextGen||{};NextGen.AccountComponent=function(){return{Initialize:function(){NextGen.Messaging.Subscribe("User_Changed",NextGen.Logger.errorWrap(function(n){NextGen.UseAllInOneLogin&&NextGen.MustCreateAccount?($("li.account-link a").hide(),$("li.sign-out-link a").hide()):($("li.account-link a").toggle(!!n.name&&n.name!="Anonymous user"),$("li.sign-out-link a").toggle(!!n.name))}));NextGen.Messaging.Subscribe("AccountPopup_BeforeOpen",NextGen.Logger.errorWrap(function(n){if(n.triggeringElement.is("li.account-link a")){var t=NextGen.UserManager.GetLoggedInUser();$('#accountEditPage input[name="AccountEmail"]').val(t.loggedInUserName||"")}}));$("body").on("click","button.account-email-update",NextGen.Logger.errorWrap(function(){var t=$('div[data-form-name="account-email"]'),n=[],i=NextGen.ValidationManager.ValidateWithTemporaryForm(t,null,n,function(n){return n.validate({rules:{AccountEmail:{required:!0,email:!0}}}),n.valid()});i.done(function(){n=[{name:"accountEmail",value:NextGen.Utils.GetFormValue(n,"AccountEmail")},{name:"__RequestVerificationToken",value:NextGen.Utils.GetAntiForgeryToken("antiforgerytoken")}];var t=NextGen.UserManager.UpdateAccountEmail(n);t.done(NextGen.Logger.errorWrap(function(n){NextGen.Alerts.success(NextGen.Localization.Messages.AccountEmailChange.Success(n.accountEmail))}));t.fail(NextGen.Logger.errorWrap(function(n){NextGen.Alerts.danger(n)}));t.always(NextGen.Logger.errorWrap(function(){NextGen.Controls.Lightbox.Close()}))})}));$("body").on("click","button.account-password-reset",NextGen.Logger.errorWrap(function(){var t=$('div[data-form-name="account-password"]'),n=[],i=NextGen.ValidationManager.ValidateWithTemporaryForm(t,null,n);i.done(function(){n=[{name:"accountEmail",value:NextGen.Utils.GetFormValue(n,"AccountEmail")},{name:"__RequestVerificationToken",value:NextGen.Utils.GetAntiForgeryToken("antiforgerytoken")}];var t=NextGen.UserManager.RequestPasswordResetEmail(n);t.done(NextGen.Logger.errorWrap(function(){NextGen.Alerts.success(NextGen.Localization.Messages.AccountPasswordReset.Success())}));t.fail(NextGen.Logger.errorWrap(function(){NextGen.Alerts.danger(NextGen.Localization.Messages.AccountPasswordReset.Failed())}));t.always(NextGen.Logger.errorWrap(function(){NextGen.Controls.Lightbox.Close()}))})}));$("body").on("click","button.do-sign-out",NextGen.Logger.errorWrap(function(){NextGen.UserManager.SignOutUser();NextGen.Controls.Lightbox.Close()}));$("body").on("click","button.cancel-sign-out",NextGen.Logger.errorWrap(function(){NextGen.Controls.Lightbox.Close()}))},WireOpenTrigger:function(n){if(n&&n.length>0){var t={closeOnBgClick:!1,closeBtnInside:!0,callbacks:{beforeOpen:function(){NextGen.Messaging.Publish("AccountPopup_BeforeOpen",{triggeringElement:n})}}};NextGen.Controls.Lightbox.Create(n,t)}}}}();
//# sourceMappingURL=components_d72ad7a23479481d8a4f0e51b567a141.map
var NextGen=NextGen||{};NextGen.CaptchaManager=function(){function n(){return{captchaResponse:$(".g-recaptcha-response").val()}}return{Create:function(n){var t=$(n),i={theme:"white",callback:function(){},custom_translations:NextGen.Localization.Messages.Captcha.CustomTranslations()};if(t.length===0)throw new Error("Cannot create captcha. Container is not a valid DOM element.");NextGen.CaptchaManager.CaptchaContainer=t.get(0);typeof grecaptcha!="undefined"&&typeof grecaptcha.render!="undefined"&&NextGen.CaptchaManager.CaptchaContainer.children.length===0&&grecaptcha.render(NextGen.CaptchaManager.CaptchaContainer,{sitekey:NextGen.PublicKeys.Recaptcha})},Reset:function(){grecaptcha.reset()},GetData:function(){return n()},Validate:function(){var t=$.Deferred(),i=n();return NextGen.Server.Components.Captcha(i).done(function(n){n&&n.valid===!0?t.resolve():t.reject("Incorrect")}).fail(function(n){NextGen.Logger.error(n);t.reject("Error")}),NextGen.CaptchaManager.CaptchaValidatorPromise=t.promise(),NextGen.CaptchaManager.CaptchaValidatorPromise},CaptchaContainer:null,CaptchaValidatorPromise:null}}();
//# sourceMappingURL=components_d72ad7a23479481d8a4f0e51b567a141.map
var NextGen=NextGen||{};NextGen.ComponentController=function(){function a(){return NextGen.Logger.debug("****Reloading all components****"),s(function(){return!0},null,!0)}function d(){$(".waiting-nav").find("button").attr("disabled",!0);$("[data-navigation-watcher]").attr("data-waiting-for-async",!0);$("[data-navigation-watcher]").css("display","inline-block");NextGen.Controls.AjaxLoader.BlockLoading()}function g(){(typeof $("[data-navigation-watcher]").attr("data-waiting-for-summary")=="undefined"||$("[data-navigation-watcher]").attr("data-waiting-for-summary")!=="true")&&(NextGen.Controls.AjaxLoader.IsLongBlock()||($(".waiting-nav").find("button").attr("disabled",!1),$("[data-navigation-watcher]").attr("data-waiting-for-async",!1),$("[data-navigation-watcher]").css("display","none"),NextGen.Controls.AjaxLoader.UnblockLoading()))}function s(n,t,i){var f,s,h,a,c;t=t||{};e=$.Deferred();var o=$.Deferred(),l=$.Deferred(),y=_.filter(NextGen.Components,function(i){return i.IsReloadable===!0&&n(i)===!0&&!t[i.Id]}),r=[],u=[];if($.each(y,function(n,t){r.push(t.Id)}),f=it(r),f&&f.length>0)for(s=0;s<f.length;s++)r.includes(f[s])||r.push(f[s]);h=_.find(NextGen.Components,function(n){return n.Name==="NextGen.Online.Components.Client.Group.GroupComponent"});a=h&&r.includes(h.Id);h&&!a&&r.push(h.Id);r.length>0?(o.promise(),d(),c=tt(r),c.done(function(n){n&&$.each(n,function(n,r){t[n]=r;i&&!u.includes(n)&&u.push(n)});o.resolve()}),c.fail(function(){NextGen.Alerts.danger(NextGen.Localization.Messages.ComponentLoad.Failed());o.reject()})):o.resolve();o.then(function(){function f(){var e,o;if(r>=NextGen.Components.length){l.resolve();return}if(e=NextGen.Components[r],r++,e.IsReloadable===!0&&(o=n(e)===!0,o)){v(e,t[e.Id]).always(f);i&&!u.includes(e.Id)&&u.push(e.Id);return}f()}var r=0;return f(),l.promise().always(function(){if(NextGen.InventoryManager.Init(),e.resolve(),i&&u.length)for(var n=0;n<u.length;n++)NextGen.Logic.Processor.ExecuteComponentLogicIfAny(u[n],!0);g()})})}function nt(n,t){if(t)return NextGen.Logger.debug("Using component contents stored locally."),$.Deferred().resolve(t).promise();NextGen.Logger.debug("Retrieving component contents from server.");var i={componentConfigurationId:n.Id,contactNumber:NextGen.GroupManager.GetCurrentContact().isNewContact?-1:NextGen.GroupManager.GetCurrentContactNumber(),editingExisting:NextGen.EditingExisting};return NextGen.Server.Site.Component(i)}function tt(n){NextGen.Logger.debug("Retrieving components contents from server.");var t=NextGen.InputChangeManager.PushChangesAsync();return t.then(function(){var t={componentConfigurationIds:n,contactNumber:NextGen.GroupManager.GetCurrentContact().isNewContact?-1:NextGen.GroupManager.GetCurrentContactNumber(),editingExisting:NextGen.EditingExisting};return NextGen.Server.Site.Components(t)})}function it(n){var t,i,r,u;if(n.length>0){for(t=[],i=0;i<n.length;i++)r=_.filter(NextGen.Logic.ComponentLogic,function(t){return t.id===n[i]}),r&&r.length>0&&_.filter(r,function(n){return _.find(n.ruleSettings.rules,function(n){return _.find(n.rows,function(n){t.includes(n.componentId)||t.push(n.componentId)})})}),u=_.filter(NextGen.Logic.PartLogics,function(t){return t.componentId===n[i]}),u&&u.length>0&&_.filter(u,function(n){return _.find(n.ruleSettings.rules,function(n){return _.find(n.rows,function(n){t.includes(n.componentId)||t.push(n.componentId)})})});return t}}function v(n,t){return nt(n,t).done(function(t){n.SetContent(t);y(n)}).fail(function(n){NextGen.Alerts.danger(NextGen.Localization.Messages.ComponentLoad.Failed());NextGen.Logger.error(n)})}function y(n){n.IsEditable=n.Scope.find('.core-component-data[name="IsEditable"]').val()==="true";f[n.Name]&&f[n.Name](n);NextGen.TemplateManager.DisposeComponentTemplates(n);NextGen.TemplateManager.RegisterComponentTemplates(n);NextGen.TemplateManager.ApplyComponentTemplates(n,p);p(n);r[n.Name]&&r[n.Name](n)}function rt(n){var t=n.find(":input");t.filter('[type="text"],[type="file"],[type="checkbox"],[type="radio"],[type="date"],[type="time"],[data-type="number"],textarea,select, .theme-btn-primary').attr("disabled",!0);t.filter('[type="file"]').each(function(n,t){var i=$(t).data().fileinput;i&&i.refresh()})}function p(n,t){t=t||n.Scope;et(t);ot(t);n.IsEditable||rt(t);NextGen.Themes.SetupTheme(t);NextGen.Behaviours.RequiredFieldMarker.Apply(t);NextGen.InputChangeManager.RegisterInputGroups(t);NextGen.Behaviours.VisibilityToggle.Register(t);NextGen.Behaviours.DropDownList.Register(n,t);NextGen.Controls.FileInput(t);st(t);NextGen.Controls.Tooltip.Create(t);w(t);ut(t);n&&NextGen.Logic.Processor.ExecuteComponentLogicIfAny(n.Id,!0)}function ut(n){var t=n.find('[data-inv-type="DiscountCode"]');t.each(function(){var n=$(this);n.keydown(function(n){if(n.keyCode===13)return n.preventDefault(),!1})})}function ft(t){var i,r;$.each(t,function(n,t){var i=h[t.Name];i&&i(t)});NextGen.InventoryManager.Init();ht();NextGen.Controls.AjaxLoader.Start();NextGen.Messaging.Subscribe("Page_Navigating",n.events.hideVisibleHelp);NextGen.Messaging.Subscribe("Site_Submitting",n.events.hideVisibleHelp);i=".tasalqw45564";k(i,1,2);NextGen.ValidationManager.StartSessionTimer();r=b(i);r===""?$("div#cookie-warning").show():ct();NextGen.ValidationManager.StartSessionTimer()}function t(n,t,i){var r=n.data("validation");r||(r={});r.hasOwnProperty(t)||(r[t]=i);n.data("validation",r)}function et(n){n.find('input[type="number"]').each(function(){var n=$(this),i=parseInt(n.attr("min"),10),r=parseInt(n.attr("max"),10);try{n.attr("type","text")}catch(u){NextGen.Logger.warning("Failed to change type of input from number to text: "+u+" Some weird behaviour may be experienced.")}n.attr("data-type","number");n.removeAttr("min");n.removeAttr("max");t(n,"number",!0);isNaN(i)||t(n,"min",i);isNaN(r)||t(n,"max",r)})}function ot(){}function st(n){n.find('input[type="date"]').each(function(){var n=$(this),r=n.attr("min"),u=n.attr("max"),i;if(Modernizr.inputtypes.date===!1||Modernizr.mq("only all and (min-width: 480px)")){try{n.attr("type","text")}catch(f){NextGen.Logger.warning("Failed to change type of input from date to text: "+f+" Some weird behaviour may be experienced.")}n.attr("data-type","date");n.datepicker({theme:"bootstrap",inputFormat:["yyyy-MM-dd"],outputFormat:"yyyy-MM-dd",min:r,max:u});n.attr("placeholder","yyyy-mm-dd");n.siblings("a.datepicker-button").removeClass("btn");n.addClass("icon-calendar");i=n.parent().parent().find(".theme-label-floating");i&&i.addClass("date-label-floating")}n.keypress(function(n){n.key=="Enter"&&n.preventDefault()});t(n,"min",r);t(n,"max",u);t(n,"date",!0)})}function w(n){n.find(".alert-container").each(function(){var n=$(this);n.data().bsAlerts===undefined&&n.bsAlerts({ids:n.attr("id")});n.on("close.bs.alert",function(){n.hide()})});n.find(".alerts-watchers").each(function(){var n=$(this);n.data().bsAlertsWatcher===undefined&&n.bsAlertsWatcher()})}function ht(){$("div.splash").fadeOut("slow",function(){$("div.delayed-component-content").slideDown("slow")})}function ct(){var n=b(c);(!n||n.length<=0||n!=="1")&&(k(c,1e4,1),$("div#cookie-message").delay(5e3).fadeIn().delay(1e4).fadeOut(),$("#cookieMessageButton").click(function(){$("div#cookie-message").fadeOut("slow")}))}function b(n){var t,i;return document.cookie.length>0&&(t=document.cookie.indexOf(n+"="),t!==-1)?(t=t+n.length+1,i=document.cookie.indexOf(";",t),i===-1&&(i=document.cookie.length),unescape(document.cookie.substring(t,i))):""}function k(n,t,i){var u,r;t?(r=new Date,r.setTime(r.getTime()+t*864e5),u="; expires="+r.toGMTString()):u="";document.cookie=n+"="+i+u+"; path=/"}var n={},h={},r={},u={},f={},e=$.Deferred().resolve(),i,c=".cmd",o=new window.tinymce.Editor("htmlEditorTextArea",{height:300,menubar:!1,entity_encoding:"raw",relative_urls:!1,plugins:["advlist autolink lists link charmap preview hr anchor pagebreak","searchreplace wordcount visualblocks visualchars fullscreen","insertdatetime save table contextmenu directionality","paste textcolor colorpicker textpattern"],toolbar:"undo redo | insert | styleselect | bold italic | forecolor backcolor | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | table link"},window.tinymce.EditorManager),l;o.render();l="<div id='html_editor' class='modal fade bs-example-modal-lg modal_div' tabindex='-1' role='dialog' ><div class='modal-dialog modal-lg' role='document'><div class='modal-content'><div class='modal-body'><textarea id='htmlEditorTextArea' data-type='html' class='form-control'/><button type='button' class='btn btn-default navbar-btn' data-dismiss='modal'>Close<\/button><\/div><\/div><\/div><input type='hidden' id='source_id'/><\/div>";$("body").append(l);$("#html_editor").on("show.bs.modal",function(n){var u=$(n.relatedTarget),r,t;i=u.attr("id");r=$("#preview_"+i).text();o.setContent(r);t=$("#html_editor").find(".btn.btn-default.navbar-btn");NextGen.SiteTheme!=="Curved"&&NextGen.SiteTheme!=="Panel"||t.hasClass("theme-btn-primary")||t.addClass("theme-btn-primary")});$("#html_editor").on("hidden.bs.modal",function(){var n=$("#area_"+i),r=$("#preview_"+i),t=o.getContent();r.text(t);n.val(t);n.trigger("change")});$(document).on("focusin",function(n){$(n.target).closest(".mce-window").length&&n.stopImmediatePropagation()});return n.events={},n.events.hideVisibleHelp=function(){NextGen.Controls.Tooltip.HideAll()},n.events.componentControllerOnSignIn=function(n){NextGen.Logger.setUser(n&&n.username&&n.username.length>0?n.username:NextGen.Localization.Messages.Error.Unknown());a();$.each(NextGen.Components,function(n,t){u[t.Name]&&u[t.Name](t)})},n.events.componentControllerOnSignOut=function(){NextGen.Logger.setUser(null);NextGen.SetEditingExisting(!1);NextGen.SetHasCancellableItems(!1);NextGen.GroupManager.ResetGroupOptions();a()},NextGen.Logger.errorWrap(n.events),NextGen.Messaging.Subscribe("Authentication_SignIn",n.events.componentControllerOnSignIn),NextGen.Messaging.Subscribe("Authentication_SignOut",n.events.componentControllerOnSignOut),{Reload:function(n){return NextGen.Logger.debug("****Reloading ["+n.Name+"] component****"),v(n)},ReloadPage:function(n){return NextGen.Logger.debug("****Reloading page "+n+" components****"),s(function(t){return t.PageNumber===n},null,!0)},ReloadDataEntry:function(n,t){NextGen.Logger.debug("****Reloading data entry components****");var i=NextGen.PageManager.GetDataEntryPageNumbers();return s(function(n){return _.contains(i,n.PageNumber)},n,t)},RegisterOnPageLoadCallback:function(n,t){NextGen.Logger.debug("Registered initial load callback for: "+n);h[n]=t},RegisterOnComponentLoadCallback:function(n,t){NextGen.Logger.debug("Registered component refreshed callback for: "+n);r[n]=t},RegisterOnSignInCompleteCallback:function(n,t){NextGen.Logger.debug("Registered SignInComplete callback for: "+n);u[n]=t},RegisterOnComponentDisposeCallback:function(n,t){NextGen.Logger.debug("Registered ComponentDispose callback for: "+n);f[n]=t},Componentize:function(n,t){function i(n){if(n){if(n.is("[data-page]"))return n;var t=n.closest("[data-page]");return t.length?t:null}return null}function r(n){return n&&n.is("[data-page]")?+n.data("page"):null}w($(document));NextGen.PageManager.Init();$.each(n,function(n,t){t.Scope=$("#"+t.Id);t.Page=i(t.Scope);t.PageNumber=r(t.Page);t.DetachContent=function(){return t.Scope.find("form.dynamic-target").children().detach()};t.SetContent=function(n){var i=t.Scope.find("form.dynamic-target").empty();n instanceof jQuery?i.append(n):n.partialView?(i.html(n.partialView),n.isVisible===!0?(t.Scope.show(),t.Scope.removeClass("invisible")):n.isVisible===!1&&(t.Scope.hide(),t.Scope.addClass("invisible"))):i.html(n)};y(t);NextGen.PageManager.RegisterComponent(t)});NextGen.PageManager.WireNavigation();ft(n);t&&t()},GetComponentById:function(n){for(var i=null,t=0;t<NextGen.Components.length;t++)if(NextGen.Components[t].Id===n){i=NextGen.Components[t];break}return i},GetAllComponents:function(){return NextGen.Components},GetComponentsOnPage:function(n){var t=[];return $.each(NextGen.Components,function(i,r){r.PageNumber===n&&t.push(r)}),t},WaitForComponentsToLoad:function(){return e.promise()}}}();
//# sourceMappingURL=components_d72ad7a23479481d8a4f0e51b567a141.map
window.eventsair_components=1;
//# sourceMappingURL=components_d72ad7a23479481d8a4f0e51b567a141.map
var NextGen=NextGen||{};NextGen.InputChangeManager=function(){function f(n){return"Page_"+NextGen.PageManager.GetPageNumber(n)+"_"+n.attr("data-inputtype")+"_"+NextGen.GroupManager.GetCurrentContactNumber()}function s(){var i=$.Deferred(),u,r;if(t||n.length<=0)return i.resolve(),i.promise();t=!0;try{u={autoSaveValues:n.slice()};n=[];r=NextGen.Server.Site.Field(u);r.done(function(n){n||n.success===!0||(n.msg?NextGen.Logger.error(new Error("Pushing changes to the server failed")):NextGen.Logger.error(new Error("Pushing changes to the server failed: "+n.msg)))});r.fail(function(n,t,i){NextGen.Logger.error("Pushing changes to the server failed: "+i)});r.always(function(){i.resolve();t=!1})}catch(f){NextGen.Logger.error("Pushing changes to the server failed: "+f);i.resolve();t=!1}return i.promise()}function e(){var r,i;if(!t&&!(n.length<=0)){t=!0;try{r={autoSaveValues:n.slice()};n=[];i=NextGen.Server.Site.Field(r);i.done(function(n){n||n.success===!0||(n.msg?NextGen.Logger.error(new Error("Pushing changes to the server failed")):NextGen.Logger.error(new Error("Pushing changes to the server failed: "+n.msg)))});i.fail(function(n,t,i){NextGen.Logger.error("Pushing changes to the server failed: "+i)});i.always(function(){t=!1})}catch(u){NextGen.Logger.error("Pushing changes to the server failed: "+u);t=!1}}}function o(t){var f,i,u,h,c;if(t.is("select")&&(f=t.data().selected,f&&t.val()!==""&&t.data("selected",t.val()),t.find("option").each(function(){var n=$(this);t.val()===n.val()?$("#"+n.val()).attr("data-selected","selected"):$("#"+n.val()).removeAttr("data-selected")})),(t.hasClass("theme-select")||t.hasClass("theme-textbox"))&&(t.val()&&t.val().length?t.addClass("field--not-empty"):(t.removeClass("field--not-empty"),t.data("selected",""))),!t.is('[type="password"]')&&t.data("auto-save")!==!1&&!t.is(".no-auto-save")&&!t.closest("div.component").is(".no-auto-save")&&!NextGen.EditingExisting){var e=NextGen.GroupManager.GetCurrentContactNumber(),o=t.closest("form.dynamic-target"),s=o.find('[name="ComponentConfigurationId"]').val(),r={key:t.attr("name"),value:NextGen.InputManager.GetInputValue(t)};t.data().autosaved=!0;t.trigger("autosaved");i=NextGen.Utils.FirstOrDefault(n,function(n,t){return t.ConfigurationId===s&&t.ContactNumber===e});i?(u=NextGen.Utils.FirstOrDefault(i.FieldValues,function(n,t){return t.key===r.key}),u?(h=$.inArray(u,i.FieldValues),i.FieldValues[h]=r):i.FieldValues.push(r)):(c=o.find('[name="ConcreteType"]').val(),n.push({ConfigurationId:s,ContactNumber:e,TypeFullName:c,FieldValues:[r]}))}}var i={},n=[],t=!1,u=NextGen.Logger.errorWrap(function(){var n=$(this),c=f(n),u=i[c],s,t,h;!n.is("[data-inputtype]")||!u||u.length<=1&&!n.attr("data-inv-payment-status")?o(n):(s=n.attr("name"),t=n.is(":checked"),n.is(":radio")&&n.data("do-not-check")&&!t&&(t=!0),t?$(u).each(function(n,i){i.attr("name")!==s&&(i.prop("checked",!t),i.trigger("inputgroup-unchecked"),NextGen.Logic.Processor.ExecuteComponentLogicIfAny($(i).parents("div.component").attr("id")),NextGen.Logic.Processor.ExecutePartLogicIfAny($(i).attr("name")||$(i).attr("id"),$(i).parents("div.component").attr("id")));o(i)}):n.prop("checked",!0),n.trigger("after-change"));var e=$(this).parents("div.component").attr("id"),r=$("#"+e),l=r.find('[name="ConcreteType"]')&&r.find('[name="ConcreteType"]')[0]&&r.find('[name="ConcreteType"]')[0].value&&r.find('[name="ConcreteType"]')[0].value.split(".").pop();NextGen.Logic.Processor.ExecuteComponentLogicIfAny(e);h=$(this).attr("name")||$(this).attr("id");NextGen.Logic.Processor.ExecutePartLogicIfAny(h,e,null,l==="AccommodationComponent",n.is("select"))}),r;$("form.dynamic-target").on("change",":input",u);$("form.dynamic-target").on("fileselect",'input[type="file"]',u);return r=setInterval(e,5e3),{StopChangeTracking:function(){clearInterval(r);r=null},StartChangeTracking:function(){r===null&&(r=setInterval(e,5e3));n=[]},PushChangesAsync:function(){return s()},RegisterInputGroups:function(n){n.find("[data-inputtype]").each(function(){var t=$(this),r=f(t),e=t.attr("id"),u,n;for(i[r]||(i[r]=[]),u=i[r],n=0;n<u.length;n++)if(u[n].attr("id")===e){u[n]=t;return}i[r].push(t)})}}}();
//# sourceMappingURL=components_d72ad7a23479481d8a4f0e51b567a141.map
var NextGen=NextGen||{};NextGen.Logic=NextGen.Logic||{};NextGen.Logic.EvaluationEngine=function(){function n(n){return n&&(typeof n=="string"||n instanceof String)&&(n=n.replace(/[\u00A0\u1680​\u180e\u2000-\u2009\u200a​\u200b​\u202f\u205f​\u3000]/g," ")),n}function y(n,t,i,r,u){var f=v[n],e;return(u==="DietaryId"&&(f=a),!f)?(NextGen.Error("Cannot determine logic evaluation engine for ruleFieldValueType of type: "+n),!1):(e=f[t],!e)?(NextGen.Error("Cannot determine logic operator evaluation engine for ruleFieldValueType of type: "+n+" and operator of type: "+t),!1):e(i,r)}var t=function(n,t){return moment(n).isSame(moment(t))},o=function(n){return t(n,moment().year(0).startOf("year"))},i=function(n,t){return moment(n).isAfter(moment(t))},r=function(n,t){return moment(n).isBefore(moment(t))},u=function(n,r){return i(n,r)||t(n,r)},f=function(n,i){return r(n,i)||t(n,i)},s=function(n,t,i){return u(n,t)&&f(n,i)},h={"=":function(n,i){return t(n,i[0])},"is equal to":function(n,i){return t(n,i[0])},"!=":function(n,i){return!t(n,i[0])},"is not equal to":function(n,i){return!t(n,i[0])},"is blank":function(n){return moment(n).isValid()?o(n):!0},"is not blank":function(n){return!o(n)},">":function(n,t){return i(n,t[0])},"is greater than":function(n,t){return i(n,t[0])},"<":function(n,t){return r(n,t[0])},"is less than":function(n,t){return r(n,t[0])},">=":function(n,t){return u(n,t[0])},"is greater than or equal to":function(n,t){return u(n,t[0])},"<=":function(n,t){return f(n,t[0])},"is less than or equal to":function(n,t){return f(n,t[0])},between:function(n,t){return s(n,t[0],t[1])}},c={"=":function(n,i){return t(n,i[0])},"is equal to":function(n,i){return t(n,i[0])},"!=":function(n,i){return!t(n,i[0])},"is not equal to":function(n,i){return!t(n,i[0])},"is blank":function(n){return o(n)},"is not blank":function(n){return!o(n)},">":function(n,t){return i(t[0],n)},"is greater than":function(n,t){return i(t[0],n)},"<":function(n,t){return r(t[0],n)},"is less than":function(n,t){return r(t[0],n)},">=":function(n,t){return u(t[0],n)},"is greater than or equal to":function(n,t){return u(t[0],n)},"<=":function(n,t){return f(t[0],n)},"is less than or equal to":function(n,t){return f(t[0],n)},between:function(n,t){return s(n,t[0],t[1])}},e={"=":function(t,i){return n(t)===n(i[0])},"is equal to":function(t,i){return n(t)===n(i[0])},"!=":function(t,i){return n(t)!==n(i[0])},"is not equal to":function(t,i){return n(t)!==n(i[0])},"begins with":function(t,i){return t.indexOf(n(i[0]))===0},"ends with":function(t,i){return t.indexOf(n(i[0]),t.length-n(i[0]).length)!==-1},contains:function(t,i){return t.indexOf(n(i[0]))>-1},"does not begin with":function(t,i){return t.indexOf(n(i[0]))!==0},"does not end with":function(t,i){return t.indexOf(n(i[0]),t.length-n(i[0]).length)===-1},"does not contain":function(t,i){return t.indexOf(n(i[0]))===-1},"is blank":function(n){return n===undefined||n===null||n.trim()===""},"is not blank":function(n){return n!==undefined&&n!==null&&n.trim()!==""},">":function(t,i){return t>n(i[0])},"is greater than":function(t,i){return t>n(i[0])},"<":function(t,i){return t<n(i[0])},"is less than":function(t,i){return t<n(i[0])},">=":function(t,i){return t>=n(i[0])},"is greater than or equal to":function(t,i){return t>=n(i[0])},"<=":function(t,i){return t<=n(i[0])},"is less than or equal to":function(t,i){return t<=n(i[0])},between:function(t,i){return t>=n(i[0])&&t<=i[1]}},l={"is blank":function(n){return isNaN(n)},"is not blank":function(n){return!isNaN(n)}},a={"is equal to":function(n,t){return n&&n.indexOf(t[0])>-1},"is not equal to":function(n,t){return n&&n.indexOf(t[0])===-1}},v={string:e,selection:e,numeric:$.extend({},e,l),date:h,time:h,list:e,html:e,timePeriod:c};return{Evaluate:y}}();
//# sourceMappingURL=components_d72ad7a23479481d8a4f0e51b567a141.map
var NextGen=NextGen||{};NextGen.Logic=NextGen.Logic||{};NextGen.Logic.Processor=function(){function u(n){var t=NextGen.Logic.ValueEngine.BuildInputsForEvaluation(n);return _.some(t.inputValues,function(i){return NextGen.Logic.EvaluationEngine.Evaluate(n.ruleFieldValueType,n.operator.display,i,t.comparisonValues,n.partId)})}function n(n){return e[n.conditional](n)}function o(t){var r=NextGen.Logic.PartLogics&&NextGen.Logic.PartLogics.length?structuredClone(_.filter(NextGen.Logic.PartLogics,function(n){var t=$("#"+n.id),i=t.is(":input")||t.is("select")?t:$("#"+n.componentId+"_"+n.id);return i.is(":visible")&&_.find(n.ruleSettings.rules,function(n){return n.ruleAction==="displayErrorComponent"})})):[],i;r.length&&r.forEach(function(n){n.ruleSettings.rules=n.ruleSettings.rules.filter(function(n){return n.ruleAction==="displayErrorComponent"})});i=NextGen.Logic.ComponentLogic&&NextGen.Logic.ComponentLogic.length?structuredClone(_.filter(NextGen.Logic.ComponentLogic,function(n){return $("#"+n.id).is(":visible")&&_.find(n.ruleSettings.rules,function(n){return n.ruleAction==="displayErrorComponent"})})):[];i.length&&i.forEach(function(n){n.ruleSettings.rules=n.ruleSettings.rules.filter(function(n){return n.ruleAction==="displayErrorComponent"})});var e=NextGen.ComponentController.GetComponentsOnPage(t),f=_.filter(_.union(NextGen.Logic.PageValidation,i,r),function(n){return _.find(e,function(t){return t.Id===n.id||t.Id===n.componentId})}),u=!1;return f.length&&f.forEach(function(t){var i,r;if(!t||!t.ruleSettings||!t.ruleSettings.rules)return!0;i=_.chain(t.ruleSettings.rules).sortBy("index").filter(n).value();i.length>0&&!u&&(u=!0,NextGen.Alerts.clear());r=_.map(i,function(n){return n.ruleActionValue});NextGen.Alerts.danger(r)}),u===!1}function s(t){var u=NextGen.ComponentController.GetComponentsOnPage(t),i=_.find(NextGen.Logic.Redirect,function(n){return _.find(u,function(t){return t.Id===n.id})}),r;return!i||!i.ruleSettings||!i.ruleSettings.rules?!1:(r=_.chain(i.ruleSettings.rules).sortBy("index").find(n).value(),!r)?!1:(NextGen.Redirect.Get(r.ruleActionValue),!0)}function i(t){var e=NextGen.ComponentController.GetComponentsOnPage(t),i=_.find(NextGen.Logic.PageDisplay,function(n){return _.find(e,function(t){return t.Id===n.id})}),r,u,f;if(!i||!i.ruleSettings||!i.ruleSettings.rules)return!0;if(r=_.chain(i.ruleSettings.rules).sortBy("index").find(n).value(),!r){if(u=_.some(i.ruleSettings.rules,function(n){return n.ruleAction==="displayThisPage"}),f=_.some(i.ruleSettings.rules,function(n){return n.ruleAction==="skipThisPage"}),u===!0)return!1;if(f===!0)return!0;throw new Error("I can not figure out what to do here. There are a mixture of DisplayThisPage and SkipThisPage rules, none of which can be actioned.");}if(r.ruleAction==="skipThisPage")return!1;if(r.ruleAction==="displayThisPage")return!0;throw new Error("The Page Visibility Rule does not have a valid action: "+r.ruleAction);}function h(n){var r=_.find(NextGen.Logic.PageDisplay,function(t){return _.find(t.ruleSettings.rules,function(t){return _.find(t.rows,function(t){return t.componentId===n})})}),t,i;return r&&r.ruleSettings&&r.ruleSettings.rules.length>0?!0:(t=_.find(NextGen.Logic.Redirect,function(t){return _.find(t.ruleSettings.rules,function(t){return _.find(t.rows,function(t){return t.componentId===n})})}),t&&t.ruleSettings&&t.ruleSettings.rules.length>0)?!0:(i=_.find(NextGen.Logic.PageValidation,function(t){return _.find(t.ruleSettings.rules,function(t){return _.find(t.rows,function(t){return t.componentId===n})})}),i&&i.ruleSettings&&i.ruleSettings.rules.length>0)?!0:!1}function c(n){if(!n)return!1;return _.filter(NextGen.Logic.ComponentLogic,function(t){return _.find(t.ruleSettings.rules,function(t){return _.find(t.rows,function(t){return t.componentId===n})})})}function l(n,t,i,r){var u,f,e;return n?(u=_.filter(NextGen.Logic.PartLogics,function(r){return _.find(r.ruleSettings.rules,function(r){return _.find(r.rows,function(r){return i?r.componentId===t:r.componentId===t&&(r.partId===n||t+"_"+r.partId===n||r.partId===n.replace("__SharedCacheKey",""))})})}),f=_.find(NextGen.Components,function(n){return n.Id===t&&n.Name==="NextGen.Online.Components.Client.Group.GroupComponent"}),f&&(u=_.filter(NextGen.Logic.PartLogics,function(n){return _.find(n.ruleSettings.rules,function(n){return _.find(n.rows,function(n){return n.componentId===t})})})),i&&!u.length&&(u=_.filter(NextGen.Logic.PartLogics,function(n){return n.componentId===t})),!u.length&&r)?_.filter(NextGen.Logic.PartLogics,function(n){return _.find(n.ruleSettings.rules,function(n){return _.find(n.rows,function(n){return n.componentId===t})})}):(u.length||n.indexOf("cst_")!==0||(e=n.split("_"),e.length===3&&(u=_.filter(NextGen.Logic.PartLogics,function(i){return _.find(i.ruleSettings.rules,function(i){return _.find(i.rows,function(i){return i.componentId===t&&n==="cst_"+t.replaceAll("-","")+"_"+i.partId.replace("cst_","")})})}))),u):!1}function r(n,t){var i=$(n),r=!1;i.is(":checkbox")&&i.is(":checked")?(i.prop("checked",!1),r=!0):i.data()&&i.data().type==="number"?i.val()!=="0"&&i.val()!==0&&(i.val("0"),r=!0):i.is(":radio")&&i.is(":checked")?(i.prop("checked",!1),i.data("do-not-check",!0),r=!0):i.data()&&i.data().inputType==="dropdown"||i.is("select")?t&&i.val()==t&&(i.val(""),r=!0):(i.hasClass("theme-select")||i.hasClass("theme-textbox"))&&i.val()&&i.val().length&&(i.data("selected",""),i.val(""),r=!0);r&&i.trigger("change");$(n).is(":radio")&&$(n).removeData("do-not-check")}function a(t,i){function o(n){var i,t,u;n.hide();n.attr("data-submit","false");i=n.find(":input[id], select");$.each(i,function(n,t){r(t)});t=n.parent("div.theme-panel").find("div.component");t.length&&(u=_.every(t,function(n){return $(n).attr("data-submit")==="false"}),u&&n.parent("div.theme-panel").addClass("theme-panel-hidden").removeClass("theme-panel"))}function s(n){n.hasClass("invisible")||(n.show(),n.removeAttr("data-submit"),n.removeData("submit"),n.parent("div.theme-panel-hidden").removeClass("theme-panel-hidden").addClass("theme-panel"))}var e=c(t);if(e.length&&e.forEach(function(t){var r,i,u,f;t&&t.ruleSettings&&t.ruleSettings.rules.length&&(r=_.chain(t.ruleSettings.rules.filter(function(n){return n.ruleAction==="displayThisComponent"||n.ruleAction==="skipThisComponent"})).sortBy("index").find(n).value(),i=$("#"+t.id),r?r.ruleAction==="skipThisComponent"?o(i,t):r.ruleAction==="displayThisComponent"&&s(i):(u=_.some(t.ruleSettings.rules,function(n){return n.ruleAction==="displayThisComponent"}),f=_.some(t.ruleSettings.rules,function(n){return n.ruleAction==="skipThisComponent"}),u===!0?o(i,t):f===!0&&s(i)))}),i){var h=$("#"+t).find(":input[id], select"),u=$("#"+t),l=u.find('[name="ConcreteType"]')&&u.find('[name="ConcreteType"]')[0]&&u.find('[name="ConcreteType"]')[0].value&&u.find('[name="ConcreteType"]')[0].value.split(".").pop();$.each(h,function(n,i){f(i.id,t,$(i).data().logicId,l==="AccommodationComponent")})}}function t(n,t,i,r){var f,u,e,o;if(i=i||n.parents(".row.hotel").length>0,f=(n.is(":checkbox")||n.is(":radio"))&&(n.closest(".checkbox").length>0||n.closest(".radio").length>0),u=r?n.parents(".travel-logic"):i?n.parents(".accom-logic"):n.parent(".row, .form-group").length?n.parent(".row, .form-group"):f&&n.parents(".form-group.col-sm-6.col-xs-12").length>0?n.parents(".form-group.col-sm-6.col-xs-12"):n.parents(".row, .form-group"),u.length||(u=n.closest(".text-left")),i&&!u.length?u=n.parents(".list-group-item.room-type-list"):n.is("select")&&!n.attr("id").startsWith("eta_")&&(u=n.closest(".cstField"),u.length===0&&(u=n.closest(".form-group")),u.length===0&&(u=n.closest(".row"))),t?(u.hide(),n.addClass("ignored-by-logic")):(u.show(),n.removeClass("ignored-by-logic")),f&&n.parents(".row").find("div.form-group").length>0)e=i?n.parents(".row").not(".accom-logic").find("div.form-group"):n.parents(".row").find("div.form-group"),o=_.every(e,function(n){return $(n).css("display")==="none"}),o&&t?n.parents(".row").hide():n.parents(".row").show();else if(f&&n.data().invType==="Registration")if(t){n.parents("form.theme-component-registration").length&&n.parents("form.theme-component-registration").css("padding-top","0px");var s=n.parents(".row").siblings("div.row.no-theme").length>0,h=n.parents(".row").siblings("div").find("p").length>0,c=n.parents(".row").siblings().find("img").length>0,l=n.parents(".row").siblings().is(":header").length>0,a=!(s||h||c||l);a&&n.parents(".row").siblings("hr").length===1&&n.parents(".row").siblings("hr").hide()}else n.parents("form.theme-component-registration").length&&n.parents("form.theme-component-registration").removeAttr("style"),n.parents(".row").siblings("hr").length===1&&n.parents(".row").siblings("hr").show();n.parents(".row").find("div.form-group").length>0&&(e=i?n.parents(".row").not(".accom-logic").find("div.form-group"):n.parents(".row").find("div.form-group"),o=_.every(e,function(n){return $(n).css("display")==="none"}),o&&t?n.parents(".row").hide():n.parents(".row").show())}function f(i,u,f,e,o){if(i&&u){var s=l(i,u,e,o);s.length&&s.forEach(function(i){var h,u,l,o,c,s,v,y,a;i&&i.ruleSettings&&i.ruleSettings.rules.length&&(h=_.chain(i.ruleSettings.rules.filter(function(n){return n.ruleAction==="displayThisComponent"||n.ruleAction==="skipThisComponent"})).sortBy("index").find(n).value(),u=$("#"+i.componentId).find("#"+i.id),u.is(":radio")&&(u=$("#"+i.componentId).find('input[name="'+i.id+'"]')),u.length||(u=$("#"+i.componentId+"_"+i.id)),u.length||i.id.indexOf("cst_")!==0||(l=i.id.split("_"),l.length===2&&(u=$("#"+i.componentId).find('[id^="cst_"][id*="'+l[1]+'"]'))),!u.length&&f&&(i.ruleSettings.rules.forEach(function(n){n.rows.forEach(function(n){var r=$("#"+i.componentId).find('div[id="'+n.partId+'"]'),t;r&&r.length&&(t=r.find('input[data-logic-id="'+i.id+'"], select[data-logic-id="'+i.id+'"]'),t&&t.length&&$.each(t,function(n,t){u.push(t)}))})}),u.length||(u=$("#"+i.componentId).find('input[data-logic-id="'+i.id+'"]'))),u.length)&&(u.length&&$(u).data().inputType==="dropdown"&&(c=$("#"+$(u).data().parent),c&&(o=$(u).attr("id"),c.length&&(u=c))),s=u.parents(".travel-logic").length!==0,h?h.ruleAction==="skipThisComponent"?(r(u,o),t(u,!0,e,s),o&&$("#"+o).attr("data-submit","false")):h.ruleAction==="displayThisComponent"&&(t(u,!1,e,s),o&&$("#"+o).removeAttr("data-submit")):(v=_.some(i.ruleSettings.rules,function(n){return n.ruleAction==="displayThisComponent"}),y=_.some(i.ruleSettings.rules,function(n){return n.ruleAction==="skipThisComponent"}),v===!0?(r(u,o),t(u,!0,e,s),o&&$("#"+o).attr("data-submit",!1)):y===!0&&(t(u,!1,e,s),o&&$("#"+o).removeAttr("data-submit"))),o&&(a=_.find(NextGen.Components,function(n){return n.Id===i.componentId}),a.IsEditable=$(u).parents("div.component").find('.core-component-data[name="IsEditable"]').val()==="true",NextGen.Behaviours.DropDownList.Register(a,$(u).parents("div.component"),!0)))})}}var e={and:function(n){return _.every(n.rows,u)},or:function(n){return _.some(n.rows,u)}};return{ProcessCustomPageValidationRules:function(n){return o(n)},ProcessCustomRedirectRules:function(n){return s(n)},ShouldDisplayPage:function(n){return i(n)},GetVisiblePageNumbers:function(){return _.filter(NextGen.PageManager.GetPageNumbers(),i)},GetVisiblePageNumbersForPosting:function(){return JSON.stringify(_.filter(NextGen.PageManager.GetPageNumbers(),i))},HasAnyLogicForComponent:function(n){return h(n)},ExecuteComponentLogicIfAny:function(n,t){return a(n,t)},ExecutePartLogicIfAny:function(n,t,i,r,u){return f(n,t,i,r,u)}}}();
//# sourceMappingURL=components_d72ad7a23479481d8a4f0e51b567a141.map
var NextGen=NextGen||{};NextGen.Logic=NextGen.Logic||{};NextGen.Logic.ValueEngine=function(){function o(n){return $("#"+n)}function t(n,t){var i=n.find('[id="'+t+'"]'),r;return i.length||(i=n.find('[name="'+t+'"]')),i.length||(i=$("#"+n.attr("id")+"_"+t)),i.length||t.indexOf("_NoOption")===-1||(i=n.find('[id$="'+t+'"]')),i.length||t.indexOf("cst_")!==0||(r=t.split("_"),r.length===2&&(i=n.find('[id^="cst_"][id*="'+r[1]+'"]'))),i}var s=function(n){return n===null||n===undefined?[]:Array.isArray(n)?n:[n]},u=function(n,t){return _.map(s(n),t)},r=function(n){return n.toString().toUpperCase()},f=function(n){return n===""?0:parseFloat(n)},h=function(n){return n?moment(n,"YYYY-MM-DD").toDate():""},c=function(n){return n?moment(n,"HH:mm"):""},i=function(n){var i=t(n.component,n.partId);return i.is("select")&&i[0]?i[0].value:i.is(":checkbox")?i.is(":checked"):i.val()},n=function(n){var i=t(n.component,n.partId);return i.is(":file")?!!i.closest(".form-group").find("[data-existing-filename]").val():i.prop("checked")},e=function(n){var i=t(n.component,n.partId),r=i.data("parent"),u,f;return r?(u=t(n.component,r),NextGen.InputManager.GetInputValue(u)===n.partId):(f=i.is("select")&&i[0]?i[0].value:"",NextGen.InputManager.GetInputValue(i)||f)},l=function(n){var r=t(n.component,n.partId);r.length>0&&(r=r.find(".booking-details"));var f=function(t){return n.component.find("["+t+"]").map(function(){return $(this).attr(t)}).toArray()},u=function(n){return r.find('[name^="'+n+'_"]').map(function(){return $(this).val()}).toArray()},e={checkindate:function(){return f("data-ref-checkin")},checkoutdate:function(){return f("data-ref-checkout")},roomtype:function(){return r.length>0},numberofrooms:function(){return u("numberOfRooms")},eta:function(){return u("eta")},etd:function(){return u("etd")},cardtype:function(){return u("cardType")},"null":function(){return i(n)}};return e[n.valueEngineFunctionKey]()},a=function(n){var t=function(t){return n.component.find('[name="'+t+'"]').val()},i={category:function(){return t("category")},subcategory:function(){return t("subcategory")},role:function(){return t("role")},status:function(){return t("status")}};return i[n.valueEngineFunctionKey]()},v=function(n){var i=t(n.component,n.partId),r=i.attr("data-input-type"),u;if(r===undefined)return u={selection:function(){return!1},numeric:function(){return null}},u[n.ruleFieldValueType]();var o={number:function(){return f(i.val())>0},dropdown:function(){return $('select[name="'+i.attr("data-parent")+'"]').val()===i.attr("id")},radio:function(){return NextGen.InputManager.GetInputValue(i)},checkbox:function(){return NextGen.InputManager.GetInputValue(i)}},e=o[r](),s={selection:function(){return e},numeric:function(){var n={number:function(){return i.val()},dropdown:function(){return i.attr("data-inv-quantity")},radio:function(){return i.attr("data-inv-quantity")},checkbox:function(){return i.attr("data-inv-quantity")}};return e||r==="number"?n[r]():null}};return s[n.ruleFieldValueType]()},y=function(t){var i=n(t)||!1,r={registrationtype:function(){return i},discount:function(){return i?t.component.find("#"+t.partId+"_DiscountCodeKey").val():null}};return r[t.valueEngineFunctionKey]()},p=function(t){var r=function(n){return t.component.find('div[data-templateplaceholder="travelPassengers"] div[class="well"] input[name="'+n+'"]').map(function(){return $(this).val()}).toArray()},u=function(n){return t.component.find('[name="'+n+'"]').val()},i=function(n){var i=t.component.find('[name="'+n+'"]');return t.component.find('[data-togglevisibility="'+i.closest("div.sectorinfo").attr("id")+'"]').prop("checked")?i.val():null},f={passengertitle:function(){return r("title")},passengerfirstname:function(){return r("firstName")},passengermiddlename:function(){return r("middleName")},passengerlastname:function(){return r("lastName")},passengermembernumber:function(){return r("membershipNumber")},passengernumber:function(){return u("passengerCount")},sector:function(){return n(t)},custominboundselected:function(){return n(t)},custominboundport:function(){return i("CustomInbound_Port")},custominboundflightnumber:function(){return i("CustomInbound_Flight")},custominbounddate:function(){return i("CustomInbound_Date")},custominboundtime:function(){return i("CustomInbound_Time")},customoutboundselected:function(){return n(t)},customoutboundport:function(){return i("CustomOutbound_Port")},customoutboundflightnumber:function(){return i("CustomOutbound_Flight")},customoutbounddate:function(){return i("CustomOutbound_Date")},customoutboundtime:function(){return i("CustomOutbound_Time")},nooptionselected:function(){return n(t)}};return f[t.valueEngineFunctionKey]()},w=function(){return NextGen.GroupManager.IsGroup()?NextGen.GroupManager.IsGroupContact():!0},b=function(n){var t=n.component.find("input[name=DataProcessingConsent]:checked").val(),i=t==="True"?"ConsentGiven":"ConsentWithdrawn",r={data_processing_consent:function(){return i}};return r[n.valueEngineFunctionKey]()},k=function(n){var t=n.component.find("input[name=AttendeeAppConsent]:checked").val(),i=t==="True"?"ConsentGiven":"ConsentWithdrawn",r={attendee_app_consent:function(){return i}};return r[n.valueEngineFunctionKey]()},d={string:i,selection:n,numeric:i,date:i,list:e,tag_type:e,registration_type:y,function_fee_type:v,accommodation:l,accrediation:a,travel:p,group_contact:w,data_processing_consent:b,attendee_app_consent:k,membership_fee_type:n},g={string:r,selection:r,numeric:f,date:h,time:c,list:r};return{BuildInputsForEvaluation:function(n){var r=n.logicValueEngineKey||n.ruleFieldValueType,f=d[r]||i,t=g[n.ruleFieldValueType],e={component:o(n.componentId),partId:n.partId,valueEngineFunctionKey:n.valueEngineFunctionKey,ruleFieldValueType:n.ruleFieldValueType},s=f(e);return{inputValues:u(s,t),comparisonValues:u(n.values,t)}}}}();
//# sourceMappingURL=components_d72ad7a23479481d8a4f0e51b567a141.map
var NextGen=NextGen||{};(function(){NextGen.ClientUrls={ComponentGet:"",SummaryGet:"",CancelRegistration:"",PoliciesGet:"",GroupPoliciesGet:"",PaymentsTotals:"",Payments:"",PaymentsProcessGateway:"",FieldPost:"",SubmitPost:"",SubmissionStatusPost:"",FinishedGet:"",CaptchaPost:"",SignInPost:"",SignOutPost:"",SendAConfirmationEmailAndSignOutPost:"",CreateIdentityPost:"",UploadPost:"",ExternalLoginPost:"",SSOLoginPost:"",InventoryCheckPost:"",InventoryEnforcePost:"",UpdateAccountEmailPost:"",RequestPasswordResetPost:"",InventoryRefreshPost:"",CountryGet:"",StateGet:"",CarriersPost:"",PortsPost:"",IsValidPortPost:"",SaveCropedPhotoPost:"",CheckOnlineUserStatusPost:"",ValidatePasscodePost:""};NextGen.PublicKeys={Recaptcha:""};NextGen.LoginComponentId="";NextGen.SummaryComponentId="";NextGen.PaymentComponentId="";NextGen.ThankYouComponentId="";NextGen.AnalyticsForThankYouPage="";NextGen.UseAllInOneLogin=!1;NextGen.HasViewedSummary=!1;NextGen.SetHasViewedSummary=function(n){n!==NextGen.HasViewedSummary&&(NextGen.HasViewedSummary=n,NextGen.Messaging.Publish("HasViewedSummary_ValueChanged"))};NextGen.EditingExisting=!1;NextGen.SetEditingExisting=function(n){n!==NextGen.EditingExisting&&(NextGen.EditingExisting=n,NextGen.Messaging.Publish("EditingExisting_ValueChanged"))};NextGen.HasCancellableItems=!1;NextGen.SetHasCancellableItems=function(n){n!==NextGen.HasCancellableItems&&(NextGen.HasCancellableItems=n,NextGen.Messaging.Publish("HasCancellableItems_ValueChanged"))};NextGen.MustCreateAccount=!1;NextGen.SetMustCreateAccount=function(n){n!==NextGen.MustCreateAccount&&(NextGen.MustCreateAccount=n)};NextGen.InventoryExhaustedMessage=null;NextGen.InventoryEnforcedByPayment=!1;NextGen.Redirection={};NextGen.Components={};NextGen.SiteTheme=""})();
//# sourceMappingURL=components_d72ad7a23479481d8a4f0e51b567a141.map
var NextGen=NextGen||{};NextGen.UserManager=function(){function t(){NextGen.Messaging.Publish("User_Changed",{name:n.loggedInUserName,hasContact:n.hasContact,contactId:n.contactId,eventId:n.eventId})}var n={};return n.loggedInUserName="",n.hasContact=!1,n.contactId=null,n.eventId=null,{UserIsLoggedIn:function(){return!!n.loggedInUserName},GetLoggedInUser:function(){return{loggedInUserName:n.loggedInUserName,hasContact:n.hasContact,contactId:n.contactId,eventId:n.eventId}},SetUser:function(i){n.loggedInUserName=i.name;n.hasContact=!!i.hasContact;n.contactId=i.contactId;n.eventId=i.eventId;t()},PublishUserChanged:function(){t()},UpdateAccountEmail:function(i){var r=$.Deferred(),f={},u;return $.each(i,function(){f[this.name]=this.value}),u=NextGen.Server.Account.UpdateAccountEmail(f),u.done(NextGen.Logger.errorWrap(function(i,u,f){i.success===!0?(n.loggedInUserName=i.accountEmail,t(),r.resolve(i)):(NextGen.Logger.info("Error updating account email: "+i.errors+" "+NextGen.Utils.ExtractJsonErrorInfo(f)),r.reject(i.errors))})),u.fail(NextGen.Logger.errorWrap(function(n){NextGen.Logger.error("Error updating account email: "+n);r.reject()})),r.promise()},RequestPasswordResetEmail:function(n){var t=$.Deferred(),r={},i;return $.each(n,function(){r[this.name]=this.value}),i=NextGen.Server.Account.RequestPasswordReset(r),i.done(NextGen.Logger.errorWrap(function(n,i,r){n.success===!0?t.resolve(n):(NextGen.Logger.error("Error requesting password reset"+n.errors+" "+NextGen.Utils.ExtractJsonErrorInfo(r)),t.reject())})),i.fail(NextGen.Logger.errorWrap(function(n){NextGen.Logger.error("Error requesting password reset"+n);t.reject()})),t.promise()},SignInUser:function(i,r){var e=r===!0?NextGen.Server.Components.CreateIdentity:NextGen.Server.Components.SignIn,u=$.Deferred(),f=e(i);return NextGen.InputChangeManager.StartChangeTracking(),f.done(function(i,f,e){i.success===!0?(NextGen.SetEditingExisting(i.hasSubmittedPreviously),NextGen.SetHasCancellableItems(i.hasCancellableModules),NextGen.Messaging.Publish("Authentication_SignIn",{username:i.loggedInUsername}),NextGen.ComponentController.WaitForComponentsToLoad().then(function(){n.loggedInUserName=i.loggedInUsername;n.hasContact=!!i.hasContact;n.contactId=i.contactId;n.eventId=i.eventId;t();u.resolve(i)})):(r?NextGen.Alerts.warning(i.errors):NextGen.Messaging.Publish("Authentication_AttemptFailed"),NextGen.Logger.error("Error signing in user"+i.errors+" "+NextGen.Utils.ExtractJsonErrorInfo(e)),u.reject(i))}),f.fail(function(n){NextGen.Logger.error("Error signing in user"+n.statusText);u.reject()}),u.promise()},SignOutUser:function(){NextGen.InputChangeManager.StopChangeTracking();var i=$.Deferred(),r=NextGen.Server.Components.SignOut();return r.done(function(r,u,f){r.success===!0?(NextGen.PageManager.NavigateToLoginPage(),n.loggedInUserName=null,n.hasContact=null,t(),NextGen.Messaging.Publish("Authentication_SignOut",{username:r.loggedInUsername}),i.resolve(r)):(NextGen.Logger.error("Error signing out user "+r.errors+" "+NextGen.Utils.ExtractJsonErrorInfo(f)),i.reject())}),r.fail(function(n){NextGen.Logger.error("Error signing out user "+n);i.reject()}),i.promise()},InitiateExternalSignIn:function(n){NextGen.Server.Account.ExternalLogin(n)},InitiateExternalSingleSignIn:function(n){NextGen.Server.Account.SSOLogin(n)},VerifyAccount:function(n){var t=$.Deferred(),i=NextGen.Server.Components.VerifyAccount(n);return i.done(function(n){t.reject(n)}),i.fail(function(n){NextGen.Logger.error("Error verifying account "+n);t.reject()}),t.promise()},AssociateAccount:function(n){var t=$.Deferred(),i=NextGen.Server.Components.AssociateAccount(n);return i.done(function(n){t.resolve(n)}),i.fail(function(n){NextGen.Logger.error("Error verifying account "+n);t.reject()}),t.promise()},VerifyEmail:function(n){var t=$.Deferred(),i=NextGen.Server.Components.VerifyEmail(n);return i.done(function(n){t.resolve(n)}),i.fail(function(n){NextGen.Logger.error("Error verifying email "+n);t.reject()}),t.promise()},ValidatePasscode:function(i){var r=$.Deferred(),u=NextGen.Server.Components.ValidatePasscode(i);return u.done(function(i,u,f){if(i.loggedInUsername){NextGen.InputChangeManager.StartChangeTracking();i.success===!0?(NextGen.SetEditingExisting(i.hasSubmittedPreviously),NextGen.SetHasCancellableItems(i.hasCancellableModules),NextGen.Messaging.Publish("Authentication_SignIn",{username:i.loggedInUsername}),NextGen.ComponentController.WaitForComponentsToLoad().then(function(){n.loggedInUserName=i.loggedInUsername;n.hasContact=!!i.hasContact;n.contactId=i.contactId;n.eventId=i.eventId;t();r.resolve(i)})):(createNewUser?NextGen.Alerts.warning(i.errors):NextGen.Messaging.Publish("Authentication_AttemptFailed"),NextGen.Logger.error("Error signing in user"+i.errors+" "+NextGen.Utils.ExtractJsonErrorInfo(f)),r.reject(i));return}r.resolve(i)}),u.fail(function(n){NextGen.Logger.error("Error validating passcode "+n);r.reject()}),r.promise()}}}();
//# sourceMappingURL=components_d72ad7a23479481d8a4f0e51b567a141.map
var NextGen=NextGen||{};NextGen.SubmissionDataManager=function(){function t(n){function i(n,i){t[n]=t.hasOwnProperty(n)?t[n].add(i):i}var t={};return n.find("[name]:input:not(button, .core-component-data, [data-nosubmit])").each(function(n,t){var r=$(t);r.closest(".component").css("display")!=="none"&&i(t.name,r)}),t}function i(n,i){function h(n){return i?n:o+"."+n}function f(n,t){u[h(n)]=t}var u={},r=n.Scope.find("form.dynamic-target"),o=r.find("[name='ComponentConfigurationId']").val(),s,e;return r&&r.parent()&&r.parent().data()&&r.parent().data().submit===!1?u:(s=t(r),e=0,$.each(s,function(n,t){if(t.data()&&t.data().submit===!1)return!0;f(n,NextGen.InputManager.GetInputValue(t));e++}),e>0&&(f("componentConfigurationId",o),f("clientDateTimeWithOffset",(new Date).toISOString())),u)}function n(n,t){var r={},u=NextGen.ComponentController.GetAllComponents();return $.each(u,function(u,f){if(n.apply(this,[f])){var e=i(f,t);$.each(e,function(n,t){r[n]=t})}}),r}return{GetAllComponentData:function(t){return n(function(){return!0},t)},GetAllDataEntryComponentData:function(){var t=NextGen.PageManager.GetDataEntryPageNumbers();return n(function(n){return _.contains(t,n.PageNumber)},!1)},GetAllDataEntryWithGroupComponentData:function(){var t=NextGen.PageManager.GetDataEntryWithGroupPageNumbers();return n(function(n){return _.contains(t,n.PageNumber)},!1)},GetAllNonDataEntryComponentData:function(){var t=NextGen.PageManager.GetDataEntryPageNumbers();return n(function(n){return!_.contains(t,n.PageNumber)},!1)},GetNamedComponentData:function(t,i){return n(function(n){return n.Name===t},i)}}}();
//# sourceMappingURL=components_d72ad7a23479481d8a4f0e51b567a141.map
var NextGen=NextGen||{};NextGen.SubmitManager=function(){function i(n){var t=$("#payment-captcha-info").hide(),r=$("#payment-captcha-failed").hide(),i=$("#payment-captcha-nothuman").hide();n.Human?n.Human==="possibly_not_human"?(t.show(),NextGen.CaptchaManager.Create($("#payment-captcha-target"),!0)):n.Human==="definitely_not_human"&&(i.show(),NextGen.ScrollManager.ScrollToElement(i)):n.CaptchaFailed&&(NextGen.CaptchaManager.Reset(),t.show(),r.show(),NextGen.CaptchaManager.Create($("#payment-captcha-target"),!0))}function r(n){var t=n.error?n.error:"";try{t=JSON.parse(t).Message}catch(i){}return t.toLowerCase().indexOf("there is no contact present to process the submission")>=0&&(t=NextGen.Localization.Messages.SiteSubmit.FailedWithNoContact()),t||(t=n.message),t}function u(n){localStorage.setItem("cid",n)}function f(){var a=$('[data-processor="CreditCard"]:visible').length===1&&$('[name="GatewayType"]').val()==="ThreeTier",v=$('[data-processor="PayPal"]:visible').length===1,e=$('[data-processor="EventsAirPayments"]:visible').length===1,y=$('[data-processor="DirectDebit"]:visible').length===1,p=a||v||y||e,i,o,s,u,c,l,f;t=e;i=NextGen.Utils.GetAntiForgeryToken("__PaymentAntiForgeryContainer");o=p?NextGen.Server.Site.SubmitPendingPayment:i!==null?NextGen.Server.Site.SubmitWithPayment:NextGen.Server.Site.Submit;try{s=localStorage.getItem("cid")}catch(w){errorMessage="Error retrieving contact id"}var n={editingExisting:NextGen.EditingExisting,finalSubmission:!0,chargeTo:NextGen.Web.Url.GetParameter(NextGen.Web.Url.QueryStringKeys.ChargeTo),noInvoice:NextGen.Web.Url.GetParameter(NextGen.Web.Url.QueryStringKeys.NoInvoice),agentId:NextGen.Web.Url.GetParameter(NextGen.Web.Url.QueryStringKeys.LinkToAgent),groupCoordinatorId:NextGen.Web.Url.GetParameter(NextGen.Web.Url.QueryStringKeys.LinkToGroupCoordinator),paymentProcessor:NextGen.PaymentManager.GetCurrentPaymentProcessor(),queryString:location.search.substring(1),contacts:[],cid:s},r=NextGen.PaymentManager.GetCurrentPaymentComponent(),h=r?r.GetSelectedPaymentScheduleIds():null;return h&&(n.selectedPaymentScheduleIds=h),u=r?r.GetSelectedAdditionalOptionGatewayDetails():null,u&&(n.selectedAdditionalOptionGatewayId=u.additionalPaymentOptionGatewayId,n.selectedAdditionalOptionIndex=u.selectedIndex),NextGen.GroupManager.IsGroupSubmission()?(NextGen.PageManager.PaymentPageExists()&&(c=NextGen.SubmissionDataManager.GetNamedComponentData("NextGen.Online.Components.Client.Payment.PaymentComponent"),NextGen.GroupManager.UpdateGroupContactPostData(c)),n.contacts=NextGen.GroupManager.GetAllContactPostData()):(l={componentSubmissionData:NextGen.SubmissionDataManager.GetAllComponentData(),visiblePageNumbers:NextGen.Logic.Processor.GetVisiblePageNumbersForPosting(),contactNumber:NextGen.GroupManager.GetCurrentContactNumber()},n.contacts.push(l)),f={},i&&(f=$.extend(f,{__RequestVerificationToken:i}),n=$.extend(n,NextGen.CaptchaManager.GetData()),n.captchaToken=i),o(n,f)}function e(){var n=$.Deferred();return f().done(function(t){t.success===!0?(t.message&&NextGen.Logger.info("Submission successful with message: "+t.message),n.resolve(t)):(i(t),n.reject(r(t)))}).fail(function(t){n.reject(t.statusText||"Could not submit to the server.")}),n.promise()}var n=!1,t=!1;return{Submit:function(){if(NextGen.ValidationManager.IsSessionTimedOut())return $.Deferred().reject(NextGen.Localization.Messages.Validation.SessionExpiredError()).promise();if(n)return $.Deferred().reject("Cannot submit as a submit operation is already in progress.").promise();n=!0;t=!1;NextGen.InputChangeManager.StopChangeTracking();var i=new $.Deferred;return NextGen.InventoryManager.EnforceInventoryHolds().done(function(){NextGen.Messaging.Publish("Site_Submitting");e().done(function(r){n=!1;NextGen.Messaging.Publish("Site_Submitted",{contactId:r.contactId,contactIdentifier:r.contactIdentifier,gatewayReceiptNumber:r.gatewayReceiptNumber,authorizationCode:r.authorizationCode,submittingEventsAirPayments:t});t=!1;i.resolve(r)}).fail(function(r){n=!1;t=!1;i.reject(NextGen.Localization.Messages.SiteSubmit.Failed()+"<br/>"+r)})}).fail(function(){n=!1;t=!1;i.reject(NextGen.Localization.Messages.InventoryHolds.Unverified())}),i.promise()},IsSubmissionHappening:function(){return n},SetCid:function(n){u(n)}}}();
//# sourceMappingURL=components_d72ad7a23479481d8a4f0e51b567a141.map
var NextGen=NextGen||{};NextGen.TemplateManager=function(){function i(n){return!n?"global scope":'component scope "'+n.Name+'" ('+n.Id+")"}function r(r,e,o){var a=n.get(r,e),h,c,v,s,l;if(n.remove(a,e),h=r.data("templateplaceholder"),c=t.get(h,e),c===null)throw new Error('Could not find template named: "'+h+'" in '+i(e)+".");if(v=r.data("templatesource"),s=u(v),s===null)throw new Error('Could not locate source element for template: "'+h+'" in '+i(e)+".");l=f(s);r.empty().html(c(l));s.val(JSON.stringify(l));s.trigger("change");a={templateName:h,template:c,placeholderElement:r,sourceElement:s,templateData:l,postRebindScopeFunction:o};n.add(a,e)}function u(n){if(n){var t=$("#"+n);if(t.length===1)return t}return null}function f(n){try{var t=n.val();return t!==""?JSON.parse(t):{}}catch(i){return NextGen.Logger.error("Error parsing template data source (#"+n.attr("id")+")"),NextGen.Logger.error(i),{}}}function e(t,r,u,f){var e=n.get(t,r),h,s,o;if(!e){h=t.data("templateplaceholder");throw new Error('Could not locate applied template: "'+h+'" in '+i(r)+".");}return(s=u(e.templateData),s===!1)?$.Deferred().resolve().promise():(e.templateData=s,o=$.Deferred(),setTimeout(function(){try{var i=null,u=null,n=null;f&&(i=$(document.activeElement),u=$.contains(t[0],i[0]),e.placeholderElement.empty().html(e.template(e.templateData)),u&&(n=$("#"+i.attr("id")),n&&n.length===1&&n.focus()),$.isFunction(e.postRebindScopeFunction)&&e.postRebindScopeFunction(r,e.placeholderElement));e.sourceElement.val(JSON.stringify(e.templateData));e.sourceElement.trigger("change");u&&(n&&n.length===1||i.attr("data-select2-focus")&&(n=$("#"+i.attr("data-select2-focus")),n.length===1&&n.select2("focus")));o.resolve()}catch(s){NextGen.Logger.error(s);o.reject(s)}},1),o.promise())}function o(n){return JSON.parse(JSON.stringify(n))}function s(t,i){var r=n.get(t,i);return r?o(r.templateData):null}Handlebars.registerHelper("withDefault",function(n,t){var u=t.hash["default"],i=t.hash.name,r=typeof n!="undefined"?n:u;return i&&(this[i]=r),r});Handlebars.registerHelper("formatCurrency",function(n){var t=typeof n!="undefined"?n:0;return parseFloat(Math.round(t*100)/100).toLocaleString(undefined,{minimumFractionDigits:2,maximumFractionDigits:2})});Handlebars.registerHelper("formatLongDate",function(n){return moment(n).format("dddd, MMMM DD, YYYY")});Handlebars.registerHelper("pluralize",function(n,t,i){return n===1?t:i});Handlebars.registerHelper("equal",function(n,t,i){return n===t?i.fn(this):i.inverse(this)});Handlebars.registerHelper("exists",function(n,t){return typeof n!="undefined"?t.fn(this):t.inverse(this)});Handlebars.registerHelper("repeat",function(n,t){for(var i="",r=0;r<n;r++)i=i+t.fn({index:r+1});return i});Handlebars.registerHelper("countGreaterThan",function(n,t,i){var r=+t;return!isNaN(r)&&n&&n.length>r?i.fn(this):i.inverse(this)});Handlebars.registerHelper("inc",function(n){return parseInt(n)+1});Handlebars.registerHelper("sum",function(n,t){for(var i=0,r=0,u=n.length;r<u;r++)i=i+parseFloat(n[r][t]);return i.toFixed(2)});Handlebars.registerHelper("sumCurrency",function(n,t){for(var i=0,r=0,u=n.length;r<u;r++)i=i+parseFloat(n[r][t]);return i.toFixed(2)});var n=function(){function t(t){return n[t.Id]||(n[t.Id]=[]),n[t.Id]}function i(n,t){for(var r,i=0;i<n.length;i++)if(r=n[i],t.call(n,i,r))return r;return null}var n={};return{get:function(n,r){return i(t(r),function(t,i){return i.placeholderElement.is(n)})},add:function(n,i){t(i).push(n)},remove:function(n,i){if(n){var r=t(i),u=r.indexOf(n);u>=0&&r.splice(u,1)}},dispose:function(t){n[t.Id]=[]}}}(),t=function(){function t(t){return n[t.Id]||(n[t.Id]={}),n[t.Id]}function r(n,t){return!n?"global."+t:n.Id+"."+t}var n={};return{get:function(n,i){var u=r(i,n),f=t(i);return f[u]||null},add:function(n,u){var f=n.data("templatename"),e=r(u,f),o=t(u);o[e]!==undefined&&NextGen.Logger.info('Template "'+f+'" overridden in '+i(u)+".");o[e]=Handlebars.compile(n.html())},dispose:function(t){n[t.Id]={}}}}();return{RegisterComponentTemplates:function(n){$(n.Scope).find('script[type="text/x-handlebars-template"][data-templatename]').each(function(){t.add($(this),n)})},RegisterTemplate:function(n,i){$(n).is('script[type="text/x-handlebars-template"][data-templatename]')&&t.add($(n),i)},ApplyComponentTemplates:function(n,t){$(n.Scope).find("[data-templateplaceholder][data-templatesource]").each(function(i,u){r($(u),n,t)})},ApplyTemplate:function(n,t,i){$(n).is("[data-templateplaceholder][data-templatesource]")&&r($(n),t,i)},MutateAppliedTemplateData:function(n,t,i,r){return $.isFunction(r)&&$(n).is("[data-templateplaceholder][data-templatesource]")?e($(n),t,r,i===undefined?!1:!!i):$.Deferred().resolve().promise()},GetAppliedTemplateData:function(n,t){return $(n).is("[data-templateplaceholder][data-templatesource]")?s($(n),t):null},DisposeComponentTemplates:function(i){t.dispose(i);n.dispose(i)}}}();
//# sourceMappingURL=components_d72ad7a23479481d8a4f0e51b567a141.map
var NextGen=NextGen||{};NextGen.ValidationPriority={Earliest:1,Normal:2};NextGen.ValidationManager=function(){function e(n){var t=$(n).data("validation");t&&typeof t=="string"&&(t=JSON.parse(t));t&&typeof t=="object"&&$(n).rules("add",t)}function o(n){return n.validate({normalizer:function(n){return $.trim(n)}}),$(n).find(":input").not('input[type="hidden"], input[type="button"], button, .ignore-validation, .ignore-validation *, .ignored-by-logic').each(function(n,t){e($(t))}),n.valid()}function c(n){return{name:n.Name,validator:o,priority:NextGen.ValidationPriority.Normal,formSelector:"form.dynamic-target"}}function l(n,t){var i=null;return $.each(u,function(r,u){return u.name===n.Name&&u.formSelector===t?(i=u,!1):!0}),i}function a(n){return $(n.Scope).css("display")==="none"}function n(n,t){function u(n){return i[n]||(i[n]=[]),i[n]}var i={},r=[].concat(t),f=NextGen.ComponentController.GetAllComponents();return $.each(f,function(i,f){if((t===undefined||$.inArray(f.PageNumber,r)!==-1)&&!a(f)){var o=l(f,n),e=[];o&&e.push(o);e.push(c(f));$.each(e,function(t,i){var r,e;i.formSelector===n&&(r=f.Scope.find(i.formSelector),r.length!==0)&&(e=u(i.priority),e.push({form:r,validate:i.validator}))})}}),i}function t(n){var y,p,w;try{var u=!0,g=[],t=[];$.each(n,function(n,i){u&&$.each(i,function(n,i){var r,e,f;g.push(i.form);r=i.validate(i.form);r.promise?t.push(r):(e=r===!1||r.hasOwnProperty("isValid")&&r.isValid===!1,f=$.Deferred(),e?(f.reject(),u=!1):f.resolve(),t.push(f.promise()))})});var f="",e=[],o=0,s="",h=[],c=0,l="",a=[],v=0,nt=_.chain(g).flatten().map(function(n){return n[0]}).uniq().value();return $.each(nt,function(n,t){var i=$(t),u,y,p;b(i)===!0&&(u=r(i,f,o,e),f=u.componentName,o=u.selectedRadioGroup,e=u.radioGroup);k(i)===!0&&(y=r(i,s,c,h),s=y.componentName,c=y.selectedRadioGroup,h=y.radioGroup);d(i)===!0&&(p=r(i,l,v,a),l=p.componentName,v=p.selectedRadioGroup,a=p.radioGroup)}),y=i(e,o,f,t),u=y.allValid,t=y.promises,p=i(h,c,s,t),u=p.allValid,t=p.promises,w=i(a,v,l,t),u=w.allValid,t=w.promises,$.when.apply(this,t)}catch(tt){return NextGen.Alerts.danger(NextGen.Localization.Messages.Error.Unexpected()),NextGen.Logger.error(tt),$.Deferred().reject().promise()}}function i(n,t,i,r){var u=!0;return n.length!==t&&(y(i),r.push($.Deferred().reject().promise()),u=!1),{allValid:u,promises:r}}function r(n,t,i,r){return t.length===0&&(t=v(n)),p(n)===!0&&($.each(s(n,!0,!0),function(n,t){$.inArray(t,r)==-1&&r.push(t)}),i+=w(n)),{componentName:t,selectedRadioGroup:i,radioGroup:r}}function v(n){return n.parent().prev(".component").find("h2")}function y(n){n=n&&n.length>0?n.text().trim():"";NextGen.Alerts.warning(NextGen.Localization.Messages.Validation.SelectRadioButtonOption(n))}function p(n){return $(n).find(":radio").not('[name*="cst_"]').not(".ignored-by-logic").length>0}function s(n,t,i){var r=[],u=$(n).find(":radio").not('[name*="cst_"]');return t===!1&&(u=u.not('[data-inputtype^="PageRadioGroup"]')),u.each(function(t,u){var o=$(u),f,e;o.hasClass("ignored-by-logic")||(f=o.attr("data-inputtype"),n.PageNumber||(n.PageNumber=n.closest("[data-page]").data("page")),e=i===!0?"Page_"+n.PageNumber+"_"+f:f,$.inArray(e,r)===-1&&r.push(e))}),r}function w(n){return $(n).find(":radio:checked").not('[name*="cst_"]').length}function b(n){return $(n).find('[data-inputtype$="_RegistrationType"]').length>0}function k(n){return $(n).find('[data-inputtype$="MarketingTag"]').length>0}function d(n){return $(n).find('[value="NextGen.Online.Components.Client.Functions.FunctionsComponent"]').length>0}function g(n){var t,i,r,u,e,f;for(r=0,f=n.split("").reverse(),i=u=0,e=f.length;u<e;i=++u)t=f[i],t=+t,i%2?(t*=2,r+=t<10?t:t-9):r+=t;return r%10==0}function nt(n,t){for(var i,r,e,u,o=[{name:"AmericanExpress",pattern:/^3[47]/,validLength:[15]},{name:"DinersClubCarteBlanche",pattern:/^30[0-5]/,validLength:[14]},{name:"DinersClubInternational",pattern:/^36/,validLength:[14]},{name:"Jcb",pattern:/^35(2[89]|[3-8][0-9])/,validLength:[16]},{name:"Laser",pattern:/^(6304|670[69]|6771)/,validLength:[16,17,18,19]},{name:"VisaElectron",pattern:/^(4026|417500|4508|4844|491(3|7))/,validLength:[16]},{name:"VisaCard",pattern:/^4/,validLength:[16]},{name:"MasterCard",pattern:/^5[1-5]|2[1-5]/,validLength:[16]},{name:"Maestro",pattern:/^(5018|5020|5038|6304|6759|676[1-3])/,validLength:[12,13,14,15,16,17,18,19]},{name:"Discover",pattern:/^(6011|622(12[6-9]|1[3-9][0-9]|[2-8][0-9]{2}|9[0-1][0-9]|92[0-5]|64[4-9])|65)/,validLength:[16]}],f=0;f<o.length;f++)if(i=o[f],i.name===n&&(r=t.replace(/[ -]/g,""),r.match(i.pattern))){for(e=!1,u=0;u<i.validLength.length;u++)i.validLength[u]===r.length&&(e=!0);if(e===!0&&g(r))return!0}return!1}function tt(n,t){var r,i,u;if(!t||!$.isNumeric(t))return!1;for(r=[{name:"AmericanExpress",validLength:4},{name:"DinersClubCarteBlanche",validLength:3},{name:"DinersClubInternational",validLength:3},{name:"Jcb",validLength:3},{name:"Laser",validLength:3},{name:"VisaElectron",validLength:3},{name:"VisaCard",validLength:3},{name:"MasterCard",validLength:3},{name:"Maestro",validLength:3},{name:"Discover",validLength:3}],i=0;i<r.length;i++)if(u=r[i],u.name===n&&u.validLength===t.length)return!0;return!1}function it(n,t){if(!$.isNumeric(n)||!$.isNumeric(t))return!1;var i=moment({day:1}),r=moment({year:parseInt(t),month:parseInt(n)-1,day:2});return i.isBefore(r)}function h(n){var i=n.attr("name"),t=i.match("_NoOption$");return t&&t.length>0}function rt(n){var t=parseInt(n.toString().replace(/,/g,""),10);return isNaN(t)?0:t}function ut(n,t){var i=null;return $.each(n,function(n,t){var r=$(t),u,f;return(r.is(":checkbox")&&r.is(":checked")===!0&&(i=r.val()),(i===null||i==="")&&r.is(":radio")&&(u=!1,r.each(function(n,t){var r=$(t);r.is(":checked")&&(h(r)?u=!0:i=r.attr("name"))}),u===!0))?"":((i===null||i==="")&&r.is(":text")&&r.data("type")==="number"&&(f=rt(r.val()),f>0&&(i=f)),i!==null&&i!==""?!1:void 0)}),(i===null||i==="")&&n.length===1&&(i=n.val()),i||$(t).find(".select2-chosen").closest(".form-control").not('[id*="cst"]').each(function(n,t){var r=$(t).select2("val");return r&&(i=r==="0"?"":r,i)?!1:!0}),i||""}function ft(n,t){var i=!1,r;return r=t?$(n).find(".form-group").not(".cstField").find(":input").not('input[type="text"]').not('input[type="hidden"]'):$(n).find(".form-group").not(".cstField").find(":input").not('input[type="hidden"]'),r.each(function(n,r){var u=$(r);return u.is(":checkbox")||u.is(":radio")?(i=u.is(":checked"),i===!0&&(i=!h(u))):u.is("select")?i=!(u.value==="0"||u.value===""):t||(i=u.val().length>0),!i}),i}function et(n,t){n.attr("custom-error","true");n.nextAll('[name="tempValidationMessage"]').remove();n.after($('<div name="tempValidationMessage" class="custom-error"><label for="'+n.attr("id")+'" class="custom-error control-label" style="font-weight:bold;color:#a94442">'+t+"<\/label><\/div>"))}function ot(n){n.removeAttr("custom-error");n.nextAll('[name="tempValidationMessage"]').remove()}function st(n){return n.attr("custom-error")==="true"}function ht(n){var t="";return n.length>0&&(t=n.first().parent().find("h3").first()),t.length===0&&(t=n.first().find("label").first()),t}function ct(n){var t=!0;return $(n).has('[name^="cst_"]').each(function(n,i){var r=$(i),f=r.find(".form-group").not(".cstField"),u,h,e;f.length===0&&(f=r.find(".row.has-feedback").not(".cstField"));u=$(f).find(":input").not(":hidden").not(".select2-offscreen").not(".select2-search__field").not('[name*="GuestName"]').not('[name$="APTitle"],[name$="APFirstName"],[name$="APLastName"],[name$="DiscountCodeKey"]');u.length===0&&(u=$(f).find("select"),u.length>0&&(u=u.not('[name*="GuestName"]').not('[name$="APTitle"],[name$="APFirstName"],[name$="APLastName"],[name$="DiscountCodeKey"]')));u.length===0&&(h=r.find(".row.has-feedback").not(".cstField"),u=$(h).find(":input").not(":hidden").not(".select2-offscreen").not('[name*="GuestName"]').not('[name$="APTitle"],[name$="APFirstName"],[name$="APLastName"],[name$="DiscountCodeKey"]'));e=ut(u,r);e===""&&(e=r.find(".booking-detail-row").length?"HotelBookings":"");var c=$(u).attr("required"),o=e==="",s=ht(f),l=st(s);r.find(':input[name^="cst_"]').add(r.find("iframe")).not(":hidden").each(function(n,i){var u=$(i),f=u.val(),a=!1,y=!1,h=!1,e;u.is("iframe")===!0?(u=r.find(':input[name^="cst_"][name$="_html"]'),f=u.val()):u.is(":checkbox")||u.is(":radio")?(u.is(":checked")===!0&&u.val()!==""&&(y=!0),a=!0):u.is(":file")&&(u.closest(".file-input.file-input-new.has-error").text()&&(t=!1),e=u.parents(".row").find(':input[name$="__OriginalFilename"]'),e.length>0&&(e=$(e[0]),h=e.attr("required")&&e.attr("required")==="required",h===!0?u.attr("required","true").removeAttr("originalAttibute"):u.removeAttr("required")),f=u.closest(".file-input").find(".file-caption-name").text().trim(),f&&f.length>0&&h&&u.attr("originalAttibute","required").removeAttr("required"));var p=f===""||f===null,w=u.is(":file")?h:u.attr("required"),b=u.attr("originalAttibute"),v=!a&&!p||a&&y;o&&!v&&w?(u.attr("originalAttibute","required").removeAttr("required"),u.valid&&u.valid()):o&&v&&!c?(et(s,NextGen.Localization.Messages.Validation.RequiredField()),t=!1):o||(b&&!v&&u.attr("required","true").removeAttr("originalAttibute"),l&&ot(s))});r.find("iframe:hidden").each(function(){var n=r.find(':input[name^="cst_"][name$="_html"]'),t=n.attr("required");t&&(n.attr("originalAttibute","required").removeAttr("required"),n.valid&&n.valid())});r.find(':input[data-type="date"]').each(function(n,i){var u=$(i),r=u.val();if(r&&(t=new Date(r)!=="Invalid Date"&&!isNaN(new Date(r)),u.isValid=t,!t))return!1})}),t}function lt(n,t){const r=/^(?!.*�)(?!.*\.\.)[a-zA-Z0-9!#\$%&'\*\+\-\/=\?\^_`{\|}~]+(?:\.[a-zA-Z0-9!#\$%&'\*\+\-\/=\?\^_`{\|}~]+)*@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/;if(t===!0){var u=!0,i=n.split(new RegExp(" |,|;|\n","g"));return i=$.grep(i,function(n){return n}),$(i).each(function(n,t){return f.test(t.toLowerCase())===!1||!r.test(t.toLowerCase())?(u=!1,!1):!0}),u}return f.test(n.toLowerCase())&&r.test(n.toLowerCase())}function at(n){var i=!0,t=$(n).find('[id*="anchor_"]'),r=NextGen.Localization.Messages.Validation.SelectRadioButtonOption(),u;return t&&t.length>0&&(t=t.text().trim(),r=NextGen.Localization.Messages.Validation.SelectRadioButtonOption(t)),u=s(n,!1,!1),$.each(u,function(t,u){if(typeof u!="undefined"){var f=$(n).find('[data-inputtype="'+u+'"]');f.filter(":checked").length===0&&(NextGen.Alerts.warning(r),i=!1)}}),i}function vt(n){var t,i;return document.cookie.length>0&&(t=document.cookie.indexOf(n+"="),t!==-1)?(t=t+n.length+1,i=document.cookie.indexOf(";",t),i===-1&&(i=document.cookie.length),unescape(document.cookie.substring(t,i))):""}function yt(n,t,i){var u,r;t?(r=new Date,r.setTime(r.getTime()+t*36e5),u="; expires="+r.toGMTString()):u="";document.cookie=n+"="+i+u+"; path=/"}var u=[],f=/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?$/;return{Initialize:function(){$.extend($.validator.messages,NextGen.Localization.Messages.Validation.CustomTranslations());$.validator.setDefaults({debug:!1,errorClass:"has-error has-feedback",ignore:".ignore-validation, .ignore-validation *, .ignored-by-logic",highlight:function(n,t,i){if(n.type==="radio"?this.findByName(n.name).closest("div.form-group").addClass(t).removeClass(i):$(n).closest("div.form-group").addClass(t).removeClass(i),$(n).hasClass("select2-offscreen"))$(n).on("change.ValidationManager",NextGen.Logger.errorWrap(function(){typeof $(this).data("validation")=="object"&&$(this).valid()}))},unhighlight:function(n,t,i){n.type==="radio"?this.findByName(n.name).closest("div.form-group").removeClass(t).addClass(i):$(n).closest("div.form-group").removeClass(t).addClass(i);$(n).hasClass("select2-offscreen")&&$(n).off("change.ValidationManager")},errorPlacement:function(n,t){n.addClass("control-label");n.attr("role","alert");var r=$(t),i=r.data("errorplacement");i?n.appendTo($("#"+i)):t.hasClass("input-sm")?t.after(n):t.closest("[class^=col-]").length>0?n.appendTo(t.closest("[class^=col-]")):n.appendTo(t.closest("div.form-group"))},focusInvalid:!1,invalidHandler:function(n,t){t.numberOfInvalids()&&NextGen.ScrollManager.ScrollToElement($(t.errorList[0].element))}});$.validator.addMethod("time",function(n,t){return this.optional(t)||/^(([0-1]?[0-9])|([2][0-4])):([0-5]?[0-9])(:([0-5]?[0-9]))?$/i.test(n)},NextGen.Localization.Messages.Validation.Valid24HourTime());$.validator.addMethod("fileExtension",function(n,t){var r=$(t),u,i,f;return r.attr("type")!=="file"?!0:(u=r.data("allowed-file-extensions"),!u)?!0:(i=r.val(),!i||i.length<=0)?!0:(f=i.split(".").pop(),_.contains(u.split(","),f))},function(n,t){var i=$(t),r=i.val(),u=i.data("allowed-file-extensions");return NextGen.Localization.Messages.FileUpload.UnsupportedFileExtension().replace(/\{name\}/g,r).replace(/\{extensions\}/g,u)});$.validator.addMethod("fileUploadCompleted",function(n,t){var r=$(t),u=r.val(),i;return!u||u.length<=0?!0:(i=r.data("sharedCacheKey"),i&&i.length>0)},NextGen.Localization.Messages.FileUpload.NotCompleted());$.validator.addMethod("customCallback",function(n,t,i){var r=i[0];if(typeof r!="function")throw new Error("customCallback validator rule is expecting a function parameter.");return this.optional(t)||r(n)})},ValidateAll:function(){var i=NextGen.PageManager.GetPagesToValidate(),r=n("form.dynamic-target",i);return t(r)},ValidatePages:function(i){var r=n("form.dynamic-target",i);return t(r)},ValidatePage:function(i){var r=n("form.dynamic-target",i);return t(r)},ValidatePageForCustomField:function(n){return ct(n)},ValidateForm:function(i){var r=n(i);return t(r)},ValidateWithTemporaryForm:function(i,r,u,f){var o,e,h,s;try{return r=r||"temporaryValidationForm"+NextGen.Utils.Random.IntWithDigits(8),i.wrap('<form id="'+r+'" />'),o=i.closest("form"),u&&$.isArray(u)&&$.merge(u,o.serializeArray()),e=n("form#"+r),f&&(e[NextGen.ValidationPriority.Earliest]||(e[NextGen.ValidationPriority.Earliest]=[]),h=e[NextGen.ValidationPriority.Earliest],h.push({form:o,validate:f})),s=t(e),s.always(function(){i.unwrap()}),s}catch(c){return i.unwrap(),NextGen.Alerts.danger(NextGen.Localization.Messages.Error.Unexpected()),NextGen.Logger.error(c),$.Deferred().reject().promise()}},RegisterCustomValidation:function(n,t,i,r){if(!n)throw new Error("Cannot register custom validation without a componentName");if(!$.isFunction(t))throw new Error("Cannot register custom validation without a function.");u.push({name:n,validator:t,priority:i||NextGen.ValidationPriority.Normal,formSelector:r||"form.dynamic-target"})},ValidateCreditCard:function(n,t){return nt(n,t)},ValidateCcv:function(n,t){return tt(n,t)},DefaultValidation:o,AttachValidationRules:e,ValidateEmail:function(n,t){return lt(n,t)},ValidatePageForRadioButton:function(n){return at(n)},HasValue:function(n,t){return ft(n,t)},ValidateCreditCardExpiry:function(n,t){return it(n,t)},RevalidateForm:function(n,t){return n.removeData("validator"),n.validate(t),n.find("input[data-validation]").each(function(n,t){NextGen.ValidationManager.AttachValidationRules(t)}),n.valid()},StartSessionTimer:function(){yt("session_timer",12,"start")},IsSessionTimedOut:function(){var n=vt("session_timer");return n===""}}}();
//# sourceMappingURL=components_d72ad7a23479481d8a4f0e51b567a141.map
(function(){function s(n){var t=n.Scope.find('input[data-inv-type="DiscountCode"]');t.length&&t.trigger("change")}function st(n){return NextGen.Server.AccommodationComponent.CheckIfInventoryAvailable(n)}function v(n,t){var r=t.Scope.find('select[name="edit-checkin-date_'+n+'"]'),i;return r.length===0&&(r=t.Scope.find('input[name="edit-checkin-date_'+n+'"]')),i=t.Scope.find('select[name="edit-checkout-date_'+n+'"]'),i.length===0&&(i=t.Scope.find('input[name="edit-checkout-date_'+n+'"]')),{checkInDate:moment(r.val()).format("YYYY-MM-DD"),checkOutDate:moment(i.val()).format("YYYY-MM-DD")}}function y(n,t){var u=t.Scope.find('[data-templateplaceholder="roomBookingDetails"]'),r=NextGen.TemplateManager.GetAppliedTemplateData(u,t),i;if(r.roomBookingDetails)return i=NextGen.Utils.FirstOrDefault(r.roomBookingDetails,function(t,i){return i&&i.bookingId===n}),i?i:null}function p(n){$("#booked_room_row_label_"+n+">span").removeClass("label-primary").addClass("label-danger").text("PENDING")}function w(n){$("#booked_room_row_label_"+n+">span").removeClass("label-danger").addClass("label-primary").text("BOOKED")}function ht(n,t){var i,r,u=t.Scope.find('select[name="CheckIn"]');return u.length===0?(i=moment($(".show-bookingdetail_"+n).find(".check-in-date").data("ref-checkin")).format("YYYY-MM-DD"),r=moment($(".show-bookingdetail_"+n).find(".check-out-date").data("ref-checkout")).format("YYYY-MM-DD")):(i=moment($(".show-bookingdetail_"+n+".check-in-date").data("ref-checkin")).format("YYYY-MM-DD"),r=moment($(".show-bookingdetail_"+n+".check-out-date").data("ref-checkout")).format("YYYY-MM-DD")),{checkInDate:i,checkOutDate:r}}function f(n,t){var i=$(n).attr("min"),r=$(n).attr("max"),u=moment(i,"YYYY-MM-DD"),f=moment(r,"YYYY-MM-DD");return f.isSameOrAfter(t)&&u.isSameOrBefore(t)?t:i}function b(n,t,i,r){var o=t.Scope.find('select[name="edit-checkin-date_'+n+'"]'),e,u;o.length===0?(o=t.Scope.find('input[name="edit-checkin-date_'+n+'"]'),u=f(o,i),$(o).val(u)):(u=f(o,i),$(o).val(u).trigger("change"));e=t.Scope.find('select[name="edit-checkout-date_'+n+'"]');e.length===0?(e=t.Scope.find('input[name="edit-checkout-date_'+n+'"]'),u=f(e,r),$(e).val(u)):(u=f(e,r),$(e).val(u).trigger("change"))}function n(n,t){$(n).each(function(n,i){t?$(i).removeClass("hidden"):$(i).hasClass("hidden")||$(i).addClass("hidden")})}function h(n,t,i,r){var e=i.Scope.find(".row.no-search-results"),o=i.Scope.find('[data-templateplaceholder="roomBookingTotal"]'),s=n.AvailableRoomTypes.length>0,u=e.length>0;u&&e.toggle(!s);o.length>0&&o.toggle(s);var c=i.Scope.find('[data-templateplaceholder="roomBookingDetails"]'),h=NextGen.TemplateManager.GetAppliedTemplateData(c,i),l=function(n){if(h.roomBookingDetails){var i=NextGen.Utils.FirstOrDefault(h.roomBookingDetails,function(i,r){return r&&r.roomTypeId===n&&r.selected&&r.checkInDate===t.checkInDate&&r.checkOutDate===t.checkOutDate});return i?i.bookingId:null}return null},f=!1;i.Scope.find(".row.hotel[data-hotel]").each(function(i,e){var o=!1;$(e).find(".row.room-type[data-roomtype]").each(function(i,r){var s=$(r),tt=s.data("roomtype"),h=NextGen.Utils.FirstOrDefault(n.AvailableRoomTypes,function(n,t){return t.RoomTypeId===tt.id}),it=s.find("span.room-row-amount"),b=s.find("span.currency-code"),e=s.find('button[name="add-room"]'),w=s.find("span.no-inventory"),c=s.find("button.booked-inventory"),a=l(tt.id),rt=s.find(".add-to-waitlist-message"),k=e.closest("[data-inv-waitlist-payment-status]"),v,y,d,p,g,nt;if(h){if(s.data("per-night-rates",h.PerNightRoomRates),it.html(NextGen.Localization.FormatCurrency(h.Amount)),b.show(),e.data("amount",h.Amount),e.data("depositAmount",h.DepositAmount),e.data("remaining",h.RemainingRooms),e.data("currency",b.text()),v=ct(h.PerNightRoomRates),v&&(y=moment(t.checkInDate),d=moment(t.checkOutDate),y.isValid()&&d.isValid())){for(p=0,g=[];y.isBefore(d,"day");)nt=null,Number.isNaN(v[p])||(nt=v[p].toFixed(2)),_.has(v,p.toString())&&g.push({date:y.format("yyyy-MM-DDTHH:mm:ss"),rate:nt}),y.add(1,"days"),p++;e.data("hotelRoomRates",g)}u&&!a?(s.parent().show(),o=!0,f=!0,e.show(),c.hide()):a?(e.hide(),w.hide(),c.show(),c.data("booking-id",a)):(e.show(),f=!0,w.hide(),c.hide());k&&(h.RoomCanBeWaitlisted?(k.data("inv-add-to-waitlist","true"),rt.show(),e.text(" "+e.data("invWaitlistLabel"))):(k.data("inv-add-to-waitlist","false"),rt.hide(),e.text(" "+e.data("invBooknowButtonLabel"))))}else it.empty(),b.hide(),e.data("amount",null),e.data("depositAmount",null),e.data("remaining",null),e.data("currency",null),s.removeData("per-night-rates"),s.removeData("hotelRoomRates"),u&&!a?s.parent().hide():a?(e.hide(),w.hide(),c.show(),c.data("booking-id",a)):(e.hide(),w.show(),c.hide())});r?($(e).toggle(!1),$(e).parent(".theme-panel").toggle(!1),$(e).parent(".theme-curved-display").toggle(!1),$(e).parent().next(".theme-curved-bottom-line").toggle(!1)):u?($(e).toggle(o),$(e).parent(".theme-panel").toggle(o),$(e).parent(".theme-curved-display").toggle(o),$(e).parent().next(".theme-curved-bottom-line").toggle(o)):($(e).show(),f=!0,$(e).parent(".theme-panel").show(),$(e).parent(".theme-curved-display").show(),$(e).parent().next(".theme-curved-bottom-line").show())});i.Scope.find(".accomodation-inbetween-parts").each(function(n,t){$(t).toggle(!r)});f===!0&&($(".accommodation-filter").show(),ii(i.Scope),pt(i.Scope))}function ct(n){try{return JSON.parse(n)}catch(t){return NextGen.Logger.error("Error parsing JSON : "+t,n),null}}function lt(n,t){return NextGen.Server.AccommodationComponent.HotelRoomTypeSearch(n).done(function(i){h(i,n,t,!1);NextGen.InventoryManager.Watch(t.Scope.find("div.row.hotel"))}).fail(function(i){NextGen.Alerts.danger(NextGen.Localization.Messages.HotelRoomTypeSearch.Failed());NextGen.Logger.error(i);h({AvailableRoomTypes:[]},n,t,!1)}).always(function(){$.each($('button[name="add-room"]',t.Scope),function(n,t){var i=$(t);i.data("inventoryInputWatcher")&&(i.inventoryInputWatcher().ClearAll(),i.prop("disabled",!1))})})}function k(n){return NextGen.ValidationManager.ValidateWithTemporaryForm(n.Scope.find("div#check-in-out"),"check-in-out")}function at(n){n.Scope.find('a[data-popup="terms-and-conditions"]').each(function(){NextGen.Controls.Lightbox.Create(this)});n.Scope.find(".hotel-photos").each(function(){NextGen.Controls.ImageGallery.Create(this)});n.Scope.find('a[data-popup="hotel-photos"]').on("click",t.events.hotelImagePopupClick);n.Scope.find(".room-type-photos").each(function(){NextGen.Controls.ImageGallery.Create(this)});n.Scope.find("a.view-room-type-photos").on("click",t.events.roomTypeImagePopupClick)}function d(n,t){var i=moment(n,"YYYY-MM-DD"),r=moment(t,"YYYY-MM-DD");return i.isValid()&&r.isValid()?r.diff(i,"days"):0}function vt(n,t){return!n||!n.length?!1:n.slice(0,t.length)==t}function g(n){var i=$(n).find('select[name="CheckIn"]'),t,r;i.length===0&&(i=$(n).find('input[name="CheckIn"]'));t=$(n).find('select[name="CheckOut"]');t.length===0&&(t=$(n).find('input[name="CheckOut"]'));r=$(n).find('button[id="updateResults"]');r.attr("disabled","disabled");i.attr("disabled","disabled");t.attr("disabled","disabled")}function nt(n){et(n)===!0&&(ot(n)===!0||NextGen.EditingExisting===!0&&e(n)===!1)&&($("#chkNoAccomodationRequired").prop("checked",!0),g(n))}function yt(n){if(NextGen.EditingExisting===!0&&e(n)===!0){var t=$(n).find('input[name^="cst_"]:radio:checked').length>0;t===!1&&$(n).find(':radio[name^="cst_"][id$="_NoOption"]').prop("checked",!0)}}function pt(n){$(n).find(".row.room-type").removeClass("use-for-filter");$(n).find(".row.hotel").removeClass("use-for-filter");tt(n);wt(n);bt(n);kt(n)}function wt(n){var t=$(n).find("#price-filter-items :checkbox");it(n,t,".row.room-type:visible",!0)}function bt(n){var t=$(n).find("#distance-filter-items :checkbox");rt(n,t,".row.hotel:visible",!0)}function kt(n){var t=$(n).find("#star-filter-items :checkbox");ut(n,t,".row.hotel:visible",!0)}function c(n,t){n.closest("div").find("span.count").remove();t>0&&n.closest("div").html(n.closest("div").html().trim()+' <span class="count">('+t+")<\/span>")}function tt(n){var t=gt(n),i=it(n,t,".row.room-type.use-for-filter",!1);if(t.length>0&&i.length===0){l();return}var r=ni(n),u=rt(n,r,".row.hotel.use-for-filter",!1);if(r.length>0&&u.length===0){l();return}var f=ti(n),e=ut(n,f,".row.hotel.use-for-filter",!1);if(f.length>0&&e.length===0){l();return}$(n).find(".row.hotel").removeClass("hidden-by-filter");$(n).find("#price-filter-items").length>0&&dt(n,i);$(n).find("#distance-filter-items").length>0&&ft(n,u);$(n).find("#star-filter-items").length>0&&ft(n,e)}function it(n,t,i,r){var u=[],f=!1;return t.each(function(t,e){var s=parseInt($(e).data("min")),h=parseInt($(e).data("max")),o=0;f=$(e).is($(n).find("#price-filter-items :checkbox").first());$(n).find(i).each(function(n,t){var e,c,i,l;r===!0&&$(t).addClass("use-for-filter");$(t).data("per-night-rates")&&(e=JSON.parse($(t).data("per-night-rates")),c=0,$.each(e,function(n,t){c+=t}),i=c/e.length,l=f===!0?i>=s:i>s,l&&i<=h&&(u.push(t),o=o+1))});r===!0&&c($(e),o)}),u}function rt(n,t,i,r){var u=[],f=!1;return t.each(function(t,e){var s=parseInt($(e).data("min")),h=parseInt($(e).data("max")),o=0;f=$(e).is($(n).find("#distance-filter-items :checkbox").first());$(n).find(i).each(function(n,t){var i=$(t).data("hotel"),e;r===!0&&$(t).addClass("use-for-filter");e=f===!0?i.distance>=s:i.distance>s;e&&i.distance<=h&&(u.push(t),o=o+1)});r===!0&&c($(e),o)}),u}function ut(n,t,i,r){var u=[];return t.each(function(t,f){var o=parseInt($(f).data("rating")),e=0;$(n).find(i).each(function(n,t){var i=$(t).data("hotel");r===!0&&$(t).addClass("use-for-filter");Math.floor(i.starRating)===o&&(u.push(t),e=e+1)});r===!0&&c($(f),e)}),u}function dt(n,t){$(n).find(".row.room-type.use-for-filter").each(function(n,i){var u=$(i).parents(".list-group-item");t.length>0?$.inArray(i,t)!==-1?(u.show(),r(u.parents(".row.hotel"))):u.hide():(u.show(),r(u.parents(".row.hotel")))});$(n).find(".row.hotel.use-for-filter").each(function(n,t){var i=$(t).find(".list-group-item.room-type-list:visible").length>0;i?r($(t)):($(t).addClass("hidden-by-filter"),a($(t)))})}function ft(n,t){$(n).find(".row.hotel.use-for-filter").not(".hidden-by-filter").each(function(n,i){t.length>0?$.inArray(i,t)!==-1?r($(i)):($(i).addClass("hidden-by-filter"),a($(i))):r($(i))})}function gt(n){return $(n).find("#price-filter-items :checkbox:checked")}function ni(n){return $(n).find("#distance-filter-items :checkbox:checked")}function ti(n){return $(n).find("#star-filter-items :checkbox:checked")}function l(){$(".row.hotel").each(function(){var n=$(this);a(n)})}function a(n){var t=n.parent(".container-accommodation");t.length&&t.hide();n.hide()}function r(n){var t=n.parent(".container-accommodation");t.length&&t.show();n.show()}function i(){$("[class*=msg-booking]").addClass("hidden")}function u(){$("[class*=-loader]").addClass("hidden")}function ii(n){$(n).find(".accommodation-filter :checkbox:checked").prop("checked",!1)}function ri(n){var i=n.find('[data-templateplaceholder="roomBookingDetails"] div.booking-details').not(":hidden"),t=[];return i.each(function(n,i){var r=$(i).find("select[id*='numberOfRooms_']"),u=NextGen.InventoryManager.IsInventoryAvailable("Accommodation","selectnumber",r);t.push(u)}),$.when.apply(this,t)}function e(n){var t=!1;return n.find('[data-templateplaceholder="roomBookingDetails"] div.booking-details').each(function(n,i){var r=$(i).find("#booked_container_fluid").find("#booked_room_detail_row"),u;r.length>0&&(u=r.first(),t==!1&&(t=u.length>0))}),t}function ui(n,t,i,r){$('[data-templateplaceholder="roomBookingDetails"] div.booking-details #booked_container_fluid [name="remove-cancel"]').each(function(t,i){$.proxy(n.onRemoveBookingButtonClick,i)()});var u={checkInDate:i.val(),checkOutDate:r.val()};return h({AvailableRoomTypes:[]},u,t,!0),!1}function fi(n){return n.find('select[name="CheckIn"]').length>0||n.find('input[name="CheckIn"]').length>0}function o(n,t){var i=t.parents(".booking-details").find('[name="remove-cancel"]');$(i).siblings().length===0&&$(i).after('<span class="label alert-warning pull-right" style="display:inline-block;margin-top: 7px; margin-right:20px">'+NextGen.Localization.Messages.InventoryCheck.Full()+"<\/span>")}function ei(n,t){var i=n.find('[data-templateplaceholder="roomBookingDetails"]').find('[data-inv-key="'+t.ParentId+'"]:button').first();$(i).siblings().remove()}function et(n){var t=$(n).find('input[id^="chkNoAccomodationRequired"]'),i=$(n).find(":checkbox");return t.length>0&&i.length>0?!0:!1}function ot(n){return $(n).find('input[id^="chkNoAccomodationRequired"]').is(":checked")}function oi(n){var i=$(n).find('input[data-inv-type="DiscountCode"]'),t=!0;return(i.each(function(n,i){var r=$(i);if(r.attr("required")&&r.is("[data-nosubmit]"))return t=!1,setTimeout(function(){r.focus()},1),!1}),t)?$.Deferred().resolve().promise():(NextGen.Alerts.danger(NextGen.Localization.Messages.Validation.ValidDiscountCodeRequired()),$.Deferred().reject().promise())}var t={};t.subscriptions=[];t.events={};t.events.hotelImagePopupClick=function(){var n=$(this).closest(".row.hotel").find("div.hotel-photos");return n.length>0&&NextGen.Controls.ImageGallery.Open(n),!1};t.events.roomTypeImagePopupClick=function(){var n=$(this).closest(".row.room-type").find("div.room-type-photos");return n.length>0&&NextGen.Controls.ImageGallery.Open(n),!1};t.events.onPageNavigated=function(n,t){t.component.PageNumber===n.toPage&&s(t.component)};NextGen.Logger.errorWrap(t.events);NextGen.ComponentController.RegisterOnComponentLoadCallback("NextGen.Online.Components.Client.Accommodation.AccommodationComponent",function(t){var r={},h=t.Scope.find('select[name="CheckIn"]'),c,f,e;h.length===0&&(h=t.Scope.find('input[name="CheckIn"]'));c=t.Scope.find('select[name="CheckOut"]');c.length===0&&(c=t.Scope.find('input[name="CheckOut"]'));f=t.Scope.find('[data-templateplaceholder="roomBookingDetails"]');at(t);yt(t.Scope);e=function(n,i,r,u){var c=function(t){var r,u;return n?(r=NextGen.Utils.FirstOrDefault(t.roomBookingDetails,function(t,i){return i&&i.bookingId===n}),r&&($.extend(!0,r,i),i.hotelRates&&r.hotelRates&&(r.hotelRates=i.hotelRates.slice(0)),r.totalAmount=r.amount*r.numberOfRooms,r.totalDepositAmount=r.depositAmount*r.numberOfRooms),r.selected===!1&&r.booked===undefined&&(u=t.roomBookingDetails.indexOf(r),t.roomBookingDetails.splice(u,1))):(i.contextId=i.bookingId,i.customFields={},t.roomBookingDetails||(t.roomBookingDetails=[]),t.roomBookingDetails.push(i)),t},h=NextGen.TemplateManager.MutateAppliedTemplateData(f,t,r,c);h.done(function(){for(var n,v,i,y,h=NextGen.TemplateManager.GetAppliedTemplateData(f,t),c=0,l=0,a=0,u=0;u<h.roomBookingDetails.length;u++)n=h.roomBookingDetails[u],n.selected&&(c+=n.totalAmount,l+=n.totalDepositAmount,a+=d(n.checkInDate,n.checkOutDate)*n.numberOfRooms);v=t.Scope.find('[data-templateplaceholder="roomBookingTotal"]');NextGen.TemplateManager.MutateAppliedTemplateData(v,t,r,function(n){return n.totalAmount=c,n.depositAmount=l,n.nights=a,n});r===!0&&(NextGen.InventoryManager.Watch(f),i=t.Scope.find('input[data-inv-type="DiscountCode"]'),i&&i.length>0&&(i.data("doNotFireChangeEvent",!1),s(t),i.removeData("doNotFireChangeEvent")));y=NextGen.Themes.HasTheme(t.Scope);y===!0&&NextGen.Themes.SetupTheme(t.Scope);f.find(".theme-textbox, .theme-select").not("div").each(function(){var n=$(this);n.val()&&n.addClass("field--not-empty")});$(t.Scope).find('[data-input-type="number"]').each(function(){var n=$(this);n.off("after-inventory-checked");n.on("after-inventory-checked",function(n,i){var r=$(this),f=r.closest("[data-booking]").data("booking"),u;r.closest("[data-booking]").data("isValidInventory",!0);i.type==="Waitlist"?(u=r.data("invWaitlistPaymentStatus"),e(f,{canBeWaitisted:!0,paymentStatus:u},!0)):i.type==="Rejection"?($(i.result.Rejections).each(function(){o($(t.Scope),r)}),r.closest("[data-booking]").data("isValidInventory",!1),r.closest("[data-booking]").data("rebind",!1)):(u=r.data("invOriginalPaymentStatus"),e(f,{canBeWaitisted:!1,paymentStatus:u},!0))})});$(t.Scope).find('input[data-inv-type="DiscountCode"]').each(function(){var n=$(this);n.off("after-inventory-checked");n.on("after-inventory-checked",function(n,t){var i=$(this);t.type==="Rejection"?i.data("rejection",!0):i.data("rejection",!1)})});f.find("div.file-caption-name").each(function(){var n=$(this);n.text()&&n.parents(".form-group").find(".theme-label-floating.theme-label-fixed-width").addClass("file-input-placeholder")})});$.isFunction(u)&&h.done(function(){u(n||i.bookingId)})};$(t.Scope).find('[data-input-type="number"]').each(function(){var n=$(this);n.off("after-inventory-checked");n.on("after-inventory-checked",function(n,i){var r=$(this),f=r.closest("[data-booking]").data("booking"),u;r.closest("[data-booking]").data("isValidInventory",!0);i.type==="Waitlist"?(u=r.data("invWaitlistPaymentStatus"),e(f,{canBeWaitisted:!0,paymentStatus:u},!0)):i.type==="Rejection"?($(i.result.Rejections).each(function(){o($(t.Scope),r)}),r.closest("[data-booking]").data("isValidInventory",!1),r.closest("[data-booking]").data("rebind",!1)):(u=r.data("invOriginalPaymentStatus"),e(f,{canBeWaitisted:!1,paymentStatus:u},!0))})});$(t.Scope).find('input[data-inv-type="DiscountCode"]').each(function(){var n=$(this);n.off("after-inventory-checked");n.on("after-inventory-checked",function(n,t){var i=$(this);t.type==="Rejection"&&i.data("rejection",!1)})});$(t.Scope).find("[id*=_carousel-selector-]").on("keyup click",function(n){var t,i,r;(n.which===13||n.keyCode===13||n.type==="click")&&(t=$(this).attr("id"),i=t.substr(t.length-1),i=parseInt(i),r=$(this).data("parent"),$("#"+r).carousel(i),$("[id^="+t.substr(0,t.length-1)+"]").removeClass("selected"),$(this).addClass("selected"))});r.onEditBookingDetailButtonClick=function(){var r=$(this).closest("[data-booking]").data("booking"),f;return n(["div.edit-bookingdetail_"+r],!0),n(["div.show-bookingdetail_"+r],!1),i(),u(),p(r),f=ht(r,t),b(r,t,f.checkInDate,f.checkOutDate),!1};r.onCancelEditBookingDetail=function(){var o=$(this).closest("[data-booking]").data("booking"),r=y(o,t),f={};return r&&(f.checkInDate=r.prevCheckInDate?r.prevCheckInDate:r.checkInDate,f.checkOutDate=r.prevCheckOutDate?r.prevCheckOutDate:r.checkOutDate,f.amount=r.prevAmount?r.prevAmount:r.amount,f.totalAmount=r.prevTotalAmount?r.prevTotalAmount:r.totalAmount,f.totalDepositAmount=r.prevTotalDepositAmount?r.prevTotalDepositAmount:r.totalDepositAmount,f.depositAmount=r.prevDepositAmount?r.prevDepositAmount:r.depositAmount,f.hotelRates=r.prevhotelRates?r.prevhotelRates.slice(0):r.hotelRates.slice(0),e(o,f,!0,null)),n(["div.edit-bookingdetail_"+o],!1),n(["div.show-bookingdetail_"+o],!0),u(),i(),w(o),!1};r.onCheckAvailabilityButtonClick=function(){var c=$(this),r=$(this).closest("[data-booking]").data("booking"),f=v(r,t),s,o,h;return $(this).find(".check-availability-loader").toggleClass("hidden"),s=!1,o=$('[name="groupPaymentOption"]'),o&&(s=o.is(":radio")?$('[name="groupPaymentOption"]:checked').val()==="AllToGroupContact":o.val()==="AllToGroupContact"),h={checkInDate:f.checkInDate,checkOutDate:f.checkOutDate,componentConfigurationId:t.Id,hotelId:$(this).data("hotelid"),bookingId:$(this).data("bookingid"),roomTypeId:$(this).data("roomtypeid"),numberOfRooms:$(this).data("numberofrooms"),isAllToGroupContact:s},st(h,t).done(function(u){if(i(),u.success){var o=y(r,t);data={};data.prevCheckInDate=o.checkInDate;data.prevCheckOutDate=o.checkOutDate;data.prevAmount=o.amount;data.prevTotalAmount=o.totalAmount;data.prevDepositAmount=o.depositAmount;data.prevTotalDepositAmount=o.totalDepositAmount;data.prevhotelRates=o.hotelRates.slice(0);data.checkInDate=f.checkInDate;data.checkOutDate=f.checkOutDate;data.amount=u.data.Amount;data.totalAmount=u.data.Amount;data.totalDepositAmount=u.data.DepositAmount;data.depositAmount=u.data.DepositAmount;data.hotelRates=u.data.HotelRates.slice(0);e(r,data,!0,function(){b(r,t,f.checkInDate,f.checkOutDate);n(["div.edit-bookingdetail_"+r],!0);n(["div.show-bookingdetail_"+r],!1);n(["#updateBookingDate_"+r,".msg-booking-available_"+r],!0);n([".msg-booking-unavailable_"+r,".msg-booking-updated_"+r],!1);p(r)})}else n([".msg-booking-unavailable_"+r],!0);return!1}).fail(function(n){NextGen.Alerts.danger(NextGen.Localization.Messages.HotelRoomTypeSearch.Failed());NextGen.Logger.error(n)}).always(function(){u()}),!1};r.onUpdateBookingDateButtonClick=function(){var o=$(this),r=$(this).closest("[data-booking]").data("booking"),s=v(r,t),f;u();i();f=$(this);f.data("booking-id",r);NextGen.InventoryManager.IsInventoryAvailable("Accommodation","updatebutton",f).done(function(t){return t.type==="Hold"?(data={},data.prevCheckInDate=null,data.prevCheckOutDate=null,data.prevAmount=null,data.prevTotalAmount=null,data.prevDepositAmount=null,data.prevTotalDepositAmount=null,data.prevhotelRates=null,n(["div.edit-bookingdetail_"+r],!1),n(["div.show-bookingdetail_"+r],!0),e(r,data,!0,function(){i();n([".msg-booking-updated_"+r],!0);n(["#updateBookingDate_"+r],!1);w(r)})):(n([".booking-unavailable-msg_"+r],!0),n(["#updateBookingDate_"+r],!1)),!1}).fail(function(n){NextGen.Alerts.danger(NextGen.Localization.Messages.HotelRoomTypeSearch.Failed());NextGen.Logger.error(n)}).always(function(){u()})};r.onSearchButtonClick=function(){var n=k(t);return n.done(function(){var i,n,r;$("#chkNoAccomodationRequired:checked").prop("checked",!1);i=!1;n=$('[name="groupPaymentOption"]');n&&(i=n.is(":radio")?$('[name="groupPaymentOption"]:checked').val()==="AllToGroupContact":n.val()==="AllToGroupContact");r={checkInDate:h.val(),checkOutDate:c.val(),componentConfigurationId:t.Id,isAllToGroupContact:i};lt(r,t).done(function(){var n=d(h.val(),c.val());t.Scope.find("span.nights").text(NextGen.Localization.Plurals.Nights(n));NextGen.Logic.Processor.ExecuteComponentLogicIfAny(t.Id,!0);$(".container-accommodation").show()})}),!1};r.onAddRoomButtonClick=function(){var n=$(this),t;return n.data("booking-id",NextGen.Utils.GenerateUUID()),t=n.data("preclick"),t?$.proxy(t,n)(r.onAddRoomSuccess,r.onAddRoomPartial,r.onAddRoomRejection):$.proxy(r.onAddRoomSuccess,n)(),!1};r.onAddRoomSuccess=function(){var n=$(this),f=n.closest("[data-roomtype]").data("roomtype"),o=n.closest("[data-hotel]").data("hotel"),s=parseFloat(n.data("amount")),p=n.data("currency"),l=parseFloat(n.data("depositAmount")),w=parseFloat(n.data("remaining")),a=n.closest("[data-roomtype]").find("button.booked-inventory"),r=n.closest("[data-inv-payment-status]").data("inv-payment-status"),v=r,y=n.data("invAddToWaitlist"),b=n.data("invEnableWaitlist"),i=n.data("invWaitlistPaymentStatus");i.trim()||(i=0);var k=n.data("invWaitlistInventoryLimit"),d=n.data("invWaitlistLabel"),g=n.data("invWaitlistMessage");y&&y==="true"&&i&&(r=i,v=i);var nt=n.data("bookingId"),tt=n.data("hotelRoomRates"),it=n.closest("[data-inv-allow-discount]").data("inv-allow-discount"),rt=n.closest("[data-inv-discount-required]").data("inv-discount-required"),ut=n.closest("[data-inv-discount-code-key]").data("inv-discount-code-key"),ft=n.closest("[data-inv-discount-code-value]").data("inv-discount-code-value"),et=n.closest("[data-inv-discount-code-inv-type]").data("inv-discount-code-inv-type"),ot=n.closest("[data-inv-discount-code-container-id]").data("inv-discount-code-container-id"),u={selected:!0,roomTypeId:f.id,roomTypeName:f.name,hotelId:o.id,hotelName:o.name,numberOfRooms:1,remaining:w,checkInDate:h.val(),checkOutDate:c.val(),amount:s,totalAmount:s,depositAmount:l,totalDepositAmount:l,paymentStatus:r,currency:p,waitlistInventoryLimit:k,canBeWaitisted:!1,waitlistLabel:d,waitlistMessage:g,originalPaymentStatus:v,waitlistPaymentStatus:i,enableWaitlist:b,bookingId:nt,allowDiscount:it,discountRequired:rt,discountCodeKey:ut,discountCodeValue:ft,discountCodeNoSubmit:"",discountCodeInvType:et,discountCodeContainerId:ot,hotelRates:tt};e(null,u,!0,function(i){for(var f,r=0;r<u.hotelRates.length;r++)u.hotelRates[r].bookingId=i;n.hide();n.data("booking-id",i);a.show();a.data("booking-id",i);f=t.Scope.find('div[data-booking="'+i+'"]');NextGen.ScrollManager.ScrollToElement(f);f.find(":input").first().focus()})};r.onAddRoomPartial=function(){$(this).attr("disabled","disabled")};r.onAddRoomRejection=function(){$(this).attr("disabled","disabled")};r.onBookedElementClick=function(){var i=$(this).data("booking-id"),n=t.Scope.find('div[data-booking="'+i+'"]');return NextGen.ScrollManager.ScrollToElement(n),n.find(":input").first().focus(),!1};r.onRemoveBookingButtonClick=function(){var n=$(this),u=$('input[id^="chkNoAccomodationRequired"]'),i;return u&&$(".booking-details").length===1&&(nt(t.scope),$(".container-accommodation").hide(),$(".accommodation-filter").hide(),$(".theme-curved-bottom-line").hide()),i=n.data("preclick"),i?$.proxy(i,n)(r.onRemoveBookingButtonClickInner,r.onRemoveBookingButtonClickInner,r.onRemoveBookingButtonClickInner,r.onRemoveBookingButtonClickInner,r.onRemoveBookingButtonClickInner):$.proxy(r.onRemoveBookingButtonClickInner,n)(),!1};r.onRemoveBookingButtonClickInner=function(){var n=$(this).closest("[data-booking]").data("booking");return e(n,{selected:!1},!0,function(){t.Scope.find('button[name="add-room"]').each(function(){var t=$(this),r=t.data("booking-id"),i;n===r&&(i=t.closest("[data-roomtype]").find("button.booked-inventory"),t.data("booking-id",null),t.data("amount")!==null?(t.show(),t.focus()):$("button#updateResults").focus(),i.hide(),i.data("booking-id",null))})}),!1};r.onUndoCancelButtonClick=function(){var n=$('input[id^="chkNoAccomodationRequired"]'),r=$(t.Scope).find('button[id="updateResults"]'),i;return n&&$(n).is(":checked")&&($(n).prop("checked",!1),r.prop("disabled",!1),h.prop("disabled",!1),c.prop("disabled",!1)),i=$(this).closest("[data-booking]").data("booking"),e(i,{selected:!0},!0),!1};r.onReplaceCreditCardDetailsButtonClick=function(){var n=$(this).closest("[data-booking]").data("booking");return e(n,{existingCard:!1,newCard:!0},!0),!1};r.onUndoReplaceCreditCardDetailsButtonClick=function(){var n=$(this).closest("[data-booking]").data("booking");return e(n,{existingCard:!0,newCard:!1,cardType:null,cardNumber:null,cardHolder:null,expiryMonth:null,expiryYear:null,ccv:null},!0),!1};r.onTemplateInputChanged=function(){var n=$(this),s=!!n.data("rebind"),u=n.closest("[data-booking]").data("booking"),r={},h=!0,c,f,t,o;n.is('[name*="numberOfRooms"]')?(c=n.closest("[data-booking]").data("isValidInventory"),c?r.numberOfRooms=parseInt(n.val(),10):s=!1):n.is('[name*="DiscountCodeKey"]')?(h=n.data("doNotFireChangeEvent")===undefined,f=n.data("rejection")?!1:!0,r.discountCodeValue=f?n.val():"",r.discountCodeNoSubmit=f?"":"nosubmit"):n.is('[name*="edit-checkin-date"]')||n.is('[name*="edit-checkout-date"]')?(t=n.attr("name"),u=t.split("_")[1],i(),$("#updateBookingDate_"+u).addClass("hidden"),r[t]=n.val()):(t=n.attr("name"),n.is('input[type="radio"]')&&(t=t.substring(0,t.lastIndexOf("_"))),n.is('[name*="DiscountCodeKey"]')&&(t=t.split("_")[1]),o=function(){return n.is('input[type="checkbox"]')?n.is(":checked"):n.val()},vt(t,"cst")?(r.customFields={},r.customFields[t]=o()):r[t]=o());h&&e(u,r,s)};r.onNoAccomodationChanged=function(){var n=$(t.Scope).find('button[id="updateResults"]');this.checked?(g(t.Scope),ui(r,t,h,h),$(".accommodation-filter").hide()):(n.prop("disabled",!1),h.prop("disabled",!1),c.prop("disabled",!1))};r.onAccommodationFilterChanged=function(){tt(t.Scope)};NextGen.Logger.errorWrap(r);t.Scope.off(".accommodation-component");t.Scope.on("click.accommodation-component","#updateResults",r.onSearchButtonClick);t.Scope.on("click.accommodation-component",'button[name="add-room"]',r.onAddRoomButtonClick);t.Scope.on("click.accommodation-component","button.booked-inventory",r.onBookedElementClick);t.Scope.on("click.accommodation-component",'input[id^="chkNoAccomodationRequired"]',r.onNoAccomodationChanged);f.off(".accommodation-component");f.on("click.accommodation-component",'button[name="remove-cancel"]',r.onRemoveBookingButtonClick);f.on("click.accommodation-component",'button[name="edit-booking"]',r.onEditBookingDetailButtonClick);f.on("click.accommodation-component",'button[name="edit-booking-cancel"]',r.onCancelEditBookingDetail);f.on("click.accommodation-component",'button[name="checkAvailability"]',r.onCheckAvailabilityButtonClick);f.on("click.accommodation-component",'button[name="updateBookingDate"]',r.onUpdateBookingDateButtonClick);f.on("click.accommodation-component",'button[name="uncancel"]',r.onUndoCancelButtonClick);f.on("click.accommodation-component",'button[name="replace-cc-details"]',r.onReplaceCreditCardDetailsButtonClick);f.on("click.accommodation-component",'button[name="undo-replace-cc"]',r.onUndoReplaceCreditCardDetailsButtonClick);f.on("change.accommodation-component","input, select, textarea",r.onTemplateInputChanged);f.find(".theme-textbox, .theme-select").not("div").each(function(){var n=$(this);n.val()&&n.addClass("field--not-empty")});f.find("div.file-caption-name").each(function(){var n=$(this);n.text()&&n.parents(".form-group").find(".theme-label-floating.theme-label-fixed-width").addClass("file-input-placeholder")});t.Scope.off(".accommodation-component-filter");t.Scope.on("change.accommodation-component-filter",".accommodation-filter input[type=checkbox]",r.onAccommodationFilterChanged);nt(t.Scope);s(t)});NextGen.ComponentController.RegisterOnComponentDisposeCallback("NextGen.Online.Components.Client.Accommodation.AccommodationComponent",function(){$.each(t.subscriptions,function(n,t){NextGen.Messaging.Unsubscribe(t)});t.subscriptions=[]});NextGen.ValidationManager.RegisterCustomValidation("NextGen.Online.Components.Client.Accommodation.AccommodationComponent",function(n){var t=[],s=NextGen.ValidationManager.RevalidateForm(n,{ignore:'input[type="hidden"], input[type="button"], button, .ignore-validation, .ignore-validation *, .ignored-by-logic'}),i,h,r,u,f;if((NextGen.EditingExisting===!1||NextGen.SubmitManager.IsSubmissionHappening()===!1)&&(i=ri(n),i.done(function(t){t&&t.type&&t.type==="Hold"&&$(t.result.Holds).each(function(t,i){ei(n,i)})}),i.fail(function(t){t&&t.type&&(t.type==="Partial"?$(t.result.Partials).each(function(t,i){o(n,i)}):t.type==="Rejection"&&$(t.result.Rejections).each(function(t,i){o(n,i)}))}),t.push(i)),et(n)===!0?ot(n)===!1&&(e(n)||(NextGen.Alerts.warning(NextGen.Localization.Messages.Accommodation.SelectAnOption()),t.push($.Deferred().reject().promise()))):(h=fi(n)&&!e(n),h&&(NextGen.Alerts.warning(NextGen.Localization.Messages.Accommodation.SelectAnOption()),t.push($.Deferred().reject().promise()))),$(n).find("#booked_container_fluid").each(function(){NextGen.ValidationManager.ValidatePageForCustomField(this)===!1&&t.push($.Deferred().reject().promise())}),n.find('input[name="cardNumber"]').each(function(n,t){var i=$(t),r=i.closest("[data-booking]").find('select[name="cardType"]'),f=function(){typeof i.data("validation")=="object"&&i.valid()},u;r.off(".cc-validation").on("change.cc-validation",NextGen.Logger.errorWrap(f));u=function(){return NextGen.ValidationManager.ValidateCreditCard(r.val(),i.val())};i.rules("add",{customCallback:[u],messages:{customCallback:NextGen.Localization.Messages.Validation.CreditCardNumberInvalid()}})}),n.find('input[name="ccv"]').each(function(n,t){var i=$(t),r=i.closest("[data-booking]").find('select[name="cardType"]'),u=function(){return NextGen.ValidationManager.ValidateCcv(r.val(),i.val())};i.rules("add",{customCallback:[u],messages:{customCallback:NextGen.Localization.Messages.Validation.CcvNumberInvalid()}})}),n.find('select[name="expiryMonth"]').each(function(n,t){var i=$(t),r=i.closest("[data-booking]").find('select[name="expiryYear"]'),u=function(){var n=moment({day:1}),t=moment({year:r.val(),month:i.val()-1,day:2});return n.isBefore(t)};i.rules("add",{customCallback:[u],messages:{customCallback:NextGen.Localization.Messages.Validation.CreditCardExpired()}})}),r=n.find('select[name="expiryMonth"]'),u=n.find('select[name="expiryYear"]'),r.off("change.validation"),u.off("change.validation"),!s){f=function(){n.valid()};r.on("change.validation",NextGen.Logger.errorWrap(f));u.on("change.validation",NextGen.Logger.errorWrap(f))}return s?t.push($.Deferred().resolve().promise()):t.push($.Deferred().reject().promise()),t.push(oi(n)),$.when.apply(this,t)});NextGen.ValidationManager.RegisterCustomValidation("NextGen.Online.Components.Client.Accommodation.AccommodationComponent",function(n){var i=$(n).find('select[name="CheckIn"]'),t,r,u;if(i.length===0&&(i=$(n).find('input[name="CheckIn"]')),t=$(n).find('select[name="CheckOut"]'),t.length===0&&(t=$(n).find('input[name="CheckOut"]')),r=function(){var n=moment(i.val(),"YYYY-MM-DD"),r=moment(t.val(),"YYYY-MM-DD");return!n.isValid()||!r.isValid()||n.isBefore(r)},n.validate({rules:{CheckIn:{required:!0,customCallback:[r],min:i.attr("min"),max:i.attr("max")},CheckOut:{required:!0,customCallback:[r],min:t.attr("min"),max:t.attr("max")}},messages:{CheckIn:{required:NextGen.Localization.Messages.Validation.CheckInDateRequired(),customCallback:NextGen.Localization.Messages.Validation.CheckInBeforeCheckOut()},CheckOut:{required:NextGen.Localization.Messages.Validation.CheckOutDateRequired(),customCallback:NextGen.Localization.Messages.Validation.CheckOutDateAfterCheckIn()}}}),u=n.valid(),i.off("change.validation"),t.off("change.validation"),!u){var e=n.closest(".component").attr("id"),o=NextGen.ComponentController.GetComponentById(e),f=function(){k(o)};i.on("change.validation",NextGen.Logger.errorWrap(f));t.on("change.validation",NextGen.Logger.errorWrap(f))}return u},null,"form#check-in-out")})();
//# sourceMappingURL=components_d72ad7a23479481d8a4f0e51b567a141.map
var NextGen=NextGen||{};(function(){NextGen.ValidationManager.RegisterCustomValidation("NextGen.Online.Components.Client.Accreditation.AccreditationComponent",function(n){return NextGen.ValidationManager.DefaultValidation(n)});NextGen.ComponentController.RegisterOnComponentLoadCallback("NextGen.Online.Components.Client.Accreditation.AccreditationComponent",function(n){var f=n.Scope.find("input[data-source]"),t,i,r,u;f&&(t=JSON.parse(f.val()),t.HiddenCategory||n.Scope.find("select[data-category]").val()||(i=[new Option],$.each(t.Categories,function(n,t){i.push(new Option(t.Name,t.Id))}),n.Scope.find("select[data-category]").append(i),t.SelectedCategory&&n.Scope.find("select[data-category]").val(t.SelectedCategory).select2("destroy").select2(),n.Scope.find("select[data-category]").change(function(){var r=$(this).val(),i=[new Option];$.each(_.find(t.Categories,function(n){return n.Id===r}).Children,function(n,t){i.push(new Option(t.Name,t.Id))});n.Scope.find("select[data-subcategory]").empty().append(i).select2("destroy").select2();n.Scope.find("select[data-role]").empty().select2("destroy").select2()})),t.HiddenSubCategory||n.Scope.find("select[data-subcategory]").val()||(t.SelectedCategory&&(r=[new Option],$.each(_.find(t.Categories,function(n){return n.Id===t.SelectedCategory}).Children,function(n,t){r.push(new Option(t.Name,t.Id))}),n.Scope.find("select[data-subcategory]").append(r),t.SelectedSubCategory&&n.Scope.find("select[data-subcategory]").val(t.SelectedSubCategory).select2("destroy").select2()),n.Scope.find("select[data-subcategory]").change(function(){var r=t.HiddenCategory?t.SelectedCategory:n.Scope.find("select[data-category]").val(),u=$(this).val(),i=[new Option];$.each(_.find(_.find(t.Categories,function(n){return n.Id===r}).Children,function(n){return n.Id===u}).Children,function(n,t){i.push(new Option(t.Name,t.Id))});n.Scope.find("select[data-role]").empty().append(i).select2("destroy").select2()})),t.SelectedSubCategory&&(t.HiddenRole||n.Scope.find("select[data-role]").val()||(u=[new Option],$.each(_.find(_.find(t.Categories,function(n){return n.Id===t.SelectedCategory}).Children,function(n){return n.Id===t.SelectedSubCategory}).Children,function(n,t){u.push(new Option(t.Name,t.Id))}),n.Scope.find("select[data-role]").append(u),t.SelectedRole&&n.Scope.find("select[data-role]").val(t.SelectedRole).select2("destroy").select2())))})})();
//# sourceMappingURL=components_d72ad7a23479481d8a4f0e51b567a141.map
(function(){NextGen.ValidationManager.RegisterCustomValidation("NextGen.Online.Components.Client.Agenda.BreakActivities.AgendaBreakActivitiesComponent",function(n){var t=[],i=NextGen.ValidationManager.RevalidateForm(n,{ignore:':hidden:not(select, :input[name^="cst_"][name$="_html"]), .cstField:hidden select'});return NextGen.ValidationManager.ValidatePageForRadioButton(n)===!1&&t.push($.Deferred().reject().promise()),NextGen.ValidationManager.ValidatePageForCustomField(n)===!1&&t.push($.Deferred().reject().promise()),t.push(i?$.Deferred().resolve().promise():$.Deferred().reject().promise()),$.when.apply(this,t)})})();
//# sourceMappingURL=components_d72ad7a23479481d8a4f0e51b567a141.map
(function(){function n(n){var t,i,r,u;if(n.is(":radio")&&n.is(":checked"))return(i=n.attr("id"),i&&i.length>0&&i.toLowerCase().indexOf("nooption")>0)?$.Deferred().resolve().promise():(t=NextGen.InventoryManager.GetInputMappedData("Agenda","radio",n),t.IsRequestingInventory="true",t);if(n.is(":checkbox")&&n.is(":checked"))return t=NextGen.InventoryManager.GetInputMappedData("Agenda","checkbox",n),t.IsRequestingInventory="true",t;if(n.is("select")){if(n.is("[data-type=number]"))return t=NextGen.InventoryManager.GetInputMappedData("Agenda","selectnumber",n),t.IsRequestingInventory="true",t;if(r=n.val(),r&&r.length>0&&(u=$("#"+r),u&&u.is(".inv-aware")))return t=NextGen.InventoryManager.GetInputMappedData("Agenda","select",u),t.IsRequestingInventory="true",t}else if(n.is(":text"))return t=NextGen.InventoryManager.GetInputMappedData("Agenda","text",n),t.IsRequestingInventory="true",t;return $.Deferred().resolve().promise()}function t(t){var u=[],i=[],r=$(t).find(":input.inv-aware").not("[name*='cst_']").not(".select2-focusser").not(":hidden");return r.length===0&&(r=$(t).find("select").not("[name*='cst_']").not(".select2-focusser")),r.each(function(t,i){u.push(n($(i)))}),i.push(NextGen.InventoryManager.IsInventoryAvailableByData(u)),$(i).each(function(n,i){i.done(function(n){n&&n.type&&$(n.result.Waitlists).each(function(i,r){var u=$(t).find("#"+r.ParentId);u&&u.trigger("after-inventory-checked",n)})});i.fail(function(n){$(n.result.Rejections).each(function(n,i){var r=$(t).find("#"+i.ParentId);r.inventoryInputWatcher().ShowInventoryErrorMessage(i.ParentId,NextGen.Localization.Messages.InventoryCheck.Full())});$.Deferred().reject().promise()})}),$.when.apply(this,i)}NextGen.ValidationManager.RegisterCustomValidation("NextGen.Online.Components.Client.Agenda.ConcurrentSessions.AgendaConcurrentSessionsComponent",function(n){var i=[],r=NextGen.ValidationManager.RevalidateForm(n,{ignore:':hidden:not(select, :input[name^="cst_"][name$="_html"]), .cstField:hidden select'});return NextGen.ValidationManager.ValidatePageForRadioButton(n)===!1&&i.push($.Deferred().reject().promise()),NextGen.ValidationManager.ValidatePageForCustomField(n)===!1&&i.push($.Deferred().reject().promise()),i.push(r?$.Deferred().resolve().promise():$.Deferred().reject().promise()),NextGen.InventoryEnforcedByPayment!==!0&&(NextGen.EditingExisting===!1||NextGen.SubmitManager.IsSubmissionHappening()===!1)&&i.push(t(n)),$.when.apply(this,i)})})();
//# sourceMappingURL=components_d72ad7a23479481d8a4f0e51b567a141.map
(function(){function n(n){var t,i,r,u;if(n.is(":radio")&&n.is(":checked"))return(i=n.attr("id"),i&&i.length>0&&i.toLowerCase().indexOf("nooption")>0)?$.Deferred().resolve().promise():(t=NextGen.InventoryManager.GetInputMappedData("Agenda","radio",n),t.IsRequestingInventory="true",t);if(n.is(":checkbox")&&n.is(":checked"))return t=NextGen.InventoryManager.GetInputMappedData("Agenda","checkbox",n),t.IsRequestingInventory="true",t;if(n.is("select")){if(n.is("[data-type=number]"))return t=NextGen.InventoryManager.GetInputMappedData("Agenda","selectnumber",n),t.IsRequestingInventory="true",t;if(r=n.val(),r&&r.length>0&&(u=$("#"+r),u&&u.is(".inv-aware")))return t=NextGen.InventoryManager.GetInputMappedData("Agenda","select",u),t.IsRequestingInventory="true",t}else if(n.is(":text"))return t=NextGen.InventoryManager.GetInputMappedData("Agenda","text",n),t.IsRequestingInventory="true",t;return $.Deferred().resolve().promise()}function t(t){var u=[],i=[],r=$(t).find(":input.inv-aware").not("[name*='cst_']").not(".select2-focusser").not(":hidden");return r.length===0&&(r=$(t).find("select").not("[name*='cst_']").not(".select2-focusser")),r.each(function(t,i){u.push(n($(i)))}),i.push(NextGen.InventoryManager.IsInventoryAvailableByData(u)),$(i).each(function(n,i){i.done(function(n){n&&n.type&&$(n.result.Waitlists).each(function(i,r){var u=$(t).find("#"+r.ParentId);u&&u.trigger("after-inventory-checked",n)})});i.fail(function(n){$(n.result.Rejections).each(function(n,i){var r=$(t).find("#"+i.ParentId);r.inventoryInputWatcher().ShowInventoryErrorMessage(i.ParentId,NextGen.Localization.Messages.InventoryCheck.Full())});$.Deferred().reject().promise()})}),$.when.apply(this,i)}NextGen.ValidationManager.RegisterCustomValidation("NextGen.Online.Components.Client.Agenda.Sessions.AgendaSessionsComponent",function(n){var i=[],r=NextGen.ValidationManager.RevalidateForm(n,{ignore:':hidden:not(select, :input[name^="cst_"][name$="_html"]), .cstField:hidden select'});return NextGen.ValidationManager.ValidatePageForRadioButton(n)===!1&&i.push($.Deferred().reject().promise()),NextGen.ValidationManager.ValidatePageForCustomField(n)===!1&&i.push($.Deferred().reject().promise()),i.push(r?$.Deferred().resolve().promise():$.Deferred().reject().promise()),NextGen.InventoryEnforcedByPayment!==!0&&(NextGen.EditingExisting===!1||NextGen.SubmitManager.IsSubmissionHappening()===!1)&&i.push(t(n)),$.when.apply(this,i)})})();
//# sourceMappingURL=components_d72ad7a23479481d8a4f0e51b567a141.map
(function(){function i(n){return n.find('[name="captcha-satisfied"]').val()==="true"}function r(n){n.find('[name="captcha-satisfied"]').val("true")}function t(n){n.find('[name="captcha-satisfied"]').val("false")}function u(n,t){var i=n.find("#captcha-target"),r;i.closest("div.form-group").addClass("has-error");i.nextAll(".has-error.control-label").remove();r=NextGen.Localization.Messages.Captcha[t]();i.after($('<label for="'+i.attr("id")+'" class="has-error control-label">'+r+"<\/label>"))}function f(n){var t=n.find("#captcha-target");t.closest("div.form-group").removeClass("has-error");t.nextAll(".has-error.control-label").remove()}var n={};n.subscriptions=new NextGen.Messaging.SubscriptionManager;n.events={};n.events.onAuthenticationSignOut=function(n,i){t(i.Scope)};n.events.onAuthenticationAttemptFailed=function(n,i){t(i.Scope)};NextGen.Logger.errorWrap(n.events);NextGen.ComponentController.RegisterOnPageLoadCallback("NextGen.Online.Components.Client.Captcha.CaptchaComponent",function(t){n.subscriptions.Subscribe("Authentication_SignOut",n.events.onAuthenticationSignOut,{component:t});n.subscriptions.Subscribe("Authentication_AttemptFailed",n.events.onAuthenticationAttemptFailed,{component:t})});NextGen.ComponentController.RegisterOnComponentDisposeCallback("NextGen.Online.Components.Client.Captcha.CaptchaComponent",function(){n.subscriptions.UnsubscribeAll()});NextGen.ComponentController.RegisterOnComponentLoadCallback("NextGen.Online.Components.Client.Captcha.CaptchaComponent",function(n){NextGen.CaptchaManager.Create(n.Scope.find("#captcha-target"))});NextGen.ValidationManager.RegisterCustomValidation("NextGen.Online.Components.Client.Captcha.CaptchaComponent",function(n){if(i(n))return!0;var e=n.find("#captcha-target"),o=NextGen.PageManager.GetPageNumber(e);return o!==NextGen.PageManager.GetCurrentPageNumber()?!0:NextGen.CaptchaManager.CaptchaValidatorPromise!==null?NextGen.CaptchaManager.CaptchaValidatorPromise:NextGen.CaptchaManager.Validate().done(function(){r(n);f(n);NextGen.CaptchaManager.CaptchaValidatorPromise=null}).fail(function(i){i!=="Empty"&&t(n);u(n,i);NextGen.CaptchaManager.CaptchaValidatorPromise=null})},NextGen.ValidationPriority.Earliest)})();
//# sourceMappingURL=components_d72ad7a23479481d8a4f0e51b567a141.map
var NextGen=NextGen||{};(function(){function h(n,t){var r,i;if(n.isNewContact&&n.isNewContact===!0)for(r=t.Scope.find(':input:not([type="hidden"]):not([type="radio"])'),i=0;i<r.length;i++)$(r[i]).is(":disabled")===!1&&($(r[i]).data("select2")?$(r[i]).select2("val",""):$(r[i]).val(null));$.each(n,function(n,i){var r=t.Scope.find(':input[name="'+n+'"]');r.length>0&&r.is(":disabled")===!1&&(r.is("input, select")&&r.attr("multiple")?r.val(JSON.parse(i)):r.val(i),r.trigger("change"))})}function t(n){function r(n){if(!n||!n.length)return null;var t=n.data().autosaved;return t&&String(t).toLowerCase()!=="true"&&String(t).toLowerCase()!=='"true"'?null:n.val()||""}var i={},t=n.Scope.find('input:not([type="hidden"]), select');return $.each(t,function(n){i[t[n].name]=r($(t[n]))}),i}function f(n){var t=$.map(u,function(n){return'input[name="'+n+'"]'}).join(",");return t=t+',select[name="DietaryId"]',n.Scope.find(t)}function i(n){if(n.element){var t=$(n.element);if(t&&t.data().right)return $.parseHTML(n.text+'<span class="pull-right">'+t.data().right+"<\/div>")}return n.text}function e(n,t){var r,i;if(t){for(r=!1,i=0;i<n.length;i++)if(n[i].id===t){r=!0;break}r||n.push({id:t,text:t})}}function o(t,r,u,f){$.ajax(r,{type:"POST",global:!1}).done(function(r){var o,s,h;if(r.length){if(n.countryListData=[...r],e(r,t),t)for(o=0;o<r.length;o++)(r[o].id==t||r[o].text==t)&&(r[o].selected=!0);s=NextGen.Themes.HasTheme(u);h={templateResult:i,maximumSelectionSize:1,width:"off",dropdownAutoWidth:"auto",theme:s?"bootstrap form-control theme-select":"bootstrap form-control",containerCssClass:"ignore-validation",data:r,sortResults:u.data("nice-sort")===!0?NextGen.Utils.NiceSelect2Sort:NextGen.Utils.StartingWithSelect2Sort,valueSeparator:"|,"};s&&(h.adaptDropdownCssClass=function(n){return n});u.select2(h);s&&u.attr("title","");f&&c(u)}}).fail(function(){})}function s(n,t,r,u){$.ajax(u,{type:"POST",global:!1,data:{country:t}}).done(function(t){if(t.length){e(t,r);n.hasClass("theme-textbox")&&(n.removeClass("theme-textbox"),n.addClass("theme-select"));var u=NextGen.Themes.HasTheme(n);u===!0?(n.select2({templateResult:i,maximumSelectionSize:1,width:"off",theme:"bootstrap form-control theme-select",dropdownAutoWidth:"auto",containerCssClass:"ignore-validation ",data:t,sortResults:n.data("nice-sort")===!0?NextGen.Utils.NiceSelect2Sort:undefined,adaptDropdownCssClass:function(n){return n}}),n.val("").trigger("change"),n.select2("val","")):(n.select2({templateResult:i,maximumSelectionSize:1,width:"off",theme:"bootstrap form-control",dropdownAutoWidth:"auto",containerCssClass:"ignore-validation",data:t,sortResults:n.data("nice-sort")===!0?NextGen.Utils.NiceSelect2Sort:undefined}),n.val("").trigger("change"),n.select2("val",""),n.attr("title",""));r&&n.select2("val",[r])}else n.hasClass("theme-select")&&(n.removeClass("theme-select"),n.addClass("theme-textbox")),n.hasClass("select2-hidden-accessible")&&n.select2("destroy"),n.val("").trigger("change")}).fail(function(){})}function c(n){var u=n.attr("id"),t=$("input[data-parentid="+u+"]");if(t.length){var f="#"+t.attr("name")+"_data",i=$(f).val(),e="#"+t.attr("name")+"_value",r=$(t).val();r||(r=$(e).val());n.on("change",function(){var n=$(this).val(),u=i.lastIndexOf("/");o(n,i.substring(0,u+1)+"Countries",$(this),!1);s(t,n,r,i)});s(t,$("#"+u).val(),r,i)}}function l(n){var u=$(n).find('input:text[id$="_LastName"]'),f=$(n).find('input:text[id$="_Organization"]'),i=$(n).find('input:text[id$="_EmailAddress"]'),h=$(n).find('label.field-required[for$="_Photo"]'),o=$(n).find('input:radio[name$="Privacy"]'),t=!0,s,r,e;if(u.length>0&&(t=$.trim(u.val()).length>0?!0:!1),t===!1&&f.length>0&&(t=$.trim(f.val()).length>0?!0:!1),i.length>0){if(s=$(n).find('label[for$="_EmailAddress"]').text(),$.trim(i.val()).length>0&&NextGen.ValidationManager.ValidateEmail(i.val(),!1)===!1)return NextGen.Alerts.warning(NextGen.Localization.Messages.Contact.EmailInvalid(s)),!1;t===!1&&(t=$.trim(i.val()).length>0?!0:!1)}return t===!1&&(u.length>0||f.length>0||i.length>0)?(NextGen.Alerts.warning(NextGen.Localization.Messages.Contact.RequiredFields()),!1):h.length>0&&($(n).find('img[id$="photoResult"]').length===0||$(n).find('img[id$="photoResult"]').css("display")==="none")?(NextGen.Alerts.warning(NextGen.Localization.Messages.Contact.PhotoIsRequired()),!1):(r=n.find("#photoResult"),r.attr("required")==="required"&&(typeof r.attr("src")=="undefined"||r.attr("src")===""))?(NextGen.Alerts.warning(NextGen.Localization.Messages.Contact.PhotoIsRequired()),!1):o.length>0&&(e=!1,o.each(function(n,t){var i=$(t);i.is(":checked")&&(e=!0)}),e===!1)?(NextGen.Alerts.warning(NextGen.Localization.Messages.Contact.PrivacyOptionRequired()),!1):!0}function a(n){var i=$(n).find(':radio[name^="cst_"]').not(".ignored-by-logic"),t;return i.length>0&&(t=$(n).find(':radio[name^="cst_"]').not(".ignored-by-logic").toArray().map(function(n){return{id:n.id,checked:n.checked}}).reduce(function(n,t){return n[t.id]=n[t.id]||t.checked,n},{}),Object.values(t).some(function(n){return n===!1}))?(NextGen.Alerts.warning(NextGen.Localization.Messages.Validation.SelectRadioButtonOption()),!1):!0}function v(n){return!n||!n.length?"":$.map(n.split(" "),function(n){return n.substring(0,1).toUpperCase()+n.substring(1).toLowerCase()}).join(" ")}var n={},r,u;n.subscriptions=new NextGen.Messaging.SubscriptionManager;n.countryListData=[];r=1048576;u={Title:"Title",FirstName:"FirstName",LastName:"LastName",Organization:"Organization",Department:"Department",SubDepartment:"SubDepartment",OfficeNumber:"OfficeNumber",Position:"Position",EmailAddress:"EmailAddress",DietaryOther:"DietaryOther"};NextGen.ComponentController.RegisterOnPageLoadCallback("NextGen.Online.Components.Client.Contact.ContactComponent",function(n){NextGen.Messaging.Publish("ContactComponent_ContactNameChanged",t(n))});NextGen.ComponentController.RegisterOnSignInCompleteCallback("NextGen.Online.Components.Client.Contact.ContactComponent",function(n){NextGen.Messaging.Publish("ContactComponent_ContactNameChanged",t(n))});NextGen.ValidationManager.RegisterCustomValidation("NextGen.Online.Components.Client.Contact.ContactComponent",function(n){var i,o,r,s,u,f,h,t,e;return l(n)===!1?!1:(i=$(n).find('textarea[id*="AdditionalEmails"]'),i.length>0&&i.val().length>0&&NextGen.ValidationManager.ValidateEmail(i.val(),!0)===!1)?(o=$(n).find('label[for*="AdditionalEmails"]').text(),NextGen.Alerts.warning(NextGen.Localization.Messages.Contact.EmailInvalid(o)),!1):(r=$(n).find('input:text[id*="BillingAddressEmail"]'),r.length>0&&r.val().length>0&&NextGen.ValidationManager.ValidateEmail(r.val(),!1)===!1)?(s=$(n).find('label[for*="BillingAddressEmail"]').text(),NextGen.Alerts.warning(NextGen.Localization.Messages.Contact.EmailInvalid(s)),!1):(u=n.find("#photoResult"),u.attr("required")==="required"&&u.attr("src")==="")?(NextGen.Alerts.warning(NextGen.Localization.Messages.Contact.PhotoIsRequired()),!1):(f=n.find("select[data-dietary]"),f.length&&(h=f.val(),t=n.find('input[id="DietaryOther"]'),t&&(e=t.val(),h.includes("DietaryOther")&&(e===null||e==="")?t.attr("required",""):t.removeAttr("required"))),NextGen.ValidationManager.DefaultValidation(n)&&a(n))});NextGen.ComponentController.RegisterOnComponentDisposeCallback("NextGen.Online.Components.Client.Contact.ContactComponent",function(t){t.Scope.find("button.take-photo").off("click");t.Scope.find("button.browse-photo").off("click");var i=NextGen.PageManager.GetVisiblePageNumbers(),r=NextGen.PageManager.GetPageNumber(t.Scope),u=$.inArray(r,i);u===-1&&(n.subscriptions.UnsubscribeAll(t.Id),f(t).off("autosaved"))});NextGen.ComponentController.RegisterOnComponentLoadCallback("NextGen.Online.Components.Client.Contact.ContactComponent",function(i){function a(n,t,i){e(n.DataUri,i);NextGen.Messaging.Publish("Page_Processed")}function y(n,t){return $.ajax({url:NextGen.ClientUrls.SaveCropedPhotoPost,data:{dataUri:n,cropData:t},type:"POST"})}function e(n,t){t.photoPreviewImage[0].src=n;t.photoPreviewImage.on("load",function(){var r=window.innerHeight>0?window.innerHeight:screen.height,e=0,i,f;(r<t.photoPreviewImage[0].naturalWidth||r<t.photoPreviewImage[0].naturalHeight)&&(e=r-120);i=window.innerWidth>0?window.innerWidth:screen.width;f=0;(i<t.photoPreviewImage[0].naturalWidth||i<t.photoPreviewImage[0].naturalWidth)&&(f=i-50);u.init(e,f);u.setImageCrop(n,t.photoPreviewImage[0].naturalWidth===0?300:t.photoPreviewImage[0].naturalWidth);Webcam.acceptButton.show();Webcam.captureButton.hide();t.backButton.show();t.browsePhotoButton.hide();t.livePhotoImageContainer.hide();t.photoPreviewImageContainer.show();try{Webcam.reset()}catch(o){}})}function s(n){n.livePhotoImageContainer.show();Webcam.on("error",function(t){console.log(t);n.livePhotoImageContainer.hide()});Webcam.set({width:300,height:300,dest_width:300,dest_height:300,image_format:"jpeg",jpeg_quality:95});Webcam.setSWFLocation("/scripts/webcam.swf");isMobile.apple.device||isMobile.android.device||Webcam.attach("#video_ContactComponent");n.Scope.find("#TakePhoto_ContactComponent").length>0&&(Webcam.captureButton=n.Scope.find("#TakePhoto_ContactComponent"),Webcam.acceptButton=n.Scope.find("#AcceptPhoto_ContactComponent"));Webcam.on("live",function(){Webcam.acceptButton.is(":visible")||Webcam.captureButton.show();n.hasLiveCamera=!0;var t=$("video")[0];t.onplaying=function(){var n=t.videoHeight/t.videoWidth;Webcam.set({dest_width:300,dest_height:300*n})}});n.photoPreviewImage.src="";Webcam.acceptButton.hide();Webcam.live===!0&&Webcam.captureButton.show();n.backButton.hide();n.browsePhotoButton.show();n.photoPreviewImageContainer.hide()}n.subscriptions.Subscribe("Start_Group_Member",function(n){h(n,i)},{componentId:i.Id});f(i).on("autosaved",NextGen.Logger.errorWrap(function(){NextGen.Messaging.Publish("ContactComponent_ContactNameChanged",t(i))}));i.Scope.find("input[data-titlecased]").each(function(){var n=$(this);n.data("oldVal",n.val());n.on("blur",function(){var n=$(this);n.data("oldVal")||n.val(v(n.val()));n.data("oldVal",n.val())})});i.Scope.find("select[data-dietary]").each(function(){var n=$(this);n.on("change",function(){var n,t;$(this)&&(n=$(this).val(),console.warn("dietary new",n),t=i.Scope.find("#dietaryOtherDiv"),n&&t?n.includes("DietaryOther")?t.show():(i.Scope.find("#DietaryOther").val(""),t.hide()):n===""&&(i.Scope.find("#DietaryOther").val(""),t.hide()))})});i.Scope.find("input[data-country]").each(function(){var r="#"+$(this).attr("name")+"_data",u=$(r).val(),f="#"+$(this).attr("name")+"_value",t=$(this),i=t.val();i||(i=$(f).val());o(i,u,t,!0);t.on("animationstart",function(i){if(i.originalEvent.animationName==="onAutoFillStart"){var r=n.countryListData,u=t.val(),f=r.some(function(n){return n.text===u});f||setTimeout(()=>{t.val(null).trigger("change")},0)}})});i.photoPopUpButton=i.Scope.find("a#capture-photo-button-"+i.Id);NextGen.Controls.Lightbox.Create(i.photoPopUpButton,{closeOnBgClick:!1,closeBtnInside:!0});i.photoPreviewImage=i.Scope.find("#photoPreview");i.photoPreviewImageContainer=i.Scope.find("#preview-container");i.photoImage=i.Scope.find("#photoResult");i.livePhotoImageContainer=i.Scope.find("#video-container");i.takePhotoButton=i.Scope.find("button.take-photo");i.removePhotoButton=i.Scope.find("button.remove-photo");i.closePhotoButton=i.Scope.find("button.mfp-close");i.acceptPhotoButton=i.Scope.find("button.accept-photo");i.backButton=i.Scope.find("button.back-photo");i.browsePhotoButton=i.Scope.find("button.browse-photo");i.photoFileInput=i.Scope.find("#browsePhoto");i.addReplacePhotoButton=i.Scope.find("button.add-replace-photo");i.photoMaxFileSizeError=i.Scope.find("#photoMaxFileSizeError");i.closePhotoButton.on("click",function(){i.hasLiveCamera=!1;var n=$("video")[0];const t=n.srcObject,r=t.getTracks();r[0].stop()});i.removePhotoButton.on("click",function(){i.photoImage[0].src="";var n=$(i.photoImage[0]).closest("div.form-group");n.find("[data-existing-filename]").val("").trigger("change");n.find("[data-existing-mime-type]").val("").trigger("change");n.find("[data-existing-content-encoding]").val("").trigger("change");n.find("[data-existing-content-sharedCacheKey]").val("").trigger("change");n.find("[data-existing-uri]").val("").trigger("change");i.removePhotoButton.hide();i.photoImage.hide();i.Scope.find("#photoResult").closest(".theme-photo-preview").hide();i.Scope.find("#photoResult").closest(".theme-photo-preview").siblings(".theme-photo-btn-box").find("label").show()});i.takePhotoButton.on("click",function(){Webcam.snap(function(n){e(n,i)})});i.browsePhotoButton.on("click",function(){i.photoFileInput.on("change",NextGen.Logger.errorWrap(function(){var t=$(this),o=window.File&&window.FileReader&&window.FileList&&window.Blob,n,u,f;if(o){if(n=i.photoFileInput[0].files[0],n&&n.size>r){i.photoMaxFileSizeError.show();return}i.photoMaxFileSizeError.hide();u=new FileReader;u.onload=function(n){e(n.target.result,i)};u.readAsDataURL(n);t.replaceWith(t.val(null).clone())}else f=$('<div class="alert alert-info"><span class="glyphicon glyphicon-upload"><\/span>&nbsp;{msg}<\/div>'.replace(/\{msg\}/g,NextGen.Localization.Messages.FileUpload.Uploading())),t.uploadFile(NextGen.ClientUrls.UploadPost,f,fileUploadSuccess,fileUploadFailure,a).timeout(3e5)}));i.photoFileInput.click()});i.acceptPhotoButton.on("click",function(){if(u.CroppedWidth==0||u.CroppedHeight==0){alert("Please crop photo");return}if(typeof u.cropData!="undefined"){u.cropData.CropImageParams=u.cropParams;var n=$('<span class="ajax-spinner"><\/span>');n.insertAfter(i.acceptPhotoButton);$.when(y(i.photoPreviewImage[0].src,JSON.stringify(u.cropData))).done(function(t){n.remove();i.photoImage[0].src=t.DataUri;i.photoImage.show();i.Scope.find("#photoResult").closest(".theme-photo-preview").show();i.Scope.find("#photoResult").closest(".theme-photo-preview").siblings(".theme-photo-btn-box").find("label").hide();var r=$(i.photoImage[0]).closest("div.form-group");r.find("[data-existing-filename]").val(t?t.FileName:"").trigger("change");r.find("[data-existing-mime-type]").val(t?t.MimeType:"").trigger("change");r.find("[data-existing-content-encoding]").val(t?t.ContentEncoding:"").trigger("change");r.find("[data-existing-content-sharedCacheKey]").val(t?t.SharedCacheKey:"").trigger("change");r.find("[data-existing-uri]").val(t?t.DataUri:"").trigger("change");i.removePhotoButton.show();try{Webcam.reset()}catch(u){}NextGen.Controls.Lightbox.Close()})}});i.addReplacePhotoButton.on("click",function(){s(i);i.photoPopUpButton.click()});i.backButton.on("click",function(){s(i)});var c=300,l=300,u={init:function(n,t){var i=c/l;photoSettings.photoType=="Passport"&&(i=7/9,l=c/i);u.jcrop_api&&u.jcrop_api.destroy();$(".jcrop-holder").remove();u.jcrop_api=$.Jcrop("#photoPreview",{onChange:u.setCropValues,onSelect:u.setCropValues,boxWidth:t<300?t:300,boxHeight:n,aspectRatio:i})},setImageCrop:function(n,t){var i=t;photoSettings.photoType=="Passport"&&(aspectRatio=7/9,i=t/aspectRatio);u.cropData={ContactId:"00000000-0000-0000-0000-000000000000"};u.cropParams={X1:0,X2:t,Y1:0,Y2:i};u.jcrop_api.setImage(n,function(){this.animateTo([0,0,t,i])})},setCropValues:function(n){u.cropParams.X1=NextGen.Utils.FloatToInt(n.x);u.cropParams.X2=NextGen.Utils.FloatToInt(n.x2);u.cropParams.Y1=NextGen.Utils.FloatToInt(n.y);u.cropParams.Y2=NextGen.Utils.FloatToInt(n.y2);u.CroppedWidth=u.cropParams.X2-u.cropParams.X1;u.CroppedHeight=u.cropParams.Y2-u.cropParams.Y1;u.setCropInfo()},setCropInfo:function(){$("#croppedPhotoWidth").text(u.CroppedWidth+"px");$("#croppedPhotoHeight").text(u.CroppedHeight+"px")}}})})();
//# sourceMappingURL=components_d72ad7a23479481d8a4f0e51b567a141.map
(function(){function h(n,t){n.hasOwnProperty("LastName")&&(u=n,i(t.component.Scope))}function f(n,t){$(n).find("div[data-remove-guest-index]").each(function(){var i=$(this);i.off(".remove-guest");i.on("click.remove-guest",function(){var r=i.data("remove-guest-index");l(r,n,t)})})}function i(n){n&&NextGen.PageManager.GetCurrentPageNumber()!==NextGen.PageManager.GetSummaryPageNumber()&&(n.find("[data-defaultfromcontact]").each(function(){var n=$(this),i=n.find("input"),t;i.each(function(){var n=$(this),t=n.parents("[data-guest-index]").find('input[id*="_GuestNameGuestFieldsEdited"]'),r,i;return t.length>0&&t.val()==="true"?!0:(r=n.data("name"),i=u[r],i&&(n.val(i),n.trigger("change"),t.length>0&&t.trigger("change")),!0)});t=n.find("select");t.each(function(){var n=$(this),t=n.parents("[data-guest-index]").find('input[id*="_GuestNameGuestFieldsEdited"]'),r,i;return t.length>0&&t.val()==="true"?!0:(r=n.data("name"),i=u[r],i&&(i==="DietaryOther"?n.val(n.find('option[value*="DietaryOther"]').val()):n.val(i),n.trigger("change"),t.length>0&&t.trigger("change")),!0)})}),s(n))}function c(n,t){try{return parseInt(n,10)}catch(i){return t||0}}function s(n){n&&NextGen.PageManager.GetCurrentPageNumber()!==NextGen.PageManager.GetSummaryPageNumber()&&n.find('[data-inv-type="DiscountCode"]').each(function(){var n=$(this);n&&n.val().length>0&&n.trigger("change")})}function l(n,t,r){var u=NextGen.TemplateManager.MutateAppliedTemplateData(t,r,!0,function(t){return t.guestNames[n].GuestFunctionRegistrationId=null,t.guestNames[n].Title=null,t.guestNames[n].FirstName=null,t.guestNames[n].LastName=null,t.guestNames[n].Organization=null,t.guestNames[n].Position=null,t.guestNames[n].EmailAddress=null,t.guestNames[n].Postcode=null,t.guestNames[n].DietaryId=null,t.guestNames[n].DietaryId=null,t.guestNames[n].MobileNumber=null,t.guestNames[n].NameToBeConfimed="false",t.guestNames[n].GuestFieldsEdited="true",t});u.done(function(){i(t);f(t,r)})}function a(n){var r=[],t=[],i=$(n).find(":input.inv-aware").not("[name*='cst_']").not(".select2-focusser").not(":hidden");return i.length===0&&(i=$(n).find("select").not("[name*='cst_']").not(".select2-focusser")),i.each(function(n,t){r.push(v($(t)))}),t.push(NextGen.InventoryManager.IsInventoryAvailableByData(r)),$(t).each(function(t,i){i.done(function(t){t&&t.type&&$(t.result.Waitlists).each(function(i,r){var u=$(n).find("#"+r.ParentId);u&&u.trigger("after-inventory-checked",t)})});i.fail(function(t){$(t.result.Rejections).each(function(t,i){var r=$(n).find("#"+i.ParentId);r.inventoryInputWatcher().ShowInventoryErrorMessage(i.ParentId,NextGen.Localization.Messages.InventoryCheck.Full())});$.Deferred().reject().promise()})}),$.when.apply(this,t)}function e(n){var i=n.parents(".row").find(".input-type-number-add-to-waitlist"),t;return i&&(t=n.parents(".row").find('input[type=checkbox][name*="_InputTypeNumberAddToWaitListCheckBox"]'),t&&t.prop("checked")===!0)?!0:!1}function v(n){var t,i,r,u;if(n.is(":radio")&&n.is(":checked"))return(i=n.attr("id"),i&&i.length>0&&i.toLowerCase().indexOf("nooption")>0)?$.Deferred().resolve().promise():(t=NextGen.InventoryManager.GetInputMappedData("FunctionRegistration","radio",n),t.IsRequestingInventory="true",t);if(n.is(":checkbox")&&n.is(":checked"))return t=NextGen.InventoryManager.GetInputMappedData("FunctionRegistration","checkbox",n),t.IsRequestingInventory="true",e(n)&&(t.PaymentStatus="WaitListPurchase"),t;if(n.is("select")){if(n.is("[data-type=number]"))return t=NextGen.InventoryManager.GetInputMappedData("FunctionRegistration","selectnumber",n),t.IsRequestingInventory="true",e(n)&&(t.PaymentStatus="WaitListPurchase"),t;if(r=n.val(),r&&r.length>0&&(u=$("#"+r),u&&u.is(".inv-aware")))return t=NextGen.InventoryManager.GetInputMappedData("FunctionRegistration","select",u),t.IsRequestingInventory="true",t}else if(n.is(":text"))return t=NextGen.InventoryManager.GetInputMappedData("FunctionRegistration","text",n),t.IsRequestingInventory="true",e(n)&&(t.PaymentStatus="WaitListPurchase"),t;return $.Deferred().resolve().promise()}function y(n){var t=!0;return $(n).find('div[data-templateplaceholder="guestNames"]').not(":hidden").each(function(n,i){var e=$(i),r=!0,u=!1,f=0;e.find("div[data-guest-index]").each(function(n,i){var o=$(i),c,s,h,e;if(f++,c=o.find('input:checkbox[id*="_GuestNameNameToBeConfimed"]'),c&&c.prop("checked")===!0)return!0;var a=o.find('input:hidden[id*="_MatchGuestsToExitingContact"]'),l=o.find('input:hidden[id*="_GuestNameGuestFunctionRegistrationId"]'),e=o.find('input:text[id*="_GuestNameEmailAddress"]');return e.length>0&&e.val().length>0&&NextGen.ValidationManager.ValidateEmail(e.val(),!1)===!1?(NextGen.Alerts.warning(NextGen.Localization.Messages.FunctionRegistration.InvalidGuestEmail(f)),e.focus(),t=!1):(a.length>0&&(l.length===0||l.val()==="")&&(u=!0),!u)?!0:(s=o.find('input:text[id*="_GuestNameLastName"]'),s.length>0&&(r=$.trim(s.val()).length>0?!0:!1),r===!1&&s.length>0)?(s.focus(),t=!1,u?NextGen.Alerts.warning(NextGen.Localization.Messages.FunctionRegistration.GuestNameAndEmail()):NextGen.Alerts.warning(NextGen.Localization.Messages.FunctionRegistration.GuestDetails()),t):u&&(t&&(h=o.find('input:text[id*="_GuestNameFirstName"]'),h.length>0&&(r=$.trim(h.val()).length>0?!0:!1),r===!1&&h.length>0&&(t=!1,h.focus())),t&&(e=o.find('input:text[id*="_GuestNameEmailAddress"]'),e.length>0&&(r=e.val().length>0?!0:!1),r===!1&&e.length>0&&(t=!1,e.focus())),!t)?(NextGen.Alerts.warning(NextGen.Localization.Messages.FunctionRegistration.GuestNameAndEmail()),t):void 0})}),t}function t(n){if(n){var t=parseFloat(n.toString().replace(/,/g,""),10);return isNaN(t)?0:t}return 0}function p(n){var i=t(n.val());i++;n.val(i);n.change()}function w(n){var i=t(n.val());i<1?i=1:"";i--;n.val(i);n.change()}function b(n,t){return n?t<=n?t:n:t}function r(n){var r,u,f;if(r=n.is(":radio")||n.is(":checkbox")?n.is(":checked")?n.data("inv-quantity")?t(n.data("inv-quantity")):1:0:t(n.val()),u=n.parents(".row.form-group"),f=u.find("span.fee-amount"),f.length){var e=t(f.data("amount")),s=u.find("div.fee-summary"),i=n.closest(".component").find('[data-inv-referenceId="'+n.attr("id")+'"]'),h=b(i.data("available-inv")!==null?t(i.data("available-inv")):r,r),o=r>0&&i.length&&e>0?i.data("discount-amount")?t(i.data("discount-amount")):0:0,c=o&&i.data("discount-type")==2,l=e*r-o*(c?h:1);s.text(NextGen.Localization.FormatCurrency(l))}}function o(n,t){var u=$("#"+n.data().togglevisibility),e,r,o;u.length||!n.is("select")||!n.val()||n.data().inputType||n.attr("multiple")||(e=$("#"+n.val()).data().togglevisibility,u=$("#"+e));r=u.find('[data-templateplaceholder="guestNames"]');o=NextGen.TemplateManager.MutateAppliedTemplateData(r,t,!0,function(t){var u=[],r=t.ticketCount,i;for(n.is("[data-type=number]")&&(r=c(n.val())),r>99&&(r=99),i=0;i<r;i++)t.guestNames.length>i?u.push(t.guestNames[i]):u.push({guestIndex:i,guestNumber:i+1+"",defaultFromContact:i===0?t.defaultFromContact:undefined});return t.guestNames=u,t});o.done(function(){i(r);n.focus();f(r,t)})}function k(n){var i=$(n).find('input[data-inv-type="DiscountCode"]'),t=!0;return(i.each(function(n,i){var u=$(i),f=u.data("inv-referenceid"),r;if(f&&(r=$("#"+f),(r.is(":checked")||r.val()&&r.val()!="0")&&u.attr("required")&&u.is("[data-nosubmit]")))return t=!1,!1}),t)?$.Deferred().resolve().promise():(NextGen.Alerts.danger(NextGen.Localization.Messages.Validation.ValidDiscountCodeRequired()),$.Deferred().reject().promise())}var n={},u;n.events={};n.subscriptions=new NextGen.Messaging.SubscriptionManager;u={};n.events.onPageNavigated=function(n,t){t.component.PageNumber===n.toPage&&s(t.component.Scope)};NextGen.ValidationManager.RegisterCustomValidation("NextGen.Online.Components.Client.Functions.FunctionsComponent",function(n){var i=[],t=':hidden[name*="GuestName"]',r;return $(n).find('div[data-templateplaceholder="guestNames"]').not(":hidden").length>0&&($(n).find('input[data-name="NameToBeConfimed"]').length===0||$(n).find('input[data-name="NameToBeConfimed"]').not(":checked").length>0)&&(t="",$(n).find("div[data-guest-index]").each(function(){var n=$(this),u=n.data("guestDivId"),i=n.data("guestIndex"),r=':hidden[name^="'+u+'_GuestName"][name$="_'+i+'"]';(n.find('input[data-name="NameToBeConfimed"]').length===0||n.find('input[data-name="NameToBeConfimed"][name$="_'+i+'"]').not(":checked").length>0)&&(r=':hidden:not(:input[name^="cst_"][name$="_html_'+i+'"]), .cstField:hidden select[name$="_'+i+'"]');t=t+(t==""?"":", ")+r})),t=t+(t==""?"":", ")+':hidden[name$="DiscountCodeKey"]',r=NextGen.ValidationManager.RevalidateForm(n,{ignore:t}),NextGen.ValidationManager.ValidatePageForRadioButton(n)===!1&&i.push($.Deferred().reject().promise()),NextGen.ValidationManager.ValidatePageForCustomField(n)===!1&&i.push($.Deferred().reject().promise()),i.push(r?$.Deferred().resolve().promise():$.Deferred().reject().promise()),NextGen.InventoryEnforcedByPayment!==!0&&(NextGen.EditingExisting===!1||NextGen.SubmitManager.IsSubmissionHappening()===!1)&&i.push(a(n)),y(n)===!1&&i.push($.Deferred().reject().promise()),i.push(k(n)),$.when.apply(this,i)});NextGen.ComponentController.RegisterOnComponentDisposeCallback("NextGen.Online.Components.Client.Functions.FunctionsComponent",function(t){var i=NextGen.PageManager.GetVisiblePageNumbers(),r=NextGen.PageManager.GetPageNumber(t.Scope),u=$.inArray(r,i);u===-1&&n.subscriptions.UnsubscribeAll(t.Id)});NextGen.ComponentController.RegisterOnPageLoadCallback("NextGen.Online.Components.Client.Functions.FunctionsComponent",function(t){n.subscriptions.Subscribe("Page_Navigated",n.events.onPageNavigated,{component:t});$(t.Scope).find("[data-togglevisibility]").each(function(){var n=$(this),t=$("#"+n.data("togglevisibility"));i(t,!0)})});NextGen.ComponentController.RegisterOnSignInCompleteCallback("NextGen.Online.Components.Client.Functions.FunctionsComponent",function(t){n.subscriptions.Subscribe("Page_Navigated",n.events.onPageNavigated,{component:t});$(t.Scope).find("[data-togglevisibility]").each(function(){var n=$(this),t=$("#"+n.data("togglevisibility"));i(t)})});NextGen.ComponentController.RegisterOnComponentLoadCallback("NextGen.Online.Components.Client.Functions.FunctionsComponent",function(t){function s(n,t,i,r,u,f){return u&&(n.guestNames[i][t]=r.is(":checkbox")?r.is(":checked"):r.val()),t==="GuestFieldsEdited"?n.guestNames[i].GuestFieldsEdited="false":n.guestNames[i]&&(n.guestNames[i][t]=r.is(":checkbox")?r.is(":checked"):r.val()),f&&r.attr("name").indexOf("_GuestNameBookingContactOnly")>1&&onInputElementChange(),n}function c(n,t,i,r){return t==="DietaryId"&&(console.warn("changinInput.val()",r.val()),r.val().indexOf("DietaryOther")>-1?n.guestNames[i].showOther=!0:(n.guestNames[i].showOther=!1,n.guestNames[i].DietaryOther="")),n.guestNames[i][t]=r.val(),n.guestNames[i].GuestFieldsEdited="true",n}function l(n){var t=n.data("select2").selection;(t.container.$container.hasClass("select2-container--open")||t.container.$container.hasClass("select2-container--focus"))&&t.trigger("toggle",{})}var e={},a,u;n.subscriptions.Subscribe("ContactComponent_ContactNameChanged",NextGen.Logger.errorWrap(h),{component:t});$(t.Scope).find('input[data-inv-type="DiscountCode"]').each(function(){var n=$(this);n.off("after-inventory-checked");n.on("after-inventory-checked",function(n,t){var i=$(this),u,f;i.data("discount-amount",t&&t.result&&t.result.Holds.length?t.result.Holds[0].DiscountAmount:0);i.data("discount-type",t&&t.result&&t.result.Holds.length?t.result.Holds[0].DiscountType:undefined);i.data("available-inv",t&&t.result&&t.result.Holds.length?t.result.Holds[0].AvailableInventoryQuantity:undefined);console.warn("result.result.Holds[0].DiscountType",t&&t.result&&t.result.Holds.length?t.result.Holds[0].DiscountType:undefined);u=i.data("inv-referenceid");u&&(f="#"+u,r($(f)));t.type==="Rejection"&&i.val()===""&&(i.siblings("span.theme-text-info-input.theme-label-primary").text(""),i.siblings("span.label-primary").text(""))})});$(t.Scope).find("[data-togglevisibility]").each(function(){var n=$(this),t=$("#"+n.data("togglevisibility"));t.on("togglevisibility-on",NextGen.Logger.errorWrap(function(){i($(this))}))});$(t.Scope).find('[id$="_Decrease"]').each(function(){var n=$(this);n.off(".decrease-value");n.on("click.decrease-value",function(){var t=n.parent().find("input.theme-number");t&&w(t)})});$(t.Scope).find('[id$="_Increase"]').each(function(){var n=$(this);n.off(".increase-value");n.on("click.increase-value",function(){var t=n.parent().find("input.theme-number");t&&p(t)})});$(t.Scope).find("input.theme-number").each(function(){var n=$(this);n&&r(n);n.on("change",function(){$(this)&&r($(this))})});$(t.Scope).find('[data-type="number"][data-togglevisibility]').each(function(){var i=$(this),u=$("#"+i.data().togglevisibility),n=u.find('[data-templateplaceholder="guestNames"]'),r;if(n.length>0){n.on("change","input",function(){var i=$(this),r=i.data("name"),u=i.closest("[data-guest-index]").data("guest-index"),e=NextGen.TemplateManager.MutateAppliedTemplateData(n,t,r==="NameToBeConfimed",function(n){return s(n,r,u,i)});e.done(function(){f(n,t)})});n.on("change","select",function(){var i=$(this),r=i.data("name"),u=i.closest("[data-guest-index]").data("guest-index"),f=NextGen.TemplateManager.MutateAppliedTemplateData(n,t,!0,function(n){return c(n,r,u,i)});f.done(function(){});r==="DietaryId"&&i.val().length===0&&l(i)});r=function(){o(i,t)};r();i.on("change",NextGen.Logger.errorWrap(r))}});a=function(){var n=$(this);n.off("after-inventory-checked");n.on("after-inventory-checked",function(t,i){var r=n.parents(".row").find(".input-type-number-add-to-waitlist");if(r&&r.length>0){var u=n.parents(".row").find('input[type=checkbox][name*="_InputTypeNumberAddToWaitListCheckBox"]'),f=n.parents(".row").find(".exhausted_label"),e=n&&n.context&&n.context.id?n.context.id:n.attr("id"),o=e!==null?n.parents(".form-horizontal").find('input[type=hidden][name="'+e+'_AddToWaitList"]'):null;i.type==="Waitlist"?(u&&u.prop("checked",!0),r.show(),f.show()):i.type==="NoAction"&&o&&o.length===1||(u&&u.prop("checked",!1),r.hide(),f.hide())}})};$(t.Scope).find('.inv-aware:not([data-inv-type="DiscountCode"])').each(a);$(t.Scope).find("select").each(function(){var n=$(this),i;if(!n.data().inputType&&!n.attr("multiple")){i=function(){o(n,t);var i=n.val();n.find("option").each(function(){var n=$(this),t,r;n.val()!==""&&$("#"+n.val()).data()&&(t=$("#"+n.val()).data().togglevisibility,t!==undefined&&(r=t.split(","),r.forEach(function(t){var r=$("#"+t);n.val()===i?r.show():r.hide()})))})};n.on("change",NextGen.Logger.errorWrap(i));n.find("option").each(function(){var i=$(this);if(i.val()!==""&&$("#"+i.val()).data()){var r=$("#"+i.val()).data().togglevisibility,u=$("#"+r),n=u.find('[data-templateplaceholder="guestNames"]');if(n.length>0){n.on("change","input",function(){var i=$(this),r=i.data("name"),u=i.closest("[data-guest-index]").data("guest-index"),f=NextGen.TemplateManager.MutateAppliedTemplateData(n,t,r==="NameToBeConfimed",function(n){return s(n,r,u,i,!0)});f.done(function(){})});n.on("change","select",function(){var i=$(this),r=i.data("name"),u=i.closest("[data-guest-index]").data("guest-index"),f=NextGen.TemplateManager.MutateAppliedTemplateData(n,t,!0,function(n){return c(n,r,u,i)});f.done(function(){})})}}})}n.on("select2-selecting",function(t){var r=n.parents("form").find(":hidden:input[name='"+t.val+"_AddToWaitList']"),u=n.parents().find(".input-type-dropdown-add-to-waitlist-"+$(this).val()),i;u&&u.hide();i=n.parents().find(".input-type-dropdown-add-to-waitlist-"+t.val);r&&r.val()==="true"&&i&&i.show()})});$(t.Scope).find('[data-input-type="radio"],[data-input-type="checkbox"]').each(function(){var n=$(this),u;if(n.data().inputType==="radio"||n.data().inputType==="checkbox"){u=function(){o(n,t)};u();r(n);n.on("change",function(){r($(this));NextGen.Logger.errorWrap(u())});n.on("inputgroup-unchecked",function(){r($(this))});var f=n.data().togglevisibility,e=$("#"+f),i=e.find('[data-templateplaceholder="guestNames"]');if(i.length>0){i.on("change","input",function(){var n=$(this),r=n.data("name"),u=n.closest("[data-guest-index]").data("guest-index"),f=NextGen.TemplateManager.MutateAppliedTemplateData(i,t,r==="NameToBeConfimed",function(t){return s(t,r,u,n,!0,!0)});f.done(function(){})});i.on("change","select",function(){var n=$(this),r=n.data("name"),u=n.closest("[data-guest-index]").data("guest-index"),f=NextGen.TemplateManager.MutateAppliedTemplateData(i,t,!0,function(t){return c(t,r,u,n)});f.done(function(){});r==="DietaryId"&&n.val().length===0&&l(n)})}}});u=$(t.Scope).find(".form-group").not(".cstField");u.find(":input:radio").not('input[type="hidden"]').on("after-change",function(){var n=NextGen.ValidationManager.HasValue(t.Scope,!0);n===!1&&t.Scope.find(".cstField :radio:checked").prop("checked",!1).change()});u.find(":input").not('input[type="hidden"]').on("change",function(){var n=NextGen.ValidationManager.HasValue(t.Scope,!0);n===!1&&t.Scope.find(".cstField :radio:checked").prop("checked",!1).change()});u.find(":input:checkbox").each(function(){$(this).on("change",function(){this.checked||$(this).closest("form").find(".cstField").each(function(n,t){$(t).find('input[id^="cst_"], select[id^="cst_"]').each(function(n,t){t.type==="select-one"?$(t).val("").trigger("change"):$(t).val("")})})})});e.onAddToWaitListChecked=function(){var n=$(this),i=n.parents(".row").find('[data-input-type="number"]'),u=n.parents(".row").find('[data-input-type="radio"]'),r=n.parents(".row").find('[data-input-type="checkbox"]'),t;n.is(":checked")||(i.length>0?(i.val("0").change(),t=n.parents(".row").find(".input-type-number-add-to-waitlist"),t&&t.hide(),n.checked=!1):r.length>0?r.prop("checked",!1).change():u.length>0&&n.prop("checked",!0))};NextGen.Logger.errorWrap(e);t.Scope.off(".function-component");t.Scope.on("click.function-component",'input[type=checkbox][name*="_InputTypeNumberAddToWaitListCheckBox"]',e.onAddToWaitListChecked)})})();
//# sourceMappingURL=components_d72ad7a23479481d8a4f0e51b567a141.map
var NextGen=NextGen||{};(function(){function n(n){var t=$(n).find("input[name=AttendeeAppConsent]:checked").val(),i=$("#AttendeeAppConsentRequired").val()==="true";return i&&(typeof t=="undefined"||t==null||t=="")?(NextGen.Alerts.warning($("#AttendeeAppConsentRequiredMessage").text()),!1):!0}function t(n){$.ajax({url:NextGen.ClientUrls.GetAttendeeAppConsentInfo,type:"POST",data:{languageId:n},success:function(n){$("#AttendeeAppConsentInfo").html(n.infoHtml)}})}NextGen.ValidationManager.RegisterCustomValidation("NextGen.Online.Components.Client.GDPR.AttendeeAppConsent.AttendeeAppConsentComponent",function(t){var i=[];return n(t)===!1&&i.push($.Deferred().reject().promise()),$.when.apply(this,i)});NextGen.ComponentController.RegisterOnComponentLoadCallback("NextGen.Online.Components.Client.GDPR.AttendeeAppConsent.AttendeeAppConsentComponent",function(n){var i=$(n.Scope).find("input[data-languageId]").first().val();t(i)})})();
//# sourceMappingURL=components_d72ad7a23479481d8a4f0e51b567a141.map
var NextGen=NextGen||{};(function(){function n(n){if(!$("input[name=DataProcessingConsent]").length)return!0;var t=$(n).find("input[name=DataProcessingConsent]:checked").val();return typeof t=="undefined"||t==null||t==""?(NextGen.Alerts.warning($("#DataProcessingConsentRequiredMessage").text()),!1):t==="False"?($("#DataProcessingConsentWithdrawModal").modal("show"),!1):!0}function t(n){$.ajax({url:NextGen.ClientUrls.GetDataProcessingConsentInfo,type:"POST",data:{languageId:n},success:function(n){$("#DataProcessingConsentInfo").html(n.infoHtml);$("#DataProcessingConsentWithdrawHeading").html(n.consentWithdrawHeading);$("#DataProcessingConsentWithdrawMessage").html(n.consentWithdrawMessage)}})}NextGen.ValidationManager.RegisterCustomValidation("NextGen.Online.Components.Client.GDPR.DataProcessingConsent.DataProcessingConsentComponent",function(t){var i=[];return n(t)===!1&&i.push($.Deferred().reject().promise()),$.when.apply(this,i)});NextGen.ComponentController.RegisterOnComponentLoadCallback("NextGen.Online.Components.Client.GDPR.DataProcessingConsent.DataProcessingConsentComponent",function(n){var i=$(n.Scope).find("input[data-languageId]").first().val();t(i);$(n.Scope).find("#DataProcessingConsentWithdrawButton").on("click",function(){var n={languageId:i},t,r;$("input[name=AttendeeAppConsent]").length>0&&(t=$("input[name=AttendeeAppConsent]:checked").val(),n.aac=t);r="?"+$.param(n);NextGen.Redirect.Get(NextGen.ClientUrls.DataProcessingConsentWithDrawn+r)})})})();
//# sourceMappingURL=components_d72ad7a23479481d8a4f0e51b567a141.map
var NextGen=NextGen||{};(function(){function t(n,t){NextGen.TemplateManager.MutateAppliedTemplateData(n,t,!0,function(){return NextGen.GroupManager.GetGroupMemberBindingData()})}function u(n){var t=n.find('[name="FirstName"]').val(),i=n.find('[name="LastName"]').val(),r=n.find('[name="Organization"]').val(),u=n.find('[name="Department"]').val(),f=n.find('[name="SubDepartment"]').val(),e=n.find('[name="OfficeNumber"]').val();NextGen.GroupManager.SetContactName(0,t,i,r,u,f,e)}function e(n){var t=NextGen.GroupManager.GetContact(0),i=n.find('[name="FirstName"]'),r;i.val(t.FirstName);r=n.find('[name="LastName"]');r.val(t.LastName);i.hasClass("theme-textbox")&&(t.FirstName&&i.addClass("field--not-empty"),t.LastName&&r.addClass("field--not-empty"))}function i(n){if(n.element){var t=$(n.element);if(t&&t.data().right)return $.parseHTML(n.text+'<span class="pull-right">'+t.data().right+"<\/div>")}return n.text}function f(n,t,r,u){$.ajax(u,{type:"POST",global:!1,data:{country:t}}).done(function(t){var f,u,e;if(t.length){if(r){for(f=!1,u=0;u<t.length;u++)if(t[u].id===r){f=!0;break}f||t.push({id:r,text:r})}e=NextGen.Themes.HasTheme(n);n.hasClass("theme-textbox")&&(n.removeClass("theme-textbox"),n.addClass("theme-select"));e===!0?(n.select2({templateResult:i,maximumSelectionSize:1,width:"off",dropdownAutoWidth:"auto",theme:"bootstrap form-control theme-select",containerCssClass:"ignore-validation",data:t,sortResults:n.data("nice-sort")===!0?NextGen.Utils.NiceSelect2Sort:undefined,adaptDropdownCssClass:function(n){return n}}).trigger("change"),n.attr("title","")):n.select2({templateResult:i,maximumSelectionSize:1,width:"off",dropdownAutoWidth:"auto",theme:"bootstrap form-control",containerCssClass:"ignore-validation",data:t,sortResults:n.data("nice-sort")===!0?NextGen.Utils.NiceSelect2Sort:undefined}).trigger("change");r&&n.select2("val",[r])}else n.select2("destroy")}).fail(function(){})}function o(n){var i=n.attr("id"),t=$("input[data-parentid="+i+"]");if(t.length){var e="#"+t.attr("name")+"_data",r=$(e).val(),o="#"+t.attr("name")+"_value",u=$(o).val();n.on("change",function(){var n=$(this).val();f(t,n,u,r)});f(t,$("#"+i).val(),u,r)}}function s(n){var e,r;if(!NextGen.GroupManager.GetGroupContactAttending()){var u=$(n).find('input:text[id$="_LastName"]'),f=$(n).find('input:text[id$="_Organization"]'),i=$(n).find('input:text[id$="_EmailAddress"]'),o=$(n).find('label.field-required[for$="_Photo"]'),t=!0;if(u.length>0&&(t=u.val().length>0?!0:!1),t===!1&&f.length>0&&(t=f.val().length>0?!0:!1),i.length>0){if(e=$(n).find('label[for$="_EmailAddress"]').text(),i.val().length>0&&NextGen.ValidationManager.ValidateEmail(i.val(),!1)===!1)return NextGen.Alerts.warning(NextGen.Localization.Messages.Contact.EmailInvalid(e)),!1;NextGen.Alerts.clear();t===!1&&(t=i.val().length>0?!0:!1)}if(t===!1&&(u.length>0||f.length>0||i.length>0))return NextGen.Alerts.warning(NextGen.Localization.Messages.Contact.RequiredFields()),!1;if(o.length>0&&($(n).find('img[id$="photoResult"]').length==0||$(n).find('img[id$="photoResult"]').css("display")==="none")||(r=n.find("#photoResult"),r.attr("required")==="required"&&typeof r.attr("src")=="undefined"||r.attr("src")===""))return NextGen.Alerts.warning(NextGen.Localization.Messages.Contact.PhotoIsRequired()),!1}return!0}var n={},r;n.events={};n.subscriptions=new NextGen.Messaging.SubscriptionManager;r=5242880;n.events.onPageNavigated=function(n,i){i.component.PageNumber===n.toPage&&NextGen.GroupManager.SwitchToContactAsync(0).then(function(){var n=i.component.Scope.find("[data-templateplaceholder][data-templatesource]");t(n,i.component)})};n.events.onContactNameChanged=function(n,i){var u=i.component.Scope.find("[data-templateplaceholder][data-templatesource]"),r=NextGen.GroupManager.GetCurrentContactNumber(),f=NextGen.GroupManager.SetContactName(r,n.FirstName,n.LastName,n.Organization,n.Department,n.SubDepartment,n.OfficeNumber);f&&r===0&&t(u,i.component)};NextGen.ComponentController.RegisterOnPageLoadCallback("NextGen.Online.Components.Client.Group.GroupComponent",function(i){n.subscriptions.Subscribe("Page_Navigated",n.events.onPageNavigated,{component:i});n.subscriptions.Subscribe("ContactComponent_ContactNameChanged",n.events.onContactNameChanged,{component:i});i.Scope.on("click","button[data-removecontact]",function(){var r=$(this),u=r.data().removecontact,n;return NextGen.GroupManager.RemoveContact(u),n=i.Scope.find("[data-templateplaceholder][data-templatesource]"),t(n,i),!1})});NextGen.ComponentController.RegisterOnComponentLoadCallback("NextGen.Online.Components.Client.Group.GroupComponent",function(n){function et(n,t,i,r){t=r>t?r:t;h.empty();for(var u=t;u<=i;u++)h.append($('<option value="'+u+'">'+u+" <\/option>"));n=n<t?t:n>i?i:n;h.val(n).trigger("change")}function ot(){var n=ft.filter(function(n,t){var i=$(t);return i.attr("type")==="radio"?i.prop("checked"):!0}).val();if(n==="AllToGroupContact")return!0;if(n==="AllToGroupMembers")return!1;throw new Error("Unexpected group payment option: "+n);}function d(){return k.filter(function(){return $(this).prop("checked")}).first()}function g(){var n=NextGen.GroupManager.IsGroup(),t;at.toggle(n);l.toggle(n);t=p(d());ut.toggle(n||t&&t.max>1)}function wt(){NextGen.Logger.debug("File upload completed successfully")}function bt(n,t){NextGen.Logger.error(t);t.error&&NextGen.Logger.debug(t.error);NextGen.Alerts.warning(NextGen.Localization.Messages.FileUpload.Failed())}function kt(n){rt(n.DataUri);NextGen.Messaging.Publish("Page_Processed")}function dt(n,t){return $.ajax({url:NextGen.ClientUrls.SaveCropedPhotoPost,data:{dataUri:n,cropData:t},type:"POST"})}function rt(n,t){t.photoPreviewImage[0].src=n;t.photoPreviewImage.on("load",function(){var r=window.innerHeight>0?window.innerHeight:screen.height,e=0,i,u;(r<t.photoPreviewImage[0].naturalWidth||r<t.photoPreviewImage[0].naturalHeight)&&(e=r-120);i=window.innerWidth>0?window.innerWidth:screen.width;u=0;(i<t.photoPreviewImage[0].naturalWidth||i<t.photoPreviewImage[0].naturalWidth)&&(u=i-50);f.init(e,u);f.setImageCrop(n,t.photoPreviewImage[0].naturalWidth===0?300:t.photoPreviewImage[0].naturalWidth);Webcam.acceptButton.show();Webcam.captureButton.hide();t.backButton.show();t.browsePhotoButton.hide();t.livePhotoImageContainer.hide();t.photoPreviewImageContainer.show();try{Webcam.reset()}catch(o){}})}function ht(n){n.livePhotoImageContainer.show();Webcam.on("error",function(t){console.log(t);n.livePhotoImageContainer.hide()});Webcam.set({width:300,height:300,dest_width:300,dest_height:300,image_format:"jpeg",jpeg_quality:95});Webcam.setSWFLocation("/scripts/webcam.swf");isMobile.apple.device||isMobile.android.device||Webcam.attach("#video_GroupComponent");n.Scope.find("#TakePhoto_GroupComponent").length>0&&(Webcam.captureButton=n.Scope.find("#TakePhoto_GroupComponent"),Webcam.acceptButton=n.Scope.find("#AcceptPhoto_GroupComponent"));Webcam.on("live",function(){Webcam.acceptButton.is(":visible")||Webcam.captureButton.show();n.hasLiveCamera=!0;var t=$("video")[0];t.onplaying=function(){var n=t.videoHeight/t.videoWidth;Webcam.set({dest_width:300,dest_height:300*n})}});n.photoPreviewImage.src="";Webcam.acceptButton.hide();Webcam.live===!0&&Webcam.captureButton.show();n.backButton.hide();n.browsePhotoButton.show();n.photoPreviewImageContainer.hide()}var w,st,p,b,s,c;if(NextGen.GroupManager.GetCurrentContactNumber()===0){var y=n.Scope.find("#notAttending"),at=n.Scope.find("#group-settings"),h=n.Scope.find('select[name="membersCount"]'),k=n.Scope.find('[data-inputtype="_GroupRegistration"]'),l=n.Scope.find("[data-templateplaceholder][data-templatesource]"),ut=n.Scope.find("#group-component-details"),a=n.Scope.find("#GroupContactAreaId"),ft=n.Scope.find('[name="groupPaymentOption"]'),vt=n.Scope.find("#groupMembersSource"),yt=n.Scope.find("#displayAmounts"),pt=n.Scope.find("#displayTotal");if(NextGen.GroupManager.SetDisplayAmountValues(yt.val()==="True",pt.val()==="True"),w=[],k.each(function(){var t=$(this),n=t.data(),i=n.mingroupsize,r=n.maxgroupsize,u=n.discountCode,f=n.groupdiscountmode;w.push({id:t.attr("id"),input:t,min:i,max:r,discountCode:u,discountMode:f})}),st=function(n){$.each(w,function(t,i){i.max<n?i.input.prop("disabled",!0):i.input.prop("disabled",!1)})},p=function(n){var t=n.attr("id");return NextGen.Utils.FirstOrDefault(w,function(n,i){return i.id===t})},NextGen.GroupManager.IsInitialized())a.toggle(!NextGen.GroupManager.GetGroupContactAttending());else{var nt=y.length>0?NextGen.Utils.InputAsBoolean(y):null,tt=NextGen.TemplateManager.GetAppliedTemplateData(l,n),it=tt.members.length,v=p(d());for(v&&v.min>it&&(it=v.min),NextGen.GroupManager.SetGroupContactAttending(!nt),NextGen.GroupManager.SetGroupContactPays(ot()),NextGen.GroupManager.SetMemberCount(it,!1),v&&NextGen.GroupManager.SetDiscountCode(v.discountCode,v.discountMode),nt&&u(a),b=0;b<tt.members.length;b++)s=tt.members[b],c=NextGen.GroupManager.GetContact(s.number),c&&(c.FirstName=s.firstName||s.FirstName||null,c.LastName=s.lastName||s.LastName||null,c.completed=!!s.completed,c.submitted=!!s.submitted,c.contactId=s.contactId||null,c.discountCode=s.discountCode||null);a.toggle(nt)}g();t(l,n);y.on("change",function(){var r=y.prop("checked"),o=NextGen.GroupManager.GetGroupContactAttending(),i=NextGen.GroupManager.GetMemberCount(),u=parseInt($("#membersCount option").first().val()),f=parseInt($("#membersCount option").last().val());if(i<u&&(i=u),o===!1&&r===!1&&u!==f){if(i===f){NextGen.Alerts.warning(NextGen.Localization.Messages.Group.MaxError());y.prop("checked","checked");return}i++}a.toggle(r);i>NextGen.GroupManager.GetMemberCount()&&h.val(i).trigger("change");NextGen.GroupManager.SetGroupContactAttending(!r);r&&e(a);i<NextGen.GroupManager.GetMemberCount()&&h.val(i).trigger("change");t(l,n)});a.on("change",'[name="FirstName"],[name="LastName"],[name="Organization"],[name="Department"],[name="SubDepartment"],[name="OfficeNumber"]',function(){var i=$(this),n=i.val(),t=i.attr("name");t==="FirstName"?NextGen.GroupManager.SetContactName(0,n,null,null,null,null,null):t==="LastName"?NextGen.GroupManager.SetContactName(0,null,n,null,null,null,null):t==="Organization"?NextGen.GroupManager.SetContactName(0,null,null,n,null,null,null):t==="Department"?NextGen.GroupManager.SetContactName(0,null,null,null,n,null,null):t==="SubDepartment"?NextGen.GroupManager.SetContactName(0,null,null,null,null,n,null):t==="OfficeNumber"&&NextGen.GroupManager.SetContactName(0,null,null,null,null,null,n);!NextGen.EditingExisting&&NextGen.Logic.Processor.HasAnyLogicForComponent(NextGen.GroupManager.GetGroupComponentId())&&NextGen.GroupManager.SetAllContactIncomplete(!0)});h.on("change",function(){var i=$(this),r=+i.val(),u=NextGen.GroupManager.SetMemberCount(r,!0);u&&(g(),t(l,n))});ut.on("change","[data-templated]",function(){var i=$(this),r=i.closest("[data-context]").data("context"),u=i.data().fieldname,f=i.val(),e=NextGen.GroupManager.GetContact(r);e[u]=f;t(l,n)});k.on("after-change",function(){if($(this).prop("checked")!==!1){var t=NextGen.GroupManager.GetMaxCompletedMemberNumber(),n=p($(this));NextGen.GroupManager.SetDiscountCode(n.discountCode,n.discountMode);et(+h.val(),n.min,n.max,t);g();!NextGen.EditingExisting&&NextGen.Logic.Processor.HasAnyLogicForComponent(NextGen.GroupManager.GetGroupComponentId())&&NextGen.GroupManager.SetAllContactIncomplete(!0);n.discountCode&&NextGen.Messaging.Publish("GroupComponent_OptionChanged");NextGen.GroupManager.SetGroupOptionChanged(!0)}});ft.on("change",function(){NextGen.GroupManager.SetGroupContactPays(ot())});vt.on("change",function(){var i=NextGen.GroupManager.GetMaxCompletedMemberNumber(),n=d(),t=p(n);t&&($(n).attr("disabled")===!1||!$(n).attr("disabled"))&&(et(+h.val(),t.min,t.max,i),st(i))});n.Scope.find("select[data-dietary]").each(function(){var t=$(this);t.on("change",function(){if($(this)){var i=$(this).val(),t=n.Scope.find("#dietaryOtherDiv");i&&t&&(i.includes("DietaryOther")?t.show():(n.Scope.find("#DietaryOther").val(""),t.hide()))}})});n.Scope.find("input[data-country]").each(function(){var r="#"+$(this).attr("name")+"_data",u=$(r).val(),f="#"+$(this).attr("name")+"_value",t=$(f).val(),n=$(this);$.ajax(u,{type:"POST",global:!1}).done(function(r){var f,u,e;if(r.length){if(t){for(f=!1,u=0;u<r.length;u++)if(r[u].id===t){f=!0;break}f||r.push({id:t,text:t})}e=NextGen.Themes.HasTheme(n);e===!0?(n.select2({templateResult:i,maximumSelectionSize:1,width:"off",dropdownAutoWidth:"auto",theme:"bootstrap form-control theme-select",containerCssClass:"ignore-validation",data:r,sortResults:n.data("nice-sort")===!0?NextGen.Utils.NiceSelect2Sort:NextGen.Utils.StartingWithSelect2Sort,adaptDropdownCssClass:function(n){return n},valueSeparator:"|,"}),n.attr("title","")):n.select2({templateResult:i,maximumSelectionSize:1,width:"off",dropdownAutoWidth:"auto",theme:"bootstrap form-control",containerCssClass:"ignore-validation",data:r,sortResults:n.data("nice-sort")===!0?NextGen.Utils.NiceSelect2Sort:NextGen.Utils.StartingWithSelect2Sort,valueSeparator:"|,"});t&&n.select2("val",[t]);o(n)}}).fail(function(){})});n.photoPopUpButton=n.Scope.find("a#capture-photo-button-"+n.Id);NextGen.Controls.Lightbox.Create(n.photoPopUpButton,{closeOnBgClick:!1,closeBtnInside:!0});n.photoPreviewImage=n.Scope.find("#photoPreview");n.photoPreviewImageContainer=n.Scope.find("#preview-container");n.photoImage=n.Scope.find("#photoResult");n.livePhotoImageContainer=n.Scope.find("#video-container");n.takePhotoButton=n.Scope.find("button.take-photo");n.removePhotoButton=n.Scope.find("button.remove-photo");n.acceptPhotoButton=n.Scope.find("button.accept-photo");n.backButton=n.Scope.find("button.back-photo");n.browsePhotoButton=n.Scope.find("button.browse-photo");n.photoFileInput=n.Scope.find("#browsePhoto");n.addReplacePhotoButton=n.Scope.find("button.add-replace-photo");n.photoMaxFileSizeError=n.Scope.find("#photoMaxFileSizeError");n.removePhotoButton.on("click",function(){n.photoImage[0].src="";var t=$(n.photoImage[0]).closest("div.form-group");t.find("[data-existing-filename]").val("").trigger("change");t.find("[data-existing-mime-type]").val("").trigger("change");t.find("[data-existing-content-encoding]").val("").trigger("change");t.find("[data-existing-content-sharedCacheKey]").val("").trigger("change");t.find("[data-existing-uri]").val("").trigger("change");n.removePhotoButton.hide();n.photoImage.hide();n.Scope.find("#photoResult").closest(".theme-photo-preview").hide();n.Scope.find("#photoResult").closest(".theme-photo-preview").siblings(".theme-photo-btn-box").find("label").show()});n.takePhotoButton.on("click",function(){Webcam.snap(function(t){rt(t,n)})});n.browsePhotoButton.on("click",function(){n.photoFileInput.on("change",NextGen.Logger.errorWrap(function(){var i=$(this),e=window.File&&window.FileReader&&window.FileList&&window.Blob,t,u,f;if(e){if(t=n.photoFileInput[0].files[0],t&&t.size>r){n.photoMaxFileSizeError.show();return}n.photoMaxFileSizeError.hide();u=new FileReader;u.onload=function(t){rt(t.target.result,n)};u.readAsDataURL(t);i.replaceWith(i.val(null).clone())}else f=$('<div class="alert alert-info"><span class="glyphicon glyphicon-upload"><\/span>&nbsp;{msg}<\/div>'.replace(/\{msg\}/g,NextGen.Localization.Messages.FileUpload.Uploading())),i.uploadFile(NextGen.ClientUrls.UploadPost,f,wt,bt,kt).timeout(3e5)}));n.photoFileInput.click()});n.acceptPhotoButton.on("click",function(){if(f.CroppedWidth==0||f.CroppedHeight==0){alert("Please crop photo");return}f.cropData.CropImageParams=f.cropParams;var t=$('<span class="ajax-spinner"><\/span>');t.insertAfter(n.acceptPhotoButton);$.when(dt(n.photoPreviewImage[0].src,JSON.stringify(f.cropData))).done(function(i){t.remove();n.photoImage[0].src=i.DataUri;n.photoImage.show();n.Scope.find("#photoResult").closest(".theme-photo-preview").show();n.Scope.find("#photoResult").closest(".theme-photo-preview").siblings(".theme-photo-btn-box").find("label").hide();var r=$(n.photoImage[0]).closest("div.form-group");r.find("[data-existing-filename]").val(i?i.FileName:"").trigger("change");r.find("[data-existing-mime-type]").val(i?i.MimeType:"").trigger("change");r.find("[data-existing-content-encoding]").val(i?i.ContentEncoding:"").trigger("change");r.find("[data-existing-content-sharedCacheKey]").val(i?i.SharedCacheKey:"").trigger("change");r.find("[data-existing-uri]").val(i?i.DataUri:"").trigger("change");n.removePhotoButton.show();try{Webcam.reset()}catch(u){}NextGen.Controls.Lightbox.Close()})});n.addReplacePhotoButton.on("click",function(){ht(n);n.photoPopUpButton.click()});n.backButton.on("click",function(){ht(n)});var ct=300,lt=300,f={init:function(n,t){var i=ct/lt;photoSettings.photoType=="Passport"&&(i=7/9,lt=ct/i);f.jcrop_api&&f.jcrop_api.destroy();$(".jcrop-holder").remove();f.jcrop_api=$.Jcrop("#photoPreview",{onChange:f.setCropValues,onSelect:f.setCropValues,boxWidth:t<300?t:300,boxHeight:n,aspectRatio:i})},setImageCrop:function(n,t){var i=t;photoSettings.photoType=="Passport"&&(aspectRatio=7/9,i=t/aspectRatio);f.cropData={ContactId:"00000000-0000-0000-0000-000000000000"};f.cropParams={X1:0,X2:t,Y1:0,Y2:i};f.jcrop_api.setImage(n,function(){this.animateTo([0,0,t,i])})},setCropValues:function(n){f.cropParams.X1=NextGen.Utils.FloatToInt(n.x);f.cropParams.X2=NextGen.Utils.FloatToInt(n.x2);f.cropParams.Y1=NextGen.Utils.FloatToInt(n.y);f.cropParams.Y2=NextGen.Utils.FloatToInt(n.y2);f.CroppedWidth=f.cropParams.X2-f.cropParams.X1;f.CroppedHeight=f.cropParams.Y2-f.cropParams.Y1;f.setCropInfo()},setCropInfo:function(){$("#croppedPhotoWidth").text(f.CroppedWidth+"px");$("#croppedPhotoHeight").text(f.CroppedHeight+"px")}}}});NextGen.ValidationManager.RegisterCustomValidation("NextGen.Online.Components.Client.Group.GroupComponent",function(n){var i,r,h,t,u,f,c,l,e,o;return s(n)===!1?!1:NextGen.ValidationManager.ValidatePageForRadioButton(n)===!1?!1:NextGen.ValidationManager.ValidatePageForCustomField(n)===!1?!1:(i=n.find("#GroupContactAreaId"),i.length&&(r=n.find("select[data-dietary]"),r.length&&(h=r.val(),t=n.find('input[id="DietaryOther"]'),t&&(u=t.val(),h.includes("DietaryOther")&&(u===null||u==="")?t.attr("required",""):t.removeAttr("required")))),n.find('button[id*="area_"]').each(function(t,i){var r=$(i);n.find("#"+r.attr("id")).each(function(n,t){var i=$(t);i&&(r.is(":hidden")&&i.attr("required")&&i.attr("originalAttibute","required").removeAttr("required"),!r.is(":hidden")&&i.attr("originalAttibute")&&i.attr("originalAttibute")==="required"&&i.attr("required","required").removeAttr("originalAttibute"))})}),f=":hidden",i.length&&(c=$(i[0]),f=c.is(":hidden")?":hidden":':hidden:not(select, :input[name^="cst_"][name$="_html"], .theme-select, .classic-select), .cstField:hidden select'),l=NextGen.ValidationManager.RevalidateForm(n,{ignore:f}),!NextGen.GroupManager.GetGroupContactAttending()&&(e=n.find('input:radio[name$="Privacy"]'),e.length>0&&(o=!1,e.each(function(n,t){var i=$(t);i.is(":checked")&&(o=!0)}),o===!1)))?(NextGen.Alerts.warning(NextGen.Localization.Messages.Contact.PrivacyOptionRequired()),!1):l});NextGen.PageManager.RegisterForwardAction("NextGen.Online.Components.Client.Group.GroupComponent",function(n){function i(){return NextGen.GroupManager.GetGroupContactAttending()?$.Deferred().resolve().promise():NextGen.SummaryManager.LoadSummaryForNonAttendingGroupContact()}NextGen.GroupManager.GetGroupContactAttending()===!1&&u(n.Scope.find("#GroupContactAreaId"));var t=$.Deferred();return i().done(function(){NextGen.GroupManager.SwitchToFirstNonRegisteredContactAsync(NextGen.GroupManager.GetGroupContactAttending()===!1).done(function(){NextGen.GroupManager.StartDataEntry();t.resolve()}).fail(function(n){t.reject(n)})}).fail(function(n){t.reject(n)}),t.promise()});NextGen.ComponentController.RegisterOnComponentDisposeCallback("NextGen.Online.Components.Client.Group.GroupComponent",function(t){t.Scope.find("button.take-photo").off("click");t.Scope.find("button.browse-photo").off("click");n.subscriptions.UnsubscribeAll()})})();
//# sourceMappingURL=components_d72ad7a23479481d8a4f0e51b567a141.map
function SigninPanel(n,t){var i=$(n),r=t;return{setEmail:function(n){i.find('input[name="accountEmail"]').val(n);i.find("[data-replace-email]").html(i.find("[data-replace-email]").text().replace("{email}",n))},getEmail:function(){return i.find('input[name="accountEmail"]').val()},show:function(){i.on("keypress",function(n){n.which===13&&(n.preventDefault(),i.find("button.btn-default").trigger("click"))});i.show()},hide:function(){i.hide()},reset:function(){i.find(".form-group").removeClass("has-error")},validate:function(){NextGen.Alerts.clear();$(".qtip").qtip("hide");var t=i.find("div[data-form-name]"),n=[],u=NextGen.ValidationManager.ValidateWithTemporaryForm(t,null,n,function(n){return(i.closest("div.form-group").find(".has-error").remove(),r)?(n.validate(r),n.valid()):!0});return{validation:u,formData:n}}}}NextGen.LoginComponent=function(){function t(n,t){return NextGen.Utils.FirstOrDefault(n,function(n,i){return i.name.indexOf(t)>=0}).value}var n={};return n.subscriptions=new NextGen.Messaging.SubscriptionManager,n.elements={spinner:null,verifyEmailPanel:null,enterPasswordPanel:null,createPasswordPanel:null,enterVerificationCodePanel:null,resetPasswordPanel:null},n.goToSigninStep=function(t){var r,u,i,f;n.elements.spinner.show();n.elements.enterPasswordPanel.hide();n.elements.enterVerificationCodePanel.hide();n.elements.createPasswordPanel.hide();n.elements.verifyEmailPanel.hide();n.elements.spinner.hide();switch(t){case"EnterPassword":i=n.elements.verifyEmailPanel.getEmail();r=n.elements.enterPasswordPanel;r.reset();r.setEmail(i);r.show();break;case"EnterVerificationCode":i=n.elements.verifyEmailPanel.getEmail();u=n.elements.enterVerificationCodePanel;u.reset();u.setEmail(i);u.show();break;case"CreatePassword":i=n.elements.verifyEmailPanel.getEmail();f=n.elements.createPasswordPanel;f.reset();f.setEmail(i);f.show();break;default:n.elements.verifyEmailPanel.show()}},n.events={},n.events.onUserChanged=function(t,i){i.component.Scope.find("span.logged-in-user-name").empty().html(t.name||NextGen.Localization.Messages.SignIn.NotSignedIn());t&&NextGen.UseAllInOneLogin?(NextGen.Alerts.clear(),t.name&&NextGen.PageManager.NavigateToInitialPage()):!t&&NextGen.UseAllInOneLogin&&n.element.spinner.show()},n.events.onExternalLoginButtonClick=function(){NextGen.UserManager.InitiateExternalSignIn($(this).data("external-login-provider"))},n.events.onExternalSingleSignOnButtonClick=function(){var n=$("external-login-provider");NextGen.UserManager.InitiateExternalSingleSignIn($(this).data("external-login-provider"))},n.events.onSignInTabButtonClick=function(){return $(this).tab("show"),!1},n.events.onSignOutButtonClick=function(){NextGen.UserManager.SignOutUser().fail(function(){NextGen.Alerts.warning(NextGen.Localization.Messages.SignOut.Failed())})},n.events.onForgotPasswordSendClick=function(){var t=$('div[data-form-name="forgot-password"]'),n=[],i=NextGen.ValidationManager.ValidateWithTemporaryForm(t,null,n,function(n){return n.validate({rules:{AccountEmail:{required:!0,email:!0}}}),n.valid()});i.done(function(){NextGen.UserManager.RequestPasswordResetEmail(n).done(NextGen.Logger.errorWrap(function(){NextGen.Alerts.success(NextGen.Localization.Messages.AccountPasswordReset.Success())})).fail(NextGen.Logger.errorWrap(function(){NextGen.Alerts.danger(NextGen.Localization.Messages.AccountPasswordReset.Failed())})).always(NextGen.Logger.errorWrap(function(){NextGen.Controls.Lightbox.Close()}))})},n.events.onVerifyEmailButtonClick=function(){var t=n.elements.verifyEmailPanel,i=n.elements.spinner,{validation:r,formData:u}=t.validate();r.done(function(){t.hide();i.show();var r=NextGen.UserManager.VerifyEmail(u);r.done(function(r){if(i.hide(),r.nextStep=="Error"){t.show();NextGen.Alerts.warning(r.errorMessage);return}n.goToSigninStep(r.nextStep)})})},n.events.onSigninButtonClick=function(){var t=n.elements.spinner,i=n.elements.enterPasswordPanel,{validation:r,formData:u}=i.validate();r.done(function(){return i.hide(),t.show(),NextGen.UserManager.SignInUser(u,!1).done(function(){t.hide()}).fail(function(){NextGen.Alerts.warning(NextGen.Localization.Messages.SignIn.Failed());t.hide();i.show()})})},n.events.onValidatePasscodeClick=function(){var t=n.elements.enterVerificationCodePanel,i=n.elements.spinner,{validation:r,formData:u}=t.validate();r.done(function(){return t.hide(),i.show(),NextGen.UserManager.ValidatePasscode(u,!1).done(function(r){if(i.hide(),!r.loggedInUsername){if(r.nextStep=="Error"){t.show();NextGen.Alerts.warning(r.errorMessage);return}n.goToSigninStep(r.nextStep)}}).fail(function(){NextGen.Alerts.warning(NextGen.Localization.Messages.SignIn.Failed());i.hide();t.show()})})},n.events.onResendValidationCode=function(){n.elements.enterVerificationCodePanel.hide();n.events.onVerifyEmailButtonClick()},n.events.onCreatePasswordButtonClick=function(){var r=n.elements.spinner,i=n.elements.createPasswordPanel,{validation:f,formData:u}=i.validate();f.done(function(){var n=[{name:"accountEmail",value:t(u,"accountEmail")},{name:"password",value:t(u,"newPassword")},{name:"__RequestVerificationToken",value:t(u,"__RequestVerificationToken")}];return i.hide(),r.show(),NextGen.UserManager.SignInUser(n,!0).done(function(){r.hide();result.nextStep=="Error"&&(i.show(),NextGen.Alerts.warning(result.errorMessage))}).fail(function(){NextGen.Alerts.warning(NextGen.Localization.Messages.SignIn.Failed());r.hide();i.show()})})},n.events.onResetPasswordClick=function(){var t=n.elements.verifyEmailPanel.getEmail(),i=$("#antiforgerytoken").find('input[name = "__RequestVerificationToken"]').val(),r=[{name:"accountEmail",value:t},{name:"__RequestVerificationToken",value:i}];NextGen.UserManager.RequestPasswordResetEmail(r).done(NextGen.Logger.errorWrap(function(){NextGen.Alerts.success(NextGen.Localization.Messages.AccountPasswordReset.Success())})).fail(NextGen.Logger.errorWrap(function(){NextGen.Alerts.danger(NextGen.Localization.Messages.AccountPasswordReset.Failed())}))},NextGen.Logger.errorWrap(n.events),NextGen.ComponentController.RegisterOnComponentDisposeCallback("NextGen.Online.Components.Client.Login.LoginComponent",function(t){n.subscriptions.UnsubscribeAll();t.Scope.find("#signin-tabs a").off("click");t.Scope.find("a[data-external-login-provider]").off("click");t.Scope.find("button.forgot-password-reset").off("click");t.Scope.find(".signout-button").off("click");t.Scope.find("button.btn-singlesignon").off("click");t.Scope.find("button#signinButton").off("click");t.Scope.find("button#verifyEmailButton").off("click");t.Scope.find("button#enterVerificationCodeButton").off("click");t.Scope.find("button#createPasswordButton").off("click");t.Scope.find("a#resendCodeLink").off("click");t.Scope.find("a#resetPasswordLink").off("click")}),NextGen.ComponentController.RegisterOnComponentLoadCallback("NextGen.Online.Components.Client.Login.LoginComponent",function(t){if(n.component=t,NextGen.UseAllInOneLogin){t.Scope.find("form").submit(function(n){n.preventDefault()});n.elements.spinner=t.Scope.find("#spinner-container");n.elements.verifyEmailPanel=new SigninPanel("#enterEmailPanel",{rules:{AccountEmail:{required:!0,email:!0}}});n.elements.enterPasswordPanel=new SigninPanel("#enterPasswordPanel",{rules:{AccountEmail:{required:!0,email:!0},Password:{required:!0}}});n.elements.enterVerificationCodePanel=new SigninPanel("#enterVerificationCodePanel",{rules:{AccountEmail:{required:!0,email:!0},PassCode:{required:!0}}});n.elements.createPasswordPanel=new SigninPanel("#createPasswordPanel",{rules:{AccountEmail:{required:!0,email:!0},Password:{required:!0}}});var i=t.Scope.find("input[name=tokenUserNeedsToCreateAccount]").val();i!==undefined&&NextGen.SetMustCreateAccount(i=="true");t.Scope.find("button#verifyEmailButton").on("click",n.events.onVerifyEmailButtonClick);t.Scope.find("button#signinButton").on("click",n.events.onSigninButtonClick);t.Scope.find("button#enterVerificationCodeButton").on("click",n.events.onValidatePasscodeClick);t.Scope.find("button#createPasswordButton").on("click",n.events.onCreatePasswordButtonClick);t.Scope.find("a#resendCodeLink").on("click",n.events.onResendValidationCode);t.Scope.find("a#resetPasswordLink").on("click",n.events.onResetPasswordClick)}n.subscriptions.Subscribe("User_Changed",n.events.onUserChanged,{component:t});t.Scope.find("#signin-tabs a").on("click",n.events.onSignInTabButtonClick);t.Scope.find("a[data-external-login-provider]").on("click",n.events.onExternalLoginButtonClick);t.Scope.find("button.forgot-password-reset").on("click",n.events.onForgotPasswordSendClick);t.Scope.find(".signout-button").on("click",n.events.onSignOutButtonClick);t.Scope.find("button.btn-singlesignon").on("click",n.events.onExternalSingleSignOnButtonClick);NextGen.Controls.Lightbox.Create(t.Scope.find("a#forgot-password-link"),{closeOnBgClick:!1,closeBtnInside:!0});$("#signin-tabs a:first").tab("show");t.Scope.find("form.dynamic-target").validate({rules:{ConfirmPassword:{equalTo:"#"+t.Id+"_Password"}}});Modernizr.cookies===!1&&NextGen.Alerts.danger(NextGen.Localization.Messages.EnableCookie())}),NextGen.ValidationManager.RegisterCustomValidation("NextGen.Online.Components.Client.Login.LoginComponent",function(n){return n.find("#pnl-social").is(":visible")?(NextGen.Alerts.warning(NextGen.Localization.Messages.SignIn.SelectSocialAuthProvider()),!1):n.find("#pnl-singlesignon").is(":visible")?(NextGen.Alerts.warning(NextGen.Localization.Messages.SignIn.SelectSSOAuthProvider()),!1):(n.validate().settings.ignore=":hidden",n.find(".pnl-register").find('input[type="password"]:visible').each(function(n,t){$(t).rules("add",{minlength:6})}),n.valid())}),NextGen.PageManager.RegisterForwardAction("NextGen.Online.Components.Client.Login.LoginComponent",function(n){var l=n.Scope.find("form.dynamic-target"),i=l.serializeArray(),r,u,o,s,h,e,c,f;return n.Scope.find('input[name$="_Authenticated"]').val()==="true"?(r=[],n.Scope.find(".pnl-register").is(":visible")&&(r.push({name:"accountEmail",value:t(i,"_RegUsername")}),r.push({name:"password",value:t(i,"_RegPassword")})),n.Scope.find("#pnl-account-email").is(":visible")&&r.push({name:"accountEmail",value:t(i,"_SocialUsername")}),r.length>0)?(r.push({name:"__RequestVerificationToken",value:t(i,"__RequestVerificationToken")}),u=NextGen.UserManager.UpdateAccountEmail(r),u.done(NextGen.Logger.errorWrap(function(){NextGen.ComponentController.Reload(n)})),u.fail(NextGen.Logger.errorWrap(function(){NextGen.Alerts.warning(NextGen.Localization.Messages.SignIn.Failed())})),u):null:n.Scope.find(".pnl-login").is(":visible")?(o=[{name:"accountEmail",value:t(i,"_Username")},{name:"password",value:t(i,"_Password")},{name:"__RequestVerificationToken",value:t(i,"__RequestVerificationToken")}],NextGen.UserManager.SignInUser(o,!1).fail(function(n){n.verifyAccount?($("#defaultContent").hide(),$("#accountVerification").show()):NextGen.Alerts.warning(NextGen.Localization.Messages.SignIn.Failed())})):n.Scope.find(".pnl-register").is(":visible")?(s=[{name:"accountEmail",value:t(i,"_RegUsername")},{name:"password",value:t(i,"_RegPassword")},{name:"__RequestVerificationToken",value:t(i,"__RequestVerificationToken")}],NextGen.UserManager.SignInUser(s,!0).fail(function(){NextGen.Alerts.warning(NextGen.Localization.Messages.SignIn.Failed())})):n.Scope.find("#accountVerification").is(":visible")?(h=[{name:"verificationCode",value:t(i,"verificationCode")},{name:"accountEmail",value:t(i,"_Username")},{name:"password",value:t(i,"_Password")},{name:"__RequestVerificationToken",value:t(i,"__RequestVerificationToken")}],e=NextGen.UserManager.VerifyAccount(h),e.fail(NextGen.Logger.errorWrap(function(n){if(n.verified){$("#accountVerification").hide();$("#accountAssociation").show();var t=$("#accountAssociationContactTemplate").html();n.contacts.forEach(function(n){var i=t.replace("#label#",n.InfoText).replace("#value#",n.ContactId);$("#accountAssociationContacts").append($(i))});$("#accountAssociation input[type='radio']:first").attr("checked","checked")}else $("#invalidVerificationCodeMessage").show()})),e):n.Scope.find("#accountAssociationContacts").is(":visible")?(c=[{name:"verificationCode",value:t(i,"verificationCode")},{name:"accountAssociationContactId",value:t(i,"accountAssociationContactId")},{name:"accountEmail",value:t(i,"_Username")},{name:"password",value:t(i,"_Password")},{name:"__RequestVerificationToken",value:t(i,"__RequestVerificationToken")}],f=NextGen.UserManager.AssociateAccount(c),f.done(NextGen.Logger.errorWrap(function(){$("#accountAssociation").hide();$("#defaultContent").show();var n=[{name:"accountEmail",value:t(i,"_Username")},{name:"password",value:t(i,"_Password")},{name:"__RequestVerificationToken",value:t(i,"__RequestVerificationToken")}];NextGen.UserManager.SignInUser(n,!1).fail(function(){NextGen.Alerts.warning(NextGen.Localization.Messages.SignIn.Failed())})})),f.fail(NextGen.Logger.errorWrap(function(){})),f):null}),NextGen.PageManager.RegisterForwardTarget("NextGen.Online.Components.Client.Login.LoginComponent",function(){return NextGen.EditingExisting&&NextGen.PageManager.SummaryPageExists()?$(NextGen.SummaryComponentId):null}),{}}();
//# sourceMappingURL=components_d72ad7a23479481d8a4f0e51b567a141.map
var NextGen=NextGen||{};(function(){function n(n){return $(n).find('[data-inputtype*="MarketingComponent"]').length>0}NextGen.ValidationManager.RegisterCustomValidation("NextGen.Online.Components.Client.Marketing.MarketingComponent",function(t){if(NextGen.ValidationManager.ValidatePageForCustomField(t)===!1||n(t)===!0&&NextGen.ValidationManager.ValidatePageForRadioButton(t)===!1)return!1;return NextGen.ValidationManager.RevalidateForm(t,{ignore:':hidden:not(select, :input[name^="cst_"][name$="_html"]), .cstField:hidden select'})});NextGen.ComponentController.RegisterOnComponentLoadCallback("NextGen.Online.Components.Client.Marketing.MarketingComponent",function(n){$(n.Scope).find(".form-group").not(".cstField").find(":input:radio").not('input[type="hidden"]').on("after-change",function(){var t=NextGen.ValidationManager.HasValue(n.Scope,!1);t===!1&&n.Scope.find(".cstField :radio:checked").prop("checked",!1).change()});$(n.Scope).find(".form-group").not(".cstField").find(":input").not('input[type="hidden"]').on("change",function(){var t=NextGen.ValidationManager.HasValue(n.Scope,!1);t===!1&&n.Scope.find(".cstField :radio:checked").prop("checked",!1).change()})})})();
//# sourceMappingURL=components_d72ad7a23479481d8a4f0e51b567a141.map
(function(){function t(n){if(n){var t=parseFloat(n.toString().replace(/,/g,""),10);return isNaN(t)?0:t}return 0}function i(n){var i,r,u;if(i=n.is(":radio")||n.is(":checkbox")?n.is(":checked")?n.data("inv-quantity")?t(n.data("inv-quantity")):1:0:t(n.val()),r=n.parents(".row"),u=r.find("span.fee-amount"),u.length){var f=t(u.data("amount")),s=r.find("div.fee-summary"),o=n.data("inv-payment-status");o&&o==="WaitListNoPaymentRequired"&&(f=0);var e=n.closest(".component").find('[data-inv-referenceId="'+n.attr("id")+'"]'),h=i>0&&e.length&&f>0?e.data("discount-amount")?t(e.data("discount-amount")):0:0,c=f*i-h;s.text(NextGen.Localization.FormatCurrency(c))}}function u(n){var i=[],t=$(n).find(".form-group").find(":input").not("[name*='cst_']").not(".select2-focusser").not(":hidden");return t.length==0&&(t=$(n).find("select").not("[name*='cst_']").not(".select2-focusser")),t.each(function(n,t){i.push(f($(t)))}),$.when.apply(this,i)}function f(n){var t,i,r;if(n.is(":radio")&&n.is(":checked"))return(t=n.attr("id"),t&&t.length>0&&t.toLowerCase().indexOf("nooption")>0)?$.Deferred().resolve().promise():NextGen.InventoryManager.IsInventoryAvailable("Membership","radio",n);if(n.is(":checkbox")&&n.is(":checked"))return NextGen.InventoryManager.IsInventoryAvailable("Membership","checkbox",n);if(n.is("select")){if(n.is("[data-type=number]"))return NextGen.InventoryManager.IsInventoryAvailable("Membership","selectnumber",n);if(i=n.val(),i&&i.length>0&&(r=$("#"+i),r&&r.is(".inv-aware")))return NextGen.InventoryManager.IsInventoryAvailable("Membership","select",r)}return $.Deferred().resolve().promise()}function e(){var t=null,i=$("#QueryParams"),n;if(i.length)try{n=JSON.parse(i.val());n&&n.Discount&&(t=n.Discount)}catch(r){NextGen.Logger.error("Error parse query parameters for discount code.")}return t}function o(n){var t=n.Scope.find('input[data-inv-type="DiscountCode"]');$.each(t,function(n,t){var r=$(t),i;r.length&&(i=r.val(),i||(i=e()),i||(i=NextGen.GroupManager.GetDiscountCode()),i&&r.val(i).trigger("change"))})}function r(n){if(n&&NextGen.PageManager.GetCurrentPageNumber()!==NextGen.PageManager.GetSummaryPageNumber()){var t=n.find('[data-inv-type="DiscountCode"]');t&&t.is(":visible")!==!1&&t.val().length>0&&t.trigger("change")}}var n={};n.events={};n.subscriptions=new NextGen.Messaging.SubscriptionManager;n.events.onPageNavigated=function(n,t){t.component.PageNumber===n.toPage&&o(t.component)};NextGen.ValidationManager.RegisterCustomValidation("NextGen.Online.Components.Client.Membership.MembershipComponent",function(n){var t=[],i=NextGen.ValidationManager.RevalidateForm(n,{ignore:':hidden:not(select, :input[name^="cst_"][name$="_html"]), .cstField:hidden select'});return NextGen.ValidationManager.ValidatePageForRadioButton(n)===!1&&t.push($.Deferred().reject().promise()),NextGen.ValidationManager.ValidatePageForCustomField(n)===!1&&t.push($.Deferred().reject().promise()),t.push(i?$.Deferred().resolve().promise():$.Deferred().reject().promise()),NextGen.InventoryEnforcedByPayment!==!0&&(NextGen.EditingExisting===!1||NextGen.SubmitManager.IsSubmissionHappening()===!1)&&t.push(u(n)),$.when.apply(this,t)});NextGen.ComponentController.RegisterOnPageLoadCallback("NextGen.Online.Components.Client.Membership.MembershipComponent",function(t){n.subscriptions.Subscribe("Page_Navigated",n.events.onPageNavigated,{component:t});$(t.Scope).find("[data-togglevisibility]").each(function(){var t=$(this),n=$("#"+t.data("togglevisibility"));n.on("togglevisibility-on",function(){r(n)})})});NextGen.ComponentController.RegisterOnSignInCompleteCallback("NextGen.Online.Components.Client.Membership.MembershipComponent",function(n){$(n.Scope).find("[data-togglevisibility]").each(function(){var t=$(this),n=$("#"+t.data("togglevisibility"));n.on("togglevisibility-on",function(){r(n)})})});NextGen.ComponentController.RegisterOnComponentLoadCallback("NextGen.Online.Components.Client.Membership.MembershipComponent",function(n){var t={};$(n.Scope).find('[data-input-type="number"]').each(function(){var n=$(this);n.off("after-inventory-checked");n.on("after-inventory-checked",function(t,i){var u=n.parents(".row").find(".input-type-number-add-to-waitlist"),r;u&&(r=n.parents(".row").find('input[type=checkbox][name*="_InputTypeNumberAddToWaitListCheckBox"]'),i.type==="Waitlist"?(r&&r.prop("checked",!0),u.show()):(r&&r.prop("checked",!1),u.hide()))})});$(n.Scope).find("select").each(function(){var n=$(this);n.on("change",function(t){var r=n.parents("form").find(":hidden:input[name='"+t.val+"_AddToWaitList']"),u=n.parents().find('[class*=" input-type-dropdown-add-to-waitlist-"]'),i;u&&u.hide();i=n.parents().find(".input-type-dropdown-add-to-waitlist-"+t.val);r&&r.val()==="true"&&i&&i.show()})});$(n.Scope).find(".form-group").not(".cstField").find(":input:radio").not('input[type="hidden"]').on("after-change",function(){var t=NextGen.ValidationManager.HasValue(n.Scope,!0);t===!1&&n.Scope.find(".cstField :radio:checked").prop("checked",!1).change()});$(n.Scope).find(".form-group").not(".cstField").find(":input").not('input[type="hidden"]').on("change",function(){var t=NextGen.ValidationManager.HasValue(n.Scope,!0);t===!1&&n.Scope.find(".cstField :radio:checked").prop("checked",!1).change()});$(n.Scope).find('[data-input-type="radio"],[data-input-type="checkbox"]').each(function(){var n=$(this);if((n.data().inputType==="radio"||n.data().inputType==="checkbox")&&NextGen.Themes.HasTheme(n)){i(n);n.on("change",function(){i($(this))});n.on("inputgroup-unchecked",function(){i($(this))})}});n.Scope.find('input[data-inv-type="DiscountCode"]').each(function(){var n=$(this);n.off("after-inventory-checked");n.on("after-inventory-checked",function(n,t){var r=$(this),u,f;r.data("discount-amount",t&&t.result&&t.result.Holds.length?t.result.Holds[0].DiscountAmount:0);u=r.data("inv-referenceid");u&&(f="#"+u,i($(f)));t.type==="Rejection"&&r.val()===""&&(r.siblings("span.theme-text-info-input.theme-label-primary").text(""),r.siblings("span.label-primary").text(""))})});t.onAddToWaitListChecked=function(){var n=$(this),t,i;n.is(":checked")||(t=n.parents(".row").find('[data-input-type="number"]'),t&&(t.val("0").change(),i=n.parents(".row").find(".input-type-number-add-to-waitlist"),i&&i.hide(),n.checked=!1))};NextGen.Logger.errorWrap(t);n.Scope.off(".membership-component");n.Scope.on("click.membership-component",'input[type=checkbox][name*="_InputTypeNumberAddToWaitListCheckBox"]',t.onAddToWaitListChecked)});NextGen.ComponentController.RegisterOnComponentDisposeCallback("NextGen.Online.Components.Client.Membership.MembershipComponent",function(){n.subscriptions.UnsubscribeAll()})})();
//# sourceMappingURL=components_d72ad7a23479481d8a4f0e51b567a141.map
var NextGen=NextGen||{};(function(){NextGen.ValidationManager.RegisterCustomValidation("NextGen.Online.Components.Client.Notes.NotesComponent",function(n){if(NextGen.ValidationManager.ValidatePageForCustomField(n)===!1)return!1;return NextGen.ValidationManager.RevalidateForm(n,{ignore:':hidden:not(select, :input[name^="cst_"][name$="_html"]), .cstField:hidden select',normalizer:function(n){return $.trim(n)}})});NextGen.ComponentController.RegisterOnComponentLoadCallback("NextGen.Online.Components.Client.Notes.NotesComponent",function(n){n.Scope.find("textarea").on("input",function(){$(this).val().length===0&&n.Scope.find(".cstField :radio:checked").prop("checked",!1).change()})})})();
//# sourceMappingURL=components_d72ad7a23479481d8a4f0e51b567a141.map
(function(){var n={};n.events={};n.events.optOutClick=function(n){var t=n.data.component,i=t.Scope.find('[name="opted-out"]');return i.val("true"),NextGen.SubmitManager.Submit().done(NextGen.PageManager.NavigateToThankYouPage),!1};NextGen.Logger.errorWrap(n.events);NextGen.ComponentController.RegisterOnComponentLoadCallback("NextGen.Online.Components.Client.OptOut.OptOutComponent",function(t){var i=t.Scope.find("button.opt-out");i.on("click.OptOutComponent",{component:t},n.events.optOutClick)});NextGen.ComponentController.RegisterOnComponentDisposeCallback("NextGen.Online.Components.Client.OptOut.OptOutComponent",function(n){var t=n.Scope.find("button.opt-out");t.off("click.OptOutComponent")})})();
//# sourceMappingURL=components_d72ad7a23479481d8a4f0e51b567a141.map
(function(){function t(n,t){n.find("span.username-text").empty().html(t||NextGen.Localization.Messages.SignIn.NotSignedIn())}function i(n){$(n.attr("href")).length>0?NextGen.AccountComponent.WireOpenTrigger(n):n.hide()}var n={};n.events={};n.subscriptions=new NextGen.Messaging.SubscriptionManager;n.events.onUserChanged=function(n,i){t(i.component.Scope,n.name)};NextGen.Logger.errorWrap(n.events);NextGen.ComponentController.RegisterOnPageLoadCallback("NextGen.Online.Components.Client.PageBreak.PageBreakComponent",function(n){n.PageNumber==NextGen.PageManager.GetLoginPageNumber()&&NextGen.UseAllInOneLogin&&(n.Scope.find(".username-text").closest("li").hide(),n.Scope.find("[data-navigation-watcher]").remove(),n.Scope.find(".alerts-watchers").remove())});NextGen.ComponentController.RegisterOnComponentLoadCallback("NextGen.Online.Components.Client.PageBreak.PageBreakComponent",function(r){var u=r.Scope.find("li.account-link a"),f=r.Scope.find("li.sign-out-link a");i(u);i(f);n.subscriptions.Subscribe("User_Changed",n.events.onUserChanged,{component:r});t(r.Scope,null)});NextGen.ComponentController.RegisterOnComponentDisposeCallback("NextGen.Online.Components.Client.PageBreak.PageBreakComponent",function(t){var i=NextGen.PageManager.GetVisiblePageNumbers(),r=NextGen.PageManager.GetPageNumber(t.Scope),u=$.inArray(r,i);u===-1&&n.subscriptions.UnsubscribeAll(t.Id)})})();
//# sourceMappingURL=components_d72ad7a23479481d8a4f0e51b567a141.map
var NextGen=NextGen||{};NextGen.PaymentManager=function(){var n,t=!1;return NextGen.PaymentProcessorBase=function(n,t){function u(){i.find(">div").hide().addClass("ignore-validation")}function f(n,t){var f='div[data-processor="'+r+'"]',u=i.find(f);u.length>1?u.each(function(i,r){var u=$(r);u.find("#PaymentTypeId").each(function(i,r){var f=$(r);f.val()===n?t?t.toString()===f.parent().find("#SelectedIndex").val()&&(f.data("selected",!0),u.show().removeClass("ignore-validation")):(f.data("selected",!0),u.show().removeClass("ignore-validation")):f.removeData("selected")})}):u.show().removeClass("ignore-validation")}var i=t,r=n;return{Dispose:function(){u()},Render:function(n,t){f(n,t)},Name:r}},NextGen.PayLaterProcessor=function(n){return $.extend(NextGen.PaymentProcessorBase("PayLater",n),{Validate:function(){return!0}})},NextGen.MarkAsPaidProcessor=function(n){return $.extend(NextGen.PaymentProcessorBase("MarkAsPaid",n),{Validate:function(){return!0}})},NextGen.AddNoteProcessor=function(n){return $.extend(NextGen.PaymentProcessorBase("AddNote",n),{Validate:function(){return!0}})},NextGen.PurchaseOrderProcessor=function(n){return $.extend(NextGen.PaymentProcessorBase("PurchaseOrder",n),{Validate:function(){return NextGen.ValidationManager.ValidateWithTemporaryForm(n.find("div[data-processor=PurchaseOrder]"))}})},NextGen.PayPalProcessor=function(n){return $.extend(NextGen.PaymentProcessorBase("PayPal",n),{Validate:function(){return!0}})},NextGen.EventsAirPaymentsProcessor=function(n){return $.extend(NextGen.PaymentProcessorBase("EventsAirPayments",n),{Validate:function(){return!0}})},NextGen.CreditCardProcessor=function(n){function r(){var n=i(),r;return n===!0&&t===!1?(r=$.trim($("#3-tier-submit").text()),NextGen.Alerts.warning(NextGen.Localization.Messages.Payment.CreditCard.ClickProceedButton(r)),!1):n}function i(){var t=n.find("div[data-processor=CreditCard]"),i=t.closest("form");i.validate({rules:{CreditCardNumber:{customCallback:[function(n){var i=t.find('select[name="PaymentType"] option:selected'),r=i.data("card-type");return NextGen.ValidationManager.ValidateCreditCard(r,n)}]},CreditCardSecurityCode:{customCallback:[function(n){var i=t.find('select[name="PaymentType"] option:selected'),r=i.data("card-type");return NextGen.ValidationManager.ValidateCcv(r,n)}]},CreditCardExpiryMonth:{customCallback:[function(t){var i=n.find("div[data-processor=CreditCard]").find('select[name="CreditCardExpiryYear"] option:selected').val();return NextGen.ValidationManager.ValidateCreditCardExpiry(t,i)}]},CreditCardExpiryYear:{customCallback:[function(t){var i=n.find("div[data-processor=CreditCard]").find('select[name="CreditCardExpiryMonth"] option:selected').val();return NextGen.ValidationManager.ValidateCreditCardExpiry(i,t)}]}},messages:{CreditCardNumber:{customCallback:NextGen.Localization.Messages.Validation.CreditCardNumberDoesNotMatchCardType()},CreditCardSecurityCode:{customCallback:NextGen.Localization.Messages.Validation.CcvNumberInvalid()},CreditCardExpiryMonth:{customCallback:NextGen.Localization.Messages.Validation.CreditCardExpired()},CreditCardExpiryYear:{customCallback:NextGen.Localization.Messages.Validation.CreditCardExpired()}}});t.find('select[name="PaymentType"]').on("change",function(){i.valid()});return i.valid()}function u(){return $('[name="GatewayType"]').val()==="ThreeTier"?r():i()}var f=NextGen.PaymentProcessorBase("CreditCard",n);return $.extend(f,{Validate:u,AfterRender:function(t){function r(){var r=n.find("div[data-processor=CreditCard]"),i=r.find('select[name="PaymentType"] option:selected'),u=i.data("card-type");i.val()===""||u==="UnionPay"?t.Scope.find(".credit-card-detail-row").hide().addClass("ignore-validation"):t.Scope.find(".credit-card-detail-row").show().removeClass("ignore-validation")}var u=t.Scope.find("button#3-tier-submit").length===1,i;if(u){i=t.Scope.find('select[name="PaymentType"]');i.off(".PaymentComponent");i.on("change.PaymentComponent",r);r()}}})},NextGen.DirectDebitProcessor=function(n){function i(){if(t===!1){var n=$.trim($("#3-tier-submit-additional").text());return NextGen.Alerts.warning(NextGen.Localization.Messages.Payment.CreditCard.ClickProceedButton(n)),!1}return!0}function r(){return i()}var u=NextGen.PaymentProcessorBase("DirectDebit",n);return $.extend(u,{Validate:r})},NextGen.PaymentComponent=function(n){function v(r){n.Scope.find("div.payment-method").toggle(!r);n.Scope.find("div.no-payment-required").toggle(!!r);!r||(i=NextGen.PayLaterProcessor(t.find("div.processor-target")))}function y(t){n.Scope.find("div.no-payment-methods-found").toggle(t);t&&(n.Scope.find("div.payment-method").hide(),$(".form-submit").hide())}function e(){var t=n.Scope.find('input[name="PaymentMethod"]:checked'),i=t.val(),r=i==="CreditCard"?n.Scope.find('select[name="PaymentType"] option:selected').val():t.data("paymentTypeId");return i==="EventsAirPayments"&&(r=n.Scope.find("#EventsAirPaymentsPaymentTypeId").val()),r}function p(){var t=n.Scope.find('input[name="PaymentMethod"]:checked'),i=t.data("additionalPaymentOptionGatewayId"),r=t.data("additionalPaymentOptionIndex");return{additionalPaymentOptionGatewayId:i,selectedIndex:r}}function o(){var t=[];return n.Scope.find("input[data-schedule-item-id]:checked").each(function(){var n=$(this).data().scheduleItemId;n&&$.merge(t,n.split(","))}),t}function c(){var t=n.Scope.find("#partPaymentAmount");if(t&&t.length===1){var i=parseFloat(t.data("max-additional-amount").toString().replace(/,/g,"")),u=t.val(),r=parseFloat(u.toString().replace(/,/g,""));return r<=i?r:(n.Scope.find("input[data-allow-paying-additional-amount]").prop("checked",!0),t.val(i),i)}return 0}function w(){var n=e(),t={opdid:f,selectedPaymentTypeId:n};return NextGen.Server.Site.PortalPayments(t)}function s(){return{editingExisting:NextGen.EditingExisting,componentSubmissionData:NextGen.SubmissionDataManager.GetAllComponentData(),visiblePageNumbers:NextGen.Logic.Processor.GetVisiblePageNumbersForPosting(),chargeTo:NextGen.Web.Url.GetParameter(NextGen.Web.Url.QueryStringKeys.ChargeTo),contactNumber:NextGen.GroupManager.GetCurrentContactNumber(),selectedScheduleIds:o(),selectedPaymentTypeId:e(),partPaymentAmount:c()}}function h(){return{editingExisting:NextGen.EditingExisting,chargeTo:NextGen.Web.Url.GetParameter(NextGen.Web.Url.QueryStringKeys.ChargeTo),groupMembers:NextGen.GroupManager.GetAllContactPostData(),groupContactPayingForAll:NextGen.GroupManager.GetGroupContactPays(),groupContactAttending:NextGen.GroupManager.GetGroupContactAttending(),selectedScheduleIds:o(),selectedPaymentTypeId:e(),partPaymentAmount:c()}}var r={},l=NextGen.PageManager.GetPageNumber(n.Scope),i=null,u=n.Scope.find("div.holding"),t=n.Scope.find("div.payment-content"),f=NextGen.Web.Url.GetParameter(NextGen.Web.Url.QueryStringKeys.OnlinePaymentDetailId),a={PayLater:NextGen.PayLaterProcessor,PurchaseOrder:NextGen.PurchaseOrderProcessor,PayPal:NextGen.PayPalProcessor,EventsAirPayments:NextGen.EventsAirPaymentsProcessor,CreditCard:NextGen.CreditCardProcessor,DirectDebit:NextGen.DirectDebitProcessor,MarkAsPaid:NextGen.MarkAsPaidProcessor,AddNote:NextGen.AddNoteProcessor};return r.events={},r.events.onLoadPaymentTotalsDone=function(r){function o(){var t=n.Scope.find("#Amount").val(),r=parseFloat(t.toString().replace(/,/g,""))||0;r!==0&&(i=null)}function e(){var i=n.Scope.find("#Amount").val(),t=parseFloat(i.toString().replace(/,/g,""))||0;v(t===0);t>0&&y(n.Scope.find("[name=PaymentMethod]").length===0)}function f(){var t;t=NextGen.GroupManager.IsGroupSubmission()?NextGen.Server.Site.GroupPaymentSummary(h()):NextGen.Server.Site.PaymentSummary(s());t.done(function(t){var i=n.Scope.find('[data-templateplaceholder="paymentSummary"]');NextGen.TemplateManager.MutateAppliedTemplateData(i,n,!0,function(){return t}).then(function(){e()}).then(function(){var t=n.Scope.find(".theme-textbox, .theme-select");t.each(function(){var n=$(this);n.val()&&n.addClass("field--not-empty")})})});t.fail(function(n){NextGen.Alerts.danger(NextGen.Localization.Messages.ComponentLoad.Failed());NextGen.Logger.error(n)})}t.empty();t.append(r);NextGen.TemplateManager.DisposeComponentTemplates(n);NextGen.TemplateManager.RegisterComponentTemplates(n);NextGen.TemplateManager.ApplyComponentTemplates(n);NextGen.Themes.SetupTheme(t);NextGen.Behaviours.DropDownList.Register(n);t.off("change.scheduleItem").on("change.scheduleItem","input[data-schedule-item-id]",function(){t.find("input[data-allow-paying-additional-amount]").prop("checked",!1);t.find("#partPaymentAmount").val(0);f()});t.off("change.partPayment").on("change.partPayment","#partPaymentAmount",function(){var n=$(this).val();parseFloat(n.toString().replace(/,/g,""))>0?t.find("input[data-allow-paying-additional-amount]").prop("checked",!0):$(this).val(0);f()});t.off("change.partPayment.checkbox").on("change.partPayment.checkbox","input[data-allow-paying-additional-amount]",function(){var i=$(this).is(":checked"),n;i===!1&&(n=t.find("#partPaymentAmount"),n.length===1&&parseFloat(n.val().toString().replace(/,/g,""))>0&&(n.val(0),f()))});u.hide();t.show();e();o();t.find('select[name="PaymentType"]').on("change",function(){f()});t.find('input[name="PaymentMethod"]').on("change",function(){var u=t.find("div.processor-target"),r=$(this).val(),e=$(this).data("paymentTypeId"),o=$(this).data("additionalPaymentOptionIndex");i&&i.Dispose&&i.Dispose();i=r!==null?a[r](u,n.Id):null;i&&i.Render&&(i.Render(e,o),i.AfterRender&&i.AfterRender(n));f();r=="EventsAirPayments"?$(".form-submit").hide():$(".form-submit").show()})},r.events.onPageNavigated=function(n){l===n.toPage&&(f&&f.length>0?w().done(r.events.onLoadPaymentTotalsDone).fail(function(n){NextGen.Alerts.danger(NextGen.Localization.Messages.ComponentLoad.Failed());NextGen.Logger.error(n);t.empty();u.hide()}):NextGen.ComponentController.WaitForComponentsToLoad().then(function(){u.show();NextGen.InventoryManager.EnforceInventoryHolds().done(function(){NextGen.InventoryEnforcedByPayment=!0;var n;NextGen.PageManager.SummaryPageExists()&&!NextGen.GroupManager.AllSummariesLoaded()?(n=NextGen.SummaryManager.LoadAllSummaries(),n.then(function(){n=NextGen.GroupManager.IsGroupSubmission()?NextGen.Server.Site.GroupPayment(h()):NextGen.Server.Site.Totals(s());n.then(r.events.onLoadPaymentTotalsDone).fail(function(n){NextGen.Alerts.danger(NextGen.Localization.Messages.ComponentLoad.Failed());NextGen.Logger.error(n);t.empty();u.hide()})})):(n=NextGen.GroupManager.IsGroupSubmission()?NextGen.Server.Site.GroupPayment(h()):NextGen.Server.Site.Totals(s()),n.done(r.events.onLoadPaymentTotalsDone),n.fail(function(n){NextGen.Alerts.danger(NextGen.Localization.Messages.ComponentLoad.Failed());NextGen.Logger.error(n);t.empty();u.hide()}))}).fail(function(n){NextGen.Alerts.danger(NextGen.Localization.Messages.ComponentLoad.Failed());NextGen.Logger.error(n);t.empty();u.hide()})}))},NextGen.Logger.errorWrap(r.events),r.subscriptions=[],r.subscriptions.push(NextGen.Messaging.Subscribe("Page_Navigated",r.events.onPageNavigated)),{OnValidate:function(){return i&&i.Validate?i.Validate():(NextGen.Alerts.warning(NextGen.Localization.Messages.Payment.SelectMethod()),!1)},Dispose:function(){$.each(r.subscriptions,function(n,t){NextGen.Messaging.Unsubscribe(t)});r.subscriptions=[]},GetPaymentProcessor:function(){return i||{Name:"No Processor Set"}},GetSelectedPaymentScheduleIds:function(){return o()},GetSelectedAdditionalOptionGatewayDetails:function(){return p()}}},NextGen.ComponentController.RegisterOnPageLoadCallback("NextGen.Online.Components.Client.Payment.PaymentComponent",function(i){n=NextGen.PaymentComponent(i);i.Scope.on("click.payment-component","#3-tier-submit",function(){return t=!0,$(".form-submit").trigger("click"),!1});i.Scope.on("click.payment-component","#3-tier-submit-additional",function(){return t=!0,$(".form-submit").trigger("click"),!1});i.Scope.on("click.payment-component","#paypal-submit",function(){return t=!0,$(".form-submit").trigger("click"),!1});i.Scope.on("click.payment-component","#eventsAirPayments-submit",function(){return t=!0,$(".form-submit").trigger("click"),!1})}),NextGen.ComponentController.RegisterOnComponentDisposeCallback("NextGen.Online.Components.Client.Payment.PaymentComponent",function(t){t.Scope.off(".payment-component");n&&(n.Dispose(),n=null)}),NextGen.ValidationManager.RegisterCustomValidation("NextGen.Online.Components.Client.Payment.PaymentComponent",function(){if(n){var i=n.OnValidate();return t=!1,i}return!1}),{GetCurrentPaymentComponent:function(){return n},GetCurrentPaymentProcessor:function(){return n?n.GetPaymentProcessor().Name:null}}}();
//# sourceMappingURL=components_d72ad7a23479481d8a4f0e51b567a141.map
(function(){function n(n){var t=$(n).find("[id*='requiredField']"),i=$(n).find(":radio").not("[name*='RadioGroup1_']");return t&&t.length>0&&i&&i.length>0?!0:!1}function t(n){var t=$(n).find(":radio:checked").not("[name*='RadioGroup1_']");return t&&t.length>0?!0:!1}function i(n){var t=$(n).find("[id*='requiredField']"),i=$(n).find(":checkbox");return t&&t.length>0&&i&&i.length>0?!0:!1}function r(n){var t=$(n).find(":checkbox:checked");return t&&t.length>0?!0:!1}NextGen.ValidationManager.RegisterCustomValidation("NextGen.Online.Components.Client.Question.QuestionComponent",function(u){var f;return n(u)===!0&&t(u)===!1?(f=$(u).find("[id*='anchor_']"),f&&f.length>0&&(f=f.text().trim()),NextGen.Alerts.warning(NextGen.Localization.Messages.Validation.SelectRadioButtonOption(f)),!1):i(u)===!0&&r(u)===!1?(f=$(u).find("[id*='anchor_']"),f&&f.length>0&&(f=f.text().trim()),NextGen.Alerts.warning(NextGen.Localization.Messages.Validation.SelectCheckBoxOption(f)),!1):u.valid()})})();
//# sourceMappingURL=components_d72ad7a23479481d8a4f0e51b567a141.map
var NextGen=NextGen||{};(function(){function o(n){return!!t(n,"_APTitle")||!!t(n,"_APFirstName")||!!t(n,"_APLastName")}function f(n){return{title:t(n,"_APTitle"),firstName:t(n,"_APFirstName"),lastName:t(n,"_APLastName"),accompanyingPersonId:s(n,"_APLastName")}}function i(n,t){return n.Scope.find('input[name$="'+t+'"]')}function t(n,t){var r=i(n,t);return r.length>0?r[0].value:""}function s(n,t){var r=i(n,t);return r.length>0?r[0].id:""}function h(n){var t=[],i=$(n).find(":input.inv-aware").not("[name*='cst_']").not(":hidden");return i.each(function(n,i){t.push(l($(i)))}),$(t).each(function(t,i){i.done(function(t){t&&t.type&&$(t.result.Waitlists).each(function(i,r){var u=$(n).find("#"+r.ParentId);u&&u.trigger("after-inventory-checked",t)})});i.fail(function(t){$(t.result.Rejections).each(function(t,i){var r=$(n).find("#"+i.ParentId);r.inventoryInputWatcher().ShowInventoryErrorMessage(i.ParentId,NextGen.Localization.Messages.InventoryCheck.Full())});$.Deferred().reject().promise()})}),$.when.apply(this,t)}function c(n){var i=$(n).find('input[data-inv-type="DiscountCode"]'),t=!0;return(i.each(function(n,i){var r=$(i),u=r.data("inv-referenceid"),f;if(u&&(f=$("#"+u),f.is(":checked")&&r.attr("required")&&r.is("[data-nosubmit]")))return t=!1,!1}),t)?$.Deferred().resolve().promise():(NextGen.Alerts.danger(NextGen.Localization.Messages.Validation.ValidDiscountCodeRequired()),$.Deferred().reject().promise())}function l(n){function r(n){var i=n.parents(".row").find(".input-type-number-add-to-waitlist"),t;return i&&(t=n.parents(".row").find('input[type=checkbox][name*="_InputTypeNumberAddToWaitListCheckBox"]'),t&&t.prop("checked")===!0)?!0:!1}var t,i;return n.is(":radio")&&n.is(":checked")?(t=n.attr("id"),t&&t.length>0&&t.toLowerCase().indexOf("nooption")>0)?$.Deferred().resolve().promise():NextGen.InventoryManager.IsInventoryAvailable("Registration","radio",n):n.is(":checkbox")&&n.is(":checked")?(i=null,r(n)&&(i="WaitListPurchase"),NextGen.InventoryManager.IsInventoryAvailable("Registration","checkbox",n,i)):$.Deferred().resolve().promise()}function a(){var t=null,i=$("#QueryParams"),n;if(i.length)try{n=JSON.parse(i.val());n&&n.Discount&&(t=n.Discount)}catch(r){NextGen.Logger.error("Error parse query parameters for discount code.")}return t}function e(n,t,i){var r,s,u;if(n=typeof n!="undefined"?n:t.component,typeof n!="undefined"&&(r=n.Scope.find('input[data-inv-type="DiscountCode"]'),r.length)){var f=r.val(),e=!0,o=NextGen.GroupManager.IsGroup();o&&(s=NextGen.GroupManager.GetCurrentContact(),(s.submitted||f&&f.length>0&&!i)&&(e=!1));o&&e&&r.val()&&r.val("").trigger("change");u=a();!u&&e&&(u=NextGen.GroupManager.GetDiscountCode(n.Id+"."+r["0"].id));u?r.val(u).trigger("change"):f&&f.length>0&&r.trigger("change")}}function r(n){if(n){var t=parseFloat(n.toString().replace(/,/g,""),10);return isNaN(t)?0:t}return 0}function u(n){var t,i,u;if(t=n.is(":radio")||n.is(":checkbox")?n.is(":checked")?n.data("inv-quantity")?r(n.data("inv-quantity")):1:0:r(n.val()),i=n.parents(".row"),u=i.find("span.fee-amount"),u.length){var f=r(u.data("amount")),s=i.find("div.fee-summary"),o=n.data("inv-payment-status");o&&o==="WaitListNoPaymentRequired"&&(f=0);var e=n.closest(".component").find('[data-inv-referenceId="'+n.attr("id")+'"]'),h=t>0&&e.length&&f>0?e.data("discount-amount")?r(e.data("discount-amount")):0:0,c=f*t-h;s.text(NextGen.Localization.FormatCurrency(c))}}var n={};n.events={};n.subscriptions=new NextGen.Messaging.SubscriptionManager;n.events.onPageNavigated=function(n,t){t.component.PageNumber===n.toPage&&e(t.component,undefined,!1)};NextGen.ComponentController.RegisterOnComponentLoadCallback("NextGen.Online.Components.Client.RegistrationType.RegistrationTypeComponent",function(n){var r,o,t;e(n,undefined,!1);$().add(i(n,"_APTitle")).add(i(n,"_APFirstName")).add(i(n,"_APLastName")).on("change",NextGen.Logger.errorWrap(function(){NextGen.Messaging.Publish("RegistrationTypeComponent_AccompanyingPersonNameChanged",f(n))}));r=function(){var n=$(this);n.off("after-inventory-checked");n.on("after-inventory-checked",function(t,i){var u=n.parents(".row").find(".input-type-number-add-to-waitlist"),r,f;u&&(r=n.parents(".row").find('input[type=checkbox][name*="_InputTypeNumberAddToWaitListCheckBox"]'),f=n.parents(".row").find(".exhausted_label"),i.type==="Waitlist"?(r&&r.prop("checked",!0),u.show(),f.show()):(r&&r.prop("checked",!1),u.hide(),f.hide()))})};o=function(){var n=$(this);n.off(".discount");n.on("change.discount",function(){var i=n.attr("id"),t=n.closest(".component").find('[data-inv-referenceid="'+i+'"]'),r=n.is(":checked");t.length&&r===!0&&t.trigger("change")})};$(n.Scope).find('input[data-inv-type="DiscountCode"]').each(function(){var n=$(this);n.off("after-inventory-checked");n.on("after-inventory-checked",function(n,t){var i=$(this),r,f;i.data("discount-amount",t&&t.result&&t.result.Holds.length?t.result.Holds[0].DiscountAmount:0);r=i.data("inv-referenceid");r&&(f="#"+r,u($(f)));t.type==="Rejection"&&i.val()===""&&(i.siblings("span.theme-text-info-input.theme-label-primary").text(""),i.siblings("span.label-primary").text(""))})});t=$(n.Scope).find(".form-group").not(".cstField");t.find(":input:radio, :input:checkbox").each(function(){var n=$(this);u(n);n.on("change",function(){u($(this))});n.on("inputgroup-unchecked",function(){u($(this))})});t.find(":input:checkbox").each(function(){$(this).on("change",function(){this.checked||$(this).closest("form").find(".cstField").each(function(n,t){$(t).find('input[id^="cst_"], select[id^="cst_"]').each(function(n,t){t.type==="select-one"?$(t).val("").trigger("change"):$(t).val("")})})})});$(n.Scope).find('.inv-aware:not([data-inv-type="DiscountCode"])').each(r);$(n.Scope).find('input[data-used-by-discount="Registration"]').each(o)});NextGen.ValidationManager.RegisterCustomValidation("NextGen.Online.Components.Client.RegistrationType.RegistrationTypeComponent",function(n){var t=[],i;return NextGen.ValidationManager.ValidatePageForCustomField(n)===!1&&t.push($.Deferred().reject().promise()),i=NextGen.ValidationManager.RevalidateForm(n,{ignore:':hidden:not(select, :input[name^="cst_"][name$="_html"]), .cstField:hidden select'}),t.push(i?$.Deferred().resolve().promise():$.Deferred().reject().promise()),NextGen.InventoryEnforcedByPayment!==!0&&(NextGen.EditingExisting===!1||NextGen.SubmitManager.IsSubmissionHappening()===!1)&&t.push(h(n)),t.push(c(n)),$.when.apply(this,t)});NextGen.ComponentController.RegisterOnPageLoadCallback("NextGen.Online.Components.Client.RegistrationType.RegistrationTypeComponent",function(t){n.subscriptions.Subscribe("Page_Navigated",n.events.onPageNavigated,{component:t});n.subscriptions.Subscribe("GroupComponent_OptionChanged",function(){e(undefined,{component:t},!0)});o(t)&&NextGen.Messaging.Publish("RegistrationTypeComponent_AccompanyingPersonNameChanged",f(t))});NextGen.ComponentController.RegisterOnSignInCompleteCallback("NextGen.Online.Components.Client.RegistrationType.RegistrationTypeComponent",function(n){o(n)&&NextGen.Messaging.Publish("RegistrationTypeComponent_AccompanyingPersonNameChanged",f(n))});NextGen.ComponentController.RegisterOnComponentDisposeCallback("NextGen.Online.Components.Client.RegistrationType.RegistrationTypeComponent",function(){n.subscriptions.UnsubscribeAll()})})();
//# sourceMappingURL=components_d72ad7a23479481d8a4f0e51b567a141.map
(function(){function t(n,t){n.find("span.username-text").empty().html(t||NextGen.Localization.Messages.SignIn.NotSignedIn())}function i(n){$(n.attr("href")).length>0?NextGen.AccountComponent.WireOpenTrigger(n):n.hide()}function r(n){return $("<a>").prop("href",n).prop("hostname")}var n={};n.events={};n.subscriptions=new NextGen.Messaging.SubscriptionManager;n.events.onUserChanged=function(n,i){t(i.component.Scope,n.name)};NextGen.Logger.errorWrap(n.events);NextGen.PageManager.RegisterForwardAction("NextGen.Online.Components.Client.Submit.SubmitComponent",function(){var n=$.Deferred();return NextGen.SubmitManager.Submit().done(function(t){if(t.redirectUrl){n.reject("Redirecting...");t.redirectMethod.toUpperCase()==="POST"?NextGen.Redirect.AutoPost(t.redirectUrl,t.formValues):t.redirectMethod.toUpperCase()==="GET"&&NextGen.Redirect.Get(t.redirectUrl);return}if(t.formValues&&t.formValues.externalRedirect){NextGen.PaymentGateway.ExternalRedirect.DealWithIt(t.formValues);return}var i=NextGen.Web.Url.GetParameter(NextGen.Web.Url.QueryStringKeys.ReturnTo),u=r(i);if(u&&u!==document.location.hostname&&(i=null),i&&t.contactId&&t.contactId.length>0&&(i=i+(i.indexOf("?")>=0?"&":"?")+NextGen.Web.Url.QueryStringKeys.ContactId+"="+t.contactId),i){n.reject("Redirecting...");NextGen.Redirect.Get(i);return}n.resolve()}).fail(function(t){NextGen.Alerts.danger(t);NextGen.Logger.error(t);n.reject(t)}),n.promise()});NextGen.ComponentController.RegisterOnComponentLoadCallback("NextGen.Online.Components.Client.Submit.SubmitComponent",function(r){var u=r.Scope.find("li.account-link a"),f=r.Scope.find("li.sign-out-link a");i(u);i(f);n.subscriptions.Subscribe("User_Changed",n.events.onUserChanged,{component:r});t(r.Scope,null)});NextGen.ComponentController.RegisterOnComponentDisposeCallback("NextGen.Online.Components.Client.Submit.SubmitComponent",function(){n.subscriptions.UnsubscribeAll()})})();
//# sourceMappingURL=components_d72ad7a23479481d8a4f0e51b567a141.map
(function(){var n={};n.events={};n.subscriptions=new NextGen.Messaging.SubscriptionManager;NextGen.ComponentController.RegisterOnPageLoadCallback("NextGen.Online.Components.Client.Summary.SummaryComponent",function(t){var i=t.Scope.find('[data-templateplaceholder="groupSummary"]');t.Scope.on("click","[data-target]",NextGen.Logger.errorWrap(function(){var n=$(this),t=n.closest(".summary-content").data("contact-number");NextGen.GroupManager.SwitchToContactAsync(t,!0).then(function(){var t=$("#"+n.data("target"));NextGen.PageManager.NavigateToPageWithElement(t);NextGen.GroupManager.IsGroupSubmission()&&NextGen.GroupManager.StartDataEntry()})}));t.Scope.on("click","[data-switch-contact]",NextGen.Logger.errorWrap(function(n){n.preventDefault();var t=$(this).data("switch-contact");NextGen.GroupManager.SwitchToContactAsync(t,!0).then(function(){NextGen.PageManager.NavigateToGroupPage(1);NextGen.GroupManager.StartDataEntry()})}));t.Scope.on("click","[data-edit-group]",NextGen.Logger.errorWrap(function(n){n.preventDefault();NextGen.PageManager.NavigateToGroupPage()}));n.events.onPageNavigated=function(n){t.PageNumber===n.toPage&&(NextGen.Controls.AjaxLoader.BlockLoading(!0),NextGen.ComponentController.WaitForComponentsToLoad().then(function(){var n;NextGen.InventoryEnforcedByPayment=!1;n=NextGen.EditingExisting&&NextGen.GroupManager.AllCompleted()&&!NextGen.GroupManager.AllSummariesLoaded()?NextGen.SummaryManager.LoadAllSummaries:NextGen.GroupManager.IsGroupSubmission()&&!NextGen.GroupManager.GetGroupContactAttending()&&NextGen.GroupManager.GetCurrentContactNumber()===0?NextGen.SummaryManager.LoadCompleteSummaries:NextGen.SummaryManager.LoadCompleteSummaries;n().then(function(){NextGen.TemplateManager.MutateAppliedTemplateData(i,t,!0,function(){return NextGen.SummaryManager.GetSummaryModel()})}).then(function(){var r=t.Scope.find("#getPolicies").val(),n,i;r==="True"&&(n=t.Scope.find('[data-templateplaceholder="policies"]'),i=NextGen.SummaryManager.LoadPolicies,i().then(function(t){n.html(t)}))}).always(function(){if($(".waiting-nav").find("button").attr("disabled",!1),$("[data-navigation-watcher]").attr("data-waiting-for-summary",!1),$("[data-navigation-watcher]").attr("data-waiting-for-async",!1),$("[data-navigation-watcher]").css("display","none"),NextGen.GroupManager.SetAllContactIncomplete(!1),NextGen.GroupManager.IsGroup())NextGen.GroupManager.SwitchToContactAsync(0).then(function(){var n=NextGen.Themes.HasTheme(t.Scope);n===!0&&NextGen.Themes.ApplyThemesForSummary(t.Scope)});else{var n=NextGen.Themes.HasTheme(t.Scope);n===!0&&NextGen.Themes.ApplyThemesForSummary(t.Scope)}NextGen.SetHasViewedSummary(!0);NextGen.Messaging.Publish("SummaryPage_Loaded");NextGen.Controls.AjaxLoader.UnblockLoading(!0)})}))};n.events.onAuthenticationSignOut=function(){var n=t.Scope.find("div.summary-content");n.empty();NextGen.SetHasViewedSummary(!1)};NextGen.Logger.errorWrap(n.events);n.subscriptions.Subscribe("Page_Navigated",n.events.onPageNavigated);n.subscriptions.Subscribe("Authentication_SignOut",n.events.onAuthenticationSignOut)});NextGen.ComponentController.RegisterOnComponentDisposeCallback("NextGen.Online.Components.Client.Summary.SummaryComponent",function(){n.subscriptions.UnsubscribeAll()});NextGen.ValidationManager.RegisterCustomValidation("NextGen.Online.Components.Client.Summary.SummaryComponent",function(n){if(!n.is(":visible"))return n.find('input:checkbox[name$="_Terms and Conditions"]').first().prop("checked",!0),NextGen.Utils.BooleanToPromise(!0);n.validate({ignore:":hidden:not(select), .cstField:hidden select"});var t=n.is(":visible")?n.valid():!0,i=NextGen.GroupManager.IsGroup()?NextGen.GroupManager.AllCompleted():!0;return NextGen.Utils.BooleanToPromise(t&&i)})})();
//# sourceMappingURL=components_d72ad7a23479481d8a4f0e51b567a141.map
var NextGen=NextGen||{};(function(){function i(){if(NextGen.AnalyticsForThankYouPage!==""){var n=$("<div>").html(NextGen.AnalyticsForThankYouPage);$("body").append($("<div>").attr("id","thankyouscript"));$("#thankyouscript").html(n.text())}}var n={},t;n.subscriptions=new NextGen.Messaging.SubscriptionManager;n.events={};t=function(n,t){n.contactIdentifier&&t.find("#contactIdentifier").html(n.contactIdentifier);n.gatewayReceiptNumber&&t.find("#gatewayReceiptNumber").html(n.gatewayReceiptNumber).closest("#gatewayReceiptNumberContainer").removeClass("hide");n.authorizationCode&&t.find("#authorizationCode").html(n.authorizationCode).closest("#authorizationCodeContainer").removeClass("hide");n.contactId&&n.contactIdentifier&&t.find("[data-append-contact-id]").each(function(t,i){var r=$(i).attr("href"),u="contactId="+n.contactId+"&contactIdentifier="+n.contactIdentifier,f=NextGen.Web.Url.AppendQueryStringToUrl(r,u);$(i).attr("href",f)})};n.events.onSiteSubmitted=function(n,r){n&&t(n,r.component.Scope);localStorage.clear();n.submittingEventsAirPayments||i()};NextGen.Logger.errorWrap(n.events);NextGen.ComponentController.RegisterOnComponentLoadCallback("NextGen.Online.Components.Client.ThankYou.ThankYouComponent",function(r){if(r.PageNumber===0){var u={contactId:NextGen.Web.Url.GetParameter("contactId"),contactIdentifier:NextGen.Web.Url.GetParameter("contactIdentifier"),gatewayReceiptNumber:NextGen.Web.Url.GetParameter("gatewayReceiptNumber"),authorizationCode:NextGen.Web.Url.GetParameter("authorizationCode")};t(u,r.Scope);localStorage.clear();i()}else n.subscriptions.Subscribe("Site_Submitted",n.events.onSiteSubmitted,{component:r})});NextGen.ComponentController.RegisterOnComponentDisposeCallback("NextGen.Online.Components.Client.ThankYou.ThankYouComponent",function(){n.subscriptions.UnsubscribeAll()})})();
//# sourceMappingURL=components_d72ad7a23479481d8a4f0e51b567a141.map
var NextGen=NextGen||{};(function(){function c(n){o=n;for(var r=0;r<t.length;r++)i(t[r])}function l(i){for(var e=n.length,f=!1,u=0;u<e;u++)n[u].accompanyingPersonId===i.accompanyingPersonId&&(n[u]=i,f=!0);for(f||n.push(i),u=0;u<t.length;u++)r(t[u])}function i(n){n.find("[data-defaultfromcontact]").each(function(){var n=$(this),t=n.find("input");t.each(function(){var n=$(this),t;return f?!0:(t=o[n[0].name],t&&(n.val(t),n.trigger("change"),f=!1),!0)})})}function r(t){n.length!=0&&t.find("[data-context]").each(function(t){var r=$(this),u=r.find("input"),i;if(r[0].getAttribute("data-context")==1||(i=n[t-1],i===undefined))return!0;u.each(function(){var n=$(this),t;n.val().length==0&&(t=i[n.context.name],t&&(n.val(t),n.trigger("change")))})})}function a(n){n.closest("div.form-group").addClass("has-error");n.nextAll(".has-error.control-label").remove();n.after($('<label for="'+n.attr("id")+'" class="has-error control-label">'+NextGen.Localization.Messages.Travel.InvalidPort()+"<\/label>"))}function v(n){n.closest("div.form-group").removeClass("has-error");n.nextAll(".has-error.control-label").remove()}function y(n){if(n.is(":radio")&&n.is(":checked")){var t=n.attr("id");return t&&t.length>0&&t.toLowerCase().indexOf("nooption")>0?$.Deferred().resolve().promise():NextGen.InventoryManager.IsInventoryAvailable("Travel","radio",n)}return $.Deferred().resolve().promise()}function p(n){var t=[],i=$(n).find(".inv-aware").not(":hidden"),r=n.find('[name="passengerCount"]').val();return i.each(function(n,i){$(i).attr("data-inv-quantity",r);t.push(y($(i)))}),$(t).each(function(t,i){i.fail(function(t){$(t.result.Rejections).each(function(t,i){var r=$(n).find("#"+i.ParentId);r.inventoryInputWatcher().ShowInventoryErrorMessage(i.ParentId,NextGen.Localization.Messages.InventoryCheck.Full())});$.Deferred().reject().promise()})}),$.when.apply(this,t)}function w(n){var r="",u=0,t=$(n).filter(":checked"),i;if(t.length>1)$(t).each(function(n,t){var i=$(t).attr("name");i&&i.match("_NoOption$")&&i.match("_NoOption$").length>0&&u++}),t.length!==u&&(r=$(t).attr("name"));else{if(i=$(t).attr("name"),i&&i.match("_NoOption$")&&i.match("_NoOption$").length>0)return"";r=i}return r}function h(n){$(n).attr("required","true");$(n).removeAttr("originalAttibute")}function e(n){$(n).attr("originalAttibute","required");$(n).removeAttr("required")}function b(n){var t=!0;return $(n).has('[name^="cst_"]').each(function(n,i){var r=$(i),o=r.find(".form-group").not(".cstField"),f=$(o).find(":input").not('input[type="hidden"]'),u=w(f,r),s=$(f).attr("required");r.find(':input[name^="cst_"]').not(":hidden").add(r.find(':input[name^="cst_"][name$="_html"]')).each(function(n,i){var r=$(i),f=r.val(),o=!1,c=!1;r.is(":checkbox")||r.is(":radio")?(r.is(":checked")===!0&&(c=!0),o=!0):r.is(":file")&&(f=r.closest(".file-input").find(".file-caption-name").text().trim(),f&&f.length>0&&r.attr("required")&&e(r));f!==null&&f!==""&&u===""?o&&c===!1?r.attr("required")&&e(r):s||(NextGen.Alerts.warning(NextGen.Localization.Messages.Travel.SelectAnOption()),t=!1):r.attr("required")&&f===""&&u===""?e(r):r.attr("originalAttibute")&&f===""&&u!==""?h(r):o&&r.attr("originalAttibute")&&c===!1&&u!==""&&h(r)})}),t}function k(n){var t=$.Deferred();return NextGen.Server.TravelComponent.IsValidPort({port:n}).done(function(n){n===!0?t.resolve():t.reject()}).fail(function(){t.reject()}),t.promise()}function d(n){var t=!0,i=n.find('input:hidden[name*="passengerNamesRequired"]');return i.length>0&&i.val()==="False"?t:($(n).find('div[data-templateplaceholder="travelPassengers"]').not(":hidden").each(function(n,i){var u=$(i),r=!0,o=u.find('input:text[id*="_Title"]'),e,f;o.each(function(n,t){var i=$(t);$.trim(i.val()).length===0&&(r=!1)});e=u.find('input:text[id*="_FirstName"]');e.each(function(n,t){var i=$(t);$.trim(i.val()).length===0&&(r=!1)});f=u.find('input:text[id*="_LastName"]');f.each(function(n,t){var i=$(t);$.trim(i.val()).length===0&&(r=!1)});r===!1&&f.length>0&&(NextGen.Alerts.warning(NextGen.Localization.Messages.Travel.PassengerDetails()),t=!1)}),t)}function g(n){if(NextGen.EditingExisting===!0&&$(n).find(":radio:checked").not('[name^="cst_"]').length===0){var t=$(n).find('[name$="_NoOption"]');t.length>0&&t.prop("checked",!0)}}function u(n){var i=!1,e=!1,r="",o=!1,s=!1,t,u,h,c,f;n.Scope.find(":radio:checked").not('[name^="cst_"]').each(function(){var f=$(this),t=f.data("inputtype"),n,u;if(t&&t.toLowerCase().indexOf("travel")>0)i=!0;else return;n=f.attr("id");n&&n.length>0&&(n.toLowerCase().indexOf("nooption")>0&&(i=!1,u=t.substring(0,n.indexOf("_")),r===""?r=u:r!==u&&(e=!0)),n==="CustomInbound"&&(o=!0),n==="CustomOutbound"&&(s=!0))});i&&!e?(t=n.Scope.find('[name="passengerCount"]'),u=n.Scope.find('input:hidden[name*="passengerNamesRequired"]'),t.length>0&&(h=u.length>0&&u.val()==="True",c=h||o||s,c?(f=t.val(),f&&f!=="0"||t.val("1").trigger("change"),t.parent().find(".select2-selection__clear").hide()):t.parent().find(".select2-selection__clear").show()),n.Scope.find(".travel-passengers").show()):n.Scope.find(".travel-passengers").hide()}var o={},f=!1,n=[],t=[],s=null;self.subscriptions=new NextGen.Messaging.SubscriptionManager;self.subscriptions.Subscribe("RegistrationTypeComponent_AccompanyingPersonNameChanged",NextGen.Logger.errorWrap(l));NextGen.ComponentController.RegisterOnComponentDisposeCallback("NextGen.Online.Components.Client.Travel.TravelComponent",function(n){var t=NextGen.PageManager.GetVisiblePageNumbers(),i=NextGen.PageManager.GetPageNumber(n.Scope),r=$.inArray(i,t);r===-1&&self.subscriptions.UnsubscribeAll(n.Id)});NextGen.ComponentController.RegisterOnPageLoadCallback("NextGen.Online.Components.Client.Travel.TravelComponent",function(n){$(n.Scope).find("[data-togglevisibility]").each(function(){var t=$(this),n=$("#"+t.data("togglevisibility"));i(n);r(n)})});NextGen.ComponentController.RegisterOnSignInCompleteCallback("NextGen.Online.Components.Client.Travel.TravelComponent",function(n){$(n.Scope).find("[data-togglevisibility]").each(function(){var t=$(this),n=$("#"+t.data("togglevisibility"));i(n);r(n)})});NextGen.ComponentController.RegisterOnComponentLoadCallback("NextGen.Online.Components.Client.Travel.TravelComponent",function(n){self.subscriptions.Subscribe("ContactComponent_ContactNameChanged",NextGen.Logger.errorWrap(c),{componentId:n.Id});$(n.Scope).find("[data-togglevisibility]").each(function(){var n=$(this),t=$("#"+n.data("togglevisibility"));t.on("togglevisibility-on",NextGen.Logger.errorWrap(function(){i($(this));r($(this))}))});s=n.Scope.find('[name="passengerCount"]');s.on("change",function(){var o=$(this),r=o.closest(".travel-passengers").find("[data-templateplaceholder][data-templatesource]"),i,e;if(t.push(r),i=+o.val(),r.length!==0){r.on("change","input",function(){f=!0});n.Scope.find(".inv-aware").each(function(n,t){var r=$(t);r.attr("data-inv-quantity",i);(r.is(":checked")||r.is(":disabled"))&&r.trigger("after-change")});e=NextGen.TemplateManager.MutateAppliedTemplateData(r,n,!0,function(n){var r=n.passengers.length,t,u;if(r!==i)if(r<i)for(t=0;t<i;t++)u=NextGen.Utils.FirstOrDefault(n.passengers,function(n,i){return i.contextId===t+1}),u||n.passengers.push({contextId:t+1});else n.passengers=$.grep(n.passengers,function(n){return n.contextId<=i});return n});e.done(function(){n.Scope.find(".theme-textbox, .theme-select").each(function(){var n=$(this);n.val().length&&n.addClass("field--not-empty")});var t=n.Scope.find("[data-templateplaceholder][data-templatesource]");t&&t.find("input").each(function(){var t=$(this),i=t.parents("[data-context]"),n;i&&(n=i.find("h4"),n&&t.attr("aria-describedby",n[0].id))});u(n)});e.fail(function(n){NextGen.Logger.error(n)})}});n.Scope.on("change","[data-templated]",function(){var t=$(this),u=t.closest("[data-templateplaceholder][data-templatesource]"),f=t.closest("[data-context]").data("context"),r={},e,i;r[t.attr("name")]=t.val();e=t.attr("id");i=NextGen.TemplateManager.MutateAppliedTemplateData(u,n,!1,function(n){var t=NextGen.Utils.FirstOrDefault(n.passengers,function(n,t){return t.contextId===f});return t&&$.extend(!0,t,r),n});i.done(function(){n.Scope.find(".theme-textbox, .theme-select").each(function(){var n=$(this);n.val().length&&n.addClass("field--not-empty")})});i.fail(function(n){NextGen.Logger.error(n)})});n.Scope.find(".custom-travel-flight-number").off("change");n.Scope.find(".custom-travel-flight-number").on("change",function(){var i=$(this),n=i.siblings(".custom-travel-carrier").find("span"),r,t;n.length!==0&&(r=i.val(),t=n[1],n.hide().html(""),t||(t=$('<span class="ajax-spinner"><\/span>'),t.insertAfter(n)),NextGen.Server.TravelComponent.Carriers({flightNumber:r}).always(function(){t.remove()}).done(function(t){t&&t.carrierName&&n.show().html(t.carrierName)}).fail(function(n){NextGen.Logger.error(n)}))});n.Scope.find('[data-autocomplete="true"]').each(function(n,t){var i=$(t);if(!i.hasClass("tt-hint")&&!i.hasClass("tt-input")){i.typeahead({hint:!0,minLength:1,highlight:!0},{name:"ports",displayKey:"value",source:NextGen.Server.TravelComponent.Ports.Bloodhound()});i.on("typeahead:selected",function(){$(this).trigger("change")});i.on("typeahead:autocompleted",function(){$(this).trigger("change")})}});n.Scope.find('[name$="_NoOption"]').on("change",function(){var t=$(this);t.is(":checked")&&n.Scope.find(".cstField :radio:checked").prop("checked",!1).change()});g(n.Scope);n.Scope.find('[name="passengerCount"]').trigger("change");n.Scope.find(":radio").not('[name^="cst_"]').each(function(){var t=$(this);t.is(":checked")&&(t.parents(".sectorinfo.sector-box").addClass("theme-selected-sector"),u(n));t.on("change",function(){$(this).is(":checked")&&($(this).parents(".sectorinfo.sector-box").addClass("theme-selected-sector"),u(n))});t.on("inputgroup-unchecked",function(){t.parents(".sectorinfo.sector-box").removeClass("theme-selected-sector");u(n)})})});NextGen.ValidationManager.RegisterCustomValidation("NextGen.Online.Components.Client.Travel.TravelComponent",function(n){var t=[],i;return n.find('.tt-input[data-autocomplete="true"]').each(function(n,i){var r=$(i),u;r.closest(".sectorinfo").prev(".row.form-group").find(":radio:checked").length>0&&(u=k(r.val().trim()).done(function(){v(r)}).fail(function(){a(r)}),t.push(u))}),NextGen.ValidationManager.ValidatePageForRadioButton(n)===!1&&t.push($.Deferred().reject().promise()),b(n)===!1&&t.push($.Deferred().reject().promise()),i=NextGen.ValidationManager.RevalidateForm(n,{ignore:':hidden:not(select, :input[name^="cst_"][name$="_html"]), .cstField:hidden select, .sectorinfo:hidden select'}),t.push(i?$.Deferred().resolve().promise():$.Deferred().reject().promise()),NextGen.InventoryEnforcedByPayment!==!0&&(NextGen.EditingExisting===!1||NextGen.SubmitManager.IsSubmissionHappening()===!1)&&t.push(p(n)),d(n)===!1&&t.push($.Deferred().reject().promise()),$.when.apply(this,t)})})();
//# sourceMappingURL=components_d72ad7a23479481d8a4f0e51b567a141.map

//# sourceMappingURL=components_d72ad7a23479481d8a4f0e51b567a141.map
