#pragma checksum "C:\Users\PawLie\Documents\Development\BTSM\Security\Analysis\Pages\Calculator.razor" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "0a210f8d8e8093f64b2866eb44908712597cf0d9"
// <auto-generated/>
#pragma warning disable 1591
namespace Analysis.Pages
{
    #line hidden
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Threading.Tasks;
#nullable restore
#line 1 "C:\Users\PawLie\Documents\Development\BTSM\Security\Analysis\_Imports.razor"
using System.Net.Http;

#line default
#line hidden
#nullable disable
#nullable restore
#line 2 "C:\Users\PawLie\Documents\Development\BTSM\Security\Analysis\_Imports.razor"
using System.Net.Http.Json;

#line default
#line hidden
#nullable disable
#nullable restore
#line 3 "C:\Users\PawLie\Documents\Development\BTSM\Security\Analysis\_Imports.razor"
using Microsoft.AspNetCore.Components;

#line default
#line hidden
#nullable disable
#nullable restore
#line 4 "C:\Users\PawLie\Documents\Development\BTSM\Security\Analysis\_Imports.razor"
using Microsoft.AspNetCore.Components.Forms;

#line default
#line hidden
#nullable disable
#nullable restore
#line 5 "C:\Users\PawLie\Documents\Development\BTSM\Security\Analysis\_Imports.razor"
using Microsoft.AspNetCore.Components.Routing;

#line default
#line hidden
#nullable disable
#nullable restore
#line 6 "C:\Users\PawLie\Documents\Development\BTSM\Security\Analysis\_Imports.razor"
using Microsoft.AspNetCore.Components.Web;

#line default
#line hidden
#nullable disable
#nullable restore
#line 7 "C:\Users\PawLie\Documents\Development\BTSM\Security\Analysis\_Imports.razor"
using Microsoft.AspNetCore.Components.WebAssembly.Http;

#line default
#line hidden
#nullable disable
#nullable restore
#line 8 "C:\Users\PawLie\Documents\Development\BTSM\Security\Analysis\_Imports.razor"
using Microsoft.JSInterop;

#line default
#line hidden
#nullable disable
#nullable restore
#line 9 "C:\Users\PawLie\Documents\Development\BTSM\Security\Analysis\_Imports.razor"
using Analysis;

#line default
#line hidden
#nullable disable
#nullable restore
#line 10 "C:\Users\PawLie\Documents\Development\BTSM\Security\Analysis\_Imports.razor"
using Analysis.Shared;

#line default
#line hidden
#nullable disable
#nullable restore
#line 11 "C:\Users\PawLie\Documents\Development\BTSM\Security\Analysis\_Imports.razor"
using Analysis.Models;

#line default
#line hidden
#nullable disable
#nullable restore
#line 12 "C:\Users\PawLie\Documents\Development\BTSM\Security\Analysis\_Imports.razor"
using Analysis.Services;

#line default
#line hidden
#nullable disable
#nullable restore
#line 13 "C:\Users\PawLie\Documents\Development\BTSM\Security\Analysis\_Imports.razor"
using System.Globalization;

#line default
#line hidden
#nullable disable
#nullable restore
#line 14 "C:\Users\PawLie\Documents\Development\BTSM\Security\Analysis\_Imports.razor"
using System.IO;

#line default
#line hidden
#nullable disable
#nullable restore
#line 15 "C:\Users\PawLie\Documents\Development\BTSM\Security\Analysis\_Imports.razor"
using System.Text.Json;

#line default
#line hidden
#nullable disable
#nullable restore
#line 16 "C:\Users\PawLie\Documents\Development\BTSM\Security\Analysis\_Imports.razor"
using System.Text;

#line default
#line hidden
#nullable disable
#nullable restore
#line 17 "C:\Users\PawLie\Documents\Development\BTSM\Security\Analysis\_Imports.razor"
using BlazorInputFile;

#line default
#line hidden
#nullable disable
    [Microsoft.AspNetCore.Components.RouteAttribute("/questions")]
    public partial class Calculator : Microsoft.AspNetCore.Components.ComponentBase
    {
        #pragma warning disable 1998
        protected override void BuildRenderTree(Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder __builder)
        {
            __builder.OpenElement(0, "div");
            __builder.AddAttribute(1, "style", "display:list-item;");
            __builder.AddAttribute(2, "class", "top-row px-4");
            __builder.AddMarkupContent(3, "\r\n\t");
            __builder.OpenElement(4, "button");
            __builder.AddAttribute(5, "onclick", Microsoft.AspNetCore.Components.EventCallback.Factory.Create<Microsoft.AspNetCore.Components.Web.MouseEventArgs>(this, 
#nullable restore
#line 6 "C:\Users\PawLie\Documents\Development\BTSM\Security\Analysis\Pages\Calculator.razor"
                      DownloadText

#line default
#line hidden
#nullable disable
            ));
            __builder.AddAttribute(6, "class", "btn btn-primary button-top-left");
            __builder.AddMarkupContent(7, "Uložit řešení <span class=\"oi oi-inbox\" aria-hidden=\"true\"></span>");
            __builder.CloseElement();
            __builder.AddMarkupContent(8, "\r\n\t");
            __builder.OpenElement(9, "label");
            __builder.AddAttribute(10, "class", "button-top-left btn btn-primary");
            __builder.AddMarkupContent(11, "\r\n\t\t");
            __builder.OpenComponent<BlazorInputFile.InputFile>(12);
            __builder.AddAttribute(13, "style", "display: none;");
            __builder.AddAttribute(14, "OnChange", Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck<Microsoft.AspNetCore.Components.EventCallback<BlazorInputFile.IFileListEntry[]>>(Microsoft.AspNetCore.Components.EventCallback.Factory.Create<BlazorInputFile.IFileListEntry[]>(this, 
#nullable restore
#line 8 "C:\Users\PawLie\Documents\Development\BTSM\Security\Analysis\Pages\Calculator.razor"
                                                    UploadFile

#line default
#line hidden
#nullable disable
            )));
            __builder.CloseComponent();
            __builder.AddMarkupContent(15, "Nahrát soubor <span class=\"oi oi-file\" aria-hidden=\"true\"></span>\r\n\t");
            __builder.CloseElement();
            __builder.AddMarkupContent(16, "\r\n");
#nullable restore
#line 10 "C:\Users\PawLie\Documents\Development\BTSM\Security\Analysis\Pages\Calculator.razor"
     if (showErrorText)
	{

#line default
#line hidden
#nullable disable
            __builder.AddMarkupContent(17, "\t\t");
            __builder.OpenElement(18, "span");
            __builder.AddAttribute(19, "class", "alert-danger");
            __builder.AddContent(20, " ! ! ! Chyba: ");
            __builder.AddContent(21, 
#nullable restore
#line 12 "C:\Users\PawLie\Documents\Development\BTSM\Security\Analysis\Pages\Calculator.razor"
                                                  errorText

#line default
#line hidden
#nullable disable
            );
            __builder.AddContent(22, " ! ! !");
            __builder.CloseElement();
            __builder.AddMarkupContent(23, "\r\n");
#nullable restore
#line 13 "C:\Users\PawLie\Documents\Development\BTSM\Security\Analysis\Pages\Calculator.razor"
	}

#line default
#line hidden
#nullable disable
            __builder.AddMarkupContent(24, "\t");
            __builder.OpenElement(25, "button");
            __builder.AddAttribute(26, "class", "button-top-right btn btn-success");
            __builder.AddAttribute(27, "onclick", Microsoft.AspNetCore.Components.EventCallback.Factory.Create<Microsoft.AspNetCore.Components.Web.MouseEventArgs>(this, 
#nullable restore
#line 14 "C:\Users\PawLie\Documents\Development\BTSM\Security\Analysis\Pages\Calculator.razor"
                                                               ShowResult

#line default
#line hidden
#nullable disable
            ));
            __builder.AddMarkupContent(28, "Výsledek <span class=\"oi oi-badge\" aria-hidden=\"true\"></span>");
            __builder.CloseElement();
            __builder.AddMarkupContent(29, "\r\n\t");
            __builder.OpenElement(30, "button");
            __builder.AddAttribute(31, "class", "button-top-right btn btn-info");
            __builder.AddAttribute(32, "onclick", Microsoft.AspNetCore.Components.EventCallback.Factory.Create<Microsoft.AspNetCore.Components.Web.MouseEventArgs>(this, 
#nullable restore
#line 15 "C:\Users\PawLie\Documents\Development\BTSM\Security\Analysis\Pages\Calculator.razor"
                                                            ShowTables

#line default
#line hidden
#nullable disable
            ));
            __builder.AddMarkupContent(33, "Tabulky <span class=\"oi oi-clipboard\" aria-hidden=\"true\"></span>");
            __builder.CloseElement();
            __builder.AddMarkupContent(34, "\r\n\t");
            __builder.OpenElement(35, "button");
            __builder.AddAttribute(36, "class", "button-top-right btn btn-primary");
            __builder.AddAttribute(37, "onclick", Microsoft.AspNetCore.Components.EventCallback.Factory.Create<Microsoft.AspNetCore.Components.Web.MouseEventArgs>(this, 
#nullable restore
#line 16 "C:\Users\PawLie\Documents\Development\BTSM\Security\Analysis\Pages\Calculator.razor"
                                                               ShowQuestions

#line default
#line hidden
#nullable disable
            ));
            __builder.AddMarkupContent(38, "Otázky <span class=\"oi oi-spreadsheet\" aria-hidden=\"true\"></span>");
            __builder.CloseElement();
            __builder.AddMarkupContent(39, "\r\n");
            __builder.CloseElement();
            __builder.AddMarkupContent(40, "\r\n\r\n");
            __builder.OpenElement(41, "div");
            __builder.AddAttribute(42, "class", "content px-4");
            __builder.AddMarkupContent(43, "\r\n");
#nullable restore
#line 20 "C:\Users\PawLie\Documents\Development\BTSM\Security\Analysis\Pages\Calculator.razor"
     if (showQuestions)
	{

#line default
#line hidden
#nullable disable
            __builder.AddMarkupContent(44, "\t\t");
            __builder.OpenElement(45, "h1");
            __builder.AddMarkupContent(46, "\r\n\t\t\tOtázky\r\n\t\t\t");
            __builder.OpenElement(47, "button");
            __builder.AddAttribute(48, "style", "margin-right: 5px");
            __builder.AddAttribute(49, "class", "btn btn-outline-danger");
            __builder.AddAttribute(50, "onclick", Microsoft.AspNetCore.Components.EventCallback.Factory.Create<Microsoft.AspNetCore.Components.Web.MouseEventArgs>(this, 
#nullable restore
#line 24 "C:\Users\PawLie\Documents\Development\BTSM\Security\Analysis\Pages\Calculator.razor"
                                                                                       ResetModel

#line default
#line hidden
#nullable disable
            ));
            __builder.AddMarkupContent(51, "Nové");
            __builder.CloseElement();
            __builder.AddMarkupContent(52, "\r\n\t\t\t");
            __builder.OpenElement(53, "button");
            __builder.AddAttribute(54, "style", "margin-right: 5px");
            __builder.AddAttribute(55, "class", "btn btn-outline-dark");
            __builder.AddAttribute(56, "onclick", Microsoft.AspNetCore.Components.EventCallback.Factory.Create<Microsoft.AspNetCore.Components.Web.MouseEventArgs>(this, 
#nullable restore
#line 25 "C:\Users\PawLie\Documents\Development\BTSM\Security\Analysis\Pages\Calculator.razor"
                                                                                     DefaultModel

#line default
#line hidden
#nullable disable
            ));
            __builder.AddMarkupContent(57, "Přednastavené");
            __builder.CloseElement();
            __builder.AddMarkupContent(58, "\r\n\t\t");
            __builder.CloseElement();
            __builder.AddMarkupContent(59, "\r\n");
#nullable restore
#line 27 "C:\Users\PawLie\Documents\Development\BTSM\Security\Analysis\Pages\Calculator.razor"
         if (analysisModel == null)
		{

#line default
#line hidden
#nullable disable
            __builder.AddMarkupContent(60, "\t\t\t");
            __builder.AddMarkupContent(61, "<p><em>Načítám...</em></p>\r\n");
#nullable restore
#line 30 "C:\Users\PawLie\Documents\Development\BTSM\Security\Analysis\Pages\Calculator.razor"
		}
		else
		{

#line default
#line hidden
#nullable disable
            __builder.AddMarkupContent(62, "\t\t\t<div class=\"section-line\"></div>\r\n");
#nullable restore
#line 34 "C:\Users\PawLie\Documents\Development\BTSM\Security\Analysis\Pages\Calculator.razor"
			foreach (var section in analysisModel.Sections.OrderBy(x => x.SectionType))
			{
				var totalCount = 0;
				var count = 0;
				var questions = section.Questions;
				SetSectionTitle(section.SectionType);

#line default
#line hidden
#nullable disable
            __builder.AddMarkupContent(63, "\t\t\t\t");
            __builder.OpenElement(64, "div");
            __builder.AddAttribute(65, "style", "cursor:pointer");
            __builder.AddAttribute(66, "onclick", Microsoft.AspNetCore.Components.EventCallback.Factory.Create<Microsoft.AspNetCore.Components.Web.MouseEventArgs>(this, 
#nullable restore
#line 40 "C:\Users\PawLie\Documents\Development\BTSM\Security\Analysis\Pages\Calculator.razor"
                                                      () => ShowSection(section)

#line default
#line hidden
#nullable disable
            ));
            __builder.OpenElement(67, "h2");
            __builder.AddContent(68, 
#nullable restore
#line 40 "C:\Users\PawLie\Documents\Development\BTSM\Security\Analysis\Pages\Calculator.razor"
                                                                                       sectionTitle

#line default
#line hidden
#nullable disable
            );
            __builder.AddContent(69, " ");
            __builder.OpenElement(70, "span");
            __builder.AddAttribute(71, "class", "oi" + " position-under" + " small" + " " + (
#nullable restore
#line 40 "C:\Users\PawLie\Documents\Development\BTSM\Security\Analysis\Pages\Calculator.razor"
                                                                                                                                           section.ShowSection ? "oi-arrow-circle-top" : "oi-arrow-circle-bottom"

#line default
#line hidden
#nullable disable
            ));
            __builder.AddAttribute(72, "aria-hidden", "true");
            __builder.CloseElement();
            __builder.CloseElement();
            __builder.CloseElement();
            __builder.AddMarkupContent(73, "\r\n\t\t\t\t<div class=\"section-line\"></div>\r\n");
#nullable restore
#line 42 "C:\Users\PawLie\Documents\Development\BTSM\Security\Analysis\Pages\Calculator.razor"
				if (section.ShowSection)
				{
					count = 0;

#line default
#line hidden
#nullable disable
            __builder.AddMarkupContent(74, "\t\t\t\t\t");
            __builder.OpenElement(75, "table");
            __builder.AddAttribute(76, "class", "table");
            __builder.AddMarkupContent(77, "\r\n\t\t\t\t\t\t");
            __builder.AddMarkupContent(78, "<thead>\r\n\t\t\t\t\t\t</thead>\r\n");
#nullable restore
#line 48 "C:\Users\PawLie\Documents\Development\BTSM\Security\Analysis\Pages\Calculator.razor"
                         foreach (var question in questions.OrderBy(x => x.QuestionType))
						{
							if (questionType != question.QuestionType || count == 0)
							{

#line default
#line hidden
#nullable disable
            __builder.AddMarkupContent(79, "\t\t\t\t\t\t\t\t");
            __builder.AddMarkupContent(80, "<tbody class=\"section-line\">\r\n\t\t\t\t\t\t\t\t\t<tr>\r\n\t\t\t\t\t\t\t\t\t</tr>\r\n\t\t\t\t\t\t\t\t</tbody>\r\n");
#nullable restore
#line 56 "C:\Users\PawLie\Documents\Development\BTSM\Security\Analysis\Pages\Calculator.razor"
								setQuestionType(question.QuestionType);
								totalCount = questions.Count(x => x.QuestionType == questionType);
								SetQuestionTitle(question.QuestionType);
								count = 0;

#line default
#line hidden
#nullable disable
            __builder.AddMarkupContent(81, "\t\t\t\t\t\t\t\t");
            __builder.OpenElement(82, "h3");
            __builder.AddContent(83, 
#nullable restore
#line 60 "C:\Users\PawLie\Documents\Development\BTSM\Security\Analysis\Pages\Calculator.razor"
                                     questionTitle

#line default
#line hidden
#nullable disable
            );
            __builder.CloseElement();
            __builder.AddMarkupContent(84, "\r\n\t\t\t\t\t\t\t\t");
            __builder.AddMarkupContent(85, "<thead>\r\n\t\t\t\t\t\t\t\t\t<tr>\r\n\t\t\t\t\t\t\t\t\t\t<th class=\"th-question\">Otázka</th>\r\n\t\t\t\t\t\t\t\t\t\t<th class=\"th-edit\"></th>\r\n\t\t\t\t\t\t\t\t\t\t<th class=\"th-edit\"></th>\r\n\t\t\t\t\t\t\t\t\t\t<th class=\"th-option\">Možnosti</th>\r\n\t\t\t\t\t\t\t\t\t</tr>\r\n\t\t\t\t\t\t\t\t</thead>\r\n");
#nullable restore
#line 69 "C:\Users\PawLie\Documents\Development\BTSM\Security\Analysis\Pages\Calculator.razor"
							}
							count++;

#line default
#line hidden
#nullable disable
            __builder.AddMarkupContent(86, "\t\t\t\t\t\t\t");
            __builder.OpenElement(87, "tbody");
            __builder.AddMarkupContent(88, "\r\n\t\t\t\t\t\t\t\t");
            __builder.OpenElement(89, "tr");
            __builder.AddMarkupContent(90, "\r\n");
#nullable restore
#line 73 "C:\Users\PawLie\Documents\Development\BTSM\Security\Analysis\Pages\Calculator.razor"
                                     if (question.Edit)
									{

#line default
#line hidden
#nullable disable
            __builder.AddMarkupContent(91, "\t\t\t\t\t\t\t\t\t\t");
            __builder.OpenElement(92, "td");
            __builder.AddAttribute(93, "class", "td-question");
            __builder.AddMarkupContent(94, "\r\n\t\t\t\t\t\t\t\t\t\t\t");
            __builder.OpenElement(95, "input");
            __builder.AddAttribute(96, "class", "form-control");
            __builder.AddAttribute(97, "type", "text");
            __builder.AddAttribute(98, "style", "background-color:lightyellow;");
            __builder.AddAttribute(99, "value", 
#nullable restore
#line 78 "C:\Users\PawLie\Documents\Development\BTSM\Security\Analysis\Pages\Calculator.razor"
                                                           question.Question

#line default
#line hidden
#nullable disable
            );
            __builder.AddAttribute(100, "oninput", Microsoft.AspNetCore.Components.EventCallback.Factory.Create<Microsoft.AspNetCore.Components.ChangeEventArgs>(this, 
#nullable restore
#line 79 "C:\Users\PawLie\Documents\Development\BTSM\Security\Analysis\Pages\Calculator.razor"
                                                               e => { question.Question = e.Value.ToString(); }

#line default
#line hidden
#nullable disable
            ));
            __builder.CloseElement();
            __builder.AddMarkupContent(101, "\r\n\t\t\t\t\t\t\t\t\t\t");
            __builder.CloseElement();
            __builder.AddMarkupContent(102, "\r\n");
#nullable restore
#line 81 "C:\Users\PawLie\Documents\Development\BTSM\Security\Analysis\Pages\Calculator.razor"
									}
									else
									{

#line default
#line hidden
#nullable disable
            __builder.AddMarkupContent(103, "\t\t\t\t\t\t\t\t\t\t");
            __builder.OpenElement(104, "td");
            __builder.AddAttribute(105, "class", "td-question");
            __builder.AddContent(106, 
#nullable restore
#line 84 "C:\Users\PawLie\Documents\Development\BTSM\Security\Analysis\Pages\Calculator.razor"
                                                                 question.Question

#line default
#line hidden
#nullable disable
            );
            __builder.CloseElement();
            __builder.AddMarkupContent(107, "\r\n");
#nullable restore
#line 85 "C:\Users\PawLie\Documents\Development\BTSM\Security\Analysis\Pages\Calculator.razor"
									}

#line default
#line hidden
#nullable disable
            __builder.AddMarkupContent(108, "\t\t\t\t\t\t\t\t\t");
            __builder.OpenElement(109, "td");
            __builder.AddAttribute(110, "class", "td-edit");
            __builder.OpenElement(111, "div");
            __builder.AddAttribute(112, "style", "cursor:pointer");
            __builder.AddAttribute(113, "onclick", Microsoft.AspNetCore.Components.EventCallback.Factory.Create<Microsoft.AspNetCore.Components.Web.MouseEventArgs>(this, 
#nullable restore
#line 86 "C:\Users\PawLie\Documents\Development\BTSM\Security\Analysis\Pages\Calculator.razor"
                                                                                              () => QuestionEdit(question)

#line default
#line hidden
#nullable disable
            ));
            __builder.AddMarkupContent(114, "<span class=\"oi position-under oi-pencil\" aria-hidden=\"true\"></span>");
            __builder.CloseElement();
            __builder.CloseElement();
            __builder.AddMarkupContent(115, "\r\n\t\t\t\t\t\t\t\t\t");
            __builder.OpenElement(116, "td");
            __builder.AddAttribute(117, "class", "td-edit");
            __builder.OpenElement(118, "div");
            __builder.AddAttribute(119, "style", "cursor:pointer");
            __builder.AddAttribute(120, "onclick", Microsoft.AspNetCore.Components.EventCallback.Factory.Create<Microsoft.AspNetCore.Components.Web.MouseEventArgs>(this, 
#nullable restore
#line 87 "C:\Users\PawLie\Documents\Development\BTSM\Security\Analysis\Pages\Calculator.razor"
                                                                                              () => RemoveQuestion(questions, question)

#line default
#line hidden
#nullable disable
            ));
            __builder.AddMarkupContent(121, "<span class=\"position-under oi oi-trash\" aria-hidden=\"true\"></span>");
            __builder.CloseElement();
            __builder.CloseElement();
            __builder.AddMarkupContent(122, "\r\n\t\t\t\t\t\t\t\t\t");
            __builder.OpenElement(123, "td");
            __builder.AddAttribute(124, "class", "td-answer");
            __builder.AddMarkupContent(125, "\r\n\t\t\t\t\t\t\t\t\t\t");
            __builder.OpenElement(126, "table");
            __builder.AddMarkupContent(127, "\r\n\t\t\t\t\t\t\t\t\t\t\t");
            __builder.AddMarkupContent(128, @"<thead>
											<th class=""th-answer th-description"">Popis</th>
											<th class></th>
											<th class=""th-answer th-description"">Body</th>
											<th class></th>
											<th class=""th-answer-value th-points"">Vybráno</th>
											</thead>
");
#nullable restore
#line 97 "C:\Users\PawLie\Documents\Development\BTSM\Security\Analysis\Pages\Calculator.razor"
                                             foreach (var answer in question.Answers.OrderBy(x => x.Value))
											{

#line default
#line hidden
#nullable disable
            __builder.AddMarkupContent(129, "\t\t\t\t\t\t\t\t\t\t\t\t");
            __builder.OpenElement(130, "tr");
            __builder.AddMarkupContent(131, "\r\n");
#nullable restore
#line 100 "C:\Users\PawLie\Documents\Development\BTSM\Security\Analysis\Pages\Calculator.razor"
                                                     if (answer.Edit)
													{

#line default
#line hidden
#nullable disable
            __builder.AddMarkupContent(132, "\t\t\t\t\t\t\t\t\t\t\t\t\t\t");
            __builder.OpenElement(133, "td");
            __builder.AddAttribute(134, "class", "td-answer");
            __builder.AddMarkupContent(135, "\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t");
            __builder.OpenElement(136, "input");
            __builder.AddAttribute(137, "class", "form-control");
            __builder.AddAttribute(138, "type", "text");
            __builder.AddAttribute(139, "style", "background-color:lightyellow;");
            __builder.AddAttribute(140, "value", 
#nullable restore
#line 105 "C:\Users\PawLie\Documents\Development\BTSM\Security\Analysis\Pages\Calculator.razor"
                                                                           answer.Answer

#line default
#line hidden
#nullable disable
            );
            __builder.AddAttribute(141, "oninput", Microsoft.AspNetCore.Components.EventCallback.Factory.Create<Microsoft.AspNetCore.Components.ChangeEventArgs>(this, 
#nullable restore
#line 106 "C:\Users\PawLie\Documents\Development\BTSM\Security\Analysis\Pages\Calculator.razor"
                                                                               e => { answer.Answer = e.Value.ToString(); }

#line default
#line hidden
#nullable disable
            ));
            __builder.CloseElement();
            __builder.AddMarkupContent(142, "\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t");
            __builder.CloseElement();
            __builder.AddMarkupContent(143, "\r\n");
#nullable restore
#line 108 "C:\Users\PawLie\Documents\Development\BTSM\Security\Analysis\Pages\Calculator.razor"
													}
													else
													{

#line default
#line hidden
#nullable disable
            __builder.AddMarkupContent(144, "\t\t\t\t\t\t\t\t\t\t\t\t\t\t");
            __builder.OpenElement(145, "td");
            __builder.AddAttribute(146, "class", "td-answer");
            __builder.AddContent(147, 
#nullable restore
#line 111 "C:\Users\PawLie\Documents\Development\BTSM\Security\Analysis\Pages\Calculator.razor"
                                                                               answer.Answer

#line default
#line hidden
#nullable disable
            );
            __builder.CloseElement();
            __builder.AddMarkupContent(148, "\r\n");
#nullable restore
#line 112 "C:\Users\PawLie\Documents\Development\BTSM\Security\Analysis\Pages\Calculator.razor"
													}

#line default
#line hidden
#nullable disable
            __builder.AddMarkupContent(149, "\t\t\t\t\t\t\t\t\t\t\t\t\t");
            __builder.OpenElement(150, "td");
            __builder.AddAttribute(151, "class", "td-answer-edit");
            __builder.OpenElement(152, "div");
            __builder.AddAttribute(153, "style", "cursor:pointer");
            __builder.AddAttribute(154, "onclick", Microsoft.AspNetCore.Components.EventCallback.Factory.Create<Microsoft.AspNetCore.Components.Web.MouseEventArgs>(this, 
#nullable restore
#line 113 "C:\Users\PawLie\Documents\Development\BTSM\Security\Analysis\Pages\Calculator.razor"
                                                                                                                     () => AnswerEdit(answer)

#line default
#line hidden
#nullable disable
            ));
            __builder.AddMarkupContent(155, "<span class=\"position-under oi oi-pencil\" aria-hidden=\"true\"></span>");
            __builder.CloseElement();
            __builder.CloseElement();
            __builder.AddMarkupContent(156, "\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t");
            __builder.OpenElement(157, "td");
            __builder.AddAttribute(158, "class", "td-answer answer-points-text");
            __builder.AddContent(159, 
#nullable restore
#line 114 "C:\Users\PawLie\Documents\Development\BTSM\Security\Analysis\Pages\Calculator.razor"
                                                                                              answer.Value

#line default
#line hidden
#nullable disable
            );
            __builder.CloseElement();
            __builder.AddMarkupContent(160, "\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t");
            __builder.OpenElement(161, "td");
            __builder.AddAttribute(162, "class", "td-answer-edit");
            __builder.AddMarkupContent(163, "\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t");
            __builder.OpenElement(164, "div");
            __builder.AddAttribute(165, "style", "cursor:pointer");
            __builder.AddAttribute(166, "onclick", Microsoft.AspNetCore.Components.EventCallback.Factory.Create<Microsoft.AspNetCore.Components.Web.MouseEventArgs>(this, 
#nullable restore
#line 116 "C:\Users\PawLie\Documents\Development\BTSM\Security\Analysis\Pages\Calculator.razor"
                                                                                              () => AddPoint(question.Answers, answer)

#line default
#line hidden
#nullable disable
            ));
            __builder.AddMarkupContent(167, "<span class=\"position-under oi oi-plus small\" aria-hidden=\"true\"></span>");
            __builder.CloseElement();
            __builder.AddMarkupContent(168, "\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t");
            __builder.OpenElement(169, "div");
            __builder.AddAttribute(170, "style", "cursor:pointer");
            __builder.AddAttribute(171, "onclick", Microsoft.AspNetCore.Components.EventCallback.Factory.Create<Microsoft.AspNetCore.Components.Web.MouseEventArgs>(this, 
#nullable restore
#line 117 "C:\Users\PawLie\Documents\Development\BTSM\Security\Analysis\Pages\Calculator.razor"
                                                                                              () => RemovePoint(question.Answers, answer)

#line default
#line hidden
#nullable disable
            ));
            __builder.AddMarkupContent(172, "<span class=\"position-under oi oi-minus small\" aria-hidden=\"true\"></span>");
            __builder.CloseElement();
            __builder.AddMarkupContent(173, "\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t");
            __builder.CloseElement();
            __builder.AddMarkupContent(174, "\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t");
            __builder.OpenElement(175, "td");
            __builder.AddAttribute(176, "class", "td-answer-value answer-checkBox");
            __builder.OpenElement(177, "input");
            __builder.AddAttribute(178, "class", "answer-checkBox");
            __builder.AddAttribute(179, "type", "checkbox");
            __builder.AddAttribute(180, "onclick", Microsoft.AspNetCore.Components.EventCallback.Factory.Create<Microsoft.AspNetCore.Components.Web.MouseEventArgs>(this, 
#nullable restore
#line 119 "C:\Users\PawLie\Documents\Development\BTSM\Security\Analysis\Pages\Calculator.razor"
                                                                                                                                                                                  () => CheckChanged(question, answer.Value)

#line default
#line hidden
#nullable disable
            ));
            __builder.AddAttribute(181, "checked", Microsoft.AspNetCore.Components.BindConverter.FormatValue(
#nullable restore
#line 119 "C:\Users\PawLie\Documents\Development\BTSM\Security\Analysis\Pages\Calculator.razor"
                                                                                                                                                       answer.IsChosen

#line default
#line hidden
#nullable disable
            ));
            __builder.AddAttribute(182, "onchange", Microsoft.AspNetCore.Components.EventCallback.Factory.CreateBinder(this, __value => answer.IsChosen = __value, answer.IsChosen));
            __builder.SetUpdatesAttributeName("checked");
            __builder.CloseElement();
            __builder.CloseElement();
            __builder.AddMarkupContent(183, "\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t");
            __builder.OpenElement(184, "td");
            __builder.AddAttribute(185, "class", "td-answer-value answer-checkBox");
            __builder.OpenElement(186, "div");
            __builder.AddAttribute(187, "style", "cursor:pointer");
            __builder.AddAttribute(188, "onclick", Microsoft.AspNetCore.Components.EventCallback.Factory.Create<Microsoft.AspNetCore.Components.Web.MouseEventArgs>(this, 
#nullable restore
#line 120 "C:\Users\PawLie\Documents\Development\BTSM\Security\Analysis\Pages\Calculator.razor"
                                                                                                                                      () => RemoveAnswer(question.Answers, answer)

#line default
#line hidden
#nullable disable
            ));
            __builder.AddMarkupContent(189, "<span class=\"position-under oi oi-trash small\" aria-hidden=\"true\"></span>");
            __builder.CloseElement();
            __builder.CloseElement();
            __builder.AddMarkupContent(190, "\r\n\t\t\t\t\t\t\t\t\t\t\t\t");
            __builder.CloseElement();
            __builder.AddMarkupContent(191, "\r\n");
#nullable restore
#line 122 "C:\Users\PawLie\Documents\Development\BTSM\Security\Analysis\Pages\Calculator.razor"
											}

#line default
#line hidden
#nullable disable
            __builder.AddMarkupContent(192, "\t\t\t\t\t\t\t\t\t\t\t");
            __builder.OpenElement(193, "div");
            __builder.AddAttribute(194, "style", "cursor:pointer");
            __builder.AddAttribute(195, "onclick", Microsoft.AspNetCore.Components.EventCallback.Factory.Create<Microsoft.AspNetCore.Components.Web.MouseEventArgs>(this, 
#nullable restore
#line 123 "C:\Users\PawLie\Documents\Development\BTSM\Security\Analysis\Pages\Calculator.razor"
                                                                                  () => AddAnswer(question.Answers, question.LowestValue)

#line default
#line hidden
#nullable disable
            ));
            __builder.AddMarkupContent(196, "<span class=\"position-under oi oi-plus\" aria-hidden=\"true\">Přidat možnost</span>");
            __builder.CloseElement();
            __builder.AddMarkupContent(197, "\r\n\t\t\t\t\t\t\t\t\t\t");
            __builder.CloseElement();
            __builder.AddMarkupContent(198, "\r\n\t\t\t\t\t\t\t\t\t");
            __builder.CloseElement();
            __builder.AddMarkupContent(199, "\r\n\t\t\t\t\t\t\t\t");
            __builder.CloseElement();
            __builder.AddMarkupContent(200, "\r\n\t\t\t\t\t\t\t");
            __builder.CloseElement();
            __builder.AddMarkupContent(201, "\r\n");
#nullable restore
#line 128 "C:\Users\PawLie\Documents\Development\BTSM\Security\Analysis\Pages\Calculator.razor"
                             if (totalCount == count)
							{

#line default
#line hidden
#nullable disable
            __builder.AddMarkupContent(202, "\t\t\t\t\t\t\t\t");
            __builder.OpenElement(203, "thead");
            __builder.AddMarkupContent(204, "\r\n\t\t\t\t\t\t\t\t\t");
            __builder.OpenElement(205, "tr");
            __builder.AddMarkupContent(206, "\r\n\t\t\t\t\t\t\t\t\t\t");
            __builder.OpenElement(207, "th");
            __builder.AddMarkupContent(208, "\r\n\t\t\t\t\t\t\t\t\t\t\t");
            __builder.OpenElement(209, "div");
            __builder.AddAttribute(210, "style", "cursor:pointer");
            __builder.AddAttribute(211, "onclick", Microsoft.AspNetCore.Components.EventCallback.Factory.Create<Microsoft.AspNetCore.Components.Web.MouseEventArgs>(this, 
#nullable restore
#line 133 "C:\Users\PawLie\Documents\Development\BTSM\Security\Analysis\Pages\Calculator.razor"
                                                                                  () => AddQuestion(questions, question.QuestionType)

#line default
#line hidden
#nullable disable
            ));
            __builder.AddMarkupContent(212, "<span class=\"position-under oi oi-plus\" aria-hidden=\"true\">Přidat otázku</span>");
            __builder.CloseElement();
            __builder.AddMarkupContent(213, "\r\n\t\t\t\t\t\t\t\t\t\t");
            __builder.CloseElement();
            __builder.AddMarkupContent(214, "\r\n\t\t\t\t\t\t\t\t\t\t<th></th>\r\n\t\t\t\t\t\t\t\t\t\t<th></th>\r\n\t\t\t\t\t\t\t\t\t\t<th></th>\r\n\t\t\t\t\t\t\t\t\t");
            __builder.CloseElement();
            __builder.AddMarkupContent(215, "\r\n\t\t\t\t\t\t\t\t");
            __builder.CloseElement();
            __builder.AddMarkupContent(216, "\r\n\t\t\t\t\t\t\t\t");
            __builder.OpenElement(217, "tbody");
            __builder.AddMarkupContent(218, "\r\n\t\t\t\t\t\t\t\t\t");
            __builder.OpenElement(219, "tr");
            __builder.AddMarkupContent(220, "\r\n\t\t\t\t\t\t\t\t\t\t");
            __builder.AddMarkupContent(221, "<td>Celkový počet bodů </td>\r\n\t\t\t\t\t\t\t\t\t\t<td></td>\r\n\t\t\t\t\t\t\t\t\t\t<td></td>\r\n\t\t\t\t\t\t\t\t\t\t");
            __builder.OpenElement(222, "td");
            __builder.AddMarkupContent(223, "\r\n");
#nullable restore
#line 146 "C:\Users\PawLie\Documents\Development\BTSM\Security\Analysis\Pages\Calculator.razor"
                                              
												var allAnswers = questions.Where(x => x.QuestionType == questionType).Select(x => x.Answers).ToList();
												var totalValue = 0;
												var chosenValue = 0;
												allAnswers.ForEach(x => totalValue += x.Select(x => x.Value).DefaultIfEmpty().Max());
												allAnswers.ForEach(x => chosenValue += x.Where(y => y.IsChosen)?.FirstOrDefault() != null ? x.Where(y => y.IsChosen).First().Value : 0);
												question.Value = chosenValue;
												question.MaxValue = totalValue;
											

#line default
#line hidden
#nullable disable
            __builder.AddMarkupContent(224, "\t\t\t\t\t\t\t\t\t\t\t");
            __builder.AddContent(225, 
#nullable restore
#line 155 "C:\Users\PawLie\Documents\Development\BTSM\Security\Analysis\Pages\Calculator.razor"
                                             question.Value.ToString()

#line default
#line hidden
#nullable disable
            );
            __builder.AddContent(226, " / ");
            __builder.AddContent(227, 
#nullable restore
#line 155 "C:\Users\PawLie\Documents\Development\BTSM\Security\Analysis\Pages\Calculator.razor"
                                                                          question.MaxValue.ToString()

#line default
#line hidden
#nullable disable
            );
            __builder.AddMarkupContent(228, "\r\n\t\t\t\t\t\t\t\t\t\t");
            __builder.CloseElement();
            __builder.AddMarkupContent(229, "\r\n\t\t\t\t\t\t\t\t\t");
            __builder.CloseElement();
            __builder.AddMarkupContent(230, "\r\n\t\t\t\t\t\t\t\t");
            __builder.CloseElement();
            __builder.AddMarkupContent(231, "\r\n");
#nullable restore
#line 159 "C:\Users\PawLie\Documents\Development\BTSM\Security\Analysis\Pages\Calculator.razor"
							}

#line default
#line hidden
#nullable disable
#nullable restore
#line 159 "C:\Users\PawLie\Documents\Development\BTSM\Security\Analysis\Pages\Calculator.razor"
                             
						}

#line default
#line hidden
#nullable disable
            __builder.AddMarkupContent(232, "\t\t\t\t\t\t");
            __builder.AddMarkupContent(233, "<tbody>\r\n\t\t\t\t\t\t\t<tr>\r\n\t\t\t\t\t\t\t</tr>\r\n\t\t\t\t\t\t</tbody>\r\n\t\t\t\t\t");
            __builder.CloseElement();
            __builder.AddMarkupContent(234, "\r\n");
#nullable restore
#line 166 "C:\Users\PawLie\Documents\Development\BTSM\Security\Analysis\Pages\Calculator.razor"
				}
			}
		}

#line default
#line hidden
#nullable disable
#nullable restore
#line 168 "C:\Users\PawLie\Documents\Development\BTSM\Security\Analysis\Pages\Calculator.razor"
         
	}
	else if (showTables)
	{

#line default
#line hidden
#nullable disable
            __builder.AddMarkupContent(235, "\t\t");
            __builder.AddMarkupContent(236, "<h1>Tabulky</h1>\r\n");
#nullable restore
#line 173 "C:\Users\PawLie\Documents\Development\BTSM\Security\Analysis\Pages\Calculator.razor"
		foreach (var ratingTable in ratingTables)
		{
			SetSectionTitle(ratingTable.SectionType);

#line default
#line hidden
#nullable disable
            __builder.AddMarkupContent(237, "\t\t\t");
            __builder.OpenElement(238, "div");
            __builder.AddAttribute(239, "style", "cursor:pointer");
            __builder.AddAttribute(240, "onclick", Microsoft.AspNetCore.Components.EventCallback.Factory.Create<Microsoft.AspNetCore.Components.Web.MouseEventArgs>(this, 
#nullable restore
#line 176 "C:\Users\PawLie\Documents\Development\BTSM\Security\Analysis\Pages\Calculator.razor"
                                                  () => ShowTable(ratingTable)

#line default
#line hidden
#nullable disable
            ));
            __builder.OpenElement(241, "h2");
            __builder.AddContent(242, 
#nullable restore
#line 176 "C:\Users\PawLie\Documents\Development\BTSM\Security\Analysis\Pages\Calculator.razor"
                                                                                     sectionTitle

#line default
#line hidden
#nullable disable
            );
            __builder.AddContent(243, " ");
            __builder.OpenElement(244, "span");
            __builder.AddAttribute(245, "class", "position-under" + " oi" + " small" + " " + (
#nullable restore
#line 176 "C:\Users\PawLie\Documents\Development\BTSM\Security\Analysis\Pages\Calculator.razor"
                                                                                                                                         ratingTable.ShowTable ? "oi-arrow-circle-top" : "oi-arrow-circle-bottom"

#line default
#line hidden
#nullable disable
            ));
            __builder.AddAttribute(246, "aria-hidden", "true");
            __builder.CloseElement();
            __builder.CloseElement();
            __builder.CloseElement();
            __builder.AddMarkupContent(247, "\r\n");
#nullable restore
#line 177 "C:\Users\PawLie\Documents\Development\BTSM\Security\Analysis\Pages\Calculator.razor"
			if (ratingTable.ShowTable)
			{

#line default
#line hidden
#nullable disable
            __builder.AddMarkupContent(248, "\t\t\t\t");
            __builder.OpenElement(249, "table");
            __builder.AddAttribute(250, "style", "width:40%");
            __builder.AddAttribute(251, "class", "table");
            __builder.AddMarkupContent(252, "\r\n\t\t\t\t\t");
            __builder.AddMarkupContent(253, "<thead>\r\n\t\t\t\t\t\t<tr>\r\n\t\t\t\t\t\t\t<th>\r\n\t\t\t\t\t\t\t\tHodnocení %\r\n\t\t\t\t\t\t\t</th>\r\n\t\t\t\t\t\t\t<th>\r\n\t\t\t\t\t\t\t\tHodnota\r\n\t\t\t\t\t\t\t</th>\r\n\t\t\t\t\t\t</tr>\r\n\t\t\t\t\t</thead>\r\n\t\t\t\t\t");
            __builder.OpenElement(254, "tbody");
            __builder.AddMarkupContent(255, "\r\n");
#nullable restore
#line 191 "C:\Users\PawLie\Documents\Development\BTSM\Security\Analysis\Pages\Calculator.razor"
                          
							var count = 0;
							var totalCount = ratingTable.Ratings.Count;
						

#line default
#line hidden
#nullable disable
#nullable restore
#line 195 "C:\Users\PawLie\Documents\Development\BTSM\Security\Analysis\Pages\Calculator.razor"
                         foreach (var rating in ratingTable.Ratings.OrderBy(x => x.MinValue))
						{

#line default
#line hidden
#nullable disable
            __builder.AddMarkupContent(256, "\t\t\t\t\t\t\t");
            __builder.OpenElement(257, "tr");
            __builder.AddMarkupContent(258, "\r\n");
#nullable restore
#line 198 "C:\Users\PawLie\Documents\Development\BTSM\Security\Analysis\Pages\Calculator.razor"
                                 if (!rating.Edit)
								{

#line default
#line hidden
#nullable disable
            __builder.AddMarkupContent(259, "\t\t\t\t\t\t\t\t\t");
            __builder.OpenElement(260, "td");
            __builder.AddContent(261, 
#nullable restore
#line 200 "C:\Users\PawLie\Documents\Development\BTSM\Security\Analysis\Pages\Calculator.razor"
                                         rating.MinValue

#line default
#line hidden
#nullable disable
            );
            __builder.AddContent(262, " % - ");
            __builder.AddContent(263, 
#nullable restore
#line 200 "C:\Users\PawLie\Documents\Development\BTSM\Security\Analysis\Pages\Calculator.razor"
                                                              rating.MaxValue

#line default
#line hidden
#nullable disable
            );
            __builder.AddContent(264, " %");
            __builder.CloseElement();
            __builder.AddMarkupContent(265, "\r\n\t\t\t\t\t\t\t\t\t");
            __builder.OpenElement(266, "td");
            __builder.AddContent(267, 
#nullable restore
#line 201 "C:\Users\PawLie\Documents\Development\BTSM\Security\Analysis\Pages\Calculator.razor"
                                         rating.Name

#line default
#line hidden
#nullable disable
            );
            __builder.CloseElement();
            __builder.AddMarkupContent(268, "\r\n");
#nullable restore
#line 202 "C:\Users\PawLie\Documents\Development\BTSM\Security\Analysis\Pages\Calculator.razor"
								}
								else
								{

#line default
#line hidden
#nullable disable
            __builder.AddMarkupContent(269, "\t\t\t\t\t\t\t\t\t");
            __builder.OpenElement(270, "td");
            __builder.AddMarkupContent(271, "\r\n\t\t\t\t\t\t\t\t\t\t");
            __builder.OpenElement(272, "input");
            __builder.AddAttribute(273, "class", "form-control");
            __builder.AddAttribute(274, "type", "number");
            __builder.AddAttribute(275, "style", "background-color:lightyellow;");
            __builder.AddAttribute(276, "value", 
#nullable restore
#line 208 "C:\Users\PawLie\Documents\Development\BTSM\Security\Analysis\Pages\Calculator.razor"
                                                       rating.MinValue

#line default
#line hidden
#nullable disable
            );
            __builder.AddAttribute(277, "oninput", Microsoft.AspNetCore.Components.EventCallback.Factory.Create<Microsoft.AspNetCore.Components.ChangeEventArgs>(this, 
#nullable restore
#line 209 "C:\Users\PawLie\Documents\Development\BTSM\Security\Analysis\Pages\Calculator.razor"
                                                           e => { rating.MinValue = EditRatingValue(e.Value.ToString(), ratingTable.Ratings.OrderBy(x => x.MinValue).ToList(), true, rating); }

#line default
#line hidden
#nullable disable
            ));
            __builder.AddAttribute(278, "max", "100");
            __builder.CloseElement();
            __builder.AddMarkupContent(279, "\r\n\t\t\t\t\t\t\t\t\t\t");
            __builder.OpenElement(280, "input");
            __builder.AddAttribute(281, "class", "form-control");
            __builder.AddAttribute(282, "type", "number");
            __builder.AddAttribute(283, "style", "background-color:lightyellow;");
            __builder.AddAttribute(284, "value", 
#nullable restore
#line 212 "C:\Users\PawLie\Documents\Development\BTSM\Security\Analysis\Pages\Calculator.razor"
                                                       rating.MaxValue

#line default
#line hidden
#nullable disable
            );
            __builder.AddAttribute(285, "oninput", Microsoft.AspNetCore.Components.EventCallback.Factory.Create<Microsoft.AspNetCore.Components.ChangeEventArgs>(this, 
#nullable restore
#line 213 "C:\Users\PawLie\Documents\Development\BTSM\Security\Analysis\Pages\Calculator.razor"
                                                           e => { rating.MaxValue = Convert.ToInt32(e.Value.ToString()); }

#line default
#line hidden
#nullable disable
            ));
            __builder.AddAttribute(286, "min", 
#nullable restore
#line 213 "C:\Users\PawLie\Documents\Development\BTSM\Security\Analysis\Pages\Calculator.razor"
                                                                                                                                    count == 0 ? 0 + 1 : ratingTable.Ratings[count - 1].MaxValue > 0 ? ratingTable.Ratings[count - 1].MaxValue + 1 : 0

#line default
#line hidden
#nullable disable
            );
            __builder.AddAttribute(287, "max", "100");
            __builder.CloseElement();
            __builder.AddMarkupContent(288, "\r\n\t\t\t\t\t\t\t\t\t");
            __builder.CloseElement();
            __builder.AddMarkupContent(289, "\r\n\t\t\t\t\t\t\t\t\t");
            __builder.OpenElement(290, "td");
            __builder.AddMarkupContent(291, "\r\n\t\t\t\t\t\t\t\t\t\t");
            __builder.OpenElement(292, "input");
            __builder.AddAttribute(293, "class", "form-control");
            __builder.AddAttribute(294, "type", "text");
            __builder.AddAttribute(295, "style", "background-color:lightyellow;");
            __builder.AddAttribute(296, "value", 
#nullable restore
#line 218 "C:\Users\PawLie\Documents\Development\BTSM\Security\Analysis\Pages\Calculator.razor"
                                                       rating.Name

#line default
#line hidden
#nullable disable
            );
            __builder.AddAttribute(297, "oninput", Microsoft.AspNetCore.Components.EventCallback.Factory.Create<Microsoft.AspNetCore.Components.ChangeEventArgs>(this, 
#nullable restore
#line 219 "C:\Users\PawLie\Documents\Development\BTSM\Security\Analysis\Pages\Calculator.razor"
                                                           e => { rating.Name = e.Value.ToString(); }

#line default
#line hidden
#nullable disable
            ));
            __builder.CloseElement();
            __builder.AddMarkupContent(298, "\r\n\t\t\t\t\t\t\t\t\t");
            __builder.CloseElement();
            __builder.AddMarkupContent(299, "\r\n");
#nullable restore
#line 221 "C:\Users\PawLie\Documents\Development\BTSM\Security\Analysis\Pages\Calculator.razor"
								}

#line default
#line hidden
#nullable disable
            __builder.AddMarkupContent(300, "\t\t\t\t\t\t\t\t");
            __builder.OpenElement(301, "td");
            __builder.AddMarkupContent(302, "\r\n\t\t\t\t\t\t\t\t\t");
            __builder.OpenElement(303, "div");
            __builder.AddAttribute(304, "style", "cursor:pointer");
            __builder.AddAttribute(305, "onclick", Microsoft.AspNetCore.Components.EventCallback.Factory.Create<Microsoft.AspNetCore.Components.Web.MouseEventArgs>(this, 
#nullable restore
#line 223 "C:\Users\PawLie\Documents\Development\BTSM\Security\Analysis\Pages\Calculator.razor"
                                                                          () => RatingEdit(rating)

#line default
#line hidden
#nullable disable
            ));
            __builder.AddMarkupContent(306, " <span class=\"position-under oi small oi-pencil\" aria-hidden=\"true\"></span>");
            __builder.CloseElement();
            __builder.AddMarkupContent(307, "\r\n\t\t\t\t\t\t\t\t");
            __builder.CloseElement();
            __builder.AddMarkupContent(308, "\r\n\t\t\t\t\t\t\t\t");
            __builder.OpenElement(309, "td");
            __builder.AddMarkupContent(310, "\r\n\t\t\t\t\t\t\t\t\t");
            __builder.OpenElement(311, "div");
            __builder.AddAttribute(312, "style", "cursor:pointer");
            __builder.AddAttribute(313, "onclick", Microsoft.AspNetCore.Components.EventCallback.Factory.Create<Microsoft.AspNetCore.Components.Web.MouseEventArgs>(this, 
#nullable restore
#line 226 "C:\Users\PawLie\Documents\Development\BTSM\Security\Analysis\Pages\Calculator.razor"
                                                                          () => RemoveRating(ratingTable.Ratings, rating)

#line default
#line hidden
#nullable disable
            ));
            __builder.AddMarkupContent(314, " <span class=\"position-under oi small oi-trash\" aria-hidden=\"true\"></span>");
            __builder.CloseElement();
            __builder.AddMarkupContent(315, "\r\n\t\t\t\t\t\t\t\t");
            __builder.CloseElement();
            __builder.AddMarkupContent(316, "\r\n\t\t\t\t\t\t\t");
            __builder.CloseElement();
            __builder.AddMarkupContent(317, "\r\n");
#nullable restore
#line 229 "C:\Users\PawLie\Documents\Development\BTSM\Security\Analysis\Pages\Calculator.razor"
							count++;
						}

#line default
#line hidden
#nullable disable
            __builder.AddMarkupContent(318, "\t\t\t\t\t");
            __builder.CloseElement();
            __builder.AddMarkupContent(319, "\r\n\t\t\t\t");
            __builder.CloseElement();
            __builder.AddMarkupContent(320, "\r\n\t\t\t\t");
            __builder.OpenElement(321, "div");
            __builder.AddAttribute(322, "style", "cursor:pointer");
            __builder.AddAttribute(323, "onclick", Microsoft.AspNetCore.Components.EventCallback.Factory.Create<Microsoft.AspNetCore.Components.Web.MouseEventArgs>(this, 
#nullable restore
#line 233 "C:\Users\PawLie\Documents\Development\BTSM\Security\Analysis\Pages\Calculator.razor"
                                                      () => AddRating(ratingTable.Ratings)

#line default
#line hidden
#nullable disable
            ));
            __builder.AddMarkupContent(324, " <span class=\"position-under oi small oi-plus\" aria-hidden=\"true\"></span>");
            __builder.CloseElement();
            __builder.AddMarkupContent(325, "\r\n");
#nullable restore
#line 234 "C:\Users\PawLie\Documents\Development\BTSM\Security\Analysis\Pages\Calculator.razor"
			}

#line default
#line hidden
#nullable disable
            __builder.AddMarkupContent(326, "\t\t\t<div class=\"section-line\"></div>\r\n");
#nullable restore
#line 236 "C:\Users\PawLie\Documents\Development\BTSM\Security\Analysis\Pages\Calculator.razor"
		}
	}
	else if (showResult)
	{
		decimal calculatedValue = 0;
		decimal rate = 0;


#line default
#line hidden
#nullable disable
            __builder.AddMarkupContent(327, "\t\t");
            __builder.AddMarkupContent(328, "<h1>Výsledek</h1>\r\n");
#nullable restore
#line 244 "C:\Users\PawLie\Documents\Development\BTSM\Security\Analysis\Pages\Calculator.razor"

		Calculate();
		var groupedSectionResults = sectionResults.GroupBy(x => x.SectionType);
		foreach (var groupedSection in groupedSectionResults)
		{
			SetSectionTitle(groupedSection.Key);

#line default
#line hidden
#nullable disable
            __builder.AddMarkupContent(329, "\t\t\t");
            __builder.OpenElement(330, "div");
            __builder.AddAttribute(331, "style", "cursor:pointer");
            __builder.OpenElement(332, "h2");
            __builder.AddContent(333, 
#nullable restore
#line 250 "C:\Users\PawLie\Documents\Development\BTSM\Security\Analysis\Pages\Calculator.razor"
                                             sectionTitle

#line default
#line hidden
#nullable disable
            );
            __builder.AddMarkupContent(334, " <span class=\"position-under oi small\" aria-hidden=\"true\"></span>");
            __builder.CloseElement();
            __builder.CloseElement();
            __builder.AddMarkupContent(335, "\r\n\t\t\t");
            __builder.OpenElement(336, "table");
            __builder.AddAttribute(337, "style", "width:40%");
            __builder.AddAttribute(338, "class", "table");
            __builder.AddMarkupContent(339, "\r\n\t\t\t\t");
            __builder.OpenElement(340, "thead");
            __builder.AddMarkupContent(341, "\r\n\t\t\t\t\t");
            __builder.OpenElement(342, "tr");
            __builder.AddMarkupContent(343, "\r\n");
#nullable restore
#line 254 "C:\Users\PawLie\Documents\Development\BTSM\Security\Analysis\Pages\Calculator.razor"
                         if (groupedSection.Key != SectionType.OrganizationalSecurityAspects && groupedSection.Key != SectionType.RegimeSecurityAspects)
						{

#line default
#line hidden
#nullable disable
            __builder.AddMarkupContent(344, "\t\t\t\t\t\t\t");
            __builder.AddMarkupContent(345, "<th>\r\n\t\t\t\t\t\t\t\tAspekty\r\n\t\t\t\t\t\t\t</th>\r\n");
#nullable restore
#line 259 "C:\Users\PawLie\Documents\Development\BTSM\Security\Analysis\Pages\Calculator.razor"
						}

#line default
#line hidden
#nullable disable
            __builder.AddMarkupContent(346, "\t\t\t\t\t\t");
            __builder.AddMarkupContent(347, "<th>\r\n\t\t\t\t\t\t\tBodová hodnota\r\n\t\t\t\t\t\t</th>\r\n\t\t\t\t\t\t");
            __builder.AddMarkupContent(348, "<th>\r\n\t\t\t\t\t\t\tHodnota\r\n\t\t\t\t\t\t</th>\r\n\t\t\t\t\t");
            __builder.CloseElement();
            __builder.AddMarkupContent(349, "\r\n\t\t\t\t");
            __builder.CloseElement();
            __builder.AddMarkupContent(350, "\r\n");
#nullable restore
#line 268 "C:\Users\PawLie\Documents\Development\BTSM\Security\Analysis\Pages\Calculator.razor"
                 foreach (var section in groupedSection)
				{

#line default
#line hidden
#nullable disable
            __builder.AddMarkupContent(351, "\t\t\t\t\t");
            __builder.OpenElement(352, "tbody");
            __builder.AddMarkupContent(353, "\r\n\t\t\t\t\t\t");
            __builder.OpenElement(354, "tr");
            __builder.AddMarkupContent(355, "\r\n");
#nullable restore
#line 272 "C:\Users\PawLie\Documents\Development\BTSM\Security\Analysis\Pages\Calculator.razor"
                             if (section.SectionType != SectionType.OrganizationalSecurityAspects && section.SectionType != SectionType.RegimeSecurityAspects)
							{

#line default
#line hidden
#nullable disable
            __builder.AddMarkupContent(356, "\t\t\t\t\t\t\t\t");
            __builder.OpenElement(357, "td");
            __builder.AddContent(358, 
#nullable restore
#line 274 "C:\Users\PawLie\Documents\Development\BTSM\Security\Analysis\Pages\Calculator.razor"
                                     section.Name

#line default
#line hidden
#nullable disable
            );
            __builder.CloseElement();
            __builder.AddMarkupContent(359, "\r\n");
#nullable restore
#line 275 "C:\Users\PawLie\Documents\Development\BTSM\Security\Analysis\Pages\Calculator.razor"
							}

#line default
#line hidden
#nullable disable
#nullable restore
#line 276 "C:\Users\PawLie\Documents\Development\BTSM\Security\Analysis\Pages\Calculator.razor"
                             if (section.AllowEdit)
							{

#line default
#line hidden
#nullable disable
            __builder.AddMarkupContent(360, "\t\t\t\t\t\t\t\t");
            __builder.OpenElement(361, "td");
            __builder.AddAttribute(362, "class", "td-answer");
            __builder.AddMarkupContent(363, "\r\n\t\t\t\t\t\t\t\t\t");
            __builder.OpenElement(364, "input");
            __builder.AddAttribute(365, "class", "form-control");
            __builder.AddAttribute(366, "type", "number");
            __builder.AddAttribute(367, "style", "background-color:lightyellow;");
            __builder.AddAttribute(368, "value", 
#nullable restore
#line 281 "C:\Users\PawLie\Documents\Development\BTSM\Security\Analysis\Pages\Calculator.razor"
                                                   section.Value

#line default
#line hidden
#nullable disable
            );
            __builder.AddAttribute(369, "oninput", Microsoft.AspNetCore.Components.EventCallback.Factory.Create<Microsoft.AspNetCore.Components.ChangeEventArgs>(this, 
#nullable restore
#line 282 "C:\Users\PawLie\Documents\Development\BTSM\Security\Analysis\Pages\Calculator.razor"
                                                       e => { section.Value = (int)e.Value; }

#line default
#line hidden
#nullable disable
            ));
            __builder.AddAttribute(370, "placeholder", 
#nullable restore
#line 282 "C:\Users\PawLie\Documents\Development\BTSM\Security\Analysis\Pages\Calculator.razor"
                                                                                                              section.Value

#line default
#line hidden
#nullable disable
            );
            __builder.CloseElement();
            __builder.AddMarkupContent(371, "\r\n\t\t\t\t\t\t\t\t\t");
            __builder.OpenElement(372, "input");
            __builder.AddAttribute(373, "class", "form-control");
            __builder.AddAttribute(374, "type", "number");
            __builder.AddAttribute(375, "style", "background-color:lightyellow;");
            __builder.AddAttribute(376, "value", 
#nullable restore
#line 285 "C:\Users\PawLie\Documents\Development\BTSM\Security\Analysis\Pages\Calculator.razor"
                                                   section.MaxValue

#line default
#line hidden
#nullable disable
            );
            __builder.AddAttribute(377, "oninput", Microsoft.AspNetCore.Components.EventCallback.Factory.Create<Microsoft.AspNetCore.Components.ChangeEventArgs>(this, 
#nullable restore
#line 286 "C:\Users\PawLie\Documents\Development\BTSM\Security\Analysis\Pages\Calculator.razor"
                                                       e => { section.MaxValue = (int)e.Value; }

#line default
#line hidden
#nullable disable
            ));
            __builder.CloseElement();
            __builder.AddMarkupContent(378, "\r\n\t\t\t\t\t\t\t\t");
            __builder.CloseElement();
            __builder.AddMarkupContent(379, "\r\n");
#nullable restore
#line 288 "C:\Users\PawLie\Documents\Development\BTSM\Security\Analysis\Pages\Calculator.razor"
							}
							else
							{

#line default
#line hidden
#nullable disable
            __builder.AddMarkupContent(380, "\t\t\t\t\t\t\t\t");
            __builder.OpenElement(381, "td");
            __builder.AddContent(382, 
#nullable restore
#line 291 "C:\Users\PawLie\Documents\Development\BTSM\Security\Analysis\Pages\Calculator.razor"
                                     section.Value

#line default
#line hidden
#nullable disable
            );
            __builder.AddMarkupContent(383, " bodů z ");
            __builder.AddContent(384, 
#nullable restore
#line 291 "C:\Users\PawLie\Documents\Development\BTSM\Security\Analysis\Pages\Calculator.razor"
                                                           section.MaxValue

#line default
#line hidden
#nullable disable
            );
            __builder.AddMarkupContent(385, " bodů maximálně");
            __builder.CloseElement();
            __builder.AddMarkupContent(386, "\r\n");
#nullable restore
#line 292 "C:\Users\PawLie\Documents\Development\BTSM\Security\Analysis\Pages\Calculator.razor"
							}

#line default
#line hidden
#nullable disable
            __builder.AddMarkupContent(387, "\t\t\t\t\t\t\t");
            __builder.OpenElement(388, "td");
            __builder.AddMarkupContent(389, "\r\n\t\t\t\t\t\t\t\t");
            __builder.AddContent(390, 
#nullable restore
#line 294 "C:\Users\PawLie\Documents\Development\BTSM\Security\Analysis\Pages\Calculator.razor"
                                 section.Result.ToString("P")

#line default
#line hidden
#nullable disable
            );
            __builder.AddContent(391, " - ");
            __builder.AddContent(392, 
#nullable restore
#line 294 "C:\Users\PawLie\Documents\Development\BTSM\Security\Analysis\Pages\Calculator.razor"
                                                                 ratingTables.Where(x => x.SectionType == section.SectionType).FirstOrDefault().Ratings.Where(y => y.MinValue <= section.Result * 100 && y.MaxValue >= section.Result * 100).FirstOrDefault().Name

#line default
#line hidden
#nullable disable
            );
            __builder.AddMarkupContent(393, "\r\n\t\t\t\t\t\t\t");
            __builder.CloseElement();
            __builder.AddMarkupContent(394, "\r\n\t\t\t\t\t\t");
            __builder.CloseElement();
            __builder.AddMarkupContent(395, "\r\n\t\t\t\t\t");
            __builder.CloseElement();
            __builder.AddMarkupContent(396, "\r\n");
#nullable restore
#line 298 "C:\Users\PawLie\Documents\Development\BTSM\Security\Analysis\Pages\Calculator.razor"
				}

#line default
#line hidden
#nullable disable
            __builder.AddMarkupContent(397, "\t\t\t");
            __builder.CloseElement();
            __builder.AddMarkupContent(398, "\r\n");
#nullable restore
#line 300 "C:\Users\PawLie\Documents\Development\BTSM\Security\Analysis\Pages\Calculator.razor"
			foreach (var sectionResult in groupedSection)
			{
				var calculation = new SectionResultCalculatedModel()
				{
					SectionType = groupedSection.Key,
					QuestionType = sectionResult.QuestionType,
					Name = sectionResult.QuestionType != null ? GetQuestionName(sectionResult.QuestionType) : GetSectionName(sectionResult.SectionType),
					Result = sectionResult.Result,
					ResultType = GetResultType(sectionResult.SectionType)
				};
				if (calculatedResults.Any(x => x.ResultType == calculation.ResultType && x.SectionType == calculation.SectionType && x.QuestionType == calculation.QuestionType))
				{
					calculatedResults.FirstOrDefault(x => x.ResultType == calculation.ResultType && x.SectionType == calculation.SectionType && x.QuestionType == calculation.QuestionType).Result = calculation.Result;
				}
				else
					calculatedResults.Add(calculation);
			}
		}

		foreach (var calculatedResult in calculatedResults.GroupBy(x => x.ResultType))
		{
			SetResultTitle(calculatedResult.Key);
			calculatedValue = 0;
			rate = 0;

#line default
#line hidden
#nullable disable
            __builder.AddMarkupContent(399, "\t\t\t");
            __builder.OpenElement(400, "h2");
            __builder.AddMarkupContent(401, "\r\n\t\t\t\t");
            __builder.AddContent(402, 
#nullable restore
#line 325 "C:\Users\PawLie\Documents\Development\BTSM\Security\Analysis\Pages\Calculator.razor"
                 resultTitle

#line default
#line hidden
#nullable disable
            );
            __builder.AddMarkupContent(403, "\r\n\t\t\t");
            __builder.CloseElement();
            __builder.AddMarkupContent(404, "\r\n\t\t\t");
            __builder.OpenElement(405, "table");
            __builder.AddAttribute(406, "style", "width:40%");
            __builder.AddAttribute(407, "class", "table");
            __builder.AddMarkupContent(408, "\r\n\t\t\t\t");
            __builder.AddMarkupContent(409, "<thead>\r\n\t\t\t\t\t<tr>\r\n\t\t\t\t\t\t<th>\r\n\t\t\t\t\t\t\tAspekty\r\n\t\t\t\t\t\t</th>\r\n\t\t\t\t\t\t<th>\r\n\t\t\t\t\t\t\tVáha\r\n\t\t\t\t\t\t</th>\r\n\t\t\t\t\t\t<th>\r\n\t\t\t\t\t\t\tÚroveň bezpečnosti\r\n\t\t\t\t\t\t</th>\r\n\t\t\t\t\t</tr>\r\n\t\t\t\t</thead>\r\n\r\n");
#nullable restore
#line 342 "C:\Users\PawLie\Documents\Development\BTSM\Security\Analysis\Pages\Calculator.razor"
                 foreach (var result in calculatedResult)
				{

#line default
#line hidden
#nullable disable
            __builder.AddMarkupContent(410, "\t\t\t\t\t");
            __builder.OpenElement(411, "tbody");
            __builder.AddMarkupContent(412, "\r\n\t\t\t\t\t\t");
            __builder.OpenElement(413, "tr");
            __builder.AddMarkupContent(414, "\r\n\t\t\t\t\t\t\t");
            __builder.OpenElement(415, "td");
            __builder.AddContent(416, 
#nullable restore
#line 346 "C:\Users\PawLie\Documents\Development\BTSM\Security\Analysis\Pages\Calculator.razor"
                                 result.Name

#line default
#line hidden
#nullable disable
            );
            __builder.CloseElement();
            __builder.AddMarkupContent(417, "\r\n");
#nullable restore
#line 347 "C:\Users\PawLie\Documents\Development\BTSM\Security\Analysis\Pages\Calculator.razor"
                             if (!result.Edit)
							{

#line default
#line hidden
#nullable disable
            __builder.AddMarkupContent(418, "\t\t\t\t\t\t\t\t");
            __builder.OpenElement(419, "td");
            __builder.AddAttribute(420, "class", "td-answer");
            __builder.AddMarkupContent(421, "\r\n\t\t\t\t\t\t\t\t\t");
            __builder.OpenElement(422, "input");
            __builder.AddAttribute(423, "class", "form-control");
            __builder.AddAttribute(424, "type", "number");
            __builder.AddAttribute(425, "step", "0.01");
            __builder.AddAttribute(426, "min", "0");
            __builder.AddAttribute(427, "max", "1");
            __builder.AddAttribute(428, "value", Microsoft.AspNetCore.Components.BindConverter.FormatValue(
#nullable restore
#line 350 "C:\Users\PawLie\Documents\Development\BTSM\Security\Analysis\Pages\Calculator.razor"
                                                                                                                        result.Rate

#line default
#line hidden
#nullable disable
            , culture: global::System.Globalization.CultureInfo.InvariantCulture));
            __builder.AddAttribute(429, "onchange", Microsoft.AspNetCore.Components.EventCallback.Factory.CreateBinder(this, __value => result.Rate = __value, result.Rate, culture: global::System.Globalization.CultureInfo.InvariantCulture));
            __builder.SetUpdatesAttributeName("value");
            __builder.CloseElement();
            __builder.AddMarkupContent(430, "\r\n\t\t\t\t\t\t\t\t");
            __builder.CloseElement();
            __builder.AddMarkupContent(431, "\r\n");
#nullable restore
#line 352 "C:\Users\PawLie\Documents\Development\BTSM\Security\Analysis\Pages\Calculator.razor"
							}
							else
							{

#line default
#line hidden
#nullable disable
            __builder.AddMarkupContent(432, "\t\t\t\t\t\t\t\t");
            __builder.OpenElement(433, "td");
            __builder.AddContent(434, 
#nullable restore
#line 355 "C:\Users\PawLie\Documents\Development\BTSM\Security\Analysis\Pages\Calculator.razor"
                                     result.Rate.ToString("0.00")

#line default
#line hidden
#nullable disable
            );
            __builder.AddContent(435, " (");
            __builder.AddContent(436, 
#nullable restore
#line 355 "C:\Users\PawLie\Documents\Development\BTSM\Security\Analysis\Pages\Calculator.razor"
                                                                     (result.Rate).ToString("P")

#line default
#line hidden
#nullable disable
            );
            __builder.AddContent(437, ")");
            __builder.CloseElement();
            __builder.AddMarkupContent(438, "\r\n");
#nullable restore
#line 356 "C:\Users\PawLie\Documents\Development\BTSM\Security\Analysis\Pages\Calculator.razor"
							}

#line default
#line hidden
#nullable disable
            __builder.AddMarkupContent(439, "\t\t\t\t\t\t\t");
            __builder.OpenElement(440, "td");
            __builder.AddMarkupContent(441, "\r\n\t\t\t\t\t\t\t\t");
            __builder.AddContent(442, 
#nullable restore
#line 358 "C:\Users\PawLie\Documents\Development\BTSM\Security\Analysis\Pages\Calculator.razor"
                                 result.Result.ToString("0.00")

#line default
#line hidden
#nullable disable
            );
            __builder.AddContent(443, " - ");
            __builder.AddContent(444, 
#nullable restore
#line 358 "C:\Users\PawLie\Documents\Development\BTSM\Security\Analysis\Pages\Calculator.razor"
                                                                   result.Result.ToString("P")

#line default
#line hidden
#nullable disable
            );
            __builder.AddMarkupContent(445, "\r\n\t\t\t\t\t\t\t");
            __builder.CloseElement();
            __builder.AddMarkupContent(446, "\r\n\t\t\t\t\t\t");
            __builder.CloseElement();
            __builder.AddMarkupContent(447, "\r\n\t\t\t\t\t");
            __builder.CloseElement();
            __builder.AddMarkupContent(448, "\r\n");
#nullable restore
#line 362 "C:\Users\PawLie\Documents\Development\BTSM\Security\Analysis\Pages\Calculator.razor"
					rate += result.Rate;
					calculatedValue += (result.Rate * result.Result);
				}

#line default
#line hidden
#nullable disable
            __builder.AddMarkupContent(449, "\t\t\t\t");
            __builder.OpenElement(450, "tbody");
            __builder.AddMarkupContent(451, "\r\n\t\t\t\t\t");
            __builder.OpenElement(452, "tr");
            __builder.AddMarkupContent(453, "\r\n\t\t\t\t\t\t");
            __builder.AddMarkupContent(454, "<td>\r\n\t\t\t\t\t\t\tVypočítaná hodnota\r\n\t\t\t\t\t\t</td>\r\n\t\t\t\t\t\t");
            __builder.OpenElement(455, "td");
            __builder.AddMarkupContent(456, "\r\n\t\t\t\t\t\t\t");
            __builder.AddContent(457, 
#nullable restore
#line 371 "C:\Users\PawLie\Documents\Development\BTSM\Security\Analysis\Pages\Calculator.razor"
                             rate.ToString("0.00")

#line default
#line hidden
#nullable disable
            );
            __builder.AddMarkupContent(458, "\r\n\t\t\t\t\t\t");
            __builder.CloseElement();
            __builder.AddMarkupContent(459, "\r\n\t\t\t\t\t\t");
            __builder.OpenElement(460, "td");
            __builder.AddMarkupContent(461, "\r\n\t\t\t\t\t\t\t");
            __builder.AddContent(462, 
#nullable restore
#line 374 "C:\Users\PawLie\Documents\Development\BTSM\Security\Analysis\Pages\Calculator.razor"
                             calculatedValue.ToString("0.00")

#line default
#line hidden
#nullable disable
            );
            __builder.AddMarkupContent(463, "\r\n\t\t\t\t\t\t");
            __builder.CloseElement();
            __builder.AddMarkupContent(464, "\r\n\t\t\t\t\t");
            __builder.CloseElement();
            __builder.AddMarkupContent(465, "\r\n\t\t\t\t");
            __builder.CloseElement();
            __builder.AddMarkupContent(466, "\r\n\t\t\t");
            __builder.CloseElement();
            __builder.AddMarkupContent(467, "\r\n");
#nullable restore
#line 379 "C:\Users\PawLie\Documents\Development\BTSM\Security\Analysis\Pages\Calculator.razor"
			var calculation = new ResultModel()
			{
				ResultType = calculatedResult.Key,
				Result = calculatedValue
			};
			if (results.Any(x => x.ResultType == calculation.ResultType))
			{
				results.FirstOrDefault(x => x.ResultType == calculation.ResultType).Result = calculation.Result;
			}
			else
				results.Add(calculation);

			

#line default
#line hidden
#nullable disable
#nullable restore
#line 391 "C:\Users\PawLie\Documents\Development\BTSM\Security\Analysis\Pages\Calculator.razor"
             if (rate != 1)
			{

#line default
#line hidden
#nullable disable
            __builder.AddMarkupContent(468, "\t\t\t\t");
            __builder.AddMarkupContent(469, "<span class=\"alert-danger\">Součet hodnot vah se musí = 1</span>\r\n");
#nullable restore
#line 394 "C:\Users\PawLie\Documents\Development\BTSM\Security\Analysis\Pages\Calculator.razor"
			}

#line default
#line hidden
#nullable disable
            __builder.AddMarkupContent(470, "\t\t\t<div class=\"section-line\"></div>\r\n\t\t\t<div class=\"section-line\"></div>\r\n");
#nullable restore
#line 397 "C:\Users\PawLie\Documents\Development\BTSM\Security\Analysis\Pages\Calculator.razor"
		}


#line default
#line hidden
#nullable disable
            __builder.AddMarkupContent(471, "\t\t");
            __builder.AddMarkupContent(472, "<h2>\r\n\t\t\tHodnocení zranitelnosti\r\n\t\t</h2>\r\n");
#nullable restore
#line 402 "C:\Users\PawLie\Documents\Development\BTSM\Security\Analysis\Pages\Calculator.razor"
		calculatedValue = 0;
		rate = 0;

#line default
#line hidden
#nullable disable
            __builder.AddMarkupContent(473, "\t\t");
            __builder.OpenElement(474, "table");
            __builder.AddAttribute(475, "style", "width:40%");
            __builder.AddAttribute(476, "class", "table");
            __builder.AddMarkupContent(477, "\r\n\t\t\t");
            __builder.AddMarkupContent(478, "<thead>\r\n\t\t\t\t<tr>\r\n\t\t\t\t\t<th>\r\n\t\t\t\t\t\tAspekty\r\n\t\t\t\t\t</th>\r\n\t\t\t\t\t<th>\r\n\t\t\t\t\t\tVáha\r\n\t\t\t\t\t</th>\r\n\t\t\t\t\t<th>\r\n\t\t\t\t\t\tÚroveň bezpečnosti\r\n\t\t\t\t\t</th>\r\n\t\t\t\t</tr>\r\n\t\t\t</thead>\r\n");
#nullable restore
#line 418 "C:\Users\PawLie\Documents\Development\BTSM\Security\Analysis\Pages\Calculator.razor"
             foreach (var result in results.Where(x => x.ResultType == ResultType.InternalVulnerabilityResult || x.ResultType == ResultType.ExternalVulnerabilityResult).OrderBy(x => x.ResultType))
			{
				SetResultTitle(result.ResultType);

#line default
#line hidden
#nullable disable
            __builder.AddMarkupContent(479, "\t\t\t\t");
            __builder.OpenElement(480, "tbody");
            __builder.AddMarkupContent(481, "\r\n\t\t\t\t\t");
            __builder.OpenElement(482, "tr");
            __builder.AddMarkupContent(483, "\r\n\t\t\t\t\t\t");
            __builder.OpenElement(484, "td");
            __builder.AddContent(485, 
#nullable restore
#line 423 "C:\Users\PawLie\Documents\Development\BTSM\Security\Analysis\Pages\Calculator.razor"
                             resultTitle

#line default
#line hidden
#nullable disable
            );
            __builder.CloseElement();
            __builder.AddMarkupContent(486, "\r\n\t\t\t\t\t\t");
            __builder.OpenElement(487, "td");
            __builder.AddAttribute(488, "class", "td-answer");
            __builder.AddMarkupContent(489, "\r\n\t\t\t\t\t\t\t");
            __builder.OpenElement(490, "input");
            __builder.AddAttribute(491, "class", "form-control");
            __builder.AddAttribute(492, "type", "number");
            __builder.AddAttribute(493, "step", "0.01");
            __builder.AddAttribute(494, "min", "0");
            __builder.AddAttribute(495, "max", "1");
            __builder.AddAttribute(496, "value", Microsoft.AspNetCore.Components.BindConverter.FormatValue(
#nullable restore
#line 425 "C:\Users\PawLie\Documents\Development\BTSM\Security\Analysis\Pages\Calculator.razor"
                                                                                                                result.Rate

#line default
#line hidden
#nullable disable
            , culture: global::System.Globalization.CultureInfo.InvariantCulture));
            __builder.AddAttribute(497, "onchange", Microsoft.AspNetCore.Components.EventCallback.Factory.CreateBinder(this, __value => result.Rate = __value, result.Rate, culture: global::System.Globalization.CultureInfo.InvariantCulture));
            __builder.SetUpdatesAttributeName("value");
            __builder.CloseElement();
            __builder.AddMarkupContent(498, "\r\n\t\t\t\t\t\t");
            __builder.CloseElement();
            __builder.AddMarkupContent(499, "\r\n\t\t\t\t\t\t");
            __builder.OpenElement(500, "td");
            __builder.AddMarkupContent(501, "\r\n\t\t\t\t\t\t\t");
            __builder.AddContent(502, 
#nullable restore
#line 428 "C:\Users\PawLie\Documents\Development\BTSM\Security\Analysis\Pages\Calculator.razor"
                             result.Result.ToString("0.00")

#line default
#line hidden
#nullable disable
            );
            __builder.AddContent(503, " - ");
            __builder.AddContent(504, 
#nullable restore
#line 428 "C:\Users\PawLie\Documents\Development\BTSM\Security\Analysis\Pages\Calculator.razor"
                                                               result.Result.ToString("P")

#line default
#line hidden
#nullable disable
            );
            __builder.AddMarkupContent(505, "\r\n\t\t\t\t\t\t");
            __builder.CloseElement();
            __builder.AddMarkupContent(506, "\r\n\t\t\t\t\t");
            __builder.CloseElement();
            __builder.AddMarkupContent(507, "\r\n\t\t\t\t");
            __builder.CloseElement();
            __builder.AddMarkupContent(508, "\r\n");
#nullable restore
#line 432 "C:\Users\PawLie\Documents\Development\BTSM\Security\Analysis\Pages\Calculator.razor"
				calculatedValue += result.Rate * result.Result;
				rate += result.Rate;
			}

#line default
#line hidden
#nullable disable
            __builder.AddMarkupContent(509, "\t\t\t");
            __builder.OpenElement(510, "tbody");
            __builder.AddMarkupContent(511, "\r\n\t\t\t\t");
            __builder.OpenElement(512, "tr");
            __builder.AddMarkupContent(513, "\r\n\t\t\t\t\t");
            __builder.AddMarkupContent(514, "<td>\r\n\t\t\t\t\t\tVypočítaná hodnota\r\n\t\t\t\t\t</td>\r\n\t\t\t\t\t");
            __builder.OpenElement(515, "td");
            __builder.AddMarkupContent(516, "\r\n\t\t\t\t\t\t");
            __builder.AddContent(517, 
#nullable restore
#line 441 "C:\Users\PawLie\Documents\Development\BTSM\Security\Analysis\Pages\Calculator.razor"
                         rate.ToString("0.00")

#line default
#line hidden
#nullable disable
            );
            __builder.AddMarkupContent(518, "\r\n\t\t\t\t\t");
            __builder.CloseElement();
            __builder.AddMarkupContent(519, "\r\n\t\t\t\t\t");
            __builder.OpenElement(520, "td");
            __builder.AddMarkupContent(521, "\r\n\t\t\t\t\t\t");
            __builder.AddContent(522, 
#nullable restore
#line 444 "C:\Users\PawLie\Documents\Development\BTSM\Security\Analysis\Pages\Calculator.razor"
                         calculatedValue.ToString("0.00")

#line default
#line hidden
#nullable disable
            );
            __builder.AddMarkupContent(523, "\r\n\t\t\t\t\t");
            __builder.CloseElement();
            __builder.AddMarkupContent(524, "\r\n\t\t\t\t");
            __builder.CloseElement();
            __builder.AddMarkupContent(525, "\r\n\t\t\t");
            __builder.CloseElement();
            __builder.AddMarkupContent(526, "\r\n\t\t");
            __builder.CloseElement();
            __builder.AddMarkupContent(527, "\r\n");
#nullable restore
#line 449 "C:\Users\PawLie\Documents\Development\BTSM\Security\Analysis\Pages\Calculator.razor"
		var model = new ResultModel()
		{
			ResultType = ResultType.VulnerabilityResult,
			Result = calculatedValue
		};
		if (results.Any(x => x.ResultType == model.ResultType))
		{
			results.FirstOrDefault(x => x.ResultType == model.ResultType).Result = model.Result;
		}
		else
			results.Add(model);

		

#line default
#line hidden
#nullable disable
#nullable restore
#line 461 "C:\Users\PawLie\Documents\Development\BTSM\Security\Analysis\Pages\Calculator.razor"
         if (rate != 1)
		{

#line default
#line hidden
#nullable disable
            __builder.AddMarkupContent(528, "\t\t\t");
            __builder.AddMarkupContent(529, "<span class=\"alert-danger\">Součet hodnot vah se musí = 1</span>\r\n");
#nullable restore
#line 464 "C:\Users\PawLie\Documents\Development\BTSM\Security\Analysis\Pages\Calculator.razor"
		}

#line default
#line hidden
#nullable disable
            __builder.AddMarkupContent(530, "\t\t<div class=\"section-line\"></div>\r\n\t\t<div class=\"section-line\"></div>\r\n");
            __builder.AddMarkupContent(531, "\t\t");
            __builder.AddMarkupContent(532, "<h2>\r\n\t\t\tHodnocení bezpečnosti\r\n\t\t</h2>\r\n");
#nullable restore
#line 471 "C:\Users\PawLie\Documents\Development\BTSM\Security\Analysis\Pages\Calculator.razor"
		calculatedValue = 0;
		rate = 0;


#line default
#line hidden
#nullable disable
            __builder.AddMarkupContent(533, "\t\t");
            __builder.OpenElement(534, "table");
            __builder.AddAttribute(535, "style", "width:40%");
            __builder.AddAttribute(536, "class", "table");
            __builder.AddMarkupContent(537, "\r\n\t\t\t");
            __builder.AddMarkupContent(538, "<thead>\r\n\t\t\t\t<tr>\r\n\t\t\t\t\t<th>\r\n\t\t\t\t\t\tAspekty\r\n\t\t\t\t\t</th>\r\n\t\t\t\t\t<th>\r\n\t\t\t\t\t\tVáha\r\n\t\t\t\t\t</th>\r\n\t\t\t\t\t<th>\r\n\t\t\t\t\t\tÚroveň bezpečnosti\r\n\t\t\t\t\t</th>\r\n\t\t\t\t</tr>\r\n\t\t\t</thead>\r\n");
#nullable restore
#line 488 "C:\Users\PawLie\Documents\Development\BTSM\Security\Analysis\Pages\Calculator.razor"
             foreach (var result in results.Where(x => x.ResultType == ResultType.InternalSecurityResult || x.ResultType == ResultType.ExternalSecurityResult || x.ResultType == ResultType.OrganizationalRegimeResult).OrderBy(x => x.ResultType))
			{
				SetResultTitle(result.ResultType);

#line default
#line hidden
#nullable disable
            __builder.AddMarkupContent(539, "\t\t\t\t");
            __builder.OpenElement(540, "tbody");
            __builder.AddMarkupContent(541, "\r\n\t\t\t\t\t");
            __builder.OpenElement(542, "tr");
            __builder.AddMarkupContent(543, "\r\n\t\t\t\t\t\t");
            __builder.OpenElement(544, "td");
            __builder.AddContent(545, 
#nullable restore
#line 493 "C:\Users\PawLie\Documents\Development\BTSM\Security\Analysis\Pages\Calculator.razor"
                             resultTitle

#line default
#line hidden
#nullable disable
            );
            __builder.CloseElement();
            __builder.AddMarkupContent(546, "\r\n\t\t\t\t\t\t");
            __builder.OpenElement(547, "td");
            __builder.AddAttribute(548, "class", "td-answer");
            __builder.AddMarkupContent(549, "\r\n\t\t\t\t\t\t\t");
            __builder.OpenElement(550, "input");
            __builder.AddAttribute(551, "class", "form-control");
            __builder.AddAttribute(552, "type", "number");
            __builder.AddAttribute(553, "step", "0.01");
            __builder.AddAttribute(554, "min", "0");
            __builder.AddAttribute(555, "max", "1");
            __builder.AddAttribute(556, "value", Microsoft.AspNetCore.Components.BindConverter.FormatValue(
#nullable restore
#line 495 "C:\Users\PawLie\Documents\Development\BTSM\Security\Analysis\Pages\Calculator.razor"
                                                                                                                result.Rate

#line default
#line hidden
#nullable disable
            , culture: global::System.Globalization.CultureInfo.InvariantCulture));
            __builder.AddAttribute(557, "onchange", Microsoft.AspNetCore.Components.EventCallback.Factory.CreateBinder(this, __value => result.Rate = __value, result.Rate, culture: global::System.Globalization.CultureInfo.InvariantCulture));
            __builder.SetUpdatesAttributeName("value");
            __builder.CloseElement();
            __builder.AddMarkupContent(558, "\r\n\t\t\t\t\t\t");
            __builder.CloseElement();
            __builder.AddMarkupContent(559, "\r\n\t\t\t\t\t\t");
            __builder.OpenElement(560, "td");
            __builder.AddMarkupContent(561, "\r\n\t\t\t\t\t\t\t");
            __builder.AddContent(562, 
#nullable restore
#line 498 "C:\Users\PawLie\Documents\Development\BTSM\Security\Analysis\Pages\Calculator.razor"
                             result.Result.ToString("0.00")

#line default
#line hidden
#nullable disable
            );
            __builder.AddContent(563, " - ");
            __builder.AddContent(564, 
#nullable restore
#line 498 "C:\Users\PawLie\Documents\Development\BTSM\Security\Analysis\Pages\Calculator.razor"
                                                               result.Result.ToString("P")

#line default
#line hidden
#nullable disable
            );
            __builder.AddMarkupContent(565, "\r\n\t\t\t\t\t\t");
            __builder.CloseElement();
            __builder.AddMarkupContent(566, "\r\n\t\t\t\t\t");
            __builder.CloseElement();
            __builder.AddMarkupContent(567, "\r\n\t\t\t\t");
            __builder.CloseElement();
            __builder.AddMarkupContent(568, "\r\n");
#nullable restore
#line 502 "C:\Users\PawLie\Documents\Development\BTSM\Security\Analysis\Pages\Calculator.razor"
				calculatedValue += result.Rate * result.Result;
				rate += result.Rate;
			}

#line default
#line hidden
#nullable disable
            __builder.AddMarkupContent(569, "\t\t\t");
            __builder.OpenElement(570, "tbody");
            __builder.AddMarkupContent(571, "\r\n\t\t\t\t");
            __builder.OpenElement(572, "tr");
            __builder.AddMarkupContent(573, "\r\n\t\t\t\t\t");
            __builder.AddMarkupContent(574, "<td>\r\n\t\t\t\t\t\tVypočítaná hodnota\r\n\t\t\t\t\t</td>\r\n\t\t\t\t\t");
            __builder.OpenElement(575, "td");
            __builder.AddMarkupContent(576, "\r\n\t\t\t\t\t\t");
            __builder.AddContent(577, 
#nullable restore
#line 511 "C:\Users\PawLie\Documents\Development\BTSM\Security\Analysis\Pages\Calculator.razor"
                         rate.ToString("0.00")

#line default
#line hidden
#nullable disable
            );
            __builder.AddMarkupContent(578, "\r\n\t\t\t\t\t");
            __builder.CloseElement();
            __builder.AddMarkupContent(579, "\r\n\t\t\t\t\t");
            __builder.OpenElement(580, "td");
            __builder.AddMarkupContent(581, "\r\n\t\t\t\t\t\t");
            __builder.AddContent(582, 
#nullable restore
#line 514 "C:\Users\PawLie\Documents\Development\BTSM\Security\Analysis\Pages\Calculator.razor"
                         calculatedValue.ToString("0.00")

#line default
#line hidden
#nullable disable
            );
            __builder.AddMarkupContent(583, "\r\n\t\t\t\t\t");
            __builder.CloseElement();
            __builder.AddMarkupContent(584, "\r\n\t\t\t\t");
            __builder.CloseElement();
            __builder.AddMarkupContent(585, "\r\n\t\t\t");
            __builder.CloseElement();
            __builder.AddMarkupContent(586, "\r\n\t\t");
            __builder.CloseElement();
            __builder.AddMarkupContent(587, "\r\n");
#nullable restore
#line 519 "C:\Users\PawLie\Documents\Development\BTSM\Security\Analysis\Pages\Calculator.razor"
		model = new ResultModel()
		{
			ResultType = ResultType.SecurityResult,
			Result = calculatedValue
		};
		if (results.Any(x => x.ResultType == model.ResultType))
		{
			results.FirstOrDefault(x => x.ResultType == model.ResultType).Result = model.Result;
		}
		else
			results.Add(model);

		

#line default
#line hidden
#nullable disable
#nullable restore
#line 531 "C:\Users\PawLie\Documents\Development\BTSM\Security\Analysis\Pages\Calculator.razor"
         if (rate != 1)
		{

#line default
#line hidden
#nullable disable
            __builder.AddMarkupContent(588, "\t\t\t");
            __builder.AddMarkupContent(589, "<span class=\"alert-danger\">Součet hodnot vah se musí = 1</span>\r\n");
#nullable restore
#line 534 "C:\Users\PawLie\Documents\Development\BTSM\Security\Analysis\Pages\Calculator.razor"
		}

#line default
#line hidden
#nullable disable
            __builder.AddMarkupContent(590, "\t\t<div class=\"section-line\"></div>\r\n\t\t<div class=\"section-line\"></div>\r\n");
            __builder.AddMarkupContent(591, "\t\t");
            __builder.AddMarkupContent(592, "<h2>\r\n\t\t\tÚroveň bezpečnosti (Kategorizace)\r\n\t\t</h2>\r\n");
#nullable restore
#line 541 "C:\Users\PawLie\Documents\Development\BTSM\Security\Analysis\Pages\Calculator.razor"
		calculatedValue = 0;
		rate = 0;

#line default
#line hidden
#nullable disable
            __builder.AddMarkupContent(593, "\t\t");
            __builder.OpenElement(594, "div");
            __builder.AddMarkupContent(595, "\r\n\t\t\t");
            __builder.OpenElement(596, "table");
            __builder.AddMarkupContent(597, "\r\n\t\t\t\t");
            __builder.OpenElement(598, "tbody");
            __builder.AddMarkupContent(599, "\r\n\t\t\t\t\t");
            __builder.OpenElement(600, "tr");
            __builder.AddMarkupContent(601, "\r\n\t\t\t\t\t\t");
            __builder.OpenElement(602, "td");
            __builder.AddMarkupContent(603, "\r\n\t\t\t\t\t\t\t");
            __builder.OpenElement(604, "table");
            __builder.AddAttribute(605, "class", "table");
            __builder.AddMarkupContent(606, "\r\n\t\t\t\t\t\t\t\t");
            __builder.AddMarkupContent(607, "<thead>\r\n\t\t\t\t\t\t\t\t\t<tr>\r\n\t\t\t\t\t\t\t\t\t\t<th>\r\n\t\t\t\t\t\t\t\t\t\t\tDruh\r\n\t\t\t\t\t\t\t\t\t\t</th>\r\n\t\t\t\t\t\t\t\t\t\t<th>\r\n\t\t\t\t\t\t\t\t\t\t\tÚroveň bezpečnosti\r\n\t\t\t\t\t\t\t\t\t\t</th>\r\n\t\t\t\t\t\t\t\t\t</tr>\r\n\t\t\t\t\t\t\t\t</thead>\r\n");
#nullable restore
#line 559 "C:\Users\PawLie\Documents\Development\BTSM\Security\Analysis\Pages\Calculator.razor"
                                 foreach (var result in results.Where(x => x.ResultType == ResultType.VulnerabilityResult || x.ResultType == ResultType.SecurityResult).OrderBy(x => x.ResultType))
								{
									SetResultTitle(result.ResultType);

#line default
#line hidden
#nullable disable
            __builder.AddMarkupContent(608, "\t\t\t\t\t\t\t\t\t");
            __builder.OpenElement(609, "tbody");
            __builder.AddMarkupContent(610, "\r\n\t\t\t\t\t\t\t\t\t\t");
            __builder.OpenElement(611, "tr");
            __builder.AddMarkupContent(612, "\r\n\t\t\t\t\t\t\t\t\t\t\t");
            __builder.OpenElement(613, "td");
            __builder.AddContent(614, 
#nullable restore
#line 564 "C:\Users\PawLie\Documents\Development\BTSM\Security\Analysis\Pages\Calculator.razor"
                                                 resultTitle

#line default
#line hidden
#nullable disable
            );
            __builder.CloseElement();
            __builder.AddMarkupContent(615, "\r\n\t\t\t\t\t\t\t\t\t\t\t");
            __builder.OpenElement(616, "td");
            __builder.AddMarkupContent(617, "\r\n\t\t\t\t\t\t\t\t\t\t\t\t");
            __builder.AddContent(618, 
#nullable restore
#line 566 "C:\Users\PawLie\Documents\Development\BTSM\Security\Analysis\Pages\Calculator.razor"
                                                 result.Result.ToString("0.0000")

#line default
#line hidden
#nullable disable
            );
            __builder.AddContent(619, " - ");
            __builder.AddContent(620, 
#nullable restore
#line 566 "C:\Users\PawLie\Documents\Development\BTSM\Security\Analysis\Pages\Calculator.razor"
                                                                                     result.Result.ToString("P")

#line default
#line hidden
#nullable disable
            );
            __builder.AddMarkupContent(621, "\r\n\t\t\t\t\t\t\t\t\t\t\t");
            __builder.CloseElement();
            __builder.AddMarkupContent(622, "\r\n\t\t\t\t\t\t\t\t\t\t");
            __builder.CloseElement();
            __builder.AddMarkupContent(623, "\r\n\t\t\t\t\t\t\t\t\t");
            __builder.CloseElement();
            __builder.AddMarkupContent(624, "\r\n");
#nullable restore
#line 570 "C:\Users\PawLie\Documents\Development\BTSM\Security\Analysis\Pages\Calculator.razor"
								}

#line default
#line hidden
#nullable disable
#nullable restore
#line 571 "C:\Users\PawLie\Documents\Development\BTSM\Security\Analysis\Pages\Calculator.razor"
                                  
									var finalCalculation = results.Where(x => x.ResultType == ResultType.SecurityResult).FirstOrDefault().Result - results.Where(x => x.ResultType == ResultType.VulnerabilityResult).FirstOrDefault().Result;
								

#line default
#line hidden
#nullable disable
            __builder.AddMarkupContent(625, "\t\t\t\t\t\t\t\t");
            __builder.OpenElement(626, "tbody");
            __builder.AddMarkupContent(627, "\r\n\t\t\t\t\t\t\t\t\t");
            __builder.OpenElement(628, "tr");
            __builder.AddMarkupContent(629, "\r\n\t\t\t\t\t\t\t\t\t\t");
            __builder.OpenElement(630, "td");
            __builder.AddMarkupContent(631, "\r\n\t\t\t\t\t\t\t\t\t\t\tVypočet: ");
            __builder.AddContent(632, 
#nullable restore
#line 577 "C:\Users\PawLie\Documents\Development\BTSM\Security\Analysis\Pages\Calculator.razor"
                                                      results.Where(x => x.ResultType == ResultType.SecurityResult).FirstOrDefault().Result.ToString("0.0000")

#line default
#line hidden
#nullable disable
            );
            __builder.AddContent(633, " - ");
            __builder.AddContent(634, 
#nullable restore
#line 577 "C:\Users\PawLie\Documents\Development\BTSM\Security\Analysis\Pages\Calculator.razor"
                                                                                                                                                                  results.Where(x => x.ResultType == ResultType.VulnerabilityResult).FirstOrDefault().Result.ToString("0.0000")

#line default
#line hidden
#nullable disable
            );
            __builder.AddContent(635, " = ");
            __builder.AddContent(636, 
#nullable restore
#line 577 "C:\Users\PawLie\Documents\Development\BTSM\Security\Analysis\Pages\Calculator.razor"
                                                                                                                                                                                                                                                                                   finalCalculation.ToString("0.0000")

#line default
#line hidden
#nullable disable
            );
            __builder.AddMarkupContent(637, "\r\n\t\t\t\t\t\t\t\t\t\t");
            __builder.CloseElement();
            __builder.AddMarkupContent(638, "\r\n\t\t\t\t\t\t\t\t\t\t");
            __builder.OpenElement(639, "td");
            __builder.AddMarkupContent(640, "\r\n");
#nullable restore
#line 580 "C:\Users\PawLie\Documents\Development\BTSM\Security\Analysis\Pages\Calculator.razor"
                                             if (finalCalculation >= 0 && finalCalculation < (decimal)0.50)
											{

#line default
#line hidden
#nullable disable
            __builder.AddMarkupContent(641, "\t\t\t\t\t\t\t\t\t\t\t\t");
            __builder.AddMarkupContent(642, "<span>\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tMalá\r\n\t\t\t\t\t\t\t\t\t\t\t\t</span>\r\n");
#nullable restore
#line 585 "C:\Users\PawLie\Documents\Development\BTSM\Security\Analysis\Pages\Calculator.razor"
											}
											else if (finalCalculation >= (decimal)0.50 && finalCalculation <= (decimal)0.74)
											{

#line default
#line hidden
#nullable disable
            __builder.AddMarkupContent(643, "\t\t\t\t\t\t\t\t\t\t\t\t");
            __builder.AddMarkupContent(644, "<span>\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tStřední\r\n\t\t\t\t\t\t\t\t\t\t\t\t</span>\r\n");
#nullable restore
#line 591 "C:\Users\PawLie\Documents\Development\BTSM\Security\Analysis\Pages\Calculator.razor"
											}
											else if (finalCalculation > (decimal)0.74)
											{

#line default
#line hidden
#nullable disable
            __builder.AddMarkupContent(645, "\t\t\t\t\t\t\t\t\t\t\t\t");
            __builder.AddMarkupContent(646, "<span>\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tVysoká\r\n\t\t\t\t\t\t\t\t\t\t\t\t</span>\r\n");
#nullable restore
#line 597 "C:\Users\PawLie\Documents\Development\BTSM\Security\Analysis\Pages\Calculator.razor"
											}
											else if (finalCalculation < 0)
											{

#line default
#line hidden
#nullable disable
            __builder.AddMarkupContent(647, "\t\t\t\t\t\t\t\t\t\t\t\t");
            __builder.AddMarkupContent(648, "<span>\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tKritická\r\n\t\t\t\t\t\t\t\t\t\t\t\t</span>\r\n");
#nullable restore
#line 603 "C:\Users\PawLie\Documents\Development\BTSM\Security\Analysis\Pages\Calculator.razor"
											}

#line default
#line hidden
#nullable disable
            __builder.AddMarkupContent(649, "\t\t\t\t\t\t\t\t\t\t");
            __builder.CloseElement();
            __builder.AddMarkupContent(650, "\r\n\t\t\t\t\t\t\t\t\t");
            __builder.CloseElement();
            __builder.AddMarkupContent(651, "\r\n\t\t\t\t\t\t\t\t");
            __builder.CloseElement();
            __builder.AddMarkupContent(652, "\r\n\t\t\t\t\t\t\t");
            __builder.CloseElement();
            __builder.AddMarkupContent(653, "\r\n\t\t\t\t\t\t");
            __builder.CloseElement();
            __builder.AddMarkupContent(654, "\r\n\t\t\t\t\t\t");
            __builder.AddMarkupContent(655, @"<td>
							<table class=""table"">
								<thead>
									<tr>
										<th>
											Bodová hodnota
										</th>
										<th>
											Úroveň zabezpečení
										</th>
									</tr>
								</thead>
								<tbody>
									<tr>
										<td>Méně než 0.5</td>
										<td>Malá</td>
									</tr>
									<tr>
										<td>0.5 - 0.74</td>
										<td>Střední</td>
									</tr>
									<tr>
										<td>Více než 0.74</td>
										<td>Vysoká</td>
									</tr>
									<tr>
										<td>Méně než 0</td>
										<td>Kritická</td>
									</tr>
								</tbody>
							</table>
						</td>
					");
            __builder.CloseElement();
            __builder.AddMarkupContent(656, "\r\n\t\t\t\t");
            __builder.CloseElement();
            __builder.AddMarkupContent(657, "\r\n\t\t\t");
            __builder.CloseElement();
            __builder.AddMarkupContent(658, "\r\n\t\t");
            __builder.CloseElement();
            __builder.AddMarkupContent(659, "\r\n");
#nullable restore
#line 645 "C:\Users\PawLie\Documents\Development\BTSM\Security\Analysis\Pages\Calculator.razor"
	}

#line default
#line hidden
#nullable disable
            __builder.CloseElement();
        }
        #pragma warning restore 1998
#nullable restore
#line 647 "C:\Users\PawLie\Documents\Development\BTSM\Security\Analysis\Pages\Calculator.razor"
       
	private AnalysisModel analysisModel;
	private QuestionType? questionType;
	private bool showQuestions;
	private bool showTables;
	private bool showResult;
	private bool showErrorText;
	private string errorText;
	private string sectionTitle;
	private string questionTitle;
	private List<RatingTableModel> ratingTables;
	private List<SectionResultModel> sectionResults;
	private List<SectionResultCalculatedModel> calculatedResults;
	private List<ResultModel> results;
	private string resultTitle;

	protected override async Task OnInitializedAsync()
	{
		analysisModel = DataService.PrepareDefaultAnalysisModel();
		ratingTables = DataService.PrepareDefaultRatingTables();
		questionType = null;
		showQuestions = true;
		calculatedResults = new List<SectionResultCalculatedModel>();
		results = new List<ResultModel>();
	}

	private void setQuestionType(QuestionType? type = null)
	{
		questionType = type;
	}

	private void CheckChanged(QuestionModel question, int value)
	{
		foreach (var answ in question.Answers.Where(x => x.Value != value))
		{
			answ.IsChosen = false;
		}
	}

	private void QuestionEdit(QuestionModel model)
	{
		if (!string.IsNullOrEmpty(model.Question) && model.Edit)
			model.Edit = !model.Edit;
		else if(!model.Edit)
			model.Edit = !model.Edit;
	}

	private void AnswerEdit(AnswerModel model)
	{
		if (!string.IsNullOrEmpty(model.Answer) && model.Edit)
			model.Edit = !model.Edit;
		else if(!model.Edit)
			model.Edit = !model.Edit;
	}

	private void RatingEdit(RatingModel model)
	{
		model.Edit = !model.Edit;
	}

	private void AddPoint(List<AnswerModel> answers, AnswerModel answer)
	{
		if (answers.Any(x => x.Value == answer.Value + 1))
		{
			answers.FirstOrDefault(x => x.Value == answer.Value + 1).Value = answer.Value;
			answer.Value = answer.Value + 1;
		}
	}

	private void RemovePoint(List<AnswerModel> answers, AnswerModel answer)
	{
		if (answers.Any(x => x.Value == answer.Value - 1))
		{
			answers.FirstOrDefault(x => x.Value == answer.Value - 1).Value = answer.Value;
			answer.Value = answer.Value - 1;
		}
	}

	private void RemoveAnswer(List<AnswerModel> answers, AnswerModel answer)
	{
		foreach (var ans in answers.Where(x => x.Value > answer.Value))
		{
			ans.Value = ans.Value - 1;
		}
		answers.Remove(answer);
	}

	private void RemoveRating(List<RatingModel> ratings, RatingModel rating)
	{
		ratings.Remove(rating);
	}

	private void AddRating(List<RatingModel> ratings)
	{
		var rating = new RatingModel();
		rating.MinValue = ratings.LastOrDefault().MaxValue;
		rating.MaxValue = 100;
		rating.Edit = true;
		ratings.Add(rating);
	}

	private void RemoveQuestion(List<QuestionModel> questions, QuestionModel question)
	{
		if (questions.Count(x => x.QuestionType == question.QuestionType) < 2)
		{
			question.Question = string.Empty;
			question.Edit = true;
			question.Answers = new List<AnswerModel>();
			return;
		}
		questions.Remove(question);
	}

	private void AddAnswer(List<AnswerModel> answers, int lowestValue)
	{
		var value = 0;
		if (answers.Count == 0)
			value = lowestValue;
		else
			value = answers.Select(x => x.Value).DefaultIfEmpty().Max() + 1;
		var answer = new AnswerModel()
		{
			Value = value,
			Edit = true
		};
		answers.Add(answer);
	}

	private void AddQuestion(List<QuestionModel> questions, QuestionType? questionType = null)
	{
		var lowest = questions.Where(x => x.QuestionType == questionType).Select(x => x.LowestValue).DefaultIfEmpty().Max();
		var question = new QuestionModel()
		{
			QuestionType = questionType,
			Answers = new List<AnswerModel>(),
			Question = string.Empty,
			Edit = true,
			LowestValue = lowest
		};
		questions.Add(question);
	}

	private void ShowQuestions()
	{
		if (CheckRatingTables())
		{
			showErrorText = true;
			errorText = "Tabulky hodnot nejsou vyplněny správně";
			return;
		}
		errorText = string.Empty;
		showErrorText = false;
		showQuestions = true;
		showTables = false;
		showResult = false;
	}
	private void ShowTables()
	{
		if (CheckFilledQuestions())
		{
			showErrorText = true;
			errorText = "V některé z otázek chybí označena odpověď";
			return;
		}
		errorText = string.Empty;
		showErrorText = false;
		showQuestions = false;
		showTables = true;
		showResult = false;
	}
	private void ShowResult()
	{
		if (CheckFilledQuestions())
		{
			showErrorText = true;
			errorText = "V některé z otázek chybí označena odpověď";
			return;
		}
		if (CheckRatingTables())
		{
			showErrorText = true;
			errorText = "Tabulky hodnot nejsou vyplněny správně";
			return;
		}
		errorText = string.Empty;
		showErrorText = false;
		showQuestions = false;
		showTables = false;
		showResult = true;
	}

	private bool CheckFilledQuestions()
	{
		foreach (var section in analysisModel.Sections)
		{
			foreach (var question in section.Questions)
			{
				if (!question.Answers.Any(x => x.IsChosen))
				{
					return true;
				}
			}
		}
		return false;
	}

	private bool CheckRatingTables()
	{
		foreach (var ratingTable in ratingTables)
		{
			var lastMaxValue = 0;
			foreach (var rating in ratingTable.Ratings.OrderBy(x => x.MinValue))
			{
				if (rating.MinValue != lastMaxValue || rating.MaxValue > 100 || rating.MinValue > 100 || rating.MinValue > rating.MaxValue || string.IsNullOrEmpty(rating.Name) || rating.MaxValue == 0 || (lastMaxValue == 0 && rating.MinValue != 0) || rating.MinValue < 0 || rating.MaxValue < 0)
				{
					return true;
				}
				lastMaxValue = rating.MaxValue;
			}
			if (lastMaxValue != 100)
				return true;
		}
		return false;
	}

	private void ResetModel()
	{
		analysisModel = DataService.ClearAnalysisModel();
	}

	private void DefaultModel()
	{
		analysisModel = DataService.PrepareDefaultAnalysisModel();
	}

	private void ShowSection(SectionModel section)
	{
		section.ShowSection = !section.ShowSection;
	}

	private void ShowTable(RatingTableModel model)
	{
		model.ShowTable = !model.ShowTable;
	}

	private void SetSectionTitle(SectionType sectionType)
	{
		sectionTitle = GetSectionName(sectionType);
	}

	private string GetSectionName(SectionType sectionType)
	{
		if (sectionType == SectionType.InternalVulnerabilityCriteria)
			return "Interní kritéria zranitelnosti";
		else if (sectionType == SectionType.ExternalVulnerabilityCriteria)
			return "Externí kritéria zranitelnosti";
		else if (sectionType == SectionType.InternalSecurityCriteria)
			return "Interní kritéria bezpečnosti";
		else if (sectionType == SectionType.ExternalSecurityCriteria)
			return "Externí kritéria bezpečnosti";
		else if (sectionType == SectionType.OrganizationalSecurityAspects)
			return "Organizační aspekty bezpečnosti";
		else if (sectionType == SectionType.RegimeSecurityAspects)
			return "Režimové aspekty bezpečnosti";

		return string.Empty;
	}

	private void SetResultTitle(ResultType resultType)
	{
		if (resultType == ResultType.InternalVulnerabilityResult)
			resultTitle = "Hodnocení interní zranitelnosti";
		else if (resultType == ResultType.ExternalVulnerabilityResult)
			resultTitle = "Hodnocení externí zranitelnosti";
		else if (resultType == ResultType.VulnerabilityResult)
			resultTitle = "Hodnocení zranitelnosti";
		else if (resultType == ResultType.InternalSecurityResult)
			resultTitle = "Hodnocení interní bezpečnosti";
		else if (resultType == ResultType.ExternalSecurityResult)
			resultTitle = "Hodnocení externí bezpečnosti";
		else if (resultType == ResultType.OrganizationalRegimeResult)
			resultTitle = "Režimové a organizační aspekty bezpečnosti";
		else if (resultType == ResultType.SecurityResult)
			resultTitle = "Hodnocení bezpečnosti";
	}

	private void SetQuestionTitle(QuestionType? questionType)
	{
		questionTitle = GetQuestionName(questionType);
	}

	private string GetQuestionName(QuestionType? questionType)
	{
		if (questionType == QuestionType.ISpatialAspects || questionType == QuestionType.ESpatialAspects)
			return "Prostorové aspekty";
		else if (questionType == QuestionType.ITimeAspects || questionType == QuestionType.ETimeAspects)
			return "Časové aspekty";
		else if (questionType == QuestionType.IConcentrationPeople || questionType == QuestionType.EConcentrationPeople)
			return "Koncentrace a počet osob";
		else if (questionType == QuestionType.IStructuralMechanicalAspects || questionType == QuestionType.EStructuralMechanicalAspects)
			return "Strukturální a mechanické aspekty";
		else if (questionType == QuestionType.ITechnologicalProcessAspects || questionType == QuestionType.ETechnologicalProcessAspects)
			return "Technologické a procesní aspekty";
		else
			return string.Empty;
	}

	private int EditRatingValue(string value, List<RatingModel> ratings, bool isMinCheck, RatingModel rating)
	{
		var count = ratings.IndexOf(rating);

		var totalCount = ratings.Count;
		var intValue = Convert.ToInt32(value) < 0 ? 0 : Convert.ToInt32(value);
		ratings.FirstOrDefault().MinValue = 0;
		ratings.LastOrDefault().MaxValue = 100;
		if (isMinCheck && count != 0 && count < totalCount)
		{
			if (count < totalCount - 1 && intValue < ratings[count - 1].MaxValue)
			{
				intValue = ratings[count - 1].MaxValue;
			}
			else if (count == totalCount - 1 && isMinCheck && intValue > 99)
			{
				rating.MinValue = 99;
			}
			ratings[count].MinValue = intValue;
		}
		return intValue;
	}

	private void Calculate()
	{
		sectionResults = new List<SectionResultModel>();

		foreach (var section in analysisModel.Sections.OrderBy(x => x.SectionType))
		{
			var groupedQuestions = section.Questions.GroupBy(x => x.QuestionType);
			foreach (var groupedQuestion in groupedQuestions)
			{
				var value = groupedQuestion.Sum(x => x.Value);
				var maxValue = groupedQuestion.Sum(x => x.MaxValue);
				sectionResults.Add(new SectionResultModel()
				{
					Name = GetQuestionName(groupedQuestion.Key),
					Value = value,
					MaxValue = maxValue,
					QuestionType = groupedQuestion.Key,
					Result = (decimal)value / maxValue,
					SectionType = section.SectionType
				});
			}
		}
	}
	private ResultType GetResultType(SectionType sectionType)
	{
		switch (sectionType)
		{
			case SectionType.InternalVulnerabilityCriteria:
				return ResultType.InternalVulnerabilityResult;
			case SectionType.ExternalSecurityCriteria:
				return ResultType.ExternalSecurityResult;
			case SectionType.ExternalVulnerabilityCriteria:
				return ResultType.ExternalVulnerabilityResult;
			case SectionType.InternalSecurityCriteria:
				return ResultType.InternalSecurityResult;
			case SectionType.RegimeSecurityAspects:
				return ResultType.OrganizationalRegimeResult;
			case SectionType.OrganizationalSecurityAspects:
				return ResultType.OrganizationalRegimeResult;
			default:
				return ResultType.InternalVulnerabilityResult;
		}
	}

	async Task DownloadText()
	{
		var analysisModelDTO = new AnalysisModelDTO();

		analysisModelDTO.CalculatedResults = calculatedResults;
		analysisModelDTO.RatingTables = ratingTables;
		analysisModelDTO.Results = results;
		analysisModelDTO.SectionResults = sectionResults;
		analysisModelDTO.AnalysisModel = analysisModel;

		string jsonString = JsonSerializer.Serialize(analysisModelDTO);
		await JSRuntime.InvokeAsync<object>("DownloadFile", "analysis.txt", jsonString);
	}

	async Task UploadFile(IFileListEntry[] files)
	{
		var file = files.FirstOrDefault();
		showErrorText = false;
		errorText = string.Empty;
		showResult = false;
		showTables = false;
		showQuestions = true;
		if (file != null)
		{
			using (var reader = new System.IO.StreamReader(file.Data))
			{
				var content = await reader.ReadToEndAsync();
				try
				{
					var model = JsonSerializer.Deserialize<AnalysisModelDTO>(content);
					analysisModel = model.AnalysisModel;
					calculatedResults = model.CalculatedResults;
					ratingTables = model.RatingTables;
					results = model.Results;
					sectionResults = model.SectionResults;
				}
				catch (Exception)
				{
					return;
				}
			}
		}
	}

#line default
#line hidden
#nullable disable
        [global::Microsoft.AspNetCore.Components.InjectAttribute] private IJSRuntime JSRuntime { get; set; }
        [global::Microsoft.AspNetCore.Components.InjectAttribute] private HttpClient Http { get; set; }
    }
}
#pragma warning restore 1591
