using BlazorGeolocation; using cwebplusApp; using cwebplusApp.Shared; using cwebplusApp.Shared.Services; using FisSst.BlazorMaps.DependencyInjection; using MatBlazor; using Microsoft.AspNetCore.Components.WebAssembly.Hosting; using Microsoft.Extensions.DependencyInjection; using System; using System.Collections.Generic; using System.Net.Http; using System.Threading.Tasks; using TG.Blazor.IndexedDB; namespace CaritasPWA { public class Program { public static async Task Main(string[] args) { var builder = WebAssemblyHostBuilder.CreateDefault(args); builder.RootComponents.Add("app"); builder.Services.AddMatBlazor(); builder.Services.AddScoped(sp => new HttpClient { BaseAddress = new Uri(builder.HostEnvironment.BaseAddress) }); builder.Services.AddScoped(); builder.Services.AddSingleton(); builder.Services.AddSingleton(); builder.Services.AddSingleton(); builder.Services.AddSingleton(); builder.Services.AddSingleton(); builder.Services.AddSingleton(); builder.Services.AddSingleton(); builder.Services.AddScoped(); builder.Services.AddScoped(); builder.Services.AddScoped(); builder.Services.AddScoped(); builder.Services.AddScoped(); builder.Services.AddLocalization(); builder.Services.AddBlazorLeafletMaps(); builder.Services.AddMatToaster(config => { config.Position = MatToastPosition.BottomCenter; config.PreventDuplicates = true; config.NewestOnTop = true; config.MaxDisplayedToasts = 5; config.ShowCloseButton = true; config.ShowProgressBar = true; config.MaximumOpacity = 100; config.VisibleStateDuration = 10000; config.ShowTransitionDuration = 300; config.HideTransitionDuration = 150; }); builder.Services.AddIndexedDB(dbStore => { dbStore.DbName = "CwebPlusAppDB"; dbStore.Version = 1; dbStore.Stores.Add(new StoreSchema { Name = "FoundReportRepositoryItems", PrimaryKey = new IndexSpec { Name = "id", KeyPath = "id", Auto = true }, Indexes = new List { new IndexSpec{Name="serverRefNbr", KeyPath = "serverRefNbr", Auto=false}, new IndexSpec{Name="status", KeyPath = "status", Auto=false} } }); dbStore.Stores.Add(new StoreSchema { Name = "MissingReportRepositoryItems", PrimaryKey = new IndexSpec { Name = "id", KeyPath = "id", Auto = true }, Indexes = new List { new IndexSpec{Name="serverRefNbr", KeyPath = "serverRefNbr", Auto=false}, new IndexSpec{Name="status", KeyPath = "status", Auto=false} } }); }); await builder.Build().RunAsync(); } } }