import { DISPLAY_TYPES as t } from "@holepunchto/keet-core/legacy-constants"
export const isUnsetRange = (t) => !!t && (t.top < 0 || t.bottom < 0)
export const isRangeIncluded = (t, e) =>
!isUnsetRange(t) && !isUnsetRange(e) && t.top <= e.top && e.bottom <= t.bottom
export const noMessagesLoaded = (t) => -1 === t.bottom && -1 === t.top
export const isSeqInRange = (t, e) =>
!(!Number.isInteger(e) || e < 0 || isUnsetRange(t)) && t.top <= e && e <= t.bottom
export const isMessageTextEmpty = (t) => 0 === t.trim().length
export function isLinkOnlyMsg(e) {
const { text: o, display: n } = e
return (
o &&
n &&
1 === n.length &&
(n[0].type === t.HTTP_LINK || n[0].type === t.PEAR_LINK) &&
0 === n[0].start &&
n[0].length === o.length
)
}