<commit_before>import { tag, WeElement, h, extractClass } from 'omi'
import * as To2To from 'to2to'


interface Props {
  easing: "quadratic-in" | "quadratic-out" | "quadratic-in-out" | "cubic-in" | "cubic-out" | "cubic-in-out" | "quartic-in" | "quartic-out" | "quartic-in-out" | "quintic-in" | "quintic-out" | "quintic-in-out" | "sinusoidal-in" | "sinusoidal-out" | "sinusoidal-in-out" | "exponential-in" | "exponential-out" | "exponential-in-out" | "circular-in" | "circular-out" | "circular-in-out" | "elastic-in" | "elastic-out" | "elastic-in-out" | "back-in" | "back-out" | "back-in-out" | "bounce-in" | "bounce-out" | "bounce-in-out" //easing graphs http://tweenjs.github.io/tween.js/examples/03_graphs.html
}

interface Data {

}


@tag('m-to')
export default class To extends WeElement<Props, Data>{

  static propTypes = {
    from: Object,
    to: Object,
    duration: Number,
    out: Object,
    easing: String
  }

  to = null

  receiveProps(props, data, preProps) {
    let restart = false
    for (let key in props.from) {
      if (props.from[key] !== preProps.from[key]) {
        restart = true
        break
      }
    }

    if (!restart) {
      for (let key in props.to) {
        if (props.to[key] !== preProps.to[key]) {
          restart = true
          break
        }
      }
    }

    if (restart) {

      if (this.to) this.to.stop()
      this.to = To2To.get(props.from)
        .to(props.to, props.duration,To2To.easing[npn(props.easing)]||To2To.easing.linear)
        .begin(()=>{
          this.fire('begin')
        })
        .progress((obj) => {
          //@ts-ignore
          Object.assign(props.out, obj)
          this.fire('progress')
        })
        .end(()=>{
          this.fire('end')
        })
        .start()
    }
  }

  render() {
    return (
      <slot></slot>
    )
  }<commit_msg>omim - build m-to<commit_after>import { tag, WeElement, h, extractClass } from 'omi'
import * as To2To from 'to2to'


interface Props {
  easing: "quadratic-in" | "quadratic-out" | "quadratic-in-out" | "cubic-in" | "cubic-out" | "cubic-in-out" | "quartic-in" | "quartic-out" | "quartic-in-out" | "quintic-in" | "quintic-out" | "quintic-in-out" | "sinusoidal-in" | "sinusoidal-out" | "sinusoidal-in-out" | "exponential-in" | "exponential-out" | "exponential-in-out" | "circular-in" | "circular-out" | "circular-in-out" | "elastic-in" | "elastic-out" | "elastic-in-out" | "back-in" | "back-out" | "back-in-out" | "bounce-in" | "bounce-out" | "bounce-in-out" //easing graphs http://tweenjs.github.io/tween.js/examples/03_graphs.html
}

interface Data {

}


@tag('m-to')
export default class To extends WeElement<Props, Data>{

  static propTypes = {
    from: Object,
    to: Object,
    duration: Number,
    out: Object,
    easing: String
  }

  to = null

  receiveProps(props, data, preProps) {
    let restart = false
    for (let key in props.from) {
      if (props.from[key] !== preProps.from[key]) {
        restart = true
        break
      }
    }

    if (!restart) {
      for (let key in props.to) {
        if (props.to[key] !== preProps.to[key]) {
          restart = true
          break
        }
      }
    }

    if (restart) {

      if (this.to) this.to.stop()
      this.to = To2To.get(props.from)
        .to(props.to, props.duration, To2To.easing[npn(props.easing)] || To2To.easing.linear)
        .begin(() => {
          this.fire('begin')
        })
        .progress((obj) => {
          //@ts-ignore
          Object.assign(props.out, obj)
          this.fire('progress')
        })
        .end(() => {
          this.fire('end')
        })
        .start()
    }
  }

  render() {
    return (
      <slot></slot>
    )
  }
{'fraction_non_alphanumeric': 0.1794109700081059, 'fraction_numerical': 0.0037827614158335585, 'mean_word_length': 2.216333622936577, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 15, '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': '7366635', 'n_tokens_mistral': 1429, 'n_tokens_neox': 1389, 'n_words': 252}