#pragma checksum "D:\src\PTCalendar - Copy\SyncfusionSchedulerDeleteBug.BlazorServer\Pages\Calendar.razor" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "8069f655421b44b0be39ec6f9758e31a8dfd4cba"
// <auto-generated/>
#pragma warning disable 1591
namespace SyncfusionSchedulerDeleteBug.Blazor.Server.Pages
{
    #line hidden
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Threading.Tasks;
    using Microsoft.AspNetCore.Components;
#nullable restore
#line 1 "D:\src\PTCalendar - Copy\SyncfusionSchedulerDeleteBug.BlazorServer\_Imports.razor"
using System.Net.Http;

#line default
#line hidden
#nullable disable
#nullable restore
#line 2 "D:\src\PTCalendar - Copy\SyncfusionSchedulerDeleteBug.BlazorServer\_Imports.razor"
using Microsoft.AspNetCore.Authorization;

#line default
#line hidden
#nullable disable
#nullable restore
#line 3 "D:\src\PTCalendar - Copy\SyncfusionSchedulerDeleteBug.BlazorServer\_Imports.razor"
using Microsoft.AspNetCore.Components.Authorization;

#line default
#line hidden
#nullable disable
#nullable restore
#line 4 "D:\src\PTCalendar - Copy\SyncfusionSchedulerDeleteBug.BlazorServer\_Imports.razor"
using Microsoft.AspNetCore.Components.Forms;

#line default
#line hidden
#nullable disable
#nullable restore
#line 5 "D:\src\PTCalendar - Copy\SyncfusionSchedulerDeleteBug.BlazorServer\_Imports.razor"
using Microsoft.AspNetCore.Components.Routing;

#line default
#line hidden
#nullable disable
#nullable restore
#line 6 "D:\src\PTCalendar - Copy\SyncfusionSchedulerDeleteBug.BlazorServer\_Imports.razor"
using Microsoft.AspNetCore.Components.Web;

#line default
#line hidden
#nullable disable
#nullable restore
#line 7 "D:\src\PTCalendar - Copy\SyncfusionSchedulerDeleteBug.BlazorServer\_Imports.razor"
using Microsoft.JSInterop;

#line default
#line hidden
#nullable disable
#nullable restore
#line 8 "D:\src\PTCalendar - Copy\SyncfusionSchedulerDeleteBug.BlazorServer\_Imports.razor"
using SyncfusionSchedulerDeleteBug.Blazor.Server;

#line default
#line hidden
#nullable disable
#nullable restore
#line 9 "D:\src\PTCalendar - Copy\SyncfusionSchedulerDeleteBug.BlazorServer\_Imports.razor"
using SyncfusionSchedulerDeleteBug.Blazor.Server.Shared;

#line default
#line hidden
#nullable disable
#nullable restore
#line 10 "D:\src\PTCalendar - Copy\SyncfusionSchedulerDeleteBug.BlazorServer\_Imports.razor"
using SyncfusionSchedulerDeleteBug.Blazor.Server.Components;

#line default
#line hidden
#nullable disable
#nullable restore
#line 3 "D:\src\PTCalendar - Copy\SyncfusionSchedulerDeleteBug.BlazorServer\Pages\Calendar.razor"
using Syncfusion.Blazor.Schedule;

#line default
#line hidden
#nullable disable
#nullable restore
#line 4 "D:\src\PTCalendar - Copy\SyncfusionSchedulerDeleteBug.BlazorServer\Pages\Calendar.razor"
using Syncfusion.Blazor.Navigations;

#line default
#line hidden
#nullable disable
#nullable restore
#line 6 "D:\src\PTCalendar - Copy\SyncfusionSchedulerDeleteBug.BlazorServer\Pages\Calendar.razor"
using SyncfusionSchedulerDeleteBug.Business.Events;

#line default
#line hidden
#nullable disable
#nullable restore
#line 7 "D:\src\PTCalendar - Copy\SyncfusionSchedulerDeleteBug.BlazorServer\Pages\Calendar.razor"
using SyncfusionSchedulerDeleteBug.Blazor.Server.Data;

#line default
#line hidden
#nullable disable
#nullable restore
#line 8 "D:\src\PTCalendar - Copy\SyncfusionSchedulerDeleteBug.BlazorServer\Pages\Calendar.razor"
using SyncfusionSchedulerDeleteBug.Blazor.Server.Components.Scheduler;

#line default
#line hidden
#nullable disable
#nullable restore
#line 10 "D:\src\PTCalendar - Copy\SyncfusionSchedulerDeleteBug.BlazorServer\Pages\Calendar.razor"
using Csla.Blazor;

#line default
#line hidden
#nullable disable
#nullable restore
#line 11 "D:\src\PTCalendar - Copy\SyncfusionSchedulerDeleteBug.BlazorServer\Pages\Calendar.razor"
using Csla;

#line default
#line hidden
#nullable disable
#nullable restore
#line 13 "D:\src\PTCalendar - Copy\SyncfusionSchedulerDeleteBug.BlazorServer\Pages\Calendar.razor"
using Microsoft.Extensions.Logging;

#line default
#line hidden
#nullable disable
    [Microsoft.AspNetCore.Components.RouteAttribute("/calendar")]
    public partial class Calendar : Microsoft.AspNetCore.Components.ComponentBase
    {
        #pragma warning disable 1998
        protected override void BuildRenderTree(Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder __builder)
        {
#nullable restore
#line 20 "D:\src\PTCalendar - Copy\SyncfusionSchedulerDeleteBug.BlazorServer\Pages\Calendar.razor"
 if (CurrentViewEvents == null)
{

#line default
#line hidden
#nullable disable
            __builder.AddMarkupContent(0, "<p>Loading...</p>");
#nullable restore
#line 23 "D:\src\PTCalendar - Copy\SyncfusionSchedulerDeleteBug.BlazorServer\Pages\Calendar.razor"
}
else
{

#line default
#line hidden
#nullable disable
            __builder.AddMarkupContent(1, @"<div class=""container-fluid""><div class=""filters_section""><div class=""row""><p>Click an event, select delete, the delete confirmation popup is displayed. Clicking the delete button on the confirmation popup does nothing.</p>
                <br>
                <p>It does not fall into OnActionBegin or OnActionComplete. The cancel button etc still works fine, edit is working as expected.</p>
                <br>
                <p>If you downgrade the syncfusion version to what we were using previously, 19.1.0.59, the delete process works without issue.</p></div></div></div>");
            __builder.OpenElement(2, "div");
            __builder.AddAttribute(3, "class", "col-lg-12");
            __builder.OpenElement(4, "div");
            __builder.OpenComponent<Syncfusion.Blazor.Navigations.SfToolbar>(5);
            __builder.AddAttribute(6, "ChildContent", (Microsoft.AspNetCore.Components.RenderFragment)((__builder2) => {
                __builder2.OpenComponent<Syncfusion.Blazor.Navigations.ToolbarItems>(7);
                __builder2.AddAttribute(8, "ChildContent", (Microsoft.AspNetCore.Components.RenderFragment)((__builder3) => {
#nullable restore
#line 43 "D:\src\PTCalendar - Copy\SyncfusionSchedulerDeleteBug.BlazorServer\Pages\Calendar.razor"
                     if (CanCreate)
                    {

#line default
#line hidden
#nullable disable
                    __builder3.OpenComponent<Syncfusion.Blazor.Navigations.ToolbarItem>(9);
                    __builder3.AddAttribute(10, "Type", Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck<Syncfusion.Blazor.Navigations.ItemType>(
#nullable restore
#line 45 "D:\src\PTCalendar - Copy\SyncfusionSchedulerDeleteBug.BlazorServer\Pages\Calendar.razor"
                                            ItemType.Button

#line default
#line hidden
#nullable disable
                    ));
                    __builder3.AddAttribute(11, "Text", "Add");
                    __builder3.AddAttribute(12, "Id", "create");
                    __builder3.AddAttribute(13, "PrefixIcon", "e-create");
                    __builder3.AddAttribute(14, "OnClick", Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck<Microsoft.AspNetCore.Components.EventCallback<Syncfusion.Blazor.Navigations.ClickEventArgs>>(Microsoft.AspNetCore.Components.EventCallback.Factory.Create<Syncfusion.Blazor.Navigations.ClickEventArgs>(this, 
#nullable restore
#line 49 "D:\src\PTCalendar - Copy\SyncfusionSchedulerDeleteBug.BlazorServer\Pages\Calendar.razor"
                                              AddEventClick

#line default
#line hidden
#nullable disable
                    )));
                    __builder3.CloseComponent();
#nullable restore
#line 50 "D:\src\PTCalendar - Copy\SyncfusionSchedulerDeleteBug.BlazorServer\Pages\Calendar.razor"

                    }

#line default
#line hidden
#nullable disable
                }
                ));
                __builder2.CloseComponent();
            }
            ));
            __builder.CloseComponent();
            __builder.CloseElement();
            __builder.AddMarkupContent(15, "\r\n\r\n        ");
            __builder.OpenElement(16, "div");
            __builder.AddAttribute(17, "class", "schedule-wrapper");
            __builder.OpenComponent<Syncfusion.Blazor.Schedule.SfSchedule<CalendarEventInfo>>(18);
            __builder.AddAttribute(19, "Width", "100%");
            __builder.AddAttribute(20, "Height", "700px");
            __builder.AddAttribute(21, "EnableAutoRowHeight", Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck<System.Boolean>(
#nullable restore
#line 62 "D:\src\PTCalendar - Copy\SyncfusionSchedulerDeleteBug.BlazorServer\Pages\Calendar.razor"
                                             true

#line default
#line hidden
#nullable disable
            ));
            __builder.AddAttribute(22, "CssClass", "schedule-date-header-template");
            __builder.AddAttribute(23, "StartHour", "08:00");
            __builder.AddAttribute(24, "EndHour", "20:00");
            __builder.AddAttribute(25, "Timezone", "60");
            __builder.AddAttribute(26, "AllowDragAndDrop", Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck<System.Boolean>(
#nullable restore
#line 67 "D:\src\PTCalendar - Copy\SyncfusionSchedulerDeleteBug.BlazorServer\Pages\Calendar.razor"
                                           CanEdit

#line default
#line hidden
#nullable disable
            ));
            __builder.AddAttribute(27, "CurrentView", Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck<Syncfusion.Blazor.Schedule.View>(
#nullable restore
#line 61 "D:\src\PTCalendar - Copy\SyncfusionSchedulerDeleteBug.BlazorServer\Pages\Calendar.razor"
                                            CurrentView

#line default
#line hidden
#nullable disable
            ));
            __builder.AddAttribute(28, "CurrentViewChanged", Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck<Microsoft.AspNetCore.Components.EventCallback<Syncfusion.Blazor.Schedule.View>>(Microsoft.AspNetCore.Components.EventCallback.Factory.Create<Syncfusion.Blazor.Schedule.View>(this, Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.CreateInferredEventCallback(this, __value => CurrentView = __value, CurrentView))));
            __builder.AddAttribute(29, "CurrentViewExpression", Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck<System.Linq.Expressions.Expression<System.Func<Syncfusion.Blazor.Schedule.View>>>(() => CurrentView));
            __builder.AddAttribute(30, "ChildContent", (Microsoft.AspNetCore.Components.RenderFragment)((__builder2) => {
                __builder2.OpenComponent<Syncfusion.Blazor.Schedule.ScheduleHeaderRows>(31);
                __builder2.AddAttribute(32, "ChildContent", (Microsoft.AspNetCore.Components.RenderFragment)((__builder3) => {
                    __builder3.OpenComponent<Syncfusion.Blazor.Schedule.ScheduleHeaderRow>(33);
                    __builder3.AddAttribute(34, "Option", Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck<Syncfusion.Blazor.Schedule.HeaderRowType>(
#nullable restore
#line 69 "D:\src\PTCalendar - Copy\SyncfusionSchedulerDeleteBug.BlazorServer\Pages\Calendar.razor"
                                               HeaderRowType.Month

#line default
#line hidden
#nullable disable
                    ));
                    __builder3.CloseComponent();
                    __builder3.AddMarkupContent(35, "\r\n                    ");
                    __builder3.OpenComponent<Syncfusion.Blazor.Schedule.ScheduleHeaderRow>(36);
                    __builder3.AddAttribute(37, "Option", Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck<Syncfusion.Blazor.Schedule.HeaderRowType>(
#nullable restore
#line 70 "D:\src\PTCalendar - Copy\SyncfusionSchedulerDeleteBug.BlazorServer\Pages\Calendar.razor"
                                               HeaderRowType.Date

#line default
#line hidden
#nullable disable
                    ));
                    __builder3.CloseComponent();
                    __builder3.AddMarkupContent(38, "\r\n                    ");
                    __builder3.OpenComponent<Syncfusion.Blazor.Schedule.ScheduleHeaderRow>(39);
                    __builder3.AddAttribute(40, "Option", Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck<Syncfusion.Blazor.Schedule.HeaderRowType>(
#nullable restore
#line 71 "D:\src\PTCalendar - Copy\SyncfusionSchedulerDeleteBug.BlazorServer\Pages\Calendar.razor"
                                               HeaderRowType.Hour

#line default
#line hidden
#nullable disable
                    ));
                    __builder3.CloseComponent();
                }
                ));
                __builder2.CloseComponent();
                __builder2.AddMarkupContent(41, "\r\n                ");
                __builder2.OpenComponent<Syncfusion.Blazor.Schedule.ScheduleWorkHours>(42);
                __builder2.AddAttribute(43, "Start", "08:30");
                __builder2.AddAttribute(44, "End", "17:00");
                __builder2.CloseComponent();
                __builder2.AddMarkupContent(45, "\r\n                ");
                __builder2.OpenComponent<Syncfusion.Blazor.Schedule.ScheduleEvents<CalendarEventInfo>>(46);
                __builder2.AddAttribute(47, "OnActionBegin", Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck<Microsoft.AspNetCore.Components.EventCallback<Syncfusion.Blazor.Schedule.ActionEventArgs<CalendarEventInfo>>>(Microsoft.AspNetCore.Components.EventCallback.Factory.Create<Syncfusion.Blazor.Schedule.ActionEventArgs<CalendarEventInfo>>(this, 
#nullable restore
#line 75 "D:\src\PTCalendar - Copy\SyncfusionSchedulerDeleteBug.BlazorServer\Pages\Calendar.razor"
                                               OnActionBegin

#line default
#line hidden
#nullable disable
                )));
                __builder2.AddAttribute(48, "ActionCompleted", Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck<Microsoft.AspNetCore.Components.EventCallback<Syncfusion.Blazor.Schedule.ActionEventArgs<CalendarEventInfo>>>(Microsoft.AspNetCore.Components.EventCallback.Factory.Create<Syncfusion.Blazor.Schedule.ActionEventArgs<CalendarEventInfo>>(this, 
#nullable restore
#line 76 "D:\src\PTCalendar - Copy\SyncfusionSchedulerDeleteBug.BlazorServer\Pages\Calendar.razor"
                                                 OnActionComplete

#line default
#line hidden
#nullable disable
                )));
                __builder2.AddAttribute(49, "OnPopupOpen", Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck<Microsoft.AspNetCore.Components.EventCallback<Syncfusion.Blazor.Schedule.PopupOpenEventArgs<CalendarEventInfo>>>(Microsoft.AspNetCore.Components.EventCallback.Factory.Create<Syncfusion.Blazor.Schedule.PopupOpenEventArgs<CalendarEventInfo>>(this, 
#nullable restore
#line 77 "D:\src\PTCalendar - Copy\SyncfusionSchedulerDeleteBug.BlazorServer\Pages\Calendar.razor"
                                             OnPopupOpen

#line default
#line hidden
#nullable disable
                )));
                __builder2.AddAttribute(50, "Dragged", Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck<Microsoft.AspNetCore.Components.EventCallback<Syncfusion.Blazor.Schedule.DragEventArgs<CalendarEventInfo>>>(Microsoft.AspNetCore.Components.EventCallback.Factory.Create<Syncfusion.Blazor.Schedule.DragEventArgs<CalendarEventInfo>>(this, 
#nullable restore
#line 78 "D:\src\PTCalendar - Copy\SyncfusionSchedulerDeleteBug.BlazorServer\Pages\Calendar.razor"
                                         OnDragged

#line default
#line hidden
#nullable disable
                )));
                __builder2.CloseComponent();
                __builder2.AddMarkupContent(51, "\r\n                ");
                __builder2.OpenComponent<Syncfusion.Blazor.Schedule.ScheduleQuickInfoTemplates>(52);
                __builder2.AddAttribute(53, "HeaderTemplate", (Microsoft.AspNetCore.Components.RenderFragment<System.Object>)((context) => (__builder3) => {
                    __builder3.OpenComponent<SyncfusionSchedulerDeleteBug.Blazor.Server.Components.Scheduler.SchedulerQuickInfoHeader>(54);
                    __builder3.AddAttribute(55, "Event", Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck<SyncfusionSchedulerDeleteBug.Business.Events.IHoldCalendarEventInfo>(
#nullable restore
#line 82 "D:\src\PTCalendar - Copy\SyncfusionSchedulerDeleteBug.BlazorServer\Pages\Calendar.razor"
                                                             context as IHoldCalendarEventInfo

#line default
#line hidden
#nullable disable
                    ));
                    __builder3.CloseComponent();
                }
                ));
                __builder2.AddAttribute(56, "ContentTemplate", (Microsoft.AspNetCore.Components.RenderFragment<System.Object>)((context) => (__builder3) => {
                    __builder3.OpenComponent<SyncfusionSchedulerDeleteBug.Blazor.Server.Components.Scheduler.SchedulerQuickInfoContent>(57);
                    __builder3.AddAttribute(58, "Event", Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck<SyncfusionSchedulerDeleteBug.Business.Events.IHoldCalendarEventInfo>(
#nullable restore
#line 87 "D:\src\PTCalendar - Copy\SyncfusionSchedulerDeleteBug.BlazorServer\Pages\Calendar.razor"
                                                              context as IHoldCalendarEventInfo

#line default
#line hidden
#nullable disable
                    ));
                    __builder3.CloseComponent();
                }
                ));
                __builder2.CloseComponent();
                __builder2.AddMarkupContent(59, "\r\n\r\n                ");
                __builder2.OpenComponent<Syncfusion.Blazor.Schedule.ScheduleViews>(60);
                __builder2.AddAttribute(61, "ChildContent", (Microsoft.AspNetCore.Components.RenderFragment)((__builder3) => {
                    __builder3.OpenComponent<Syncfusion.Blazor.Schedule.ScheduleView>(62);
                    __builder3.AddAttribute(63, "Option", Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck<Syncfusion.Blazor.Schedule.View>(
#nullable restore
#line 93 "D:\src\PTCalendar - Copy\SyncfusionSchedulerDeleteBug.BlazorServer\Pages\Calendar.razor"
                                          View.TimelineWeek

#line default
#line hidden
#nullable disable
                    ));
                    __builder3.AddAttribute(64, "EventTemplate", (Microsoft.AspNetCore.Components.RenderFragment<System.Object>)((context) => (__builder4) => {
                        __builder4.OpenComponent<SyncfusionSchedulerDeleteBug.Blazor.Server.Components.Scheduler.SchedulerWeekEvent>(65);
                        __builder4.AddAttribute(66, "Event", Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck<SyncfusionSchedulerDeleteBug.Business.Events.IHoldCalendarEventInfo>(
#nullable restore
#line 95 "D:\src\PTCalendar - Copy\SyncfusionSchedulerDeleteBug.BlazorServer\Pages\Calendar.razor"
                                                       context as IHoldCalendarEventInfo

#line default
#line hidden
#nullable disable
                        ));
                        __builder4.CloseComponent();
                    }
                    ));
                    __builder3.CloseComponent();
                    __builder3.AddMarkupContent(67, "\r\n                    ");
                    __builder3.OpenComponent<Syncfusion.Blazor.Schedule.ScheduleView>(68);
                    __builder3.AddAttribute(69, "Option", Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck<Syncfusion.Blazor.Schedule.View>(
#nullable restore
#line 98 "D:\src\PTCalendar - Copy\SyncfusionSchedulerDeleteBug.BlazorServer\Pages\Calendar.razor"
                                          View.TimelineMonth

#line default
#line hidden
#nullable disable
                    ));
                    __builder3.AddAttribute(70, "EventTemplate", (Microsoft.AspNetCore.Components.RenderFragment<System.Object>)((context) => (__builder4) => {
                        __builder4.OpenComponent<SyncfusionSchedulerDeleteBug.Blazor.Server.Components.Scheduler.SchedulerMonthEvent>(71);
                        __builder4.AddAttribute(72, "Event", Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck<SyncfusionSchedulerDeleteBug.Business.Events.IHoldCalendarEventInfo>(
#nullable restore
#line 100 "D:\src\PTCalendar - Copy\SyncfusionSchedulerDeleteBug.BlazorServer\Pages\Calendar.razor"
                                                        context as IHoldCalendarEventInfo

#line default
#line hidden
#nullable disable
                        ));
                        __builder4.CloseComponent();
                    }
                    ));
                    __builder3.CloseComponent();
                }
                ));
                __builder2.CloseComponent();
                __builder2.AddMarkupContent(73, "\r\n\r\n                \r\n                ");
                __builder2.OpenComponent<Syncfusion.Blazor.Schedule.ScheduleTimeScale>(74);
                __builder2.AddAttribute(75, "Enable", Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck<System.Boolean>(
#nullable restore
#line 106 "D:\src\PTCalendar - Copy\SyncfusionSchedulerDeleteBug.BlazorServer\Pages\Calendar.razor"
                                           true

#line default
#line hidden
#nullable disable
                ));
                __builder2.AddAttribute(76, "Interval", Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck<System.Int32>(
#nullable restore
#line 107 "D:\src\PTCalendar - Copy\SyncfusionSchedulerDeleteBug.BlazorServer\Pages\Calendar.razor"
                                             60

#line default
#line hidden
#nullable disable
                ));
                __builder2.AddAttribute(77, "SlotCount", Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck<System.Int32>(
#nullable restore
#line 108 "D:\src\PTCalendar - Copy\SyncfusionSchedulerDeleteBug.BlazorServer\Pages\Calendar.razor"
                                              1

#line default
#line hidden
#nullable disable
                ));
                __builder2.CloseComponent();
                __builder2.AddMarkupContent(78, "\r\n\r\n                ");
                __builder2.OpenComponent<Syncfusion.Blazor.Schedule.ScheduleGroup>(79);
                __builder2.AddAttribute(80, "EnableCompactView", Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck<System.Boolean>(
#nullable restore
#line 110 "D:\src\PTCalendar - Copy\SyncfusionSchedulerDeleteBug.BlazorServer\Pages\Calendar.razor"
                                                  true

#line default
#line hidden
#nullable disable
                ));
                __builder2.AddAttribute(81, "Resources", Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck<System.String[]>(
#nullable restore
#line 110 "D:\src\PTCalendar - Copy\SyncfusionSchedulerDeleteBug.BlazorServer\Pages\Calendar.razor"
                                                                    GroupData

#line default
#line hidden
#nullable disable
                ));
                __builder2.CloseComponent();
                __builder2.AddMarkupContent(82, "\r\n                ");
                __builder2.OpenComponent<Syncfusion.Blazor.Schedule.ScheduleResources>(83);
                __builder2.AddAttribute(84, "ChildContent", (Microsoft.AspNetCore.Components.RenderFragment)((__builder3) => {
                    __builder3.OpenComponent<Syncfusion.Blazor.Schedule.ScheduleResource<int, ProjectData>>(85);
                    __builder3.AddAttribute(86, "DataSource", Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck<System.Collections.Generic.IEnumerable<ProjectData>>(
#nullable restore
#line 112 "D:\src\PTCalendar - Copy\SyncfusionSchedulerDeleteBug.BlazorServer\Pages\Calendar.razor"
                                                                                    Projects

#line default
#line hidden
#nullable disable
                    ));
                    __builder3.AddAttribute(87, "Name", "Projects");
                    __builder3.AddAttribute(88, "Field", Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck<System.String>(
#nullable restore
#line 112 "D:\src\PTCalendar - Copy\SyncfusionSchedulerDeleteBug.BlazorServer\Pages\Calendar.razor"
                                                                                                                      nameof(CalendarEventInfo.ProjectId)

#line default
#line hidden
#nullable disable
                    ));
                    __builder3.AddAttribute(89, "TextField", Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck<System.String>(
#nullable restore
#line 112 "D:\src\PTCalendar - Copy\SyncfusionSchedulerDeleteBug.BlazorServer\Pages\Calendar.razor"
                                                                                                                                                                       nameof(ProjectData.ProjectName)

#line default
#line hidden
#nullable disable
                    ));
                    __builder3.AddAttribute(90, "IdField", Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck<System.String>(
#nullable restore
#line 112 "D:\src\PTCalendar - Copy\SyncfusionSchedulerDeleteBug.BlazorServer\Pages\Calendar.razor"
                                                                                                                                                                                                                  nameof(ProjectData.ProjectId)

#line default
#line hidden
#nullable disable
                    ));
                    __builder3.CloseComponent();
                    __builder3.AddMarkupContent(91, "\r\n                    ");
                    __builder3.OpenComponent<Syncfusion.Blazor.Schedule.ScheduleResource<int, UserProjectData>>(92);
                    __builder3.AddAttribute(93, "DataSource", Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck<System.Collections.Generic.IEnumerable<UserProjectData>>(
#nullable restore
#line 113 "D:\src\PTCalendar - Copy\SyncfusionSchedulerDeleteBug.BlazorServer\Pages\Calendar.razor"
                                                                                        Workers

#line default
#line hidden
#nullable disable
                    ));
                    __builder3.AddAttribute(94, "Name", "Workers");
                    __builder3.AddAttribute(95, "Field", Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck<System.String>(
#nullable restore
#line 113 "D:\src\PTCalendar - Copy\SyncfusionSchedulerDeleteBug.BlazorServer\Pages\Calendar.razor"
                                                                                                                        nameof(CalendarEventInfo.WorkerId)

#line default
#line hidden
#nullable disable
                    ));
                    __builder3.AddAttribute(96, "TextField", Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck<System.String>(
#nullable restore
#line 113 "D:\src\PTCalendar - Copy\SyncfusionSchedulerDeleteBug.BlazorServer\Pages\Calendar.razor"
                                                                                                                                                                        nameof(UserProjectData.WorkerName)

#line default
#line hidden
#nullable disable
                    ));
                    __builder3.AddAttribute(97, "IdField", Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck<System.String>(
#nullable restore
#line 113 "D:\src\PTCalendar - Copy\SyncfusionSchedulerDeleteBug.BlazorServer\Pages\Calendar.razor"
                                                                                                                                                                                                                      nameof(UserProjectData.WorkerId)

#line default
#line hidden
#nullable disable
                    ));
                    __builder3.AddAttribute(98, "GroupIDField", Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck<System.String>(
#nullable restore
#line 113 "D:\src\PTCalendar - Copy\SyncfusionSchedulerDeleteBug.BlazorServer\Pages\Calendar.razor"
                                                                                                                                                                                                                                                                       nameof(UserProjectData.ProjectId)

#line default
#line hidden
#nullable disable
                    ));
                    __builder3.CloseComponent();
                }
                ));
                __builder2.CloseComponent();
                __builder2.AddMarkupContent(99, "\r\n\r\n                ");
                __builder2.OpenComponent<Syncfusion.Blazor.Schedule.ScheduleEventSettings<CalendarEventInfo>>(100);
                __builder2.AddAttribute(101, "DataSource", Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck<System.Collections.Generic.IEnumerable<CalendarEventInfo>>(
#nullable restore
#line 117 "D:\src\PTCalendar - Copy\SyncfusionSchedulerDeleteBug.BlazorServer\Pages\Calendar.razor"
                                                    CurrentViewEvents

#line default
#line hidden
#nullable disable
                ));
                __builder2.AddAttribute(102, "AllowAdding", Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck<System.Boolean>(
#nullable restore
#line 118 "D:\src\PTCalendar - Copy\SyncfusionSchedulerDeleteBug.BlazorServer\Pages\Calendar.razor"
                                                     CanCreate

#line default
#line hidden
#nullable disable
                ));
                __builder2.AddAttribute(103, "AllowEditing", Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck<System.Boolean>(
#nullable restore
#line 119 "D:\src\PTCalendar - Copy\SyncfusionSchedulerDeleteBug.BlazorServer\Pages\Calendar.razor"
                                                      CanEdit

#line default
#line hidden
#nullable disable
                ));
                __builder2.AddAttribute(104, "AllowDeleting", Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck<System.Boolean>(
#nullable restore
#line 120 "D:\src\PTCalendar - Copy\SyncfusionSchedulerDeleteBug.BlazorServer\Pages\Calendar.razor"
                                                       CanDelete

#line default
#line hidden
#nullable disable
                ));
                __builder2.AddAttribute(105, "AllowEditFollowingEvents", Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck<System.Boolean>(
#nullable restore
#line 121 "D:\src\PTCalendar - Copy\SyncfusionSchedulerDeleteBug.BlazorServer\Pages\Calendar.razor"
                                                                  CanEdit

#line default
#line hidden
#nullable disable
                ));
                __builder2.AddAttribute(106, "ChildContent", (Microsoft.AspNetCore.Components.RenderFragment)((__builder3) => {
                    __builder3.OpenComponent<Syncfusion.Blazor.Schedule.ScheduleField>(107);
                    __builder3.AddAttribute(108, "ChildContent", (Microsoft.AspNetCore.Components.RenderFragment)((__builder4) => {
                        __builder4.OpenComponent<Syncfusion.Blazor.Schedule.FieldSubject>(109);
                        __builder4.AddAttribute(110, "Title", "Type");
                        __builder4.CloseComponent();
                    }
                    ));
                    __builder3.CloseComponent();
                }
                ));
                __builder2.CloseComponent();
                __builder2.AddMarkupContent(111, "\r\n\r\n                ");
                __builder2.OpenComponent<Syncfusion.Blazor.Schedule.ScheduleTemplates>(112);
                __builder2.AddAttribute(113, "DateHeaderTemplate", (Microsoft.AspNetCore.Components.RenderFragment<Syncfusion.Blazor.Schedule.TemplateContext>)((context) => (__builder3) => {
#nullable restore
#line 129 "D:\src\PTCalendar - Copy\SyncfusionSchedulerDeleteBug.BlazorServer\Pages\Calendar.razor"
                          
                            var date = (context as TemplateContext).Date;

                            

#line default
#line hidden
#nullable disable
#nullable restore
#line 132 "D:\src\PTCalendar - Copy\SyncfusionSchedulerDeleteBug.BlazorServer\Pages\Calendar.razor"
                             if (CurrentView == View.TimelineMonth)
                            {

#line default
#line hidden
#nullable disable
                    __builder3.OpenElement(114, "div");
                    __builder3.AddAttribute(115, "class", "date-text");
                    __builder3.AddContent(116, 
#nullable restore
#line 134 "D:\src\PTCalendar - Copy\SyncfusionSchedulerDeleteBug.BlazorServer\Pages\Calendar.razor"
                                                        date.ToString("dd")

#line default
#line hidden
#nullable disable
                    );
                    __builder3.CloseElement();
                    __builder3.AddMarkupContent(117, "\r\n                                ");
                    __builder3.OpenElement(118, "div");
                    __builder3.AddAttribute(119, "class", "date-text");
                    __builder3.AddContent(120, 
#nullable restore
#line 135 "D:\src\PTCalendar - Copy\SyncfusionSchedulerDeleteBug.BlazorServer\Pages\Calendar.razor"
                                                        date.ToString("ddd")

#line default
#line hidden
#nullable disable
                    );
                    __builder3.CloseElement();
#nullable restore
#line 136 "D:\src\PTCalendar - Copy\SyncfusionSchedulerDeleteBug.BlazorServer\Pages\Calendar.razor"
                            }
                            else if (CurrentView == View.TimelineWeek)
                            {

#line default
#line hidden
#nullable disable
                    __builder3.OpenElement(121, "div");
                    __builder3.AddAttribute(122, "class", "date-text");
                    __builder3.AddContent(123, 
#nullable restore
#line 139 "D:\src\PTCalendar - Copy\SyncfusionSchedulerDeleteBug.BlazorServer\Pages\Calendar.razor"
                                                        date.ToString("dddd, dd MMMM")

#line default
#line hidden
#nullable disable
                    );
                    __builder3.CloseElement();
#nullable restore
#line 140 "D:\src\PTCalendar - Copy\SyncfusionSchedulerDeleteBug.BlazorServer\Pages\Calendar.razor"
                            }

#line default
#line hidden
#nullable disable
                }
                ));
                __builder2.AddAttribute(124, "ResourceHeaderTemplate", (Microsoft.AspNetCore.Components.RenderFragment<Syncfusion.Blazor.Schedule.TemplateContext>)((context) => (__builder3) => {
#nullable restore
#line 144 "D:\src\PTCalendar - Copy\SyncfusionSchedulerDeleteBug.BlazorServer\Pages\Calendar.razor"
                          
                            var templateContext = (context as TemplateContext);

                            if (templateContext.ResourceData is ProjectData project)
                            {

#line default
#line hidden
#nullable disable
                    __builder3.OpenElement(125, "div");
                    __builder3.AddAttribute(126, "class", "schedule-group-text");
                    __builder3.OpenElement(127, "div");
                    __builder3.AddAttribute(128, "class", "schedule-group-parent");
                    __builder3.AddContent(129, 
#nullable restore
#line 151 "D:\src\PTCalendar - Copy\SyncfusionSchedulerDeleteBug.BlazorServer\Pages\Calendar.razor"
                                          project.ProjectName

#line default
#line hidden
#nullable disable
                    );
                    __builder3.CloseElement();
                    __builder3.CloseElement();
#nullable restore
#line 154 "D:\src\PTCalendar - Copy\SyncfusionSchedulerDeleteBug.BlazorServer\Pages\Calendar.razor"
                            }
                            else if (templateContext.ResourceData is UserProjectData worker)
                            {

#line default
#line hidden
#nullable disable
                    __builder3.OpenElement(130, "div");
                    __builder3.AddAttribute(131, "class", "schedule-group-text");
                    __builder3.OpenElement(132, "div");
                    __builder3.AddAttribute(133, "class", "schedule-group-child");
                    __builder3.AddContent(134, 
#nullable restore
#line 159 "D:\src\PTCalendar - Copy\SyncfusionSchedulerDeleteBug.BlazorServer\Pages\Calendar.razor"
                                          worker.WorkerName

#line default
#line hidden
#nullable disable
                    );
                    __builder3.CloseElement();
                    __builder3.CloseElement();
#nullable restore
#line 162 "D:\src\PTCalendar - Copy\SyncfusionSchedulerDeleteBug.BlazorServer\Pages\Calendar.razor"
                            }
                        

#line default
#line hidden
#nullable disable
                }
                ));
                __builder2.CloseComponent();
            }
            ));
            __builder.AddComponentReferenceCapture(135, (__value) => {
#nullable restore
#line 58 "D:\src\PTCalendar - Copy\SyncfusionSchedulerDeleteBug.BlazorServer\Pages\Calendar.razor"
                               ScheduleRef = (Syncfusion.Blazor.Schedule.SfSchedule<CalendarEventInfo>)__value;

#line default
#line hidden
#nullable disable
            }
            );
            __builder.CloseComponent();
            __builder.AddMarkupContent(136, "\r\n\r\n            ");
            __builder.OpenComponent<SyncfusionSchedulerDeleteBug.Blazor.Server.Components.Scheduler.CalendarEventEditDialog>(137);
            __builder.AddComponentReferenceCapture(138, (__value) => {
#nullable restore
#line 168 "D:\src\PTCalendar - Copy\SyncfusionSchedulerDeleteBug.BlazorServer\Pages\Calendar.razor"
                                           editDialog = (SyncfusionSchedulerDeleteBug.Blazor.Server.Components.Scheduler.CalendarEventEditDialog)__value;

#line default
#line hidden
#nullable disable
            }
            );
            __builder.CloseComponent();
            __builder.CloseElement();
            __builder.CloseElement();
#nullable restore
#line 171 "D:\src\PTCalendar - Copy\SyncfusionSchedulerDeleteBug.BlazorServer\Pages\Calendar.razor"
}

#line default
#line hidden
#nullable disable
        }
        #pragma warning restore 1998
#nullable restore
#line 175 "D:\src\PTCalendar - Copy\SyncfusionSchedulerDeleteBug.BlazorServer\Pages\Calendar.razor"
 
        #region properties

    private CalendarEventEditDialog editDialog;

    private SfSchedule<CalendarEventInfo> ScheduleRef;
    private View CurrentView { get; set; }

    private DateTime DefaultDate { get; set; }
    private DateTime CurrentDate { get; set; }

    private DateTime CurrentViewFrom { get; set; }
    private DateTime CurrentViewTo { get; set; }
    private List<CalendarEventInfo> CurrentViewEvents { get; set; }

    public string[] GroupData = new string[] { "Projects", "Workers" };

    private bool RefreshChildren { get; set; }

    private List<ProjectData> Projects { get; set; }
    private List<UserProjectData> Workers { get; set; }

    private TimeSpan? UserOffset;

    [CascadingParameter]
    public Error Error { get; set; }

    private bool CanCreate { get; set; }
    private bool CanEdit { get; set; }
    private bool CanDelete { get; set; }

    #endregion

    #region code behind only

    #region lifecycle

    protected override async Task OnInitializedAsync()
    {
        CanCreate = true;
        CanEdit = true;
        CanDelete = true;

        CurrentView = View.TimelineMonth;

        DefaultDate = DateTime.Today;
        CurrentDate = DateTime.Today;
        CurrentViewFrom = new DateTime(CurrentDate.Year, CurrentDate.Month, CurrentDate.Day);
        CurrentViewTo = new DateTime(CurrentDate.Year, CurrentDate.Month, DateTime.DaysInMonth(CurrentDate.Year, CurrentDate.Month));

        Projects = new List<ProjectData>();
        Workers = new List<UserProjectData>();

        await RefreshEvents();
    }

    protected override async Task OnAfterRenderAsync(bool firstRender)
    {
        if (firstRender)
        {
            //do not bind before render
            eventsViewModel.ModelChanging += async (o, n) => { await OnModelChanging(o, n); };
            await tzService.ApplyOffset(eventsViewModel.Model);
            RefreshCurrentViewEvents(eventsViewModel.Model);
        }

        RefreshChildren = false; //block refresh until event is saved
    }

    #endregion

    private async Task RefreshEvents()
    {
        DateRangeCriteria dates = new DateRangeCriteria(CurrentDate.AddYears(-1), CurrentDate.AddYears(+1));

        try
        {
            await eventsViewModel.RefreshAsync(() => DataPortal.FetchAsync<CalendarEventsList>(dates));
        }
        catch (Exception ex)
        {
            logger.LogError(ex, "Unable to refresh events due to an error");
        }
    }

    private async Task OnModelChanging(CalendarEventsList oldModel, CalendarEventsList newModel)
    {
        await tzService.ApplyOffset(newModel);

        RefreshCurrentViewEvents(newModel);
    }

    private void ReadCurrentViewDates()
    {
        try
        {
            //read from scheduler control
            var currentViewDates = ScheduleRef.GetCurrentViewDates();

            CurrentViewFrom = currentViewDates.Min();
            CurrentViewTo = currentViewDates.Max();
        }
        catch (Exception ex)
        {
            logger.LogError(ex, "Unable to read current view dates due to an error");
        }
    }

    private void RefreshCurrentViewEvents(CalendarEventsList events)
    {
        if (events is null)
            return;

        try
        {
            CurrentViewEvents = events.GetEventsForRange(CurrentViewFrom, CurrentViewTo);

            RefreshProjectsGroup(CurrentViewEvents);
            RefreshWorkersGroup(CurrentViewEvents);
        }
        catch (Exception ex)
        {
            logger.LogError(ex, "Unable to refresh current view events due to an error");
        }

        StateHasChanged();
    }

    private void RefreshProjectsGroup(IList<CalendarEventInfo> events)
    {
        try
        {
            Projects = (from e in events.GroupBy(x => new { x.ProjectId, x.ProjectName })
                        select new ProjectData()
                        {
                            ProjectId = e.Key.ProjectId,
                            ProjectName = e.Key.ProjectName
                        }).OrderBy(x => x.ProjectName).ToList();

        }
        catch (Exception ex)
        {
            logger.LogError(ex, "Unable to refresh projects group due to an error");
        }
    }

    private void RefreshWorkersGroup(IList<CalendarEventInfo> events)
    {
        try
        {
            Workers = (from e in events.GroupBy(x => new { x.WorkerId, x.WorkersFullName, x.CompanyId, x.ProjectId, x.ProjectName, x.CompanyName, x.CountryId, x.Country })
                       select new UserProjectData()
                       {
                           ProjectId = e.Key.ProjectId,
                           WorkerId = e.Key.WorkerId,
                           WorkerName = e.Key.WorkersFullName,
                           CompanyId = e.Key.CompanyId,
                           CompanyName = e.Key.CompanyName,
                           ProjectName = e.Key.ProjectName,
                           CountryId = e.Key.CountryId,
                           Country = e.Key.Country
                       }).OrderBy(x => x.WorkerName).ToList();
        }
        catch (Exception ex)
        {
            logger.LogError(ex, "Unable to refresh workers group due to an error");
        }
    }

    #endregion


    #region scheduler

    public void OnActionBegin(ActionEventArgs<CalendarEventInfo> args)
    {
        switch (args.ActionType)
        {

            case ActionType.EventRemove:
                //never gets here anymore

                break;
        }
    }

    public void OnActionComplete(ActionEventArgs<CalendarEventInfo> args)
    {
        switch (args.ActionType)
        {
            case ActionType.EventRemove:

                //never gets here anymore
                if (!CanDelete)
                    return;

                var deleted = args.DeletedRecords;
                var changed = args.ChangedRecords;

                scheduleController.EventDelete(deleted, changed);
                break;

            default:
                break;

        }
    }

    public async Task OnPopupOpen(PopupOpenEventArgs<CalendarEventInfo> args)
    {
        if (args.Type == PopupType.QuickInfo)
        {
            if (args.Data.Id == 0)
                args.Cancel = true; //do not show the quick info form for a new event
        }
        else if (args.Type == PopupType.Editor)
        {
            args.Cancel = true;

            if (args.Data.Id == 0)
            {
                await CreateEvent(args.Data);
            }
            else
            {
                CurrentAction action = ScheduleRef.GetCurrentAction();
                switch (action)
                {
                    case CurrentAction.EditOccurrence:
                        await EditOccurence(args.Data.Id, args.Data.StartTime);
                        break;
                    default:
                        await EditEvent(args.Data.Id);
                        break;
                }
            }
        }
        else if(args.Type == PopupType.RecurrenceAlert)
        {
            if (!CanEdit)
                args.Cancel = true;
        }
    }

    private async Task EditEvent(int eventId)
    {
        if (!CanEdit)
            return;

        await editDialog.Edit(eventId);
    }

    private async Task EditOccurence(int eventId, DateTime occurenceDate)
    {
        if (!CanEdit)
            return;

        await editDialog.EditOccurence(eventId, occurenceDate);
    }

    private async Task CreateEvent(CalendarEventInfo data)
    {
        if (!CanCreate)
            return;

        //each workerid/projectid combo should be unique, set the default company id for a new event accordingly
        UserProjectData project = Workers.Where(x => x.WorkerId == data.WorkerId && x.ProjectId == data.ProjectId).FirstOrDefault();

        if (project is null)
            return; //what will this do?
        else
        {
            data.CompanyId = project.CompanyId;
            data.CountryId = project.CountryId;
        }

        var start = DateTime.Now;
        var end = DateTime.Now;

        CalendarEventCreateCriteria criteria = new CalendarEventCreateCriteria()
        {
            WorkerId = data.WorkerId,
            CompanyId = data.CompanyId,
            ProjectId = data.ProjectId,
            CountryId = data.CountryId,
            StartDate = start,
            EndDate = end
        };

        await editDialog.Create(criteria);
    }

    public void OnDragged(Syncfusion.Blazor.Schedule.DragEventArgs<CalendarEventInfo> args)
    {
        CalendarEventInfo item = args.Data;
        //CalendarEventEdit savedItem = DataPortal.Fetch<CalendarEventEdit>(item.Id);
        //if (savedItem.WorkerId != item.WorkerId || savedItem.ProjectId != item.ProjectId)
        //{
        //    args.Cancel = true;
        //}
    }

    private async void EventSaved(int eventId)
    {
        await RefreshEvents();

        RefreshChildren = true;

        StateHasChanged();
    }

    #endregion

    #region toolbar

    public async Task AddEventClick(ClickEventArgs args)
    {
        var start = DateTime.Now;
        var end = DateTime.Now;

        await editDialog.Create(start, end);
    }

    #endregion


#line default
#line hidden
#nullable disable
        [global::Microsoft.AspNetCore.Components.InjectAttribute] private ILogger<Calendar> logger { get; set; }
        [global::Microsoft.AspNetCore.Components.InjectAttribute] private TimeZoneService tzService { get; set; }
        [global::Microsoft.AspNetCore.Components.InjectAttribute] private ScheduleController scheduleController { get; set; }
        [global::Microsoft.AspNetCore.Components.InjectAttribute] private ViewModel<CalendarEventsList> eventsViewModel { get; set; }
    }
}
#pragma warning restore 1591
