var Registration;window.Registration=window.Registration||{};Registration.Events=Registration.Events||{};Registration.Events.People={NavigateTo:"SpaPeopleNavigateTo",NotificationSent:"NotificationSent",RegistrationCompleted:"RegistrationCompleted"};window.Registration=window.Registration||{};Registration.Configuration=function(n){var t=this,i=n.ErrorMessage;t.urls={};t.urls.BaseUrl=n.Urls.BaseUrl;t.urls.BaseSecureUrl=n.Urls.BaseSecureUrl;t.urls.ApiV2BasePath=n.Urls.ApiV2BasePath;t.urls.GetApi2Uri=function(n){var i=location.protocol==="https:"?t.urls.BaseSecureUrl:t.urls.BaseUrl;return i+t.urls.ApiV2BasePath+n};t.urls.ApiV3BasePath=n.Urls.ApiV3BasePath;t.urls.GetApi3Uri=function(n){var i=location.protocol==="https:"?t.urls.BaseSecureUrl:t.urls.BaseUrl;return i+t.urls.ApiV3BasePath+n};t.urls.loopBaseAddress=n.Urls.LoopBaseAddress;t.urls.loopTermsAndConditionsUrl=n.Urls.LoopTermsAndConditionsUrl;t.urls.frontiersTermsAndConditionsUrl=n.Urls.FrontiersTermsAndConditionsUrl;t.urls.MainWebsiteBaseUrl=n.Urls.MainWebsiteBaseUrl;t.urls.IdentityProviderBaseUrl=n.Urls.IdentityProviderBaseUrl;t.urls.thirdPartyLogin=n.Urls.ThirdPartyLogin;t.urls.thirdPartyRegister=n.Urls.ThirdPartyRegister;t.branding={};t.branding.code=function(){return n.Branding.Code};t.branding.displayName=function(){return n.Branding.Name};t.branding.pageTitle=function(){return n.Branding.PageTitle};t.branding.registerTermsAndConditions=function(){return n.Branding.TermsAndConditionsList};t.tenantTermsAndConditionsInfo=function(){return n.TenantTermsAndConditionsInfo};t.identityProviderTermsAndConditionsInfo=function(){return n.IdentityProviderTermsAndConditionsInfo};t.publishInitialMessages=function(){i&&Loop.Core.publish(Registration.Events.People.NotificationSent,{type:Registration.Constants.AlertTypes.ERROR,message:Registration.Constants.UIMessages.translateServerMessage(i)});t.infoMessage&&Loop.Core.publish(Registration.Events.People.NotificationSent,{type:Registration.Constants.AlertTypes.INFO,message:Registration.Constants.UIMessages.translateServerMessage(infoMessageCode)})};t.enableThirdPartyLoginAndRegister=n.EnableThirdPartyLoginAndRegister;t.enableYourMembership=n.EnableYourMembership;t.enableOrcidLogin=n.EnableOrcidLogin;t.friendlyCaptchaSettings={};t.friendlyCaptchaSettings.siteKey=function(){return n.FriendlyCaptchaSettings.SiteKey};t.bypassCaptcha=n.BypassCaptcha;Frontiers.Ugarit.Common.Configuration.SetBaseUrls(n.Urls.UgaritBaseAddress,n.Urls.LoopBaseAddress)};window.Registration=window.Registration||{};Registration.Constants=Registration.Constants||{};Registration.Constants.UIMessages={requiredField:"Please fill in this field.",requiredWithMinLength:function(n){return"A minimum of "+n+" characters is required."},limitExceded:function(n){return"A maximum of "+n+" characters is allowed."},passwordDontMatch:"Passwords do not match.",invalidEmail:"Please enter a valid email address.",captchaRequired:"Please click to verify you are not a robot.",invalidCaptcha:"Validation failed. Try again.",agreeTermsRequired:"Please accept the Terms and Conditions to proceed.",javascriptInjection:"Invalid input.",errorSendingEmail:"An error occurred. Please try resetting your password again.",userEmailNotFound:"The email address you entered didn't match our records. You may have registered with a different email. Please try again.",authenticationFailed:"The email and password you entered did not match our records. Please try again.",thirdPartyAuthenticationFailed:function(n){return Loop.Core.Utils.stringFormat("Unable to login with {0}. Please try again or use a different method to sign in. ",n)},suspendedAccount:function(n,t){return Loop.Core.Utils.stringFormat("This email belongs to a de-activated account. Re-activate your account by contacting our support team at {0}<\/a> or use a different email address to create a new account.",t.replace("mailto:",""))},suspendedAccount2:function(n,t){return Loop.Core.Utils.stringFormat("This email belongs to a de-activated account. Re-activate your account by contacting our support team at {0}<\/a> or use a different email address to create a new account.",t.replace("mailto:",""))},alreadyExistingOrInactiveAccount:function(){return"This email belongs to an existing account. Login or use a different address to create a new account."},genericErrorSaving:"Something went wrong while we were saving your changes. Please try again.",genericError:"Something went wrong. Please try again.",preconditionFailedNotHandledError:function(n){return Loop.Core.Utils.stringFormat("Something went wrong ({0} - '{1}'). Please try again.",n.Code,n.Message||"Unknown")},invalidResetCode:"The reset password link you are using is not valid. Please copy and paste the URL in the email you received into your browser, or reset your password again.",verificationError:"This link is no longer valid. Log in to receive a new activation email.",forgotPasswordSuccess:"Instructions on how to reset your password will be sent if the email address provided matches one in our records. If you don’t receive an email within a few minutes, please check your spam folder.",twitterResetPasswordSuccess:"We’ve sent instructions to set your new password if the email address provided matches one in our records. If you don’t receive an email within a few minutes, please check your spam folder.",passwordResetSuccess:"Your password has been successfully updated. You can now login using your new password.",twitterNewPasswordSuccess:"Success. Your password has been created.",registrationWithForgotPassword:"A registration has been started with email {0}. Please enter your new password below and complete the registration process.",translateServerMessage:function(n){if(n.indexOf("GE_")===0)switch(n){case"GE_ResetPassword_CopyLinkOrTryAgain":return"The reset password link you are using is not valid. Please copy and paste the URL in the email you received into your browser, or reset your password again.";case"GE_ResetPassword_Already_Reset":return"This reset password link has already been used. Please login or reset your password<\/a> again.";default:return n}else return n},registrationNotCompleted:"It looks like you started the registration process with this email address. Please continue to be able to login.",invitationEmailCouldNotBeAdded:function(n){return Loop.Core.Utils.stringFormat("The email address on which you received the invitation, is attached to another account. If you would like to merge these accounts, please contact our support office<\/a>.This is not mandatory, but please note, we will not be able to process the invitation you received.",n)},ipBlockedLogin:"It seems that you are having trouble logging into your account. Please try again later or use the Forgot Password link to reset your password.",passwordDoesnotMatch:"The confirmation password must match the password.",impersonationOperationForbidden:function(n){return"You cannot "+n+" while impersonating a user. Please quit the impersonation and try again."},linkAccountPageTitle:function(){return"Register with "+Registration.Configuration.branding.displayName()},linkAccountPageDescription:function(){return"You are about to register with "+Registration.Configuration.branding.displayName()+" using your Loop account."}};Registration.Constants.Fields={FIRST_MAX_LENGTH:150,EMAIL_MAX_LENGTH:150,PWD_MIN_LENGTH:8,PWD_MAX_LENGTH:50};Registration.Constants.PrecoditionErrorCodes={USER_NOT_FOUND:1,REGISTRATION_NOT_COMPLETED:2,CAPTCHA_ERROR:3,ERROR_SENDING_EMAIL:4,INVALID_RESET_CODE:5,AUTHENTICATION_FAILED:6,THIRD_PARTY_AUTHENTICATION_FAILED:61,INACTIVE_ACCOUNT:7,SUSPENDED_ACCOUNT:8,ERROR_ADDING_INVITED_EMAIL:10,ALREADY_EXISTING_ACCOUNT:11,NOT_STARTED_REGISTRATION:13,RETURN_URL_NOT_PARSED:14,ENCRYPTED_EMAIL_NOT_VALID:24,IP_BLOCKED_LOGIN:63,INVALID_AUTHENTICATION_TOKEN:64,NOT_LINKED_TO_TENANT:66,IMPERSONATION_OPERATION_FORBIDDEN:85};Registration.Constants.VerificationErrorCodes={USER_NOT_FOUND:1,USER_SUSPENDED:2,USER_NOT_ACTIVE:14,INVALID_EMAIL:3,INVALID_EMAIL_TOO_LONG:4,MISSING_EMAIL:5,MISSING_USER_ID:6,MISSING_VERIFICATION_CODE:15,EMAIL_NOT_FOUND:10,EMAIL_NOT_FOUND_FOR_USER:11,EMAIL_ALREADY_VERIFIED:12,INVALID_VERIFICATION_CODE:13};Registration.Constants.AlertTypes={SUCCESS:"alert alert-success",ERROR:"alert alert-error",WARNING:"alert alert-warning",INFO:"alert alert-info"};Registration.Constants.PageRoutes={Login:"people/login",OAuthLogin:"oAuth/login",OAuthConsent:"/oAuth/consent",DuplicatedAccount:"register/duplicate",Register00:"register",Register01:"register/step-1",RegisterSuccess:"register/success",ResendEmailValidation:"register/resend-activation-email",ForgotPassword:"password/forgot",ResetPassword:"password/reset",SecondaryEmailAdded:"register/secondary-email-added",LinkAccount:"register/link-account",TwitterLogin:"people/twitterlogin",TwitterNewPassword:"people/newpassword"};Registration.Constants.Transition={Speed:function(){return 400}};Registration.Constants.InvitationProcessingResult={Success:0,NoInvitation:1,EmailAddressOwnedByAnotherUser:2};Registration.Constants.ThirdPartyProvider={None:0,Facebook:1,LinkedIn:2,ESOT:4,Orcid:5};Registration.Constants.EmailProvider="email";Registration.Constants.ThirdPartyActionRequested={None:0,Register:1,Login:2};Registration.Constants.RequestAuthResult={None:0,FollowCallbackUrl:1,ActivationEmailSent:2,SecondaryEmailAdded:3};Registration.Constants.QueryStringsToKeep=["returnUrl","requestAuthToken","login_challenge","consent_challenge"];Loop.Core.EndpointRepository.addEndpoint({type:Loop.Core.Constants.EndpointType.PRIVATE,key:"Login",urlArgs:{},url:function(){return Registration.Configuration.urls.GetApi2Uri("/user/login")}});Loop.Core.EndpointRepository.addEndpoint({type:Loop.Core.Constants.EndpointType.PRIVATE,key:"Validate",urlArgs:{},url:function(){return Registration.Configuration.urls.GetApi3Uri("/login/validate")}});Loop.Core.EndpointRepository.addEndpoint({type:Loop.Core.Constants.EndpointType.PRIVATE,key:"LoginAccept",urlArgs:{},url:function(){return Registration.Configuration.urls.BaseSecureUrl+"/oauth/loginaccept"}});Loop.Core.EndpointRepository.addEndpoint({type:Loop.Core.Constants.EndpointType.PRIVATE,key:"LoginReject",urlArgs:{},url:function(){return Registration.Configuration.urls.BaseSecureUrl+"/oauth/loginreject"}});Loop.Core.EndpointRepository.addEndpoint({type:Loop.Core.Constants.EndpointType.PRIVATE,key:"ConsentAccept",urlArgs:{},url:function(){return Registration.Configuration.urls.BaseSecureUrl+"/oauth/consentaccept"}});Loop.Core.EndpointRepository.addEndpoint({type:Loop.Core.Constants.EndpointType.PRIVATE,key:"ConsentReject",urlArgs:{},url:function(){return Registration.Configuration.urls.BaseSecureUrl+"/oauth/consentreject"}});Loop.Core.EndpointRepository.addEndpoint({type:Loop.Core.Constants.EndpointType.PRIVATE,key:"Logout",urlArgs:{},url:function(){return Registration.Configuration.urls.GetApi2Uri("/user/logout")}});Loop.Core.EndpointRepository.addEndpoint({type:Loop.Core.Constants.EndpointType.PRIVATE,key:"RegisterStep0",urlArgs:{},url:function(){return Registration.Configuration.urls.GetApi2Uri("/user/register/step0")}});Loop.Core.EndpointRepository.addEndpoint({type:Loop.Core.Constants.EndpointType.PRIVATE,key:"RegisterStep1Load",urlArgs:{},url:function(){return Registration.Configuration.urls.GetApi2Uri("/user/register/step1")}});Loop.Core.EndpointRepository.addEndpoint({type:Loop.Core.Constants.EndpointType.PRIVATE,key:"RegisterFriendlyCaptchaValidation",urlArgs:{},url:function(){return Registration.Configuration.urls.GetApi3Uri("/captcha/validate")}});Loop.Core.EndpointRepository.addEndpoint({type:Loop.Core.Constants.EndpointType.PRIVATE,key:"RegisterStep1",urlArgs:{},url:function(){return Registration.Configuration.urls.GetApi2Uri("/user/register/step1")}});Loop.Core.EndpointRepository.addEndpoint({type:Loop.Core.Constants.EndpointType.PRIVATE,key:"ForgotPassword",urlArgs:{},url:function(){return Registration.Configuration.urls.GetApi2Uri("/users/password/forgot")}});Loop.Core.EndpointRepository.addEndpoint({type:Loop.Core.Constants.EndpointType.PRIVATE,key:"TwitterPasswordReset",urlArgs:{},url:function(){return Registration.Configuration.urls.GetApi2Uri("/users/password/twitterPasswordReset")}});Loop.Core.EndpointRepository.addEndpoint({type:Loop.Core.Constants.EndpointType.PRIVATE,key:"ResetPassword",urlArgs:{},url:function(){return Registration.Configuration.urls.GetApi2Uri("/users/password/reset")}});Loop.Core.EndpointRepository.addEndpoint({type:Loop.Core.Constants.EndpointType.PRIVATE,key:"Success",urlArgs:{},url:function(){return Registration.Configuration.urls.GetApi2Uri("/success")}});Loop.Core.EndpointRepository.addEndpoint({type:Loop.Core.Constants.EndpointType.PRIVATE,key:"ValidateCaptcha",urlArgs:{},url:function(){return Registration.Configuration.urls.GetApi2Uri("/api/v2/captcha/try")}});Loop.Core.EndpointRepository.addEndpoint({type:Loop.Core.Constants.EndpointType.PRIVATE,key:"ResendEmailValidation",urlArgs:{},url:function(){return Registration.Configuration.urls.GetApi2Uri("/user/email/resend")}});Loop.Core.EndpointRepository.addEndpoint({type:Loop.Core.Constants.EndpointType.PRIVATE,key:"AcceptTermsAndConditions",urlArgs:{},url:function(){return Registration.Configuration.urls.GetApi2Uri("/terms-and-conditions/accept")}});Loop.Core.EndpointRepository.addEndpoint({type:Loop.Core.Constants.EndpointType.PRIVATE,key:"AutoLogin",urlArgs:{},url:function(){return Registration.Configuration.urls.GetApi2Uri("/user/autologin")}});Loop.Core.EndpointRepository.addEndpoint({type:Loop.Core.Constants.EndpointType.PUBLIC,key:"CheckLoggedInIdentity",urlArgs:{},url:function(){return Registration.Configuration.urls.IdentityProviderBaseUrl+"/api/v2/user/loggedin"}});window.Registration=window.Registration||{};Registration.Controls=Registration.Controls||{};Registration.Controls.PasswordInput=function(n){function h(){function h(n){if(typeof n.applyExtraValidations!="boolean")throw new Error("options.applyExtraValidations must be bool");if(n.onEnterKeyPress&&typeof n.onEnterKeyPress!="function")throw new Error("options.onEnterKeyPress must be a function if it is not undefined or null");}var s=jQuery.extend(!0,{},u,n);h(s);t.placeholder=s.placeholder;t.onEnterKeyPress=s.onEnterKeyPress;t.onKeyPress=s.onKeyPress;o(s.showTip);t.isDisabled(s.isDisabled);f=ko.observable(s.applyRequiredFieldValidation);r=ko.observable(s.applyExtraValidations);e=ko.observable(s.applySameTextValidations);t.sameTextReference=ko.observable(s.sameTextReference);typeof s.validationFlag=="function"&&(i=s.validationFlag);t.value=ko.observable().extend({required:{message:Registration.Constants.UIMessages.requiredField,onlyIf:function(){return i()&&(r()||f())}},minLength:{params:Registration.Constants.Fields.PWD_MIN_LENGTH,message:Registration.Constants.UIMessages.requiredWithMinLength(Registration.Constants.Fields.PWD_MIN_LENGTH),onlyIf:function(){return i()&&r()}},maxLength:{params:Registration.Constants.Fields.PWD_MAX_LENGTH,message:Registration.Constants.UIMessages.limitExceded(Registration.Constants.Fields.PWD_MAX_LENGTH),onlyIf:function(){return i()&&r()}},mustEqual:{params:t.sameTextReference,message:Registration.Constants.UIMessages.passwordDoesnotMatch,onlyIf:function(){return i()&&e()}}})}var t=this,i=ko.observable(!1),f=ko.observable(!0),r=ko.observable(!0),e=ko.observable(!1),o=ko.observable(!1),s=ko.observable(!1),u={placeholder:"Password *",applyExtraValidations:!1,applySameTextValidations:!1,sameTextReference:"",validationFlag:null,onEnterKeyPress:function(){},showTip:o(),isDisabled:!1,applyRequiredFieldValidation:!0};t.value=null;t.placeholder=u.placeholder;t.passwordInputType=ko.observable("password");t.showPassword=function(){t.passwordInputType(t.passwordInputType()==="password"?"text":"password")};t.validate=function(){i(!0)};t.onEnterKeyPress=u.onEnterKeyPress;t.onFocus=function(){s(!0)};t.onBlur=function(){setTimeout(function(){s(!1)},200)};t.showTip=ko.computed(function(){return o()&&s()});t.infoMessage=ko.observable();t.isDisabled=ko.observable(u.isDisabled);t.updateApplyExtraValidations=function(n){r(n)};t.updateApplySameTextValidations=function(n){e(n)};t.updateApplyRequiredValidations=function(n){f(n)};h()};window.Registration=window.Registration||{};Registration.Controls=Registration.Controls||{};Registration.Controls.Captcha=function(){function t(){n.isResponded(!0);n.hasFailed(!1);n.errorMessage("");n.validate()}function i(){n.hasFailed(!0);n.isResponded(!0);n.validate()}var n=this;n.captchaProofCode=null;n.errorMessage=ko.observable(null);n.visible=!0;n.isResponded=ko.observable(!1);n.hasFailed=ko.observable(!1);n.destroy=ko.observable(null);n.sessionToken=null;n.validate=function(){n.hasFailed()&&n.isResponded()?n.errorMessage(Registration.Constants.UIMessages.invalidCaptcha):n.isResponded()||(n.hasFailed(!0),n.errorMessage(Registration.Constants.UIMessages.captchaRequired))};n.validateCaptchaSolution=function(r){if(n.sessionToken==null)throw new Error("session token should not be null");var u=Loop.Core.EndpointRepository.getEndpoint("RegisterFriendlyCaptchaValidation"),f={CaptchaToken:r,SessionId:n.sessionToken};Loop.Core.Ajax.createData({loginRequired:!1,withCredentials:!0,endpoint:u,inputData:JSON.stringify(f),successCallback:t,errorCallback:i})}};window.Registration=window.Registration||{};Registration.Controls=Registration.Controls||{};Registration.Controls.Dropdown=function(n){function u(){function e(n){if(typeof n.applyExtraValidations!="boolean")throw new Error("options.applyExtraValidations must be bool");}var u=jQuery.extend(!0,{},i,n),f;t.optionText=u.optionText;t.optionValue=u.optionValue;t.optionSubobject=u.optionSubobject;t.optionCaption(u.optionCaption);t.loadOptions(u.availableOptions);t.disabled(u.disabled);t.half(u.half);r=u.validationFlag;t.optionSelected=u.isRequired?ko.observable(u.optionSelected).extend({required:{message:Registration.Constants.UIMessages.requiredField,onlyIf:r}}):ko.observable(u.optionSelected);f=ko.validation.group(t,{deep:!0});isFormValid=ko.computed(function(){return f().length===0});e(u)}var t=this,r=ko.observable(!1),i={availableOptions:[],optionCaption:"Select...",optionText:"text",optionValue:"value",optionSubobject:null,applyExtraValidations:!1,half:!1,disabled:!1,isRequired:!1};t.optionSelected=null;t.half=ko.observable(i.half);t.disabled=ko.observable(i.disabled);t.optionText=i.optionText;t.optionValue=i.optionValue;t.optionSubobject=i.optionSubobject;t.optionCaption=ko.observable(i.optionCaption);t.availableOptions=ko.observableArray(i.availableOptions);t.refreshOptions=function(n){t.optionSelected(null);t.availableOptions([]);t.loadOptions(n)};t.loadOptions=function(n){for(var r=[],i=0;i=r-60?(n.parent().addClass("p-noright"),n.css("rigth","auto"),n.parent().hasClass("top-tile")?n.css("top","30 px"):n.css("top",-f-46+"px"),i>=t/2?n.css("left",-t/2):n.css("left",-i+15)):n.parent().removeClass("")}function t(t){function f(t){i.removeClass("arrow-popover");u.removeClass("open-popover");$(this).children().addClass("open-popover");$(this).addClass("arrow-popover");n($(this).children());t.stopPropagation()}function e(n){$(this).parent().removeClass("open-popover");$(this).parent().parent().removeClass("arrow-popover");n.stopPropagation()}var o=window.innerWidth,i=t.find(".info-popover"),r=t.find(".close-popover"),u=t.find(".popover-container");i.click(f);r.click(e)}function i(){function i(){var t=$(".popover-container");n(t)}t($("body"));$("body").on("DOMNodeInserted",function(n){t($(n.target))});$(document).click(function(n){var t=$(n.target).closest(".popover-container"),i=$(".info-popover"),r=$(".popover-container");t.length===0&&(i.removeClass("arrow-popover"),r.removeClass("open-popover"))});$(window).resize(function(){setTimeout(i,500)})}return{initInfoPopovers:i}}();Registration=Registration||{};Registration.Helpers=Registration.Helpers||{};Registration.Helpers.googleAnalytics=function(){function i(){var r=document.location.hostname,n=r.split("."),i=n.length,u="."+n[i-2]+"."+n[i-1];t=u}function r(){(function(n,t,i,r,u,f,e){n.GoogleAnalyticsObject=u;n[u]=n[u]||function(){(n[u].q=n[u].q||[]).push(arguments)};n[u].l=1*new Date;f=t.createElement(i);e=t.getElementsByTagName(i)[0];f.async=1;f.src=r;e.parentNode.insertBefore(f,e)})(window,document,"script","//www.google-analytics.com/analytics.js","ga")}function u(u){if(n=u,i(),r(),!n)throw new Error('Google analytic code cannot be "'+n+'".');return ga("create",n,t),Registration.Helpers.googleAnalytics}var t="",n="";return{getCode:function(){return n},getDomain:function(){return t},init:u,track:function(){ga("send","pageview")}}}();window.Registration=window.Registration||{};Registration.Helpers=Registration.Helpers||{};Registration.Helpers.UrlHelper=function(){function i(){for(var f=[],i,u=t.slice(t.indexOf("?")+1).split("&"),r=0;r1&&(f[i[0].toLowerCase()]=decodeURIComponent(i[1]));n=f}function r(t){return n[t.toLowerCase()]}function u(t){for(var i in n)t+=(t.indexOf("?")>-1?"&":"?")+i+"="+n[i];return t}function f(t){delete n[t.toLowerCase()]}var n=[],t=window.location.toString();return i(),{originalUri:function(){return t},getQueryString:r,getUrlWithQuerystring:u,deleteQueryStringParameter:f}}();window.Registration=window.Registration||{};Registration.Helpers=Registration.Helpers||{};Registration.Helpers.locationHelper=function(){function n(){var n=t();return n===""?n:n.substring(n.lastIndexOf(".",n.lastIndexOf(".")-1)+1)}function t(){return window.location.hostname}return{getCurrentDomain:n,redirect:function(n){window.location=n},getPathName:function(){return window.location.pathname}}}()