var newTabLinkText="Pause Testing Daily in new tab for",supp_filter=0,perDayShowLimit=4;
chrome.storage.local.get(["pause","upto","pausestarttime","todayDay","showLimit"],function(a){if(a.pause)if(-5==parseInt(a.upto))moment().day()==a.todayDay?-1<location.href.indexOf("exticon")?newTabLinkText="Active new tab":0<=a.showLimit?(chrome.storage.local.set({showLimit:parseInt(a.showLimit)-1}),newTabLinkText="Active new tab"):chrome.runtime.sendMessage({opend:!0}):chrome.storage.local.set({showLimit:perDayShowLimit,todayDay:moment().day()});else{let c=60*parseInt(a.upto);moment().unix()-a.pausestarttime<
c&&(-1<location.href.indexOf("exticon")?newTabLinkText="Active new tab":chrome.runtime.sendMessage({opend:!0}))}});
var bookmarkImages=['<img title="Add to bookmark" data-toggle="tooltip" data-placement="bottom" class="bookmark do-bookmark" src="../assets/images/review-grey.png">','<img title="Remove bookmark" data-toggle="tooltip" data-placement="bottom" class="bookmark do-bookmark" src="../assets/images/review-orange.png">'],pinnedImageUrl="../assets/images/poll/pinned.png",sponsoredPostImageUrl="../assets/images/sponsored.jpeg",noMoreResults='<div class="row feed_strip post feed_full_width no-more-row">\n<span class="no-more-results">No more results.</span>\n</div>',
feedType="latest",feedTypebysearch=!1,sponsoredPost=[],repeat_after_x=0;getSponsoredPost();function faviConUrl(a,c){return`https://backend.testingdaily.info/allfavicons/${a}.png`}function authorFaviConUrl(a,c){return null!=c?c:null!=a?a:"../assets/images/default/user-tag.png"}
function addTitles(){setInterval(()=>{$('[data-toggle="tooltip"]').tooltip()},500);$(".feed_strip").hover(function(){$(this).find(".read_feed").toggle();$(this).find(".icon_3").toggle()});$(".all_feeds").on("scroll",function(){if($(this).scrollTop()+$(this).innerHeight()>=$(this)[0].scrollHeight-2&&0!=$(".all_feeds .post").length){if(-1==supp_filter)return getEventFeed($(".all_feeds .post").length),!0;getFeed($(".all_feeds .post").length)}});$(".all_jobs").on("scroll",function(){if(!$(".no-more-row").length&&
$(this).scrollTop()+$(this).innerHeight()>=$(this)[0].scrollHeight-2&&0!=$(".all_jobs .post").length)return getJobFeed($(".all_jobs .post").length),!0});setTimeout(()=>{imloaderros2()},500)}function preParePostHtml(a,c){let b="";null!=a.isvoted&&(b="votted");iscommented="";"0"!=a.iscommented&&(iscommented="commented");let d=bookmarkImages[0];null!=a.isBookMark&&(d=bookmarkImages[1]);let e,f=` <span class="read_feed redirect-link" style="display:none">
  <a target="_blank" href="${a.url}" >
  <u>${null==a.external_label_link?"Read Article":a.external_label_link}</u>
  <img src="../assets/images/view.svg">
  </a>
  </span>`;2==a.supplier_id?(e=a.image,f=` <span class="read_feed redirect-link youtube-redirect" style="display:none; ">
                    <a target="_blank" href="${a.url}" >
                    <u>Watch on youtube</u>
                    <img src="${faviConUrl(a.supplier_id,a.display_author_logo)}">
                    </a>
                    </span>`):e=3==a.supplier_id?"../assets/images/feed-def-image.png":a.image;let g=JSON.parse(a.title);69<g.length&&(g=JSON.parse(a.title).substring(0,69)+"...");let h="";1==a.is_pin&&(h=`<span class="pinned-post-parent"><img class="pinned-post" src="${pinnedImageUrl}">Pinned post</span>`);1==a.is_sponsored&&(h=`<span class="pinned-post-parent"><img class="pinned-post" src="${sponsoredPostImageUrl}">Sponsored</span>`);let l="",m="",k="";null==e&&(k="dancing-class",e="../assets/images/white.png",
m=`<img data-toggle="modal" data-target="#myModal" class="${k} thumbnail-image open-post black-theme-thumbnail" src="../assets/images/black.png"></img>`,l=`<span class="two-ch-center">${g.substring(0,2)}</span>`);return`<div data-supplier-id="${a.supplier_id}" data-post-id ="${a.id}" class="row feed_strip post feed_full_width ${c} " >
      ${h}
      <div class="col-2">
      ${l}
            <img data-toggle="modal"  class="open-post ${k} white-theme-thumbnail" data-target="#myModal" src="${e}">
            ${m}
            </div>
            <div class="col-10 feed_icon">
            <p   class="open-post tooltip-r post-title" data-toggle="tooltip" data-placement="bottom" title="${JSON.parse(a.title)}">${g}</p>
           
            <img class="sup-favicon" src="${faviConUrl(a.supplier_id,a.display_author_logo)}">
            <span class="post-date-time">${displayDate(a.pubdate)}</span>
            <span class="post-author"><img src="${authorFaviConUrl(a.display_author_logo,a.author_logo)}" class="author-image">${null==a.display_author_name?JSON.parse(a.author_name):a.display_author_name}</span><br>
            <span class="pills upvote vote-btn ${b}">
                <img class="down-vote" src="../assets/images/up-vote.png">
                <img  class="up-vote" src="../assets/images/upvoted-r.png">
                <span class="counter">${a.vote_count}</span>
            </span>
            <span class="pills comment-pills ${iscommented}" id="msg_icon">
                <img class="comment-default" src="../assets/images/msg_icon.png">
                <img class="blue-comment" src="../assets/images/blue-message.png">
                <span class="counter1">${a.comment_count}</span>
            </span>
            <span class="pills bookmark-btn" id="msg_icon">
                ${d}
              </span>
            <span class="pills share-icons" id="share_icon" style="display:none">
                <img class="share-default" src="../assets/images/share_icon.png">
                <img class="green-share" src="../assets/images/green-share.png">
            </span>
            ${f}
           
        </div>
      </div>`}
function checkForSponsoredPost(){repeat_after_x=parseInt(repeat_after_x);if(sponsoredPost.length){let a=document.querySelectorAll(".all_feeds div.post[data-post-id]:not(.not-in-loop)");for(let d=0;d<=a.length;d+=repeat_after_x)0<d&&d<=a.length-1&&sponsoredPost.forEach(e=>{e=preParePostHtml(e,"sponsored-post");-1!=supp_filter&&(0==$(".sponsored-post").length?a[d-1].insertAdjacentHTML("afterend",e):a[d].insertAdjacentHTML("afterend",e))});$(".all_feeds div.post[data-post-id]:not(.not-in-loop)").addClass("not-in-loop");let c=
document.querySelectorAll(".all_feeds div.post.not-in-loop"),b=!0;for(let d=c.length-1;0<=d;d--)c[d].classList.contains("sponsored-post")&&(b=!1),b&&c[d].classList.remove("not-in-loop")}}let loadedPosts=-1;function addItemIntoFeed(a){-1!=supp_filter&&(a.forEach(c=>{let b=preParePostHtml(c,"not-sponsored");$('div.post[data-post-id="'+c.id+'"]').length||(1==c.is_pin?$(".all_feeds").prepend(b):$(".all_feeds").append(b))}),checkForSponsoredPost(),addTitles())}
function getFeed(a=0){$(".all_feeds").show();$(".all_jobs").hide();0==a&&$(".all_feeds").html("");if(loadedPosts!=a||0==a)loadedPosts=a,addingSkeletonLoading(!0),chrome.storage.local.get(["login"],function(c){$(".all_feeds").removeClass("section__popular").removeClass("section__most-voted").removeClass("section__best-discussion").removeClass("section__search");$(".all_feeds").addClass("section__"+feedType);let b=endpoint+"getfeed3?skip="+a+"&type="+feedType+"&supp_filter="+supp_filter;if(feedTypebysearch&&
""!=$("#search-posts").val().trim()&&(b=endpoint+"getfeed3?skip="+a+"&type="+feedType+"&supp_filter="+supp_filter+"&feedTypebysearch="+feedTypebysearch+"&searchtext="+$("#search-posts").val().trim().replaceAll("\u2019","'"),"<script"==$("#search-posts").val().trim()))return addingSkeletonLoading(!1),$(".all_feeds").append(noMoreResults),!1;$.ajax({method:"GET",url:b,headers:{Authorization:"Bearer "+c.login},success:function(d,e,f){addingSkeletonLoading(!1);1==d.status&&("search"==feedType&&""!=$("#search-posts").val().trim()?
$(".search-for").show().text('Search results for "'+$("#search-posts").val().trim()+'"'):$(".search-for").hide(),d=d.feed,d.length?addItemIntoFeed(d):$(".no-more-row").length||$(".all_feeds").append(noMoreResults))},statusCode:{500:function(d){},401:function(){},422:function(d){}}})})}
function showFeedFromStorage(a){$(".all_feeds").html("");addingSkeletonLoading(!0);$(".all_feeds").removeClass("section__popular").removeClass("section__most-voted").removeClass("section__best-discussion").removeClass("section__search");$(".all_feeds").addClass("section__latest");setTimeout(()=>{$(".all_feeds").html("");addItemIntoFeed(a)},100)}
function getPostComment(a){chrome.storage.local.get(["login"],function(c){$.ajax({method:"GET",url:endpoint+"getcomments?id="+a,headers:{Authorization:"Bearer "+c.login},success:function(b,d,e){1==b.status&&showComments(b.data,b.user_id,b.sa)},statusCode:{500:function(b){},401:function(){},422:function(b){}}})})}
function getMightLikePost(){skeletonloadingformightlike();$.ajax({method:"GET",url:endpoint+"getmightlikepost",success:function(a,c,b){1==a.status&&displayMightLikePost(a.likefeed)},statusCode:{500:function(a){},401:function(){},422:function(a){}}})}
function getOnePost(a){addingSkeletonLoadingForFullPost(!0);chrome.storage.local.get(["login"],function(c){$.ajax({method:"GET",url:endpoint+"getpost?id="+a,headers:{Authorization:"Bearer "+c.login},success:function(b,d,e){addingSkeletonLoadingForFullPost(!1);1==b.status&&showSinglePost(b.post)},statusCode:{500:function(b){},401:function(){},422:function(b){}}})})}
function checkNewTab(){setTimeout(()=>{"Active new tab"==newTabLinkText&&($(".nav-li-active-new-tab").addClass("active-li").show(),$(".nav-li-active-new-tab img").show(),$(".nav-li-pause-new-tab").hide())},100)}function getRandomInt(a){return Math.floor(Math.random()*a)}
$(document).ready(function(){$(".parent-text").on("click",function(){$(this).closest(".filter-parent").find(".sup-filter").eq(0).click()});$(".scroll-up").fadeOut();$(".scroll-up").on("click",function(){$(".all_feeds").animate({scrollTop:0},"500")});$(".all_feeds").on("scroll",function(){100<=$(this).scrollTop()?$(".scroll-up").fadeIn():$(".scroll-up").fadeOut()});$(".offline-details").slideUp(400);$('input[name="event_mode"]').change(function(){"1"==$(this).val()?$(".offline-details").slideUp(400):
"0"==$(this).val()&&$(".offline-details").slideDown(400)});$(".sup-filter:not(.job-filter)").click(function(){$(".search-post-can").css("display","inline").show();$(".search-job-can").hide()});$(".event-filter").click(function(){$(".all_feeds  div").remove();supp_filter=-1;feedType="latest";showTab("event");getEventFeed();getPinEvent()});$(".youtube-filter").click(function(){$('.all_feeds  div[data-supplier-id="2"]').show();$('.all_feeds  div[data-supplier-id]:not([data-supplier-id="2"]').hide();
supp_filter=1;showTab("youtube");getFeed()});$(".blogspot-filter").click(function(){supp_filter=2;$('.all_feeds div[data-supplier-id="2"]').hide();$('.all_feeds div[data-supplier-id]:not([data-supplier-id="2"]').show();showTab("blog");getFeed()});$(".job-filter").click(function(){supp_filter=3;showTab("job");$(".search-job-can").css("display","inline").show();$(".search-post-can").hide();$(".open-job").length?($(".all_feeds").hide(),$(".all_jobs").show()):(getJobFeed(),getPinJob())});$(".clear-job-search").click(function(){$("#search-jobs").val("");
$(".job-item, .no-more-row").remove();$(".job-filter").click();$(this).hide()});$(".home-filter").click(function(){supp_filter=0;showTab("home");$("#my-feed").click()});$(".nav-li-bookmark, .nav-li-best-discussion, .nav-li-most-voted, .nav-li-popular, .nav-li-my-feed").click(function(){supp_filter=0;$(".youtube-inactive, .event-inactive, .home-inactive, .blog-inactive").show();$(".youtube-active, .event-active, .home-active, .blog-active").hide()});$(".nav-li-my-feed").click(function(){supp_filter=
0;showTab("home")});null==localStorage.getItem("mode")?($(".dark-image").show(),$(".light-image").hide()):($("body").addClass("dark-mode"),$(".dark-image").hide(),$(".light-image").show(),localStorage.setItem("mode","dark"));$(".dark-image.dark-image").click(function(){$("body").addClass("dark-mode");$(".dark-image").hide();$(".light-image").show();localStorage.setItem("mode","dark")});$(".light-image").click(function(){$("body").removeClass("dark-mode");$(".dark-image").show();$(".light-image").hide();
localStorage.removeItem("mode")});$("#myModal").on("hidden.bs.modal",function(){$("#myModal").find("iframe").remove()});getPinPost();setTimeout(()=>{$("body").show()},200);checkNewTab();chrome.storage.local.get(["prefeed"],function(a){if("undefined"==typeof a.prefeed)getFeed(),chrome.runtime.sendMessage({prefeed:!0});else{prefeed=JSON.parse(a.prefeed);getOuterArrayIndex=[];for(a=0;200>a;a++){let b=getRandomInt(prefeed.length);getOuterArrayIndex.length<prefeed.length&&-1==getOuterArrayIndex.indexOf(b)&&
prefeed[b].length&&getOuterArrayIndex.push(b)}var c=[];getOuterArrayIndex.forEach(b=>{6!=c.length&&prefeed[b].length&&(c.push(prefeed[b][0]),prefeed[b].splice(0,1))});0==prefeed[0].length?chrome.runtime.sendMessage({prefeed:!0}):chrome.storage.local.set({prefeed:JSON.stringify(prefeed)});0==c.length?getFeed():(showFeedFromStorage(c),6>c.length&&getFeed())}});$("#search-posts").on("keyup",function(a){if("Enter"===a.key||13===a.keyCode)a=$("#search-posts").val().trim(),""!=a?(feedTypebysearch=!0,loadedPosts=
-1,-1==supp_filter?getEventFeed():3==supp_filter?($(".all_jobs").html(""),getJobFeed()):getFeed()):""==a&&"bookmark"==feedType&&$(".nav-li-bookmark").click()});$("#search-jobs").on("keyup",function(a){""==$("#search-jobs").val().trim()?$(".search-job-close-icon").hide():$(".search-job-close-icon").show();"Enter"!==a.key&&13!==a.keyCode||""==$("#search-jobs").val().trim()||(feedTypebysearch=!0,loadedPosts=-1,$(".all_jobs").html(""),getJobFeed(0))});$(document).on("click",".sidebar .nav-li",function(){$(".search-for").hide();
$(".my-feed-heading").css("display","inline-block");if($(this).hasClass("nav-li-my-feed"))feedType="latest",feedTypebysearch=!1,$("#search-posts").val(""),loadedPosts=-1,$("#search-posts").show(),getFeed(),getPinPost();else if($(this).hasClass("nav-li-popular"))feedType="popular",loadedPosts=-1,feedTypebysearch=!1,$("#search-posts").val(""),$("#search-posts").show(),getFeed();else if($(this).hasClass("nav-li-most-voted"))feedType="most-voted",loadedPosts=-1,feedTypebysearch=!1,$("#search-posts").val(""),
$("#search-posts").show(),getFeed();else if($(this).hasClass("nav-li-best-discussion"))feedType="best-discussion",loadedPosts=-1,feedTypebysearch=!1,$("#search-posts").val(""),$("#search-posts").show(),getFeed();else if(!$(this).hasClass("nav-li-submit-article"))if($(this).hasClass("nav-li-bookmark"))chrome.storage.local.get(["login"],function(a){if(void 0!==a.login&&a.login&&""!=a.login)feedType="bookmark",loadedPosts=-1,feedTypebysearch=!1,$("#search-posts").val(""),$("#search-posts").show(),getFeed(),
getEventFeed();else return $("button.close").click(),$(".login-link").click(),!1});else if(!$(this).hasClass("nav-li-pause-new-tab"))if($(this).hasClass("nav-li-groups"))$("#testing-group-modal").modal("show");else if($(this).hasClass("nav-li-active-new-tab"))chrome.storage.local.set({pause:!1},function(){$(".nav-li-active-new-tab").hide();$(".nav-li-pause-new-tab").show()});else if($(this).hasClass("nav-li-customize"))$("#customize-modal").modal("show");else if($(this).hasClass("nav-li-feedback"))window.open("https://my.bugasura.io/testing-daily/testing-daily");
else if($(this).hasClass("nav-li-invite-people")){let a=`https://twitter.com/share?text=${encodeURI("Testing Daily")}&url=https://chrome.google.com/webstore/detail/testingdaily/fpnceijpmnhdfjpgkaofcehohifomecd&via=SH_TestingDaily`;window.open(a)}else $(this).hasClass("nav-li-review")&&window.open("https://bit.ly/TD_review")});$(document).on("click",".pause-start",function(){void 0!==$('input[name="pauselimit"]:checked').val()?(-5==$('input[name="pauselimit"]:checked').val()?chrome.storage.local.set({showLimit:perDayShowLimit,
todayDay:moment().day(),pausestarttime:moment().unix(),pause:!0,upto:$('input[name="pauselimit"]:checked').val()}):chrome.storage.local.set({pausestarttime:moment().unix(),pause:!0,upto:$('input[name="pauselimit"]:checked').val()}),pn("New tab is paused","success"),$(".nav-li-active-new-tab").addClass("active-li").show(),$(".nav-li-active-new-tab img").show(),$(".nav-li-pause-new-tab").hide()):pn("Please select pause duration.","error")});$(document).on("click",".comment-del",function(){let a=$(this).closest(".row.comment_section").attr("data-comment-id");
deleteComment(a)});$(document).on("keyup",".new-comment-text",function(){""!=$(".new-comment-text").val()?($(".save-new-comment").addClass("active-btn"),$(".save-new-comment").removeClass("disable-btn"),$(".save-new-comment").prop("disabled",!1)):($(".save-new-comment").removeClass("active-btn"),$(".save-new-comment").addClass("disable-btn"),$(".save-new-comment").prop("disabled",!0))});$(".td-login input").on("keyup",function(a){"Enter"!==a.key&&13!==a.keyCode||$(".login-btn.outer-btns").click()});
$(".td-register input").on("keyup",function(a){"Enter"!==a.key&&13!==a.keyCode||$(".register-btn.outer-btns").click()});$("form.td-set-new-password input").on("keyup",function(a){"Enter"!==a.key&&13!==a.keyCode||$(".setnew-password-btn.outer-btns").click()});$(document).on("click",".reload-tab",function(){location.reload()});$(document).on("keyup",".new-comment-text",function(){""!=$(".new-comment-text").val()?($(".save-new-comment").addClass("active-btn"),$(".save-new-comment").removeClass("disable-btn"),
$(".save-new-comment").prop("disabled",!1)):($(".save-new-comment").removeClass("active-btn"),$(".save-new-comment").addClass("disable-btn"),$(".save-new-comment").prop("disabled",!0))});$(document).on("click",".save-new-comment",function(){let a=$(this).closest(".post").attr("data-post-id"),c=$(".new-comment-text").val();chrome.storage.local.get(["login"],function(b){if(void 0!==b.login&&b.login&&""!=b.login)$(".save-new-comment").removeClass("active-btn"),$(".save-new-comment").addClass("disable-btn"),
$(".save-new-comment").prop("disabled",!0),$.ajax({method:"POST",url:endpoint+"addcomment",headers:{Authorization:"Bearer "+b.login},data:{post_id:a,text:c,parent_id:"0"},success:function(d,e,f){$(".save-new-comment").addClass("active-btn");$(".save-new-comment").removeClass("disable-btn");$(".save-new-comment").prop("disabled",!1);1==d.status&&($(".new-comment-text").val(""),addNewAddedComment(d))},statusCode:{500:function(d){},401:function(){},422:function(d){}}});else return $("button.close").click(),
$(".login-link").click(),!1})});$(document).on("click",".vote-btn",function(){let a=$(this).closest(".post").attr("data-post-id");chrome.storage.local.get(["login"],function(c){if(void 0!==c.login&&c.login&&""!=c.login)pn("Sending request...","warning"),$.ajax({method:"GET",url:endpoint+"upvote?id="+a,headers:{Authorization:"Bearer "+c.login},success:function(b,d,e){1==b.status?(d=b.id,e=$(`.post[data-post-id="${d}"]`).find(".vote-btn").find(".counter").text().trim(),"Unvoted"==b.message?($(`.post[data-post-id="${d}"]`).find(".counter").html(parseInt(e)-
1),$(`.post[data-post-id="${d}"]`).find(".upvote").removeClass("votted")):($(`.post[data-post-id="${d}"]`).find(".counter").html(parseInt(e)+1),$(`.post[data-post-id="${d}"]`).find(".upvote").addClass("votted")),pn(b.message,"success")):pn(b.message,"error")},statusCode:{500:function(b){},401:function(){},422:function(b){}}});else return $("button.close").click(),$(".login-link").click(),!1})});$(document).on("click",".bookmark-btn img",function(){let a=$(this).closest(".post").attr("data-post-id");
chrome.storage.local.get(["login"],function(c){if(void 0!==c.login&&c.login&&""!=c.login)pn("Sending request...","warning"),$.ajax({method:"GET",url:endpoint+"bookmark?id="+a,headers:{Authorization:"Bearer "+c.login},success:function(b,d,e){1==b.status?(d=b.id,-1<b.message.indexOf("added")?$(`.post[data-post-id="${d}"]`).find(".bookmark-btn").html(bookmarkImages[1]):$(`.post[data-post-id="${d}"]`).find(".bookmark-btn").html(bookmarkImages[0]),chrome.runtime.sendMessage({prefeed:!0}),$(".tooltip.bs-tooltip-bottom").removeClass("show"),
$('[data-toggle="tooltip"]').tooltip(),pn(b.message,"success")):pn(b.message,"error")},statusCode:{500:function(b){},401:function(){},422:function(b){}}});else return $("button.close").click(),$(".login-link").click(),!1})});$(document).on("click","img.open-post",function(){let a=$(this).closest(".post").attr("data-post-id");$(this).closest(".post").hasClass("event-item")?(getOneEvent(a),getMightLikeEvent()):(getOnePost(a),getPostComment(a),getMightLikePost())});$(document).on("click","p.open-post, .read-all p, .comment-pills, .two-ch-center",
function(){$(this).closest(".post").find("img.open-post").eq(0).click()});$(document).on("click",".copy-post-url",function(){$(this).attr("data-copy-url");pn("Copied succesfully.","success")});$(document).on("click",".open-share-options",function(){$(".social_icons").toggle()});chrome.storage.local.get("list login name image email company bio googlesearch".split(" "),function(a){$(".display-type").show();$(".post-layout").hide();a.list?($(".list-active").show(),$(".grid-d").show()):($(".grid-active").show(),
$(".list-d").show());void 0!==a.login&&a.login&&""!=a.login?($(".login-link").hide(),$(".profile-link").show(),void 0!==a.name&&null!=a.name&&""!=a.name&&($(".user-name").text(a.name),-1<a.name.indexOf(" ")&&$(".profile-link .user-name").text(a.name.split(" ")[0]),$(".td-profile #name").val(a.name),$(".td-profile #email").val(a.email)),void 0!==a.image&&null!=a.image&&""!=a.image&&($(".profile-image").prop("src",a.image),-1==a.image.indexOf("default-profile-image.png")&&$(".change-user-image").prop("src",
a.image)),void 0!==a.company&&null!=a.company&&""!=a.company&&($(".company-name").text(a.company),$(".td-profile #company").val(a.company)),void 0!==a.bio&&null!=a.bio&&""!=a.bio&&($(".bio").text(a.bio),$("#bio").val(a.bio))):($(".login-link").show(),$(".profile-link").hide())});$(document).on("click",".delete-account-btn",function(){confirm("Are you sure?")&&deleteAccount()});$(document).on("click",".logout",function(){chrome.storage.local.get(["googlesearch"],function(a){chrome.storage.local.clear(function(){chrome.storage.local.set({list:!0,
pause:!1,googlesearch:a.newGST},function(){location.reload()})})})});$(".back_arrow").click(function(){118<parseInt($(".sidebar").css("width").trim().split("px")[0])?($(".sidebar").css("width","118px"),$(".heading").hide(),$(".side_link").hide(),$(".content").css("margin-left","118px"),$(".my_feed").css("width","83px"),$(".toggle-btn").show(),$(".left-arrow").hide(),$(".logo-string").hide(),$(".content").css("width","calc(100% - 118px)"),$(".active-li").css("width","95px"),$(".tagline").hide()):($(".sidebar").css("width",
"277px"),$(".heading").fadeIn(),$(".side_link").fadeIn(),$(".content").css("margin-left","283px"),$(".sidebar li").css("width","unset"),$(".my_feed").css("width","245px"),$(".toggle-btn").hide(),$(".left-arrow").show(),$(".logo-string").show(),$(".active-li").css("width","245px"),$(".content").css("width","calc(100% - 283px)"),$(".tagline").show())});$('[data-toggle="tooltip"]').tooltip();$(".feed_strip").hover(function(){$(this).find(".read_feed").toggle();$(this).find(".icon_3").toggle()});$(".grid_view").click(function(){$(".grid-view").show()});
$(".feed-links li").click(function(){$(this).hasClass("nav-li-apple")||$(this).hasClass("nav-li-andorid")||$(this).hasClass("nav-li-donate")||$(this).hasClass("nav-li-contact")||($("li").removeClass("active-li"),$(this).addClass("active-li"),$(".icon-inactive").show(),$(".icon-active").hide(),$(this).find(".icon-inactive").hide(),$(this).find(".icon-active").show(),118<parseInt($(".sidebar").css("width").trim().split("px")[0])?$(".active-li").css("width","245px"):$(".active-li").css("width","95px"))});
getSupplierList();$(document).on("change",".supplier-status",function(){let a=1;$(this).is(":checked")||(a=0);if(0==a&&1>$(".supplier-status:checked").length)return $(this).prop("checked",!0),pn("Al least one supplier must be on","error"),!1;let c=$(this).closest(".supplier-rows").attr("data-supplier-id");updateSupplierStatus(a,c)})});
setInterval(()=>{chrome.storage.local.get(["login"],function(a){void 0!==a.login&&a.login&&""!=a.login&&$.ajax({method:"GET",url:endpoint+"getUserAccount",headers:{Authorization:"Bearer "+a.login},success:function(c,b,d){0==c.status&&$(".logout").click()},statusCode:{500:function(c){},401:function(){},422:function(c){}}})})},15E3);
function getSponsoredPost(){chrome.storage.local.get(["login"],function(a){$.ajax({method:"GET",url:endpoint+"getSponsoredPost",headers:{Authorization:"Bearer "+a.login},success:function(c,b,d){1==c.status&&c.feed.length&&(b=c.feed,3!=b[0].post_type&&(sponsoredPost=b,repeat_after_x=parseInt(c.repeat_after_x),0==$(".sponsored-post").length&&checkForSponsoredPost()))},statusCode:{500:function(c){},401:function(){},422:function(c){}}})})};
