(async()=>{const e=document.querySelector("a.btn-nomargin:nth-child(1)").href.split("S/")[1],t="nf:"+e,n=sessionStorage.getItem(t),o=n?.includes("{")?JSON.parse(n):await fetch("//"+location.host+"/api/songs/"+e+"/for-edit").then(e=>e.json());sessionStorage.setItem(t,JSON.stringify(o));const i="div.editor-field > table > tbody",l=e=>document.querySelector(i+`> tr:nth-child(${e}) input:nth-child(1)`),r=e=>document.querySelector(i+`> tr:nth-child(${e}) > td`),a=e=>document.querySelector(`div.editor-field:nth-child(2) > select > option:nth-child(${e})`),s=["Japanese","Romaji","English"];for(let e=0;et===e.language)[0]?.value||"",o.defaultNameLanguage===t&&(console.log(r(e+1)),r(e+1).style.fontWeight="600 !important",a(e+2)&&(a(e+2).style.fontWeight="600"))}const c=o.names.filter(e=>"Unspecified"===e.language).map(e=>e.value),d=document.querySelector("div.editor-field:nth-child(4) > span:nth-child(2)");d&&!d.querySelector("br")&&(d.innerHTML+="
"+c.join("
"));const h=document.querySelector(".editor-label .extraInfo, [id$=tabpane-artists] .span4:nth-child(2)"),u=document.createElement("ul");u.id="nf-artists";for(const e of h.querySelectorAll("#"+u.id))h.removeChild(e);o.artists.forEach(e=>{const t=document.createElement("li"),n=document.createElement("a"),o=e.effectiveRoles;e.isCustomName||(n.href="/Ar/"+e.artist.id);const i="Default"===o?"D: "+e.artist?.artistType:o,l=e.isSupport?", Support":"";n.textContent=e.name+" ("+i+l+")",t.appendChild(n),u.appendChild(t)}),h.appendChild(u)})();