<?php
namespace NeoLibraryFull\NeoSettings; if (!defined("ABSPATH")) { die("neoWP direct access not allowed"); }














\NeoLibraryFull\NeoGlobal\val("neo_settings__sections", []);
function interface_add_neo_settings_section_20260411($id, $module_id_prefixes, $icon, $icon_animated, $title, $description, $coming_soon_url = null, $section_group = null, $render_callback_setting_slot = null) {
    \NeoLibraryFull\NeoGlobal\val("neo_settings__sections")[] = ["id" => $id, "module_id_prefixes" => $module_id_prefixes, "icon" => $icon, "icon_animated" => $icon_animated, "title" => $title, "description" => $description, "coming_soon_url" => $coming_soon_url, "section_group" => $section_group, "render_callback_setting_slot" => $render_callback_setting_slot];
}

\NeoLibraryFull\NeoGlobal\val("neo_settings__settings", []);
function interface_add_neo_setting_20260326($module_id, $render_callback, $show_to_editor = false) {
    \NeoLibraryFull\NeoGlobal\val("neo_settings__settings")[] = ["module_id" => $module_id, "render_callback" => $render_callback, "show_to_editor" => $show_to_editor];
}

\NeoLibraryFull\NeoGlobal\val("neo_settings__asset_loading_callbacks", []);
function interface_add_neo_settings_asset_loading_callback_20250918($callback) { \NeoLibraryFull\NeoGlobal\val("neo_settings__asset_loading_callbacks")[] = $callback; }



\NeoLibraryFull\NeoGlobal\add_action_hook("neo_init", function () {
    $settings_render_callback = function () {
        ?><neo-setting-neo-library-full>
            <div slot="left">
                <h3><?php \NeoLibraryFull\NeoGlobal\echo_neo__("Show neoWP under Settings", "neoWP unter Einstellungen anzeigen") ?></h3>
                <p id="neo-settings--menu-location-description" data-neo-settings--menu-location-notice="<?php \NeoLibraryFull\NeoGlobal\echo_neo_attr__("The menu item will be hidden when you leave this page.", "Der Menüpunkt wird beim Verlassen dieser Seite ausgeblendet.") ?>"><?php \NeoLibraryFull\NeoGlobal\echo_neo__("Move neoWP into the WordPress Settings menu and hide the large sidebar entry.", "NeoWP in das WordPress-Menü Einstellungen verschieben und den großen Sidebar-Eintrag ausblenden.") ?></p>
            </div>
            <div slot="right">
                <?php \NeoLibraryFull\NeoGlobal\echo_switch_for_option("neo_settings__hide_top_level_menu_enabled", \NeoLibraryFull\NeoGlobal\neo__("Settings menu", "Einstellungen-Menü"), js_function_on_change: "window.neoSettingsMenuLocationNoticeOnChange") ?> 
            </div>
            <script type="module">window.neoSettingsMenuLocationNoticeOnChange = ({ checked }) => { const descriptionNode = document.querySelector("#neo-settings--menu-location-description"); if (!descriptionNode) { return; } document.querySelector("#neo-settings--menu-location-notice")?.remove(); if (!checked) { return; } const noticeNode = document.createElement("span"); noticeNode.id = "neo-settings--menu-location-notice"; noticeNode.style.display = "block"; noticeNode.style.color = "#166534"; noticeNode.style.fontWeight = "600"; noticeNode.textContent = descriptionNode.getAttribute("data-neo-settings--menu-location-notice"); descriptionNode.append(noticeNode); };</script>
        </neo-setting-neo-library-full><?php
    };
    interface_add_neo_setting_20260326("neo-settings--menu-location", $settings_render_callback);
});



\NeoLibraryFull\NeoGlobal\add_action_hook("admin_menu", function () {

    $menu_page_hook_suffix_id = add_menu_page(
        \NeoLibraryFull\NeoGlobal\neo__("neoWP - Media plugins", "neoWP - Media plugins"),
        \NeoLibraryFull\NeoGlobal\neo__("neoWP", "neoWP"),
        \NeoLibraryFull\NeoGlobal\capability__neo_settings(),
        \NeoLibraryFull\NeoGlobal\plugin_settings_page_slug(),
        function () {
            \NeoLibraryFull\NeoGlobal\performance_checkpoint("neo-settings menu page", is_start: true);
            \NeoLibraryFull\NeoGlobal\disallow_enqueue("Use interface_add_neo_settings_asset_loading_callback_20250918 to enqueue JS/CSS on neo-settings pages.", function () {

                [$plugin_list, $plugin_icon_list] = \NeoLibraryFull\NeoGlobal\update_and_get_plugin_list_and_icons();

                $not_installed_neoplugins = []; foreach ($plugin_list as $plugin_data) { if (!in_array(\NeoLibraryFull\NeoGlobal\get_plugin_entry_path_relative($plugin_data["plugin-slug"]), array_keys(get_plugins())) && !\NeoLibraryFull\NeoGlobal\is_module_available($plugin_data["plugin-slug"]) && !\NeoLibraryFull\NeoGlobal\is_module_available($plugin_data["plugin-slug"], include_suppressed: true)) { $not_installed_neoplugins[] = $plugin_data["plugin-slug"]; } }
                usort($plugin_list, function ($a, $b) use ($not_installed_neoplugins) {
                    $a_not_installed = in_array($a["plugin-slug"], $not_installed_neoplugins);
                    $b_not_installed = in_array($b["plugin-slug"], $not_installed_neoplugins);
                    if (!$a_not_installed && $b_not_installed) { return -1; }
                    if ($a_not_installed && !$b_not_installed) { return +1; }

                    if (!$a["plugin-is-coming-soon"] &&  $b["plugin-is-coming-soon"]) { return -1; }
                    if ( $a["plugin-is-coming-soon"] && !$b["plugin-is-coming-soon"]) { return +1; }

                    [$user_type, $interface_ok] = \NeoLibraryFull\NeoGlobal\call_interface_func_implemented('\NeoLibraryFull\NeoDomainSettings\interface_get_user_type_20260412')(); if (!$interface_ok) { $user_type = "user"; }
                    if ($user_type === "dev") {
                        if ($a["plugin-slug"] === "neo-prod") { return -1; }
                        if ($b["plugin-slug"] === "neo-prod") { return +1; }
                    }
                    return 0;
                });

                [$color_theme, $interface_ok] = \NeoLibraryFull\NeoGlobal\call_interface_func_implemented('\NeoLibraryFull\NeoProColorTheme\interface_get_color_theme_20260106')(); if (!$interface_ok) { $color_theme = "theme-neo"; }
                foreach ($plugin_list as $plugin_data) {
                    interface_add_neo_settings_section_20260411(
                        id: $plugin_data["plugin-slug"],
                        module_id_prefixes: [$plugin_data["plugin-slug"]],
                        icon: $plugin_icon_list[$plugin_data["plugin-slug"]][$color_theme]["icon"],
                        icon_animated: $plugin_icon_list[$plugin_data["plugin-slug"]][$color_theme]["icon-animated"],
                        title: $plugin_data["plugin-name"],
                        description: $plugin_data["plugin-slogan"],
                        coming_soon_url: $plugin_data["plugin-is-coming-soon"] ? $plugin_data["plugin-website-url"] : null,
                        section_group: (in_array($plugin_data["plugin-slug"], $not_installed_neoplugins) && \NeoLibraryFull\NeoGlobal\plugin_slug() !== "neo-plugins") || (\NeoLibraryFull\NeoGlobal\plugin_slug() === "neo-plugins" && $plugin_data["plugin-is-coming-soon"]) ? \NeoLibraryFull\NeoGlobal\neo__("👀 Show all neoPlugins (+" . count($not_installed_neoplugins) . ")", "👀 Alle neoPlugins anzeigen (+" . count($not_installed_neoplugins) . ")") : "",
                        render_callback_setting_slot: function ($setting_slot) use ($plugin_data) {
                            [$_, $interface_ok] = \NeoLibraryFull\NeoGlobal\call_interface_func_implemented('\NeoLibraryFull\NeoManagerInstaller\interface_neo_manager_render_settings_card_slot_20260327')($plugin_data, $setting_slot);
                            if (!$interface_ok) { \NeoLibraryFull\NeoGlobal\call_interface_func_implemented('\NeoLibraryFull\NeoManagerWporg\interface_neo_manager_render_settings_card_slot_20260327')($plugin_data, $setting_slot); }
                        }
                    );
                }

                interface_add_neo_settings_section_20260411(
                    id: "neo-pro",
                    module_id_prefixes: ["neo-pro", "neo-freemius"],
                    icon: \NeoLibraryFull\NeoGlobal\plugin_url() . "/img/plugin-module-neo-pro-icon.svg", icon_animated: null,
                    title: \NeoLibraryFull\NeoGlobal\neo__("neoPro", "neoPro"),
                    description: \NeoLibraryFull\NeoGlobal\neo__("Manage your neoPro license and access extended features.", "Verwalte deine neoPro-Lizenz und erhalte Zugriff auf erweiterte Funktionen.")
                );
                interface_add_neo_settings_section_20260411(
                    id: "neo-support-reset-log",
                    module_id_prefixes: ["neo-support--support", "neo-settings--menu-location", "neo-log", "neo-reset", "neo-support--privacy-policy"],
                    icon: \NeoLibraryFull\NeoGlobal\plugin_url() . "/img/plugin-module-neo-support-icon.svg", icon_animated: null,
                    title: \NeoLibraryFull\NeoGlobal\neo__("neoSupport", "neoSupport"),
                    description: \NeoLibraryFull\NeoGlobal\neo__("Access support resources, reset settings, and view logs for troubleshooting.", "Zugriff auf Support-Ressourcen, Einstellungen zurücksetzen und Logs zur Fehlerbehebung anzeigen.")
                );
                interface_add_neo_settings_section_20260411(
                    id: "neo-mail",
                    module_id_prefixes: ["neo-tool-mail-send"],
                    icon: \NeoLibraryFull\NeoGlobal\plugin_url() . "/img/plugin-module-neo-mail-icon.svg", icon_animated: null,
                    title: \NeoLibraryFull\NeoGlobal\neo__("neoMail", "neoMail"),
                    description: \NeoLibraryFull\NeoGlobal\neo__("File-based email jobs.", "Dateibasierte E-Mail-Jobs.")
                );
                interface_add_neo_settings_section_20260411(
                    id: "neo-website",
                    module_id_prefixes: ["neo-statistics"],
                    icon: \NeoLibraryFull\NeoGlobal\plugin_url() . "/img/plugin-module-neo-website-icon.svg", icon_animated: null,
                    title: \NeoLibraryFull\NeoGlobal\neo__("neoWebsite", "neoWebsite"),
                    description: \NeoLibraryFull\NeoGlobal\neo__("Website tools and statistics.", "Website-Tools und Statistiken.")
                );
                interface_add_neo_settings_section_20260411(
                    id: "neo-developer",
                    module_id_prefixes: ["neo-debug", "neo-symlink", "neo-demo-content", "neo-demo-screenshot", "neo-tool-passkey", "neo-license-server"],
                    icon: \NeoLibraryFull\NeoGlobal\plugin_url() . "/img/plugin-module-neo-developer-icon.svg", icon_animated: null,
                    title: \NeoLibraryFull\NeoGlobal\neo__("neoDeveloper", "neoDeveloper"),
                    description: \NeoLibraryFull\NeoGlobal\neo__("Developer tools and settings for advanced users.", "Entwicklertools und Einstellungen für fortgeschrittene Nutzer.")
                );







                ?><div class="wrap">
                    <h1 id="neo-settings--top"><?php \NeoLibraryFull\NeoGlobal\echo_neo__("neoWP - Media Plugins", "neoWP - Media Plugins"); ?></h1>
                    <style>
                        html { scroll-behavior: smooth; }
                        .wrap { --neo-settings--section-card-width: 800px; --neo-settings--section-space: 30px; --neo-settings--section-outer-width: calc(var(--neo-settings--section-card-width) + (var(--neo-settings--section-space) * 2)); }
                        #wpbody-content { overflow: hidden; }
                        #wpbody-content { padding-bottom: 40px; }
                        #wpbody-content { font-size: 16px; } #wpbody-content p { font-size: 1em; }
                        .neo-settings--sections, .neo-settings--section-group { display: flex; flex-direction: column; gap: 20px; }
                        .neo-settings--section-group-header { display: flex; justify-content: center; width: var(--neo-settings--section-outer-width); max-width: 100%; }
                        .neo-settings--section-group-toggle { display: inline-flex; align-items: center; justify-content: center; gap: 10px; color: #606060; background: transparent; border: none; font-size: 1.5em; cursor: pointer; &:focus-visible { outline: 2px solid blue; } }
                        .neo-settings--section-group-header-chevron { display: inline-flex; align-items: center; justify-content: center; width: 1.5em; height: 1.5em; flex-shrink: 0; transition: transform 200ms ease; svg { width: 24px; } }
                        .neo-settings--section-group-toggle.neo-settings--section-group-toggle-open .neo-settings--section-group-header-chevron { transform: rotate(180deg); }
                        .neo-settings--section-group { width: fit-content; max-width: 100%; opacity: 1; transition: max-height 400ms ease, opacity 200ms linear; }
                        .neo-settings--section-group.neo-settings--section-group-collapsed { transition: max-height 200ms linear, opacity 200ms linear; }
                        .neo-settings--section-group[hidden] { display: none; }
                        .neo-settings--section-group-separator { border: 0; border-top: 1px solid rgba(0, 0, 0, 0.08); width: calc(100% - 40px); }
                        @media (max-width: 767px) { .wrap { --neo-settings--section-space: 20px; } }
                    </style>
                    <?php

                    $sections_with_settings = [];
                    foreach (\NeoLibraryFull\NeoGlobal\val("neo_settings__sections") as $settings_section) {

                        $settings_for_section = [];
                        foreach ($settings_section["module_id_prefixes"] as $module_id_prefix) {
                            if ($settings_section["id"] === "neo-symlink") { break; }
                            $settings_for_section = array_merge($settings_for_section, \NeoLibraryFull\NeoGlobal\array_filter_better(\NeoLibraryFull\NeoGlobal\val("neo_settings__settings"), fn ($setting) => str_starts_with($setting["module_id"], $module_id_prefix)));
                        }
                        if (!\NeoLibraryFull\NeoGlobal\current_user_can__neo_settings__see_all_settings()) { $settings_for_section = \NeoLibraryFull\NeoGlobal\array_filter_better($settings_for_section, fn ($setting) => $setting["show_to_editor"]); }

                        if (empty($settings_for_section) && empty($settings_section["render_callback_setting_slot"])) { continue; }
                        if (!\NeoLibraryFull\NeoGlobal\current_user_can__neo_settings__see_all_settings() && empty($settings_for_section)) { continue; }

                        $settings_section["render_callbacks_settings"] = array_combine(array_column($settings_for_section, "module_id"), array_column($settings_for_section, "render_callback"));
                        $sections_with_settings[] = $settings_section;
                        foreach ($settings_for_section as $setting) { \NeoLibraryFull\NeoGlobal\val("neo_settings__settings", \NeoLibraryFull\NeoGlobal\array_filter_better(\NeoLibraryFull\NeoGlobal\val("neo_settings__settings"), fn ($s) => $s["module_id"] !== $setting["module_id"])); }
                    }

                    foreach (\NeoLibraryFull\NeoGlobal\val("neo_settings__settings") as $setting) {
                        if (!\NeoLibraryFull\NeoGlobal\current_user_can__neo_settings__see_all_settings() && !$setting["show_to_editor"]) { continue; }
                        $sections_with_settings[] = [
                            "id"                        => $setting["module_id"],
                            "title"                     => lcfirst(str_replace(" ", "", ucwords(str_replace("-", " ", $setting["module_id"])))),
                            "render_callbacks_settings" => [$setting["module_id"] => $setting["render_callback"]],
                        ];
                    }

                    ?><div class="neo-settings--sections" style="margin-top: 20px;"><?php 
                        $current_section_group = null;
                        foreach ($sections_with_settings as $settings_section) {
                            \NeoLibraryFull\NeoGlobal\performance_checkpoint("neo-settings section " . $settings_section["id"], is_start: true);

                            if (($settings_section["section_group"] ?? null) && $settings_section["section_group"] !== $current_section_group) {
                                if ($current_section_group) { ?></div><?php }
                                ?>
                                <div class="neo-settings--section-group-header">
                                    <button class="neo-settings--section-group-toggle">
                                        <span class="neo-settings--section-group-header-label"><?php echo esc_html($settings_section["section_group"]) ?></span>
                                        <span class="neo-settings--section-group-header-chevron"><svg viewBox="0 0 24 24" fill="none"><path d="M6 9L12 15L18 9" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round"></path></svg></span>
                                    </button>
                                </div>
                                <div class="neo-settings--section-group neo-settings--section-group-collapsed" hidden><?php
                                $current_section_group = $settings_section["section_group"];
                            } else if (!($settings_section["section_group"] ?? null) && $current_section_group) {
                                ?><hr class="neo-settings--section-group-separator" /></div><?php
                                $current_section_group = null;
                            }

                            $title = \NeoLibraryFull\NeoGlobal\preg_replace_better('/(?<=[a-z])(?=[A-Z])/u', "\u{00AD}", $settings_section["title"] ?? "");
                            ?><neo-setting-section-neo-library-full id="neo-settings--section-<?php echo esc_attr($settings_section["id"]) ?>" section-title="<?php echo esc_attr($title) ?>" section-description="<?php echo esc_attr($settings_section["description"] ?? "") ?>" icon="<?php echo esc_url($settings_section["icon"] ?? "") ?>" icon-animated="<?php echo ($settings_section["icon_animated"] ?? null) ? esc_url($settings_section["icon_animated"]) : ""; ?>" <?php echo ($settings_section["coming_soon_url"] ?? null) ? 'coming-soon="' . esc_attr($settings_section["coming_soon_url"]) . '"' : ""; ?>>
                                <?php if ($settings_section["render_callback_setting_slot"] ?? null) { ?> 
                                    <?php foreach (["tooltip", "switch", "install-options", "reload-button"] as $part_type) {
                                        ?><div slot="<?php echo esc_attr($part_type) ?>">
                                            <?php try { $settings_section["render_callback_setting_slot"]($part_type); } catch (\Throwable $e) { \NeoLibraryFull\NeoGlobal\echo_neo__("Error while rendering section header " . $part_type . " callback", "Fehler beim Rendern des Abschnitts-Header-" . $part_type); \NeoLibraryFull\NeoGlobal\global_warn_with_module_name("neo-settings", "Error while rendering section header " . $part_type . " callback: " . get_class($e) . ": " . $e->getMessage() . " in " . $e->getFile() . ":" . $e->getLine() . "\n" . $e->getTraceAsString()); } ?>
                                        </div><?php
                                    } ?>
                                <?php } ?>
                                <div slot="settings"><?php
                                    foreach ($settings_section["render_callbacks_settings"] ?? [] as $module_id => $setting) {
                                        \NeoLibraryFull\NeoGlobal\performance_checkpoint("neo-settings section " . $settings_section["id"] . " setting " . $module_id, is_start: true);
                                        try { $setting(); } catch (\Throwable $e) { \NeoLibraryFull\NeoGlobal\echo_neo__("Error while rendering setting", "Fehler beim Rendern der Einstellung"); \NeoLibraryFull\NeoGlobal\global_warn_with_module_name("neo-settings", "Error while rendering setting: " . get_class($e) . ": " . $e->getMessage() . " in " . $e->getFile() . ":" . $e->getLine() . "\n" . $e->getTraceAsString()); }
                                        \NeoLibraryFull\NeoGlobal\performance_checkpoint("neo-settings section " . $settings_section["id"] . " setting " . $module_id, is_end: true);
                                    }
                                ?></div>
                            </neo-setting-section-neo-library-full><?php
                            \NeoLibraryFull\NeoGlobal\performance_checkpoint("neo-settings section " . $settings_section["id"], is_end: true);
                        }
                        if ($current_section_group) { ?></div><?php }
                    ?></div>

                    <div id="neo-settings--anti-scroll-glitch-spacing-element" style="width: 100%; height: 30vh;"></div>
                </div>
                <div id="neo-settings--footer-thankyou">
                    <?php \NeoLibraryFull\NeoGlobal\echo_neo__("Thank you for creating with", "Danke für dein Vertrauen in") ?> <a href="<?php echo esc_url(\NeoLibraryFull\NeoGlobal\get_plugin_download_url()) ?>" target="_blank">neo-wp.com</a>.
                    <script type="speculationrules">{ "prefetch": [{ "urls": ["<?php echo esc_url(\NeoLibraryFull\NeoGlobal\get_plugin_download_url()) ?>"] }] }</script>
                    <script type="module">
                        import { observeOnce } from "<?php echo esc_url(\NeoLibraryFull\NeoGlobal\plugin_url()) ?>/_global--observer.js";
                        observeOnce("#footer-thankyou", (node) => { node.prepend(document.querySelector("#neo-settings--footer-thankyou")); });
                    </script>
                </div>


                <script type="module">
                    import { domLoaded, addEventListenerWithInitialCall } from "<?php echo esc_url(\NeoLibraryFull\NeoGlobal\plugin_url()) ?>/_global--observer.js";
                    domLoaded(() => {

                        const sections = document.querySelectorAll("neo-setting-section-neo-library-full");
                        addEventListenerWithInitialCall(window, "scroll", () => {

                            const scrollY = window.scrollY;
                            for (const anyLink of document.querySelectorAll("#toplevel_page_<?php echo esc_attr(\NeoLibraryFull\NeoGlobal\plugin_settings_page_slug()) ?> li")) { anyLink.classList.remove("current"); }

                            if (Math.ceil(document.querySelector("html").scrollTop + document.querySelector("html").clientHeight) >= document.querySelector("html").scrollHeight) {
                                [...document.querySelectorAll(`#toplevel_page_<?php echo esc_attr(\NeoLibraryFull\NeoGlobal\plugin_settings_page_slug()) ?> a[href*="#"]`)].pop().parentElement.classList.add("current");
                                return;
                            }

                            for (const section of [...sections].reverse()) {
                                const sectionMenuLink = document.querySelector(`#toplevel_page_<?php echo esc_attr(\NeoLibraryFull\NeoGlobal\plugin_settings_page_slug()) ?> a[href="admin.php?page=<?php echo esc_attr(\NeoLibraryFull\NeoGlobal\plugin_settings_page_slug()) ?>#${section.getAttribute('id')}"]`);
                                if (!sectionMenuLink) { continue; }
                                if (section.offsetTop < scrollY + window.innerHeight / 2) {
                                    sectionMenuLink.parentElement.classList.add("current");
                                    return;
                                }
                            }
                        });
                    });
                </script>
                <?php
            });
            \NeoLibraryFull\NeoGlobal\performance_checkpoint("neo-settings menu page", is_end: true);
        },
        icon_url: "data:image/svg+xml;base64," . base64_encode(\NeoLibraryFull\NeoGlobal\fs_file_get_contents(\NeoLibraryFull\NeoGlobal\plugin_path() . "/img/neo-settings--icon.svg")),
    );

    \NeoLibraryFull\NeoGlobal\add_action_hook("load-$menu_page_hook_suffix_id", function () {
        \NeoLibraryFull\NeoGlobal\enqueue_js("neo-settings.js");
        foreach (\NeoLibraryFull\NeoGlobal\val("neo_settings__asset_loading_callbacks") as $callback) { try { $callback(); } catch (\Throwable $e) { \NeoLibraryFull\NeoGlobal\global_warn_with_module_name("neo-settings", "Error while loading menu page assets: " . get_class($e) . ": " . $e->getMessage() . " in " . $e->getFile() . ":" . $e->getLine() . "\n" . $e->getTraceAsString()); } }
    });

    $submenu_entries = [
        \NeoLibraryFull\NeoGlobal\neo__("neoPlugins", "neoPlugins") => "#neo-settings--top",
        \NeoLibraryFull\NeoGlobal\neo__("License", "Lizenz")        => "#neo-settings--section-neo-pro",
        \NeoLibraryFull\NeoGlobal\neo__("Support", "Support")       => "#neo-settings--section-neo-support-reset-log",
    ];
    foreach ($submenu_entries as $submenu_page_title => $section_id) {
        add_submenu_page(
            \NeoLibraryFull\NeoGlobal\plugin_settings_page_slug(),
            $submenu_page_title,
            $submenu_page_title,
            \NeoLibraryFull\NeoGlobal\capability__neo_settings(),
            \NeoLibraryFull\NeoGlobal\plugin_settings_page_slug() . $section_id,
            function () { },
        );
    }
    if (\NeoLibraryFull\NeoGlobal\option__neo_settings__hide_top_level_menu_enabled()) {
        $settings_menu_hook_suffix_id = add_submenu_page("options-general.php", \NeoLibraryFull\NeoGlobal\neo__("neoWP", "neoWP"), \NeoLibraryFull\NeoGlobal\neo__("neoWP", "neoWP"), \NeoLibraryFull\NeoGlobal\capability__neo_settings(), \NeoLibraryFull\NeoGlobal\plugin_settings_page_slug(), function () { global $pagenow; if ($pagenow !== "options-general.php") { return; } wp_safe_redirect(admin_url("admin.php?page=" . \NeoLibraryFull\NeoGlobal\plugin_settings_page_slug())); exit; });
        \NeoLibraryFull\NeoGlobal\add_action_hook("load-$settings_menu_hook_suffix_id", function () { global $pagenow; if ($pagenow !== "options-general.php") { return; } wp_safe_redirect(admin_url("admin.php?page=" . \NeoLibraryFull\NeoGlobal\plugin_settings_page_slug())); exit; });
    }
});



\NeoLibraryFull\NeoGlobal\add_action_hook("admin_footer", function () {
    ?><style>
        #toplevel_page_<?php echo esc_attr(\NeoLibraryFull\NeoGlobal\plugin_settings_page_slug()) ?> > .wp-submenu > .wp-first-item { display: none; }
    </style><?php
});



\NeoLibraryFull\NeoGlobal\add_action_hook("admin_footer", function () {
    if (!\NeoLibraryFull\NeoGlobal\option__neo_settings__hide_top_level_menu_enabled()) { return; }
    if (\NeoLibraryFull\NeoGlobal\query_param("page") === \NeoLibraryFull\NeoGlobal\plugin_settings_page_slug()) { return; }
    ?><style>
        #toplevel_page_<?php echo esc_attr(\NeoLibraryFull\NeoGlobal\plugin_settings_page_slug()) ?> { display: none; }
    </style><?php
});



\NeoLibraryFull\NeoGlobal\add_action_hook("neo_init", function () {
    foreach (\NeoLibraryFull\NeoEntrypoint\get_neo_active_plugins() as $neo_plugin) {
        \NeoLibraryFull\NeoGlobal\add_filter_hook("plugin_action_links_" . plugin_basename($neo_plugin["plugin_entry_file_path"] ?? ""), function ($links) {
            array_unshift($links, '<a href="admin.php?page=' . \NeoLibraryFull\NeoGlobal\plugin_settings_page_slug() . '">' . \NeoLibraryFull\NeoGlobal\neo__("neoSettings", "neoSettings") . '</a>');
            return $links;
        });
    }
});
