
using Microsoft.AspNetCore.Components.Web;
using Microsoft.AspNetCore.Components.WebAssembly.Hosting;
using Panel;
using Services;
using Blazored.LocalStorage;
using System.Globalization;
using AbrBlazorTools;
using CurrieTechnologies.Razor.SweetAlert2;
using Panel.ApiUtils;


var builder = WebAssemblyHostBuilder.CreateDefault(args);
builder.RootComponents.Add<App>("#app");
builder.RootComponents.Add<HeadOutlet>("head::after");
builder.Services.AddBlazoredLocalStorage(config => config.JsonSerializerOptions.WriteIndented = true);
builder.Services.AddScoped<ISwalUtils, SwalUtils>();
builder.Services.AddSweetAlert2();
builder.Services.AddScoped(sp => new HttpClient { BaseAddress = new Uri(builder.HostEnvironment.BaseAddress) });
builder.Services.AddBlazorBootstrap();

builder.Services.AddScoped<ILoadingSpinner, LoadingSpinner>();
builder.Services.AddScoped<IHttpClientWithLoginToken, HttpClientWithLoginToken>();
builder.Services.AddScoped<IBrowserTools, BrowserTools>();
builder.Services.AddScoped<IUserUtils, UserUtils>();

#region Api
builder.Services.AddScoped<IPlantsUtils, PlantsUtils>();
#endregion

await builder.Build().RunAsync();
