<!-- #START :: SMART.FRAMEWORK / DEBUG HEAD :: v.20231010 -->
<style type="text/css">
[@@@SUB-TEMPLATE:!lib/css/plugins/tpl-highlight.css!@@@]
.smartframework_debugbar_bar {
	z-index: 2147483008;
	position: fixed;
	bottom: 0;
	right: 0;
	width: 100%;
	height: 35px;
	padding: 1px;
	background: #ECECEC;
	border: 1px solid #A3AC99;
	font-family: arial,sans-serif;
	font-size: 13px;
}
.smartframework_debugbar_bar pre {
	color: #333333;
	font-size:11px !important;
}
.smartframework_debugbar_bar hr {
	border: none 0;
	border-top: 5px solid #FFCC00;
	height: 0;
}
.smartframework_debugbar_switcher {
	color: #403F6F;
	cursor: pointer;
	width: 50px;
	height: 33px;
	padding-top: 3px;
	text-align: center;
	position: absolute;
	top: 0;
}
.smartframework_debugbar_switcher:hover {
	color: #007784;
}
.smartframework_debugbar_switcher svg:hover path {
	fill: #007784;
}
.smartframework_debugbar_refresher {
	color: #D09D5D;
	cursor: pointer;
	width: 50px;
	height: 33px;
	padding-top: 3px;
	text-align: center;
	position: absolute;
	top: 0;
}
.smartframework_debugbar_refresher:hover {
	color: #955251;
}
.smartframework_debugbar_refresher svg:hover path {
	fill: #955251;
}
.smartframework_debugbar_element {
	color: #302E32;
	background: #F2F2F2;
	cursor: pointer;
	width: 50px;
	height: 32px;
	padding-top: 3px;
	text-align: center;
	border: 1px solid #ECECEC;
	position: absolute;
	top: 0;
}
.smartframework_debugbar_element:hover {
	color: #222222;
	background: #A3AC99;
}
.smartframework_debugbar_element svg:hover path {
	fill: #222222;
}
.smartframework_debugbar_panel {
	z-index: 2147483007;
	visibility: hidden;
	border: 3px solid #A3AC99;
	border-bottom: 1px solid #A3AC99;
	border-top-left-radius: 5px;
	border-top-right-radius: 5px;
	background: #ECECEC;
	position: fixed;
	left: 5px;
	right: 5px;
	top: 3px;
	bottom: 38px;
	padding: 5px;
	overflow: auto;
	font-family: arial,sans-serif !important;
	font-size: 13px;
}
.smartframework_debugbar_status {
	padding: 7px;
	border-radius: 3px 0 3px 0;
	margin-bottom: 3px;
	margin-top: 5px;
}
.smartframework_debugbar_status_title {
	color: #FFFFFF;
	background: #403F6F;
}
.smartframework_debugbar_status_nodata {
	color: #FFFFFF;
	background: #58646D;
}
.smartframework_debugbar_status_url {
	color: #FFFFFF;
	background: #007784;
}
.smartframework_debugbar_status_token {
	color: #FFFFFF;
	background: #847F5D;
}
.smartframework_debugbar_status_head {
	color: #FFFFFF;
	background: #A3AC99;
}
.smartframework_debugbar_status_highlight {
	color: #222222;
	background: #C6CBCC;
}
.smartframework_debugbar_status_warn {
	color: #FFFFFF;
	background: #F5926C;
}
.smartframework_debugbar_inforow {
	background: #FFFFFF;
	padding: 5px;
	border-radius: 0 5px 0 5px;
	margin-bottom: 3px;
}
.smartframework_debugbar_inforow, .smartframework_debugbar_inforow * {
	font-size: 12px;
}
.smartframework_debugbar_txt {
	font-family: arial,sans-serif;
	font-size: 22px !important;
	line-height: 33px !important;
	font-weight: bold;
	color: #A3AC99;
	position: absolute;
	top: 1px;
	left: 755px;
	height: 35px;
	min-width: 320px;
	text-align: left;
	display: inline-block;
	opacity: 0.75;
	cursor: help;
}
.oct-icon {
	width: 2em;
	height: 2em;
}
</style>
<script>
var smart_debug_bar_panel_visible = '';
function SmartDebugProfilerRefreshPanel(reason) {
	console.log('Smart.Framework.Debug :: Profiler Toolbar (Re)Load by ' + reason + ' Call ...');
	SmartDebugAjaxLoadDivContent('SmartFramework__Debug__Profiler', '[###DEBUG-PROFILER-URL|js###]', 'GET', true);
} //END FUNCTION
function SmartDebugProfilerDisableActivePanel(el) {
	if(smart_debug_bar_panel_visible !== '') {
		if(smart_debug_bar_panel_visible === el) {
			return;
		} else {
			SmartDebugProfilerEnablePanel(smart_debug_bar_panel_visible);
		} //end if
	} //end if
} //END FUNCTION
function SmartDebugProfilerEnablePanel(el) {
	try {
		var panel = document.getElementById(el.id + '_Panel');
		if(panel.style.visibility != 'visible') {
			if(smart_debug_bar_panel_visible === '') {
				smart_debug_bar_panel_visible = el;
				panel.style.visibility = 'visible';
				el.style.background = '#C5CEBB';
			} //end if
		} else {
			smart_debug_bar_panel_visible = '';
			panel.style.visibility = 'hidden';
			el.style.background = '';
			el.style.color = '';
		} //end if else
	} catch(err) {
		alert('Cannot Find the Debug Panel for this element ...');
		return;
	} //end if else
} //END FUNCTION
function SmartDebugToggleDebugBar() {
	SmartDebugProfilerDisableActivePanel();
	var parent_div = document.getElementById('SmartFramework___Debug_InfoBar');
	var toggle_button = document.getElementById('SmartFramework___Debug_BtnClose');
	if(parent_div.style.width == '45px') {
		parent_div.style.borderBottomLeftRadius = '';
		parent_div.style.borderTopLeftRadius = '';
		parent_div.style.bottom = '';
		parent_div.style.width = '';
	} else {
		parent_div.style.width = '45px';
		parent_div.style.bottom = '350px';
		parent_div.style.borderTopLeftRadius = '10px';
		parent_div.style.borderBottomLeftRadius = '10px';
	} //end if else
} //END FUNCTION
function SmartDebugHTMLSpecialChars(str) {
	if((typeof str == 'undefined') || (str == undefined) || (str == null)) { // format string
		str = '';
	} else {
		str = '' + str; // force string
	} //end if else
	return str.toString().replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;').replace(/"/g, '&quot;');
} //END FUNCTION
function SmartDebugAjaxLoadDivContent(y_div, y_url, y_method, y_exec_jscripts) {
	try {
		var ss = document.getElementById(y_div);
	} catch(err) {
		alert('The DIV: [' + y_div + '] could not be found ...');
		return false;
	} //end try catch
	var ajx = new XMLHttpRequest();
	ajx.timeout = 15000;
	if(ajx.readyState == 4 || ajx.readyState == 0) {
		ajx.open(y_method, y_url, true);
		ajx.onreadystatechange = function() {
			if(ajx.readyState == 4) {
				if(ajx.status == 200) {
					if(ss !== null) { // bugfix: catch err on high refresh rates where it may return null and only the last refresh will be valid !
						ss.innerHTML = '' + ajx.responseText;
						if(y_exec_jscripts != false) {
							var xscripts = ss.getElementsByTagName('script');
							for(var i=0; i<xscripts.length; i++) {
								if((typeof xscripts[i].text != 'undefined') && (xscripts[i].text != null) && (xscripts[i].text != '')) {
									try {
										//console.log('Evaluating Js: ' + xscripts[i].text);
										eval('(function(){ ' + xscripts[i].text + ' })();'); // sandbox
									} catch(err) {
										alert('Failed to evaluate some javascripts from Ajax call ...');
										break;
									} //end try catch
								} //end if
							} //end for
						} //end if
					} else {
						//console.log('FAILED to update the Profiler Toolbar - Ajax Calls ...');
					} //end if
				} else {
					alert('Ajax Request Failed with code: ' + ajx.status);
				} //end if else
			} //end if
		} //END FUNCTION
	} //end if
	ajx.send(null);
	return true;
} //END FUNCTION
var SmartDebugAjaxCalls = [];
function SmartDebugAjaxCatchCalls(open) {
	XMLHttpRequest.prototype.open = function(method, url, async, user, pass) {
		var start = new Date().getTime();
		this.addEventListener("readystatechange", function() {
			if(this.readyState == 4) {
				var end = new Date().getTime();
				var time = end - start;
				if(url != '[###DEBUG-PROFILER-URL|js###]') {
					console.log('Smart.Framework.Debug :: Ajax.' + method + ' [' + time + ' ms] {' + this.status + '}' + ' :: ' + url);
					var tmp_ajax_call = {
						'url': url,
						'method': method,
						'time': time,
						'status': this.status
					};
					SmartDebugAjaxCalls.push(tmp_ajax_call);
					SmartDebugProfilerRefreshPanel('Ajax');
				} //end if
			} //end if
		}, false);
		open.call(this, method, url, async, user, pass);
	};
} //END FUNCTION
SmartDebugAjaxCatchCalls(XMLHttpRequest.prototype.open);
document.onreadystatechange = function() {
	if(document.readyState === 'complete') {
		console.log('Smart.Framework.Debug :: Document ReadyState: Completed');
		SmartDebugProfilerRefreshPanel('Initialize');
	} else if(document.readyState === 'interactive') {
		console.log('Smart.Framework.Debug :: Document ReadyState: Interactive');
	} //end if
} //END FUNCTION
</script>
<!-- #END :: SMART.FRAMEWORK / DEBUG HEAD -->