const IssuesAPI={requestIssuesAPI(s,e,t){let i=10;!function n(){return new Promise(((a,o)=>{let r=0,l=setTimeout((()=>{0===r&&(r=2,l=null,o("请求超时"),0==i&&t())}),5e3);fetch(s).then((function(s){if(2!==r&&(clearTimeout(l),a(s),l=null,r=1),s.ok)return s.json();throw new Error("Network response was not ok.")})).then((function(s){i=0,e(s)})).catch((function(s){i>0?(i-=1,setTimeout((()=>{n()}),5e3)):t()}))}))}()},parseIssueStrToJson(s){let e=s.match(/```json[\s|\S]*```/);if(e&&e.length>0&&(e=e[0]),e&&(e=e.split("```json")[1].split("```")[0],e))return JSON.parse(e)},groupIssuesData(s,e){var t=new Object;if(e.length>0)if(null!=s.group){const a=s.group.split("=");if(a.length>1){const o=a[0];let r=a[1];for(o&&r&&(r=r.split(",")),s.group=r,i=0;i

正在加载

'),this.requestIssuesAPI(s.api,(function(t){$(e).find(".loading").remove();const i=IssuesAPI.groupIssuesData(s,t),n=Object.keys(i);s.group.forEach(((s,t)=>{const a=i[s];if(a&&a.length>0)for(s.length>0?$(e).append("

"+s+"

"):""==name&&n.length>1&&$(e).append("

未分组

"),$(e).append('
'),j=0;j0?'
":'
';let n='
';s.avatar&&s.avatar.length>0&&(n+='"),n+=''+s.title+''+s.description+"
";const o="
"+i+n+"
";$(e).find(".site-card-group."+t).append(o)}}))}),(function(){$(e).find(".loading i").remove(),$(e).find(".loading p").text("加载失败,请稍后重试。")}))},getIssuesAPIForTimeline(s){const e=$(s.el)[0];$(e).append('

正在加载

'),this.requestIssuesAPI(s.api,(function(s){if($(e).find(".loading").remove(),s.length>0)for(i=0;i'+s[i].comments+"",n='
'+('

'+s[i].title+t+"

")+('

'+s[i].body+"

")+"
";$(e).append(n)}}),(function(){$(e).find(".loading i").remove(),$(e).find(".loading p").text("加载失败,请稍后重试。")}))},request(){const s=document.getElementsByClassName("issues-wrap");for(var e=0;e