<commit_before>import { Component, OnInit } from '@angular/core';
import {
  LayerStateService, MorphabilityStatus, Event as LayerStateEvent
} from '../services/layerstate.service';
import { CanvasType } from '../CanvasType';
import { AvdSerializer } from '../scripts/parsers';
import * as $ from 'jquery';
import { AnimationTarget } from '../scripts/animation';

@Component({
  selector: 'app-toolbar',
  templateUrl: './toolbar.component.html',
  styleUrls: ['./toolbar.component.scss']
})
export class ToolbarComponent implements OnInit {
  isMorphable = false;

  constructor(private layerStateService: LayerStateService) { }

  ngOnInit() {
    this.layerStateService.addListener(CanvasType.Start, (event: LayerStateEvent) => {
      this.isMorphable = event.morphabilityStatus === MorphabilityStatus.Morphable;
    });
    this.layerStateService.addListener(CanvasType.End, (event: LayerStateEvent) => {
      this.isMorphable = event.morphabilityStatus === MorphabilityStatus.Morphable;
    });
  }

  private onExportClick() {
    const startVectorLayer = this.layerStateService.getVectorLayer(CanvasType.Start);
    const startLayer = this.layerStateService.getActivePathLayer(CanvasType.Start);
    const fromValue = startLayer.pathData.pathString;
    const endLayer = this.layerStateService.getActivePathLayer(CanvasType.End);
    const toValue = endLayer.pathData.pathString;
    const xmlStr = AvdSerializer.vectorLayerAnimationToAvdXmlString(startVectorLayer,
      new AnimationTarget(
        startLayer.id,
        fromValue,
        toValue,
      ));
    this.downloadFile(xmlStr, `ShapeShifterAvd.xml`);
  }

  private downloadFile(content: string, filename: string) {
    const blob = new Blob([content], {type: 'octet/stream'});;
    const url = window.URL.createObjectURL(blob);
    const anchor = $('<a>').hide().appendTo(document.body);
    anchor.attr({ href: url, download: filename });
    anchor.get(0).click();
    window.URL.revokeObjectURL(url);
  }
}<commit_msg>update lint<commit_after>import { Component, OnInit } from '@angular/core';
import {
  LayerStateService, MorphabilityStatus, Event as LayerStateEvent
} from '../services/layerstate.service';
import { CanvasType } from '../CanvasType';
import { AvdSerializer } from '../scripts/parsers';
import * as $ from 'jquery';
import { AnimationTarget } from '../scripts/animation';

@Component({
  selector: 'app-toolbar',
  templateUrl: './toolbar.component.html',
  styleUrls: ['./toolbar.component.scss']
})
export class ToolbarComponent implements OnInit {
  isMorphable = false;

  constructor(private layerStateService: LayerStateService) { }

  ngOnInit() {
    this.layerStateService.addListener(CanvasType.Start, (event: LayerStateEvent) => {
      this.isMorphable = event.morphabilityStatus === MorphabilityStatus.Morphable;
    });
    this.layerStateService.addListener(CanvasType.End, (event: LayerStateEvent) => {
      this.isMorphable = event.morphabilityStatus === MorphabilityStatus.Morphable;
    });
  }

  onExportClick() {
    const startVectorLayer = this.layerStateService.getVectorLayer(CanvasType.Start);
    const startLayer = this.layerStateService.getActivePathLayer(CanvasType.Start);
    const fromValue = startLayer.pathData.pathString;
    const endLayer = this.layerStateService.getActivePathLayer(CanvasType.End);
    const toValue = endLayer.pathData.pathString;
    const xmlStr = AvdSerializer.vectorLayerAnimationToAvdXmlString(startVectorLayer,
      new AnimationTarget(
        startLayer.id,
        fromValue,
        toValue,
      ));
    this.downloadFile(xmlStr, `ShapeShifterAvd.xml`);
  }

  private downloadFile(content: string, filename: string) {
    const blob = new Blob([content], {type: 'octet/stream'});
    const url = window.URL.createObjectURL(blob);
    const anchor = $('<a>').hide().appendTo(document.body);
    anchor.attr({ href: url, download: filename });
    anchor.get(0).click();
    window.URL.revokeObjectURL(url);
  }
}
{'fraction_non_alphanumeric': 0.12785732228083396, 'fraction_numerical': 0.0005023863350916855, 'mean_word_length': 4.447332421340629, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 6}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1769817', 'n_tokens_mistral': 1183, 'n_tokens_neox': 1155, 'n_words': 220}