1 line
8.6 KiB
JavaScript
1 line
8.6 KiB
JavaScript
(()=>{var e,t,r={59:(e,t,r)=>{var n={"./prism-atom-dark.less":[271,271],"./prism-duotone-sea.less":[922,922],"./prism-laserwave.less":[796,21],"./prism-line-number.less":[206,206],"./prism-material-dark.less":[429,429],"./prism-night-owl.less":[291,291],"./prism-one-dark.less":[766,766],"./prism-one-light.less":[618,618],"./prism-vsc-dark-plus.less":[945,945]};function o(e){if(!r.o(n,e))return Promise.resolve().then((()=>{var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}));var t=n[e],o=t[0];return r.e(t[1]).then((()=>r(o)))}o.keys=()=>Object.keys(n),o.id=59,e.exports=o},837:()=>{"use strict";document.addEventListener("DOMContentLoaded",(function(){!function(e,t){const r=document.querySelector(e);r&&document.addEventListener("selectionchange",(()=>{const e=window.getSelection();if(e&&e.rangeCount>0&&!e.isCollapsed){const n=e.getRangeAt(0);if(r.contains(n.startContainer)&&r.contains(n.endContainer)){const o=e.toString(),s=[],i=document.createNodeIterator(n.commonAncestorContainer,NodeFilter.SHOW_ELEMENT);let a;for(;a=i.nextNode();)n.intersectsNode(a)&&s.push(a);const l=s.filter((e=>r!==e));t({selectedElements:l,selectedText:o})}}}))}(".article-container article",(e=>{}))}))}},n={};function o(e){var t=n[e];if(void 0!==t)return t.exports;var s=n[e]={exports:{}};return r[e](s,s.exports,o),s.exports}o.m=r,o.f={},o.e=e=>Promise.all(Object.keys(o.f).reduce(((t,r)=>(o.f[r](e,t),t)),[])),o.u=e=>"js/"+e+"."+{21:"282c05e7",206:"759361ed",271:"ee88a6de",291:"4ac6984b",429:"bc4769cb",618:"1a58fba9",766:"9503a62c",922:"689e0633",945:"0313a94c"}[e]+".js",o.miniCssF=e=>"css/"+e+"."+{21:"88950121",206:"a3a4e130",271:"54fa1675",291:"a8323266",429:"fb1dabcb",618:"6513d67e",766:"64ad3c35",922:"9efa0b6b",945:"fdf98cb0"}[e]+".css",o.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),e={},t="@ornn/dockyard:",o.l=(r,n,s,i)=>{if(e[r])e[r].push(n);else{var a,l;if(void 0!==s)for(var c=document.getElementsByTagName("script"),d=0;d<c.length;d++){var u=c[d];if(u.getAttribute("src")==r||u.getAttribute("data-webpack")==t+s){a=u;break}}a||(l=!0,(a=document.createElement("script")).charset="utf-8",a.timeout=120,o.nc&&a.setAttribute("nonce",o.nc),a.setAttribute("data-webpack",t+s),a.src=r),e[r]=[n];var m=(t,n)=>{a.onerror=a.onload=null,clearTimeout(p);var o=e[r];if(delete e[r],a.parentNode&&a.parentNode.removeChild(a),o&&o.forEach((e=>e(n))),t)return t(n)},p=setTimeout(m.bind(null,void 0,{type:"timeout",target:a}),12e4);a.onerror=m.bind(null,a.onerror),a.onload=m.bind(null,a.onload),l&&document.head.appendChild(a)}},o.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e;o.g.importScripts&&(e=o.g.location+"");var t=o.g.document;if(!e&&t&&(t.currentScript&&(e=t.currentScript.src),!e)){var r=t.getElementsByTagName("script");if(r.length)for(var n=r.length-1;n>-1&&!e;)e=r[n--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),o.p=e+"../"})(),(()=>{if("undefined"!=typeof document){var e=e=>new Promise(((t,r)=>{var n=o.miniCssF(e),s=o.p+n;if(((e,t)=>{for(var r=document.getElementsByTagName("link"),n=0;n<r.length;n++){var o=(i=r[n]).getAttribute("data-href")||i.getAttribute("href");if("stylesheet"===i.rel&&(o===e||o===t))return i}var s=document.getElementsByTagName("style");for(n=0;n<s.length;n++){var i;if((o=(i=s[n]).getAttribute("data-href"))===e||o===t)return i}})(n,s))return t();((e,t,r,n,o)=>{var s=document.createElement("link");s.rel="stylesheet",s.type="text/css",s.onerror=s.onload=r=>{if(s.onerror=s.onload=null,"load"===r.type)n();else{var i=r&&("load"===r.type?"missing":r.type),a=r&&r.target&&r.target.href||t,l=new Error("Loading CSS chunk "+e+" failed.\n("+a+")");l.code="CSS_CHUNK_LOAD_FAILED",l.type=i,l.request=a,s.parentNode&&s.parentNode.removeChild(s),o(l)}},s.href=t,r?r.parentNode.insertBefore(s,r.nextSibling):document.head.appendChild(s)})(e,s,null,t,r)})),t={913:0};o.f.miniCss=(r,n)=>{t[r]?n.push(t[r]):0!==t[r]&&{21:1,206:1,271:1,291:1,429:1,618:1,766:1,922:1,945:1}[r]&&n.push(t[r]=e(r).then((()=>{t[r]=0}),(e=>{throw delete t[r],e})))}}})(),(()=>{var e={913:0};o.f.j=(t,r)=>{var n=o.o(e,t)?e[t]:void 0;if(0!==n)if(n)r.push(n[2]);else{var s=new Promise(((r,o)=>n=e[t]=[r,o]));r.push(n[2]=s);var i=o.p+o.u(t),a=new Error;o.l(i,(r=>{if(o.o(e,t)&&(0!==(n=e[t])&&(e[t]=void 0),n)){var s=r&&("load"===r.type?"missing":r.type),i=r&&r.target&&r.target.src;a.message="Loading chunk "+t+" failed.\n("+s+": "+i+")",a.name="ChunkLoadError",a.type=s,a.request=i,n[1](a)}}),"chunk-"+t,t)}};var t=(t,r)=>{var n,s,[i,a,l]=r,c=0;if(i.some((t=>0!==e[t]))){for(n in a)o.o(a,n)&&(o.m[n]=a[n]);if(l)l(o)}for(t&&t(r);c<i.length;c++)s=i[c],o.o(e,s)&&e[s]&&e[s][0](),e[s]=0},r=self.webpackChunk_ornn_dockyard=self.webpackChunk_ornn_dockyard||[];r.forEach(t.bind(null,0)),r.push=t.bind(null,r.push.bind(r))})(),(()=>{"use strict";const e="__theme__",t=()=>{const t=localStorage.getItem(e);return null!=t?t:"light"};const r=new class{constructor(){this.listeners={}}on(e,t){this.listeners[e]||(this.listeners[e]=[]),this.listeners[e].push(t)}off(e,t){const r=this.listeners[e];r&&(this.listeners[e]=r.filter((e=>e!==t)))}emit(e,...t){const r=this.listeners[e];r&&r.length&&r.forEach((e=>{e(...t)}))}},n=e=>Promise.all(e.map((e=>new Promise(((t,r)=>{if("css"===e.type){const n=document.createElement("link");n.href=e.url,n.rel="stylesheet",n.onload=()=>t(),n.onerror=()=>r(new Error(`Failed to load CSS from ${e.url}`)),document.head.appendChild(n)}else if("js"===e.type){const n=document.createElement("script");n.src=e.url,n.onload=()=>t(),n.onerror=()=>r(new Error(`Failed to load JS from ${e.url}`)),document.body.appendChild(n)}else r(new Error("Invalid resource type specified."))}))))),s=e=>{const t=document.querySelector(e);if(t){const e=t.scrollTop;localStorage.setItem("scrolledHeight",String(e))}},i=e=>{const{enable:t,jsCdn:r,cssCdn:o}=e;"true"===t&&n([{type:"css",url:o},{type:"js",url:r}]).then((e=>{e&&(e=>{const t=/\$\$(.+?)\$\$/g,r=/\\\[(.+?)\\\]/g;function n(e,t,r){let n;const o=[];for(;null!==(n=t.exec(e.nodeValue));){const t=document.createRange();t.setStart(e,n.index),t.setEnd(e,n.index+n[0].length),o.push(t)}for(const e of o){const t=e.toString().replace(/^\$\$|\$\$$|\\\[|\\\]$/g,""),n=document.createElement("span");n.innerHTML=window.katex.renderToString(t,{throwOnError:!1,displayMode:r}),e.deleteContents(),e.insertNode(n)}}document.querySelectorAll(e).forEach((e=>{const o=document.createTreeWalker(e,NodeFilter.SHOW_TEXT,null);let s;for(;s=o.nextNode();)n(s,t,!1),n(s,r,!0)}))})(".article-container")}))};var a=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]])}return r};const l=e=>{const{enable:t,cdn:r}=e,o=a(e,["enable","cdn"]);"true"===t&&n([{type:"js",url:r}]).then((e=>{e&&(((e="vcomments",t=".article-container")=>{const r=document.querySelector(t);if(!r)return;const n=document.createElement("div");n.id=e,r.appendChild(n)})(),new window.Valine(Object.assign({el:"#vcomments"},o)))}))};o(837);const c={light:"prism-one-light",dark:"prism-one-dark"},d=e=>{document.querySelectorAll(".toc a").forEach((e=>e.classList.remove("active")));const t=document.querySelector('.toc a[href="'+e+'"]');t&&t.classList.add("active")};document.addEventListener("click",(function(e){const t=e.target.closest(".toc-link");if(t){const e=t.getAttribute("href");e&&d(e)}})),document.addEventListener("DOMContentLoaded",(function(){(e=>{const t=document.querySelector(e);if(t){const e=localStorage.getItem("scrolledHeight");e&&(t.scrollTop=Number(e))}})("main.scrollbar-obtrusive");const{hash:e}=window.location;e&&d(e);const{mermaid:a,katex:u,valine:m}=window;i(u),(e=>{const{enable:o,cdn:s}=e;"true"===o&&n([{type:"js",url:s}]).then((e=>{e&&(window.mermaid.initialize({theme:"dark"===t()?"dark":"default"}),r.on("theme:change",(()=>location.reload())))}))})(a),l(m),o(59)(`./${c[t()]}.less`);const p=document.getElementById("toggle-theme");null==p||p.addEventListener("click",(()=>{s("main.scrollbar-obtrusive"),window.location.reload()}))})),document.addEventListener("DOMContentLoaded",(function(){const e=document.querySelector("main.scrollbar-obtrusive");e&&e.addEventListener("scroll",(()=>{s("main.scrollbar-obtrusive")}))}))})()})(); |