<commit_before>{% if plugins.call_tool[ref].active %}
  <div id='call-tool-component'></div>

  <script>
    $(document).ready(function() {
      var data = _.clone(window.champaign.personalization.callTool['{{ref}}']);
      data.trackingParams = _.pick(window.champaign.personalization.urlParams,
                                   'source', 'akid', 'referring_akid',
                                   'referrer_id', 'rid');
      data.countryCode = window.champaign.personalization.member.country;
      data.filters = window.champaign.personalization.urlParams.filters;
      data.onSuccess = function(selectedTarget) {
        var followUpUrl = window.URI("{{ follow_up_url }}");
        followUpUrl.addQuery({
          'target[name]': selectedTarget.name,
          'target[title]': selectedTarget.title
        });
        window.location.href = followUpUrl.toString();
      };

      mountCallTool('call-tool-component', data);
    });
  </script>
{% endif %}<commit_msg>accept filters as filters[field]= or filters_field=<commit_after>{% if plugins.call_tool[ref].active %}
  <div id='call-tool-component'></div>

  <script>
    $(document).ready(function() {
      var parseFilters = function(params) {
        if (!!params.filters) return params.filters;
        var filters = {};
        for (var key in params) {
          if (key.indexOf('filters_') === 0 || key.indexOf('filter_') === 0) {
            var shortKey = key.replace(/filters?_/i, '');
            filters[shortKey] = params[key];
          }
        }
        return filters;
      }

      var data = _.clone(window.champaign.personalization.callTool['{{ref}}']);
      data.trackingParams = _.pick(window.champaign.personalization.urlParams,
                                   'source', 'akid', 'referring_akid',
                                   'referrer_id', 'rid');
      data.countryCode = window.champaign.personalization.member.country;
      data.filters = parseFilters(window.champaign.personalization.urlParams);
      data.onSuccess = function(selectedTarget) {
        var followUpUrl = window.URI("{{ follow_up_url }}");
        followUpUrl.addQuery({
          'target[name]': selectedTarget.name,
          'target[title]': selectedTarget.title
        });
        window.location.href = followUpUrl.toString();
      };

      mountCallTool('call-tool-component', data);
    });
  </script>
{% endif %}
{'fraction_non_alphanumeric': 0.14945878434637802, 'fraction_numerical': 0.0008326394671107411, 'mean_word_length': 2.4927325581395348, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2983', 'n_tokens_mistral': 697, 'n_tokens_neox': 677, 'n_words': 107}