(function() {
var c=1;
var x = document.getElementById("Sureview276");
var sureview_logo_container=document.createElement("div");
var vdo = document.createElement("div");
var vi_maindiv = document.createElement("div");
var teads = document.createElement("script");
teads.id="sureview_2";
var third_party = document.createElement("script");
var adipolo = document.createElement("div");
var teads_main_div = document.createElement("div");
var vdo_id="";
var is_active_adipolo=0;
var is_active_teads=0;
var is_active_aniview=0;
var is_active_vdo=0;
var is_active_valueImpression=0;
var ad_displaying=0;
var running_ads=0;
var by_tag_name="";
var placement_salector="";
var no_of_tag="";
var placed_by="";
var priority1="2";
var priority2="1";
var priority3="4";
var refreshIntervalId;
var iframe="iframe";
var is_added_smc_header=0;
var vdo_player;
var teads_player;
var teads_ads_duration=10000;
var vdo_ads_duration=10000;
var setlogo_intval;
var setlogoTeads_intval;
var dailyMotionStyle = document.createElement('style');
dailyMotionStyle.innerHTML="#dailymotion-pip-large-viewport{ --dm--pip-left: 0px;} #dailymotion-pip-large-viewport{ --dm--pip-left: 0; --dm--pip-right: auto; } #dailymotion-pip-small-viewport {--dm--pip-size-width: 200px !important; --dm--pip-size-height: 110px !important;} .dm-player.dm-player-close-show #dailymotion-pip-large-viewport .dm__close-button, .dm-player.dm-player-close-show #dailymotion-pip-small-viewport .dm__close-button { visibility: visible !important;} .dm-player.dm-player-close-show .dm__close-button { visibility: visible !important; } .dm__close-button { position: absolute !important; top: var(--dm-close-top, -28px) !important; right: unset !important; width: var(--dm-close-width, 25px) !important; height: var(--dm-close-height, 25px) !important; background: var(--dm-close-bg, #000) !important; opacity: var(--dm-close-opacity, 0.45) !important; border-radius: 50% !important; padding: var(--dm-close-padding, 7px) !important; border: var(--dm-close-border, 0) !important; cursor: pointer; visibility: hidden; } .dailymotion-player-wrapper#dailymotion-pip-small-viewport .dm__close-button { left: 0px !important; right: unset !important; }";
top.document.getElementsByTagName('head')[0].appendChild(dailyMotionStyle);
var dailyMotionStyle = document.createElement('style');
dailyMotionStyle.innerHTML="#dailymotion-pip-small-viewport, #dailymotion-pip-large-viewport { width: var(--dm--pip-size-width, 410px) !important; left: var(--dm--pip-left, 0) !important; height: var(--dm--pip-size-height, 231px) !important; transition: right .5s ease !important; right: var(--dm--pip-right, initial) !important;} .dailymotion-player-wrapper#dailymotion-pip-small-viewport .dm__close-button { left: 0px !important; right: unset !important; }";
var reduce_size_for_big_screen= document.createElement('style');
reduce_size_for_big_screen.innerHTML="@media screen and (min-width: 640px) {.dm-player { padding-left: 20% !important; padding-right: 20% !important; }} #dailymotion-pip-small-viewport .dailymotion-player, #dailymotion-pip-small-viewport .dm__pip-new-controls{ border-radius: 10px; }";
top.document.getElementsByTagName('head')[0].appendChild(reduce_size_for_big_screen);
placement_salector=0;
setTimeout(function(){
by_tag_name="Sureview276";
placed_by="3";
no_of_tag="0";
var daily_motion_ads=document.createElement("div");
daily_motion_ads.className="dm-player sureview-ads";
daily_motion_ads.id="daily_motion_ads_div";
daily_motion_ads.style.cssText="padding-top: 10px; padding-bottom: 10px;";
var script_daily_motion=document.createElement("script");
script_daily_motion.src="https://statics.dmcdn.net/c/dm-ce.min.js";
script_daily_motion.type="text/javascript";
var ani_placement=is_avail_selector(by_tag_name,placed_by);
if(ani_placement!=0){
try{
if(placed_by!="3"){
ani_placement[no_of_tag].appendChild(daily_motion_ads);
ani_placement[no_of_tag].appendChild(script_daily_motion);
}else{
ani_placement.appendChild(daily_motion_ads);
ani_placement.appendChild(script_daily_motion);
}
top.document.getElementById("daily_motion_ads_div").setAttribute("owners", "sureview");
top.document.getElementById("daily_motion_ads_div").setAttribute("sort", "recent");
top.document.getElementById("daily_motion_ads_div").setAttribute("playerId", "x918a");
top.document.getElementById("daily_motion_ads_div").setAttribute("mute", "true");
top.document.getElementById("daily_motion_ads_div").setAttribute("loop", "true");
top.document.getElementById("daily_motion_ads_div").setAttribute("closeButton", "true");
top.document.getElementById("daily_motion_ads_div").setAttribute("hideButton", "false");
top.document.getElementById("daily_motion_ads_div").setAttribute("referrerPolicy", "no-referrer-when-downgrade");
top.document.getElementById("daily_motion_ads_div").setAttribute("playlistId", "x7ib3p");
top.document.getElementById("daily_motion_ads_div").setAttribute("enable_google_policy_ui", "true");
top.document.getElementById("daily_motion_ads_div").setAttribute("showAdOnly", "5");
top.document.getElementById("daily_motion_ads_div").setAttribute("mute", "true");
top.document.getElementById("daily_motion_ads_div").setAttribute("loop", "true");
top.document.getElementById("daily_motion_ads_div").setAttribute("closeButton", "true");
top.document.getElementById("daily_motion_ads_div").setAttribute("hideButton", "false");
top.document.getElementById("daily_motion_ads_div").setAttribute("referrerPolicy", "no-referrer-when-downgrade");
top.document.getElementById("daily_motion_ads_div").setAttribute("playlistId", "x7ib3p");
top.document.getElementById("daily_motion_ads_div").setAttribute("enable_google_policy_ui", "true");
new_logo(9);
}catch (exception_var) {
}
}
var widget_code="PGRpdiBpZD0ic3VyZXZpZXctc3RpY2t5LWJhbm5lciIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmNmY2ZjYwMDsgcG9zaXRpb246IGZpeGVkOyBib3R0b206IC01MHB4OyBsZWZ0OjA7IG92ZXJmbG93OiBoaWRkZW47IGRpcmVjdGlvbjogbHRyICFpbXBvcnRhbnQ7IHRyYW5zZm9ybTogc2NhbGUoMC41Nik7IG1heC13aWR0aDogMzAwcHg7IGxlZnQ6IC01MHB4OyBtYXJnaW46IGF1dG87IHotaW5kZXg6IDk5OTk5OTk5OSAhaW1wb3J0YW50OyBkaXNwbGF5OiBub25lOyI+DQogICAgICAgICAgICA8ZGl2IGNsYXNzPSJjcm9zcy1zdi1zdGlja3ktYmFubmVyIiBpZD0iY3Jvc3Mtc3Ytc3RpY2t5LWJhbm5lciIgc3R5bGU9ImRpc3BsYXk6IGZsZXg7IGJhY2tncm91bmQ6ICMwMDAwMDA7IGRpcmVjdGlvbjogbHRyICFpbXBvcnRhbnQ7IGJvcmRlci1yYWRpdXM6IDVweCA1cHggMHB4IDBweDsgbWF4LWhlaWdodDogMzVweDsgZGlzcGxheTogZmxleDsgYWxpZ24taXRlbXM6IGNlbn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XZpZXctc3RpY2t5LWJhbm5lciIpLnN0eWxlLmRpc3BsYXkgPSAibm9uZSI7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgaXNGaXJzdFJlbmRlciA9IGZhbHNlOw0KICAgICAgICAgICAgICAgICAgICAgICAgICAgIGdvb2dsZXRhZy5wdWJhZHMoKS5yZWZyZXNoKFtzdl9zdGlja3lfc2xvdF0pOw0KICAgICAgICAgICAgICAgICAgICAgICAgfQ0KICAgICAgICAgICAgICAgICAgICB9DQogICAgICAgICAgICAgICAgICAgIHZhciBTVmluaXRJbnRlcnZhbCwgc3Zfc3RpY2t5X3Nsb3QsIGlzRmlyc3RSZW5kZXI7DQogICAgICAgICAgICAgICAgICAgIHdpbmRvdy5nb29nbGV0YWcgPSB3aW5kb3cuZ29vZ2xldGFnIHx8IHtjbWQ6IFtdfTsNCiAgICAgICAgICAgICAgICAgICAgZ29vZ2xldGFnLmNtZC5wdXNoKGZ1bmN0aW9uICgpIHsNCiAgICAgICAgICAgICAgICAgICAgICAgIHN2X3N0aWNreV9zbG90ID0gZ29vZ2xldGFnLmRlZmluZVNsb3QoJy8yMjk0NTU4Njg5Ni9wcmVzc2NpdGllcy1yZXNwb25zaXZlJywgWzMwMCwgMjUwXSwgJ3N1cmV2aWV3LXN0aWNreS1iYW5uZXItYWRzJykuYWRkU2VydmljZShnb29nbGV0YWcucHViYWRzKCkpOw0KICAgICAgICAgICAgICAgICAgICAgICAgZ29vZ2xldGFnLnB1YmFkcygpLnNldCgncGFnZV91cmwnLCAnYnJlYWtpbmduZXdzbGViLmNvbScpOw0KICAgICAgICAgICAgICAgICAgICAgICAgZ29vZ2xldGFnLmVuYWJsZVNlcnZpY2VzKCk7DQogICAgICAgICAgICAgICAgICAgICAgICBnb29nbGV0YWcuZGlzcGxheSgnc3VyZXZpZXctc3RpY2t5LWJhbm5lci1hZHMnKTsNCiAgICAgICAgICAgICAgICAgICAgICAgIGlzRmlyc3RSZW5kZXIgPSB0cnVlOw0KICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGlzQWREaXNwbGF5ZWQgPSBmYWxzZTsNCiAgICAgICAgICAgICAgICAgICAgICAgIFNWaW5pdEludGVydmFsID0gc2V0SW50ZXJ2YWwocmVmcmVzaFNWU2xvdCwgMjIwMDAsIHN2X3N0aWNreV9zbG90KTsNCiAgICAgICAgICAgICAgICAgICAgICAgIGdvb2dsZXRhZy5wdWJhZHMoKS5hZGRFdmVudExpc3RlbmVyKCdzbG90UmVuZGVyRW5kZWQnLCBmdW5jdGlvbiAoZXZlbnQpIHsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoIWV2ZW50LmlzRW1wdHkpIHsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaXNBZERpc3BsYXllZCA9IHRydWU7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNldFRpbWVvdXQoZnVuY3Rpb24gKCkgew0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdG9wLmRvY3VtZW50LmdldEVsZW1lbnRCeUlkKCJzdXJldmlldy1zdGlja3ktYmFubmVyIikuc3R5bGUuZGlzcGxheSA9ICJibG9jayI7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sIDMwMDApOw0KICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoZXZlbnQuaXNFbXB0eSAmJiAhaXNGaXJzdFJlbmRlciAmJiBpc0FkRGlzcGxheWVkKSB7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRvcC5kb2N1bWVudC5nZXRFbGVtZW50QnlJZCgic3VyZXZpZXctc3RpY2t5LWJhbm5lciIpLnN0eWxlLmRpc3BsYXkgPSAiYmxvY2siOw0KICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoZXZlbnQuaXNFbXB0eSAmJiAhaXNBZERpc3BsYXllZCkgew0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjbGVhckludGVydmFsKFNWaW5pdEludGVydmFsKTsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFNWU2xvdChzdl9zdGlja3lfc2xvdCk7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFNWaW5pdEludGVydmFsID0gc2V0SW50ZXJ2YWwocmVmcmVzaFNWU2xvdCwgMjIwMDAsIHN2X3N0aWNreV9zbG90KTsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9DQogICAgICAgICAgICAgICAgICAgICAgICB9KTsNCiAgICAgICAgICAgICAgICAgICAgfSk7DQogICAgICAgICAgICAgICAgICAgIHRvcC5kb2N1bWVudC5nZXRFbGVtZW50QnlJZCgnc3VyZXZpZXctc3RpY2t5LWJhbm5lci1yZW1vdmUnKS5vbmNsaWNrID0gZnVuY3Rpb24gKGV2dCkgew0KICAgICAgICAgICAgICAgICAgICAgICAgdG9wLmRvY3VtZW50LmdldEVsZW1lbnRCeUlkKCJzdXJldmlldy1zdGlja3ktYmFubmVyIikuc3R5bGUuZGlzcGxheSA9ICJub25lIjsNCiAgICAgICAgICAgICAgICAgICAgICAgIGNsZWFySW50ZXJ2YWwoU1Zpbml0SW50ZXJ2YWwpOw0KICAgICAgICAgICAgICAgICAgICAgICAgU1Zpbml0SW50ZXJ2YWwgPSBzZXRJbnRlcnZhbChyZWZyZXNoU1ZTbG90LCAyMjAwMCwgc3Zfc3RpY2t5X3Nsb3QpOw0KICAgICAgICAgICAgICAgICAgICB9Ow0KICAgICAgICAgICAgICAgIH0pKCk7DQogICAgICAgICAgICA8L3NjcmlwdD4NCiAgICAgICAgPC9kaXY+";
var googleBs64Code=widget_code;
top.svJQInj_1 = {};
by_tag_name="Sureview276";
placed_by="3";
no_of_tag="0";
if (!top.window.jQuery) {
var dJqDynamic = document.createElement("script");
dJqDynamic.src = atob("aHR0cHM6Ly9hamF4Lmdvb2dsZWFwaXMuY29tL2FqYXgvbGlicy9qcXVlcnkvMy43LjAvanF1ZXJ5Lm1pbi5qcw==");
top.document.getElementsByTagName("head")[0].append(dJqDynamic);
dJqDynamic.onload = function(){
top.svJQInj_1 = jQuery.noConflict(true);
if(placed_by=='1'){
top.svJQInj_1(by_tag_name).eq(no_of_tag).append(atob(googleBs64Code));
}else if(placed_by=='2'){
top.svJQInj_1("."+by_tag_name).eq(no_of_tag).append(atob(googleBs64Code));
}else if(placed_by=='3'){
top.svJQInj_1("#"+by_tag_name).append(atob(googleBs64Code));
}
}
}else{
if(placed_by=='1'){
top.jQuery(by_tag_name).eq(no_of_tag).append(atob(googleBs64Code));
}else if(placed_by=='2'){
top.jQuery("."+by_tag_name).eq(no_of_tag).append(atob(googleBs64Code));
}else if(placed_by=='3'){
top.jQuery("#"+by_tag_name).append(atob(googleBs64Code));
}
}
setTimeout(function(){
try{
var s3 = document.createElement("style");
s3.append("#dailymotion-pip-small-viewport, #dailymotion-pip-large-viewport { width: var(--dm--pip-size-width, 410px) !important; left: var(--dm--pip-left, 0) !important; height: var(--dm--pip-size-height, 231px) !important; transition: right .5s ease !important; right: var(--dm--pip-right, initial) !important; display: block !important; bottom: var(--dm--pip-bottom, 0) !important; top: var(--dm--pip-top, initial) !important; } .sview_float_player_outstream { position: fixed !important; bottom: 0px !important; left: 0rem !important; height: unset !important; overflow: unset !important; bottom: 0px !important; z-index: 99999999999999 !important; }");
top.document.head.appendChild(s3);
}catch{
}
if(document.getElementsByClassName('teads-inread').length>0){
var teadsMarginStyle = document.createElement('style');
teadsMarginStyle.innerHTML=".teads-inread {padding-bottom:10px !important;}";
document.getElementsByClassName('teads-inread')[0].appendChild(teadsMarginStyle);
}
},8000);
},800);
function set_aniview_after15sec(){
setlogoTeads_intval=setInterval(function(){
try{
document.querySelector(".teads-inread").remove();
}catch{
}
},15000);
}
function new_logo(company_id){
var isLogoTriggered = false;
var isLogoTriggeredTeads = false;
if(company_id==2){
var test_id=276;
setlogoTeads_intval=setInterval(function(){
teads_primary_div=document.getElementById('teads0');
if(test_id==64 && !isLogoTriggeredTeads){
isLogoTriggeredTeads = true;
clearInterval(setlogoTeads_intval);
var bottom_div = document.createElement("div");
bottom_div.id="sureview_branding_2";
bottom_div.style.cssText="line-height:0px;";
bottom_div.className="sureviewBottomDiv sureviewtv";
var anchor1=document.createElement("a");
anchor1.href="http://sureview.tv/";
anchor1.target="_BLANK";
var bottom_logo_img = document.createElement("img");
bottom_logo_img.id="sureview_logo_bottom_2";
bottom_logo_img.src="https://app.sureview.tv/logo/sureview_logo.svg";
bottom_logo_img.style.cssText="height: 18px !important; margin: 0 !important; margin-top: 2px !important; width: 70px !important;";
anchor1.appendChild(bottom_logo_img);
bottom_div.appendChild(anchor1);
teads_primary_div.appendChild(bottom_div);
}else{
}
},1000);
}else{
daily_motion_ads=document.getElementById('daily_motion_ads_div');
setlogo_intval=setInterval(function(){
if(document.getElementsByClassName('dm-player-wrapper').length > 0 && !isLogoTriggered){
isLogoTriggered = true;
clearInterval(setlogo_intval);
var bottom_div = document.createElement("div");
bottom_div.id="sureview_branding";
bottom_div.style.cssText="line-height:0px;";
bottom_div.className="sureviewBottomDiv sureviewtv";
var anchor1=document.createElement("a");
anchor1.href="http://sureview.tv/";
anchor1.target="_BLANK";
var bottom_logo_img = document.createElement("img");
bottom_logo_img.id="sureview_logo_bottom";
bottom_logo_img.src="https://app.sureview.tv/logo/sureview_logo.svg";
bottom_logo_img.style.cssText="height: 18px !important; margin: 0 !important; margin-top: 2px !important; width: 70px !important;";
anchor1.appendChild(bottom_logo_img);
bottom_div.appendChild(anchor1);
daily_motion_ads.appendChild(bottom_div);
is_dm_ready();
}
},1000);
}
}
function is_dm_ready(){
var is_dm_sv_ready = setInterval(function(){
if(top.document.querySelectorAll(".dailymotion-player-wrapper .dm__close-button").length > 0){
clearInterval(is_dm_sv_ready);
document.querySelector(".dailymotion-player-wrapper .dm__close-button").innerHTML += '';
}
},500);
}
function is_avail_selector(name, by){
if(by==1){
placement_salector=document.getElementsByTagName(name);
if(placement_salector.length>0){
return placement_salector;
}else{
return 0;
}
}else if(by==2){
placement_salector=document.getElementsByClassName(name);
if(placement_salector.length>0){
return placement_salector;
}else{
return 0;
}
}else if(by==3){
placement_salector=top.document.getElementById(name);
if(placement_salector===null){
return 0;
}else{
return placement_salector;
}
}else if(by==4){
placement_salector=document.querySelectorAll(name);
if(placement_salector===null){
return 0;
}else{
return placement_salector;
}
}else{
placement_salector=document.getElementById(name);
if(placement_salector===null){
return 0;
}else{
return placement_salector;
}
}
}
function set_bottom_logo(company){
var counter=1;
setlogo_intval=setInterval(function(){
counter++;
try{
document.getElementById("sureview_branding").remove();
}catch(error){
}
var sureview_div=document.getElementById('Sureview276').clientWidth;
try{
if(company==1){
var video_div=document.getElementsByClassName('ima-ad-container')[0].clientWidth;
}else if(company==2){
var video_div=document.getElementsByClassName('teads-player')[0].clientWidth;
}else if(company==4){
var video_div=document.getElementById('ifr_PHN0eWxlPgogICAgICAgICAgICAjbWFpbl9zdkNvbnRhaW5lcnsKICAgICAgICAgICAgICAgIGJhY2tncm91bmQtY29sb3I6ICNlOWU5ZTk7CiAgICAgICAgICAgICAgICB3aWR0aDogMTAwJTsKICAgICAgICAgICAgICAgIGRpc3BsYXk6IGZsZXg7CiAgICAgICAgICAgICAgICBhbGlnbi1pdGVtczogY2VudGVyOwogICAgICAgICAgICAgICAganVzdGlmeS1jb250ZW50OiBjZW50ZXI7CiAgICAgICAgICAgIH0KCiAgICAgICAgICAgIEBtZWRpYSAobWluLXdpZHRoOjMyMHB4KSAgewogICAgICAgICAgICAgICAgI1NWbWFpbkNvbnRhaW5lciB7CiAgICAgICAgICAgICAgICAgICAgcG9zaXRpb246IHJlbGF0aXZlOwogICAgICAgICAgICAgICAgICAgIHBhZGRpbmctYm90dG9tOiA1cHg7CiAgICAgICAgICAgICAgICAgICAgd2lkdGg6IDMwMHB4ICFpbXBvcnRhbnQ7CiAgICAgICAgICAgICAgICAgICAgaGVpZ2h0OiAxNjlweCAhaW1wb3J0YW50OwogICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgI1NWY29udGVudCwgI1NWYWRDb250YWluZXIgewogICAgICAgICAgICAgICAgICAgIHBvc2l0aW9uOiBhYnNvbHV0ZTsKICAgICAgICAgICAgICAgICAgICB0b3A6IDBweDsKICAgICAgICAgICAgICAgICAgICBsZWZ0OiAwcHg7CiAgICAgICAgICAgICAgICAgICAgd2lkdGg6IDMwMHB4OwogICAgICAgICAgICAgICAgICAgIGhlaWdodDogMTY5cHg7CiAgICAgICAgICAgICAgICB9CgogICAgICAgICAgICAgICAgI2NvbnRlbnRFbGVtZW50IHsKICAgICAgICAgICAgICAgICAgICB3aWR0aDogMzAwcHg7CiAgICAgICAgICAgICAgICAgICAgaGVpZ2h0OiAxNjlweDsKICAgICAgICAgICAgICAgICAgICBvdmVyZmxvdzogaGlkZGVuOwogICAgICAgICAgICAgICAgfQogICAgICAgICAgICB9CiAgICAgICAgICAgIEBtZWRpYSAobWluLXdpZHRoOjQ4MXB4KSAgewogICAgICAgICAgICAgICAgI1NWbWFpbkNvbnRhaW5lciB7CiAgICAgICAgICAgICAgICAgICAgd2lkdGg6IDMwMHB4ICFpbXBvcnRhbnQ7CiAgICAgICAgICAgICAgICAgICAgaGVpZ2h0OiAxNjlweCAhaW1wb3J0YW50OwogICAgICAgICAgICAgICAgICAgIHBvc2l0aW9uOiByZWxhdGl2ZTsKICAgICAgICAgICAgICAgICAgICBwYWRkaW5nLWJvdHRvbTogNXB4OwogICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgI1NWY29udGVudCwgI1NWYWRDb250YWluZXIgewogICAgICAgICAgICAgICAgICAgIHBvc2l0aW9uOiBhYnNvbHV0ZTsKICAgICAgICAgICAgICAgICAgICB0b3A6IDBweDsKICAgICAgICAgICAgICAgICAgICBsZWZ0OiAwcHg7CiAgICAgICAgICAgICAgICAgICAgd2lkdGg6IDMwMHB4OwogICAgICAgICAgICAgICAgICAgIGhlaWdodDogMTY5cHg7CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAjY29udGVudEVsZW1lbnQgewogICAgICAgICAgICAgICAgICAgIHdpZHRoOiAzMDBweDsKICAgICAgICAgICAgICAgICAgICBoZWlnaHQ6IDE2OXB4OwogICAgICAgICAgICAgICAgICAgIG92ZXJmbG93OiBoaWRkZW47CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgIH0KICAgICAgICAgICAgQG1lZGlhIChtaW4td2lkdGg6NjQxcHgpICB7CiAgICAgICAgICAgICAgICAjU1ZtYWluQ29udGFpbmVyIHsKICAgICAgICAgICAgICAgICAgICB3aWR0aDogMzAwcHggIWltcG9ydGFudDsKICAgICAgICAgICAgICAgICAgICBoZWlnaHQ6IDE2OXB4ICFpbXBvcnRhbnQ7CiAgICAgICAgICAgICAgICAgICAgcG9zaXRpb246IHJlbGF0aXZlOwogICAgICAgICAgICAgICAgICAgIHBhZGRpbmctYm90dG9tOiA1cHg7CiAgICAgICAgICAgICAgICB9CgogICAgICAgICAgICAgICAgI1NWY29udGVudCwgI1NWYWRDb250YWluZXIgewogICAgICAgICAgICAgICAgICAgIHBvc2l0aW9uOiBhYnNvbHV0ZTsKICAgICAgICAgICAgICAgICAgICB0b3A6IDBweDsKICAgICAgICAgICAgICAgICAgICBsZWZ0OiAwcHg7CiAgICAgICAgICAgICAgICAgICAgd2lkdGg6IDMwMHB4OwogICAgICAgICAgICAgICAgICAgIGhlaWdodDogMTY5cHg7CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAjY29udGVudEVsZW1lbnQgewogICAgICAgICAgICAgICAgICAgIHdpZHRoOiAzMDBweDsKICAgICAgICAgICAgICAgICAgICBoZWlnaHQ6IDE2OXB4OwogICAgICAgICAgICAgICAgICAgIG92ZXJmbG93OiBoaWRkZW47CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgIH0KICAgICAgICAgICAgQG1lZGlhIChtaW4td2lkdGg6OTYxcHgpICB7CiAgICAgICAgICAgICAgICAjU1ZtYWluQ29udGFpbmVyIHsKICAgICAgICAgICAgICAgICAgICB3aWR0aDogNjQwcHggIWltcG9ydGFudDsKICAgICAgICAgICAgICAgICAgICBoZWlnaHQ6IDM2MHB4ICFpbXBvcnRhbnQ7CiAgICAgICAgICAgICAgICB9CgogICAgICAgICAgICAgICAgI1NWY29udGVudCwgI1NWYWRDb250YWluZXIgewogICAgICAgICAgICAgICAgICAgIHBvc2l0aW9uOiBhYnNvbHV0ZTsKICAgICAgICAgICAgICAgICAgICB0b3A6IDBweDsKICAgICAgICAgICAgICAgICAgICBsZWZ0OiAwcHg7CiAgICAgICAgICAgICAgICAgICAgd2lkdGg6IDY0MHB4OwogICAgICAgICAgICAgICAgICAgIGhlaWdodDogMzYwcHg7CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAjY29udGVudEVsZW1lbnQgewogICAgICAgICAgICAgICAgICAgIHdpZHRoOiA2NDBweDsKICAgICAgICAgICAgICAgICAgICBoZWlnaHQ6IDM2MHB4OwogICAgICAgICAgICAgICAgICAgIG92ZXJmbG93OiBoaWRkZW47CiAgICAgICAgICAgICAgICB9CgogICAgICAgICAgICB9CiAgICAgICAgICAgIEBtZWRpYSAobWluLXdpZHRoOjEwMjVweCkgewogICAgICAgICAgICAgICAgI1NWbWFpbkNvbnRhaW5lciB7CiAgICAgICAgICAgICAgICAgICAgd2lkdGg6IDY0MHB4ICFpbXBvcnRhbnQ7CiAgICAgICAgICAgICAgICAgICAgaGVpZ2h0OiAzNjBweCAhaW1wb3J0YW50OwogICAgICAgICAgICAgICAgICAgIHBvc2l0aW9uOiByZWxhdGl2ZTsKICAgICAgICAgICAgICAgICAgICBwYWRkaW5nLWJvdHRvbTogNXB4OwogICAgICAgICAgICAgICAgfQoKICAgICAgICAgICAgICAgICNTVmNvbnRlbnQsICNTVmFkQ29udGFpbmVyIHsKICAgICAgICAgICAgICAgICAgICBwb3NpdGlvbjogYWJzb2x1dGU7CiAgICAgICAgICAgICAgICAgICAgd2lkdGg6IDY0MHB4OwogICAgICAgICAgICAgICAgICAgIGhlaWdodDogMzYwcHg7CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAjY29udGVudEVsZW1lbnQgewogICAgICAgICAgICAgICAgICAgIHdpZHRoOiA2NDBweDsKICAgICAgICAgICAgICAgICAgICBoZWlnaHQ6IDM2MHB4OwogICAgICAgICAgICAgICAgICAgIG92ZXJmbG93OiBoaWRkZW47CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgIH0KICAgICAgICAgICAgQG1lZGlhIChtaW4td2lkdGg6MTI4MXB4KSB7CiAgICAgICAgICAgICAgICAjU1ZtYWluQ29udGFpbmVyIHsKICAgICAgICAgICAgICAgICAgICB3aWR0aDogNjQwcHggIWltcG9ydGFudDsKICAgICAgICAgICAgICAgICAgICBoZWlnaHQ6IDM2MHB4ICFpbXBvcnRhbnQ7CiAgICAgICAgICAgICAgICAgICAgcG9zaXRpb246IHJlbGF0aXZlOwogICAgICAgICAgICAgICAgICAgIHBhZGRpbmctYm90dG9tOiA1cHg7CiAgICAgICAgICAgICAgICB9CgogICAgICAgICAgICAgICAgI1NWY29udGVudCwgI1NWYWRDb250YWluZXIgewogICAgICAgICAgICAgICAgICAgIHBvc2l0aW9uOiBhYnNvbHV0ZTsKICAgICAgICAgICAgICAgICAgICB0b3A6IDBweDsKICAgICAgICAgICAgICAgICAgICBsZWZ0OiAwcHg7CiAgICAgICAgICAgICAgICAgICAgd2lkdGg6IDY0MHB4OwogICAgICAgICAgICAgICAgICAgIGhlaWdodDogMzYwcHg7CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAjY29udGVudEVsZW1lbnQgewogICAgICAgICAgICAgICAgICAgIHdpZHRoOiA2NDBweDsKICAgICAgICAgICAgICAgICAgICBoZWlnaHQ6IDM2MHB4OwogICAgICAgICAgICAgICAgICAgIG92ZXJmbG93OiBoaWRkZW47CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgIH0KICAgICAgICAgICAgI3N2LWZvb3Rlci1lbGVtZW50ewogICAgICAgICAgICAgICAgcG9zaXRpb246IGFic29sdXRlOwogICAgICAgICAgICAgICAgd2lkdGg6IDEwMCUgIWltcG9ydGFudDsKICAgICAgICAgICAgICAgIGJvdHRvbTogMDsKICAgICAgICAgICAgICAgIGhlaWdodDogNDBweCAhaW1wb3J0YW50OwogICAgICAgICAgICAgICAgYmFja2dyb3VuZDogbGluZWFyLWdyYWRpZW50KHRvIGJvdHRvbSwgdHJhbnNwYXJlbnQgMCUsIHJnYmEoMCwgMCwgMCwgMC41KSAxMDAlKTsKICAgICAgICAgICAgICAgIGRpc3BsYXk6IGZsZXg7CiAgICAgICAgICAgICAgICBmbGV4LWRpcmVjdGlvbjogcm93OwogICAgICAgICAgICAgICAganVzdGlmeS1jb250ZW50OiBzcGFjZS1iZXR3ZWVuOwogICAgICAgICAgICAgICAgYWxpZ24taXRlbXM6IGNlbnRlcjsKICAgICAgICAgICAgfQoKICAgICAgICAgICAgLnN2LWNvbnRyb2xzLWNvbnRhaW5lcnsKICAgICAgICAgICAgICAgIGRpc3BsYXk6IGlubGluZS1ibG9jazsKICAgICAgICAgICAgICAgIHBhZGRpbmc6IDEycHg7CiAgICAgICAgICAgICAgICBjdXJzb3I6IHBvaW50ZXI7CiAgICAgICAgICAgIH0KICAgICAgICAgICAgLnN2LWNvbnRyb2xzewogICAgICAgICAgICAgICAgd2lkdGg6MjVweDsKICAgICAgICAgICAgICAgIGhlaWdodDogMjVweDsKCiAgICAgICAgICAgIH0KICAgICAgICAgICAgLnN2LWNvbnRyb2xzLWNvbnRhaW5lciAuc3Ytdm9sdW1lLW11dGV7CiAgICAgICAgICAgICAgICBjb250ZW50OnVybCgiZGF0YTppbWFnZS9wbmc7YmFzZTY0LGlWQk9SdzBLR2dvQUFBQU5TVWhFVWdBQUFHQUFBQUJnQ0FZQUFBRGltSGM0QUFBQUNYQklXWE1BQUFzVEFBQUxFd0VBbXB3WUFBQURMVWxFUVZSNG5PMmNTMjdUVUJoR2Z5aUNNVnNBVVVDQVFFR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AgICAgICAgICAgICAgZGlzcGxheTogbm9uZTsKICAgICAgICAgICAgfQoKICAgICAgICAgICAgLmZsb2F0ZXJfc3Z7CiAgICAgICAgICAgICAgICBwb3NpdGlvbjogZml4ZWQgIWltcG9ydGFudDsKICAgICAgICAgICAgICAgIGJvdHRvbTogM3JlbSAhaW1wb3J0YW50OwogICAgICAgICAgICAgICAgbGVmdDogLTVyZW0gIWltcG9ydGFudDsKICAgICAgICAgICAgICAgIGhlaWdodDogdW5zZXQgIWltcG9ydGFudDsKICAgICAgICAgICAgICAgIG92ZXJmbG93OiB1bnNldCAhaW1wb3J0YW50OwogICAgICAgICAgICAgICAgei1pbmRleDogOTk5OTk5OTk5OTk5OTkgIWltcG9ydGFudDsKICAgICAgICAgICAgICAgIHRyYW5zZm9ybTogc2NhbGUoMC40KTsKICAgICAgICAgICAgfQoKICAgICAgICAgICAgLmNsb3NlLWZsb2F0ZXJ7CiAgICAgICAgICAgICAgICB3aWR0aDogMTAwJTsKICAgICAgICAgICAgICAgIG1hcmdpbi10b3A6IC01MHB4OwogICAgICAgICAgICAgICAgY3Vyc29yOiBwb2ludGVyOwoKICAgICAgICAgICAgfQogICAgICAgIDwvc3R5bGU+CiAgICAgICAgPGRpdiBpZD0ibWFpbl9zdkNvbnRhaW5lciIgc3R5bGU9ImZsZXgtZGlyZWN0aW9uOiBjb2x1bW47Ij4KICAgICAgICAgICAgPGRpdiBpZD0iU1ZtYWluQ29udGFpbmVyIj4KICAgICAgICAgICAgICAgIDxkaXYgY2xhc3M9J2Nsb3NlLWZsb2F0ZXIgc3YtaGlkZScgaWQ9J2Nsb3NlLWZsb2F0ZXInPgogICAgICAgICAgICAgICAgICAgIDxpbWcgaWQ9J3N2LWNsb3NlLWZsb2F0ZXItYnV0dG9uJz4KICAgICAgICAgICAgICAgIDwvZGl2PgogICAgICAgICAgICAgICAgPGRpdiBpZD0iU1Zjb250ZW50Ij4KICAgICAgICAgICAgICAgICAgICA8dmlkZW8gaWQ9ImNvbnRlbnRFbGVtZW50IiBwbGF5c2lubGluZT4KICAgICAgICAgICAgICAgICAgICAgICAgPHNvdXJjZSBzcmM9Imh0dHBzOi8vY2RuLnN1cmV2aWV3LnR2L2RlZmF1bHQvZGVmYXVsdC12aWRlby5tcDQiPjwvc291cmNlPgogICAgICAgICAgICAgICAgICAgIDwvdmlkZW8+CiAgICAgICAgICAgICAgICA8L2Rpdj4KICAgICAgICAgICAgICAgIDxkaXYgaWQ9IlNWYWRDb250YWluZXIiPjwvZGl2PgogICAgICAgICAgICAgICAgPGRpdiBpZD0ic3YtZm9vdGVyLWVsZW1lbnQiIGNsYXNzPSdzdi1mb290ZXItZWxlbWVudCc+CiAgICAgICAgICAgICAgICAgICAgPGRpdiBjbGFzcz0nc3YtY29udHJvbHMtY29udGFpbmVyJyBvbmNsaWNrPSJwbGF5UGF1c2UoMCwgMSk7Ij48aW1nICBpZD0ic3YtcGxheS10b2dnbGUiIGNsYXNzPSdzdi1wYXVzZScvPjwvZGl2PgogICAgICAgICAgICAgICAgICAgIDxkaXYgY2xhc3M9J3N2LWNvbnRyb2xzLWNvbnRhaW5lcicgc3R5bGU9J2Rpc3BsYXk6IGlubGluZS1ibG9jazsnIG9uY2xpY2s9Im11dGVVbm11dGUoKTsiPjxpbWcgY2xhc3M9J3N2LXZvbHVtZS1tdXRlJyBpZD0ic3Ytc291bmQtdG9nZ2xlIiBjbGFzcz0nc3YtY29udHJvbHMnLz48L2Rpdj4KICAgICAgICAgICAgICAgIDwvZGl2PgogICAgICAgICAgICA8L2Rpdj4KICAgICAgICA8L2Rpdj4KCiAgICAgICAgPHNjcmlwdD4KCiAgICAgICAgICAgIGxldCB2YXN0X3NvdW5kID0gInZwbXV0ZT0xJiI7CgogICAgICAgICAgICBsZXQgYWRzTWFuYWdlcjsKICAgICAgICAgICAgbGV0IGFkc0xvYWRlcjsKICAgICAgICAgICAgbGV0IGFkRGlzcGxheUNvbnRhaW5lcjsKICAgICAgICAgICAgbGV0IGludGVydmFsVGltZXI7CiAgICAgICAgICAgIGxldCBTVmlzQWRQbGF5aW5nOwogICAgICAgICAgICBsZXQgaXNDb250ZW50RmluaXNoZWQ7CiAgICAgICAgICAgIGxldCB2aWRlb0NvbnRlbnQ7CiAgICAgICAgICAgIGxldCBpc19hZHNfcGxheWluZyA9IDA7CiAgICAgICAgICAgIGxldCBpc19wbGF5X3BhdXNlID0gMDsKICAgICAgICAgICAgbGV0IGlzX3ZvbHVtZSA9IDA7CiAgICAgICAgICAgIGxldCB2aWRlb19jb250ZW50X3BhdXNlID0gMDsKICAgICAgICAgICAgbGV0IHBhdXNlX2J5X3VzZXIgPSAwOwogICAgICAgICAgICBsZXQgaXNTVlRhYkFjdGl2ZSA9IHRydWU7CiAgICAgICAgICAgIGxldCByZXF1ZXN0X2hlaWdodCA9IDA7CiAgICAgICAgICAgIGxldCByZXF1ZXN0X3dpZHRoID0gMDsKICAgICAgICAgICAgbGV0IHN2X2lzX2Zsb2F0ZXJfYWN0aXZlID0gMDsKICAgICAgICAgICAgbGV0IHN2X2lzX2Zsb2F0ZXJfY2xvc2VkID0gbnVsbDsKICAgICAgICAgICAgbGV0IGNoZWNrX3N2X29uY2UgPSAwOwoKCiAgICAgICAgICAgIGRvY3VtZW50LmdldEVsZW1lbnRCeUlkKCdjb250ZW50RWxlbWVudCcpLm11dGVkID0gdHJ1ZTsKCiAgICAgICAgICAgIGRvY3VtZW50LmJvZHkuYWRkRXZlbnRMaXN0ZW5lcignY2xpY2snLCAoKSA9PiB7CiAgICAgICAgICAgICAgICBkb2N1bWVudC5nZXRFbGVtZW50QnlJZCgnY29udGVudEVsZW1lbnQnKS5tdXRlZCA9IGZhbHNlOwoKICAgICAgICAgICAgICAgIGlmIChkb2N1bWVudC5nZXRFbGVtZW50QnlJZCgnY29udGVudEVsZW1lbnQnKS5yZWFkeVN0YXRlID09IDQpIHsKICAgICAgICAgICAgICAgICAgICB2YXN0X3NvdW5kID0gInZwbXV0ZT0wJnBsY210PTEmIjsKICAgICAgICAgICAgICAgICAgICBpZiAoY2hlY2tfc3Zfb25jZSA9PSAwKSB7CiAgICAgICAgICAgICAgICAgICAgICAgIGlzX3ZvbHVtZSA9IDE7CiAgICAgICAgICAgICAgICAgICAgICAgIGRvY3VtZW50LmdldEVsZW1lbnRCeUlkKCJzdi1zb3VuZC10b2dnbGUiKS5jbGFzc05hbWUgPSAic3Ytdm9sdW1lLXVuLW11dGUiOwogICAgICAgICAgICAgICAgICAgICAgICBjaGVja19zdl9vbmNlID0gMTsKICAgICAgICAgICAgICAgICAgICB9IGVsc2UgewoKICAgICAgICAgICAgICAgICAgICB9CgoKICAgICAgICAgICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgICAgICAgICAgZG9jdW1lbnQuZ2V0RWxlbWVudEJ5SWQoJ2NvbnRlbnRFbGVtZW50JykubXV0ZWQgPSB0cnVlOwogICAgICAgICAgICAgICAgICAgIGNvbnNvbGUubG9nKCJOb3QgcmVhZHkiKTsKICAgICAgICAgICAgICAgIH0KCiAgICAgICAgICAgIH0pOwoKCiAgICAgICAgICAgIGZ1bmN0aW9uIGluaXQoKSB7CiAgICAgICAgICAgICAgICB2aWRlb0NvbnRlbnQgPSBkb2N1bWVudC5nZXRFbGVtZW50QnlJZCgnY29udGVudEVsZW1lbnQnKTsKICAgICAgICAgICAgICAgIHBsYXlCdXR0b24gPSBkb2N1bWVudC5nZXRFbGVtZW50QnlJZCgncGxheUJ1dHRvbicpOwogICAgICAgICAgICAgICAgc2V0VXBJTUEoKTsKICAgICAgICAgICAgfQoKICAgICAgICAgICAgZnVuY3Rpb24gc2V0VXBJTUEoKSB7CgogICAgICAgICAgICAgICAgdmFyIG9mZnNldEhlaWdodCA9IGRvY3VtZW50LmdldEVsZW1lbnRCeUlkKCdTVm1haW5Db250YWluZXInKS5vZmZzZXRIZWlnaHQ7CiAgICAgICAgICAgICAgICBkb2N1bWVudC5nZXRFbGVtZW50QnlJZCgnbWFpbl9zdkNvbnRhaW5lcicpLnN0eWxlLmhlaWdodCA9IG9mZnNldEhlaWdodCArICJweCI7CgogICAgICAgICAgICAgICAgdmFyIGVsZW1lbnQgPSBkb2N1bWVudC5nZXRFbGVtZW50QnlJZCgnU1ZtYWluQ29udGFpbmVyJyk7CiAgICAgICAgICAgICAgICByZXF1ZXN0X2hlaWdodCA9IGVsZW1lbnQub2Zmc2V0SGVpZ2h0OwogICAgICAgICAgICAgICAgcmVxdWVzdF93aWR0aCA9IGVsZW1lbnQub2Zmc2V0V2lkdGg7CgogICAgICAgICAgICAgICAgY3JlYXRlQWREaXNwbGF5Q29udGFpbmVyKCk7CgogICAgICAgICAgICAgICAgYWRzTG9hZGVyID0gbmV3IGdvb2dsZS5pbWEuQWRzTG9hZGVyKGFkRGlzcGxheUNvbnRhaW5lcik7CgogICAgICAgICAgICAgICAgYWRzTG9hZGVyLmFkZEV2ZW50TGlzdGVuZXIoCiAgICAgICAgICAgICAgICAgICAgICAgIGdvb2dsZS5pbWEuQWRzTWFuYWdlckxvYWRlZEV2ZW50LlR5cGUuQURTX01BTkFHRVJfTE9BREVELAogICAgICAgICAgICAgICAgICAgICAgICBvbkFkc01hbmFnZXJMb2FkZWQsIGZhbHNlKTsKICAgICAgICAgICAgICAgIGFkc0xvYWRlci5hZGRFdmVudExpc3RlbmVyKAogICAgICAgICAgICAgICAgICAgICAgICBnb29nbGUuaW1hLkFkRXJyb3JFdmVudC5UeXBlLkFEX0VSUk9SLCBvbkFkRXJyb3IsIGZhbHNlKTsKCgogICAgICAgICAgICAgICAgY29uc3QgY29udGVudEVuZGVkTGlzdGVuZXIgPSBmdW5jdGlvbiAoKSB7CiAgICAgICAgICAgICAgICAgICAgaWYgKFNWaXNBZFBsYXlpbmcpCiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybjsKICAgICAgICAgICAgICAgICAgICBpc0NvbnRlbnRGaW5pc2hlZCA9IHRydWU7CiAgICAgICAgICAgICAgICAgICAgdmlkZW9Db250ZW50LnBsYXkoKTsKICAgICAgICAgICAgICAgICAg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xdWVzdC5saW5lYXJBZFNsb3RXaWR0aCA9IDY0MDsKICAgICAgICAgICAgICAgIGFkc1JlcXVlc3QubGluZWFyQWRTbG90SGVpZ2h0ID0gNDAwOwoKICAgICAgICAgICAgICAgIGFkc1JlcXVlc3Qubm9uTGluZWFyQWRTbG90V2lkdGggPSA2NDA7CiAgICAgICAgICAgICAgICBhZHNSZXF1ZXN0Lm5vbkxpbmVhckFkU2xvdEhlaWdodCA9IDE1MDsKCiAgICAgICAgICAgICAgICBhZHNMb2FkZXIucmVxdWVzdEFkcyhhZHNSZXF1ZXN0KTsKICAgICAgICAgICAgfQoKCiAgICAgICAgICAgIGZ1bmN0aW9uIGNyZWF0ZUFkRGlzcGxheUNvbnRhaW5lcigpIHsKCiAgICAgICAgICAgICAgICBhZERpc3BsYXlDb250YWluZXIgPSBuZXcgZ29vZ2xlLmltYS5BZERpc3BsYXlDb250YWluZXIoCiAgICAgICAgICAgICAgICAgICAgICAgIGRvY3VtZW50LmdldEVsZW1lbnRCeUlkKCdTVmFkQ29udGFpbmVyJyksIHZpZGVvQ29udGVudCk7CiAgICAgICAgICAgIH0KCgogICAgICAgICAgICBmdW5jdGlvbiBwbGF5QWRzKCkgewoKICAgICAgICAgICAgICAgIHZpZGVvQ29udGVudC5sb2FkKCk7CiAgICAgICAgICAgICAgICBhZERpc3BsYXlDb250YWluZXIuaW5pdGlhbGl6ZSgpOwoKICAgICAgICAgICAgICAgIHRyeSB7CiAgICAgICAgICAgICAgICAgICAgYWRzTWFuYWdlci5pbml0KHJlcXVlc3Rfd2lkdGgsIHJlcXVlc3RfaGVpZ2h0LCBnb29nbGUuaW1hLlZpZXdNb2RlLk5PUk1BTCk7CgogICAgICAgICAgICAgICAgICAgIGFkc01hbmFnZXIuc3RhcnQoKTsKCgogICAgICAgICAgICAgICAgfSBjYXRjaCAoYWRFcnJvcikgewogICAgICAgICAgICAgICAgICAgIHZpZGVvQ29udGVudC5wbGF5KCk7CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgIH0KCiAgICAgICAgICAgIGZ1bmN0aW9uIG9uQWRzTWFuYWdlckxvYWRlZChhZHNNYW5hZ2VyTG9hZGVkRXZlbnQpIHsKCiAgICAgICAgICAgICAgICBjb25zdCBhZHNSZW5kZXJpbmdTZXR0aW5ncyA9IG5ldyBnb29nbGUuaW1hLkFkc1JlbmRlcmluZ1NldHRpbmdzKCk7CiAgICAgICAgICAgICAgICBhZHNSZW5kZXJpbmdTZXR0aW5ncy5yZXN0b3JlQ3VzdG9tUGxheWJhY2tTdGF0ZU9uQWRCcmVha0NvbXBsZXRlID0gdHJ1ZTsKCiAgICAgICAgICAgICAgICBhZHNNYW5hZ2VyID0KICAgICAgICAgICAgICAgICAgICAgICAgYWRzTWFuYWdlckxvYWRlZEV2ZW50LmdldEFkc01hbmFnZXIodmlkZW9Db250ZW50LCBhZHNSZW5kZXJpbmdTZXR0aW5ncyk7CgoKICAgICAgICAgICAgICAgIGFkc01hbmFnZXIuYWRkRXZlbnRMaXN0ZW5lcihnb29nbGUuaW1hLkFkRXJyb3JFdmVudC5UeXBlLkFEX0VSUk9SLCBvbkFkRXJyb3IpOwogICAgICAgICAgICAgICAgYWRzTWFuYWdlci5hZGRFdmVudExpc3RlbmVyKAogICAgICAgICAgICAgICAgICAgICAgICBnb29nbGUuaW1hLkFkRXZlbnQuVHlwZS5DT05URU5UX1BBVVNFX1JFUVVFU1RFRCwgb25Db250ZW50UGF1c2VSZXF1ZXN0ZWQpOwogICAgICAgICAgICAgICAgYWRzTWFuYWdlci5hZGRFdmVudExpc3RlbmVyKAogICAgICAgICAgICAgICAgICAgICAgICBnb29nbGUuaW1hLkFkRXZlbnQuVHlwZS5DT05URU5UX1JFU1VNRV9SRVFVRVNURUQsCiAgICAgICAgICAgICAgICAgICAgICAgIG9uQ29udGVudFJlc3VtZVJlcXVlc3RlZCk7CiAgICAgICAgICAgICAgICBhZHNNYW5hZ2VyLmFkZEV2ZW50TGlzdGVuZXIoCiAgICAgICAgICAgICAgICAgICAgICAgIGdvb2dsZS5pbWEuQWRFdmVudC5UeXBlLkFMTF9BRFNfQ09NUExFVEVELCBvbkFkRXZlbnQpOwogICAgICAgICAgICAgICAgYWRzTWFuYWdlci5hZGRFdmVudExpc3RlbmVyKGdvb2dsZS5pbWEuQWRFdmVudC5UeXBlLkxPQURFRCwgb25BZEV2ZW50KTsKICAgICAgICAgICAgICAgIGFkc01hbmFnZXIuYWRkRXZlbnRMaXN0ZW5lcihnb29nbGUuaW1hLkFkRXZlbnQuVHlwZS5TVEFSVEVELCBvbkFkRXZlbnQpOwogICAgICAgICAgICAgICAgYWRzTWFuYWdlci5hZGRFdmVudExpc3RlbmVyKGdvb2dsZS5pbWEuQWRFdmVudC5UeXBlLkNPTVBMRVRFLCBvbkFkRXZlbnQpOwoKCiAgICAgICAgICAgICAgICBpZiAodmlkZW9Db250ZW50Lm11dGVkKSB7CiAgICAgICAgICAgICAgICAgICAgY29uc29sZS5sb2coIlZJREVPIE1VVEVEIik7CiAgICAgICAgICAgICAgICAgICAgYWRzTWFuYWdlci5zZXRWb2x1bWUoMCk7CiAgICAgICAgICAgICAgICAgICAgaXNfdm9sdW1lID0gMDsKICAgICAgICAgICAgICAgICAgICBkb2N1bWVudC5nZXRFbGVtZW50QnlJZCgic3Ytc291bmQtdG9nZ2xlIikuY2xhc3NOYW1lID0gInN2LXZvbHVtZS1tdXRlIjsKICAgICAgICAgICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgICAgICAgICAgY29uc29sZS5sb2coIlZJREVPIE5PVCBNVVRFRCIpOwogICAgICAgICAgICAgICAgICAgIGFkc01hbmFnZXIuc2V0Vm9sdW1lKDAuMDEpOwogICAgICAgICAgICAgICAgICAgIGlzX3ZvbHVtZSA9IDE7CiAgICAgICAgICAgICAgICAgICAgZG9jdW1lbnQuZ2V0RWxlbWVudEJ5SWQoInN2LXNvdW5kLXRvZ2dsZSIpLmNsYXNzTmFtZSA9ICJzdi12b2x1bWUtdW4tbXV0ZSI7CiAgICAgICAgICAgICAgICB9CgoKICAgICAgICAgICAgICAgIGFkRGlzcGxheUNvbnRhaW5lci5pbml0aWFsaXplKCk7CgogICAgICAgICAgICAgICAgdHJ5IHsKICAgICAgICAgICAgICAgICAgICBhZHNNYW5hZ2VyLmluaXQocmVxdWVzdF93aWR0aCwgcmVxdWVzdF9oZWlnaHQsIGdvb2dsZS5pbWEuVmlld01vZGUuTk9STUFMKTsKCiAgICAgICAgICAgICAgICAgICAgYWRzTWFuYWdlci5zdGFydCgpOwogICAgICAgICAgICAgICAgfSBjYXRjaCAoYWRFcnJvcikgewoKCiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgIH0KCiAgICAgICAgICAgIGZ1bmN0aW9uIG9uQWRFdmVudChhZEV2ZW50KSB7CgogICAgICAgICAgICAgICAgY29uc3QgYWQgPSBhZEV2ZW50LmdldEFkKCk7CiAgICAgICAgICAgICAgICBzd2l0Y2ggKGFkRXZlbnQudHlwZSkgewogICAgICAgICAgICAgICAgICAgIGNhc2UgZ29vZ2xlLmltYS5BZEV2ZW50LlR5cGUuTE9BREVEOgoKICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCFhZC5pc0xpbmVhcigpKSB7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgdmlkZW9Db250ZW50LnBsYXkoKTsKICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKICAgICAgICAgICAgICAgICAgICBjYXNlIGdvb2dsZS5pbWEuQWRFdmVudC5UeXBlLlNUQVJURUQ6CgogICAgICAgICAgICAgICAgICAgICAgICBpc19hZHNfcGxheWluZyA9IDE7CiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChhZC5pc0xpbmVhcigpKSB7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50ZXJ2YWxUaW1lciA9IHNldEludGVydmFsKAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmdW5jdGlvbiAoKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDMwMCk7ICAvLyBldmVyeSAzMDBtcwogICAgICAgICAgICAgICAgICAgICAgICB9CgogICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKICAgICAgICAgICAgICAgICAgICBjYXNlIGdvb2dsZS5pbWEuQWRFdmVudC5UeXBlLkNPTVBMRVRFOgogICAgICAgICAgICAgICAgICAgICAgICBpZiAoYWQuaXNMaW5lYXIoKSkgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgY2xlYXJJbnRlcnZhbChpbnRlcnZhbFRpbWVyKTsKICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICBpc19hZHNfcGxheWluZyA9IDA7CgoKCgogICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgfQoKICAgICAgICAgICAgZnVuY3Rpb24gb25BZEVycm9yKGFkRXJyb3JFdmVudCkgewoKICAgICAgICAgICAgICAgIHRyeSB7CiAgICAgICAgICAgICAgICAgICAgYWRzTWFuYWdlci5kZXN0cm95KCk7CiAgICAgICAgICAgICAgICB9IGNhdGNoIChhZEVycm9yKSB7CgoKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgfQoKCiAgICAgICAgICAgIGZ1bmN0aW9uIG9uQ29udGVudFBhdXNlUmVxdWVzdGVkKCkgewogICAgICAgICAgICAgICAgU1Zpc0FkUGxheWluZyA9IHRydWU7CiAgICAgICAgICAgICAgICB2aWRlb0NvbnRlbnQucGF1c2UoKTsKICAgICAgICAgICAgICAgIHZpZGVvX2NvbnRlbnRfcGF1c2UgPSAxOwoKICAgICAgICAgICAgfQoKCiAgICAgICAgICAgIGZ1bmN0aW9uIG9uQ29udGVudFJlc3VtZVJlcXVlc3RlZCgpIHsKICAgICAgICAgICAgICAgIFNWaXNBZFBsYXlpbmcgPSBmYWxzZTsKICAgICAgICAgICAgICAgIHZpZGVvX2NvbnRlbnRfcGF1c2UgPSAwOwogICAgICAgICAgICAgICAgaWYgKCFpc0NvbnRlbnRGaW5pc2hlZCkgewogICAgICAgICAgICAgICAgICAgIHZpZGVvQ29udGVudC5wbGF5KCk7CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICB2YXIgZWwgPSBkb2N1bWVudC5nZXRFbGVtZW50QnlJZCgnU1ZhZENvbnRhaW5lcicpOwovLyAgICAgICAgICAgICAgICBlbC5yZW1vdmVDaGlsZChlbC5maXJzdENoaWxkKTsKICAgICAgICAgICAgICAgIHdoaWxlIChlbC5maXJzdENoaWxkKSB7CiAgICAgICAgICAgICAgICAgICAgZWwucmVtb3ZlQ2hpbGQoZWwubGFzdENoaWxkKTsKICAgICAgICAgICAgICAgIH0KCiAgICAgICAgICAgIH0KCgoKICAgICAgICAgICAgZnVuY3Rpb24gcGxheVBhdXNlKGlzRG9jdW1lbnRoaWRkZW4sIGNsaWNrZWRfYnlfdXNlcikgewoKICAgICAgICAgICAgICAgIGlmIChjbGlja2VkX2J5X3VzZXIgPT09IDEgJiYgaXNEb2N1bWVudGhpZGRlbiA9PT0gMCkgewogICAgICAgICAgICAgICAgICAgIGlmIChTVmlzQWRQbGF5aW5nICYmIHBhdXNlX2J5X3VzZXIgPT09IDApIHsKICAgICAgICAgICAgICAgICAgICAgICAgYWRzTWFuYWdlci5wYXVzZSgpOwogICAgICAgICAgICAgICAgICAgICAgICBpc19wbGF5X3BhdXNlID0gMDsKICAgICAgICAgICAgICAgICAgICAgICAgZG9jdW1lbnQuZ2V0RWxlbWVudEJ5SWQoInN2LXBsYXktdG9nZ2xlIikuY2xhc3NOYW1lID0gInN2LXBsYXkiOwogICAgICAgICAgICAgICAgICAgICAgICBwYXVzZV9ieV91c2VyID0gMTsKICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKFNWaXNBZFBsYXlpbmcgJiYgcGF1c2VfYnlfdXNlciA9PT0gMSkgewogICAgICAgICAgICAgICAgICAgICAgICBhZHNNYW5hZ2VyLnJlc3VtZSgpOwogICAgICAgICAgICAgICAgICAgICAgICBpc19wbGF5X3BhdXNlID0gMTsKICAgICAgICAgICAgICAgICAgICAgICAgZG9jdW1lbnQuZ2V0RWxlbWVudEJ5SWQoInN2LXBsYXktdG9nZ2xlIikuY2xhc3NOYW1lID0gInN2LXBhdXNlIjsKICAgICAgICAgICAgICAgICAgICAgICAgcGF1c2VfYnlfdXNlciA9IDA7CiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmICghU1Zpc0FkUGxheWluZyAmJiBwYXVzZV9ieV91c2VyID09PSAwKSB7CiAgICAgICAgICAgICAgICAgICAgICAgIHZpZGVvQ29udGVudC5wYXVzZSgpOwogICAgICAgICAgICAgICAgICAgICAgICBkb2N1bWVudC5nZXRFbGVtZW50QnlJZCgic3YtcGxheS10b2dnbGUiKS5jbGFzc05hbWUgPSAic3YtcGxheSI7CiAgICAgICAgICAgICAgICAgICAgICAgIHBhdXNlX2J5X3VzZXIgPSAxOwogICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoIVNWaXNBZFBsYXlpbmcgJiYgcGF1c2VfYnlfdXNlciA9PT0gMSkgewogICAgICAgICAgICAgICAgICAgICAgICB2aWRlb0NvbnRlbnQucGxheSgpOwogICAgICAgICAgICAgICAgICAgICAgICBkb2N1bWVudC5nZXRFbGVtZW50QnlJZCgic3YtcGxheS10b2dnbGUiKS5jbGFzc05hbWUgPSAic3YtcGF1c2UiOwogICAgICAgICAgICAgICAgICAgICAgICBwYXVzZV9ieV91c2VyID0gMDsKICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGlzRG9jdW1lbnRoaWRkZW4gPT09IDEpIHsKICAgICAgICAgICAgICAgICAgICBpZiAoU1Zpc0FkUGxheWluZyAmJiBwYXVzZV9ieV91c2VyID09PSAwKSB7CiAgICAgICAgICAgICAgICAgICAgICAgIGFkc01hbmFnZXIucGF1c2UoKTsKICAgICAgICAgICAgICAgICAgICAgICAgaXNfcGxheV9wYXVzZSA9IDA7CiAgICAgICAgICAgICAgICAgICAgICAgIGRvY3VtZW50LmdldEVsZW1lbnRCeUlkKCJzdi1wbGF5LXRvZ2dsZSIpLmNsYXNzTmFtZSA9ICJzdi1wbGF5IjsKICAgICAgICAgICAgICAgICAgICAgICAgcGF1c2VfYnlfdXNlciA9IDA7CiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmICghU1Zpc0FkUGxheWluZyAmJiBwYXVzZV9ieV91c2VyID09PSAwKSB7CiAgICAgICAgICAgICAgICAgICAgICAgIHRyeSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICB2aWRlb0NvbnRlbnQucGF1c2UoKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRvY3VtZW50LmdldEVsZW1lbnRCeUlkKCJzdi1wbGF5LXRvZ2dsZSIpLmNsYXNzTmFtZSA9ICJzdi1wbGF5IjsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBhdXNlX2J5X3VzZXIgPSAwOwogICAgICAgICAgICAgICAgICAgICAgICB9IGNhdGNoIChFcnJvcikgewoKICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoaXNEb2N1bWVudGhpZGRlbiA9PT0gMCkgewoKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgfQoKCiAgICAgICAgICAgIGZ1bmN0aW9uIG11dGVVbm11dGUoKSB7CiAgICAgICAgICAgICAgICBpZiAoaXNfdm9sdW1lID09PSAxKSB7CiAgICAgICAgICAgICAgICAgICAgaXNfdm9sdW1lID0gMDsKICAgICAgICAgICAgICAgICAgICB0cnkgewogICAgICAgICAgICAgICAgICAgICAgICBhZHNNYW5hZ2VyLnNldFZvbHVtZSgwKTsKICAgICAgICAgICAgICAgICAgICAgICAgdmFzdF9zb3VuZCA9ICJ2cG11dGU9MSYiOwogICAgICAgICAgICAgICAgICAgIH0gY2F0Y2ggKGFkRXJyb3IpIHsKCgogICAgICAgICAgICAgICAgICAgIH0KCiAgICAgICAgICAgICAgICAgICAgZG9jdW1lbnQuZ2V0RWxlbWVudEJ5SWQoInN2LXNvdW5kLXRvZ2dsZSIpLmNsYXNzTmFtZSA9ICJzdi12b2x1bWUtbXV0ZSI7CiAgICAgICAgICAgICAgICAgICAgdmlkZW9Db250ZW50Lm11dGVkID0gdHJ1ZTsKICAgICAgICAgICAgICAgICAgICB2YXN0X3NvdW5kID0gInZwbXV0ZT0xJiI7CgoKICAgICAgICAgICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgICAgICAgICAgaXNfdm9sdW1lID0gMTsKICAgICAgICAgICAgICAgICAgICB0cnkgewogICAgICAgICAgICAgICAgICAgICAgICBhZHNNYW5hZ2VyLnNldFZvbHVtZSgwLjAxKTsKICAgICAgICAgICAgICAgICAgICAgICAgdmFzdF9zb3VuZCA9ICJ2cG11dGU9MCZwbGNtdD0xJiI7CiAgICAgICAgICAgICAgICAgICAgfSBjYXRjaCAoYWRFcnJvcikgewoKCiAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgIHZhc3Rfc291bmQgPSAidnBtdXRlPTAmcGxjbXQ9MSYiOwogICAgICAgICAgICAgICAgICAgIGRvY3VtZW50LmdldEVsZW1lbnRCeUlkKCJzdi1zb3VuZC10b2dnbGUiKS5jbGFzc05hbWUgPSAic3Ytdm9sdW1lLXVuLW11dGUiOwogICAgICAgICAgICAgICAgICAgIHZpZGVvQ29udGVudC5tdXRlZCA9IGZhbHNlOwogICAgICAgICAgICAgICAgfQoKICAgICAgICAgICAgfQoKCiAgICAgICAgICAgIGNvbnN0IFNWb3B0aW9ucyA9IHsKICAgICAgICAgICAgICAgIHJvb3Q6IG51bGwsCiAgICAgICAgICAgICAgICByb290TWFyZ2luOiAnMHB4JywKICAgICAgICAgICAgICAgIHRocmVzaG9sZDogMC41CiAgICAgICAgICAgIH07CgogICAgICAgICAgICBjb25zdCBmaXJzdF9zdl9vYnNlcnZlciA9IG5ldyBJbnRlcnNlY3Rpb25PYnNlcnZlcigoZW50cmllcywgb2JzZXJ2ZXIpID0+IHsKICAgICAgICAgICAgICAgIGVudHJpZXMuZm9yRWFjaChlbnRyeSA9PiB7CiAgICAgICAgICAgICAgICAgICAgaWYgKGVudHJ5LmlzSW50ZXJzZWN0aW5nKSB7CgogICAgICAgICAgICAgICAgICAgICAgICBvYnNlcnZlci51bm9ic2VydmUoZW50cnkudGFyZ2V0KTsKCiAgICAgICAgICAgICAgICAgICAgICAgIHZhciBHSU1BU2RrU2NyaXB0ID0gZG9jdW1lbnQuY3JlYXRlRWxlbWVudCgic2NyaXB0Iik7CiAgICAgICAgICAgICAgICAgICAgICAgIEdJTUFTZGtTY3JpcHQudHlwZSA9ICJ0ZXh0L2phdmFzY3JpcHQiOwogICAgICAgICAgICAgICAgICAgICAgICBHSU1BU2RrU2NyaXB0Lm9ubG9hZCA9IGZ1bmN0aW9uICgpIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZpZGVvQ29udGVudCA9IGRvY3VtZW50LmdldEVsZW1lbnRCeUlkKCdjb250ZW50RWxlbWVudCcpOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgcGxheUJ1dHRvbiA9IGRvY3VtZW50LmdldEVsZW1lbnRCeUlkKCdwbGF5QnV0dG9uJyk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZXRVcElNQSgpOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgcGxheUFkcygpOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgc3ZfaXNfZmxvYXRlcl9jbG9zZWQgPSAwOwoKICAgICAgICAgICAgICAgICAgICAgICAgfTsKICAgICAgICAgICAgICAgICAgICAgICAgR0lNQVNka1NjcmlwdC5zcmMgPSAiLy9pbWFzZGsuZ29vZ2xlYXBpcy5jb20vanMvc2RrbG9hZGVyL2ltYTMuanMiOwogICAgICAgICAgICAgICAgICAgICAgICBkb2N1bWVudC5nZXRFbGVtZW50c0J5VGFnTmFtZSgiaGVhZCIpWzBdLmFwcGVuZENoaWxkKEdJTUFTZGtTY3JpcHQpOwoKICAgICAgICAgICAgICAgICAgICAgICAgc2V0SW50ZXJ2YWwoZnVuY3Rpb24gKCkgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCFTVmlzQWRQbGF5aW5nKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2V0VXBJTUEoKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KCiAgICAgICAgICAgICAgICAgICAgICAgIH0sIDEwMDApOwoKCiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKCiAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgfSk7CiAgICAgICAgICAgIH0sIFNWb3B0aW9ucyk7CgogICAgICAgICAgICBjb25zdCB0YXJnZXRFbGVtZW50ID0gZG9jdW1lbnQucXVlcnlTZWxlY3RvcignI1NWbWFpbkNvbnRhaW5lcicpOwogICAgICAgICAgICBmaXJzdF9zdl9vYnNlcnZlci5vYnNlcnZlKHRhcmdldEVsZW1lbnQpOwoKICAgICAgICAgICAgc2V0SW50ZXJ2YWwoZnVuY3Rpb24gKCkgewogICAgICAgICAgICAgICAgd2luZG93Lm9uZm9jdXMgPSBmdW5jdGlvbiAoKSB7CiAgICAgICAgICAgICAgICAgICAgaXNTVlRhYkFjdGl2ZSA9IHRydWU7CiAgICAgICAgICAgICAgICAgICAgaWYgKGlzU1ZUYWJBY3RpdmUgPT09IHRydWUpIHsKCiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChzdl9pc19mbG9hdGVyX2Nsb3NlZCA9PT0gMSkgewoKICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChTVmlzQWRQbGF5aW5nICYmIHBhdXNlX2J5X3VzZXIgPT09IDApIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhZHNNYW5hZ2VyLnJlc3VtZSgpOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBsYXlfcGF1c2UgPSAxOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRvY3VtZW50LmdldEVsZW1lbnRCeUlkKCJzdi1wbGF5LXRvZ2dsZSIpLmNsYXNzTmFtZSA9ICJzdi1wYXVzZSI7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKCFTVmlzQWRQbGF5aW5nICYmIHBhdXNlX2J5X3VzZXIgPT09IDAgJiYgdmlkZW9fY29udGVudF9wYXVzZSA9PT0gMSkgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZpZGVvQ29udGVudC5wbGF5KCk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZG9jdW1lbnQuZ2V0RWxlbWVudEJ5SWQoInN2LXBsYXktdG9nZ2xlIikuY2xhc3NOYW1lID0gInN2LXBhdXNlIjsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgICAgfQoKCiAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgfTsKICAgICAgICAgICAgICAgIHdpbmRvdy5vbmJsdXIgPSBmdW5jdGlvbiAoKSB7CiAgICAgICAgICAgICAgICAgICAgaXNTVlRhYkFjdGl2ZSA9IGZhbHNlOwogICAgICAgICAgICAgICAgICAgIGlmIChpc1NWVGFiQWN0aXZlID09PSBmYWxzZSkgewogICAgICAgICAgICAgICAgICAgICAgICBpZiAoU1Zpc0FkUGxheWluZykgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgYWRzTWFuYWdlci5wYXVzZSgpOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgcGxheV9wYXVzZSA9IDA7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBkb2N1bWVudC5nZXRFbGVtZW50QnlJZCgic3YtcGxheS10b2dnbGUiKS5jbGFzc05hbWUgPSAic3YtcGxheSI7CiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoIVNWaXNBZFBsYXlpbmcgJiYgcGF1c2VfYnlfdXNlciA9PT0gMCAmJiB2aWRlb19jb250ZW50X3BhdXNlID09PSAwKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0cnkgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZpZGVvQ29udGVudC5wYXVzZSgpOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRvY3VtZW50LmdldEVsZW1lbnRCeUlkKCJzdi1wbGF5LXRvZ2dsZSIpLmNsYXNzTmFtZSA9ICJzdi1wbGF5IjsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwYXVzZV9ieV91c2VyID0gMDsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2aWRlb19jb250ZW50X3BhdXNlID0gMTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gY2F0Y2ggKEVycm9yKSB7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgfQoKICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgIH07CiAgICAgICAgICAgIH0sIDEwMDApOwoKCiAgICAgICAgICAgIGNvbnN0IHNlY29uZF9zdl9vYnNlcnZlciA9IG5ldyBJbnRlcnNlY3Rpb25PYnNlcnZlcigoZW50cmllcywgb2JzZXJ2ZXIpID0+IHsKICAgICAgICAgICAgICAgIGVudHJpZXMuZm9yRWFjaChlbnRyeSA9PiB7CiAgICAgICAgICAgICAgICAgICAgaWYgKGVudHJ5LmlzSW50ZXJzZWN0aW5nKSB7CiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChzdl9pc19mbG9hdGVyX2Nsb3NlZCA9PT0gMCkgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgZG9jdW1lbnQuZ2V0RWxlbWVudEJ5SWQoIlNWbWFpbkNvbnRhaW5lciIpLmNsYXNzTmFtZSA9ICIiOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgc3ZfaXNfZmxvYXRlcl9hY3RpdmUgPSAwOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgZG9jdW1lbnQuZ2V0RWxlbWVudEJ5SWQoImNsb3NlLWZsb2F0ZXIiKS5jbGFzc0xpc3QucmVtb3ZlKCJzdi1zaG93Iik7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBkb2N1bWVudC5nZXRFbGVtZW50QnlJZCgiY2xvc2UtZmxvYXRlciIpLmNsYXNzTGlzdC5hZGQoInN2LWhpZGUiKTsKCiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoU1Zpc0FkUGxheWluZyAmJiBwYXVzZV9ieV91c2VyID09PSAwKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYWRzTWFuYWdlci5yZXN1bWUoKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpc19wbGF5X3BhdXNlID0gMTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkb2N1bWVudC5nZXRFbGVtZW50QnlJZCgic3YtcGxheS10b2dnbGUiKS5jbGFzc05hbWUgPSAic3YtcGF1c2UiOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBhdXNlX2J5X3VzZXIgPSAwOwoKICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoIVNWaXNBZFBsYXlpbmcgJiYgdmlkZW9fY29udGVudF9wYXVzZSA9PT0gMSkgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZpZGVvQ29udGVudC5wbGF5KCk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZG9jdW1lbnQuZ2V0RWxlbWVudEJ5SWQoInN2LXBsYXktdG9nZ2xlIikuY2xhc3NOYW1lID0gInN2LXBhdXNlIjsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwYXVzZV9ieV91c2VyID0gMDsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgIH0KCiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKCiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChzdl9pc19mbG9hdGVyX2Nsb3NlZCA9PT0gMCkgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgZG9jdW1lbnQuZ2V0RWxlbWVudEJ5SWQoIlNWbWFpbkNvbnRhaW5lciIpLmNsYXNzTmFtZSA9ICJmbG9hdGVyX3N2IjsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN2X2lzX2Zsb2F0ZXJfYWN0aXZlID0gMTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRvY3VtZW50LmdldEVsZW1lbnRCeUlkKCJjbG9zZS1mbG9hdGVyIikuY2xhc3NMaXN0LmFkZCgic3Ytc2hvdyIpOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgZG9jdW1lbnQuZ2V0RWxlbWVudEJ5SWQoImNsb3NlLWZsb2F0ZXIiKS5jbGFzc0xpc3QucmVtb3ZlKCJzdi1oaWRlIik7CgogICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKFNWaXNBZFBsYXlpbmcgJiYgcGF1c2VfYnlfdXNlciA9PT0gMCkgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFkc01hbmFnZXIucGF1c2UoKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpc19wbGF5X3BhdXNlID0gMDsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkb2N1bWVudC5nZXRFbGVtZW50QnlJZCgic3YtcGxheS10b2dnbGUiKS5jbGFzc05hbWUgPSAic3YtcGxheSI7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGF1c2VfYnlfdXNlciA9IDA7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKCFTVmlzQWRQbGF5aW5nICYmIHBhdXNlX2J5X3VzZXIgPT09IDApIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0cnkgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2aWRlb0NvbnRlbnQucGF1c2UoKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZG9jdW1lbnQuZ2V0RWxlbWVudEJ5SWQoInN2LXBsYXktdG9nZ2xlIikuY2xhc3NOYW1lID0gInN2LXBsYXkiOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwYXVzZV9ieV91c2VyID0gMDsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmlkZW9fY29udGVudF9wYXVzZSA9IDE7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBjYXRjaCAoRXJyb3IpIHsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICB9CgogICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgIH0pOwogICAgICAgICAgICB9LCBTVm9wdGlvbnMpOwoKICAgICAgICAgICAgZG9jdW1lbnQuYWRkRXZlbnRMaXN0ZW5lcignc2Nyb2xsJywgZnVuY3Rpb24gKCkgewoKICAgICAgICAgICAgICAgIGNvbnN0IHRhcmdldEVsZW1lbnRGaXJzdCA9IGRvY3VtZW50LnF1ZXJ5U2VsZWN0b3IoJyNtYWluX3N2Q29udGFpbmVyJyk7CiAgICAgICAgICAgICAgICBzZWNvbmRfc3Zfb2JzZXJ2ZXIub2JzZXJ2ZSh0YXJnZXRFbGVtZW50Rmlyc3QpOwogICAgICAgICAgICB9LCB7CiAgICAgICAgICAgICAgICBwYXNzaXZlOiB0cnVlCiAgICAgICAgICAgIH0pOwoKICAgICAgICAgICAgdG9wLmRvY3VtZW50LmdldEVsZW1lbnRCeUlkKCdjbG9zZS1mbG9hdGVyJykub25jbGljayA9IGZ1bmN0aW9uIChldnQpIHsKICAgICAgICAgICAgICAgIGRvY3VtZW50LmdldEVsZW1lbnRCeUlkKCJTVm1haW5Db250YWluZXIiKS5jbGFzc05hbWUgPSAiIjsKCiAgICAgICAgICAgICAgICBzdl9pc19mbG9hdGVyX2Nsb3NlZCA9IDE7CiAgICAgICAgICAgICAgICBzdl9pc19mbG9hdGVyX2FjdGl2ZSA9IDA7CiAgICAgICAgICAgICAgICB2aWRlb19jb250ZW50X3BhdXNlID0gMDsKICAgICAgICAgICAgICAgIGRvY3VtZW50LmdldEVsZW1lbnRCeUlkKCJjbG9zZS1mbG9hdGVyIikuY2xhc3NMaXN0LnJlbW92ZSgic3Ytc2hvdyIpOwogICAgICAgICAgICAgICAgZG9jdW1lbnQuZ2V0RWxlbWVudEJ5SWQoImNsb3NlLWZsb2F0ZXIiKS5jbGFzc0xpc3QuYWRkKCJzdi1oaWRlIik7CiAgICAgICAgICAgICAgICBpZiAoU1Zpc0FkUGxheWluZykgewogICAgICAgICAgICAgICAgICAgIGFkc01hbmFnZXIucGF1c2UoKTsKICAgICAgICAgICAgICAgICAgICBwbGF5X3BhdXNlID0gMDsKICAgICAgICAgICAgICAgICAgICBkb2N1bWVudC5nZXRFbGVtZW50QnlJZCgic3YtcGxheS10b2dnbGUiKS5jbGFzc05hbWUgPSAic3YtcGxheSI7CgogICAgICAgICAgICAgICAgfSBlbHNlIGlmICghU1Zpc0FkUGxheWluZykgewogICAgICAgICAgICAgICAgICAgIHZpZGVvQ29udGVudC5wYXVzZSgpOwogICAgICAgICAgICAgICAgICAgIGRvY3VtZW50LmdldEVsZW1lbnRCeUlkKCJzdi1wbGF5LXRvZ2dsZSIpLmNsYXNzTmFtZSA9ICJzdi1wbGF5IjsKICAgICAgICAgICAgICAgICAgICBwYXVzZV9ieV91c2VyID0gMDsKICAgICAgICAgICAgICAgIH0KCiAgICAgICAgICAgICAgICBpc192b2x1bWUgPSAwOwogICAgICAgICAgICAgICAgYWRzTWFuYWdlci5zZXRWb2x1bWUoMCk7CiAgICAgICAgICAgICAgICBkb2N1bWVudC5nZXRFbGVtZW50QnlJZCgic3Ytc291bmQtdG9nZ2xlIikuY2xhc3NOYW1lID0gInN2LXZvbHVtZS1tdXRlIjsKICAgICAgICAgICAgICAgIHZpZGVvQ29udGVudC5tdXRlZCA9IHRydWU7CiAgICAgICAgICAgIH07CiAgICAgICAgPC9zY3JpcHQ+').clientWidth;
}else if(company==9){
var video_div=document.getElementsByClassName("dm-player")[0].clientWidth;
}else{
video_div=sureview_div;
}
var diff=(sureview_div)-(video_div);
var padd='0px';
if(diff>10){
padd=diff/2+"px";
}
var bottom_div = document.createElement("div");
bottom_div.id="sureview_branding";
bottom_div.className="sureviewBottomDiv sureviewtv";
var anchor1=document.createElement("a");
anchor1.href="http://sureview.tv/";
anchor1.target="_BLANK";
var bottom_logo_img = document.createElement("img");
bottom_logo_img.id="sureview_logo_bottom";
bottom_logo_img.src="https://app.sureview.tv/logo/sureview_logo.svg";
anchor1.appendChild(bottom_logo_img);
bottom_div.appendChild(anchor1);
if(company==1){
try{
vdo_player= document.getElementsByClassName("vdo_content")[0].getElementsByTagName("video-js")[0].getElementsByClassName('ima-ad-container')[0].getElementsByTagName('div')[1].getElementsByTagName('video')[0];
if(vdo_player.duration>5){
x.appendChild(bottom_div);
document.getElementById("sureview_logo_bottom").style.padding = "0px "+padd+" 0px 0px";
if(video_div>0){
clearInterval(setlogo_intval);
}
}else{
if(counter==2){
clearInterval(setlogo_intval);
}
}
}catch(error){
if(counter==2){
clearInterval(setlogo_intval);
}
}
}else if(company==2){
try{
teads_player=document.getElementsByClassName("teads-inread")[0].getElementsByTagName("iframe")[0].contentDocument.getElementsByTagName("iframe")[0].contentDocument.getElementsByTagName('video')[0];
if(teads_player.duration>5){
x.appendChild(bottom_div);
document.getElementById("sureview_logo_bottom").style.padding = "0px "+padd+" 0px 0px";
if(video_div>0){
clearInterval(setlogo_intval);
}
}else{
}
}catch(error){
}
}else if(company==9){
}
}catch(Error){
if(counter==10){
clearInterval(setlogo_intval);
}
}
},1000);
}
function get_video_duration(){
refreshIntervalId=setInterval(function(){
try{
vdo_player= document.getElementsByClassName("vdo_content")[0].getElementsByTagName("video-js")[0].getElementsByClassName('ima-ad-container')[0].getElementsByTagName('div')[1].getElementsByTagName('video')[0];
if(isNaN(vdo_player.duration) || vdo_player.duration==0){
setTimeout(function(){
clearInterval(refreshIntervalId);
change_ads(2);
},1000);
}else{
}
}catch(error){
try{
teads_player=document.getElementsByClassName("teads-inread")[0].getElementsByTagName("iframe")[0].contentDocument.getElementsByTagName("iframe")[0].contentDocument.getElementsByTagName('video')[0];
setTimeout(function(){
if(teads_player.currentTime===0){
change_ads(1);
clearInterval(refreshIntervalId);
}else{
}
},10000);
if(isNaN(teads_player.duration)){
setTimeout(function(){
change_ads(1);
},10000);
}else{
if(teads_player.duration==teads_player.currentTime){
setTimeout(function(){
change_ads(1);
},10000);
}
}
}catch(error){
clearInterval(refreshIntervalId);
try{
teads_player=document.getElementsByClassName("teads-inread")[0].getElementsByTagName("iframe")[0].children;
}catch(error){
change_ads(1);
}
}
}
}, 10000);
}
function change_ads(ads_id){
clearInterval(refreshIntervalId);
if(ads_id==1){
add_vdo();
}else if(ads_id==2){
add_teads();
}
}
function add_vdo(){
if(is_active_vdo==1){
set_bottom_logo(1);
try{
document.querySelector('script[src*="vdo.ai"]').remove();
}catch(error){
console.log("VDO ERROR",error);
}
document.getElementsByClassName("sureview-content")[0].innerHTML = "";
running_ads=1;
if(placement_salector!=0){
try {
placement_salector[no_of_tag].appendChild(x);
}
catch (exception_var) {
}
ad_displaying=1;
x.appendChild(vdo);
(function(v,d,o,ai)
{ai=d.createElement('script');ai.defer=true;ai.async=true;ai.src=v.location.protocol+o;d.head.appendChild(ai);})(window, document, '//a.vdo.ai/core/'+vdo_id+'/vdo.ai.js');
}else{
x.appendChild(vdo);
(function(v,d,o,ai)
{ai=d.createElement('script');ai.defer=true;ai.async=true;ai.src=v.location.protocol+o;d.head.appendChild(ai);})(window, document, '//a.vdo.ai/core/'+vdo_id+'/vdo.ai.js');
}
}
}
function add_teads(){
if(is_active_teads==1){
set_bottom_logo(2);
clearInterval(setlogo_intval);
document.getElementsByClassName("sureview-content")[0].innerHTML = "";
running_ads=2;
if(placement_salector!=0){
ad_displaying=1;
x.appendChild(teads_main_div);
try {
placement_salector[no_of_tag].appendChild(x);
}catch (exception_var) {
}
}else{
x.appendChild(teads_main_div);
}
}
}
function remove_logo_2(){
try{
document.getElementById("sureview_branding").remove();
}catch(error){
}
}
const box = document.getElementById('Sureview276');
document.addEventListener('scroll', function () {
var inVpPartial = isElementPartiallyInViewport(box);
if(inVpPartial==true){
}else{
}
}, {
passive: true
});
function isElementPartiallyInViewport(el)
{
if (typeof jQuery !== 'undefined' && el instanceof jQuery)
el = el[0];
var rect = el.getBoundingClientRect();
var windowHeight = (window.innerHeight || document.documentElement.clientHeight);
var windowWidth = (window.innerWidth || document.documentElement.clientWidth);
var vertInView = (rect.top <= windowHeight) && ((rect.top + rect.height) >= 0);
var horInView = (rect.left <= windowWidth) && ((rect.left + rect.width) >= 0);
return (vertInView && horInView);
}
})();