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




\NeoMotionBeta\NeoGlobal\add_action_hook("neo_init", function () {
    if (\NeoMotionBeta\NeoGlobal\is_playground()) { return; }// It does not make sense to enter a license key in the WP playground, so we omit it for our sandbox.
    $settings_render_callback = function () {
        ?>
        <neo-setting-neo-motion-beta id="neo-freemius--settings"><?php

            $params = ["id" => freemius_product_id()];
            if (init_freemius_once_and_get_instance()->get_user()) {
                
                echo init_freemius_once_and_get_instance()->apply_filters("templates/account.php", fs_get_template("account.php", $params)); /* phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped */ // Not escaped because template code from the Freemius SDK is already properly escaped
            } else if (!init_freemius_once_and_get_instance()->is_anonymous()) {
                
                echo init_freemius_once_and_get_instance()->apply_filters("templates/connect.php", fs_get_template("connect.php", $params)); /* phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped */ // Not escaped because template code from the Freemius SDK is already properly escaped
            } else {
                ?><?php
            }
        ?></neo-setting-neo-motion-beta>
        <neo-setting-neo-motion-beta id="neo-freemius--notices"></neo-setting-neo-motion-beta>
        <neo-setting-neo-motion-beta>
            <div slot="left">
                <h3><?php \NeoMotionBeta\NeoGlobal\echo_neo__("Remove license", "Lizenz entfernen"); ?></h3>
                <p><?php \NeoMotionBeta\NeoGlobal\echo_neo__("Remove all licenses from the website and reset license settings.", "Alle Lizenzen von der Webseite entfernen und Lizenzeinstellungen zurücksetzen."); ?></p>
            </div>
            <div slot="right">
                <neo-button-neo-motion-beta id="neo-freemius--remove-license-button"><?php \NeoMotionBeta\NeoGlobal\echo_neo__("Reset license data", "Lizenzdaten zurücksetzen"); ?></neo-button-neo-motion-beta>
            </div>
        </neo-setting-neo-motion-beta>
        <?php if (isset(pack('H*', '5c4e656f4d6f74696f6e426574615c4e656f476c6f62616c5c70726f5f636865636b')()[31])) {
            if (!freemius_license()?->is_whitelabeled) {?>
                
                <neo-setting-neo-motion-beta>
                    <div slot="left">
                        <h3><?php \NeoMotionBeta\NeoGlobal\echo_neo__("neoPro ZIP Download", "neoPro ZIP Download"); ?></h3>
                        <p><?php \NeoMotionBeta\NeoGlobal\echo_neo__("Download your personal ZIP file here. The license key is integrated, so you won't have to enter it again in the future.", "Lade dir hier deine persönliche ZIP-Datei herunter. Der Lizenzschlüssel ist integriert, sodass du ihn zukünftig nicht mehr eingeben musst."); ?></p>
                    </div>
                    <div slot="right">
                        <?php 
                        $license_key = freemius_license()?->secret_key ?? "";
                        $zip_url = \NeoMotionBeta\NeoGlobal\add_query_param(\NeoMotionBeta\NeoGlobal\get_plugin_download_zip_file_url_without_version("neo-media", "pro"), "license-key", $license_key);
                        ?>
                        <neo-button-neo-motion-beta href="<?php echo esc_url($zip_url) ?>" target="_blank"><?php \NeoMotionBeta\NeoGlobal\echo_neo__("Download ZIP", "Download ZIP") ?></neo-button-neo-motion-beta>
                    </div>
                </neo-setting-neo-motion-beta>
            <?php } else {
                ?><?php
            } ?>
        <?php } ?>
    <?php };
    \NeoMotionBeta\NeoGlobal\call_interface_func_implemented('\NeoMotionBeta\NeoSettings\interface_add_neo_setting_20260326')("neo-freemius", $settings_render_callback);
    
    $freemius_account_page_load_callback = function () {
        init_freemius_once_and_get_instance()->_account_page_load();
        \NeoMotionBeta\NeoGlobal\enqueue_css("neo-freemius--account-page.css");
        \NeoMotionBeta\NeoGlobal\enqueue_js("neo-freemius--reset-license-data.js");
    };
    \NeoMotionBeta\NeoGlobal\call_interface_func_implemented('\NeoMotionBeta\NeoSettings\interface_add_neo_settings_asset_loading_callback_20250918')($freemius_account_page_load_callback);
    \NeoMotionBeta\NeoGlobal\add_action_hook("admin_footer", function () { ?><style>.wp-submenu>li:has(a[href*="?page=<?php echo esc_attr(\NeoMotionBeta\NeoGlobal\plugin_settings_page_slug()) ?>-account"]) { display: none; }</style><?php });
});


\NeoMotionBeta\NeoGlobal\add_action_hook("admin_footer", function () {
    
    if (\NeoMotionBeta\NeoGlobal\query_param("fs_action") === null) { return; }
    ?><script type="module">
        import { observeOnce } from "<?php echo esc_url(\NeoMotionBeta\NeoGlobal\plugin_url()) ?>/_global--observer.js";
        observeOnce("#neo-freemius--settings", element => setTimeout(() => element.scrollIntoView({ behavior: "smooth" }), 1000));
    </script><?php
});


\NeoMotionBeta\NeoGlobal\add_action_hook("current_screen", function () {
    if (!(\NeoMotionBeta\NeoGlobal\query_param("page") === \NeoMotionBeta\NeoGlobal\plugin_settings_page_slug())) { return; }
    if ((strlen(str_rot13("\\ArbZbgvbaOrgn\\ArbTybony\\ceb_purpx")()??"") === 32)) {
        if (!(\FS_Site::is_localhost_by_address(init_freemius_once_and_get_instance()::get_unfiltered_site_url()))) { return; }
        \NeoMotionBeta\NeoGlobal\admin_info(
            \NeoMotionBeta\NeoGlobal\neo__("The use of the neoPro license on this development domain does not affect your license budget and is free of charge.", "Die Nutzung der neoPro-Lizenz ist auf dieser Entwicklungs-Domain kostenfrei und belastet nicht dein Lizenzbudget."),
            title: \NeoMotionBeta\NeoGlobal\neo__("neoPro Development License", "neoPro Entwicklungs-Lizenz")
        );
    }
});


\NeoMotionBeta\NeoGlobal\add_action_hook("admin_head", function () {
    if (!(\NeoMotionBeta\NeoGlobal\query_param("page") === \NeoMotionBeta\NeoGlobal\plugin_settings_page_slug())) { return; }
    
    ?><style id="neo-freemius--hide-fs-notice">.fs-notice:not(#more-specificity) { display: none !important; }</style><?php
    \NeoMotionBeta\NeoGlobal\enqueue_js("neo-freemius--move-notices-on-settings-page.js");
});
