@attribute [Route(Routes.ABOUT)]
@using AIStudio.Tools.PluginSystem
@using AIStudio.Tools.Services
@inherits MSGComponentBase

<div class="inner-scrolling-context">
    <MudText Typo="Typo.h3" Class="mb-2">
        @T("Information about MindWork AI Studio")
    </MudText>

    <InnerScrolling>
        <MudExpansionPanels Class="mb-3" MultiExpansion="@false">
            <ExpansionPanel HeaderIcon="@Icons.Material.Filled.Layers" HeaderText="@T("Versions")" IsExpanded="@true">
                <MudText>
                    @T("The following list shows the versions of the MindWork AI Studio, the used compilers, build time, etc.:")
                </MudText>
                <MudList T="string" Class="mb-3">
                    <MudListItem T="string" Icon="@Icons.Material.Outlined.Chat" Text="@VersionApp"/>
                    <MudListItem T="string" Icon="@Icons.Material.Outlined.Timer" Text="@this.BuildTime"/>
                    <MudListItem T="string" Icon="@Icons.Material.Outlined.Build" Text="@this.VersionDotnetSdk"/>
                    <MudListItem T="string" Icon="@Icons.Material.Outlined.Memory" Text="@this.VersionDotnetRuntime"/>
                    <MudListItem T="string" Icon="@Icons.Material.Outlined.Build" Text="@this.VersionRust"/>
                    <MudListItem T="string" Icon="@Icons.Material.Outlined.Storage">
                        <MudText Typo="Typo.body1">
                            @this.VersionVectorStore
                        </MudText>
                        <MudCollapse Expanded="@this.showVectorStoreDetails">
                            <MudText Typo="Typo.body1" Class="mt-2 mb-2">
                                @foreach (var item in this.vectorStoreDisplayInfo)
                                {
                                    <div style="display: flex; align-items: center; gap: 8px;">
                                        <MudIcon Icon="@Icons.Material.Filled.ArrowRightAlt"/>
                                        <span>@item.Label: @item.Value</span>
                                        <MudCopyClipboardButton TooltipMessage="@(T("Copies the following to the clipboard")+": "+item.Value)" StringContent=@item.Value/>
                                    </div>
                                }
                            </MudText>
                        </MudCollapse>
                        <MudButton StartIcon="@(this.showVectorStoreDetails ? Icons.Material.Filled.ExpandLess : Icons.Material.Filled.ExpandMore)"
                                   Size="Size.Small"
                                   Variant="Variant.Text"
                                   OnClick="@this.ToggleVectorStoreDetails">
                            @(this.showVectorStoreDetails ? T("Hide Details") : T("Show Details"))
                        </MudButton>
                    </MudListItem>
                    <MudListItem T="string" Icon="@Icons.Material.Outlined.DocumentScanner" Text="@this.VersionPdfium"/>
                    <MudListItem T="string" Icon="@Icons.Material.Outlined.Article" Text="@this.versionPandoc"/>
                    <MudListItem T="string" Icon="@Icons.Material.Outlined.Widgets" Text="@MudBlazorVersion"/>
                    <MudListItem T="string" Icon="@Icons.Material.Outlined.Memory" Text="@TauriVersion"/>
                    <MudListItem T="string" Icon="@Icons.Material.Outlined.Translate" Text="@this.OSLanguage"/>
                    <MudListItem T="string" Icon="@Icons.Material.Outlined.AccountCircle" Text="@this.OSUserName"/>
                    <MudListItem T="string" Icon="@Icons.Material.Outlined.Folder">
                        <div style="display: flex; align-items: center; gap: 8px;">
                            <MudText Typo="Typo.body1">
                                @this.WorkingDirectory
                            </MudText>
                            <MudCopyClipboardButton TooltipMessage="@(T("Copies the working directory to the clipboard"))" StringContent="@this.RuntimeInfo.WorkingDirectory"/>
                        </div>
                    </MudListItem>
                    <MudListItem T="string" Icon="@Icons.Material.Filled.InsertDriveFile">
                        <div style="display: flex; align-items: center; gap: 8px;">
                            <MudText Typo="Typo.body1">
                                @this.ExecutablePath
                            </MudText>
                            <MudCopyClipboardButton TooltipMessage="@(T("Copies the executable path to the clipboard"))" StringContent="@this.RuntimeInfo.ExecutablePath"/>
                        </div>
                    </MudListItem>
                    @if (OperatingSystem.IsLinux())
                    {
                        <MudListItem T="string" Icon="@Icons.Material.Outlined.Storage" Text="@this.LinuxPackageType"/>
                    }
                    <MudListItem T="string" Icon="@Icons.Material.Outlined.Business">
                        @switch (HasAnyActiveEnvironment)
                        {
                            case false when this.configPlugins.Count == 0:
                                <MudText Typo="Typo.body1">
                                    @T("This is a private AI Studio installation. It runs without an enterprise configuration.")
                                </MudText>
                                break;

                            case false:
                                <MudText Typo="Typo.body1">
                                    @T("AI Studio runs with an enterprise configuration using configuration plugins, without central configuration management.")
                                </MudText>
                                <MudCollapse Expanded="@this.showEnterpriseConfigDetails">
                                    @foreach (var plug in this.configPlugins)
                                    {
                                        <ConfigPluginInfoCard HeaderIcon="@Icons.Material.Filled.Extension"
                                                              HeaderText="@plug.Name"
                                                              Items="@([
                                                                         new ConfigInfoRowItem(Icons.Material.Filled.ArrowRightAlt,
                                                                             $"{T("Configuration plugin ID:")} {plug.Id}",
                                                                             plug.Id.ToString(),
                                                                             T("Copies the configuration plugin ID to the clipboard"))
                                                                     ])"/>
                                    }
                                    
                                    <EncryptionSecretInfo IsConfigured="@(PluginFactory.EnterpriseEncryption?.IsAvailable is true)"
                                                          ConfiguredText="@T("Encryption secret: is configured")"
                                                          NotConfiguredText="@T("Encryption secret: is not configured")"/>
                                </MudCollapse>
                                break;

                            case true when this.configPlugins.Count == 0:
                                <MudText Typo="Typo.body1">
                                    @T("AI Studio runs with an enterprise configuration and configuration servers. The configuration plugins are not yet available.")
                                </MudText>
                                <MudCollapse Expanded="@this.showEnterpriseConfigDetails">
                                    @foreach (var env in this.enterpriseEnvironments.Where(e => e.IsActive))
                                    {
                                        <ConfigPluginInfoCard HeaderIcon="@Icons.Material.Filled.HourglassBottom"
                                                              HeaderText="@T("Waiting for the configuration plugin...")"
                                                              Items="@this.BuildEnterpriseConfigurationItems(env)"/>
                                    }
                                    
                                    <EncryptionSecretInfo IsConfigured="@(PluginFactory.EnterpriseEncryption?.IsAvailable is true)"
                                                          ConfiguredText="@T("Encryption secret: is configured")"
                                                          NotConfiguredText="@T("Encryption secret: is not configured")"/>
                                </MudCollapse>
                                break;

                            case true:
                                @if (this.HasAnyLoadedEnterpriseConfigurationPlugin)
                                {
                                    <MudText Typo="Typo.body1">
                                        @T("AI Studio runs with an enterprise configuration and configuration servers. The configuration plugins are active.")
                                    </MudText>
                                }
                                else
                                {
                                    <MudText Typo="Typo.body1">
                                        @T("AI Studio runs with an enterprise configuration and configuration servers. The configuration plugins are not yet available.")
                                    </MudText>
                                }
                                <MudCollapse Expanded="@this.showEnterpriseConfigDetails">
                                    @foreach (var env in this.enterpriseEnvironments.Where(e => e.IsActive))
                                    {
                                        var matchingPlugin = this.FindManagedConfigurationPlugin(env.ConfigurationId);
                                        if (matchingPlugin is null)
                                        {
                                            <ConfigPluginInfoCard HeaderIcon="@Icons.Material.Filled.HourglassBottom"
                                                                  HeaderText="@T("Waiting for the configuration plugin...")"
                                                                  Items="@this.BuildEnterpriseConfigurationItems(env)"/>
                                            continue;
                                        }
                                        
                                        <ConfigPluginInfoCard HeaderIcon="@Icons.Material.Filled.Extension"
                                                              HeaderText="@matchingPlugin.Name"
                                                              Items="@this.BuildEnterpriseConfigurationItems(env, matchingPlugin)"
                                                              ShowWarning="@this.IsManagedConfigurationIdMismatch(matchingPlugin, env.ConfigurationId)"
                                                              WarningText="@T("ID mismatch: the plugin ID differs from the enterprise configuration ID.")"/>
                                    }
                                    
                                    <EncryptionSecretInfo IsConfigured="@(PluginFactory.EnterpriseEncryption?.IsAvailable is true)"
                                                          ConfiguredText="@T("Encryption secret: is configured")"
                                                          NotConfiguredText="@T("Encryption secret: is not configured")"/>
                                </MudCollapse>
                                break;
                        }

                        @if (this.HasEnterpriseConfigurationDetails)
                        {
                            <MudButton StartIcon="@(this.showEnterpriseConfigDetails ? Icons.Material.Filled.ExpandLess : Icons.Material.Filled.ExpandMore)"
                                       Size="Size.Small"
                                       Variant="Variant.Text"
                                       OnClick="@this.ToggleEnterpriseConfigDetails">
                                @(this.showEnterpriseConfigDetails ? T("Hide Details") : T("Show Details"))
                            </MudButton>
                        }
                    </MudListItem>
                    @if (ExternalHttpClientTimeout.CustomRootCertificateState.IsEnabled)
                    {
                        <MudListItem T="string" Icon="@Icons.Material.Outlined.Security">
                            <MudText Typo="Typo.body1">
                                @(ExternalHttpClientTimeout.CustomRootCertificateState.IsUsable
                                    ? T("External HTTPS custom root certificates are active.")
                                    : T("External HTTPS custom root certificates are configured but not active."))
                            </MudText>
                            <MudCollapse Expanded="@this.showExternalHttpCustomRootCertificateDetails">
                                <ConfigPluginInfoCard HeaderIcon="@Icons.Material.Filled.Security"
                                                      HeaderText="@T("External HTTPS custom root certificates")"
                                                      Items="@this.BuildExternalHttpCustomRootCertificateItems()"
                                                      ShowWarning="@(!ExternalHttpClientTimeout.CustomRootCertificateState.IsUsable)"
                                                      WarningText="@this.ExternalHttpCustomRootCertificateWarningText"/>
                            </MudCollapse>
                            <MudButton StartIcon="@(this.showExternalHttpCustomRootCertificateDetails ? Icons.Material.Filled.ExpandLess : Icons.Material.Filled.ExpandMore)"
                                       Size="Size.Small"
                                       Variant="Variant.Text"
                                       OnClick="@this.ToggleExternalHttpCustomRootCertificateDetails">
                                @(this.showExternalHttpCustomRootCertificateDetails ? T("Hide Details") : T("Show Details"))
                            </MudButton>
                        </MudListItem>
                    }
                </MudList>
                <MudStack Row="true">
                    <MudButton Variant="Variant.Filled" Color="Color.Info" StartIcon="@Icons.Material.Filled.Update" OnClick="@this.CheckForUpdate">
                        @(this.updatePolicyMode is UpdatePolicyMode.SELF_UPDATE ? T("Check for updates") : T("How to update"))
                    </MudButton>
                    <MudButton Variant="Variant.Filled" Color="Color.Default" StartIcon="@Icons.Material.Filled.Download" OnClick="@(async () => await this.ShowPandocDialog())">
                        @this.PandocButtonText
                    </MudButton>
                </MudStack>
            </ExpansionPanel>

            <ExpansionPanel HeaderIcon="@Icons.Custom.Brands.GitHub" HeaderText="@T("Community & Code")">
                <MudList T="string" Class="mb-1">
                    <MudListItem T="string" Icon="@Icons.Material.Outlined.Home" Target="_blank" Href="https://mindworkai.org/">
                        @T("Discover MindWork AI's mission and vision on our official homepage.")
                    </MudListItem>
                    <MudListItem T="string" Icon="@Icons.Custom.Brands.GitHub" Target="_blank" Href="https://github.com/MindWorkAI/AI-Studio">
                        @T("Browse AI Studio's source code on GitHub — we welcome your contributions.")
                    </MudListItem>
                    <MudListItem T="string" Icon="@Icons.Material.Outlined.PrivateConnectivity" Target="_blank" Href="https://github.com/MindWorkAI/ERI">
                        @T("Connect AI Studio to your organization's data with our External Retrieval Interface (ERI).")
                    </MudListItem>
                    <MudListItem T="string" Icon="@Icons.Material.Outlined.Timeline" Target="_blank" Href="https://github.com/orgs/MindWorkAI/projects/2/views/3">
                        @T("View our project roadmap and help shape AI Studio's future development.")
                    </MudListItem>
                    <MudListItem T="string" Icon="@Icons.Material.Outlined.BugReport" Target="_blank" Href="https://github.com/MindWorkAI/AI-Studio/issues">
                        @T("Did you find a bug or are you experiencing issues? Report your concern here.")
                    </MudListItem>
                    <MudListItem T="string" Icon="@Icons.Material.Outlined.Lightbulb" Target="_blank" Href="https://github.com/MindWorkAI/Planning/issues">
                        @T("Have feature ideas? Submit suggestions for future AI Studio enhancements.")
                    </MudListItem>
                </MudList>
            </ExpansionPanel>
            
            <ExpansionPanel HeaderIcon="@Icons.Material.Filled.EventNote" HeaderText="@T("Changelog")">
                <Changelog/>
            </ExpansionPanel>

            @foreach (var mandatoryInfoPanel in this.mandatoryInfoPanels)
            {
                <ExpansionPanel HeaderIcon="@Icons.Material.Filled.Gavel" HeaderText="@mandatoryInfoPanel.HeaderText">
                    <MudText Typo="Typo.body2" Class="mb-3">
                        @string.Format(T("Provided by configuration plugin: {0}"), mandatoryInfoPanel.PluginName)
                    </MudText>
                    <MandatoryInfoDisplay Info="@mandatoryInfoPanel.Info"
                                          Acceptance="@mandatoryInfoPanel.Acceptance"
                                          ShowAcceptanceMetadata="@true"/>
                </ExpansionPanel>
            }
            
            <ExpansionPanel HeaderIcon="@Icons.Material.Filled.Book" HeaderText="@T("Logbook")">
                <MudText Typo="Typo.h4">
                    @T("Explanation")
                </MudText>
                <MudJustifiedText Class="mb-3" Typo="Typo.body1">
                    @T("AI Studio creates a log file at startup, in which events during startup are recorded. After startup, another log file is created that records all events that occur during the use of the app. This includes any errors that may occur. Depending on when an error occurs (at startup or during use), the contents of these log files can be helpful for troubleshooting. Sensitive information such as passwords is not included in the log files.")
                </MudJustifiedText>
                
                <MudJustifiedText Class="mb-3" Typo="Typo.body1">
                    @T("By clicking on the respective path, the path is copied to the clipboard. You might open these files with a text editor to view their contents.")
                </MudJustifiedText>
                
                <MudText Typo="Typo.h4">
                    @T("Startup log file")
                </MudText>
                <MudList T="string" Class="mb-3">
                    <MudListItem T="string" Icon="@Icons.Material.Outlined.Folder" Text="@this.logPaths.LogStartupPath" OnClick="@(() => this.CopyStartupLogPath())"/>
                </MudList>
                
                <MudText Typo="Typo.h4">
                    @T("Usage log file")
                </MudText>
                <MudList T="string" Class="mb-3">
                    <MudListItem T="string" Icon="@Icons.Material.Outlined.Folder" Text="@this.logPaths.LogAppPath" OnClick="@(() => this.CopyAppLogPath())"/>
                </MudList>
            </ExpansionPanel>

            <ExpansionPanel HeaderIcon="@Icons.Material.Filled.Engineering" HeaderText="@T("Motivation")">
                <Motivation/>
            </ExpansionPanel>

            <ExpansionPanel HeaderIcon="@Icons.Material.Filled.Lightbulb" HeaderText="@T("Vision")">
                <Vision/>
            </ExpansionPanel>
            
            <ExpansionPanel HeaderIcon="@Icons.Material.Filled.AutoAwesomeMotion" HeaderText="@T("Used Open Source Projects")">
                <MudGrid Spacing="1">
                    <ThirdPartyComponent Name=".NET" Developer="Microsoft & Open Source Community" LicenseName="MIT" LicenseUrl="https://github.com/dotnet/runtime/blob/main/LICENSE.TXT" RepositoryUrl="https://github.com/dotnet" UseCase="@T("The C# language is used for the implementation of the user interface and the backend. To implement the user interface with C#, the Blazor technology from ASP.NET Core is used. All these technologies are integrated into the .NET SDK.")"/>
                    <ThirdPartyComponent Name="MudBlazor" Developer="Jonny Larsson, Meinrad Recheis & Open Source Community" LicenseName="MIT" LicenseUrl="https://github.com/MudBlazor/MudBlazor/blob/dev/LICENSE" RepositoryUrl="https://github.com/MudBlazor/MudBlazor/" UseCase="@T("Building on .NET, ASP.NET Core, and Blazor, MudBlazor is used as a library for designing and developing the user interface. It is a great project that significantly accelerates the development of advanced user interfaces with Blazor.")"/>
                    <ThirdPartyComponent Name="MudBlazor.Markdown" Developer="My Nihongo & Open Source Community" LicenseName="MIT" LicenseUrl="https://github.com/MyNihongo/MudBlazor.Markdown/blob/main/LICENSE" RepositoryUrl="https://github.com/MyNihongo/MudBlazor.Markdown" UseCase="@T("This component is used to render Markdown text. This is important because the LLM often responds with Markdown-formatted text, allowing us to present it in a way that is easier to read.")"/>
                    <ThirdPartyComponent Name="CodeBeam.MudBlazor.Extensions" Developer="Mehmet Can Karagöz & Open Source Community" LicenseName="MIT" LicenseUrl="https://github.com/CodeBeamOrg/CodeBeam.MudBlazor.Extensions/blob/dev/LICENSE" RepositoryUrl="https://github.com/CodeBeamOrg/CodeBeam.MudBlazor.Extensions" UseCase="@T("This library is used to extend the MudBlazor library. It provides additional components that are not part of the MudBlazor library.")"/>
                    <ThirdPartyComponent Name="Rust" Developer="Graydon Hoare, Rust Foundation, Rust developers & Open Source Community" LicenseName="MIT" LicenseUrl="https://github.com/rust-lang/rust/blob/master/LICENSE-MIT" RepositoryUrl="https://github.com/rust-lang/rust" UseCase="@T("The .NET backend cannot be started as a desktop app. Therefore, I use a second backend in Rust, which I call runtime. With Rust as the runtime, Tauri can be used to realize a typical desktop app. Thanks to Rust, this app can be offered for Windows, macOS, and Linux desktops. Rust is a great language for developing safe and high-performance software.")"/>
                    <ThirdPartyComponent Name="Tauri" Developer="Daniel Thompson-Yvetot, Lucas Nogueira, Tensor, Boscop, Serge Zaitsev, George Burton & Open Source Community" LicenseName="MIT" LicenseUrl="https://github.com/tauri-apps/tauri/blob/dev/LICENSE_MIT" RepositoryUrl="https://github.com/tauri-apps/tauri" UseCase="@T("Tauri is used to host the Blazor user interface. It is a great project that allows the creation of desktop applications using web technologies. I love Tauri!")"/>
                    <ThirdPartyComponent Name="Apache ECharts" Developer="Yi Shen, 100pah, Ovilia, kener, Apache Software Foundation & Open Source Community" LicenseName="Apache-2.0" LicenseUrl="https://github.com/apache/echarts/blob/master/LICENSE" RepositoryUrl="https://github.com/apache/echarts" UseCase="@T("Apache ECharts is embedded only in exported visual briefings that use supported data-driven charts.")"/>
                    <ThirdPartyComponent Name="image-rs" Developer="Aurelia Molzer, Jonathan Behrens, nwin, Sergey Davidoff, Michael Schmidt, Johannes Vollmer, Sven Nilsen, Sergio Gonzalez-Martin, Radzivon Bartoshyk, Philippe Solodov, ccgn, nabijaczleweli & Open Source Community" LicenseName="MIT" LicenseUrl="https://github.com/image-rs/image/blob/main/LICENSE-MIT" RepositoryUrl="https://github.com/image-rs/image" UseCase="@T("The image crate decodes and optimizes PNG, JPEG, and WebP visual assets locally before they are analyzed and embedded in visual briefings.")"/>
                    
                    @if (OperatingSystem.IsLinux())
                    {
                        <ThirdPartyComponent Name="GStreamer" Developer="GStreamer contributors & Open Source Community" LicenseName="LGPL-2.1" LicenseUrl="https://gstreamer.freedesktop.org/documentation/frequently-asked-questions/licensing.html" RepositoryUrl="https://gitlab.freedesktop.org/gstreamer/gstreamer" UseCase="@T("Linux AppImages bundle GStreamer components to support microphone access and WebM audio recording in the embedded WebKitGTK web view.")"/>
                        <ThirdPartyComponent Name="ashpd" Developer="Bilal Elmoussaoui & Open Source Community" LicenseName="MIT" LicenseUrl="https://github.com/bilelmoussaoui/ashpd/blob/main/LICENSE" RepositoryUrl="https://github.com/bilelmoussaoui/ashpd" UseCase="@T("On Linux, ashpd provides access to desktop portals, allowing AI Studio to open folders and files for the user.")"/>
                    }
                    
                    <ThirdPartyComponent Name="Qdrant Edge" Developer="Andrey Vasnetsov, Tim Visée, Arnaud Gourlay, Luis Cossío, Ivan Pleshkov, Roman Titov, xzfc, JojiiOfficial & Open Source Community" LicenseName="Apache-2.0" LicenseUrl="https://github.com/qdrant/qdrant/blob/master/LICENSE" RepositoryUrl="https://github.com/qdrant/qdrant" UseCase="@T("Qdrant Edge is an embedded vector database and vector similarity search engine. We use it to realize local RAG—retrieval-augmented generation—within AI Studio. Thanks for the effort and great work that has been and is being put into Qdrant.")"/>
                    <ThirdPartyComponent Name="axum" Developer="David Pedersen, Jonas Platte, tottoto, David Mládek, Yann Simon, Tobias Bieniek, Open Source Community & Tokio Project" LicenseName="MIT" LicenseUrl="https://github.com/tokio-rs/axum/blob/main/LICENSE" RepositoryUrl="https://github.com/tokio-rs/axum" UseCase="@T("Axum is used to provide the small internal service that connects the Rust runtime with the app's user interface. This lets both parts of AI Studio exchange information while the app is running.")"/>
                    <ThirdPartyComponent Name="axum-server" Developer="Eray Karatay, Adi Salimgereyev, daxpedda & Open Source Community" LicenseName="MIT" LicenseUrl="https://github.com/programatik29/axum-server/blob/master/LICENSE" RepositoryUrl="https://github.com/programatik29/axum-server" UseCase="@T("Axum server runs the internal axum service over a secure local connection. This helps AI Studio protect the communication between the Rust runtime and the user interface.")"/>
                    <ThirdPartyComponent Name="Rustls" Developer="Joe Birr-Pixton, Dirkjan Ochtman, Daniel McCarney, Brian Smith, Jacob Hoffman-Andrews, Jorge Aparicio & Open Source Community" LicenseName="MIT" LicenseUrl="https://github.com/rustls/rustls/blob/main/LICENSE-MIT" RepositoryUrl="https://github.com/rustls/rustls" UseCase="@T("Rustls helps secure the internal connection between the app's user interface and the Rust runtime. This protects the local communication that AI Studio needs while it is running.")"/>
                    <ThirdPartyComponent Name="serde" Developer="Erick Tryzelaar, David Tolnay & Open Source Community" LicenseName="MIT" LicenseUrl="https://github.com/serde-rs/serde/blob/master/LICENSE-MIT" RepositoryUrl="https://github.com/serde-rs/serde" UseCase="@T("Now we have multiple systems, some developed in .NET and others in Rust. The data format JSON is responsible for translating data between both worlds (called data serialization and deserialization). Serde takes on this task in the Rust world. The counterpart in the .NET world is an integral part of .NET and is located in System.Text.Json.")"/>
                    <ThirdPartyComponent Name="strum_macros" Developer="Peter Glotfelty & Open Source Community" LicenseName="MIT" LicenseUrl="https://github.com/Peternator7/strum/blob/master/LICENSE" RepositoryUrl="https://github.com/Peternator7/strum" UseCase="@T("This crate provides derive macros for Rust enums, which we use to reduce boilerplate when implementing string conversions and metadata for runtime types. This is helpful for the communication between our Rust and .NET systems.")"/>
                    <ThirdPartyComponent Name="keyring-core" Developer="Daniel Brotsky & Open Source Community" LicenseName="MIT" LicenseUrl="https://github.com/open-source-cooperative/keyring-core/blob/main/LICENSE-MIT" RepositoryUrl="https://github.com/open-source-cooperative/keyring-core" UseCase="@T("AI Studio stores secrets like API keys in your operating system’s secure credential store. The keyring-core library handles this by connecting to macOS Keychain, Windows Credential Manager, and Linux Secret Service.")"/>
                    <ThirdPartyComponent Name="dbus-secret-service" Developer="Daniel Brotsky, Walther Chen, ComplexSpaces, Rasmus Thomsen & Open Source Community" LicenseName="MIT" LicenseUrl="https://github.com/open-source-cooperative/dbus-secret-service/blob/main/LICENSE-MIT" RepositoryUrl="https://github.com/open-source-cooperative/dbus-secret-service" UseCase="@T("On Linux, this library communicates with the FreeDesktop Secret Service. AI Studio uses its structured errors to provide helpful guidance when secure credential storage is unavailable or not configured correctly.")"/>
                    <ThirdPartyComponent Name="arboard" Developer="Artur Kovacs, Avi Weinstock, 1Password & Open Source Community" LicenseName="MIT" LicenseUrl="https://github.com/1Password/arboard/blob/master/LICENSE-MIT.txt" RepositoryUrl="https://github.com/1Password/arboard" UseCase="@T("To be able to use the responses of the LLM in other apps, we often use the clipboard of the respective operating system. Unfortunately, in .NET there is no solution that works with all operating systems. Therefore, I have opted for this library in Rust. This way, data transfer to other apps works on every system.")"/>
                    <ThirdPartyComponent Name="tokio" Developer="Alex Crichton, Carl Lerche, Alice Ryhl, Taiki Endo, Ivan Petkov, Eliza Weisman, Lucio Franco & Open Source Community" LicenseName="MIT" LicenseUrl="https://github.com/tokio-rs/tokio/blob/master/LICENSE" RepositoryUrl="https://github.com/tokio-rs/tokio" UseCase="@T("Code in the Rust language can be specified as synchronous or asynchronous. Unlike .NET and the C# language, Rust cannot execute asynchronous code by itself. Rust requires support in the form of an executor for this. Tokio is one such executor.")"/>
                    <ThirdPartyComponent Name="futures" Developer="Alex Crichton, Taiki Endo, Taylor Cramer, Nemo157, Josef Brandl, Aaron Turon & Open Source Community" LicenseName="MIT" LicenseUrl="https://github.com/rust-lang/futures-rs/blob/master/LICENSE-MIT" RepositoryUrl="https://github.com/rust-lang/futures-rs" UseCase="@T("This is a library providing the foundations for asynchronous programming in Rust. It includes key trait definitions like Stream, as well as utilities like join!, select!, and various futures combinator methods which enable expressive asynchronous control flow.")"/>
                    <ThirdPartyComponent Name="async-stream" Developer="Carl Lerche, Taiki Endo & Open Source Community" LicenseName="MIT" LicenseUrl="https://github.com/tokio-rs/async-stream/blob/master/LICENSE" RepositoryUrl="https://github.com/tokio-rs/async-stream" UseCase="@T("This library is used to create asynchronous streams in Rust. It allows us to work with streams of data that can be produced asynchronously, making it easier to handle events or data that arrive over time. We use this, e.g., to stream arbitrary data from the file system to the embedding system.")"/>
                    <ThirdPartyComponent Name="flexi_logger" Developer="emabee & Open Source Community" LicenseName="MIT" LicenseUrl="https://github.com/emabee/flexi_logger/blob/master/LICENSE-MIT" RepositoryUrl="https://github.com/emabee/flexi_logger" UseCase="@T("This Rust library is used to output the app's messages to the terminal. This is helpful during development and troubleshooting. This feature is initially invisible; when the app is started via the terminal, the messages become visible.")"/>
                    <ThirdPartyComponent Name="dirs" Developer="soc, Wang Xuerui & Open Source Community" LicenseName="MIT" LicenseUrl="https://codeberg.org/dirs/dirs-rs/src/branch/main/LICENSE-MIT" RepositoryUrl="https://codeberg.org/dirs/dirs-rs" UseCase="@T("dirs determines the platform-specific local application data directory. AI Studio uses it so the Flatpak startup log is written to the same application data directory that Tauri uses.")"/>
                    <ThirdPartyComponent Name="rand" Developer="Rust developers & Open Source Community" LicenseName="MIT" LicenseUrl="https://github.com/rust-random/rand/blob/master/LICENSE-MIT" RepositoryUrl="https://github.com/rust-random/rand" UseCase="@T("We must generate random numbers, e.g., for securing the interprocess communication between the user interface and the runtime. The rand library is great for this purpose.")"/>
                    <ThirdPartyComponent Name="pptx-to-md" Developer="Nils Kruthoff & Open Source Community" LicenseName="MIT" LicenseUrl="https://github.com/nilskruthoff/pptx-parser/blob/master/LICENCE-MIT" RepositoryUrl="https://github.com/nilskruthoff/pptx-parser" UseCase="@T("We use this library to be able to read PowerPoint files. This allows us to insert content from slides into prompts and take PowerPoint files into account in RAG processes. We thank Nils Kruthoff for his work on this Rust crate.")"/>
                    <ThirdPartyComponent Name="base64" Developer="Marshall Pierce, Alice Maz & Open Source Community" LicenseName="MIT" LicenseUrl="https://github.com/marshallpierce/rust-base64/blob/master/LICENSE-MIT" RepositoryUrl="https://github.com/marshallpierce/rust-base64" UseCase="@T("For some data transfers, we need to encode the data in base64. This Rust library is great for this purpose.")"/>
                    <ThirdPartyComponent Name="Rust Crypto" Developer="Artyom Pavlov, Tony Arcieri, Brian Warner, Arthur Gautier, Vlad Filippov, Friedel Ziegelmayer, Nicolas Stalder & Open Source Community" LicenseName="MIT" LicenseUrl="https://github.com/RustCrypto/traits/blob/master/cipher/LICENSE-MIT" RepositoryUrl="https://github.com/RustCrypto" UseCase="@T("When transferring sensitive data between Rust runtime and .NET app, we encrypt the data. We use some libraries from the Rust Crypto project for this purpose: cipher, aes, cbc, pbkdf2, hmac, and sha2. We are thankful for the great work of the Rust Crypto project.")"/>
                    <ThirdPartyComponent Name="rcgen" Developer="RustTLS developers, est31 & Open Source Community" LicenseName="MIT" LicenseUrl="https://github.com/rustls/rcgen/blob/main/LICENSE" RepositoryUrl="https://github.com/rustls/rcgen" UseCase="@T("For the secure communication between the user interface and the runtime, we need to create certificates. This Rust library is great for this purpose.")"/>
                    <ThirdPartyComponent Name="windows-registry" Developer="Microsoft, Kenny Kerr, Ryan Levick, Rafael Rivera, sivadeilra, Marijn Suijten & Open Source Community" LicenseName="MIT" LicenseUrl="https://github.com/microsoft/windows-rs/blob/master/license-mit" RepositoryUrl="https://github.com/microsoft/windows-rs" UseCase="@T("This library is used to access the Windows registry. We use this for Windows enterprise environments to read the desired configuration.")"/>
                    <ThirdPartyComponent Name="file-format" Developer="Mickaël Malécot & Open Source Community" LicenseName="MIT" LicenseUrl="https://github.com/mmalecot/file-format/blob/main/LICENSE-MIT" RepositoryUrl="https://github.com/mmalecot/file-format" UseCase="@T("This library identifies files by their content. It is used for document streaming and as the first safety and media classification step before local audio processing.")"/>
                    <ThirdPartyComponent Name="Symphonia" Developer="Philip Deljanov & Open Source Community" LicenseName="MPL-2.0" LicenseUrl="https://github.com/pdeljanov/Symphonia/blob/v0.6.0/LICENSE" RepositoryUrl="https://github.com/pdeljanov/Symphonia" UseCase="@T("Symphonia is used for media container demuxing and audio decoding. The exact MPL-covered source is available from the repository linked and is identified in the offline notices bundled with AI Studio.")"/>
                    <ThirdPartyComponent Name="Ropus" Developer="0x4D44, Xiph.Org, Skype Limited, Octasic, Jean-Marc Valin, Timothy B. Terriberry, CSIRO, Gregory Maxwell, Mark Borgerding, Erik de Castro Lopo, Mozilla, Amazon & Open Source Community" LicenseName="BSD-3-Clause" LicenseUrl="https://github.com/0x4D44/ropus/blob/main/LICENSE" RepositoryUrl="https://github.com/0x4d44/ropus" UseCase="@T("Ropus provides the Opus encoder and decoder used by the media pipeline.")"/>
                    <ThirdPartyComponent Name="Rubato" Developer="Henrik Enquist & Open Source Community" LicenseName="MIT" LicenseUrl="https://github.com/HEnquist/rubato/blob/master/LICENSE-MIT" RepositoryUrl="https://github.com/HEnquist/rubato" UseCase="@T("We use Rubato to resample the decoded audio to 48 kHz before the Opus encoding.")"/>
                    <ThirdPartyComponent Name="webm-iterable" Developer="Austin Blake & Open Source Community" LicenseName="MIT" LicenseUrl="https://github.com/austinleroy/webm-iterable/blob/main/LICENSE" RepositoryUrl="https://github.com/austinleroy/webm-iterable" UseCase="@T("webm-iterable provides the EBML and WebM writing path for normalized audio.")"/>
                    <ThirdPartyComponent Name="calamine" Developer="Johann Tuffe, Joel Natividad, Eric Jolibois, Dmitriy & Open Source Community" LicenseName="MIT" LicenseUrl="https://github.com/tafia/calamine/blob/master/LICENSE-MIT.md" RepositoryUrl="https://github.com/tafia/calamine" UseCase="@T("This library is used to read Excel and OpenDocument spreadsheet files. This is necessary, e.g., for using spreadsheets as a data source for a chat.")"/>
                    <ThirdPartyComponent Name="PDFium" Developer="Lei Zhang, Tom Sepez, Dan Sinclair, and Foxit, Google, Chromium, Collabora, Ada, DocsCorp, Dropbox, Microsoft, and PSPDFKit Teams & Open Source Community" LicenseName="Apache-2.0" LicenseUrl="https://pdfium.googlesource.com/pdfium/+/refs/heads/main/LICENSE" RepositoryUrl="https://pdfium.googlesource.com/pdfium" UseCase="@T("This library is used to read PDF files. This is necessary, e.g., for using PDFs as a data source for a chat.")"/>
                    <ThirdPartyComponent Name="pdfium-render" Developer="Alastair Carey, Dorian Rudolph & Open Source Community" LicenseName="MIT" LicenseUrl="https://github.com/ajrcarey/pdfium-render/blob/master/LICENSE.md" RepositoryUrl="https://github.com/ajrcarey/pdfium-render" UseCase="@T("This library is used to read PDF files. This is necessary, e.g., for using PDFs as a data source for a chat.")"/>
                    <ThirdPartyComponent Name="sys-locale" Developer="1Password Team, ComplexSpaces & Open Source Community" LicenseName="MIT" LicenseUrl="https://github.com/1Password/sys-locale/blob/main/LICENSE-MIT" RepositoryUrl="https://github.com/1Password/sys-locale" UseCase="@T("This library is used to determine the language of the operating system. This is necessary to set the language of the user interface.")"/>
                    <ThirdPartyComponent Name="whoami" Developer="Ardaku Systems, Jeryn Aldaron Lau, Chase Johnson & Open Source Community" LicenseName="MIT" LicenseUrl="https://github.com/ardaku/whoami/blob/stable/LICENSE_MIT" RepositoryUrl="https://github.com/ardaku/whoami" UseCase="@T("This library is used by the Rust runtime to read the current user's username, e.g. when an organization-managed ERI server uses the OS username for authentication.")"/>
                    <ThirdPartyComponent Name="sysinfo" Developer="Guillaume Gomez & Open Source Community" LicenseName="MIT" LicenseUrl="https://github.com/GuillaumeGomez/sysinfo/blob/main/LICENSE" RepositoryUrl="https://github.com/GuillaumeGomez/sysinfo" UseCase="@T("This library is used to manage sidecar processes and to ensure that stale or zombie sidecars are detected and terminated.")"/>
                    <ThirdPartyComponent Name="tempfile" Developer="Steven Allen, Ashley Mannix & Open Source Community" LicenseName="MIT" LicenseUrl="https://github.com/Stebalien/tempfile/blob/master/LICENSE-MIT" RepositoryUrl="https://github.com/Stebalien/tempfile" UseCase="@T("This library is used to create temporary folders in runtime tests and supporting filesystem operations.")"/>
                    <ThirdPartyComponent Name="Lua-CSharp" Developer="Yusuke Nakada & Open Source Community" LicenseName="MIT" LicenseUrl="https://github.com/nuskey8/Lua-CSharp/blob/main/LICENSE" RepositoryUrl="https://github.com/nuskey8/Lua-CSharp" UseCase="@T("We use Lua as the language for plugins. Lua-CSharp lets Lua scripts communicate with AI Studio and vice versa. Thank you, Yusuke Nakada, for this great library.")" />
                    <ThirdPartyComponent Name="HtmlAgilityPack" Developer="ZZZ Projects & Open Source Community" LicenseName="MIT" LicenseUrl="https://github.com/zzzprojects/html-agility-pack/blob/master/LICENSE" RepositoryUrl="https://github.com/zzzprojects/html-agility-pack" UseCase="@T("We use the HtmlAgilityPack to extract content from the web. This is necessary, e.g., when you provide a URL as input for an assistant.")"/>
                    <ThirdPartyComponent Name="ReverseMarkdown" Developer="Babu Annamalai & Open Source Community" LicenseName="MIT" LicenseUrl="https://github.com/mysticmind/reversemarkdown-net/blob/master/LICENSE" RepositoryUrl="https://github.com/mysticmind/reversemarkdown-net" UseCase="@T("This library is used to convert HTML to Markdown. This is necessary, e.g., when you provide a URL as input for an assistant.")"/>
                    <ThirdPartyComponent Name="wikEd diff" Developer="Cacycle & Open Source Community" LicenseName="None (public domain)" LicenseUrl="https://en.wikipedia.org/wiki/User:Cacycle/diff#License" RepositoryUrl="https://en.wikipedia.org/wiki/User:Cacycle/diff" UseCase="@T("This library is used to display the differences between two texts. This is necessary, e.g., for the grammar and spelling assistant.")"/>
                    <ThirdPartyComponent Name="CodeJar" Developer="Anton Medvedev" LicenseName="MIT" LicenseUrl="https://github.com/antonmedv/codejar/blob/master/LICENSE" RepositoryUrl="https://github.com/antonmedv/codejar/" UseCase="@T("CodeJar is a lightweight embeddable code editor for the browser.")"/>
                </MudGrid>
            </ExpansionPanel>
            <ExpansionPanel HeaderIcon="@Icons.Material.Filled.Verified" HeaderText="License: FSL-1.1-MIT">
                <MudMarkdown Value="@LICENSE" Props="Markdown.DefaultConfig" MarkdownPipeline="Markdown.SAFE_MARKDOWN_PIPELINE"/>
            </ExpansionPanel>
        </MudExpansionPanels>
    </InnerScrolling>
</div>
