System.register(["./p-c4df9d4b.system.js","./p-637a7d5a.system.js","./p-4785c63b.system.js","./p-dfb1d72b.system.js","./p-58f2f536.system.js","./p-d86a8e66.system.js"],(function(e){"use strict";var r,t,s,i,n;return{setters:[function(e){r=e.r;t=e.h},function(e){s=e.T},function(e){i=e.V},function(e){n=e.V},function(){},function(){}],execute:function(){var o=function(e){return[new s("firstName","","First name","").setValue(e.firstName).setErrorTitle("Name").require(),new s("lastName","","Last name","").setValue(e.lastName).setErrorTitle("Surname").require(),new s("email","","Email","","email").setValue(e.email).setErrorTitle("Email").addInterceptor("onSubmit",new i).require(),new s("password","","Password","","password").setErrorTitle("Password").addInterceptor("onSubmit",new n(6,24)).require()]};function a(e){if(!e){return undefined}if(e.status===401){return["Credentials are not valid."]}else{return["Unexpected error."]}}var u=e("kimlik_register_form",function(){function e(e){var t=this;r(this,e);this.data={};this.onSubmit=function(e){var r=e.detail.values;var s=r.email,i=r.firstName,n=r.lastName,o=r.password;t.progressing=true;t.api.register(s,i,n,o).then(t.onSucceed,t.onError)};this.onSucceed=function(e){t.api.addAuthInterceptor(e.jwt);t.progressing=false;if(t.onRegister){t.onRegister(e)}if(t.redirect){window.location=t.redirect}};this.onError=function(e){t.error=e;t.progressing=false}}e.prototype.render=function(){var e=this,r=e.data,s=e.error,i=e.progressing;return t("doldurma-form",{fields:o(r),onSubmit:this.onSubmit,submitButtonLabel:"Register",progressing:i,formErrors:a(s)})};return e}())}}}));