<commit_before>L.DistortableImage = L.DistortableImage || {};
L.distortableImage = L.DistortableImage;

L.DistortableImage.action_map = {};

L.EditAction = L.Toolbar2.Action.extend({
  options: {
    toolbarIcon: {
      svg: false,
      html: '',
      className: '',
      tooltip: '',
    },
  },

  initialize(map, overlay, options) {
    this._overlay = overlay;
    this._map = map;

    L.setOptions(this, options);
    L.Toolbar2.Action.prototype.initialize.call(this, options);

    this._injectIconSet();
  },

  _createIcon(toolbar, container, args) {
    var iconOptions = this.options.toolbarIcon;
    var className = iconOptions.className;
    var edit = this._overlay.editing;

    this.toolbar = toolbar;
    this._icon = L.DomUtil.create('li', '', container);
    this._link = L.DomUtil.create('a', '', this._icon);

    if (iconOptions.svg) {
      this._link.innerHTML = L.IconUtil.create(iconOptions.html);
    } else {
      this._link.innerHTML = iconOptions.html;
    }

    this._link.setAttribute('href', '#');
    this._link.setAttribute('title', iconOptions.tooltip);
    this._link.setAttribute('role', 'button');

    L.DomUtil.addClass(this._link, this.constructor.baseClass);

    if (className) {
      L.DomUtil.addClass(this._link, className);
      if (className === 'disabled') {
        L.DomUtil.addClass(this._icon, className);
      }
      if (className === edit._mode) {
        L.DomUtil.addClass(this._link, 'selected-mode');
      } else {
        L.DomUtil.removeClass(this._link, 'selected-mode');
      }
    }

    L.DomEvent.on(this._link, 'click', this.enable, this);
    L.DomEvent.on(this._overlay, 'update', () => {
      var match = this._link.innerHTML.match(/xlink:href="#restore"/);
      if (match && match.length === 1) { this._enableAction(); }
    });

    /* Add secondary toolbar */
    this._addSubToolbar(toolbar, this._icon, args);
  },

  _injectIconSet() {
    if (document.querySelector('#iconset')) {
      return;
    }

    var el = document.createElement('div');<commit_msg>feat: update var with const or let<commit_after>L.DistortableImage = L.DistortableImage || {};
L.distortableImage = L.DistortableImage;

L.DistortableImage.action_map = {};

L.EditAction = L.Toolbar2.Action.extend({
  options: {
    toolbarIcon: {
      svg: false,
      html: '',
      className: '',
      tooltip: '',
    },
  },

  initialize(map, overlay, options) {
    this._overlay = overlay;
    this._map = map;

    L.setOptions(this, options);
    L.Toolbar2.Action.prototype.initialize.call(this, options);

    this._injectIconSet();
  },

  _createIcon(toolbar, container, args) {
    const iconOptions = this.options.toolbarIcon;
    const className = iconOptions.className;
    const edit = this._overlay.editing;

    this.toolbar = toolbar;
    this._icon = L.DomUtil.create('li', '', container);
    this._link = L.DomUtil.create('a', '', this._icon);

    if (iconOptions.svg) {
      this._link.innerHTML = L.IconUtil.create(iconOptions.html);
    } else {
      this._link.innerHTML = iconOptions.html;
    }

    this._link.setAttribute('href', '#');
    this._link.setAttribute('title', iconOptions.tooltip);
    this._link.setAttribute('role', 'button');

    L.DomUtil.addClass(this._link, this.constructor.baseClass);

    if (className) {
      L.DomUtil.addClass(this._link, className);
      if (className === 'disabled') {
        L.DomUtil.addClass(this._icon, className);
      }
      if (className === edit._mode) {
        L.DomUtil.addClass(this._link, 'selected-mode');
      } else {
        L.DomUtil.removeClass(this._link, 'selected-mode');
      }
    }

    L.DomEvent.on(this._link, 'click', this.enable, this);
    L.DomEvent.on(this._overlay, 'update', () => {
      const match = this._link.innerHTML.match(/xlink:href="#restore"/);
      if (match && match.length === 1) { this._enableAction(); }
    });

    /* Add secondary toolbar */
    this._addSubToolbar(toolbar, this._icon, args);
  },

  _injectIconSet() {
    if (document.querySelector('#iconset')) {
      return;
    }

    let el = document.createElement('div');
{'fraction_non_alphanumeric': 0.16210322267991276, 'fraction_numerical': 0.001453840562151684, 'mean_word_length': 2.9884057971014495, 'pattern_counts': {'":': 0, '<': 3, '<?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': '2205950', 'n_tokens_mistral': 1322, 'n_tokens_neox': 1293, 'n_words': 213}