#pragma checksum "/run/media/yla/Dataa/Work/Programming/AllProjects/MainProgram/UI/Libs/Modules/AuthModule/Components/Pages/Auths/ChangePassword/ResetPassword.razor" "{8829d00f-11b8-4213-878b-770e8597ac16}" "3b609a7f5368f205a2d795a21ab5607907a3255310aa84282c1a9d2c28dd5839"
// <auto-generated/>
#pragma warning disable 1591
namespace AuthModule.Components.Pages.Auths.ChangePassword
{
    #line default
    using global::System;
    using global::System.Collections.Generic;
    using global::System.Linq;
    using global::System.Threading.Tasks;
    using global::Microsoft.AspNetCore.Components;
#nullable restore
#line (2,2)-(2,33) "/run/media/yla/Dataa/Work/Programming/AllProjects/MainProgram/UI/Libs/Modules/AuthModule/_Imports.razor"
using Auth.Contracts.DTOs.Users

#nullable disable
    ;
#nullable restore
#line (3,2)-(3,32) "/run/media/yla/Dataa/Work/Programming/AllProjects/MainProgram/UI/Libs/Modules/AuthModule/_Imports.razor"
using Auth.Contracts.DTOs.Auth

#nullable disable
    ;
#nullable restore
#line (4,2)-(4,27) "/run/media/yla/Dataa/Work/Programming/AllProjects/MainProgram/UI/Libs/Modules/AuthModule/_Imports.razor"
using AuthModule.Services

#nullable disable
    ;
#nullable restore
#line (5,2)-(5,42) "/run/media/yla/Dataa/Work/Programming/AllProjects/MainProgram/UI/Libs/Modules/AuthModule/_Imports.razor"
using Microsoft.AspNetCore.Authorization

#nullable disable
    ;
#nullable restore
#line (6,2)-(6,53) "/run/media/yla/Dataa/Work/Programming/AllProjects/MainProgram/UI/Libs/Modules/AuthModule/_Imports.razor"
using Microsoft.AspNetCore.Components.Authorization

#nullable disable
    ;
#nullable restore
#line (7,2)-(7,28) "/run/media/yla/Dataa/Work/Programming/AllProjects/MainProgram/UI/Libs/Modules/AuthModule/_Imports.razor"
using LayoutLib.Components

#nullable disable
    ;
#nullable restore
#line (9,2)-(9,17) "/run/media/yla/Dataa/Work/Programming/AllProjects/MainProgram/UI/Libs/Modules/AuthModule/_Imports.razor"
using MudBlazor

#nullable disable
    ;
#nullable restore
#line (10,2)-(10,23) "/run/media/yla/Dataa/Work/Programming/AllProjects/MainProgram/UI/Libs/Modules/AuthModule/_Imports.razor"
using Auth.Contracts;

#nullable disable
#nullable restore
#line (13,2)-(13,23) "/run/media/yla/Dataa/Work/Programming/AllProjects/MainProgram/UI/Libs/Modules/AuthModule/_Imports.razor"
using System.Net.Http

#nullable disable
    ;
#nullable restore
#line (14,2)-(14,28) "/run/media/yla/Dataa/Work/Programming/AllProjects/MainProgram/UI/Libs/Modules/AuthModule/_Imports.razor"
using System.Net.Http.Json

#nullable disable
    ;
#nullable restore
#line (15,2)-(15,45) "/run/media/yla/Dataa/Work/Programming/AllProjects/MainProgram/UI/Libs/Modules/AuthModule/_Imports.razor"
using Microsoft.AspNetCore.Components.Forms

#nullable disable
    ;
#nullable restore
#line (16,2)-(16,47) "/run/media/yla/Dataa/Work/Programming/AllProjects/MainProgram/UI/Libs/Modules/AuthModule/_Imports.razor"
using Microsoft.AspNetCore.Components.Routing

#nullable disable
    ;
#nullable restore
#line (17,2)-(17,43) "/run/media/yla/Dataa/Work/Programming/AllProjects/MainProgram/UI/Libs/Modules/AuthModule/_Imports.razor"
using Microsoft.AspNetCore.Components.Web

#nullable disable
    ;
#nullable restore
#line (18,2)-(18,58) "/run/media/yla/Dataa/Work/Programming/AllProjects/MainProgram/UI/Libs/Modules/AuthModule/_Imports.razor"
using Microsoft.AspNetCore.Components.Web.Virtualization

#nullable disable
    ;
    #line default
    #line hidden
    [global::Microsoft.AspNetCore.Components.LayoutAttribute(typeof(
#nullable restore
#line (2,9)-(2,20) "/run/media/yla/Dataa/Work/Programming/AllProjects/MainProgram/UI/Libs/Modules/AuthModule/Components/Pages/Auths/ChangePassword/ResetPassword.razor"
EmptyLayout

#line default
#line hidden
#nullable disable
    ))]
    [global::Microsoft.AspNetCore.Components.RouteAttribute(
    // language=Route,Component
#nullable restore
#line (1,7)-(1,41) "/run/media/yla/Dataa/Work/Programming/AllProjects/MainProgram/UI/Libs/Modules/AuthModule/Components/Pages/Auths/ChangePassword/ResetPassword.razor"
"/account/reset-password/{*token}"

#line default
#line hidden
#nullable disable
    )]
    #nullable restore
    public partial class ResetPassword : global::Microsoft.AspNetCore.Components.ComponentBase
    #nullable disable
    {
        #pragma warning disable 1998
        protected override void BuildRenderTree(global::Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder __builder)
        {
            __builder.OpenComponent<global::Microsoft.AspNetCore.Components.Forms.EditForm>(0);
            __builder.AddComponentParameter(1, nameof(global::Microsoft.AspNetCore.Components.Forms.EditForm.
#nullable restore
#line (6,11)-(6,22) "/run/media/yla/Dataa/Work/Programming/AllProjects/MainProgram/UI/Libs/Modules/AuthModule/Components/Pages/Auths/ChangePassword/ResetPassword.razor"
EditContext

#line default
#line hidden
#nullable disable
            ), global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck<global::Microsoft.AspNetCore.Components.Forms.EditContext>(
#nullable restore
#line (6,24)-(6,26) "/run/media/yla/Dataa/Work/Programming/AllProjects/MainProgram/UI/Libs/Modules/AuthModule/Components/Pages/Auths/ChangePassword/ResetPassword.razor"
ec

#line default
#line hidden
#nullable disable
            ));
            __builder.AddComponentParameter(2, nameof(global::Microsoft.AspNetCore.Components.Forms.EditForm.
#nullable restore
#line (6,28)-(6,41) "/run/media/yla/Dataa/Work/Programming/AllProjects/MainProgram/UI/Libs/Modules/AuthModule/Components/Pages/Auths/ChangePassword/ResetPassword.razor"
OnValidSubmit

#line default
#line hidden
#nullable disable
            ), global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck<global::Microsoft.AspNetCore.Components.EventCallback<global::Microsoft.AspNetCore.Components.Forms.EditContext>>(global::Microsoft.AspNetCore.Components.EventCallback.Factory.Create<global::Microsoft.AspNetCore.Components.Forms.EditContext>(this, 
#nullable restore
#line (6,43)-(6,48) "/run/media/yla/Dataa/Work/Programming/AllProjects/MainProgram/UI/Libs/Modules/AuthModule/Components/Pages/Auths/ChangePassword/ResetPassword.razor"
Reset

#line default
#line hidden
#nullable disable
            )));
            __builder.AddComponentParameter(3, "class", "container px-5 py-24 mx-auto flex flex-wrap items-center");
            __builder.AddAttribute(4, "ChildContent", (global::Microsoft.AspNetCore.Components.RenderFragment<global::Microsoft.AspNetCore.Components.Forms.EditContext>)((context) => (__builder2) => {
                __builder2.OpenElement(5, "div");
                __builder2.AddAttribute(6, "class", "lg:w-2/6 md:w-1/2 bg-gray-100 rounded-lg p-8 flex flex-col mx-auto w-full mt-10 md:mt-0");
                __builder2.AddMarkupContent(7, "<h2 class=\"text-gray-900 text-lg font-medium title-font mb-5\">Reset your Password</h2>\n\n\n        ");
                __builder2.OpenElement(8, "div");
                __builder2.AddAttribute(9, "class", "relative mb-4");
                __builder2.AddMarkupContent(10, "<label for=\"email\" class=\"leading-7 text-sm text-gray-600\">Email</label>\n            ");
                __builder2.OpenComponent<global::Microsoft.AspNetCore.Components.Forms.InputText>(11);
                __builder2.AddComponentParameter(12, "type", "email");
                __builder2.AddComponentParameter(13, "placeholder", "Email");
                __builder2.AddComponentParameter(14, "id", "email");
                __builder2.AddComponentParameter(15, "class", "w-full bg-white rounded border border-gray-300 focus:border-indigo-500 focus:ring-2 focus:ring-indigo-200 text-base outline-none text-gray-700 py-1 px-3 leading-8 transition-colors duration-200 ease-in-out");
                __builder2.AddComponentParameter(16, nameof(global::Microsoft.AspNetCore.Components.Forms.InputText.
#nullable restore
#line (14,63)-(14,68) "/run/media/yla/Dataa/Work/Programming/AllProjects/MainProgram/UI/Libs/Modules/AuthModule/Components/Pages/Auths/ChangePassword/ResetPassword.razor"
Value

#line default
#line hidden
#nullable disable
                ), global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck<global::System.String>(
#nullable restore
#line (14,70)-(14,94) "/run/media/yla/Dataa/Work/Programming/AllProjects/MainProgram/UI/Libs/Modules/AuthModule/Components/Pages/Auths/ChangePassword/ResetPassword.razor"
passwordResetModel.Email

#line default
#line hidden
#nullable disable
                ));
                __builder2.AddComponentParameter(17, nameof(global::Microsoft.AspNetCore.Components.Forms.InputText.ValueChanged), global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck<global::Microsoft.AspNetCore.Components.EventCallback<global::System.String>>(global::Microsoft.AspNetCore.Components.EventCallback.Factory.Create<global::System.String>(this, global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.CreateInferredEventCallback(this, __value => passwordResetModel.Email = __value, passwordResetModel.Email))));
                __builder2.AddComponentParameter(18, nameof(global::Microsoft.AspNetCore.Components.Forms.InputText.ValueExpression), global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck<global::System.Linq.Expressions.Expression<global::System.Func<global::System.String>>>(() => passwordResetModel.Email));
                __builder2.CloseComponent();
                __builder2.CloseElement();
                __builder2.AddMarkupContent(19, "\n\n        ");
                __builder2.OpenElement(20, "div");
                __builder2.AddAttribute(21, "class", "relative mb-4");
                __builder2.AddMarkupContent(22, "<label for=\"password\" class=\"leading-7 text-sm text-gray-600\">Password</label>\n            ");
                __builder2.OpenComponent<global::Microsoft.AspNetCore.Components.Forms.InputText>(23);
                __builder2.AddComponentParameter(24, "type", "password");
                __builder2.AddComponentParameter(25, "placeholder", "Password");
                __builder2.AddComponentParameter(26, "id", "password");
                __builder2.AddComponentParameter(27, "class", "w-full bg-white rounded border border-gray-300 focus:border-indigo-500 focus:ring-2 focus:ring-indigo-200 text-base outline-none text-gray-700 py-1 px-3 leading-8 transition-colors duration-200 ease-in-out");
                __builder2.AddComponentParameter(28, nameof(global::Microsoft.AspNetCore.Components.Forms.InputText.
#nullable restore
#line (21,69)-(21,74) "/run/media/yla/Dataa/Work/Programming/AllProjects/MainProgram/UI/Libs/Modules/AuthModule/Components/Pages/Auths/ChangePassword/ResetPassword.razor"
Value

#line default
#line hidden
#nullable disable
                ), global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck<global::System.String>(
#nullable restore
#line (21,76)-(21,103) "/run/media/yla/Dataa/Work/Programming/AllProjects/MainProgram/UI/Libs/Modules/AuthModule/Components/Pages/Auths/ChangePassword/ResetPassword.razor"
passwordResetModel.Password

#line default
#line hidden
#nullable disable
                ));
                __builder2.AddComponentParameter(29, nameof(global::Microsoft.AspNetCore.Components.Forms.InputText.ValueChanged), global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck<global::Microsoft.AspNetCore.Components.EventCallback<global::System.String>>(global::Microsoft.AspNetCore.Components.EventCallback.Factory.Create<global::System.String>(this, global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.CreateInferredEventCallback(this, __value => passwordResetModel.Password = __value, passwordResetModel.Password))));
                __builder2.AddComponentParameter(30, nameof(global::Microsoft.AspNetCore.Components.Forms.InputText.ValueExpression), global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck<global::System.Linq.Expressions.Expression<global::System.Func<global::System.String>>>(() => passwordResetModel.Password));
                __builder2.CloseComponent();
                __builder2.CloseElement();
                __builder2.AddMarkupContent(31, "\n\n\n        ");
                __builder2.AddMarkupContent(32, "<button type=\"submit\" class=\"text-white mt-4 bg-indigo-500 border-0 py-2 px-8 focus:outline-none hover:bg-indigo-600 rounded text-lg\">Reset\n            Password</button>\n        ");
                __builder2.OpenElement(33, "p");
                __builder2.AddAttribute(34, "class", "text-md" + " text-center" + " font-bold" + " " + (
#nullable restore
#line (30,51)-(30,99) "/run/media/yla/Dataa/Work/Programming/AllProjects/MainProgram/UI/Libs/Modules/AuthModule/Components/Pages/Auths/ChangePassword/ResetPassword.razor"
isSuccessful ? "text-green-500" : "text-red-500"

#line default
#line hidden
#nullable disable
                ) + " mt-4");
#nullable restore
#line (30,108)-(30,121) 26 "/run/media/yla/Dataa/Work/Programming/AllProjects/MainProgram/UI/Libs/Modules/AuthModule/Components/Pages/Auths/ChangePassword/ResetPassword.razor"
__builder2.AddContent(35, resultMessage

#line default
#line hidden
#nullable disable
                );
                __builder2.CloseElement();
                __builder2.CloseElement();
            }
            ));
            __builder.CloseComponent();
        }
        #pragma warning restore 1998
#nullable restore
#line (38,8)-(44,5) "/run/media/yla/Dataa/Work/Programming/AllProjects/MainProgram/UI/Libs/Modules/AuthModule/Components/Pages/Auths/ChangePassword/ResetPassword.razor"


    [Parameter]
    public string Token { get; set; }

    PasswordResetModel passwordResetModel = new();
    

#line default
#line hidden
#nullable disable

#nullable restore
#line (44,43)-(73,1) "/run/media/yla/Dataa/Work/Programming/AllProjects/MainProgram/UI/Libs/Modules/AuthModule/Components/Pages/Auths/ChangePassword/ResetPassword.razor"


    string resultMessage = "";

    bool isSuccessful = false;
    EditContext ec;

    protected override async Task OnInitializedAsync()
    {
        ec = new EditContext(passwordResetModel);
    }

    async Task Reset()
    {
        resultMessage = "";
        passwordResetModel.Token = Token;
        if (ec.Validate())
        {
            isSuccessful = await userAPIConsumer.ResetPassword(passwordResetModel);
            if (isSuccessful)
                resultMessage = "Password reset successful.";
            else
                resultMessage = "Error, Try Again later";



        }
    }


#line default
#line hidden
#nullable disable

        [global::Microsoft.AspNetCore.Components.InjectAttribute] private 
#nullable restore
#line (3,9)-(3,24) "/run/media/yla/Dataa/Work/Programming/AllProjects/MainProgram/UI/Libs/Modules/AuthModule/Components/Pages/Auths/ChangePassword/ResetPassword.razor"
UserAPIConsumer

#line default
#line hidden
#nullable disable
         
#nullable restore
#line (3,25)-(3,40) "/run/media/yla/Dataa/Work/Programming/AllProjects/MainProgram/UI/Libs/Modules/AuthModule/Components/Pages/Auths/ChangePassword/ResetPassword.razor"
userAPIConsumer

#line default
#line hidden
#nullable disable
         { get; set; }
         = default!;
    }
}
#pragma warning restore 1591
