<commit_before>(function () {

  var requestAnimationFrame = window.requestAnimationFrame ||
                              window.mozRequestAnimationFrame ||
                              window.webkitRequestAnimationFrame ||
                              window.msRequestAnimationFrame ||
                              function (fn) { setTimeout(fn, 16); };

  function delegate(selector, handler) {
    return function(e) {
      var target = e.target;
      var delegateEl = e.currentTarget;
      var matches = delegateEl.querySelectorAll(selector);
      for (var el = target; el.parentNode && el !== delegateEl; el = el.parentNode) {
        for (var i = 0; i < matches.length; i++) {
          if (matches[i] === el) {
            handler.call(el, e);
            return;
          }
        }
      }
    };
  }

  // just prefix for webkit
  var skipTransition = function(element, fn, bind){
    element.style.webkitTransitionProperty = 'none';
    element.style.transitionProperty = 'none';
    var callback = fn ? fn.call(bind) : null;
    return requestAnimationFrame(function(){
      requestAnimationFrame(function(){
        element.style.webkitTransitionProperty = '';
        element.style.transitionProperty = '';
        if (callback) {
          requestAnimationFrame(callback);
        }
      });
    });
  };

  function reveal(e) {
    var flipBox = e.currentTarget;
    if (this.parentNode === flipBox) {
      if (this.parentNode.firstElementChild === this) {
        flipBox.showFront();
      }
      else if (this.parentNode.lastElementChild === this) {
        flipBox.showBack();
      }
    }
  }

  var BrickFlipboxElementPrototype = Object.create(HTMLElement.prototype);

  BrickFlipboxElementPrototype.attachedCallback = function () {
    // reveal a side when reveal a reveal event is triggered on it.
    this.revealEventHandler = delegate("x-flipbox > *", reveal);
    this.addEventListener("reveal", this.revealEventHandler);

    // default to right.
    var direction = this.getAttribute('direction') || 'right';
    this.direction = direction;

    // instantiate sides without initial flip animation
    console.log(this.firstElementChild);
    if (this.firstElementChild) {
      skipTransition(this.firstElementChild, function () {});
      // fire an flipend Event when the transition ended.
      // only on the first child do avoid firing twice
      this.transitionendEventHandler = function(e) {
        var flipBox = e.target.parentNode;
        var event = new CustomEvent('flipend', {'bubbles': true});
        flipBox.dispatchEvent(event);
        e.stopPropagation();
      };
      this.firstElementChild.addEventListener('transitionend', this.transitionendEventHandler);
    }
    if (this.lastElementChild) {
      skipTransition(this.lastElementChild, function () {});
    }
  };

  BrickFlipboxElementPrototype.detachedCallback = function () {
    // cleanup event listeners
    this.removeEventListener('reveal',this.revealEventHandler);
    if (this.firstElementChild && this.transitionendEventHandler) {
      this.firstElementChild.removeEventListener('transitionend',this.transitionendEventHandler);
    }<commit_msg>removed logs<commit_after>(function () {

  var requestAnimationFrame = window.requestAnimationFrame ||
                              window.mozRequestAnimationFrame ||
                              window.webkitRequestAnimationFrame ||
                              window.msRequestAnimationFrame ||
                              function (fn) { setTimeout(fn, 16); };

  function delegate(selector, handler) {
    return function(e) {
      var target = e.target;
      var delegateEl = e.currentTarget;
      var matches = delegateEl.querySelectorAll(selector);
      for (var el = target; el.parentNode && el !== delegateEl; el = el.parentNode) {
        for (var i = 0; i < matches.length; i++) {
          if (matches[i] === el) {
            handler.call(el, e);
            return;
          }
        }
      }
    };
  }

  // just prefix for webkit
  var skipTransition = function(element, fn, bind){
    element.style.webkitTransitionProperty = 'none';
    element.style.transitionProperty = 'none';
    var callback = fn ? fn.call(bind) : null;
    return requestAnimationFrame(function(){
      requestAnimationFrame(function(){
        element.style.webkitTransitionProperty = '';
        element.style.transitionProperty = '';
        if (callback) {
          requestAnimationFrame(callback);
        }
      });
    });
  };

  function reveal(e) {
    var flipBox = e.currentTarget;
    if (this.parentNode === flipBox) {
      if (this.parentNode.firstElementChild === this) {
        flipBox.showFront();
      }
      else if (this.parentNode.lastElementChild === this) {
        flipBox.showBack();
      }
    }
  }

  var BrickFlipboxElementPrototype = Object.create(HTMLElement.prototype);

  BrickFlipboxElementPrototype.attachedCallback = function () {
    // reveal a side when reveal a reveal event is triggered on it.
    this.revealEventHandler = delegate("x-flipbox > *", reveal);
    this.addEventListener("reveal", this.revealEventHandler);

    // default to right.
    var direction = this.getAttribute('direction') || 'right';
    this.direction = direction;

    // instantiate sides without initial flip animation
    if (this.firstElementChild) {
      skipTransition(this.firstElementChild, function () {});
      // fire an flipend Event when the transition ended.
      // only on the first child do avoid firing twice
      this.transitionendEventHandler = function(e) {
        var flipBox = e.target.parentNode;
        var event = new CustomEvent('flipend', {'bubbles': true});
        flipBox.dispatchEvent(event);
        e.stopPropagation();
      };
      this.firstElementChild.addEventListener('transitionend', this.transitionendEventHandler);
    }
    if (this.lastElementChild) {
      skipTransition(this.lastElementChild, function () {});
    }
  };

  BrickFlipboxElementPrototype.detachedCallback = function () {
    // cleanup event listeners
    this.removeEventListener('reveal',this.revealEventHandler);
    if (this.firstElementChild && this.transitionendEventHandler) {
      this.firstElementChild.removeEventListener('transitionend',this.transitionendEventHandler);
    }
{'fraction_non_alphanumeric': 0.11246440999683645, 'fraction_numerical': 0.0009490667510281556, 'mean_word_length': 2.6570271833429726, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '2931186', 'n_tokens_mistral': 1658, 'n_tokens_neox': 1653, 'n_words': 356}