function adaptUserName(n){return n.length>28?n.substring(0,28)+"...":n}function notificationVariant(){$(".notifications-indicator p.notification-info span:first-child").addClass("hidden");$(".area-riservata a").addClass("lock-over");var n="EAMBASCO TECNICHE AZIENDALI SATAMBASCO TECNICHE AZ";$(".area-riservata a span:first-child").html(adaptUserName(n));$("header .notifications-banner .user strong").html(adaptUserName(n))}function calcCookieHeight(){var n=0;return $(".panel.cookie-warn").is(":visible")&&(n=$(".panel.cookie-warn").outerHeight()),n}function startSpinner(n){var t,i;$("#sticky-banner button").attr("disabled","disabled");t="";typeof isCustomerApp!="undefined"&&isCustomerApp()==="True"&&(t="whiteBackground");$("body").append($('<div class="modal-layer spinnerBaloons '+t+'">').append('<div class="wrapper spinner generalSpinner hide"><div id="spinner-loader" tabindex="10001" z-index="1001"><img src="Images/loader2.gif"><\/div><div id="spinnerText">Un attimo ancora, caricamento in corso...<\/div><div class="clear"><\/div><\/div>'));typeof n!="undefined"&&$("#spinnerText").html(n.html());$("body div.wrapper.spinner.generalSpinner div#spinner-loader").focus();$("html body div.wrapper.spinner.generalSpinner").removeClass("hide");$("html body div.wrapper.spinner.generalSpinner").show();i=$(window).width()/2-$("html body div.wrapper.spinner.generalSpinner").outerWidth()/2;$("html body div.wrapper.spinner.generalSpinner").offset({top:"25%",left:i})}function stopSpinner(){$(".modal-layer").remove();$("#sticky-banner button").removeAttr("disabled")}function isNumberKey(n){var t=n.which?n.which:n.keyCode;return t!=46&&t>31&&(t<48||t>57)?!1:!0}function isValidDate(n){var t;if(n.length!=10)return!1;if(t=n.split("/"),t.length==3){var i=t[0].toString(),r=t[1].toString(),u=t[2].toString();if(i.length<2||u.length<3||r.length<2)return!1}else return!1;return!0}function startFieldSpinner(n,t){typeof t=="undefined"&&(t="center");$("body").append('<div id="field-loader" class="wrapper spinner fieldSpinner" tabindex="10001"><\/div>');fl=new CanvasLoader("field-loader");fl.setColor("#003399");fl.setDiameter(26);fl.setDensity(55);fl.setRange(.9);fl.setFPS(28);var i=n.offset(),u=n.width(),f=n.height(),r=i.left+(u-fl.getDiameter())/2;t=="left"?r=i.left:t=="right"&&(r=i.left+(u-fl.getDiameter()));$("#field-loader").offset({top:i.top-(f-fl.getDiameter())/2,left:r});$("#field-loader").focus();n.prop("disabled",!0);fl.show()}function stopFieldSpinner(n){n.prop("disabled",!1);fl.hide();$("html body div#field-loader").remove()}function hideField(n){$(n).hasClass("nascosto")||($(n).css({opacity:1}),$(n).fadeTo(fadeSpeed,0,function(){$(n).addClass("nascosto");$(n).hide()}))}function showField(n){$(n).hasClass("nascosto")&&($(n).css({opacity:0}),$(n).removeClass("nascosto"),$(n).show(),$(n).fadeTo(fadeSpeed,1))}function SetCalendar(){var n,t;$(".calendar .input-group.date .input-group-addon>img").each(function(n,t){var i={language:"it",orientation:"top right",multidate:!1,autoclose:!0,todayHighlight:!0},u=$(t).parent().parent().data("start-date"),r=$(t).parent().parent().data("end-date");(u!=undefined||u!=null)&&(i.startDate="+0d");(r!=undefined||r!=null)&&(i.endDate=r);$(t).datepicker(i)});$(".calendar .input-group.date .input-group-addon>img").click(function(){var i,n,t,r;$(".datepicker.dropdown-menu").hasClass("datepicker-is-opened")?($(".datepicker").hide(),$(".datepicker.dropdown-menu").removeClass("datepicker-is-opened")):(i=$(this).offset().top-45,$("html, body").animate({scrollTop:i},1e3),$(".datepicker.dropdown-menu").addClass("datepicker-is-opened"),n=$(this).parents(".input-group.date").find("input[type='text']").val(),!n||n==""||n.indexOf("_")>-1||n=="__/__/____"||n.indexOf("/")>-1&&(t=n.split("/"),r=new Date(t[2],t[1]-1,t[0]),$(this).datepicker("setDate",r)))}).on("changeDate",function(n){var t=n.date,u=t.getDate()>=10?t.getDate():"0"+t.getDate(),f=t.getMonth()+1>=10?t.getMonth()+1:"0"+(t.getMonth()+1),i=u+"/"+f+"/"+t.getFullYear(),r;$(this).parents(".input-group.date").find("input[type='text']").val(i);$(this).parents(".input-group.date").find("input[type='text']").change();new Date(i.split("/").reverse().join("/"))>=new Date&&(r=$(this).parents(".input-group.date").find("input[type='text']")[0].id,$("."+r).each(function(){$(this).val(i)}))});$(".calendar .input-group.date input[type=text]").on("click",function(){$(window).width()>=768&&$(this).siblings("span").find("img").trigger("click")});$("body").on("click",function(n){$(".pop").each(function(){$(this).is(n.target)||$(this).has(n.target).length!==0||$(".popover").has(n.target).length!==0||$(this).popover("hide")})});$("[data-date-father]").on("changeDate",function(){$('[data-date-son="'+$(this).data("date-father")+'"]').datepicker("setDate",$(this).datepicker("getDate"))});$("[data-input-father]").change(function(){$('[data-input-son="'+$(this).data("input-father")+'"]').val($(this).val())});$(".phoneMask>input[type='tel']").keypress(function(n){return isNumberKey(n)});$(".date-input,.input-group.date>input[type='text']").keypress(function(n){return isNumberKey(n)});$(".date-input,.input-group.date>input[type='text']").focusout(function(){isValidDate($(this).val())||$(".date-input,.input-group.date>input[type='text']").val("")});n=navigator.userAgent.toLowerCase();t=n.indexOf("android")>-1;t?$(".date-input,.input-group.date>input[type='text']").keyup(function(n){var t,i;n.keyCode!=193&&n.keyCode!=111?n.keyCode!=8?$(this).val().length==2?$(this).val($(this).val()+"/"):$(this).val().length==5&&$(this).val($(this).val()+"/"):(t=$(this).val(),$(this).val().length==5?$(this).val(t.substring(0,4)):$(this).val().length==2&&$(this).val(t.substring(0,1))):(t=$(this).val(),i=$(this).val().length,$(this).val(t.substring(0,i-1)))}):$(".date-input,.input-group.date>input[type='text']").keyup(function(n){var t,i;n.ctrlKey&&n.keyCode==86?$(".date-input,.input-group.date>input[type='text']").mask("99/99/9999"):($(".date-input,.input-group.date>input[type='text']").unmask(),n.keyCode!=193&&n.keyCode!=111?n.keyCode!=8?$(this).val().length==2?$(this).val($(this).val()+"/"):$(this).val().length==5&&$(this).val($(this).val()+"/"):(t=$(this).val(),$(this).val().length==5?$(this).val(t.substring(0,4)):$(this).val().length==2&&$(this).val(t.substring(0,1))):(t=$(this).val(),i=$(this).val().length,$(this).val(t.substring(0,i-1))))});$(".date-input,.input-group.date>input[type='text']").click(function(){if($(this).val().length==10){var n=$(this).caret();n.begin>=6&&n.begin<=10?$(this).caret(6,10):n.begin>=3&&n.begin<=5?$(this).caret(3,5):n.begin>=0&&n.begin<=2&&$(this).caret(0,2)}});$(".pop.pop-bottom").popover({placement:"bottom",animation:!1,html:!0});$(".pop").not(".pop-bottom").popover({placement:"top",animation:!1,html:!0});popOverDisplay()}function isBreakpoint(n){return $(".device-xs.visible-xs").length==0&&$("body").append($('<div class="device-xs visible-xs"><\/div>')).append($('<div class="device-sm visible-sm"><\/div>')).append($('<div class="device-md visible-md"><\/div>')).append($('<div class="device-lg visible-lg"><\/div>')),$(".device-"+n).is(":visible")}function popOverDisplay(){$(".pop").on("hidden.bs.popover",function(){$(this).children("img").attr("src","Images/question.png")});$(".pop").on("shown.bs.popover",function(){if($(this).offset().left>$(window).width()/2){$(".pop:visible").not(this).popover("hide");$(this).children("img").attr("src","Images/close.png");var n=$(window).width()-$(this).offset().left-$(this).width();$(".popover").css({left:"auto",right:n+"px"});$(".popover.top > .arrow").css({left:"auto",right:$(this).width()/2-$(".popover.top > .arrow").outerWidth()/2+"px"})}else $(".pop:visible").not(this).popover("hide"),$(this).children("img").attr("src","Images/close.png"),$(".popover").css("left",$(this).offset().left+"px"),$(".popover.top > .arrow").css("left",$(this).width()/2+"px")})}function setLinksToIngoreTabIndex(){$("div.question a.pop").attr("tabindex","-1");$("div.area-riservata a").attr("tabindex","-1");$("div.logo a").attr("tabindex","-1")}function ajaxSuccessComplete(){stopCustomSpinner()}function ajaxErrorComplete(){stopCustomSpinner()}function startCustomSpinner(n){var t,i;stopCustomSpinner();t="";typeof isCustomerApp!="undefined"&&isCustomerApp()==="True"&&(t="whiteBackground");$("body").append($('<div class="modal-layer spinnerBaloons '+t+'">').append('<div class="wrapper spinner generalSpinner hide"><div id="spinner-loader" tabindex="10001" z-index="1001"><img src="Images/loader2.gif"><\/div><div id="spinnerText">Un attimo ancora, caricamento in corso...<\/div><div class="clear"><\/div><\/div>'));typeof n!="undefined"&&$("#spinnerText").html(n);$("body div.wrapper.spinner.generalSpinner div#spinner-loader").focus();$("html body div.wrapper.spinner.generalSpinner").removeClass("hide");$("html body div.wrapper.spinner.generalSpinner").show();i=$(window).width()/2-$("html body div.wrapper.spinner.generalSpinner").outerWidth()/2;$("html body div.wrapper.spinner.generalSpinner").offset({top:"25%",left:i})}function stopCustomSpinner(n){n==null?$(".modal-layer").remove():setTimeout(function(){$(".modal-layer").remove()},n*1e3)}function AdForm(n,t,i){typeof $("#adFormDiv")!="undefined"&&typeof $("#adFormDiv").length!="undefined"&&$("#adFormDiv").length>0&&$.ajax({url:"/AdForm/Index",data:{id:n,pagina:t,preventivatore:i},dataType:"html",success:function(n){$("#adFormDiv").html(n)}})}function AdForm(n,t,i,r){typeof $("#adFormDiv")!="undefined"&&typeof $("#adFormDiv").length!="undefined"&&$("#adFormDiv").length>0&&$.ajax({url:"/AdForm/Index",data:{id:n,pagina:t,preventivatore:i,inIsGlobalTrackingPoint:r},dataType:"html",success:function(n){$("#adFormDiv").html(n)}})}function IsNullOrEmptyString(n){return n===""||n===undefined}function getUserEmail(){$.ajax({type:"POST",url:"/Utility/GetUserEmail",dataType:"json",success:function(n){$("#EmailSaveInDraft").val(n)}})}function openLChatBot(){$.ajax({type:"POST",url:"/Utility/GetChatBotURL",dataType:"json",success:function(n){window.open(n,"","height=500,width=400");$("#ins-email").modal("toggle")}})}function counterSalvaBozza(n){var t={azione:n},i=JSON.stringify(t);$.ajax({type:"POST",url:"/Utility/UpdateCounterSalvaBozza",data:i,contentType:"application/json",dataType:"text",success:function(){}})}function InitSaveInDraft(){$("#ins-email").modal("show");$('#ins-email div[id="bodyMailHeader"]').show();$('#ins-email div[id="title_abbandono"]').hide();$('#ins-email div[id="title_standard"]').show();$('#ins-email div[id="bodyMail"]').show();$('#ins-email div[id="bodyPagamento"]').show();$("#bodyOK").modal("hide");$("#bodyOkPagamento").modal("hide");counterSalvaBozza("UTILIZZO");$(".modal-salvataggio-radio.modal-salvataggio-radio--border").addClass("active");$("#EmailSaveInDraft").removeAttr("disabled")}function SaveInDraft(){if(!IsNullOrEmptyString($("#EmailSaveInDraft").val())&&$("#EmailSaveInDraft").val()!="Indirizzo email"){AddHiddenClass('#ins-email div[id="redAlert"]');var n={vm:$("#formDati").serializeDraft(),onlyCheck:!1},t=JSON.stringify(n),i="/"+currentController+"/SaveInDraft";$('#ins-email div[id="bodyMailHeader"]').hide();$('#ins-email div[id="bodyMail"]').hide();$('#ins-email div[id="bodyPagamento"]').hide();$('#ins-email div[id="bodySpinner"]').show();$.ajax({url:i,type:"POST",data:t,contentType:"application/json",dataType:"json",success:function(n){n.EmailSaveInDraftRedAlert!=null&&n.EmailSaveInDraftRedAlert?($("#ins-email").modal("show"),$('#ins-email div[id="bodyMailHeader"]').show(),$('#ins-email div[id="bodyMail"]').show(),$('#ins-email div[id="bodyPagamento"]').show(),$("#bodyOK").modal("hide"),$("#bodyOkPagamento").modal("hide"),RemoveHiddenClass('#ins-email div[id="redAlert"]',"Inserisci un indirizzo email valido"),$('#ins-email div[id="bodySpinner"]').hide()):(counterSalvaBozza("DEM"),$("#mailSentInDraft").text($("#EmailSaveInDraft").val()),$("#ins-email").modal("hide"),$("#bodyOK").modal("show"),AddHiddenClass('#ins-email div[id="redAlert"]'),$('#ins-email div[id="bodySpinner"]').hide())},error:function(){}})}}function InitSendEmailCustom(n){n&&$('#ins-email input[id="info-dos"]').val(JSON.stringify(n));$('#ins-email div[id="title_standard"]').show();$('#ins-email div[id="title_abbandono"]').hide();VisibilityOff('#ins-email div[id="redAlert"]');$('#ins-email div[id="bodyMailHeader"]').show();$('#ins-email div[id="bodyMail"]').show();$('#ins-email div[id="bodyMailFooter"]').show();$('#ins-email div[id="bodySpinner"]').hide();$('#ins-email div[id="dataContainer"]').show();$('#ins-email div[id="standardBtn"]').show();$("#ins-email").modal("show");$("#bodyOK").modal("hide")}function SendMailCustom(){var t=$("#CustomEmail").val(),n;if(!/\w+@\w+\.[a-z]+/.test(t)){VisibilityOn('#ins-email div[id="redAlert"]',"Il campo email non è valido");return}VisibilityOff('#ins-email div[id="redAlert"]');$('#ins-email div[id="bodyMailHeader"]').hide();$('#ins-email div[id="bodyMail"]').hide();$('#ins-email div[id="bodyMailFooter"]').hide();$('#ins-email div[id="bodySpinner"]').show();n={custom_email:$("#CustomEmail").val(),hInfo:$('#ins-email input[id="info-dos"]').val()};n.hInfo&&jQuery.extend(n,JSON.parse(n.hInfo));delete n.hInfo;$.ajax({url:"/"+currentController+"/PreventivoInviaEmail",type:"POST",data:JSON.stringify(n),contentType:"application/json",dataType:"text",success:function(n){n=="Impossibile inviare la mail"?($("#bodyOK .modal-body .esito.fail h2").html(n),$("#bodyOK .modal-body .esito.success").hide()):($("#bodyOK .modal-body .esito.success h2").html(n),$("#bodyOK .modal-body .esito.fail").hide());$("#ins-email").modal("hide");$("#bodyOK").modal("show");VisibilityOff('#ins-email div[id="redAlert"]');$('#ins-email div[id="bodySpinner"]').hide()},error:function(){}})}function CloseModal(){SendToOTP=!1;$("#primaConfermaOTP").modal("hide");$("#ins-otp").modal("hide");$(".modal-backdrop").remove();userOtpBlocked==!0&&(window.location.replace=AreaRiservataActionLink())}function ResendOtp(n){$(".lblOtpMess").html("Codice inviato correttamente");(n==null||n==undefined)&&(n=1);var t="/AreaRiservata/SendOtp?operationType="+n;$.ajax({url:t,type:"POST",contentType:"application/json",dataType:"json",success:function(n){n.id=="403"&&($("#ConfermaButton").addClass("disabled"),$(".lblOtpMess").html("Utente bloccato. Non è possibile richiedere un nuovo codice!"))},error:function(){}})}function CheckOtpClusterIntermediari(n,t,i){var r=!1,u={operationType:n,codProdotto:t,codConvenzione:i},f=JSON.stringify(u);return $.ajax({type:"POST",data:f,contentType:"application/json",dataType:"json",url:"/AreaRiservata/CheckOtpClusterIntermediari",async:!1,success:function(n){n.Blocked&&(r=!0)}}),r}function SendOTP(n,t,i,r,u,f,e,o,s,h,c,l,a,v){var y,p,w;y=l=="SendOtpSignup"?{operationType:i,userid:a,pwd:v}:{operationType:i};p=JSON.stringify(y);w=l!=null&&l!=""?l:"SendOtp";$.ajax({type:"POST",url:"/AreaRiservata/"+w,data:p,dataType:"json",contentType:"application/json",success:function(t){var a,v,i;if(t.id=="200")return a=t.sentTo,v="",(r!=null||r!="")&&$(e).html(r),a=="Phone"?($(o).html(u+" via sms al numero "+t.sentAt+" "+f),$(s).html("Hai cambiato numero di cellulare?  "+n)):($(o).html(u+" via e-mail a "+t.sentAt+" "+f),$(s).html("Hai cambiato mail?  "+n)),l=="SendOtpSignup"&&$("h1.title-modal").html("VERIFICA"),c!=null&&$(c).modal("show"),stopCustomSpinner(),i=t.avoidOtpForTesting,i!=null&&i!=""&&(document.getElementById(h).value=i),!1;t.id=="403"?($("#ins-otp").modal("show"),$('#ins-otp div[id="bodySpinner"]').hide(),$('#ins-otp div[id="bodyMail"]').show(),$('#ins-otp div[id="bodyMailFooter"]').show(),showRedAlertMessage('#ins-otp div[id="redAlert"]',"Utente bloccato. Non è possibile richiedere un nuovo codice!"),stopCustomSpinner()):($("#ins-otp").modal("show"),$('#ins-otp div[id="bodySpinner"]').hide(),$('#ins-otp div[id="bodyMail"]').show(),$('#ins-otp div[id="bodyMailFooter"]').show(),showRedAlertMessage('#ins-otp div[id="redAlert"]',"Errore interno al Sistema. Riprovare"),stopCustomSpinner())},error:function(){}})}function ConfirmOTP(n,t,i,r,u,f,e){if(t===undefined&&(t=!0),IsNullOrEmptyString($("#codeOTP").val())||$("#codeOTP").val()=="Codice di Verifica"){showRedAlertMessage('#ins-otp div[id="redAlert"]',"Codice inserito non valido");return}$.when().then($("#ins-otp").modal("hide")).then($(".modal-backdrop").remove()).then(function(){var h=!1,c,l,o,s;return c=u!=null&&u!=""&&u=="ValidateTOtpSignup"?{otp:$("#codeOTP").val(),userid:f,pwd:e,renewPSK:r}:{otp:$("#codeOTP").val(),renewPSK:r,modificaDati:t},l=JSON.stringify(c),o=u!=null&&u!=""?u:"ValidateTOtp",s=n!=null||n!=undefined?"/"+n+"/"+o:"/"+currentController+"/"+o,$('#ins-otp div[id="bodyMail"]').hide(),$('#ins-otp div[id="bodyMailFooter"]').hide(),$('#ins-otp div[id="bodySpinner"]').show(),$.ajax({url:s,type:"POST",data:l,async:!1,contentType:"application/json",dataType:"json",success:function(n){if(n.id=="200"){h=!0;var r=$("form").serialize();if(t)$.ajax({url:"/AreaRiservata/ActionITuoiDati",type:"POST",data:r,success:function(){var n,t;return $.validator.unobtrusive.addValidation("form"),gestioneButtonActive(),gestioneModificaEliminaDomicilio(),n=$(".error"),n.length>0&&(t=n.offset().top,$(window).scrollTop(t)),$("#ins-otp").modal("show"),$('#ins-otp div[id="bodyMail"]').hide(),$('#ins-otp div[id="bodyMailFooter"]').hide(),$('#ins-otp div[id="bodySpinner"]').hide(),$('#ins-otp div[id="bodyOk"]').show(),$('#ins-otp div[id="bodyOkFooter"]').show(),!1},error:function(){}});else return i(),!1}else n.id=="401"?($("#ins-otp").modal("show"),$('#ins-otp div[id="bodySpinner"]').hide(),$('#ins-otp div[id="bodyMail"]').show(),$('#ins-otp div[id="bodyMailFooter"]').show(),showRedAlertMessage('#ins-otp div[id="redAlert"]',"Codice inserito non valido")):n.id=="403"?($("#ins-otp").modal("show"),$('#ins-otp div[id="bodySpinner"]').hide(),t?($('#ins-otp div[id="bodyFailed"]').show(),$('#ins-otp div[id="bodyFailedFooter"]').show()):($('#ins-otp div[id="bodyMail"]').show(),$('#ins-otp div[id="bodyMailFooter"]').show()),showRedAlertMessage('#ins-otp div[id="redAlert"]',"<b>3 tentativi falliti<\/b><br>Hai superato il numero massimo di tentativi disponibili. Riprova fra 24 ore."),$(".lblOtpMess").hide(),$("#ConfermaButton").addClass("disabled"),$("#ConfermaButton").addClass("errorDisabled"),$("[data-group-id='Anagrafica.ModificaContatto'][id='No']").click(),$("[data-group-id='Anagrafica.ModificaContatto']").addClass("disabled").removeClass("active"),$("#pnlWarnUpdateBlocked").removeClass("hide"),userOtpBlocked=!0):($("#ins-otp").modal("show"),$('#ins-otp div[id="bodySpinner"]').hide(),$('#ins-otp div[id="bodyMail"]').show(),$('#ins-otp div[id="bodyMailFooter"]').show(),VisibilityOn('#ins-otp div[id="redAlert"]',"Errore interno al Sistema. Riprovare"))},error:function(){}}),h})}function InsertNotaBloccoOtp(){if(IsNullOrEmptyString($("#codeOTP").val())||$("#codeOTP").val()=="Codice di Verifica"){VisibilityOn('#ins-otp div[id="redAlert"]',"<b>3 tentativi falliti<\/b><br>Hai superato il numero massimo di tentativi disponibili. Riprova fra 24 ore.");$(".lblOtpMess").hide();return}VisibilityOff('#ins-otp div[id="redAlertRecap"]');var n={recapTel:$("#recapTel").val()},t=JSON.stringify(n),i="/"+currentController+"/InsertNotaBloccoOtp";$.ajax({url:i,type:"POST",data:t,contentType:"application/json",dataType:"json",success:function(n){if(n){var t=$("form").serialize();$.ajax({url:"/AreaRiservata/ActionITuoiDati",type:"POST",data:t,success:function(){var n,t;return $.validator.unobtrusive.addValidation("form"),gestioneButtonActive(),gestioneModificaEliminaDomicilio(),n=$(".error"),n.length>0&&(t=n.offset().top,$(window).scrollTop(t)),stopCustomSpinner(),$("#ins-otp").modal("show"),$('#ins-otp div[id="bodyMail"]').hide(),$('#ins-otp div[id="bodyMailFooter"]').hide(),$('#ins-otp div[id="bodySpinner"]').hide(),$('#ins-otp div[id="bodyFailed"]').hide(),$('#ins-otp div[id="bodyFailedFooter"]').hide(),$("#otp-text-EmailCell").html("Ti richiameremo entro 24 ore al numero che ci hai indicato."),$('#ins-otp div[id="bodyOk"]').show(),$('#ins-otp div[id="bodyOkFooter"]').show(),!1},error:function(){}})}else return VisibilityOn('#ins-otp div[id="redAlert"]',"<b>3 tentativi falliti<\/b><br>Hai superato il numero massimo di tentativi disponibili. Riprova fra 24 ore."),$('#ins-otp div[id="bodySpinner"]').hide(),$(".lblOtpMess").hide(),!1},error:function(){}})}function RenewPSK(){var n="/"+currentController+"/RenewPSK",t=$("form").serialize();$.ajax({url:n,type:"POST",contentType:"application/json",dataType:"json",success:function(n){n.isValid?$.ajax({type:"POST",url:"/AreaRiservata/SendTOtp",data:t,success:function(n){if(n){$('#ins-otp label[id="new_psk"]').html("Codice inviato come richiesto!");var t=n.avoidOtpForTesting;t!=null&&t!=""&&(document.getElementById("codeOTP").value=t)}else $("#ConfermaButton").addClass("disabled"),$('#ins-otp div[id="redAlert"]').html("Utente bloccato. Non è possibile richiedere un nuovo codice!"),showRedAlertMessage('#ins-otp div[id="redAlert"]',"Codice inserito non valido")},error:function(){}}):($("#ConfermaButton").addClass("disabled"),$('#ins-otp label[id="new_psk"]').html("Utente bloccato. Non è possibile richiedere un nuovo codice!"))},error:function(){}})}function compareController(n){for(var t=0;t<controllersSalvaBozza.length;t++)if(controllersSalvaBozza[t]==n)return!0;return!1}function verifyForControllerPolizza(n){for(var t=0;t<controllersPolizza.length;t++)if(controllersSalvaBozza[t]==n)return!0;return!1}function getFlowState(){return typeof currentController!="undefined"?verifyForControllerPolizza(currentController)?ControllerOK&&flagConvenzioneOk&&DocumentReady:ControllerOK&&DocumentReady:!1}function verifySaveInDraftEnabled(){if(getFlowState()&&typeof currentController!="undefined"&&compareController(currentController)){var n={vm:{CodiceConvenzione:$("#CodiceConvenzione").val()},onlyCheck:!0},t=JSON.stringify(n),i="/"+currentController+"/SaveInDraft";$.ajax({url:i,type:"POST",data:t,contentType:"application/json",dataType:"json",success:function(n){n.SaveInDraftEnabled?showField("#buttonSalvaBozza"):hideField("#buttonSalvaBozza")},error:function(){}});flagConvenzioneOk=!1}}function hideField(n){$(n).hasClass("nascosto")||($(n).addClass("nascosto"),$(n).hide())}function showField(n){$(n).hasClass("nascosto")&&($(n).removeClass("nascosto"),$(n).show())}function Enable(n){$(n).hasClass("falseDisabled")&&$(n).hasClass("disabled")&&($(n).removeClass("falseDisabled"),$(n).removeClass("disabled"))}function Disable(n){$(n).hasClass("falseDisabled")||$(n).hasClass("disabled")||($(n).addClass("disabled"),$(n).addClass("falseDisabled"))}function VisibilityOff(n){$(n).hasClass("invisible")||$(n).addClass("invisible")}function VisibilityOn(n,t){$(n).hasClass("invisible")&&$(n).removeClass("invisible");$(n).html(t)}function AddHiddenClass(n){$(n).hasClass("hidden")||$(n).addClass("hidden")}function RemoveHiddenClass(n,t){$(n).hasClass("hidden")&&$(n).removeClass("hidden");$(n).html(t)}function HideErrorField(){AddHiddenClass('#ins-email div[id="redAlert"]')}function showRedAlertMessage(n,t){$(n).removeClass("hidden");$(n).removeClass("invisible");$(n).html(t)}function OnCtrlCreatedHandler(){ControllerOK=!0;ControllerOK2=!0;verifySaveInDraftEnabled()}function OnConvenzioneModified(){flagConvenzioneOk=!0;verifySaveInDraftEnabled()}function setPageTabIndex(){var n=1;$("input,select,text,textarea,radio,checkbox,multiselect,dropdown,button,link,chosen").each(function(){if(this.type!="hidden"){var t=$(this);t.attr("tabindex",n);n++}})}function CheckSalvaBozzaButtonEnabling(){if(DocumentReady&&ControllerOK2&&typeof currentController!="undefined"&&compareController(currentController)){$("input,text,textarea,radio,button").on("blur",function(){Enable("#buttonSalvaBozza")});$("multiselect,dropdown,chosen,select").on("change",function(){Enable("#buttonSalvaBozza")});$(".checkbox").on("ifChanged",function(){Enable("#buttonSalvaBozza")});$(".calendar .input-group.date .input-group-addon>img").datepicker({language:"it",orientation:"top right",multidate:!1,autoclose:!0}).on("changeDate",function(){Enable("#buttonSalvaBozza")});Disable("#buttonSalvaBozza");ControllerOK2=!1;DocumentReady=!1}}function are_cookies_enabled(){var t=typeof navigator!="undefined"&&navigator.cookieEnabled,n;return t?typeof document!="undefined"&&typeof document.cookie!="undefined"&&typeof document.cookie!="null"?document.cookie!=""?!0:(n="test_cookie",createCookie(n,n,2),readCookie(n)!=null?(eraseCookie(n),!0):!1):!1:!1}function createCookie(n,t,i){var u,r;i?(r=new Date,r.setTime(r.getTime()+i*864e5),u="; expires="+r.toGMTString()):u="";document.cookie=encodeURIComponent(n)+"="+encodeURIComponent(t)+u+"; path=/"}function readCookie(n){for(var r=encodeURIComponent(n)+"=",u=document.cookie.split(";"),t,i=0;i<u.length;i++){for(t=u[i];t.charAt(0)===" ";)t=t.substring(1,t.length);if(t.indexOf(r)===0)return decodeURIComponent(t.substring(r.length,t.length))}return null}function eraseCookie(n){createCookie(n,"",-1)}var cl,fl,fadeSpeed,timeDelay,SendToOTP,userOtpBlocked,controllersSalvaBozza,controllersPolizza,Swiper;$(document).ready(function(){var i=$(location).attr("hash"),r,u,f,e;switch(i){case"#notificationVariant":notificationVariant()}var o=$(window).width(),s=$("#responsive-menu-acquista").scrollTop(),n=$("header .container").offset().left,t=parseInt($("header .container").css("padding-left"));$("#responsive-menu-acquista").css("padding-left",t+n);$("#responsive-menu-acquista").css("padding-right",t+n);r=$("header").outerHeight();u=calcCookieHeight();$("#responsive-menu-acquista").css("top","100%");f=$("#bg-gradient").outerHeight();e=$("#sticky-banner").outerHeight();$(window).resize(function(){var u=$(window).width(),f=$("#responsive-menu-acquista").scrollTop(),n=$("header .container").offset().left,t=parseInt($("header .container").css("padding-left")),i,r;$("#responsive-menu-acquista").css("padding-left",t+n);$("#responsive-menu-acquista").css("padding-right",t+n);$("#responsive-menu-acquista").css("left","0px");$("#responsive-menu-acquista").css("left",-1*$("#responsive-menu-acquista").offset().left+"px");var e=$("header .container").outerWidth(),o=$("header").outerHeight(),s=calcCookieHeight();$("#responsive-menu-acquista").css("top","100%");i=$("#bg-gradient").outerHeight();r=$("#sticky-banner").outerHeight()});$(window).scroll(function(){var i=$(window).width();if(i>768){var r=$("#responsive-menu-acquista").scrollTop(),n=$("header .container").offset().left,t=parseInt($("header .container").css("padding-left"));$("#responsive-menu-acquista").css("padding-left",t+n);$("#responsive-menu-acquista").css("padding-right",t+n);var u=$("header").outerHeight(),f=calcCookieHeight(),e=$("#bg-gradient").outerHeight(),o=$("#sticky-banner").outerHeight()}});$("#menu-opener").on("click",function(){$(window).width()>=768?$("#responsive-menu-acquista").css("display")==="none"?($("#responsive-menu-acquista").fadeIn(300),$("#responsive-menu-acquista").css("left","0px"),$("#responsive-menu-acquista").addClass("menu-opened"),$("#menu-opener").addClass("acquista-menu-opened"),$(document).trigger("resize")):$("#responsive-menu-acquista").fadeOut(300,function(){$("#responsive-menu-acquista").removeClass("menu-opened");$("#menu-opener").removeClass("acquista-menu-opened")}):($("#responsive-menu-acquista").slideToggle(300),$("#menu-opener.AR_prodotti").toggleClass("open"))});$("#responsive-menu-acquista .close-button.close-it").on("click",function(){$("#responsive-menu-acquista").fadeOut(400);$("#menu-opener").removeClass("acquista-menu-opened")});$("body").on("DOMNodeInserted",function(n){if($(n.target).is(".popover"))$(".popover .popover-header .mark-all").on("click",function(){$(".popover .glass-panel").removeClass("new");var n=$("header a.pop.pop-bottom").attr("data-content");n=n.replace(/new/g,"");$("header a.pop.pop-bottom").attr("data-content",n)})});$(window).resize(function(){$(window).width()<768?$("#responsive-menu-acquista").hasClass("acquista-menu-opened")&&($("#responsive-menu-acquista").addClass("hidden"),$('header button[data-target=".bs-navbar-collapse"').removeClass("collapsed"),$("header .bs-navbar-collapse").addClass("in"),$('header a[data-target="#menuAcquista"]').removeClass("collapsed"),$("#menuAcquista").addClass("in")):$(window).width()>=768&&$("#menuAcquista").hasClass("in")&&($('header a[data-target="#menuAcquista"]').addClass("collapsed"),$("#menuAcquista").removeClass("in"),$('header button[data-target=".bs-navbar-collapse"').addClass("collapsed"),$("header .bs-navbar-collapse").removeClass("in"),$("#responsive-menu-acquista").css("display","block"),$("#responsive-menu-acquista").removeClass("hidden"))})});+function(n){"use strict";var i='[data-dismiss="alert"]',t=function(t){n(t).on("click",i,this.close)},r;t.prototype.close=function(t){function f(){i.trigger("closed.bs.alert").remove()}var u=n(this),r=u.attr("data-target"),i;(r||(r=u.attr("href"),r=r&&r.replace(/.*(?=#[^\s]*$)/,"")),i=n(r),t&&t.preventDefault(),i.length||(i=u.hasClass("alert")?u:u.parent()),i.trigger(t=n.Event("close.bs.alert")),t.isDefaultPrevented())||(i.removeClass("in"),n.support.transition&&i.hasClass("fade")?i.one(n.support.transition.end,f).emulateTransitionEnd(150):f())};r=n.fn.alert;n.fn.alert=function(i){return this.each(function(){var r=n(this),u=r.data("bs.alert");u||r.data("bs.alert",u=new t(this));typeof i=="string"&&u[i].call(r)})};n.fn.alert.Constructor=t;n.fn.alert.noConflict=function(){return n.fn.alert=r,this};n(document).on("click.bs.alert.data-api",i,t.prototype.close)}(jQuery);+function(n){"use strict";var t=function(i,r){this.$element=n(i);this.options=n.extend({},t.DEFAULTS,r);this.isLoading=!1},i;t.DEFAULTS={loadingText:"loading..."};t.prototype.setState=function(t){var r="disabled",i=this.$element,u=i.is("input")?"val":"html",f=i.data();t+="Text";f.resetText||i.data("resetText",i[u]());i[u](f[t]||this.options[t]);setTimeout(n.proxy(function(){t=="loadingText"?(this.isLoading=!0,i.addClass(r).attr(r,r)):this.isLoading&&(this.isLoading=!1,i.removeClass(r).removeAttr(r))},this),0)};t.prototype.toggle=function(){var t=!0,i=this.$element.closest('[data-toggle="buttons"]'),n;i.length&&(n=this.$element.find("input"),n.prop("type")=="radio"&&(n.prop("checked")&&this.$element.hasClass("active")?t=!1:i.find(".active").removeClass("active")),t&&n.prop("checked",!this.$element.hasClass("active")).trigger("change"));t&&this.$element.toggleClass("active")};i=n.fn.button;n.fn.button=function(i){return this.each(function(){var u=n(this),r=u.data("bs.button"),f=typeof i=="object"&&i;r||u.data("bs.button",r=new t(this,f));i=="toggle"?r.toggle():i&&r.setState(i)})};n.fn.button.Constructor=t;n.fn.button.noConflict=function(){return n.fn.button=i,this};n(document).on("click.bs.button.data-api","[data-toggle^=button]",function(t){var i=n(t.target);i.hasClass("btn")||(i=i.closest(".btn"));i.button("toggle");t.preventDefault()})}(jQuery);+function(n){"use strict";var t=function(t,i){this.$element=n(t);this.$indicators=this.$element.find(".carousel-indicators");this.options=i;this.paused=this.sliding=this.interval=this.$active=this.$items=null;this.options.pause=="hover"&&this.$element.on("mouseenter",n.proxy(this.pause,this)).on("mouseleave",n.proxy(this.cycle,this))},i;t.DEFAULTS={interval:5e3,pause:"hover",wrap:!0};t.prototype.cycle=function(t){return t||(this.paused=!1),this.interval&&clearInterval(this.interval),this.options.interval&&!this.paused&&(this.interval=setInterval(n.proxy(this.next,this),this.options.interval)),this};t.prototype.getActiveIndex=function(){return this.$active=this.$element.find(".item.active"),this.$items=this.$active.parent().children(),this.$items.index(this.$active)};t.prototype.to=function(t){var r=this,i=this.getActiveIndex();if(!(t>this.$items.length-1)&&!(t<0))return this.sliding?this.$element.one("slid.bs.carousel",function(){r.to(t)}):i==t?this.pause().cycle():this.slide(t>i?"next":"prev",n(this.$items[t]))};t.prototype.pause=function(t){return t||(this.paused=!0),this.$element.find(".next, .prev").length&&n.support.transition&&(this.$element.trigger(n.support.transition.end),this.cycle(!0)),this.interval=clearInterval(this.interval),this};t.prototype.next=function(){if(!this.sliding)return this.slide("next")};t.prototype.prev=function(){if(!this.sliding)return this.slide("prev")};t.prototype.slide=function(t,i){var u=this.$element.find(".item.active"),r=i||u[t](),s=this.interval,f=t=="next"?"left":"right",h=t=="next"?"first":"last",e=this,o;if(!r.length){if(!this.options.wrap)return;r=this.$element.find(".item")[h]()}return r.hasClass("active")?this.sliding=!1:(o=n.Event("slide.bs.carousel",{relatedTarget:r[0],direction:f}),this.$element.trigger(o),o.isDefaultPrevented())?void 0:(this.sliding=!0,s&&this.pause(),this.$indicators.length&&(this.$indicators.find(".active").removeClass("active"),this.$element.one("slid.bs.carousel",function(){var t=n(e.$indicators.children()[e.getActiveIndex()]);t&&t.addClass("active")})),n.support.transition&&this.$element.hasClass("slide")?(r.addClass(t),r[0].offsetWidth,u.addClass(f),r.addClass(f),u.one(n.support.transition.end,function(){r.removeClass([t,f].join(" ")).addClass("active");u.removeClass(["active",f].join(" "));e.sliding=!1;setTimeout(function(){e.$element.trigger("slid.bs.carousel")},0)}).emulateTransitionEnd(u.css("transition-duration").slice(0,-1)*1e3)):(u.removeClass("active"),r.addClass("active"),this.sliding=!1,this.$element.trigger("slid.bs.carousel")),s&&this.cycle(),this)};i=n.fn.carousel;n.fn.carousel=function(i){return this.each(function(){var u=n(this),r=u.data("bs.carousel"),f=n.extend({},t.DEFAULTS,u.data(),typeof i=="object"&&i),e=typeof i=="string"?i:f.slide;r||u.data("bs.carousel",r=new t(this,f));typeof i=="number"?r.to(i):e?r[e]():f.interval&&r.pause().cycle()})};n.fn.carousel.Constructor=t;n.fn.carousel.noConflict=function(){return n.fn.carousel=i,this};n(document).on("click.bs.carousel.data-api","[data-slide], [data-slide-to]",function(t){var i=n(this),f,r=n(i.attr("data-target")||(f=i.attr("href"))&&f.replace(/.*(?=#[^\s]+$)/,"")),e=n.extend({},r.data(),i.data()),u=i.attr("data-slide-to");u&&(e.interval=!1);r.carousel(e);(u=i.attr("data-slide-to"))&&r.data("bs.carousel").to(u);t.preventDefault()});n(window).on("load",function(){n('[data-ride="carousel"]').each(function(){var t=n(this);t.carousel(t.data())})})}(jQuery);+function(n){function r(t){n(e).remove();n(i).each(function(){var i=u(n(this)),r={relatedTarget:this};i.hasClass("open")&&((i.trigger(t=n.Event("hide.bs.dropdown",r)),t.isDefaultPrevented())||i.removeClass("open").trigger("hidden.bs.dropdown",r))})}function u(t){var i=t.attr("data-target"),r;return i||(i=t.attr("href"),i=i&&/#[A-Za-z]/.test(i)&&i.replace(/.*(?=#[^\s]*$)/,"")),r=i&&n(i),r&&r.length?r:t.parent()}var f;"use strict";var e=".dropdown-backdrop",i="[data-toggle=dropdown]",t=function(t){n(t).on("click.bs.dropdown",this.toggle)};t.prototype.toggle=function(t){var f=n(this),i,o,e;if(!f.is(".disabled, :disabled")){if(i=u(f),o=i.hasClass("open"),r(),!o){if("ontouchstart"in document.documentElement&&!i.closest(".navbar-nav").length&&n('<div class="dropdown-backdrop"/>').insertAfter(n(this)).on("click",r),e={relatedTarget:this},i.trigger(t=n.Event("show.bs.dropdown",e)),t.isDefaultPrevented())return;i.toggleClass("open").trigger("shown.bs.dropdown",e);f.focus()}return!1}};t.prototype.keydown=function(t){var e,o,s,h,f,r;if(/(38|40|27)/.test(t.keyCode)&&(e=n(this),t.preventDefault(),t.stopPropagation(),!e.is(".disabled, :disabled"))){if(o=u(e),s=o.hasClass("open"),!s||s&&t.keyCode==27)return t.which==27&&o.find(i).focus(),e.click();(h=" li:not(.divider):visible a",f=o.find("[role=menu]"+h+", [role=listbox]"+h),f.length)&&(r=f.index(f.filter(":focus")),t.keyCode==38&&r>0&&r--,t.keyCode==40&&r<f.length-1&&r++,~r||(r=0),f.eq(r).focus())}};f=n.fn.dropdown;n.fn.dropdown=function(i){return this.each(function(){var r=n(this),u=r.data("bs.dropdown");u||r.data("bs.dropdown",u=new t(this));typeof i=="string"&&u[i].call(r)})};n.fn.dropdown.Constructor=t;n.fn.dropdown.noConflict=function(){return n.fn.dropdown=f,this};n(document).on("click.bs.dropdown.data-api",r).on("click.bs.dropdown.data-api",".dropdown form",function(n){n.stopPropagation()}).on("click.bs.dropdown.data-api",i,t.prototype.toggle).on("keydown.bs.dropdown.data-api",i+", [role=menu], [role=listbox]",t.prototype.keydown)}(jQuery);+function(n){"use strict";var t=function(t,i){this.options=i;this.$element=n(t);this.$backdrop=this.isShown=null;this.options.remote&&this.$element.find(".modal-content").load(this.options.remote,n.proxy(function(){this.$element.trigger("loaded.bs.modal")},this))},i;t.DEFAULTS={backdrop:!0,keyboard:!0,show:!0};t.prototype.toggle=function(n){return this[this.isShown?"hide":"show"](n)};t.prototype.show=function(t){var i=this,r=n.Event("show.bs.modal",{relatedTarget:t});(this.$element.trigger(r),this.isShown||r.isDefaultPrevented())||(this.isShown=!0,this.escape(),this.$element.on("click.dismiss.bs.modal",'[data-dismiss="modal"]',n.proxy(this.hide,this)),this.backdrop(function(){var u=n.support.transition&&i.$element.hasClass("fade"),r;i.$element.parent().length||i.$element.appendTo(document.body);i.$element.show().scrollTop(0);u&&i.$element[0].offsetWidth;i.$element.addClass("in").attr("aria-hidden",!1);i.enforceFocus();r=n.Event("shown.bs.modal",{relatedTarget:t});u?i.$element.find(".modal-dialog").one(n.support.transition.end,function(){i.$element.focus().trigger(r)}).emulateTransitionEnd(300):i.$element.focus().trigger(r)}))};t.prototype.hide=function(t){(t&&t.preventDefault(),t=n.Event("hide.bs.modal"),this.$element.trigger(t),this.isShown&&!t.isDefaultPrevented())&&(this.isShown=!1,this.escape(),n(document).off("focusin.bs.modal"),this.$element.removeClass("in").attr("aria-hidden",!0).off("click.dismiss.bs.modal"),n.support.transition&&this.$element.hasClass("fade")?this.$element.one(n.support.transition.end,n.proxy(this.hideModal,this)).emulateTransitionEnd(300):this.hideModal())};t.prototype.enforceFocus=function(){n(document).off("focusin.bs.modal").on("focusin.bs.modal",n.proxy(function(n){this.$element[0]===n.target||this.$element.has(n.target).length||this.$element.focus()},this))};t.prototype.escape=function(){this.isShown&&this.options.keyboard?this.$element.on("keyup.dismiss.bs.modal",n.proxy(function(n){n.which==27&&this.hide()},this)):this.isShown||this.$element.off("keyup.dismiss.bs.modal")};t.prototype.hideModal=function(){var n=this;this.$element.hide();this.backdrop(function(){n.removeBackdrop();n.$element.trigger("hidden.bs.modal")})};t.prototype.removeBackdrop=function(){this.$backdrop&&this.$backdrop.remove();this.$backdrop=null};t.prototype.backdrop=function(t){var r=this.$element.hasClass("fade")?"fade":"",i;if(this.isShown&&this.options.backdrop){if(i=n.support.transition&&r,this.$backdrop=n('<div class="modal-backdrop '+r+'" />').appendTo(document.body),this.$element.on("click.dismiss.bs.modal",n.proxy(function(n){n.target===n.currentTarget&&(this.options.backdrop=="static"?this.$element[0].focus.call(this.$element[0]):this.hide.call(this))},this)),i&&this.$backdrop[0].offsetWidth,this.$backdrop.addClass("in"),!t)return;i?this.$backdrop.one(n.support.transition.end,t).emulateTransitionEnd(150):t()}else!this.isShown&&this.$backdrop?(this.$backdrop.removeClass("in"),n.support.transition&&this.$element.hasClass("fade")?this.$backdrop.one(n.support.transition.end,t).emulateTransitionEnd(150):t()):t&&t()};i=n.fn.modal;n.fn.modal=function(i,r){return this.each(function(){var f=n(this),u=f.data("bs.modal"),e=n.extend({},t.DEFAULTS,f.data(),typeof i=="object"&&i);u||f.data("bs.modal",u=new t(this,e));typeof i=="string"?u[i](r):e.show&&u.show(r)})};n.fn.modal.Constructor=t;n.fn.modal.noConflict=function(){return n.fn.modal=i,this};n(document).on("click.bs.modal.data-api",'[data-toggle="modal"]',function(t){var i=n(this),r=i.attr("href"),u=n(i.attr("data-target")||r&&r.replace(/.*(?=#[^\s]+$)/,"")),f=u.data("bs.modal")?"toggle":n.extend({remote:!/#/.test(r)&&r},u.data(),i.data());i.is("a")&&t.preventDefault();u.modal(f,this).one("hide",function(){i.is(":visible")&&i.focus()})});n(document).on("show.bs.modal",".modal",function(){n(document.body).addClass("modal-open")}).on("hidden.bs.modal",".modal",function(){n(document.body).removeClass("modal-open")})}(jQuery);+function(n){"use strict";var t=function(n,t){this.type=this.options=this.enabled=this.timeout=this.hoverState=this.$element=null;this.init("tooltip",n,t)},i;t.DEFAULTS={animation:!0,placement:"top",selector:!1,template:'<div class="tooltip"><div class="tooltip-arrow"><\/div><div class="tooltip-inner"><\/div><\/div>',trigger:"hover focus",title:"",delay:0,html:!1,container:!1};t.prototype.init=function(t,i,r){var f,e,u,o,s;for(this.enabled=!0,this.type=t,this.$element=n(i),this.options=this.getOptions(r),f=this.options.trigger.split(" "),e=f.length;e--;)if(u=f[e],u=="click")this.$element.on("click."+this.type,this.options.selector,n.proxy(this.toggle,this));else u!="manual"&&(o=u=="hover"?"mouseenter":"focusin",s=u=="hover"?"mouseleave":"focusout",this.$element.on(o+"."+this.type,this.options.selector,n.proxy(this.enter,this)),this.$element.on(s+"."+this.type,this.options.selector,n.proxy(this.leave,this)));this.options.selector?this._options=n.extend({},this.options,{trigger:"manual",selector:""}):this.fixTitle()};t.prototype.getDefaults=function(){return t.DEFAULTS};t.prototype.getOptions=function(t){return t=n.extend({},this.getDefaults(),this.$element.data(),t),t.delay&&typeof t.delay=="number"&&(t.delay={show:t.delay,hide:t.delay}),t};t.prototype.getDelegateOptions=function(){var t={},i=this.getDefaults();return this._options&&n.each(this._options,function(n,r){i[n]!=r&&(t[n]=r)}),t};t.prototype.enter=function(t){var i=t instanceof this.constructor?t:n(t.currentTarget)[this.type](this.getDelegateOptions()).data("bs."+this.type);if(clearTimeout(i.timeout),i.hoverState="in",!i.options.delay||!i.options.delay.show)return i.show();i.timeout=setTimeout(function(){i.hoverState=="in"&&i.show()},i.options.delay.show)};t.prototype.leave=function(t){var i=t instanceof this.constructor?t:n(t.currentTarget)[this.type](this.getDelegateOptions()).data("bs."+this.type);if(clearTimeout(i.timeout),i.hoverState="out",!i.options.delay||!i.options.delay.hide)return i.hide();i.timeout=setTimeout(function(){i.hoverState=="out"&&i.hide()},i.options.delay.hide)};t.prototype.show=function(){var h=n.Event("show.bs."+this.type),u,i,v,s;if(this.hasContent()&&this.enabled){if(this.$element.trigger(h),h.isDefaultPrevented())return;u=this;i=this.tip();this.setContent();this.options.animation&&i.addClass("fade");var t=typeof this.options.placement=="function"?this.options.placement.call(this,i[0],this.$element[0]):this.options.placement,c=/\s?auto?\s?/i,l=c.test(t);l&&(t=t.replace(c,"")||"top");i.detach().css({top:0,left:0,display:"block"}).addClass(t);this.options.container?i.appendTo(this.options.container):i.insertAfter(this.$element);var r=this.getPosition(),f=i[0].offsetWidth,e=i[0].offsetHeight;if(l){var o=this.$element.parent(),y=t,a=document.documentElement.scrollTop||document.body.scrollTop,p=this.options.container=="body"?window.innerWidth:o.outerWidth(),w=this.options.container=="body"?window.innerHeight:o.outerHeight(),b=this.options.container=="body"?0:o.offset().left;t=t=="bottom"&&r.top+r.height+e-a>w?"top":t=="top"&&r.top-a-e<0?"bottom":t=="right"&&r.right+f>p?"left":t=="left"&&r.left-f<b?"right":t;i.removeClass(y).addClass(t)}v=this.getCalculatedOffset(t,r,f,e);this.applyPlacement(v,t);this.hoverState=null;s=function(){u.$element.trigger("shown.bs."+u.type)};n.support.transition&&this.$tip.hasClass("fade")?i.one(n.support.transition.end,s).emulateTransitionEnd(150):s()}};t.prototype.applyPlacement=function(t,i){var c,r=this.tip(),l=r[0].offsetWidth,e=r[0].offsetHeight,o=parseInt(r.css("margin-top"),10),s=parseInt(r.css("margin-left"),10),f,u,h;isNaN(o)&&(o=0);isNaN(s)&&(s=0);t.top=t.top+o;t.left=t.left+s;n.offset.setOffset(r[0],n.extend({using:function(n){r.css({top:Math.round(n.top),left:Math.round(n.left)})}},t),0);r.addClass("in");f=r[0].offsetWidth;u=r[0].offsetHeight;i=="top"&&u!=e&&(c=!0,t.top=t.top+e-u);/bottom|top/.test(i)?(h=0,t.left<0&&(h=t.left*-2,t.left=0,r.offset(t),f=r[0].offsetWidth,u=r[0].offsetHeight),this.replaceArrow(h-l+f,f,"left")):this.replaceArrow(u-e,u,"top");c&&r.offset(t)};t.prototype.replaceArrow=function(n,t,i){this.arrow().css(i,n?50*(1-n/t)+"%":"")};t.prototype.setContent=function(){var n=this.tip(),t=this.getTitle();n.find(".tooltip-inner")[this.options.html?"html":"text"](t);n.removeClass("fade in top bottom left right")};t.prototype.hide=function(){function r(){t.hoverState!="in"&&i.detach();t.$element.trigger("hidden.bs."+t.type)}var t=this,i=this.tip(),u=n.Event("hide.bs."+this.type);if(this.$element.trigger(u),!u.isDefaultPrevented())return i.removeClass("in"),n.support.transition&&this.$tip.hasClass("fade")?i.one(n.support.transition.end,r).emulateTransitionEnd(150):r(),this.hoverState=null,this};t.prototype.fixTitle=function(){var n=this.$element;(n.attr("title")||typeof n.attr("data-original-title")!="string")&&n.attr("data-original-title",n.attr("title")||"").attr("title","")};t.prototype.hasContent=function(){return this.getTitle()};t.prototype.getPosition=function(){var t=this.$element[0];return n.extend({},typeof t.getBoundingClientRect=="function"?t.getBoundingClientRect():{width:t.offsetWidth,height:t.offsetHeight},this.$element.offset())};t.prototype.getCalculatedOffset=function(n,t,i,r){return n=="bottom"?{top:t.top+t.height,left:t.left+t.width/2-i/2}:n=="top"?{top:t.top-r,left:t.left+t.width/2-i/2}:n=="left"?{top:t.top+t.height/2-r/2,left:t.left-i}:{top:t.top+t.height/2-r/2,left:t.left+t.width}};t.prototype.getTitle=function(){var t,i=this.$element,n=this.options;return t=i.attr("data-original-title")||(typeof n.title=="function"?n.title.call(i[0]):n.title),t};t.prototype.tip=function(){return this.$tip=this.$tip||n(this.options.template)};t.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".tooltip-arrow")};t.prototype.validate=function(){this.$element[0].parentNode||(this.hide(),this.$element=null,this.options=null)};t.prototype.enable=function(){this.enabled=!0};t.prototype.disable=function(){this.enabled=!1};t.prototype.toggleEnabled=function(){this.enabled=!this.enabled};t.prototype.toggle=function(t){var i=t?n(t.currentTarget)[this.type](this.getDelegateOptions()).data("bs."+this.type):this;i.tip().hasClass("in")?i.leave(i):i.enter(i)};t.prototype.destroy=function(){clearTimeout(this.timeout);this.hide().$element.off("."+this.type).removeData("bs."+this.type)};i=n.fn.tooltip;n.fn.tooltip=function(i){return this.each(function(){var u=n(this),r=u.data("bs.tooltip"),f=typeof i=="object"&&i;(r||i!="destroy")&&(r||u.data("bs.tooltip",r=new t(this,f)),typeof i=="string"&&r[i]())})};n.fn.tooltip.Constructor=t;n.fn.tooltip.noConflict=function(){return n.fn.tooltip=i,this}}(jQuery);+function(n){"use strict";var t=function(n,t){this.init("popover",n,t)},i;if(!n.fn.tooltip)throw new Error("Popover requires tooltip.js");t.DEFAULTS=n.extend({},n.fn.tooltip.Constructor.DEFAULTS,{placement:"right",trigger:"click",content:"",template:'<div class="popover"><div class="arrow"><\/div><h3 class="popover-title"><\/h3><div class="popover-content"><\/div><\/div>'});t.prototype=n.extend({},n.fn.tooltip.Constructor.prototype);t.prototype.constructor=t;t.prototype.getDefaults=function(){return t.DEFAULTS};t.prototype.setContent=function(){var n=this.tip(),i=this.getTitle(),t=this.getContent();n.find(".popover-title")[this.options.html?"html":"text"](i);n.find(".popover-content")[this.options.html?typeof t=="string"?"html":"append":"text"](t);n.removeClass("fade top bottom left right in");n.find(".popover-title").html()||n.find(".popover-title").hide()};t.prototype.hasContent=function(){return this.getTitle()||this.getContent()};t.prototype.getContent=function(){var t=this.$element,n=this.options;return t.attr("data-content")||(typeof n.content=="function"?n.content.call(t[0]):n.content)};t.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".arrow")};t.prototype.tip=function(){return this.$tip||(this.$tip=n(this.options.template)),this.$tip};i=n.fn.popover;n.fn.popover=function(i){return this.each(function(){var u=n(this),r=u.data("bs.popover"),f=typeof i=="object"&&i;(r||i!="destroy")&&(r||u.data("bs.popover",r=new t(this,f)),typeof i=="string"&&r[i]())})};n.fn.popover.Constructor=t;n.fn.popover.noConflict=function(){return n.fn.popover=i,this}}(jQuery);+function(n){"use strict";var t=function(t){this.element=n(t)},i;t.prototype.show=function(){var t=this.element,e=t.closest("ul:not(.dropdown-menu)"),i=t.data("target"),r,u,f;(i||(i=t.attr("href"),i=i&&i.replace(/.*(?=#[^\s]*$)/,"")),t.parent("li").hasClass("active"))||(r=e.find(".active:last a")[0],u=n.Event("show.bs.tab",{relatedTarget:r}),t.trigger(u),u.isDefaultPrevented())||(f=n(i),this.activate(t.parent("li"),e),this.activate(f,f.parent(),function(){t.trigger({type:"shown.bs.tab",relatedTarget:r})}))};t.prototype.activate=function(t,i,r){function f(){u.removeClass("active").find("> .dropdown-menu > .active").removeClass("active");t.addClass("active");e?(t[0].offsetWidth,t.addClass("in")):t.removeClass("fade");t.parent(".dropdown-menu")&&t.closest("li.dropdown").addClass("active");r&&r()}var u=i.find("> .active"),e=r&&n.support.transition&&u.hasClass("fade");e?u.one(n.support.transition.end,f).emulateTransitionEnd(150):f();u.removeClass("in")};i=n.fn.tab;n.fn.tab=function(i){return this.each(function(){var u=n(this),r=u.data("bs.tab");r||u.data("bs.tab",r=new t(this));typeof i=="string"&&r[i]()})};n.fn.tab.Constructor=t;n.fn.tab.noConflict=function(){return n.fn.tab=i,this};n(document).on("click.bs.tab.data-api",'[data-toggle="tab"], [data-toggle="pill"]',function(t){t.preventDefault();n(this).tab("show")})}(jQuery);+function(n){"use strict";var t=function(i,r){this.options=n.extend({},t.DEFAULTS,r);this.$window=n(window).on("scroll.bs.affix.data-api",n.proxy(this.checkPosition,this)).on("click.bs.affix.data-api",n.proxy(this.checkPositionWithEventLoop,this));this.$element=n(i);this.affixed=this.unpin=this.pinnedOffset=null;this.checkPosition()},i;t.RESET="affix affix-top affix-bottom";t.DEFAULTS={offset:0};t.prototype.getPinnedOffset=function(){if(this.pinnedOffset)return this.pinnedOffset;this.$element.removeClass(t.RESET).addClass("affix");var n=this.$window.scrollTop(),i=this.$element.offset();return this.pinnedOffset=i.top-n};t.prototype.checkPositionWithEventLoop=function(){setTimeout(n.proxy(this.checkPosition,this),1)};t.prototype.checkPosition=function(){var i,e,h;if(this.$element.is(":visible")){var c=n(document).height(),o=this.$window.scrollTop(),s=this.$element.offset(),r=this.options.offset,f=r.top,u=r.bottom;(this.affixed=="top"&&(s.top+=o),typeof r!="object"&&(u=f=r),typeof f=="function"&&(f=r.top(this.$element)),typeof u=="function"&&(u=r.bottom(this.$element)),i=this.unpin!=null&&o+this.unpin<=s.top?!1:u!=null&&s.top+this.$element.height()>=c-u?"bottom":f!=null&&o<=f?"top":!1,this.affixed!==i)&&((this.unpin&&this.$element.css("top",""),e="affix"+(i?"-"+i:""),h=n.Event(e+".bs.affix"),this.$element.trigger(h),h.isDefaultPrevented())||(this.affixed=i,this.unpin=i=="bottom"?this.getPinnedOffset():null,this.$element.removeClass(t.RESET).addClass(e).trigger(n.Event(e.replace("affix","affixed"))),i=="bottom"&&this.$element.offset({top:c-u-this.$element.height()})))}};i=n.fn.affix;n.fn.affix=function(i){return this.each(function(){var u=n(this),r=u.data("bs.affix"),f=typeof i=="object"&&i;r||u.data("bs.affix",r=new t(this,f));typeof i=="string"&&r[i]()})};n.fn.affix.Constructor=t;n.fn.affix.noConflict=function(){return n.fn.affix=i,this};n(window).on("load",function(){n('[data-spy="affix"]').each(function(){var i=n(this),t=i.data();t.offset=t.offset||{};t.offsetBottom&&(t.offset.bottom=t.offsetBottom);t.offsetTop&&(t.offset.top=t.offsetTop);i.affix(t)})})}(jQuery);+function(n){"use strict";var t=function(i,r){this.$element=n(i);this.options=n.extend({},t.DEFAULTS,r);this.transitioning=null;this.options.parent&&(this.$parent=n(this.options.parent));this.options.toggle&&this.toggle()},i;t.DEFAULTS={toggle:!0};t.prototype.dimension=function(){var n=this.$element.hasClass("width");return n?"width":"height"};t.prototype.show=function(){var u,t,r,i,f,e;if(!this.transitioning&&!this.$element.hasClass("in")&&(u=n.Event("show.bs.collapse"),this.$element.trigger(u),!u.isDefaultPrevented())){if(t=this.$parent&&this.$parent.find("> .panel > .in"),t&&t.length){if(r=t.data("bs.collapse"),r&&r.transitioning)return;t.collapse("hide");r||t.data("bs.collapse",null)}if(i=this.dimension(),this.$element.removeClass("collapse").addClass("collapsing")[i](0),this.transitioning=1,f=function(){this.$element.removeClass("collapsing").addClass("collapse in")[i]("auto");this.transitioning=0;this.$element.trigger("shown.bs.collapse")},!n.support.transition)return f.call(this);e=n.camelCase(["scroll",i].join("-"));this.$element.one(n.support.transition.end,n.proxy(f,this)).emulateTransitionEnd(350)[i](this.$element[0][e])}};t.prototype.hide=function(){var i,t,r;if(!this.transitioning&&this.$element.hasClass("in")&&(i=n.Event("hide.bs.collapse"),this.$element.trigger(i),!i.isDefaultPrevented())){if(t=this.dimension(),this.$element[t](this.$element[t]())[0].offsetHeight,this.$element.addClass("collapsing").removeClass("collapse").removeClass("in"),this.transitioning=1,r=function(){this.transitioning=0;this.$element.trigger("hidden.bs.collapse").removeClass("collapsing").addClass("collapse")},!n.support.transition)return r.call(this);this.$element[t](0).one(n.support.transition.end,n.proxy(r,this)).emulateTransitionEnd(350)}};t.prototype.toggle=function(){this[this.$element.hasClass("in")?"hide":"show"]()};i=n.fn.collapse;n.fn.collapse=function(i){return this.each(function(){var u=n(this),r=u.data("bs.collapse"),f=n.extend({},t.DEFAULTS,u.data(),typeof i=="object"&&i);!r&&f.toggle&&i=="show"&&(i=!i);r||u.data("bs.collapse",r=new t(this,f));typeof i=="string"&&r[i]()})};n.fn.collapse.Constructor=t;n.fn.collapse.noConflict=function(){return n.fn.collapse=i,this};n(document).on("click.bs.collapse.data-api","[data-toggle=collapse]",function(t){var i=n(this),e,s=i.attr("data-target")||t.preventDefault()||(e=i.attr("href"))&&e.replace(/.*(?=#[^\s]+$)/,""),r=n(s),u=r.data("bs.collapse"),h=u?"toggle":i.data(),f=i.attr("data-parent"),o=f&&n(f);u&&u.transitioning||(o&&o.find('[data-toggle=collapse][data-parent="'+f+'"]').not(i).addClass("collapsed"),i[r.hasClass("in")?"addClass":"removeClass"]("collapsed"));r.collapse(h)})}(jQuery);+function(n){function t(i,r){var u,f=n.proxy(this.process,this);this.$element=n(i).is("body")?n(window):n(i);this.$body=n("body");this.$scrollElement=this.$element.on("scroll.bs.scroll-spy.data-api",f);this.options=n.extend({},t.DEFAULTS,r);this.selector=(this.options.target||(u=n(i).attr("href"))&&u.replace(/.*(?=#[^\s]+$)/,"")||"")+" .nav li > a";this.offsets=n([]);this.targets=n([]);this.activeTarget=null;this.refresh();this.process()}t.DEFAULTS={offset:10};t.prototype.refresh=function(){var i=this.$element[0]==window?"offset":"position",t,r;this.offsets=n([]);this.targets=n([]);t=this;r=this.$body.find(this.selector).map(function(){var f=n(this),u=f.data("target")||f.attr("href"),r=/^#./.test(u)&&n(u);return r&&r.length&&r.is(":visible")&&[[r[i]().top+(!n.isWindow(t.$scrollElement.get(0))&&t.$scrollElement.scrollTop()),u]]||null}).sort(function(n,t){return n[0]-t[0]}).each(function(){t.offsets.push(this[0]);t.targets.push(this[1])})};t.prototype.process=function(){var i=this.$scrollElement.scrollTop()+this.options.offset,f=this.$scrollElement[0].scrollHeight||this.$body[0].scrollHeight,e=f-this.$scrollElement.height(),t=this.offsets,r=this.targets,u=this.activeTarget,n;if(i>=e)return u!=(n=r.last()[0])&&this.activate(n);if(u&&i<=t[0])return u!=(n=r[0])&&this.activate(n);for(n=t.length;n--;)u!=r[n]&&i>=t[n]&&(!t[n+1]||i<=t[n+1])&&this.activate(r[n])};t.prototype.activate=function(t){this.activeTarget=t;n(this.selector).parentsUntil(this.options.target,".active").removeClass("active");var r=this.selector+'[data-target="'+t+'"],'+this.selector+'[href="'+t+'"]',i=n(r).parents("li").addClass("active");i.parent(".dropdown-menu").length&&(i=i.closest("li.dropdown").addClass("active"));i.trigger("activate.bs.scrollspy")};var i=n.fn.scrollspy;n.fn.scrollspy=function(i){return this.each(function(){var u=n(this),r=u.data("bs.scrollspy"),f=typeof i=="object"&&i;r||u.data("bs.scrollspy",r=new t(this,f));typeof i=="string"&&r[i]()})};n.fn.scrollspy.Constructor=t;n.fn.scrollspy.noConflict=function(){return n.fn.scrollspy=i,this};n(window).on("load",function(){n('[data-spy="scroll"]').each(function(){var t=n(this);t.scrollspy(t.data())})})}(jQuery);+function(n){function t(){var i=document.createElement("bootstrap"),t={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"},n;for(n in t)if(i.style[n]!==undefined)return{end:t[n]};return!1}n.fn.emulateTransitionEnd=function(t){var i=!1,u=this,r;n(this).one(n.support.transition.end,function(){i=!0});return r=function(){i||n(u).trigger(n.support.transition.end)},setTimeout(r,t),this};n(function(){n.support.transition=t()})}(jQuery),function(n){"use strict";var o=function(n,t){typeof t=="undefined"&&(t={});this.init(n,t)},t=o.prototype,f,e=["canvas","vml"],i=["oval","spiral","square","rect","roundRect"],v=/^\#([a-fA-F0-9]{6}|[a-fA-F0-9]{3})$/,c=navigator.appVersion.indexOf("MSIE")!==-1&&parseFloat(navigator.appVersion.split("MSIE")[1])===8?!0:!1,y=!!document.createElement("canvas").getContext,l=40,a=!0,u=function(n,t,i){var r=document.createElement(n),u;for(u in i)r[u]=i[u];return typeof t!="undefined"&&t.appendChild(r),r},r=function(n,t){for(var i in t)n.style[i]=t[i];return n},s=function(n,t){for(var i in t)n.setAttribute(i,t[i]);return n},h=function(n,t,i,r){n.save();n.translate(t,i);n.rotate(r);n.translate(-t,-i);n.beginPath()};t.init=function(n,t){var s,i;typeof t.safeVML=="boolean"&&(a=t.safeVML);try{this.mum=document.getElementById(n)!==undefined?document.getElementById(n):document.body}catch(h){this.mum=document.body}if(t.id=typeof t.id!="undefined"?t.id:"canvasLoader",this.cont=u("div",this.mum,{id:t.id}),y)f=e[0],this.can=u("canvas",this.cont),this.con=this.can.getContext("2d"),this.cCan=r(u("canvas",this.cont),{display:"none"}),this.cCon=this.cCan.getContext("2d");else{if(f=e[1],typeof o.vmlSheet=="undefined")for(document.getElementsByTagName("head")[0].appendChild(u("style")),o.vmlSheet=document.styleSheets[document.styleSheets.length-1],s=["group","oval","roundrect","fill"],i=0;i<s.length;++i)o.vmlSheet.addRule(s[i],"behavior:url(#default#VML); position:absolute;");this.vml=u("group",this.cont)}this.setColor(this.color);this.draw();r(this.cont,{display:"none"})};t.cont={};t.can={};t.con={};t.cCan={};t.cCon={};t.timer={};t.activeId=0;t.diameter=40;t.setDiameter=function(n){this.diameter=Math.round(Math.abs(n));this.redraw()};t.getDiameter=function(){return this.diameter};t.cRGB={};t.color="#000000";t.setColor=function(n){this.color=v.test(n)?n:"#000000";this.cRGB=this.getRGB(this.color);this.redraw()};t.getColor=function(){return this.color};t.shape=i[0];t.setShape=function(n){var t;for(t in i)if(n===i[t]){this.shape=n;this.redraw();break}};t.getShape=function(){return this.shape};t.density=40;t.setDensity=function(n){this.density=a&&f===e[1]?Math.round(Math.abs(n))<=l?Math.round(Math.abs(n)):l:Math.round(Math.abs(n));this.density>360&&(this.density=360);this.activeId=0;this.redraw()};t.getDensity=function(){return this.density};t.range=1.3;t.setRange=function(n){this.range=Math.abs(n);this.redraw()};t.getRange=function(){return this.range};t.speed=2;t.setSpeed=function(n){this.speed=Math.round(Math.abs(n))};t.getSpeed=function(){return this.speed};t.fps=24;t.setFPS=function(n){this.fps=Math.round(Math.abs(n));this.reset()};t.getFPS=function(){return this.fps};t.getRGB=function(n){return n=n.charAt(0)==="#"?n.substring(1,7):n,{r:parseInt(n.substring(0,2),16),g:parseInt(n.substring(2,4),16),b:parseInt(n.substring(4,6),16)}};t.draw=function(){var w=0,a,p,n,o,l,tt,d,b,nt=this.density,it=Math.round(nt*this.range),k,rt=0,ft,et,ut,st,y=1e3,ot=0,v=this.cCon,t=this.diameter,g=.47;if(f===e[0])for(v.clearRect(0,0,y,y),s(this.can,{width:t,height:t}),s(this.cCan,{width:t,height:t});w<nt;){k=w<=it?1-(1-rt)/it*w:k=rt;tt=270-360/nt*w;d=tt/180*Math.PI;v.fillStyle="rgba("+this.cRGB.r+","+this.cRGB.g+","+this.cRGB.b+","+k.toString()+")";switch(this.shape){case i[0]:case i[1]:a=t*.07;o=t*g+Math.cos(d)*(t*g-a)-t*g;l=t*g+Math.sin(d)*(t*g-a)-t*g;v.beginPath();this.shape===i[1]?v.arc(t*.5+o,t*.5+l,a*k,0,Math.PI*2,!1):v.arc(t*.5+o,t*.5+l,a,0,Math.PI*2,!1);break;case i[2]:a=t*.12;o=Math.cos(d)*(t*g-a)+t*.5;l=Math.sin(d)*(t*g-a)+t*.5;h(v,o,l,d);v.fillRect(o,l-a*.5,a,a);break;case i[3]:case i[4]:p=t*.3;n=p*.27;o=Math.cos(d)*(n+(t-n)*.13)+t*.5;l=Math.sin(d)*(n+(t-n)*.13)+t*.5;h(v,o,l,d);this.shape===i[3]?v.fillRect(o,l-n*.5,p,n):(b=n*.55,v.moveTo(o+b,l-n*.5),v.lineTo(o+p-b,l-n*.5),v.quadraticCurveTo(o+p,l-n*.5,o+p,l-n*.5+b),v.lineTo(o+p,l-n*.5+n-b),v.quadraticCurveTo(o+p,l-n*.5+n,o+p-b,l-n*.5+n),v.lineTo(o+b,l-n*.5+n),v.quadraticCurveTo(o,l-n*.5+n,o,l-n*.5+n-b),v.lineTo(o,l-n*.5+b),v.quadraticCurveTo(o,l-n*.5,o+b,l-n*.5))}v.closePath();v.fill();v.restore();++w}else{r(this.cont,{width:t,height:t});r(this.vml,{width:t,height:t});switch(this.shape){case i[0]:case i[1]:ut="oval";a=y*.14;break;case i[2]:ut="roundrect";a=y*.12;break;case i[3]:case i[4]:ut="roundrect";a=y*.3}for(p=n=a,o=y*.5-n,l=-n*.5;w<nt;){k=w<=it?1-(1-rt)/it*w:k=rt;tt=270-360/nt*w;switch(this.shape){case i[1]:p=n=a*k;o=y*.5-a*.5-a*k*.5;l=(a-a*k)*.5;break;case i[0]:case i[2]:c&&(l=0,this.shape===i[2]&&(o=y*.5-n*.5));break;case i[3]:case i[4]:p=a*.95;n=p*.28;c?(o=0,l=y*.5-n*.5):(o=y*.5-p,l=-n*.5);ot=this.shape===i[4]?.6:0}et=s(r(u("group",this.vml),{width:y,height:y,rotation:tt}),{coordsize:y+","+y,coordorigin:-y*.5+","+-y*.5});ft=r(u(ut,et,{stroked:!1,arcSize:ot}),{width:p,height:n,top:l,left:o});st=u("fill",ft,{color:this.color,opacity:k});++w}}this.tick(!0)};t.clean=function(){if(f===e[0])this.con.clearRect(0,0,1e3,1e3);else{var n=this.vml;if(n.hasChildNodes())while(n.childNodes.length>=1)n.removeChild(n.firstChild)}};t.redraw=function(){this.clean();this.draw()};t.reset=function(){typeof this.timer=="number"&&(this.hide(),this.show())};t.tick=function(n){var i=this.con,t=this.diameter;n||(this.activeId+=360/this.density*this.speed);f===e[0]?(i.clearRect(0,0,t,t),h(i,t*.5,t*.5,this.activeId/180*Math.PI),i.drawImage(this.cCan,0,0,t,t),i.restore()):(this.activeId>=360&&(this.activeId-=360),r(this.vml,{rotation:this.activeId}))};t.show=function(){if(typeof this.timer!="number"){var n=this;this.timer=self.setInterval(function(){n.tick()},Math.round(1e3/this.fps));r(this.cont,{display:"block"})}};t.hide=function(){typeof this.timer=="number"&&(clearInterval(this.timer),delete this.timer,r(this.cont,{display:"none"}))};t.kill=function(){var n=this.cont,t;typeof this.timer=="number"&&this.hide();f===e[0]?(n.removeChild(this.can),n.removeChild(this.cCan)):n.removeChild(this.vml);for(t in this)delete this[t]};n.CanvasLoader=o}(window),function(n){var t=this.SelectBox=function(n,t){if(n instanceof jQuery)if(n.length>0)n=n[0];else return;if((this.typeTimer=null,this.typeSearch="",this.isMac=navigator.platform.match(/mac/i),t="object"==typeof t?t:{},this.selectElement=n,!t.mobile&&navigator.userAgent.match(/iPad|iPhone|Android|IEMobile|BlackBerry/i))||"select"!==n.tagName.toLowerCase())return!1;this.init(t)};t.prototype.version="1.2.0";t.prototype.init=function(t){var r=n(this.selectElement),s,e,h,f,o,c;if(r.data("selectBox-control"))return!1;var i=n('<a class="selectBox" />'),l=r.attr("multiple")||parseInt(r.attr("size"))>1,a=t||{},v=parseInt(r.prop("tabindex"))||0,u=this;i.width(r.outerWidth()).addClass(r.attr("class")).attr("title",r.attr("title")||"").attr("tabindex",v).css("display","inline-block").bind("focus.selectBox",function(){(this!==document.activeElement&&document.body!==document.activeElement&&n(document.activeElement).blur(),i.hasClass("selectBox-active"))||(i.addClass("selectBox-active"),r.trigger("focus"))}).bind("blur.selectBox",function(){i.hasClass("selectBox-active")&&(i.removeClass("selectBox-active"),r.trigger("blur"))});n(window).data("selectBox-bindings")||n(window).data("selectBox-bindings",!0).bind("scroll.selectBox",this.hideMenus).bind("resize.selectBox",this.hideMenus);r.attr("disabled")&&i.addClass("selectBox-disabled");r.bind("click.selectBox",function(n){i.focus();n.preventDefault()});l?(t=this.getOptions("inline"),i.append(t).data("selectBox-options",t).addClass("selectBox-inline selectBox-menuShowing").bind("keydown.selectBox",function(n){u.handleKeyDown(n)}).bind("keypress.selectBox",function(n){u.handleKeyPress(n)}).bind("mousedown.selectBox",function(t){1===t.which&&(n(t.target).is("A.selectBox-inline")&&t.preventDefault(),i.hasClass("selectBox-focus")||i.focus())}).insertAfter(r),r[0].style.height||(s=r.attr("size")?parseInt(r.attr("size")):5,e=i.clone().removeAttr("id").css({position:"absolute",top:"-9999em"}).show().appendTo("body"),e.find(".selectBox-options").html("<li><a> <\/a><\/li>"),h=parseInt(e.find(".selectBox-options A:first").html("&nbsp;").outerHeight()),e.remove(),i.height(h*s)),this.disableSelection(i)):(f=n('<span class="selectBox-label" />'),o=n('<span class="selectBox-arrow" />'),f.attr("class",this.getLabelClass()).text(this.getLabelText()),t=this.getOptions("dropdown"),t.appendTo("BODY"),i.data("selectBox-options",t).addClass("selectBox-dropdown").append(f).append(o).bind("mousedown.selectBox",function(n){1===n.which&&(i.hasClass("selectBox-menuShowing")?u.hideMenus():(n.stopPropagation(),t.data("selectBox-down-at-x",n.screenX).data("selectBox-down-at-y",n.screenY),u.showMenu()))}).bind("keydown.selectBox",function(n){u.handleKeyDown(n)}).bind("keypress.selectBox",function(n){u.handleKeyPress(n)}).bind("open.selectBox",function(n,t){t&&t._selectBox===!0||u.showMenu()}).bind("close.selectBox",function(n,t){t&&t._selectBox===!0||u.hideMenus()}).insertAfter(r),c=i.width()-o.outerWidth()-parseInt(f.css("paddingLeft"))||0-parseInt(f.css("paddingRight"))||0,f.width(c),this.disableSelection(i));r.addClass("selectBox").data("selectBox-control",i).data("selectBox-settings",a).hide()};t.prototype.getOptions=function(t){var i,u=n(this.selectElement),r=this,e=function(t,i){return t.children("OPTION, OPTGROUP").each(function(){if(n(this).is("OPTION"))n(this).length>0?r.generateOptions(n(this),i):i.append("<li> <\/li>");else{var t=n('<li class="selectBox-optgroup" />');t.text(n(this).attr("label"));i.append(t);i=e(n(this),i)}}),i},f,o;switch(t){case"inline":return i=n('<ul class="selectBox-options" />'),i=e(u,i),i.find("A").bind("mouseover.selectBox",function(){r.addHover(n(this).parent())}).bind("mouseout.selectBox",function(){r.removeHover(n(this).parent())}).bind("mousedown.selectBox",function(n){1===n.which&&(n.preventDefault(),u.selectBox("control").hasClass("selectBox-active")||u.selectBox("control").focus())}).bind("mouseup.selectBox",function(t){1===t.which&&(r.hideMenus(),r.selectOption(n(this).parent(),t))}),this.disableSelection(i),i;case"dropdown":if(i=n('<ul class="selectBox-dropdown-menu selectBox-options" />'),i=e(u,i),i.data("selectBox-select",u).css("display","none").appendTo("BODY").find("A").bind("mousedown.selectBox",function(n){n.which===1&&(n.preventDefault(),n.screenX===i.data("selectBox-down-at-x")&&n.screenY===i.data("selectBox-down-at-y")&&(i.removeData("selectBox-down-at-x").removeData("selectBox-down-at-y"),r.hideMenus()))}).bind("mouseup.selectBox",function(t){1===t.which&&(t.screenX!==i.data("selectBox-down-at-x")||t.screenY!==i.data("selectBox-down-at-y"))&&(i.removeData("selectBox-down-at-x").removeData("selectBox-down-at-y"),r.selectOption(n(this).parent()),r.hideMenus())}).bind("mouseover.selectBox",function(){r.addHover(n(this).parent())}).bind("mouseout.selectBox",function(){r.removeHover(n(this).parent())}),f=u.attr("class")||"",""!==f){f=f.split(" ");for(o in f)i.addClass(f[o]+"-selectBox-dropdown-menu")}return this.disableSelection(i),i}};t.prototype.getLabelClass=function(){var t=n(this.selectElement).find("OPTION:selected");return("selectBox-label "+(t.attr("class")||"")).replace(/\s+$/,"")};t.prototype.getLabelText=function(){var t=n(this.selectElement).find("OPTION:selected");return t.text()||" "};t.prototype.setLabel=function(){var i=n(this.selectElement),t=i.data("selectBox-control");t&&t.find(".selectBox-label").attr("class",this.getLabelClass()).text(this.getLabelText())};t.prototype.destroy=function(){var i=n(this.selectElement),t=i.data("selectBox-control"),r;t&&(r=t.data("selectBox-options"),r.remove(),t.remove(),i.removeClass("selectBox").removeData("selectBox-control").data("selectBox-control",null).removeData("selectBox-settings").data("selectBox-settings",null).show())};t.prototype.refresh=function(){var t=n(this.selectElement),i=t.data("selectBox-control"),r=i.hasClass("selectBox-dropdown"),u=i.hasClass("selectBox-menuShowing");t.selectBox("options",t.html());r&&u&&this.showMenu()};t.prototype.showMenu=function(){var s=this,f=n(this.selectElement),t=f.data("selectBox-control"),i=f.data("selectBox-settings"),r=t.data("selectBox-options"),o,u,e;if(t.hasClass("selectBox-disabled")||(this.hideMenus(),o=parseInt(t.css("borderBottomWidth"))||0,r.width(t.innerWidth()).css({top:t.offset().top+t.outerHeight()-o,left:t.offset().left}),f.triggerHandler("beforeopen")))return!1;u=function(){f.triggerHandler("open",{_selectBox:!0})};switch(i.menuTransition){case"fade":r.fadeIn(i.menuSpeed,u);break;case"slide":r.slideDown(i.menuSpeed,u);break;default:r.show(i.menuSpeed,u)}i.menuSpeed||u();e=r.find(".selectBox-selected:first");this.keepOptionInView(e,!0);this.addHover(e);t.addClass("selectBox-menuShowing");n(document).bind("mousedown.selectBox",function(t){if(1===t.which){if(n(t.target).parents().addBack().hasClass("selectBox-options"))return;s.hideMenus()}})};t.prototype.hideMenus=function(){n(".selectBox-dropdown-menu:visible").length!==0&&(n(document).unbind("mousedown.selectBox"),n(".selectBox-dropdown-menu").each(function(){var r=n(this),u=r.data("selectBox-select"),f=u.data("selectBox-control"),t=u.data("selectBox-settings"),i;if(u.triggerHandler("beforeclose"))return!1;if(i=function(){u.triggerHandler("close",{_selectBox:!0})},t){switch(t.menuTransition){case"fade":r.fadeOut(t.menuSpeed,i);break;case"slide":r.slideUp(t.menuSpeed,i);break;default:r.hide(t.menuSpeed,i)}t.menuSpeed||i();f.removeClass("selectBox-menuShowing")}else n(this).hide(),n(this).triggerHandler("close",{_selectBox:!0}),n(this).removeClass("selectBox-menuShowing")}))};t.prototype.selectOption=function(t,i){var u=n(this.selectElement),r,s,f,o,e;return(t=n(t),r=u.data("selectBox-control"),s=u.data("selectBox-settings"),r.hasClass("selectBox-disabled"))?!1:0===t.length||t.hasClass("selectBox-disabled")?!1:(u.attr("multiple")?i.shiftKey&&r.data("selectBox-last-selected")?(t.toggleClass("selectBox-selected"),f=t.index()>r.data("selectBox-last-selected").index()?t.siblings().slice(r.data("selectBox-last-selected").index(),t.index()):t.siblings().slice(t.index(),r.data("selectBox-last-selected").index()),f=f.not(".selectBox-optgroup, .selectBox-disabled"),t.hasClass("selectBox-selected")?f.addClass("selectBox-selected"):f.removeClass("selectBox-selected")):this.isMac&&i.metaKey||!this.isMac&&i.ctrlKey?t.toggleClass("selectBox-selected"):(t.siblings().removeClass("selectBox-selected"),t.addClass("selectBox-selected")):(t.siblings().removeClass("selectBox-selected"),t.addClass("selectBox-selected")),r.hasClass("selectBox-dropdown")&&r.find(".selectBox-label").text(t.text()),o=0,e=[],u.attr("multiple")?r.find(".selectBox-selected A").each(function(){e[o++]=n(this).attr("rel")}):e=t.find("A").attr("rel"),r.data("selectBox-last-selected",t),u.val()!==e&&(u.val(e),this.setLabel(),u.trigger("change")),!0)};t.prototype.addHover=function(t){t=n(t);var i=n(this.selectElement),r=i.data("selectBox-control"),u=r.data("selectBox-options");u.find(".selectBox-hover").removeClass("selectBox-hover");t.addClass("selectBox-hover")};t.prototype.getSelectElement=function(){return this.selectElement};t.prototype.removeHover=function(t){t=n(t);var i=n(this.selectElement),r=i.data("selectBox-control"),u=r.data("selectBox-options");u.find(".selectBox-hover").removeClass("selectBox-hover")};t.prototype.keepOptionInView=function(t,i){if(t&&t.length!==0){var o=n(this.selectElement),u=o.data("selectBox-control"),f=u.data("selectBox-options"),r=u.hasClass("selectBox-dropdown")?f:f.parent(),e=parseInt(t.offset().top-r.position().top),s=parseInt(e+t.outerHeight());i?r.scrollTop(t.offset().top-r.offset().top+r.scrollTop()-r.height()/2):(e<0&&r.scrollTop(t.offset().top-r.offset().top+r.scrollTop()),s>r.height()&&r.scrollTop(t.offset().top+t.outerHeight()-r.offset().top+r.scrollTop()-r.height()))}};t.prototype.handleKeyDown=function(t){var s=n(this.selectElement),f=s.data("selectBox-control"),u=f.data("selectBox-options"),h=s.data("selectBox-settings"),e=0,o=0,i,r;if(!f.hasClass("selectBox-disabled"))switch(t.keyCode){case 8:t.preventDefault();this.typeSearch="";break;case 9:case 27:this.hideMenus();this.removeHover();break;case 13:f.hasClass("selectBox-menuShowing")?(this.selectOption(u.find("LI.selectBox-hover:first"),t),f.hasClass("selectBox-dropdown")&&this.hideMenus()):this.showMenu();break;case 38:case 37:if(t.preventDefault(),f.hasClass("selectBox-menuShowing")){for(i=u.find(".selectBox-hover").prev("LI"),e=u.find("LI:not(.selectBox-optgroup)").length,o=0;i.length===0||i.hasClass("selectBox-disabled")||i.hasClass("selectBox-optgroup");)if(i=i.prev("LI"),i.length===0&&(i=h.loopOptions?u.find("LI:last"):u.find("LI:first")),++o>=e)break;this.addHover(i);this.selectOption(i,t);this.keepOptionInView(i)}else this.showMenu();break;case 40:case 39:if(t.preventDefault(),f.hasClass("selectBox-menuShowing")){for(r=u.find(".selectBox-hover").next("LI"),e=u.find("LI:not(.selectBox-optgroup)").length,o=0;0===r.length||r.hasClass("selectBox-disabled")||r.hasClass("selectBox-optgroup");)if(r=r.next("LI"),r.length===0&&(r=h.loopOptions?u.find("LI:first"):u.find("LI:last")),++o>=e)break;this.addHover(r);this.selectOption(r,t);this.keepOptionInView(r)}else this.showMenu()}};t.prototype.handleKeyPress=function(t){var r=n(this.selectElement),i=r.data("selectBox-control"),u=i.data("selectBox-options");if(!i.hasClass("selectBox-disabled"))switch(t.keyCode){case 9:case 27:case 13:case 38:case 37:case 40:case 39:break;default:i.hasClass("selectBox-menuShowing")||this.showMenu();t.preventDefault();clearTimeout(this.typeTimer);this.typeSearch+=String.fromCharCode(t.charCode||t.keyCode);u.find("A").each(function(){if(n(this).text().substr(0,this.typeSearch.length).toLowerCase()===this.typeSearch.toLowerCase())return this.addHover(n(this).parent()),this.selectOption(n(this).parent(),t),this.keepOptionInView(n(this).parent()),!1});this.typeTimer=setTimeout(function(){this.typeSearch=""},1e3)}};t.prototype.enable=function(){var i=n(this.selectElement),t;(i.prop("disabled",!1),t=i.data("selectBox-control"),t)&&t.removeClass("selectBox-disabled")};t.prototype.disable=function(){var i=n(this.selectElement),t;(i.prop("disabled",!0),t=i.data("selectBox-control"),t)&&t.addClass("selectBox-disabled")};t.prototype.setValue=function(t){var i=n(this.selectElement),r,u,f;(i.val(t),t=i.val(),null===t&&(t=i.children().first().val(),i.val(t)),r=i.data("selectBox-control"),r)&&(u=i.data("selectBox-settings"),f=r.data("selectBox-options"),this.setLabel(),f.find(".selectBox-selected").removeClass("selectBox-selected"),f.find("A").each(function(){if(typeof t=="object")for(var i=0;i<t.length;i++)n(this).attr("rel")==t[i]&&n(this).parent().addClass("selectBox-selected");else n(this).attr("rel")==t&&n(this).parent().addClass("selectBox-selected")}),u.change&&u.change.call(i))};t.prototype.setOptions=function(t){var r=n(this.selectElement),u=r.data("selectBox-control"),h=r.data("selectBox-settings"),f,i,e,o,s;switch(typeof t){case"string":r.html(t);break;case"object":r.html("");for(i in t)if(t[i]!==null)if(typeof t[i]=="object"){e=n('<optgroup label="'+i+'" />');for(o in t[i])e.append('<option value="'+o+'">'+t[i][o]+"<\/option>");r.append(e)}else s=n('<option value="'+i+'">'+t[i]+"<\/option>"),r.append(s)}if(u){u.data("selectBox-options").remove();f=u.hasClass("selectBox-dropdown")?"dropdown":"inline";t=this.getOptions(f);u.data("selectBox-options",t);switch(f){case"inline":u.append(t);break;case"dropdown":this.setLabel();n("BODY").append(t)}}};t.prototype.disableSelection=function(t){n(t).css("MozUserSelect","none").bind("selectstart",function(n){n.preventDefault()})};t.prototype.generateOptions=function(t,i){var r=n("<li />"),u=n("<a />");r.addClass(t.attr("class"));r.data(t.data());u.attr("rel",t.val()).text(t.text());r.append(u);t.attr("disabled")&&r.addClass("selectBox-disabled");t.attr("selected")&&r.addClass("selectBox-selected");i.append(r)};n.extend(n.fn,{selectBox:function(i,r){var u;switch(i){case"control":return n(this).data("selectBox-control");case"settings":if(!r)return n(this).data("selectBox-settings");n(this).each(function(){n(this).data("selectBox-settings",n.extend(!0,n(this).data("selectBox-settings"),r))});break;case"options":if(undefined===r)return n(this).data("selectBox-control").data("selectBox-options");n(this).each(function(){(u=n(this).data("selectBox"))&&u.setOptions(r)});break;case"value":if(undefined===r)return n(this).val();n(this).each(function(){(u=n(this).data("selectBox"))&&u.setValue(r)});break;case"refresh":n(this).each(function(){(u=n(this).data("selectBox"))&&u.refresh()});break;case"enable":n(this).each(function(){(u=n(this).data("selectBox"))&&u.enable(this)});break;case"disable":n(this).each(function(){(u=n(this).data("selectBox"))&&u.disable()});break;case"destroy":n(this).each(function(){(u=n(this).data("selectBox"))&&(u.destroy(),n(this).data("selectBox",null))});break;case"instance":return n(this).data("selectBox");default:n(this).each(function(r,u){n(u).data("selectBox")||n(u).data("selectBox",new t(u,i))})}return n(this)}})}(jQuery),function(){var n,i,r,t,u,f={}.hasOwnProperty,e=function(n,t){function r(){this.constructor=n}for(var i in t)f.call(t,i)&&(n[i]=t[i]);return r.prototype=t.prototype,n.prototype=new r,n.__super__=t.prototype,n};t=function(){function n(){this.options_index=0;this.parsed=[]}return n.prototype.add_node=function(n){return n.nodeName.toUpperCase()==="OPTGROUP"?this.add_group(n):this.add_option(n)},n.prototype.add_group=function(n){var i,f,t,e,r,u;for(i=this.parsed.length,this.parsed.push({array_index:i,group:!0,label:this.escapeExpression(n.label),children:0,disabled:n.disabled}),r=n.childNodes,u=[],t=0,e=r.length;t<e;t++)f=r[t],u.push(this.add_option(f,i,n.disabled));return u},n.prototype.add_option=function(n,t,i){if(n.nodeName.toUpperCase()==="OPTION")return n.text!==""?(t!=null&&(this.parsed[t].children+=1),this.parsed.push({array_index:this.parsed.length,options_index:this.options_index,value:n.value,text:n.text,html:n.innerHTML,selected:n.selected,disabled:i===!0?i:n.disabled,group_array_index:t,classes:n.className,style:n.style.cssText})):this.parsed.push({array_index:this.parsed.length,options_index:this.options_index,empty:!0}),this.options_index+=1},n.prototype.escapeExpression=function(n){var t,i;return n==null||n===!1?"":/[\&\<\>\"\'\`]/.test(n)?(t={"<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","`":"&#x60;"},i=/&(?!\w+;)|[\<\>\"\'\`]/g,n.replace(i,function(n){return t[n]||"&amp;"})):n},n}();t.select_to_array=function(n){var f,r,i,e,u;for(r=new t,u=n.childNodes,i=0,e=u.length;i<e;i++)f=u[i],r.add_node(f);return r.parsed};i=function(){function n(t,i){(this.form_field=t,this.options=i!=null?i:{},n.browser_is_supported())&&(this.is_multiple=this.form_field.multiple,this.set_default_text(),this.set_default_values(),this.setup(),this.set_up_html(),this.register_observers())}return n.prototype.set_default_values=function(){var n=this;return this.click_test_action=function(t){return n.test_active_click(t)},this.activate_action=function(t){return n.activate_field(t)},this.active_field=!1,this.mouse_on_container=!1,this.results_showing=!1,this.result_highlighted=null,this.result_single_selected=null,this.allow_single_deselect=this.options.allow_single_deselect!=null&&this.form_field.options[0]!=null&&this.form_field.options[0].text===""?this.options.allow_single_deselect:!1,this.disable_search_threshold=this.options.disable_search_threshold||0,this.disable_search=this.options.disable_search||!1,this.enable_split_word_search=this.options.enable_split_word_search!=null?this.options.enable_split_word_search:!0,this.group_search=this.options.group_search!=null?this.options.group_search:!0,this.search_contains=this.options.search_contains||!1,this.single_backstroke_delete=this.options.single_backstroke_delete!=null?this.options.single_backstroke_delete:!0,this.max_selected_options=this.options.max_selected_options||Infinity,this.inherit_select_classes=this.options.inherit_select_classes||!1,this.display_selected_options=this.options.display_selected_options!=null?this.options.display_selected_options:!0,this.display_disabled_options=this.options.display_disabled_options!=null?this.options.display_disabled_options:!0},n.prototype.set_default_text=function(){return this.default_text=this.form_field.getAttribute("data-placeholder")?this.form_field.getAttribute("data-placeholder"):this.is_multiple?this.options.placeholder_text_multiple||this.options.placeholder_text||n.default_multiple_text:this.options.placeholder_text_single||this.options.placeholder_text||n.default_single_text,this.results_none_found=this.form_field.getAttribute("data-no_results_text")||this.options.no_results_text||n.default_no_result_text},n.prototype.mouse_enter=function(){return this.mouse_on_container=!0},n.prototype.mouse_leave=function(){return this.mouse_on_container=!1},n.prototype.input_focus=function(){var n=this;if(this.is_multiple){if(!this.active_field)return setTimeout(function(){return n.container_mousedown()},50)}else if(!this.active_field)return this.activate_field()},n.prototype.input_blur=function(){var n=this;if(!this.mouse_on_container)return this.active_field=!1,setTimeout(function(){return n.blur_test()},100)},n.prototype.results_option_build=function(n){var r,t,i,f,u;for(r="",u=this.results_data,i=0,f=u.length;i<f;i++)t=u[i],r+=t.group?this.result_add_group(t):this.result_add_option(t),(n!=null?n.first:void 0)&&(t.selected&&this.is_multiple?this.choice_build(t):t.selected&&!this.is_multiple&&this.single_set_selected_text(t.text));return r},n.prototype.result_add_option=function(n){var t,i;return n.search_match?this.include_option_in_results(n)?(t=[],n.disabled||n.selected&&this.is_multiple||t.push("active-result"),!n.disabled||n.selected&&this.is_multiple||t.push("disabled-result"),n.selected&&t.push("result-selected"),n.group_array_index!=null&&t.push("group-option"),n.classes!==""&&t.push(n.classes),i=n.style.cssText!==""?' style="'+n.style+'"':"",'<li class="'+t.join(" ")+'"'+i+' data-option-array-index="'+n.array_index+'">'+n.search_text+"<\/li>"):"":""},n.prototype.result_add_group=function(n){return(n.search_match||n.group_match)?(n.active_options>0)?'<li class="group-result">'+n.search_text+"<\/li>":"":""},n.prototype.results_update_field=function(){return this.set_default_text(),this.is_multiple||this.results_reset_cleanup(),this.result_clear_highlight(),this.result_single_selected=null,this.results_build(),this.results_showing?this.winnow_results():void 0},n.prototype.results_toggle=function(){return this.results_showing?this.results_hide():this.results_show()},n.prototype.results_search=function(){return this.results_showing?this.winnow_results():this.results_show()},n.prototype.winnow_results=function(){var e,n,h,c,u,t,i,r,o,l,f,a,s;for(this.no_results_clear(),u=0,i=this.get_search_text(),e=i.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),c=this.search_contains?"":"^",h=new RegExp(c+e,"i"),l=new RegExp(e,"i"),s=this.results_data,f=0,a=s.length;f<a;f++)n=s[f],n.search_match=!1,t=null,this.include_option_in_results(n)&&(n.group&&(n.group_match=!1,n.active_options=0),n.group_array_index!=null&&this.results_data[n.group_array_index]&&(t=this.results_data[n.group_array_index],t.active_options===0&&t.search_match&&(u+=1),t.active_options+=1),n.group&&!this.group_search||(n.search_text=n.group?n.label:n.html,n.search_match=this.search_string_match(n.search_text,h),n.search_match&&!n.group&&(u+=1),n.search_match?(i.length&&(r=n.search_text.search(l),o=n.search_text.substr(0,r+i.length)+"<\/em>"+n.search_text.substr(r+i.length),n.search_text=o.substr(0,r)+"<em>"+o.substr(r)),t!=null&&(t.group_match=!0)):n.group_array_index!=null&&this.results_data[n.group_array_index].search_match&&(n.search_match=!0)));return this.result_clear_highlight(),u<1&&i.length?(this.update_results_content(""),this.no_results(i)):(this.update_results_content(this.results_option_build()),this.winnow_results_set_highlight())},n.prototype.search_string_match=function(n,t){var u,i,r,f;if(t.test(n))return!0;if(this.enable_split_word_search&&(n.indexOf(" ")>=0||n.indexOf("[")===0)&&(i=n.replace(/\[|\]/g,"").split(" "),i.length))for(r=0,f=i.length;r<f;r++)if(u=i[r],t.test(u))return!0},n.prototype.choices_count=function(){var i,n,r,t;if(this.selected_option_count!=null)return this.selected_option_count;for(this.selected_option_count=0,t=this.form_field.options,n=0,r=t.length;n<r;n++)i=t[n],i.selected&&(this.selected_option_count+=1);return this.selected_option_count},n.prototype.choices_click=function(n){return n.preventDefault(),(this.results_showing||this.is_disabled)?void 0:this.results_show()},n.prototype.keyup_checker=function(n){var t,i;t=(i=n.which)!=null?i:n.keyCode;this.search_field_scale();switch(t){case 8:if(this.is_multiple&&this.backstroke_length<1&&this.choices_count()>0)return this.keydown_backstroke();if(!this.pending_backstroke)return this.result_clear_highlight(),this.results_search();break;case 13:if(n.preventDefault(),this.results_showing)return this.result_select(n);break;case 27:return this.results_showing&&this.results_hide(),!0;case 9:case 38:case 40:case 16:case 91:case 17:break;default:return this.results_search()}},n.prototype.container_width=function(){return this.options.width!=null?this.options.width:""+this.form_field.offsetWidth+"px"},n.prototype.include_option_in_results=function(n){return this.is_multiple&&!this.display_selected_options&&n.selected?!1:!this.display_disabled_options&&n.disabled?!1:n.empty?!1:!0},n.browser_is_supported=function(){return window.navigator.appName==="Microsoft Internet Explorer"?document.documentMode>=8:/iP(od|hone)/i.test(window.navigator.userAgent)?!0:(/Android/i.test(window.navigator.userAgent)&&/Mobile/i.test(window.navigator.userAgent),!0)},n.default_multiple_text="Select Some Options",n.default_single_text="Select an Option",n.default_no_result_text="No results match",n}();n=jQuery;n.fn.extend({chosen:function(t){return i.browser_is_supported()?this.each(function(){var u,i;u=n(this);i=u.data("chosen");t==="destroy"&&i?i.destroy():i||u.data("chosen",new r(this,t))}):this}});r=function(i){function r(){return u=r.__super__.constructor.apply(this,arguments)}return e(r,i),r.prototype.setup=function(){return this.form_field_jq=n(this.form_field),this.current_selectedIndex=this.form_field.selectedIndex,this.is_rtl=this.form_field_jq.hasClass("chosen-rtl")},r.prototype.set_up_html=function(){var t,i;return t=["chosen-container"],t.push("chosen-container-"+(this.is_multiple?"multi":"single")),this.inherit_select_classes&&this.form_field.className&&t.push(this.form_field.className),this.is_rtl&&t.push("chosen-rtl"),i={"class":t.join(" "),style:"width: "+this.container_width()+";",title:this.form_field.title},this.form_field.id.length&&(i.id=this.form_field.id.replace(/[^\w]/g,"_")+"_chosen"),this.container=n("<div />",i),this.is_multiple?this.container.html('<ul class="chosen-choices"><li class="search-field"><input type="text" value="'+this.default_text+'" class="default" autocomplete="off" style="width:25px;" /><\/li><\/ul><div class="chosen-drop"><ul class="chosen-results"><\/ul><\/div>'):this.container.html('<a class="chosen-single chosen-default" tabindex="-1"><span>'+this.default_text+'<\/span><div><b><\/b><\/div><\/a><div class="chosen-drop"><div class="chosen-search"><input type="text" autocomplete="off" /><\/div><ul class="chosen-results"><\/ul><\/div>'),this.form_field_jq.hide().after(this.container),this.dropdown=this.container.find("div.chosen-drop").first(),this.search_field=this.container.find("input").first(),this.search_results=this.container.find("ul.chosen-results").first(),this.search_field_scale(),this.search_no_results=this.container.find("li.no-results").first(),this.is_multiple?(this.search_choices=this.container.find("ul.chosen-choices").first(),this.search_container=this.container.find("li.search-field").first()):(this.search_container=this.container.find("div.chosen-search").first(),this.selected_item=this.container.find(".chosen-single").first()),this.results_build(),this.set_tab_index(),this.set_label_behavior(),this.form_field_jq.trigger("chosen:ready",{chosen:this})},r.prototype.register_observers=function(){var n=this;return this.container.bind("mousedown.chosen",function(t){n.container_mousedown(t)}),this.container.bind("mouseup.chosen",function(t){n.container_mouseup(t)}),this.container.bind("mouseenter.chosen",function(t){n.mouse_enter(t)}),this.container.bind("mouseleave.chosen",function(t){n.mouse_leave(t)}),this.search_results.bind("mouseup.chosen",function(t){n.search_results_mouseup(t)}),this.search_results.bind("mouseover.chosen",function(t){n.search_results_mouseover(t)}),this.search_results.bind("mouseout.chosen",function(t){n.search_results_mouseout(t)}),this.search_results.bind("mousewheel.chosen DOMMouseScroll.chosen",function(t){n.search_results_mousewheel(t)}),this.form_field_jq.bind("chosen:updated.chosen",function(t){n.results_update_field(t)}),this.form_field_jq.bind("chosen:activate.chosen",function(t){n.activate_field(t)}),this.form_field_jq.bind("chosen:open.chosen",function(t){n.container_mousedown(t)}),this.search_field.bind("blur.chosen",function(t){n.input_blur(t)}),this.search_field.bind("keyup.chosen",function(t){n.keyup_checker(t)}),this.search_field.bind("keydown.chosen",function(t){n.keydown_checker(t)}),this.search_field.bind("focus.chosen",function(t){n.input_focus(t)}),this.is_multiple?this.search_choices.bind("click.chosen",function(t){n.choices_click(t)}):this.container.bind("click.chosen",function(n){n.preventDefault()})},r.prototype.destroy=function(){return n(document).unbind("click.chosen",this.click_test_action),this.search_field[0].tabIndex&&(this.form_field_jq[0].tabIndex=this.search_field[0].tabIndex),this.container.remove(),this.form_field_jq.removeData("chosen"),this.form_field_jq.show()},r.prototype.search_field_disabled=function(){return(this.is_disabled=this.form_field_jq[0].disabled,this.is_disabled)?(this.container.addClass("chosen-disabled"),this.search_field[0].disabled=!0,this.is_multiple||this.selected_item.unbind("focus.chosen",this.activate_action),this.close_field()):(this.container.removeClass("chosen-disabled"),this.search_field[0].disabled=!1,!this.is_multiple)?this.selected_item.bind("focus.chosen",this.activate_action):void 0},r.prototype.container_mousedown=function(t){if(!this.is_disabled&&(t&&t.type==="mousedown"&&!this.results_showing&&t.preventDefault(),!(t!=null&&n(t.target).hasClass("search-choice-close"))))return this.active_field?!this.is_multiple&&t&&(n(t.target)[0]===this.selected_item[0]||n(t.target).parents("a.chosen-single").length)&&(t.preventDefault(),this.results_toggle()):(this.is_multiple&&this.search_field.val(""),n(document).bind("click.chosen",this.click_test_action),this.results_show()),this.activate_field()},r.prototype.container_mouseup=function(n){if(n.target.nodeName==="ABBR"&&!this.is_disabled)return this.results_reset(n)},r.prototype.search_results_mousewheel=function(n){var t,i,r;return t=-((i=n.originalEvent)!=null?i.wheelDelta:void 0)||((r=n.originialEvent)!=null?r.detail:void 0),t!=null?(n.preventDefault(),n.type==="DOMMouseScroll"&&(t=t*40),this.search_results.scrollTop(t+this.search_results.scrollTop())):void 0},r.prototype.blur_test=function(){if(!this.active_field&&this.container.hasClass("chosen-container-active"))return this.close_field()},r.prototype.close_field=function(){return n(document).unbind("click.chosen",this.click_test_action),this.active_field=!1,this.results_hide(),this.container.removeClass("chosen-container-active"),this.clear_backstroke(),this.show_search_field_default(),this.search_field_scale()},r.prototype.activate_field=function(){return this.container.addClass("chosen-container-active"),this.active_field=!0,this.search_field.val(this.search_field.val()),this.search_field.focus()},r.prototype.test_active_click=function(t){return this.container.is(n(t.target).closest(".chosen-container"))?this.active_field=!0:this.close_field()},r.prototype.results_build=function(){return this.parsing=!0,this.selected_option_count=null,this.results_data=t.select_to_array(this.form_field),this.is_multiple?this.search_choices.find("li.search-choice").remove():this.is_multiple||(this.single_set_selected_text(),this.disable_search||this.form_field.options.length<=this.disable_search_threshold?(this.search_field[0].readOnly=!0,this.container.addClass("chosen-container-single-nosearch")):(this.search_field[0].readOnly=!1,this.container.removeClass("chosen-container-single-nosearch"))),this.update_results_content(this.results_option_build({first:!0})),this.search_field_disabled(),this.show_search_field_default(),this.search_field_scale(),this.parsing=!1},r.prototype.result_do_highlight=function(n){var t,i,r,f,u;if(n.length){if(this.result_clear_highlight(),this.result_highlight=n,this.result_highlight.addClass("highlighted"),r=parseInt(this.search_results.css("maxHeight"),10),u=this.search_results.scrollTop(),f=r+u,i=this.result_highlight.position().top+this.search_results.scrollTop(),t=i+this.result_highlight.outerHeight(),t>=f)return this.search_results.scrollTop(t-r>0?t-r:0);if(i<u)return this.search_results.scrollTop(i)}},r.prototype.result_clear_highlight=function(){return this.result_highlight&&this.result_highlight.removeClass("highlighted"),this.result_highlight=null},r.prototype.results_show=function(){return this.is_multiple&&this.max_selected_options<=this.choices_count()?(this.form_field_jq.trigger("chosen:maxselected",{chosen:this}),!1):(this.container.addClass("chosen-with-drop"),this.form_field_jq.trigger("chosen:showing_dropdown",{chosen:this}),this.results_showing=!0,this.search_field.focus(),this.search_field.val(this.search_field.val()),this.winnow_results())},r.prototype.update_results_content=function(n){return this.search_results.html(n)},r.prototype.results_hide=function(){return this.results_showing&&(this.result_clear_highlight(),this.container.removeClass("chosen-with-drop"),this.form_field_jq.trigger("chosen:hiding_dropdown",{chosen:this})),this.results_showing=!1},r.prototype.set_tab_index=function(){var n;if(this.form_field.tabIndex)return n=this.form_field.tabIndex,this.form_field.tabIndex=-1,this.search_field[0].tabIndex=n},r.prototype.set_label_behavior=function(){var t=this;return this.form_field_label=this.form_field_jq.parents("label"),!this.form_field_label.length&&this.form_field.id.length&&(this.form_field_label=n("label[for='"+this.form_field.id+"']")),this.form_field_label.length>0?this.form_field_label.bind("click.chosen",function(n){return t.is_multiple?t.container_mousedown(n):t.activate_field()}):void 0},r.prototype.show_search_field_default=function(){return this.is_multiple&&this.choices_count()<1&&!this.active_field?(this.search_field.val(this.default_text),this.search_field.addClass("default")):(this.search_field.val(""),this.search_field.removeClass("default"))},r.prototype.search_results_mouseup=function(t){var i;return i=n(t.target).hasClass("active-result")?n(t.target):n(t.target).parents(".active-result").first(),i.length?(this.result_highlight=i,this.result_select(t),this.search_field.focus()):void 0},r.prototype.search_results_mouseover=function(t){var i;return i=n(t.target).hasClass("active-result")?n(t.target):n(t.target).parents(".active-result").first(),i?this.result_do_highlight(i):void 0},r.prototype.search_results_mouseout=function(t){if(n(t.target).hasClass("active-result"||n(t.target).parents(".active-result").first()))return this.result_clear_highlight()},r.prototype.choice_build=function(t){var i,r,u=this;return i=n("<li />",{"class":"search-choice"}).html("<span>"+t.html+"<\/span>"),t.disabled?i.addClass("search-choice-disabled"):(r=n("<a />",{"class":"search-choice-close","data-option-array-index":t.array_index}),r.bind("click.chosen",function(n){return u.choice_destroy_link_click(n)}),i.append(r)),this.search_container.before(i)},r.prototype.choice_destroy_link_click=function(t){return t.preventDefault(),t.stopPropagation(),this.is_disabled?void 0:this.choice_destroy(n(t.target))},r.prototype.choice_destroy=function(n){if(this.result_deselect(n[0].getAttribute("data-option-array-index")))return this.show_search_field_default(),this.is_multiple&&this.choices_count()>0&&this.search_field.val().length<1&&this.results_hide(),n.parents("li").first().remove(),this.search_field_scale()},r.prototype.results_reset=function(){return this.form_field.options[0].selected=!0,this.selected_option_count=null,this.single_set_selected_text(),this.show_search_field_default(),this.results_reset_cleanup(),this.form_field_jq.trigger("change"),this.active_field?this.results_hide():void 0},r.prototype.results_reset_cleanup=function(){return this.current_selectedIndex=this.form_field.selectedIndex,this.selected_item.find("abbr").remove()},r.prototype.result_select=function(n){var i,t,r;if(this.result_highlight)return(i=this.result_highlight,this.result_clear_highlight(),this.is_multiple&&this.max_selected_options<=this.choices_count())?(this.form_field_jq.trigger("chosen:maxselected",{chosen:this}),!1):(this.is_multiple?i.removeClass("active-result"):(this.result_single_selected&&(this.result_single_selected.removeClass("result-selected"),r=this.result_single_selected[0].getAttribute("data-option-array-index"),this.results_data[r].selected=!1),this.result_single_selected=i),i.addClass("result-selected"),t=this.results_data[i[0].getAttribute("data-option-array-index")],t.selected=!0,this.form_field.options[t.options_index].selected=!0,this.selected_option_count=null,this.is_multiple?this.choice_build(t):this.single_set_selected_text(t.text),(n.metaKey||n.ctrlKey)&&this.is_multiple||this.results_hide(),this.search_field.val(""),(this.is_multiple||this.form_field.selectedIndex!==this.current_selectedIndex)&&this.form_field_jq.trigger("change",{selected:this.form_field.options[t.options_index].value}),this.current_selectedIndex=this.form_field.selectedIndex,this.search_field_scale())},r.prototype.single_set_selected_text=function(n){return n==null&&(n=this.default_text),n===this.default_text?this.selected_item.addClass("chosen-default"):(this.single_deselect_control_build(),this.selected_item.removeClass("chosen-default")),this.selected_item.find("span").text(n)},r.prototype.result_deselect=function(n){var t;return t=this.results_data[n],this.form_field.options[t.options_index].disabled?!1:(t.selected=!1,this.form_field.options[t.options_index].selected=!1,this.selected_option_count=null,this.result_clear_highlight(),this.results_showing&&this.winnow_results(),this.form_field_jq.trigger("change",{deselected:this.form_field.options[t.options_index].value}),this.search_field_scale(),!0)},r.prototype.single_deselect_control_build=function(){if(this.allow_single_deselect)return this.selected_item.find("abbr").length||this.selected_item.find("span").first().after('<abbr class="search-choice-close"><\/abbr>'),this.selected_item.addClass("chosen-single-with-deselect")},r.prototype.get_search_text=function(){return this.search_field.val()===this.default_text?"":n("<div/>").text(n.trim(this.search_field.val())).html()},r.prototype.winnow_results_set_highlight=function(){var n,t;return t=this.is_multiple?[]:this.search_results.find(".result-selected.active-result"),n=t.length?t.first():this.search_results.find(".active-result").first(),n!=null?this.result_do_highlight(n):void 0},r.prototype.no_results=function(t){var i;return i=n('<li class="no-results">'+this.results_none_found+' "<span><\/span>"<\/li>'),i.find("span").first().html(t),this.search_results.append(i)},r.prototype.no_results_clear=function(){return this.search_results.find(".no-results").remove()},r.prototype.keydown_arrow=function(){var n;if(this.results_showing&&this.result_highlight){if(n=this.result_highlight.nextAll("li.active-result").first(),n)return this.result_do_highlight(n)}else return this.results_show()},r.prototype.keyup_arrow=function(){var n;if(this.results_showing||this.is_multiple){if(this.result_highlight)return n=this.result_highlight.prevAll("li.active-result"),n.length?this.result_do_highlight(n.first()):(this.choices_count()>0&&this.results_hide(),this.result_clear_highlight())}else return this.results_show()},r.prototype.keydown_backstroke=function(){var n;return this.pending_backstroke?(this.choice_destroy(this.pending_backstroke.find("a").first()),this.clear_backstroke()):(n=this.search_container.siblings("li.search-choice").last(),n.length&&!n.hasClass("search-choice-disabled"))?(this.pending_backstroke=n,this.single_backstroke_delete?this.keydown_backstroke():this.pending_backstroke.addClass("search-choice-focus")):void 0},r.prototype.clear_backstroke=function(){return this.pending_backstroke&&this.pending_backstroke.removeClass("search-choice-focus"),this.pending_backstroke=null},r.prototype.keydown_checker=function(n){var t,i;t=(i=n.which)!=null?i:n.keyCode;this.search_field_scale();t!==8&&this.pending_backstroke&&this.clear_backstroke();switch(t){case 8:this.backstroke_length=this.search_field.val().length;break;case 9:this.results_showing&&!this.is_multiple&&this.result_select(n);this.mouse_on_container=!1;break;case 13:n.preventDefault();break;case 38:n.preventDefault();this.keyup_arrow();break;case 40:n.preventDefault();this.keydown_arrow()}},r.prototype.search_field_scale=function(){var t,u,h,f,e,o,i,r,s;if(this.is_multiple){for(h=0,i=0,e="position:absolute; left: -1000px; top: -1000px; display:none;",o=["font-size","font-style","font-weight","font-family","line-height","text-transform","letter-spacing"],r=0,s=o.length;r<s;r++)f=o[r],e+=f+":"+this.search_field.css(f)+";";return t=n("<div />",{style:e}),t.text(this.search_field.val()),n("body").append(t),i=t.width()+25,t.remove(),u=this.container.outerWidth(),i>u-10&&(i=u-10),this.search_field.css({width:i+"px"})}},r}(i)}.call(this);!function(n){var t={isMsie:function(){return/(msie|trident)/i.test(navigator.userAgent)?navigator.userAgent.match(/(msie |rv:)(\d+(.\d+)?)/i)[2]:!1},isBlankString:function(n){return!n||/^\s*$/.test(n)},escapeRegExChars:function(n){return n.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")},isString:function(n){return"string"==typeof n},isNumber:function(n){return"number"==typeof n},isArray:n.isArray,isFunction:n.isFunction,isObject:n.isPlainObject,isUndefined:function(n){return"undefined"==typeof n},bind:n.proxy,each:function(t,i){function r(n,t){return i(t,n)}n.each(t,r)},map:n.map,filter:n.grep,every:function(t,i){var r=!0;return t?(n.each(t,function(n,u){if(!(r=i.call(null,u,n,t)))return!1}),!!r):r},some:function(t,i){var r=!1;return t?(n.each(t,function(n,u){if((r=i.call(null,u,n,t)))return!1}),!!r):r},mixin:n.extend,getUniqueId:function(){var n=0;return function(){return n++}}(),templatify:function(t){function i(){return String(t)}return n.isFunction(t)?t:i},defer:function(n){setTimeout(n,0)},debounce:function(n,t,i){var r,u;return function(){var f,e,o=this,s=arguments;return f=function(){r=null;i||(u=n.apply(o,s))},e=i&&!r,clearTimeout(r),r=setTimeout(f,t),e&&(u=n.apply(o,s)),u}},throttle:function(n,t){var u,f,i,e,r,o;return r=0,o=function(){r=new Date;i=null;e=n.apply(u,f)},function(){var s=new Date,h=t-(s-r);return u=this,f=arguments,0>=h?(clearTimeout(i),i=null,r=s,e=n.apply(u,f)):i||(i=setTimeout(o,h)),e}},noop:function(){}},r={wrapper:'<span class="twitter-typeahead"><\/span>',dropdown:'<span class="tt-dropdown-menu"><\/span>',dataset:'<div class="tt-dataset-%CLASS%"><\/div>',suggestions:'<span class="tt-suggestions"><\/span>',suggestion:'<div class="tt-suggestion"><\/div>'},i={wrapper:{position:"relative",display:"inline-block"},hint:{position:"absolute",top:"0",left:"0",borderColor:"transparent",boxShadow:"none"},input:{position:"relative",verticalAlign:"top",backgroundColor:"transparent"},inputWithNoHint:{position:"relative",verticalAlign:"top"},dropdown:{position:"absolute",top:"100%",left:"0",zIndex:"100",display:"none"},suggestions:{display:"block"},suggestion:{whiteSpace:"nowrap",cursor:"pointer"},suggestionChild:{whiteSpace:"normal"},ltr:{left:"0",right:"auto"},rtl:{left:"auto",right:" 0"}};t.isMsie()&&t.mixin(i.input,{backgroundImage:"url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)"});t.isMsie()&&t.isMsie()<=7&&t.mixin(i.input,{marginTop:"-1px"});var e=function(){function i(t){t&&t.el||n.error("EventBus initialized without el");this.$el=n(t.el)}var r="typeahead:";return t.mixin(i.prototype,{trigger:function(n){var t=[].slice.call(arguments,1);this.$el.trigger(r+n,t)}}),i}(),f=function(){function t(t,i,r,u){var f;if(!r)return this;for(i=i.split(n),r=u?s(r,u):r,this._callbacks=this._callbacks||{};f=i.shift();)this._callbacks[f]=this._callbacks[f]||{sync:[],async:[]},this._callbacks[f][t].push(r);return this}function r(n,i,r){return t.call(this,"async",n,i,r)}function u(n,i,r){return t.call(this,"sync",n,i,r)}function f(t){var i;if(!this._callbacks)return this;for(t=t.split(n);i=t.shift();)delete this._callbacks[i];return this}function e(t){var r,u,f,e,o;if(!this._callbacks)return this;for(t=t.split(n),f=[].slice.call(arguments,1);(r=t.shift())&&(u=this._callbacks[r]);)e=i(u.sync,this,[r].concat(f)),o=i(u.async,this,[r].concat(f)),e()&&h(o);return this}function i(n,t,i){function r(){for(var r,u=0;!r&&u<n.length;u+=1)r=n[u].apply(t,i)===!1;return!r}return r}function o(){return window.setImmediate?function(n){setImmediate(function(){n()})}:function(n){setTimeout(function(){n()},0)}}function s(n,t){return n.bind?n.bind(t):function(){n.apply(t,[].slice.call(arguments,0))}}var n=/\s+/,h=o();return{onSync:u,onAsync:r,off:f,trigger:e}}(),s=function(n){function i(n,i,r){for(var u,f=[],e=0;e<n.length;e++)f.push(t.escapeRegExChars(n[e]));return u=r?"\\b("+f.join("|")+")\\b":"("+f.join("|")+")",i?new RegExp(u):new RegExp(u,"i")}var r={node:null,pattern:null,tagName:"strong",className:null,wordsOnly:!1,caseSensitive:!1};return function(u){function o(t){var i,r;return(i=e.exec(t.data))&&(wrapperNode=n.createElement(u.tagName),u.className&&(wrapperNode.className=u.className),r=t.splitText(i.index),r.splitText(i[0].length),wrapperNode.appendChild(r.cloneNode(!0)),t.parentNode.replaceChild(wrapperNode,r)),!!i}function f(n,t){for(var i,r=0;r<n.childNodes.length;r++)i=n.childNodes[r],i.nodeType===3?r+=t(i)?1:0:f(i,t)}var e;u=t.mixin({},r,u);u.node&&u.pattern&&(u.pattern=t.isArray(u.pattern)?u.pattern:[u.pattern],e=i(u.pattern,u.caseSensitive,u.wordsOnly),f(u.node,o))}}(window.document),o=function(){function i(i){var r,f,o,s,h=this;i=i||{};i.input||n.error("input is missing");r=t.bind(this._onBlur,this);f=t.bind(this._onFocus,this);o=t.bind(this._onKeydown,this);s=t.bind(this._onInput,this);this.$hint=n(i.hint);this.$input=n(i.input).on("blur.tt",r).on("focus.tt",f).on("keydown.tt",o);0===this.$hint.length&&(this.setHint=this.getHint=this.clearHint=this.clearHintIfInvalid=t.noop);t.isMsie()?this.$input.on("keydown.tt keypress.tt cut.tt paste.tt",function(n){u[n.which||n.keyCode]||t.defer(t.bind(h._onInput,h,n))}):this.$input.on("input.tt",s);this.query=this.$input.val();this.$overflowHelper=e(this.$input)}function e(t){return n('<pre aria-hidden="true"><\/pre>').css({position:"absolute",visibility:"hidden",whiteSpace:"pre",fontFamily:t.css("font-family"),fontSize:t.css("font-size"),fontStyle:t.css("font-style"),fontVariant:t.css("font-variant"),fontWeight:t.css("font-weight"),wordSpacing:t.css("word-spacing"),letterSpacing:t.css("letter-spacing"),textIndent:t.css("text-indent"),textRendering:t.css("text-rendering"),textTransform:t.css("text-transform")}).insertAfter(t)}function o(n,t){return i.normalizeQuery(n)===i.normalizeQuery(t)}function r(n){return n.altKey||n.ctrlKey||n.metaKey||n.shiftKey}var u;return u={9:"tab",27:"esc",37:"left",39:"right",13:"enter",38:"up",40:"down"},i.normalizeQuery=function(n){return(n||"").replace(/^\s*/g,"").replace(/\s{2,}/g," ")},t.mixin(i.prototype,f,{_onBlur:function(){this.resetInputValue();this.trigger("blurred")},_onFocus:function(){this.trigger("focused")},_onKeydown:function(n){var t=u[n.which||n.keyCode];this._managePreventDefault(t,n);t&&this._shouldTrigger(t,n)&&this.trigger(t+"Keyed",n)},_onInput:function(){this._checkInputValue()},_managePreventDefault:function(n,t){var i,u,f;switch(n){case"tab":u=this.getHint();f=this.getInputValue();i=u&&u!==f&&!r(t);break;case"up":case"down":i=!r(t);break;default:i=!1}i&&t.preventDefault()},_shouldTrigger:function(n,t){var i;switch(n){case"tab":i=!r(t);break;default:i=!0}return i},_checkInputValue:function(){var n,t,i;n=this.getInputValue();t=o(n,this.query);i=t?this.query.length!==n.length:!1;t?i&&this.trigger("whitespaceChanged",this.query):this.trigger("queryChanged",this.query=n)},focus:function(){this.$input.focus()},blur:function(){this.$input.blur()},getQuery:function(){return this.query},setQuery:function(n){this.query=n},getInputValue:function(){return this.$input.val()},setInputValue:function(n,t){this.$input.val(n);t?this.clearHint():this._checkInputValue()},resetInputValue:function(){this.setInputValue(this.query,!0)},getHint:function(){return this.$hint.val()},setHint:function(n){this.$hint.val(n)},clearHint:function(){this.setHint("")},clearHintIfInvalid:function(){var n,t,i,r;n=this.getInputValue();t=this.getHint();i=n!==t&&0===t.indexOf(n);r=""!==n&&i&&!this.hasOverflow();!r&&this.clearHint()},getLanguageDirection:function(){return(this.$input.css("direction")||"ltr").toLowerCase()},hasOverflow:function(){var n=this.$input.width()-2;return this.$overflowHelper.text(this.getInputValue()),this.$overflowHelper.width()>=n},isCursorAtEnd:function(){var n,i,r;return n=this.$input.val().length,i=this.$input[0].selectionStart,t.isNumber(i)?i===n:document.selection?(r=document.selection.createRange(),r.moveStart("character",-n),n===r.text.length):!0},destroy:function(){this.$hint.off(".tt");this.$input.off(".tt");this.$hint=this.$input=this.$overflowHelper=null}}),i}(),u=function(){function u(i){i=i||{};i.templates=i.templates||{};i.source||n.error("missing source");i.name&&!a(i.name)&&n.error("invalid dataset name: "+i.name);this.query=null;this.highlight=!!i.highlight;this.name=i.name||t.getUniqueId();this.source=i.source;this.displayFn=c(i.display||i.displayKey);this.templates=l(i.templates,this.displayFn);this.$el=n(r.dataset.replace("%CLASS%",this.name))}function c(n){function i(t){return t[n]}return n=n||"value",t.isFunction(n)?n:i}function l(n,i){function r(n){return"<p>"+i(n)+"<\/p>"}return{empty:n.empty&&t.templatify(n.empty),header:n.header&&t.templatify(n.header),footer:n.footer&&t.templatify(n.footer),suggestion:n.suggestion||r}}function a(n){return/^[_a-zA-Z0-9-]+$/.test(n)}var e="ttDataset",o="ttValue",h="ttDatum";return u.extractDatasetName=function(t){return n(t).data(e)},u.extractValue=function(t){return n(t).data(o)},u.extractDatum=function(t){return n(t).data(h)},t.mixin(u.prototype,f,{_render:function(u,f){function y(){return c.templates.empty({query:u,isEmpty:!0})}function p(){function v(t){var u;return u=n(r.suggestion).append(c.templates.suggestion(t)).data(e,c.name).data(o,c.displayFn(t)).data(h,t),u.children().each(function(){n(this).css(i.suggestionChild)}),u}var l,a;return l=n(r.suggestions).css(i.suggestions),a=t.map(f,v),l.append.apply(l,a),c.highlight&&s({node:l[0],pattern:u}),l}function a(){return c.templates.header({query:u,isEmpty:!l})}function v(){return c.templates.footer({query:u,isEmpty:!l})}if(this.$el){var l,c=this;this.$el.empty();l=f&&f.length;!l&&this.templates.empty?this.$el.html(y()).prepend(c.templates.header?a():null).append(c.templates.footer?v():null):l&&this.$el.html(p()).prepend(c.templates.header?a():null).append(c.templates.footer?v():null);this.trigger("rendered")}},getRoot:function(){return this.$el},update:function(n){function i(i){t.canceled||n!==t.query||t._render(n,i)}var t=this;this.query=n;this.canceled=!1;this.source(n,i)},cancel:function(){this.canceled=!0},clear:function(){this.cancel();this.$el.empty();this.trigger("rendered")},isEmpty:function(){return this.$el.is(":empty")},destroy:function(){this.$el=null}}),u}(),h=function(){function r(i){var u,f,o,r=this;i=i||{};i.menu||n.error("menu is required");this.isOpen=!1;this.isEmpty=!0;this.datasets=t.map(i.datasets,e);u=t.bind(this._onSuggestionClick,this);f=t.bind(this._onSuggestionMouseEnter,this);o=t.bind(this._onSuggestionMouseLeave,this);this.$menu=n(i.menu).on("click.tt",".tt-suggestion",u).on("mouseenter.tt",".tt-suggestion",f).on("mouseleave.tt",".tt-suggestion",o);t.each(this.datasets,function(n){r.$menu.append(n.getRoot());n.onSync("rendered",r._onRendered,r)})}function e(n){return new u(n)}return t.mixin(r.prototype,f,{_onSuggestionClick:function(t){this.trigger("suggestionClicked",n(t.currentTarget))},_onSuggestionMouseEnter:function(t){this._removeCursor();this._setCursor(n(t.currentTarget),!0)},_onSuggestionMouseLeave:function(){this._removeCursor()},_onRendered:function(){function n(n){return n.isEmpty()}this.isEmpty=t.every(this.datasets,n);this.isEmpty?this._hide():this.isOpen&&this._show();this.trigger("datasetRendered")},_hide:function(){this.$menu.hide()},_show:function(){this.$menu.css("display","block")},_getSuggestions:function(){return this.$menu.find(".tt-suggestion")},_getCursor:function(){return this.$menu.find(".tt-cursor").first()},_setCursor:function(n,t){n.first().addClass("tt-cursor");t||this.trigger("cursorMoved")},_removeCursor:function(){this._getCursor().removeClass("tt-cursor")},_moveCursor:function(n){var i,r,t,u;if(this.isOpen){if(r=this._getCursor(),i=this._getSuggestions(),this._removeCursor(),t=i.index(r)+n,t=(t+1)%(i.length+1)-1,-1===t)return void this.trigger("cursorRemoved");-1>t&&(t=i.length-1);this._setCursor(u=i.eq(t));this._ensureVisible(u)}},_ensureVisible:function(n){var t,i,r,u;t=n.position().top;i=t+n.outerHeight(!0);r=this.$menu.scrollTop();u=this.$menu.height()+parseInt(this.$menu.css("paddingTop"),10)+parseInt(this.$menu.css("paddingBottom"),10);0>t?this.$menu.scrollTop(r+t):i>u&&this.$menu.scrollTop(r+(i-u))},close:function(){this.isOpen&&(this.isOpen=!1,this._removeCursor(),this._hide(),this.trigger("closed"))},open:function(){this.isOpen||(this.isOpen=!0,!this.isEmpty&&this._show(),this.trigger("opened"))},setLanguageDirection:function(n){this.$menu.css("ltr"===n?i.ltr:i.rtl)},moveCursorUp:function(){this._moveCursor(-1)},moveCursorDown:function(){this._moveCursor(1)},getDatumForSuggestion:function(n){var t=null;return n.length&&(t={raw:u.extractDatum(n),value:u.extractValue(n),datasetName:u.extractDatasetName(n)}),t},getDatumForCursor:function(){return this.getDatumForSuggestion(this._getCursor().first())},getDatumForTopSuggestion:function(){return this.getDatumForSuggestion(this._getSuggestions().first())},update:function(n){function i(t){t.update(n)}t.each(this.datasets,i)},empty:function(){function n(n){n.clear()}t.each(this.datasets,n);this.isEmpty=!0},isVisible:function(){return this.isOpen&&!this.isEmpty},destroy:function(){function n(n){n.destroy()}this.$menu.off(".tt");this.$menu=null;t.each(this.datasets,n)}}),r}(),c=function(){function f(i){var r,u,f;i=i||{};i.input||n.error("missing input");this.isActivated=!1;this.autoselect=!!i.autoselect;this.minLength=t.isNumber(i.minLength)?i.minLength:1;this.$node=s(i.input,i.withHint);r=this.$node.find(".tt-dropdown-menu");u=this.$node.find(".tt-input");f=this.$node.find(".tt-hint");u.on("blur.tt",function(n){var i,f,e;i=document.activeElement;f=r.is(i);e=r.has(i).length>0;t.isMsie()&&(f||e)&&(n.preventDefault(),n.stopImmediatePropagation(),t.defer(function(){u.focus()}))});r.on("mousedown.tt",function(n){n.preventDefault()});this.eventBus=i.eventBus||new e({el:u});this.dropdown=new h({menu:r,datasets:i.datasets}).onSync("suggestionClicked",this._onSuggestionClicked,this).onSync("cursorMoved",this._onCursorMoved,this).onSync("cursorRemoved",this._onCursorRemoved,this).onSync("opened",this._onOpened,this).onSync("closed",this._onClosed,this).onAsync("datasetRendered",this._onDatasetRendered,this);this.input=new o({input:u,hint:f}).onSync("focused",this._onFocused,this).onSync("blurred",this._onBlurred,this).onSync("enterKeyed",this._onEnterKeyed,this).onSync("tabKeyed",this._onTabKeyed,this).onSync("escKeyed",this._onEscKeyed,this).onSync("upKeyed",this._onUpKeyed,this).onSync("downKeyed",this._onDownKeyed,this).onSync("leftKeyed",this._onLeftKeyed,this).onSync("rightKeyed",this._onRightKeyed,this).onSync("queryChanged",this._onQueryChanged,this).onSync("whitespaceChanged",this._onWhitespaceChanged,this);this._setLanguageDirection()}function s(t,f){var e,s,h,o;e=n(t);s=n(r.wrapper).css(i.wrapper);h=n(r.dropdown).css(i.dropdown);o=e.clone().css(i.hint).css(c(e));o.val("").removeData().addClass("tt-hint").removeAttr("id name placeholder").prop("disabled",!0).attr({autocomplete:"off",spellcheck:"false"});e.data(u,{dir:e.attr("dir"),autocomplete:e.attr("autocomplete"),spellcheck:e.attr("spellcheck"),style:e.attr("style")});e.addClass("tt-input").attr({autocomplete:"off",spellcheck:!1}).css(f?i.input:i.inputWithNoHint);try{e.attr("dir")||e.attr("dir","auto")}catch(l){}return e.wrap(s).parent().prepend(f?o:null).append(h)}function c(n){return{backgroundAttachment:n.css("background-attachment"),backgroundClip:n.css("background-clip"),backgroundColor:n.css("background-color"),backgroundImage:n.css("background-image"),backgroundOrigin:n.css("background-origin"),backgroundPosition:n.css("background-position"),backgroundRepeat:n.css("background-repeat"),backgroundSize:n.css("background-size")}}function l(n){var i=n.find(".tt-input");t.each(i.data(u),function(n,r){t.isUndefined(n)?i.removeAttr(r):i.attr(r,n)});i.detach().removeData(u).removeClass("tt-input").insertAfter(n);n.remove()}var u="ttAttrs";return t.mixin(f.prototype,{_onSuggestionClicked:function(n,t){var i;(i=this.dropdown.getDatumForSuggestion(t))&&this._select(i)},_onCursorMoved:function(){var n=this.dropdown.getDatumForCursor();this.input.setInputValue(n.value,!0);this.eventBus.trigger("cursorchanged",n.raw,n.datasetName)},_onCursorRemoved:function(){this.input.resetInputValue();this._updateHint()},_onDatasetRendered:function(){this._updateHint()},_onOpened:function(){this._updateHint();this.eventBus.trigger("opened")},_onClosed:function(){this.input.clearHint();this.eventBus.trigger("closed")},_onFocused:function(){this.isActivated=!0;this.dropdown.open()},_onBlurred:function(){this.isActivated=!1;this.dropdown.empty();this.dropdown.close()},_onEnterKeyed:function(n,t){var i,r;i=this.dropdown.getDatumForCursor();r=this.dropdown.getDatumForTopSuggestion();i?(this._select(i),t.preventDefault()):this.autoselect&&r&&(this._select(r),t.preventDefault())},_onTabKeyed:function(n,t){var i;(i=this.dropdown.getDatumForCursor())?(this._select(i),t.preventDefault()):this._autocomplete(!0)},_onEscKeyed:function(){this.dropdown.close();this.input.resetInputValue()},_onUpKeyed:function(){var n=this.input.getQuery();this.dropdown.isEmpty&&n.length>=this.minLength?this.dropdown.update(n):this.dropdown.moveCursorUp();this.dropdown.open()},_onDownKeyed:function(){var n=this.input.getQuery();this.dropdown.isEmpty&&n.length>=this.minLength?this.dropdown.update(n):this.dropdown.moveCursorDown();this.dropdown.open()},_onLeftKeyed:function(){"rtl"===this.dir&&this._autocomplete()},_onRightKeyed:function(){"ltr"===this.dir&&this._autocomplete()},_onQueryChanged:function(n,t){this.input.clearHintIfInvalid();t.length>=this.minLength?this.dropdown.update(t):this.dropdown.empty();this.dropdown.open();this._setLanguageDirection()},_onWhitespaceChanged:function(){this._updateHint();this.dropdown.open()},_setLanguageDirection:function(){var n;this.dir!==(n=this.input.getLanguageDirection())&&(this.dir=n,this.$node.css("direction",n),this.dropdown.setLanguageDirection(n))},_updateHint:function(){var n,i,u,f,e,r;n=this.dropdown.getDatumForTopSuggestion();n&&this.dropdown.isVisible()&&!this.input.hasOverflow()?(i=this.input.getInputValue(),u=o.normalizeQuery(i),f=t.escapeRegExChars(u),e=new RegExp("^(?:"+f+")(.+$)","i"),r=e.exec(n.value),r?this.input.setHint(i+r[1]):this.input.clearHint()):this.input.clearHint()},_autocomplete:function(n){var i,r,u,t;i=this.input.getHint();r=this.input.getQuery();u=n||this.input.isCursorAtEnd();i&&r!==i&&u&&(t=this.dropdown.getDatumForTopSuggestion(),t&&this.input.setInputValue(t.value),this.eventBus.trigger("autocompleted",t.raw,t.datasetName))},_select:function(n){this.input.setQuery(n.value);this.input.setInputValue(n.value,!0);this._setLanguageDirection();this.eventBus.trigger("selected",n.raw,n.datasetName);this.dropdown.close();t.defer(t.bind(this.dropdown.empty,this.dropdown))},open:function(){this.dropdown.open()},close:function(){this.dropdown.close()},setVal:function(n){this.isActivated?this.input.setInputValue(n):(this.input.setQuery(n),this.input.setInputValue(n,!0));this._setLanguageDirection()},getVal:function(){return this.input.getQuery()},destroy:function(){this.input.destroy();this.dropdown.destroy();l(this.$node);this.$node=null}}),f}();!function(){var u,i,r;u=n.fn.typeahead;i="ttTypeahead";r={initialize:function(r,u){function f(){var s,o,f=n(this);t.each(u,function(n){n.highlight=!!r.highlight});o=new c({input:f,eventBus:s=new e({el:f}),withHint:t.isUndefined(r.hint)?!0:!!r.hint,minLength:r.minLength,autoselect:r.autoselect,datasets:u});f.data(i,o)}return u=t.isArray(u)?u:[].slice.call(arguments,1),r=r||{},this.each(f)},open:function(){function t(){var t,r=n(this);(t=r.data(i))&&t.open()}return this.each(t)},close:function(){function t(){var t,r=n(this);(t=r.data(i))&&t.close()}return this.each(t)},val:function(t){function r(){var r,u=n(this);(r=u.data(i))&&r.setVal(t)}function u(n){var t,r;return(t=n.data(i))&&(r=t.getVal()),r}return arguments.length?this.each(r):u(this.first())},destroy:function(){function t(){var t,r=n(this);(t=r.data(i))&&(t.destroy(),r.removeData(i))}return this.each(t)}};n.fn.typeahead=function(n){return r[n]?r[n].apply(this,[].slice.call(arguments,1)):r.initialize.apply(this,arguments)};n.fn.typeahead.noConflict=function(){return n.fn.typeahead=u,this}}()}(window.jQuery),function(n){function r(){var n=document.createElement("input"),t="onpaste";return n.setAttribute(t,""),"function"==typeof n[t]?"paste":"input"}var t,u=r()+".mask",i=navigator.userAgent,f=/iphone/i.test(i),e=/android/i.test(i);n.mask={definitions:{9:"[0-9]",a:"[A-Za-z]","*":"[A-Za-z0-9]"},dataName:"rawMaskFn",placeholder:"_"};n.fn.extend({caret:function(n,t){var i;if(0!==this.length&&!this.is(":hidden"))return"number"==typeof n?(t="number"==typeof t?t:n,this.each(function(){this.setSelectionRange?this.setSelectionRange(n,t):this.createTextRange&&(i=this.createTextRange(),i.collapse(!0),i.moveEnd("character",t),i.moveStart("character",n),i.select())})):(this[0].setSelectionRange?(n=this[0].selectionStart,t=this[0].selectionEnd):document.selection&&document.selection.createRange&&(i=document.selection.createRange(),n=0-i.duplicate().moveStart("character",-1e5),t=n+i.text.length),{begin:n,end:t})},unmask:function(){return this.trigger("unmask")},mask:function(i,r){var a,l,o,h,c,s;return!i&&this.length>0?(a=n(this[0]),a.data(n.mask.dataName)()):(r=n.extend({placeholder:n.mask.placeholder,completed:null},r),l=n.mask.definitions,o=[],h=s=i.length,c=null,n.each(i.split(""),function(n,t){"?"==t?(s--,h=n):l[t]?(o.push(RegExp(l[t])),null===c&&(c=o.length-1)):o.push(null)}),this.trigger("unmask").each(function(){function y(n){for(;s>++n&&!o[n];);return n}function g(n){for(;--n>=0&&!o[n];);return n}function d(n,t){var u,i;if(!(0>n)){for(u=n,i=y(t);s>u;u++)if(o[u]){if(!(s>i&&o[u].test(v[i])))break;v[u]=v[i];v[i]=r.placeholder;i=y(i)}p();a.caret(Math.max(c,n))}}function nt(n){for(var u,f,t=n,i=r.placeholder;s>t;t++)if(o[t]){if(u=y(t),f=v[t],v[t]=i,!(s>u&&o[u].test(f)))break;i=f}}function tt(n){var u,i,t,r=n.which;8===r||46===r||f&&127===r?(u=a.caret(),i=u.begin,t=u.end,0==t-i&&(i=46!==r?g(i):t=y(i-1),t=46===r?y(t):t),b(i,t),d(i,t-1),n.preventDefault()):27==r&&(a.val(k),a.caret(0,w()),n.preventDefault())}function it(t){var u,h,f,c=t.which,i=a.caret();t.ctrlKey||t.altKey||t.metaKey||32>c||c&&(0!=i.end-i.begin&&(b(i.begin,i.end),d(i.begin,i.end-1)),u=y(i.begin-1),s>u&&(h=String.fromCharCode(c),o[u].test(h)&&(nt(u),v[u]=h,p(),f=y(u),e?setTimeout(n.proxy(n.fn.caret,a,f),0):a.caret(f),r.completed&&f>=s&&r.completed.call(a))),t.preventDefault())}function b(n,t){for(var i=n;t>i&&s>i;i++)o[i]&&(v[i]=r.placeholder)}function p(){a.val(v.join(""))}function w(n){var t,f,i=a.val(),u=-1;for(t=0,pos=0;s>t;t++)if(o[t]){for(v[t]=r.placeholder;pos++<i.length;)if(f=i.charAt(pos-1),o[t].test(f)){v[t]=f;u=t;break}if(pos>i.length)break}else v[t]===i.charAt(pos)&&t!==h&&(pos++,u=t);return n?p():h>u+1?(a.val(""),b(0,s)):(p(),a.val(a.val().substring(0,u+1))),h?t:c}var a=n(this),v=n.map(i.split(""),function(n){if("?"!=n)return l[n]?r.placeholder:n}),k=a.val();a.data(n.mask.dataName,function(){return n.map(v,function(n,t){return o[t]&&n!=r.placeholder?n:null}).join("")});a.attr("readonly")||a.one("unmask",function(){a.unbind(".mask").removeData(n.mask.dataName)}).bind("focus.mask",function(){clearTimeout(t);var n;k=a.val();n=w();t=setTimeout(function(){p();n==i.length?a.caret(0,n):a.caret(n)},10)}).bind("blur.mask",function(){w();a.val()!=k&&a.change()}).bind("keydown.mask",tt).bind("keypress.mask",it).bind(u,function(){setTimeout(function(){var n=w(!0);a.caret(n);r.completed&&n==a.val().length&&r.completed.call(a)},0)});w()}))}})}(jQuery);fadeSpeed="slow";timeDelay=3e3;$(document).ready(function(){function i(){$(this).val()===""&&$(this).val($(this).attr("placeholder")).addClass("placeholder")}function r(){$(this).val()===$(this).attr("placeholder")&&$(this).val("").removeClass("placeholder")}var u=navigator.userAgent.toLowerCase(),f=u.indexOf("android")>-1,n,t;$(":input").prop("autocomplete","no");$(".date-input,.input-group.date>input[type='text']").attr("maxlength","10");$(".date-input,.input-group.date>input[type='text']").attr("onfocus","this.placeholder=''");$(".date-input,.input-group.date>input[type='text']").attr("onblur","this.placeholder='GG/MM/AAAA'");f?$(".phoneMask>input[type='tel']").keyup(function(n){var t,i;console.log(n.keyCode);n.keyCode!=193&&n.keyCode!=111?n.keyCode!=8?$(this).val().length==3&&$(this).val($(this).val()+"-"):(t=$(this).val(),$(this).val().length==3&&$(this).val(t.substring(0,$(this).val().length-1))):(t=$(this).val(),i=$(this).val().length,$(this).val(t.substring(0,i-1)))}):$(".phoneMask>input[type='tel']").keyup(function(n){var t,i;console.log(n.keyCode);n.keyCode!=193&&n.keyCode!=111?n.keyCode!=8?$(this).val().length==3&&$(this).val($(this).val()+"-"):(t=$(this).val(),$(this).val().length==3&&$(this).val(t.substring(0,$(this).val().length-1))):(t=$(this).val(),i=$(this).val().length,$(this).val(t.substring(0,i-1)))});$(".button-group").each(function(){var n=$(this).data("group-id");$(this).click(function(){$('.button-group[data-group-id="'+n+'"]').removeClass("active");$(this).addClass("active");$(this).siblings('input[type="hidden"]').val($(this).data("value")).triggerHandler("change");$(this).closest(".panel.error").removeClass("error");var t=$(document).find("form").find("[data-valmsg-for='"+n+"']");t.hide()})});$("body").on("click",function(n){$(".pop").each(function(){$(this).is(n.target)||$(this).has(n.target).length!==0||$(".popover").has(n.target).length!==0||$(this).popover("hide")})});$("select:not(.zuco-search)").chosen({disable_search:!0});$("select.zuco-search").chosen({no_results_text:"Nessun risultato."});$(".chosen-search").remove();SetCalendar();popOverDisplay();$(window).resize(function(){$(".pop").popover("hide")});$('.handle-convenzione [type="text"]').on("keyup",function(){var n=$(".handle-convenzione").find('[type="button"].applica');val=$(this).val();val.length>0?n.attr("disabled",!1):n.attr("disabled",!0)});$('.handle-convenzione [type="text"]').on("keyup",function(){var n=$(".handle-convenzione").find('[type="button"].applica');val=$(this).val();val.length>0?n.attr("disabled",!1):n.attr("disabled",!0);n.val("APPLICA CODICE")});if($(".checkbox input, .radio input").iCheck({checkboxClass:"icheckbox_zuco",radioClass:"iradio_zuco",increaseArea:"20%"}),"placeholder"in $("<input>")[0]||($("input[placeholder], textarea[placeholder]").blur(i).focus(r).each(i),$("form").submit(function(){$(this).find("input[placeholder], textarea[placeholder]").each(r)})),setLinksToIngoreTabIndex(),n=window.location.hash,$(n).length>0){t=0;isBreakpoint("xs")||$("#sticky-banner").length>0&&(t+=$("#sticky-banner").outerHeight());t+=$("[href='"+n+"']").outerHeight();$(n).one("shown.bs.collapse",function(){$("html, body").animate({scrollTop:$(n).offset().top-t})});$(n).hasClass("collapse")&&$(n).collapse("show")}$("ol.stepper").each(function(){var n=1;$(this).children().each(function(){$(this).children(".orange-circle").children(".vertical-middle").html(n);n++})})});SendToOTP=!1;userOtpBlocked=!1;$.fn.serializeDraft=function(){var n={},t=this.serializeArray();return $.each(t,function(){n[this.name]?(n[this.name].push||(n[this.name]=[n[this.name]]),n[this.name].push(this.value||"")):n[this.name]=this.value||""}),n};controllersSalvaBozza=["DatiPolizza","DatiPolizzaMoto","DatiPolizzaVans","DatiPolizzaCasa","DatiAnagrafici","DatiAnagraficiMoto","DatiAnagraficiVans","DatiAbitazione","DatiVeicolo","DatiVeicoloMoto","DatiVeicoloVans","StoriaAssicurativaVans","StoriaAssicurativa"];controllersPolizza=["DatiPolizza","DatiPolizzaMoto","DatiPolizzaVans","DatiPolizzaCasa"];$(document).on("OnCtrlCreated",OnCtrlCreatedHandler);$(document).on("OnConvenzioneModified",OnConvenzioneModified);var flagConvenzioneOk=!1,ControllerOK=!1,DocumentReady=!1,ControllerOK2=!1;$(document).ready(function(){var n;if($(".modal-salvataggio-radio .radio-container input").change(function(){$(".modal-salvataggio-radio",$(this).parents(".modalAlert")).removeClass("active");$(".input-email-address").removeClass("error");var n=$(this).parents(".modal-salvataggio-radio");$("input",n).removeAttr("disabled");n.addClass("active");$(".submit-email").parents(".modal-salvataggio-radio").hasClass("active")&&getUserEmail()}),$(".modal-salvataggio-action.submit-email").click(function(n){n.preventDefault();/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test($(".input-email-address").val())?$(".input-email-address").removeClass("error"):$(".input-email-address").addClass("error")}),$(".input-email-address").keyup(function(){$(this).removeClass("error");AddHiddenClass('#ins-email div[id="redAlert"]')}),n=are_cookies_enabled(),n)DocumentReady=!0,verifySaveInDraftEnabled();else if(window.location.href.indexOf("Error")>0)$(".modal-body").html('<p><em>La pagina non è più disponibile perchè sono stati disabilitati i cookie tecnici di sessione. Ti consigliamo di riabilitarli per consentire la normale navigazione del sito.<\/em><a href="/Cookies/" class="link back">TORNA ALLA PAGINA COOKIE<\/a><\/p>')});$.ajaxSetup({beforeSend:function(n){securityToken=$("[name=__RequestVerificationToken]").val();n.setRequestHeader("__RequestVerificationToken",securityToken)},statusCode:{502:function(){window.location.href="/Error/Index"},400:function(){window.location.href="/CustomError/Index"}}});Swiper=function(n,t){function h(n,t){return document.querySelectorAll?(t||document).querySelectorAll(n):jQuery(n,t)}function oi(n){"use strict";return Object.prototype.toString.apply(n)==="[object Array]"?!0:!1}function f(){var n=v-u;return t.freeMode&&(n=v-u),t.slidesPerView>i.slides.length&&(n=0),n<0&&(n=0),n}function si(){function f(n){var r=new Image;r.onload=function(){i.imagesLoaded++;i.imagesLoaded==i.imagesToLoad.length&&(i.reInit(),t.onImagesReady&&i.fireCallback(t.onImagesReady,i))};r.src=n}var n=i.h.addEventListener,r=t.eventTarget=="wrapper"?i.wrapper:i.container,u;if(i.browser.ie10||i.browser.ie11?(n(r,i.touchEvents.touchStart,w),n(document,i.touchEvents.touchMove,b),n(document,i.touchEvents.touchEnd,k)):(i.support.touch&&(n(r,"touchstart",w),n(r,"touchmove",b),n(r,"touchend",k)),t.simulateTouch&&(n(r,"mousedown",w),n(document,"mousemove",b),n(document,"mouseup",k))),t.autoResize&&n(window,"resize",i.resizeFix),wt(),i._wheelEvent=!1,t.mousewheelControl){document.onmousewheel!==undefined&&(i._wheelEvent="mousewheel");try{WheelEvent("wheel");i._wheelEvent="wheel"}catch(e){}i._wheelEvent||(i._wheelEvent="DOMMouseScroll");i._wheelEvent&&n(i.container,i._wheelEvent,dt)}if(t.keyboardControl&&n(document,"keydown",kt),t.updateOnImagesReady)for(i.imagesToLoad=h("img",i.container),u=0;u<i.imagesToLoad.length;u++)f(i.imagesToLoad[u].getAttribute("src"))}function wt(){var r=i.h.addEventListener,n,u,f;if(t.preventLinks)for(u=h("a",i.container),n=0;n<u.length;n++)r(u[n],"click",ii);if(t.releaseFormElements)for(f=h("input, textarea, select",i.container),n=0;n<f.length;n++)r(f[n],i.touchEvents.touchStart,ri,!0);if(t.onSlideClick)for(n=0;n<i.slides.length;n++)r(i.slides[n],"click",gt);if(t.onSlideTouch)for(n=0;n<i.slides.length;n++)r(i.slides[n],i.touchEvents.touchStart,ni)}function bt(){var r=i.h.removeEventListener,n,u,f;if(t.onSlideClick)for(n=0;n<i.slides.length;n++)r(i.slides[n],"click",gt);if(t.onSlideTouch)for(n=0;n<i.slides.length;n++)r(i.slides[n],i.touchEvents.touchStart,ni);if(t.releaseFormElements)for(u=h("input, textarea, select",i.container),n=0;n<u.length;n++)r(u[n],i.touchEvents.touchStart,ri,!0);if(t.preventLinks)for(f=h("a",i.container),n=0;n<f.length;n++)r(f[n],"click",ii)}function kt(n){var t=n.keyCode||n.charCode,e,f;if(t==37||t==39||t==38||t==40){var o=!1,u=i.h.getOffset(i.container),s=i.h.windowScroll().left,h=i.h.windowScroll().top,l=i.h.windowWidth(),a=i.h.windowHeight(),c=[[u.left,u.top],[u.left+i.width,u.top],[u.left,u.top+i.height],[u.left+i.width,u.top+i.height]];for(e=0;e<c.length;e++)f=c[e],f[0]>=s&&f[0]<=s+l&&f[1]>=h&&f[1]<=h+a&&(o=!0);if(!o)return}r?((t==37||t==39)&&(n.preventDefault?n.preventDefault():n.returnValue=!1),t==39&&i.swipeNext(),t==37&&i.swipePrev()):((t==38||t==40)&&(n.preventDefault?n.preventDefault():n.returnValue=!1),t==40&&i.swipeNext(),t==38&&i.swipePrev())}function dt(n){var o=i._wheelEvent,u=0,e;if(n.detail)u=-n.detail;else if(o=="mousewheel")if(t.mousewheelControlForceToAxis)if(r)if(Math.abs(n.wheelDeltaX)>Math.abs(n.wheelDeltaY))u=n.wheelDeltaX;else return;else if(Math.abs(n.wheelDeltaY)>Math.abs(n.wheelDeltaX))u=n.wheelDeltaY;else return;else u=n.wheelDelta;else if(o=="DOMMouseScroll")u=-n.detail;else if(o=="wheel")if(t.mousewheelControlForceToAxis)if(r)if(Math.abs(n.deltaX)>Math.abs(n.deltaY))u=-n.deltaX;else return;else if(Math.abs(n.deltaY)>Math.abs(n.deltaX))u=-n.deltaY;else return;else u=Math.abs(n.deltaX)>Math.abs(n.deltaY)?-n.deltaX:-n.deltaY;if(t.freeMode){if(e=i.getWrapperTranslate()+u,e>0&&(e=0),e<-f()&&(e=-f()),i.setWrapperTransition(0),i.setWrapperTranslate(e),i.updateActiveSlide(e),e==0||e==-f())return}else(new Date).getTime()-yt>60&&(u<0?i.swipeNext():i.swipePrev()),yt=(new Date).getTime();return t.autoplay&&i.stopAutoplay(!0),n.preventDefault?n.preventDefault():n.returnValue=!1,!1}function gt(n){i.allowSlideClick&&(ti(n),i.fireCallback(t.onSlideClick,i,n))}function ni(n){ti(n);i.fireCallback(t.onSlideTouch,i,n)}function ti(n){if(n.currentTarget)i.clickedSlide=n.currentTarget;else{var r=n.srcElement;do if(r.className.indexOf(t.slideClass)>-1)break;while(r=r.parentNode);i.clickedSlide=r}i.clickedSlideIndex=i.slides.indexOf(i.clickedSlide);i.clickedSlideLoopIndex=i.clickedSlideIndex-(i.loopedSlides||0)}function ii(n){if(!i.allowLinks)return n.preventDefault?n.preventDefault():n.returnValue=!1,t.preventLinksPropagation&&"stopPropagation"in n&&n.stopPropagation(),!1}function ri(n){return n.stopPropagation?n.stopPropagation():n.returnValue=!1,!1}function w(n){if((t.preventLinks&&(i.allowLinks=!0),i.isTouched||t.onlyExternal)||t.noSwiping&&(n.target||n.srcElement)&&hi(n.target||n.srcElement))return!1;if(it=!1,thresholdFirstMove=!1,i.isTouched=!0,l=n.type=="touchstart",!l||n.targetTouches.length==1){i.callPlugins("onTouchStartBegin");l||i.isAndroid||(n.preventDefault?n.preventDefault():n.returnValue=!1);var u=l?n.targetTouches[0].pageX:n.pageX||n.clientX,f=l?n.targetTouches[0].pageY:n.pageY||n.clientY;i.touches.startX=i.touches.currentX=u;i.touches.startY=i.touches.currentY=f;i.touches.start=i.touches.current=r?u:f;i.setWrapperTransition(0);i.positions.start=i.positions.current=i.getWrapperTranslate();i.setWrapperTranslate(i.positions.start);i.times.start=(new Date).getTime();a=undefined;t.moveStartThreshold>0&&(st=!1);t.onTouchStart&&i.fireCallback(t.onTouchStart,i);i.callPlugins("onTouchStartEnd")}}function b(n){var o,s,e;if(i.isTouched&&!t.onlyExternal&&(!l||n.type!="mousemove")){if(o=l?n.targetTouches[0].pageX:n.pageX||n.clientX,s=l?n.targetTouches[0].pageY:n.pageY||n.clientY,typeof a=="undefined"&&r&&(a=!!(a||Math.abs(s-i.touches.startY)>Math.abs(o-i.touches.startX))),typeof a!="undefined"||r||(a=!!(a||Math.abs(s-i.touches.startY)<Math.abs(o-i.touches.startX))),a){i.isTouched=!1;return}if(n.assignedToSwiper){i.isTouched=!1;return}if(n.assignedToSwiper=!0,t.preventLinks&&(i.allowLinks=!1),t.onSlideClick&&(i.allowSlideClick=!1),t.autoplay&&i.stopAutoplay(!0),!l||n.touches.length==1){if(i.isMoved||(i.callPlugins("onTouchMoveStart"),t.loop&&(i.fixLoop(),i.positions.start=i.getWrapperTranslate()),t.onTouchMoveStart&&i.fireCallback(t.onTouchMoveStart,i)),i.isMoved=!0,n.preventDefault?n.preventDefault():n.returnValue=!1,i.touches.current=r?o:s,i.positions.current=(i.touches.current-i.touches.start)*t.touchRatio+i.positions.start,i.positions.current>0&&t.onResistanceBefore&&i.fireCallback(t.onResistanceBefore,i,i.positions.current),i.positions.current<-f()&&t.onResistanceAfter&&i.fireCallback(t.onResistanceAfter,i,Math.abs(i.positions.current+f())),t.resistance&&t.resistance!="100%"&&(i.positions.current>0&&(e=1-i.positions.current/u/2,i.positions.current=e<.5?u/2:i.positions.current*e),i.positions.current<-f())){var h=(i.touches.current-i.touches.start)*t.touchRatio+(f()+i.positions.start),e=(u+h)/u,c=i.positions.current-h*(1-e)/2,v=-f()-u/2;i.positions.current=c<v||e<=0?v:c}if(t.resistance&&t.resistance=="100%"&&(i.positions.current>0&&!(t.freeMode&&!t.freeModeFluid)&&(i.positions.current=0),i.positions.current<-f()&&!(t.freeMode&&!t.freeModeFluid)&&(i.positions.current=-f())),!t.followFinger)return;if(t.moveStartThreshold)if(Math.abs(i.touches.current-i.touches.start)>t.moveStartThreshold||st){if(!st){st=!0;i.touches.start=i.touches.current;return}i.setWrapperTranslate(i.positions.current)}else i.positions.current=i.positions.start;else i.setWrapperTranslate(i.positions.current);return(t.freeMode||t.watchActiveIndex)&&i.updateActiveSlide(i.positions.current),t.grabCursor&&(i.container.style.cursor="move",i.container.style.cursor="grabbing",i.container.style.cursor="-moz-grabbin",i.container.style.cursor="-webkit-grabbing"),rt||(rt=i.touches.current),ht||(ht=(new Date).getTime()),i.velocity=(i.touches.current-rt)/((new Date).getTime()-ht)/2,Math.abs(i.touches.current-rt)<2&&(i.velocity=0),rt=i.touches.current,ht=(new Date).getTime(),i.callPlugins("onTouchMoveEnd"),t.onTouchMove&&i.fireCallback(t.onTouchMove,i),!1}}}function k(){var o,s,g,b,k,l;if(a&&i.swipeReset(),!t.onlyExternal&&i.isTouched){i.isTouched=!1;t.grabCursor&&(i.container.style.cursor="move",i.container.style.cursor="grab",i.container.style.cursor="-moz-grab",i.container.style.cursor="-webkit-grab");i.positions.current||i.positions.current===0||(i.positions.current=i.positions.start);t.followFinger&&i.setWrapperTranslate(i.positions.current);i.times.end=(new Date).getTime();i.touches.diff=i.touches.current-i.touches.start;i.touches.abs=Math.abs(i.touches.diff);i.positions.diff=i.positions.current-i.positions.start;i.positions.abs=Math.abs(i.positions.diff);var nt=i.positions.diff,h=i.positions.abs,c=i.times.end-i.times.start;if(h<5&&c<300&&i.allowLinks==!1&&(t.freeMode||h==0||i.swipeReset(),t.preventLinks&&(i.allowLinks=!0),t.onSlideClick&&(i.allowSlideClick=!0)),setTimeout(function(){t.preventLinks&&(i.allowLinks=!0);t.onSlideClick&&(i.allowSlideClick=!0)},100),o=f(),!i.isMoved&&t.freeMode){i.isMoved=!1;t.onTouchEnd&&i.fireCallback(t.onTouchEnd,i);i.callPlugins("onTouchEnd");return}if(!i.isMoved||i.positions.current>0||i.positions.current<-o){i.swipeReset();t.onTouchEnd&&i.fireCallback(t.onTouchEnd,i);i.callPlugins("onTouchEnd");return}if(i.isMoved=!1,t.freeMode){if(t.freeModeFluid){var y=1e3*t.momentumRatio,tt=i.velocity*y,n=i.positions.current+tt,p=!1,w,v=Math.abs(i.velocity)*20*t.momentumBounceRatio;n<-o&&(t.momentumBounce&&i.support.transitions?(n+o<-v&&(n=-o-v),w=-o,p=!0,it=!0):n=-o);n>0&&(t.momentumBounce&&i.support.transitions?(n>v&&(n=v),w=0,p=!0,it=!0):n=0);i.velocity!=0&&(y=Math.abs((n-i.positions.current)/i.velocity));i.setWrapperTranslate(n);i.setWrapperTransition(y);t.momentumBounce&&p&&i.wrapperTransitionEnd(function(){it&&(t.onMomentumBounce&&i.fireCallback(t.onMomentumBounce,i),i.callPlugins("onMomentumBounce"),i.setWrapperTranslate(w),i.setWrapperTransition(300))});i.updateActiveSlide(n)}(!t.freeModeFluid||c>=300)&&i.updateActiveSlide(i.positions.current);t.onTouchEnd&&i.fireCallback(t.onTouchEnd,i);i.callPlugins("onTouchEnd");return}if(d=nt<0?"toNext":"toPrev",d=="toNext"&&c<=300&&(h<30||!t.shortSwipes?i.swipeReset():i.swipeNext(!0)),d=="toPrev"&&c<=300&&(h<30||!t.shortSwipes?i.swipeReset():i.swipePrev(!0)),s=0,t.slidesPerView=="auto"){for(g=Math.abs(i.getWrapperTranslate()),b=0,l=0;l<i.slides.length;l++)if(k=r?i.slides[l].getWidth(!0):i.slides[l].getHeight(!0),b+=k,b>g){s=k;break}s>u&&(s=u)}else s=e*t.slidesPerView;d=="toNext"&&c>300&&(h>=s*t.longSwipesRatio?i.swipeNext(!0):i.swipeReset());d=="toPrev"&&c>300&&(h>=s*t.longSwipesRatio?i.swipePrev(!0):i.swipeReset());t.onTouchEnd&&i.fireCallback(t.onTouchEnd,i);i.callPlugins("onTouchEnd")}}function hi(n){var i=!1;do n.className.indexOf(t.noSwipingClass)>-1&&(i=!0),n=n.parentElement;while(!i&&n.parentElement&&n.className.indexOf(t.wrapperClass)==-1);return!i&&n.className.indexOf(t.wrapperClass)>-1&&n.className.indexOf(t.noSwipingClass)>-1&&(i=!0),i}function ui(n,t){var r=document.createElement("div"),i;return r.innerHTML=t,i=r.firstChild,i.className+=" "+n,i.outerHTML}function ct(n,r,u){function h(){var r=+new Date,u=r-c;f+=l*u/(1e3/60);s=o=="toNext"?f>n:f<n;s?(i.setWrapperTranslate(Math.round(f)),i._DOMAnimating=!0,window.setTimeout(function(){h()},1e3/60)):(t.onSlideChangeEnd&&i.fireCallback(t.onSlideChangeEnd,i),i.setWrapperTranslate(n),i._DOMAnimating=!1)}var e=r=="to"&&u.speed>=0?u.speed:t.speed,c=+new Date;if(i.support.transitions||!t.DOMAnimation)i.setWrapperTranslate(n),i.setWrapperTransition(e);else{var f=i.getWrapperTranslate(),l=Math.ceil((n-f)/e*(1e3/60)),o=f>n?"toNext":"toPrev",s=o=="toNext"?f>n:f<n;if(i._DOMAnimating)return;h()}i.updateActiveSlide(n);t.onSlideNext&&r=="next"&&i.fireCallback(t.onSlideNext,i,n);t.onSlidePrev&&r=="prev"&&i.fireCallback(t.onSlidePrev,i,n);t.onSlideReset&&r=="reset"&&i.fireCallback(t.onSlideReset,i,n);(r=="next"||r=="prev"||r=="to"&&u.runCallbacks==!0)&&ci(r)}function ci(n){if(i.callPlugins("onSlideChangeStart"),t.onSlideChangeStart)if(t.queueStartCallbacks&&i.support.transitions){if(i._queueStartCallbacks)return;i._queueStartCallbacks=!0;i.fireCallback(t.onSlideChangeStart,i,n);i.wrapperTransitionEnd(function(){i._queueStartCallbacks=!1})}else i.fireCallback(t.onSlideChangeStart,i,n);if(t.onSlideChangeEnd)if(i.support.transitions)if(t.queueEndCallbacks){if(i._queueEndCallbacks)return;i._queueEndCallbacks=!0;i.wrapperTransitionEnd(function(r){i.fireCallback(t.onSlideChangeEnd,r,n)})}else i.wrapperTransitionEnd(function(r){i.fireCallback(t.onSlideChangeEnd,r,n)});else t.DOMAnimation||setTimeout(function(){i.fireCallback(t.onSlideChangeEnd,i,n)},10)}function fi(){for(var t=i.paginationButtons,n=0;n<t.length;n++)i.h.removeEventListener(t[n],"click",ei)}function li(){for(var t=i.paginationButtons,n=0;n<t.length;n++)i.h.addEventListener(t[n],"click",ei)}function ei(n){for(var r,f=n.target||n.srcElement,u=i.paginationButtons,t=0;t<u.length;t++)f===u[t]&&(r=t);i.swipeTo(r)}function pt(){o=setTimeout(function(){t.loop?(i.fixLoop(),i.swipeNext(!0)):i.swipeNext(!0)||(t.autoplayStopOnLast?(clearTimeout(o),o=undefined):i.swipeTo(0));i.wrapperTransitionEnd(function(){typeof o!="undefined"&&pt()})},t.autoplay)}function ai(){i.calcSlides();t.loader.slides.length>0&&i.slides.length==0&&i.loadSlides();t.loop&&i.createLoop();i.init();si();t.pagination&&i.createPagination(!0);t.loop||t.initialSlide>0?i.swipeTo(t.initialSlide,0,!1):i.updateActiveSlide(0);t.autoplay&&i.startAutoplay();i.centerIndex=i.activeIndex;t.onSwiperCreated&&i.fireCallback(t.onSwiperCreated,i);i.callPlugins("onSwiperCreated")}var lt,i,ut,e,v,d,a,u,g,c,ft,r,y,p,at,et,nt,ot,vt,yt,tt,l,st,it,rt,ht,o,s;if((document.body.__defineGetter__&&HTMLElement&&(lt=HTMLElement.prototype,lt.__defineGetter__&&lt.__defineGetter__("outerHTML",function(){return(new XMLSerializer).serializeToString(this)})),window.getComputedStyle||(window.getComputedStyle=function(n){return this.el=n,this.getPropertyValue=function(t){var i=/(\-([a-z]){1})/g;return t==="float"&&(t="styleFloat"),i.test(t)&&(t=t.replace(i,function(){return arguments[2].toUpperCase()})),n.currentStyle[t]?n.currentStyle[t]:null},this}),Array.prototype.indexOf||(Array.prototype.indexOf=function(n,t){for(var i=t||0,r=this.length;i<r;i++)if(this[i]===n)return i;return-1}),document.querySelectorAll||window.jQuery)&&typeof n!="undefined"&&(n.nodeType||h(n).length!==0)){i=this;i.touches={start:0,startX:0,startY:0,current:0,currentX:0,currentY:0,diff:0,abs:0};i.positions={start:0,abs:0,diff:0,current:0};i.times={start:0,end:0};i.id=(new Date).getTime();i.container=n.nodeType?n:h(n)[0];i.isTouched=!1;i.isMoved=!1;i.activeIndex=0;i.centerIndex=0;i.activeLoaderIndex=0;i.activeLoopIndex=0;i.previousIndex=null;i.velocity=0;i.snapGrid=[];i.slidesGrid=[];i.imagesToLoad=[];i.imagesLoaded=0;i.wrapperLeft=0;i.wrapperRight=0;i.wrapperTop=0;i.wrapperBottom=0;i.isAndroid=navigator.userAgent.toLowerCase().indexOf("android")>=0;g={eventTarget:"wrapper",mode:"horizontal",touchRatio:1,speed:300,freeMode:!1,freeModeFluid:!1,momentumRatio:1,momentumBounce:!0,momentumBounceRatio:1,slidesPerView:1,slidesPerGroup:1,simulateTouch:!0,followFinger:!0,shortSwipes:!0,longSwipesRatio:.5,moveStartThreshold:!1,onlyExternal:!1,createPagination:!0,pagination:!1,paginationElement:"span",paginationClickable:!1,paginationAsRange:!0,resistance:!0,scrollContainer:!1,preventLinks:!0,preventLinksPropagation:!1,noSwiping:!1,noSwipingClass:"swiper-no-swiping",initialSlide:0,keyboardControl:!1,mousewheelControl:!1,mousewheelControlForceToAxis:!1,useCSS3Transforms:!0,autoplay:!1,autoplayDisableOnInteraction:!0,autoplayStopOnLast:!1,loop:!1,loopAdditionalSlides:0,calculateHeight:!1,cssWidthAndHeight:!1,updateOnImagesReady:!0,releaseFormElements:!0,watchActiveIndex:!1,visibilityFullFit:!1,offsetPxBefore:0,offsetPxAfter:0,offsetSlidesBefore:0,offsetSlidesAfter:0,centeredSlides:!1,queueStartCallbacks:!1,queueEndCallbacks:!1,autoResize:!0,resizeReInit:!1,DOMAnimation:!0,loader:{slides:[],slidesHTMLType:"inner",surroundGroups:1,logic:"reload",loadAllSlides:!1},slideElement:"div",slideClass:"swiper-slide",slideActiveClass:"swiper-slide-active",slideVisibleClass:"swiper-slide-visible",slideDuplicateClass:"swiper-slide-duplicate",wrapperClass:"swiper-wrapper",paginationElementClass:"swiper-pagination-switch",paginationActiveClass:"swiper-active-switch",paginationVisibleClass:"swiper-visible-switch"};t=t||{};for(c in g)if(c in t&&typeof t[c]=="object")for(ft in g[c])ft in t[c]||(t[c][ft]=g[c][ft]);else c in t||(t[c]=g[c]);for(i.params=t,t.scrollContainer&&(t.freeMode=!0,t.freeModeFluid=!0),t.loop&&(t.resistance="100%"),r=t.mode==="horizontal",y=["mousedown","mousemove","mouseup"],i.browser.ie10&&(y=["MSPointerDown","MSPointerMove","MSPointerUp"]),i.browser.ie11&&(y=["pointerdown","pointermove","pointerup"]),i.touchEvents={touchStart:i.support.touch||!t.simulateTouch?"touchstart":y[0],touchMove:i.support.touch||!t.simulateTouch?"touchmove":y[1],touchEnd:i.support.touch||!t.simulateTouch?"touchend":y[2]},p=i.container.childNodes.length-1;p>=0;p--)if(i.container.childNodes[p].className)for(at=i.container.childNodes[p].className.split(" "),et=0;et<at.length;et++)at[et]===t.wrapperClass&&(ut=i.container.childNodes[p]);i.wrapper=ut;i._extendSwiperSlide=function(n){return n.append=function(){return t.loop?n.insertAfter(i.slides.length-i.loopedSlides):(i.wrapper.appendChild(n),i.reInit()),n},n.prepend=function(){return t.loop?(i.wrapper.insertBefore(n,i.slides[i.loopedSlides]),i.removeLoopedSlides(),i.calcSlides(),i.createLoop()):i.wrapper.insertBefore(n,i.wrapper.firstChild),i.reInit(),n},n.insertAfter=function(r){if(typeof r=="undefined")return!1;var u;return t.loop?(u=i.slides[r+1+i.loopedSlides],u?i.wrapper.insertBefore(n,u):i.wrapper.appendChild(n),i.removeLoopedSlides(),i.calcSlides(),i.createLoop()):(u=i.slides[r+1],i.wrapper.insertBefore(n,u)),i.reInit(),n},n.clone=function(){return i._extendSwiperSlide(n.cloneNode(!0))},n.remove=function(){i.wrapper.removeChild(n);i.reInit()},n.html=function(t){return typeof t=="undefined"?n.innerHTML:(n.innerHTML=t,n)},n.index=function(){for(var r,t=i.slides.length-1;t>=0;t--)n===i.slides[t]&&(r=t);return r},n.isActive=function(){return n.index()===i.activeIndex?!0:!1},n.swiperSlideDataStorage||(n.swiperSlideDataStorage={}),n.getData=function(t){return n.swiperSlideDataStorage[t]},n.setData=function(t,i){return n.swiperSlideDataStorage[t]=i,n},n.data=function(t,i){return i?(n.setAttribute("data-"+t,i),n):n.getAttribute("data-"+t)},n.getWidth=function(t){return i.h.getWidth(n,t)},n.getHeight=function(t){return i.h.getHeight(n,t)},n.getOffset=function(){return i.h.getOffset(n)},n};i.calcSlides=function(n){var e=i.slides?i.slides.length:!1,r,o,f,u;for(i.slides=[],i.displaySlides=[],r=0;r<i.wrapper.childNodes.length;r++)if(i.wrapper.childNodes[r].className)for(o=i.wrapper.childNodes[r].className,f=o.split(" "),u=0;u<f.length;u++)f[u]===t.slideClass&&i.slides.push(i.wrapper.childNodes[r]);for(r=i.slides.length-1;r>=0;r--)i._extendSwiperSlide(i.slides[r]);e!==!1&&(e!==i.slides.length||n)&&(bt(),wt(),i.updateActiveSlide(),i.params.pagination&&i.createPagination(),i.callPlugins("numberOfSlidesChanged"))};i.createSlide=function(n,r,u){var r=r||i.params.slideClass,u=u||t.slideElement,f=document.createElement(u);return f.innerHTML=n||"",f.className=r,i._extendSwiperSlide(f)};i.appendSlide=function(n,t,r){if(n)return n.nodeType?i._extendSwiperSlide(n).append():i.createSlide(n,t,r).append()};i.prependSlide=function(n,t,r){if(n)return n.nodeType?i._extendSwiperSlide(n).prepend():i.createSlide(n,t,r).prepend()};i.insertSlideAfter=function(n,t,r,u){return typeof n=="undefined"?!1:t.nodeType?i._extendSwiperSlide(t).insertAfter(n):i.createSlide(t,r,u).insertAfter(n)};i.removeSlide=function(n){if(i.slides[n]){if(t.loop){if(!i.slides[n+i.loopedSlides])return!1;i.slides[n+i.loopedSlides].remove();i.removeLoopedSlides();i.calcSlides();i.createLoop()}else i.slides[n].remove();return!0}return!1};i.removeLastSlide=function(){return i.slides.length>0?(t.loop?(i.slides[i.slides.length-1-i.loopedSlides].remove(),i.removeLoopedSlides(),i.calcSlides(),i.createLoop()):i.slides[i.slides.length-1].remove(),!0):!1};i.removeAllSlides=function(){for(var n=i.slides.length-1;n>=0;n--)i.slides[n].remove()};i.getSlide=function(n){return i.slides[n]};i.getLastSlide=function(){return i.slides[i.slides.length-1]};i.getFirstSlide=function(){return i.slides[0]};i.activeSlide=function(){return i.slides[i.activeIndex]};i.fireCallback=function(){var n=arguments[0],r;if(Object.prototype.toString.call(n)==="[object Array]")for(r=0;r<n.length;r++)typeof n[r]=="function"&&n[r](arguments[1],arguments[2],arguments[3],arguments[4],arguments[5]);else Object.prototype.toString.call(n)==="[object String]"?t["on"+n]&&i.fireCallback(t["on"+n]):n(arguments[1],arguments[2],arguments[3],arguments[4],arguments[5])};i.addCallback=function(n,t){"use strict";var r=this,i;if(r.params["on"+n]){if(oi(this.params["on"+n]))return this.params["on"+n].push(t);if(typeof this.params["on"+n]=="function")return i=this.params["on"+n],this.params["on"+n]=[],this.params["on"+n].push(i),this.params["on"+n].push(t)}else return this.params["on"+n]=[],this.params["on"+n].push(t)};i.removeCallbacks=function(n){if(i.params["on"+n])return i.params["on"+n]=null};nt=[];for(ot in i.plugins)t[ot]&&(vt=i.plugins[ot](i,t[ot]),vt&&nt.push(vt));i.callPlugins=function(n,t){t||(t={});for(var i=0;i<nt.length;i++)n in nt[i]&&nt[i][n](t)};(i.browser.ie10||i.browser.ie11)&&!t.onlyExternal&&i.wrapper.classList.add("swiper-wp8-"+(r?"horizontal":"vertical"));t.freeMode&&(i.container.className+=" swiper-free-mode");i.initialized=!1;i.init=function(n,f){var nt=i.h.getWidth(i.container),tt=i.h.getHeight(i.container),o,k,d,g,b,a,y,h,l,p,w,c,s;if(nt!==i.width||tt!==i.height||n){if(i.width=nt,i.height=tt,u=r?nt:tt,o=i.wrapper,n&&i.calcSlides(f),t.slidesPerView==="auto"){for(k=0,d=0,t.slidesOffset>0&&(o.style.paddingLeft="",o.style.paddingRight="",o.style.paddingTop="",o.style.paddingBottom=""),o.style.width="",o.style.height="",t.offsetPxBefore>0&&(r?i.wrapperLeft=t.offsetPxBefore:i.wrapperTop=t.offsetPxBefore),t.offsetPxAfter>0&&(r?i.wrapperRight=t.offsetPxAfter:i.wrapperBottom=t.offsetPxAfter),t.centeredSlides&&(r?(i.wrapperLeft=(u-this.slides[0].getWidth(!0))/2,i.wrapperRight=(u-i.slides[i.slides.length-1].getWidth(!0))/2):(i.wrapperTop=(u-i.slides[0].getHeight(!0))/2,i.wrapperBottom=(u-i.slides[i.slides.length-1].getHeight(!0))/2)),r?(i.wrapperLeft>=0&&(o.style.paddingLeft=i.wrapperLeft+"px"),i.wrapperRight>=0&&(o.style.paddingRight=i.wrapperRight+"px")):(i.wrapperTop>=0&&(o.style.paddingTop=i.wrapperTop+"px"),i.wrapperBottom>=0&&(o.style.paddingBottom=i.wrapperBottom+"px")),c=0,g=0,i.snapGrid=[],i.slidesGrid=[],y=0,s=0;s<i.slides.length;s++){if(p=i.slides[s].getWidth(!0),h=i.slides[s].getHeight(!0),t.calculateHeight&&(y=Math.max(y,h)),b=r?p:h,t.centeredSlides){var it=s===i.slides.length-1?0:i.slides[s+1].getWidth(!0),rt=s===i.slides.length-1?0:i.slides[s+1].getHeight(!0),ut=r?it:rt;if(b>u){for(a=0;a<=Math.floor(b/(u+i.wrapperLeft));a++)a===0?i.snapGrid.push(c+i.wrapperLeft):i.snapGrid.push(c+i.wrapperLeft+u*a);i.slidesGrid.push(c+i.wrapperLeft)}else i.snapGrid.push(g),i.slidesGrid.push(g);g+=b/2+ut/2}else{if(b>u)for(a=0;a<=Math.floor(b/u);a++)i.snapGrid.push(c+u*a);else i.snapGrid.push(c);i.slidesGrid.push(c)}c+=b;k+=p;d+=h}t.calculateHeight&&(i.height=y);r?(v=k+i.wrapperRight+i.wrapperLeft,o.style.width=k+"px",o.style.height=i.height+"px"):(v=d+i.wrapperTop+i.wrapperBottom,o.style.width=i.width+"px",o.style.height=d+"px")}else if(t.scrollContainer)o.style.width="",o.style.height="",w=i.slides[0].getWidth(!0),l=i.slides[0].getHeight(!0),v=r?w:l,o.style.width=w+"px",o.style.height=l+"px",e=r?w:l;else{if(t.calculateHeight){for(y=0,l=0,r||(i.container.style.height=""),o.style.height="",s=0;s<i.slides.length;s++)i.slides[s].style.height="",y=Math.max(i.slides[s].getHeight(!0),y),r||(l+=i.slides[s].getHeight(!0));h=y;i.height=h;r?l=h:(u=h,i.container.style.height=u+"px")}else h=r?i.height:i.height/t.slidesPerView,l=r?i.height:i.slides.length*h;for(p=r?i.width/t.slidesPerView:i.width,w=r?i.slides.length*p:i.width,e=r?p:h,t.offsetSlidesBefore>0&&(r?i.wrapperLeft=e*t.offsetSlidesBefore:i.wrapperTop=e*t.offsetSlidesBefore),t.offsetSlidesAfter>0&&(r?i.wrapperRight=e*t.offsetSlidesAfter:i.wrapperBottom=e*t.offsetSlidesAfter),t.offsetPxBefore>0&&(r?i.wrapperLeft=t.offsetPxBefore:i.wrapperTop=t.offsetPxBefore),t.offsetPxAfter>0&&(r?i.wrapperRight=t.offsetPxAfter:i.wrapperBottom=t.offsetPxAfter),t.centeredSlides&&(r?(i.wrapperLeft=(u-e)/2,i.wrapperRight=(u-e)/2):(i.wrapperTop=(u-e)/2,i.wrapperBottom=(u-e)/2)),r?(i.wrapperLeft>0&&(o.style.paddingLeft=i.wrapperLeft+"px"),i.wrapperRight>0&&(o.style.paddingRight=i.wrapperRight+"px")):(i.wrapperTop>0&&(o.style.paddingTop=i.wrapperTop+"px"),i.wrapperBottom>0&&(o.style.paddingBottom=i.wrapperBottom+"px")),v=r?w+i.wrapperRight+i.wrapperLeft:l+i.wrapperTop+i.wrapperBottom,t.cssWidthAndHeight||(parseFloat(w)>0&&(o.style.width=w+"px"),parseFloat(l)>0&&(o.style.height=l+"px")),c=0,i.snapGrid=[],i.slidesGrid=[],s=0;s<i.slides.length;s++)i.snapGrid.push(c),i.slidesGrid.push(c),c+=e,t.cssWidthAndHeight||(parseFloat(p)>0&&(i.slides[s].style.width=p+"px"),parseFloat(h)>0&&(i.slides[s].style.height=h+"px"))}i.initialized?(i.callPlugins("onInit"),t.onInit&&i.fireCallback(t.onInit,i)):(i.callPlugins("onFirstInit"),t.onFirstInit&&i.fireCallback(t.onFirstInit,i));i.initialized=!0}};i.reInit=function(n){i.init(!0,n)};i.resizeFix=function(n){i.callPlugins("beforeResizeFix");i.init(t.resizeReInit||n);t.freeMode?i.getWrapperTranslate()<-f()&&(i.setWrapperTransition(0),i.setWrapperTranslate(-f())):(i.swipeTo(t.loop?i.activeLoopIndex:i.activeIndex,0,!1),t.autoplay&&(i.support.transitions&&typeof o!="undefined"?typeof o!="undefined"&&(clearTimeout(o),o=undefined,i.startAutoplay()):typeof s!="undefined"&&(clearInterval(s),s=undefined,i.startAutoplay())));i.callPlugins("afterResizeFix")};i.destroy=function(){var n=i.h.removeEventListener,r=t.eventTarget=="wrapper"?i.wrapper:i.container;i.browser.ie10||i.browser.ie11?(n(r,i.touchEvents.touchStart,w),n(document,i.touchEvents.touchMove,b),n(document,i.touchEvents.touchEnd,k)):(i.support.touch&&(n(r,"touchstart",w),n(r,"touchmove",b),n(r,"touchend",k)),t.simulateTouch&&(n(r,"mousedown",w),n(document,"mousemove",b),n(document,"mouseup",k)));t.autoResize&&n(window,"resize",i.resizeFix);bt();t.paginationClickable&&fi();t.mousewheelControl&&i._wheelEvent&&n(i.container,i._wheelEvent,dt);t.keyboardControl&&n(document,"keydown",kt);t.autoplay&&i.stopAutoplay();i.callPlugins("onDestroy");i=null};yt=(new Date).getTime();t.grabCursor&&(tt=i.container.style,tt.cursor="move",tt.cursor="grab",tt.cursor="-moz-grab",tt.cursor="-webkit-grab");i.allowSlideClick=!0;i.allowLinks=!0;l=!1;it=!0;i.swipeNext=function(n){var u,r,o,s;if(!n&&t.loop&&i.fixLoop(),!n&&t.autoplay&&i.stopAutoplay(!0),i.callPlugins("onSwipeNext"),u=i.getWrapperTranslate(),r=u,t.slidesPerView=="auto"){for(o=0;o<i.snapGrid.length;o++)if(-u>=i.snapGrid[o]&&-u<i.snapGrid[o+1]){r=-i.snapGrid[o+1];break}}else s=e*t.slidesPerGroup,r=-(Math.floor(Math.abs(u)/Math.floor(s))*s+s);return(r<-f()&&(r=-f()),r==u)?!1:(ct(r,"next"),!0)};i.swipePrev=function(n){var f,r,u,o;if(!n&&t.loop&&i.fixLoop(),!n&&t.autoplay&&i.stopAutoplay(!0),i.callPlugins("onSwipePrev"),f=Math.ceil(i.getWrapperTranslate()),t.slidesPerView=="auto")for(r=0,u=1;u<i.snapGrid.length;u++){if(-f==i.snapGrid[u]){r=-i.snapGrid[u-1];break}if(-f>i.snapGrid[u]&&-f<i.snapGrid[u+1]){r=-i.snapGrid[u];break}}else o=e*t.slidesPerGroup,r=-(Math.ceil(-f/o)-1)*o;return(r>0&&(r=0),r==f)?!1:(ct(r,"prev"),!0)};i.swipeReset=function(){var o;i.callPlugins("onSwipeReset");var r=i.getWrapperTranslate(),s=e*t.slidesPerGroup,n,h=-f();if(t.slidesPerView=="auto"){for(n=0,o=0;o<i.snapGrid.length;o++){if(-r===i.snapGrid[o])return;if(-r>=i.snapGrid[o]&&-r<i.snapGrid[o+1]){n=i.positions.diff>0?-i.snapGrid[o+1]:-i.snapGrid[o];break}}-r>=i.snapGrid[i.snapGrid.length-1]&&(n=-i.snapGrid[i.snapGrid.length-1]);r<=-f()&&(n=-f())}else n=r<0?Math.round(r/s)*s:0;return(t.scrollContainer&&(n=r<0?r:0),n<-f()&&(n=-f()),t.scrollContainer&&u>e&&(n=0),n==r)?!1:(ct(n,"reset"),!0)};i.swipeTo=function(n,r,u){var s,o;if(n=parseInt(n,10),i.callPlugins("onSwipeTo",{index:n,speed:r}),t.loop&&(n=n+i.loopedSlides),s=i.getWrapperTranslate(),!(n>i.slides.length-1)&&!(n<0))return(o=t.slidesPerView=="auto"?-i.slidesGrid[n]:-n*e,o<-f()&&(o=-f()),o==s)?!1:(u=u===!1?!1:!0,ct(o,"to",{index:n,speed:r,runCallbacks:u}),!0)};i._queueStartCallbacks=!1;i._queueEndCallbacks=!1;i.updateActiveSlide=function(n){var c,f,o,s,h,r,u;if(i.initialized&&i.slides.length!=0){if(i.previousIndex=i.activeIndex,typeof n=="undefined"&&(n=i.getWrapperTranslate()),n>0&&(n=0),t.slidesPerView=="auto"){if(c=0,i.activeIndex=i.slidesGrid.indexOf(-n),i.activeIndex<0){for(r=0;r<i.slidesGrid.length-1;r++)if(-n>i.slidesGrid[r]&&-n<i.slidesGrid[r+1])break;f=Math.abs(i.slidesGrid[r]+n);o=Math.abs(i.slidesGrid[r+1]+n);i.activeIndex=f<=o?r:r+1}}else i.activeIndex=Math[t.visibilityFullFit?"ceil":"round"](-n/e);if(i.activeIndex==i.slides.length&&(i.activeIndex=i.slides.length-1),i.activeIndex<0&&(i.activeIndex=0),i.slides[i.activeIndex]){for(i.calcVisibleSlides(n),s=new RegExp("\\s*"+t.slideActiveClass),h=new RegExp("\\s*"+t.slideVisibleClass),r=0;r<i.slides.length;r++)i.slides[r].className=i.slides[r].className.replace(s,"").replace(h,""),i.visibleSlides.indexOf(i.slides[r])>=0&&(i.slides[r].className+=" "+t.slideVisibleClass);i.slides[i.activeIndex].className+=" "+t.slideActiveClass;t.loop?(u=i.loopedSlides,i.activeLoopIndex=i.activeIndex-u,i.activeLoopIndex>=i.slides.length-u*2&&(i.activeLoopIndex=i.slides.length-u*2-i.activeLoopIndex),i.activeLoopIndex<0&&(i.activeLoopIndex=i.slides.length-u*2+i.activeLoopIndex),i.activeLoopIndex<0&&(i.activeLoopIndex=0)):i.activeLoopIndex=i.activeIndex;t.pagination&&i.updatePagination(n)}}};i.createPagination=function(n){var r;if(t.paginationClickable&&i.paginationButtons&&fi(),i.paginationContainer=t.pagination.nodeType?t.pagination:h(t.pagination)[0],t.createPagination){var u="",e=i.slides.length,f=e;for(t.loop&&(f-=i.loopedSlides*2),r=0;r<f;r++)u+="<"+t.paginationElement+' class="'+t.paginationElementClass+'"><\/'+t.paginationElement+">";i.paginationContainer.innerHTML=u}i.paginationButtons=h("."+t.paginationElementClass,i.paginationContainer);n||i.updatePagination();i.callPlugins("onCreatePagination");t.paginationClickable&&li()};i.updatePagination=function(n){var o,u,s,e,r,f;if(t.pagination&&!(i.slides.length<1)&&(o=h("."+t.paginationActiveClass,i.paginationContainer),o)&&(u=i.paginationButtons,u.length!=0)){for(r=0;r<u.length;r++)u[r].className=t.paginationElementClass;if(s=t.loop?i.loopedSlides:0,t.paginationAsRange){for(i.visibleSlides||i.calcVisibleSlides(n),e=[],r=0;r<i.visibleSlides.length;r++)f=i.slides.indexOf(i.visibleSlides[r])-s,t.loop&&f<0&&(f=i.slides.length-i.loopedSlides*2+f),t.loop&&f>=i.slides.length-i.loopedSlides*2&&(f=i.slides.length-i.loopedSlides*2-f,f=Math.abs(f)),e.push(f);for(r=0;r<e.length;r++)u[e[r]]&&(u[e[r]].className+=" "+t.paginationVisibleClass);t.loop?u[i.activeLoopIndex].className+=" "+t.paginationActiveClass:u[i.activeIndex].className+=" "+t.paginationActiveClass}else t.loop?u[i.activeLoopIndex]&&(u[i.activeLoopIndex].className+=" "+t.paginationActiveClass+" "+t.paginationVisibleClass):u[i.activeIndex].className+=" "+t.paginationActiveClass+" "+t.paginationVisibleClass}};i.calcVisibleSlides=function(n){var c=[],f=0,l=0,s=0,h,o;for(r&&i.wrapperLeft>0&&(n=n+i.wrapperLeft),!r&&i.wrapperTop>0&&(n=n+i.wrapperTop),h=0;h<i.slides.length;h++)f+=l,l=t.slidesPerView=="auto"?r?i.h.getWidth(i.slides[h],!0):i.h.getHeight(i.slides[h],!0):e,s=f+l,o=!1,t.visibilityFullFit?(f>=-n&&s<=-n+u&&(o=!0),f<=-n&&s>=-n+u&&(o=!0)):(s>-n&&s<=-n+u&&(o=!0),f>=-n&&f<-n+u&&(o=!0),f<-n&&s>-n+u&&(o=!0)),o&&c.push(i.slides[h]);c.length==0&&(c=[i.slides[i.activeIndex]]);i.visibleSlides=c};o=undefined;s=undefined;i.startAutoplay=function(){if(i.support.transitions){if(typeof o!="undefined")return!1;if(!t.autoplay)return;i.callPlugins("onAutoplayStart");pt()}else{if(typeof s!="undefined")return!1;if(!t.autoplay)return;i.callPlugins("onAutoplayStart");s=setInterval(function(){t.loop?(i.fixLoop(),i.swipeNext(!0)):i.swipeNext(!0)||(t.autoplayStopOnLast?(clearInterval(s),s=undefined):i.swipeTo(0))},t.autoplay)}};i.stopAutoplay=function(n){if(i.support.transitions){if(!o)return;o&&clearTimeout(o);o=undefined;n&&!t.autoplayDisableOnInteraction&&i.wrapperTransitionEnd(function(){pt()});i.callPlugins("onAutoplayStop")}else s&&clearInterval(s),s=undefined,i.callPlugins("onAutoplayStop")};i.loopCreated=!1;i.removeLoopedSlides=function(){if(i.loopCreated)for(var n=0;n<i.slides.length;n++)i.slides[n].getData("looped")===!0&&i.wrapper.removeChild(i.slides[n])};i.createLoop=function(){var f,h,c;if(i.slides.length!=0){i.loopedSlides=t.slidesPerView=="auto"?t.loopedSlides||1:t.slidesPerView+t.loopAdditionalSlides;i.loopedSlides>i.slides.length&&(i.loopedSlides=i.slides.length);for(var e="",o="",u="",r=i.slides.length,l=Math.floor(i.loopedSlides/r),s=i.loopedSlides%r,n=0;n<l*r;n++)f=n,n>=r&&(h=Math.floor(n/r),f=n-r*h),u+=i.slides[f].outerHTML;for(n=0;n<s;n++)o+=ui(t.slideDuplicateClass,i.slides[n].outerHTML);for(n=r-s;n<r;n++)e+=ui(t.slideDuplicateClass,i.slides[n].outerHTML);for(c=e+u+ut.innerHTML+u+o,ut.innerHTML=c,i.loopCreated=!0,i.calcSlides(),n=0;n<i.slides.length;n++)(n<i.loopedSlides||n>=i.slides.length-i.loopedSlides)&&i.slides[n].setData("looped",!0);i.callPlugins("onCreateLoop")}};i.fixLoop=function(){var n;i.activeIndex<i.loopedSlides?(n=i.slides.length-i.loopedSlides*3+i.activeIndex,i.swipeTo(n,0,!1)):(t.slidesPerView=="auto"&&i.activeIndex>=i.loopedSlides*2||i.activeIndex>i.slides.length-t.slidesPerView*2)&&(n=-i.slides.length+i.activeIndex+i.loopedSlides,i.swipeTo(n,0,!1))};i.loadSlides=function(){var u="",r,f,n;for(i.activeLoaderIndex=0,r=t.loader.slides,f=t.loader.loadAllSlides?r.length:t.slidesPerView*(1+t.loader.surroundGroups),n=0;n<f;n++)u+=t.loader.slidesHTMLType=="outer"?r[n]:"<"+t.slideElement+' class="'+t.slideClass+'" data-swiperindex="'+n+'">'+r[n]+"<\/"+t.slideElement+">";i.wrapper.innerHTML=u;i.calcSlides(!0);t.loader.loadAllSlides||i.wrapperTransitionEnd(i.reloadSlides,!0)};i.reloadSlides=function(){var f=t.loader.slides,u=parseInt(i.activeSlide().data("swiperindex"),10),o,h,v,a,c,l,s,n,r;if(!(u<0)&&!(u>f.length-1)){if(i.activeLoaderIndex=u,o=Math.max(0,u-t.slidesPerView*t.loader.surroundGroups),h=Math.min(u+t.slidesPerView*(1+t.loader.surroundGroups)-1,f.length-1),u>0&&(v=-e*(u-o),i.setWrapperTranslate(v),i.setWrapperTransition(0)),t.loader.logic==="reload"){for(i.wrapper.innerHTML="",a="",n=o;n<=h;n++)a+=t.loader.slidesHTMLType=="outer"?f[n]:"<"+t.slideElement+' class="'+t.slideClass+'" data-swiperindex="'+n+'">'+f[n]+"<\/"+t.slideElement+">";i.wrapper.innerHTML=a}else{for(c=1e3,l=0,n=0;n<i.slides.length;n++)s=i.slides[n].data("swiperindex"),s<o||s>h?i.wrapper.removeChild(i.slides[n]):(c=Math.min(s,c),l=Math.max(s,l));for(n=o;n<=h;n++)n<c&&(r=document.createElement(t.slideElement),r.className=t.slideClass,r.setAttribute("data-swiperindex",n),r.innerHTML=f[n],i.wrapper.insertBefore(r,i.wrapper.firstChild)),n>l&&(r=document.createElement(t.slideElement),r.className=t.slideClass,r.setAttribute("data-swiperindex",n),r.innerHTML=f[n],i.wrapper.appendChild(r))}i.reInit(!0)}};ai()}};Swiper.prototype={plugins:{},wrapperTransitionEnd:function(n,t){function e(){if(n(r),r.params.queueEndCallbacks&&(r._queueEndCallbacks=!1),!t)for(i=0;i<u.length;i++)r.h.removeEventListener(f,u[i],e)}var r=this,f=r.wrapper,u=["webkitTransitionEnd","transitionend","oTransitionEnd","MSTransitionEnd","msTransitionEnd"],i;if(n)for(i=0;i<u.length;i++)r.h.addEventListener(f,u[i],e)},getWrapperTranslate:function(n){var f=this.wrapper,i,r,t,u;return typeof n=="undefined"&&(n=this.params.mode=="horizontal"?"x":"y"),this.support.transforms&&this.params.useCSS3Transforms?(t=window.getComputedStyle(f,null),window.WebKitCSSMatrix?u=new WebKitCSSMatrix(t.webkitTransform):(u=t.MozTransform||t.OTransform||t.MsTransform||t.msTransform||t.transform||t.getPropertyValue("transform").replace("translate(","matrix(1, 0, 0, 1,"),i=u.toString().split(",")),n=="x"&&(r=window.WebKitCSSMatrix?u.m41:i.length==16?parseFloat(i[12]):parseFloat(i[4])),n=="y"&&(r=window.WebKitCSSMatrix?u.m42:i.length==16?parseFloat(i[13]):parseFloat(i[5]))):(n=="x"&&(r=parseFloat(f.style.left,10)||0),n=="y"&&(r=parseFloat(f.style.top,10)||0)),r||0},setWrapperTranslate:function(n,t,i){var u=this.wrapper.style,r={x:0,y:0,z:0},f;arguments.length==3?(r.x=n,r.y=t,r.z=i):(typeof t=="undefined"&&(t=this.params.mode=="horizontal"?"x":"y"),r[t]=n);this.support.transforms&&this.params.useCSS3Transforms?(f=this.support.transforms3d?"translate3d("+r.x+"px, "+r.y+"px, "+r.z+"px)":"translate("+r.x+"px, "+r.y+"px)",u.webkitTransform=u.MsTransform=u.msTransform=u.MozTransform=u.OTransform=u.transform=f):(u.left=r.x+"px",u.top=r.y+"px");this.callPlugins("onSetWrapperTransform",r);this.params.onSetWrapperTransform&&this.fireCallback(this.params.onSetWrapperTransform,this,r)},setWrapperTransition:function(n){var t=this.wrapper.style;t.webkitTransitionDuration=t.MsTransitionDuration=t.msTransitionDuration=t.MozTransitionDuration=t.OTransitionDuration=t.transitionDuration=n/1e3+"s";this.callPlugins("onSetWrapperTransition",{duration:n});this.params.onSetWrapperTransition&&this.fireCallback(this.params.onSetWrapperTransition,this,n)},h:{getWidth:function(n,t){var r=window.getComputedStyle(n,null).getPropertyValue("width"),i=parseFloat(r);return(isNaN(i)||r.indexOf("%")>0)&&(i=n.offsetWidth-parseFloat(window.getComputedStyle(n,null).getPropertyValue("padding-left"))-parseFloat(window.getComputedStyle(n,null).getPropertyValue("padding-right"))),t&&(i+=parseFloat(window.getComputedStyle(n,null).getPropertyValue("padding-left"))+parseFloat(window.getComputedStyle(n,null).getPropertyValue("padding-right"))),i},getHeight:function(n,t){if(t)return n.offsetHeight;var r=window.getComputedStyle(n,null).getPropertyValue("height"),i=parseFloat(r);return(isNaN(i)||r.indexOf("%")>0)&&(i=n.offsetHeight-parseFloat(window.getComputedStyle(n,null).getPropertyValue("padding-top"))-parseFloat(window.getComputedStyle(n,null).getPropertyValue("padding-bottom"))),t&&(i+=parseFloat(window.getComputedStyle(n,null).getPropertyValue("padding-top"))+parseFloat(window.getComputedStyle(n,null).getPropertyValue("padding-bottom"))),i},getOffset:function(n){var t=n.getBoundingClientRect(),i=document.body,f=n.clientTop||i.clientTop||0,e=n.clientLeft||i.clientLeft||0,r=window.pageYOffset||n.scrollTop,u=window.pageXOffset||n.scrollLeft;return document.documentElement&&!window.pageYOffset&&(r=document.documentElement.scrollTop,u=document.documentElement.scrollLeft),{top:t.top+r-f,left:t.left+u-e}},windowWidth:function(){return window.innerWidth?window.innerWidth:document.documentElement&&document.documentElement.clientWidth?document.documentElement.clientWidth:void 0},windowHeight:function(){return window.innerHeight?window.innerHeight:document.documentElement&&document.documentElement.clientHeight?document.documentElement.clientHeight:void 0},windowScroll:function(){return typeof pageYOffset!="undefined"?{left:window.pageXOffset,top:window.pageYOffset}:document.documentElement?{left:document.documentElement.scrollLeft,top:document.documentElement.scrollTop}:void 0},addEventListener:function(n,t,i,r){typeof r=="undefined"&&(r=!1);n.addEventListener?n.addEventListener(t,i,r):n.attachEvent&&n.attachEvent("on"+t,i)},removeEventListener:function(n,t,i,r){typeof r=="undefined"&&(r=!1);n.removeEventListener?n.removeEventListener(t,i,r):n.detachEvent&&n.detachEvent("on"+t,i)}},setTransform:function(n,t){var i=n.style;i.webkitTransform=i.MsTransform=i.msTransform=i.MozTransform=i.OTransform=i.transform=t},setTranslate:function(n,t){var i=n.style,r={x:t.x||0,y:t.y||0,z:t.z||0},u=this.support.transforms3d?"translate3d("+r.x+"px,"+r.y+"px,"+r.z+"px)":"translate("+r.x+"px,"+r.y+"px)";i.webkitTransform=i.MsTransform=i.msTransform=i.MozTransform=i.OTransform=i.transform=u;this.support.transforms||(i.left=r.x+"px",i.top=r.y+"px")},setTransition:function(n,t){var i=n.style;i.webkitTransitionDuration=i.MsTransitionDuration=i.msTransitionDuration=i.MozTransitionDuration=i.OTransitionDuration=i.transitionDuration=t+"ms"},support:{touch:window.Modernizr&&Modernizr.touch===!0||function(){return!!("ontouchstart"in window||window.DocumentTouch&&document instanceof DocumentTouch)}(),transforms3d:window.Modernizr&&Modernizr.csstransforms3d===!0||function(){var n=document.createElement("div").style;return"webkitPerspective"in n||"MozPerspective"in n||"OPerspective"in n||"MsPerspective"in n||"perspective"in n}(),transforms:window.Modernizr&&Modernizr.csstransforms===!0||function(){var n=document.createElement("div").style;return"transform"in n||"WebkitTransform"in n||"MozTransform"in n||"msTransform"in n||"MsTransform"in n||"OTransform"in n}(),transitions:window.Modernizr&&Modernizr.csstransitions===!0||function(){var n=document.createElement("div").style;return"transition"in n||"WebkitTransition"in n||"MozTransition"in n||"msTransition"in n||"MsTransition"in n||"OTransition"in n}()},browser:{ie8:function(){var n=-1,t,i;return navigator.appName=="Microsoft Internet Explorer"&&(t=navigator.userAgent,i=new RegExp("MSIE ([0-9]{1,}[.0-9]{0,})"),i.exec(t)!=null&&(n=parseFloat(RegExp.$1))),n!=-1&&n<9}(),ie10:window.navigator.msPointerEnabled,ie11:window.navigator.pointerEnabled}};(window.jQuery||window.Zepto)&&function(n){n.fn.swiper=function(t){var i=new Swiper(n(this)[0],t);return n(this).data("swiper",i),i}}(window.jQuery||window.Zepto);typeof module!="undefined"&&(module.exports=Swiper),function(n,t){function u(){return new Date(Date.UTC.apply(Date,arguments))}function e(){var n=new Date;return u(n.getFullYear(),n.getMonth(),n.getDate())}function c(n){return function(){return this[n].apply(this,arguments)}}function y(t,i){function s(n,t){return t.toLowerCase()}var u=n(t).data(),f={},e,o=new RegExp("^"+i.toLowerCase()+"([A-Z])"),r;i=new RegExp("^"+i.toLowerCase());for(r in u)i.test(r)&&(e=r.replace(o,s),f[e]=u[r]);return f}function p(t){var u={},i;if(r[t]||(t=t.split("-")[0],r[t]))return i=r[t],n.each(v,function(n,t){t in i&&(u[t]=i[t])}),u}var s=n(window),l=function(){var t={get:function(n){return this.slice(n)[0]},contains:function(n){for(var r=n&&n.valueOf(),t=0,i=this.length;t<i;t++)if(this[t].valueOf()===r)return t;return-1},remove:function(n){this.splice(n,1)},replace:function(t){t&&(n.isArray(t)||(t=[t]),this.clear(),this.push.apply(this,t))},clear:function(){this.splice(0)},copy:function(){var n=new l;return n.replace(this),n}};return function(){var i=[];return i.push.apply(i,arguments),n.extend(i,t),i}}(),f=function(t,r){this.dates=new l;this.viewDate=e();this.focusDate=null;this._process_options(r);this.element=n(t);this.isInline=!1;this.isInput=this.element.is("input");this.component=this.element.is(".date")?this.element.find(".add-on, .input-group-addon, .btn"):!1;this.hasInput=this.component&&this.element.find("input").length;this.component&&this.component.length===0&&(this.component=!1);this.picker=n(i.template);this._buildEvents();this._attachEvents();this.isInline?this.picker.addClass("datepicker-inline").appendTo(this.element):this.picker.addClass("datepicker-dropdown dropdown-menu");this.o.rtl&&this.picker.addClass("datepicker-rtl");this.viewMode=this.o.startView;this.o.calendarWeeks&&this.picker.find("tfoot th.today").attr("colspan",function(n,t){return parseInt(t)+1});this._allow_update=!1;this.setStartDate(this._o.startDate);this.setEndDate(this._o.endDate);this.setDaysOfWeekDisabled(this.o.daysOfWeekDisabled);this.fillDow();this.fillMonths();this._allow_update=!0;this.update();this.showMode();this.isInline&&this.show()},h,a,o,v,r,i;f.prototype={constructor:f,_process_options:function(t){var u,e,h,f,s;this._o=n.extend({},this._o,t);u=this.o=n.extend({},this._o);e=u.language;r[e]||(e=e.split("-")[0],r[e]||(e=o.language));u.language=e;switch(u.startView){case 2:case"decade":u.startView=2;break;case 1:case"year":u.startView=1;break;default:u.startView=0}switch(u.minViewMode){case 1:case"months":u.minViewMode=1;break;case 2:case"years":u.minViewMode=2;break;default:u.minViewMode=0}if(u.startView=Math.max(u.startView,u.minViewMode),u.multidate!==!0&&(u.multidate=Number(u.multidate)||!1,u.multidate=u.multidate!==!1?Math.max(0,u.multidate):1),u.multidateSeparator=String(u.multidateSeparator),u.weekStart%=7,u.weekEnd=(u.weekStart+6)%7,h=i.parseFormat(u.format),u.startDate!==-Infinity&&(u.startDate=u.startDate?u.startDate instanceof Date?this._local_to_utc(this._zero_time(u.startDate)):i.parseDate(u.startDate,h,u.language):-Infinity),u.endDate!==Infinity&&(u.endDate=u.endDate?u.endDate instanceof Date?this._local_to_utc(this._zero_time(u.endDate)):i.parseDate(u.endDate,h,u.language):Infinity),u.daysOfWeekDisabled=u.daysOfWeekDisabled||[],n.isArray(u.daysOfWeekDisabled)||(u.daysOfWeekDisabled=u.daysOfWeekDisabled.split(/[,\s]*/)),u.daysOfWeekDisabled=n.map(u.daysOfWeekDisabled,function(n){return parseInt(n,10)}),f=String(u.orientation).toLowerCase().split(/\s+/g),s=u.orientation.toLowerCase(),f=n.grep(f,function(n){return/^auto|left|right|top|bottom$/.test(n)}),u.orientation={x:"auto",y:"auto"},s&&s!=="auto")if(f.length===1)switch(f[0]){case"top":case"bottom":u.orientation.y=f[0];break;case"left":case"right":u.orientation.x=f[0]}else s=n.grep(f,function(n){return/^left|right$/.test(n)}),u.orientation.x=s[0]||"auto",s=n.grep(f,function(n){return/^top|bottom$/.test(n)}),u.orientation.y=s[0]||"auto"},_events:[],_secondaryEvents:[],_applyEvents:function(n){for(var i=0,f,r,u;i<n.length;i++){f=n[i][0];n[i].length===2?(r=t,u=n[i][1]):n[i].length===3&&(r=n[i][1],u=n[i][2]);f.on(u,r)}},_unapplyEvents:function(n){for(var i=0,f,r,u;i<n.length;i++)f=n[i][0],n[i].length===2?(u=t,r=n[i][1]):n[i].length===3&&(u=n[i][1],r=n[i][2]),f.off(r,u)},_buildEvents:function(){this.isInput?this._events=[[this.element,{focus:n.proxy(this.show,this),keyup:n.proxy(function(t){n.inArray(t.keyCode,[27,37,39,38,40,32,13,9])===-1&&this.update()},this),keydown:n.proxy(this.keydown,this)}]]:this.component&&this.hasInput?this._events=[[this.element.find("input"),{focus:n.proxy(this.show,this),keyup:n.proxy(function(t){n.inArray(t.keyCode,[27,37,39,38,40,32,13,9])===-1&&this.update()},this),keydown:n.proxy(this.keydown,this)}],[this.component,{click:n.proxy(this.show,this)}]]:this.element.is("div")?this.isInline=!0:this._events=[[this.element,{click:n.proxy(this.show,this)}]];this._events.push([this.element,"*",{blur:n.proxy(function(n){this._focused_from=n.target},this)}],[this.element,{blur:n.proxy(function(n){this._focused_from=n.target},this)}]);this._secondaryEvents=[[this.picker,{click:n.proxy(this.click,this)}],[n(window),{resize:n.proxy(this.place,this)}],[n(document),{"mousedown touchstart":n.proxy(function(n){this.element.is(n.target)||this.element.find(n.target).length||this.picker.is(n.target)||this.picker.find(n.target).length||this.hide()},this)}]]},_attachEvents:function(){this._detachEvents();this._applyEvents(this._events)},_detachEvents:function(){this._unapplyEvents(this._events)},_attachSecondaryEvents:function(){this._detachSecondaryEvents();this._applyEvents(this._secondaryEvents)},_detachSecondaryEvents:function(){this._unapplyEvents(this._secondaryEvents)},_trigger:function(t,r){var u=r||this.dates.get(-1),f=this._utc_to_local(u);this.element.trigger({type:t,date:f,dates:n.map(this.dates,this._utc_to_local),format:n.proxy(function(n,t){arguments.length===0?(n=this.dates.length-1,t=this.o.format):typeof n=="string"&&(t=n,n=this.dates.length-1);t=t||this.o.format;var r=this.dates.get(n);return i.formatDate(r,t,this.o.language)},this)})},show:function(){this.isInline||this.picker.appendTo("body");this.picker.show();this.place();this._attachSecondaryEvents();this._trigger("show")},hide:function(){this.isInline||this.picker.is(":visible")&&(this.focusDate=null,this.picker.hide().detach(),this._detachSecondaryEvents(),this.viewMode=this.o.startView,this.showMode(),this.o.forceParse&&(this.isInput&&this.element.val()||this.hasInput&&this.element.find("input").val())&&this.setValue(),this._trigger("hide"))},remove:function(){this.hide();this._detachEvents();this._detachSecondaryEvents();this.picker.remove();delete this.element.data().datepicker;this.isInput||delete this.element.data().date},_utc_to_local:function(n){return n&&new Date(n.getTime()+n.getTimezoneOffset()*6e4)},_local_to_utc:function(n){return n&&new Date(n.getTime()-n.getTimezoneOffset()*6e4)},_zero_time:function(n){return n&&new Date(n.getFullYear(),n.getMonth(),n.getDate())},_zero_utc_time:function(n){return n&&new Date(Date.UTC(n.getUTCFullYear(),n.getUTCMonth(),n.getUTCDate()))},getDates:function(){return n.map(this.dates,this._utc_to_local)},getUTCDates:function(){return n.map(this.dates,function(n){return new Date(n)})},getDate:function(){return this._utc_to_local(this.getUTCDate())},getUTCDate:function(){return new Date(this.dates.get(-1))},setDates:function(){var t=n.isArray(arguments[0])?arguments[0]:arguments;this.update.apply(this,t);this._trigger("changeDate");this.setValue()},setUTCDates:function(){var t=n.isArray(arguments[0])?arguments[0]:arguments;this.update.apply(this,n.map(t,this._utc_to_local));this._trigger("changeDate");this.setValue()},setDate:c("setDates"),setUTCDate:c("setUTCDates"),setValue:function(){var n=this.getFormattedDate();this.isInput?this.element.val(n).change():this.component&&this.element.find("input").val(n).change()},getFormattedDate:function(r){r===t&&(r=this.o.format);var u=this.o.language;return n.map(this.dates,function(n){return i.formatDate(n,r,u)}).join(this.o.multidateSeparator)},setStartDate:function(n){this._process_options({startDate:n});this.update();this.updateNavArrows()},setEndDate:function(n){this._process_options({endDate:n});this.update();this.updateNavArrows()},setDaysOfWeekDisabled:function(n){this._process_options({daysOfWeekDisabled:n});this.update();this.updateNavArrows()},place:function(){var i,v,o;if(!this.isInline){var u=this.picker.outerWidth(),f=this.picker.outerHeight(),h=10,c=s.width(),y=s.height(),l=s.scrollTop(),p=parseInt(this.element.parents().filter(function(){return n(this).css("z-index")!=="auto"}).first().css("z-index"))+10,t=this.component?this.component.parent().offset():this.element.offset(),a=this.component?this.component.outerHeight(!0):this.element.outerHeight(!1),w=this.component?this.component.outerWidth(!0):this.element.outerWidth(!1),r=t.left,e=t.top;this.picker.removeClass("datepicker-orient-top datepicker-orient-bottom datepicker-orient-right datepicker-orient-left");this.o.orientation.x!=="auto"?(this.picker.addClass("datepicker-orient-"+this.o.orientation.x),this.o.orientation.x==="right"&&(r-=u-w)):(this.picker.addClass("datepicker-orient-left"),t.left<0?r-=t.left-h:t.left+u>c&&(r=c-u-h));i=this.o.orientation.y;i==="auto"&&(v=-l+t.top-f,o=l+y-(t.top+a+f),i=Math.max(v,o)===o?"top":"bottom");this.picker.addClass("datepicker-orient-"+i);i==="top"?e+=a:e-=f+parseInt(this.picker.css("padding-top"));this.picker.css({top:e,left:r,zIndex:p})}},_allow_update:!0,update:function(){if(this._allow_update){var r=this.dates.copy(),t=[],u=!1;arguments.length?(n.each(arguments,n.proxy(function(n,i){i instanceof Date&&(i=this._local_to_utc(i));t.push(i)},this)),u=!0):(t=this.isInput?this.element.val():this.element.data("date")||this.element.find("input").val(),t=t&&this.o.multidate?t.split(this.o.multidateSeparator):[t],delete this.element.data().date);t=n.map(t,n.proxy(function(n){return i.parseDate(n,this.o.format,this.o.language)},this));t=n.grep(t,n.proxy(function(n){return n<this.o.startDate||n>this.o.endDate||!n},this),!0);this.dates.replace(t);this.dates.length?this.viewDate=new Date(this.dates.get(-1)):this.viewDate<this.o.startDate?this.viewDate=new Date(this.o.startDate):this.viewDate>this.o.endDate&&(this.viewDate=new Date(this.o.endDate));u?this.setValue():t.length&&String(r)!==String(this.dates)&&this._trigger("changeDate");!this.dates.length&&r.length&&this._trigger("clearDate");this.fill()}},fillDow:function(){var i=this.o.weekStart,n="<tr>",t;for(this.o.calendarWeeks&&(t='<th class="cw">&nbsp;<\/th>',n+=t,this.picker.find(".datepicker-days thead tr:first-child").prepend(t));i<this.o.weekStart+7;)n+='<th class="dow">'+r[this.o.language].daysMin[i++%7]+"<\/th>";n+="<\/tr>";this.picker.find(".datepicker-days thead").append(n)},fillMonths:function(){for(var n="",t=0;t<12;)n+='<span class="month">'+r[this.o.language].monthsShort[t++]+"<\/span>";this.picker.find(".datepicker-months td").html(n)},setRange:function(t){t&&t.length?this.range=n.map(t,function(n){return n.valueOf()}):delete this.range;this.fill()},getClassNames:function(t){var i=[],r=this.viewDate.getUTCFullYear(),f=this.viewDate.getUTCMonth(),u=new Date;return t.getUTCFullYear()<r||t.getUTCFullYear()===r&&t.getUTCMonth()<f?i.push("old"):(t.getUTCFullYear()>r||t.getUTCFullYear()===r&&t.getUTCMonth()>f)&&i.push("new"),this.focusDate&&t.valueOf()===this.focusDate.valueOf()&&i.push("focused"),this.o.todayHighlight&&t.getUTCFullYear()===u.getFullYear()&&t.getUTCMonth()===u.getMonth()&&t.getUTCDate()===u.getDate()&&i.push("today"),this.dates.contains(t)!==-1&&i.push("active"),(t.valueOf()<this.o.startDate||t.valueOf()>this.o.endDate||n.inArray(t.getUTCDay(),this.o.daysOfWeekDisabled)!==-1)&&i.push("disabled"),this.range&&(t>this.range[0]&&t<this.range[this.range.length-1]&&i.push("range"),n.inArray(t.valueOf(),this.range)!==-1&&i.push("selected")),i},fill:function(){var d=new Date(this.viewDate),f=d.getUTCFullYear(),g=d.getUTCMonth(),y=this.o.startDate!==-Infinity?this.o.startDate.getUTCFullYear():-Infinity,ut=this.o.startDate!==-Infinity?this.o.startDate.getUTCMonth():-Infinity,p=this.o.endDate!==Infinity?this.o.endDate.getUTCFullYear():Infinity,ft=this.o.endDate!==Infinity?this.o.endDate.getUTCMonth():Infinity,et=r[this.o.language].today||r.en.today||"",ot=r[this.o.language].clear||r.en.clear||"",w,e,b,c,s,h,o,a,it,rt,l,v;for(this.picker.find(".datepicker-days thead th.datepicker-switch").text(r[this.o.language].months[g]+" "+f),this.picker.find("tfoot th.today").text(et).toggle(this.o.todayBtn!==!1),this.picker.find("tfoot th.clear").text(ot).toggle(this.o.clearBtn!==!1),this.updateNavArrows(),this.fillMonths(),e=u(f,g-1,28),b=i.getDaysInMonth(e.getUTCFullYear(),e.getUTCMonth()),e.setUTCDate(b),e.setUTCDate(b-(e.getUTCDay()-this.o.weekStart+7)%7),c=new Date(e),c.setUTCDate(c.getUTCDate()+42),c=c.valueOf(),s=[];e.valueOf()<c;){if(e.getUTCDay()===this.o.weekStart&&(s.push("<tr>"),this.o.calendarWeeks)){var nt=new Date(+e+(this.o.weekStart-e.getUTCDay()-7)%7*864e5),tt=new Date(Number(nt)+(11-nt.getUTCDay())%7*864e5),k=new Date(Number(k=u(tt.getUTCFullYear(),0,1))+(11-k.getUTCDay())%7*864e5),st=(tt-k)/6048e5+1;s.push('<td class="cw">'+st+"<\/td>")}h=this.getClassNames(e);h.push("day");this.o.beforeShowDay!==n.noop&&(o=this.o.beforeShowDay(this._utc_to_local(e)),o===t?o={}:typeof o=="boolean"?o={enabled:o}:typeof o=="string"&&(o={classes:o}),o.enabled===!1&&h.push("disabled"),o.classes&&(h=h.concat(o.classes.split(/\s+/))),o.tooltip&&(w=o.tooltip));h=n.unique(h);s.push('<td class="'+h.join(" ")+'"'+(w?' title="'+w+'"':"")+">"+e.getUTCDate()+"<\/td>");e.getUTCDay()===this.o.weekEnd&&s.push("<\/tr>");e.setUTCDate(e.getUTCDate()+1)}for(this.picker.find(".datepicker-days tbody").empty().append(s.join("")),a=this.picker.find(".datepicker-months").find("th:eq(1)").text(f).end().find("span").removeClass("active"),n.each(this.dates,function(n,t){t.getUTCFullYear()===f&&a.eq(t.getUTCMonth()).addClass("active")}),(f<y||f>p)&&a.addClass("disabled"),f===y&&a.slice(0,ut).addClass("disabled"),f===p&&a.slice(ft+1).addClass("disabled"),s="",f=parseInt(f/10,10)*10,it=this.picker.find(".datepicker-years").find("th:eq(1)").text(f+"-"+(f+9)).end().find("td"),f-=1,rt=n.map(this.dates,function(n){return n.getUTCFullYear()}),v=-1;v<11;v++)l=["year"],v===-1?l.push("old"):v===10&&l.push("new"),n.inArray(f,rt)!==-1&&l.push("active"),(f<y||f>p)&&l.push("disabled"),s+='<span class="'+l.join(" ")+'">'+f+"<\/span>",f+=1;it.html(s)},updateNavArrows:function(){if(this._allow_update){var t=new Date(this.viewDate),n=t.getUTCFullYear(),i=t.getUTCMonth();switch(this.viewMode){case 0:this.o.startDate!==-Infinity&&n<=this.o.startDate.getUTCFullYear()&&i<=this.o.startDate.getUTCMonth()?this.picker.find(".prev").css({visibility:"hidden"}):this.picker.find(".prev").css({visibility:"visible"});this.o.endDate!==Infinity&&n>=this.o.endDate.getUTCFullYear()&&i>=this.o.endDate.getUTCMonth()?this.picker.find(".next").css({visibility:"hidden"}):this.picker.find(".next").css({visibility:"visible"});break;case 1:case 2:this.o.startDate!==-Infinity&&n<=this.o.startDate.getUTCFullYear()?this.picker.find(".prev").css({visibility:"hidden"}):this.picker.find(".prev").css({visibility:"visible"});this.o.endDate!==Infinity&&n>=this.o.endDate.getUTCFullYear()?this.picker.find(".next").css({visibility:"hidden"}):this.picker.find(".next").css({visibility:"visible"})}}},click:function(t){var r,e,f,o,c,s,l,h;if(t.preventDefault(),r=n(t.target).closest("span, td, th"),r.length===1)switch(r[0].nodeName.toLowerCase()){case"th":switch(r[0].className){case"datepicker-switch":this.showMode(1);break;case"prev":case"next":c=i.modes[this.viewMode].navStep*(r[0].className==="prev"?-1:1);switch(this.viewMode){case 0:this.viewDate=this.moveMonth(this.viewDate,c);this._trigger("changeMonth",this.viewDate);break;case 1:case 2:this.viewDate=this.moveYear(this.viewDate,c);this.viewMode===1&&this._trigger("changeYear",this.viewDate)}this.fill();break;case"today":s=new Date;s=u(s.getFullYear(),s.getMonth(),s.getDate(),0,0,0);this.showMode(-2);l=this.o.todayBtn==="linked"?null:"view";this._setDate(s,l);break;case"clear":this.isInput?h=this.element:this.component&&(h=this.element.find("input"));h&&h.val("").change();this.update();this._trigger("changeDate");this.o.autoclose&&this.hide()}break;case"span":r.is(".disabled")||(this.viewDate.setUTCDate(1),r.is(".month")?(o=1,f=r.parent().find("span").index(r),e=this.viewDate.getUTCFullYear(),this.viewDate.setUTCMonth(f),this._trigger("changeMonth",this.viewDate),this.o.minViewMode===1&&this._setDate(u(e,f,o))):(o=1,f=0,e=parseInt(r.text(),10)||0,this.viewDate.setUTCFullYear(e),this._trigger("changeYear",this.viewDate),this.o.minViewMode===2&&this._setDate(u(e,f,o))),this.showMode(-1),this.fill());break;case"td":r.is(".day")&&!r.is(".disabled")&&(o=parseInt(r.text(),10)||1,e=this.viewDate.getUTCFullYear(),f=this.viewDate.getUTCMonth(),r.is(".old")?f===0?(f=11,e-=1):f-=1:r.is(".new")&&(f===11?(f=0,e+=1):f+=1),this._setDate(u(e,f,o)))}this.picker.is(":visible")&&this._focused_from&&n(this._focused_from).focus();delete this._focused_from},_toggle_multidate:function(n){var t=this.dates.contains(n);if(n?t!==-1?this.dates.remove(t):this.dates.push(n):this.dates.clear(),typeof this.o.multidate=="number")while(this.dates.length>this.o.multidate)this.dates.remove(0)},_setDate:function(n,t){t&&t!=="date"||this._toggle_multidate(n&&new Date(n));t&&t!=="view"||(this.viewDate=n&&new Date(n));this.fill();this.setValue();this._trigger("changeDate");var i;this.isInput?i=this.element:this.component&&(i=this.element.find("input"));i&&i.change();this.o.autoclose&&(!t||t==="date")&&this.hide()},moveMonth:function(n,i){var e;if(!n)return t;if(!i)return n;var r=new Date(n.valueOf()),o=r.getUTCDate(),s=r.getUTCMonth(),h=Math.abs(i),u,f;if(i=i>0?1:-1,h===1)f=i===-1?function(){return r.getUTCMonth()===s}:function(){return r.getUTCMonth()!==u},u=s+i,r.setUTCMonth(u),(u<0||u>11)&&(u=(u+12)%12);else{for(e=0;e<h;e++)r=this.moveMonth(r,i);u=r.getUTCMonth();r.setUTCDate(o);f=function(){return u!==r.getUTCMonth()}}while(f())r.setUTCDate(--o),r.setUTCMonth(u);return r},moveYear:function(n,t){return this.moveMonth(n,t*12)},dateWithinRange:function(n){return n>=this.o.startDate&&n<=this.o.endDate},keydown:function(n){var o,t,i,u,r,f;if(this.picker.is(":not(:visible)")){n.keyCode===27&&this.show();return}o=!1;r=this.focusDate||this.viewDate;switch(n.keyCode){case 27:this.focusDate?(this.focusDate=null,this.viewDate=this.dates.get(-1)||this.viewDate,this.fill()):this.hide();n.preventDefault();break;case 37:case 39:if(!this.o.keyboardNavigation)break;t=n.keyCode===37?-1:1;n.ctrlKey?(i=this.moveYear(this.dates.get(-1)||e(),t),u=this.moveYear(r,t),this._trigger("changeYear",this.viewDate)):n.shiftKey?(i=this.moveMonth(this.dates.get(-1)||e(),t),u=this.moveMonth(r,t),this._trigger("changeMonth",this.viewDate)):(i=new Date(this.dates.get(-1)||e()),i.setUTCDate(i.getUTCDate()+t),u=new Date(r),u.setUTCDate(r.getUTCDate()+t));this.dateWithinRange(i)&&(this.focusDate=this.viewDate=u,this.setValue(),this.fill(),n.preventDefault());break;case 38:case 40:if(!this.o.keyboardNavigation)break;t=n.keyCode===38?-1:1;n.ctrlKey?(i=this.moveYear(this.dates.get(-1)||e(),t),u=this.moveYear(r,t),this._trigger("changeYear",this.viewDate)):n.shiftKey?(i=this.moveMonth(this.dates.get(-1)||e(),t),u=this.moveMonth(r,t),this._trigger("changeMonth",this.viewDate)):(i=new Date(this.dates.get(-1)||e()),i.setUTCDate(i.getUTCDate()+t*7),u=new Date(r),u.setUTCDate(r.getUTCDate()+t*7));this.dateWithinRange(i)&&(this.focusDate=this.viewDate=u,this.setValue(),this.fill(),n.preventDefault());break;case 13:r=this.focusDate||this.dates.get(-1)||this.viewDate;this._toggle_multidate(r);o=!0;this.focusDate=null;this.viewDate=this.dates.get(-1)||this.viewDate;this.setValue();this.fill();this.picker.is(":visible")&&(n.preventDefault(),this.o.autoclose&&this.hide());break;case 9:this.focusDate=null;this.viewDate=this.dates.get(-1)||this.viewDate;this.fill();this.hide()}o&&(this.dates.length?this._trigger("changeDate"):this._trigger("clearDate"),this.isInput?f=this.element:this.component&&(f=this.element.find("input")),f&&f.change())},showMode:function(n){n&&(this.viewMode=Math.max(this.o.minViewMode,Math.min(2,this.viewMode+n)));this.picker.find(">div").hide().filter(".datepicker-"+i.modes[this.viewMode].clsName).css("display","block");this.updateNavArrows()}};h=function(t,i){this.element=n(t);this.inputs=n.map(i.inputs,function(n){return n.jquery?n[0]:n});delete i.inputs;n(this.inputs).datepicker(i).bind("changeDate",n.proxy(this.dateUpdated,this));this.pickers=n.map(this.inputs,function(t){return n(t).data("datepicker")});this.updateDates()};h.prototype={updateDates:function(){this.dates=n.map(this.pickers,function(n){return n.getUTCDate()});this.updateRanges()},updateRanges:function(){var t=n.map(this.dates,function(n){return n.valueOf()});n.each(this.pickers,function(n,i){i.setRange(t)})},dateUpdated:function(t){if(!this.updating){this.updating=!0;var u=n(t.target).data("datepicker"),r=u.getUTCDate(),i=n.inArray(t.target,this.inputs),f=this.inputs.length;if(i!==-1){if(n.each(this.pickers,function(n,t){t.getUTCDate()||t.setUTCDate(r)}),r<this.dates[i])while(i>=0&&r<this.dates[i])this.pickers[i--].setUTCDate(r);else if(r>this.dates[i])while(i<f&&r>this.dates[i])this.pickers[i++].setUTCDate(r);this.updateDates();delete this.updating}}},remove:function(){n.map(this.pickers,function(n){n.remove()});delete this.element.data().datepicker}};a=n.fn.datepicker;n.fn.datepicker=function(i){var u=Array.apply(null,arguments),r;return u.shift(),this.each(function(){var s=n(this),e=s.data("datepicker"),l=typeof i=="object"&&i,v;if(!e){var a=y(this,"date"),w=n.extend({},o,a,l),b=p(w.language),c=n.extend({},o,b,a,l);s.is(".input-daterange")||c.inputs?(v={inputs:c.inputs||s.find("input").toArray()},s.data("datepicker",e=new h(this,n.extend(c,v)))):s.data("datepicker",e=new f(this,c))}if(typeof i=="string"&&typeof e[i]=="function"&&(r=e[i].apply(e,u),r!==t))return!1}),r!==t?r:this};o=n.fn.datepicker.defaults={autoclose:!1,beforeShowDay:n.noop,calendarWeeks:!1,clearBtn:!1,daysOfWeekDisabled:[],endDate:Infinity,forceParse:!0,format:"mm/dd/yyyy",keyboardNavigation:!0,language:"en",minViewMode:0,multidate:!1,multidateSeparator:",",orientation:"auto",rtl:!1,startDate:-Infinity,startView:0,todayBtn:!1,todayHighlight:!1,weekStart:0};v=n.fn.datepicker.locale_opts=["format","rtl","weekStart"];n.fn.datepicker.Constructor=f;r=n.fn.datepicker.dates={en:{days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],daysShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat","Sun"],daysMin:["Su","Mo","Tu","We","Th","Fr","Sa","Su"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],monthsShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],today:"Today",clear:"Clear"}};i={modes:[{clsName:"days",navFnc:"Month",navStep:1},{clsName:"months",navFnc:"FullYear",navStep:1},{clsName:"years",navFnc:"FullYear",navStep:10}],isLeapYear:function(n){return n%4==0&&n%100!=0||n%400==0},getDaysInMonth:function(n,t){return[31,i.isLeapYear(n)?29:28,31,30,31,30,31,31,30,31,30,31][t]},validParts:/dd?|DD?|mm?|MM?|yy(?:yy)?/g,nonpunctuation:/[^ -\/:-@\[\u3400-\u9fff-`{-~\t\n\r]+/g,parseFormat:function(n){var t=n.replace(this.validParts,'\0').split('\0'),i=n.match(this.validParts);if(!t||!t.length||!i||i.length===0)throw new Error("Invalid date format.");return{separators:t,parts:i}},parseDate:function(e,o,s){function tt(){var n=this.slice(0,c[h].length),t=c[h].slice(0,n.length);return n===t}var nt,c,v,y,h,a,it,d,w;if(!e)return t;if(e instanceof Date)return e;if(typeof o=="string"&&(o=i.parseFormat(o)),nt=/([\-+]\d+)([dmwy])/,c=e.match(/([\-+]\d+)([dmwy])/g),/^[\-+]\d+[dmwy]([\s,]+[\-+]\d+[dmwy])*$/.test(e)){for(e=new Date,h=0;h<c.length;h++){v=nt.exec(c[h]);y=parseInt(v[1]);switch(v[2]){case"d":e.setUTCDate(e.getUTCDate()+y);break;case"m":e=f.prototype.moveMonth.call(f.prototype,e,y);break;case"w":e.setUTCDate(e.getUTCDate()+y*7);break;case"y":e=f.prototype.moveYear.call(f.prototype,e,y)}}return u(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate(),0,0,0)}c=e&&e.match(this.nonpunctuation)||[];e=new Date;var b={},g=["yyyy","yy","M","MM","m","mm","d","dd"],l={yyyy:function(n,t){return n.setUTCFullYear(t)},yy:function(n,t){return n.setUTCFullYear(2e3+t)},m:function(n,t){if(isNaN(n))return n;for(t-=1;t<0;)t+=12;for(t%=12,n.setUTCMonth(t);n.getUTCMonth()!==t;)n.setUTCDate(n.getUTCDate()-1);return n},d:function(n,t){return n.setUTCDate(t)}},p,k;if(l.M=l.MM=l.mm=l.m,l.dd=l.d,e=u(e.getFullYear(),e.getMonth(),e.getDate(),0,0,0),a=o.parts.slice(),c.length!==a.length&&(a=n(a).filter(function(t,i){return n.inArray(i,g)!==-1}).toArray()),c.length===a.length){for(h=0,it=a.length;h<it;h++){if(p=parseInt(c[h],10),v=a[h],isNaN(p))switch(v){case"MM":k=n(r[s].months).filter(tt);p=n.inArray(k[0],r[s].months)+1;break;case"M":k=n(r[s].monthsShort).filter(tt);p=n.inArray(k[0],r[s].monthsShort)+1}b[v]=p}for(h=0;h<g.length;h++)w=g[h],w in b&&!isNaN(b[w])&&(d=new Date(e),l[w](d,b[w]),isNaN(d)||(e=d))}return e},formatDate:function(t,u,f){var e,s,o,h;if(!t)return"";for(typeof u=="string"&&(u=i.parseFormat(u)),e={d:t.getUTCDate(),D:r[f].daysShort[t.getUTCDay()],DD:r[f].days[t.getUTCDay()],m:t.getUTCMonth()+1,M:r[f].monthsShort[t.getUTCMonth()],MM:r[f].months[t.getUTCMonth()],yy:t.getUTCFullYear().toString().substring(2),yyyy:t.getUTCFullYear()},e.dd=(e.d<10?"0":"")+e.d,e.mm=(e.m<10?"0":"")+e.m,t=[],s=n.extend([],u.separators),o=0,h=u.parts.length;o<=h;o++)s.length&&t.push(s.shift()),t.push(e[u.parts[o]]);return t.join("")},headTemplate:'<thead><tr><th class="prev"><img src="/Images/calendar-left.jpg" alt="prev" /><\/th><th colspan="5" class="datepicker-switch"><\/th><th class="next"><img src="/Images/calendar-right.jpg" alt="next" /><\/th><\/tr><\/thead>',contTemplate:'<tbody><tr><td colspan="7"><\/td><\/tr><\/tbody>',footTemplate:'<tfoot><tr><th colspan="7" class="today"><\/th><\/tr><tr><th colspan="7" class="clear"><\/th><\/tr><\/tfoot>'};i.template='<div class="datepicker"><div class="datepicker-days"><table class=" table-condensed">'+i.headTemplate+"<tbody><\/tbody>"+i.footTemplate+'<\/table><\/div><div class="datepicker-months"><table class="table-condensed">'+i.headTemplate+i.contTemplate+i.footTemplate+'<\/table><\/div><div class="datepicker-years"><table class="table-condensed">'+i.headTemplate+i.contTemplate+i.footTemplate+"<\/table><\/div><\/div>";n.fn.datepicker.DPGlobal=i;n.fn.datepicker.noConflict=function(){return n.fn.datepicker=a,this};n(document).on("focus.datepicker.data-api click.datepicker.data-api",'[data-provide="datepicker"]',function(t){var i=n(this);i.data("datepicker")||(t.preventDefault(),i.datepicker("show"))});n(function(){n('[data-provide="datepicker-inline"]').datepicker()})}(window.jQuery),function(n){n.fn.datepicker.dates.it={days:["Domenica","Lunedì","Martedì","Mercoledì","Giovedì","Venerdì","Sabato","Domenica"],daysShort:["Dom","Lun","Mar","Mer","Gio","Ven","Sab","Dom"],daysMin:["D","L","M","M","G","V","S","D"],months:["Gennaio","Febbraio","Marzo","Aprile","Maggio","Giugno","Luglio","Agosto","Settembre","Ottobre","Novembre","Dicembre"],monthsShort:["Gen","Feb","Mar","Apr","Mag","Giu","Lug","Ago","Set","Ott","Nov","Dic"],today:"Oggi",clear:"Cancella",weekStart:1,format:"dd/mm/yyyy"}}(jQuery),function(){(function(n){var r=this||eval("this"),i=r.document,f=r.navigator,t=r.jQuery,u=r.JSON;(function(n){"function"==typeof require&&"object"==typeof exports&&"object"==typeof module?n(module.exports||exports):"function"==typeof define&&define.amd?define(["exports"],n):n(r.ko={})})(function(e){function a(n,t){return null===n||typeof n in p?n===t:!1}function w(t,i){var r;return function(){r||(r=setTimeout(function(){r=n;t()},i))}}function b(n,t){var i;return function(){clearTimeout(i);i=setTimeout(n,t)}}function v(n,t,i,r){o.d[n]={init:function(n,u,f,e,s){var c,h;return o.ba(function(){var l=o.a.c(u()),f=!i!=!l,e=!h;(e||t||f!==c)&&(e&&o.ca.fa()&&(h=o.a.lb(o.e.childNodes(n),!0)),f?(e||o.e.U(n,o.a.lb(h)),o.gb(r?r(s,l):s,n)):o.e.da(n),c=f)},null,{G:n}),{controlsDescendantBindings:!0}}};o.g.aa[n]=!1;o.e.Q[n]=!0}var o="undefined"!=typeof e?e:{},p,h,s,c,y,l;o.b=function(n,t){for(var i=n.split("."),r=o,u=0;u<i.length-1;u++)r=r[i[u]];r[i[i.length-1]]=t};o.s=function(n,t,i){n[t]=i};o.version="3.1.0";o.b("version",o.version);o.a=function(){function s(n,t){for(var i in n)n.hasOwnProperty(i)&&t(i,n[i])}function c(n,t){if(t)for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);return n}function l(n,t){return n.__proto__=t,n}var a={__proto__:[]}instanceof Array,h={},v={},y,e;return h[f&&/Firefox\/2/i.test(f.userAgent)?"KeyboardEvent":"UIEvents"]=["keyup","keydown","keypress"],h.MouseEvents="click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave".split(" "),s(h,function(n,t){if(t.length)for(var i=0,r=t.length;i<r;i++)v[t[i]]=n}),y={propertychange:!0},e=i&&function(){for(var t=3,r=i.createElement("div"),u=r.getElementsByTagName("i");r.innerHTML="<!--[if gt IE "+ ++t+"]><i><\/i><![endif]-->",u[0];);return 4<t?t:n}(),{mb:["authenticity_token",/^__RequestVerificationToken(_.*)?$/],r:function(n,t){for(var i=0,r=n.length;i<r;i++)t(n[i],i)},l:function(n,t){if("function"==typeof Array.prototype.indexOf)return Array.prototype.indexOf.call(n,t);for(var i=0,r=n.length;i<r;i++)if(n[i]===t)return i;return-1},hb:function(n,t,i){for(var r=0,u=n.length;r<u;r++)if(t.call(i,n[r],r))return n[r];return null},ma:function(n,t){var i=o.a.l(n,t);0<i?n.splice(i,1):0===i&&n.shift()},ib:function(n){n=n||[];for(var i=[],t=0,r=n.length;t<r;t++)0>o.a.l(i,n[t])&&i.push(n[t]);return i},ya:function(n,t){n=n||[];for(var r=[],i=0,u=n.length;i<u;i++)r.push(t(n[i],i));return r},la:function(n,t){n=n||[];for(var r=[],i=0,u=n.length;i<u;i++)t(n[i],i)&&r.push(n[i]);return r},$:function(n,t){if(t instanceof Array)n.push.apply(n,t);else for(var i=0,r=t.length;i<r;i++)n.push(t[i]);return n},Y:function(n,t,i){var r=o.a.l(o.a.Sa(n),t);0>r?i&&n.push(t):i||n.splice(r,1)},na:a,extend:c,ra:l,sa:a?l:c,A:s,Oa:function(n,t){if(!n)return n;var r={},i;for(i in n)n.hasOwnProperty(i)&&(r[i]=t(n[i],i,n));return r},Fa:function(n){for(;n.firstChild;)o.removeNode(n.firstChild)},ec:function(n){n=o.a.R(n);for(var r=i.createElement("div"),t=0,u=n.length;t<u;t++)r.appendChild(o.M(n[t]));return r},lb:function(n,t){for(var r,i=0,f=n.length,u=[];i<f;i++)r=n[i].cloneNode(!0),u.push(t?o.M(r):r);return u},U:function(n,t){if(o.a.Fa(n),t)for(var i=0,r=t.length;i<r;i++)n.appendChild(t[i])},Bb:function(n,t){var r=n.nodeType?[n]:n;if(0<r.length){for(var f=r[0],e=f.parentNode,i=0,u=t.length;i<u;i++)e.insertBefore(t[i],f);for(i=0,u=r.length;i<u;i++)o.removeNode(r[i])}},ea:function(n,t){if(n.length){for(t=8===t.nodeType&&t.parentNode||t;n.length&&n[0].parentNode!==t;)n.shift();if(1<n.length){var i=n[0],r=n[n.length-1];for(n.length=0;i!==r;)if(n.push(i),i=i.nextSibling,!i)return;n.push(r)}}return n},Db:function(n,t){7>e?n.setAttribute("selected",t):n.selected=t},ta:function(t){return null===t||t===n?"":t.trim?t.trim():t.toString().replace(/^[\s\xa0]+|[\s\xa0]+$/g,"")},oc:function(n,t){for(var r,u=[],f=(n||"").split(t),i=0,e=f.length;i<e;i++)r=o.a.ta(f[i]),""!==r&&u.push(r);return u},kc:function(n,t){return n=n||"",t.length>n.length?!1:n.substring(0,t.length)===t},Sb:function(n,t){if(n===t)return!0;if(11===n.nodeType)return!1;if(t.contains)return t.contains(3===n.nodeType?n.parentNode:n);if(t.compareDocumentPosition)return 16==(t.compareDocumentPosition(n)&16);for(;n&&n!=t;)n=n.parentNode;return!!n},Ea:function(n){return o.a.Sb(n,n.ownerDocument.documentElement)},eb:function(n){return!!o.a.hb(n,o.a.Ea)},B:function(n){return n&&n.tagName&&n.tagName.toLowerCase()},q:function(n,i,r){var s=e&&y[i],u,f;if(!s&&t)t(n).bind(i,r);else if(s||"function"!=typeof n.addEventListener)if("undefined"!=typeof n.attachEvent)u=function(t){r.call(n,t)},f="on"+i,n.attachEvent(f,u),o.a.u.ja(n,function(){n.detachEvent(f,u)});else throw Error("Browser doesn't support addEventListener or attachEvent");else n.addEventListener(i,r,!1)},ha:function(n,u){if(!n||!n.nodeType)throw Error("element must be a DOM node when calling triggerEvent");var f;if("input"===o.a.B(n)&&n.type&&"click"==u.toLowerCase()?(f=n.type,f="checkbox"==f||"radio"==f):f=!1,t&&!f)t(n).trigger(u);else if("function"==typeof i.createEvent)if("function"==typeof n.dispatchEvent)f=i.createEvent(v[u]||"HTMLEvents"),f.initEvent(u,!0,!0,r,0,0,0,0,0,!1,!1,!1,!1,0,n),n.dispatchEvent(f);else throw Error("The supplied element doesn't support dispatchEvent");else if(f&&n.click)n.click();else if("undefined"!=typeof n.fireEvent)n.fireEvent("on"+u);else throw Error("Browser doesn't support triggering events");},c:function(n){return o.v(n)?n():n},Sa:function(n){return o.v(n)?n.o():n},ua:function(n,t,i){if(t){var r=/\S+/g,u=n.className.match(r)||[];o.a.r(t.match(r),function(n){o.a.Y(u,n,i)});n.className=u.join(" ")}},Xa:function(t,i){var r=o.a.c(i),u;(null===r||r===n)&&(r="");u=o.e.firstChild(t);!u||3!=u.nodeType||o.e.nextSibling(u)?o.e.U(t,[t.ownerDocument.createTextNode(r)]):u.data=r;o.a.Vb(t)},Cb:function(n,t){if(n.name=t,7>=e)try{n.mergeAttributes(i.createElement("<input name='"+n.name+"'/>"),!1)}catch(r){}},Vb:function(n){9<=e&&(n=1==n.nodeType?n:n.parentNode,n.style&&(n.style.zoom=n.style.zoom))},Tb:function(n){if(e){var t=n.style.width;n.style.width=0;n.style.width=t}},ic:function(n,t){n=o.a.c(n);t=o.a.c(t);for(var r=[],i=n;i<=t;i++)r.push(i);return r},R:function(n){for(var i=[],t=0,r=n.length;t<r;t++)i.push(n[t]);return i},mc:6===e,nc:7===e,oa:e,ob:function(n,t){for(var r=o.a.R(n.getElementsByTagName("input")).concat(o.a.R(n.getElementsByTagName("textarea"))),f="string"==typeof t?function(n){return n.name===t}:function(n){return t.test(n.name)},u=[],i=r.length-1;0<=i;i--)f(r[i])&&u.push(r[i]);return u},fc:function(n){return"string"==typeof n&&(n=o.a.ta(n))?u&&u.parse?u.parse(n):new Function("return "+n)():null},Ya:function(n,t,i){if(!u||!u.stringify)throw Error("Cannot find JSON.stringify(). Some browsers (e.g., IE < 8) don't support it natively, but you can overcome this by adding a script reference to json2.js, downloadable from http://www.json.org/json2.js");return u.stringify(o.a.c(n),t,i)},gc:function(n,t,r){var c,e,h,f,u,l;r=r||{};var a=r.params||{},v=r.includeFields||this.mb,c=n;if("object"==typeof n&&"form"===o.a.B(n))for(c=n.action,e=v.length-1;0<=e;e--)for(h=o.a.ob(n,v[e]),f=h.length-1;0<=f;f--)a[h[f].name]=h[f].value;t=o.a.c(t);u=i.createElement("form");u.style.display="none";u.action=c;u.method="post";for(l in t)n=i.createElement("input"),n.name=l,n.value=o.a.Ya(o.a.c(t[l])),u.appendChild(n);s(a,function(n,t){var r=i.createElement("input");r.name=n;r.value=t;u.appendChild(r)});i.body.appendChild(u);r.submitter?r.submitter(u):u.submit();setTimeout(function(){u.parentNode.removeChild(u)},0)}}}();o.b("utils",o.a);o.b("utils.arrayForEach",o.a.r);o.b("utils.arrayFirst",o.a.hb);o.b("utils.arrayFilter",o.a.la);o.b("utils.arrayGetDistinctValues",o.a.ib);o.b("utils.arrayIndexOf",o.a.l);o.b("utils.arrayMap",o.a.ya);o.b("utils.arrayPushAll",o.a.$);o.b("utils.arrayRemoveItem",o.a.ma);o.b("utils.extend",o.a.extend);o.b("utils.fieldsIncludedWithJsonPost",o.a.mb);o.b("utils.getFormFields",o.a.ob);o.b("utils.peekObservable",o.a.Sa);o.b("utils.postJson",o.a.gc);o.b("utils.parseJson",o.a.fc);o.b("utils.registerEventHandler",o.a.q);o.b("utils.stringifyJson",o.a.Ya);o.b("utils.range",o.a.ic);o.b("utils.toggleDomNodeCssClass",o.a.ua);o.b("utils.triggerEvent",o.a.ha);o.b("utils.unwrapObservable",o.a.c);o.b("utils.objectForEach",o.a.A);o.b("utils.addOrRemoveItem",o.a.Y);o.b("unwrap",o.a.c);Function.prototype.bind||(Function.prototype.bind=function(n){var i=this,t=Array.prototype.slice.call(arguments);return n=t.shift(),function(){return i.apply(n,t.concat(Array.prototype.slice.call(arguments)))}});o.a.f=new function(){function r(r,f){var e=r[t];if(!e||"null"===e||!i[e]){if(!f)return n;e=r[t]="ko"+u++;i[e]={}}return i[e]}var u=0,t="__ko__"+(new Date).getTime(),i={};return{get:function(t,i){var u=r(t,!1);return u===n?n:u[i]},set:function(t,i,u){(u!==n||r(t,!1)!==n)&&(r(t,!0)[i]=u)},clear:function(n){var r=n[t];return r?(delete i[r],n[t]=null,!0):!1},L:function(){return u+++t}}};o.b("utils.domData",o.a.f);o.b("utils.domData.clear",o.a.f.clear);o.a.u=new function(){function i(t,i){var r=o.a.f.get(t,u);return r===n&&i&&(r=[],o.a.f.set(t,u,r)),r}function r(n){var t=i(n,!1),u;if(t)for(t=t.slice(0),u=0;u<t.length;u++)t[u](n);if(o.a.f.clear(n),o.a.u.cleanExternalData(n),f[n.nodeType])for(t=n.firstChild;n=t;)t=n.nextSibling,8===n.nodeType&&r(n)}var u=o.a.f.L(),e={1:!0,8:!0,9:!0},f={1:!0,9:!0};return{ja:function(n,t){if("function"!=typeof t)throw Error("Callback must be a function");i(n,!0).push(t)},Ab:function(t,r){var f=i(t,!1);f&&(o.a.ma(f,r),0==f.length&&o.a.f.set(t,u,n))},M:function(n){var t,i,u;if(e[n.nodeType]&&(r(n),f[n.nodeType]))for(t=[],o.a.$(t,n.getElementsByTagName("*")),i=0,u=t.length;i<u;i++)r(t[i]);return n},removeNode:function(n){o.M(n);n.parentNode&&n.parentNode.removeChild(n)},cleanExternalData:function(n){t&&"function"==typeof t.cleanData&&t.cleanData([n])}}};o.M=o.a.u.M;o.removeNode=o.a.u.removeNode;o.b("cleanNode",o.M);o.b("removeNode",o.removeNode);o.b("utils.domNodeDisposal",o.a.u);o.b("utils.domNodeDisposal.addDisposeCallback",o.a.u.ja);o.b("utils.domNodeDisposal.removeDisposeCallback",o.a.u.Ab),function(){o.a.Qa=function(n){var u,f;if(t){if(t.parseHTML)u=t.parseHTML(n)||[];else if((u=t.clean([n]))&&u[0]){for(n=u[0];n.parentNode&&11!==n.parentNode.nodeType;)n=n.parentNode;n.parentNode&&n.parentNode.removeChild(n)}}else{for(f=o.a.ta(n).toLowerCase(),u=i.createElement("div"),f=f.match(/^<(thead|tbody|tfoot)/)&&[1,"<table>","<\/table>"]||!f.indexOf("<tr")&&[2,"<table><tbody>","<\/tbody><\/table>"]||(!f.indexOf("<td")||!f.indexOf("<th"))&&[3,"<table><tbody><tr>","<\/tr><\/tbody><\/table>"]||[0,"",""],n="ignored<div>"+f[1]+n+f[2]+"<\/div>","function"==typeof r.innerShiv?u.appendChild(r.innerShiv(n)):u.innerHTML=n;f[0]--;)u=u.lastChild;u=o.a.R(u.lastChild.childNodes)}return u};o.a.Va=function(i,r){if(o.a.Fa(i),r=o.a.c(r),null!==r&&r!==n)if("string"!=typeof r&&(r=r.toString()),t)t(i).html(r);else for(var f=o.a.Qa(r),u=0;u<f.length;u++)i.appendChild(f[u])}}();o.b("utils.parseHtmlFragment",o.a.Qa);o.b("utils.setHtml",o.a.Va);o.w=function(){function i(n,t){var r;if(n)if(8==n.nodeType)r=o.w.xb(n.nodeValue),null!=r&&t.push({Rb:n,cc:r});else if(1==n.nodeType)for(var r=0,u=n.childNodes,f=u.length;r<f;r++)i(u[r],t)}var t={};return{Na:function(n){if("function"!=typeof n)throw Error("You can only pass a function to ko.memoization.memoize()");var i=(4294967296*(1+Math.random())|0).toString(16).substring(1)+(4294967296*(1+Math.random())|0).toString(16).substring(1);return t[i]=n,"<!--[ko_memo:"+i+"]-->"},Hb:function(i,r){var u=t[i];if(u===n)throw Error("Couldn't find any memo with ID "+i+". Perhaps it's already been unmemoized.");try{return u.apply(null,r||[]),!0}finally{delete t[i]}},Ib:function(n,t){var f=[],u,s,r,e;for(i(n,f),u=0,s=f.length;u<s;u++)r=f[u].Rb,e=[r],t&&o.a.$(e,t),o.w.Hb(f[u].cc,e),r.nodeValue="",r.parentNode&&r.parentNode.removeChild(r)},xb:function(n){return(n=n.match(/^\[ko_memo\:(.*?)\]$/))?n[1]:null}}}();o.b("memoization",o.w);o.b("memoization.memoize",o.w.Na);o.b("memoization.unmemoize",o.w.Hb);o.b("memoization.parseMemoText",o.w.xb);o.b("memoization.unmemoizeDomNodeAndDescendants",o.w.Ib);o.Ga={throttle:function(n,t){n.throttleEvaluation=t;var i=null;return o.h({read:n,write:function(r){clearTimeout(i);i=setTimeout(function(){n(r)},t)}})},rateLimit:function(n,t){var i,r,u;"number"==typeof t?i=t:(i=t.timeout,r=t.method);u="notifyWhenChangesStop"==r?b:w;n.Ma(function(n){return u(n,i)})},notify:function(n,t){n.equalityComparer="always"==t?null:a}};p={undefined:1,boolean:1,number:1,string:1};o.b("extenders",o.Ga);o.Fb=function(n,t,i){this.target=n;this.za=t;this.Qb=i;this.sb=!1;o.s(this,"dispose",this.F)};o.Fb.prototype.F=function(){this.sb=!0;this.Qb()};o.N=function(){o.a.sa(this,o.N.fn);this.H={}};h="change";e={V:function(n,t,i){var r=this,u;return i=i||h,u=new o.Fb(r,t?n.bind(t):n,function(){o.a.ma(r.H[i],u)}),r.o&&r.o(),r.H[i]||(r.H[i]=[]),r.H[i].push(u),u},notifySubscribers:function(n,t){if(t=t||h,this.qb(t))try{o.k.jb();for(var u=this.H[t].slice(0),r=0,i;i=u[r];++r)i.sb||i.za(n)}finally{o.k.end()}},Ma:function(n){var t=this,e=o.v(t),r,u,i,f;t.ia||(t.ia=t.notifySubscribers,t.notifySubscribers=function(n,i){i&&i!==h?"beforeChange"===i?t.bb(n):t.ia(n,i):t.cb(n)});f=n(function(){e&&i===t&&(i=t());r=!1;t.Ka(u,i)&&t.ia(u=i)});t.cb=function(n){r=!0;i=n;f()};t.bb=function(n){r||(u=n,t.ia(n,"beforeChange"))}},qb:function(n){return this.H[n]&&this.H[n].length},Wb:function(){var n=0;return o.a.A(this.H,function(t,i){n+=i.length}),n},Ka:function(n,t){return!this.equalityComparer||!this.equalityComparer(n,t)},extend:function(n){var t=this;return n&&o.a.A(n,function(n,i){var r=o.Ga[n];"function"==typeof r&&(t=r(t,i)||t)}),t}};o.s(e,"subscribe",e.V);o.s(e,"extend",e.extend);o.s(e,"getSubscriptionsCount",e.Wb);o.a.na&&o.a.ra(e,Function.prototype);o.N.fn=e;o.tb=function(n){return null!=n&&"function"==typeof n.V&&"function"==typeof n.notifySubscribers};o.b("subscribable",o.N);o.b("isSubscribable",o.tb);o.ca=o.k=function(){function t(t){r.push(n);n=t}function i(){n=r.pop()}var r=[],n,u=0;return{jb:t,end:i,zb:function(t){if(n){if(!o.tb(t))throw Error("Only subscribable things can act as dependencies");n.za(t,t.Kb||(t.Kb=++u))}},t:function(n,r,u){try{return t(),n.apply(r,u||[])}finally{i()}},fa:function(){if(n)return n.ba.fa()},pa:function(){if(n)return n.pa}}}();o.b("computedContext",o.ca);o.b("computedContext.getDependenciesCount",o.ca.fa);o.b("computedContext.isInitial",o.ca.pa);o.m=function(n){function t(){return 0<arguments.length?(t.Ka(i,arguments[0])&&(t.P(),i=arguments[0],t.O()),this):(o.k.zb(t),i)}var i=n;return o.N.call(t),o.a.sa(t,o.m.fn),t.o=function(){return i},t.O=function(){t.notifySubscribers(i)},t.P=function(){t.notifySubscribers(i,"beforeChange")},o.s(t,"peek",t.o),o.s(t,"valueHasMutated",t.O),o.s(t,"valueWillMutate",t.P),t};o.m.fn={equalityComparer:a};s=o.m.hc="__ko_proto__";o.m.fn[s]=o.m;o.a.na&&o.a.ra(o.m.fn,o.N.fn);o.Ha=function(t,i){return null===t||t===n||t[s]===n?!1:t[s]===i?!0:o.Ha(t[s],i)};o.v=function(n){return o.Ha(n,o.m)};o.ub=function(n){return"function"==typeof n&&n[s]===o.m||"function"==typeof n&&n[s]===o.h&&n.Yb?!0:!1};o.b("observable",o.m);o.b("isObservable",o.v);o.b("isWriteableObservable",o.ub);o.T=function(n){if(n=n||[],"object"!=typeof n||!("length"in n))throw Error("The argument passed when initializing an observable array must be an array, or null, or undefined.");return n=o.m(n),o.a.sa(n,o.T.fn),n.extend({trackArrayChanges:!0})};o.T.fn={remove:function(n){for(var u,r=this.o(),i=[],f="function"!=typeof n||o.v(n)?function(t){return t===n}:n,t=0;t<r.length;t++)u=r[t],f(u)&&(0===i.length&&this.P(),i.push(u),r.splice(t,1),t--);return i.length&&this.O(),i},removeAll:function(t){if(t===n){var i=this.o(),r=i.slice(0);return this.P(),i.splice(0,i.length),this.O(),r}return t?this.remove(function(n){return 0<=o.a.l(t,n)}):[]},destroy:function(n){var i=this.o(),r="function"!=typeof n||o.v(n)?function(t){return t===n}:n,t;for(this.P(),t=i.length-1;0<=t;t--)r(i[t])&&(i[t]._destroy=!0);this.O()},destroyAll:function(t){return t===n?this.destroy(function(){return!0}):t?this.destroy(function(n){return 0<=o.a.l(t,n)}):[]},indexOf:function(n){var t=this();return o.a.l(t,n)},replace:function(n,t){var i=this.indexOf(n);0<=i&&(this.P(),this.o()[i]=t,this.O())}};o.a.r("pop push reverse shift sort splice unshift".split(" "),function(n){o.T.fn[n]=function(){var t=this.o();return this.P(),this.kb(t,n,arguments),t=t[n].apply(t,arguments),this.O(),t}});o.a.r(["slice"],function(n){o.T.fn[n]=function(){var t=this();return t[n].apply(t,arguments)}});o.a.na&&o.a.ra(o.T.fn,o.m.fn);o.b("observableArray",o.T);c="arrayChange";o.Ga.trackArrayChanges=function(n){function u(){var f,u;r||(r=!0,f=n.notifySubscribers,n.notifySubscribers=function(n,t){return t&&t!==h||++i,f.apply(this,arguments)},u=[].concat(n.o()||[]),t=null,n.V(function(r){if(r=[].concat(r||[]),n.qb(c)){var f;(!t||1<i)&&(t=o.a.Aa(u,r,{sparse:!0}));f=t;f.length&&n.notifySubscribers(f,c)}u=r;t=null;i=0}))}if(!n.kb){var r=!1,t=null,i=0,f=n.V;n.V=n.subscribe=function(n,t,i){return i===c&&u(),f.apply(this,arguments)};n.kb=function(n,u,f){function c(n,t,i){return l[l.length]={status:n,value:t,index:i}}if(r&&!i){var l=[],e=n.length,h=f.length,s=0;switch(u){case"push":s=e;case"unshift":for(u=0;u<h;u++)c("added",f[u],s+u);break;case"pop":s=e-1;case"shift":e&&c("deleted",n[s],s);break;case"splice":u=Math.min(Math.max(0,0>f[0]?e+f[0]:f[0]),e);for(var e=1===h?e:Math.min(u+(f[1]||0),e),h=u+h-2,s=Math.max(e,h),a=[],v=[],y=2;u<s;++u,++y)u<e&&v.push(c("deleted",n[u],u)),u<h&&a.push(c("added",f[y],u));o.a.nb(v,a);break;default:return}t=l}}}};o.ba=o.h=function(n,t,i){function k(){p=!0;o.a.A(h,function(n,t){t.F()});h={};u=0;c=!1}function it(){var n=r.throttleEvaluation;n&&0<=n?(clearTimeout(nt),nt=setTimeout(a,n)):r.wa?r.wa():a()}function a(){var n,i,s;if(!v&&!p){if(b&&b()){if(!y){l();return}}else y=!1;v=!0;try{n=h;i=u;o.k.jb({za:function(t,r){p||(i&&n[r]?(h[r]=n[r],++u,delete n[r],--i):h[r]||(h[r]=t.V(it),++u))},ba:r,pa:!u});h={};u=0;try{s=t?f.call(t):f()}finally{o.k.end();i&&o.a.A(n,function(n,t){t.F()});c=!1}r.Ka(e,s)&&(r.notifySubscribers(e,"beforeChange"),e=s,r.wa&&!r.throttleEvaluation||r.notifySubscribers(e))}finally{v=!1}u||l()}}function r(){if(0<arguments.length){if("function"==typeof g)g.apply(t,arguments);else throw Error("Cannot write a value to a ko.computed unless you specify a 'write' option. If you wish to read the current value, don't pass any parameters.");return this}return c&&a(),o.k.zb(r),e}function d(){return c||0<u}var e,c=!0,v=!1,y=!1,p=!1,f=n,tt;if(f&&"object"==typeof f?(i=f,f=i.read):(i=i||{},f||(f=i.read)),"function"!=typeof f)throw Error("Pass a function that returns the value of the ko.computed");var g=i.write,s=i.disposeWhenNodeIsRemoved||i.G||null,w=i.disposeWhen||i.Da,b=w,l=k,h={},u=0,nt=null;return t||(t=i.owner),o.N.call(r),o.a.sa(r,o.h.fn),r.o=function(){return c&&!u&&a(),e},r.fa=function(){return u},r.Yb="function"==typeof i.write,r.F=function(){l()},r.ga=d,tt=r.Ma,r.Ma=function(n){tt.call(r,n);r.wa=function(){r.bb(e);c=!0;r.cb(r)}},o.s(r,"peek",r.o),o.s(r,"dispose",r.F),o.s(r,"isActive",r.ga),o.s(r,"getDependenciesCount",r.fa),s&&(y=!0,s.nodeType&&(b=function(){return!o.a.Ea(s)||w&&w()})),!0!==i.deferEvaluation&&a(),s&&d()&&s.nodeType&&(l=function(){o.a.u.Ab(s,l);k()},o.a.u.ja(s,l)),r};o.$b=function(n){return o.Ha(n,o.h)};e=o.m.hc;o.h[e]=o.m;o.h.fn={equalityComparer:a};o.h.fn[e]=o.h;o.a.na&&o.a.ra(o.h.fn,o.N.fn);o.b("dependentObservable",o.h);o.b("computed",o.h);o.b("isComputed",o.$b),function(){function t(u,f,e){if(e=e||new i,u=f(u),"object"!=typeof u||null===u||u===n||u instanceof Date||u instanceof String||u instanceof Number||u instanceof Boolean)return u;var o=u instanceof Array?[]:{};return e.save(u,o),r(u,function(i){var r=f(u[i]),s;switch(typeof r){case"boolean":case"number":case"string":case"function":o[i]=r;break;case"object":case"undefined":s=e.get(r);o[i]=s!==n?s:t(r,f,e)}}),o}function r(n,t){if(n instanceof Array){for(var i=0;i<n.length;i++)t(i);"function"==typeof n.toJSON&&t("toJSON")}else for(i in n)t(i)}function i(){this.keys=[];this.ab=[]}o.Gb=function(n){if(0==arguments.length)throw Error("When calling ko.toJS, pass the object you want to convert.");return t(n,function(n){for(var t=0;o.v(n)&&10>t;t++)n=n();return n})};o.toJSON=function(n,t,i){return n=o.Gb(n),o.a.Ya(n,t,i)};i.prototype={save:function(n,t){var i=o.a.l(this.keys,n);0<=i?this.ab[i]=t:(this.keys.push(n),this.ab.push(t))},get:function(t){return t=o.a.l(this.keys,t),0<=t?this.ab[t]:n}}}();o.b("toJS",o.Gb);o.b("toJSON",o.toJSON),function(){o.i={p:function(t){switch(o.a.B(t)){case"option":return!0===t.__ko__hasDomDataOptionValue__?o.a.f.get(t,o.d.options.Pa):7>=o.a.oa?t.getAttributeNode("value")&&t.getAttributeNode("value").specified?t.value:t.text:t.value;case"select":return 0<=t.selectedIndex?o.i.p(t.options[t.selectedIndex]):n;default:return t.value}},X:function(t,i,r){switch(o.a.B(t)){case"option":switch(typeof i){case"string":o.a.f.set(t,o.d.options.Pa,n);"__ko__hasDomDataOptionValue__"in t&&delete t.__ko__hasDomDataOptionValue__;t.value=i;break;default:o.a.f.set(t,o.d.options.Pa,i);t.__ko__hasDomDataOptionValue__=!0;t.value="number"==typeof i?i:""}break;case"select":(""===i||null===i)&&(i=n);for(var f=-1,u=0,s=t.options.length,e;u<s;++u)if(e=o.i.p(t.options[u]),e==i||""==e&&i===n){f=u;break}(r||0<=f||i===n&&1<t.size)&&(t.selectedIndex=f);break;default:(null===i||i===n)&&(i="");t.value=i}}}}();o.b("selectExtensions",o.i);o.b("selectExtensions.readValue",o.i.p);o.b("selectExtensions.writeValue",o.i.X);o.g=function(){function n(n){var c,r,i;n=o.a.ta(n);123===n.charCodeAt(0)&&(n=n.slice(1,-1));var a=[],s=n.match(t),h,u,l=0;if(s)for(s.push(","),c=0;r=s[c];++c){if(i=r.charCodeAt(0),44===i){if(0>=l){h&&a.push(u?{key:h,value:u.join("")}:{unknown:h});h=u=l=0;continue}}else if(58===i){if(!u)continue}else if(47===i&&c&&1<r.length)(i=s[c-1].match(f))&&!e[i[0]]&&(n=n.substr(n.indexOf(r)+1),s=n.match(t),s.push(","),c=-1,r="/");else if(40===i||123===i||91===i)++l;else if(41===i||125===i||93===i)--l;else if(!h&&!u){h=34===i||39===i?r.slice(1,-1):r;continue}u?u.push(r):u=[r]}return a}var r=["true","false","null","undefined"],u=/^(?:[$_a-z][$\w]*|(.+)(\.\s*[$_a-z][$\w]*|\[.+\]))$/i,t=RegExp("\"(?:[^\"\\\\]|\\\\.)*\"|'(?:[^'\\\\]|\\\\.)*'|/(?:[^/\\\\]|\\\\.)*/w*|[^\\s:,/][^,\"'{}()/:[\\]]*[^\\s,\"'{}()/:[\\]]|[^\\s]","g"),f=/[\])"'A-Za-z0-9_$]+$/,e={"in":1,"return":1,"typeof":1},i={};return{aa:[],W:i,Ra:n,qa:function(t,f){function e(n,t){var l,f=o.getBindingHandler(n);(f&&f.preprocess?t=f.preprocess(t,n,e):1)&&((f=i[n])&&(l=t,0<=o.a.l(r,l)?l=!1:(f=l.match(u),l=null===f?!1:f[1]?"Object("+f[1]+")"+f[2]:l),f=l),f&&s.push("'"+n+"':function(_z){"+l+"=_z}"),c&&(t="function(){return "+t+" }"),h.push("'"+n+"':"+t))}f=f||{};var h=[],s=[],c=f.valueAccessors,l="string"==typeof t?n(t):t;return o.a.r(l,function(n){e(n.key||n.unknown,n.value)}),s.length&&e("_ko_property_writers","{"+s.join(",")+" }"),h.join(",")},bc:function(n,t){for(var i=0;i<n.length;i++)if(n[i].key==t)return!0;return!1},va:function(n,t,i,r,u){n&&o.v(n)?!o.ub(n)||u&&n.o()===r||n(r):(n=t.get("_ko_property_writers"))&&n[i]&&n[i](r)}}}();o.b("expressionRewriting",o.g);o.b("expressionRewriting.bindingRewriteValidators",o.g.aa);o.b("expressionRewriting.parseObjectLiteral",o.g.Ra);o.b("expressionRewriting.preProcessBindings",o.g.qa);o.b("expressionRewriting._twoWayBindings",o.g.W);o.b("jsonExpressionRewriting",o.g);o.b("jsonExpressionRewriting.insertPropertyAccessorsIntoJson",o.g.qa),function(){function n(n){return 8==n.nodeType&&e.test(t?n.text:n.nodeValue)}function r(n){return 8==n.nodeType&&s.test(t?n.text:n.nodeValue)}function u(t,i){for(var u=t,f=1,e=[];u=u.nextSibling;){if(r(u)&&(f--,0===f))return e;e.push(u);n(u)&&f++}if(!i)throw Error("Cannot find closing comment tag to match: "+t.nodeValue);return null}function f(n,t){var i=u(n,t);return i?0<i.length?i[i.length-1].nextSibling:n.nextSibling:null}var t=i&&"<!--test-->"===i.createComment("test").text,e=t?/^\x3c!--\s*ko(?:\s+([\s\S]+))?\s*--\x3e$/:/^\s*ko(?:\s+([\s\S]+))?\s*$/,s=t?/^\x3c!--\s*\/ko\s*--\x3e$/:/^\s*\/ko\s*$/,h={ul:!0,ol:!0};o.e={Q:{},childNodes:function(t){return n(t)?u(t):t.childNodes},da:function(t){if(n(t)){t=o.e.childNodes(t);for(var i=0,r=t.length;i<r;i++)o.removeNode(t[i])}else o.a.Fa(t)},U:function(t,i){if(n(t)){o.e.da(t);for(var u=t.nextSibling,r=0,f=i.length;r<f;r++)u.parentNode.insertBefore(i[r],u)}else o.a.U(t,i)},yb:function(t,i){n(t)?t.parentNode.insertBefore(i,t.nextSibling):t.firstChild?t.insertBefore(i,t.firstChild):t.appendChild(i)},rb:function(t,i,r){r?n(t)?t.parentNode.insertBefore(i,r.nextSibling):r.nextSibling?t.insertBefore(i,r.nextSibling):t.appendChild(i):o.e.yb(t,i)},firstChild:function(t){return n(t)?!t.nextSibling||r(t.nextSibling)?null:t.nextSibling:t.firstChild},nextSibling:function(t){return n(t)&&(t=f(t)),t.nextSibling&&r(t.nextSibling)?null:t.nextSibling},Xb:n,lc:function(n){return(n=(t?n.text:n.nodeValue).match(e))?n[1]:null},wb:function(t){var s,i,u,e;if(h[o.a.B(t)]&&(s=t.firstChild,s))do if(1===s.nodeType){if(i=s.firstChild,u=null,i)do u?u.push(i):n(i)?(e=f(i,!0),e?i=e:u=[i]):r(i)&&(u=[i]);while(i=i.nextSibling);if(i=u)for(u=s.nextSibling,e=0;e<i.length;e++)u?t.insertBefore(i[e],u):t.appendChild(i[e])}while(s=s.nextSibling)}}}();o.b("virtualElements",o.e);o.b("virtualElements.allowedBindings",o.e.Q);o.b("virtualElements.emptyNode",o.e.da);o.b("virtualElements.insertAfter",o.e.rb);o.b("virtualElements.prepend",o.e.yb);o.b("virtualElements.setDomNodeChildren",o.e.U),function(){o.J=function(){this.Nb={}};o.a.extend(o.J.prototype,{nodeHasBindings:function(n){switch(n.nodeType){case 1:return null!=n.getAttribute("data-bind");case 8:return o.e.Xb(n);default:return!1}},getBindings:function(n,t){var i=this.getBindingsString(n,t);return i?this.parseBindingsString(i,t,n):null},getBindingAccessors:function(n,t){var i=this.getBindingsString(n,t);return i?this.parseBindingsString(i,t,n,{valueAccessors:!0}):null},getBindingsString:function(n){switch(n.nodeType){case 1:return n.getAttribute("data-bind");case 8:return o.e.lc(n);default:return null}},parseBindingsString:function(n,t,i,r){var u,f,e,h,c;try{return u=this.Nb,f=n+(r&&r.valueAccessors||""),(e=u[f])||(c="with($context){with($data||{}){return{"+o.g.qa(n,r)+"}}}",h=new Function("$context","$element",c),e=u[f]=h),e(t,i)}catch(s){throw s.message="Unable to parse bindings.\nBindings value: "+n+"\nMessage: "+s.message,s;}}});o.J.instance=new o.J}();o.b("bindingProvider",o.J),function(){function v(n){return function(){return n}}function u(n){return n()}function s(n){return o.a.Oa(o.k.t(n),function(t,i){return function(){return n()[i]}})}function y(n,t){return s(this.getBindings.bind(this,n,t))}function h(n,t,i){var r,u=o.e.firstChild(t),f=o.J.instance,e=f.preprocessNode;if(e){for(;r=u;)u=o.e.nextSibling(r),e.call(f,r);u=o.e.firstChild(t)}for(;r=u;)u=o.e.nextSibling(r),c(n,r,i)}function c(n,t,i){var u=!0,r=1===t.nodeType;r&&o.e.wb(t);(r&&i||o.J.instance.nodeHasBindings(t))&&(u=l(t,null,n,i).shouldBindDescendants);u&&!a[o.a.B(t)]&&h(n,t,!r)}function p(n){var i=[],r={},t=[];return o.a.A(n,function u(f){if(!r[f]){var e=o.getBindingHandler(f);e&&(e.after&&(t.push(f),o.a.r(e.after,function(i){if(n[i]){if(-1!==o.a.l(t,i))throw Error("Cannot combine the following bindings, because they have a cyclic dependency: "+t.join(", "));u(i)}}),t.length--),i.push({key:f,pb:e}));r[f]=!0}}),i}function l(t,i,r,e){var v=o.a.f.get(t,f),s,l,a,c;if(!i){if(v)throw Error("You cannot apply bindings multiple times to the same element.");o.a.f.set(t,f,!0)}if(!v&&e&&o.Eb(t,r),i&&"function"!=typeof i)s=i;else{var w=o.J.instance,b=w.getBindingAccessors||y,h=o.h(function(){return(s=i?i(r,t):b.call(w,t,r))&&r.D&&r.D(),s},null,{G:t});s&&h.ga()||(h=null)}return s&&(a=h?function(n){return function(){return u(h()[n])}}:function(n){return s[n]},c=function(){return o.a.Oa(h?h():s,u)},c.get=function(n){return s[n]&&u(a(n))},c.has=function(n){return n in s},e=p(s),o.a.r(e,function(i){var e=i.pb.init,h=i.pb.update,u=i.key;if(8===t.nodeType&&!o.e.Q[u])throw Error("The binding '"+u+"' cannot be used with virtual elements");try{"function"==typeof e&&o.k.t(function(){var i=e(t,a(u),c,r.$data,r);if(i&&i.controlsDescendantBindings){if(l!==n)throw Error("Multiple bindings ("+l+" and "+u+") are trying to control descendant bindings of the same element. You cannot use these bindings together on the same element.");l=u}});"function"==typeof h&&o.h(function(){h(t,a(u),c,r.$data,r)},null,{G:t})}catch(f){throw f.message='Unable to process binding "'+u+": "+s[u]+'"\nMessage: '+f.message,f;}})),{shouldBindDescendants:l===n}}function i(n){return n&&n instanceof o.I?n:new o.I(n)}var a,f,e;o.d={};a={script:!0};o.getBindingHandler=function(n){return o.d[n]};o.I=function(t,i,r,u){var f=this,h="function"==typeof t&&!o.v(t),s,e=o.h(function(){var s=h?t():t,n=o.a.c(s);return i?(i.D&&i.D(),o.a.extend(f,i),e&&(f.D=e)):(f.$parents=[],f.$root=n,f.ko=o),f.$rawData=s,f.$data=n,r&&(f[r]=n),u&&u(f,i,n),f.$data},null,{Da:function(){return s&&!o.a.eb(s)},G:!0});e.ga()&&(f.D=e,e.equalityComparer=null,s=[],e.Jb=function(t){s.push(t);o.a.u.ja(t,function(t){o.a.ma(s,t);s.length||(e.F(),f.D=e=n)})})};o.I.prototype.createChildContext=function(n,t,i){return new o.I(n,this,t,function(n,t){n.$parentContext=t;n.$parent=t.$data;n.$parents=(t.$parents||[]).slice(0);n.$parents.unshift(n.$parent);i&&i(n)})};o.I.prototype.extend=function(n){return new o.I(this.D||this.$data,this,null,function(t,i){t.$rawData=i.$rawData;o.a.extend(t,"function"==typeof n?n():n)})};f=o.a.f.L();e=o.a.f.L();o.Eb=function(n,t){if(2==arguments.length)o.a.f.set(n,e,t),t.D&&t.D.Jb(n);else return o.a.f.get(n,e)};o.xa=function(n,t,r){return 1===n.nodeType&&o.e.wb(n),l(n,t,i(r),!0)};o.Lb=function(n,t,r){return r=i(r),o.xa(n,"function"==typeof t?s(t.bind(null,r,n)):o.a.Oa(t,v),r)};o.gb=function(n,t){1!==t.nodeType&&8!==t.nodeType||h(i(n),t,!0)};o.fb=function(n,u){if(!t&&r.jQuery&&(t=r.jQuery),u&&1!==u.nodeType&&8!==u.nodeType)throw Error("ko.applyBindings: first parameter should be your view model; second parameter should be a DOM node");u=u||r.document.body;c(i(n),u,!0)};o.Ca=function(t){switch(t.nodeType){case 1:case 8:var i=o.Eb(t);if(i)return i;if(t.parentNode)return o.Ca(t.parentNode)}return n};o.Pb=function(t){return(t=o.Ca(t))?t.$data:n};o.b("bindingHandlers",o.d);o.b("applyBindings",o.fb);o.b("applyBindingsToDescendants",o.gb);o.b("applyBindingAccessorsToNode",o.xa);o.b("applyBindingsToNode",o.Lb);o.b("contextFor",o.Ca);o.b("dataFor",o.Pb)}();y={"class":"className","for":"htmlFor"};o.d.attr={update:function(t,i){var r=o.a.c(i())||{};o.a.A(r,function(i,r){r=o.a.c(r);var u=!1===r||null===r||r===n;u&&t.removeAttribute(i);8>=o.a.oa&&i in y?(i=y[i],u?t.removeAttribute(i):t[i]=r):u||t.setAttribute(i,r.toString());"name"===i&&o.a.Cb(t,u?"":r.toString())})}},function(){o.d.checked={after:["value","attr"],init:function(t,i,r){function u(){return r.has("checkedValue")?o.a.c(r.get("checkedValue")):t.value}function c(){var c=t.checked,n=a?u():c,s;o.ca.pa()||f&&!c||(s=o.k.t(i),e?h!==n?(c&&(o.a.Y(s,n,!0),o.a.Y(s,h,!1)),h=n):o.a.Y(s,n,c):o.g.va(s,r,"checked",n,!0))}function l(){var n=o.a.c(i());t.checked=e?0<=o.a.l(n,u()):s?n:u()===n}var s="checkbox"==t.type,f="radio"==t.type;if(s||f){var e=s&&o.a.c(i())instanceof Array,h=e?u():n,a=f||e;f&&!t.name&&o.d.uniqueName.init(t,function(){return!0});o.ba(c,null,{G:t});o.a.q(t,"click",c);o.ba(l,null,{G:t})}}};o.g.W.checked=!0;o.d.checkedValue={update:function(n,t){n.value=o.a.c(t())}}}();o.d.css={update:function(n,t){var i=o.a.c(t());"object"==typeof i?o.a.A(i,function(t,i){i=o.a.c(i);o.a.ua(n,t,i)}):(i=String(i||""),o.a.ua(n,n.__ko__cssValue,!1),n.__ko__cssValue=i,o.a.ua(n,i,!0))}};o.d.enable={update:function(n,t){var i=o.a.c(t());i&&n.disabled?n.removeAttribute("disabled"):i||n.disabled||(n.disabled=!0)}};o.d.disable={update:function(n,t){o.d.enable.update(n,function(){return!o.a.c(t())})}};o.d.event={init:function(n,t,i,r,u){var f=t()||{};o.a.A(f,function(f){"string"==typeof f&&o.a.q(n,f,function(n){var s,h=t()[f],e;if(h){try{e=o.a.R(arguments);r=u.$data;e.unshift(r);s=h.apply(r,e)}finally{!0!==s&&(n.preventDefault?n.preventDefault():n.returnValue=!1)}!1===i.get(f+"Bubble")&&(n.cancelBubble=!0,n.stopPropagation&&n.stopPropagation())}})})}};o.d.foreach={vb:function(n){return function(){var i=n(),t=o.a.Sa(i);return!t||"number"==typeof t.length?{foreach:i,templateEngine:o.K.Ja}:(o.a.c(i),{foreach:t.data,as:t.as,includeDestroyed:t.includeDestroyed,afterAdd:t.afterAdd,beforeRemove:t.beforeRemove,afterRender:t.afterRender,beforeMove:t.beforeMove,afterMove:t.afterMove,templateEngine:o.K.Ja})}},init:function(n,t){return o.d.template.init(n,o.d.foreach.vb(t))},update:function(n,t,i,r,u){return o.d.template.update(n,o.d.foreach.vb(t),i,r,u)}};o.g.aa.foreach=!1;o.e.Q.foreach=!0;o.d.hasfocus={init:function(n,t,i){function r(r){var u,f;if(n.__ko_hasfocusUpdating=!0,u=n.ownerDocument,"activeElement"in u){try{f=u.activeElement}catch(e){f=u.body}r=f===n}u=t();o.g.va(u,i,"hasfocus",r,!0);n.__ko_hasfocusLastValue=r;n.__ko_hasfocusUpdating=!1}var u=r.bind(null,!0),f=r.bind(null,!1);o.a.q(n,"focus",u);o.a.q(n,"focusin",u);o.a.q(n,"blur",f);o.a.q(n,"focusout",f)},update:function(n,t){var i=!!o.a.c(t());n.__ko_hasfocusUpdating||n.__ko_hasfocusLastValue===i||(i?n.focus():n.blur(),o.k.t(o.a.ha,null,[n,i?"focusin":"focusout"]))}};o.g.W.hasfocus=!0;o.d.hasFocus=o.d.hasfocus;o.g.W.hasFocus=!0;o.d.html={init:function(){return{controlsDescendantBindings:!0}},update:function(n,t){o.a.Va(n,t())}};v("if");v("ifnot",!1,!0);v("with",!0,!1,function(n,t){return n.createChildContext(t)});l={};o.d.options={init:function(n){if("select"!==o.a.B(n))throw Error("options binding applies only to SELECT elements");for(;0<n.length;)n.remove(0);return{controlsDescendantBindings:!0}},update:function(t,i,r){function c(){return o.a.la(t.options,function(n){return n.selected})}function a(n,t,i){var r=typeof t;return"function"==r?t(n):"string"==r?n[t]:i}function v(n,i){if(f.length){var r=0<=o.a.l(f,o.i.p(i[0]));o.a.Db(i[0],r);h&&!r&&o.k.t(o.a.ha,null,[t,"change"])}}var e=0!=t.length&&t.multiple?t.scrollTop:null,u=o.a.c(i()),y=r.get("optionsIncludeDestroyed"),s,f,h;i={};f=t.multiple?o.a.ya(c(),o.i.p):0<=t.selectedIndex?[o.i.p(t.options[t.selectedIndex])]:[];u&&("undefined"==typeof u.length&&(u=[u]),s=o.a.la(u,function(t){return y||t===n||null===t||!o.a.c(t._destroy)}),r.has("optionsCaption")&&(u=o.a.c(r.get("optionsCaption")),null!==u&&u!==n&&s.unshift(l)));h=!1;i.beforeRemove=function(n){t.removeChild(n)};u=v;r.has("optionsAfterRender")&&(u=function(t,i){v(0,i);o.k.t(r.get("optionsAfterRender"),null,[i[0],t!==l?t:n])});o.a.Ua(t,s,function(i,u,e){return e.length&&(f=e[0].selected?[o.i.p(e[0])]:[],h=!0),u=t.ownerDocument.createElement("option"),i===l?(o.a.Xa(u,r.get("optionsCaption")),o.i.X(u,n)):(e=a(i,r.get("optionsValue"),i),o.i.X(u,o.a.c(e)),i=a(i,r.get("optionsText"),e),o.a.Xa(u,i)),[u]},i,u);o.k.t(function(){r.get("valueAllowUnset")&&r.has("value")?o.i.X(t,o.a.c(r.get("value")),!0):(t.multiple?f.length&&c().length<f.length:f.length&&0<=t.selectedIndex?o.i.p(t.options[t.selectedIndex])!==f[0]:f.length||0<=t.selectedIndex)&&o.a.ha(t,"change")});o.a.Tb(t);e&&20<Math.abs(e-t.scrollTop)&&(t.scrollTop=e)}};o.d.options.Pa=o.a.f.L();o.d.selectedOptions={after:["options","foreach"],init:function(n,t,i){o.a.q(n,"change",function(){var u=t(),r=[];o.a.r(n.getElementsByTagName("option"),function(n){n.selected&&r.push(o.i.p(n))});o.g.va(u,i,"selectedOptions",r)})},update:function(n,t){if("select"!=o.a.B(n))throw Error("values binding applies only to SELECT elements");var i=o.a.c(t());i&&"number"==typeof i.length&&o.a.r(n.getElementsByTagName("option"),function(n){var t=0<=o.a.l(i,o.i.p(n));o.a.Db(n,t)})}};o.g.W.selectedOptions=!0;o.d.style={update:function(n,t){var i=o.a.c(t()||{});o.a.A(i,function(t,i){i=o.a.c(i);n.style[t]=i||""})}};o.d.submit={init:function(n,t,i,r,u){if("function"!=typeof t())throw Error("The value for a submit binding must be a function");o.a.q(n,"submit",function(i){var r,f=t();try{r=f.call(u.$data,n)}finally{!0!==r&&(i.preventDefault?i.preventDefault():i.returnValue=!1)}})}};o.d.text={init:function(){return{controlsDescendantBindings:!0}},update:function(n,t){o.a.Xa(n,t())}};o.e.Q.text=!0;o.d.uniqueName={init:function(n,t){if(t()){var i="ko_unique_"+ ++o.d.uniqueName.Ob;o.a.Cb(n,i)}}};o.d.uniqueName.Ob=0;o.d.value={after:["options","foreach"],init:function(n,t,i){function e(){f=!1;var r=t(),u=o.i.p(n);o.g.va(r,i,"value",u)}var r=["change"],u=i.get("valueUpdate"),f=!1;u&&("string"==typeof u&&(u=[u]),o.a.$(r,u),r=o.a.ib(r));!o.a.oa||"input"!=n.tagName.toLowerCase()||"text"!=n.type||"off"==n.autocomplete||n.form&&"off"==n.form.autocomplete||-1!=o.a.l(r,"propertychange")||(o.a.q(n,"propertychange",function(){f=!0}),o.a.q(n,"focus",function(){f=!1}),o.a.q(n,"blur",function(){f&&e()}));o.a.r(r,function(t){var i=e;o.a.kc(t,"after")&&(i=function(){setTimeout(e,0)},t=t.substring(5));o.a.q(n,t,i)})},update:function(n,t,i){var r=o.a.c(t()),u;t=o.i.p(n);r!==t&&("select"===o.a.B(n)?(u=i.get("valueAllowUnset"),i=function(){o.i.X(n,r,u)},i(),u||r===o.i.p(n)?setTimeout(i,0):o.k.t(o.a.ha,null,[n,"change"])):o.i.X(n,r))}};o.g.W.value=!0;o.d.visible={update:function(n,t){var i=o.a.c(t()),r="none"!=n.style.display;i&&!r?n.style.display="":!i&&r&&(n.style.display="none")}},function(n){o.d[n]={init:function(t,i,r,u,f){return o.d.event.init.call(this,t,function(){var t={};return t[n]=i(),t},r,u,f)}}}("click");o.C=function(){};o.C.prototype.renderTemplateSource=function(){throw Error("Override renderTemplateSource");};o.C.prototype.createJavaScriptEvaluatorBlock=function(){throw Error("Override createJavaScriptEvaluatorBlock");};o.C.prototype.makeTemplateSource=function(n,t){if("string"==typeof n){t=t||i;var r=t.getElementById(n);if(!r)throw Error("Cannot find template with ID "+n);return new o.n.j(r)}if(1==n.nodeType||8==n.nodeType)return new o.n.Z(n);throw Error("Unknown template type: "+n);};o.C.prototype.renderTemplate=function(n,t,i,r){return n=this.makeTemplateSource(n,r),this.renderTemplateSource(n,t,i)};o.C.prototype.isTemplateRewritten=function(n,t){return!1===this.allowTemplateRewriting?!0:this.makeTemplateSource(n,t).data("isRewritten")};o.C.prototype.rewriteTemplate=function(n,t,i){n=this.makeTemplateSource(n,i);t=t(n.text());n.text(t);n.data("isRewritten",!0)};o.b("templateEngine",o.C);o.Za=function(){function n(n,t,i,r){var s,f,u,e;for(n=o.g.Ra(n),s=o.g.aa,f=0;f<n.length;f++)if(u=n[f].key,s.hasOwnProperty(u))if(e=s[u],"function"==typeof e){if(u=e(n[f].value))throw Error(u);}else if(!e)throw Error("This template engine does not support the '"+u+"' binding within its templates");return i="ko.__tr_ambtns(function($context,$element){return(function(){return{ "+o.g.qa(n,{valueAccessors:!0})+" } })()},'"+i.toLowerCase()+"')",r.createJavaScriptEvaluatorBlock(i)+t}var t=/(<([a-z]+\d*)(?:\s+(?!data-bind\s*=\s*)[a-z0-9\-]+(?:=(?:\"[^\"]*\"|\'[^\']*\'))?)*\s+)data-bind\s*=\s*(["'])([\s\S]*?)\3/gi,i=/\x3c!--\s*ko\b\s*([\s\S]*?)\s*--\x3e/g;return{Ub:function(n,t,i){t.isTemplateRewritten(n,i)||t.rewriteTemplate(n,function(n){return o.Za.dc(n,t)},i)},dc:function(r,u){return r.replace(t,function(t,i,r,f,e){return n(e,i,r,u)}).replace(i,function(t,i){return n(i,"<!-- ko -->","#comment",u)})},Mb:function(n,t){return o.w.Na(function(i,r){var u=i.nextSibling;u&&u.nodeName.toLowerCase()===t&&o.xa(u,n,r)})}}}();o.b("__tr_ambtns",o.Za.Mb),function(){var i,t;o.n={};o.n.j=function(n){this.j=n};o.n.j.prototype.text=function(){var n=o.a.B(this.j),n="script"===n?"text":"textarea"===n?"value":"innerHTML",t;if(0==arguments.length)return this.j[n];t=arguments[0];"innerHTML"===n?o.a.Va(this.j,t):this.j[n]=t};i=o.a.f.L()+"_";o.n.j.prototype.data=function(n){if(1===arguments.length)return o.a.f.get(this.j,i+n);o.a.f.set(this.j,i+n,arguments[1])};t=o.a.f.L();o.n.Z=function(n){this.j=n};o.n.Z.prototype=new o.n.j;o.n.Z.prototype.text=function(){if(0==arguments.length){var i=o.a.f.get(this.j,t)||{};return i.$a===n&&i.Ba&&(i.$a=i.Ba.innerHTML),i.$a}o.a.f.set(this.j,t,{$a:arguments[0]})};o.n.j.prototype.nodes=function(){if(0==arguments.length)return(o.a.f.get(this.j,t)||{}).Ba;o.a.f.set(this.j,t,{Ba:arguments[0]})};o.b("templateSources",o.n);o.b("templateSources.domElement",o.n.j);o.b("templateSources.anonymousTemplate",o.n.Z)}(),function(){function t(n,t,i){var r;for(t=o.e.nextSibling(t);n&&(r=n)!==t;)n=o.e.nextSibling(r),i(r,n)}function f(n,i){if(n.length){var r=n[0],u=n[n.length-1],f=r.parentNode,e=o.J.instance,s=e.preprocessNode;if(s){if(t(r,u,function(n,t){var f=n.previousSibling,i=s.call(e,n);i&&(n===r&&(r=i[0]||t),n===u&&(u=i[i.length-1]||f))}),n.length=0,!r)return;r===u?n.push(r):(n.push(r,u),o.a.ea(n,f))}t(r,u,function(n){1!==n.nodeType&&8!==n.nodeType||o.fb(i,n)});t(r,u,function(n){1!==n.nodeType&&8!==n.nodeType||o.w.Ib(n,[i])});o.a.ea(n,f)}}function i(n){return n.nodeType?n:0<n.length?n[0]:null}function e(n,t,u,e,s){s=s||{};var h=n&&i(n),h=h&&h.ownerDocument,c=s.templateEngine||r;if(o.Za.Ub(u,c,h),u=c.renderTemplate(u,e,s,h),"number"!=typeof u.length||0<u.length&&"number"!=typeof u[0].nodeType)throw Error("Template engine must return an array of DOM nodes");h=!1;switch(t){case"replaceChildren":o.e.U(n,u);h=!0;break;case"replaceNode":o.a.Bb(n,u);h=!0;break;case"ignoreTargetNode":break;default:throw Error("Unknown renderMode: "+t);}return h&&(f(u,e),s.afterRender&&o.k.t(s.afterRender,null,[u,e.$data])),u}var r,u;o.Wa=function(t){if(t!=n&&!(t instanceof o.C))throw Error("templateEngine must inherit from ko.templateEngine");r=t};o.Ta=function(t,u,f,s,h){if(f=f||{},(f.templateEngine||r)==n)throw Error("Set a template engine before calling renderTemplate");if(h=h||"replaceChildren",s){var c=i(s);return o.h(function(){var n=u&&u instanceof o.I?u:new o.I(o.a.c(u)),r=o.v(t)?t():"function"==typeof t?t(n.$data,n):t,n=e(s,h,r,n,f);"replaceNode"==h&&(s=n,c=i(s))},null,{Da:function(){return!c||!o.a.Ea(c)},G:c&&"replaceNode"==h?c.parentNode:c})}return o.w.Na(function(n){o.Ta(t,u,f,n,"replaceNode")})};o.jc=function(t,i,r,u,s){function c(n,t){f(t,h);r.afterRender&&r.afterRender(t,n)}function l(n,i){h=s.createChildContext(n,r.as,function(n){n.$index=i});var u="function"==typeof t?t(n,h):t;return e(null,"ignoreTargetNode",u,h,r)}var h;return o.h(function(){var t=o.a.c(i)||[];"undefined"==typeof t.length&&(t=[t]);t=o.a.la(t,function(t){return r.includeDestroyed||t===n||null===t||!o.a.c(t._destroy)});o.k.t(o.a.Ua,null,[u,t,l,r,c])},null,{G:u})};u=o.a.f.L();o.d.template={init:function(n,t){var i=o.a.c(t());return"string"==typeof i||i.name?o.e.da(n):(i=o.e.childNodes(n),i=o.a.ec(i),new o.n.Z(n).nodes(i)),{controlsDescendantBindings:!0}},update:function(t,i,r,f,e){var h=i(),s;i=o.a.c(h);r=!0;f=null;"string"==typeof i?i={}:(h=i.name,"if"in i&&(r=o.a.c(i["if"])),r&&"ifnot"in i&&(r=!o.a.c(i.ifnot)),s=o.a.c(i.data));"foreach"in i?f=o.jc(h||t,r&&i.foreach||[],i,t,e):r?(e="data"in i?e.createChildContext(s,i.as):e,f=o.Ta(h||t,e,i,t)):o.e.da(t);e=f;(s=o.a.f.get(t,u))&&"function"==typeof s.F&&s.F();o.a.f.set(t,u,e&&e.ga()?e:n)}};o.g.aa.template=function(n){return n=o.g.Ra(n),1==n.length&&n[0].unknown||o.g.bc(n,"name")?null:"This template engine does not support anonymous templates nested within its templates"};o.e.Q.template=!0}();o.b("setTemplateEngine",o.Wa);o.b("renderTemplate",o.Ta);o.a.nb=function(n,t,i){if(n.length&&t.length)for(var o,r,f,e,u=o=0;(!i||u<i)&&(f=n[o]);++o){for(r=0;e=t[r];++r)if(f.value===e.value){f.moved=e.index;e.moved=f.index;t.splice(r,1);u=r=0;break}u+=r}};o.a.Aa=function(){function n(n,t,i,r,u){for(var s=Math.min,l=Math.max,a=[],c=n.length,f,h=t.length,v=h-c||1,w=c+h+1,y,p,b,e=0;e<=c;e++)for(p=y,a.push(y=[]),b=s(h,e+v),f=l(0,e-1);f<=b;f++)y[f]=f?e?n[e-1]===t[f-1]?p[f-1]:s(p[f]||w,y[f-1]||w)+1:f+1:e+1;for(s=[],l=[],v=[],e=c,f=h;e||f;)h=a[e][f]-1,f&&h===a[e][f-1]?l.push(s[s.length]={status:i,value:t[--f],index:f}):e&&h===a[e-1][f]?v.push(s[s.length]={status:r,value:n[--e],index:e}):(--f,--e,u.sparse||s.push({status:"retained",value:t[f]}));return o.a.nb(l,v,10*c),s.reverse()}return function(t,i,r){return r="boolean"==typeof r?{dontLimitMoves:r}:r||{},t=t||[],i=i||[],t.length<=i.length?n(t,i,"added","deleted",r):n(i,t,"deleted","added",r)}}();o.b("utils.compareArrays",o.a.Aa),function(){function i(t,i,r,u,f){var e=[],s=o.h(function(){var n=i(r,f,o.a.ea(e,t))||[];0<e.length&&(o.a.Bb(e,n),u&&o.k.t(u,null,[r,n,f]));e.length=0;o.a.$(e,n)},null,{G:t,Da:function(){return!o.a.eb(e)}});return{S:e,h:s.ga()?s:n}}var t=o.a.f.L();o.a.Ua=function(r,u,f,e,s){function rt(n,t){h=d[t];nt!==t&&(it[n]=h);h.Ia(nt++);o.a.ea(h.S,r);g.push(h);w.push(h)}function y(n,t){if(n)for(var i=0,r=t.length;i<r;i++)t[i]&&o.a.r(t[i].S,function(r){n(r,i,t[i].ka)})}var c,v,ut;u=u||[];e=e||{};var v=o.a.f.get(r,t)===n,d=o.a.f.get(r,t)||[],p=o.a.ya(d,function(n){return n.ka}),l=o.a.Aa(p,u,e.dontLimitMoves),g=[],a=0,nt=0,tt=[],w=[];u=[];for(var it=[],p=[],h,c=0,b,k;b=l[c];c++)switch(k=b.moved,b.status){case"deleted":k===n&&(h=d[a],h.h&&h.h.F(),tt.push.apply(tt,o.a.ea(h.S,r)),e.beforeRemove&&(u[c]=h,w.push(h)));a++;break;case"retained":rt(c,a++);break;case"added":k!==n?rt(c,k):(h={ka:b.value,Ia:o.m(nt++)},g.push(h),w.push(h),v||(p[c]=h))}for(y(e.beforeMove,it),o.a.r(tt,e.beforeRemove?o.M:o.removeNode),c=0,v=o.e.firstChild(r);h=w[c];c++){for(h.S||o.a.extend(h,i(r,f,h.ka,s,h.Ia)),a=0;l=h.S[a];v=l.nextSibling,ut=l,a++)l!==v&&o.e.rb(r,l,ut);!h.Zb&&s&&(s(h.ka,h.S,h.Ia),h.Zb=!0)}y(e.beforeRemove,u);y(e.afterMove,it);y(e.afterAdd,p);o.a.f.set(r,t,g)}}();o.b("utils.setDomNodeChildrenFromArrayMapping",o.a.Ua);o.K=function(){this.allowTemplateRewriting=!1};o.K.prototype=new o.C;o.K.prototype.renderTemplateSource=function(n){var t=(9>o.a.oa?0:n.nodes)?n.nodes():null;return t?o.a.R(t.cloneNode(!0).childNodes):(n=n.text(),o.a.Qa(n))};o.K.Ja=new o.K;o.Wa(o.K.Ja);o.b("nativeTemplateEngine",o.K),function(){o.La=function(){var n=this.ac=function(){if(!t||!t.tmpl)return 0;try{if(0<=t.tmpl.tag.tmpl.open.toString().indexOf("__"))return 2}catch(n){}return 1}();this.renderTemplateSource=function(r,u,f){if(f=f||{},2>n)throw Error("Your version of jQuery.tmpl is too old. Please upgrade to jQuery.tmpl 1.0.0pre or later.");var e=r.data("precompiled");return e||(e=r.text()||"",e=t.template(null,"{{ko_with $item.koBindingContext}}"+e+"{{/ko_with}}"),r.data("precompiled",e)),r=[u.$data],u=t.extend({koBindingContext:u},f.templateOptions),u=t.tmpl(e,r,u),u.appendTo(i.createElement("div")),t.fragments={},u};this.createJavaScriptEvaluatorBlock=function(n){return"{{ko_code ((function() { return "+n+" })()) }}"};this.addTemplate=function(n,t){i.write("<script type='text/html' id='"+n+"'>"+t+"<\/script>")};0<n&&(t.tmpl.tag.ko_code={open:"__.push($1 || '');"},t.tmpl.tag.ko_with={open:"with($1) {",close:"} "})};o.La.prototype=new o.C;var n=new o.La;0<n.ac&&o.Wa(n);o.b("jqueryTmplTemplateEngine",o.La)}()})})()}(),function(n){"function"==typeof require&&"object"==typeof exports&&"object"==typeof module?n(require("knockout"),exports):"function"==typeof define&&define.amd?define(["knockout","exports"],n):n(ko,ko.mapping={})}(function(n,t){function v(n,i){var o,r;for(r in i)if(i.hasOwnProperty(r)&&i[r])if(o=t.getType(n[r]),r&&n[r]&&"array"!==o&&"string"!==o)v(n[r],i[r]);else if("array"===t.getType(n[r])&&"array"===t.getType(i[r])){o=n;for(var h=r,f=n[r],e=i[r],s={},u=f.length-1;0<=u;--u)s[f[u]]=f[u];for(u=e.length-1;0<=u;--u)s[e[u]]=e[u];f=[];e=void 0;for(e in s)f.push(s[e]);o[h]=f}else n[r]=i[r]}function e(n,t){var i={};return v(i,n),v(i,t),i}function y(n,t){for(var f,i=e({},n),o=nt.length-1;0<=o;o--)f=nt[o],i[f]&&(i[""]instanceof Object||(i[""]={}),i[""][f]=i[f],delete i[f]);return t&&(i.ignore=u(t.ignore,i.ignore),i.include=u(t.include,i.include),i.copy=u(t.copy,i.copy),i.observe=u(t.observe,i.observe)),i.ignore=u(i.ignore,r.ignore),i.include=u(i.include,r.include),i.copy=u(i.copy,r.copy),i.observe=u(i.observe,r.observe),i.mappedProperties=i.mappedProperties||{},i.copiedProperties=i.copiedProperties||{},i}function u(i,r){return"array"!==t.getType(i)&&(i="undefined"===t.getType(i)?[]:[i]),"array"!==t.getType(r)&&(r="undefined"===t.getType(r)?[]:[r]),n.utils.arrayGetDistinctValues(i.concat(r))}function o(r,u,a,v,y,p,b){var lt="array"===t.getType(n.utils.unwrapObservable(u)),nt,it,rt,et,ht;p=p||"";t.isMapped(r)&&(nt=n.utils.unwrapObservable(r)[i],a=e(nt,a));var vt=b||y,ct=function(){return a[v]&&a[v].create instanceof Function},yt=function(t){var i=c,r=n.dependentObservable;return n.dependentObservable=function(t,r,u){var o,f,e;return u=u||{},t&&"object"==typeof t&&(u=t),e=u.deferEvaluation,o=!1,u.deferEvaluation=!0,t=new h(t,r,u),e||(f=t,e=n.dependentObservable,n.dependentObservable=h,t=n.isWriteableObservable(f),n.dependentObservable=e,t=h({read:function(){return o||(n.utils.arrayRemoveItem(i,f),o=!0),f.apply(f,arguments)},write:t&&function(n){return f(n)},deferEvaluation:!0}),i.push(t)),t},n.dependentObservable.fn=h.fn,n.computed=n.dependentObservable,t=n.utils.unwrapObservable(y)instanceof Array?a[v].create({data:t||u,parent:vt,skip:tt}):a[v].create({data:t||u,parent:vt}),n.dependentObservable=r,n.computed=n.dependentObservable,t},ft=function(){return a[v]&&a[v].update instanceof Function},ot=function(t,i){var r={data:i||u,parent:vt,target:n.utils.unwrapObservable(t)};return n.isWriteableObservable(t)&&(r.observable=t),a[v].update(r)};if(b=l.get(u))return b;if(v=v||"",lt){var lt=[],ut=!1,g=function(n){return n};a[v]&&a[v].key&&(g=a[v].key,ut=!0);n.isObservable(r)||(r=n.observableArray([]),r.mappedRemove=function(n){var t="function"==typeof n?n:function(t){return t===g(n)};return r.remove(function(n){return t(g(n))})},r.mappedRemoveAll=function(t){var i=f(t,g);return r.remove(function(t){return-1!=n.utils.arrayIndexOf(i,g(t))})},r.mappedDestroy=function(n){var t="function"==typeof n?n:function(t){return t===g(n)};return r.destroy(function(n){return t(g(n))})},r.mappedDestroyAll=function(t){var i=f(t,g);return r.destroy(function(t){return-1!=n.utils.arrayIndexOf(i,g(t))})},r.mappedIndexOf=function(t){var i=f(r(),g);return t=g(t),n.utils.arrayIndexOf(i,t)},r.mappedCreate=function(t){if(-1!==r.mappedIndexOf(t))throw Error("There already is an object with the key that you specified.");var i=ct()?yt(t):t;return ft()&&(t=ot(i,t),n.isWriteableObservable(i)?i(t):i=t),r.push(i),i});b=f(n.utils.unwrapObservable(r),g).sort();nt=f(u,g);ut&&nt.sort();ut=n.utils.compareArrays(b,nt);b={};for(var st=n.utils.unwrapObservable(u),pt={},wt=!0,nt=0,at=st.length;nt<at;nt++){if(it=g(st[nt]),void 0===it||it instanceof Object){wt=!1;break}pt[it]=st[nt]}var st=[],bt=0,nt=0;for(at=ut.length;nt<at;nt++){it=ut[nt];et=p+"["+nt+"]";switch(it.status){case"added":ht=wt?pt[it.value]:s(n.utils.unwrapObservable(u),it.value,g);rt=o(void 0,ht,a,v,r,et,y);ct()||(rt=n.utils.unwrapObservable(rt));et=w(n.utils.unwrapObservable(u),ht,b);rt===tt?bt++:st[et-bt]=rt;b[et]=!0;break;case"retained":ht=wt?pt[it.value]:s(n.utils.unwrapObservable(u),it.value,g);rt=s(r,it.value,g);o(rt,ht,a,v,r,et,y);et=w(n.utils.unwrapObservable(u),ht,b);st[et]=rt;b[et]=!0;break;case"deleted":rt=s(r,it.value,g)}lt.push({event:it.status,item:rt})}r(st);a[v]&&a[v].arrayChanged&&n.utils.arrayForEach(lt,function(n){a[v].arrayChanged(n.event,n.item)})}else if(d(u)){if(r=n.utils.unwrapObservable(r),!r){if(ct())return ut=yt(),ft()&&(ut=ot(ut)),ut;if(ft())return ot(ut);r={}}if(ft()&&(r=ot(r)),l.save(u,r),ft())return r;k(u,function(t){var i=p.length?p+"."+t:t;if(-1==n.utils.arrayIndexOf(a.ignore,i))if(-1!=n.utils.arrayIndexOf(a.copy,i))r[t]=u[t];else if("object"!=typeof u[t]&&"array"!=typeof u[t]&&0<a.observe.length&&-1==n.utils.arrayIndexOf(a.observe,i))r[t]=u[t],a.copiedProperties[i]=!0;else{var f=l.get(u[t]),e=o(r[t],u[t],a,t,r,i,r),f=f||e;0<a.observe.length&&-1==n.utils.arrayIndexOf(a.observe,i)?(r[t]=f(),a.copiedProperties[i]=!0):(n.isWriteableObservable(r[t])?r[t](n.utils.unwrapObservable(f)):(f=void 0===r[t]?f:n.utils.unwrapObservable(f),r[t]=f),a.mappedProperties[i]=!0)}})}else switch(t.getType(u)){case"function":ft()?n.isWriteableObservable(u)?(u(ot(u)),r=u):r=ot(u):r=u;break;default:if(n.isWriteableObservable(r))return rt=ft()?ot(r):n.utils.unwrapObservable(u),r(rt),rt;ct()||ft();r=ct()?yt():n.observable(n.utils.unwrapObservable(u));ft()&&r(ot(r))}return r}function w(n,t,i){for(var r=0,u=n.length;r<u;r++)if(!0!==i[r]&&n[r]===t)return r;return null}function b(i,r){var u;return r&&(u=r(i)),"undefined"===t.getType(u)&&(u=i),n.utils.unwrapObservable(u)}function s(t,i,r){var u,e,f;for(t=n.utils.unwrapObservable(t),u=0,e=t.length;u<e;u++)if(f=t[u],b(f,r)===i)return f;throw Error("When calling ko.update*, the key '"+i+"' was not found!");}function f(t,i){return n.utils.arrayMap(n.utils.unwrapObservable(t),function(n){return i?b(n,i):n})}function k(n,i){if("array"===t.getType(n))for(var r=0;r<n.length;r++)i(r);else for(r in n)i(r)}function d(n){var i=t.getType(n);return("object"===i||"array"===i)&&null!==n}function it(){var t=[],i=[];this.save=function(r,u){var f=n.utils.arrayIndexOf(t,r);0<=f?i[f]=u:(t.push(r),i.push(u))};this.get=function(r){return r=n.utils.arrayIndexOf(t,r),0<=r?i[r]:void 0}}function g(){var n={},t=function(t){var i;try{i=t}catch(r){i="$$$"}return t=n[i],void 0===t&&(t=new it,n[i]=t),t};this.save=function(n,i){t(n).save(n,i)};this.get=function(n){return t(n).get(n)}}var i="__ko_mapping__",h=n.dependentObservable,p=0,c,l,nt=["create","update","key","arrayChanged"],tt={},a={include:["_destroy"],ignore:[],copy:[],observe:[]},r=a;t.isMapped=function(t){return(t=n.utils.unwrapObservable(t))&&t[i]};t.fromJS=function(n){var t,r,u,f;if(0==arguments.length)throw Error("When calling ko.fromJS, pass the object you want to convert.");try{if(p++||(c=[],l=new g),2==arguments.length&&(arguments[1][i]?r=arguments[1]:t=arguments[1]),3==arguments.length&&(t=arguments[1],r=arguments[2]),r&&(t=e(t,r[i])),t=y(t),u=o(r,n,t),r&&(u=r),!--p)for(;c.length;)f=c.pop(),f&&f();return u[i]=e(u[i],t),u}catch(s){throw p=0,s;}};t.fromJSON=function(i){var r=n.utils.parseJson(i);return arguments[0]=r,t.fromJS.apply(this,arguments)};t.updateFromJS=function(){throw Error("ko.mapping.updateFromJS, use ko.mapping.fromJS instead. Please note that the order of parameters is different!");};t.updateFromJSON=function(){throw Error("ko.mapping.updateFromJSON, use ko.mapping.fromJSON instead. Please note that the order of parameters is different!");};t.toJS=function(u,f){if(r||t.resetDefaultOptions(),0==arguments.length)throw Error("When calling ko.mapping.toJS, pass the object you want to convert.");if("array"!==t.getType(r.ignore))throw Error("ko.mapping.defaultOptions().ignore should be an array.");if("array"!==t.getType(r.include))throw Error("ko.mapping.defaultOptions().include should be an array.");if("array"!==t.getType(r.copy))throw Error("ko.mapping.defaultOptions().copy should be an array.");return f=y(f,u[i]),t.visitModel(u,function(t){return n.utils.unwrapObservable(t)},f)};t.toJSON=function(i,r){var u=t.toJS(i,r);return n.utils.stringifyJson(u)};t.defaultOptions=function(){if(0<arguments.length)r=arguments[0];else return r};t.resetDefaultOptions=function(){r={include:a.include.slice(0),ignore:a.ignore.slice(0),copy:a.copy.slice(0)}};t.getType=function(n){if(n&&"object"==typeof n){if(n.constructor===Date)return"date";if(n.constructor===Array)return"array"}return typeof n};t.visitModel=function(r,u,f){var o,e,s;if(f=f||{},f.visitedObjects=f.visitedObjects||new g,e=n.utils.unwrapObservable(r),d(e))f=y(f,e[i]),u(r,f.parentName),o="array"===t.getType(e)?[]:{};else return u(r,f.parentName);return f.visitedObjects.save(r,o),s=f.parentName,k(e,function(r){if(!(f.ignore&&-1!=n.utils.arrayIndexOf(f.ignore,r))){var h=e[r],c=f,l=s||"";if("array"===t.getType(e)?s&&(l+="["+r+"]"):(s&&(l+="."),l+=r),c.parentName=l,!(-1===n.utils.arrayIndexOf(f.copy,r)&&-1===n.utils.arrayIndexOf(f.include,r)&&e[i]&&e[i].mappedProperties&&!e[i].mappedProperties[r]&&e[i].copiedProperties&&!e[i].copiedProperties[r]&&"array"!==t.getType(e)))switch(t.getType(n.utils.unwrapObservable(h))){case"object":case"array":case"undefined":c=f.visitedObjects.get(h);o[r]="undefined"!==t.getType(c)?c:t.visitModel(h,u,f);break;default:o[r]=u(h,f.parentName)}}}),o}}),function(n){function d(n,t,i){switch(arguments.length){case 2:return null!=n?n:t;case 3:return null!=n?n:null!=t?t:i;default:throw new Error("Implement me");}}function ft(){return{empty:!1,unusedTokens:[],unusedInput:[],overflow:-2,charsLeftOver:0,nullInput:!1,invalidMonth:null,invalidFormat:!1,userInvalidated:!1,iso:!1}}function g(n,i){function u(){t.suppressDeprecationWarnings===!1&&"undefined"!=typeof console&&console.warn&&console.warn("Deprecation warning: "+n)}var r=!0;return o(function(){return r&&(u(),r=!1),i.apply(this,arguments)},i)}function ii(n,t){return function(i){return r(n.call(this,i),t)}}function cr(n,t){return function(i){return this.lang().ordinal(n.call(this,i),t)}}function ri(){}function et(n){hi(n);o(this,n)}function ot(n){var t=fi(n),i=t.year||0,r=t.quarter||0,u=t.month||0,f=t.week||0,e=t.day||0,o=t.hour||0,s=t.minute||0,h=t.second||0,c=t.millisecond||0;this._milliseconds=+c+1e3*h+6e4*s+36e5*o;this._days=+e+7*f;this._months=+u+3*r+12*i;this._data={};this._bubble()}function o(n,t){for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);return t.hasOwnProperty("toString")&&(n.toString=t.toString),t.hasOwnProperty("valueOf")&&(n.valueOf=t.valueOf),n}function lr(n){var t,i={};for(t in n)n.hasOwnProperty(t)&&nr.hasOwnProperty(t)&&(i[t]=n[t]);return i}function y(n){return 0>n?Math.ceil(n):Math.floor(n)}function r(n,t,i){for(var r=""+Math.abs(n),u=n>=0;r.length<t;)r="0"+r;return(u?i?"+":"":"-")+r}function st(n,i,r,u){var o=i._milliseconds,f=i._days,e=i._months;u=null==u?!0:u;o&&n._d.setTime(+n._d+o*r);f&&bi(n,"Date",wt(n,"Date")+f*r);e&&wi(n,wt(n,"Month")+e*r);u&&t.updateOffset(n,f||e)}function rt(n){return"[object Array]"===Object.prototype.toString.call(n)}function ar(n){return"[object Date]"===Object.prototype.toString.call(n)||n instanceof Date}function ui(n,t,r){for(var e=Math.min(n.length,t.length),o=Math.abs(n.length-t.length),f=0,u=0;e>u;u++)(r&&n[u]!==t[u]||!r&&i(n[u])!==i(t[u]))&&f++;return f+o}function s(n){if(n){var t=n.toLowerCase().replace(/(.)s$/,"$1");n=hf[n]||cf[t]||t}return n}function fi(n){var i,t,r={};for(t in n)n.hasOwnProperty(t)&&(i=s(t),i&&(r[i]=n[t]));return r}function vr(i){var r,u;if(0===i.indexOf("week"))r=7,u="day";else{if(0!==i.indexOf("month"))return;r=12;u="month"}t[i]=function(f,e){var o,s,c=t.fn._lang[i],h=[];if("number"==typeof f&&(e=f,f=n),s=function(n){var i=t().utc().set(u,n);return c.call(t.fn._lang,i,f||"")},null!=e)return s(e);for(o=0;r>o;o++)h.push(s(o));return h}}function i(n){var t=+n,i=0;return 0!==t&&isFinite(t)&&(i=t>=0?Math.floor(t):Math.ceil(t)),i}function ht(n,t){return new Date(Date.UTC(n,t+1,0)).getUTCDate()}function ei(n,i,r){return b(t([n,11,31+i-r]),i,r).week}function oi(n){return si(n)?366:365}function si(n){return n%4==0&&n%100!=0||n%400==0}function hi(n){var t;n._a&&-2===n._pf.overflow&&(t=n._a[l]<0||n._a[l]>11?l:n._a[e]<1||n._a[e]>ht(n._a[c],n._a[l])?e:n._a[a]<0||n._a[a]>23?a:n._a[nt]<0||n._a[nt]>59?nt:n._a[tt]<0||n._a[tt]>59?tt:n._a[it]<0||n._a[it]>999?it:-1,n._pf._overflowDayOfYear&&(c>t||t>e)&&(t=e),n._pf.overflow=t)}function ci(n){return null==n._isValid&&(n._isValid=!isNaN(n._d.getTime())&&n._pf.overflow<0&&!n._pf.empty&&!n._pf.invalidMonth&&!n._pf.nullInput&&!n._pf.invalidFormat&&!n._pf.userInvalidated,n._strict&&(n._isValid=n._isValid&&0===n._pf.charsLeftOver&&0===n._pf.unusedTokens.length)),n._isValid}function ct(n){return n?n.toLowerCase().replace("_","-"):n}function lt(n,i){return i._isUTC?t(n).zone(i._offset||0):t(n).local()}function yr(n,t){return t.abbr=n,p[n]||(p[n]=new ri),p[n].set(t),p[n]}function pr(n){delete p[n]}function f(n){var r,u,i,f,e=0,o=function(n){if(!p[n]&&tr)try{require("./lang/"+n)}catch(t){}return p[n]};if(!n)return t.fn._lang;if(!rt(n)){if(u=o(n))return u;n=[n]}for(;e<n.length;){for(f=ct(n[e]).split("-"),r=f.length,i=ct(n[e+1]),i=i?i.split("-"):null;r>0;){if(u=o(f.slice(0,r).join("-")))return u;if(i&&i.length>=r&&ui(f,i,!0)>=r-1)break;r--}e++}return t.fn._lang}function wr(n){return n.match(/\[[\s\S]/)?n.replace(/^\[|\]$/g,""):n.replace(/\\/g,"")}function br(n){for(var i=n.match(ir),t=0,r=i.length;r>t;t++)i[t]=v[i[t]]?v[i[t]]:wr(i[t]);return function(u){var f="";for(t=0;r>t;t++)f+=i[t]instanceof Function?i[t].call(u,n):i[t];return f}}function at(n,t){return n.isValid()?(t=li(t,n.lang()),ti[t]||(ti[t]=br(t)),ti[t](n)):n.lang().invalidDate()}function li(n,t){function r(n){return t.longDateFormat(n)||n}var i=5;for(ut.lastIndex=0;i>=0&&ut.test(n);)n=n.replace(ut,r),ut.lastIndex=0,i-=1;return n}function kr(n,t){var i=t._strict;switch(n){case"Q":return ur;case"DDDD":return er;case"YYYY":case"GGGG":case"gggg":return i?uf:bu;case"Y":case"G":case"g":return ef;case"YYYYYY":case"YYYYY":case"GGGGG":case"ggggg":return i?ff:ku;case"S":if(i)return ur;case"SS":if(i)return fr;case"SSS":if(i)return er;case"DDD":return wu;case"MMM":case"MMMM":case"dd":case"ddd":case"dddd":return gu;case"a":case"A":return f(t._l)._meridiemParse;case"X":return tf;case"Z":case"ZZ":return kt;case"T":return nf;case"SSSS":return du;case"MM":case"DD":case"YY":case"GG":case"gg":case"HH":case"hh":case"mm":case"ss":case"ww":case"WW":return i?fr:rr;case"M":case"D":case"d":case"H":case"h":case"m":case"s":case"w":case"W":case"e":case"E":return rr;case"Do":return rf;default:return new RegExp(ru(iu(n.replace("\\","")),"i"))}}function ai(n){n=n||"";var r=n.match(kt)||[],f=r[r.length-1]||[],t=(f+"").match(sf)||["-",0,0],u=+(60*t[1])+i(t[2]);return"+"===t[0]?-u:u}function dr(n,r,u){var s,o=u._a;switch(n){case"Q":null!=r&&(o[l]=3*(i(r)-1));break;case"M":case"MM":null!=r&&(o[l]=i(r)-1);break;case"MMM":case"MMMM":s=f(u._l).monthsParse(r);null!=s?o[l]=s:u._pf.invalidMonth=r;break;case"D":case"DD":null!=r&&(o[e]=i(r));break;case"Do":null!=r&&(o[e]=i(parseInt(r,10)));break;case"DDD":case"DDDD":null!=r&&(u._dayOfYear=i(r));break;case"YY":o[c]=t.parseTwoDigitYear(r);break;case"YYYY":case"YYYYY":case"YYYYYY":o[c]=i(r);break;case"a":case"A":u._isPm=f(u._l).isPM(r);break;case"H":case"HH":case"h":case"hh":o[a]=i(r);break;case"m":case"mm":o[nt]=i(r);break;case"s":case"ss":o[tt]=i(r);break;case"S":case"SS":case"SSS":case"SSSS":o[it]=i(1e3*("0."+r));break;case"X":u._d=new Date(1e3*parseFloat(r));break;case"Z":case"ZZ":u._useUTC=!0;u._tzm=ai(r);break;case"dd":case"ddd":case"dddd":s=f(u._l).weekdaysParse(r);null!=s?(u._w=u._w||{},u._w.d=s):u._pf.invalidWeekday=r;break;case"w":case"ww":case"W":case"WW":case"d":case"e":case"E":n=n.substr(0,1);case"gggg":case"GGGG":case"GGGGG":n=n.substr(0,2);r&&(u._w=u._w||{},u._w[n]=i(r));break;case"gg":case"GG":u._w=u._w||{};u._w[n]=t.parseTwoDigitYear(r)}}function gr(n){var i,s,e,u,r,o,h,l;i=n._w;null!=i.GG||null!=i.W||null!=i.E?(r=1,o=4,s=d(i.GG,n._a[c],b(t(),1,4).year),e=d(i.W,1),u=d(i.E,1)):(l=f(n._l),r=l._week.dow,o=l._week.doy,s=d(i.gg,n._a[c],b(t(),r,o).year),e=d(i.w,1),null!=i.d?(u=i.d,r>u&&++e):u=null!=i.e?i.e+r:r);h=lu(s,e,u,o,r);n._a[c]=h.year;n._dayOfYear=h.dayOfYear}function vt(n){var t,i,r,u,f=[];if(!n._d){for(r=tu(n),n._w&&null==n._a[e]&&null==n._a[l]&&gr(n),n._dayOfYear&&(u=d(n._a[c],r[c]),n._dayOfYear>oi(u)&&(n._pf._overflowDayOfYear=!0),i=pt(u,0,n._dayOfYear),n._a[l]=i.getUTCMonth(),n._a[e]=i.getUTCDate()),t=0;3>t&&null==n._a[t];++t)n._a[t]=f[t]=r[t];for(;7>t;t++)n._a[t]=f[t]=null==n._a[t]?2===t?1:0:n._a[t];n._d=(n._useUTC?pt:ou).apply(null,f);null!=n._tzm&&n._d.setUTCMinutes(n._d.getUTCMinutes()+n._tzm)}}function nu(n){var t;n._d||(t=fi(n._i),n._a=[t.year,t.month,t.day,t.hour,t.minute,t.second,t.millisecond],vt(n))}function tu(n){var t=new Date;return n._useUTC?[t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate()]:[t.getFullYear(),t.getMonth(),t.getDate()]}function yt(n){if(n._f===t.ISO_8601)return void vi(n);n._a=[];n._pf.empty=!0;for(var i,u,s,c=f(n._l),r=""+n._i,l=r.length,h=0,o=li(n._f,c).match(ir)||[],e=0;e<o.length;e++)u=o[e],i=(r.match(kr(u,n))||[])[0],i&&(s=r.substr(0,r.indexOf(i)),s.length>0&&n._pf.unusedInput.push(s),r=r.slice(r.indexOf(i)+i.length),h+=i.length),v[u]?(i?n._pf.empty=!1:n._pf.unusedTokens.push(u),dr(u,i,n)):n._strict&&!i&&n._pf.unusedTokens.push(u);n._pf.charsLeftOver=l-h;r.length>0&&n._pf.unusedInput.push(r);n._isPm&&n._a[a]<12&&(n._a[a]+=12);n._isPm===!1&&12===n._a[a]&&(n._a[a]=0);vt(n);hi(n)}function iu(n){return n.replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(n,t,i,r,u){return t||i||r||u})}function ru(n){return n.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function uu(n){var t,f,u,r,i;if(0===n._f.length)return n._pf.invalidFormat=!0,void(n._d=new Date(NaN));for(r=0;r<n._f.length;r++)i=0,t=o({},n),t._pf=ft(),t._f=n._f[r],yt(t),ci(t)&&(i+=t._pf.charsLeftOver,i+=10*t._pf.unusedTokens.length,t._pf.score=i,(null==u||u>i)&&(u=i,f=t));o(n,f||t)}function vi(n){var t,i,r=n._i,u=of.exec(r);if(u){for(n._pf.iso=!0,t=0,i=dt.length;i>t;t++)if(dt[t][1].exec(r)){n._f=dt[t][0]+(u[6]||" ");break}for(t=0,i=gt.length;i>t;t++)if(gt[t][1].exec(r)){n._f+=gt[t][0];break}r.match(kt)&&(n._f+="Z");yt(n)}else n._isValid=!1}function fu(n){vi(n);n._isValid===!1&&(delete n._isValid,t.createFromInputFallback(n))}function eu(i){var r=i._i,u=vu.exec(r);r===n?i._d=new Date:u?i._d=new Date(+u[1]):"string"==typeof r?fu(i):rt(r)?(i._a=r.slice(0),vt(i)):ar(r)?i._d=new Date(+r):"object"==typeof r?nu(i):"number"==typeof r?i._d=new Date(r):t.createFromInputFallback(i)}function ou(n,t,i,r,u,f,e){var o=new Date(n,t,i,r,u,f,e);return 1970>n&&o.setFullYear(n),o}function pt(n){var t=new Date(Date.UTC.apply(null,arguments));return 1970>n&&t.setUTCFullYear(n),t}function su(n,t){if("string"==typeof n)if(isNaN(n)){if(n=t.weekdaysParse(n),"number"!=typeof n)return null}else n=parseInt(n,10);return n}function hu(n,t,i,r,u){return u.relativeTime(t||1,!!i,n,r)}function cu(n,t,i){var o=k(Math.abs(n)/1e3),u=k(o/60),f=k(u/60),r=k(f/24),s=k(r/365),e=o<w.s&&["s",o]||1===u&&["m"]||u<w.m&&["mm",u]||1===f&&["h"]||f<w.h&&["hh",f]||1===r&&["d"]||r<=w.dd&&["dd",r]||r<=w.dm&&["M"]||r<w.dy&&["MM",k(r/30)]||1===s&&["y"]||["yy",s];return e[2]=t,e[3]=n>0,e[4]=i,hu.apply({},e)}function b(n,i,r){var f,e=r-i,u=r-n.day();return u>e&&(u-=7),e-7>u&&(u+=7),f=t(n).add("d",u),{week:Math.ceil(f.dayOfYear()/7),year:f.year()}}function lu(n,t,i,r,u){var o,e,f=pt(n,0,1).getUTCDay();return f=0===f?7:f,i=null!=i?i:u,o=u-f+(f>r?7:0)-(u>f?7:0),e=7*(t-1)+(i-u)+o+1,{year:e>0?n:n-1,dayOfYear:e>0?e:oi(n-1)+e}}function yi(i){var r=i._i,u=i._f;return null===r||u===n&&""===r?t.invalid({nullInput:!0}):("string"==typeof r&&(i._i=r=f().preparse(r)),t.isMoment(r)?(i=lr(r),i._d=new Date(+r._d)):u?rt(u)?uu(i):yt(i):eu(i),new et(i))}function pi(n,i){var u,r;if(1===i.length&&rt(i[0])&&(i=i[0]),!i.length)return t();for(u=i[0],r=1;r<i.length;++r)i[r][n](u)&&(u=i[r]);return u}function wi(n,t){var i;return"string"==typeof t&&(t=n.lang().monthsParse(t),"number"!=typeof t)?n:(i=Math.min(n.date(),ht(n.year(),t)),n._d["set"+(n._isUTC?"UTC":"")+"Month"](t,i),n)}function wt(n,t){return n._d["get"+(n._isUTC?"UTC":"")+t]()}function bi(n,t,i){return"Month"===t?wi(n,i):n._d["set"+(n._isUTC?"UTC":"")+t](i)}function h(n,i){return function(r){return null!=r?(bi(this,n,r),t.updateOffset(this,i),this):wt(this,n)}}function au(n){t.duration.fn[n]=function(){return this._data[n]}}function ki(n,i){t.duration.fn["as"+n]=function(){return+this/i}}function di(n){"undefined"==typeof ender&&(gi=bt.moment,bt.moment=n?g("Accessing Moment through the global scope is deprecated, and will be removed in an upcoming release.",t):t)}for(var t,gi,u,bt="undefined"!=typeof global?global:this,k=Math.round,c=0,l=1,e=2,a=3,nt=4,tt=5,it=6,p={},nr={_isAMomentObject:null,_i:null,_f:null,_l:null,_strict:null,_tzm:null,_isUTC:null,_offset:null,_pf:null,_lang:null},tr="undefined"!=typeof module&&module.exports,vu=/^\/?Date\((\-?\d+)/i,yu=/(\-)?(?:(\d*)\.)?(\d+)\:(\d+)(?:\:(\d+)\.?(\d{3})?)?/,pu=/^(-)?P(?:(?:([0-9,.]*)Y)?(?:([0-9,.]*)M)?(?:([0-9,.]*)D)?(?:T(?:([0-9,.]*)H)?(?:([0-9,.]*)M)?(?:([0-9,.]*)S)?)?|([0-9,.]*)W)$/,ir=/(\[[^\[]*\])|(\\)?(Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Q|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|mm?|ss?|S{1,4}|X|zz?|ZZ?|.)/g,ut=/(\[[^\[]*\])|(\\)?(LT|LL?L?L?|l{1,4})/g,rr=/\d\d?/,wu=/\d{1,3}/,bu=/\d{1,4}/,ku=/[+\-]?\d{1,6}/,du=/\d+/,gu=/[0-9]*['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+|[\u0600-\u06FF\/]+(\s*?[\u0600-\u06FF]+){1,2}/i,kt=/Z|[\+\-]\d\d:?\d\d/gi,nf=/T/i,tf=/[\+\-]?\d+(\.\d{1,3})?/,rf=/\d{1,2}/,ur=/\d/,fr=/\d\d/,er=/\d{3}/,uf=/\d{4}/,ff=/[+-]?\d{6}/,ef=/[+-]?\d+/,of=/^\s*(?:[+-]\d{6}|\d{4})-(?:(\d\d-\d\d)|(W\d\d$)|(W\d\d-\d)|(\d\d\d))((T| )(\d\d(:\d\d(:\d\d(\.\d+)?)?)?)?([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/,dt=[["YYYYYY-MM-DD",/[+-]\d{6}-\d{2}-\d{2}/],["YYYY-MM-DD",/\d{4}-\d{2}-\d{2}/],["GGGG-[W]WW-E",/\d{4}-W\d{2}-\d/],["GGGG-[W]WW",/\d{4}-W\d{2}/],["YYYY-DDD",/\d{4}-\d{3}/]],gt=[["HH:mm:ss.SSSS",/(T| )\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss",/(T| )\d\d:\d\d:\d\d/],["HH:mm",/(T| )\d\d:\d\d/],["HH",/(T| )\d\d/]],sf=/([\+\-]|\d\d)/gi,ni=("Date|Hours|Minutes|Seconds|Milliseconds".split("|"),{Milliseconds:1,Seconds:1e3,Minutes:6e4,Hours:36e5,Days:864e5,Months:2592e6,Years:31536e6}),hf={ms:"millisecond",s:"second",m:"minute",h:"hour",d:"day",D:"date",w:"week",W:"isoWeek",M:"month",Q:"quarter",y:"year",DDD:"dayOfYear",e:"weekday",E:"isoWeekday",gg:"weekYear",GG:"isoWeekYear"},cf={dayofyear:"dayOfYear",isoweekday:"isoWeekday",isoweek:"isoWeek",weekyear:"weekYear",isoweekyear:"isoWeekYear"},ti={},w={s:45,m:45,h:22,dd:25,dm:45,dy:345},or="DDD w W M D d".split(" "),sr="M D H h m s w W".split(" "),v={M:function(){return this.month()+1},MMM:function(n){return this.lang().monthsShort(this,n)},MMMM:function(n){return this.lang().months(this,n)},D:function(){return this.date()},DDD:function(){return this.dayOfYear()},d:function(){return this.day()},dd:function(n){return this.lang().weekdaysMin(this,n)},ddd:function(n){return this.lang().weekdaysShort(this,n)},dddd:function(n){return this.lang().weekdays(this,n)},w:function(){return this.week()},W:function(){return this.isoWeek()},YY:function(){return r(this.year()%100,2)},YYYY:function(){return r(this.year(),4)},YYYYY:function(){return r(this.year(),5)},YYYYYY:function(){var n=this.year(),t=n>=0?"+":"-";return t+r(Math.abs(n),6)},gg:function(){return r(this.weekYear()%100,2)},gggg:function(){return r(this.weekYear(),4)},ggggg:function(){return r(this.weekYear(),5)},GG:function(){return r(this.isoWeekYear()%100,2)},GGGG:function(){return r(this.isoWeekYear(),4)},GGGGG:function(){return r(this.isoWeekYear(),5)},e:function(){return this.weekday()},E:function(){return this.isoWeekday()},a:function(){return this.lang().meridiem(this.hours(),this.minutes(),!0)},A:function(){return this.lang().meridiem(this.hours(),this.minutes(),!1)},H:function(){return this.hours()},h:function(){return this.hours()%12||12},m:function(){return this.minutes()},s:function(){return this.seconds()},S:function(){return i(this.milliseconds()/100)},SS:function(){return r(i(this.milliseconds()/10),2)},SSS:function(){return r(this.milliseconds(),3)},SSSS:function(){return r(this.milliseconds(),3)},Z:function(){var n=-this.zone(),t="+";return 0>n&&(n=-n,t="-"),t+r(i(n/60),2)+":"+r(i(n)%60,2)},ZZ:function(){var n=-this.zone(),t="+";return 0>n&&(n=-n,t="-"),t+r(i(n/60),2)+r(i(n)%60,2)},z:function(){return this.zoneAbbr()},zz:function(){return this.zoneName()},X:function(){return this.unix()},Q:function(){return this.quarter()}},hr=["months","monthsShort","weekdays","weekdaysShort","weekdaysMin"];or.length;)u=or.pop(),v[u+"o"]=cr(v[u],u);for(;sr.length;)u=sr.pop(),v[u+u]=ii(v[u],2);for(v.DDDD=ii(v.DDD,3),o(ri.prototype,{set:function(n){var t,i;for(i in n)t=n[i],"function"==typeof t?this[i]=t:this["_"+i]=t},_months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),months:function(n){return this._months[n.month()]},_monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),monthsShort:function(n){return this._monthsShort[n.month()]},monthsParse:function(n){var i,r,u;for(this._monthsParse||(this._monthsParse=[]),i=0;12>i;i++)if(this._monthsParse[i]||(r=t.utc([2e3,i]),u="^"+this.months(r,"")+"|^"+this.monthsShort(r,""),this._monthsParse[i]=new RegExp(u.replace(".",""),"i")),this._monthsParse[i].test(n))return i},_weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdays:function(n){return this._weekdays[n.day()]},_weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysShort:function(n){return this._weekdaysShort[n.day()]},_weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),weekdaysMin:function(n){return this._weekdaysMin[n.day()]},weekdaysParse:function(n){var i,r,u;for(this._weekdaysParse||(this._weekdaysParse=[]),i=0;7>i;i++)if(this._weekdaysParse[i]||(r=t([2e3,1]).day(i),u="^"+this.weekdays(r,"")+"|^"+this.weekdaysShort(r,"")+"|^"+this.weekdaysMin(r,""),this._weekdaysParse[i]=new RegExp(u.replace(".",""),"i")),this._weekdaysParse[i].test(n))return i},_longDateFormat:{LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D YYYY",LLL:"MMMM D YYYY LT",LLLL:"dddd, MMMM D YYYY LT"},longDateFormat:function(n){var t=this._longDateFormat[n];return!t&&this._longDateFormat[n.toUpperCase()]&&(t=this._longDateFormat[n.toUpperCase()].replace(/MMMM|MM|DD|dddd/g,function(n){return n.slice(1)}),this._longDateFormat[n]=t),t},isPM:function(n){return"p"===(n+"").toLowerCase().charAt(0)},_meridiemParse:/[ap]\.?m?\.?/i,meridiem:function(n,t,i){return n>11?i?"pm":"PM":i?"am":"AM"},_calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},calendar:function(n,t){var i=this._calendar[n];return"function"==typeof i?i.apply(t):i},_relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},relativeTime:function(n,t,i,r){var u=this._relativeTime[i];return"function"==typeof u?u(n,t,i,r):u.replace(/%d/i,n)},pastFuture:function(n,t){var i=this._relativeTime[n>0?"future":"past"];return"function"==typeof i?i(t):i.replace(/%s/i,t)},ordinal:function(n){return this._ordinal.replace("%d",n)},_ordinal:"%d",preparse:function(n){return n},postformat:function(n){return n},week:function(n){return b(n,this._week.dow,this._week.doy).week},_week:{dow:0,doy:6},_invalidDate:"Invalid date",invalidDate:function(){return this._invalidDate}}),t=function(t,i,r,u){var f;return"boolean"==typeof r&&(u=r,r=n),f={},f._isAMomentObject=!0,f._i=t,f._f=i,f._l=r,f._strict=u,f._isUTC=!1,f._pf=ft(),yi(f)},t.suppressDeprecationWarnings=!1,t.createFromInputFallback=g("moment construction falls back to js Date. This is discouraged and will be removed in upcoming major release. Please refer to https://github.com/moment/moment/issues/1407 for more info.",function(n){n._d=new Date(n._i)}),t.min=function(){var n=[].slice.call(arguments,0);return pi("isBefore",n)},t.max=function(){var n=[].slice.call(arguments,0);return pi("isAfter",n)},t.utc=function(t,i,r,u){var f;return"boolean"==typeof r&&(u=r,r=n),f={},f._isAMomentObject=!0,f._useUTC=!0,f._isUTC=!0,f._l=r,f._i=t,f._f=i,f._strict=u,f._pf=ft(),yi(f).utc()},t.unix=function(n){return t(1e3*n)},t.duration=function(n,r){var f,h,o,s=n,u=null;return t.isDuration(n)?s={ms:n._milliseconds,d:n._days,M:n._months}:"number"==typeof n?(s={},r?s[r]=n:s.milliseconds=n):(u=yu.exec(n))?(f="-"===u[1]?-1:1,s={y:0,d:i(u[e])*f,h:i(u[a])*f,m:i(u[nt])*f,s:i(u[tt])*f,ms:i(u[it])*f}):(u=pu.exec(n))&&(f="-"===u[1]?-1:1,o=function(n){var t=n&&parseFloat(n.replace(",","."));return(isNaN(t)?0:t)*f},s={y:o(u[2]),M:o(u[3]),d:o(u[4]),h:o(u[5]),m:o(u[6]),s:o(u[7]),w:o(u[8])}),h=new ot(s),t.isDuration(n)&&n.hasOwnProperty("_lang")&&(h._lang=n._lang),h},t.version="2.7.0",t.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",t.ISO_8601=function(){},t.momentProperties=nr,t.updateOffset=function(){},t.relativeTimeThreshold=function(t,i){return w[t]===n?!1:(w[t]=i,!0)},t.lang=function(n,i){var r;return n?(i?yr(ct(n),i):null===i?(pr(n),n="en"):p[n]||f(n),r=t.duration.fn._lang=t.fn._lang=f(n),r._abbr):t.fn._lang._abbr},t.langData=function(n){return n&&n._lang&&n._lang._abbr&&(n=n._lang._abbr),f(n)},t.isMoment=function(n){return n instanceof et||null!=n&&n.hasOwnProperty("_isAMomentObject")},t.isDuration=function(n){return n instanceof ot},u=hr.length-1;u>=0;--u)vr(hr[u]);t.normalizeUnits=function(n){return s(n)};t.invalid=function(n){var i=t.utc(NaN);return null!=n?o(i._pf,n):i._pf.userInvalidated=!0,i};t.parseZone=function(){return t.apply(null,arguments).parseZone()};t.parseTwoDigitYear=function(n){return i(n)+(i(n)>68?1900:2e3)};o(t.fn=et.prototype,{clone:function(){return t(this)},valueOf:function(){return+this._d+6e4*(this._offset||0)},unix:function(){return Math.floor(+this/1e3)},toString:function(){return this.clone().lang("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")},toDate:function(){return this._offset?new Date(+this):this._d},toISOString:function(){var n=t(this).utc();return 0<n.year()&&n.year()<=9999?at(n,"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]"):at(n,"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]")},toArray:function(){var n=this;return[n.year(),n.month(),n.date(),n.hours(),n.minutes(),n.seconds(),n.milliseconds()]},isValid:function(){return ci(this)},isDSTShifted:function(){return this._a?this.isValid()&&ui(this._a,(this._isUTC?t.utc(this._a):t(this._a)).toArray())>0:!1},parsingFlags:function(){return o({},this._pf)},invalidAt:function(){return this._pf.overflow},utc:function(){return this.zone(0)},local:function(){return this.zone(0),this._isUTC=!1,this},format:function(n){var i=at(this,n||t.defaultFormat);return this.lang().postformat(i)},add:function(n,i){var r;return r="string"==typeof n&&"string"==typeof i?t.duration(isNaN(+i)?+n:+i,isNaN(+i)?i:n):"string"==typeof n?t.duration(+i,n):t.duration(n,i),st(this,r,1),this},subtract:function(n,i){var r;return r="string"==typeof n&&"string"==typeof i?t.duration(isNaN(+i)?+n:+i,isNaN(+i)?i:n):"string"==typeof n?t.duration(+i,n):t.duration(n,i),st(this,r,-1),this},diff:function(n,i,r){var u,e,f=lt(n,this),o=6e4*(this.zone()-f.zone());return i=s(i),"year"===i||"month"===i?(u=432e5*(this.daysInMonth()+f.daysInMonth()),e=12*(this.year()-f.year())+(this.month()-f.month()),e+=(this-t(this).startOf("month")-(f-t(f).startOf("month")))/u,e-=6e4*(this.zone()-t(this).startOf("month").zone()-(f.zone()-t(f).startOf("month").zone()))/u,"year"===i&&(e/=12)):(u=this-f,e="second"===i?u/1e3:"minute"===i?u/6e4:"hour"===i?u/36e5:"day"===i?(u-o)/864e5:"week"===i?(u-o)/6048e5:u),r?e:y(e)},from:function(n,i){return t.duration(this.diff(n)).lang(this.lang()._abbr).humanize(!i)},fromNow:function(n){return this.from(t(),n)},calendar:function(n){var r=n||t(),u=lt(r,this).startOf("day"),i=this.diff(u,"days",!0),f=-6>i?"sameElse":-1>i?"lastWeek":0>i?"lastDay":1>i?"sameDay":2>i?"nextDay":7>i?"nextWeek":"sameElse";return this.format(this.lang().calendar(f,this))},isLeapYear:function(){return si(this.year())},isDST:function(){return this.zone()<this.clone().month(0).zone()||this.zone()<this.clone().month(5).zone()},day:function(n){var t=this._isUTC?this._d.getUTCDay():this._d.getDay();return null!=n?(n=su(n,this.lang()),this.add({d:n-t})):t},month:h("Month",!0),startOf:function(n){switch(n=s(n)){case"year":this.month(0);case"quarter":case"month":this.date(1);case"week":case"isoWeek":case"day":this.hours(0);case"hour":this.minutes(0);case"minute":this.seconds(0);case"second":this.milliseconds(0)}return"week"===n?this.weekday(0):"isoWeek"===n&&this.isoWeekday(1),"quarter"===n&&this.month(3*Math.floor(this.month()/3)),this},endOf:function(n){return n=s(n),this.startOf(n).add("isoWeek"===n?"week":n,1).subtract("ms",1)},isAfter:function(n,i){return i="undefined"!=typeof i?i:"millisecond",+this.clone().startOf(i)>+t(n).startOf(i)},isBefore:function(n,i){return i="undefined"!=typeof i?i:"millisecond",+this.clone().startOf(i)<+t(n).startOf(i)},isSame:function(n,t){return t=t||"ms",+this.clone().startOf(t)==+lt(n,this).startOf(t)},min:g("moment().min is deprecated, use moment.min instead. https://github.com/moment/moment/issues/1548",function(n){return n=t.apply(null,arguments),this>n?this:n}),max:g("moment().max is deprecated, use moment.max instead. https://github.com/moment/moment/issues/1548",function(n){return n=t.apply(null,arguments),n>this?this:n}),zone:function(n,i){var r=this._offset||0;return null==n?this._isUTC?r:this._d.getTimezoneOffset():("string"==typeof n&&(n=ai(n)),Math.abs(n)<16&&(n=60*n),this._offset=n,this._isUTC=!0,r!==n&&(!i||this._changeInProgress?st(this,t.duration(r-n,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,t.updateOffset(this,!0),this._changeInProgress=null)),this)},zoneAbbr:function(){return this._isUTC?"UTC":""},zoneName:function(){return this._isUTC?"Coordinated Universal Time":""},parseZone:function(){return this._tzm?this.zone(this._tzm):"string"==typeof this._i&&this.zone(this._i),this},hasAlignedHourOffset:function(n){return n=n?t(n).zone():0,(this.zone()-n)%60==0},daysInMonth:function(){return ht(this.year(),this.month())},dayOfYear:function(n){var i=k((t(this).startOf("day")-t(this).startOf("year"))/864e5)+1;return null==n?i:this.add("d",n-i)},quarter:function(n){return null==n?Math.ceil((this.month()+1)/3):this.month(3*(n-1)+this.month()%3)},weekYear:function(n){var t=b(this,this.lang()._week.dow,this.lang()._week.doy).year;return null==n?t:this.add("y",n-t)},isoWeekYear:function(n){var t=b(this,1,4).year;return null==n?t:this.add("y",n-t)},week:function(n){var t=this.lang().week(this);return null==n?t:this.add("d",7*(n-t))},isoWeek:function(n){var t=b(this,1,4).week;return null==n?t:this.add("d",7*(n-t))},weekday:function(n){var t=(this.day()+7-this.lang()._week.dow)%7;return null==n?t:this.add("d",n-t)},isoWeekday:function(n){return null==n?this.day()||7:this.day(this.day()%7?n:n-7)},isoWeeksInYear:function(){return ei(this.year(),1,4)},weeksInYear:function(){var n=this._lang._week;return ei(this.year(),n.dow,n.doy)},get:function(n){return n=s(n),this[n]()},set:function(n,t){return n=s(n),"function"==typeof this[n]&&this[n](t),this},lang:function(t){return t===n?this._lang:(this._lang=f(t),this)}});t.fn.millisecond=t.fn.milliseconds=h("Milliseconds",!1);t.fn.second=t.fn.seconds=h("Seconds",!1);t.fn.minute=t.fn.minutes=h("Minutes",!1);t.fn.hour=t.fn.hours=h("Hours",!0);t.fn.date=h("Date",!0);t.fn.dates=g("dates accessor is deprecated. Use date instead.",h("Date",!0));t.fn.year=h("FullYear",!0);t.fn.years=g("years accessor is deprecated. Use year instead.",h("FullYear",!0));t.fn.days=t.fn.day;t.fn.months=t.fn.month;t.fn.weeks=t.fn.week;t.fn.isoWeeks=t.fn.isoWeek;t.fn.quarters=t.fn.quarter;t.fn.toJSON=t.fn.toISOString;o(t.duration.fn=ot.prototype,{_bubble:function(){var t,i,r,e,o=this._milliseconds,u=this._days,f=this._months,n=this._data;n.milliseconds=o%1e3;t=y(o/1e3);n.seconds=t%60;i=y(t/60);n.minutes=i%60;r=y(i/60);n.hours=r%24;u+=y(r/24);n.days=u%30;f+=y(u/30);n.months=f%12;e=y(f/12);n.years=e},weeks:function(){return y(this.days()/7)},valueOf:function(){return this._milliseconds+864e5*this._days+this._months%12*2592e6+31536e6*i(this._months/12)},humanize:function(n){var i=+this,t=cu(i,!n,this.lang());return n&&(t=this.lang().pastFuture(i,t)),this.lang().postformat(t)},add:function(n,i){var r=t.duration(n,i);return this._milliseconds+=r._milliseconds,this._days+=r._days,this._months+=r._months,this._bubble(),this},subtract:function(n,i){var r=t.duration(n,i);return this._milliseconds-=r._milliseconds,this._days-=r._days,this._months-=r._months,this._bubble(),this},get:function(n){return n=s(n),this[n.toLowerCase()+"s"]()},as:function(n){return n=s(n),this["as"+n.charAt(0).toUpperCase()+n.slice(1)+"s"]()},lang:t.fn.lang,toIsoString:function(){var r=Math.abs(this.years()),u=Math.abs(this.months()),f=Math.abs(this.days()),n=Math.abs(this.hours()),t=Math.abs(this.minutes()),i=Math.abs(this.seconds()+this.milliseconds()/1e3);return this.asSeconds()?(this.asSeconds()<0?"-":"")+"P"+(r?r+"Y":"")+(u?u+"M":"")+(f?f+"D":"")+(n||t||i?"T":"")+(n?n+"H":"")+(t?t+"M":"")+(i?i+"S":""):"P0D"}});for(u in ni)ni.hasOwnProperty(u)&&(ki(u,ni[u]),au(u.toLowerCase()));ki("Weeks",6048e5);t.duration.fn.asMonths=function(){return(+this-31536e6*this.years())/2592e6+12*this.years()};t.lang("en",{ordinal:function(n){var t=n%10,r=1===i(n%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th";return n+r}});tr?module.exports=t:"function"==typeof define&&define.amd?(define("moment",function(n,i,r){return r.config&&r.config()&&r.config().noGlobal===!0&&(bt.moment=gi),t}),di(!0)):di()}.call(this);window.Modernizr=function(n,t,i){function w(n){d.cssText=n}function e(n,t){return typeof n===t}var r={},c=!0,u=t.documentElement,f="modernizr",b=t.createElement(f),d=b.style,g,nt={}.toString,l=" -webkit- -moz- -o- -ms- ".split(" "),o={},a=[],v=a.slice,s,k=function(n,i,r,e){var l,a,c,v,o=t.createElement("div"),h=t.body,s=h||t.createElement("body");if(parseInt(r,10))while(r--)c=t.createElement("div"),c.id=e?e[r]:f+(r+1),o.appendChild(c);return l=["&#173;",'<style id="s',f,'">',n,"<\/style>"].join(""),o.id=f,(h?o:s).innerHTML+=l,s.appendChild(o),h||(s.style.background="",s.style.overflow="hidden",v=u.style.overflow,u.style.overflow="hidden",u.appendChild(s)),a=i(o,n),h?o.parentNode.removeChild(o):(s.parentNode.removeChild(s),u.style.overflow=v),!!a},y={}.hasOwnProperty,p,h;p=!e(y,"undefined")&&!e(y.call,"undefined")?function(n,t){return y.call(n,t)}:function(n,t){return t in n&&e(n.constructor.prototype[t],"undefined")};Function.prototype.bind||(Function.prototype.bind=function(n){var t=this,i,r;if(typeof t!="function")throw new TypeError;return i=v.call(arguments,1),r=function(){var f,e,u;return this instanceof r?(f=function(){},f.prototype=t.prototype,e=new f,u=t.apply(e,i.concat(v.call(arguments))),Object(u)===u?u:e):t.apply(n,i.concat(v.call(arguments)))},r});o.touch=function(){var i;return"ontouchstart"in n||n.DocumentTouch&&t instanceof DocumentTouch?i=!0:k(["@media (",l.join("touch-enabled),("),f,")","{#modernizr{top:9px;position:absolute}}"].join(""),function(n){i=n.offsetTop===9}),i};for(h in o)p(o,h)&&(s=h.toLowerCase(),r[s]=o[h](),a.push((r[s]?"":"no-")+s));return r.addTest=function(n,t){if(typeof n=="object")for(var f in n)p(n,f)&&r.addTest(f,n[f]);else{if(n=n.toLowerCase(),r[n]!==i)return r;t=typeof t=="function"?t():t;typeof c!="undefined"&&c&&(u.className+=" "+(t?"":"no-")+n);r[n]=t}return r},w(""),b=g=null,r._version="2.7.1",r._prefixes=l,r.testStyles=k,u.className=u.className.replace(/(^|\s)no-js(\s|$)/,"$1$2")+(c?" js "+a.join(" "):""),r}(this,this.document);$(window).on("load",function(){var n=$(window).width();$(".cookie-warn .close-cookie-warn").on("click",function(){setTimeout(function(){height=$(".panel.cookie-warn").outerHeight();$(".cookie-warn, #responsive-menu-acquista").animate({marginTop:-height},{easing:"swing"},1500)},1)});$(document).one("mousedown",function(){return $(".cookie-warn .close-cookie-warn").click(),!0});$(window).one("scroll",function(){$(".cookie-warn .close-cookie-warn").click()})});$(document).ready(function(){var t=null,u=function(n){$.each(n,function(n,t){$(t).find(".panel-body").show();$(t).find(".panel-head a").off("click")})},f=function(n){$.each(n,function(n,t){$(t).find(".panel-body").hide();$(t).find(".panel-head a").off("click").on("click",function(){var i=$($(t).find(".panel-head a")),n=$($(t).find(".panel-body"));n.is(":visible")?(n.slideUp(400),i.removeClass("goneUp")):(n.slideDown(400),i.addClass("goneUp"))})})},i=function(){return $(window).width()>=768?(n!="desktop"&&u($("footer [data-collapsermobile]")),"desktop"):(n!="mobile"&&f($("footer [data-collapsermobile]")),"mobile")},r=function(n){var t=0;$.each(n,function(n,i){t=t>$(i).outerHeight()?t:$(i).outerHeight()});$(n).parent().css({height:t})},n=i();$("footer [data-action][data-target]").on("click",function(n){var u=$(this).data("action"),t=$($(this).data("target")),i=$(n.target);switch(u){case"slide":t.is(":visible")?(t.slideUp(400),i.removeClass("goneUp")):(t.slideDown(400,function(){r($('footer [id^="infopanel-"]'))}),i.addClass("goneUp"));break;case"fade":t.is(":visible")?i.removeClass("active"):(t.siblings().fadeOut(400),i.parent().siblings().find("a").removeClass("active"),t.fadeIn(400,function(){r($('footer [id^="infopanel-"]'))}),i.addClass("active"))}});$(window).resize(function(){clearTimeout(t);t=setTimeout(function(){n=i()},200)})}),function(n,t){typeof define=="function"&&define.amd?define(["jquery"],t):t(n.jQuery)}(this,function(n){function u(){var i=document.createElement("smartbanner"),t={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"},n;for(n in t)if(i.style[n]!==undefined)return{end:t[n]};return!1}var t=navigator.userAgent,r=/Edge/i.test(t),i=function(i){var e,u,f;if((this.origHtmlMargin=parseFloat(n("html").css("margin-top")),this.options=n.extend({},n.smartbanner.defaults,i),e=navigator.standalone,this.options.force?this.type=this.options.force:t.match(/Windows Phone/i)!==null&&t.match(/Edge|Touch/i)!==null?this.type="windows":t.match(/iPhone|iPod/i)!==null||t.match(/iPad/)&&this.options.iOSUniversalApp?t.match(/Safari/i)!==null&&(t.match(/CriOS/i)!==null||t.match(/FxiOS/i)!=null||window.Number(t.substr(t.indexOf("OS ")+3,3).replace("_","."))<6)&&(this.type="ios"):t.match(/\bSilk\/(.*\bMobile Safari\b)?/)||t.match(/\bKF\w/)||t.match("Kindle Fire")?this.type="kindle":t.match(/Android/i)!==null&&(this.type="android"),this.type&&!e&&!this.getCookie("sb-closed")&&!this.getCookie("sb-installed"))&&(this.scale=this.options.scale=="auto"?n(window).width()/window.screen.width:this.options.scale,this.scale<1&&(this.scale=1),u=n(this.type=="android"?'meta[name="google-play-app"]':this.type=="ios"?'meta[name="apple-itunes-app"]':this.type=="kindle"?'meta[name="kindle-fire-app"]':'meta[name="msApplication-ID"]'),u.length)){if(this.type=="windows")r&&(this.appId=n('meta[name="msApplication-PackageEdgeName"]').attr("content")),this.appId||(this.appId=n('meta[name="msApplication-PackageFamilyName"]').attr("content"));else if(f=/app-id=([^\s,]+)/.exec(u.attr("content")),f)this.appId=f[1];else return;this.title=this.options.title?this.options.title:u.data("title")||n("title").text().replace(/\s*[|\-·].*$/,"");this.author=this.options.author?this.options.author:u.data("author")||(n('meta[name="author"]').length?n('meta[name="author"]').attr("content"):window.location.hostname);this.iconUrl=u.data("icon-url");this.price=u.data("price");this.options.onInstall=typeof this.options.onInstall=="function"?this.options.onInstall:function(){};this.options.onClose=typeof this.options.onClose=="function"?this.options.onClose:function(){};this.create();this.show();this.listen()}};(i.prototype={constructor:i,create:function(){var t,u=this.price||this.options.price,f=this.options.url||function(){switch(this.type){case"android":return"market://details?id=";case"kindle":return"amzn://apps/android?asin=";case"windows":return r?"ms-windows-store://pdp/?productid=":"ms-windows-store:navigate?appid="}return"https://itunes.apple.com/"+this.options.appStoreLanguage+"/app/id"}.call(this)+this.appId,o=u?function(){var n=u+" - ";switch(this.type){case"android":return n+this.options.inGooglePlay;case"kindle":return n+this.options.inAmazonAppStore;case"windows":return n+this.options.inWindowsStore}return n+this.options.inAppStore}.call(this):"",e=this.options.iconGloss==null?this.type=="ios":this.options.iconGloss,i;this.type=="android"&&this.options.GooglePlayParams&&(f+="&referrer="+this.options.GooglePlayParams);i='<div id="smartbanner" class="'+this.type+'"><div class="sb-container"><a href="#" class="sb-close">&times;<\/a><span class="sb-icon"><\/span><div class="sb-info"><strong>'+this.title+"<\/strong><span>"+this.author+"<\/span><span>"+o+'<\/span><\/div><a href="'+f+'" class="sb-button"><span>'+this.options.button+"<\/span><\/a><\/div><\/div>";this.options.layer?n(this.options.appendToSelector).append(i):n(this.options.appendToSelector).prepend(i);this.options.icon?t=this.options.icon:this.iconUrl?t=this.iconUrl:n('link[rel="apple-touch-icon-precomposed"]').length>0?(t=n('link[rel="apple-touch-icon-precomposed"]').attr("href"),this.options.iconGloss==null&&(e=!1)):n('link[rel="apple-touch-icon"]').length>0?t=n('link[rel="apple-touch-icon"]').attr("href"):n('meta[name="msApplication-TileImage"]').length>0?t=n('meta[name="msApplication-TileImage"]').attr("content"):n('meta[name="msapplication-TileImage"]').length>0&&(t=n('meta[name="msapplication-TileImage"]').attr("content"));t?(n("#smartbanner .sb-icon").css("background-image","url("+t+")"),e&&n("#smartbanner .sb-icon").addClass("gloss")):n("#smartbanner").addClass("no-icon");this.bannerHeight=n("#smartbanner").outerHeight()+2;this.scale>1&&(n("#smartbanner").css("top",parseFloat(n("#smartbanner").css("top"))*this.scale).css("height",parseFloat(n("#smartbanner").css("height"))*this.scale).hide(),n("#smartbanner .sb-container").css("-webkit-transform","scale("+this.scale+")").css("-msie-transform","scale("+this.scale+")").css("-moz-transform","scale("+this.scale+")").css("width",n(window).width()/this.scale));n("#smartbanner").css("position",this.options.layer?"absolute":"static")},listen:function(){n("#smartbanner .sb-close").on("click",n.proxy(this.close,this));n("#smartbanner .sb-button").on("click",n.proxy(this.install,this))},show:function(t){var i=n("#smartbanner"),r;i.stop();this.options.layer?(i.animate({top:0,display:"block"},this.options.speedIn).addClass("shown").show(),n(this.pushSelector).animate({paddingTop:this.origHtmlMargin+this.bannerHeight*this.scale},this.options.speedIn,"swing",t)):n.support.transition?(i.animate({top:0},this.options.speedIn).addClass("shown"),r=function(){n("html").removeClass("sb-animation");t&&t()},n(this.pushSelector).addClass("sb-animation").one(n.support.transition.end,r).emulateTransitionEnd(this.options.speedIn).css("margin-top",this.origHtmlMargin+this.bannerHeight*this.scale)):i.slideDown(this.options.speedIn).addClass("shown")},hide:function(t){var i=n("#smartbanner"),r;i.stop();this.options.layer?(i.animate({top:-1*this.bannerHeight*this.scale,display:"block"},this.options.speedIn).removeClass("shown"),n(this.pushSelector).animate({paddingTop:this.origHtmlMargin},this.options.speedIn,"swing",t)):n.support.transition?(this.type!=="android"?i.css("top",-1*this.bannerHeight*this.scale).removeClass("shown"):i.css({display:"none"}).removeClass("shown"),r=function(){n("html").removeClass("sb-animation");t&&t()},n(this.pushSelector).addClass("sb-animation").one(n.support.transition.end,r).emulateTransitionEnd(this.options.speedOut).css("margin-top",this.origHtmlMargin)):i.slideUp(this.options.speedOut).removeClass("shown")},close:function(n){n.preventDefault();this.hide();this.setCookie("sb-closed","true",this.options.daysHidden);this.options.onClose(n)},install:function(n){this.options.hideOnInstall&&this.hide();this.setCookie("sb-installed","true",this.options.daysReminder);this.options.onInstall(n)},setCookie:function(n,t,i){var r=new Date;r.setDate(r.getDate()+i);t=encodeURI(t)+(i==null?"":"; expires="+r.toUTCString());document.cookie=n+"="+t+"; path=/;"},getCookie:function(n){for(var r,u,i=document.cookie.split(";"),t=0;t<i.length;t++)if(r=i[t].substr(0,i[t].indexOf("=")),u=i[t].substr(i[t].indexOf("=")+1),r=r.replace(/^\s+|\s+$/g,""),r==n)return decodeURI(u);return null},switchType:function(){var t=this;this.hide(function(){t.type=t.type=="android"?"ios":"android";var i=n(t.type=="android"?'meta[name="google-play-app"]':'meta[name="apple-itunes-app"]').attr("content");t.appId=/app-id=([^\s,]+)/.exec(i)[1];n("#smartbanner").detach();t.create();t.show()})}},n.smartbanner=function(t){var u=n(window),r=u.data("smartbanner"),f=typeof t=="object"&&t;r||u.data("smartbanner",r=new i(f));typeof t=="string"&&r[t]()},n.smartbanner.defaults={title:null,author:null,price:"FREE",appStoreLanguage:"us",inAppStore:"On the App Store",inGooglePlay:"In Google Play",inAmazonAppStore:"In the Amazon Appstore",inWindowsStore:"In the Windows Store",GooglePlayParams:null,icon:null,iconGloss:null,button:"VIEW",url:null,scale:"auto",speedIn:300,speedOut:400,daysHidden:15,daysReminder:90,force:null,hideOnInstall:!0,layer:!1,iOSUniversalApp:!0,appendToSelector:"body",pushSelector:"html"},n.smartbanner.Constructor=i,n.support.transition===undefined)&&(n.fn.emulateTransitionEnd=function(t){var i=!1,u=this,r;n(this).one(n.support.transition.end,function(){i=!0});return r=function(){i||n(u).trigger(n.support.transition.end)},setTimeout(r,t),this},n(function(){n.support.transition=u()}))})