<commit_before>// indexOf polyfill
// Minified version of this:
// https://stackoverflow.com/a/35054662/1611058
if (!Array.prototype.indexOf) {
  Array.prototype.indexOf=function(r){var t=this.length>0,i=Number(arguments[1])||0;for((i=i<0?Math.ceil(i):Math.floor(i))<0&&(i+=t);i<t;i++)if(i in this&&this[i]===r)return i;return-1};
}

$(document).ready(function(){

//IE8 tabs code
	var //hooks
	_module = $('.JS-tabs'),
	_content = $('.JS-tabs__content'),
	_triggers = $('.JS-tabs__trigger');

	var //classes
	active_ = '-active';

	//module functionality

	function tabs(elem) {

		var This = this;
		this.elem = elem;
		this.$elem = $(elem);
		this.$triggers = this.$elem.find('.JS-tabs__trigger');
		this.$content = this.$elem.find('.JS-tabs__content');

		this.$triggers.click(function (e) {
			e.preventDefault();
			switchTab($(this));
		});

		if (typeof window.localStorage.activeTab !== 'undefined') {
			switchTab(window.localStorage.activeTab);
		} else {
			switchTab(0);
		}

		function switchTab(tab) {

			var isString = typeof tab === 'string';

			if ($.isNumeric(tab) || isString) {
				if (isString) {
					tab = ['classes','mixin','both'].indexOf(tab);
				}
				tab = This.$triggers.eq(tab);
			}

			var pos = tab.parent().index();

			This.$triggers.filter('.' + active_).removeClass(active_);
			tab.addClass(active_);

			This.$content.hide();
			This.$content.eq(pos).show();

		}
	}

	_module.each(function(e){
		var tabset = new tabs(this);
	})



	// CODE MODIFICATION

	var get_format = function get_format($wrapper) {
		var text = $wrapper.text();
		var isMixin = /mixin|include/i.test(text);
		return isMixin ? 'mixin' : 'classes';
	};
	
	function DemoCode(elem) {

		this.$wrapper = $(elem);

		this.get_type = function(){
			var classes = this.$wrapper.attr('class');
			var result = /\s([A-z]+)$/.exec(classes);
			return result[1];
		}

		this.add_html_class = function(){
			var _this = this;

			var html = _this.$wrapper.html();

			var regex = /&lt;div class="grid grid--cols-([A-z0-9 -]*)"&gt;/gi;
			var replacement = html.replace(regex, '&lt;div class="grid grid--cols-$1 grid--wrap"&gt;');
			console.log('original', html);
			console.log('replacement', replacement);
			_this.$wrapper.html(replacement);
		}

		this.add_mixin_wrap_setting = function(){<commit_msg>disabling html transform preview logs<commit_after>// indexOf polyfill
// Minified version of this:
// https://stackoverflow.com/a/35054662/1611058
if (!Array.prototype.indexOf) {
  Array.prototype.indexOf=function(r){var t=this.length>0,i=Number(arguments[1])||0;for((i=i<0?Math.ceil(i):Math.floor(i))<0&&(i+=t);i<t;i++)if(i in this&&this[i]===r)return i;return-1};
}

$(document).ready(function(){

//IE8 tabs code
	var //hooks
	_module = $('.JS-tabs'),
	_content = $('.JS-tabs__content'),
	_triggers = $('.JS-tabs__trigger');

	var //classes
	active_ = '-active';

	//module functionality

	function tabs(elem) {

		var This = this;
		this.elem = elem;
		this.$elem = $(elem);
		this.$triggers = this.$elem.find('.JS-tabs__trigger');
		this.$content = this.$elem.find('.JS-tabs__content');

		this.$triggers.click(function (e) {
			e.preventDefault();
			switchTab($(this));
		});

		if (typeof window.localStorage.activeTab !== 'undefined') {
			switchTab(window.localStorage.activeTab);
		} else {
			switchTab(0);
		}

		function switchTab(tab) {

			var isString = typeof tab === 'string';

			if ($.isNumeric(tab) || isString) {
				if (isString) {
					tab = ['classes','mixin','both'].indexOf(tab);
				}
				tab = This.$triggers.eq(tab);
			}

			var pos = tab.parent().index();

			This.$triggers.filter('.' + active_).removeClass(active_);
			tab.addClass(active_);

			This.$content.hide();
			This.$content.eq(pos).show();

		}
	}

	_module.each(function(e){
		var tabset = new tabs(this);
	})



	// CODE MODIFICATION

	var get_format = function get_format($wrapper) {
		var text = $wrapper.text();
		var isMixin = /mixin|include/i.test(text);
		return isMixin ? 'mixin' : 'classes';
	};
	
	function DemoCode(elem) {

		this.$wrapper = $(elem);

		this.get_type = function(){
			var classes = this.$wrapper.attr('class');
			var result = /\s([A-z]+)$/.exec(classes);
			return result[1];
		}

		this.add_html_class = function(){
			var _this = this;

			var html = _this.$wrapper.html();

			var regex = /&lt;div class="grid grid--cols-([A-z0-9 -]*)"&gt;/gi;
			var replacement = html.replace(regex, '&lt;div class="grid grid--cols-$1 grid--wrap"&gt;');
			// console.log('original', html);
			// console.log('replacement', replacement);
			_this.$wrapper.html(replacement);
		}

		this.add_mixin_wrap_setting = function(){
{'fraction_non_alphanumeric': 0.20137693631669534, 'fraction_numerical': 0.01161790017211704, 'mean_word_length': 3.7682051282051283, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 5, 'https://': 2, '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': '784890', 'n_tokens_mistral': 1874, 'n_tokens_neox': 1635, 'n_words': 291}