<commit_before>// Copyright (c) ppy Pty Ltd <<EMAIL>>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.

using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using osu.Framework.Allocation;
using osu.Framework.Extensions.Color4Extensions;
using osu.Framework.Extensions.IEnumerableExtensions;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Colour;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Effects;
using osu.Framework.Graphics.Shapes;
using osu.Framework.Utils;
using osu.Game.Overlays.Notifications;
using osuTK;

namespace osu.Game.Overlays
{
    /// <summary>
    /// A tray which attaches to the left of <see cref="NotificationOverlay"/> to show temporary toasts.
    /// </summary>
    public class NotificationOverlayToastTray : CompositeDrawable
    {
        public override bool IsPresent => toastContentBackground.Height > 0 || toastFlow.Count > 0;

        public bool IsDisplayingToasts => toastFlow.Count > 0;

        private FillFlowContainer<Notification> toastFlow = null!;
        private BufferedContainer toastContentBackground = null!;

        [Resolved]
        private OverlayColourProvider colourProvider { get; set; } = null!;

        public Action<Notification>? ForwardNotificationToPermanentStore { get; set; }

        public int UnreadCount => allDisplayedNotifications.Count(n => !n.WasClosed && !n.Read);

        /// <summary>
        /// Notifications contained in the toast flow, or in a detached state while they animate during forwarding to the main overlay.
        /// </summary>
        private IEnumerable<Notification> allDisplayedNotifications => toastFlow.Concat(InternalChildren.OfType<Notification>());

        private int runningDepth;

        [BackgroundDependencyLoader]
        private void load()<commit_msg>Fix notification overlay toast tray background absorbing input from behind<commit_after>// Copyright (c) ppy Pty Ltd <<EMAIL>>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.

using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using osu.Framework.Allocation;
using osu.Framework.Extensions.Color4Extensions;
using osu.Framework.Extensions.IEnumerableExtensions;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Colour;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Effects;
using osu.Framework.Graphics.Shapes;
using osu.Framework.Utils;
using osu.Game.Overlays.Notifications;
using osuTK;

namespace osu.Game.Overlays
{
    /// <summary>
    /// A tray which attaches to the left of <see cref="NotificationOverlay"/> to show temporary toasts.
    /// </summary>
    public class NotificationOverlayToastTray : CompositeDrawable
    {
        public override bool IsPresent => toastContentBackground.Height > 0 || toastFlow.Count > 0;

        public override bool ReceivePositionalInputAt(Vector2 screenSpacePos) => toastFlow.ReceivePositionalInputAt(screenSpacePos);

        public bool IsDisplayingToasts => toastFlow.Count > 0;

        private FillFlowContainer<Notification> toastFlow = null!;
        private BufferedContainer toastContentBackground = null!;

        [Resolved]
        private OverlayColourProvider colourProvider { get; set; } = null!;

        public Action<Notification>? ForwardNotificationToPermanentStore { get; set; }

        public int UnreadCount => allDisplayedNotifications.Count(n => !n.WasClosed && !n.Read);

        /// <summary>
        /// Notifications contained in the toast flow, or in a detached state while they animate during forwarding to the main overlay.
        /// </summary>
        private IEnumerable<Notification> allDisplayedNotifications => toastFlow.Concat(InternalChildren.OfType<Notification>());

        private int runningDepth;

        [BackgroundDependencyLoader]
        private void load()
{'fraction_non_alphanumeric': 0.08924542491852594, 'fraction_numerical': 0.002256204562547004, 'mean_word_length': 3.883720930232558, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 0, '>': 42, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3394663', 'n_tokens_mistral': 1066, 'n_tokens_neox': 1031, 'n_words': 310}