package lipgloss

import (
	
	

	
)

// GetBold returns the style's bold value. If no value is set false is returned.
func ( Style) () bool {
	return .getAsBool(boldKey, false)
}

// GetItalic returns the style's italic value. If no value is set false is
// returned.
func ( Style) () bool {
	return .getAsBool(italicKey, false)
}

// GetUnderline returns the style's underline value. If no value is set false is
// returned.
func ( Style) () bool {
	return .ul != UnderlineNone
}

// GetUnderlineStyle returns the style's underline style. If no value is set
// UnderlineNone is returned.
func ( Style) () Underline {
	return .ul
}

// GetUnderlineColor returns the style's underline color. If no value is set
// NoColor{} is returned.
func ( Style) () color.Color {
	return .getAsColor(underlineColorKey)
}

// GetStrikethrough returns the style's strikethrough value. If no value is set false
// is returned.
func ( Style) () bool {
	return .getAsBool(strikethroughKey, false)
}

// GetReverse returns the style's reverse value. If no value is set false is
// returned.
func ( Style) () bool {
	return .getAsBool(reverseKey, false)
}

// GetBlink returns the style's blink value. If no value is set false is
// returned.
func ( Style) () bool {
	return .getAsBool(blinkKey, false)
}

// GetFaint returns the style's faint value. If no value is set false is
// returned.
func ( Style) () bool {
	return .getAsBool(faintKey, false)
}

// GetForeground returns the style's foreground color. If no value is set
// NoColor{} is returned.
func ( Style) () color.Color {
	return .getAsColor(foregroundKey)
}

// GetBackground returns the style's background color. If no value is set
// NoColor{} is returned.
func ( Style) () color.Color {
	return .getAsColor(backgroundKey)
}

// GetWidth returns the style's width setting. If no width is set 0 is
// returned.
func ( Style) () int {
	return .getAsInt(widthKey)
}

// GetHeight returns the style's height setting. If no height is set 0 is
// returned.
func ( Style) () int {
	return .getAsInt(heightKey)
}

// GetAlign returns the style's implicit horizontal alignment setting.
// If no alignment is set Position.Left is returned.
func ( Style) () Position {
	 := .getAsPosition(alignHorizontalKey)
	if  == Position(0) {
		return Left
	}
	return 
}

// GetAlignHorizontal returns the style's implicit horizontal alignment setting.
// If no alignment is set Position.Left is returned.
func ( Style) () Position {
	 := .getAsPosition(alignHorizontalKey)
	if  == Position(0) {
		return Left
	}
	return 
}

// GetAlignVertical returns the style's implicit vertical alignment setting.
// If no alignment is set Position.Top is returned.
func ( Style) () Position {
	 := .getAsPosition(alignVerticalKey)
	if  == Position(0) {
		return Top
	}
	return 
}

// GetPadding returns the style's top, right, bottom, and left padding values,
// in that order. 0 is returned for unset values.
func ( Style) () (, , ,  int) {
	return .getAsInt(paddingTopKey),
		.getAsInt(paddingRightKey),
		.getAsInt(paddingBottomKey),
		.getAsInt(paddingLeftKey)
}

// GetPaddingTop returns the style's top padding. If no value is set 0 is
// returned.
func ( Style) () int {
	return .getAsInt(paddingTopKey)
}

// GetPaddingRight returns the style's right padding. If no value is set 0 is
// returned.
func ( Style) () int {
	return .getAsInt(paddingRightKey)
}

// GetPaddingBottom returns the style's bottom padding. If no value is set 0 is
// returned.
func ( Style) () int {
	return .getAsInt(paddingBottomKey)
}

// GetPaddingLeft returns the style's left padding. If no value is set 0 is
// returned.
func ( Style) () int {
	return .getAsInt(paddingLeftKey)
}

// GetPaddingChar returns the style's padding character. If no value is set a
// space is returned.
func ( Style) () rune {
	 := .getAsRune(paddingCharKey)
	if  == 0 {
		return ' '
	}
	return 
}

// GetHorizontalPadding returns the style's left and right padding. Unset
// values are measured as 0.
func ( Style) () int {
	return .getAsInt(paddingLeftKey) + .getAsInt(paddingRightKey)
}

// GetVerticalPadding returns the style's top and bottom padding. Unset values
// are measured as 0.
func ( Style) () int {
	return .getAsInt(paddingTopKey) + .getAsInt(paddingBottomKey)
}

// GetColorWhitespace returns the style's whitespace coloring setting. If no
// value is set false is returned.
func ( Style) () bool {
	return .getAsBool(colorWhitespaceKey, false)
}

// GetMargin returns the style's top, right, bottom, and left margins, in that
// order. 0 is returned for unset values.
func ( Style) () (, , ,  int) {
	return .getAsInt(marginTopKey),
		.getAsInt(marginRightKey),
		.getAsInt(marginBottomKey),
		.getAsInt(marginLeftKey)
}

// GetMarginTop returns the style's top margin. If no value is set 0 is
// returned.
func ( Style) () int {
	return .getAsInt(marginTopKey)
}

// GetMarginRight returns the style's right margin. If no value is set 0 is
// returned.
func ( Style) () int {
	return .getAsInt(marginRightKey)
}

// GetMarginBottom returns the style's bottom margin. If no value is set 0 is
// returned.
func ( Style) () int {
	return .getAsInt(marginBottomKey)
}

// GetMarginLeft returns the style's left margin. If no value is set 0 is
// returned.
func ( Style) () int {
	return .getAsInt(marginLeftKey)
}

// GetMarginChar returns the style's padding character. If no value is set a
// space is returned.
func ( Style) () rune {
	 := .getAsRune(marginCharKey)
	if  == 0 {
		return ' '
	}
	return 
}

// GetHorizontalMargins returns the style's left and right margins. Unset
// values are measured as 0.
func ( Style) () int {
	return .getAsInt(marginLeftKey) + .getAsInt(marginRightKey)
}

// GetVerticalMargins returns the style's top and bottom margins. Unset values
// are measured as 0.
func ( Style) () int {
	return .getAsInt(marginTopKey) + .getAsInt(marginBottomKey)
}

// GetBorder returns the style's border style (type Border) and value for the
// top, right, bottom, and left in that order. If no value is set for the
// border style, Border{} is returned. For all other unset values false is
// returned.
func ( Style) () ( Border, , , ,  bool) {
	return .getBorderStyle(),
		.getAsBool(borderTopKey, false),
		.getAsBool(borderRightKey, false),
		.getAsBool(borderBottomKey, false),
		.getAsBool(borderLeftKey, false)
}

// GetBorderStyle returns the style's border style (type Border). If no value
// is set Border{} is returned.
func ( Style) () Border {
	return .getBorderStyle()
}

// GetBorderTop returns the style's top border setting. If no value is set
// false is returned.
func ( Style) () bool {
	return .getAsBool(borderTopKey, false)
}

// GetBorderRight returns the style's right border setting. If no value is set
// false is returned.
func ( Style) () bool {
	return .getAsBool(borderRightKey, false)
}

// GetBorderBottom returns the style's bottom border setting. If no value is
// set false is returned.
func ( Style) () bool {
	return .getAsBool(borderBottomKey, false)
}

// GetBorderLeft returns the style's left border setting. If no value is
// set false is returned.
func ( Style) () bool {
	return .getAsBool(borderLeftKey, false)
}

// GetBorderTopForeground returns the style's border top foreground color. If
// no value is set NoColor{} is returned.
func ( Style) () color.Color {
	return .getAsColor(borderTopForegroundKey)
}

// GetBorderRightForeground returns the style's border right foreground color.
// If no value is set NoColor{} is returned.
func ( Style) () color.Color {
	return .getAsColor(borderRightForegroundKey)
}

// GetBorderBottomForeground returns the style's border bottom foreground
// color.  If no value is set NoColor{} is returned.
func ( Style) () color.Color {
	return .getAsColor(borderBottomForegroundKey)
}

// GetBorderLeftForeground returns the style's border left foreground
// color.  If no value is set NoColor{} is returned.
func ( Style) () color.Color {
	return .getAsColor(borderLeftForegroundKey)
}

// GetBorderForegroundBlend returns the style's border blend foreground
// colors. If no value is set, nil is returned.
func ( Style) () []color.Color {
	return .getAsColors(borderForegroundBlendKey)
}

// GetBorderForegroundBlendOffset returns the style's border blend offset. If no
// value is set, 0 is returned.
func ( Style) () int {
	return .getAsInt(borderForegroundBlendOffsetKey)
}

// GetBorderTopBackground returns the style's border top background color. If
// no value is set NoColor{} is returned.
func ( Style) () color.Color {
	return .getAsColor(borderTopBackgroundKey)
}

// GetBorderRightBackground returns the style's border right background color.
// If no value is set NoColor{} is returned.
func ( Style) () color.Color {
	return .getAsColor(borderRightBackgroundKey)
}

// GetBorderBottomBackground returns the style's border bottom background
// color.  If no value is set NoColor{} is returned.
func ( Style) () color.Color {
	return .getAsColor(borderBottomBackgroundKey)
}

// GetBorderLeftBackground returns the style's border left background
// color.  If no value is set NoColor{} is returned.
func ( Style) () color.Color {
	return .getAsColor(borderLeftBackgroundKey)
}

// GetBorderTopWidth returns the width of the top border. If borders contain
// runes of varying widths, the widest rune is returned. If no border exists on
// the top edge, 0 is returned.
//
// Deprecated: This function simply calls Style.GetBorderTopSize.
func ( Style) () int {
	return .GetBorderTopSize()
}

// GetBorderTopSize returns the width of the top border. If borders contain
// runes of varying widths, the widest rune is returned. If no border exists on
// the top edge, 0 is returned.
func ( Style) () int {
	if .isBorderStyleSetWithoutSides() {
		return 1
	}
	if !.getAsBool(borderTopKey, false) {
		return 0
	}
	return .getBorderStyle().GetTopSize()
}

// GetBorderLeftSize returns the width of the left border. If borders contain
// runes of varying widths, the widest rune is returned. If no border exists on
// the left edge, 0 is returned.
func ( Style) () int {
	if .isBorderStyleSetWithoutSides() {
		return 1
	}
	if !.getAsBool(borderLeftKey, false) {
		return 0
	}
	return .getBorderStyle().GetLeftSize()
}

// GetBorderBottomSize returns the width of the bottom border. If borders
// contain runes of varying widths, the widest rune is returned. If no border
// exists on the left edge, 0 is returned.
func ( Style) () int {
	if .isBorderStyleSetWithoutSides() {
		return 1
	}
	if !.getAsBool(borderBottomKey, false) {
		return 0
	}
	return .getBorderStyle().GetBottomSize()
}

// GetBorderRightSize returns the width of the right border. If borders
// contain runes of varying widths, the widest rune is returned. If no border
// exists on the right edge, 0 is returned.
func ( Style) () int {
	if .isBorderStyleSetWithoutSides() {
		return 1
	}
	if !.getAsBool(borderRightKey, false) {
		return 0
	}
	return .getBorderStyle().GetRightSize()
}

// GetHorizontalBorderSize returns the width of the horizontal borders. If
// borders contain runes of varying widths, the widest rune is returned. If no
// border exists on the horizontal edges, 0 is returned.
func ( Style) () int {
	return .GetBorderLeftSize() + .GetBorderRightSize()
}

// GetVerticalBorderSize returns the width of the vertical borders. If
// borders contain runes of varying widths, the widest rune is returned. If no
// border exists on the vertical edges, 0 is returned.
func ( Style) () int {
	return .GetBorderTopSize() + .GetBorderBottomSize()
}

// GetInline returns the style's inline setting. If no value is set false is
// returned.
func ( Style) () bool {
	return .getAsBool(inlineKey, false)
}

// GetMaxWidth returns the style's max width setting. If no value is set 0 is
// returned.
func ( Style) () int {
	return .getAsInt(maxWidthKey)
}

// GetMaxHeight returns the style's max height setting. If no value is set 0 is
// returned.
func ( Style) () int {
	return .getAsInt(maxHeightKey)
}

// GetTabWidth returns the style's tab width setting. If no value is set 4 is
// returned which is the implicit default.
func ( Style) () int {
	return .getAsInt(tabWidthKey)
}

// GetUnderlineSpaces returns whether or not the style is set to underline
// spaces. If not value is set false is returned.
func ( Style) () bool {
	return .getAsBool(underlineSpacesKey, false)
}

// GetStrikethroughSpaces returns whether or not the style is set to strikethrough
// spaces. If not value is set false is returned.
func ( Style) () bool {
	return .getAsBool(strikethroughSpacesKey, false)
}

// GetHorizontalFrameSize returns the sum of the style's horizontal margins, padding
// and border widths.
//
// Provisional: this method may be renamed.
func ( Style) () int {
	return .GetHorizontalMargins() + .GetHorizontalPadding() + .GetHorizontalBorderSize()
}

// GetVerticalFrameSize returns the sum of the style's vertical margins, padding
// and border widths.
//
// Provisional: this method may be renamed.
func ( Style) () int {
	return .GetVerticalMargins() + .GetVerticalPadding() + .GetVerticalBorderSize()
}

// GetFrameSize returns the sum of the margins, padding and border width for
// both the horizontal and vertical margins.
func ( Style) () (,  int) {
	return .GetHorizontalFrameSize(), .GetVerticalFrameSize()
}

// GetTransform returns the transform set on the style. If no transform is set
// nil is returned.
func ( Style) () func(string) string {
	return .getAsTransform(transformKey)
}

// GetHyperlink returns the hyperlink along with its parameters. If no
// hyperlink is set, empty strings are returned.
func ( Style) () (,  string) {
	if .isSet(linkKey) {
		 = .link
	}
	if .isSet(linkParamsKey) {
		 = .linkParams
	}
	return
}

// Returns whether or not the given property is set.
func ( Style) ( propKey) bool {
	return .props.has()
}

func ( Style) ( propKey) rune {
	if !.isSet() {
		return 0
	}
	switch  { //nolint:exhaustive
	case paddingCharKey:
		return .paddingChar
	case marginCharKey:
		return .marginChar
	}
	return 0
}

func ( Style) ( propKey,  bool) bool {
	if !.isSet() {
		return 
	}
	return .attrs&int64() != 0
}

func ( Style) ( propKey) ( []color.Color) {
	if !.isSet() {
		return nil
	}

	switch  { //nolint:exhaustive
	case borderForegroundBlendKey:
		return .borderBlendFgColor
	}

	return nil
}

func ( Style) ( propKey) color.Color {
	if !.isSet() {
		return noColor
	}

	var  color.Color
	switch  { //nolint:exhaustive
	case foregroundKey:
		 = .fgColor
	case backgroundKey:
		 = .bgColor
	case marginBackgroundKey:
		 = .marginBgColor
	case borderTopForegroundKey:
		 = .borderTopFgColor
	case borderRightForegroundKey:
		 = .borderRightFgColor
	case borderBottomForegroundKey:
		 = .borderBottomFgColor
	case borderLeftForegroundKey:
		 = .borderLeftFgColor
	case borderTopBackgroundKey:
		 = .borderTopBgColor
	case borderRightBackgroundKey:
		 = .borderRightBgColor
	case borderBottomBackgroundKey:
		 = .borderBottomBgColor
	case borderLeftBackgroundKey:
		 = .borderLeftBgColor
	case underlineColorKey:
		 = .ulColor
	}

	if  != nil {
		return 
	}

	return noColor
}

func ( Style) ( propKey) int {
	if !.isSet() {
		return 0
	}
	switch  { //nolint:exhaustive
	case widthKey:
		return .width
	case heightKey:
		return .height
	case paddingTopKey:
		return .paddingTop
	case paddingRightKey:
		return .paddingRight
	case paddingBottomKey:
		return .paddingBottom
	case paddingLeftKey:
		return .paddingLeft
	case marginTopKey:
		return .marginTop
	case marginRightKey:
		return .marginRight
	case marginBottomKey:
		return .marginBottom
	case marginLeftKey:
		return .marginLeft
	case borderForegroundBlendOffsetKey:
		return .borderForegroundBlendOffset
	case maxWidthKey:
		return .maxWidth
	case maxHeightKey:
		return .maxHeight
	case tabWidthKey:
		return .tabWidth
	}
	return 0
}

func ( Style) ( propKey) Position {
	if !.isSet() {
		return Position(0)
	}
	switch  { //nolint:exhaustive
	case alignHorizontalKey:
		return .alignHorizontal
	case alignVerticalKey:
		return .alignVertical
	}
	return Position(0)
}

func ( Style) () Border {
	if !.isSet(borderStyleKey) {
		return noBorder
	}
	return .borderStyle
}

func ( Style) (propKey) func(string) string {
	if !.isSet(transformKey) {
		return nil
	}
	return .transform
}

// Split a string into lines, additionally returning the size of the widest
// line.
func ( string) ( []string,  int) {
	 = strings.ReplaceAll(, "\t", "    ")
	 = strings.ReplaceAll(, "\r\n", "\n")
	 = strings.Split(, "\n")

	for ,  := range  {
		 := ansi.StringWidth()
		if  <  {
			 = 
		}
	}

	return , 
}

// isBorderStyleSetWithoutSides returns true if the border style is set but no
// sides are set. This is used to determine if the border should be rendered by
// default.
func ( Style) () bool {
	var (
		    = .getBorderStyle()
		    = .isSet(borderTopKey)
		  = .isSet(borderRightKey)
		 = .isSet(borderBottomKey)
		   = .isSet(borderLeftKey)
	)
	return  != noBorder && !( ||  ||  || ) //nolint:staticcheck
}