"use strict";function _objectDestructuringEmpty(e){if(e==null)throw new TypeError("Cannot destructure undefined")}function _createForOfIteratorHelper(e,t){if(n=typeof Symbol!="undefined"&&e[Symbol.iterator]||e["@@iterator"],!n){if(Array.isArray(e)||(n=_unsupportedIterableToArray(e))||t&&e&&typeof e.length=="number")return n&&(e=n),s=0,o=function(){},{s:o,n:function(){return s>=e.length?{done:!0}:{done:!1,value:e[s++]}},e:function(t){throw t},f:o};throw new TypeError(`Invalid attempt to iterate non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var n,s,o,r,i=!0,a=!1;return{s:function(){n=n.call(e)},n:function(){var t=n.next();return i=t.done,t},e:function(t){a=!0,r=t},f:function(){try{!i&&n.return!=null&&n.return()}finally{if(a)throw r}}}}function _toConsumableArray(e){return _arrayWithoutHoles(e)||_iterableToArray(e)||_unsupportedIterableToArray(e)||_nonIterableSpread()}function _nonIterableSpread(){throw new TypeError(`Invalid attempt to spread non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function _unsupportedIterableToArray(e,t){if(!e)return;if(typeof e=="string")return _arrayLikeToArray(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _arrayLikeToArray(e,t)}function _iterableToArray(e){if(typeof Symbol!="undefined"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function _arrayWithoutHoles(e){if(Array.isArray(e))return _arrayLikeToArray(e)}function _arrayLikeToArray(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,s=new Array(t);n0?(s+=o.substr(s,20).lastIndexOf(" ")+1,o="..."+o.substr(s,d)):o=o.substr(0,d),Object.keys(l).forEach(function(e){c=c.replace(new RegExp("(".concat(e,")"),"gi"),"<".concat(a,">$1")),o=o.replace(new RegExp("(".concat(e,")"),"gi"),"<".concat(a,">$1"))}),n[r]={uri:r,title:c,date:i.date,context:o}}),Object.values(n).slice(0,h)},t._index?r(l()):fetch(n.lunrIndexURL).then(function(e){return e.json()}).then(function(e){var s={};t._index=lunr(function(){var t=this;n.lunrLanguageCode&&this.use(lunr[n.lunrLanguageCode]),this.ref("objectID"),this.field("title",{boost:50}),this.field("tags",{boost:20}),this.field("categories",{boost:20}),this.field("content",{boost:10}),this.metadataWhitelist=["position"],e.forEach(function(e){s[e.objectID]=e,t.add(e)})}),t._indexData=s,r(l())}).catch(function(e){console.error(e),r([])})):n.type==="algolia"&&(t._algoliaIndex=t._algoliaIndex||algoliasearch(n.algoliaAppID,n.algoliaSearchKey).initIndex(n.algoliaIndex),t._algoliaIndex.search(o,{offset:0,length:h*8,attributesToHighlight:["title"],attributesToSnippet:["content:".concat(d)],highlightPreTag:"<".concat(a,">"),highlightPostTag:"")}).then(function(e){var n=e.hits,t={};n.forEach(function(e){var n=e.uri,o=e.date,i=e._highlightResult.title,s=e._snippetResult.content;if(t[n]&&t[n].context.length>s.value)return;t[n]={uri:n,title:i.value,date:o,context:s.value}}),r(Object.values(t).slice(0,h))}).catch(function(e){console.error(e),r([])}))},templates:{suggestion:function(t){var n=t.title,s=t.date,o=t.context;return'
'.concat(n,'').concat(s,'
').concat(o,"
")},empty:function(t){var s=t.query;return'
'.concat(n.noResultsFound,': "').concat(s,'"
')},footer:function(t){_objectDestructuringEmpty(t);var s=n.type==="algolia"?{searchType:"algolia",icon:'',href:"https://www.algolia.com/"}:{searchType:"Lunr.js",icon:"",href:"https://lunrjs.com/"},o=s.searchType,i=s.icon,a=s.href;return'")}}});o.on("autocomplete:selected",function(e,t){window.location.assign(t.uri)}),l?t._searchMobile=o:t._searchDesktop=o},n.lunrSegmentitURL&&!document.getElementById("lunr-segmentit")?(o=document.createElement("script"),o.id="lunr-segmentit",o.type="text/javascript",o.src=n.lunrSegmentitURL,o.async=!0,o.readyState?o.onreadystatechange=function(){(o.readyState=="loaded"||o.readyState=="complete")&&(o.onreadystatechange=null,m())}:o.onload=function(){m()},document.body.appendChild(o)):m()}},{key:"initDetails",value:function(){this.util.forEach(document.getElementsByClassName("details"),function(e){var t=e.getElementsByClassName("details-summary")[0];t.addEventListener("click",function(){e.classList.toggle("open")},!1)})}},{key:"initLightGallery",value:function(){this.config.lightgallery&&lightGallery(document.getElementById("content"),{plugins:[lgThumbnail,lgZoom],selector:".lightgallery",speed:400,hideBarsDelay:2e3,allowMediaOverlap:!0,exThumbImage:"data-thumbnail",toggleThumb:!0,thumbWidth:80,thumbHeight:"60px",actualSize:!1,showZoomInOutIcons:!0})}},{key:"initHighlight",value:function(){var t=this;this.util.forEach(document.querySelectorAll(".highlight > pre.chroma"),function(e){var n,s,o,i,t=document.createElement("div");t.className=e.className,n=document.createElement("table"),t.appendChild(n),s=document.createElement("tbody"),n.appendChild(s),o=document.createElement("tr"),s.appendChild(o),i=document.createElement("td"),o.appendChild(i),e.parentElement.replaceChild(t,e),i.appendChild(e)}),this.util.forEach(document.querySelectorAll(".highlight > .chroma"),function(e){var n,s,o,i,a,c,l,r=e.querySelectorAll("pre.chroma > code");r.length&&(a=r[r.length-1],s=document.createElement("div"),s.className="code-header "+a.className.toLowerCase(),o=document.createElement("span"),o.classList.add("code-title"),o.insertAdjacentHTML("afterbegin",''),o.addEventListener("click",function(){e.classList.toggle("open")},!1),s.appendChild(o),i=document.createElement("span"),i.insertAdjacentHTML("afterbegin",''),i.classList.add("ellipses"),i.addEventListener("click",function(){e.classList.add("open")},!1),s.appendChild(i),n=document.createElement("span"),n.insertAdjacentHTML("afterbegin",''),n.classList.add("copy"),c=a.innerText,(t.config.code.maxShownLines<0||c.split(` `).length h"+t),function(e){e.classList.add("headerLink"),e.insertAdjacentHTML("afterbegin",''))})}},{key:"initToc",value:function(){var n,s,o,i,a,c,l,d,u,h,m,f,p,r=this,t=document.getElementById("TableOfContents");if(t===null)return;document.getElementById("toc-static").getAttribute("data-kept")||this.util.isTocStatic()?(h=document.getElementById("toc-content-static"),t.parentElement!==h&&(t.parentElement.removeChild(t),h.appendChild(t)),this._tocOnScroll&&this.scrollEventSet.delete(this._tocOnScroll)):(l=document.getElementById("toc-content-auto"),t.parentElement!==l&&(t.parentElement.removeChild(t),l.appendChild(t)),n=document.getElementById("toc-auto"),u=document.getElementsByClassName("page")[0],d=u.getBoundingClientRect(),n.style.left="".concat(d.left+d.width+20,"px"),n.style.maxWidth="".concat(u.getBoundingClientRect().left-20,"px"),n.style.visibility="visible",c=t.querySelectorAll("a:first-child"),f=t.getElementsByTagName("li"),s=document.getElementsByClassName("headerLink"),i=document.body.getAttribute("data-header-desktop")!=="normal",o=document.getElementById("header-desktop").offsetHeight,a=20+(i?o:0),m=n.offsetTop,p=m-a+(i?0:o),this._tocOnScroll=this._tocOnScroll||function(){var e,l,d,u,h,v,b=document.getElementById("post-footer").offsetTop,g=b-n.getBoundingClientRect().height,j=g-a+(i?0:o);r.newScrollTopj?(n.style.position="absolute",n.style.top="".concat(g,"px")):(n.style.position="fixed",n.style.top="".concat(a,"px")),r.util.forEach(c,function(e){e.classList.remove("active")}),r.util.forEach(f,function(e){e.classList.remove("has-active")}),u=20+(i?o:0),l=s.length-1;for(e=0;eu||h<=u&&v>u){l=e;break}if(l!==-1)for(c[l].classList.add("active"),d=c[l].parentElement;d!==t;)d.classList.add("has-active"),d=d.parentElement.parentElement},this._tocOnScroll(),this.scrollEventSet.add(this._tocOnScroll))}},{key:"initMath",value:function(){this.config.math&&renderMathInElement(document.body,this.config.math)}},{key:"initMermaid",value:function(){var t=this;this._mermaidOnSwitchTheme=this._mermaidOnSwitchTheme||function(){var e=document.getElementsByClassName("mermaid");e.length&&(mermaid.initialize({startOnLoad:!1,theme:t.isDark?"dark":"neutral",securityLevel:"loose"}),t.util.forEach(e,function(e){mermaid.render("svg-"+e.id,t.data[e.id],function(t){e.innerHTML=t},e)}))},this.switchThemeEventSet.add(this._mermaidOnSwitchTheme),this._mermaidOnSwitchTheme()}},{key:"initEcharts",value:function(){var t=this;this.config.echarts&&(echarts.registerTheme("light",this.config.echarts.lightTheme),echarts.registerTheme("dark",this.config.echarts.darkTheme),this._echartsOnSwitchTheme=this._echartsOnSwitchTheme||function(){t._echartsArr=t._echartsArr||[];for(var e=0;e=0&&window.setTimeout(function(){l.destroy()},t.duration);return}l.destroy(),a(r+1)}}).go()};a(0)}))}},{key:"initComment",value:function(){var t,n,s,o,a,i=this;this.config.comment&&(this.config.comment.gitalk&&(this.config.comment.gitalk.body=decodeURI(window.location.href),a=new Gitalk(this.config.comment.gitalk),a.render("gitalk")),this.config.comment.valine&&new Valine(this.config.comment.valine),this.config.comment.utterances&&(o=this.config.comment.utterances,s=document.createElement("script"),s.src="https://utteranc.es/client.js",s.type="text/javascript",s.setAttribute("repo",o.repo),s.setAttribute("issue-term",o.issueTerm),o.label&&s.setAttribute("label",o.label),s.setAttribute("theme",this.isDark?o.darkTheme:o.lightTheme),s.crossOrigin="anonymous",s.async=!0,document.getElementById("utterances").appendChild(s),this._utterancesOnSwitchTheme=this._utterancesOnSwitchTheme||function(){var e={type:"set-theme",theme:i.isDark?o.darkTheme:o.lightTheme},t=document.querySelector(".utterances-frame");t.contentWindow.postMessage(e,"https://utteranc.es")},this.switchThemeEventSet.add(this._utterancesOnSwitchTheme)),this.config.comment.giscus&&(n=this.config.comment.giscus,t=document.createElement("script"),t.src="https://giscus.app/client.js",t.type="text/javascript",t.setAttribute("data-repo",n.repo),t.setAttribute("data-repo-id",n.repoId),t.setAttribute("data-category",n.category),t.setAttribute("data-category-id",n.categoryId),t.setAttribute("data-lang",n.lang),t.setAttribute("data-mapping",n.mapping),t.setAttribute("data-reactions-enabled",n.reactionsEnabled),t.setAttribute("data-emit-metadata",n.emitMetadata),t.setAttribute("data-input-position",n.inputPosition),n.lazyLoading&&t.setAttribute("data-loading","lazy"),t.setAttribute("data-theme",this.isDark?n.darkTheme:n.lightTheme),t.crossOrigin="anonymous",t.async=!0,document.getElementById("giscus").appendChild(t),this._giscusOnSwitchTheme=this._giscusOnSwitchTheme||function(){var t={setConfig:{theme:i.isDark?n.darkTheme:n.lightTheme,reactionsEnabled:!1}},e=document.querySelector("iframe.giscus-frame");if(!e)return;e.contentWindow.postMessage({giscus:t},"https://giscus.app")},this.switchThemeEventSet.add(this._giscusOnSwitchTheme)))}},{key:"initCookieconsent",value:function(){this.config.cookieconsent&&cookieconsent.initialise(this.config.cookieconsent)}},{key:"onScroll",value:function(){t=this,s=[],document.body.getAttribute("data-header-desktop")==="auto"&&s.push(document.getElementById("header-desktop")),document.body.getAttribute("data-header-mobile")==="auto"&&s.push(document.getElementById("header-mobile")),document.getElementById("comments")&&(i=document.getElementById("view-comments"),i.href="#comments",i.style.display="block");var t,s,i,n=document.getElementById("fixed-buttons"),o=20,a=100;window.addEventListener("scroll",function(){t.newScrollTop=t.util.getScrollTop();var e,c,l,i=t.newScrollTop-t.oldScrollTop,r=t.util.isMobile();t.util.forEach(s,function(e){i>o?(e.classList.remove("animate__fadeInDown"),t.util.animateCSS(e,["animate__fadeOutUp","animate__faster"],!0)):i<-o&&(e.classList.remove("animate__fadeOutUp"),t.util.animateCSS(e,["animate__fadeInDown","animate__faster"],!0))}),t.newScrollTop>a?r&&i>o?(n.classList.remove("animate__fadeIn"),t.util.animateCSS(n,["animate__fadeOut","animate__faster"],!0)):(!r||i<-o)&&(n.style.display="block",n.classList.remove("animate__fadeOut"),t.util.animateCSS(n,["animate__fadeIn","animate__faster"],!0)):(r||(n.classList.remove("animate__fadeIn"),t.util.animateCSS(n,["animate__fadeOut","animate__faster"],!0)),n.style.display="none"),e=_createForOfIteratorHelper(t.scrollEventSet);try{for(e.s();!(c=e.n()).done;)l=c.value,l()}catch(t){e.e(t)}finally{e.f()}t.oldScrollTop=t.newScrollTop},!1)}},{key:"onResize",value:function(){var t=this;window.addEventListener("resize",function(){t._resizeTimeout||(t._resizeTimeout=window.setTimeout(function(){t._resizeTimeout=null;var n,s,e=_createForOfIteratorHelper(t.resizeEventSet);try{for(e.s();!(n=e.n()).done;)s=n.value,s()}catch(t){e.e(t)}finally{e.f()}t.initToc(),t.initMermaid(),t.initSearch()},100))},!1)}},{key:"onClickMask",value:function(){var t=this;document.getElementById("mask").addEventListener("click",function(){var n,s,e=_createForOfIteratorHelper(t.clickMaskEventSet);try{for(e.s();!(n=e.n()).done;)s=n.value,s()}catch(t){e.e(t)}finally{e.f()}document.body.classList.remove("blur")},!1)}},{key:"init",value:function(){var t=this;try{this.initRaw(),this.initSVGIcon(),this.initTwemoji(),this.initMenuMobile(),this.initSwitchTheme(),this.initSearch(),this.initDetails(),this.initLightGallery(),this.initHighlight(),this.initTable(),this.initHeaderLink(),this.initMath(),this.initMermaid(),this.initEcharts(),this.initTypeit(),this.initMapbox(),this.initCookieconsent()}catch(e){console.error(e)}window.setTimeout(function(){t.initToc(),t.initComment(),t.onScroll(),t.onResize(),t.onClickMask()},100)}}]),e}(),themeInit=function(){var t=new Theme;t.init()};document.readyState!=="loading"?themeInit():document.addEventListener("DOMContentLoaded",themeInit,!1)