-
Notifications
You must be signed in to change notification settings - Fork 50
/
Copy pathmain-ca95302712d4183efe51.js
1 lines (1 loc) · 43.5 KB
/
main-ca95302712d4183efe51.js
1
(()=>{var e,t,a,n,r={204:(e,t,a)=>{var n={"./web.css":285};function r(e){var t=o(e);return a(t)}function o(e){if(!a.o(n,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return n[e]}r.keys=function(){return Object.keys(n)},r.resolve=o,e.exports=r,r.id=204},747:(e,t,a)=>{var n={"./nrShared.css":31};function r(e){var t=o(e);return a(t)}function o(e){if(!a.o(n,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return n[e]}r.keys=function(){return Object.keys(n)},r.resolve=o,e.exports=r,r.id=747},285:(e,t,a)=>{"use strict";a.r(t)},31:(e,t,a)=>{"use strict";a.r(t)},330:e=>{"use strict";e.exports={rE:"7.0.20"}}},o={};function s(e){var t=o[e];if(void 0!==t)return t.exports;var a=o[e]={exports:{}};return r[e].call(a.exports,a,a.exports,s),a.exports}s.m=r,t=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,s.t=function(a,n){if(1&n&&(a=this(a)),8&n)return a;if("object"==typeof a&&a){if(4&n&&a.__esModule)return a;if(16&n&&"function"==typeof a.then)return a}var r=Object.create(null);s.r(r);var o={};e=e||[null,t({}),t([]),t(t)];for(var i=2&n&&a;"object"==typeof i&&!~e.indexOf(i);i=t(i))Object.getOwnPropertyNames(i).forEach((e=>o[e]=()=>a[e]));return o.default=()=>a,s.d(r,o),r},s.d=(e,t)=>{for(var a in t)s.o(t,a)&&!s.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:t[a]})},s.f={},s.e=e=>Promise.all(Object.keys(s.f).reduce(((t,a)=>(s.f[a](e,t),t)),[])),s.u=e=>e+"-"+{23:"68ec6bc8bbe9e807b823",833:"bfd3a2852380174c2f01",908:"74fec7017dc97c5bad0c"}[e]+".js",s.miniCssF=e=>e+"-d83aa8b4563dbceee6f4.css",s.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),a={},n="netnr:",s.l=(e,t,r,o)=>{if(a[e])a[e].push(t);else{var i,l;if(void 0!==r)for(var d=document.getElementsByTagName("script"),c=0;c<d.length;c++){var m=d[c];if(m.getAttribute("src")==e||m.getAttribute("data-webpack")==n+r){i=m;break}}i||(l=!0,(i=document.createElement("script")).charset="utf-8",i.timeout=120,s.nc&&i.setAttribute("nonce",s.nc),i.setAttribute("data-webpack",n+r),i.src=e),a[e]=[t];var u=(t,n)=>{i.onerror=i.onload=null,clearTimeout(p);var r=a[e];if(delete a[e],i.parentNode&&i.parentNode.removeChild(i),r&&r.forEach((e=>e(n))),t)return t(n)},p=setTimeout(u.bind(null,void 0,{type:"timeout",target:i}),12e4);i.onerror=u.bind(null,i.onerror),i.onload=u.bind(null,i.onload),l&&document.head.appendChild(i)}},s.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},s.p="/",(()=>{if("undefined"!=typeof document){var e=e=>new Promise(((t,a)=>{var n=s.miniCssF(e),r=s.p+n;if(((e,t)=>{for(var a=document.getElementsByTagName("link"),n=0;n<a.length;n++){var r=(s=a[n]).getAttribute("data-href")||s.getAttribute("href");if("stylesheet"===s.rel&&(r===e||r===t))return s}var o=document.getElementsByTagName("style");for(n=0;n<o.length;n++){var s;if((r=(s=o[n]).getAttribute("data-href"))===e||r===t)return s}})(n,r))return t();((e,t,a,n,r)=>{var o=document.createElement("link");o.rel="stylesheet",o.type="text/css",s.nc&&(o.nonce=s.nc),o.onerror=o.onload=a=>{if(o.onerror=o.onload=null,"load"===a.type)n();else{var s=a&&a.type,i=a&&a.target&&a.target.href||t,l=new Error("Loading CSS chunk "+e+" failed.\n("+s+": "+i+")");l.name="ChunkLoadError",l.code="CSS_CHUNK_LOAD_FAILED",l.type=s,l.request=i,o.parentNode&&o.parentNode.removeChild(o),r(l)}},o.href=t,a?a.parentNode.insertBefore(o,a.nextSibling):document.head.appendChild(o)})(e,r,null,t,a)})),t={792:0};s.f.miniCss=(a,n)=>{t[a]?n.push(t[a]):0!==t[a]&&{799:1}[a]&&n.push(t[a]=e(a).then((()=>{t[a]=0}),(e=>{throw delete t[a],e})))}}})(),(()=>{var e={792:0};s.f.j=(t,a)=>{var n=s.o(e,t)?e[t]:void 0;if(0!==n)if(n)a.push(n[2]);else if(799!=t){var r=new Promise(((a,r)=>n=e[t]=[a,r]));a.push(n[2]=r);var o=s.p+s.u(t),i=new Error;s.l(o,(a=>{if(s.o(e,t)&&(0!==(n=e[t])&&(e[t]=void 0),n)){var r=a&&("load"===a.type?"missing":a.type),o=a&&a.target&&a.target.src;i.message="Loading chunk "+t+" failed.\n("+r+": "+o+")",i.name="ChunkLoadError",i.type=r,i.request=o,n[1](i)}}),"chunk-"+t,t)}else e[t]=0};var t=(t,a)=>{var n,r,[o,i,l]=a,d=0;if(o.some((t=>0!==e[t]))){for(n in i)s.o(i,n)&&(s.m[n]=i[n]);if(l)l(s)}for(t&&t(a);d<o.length;d++)r=o[d],s.o(e,r)&&e[r]&&e[r][0](),e[r]=0},a=self.webpackChunknetnr=self.webpackChunknetnr||[];a.forEach(t.bind(null,0)),a.push=t.bind(null,a.push.bind(a))})(),(()=>{"use strict";let e={init:(t,a,n=document)=>{n.addEventListener("dragover",(e=>{a&&a.contains(e.target)||(e.preventDefault(),e.stopPropagation())})),n.addEventListener("drop",(async n=>{if(!a||!a.contains(n.target)){n.preventDefault();let a=await e.readDataTransferItems(n.dataTransfer.items);a.length&&await t(a,"drag")}})),a&&a.addEventListener("change",(async function(){let e=this.files;e.length&&await t(e,"change")})),document.addEventListener("paste",(async function(e){if(!["INPUT","TEXTAREA"].includes(e.target.nodeName)){let a=e.clipboardData.items,n=[];for(let e=0;e<a.length;e++){let t=a[e].getAsFile();t&&n.push(t)}n.length&&await t(n,"paste")}}))},readDataTransferItems:async t=>{let a=[],n=[];for(let r=0;r<t.length;r++){let o=t[r],s=o.webkitGetAsEntry();if(null!=s)a.push(e.readDataTransferItemEntry(s));else{let e=o.getAsFile();e&&n.push(e)}}return(await Promise.all(a)).forEach((e=>{e.length?n=n.concat(e):n.push(e)})),n},readDataTransferItemEntry:(t,a)=>new Promise((n=>{if(a=a||"",t.isFile)t.file((e=>{""!=a&&(e.fullPath=a+e.name),n(e)}));else if(t.isDirectory){t.createReader().readEntries((r=>{let o=[];for(let n=0;n<r.length;n++)o.push(e.readDataTransferItemEntry(r[n],a+t.name+"/"));Promise.all(o).then((e=>{let t=[];e.forEach((e=>{e.length?t=t.concat(e):t.push(e)})),n(t)}))}))}})),invokeCanvasToBlob:(e,t,a)=>new Promise((n=>{e.toBlob((e=>{n(e)}),t,a)})),invokeImageOnload:(e,t)=>new Promise((a=>{e.onload=()=>a(e),e.src=t})),reader:(e,t="Text",a="utf-8")=>new Promise(((n,r)=>{const o=new FileReader;o.onloadend=()=>n(o.result),o.onerror=()=>r(),"Text"==t?o.readAsText(e,a):o[`readAs${t}`](e)}))};Object.assign(window,{nrcFile:e});let t={version:s(330).rE,lastFetchDate:null,cookie:function(e,t,a){if(1==arguments.length){let t=document.cookie.match(new RegExp("(^| )"+e+"=([^;]*)(;|$)"));return null!=t?t[2]:null}{let n=`${e}=${t};Path=/`;if(a){let e=new Date;e.setTime(e.getTime()+a),n=`${n};Expires=${e.toGMTString()}`}document.cookie=n}},isDark:()=>document.cookie.includes(".theme=dark"),saveTheme:e=>{let t=new Date;t.setFullYear(t.getFullYear()+1),document.cookie=`.theme=${e};Path=/;Expires=${t.toGMTString()}`},isNullOrWhiteSpace:e=>null==e||""==e.toString().trim(),getFileNameWithoutExtension:e=>{var t=e.split(".");return t.pop(),t.join(".")},UUID:()=>window.crypto&&window.crypto.randomUUID?crypto.randomUUID():URL.createObjectURL(new Blob([])).split("/").pop(),random:(e=99999,t=0)=>Math.floor(Math.random()*(e-t+1)+t),addSeconds:(e,t)=>(e.setSeconds(e.getSeconds()+t),e),addMinutes:(e,t)=>(e.setMinutes(e.getMinutes()+t),e),addHours:(e,t)=>(e.setHours(e.getHours()+t),e),addDays:(e,t)=>(e.setDate(e.getDate()+t),e),addMonths:(e,t)=>(e.setMonth(e.getMonth()+t),e),addYears:(e,t)=>(e.setFullYear(e.getFullYear()+t),e),type:function(e){return{}.toString.call(e).split(" ")[1].replace("]","")},clone:e=>window.structuredClone?window.structuredClone(e):JSON.parse(JSON.stringify(e)),sleep:e=>new Promise((t=>setTimeout((()=>t()),e||1e3))),trimStart:(e,t)=>{for(e=e.toString().trim();e.startsWith(t);)e=e.substring(t.length);return e},trimEnd:(e,t)=>{for(e=e.toString().trim();e.endsWith(t);)e=e.substring(0,e.length-t.length);return e},error:()=>{throw new Error("Fake Error")},dispatchEvent:(e,t=window)=>t.dispatchEvent(new Event(e)),cssvar:(e,t,a)=>{if(null==a)return getComputedStyle(e).getPropertyValue(t);e.style.setProperty(t,a)},xssOf:e=>{let t=window.DOMPurify;return t?t.sanitize(e,{ADD_ATTR:["password-toggle","clearable","variant","target"]}):(console.debug("DOMPurify not found"),e)},htmlOf:e=>String(e).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'").replace(/\//g,"/"),htmlEncode:e=>e.replace(/[\u00A0-\u9999<>\&]/g,(e=>"&#"+e.charCodeAt(0)+";")),htmlDecode:e=>{let t=document.createElement("div");return t.innerHTML=e,t.innerText},arrayDistinct:e=>Array.from(new Set(e)),groupBy:(e,t)=>Array.from(new Set(e.map(t))),isDanger:e=>/[^a-zA-Z0-9_]+/.test(e),dangerReplace:e=>e.replace(/[^a-zA-Z0-9_]+/g,""),isRiskFile:e=>{let a=!1;if(t.isNullOrWhiteSpace(e)||e.length>250||e.endsWith("."))a=!0;else{let t=e.split("."),n=t.length>1?t.pop().toLowerCase():"";(n.length>10||n.length>1&&"exe,msi,bat,sh,php,php3,asa,asp,aspx,css,htm,html,mhtml,js,jse,jsp,jspx,dll,so,jar,war,ear,ps1,psm1,pl,pm,py,pyc,pyo,rb".includes(n))&&(a=!0)}return a},humpToUnderline:e=>{let t=[];for(let a=0;a<e.length;a++){let n=e[a].toLowerCase(),r=e.charCodeAt(a);r>=65&&r<=90?t.push(`_${n}`):t.push(n)}return t.join("")},byteLength:e=>{let t=0;return Array.from(e).map((function(e){t+=e.charCodeAt(0)>255?2:1})),t},fromCommaToArray:e=>null==e||""==e.trim()?[]:e.split(","),fromKeyToURLParams:e=>{if("Object"==t.type(e))for(const t in e)null!==e[t]&&void 0!==e[t]||(e[t]="");return new URLSearchParams(e).toString()},fromFormToKey:e=>Object.fromEntries(t.fromFormToFormData(e)),fromFormToFormData:e=>{let t=new FormData(e);return e.querySelectorAll("sl-select[multiple]").forEach((e=>{e.name&&t.set(e.name,e.value.join())})),t},fromKeyToFormData:e=>{let t=new FormData;for(const a in e){null!==e[a]&&t.append(a,e[a])}return t},getUrlParams:(e,t)=>new URLSearchParams(t||location.search).get(e),findParentElement:(e,t)=>{let a=e;for(;null!=a;){if(t(a))return a;a=a.parentElement}return null},readDOM:(e,t,a,n)=>{e.querySelectorAll("*").forEach((e=>{if(e.classList.value.startsWith(t)){let r="dom";e.classList[0].substring(t.length+1).split("-").forEach((e=>r+=e.substring(0,1).toUpperCase()+e.substring(1))),1!=n&&r in a||(a[r]=e)}}))},editDOM:e=>{e.setAttribute("contenteditable",!0),e.setAttribute("spellcheck",!1)},parserDOM:(e,t)=>(t=t||"text/html",(new DOMParser).parseFromString(e,t)),fetch:async(e,a)=>{let n={resp:null,result:null,error:null};try{a=a||{method:"GET",Cache:"no-cache"};let r=await fetch(e,a);n.resp=r;try{switch(t.lastFetchDate=r.headers.get("date"),null!=t.lastFetchDate&&(t.lastFetchDate=t.formatDateTime("datetime",t.lastFetchDate)),a.type){case"text":n.result=await r.text();break;case"blob":n.result=await r.blob();break;case"buffer":n.result=await r.arrayBuffer();break;case"reader":n.result=await r.body.getReader();break;default:n.result=await r.json()}}catch(e){if(r.ok)throw e}}catch(e){n.error=e}return n},tsLoaded:{},importStyle:async e=>{e=t.mirrorNPM(e);let a=t.tsLoaded[e];return a||(t.tsLoaded[e]=a=new Promise((t=>{let a=!1;if(document.querySelectorAll("link").forEach((t=>{t.href&&t.href.includes(e)&&(a=!0)})),a)t();else{let a=document.createElement("LINK");a.href=e,a.rel="stylesheet","onload"in a?a.onload=()=>{t()}:t(),document.head.appendChild(a)}}))),a},importScript:async(e,a)=>{e=t.mirrorNPM(e);let n=t.tsLoaded[e];return n||(t.tsLoaded[e]=n=new Promise(((t,n)=>{let r,o=document.scripts;for(let t=0;t<o.length;t++){let a=o[t];if(a.src.includes(e)){r=a;break}}if(r)t();else{let r=document.createElement("SCRIPT");r.src=e,r.type=a||"text/javascript",r.onerror=function(e){n(e)},r.onload=function(){t()},document.head.appendChild(r)}}))),n},require:(e,a)=>new Promise((n=>{if(a in t.tsLoaded)n();else{let r=a.split(",");e=e.map((e=>t.mirrorNPM(e))),window.require(e,(function(){for(let e=0;e<arguments.length;e++)Object.assign(window,{[r[e].trim()]:arguments[e]});t.tsLoaded[a]=!0,n()}))}})),mirrorNPM:e=>{let t=/(https?:\/\/[\w.-]+)\/(.*)@([\d.]+)\/(.*)\.(\w+)/.exec(e);return null!=t&&(e=`https://ss.netnr.com/${t[2]}@${t[3]}/${t[4]}.${t[5]}`),e},tsBottomKeepHeight:40,setHeightFromBottom:(e,a)=>{let n=null==a?t.tsBottomKeepHeight:a,r=e.getBoundingClientRect().top+n;Object.assign(e.style,{height:`calc(100vh - ${r}px)`,minHeight:"200px"})},formatByteSize:function(e,t=2,a=1024){if(Math.abs(e)<a)return e+" B";const n=1e3==a?["KB","MB","GB","TB","PB","EB","ZB","YB"]:["KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"];let r=-1;const o=10**t;do{e/=a,++r}while(Math.round(Math.abs(e)*o)/o>=a&&r<n.length-1);return(1*e.toFixed(t)).toString()+n[r]},formatDateTime:(e,a)=>{switch(t.type(a)){case"String":case"Number":{let e=new Date(a);isNaN(e)?a.includes("年")&&a.includes("月")&&a.includes("日")&&(e=new Date(a.replace(/年|月/g,"-").replace("日",""))):10==a.length&&e.setHours(0,0,0,0),a=e}break;case"Date":break;default:a=new Date}switch(e=e||"yyyy-MM-dd HH:mm:ss"){case"date":e="yyyy-MM-dd";break;case"time":e="HH:mm:ss";break;case"datetime":e="yyyy-MM-dd HH:mm:ss";break;case"datetime-local":e="yyyy-MM-ddTHH:mm"}return[["yyyy",a.getFullYear()],["MM",a.getMonth()+1],["dd",a.getDate()],["HH",a.getHours()],["mm",a.getMinutes()],["ss",a.getSeconds()],["fff",a.getMilliseconds()]].reduce(((e,t)=>e.replace(t[0],`${t[1]}`.padStart(t[0].length,"0"))),e)},now:()=>t.formatDateTime("datetime"),downloadBlob:function(e,a){let n=window.URL.createObjectURL(e);t.downloadUrl(n,a)},downloadCanvas:function(e,a,n,r){if(null==n){let e=a.split(".").pop().toLowerCase();"jpg"==e&&(e="jpeg"),n=`image/${e}`}let o;o="image/png"==n?e.toDataURL(n):e.toDataURL(n,r),t.downloadUrl(o,a)},downloadText:function(e,a,n){let r=new Blob([e],{type:n||"text/plain"}),o=window.URL.createObjectURL(r);t.downloadUrl(o,a)},downloadUrl:function(e,t){let a=document.createElement("a");a.href=e,a.download=t,document.body.appendChild(a),a.click(),document.body.removeChild(a)},performance:()=>{if(window.performance){let e=window.performance.getEntries();for(const a of e)if("PerformanceNavigationTiming"==t.type(a)){console.debug(a);break}}},voice:function(e){if(console.debug(e),"function"==typeof SpeechSynthesisUtterance){let t=new SpeechSynthesisUtterance(e);t.lang="zh-CN",window.speechSynthesis.speak(t)}},notify:async e=>{if("granted"==await Notification.requestPermission())return new Notification(e.title||"消息",e);console.debug(e)},cyrb53:(e,t=0)=>{let a=3735928559^t,n=1103547991^t;for(let t,r=0;r<e.length;r++)t=e.charCodeAt(r),a=Math.imul(a^t,2654435761),n=Math.imul(n^t,1597334677);return a=Math.imul(a^a>>>16,2246822507),a^=Math.imul(n^n>>>13,3266489909),n=Math.imul(n^n>>>16,2246822507),n^=Math.imul(a^a>>>13,3266489909),(4294967296*(2097151&n)+(a>>>0)).toString(36).slice(0,6)},clipboard:async e=>{let t;if(navigator.clipboard)return t=null==e?await navigator.clipboard.readText():await navigator.clipboard.writeText(e),t;if(null!=e){let t=document.createElement("textarea");return t.value=e,t.style.position="fixed",t.style.opacity=0,document.body.appendChild(t),t.select(),window.document.execCommand("Copy"),t.remove(),e}return ndkI18n.lg.unsupported}};Object.assign(window,{nrcBase:t});class a{constructor(e={}){this.db=null,this.name=e.name||"localforage",this.storeName=e.storeName||"keyvaluepairs",this.version=e.version||2}init(){return new Promise(((e,t)=>{if(this.db)return void e(this);const a=window.indexedDB.open(this.name,this.version);a.onerror=()=>{t(a.error)},a.onupgradeneeded=()=>{const e=a.result;e.objectStoreNames.contains(this.storeName)||e.createObjectStore(this.storeName)},a.onsuccess=()=>{this.db=a.result,e(this)}}))}_performTransaction(e,t){return new Promise(((a,n)=>{const r=this.db.transaction(this.storeName,e),o=r.objectStore(this.storeName);r.oncomplete=()=>{a()},r.onerror=e=>{n(e.target.error)},t(o,a,n)}))}setItem(e,t){return this._performTransaction("readwrite",((a,n,r)=>{const o=a.put(t,e);o.onsuccess=()=>{n()},o.onerror=()=>{r(o.error)}}))}getItem(e){return this._performTransaction("readonly",((t,a,n)=>{const r=t.get(e);r.onsuccess=()=>{a(r.result)},r.onerror=()=>{n(r.error)}}))}removeItem(e){return this._performTransaction("readwrite",((t,a,n)=>{const r=t.delete(e);r.onsuccess=()=>{a()},r.onerror=()=>{n(r.error)}}))}keys(){return this._performTransaction("readonly",((e,t,a)=>{const n=e.getAllKeys();n.onsuccess=()=>{t(n.result)},n.onerror=()=>{a(n.error)}}))}clear(){return this._performTransaction("readwrite",((e,t,a)=>{const n=e.clear();n.onsuccess=()=>{t()},n.onerror=()=>{a(n.error)}}))}}Object.assign(window,{nrcIndexedDB:a});let n={init:async()=>{null==n.localforage&&(n.localforage=await(new a).init())},localforage:null,getItem:async e=>await n.localforage.getItem(e),setItem:async(e,t)=>await n.localforage.setItem(e,t),removeItem:async e=>await n.localforage.removeItem(e),keys:async()=>await n.localforage.keys(),clear:async()=>await n.localforage.clear(),setCache:async(e,t,a)=>{let r={data:t,flag:a,time:(new Date).toLocaleString()};await n.localforage.setItem(e,r)},getCache:async(e,t)=>{let a=await n.localforage.getItem(e);if(a){if("function"==typeof t?t(a.flag):a.flag==t)return a.data;await n.localforage.removeItem(e)}}};Object.assign(window,{nrStorage:n});let r={remote:async e=>{switch(e){case"bootstrap5.js":await t.importScript("https://npmcdn.com/[email protected]/dist/js/bootstrap.bundle.min.js");break;case"bootstrap5.css":await t.importStyle("https://npmcdn.com/[email protected]/dist/css/bootstrap.min.css");break;case"agGrid":await t.importScript("https://npmcdn.com/[email protected]/dist/ag-grid-enterprise.min.js");break;case"echarts":await t.importScript("https://npmcdn.com/[email protected]/dist/echarts.min.js");break;case"netnrmd":await t.importStyle("/file/md/netnrmd.css?4.1.0"),await t.importScript("/file/md/netnrmd.js?4.1.0");break;case"asciinema-player":await t.importStyle("https://npmcdn.com/[email protected]/dist/bundle/asciinema-player.css"),await t.importScript("https://npmcdn.com/[email protected]/dist/bundle/asciinema-player.min.js");break;case"tom-select-bootstrap5":await t.importStyle("https://npmcdn.com/[email protected]/dist/css/tom-select.bootstrap5.min.css"),await t.importScript("https://npmcdn.com/[email protected]/dist/js/tom-select.complete.min.js");break;case"md5.js":await t.importScript("https://npmcdn.com/[email protected]/js/md5.min.js");break;case"hls.js":await t.importScript("https://npmcdn.com/[email protected]/dist/hls.min.js");break;case"qrcode.js":await t.importScript("https://npmcdn.com/[email protected]/build/qrcode.js");break;case"jsqr.js":await t.importScript("https://npmcdn.com/[email protected]/dist/jsQR.js");break;case"terser.js":await t.importScript("https://npmcdn.com/[email protected]/dist/bundle.min.js");break;case"editor-nginx":await t.importScript("/file/ss-editor-nginx.js?202303"),await t.importScript("https://npmcdn.com/[email protected]/nginxbeautifier.js");break;case"js-beautify.js":await t.importScript("https://npmcdn.com/[email protected]/js/lib/beautifier.min.js"),await t.require(["beautifier"],"beautifier");break;case"sql-formatter.js":await t.require(["https://npmcdn.com/[email protected]/dist/sql-formatter.min.js"],"sqlFormatter");break;case"html2canvas.js":await t.importScript("https://npmcdn.com/[email protected]/dist/html2canvas.min.js");break;case"identicon":await t.importScript("/file/identicon/identicon.min.js?202303"),await t.importScript("https://npmcdn.com/[email protected]/dist/jdenticon.min.js");break;case"svgo.js":window.svgo||Object.assign(window,{svgo:await import("https://npmcdn.com/[email protected]/dist/svgo.browser.js")});break;case"nsfwjs":await t.importScript("https://npmcdn.com/@tensorflow/[email protected]/dist/tf.min.js"),await t.importScript("https://npmcdn.com/[email protected]/dist/nsfwjs.min.js");break;case"segmentit.js":await t.importScript("https://npmcdn.com/[email protected]/dist/umd/segmentit.js");break;case"cropperjs":await t.importStyle("https://npmcdn.com/[email protected]/dist/cropper.min.css"),await t.importScript("https://npmcdn.com/[email protected]/dist/cropper.min.js");break;case"exceljs":await t.importScript("https://npmcdn.com/[email protected]/dist/exceljs.min.js");break;case"XLSX":await t.importScript("https://npmcdn.com/[email protected]/dist/xlsx.full.min.js");break;case"pdf.js":await t.importScript("https://npmcdn.com/[email protected]/build/pdf.min.js");break;case"jszip.js":await t.importScript("https://npmcdn.com/[email protected]/dist/jszip.min.js");break;case"bowser.js":await t.importScript("https://npmcdn.com/[email protected]/es5.js");break;case"swaggerui":await t.importStyle("https://npmcdn.com/[email protected]/swagger-ui.css"),await t.require(["https://npmcdn.com/[email protected]/swagger-ui-bundle.js","https://npmcdn.com/[email protected]/swagger-ui-standalone-preset.js"],"SwaggerUIBundle, SwaggerUIStandalonePreset");break;case"crypto.js":await t.importScript("https://npmcdn.com/[email protected]/crypto-js.js");break;case"jstree":await t.importScript("https://npmcdn.com/[email protected]/dist/jquery.min.js"),await t.importStyle("https://npmcdn.com/[email protected]/dist/themes/default/style.min.css"),await t.importStyle("https://npmcdn.com/[email protected]/dist/themes/default-dark/style.min.css"),await t.importScript("https://npmcdn.com/[email protected]/dist/jstree.min.js");break;case"pinyin-pro.js":await t.importScript("https://npmcdn.com/[email protected]/dist/index.js");break;case"turndown.js":await t.importScript("https://npmcdn.com/[email protected]/lib/turndown.browser.umd.js")}}};Object.assign(window,{nrcRely:r});let o={tsLoaded:null,rely:async()=>r.remote("echarts"),bind:async(e,a,n)=>{await o.rely(),a=Object.assign({renderer:"svg",backgroundColor:"transparent"},a),null==n&&(n=t.isDark()?"dark":null),e.chart?e.chart.dispose():e.innerHTML="";let r=echarts.init(e,n,{renderer:a.renderer});return r.setOption(a),e.dataset.bind||(e.dataset.bind=!0,window.addEventListener("resize",(()=>{let t=e.chart;t&&t.resize()}))),e.chartOption=a,e.chart=r,r},playTooltip:(e,t)=>{if("true"!=e.dataset.bingPlay){e.dataset.bingPlay="true";let a=-1,n=function(){if(document.body.contains(e)){if(-1==a)a=0;else{let t=e.chart;var r=t.getOption().series[0].data.length;"true"!=e.dataset.playPause&&(t.dispatchAction({type:"downplay",seriesIndex:0,dataIndex:a}),a=(a+1)%r,t.dispatchAction({type:"highlight",seriesIndex:0,dataIndex:a}),t.dispatchAction({type:"showTip",seriesIndex:0,dataIndex:a}))}setTimeout(n,t||5e3)}};e.addEventListener("mouseover",(function(){e.dataset.playPause="true"})),e.addEventListener("mouseout",(function(){e.dataset.playPause="false"})),n()}},setTheme:async(e,t)=>{if(e){let a=e.chart,n=e.chartOption;a&&n&&await o.bind(e,n,t)}},color2:["#2ec7c9","#b6a2de","#5ab1ef","#ffb980","#d87a80","#8d98b3","#e5cf0d","#97b552","#95706d","#dc69aa","#07a2a4","#9a7fd1","#588dd5","#f5994e","#c05050","#59678c","#c9ab00","#7eb00a","#6f5553","#c14089"],color3:["#c1232b","#27727b","#fcce10","#e87c25","#b5c334","#fe8463","#9bca63","#fad860","#f3a43b","#60c0dd","#d7504b","#c6e579","#f4e001","#f0805a","#26c0c0"],color4:["#e01f54","#001852","#f5e8c8","#b8d2c7","#c6b38e","#a4d8c2","#f3d999","#d3758f","#dcc392","#2e4783","#82b6e9","#ff6347","#a092f1","#0a915d","#eaf889","#6699FF","#ff6666","#3cb371","#d5b158","#38b6b6"]};Object.assign(window,{nrECharts:o});let i={tsEditor:null,tsEditor2:null,tsMd:null,tsGrid:null,tsLoadingHtml:'<div class="spinner-border m-3" role="status"><span class="visually-hidden">Loading...</span></div>',tsFailHtml:'<input type="text" readonly class="form-control-plaintext" value="网络错误">',setTheme:function(e){let a=document.documentElement,n="dark"==e?"light":"dark";a.className=a.className.replace(n,e),a.dataset.bsTheme=e,t.saveTheme(e);let r=t.isDark();window.monaco&&(r?monaco.editor.setTheme("vs-dark"):monaco.editor.setTheme("vs")),i.tsMd&&i.tsMd.toggleTheme(r?"dark":"light"),document.querySelectorAll(".nrg-grid").forEach((e=>{r?(e.classList.remove("ag-theme-alpine"),e.classList.add("ag-theme-alpine-dark")):(e.classList.remove("ag-theme-alpine-dark"),e.classList.add("ag-theme-alpine"))})),document.querySelectorAll(".nrg-chart").forEach((e=>{o.setTheme(e)})),document.querySelectorAll(".nrg-tree").forEach((e=>{let t=e.tree;t&&t.set_theme(r?"default-dark":"default")})),document.querySelectorAll(".nrg-json-editor").forEach((e=>{r?e.classList.add("jse-theme-dark"):e.classList.remove("jse-theme-dark")}))},setLoading:(e,t=!1)=>{if(e.disabled=!t,t){e.classList.remove("nrg-loading");let t=e.querySelector(".nrg-loading-wait");t&&t.remove()}else if(!e.classList.contains("nrg-loading")){e.classList.add("nrg-loading");let t=document.createElement("span");t.className="nrg-loading-wait",t.innerHTML='<span class="spinner-border spinner-border-sm"></span>',e.appendChild(t)}},globalError:()=>{window.addEventListener("unhandledrejection",(async function(e){if(console.debug(e),window.bootstrap){let a=t.isNullOrWhiteSpace(e.reason)?"出错了!":e.reason;i.toast(a)}})),window.addEventListener("error",(async function(e){let t=e.message;t.startsWith("ResizeObserver")||(console.debug(e),window.bootstrap&&i.toast(t))}))},logError:(e,t)=>{console.debug(e),null!=t&&i.toast(t)},setGridColumnLoading:e=>{for(let t=0;t<e.length;t++){let a=e[t];if("#line_number"!=a.field&&1!=a.hide){null==a.cellRenderer&&(a.cellRenderer=e=>void 0===e.value?'<div class="spinner-border"></div>':e.value);break}}},setQuickFilter:(e,t)=>{e.addEventListener("input",(async function(){let e=t.gridApi||t;e&&e.updateGridOptions({quickFilterText:this.value})}))},toast:e=>{null==i.domToastContainer&&(i.domToastContainer=document.createElement("div"),i.domToastContainer.className="toast-container position-fixed bottom-0 end-0 p-4",document.body.appendChild(i.domToastContainer));let t=document.createElement("div");t.innerHTML=`\n<div class="toast-header">\n <img src="/favicon.ico" class="rounded me-2" height="18">\n <strong class="me-auto">消息提示</strong>\n <button type="button" class="btn-close" data-bs-dismiss="toast"></button>\n</div>\n<div class="toast-body">${e}</div>\n`,t.className="toast",i.domToastContainer.appendChild(t);let a=new bootstrap.Toast(t);a.show(),i.domToastContainer.toast=a,t.addEventListener("hidden.bs.toast",(function(e){e.target.remove()}))},domAlert:null,alert:(e,a,n="60em")=>{null==i.domAlert&&(i.domAlert=document.createElement("div"),i.domAlert.innerHTML='\n<div class="modal-dialog modal-dialog-centered modal-dialog-scrollable">\n <div class="modal-content">\n <div class="modal-header">\n <h5 class="modal-title"></h5>\n <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>\n </div>\n <div class="modal-body"></div>\n <div class="modal-footer">\n <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">关闭</button>\n </div>\n </div>\n</div>\n ',i.domAlert.className="modal",document.body.appendChild(i.domAlert),i.domAlert.alert=new bootstrap.Modal(i.domAlert)),i.domAlert.querySelector(".modal-title").innerHTML=a||"消息提示",t.cssvar(i.domAlert,"--bs-modal-width",n);let r=i.domAlert.querySelector(".modal-body");r.innerHTML="";try{e="string"==typeof e?JSON.stringify(JSON.parse(e),null,2):JSON.stringify(e,null,2);let t=document.createElement("pre");t.className="m-0 fs-6",t.style.whiteSpace="pre-wrap",t.innerText=e,r.appendChild(t)}catch(t){r.innerHTML=e}i.domAlert.alert.show()},domConfirm:null,confirm:(e,a,n="30em")=>new Promise((r=>{null==i.domConfirm&&(i.domConfirm=document.createElement("div"),i.domConfirm.innerHTML='\n<div class="modal-dialog modal-dialog-centered modal-dialog-scrollable">\n <div class="modal-content">\n <div class="modal-header">\n <h5 class="modal-title"></h5>\n <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>\n </div>\n <div class="modal-body"></div>\n <div class="modal-footer">\n <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">取消</button>\n <button type="button" class="btn btn-primary flag-ok">确定</button>\n </div>\n </div>\n</div>\n ',i.domConfirm.className="modal",document.body.appendChild(i.domConfirm),i.domConfirm.confirm=new bootstrap.Modal(i.domConfirm)),i.domConfirm.querySelector(".modal-title").innerHTML=a||"消息提示",t.cssvar(i.domConfirm,"--bs-modal-width",n),i.domConfirm.querySelector(".modal-body").innerHTML=e;let o=function(){i.domConfirm.removeEventListener("hidden.bs.modal",o),r(!1)};i.domConfirm.addEventListener("hidden.bs.modal",o),i.domConfirm.querySelector(".flag-ok").onclick=()=>{i.domConfirm.removeEventListener("hidden.bs.modal",o),i.domConfirm.confirm.hide(),r(!0)},i.domConfirm.confirm.show()}))};Object.assign(window,{nrApp:i});let l={flagName:"netnr",flagResp:"uuid",flagLibs:"libs",flagSuffix:".md",flagToken:null,flagLocalUsed:!0,flagLocalPath:"/libs/index.json",flagLocalJson:null,flagProxyServer:"https://seep.eu.org/",flagProxyUsed:!1,flagTitle:document.title},d={init:async()=>{isSecureContext&&!window.webpackHotUpdatenetnr&&navigator.serviceWorker.register("/sw.js").then((e=>console.debug("SW registered: ",e))).catch((e=>console.debug("SW failed: ",e))),i.setTheme(t.isDark()?"dark":"light"),await Promise.all([s.e(799),s.e(908)]).then(s.bind(s,908));const e=await s.e(833).then(s.t.bind(s,833,23));Object.assign(window,{bootstrap:e,nrWeb:d,nrVary:l}),n.localforage=await new a({name:"nr-cache"}).init(),n.instanceUser=await new a({name:"nr-user"}).init(),await d.render(),d.bindEvent();let r=(location.hash.length>1?location.hash:location.pathname).substring(1).split("/");if(""!=r[0]&&(l.flagName=r[0]),null!=r[1]&&""!=r[1]&&(l.flagResp=r[1]),null!=r[2]&&""!=r[2]&&(l.flagLibs=r[2]),"#_local"==location.hash)l.flagLocalUsed=!0,await n.setItem("local",l.flagLocalUsed);else{let e=await n.getItem("local");null!=e&&(l.flagLocalUsed=e)}l.flagLocalUsed&&document.querySelector('[data-action="local"]').classList.add("active");let o=await n.getItem("uuid-token-github");null!=o&&o.length>10&&(l.flagToken=o,document.querySelector('[data-action="token"]').classList.add("active"));let c=await n.getItem("proxy");null!=c&&(l.flagProxyUsed=c),l.flagProxyUsed&&document.querySelector('[data-action="proxy"]').classList.add("active"),document.getElementById("style0").remove(),l.domLayout.classList.remove("invisible"),await d.load()},render:async()=>{let e=document.createElement("div");l.domLayout=e,e.className="invisible",e.innerHTML='\n<div class="container-fluid p-lg-4 pb-lg-0 py-4">\n <div class="row">\n\n <div class="col-auto mb-2">\n <div class="dropdown">\n <button class="btn btn-outline-success dropdown-toggle" data-bs-toggle="dropdown" data-bs-auto-close="false">\n <img class="nrg-img-avatar rounded" style="height:1.3em;width:1.3em;" src="/favicon.ico" >\n </button>\n <ul class="nrg-dd-user-info dropdown-menu"></ul>\n </div>\n </div>\n\n <div class="col mb-2">\n <input class="nrg-txt-filter form-control" type="search" placeholder="silent search.." data-search="" title="silent search.." />\n </div>\n\n <div class="col-auto mb-2">\n <div class="btn-group">\n <button class="nrg-btn-reload btn btn-outline-success" data-action="reload" title="重新加载">Reload</button>\n <button type="button" class="btn btn-outline-success dropdown-toggle dropdown-toggle-split" data-bs-toggle="dropdown">\n <span class="visually-hidden">Toggle Dropdown</span>\n </button>\n <ul class="nrg-dd-more dropdown-menu">\n <li><button class="dropdown-item" data-action="theme">主题 Theme</button></li>\n <li><hr class="dropdown-divider"></li>\n <li><button class="dropdown-item" data-action="local" title="私有化部署 Privatization deployment">本地 Local</button></li>\n <li><button class="dropdown-item" data-action="token">设置 Token</button></li>\n <li><button class="dropdown-item" data-action="proxy" title="使用代理 use proxy">代理 Proxy</button></li>\n <li><hr class="dropdown-divider"></li>\n <li><button class="dropdown-item" data-action="convert" title="转换浏览器导出的 HTML 书签">转换 Convert</button></li>\n <li><button class="dropdown-item" data-action="about">关于 About</button></li>\n </ul>\n </div>\n </div>\n <div class="col-12 position-relative">\n <div class="nrg-search border rounded d-none position-absolute"></div>\n </div> \n </div>\n <div class="nrg-view row my-3"></div>\n</div>\n',document.body.appendChild(e),t.readDOM(document.body,"nrg",l)},load:async()=>{i.setLoading(l.domBtnReload),await d.viewUser(),await d.viewLink(),i.setLoading(l.domBtnReload,!0);try{let e=await n.instanceUser.getItem(`${l.flagName}:update-time`);e&&Date.now()-e>6048e5&&(await d.reqUser(l.flagName,!0),await d.reqLibs(l.flagName,l.flagResp,l.flagLibs,!0))}catch(e){}},bindEvent:()=>{document.body.addEventListener("click",(async function(e){let t=e.target;t.dataset.action&&d.triggerAction(t.dataset.action,t)})),l.domTxtFilter.addEventListener("keydown",(function(e){if(["ArrowUp","ArrowDown"].includes(e.code))e.preventDefault(),d.searchArrow(e.code);else if("Enter"==e.key){e.preventDefault();let t=l.domSearch.querySelector("a.active");t&&t.click()}})),l.domTxtFilter.addEventListener("input",(function(){d.searchLink(this.value.trim())})),document.body.addEventListener("keydown",(function(e){if("INPUT"!=document.activeElement.nodeName)if(e.ctrlKey&&["KeyQ","KeyK"].includes(e.code))e.preventDefault(),l.domTxtFilter.focus(),l.domTxtFilter.dataset.search="",l.domTxtFilter.placeholder=l.domTxtFilter.title,d.searchLink("");else if("Backspace"==e.code)e.preventDefault(),l.domTxtFilter.dataset.search.length&&(l.domTxtFilter.dataset.search=l.domTxtFilter.dataset.search.slice(0,-1)),l.domTxtFilter.placeholder=l.domTxtFilter.dataset.search.length?l.domTxtFilter.dataset.search:l.domTxtFilter.title,d.searchLink(l.domTxtFilter.dataset.search);else if("Enter"==e.key){if(e.preventDefault(),!l.domSearch.classList.contains("d-none")){let e=l.domSearch.querySelector("a.active");e&&e.click()}}else"Escape"==e.code?(e.preventDefault(),l.domTxtFilter.dataset.search.length&&(l.domTxtFilter.dataset.search="",l.domTxtFilter.placeholder=l.domTxtFilter.title,d.searchLink(""))):["ArrowUp","ArrowDown"].includes(e.code)?(e.preventDefault(),l.domTxtFilter.dataset.search.length&&d.searchArrow(e.code)):/^[a-z0-9\.\_\-\/]$/i.test(e.key)&&!e.ctrlKey&&(l.domTxtFilter.value="",document.documentElement.scrollTo(0,0),l.domTxtFilter.dataset.search+=e.key,l.domTxtFilter.placeholder=l.domTxtFilter.dataset.search,d.searchLink(l.domTxtFilter.dataset.search))}))},triggerAction:async(a,r)=>{switch(a){case"theme":i.setTheme(t.isDark()?"light":"dark");break;case"token":null==l.domDialogToken&&(l.domDialogToken=document.createElement("div"),l.domDialogToken.innerHTML='\n<div class="modal-dialog modal-dialog-centered modal-dialog-scrollable">\n <div class="modal-content">\n <div class="modal-header">\n <h5 class="modal-title">Token(令牌)</h5>\n <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>\n </div>\n <div class="modal-body">\n <div>Refresh after pasting</div>\n <div>Anonymous access is limited (60 per hour)</div>\n <input class="form-control my-3" placeholder="token" />\n <div><a target="_blank" href="https://github.com/settings/tokens">https://github.com/settings/tokens</a></div>\n </div>\n </div>\n</div>',l.domDialogToken.className="modal",document.body.appendChild(l.domDialogToken),l.domDialogToken.querySelector("input").addEventListener("input",(async function(){let e=l.domDdMore.querySelector('[data-action="token"]');""==this.value.trim()?(e.classList.remove("active"),l.flagToken=null,await n.removeItem("uuid-token-github")):this.value.length>10&&(e.classList.add("active"),l.flagToken=this.value.trim(),await n.setItem("uuid-token-github",this.value.trim()))})),l.bsDialogToken=new bootstrap.Modal(l.domDialogToken)),l.domDialogToken.querySelector("input").value=l.flagToken,l.bsDialogToken.show();break;case"local":{let e=`https://github.com/${l.flagName}/${l.flagResp}`,t=`线上 GitHub (<a href="${e}">${e}</a>)`,a=new URL(l.flagLocalPath,location).href,r=`本地 Local (<a href="${a}">${a}</a>)`,o='<svg viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" width="24" height="24"><path d="M448 789.312V0h128v789.312l234.688-234.624L896 640l-384 384-384-384 85.312-85.312L448 789.312z" fill="currentColor"></path></svg>',s=l.flagLocalUsed?`${r}<div class="my-2">${o}</div>${t}`:`${t}<div class="my-2">${o}</div>${r}`;await i.confirm(s,"切换 switch")&&(l.flagLocalUsed=!l.flagLocalUsed,await n.setItem("local",l.flagLocalUsed),l.domDdMore.querySelector('[data-action="local"]').classList.toggle("active"),"#_local"==location.hash&&(location.hash=""),location.reload())}break;case"proxy":l.flagProxyUsed=!l.flagProxyUsed,await n.setItem("proxy",l.flagProxyUsed),l.domDdMore.querySelector('[data-action="proxy"]').classList.toggle("active");break;case"reload":{let e=await n.instanceUser.keys();for(const t of e)t.startsWith(`${l.flagName}:`)&&await n.instanceUser.removeItem(t);await d.load()}break;case"convert":null==l.domDialogConvert&&(l.domDialogConvert=document.createElement("div"),l.domDialogConvert.innerHTML='\n<div class="modal-dialog modal-fullscreen modal-dialog-centered modal-dialog-scrollable">\n <div class="modal-content">\n <div class="modal-header">\n <h5 class="modal-title">Convert HTML bookmarks(转换书签)</h5>\n <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>\n </div>\n <div class="modal-body">\n <div class="row">\n <div class="col-lg-6">\n <input type="file" class="mb-2 form-control" />\n <textarea class="form-control" style="height:calc(100vh - 145px);"></textarea>\n </div>\n <div class="col-lg-6">\n <div class="nrg-preview overflow-auto border rounded p-3" style="height:calc(100vh - 100px);">preview</div>\n </div>\n </div>\n </div>\n </div>\n</div>',l.domDialogConvert.className="modal",document.body.appendChild(l.domDialogConvert),l.domDialogConvert.querySelector("input").addEventListener("change",(async function(){let t=this.files[0];if(t){try{let a=await e.reader(t),n=[],r=document.createElement("div");r.innerHTML=a,n.push("# "+r.querySelector("h1").innerHTML),d.convertHtml(r,n);let o=n.join("\r\n");l.domDialogConvert.querySelector("textarea").value=o;let i=await s.e(23).then(s.bind(s,23));l.domDialogConvert.querySelector(".nrg-preview").innerHTML=i.parse(o)}catch(e){console.debug(e),i.alert("转换失败")}this.value=""}})),l.domDialogConvert.querySelector("textarea").addEventListener("input",(async function(){let e=await s.e(23).then(s.bind(s,23));l.domDialogConvert.querySelector(".nrg-preview").innerHTML=e.parse(this.value)})),l.bsDialogConvert=new bootstrap.Modal(l.domDialogConvert)),l.bsDialogConvert.show();break;case"about":{let e='\n<div>GitHub: <a href="https://github.com/netnr">https://github.com/netnr</a></div>\n<div>联系打赏: <a href="https://zme.ink">https://zme.ink</a></div>\n<hr/>\n<div class="mt-2">缓存后可离线使用</div>\n<hr/>\n<div>Fork 项目,从浏览器导出书签 HTML,再转换书签为 Markdown,保存到 libs/*.md</div>\n<div>私有化部署,更新索引文件 libs/index.json,页面再启用 本地 Local</div>\n<hr/>\n<div>uuid.fun 于 2028-11-09 8:00 到期,计划不再续费,启用子域名,<a href="https://uu.zme.ink">https://uu.zme.ink</a></div>\n';i.alert(e,"About 关于")}}},reqUser:async(e,t)=>{let a=`https://api.github.com/users/${e}`,r=`${e}:${a}`,o=await n.instanceUser.getItem(r);return(null==o||t)&&(o=await d.reqServer(a),o&&(await n.instanceUser.setItem(r,o),await n.instanceUser.setItem(`${e}:update-time`,Date.now()))),o},reqLibs:async(e,t,a,r)=>{let o=`https://api.github.com/repos/${e}/${t}/contents/${a}`,s=`${e}:${o}`,i=await n.instanceUser.getItem(s);return(null==i||r)&&(i=await d.reqServer(o),i&&await n.instanceUser.setItem(s,i)),i},reqRaw:async e=>{let a=`${l.flagName}:${e}`,r=await n.instanceUser.getItem(a);return null==r&&(r=await d.reqServer(`${e}?_${t.random()}`,{type:"text"}),r&&await n.instanceUser.setItem(a,r)),r},convertHtml:(e,t)=>{for(let a=0;a<e.children.length;a++){let n=e.children[a];switch(n.nodeName){case"H3":t.push(""),t.push("### "+n.innerHTML);break;case"DL":case"P":d.convertHtml(n,t);break;case"DT":if(1==n.children.length){let e=n.querySelector("a");t.push("- ["+e.innerHTML.replace(/`/g,"\\`")+"]("+e.href+")")}else d.convertHtml(n,t)}}},viewUser:async()=>{let e;if(l.flagLocalUsed?(l.flagLocalJson=await d.reqServer(l.flagLocalPath),l.flagLocalJson?e=l.flagLocalJson.user:i.toast("加载失败")):e=await d.reqUser(l.flagName),e){l.domImgAvatar.onerror=function(){l.domImgAvatar.src="/favicon.ico",l.domImgAvatar.onerror=!1},l.domImgAvatar.src=e.avatar_url;let t=null==e.name?e.login:`${e.login} (${e.name})`,a=null==e.bio?"":`<li><span class="dropdown-item-text" title="bio">${e.bio}</span></li>`,n=null==e.company?"":`<li><span class="dropdown-item-text" title="company">${e.company}</span></li>`,r=null==e.location?"":`<li><span class="dropdown-item-text" title="location">${e.location}</span></li>`,o=null==e.blog?"":`<li><a class="dropdown-item" title="blog" href="${e.blog}">${e.blog}</a></li>`;l.domDdUserInfo.innerHTML=`<li><a class="dropdown-item" title="name" href="https://github.com/${e.login}">${t}</a></li>\n ${a}<li><hr class="dropdown-divider"></li>${n}${r}${o}\n `,document.title=`${e.login} - ${l.flagTitle}`}},viewLink:async()=>{let e;if(l.flagLocalUsed?l.flagLocalJson&&(e=l.flagLocalJson.libs):e=await d.reqLibs(l.flagName,l.flagResp,l.flagLibs),e){let t=[],a=0;e.forEach((e=>{if("file"==e.type&&e.name.endsWith(l.flagSuffix)){let n=e.name.substring(0,e.name.length-l.flagSuffix.length);a++,t.push(`\n <div class="accordion-item">\n <h2 class="accordion-header">\n <button class="accordion-button" type="button" data-bs-toggle="collapse" data-bs-target="#collapse-${a}">${n}</button>\n </h2>\n <div id="collapse-${a}" class="accordion-collapse collapse show">\n <div class="accordion-body">${i.tsLoadingHtml}</div>\n </div>\n </div>\n `)}})),l.domView.innerHTML=`<div class="accordion">${t.join("")}</div>`,a=0;for(const t of e)if("file"==t.type&&t.name.endsWith(l.flagSuffix)){a++;let e=l.domView.querySelector(`#collapse-${a}`).children[0],n=await d.reqRaw(t.download_url);if(n){let t=await s.e(23).then(s.bind(s,23));e.innerHTML=t.parse(n)}else e.innerHTML=i.tsFailHtml}l.domView.dataset.ended=!0}else l.domView.innerHTML=`<div class="col-12">${i.tsFailHtml}</div>`},searchLink:e=>{if(l.domView.dataset.ended){let t=[];if(""!=e.trim()){e=e.toLowerCase();let a=l.domView.querySelectorAll("a");for(let n=0;n<a.length;n++){const r=a[n];if(`${r.href},${r.innerText},${r.title||""}`.toLowerCase().includes(e)&&(t.push(`<a class="d-flex px-3 py-2 border-top opacity-75" href="${r.href}"><span class="w-75 text-truncate">${r.href}</span><span class="w-25 text-truncate">${r.innerText}</span></a>`),t.length>7))break}}l.domSearch.innerHTML=t.join(""),t.length?(l.domSearch.classList.remove("d-none"),l.domSearch.querySelector("a").classList.add("active")):l.domSearch.classList.add("d-none")}},searchArrow:e=>{if(!l.domSearch.classList.contains("d-none")){let t=l.domSearch.querySelector("a.active"),a="ArrowDown"==e?t.nextElementSibling:t.previousElementSibling;a&&(t.classList.remove("active"),a.classList.add("active"))}},reqServer:async(e,a)=>{a=a||{},null!=l.flagToken&&l.flagToken.length>10&&!e.includes("githubusercontent")&&(a.headers=a.headers||{},a.headers.authorization=`token ${l.flagToken}`),l.flagProxyUsed&&!l.flagLocalUsed&&(e=`${l.flagProxyServer}${encodeURIComponent(e)}`);let n=await t.fetch(e,a);if(n.error)i.logError(n.error,"网络错误");else if(0==n.resp.ok)403==n.resp.status&&i.toast("请设置 Token");else if(n.resp.ok&&n.result)return n.result}};s(747),s(204),"loading"==document.readyState?document.addEventListener("DOMContentLoaded",d.init):d.init()})()})();