function openCustomLinksNav(){document.getElementById("custom_links_nav").style.width="250px";document.CustomLinksNavOpened=!0}function closeCustomLinksNav(){document.getElementById("custom_links_nav").style.width="0";document.CustomLinksNavOpened=!1}function getCustomLinkItems(){return localStorage.getItem("menu-items")?JSON.parse(localStorage.getItem("menu-items")):{}}function storeCustomLinkItems(a){localStorage.setItem("menu-items",JSON.stringify(a))} function getDefaultSystemLinks(){return window.linkMenu} function buildCustomUserLinksMenu(){for(var a=getCustomLinkItems(),b=Object.keys(a),c=[],d=0;da[b[d]].length)){c.push('
  • \n\t\t'+(0==d?"":"
    ")+"\n\t\t "+b[d]+"\n\t\t
    \n\t\t
  • ");for(var e=1;e\n\t\t\tx\n\t\t\t'+a[b[d]][e][0]+"")}document.getElementById("userCustomLinks").innerHTML=c.join("\n")}function getCustomLinkItemsCatImage(a){var b=getDefaultSystemLinks();return b[a]?b[a][0]:[]}function addCustomLinkToLinkItems(a,b,c,d){var e=getCustomLinkItems();e[c]||(e[c]=[],e[c].push([d]));e[c].push([b,a,""]);return e}function addCustomLinkToMenu(a,b,c,d){storeCustomLinkItems(addCustomLinkToLinkItems(a,b,c,d));buildCustomUserLinksMenu();perfectSrollBars.customLinks.update()} function removeCustomLink(a,b){for(var c=getCustomLinkItems(),d=[],e=0;ed.length?delete c[a]:c[a]=d;storeCustomLinkItems(c);buildCustomUserLinksMenu()} function customLinkRemoveConfirmation(a){var b=a.srcElement.attributes["data-category"].nodeValue,c=a.srcElement.attributes["data-index"].nodeValue;a=getCustomLinkItems()[b][c][0];confirmModal.style.display="block";overlay.style.display="block";document.getElementById("modal-label").innerHTML=a;document.getElementById("deleteLink").addEventListener("click",function(){removeCustomLink(b,c);confirmModal.style.display="none";overlay.style.display="none"},{once:!0})}var perfectSrollBars={customLinks:null}; function setPerfectScrollbar(){perfectSrollBars.customLinks=new PerfectScrollbar("#userCustomLinks");perfectSrollBars.customLinks.update();document.getElementById("userCustomLinks").scrollTop=0;document.querySelector("#userCustomLinks>div.ps__rail-y").style.opacity=1} (function(){var a=setInterval(function(){if(linkMenu){try{buildCustomUserLinksMenu(),window.addLinkToMenu=function(a,c,d){d=document.getElementById("custom-category-name").value;var b=document.getElementById("custom-category-color").value;addCustomLinkToMenu(a,c,d,b)},setPerfectScrollbar()}catch(b){console.log(b)}clearInterval(a)}},30)})();