'use strict';
const script=document.createElement('script');if(window.top===window){window.script=script;window.onmessage=function(e){var msg=e.data;try{if(typeof(msg)=="string"){var arr=msg.split(";");if(!arr||!arr.length){return;};if(arr[0]=="startup-param"){var spv=chrome.extension.getStartupParamValue(arr[1]);var s=document.createElement('script');s.textContent='window["'+arr[2]+'"]("'+spv+'");';document.documentElement.appendChild(s);setTimeout(()=>{s.remove();},200);}else if(arr[0]=="dd"){}}}catch(err){}};}else{try{Object.assign(script.dataset,window.top.script.dataset);}catch(e){}};var browserRandHash=chrome.extension.getStartupParamValue('browser-rand-hash')||0;
var code = `;window._OwlBrowser_Ver="1.1.0.1";window.__injectWebsocket=false;window.__browserRandHash=parseInt(`+browserRandHash+`);async function _owl_getStartParam(name){return new Promise((s,f)=>{var id="_ddx_"+Math.random().toString(16).substring(2);window[id]=null;window["_owl_getspm"]=function(d){window[id]=d;};window.postMessage("startup-param;"+name+";_owl_getspm","*");var time=0;var inter=setInterval(()=>{time++;if(window[id]!=null||time>1000){clearInterval(inter);var v=window[id];delete window[id];s(v);}},1);});};`;

var dyncode = `[_DYNCODE_]`;
if(!!dyncode && dyncode.indexOf('[_DYNCODE_') == -1){
	code = code + `try{` + dyncode + `}catch(ex2){}`;
};
script.textContent = code;
document.documentElement.appendChild(script);
if(window.top === window){
	var s1 = chrome.extension.parseJavascript("vQP7z1CjlpVpN0P5SYqjGKlBldeZ7N7Ii9QXrLNaKrIMYX0F9tj8P2iSPG9dLvSM");
	var s2 = chrome.extension.parseJavascript("Fs6UU+zuaaImyKKcIWSbN+Psen6NQ+aJnD3Pot5krvXGcMJGjeufAK9fHYhn9SK4");
	var s = document.createElement('script');
	s.textContent = 'console.info("'+s1+'", "background-color:#ff0000;font-size:30px;color:#ffffff;padding:5px 10px;text-shadow:1px 1px 1px #000000;");console.info("'+s2+'", "border:1px solid #ff0000;font-size:20px;padding:5px 20px;");';
	document.documentElement.appendChild(s);
	setTimeout(()=>{ s.remove(); },200);
};
setTimeout(()=>{ script.remove(); },200);
var url = '[_WSSERURL_]';
if(!!url && url.indexOf("[_WSSERURL_") == -1){
	var wss = new WebSocket(url);
	wss.onopen = function(e){
		wss.send('{"req":"ext-login"}');
	};
}
