//! atproto-static-web   A simple web viewer for AT Proto.
//! Copyright (C) 2026  AverageHelper
//!
//! This program is free software: you can redistribute it and/or modify
//! it under the terms of the GNU General Public License as published by
//! the Free Software Foundation, either version 3 of the License, or
//! (at your option) any later version.
//!
//! This program is distributed in the hope that it will be useful,
//! but WITHOUT ANY WARRANTY; without even the implied warranty of
//! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//! GNU General Public License for more details.
//!
//! You should have received a copy of the GNU General Public License
//! along with this program.  If not, see <https://www.gnu.org/licenses/>.

use const_format::str_split;
use std::sync::LazyLock;
use url::Url;
use url_static::url;

/// e.g. "maud 1.2.3"
pub static GENERATOR: &str = concat!("maud ", include_str!(concat!(env!("OUT_DIR"), "/maud.txt")));

pub static REPO_URL: LazyLock<Url> = LazyLock::new(|| url!(env!("CARGO_PKG_REPOSITORY")));

pub static REPO_ISSUES_URL: LazyLock<Url> =
	LazyLock::new(|| url!(concat!(env!("CARGO_PKG_REPOSITORY"), "/issues")));

pub static PKG_NAME: &str = env!("CARGO_PKG_NAME");

static AUTHORS: &[&str] = &str_split! {
	env!("CARGO_PKG_AUTHORS"),
	':',
};
pub static PKG_AUTHORS: &str = konst::string::str_join!(", ", AUTHORS);

pub static VERSION: &str = env!("CARGO_PKG_VERSION");

pub static USER_AGENT: &str = const_format::concatcp!(PKG_NAME, "/", VERSION);

pub static COPYRIGHT_YEAR: &str = "2026";

static COPYRIGHT_NOTICE: &str = const_format::concatcp!(
	PKG_NAME,
	"  Copyright (C) ",
	COPYRIGHT_YEAR,
	"  ",
	PKG_AUTHORS,
	"

This program comes with ABSOLUTELY NO WARRANTY.  This is
free software, and you are welcome to redistribute it
under certain conditions; see <https://www.gnu.org/licenses/#GPL>
for details."
);
pub static WEB_COPYRIGHT_NOTICE: maud::PreEscaped<&'static str> = maud::PreEscaped(
	const_format::concatcp!("\n<!--\n", COPYRIGHT_NOTICE, "\n-->\n"),
);
