#pragma checksum "C:\Users\jayt7\Source\Repos\Senior-Project\SPWA\Pages\Projects.razor" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "b85f43099b5a41e9cf7e3314e3ccd49c99e331d7"
// <auto-generated/>
#pragma warning disable 1591
namespace SPWA.Pages
{
    #line hidden
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Threading.Tasks;
    using Microsoft.AspNetCore.Components;
#nullable restore
#line 2 "C:\Users\jayt7\Source\Repos\Senior-Project\SPWA\_Imports.razor"
using System.Net.Http;

#line default
#line hidden
#nullable disable
#nullable restore
#line 3 "C:\Users\jayt7\Source\Repos\Senior-Project\SPWA\_Imports.razor"
using Microsoft.AspNetCore.Authorization;

#line default
#line hidden
#nullable disable
#nullable restore
#line 4 "C:\Users\jayt7\Source\Repos\Senior-Project\SPWA\_Imports.razor"
using Microsoft.AspNetCore.Components.Authorization;

#line default
#line hidden
#nullable disable
#nullable restore
#line 5 "C:\Users\jayt7\Source\Repos\Senior-Project\SPWA\_Imports.razor"
using Microsoft.AspNetCore.Components.Forms;

#line default
#line hidden
#nullable disable
#nullable restore
#line 6 "C:\Users\jayt7\Source\Repos\Senior-Project\SPWA\_Imports.razor"
using Microsoft.AspNetCore.Components.Routing;

#line default
#line hidden
#nullable disable
#nullable restore
#line 7 "C:\Users\jayt7\Source\Repos\Senior-Project\SPWA\_Imports.razor"
using Microsoft.AspNetCore.Components.Web;

#line default
#line hidden
#nullable disable
#nullable restore
#line 8 "C:\Users\jayt7\Source\Repos\Senior-Project\SPWA\_Imports.razor"
using Microsoft.JSInterop;

#line default
#line hidden
#nullable disable
#nullable restore
#line 9 "C:\Users\jayt7\Source\Repos\Senior-Project\SPWA\_Imports.razor"
using SPWA;

#line default
#line hidden
#nullable disable
#nullable restore
#line 10 "C:\Users\jayt7\Source\Repos\Senior-Project\SPWA\_Imports.razor"
using SPWA.Shared;

#line default
#line hidden
#nullable disable
#nullable restore
#line 11 "C:\Users\jayt7\Source\Repos\Senior-Project\SPWA\_Imports.razor"
using MatBlazor;

#line default
#line hidden
#nullable disable
#nullable restore
#line 12 "C:\Users\jayt7\Source\Repos\Senior-Project\SPWA\_Imports.razor"
using BlazorInputFile;

#line default
#line hidden
#nullable disable
#nullable restore
#line 14 "C:\Users\jayt7\Source\Repos\Senior-Project\SPWA\_Imports.razor"
using Microsoft.AspNetCore.DataProtection;

#line default
#line hidden
#nullable disable
#nullable restore
#line 15 "C:\Users\jayt7\Source\Repos\Senior-Project\SPWA\_Imports.razor"
using SPWA.LoginFeatures.Account.Pages.GoogleLogin;

#line default
#line hidden
#nullable disable
#nullable restore
#line 2 "C:\Users\jayt7\Source\Repos\Senior-Project\SPWA\Pages\Projects.razor"
using Project.Data;

#line default
#line hidden
#nullable disable
#nullable restore
#line 3 "C:\Users\jayt7\Source\Repos\Senior-Project\SPWA\Pages\Projects.razor"
using Project.Data.Project;

#line default
#line hidden
#nullable disable
#nullable restore
#line 4 "C:\Users\jayt7\Source\Repos\Senior-Project\SPWA\Pages\Projects.razor"
using Microsoft.AspNetCore.Identity;

#line default
#line hidden
#nullable disable
#nullable restore
#line 5 "C:\Users\jayt7\Source\Repos\Senior-Project\SPWA\Pages\Projects.razor"
using SPWA.DataAccess.Data;

#line default
#line hidden
#nullable disable
    [Microsoft.AspNetCore.Components.RouteAttribute("/projects")]
    public partial class Projects : OwningComponentBase<ProjectService>
    {
        #pragma warning disable 1998
        protected override void BuildRenderTree(Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder __builder)
        {
            __builder.AddMarkupContent(0, "<h1>Projects</h1>\r\n\r\n\r\n");
#nullable restore
#line 21 "C:\Users\jayt7\Source\Repos\Senior-Project\SPWA\Pages\Projects.razor"
 if (projects == null)
{

#line default
#line hidden
#nullable disable
            __builder.AddMarkupContent(1, "    \r\n    ");
            __builder.AddMarkupContent(2, "<p><em>Loading...</em></p>\r\n");
#nullable restore
#line 25 "C:\Users\jayt7\Source\Repos\Senior-Project\SPWA\Pages\Projects.razor"
}
else
{

#line default
#line hidden
#nullable disable
            __builder.AddContent(3, "    ");
            __builder.OpenElement(4, "div");
            __builder.AddAttribute(5, "class", "mat-layout-grid");
            __builder.AddMarkupContent(6, "\r\n        ");
            __builder.OpenElement(7, "div");
            __builder.AddAttribute(8, "class", "mat-layout-grid-inner");
            __builder.AddMarkupContent(9, "\r\n");
#nullable restore
#line 30 "C:\Users\jayt7\Source\Repos\Senior-Project\SPWA\Pages\Projects.razor"
             foreach (var project in projects)
            {

#line default
#line hidden
#nullable disable
            __builder.AddContent(10, "                ");
            __builder.OpenElement(11, "div");
            __builder.AddAttribute(12, "class", "mat-layout-grid-cell");
            __builder.AddMarkupContent(13, "\r\n                    ");
            __builder.OpenComponent<MatBlazor.MatCard>(14);
            __builder.AddAttribute(15, "class", "mat-card-test");
            __builder.AddAttribute(16, "ChildContent", (Microsoft.AspNetCore.Components.RenderFragment)((__builder2) => {
                __builder2.AddMarkupContent(17, "\r\n                        ");
                __builder2.OpenComponent<MatBlazor.MatCardContent>(18);
                __builder2.AddAttribute(19, "onclick", Microsoft.AspNetCore.Components.EventCallback.Factory.Create<Microsoft.AspNetCore.Components.Web.MouseEventArgs>(this, 
#nullable restore
#line 34 "C:\Users\jayt7\Source\Repos\Senior-Project\SPWA\Pages\Projects.razor"
                                                  (() => NavigateToProject(project.Id))

#line default
#line hidden
#nullable disable
                ));
                __builder2.AddAttribute(20, "ChildContent", (Microsoft.AspNetCore.Components.RenderFragment)((__builder3) => {
                    __builder3.AddMarkupContent(21, "\r\n                            ");
                    __builder3.OpenElement(22, "mat-card-header");
                    __builder3.AddAttribute(23, "style", "background-color:dodgerblue;");
                    __builder3.AddMarkupContent(24, "\r\n                                ");
                    __builder3.OpenElement(25, "mat-card-title-group");
                    __builder3.AddMarkupContent(26, "\r\n                                    ");
                    __builder3.OpenElement(27, "mat-card-title");
                    __builder3.AddMarkupContent(28, "\r\n                                        ");
                    __builder3.OpenComponent<MatBlazor.MatHeadline6>(29);
                    __builder3.AddAttribute(30, "Style", "padding-left: 1em; color:white; font-weight:bolder");
                    __builder3.AddAttribute(31, "ChildContent", (Microsoft.AspNetCore.Components.RenderFragment)((__builder4) => {
                        __builder4.AddMarkupContent(32, "\r\n                                            ");
                        __builder4.AddContent(33, 
#nullable restore
#line 39 "C:\Users\jayt7\Source\Repos\Senior-Project\SPWA\Pages\Projects.razor"
                                             project.Title.ToUpper()

#line default
#line hidden
#nullable disable
                        );
                        __builder4.AddMarkupContent(34, "\r\n");
#nullable restore
#line 40 "C:\Users\jayt7\Source\Repos\Senior-Project\SPWA\Pages\Projects.razor"
                                             if (@project.IsActive == true)
                                            {

#line default
#line hidden
#nullable disable
                        __builder4.AddContent(35, "                                                ");
                        __builder4.OpenComponent<MatBlazor.MatIcon>(36);
                        __builder4.AddAttribute(37, "Icon", "check_circle");
                        __builder4.AddAttribute(38, "Style", "color:lawngreen; float:right;padding-right:.5em; padding-top:.3em");
                        __builder4.CloseComponent();
                        __builder4.AddMarkupContent(39, "\r\n");
#nullable restore
#line 43 "C:\Users\jayt7\Source\Repos\Senior-Project\SPWA\Pages\Projects.razor"
                                            }
                                            else
                                            {

#line default
#line hidden
#nullable disable
                        __builder4.AddContent(40, "                                                ");
                        __builder4.OpenComponent<MatBlazor.MatIcon>(41);
                        __builder4.AddAttribute(42, "Icon", "check_circle");
                        __builder4.AddAttribute(43, "Style", "float:right;padding-right:.5em; padding-top:.3em");
                        __builder4.CloseComponent();
                        __builder4.AddMarkupContent(44, "\r\n");
#nullable restore
#line 47 "C:\Users\jayt7\Source\Repos\Senior-Project\SPWA\Pages\Projects.razor"
                                            }

#line default
#line hidden
#nullable disable
                        __builder4.AddContent(45, "                                        ");
                    }
                    ));
                    __builder3.CloseComponent();
                    __builder3.AddMarkupContent(46, "\r\n                                    ");
                    __builder3.CloseElement();
                    __builder3.AddMarkupContent(47, "\r\n                                    ");
                    __builder3.OpenComponent<MatBlazor.MatSubtitle2>(48);
                    __builder3.AddAttribute(49, "Style", "padding-left: 2em; color:white; padding-right: 1em");
                    __builder3.AddAttribute(50, "ChildContent", (Microsoft.AspNetCore.Components.RenderFragment)((__builder4) => {
                        __builder4.AddMarkupContent(51, "\r\n                                        Owner: ");
                        __builder4.AddContent(52, 
#nullable restore
#line 51 "C:\Users\jayt7\Source\Repos\Senior-Project\SPWA\Pages\Projects.razor"
                                                project.OwnerId

#line default
#line hidden
#nullable disable
                        );
                        __builder4.AddMarkupContent(53, "\r\n                                    ");
                    }
                    ));
                    __builder3.CloseComponent();
                    __builder3.AddMarkupContent(54, "\r\n                                ");
                    __builder3.CloseElement();
                    __builder3.AddMarkupContent(55, "\r\n                            ");
                    __builder3.CloseElement();
                    __builder3.AddMarkupContent(56, "\r\n                            ");
                    __builder3.OpenComponent<MatBlazor.MatBody2>(57);
                    __builder3.AddAttribute(58, "class", "mat-card-text");
                    __builder3.AddAttribute(59, "Style", "padding-left: 1em");
                    __builder3.AddAttribute(60, "ChildContent", (Microsoft.AspNetCore.Components.RenderFragment)((__builder4) => {
                        __builder4.AddMarkupContent(61, "\r\n                                ");
                        __builder4.AddContent(62, 
#nullable restore
#line 56 "C:\Users\jayt7\Source\Repos\Senior-Project\SPWA\Pages\Projects.razor"
                                 project.Details

#line default
#line hidden
#nullable disable
                        );
                        __builder4.AddMarkupContent(63, "\r\n                            ");
                    }
                    ));
                    __builder3.CloseComponent();
                    __builder3.AddMarkupContent(64, "\r\n                            ");
                    __builder3.OpenComponent<MatBlazor.MatBody2>(65);
                    __builder3.AddAttribute(66, "Style", "padding-left: 1em");
                    __builder3.AddAttribute(67, "ChildContent", (Microsoft.AspNetCore.Components.RenderFragment)((__builder4) => {
                        __builder4.AddMarkupContent(68, "\r\n                                Project Lock by: ");
                        __builder4.AddContent(69, 
#nullable restore
#line 59 "C:\Users\jayt7\Source\Repos\Senior-Project\SPWA\Pages\Projects.razor"
                                                  project.UserLockID

#line default
#line hidden
#nullable disable
                        );
                        __builder4.AddMarkupContent(70, " <br>\r\n                                Skills preferred: project.reqSkills <br>\r\n\r\n                                Currently enrolled: project.members.Length student(s) <br>\r\n                                Max Capacity: ");
                        __builder4.AddContent(71, 
#nullable restore
#line 63 "C:\Users\jayt7\Source\Repos\Senior-Project\SPWA\Pages\Projects.razor"
                                               project.MaxStudents

#line default
#line hidden
#nullable disable
                        );
                        __builder4.AddMarkupContent(72, " student(s) <br>\r\n                                Current Members: project.members\r\n                            ");
                    }
                    ));
                    __builder3.CloseComponent();
                    __builder3.AddMarkupContent(73, "\r\n\r\n                        ");
                }
                ));
                __builder2.CloseComponent();
                __builder2.AddMarkupContent(74, "\r\n                        ");
                __builder2.OpenComponent<MatBlazor.MatCardActions>(75);
                __builder2.AddAttribute(76, "ChildContent", (Microsoft.AspNetCore.Components.RenderFragment)((__builder3) => {
                    __builder3.AddMarkupContent(77, "\r\n                            ");
                    __builder3.OpenComponent<MatBlazor.MatButton>(78);
                    __builder3.AddAttribute(79, "onclick", Microsoft.AspNetCore.Components.EventCallback.Factory.Create<Microsoft.AspNetCore.Components.Web.MouseEventArgs>(this, 
#nullable restore
#line 69 "C:\Users\jayt7\Source\Repos\Senior-Project\SPWA\Pages\Projects.razor"
                                                 (() => ReadProject(project))

#line default
#line hidden
#nullable disable
                    ));
                    __builder3.AddAttribute(80, "ChildContent", (Microsoft.AspNetCore.Components.RenderFragment)((__builder4) => {
                        __builder4.AddContent(81, "Read More");
                    }
                    ));
                    __builder3.CloseComponent();
                    __builder3.AddMarkupContent(82, "\r\n\r\n\r\n");
#nullable restore
#line 72 "C:\Users\jayt7\Source\Repos\Senior-Project\SPWA\Pages\Projects.razor"
                             if (@project.isLock == !true)
                            {

#line default
#line hidden
#nullable disable
                    __builder3.AddContent(83, "                                ");
                    __builder3.OpenComponent<MatBlazor.MatButton>(84);
                    __builder3.AddAttribute(85, "onclick", Microsoft.AspNetCore.Components.EventCallback.Factory.Create<Microsoft.AspNetCore.Components.Web.MouseEventArgs>(this, 
#nullable restore
#line 74 "C:\Users\jayt7\Source\Repos\Senior-Project\SPWA\Pages\Projects.razor"
                                                     (() => LockProject(project))

#line default
#line hidden
#nullable disable
                    ));
                    __builder3.AddAttribute(86, "ChildContent", (Microsoft.AspNetCore.Components.RenderFragment)((__builder4) => {
                        __builder4.AddContent(87, "Lock Project");
                    }
                    ));
                    __builder3.CloseComponent();
                    __builder3.AddMarkupContent(88, "\r\n");
#nullable restore
#line 75 "C:\Users\jayt7\Source\Repos\Senior-Project\SPWA\Pages\Projects.razor"
                            }
                            else if (@project.UserLockID == CurrentUser.Identity.Name)
                            {

#line default
#line hidden
#nullable disable
                    __builder3.AddContent(89, "                                ");
                    __builder3.OpenComponent<MatBlazor.MatButton>(90);
                    __builder3.AddAttribute(91, "onclick", Microsoft.AspNetCore.Components.EventCallback.Factory.Create<Microsoft.AspNetCore.Components.Web.MouseEventArgs>(this, 
#nullable restore
#line 78 "C:\Users\jayt7\Source\Repos\Senior-Project\SPWA\Pages\Projects.razor"
                                                     (() => LockProject(project))

#line default
#line hidden
#nullable disable
                    ));
                    __builder3.AddAttribute(92, "ChildContent", (Microsoft.AspNetCore.Components.RenderFragment)((__builder4) => {
                        __builder4.AddContent(93, "Release Project");
                    }
                    ));
                    __builder3.CloseComponent();
                    __builder3.AddMarkupContent(94, "\r\n");
#nullable restore
#line 79 "C:\Users\jayt7\Source\Repos\Senior-Project\SPWA\Pages\Projects.razor"
                            }

#line default
#line hidden
#nullable disable
                    __builder3.AddMarkupContent(95, "\r\n                            ");
                    __builder3.OpenComponent<Microsoft.AspNetCore.Components.Authorization.AuthorizeView>(96);
                    __builder3.AddAttribute(97, "Roles", "Administrators");
                    __builder3.AddAttribute(98, "ChildContent", (Microsoft.AspNetCore.Components.RenderFragment<Microsoft.AspNetCore.Components.Authorization.AuthenticationState>)((context) => (__builder4) => {
                        __builder4.AddMarkupContent(99, "\r\n                                ");
                        __builder4.OpenComponent<MatBlazor.MatButton>(100);
                        __builder4.AddAttribute(101, "onclick", Microsoft.AspNetCore.Components.EventCallback.Factory.Create<Microsoft.AspNetCore.Components.Web.MouseEventArgs>(this, 
#nullable restore
#line 82 "C:\Users\jayt7\Source\Repos\Senior-Project\SPWA\Pages\Projects.razor"
                                                     (() => EditProject(project))

#line default
#line hidden
#nullable disable
                        ));
                        __builder4.AddAttribute(102, "ChildContent", (Microsoft.AspNetCore.Components.RenderFragment)((__builder5) => {
                            __builder5.AddContent(103, "Edit Project");
                        }
                        ));
                        __builder4.CloseComponent();
                        __builder4.AddMarkupContent(104, "\r\n                            ");
                    }
                    ));
                    __builder3.CloseComponent();
                    __builder3.AddMarkupContent(105, "\r\n                        ");
                }
                ));
                __builder2.CloseComponent();
                __builder2.AddMarkupContent(106, "\r\n\r\n                    ");
            }
            ));
            __builder.CloseComponent();
            __builder.AddMarkupContent(107, "\r\n                ");
            __builder.CloseElement();
            __builder.AddMarkupContent(108, "\r\n");
#nullable restore
#line 88 "C:\Users\jayt7\Source\Repos\Senior-Project\SPWA\Pages\Projects.razor"

            }

#line default
#line hidden
#nullable disable
            __builder.AddContent(109, "        ");
            __builder.CloseElement();
            __builder.AddMarkupContent(110, "\r\n    ");
            __builder.CloseElement();
            __builder.AddMarkupContent(111, "\r\n    ");
            __builder.OpenComponent<Microsoft.AspNetCore.Components.Authorization.AuthorizeView>(112);
            __builder.AddAttribute(113, "Roles", "Administrators");
            __builder.AddAttribute(114, "ChildContent", (Microsoft.AspNetCore.Components.RenderFragment<Microsoft.AspNetCore.Components.Authorization.AuthenticationState>)((context) => (__builder2) => {
                __builder2.AddMarkupContent(115, "\r\n        ");
                __builder2.OpenElement(116, "p");
                __builder2.AddMarkupContent(117, "\r\n            \r\n            ");
                __builder2.OpenElement(118, "button");
                __builder2.AddAttribute(119, "class", "btn btn-primary");
                __builder2.AddAttribute(120, "onclick", Microsoft.AspNetCore.Components.EventCallback.Factory.Create<Microsoft.AspNetCore.Components.Web.MouseEventArgs>(this, 
#nullable restore
#line 96 "C:\Users\jayt7\Source\Repos\Senior-Project\SPWA\Pages\Projects.razor"
                              AddNewProject

#line default
#line hidden
#nullable disable
                ));
                __builder2.AddMarkupContent(121, "\r\n                Submit New Project\r\n            ");
                __builder2.CloseElement();
                __builder2.AddMarkupContent(122, "\r\n        ");
                __builder2.CloseElement();
                __builder2.AddMarkupContent(123, "\r\n    ");
            }
            ));
            __builder.CloseComponent();
            __builder.AddMarkupContent(124, "\r\n");
            __builder.AddContent(125, "    ");
            __builder.OpenComponent<MatBlazor.MatDialog>(126);
            __builder.AddAttribute(127, "IsOpen", Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck<System.Boolean>(
#nullable restore
#line 102 "C:\Users\jayt7\Source\Repos\Senior-Project\SPWA\Pages\Projects.razor"
                             ReadMorePopup

#line default
#line hidden
#nullable disable
            ));
            __builder.AddAttribute(128, "IsOpenChanged", Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck<Microsoft.AspNetCore.Components.EventCallback<System.Boolean>>(Microsoft.AspNetCore.Components.EventCallback.Factory.Create<System.Boolean>(this, Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.CreateInferredEventCallback(this, __value => ReadMorePopup = __value, ReadMorePopup))));
            __builder.AddAttribute(129, "ChildContent", (Microsoft.AspNetCore.Components.RenderFragment)((__builder2) => {
                __builder2.AddMarkupContent(130, "\r\n        ");
                __builder2.OpenComponent<MatBlazor.MatDialogTitle>(131);
                __builder2.AddAttribute(132, "ChildContent", (Microsoft.AspNetCore.Components.RenderFragment)((__builder3) => {
                    __builder3.AddContent(133, " ");
                    __builder3.AddContent(134, 
#nullable restore
#line 103 "C:\Users\jayt7\Source\Repos\Senior-Project\SPWA\Pages\Projects.razor"
                          objProject.Title

#line default
#line hidden
#nullable disable
                    );
                    __builder3.AddContent(135, " ");
                }
                ));
                __builder2.CloseComponent();
                __builder2.AddMarkupContent(136, "\r\n        ");
                __builder2.OpenComponent<MatBlazor.MatDialogContent>(137);
                __builder2.AddAttribute(138, "ChildContent", (Microsoft.AspNetCore.Components.RenderFragment)((__builder3) => {
                    __builder3.AddMarkupContent(139, "\r\n            ");
                    __builder3.OpenComponent<MatBlazor.MatSubtitle2>(140);
                    __builder3.AddAttribute(141, "ChildContent", (Microsoft.AspNetCore.Components.RenderFragment)((__builder4) => {
                        __builder4.AddContent(142, " selectedProj.semester ");
                    }
                    ));
                    __builder3.CloseComponent();
                    __builder3.AddMarkupContent(143, "\r\n            ");
                    __builder3.OpenElement(144, "p");
                    __builder3.AddContent(145, " ");
                    __builder3.AddContent(146, 
#nullable restore
#line 106 "C:\Users\jayt7\Source\Repos\Senior-Project\SPWA\Pages\Projects.razor"
                 objProject.Details

#line default
#line hidden
#nullable disable
                    );
                    __builder3.AddContent(147, " ");
                    __builder3.CloseElement();
                    __builder3.AddMarkupContent(148, "\r\n            ");
                    __builder3.OpenComponent<MatBlazor.MatBody2>(149);
                    __builder3.AddAttribute(150, "ChildContent", (Microsoft.AspNetCore.Components.RenderFragment)((__builder4) => {
                        __builder4.AddMarkupContent(151, "\r\n                Skills preferred: selectedProj.reqSkills <br>\r\n\r\n                Currently enrolled: .members.Length student(s) <br>\r\n                Max Capacity: ");
                        __builder4.AddContent(152, 
#nullable restore
#line 111 "C:\Users\jayt7\Source\Repos\Senior-Project\SPWA\Pages\Projects.razor"
                               objProject.MaxStudents

#line default
#line hidden
#nullable disable
                        );
                        __builder4.AddMarkupContent(153, " student(s) <br>\r\n                Current Members: selectedProj.members\r\n            ");
                    }
                    ));
                    __builder3.CloseComponent();
                    __builder3.AddMarkupContent(154, "\r\n        ");
                }
                ));
                __builder2.CloseComponent();
                __builder2.AddMarkupContent(155, "\r\n        ");
                __builder2.OpenComponent<MatBlazor.MatDialogActions>(156);
                __builder2.AddAttribute(157, "ChildContent", (Microsoft.AspNetCore.Components.RenderFragment)((__builder3) => {
                    __builder3.AddMarkupContent(158, "\r\n            ");
                    __builder3.OpenComponent<MatBlazor.MatButton>(159);
                    __builder3.AddAttribute(160, "OnClick", Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck<Microsoft.AspNetCore.Components.EventCallback<Microsoft.AspNetCore.Components.Web.MouseEventArgs>>(Microsoft.AspNetCore.Components.EventCallback.Factory.Create<Microsoft.AspNetCore.Components.Web.MouseEventArgs>(this, 
#nullable restore
#line 116 "C:\Users\jayt7\Source\Repos\Senior-Project\SPWA\Pages\Projects.razor"
                                  e => { ReadMorePopup = false; }

#line default
#line hidden
#nullable disable
                    )));
                    __builder3.AddAttribute(161, "ChildContent", (Microsoft.AspNetCore.Components.RenderFragment)((__builder4) => {
                        __builder4.AddContent(162, "Back");
                    }
                    ));
                    __builder3.CloseComponent();
                    __builder3.AddMarkupContent(163, "\r\n        ");
                }
                ));
                __builder2.CloseComponent();
                __builder2.AddMarkupContent(164, "\r\n    ");
            }
            ));
            __builder.CloseComponent();
            __builder.AddMarkupContent(165, "\r\n");
#nullable restore
#line 120 "C:\Users\jayt7\Source\Repos\Senior-Project\SPWA\Pages\Projects.razor"
     if (ShowPopup)
    {

#line default
#line hidden
#nullable disable
            __builder.AddContent(166, "        ");
            __builder.OpenElement(167, "div");
            __builder.AddAttribute(168, "class", "modal");
            __builder.AddAttribute(169, "tabindex", "-1");
            __builder.AddAttribute(170, "style", "display:block");
            __builder.AddAttribute(171, "role", "dialog");
            __builder.AddMarkupContent(172, "\r\n            ");
            __builder.OpenElement(173, "div");
            __builder.AddAttribute(174, "class", "modal-dialog");
            __builder.AddMarkupContent(175, "\r\n                ");
            __builder.OpenElement(176, "div");
            __builder.AddAttribute(177, "class", "modal-content");
            __builder.AddMarkupContent(178, "\r\n                    ");
            __builder.OpenElement(179, "div");
            __builder.AddAttribute(180, "class", "modal-header");
            __builder.AddMarkupContent(181, "\r\n                        ");
            __builder.AddMarkupContent(182, "<h3 class=\"modal-title\">Edit Project</h3>\r\n                        \r\n                        ");
            __builder.OpenElement(183, "button");
            __builder.AddAttribute(184, "type", "button");
            __builder.AddAttribute(185, "class", "close");
            __builder.AddAttribute(186, "onclick", Microsoft.AspNetCore.Components.EventCallback.Factory.Create<Microsoft.AspNetCore.Components.Web.MouseEventArgs>(this, 
#nullable restore
#line 129 "C:\Users\jayt7\Source\Repos\Senior-Project\SPWA\Pages\Projects.razor"
                                          ClosePopup

#line default
#line hidden
#nullable disable
            ));
            __builder.AddMarkupContent(187, "\r\n                            ");
            __builder.AddMarkupContent(188, "<span aria-hidden=\"true\">X</span>\r\n                        ");
            __builder.CloseElement();
            __builder.AddMarkupContent(189, "\r\n                    ");
            __builder.CloseElement();
            __builder.AddMarkupContent(190, "\r\n                    \r\n                    ");
            __builder.OpenElement(191, "div");
            __builder.AddAttribute(192, "class", "modal-body");
            __builder.AddMarkupContent(193, "\r\n                        ");
            __builder.AddMarkupContent(194, "<label for=\"Name\" class=\"control-label\">Title</label>\r\n                        ");
            __builder.OpenElement(195, "input");
            __builder.AddAttribute(196, "class", "form-control");
            __builder.AddAttribute(197, "type", "text");
            __builder.AddAttribute(198, "placeholder", "Title");
            __builder.AddAttribute(199, "value", Microsoft.AspNetCore.Components.BindConverter.FormatValue(
#nullable restore
#line 138 "C:\Users\jayt7\Source\Repos\Senior-Project\SPWA\Pages\Projects.razor"
                                      objProject.Title

#line default
#line hidden
#nullable disable
            ));
            __builder.AddAttribute(200, "onchange", Microsoft.AspNetCore.Components.EventCallback.Factory.CreateBinder(this, __value => objProject.Title = __value, objProject.Title));
            __builder.SetUpdatesAttributeName("value");
            __builder.CloseElement();
            __builder.AddMarkupContent(201, "\r\n                        ");
            __builder.AddMarkupContent(202, "<label for=\"exampleFormControlTextarea1\" class=\"control-label\">Description</label>\r\n                        ");
            __builder.OpenElement(203, "input");
            __builder.AddAttribute(204, "class", "form-control");
            __builder.AddAttribute(205, "type", "text");
            __builder.AddAttribute(206, "placeholder", "Description");
            __builder.AddAttribute(207, "value", Microsoft.AspNetCore.Components.BindConverter.FormatValue(
#nullable restore
#line 142 "C:\Users\jayt7\Source\Repos\Senior-Project\SPWA\Pages\Projects.razor"
                                      objProject.Details

#line default
#line hidden
#nullable disable
            ));
            __builder.AddAttribute(208, "onchange", Microsoft.AspNetCore.Components.EventCallback.Factory.CreateBinder(this, __value => objProject.Details = __value, objProject.Details));
            __builder.SetUpdatesAttributeName("value");
            __builder.CloseElement();
            __builder.AddMarkupContent(209, "\r\n                        ");
            __builder.AddMarkupContent(210, "<label for=\"Name\" class=\"control-label\">Number of students</label>\r\n                        ");
            __builder.OpenElement(211, "input");
            __builder.AddAttribute(212, "class", "form-control");
            __builder.AddAttribute(213, "type", "text");
            __builder.AddAttribute(214, "placeholder", "Number of students");
            __builder.AddAttribute(215, "value", Microsoft.AspNetCore.Components.BindConverter.FormatValue(
#nullable restore
#line 146 "C:\Users\jayt7\Source\Repos\Senior-Project\SPWA\Pages\Projects.razor"
                                      objProject.MaxStudents

#line default
#line hidden
#nullable disable
            ));
            __builder.AddAttribute(216, "onchange", Microsoft.AspNetCore.Components.EventCallback.Factory.CreateBinder(this, __value => objProject.MaxStudents = __value, objProject.MaxStudents));
            __builder.SetUpdatesAttributeName("value");
            __builder.CloseElement();
            __builder.AddMarkupContent(217, "\r\n                        <br>\r\n                        ");
            __builder.AddMarkupContent(218, "<label for=\"isActive\">Activate</label>\r\n                        ");
            __builder.OpenElement(219, "input");
            __builder.AddAttribute(220, "type", "checkbox");
            __builder.AddAttribute(221, "id", "isActive");
            __builder.AddAttribute(222, "value", 
#nullable restore
#line 149 "C:\Users\jayt7\Source\Repos\Senior-Project\SPWA\Pages\Projects.razor"
                                                                     objProject.IsActive

#line default
#line hidden
#nullable disable
            );
            __builder.AddAttribute(223, "checked", Microsoft.AspNetCore.Components.BindConverter.FormatValue(
#nullable restore
#line 149 "C:\Users\jayt7\Source\Repos\Senior-Project\SPWA\Pages\Projects.razor"
                                                                                                 objProject.IsActive

#line default
#line hidden
#nullable disable
            ));
            __builder.AddAttribute(224, "onchange", Microsoft.AspNetCore.Components.EventCallback.Factory.CreateBinder(this, __value => objProject.IsActive = __value, objProject.IsActive));
            __builder.SetUpdatesAttributeName("checked");
            __builder.CloseElement();
            __builder.AddMarkupContent(225, "\r\n                        <br>\r\n                        \r\n                        ");
            __builder.OpenElement(226, "button");
            __builder.AddAttribute(227, "class", "btn btn-primary");
            __builder.AddAttribute(228, "onclick", Microsoft.AspNetCore.Components.EventCallback.Factory.Create<Microsoft.AspNetCore.Components.Web.MouseEventArgs>(this, 
#nullable restore
#line 153 "C:\Users\jayt7\Source\Repos\Senior-Project\SPWA\Pages\Projects.razor"
                                          SaveProject

#line default
#line hidden
#nullable disable
            ));
            __builder.AddMarkupContent(229, "\r\n                            Save\r\n                        ");
            __builder.CloseElement();
            __builder.AddMarkupContent(230, "\r\n                    ");
            __builder.CloseElement();
            __builder.AddMarkupContent(231, "\r\n                ");
            __builder.CloseElement();
            __builder.AddMarkupContent(232, "\r\n            ");
            __builder.CloseElement();
            __builder.AddMarkupContent(233, "\r\n        ");
            __builder.CloseElement();
            __builder.AddMarkupContent(234, "\r\n");
#nullable restore
#line 160 "C:\Users\jayt7\Source\Repos\Senior-Project\SPWA\Pages\Projects.razor"
    }

#line default
#line hidden
#nullable disable
#nullable restore
#line 162 "C:\Users\jayt7\Source\Repos\Senior-Project\SPWA\Pages\Projects.razor"
     if (lockPop)
    {

#line default
#line hidden
#nullable disable
            __builder.AddMarkupContent(235, "        \r\n        ");
            __builder.OpenElement(236, "div");
            __builder.AddAttribute(237, "class", "modal");
            __builder.AddAttribute(238, "tabindex", "-1");
            __builder.AddAttribute(239, "style", "display:block");
            __builder.AddAttribute(240, "role", "dialog");
            __builder.AddMarkupContent(241, "\r\n            ");
            __builder.OpenElement(242, "div");
            __builder.AddAttribute(243, "class", "modal-dialog");
            __builder.AddMarkupContent(244, "\r\n                ");
            __builder.OpenElement(245, "div");
            __builder.AddAttribute(246, "class", "modal-content");
            __builder.AddMarkupContent(247, "\r\n                    ");
            __builder.OpenElement(248, "div");
            __builder.AddAttribute(249, "class", "modal-header");
            __builder.AddMarkupContent(250, "\r\n                        ");
            __builder.AddMarkupContent(251, "<h3 class=\"modal-title\">Lock Project</h3>\r\n                        \r\n                        ");
            __builder.OpenElement(252, "button");
            __builder.AddAttribute(253, "type", "button");
            __builder.AddAttribute(254, "class", "close");
            __builder.AddAttribute(255, "onclick", Microsoft.AspNetCore.Components.EventCallback.Factory.Create<Microsoft.AspNetCore.Components.Web.MouseEventArgs>(this, 
#nullable restore
#line 172 "C:\Users\jayt7\Source\Repos\Senior-Project\SPWA\Pages\Projects.razor"
                                          ClosePopup

#line default
#line hidden
#nullable disable
            ));
            __builder.AddMarkupContent(256, "\r\n                            ");
            __builder.AddMarkupContent(257, "<span aria-hidden=\"true\">X</span>\r\n                        ");
            __builder.CloseElement();
            __builder.AddMarkupContent(258, "\r\n                    ");
            __builder.CloseElement();
            __builder.AddMarkupContent(259, "\r\n");
#nullable restore
#line 176 "C:\Users\jayt7\Source\Repos\Senior-Project\SPWA\Pages\Projects.razor"
                     if (objProject.isLock == !true)
                    {

#line default
#line hidden
#nullable disable
            __builder.AddContent(260, "                        ");
            __builder.AddMarkupContent(261, "<label for=\"exampleFormControlTextarea1\" class=\"control-label\">Confirm Lock</label>\r\n");
            __builder.AddMarkupContent(262, "                        \r\n                        ");
            __builder.OpenElement(263, "button");
            __builder.AddAttribute(264, "class", "btn btn-primary");
            __builder.AddAttribute(265, "onclick", Microsoft.AspNetCore.Components.EventCallback.Factory.Create<Microsoft.AspNetCore.Components.Web.MouseEventArgs>(this, 
#nullable restore
#line 183 "C:\Users\jayt7\Source\Repos\Senior-Project\SPWA\Pages\Projects.razor"
                                          ConfirmLockProject

#line default
#line hidden
#nullable disable
            ));
            __builder.AddMarkupContent(266, "\r\n                            Lock Project\r\n                        ");
            __builder.CloseElement();
            __builder.AddMarkupContent(267, "\r\n");
#nullable restore
#line 186 "C:\Users\jayt7\Source\Repos\Senior-Project\SPWA\Pages\Projects.razor"
                    }
                    else if (objProject.UserLockID == CurrentUser.Identity.Name)
                    {

#line default
#line hidden
#nullable disable
            __builder.AddContent(268, "                        ");
            __builder.AddMarkupContent(269, "<label for=\"exampleFormControlTextarea1\" class=\"control-label\">Release Lock</label>\r\n");
            __builder.AddMarkupContent(270, "                        \r\n                        ");
            __builder.OpenElement(271, "button");
            __builder.AddAttribute(272, "class", "btn btn-primary");
            __builder.AddAttribute(273, "onclick", Microsoft.AspNetCore.Components.EventCallback.Factory.Create<Microsoft.AspNetCore.Components.Web.MouseEventArgs>(this, 
#nullable restore
#line 194 "C:\Users\jayt7\Source\Repos\Senior-Project\SPWA\Pages\Projects.razor"
                                          ReleaseProject

#line default
#line hidden
#nullable disable
            ));
            __builder.AddMarkupContent(274, "\r\n                            Release Project\r\n                        ");
            __builder.CloseElement();
            __builder.AddMarkupContent(275, "\r\n");
#nullable restore
#line 197 "C:\Users\jayt7\Source\Repos\Senior-Project\SPWA\Pages\Projects.razor"
                    }

#line default
#line hidden
#nullable disable
            __builder.AddMarkupContent(276, "\r\n                ");
            __builder.CloseElement();
            __builder.AddMarkupContent(277, "\r\n            ");
            __builder.CloseElement();
            __builder.AddMarkupContent(278, "\r\n        ");
            __builder.CloseElement();
            __builder.AddMarkupContent(279, "\r\n");
#nullable restore
#line 202 "C:\Users\jayt7\Source\Repos\Senior-Project\SPWA\Pages\Projects.razor"

    }

#line default
#line hidden
#nullable disable
#nullable restore
#line 205 "C:\Users\jayt7\Source\Repos\Senior-Project\SPWA\Pages\Projects.razor"
     if (addMember)
    {

#line default
#line hidden
#nullable disable
            __builder.AddContent(280, "        ");
            __builder.OpenElement(281, "select");
            __builder.AddAttribute(282, "class", "form-control");
            __builder.AddAttribute(283, "value", Microsoft.AspNetCore.Components.BindConverter.FormatValue(
#nullable restore
#line 208 "C:\Users\jayt7\Source\Repos\Senior-Project\SPWA\Pages\Projects.razor"
                        userToAddToProject

#line default
#line hidden
#nullable disable
            ));
            __builder.AddAttribute(284, "onchange", Microsoft.AspNetCore.Components.EventCallback.Factory.CreateBinder(this, __value => userToAddToProject = __value, userToAddToProject));
            __builder.SetUpdatesAttributeName("value");
            __builder.AddMarkupContent(285, "\r\n");
#nullable restore
#line 209 "C:\Users\jayt7\Source\Repos\Senior-Project\SPWA\Pages\Projects.razor"
             foreach (var userToAdd in ColUsers)
            {

#line default
#line hidden
#nullable disable
            __builder.AddContent(286, "                ");
            __builder.OpenElement(287, "option");
            __builder.AddAttribute(288, "value", 
#nullable restore
#line 211 "C:\Users\jayt7\Source\Repos\Senior-Project\SPWA\Pages\Projects.razor"
                                userToAdd

#line default
#line hidden
#nullable disable
            );
            __builder.AddMarkupContent(289, "\r\n                    ");
            __builder.AddContent(290, 
#nullable restore
#line 212 "C:\Users\jayt7\Source\Repos\Senior-Project\SPWA\Pages\Projects.razor"
                     userToAdd.UserName

#line default
#line hidden
#nullable disable
            );
            __builder.AddMarkupContent(291, "\r\n                ");
            __builder.CloseElement();
            __builder.AddMarkupContent(292, "\r\n");
#nullable restore
#line 214 "C:\Users\jayt7\Source\Repos\Senior-Project\SPWA\Pages\Projects.razor"
            }

#line default
#line hidden
#nullable disable
            __builder.AddContent(293, "        ");
            __builder.CloseElement();
            __builder.AddMarkupContent(294, "\r\n        <br>\r\n        <br>\r\n        \r\n            ");
            __builder.OpenElement(295, "button");
            __builder.AddAttribute(296, "class", "btn btn-primary");
            __builder.AddAttribute(297, "onclick", Microsoft.AspNetCore.Components.EventCallback.Factory.Create<Microsoft.AspNetCore.Components.Web.MouseEventArgs>(this, 
#nullable restore
#line 219 "C:\Users\jayt7\Source\Repos\Senior-Project\SPWA\Pages\Projects.razor"
                                                      (() => AddUserToProject())

#line default
#line hidden
#nullable disable
            ));
            __builder.AddMarkupContent(298, "\r\n            Add User\r\n            ");
            __builder.CloseElement();
            __builder.AddMarkupContent(299, "\r\n");
#nullable restore
#line 222 "C:\Users\jayt7\Source\Repos\Senior-Project\SPWA\Pages\Projects.razor"
    }

#line default
#line hidden
#nullable disable
#nullable restore
#line 222 "C:\Users\jayt7\Source\Repos\Senior-Project\SPWA\Pages\Projects.razor"
     
}

#line default
#line hidden
#nullable disable
        }
        #pragma warning restore 1998
#nullable restore
#line 225 "C:\Users\jayt7\Source\Repos\Senior-Project\SPWA\Pages\Projects.razor"
       
    // AuthenticationState is available as a CascadingParameter
    [CascadingParameter]
    private Task<AuthenticationState> authenticationStateTask { get; set; }
    System.Security.Claims.ClaimsPrincipal CurrentUser;

    // Options to display in the approved dropdown when editing a Project
    List<string> Options = new List<string>() { "Approved", "Rejected" };
    ApplicationUser objUser = new ApplicationUser();
    public UserManager<ApplicationUser> UserManager { get; private set; }
    List<Project> projects;
    List<ApplicationUser> ColUsers = new List<ApplicationUser>();

    protected override async Task OnInitializedAsync()
    {
        await GetUsers();
        // Get the current user
        var user = (await authenticationStateTask).User;
        // Get the Projects for the current user
        // We access ProjectService using @Service
        projects = await @Service.GetProjectAsync();
        CurrentUser = (await authenticationStateTask).User;
    }
    bool lockPop = false;
    Project objProject = new Project();
    bool ShowPopup = false;
    bool ReadMorePopup = false;
    bool addMember = false;
    string userToAddToProject = "";

    void ClosePopup()
    {
        // Close the Popup
        ShowPopup = false;
    }


    public async Task GetUsers()
    {
        // Collection to hold users
        ColUsers = new List<ApplicationUser>();
        // get users from _UserManager
        var user = _UserManager.Users.Select(x => new ApplicationUser
        {
            Id = x.Id,
            UserName = x.UserName,
            Email = x.Email,
            PasswordHash = "*****"
        });
        foreach (var item in user)
        {
            var UserResult = await _UserManager.IsInRoleAsync(item, "Administrators");
            if (!UserResult)
            {
                ColUsers.Add(item);
            }
        }
    }
    void AddNewProject()
    {
        //System.Diagnostics.Debug.WriteLine("read value =" + ReadMorePopup);
        // Make new Project
        objProject = new Project();
        // Set Id to 0 so we know it is a new record
        objProject.Id = 0;
        // Open the Popup
        ShowPopup = true;
    }
    async Task SaveProject()
    {

        // Close the Popup
        ShowPopup = false;
        // Get the current user
        var user = (await authenticationStateTask).User;
        // A new Proejct will have the Id set to 0
        if (objProject.Id == 0)
        {
            // Create new Project
            Project objNewProject = new Project();
            objNewProject.Title = objProject.Title;
            objNewProject.Details = objProject.Details;
            objNewProject.MaxStudents = objProject.MaxStudents;
            objNewProject.IsActive = objProject.IsActive;
            objNewProject.isLock = false;

            //objNewProject.TemperatureF =
            //Convert.ToInt32(objProject.TemperatureF);
            objNewProject.OwnerId = user.Identity.Name;
            // Save the result
            var result =
            @Service.CreateProjectAsync(objNewProject);
        }
        else
        {

            // This is an update
            var result =
            @Service.UpdateProjectAsync(objProject);
        }
        // Get the Projects for the current user
        projects =
        await @Service.GetProjectAsync();
    }

    void EditProject(Project project)
    {
        System.Diagnostics.Debug.WriteLine("read value =" + ReadMorePopup);
        // Set the selected project
        // as the current project
        objProject = project;
        // Open the Popup
        ShowPopup = true;
    }


    void ReadProject(Project project)
    {
        System.Diagnostics.Debug.WriteLine("In Readmorepopup ");
        // Set the selected project
        // as the current project
        objProject = project;
        // Open the Popup
        ReadMorePopup = true;
        System.Diagnostics.Debug.WriteLine(ReadMorePopup);
    }

    void LockProject(Project project)
    {
        lockPop = true;

        objProject = project;

    }



    async Task ConfirmLockProject()
    {
        var user = (await authenticationStateTask).User;
        //var currentUser = await UserManager.GetUserAsync(user);


        objProject.UserLockID = user.Identity.Name;
        objProject.isLock = true;

        var result =
            @Service.UpdateProjectAsync(objProject);
        lockPop = false;
    }


    void NavigateToProject(int projectId)
    {
        NavigationManager.NavigateTo(uri: ("/ProjectDetails/" + projectId));

    }


    void AddUserToProject(Project project)
    {
        lockPop = true;

        objProject = project;
    }


    async Task AddUserToProject()
    {


        var userToADD = await _UserManager.FindByNameAsync(userToAddToProject);
        if (userToADD != null)
        {

        }



        //var user = (await authenticationStateTask).User;
        //var currentUser = await UserManager.GetUserAsync(user);


        //objProject.UserLockID = user.Identity.Name;
        //objProject.isLock = true;

        var result =
            @Service.UpdateProjectAsync(objProject);
        lockPop = false;
    }



    async Task ReleaseProject()
    {



        objProject.UserLockID = "";
        objProject.isLock = false;
        System.Diagnostics.Debug.WriteLine("In Realese Project isLock value =" + objProject.isLock);
        var result =
            @Service.UpdateProjectAsync(objProject);
        lockPop = false;
    }


#line default
#line hidden
#nullable disable
        [global::Microsoft.AspNetCore.Components.InjectAttribute] private AuthenticationStateProvider AuthenticationStateProvider { get; set; }
        [global::Microsoft.AspNetCore.Components.InjectAttribute] private UserManager<ApplicationUser> _UserManager { get; set; }
        [global::Microsoft.AspNetCore.Components.InjectAttribute] private NavigationManager NavigationManager { get; set; }
    }
}
#pragma warning restore 1591
