<commit_before>(function(){
	'use strict'
	var selectTreeSelector = ".selectTree", 
	get = {
		// selectors tree dom - get.item/all("seletor",fatherDom) 
	 	item: function(el, root){
			if(typeof(root)!="undefined") return root.querySelector(el);
			return document.querySelector(el);
	 	},
	 	all: function(el, root){
	 		if(typeof(root)!="undefined") return root.querySelectorAll(el);
	 		return document.querySelectorAll(el);
	 	},
		searchKey: function(arr, key, value){
			for (var i = arr.length; i--;) {
				if(arr[i][key]==value) return i;
			};
			return null;
		}
	},
	selectTree = (function(el){
		var app = {
			active: false,
			disabled: false,
			list: [],
			fathers: [],
			el: {},
			value: null,
			empty: "Sem itens para os pai(s) selecionados", // DEFAULT MESSAGE EMPTY
			beforeOptions: "", //DEFAULT AFTER OPTION
			_getValueFather: function(key){
				var temp = get.item('select[data-shr-id="'+key+'"]'),
				val;
				if(temp===null) {
					throw "SelectTree: Father ("+key+") not found";
				}
				val = temp.value;
				app.fathers.push({'id': key,'value': val,'el': temp});
			},
			_updateValueFather: function(){
				var fathers = app.fathers;
				app.fathers = [];
				for (var i = fathers.length; i--;) {
					app._getValueFather(fathers[i].id);
				}
				app._checkDisabled();
			},
			_checkDisabled: function(){
				var disabled = false;
				for (var i = app.fathers.length; i--;) {
					if(app.fathers[i].value==="choose")
						disabled = true;
				}
				app.disabled = disabled;
				if(app.disabled) return app.el.setAttribute("disabled","on");
				app.el.removeAttribute("disabled");
			},
			_filter: function(option){
				for (var i = app.fathers.length; i--;) {
					if(app.fathers[i].value!="all" && app.fathers[i].value!="choose"){
						if(typeof(option[app.fathers[i].id])==="undefined") return false;
						// CONFERIR LANCE DE COMPRAÇÂO DE STRING COM NUMBER DO INDEX OF
						if(option[app.fathers[i].id].indexOf(app.fathers[i].value)===-1) return false; 
					}
				}
				return true;
			},
			_clearSelected: function(){
				for (var i = app.list.length; i--;) {
					if(app.list[i].html.indexOf('selected')) {
						app.list[i].html = app.list[i].html.replace('selected="on"', "");
						app.list[i].html = app.list[i].html.replace("selected", "");
					}
				}
			},
			buildOptions: function(){
				var string = "";
				for (var i = app.list.length; i--;) {
					if(app._filter(app.list[i])) 
						string = app.list[i].html + string;
				};
				if(string===""){
					string = '<option disabled="on" value="" selected="on">'+app.empty+'</option>';
				} else {
					string = app.beforeOptions.html + string;
				}
				app.el.innerHTML = string;
			},
			statusSelect: function(){
				var dataset = app.el.dataset;
				if(dataset.shrValue){
					app.value = dataset['shrValue'];
					delete dataset['shrValue'];
				} 
				if(dataset.shrEmpty) app.empty = dataset.shrEmpty;
				app._checkDisabled();
			},
			setEvents: function(){
				var flag = true;
				for (var i = app.fathers.length; i--;) {
					app.fathers[i].el.addEventListener('change',function(){
						app._updateValueFather();
						app.buildOptions();
					},false);
					app.fathers[i].el.addEventListener('DOMSubtreeModified',function(){
						//EVENTO @DOMSubtreeModified É DISPARADO DUAS VEZES
						//FLAG e SeTimeout PARA NÃO EXECUTAR DUAS VEZES
						if(flag){ 
							flag = false;
							setTimeout(function(){
								app._updateValueFather();
								app.buildOptions();
								flag = true;	
							},20);
						}<commit_msg>Correções de bug no disabled de filhoi vazio.<commit_after>(function(){
	'use strict'
	var selectTreeSelector = ".selectTree", 
	get = {
		// selectors tree dom - get.item/all("seletor",fatherDom) 
	 	item: function(el, root){
			if(typeof(root)!="undefined") return root.querySelector(el);
			return document.querySelector(el);
	 	},
	 	all: function(el, root){
	 		if(typeof(root)!="undefined") return root.querySelectorAll(el);
	 		return document.querySelectorAll(el);
	 	},
		searchKey: function(arr, key, value){
			for (var i = arr.length; i--;) {
				if(arr[i][key]==value) return i;
			};
			return null;
		}
	},
	selectTree = (function(el){
		var app = {
			active: false,
			disabled: false,
			list: [],
			fathers: [],
			el: {},
			value: null,
			empty: "Sem itens para os pai(s) selecionados", // DEFAULT MESSAGE EMPTY
			beforeOptions: "", //DEFAULT AFTER OPTION
			_getValueFather: function(key){
				var temp = get.item('select[data-shr-id="'+key+'"]'),
				val;
				if(temp===null) {
					throw "SelectTree: Father ("+key+") not found";
				}
				val = temp.value;
				app.fathers.push({'id': key,'value': val,'el': temp});
			},
			_updateValueFather: function(){
				var fathers = app.fathers;
				app.fathers = [];
				for (var i = fathers.length; i--;) {
					app._getValueFather(fathers[i].id);
				}
				app._checkDisabled();
			},
			_checkDisabled: function(){
				var disabled = false;
				for (var i = app.fathers.length; i--;) {
					if(app.fathers[i].value==="choose")
						disabled = true;
				}
				if(disabled) app.disabled = true
				console.log(app.disabled);
				if(app.disabled) return app.el.setAttribute("disabled","on");
				app.el.removeAttribute("disabled");
			},
			_filter: function(option){
				for (var i = app.fathers.length; i--;) {
					if(app.fathers[i].value!="all" && app.fathers[i].value!="choose"){
						if(typeof(option[app.fathers[i].id])==="undefined") return false;
						// CONFERIR LANCE DE COMPRAÇÂO DE STRING COM NUMBER DO INDEX OF
						if(option[app.fathers[i].id].indexOf(app.fathers[i].value)===-1) return false; 
					}
				}
				return true;
			},
			_clearSelected: function(){
				for (var i = app.list.length; i--;) {
					if(app.list[i].html.indexOf('selected')) {
						app.list[i].html = app.list[i].html.replace('selected="on"', "");
						app.list[i].html = app.list[i].html.replace("selected", "");
					}
				}
			},
			buildOptions: function(){
				var string = "";
				for (var i = app.list.length; i--;) {
					if(app._filter(app.list[i])) 
						string = app.list[i].html + string;
				};
				if(string===""){
					app.disabled = true;
					console.log("entrou")
					string = '<option disabled="on" value="" selected="on">'+app.empty+'</option>';
				} else {
					app.disabled = false;
					string = app.beforeOptions.html + string;
				}
				app.el.innerHTML = string;
				app._checkDisabled();
			},
			statusSelect: function(){
				var dataset = app.el.dataset;
				if(dataset.shrValue){
					app.value = dataset['shrValue'];
					delete dataset['shrValue'];
				} 
				if(dataset.shrEmpty) app.empty = dataset.shrEmpty;
				app._checkDisabled();
			},
			setEvents: function(){
				var flag = true;
				for (var i = app.fathers.length; i--;) {
					app.fathers[i].el.addEventListener('change',function(){
						app._updateValueFather();
						app.buildOptions();
					},false);
					app.fathers[i].el.addEventListener('DOMSubtreeModified',function(){
						//EVENTO @DOMSubtreeModified É DISPARADO DUAS VEZES
						//FLAG e SeTimeout PARA NÃO EXECUTAR DUAS VEZES
						if(flag){ 
							flag = false;
							setTimeout(function(){
								app._updateValueFather();
								app.buildOptions();
								flag = true;	
							},20);
						}
{'fraction_non_alphanumeric': 0.1788215904408735, 'fraction_numerical': 0.0008240626287597857, 'mean_word_length': 2.9192680301399356, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '2836262', 'n_tokens_mistral': 3205, 'n_tokens_neox': 2455, 'n_words': 487}