Hypergraph Contrastive Learning for both Homophilic and Heterophilic Hypergraphs