use crate::prelude::*;
use icu_properties::{CodePointMapDataBorrowed, props::{GeneralCategory, GeneralCategoryGroup}};
static GC: CodePointMapDataBorrowed<GeneralCategory> = CodePointMapDataBorrowed::new();
pub fn mostly_validate_domain_segment_unicode(value: &str) -> bool {
UTS46.normalize_validate(value.chars()).eq(value.chars())
&& !value.starts_with("xn--")
&& !value.contains('.')
&& !value.starts_with(|c| GeneralCategoryGroup::Mark.contains(GC.get(c)))
&& !value.contains('\u{FFFD}')
&& validate_domain_segment_joiners(value)
}
pub fn mostly_validate_uts46_domain_segment_unicode(value: &str) -> bool {
!value.starts_with("xn--")
&& !value.contains('.')
&& !value.starts_with(|c| GeneralCategoryGroup::Mark.contains(GC.get(c)))
&& !value.contains('\u{FFFD}')
&& validate_domain_segment_joiners(value)
}