/*! matchMedia() polyfill - Test a CSS media type/query in JS. Authors & copyright (c) 2012: Scott Jehl, Paul Irish, Nicholas Zakas. Dual MIT/BSD license */
/*! NOTE: If you're already including a window.matchMedia polyfill via Modernizr or otherwise, you don't need this part */
function getScriptConfiguration(){var n,t=currentScript,i="",r="";return t&&(n=$(t).attr("data-domain"),"undefined"!=typeof n&&(i=n),n=$(t).attr("data-loopDomain"),"undefined"!=typeof n&&(r=n)),{domain:i,loopDomain:r}}var Loop,currentScript;window.matchMedia=window.matchMedia||function(n){var u,i=n.documentElement,f=i.firstElementChild||i.firstChild,r=n.createElement("body"),t=n.createElement("div");return t.id="mq-test-1",t.style.cssText="position:absolute;top:-100em",r.style.background="none",r.appendChild(t),function(n){return t.innerHTML='&shy;<style media="'+n+'"> #mq-test-1 { width: 42px; }<\/style>',i.insertBefore(r,f),u=t.offsetWidth==42,i.removeChild(r),{matches:u,media:n}}}(document);
/*! Respond.js v1.2.0: min/max-width media query polyfill. (c) Scott Jehl. MIT/GPLv2 Lic. j.mp/respondjs  */
(function(n){function d(){a(!0)}if(n.respond={},respond.update=function(){},respond.mediaQueriesSupported=n.matchMedia&&n.matchMedia("only all").matches,!respond.mediaQueriesSupported){var t=n.document,i=t.documentElement,e=[],u=[],r=[],o={},v=30,f=t.getElementsByTagName("head")[0]||i,g=t.getElementsByTagName("base")[0],s=f.getElementsByTagName("link"),h=[],y=function(){for(var f=s,c=f.length,r=0,t,i,u,e;r<c;r++)t=f[r],i=t.href,u=t.media,e=t.rel&&t.rel.toLowerCase()==="stylesheet",!i||!e||o[i]||(t.styleSheet&&t.styleSheet.rawCssText?(w(t.styleSheet.rawCssText,i,u),o[i]=!0):(/^([a-zA-Z:]*\/\/)/.test(i)||g)&&i.replace(RegExp.$1,"").split("/")[0]!==n.location.host||h.push({href:i,media:u}));p()},p=function(){if(h.length){var n=h.shift();nt(n.href,function(t){w(t,n.href,n.media);o[n.href]=!0;p()})}},w=function(n,t,i){var o=n.match(/@media[^\{]+\{([^\{\}]*\{[^\}\{]*\})+/gi),s=o&&o.length||0,t=t.substring(0,t.lastIndexOf("/")),v=function(n){return n.replace(/(url\()['"]?([^\/\)'"][^:\)'"]+)['"]?(\))/g,"$1"+t+"$2$3")},y=!s&&i,h=0,f,c,r,l,p;for(t.length&&(t+="/"),y&&(s=1);h<s;h++)for(f=0,y?(c=i,u.push(v(n))):(c=o[h].match(/@media *([^\{]+)\{([\S\s]+?)$/)&&RegExp.$1,u.push(RegExp.$2&&v(RegExp.$2))),l=c.split(","),p=l.length;f<p;f++)r=l[f],e.push({media:r.split("(")[0].match(/(only\s+)?([a-zA-Z]+)\s?/)&&RegExp.$2||"all",rules:u.length-1,hasquery:r.indexOf("(")>-1,minw:r.match(/\(min\-width:[\s]*([\s]*[0-9\.]+)(px|em)[\s]*\)/)&&parseFloat(RegExp.$1)+(RegExp.$2||""),maxw:r.match(/\(max\-width:[\s]*([\s]*[0-9\.]+)(px|em)[\s]*\)/)&&parseFloat(RegExp.$1)+(RegExp.$2||"")});a()},c,b,k=function(){var u,r=t.createElement("div"),n=t.body,f=!1;return r.style.cssText="position:absolute;font-size:1em;width:1em",n||(n=f=t.createElement("body"),n.style.background="none"),n.appendChild(r),i.insertBefore(n,i.firstChild),u=r.offsetWidth,f?i.removeChild(n):n.removeChild(r),l=parseFloat(u)},l,a=function(n){var nt="clientWidth",tt=i[nt],it=t.compatMode==="CSS1Compat"&&tt||t.body[nt]||tt,d={},ot=s[s.length-1],rt=(new Date).getTime(),o,h,g;if(n&&c&&rt-c<v){clearTimeout(b);b=setTimeout(a,v);return}c=rt;for(o in e){var y=e[o],p=y.minw,w=y.maxw,ut=p===null,ft=w===null,et="em";!p||(p=parseFloat(p)*(p.indexOf(et)>-1?l||k():1));!w||(w=parseFloat(w)*(w.indexOf(et)>-1?l||k():1));y.hasquery&&(ut&&ft||!(ut||it>=p)||!(ft||it<=w))||(d[y.media]||(d[y.media]=[]),d[y.media].push(u[y.rules]))}for(o in r)r[o]&&r[o].parentNode===f&&f.removeChild(r[o]);for(o in d)h=t.createElement("style"),g=d[o].join("\n"),h.type="text/css",h.media=o,f.insertBefore(h,ot.nextSibling),h.styleSheet?h.styleSheet.cssText=g:h.appendChild(t.createTextNode(g)),r.push(h)},nt=function(n,t){var i=tt();i&&(i.open("GET",n,!0),i.onreadystatechange=function(){i.readyState==4&&(i.status==200||i.status==304)&&t(i.responseText)},i.readyState!=4)&&i.send(null)},tt=function(){var n=!1;try{n=new XMLHttpRequest}catch(t){n=new ActiveXObject("Microsoft.XMLHTTP")}return function(){return n}}();y();respond.update=y;n.addEventListener?n.addEventListener("resize",d,!1):n.attachEvent&&n.attachEvent("onresize",d)}})(this);!function(n){"use strict";function t(t){var i=this._getSettings(t);return this.routes=i.routes,this.notFoundHandler=i.page404,this.mode=n.history&&n.history.pushState?i.mode:"hash",this.root="/"===i.root?"/":"/"+this._trimSlashes(i.root)+"/",this.beforeHook=i.hooks.before,this.securityHook=i.hooks.secure,this._pageState=null,this._currentPage=null,this._skipCheck=!1,this._action=null,"hash"===this.mode&&(this._historyStack=[],this._historyIdx=0,this._historyState="add"),this}t.Page=function(n,t,i,r,u){this.uri=n||"";this.query=t||{};this.params=i||[];this.state=r||null;this.options=u||{}};t.prototype._getSettings=function(n){var t={},i={routes:[],mode:"history",root:"/",hooks:{before:function(){},secure:function(){return!0}},page404:function(n){console.error({page:n,message:"404. Page not found"})}};return n=n||{},["routes","mode","root","page404"].forEach(function(r){t[r]=n[r]||i[r]}),t.hooks=Object.assign({},i.hooks,n.hooks||{}),t};t.prototype._getHistoryFragment=function(){var t=decodeURI(n.location.pathname);return"/"!==this.root&&(t=t.replace(this.root,"")),this._trimSlashes(t)};t.prototype._getHashFragment=function(){var t=n.location.hash.substr(1).replace(/(\?.*)$/,"");return this._trimSlashes(t)};t.prototype._getFragment=function(){return"history"===this.mode?this._getHistoryFragment():this._getHashFragment()};t.prototype._trimSlashes=function(n){return"string"!=typeof n?"":n.toString().replace(/\/$/,"").replace(/^\//,"")};t.prototype._page404=function(n){this._currentPage=new t.Page(n);this.notFoundHandler(n)};t.prototype._parseRouteRule=function(n){if("string"!=typeof n)return n;var t=this._trimSlashes(n).replace(/([\\\/\-\_\.])/g,"\\$1").replace(/\{[a-zA-Z]+\}/g,"(:any)").replace(/\:any/g,"[\\w\\-\\_\\.]+").replace(/\:word/g,"[a-zA-Z]+").replace(/\:num/g,"\\d+");return new RegExp("^"+t+"$","i")};t.prototype._parseQuery=function(n){var t={};return"string"!=typeof n?t:("?"===n[0]&&(n=n.substr(1)),this._queryString=n,n.split("&").forEach(function(n){var i=n.split("=");""!==i[0]&&(void 0===i[1]&&(i[1]=!0),t[decodeURIComponent(i[0])]=i[1])}),t)};t.prototype._getHistoryQuery=function(){return this._parseQuery(n.location.search)};t.prototype._getHashQuery=function(){var t=n.location.hash.indexOf("?"),i=-1!==t?n.location.hash.substr(t):"";return this._parseQuery(i)};t.prototype._getQuery=function(){return"history"===this.mode?this._getHistoryQuery():this._getHashQuery()};t.prototype.add=function(n,t,i){return this.routes.push({rule:this._parseRouteRule(n),handler:t,options:i}),this};t.prototype.remove=function(n){var t=this;return"string"==typeof n&&(n=this._parseRouteRule(n).toString()),this.routes.some(function(i,r){return(i.handler===n||i.rule.toString()===n)&&(t.routes.splice(r,1),!0)}),this};t.prototype.reset=function(){return this.routes=[],this.mode=null,this.root="/",this._pageState={},this.removeUriListener(),this};t.prototype._pushHistory=function(){var n=this._getFragment();"hash"===this.mode&&("add"===this._historyState&&(this._historyIdx!==this._historyStack.length-1&&this._historyStack.splice(this._historyIdx+1),this._historyStack.push({path:n,state:this._pageState}),this._historyIdx=this._historyStack.length-1),this._historyState="add")};t.prototype._unloadCallback=function(n){var t;return this._skipCheck?!n||Promise.resolve(!0):this._currentPage&&this._currentPage.options&&this._currentPage.options.unloadCb?(t=this._currentPage.options.unloadCb(this._currentPage,n),!n||t instanceof Promise?t:t?Promise.resolve(t):Promise.reject(t)):!n||Promise.resolve(!0)};t.prototype._findRoute=function(){var i=this,r=this._getFragment();return this.routes.some(function(u){var e=r.match(u.rule),o,f;return e?(e.shift(),o=i._getQuery(),f=new t.Page(r,o,e,i._pageState,u.options),!!i.securityHook(f)&&(i._currentPage=f,i._skipCheck?(i._skipCheck=!1,!0):(i.beforeHook(f),u.handler.apply(f,e),i._pageState=null,n.onbeforeunload=function(n){if(!i._unloadCallback(!1))return n.returnValue=!0,!0},!0))):!1})};t.prototype._treatAsync=function(){var n;(n=this._currentPage.options.unloadCb(this._currentPage,!0))instanceof Promise||(n=n?Promise.resolve(n):Promise.reject(n));n.then(this._processUri.bind(this)).catch(this._resetState.bind(this))};t.prototype._resetState=function(){this._skipCheck=!0;this.navigateTo(this._current,this._currentPage.state,!0)};t.prototype._processUri=function(){var n=this._getFragment();this._current=n;this._pushHistory();this._findRoute.call(this)||this._page404(n)};t.prototype.check=function(){return this._skipCheck?this:(this._currentPage&&this._currentPage.options&&this._currentPage.options.unloadCb?this._treatAsync():this._processUri(),this)};t.prototype.addUriListener=function(){return"history"===this.mode?n.onpopstate=this.check.bind(this):n.onhashchange=this.check.bind(this),this};t.prototype.removeUriListener=function(){return n.onpopstate=null,n.onhashchange=null,this};t.prototype.redirectTo=function(t,i,r){return t=this._trimSlashes(t)||"",this._pageState=i||null,this._skipCheck=!!r,"history"===this.mode?(history.replaceState(i,null,this.root+this._trimSlashes(t)),this.check()):(this._historyIdx--,n.location.hash=t,this)};t.prototype.navigateTo=function(t,i,r){return t=this._trimSlashes(t)||"",this._pageState=i||null,this._skipCheck=!!r,"history"===this.mode?(history.pushState(i,null,this.root+this._trimSlashes(t)),this.check()):(n.location.hash=t,this)};t.prototype.refresh=function(){if(!this._currentPage)return this;var n=this._currentPage.uri+"?"+this._queryString;return this.navigateTo(n,this._currentPage.state)};t.prototype.back=function(){return"history"===this.mode?(n.history.back(),this):this.go(this._historyIdx-1)};t.prototype.forward=function(){return"history"===this.mode?(n.history.forward(),this):this.go(this._historyIdx+1)};t.prototype.go=function(t){if("history"===this.mode)return n.history.go(t),this;var i=this._historyStack[t];return i?(this._historyIdx=t,this._historyState="hold",this.navigateTo(i.path,i.state)):this};n.Router=t}(window);ko.bindingHandlers.fadeIf={init:function(n,t,i,r,u){var f=t();return $(n).toggle(ko.utils.unwrapObservable(f)),ko.bindingHandlers["if"].init(n,t,i,r,u)},update:function(n,t){var i=t();ko.utils.unwrapObservable(i)?$(n).slideDown(200).animate({opacity:"1"},200):$(n).animate({opacity:"0"},200).slideUp(200)}};ko.bindingHandlers.fadeVisible={init:function(n,t){var i=t();$(n).toggle(ko.utils.unwrapObservable(i))},update:function(n,t){var i=t();ko.utils.unwrapObservable(i)?$(n).slideDown(500,"easeInOutExpo").animate({opacity:"1"},500):$(n).animate({opacity:"0"},300).slideUp(500,"easeInOutExpo")}},function(n,t){var i=function(n,t,i){var r;return function(){function e(){i||n.apply(u,f);r=null}var u=this,f=arguments;r?clearTimeout(r):i&&n.apply(u,f);r=setTimeout(e,t||100)}};jQuery.fn[t]=function(n){return n?this.bind("resize",i(n)):this.trigger(t)}}(jQuery,"smartresize");Loop=Loop||{};Loop.Core=Loop.Core||{};Loop.Core.Configuration=function(){function n(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)}function r(n){var t,r=!1,u="",i="";return n=n||window.location.host,n&&(t=n.split(":"),t.length>1&&(n=t.slice(0,t.length-1).join(":"),u=t[t.length-1]),t=n.split("."),i=t.slice(-2).join("."),["com.au","net.au","org.au","edu.au","gov.au","net.za","co.uk","org.uk","ltd.uk","plc.uk","net.uk","sch.uk","ac.uk","gov.uk","com.fr","ac.jp","co.jp","ed.jp","go.jp","ne.jp","or.jp"].forEach(function(n){i===n&&(r=!0)}),r&&(i=t.slice(-3).join("."))),i}function e(n){n&&n.domain&&(u=t+("string"==typeof n.loopDomain&&n.loopDomain.length>0?n.loopDomain:"loop."+n.domain),i=t+"registration."+n.domain,f=t+"www."+n.domain)}function o(){Loop.Core.Configuration.loginPage=i+"/people/login";Loop.Core.Configuration.registerPage=i+"/people/register-user";Loop.Core.Configuration.UrlList.loopApi=u+"/api/v1";Loop.Core.Configuration.UrlList.frontiers=f}function s(n){var t=window.location.host;n&&!n.domain&&t&&(n.domain=r(t));e(n);o()}var h="0.3.17283.0",t="//",u="loop.frontiersin.org",i="registration.frontiersin.org",f="www.frontiersin.org";return{init:s,getDomain:r,version:function(){return h},generateUUID:function(){return n()+n()+"-"+n()+"-"+n()+"-"+n()+"-"+n()+n()+n()},loginPage:null,registerPage:null,currentUserId:null,loggedUserId:null,isUserLogged:function(){return isNaN(this.loggedUserId)===!1&&parseInt(this.loggedUserId,10)>=0},getLoginUri:function(n,t){var i=window.location.protocol+"//"+window.location.host,r=this.loginPage;return t=t?"actionReferral="+t+"&":"",n=n?n:window.location,n="returnUrl="+encodeURI(i+n),r+"?"+t+n},getRegisterUri:function(n,t){var i=window.location.protocol+"//"+window.location.host,r=this.registerPage;return t=t?"actionReferral="+t+"&":"",n=n?n:window.location,n="returnUrl="+encodeURI(i+n),r+"?"+t+n},UrlList:{frontiers:null,loopApi:null,getLoopProfilePage:function(n){var t=this.getAbsoluteUrl("frontiers","/people/{0}/overview");return t=t.replace("www","loop"),Loop.Core.Utils.stringFormat(t,n)},getDefaultProfilePicture:function(){var n=this.getAbsoluteUrl("frontiers","/cdn/images/profile/default_240.jpg");return n.replace("www","loop")},getProfilePicture:function(n){var t=this.getAbsoluteUrl("frontiers","/images/profile/{0}/203");return t=t.replace("www","loop"),Loop.Core.Utils.stringFormat(t,n)},getAbsoluteUrl:function(n,t){var i=$.trim(this[n]);if(t=$.trim(t),!i)throw new Error("The 'Loop.Core.Configuration.UrlList."+n+"' property is undefined.");if("function"==typeof i)throw new Error("The 'Loop.Core.Configuration.UrlList."+n+"' is a function.");return"/"===i[i.length-1]&&(i=i.substring(0,i.length-1)),"/"===t[0]&&(t=t.substring(1)),i+"/"+t}}}}();Loop.Core.Utils=function(){function n(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)}function t(){return'<script type="text/html" id="multipleAuthorsTemplate">    <ul class="people-list" data-bind="foreach: $data.authorList, css: {\'one-line\': $data.extendDataOnDialog === false}">        <li>            <div class="image-container">                <img alt="author image" class="img-responsive" data-bind="customImg: { src: pictureUrl }" />            <\/div>            <div class="data-container">                <div class="name"><a data-bind="text: name, attr: { href: profileUrl }"><\/a><\/div>                <div class="cb"><\/div>                <ul class="list-hrz">                    <!-- ko if: affiliation -->                    <li data-bind="text: affiliation"><\/li>                    <!-- /ko -->                    <li data-bind="text: location"><\/li>                <\/ul>            <\/div>            <div class="cb"><\/div>        <\/li>    <\/ul><\/script>'}function i(){return'<script type="text/html" id="authorsListTemplate">    <ul class="people-list-hrz" data-test-id="author-list">        <!-- ko foreach: $data.visibleAuthorList -->        <li>            <!-- ko if: ($data.profileUrl || $data.clickAction) && $parent.enableLinks -->            <a data-bind="attr: { href: $data.profileUrl }, click: $data.clickAction" data-test-id="author-name">                <span class="img-frame" data-bind="visible: $data.showImageInList"><img data-bind="attr: {src: $data.imageUrl}, visible: $data.showImageInList"                     data-test-id="author-image"                     onerror="this.src=Loop.Core.Configuration.UrlList.getDefaultProfilePicture();" /><\/span>                <span class="name" data-bind="text: $data.fullName"><\/span>            <\/a>            <!-- /ko -->            <!-- ko ifnot: ($data.profileUrl || $data.clickAction) && $parent.enableLinks -->            <span data-test-id="author-profile-link-empty">                <span class="img-frame" data-bind="visible: $data.showImageInList"><img data-bind="attr: {src: $data.imageUrl}, visible: $data.showImageInList"                     data-test-id="author-image"                     onerror="this.src=Loop.Core.Configuration.UrlList.getDefaultProfilePicture();" /><\/span>                <span class="name" data-bind="text: $data.fullName" data-test-id="author-name"><\/span>            <\/span>            <!-- /ko -->        <\/li>        <!-- /ko -->                <!-- ko if: $data.lastAuthor -->        <li>            <!-- ko if: $data.enableLinks -->               <a data-bind="click: $data.showMoreAction" class="more" data-test-id="author-list-more">                   <span data-bind="text: $data.showMoreCounter() + \' more\'"><\/span>               <\/a>            <!-- /ko -->            <!-- ko ifnot: $data.enableLinks -->               <span data-bind="text: $data.showMoreCounter() + \' more\'"><\/span>            <!-- /ko -->        <\/li>        <li>            <!-- ko if: ($data.lastAuthor().profileUrl || $data.lastAuthor().clickAction) && $data.enableLinks -->            <a data-bind="attr: {href: $data.lastAuthor().profileUrl }, click: $data.lastAuthor().clickAction" data-test-id="last-author-name">                <span class="img-frame" data-bind="visible: $data.lastAuthor().showImageInList"><img data-bind="attr: {src: $data.lastAuthor().imageUrl}, visible: $data.lastAuthor().showImageInList"                     data-test-id="last-author-image"                     onerror="this.src=Loop.Core.Configuration.UrlList.getDefaultProfilePicture();" /><\/span>                <span data-bind="text: $data.lastAuthor().fullName"><\/span>            <\/a>            <!-- /ko -->            <!-- ko ifnot: ($data.lastAuthor().profileUrl || $data.lastAuthor().clickAction) && $data.enableLinks -->            <span data-test-id="author-profile-link-empty">                <span class="img-frame" data-bind="visible: $data.lastAuthor().showImageInList"><img data-bind="attr: {src: $data.lastAuthor().imageUrl}, visible: $data.lastAuthor().showImageInList"                     data-test-id="author-image"                     onerror="this.src=Loop.Core.Configuration.UrlList.getDefaultProfilePicture();" /><\/span>                <span data-bind="text: $data.lastAuthor().fullName" data-test-id="last-author-name"><\/span>            <\/span>            <!-- /ko -->        <\/li>        <!-- /ko -->    <\/ul>    <div class="cb"><\/div><\/script><script type="text/html" id="authorsListDetailedTemplate">    <ul class="people-list" data-bind="foreach: $data.fullInfoAuthorList, css: {\'one-line\': $data.extendDataOnDialog === false}">        <li>            <div class="image-container">                <!-- ko if: profileUrl-->                <a data-bind="attr: { href: profileUrl }" href="" data-test-id="author-image-link">                    <span class="img-frame"><img data-bind="attr: { src: imageUrl, alt: fullName }" alt="" class="img-responsive"                         data-test-id="author-image"                         onerror="this.src=Loop.Core.Configuration.UrlList.getDefaultProfilePicture();" /><\/span>                <\/a>                <!-- /ko-->                <!-- ko ifnot: profileUrl-->                <a style="pointer-events: none;" data-test-id="author-profile-link-empty">                    <span class="img-frame"><img data-bind="attr: { src: imageUrl, alt: fullName }" alt="" class="img-responsive"                         data-test-id="author-image"                         onerror="this.src=Loop.Core.Configuration.UrlList.getDefaultProfilePicture();" /><\/span>                <\/a>                <!-- /ko-->            <\/div>            <div class="data-container">                <div class="name">                    <!-- ko if: profileUrl-->                    <a data-bind="text: fullName, attr: { href: profileUrl }" href="" data-test-id="author-name"><\/a>                    <!-- /ko-->                    <!-- ko ifnot: profileUrl-->                    <span data-bind="text: fullName" data-test-id="author-name"><\/span>                    <!-- /ko-->                <\/div>                <div class="cb"><\/div>                <ul class="list-hrz">                    <li data-bind="text: affiliation" data-test-id="author-affiliation">Affiliation<\/li>                    <li data-bind="text: location" data-test-id="author-location">Location<\/li>                <\/ul>            <\/div>            <div class="cb"><\/div>        <\/li>    <\/ul><\/script>'}function r(){return'<script type="text/html" id="message-bar-template"><div data-bind="fadeVisible: visible, attr: { \'class\': \'alert \' + getCssClass() , \'data-test-id\': dataTestId}" role="alert"><p data-bind="html: htmlMessage, css: { \'icon\': showIcon() === true }"><\/p><!-- ko if: showCloseButton() === true--><i class="close" data-bind="click: close"><\/i><!-- /ko --><\/div><\/script>'}function u(){var n="";return n+='<script type="text/html" id="button">',n+="    <!-- ko template: { name: viewName } -->",n+="    <!-- /ko -->",n+="<\/script>",n+='<script type="text/html" id="defaultButton">',n+="    <button type=\"button\" data-bind=\"attr: { 'data-test-id': 'btn-' + buttonText, 'class': className, 'data-track': dataTrack }, css: { 'btn-saving': isWorking(), 'disabled': (isWorking() || disabled()) }, click: clickAction, enable: (!isWorking() && !disabled())\">",n+="        <span data-bind=\"html: buttonText, attr: { 'data-track': dataTrack }, css: { 'disabled-click': (isWorking() || disabled()) }\"><\/span>",n+="    <\/button>",n+="<\/script>",n+='<script type="text/html" id="cancelButton">',n+='    <button class="btn-cancel" type="button" data-test-id="cancelButton" data-dismiss="modal"',n+="            data-bind=\"click: clickAction, enable: !isWorking(), css: { 'disabled': isWorking() }, attr: { 'data-track': dataTrack }\">",n+="        <span data-bind=\"html: buttonText, attr: { 'data-track': dataTrack }, css: { 'disabled-click': (isWorking() || disabled()) }\"><\/span>",n+="    <\/button>",n+="<\/script>",n+='<script type="text/html" id="confirmButton">',n+='    <button class="btn-save" type="button" data-test-id="confirmButton"',n+="            data-bind=\"click: clickAction, css: {'btn-saving': isWorking(), 'disabled': disabled() }, enable: !isWorking() && !disabled(), attr: { 'data-track': dataTrack }\">",n+="        <span data-bind=\"html: buttonText, attr: { 'data-track': dataTrack }, css: { 'disabled-click': (isWorking() || disabled()) }\"><\/span>",n+="    <\/button>",n+"<\/script>"}function f(){return'<script type="text/html" id="loopMD">    <div class="modal fade" data-bind="attr:{id: id}" role="dialog" aria-hidden="true">        <div class="modal-dialog" data-test-id="actual-dialog">            <div class="modal-content">                <div class="modal-header">                    <button type="button" class="close" data-dismiss="modal"                            data-bind="visible: !hideCloseButton() || error(), click: close">                        <span aria-hidden="true">&times;<\/span><span class="sr-only" data-test-id="closeModalDialogButton"><\/span>                    <\/button>                    <h4 class="modal-title" data-bind="text: title" data-test-id="modal-title"><\/h4>                <\/div>                <div class="spinner" data-bind="fadeIf: isLoading()"><\/div>                <div class="modal-body" data-bind="fadeIf: !error() && isLoaded()">                    <!-- ko template : { name: viewModelTemplate, data: viewModelData } -->                    <!-- /ko -->                <\/div>                <div class="error-module" data-bind="fadeIf: error()">                    <p data-bind="html: error"><\/p>                <\/div>                <div class="modal-footer" style="text-align: center" data-bind="visible: !isLoading()">                    <div data-bind="fadeIf: !error() && isLoaded()">                        <div data-bind="template: { name: \'button\', foreach: buttons }"><\/div>                        <div class="cb"><\/div>                    <\/div>                    <div data-bind="fadeIf: actionButtonError() !== \'\' && actionButtonError() !== null" class="form-validator-warning">                       <span id="exp-ui-msg" data-bind="text: actionButtonError"><\/span>                    <\/div>                <\/div>            <\/div>        <\/div>    <\/div><\/script><script type="text/html" id="loopLoginOrRegisterMD">    <div class="modal fade" data-bind="attr:{id: id}" aria-hidden="true">        <div class="modal-dialog">            <div class="modal-content">                <div class="modal-header">                    <button type="button" class="close" data-dismiss="modal"                            data-bind="visible: !hideCloseButton() || error, click: close">                        <span aria-hidden="true">&times;<\/span><span class="sr-only" data-test-id="closeModalDialogButton"><\/span>                    <\/button>                    <h1 class="modal-title" data-bind="html: title" data-test-id="modal-title"><\/h1>                <\/div>                <div class="modal-body">                    <!-- ko template : { name: viewModelTemplate, data: viewModelData } -->                    <!-- /ko -->                    <div class="divider"><\/div>                <\/div>                <div class="modal-footer">                    <div class="button-container" data-bind="template: { name: \'button\', foreach: buttons }"><\/div>                    <div class="cb"><\/div>                <\/div>            <\/div>        <\/div>    <\/div><\/script><script type="text/html" id="loopSimpleMD">    <div data-bind="html: htmlString"><\/div><\/script>'}function e(){$("body").append(f());$("body").append(u());$("body").append(r());$("body").append(i());$("body").append(t())}return $(document).ready(function(){e()}),{generateUUID:function(){return n()+n()+"-"+n()+"-"+n()+"-"+n()+"-"+n()+n()+n()},stringFormat:function(n){var t=Array.prototype.slice.call(arguments,1);return n.replace(/{(\d+)}/g,function(n,i){return"undefined"!=typeof t[i]?t[i]:n})},scrollToElement:function(n,t){var i,r=null,u=!1;r="string"==typeof n?$("#"+n):n;void 0!==t?i="string"==typeof t?$("#"+t):t:(i=$("body"),u=!0);r&&r.offset()&&!i.is(":animated")&&($(window).bind("mousewheel",function(){i.stop()}),r.velocity("scroll",{duration:700,easing:"ease-in-out",container:u?void 0:i,complete:function(){$(window).unbind("mousewheel")}}))}}}();Loop.Core.Browser=function(){function s(){var r,t,u,i=navigator.userAgent;if(o)n.name="MSIE",n.version=11;else{if(t=i.match(/(opera|chrome|safari|firefox|msie|trident(?=\/))\/?\s*(\d+)/i)||[],/trident/i.test(t[1]))return r=/\brv[ :]+(\d+)/g.exec(i)||[],"IE "+(r[1]||"");if("Chrome"===t[1]&&(r=i.match(/\bOPR\/(\d+)/),null!==r))return"Opera "+r[1];t=t[2]?[t[1],t[2]]:[navigator.appName,navigator.appVersion,"-?"];null!==(r=i.match(/version\/(\d+)/i))&&t.splice(1,1,r[1]);n.name=t[0];n.version=parseInt(t[1],10)}u=navigator.userAgent.match(/Mobile/);n.isMobile=u?u.length>0:!1;n.isMobile===!0?(i=i.toLowerCase(),n.isIpad=i.indexOf("ipad")>-1,n.isIphone=i.indexOf("iphone")>-1):(n.isIpad=!1,n.isIphone=!1)}function i(i,r,u){for(var e=null,f=0;f<t.length;f++)if(t[f].name===i){e=t[f];break}if(null!==e)throw new Error(Loop.Core.Utils.stringFormat("The browser '{0}' with version {1} is already added.",e.name,e.version));"function"!=typeof u&&(u=function(){return"number"==typeof n.version?n.version>=this.minVersion:!1});t.push({name:i,minVersion:r,isSupportedVersion:u,toString:function(){return this.name+" "+this.minVersion}})}var t=[],n={name:null,version:null,isMobile:null,isIpad:null,isIphone:null,toString:function(){return this.name+" "+this.version}},h=!!window.opera||navigator.userAgent.indexOf(" OPR/")>=0,r="undefined"!=typeof InstallTrigger,u=Object.prototype.toString.call(window.HTMLElement).indexOf("Constructor")>0,f=!!window.chrome&&!h,e=!1||!!document.documentMode,o=!!navigator.userAgent.match(/Trident.*rv[ :]*11\./);return i("Chrome",40,function(){return f?"number"==typeof n.version?n.version>=this.minVersion:!1:!1}),i("Firefox",35,function(){return r?"number"==typeof n.version?n.version>=this.minVersion:!1:!1}),i("IE",11,function(){return e?"number"==typeof n.version?n.version>=this.minVersion:!1:!1}),i("Safari",8,function(){return u?"number"==typeof n.version?n.version>=this.minVersion:!1:!1}),s(),{addSupportedBrowser:i,getCurrentNavigator:function(){return n},getDefaultSupportedBrowsers:function(){return t},isSupportedBrowser:function(){return(r||u||f||e||o)&&!n.isMobile},isSupportedBrowserVersion:function(){var n=!1;return $.each(t,function(t,i){if(i.isSupportedVersion())return(n=!0,void 0)}),n}}}();Loop.Core.Tracking=function(){function o(){if(null===t)throw new Error("Endpoint cannot be null.");if("number"!=typeof t.type)throw new Error("Missing 'type' property in endpoint object.");if("function"!=typeof t.url)throw new Error("Missing 'url' function in endpoint object.");}function f(t){if(!i)throw new Error("Loop.Core.Tracking.eventType must be defined.");("undefined"==typeof n.userId||null===n.userId)&&(n.userId=Loop.Core.Configuration.currentUserId);("undefined"==typeof n.loggedUserId||null===n.loggedUserId)&&(n.loggedUserId=Loop.Core.Configuration.loggedUserId);var u=$(t).attr("data-track-referral"),f={eventType:i,action:$(t).attr("data-track"),actionReferral:u?u:""},r=jQuery.extend(!0,{},n,f);return r.userId<0&&(r.userId=0),r.loggedUserId<0&&(r.loggedUserId=0),r}function r(n){var e,s,r,i=n.target,h=!0;u&&(r="Click -> OnTrackEvent(). Node: ",r+=i.nodeName,i.id&&(r+=" Id: "+i.id),console.log(r));$(i).data("track")&&(u&&console.log("The element has a data-track attribute."),"function"==typeof Loop.Core.Tracking.canTrackThisElement&&(h=Loop.Core.Tracking.canTrackThisElement(i)),h?(o(),e=f(i),"function"==typeof Loop.Core.Tracking.setTrackInfo&&(s=Loop.Core.Tracking.setTrackInfo(i),$.extend(e,s)),Loop.Core.Ajax.createData({endpoint:t,inputData:JSON.stringify(e),successCallback:function(){},errorCallback:function(){},preventModalOnError:!0,loginRequired:!1})):u&&console.log("canTrackElement is false."))}function s(){window.addEventListener?window.addEventListener("click",r,!0):window.attachEvent("click",r)}function h(){window.removeEventListener?window.removeEventListener("click",r,!0):window.detachEvent("click",r)}var e=!1,t=null,i=null,n={eventType:i,action:"",actionReferral:"",page:window.location.pathname,host:window.location.hostname,userId:Loop.Core.Configuration.currentUserId,loggedUserId:Loop.Core.Configuration.loggedUserId},u=!1;return{eventType:function(n){return"string"==typeof n&&(i=n),i},enabled:function(n,t){return"boolean"==typeof n&&(n?s():h(),e=n),Loop.Core.Tracking.eventType(t),e},endpoint:function(n){return n&&(t=n),t},defaultTrackItem:n,setTrackInfo:null,canTrackThisAction:!0,getFakeTrackItem:function(n){var t,i=f(n);return"function"==typeof Loop.Core.Tracking.setTrackInfo&&(t=Loop.Core.Tracking.setTrackInfo(n),$.extend(i,t)),i},setVerbose:function(n){u=n}}}();Loop.Core=Loop.Core||{},function(){var n=function(){var n,t,f,i="trapScroll-enabled",e=".trapScroll",r=".trapScroll-container",o=null,u=null;o=function(r){if($("body").hasClass(i))if($(r.target).closest(n).length>0){var u=n.scrollTop(),o=r.originalEvent,e=o.deltaY;if(e>0&&u>=f||0>e&&0>=u)return!1}else if($(r.target).closest(t).length>0)return!1};u=function(){if(n=t.find(e+":first"),n&&n[0]){var r=n.outerHeight(),u=n[0].scrollHeight;f=u-r;$("body").addClass(i)}};$(document).on("wheel",o);Loop.Core.trapScroll=function(n,f){n&&(f||(f=n),f.addClass(r.substr(1)),n.addClass(e.substr(1)),f.on("mouseleave",function(){$("body").removeClass(i);t=$(this);t.parents(r).length>0&&(t=t.parents(r+":first"),u())}).on("mouseenter",function(n){t=$(this);u();n.stopPropagation()}))}};n()}();Loop.Core.Literals={errors:{defaultRead:{title:"",message:"Sorry, something went wrong and this content could not be loaded. Please refresh the page and try again."},defaultEdit:{title:"",message:"Sorry, something went wrong and your changes could not be saved. Please try again."},unauthorized:{title:"Authentication required",message:"Your session has expired. Please login to continue."},forbidden:{title:"Authorization required",message:"You are not allowed to perform this action. Please refresh the page and try again."},resourceNotFoundRead:{title:"Resource not found",message:"This resource is temporarily unavailable. Please refresh the page and try again."},resourceNotFoundEdit:{title:"Resource not found",message:"The resource you’re editing is temporarily unavailable. Please refresh the page and try again."},itemNotFoundEdit:{title:"Resource not found",message:"The resource you’re editing is temporarily unavailable."},genericLoadingErrorInModal:{title:"",message:"Sorry, something went wrong and this content could not be loaded. Please refresh the page and try again."}},modals:{loginOrRegister:{title:"Stay in the <span>Loop<\/span><br>&amp; up-to-date",message:"<h4>Loop maximizes the impact of researchers and their discoveries. Join the world's leading researchers and academics and become discoverable.<\/h4>"},unauthorized:{title:"Authentication required",message:"Your session has expired. Please login to continue."},forbidden:{title:"Forbidden",message:'Please set your profile to public in the <a href="/settings/privacy">settings<\/a> page so you will be able to perform this action.'},resourceNotFound:{title:"Resource not found",message:"The resource you’re editing is temporarily unavailable. Please refresh the page and try again."},itemNotFound:{title:"Resource not found",message:"The resource you’re editing is temporarily unavailable."}}};Loop.Core.Constants=Loop.Core.Constants||{};Loop.Core.Constants.EndpointType={PRIVATE:0,PUBLIC:1,SOCIAL:2};Loop.Core.Constants.ModalType={DEFAULT:0,LOGIN_OR_REGISTER:1};Loop.Core.Constants.ButtonTypes={DEFAULT:"default",CONFIRM:"confirm",CANCEL:"cancel",BLOCK:"block",UNBLOCK:"unblock"};Loop.Core.Constants.FloatPosition={NONE:"none",LEFT:"left",RIGHT:"right"};Loop.Core.Constants.MessageBarTypes={ERROR:0,SUCCESS:1,INFO:2,WARNING:3,PRIVATE:4};Loop.Core.Constants.Breakpoints={EXTRA_SMALL:"xs",SMALL:"sm",MEDIUM:"md",LARGE:"lg"};Loop.Core.Constants.PaginationMode={NONE:0,SCROLL_DOCUMENT:1,SCROLL_ELEMENT:2,SHOW_MORE:3,POOL:4,NUMBER:5};Loop.Core.Enum=Loop.Core.Enum||{};Loop.Core.Enum.APIActions=function(){return{Read:0,Create:1,Update:2,Delete:3,GetName:function(n){var t;switch(n){case Loop.Core.Enum.APIActions.Read:t="READ";break;case Loop.Core.Enum.APIActions.Create:t="CREATE";break;case Loop.Core.Enum.APIActions.Update:t="UPDATE";break;case Loop.Core.Enum.APIActions.Delete:t="DELETE"}return t}}}();Loop.Core.Constants.Events={},function(n,t){var i=n({});t.subscribe=function(t,r,u){return n.isArray(t)||(t=[t]),n.each(t,function(n,t){u?setTimeout(function(){i.on(t,function(){setTimeout(r,u)})}):i.on(t,r)}),!0};t.unsubscribe=function(n,t){return i.off(n,t),void 0};t.publish=function(n,t){i.trigger(n,t)}}(jQuery,window.Loop.Core=window.Loop.Core||{});Loop.Core.Controls=Loop.Core.Controls||{};Loop.Core.Controls.Pager=function(n){function o(){var i=jQuery.extend(!0,{},e,n);t.paginationMode=i.paginationMode;t.pageSize(i.pageSize);t.currentPage(i.currentPage);t.total(i.totalElements);t.customArgs=i.customArgs;t.onPagination=i.onPagination}function r(n){"function"==typeof t.onPagination?(f("paging"),t.pagingFinish=$.Deferred(),t.pagingFinish.promise(),t.onPagination(t),$.when(t.pagingFinish).then(function(){f("none");u=!0;t.paginationMode===Loop.Core.Constants.PaginationMode.NUMBER?s(t.total(),t.pageSize()):n===!0?t.currentPage(t.currentPage()+1):n===!1&&t.currentPage(t.currentPage()-1)},function(){f("none");u=!0})):console.warn("next function needs a handler for options.onPagination event. Pass it into the constractor.")}function s(n,i){var u,f=parseInt(n/i);for(0!=n%i&&(f+=1),t.totalPages(f),t.pages([]),u=0;f>u;u++)t.pages.push({index:u,isCurrent:u==t.currentPage(),goTo:function(){t.currentPage(this.index);r()}})}var t=this,i=!1,u=!1,f=ko.observable("none"),e={pageSize:100,currentPage:0,totalElements:0,paginationMode:Loop.Core.Constants.PaginationMode.NONE,customArgs:null,onPagination:null};t.pagingFinish=$.Deferred();t.pagingFinish.promise();t.paginationMode=null;t.disabled=!1;t.pageSize=ko.observable(e.pageSize);t.currentPage=ko.observable(0);t.pages=ko.observableArray([]);t.totalPages=ko.observable(0);t.total=ko.observable(0);t.customArgs=null;t.onPagination=null;t.getOffset=function(){return t.pageSize()*t.currentPage()};t.next=function(){if(i&&!u)throw new Error("pagingFinish deferred was not resolved nor rejected.");t.isEndOfPagination()!==!1&&i!==!1||t.isPaging()!==!1||(t.paginationMode===Loop.Core.Constants.PaginationMode.NUMBER&&t.currentPage(t.currentPage()+1),r(!0),i=!0)};t.previous=function(){if(i&&!u)throw new Error("pagingFinish deferred was not resolved nor rejected.");t.currentPage()>0&&t.isPaging()===!1&&(t.paginationMode===Loop.Core.Constants.PaginationMode.NUMBER&&t.currentPage(t.currentPage()-1),r(!1),i=!0)};t.loadPage=function(n){t.currentPage(n);r()};t.isPaging=ko.computed(function(){return"paging"===f()});t.isEndOfPagination=ko.computed(function(){if(t.paginationMode===Loop.Core.Constants.PaginationMode.NUMBER)return t.pages().length-1<=t.currentPage();var n=t.currentPage()*t.pageSize();return n>=t.total()});t.allowPagination=ko.computed(function(){return!t.isPaging()&&!t.isEndOfPagination()&&!t.disabled});o()};Loop.Core.Controls=Loop.Core.Controls||{};Loop.Core.Controls.Button=function(n){function u(){switch(r){case Loop.Core.Constants.ButtonTypes.CONFIRM:i="confirmButton";t=t||"btn-save";break;case Loop.Core.Constants.ButtonTypes.CANCEL:i="cancelButton";t=t||"btn-cancel";break;case Loop.Core.Constants.ButtonTypes.BLOCK:i="defaultButton";t=t||"btn-block";break;case Loop.Core.Constants.ButtonTypes.UNBLOCK:i="defaultButton";t=t||"btn-confirm";break;case Loop.Core.Constants.ButtonTypes.DEFAULT:i="defaultButton";t=t||"btn"}switch(o){case Loop.Core.Constants.FloatPosition.LEFT:t+=" pull-left";break;case Loop.Core.Constants.FloatPosition.RIGHT:t+=" pull-right"}}var r=n.buttonType||Loop.Core.Constants.ButtonTypes.DEFAULT,f=n.buttonText,i="",e=n.clickAction,o=n.floatPosition,s=n.isDefault||!1,h=n.isWorking||ko.observable(!1),t=n.buttonClass,c=n.dataTrack||null,l=n.isDisabled||ko.observable(!1),a=n.trackingData;return u(),{viewName:i,buttonType:r,buttonText:f,clickAction:e,isDefault:s,isWorking:h,disabled:l,className:t,dataTrack:c,trackingData:a}};Loop.Core.Controls=Loop.Core.Controls||{};Loop.Core.Controls.ModalDialog=function(n,t,i,r,u,f,e,o){function l(){return s.modalType===Loop.Core.Constants.ModalType.LOGIN_OR_REGISTER?"loopLoginOrRegisterMD":(s.modalType=Loop.Core.Constants.ModalType.DEFAULT,"loopMD")}function a(){return $.extend({backdrop:"static",keyboard:!1,show:!1},o||{})}function v(){var n=$($("#"+c).html().trim()).modal(a());return n.on("hide.bs.modal",function(){s.currentlyModalOnScreen=!1}),n.on("hidden.bs.modal",function(){f===!0&&n.remove()}),n}function y(){c=l();null===s.viewModelTemplate&&"string"==typeof s.viewModelData&&(s.viewModelData={htmlString:s.viewModelData},s.viewModelTemplate=p);s.dialog=v();ko.applyBindings(s,s.dialog[0])}f="boolean"==typeof f?f:!0;u="boolean"==typeof u?u:!1;var s=this,c=null,p="loopSimpleMD",h=ko.observable("none");s.dialogGUID=Loop.Core.Utils.generateUUID();s.dialog=null;s.currentlyModalOnScreen=!1;s.id=n;s.title=ko.observable(t);s.modalType=e;s.viewModelTemplate=null;s.viewModelData=i;s.buttons=r;s.error=ko.observable(!1);s.actionButtonError=ko.observable("");s.hideCloseButton=ko.observable(u);s.onDestroy=null;s.onClose=null;s.isLoading=ko.computed(function(){return"loading"===h()});s.isLoaded=ko.computed(function(){return"loaded"===h()});s.setDataStatus=function(n){n="boolean"==typeof n?n:!0;h(n?"loaded":"loading")};s.show=function(n){return s.setDataStatus(n),null===s.dialog&&y(),s.currentlyModalOnScreen||(s.dialog.modal("show"),s.currentlyModalOnScreen=!0,document.activeElement&&"function"==typeof document.activeElement.blur&&document.activeElement.blur()),s};s.close=function(){if(s.dialog.modal("hide"),s.currentlyModalOnScreen=!1,s.buttons&&s.buttons.length>0){var n=s.buttons.filter(function(n){return n.isDefault});n.length>0?n[0].clickAction():n.length>1&&(n[0].clickAction(),console.warn("The current dialog (id='"+s.id+"') has more than one default buttons. The first button action has been triggered."))}return"function"==typeof s.onClose&&s.onClose(s),s};s.toggle=function(){return s.dialog.modal("toggle"),s};s.destroy=function(){if(s)return(s.currentlyModalOnScreen&&s.dialog.modal("hide"),"function"==typeof s.onDestroy&&s.onDestroy(s),s.currentlyModalOnScreen=!1,s=null)}};Loop.Core.Modals=function(){function t(n){return"<p>"+n+"<\/p>"}function e(){for(;n.length;){var t=n.pop();t.destroy()}}function f(t){for(var i=0;i<n.length;i++)if(n[i]===t){n.splice(i,1);break}}function u(){var t=$.grep(n,function(n){return n.currentlyModalOnScreen===!0});if(t.length>0)return t[0]}function r(){return u()}function i(t,i,u,e,o){var s,h,c;return s=new Loop.Core.Controls.ModalDialog(t,i,u),c=function(){"function"==typeof e&&e();s.destroy()},h=new Loop.Core.Controls.Button({buttonType:Loop.Core.Constants.ButtonTypes.CONFIRM,buttonText:"OK",floatPosition:Loop.Core.Constants.FloatPosition.RIGHT,clickAction:c,isDefault:!0}),s.hideCloseButton(o),s.buttons=[h],s.onDestroy=f,r()||s.show(),n.push(s),s}function o(i){var u,s,h,e=[],o=[];if(!i)throw new Error("Method expects parameters.");if(i.id||e.push("id"),i.title||e.push("title"),i.message||e.push("message"),i.confirmAction||e.push("confirmAction"),i.cancelAction||e.push("cancelAction"),e.length>0)throw new Error("Missing required fields: "+e.join(","));if("string"!=typeof i.id&&o.push("id"),"string"!=typeof i.title&&o.push("title"),"string"!=typeof i.message&&o.push("message"),"function"!=typeof i.confirmAction&&o.push("confirmAction"),"function"!=typeof i.cancelAction&&o.push("cancelAction"),o.length>0)throw new Error("Wrong field types: "+o.join(","));return u=new Loop.Core.Controls.ModalDialog(i.id,i.title,t(i.message)),s=new Loop.Core.Controls.Button({buttonType:Loop.Core.Constants.ButtonTypes.CONFIRM,buttonText:i.confirmButtonText||"Confirm",floatPosition:Loop.Core.Constants.FloatPosition.RIGHT,clickAction:i.confirmAction,isWorking:i.isWorking,dataTrack:i.confirmDataTrack,trackingData:i.confirmTrackingData}),h=new Loop.Core.Controls.Button({buttonType:Loop.Core.Constants.ButtonTypes.CANCEL,buttonText:i.cancelButtonText||"Cancel",floatPosition:Loop.Core.Constants.FloatPosition.LEFT,clickAction:i.cancelAction,isDefault:!0,isWorking:i.isWorking,dataTrack:i.cancelDataTrack,trackingData:i.cancelTrackingData}),u.buttons=[s,h],u.onDestroy=f,void 0!==u.hideCloseButton&&u.hideCloseButton(!1),r()||u.show(),n.push(u),u}function s(n){var r=Loop.Core.Literals.modals.unauthorized.title,u=t(Loop.Core.Literals.modals.unauthorized.message);return i("unauthorizedModal",r,u,n,!0)}function h(i,u){var f,e,o;return f=new Loop.Core.Controls.ModalDialog("socialForbiddenAction",i,t(u)),o=function(){var n=window.location.protocol+"//"+window.location.host,t=n+"/settings/privacy";location.replace(t)},e=new Loop.Core.Controls.Button({buttonType:Loop.Core.Constants.ButtonTypes.DEFAULT,buttonText:"Change privacy settings",floatPosition:Loop.Core.Constants.FloatPosition.RIGHT,clickAction:o,buttonClass:"btn-flex"}),f.hideCloseButton(!1),f.buttons=[e],r()||f.show(),n.push(f),f}function c(){var n=Loop.Core.Literals.modals.forbidden.title,r=t(Loop.Core.Literals.modals.forbidden.message);return i("forbiddenModal",n,r,!0)}function l(n){var r=Loop.Core.Literals.modals.resourceNotFound.title,u=t(Loop.Core.Literals.modals.resourceNotFound.message);return i("errorModalResNotFound",r,u,n,!0)}function a(n){var r=Loop.Core.Literals.modals.itemNotFound.title,u=t(Loop.Core.Literals.modals.itemNotFound.message);return i("errorModalItemNotFound",r,u,n,!0)}function v(t,i,f,e){var o,s,h,c,l="modal-login-register",a=Loop.Core.Literals.modals.loginOrRegister.title,v=void 0===f?Loop.Core.Literals.modals.loginOrRegister.message:"<h4>"+f+"<\/h4>";return o=new Loop.Core.Controls.ModalDialog(l,a,v),o.modalType=Loop.Core.Constants.ModalType.LOGIN_OR_REGISTER,e=e?e:"",c=e?"actionReferral="+e+"&":"","function"!=typeof t&&(t=function(){var n=Loop.Core.Configuration.loginPage+"?"+c+"returnUrl="+encodeURI(window.location);location.replace(n)}),"function"!=typeof i&&(i=function(){var n=Loop.Core.Configuration.registerPage+"?"+c+"returnUrl="+encodeURI(window.location);location.replace(n)}),s=new Loop.Core.Controls.Button({buttonType:Loop.Core.Constants.ButtonTypes.DEFAULT,buttonText:"LOGIN",floatPosition:Loop.Core.Constants.FloatPosition.LEFT,clickAction:t,dataTrack:"login",trackingData:function(){return{brick:l,actionReferral:e}}}),h=new Loop.Core.Controls.Button({buttonType:Loop.Core.Constants.ButtonTypes.DEFAULT,buttonText:"REGISTER",floatPosition:Loop.Core.Constants.FloatPosition.RIGHT,clickAction:i,dataTrack:"register",trackingData:function(){return{brick:l,actionReferral:e}}}),s.className="btn-login",h.className="btn-register",o.buttons=[s,h],r()&&u().destroy(),o.show(),n.push(o),o}function y(n,u,f,e,o){f="string"==typeof f?t(f):f;var s=i(n,u,f,e,o);return r()||s.show(),s}function p(n,r,f,o){var s=u(),h="loopBlockingErrorModal",c=null;if(!s||s.id!==h)return(o="boolean"==typeof o?o:!0,e(),c=i(h,n,t(r),f,o),c.show())}function w(t,i,r,u,f,e,o,s){var h=new Loop.Core.Controls.ModalDialog(t,i,r,u,f,e,o,s);return n.push(h),h}var n=[];return{getCurrentModalOnScreen:u,getModal:w,showModal:y,showConfirmCancelModal:o,showForbiddenModal:c,showUnauthorizedModal:s,showResourceNotFound:l,showItemNotFound:a,showLoginRegisterModal:v,showSocialForbiddenModal:h,showBlockingErrorModal:p}}();Loop.Core.Controls=Loop.Core.Controls||{};Loop.Core.Controls.MessageBar=function(n){function u(){var u=jQuery.extend(!0,{},f,n),e=$("#"+r);if(0===e.length)throw new Error("Template script '"+r+"' not found.");i=$(e.html().trim());t.type(u.type);t.htmlMessage=ko.observable(u.htmlMessage);t.visible=ko.observable(u.visible);t.showCloseButton=ko.observable(u.showCloseButton);t.showIcon=ko.observable(u.showIcon);t.parent=u.parent;t.dataTestId=u.dataTestId;t.onClose=u.onClose;ko.applyBindings(t,i[0]);t.parent.prepend(i)}var f={type:Loop.Core.Constants.MessageBarTypes.INFO,htmlMessage:"",showCloseButton:!0,visible:!1,parent:$("body"),dataTestId:"msg-bar",showIcon:!0,onClose:null},r="message-bar-template",i=null,t=this;t.type=ko.observable();t.htmlMessage=null;t.visible=null;t.showCloseButton=null;t.parent=null;t.dataTestId=null;t.showIcon=null;t.show=function(){t.visible(!0)};t.close=function(){t.visible(!1);"function"==typeof t.onClose&&t.onClose(t)};t.getCssClass=ko.computed(function(){switch(t.type()){case Loop.Core.Constants.MessageBarTypes.ERROR:return"alert-error";case Loop.Core.Constants.MessageBarTypes.SUCCESS:return"alert-success";case Loop.Core.Constants.MessageBarTypes.INFO:return"alert-info";case Loop.Core.Constants.MessageBarTypes.WARNING:return"alert-warning";case Loop.Core.Constants.MessageBarTypes.PRIVATE:return"alert-private";default:return"alert-info"}});t.onClose=null;u()};Loop.Core.ErrorHandler=function(){function t(n,t,i,r){var u="EPT"+n+"_";return u+=t?t:"DEFAULT",i&&(u+="_"+i),u+(r?"_"+Loop.Core.Enum.APIActions.GetName(r):"_ALL")}function r(i){if(!i)throw new Error("Error trying to add a new error handler. Parameter 'handler' is null.");var r=n[t(i.endpointType,i.errorCode,i.subErrorCode,i.apiAction)];if(r)throw new Error("New error handler for endpoint type '"+i.endpointType+"', error code  '"+i.errorCode+"', error subcode '"+i.subErrorCode+"' and API action '"+i.apiAction+"' already exists.");if("string"!=typeof i.errorMessage&&"function"!=typeof i.action)throw new Error("New error handler doesn't contain error message and action.");}function u(t){r(t);var i=jQuery.extend(!0,{},e,t);n[i.getEntryCode()]=i}function i(i,r,u,f){var e=n[t(i,r,u,f)];return e||(e=n[t(i,r,u,null)]),e||(e=n[t(i,r,null,null)]),e||(e=n[t(i,null,null,f)]),e||(e=n[t(i,null,null,null)]),e}function f(n,t,r,u){var f=i(n,t,r,u);return f||(f=i(Loop.Core.Constants.EndpointType.PRIVATE,t,r,u)),f}var n={},e={endpointType:Loop.Core.Constants.EndpointType.PRIVATE,errorCode:null,subErrorCode:null,apiAction:null,errorTitle:null,errorMessage:null,action:null,getEntryCode:function(){return t(this.endpointType,this.errorCode,this.subErrorCode,this.apiAction)}};return{addErrorHandler:u,getErrorHandler:f,getAllErrorHandlers:function(){return n}}}();Loop.Core.ErrorHandler.addErrorHandler({errorTitle:Loop.Core.Literals.errors.defaultRead.title,errorMessage:Loop.Core.Literals.errors.defaultRead.message,apiAction:Loop.Core.Enum.APIActions.Read});Loop.Core.ErrorHandler.addErrorHandler({errorTitle:Loop.Core.Literals.errors.defaultEdit.title,errorMessage:Loop.Core.Literals.errors.defaultEdit.message,apiAction:Loop.Core.Enum.APIActions.Create});Loop.Core.ErrorHandler.addErrorHandler({errorTitle:Loop.Core.Literals.errors.defaultEdit.title,errorMessage:Loop.Core.Literals.errors.defaultEdit.message,apiAction:Loop.Core.Enum.APIActions.Update});Loop.Core.ErrorHandler.addErrorHandler({errorTitle:Loop.Core.Literals.errors.defaultEdit.title,errorMessage:Loop.Core.Literals.errors.defaultEdit.message,apiAction:Loop.Core.Enum.APIActions.Delete});Loop.Core.ErrorHandler.addErrorHandler({errorCode:401,errorTitle:Loop.Core.Literals.errors.unauthorized.title,errorMessage:Loop.Core.Literals.errors.unauthorized.message,action:function(){Loop.Core.Modals.showBlockingErrorModal(this.errorTitle,this.errorMessage,function(){var n=Loop.Core.Configuration.loginPage;n=n+"?ReturnUrl="+document.location.href;location.replace(n)})}});Loop.Core.ErrorHandler.addErrorHandler({errorCode:403,errorTitle:Loop.Core.Literals.errors.forbidden.title,errorMessage:Loop.Core.Literals.errors.forbidden.message,action:function(){Loop.Core.Modals.showBlockingErrorModal(this.errorTitle,this.errorMessage,function(){location.reload()})}});Loop.Core.ErrorHandler.addErrorHandler({errorCode:404,errorTitle:Loop.Core.Literals.errors.resourceNotFoundRead.title,errorMessage:Loop.Core.Literals.errors.resourceNotFoundRead.message,apiAction:Loop.Core.Enum.APIActions.Read,action:function(){Loop.Core.Modals.showBlockingErrorModal(this.errorTitle,this.errorMessage,function(){location.reload()})}});Loop.Core.ErrorHandler.addErrorHandler({errorCode:404,errorTitle:Loop.Core.Literals.errors.resourceNotFoundEdit.title,errorMessage:Loop.Core.Literals.errors.resourceNotFoundEdit.message,apiAction:Loop.Core.Enum.APIActions.Create,action:function(){Loop.Core.Modals.showBlockingErrorModal(this.errorTitle,this.errorMessage,function(){location.reload()})}});Loop.Core.ErrorHandler.addErrorHandler({errorCode:404,errorTitle:Loop.Core.Literals.errors.resourceNotFoundEdit.title,errorMessage:Loop.Core.Literals.errors.resourceNotFoundEdit.message,apiAction:Loop.Core.Enum.APIActions.Update,action:function(){Loop.Core.Modals.showBlockingErrorModal(this.errorTitle,this.errorMessage,function(){location.reload()})}});Loop.Core.ErrorHandler.addErrorHandler({errorCode:412,subErrorCode:7,errorTitle:Loop.Core.Literals.errors.itemNotFoundEdit.title,errorMessage:Loop.Core.Literals.errors.itemNotFoundEdit.message,apiAction:Loop.Core.Enum.APIActions.Update});Loop.Core.EndpointRepository=function(){function t(n,t){var i=n;return t&&(i+="_"+t),i}function r(n){if(!n)throw new Error("Error trying to add a new endpoint. Parameter 'endpoint' is null.");if(!n.key)throw new Error("Error trying to add a new endpoint. Parameter 'key' is null.");var t=i(n.key);if(t)throw new Error("Endpoint with key '"+t.key+"' already exists.");if("function"!=typeof n.url)throw new Error("endpoint.url must be a function which return the URI of the endpoint.");}function u(t){r(t);var i=jQuery.extend(!0,{},o,t);n[i.key]=i}function i(t,i){var u=n[t],r=null;return u?(r=jQuery.extend(!0,{},u),r.urlArgs=i,r):null}function f(t,i){var r=jQuery.extend(!0,{},s,i),u=n[t];u&&(u.customErrorMessages[r.getCustomMessageCode()]=r)}function e(t,i,r){var u=n[t];return u?u.getCustomMessage(i,r):null}var n={},o={key:null,url:null,urlArgs:null,params:null,type:Loop.Core.Constants.EndpointType.PRIVATE,customErrorMessages:{},getCustomMessage:function(n,i){if(this.customErrorMessages){var r=this.customErrorMessages[t(n,i)];return r?r:this.customErrorMessages[t(n,null)]}return null}},s={errorCode:null,subErrorCode:null,errorTitle:null,errorMessage:null,getCustomMessageCode:function(){return t(this.errorCode,this.subErrorCode)}};return{addEndpoint:u,getEndpoint:i,addCustomMessage:f,getCustomMessage:e,getAllEndpoints:function(){return n}}}();Loop.Core.Ajax=function(){function i(n,t,i,r,u){var e=u?u.ErrorCode:null,f=Loop.Core.ErrorHandler.getErrorHandler(n.type,t,e,i);return"function"==typeof f.action&&r!==!0&&f.action(n,t,e,i),f.errorMessage}function u(n,t,i){if(t){var u=Loop.Core.ErrorHandler.getErrorHandler(n.type,401,null,i),r=u.errorMessage;i===Loop.Core.Enum.APIActions.Delete?setTimeout(function(){t(401,r)},500):t(401,r)}}function f(n){return n?Loop.Core.Configuration.isUserLogged():!0}function r(n,t,r){if(f(n.loginRequired)){var o,s=!0;return $("html").hasClass("ie9")&&(s=!1),o={type:n.verb,url:n.endpoint.url(),"async":r,timeout:n.timeout,tryCount:0,retryLimit:3,crossDomain:s,dataType:"json",contentType:"application/json; charset=utf-8",cache:!e,data:n.inputData,success:function(t){"function"==typeof n.successCallback&&n.successCallback(t)},error:function(r){var f,u;this.tryCount+=1;0===r.status&&"timeout"===r.statusText?this.tryCount<=this.retryLimit-1&&"GET"===n.verb?$.ajax(this):(u=i(n.endpoint,408,t,n.preventModalOnError),"function"==typeof n.errorCallback&&n.errorCallback(408,u)):(412===r.status&&(f=JSON.parse(r.responseText)),u=i(n.endpoint,r.status,t,n.preventModalOnError,f),"function"==typeof n.errorCallback&&n.errorCallback(r.status,u,f))}},r&&(o.xhrFields={withCredentials:n.withCredentials}),$.ajax(o)}u(n.endpoint,n.errorCallback,t)}function o(n,t){var r={url:n.endpoint.url(),timeout:n.timeout,type:"POST",data:n.inputData,mimeType:"multipart/form-data",contentType:!1,cache:!1,processData:!1,success:function(t){"function"==typeof n.successCallback&&n.successCallback(t)},error:function(t){var r;0===t.status&&"timeout"===t.statusText&&n.errorCallback(408,i(n.endpoint,408,Loop.Core.Enum.APIActions.Create,n.preventModalOnError));412===t.status&&(r=JSON.parse(t.responseText));n.errorCallback(t.status,i(n.endpoint,t.status,Loop.Core.Enum.APIActions.Create,r),r)}};return t&&(r.xhrFields={withCredentials:n.withCredentials}),$.ajax(r)}function n(n,t,i){var u=[],r=[];if(n.endpoint||u.push("endpoint"),n.verb||(n.verb=t),"boolean"!=typeof n.loginRequired&&(n.loginRequired=i),n.withCredentials||(n.withCredentials=!1),u.length>0)throw new Error("Missing required fields: "+u.join(","));if("object"!=typeof n.endpoint&&r.push("endpoint"),"string"!=typeof n.verb&&r.push("verb"),"boolean"!=typeof n.loginRequired&&r.push("loginRequired"),"boolean"!=typeof n.withCredentials&&r.push("withCredentials"),r.length>0)throw new Error("Wrong field types: "+r.join(","));isNaN(n.timeout)&&(n.timeout=15e3)}$.support.cors=!0;var e=!0,t={endpoint:null,verb:null,inputData:null,loginRequired:null,preventModalOnError:!1,timeout:15e3,successCallback:null,errorCallback:null};return{forceNoCache:function(n){e=n},handleErrors:i,loadData:function(i){return i=jQuery.extend(!0,{},t,i),n(i,"GET",!1),r(i,Loop.Core.Enum.APIActions.Read,!0)},loadDataSync:function(i){i=jQuery.extend(!0,{},t,i);n(i,"GET",!1);r(i,Loop.Core.Enum.APIActions.Read,!1)},updateData:function(i){i=jQuery.extend(!0,{},t,i);n(i,"PUT",!0);r(i,Loop.Core.Enum.APIActions.Update,!0)},createData:function(i){i=jQuery.extend(!0,{},t,i);n(i,"POST",!0);r(i,Loop.Core.Enum.APIActions.Create,!0)},deleteData:function(i){return i=jQuery.extend(!0,{},t,i),n(i,"DELETE",!0),r(i,"DELETE",!0)},createMultipartData:function(i){i=jQuery.extend(!0,{},t,i);n(i,"POST",!0);f(!0)?o(i):u(i.endpoint,i.errorCallback,Loop.Core.Enum.APIActions.Update)},isBlockingError:function(n){return 404===n||403===n||401===n}}}();Loop.Core.Breakpoints=function(){function n(){return window.innerWidth<t.sm}function i(){return window.innerWidth<t.md&&!n()}function r(){return window.innerWidth<t.lg&&!i()&&!n()}function u(){return window.innerWidth>=t.lg}function f(t){return t===Loop.Core.Constants.Breakpoints.EXTRA_SMALL?n():t===Loop.Core.Constants.Breakpoints.SMALL?i():t===Loop.Core.Constants.Breakpoints.MEDIUM?r():t===Loop.Core.Constants.Breakpoints.LARGE?u():(console.error("Bad argument for isCurrentBreakpoint()"),!1)}function e(){return n()?Loop.Core.Constants.Breakpoints.EXTRA_SMALL:i()?Loop.Core.Constants.Breakpoints.SMALL:r()?Loop.Core.Constants.Breakpoints.MEDIUM:u()?Loop.Core.Constants.Breakpoints.LARGE:void 0}function o(n){$(window).smartresize(n)}var t={xs:480,sm:768,md:992,lg:1300};return{getCurrentBreakpoint:e,isCurrentBreakpoint:f,smartResize:o}}();Loop.Core.Authors=Loop.Core.Authors||{};Loop.Core.Authors.MultipleAuthors=function(n){function u(n,t){var i=n||"",r=t||"";return i.trim()+" "+r.trim()}function f(n,t){var i=n||"",r=t||"";return i&&r?i+", "+r:i?i:r}function e(){var n=$.Deferred();return Loop.Core.Ajax.loadData({endpoint:Loop.Core.EndpointRepository.getEndpoint("LoopCore-MainInfoUserList",{userIDList:r}),successCallback:function(t){$.each(t,function(n,t){var e=t.LocationCountry?t.LocationCountry.Name||"":null,r={name:u(t.FirstName,t.LastName),affiliation:"",location:"",pictureUrl:t.ProfilePictureSmall||null,profileUrl:Loop.Core.Configuration.UrlList.getLoopProfilePage(t.UserId)};i.extendDataOnDialog===!0&&(r.affiliation=t.Affiliation||"",r.location=f(t.LocationCity,e));i.authorList.push(r)});n.resolve()},errorCallback:function(t,i,r){var u={errorCode:t,errorMessage:i,preconditionFailed:r};n.reject(u)},preventModalOnError:!0}),n.promise()}function o(){r="object"==typeof n.authorList?n.authorList:[];i.extendDataOnDialog="boolean"==typeof n.extendDataOnDialog?n.extendDataOnDialog:!0}var i=this,r=[],t=null;i.authorList=ko.observableArray();i.extendDataOnDialog=!0;i.showModal=function(){if(null===t)t=new Loop.Core.Controls.ModalDialog("multi-auth-modal","More than one user with this authoring name has confirmed this publication:","",null,!1,!1),t.viewModelData=i,t.viewModelTemplate="multipleAuthorsTemplate";0===i.authorList().length?(t.show(!1),$.when(e()).then(function(){t.viewModelData=i;t.setDataStatus(!0)},function(){t.error(Loop.Core.Literals.errors.genericLoadingErrorInModal.message);t.setDataStatus(!0)})):t.show(!0)};o()};Loop.Core.Authors=Loop.Core.Authors||{};Loop.Core.Authors.AuthorList=function(n){function o(){var i={};i[Loop.Core.Constants.Breakpoints.EXTRA_SMALL]=8;i[Loop.Core.Constants.Breakpoints.SMALL]=10;i[Loop.Core.Constants.Breakpoints.MEDIUM]=15;i[Loop.Core.Constants.Breakpoints.LARGE]=15;t.authorList="object"==typeof n.authorList?n.authorList:[];t.enableLinks="boolean"==typeof n.enableLinks?n.enableLinks:!0;t.extendDataOnDialog="boolean"==typeof n.extendDataOnDialog?n.extendDataOnDialog:!0;t.itemsToShowByBreakpoint="object"==typeof n.itemsToShowByBreakpoint?n.itemsToShowByBreakpoint:i;u=t.authorList.length;h();Loop.Core.Breakpoints.smartResize(c);f()}function s(){var r=[],n=$.Deferred(),u=0;return $.each(t.authorList,function(n,t){t.UserID.length>0&&r.push(t.UserID[0]);u+=t.UserID.length}),u>0?Loop.Core.Ajax.loadData({endpoint:Loop.Core.EndpointRepository.getEndpoint("LoopCore-MainInfoUserList",{userIDList:r}),successCallback:function(r){i=t.authorList;$.each(i,function(n,i){i.affiliation="";i.location="";$.each(r,function(n,r){i.UserID&&i.UserID[0]===r.UserId&&(i.imageUrl=r.ProfilePictureSmall,i.imageUrl&&(i.showImageInList=!0),t.extendDataOnDialog===!0&&(i.affiliation=r.Affiliation,i.location=r.LocationCountry?r.LocationCity+", "+r.LocationCountry.Name:r.LocationCity))})});n.resolve()},errorCallback:function(t,i,r){var u={errorCode:t,errorMessage:i,preconditionFailed:r};n.reject(u)},preventModalOnError:!0}):(i=t.authorList,$.each(i,function(n,t){t.affiliation="";t.location=""}),n.resolve()),n.promise()}function h(){var n=null;t.itemsToShowByBreakpoint[Loop.Core.Constants.Breakpoints.LARGE];t.authorList.length>e&&(n=t.authorList[t.authorList.length-1],t.authorList=t.authorList.slice(0,e),t.authorList.push(n));t.authorList=t.authorList.filter(function(n){return"string"==typeof n.FullName&&n.FullName.trim().length>0});$.each(t.authorList,function(n,i){i.fullName=i.FullName.trim();i.profileUrl=null;i.imageUrl=Loop.Core.Configuration.UrlList.getDefaultProfilePicture();i.showImageInList=!1;i.clickAction=null;i.UserID.length>0&&(i.showImageInList=!0);1===i.UserID.length&&(i.imageUrl=Loop.Core.Configuration.UrlList.getProfilePicture(i.UserID[0]));t.enableLinks&&(1===i.UserID.length?i.profileUrl=Loop.Core.Configuration.UrlList.getLoopProfilePage(i.UserID[0]):i.UserID.length>1&&(i.multiAuthors=new Loop.Core.Authors.MultipleAuthors({authorList:i.UserID,extendDataOnDialog:t.extendDataOnDialog}),i.clickAction=function(){this.multiAuthors.showModal()}))})}function f(){var n=0,i=t.itemsToShowByBreakpoint[r],f=[],e=u>i?i-1:i;for(0===i&&(i=2),n=0;e>n&&n<t.authorList.length;n++)f.push(t.authorList[n]);t.visibleAuthorList(f);t.showMoreCounter(u-t.visibleAuthorList().length-1);t.showMoreCounter()>0?t.lastAuthor(t.authorList[t.authorList.length-1]):t.lastAuthor(null)}function c(){var n=Loop.Core.Breakpoints.getCurrentBreakpoint();r!==n&&(r=n,f())}var t=this,r=Loop.Core.Breakpoints.getCurrentBreakpoint(),e=1e4,u=0,i=null;t.authorList=[];t.visibleAuthorList=ko.observableArray([]);t.lastAuthor=ko.observable();t.showMoreCounter=ko.observable(0);t.showMoreAction=function(){function r(){return{fullInfoAuthorList:i,extendDataOnDialog:t.extendDataOnDialog}}if(t.enableLinks){var n=new Loop.Core.Modals.getModal("multi-auth-modal","Authors of this publication",!0);n.viewModelData=r();n.viewModelTemplate="authorsListDetailedTemplate";null===i?(n.show(!1),$.when(s()).then(function(){n.viewModelData=r();n.setDataStatus(!0)},function(t){n.error(t.errorMessage);n.setDataStatus(!0)})):n.show(!0)}};t.enableLinks=!0;t.extendDataOnDialog=!0;t.itemsToShowByBreakpoint={xs:8,sm:10,md:15,lg:15};o()};Loop.Core.EndpointRepository.addEndpoint({type:Loop.Core.Constants.EndpointType.PRIVATE,key:"LoopCore-MainInfoUserList",urlArgs:{userIDList:[]},url:function(){var n="";return"object"==typeof this.urlArgs.userIDList&&($.each(this.urlArgs.userIDList,function(t,i){if("number"!=typeof i)throw new Error("'"+typeof i+"' type is not valid for the querystring of 'LoopCore-MainInfoUserList' endpoint.");n+="usersIds="+i+"&"}),n.length>0&&(n=n.substr(0,n.length-1))),Loop.Core.Configuration.UrlList.getAbsoluteUrl("loopApi","/users/main-info?"+n)}});currentScript=document.currentScript;$(document).ready(function(){var n=getScriptConfiguration();Loop.Core.Configuration.init(n)}),function(n){"use strict";function t(t){var i=this._getSettings(t);return this.routes=i.routes,this.notFoundHandler=i.page404,this.mode=!n.history||!n.history.pushState?"hash":i.mode,this.root=i.root==="/"?"/":"/"+this._trimSlashes(i.root)+"/",this.beforeHook=i.hooks.before,this.securityHook=i.hooks.secure,this._pageState=null,this._currentPage=null,this._skipCheck=!1,this._action=null,this.mode==="hash"&&(this._historyStack=[],this._historyIdx=0,this._historyState="add"),this}t.Page=function(n,t,i,r,u){this.uri=n||"";this.query=t||{};this.params=i||[];this.state=r||null;this.options=u||{}};t.prototype._getSettings=function(n){var t={},i={routes:[],mode:"history",root:"/",hooks:{before:function(){},secure:function(){return!0}},page404:function(n){console.error({page:n,message:"404. Page not found"})}};return n=n||{},["routes","mode","root","page404"].forEach(function(r){t[r]=n[r]||i[r]}),t.hooks=Object.assign({},i.hooks,n.hooks||{}),t};t.prototype._getHistoryFragment=function(){var t=decodeURI(n.location.pathname);return this.root!=="/"&&(t=t.replace(this.root,"")),this._trimSlashes(t)};t.prototype._getHashFragment=function(){var t=n.location.hash.substr(1).replace(/(\?.*)$/,"");return this._trimSlashes(t)};t.prototype._getFragment=function(){return this.mode==="history"?this._getHistoryFragment():this._getHashFragment()};t.prototype._trimSlashes=function(n){return typeof n!="string"?"":n.toString().replace(/\/$/,"").replace(/^\//,"")};t.prototype._page404=function(n){this._currentPage=new t.Page(n);this.notFoundHandler(n)};t.prototype._parseRouteRule=function(n){if(typeof n!="string")return n;var t=this._trimSlashes(n),i=t.replace(/([\\\/\-\_\.])/g,"\\$1").replace(/\{[a-zA-Z]+\}/g,"(:any)").replace(/\:any/g,"[\\w\\-\\_\\.]+").replace(/\:word/g,"[a-zA-Z]+").replace(/\:num/g,"\\d+");return new RegExp("^"+i+"$","i")};t.prototype._parseQuery=function(n){var t={};return typeof n!="string"?t:(n[0]==="?"&&(n=n.substr(1)),this._queryString=n,n.split("&").forEach(function(n){var i=n.split("=");i[0]!==""&&(i[1]===undefined&&(i[1]=!0),t[decodeURIComponent(i[0])]=i[1])}),t)};t.prototype._getHistoryQuery=function(){return this._parseQuery(n.location.search)};t.prototype._getHashQuery=function(){var t=n.location.hash.indexOf("?"),i=t!==-1?n.location.hash.substr(t):"";return this._parseQuery(i)};t.prototype._getQuery=function(){return this.mode==="history"?this._getHistoryQuery():this._getHashQuery()};t.prototype.add=function(n,t,i){return this.routes.push({rule:this._parseRouteRule(n),handler:t,options:i}),this};t.prototype.remove=function(n){var t=this;return typeof n=="string"&&(n=this._parseRouteRule(n).toString()),this.routes.some(function(i,r){return i.handler===n||i.rule.toString()===n?(t.routes.splice(r,1),!0):!1}),this};t.prototype.reset=function(){return this.routes=[],this.mode=null,this.root="/",this._pageState={},this.removeUriListener(),this};t.prototype._pushHistory=function(){var n=this,t=this._getFragment();this.mode==="hash"&&(this._historyState==="add"&&(this._historyIdx!==this._historyStack.length-1&&this._historyStack.splice(this._historyIdx+1),this._historyStack.push({path:t,state:n._pageState}),this._historyIdx=this._historyStack.length-1),this._historyState="add")};t.prototype._unloadCallback=function(n){var t;return this._skipCheck?n?Promise.resolve(!0):!0:this._currentPage&&this._currentPage.options&&this._currentPage.options.unloadCb?(t=this._currentPage.options.unloadCb(this._currentPage,n),!n||t instanceof Promise)?t:t?Promise.resolve(t):Promise.reject(t):n?Promise.resolve(!0):!0};t.prototype._findRoute=function(){var i=this,r=this._getFragment();return this.routes.some(function(u){var e=r.match(u.rule),o,f;return e?(e.shift(),o=i._getQuery(),f=new t.Page(r,o,e,i._pageState,u.options),!i.securityHook(f))?!1:(i._currentPage=f,i._skipCheck)?(i._skipCheck=!1,!0):(i.beforeHook(f),u.handler.apply(f,e),i._pageState=null,n.onbeforeunload=function(n){if(!i._unloadCallback(!1))return n.returnValue=!0,!0},!0):!1})};t.prototype._treatAsync=function(){var n;n=this._currentPage.options.unloadCb(this._currentPage,!0);n instanceof Promise||(n=n?Promise.resolve(n):Promise.reject(n));n.then(this._processUri.bind(this)).catch(this._resetState.bind(this))};t.prototype._resetState=function(){this._skipCheck=!0;this.navigateTo(this._current,this._currentPage.state,!0)};t.prototype._processUri=function(){var n=this._getFragment(),t;this._current=n;this._pushHistory();t=this._findRoute.call(this);t||this._page404(n)};t.prototype.check=function(){return this._skipCheck?this:(this._currentPage&&this._currentPage.options&&this._currentPage.options.unloadCb?this._treatAsync():this._processUri(),this)};t.prototype.addUriListener=function(){return this.mode==="history"?n.onpopstate=this.check.bind(this):n.onhashchange=this.check.bind(this),this};t.prototype.removeUriListener=function(){return n.onpopstate=null,n.onhashchange=null,this};t.prototype.redirectTo=function(t,i,r){return(t=this._trimSlashes(t)||"",this._pageState=i||null,this._skipCheck=!!r,this.mode==="history")?(history.replaceState(i,null,this.root+this._trimSlashes(t)),this.check()):(this._historyIdx--,n.location.hash=t,this)};t.prototype.navigateTo=function(t,i,r){return(t=this._trimSlashes(t)||"",this._pageState=i||null,this._skipCheck=!!r,this.mode==="history")?(history.pushState(i,null,this.root+this._trimSlashes(t)),this.check()):(n.location.hash=t,this)};t.prototype.refresh=function(){if(!this._currentPage)return this;var n=this._currentPage.uri+"?"+this._queryString;return this.navigateTo(n,this._currentPage.state)};t.prototype.back=function(){return this.mode==="history"?(n.history.back(),this):this.go(this._historyIdx-1)};t.prototype.forward=function(){return this.mode==="history"?(n.history.forward(),this):this.go(this._historyIdx+1)};t.prototype.go=function(t){if(this.mode==="history")return n.history.go(t),this;var i=this._historyStack[t];return i?(this._historyIdx=t,this._historyState="hold",this.navigateTo(i.path,i.state)):this};n.Router=t}(window);!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.validation={})}(function(n,t){function c(n){var t="max"===n;return function(r,u){var o,h,s,f,e;if(i.utils.isEmptyVal(r))return!0;void 0===u.typeAttr?(h="text",o=u):(h=u.typeAttr,o=u.value);isNaN(o)||o instanceof Date||(h="number");switch(h.toLowerCase()){case"week":if(s=/^(\d{4})-W(\d{2})$/,f=r.match(s),null===f)throw new Error("Invalid value for "+n+" attribute for week input.  Should look like '2000-W33' http://www.w3.org/TR/html-markup/input.week.html#input.week.attrs.min");return e=o.match(s),e?t?f[1]<e[1]||f[1]===e[1]&&f[2]<=e[2]:f[1]>e[1]||f[1]===e[1]&&f[2]>=e[2]:!1;case"month":if(s=/^(\d{4})-(\d{2})$/,f=r.match(s),null===f)throw new Error("Invalid value for "+n+" attribute for month input.  Should look like '2000-03' http://www.w3.org/TR/html-markup/input.month.html#input.month.attrs.min");return e=o.match(s),e?t?f[1]<e[1]||f[1]===e[1]&&f[2]<=e[2]:f[1]>e[1]||f[1]===e[1]&&f[2]>=e[2]:!1;case"number":case"range":return t?!isNaN(r)&&parseFloat(r)<=parseFloat(o):!isNaN(r)&&parseFloat(r)>=parseFloat(o);default:return t?o>=r:r>=o}}}function y(n,t,r){return t.validator(n(),void 0===r.params?!0:f(r.params))?!0:(n.setError(i.formatMessage(r.message||t.message,f(r.params),n)),!1)}function p(n,t,r){n.isValidating(!0);var u=function(u){var e=!1,o="";return n.__valid__()?(u.message?(e=u.isValid,o=u.message):e=u,e||(n.error(i.formatMessage(o||r.message||t.message,f(r.params),n)),n.__valid__(e)),void n.isValidating(!1)):void n.isValidating(!1)};i.utils.async(function(){t.validator(n(),void 0===r.params?!0:f(r.params),u)})}var a,h,s,v;if("undefined"==typeof n)throw new Error("Knockout is required, please ensure it is loaded before loading this validation plug-in");n.validation=t;var i=n.validation,u=n.utils,f=u.unwrapObservable,e=u.arrayForEach,r=u.extend,l={registerExtenders:!0,messagesOnModified:!0,errorsAsTitle:!0,errorsAsTitleOnModified:!1,messageTemplate:null,insertMessages:!0,parseInputAttributes:!1,writeInputAttributes:!1,decorateInputElement:!1,decorateElementOnModified:!0,errorClass:null,errorElementClass:"validationElement",errorMessageClass:"validationMessage",allowHtmlMessages:!1,grouping:{deep:!1,observable:!0,live:!1},validate:{}},o=r({},l);o.html5Attributes=["required","pattern","min","max","step"];o.html5InputTypes=["email","number","date"];o.reset=function(){r(o,l)};i.configuration=o;i.utils=function(){var r=(new Date).getTime(),t={},n="__ko_validation__";return{isArray:function(n){return n.isArray||"[object Array]"===Object.prototype.toString.call(n)},isObject:function(n){return null!==n&&"object"==typeof n},isNumber:function(n){return!isNaN(n)},isObservableArray:function(n){return!!n&&"function"==typeof n.remove&&"function"==typeof n.removeAll&&"function"==typeof n.destroy&&"function"==typeof n.destroyAll&&"function"==typeof n.indexOf&&"function"==typeof n.replace},values:function(n){var t=[];for(var i in n)n.hasOwnProperty(i)&&t.push(n[i]);return t},getValue:function(n){return"function"==typeof n?n():n},hasAttribute:function(n,t){return null!==n.getAttribute(t)},getAttribute:function(n,t){return n.getAttribute(t)},setAttribute:function(n,t,i){return n.setAttribute(t,i)},isValidatable:function(n){return!!(n&&n.rules&&n.isValid&&n.isModified)},insertAfter:function(n,t){n.parentNode.insertBefore(t,n.nextSibling)},newId:function(){return r+=1},getConfigOptions:function(n){var t=i.utils.contextFor(n);return t||i.configuration},setDomData:function(r,u){var f=r[n];f||(r[n]=f=i.utils.newId());t[f]=u},getDomData:function(i){var r=i[n];if(r)return t[r]},contextFor:function(n){switch(n.nodeType){case 1:case 8:var t=i.utils.getDomData(n);if(t)return t;if(n.parentNode)return i.utils.contextFor(n.parentNode)}return void 0},isEmptyVal:function(n){return void 0===n?!0:null===n?!0:""===n?!0:void 0},getOriginalElementTitle:function(n){var t=i.utils.getAttribute(n,"data-orig-title"),r=n.title,u=i.utils.hasAttribute(n,"data-orig-title");return u?t:r},"async":function(n){window.setImmediate?window.setImmediate(n):window.setTimeout(n,0)},forEach:function(n,t){if(i.utils.isArray(n))return e(n,t);for(var r in n)n.hasOwnProperty(r)&&t(n[r],r)}}}();a=function(){function c(n){e(n.subscriptions,function(n){n.dispose()});n.subscriptions=[]}function v(n){n.options.deep&&(e(n.flagged,function(n){delete n.__kv_traversed}),n.flagged.length=0);n.options.live||c(n)}function s(n,t){t.validatables=[];c(t);l(n,t);v(t)}function l(i,r,u){var e=[],f=i.peek?i.peek():i;i.__kv_traversed!==!0&&(r.options.deep&&(i.__kv_traversed=!0,r.flagged.push(i)),u=void 0!==u?u:r.options.deep?1:-1,n.isObservable(i)&&(i.errors||t.isValidatable(i)||i.extend({validatable:!0}),r.validatables.push(i),r.options.live&&t.isObservableArray(i)&&r.subscriptions.push(i.subscribe(function(){r.graphMonitor.valueHasMutated()}))),f&&!f._destroy&&(t.isArray(f)?e=f:t.isObject(f)&&(e=t.values(f))),0!==u&&t.forEach(e,function(t){!t||t.nodeType||n.isComputed(t)&&!t.rules||l(t,r,u+1)}))}function h(n){var i=[];return e(n,function(n){t.isValidatable(n)&&!n.isValid()&&i.push(n.error.peek())}),i}var a=0,o=i.configuration,t=i.utils;return{init:function(n,t){a>0&&!t||(n=n||{},n.errorElementClass=n.errorElementClass||n.errorClass||o.errorElementClass,n.errorMessageClass=n.errorMessageClass||n.errorClass||o.errorMessageClass,r(o,n),o.registerExtenders&&i.registerExtenders(),a=1)},reset:i.configuration.reset,group:function(i,f){f=r(r({},o.grouping),f);var l={options:f,graphMonitor:n.observable(),flagged:[],subscriptions:[],validatables:[]},c=null;return c=f.observable?n.computed(function(){return l.graphMonitor(),s(i,l),h(l.validatables)}):function(){return s(i,l),h(l.validatables)},c.showAllMessages=function(n){void 0===n&&(n=!0);c.forEach(function(i){t.isValidatable(i)&&i.isModified(n)})},c.isAnyMessageShown=function(){return!!c.find(function(n){return t.isValidatable(n)&&!n.isValid()&&n.isModified()})},c.filter=function(n){return n=n||function(){return!0},c(),u.arrayFilter(l.validatables,n)},c.find=function(n){return n=n||function(){return!0},c(),u.arrayFirst(l.validatables,n)},c.forEach=function(n){n=n||function(){};c();e(l.validatables,n)},c.map=function(n){return n=n||function(n){return n},c(),u.arrayMap(l.validatables,n)},c._updateState=function(n){if(!t.isObject(n))throw new Error("An object is required.");return i=n,f.observable?void l.graphMonitor.valueHasMutated():(s(n,l),h(l.validatables))},c},formatMessage:function(n,i,r){if(t.isObject(i)&&i.typeAttr&&(i=i.value),"function"==typeof n)return n(i,r);var u=f(i);return null==u&&(u=[]),t.isArray(u)||(u=[u]),n.replace(/{(\d+)}/gi,function(n,t){return"undefined"!=typeof u[t]?u[t]:n})},addRule:function(n,t){n.extend({validatable:!0});var i=!!u.arrayFirst(n.rules(),function(n){return n.rule&&n.rule===t.rule});return i||n.rules.push(t),n},addAnonymousRule:function(n,t){void 0===t.message&&(t.message="Error");t.onlyIf&&(t.condition=t.onlyIf);i.addRule(n,t)},addExtender:function(r){n.extenders[r]=function(n,u){return u&&(u.message||u.onlyIf)?i.addRule(n,{rule:r,message:u.message,params:t.isEmptyVal(u.params)?!0:u.params,condition:u.onlyIf}):i.addRule(n,{rule:r,params:u})}},registerExtenders:function(){if(o.registerExtenders)for(var t in i.rules)i.rules.hasOwnProperty(t)&&(n.extenders[t]||i.addExtender(t))},insertValidationMessage:function(n){var i=document.createElement("SPAN");return i.className=t.getConfigOptions(n).errorMessageClass,t.insertAfter(n,i),i},parseInputValidationAttributes:function(n,r){e(i.configuration.html5Attributes,function(u){var e,f;t.hasAttribute(n,u)&&(e=n.getAttribute(u)||!0,("min"===u||"max"===u)&&(f=n.getAttribute("type"),"undefined"!=typeof f&&f||(f="text"),e={typeAttr:f,value:e}),i.addRule(r(),{rule:u,params:e}))});var u=n.getAttribute("type");e(i.configuration.html5InputTypes,function(n){n===u&&i.addRule(r(),{rule:"date"===n?"dateISO":n,params:!0})})},writeInputValidationAttributes:function(t,r){var f=r(),o;f&&f.rules&&(o=f.rules(),e(i.configuration.html5Attributes,function(i){var r=u.arrayFirst(o,function(n){return n.rule&&n.rule.toLowerCase()===i.toLowerCase()});r&&n.computed({read:function(){var u=n.unwrap(r.params);"pattern"===r.rule&&u instanceof RegExp&&(u=u.source);t.setAttribute(i,u)},disposeWhenNodeIsRemoved:t})}),o=null)},makeBindingHandlerValidatable:function(t){var i=n.bindingHandlers[t].init;n.bindingHandlers[t].init=function(t,r,u,f,e){return i(t,r,u,f,e),n.bindingHandlers.validationCore.init(t,r,u,f,e)}},setRules:function(r,u){var e=function(r,u){var s,h,o,l;if(r&&u)for(s in u)if(u.hasOwnProperty(s)&&(h=u[s],r[s])){var a=r[s],c=f(a),y={},v={};for(o in h)h.hasOwnProperty(o)&&(i.rules[o]?y[o]=h[o]:v[o]=h[o]);if(n.isObservable(a)&&a.extend(y),c&&t.isArray(c))for(l=0;l<c.length;l++)e(c[l],v);else e(c,v)}};e(r,u)}}}();r(n.validation,a);i.rules={};i.rules.required={validator:function(n,t){var i;return void 0===n||null===n?!t:(i=n,"string"==typeof n&&(i=String.prototype.trim?n.trim():n.replace(/^\s+|\s+$/g,"")),t?(i+"").length>0:!0)},message:"This field is required."};i.rules.min={validator:c("min"),message:"Please enter a value greater than or equal to {0}."};i.rules.max={validator:c("max"),message:"Please enter a value less than or equal to {0}."};i.rules.minLength={validator:function(n,t){if(i.utils.isEmptyVal(n))return!0;var r=i.utils.isNumber(n)?""+n:n;return r.length>=t},message:"Please enter at least {0} characters."};i.rules.maxLength={validator:function(n,t){if(i.utils.isEmptyVal(n))return!0;var r=i.utils.isNumber(n)?""+n:n;return r.length<=t},message:"Please enter no more than {0} characters."};i.rules.pattern={validator:function(n,t){return i.utils.isEmptyVal(n)||null!==n.toString().match(t)},message:"Please check this value."};i.rules.step={validator:function(n,t){if(i.utils.isEmptyVal(n)||"any"===t)return!0;var r=100*n%(100*t);return Math.abs(r)<1e-5||Math.abs(1-r)<1e-5},message:"The value must increment by {0}."};i.rules.email={validator:function(n,t){return t?i.utils.isEmptyVal(n)||t&&/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))$/i.test(n):!0},message:"Please enter a proper email address."};i.rules.date={validator:function(n,t){return t?i.utils.isEmptyVal(n)||t&&!/Invalid|NaN/.test(new Date(n)):!0},message:"Please enter a proper date."};i.rules.dateISO={validator:function(n,t){return t?i.utils.isEmptyVal(n)||t&&/^\d{4}[-/](?:0?[1-9]|1[012])[-/](?:0?[1-9]|[12][0-9]|3[01])$/.test(n):!0},message:"Please enter a proper date."};i.rules.number={validator:function(n,t){return t?i.utils.isEmptyVal(n)||t&&/^-?(?:\d+|\d{1,3}(?:,\d{3})+)?(?:\.\d+)?$/.test(n):!0},message:"Please enter a number."};i.rules.digit={validator:function(n,t){return t?i.utils.isEmptyVal(n)||t&&/^\d+$/.test(n):!0},message:"Please enter a digit."};i.rules.phoneUS={validator:function(n,t){return t?i.utils.isEmptyVal(n)?!0:"string"!=typeof n?!1:(n=n.replace(/\s+/g,""),t&&n.length>9&&n.match(/^(1-?)?(\([2-9]\d{2}\)|[2-9]\d{2})-?[2-9]\d{2}-?\d{4}$/)):!0},message:"Please specify a valid phone number."};i.rules.equal={validator:function(n,t){var r=t;return n===i.utils.getValue(r)},message:"Values must equal."};i.rules.notEqual={validator:function(n,t){var r=t;return n!==i.utils.getValue(r)},message:"Please choose another value."};i.rules.unique={validator:function(n,t){var r=i.utils.getValue(t.collection),e=i.utils.getValue(t.externalValue),f=0;return n&&r?(u.arrayFilter(r,function(i){n===(t.valueAccessor?t.valueAccessor(i):i)&&f++}),(e?1:2)>f):!0},message:"Please make sure the value is unique."},function(){i.registerExtenders()}();n.bindingHandlers.validationCore=function(){return{init:function(t,r){var u=i.utils.getConfigOptions(t),f=r(),e;(u.parseInputAttributes&&i.utils.async(function(){i.parseInputValidationAttributes(t,r)}),u.insertMessages&&i.utils.isValidatable(f))&&(e=i.insertValidationMessage(t),u.messageTemplate?n.renderTemplate(u.messageTemplate,{field:f},null,e,"replaceNode"):n.applyBindingsToNode(e,{validationMessage:f}));u.writeInputAttributes&&i.utils.isValidatable(f)&&i.writeInputValidationAttributes(t,r);u.decorateInputElement&&i.utils.isValidatable(f)&&n.applyBindingsToNode(t,{validationElement:f})}}}();i.makeBindingHandlerValidatable("value");i.makeBindingHandlerValidatable("checked");n.bindingHandlers.textInput&&i.makeBindingHandlerValidatable("textInput");i.makeBindingHandlerValidatable("selectedOptions");n.bindingHandlers.validationMessage={update:function(t,r){var e=r(),s=i.utils.getConfigOptions(t),h=(f(e),!1),c=!1,o,l,a;if(null===e||"undefined"==typeof e)throw new Error("Cannot bind validationMessage to undefined value. data-bind expression: "+t.getAttribute("data-bind"));h=e.isModified&&e.isModified();c=e.isValid&&e.isValid();o=null;(!s.messagesOnModified||h)&&(o=c?null:e.error);l=!s.messagesOnModified||h?!c:!1;a="none"!==t.style.display;s.allowHtmlMessages?u.setHtml(t,o):n.bindingHandlers.text.update(t,function(){return o});a&&!l?t.style.display="none":!a&&l&&(t.style.display="")}};n.bindingHandlers.validationElement={update:function(t,r,u){var e=r(),o=i.utils.getConfigOptions(t),h=(f(e),!1),s=!1,c;if(null===e||"undefined"==typeof e)throw new Error("Cannot bind validationElement to undefined value. data-bind expression: "+t.getAttribute("data-bind"));h=e.isModified&&e.isModified();s=e.isValid&&e.isValid();c=function(){var n={},t=!o.decorateElementOnModified||h?!s:!1;return n[o.errorElementClass]=t,n};n.bindingHandlers.css.update(t,c,u);o.errorsAsTitle&&n.bindingHandlers.attr.update(t,function(){var n=!o.errorsAsTitleOnModified||h,r=i.utils.getOriginalElementTitle(t);return n&&!s?{title:e.error,"data-orig-title":r}:!n||s?{title:r,"data-orig-title":null}:void 0})}};n.bindingHandlers.validationOptions=function(){return{init:function(n,t){var e=f(t()),u;e&&(u=r({},i.configuration),r(u,e),i.utils.setDomData(n,u))}}}();n.extenders.validation=function(n,t){return e(i.utils.isArray(t)?t:[t],function(t){i.addAnonymousRule(n,t)}),n};n.extenders.validatable=function(t,u){var o,f,s,e;return(i.utils.isObject(u)||(u={enable:u}),"enable"in u||(u.enable=!0),u.enable&&!i.utils.isValidatable(t))?(o=i.configuration.validate||{},f={throttleEvaluation:u.throttle||o.throttle},t.error=n.observable(null),t.rules=n.observableArray(),t.isValidating=n.observable(!1),t.__valid__=n.observable(!0),t.isModified=n.observable(!1),t.isValid=n.computed(t.__valid__),t.setError=function(n){var i=t.error.peek(),r=t.__valid__.peek();t.error(n);t.__valid__(!1);i===n||r||t.isValid.notifySubscribers()},t.clearError=function(){return t.error(null),t.__valid__(!0),t},s=t.subscribe(function(){t.isModified(!0)}),e=n.computed(r({read:function(){return t(),t.rules(),i.validateObservable(t),!0}},f)),r(e,f),t._disposeValidation=function(){t.isValid.dispose();t.rules.removeAll();s.dispose();e.dispose();delete t.rules;delete t.error;delete t.isValid;delete t.isValidating;delete t.__valid__;delete t.isModified;delete t.setError;delete t.clearError;delete t._disposeValidation}):u.enable===!1&&t._disposeValidation&&t._disposeValidation(),t};i.validateObservable=function(n){for(var r,t,u=0,f=n.rules(),e=f.length;e>u;u++)if(t=f[u],!t.condition||t.condition())if(r=t.rule?i.rules[t.rule]:t,r.async||t.async)p(n,r,t);else if(!y(n,r,t))return!1;return n.clearError(),!0};s={};i.defineLocale=function(n,t){return n&&t?(s[n.toLowerCase()]=t,t):null};i.locale=function(n){if(n){if(n=n.toLowerCase(),!s.hasOwnProperty(n))throw new Error("Localization "+n+" has not been loaded.");i.localize(s[n]);h=n}return h};i.localize=function(n){var r=i.rules;for(var t in n)r.hasOwnProperty(t)&&(r[t].message=n[t])},function(){var r={},n=i.rules;for(var t in n)n.hasOwnProperty(t)&&(r[t]=n[t].message);i.defineLocale("en-us",r)}();h="en-us";n.applyBindingsWithValidation=function(t,u,f){var e,o=document.body;u&&u.nodeType?(o=u,e=f):e=u;i.init();e&&(e=r(r({},i.configuration),e),i.utils.setDomData(o,e));n.applyBindings(t,o)};v=n.applyBindings;n.applyBindings=function(n,t){i.init();v(n,t)};n.validatedObservable=function(t,r){if(!r&&!i.utils.isObject(t))return n.observable(t).extend({validatable:!0});var u=n.observable(t);return u.errors=i.group(i.utils.isObject(t)?t:{},r),u.isValid=n.observable(0===u.errors().length),n.isObservable(u.errors)?u.errors.subscribe(function(n){u.isValid(0===n.length)}):n.computed(u.errors).subscribe(function(n){u.isValid(0===n.length)}),u.subscribe(function(n){i.utils.isObject(n)||(n={});u.errors._updateState(n);u.isValid(0===u.errors().length)}),u}});
/*! matchMedia() polyfill - Test a CSS media type/query in JS. Authors & copyright (c) 2012: Scott Jehl, Paul Irish, Nicholas Zakas. Dual MIT/BSD license */
/*! NOTE: If you're already including a window.matchMedia polyfill via Modernizr or otherwise, you don't need this part */
window.matchMedia=window.matchMedia||function(n){var u,i=n.documentElement,f=i.firstElementChild||i.firstChild,r=n.createElement("body"),t=n.createElement("div");return t.id="mq-test-1",t.style.cssText="position:absolute;top:-100em",r.style.background="none",r.appendChild(t),function(n){return t.innerHTML='&shy;<style media="'+n+'"> #mq-test-1 { width: 42px; }<\/style>',i.insertBefore(r,f),u=t.offsetWidth==42,i.removeChild(r),{matches:u,media:n}}}(document);
/*! Respond.js v1.2.0: min/max-width media query polyfill. (c) Scott Jehl. MIT/GPLv2 Lic. j.mp/respondjs  */
(function(n){function d(){a(!0)}if(n.respond={},respond.update=function(){},respond.mediaQueriesSupported=n.matchMedia&&n.matchMedia("only all").matches,!respond.mediaQueriesSupported){var t=n.document,i=t.documentElement,e=[],u=[],r=[],o={},v=30,f=t.getElementsByTagName("head")[0]||i,g=t.getElementsByTagName("base")[0],s=f.getElementsByTagName("link"),h=[],y=function(){for(var f=s,c=f.length,r=0,t,i,u,e;r<c;r++)t=f[r],i=t.href,u=t.media,e=t.rel&&t.rel.toLowerCase()==="stylesheet",!i||!e||o[i]||(t.styleSheet&&t.styleSheet.rawCssText?(w(t.styleSheet.rawCssText,i,u),o[i]=!0):(/^([a-zA-Z:]*\/\/)/.test(i)||g)&&i.replace(RegExp.$1,"").split("/")[0]!==n.location.host||h.push({href:i,media:u}));p()},p=function(){if(h.length){var n=h.shift();nt(n.href,function(t){w(t,n.href,n.media);o[n.href]=!0;p()})}},w=function(n,t,i){var o=n.match(/@media[^\{]+\{([^\{\}]*\{[^\}\{]*\})+/gi),s=o&&o.length||0,t=t.substring(0,t.lastIndexOf("/")),v=function(n){return n.replace(/(url\()['"]?([^\/\)'"][^:\)'"]+)['"]?(\))/g,"$1"+t+"$2$3")},y=!s&&i,h=0,f,c,r,l,p;for(t.length&&(t+="/"),y&&(s=1);h<s;h++)for(f=0,y?(c=i,u.push(v(n))):(c=o[h].match(/@media *([^\{]+)\{([\S\s]+?)$/)&&RegExp.$1,u.push(RegExp.$2&&v(RegExp.$2))),l=c.split(","),p=l.length;f<p;f++)r=l[f],e.push({media:r.split("(")[0].match(/(only\s+)?([a-zA-Z]+)\s?/)&&RegExp.$2||"all",rules:u.length-1,hasquery:r.indexOf("(")>-1,minw:r.match(/\(min\-width:[\s]*([\s]*[0-9\.]+)(px|em)[\s]*\)/)&&parseFloat(RegExp.$1)+(RegExp.$2||""),maxw:r.match(/\(max\-width:[\s]*([\s]*[0-9\.]+)(px|em)[\s]*\)/)&&parseFloat(RegExp.$1)+(RegExp.$2||"")});a()},c,b,k=function(){var u,r=t.createElement("div"),n=t.body,f=!1;return r.style.cssText="position:absolute;font-size:1em;width:1em",n||(n=f=t.createElement("body"),n.style.background="none"),n.appendChild(r),i.insertBefore(n,i.firstChild),u=r.offsetWidth,f?i.removeChild(n):n.removeChild(r),l=parseFloat(u)},l,a=function(n){var nt="clientWidth",tt=i[nt],it=t.compatMode==="CSS1Compat"&&tt||t.body[nt]||tt,d={},ot=s[s.length-1],rt=(new Date).getTime(),o,h,g;if(n&&c&&rt-c<v){clearTimeout(b);b=setTimeout(a,v);return}c=rt;for(o in e){var y=e[o],p=y.minw,w=y.maxw,ut=p===null,ft=w===null,et="em";!p||(p=parseFloat(p)*(p.indexOf(et)>-1?l||k():1));!w||(w=parseFloat(w)*(w.indexOf(et)>-1?l||k():1));y.hasquery&&(ut&&ft||!(ut||it>=p)||!(ft||it<=w))||(d[y.media]||(d[y.media]=[]),d[y.media].push(u[y.rules]))}for(o in r)r[o]&&r[o].parentNode===f&&f.removeChild(r[o]);for(o in d)h=t.createElement("style"),g=d[o].join("\n"),h.type="text/css",h.media=o,f.insertBefore(h,ot.nextSibling),h.styleSheet?h.styleSheet.cssText=g:h.appendChild(t.createTextNode(g)),r.push(h)},nt=function(n,t){var i=tt();i&&(i.open("GET",n,!0),i.onreadystatechange=function(){i.readyState==4&&(i.status==200||i.status==304)&&t(i.responseText)},i.readyState!=4)&&i.send(null)},tt=function(){var n=!1;try{n=new XMLHttpRequest}catch(t){n=new ActiveXObject("Microsoft.XMLHTTP")}return function(){return n}}();y();respond.update=y;n.addEventListener?n.addEventListener("resize",d,!1):n.attachEvent&&n.attachEvent("onresize",d)}})(this);
/*!
 * Modernizr v2.7.2
 * www.modernizr.com
 *
 * Copyright (c) Faruk Ates, Paul Irish, Alex Sexton
 * Available under the BSD and MIT licenses: www.modernizr.com/license/
 */
if(window.Modernizr=function(n,t,i){function a(n){c.cssText=n}function vt(n,t){return a(y.join(n+";")+(t||""))}function h(n,t){return typeof n===t}function v(n,t){return!!~(""+n).indexOf(t)}function lt(n,t){var u,r;for(u in n)if(r=n[u],!v(r,"-")&&c[r]!==i)return t=="pfx"?r:!0;return!1}function yt(n,t,r){var f,u;for(f in n)if(u=t[n[f]],u!==i)return r===!1?n[f]:h(u,"function")?u.bind(r||t):u;return!1}function f(n,t,i){var r=n.charAt(0).toUpperCase()+n.slice(1),u=(n+" "+ot.join(r+" ")+r).split(" ");return h(t,"string")||h(t,"undefined")?lt(u,t):(u=(n+" "+st.join(r+" ")+r).split(" "),yt(u,t,i))}function pt(){u.input=function(i){for(var r=0,u=i.length;r<u;r++)w[i[r]]=!!(i[r]in o);return w.list&&(w.list=!!(t.createElement("datalist")&&n.HTMLDataListElement)),w}("autocomplete autofocus list placeholder max min multiple pattern required step".split(" "));u.inputtypes=function(n){for(var u=0,r,f,e,h=n.length;u<h;u++)o.setAttribute("type",f=n[u]),r=o.type!=="text",r&&(o.value=g,o.style.cssText="position:absolute;visibility:hidden;",/^range$/.test(f)&&o.style.WebkitAppearance!==i?(s.appendChild(o),e=t.defaultView,r=e.getComputedStyle&&e.getComputedStyle(o,null).WebkitAppearance!=="textfield"&&o.offsetHeight!==0,s.removeChild(o)):/^(search|tel)$/.test(f)||(r=/^(url|email)$/.test(f)?o.checkValidity&&o.checkValidity()===!1:o.value!=g)),ht[n[u]]=!!r;return ht}("search tel url email datetime date month week time datetime-local number range color".split(" "))}var u={},d=!0,s=t.documentElement,e="modernizr",ut=t.createElement(e),c=ut.style,o=t.createElement("input"),g=":)",ft={}.toString,y=" -webkit- -moz- -o- -ms- ".split(" "),et="Webkit Moz O ms",ot=et.split(" "),st=et.toLowerCase().split(" "),p={svg:"http://www.w3.org/2000/svg"},r={},ht={},w={},nt=[],tt=nt.slice,b,l=function(n,i,r,u){var l,a,c,v,f=t.createElement("div"),h=t.body,o=h||t.createElement("body");if(parseInt(r,10))while(r--)c=t.createElement("div"),c.id=u?u[r]:e+(r+1),f.appendChild(c);return l=["&#173;",'<style id="s',e,'">',n,"<\/style>"].join(""),f.id=e,(h?f:o).innerHTML+=l,o.appendChild(f),h||(o.style.background="",o.style.overflow="hidden",v=s.style.overflow,s.style.overflow="hidden",s.appendChild(o)),a=i(f,n),h?f.parentNode.removeChild(f):(o.parentNode.removeChild(o),s.style.overflow=v),!!a},at=function(t){var i=n.matchMedia||n.msMatchMedia,r;return i?i(t).matches:(l("@media "+t+" { #"+e+" { position: absolute; } }",function(t){r=(n.getComputedStyle?getComputedStyle(t,null):t.currentStyle).position=="absolute"}),r)},ct=function(){function r(r,u){u=u||t.createElement(n[r]||"div");r="on"+r;var f=r in u;return f||(u.setAttribute||(u=t.createElement("div")),u.setAttribute&&u.removeAttribute&&(u.setAttribute(r,""),f=h(u[r],"function"),h(u[r],"undefined")||(u[r]=i),u.removeAttribute(r))),u=null,f}var n={select:"input",change:"input",submit:"form",reset:"form",error:"img",load:"img",abort:"img"};return r}(),it={}.hasOwnProperty,rt,k;rt=h(it,"undefined")||h(it.call,"undefined")?function(n,t){return t in n&&h(n.constructor.prototype[t],"undefined")}:function(n,t){return it.call(n,t)};Function.prototype.bind||(Function.prototype.bind=function(n){var t=this,i,r;if(typeof t!="function")throw new TypeError;return i=tt.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(tt.call(arguments))),Object(u)===u)?u:e:t.apply(n,i.concat(tt.call(arguments)))},r});r.flexbox=function(){return f("flexWrap")};r.flexboxlegacy=function(){return f("boxDirection")};r.canvas=function(){var n=t.createElement("canvas");return!!(n.getContext&&n.getContext("2d"))};r.canvastext=function(){return!!(u.canvas&&h(t.createElement("canvas").getContext("2d").fillText,"function"))};r.webgl=function(){return!!n.WebGLRenderingContext};r.touch=function(){var i;return"ontouchstart"in n||n.DocumentTouch&&t instanceof DocumentTouch?i=!0:l(["@media (",y.join("touch-enabled),("),e,")","{#modernizr{top:9px;position:absolute}}"].join(""),function(n){i=n.offsetTop===9}),i};r.geolocation=function(){return"geolocation"in navigator};r.postmessage=function(){return!!n.postMessage};r.websqldatabase=function(){return!!n.openDatabase};r.indexedDB=function(){return!!f("indexedDB",n)};r.hashchange=function(){return ct("hashchange",n)&&(t.documentMode===i||t.documentMode>7)};r.history=function(){return!!(n.history&&history.pushState)};r.draganddrop=function(){var n=t.createElement("div");return"draggable"in n||"ondragstart"in n&&"ondrop"in n};r.websockets=function(){return"WebSocket"in n||"MozWebSocket"in n};r.rgba=function(){return a("background-color:rgba(150,255,150,.5)"),v(c.backgroundColor,"rgba")};r.hsla=function(){return a("background-color:hsla(120,40%,100%,.5)"),v(c.backgroundColor,"rgba")||v(c.backgroundColor,"hsla")};r.multiplebgs=function(){return a("background:url(https://),url(https://),red url(https://)"),/(url\s*\(.*?){3}/.test(c.background)};r.backgroundsize=function(){return f("backgroundSize")};r.borderimage=function(){return f("borderImage")};r.borderradius=function(){return f("borderRadius")};r.boxshadow=function(){return f("boxShadow")};r.textshadow=function(){return t.createElement("div").style.textShadow===""};r.opacity=function(){return vt("opacity:.55"),/^0.55$/.test(c.opacity)};r.cssanimations=function(){return f("animationName")};r.csscolumns=function(){return f("columnCount")};r.cssgradients=function(){var n="background-image:";return a((n+"-webkit- ".split(" ").join("gradient(linear,left top,right bottom,from(#9f9),to(white));"+n)+y.join("linear-gradient(left top,#9f9, white);"+n)).slice(0,-n.length)),v(c.backgroundImage,"gradient")};r.cssreflections=function(){return f("boxReflect")};r.csstransforms=function(){return!!f("transform")};r.csstransforms3d=function(){var n=!!f("perspective");return n&&"webkitPerspective"in s.style&&l("@media (transform-3d),(-webkit-transform-3d){#modernizr{left:9px;position:absolute;height:3px;}}",function(t){n=t.offsetLeft===9&&t.offsetHeight===3}),n};r.csstransitions=function(){return f("transition")};r.fontface=function(){var n;return l('@font-face {font-family:"font";src:url("https://")}',function(i,r){var f=t.getElementById("smodernizr"),u=f.sheet||f.styleSheet,e=u?u.cssRules&&u.cssRules[0]?u.cssRules[0].cssText:u.cssText||"":"";n=/src/i.test(e)&&e.indexOf(r.split(" ")[0])===0}),n};r.generatedcontent=function(){var n;return l(["#",e,"{font:0/0 a}#",e,':after{content:"',g,'";visibility:hidden;font:3px/1 a}'].join(""),function(t){n=t.offsetHeight>=3}),n};r.video=function(){var i=t.createElement("video"),n=!1;try{(n=!!i.canPlayType)&&(n=new Boolean(n),n.ogg=i.canPlayType('video/ogg; codecs="theora"').replace(/^no$/,""),n.h264=i.canPlayType('video/mp4; codecs="avc1.42E01E"').replace(/^no$/,""),n.webm=i.canPlayType('video/webm; codecs="vp8, vorbis"').replace(/^no$/,""))}catch(r){}return n};r.audio=function(){var i=t.createElement("audio"),n=!1;try{(n=!!i.canPlayType)&&(n=new Boolean(n),n.ogg=i.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,""),n.mp3=i.canPlayType("audio/mpeg;").replace(/^no$/,""),n.wav=i.canPlayType('audio/wav; codecs="1"').replace(/^no$/,""),n.m4a=(i.canPlayType("audio/x-m4a;")||i.canPlayType("audio/aac;")).replace(/^no$/,""))}catch(r){}return n};r.localstorage=function(){try{return localStorage.setItem(e,e),localStorage.removeItem(e),!0}catch(n){return!1}};r.sessionstorage=function(){try{return sessionStorage.setItem(e,e),sessionStorage.removeItem(e),!0}catch(n){return!1}};r.webworkers=function(){return!!n.Worker};r.applicationcache=function(){return!!n.applicationCache};r.svg=function(){return!!t.createElementNS&&!!t.createElementNS(p.svg,"svg").createSVGRect};r.inlinesvg=function(){var n=t.createElement("div");return n.innerHTML="<svg/>",(n.firstChild&&n.firstChild.namespaceURI)==p.svg};r.smil=function(){return!!t.createElementNS&&/SVGAnimate/.test(ft.call(t.createElementNS(p.svg,"animate")))};r.svgclippaths=function(){return!!t.createElementNS&&/SVGClipPath/.test(ft.call(t.createElementNS(p.svg,"clipPath")))};for(k in r)rt(r,k)&&(b=k.toLowerCase(),u[b]=r[k](),nt.push((u[b]?"":"no-")+b));u.input||pt();u.addTest=function(n,t){if(typeof n=="object")for(var r in n)rt(n,r)&&u.addTest(r,n[r]);else{if(n=n.toLowerCase(),u[n]!==i)return u;t=typeof t=="function"?t():t;typeof d!="undefined"&&d&&(s.className+=" "+(t?"":"no-")+n);u[n]=t}return u};a("");ut=o=null;
/**
     * @preserve HTML5 Shiv prev3.7.1 | @afarkas @jdalton @jon_neal @rem | MIT/GPL2 Licensed
     */
return function(n,t){function p(n,t){var i=n.createElement("p"),r=n.getElementsByTagName("head")[0]||n.documentElement;return i.innerHTML="x<style>"+t+"<\/style>",r.insertBefore(i.lastChild,r.firstChild)}function c(){var n=r.elements;return typeof n=="string"?n.split(" "):n}function o(n){var t=h[n[s]];return t||(t={},e++,n[s]=e,h[e]=t),t}function l(n,r,u){if(r||(r=t),i)return r.createElement(n);u||(u=o(r));var f;return f=u.cache[n]?u.cache[n].cloneNode():y.test(n)?(u.cache[n]=u.createElem(n)).cloneNode():u.createElem(n),f.canHaveChildren&&!v.test(n)&&!f.tagUrn?u.frag.appendChild(f):f}function w(n,r){if(n||(n=t),i)return n.createDocumentFragment();r=r||o(n);for(var f=r.frag.cloneNode(),u=0,e=c(),s=e.length;u<s;u++)f.createElement(e[u]);return f}function b(n,t){t.cache||(t.cache={},t.createElem=n.createElement,t.createFrag=n.createDocumentFragment,t.frag=t.createFrag());n.createElement=function(i){return r.shivMethods?l(i,n,t):t.createElem(i)};n.createDocumentFragment=Function("h,f","return function(){var n=f.cloneNode(),c=n.createElement;h.shivMethods&&("+c().join().replace(/[\w\-]+/g,function(n){return t.createElem(n),t.frag.createElement(n),'c("'+n+'")'})+");return n}")(r,t.frag)}function a(n){n||(n=t);var u=o(n);return!r.shivCSS||f||u.hasCSS||(u.hasCSS=!!p(n,"article,aside,dialog,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}mark{background:#FF0;color:#000}template{display:none}")),i||b(n,u),n}var u=n.html5||{},v=/^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i,y=/^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i,f,s="_html5shiv",e=0,h={},i,r;(function(){try{var n=t.createElement("a");n.innerHTML="<xyz><\/xyz>";f="hidden"in n;i=n.childNodes.length==1||function(){t.createElement("a");var n=t.createDocumentFragment();return typeof n.cloneNode=="undefined"||typeof n.createDocumentFragment=="undefined"||typeof n.createElement=="undefined"}()}catch(r){f=!0;i=!0}})();r={elements:u.elements||"abbr article aside audio bdi canvas data datalist details dialog figcaption figure footer header hgroup main mark meter nav output progress section summary template time video",version:"3.7.0",shivCSS:u.shivCSS!==!1,supportsUnknownElements:i,shivMethods:u.shivMethods!==!1,type:"default",shivDocument:a,createElement:l,createDocumentFragment:w};n.html5=r;a(t)}(this,t),u._version="2.7.2",u._prefixes=y,u._domPrefixes=st,u._cssomPrefixes=ot,u.mq=at,u.hasEvent=ct,u.testProp=function(n){return lt([n])},u.testAllProps=f,u.testStyles=l,u.prefixed=function(n,t,i){return t?f(n,t,i):f(n,"pfx")},s.className=s.className.replace(/(^|\s)no-js(\s|$)/,"$1$2")+(d?" js "+nt.join(" "):""),u}(this,this.document),!jQuery)throw new Error("Bootstrap requires jQuery");+function(n){"use strict";function t(){var i=document.createElement("bootstrap"),n={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var t in n)if(void 0!==i.style[t])return{end:n[t]}}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()})}(window.jQuery);+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));"string"==typeof i&&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)}(window.jQuery);+function(n){"use strict";var t=function(i,r){this.$element=n(i);this.options=n.extend({},t.DEFAULTS,r)},i;t.DEFAULTS={loadingText:"loading..."};t.prototype.setState=function(n){var i="disabled",t=this.$element,r=t.is("input")?"val":"html",u=t.data();n+="Text";u.resetText||t.data("resetText",t[r]());t[r](u[n]||this.options[n]);setTimeout(function(){"loadingText"==n?t.addClass(i).attr(i,i):t.removeClass(i).removeAttr(i)},0)};t.prototype.toggle=function(){var n=this.$element.closest('[data-toggle="buttons"]'),t;n.length&&(t=this.$element.find("input").prop("checked",!this.$element.hasClass("active")).trigger("change"),"radio"===t.prop("type")&&n.find(".active").removeClass("active"));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="object"==typeof i&&i;r||u.data("bs.button",r=new t(this,f));"toggle"==i?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()})}(window.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;"hover"==this.options.pause&&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)&&!(0>t))return this.sliding?this.$element.one("slid",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.end&&(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="next"==t?"left":"right",h="next"==t?"first":"last",o=this,e;if(!r.length){if(!this.options.wrap)return;r=this.$element.find(".item")[h]()}if(this.sliding=!0,s&&this.pause(),e=n.Event("slide.bs.carousel",{relatedTarget:r[0],direction:f}),!r.hasClass("active")){if(this.$indicators.length&&(this.$indicators.find(".active").removeClass("active"),this.$element.one("slid",function(){var t=n(o.$indicators.children()[o.getActiveIndex()]);t&&t.addClass("active")})),n.support.transition&&this.$element.hasClass("slide")){if(this.$element.trigger(e),e.isDefaultPrevented())return;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(" "));o.sliding=!1;setTimeout(function(){o.$element.trigger("slid")},0)}).emulateTransitionEnd(600)}else{if(this.$element.trigger(e),e.isDefaultPrevented())return;u.removeClass("active");r.addClass("active");this.sliding=!1;this.$element.trigger("slid")}return 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(),"object"==typeof i&&i),e="string"==typeof i?i:f.slide;r||u.data("bs.carousel",r=new t(this,f));"number"==typeof i?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 f,i=n(this),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())})})}(window.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("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()))return 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?(this.$element[t](0).one(n.support.transition.end,n.proxy(r,this)).emulateTransitionEnd(350),void 0):r.call(this)};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 r=n(this),u=r.data("bs.collapse"),f=n.extend({},t.DEFAULTS,r.data(),"object"==typeof i&&i);u||r.data("bs.collapse",u=new t(this,f));"string"==typeof i&&u[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 e,i=n(this),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)})}(window.jQuery);+function(n){"use strict";function r(){n(e).remove();n(i).each(function(t){var i=u(n(this));i.hasClass("open")&&(i.trigger(t=n.Event("hide.bs.dropdown")),t.isDefaultPrevented()||i.removeClass("open").trigger("hidden.bs.dropdown"))})}function u(t){var i=t.attr("data-target"),r;return i||(i=t.attr("href"),i=i&&/#/.test(i)&&i.replace(/.*(?=#[^\s]*$)/,"")),r=i&&n(i),r&&r.length?r:t.parent()}var e=".dropdown-backdrop",i="[data-toggle=dropdown]",t=function(t){n(t).on("click.bs.dropdown",this.toggle)},f;t.prototype.toggle=function(t){var f=n(this),i,e;if(!f.is(".disabled, :disabled")){if(i=u(f),e=i.hasClass("open"),r(),!e){if("ontouchstart"in document.documentElement&&!i.closest(".navbar-nav").length&&n('<div class="dropdown-backdrop"/>').insertAfter(n(this)).on("click",r),i.trigger(t=n.Event("show.bs.dropdown")),t.isDefaultPrevented())return;i.toggleClass("open").trigger("shown.bs.dropdown");f.focus()}return!1}};t.prototype.keydown=function(t){var e,o,s,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&&27==t.keyCode)return 27==t.which&&o.find(i).focus(),e.click();f=n("[role=menu] li:not(.divider):visible a",o);f.length&&(r=f.index(f.filter(":focus")),38==t.keyCode&&r>0&&r--,40==t.keyCode&&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("dropdown");u||r.data("dropdown",u=new t(this));"string"==typeof i&&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]",t.prototype.keydown)}(window.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.load(this.options.remote)},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.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();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.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){27==n.which&&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.modal",n.proxy(function(n){n.target===n.currentTarget&&("static"==this.options.backdrop?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(),"object"==typeof i&&i);u||f.data("bs.modal",u=new t(this,e));"string"==typeof i?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("modal")?"toggle":n.extend({remote:!/#/.test(r)&&r},u.data(),i.data());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")})}(window.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],"click"==u)this.$element.on("click."+this.type,this.options.selector,n.proxy(this.toggle,this));else"manual"!=u&&(o="hover"==u?"mouseenter":"focus",s="hover"==u?"mouseleave":"blur",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&&"number"==typeof t.delay&&(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);return clearTimeout(i.timeout),i.hoverState="in",i.options.delay&&i.options.delay.show?(i.timeout=setTimeout(function(){"in"==i.hoverState&&i.show()},i.options.delay.show),void 0):i.show()};t.prototype.leave=function(t){var i=t instanceof this.constructor?t:n(t.currentTarget)[this.type](this.getDelegateOptions()).data("bs."+this.type);return clearTimeout(i.timeout),i.hoverState="out",i.options.delay&&i.options.delay.hide?(i.timeout=setTimeout(function(){"out"==i.hoverState&&i.hide()},i.options.delay.hide),void 0):i.hide()};t.prototype.show=function(){var o=n.Event("show.bs."+this.type),i,l;if(this.hasContent()&&this.enabled){if(this.$element.trigger(o),o.isDefaultPrevented())return;i=this.tip();this.setContent();this.options.animation&&i.addClass("fade");var t="function"==typeof this.options.placement?this.options.placement.call(this,i[0],this.$element[0]):this.options.placement,s=/\s?auto?\s?/i,h=s.test(t);h&&(t=t.replace(s,"")||"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(),u=i[0].offsetWidth,f=i[0].offsetHeight;if(h){var e=this.$element.parent(),a=t,c=document.documentElement.scrollTop||document.body.scrollTop,v="body"==this.options.container?window.innerWidth:e.outerWidth(),y="body"==this.options.container?window.innerHeight:e.outerHeight(),p="body"==this.options.container?0:e.offset().left;t="bottom"==t&&r.top+r.height+f-c>y?"top":"top"==t&&r.top-c-f<0?"bottom":"right"==t&&r.right+u>v?"left":"left"==t&&r.left-u<p?"right":t;i.removeClass(a).addClass(t)}l=this.getCalculatedOffset(t,r,u,f);this.applyPlacement(l,t);this.$element.trigger("shown.bs."+this.type)}};t.prototype.applyPlacement=function(n,t){var h,i=this.tip(),c=i[0].offsetWidth,f=i[0].offsetHeight,e=parseInt(i.css("margin-top"),10),o=parseInt(i.css("margin-left"),10),u,r,s;isNaN(e)&&(e=0);isNaN(o)&&(o=0);n.top=n.top+e;n.left=n.left+o;i.offset(n).addClass("in");u=i[0].offsetWidth;r=i[0].offsetHeight;("top"==t&&r!=f&&(h=!0,n.top=n.top+f-r),/bottom|top/.test(t))?(s=0,n.left<0&&(s=-2*n.left,n.left=0,i.offset(n),u=i[0].offsetWidth,r=i[0].offsetHeight),this.replaceArrow(s-c+u,u,"left")):this.replaceArrow(r-f,r,"top");h&&i.offset(n)};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 i(){"in"!=u.hoverState&&t.detach()}var u=this,t=this.tip(),r=n.Event("hide.bs."+this.type);return this.$element.trigger(r),r.isDefaultPrevented()?void 0:(t.removeClass("in"),n.support.transition&&this.$tip.hasClass("fade")?t.one(n.support.transition.end,i).emulateTransitionEnd(150):i(),this.$element.trigger("hidden.bs."+this.type),this)};t.prototype.fixTitle=function(){var n=this.$element;(n.attr("title")||"string"!=typeof n.attr("data-original-title"))&&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({},"function"==typeof t.getBoundingClientRect?t.getBoundingClientRect():{width:t.offsetWidth,height:t.offsetHeight},this.$element.offset())};t.prototype.getCalculatedOffset=function(n,t,i,r){return"bottom"==n?{top:t.top+t.height,left:t.left+t.width/2-i/2}:"top"==n?{top:t.top-r,left:t.left+t.width/2-i/2}:"left"==n?{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=this.$element,n=this.options;return t.attr("data-original-title")||("function"==typeof n.title?n.title.call(t[0]):n.title)};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(){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="object"==typeof i&&i;r||u.data("bs.tooltip",r=new t(this,f));"string"==typeof i&&r[i]()})};n.fn.tooltip.Constructor=t;n.fn.tooltip.noConflict=function(){return n.fn.tooltip=i,this}}(window.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(),t=this.getTitle(),i=this.getContent();n.find(".popover-title")[this.options.html?"html":"text"](t);n.find(".popover-content")[this.options.html?"html":"text"](i);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")||("function"==typeof n.content?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="object"==typeof i&&i;r||u.data("bs.popover",r=new t(this,f));"string"==typeof i&&r[i]()})};n.fn.popover.Constructor=t;n.fn.popover.noConflict=function(){return n.fn.popover=i,this}}(window.jQuery);+function(n){"use strict";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;this.offsets=n([]);this.targets=n([]);t=this;this.$body.find(this.selector).map(function(){var f=n(this),r=f.data("target")||f.attr("href"),u=/^#\w/.test(r)&&n(r);return u&&u.length&&[[u[i]().top+(!n.isWindow(t.$scrollElement.get(0))&&t.$scrollElement.scrollTop()),r]]||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 n,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;if(i>=e)return u!=(n=r.last()[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).parents(".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")};var i=n.fn.scrollspy;n.fn.scrollspy=function(i){return this.each(function(){var u=n(this),r=u.data("bs.scrollspy"),f="object"==typeof i&&i;r||u.data("bs.scrollspy",r=new t(this,f));"string"==typeof i&&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())})})}(window.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.attr("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));"string"==typeof i&&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")})}(window.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=null;this.checkPosition()},i;t.RESET="affix affix-top affix-bottom";t.DEFAULTS={offset:0};t.prototype.checkPositionWithEventLoop=function(){setTimeout(n.proxy(this.checkPosition,this),1)};t.prototype.checkPosition=function(){var i;if(this.$element.is(":visible")){var s=n(document).height(),e=this.$window.scrollTop(),o=this.$element.offset(),r=this.options.offset,f=r.top,u=r.bottom;"object"!=typeof r&&(u=f=r);"function"==typeof f&&(f=r.top());"function"==typeof u&&(u=r.bottom());i=null!=this.unpin&&e+this.unpin<=o.top?!1:null!=u&&o.top+this.$element.height()>=s-u?"bottom":null!=f&&f>=e?"top":!1;this.affixed!==i&&(this.unpin&&this.$element.css("top",""),this.affixed=i,this.unpin="bottom"==i?o.top-e:null,this.$element.removeClass(t.RESET).addClass("affix"+(i?"-"+i:"")),"bottom"==i&&this.$element.offset({top:document.body.offsetHeight-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="object"==typeof i&&i;r||u.data("bs.affix",r=new t(this,f));"string"==typeof i&&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)})})}(window.jQuery),function(){}.call("object"==typeof window&&window||"object"==typeof self&&self||"object"==typeof global&&global||{});ko.validation.rules.checked={validator:function(n){return n?!0:!1}};ko.validation.rules.javascriptInjection={validator:function(n){var i,t;if(n!=null&&n.length>0)for(i=["<",">"],t=0;t<i.length;t+=1)if(n.indexOf(i[t])>=0)return!1;return!0}};ko.validation.rules.mustEqual={validator:function(n,t){return n===t()}};ko.validation.registerExtenders();ko.bindingHandlers.friendlyCaptcha={init:function(n,t,i,r){const e=new friendlyChallenge.WidgetInstance(n,{doneCallback:r.validateCaptchaSolution,sitekey:Registration.Configuration.friendlyCaptchaSettings.siteKey(),startMode:"none"});var u=$("<div class='input-container'>"),f=$(n),o=$("<div class='error-message'><\/div>");f.after(u);u.append(f);f.after(o);r&&(r.refresh=function(){e.reset();r.captchaProofCode=null;r.isResponded(!1);r.hasFailed(!1)},r.destroy=function(){setTimeout(function(){e.reset();r.captchaProofCode=null;r.isResponded(!1);r.hasFailed(!1)},3e3)},r.hasFailed.subscribe(function(){r.hasFailed()===!0?u.addClass("error"):u.removeClass("error")}),r.errorMessage.subscribe(function(){o.text(r.errorMessage())}))}};ko.bindingHandlers.fadeIf={update:function(n,t){function f(n,t){var i=parseInt(window.getComputedStyle(n,null).getPropertyValue("padding-bottom"))+parseInt(window.getComputedStyle(n,null).getPropertyValue("padding-top"));n.style.height=t.offsetHeight+i+"px"}function e(n){n.classList.contains("add-big")?n.classList.add("big"):n.classList.remove("big")}var r=$(n),u=ko.utils.unwrapObservable(t()),i=$(n).closest(".inner-wrapper")[0];u===!0&&r.hasClass("hidden")?(e(i),r.removeClass("hidden"),f(i,n),setTimeout(function(){r.removeClass("faded");i.style.minHeight=i.style.height;i.style.height="auto"},Registration.Constants.Transition.Speed())):u!==!1||r.hasClass("faded")||(i.style.height=i.offsetHeight+"px",i.style.minHeight="0px",r.addClass("faded"),setTimeout(function(){r.addClass("hidden")},Registration.Constants.Transition.Speed()))}};ko.bindingHandlers.hide={update:function(n,t){var i=$(n);t()===!0&&i.closest(".alert").animate({opacity:"0"},200).slideUp(500,$.bez([.37,.74,.15,1]))}};ko.bindingHandlers.onEnterKeyPress={init:function(n,t,i,r){var u=i();$(n).keypress(function(n){var t=n.which?n.which:n.keyCode;return t===13?(u.onEnterKeyPress.call(r),!1):!0})}};ko.bindingHandlers.avoidWhiteSpaces={init:function(n,t,i){var r=i();$(n).keydown(function(n){var t=n.which?n.which:n.keyCode;return t===32?!1:!0})}};ko.bindingHandlers.ugarit={init:function(n,t,i){var r=t()||{},u=i(),f=$(n),e;f.attr("id")===undefined&&f.attr("id",Loop.Core.Utils.generateUUID());e=new Frontiers.Ugarit.Plugins.AutocompleteOrganizations({inputTextElementId:f.attr("id"),allowCreateOrganization:r.allowCreateOrganization,displayOtherOptions:r.displayOtherOptions,displaySuggestions:r.displaySuggestions,onSelectedOrganizationChanged:r.onSelectedOrganizationChanged,defaultCreateOrganization:{shadowSave:r.defaultCreateOrganization.shadowSave,title:r.defaultCreateOrganization.title,onOrganizationCreated:r.defaultCreateOrganization.onOrganizationCreated,onOrganizationCreationError:r.defaultCreateOrganization.onOrganizationCreationError},onSuggestionsLoadingFail:function(){e.showCreateOrganizationForm(!0)}});typeof u.value=="function"&&u.value.subscribe(function(){u.value()||e.clearInput()})}}