<?php

namespace Formatrica\Assets;

if ( ! defined( 'ABSPATH' ) ) {
    exit;
}

use Formatrica\Setup\Service_Locator;
use Formatrica\Setup\Service_Provider;

final class Assets_Service_Provider implements Service_Provider
{
    public function register(Service_Locator $services): void
    {
        $manager = new Manager();

        add_action('init', [$manager, 'register_block_assets'], 5);
        add_action('admin_enqueue_scripts', [$manager, 'register_admin_assets']);
        add_action('wp_enqueue_scripts', [$manager, 'register_frontend_assets']);
        add_action('wp_head', [$manager, 'print_frontend_inline_css'], 90);

        $services->set(Manager::class, $manager);
    }
}
