<commit_before>###

  TopUI

  An agnostic sort of "tool" that doesn't care what tool is selected.
  Specifically for dealing with top UI elements like utilities.

  Operates much like a Tool object, but the keys are classnames of top UI objects.

###

ui.topUI =

  _tooltipShowTimeout: undefined
  _tooltipHideTimeout: undefined
  _$tooltipVisible:    undefined

  dispatch: (e, event) ->
    for cl in e.target.className.split(" ")
      @[event]["." + cl]?(e)
    @[event]["#" + e.target.id]?(e)

  hover:
    "slider knob": (e) ->

    ".tool-button": (e) ->
      $tooltip = $(e.target).find(".tool-info")
      $visible = ui.topUI._$tooltipVisible

      if $visible? and $visible.text() == $tooltip.text()
        return clearTimeout ui.topUI._tooltipHideTimeout

      if $visible?
        clearTimeout ui.topUI._tooltipHideTimeout
        $visible.hide()
        $tooltip.show()
        ui.topUI._$tooltipVisible = $tooltip
      else
        clearTimeout ui.topUI._tooltipShowTimeout
        ui.topUI._tooltipShowTimeout = setTimeout =>
          $tooltip.fadeIn(50)
          ui.topUI._$tooltipVisible = $tooltip
        , 400

  unhover:
    "slider knob": ->

    ".tool-button": (e) ->
      $tooltip = $(e.target).find(".tool-info")
      $visible = ui.topUI._$tooltipVisible

      if $visible?
        if $visible.text() == $tooltip.text()
          ui.topUI._tooltipHideTimeout = setTimeout =>
            $tooltip.fadeOut(50)
            ui.topUI._$tooltipVisible = undefined
          , 300
      else
        clearTimeout ui.topUI._tooltipShowTimeout

  click:
    ".swatch": (e) ->
      return if e.target.parentNode.className == "swatch-duo"
      $swatch = $(e.target)
      offset = $swatch.offset()<commit_msg>Longer delay<commit_after>###

  TopUI

  An agnostic sort of "tool" that doesn't care what tool is selected.
  Specifically for dealing with top UI elements like utilities.

  Operates much like a Tool object, but the keys are classnames of top UI objects.

###

ui.topUI =

  _tooltipShowTimeout: undefined
  _tooltipHideTimeout: undefined
  _$tooltipVisible:    undefined

  dispatch: (e, event) ->
    for cl in e.target.className.split(" ")
      @[event]["." + cl]?(e)
    @[event]["#" + e.target.id]?(e)

  hover:
    "slider knob": (e) ->

    ".tool-button": (e) ->
      $tooltip = $(e.target).find(".tool-info")
      $visible = ui.topUI._$tooltipVisible

      if $visible? and $visible.text() == $tooltip.text()
        return clearTimeout ui.topUI._tooltipHideTimeout

      if $visible?
        clearTimeout ui.topUI._tooltipHideTimeout
        $visible.hide()
        $tooltip.show()
        ui.topUI._$tooltipVisible = $tooltip
      else
        clearTimeout ui.topUI._tooltipShowTimeout
        ui.topUI._tooltipShowTimeout = setTimeout =>
          $tooltip.fadeIn(50)
          ui.topUI._$tooltipVisible = $tooltip
        , 500

  unhover:
    "slider knob": ->

    ".tool-button": (e) ->
      $tooltip = $(e.target).find(".tool-info")
      $visible = ui.topUI._$tooltipVisible

      if $visible?
        if $visible.text() == $tooltip.text()
          ui.topUI._tooltipHideTimeout = setTimeout =>
            $tooltip.fadeOut(50)
            ui.topUI._$tooltipVisible = undefined
          , 300
      else
        clearTimeout ui.topUI._tooltipShowTimeout

  click:
    ".swatch": (e) ->
      return if e.target.parentNode.className == "swatch-duo"
      $swatch = $(e.target)
      offset = $swatch.offset()
{'fraction_non_alphanumeric': 0.13410071942446042, 'fraction_numerical': 0.0057553956834532375, 'mean_word_length': 2.4145383104125737, 'pattern_counts': {'":': 10, '<': 3, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '743935', 'n_tokens_mistral': 1105, 'n_tokens_neox': 1058, 'n_words': 250}