diff --git a/CHANGELOG.md b/CHANGELOG.md index 073e0114..de7f2761 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,16 +3,18 @@ All notable changes to this project will be documented in this file. -## v0.2.18 +## v0.2.18 [2023.3.31] + +> **Note** +> This will be the last relatively stable 0.x release, after which the first major release will be incompatible with all previous 0.x releases +> Snapshot: <> ## :boom: Breaking Updates -- [#288](https://github.com/hugo-fixit/FixIt/pull/288) +- Refactor author data config [#288](https://github.com/hugo-fixit/FixIt/pull/288) ## :new: What's New -> Snapshot: <> - - :tada: Feat: add natively support mermaid with code fences ([#230](https://github.com/hugo-fixit/FixIt/issues/230)) - :tada: Feat: add breadcrumb navigation ([#309](https://github.com/hugo-fixit/FixIt/pull/309)) - :sparkles: Feat: add instant page (@Mejituu [#279](https://github.com/hugo-fixit/FixIt/pull/279)) @@ -43,6 +45,7 @@ All notable changes to this project will be documented in this file. - Update Update @waline/client from 2.10.0 to 2.14.7 (@Mejituu [#279](https://github.com/hugo-fixit/FixIt/pull/279)) - Update typeit from 8.7.0 to 8.7.1 - Update mermaid from 9.1.7 to 9.4.3 + - Update Artalk from 2.3.4 to 2.5.2 - **Full Changelog:** @Lruihao [`v0.2.16...v0.2.17`](https://github.com/hugo-fixit/FixIt/compare/v0.2.16...v0.2.17) ## v0.2.17 [2023.1.29] diff --git a/assets/data/cdn/jsdelivr.yml b/assets/data/cdn/jsdelivr.yml index 719e14a3..b9690437 100644 --- a/assets/data/cdn/jsdelivr.yml +++ b/assets/data/cdn/jsdelivr.yml @@ -13,9 +13,9 @@ libFiles: # aplayer@1.10.1 https://github.com/MoePlayer/APlayer aplayerCSS: aplayer@1.10.1/dist/APlayer.min.css aplayerJS: aplayer@1.10.1/dist/APlayer.min.js - # artalk@2.3.4 https://github.com/ArtalkJS/Artalk - artalkCSS: artalk@2.3.4/dist/Artalk.min.css - artalkJS: artalk@2.3.4/dist/Artalk.min.js + # artalk@2.5.2 https://github.com/ArtalkJS/Artalk + artalkCSS: artalk@2.5.2/dist/Artalk.css + artalkJS: artalk@2.5.2/dist/Artalk.js # autocomplete-js@0.38.1 https://github.com/algolia/autocomplete # TODO update autocompleteJS: '@algolia/autocomplete-js@1.7.1/dist/umd/index.production.js' autocompleteJS: autocomplete.js@0.38.1/dist/autocomplete.min.js diff --git a/assets/data/cdn/unpkg.yml b/assets/data/cdn/unpkg.yml index a440944e..d064ada5 100644 --- a/assets/data/cdn/unpkg.yml +++ b/assets/data/cdn/unpkg.yml @@ -13,9 +13,9 @@ libFiles: # aplayer@1.10.1 https://github.com/MoePlayer/APlayer aplayerCSS: aplayer@1.10.1/dist/APlayer.min.css aplayerJS: aplayer@1.10.1/dist/APlayer.min.js - # artalk@2.3.4 https://github.com/ArtalkJS/Artalk - artalkCSS: artalk@2.3.4/dist/Artalk.css - artalkJS: artalk@2.3.4/dist/Artalk.js + # artalk@2.5.2 https://github.com/ArtalkJS/Artalk + artalkCSS: artalk@2.5.2/dist/Artalk.css + artalkJS: artalk@2.5.2/dist/Artalk.js # autocomplete-js@0.38.1 https://github.com/algolia/autocomplete # TODO update autocompleteJS: '@algolia/autocomplete-js@1.7.1/dist/umd/index.production.js' autocompleteJS: autocomplete.js@0.38.1/dist/autocomplete.min.js diff --git a/assets/js/theme.min.js b/assets/js/theme.min.js index 121554dc..538a4e98 100644 --- a/assets/js/theme.min.js +++ b/assets/js/theme.min.js @@ -1,3 +1,3 @@ -"use strict";function _objectDestructuringEmpty(obj){if(obj==null)throw new TypeError("Cannot destructure "+obj)}function _createForOfIteratorHelper(o,allowArrayLike){var it=typeof Symbol!=="undefined"&&o[Symbol.iterator]||o["@@iterator"];if(!it){if(Array.isArray(o)||(it=_unsupportedIterableToArray(o))||allowArrayLike&&o&&typeof o.length==="number"){if(it)o=it;var i=0;var F=function F(){};return{s:F,n:function n(){if(i>=o.length)return{done:true};return{done:false,value:o[i++]}},e:function e(_e){throw _e},f:F}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var normalCompletion=true,didErr=false,err;return{s:function s(){it=it.call(o)},n:function n(){var step=it.next();normalCompletion=step.done;return step},e:function e(_e2){didErr=true;err=_e2},f:function f(){try{if(!normalCompletion&&it.return!=null)it.return()}finally{if(didErr)throw err}}}}function _defineProperty(obj,key,value){if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true})}else{obj[key]=value}return obj}function _toConsumableArray(arr){return _arrayWithoutHoles(arr)||_iterableToArray(arr)||_unsupportedIterableToArray(arr)||_nonIterableSpread()}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(o,minLen){if(!o)return;if(typeof o==="string")return _arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);if(n==="Object"&&o.constructor)n=o.constructor.name;if(n==="Map"||n==="Set")return Array.from(o);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _arrayLikeToArray(o,minLen)}function _iterableToArray(iter){if(typeof Symbol!=="undefined"&&iter[Symbol.iterator]!=null||iter["@@iterator"]!=null)return Array.from(iter)}function _arrayWithoutHoles(arr){if(Array.isArray(arr))return _arrayLikeToArray(arr)}function _arrayLikeToArray(arr,len){if(len==null||len>arr.length)len=arr.length;for(var i=0,arr2=new Array(len);i.nested-item"),function($nestedItem){$nestedItem.addEventListener("click",function(){this.parentNode.querySelector(".sub-menu").classList.toggle("open");this.querySelector(".dropdown-icon").classList.toggle("open")})})}},{key:"initSwitchTheme",value:function initSwitchTheme(){var _this4=this;this.util.forEach(document.getElementsByClassName("theme-switch"),function($themeSwitch){$themeSwitch.addEventListener("click",function(){var _window$localStorage;document.body.dataset.theme=document.body.dataset.theme==="dark"?"light":"dark";_this4.isDark=!_this4.isDark;(_window$localStorage=window.localStorage)===null||_window$localStorage===void 0?void 0:_window$localStorage.setItem("theme",_this4.isDark?"dark":"light");var _iterator=_createForOfIteratorHelper(_this4.switchThemeEventSet),_step;try{for(_iterator.s();!(_step=_iterator.n()).done;){var event=_step.value;event()}}catch(err){_iterator.e(err)}finally{_iterator.f()}},false)})}},{key:"initSearch",value:function initSearch(){var _searchConfig$maxResu,_searchConfig$snippet,_searchConfig$highlig,_searchConfig$isCaseS,_searchConfig$minMatc,_searchConfig$findAll,_searchConfig$locatio,_searchConfig$thresho,_searchConfig$distanc,_searchConfig$ignoreL,_searchConfig$useExte,_searchConfig$ignoreF,_this5=this;var searchConfig=this.config.search;var isMobile=this.util.isMobile();if(!searchConfig||isMobile&&this._searchMobileOnce||!isMobile&&this._searchDesktopOnce){return}var maxResultLength=(_searchConfig$maxResu=searchConfig.maxResultLength)!==null&&_searchConfig$maxResu!==void 0?_searchConfig$maxResu:10;var snippetLength=(_searchConfig$snippet=searchConfig.snippetLength)!==null&&_searchConfig$snippet!==void 0?_searchConfig$snippet:50;var highlightTag=(_searchConfig$highlig=searchConfig.highlightTag)!==null&&_searchConfig$highlig!==void 0?_searchConfig$highlig:"em";var isCaseSensitive=(_searchConfig$isCaseS=searchConfig.isCaseSensitive)!==null&&_searchConfig$isCaseS!==void 0?_searchConfig$isCaseS:false;var minMatchCharLength=(_searchConfig$minMatc=searchConfig.minMatchCharLength)!==null&&_searchConfig$minMatc!==void 0?_searchConfig$minMatc:1;var findAllMatches=(_searchConfig$findAll=searchConfig.findAllMatches)!==null&&_searchConfig$findAll!==void 0?_searchConfig$findAll:false;var location=(_searchConfig$locatio=searchConfig.location)!==null&&_searchConfig$locatio!==void 0?_searchConfig$locatio:0;var threshold=(_searchConfig$thresho=searchConfig.threshold)!==null&&_searchConfig$thresho!==void 0?_searchConfig$thresho:0.3;var distance=(_searchConfig$distanc=searchConfig.distance)!==null&&_searchConfig$distanc!==void 0?_searchConfig$distanc:100;var ignoreLocation=(_searchConfig$ignoreL=searchConfig.ignoreLocation)!==null&&_searchConfig$ignoreL!==void 0?_searchConfig$ignoreL:false;var useExtendedSearch=(_searchConfig$useExte=searchConfig.useExtendedSearch)!==null&&_searchConfig$useExte!==void 0?_searchConfig$useExte:false;var ignoreFieldNorm=(_searchConfig$ignoreF=searchConfig.ignoreFieldNorm)!==null&&_searchConfig$ignoreF!==void 0?_searchConfig$ignoreF:false;var suffix=isMobile?"mobile":"desktop";var $header=document.getElementById("header-".concat(suffix));var $searchInput=document.getElementById("search-input-".concat(suffix));var $searchToggle=document.getElementById("search-toggle-".concat(suffix));var $searchLoading=document.getElementById("search-loading-".concat(suffix));var $searchClear=document.getElementById("search-clear-".concat(suffix));if(isMobile){this._searchMobileOnce=true;$searchInput.addEventListener("focus",function(){_this5.disableScrollEvent=true;document.body.classList.add("blur");$header.classList.add("open")},false);document.getElementById("search-cancel-mobile").addEventListener("click",function(){_this5.disableScrollEvent=false;$header.classList.remove("open");document.body.classList.remove("blur");document.getElementById("menu-toggle-mobile").classList.remove("active");document.getElementById("menu-mobile").classList.remove("active");$searchLoading.style.display="none";$searchClear.style.display="none";_this5._searchMobile&&_this5._searchMobile.autocomplete.setVal("")},false);$searchClear.addEventListener("click",function(){$searchClear.style.display="none";_this5._searchMobile&&_this5._searchMobile.autocomplete.setVal("")},false);this._searchMobileOnClickMask=this._searchMobileOnClickMask||function(){$header.classList.remove("open");$searchLoading.style.display="none";$searchClear.style.display="none";_this5._searchMobile&&_this5._searchMobile.autocomplete.setVal("")};this.clickMaskEventSet.add(this._searchMobileOnClickMask)}else{this._searchDesktopOnce=true;$searchToggle.addEventListener("click",function(){document.body.classList.add("blur");$header.classList.add("open");$searchInput.focus()},false);$searchClear.addEventListener("click",function(){$searchClear.style.display="none";_this5._searchDesktop&&_this5._searchDesktop.autocomplete.setVal("")},false);this._searchDesktopOnClickMask=this._searchDesktopOnClickMask||function(){$header.classList.remove("open");$searchLoading.style.display="none";$searchClear.style.display="none";_this5._searchDesktop&&_this5._searchDesktop.autocomplete.setVal("")};this.clickMaskEventSet.add(this._searchDesktopOnClickMask)}$searchInput.addEventListener("input",function(){if($searchInput.value==="")$searchClear.style.display="none";else $searchClear.style.display="inline"},false);var initAutosearch=function initAutosearch(){var autosearch=autocomplete("#search-input-".concat(suffix),{hint:false,autoselect:true,dropdownMenuContainer:"#search-dropdown-".concat(suffix),clearOnSelected:true,cssClasses:{noPrefix:true},debug:true},{name:"search",source:function source(query,callback){$searchLoading.style.display="inline";$searchClear.style.display="none";var finish=function finish(results){$searchLoading.style.display="none";$searchClear.style.display="inline";callback(results)};if(searchConfig.type==="lunr"){var search=function search(){if(lunr.queryHandler){query=lunr.queryHandler(query)}var results={};_this5._index.search(query).forEach(function(_ref){var ref=_ref.ref,metadata=_ref.matchData.metadata;var matchData=_this5._indexData[ref];var uri=matchData.uri,title=matchData.title,context=matchData.content;if(results[uri]){return}var position=0;Object.values(metadata).forEach(function(_ref2){var content=_ref2.content;if(content){var matchPosition=content.position[0][0];if(matchPosition0){position+=context.substr(position,20).lastIndexOf(" ")+1;context="..."+context.substr(position,snippetLength)}else{context=context.substr(0,snippetLength)}Object.keys(metadata).forEach(function(key){title=title.replace(new RegExp("(".concat(key,")"),"gi"),"<".concat(highlightTag,">$1"));context=context.replace(new RegExp("(".concat(key,")"),"gi"),"<".concat(highlightTag,">$1"))});results[uri]={uri:uri,title:title,date:matchData.date,context:context}});return Object.values(results).slice(0,maxResultLength)};if(!_this5._index){fetch(searchConfig.lunrIndexURL).then(function(response){return response.json()}).then(function(data){var indexData={};_this5._index=lunr(function(){var _this6=this;if(searchConfig.lunrLanguageCode)this.use(lunr[searchConfig.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"];data.forEach(function(record){indexData[record.objectID]=record;_this6.add(record)})});_this5._indexData=indexData;finish(search())}).catch(function(err){console.error(err);finish([])})}else finish(search())}else if(searchConfig.type==="algolia"){_this5._algoliaIndex=_this5._algoliaIndex||algoliasearch(searchConfig.algoliaAppID,searchConfig.algoliaSearchKey).initIndex(searchConfig.algoliaIndex);_this5._algoliaIndex.search(query,{offset:0,length:maxResultLength*8,attributesToHighlight:["title"],attributesToSnippet:["content:".concat(snippetLength)],highlightPreTag:"<".concat(highlightTag,">"),highlightPostTag:"")}).then(function(_ref3){var hits=_ref3.hits;var results={};hits.forEach(function(_ref4){var uri=_ref4.uri,date=_ref4.date,title=_ref4._highlightResult.title,content=_ref4._snippetResult.content;if(results[uri]&&results[uri].context.length>content.value){return}results[uri]={uri:uri,title:title.value,date:date,context:content.value}});finish(Object.values(results).slice(0,maxResultLength))}).catch(function(err){console.error(err);finish([])})}else if(searchConfig.type==="fuse"){var _search=function _search(){var results={};window._index.search(query).forEach(function(_ref5){var item=_ref5.item,refIndex=_ref5.refIndex,matches=_ref5.matches;var title=item.title;var content=item.content;matches.forEach(function(_ref6){var indices=_ref6.indices,value=_ref6.value,key=_ref6.key;if(key==="content"){var offset=0;for(var i=0;i")+substr+"");content=content.substring(0,indices[i][0]+offset)+tag+content.substring(indices[i][1]+1+offset,content.length);offset+=highlightTag.length*2+5}}else if(key==="title"){var _offset=0;for(var _i=0;_i")+_substr+"");title=title.substring(0,indices[_i][0]+_offset)+_tag+title.substring(indices[_i][1]+1+_offset,content.length);_offset+=highlightTag.length*2+5}}});results[item.uri]={uri:item.uri,title:title,date:item.date,context:content}});return Object.values(results).slice(0,maxResultLength)};if(!window._index){fetch(searchConfig.fuseIndexURL).then(function(response){return response.json()}).then(function(data){var options={isCaseSensitive:isCaseSensitive,findAllMatches:findAllMatches,minMatchCharLength:minMatchCharLength,location:location,threshold:threshold,distance:distance,ignoreLocation:ignoreLocation,useExtendedSearch:useExtendedSearch,ignoreFieldNorm:ignoreFieldNorm,includeScore:false,shouldSort:true,includeMatches:true,keys:["content","title"]};window._index=new Fuse(data,options);finish(_search())}).catch(function(err){console.error(err);finish([])})}else finish(_search())}},templates:{suggestion:function suggestion(_ref7){var title=_ref7.title,date=_ref7.date,context=_ref7.context;return"
".concat(title,"").concat(date,"
").concat(context,"
")},empty:function empty(_ref8){var query=_ref8.query;return"
".concat(searchConfig.noResultsFound,": \"").concat(query,"\"
")},footer:function footer(_ref9){_objectDestructuringEmpty(_ref9);var _ref10=searchConfig.type==="algolia"?{searchType:"algolia",icon:"",href:"https://www.algolia.com/"}:searchConfig.type==="lunr"?{searchType:"Lunr.js",icon:"",href:"https://lunrjs.com/"}:{searchType:"Fuse.js",icon:"",href:"https://fusejs.io/"},searchType=_ref10.searchType,icon=_ref10.icon,href=_ref10.href;return"")}}});autosearch.on("autocomplete:selected",function(_event,suggestion,_dataset,_context){window.location.assign(suggestion.uri)});if(isMobile){_this5._searchMobile=autosearch}else{_this5._searchDesktop=autosearch}};if(searchConfig.lunrSegmentitURL&&!document.getElementById("lunr-segmentit")){var script=document.createElement("script");script.id="lunr-segmentit";script.src=searchConfig.lunrSegmentitURL;script.async=true;if(script.readyState){script.onreadystatechange=function(){if(script.readyState=="loaded"||script.readyState=="complete"){script.onreadystatechange=null;initAutosearch()}}}else{script.onload=function(){initAutosearch()}}document.body.appendChild(script)}else{initAutosearch()}}},{key:"initDetails",value:function initDetails(){this.util.forEach(document.getElementsByClassName("details"),function($details){var $summary=$details.querySelector(".details-summary");$summary.addEventListener("click",function(){$details.classList.toggle("open")},false)})}},{key:"initLightGallery",value:function initLightGallery(){if(this.config.lightgallery){lightGallery(document.getElementById("content"),{plugins:[lgThumbnail,lgZoom],selector:".lightgallery",speed:400,hideBarsDelay:2000,allowMediaOverlap:true,exThumbImage:"data-thumbnail",toggleThumb:true,thumbWidth:80,thumbHeight:"60px",actualSize:false,showZoomInOutIcons:true,licenseKey:"none"})}}},{key:"initHighlight",value:function initHighlight(){var _this7=this;this.util.forEach(document.querySelectorAll(".highlight > pre.chroma"),function($preChroma){var $chroma=document.createElement("div");$chroma.className=$preChroma.className;var $table=document.createElement("table");$chroma.appendChild($table);var $tbody=document.createElement("tbody");$table.appendChild($tbody);var $tr=document.createElement("tr");$tbody.appendChild($tr);var $td=document.createElement("td");$tr.appendChild($td);$preChroma.parentElement.replaceChild($chroma,$preChroma);$td.appendChild($preChroma)});this.util.forEach(document.querySelectorAll(".highlight > .chroma"),function($chroma){var $codeElements=$chroma.querySelectorAll("pre.chroma > code");if($codeElements.length){var $code=$codeElements[$codeElements.length-1];var $header=document.createElement("div");$header.className="code-header "+$code.className.toLowerCase();var $title=document.createElement("span");$title.classList.add("code-title");$title.insertAdjacentHTML("afterbegin","");$title.addEventListener("click",function(){$chroma.classList.toggle("open")},false);$header.appendChild($title);var $ellipses=document.createElement("span");$ellipses.insertAdjacentHTML("afterbegin","");$ellipses.classList.add("ellipses");$ellipses.addEventListener("click",function(){$chroma.classList.add("open")},false);$header.appendChild($ellipses);if(_this7.config.code.editable){var $edit=document.createElement("span");$edit.classList.add("edit");$edit.insertAdjacentHTML("afterbegin",""));$edit.addEventListener("click",function(){var $iconKey=$edit.querySelector(".fa-key");var $iconLock=$edit.querySelector(".fa-lock");var $preChromas=$edit.parentElement.parentElement.querySelectorAll("pre.chroma");var $preChroma=$preChromas.length===2?$preChromas[1]:$preChromas[0];if($iconKey){$iconKey.classList.add("fa-lock");$iconKey.classList.remove("fa-key");$iconKey.title=_this7.config.code.editLockTitle;$preChroma.setAttribute("contenteditable",true);$preChroma.focus()}else{$iconLock.classList.add("fa-key");$iconLock.classList.remove("fa-lock");$iconLock.title=_this7.config.code.editUnLockTitle;$preChroma.setAttribute("contenteditable",false);$preChroma.blur()}},false);$header.appendChild($edit)}if(_this7.config.code.copyTitle){var $copy=document.createElement("span");$copy.insertAdjacentHTML("afterbegin","");$copy.classList.add("copy");var code=$code.innerText.trim();if(_this7.config.code.maxShownLines<0||code.split("\n").length<_this7.config.code.maxShownLines+2){$chroma.classList.add("open")}$copy.title=_this7.config.code.copyTitle;$copy.addEventListener("click",function(){navigator.clipboard.writeText(code).then(function(){_this7.util.animateCSS($code,"animate__flash")},function(){console.error("Clipboard write failed!","Your browser does not support clipboard API!")})},false);$header.appendChild($copy)}$chroma.insertBefore($header,$chroma.firstChild)}})}},{key:"initTable",value:function initTable(){this.util.forEach(document.querySelectorAll(".content table"),function($table){var $wrapper=document.createElement("div");$wrapper.className="table-wrapper";$table.parentElement.replaceChild($wrapper,$table);$wrapper.appendChild($table)})}},{key:"initHeaderLink",value:function initHeaderLink(){for(var num=1;num<=6;num++){this.util.forEach(document.querySelectorAll(".single .content > h"+num),function($header){$header.classList.add("header-link");$header.insertAdjacentHTML("afterbegin",""))})}}},{key:"initToc",value:function initToc(){var _this8=this;var $tocCore=document.getElementById("TableOfContents");if($tocCore===null){return}if(typeof APlayer==="function"){var $newTocCore=$tocCore.cloneNode(true);$tocCore.parentElement.replaceChild($newTocCore,$tocCore);$tocCore=$newTocCore}if(document.getElementById("toc-static").dataset.kept===true||this.util.isTocStatic()){var $tocContentStatic=document.getElementById("toc-content-static");if($tocCore.parentElement!==$tocContentStatic){$tocCore.parentElement.removeChild($tocCore);$tocContentStatic.appendChild($tocCore)}this._tocOnScroll&&this.scrollEventSet.delete(this._tocOnScroll)}else{var $tocContentAuto=document.getElementById("toc-content-auto");if($tocCore.parentElement!==$tocContentAuto){$tocCore.parentElement.removeChild($tocCore);$tocContentAuto.appendChild($tocCore)}var $toc=document.getElementById("toc-auto");$toc.style.visibility="visible";this.util.animateCSS($toc,["animate__fadeIn","animate__faster"],true);var $postMeta=document.querySelector(".post-meta");$toc.style.marginTop="".concat($postMeta.offsetTop+$postMeta.clientHeight,"px");var $tocLinkElements=$tocCore.querySelectorAll("a:first-child");var $tocLiElements=$tocCore.getElementsByTagName("li");var $headerLinkElements=document.getElementsByClassName("header-link");var headerIsFixed=document.body.dataset.headerDesktop!=="normal";var headerHeight=document.getElementById("header-desktop").offsetHeight;document.querySelector(".container").addEventListener("resize",function(){$toc.style.marginBottom="".concat(document.querySelector(".container").clientHeight-document.querySelector(".post-footer").offsetTop,"px")});this._tocOnScroll=this._tocOnScroll||function(){$toc.style.marginBottom="".concat(document.querySelector(".container").clientHeight-document.querySelector(".post-footer").offsetTop,"px");_this8.util.forEach($tocLinkElements,function($tocLink){$tocLink.classList.remove("active")});_this8.util.forEach($tocLiElements,function($tocLi){$tocLi.classList.remove("has-active")});var INDEX_SPACING=20+(headerIsFixed?headerHeight:0);var activeTocIndex=$headerLinkElements.length-1;for(var i=0;i<$headerLinkElements.length-1;i++){var thisTop=$headerLinkElements[i].getBoundingClientRect().top;var nextTop=$headerLinkElements[i+1].getBoundingClientRect().top;if(i==0&&thisTop>INDEX_SPACING||thisTop<=INDEX_SPACING&&nextTop>INDEX_SPACING){activeTocIndex=i;break}}if(activeTocIndex!==-1){$tocLinkElements[activeTocIndex].classList.add("active");var $parent=$tocLinkElements[activeTocIndex].parentElement;while($parent!==$tocCore){$parent.classList.add("has-active");$parent=$parent.parentElement.parentElement}}};this._tocOnScroll();this.scrollEventSet.add(this._tocOnScroll)}}},{key:"initTocListener",value:function initTocListener(){var _document$querySelect2,_this9=this;var $toc=document.getElementById("toc-auto");var $tocContentAuto=document.getElementById("toc-content-auto");(_document$querySelect2=document.querySelector("#toc-auto>.toc-title"))===null||_document$querySelect2===void 0?void 0:_document$querySelect2.addEventListener("click",function(){var animation=["animate__faster"];var tocHidden=$toc.classList.contains("toc-hidden");animation.push(tocHidden?"animate__fadeIn":"animate__fadeOut");$tocContentAuto.classList.remove(tocHidden?"animate__fadeOut":"animate__fadeIn");_this9.util.animateCSS($tocContentAuto,animation,true);$toc.classList.toggle("toc-hidden")},false)}},{key:"initMath",value:function initMath(){if(this.config.math){renderMathInElement(document.body,this.config.math)}}},{key:"switchMermaidTheme",value:function switchMermaidTheme(theme){var _this10=this;var $mermaidElements=document.getElementsByClassName("mermaid");if($mermaidElements.length){var _this$config$mermaid$;var themes=(_this$config$mermaid$=this.config.mermaid.themes)!==null&&_this$config$mermaid$!==void 0?_this$config$mermaid$:["default","dark","neutral"];mermaid.initialize({startOnLoad:false,theme:theme!==null&&theme!==void 0?theme:this.isDark?themes[1]:themes[0],securityLevel:"loose"});this.util.forEach($mermaidElements,function($mermaid){mermaid.render("svg-"+$mermaid.id,_this10.data[$mermaid.id],function(svgCode){$mermaid.innerHTML=svgCode},$mermaid)})}}},{key:"initMermaid",value:function initMermaid(){var _this11=this;this.switchMermaidTheme();this.switchThemeEventSet.add(function(){_this11.switchMermaidTheme()});this.beforeprintEventSet.add(function(){_this11.switchMermaidTheme("neutral")})}},{key:"initEcharts",value:function initEcharts(){var _this12=this;if(!this.config.echarts){return}echarts.registerTheme("light",this.config.echarts.lightTheme);echarts.registerTheme("dark",this.config.echarts.darkTheme);this._echartsOnSwitchTheme=this._echartsOnSwitchTheme||function(){_this12._echartsArr=_this12._echartsArr||[];for(var i=0;i<_this12._echartsArr.length;i++){_this12._echartsArr[i].dispose()}_this12._echartsArr=[];_this12.util.forEach(document.getElementsByClassName("echarts"),function($echarts){var chart=echarts.init($echarts,_this12.isDark?"dark":"light",{renderer:"svg"});chart.setOption(JSON.parse(_this12.data[$echarts.id]));_this12._echartsArr.push(chart)})};this.switchThemeEventSet.add(this._echartsOnSwitchTheme);this._echartsOnSwitchTheme();this._echartsOnResize=this._echartsOnResize||function(){for(var i=0;i<_this12._echartsArr.length;i++){_this12._echartsArr[i].resize()}};this.resizeEventSet.add(this._echartsOnResize)}},{key:"initMapbox",value:function initMapbox(){var _this13=this;if(this.config.mapbox){mapboxgl.accessToken=this.config.mapbox.accessToken;mapboxgl.setRTLTextPlugin(this.config.mapbox.RTLTextPlugin);this._mapboxArr=this._mapboxArr||[];this.util.forEach(document.getElementsByClassName("mapbox"),function($mapbox){var _this13$data$$mapbox$=_this13.data[$mapbox.id],lng=_this13$data$$mapbox$.lng,lat=_this13$data$$mapbox$.lat,zoom=_this13$data$$mapbox$.zoom,lightStyle=_this13$data$$mapbox$.lightStyle,darkStyle=_this13$data$$mapbox$.darkStyle,marked=_this13$data$$mapbox$.marked,navigation=_this13$data$$mapbox$.navigation,geolocate=_this13$data$$mapbox$.geolocate,scale=_this13$data$$mapbox$.scale,fullscreen=_this13$data$$mapbox$.fullscreen;var mapbox=new mapboxgl.Map({container:$mapbox,center:[lng,lat],zoom:zoom,minZoom:0.2,style:_this13.isDark?darkStyle:lightStyle,attributionControl:false});if(marked){new mapboxgl.Marker().setLngLat([lng,lat]).addTo(mapbox)}if(navigation){mapbox.addControl(new mapboxgl.NavigationControl,"bottom-right")}if(geolocate){mapbox.addControl(new mapboxgl.GeolocateControl({positionOptions:{enableHighAccuracy:true},showUserLocation:true,trackUserLocation:true}),"bottom-right")}if(scale){mapbox.addControl(new mapboxgl.ScaleControl)}if(fullscreen){mapbox.addControl(new mapboxgl.FullscreenControl)}mapbox.addControl(new MapboxLanguage);_this13._mapboxArr.push(mapbox)});this._mapboxOnSwitchTheme=this._mapboxOnSwitchTheme||function(){_this13.util.forEach(_this13._mapboxArr,function(mapbox){var $mapbox=mapbox.getContainer();var _this13$data$$mapbox$2=_this13.data[$mapbox.id],lightStyle=_this13$data$$mapbox$2.lightStyle,darkStyle=_this13$data$$mapbox$2.darkStyle;mapbox.setStyle(_this13.isDark?darkStyle:lightStyle);mapbox.addControl(new MapboxLanguage)})};this.switchThemeEventSet.add(this._mapboxOnSwitchTheme)}}},{key:"initTypeit",value:function initTypeit(){var _this14=this;if(this.config.typeit){var _typeitConfig$loop;var typeitConfig=this.config.typeit;var speed=typeitConfig.speed||100;var cursorSpeed=typeitConfig.cursorSpeed||1000;var cursorChar=typeitConfig.cursorChar||"|";var loop=(_typeitConfig$loop=typeitConfig.loop)!==null&&_typeitConfig$loop!==void 0?_typeitConfig$loop:false;Object.values(typeitConfig.data).forEach(function(group){var typeone=function typeone(i){var id=group[i];var shortcodeLoop=document.querySelector("#".concat(id)).parentElement.dataset.loop;var instance=new TypeIt("#".concat(id),{strings:_this14.data[id],speed:speed,lifeLike:true,cursorSpeed:cursorSpeed,cursorChar:cursorChar,waitUntilVisible:true,loop:shortcodeLoop?JSON.parse(shortcodeLoop):loop,afterComplete:function afterComplete(){if(i===group.length-1){if(typeitConfig.duration>=0){window.setTimeout(function(){instance.destroy()},typeitConfig.duration)}return}instance.destroy();typeone(i+1)}}).go()};typeone(0)})}}},{key:"initCommentLightGallery",value:function initCommentLightGallery(comments,images){document.querySelectorAll(comments).forEach(function($content){var $imgs=$content.querySelectorAll(images+":not([lightgallery-loaded])");$imgs.forEach(function($img){$img.setAttribute("lightgallery-loaded","");var $link=document.createElement("a");$link.setAttribute("class","comment-lightgallery");$link.setAttribute("href",$img.src);$link.append($img.cloneNode());$img.replaceWith($link)});if($imgs.length){lightGallery($content,{selector:".comment-lightgallery",actualSize:false,hideBarsDelay:2000,speed:400})}})}},{key:"initComment",value:function initComment(){var _this$config$comment,_this15=this;if(!((_this$config$comment=this.config.comment)!==null&&_this$config$comment!==void 0&&_this$config$comment.enable)){return}if(document.querySelector("#comments")){var $viewCommentsBtn=document.querySelector(".view-comments");$viewCommentsBtn.classList.remove("d-none");$viewCommentsBtn.addEventListener("click",function(){_this15.util.scrollIntoView("#comments")},false)}this.config.comment.expired&&document.querySelector("#comments").remove();if(this.config.comment.artalk){if(this.config.comment.expired){return Artalk.LoadCountWidget({server:this.config.comment.artalk.server,site:this.config.comment.artalk.site,pvEl:this.config.comment.artalk.pvEl,countEl:this.config.comment.artalk.countEl})}var artalk=new Artalk(this.config.comment.artalk);artalk.setDarkMode(this.isDark);this.switchThemeEventSet.add(function(){artalk.setDarkMode(_this15.isDark)});artalk.on("comments-loaded",function(){_this15.config.comment.artalk.lightgallery&&_this15.initCommentLightGallery(".atk-comment .atk-content","img:not([atk-emoticon])")});return artalk}if(this.config.comment.gitalk){this.config.comment.gitalk.body=decodeURI(window.location.href);var gitalk=new Gitalk(this.config.comment.gitalk);gitalk.render("gitalk");return gitalk}if(this.config.comment.valine){return new Valine(this.config.comment.valine)}if(this.config.comment.waline){if(this.config.comment.expired){this.config.comment.waline.pageview&&Waline.pageviewCount({serverURL:this.config.comment.waline.serverURL,path:window.location.pathname});return}return Waline.init(this.config.comment.waline)}if(this.config.comment.utterances){var utterancesConfig=this.config.comment.utterances;var script=document.createElement("script");script.src="https://utteranc.es/client.js";script.setAttribute("repo",utterancesConfig.repo);script.setAttribute("issue-term",utterancesConfig.issueTerm);if(utterancesConfig.label)script.setAttribute("label",utterancesConfig.label);script.setAttribute("theme",this.isDark?utterancesConfig.darkTheme:utterancesConfig.lightTheme);script.crossOrigin="anonymous";script.async=true;document.getElementById("utterances").appendChild(script);this._utterancesOnSwitchTheme=this._utterancesOnSwitchTheme||function(){var _document$querySelect3;var message={type:"set-theme",theme:_this15.isDark?utterancesConfig.darkTheme:utterancesConfig.lightTheme};(_document$querySelect3=document.querySelector(".utterances-frame"))===null||_document$querySelect3===void 0?void 0:_document$querySelect3.contentWindow.postMessage(message,"https://utteranc.es")};this.switchThemeEventSet.add(this._utterancesOnSwitchTheme);return}if(this.config.comment.twikoo){var twikooConfig=this.config.comment.twikoo;if(twikooConfig.lightgallery){twikooConfig.onCommentLoaded=function(){_this15.initCommentLightGallery(".tk-comments .tk-content","img:not(.tk-owo-emotion)")}}twikoo.init(twikooConfig);if(twikooConfig.commentCount){twikoo.getCommentsCount({envId:twikooConfig.envId,region:twikooConfig.region,urls:[window.location.pathname],includeReply:false}).then(function(response){var twikooCommentCount=document.getElementById("twikoo-comment-count");if(twikooCommentCount)twikooCommentCount.innerHTML=response[0].count})}return}if(this.config.comment.giscus){var giscusConfig=this.config.comment.giscus;this._giscusOnSwitchTheme=this._giscusOnSwitchTheme||function(){var _document$querySelect4;var message={setConfig:{theme:_this15.isDark?giscusConfig.darkTheme:giscusConfig.lightTheme}};(_document$querySelect4=document.querySelector(".giscus-frame"))===null||_document$querySelect4===void 0?void 0:_document$querySelect4.contentWindow.postMessage({giscus:message},"https://giscus.app")};this.switchThemeEventSet.add(this._giscusOnSwitchTheme);this.giscus2parentMsg=window.addEventListener("message",function(event){var $script=document.querySelector("#giscus>script");if($script){_this15._giscusOnSwitchTheme();$script.parentElement.removeChild($script)}},{once:true});return}}},{key:"initCookieconsent",value:function initCookieconsent(){this.config.cookieconsent&&cookieconsent.initialise(this.config.cookieconsent)}},{key:"initSiteTime",value:function initSiteTime(){var _this16=this;if(this.config.siteTime){this.siteTime=setInterval(this.getSiteTime,500);document.addEventListener("visibilitychange",function(){if(document.hidden){return clearInterval(_this16.siteTime)}_this16.siteTime=setInterval(_this16.getSiteTime,500)},false)}}},{key:"initServiceWorker",value:function initServiceWorker(){if(this.config.enablePWA&&"serviceWorker"in navigator){navigator.serviceWorker.register("/service-worker.min.js",{scope:"/"}).then(function(registration){}).catch(function(error){console.error("error: ",error)});navigator.serviceWorker.ready.then(function(registration){})}}},{key:"initWatermark",value:function initWatermark(){var _this$config$watermar,_document$querySelect5,_document$querySelect6;((_this$config$watermar=this.config.watermark)===null||_this$config$watermar===void 0?void 0:_this$config$watermar.enable)&&new Watermark({content:this.config.watermark.content||"".concat((_document$querySelect5=(_document$querySelect6=document.querySelector("footer .fixit-icon"))===null||_document$querySelect6===void 0?void 0:_document$querySelect6.outerHTML)!==null&&_document$querySelect5!==void 0?_document$querySelect5:""," FixIt Theme"),appendTo:this.config.watermark.appendto||".wrapper>main",opacity:this.config.watermark.opacity,width:this.config.watermark.width,height:this.config.watermark.height,rowSpacing:this.config.watermark.rowspacing,colSpacing:this.config.watermark.colspacing,rotate:this.config.watermark.rotate,fontSize:this.config.watermark.fontsize,fontFamily:this.config.watermark.fontfamily})}},{key:"initPangu",value:function initPangu(){var _this$config$pangu;if(!((_this$config$pangu=this.config.pangu)!==null&&_this$config$pangu!==void 0&&_this$config$pangu.enable)){return}var selector=this.config.pangu.selector;if(selector){if(selector.startsWith("#")){pangu.spacingElementById(selector.slice(1))}else if(selector.startsWith(".")){pangu.spacingElementByClassName(selector.slice(1))}else{pangu.spacingElementByTagName(selector)}return}pangu.autoSpacingPage()}},{key:"initFixItDecryptor",value:function initFixItDecryptor(){var _this17=this,_this$config$encrypti,_this$config$encrypti2;var $tocNodes=document.querySelectorAll("#toc-auto>.d-none, #toc-static.d-none");this.decryptor=new FixItDecryptor({decrypted:function decrypted(){_this17.initTwemoji();_this17.initDetails();_this17.initLightGallery();_this17.initHighlight();_this17.initTable();_this17.initHeaderLink();_this17.initMath();_this17.initMermaid();_this17.initEcharts();_this17.initTypeit();_this17.initMapbox();_this17.util.forEach($tocNodes,function($element){$element.classList.remove("d-none")});_this17.initToc();_this17.initTocListener();_this17.initPangu()},reset:function reset(){_this17.util.forEach($tocNodes,function($element){$element.classList.add("d-none")})}});if((_this$config$encrypti=this.config.encryption)!==null&&_this$config$encrypti!==void 0&&_this$config$encrypti.shortcode){this.decryptor.addEventListener("decrypted",function(){_this17.decryptor.initShortcodes()});this.decryptor.initShortcodes()}((_this$config$encrypti2=this.config.encryption)===null||_this$config$encrypti2===void 0?void 0:_this$config$encrypti2.all)&&this.decryptor.init()}},{key:"initMDevtools",value:function initMDevtools(){var _this$config,_this18=this;var type=(_this$config=this.config)===null||_this$config===void 0?void 0:_this$config.mDevtools;if(typeof window.orientation==="undefined"){return}if(type==="vConsole"){var vConsole=new VConsole({target:".widgets",theme:this.isDark?"dark":"light"});this._vConsoleOnSwitchTheme=this._vConsoleOnSwitchTheme||function(){vConsole.setOption("theme",_this18.isDark?"dark":"light")};this.switchThemeEventSet.add(this._vConsoleOnSwitchTheme)}if(type==="eruda"){eruda.init({defaults:{theme:this.isDark?"Dark":"Light"}});this._erudaOnSwitchTheme=this._erudaOnSwitchTheme||function(){eruda.util.evalCss.setTheme(_this18.isDark?"Dark":"Light")};this.switchThemeEventSet.add(this._erudaOnSwitchTheme)}}},{key:"initAutoMark",value:function initAutoMark(){var _this19=this,_window$localStorage3;if(!this.config.autoBookmark){return}window.addEventListener("beforeunload",function(){var _window$localStorage2;(_window$localStorage2=window.localStorage)===null||_window$localStorage2===void 0?void 0:_window$localStorage2.setItem("fixit-bookmark/#".concat(location.pathname),_this19.util.getScrollTop())});var scrollTop=Number((_window$localStorage3=window.localStorage)===null||_window$localStorage3===void 0?void 0:_window$localStorage3.getItem("fixit-bookmark/#".concat(location.pathname)));if(scrollTop&&location.hash===""){window.scrollTo({top:scrollTop,behavior:"smooth"})}}},{key:"initReward",value:function initReward(){var _this20=this;var $rewards=document.querySelectorAll(".post-reward [data-mode=\"fixed\"]");if(!$rewards.length){return}if(this.util.isMobile()){this.util.forEach($rewards,function($reward){$reward.removeAttribute("data-mode")});return}var _closeRewardExclude=function _closeRewardExclude(id){_this20.util.forEach($rewards,function($reward){var $rewardInput=$reward.parentElement.querySelector(".reward-input");if($rewardInput.id!==id){$rewardInput.checked=false}})};this.util.forEach($rewards,function($reward){$reward.previousElementSibling.addEventListener("click",function(){_closeRewardExclude(this.getAttribute("for"))},false)});this.scrollEventSet.add(_closeRewardExclude)}},{key:"onScroll",value:function onScroll(){var _this21=this;var $headers=[];var ACCURACY=20;var $fixedButtons=document.querySelector(".fixed-buttons");var $backToTop=document.querySelector(".back-to-top");var $readingProgressBar=document.querySelector(".reading-progress-bar");var scrollTimer=void 0;if(document.body.dataset.headerDesktop==="auto"){$headers.push(document.getElementById("header-desktop"))}if(document.body.dataset.headerMobile==="auto"){$headers.push(document.getElementById("header-mobile"))}$backToTop===null||$backToTop===void 0?void 0:$backToTop.addEventListener("click",function(){_this21.util.scrollIntoView("body")});window.addEventListener("scroll",function(event){if(_this21.disableScrollEvent){event.preventDefault();return}var $mask=document.getElementById("mask");_this21.newScrollTop=_this21.util.getScrollTop();var scroll=_this21.newScrollTop-_this21.oldScrollTop;document.body.toggleAttribute("data-scroll",true);scrollTimer&&window.clearTimeout(scrollTimer);scrollTimer=window.setTimeout(function(){document.body.toggleAttribute("data-scroll")},500);_this21.util.forEach($headers,function($header){if(scroll>ACCURACY){$header.classList.remove("animate__fadeInDown");_this21.util.animateCSS($header,["animate__fadeOutUp"],true);$mask.click()}else if(scroll<-ACCURACY){$header.classList.remove("animate__fadeOutUp");_this21.util.animateCSS($header,["animate__fadeInDown"],true);$mask.click()}});var contentHeight=document.body.scrollHeight-window.innerHeight;var scrollPercent=Math.max(Math.min(100*Math.max(_this21.newScrollTop,0)/contentHeight,100),0);if($readingProgressBar){$readingProgressBar.style.setProperty("--progress","".concat(scrollPercent.toFixed(2),"%"))}if($fixedButtons){if(scrollPercent>1){$fixedButtons.classList.remove("d-none","animate__fadeOut");_this21.util.animateCSS($fixedButtons,["animate__fadeIn"],true)}else{$fixedButtons.classList.remove("animate__fadeIn");_this21.util.animateCSS($fixedButtons,["animate__fadeOut"],true,function(){$fixedButtons.classList.contains("animate__fadeOut")&&$fixedButtons.classList.add("d-none")})}if($backToTop){$backToTop.querySelector("span").innerText="".concat(Math.round(scrollPercent),"%")}}var _iterator2=_createForOfIteratorHelper(_this21.scrollEventSet),_step2;try{for(_iterator2.s();!(_step2=_iterator2.n()).done;){var _event2=_step2.value;_event2()}}catch(err){_iterator2.e(err)}finally{_iterator2.f()}_this21.oldScrollTop=_this21.newScrollTop},false)}},{key:"onResize",value:function onResize(){var _this22=this;var resizeBefore=this.util.isMobile();window.addEventListener("resize",function(){if(!_this22._resizeTimeout){_this22._resizeTimeout=window.setTimeout(function(){_this22._resizeTimeout=null;var _iterator3=_createForOfIteratorHelper(_this22.resizeEventSet),_step3;try{for(_iterator3.s();!(_step3=_iterator3.n()).done;){var event=_step3.value;event()}}catch(err){_iterator3.e(err)}finally{_iterator3.f()}_this22.initToc();_this22.switchMermaidTheme();_this22.initSearch();var isMobile=_this22.util.isMobile();if(isMobile!==resizeBefore){document.getElementById("mask").click();resizeBefore=isMobile}},100)}},false)}},{key:"onClickMask",value:function onClickMask(){var _this23=this;document.getElementById("mask").addEventListener("click",function(){if(!document.body.classList.contains("blur")){return}var _iterator4=_createForOfIteratorHelper(_this23.clickMaskEventSet),_step4;try{for(_iterator4.s();!(_step4=_iterator4.n()).done;){var event=_step4.value;event()}}catch(err){_iterator4.e(err)}finally{_iterator4.f()}_this23.disableScrollEvent=false;document.body.classList.remove("blur")},false)}},{key:"beforeprint",value:function beforeprint(){var _this24=this;window.addEventListener("beforeprint",function(){_this24.util.forEach(document.querySelectorAll(".chroma"),function($el){$el.classList.toggle("open",true)});var _iterator5=_createForOfIteratorHelper(_this24.beforeprintEventSet),_step5;try{for(_iterator5.s();!(_step5=_iterator5.n()).done;){var event=_step5.value;event()}}catch(err){_iterator5.e(err)}finally{_iterator5.f()}},false)}},{key:"init",value:function init(){var _this25=this;try{var _this$config$encrypti3;if(this.config.encryption){this.initFixItDecryptor()}else if(!((_this$config$encrypti3=this.config.encryption)!==null&&_this$config$encrypti3!==void 0&&_this$config$encrypti3.all)){this.initTwemoji();this.initDetails();this.initLightGallery();this.initHighlight();this.initTable();this.initHeaderLink();this.initMath();this.initMermaid();this.initEcharts();this.initTypeit();this.initMapbox();this.initPangu()}this.initThemeColor();this.initSVGIcon();this.initMenu();this.initSwitchTheme();this.initSearch();this.initCookieconsent();this.initSiteTime();this.initServiceWorker();this.initWatermark();this.initMDevtools();this.initAutoMark();this.initReward();window.setTimeout(function(){var _this25$config$encryp;_this25.initComment();if(!((_this25$config$encryp=_this25.config.encryption)!==null&&_this25$config$encryp!==void 0&&_this25$config$encryp.all)){_this25.initToc();_this25.initTocListener()}_this25.onScroll();_this25.onResize();_this25.onClickMask();_this25.beforeprint()},100)}catch(err){console.error(err)}}}]);return FixIt}();var themeInit=function themeInit(){window.fixit=new FixIt;window.fixit.init()};if(document.readyState!=="loading"){themeInit()}else{document.addEventListener("DOMContentLoaded",themeInit,false)} +"use strict";function _objectDestructuringEmpty(obj){if(obj==null)throw new TypeError("Cannot destructure "+obj)}function _createForOfIteratorHelper(o,allowArrayLike){var it=typeof Symbol!=="undefined"&&o[Symbol.iterator]||o["@@iterator"];if(!it){if(Array.isArray(o)||(it=_unsupportedIterableToArray(o))||allowArrayLike&&o&&typeof o.length==="number"){if(it)o=it;var i=0;var F=function F(){};return{s:F,n:function n(){if(i>=o.length)return{done:true};return{done:false,value:o[i++]}},e:function e(_e){throw _e},f:F}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var normalCompletion=true,didErr=false,err;return{s:function s(){it=it.call(o)},n:function n(){var step=it.next();normalCompletion=step.done;return step},e:function e(_e2){didErr=true;err=_e2},f:function f(){try{if(!normalCompletion&&it.return!=null)it.return()}finally{if(didErr)throw err}}}}function _defineProperty(obj,key,value){if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true})}else{obj[key]=value}return obj}function _toConsumableArray(arr){return _arrayWithoutHoles(arr)||_iterableToArray(arr)||_unsupportedIterableToArray(arr)||_nonIterableSpread()}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(o,minLen){if(!o)return;if(typeof o==="string")return _arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);if(n==="Object"&&o.constructor)n=o.constructor.name;if(n==="Map"||n==="Set")return Array.from(o);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _arrayLikeToArray(o,minLen)}function _iterableToArray(iter){if(typeof Symbol!=="undefined"&&iter[Symbol.iterator]!=null||iter["@@iterator"]!=null)return Array.from(iter)}function _arrayWithoutHoles(arr){if(Array.isArray(arr))return _arrayLikeToArray(arr)}function _arrayLikeToArray(arr,len){if(len==null||len>arr.length)len=arr.length;for(var i=0,arr2=new Array(len);i.nested-item"),function($nestedItem){$nestedItem.addEventListener("click",function(){this.parentNode.querySelector(".sub-menu").classList.toggle("open");this.querySelector(".dropdown-icon").classList.toggle("open")})})}},{key:"initSwitchTheme",value:function initSwitchTheme(){var _this4=this;this.util.forEach(document.getElementsByClassName("theme-switch"),function($themeSwitch){$themeSwitch.addEventListener("click",function(){var _window$localStorage;document.body.dataset.theme=document.body.dataset.theme==="dark"?"light":"dark";_this4.isDark=!_this4.isDark;(_window$localStorage=window.localStorage)===null||_window$localStorage===void 0?void 0:_window$localStorage.setItem("theme",_this4.isDark?"dark":"light");var _iterator=_createForOfIteratorHelper(_this4.switchThemeEventSet),_step;try{for(_iterator.s();!(_step=_iterator.n()).done;){var event=_step.value;event()}}catch(err){_iterator.e(err)}finally{_iterator.f()}},false)})}},{key:"initSearch",value:function initSearch(){var _searchConfig$maxResu,_searchConfig$snippet,_searchConfig$highlig,_searchConfig$isCaseS,_searchConfig$minMatc,_searchConfig$findAll,_searchConfig$locatio,_searchConfig$thresho,_searchConfig$distanc,_searchConfig$ignoreL,_searchConfig$useExte,_searchConfig$ignoreF,_this5=this;var searchConfig=this.config.search;var isMobile=this.util.isMobile();if(!searchConfig||isMobile&&this._searchMobileOnce||!isMobile&&this._searchDesktopOnce){return}var maxResultLength=(_searchConfig$maxResu=searchConfig.maxResultLength)!==null&&_searchConfig$maxResu!==void 0?_searchConfig$maxResu:10;var snippetLength=(_searchConfig$snippet=searchConfig.snippetLength)!==null&&_searchConfig$snippet!==void 0?_searchConfig$snippet:50;var highlightTag=(_searchConfig$highlig=searchConfig.highlightTag)!==null&&_searchConfig$highlig!==void 0?_searchConfig$highlig:"em";var isCaseSensitive=(_searchConfig$isCaseS=searchConfig.isCaseSensitive)!==null&&_searchConfig$isCaseS!==void 0?_searchConfig$isCaseS:false;var minMatchCharLength=(_searchConfig$minMatc=searchConfig.minMatchCharLength)!==null&&_searchConfig$minMatc!==void 0?_searchConfig$minMatc:1;var findAllMatches=(_searchConfig$findAll=searchConfig.findAllMatches)!==null&&_searchConfig$findAll!==void 0?_searchConfig$findAll:false;var location=(_searchConfig$locatio=searchConfig.location)!==null&&_searchConfig$locatio!==void 0?_searchConfig$locatio:0;var threshold=(_searchConfig$thresho=searchConfig.threshold)!==null&&_searchConfig$thresho!==void 0?_searchConfig$thresho:0.3;var distance=(_searchConfig$distanc=searchConfig.distance)!==null&&_searchConfig$distanc!==void 0?_searchConfig$distanc:100;var ignoreLocation=(_searchConfig$ignoreL=searchConfig.ignoreLocation)!==null&&_searchConfig$ignoreL!==void 0?_searchConfig$ignoreL:false;var useExtendedSearch=(_searchConfig$useExte=searchConfig.useExtendedSearch)!==null&&_searchConfig$useExte!==void 0?_searchConfig$useExte:false;var ignoreFieldNorm=(_searchConfig$ignoreF=searchConfig.ignoreFieldNorm)!==null&&_searchConfig$ignoreF!==void 0?_searchConfig$ignoreF:false;var suffix=isMobile?"mobile":"desktop";var $header=document.getElementById("header-".concat(suffix));var $searchInput=document.getElementById("search-input-".concat(suffix));var $searchToggle=document.getElementById("search-toggle-".concat(suffix));var $searchLoading=document.getElementById("search-loading-".concat(suffix));var $searchClear=document.getElementById("search-clear-".concat(suffix));if(isMobile){this._searchMobileOnce=true;$searchInput.addEventListener("focus",function(){_this5.disableScrollEvent=true;document.body.classList.add("blur");$header.classList.add("open")},false);document.getElementById("search-cancel-mobile").addEventListener("click",function(){_this5.disableScrollEvent=false;$header.classList.remove("open");document.body.classList.remove("blur");document.getElementById("menu-toggle-mobile").classList.remove("active");document.getElementById("menu-mobile").classList.remove("active");$searchLoading.style.display="none";$searchClear.style.display="none";_this5._searchMobile&&_this5._searchMobile.autocomplete.setVal("")},false);$searchClear.addEventListener("click",function(){$searchClear.style.display="none";_this5._searchMobile&&_this5._searchMobile.autocomplete.setVal("")},false);this._searchMobileOnClickMask=this._searchMobileOnClickMask||function(){$header.classList.remove("open");$searchLoading.style.display="none";$searchClear.style.display="none";_this5._searchMobile&&_this5._searchMobile.autocomplete.setVal("")};this.clickMaskEventSet.add(this._searchMobileOnClickMask)}else{this._searchDesktopOnce=true;$searchToggle.addEventListener("click",function(){document.body.classList.add("blur");$header.classList.add("open");$searchInput.focus()},false);$searchClear.addEventListener("click",function(){$searchClear.style.display="none";_this5._searchDesktop&&_this5._searchDesktop.autocomplete.setVal("")},false);this._searchDesktopOnClickMask=this._searchDesktopOnClickMask||function(){$header.classList.remove("open");$searchLoading.style.display="none";$searchClear.style.display="none";_this5._searchDesktop&&_this5._searchDesktop.autocomplete.setVal("")};this.clickMaskEventSet.add(this._searchDesktopOnClickMask)}$searchInput.addEventListener("input",function(){if($searchInput.value==="")$searchClear.style.display="none";else $searchClear.style.display="inline"},false);var initAutosearch=function initAutosearch(){var autosearch=autocomplete("#search-input-".concat(suffix),{hint:false,autoselect:true,dropdownMenuContainer:"#search-dropdown-".concat(suffix),clearOnSelected:true,cssClasses:{noPrefix:true},debug:true},{name:"search",source:function source(query,callback){$searchLoading.style.display="inline";$searchClear.style.display="none";var finish=function finish(results){$searchLoading.style.display="none";$searchClear.style.display="inline";callback(results)};if(searchConfig.type==="lunr"){var search=function search(){if(lunr.queryHandler){query=lunr.queryHandler(query)}var results={};_this5._index.search(query).forEach(function(_ref){var ref=_ref.ref,metadata=_ref.matchData.metadata;var matchData=_this5._indexData[ref];var uri=matchData.uri,title=matchData.title,context=matchData.content;if(results[uri]){return}var position=0;Object.values(metadata).forEach(function(_ref2){var content=_ref2.content;if(content){var matchPosition=content.position[0][0];if(matchPosition0){position+=context.substr(position,20).lastIndexOf(" ")+1;context="..."+context.substr(position,snippetLength)}else{context=context.substr(0,snippetLength)}Object.keys(metadata).forEach(function(key){title=title.replace(new RegExp("(".concat(key,")"),"gi"),"<".concat(highlightTag,">$1"));context=context.replace(new RegExp("(".concat(key,")"),"gi"),"<".concat(highlightTag,">$1"))});results[uri]={uri:uri,title:title,date:matchData.date,context:context}});return Object.values(results).slice(0,maxResultLength)};if(!_this5._index){fetch(searchConfig.lunrIndexURL).then(function(response){return response.json()}).then(function(data){var indexData={};_this5._index=lunr(function(){var _this6=this;if(searchConfig.lunrLanguageCode)this.use(lunr[searchConfig.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"];data.forEach(function(record){indexData[record.objectID]=record;_this6.add(record)})});_this5._indexData=indexData;finish(search())}).catch(function(err){console.error(err);finish([])})}else finish(search())}else if(searchConfig.type==="algolia"){_this5._algoliaIndex=_this5._algoliaIndex||algoliasearch(searchConfig.algoliaAppID,searchConfig.algoliaSearchKey).initIndex(searchConfig.algoliaIndex);_this5._algoliaIndex.search(query,{offset:0,length:maxResultLength*8,attributesToHighlight:["title"],attributesToSnippet:["content:".concat(snippetLength)],highlightPreTag:"<".concat(highlightTag,">"),highlightPostTag:"")}).then(function(_ref3){var hits=_ref3.hits;var results={};hits.forEach(function(_ref4){var uri=_ref4.uri,date=_ref4.date,title=_ref4._highlightResult.title,content=_ref4._snippetResult.content;if(results[uri]&&results[uri].context.length>content.value){return}results[uri]={uri:uri,title:title.value,date:date,context:content.value}});finish(Object.values(results).slice(0,maxResultLength))}).catch(function(err){console.error(err);finish([])})}else if(searchConfig.type==="fuse"){var _search=function _search(){var results={};window._index.search(query).forEach(function(_ref5){var item=_ref5.item,refIndex=_ref5.refIndex,matches=_ref5.matches;var title=item.title;var content=item.content;matches.forEach(function(_ref6){var indices=_ref6.indices,value=_ref6.value,key=_ref6.key;if(key==="content"){var offset=0;for(var i=0;i")+substr+"");content=content.substring(0,indices[i][0]+offset)+tag+content.substring(indices[i][1]+1+offset,content.length);offset+=highlightTag.length*2+5}}else if(key==="title"){var _offset=0;for(var _i=0;_i")+_substr+"");title=title.substring(0,indices[_i][0]+_offset)+_tag+title.substring(indices[_i][1]+1+_offset,content.length);_offset+=highlightTag.length*2+5}}});results[item.uri]={uri:item.uri,title:title,date:item.date,context:content}});return Object.values(results).slice(0,maxResultLength)};if(!window._index){fetch(searchConfig.fuseIndexURL).then(function(response){return response.json()}).then(function(data){var options={isCaseSensitive:isCaseSensitive,findAllMatches:findAllMatches,minMatchCharLength:minMatchCharLength,location:location,threshold:threshold,distance:distance,ignoreLocation:ignoreLocation,useExtendedSearch:useExtendedSearch,ignoreFieldNorm:ignoreFieldNorm,includeScore:false,shouldSort:true,includeMatches:true,keys:["content","title"]};window._index=new Fuse(data,options);finish(_search())}).catch(function(err){console.error(err);finish([])})}else finish(_search())}},templates:{suggestion:function suggestion(_ref7){var title=_ref7.title,date=_ref7.date,context=_ref7.context;return"
".concat(title,"").concat(date,"
").concat(context,"
")},empty:function empty(_ref8){var query=_ref8.query;return"
".concat(searchConfig.noResultsFound,": \"").concat(query,"\"
")},footer:function footer(_ref9){_objectDestructuringEmpty(_ref9);var _ref10=searchConfig.type==="algolia"?{searchType:"algolia",icon:"",href:"https://www.algolia.com/"}:searchConfig.type==="lunr"?{searchType:"Lunr.js",icon:"",href:"https://lunrjs.com/"}:{searchType:"Fuse.js",icon:"",href:"https://fusejs.io/"},searchType=_ref10.searchType,icon=_ref10.icon,href=_ref10.href;return"")}}});autosearch.on("autocomplete:selected",function(_event,suggestion,_dataset,_context){window.location.assign(suggestion.uri)});if(isMobile){_this5._searchMobile=autosearch}else{_this5._searchDesktop=autosearch}};if(searchConfig.lunrSegmentitURL&&!document.getElementById("lunr-segmentit")){var script=document.createElement("script");script.id="lunr-segmentit";script.src=searchConfig.lunrSegmentitURL;script.async=true;if(script.readyState){script.onreadystatechange=function(){if(script.readyState=="loaded"||script.readyState=="complete"){script.onreadystatechange=null;initAutosearch()}}}else{script.onload=function(){initAutosearch()}}document.body.appendChild(script)}else{initAutosearch()}}},{key:"initDetails",value:function initDetails(){this.util.forEach(document.getElementsByClassName("details"),function($details){var $summary=$details.querySelector(".details-summary");$summary.addEventListener("click",function(){$details.classList.toggle("open")},false)})}},{key:"initLightGallery",value:function initLightGallery(){if(this.config.lightgallery){lightGallery(document.getElementById("content"),{plugins:[lgThumbnail,lgZoom],selector:".lightgallery",speed:400,hideBarsDelay:2000,allowMediaOverlap:true,exThumbImage:"data-thumbnail",toggleThumb:true,thumbWidth:80,thumbHeight:"60px",actualSize:false,showZoomInOutIcons:true,licenseKey:"none"})}}},{key:"initHighlight",value:function initHighlight(){var _this7=this;this.util.forEach(document.querySelectorAll(".highlight > pre.chroma"),function($preChroma){var $chroma=document.createElement("div");$chroma.className=$preChroma.className;var $table=document.createElement("table");$chroma.appendChild($table);var $tbody=document.createElement("tbody");$table.appendChild($tbody);var $tr=document.createElement("tr");$tbody.appendChild($tr);var $td=document.createElement("td");$tr.appendChild($td);$preChroma.parentElement.replaceChild($chroma,$preChroma);$td.appendChild($preChroma)});this.util.forEach(document.querySelectorAll(".highlight > .chroma"),function($chroma){var $codeElements=$chroma.querySelectorAll("pre.chroma > code");if($codeElements.length){var $code=$codeElements[$codeElements.length-1];var $header=document.createElement("div");$header.className="code-header "+$code.className.toLowerCase();var $title=document.createElement("span");$title.classList.add("code-title");$title.insertAdjacentHTML("afterbegin","");$title.addEventListener("click",function(){$chroma.classList.toggle("open")},false);$header.appendChild($title);var $ellipses=document.createElement("span");$ellipses.insertAdjacentHTML("afterbegin","");$ellipses.classList.add("ellipses");$ellipses.addEventListener("click",function(){$chroma.classList.add("open")},false);$header.appendChild($ellipses);if(_this7.config.code.editable){var $edit=document.createElement("span");$edit.classList.add("edit");$edit.insertAdjacentHTML("afterbegin",""));$edit.addEventListener("click",function(){var $iconKey=$edit.querySelector(".fa-key");var $iconLock=$edit.querySelector(".fa-lock");var $preChromas=$edit.parentElement.parentElement.querySelectorAll("pre.chroma");var $preChroma=$preChromas.length===2?$preChromas[1]:$preChromas[0];if($iconKey){$iconKey.classList.add("fa-lock");$iconKey.classList.remove("fa-key");$iconKey.title=_this7.config.code.editLockTitle;$preChroma.setAttribute("contenteditable",true);$preChroma.focus()}else{$iconLock.classList.add("fa-key");$iconLock.classList.remove("fa-lock");$iconLock.title=_this7.config.code.editUnLockTitle;$preChroma.setAttribute("contenteditable",false);$preChroma.blur()}},false);$header.appendChild($edit)}if(_this7.config.code.copyTitle){var $copy=document.createElement("span");$copy.insertAdjacentHTML("afterbegin","");$copy.classList.add("copy");var code=$code.innerText.trim();if(_this7.config.code.maxShownLines<0||code.split("\n").length<_this7.config.code.maxShownLines+2){$chroma.classList.add("open")}$copy.title=_this7.config.code.copyTitle;$copy.addEventListener("click",function(){navigator.clipboard.writeText(code).then(function(){_this7.util.animateCSS($code,"animate__flash")},function(){console.error("Clipboard write failed!","Your browser does not support clipboard API!")})},false);$header.appendChild($copy)}$chroma.insertBefore($header,$chroma.firstChild)}})}},{key:"initTable",value:function initTable(){this.util.forEach(document.querySelectorAll(".content table"),function($table){var $wrapper=document.createElement("div");$wrapper.className="table-wrapper";$table.parentElement.replaceChild($wrapper,$table);$wrapper.appendChild($table)})}},{key:"initHeaderLink",value:function initHeaderLink(){for(var num=1;num<=6;num++){this.util.forEach(document.querySelectorAll(".single .content > h"+num),function($header){$header.classList.add("header-link");$header.insertAdjacentHTML("afterbegin",""))})}}},{key:"initToc",value:function initToc(){var _this8=this;var $tocCore=document.getElementById("TableOfContents");if($tocCore===null){return}if(typeof APlayer==="function"){var $newTocCore=$tocCore.cloneNode(true);$tocCore.parentElement.replaceChild($newTocCore,$tocCore);$tocCore=$newTocCore}if(document.getElementById("toc-static").dataset.kept===true||this.util.isTocStatic()){var $tocContentStatic=document.getElementById("toc-content-static");if($tocCore.parentElement!==$tocContentStatic){$tocCore.parentElement.removeChild($tocCore);$tocContentStatic.appendChild($tocCore)}this._tocOnScroll&&this.scrollEventSet.delete(this._tocOnScroll)}else{var $tocContentAuto=document.getElementById("toc-content-auto");if($tocCore.parentElement!==$tocContentAuto){$tocCore.parentElement.removeChild($tocCore);$tocContentAuto.appendChild($tocCore)}var $toc=document.getElementById("toc-auto");$toc.style.visibility="visible";this.util.animateCSS($toc,["animate__fadeIn","animate__faster"],true);var $postMeta=document.querySelector(".post-meta");$toc.style.marginTop="".concat($postMeta.offsetTop+$postMeta.clientHeight,"px");var $tocLinkElements=$tocCore.querySelectorAll("a:first-child");var $tocLiElements=$tocCore.getElementsByTagName("li");var $headerLinkElements=document.getElementsByClassName("header-link");var headerIsFixed=document.body.dataset.headerDesktop!=="normal";var headerHeight=document.getElementById("header-desktop").offsetHeight;document.querySelector(".container").addEventListener("resize",function(){$toc.style.marginBottom="".concat(document.querySelector(".container").clientHeight-document.querySelector(".post-footer").offsetTop,"px")});this._tocOnScroll=this._tocOnScroll||function(){$toc.style.marginBottom="".concat(document.querySelector(".container").clientHeight-document.querySelector(".post-footer").offsetTop,"px");_this8.util.forEach($tocLinkElements,function($tocLink){$tocLink.classList.remove("active")});_this8.util.forEach($tocLiElements,function($tocLi){$tocLi.classList.remove("has-active")});var INDEX_SPACING=20+(headerIsFixed?headerHeight:0);var activeTocIndex=$headerLinkElements.length-1;for(var i=0;i<$headerLinkElements.length-1;i++){var thisTop=$headerLinkElements[i].getBoundingClientRect().top;var nextTop=$headerLinkElements[i+1].getBoundingClientRect().top;if(i==0&&thisTop>INDEX_SPACING||thisTop<=INDEX_SPACING&&nextTop>INDEX_SPACING){activeTocIndex=i;break}}if(activeTocIndex!==-1){$tocLinkElements[activeTocIndex].classList.add("active");var $parent=$tocLinkElements[activeTocIndex].parentElement;while($parent!==$tocCore){$parent.classList.add("has-active");$parent=$parent.parentElement.parentElement}}};this._tocOnScroll();this.scrollEventSet.add(this._tocOnScroll)}}},{key:"initTocListener",value:function initTocListener(){var _document$querySelect2,_this9=this;var $toc=document.getElementById("toc-auto");var $tocContentAuto=document.getElementById("toc-content-auto");(_document$querySelect2=document.querySelector("#toc-auto>.toc-title"))===null||_document$querySelect2===void 0?void 0:_document$querySelect2.addEventListener("click",function(){var animation=["animate__faster"];var tocHidden=$toc.classList.contains("toc-hidden");animation.push(tocHidden?"animate__fadeIn":"animate__fadeOut");$tocContentAuto.classList.remove(tocHidden?"animate__fadeOut":"animate__fadeIn");_this9.util.animateCSS($tocContentAuto,animation,true);$toc.classList.toggle("toc-hidden")},false)}},{key:"initMath",value:function initMath(){if(this.config.math){renderMathInElement(document.body,this.config.math)}}},{key:"switchMermaidTheme",value:function switchMermaidTheme(theme){var _this10=this;var $mermaidElements=document.getElementsByClassName("mermaid");if($mermaidElements.length){var _this$config$mermaid$;var themes=(_this$config$mermaid$=this.config.mermaid.themes)!==null&&_this$config$mermaid$!==void 0?_this$config$mermaid$:["default","dark","neutral"];mermaid.initialize({startOnLoad:false,theme:theme!==null&&theme!==void 0?theme:this.isDark?themes[1]:themes[0],securityLevel:"loose"});this.util.forEach($mermaidElements,function($mermaid){mermaid.render("svg-"+$mermaid.id,_this10.data[$mermaid.id],function(svgCode){$mermaid.innerHTML=svgCode},$mermaid)})}}},{key:"initMermaid",value:function initMermaid(){var _this11=this;this.switchMermaidTheme();this.switchThemeEventSet.add(function(){_this11.switchMermaidTheme()});this.beforeprintEventSet.add(function(){_this11.switchMermaidTheme("neutral")})}},{key:"initEcharts",value:function initEcharts(){var _this12=this;if(!this.config.echarts){return}echarts.registerTheme("light",this.config.echarts.lightTheme);echarts.registerTheme("dark",this.config.echarts.darkTheme);this._echartsOnSwitchTheme=this._echartsOnSwitchTheme||function(){_this12._echartsArr=_this12._echartsArr||[];for(var i=0;i<_this12._echartsArr.length;i++){_this12._echartsArr[i].dispose()}_this12._echartsArr=[];_this12.util.forEach(document.getElementsByClassName("echarts"),function($echarts){var chart=echarts.init($echarts,_this12.isDark?"dark":"light",{renderer:"svg"});chart.setOption(JSON.parse(_this12.data[$echarts.id]));_this12._echartsArr.push(chart)})};this.switchThemeEventSet.add(this._echartsOnSwitchTheme);this._echartsOnSwitchTheme();this._echartsOnResize=this._echartsOnResize||function(){for(var i=0;i<_this12._echartsArr.length;i++){_this12._echartsArr[i].resize()}};this.resizeEventSet.add(this._echartsOnResize)}},{key:"initMapbox",value:function initMapbox(){var _this13=this;if(this.config.mapbox){mapboxgl.accessToken=this.config.mapbox.accessToken;mapboxgl.setRTLTextPlugin(this.config.mapbox.RTLTextPlugin);this._mapboxArr=this._mapboxArr||[];this.util.forEach(document.getElementsByClassName("mapbox"),function($mapbox){var _this13$data$$mapbox$=_this13.data[$mapbox.id],lng=_this13$data$$mapbox$.lng,lat=_this13$data$$mapbox$.lat,zoom=_this13$data$$mapbox$.zoom,lightStyle=_this13$data$$mapbox$.lightStyle,darkStyle=_this13$data$$mapbox$.darkStyle,marked=_this13$data$$mapbox$.marked,navigation=_this13$data$$mapbox$.navigation,geolocate=_this13$data$$mapbox$.geolocate,scale=_this13$data$$mapbox$.scale,fullscreen=_this13$data$$mapbox$.fullscreen;var mapbox=new mapboxgl.Map({container:$mapbox,center:[lng,lat],zoom:zoom,minZoom:0.2,style:_this13.isDark?darkStyle:lightStyle,attributionControl:false});if(marked){new mapboxgl.Marker().setLngLat([lng,lat]).addTo(mapbox)}if(navigation){mapbox.addControl(new mapboxgl.NavigationControl,"bottom-right")}if(geolocate){mapbox.addControl(new mapboxgl.GeolocateControl({positionOptions:{enableHighAccuracy:true},showUserLocation:true,trackUserLocation:true}),"bottom-right")}if(scale){mapbox.addControl(new mapboxgl.ScaleControl)}if(fullscreen){mapbox.addControl(new mapboxgl.FullscreenControl)}mapbox.addControl(new MapboxLanguage);_this13._mapboxArr.push(mapbox)});this._mapboxOnSwitchTheme=this._mapboxOnSwitchTheme||function(){_this13.util.forEach(_this13._mapboxArr,function(mapbox){var $mapbox=mapbox.getContainer();var _this13$data$$mapbox$2=_this13.data[$mapbox.id],lightStyle=_this13$data$$mapbox$2.lightStyle,darkStyle=_this13$data$$mapbox$2.darkStyle;mapbox.setStyle(_this13.isDark?darkStyle:lightStyle);mapbox.addControl(new MapboxLanguage)})};this.switchThemeEventSet.add(this._mapboxOnSwitchTheme)}}},{key:"initTypeit",value:function initTypeit(){var _this14=this;if(this.config.typeit){var _typeitConfig$loop;var typeitConfig=this.config.typeit;var speed=typeitConfig.speed||100;var cursorSpeed=typeitConfig.cursorSpeed||1000;var cursorChar=typeitConfig.cursorChar||"|";var loop=(_typeitConfig$loop=typeitConfig.loop)!==null&&_typeitConfig$loop!==void 0?_typeitConfig$loop:false;Object.values(typeitConfig.data).forEach(function(group){var typeone=function typeone(i){var id=group[i];var shortcodeLoop=document.querySelector("#".concat(id)).parentElement.dataset.loop;var instance=new TypeIt("#".concat(id),{strings:_this14.data[id],speed:speed,lifeLike:true,cursorSpeed:cursorSpeed,cursorChar:cursorChar,waitUntilVisible:true,loop:shortcodeLoop?JSON.parse(shortcodeLoop):loop,afterComplete:function afterComplete(){if(i===group.length-1){if(typeitConfig.duration>=0){window.setTimeout(function(){instance.destroy()},typeitConfig.duration)}return}instance.destroy();typeone(i+1)}}).go()};typeone(0)})}}},{key:"initCommentLightGallery",value:function initCommentLightGallery(comments,images){document.querySelectorAll(comments).forEach(function($content){var $imgs=$content.querySelectorAll(images+":not([lightgallery-loaded])");$imgs.forEach(function($img){$img.setAttribute("lightgallery-loaded","");var $link=document.createElement("a");$link.setAttribute("class","comment-lightgallery");$link.setAttribute("href",$img.src);$link.append($img.cloneNode());$img.replaceWith($link)});if($imgs.length){lightGallery($content,{selector:".comment-lightgallery",actualSize:false,hideBarsDelay:2000,speed:400})}})}},{key:"initComment",value:function initComment(){var _this$config$comment,_this15=this;if(!((_this$config$comment=this.config.comment)!==null&&_this$config$comment!==void 0&&_this$config$comment.enable)){return}if(document.querySelector("#comments")){var $viewCommentsBtn=document.querySelector(".view-comments");$viewCommentsBtn.classList.remove("d-none");$viewCommentsBtn.addEventListener("click",function(){_this15.util.scrollIntoView("#comments")},false)}this.config.comment.expired&&document.querySelector("#comments").remove();if(this.config.comment.artalk){if(this.config.comment.expired){return Artalk.LoadCountWidget({server:this.config.comment.artalk.server,site:this.config.comment.artalk.site,pvEl:this.config.comment.artalk.pvEl,countEl:this.config.comment.artalk.countEl})}var artalk=Artalk.init(this.config.comment.artalk);artalk.setDarkMode(this.isDark);this.switchThemeEventSet.add(function(){artalk.setDarkMode(_this15.isDark)});artalk.on("comments-loaded",function(){_this15.config.comment.artalk.lightgallery&&_this15.initCommentLightGallery(".atk-comment .atk-content","img:not([atk-emoticon])")});return artalk}if(this.config.comment.gitalk){this.config.comment.gitalk.body=decodeURI(window.location.href);var gitalk=new Gitalk(this.config.comment.gitalk);gitalk.render("gitalk");return gitalk}if(this.config.comment.valine){return new Valine(this.config.comment.valine)}if(this.config.comment.waline){if(this.config.comment.expired){this.config.comment.waline.pageview&&Waline.pageviewCount({serverURL:this.config.comment.waline.serverURL,path:window.location.pathname});return}return Waline.init(this.config.comment.waline)}if(this.config.comment.utterances){var utterancesConfig=this.config.comment.utterances;var script=document.createElement("script");script.src="https://utteranc.es/client.js";script.setAttribute("repo",utterancesConfig.repo);script.setAttribute("issue-term",utterancesConfig.issueTerm);if(utterancesConfig.label)script.setAttribute("label",utterancesConfig.label);script.setAttribute("theme",this.isDark?utterancesConfig.darkTheme:utterancesConfig.lightTheme);script.crossOrigin="anonymous";script.async=true;document.getElementById("utterances").appendChild(script);this._utterancesOnSwitchTheme=this._utterancesOnSwitchTheme||function(){var _document$querySelect3;var message={type:"set-theme",theme:_this15.isDark?utterancesConfig.darkTheme:utterancesConfig.lightTheme};(_document$querySelect3=document.querySelector(".utterances-frame"))===null||_document$querySelect3===void 0?void 0:_document$querySelect3.contentWindow.postMessage(message,"https://utteranc.es")};this.switchThemeEventSet.add(this._utterancesOnSwitchTheme);return}if(this.config.comment.twikoo){var twikooConfig=this.config.comment.twikoo;if(twikooConfig.lightgallery){twikooConfig.onCommentLoaded=function(){_this15.initCommentLightGallery(".tk-comments .tk-content","img:not(.tk-owo-emotion)")}}twikoo.init(twikooConfig);if(twikooConfig.commentCount){twikoo.getCommentsCount({envId:twikooConfig.envId,region:twikooConfig.region,urls:[window.location.pathname],includeReply:false}).then(function(response){var twikooCommentCount=document.getElementById("twikoo-comment-count");if(twikooCommentCount)twikooCommentCount.innerHTML=response[0].count})}return}if(this.config.comment.giscus){var giscusConfig=this.config.comment.giscus;this._giscusOnSwitchTheme=this._giscusOnSwitchTheme||function(){var _document$querySelect4;var message={setConfig:{theme:_this15.isDark?giscusConfig.darkTheme:giscusConfig.lightTheme}};(_document$querySelect4=document.querySelector(".giscus-frame"))===null||_document$querySelect4===void 0?void 0:_document$querySelect4.contentWindow.postMessage({giscus:message},"https://giscus.app")};this.switchThemeEventSet.add(this._giscusOnSwitchTheme);this.giscus2parentMsg=window.addEventListener("message",function(event){var $script=document.querySelector("#giscus>script");if($script){_this15._giscusOnSwitchTheme();$script.parentElement.removeChild($script)}},{once:true});return}}},{key:"initCookieconsent",value:function initCookieconsent(){this.config.cookieconsent&&cookieconsent.initialise(this.config.cookieconsent)}},{key:"initSiteTime",value:function initSiteTime(){var _this16=this;if(this.config.siteTime){this.siteTime=setInterval(this.getSiteTime,500);document.addEventListener("visibilitychange",function(){if(document.hidden){return clearInterval(_this16.siteTime)}_this16.siteTime=setInterval(_this16.getSiteTime,500)},false)}}},{key:"initServiceWorker",value:function initServiceWorker(){if(this.config.enablePWA&&"serviceWorker"in navigator){navigator.serviceWorker.register("/service-worker.min.js",{scope:"/"}).then(function(registration){}).catch(function(error){console.error("error: ",error)});navigator.serviceWorker.ready.then(function(registration){})}}},{key:"initWatermark",value:function initWatermark(){var _this$config$watermar,_document$querySelect5,_document$querySelect6;((_this$config$watermar=this.config.watermark)===null||_this$config$watermar===void 0?void 0:_this$config$watermar.enable)&&new Watermark({content:this.config.watermark.content||"".concat((_document$querySelect5=(_document$querySelect6=document.querySelector("footer .fixit-icon"))===null||_document$querySelect6===void 0?void 0:_document$querySelect6.outerHTML)!==null&&_document$querySelect5!==void 0?_document$querySelect5:""," FixIt Theme"),appendTo:this.config.watermark.appendto||".wrapper>main",opacity:this.config.watermark.opacity,width:this.config.watermark.width,height:this.config.watermark.height,rowSpacing:this.config.watermark.rowspacing,colSpacing:this.config.watermark.colspacing,rotate:this.config.watermark.rotate,fontSize:this.config.watermark.fontsize,fontFamily:this.config.watermark.fontfamily})}},{key:"initPangu",value:function initPangu(){var _this$config$pangu;if(!((_this$config$pangu=this.config.pangu)!==null&&_this$config$pangu!==void 0&&_this$config$pangu.enable)){return}var selector=this.config.pangu.selector;if(selector){if(selector.startsWith("#")){pangu.spacingElementById(selector.slice(1))}else if(selector.startsWith(".")){pangu.spacingElementByClassName(selector.slice(1))}else{pangu.spacingElementByTagName(selector)}return}pangu.autoSpacingPage()}},{key:"initFixItDecryptor",value:function initFixItDecryptor(){var _this17=this,_this$config$encrypti,_this$config$encrypti2;var $tocNodes=document.querySelectorAll("#toc-auto>.d-none, #toc-static.d-none");this.decryptor=new FixItDecryptor({decrypted:function decrypted(){_this17.initTwemoji();_this17.initDetails();_this17.initLightGallery();_this17.initHighlight();_this17.initTable();_this17.initHeaderLink();_this17.initMath();_this17.initMermaid();_this17.initEcharts();_this17.initTypeit();_this17.initMapbox();_this17.util.forEach($tocNodes,function($element){$element.classList.remove("d-none")});_this17.initToc();_this17.initTocListener();_this17.initPangu()},reset:function reset(){_this17.util.forEach($tocNodes,function($element){$element.classList.add("d-none")})}});if((_this$config$encrypti=this.config.encryption)!==null&&_this$config$encrypti!==void 0&&_this$config$encrypti.shortcode){this.decryptor.addEventListener("decrypted",function(){_this17.decryptor.initShortcodes()});this.decryptor.initShortcodes()}((_this$config$encrypti2=this.config.encryption)===null||_this$config$encrypti2===void 0?void 0:_this$config$encrypti2.all)&&this.decryptor.init()}},{key:"initMDevtools",value:function initMDevtools(){var _this$config,_this18=this;var type=(_this$config=this.config)===null||_this$config===void 0?void 0:_this$config.mDevtools;if(typeof window.orientation==="undefined"){return}if(type==="vConsole"){var vConsole=new VConsole({target:".widgets",theme:this.isDark?"dark":"light"});this._vConsoleOnSwitchTheme=this._vConsoleOnSwitchTheme||function(){vConsole.setOption("theme",_this18.isDark?"dark":"light")};this.switchThemeEventSet.add(this._vConsoleOnSwitchTheme)}if(type==="eruda"){eruda.init({defaults:{theme:this.isDark?"Dark":"Light"}});this._erudaOnSwitchTheme=this._erudaOnSwitchTheme||function(){eruda.util.evalCss.setTheme(_this18.isDark?"Dark":"Light")};this.switchThemeEventSet.add(this._erudaOnSwitchTheme)}}},{key:"initAutoMark",value:function initAutoMark(){var _this19=this,_window$localStorage3;if(!this.config.autoBookmark){return}window.addEventListener("beforeunload",function(){var _window$localStorage2;(_window$localStorage2=window.localStorage)===null||_window$localStorage2===void 0?void 0:_window$localStorage2.setItem("fixit-bookmark/#".concat(location.pathname),_this19.util.getScrollTop())});var scrollTop=Number((_window$localStorage3=window.localStorage)===null||_window$localStorage3===void 0?void 0:_window$localStorage3.getItem("fixit-bookmark/#".concat(location.pathname)));if(scrollTop&&location.hash===""){window.scrollTo({top:scrollTop,behavior:"smooth"})}}},{key:"initReward",value:function initReward(){var _this20=this;var $rewards=document.querySelectorAll(".post-reward [data-mode=\"fixed\"]");if(!$rewards.length){return}if(this.util.isMobile()){this.util.forEach($rewards,function($reward){$reward.removeAttribute("data-mode")});return}var _closeRewardExclude=function _closeRewardExclude(id){_this20.util.forEach($rewards,function($reward){var $rewardInput=$reward.parentElement.querySelector(".reward-input");if($rewardInput.id!==id){$rewardInput.checked=false}})};this.util.forEach($rewards,function($reward){$reward.previousElementSibling.addEventListener("click",function(){_closeRewardExclude(this.getAttribute("for"))},false)});this.scrollEventSet.add(_closeRewardExclude)}},{key:"onScroll",value:function onScroll(){var _this21=this;var $headers=[];var ACCURACY=20;var $fixedButtons=document.querySelector(".fixed-buttons");var $backToTop=document.querySelector(".back-to-top");var $readingProgressBar=document.querySelector(".reading-progress-bar");var scrollTimer=void 0;if(document.body.dataset.headerDesktop==="auto"){$headers.push(document.getElementById("header-desktop"))}if(document.body.dataset.headerMobile==="auto"){$headers.push(document.getElementById("header-mobile"))}$backToTop===null||$backToTop===void 0?void 0:$backToTop.addEventListener("click",function(){_this21.util.scrollIntoView("body")});window.addEventListener("scroll",function(event){if(_this21.disableScrollEvent){event.preventDefault();return}var $mask=document.getElementById("mask");_this21.newScrollTop=_this21.util.getScrollTop();var scroll=_this21.newScrollTop-_this21.oldScrollTop;document.body.toggleAttribute("data-scroll",true);scrollTimer&&window.clearTimeout(scrollTimer);scrollTimer=window.setTimeout(function(){document.body.toggleAttribute("data-scroll")},500);_this21.util.forEach($headers,function($header){if(scroll>ACCURACY){$header.classList.remove("animate__fadeInDown");_this21.util.animateCSS($header,["animate__fadeOutUp"],true);$mask.click()}else if(scroll<-ACCURACY){$header.classList.remove("animate__fadeOutUp");_this21.util.animateCSS($header,["animate__fadeInDown"],true);$mask.click()}});var contentHeight=document.body.scrollHeight-window.innerHeight;var scrollPercent=Math.max(Math.min(100*Math.max(_this21.newScrollTop,0)/contentHeight,100),0);if($readingProgressBar){$readingProgressBar.style.setProperty("--progress","".concat(scrollPercent.toFixed(2),"%"))}if($fixedButtons){if(scrollPercent>1){$fixedButtons.classList.remove("d-none","animate__fadeOut");_this21.util.animateCSS($fixedButtons,["animate__fadeIn"],true)}else{$fixedButtons.classList.remove("animate__fadeIn");_this21.util.animateCSS($fixedButtons,["animate__fadeOut"],true,function(){$fixedButtons.classList.contains("animate__fadeOut")&&$fixedButtons.classList.add("d-none")})}if($backToTop){$backToTop.querySelector("span").innerText="".concat(Math.round(scrollPercent),"%")}}var _iterator2=_createForOfIteratorHelper(_this21.scrollEventSet),_step2;try{for(_iterator2.s();!(_step2=_iterator2.n()).done;){var _event2=_step2.value;_event2()}}catch(err){_iterator2.e(err)}finally{_iterator2.f()}_this21.oldScrollTop=_this21.newScrollTop},false)}},{key:"onResize",value:function onResize(){var _this22=this;var resizeBefore=this.util.isMobile();window.addEventListener("resize",function(){if(!_this22._resizeTimeout){_this22._resizeTimeout=window.setTimeout(function(){_this22._resizeTimeout=null;var _iterator3=_createForOfIteratorHelper(_this22.resizeEventSet),_step3;try{for(_iterator3.s();!(_step3=_iterator3.n()).done;){var event=_step3.value;event()}}catch(err){_iterator3.e(err)}finally{_iterator3.f()}_this22.initToc();_this22.switchMermaidTheme();_this22.initSearch();var isMobile=_this22.util.isMobile();if(isMobile!==resizeBefore){document.getElementById("mask").click();resizeBefore=isMobile}},100)}},false)}},{key:"onClickMask",value:function onClickMask(){var _this23=this;document.getElementById("mask").addEventListener("click",function(){if(!document.body.classList.contains("blur")){return}var _iterator4=_createForOfIteratorHelper(_this23.clickMaskEventSet),_step4;try{for(_iterator4.s();!(_step4=_iterator4.n()).done;){var event=_step4.value;event()}}catch(err){_iterator4.e(err)}finally{_iterator4.f()}_this23.disableScrollEvent=false;document.body.classList.remove("blur")},false)}},{key:"beforeprint",value:function beforeprint(){var _this24=this;window.addEventListener("beforeprint",function(){_this24.util.forEach(document.querySelectorAll(".chroma"),function($el){$el.classList.toggle("open",true)});var _iterator5=_createForOfIteratorHelper(_this24.beforeprintEventSet),_step5;try{for(_iterator5.s();!(_step5=_iterator5.n()).done;){var event=_step5.value;event()}}catch(err){_iterator5.e(err)}finally{_iterator5.f()}},false)}},{key:"init",value:function init(){var _this25=this;try{var _this$config$encrypti3;if(this.config.encryption){this.initFixItDecryptor()}else if(!((_this$config$encrypti3=this.config.encryption)!==null&&_this$config$encrypti3!==void 0&&_this$config$encrypti3.all)){this.initTwemoji();this.initDetails();this.initLightGallery();this.initHighlight();this.initTable();this.initHeaderLink();this.initMath();this.initMermaid();this.initEcharts();this.initTypeit();this.initMapbox();this.initPangu()}this.initThemeColor();this.initSVGIcon();this.initMenu();this.initSwitchTheme();this.initSearch();this.initCookieconsent();this.initSiteTime();this.initServiceWorker();this.initWatermark();this.initMDevtools();this.initAutoMark();this.initReward();window.setTimeout(function(){var _this25$config$encryp;_this25.initComment();if(!((_this25$config$encryp=_this25.config.encryption)!==null&&_this25$config$encryp!==void 0&&_this25$config$encryp.all)){_this25.initToc();_this25.initTocListener()}_this25.onScroll();_this25.onResize();_this25.onClickMask();_this25.beforeprint()},100)}catch(err){console.error(err)}}}]);return FixIt}();var themeInit=function themeInit(){window.fixit=new FixIt;window.fixit.init()};if(document.readyState!=="loading"){themeInit()}else{document.addEventListener("DOMContentLoaded",themeInit,false)} //# sourceMappingURL=theme.min.js.map \ No newline at end of file diff --git a/assets/js/theme.min.js.map b/assets/js/theme.min.js.map index a7ce1521..669261a3 100644 --- a/assets/js/theme.min.js.map +++ b/assets/js/theme.min.js.map @@ -1 +1 @@ -{"version":3,"file":"theme.min.js","names":["Util","elements","handler","i","length","document","documentElement","body","scrollTop","window","matchMedia","matches","element","animation","reserved","callback","Array","isArray","classList","add","addEventListener","remove","once","date","Date","isNaN","getTime","selector","startsWith","getElementById","slice","querySelector","scrollIntoView","behavior","FixIt","now","run","config","siteTime","$runTimes","util","isValidDate","clearInterval","parentNode","runTime","days","Math","floor","hours","minutes","seconds","innerHTML","String","padStart","data","isDark","dataset","theme","newScrollTop","getScrollTop","oldScrollTop","scrollEventSet","Set","resizeEventSet","switchThemeEventSet","clickMaskEventSet","beforeprintEventSet","disableScrollEvent","objectFitImages","$meta","_themeColorOnSwitchTheme","content","dark","light","forEach","querySelectorAll","$icon","fetch","svgSrc","then","response","text","svg","$temp","createElement","insertAdjacentHTML","$svg","firstChild","$titleElements","getElementsByTagName","removeChild","parentElement","replaceChild","catch","err","console","error","twemoji","parse","initMenuDesktop","initMenuMobile","$item","style","minWidth","offsetWidth","$menuToggleMobile","$menuMobile","event","toggle","contains","_menuMobileOnClickMask","$nestedItem","getElementsByClassName","$themeSwitch","localStorage","setItem","searchConfig","search","isMobile","_searchMobileOnce","_searchDesktopOnce","maxResultLength","snippetLength","highlightTag","isCaseSensitive","minMatchCharLength","findAllMatches","location","threshold","distance","ignoreLocation","useExtendedSearch","ignoreFieldNorm","suffix","$header","$searchInput","$searchToggle","$searchLoading","$searchClear","display","_searchMobile","autocomplete","setVal","_searchMobileOnClickMask","focus","_searchDesktop","_searchDesktopOnClickMask","value","initAutosearch","autosearch","hint","autoselect","dropdownMenuContainer","clearOnSelected","cssClasses","noPrefix","debug","name","source","query","finish","results","type","lunr","queryHandler","_index","ref","metadata","matchData","_indexData","uri","title","context","position","Object","values","matchPosition","substr","lastIndexOf","keys","key","replace","RegExp","lunrIndexURL","json","indexData","lunrLanguageCode","use","field","boost","metadataWhitelist","record","objectID","_algoliaIndex","algoliasearch","algoliaAppID","algoliaSearchKey","initIndex","algoliaIndex","offset","attributesToHighlight","attributesToSnippet","highlightPreTag","highlightPostTag","hits","_highlightResult","_snippetResult","item","refIndex","indices","substring","tag","fuseIndexURL","options","includeScore","shouldSort","includeMatches","Fuse","templates","suggestion","empty","noResultsFound","footer","searchType","icon","href","on","_event","_dataset","_context","assign","lunrSegmentitURL","script","id","src","async","readyState","onreadystatechange","onload","appendChild","$details","$summary","lightgallery","lightGallery","plugins","lgThumbnail","lgZoom","speed","hideBarsDelay","allowMediaOverlap","exThumbImage","toggleThumb","thumbWidth","thumbHeight","actualSize","showZoomInOutIcons","licenseKey","$preChroma","$chroma","className","$table","$tbody","$tr","$td","$codeElements","$code","toLowerCase","$title","$ellipses","code","editable","$edit","editUnLockTitle","$iconKey","$iconLock","$preChromas","editLockTitle","setAttribute","blur","copyTitle","$copy","innerText","trim","maxShownLines","split","navigator","clipboard","writeText","animateCSS","insertBefore","$wrapper","num","$tocCore","APlayer","$newTocCore","cloneNode","kept","isTocStatic","$tocContentStatic","_tocOnScroll","delete","$tocContentAuto","$toc","visibility","$postMeta","marginTop","offsetTop","clientHeight","$tocLinkElements","$tocLiElements","$headerLinkElements","headerIsFixed","headerDesktop","headerHeight","offsetHeight","marginBottom","$tocLink","$tocLi","INDEX_SPACING","activeTocIndex","thisTop","getBoundingClientRect","top","nextTop","$parent","tocHidden","push","math","renderMathInElement","$mermaidElements","themes","mermaid","initialize","startOnLoad","securityLevel","$mermaid","render","svgCode","switchMermaidTheme","echarts","registerTheme","lightTheme","darkTheme","_echartsOnSwitchTheme","_echartsArr","dispose","$echarts","chart","init","renderer","setOption","JSON","_echartsOnResize","resize","mapbox","mapboxgl","accessToken","setRTLTextPlugin","RTLTextPlugin","_mapboxArr","$mapbox","lng","lat","zoom","lightStyle","darkStyle","marked","navigation","geolocate","scale","fullscreen","Map","container","center","minZoom","attributionControl","Marker","setLngLat","addTo","addControl","NavigationControl","GeolocateControl","positionOptions","enableHighAccuracy","showUserLocation","trackUserLocation","ScaleControl","FullscreenControl","MapboxLanguage","_mapboxOnSwitchTheme","getContainer","setStyle","typeit","typeitConfig","cursorSpeed","cursorChar","loop","group","typeone","shortcodeLoop","instance","TypeIt","strings","lifeLike","waitUntilVisible","afterComplete","duration","setTimeout","destroy","go","comments","images","$content","$imgs","$img","$link","append","replaceWith","comment","enable","$viewCommentsBtn","expired","artalk","Artalk","LoadCountWidget","server","site","pvEl","countEl","setDarkMode","initCommentLightGallery","gitalk","decodeURI","Gitalk","valine","Valine","waline","pageview","Waline","pageviewCount","serverURL","path","pathname","utterances","utterancesConfig","repo","issueTerm","label","crossOrigin","_utterancesOnSwitchTheme","message","contentWindow","postMessage","twikoo","twikooConfig","onCommentLoaded","commentCount","getCommentsCount","envId","region","urls","includeReply","twikooCommentCount","count","giscus","giscusConfig","_giscusOnSwitchTheme","setConfig","giscus2parentMsg","$script","cookieconsent","initialise","setInterval","getSiteTime","hidden","enablePWA","serviceWorker","register","scope","registration","ready","watermark","Watermark","outerHTML","appendTo","appendto","opacity","width","height","rowSpacing","rowspacing","colSpacing","colspacing","rotate","fontSize","fontsize","fontFamily","fontfamily","pangu","spacingElementById","spacingElementByClassName","spacingElementByTagName","autoSpacingPage","$tocNodes","decryptor","FixItDecryptor","decrypted","initTwemoji","initDetails","initLightGallery","initHighlight","initTable","initHeaderLink","initMath","initMermaid","initEcharts","initTypeit","initMapbox","$element","initToc","initTocListener","initPangu","reset","encryption","shortcode","initShortcodes","all","mDevtools","orientation","vConsole","VConsole","target","_vConsoleOnSwitchTheme","eruda","defaults","_erudaOnSwitchTheme","evalCss","setTheme","autoBookmark","Number","getItem","hash","scrollTo","$rewards","$reward","removeAttribute","_closeRewardExclude","$rewardInput","checked","previousElementSibling","getAttribute","$headers","ACCURACY","$fixedButtons","$backToTop","$readingProgressBar","scrollTimer","headerMobile","preventDefault","$mask","scroll","toggleAttribute","clearTimeout","click","contentHeight","scrollHeight","innerHeight","scrollPercent","max","min","setProperty","toFixed","round","resizeBefore","_resizeTimeout","initSearch","$el","initFixItDecryptor","initThemeColor","initSVGIcon","initMenu","initSwitchTheme","initCookieconsent","initSiteTime","initServiceWorker","initWatermark","initMDevtools","initAutoMark","initReward","initComment","onScroll","onResize","onClickMask","beforeprint","themeInit","fixit"],"sources":["../../src/js/theme.js"],"sourcesContent":["class Util {\n forEach(elements, handler) {\n elements = elements || [];\n for (let i = 0; i < elements.length; i++) {\n handler(elements[i]);\n }\n }\n\n getScrollTop() {\n return (document.documentElement ?? document.body).scrollTop;\n }\n\n isMobile() {\n return window.matchMedia('only screen and (max-width: 680px)').matches;\n }\n\n isTocStatic() {\n return window.matchMedia('only screen and (max-width: 960px)').matches;\n }\n\n /**\n * add animate to element\n * @param {Element} element animate element\n * @param {String|Array} animation animation name\n * @param {Boolean} reserved reserved animation\n * @param {Function} callback remove callback\n */\n animateCSS(element, animation, reserved, callback) {\n !Array.isArray(animation) && (animation = [animation]);\n element.classList.add('animate__animated', ...animation);\n element.addEventListener('animationend', () => {\n !reserved && element.classList.remove('animate__animated', ...animation);\n typeof callback === 'function' && callback();\n }, { once: true });\n }\n\n /**\n * date validator\n * @param {*} date may be date or not\n * @returns {Boolean}\n */\n isValidDate(date) {\n return date instanceof Date && !isNaN(date.getTime());\n }\n \n /**\n * scroll some element into view\n * @param {String} selector element to scroll\n */\n scrollIntoView(selector) {\n const element = selector.startsWith('#')\n ? document.getElementById(selector.slice(1))\n : document.querySelector(selector);\n element?.scrollIntoView({\n behavior: 'smooth'\n });\n }\n}\n\nclass FixIt {\n constructor() {\n this.config = window.config;\n this.data = this.config.data;\n this.isDark = document.body.dataset.theme === 'dark';\n this.util = new Util();\n this.newScrollTop = this.util.getScrollTop();\n this.oldScrollTop = this.newScrollTop;\n this.scrollEventSet = new Set();\n this.resizeEventSet = new Set();\n this.switchThemeEventSet = new Set();\n this.clickMaskEventSet = new Set();\n this.beforeprintEventSet = new Set();\n this.disableScrollEvent = false;\n window.objectFitImages && objectFitImages();\n }\n\n initThemeColor() {\n const $meta = document.querySelector('[name=\"theme-color\"]');\n if (!$meta) {\n return;\n }\n this._themeColorOnSwitchTheme = this._themeColorOnSwitchTheme || (() => {\n $meta.content = this.isDark ? $meta.dataset.dark : $meta.dataset.light;\n });\n this.switchThemeEventSet.add(this._themeColorOnSwitchTheme);\n this._themeColorOnSwitchTheme();\n }\n\n initSVGIcon() {\n this.util.forEach(document.querySelectorAll('[data-svg-src]'), ($icon) => {\n fetch($icon.dataset.svgSrc)\n .then((response) => response.text())\n .then((svg) => {\n const $temp = document.createElement('div');\n $temp.insertAdjacentHTML('afterbegin', svg);\n const $svg = $temp.firstChild;\n $svg.dataset.svgSrc = $icon.dataset.svgSrc\n $svg.classList.add('icon');\n const $titleElements = $svg.getElementsByTagName('title');\n $titleElements.length && $svg.removeChild($titleElements[0]);\n $icon.parentElement.replaceChild($svg, $icon);\n })\n .catch((err) => {\n console.error(err);\n });\n });\n }\n\n initTwemoji() {\n this.config.twemoji && twemoji.parse(document.body);\n }\n\n initMenu() {\n this.initMenuDesktop();\n this.initMenuMobile();\n }\n\n initMenuDesktop() {\n this.util.forEach(document.querySelectorAll('.has-children'), ($item) => {\n $item.querySelector('.sub-menu').style.minWidth = `${$item.offsetWidth - 8}px`;\n });\n }\n\n initMenuMobile() {\n const $menuToggleMobile = document.getElementById('menu-toggle-mobile');\n const $menuMobile = document.getElementById('menu-mobile');\n $menuToggleMobile.addEventListener('click', (event) => {\n document.body.classList.toggle('blur');\n $menuToggleMobile.classList.toggle('active');\n $menuMobile.classList.toggle('active');\n this.disableScrollEvent = document.body.classList.contains('blur');\n }, false);\n this._menuMobileOnClickMask = this._menuMobileOnClickMask || (() => {\n $menuToggleMobile.classList.remove('active');\n $menuMobile.classList.remove('active');\n });\n this.clickMaskEventSet.add(this._menuMobileOnClickMask);\n // add nested menu toggler\n this.util.forEach(document.querySelectorAll('.menu-item>.nested-item'), ($nestedItem) => {\n $nestedItem.addEventListener('click', function () {\n this.parentNode.querySelector('.sub-menu').classList.toggle('open');\n this.querySelector('.dropdown-icon').classList.toggle('open');\n });\n });\n }\n\n initSwitchTheme() {\n this.util.forEach(document.getElementsByClassName('theme-switch'), ($themeSwitch) => {\n $themeSwitch.addEventListener('click', () => {\n document.body.dataset.theme = document.body.dataset.theme === 'dark' ? 'light' : 'dark';\n this.isDark = !this.isDark;\n window.localStorage?.setItem('theme', this.isDark ? 'dark' : 'light');\n for (let event of this.switchThemeEventSet) {\n event();\n }\n }, false);\n });\n }\n\n initSearch() {\n const searchConfig = this.config.search;\n const isMobile = this.util.isMobile();\n if (!searchConfig || (isMobile && this._searchMobileOnce) || (!isMobile && this._searchDesktopOnce)) {\n return;\n }\n // Initialize default search config\n const maxResultLength = searchConfig.maxResultLength ?? 10;\n const snippetLength = searchConfig.snippetLength ?? 50;\n const highlightTag = searchConfig.highlightTag ?? 'em';\n const isCaseSensitive = searchConfig.isCaseSensitive ?? false;\n const minMatchCharLength = searchConfig.minMatchCharLength ?? 1;\n const findAllMatches = searchConfig.findAllMatches ?? false;\n const location = searchConfig.location ?? 0;\n const threshold = searchConfig.threshold ?? 0.3;\n const distance = searchConfig.distance ?? 100;\n const ignoreLocation = searchConfig.ignoreLocation ?? false;\n const useExtendedSearch = searchConfig.useExtendedSearch ?? false;\n const ignoreFieldNorm = searchConfig.ignoreFieldNorm ?? false;\n const suffix = isMobile ? 'mobile' : 'desktop';\n const $header = document.getElementById(`header-${suffix}`);\n const $searchInput = document.getElementById(`search-input-${suffix}`);\n const $searchToggle = document.getElementById(`search-toggle-${suffix}`);\n const $searchLoading = document.getElementById(`search-loading-${suffix}`);\n const $searchClear = document.getElementById(`search-clear-${suffix}`);\n\n if (isMobile) {\n this._searchMobileOnce = true;\n $searchInput.addEventListener('focus', () => {\n this.disableScrollEvent = true;\n document.body.classList.add('blur');\n $header.classList.add('open');\n }, false);\n document.getElementById('search-cancel-mobile').addEventListener('click', () => {\n this.disableScrollEvent = false;\n $header.classList.remove('open');\n document.body.classList.remove('blur');\n document.getElementById('menu-toggle-mobile').classList.remove('active');\n document.getElementById('menu-mobile').classList.remove('active');\n $searchLoading.style.display = 'none';\n $searchClear.style.display = 'none';\n this._searchMobile && this._searchMobile.autocomplete.setVal('');\n }, false);\n $searchClear.addEventListener('click', () => {\n $searchClear.style.display = 'none';\n this._searchMobile && this._searchMobile.autocomplete.setVal('');\n }, false);\n this._searchMobileOnClickMask = this._searchMobileOnClickMask || (() => {\n $header.classList.remove('open');\n $searchLoading.style.display = 'none';\n $searchClear.style.display = 'none';\n this._searchMobile && this._searchMobile.autocomplete.setVal('');\n });\n this.clickMaskEventSet.add(this._searchMobileOnClickMask);\n } else {\n this._searchDesktopOnce = true;\n $searchToggle.addEventListener('click', () => {\n document.body.classList.add('blur');\n $header.classList.add('open');\n $searchInput.focus();\n }, false);\n $searchClear.addEventListener('click', () => {\n $searchClear.style.display = 'none';\n this._searchDesktop && this._searchDesktop.autocomplete.setVal('');\n }, false);\n this._searchDesktopOnClickMask = this._searchDesktopOnClickMask ||(() => {\n $header.classList.remove('open');\n $searchLoading.style.display = 'none';\n $searchClear.style.display = 'none';\n this._searchDesktop && this._searchDesktop.autocomplete.setVal('');\n });\n this.clickMaskEventSet.add(this._searchDesktopOnClickMask);\n }\n $searchInput.addEventListener('input', () => {\n if ($searchInput.value === '') $searchClear.style.display = 'none';\n else $searchClear.style.display = 'inline';\n }, false);\n\n const initAutosearch = () => {\n const autosearch = autocomplete(`#search-input-${suffix}`,\n {\n hint: false,\n autoselect: true,\n dropdownMenuContainer: `#search-dropdown-${suffix}`,\n clearOnSelected: true,\n cssClasses: { noPrefix: true },\n debug: true\n },\n {\n name: 'search',\n source: (query, callback) => {\n $searchLoading.style.display = 'inline';\n $searchClear.style.display = 'none';\n const finish = (results) => {\n $searchLoading.style.display = 'none';\n $searchClear.style.display = 'inline';\n callback(results);\n };\n if (searchConfig.type === 'lunr') {\n const search = () => {\n if (lunr.queryHandler) {\n query = lunr.queryHandler(query);\n }\n const results = {};\n this._index.search(query).forEach(({ ref, matchData: { metadata } }) => {\n const matchData = this._indexData[ref];\n let { uri, title, content: context } = matchData;\n if (results[uri]) {\n return;\n }\n let position = 0;\n Object.values(metadata).forEach(({ content }) => {\n if (content) {\n const matchPosition = content.position[0][0];\n if (matchPosition < position || position === 0) {\n position = matchPosition;\n }\n }\n });\n position -= snippetLength / 5;\n if (position > 0) {\n position += context.substr(position, 20).lastIndexOf(' ') + 1;\n context = '...' + context.substr(position, snippetLength);\n } else {\n context = context.substr(0, snippetLength);\n }\n Object.keys(metadata).forEach((key) => {\n title = title.replace(new RegExp(`(${key})`, 'gi'), `<${highlightTag}>$1`);\n context = context.replace(new RegExp(`(${key})`, 'gi'), `<${highlightTag}>$1`);\n });\n results[uri] = {\n uri: uri,\n title: title,\n date: matchData.date,\n context: context\n };\n });\n return Object.values(results).slice(0, maxResultLength);\n };\n if (!this._index) {\n fetch(searchConfig.lunrIndexURL)\n .then((response) => response.json())\n .then((data) => {\n const indexData = {};\n this._index = lunr(function () {\n if (searchConfig.lunrLanguageCode) this.use(lunr[searchConfig.lunrLanguageCode]);\n this.ref('objectID');\n this.field('title', { boost: 50 });\n this.field('tags', { boost: 20 });\n this.field('categories', { boost: 20 });\n this.field('content', { boost: 10 });\n this.metadataWhitelist = ['position'];\n data.forEach((record) => {\n indexData[record.objectID] = record;\n this.add(record);\n });\n });\n this._indexData = indexData;\n finish(search());\n })\n .catch((err) => {\n console.error(err);\n finish([]);\n });\n } else finish(search());\n } else if (searchConfig.type === 'algolia') {\n this._algoliaIndex =\n this._algoliaIndex || algoliasearch(searchConfig.algoliaAppID, searchConfig.algoliaSearchKey).initIndex(searchConfig.algoliaIndex);\n this._algoliaIndex\n .search(query, {\n offset: 0,\n length: maxResultLength * 8,\n attributesToHighlight: ['title'],\n attributesToSnippet: [`content:${snippetLength}`],\n highlightPreTag: `<${highlightTag}>`,\n highlightPostTag: ``\n })\n .then(({ hits }) => {\n const results = {};\n hits.forEach(({ uri, date, _highlightResult: { title }, _snippetResult: { content } }) => {\n if (results[uri] && results[uri].context.length > content.value) {\n return;\n }\n results[uri] = {\n uri: uri,\n title: title.value,\n date: date,\n context: content.value\n };\n });\n finish(Object.values(results).slice(0, maxResultLength));\n })\n .catch((err) => {\n console.error(err);\n finish([]);\n });\n } else if (searchConfig.type === 'fuse') {\n const search = () => {\n const results = {};\n window._index.search(query).forEach(({ item, refIndex, matches }) => {\n let title = item.title;\n let content = item.content;\n matches.forEach(({ indices, value, key }) => {\n if (key === 'content') {\n let offset = 0;\n for (let i = 0; i < indices.length; i++) {\n const substr = content.substring(indices[i][0] + offset, indices[i][1] + 1 + offset);\n const tag = `<${highlightTag}>` + substr + ``;\n content = content.substring(0, indices[i][0] + offset) + tag + content.substring(indices[i][1] + 1 + offset, content.length);\n offset += highlightTag.length * 2 + 5;\n }\n } else if (key === 'title') {\n let offset = 0;\n for (let i = 0; i < indices.length; i++) {\n const substr = title.substring(indices[i][0] + offset, indices[i][1] + 1 + offset);\n const tag = `<${highlightTag}>` + substr + ``;\n title = title.substring(0, indices[i][0] + offset) + tag + title.substring(indices[i][1] + 1 + offset, content.length);\n offset += highlightTag.length * 2 + 5;\n }\n }\n });\n results[item.uri] = {\n uri: item.uri,\n title: title,\n date: item.date,\n context: content\n };\n });\n return Object.values(results).slice(0, maxResultLength);\n };\n if (!window._index) {\n fetch(searchConfig.fuseIndexURL)\n .then((response) => response.json())\n .then((data) => {\n const options = {\n isCaseSensitive: isCaseSensitive,\n findAllMatches: findAllMatches,\n minMatchCharLength: minMatchCharLength,\n location: location,\n threshold: threshold,\n distance: distance,\n ignoreLocation: ignoreLocation,\n useExtendedSearch: useExtendedSearch,\n ignoreFieldNorm: ignoreFieldNorm,\n includeScore: false,\n shouldSort: true,\n includeMatches: true,\n keys: ['content', 'title']\n };\n window._index = new Fuse(data, options);\n finish(search());\n })\n .catch((err) => {\n console.error(err);\n finish([]);\n });\n } else finish(search());\n } \n },\n templates: {\n suggestion: ({ title, date, context }) =>\n `
${title}${date}
${context}
`,\n empty: ({ query }) => `
${searchConfig.noResultsFound}: \"${query}\"
`,\n footer: ({}) => {\n const { searchType, icon, href } =\n searchConfig.type === 'algolia'\n ? {\n searchType: 'algolia',\n icon: '',\n href: 'https://www.algolia.com/'\n }\n : (searchConfig.type === 'lunr'\n ? {\n searchType: 'Lunr.js',\n icon: '',\n href: 'https://lunrjs.com/'\n }\n : {\n searchType: 'Fuse.js',\n icon: '',\n href: 'https://fusejs.io/'\n })\n return ``;\n }\n }\n }\n );\n autosearch.on('autocomplete:selected', (_event, suggestion, _dataset, _context) => {\n window.location.assign(suggestion.uri);\n });\n if (isMobile) {\n this._searchMobile = autosearch;\n } else {\n this._searchDesktop = autosearch;\n }\n };\n if (searchConfig.lunrSegmentitURL && !document.getElementById('lunr-segmentit')) {\n const script = document.createElement('script');\n script.id = 'lunr-segmentit';\n script.src = searchConfig.lunrSegmentitURL;\n script.async = true;\n if (script.readyState) {\n script.onreadystatechange = () => {\n if (script.readyState == 'loaded' || script.readyState == 'complete') {\n script.onreadystatechange = null;\n initAutosearch();\n }\n };\n } else {\n script.onload = () => {\n initAutosearch();\n };\n }\n document.body.appendChild(script);\n } else {\n initAutosearch();\n }\n }\n\n initDetails() {\n this.util.forEach(document.getElementsByClassName('details'), ($details) => {\n const $summary = $details.querySelector('.details-summary');\n $summary.addEventListener('click', () => {\n $details.classList.toggle('open');\n }, false);\n });\n }\n\n initLightGallery() {\n if (this.config.lightgallery) {\n lightGallery(document.getElementById('content'), {\n plugins: [lgThumbnail, lgZoom],\n selector: '.lightgallery',\n speed: 400,\n hideBarsDelay: 2000,\n allowMediaOverlap: true,\n exThumbImage: 'data-thumbnail',\n toggleThumb: true,\n thumbWidth: 80,\n thumbHeight: '60px',\n actualSize: false,\n showZoomInOutIcons: true,\n licenseKey: 'none'\n });\n }\n }\n\n initHighlight() {\n this.util.forEach(document.querySelectorAll('.highlight > pre.chroma'), ($preChroma) => {\n const $chroma = document.createElement('div');\n $chroma.className = $preChroma.className;\n const $table = document.createElement('table');\n $chroma.appendChild($table);\n const $tbody = document.createElement('tbody');\n $table.appendChild($tbody);\n const $tr = document.createElement('tr');\n $tbody.appendChild($tr);\n const $td = document.createElement('td');\n $tr.appendChild($td);\n $preChroma.parentElement.replaceChild($chroma, $preChroma);\n $td.appendChild($preChroma);\n });\n this.util.forEach(document.querySelectorAll('.highlight > .chroma'), ($chroma) => {\n const $codeElements = $chroma.querySelectorAll('pre.chroma > code');\n if ($codeElements.length) {\n const $code = $codeElements[$codeElements.length - 1];\n const $header = document.createElement('div');\n $header.className = 'code-header ' + $code.className.toLowerCase();\n // code title\n const $title = document.createElement('span');\n $title.classList.add('code-title');\n $title.insertAdjacentHTML('afterbegin', '');\n $title.addEventListener('click', () => {\n $chroma.classList.toggle('open');\n }, false);\n $header.appendChild($title);\n // ellipses icon\n const $ellipses = document.createElement('span');\n $ellipses.insertAdjacentHTML('afterbegin', '');\n $ellipses.classList.add('ellipses');\n $ellipses.addEventListener('click', () => {\n $chroma.classList.add('open');\n }, false);\n $header.appendChild($ellipses);\n // edit button\n if (this.config.code.editable) {\n const $edit = document.createElement('span');\n $edit.classList.add('edit');\n $edit.insertAdjacentHTML('afterbegin', ``);\n $edit.addEventListener('click', () => {\n const $iconKey = $edit.querySelector('.fa-key');\n const $iconLock = $edit.querySelector('.fa-lock');\n const $preChromas = $edit.parentElement.parentElement.querySelectorAll('pre.chroma');\n const $preChroma = $preChromas.length === 2 ? $preChromas[1] : $preChromas[0];\n if ($iconKey) {\n $iconKey.classList.add('fa-lock');\n $iconKey.classList.remove('fa-key');\n $iconKey.title = this.config.code.editLockTitle;\n $preChroma.setAttribute('contenteditable', true);\n $preChroma.focus();\n } else {\n $iconLock.classList.add('fa-key');\n $iconLock.classList.remove('fa-lock');\n $iconLock.title = this.config.code.editUnLockTitle;\n $preChroma.setAttribute('contenteditable', false);\n $preChroma.blur();\n }\n }, false);\n $header.appendChild($edit);\n }\n // copy button\n if (this.config.code.copyTitle) {\n const $copy = document.createElement('span');\n $copy.insertAdjacentHTML('afterbegin', '');\n $copy.classList.add('copy');\n // remove the leading and trailing whitespace of the code string\n const code = $code.innerText.trim();\n if (this.config.code.maxShownLines < 0 || code.split('\\n').length < this.config.code.maxShownLines + 2) {\n $chroma.classList.add('open');\n }\n $copy.title = this.config.code.copyTitle;\n $copy.addEventListener('click', () => {\n navigator.clipboard.writeText(code).then(() => {\n this.util.animateCSS($code, 'animate__flash');\n }, () => {\n console.error('Clipboard write failed!', 'Your browser does not support clipboard API!');\n });\n }, false);\n $header.appendChild($copy);\n }\n $chroma.insertBefore($header, $chroma.firstChild);\n }\n });\n }\n\n initTable() {\n this.util.forEach(document.querySelectorAll('.content table'), ($table) => {\n const $wrapper = document.createElement('div');\n $wrapper.className = 'table-wrapper';\n $table.parentElement.replaceChild($wrapper, $table);\n $wrapper.appendChild($table);\n });\n }\n\n initHeaderLink() {\n for (let num = 1; num <= 6; num++) {\n this.util.forEach(document.querySelectorAll('.single .content > h' + num), ($header) => {\n $header.classList.add('header-link');\n $header.insertAdjacentHTML('afterbegin', ``);\n });\n }\n }\n /**\n * init table of contents\n */\n initToc() {\n let $tocCore = document.getElementById('TableOfContents');\n if ($tocCore === null) {\n return;\n }\n // It's a dirty hack to fix the bug of APlayer, see https://github.com/hugo-fixit/FixIt/issues/292\n if (typeof APlayer === 'function') {\n const $newTocCore = $tocCore.cloneNode(true);\n $tocCore.parentElement.replaceChild($newTocCore, $tocCore);\n $tocCore = $newTocCore;\n }\n if (document.getElementById('toc-static').dataset.kept === true || this.util.isTocStatic()) {\n const $tocContentStatic = document.getElementById('toc-content-static');\n if ($tocCore.parentElement !== $tocContentStatic) {\n $tocCore.parentElement.removeChild($tocCore);\n $tocContentStatic.appendChild($tocCore);\n }\n this._tocOnScroll && this.scrollEventSet.delete(this._tocOnScroll);\n } else {\n const $tocContentAuto = document.getElementById('toc-content-auto');\n if ($tocCore.parentElement !== $tocContentAuto) {\n $tocCore.parentElement.removeChild($tocCore);\n $tocContentAuto.appendChild($tocCore);\n }\n const $toc = document.getElementById('toc-auto');\n $toc.style.visibility = 'visible';\n this.util.animateCSS($toc, ['animate__fadeIn', 'animate__faster'], true);\n const $postMeta = document.querySelector('.post-meta');\n $toc.style.marginTop = `${$postMeta.offsetTop + $postMeta.clientHeight}px`;\n const $tocLinkElements = $tocCore.querySelectorAll('a:first-child');\n const $tocLiElements = $tocCore.getElementsByTagName('li');\n const $headerLinkElements = document.getElementsByClassName('header-link');\n const headerIsFixed = document.body.dataset.headerDesktop !== 'normal';\n const headerHeight = document.getElementById('header-desktop').offsetHeight;\n document.querySelector('.container').addEventListener('resize', () => {\n $toc.style.marginBottom = `${document.querySelector('.container').clientHeight - document.querySelector('.post-footer').offsetTop}px`;\n });\n this._tocOnScroll = this._tocOnScroll || (() => {\n $toc.style.marginBottom = `${document.querySelector('.container').clientHeight - document.querySelector('.post-footer').offsetTop}px`;\n this.util.forEach($tocLinkElements, ($tocLink) => {\n $tocLink.classList.remove('active');\n });\n this.util.forEach($tocLiElements, ($tocLi) => {\n $tocLi.classList.remove('has-active');\n });\n const INDEX_SPACING = 20 + (headerIsFixed ? headerHeight : 0);\n let activeTocIndex = $headerLinkElements.length - 1;\n for (let i = 0; i < $headerLinkElements.length - 1; i++) {\n const thisTop = $headerLinkElements[i].getBoundingClientRect().top;\n const nextTop = $headerLinkElements[i + 1].getBoundingClientRect().top;\n if ((i == 0 && thisTop > INDEX_SPACING) || (thisTop <= INDEX_SPACING && nextTop > INDEX_SPACING)) {\n activeTocIndex = i;\n break;\n }\n }\n if (activeTocIndex !== -1) {\n $tocLinkElements[activeTocIndex].classList.add('active');\n let $parent = $tocLinkElements[activeTocIndex].parentElement;\n while ($parent !== $tocCore) {\n $parent.classList.add('has-active');\n $parent = $parent.parentElement.parentElement;\n }\n }\n });\n this._tocOnScroll();\n this.scrollEventSet.add(this._tocOnScroll);\n }\n }\n\n initTocListener() {\n const $toc = document.getElementById('toc-auto');\n const $tocContentAuto = document.getElementById('toc-content-auto');\n document.querySelector('#toc-auto>.toc-title')?.addEventListener('click', () => {\n const animation = ['animate__faster'];\n const tocHidden = $toc.classList.contains('toc-hidden');\n animation.push(tocHidden ? 'animate__fadeIn' : 'animate__fadeOut');\n $tocContentAuto.classList.remove(tocHidden ? 'animate__fadeOut' : 'animate__fadeIn');\n this.util.animateCSS($tocContentAuto, animation, true);\n $toc.classList.toggle('toc-hidden');\n }, false);\n }\n\n initMath() {\n if (this.config.math) {\n renderMathInElement(document.body, this.config.math);\n }\n }\n\n switchMermaidTheme(theme) {\n const $mermaidElements = document.getElementsByClassName('mermaid');\n if ($mermaidElements.length) {\n // TODO perf\n const themes = this.config.mermaid.themes ?? ['default', 'dark', 'neutral'];\n mermaid.initialize({ startOnLoad: false, theme: theme ?? (this.isDark ? themes[1] : themes[0]), securityLevel: 'loose' });\n this.util.forEach($mermaidElements, $mermaid => {\n mermaid.render('svg-' + $mermaid.id, this.data[$mermaid.id], svgCode => {\n $mermaid.innerHTML = svgCode;\n }, $mermaid);\n });\n }\n };\n\n initMermaid() {\n this.switchMermaidTheme();\n this.switchThemeEventSet.add(() => { this.switchMermaidTheme(); });\n this.beforeprintEventSet.add(() => { this.switchMermaidTheme('neutral'); });\n }\n\n initEcharts() {\n if (!this.config.echarts) {\n return;\n }\n echarts.registerTheme('light', this.config.echarts.lightTheme);\n echarts.registerTheme('dark', this.config.echarts.darkTheme);\n this._echartsOnSwitchTheme = this._echartsOnSwitchTheme || (() => {\n this._echartsArr = this._echartsArr || [];\n for (let i = 0; i < this._echartsArr.length; i++) {\n this._echartsArr[i].dispose();\n }\n this._echartsArr = [];\n this.util.forEach(document.getElementsByClassName('echarts'), ($echarts) => {\n const chart = echarts.init($echarts, this.isDark ? 'dark' : 'light', { renderer: 'svg' });\n chart.setOption(JSON.parse(this.data[$echarts.id]));\n this._echartsArr.push(chart);\n });\n });\n this.switchThemeEventSet.add(this._echartsOnSwitchTheme);\n this._echartsOnSwitchTheme();\n this._echartsOnResize = this._echartsOnResize || (() => {\n for (let i = 0; i < this._echartsArr.length; i++) {\n this._echartsArr[i].resize();\n }\n });\n this.resizeEventSet.add(this._echartsOnResize);\n }\n\n initMapbox() {\n if (this.config.mapbox) {\n mapboxgl.accessToken = this.config.mapbox.accessToken;\n mapboxgl.setRTLTextPlugin(this.config.mapbox.RTLTextPlugin);\n this._mapboxArr = this._mapboxArr || [];\n this.util.forEach(document.getElementsByClassName('mapbox'), ($mapbox) => {\n const { lng, lat, zoom, lightStyle, darkStyle, marked, navigation, geolocate, scale, fullscreen } = this.data[$mapbox.id];\n const mapbox = new mapboxgl.Map({\n container: $mapbox,\n center: [lng, lat],\n zoom: zoom,\n minZoom: 0.2,\n style: this.isDark ? darkStyle : lightStyle,\n attributionControl: false\n });\n if (marked) {\n new mapboxgl.Marker().setLngLat([lng, lat]).addTo(mapbox);\n }\n if (navigation) {\n mapbox.addControl(new mapboxgl.NavigationControl(), 'bottom-right');\n }\n if (geolocate) {\n mapbox.addControl(\n new mapboxgl.GeolocateControl({\n positionOptions: {\n enableHighAccuracy: true\n },\n showUserLocation: true,\n trackUserLocation: true\n }),\n 'bottom-right'\n );\n }\n if (scale) {\n mapbox.addControl(new mapboxgl.ScaleControl());\n }\n if (fullscreen) {\n mapbox.addControl(new mapboxgl.FullscreenControl());\n }\n mapbox.addControl(new MapboxLanguage());\n this._mapboxArr.push(mapbox);\n });\n this._mapboxOnSwitchTheme = this._mapboxOnSwitchTheme || (() => {\n this.util.forEach(this._mapboxArr, (mapbox) => {\n const $mapbox = mapbox.getContainer();\n const { lightStyle, darkStyle } = this.data[$mapbox.id];\n mapbox.setStyle(this.isDark ? darkStyle : lightStyle);\n mapbox.addControl(new MapboxLanguage());\n });\n });\n this.switchThemeEventSet.add(this._mapboxOnSwitchTheme);\n }\n }\n\n initTypeit() {\n if (this.config.typeit) {\n const typeitConfig = this.config.typeit;\n const speed = typeitConfig.speed || 100;\n const cursorSpeed = typeitConfig.cursorSpeed || 1000;\n const cursorChar = typeitConfig.cursorChar || '|';\n const loop = typeitConfig.loop ?? false;\n Object.values(typeitConfig.data).forEach((group) => {\n const typeone = (i) => {\n const id = group[i];\n const shortcodeLoop = document.querySelector(`#${id}`).parentElement.dataset.loop;\n const instance = new TypeIt(`#${id}`, {\n strings: this.data[id],\n speed: speed,\n lifeLike: true,\n cursorSpeed: cursorSpeed,\n cursorChar: cursorChar,\n waitUntilVisible: true,\n loop: shortcodeLoop ? JSON.parse(shortcodeLoop) : loop,\n afterComplete: () => {\n if (i === group.length - 1) {\n if (typeitConfig.duration >= 0) {\n window.setTimeout(() => {\n instance.destroy();\n }, typeitConfig.duration);\n }\n return;\n }\n instance.destroy();\n typeone(i + 1);\n }\n }).go();\n };\n typeone(0);\n });\n }\n }\n\n initCommentLightGallery(comments, images) {\n document.querySelectorAll(comments).forEach(($content) => {\n const $imgs = $content.querySelectorAll(images + ':not([lightgallery-loaded])');\n $imgs.forEach(($img) => {\n $img.setAttribute('lightgallery-loaded', '');\n const $link = document.createElement('a');\n $link.setAttribute('class', 'comment-lightgallery');\n $link.setAttribute('href', $img.src);\n $link.append($img.cloneNode());\n $img.replaceWith($link);\n });\n if ($imgs.length) {\n lightGallery($content, {\n selector: '.comment-lightgallery',\n actualSize: false,\n hideBarsDelay: 2000,\n speed: 400\n });\n }\n });\n }\n\n initComment() {\n if (!this.config.comment?.enable) {\n return;\n }\n // whether to show the view comments button\n if (document.querySelector('#comments')) {\n const $viewCommentsBtn = document.querySelector('.view-comments');\n $viewCommentsBtn.classList.remove('d-none');\n // view comments button click event\n $viewCommentsBtn.addEventListener('click', () => {\n this.util.scrollIntoView('#comments');\n }, false);\n }\n this.config.comment.expired && document.querySelector('#comments').remove();\n if (this.config.comment.artalk) {\n if (this.config.comment.expired) {\n return Artalk.LoadCountWidget({\n server: this.config.comment.artalk.server,\n site: this.config.comment.artalk.site,\n pvEl: this.config.comment.artalk.pvEl,\n countEl: this.config.comment.artalk.countEl\n })\n }\n const artalk = new Artalk(this.config.comment.artalk);\n artalk.setDarkMode(this.isDark);\n this.switchThemeEventSet.add(() => {\n artalk.setDarkMode(this.isDark);\n });\n artalk.on('comments-loaded', () => {\n this.config.comment.artalk.lightgallery && this.initCommentLightGallery('.atk-comment .atk-content', 'img:not([atk-emoticon])');\n });\n return artalk;\n }\n if (this.config.comment.gitalk) {\n this.config.comment.gitalk.body = decodeURI(window.location.href);\n const gitalk = new Gitalk(this.config.comment.gitalk);\n gitalk.render('gitalk');\n return gitalk;\n }\n if (this.config.comment.valine) {\n return new Valine(this.config.comment.valine);\n }\n if (this.config.comment.waline) {\n if (this.config.comment.expired) {\n this.config.comment.waline.pageview && Waline.pageviewCount({\n serverURL: this.config.comment.waline.serverURL,\n path: window.location.pathname\n });\n return;\n }\n return Waline.init(this.config.comment.waline);\n }\n if (this.config.comment.utterances) {\n const utterancesConfig = this.config.comment.utterances;\n const script = document.createElement('script');\n script.src = 'https://utteranc.es/client.js';\n script.setAttribute('repo', utterancesConfig.repo);\n script.setAttribute('issue-term', utterancesConfig.issueTerm);\n if (utterancesConfig.label) script.setAttribute('label', utterancesConfig.label);\n script.setAttribute('theme', this.isDark ? utterancesConfig.darkTheme : utterancesConfig.lightTheme);\n script.crossOrigin = 'anonymous';\n script.async = true;\n document.getElementById('utterances').appendChild(script);\n this._utterancesOnSwitchTheme = this._utterancesOnSwitchTheme || (() => {\n const message = {\n type: 'set-theme',\n theme: this.isDark ? utterancesConfig.darkTheme : utterancesConfig.lightTheme\n };\n document.querySelector('.utterances-frame')?.contentWindow.postMessage(message, 'https://utteranc.es');\n });\n this.switchThemeEventSet.add(this._utterancesOnSwitchTheme);\n return;\n }\n if (this.config.comment.twikoo) {\n const twikooConfig = this.config.comment.twikoo;\n if (twikooConfig.lightgallery) {\n twikooConfig.onCommentLoaded = () => {\n this.initCommentLightGallery('.tk-comments .tk-content', 'img:not(.tk-owo-emotion)');\n };\n }\n twikoo.init(twikooConfig);\n if (twikooConfig.commentCount) {\n // https://twikoo.js.org/api.html#get-comments-count\n twikoo\n .getCommentsCount({\n envId: twikooConfig.envId,\n region: twikooConfig.region,\n urls: [window.location.pathname],\n includeReply: false\n })\n .then(function (response) {\n const twikooCommentCount = document.getElementById('twikoo-comment-count');\n if (twikooCommentCount) twikooCommentCount.innerHTML = response[0].count;\n });\n }\n return;\n }\n if (this.config.comment.giscus) {\n const giscusConfig = this.config.comment.giscus;\n this._giscusOnSwitchTheme = this._giscusOnSwitchTheme || (() => {\n const message = { setConfig: { theme: this.isDark ? giscusConfig.darkTheme : giscusConfig.lightTheme }};\n document.querySelector('.giscus-frame')?.contentWindow.postMessage({ giscus: message }, 'https://giscus.app');\n });\n this.switchThemeEventSet.add(this._giscusOnSwitchTheme);\n this.giscus2parentMsg = window.addEventListener('message', (event) => {\n const $script = document.querySelector('#giscus>script');\n if ($script){\n this._giscusOnSwitchTheme();\n $script.parentElement.removeChild($script);\n }\n }, { once: true });\n return;\n }\n }\n\n initCookieconsent() {\n this.config.cookieconsent && cookieconsent.initialise(this.config.cookieconsent);\n }\n\n getSiteTime = () => {\n let now = new Date();\n let run = new Date(this.config.siteTime);\n let $runTimes = document.querySelector('.run-times');\n if (!this.util.isValidDate(run) || !$runTimes) {\n clearInterval(this.siteTime);\n $runTimes && $runTimes.parentNode.remove();\n return;\n }\n let runTime = (now - run) / 1000,\n days = Math.floor(runTime / 60 / 60 / 24),\n hours = Math.floor(runTime / 60 / 60 - 24 * days),\n minutes = Math.floor(runTime / 60 - 24 * 60 * days - 60 * hours),\n seconds = Math.floor((now - run) / 1000 - 24 * 60 * 60 * days - 60 * 60 * hours - 60 * minutes);\n $runTimes.innerHTML = `${days}, ${String(hours).padStart(2, 0)}:${String(minutes).padStart(2, 0)}:${String(seconds).padStart(2, 0)}`;\n document.querySelector('.site-time .d-none')?.classList.remove('d-none');\n };\n\n initSiteTime() {\n if (this.config.siteTime) {\n this.siteTime = setInterval(this.getSiteTime, 500);\n document.addEventListener('visibilitychange', () => {\n if (document.hidden) {\n return clearInterval(this.siteTime);\n }\n this.siteTime = setInterval(this.getSiteTime, 500);\n }, false);\n }\n }\n\n initServiceWorker() {\n if (this.config.enablePWA && 'serviceWorker' in navigator) {\n navigator.serviceWorker\n .register('/service-worker.min.js', { scope: '/' })\n .then(function (registration) {\n // console.log('Service Worker Registered');\n })\n .catch(function (error) {\n console.error('error: ', error);\n });\n navigator.serviceWorker\n .ready\n .then(function (registration) {\n // console.log('Service Worker Ready');\n });\n }\n }\n\n initWatermark() {\n this.config.watermark?.enable &&\n new Watermark({\n content: this.config.watermark.content || `${document.querySelector('footer .fixit-icon')?.outerHTML ?? ''} FixIt Theme`,\n appendTo: this.config.watermark.appendto || '.wrapper>main',\n opacity: this.config.watermark.opacity,\n width: this.config.watermark.width,\n height: this.config.watermark.height,\n rowSpacing: this.config.watermark.rowspacing,\n colSpacing: this.config.watermark.colspacing,\n rotate: this.config.watermark.rotate,\n fontSize: this.config.watermark.fontsize,\n fontFamily: this.config.watermark.fontfamily\n });\n }\n\n initPangu() {\n if (!this.config.pangu?.enable) {\n return;\n }\n const selector = this.config.pangu.selector;\n if (selector) {\n if (selector.startsWith('#')) {\n pangu.spacingElementById(selector.slice(1));\n } else if (selector.startsWith('.')) {\n pangu.spacingElementByClassName(selector.slice(1));\n } else {\n pangu.spacingElementByTagName(selector)\n }\n return;\n }\n pangu.autoSpacingPage();\n }\n\n initFixItDecryptor() {\n const $tocNodes = document.querySelectorAll('#toc-auto>.d-none, #toc-static.d-none');\n this.decryptor = new FixItDecryptor({\n decrypted: () => {\n this.initTwemoji();\n this.initDetails();\n this.initLightGallery();\n this.initHighlight();\n this.initTable();\n this.initHeaderLink();\n this.initMath();\n this.initMermaid();\n this.initEcharts();\n this.initTypeit();\n this.initMapbox();\n this.util.forEach($tocNodes, ($element) => {\n $element.classList.remove('d-none');\n });\n this.initToc();\n this.initTocListener();\n this.initPangu();\n },\n reset: () => {\n this.util.forEach($tocNodes, ($element) => {\n $element.classList.add('d-none');\n });\n }\n });\n if (this.config.encryption?.shortcode) {\n this.decryptor.addEventListener('decrypted', () => {\n this.decryptor.initShortcodes();\n })\n this.decryptor.initShortcodes();\n }\n this.config.encryption?.all && this.decryptor.init();\n }\n\n initMDevtools() {\n const type = this.config?.mDevtools;\n if (typeof window.orientation === 'undefined') {\n return;\n }\n if (type === 'vConsole') {\n const vConsole = new VConsole({\n target: '.widgets',\n theme: this.isDark ? 'dark' : 'light'\n });\n this._vConsoleOnSwitchTheme = this._vConsoleOnSwitchTheme || (() => {\n vConsole.setOption('theme', this.isDark ? 'dark' : 'light');\n });\n this.switchThemeEventSet.add(this._vConsoleOnSwitchTheme);\n }\n if(type === 'eruda') {\n eruda.init({\n defaults: { theme: this.isDark ? 'Dark' : 'Light' }\n });\n this._erudaOnSwitchTheme = this._erudaOnSwitchTheme || (() => {\n eruda.util.evalCss.setTheme(this.isDark ? 'Dark' : 'Light');\n });\n this.switchThemeEventSet.add(this._erudaOnSwitchTheme);\n }\n }\n\n initAutoMark() {\n if (!this.config.autoBookmark) {\n return;\n }\n window.addEventListener('beforeunload', () => {\n window.localStorage?.setItem(`fixit-bookmark/#${location.pathname}`, this.util.getScrollTop());\n });\n const scrollTop = Number(window.localStorage?.getItem(`fixit-bookmark/#${location.pathname}`));\n // If the page opens with a specific hash, just jump out\n if (scrollTop && location.hash === '') {\n window.scrollTo({ \n top: scrollTop,\n behavior: 'smooth'\n });\n }\n }\n\n initReward() {\n const $rewards = document.querySelectorAll('.post-reward [data-mode=\"fixed\"]');\n if (!$rewards.length) {\n return;\n }\n // `fixed` mode only supports desktop\n if (this.util.isMobile()) {\n this.util.forEach($rewards, ($reward) => {\n $reward.removeAttribute('data-mode');\n });\n return;\n }\n // Close post reward images exclude special id\n const _closeRewardExclude = (id) => {\n this.util.forEach($rewards, ($reward) => {\n const $rewardInput = $reward.parentElement.querySelector('.reward-input');\n if ($rewardInput.id !== id) {\n $rewardInput.checked = false;\n }\n });\n };\n // Add additional click event to reward buttons\n this.util.forEach($rewards, ($reward) => {\n $reward.previousElementSibling.addEventListener('click', function () {\n _closeRewardExclude(this.getAttribute('for'));\n }, false)\n });\n this.scrollEventSet.add(_closeRewardExclude);\n }\n\n onScroll() {\n const $headers = [];\n const ACCURACY = 20;\n const $fixedButtons = document.querySelector('.fixed-buttons');\n const $backToTop = document.querySelector('.back-to-top');\n const $readingProgressBar = document.querySelector('.reading-progress-bar');\n let scrollTimer = void 0;\n if (document.body.dataset.headerDesktop === 'auto') {\n $headers.push(document.getElementById('header-desktop'));\n }\n if (document.body.dataset.headerMobile === 'auto') {\n $headers.push(document.getElementById('header-mobile'));\n }\n // b2t button click event\n $backToTop?.addEventListener('click', () => {\n this.util.scrollIntoView('body');\n });\n window.addEventListener('scroll', (event) => {\n if (this.disableScrollEvent) {\n event.preventDefault();\n return;\n }\n const $mask = document.getElementById('mask');\n this.newScrollTop = this.util.getScrollTop();\n const scroll = this.newScrollTop - this.oldScrollTop;\n // body scrollbar style\n document.body.toggleAttribute('data-scroll', true);\n scrollTimer && window.clearTimeout(scrollTimer);\n scrollTimer = window.setTimeout(() => {\n document.body.toggleAttribute('data-scroll');\n }, 500);\n // header animation\n this.util.forEach($headers, ($header) => {\n if (scroll > ACCURACY) {\n $header.classList.remove('animate__fadeInDown');\n this.util.animateCSS($header, ['animate__fadeOutUp'], true);\n $mask.click();\n } else if (scroll < -ACCURACY) {\n $header.classList.remove('animate__fadeOutUp');\n this.util.animateCSS($header, ['animate__fadeInDown'], true);\n $mask.click();\n }\n });\n const contentHeight = document.body.scrollHeight - window.innerHeight;\n const scrollPercent = Math.max(Math.min(100 * Math.max(this.newScrollTop, 0) / contentHeight, 100), 0);\n if ($readingProgressBar) {\n $readingProgressBar.style.setProperty('--progress', `${scrollPercent.toFixed(2)}%`);\n }\n // whether to show fixed buttons\n if ($fixedButtons) {\n if (scrollPercent > 1) {\n $fixedButtons.classList.remove('d-none', 'animate__fadeOut');\n this.util.animateCSS($fixedButtons, ['animate__fadeIn'], true);\n } else {\n $fixedButtons.classList.remove('animate__fadeIn');\n this.util.animateCSS($fixedButtons, ['animate__fadeOut'], true, () => {\n $fixedButtons.classList.contains('animate__fadeOut') && $fixedButtons.classList.add('d-none');\n });\n }\n if ($backToTop) {\n $backToTop.querySelector('span').innerText = `${Math.round(scrollPercent)}%`;\n }\n }\n for (let event of this.scrollEventSet) {\n event();\n }\n this.oldScrollTop = this.newScrollTop;\n }, false);\n }\n\n onResize() {\n let resizeBefore = this.util.isMobile();\n window.addEventListener('resize', () => {\n if (!this._resizeTimeout) {\n this._resizeTimeout = window.setTimeout(() => {\n this._resizeTimeout = null;\n for (let event of this.resizeEventSet) {\n event();\n }\n this.initToc();\n this.switchMermaidTheme();\n this.initSearch();\n\n const isMobile = this.util.isMobile()\n if (isMobile !== resizeBefore) {\n document.getElementById('mask').click();\n resizeBefore = isMobile;\n }\n }, 100);\n }\n }, false);\n }\n\n onClickMask() {\n document.getElementById('mask').addEventListener('click', () => {\n if (!document.body.classList.contains('blur')) {\n return;\n }\n for (let event of this.clickMaskEventSet) {\n event();\n }\n this.disableScrollEvent = false;\n document.body.classList.remove('blur');\n }, false);\n }\n\n beforeprint() {\n window.addEventListener('beforeprint', () => {\n this.util.forEach(document.querySelectorAll('.chroma'), ($el) => {\n $el.classList.toggle('open', true)\n });\n for (let event of this.beforeprintEventSet) {\n event();\n }\n }, false);\n }\n\n init() {\n try {\n if (this.config.encryption) {\n this.initFixItDecryptor();\n } else if (!this.config.encryption?.all) {\n this.initTwemoji();\n this.initDetails();\n this.initLightGallery();\n this.initHighlight();\n this.initTable();\n this.initHeaderLink();\n this.initMath();\n this.initMermaid();\n this.initEcharts();\n this.initTypeit();\n this.initMapbox();\n this.initPangu();\n }\n this.initThemeColor();\n this.initSVGIcon();\n this.initMenu();\n this.initSwitchTheme();\n this.initSearch();\n this.initCookieconsent();\n this.initSiteTime();\n this.initServiceWorker();\n this.initWatermark();\n this.initMDevtools();\n this.initAutoMark();\n this.initReward();\n\n window.setTimeout(() => {\n this.initComment();\n if (!this.config.encryption?.all) {\n this.initToc();\n this.initTocListener();\n }\n this.onScroll();\n this.onResize();\n this.onClickMask();\n this.beforeprint();\n }, 100);\n } catch (err) {\n console.error(err);\n }\n }\n}\n\nconst themeInit = () => {\n window.fixit = new FixIt();\n window.fixit.init();\n};\n\nif (document.readyState !== 'loading') {\n themeInit();\n} else {\n document.addEventListener('DOMContentLoaded', themeInit, false);\n}\n"],"mappings":"u2FAAMA,KAAI,+FACR,iBAAQC,QAAQ,CAAEC,OAAO,CA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C,iBAAiB,EAAE,CACxB,IAAI,CAACC,aAAa,EAAE,CACpB,IAAI,CAACC,aAAa,EAAE,CACpB,IAAI,CAACC,YAAY,EAAE,CACnB,IAAI,CAACC,UAAU,EAAE,CAEjBnkB,MAAM,CAAC8Y,UAAU,CAAC,UAAM,2BACtB,OAAI,CAACsL,WAAW,EAAE,CAClB,GAAI,yBAAC,OAAI,CAACxiB,MAAM,CAACse,UAAU,0CAAtB,sBAAwBG,GAAG,EAAE,CAChC,OAAI,CAACP,OAAO,EAAE,CACd,OAAI,CAACC,eAAe,EACtB,CACA,OAAI,CAACsE,QAAQ,EAAE,CACf,OAAI,CAACC,QAAQ,EAAE,CACf,OAAI,CAACC,WAAW,EAAE,CAClB,OAAI,CAACC,WAAW,EAClB,CAAC,CAAE,GAAG,CACR,CAAE,MAAOnf,GAAG,CAAE,CACZC,OAAO,CAACC,KAAK,CAACF,GAAG,CACnB,CACF,CAAC,oBAGH,GAAMof,UAAS,CAAG,QAAZA,UAAS,EAAS,CACtBzkB,MAAM,CAAC0kB,KAAK,CAAG,GAAIjjB,MAAO,CAC1BzB,MAAM,CAAC0kB,KAAK,CAACvP,IAAI,EACnB,CAAC,CAED,GAAIvV,QAAQ,CAACuO,UAAU,GAAK,SAAS,CAAE,CACrCsW,SAAS,EACX,CAAC,IAAM,CACL7kB,QAAQ,CAACe,gBAAgB,CAAC,kBAAkB,CAAE8jB,SAAS,CAAE,KAAK,CAChE"} \ No newline at end of file +{"version":3,"file":"theme.min.js","names":["Util","elements","handler","i","length","document","documentElement","body","scrollTop","window","matchMedia","matches","element","animation","reserved","callback","Array","isArray","classList","add","addEventListener","remove","once","date","Date","isNaN","getTime","selector","startsWith","getElementById","slice","querySelector","scrollIntoView","behavior","FixIt","now","run","config","siteTime","$runTimes","util","isValidDate","clearInterval","parentNode","runTime","days","Math","floor","hours","minutes","seconds","innerHTML","String","padStart","data","isDark","dataset","theme","newScrollTop","getScrollTop","oldScrollTop","scrollEventSet","Set","resizeEventSet","switchThemeEventSet","clickMaskEventSet","beforeprintEventSet","disableScrollEvent","objectFitImages","$meta","_themeColorOnSwitchTheme","content","dark","light","forEach","querySelectorAll","$icon","fetch","svgSrc","then","response","text","svg","$temp","createElement","insertAdjacentHTML","$svg","firstChild","$titleElements","getElementsByTagName","removeChild","parentElement","replaceChild","catch","err","console","error","twemoji","parse","initMenuDesktop","initMenuMobile","$item","style","minWidth","offsetWidth","$menuToggleMobile","$menuMobile","event","toggle","contains","_menuMobileOnClickMask","$nestedItem","getElementsByClassName","$themeSwitch","localStorage","setItem","searchConfig","search","isMobile","_searchMobileOnce","_searchDesktopOnce","maxResultLength","snippetLength","highlightTag","isCaseSensitive","minMatchCharLength","findAllMatches","location","threshold","distance","ignoreLocation","useExtendedSearch","ignoreFieldNorm","suffix","$header","$searchInput","$searchToggle","$searchLoading","$searchClear","display","_searchMobile","autocomplete","setVal","_searchMobileOnClickMask","focus","_searchDesktop","_searchDesktopOnClickMask","value","initAutosearch","autosearch","hint","autoselect","dropdownMenuContainer","clearOnSelected","cssClasses","noPrefix","debug","name","source","query","finish","results","type","lunr","queryHandler","_index","ref","metadata","matchData","_indexData","uri","title","context","position","Object","values","matchPosition","substr","lastIndexOf","keys","key","replace","RegExp","lunrIndexURL","json","indexData","lunrLanguageCode","use","field","boost","metadataWhitelist","record","objectID","_algoliaIndex","algoliasearch","algoliaAppID","algoliaSearchKey","initIndex","algoliaIndex","offset","attributesToHighlight","attributesToSnippet","highlightPreTag","highlightPostTag","hits","_highlightResult","_snippetResult","item","refIndex","indices","substring","tag","fuseIndexURL","options","includeScore","shouldSort","includeMatches","Fuse","templates","suggestion","empty","noResultsFound","footer","searchType","icon","href","on","_event","_dataset","_context","assign","lunrSegmentitURL","script","id","src","async","readyState","onreadystatechange","onload","appendChild","$details","$summary","lightgallery","lightGallery","plugins","lgThumbnail","lgZoom","speed","hideBarsDelay","allowMediaOverlap","exThumbImage","toggleThumb","thumbWidth","thumbHeight","actualSize","showZoomInOutIcons","licenseKey","$preChroma","$chroma","className","$table","$tbody","$tr","$td","$codeElements","$code","toLowerCase","$title","$ellipses","code","editable","$edit","editUnLockTitle","$iconKey","$iconLock","$preChromas","editLockTitle","setAttribute","blur","copyTitle","$copy","innerText","trim","maxShownLines","split","navigator","clipboard","writeText","animateCSS","insertBefore","$wrapper","num","$tocCore","APlayer","$newTocCore","cloneNode","kept","isTocStatic","$tocContentStatic","_tocOnScroll","delete","$tocContentAuto","$toc","visibility","$postMeta","marginTop","offsetTop","clientHeight","$tocLinkElements","$tocLiElements","$headerLinkElements","headerIsFixed","headerDesktop","headerHeight","offsetHeight","marginBottom","$tocLink","$tocLi","INDEX_SPACING","activeTocIndex","thisTop","getBoundingClientRect","top","nextTop","$parent","tocHidden","push","math","renderMathInElement","$mermaidElements","themes","mermaid","initialize","startOnLoad","securityLevel","$mermaid","render","svgCode","switchMermaidTheme","echarts","registerTheme","lightTheme","darkTheme","_echartsOnSwitchTheme","_echartsArr","dispose","$echarts","chart","init","renderer","setOption","JSON","_echartsOnResize","resize","mapbox","mapboxgl","accessToken","setRTLTextPlugin","RTLTextPlugin","_mapboxArr","$mapbox","lng","lat","zoom","lightStyle","darkStyle","marked","navigation","geolocate","scale","fullscreen","Map","container","center","minZoom","attributionControl","Marker","setLngLat","addTo","addControl","NavigationControl","GeolocateControl","positionOptions","enableHighAccuracy","showUserLocation","trackUserLocation","ScaleControl","FullscreenControl","MapboxLanguage","_mapboxOnSwitchTheme","getContainer","setStyle","typeit","typeitConfig","cursorSpeed","cursorChar","loop","group","typeone","shortcodeLoop","instance","TypeIt","strings","lifeLike","waitUntilVisible","afterComplete","duration","setTimeout","destroy","go","comments","images","$content","$imgs","$img","$link","append","replaceWith","comment","enable","$viewCommentsBtn","expired","artalk","Artalk","LoadCountWidget","server","site","pvEl","countEl","setDarkMode","initCommentLightGallery","gitalk","decodeURI","Gitalk","valine","Valine","waline","pageview","Waline","pageviewCount","serverURL","path","pathname","utterances","utterancesConfig","repo","issueTerm","label","crossOrigin","_utterancesOnSwitchTheme","message","contentWindow","postMessage","twikoo","twikooConfig","onCommentLoaded","commentCount","getCommentsCount","envId","region","urls","includeReply","twikooCommentCount","count","giscus","giscusConfig","_giscusOnSwitchTheme","setConfig","giscus2parentMsg","$script","cookieconsent","initialise","setInterval","getSiteTime","hidden","enablePWA","serviceWorker","register","scope","registration","ready","watermark","Watermark","outerHTML","appendTo","appendto","opacity","width","height","rowSpacing","rowspacing","colSpacing","colspacing","rotate","fontSize","fontsize","fontFamily","fontfamily","pangu","spacingElementById","spacingElementByClassName","spacingElementByTagName","autoSpacingPage","$tocNodes","decryptor","FixItDecryptor","decrypted","initTwemoji","initDetails","initLightGallery","initHighlight","initTable","initHeaderLink","initMath","initMermaid","initEcharts","initTypeit","initMapbox","$element","initToc","initTocListener","initPangu","reset","encryption","shortcode","initShortcodes","all","mDevtools","orientation","vConsole","VConsole","target","_vConsoleOnSwitchTheme","eruda","defaults","_erudaOnSwitchTheme","evalCss","setTheme","autoBookmark","Number","getItem","hash","scrollTo","$rewards","$reward","removeAttribute","_closeRewardExclude","$rewardInput","checked","previousElementSibling","getAttribute","$headers","ACCURACY","$fixedButtons","$backToTop","$readingProgressBar","scrollTimer","headerMobile","preventDefault","$mask","scroll","toggleAttribute","clearTimeout","click","contentHeight","scrollHeight","innerHeight","scrollPercent","max","min","setProperty","toFixed","round","resizeBefore","_resizeTimeout","initSearch","$el","initFixItDecryptor","initThemeColor","initSVGIcon","initMenu","initSwitchTheme","initCookieconsent","initSiteTime","initServiceWorker","initWatermark","initMDevtools","initAutoMark","initReward","initComment","onScroll","onResize","onClickMask","beforeprint","themeInit","fixit"],"sources":["../../src/js/theme.js"],"sourcesContent":["class Util {\n forEach(elements, handler) {\n elements = elements || [];\n for (let i = 0; i < elements.length; i++) {\n handler(elements[i]);\n }\n }\n\n getScrollTop() {\n return (document.documentElement ?? document.body).scrollTop;\n }\n\n isMobile() {\n return window.matchMedia('only screen and (max-width: 680px)').matches;\n }\n\n isTocStatic() {\n return window.matchMedia('only screen and (max-width: 960px)').matches;\n }\n\n /**\n * add animate to element\n * @param {Element} element animate element\n * @param {String|Array} animation animation name\n * @param {Boolean} reserved reserved animation\n * @param {Function} callback remove callback\n */\n animateCSS(element, animation, reserved, callback) {\n !Array.isArray(animation) && (animation = [animation]);\n element.classList.add('animate__animated', ...animation);\n element.addEventListener('animationend', () => {\n !reserved && element.classList.remove('animate__animated', ...animation);\n typeof callback === 'function' && callback();\n }, { once: true });\n }\n\n /**\n * date validator\n * @param {*} date may be date or not\n * @returns {Boolean}\n */\n isValidDate(date) {\n return date instanceof Date && !isNaN(date.getTime());\n }\n \n /**\n * scroll some element into view\n * @param {String} selector element to scroll\n */\n scrollIntoView(selector) {\n const element = selector.startsWith('#')\n ? document.getElementById(selector.slice(1))\n : document.querySelector(selector);\n element?.scrollIntoView({\n behavior: 'smooth'\n });\n }\n}\n\nclass FixIt {\n constructor() {\n this.config = window.config;\n this.data = this.config.data;\n this.isDark = document.body.dataset.theme === 'dark';\n this.util = new Util();\n this.newScrollTop = this.util.getScrollTop();\n this.oldScrollTop = this.newScrollTop;\n this.scrollEventSet = new Set();\n this.resizeEventSet = new Set();\n this.switchThemeEventSet = new Set();\n this.clickMaskEventSet = new Set();\n this.beforeprintEventSet = new Set();\n this.disableScrollEvent = false;\n window.objectFitImages && objectFitImages();\n }\n\n initThemeColor() {\n const $meta = document.querySelector('[name=\"theme-color\"]');\n if (!$meta) {\n return;\n }\n this._themeColorOnSwitchTheme = this._themeColorOnSwitchTheme || (() => {\n $meta.content = this.isDark ? $meta.dataset.dark : $meta.dataset.light;\n });\n this.switchThemeEventSet.add(this._themeColorOnSwitchTheme);\n this._themeColorOnSwitchTheme();\n }\n\n initSVGIcon() {\n this.util.forEach(document.querySelectorAll('[data-svg-src]'), ($icon) => {\n fetch($icon.dataset.svgSrc)\n .then((response) => response.text())\n .then((svg) => {\n const $temp = document.createElement('div');\n $temp.insertAdjacentHTML('afterbegin', svg);\n const $svg = $temp.firstChild;\n $svg.dataset.svgSrc = $icon.dataset.svgSrc\n $svg.classList.add('icon');\n const $titleElements = $svg.getElementsByTagName('title');\n $titleElements.length && $svg.removeChild($titleElements[0]);\n $icon.parentElement.replaceChild($svg, $icon);\n })\n .catch((err) => {\n console.error(err);\n });\n });\n }\n\n initTwemoji() {\n this.config.twemoji && twemoji.parse(document.body);\n }\n\n initMenu() {\n this.initMenuDesktop();\n this.initMenuMobile();\n }\n\n initMenuDesktop() {\n this.util.forEach(document.querySelectorAll('.has-children'), ($item) => {\n $item.querySelector('.sub-menu').style.minWidth = `${$item.offsetWidth - 8}px`;\n });\n }\n\n initMenuMobile() {\n const $menuToggleMobile = document.getElementById('menu-toggle-mobile');\n const $menuMobile = document.getElementById('menu-mobile');\n $menuToggleMobile.addEventListener('click', (event) => {\n document.body.classList.toggle('blur');\n $menuToggleMobile.classList.toggle('active');\n $menuMobile.classList.toggle('active');\n this.disableScrollEvent = document.body.classList.contains('blur');\n }, false);\n this._menuMobileOnClickMask = this._menuMobileOnClickMask || (() => {\n $menuToggleMobile.classList.remove('active');\n $menuMobile.classList.remove('active');\n });\n this.clickMaskEventSet.add(this._menuMobileOnClickMask);\n // add nested menu toggler\n this.util.forEach(document.querySelectorAll('.menu-item>.nested-item'), ($nestedItem) => {\n $nestedItem.addEventListener('click', function () {\n this.parentNode.querySelector('.sub-menu').classList.toggle('open');\n this.querySelector('.dropdown-icon').classList.toggle('open');\n });\n });\n }\n\n initSwitchTheme() {\n this.util.forEach(document.getElementsByClassName('theme-switch'), ($themeSwitch) => {\n $themeSwitch.addEventListener('click', () => {\n document.body.dataset.theme = document.body.dataset.theme === 'dark' ? 'light' : 'dark';\n this.isDark = !this.isDark;\n window.localStorage?.setItem('theme', this.isDark ? 'dark' : 'light');\n for (let event of this.switchThemeEventSet) {\n event();\n }\n }, false);\n });\n }\n\n initSearch() {\n const searchConfig = this.config.search;\n const isMobile = this.util.isMobile();\n if (!searchConfig || (isMobile && this._searchMobileOnce) || (!isMobile && this._searchDesktopOnce)) {\n return;\n }\n // Initialize default search config\n const maxResultLength = searchConfig.maxResultLength ?? 10;\n const snippetLength = searchConfig.snippetLength ?? 50;\n const highlightTag = searchConfig.highlightTag ?? 'em';\n const isCaseSensitive = searchConfig.isCaseSensitive ?? false;\n const minMatchCharLength = searchConfig.minMatchCharLength ?? 1;\n const findAllMatches = searchConfig.findAllMatches ?? false;\n const location = searchConfig.location ?? 0;\n const threshold = searchConfig.threshold ?? 0.3;\n const distance = searchConfig.distance ?? 100;\n const ignoreLocation = searchConfig.ignoreLocation ?? false;\n const useExtendedSearch = searchConfig.useExtendedSearch ?? false;\n const ignoreFieldNorm = searchConfig.ignoreFieldNorm ?? false;\n const suffix = isMobile ? 'mobile' : 'desktop';\n const $header = document.getElementById(`header-${suffix}`);\n const $searchInput = document.getElementById(`search-input-${suffix}`);\n const $searchToggle = document.getElementById(`search-toggle-${suffix}`);\n const $searchLoading = document.getElementById(`search-loading-${suffix}`);\n const $searchClear = document.getElementById(`search-clear-${suffix}`);\n\n if (isMobile) {\n this._searchMobileOnce = true;\n $searchInput.addEventListener('focus', () => {\n this.disableScrollEvent = true;\n document.body.classList.add('blur');\n $header.classList.add('open');\n }, false);\n document.getElementById('search-cancel-mobile').addEventListener('click', () => {\n this.disableScrollEvent = false;\n $header.classList.remove('open');\n document.body.classList.remove('blur');\n document.getElementById('menu-toggle-mobile').classList.remove('active');\n document.getElementById('menu-mobile').classList.remove('active');\n $searchLoading.style.display = 'none';\n $searchClear.style.display = 'none';\n this._searchMobile && this._searchMobile.autocomplete.setVal('');\n }, false);\n $searchClear.addEventListener('click', () => {\n $searchClear.style.display = 'none';\n this._searchMobile && this._searchMobile.autocomplete.setVal('');\n }, false);\n this._searchMobileOnClickMask = this._searchMobileOnClickMask || (() => {\n $header.classList.remove('open');\n $searchLoading.style.display = 'none';\n $searchClear.style.display = 'none';\n this._searchMobile && this._searchMobile.autocomplete.setVal('');\n });\n this.clickMaskEventSet.add(this._searchMobileOnClickMask);\n } else {\n this._searchDesktopOnce = true;\n $searchToggle.addEventListener('click', () => {\n document.body.classList.add('blur');\n $header.classList.add('open');\n $searchInput.focus();\n }, false);\n $searchClear.addEventListener('click', () => {\n $searchClear.style.display = 'none';\n this._searchDesktop && this._searchDesktop.autocomplete.setVal('');\n }, false);\n this._searchDesktopOnClickMask = this._searchDesktopOnClickMask ||(() => {\n $header.classList.remove('open');\n $searchLoading.style.display = 'none';\n $searchClear.style.display = 'none';\n this._searchDesktop && this._searchDesktop.autocomplete.setVal('');\n });\n this.clickMaskEventSet.add(this._searchDesktopOnClickMask);\n }\n $searchInput.addEventListener('input', () => {\n if ($searchInput.value === '') $searchClear.style.display = 'none';\n else $searchClear.style.display = 'inline';\n }, false);\n\n const initAutosearch = () => {\n const autosearch = autocomplete(`#search-input-${suffix}`,\n {\n hint: false,\n autoselect: true,\n dropdownMenuContainer: `#search-dropdown-${suffix}`,\n clearOnSelected: true,\n cssClasses: { noPrefix: true },\n debug: true\n },\n {\n name: 'search',\n source: (query, callback) => {\n $searchLoading.style.display = 'inline';\n $searchClear.style.display = 'none';\n const finish = (results) => {\n $searchLoading.style.display = 'none';\n $searchClear.style.display = 'inline';\n callback(results);\n };\n if (searchConfig.type === 'lunr') {\n const search = () => {\n if (lunr.queryHandler) {\n query = lunr.queryHandler(query);\n }\n const results = {};\n this._index.search(query).forEach(({ ref, matchData: { metadata } }) => {\n const matchData = this._indexData[ref];\n let { uri, title, content: context } = matchData;\n if (results[uri]) {\n return;\n }\n let position = 0;\n Object.values(metadata).forEach(({ content }) => {\n if (content) {\n const matchPosition = content.position[0][0];\n if (matchPosition < position || position === 0) {\n position = matchPosition;\n }\n }\n });\n position -= snippetLength / 5;\n if (position > 0) {\n position += context.substr(position, 20).lastIndexOf(' ') + 1;\n context = '...' + context.substr(position, snippetLength);\n } else {\n context = context.substr(0, snippetLength);\n }\n Object.keys(metadata).forEach((key) => {\n title = title.replace(new RegExp(`(${key})`, 'gi'), `<${highlightTag}>$1`);\n context = context.replace(new RegExp(`(${key})`, 'gi'), `<${highlightTag}>$1`);\n });\n results[uri] = {\n uri: uri,\n title: title,\n date: matchData.date,\n context: context\n };\n });\n return Object.values(results).slice(0, maxResultLength);\n };\n if (!this._index) {\n fetch(searchConfig.lunrIndexURL)\n .then((response) => response.json())\n .then((data) => {\n const indexData = {};\n this._index = lunr(function () {\n if (searchConfig.lunrLanguageCode) this.use(lunr[searchConfig.lunrLanguageCode]);\n this.ref('objectID');\n this.field('title', { boost: 50 });\n this.field('tags', { boost: 20 });\n this.field('categories', { boost: 20 });\n this.field('content', { boost: 10 });\n this.metadataWhitelist = ['position'];\n data.forEach((record) => {\n indexData[record.objectID] = record;\n this.add(record);\n });\n });\n this._indexData = indexData;\n finish(search());\n })\n .catch((err) => {\n console.error(err);\n finish([]);\n });\n } else finish(search());\n } else if (searchConfig.type === 'algolia') {\n this._algoliaIndex =\n this._algoliaIndex || algoliasearch(searchConfig.algoliaAppID, searchConfig.algoliaSearchKey).initIndex(searchConfig.algoliaIndex);\n this._algoliaIndex\n .search(query, {\n offset: 0,\n length: maxResultLength * 8,\n attributesToHighlight: ['title'],\n attributesToSnippet: [`content:${snippetLength}`],\n highlightPreTag: `<${highlightTag}>`,\n highlightPostTag: ``\n })\n .then(({ hits }) => {\n const results = {};\n hits.forEach(({ uri, date, _highlightResult: { title }, _snippetResult: { content } }) => {\n if (results[uri] && results[uri].context.length > content.value) {\n return;\n }\n results[uri] = {\n uri: uri,\n title: title.value,\n date: date,\n context: content.value\n };\n });\n finish(Object.values(results).slice(0, maxResultLength));\n })\n .catch((err) => {\n console.error(err);\n finish([]);\n });\n } else if (searchConfig.type === 'fuse') {\n const search = () => {\n const results = {};\n window._index.search(query).forEach(({ item, refIndex, matches }) => {\n let title = item.title;\n let content = item.content;\n matches.forEach(({ indices, value, key }) => {\n if (key === 'content') {\n let offset = 0;\n for (let i = 0; i < indices.length; i++) {\n const substr = content.substring(indices[i][0] + offset, indices[i][1] + 1 + offset);\n const tag = `<${highlightTag}>` + substr + ``;\n content = content.substring(0, indices[i][0] + offset) + tag + content.substring(indices[i][1] + 1 + offset, content.length);\n offset += highlightTag.length * 2 + 5;\n }\n } else if (key === 'title') {\n let offset = 0;\n for (let i = 0; i < indices.length; i++) {\n const substr = title.substring(indices[i][0] + offset, indices[i][1] + 1 + offset);\n const tag = `<${highlightTag}>` + substr + ``;\n title = title.substring(0, indices[i][0] + offset) + tag + title.substring(indices[i][1] + 1 + offset, content.length);\n offset += highlightTag.length * 2 + 5;\n }\n }\n });\n results[item.uri] = {\n uri: item.uri,\n title: title,\n date: item.date,\n context: content\n };\n });\n return Object.values(results).slice(0, maxResultLength);\n };\n if (!window._index) {\n fetch(searchConfig.fuseIndexURL)\n .then((response) => response.json())\n .then((data) => {\n const options = {\n isCaseSensitive: isCaseSensitive,\n findAllMatches: findAllMatches,\n minMatchCharLength: minMatchCharLength,\n location: location,\n threshold: threshold,\n distance: distance,\n ignoreLocation: ignoreLocation,\n useExtendedSearch: useExtendedSearch,\n ignoreFieldNorm: ignoreFieldNorm,\n includeScore: false,\n shouldSort: true,\n includeMatches: true,\n keys: ['content', 'title']\n };\n window._index = new Fuse(data, options);\n finish(search());\n })\n .catch((err) => {\n console.error(err);\n finish([]);\n });\n } else finish(search());\n } \n },\n templates: {\n suggestion: ({ title, date, context }) =>\n `
${title}${date}
${context}
`,\n empty: ({ query }) => `
${searchConfig.noResultsFound}: \"${query}\"
`,\n footer: ({}) => {\n const { searchType, icon, href } =\n searchConfig.type === 'algolia'\n ? {\n searchType: 'algolia',\n icon: '',\n href: 'https://www.algolia.com/'\n }\n : (searchConfig.type === 'lunr'\n ? {\n searchType: 'Lunr.js',\n icon: '',\n href: 'https://lunrjs.com/'\n }\n : {\n searchType: 'Fuse.js',\n icon: '',\n href: 'https://fusejs.io/'\n })\n return ``;\n }\n }\n }\n );\n autosearch.on('autocomplete:selected', (_event, suggestion, _dataset, _context) => {\n window.location.assign(suggestion.uri);\n });\n if (isMobile) {\n this._searchMobile = autosearch;\n } else {\n this._searchDesktop = autosearch;\n }\n };\n if (searchConfig.lunrSegmentitURL && !document.getElementById('lunr-segmentit')) {\n const script = document.createElement('script');\n script.id = 'lunr-segmentit';\n script.src = searchConfig.lunrSegmentitURL;\n script.async = true;\n if (script.readyState) {\n script.onreadystatechange = () => {\n if (script.readyState == 'loaded' || script.readyState == 'complete') {\n script.onreadystatechange = null;\n initAutosearch();\n }\n };\n } else {\n script.onload = () => {\n initAutosearch();\n };\n }\n document.body.appendChild(script);\n } else {\n initAutosearch();\n }\n }\n\n initDetails() {\n this.util.forEach(document.getElementsByClassName('details'), ($details) => {\n const $summary = $details.querySelector('.details-summary');\n $summary.addEventListener('click', () => {\n $details.classList.toggle('open');\n }, false);\n });\n }\n\n initLightGallery() {\n if (this.config.lightgallery) {\n lightGallery(document.getElementById('content'), {\n plugins: [lgThumbnail, lgZoom],\n selector: '.lightgallery',\n speed: 400,\n hideBarsDelay: 2000,\n allowMediaOverlap: true,\n exThumbImage: 'data-thumbnail',\n toggleThumb: true,\n thumbWidth: 80,\n thumbHeight: '60px',\n actualSize: false,\n showZoomInOutIcons: true,\n licenseKey: 'none'\n });\n }\n }\n\n initHighlight() {\n this.util.forEach(document.querySelectorAll('.highlight > pre.chroma'), ($preChroma) => {\n const $chroma = document.createElement('div');\n $chroma.className = $preChroma.className;\n const $table = document.createElement('table');\n $chroma.appendChild($table);\n const $tbody = document.createElement('tbody');\n $table.appendChild($tbody);\n const $tr = document.createElement('tr');\n $tbody.appendChild($tr);\n const $td = document.createElement('td');\n $tr.appendChild($td);\n $preChroma.parentElement.replaceChild($chroma, $preChroma);\n $td.appendChild($preChroma);\n });\n this.util.forEach(document.querySelectorAll('.highlight > .chroma'), ($chroma) => {\n const $codeElements = $chroma.querySelectorAll('pre.chroma > code');\n if ($codeElements.length) {\n const $code = $codeElements[$codeElements.length - 1];\n const $header = document.createElement('div');\n $header.className = 'code-header ' + $code.className.toLowerCase();\n // code title\n const $title = document.createElement('span');\n $title.classList.add('code-title');\n $title.insertAdjacentHTML('afterbegin', '');\n $title.addEventListener('click', () => {\n $chroma.classList.toggle('open');\n }, false);\n $header.appendChild($title);\n // ellipses icon\n const $ellipses = document.createElement('span');\n $ellipses.insertAdjacentHTML('afterbegin', '');\n $ellipses.classList.add('ellipses');\n $ellipses.addEventListener('click', () => {\n $chroma.classList.add('open');\n }, false);\n $header.appendChild($ellipses);\n // edit button\n if (this.config.code.editable) {\n const $edit = document.createElement('span');\n $edit.classList.add('edit');\n $edit.insertAdjacentHTML('afterbegin', ``);\n $edit.addEventListener('click', () => {\n const $iconKey = $edit.querySelector('.fa-key');\n const $iconLock = $edit.querySelector('.fa-lock');\n const $preChromas = $edit.parentElement.parentElement.querySelectorAll('pre.chroma');\n const $preChroma = $preChromas.length === 2 ? $preChromas[1] : $preChromas[0];\n if ($iconKey) {\n $iconKey.classList.add('fa-lock');\n $iconKey.classList.remove('fa-key');\n $iconKey.title = this.config.code.editLockTitle;\n $preChroma.setAttribute('contenteditable', true);\n $preChroma.focus();\n } else {\n $iconLock.classList.add('fa-key');\n $iconLock.classList.remove('fa-lock');\n $iconLock.title = this.config.code.editUnLockTitle;\n $preChroma.setAttribute('contenteditable', false);\n $preChroma.blur();\n }\n }, false);\n $header.appendChild($edit);\n }\n // copy button\n if (this.config.code.copyTitle) {\n const $copy = document.createElement('span');\n $copy.insertAdjacentHTML('afterbegin', '');\n $copy.classList.add('copy');\n // remove the leading and trailing whitespace of the code string\n const code = $code.innerText.trim();\n if (this.config.code.maxShownLines < 0 || code.split('\\n').length < this.config.code.maxShownLines + 2) {\n $chroma.classList.add('open');\n }\n $copy.title = this.config.code.copyTitle;\n $copy.addEventListener('click', () => {\n navigator.clipboard.writeText(code).then(() => {\n this.util.animateCSS($code, 'animate__flash');\n }, () => {\n console.error('Clipboard write failed!', 'Your browser does not support clipboard API!');\n });\n }, false);\n $header.appendChild($copy);\n }\n $chroma.insertBefore($header, $chroma.firstChild);\n }\n });\n }\n\n initTable() {\n this.util.forEach(document.querySelectorAll('.content table'), ($table) => {\n const $wrapper = document.createElement('div');\n $wrapper.className = 'table-wrapper';\n $table.parentElement.replaceChild($wrapper, $table);\n $wrapper.appendChild($table);\n });\n }\n\n initHeaderLink() {\n for (let num = 1; num <= 6; num++) {\n this.util.forEach(document.querySelectorAll('.single .content > h' + num), ($header) => {\n $header.classList.add('header-link');\n $header.insertAdjacentHTML('afterbegin', ``);\n });\n }\n }\n /**\n * init table of contents\n */\n initToc() {\n let $tocCore = document.getElementById('TableOfContents');\n if ($tocCore === null) {\n return;\n }\n // It's a dirty hack to fix the bug of APlayer, see https://github.com/hugo-fixit/FixIt/issues/292\n if (typeof APlayer === 'function') {\n const $newTocCore = $tocCore.cloneNode(true);\n $tocCore.parentElement.replaceChild($newTocCore, $tocCore);\n $tocCore = $newTocCore;\n }\n if (document.getElementById('toc-static').dataset.kept === true || this.util.isTocStatic()) {\n const $tocContentStatic = document.getElementById('toc-content-static');\n if ($tocCore.parentElement !== $tocContentStatic) {\n $tocCore.parentElement.removeChild($tocCore);\n $tocContentStatic.appendChild($tocCore);\n }\n this._tocOnScroll && this.scrollEventSet.delete(this._tocOnScroll);\n } else {\n const $tocContentAuto = document.getElementById('toc-content-auto');\n if ($tocCore.parentElement !== $tocContentAuto) {\n $tocCore.parentElement.removeChild($tocCore);\n $tocContentAuto.appendChild($tocCore);\n }\n const $toc = document.getElementById('toc-auto');\n $toc.style.visibility = 'visible';\n this.util.animateCSS($toc, ['animate__fadeIn', 'animate__faster'], true);\n const $postMeta = document.querySelector('.post-meta');\n $toc.style.marginTop = `${$postMeta.offsetTop + $postMeta.clientHeight}px`;\n const $tocLinkElements = $tocCore.querySelectorAll('a:first-child');\n const $tocLiElements = $tocCore.getElementsByTagName('li');\n const $headerLinkElements = document.getElementsByClassName('header-link');\n const headerIsFixed = document.body.dataset.headerDesktop !== 'normal';\n const headerHeight = document.getElementById('header-desktop').offsetHeight;\n document.querySelector('.container').addEventListener('resize', () => {\n $toc.style.marginBottom = `${document.querySelector('.container').clientHeight - document.querySelector('.post-footer').offsetTop}px`;\n });\n this._tocOnScroll = this._tocOnScroll || (() => {\n $toc.style.marginBottom = `${document.querySelector('.container').clientHeight - document.querySelector('.post-footer').offsetTop}px`;\n this.util.forEach($tocLinkElements, ($tocLink) => {\n $tocLink.classList.remove('active');\n });\n this.util.forEach($tocLiElements, ($tocLi) => {\n $tocLi.classList.remove('has-active');\n });\n const INDEX_SPACING = 20 + (headerIsFixed ? headerHeight : 0);\n let activeTocIndex = $headerLinkElements.length - 1;\n for (let i = 0; i < $headerLinkElements.length - 1; i++) {\n const thisTop = $headerLinkElements[i].getBoundingClientRect().top;\n const nextTop = $headerLinkElements[i + 1].getBoundingClientRect().top;\n if ((i == 0 && thisTop > INDEX_SPACING) || (thisTop <= INDEX_SPACING && nextTop > INDEX_SPACING)) {\n activeTocIndex = i;\n break;\n }\n }\n if (activeTocIndex !== -1) {\n $tocLinkElements[activeTocIndex].classList.add('active');\n let $parent = $tocLinkElements[activeTocIndex].parentElement;\n while ($parent !== $tocCore) {\n $parent.classList.add('has-active');\n $parent = $parent.parentElement.parentElement;\n }\n }\n });\n this._tocOnScroll();\n this.scrollEventSet.add(this._tocOnScroll);\n }\n }\n\n initTocListener() {\n const $toc = document.getElementById('toc-auto');\n const $tocContentAuto = document.getElementById('toc-content-auto');\n document.querySelector('#toc-auto>.toc-title')?.addEventListener('click', () => {\n const animation = ['animate__faster'];\n const tocHidden = $toc.classList.contains('toc-hidden');\n animation.push(tocHidden ? 'animate__fadeIn' : 'animate__fadeOut');\n $tocContentAuto.classList.remove(tocHidden ? 'animate__fadeOut' : 'animate__fadeIn');\n this.util.animateCSS($tocContentAuto, animation, true);\n $toc.classList.toggle('toc-hidden');\n }, false);\n }\n\n initMath() {\n if (this.config.math) {\n renderMathInElement(document.body, this.config.math);\n }\n }\n\n switchMermaidTheme(theme) {\n const $mermaidElements = document.getElementsByClassName('mermaid');\n if ($mermaidElements.length) {\n // TODO perf\n const themes = this.config.mermaid.themes ?? ['default', 'dark', 'neutral'];\n mermaid.initialize({ startOnLoad: false, theme: theme ?? (this.isDark ? themes[1] : themes[0]), securityLevel: 'loose' });\n this.util.forEach($mermaidElements, $mermaid => {\n mermaid.render('svg-' + $mermaid.id, this.data[$mermaid.id], svgCode => {\n $mermaid.innerHTML = svgCode;\n }, $mermaid);\n });\n }\n };\n\n initMermaid() {\n this.switchMermaidTheme();\n this.switchThemeEventSet.add(() => { this.switchMermaidTheme(); });\n this.beforeprintEventSet.add(() => { this.switchMermaidTheme('neutral'); });\n }\n\n initEcharts() {\n if (!this.config.echarts) {\n return;\n }\n echarts.registerTheme('light', this.config.echarts.lightTheme);\n echarts.registerTheme('dark', this.config.echarts.darkTheme);\n this._echartsOnSwitchTheme = this._echartsOnSwitchTheme || (() => {\n this._echartsArr = this._echartsArr || [];\n for (let i = 0; i < this._echartsArr.length; i++) {\n this._echartsArr[i].dispose();\n }\n this._echartsArr = [];\n this.util.forEach(document.getElementsByClassName('echarts'), ($echarts) => {\n const chart = echarts.init($echarts, this.isDark ? 'dark' : 'light', { renderer: 'svg' });\n chart.setOption(JSON.parse(this.data[$echarts.id]));\n this._echartsArr.push(chart);\n });\n });\n this.switchThemeEventSet.add(this._echartsOnSwitchTheme);\n this._echartsOnSwitchTheme();\n this._echartsOnResize = this._echartsOnResize || (() => {\n for (let i = 0; i < this._echartsArr.length; i++) {\n this._echartsArr[i].resize();\n }\n });\n this.resizeEventSet.add(this._echartsOnResize);\n }\n\n initMapbox() {\n if (this.config.mapbox) {\n mapboxgl.accessToken = this.config.mapbox.accessToken;\n mapboxgl.setRTLTextPlugin(this.config.mapbox.RTLTextPlugin);\n this._mapboxArr = this._mapboxArr || [];\n this.util.forEach(document.getElementsByClassName('mapbox'), ($mapbox) => {\n const { lng, lat, zoom, lightStyle, darkStyle, marked, navigation, geolocate, scale, fullscreen } = this.data[$mapbox.id];\n const mapbox = new mapboxgl.Map({\n container: $mapbox,\n center: [lng, lat],\n zoom: zoom,\n minZoom: 0.2,\n style: this.isDark ? darkStyle : lightStyle,\n attributionControl: false\n });\n if (marked) {\n new mapboxgl.Marker().setLngLat([lng, lat]).addTo(mapbox);\n }\n if (navigation) {\n mapbox.addControl(new mapboxgl.NavigationControl(), 'bottom-right');\n }\n if (geolocate) {\n mapbox.addControl(\n new mapboxgl.GeolocateControl({\n positionOptions: {\n enableHighAccuracy: true\n },\n showUserLocation: true,\n trackUserLocation: true\n }),\n 'bottom-right'\n );\n }\n if (scale) {\n mapbox.addControl(new mapboxgl.ScaleControl());\n }\n if (fullscreen) {\n mapbox.addControl(new mapboxgl.FullscreenControl());\n }\n mapbox.addControl(new MapboxLanguage());\n this._mapboxArr.push(mapbox);\n });\n this._mapboxOnSwitchTheme = this._mapboxOnSwitchTheme || (() => {\n this.util.forEach(this._mapboxArr, (mapbox) => {\n const $mapbox = mapbox.getContainer();\n const { lightStyle, darkStyle } = this.data[$mapbox.id];\n mapbox.setStyle(this.isDark ? darkStyle : lightStyle);\n mapbox.addControl(new MapboxLanguage());\n });\n });\n this.switchThemeEventSet.add(this._mapboxOnSwitchTheme);\n }\n }\n\n initTypeit() {\n if (this.config.typeit) {\n const typeitConfig = this.config.typeit;\n const speed = typeitConfig.speed || 100;\n const cursorSpeed = typeitConfig.cursorSpeed || 1000;\n const cursorChar = typeitConfig.cursorChar || '|';\n const loop = typeitConfig.loop ?? false;\n Object.values(typeitConfig.data).forEach((group) => {\n const typeone = (i) => {\n const id = group[i];\n const shortcodeLoop = document.querySelector(`#${id}`).parentElement.dataset.loop;\n const instance = new TypeIt(`#${id}`, {\n strings: this.data[id],\n speed: speed,\n lifeLike: true,\n cursorSpeed: cursorSpeed,\n cursorChar: cursorChar,\n waitUntilVisible: true,\n loop: shortcodeLoop ? JSON.parse(shortcodeLoop) : loop,\n afterComplete: () => {\n if (i === group.length - 1) {\n if (typeitConfig.duration >= 0) {\n window.setTimeout(() => {\n instance.destroy();\n }, typeitConfig.duration);\n }\n return;\n }\n instance.destroy();\n typeone(i + 1);\n }\n }).go();\n };\n typeone(0);\n });\n }\n }\n\n initCommentLightGallery(comments, images) {\n document.querySelectorAll(comments).forEach(($content) => {\n const $imgs = $content.querySelectorAll(images + ':not([lightgallery-loaded])');\n $imgs.forEach(($img) => {\n $img.setAttribute('lightgallery-loaded', '');\n const $link = document.createElement('a');\n $link.setAttribute('class', 'comment-lightgallery');\n $link.setAttribute('href', $img.src);\n $link.append($img.cloneNode());\n $img.replaceWith($link);\n });\n if ($imgs.length) {\n lightGallery($content, {\n selector: '.comment-lightgallery',\n actualSize: false,\n hideBarsDelay: 2000,\n speed: 400\n });\n }\n });\n }\n\n initComment() {\n if (!this.config.comment?.enable) {\n return;\n }\n // whether to show the view comments button\n if (document.querySelector('#comments')) {\n const $viewCommentsBtn = document.querySelector('.view-comments');\n $viewCommentsBtn.classList.remove('d-none');\n // view comments button click event\n $viewCommentsBtn.addEventListener('click', () => {\n this.util.scrollIntoView('#comments');\n }, false);\n }\n this.config.comment.expired && document.querySelector('#comments').remove();\n if (this.config.comment.artalk) {\n if (this.config.comment.expired) {\n return Artalk.LoadCountWidget({\n server: this.config.comment.artalk.server,\n site: this.config.comment.artalk.site,\n pvEl: this.config.comment.artalk.pvEl,\n countEl: this.config.comment.artalk.countEl\n })\n }\n const artalk = Artalk.init(this.config.comment.artalk);\n artalk.setDarkMode(this.isDark);\n this.switchThemeEventSet.add(() => {\n artalk.setDarkMode(this.isDark);\n });\n artalk.on('comments-loaded', () => {\n this.config.comment.artalk.lightgallery && this.initCommentLightGallery('.atk-comment .atk-content', 'img:not([atk-emoticon])');\n });\n return artalk;\n }\n if (this.config.comment.gitalk) {\n this.config.comment.gitalk.body = decodeURI(window.location.href);\n const gitalk = new Gitalk(this.config.comment.gitalk);\n gitalk.render('gitalk');\n return gitalk;\n }\n if (this.config.comment.valine) {\n return new Valine(this.config.comment.valine);\n }\n if (this.config.comment.waline) {\n if (this.config.comment.expired) {\n this.config.comment.waline.pageview && Waline.pageviewCount({\n serverURL: this.config.comment.waline.serverURL,\n path: window.location.pathname\n });\n return;\n }\n return Waline.init(this.config.comment.waline);\n }\n if (this.config.comment.utterances) {\n const utterancesConfig = this.config.comment.utterances;\n const script = document.createElement('script');\n script.src = 'https://utteranc.es/client.js';\n script.setAttribute('repo', utterancesConfig.repo);\n script.setAttribute('issue-term', utterancesConfig.issueTerm);\n if (utterancesConfig.label) script.setAttribute('label', utterancesConfig.label);\n script.setAttribute('theme', this.isDark ? utterancesConfig.darkTheme : utterancesConfig.lightTheme);\n script.crossOrigin = 'anonymous';\n script.async = true;\n document.getElementById('utterances').appendChild(script);\n this._utterancesOnSwitchTheme = this._utterancesOnSwitchTheme || (() => {\n const message = {\n type: 'set-theme',\n theme: this.isDark ? utterancesConfig.darkTheme : utterancesConfig.lightTheme\n };\n document.querySelector('.utterances-frame')?.contentWindow.postMessage(message, 'https://utteranc.es');\n });\n this.switchThemeEventSet.add(this._utterancesOnSwitchTheme);\n return;\n }\n if (this.config.comment.twikoo) {\n const twikooConfig = this.config.comment.twikoo;\n if (twikooConfig.lightgallery) {\n twikooConfig.onCommentLoaded = () => {\n this.initCommentLightGallery('.tk-comments .tk-content', 'img:not(.tk-owo-emotion)');\n };\n }\n twikoo.init(twikooConfig);\n if (twikooConfig.commentCount) {\n // https://twikoo.js.org/api.html#get-comments-count\n twikoo\n .getCommentsCount({\n envId: twikooConfig.envId,\n region: twikooConfig.region,\n urls: [window.location.pathname],\n includeReply: false\n })\n .then(function (response) {\n const twikooCommentCount = document.getElementById('twikoo-comment-count');\n if (twikooCommentCount) twikooCommentCount.innerHTML = response[0].count;\n });\n }\n return;\n }\n if (this.config.comment.giscus) {\n const giscusConfig = this.config.comment.giscus;\n this._giscusOnSwitchTheme = this._giscusOnSwitchTheme || (() => {\n const message = { setConfig: { theme: this.isDark ? giscusConfig.darkTheme : giscusConfig.lightTheme }};\n document.querySelector('.giscus-frame')?.contentWindow.postMessage({ giscus: message }, 'https://giscus.app');\n });\n this.switchThemeEventSet.add(this._giscusOnSwitchTheme);\n this.giscus2parentMsg = window.addEventListener('message', (event) => {\n const $script = document.querySelector('#giscus>script');\n if ($script){\n this._giscusOnSwitchTheme();\n $script.parentElement.removeChild($script);\n }\n }, { once: true });\n return;\n }\n }\n\n initCookieconsent() {\n this.config.cookieconsent && cookieconsent.initialise(this.config.cookieconsent);\n }\n\n getSiteTime = () => {\n let now = new Date();\n let run = new Date(this.config.siteTime);\n let $runTimes = document.querySelector('.run-times');\n if (!this.util.isValidDate(run) || !$runTimes) {\n clearInterval(this.siteTime);\n $runTimes && $runTimes.parentNode.remove();\n return;\n }\n let runTime = (now - run) / 1000,\n days = Math.floor(runTime / 60 / 60 / 24),\n hours = Math.floor(runTime / 60 / 60 - 24 * days),\n minutes = Math.floor(runTime / 60 - 24 * 60 * days - 60 * hours),\n seconds = Math.floor((now - run) / 1000 - 24 * 60 * 60 * days - 60 * 60 * hours - 60 * minutes);\n $runTimes.innerHTML = `${days}, ${String(hours).padStart(2, 0)}:${String(minutes).padStart(2, 0)}:${String(seconds).padStart(2, 0)}`;\n document.querySelector('.site-time .d-none')?.classList.remove('d-none');\n };\n\n initSiteTime() {\n if (this.config.siteTime) {\n this.siteTime = setInterval(this.getSiteTime, 500);\n document.addEventListener('visibilitychange', () => {\n if (document.hidden) {\n return clearInterval(this.siteTime);\n }\n this.siteTime = setInterval(this.getSiteTime, 500);\n }, false);\n }\n }\n\n initServiceWorker() {\n if (this.config.enablePWA && 'serviceWorker' in navigator) {\n navigator.serviceWorker\n .register('/service-worker.min.js', { scope: '/' })\n .then(function (registration) {\n // console.log('Service Worker Registered');\n })\n .catch(function (error) {\n console.error('error: ', error);\n });\n navigator.serviceWorker\n .ready\n .then(function (registration) {\n // console.log('Service Worker Ready');\n });\n }\n }\n\n initWatermark() {\n this.config.watermark?.enable &&\n new Watermark({\n content: this.config.watermark.content || `${document.querySelector('footer .fixit-icon')?.outerHTML ?? ''} FixIt Theme`,\n appendTo: this.config.watermark.appendto || '.wrapper>main',\n opacity: this.config.watermark.opacity,\n width: this.config.watermark.width,\n height: this.config.watermark.height,\n rowSpacing: this.config.watermark.rowspacing,\n colSpacing: this.config.watermark.colspacing,\n rotate: this.config.watermark.rotate,\n fontSize: this.config.watermark.fontsize,\n fontFamily: this.config.watermark.fontfamily\n });\n }\n\n initPangu() {\n if (!this.config.pangu?.enable) {\n return;\n }\n const selector = this.config.pangu.selector;\n if (selector) {\n if (selector.startsWith('#')) {\n pangu.spacingElementById(selector.slice(1));\n } else if (selector.startsWith('.')) {\n pangu.spacingElementByClassName(selector.slice(1));\n } else {\n pangu.spacingElementByTagName(selector)\n }\n return;\n }\n pangu.autoSpacingPage();\n }\n\n initFixItDecryptor() {\n const $tocNodes = document.querySelectorAll('#toc-auto>.d-none, #toc-static.d-none');\n this.decryptor = new FixItDecryptor({\n decrypted: () => {\n this.initTwemoji();\n this.initDetails();\n this.initLightGallery();\n this.initHighlight();\n this.initTable();\n this.initHeaderLink();\n this.initMath();\n this.initMermaid();\n this.initEcharts();\n this.initTypeit();\n this.initMapbox();\n this.util.forEach($tocNodes, ($element) => {\n $element.classList.remove('d-none');\n });\n this.initToc();\n this.initTocListener();\n this.initPangu();\n },\n reset: () => {\n this.util.forEach($tocNodes, ($element) => {\n $element.classList.add('d-none');\n });\n }\n });\n if (this.config.encryption?.shortcode) {\n this.decryptor.addEventListener('decrypted', () => {\n this.decryptor.initShortcodes();\n })\n this.decryptor.initShortcodes();\n }\n this.config.encryption?.all && this.decryptor.init();\n }\n\n initMDevtools() {\n const type = this.config?.mDevtools;\n if (typeof window.orientation === 'undefined') {\n return;\n }\n if (type === 'vConsole') {\n const vConsole = new VConsole({\n target: '.widgets',\n theme: this.isDark ? 'dark' : 'light'\n });\n this._vConsoleOnSwitchTheme = this._vConsoleOnSwitchTheme || (() => {\n vConsole.setOption('theme', this.isDark ? 'dark' : 'light');\n });\n this.switchThemeEventSet.add(this._vConsoleOnSwitchTheme);\n }\n if(type === 'eruda') {\n eruda.init({\n defaults: { theme: this.isDark ? 'Dark' : 'Light' }\n });\n this._erudaOnSwitchTheme = this._erudaOnSwitchTheme || (() => {\n eruda.util.evalCss.setTheme(this.isDark ? 'Dark' : 'Light');\n });\n this.switchThemeEventSet.add(this._erudaOnSwitchTheme);\n }\n }\n\n initAutoMark() {\n if (!this.config.autoBookmark) {\n return;\n }\n window.addEventListener('beforeunload', () => {\n window.localStorage?.setItem(`fixit-bookmark/#${location.pathname}`, this.util.getScrollTop());\n });\n const scrollTop = Number(window.localStorage?.getItem(`fixit-bookmark/#${location.pathname}`));\n // If the page opens with a specific hash, just jump out\n if (scrollTop && location.hash === '') {\n window.scrollTo({ \n top: scrollTop,\n behavior: 'smooth'\n });\n }\n }\n\n initReward() {\n const $rewards = document.querySelectorAll('.post-reward [data-mode=\"fixed\"]');\n if (!$rewards.length) {\n return;\n }\n // `fixed` mode only supports desktop\n if (this.util.isMobile()) {\n this.util.forEach($rewards, ($reward) => {\n $reward.removeAttribute('data-mode');\n });\n return;\n }\n // Close post reward images exclude special id\n const _closeRewardExclude = (id) => {\n this.util.forEach($rewards, ($reward) => {\n const $rewardInput = $reward.parentElement.querySelector('.reward-input');\n if ($rewardInput.id !== id) {\n $rewardInput.checked = false;\n }\n });\n };\n // Add additional click event to reward buttons\n this.util.forEach($rewards, ($reward) => {\n $reward.previousElementSibling.addEventListener('click', function () {\n _closeRewardExclude(this.getAttribute('for'));\n }, false)\n });\n this.scrollEventSet.add(_closeRewardExclude);\n }\n\n onScroll() {\n const $headers = [];\n const ACCURACY = 20;\n const $fixedButtons = document.querySelector('.fixed-buttons');\n const $backToTop = document.querySelector('.back-to-top');\n const $readingProgressBar = document.querySelector('.reading-progress-bar');\n let scrollTimer = void 0;\n if (document.body.dataset.headerDesktop === 'auto') {\n $headers.push(document.getElementById('header-desktop'));\n }\n if (document.body.dataset.headerMobile === 'auto') {\n $headers.push(document.getElementById('header-mobile'));\n }\n // b2t button click event\n $backToTop?.addEventListener('click', () => {\n this.util.scrollIntoView('body');\n });\n window.addEventListener('scroll', (event) => {\n if (this.disableScrollEvent) {\n event.preventDefault();\n return;\n }\n const $mask = document.getElementById('mask');\n this.newScrollTop = this.util.getScrollTop();\n const scroll = this.newScrollTop - this.oldScrollTop;\n // body scrollbar style\n document.body.toggleAttribute('data-scroll', true);\n scrollTimer && window.clearTimeout(scrollTimer);\n scrollTimer = window.setTimeout(() => {\n document.body.toggleAttribute('data-scroll');\n }, 500);\n // header animation\n this.util.forEach($headers, ($header) => {\n if (scroll > ACCURACY) {\n $header.classList.remove('animate__fadeInDown');\n this.util.animateCSS($header, ['animate__fadeOutUp'], true);\n $mask.click();\n } else if (scroll < -ACCURACY) {\n $header.classList.remove('animate__fadeOutUp');\n this.util.animateCSS($header, ['animate__fadeInDown'], true);\n $mask.click();\n }\n });\n const contentHeight = document.body.scrollHeight - window.innerHeight;\n const scrollPercent = Math.max(Math.min(100 * Math.max(this.newScrollTop, 0) / contentHeight, 100), 0);\n if ($readingProgressBar) {\n $readingProgressBar.style.setProperty('--progress', `${scrollPercent.toFixed(2)}%`);\n }\n // whether to show fixed buttons\n if ($fixedButtons) {\n if (scrollPercent > 1) {\n $fixedButtons.classList.remove('d-none', 'animate__fadeOut');\n this.util.animateCSS($fixedButtons, ['animate__fadeIn'], true);\n } else {\n $fixedButtons.classList.remove('animate__fadeIn');\n this.util.animateCSS($fixedButtons, ['animate__fadeOut'], true, () => {\n $fixedButtons.classList.contains('animate__fadeOut') && $fixedButtons.classList.add('d-none');\n });\n }\n if ($backToTop) {\n $backToTop.querySelector('span').innerText = `${Math.round(scrollPercent)}%`;\n }\n }\n for (let event of this.scrollEventSet) {\n event();\n }\n this.oldScrollTop = this.newScrollTop;\n }, false);\n }\n\n onResize() {\n let resizeBefore = this.util.isMobile();\n window.addEventListener('resize', () => {\n if (!this._resizeTimeout) {\n this._resizeTimeout = window.setTimeout(() => {\n this._resizeTimeout = null;\n for (let event of this.resizeEventSet) {\n event();\n }\n this.initToc();\n this.switchMermaidTheme();\n this.initSearch();\n\n const isMobile = this.util.isMobile()\n if (isMobile !== resizeBefore) {\n document.getElementById('mask').click();\n resizeBefore = isMobile;\n }\n }, 100);\n }\n }, false);\n }\n\n onClickMask() {\n document.getElementById('mask').addEventListener('click', () => {\n if (!document.body.classList.contains('blur')) {\n return;\n }\n for (let event of this.clickMaskEventSet) {\n event();\n }\n this.disableScrollEvent = false;\n document.body.classList.remove('blur');\n }, false);\n }\n\n beforeprint() {\n window.addEventListener('beforeprint', () => {\n this.util.forEach(document.querySelectorAll('.chroma'), ($el) => {\n $el.classList.toggle('open', true)\n });\n for (let event of this.beforeprintEventSet) {\n event();\n }\n }, false);\n }\n\n init() {\n try {\n if (this.config.encryption) {\n this.initFixItDecryptor();\n } else if (!this.config.encryption?.all) {\n this.initTwemoji();\n this.initDetails();\n this.initLightGallery();\n this.initHighlight();\n this.initTable();\n this.initHeaderLink();\n this.initMath();\n this.initMermaid();\n this.initEcharts();\n this.initTypeit();\n this.initMapbox();\n this.initPangu();\n }\n this.initThemeColor();\n this.initSVGIcon();\n this.initMenu();\n this.initSwitchTheme();\n this.initSearch();\n this.initCookieconsent();\n this.initSiteTime();\n this.initServiceWorker();\n this.initWatermark();\n this.initMDevtools();\n this.initAutoMark();\n this.initReward();\n\n window.setTimeout(() => {\n this.initComment();\n if (!this.config.encryption?.all) {\n this.initToc();\n this.initTocListener();\n }\n this.onScroll();\n this.onResize();\n this.onClickMask();\n this.beforeprint();\n }, 100);\n } catch (err) {\n console.error(err);\n }\n }\n}\n\nconst themeInit = () => {\n window.fixit = new FixIt();\n window.fixit.init();\n};\n\nif (document.readyState !== 'loading') {\n themeInit();\n} else {\n document.addEventListener('DOMContentLoaded', themeInit, false);\n}\n"],"mappings":"u2FAAMA,KAAI,+FACR,iBAAQC,QAAQ,CAAEC,OAAO,CAAE,CACzBD,QAAQ,CAAGA,QAAQ,EAAI,EAAE,CACzB,IAAK,GAAIE,EAAC,CAAG,CAAC,CAAEA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pB,IAAI,CAACC,YAAY,EAAE,CACnB,IAAI,CAACC,UAAU,EAAE,CAEjBnkB,MAAM,CAAC8Y,UAAU,CAAC,UAAM,2BACtB,OAAI,CAACsL,WAAW,EAAE,CAClB,GAAI,yBAAC,OAAI,CAACxiB,MAAM,CAACse,UAAU,0CAAtB,sBAAwBG,GAAG,EAAE,CAChC,OAAI,CAACP,OAAO,EAAE,CACd,OAAI,CAACC,eAAe,EACtB,CACA,OAAI,CAACsE,QAAQ,EAAE,CACf,OAAI,CAACC,QAAQ,EAAE,CACf,OAAI,CAACC,WAAW,EAAE,CAClB,OAAI,CAACC,WAAW,EAClB,CAAC,CAAE,GAAG,CACR,CAAE,MAAOnf,GAAG,CAAE,CACZC,OAAO,CAACC,KAAK,CAACF,GAAG,CACnB,CACF,CAAC,oBAGH,GAAMof,UAAS,CAAG,QAAZA,UAAS,EAAS,CACtBzkB,MAAM,CAAC0kB,KAAK,CAAG,GAAIjjB,MAAO,CAC1BzB,MAAM,CAAC0kB,KAAK,CAACvP,IAAI,EACnB,CAAC,CAED,GAAIvV,QAAQ,CAACuO,UAAU,GAAK,SAAS,CAAE,CACrCsW,SAAS,EACX,CAAC,IAAM,CACL7kB,QAAQ,CAACe,gBAAgB,CAAC,kBAAkB,CAAE8jB,SAAS,CAAE,KAAK,CAChE"} \ No newline at end of file diff --git a/assets/lib/VERSION b/assets/lib/VERSION index dcfc6fd4..1738592c 100644 --- a/assets/lib/VERSION +++ b/assets/lib/VERSION @@ -1,7 +1,7 @@ algoliasearch@4.14.2 https://github.com/algolia/algoliasearch-client-javascript animate.css@4.1.1 https://github.com/daneden/animate.css aplayer@1.10.1 https://github.com/MoePlayer/APlayer -artalk@2.3.4 https://github.com/ArtalkJS/Artalk +artalk@2.5.2 https://github.com/ArtalkJS/Artalk autocomplete-js@0.38.1 https://github.com/algolia/autocomplete cell-watermark@1.0.3 https://github.com/Lruihao/watermark cookieconsent@3.1.1 https://github.com/osano/cookieconsent diff --git a/assets/lib/artalk/Artalk.css b/assets/lib/artalk/Artalk.css new file mode 100644 index 00000000..d11bf445 --- /dev/null +++ b/assets/lib/artalk/Artalk.css @@ -0,0 +1 @@ +@charset "UTF-8";.artalk,.atk-layer-wrap{--at-color-font: #2a2e2e;--at-color-deep: #2a2e2e;--at-color-sub: #757575;--at-color-grey: #747474;--at-color-meta: #697182;--at-color-border: #eceff2;--at-color-light: #4285f4;--at-color-bg: #FFF;--at-color-bg-transl: rgba(255, 255, 255, .94);--at-color-bg-grey: #f3f4f5;--at-color-bg-grey-transl: rgba(244, 244, 244, .75);--at-color-bg-light: rgba(29, 161, 242, .1);--at-color-main: #0083ff;--at-color-red: #ff5652;--at-color-pink: #fa5a57;--at-color-yellow: #ff7c37;--at-color-green: #4caf50;--at-color-gradient: linear-gradient(180deg, transparent, rgba(255, 255, 255))}.artalk.atk-dark-mode,.atk-layer-wrap.atk-dark-mode{--at-color-font: #fff;--at-color-deep: #e7e7e7;--at-color-sub: #e7e7e7;--at-color-grey: #fff;--at-color-meta: #fff;--at-color-border: #2d3235;--at-color-light: #687a86;--at-color-bg: #1e2224;--at-color-bg-transl: rgba(30, 34, 36, .95);--at-color-bg-grey: #46494e;--at-color-bg-grey-transl: rgba(8, 8, 8, .95);--at-color-bg-light: rgba(29, 161, 242, .1);--at-color-main: #0083ff;--at-color-red: #ff5652;--at-color-pink: #fa5a57;--at-color-yellow: #ff7c37;--at-color-green: #4caf50;--at-color-gradient: linear-gradient(180deg, transparent, rgba(30, 34, 36, 1))}.atk-comment-wrap{overflow:hidden;position:relative;border-bottom:1px solid transparent}.atk-comment-wrap.atk-flash-once{animation:atkFlashOnce 1s ease-in-out 0s}@keyframes atkFlashOnce{0%{background:rgba(0,131,255,.2)}to{background:transparent}}.atk-comment-wrap.atk-unread:before{content:" ";position:absolute;left:0;top:10%;width:3px;height:80%;background:var(--at-color-main)}.atk-comment-wrap.atk-openable{cursor:pointer}.atk-comment-wrap.atk-openable:hover{background:var(--at-color-bg-grey)}.atk-comment-wrap.atk-openable .atk-height-limit:after{background:transparent!important}.atk-comment-wrap:last-child{border-bottom:none}.atk-comment{display:block;padding:12px 10px}.atk-comment>.atk-avatar{display:block;padding:2px 0;float:left}.atk-comment>.atk-avatar img{width:50px;height:50px;border-radius:3px}.atk-comment>.atk-main{display:block;margin-left:63px}.atk-comment>.atk-main>.atk-header{line-height:1.5;font-size:13px;margin-bottom:.5em;overflow:hidden;position:relative;display:flex;flex-wrap:wrap;align-items:center}.atk-comment>.atk-main>.atk-header .atk-item{display:flex;align-items:center;margin-top:2px;margin-bottom:2px;color:var(--at-color-meta)}.atk-comment>.atk-main>.atk-header .atk-item:not(:last-child){margin-right:6px}.atk-comment>.atk-main>.atk-header .atk-item.atk-nick,.atk-comment>.atk-main>.atk-header .atk-item.atk-nick a{font-size:14px;color:var(--at-color-main);text-decoration:none}.atk-comment>.atk-main>.atk-header .atk-item.atk-reply-at{margin-left:2px}.atk-comment>.atk-main>.atk-header .atk-item.atk-reply-at>.atk-arrow:before{content:"";vertical-align:middle;transform:rotate(90deg);border-bottom:4px solid var(--at-color-grey);border-left:3px solid transparent;border-right:3px solid transparent;display:inline-block;margin-top:-1px}.atk-comment>.atk-main>.atk-header .atk-item.atk-reply-at>.atk-nick{color:var(--at-color-main);cursor:pointer;margin-left:6px}.atk-comment>.atk-main>.atk-header .badge,.atk-comment>.atk-main>.atk-header .atk-ua,.atk-comment>.atk-main>.atk-header .atk-pinned-badge,.atk-comment>.atk-main>.atk-header .atk-region-badge,.atk-comment>.atk-main>.atk-header .atk-badge{display:inline-block;color:var(--at-color-meta);background:var(--at-color-bg-grey);padding:0 6px;line-height:17px;border-radius:3px}.atk-comment>.atk-main>.atk-header .badge:not(:last-child),.atk-comment>.atk-main>.atk-header .atk-ua:not(:last-child),.atk-comment>.atk-main>.atk-header .atk-pinned-badge:not(:last-child),.atk-comment>.atk-main>.atk-header .atk-region-badge:not(:last-child),.atk-comment>.atk-main>.atk-header .atk-badge:not(:last-child){margin-right:6px}.atk-comment>.atk-main>.atk-header .atk-badge-wrap>*:last-child{margin-right:6px}.atk-comment>.atk-main>.atk-header .atk-badge{color:#fff}.atk-comment>.atk-main>.atk-header .atk-pinned-badge{color:#fff;background:#f44336}@media only screen and (max-width: 768px){.atk-comment>.atk-main>.atk-header .atk-ua-wrap{display:block}}.atk-comment>.atk-main>.atk-body{display:block;overflow:hidden;position:relative}.atk-comment>.atk-main>.atk-body img{max-width:100%}.atk-comment>.atk-main>.atk-body>.atk-content{word-break:break-all}.atk-comment>.atk-main>.atk-body>.atk-content.atk-type-collapsed{border:3px solid var(--at-color-bg-grey);border-bottom:0;padding:5px 10px;border-radius:6px 6px 0 0;margin-bottom:-5px}.atk-comment>.atk-main>.atk-body>.atk-content>*:first-child{margin-top:0}.atk-comment>.atk-main>.atk-body>.atk-content>*:last-child{margin-bottom:0}.atk-comment>.atk-main>.atk-body>.atk-content .atk-height-limit-btn{bottom:5px}.atk-comment>.atk-main>.atk-body>.atk-pending{color:var(--at-color-meta);margin:3px 0;font-size:13px;padding:10px 18px;display:block;background:var(--at-color-bg-grey);border-left:4px solid #f44336}.atk-comment>.atk-main>.atk-body>.atk-reply-to{padding:5px 15px;border-left:3px solid var(--at-color-border);margin-bottom:10px;position:relative;margin-top:10px}.atk-comment>.atk-main>.atk-body>.atk-reply-to .atk-meta{font-size:15px}.atk-comment>.atk-main>.atk-body>.atk-reply-to .atk-meta .atk-nick{color:var(--at-color-main)}.atk-comment>.atk-main>.atk-body>.atk-reply-to .atk-content{margin-top:5px}.atk-comment>.atk-main>.atk-body>.atk-collapsed{margin:3px 0;font-size:13px;padding:10px 18px;display:block;background:var(--at-color-bg-grey);border-radius:6px}.atk-comment>.atk-main>.atk-body>.atk-collapsed .atk-text{color:var(--at-color-meta)}.atk-comment>.atk-main>.atk-body>.atk-collapsed .atk-show-btn{color:var(--at-color-main);cursor:pointer;-webkit-user-select:none;-moz-user-select:none;user-select:none;margin-left:3px}.atk-comment>.atk-main>.atk-body>.atk-collapsed .atk-show-btn:hover{color:var(--at-color-main)}.atk-comment>.atk-main>.atk-footer{margin-top:12px}.atk-comment>.atk-main>.atk-footer .atk-actions{display:flex;flex-direction:row;align-items:center;flex-wrap:wrap;margin-bottom:-15px}.atk-comment>.atk-main>.atk-footer .atk-actions>span{color:var(--at-color-meta);font-size:13px;line-height:15px;display:inline-flex;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;user-select:none;margin-bottom:15px}.atk-comment>.atk-main>.atk-footer .atk-actions>span.atk-error,.atk-comment>.atk-main>.atk-footer .atk-actions>span.atk-error:hover{color:var(--at-color-red)}.atk-comment>.atk-main>.atk-footer .atk-actions>span:not(:last-child):not(.atk-hide){margin-right:16px}.atk-comment>.atk-main>.atk-footer .atk-actions>span:hover{color:var(--at-color-deep)}.atk-comment .atk-height-limit:after{position:absolute;z-index:1;display:block;overflow:hidden;width:100%;content:" ";bottom:0;height:80px;background:var(--at-color-gradient)}.atk-comment .atk-height-limit-btn{z-index:10;position:absolute;left:50%;bottom:10px;transform:translate(-50%);cursor:pointer;border:1px solid var(--at-color-border);border-radius:6px;background:var(--at-color-bg);padding:1px 20px;font-size:15px;color:var(--at-color-meta);-webkit-user-select:none;-moz-user-select:none;user-select:none}.atk-comment .atk-height-limit-btn:hover{background:var(--at-color-bg-grey)}.atk-comment .atk-height-limit .atk-height-limit .atk-height-limit-btn{display:none}.atk-comment .atk-height-limit-scroll{margin-top:10px;overflow-y:auto;background:linear-gradient(var(--at-color-bg) 1px,transparent 1px calc(100% - 1px)) center top,linear-gradient(transparent calc(100% - 1px),var(--at-color-bg) calc(100% - 1px) 1px) center bottom,linear-gradient(var(--at-color-border) 1px,transparent 1px calc(100% - 1px)) center top,linear-gradient(transparent calc(100% - 1px),var(--at-color-border) calc(100% - 1px) 1px) center bottom;background-repeat:no-repeat;background-color:transparent;background-size:100% 1px,100% 1px,100% 1px,100% 1px;background-attachment:local,local,scroll,scroll}.atk-comment-children>.atk-comment-wrap{margin-top:10px;border-left:1px dashed transparent;border-bottom-color:transparent}.atk-comment-children>.atk-comment-wrap:not(:last-child){margin-bottom:5px}.atk-comment-children>.atk-comment-wrap>.atk-comment{padding:4px 0}.atk-comment-children>.atk-comment-wrap>.atk-comment>.atk-avatar img{width:36px;height:36px}.atk-comment-children>.atk-comment-wrap>.atk-comment>.atk-main{margin-left:47px}.artalk>.atk-list{position:relative}.artalk>.atk-list>.atk-list-header{display:flex;flex-direction:row;padding:10px 17px}.artalk>.atk-list>.atk-list-header .atk-text{display:inline-block}.artalk>.atk-list>.atk-list-header .atk-dropdown-wrap{position:relative;cursor:pointer}.artalk>.atk-list>.atk-list-header .atk-dropdown-wrap .atk-arrow-down-icon{cursor:pointer;vertical-align:middle;border-top:5px solid var(--at-color-grey);border-left:3px solid transparent;border-right:3px solid transparent;margin-top:-1px;margin-left:.8rem;display:inline-block}.artalk>.atk-list>.atk-list-header .atk-dropdown-wrap:hover .atk-dropdown{display:block}.artalk>.atk-list>.atk-list-header .atk-dropdown-wrap .atk-dropdown{z-index:888;display:none;height:auto!important;max-height:calc(100vh - 2.7rem);overflow-y:auto;position:absolute;top:100%;right:0;width:100%;background-color:var(--at-color-bg);padding:.6rem 0;border:1px solid var(--at-color-border);text-align:center;border-radius:6px;white-space:nowrap;margin:0;list-style:none}.artalk>.atk-list>.atk-list-header .atk-dropdown-wrap .atk-dropdown-item span,.artalk>.atk-list>.atk-list-header .atk-dropdown-wrap .atk-dropdown-item a{display:block;line-height:2rem;position:relative;border-bottom:none;font-weight:400;padding:0 1.5rem}.artalk>.atk-list>.atk-list-header .atk-dropdown-wrap .atk-dropdown-item span:hover,.artalk>.atk-list>.atk-list-header .atk-dropdown-wrap .atk-dropdown-item a:hover{color:var(--at-color-main)}.artalk>.atk-list>.atk-list-header .atk-dropdown-wrap .atk-dropdown-item.active span,.artalk>.atk-list>.atk-list-header .atk-dropdown-wrap .atk-dropdown-item a{color:var(--at-color-main)}.artalk>.atk-list>.atk-list-header .atk-comment-count{font-size:15px}.artalk>.atk-list>.atk-list-header .atk-comment-count .atk-comment-count-num{font-size:22px;margin-right:4px}.artalk>.atk-list>.atk-list-header .atk-right-action{display:flex;flex:1;flex-direction:row;align-items:center;justify-content:flex-end}.artalk>.atk-list>.atk-list-header .atk-right-action>span{font-size:14px;color:var(--at-color-meta);cursor:pointer;-webkit-user-select:none;-moz-user-select:none;user-select:none;position:relative}.artalk>.atk-list>.atk-list-header .atk-right-action>span.atk-on,.artalk>.atk-list>.atk-list-header .atk-right-action>span.atk-on *{color:var(--at-color-main)}.artalk>.atk-list>.atk-list-header .atk-right-action>span:not(:last-child):not(.atk-hide){margin-right:10px;padding-right:10px}.artalk>.atk-list>.atk-list-header .atk-right-action>span .atk-unread-badge{position:absolute;top:-5px;left:-6px;color:#fff;background:var(--at-color-pink);text-align:center;min-width:16px;height:16px;padding:0 3px;border-radius:8px;line-height:16px;font-size:12px}.artalk>.atk-list>.atk-list-body{min-height:150px}.artalk>.atk-list>.atk-list-footer{z-index:1;position:absolute;bottom:5px;right:0}@media only screen and (max-width: 768px){.artalk>.atk-list>.atk-list-footer{position:relative;margin-top:10px;text-align:center}}.artalk>.atk-list>.atk-list-footer .atk-copyright{display:block;font-size:12px;color:var(--at-color-meta);padding-right:15px;margin-top:5px}.artalk>.atk-list>.atk-list-footer .atk-copyright a{color:var(--at-color-main);text-decoration:none}.atk-list-no-comment{height:150px;display:flex;font-size:19px;justify-content:center;align-items:center;word-break:break-word;text-align:center}.atk-list-read-more{border-top:1px dashed var(--at-color-border);margin-top:28px;padding-bottom:25px}@media only screen and (max-width: 768px){.atk-list-read-more{padding-bottom:10px}}.atk-list-read-more.atk-err .atk-text{color:var(--at-color-red)!important}.atk-list-read-more .atk-list-read-more-inner{cursor:pointer;-webkit-user-select:none;-moz-user-select:none;user-select:none;padding:0 15px;font-size:14px;border-radius:6px;border:1px solid transparent;display:flex;height:30px;flex-direction:row;place-content:center;align-items:center;width:120px;margin:-15px auto 0;background:var(--at-color-bg);border-color:var(--at-color-border)}.atk-list-read-more .atk-list-read-more-inner>.atk-loading-icon{height:15px;width:15px}.atk-list-read-more .atk-list-read-more-inner>.atk-text{color:var(--at-color-meta)}.atk-list-read-more .atk-list-read-more-inner:hover{background:var(--at-color-bg-grey)}.atk-pagination{display:flex;flex-direction:row;justify-content:center;padding:10px 0;position:relative}.atk-pagination>.atk-btn,.atk-pagination>.atk-input{font-size:15px;height:30px;border:1px solid var(--at-color-border);border-radius:3px;padding:0 5px;text-align:center;background:var(--at-color-bg)}.atk-pagination>.atk-btn{-webkit-user-select:none;-moz-user-select:none;user-select:none;width:70px;cursor:pointer;display:flex;justify-content:center;align-items:center}.atk-pagination>.atk-btn:hover{background:var(--at-color-bg-grey)}.atk-pagination>.atk-btn.atk-disabled{color:var(--at-color-sub)}.atk-pagination>.atk-btn.atk-disabled:hover{cursor:default;background:initial}.atk-pagination>.atk-input{background:transparent;color:var(--at-color-font);font-size:18px;width:60px;outline:none}.atk-pagination>.atk-input:focus{border-color:var(--at-color-main)}.atk-pagination>*:not(:last-child){margin-right:10px}.atk-main-editor{z-index:5;position:relative;overflow:hidden;background:var(--at-color-bg);border:1px solid var(--at-color-border);border-radius:6px;margin-bottom:10px}@media only screen and (max-width: 768px){.atk-main-editor{margin-bottom:7px}}.atk-main-editor>.atk-header{display:flex;flex-direction:row;padding:10px 14px 0}.atk-main-editor>.atk-header input{flex:1;width:100%;font-size:14px;background:transparent;border:2px solid transparent;border-radius:3px;padding:6px 5px;resize:none;outline:none}.atk-main-editor>.atk-header input:not(:last-child){margin-right:2px}.atk-main-editor>.atk-textarea-wrap{position:relative}.atk-main-editor>.atk-textarea-wrap>.atk-textarea{display:block;overflow:hidden;color:var(--at-color-font);font-size:15px;background-color:var(--at-color-bg);border:2px solid transparent;border-radius:3px;width:100%;min-height:120px;margin-top:2px;padding:10px 20px;resize:none;word-wrap:break-word;outline:none}.atk-main-editor>.atk-textarea-wrap>.atk-comment-closed{pointer-events:none;color:var(--at-color-meta);font-size:12px;background-color:var(--at-color-bg);border-top:1px solid var(--at-color-border);padding:5px 15px;margin-top:10px}.atk-main-editor>.atk-textarea-wrap>.atk-send-reply{z-index:2;position:absolute;right:7px;bottom:2px;max-width:calc(100% - 20px);height:30px;line-height:30px;font-size:14px;background:var(--at-color-bg-grey-transl);padding:0 30px 0 10px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;cursor:pointer;border-radius:3px}.atk-main-editor>.atk-textarea-wrap>.atk-send-reply .atk-cancel{position:absolute;right:0;bottom:0;height:30px;text-align:center;width:30px;line-height:30px;font-weight:700}.atk-main-editor>.atk-textarea-wrap>.atk-send-reply .atk-cancel:hover{color:var(--at-color-deep)}.atk-main-editor>.atk-plug-panel-wrap{position:relative;height:180px;width:100%;overflow:hidden;border-top:1px solid var(--at-color-border);animation:.3s both atkFadeIn;transition:.2s height ease-in-out}.atk-main-editor>.atk-bottom{display:flex;flex-direction:row;justify-content:space-between;padding:5px 5px 5px 10px}.atk-main-editor>.atk-bottom>.atk-item{display:flex;flex-direction:row;align-items:center}.atk-main-editor>.atk-bottom .atk-plug-btn{padding:0 8px;line-height:24px;cursor:pointer;color:var(--at-color-grey);font-size:14px;-webkit-user-select:none;-moz-user-select:none;user-select:none;border-radius:3px}.atk-main-editor>.atk-bottom .atk-plug-btn:not(:last-child){margin-right:2px}.atk-main-editor>.atk-bottom .atk-plug-btn:hover{background:var(--at-color-bg-grey)}.atk-main-editor>.atk-bottom .atk-plug-btn.active{color:var(--at-color-main)}.atk-main-editor>.atk-bottom .atk-plug-btn.active svg.markdown path{fill:var(--at-color-main)}.atk-main-editor>.atk-bottom .atk-plug-btn i{color:var(--at-color-grey);display:inline-flex;vertical-align:sub;margin-left:4px}.atk-main-editor>.atk-bottom .atk-plug-btn i svg.markdown path{fill:var(--at-color-grey)}.atk-main-editor>.atk-bottom .atk-send-btn{background:var(--at-color-main);color:#fff;font-size:14px;border:none;margin:0;height:30px;width:8em;cursor:pointer;transition:opacity .3s ease-in-out;outline:none;border-radius:3px}.atk-main-editor>.atk-bottom .atk-send-btn:active{opacity:.9}.atk-main-editor>.atk-notify-wrap{z-index:9;position:absolute;right:-2px;bottom:40px;width:225px;opacity:.83}.atk-sidebar-layer{position:fixed;z-index:99999;top:0;right:0;width:430px;height:100%;background:var(--at-color-bg);transition:transform .45s cubic-bezier(.23,1,.32,1) 0ms;transform:translate(430px)}@media only screen and (max-width: 430px){.atk-sidebar-layer{width:100%}}.atk-sidebar-layer .atk-sidebar-inner{position:relative;height:100%}.atk-sidebar-layer .atk-sidebar-header{position:absolute;top:0;right:0;display:flex;flex-direction:row;align-items:center;z-index:99999}.atk-sidebar-layer .atk-sidebar-header .atk-sidebar-close{display:flex;flex-direction:column;width:60px;height:60px;align-items:center;place-content:center;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;user-select:none;margin-left:10px}.atk-sidebar-layer .atk-sidebar-header .atk-sidebar-close:hover .atk-icon-close{background-color:#e81123e6}.atk-sidebar-layer .atk-sidebar-iframe-wrap{height:100%;position:relative}.atk-sidebar-layer .atk-sidebar-iframe-wrap iframe{border:0;width:100%;height:100%}.atk-sidebar-layer .atk-sidebar-iframe-wrap .atk-err-alert{z-index:9999;top:50%;left:50%;transform:translate(-50%,-50%);position:absolute;background:var(--at-color-bg);padding:40px 30px;width:80%;text-align:center;border-radius:4px}.atk-sidebar-layer .atk-sidebar-iframe-wrap .atk-err-alert .atk-title{font-size:1.4em;margin-bottom:20px;color:var(--at-color-font)}.atk-sidebar-layer .atk-sidebar-iframe-wrap .atk-err-alert .atk-text{color:var(--at-color-font)}.atk-sidebar-layer .atk-sidebar-iframe-wrap .atk-err-alert .atk-text span{cursor:pointer;color:var(--at-color-main)}.artalk{position:relative;width:100%;min-height:200px}.artalk,.atk-layer-wrap{color:var(--at-color-font);word-wrap:break-word;word-break:break-word}.artalk *,.atk-layer-wrap *{box-sizing:border-box}.artalk input,.artalk textarea,.artalk button,.artalk optgroup,.artalk select,.atk-layer-wrap input,.atk-layer-wrap textarea,.atk-layer-wrap button,.atk-layer-wrap optgroup,.atk-layer-wrap select{font-family:inherit;color:inherit;font-size:inherit}.artalk code,.atk-layer-wrap code{font-family:source code pro,Consolas,Monaco,Menlo,sans-serif;margin:0 .05em;padding:0 .4em;display:inline-block;vertical-align:middle;font-size:.9em;background-color:var(--at-color-bg-grey);color:var(--at-color-font);border-radius:2px}.artalk pre,.atk-layer-wrap pre{margin:10px 0 0;padding:0;line-height:0}.artalk pre code,.atk-layer-wrap pre code{line-height:1.6em;display:block;padding:10px 15px;white-space:pre-wrap!important;background-color:var(--at-color-bg-grey);color:var(--at-color-font);margin:0}.artalk pre code *,.atk-layer-wrap pre code *{font-family:source code pro,Consolas,Monaco,Menlo,sans-serif}.artalk a,.atk-layer-wrap a{color:var(--at-color-main);text-decoration:none}.artalk blockquote,.atk-layer-wrap blockquote{position:static;margin:10px 0;padding:10px 20px;background:var(--at-color-bg-grey);border-left:4px solid #687a86;color:var(--at-color-font)}.artalk p:first-child,.atk-layer-wrap p:first-child{margin-top:0}.artalk p:last-child,.atk-layer-wrap p:last-child{margin-bottom:0}.artalk img,.atk-layer-wrap img{max-width:100%}.artalk table,.atk-layer-wrap table{width:100%;border-collapse:collapse;border-spacing:0;margin-bottom:1.5em;font-size:.96em}.artalk td,.artalk th,.atk-layer-wrap td,.atk-layer-wrap th{text-align:left;padding:4px 8px 4px 10px;border:1px solid var(--at-color-border)}.artalk td,.atk-layer-wrap td{vertical-align:top}.artalk tr:nth-child(even),.atk-layer-wrap tr:nth-child(even){background-color:var(--at-color-bg-grey)}.artalk ul,.atk-layer-wrap ul{list-style:disc}.artalk ol,.atk-layer-wrap ol{list-style:decimal}.artalk li+li,.atk-layer-wrap li+li{margin-top:8px}.artalk li>ol,.artalk li>ul,.atk-layer-wrap li>ol,.atk-layer-wrap li>ul{margin:8px 0 0}.atk-hide{display:none!important}.atk-full-layer,.atk-layer-dialog-wrap,.atk-error-layer,.atk-loading{width:100%;height:100%;position:absolute;top:0;left:0;background:var(--at-color-bg);z-index:10;align-items:center;justify-content:center;flex-flow:column;display:flex}.atk-loading{z-index:11}.atk-loading-spinner{position:relative;width:50px;height:50px}.atk-loading-spinner svg{animation:atkRotate 2s linear infinite;transform-origin:center center;width:100%;height:100%;position:absolute;top:0;left:0}.atk-loading-spinner svg circle{stroke-dasharray:1,200;stroke-dashoffset:0;animation:atkDash 1.5s ease-in-out infinite,atkColor 6s ease-in-out infinite;stroke-linecap:round}@keyframes atkRotate{to{transform:rotate(360deg)}}@keyframes atkDash{0%{stroke-dasharray:1,200;stroke-dashoffset:0}50%{stroke-dasharray:89,200;stroke-dashoffset:-35px}to{stroke-dasharray:89,200;stroke-dashoffset:-124px}}@keyframes atkColor{0%,to{stroke:#ff5652}40%{stroke:#2196f3}66%{stroke:#32c787}80%,90%{stroke:#ffc107}}@keyframes atkLoadingIconRotate{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.atk-loading-icon{width:18px;height:18px;box-sizing:border-box;border:solid 1px transparent;border-top-color:#29d;border-left-color:#29d;border-radius:50%;animation:atkLoadingIconRotate .4s linear infinite}.atk-fade-in{animation:atkFadeIn both .3s}.atk-fade-out{animation:atkFadeOut both .2s}.atk-rotate{animation:atkRotate 2s linear infinite}@keyframes atkFadeIn{0%{opacity:0}to{opacity:1}}@keyframes atkFadeOut{to{opacity:0}}@keyframes atkRotate{0%{transform:rotate(0)}to{transform:rotate(360deg)}}i.atk-icon{width:20px;height:20px;background-color:var(--at-color-deep);background-size:contain;background-repeat:no-repeat;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-position:center;mask-position:center;-webkit-mask-size:contain;mask-size:contain}.atk-icon-sync{-webkit-mask-image:url("data:image/svg+xml,%3Csvg width='20' height='20' viewBox='0 0 20 20' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M4.99133 4.87635C2.22512 7.64257 2.22512 12.1275 4.99133 14.8937C6.04677 15.9491 7.3524 16.6019 8.71732 16.8519' stroke='%234E5969' stroke-width='2'/%3E%3Cpath d='M14.4179 15.4815L15.0072 14.8922C17.7734 12.126 17.7734 7.64107 15.0072 4.87486C13.9518 3.81942 12.6461 3.16668 11.2812 2.91664' stroke='%234E5969' stroke-width='2'/%3E%3Cpath d='M6.17106 4.99252L5.58181 4.40327L4.99255 3.81401H6.17106V4.99252Z' fill='%23C4C4C4' stroke='%234E5969' stroke-width='2'/%3E%3Cpath d='M13.8299 15.0084L14.4192 15.5976L15.0084 16.1869H13.8299V15.0084Z' fill='%23C4C4C4' stroke='%234E5969' stroke-width='2'/%3E%3C/svg%3E");mask-image:url("data:image/svg+xml,%3Csvg width='20' height='20' viewBox='0 0 20 20' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M4.99133 4.87635C2.22512 7.64257 2.22512 12.1275 4.99133 14.8937C6.04677 15.9491 7.3524 16.6019 8.71732 16.8519' stroke='%234E5969' stroke-width='2'/%3E%3Cpath d='M14.4179 15.4815L15.0072 14.8922C17.7734 12.126 17.7734 7.64107 15.0072 4.87486C13.9518 3.81942 12.6461 3.16668 11.2812 2.91664' stroke='%234E5969' stroke-width='2'/%3E%3Cpath d='M6.17106 4.99252L5.58181 4.40327L4.99255 3.81401H6.17106V4.99252Z' fill='%23C4C4C4' stroke='%234E5969' stroke-width='2'/%3E%3Cpath d='M13.8299 15.0084L14.4192 15.5976L15.0084 16.1869H13.8299V15.0084Z' fill='%23C4C4C4' stroke='%234E5969' stroke-width='2'/%3E%3C/svg%3E")}.atk-icon-del{background-color:var(--at-color-red)!important;-webkit-mask-image:url("data:image/svg+xml,%3Csvg width='22' height='22' viewBox='0 0 22 22' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M2.29167 5.04166L4.81251 5.04166M4.81251 5.04166L4.81251 18.3333C4.81251 18.5865 5.01771 18.7917 5.27084 18.7917L16.7292 18.7917C16.9823 18.7917 17.1875 18.5865 17.1875 18.3333V5.04166M4.81251 5.04166L7.33334 5.04166M17.1875 5.04166L19.7083 5.04166M17.1875 5.04166L14.6667 5.04166M7.33334 5.04166V3.20833L14.6667 3.20833V5.04166M7.33334 5.04166L14.6667 5.04166' stroke='%23D06565' stroke-width='2'/%3E%3Cpath d='M9.16667 8.25V15.125M12.8333 8.25V15.125' stroke='%23D06565' stroke-width='2'/%3E%3C/svg%3E");mask-image:url("data:image/svg+xml,%3Csvg width='22' height='22' viewBox='0 0 22 22' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M2.29167 5.04166L4.81251 5.04166M4.81251 5.04166L4.81251 18.3333C4.81251 18.5865 5.01771 18.7917 5.27084 18.7917L16.7292 18.7917C16.9823 18.7917 17.1875 18.5865 17.1875 18.3333V5.04166M4.81251 5.04166L7.33334 5.04166M17.1875 5.04166L19.7083 5.04166M17.1875 5.04166L14.6667 5.04166M7.33334 5.04166V3.20833L14.6667 3.20833V5.04166M7.33334 5.04166L14.6667 5.04166' stroke='%23D06565' stroke-width='2'/%3E%3Cpath d='M9.16667 8.25V15.125M12.8333 8.25V15.125' stroke='%23D06565' stroke-width='2'/%3E%3C/svg%3E")}.atk-icon-edit{-webkit-mask-image:url("data:image/svg+xml,%3Csvg width='16' height='17' viewBox='0 0 16 17' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M9.70618 4.08515L12.6081 7.06376M1.00041 13.021L11.7376 2L14.6392 4.97861L3.90274 16H1L1.00041 13.021Z' stroke='%234E5969' stroke-width='1.5'/%3E%3C/svg%3E");mask-image:url("data:image/svg+xml,%3Csvg width='16' height='17' viewBox='0 0 16 17' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M9.70618 4.08515L12.6081 7.06376M1.00041 13.021L11.7376 2L14.6392 4.97861L3.90274 16H1L1.00041 13.021Z' stroke='%234E5969' stroke-width='1.5'/%3E%3C/svg%3E")}.atk-icon-no,.atk-icon-close{-webkit-mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='25' height='25' viewBox='0 0 25 25' fill='none'%3E%3Cpath d='M19.8657 5.13431L12.5 12.5L5.13431 19.8657' stroke='%234E5969'/%3E%3Cpath d='M5.13431 5.13432L12.5 12.5L19.8657 19.8657' stroke='%234E5969'/%3E%3C/svg%3E");mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='25' height='25' viewBox='0 0 25 25' fill='none'%3E%3Cpath d='M19.8657 5.13431L12.5 12.5L5.13431 19.8657' stroke='%234E5969'/%3E%3Cpath d='M5.13431 5.13432L12.5 12.5L19.8657 19.8657' stroke='%234E5969'/%3E%3C/svg%3E")}.atk-icon-yes{-webkit-mask-image:url("data:image/svg+xml,%3Csvg width='25' height='25' viewBox='0 0 25 25' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M21.7071 5.75533L9.92197 17.5404L3.29285 10.9113' stroke='%234E5969'/%3E%3C/svg%3E");mask-image:url("data:image/svg+xml,%3Csvg width='25' height='25' viewBox='0 0 25 25' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M21.7071 5.75533L9.92197 17.5404L3.29285 10.9113' stroke='%234E5969'/%3E%3C/svg%3E")}.atk-icon-plus{-webkit-mask-image:url("data:image/svg+xml,%3Csvg width='20' height='20' viewBox='0 0 20 20' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M2.08331 10H17.9166' stroke='%234E5969' stroke-width='2'/%3E%3Cpath d='M10 2.08334L10 17.9167' stroke='%234E5969' stroke-width='2'/%3E%3C/svg%3E");mask-image:url("data:image/svg+xml,%3Csvg width='20' height='20' viewBox='0 0 20 20' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M2.08331 10H17.9166' stroke='%234E5969' stroke-width='2'/%3E%3Cpath d='M10 2.08334L10 17.9167' stroke='%234E5969' stroke-width='2'/%3E%3C/svg%3E")}.atk-error-layer{background-color:var(--at-color-bg-transl)}.atk-error-layer .atk-error-title{color:var(--at-color-red)}.atk-error-layer .atk-warn-title{color:var(--at-color-yellow)}.atk-error-layer .atk-error-title,.atk-error-layer .atk-warn-title{display:inline-block;padding:0 15px;margin-bottom:20px;font-size:20px;letter-spacing:-.5px}.atk-error-layer .atk-error-text{text-align:center;padding:0 20px}.atk-error-layer .atk-error-text *{color:var(--at-color-deep)}.atk-error-layer .atk-error-text a{color:var(--at-color-meta)}.atk-layer-dialog-wrap{background-color:var(--at-color-bg-transl)}.atk-layer-dialog-wrap>.atk-layer-dialog{width:25%}.atk-layer-dialog-wrap>.atk-layer-dialog>.atk-layer-dialog-content .atk-captcha-img{cursor:pointer;width:170px;height:auto;margin-right:10px;padding-right:10px;border-right:1px solid var(--at-color-border);vertical-align:bottom}.atk-layer-dialog-wrap>.atk-layer-dialog>.atk-layer-dialog-content input{width:100%;line-height:34px;background-color:var(--at-color-bg);border:1px solid var(--at-color-border);border-radius:3px;outline:none;padding:0 6px;display:block;margin-top:10px;margin-bottom:5px;text-align:center}.atk-layer-dialog-wrap>.atk-layer-dialog>.atk-layer-dialog-actions{display:flex;flex-direction:row}.atk-layer-dialog-wrap>.atk-layer-dialog>.atk-layer-dialog-actions button{flex:1;display:block;cursor:pointer;border:1px solid var(--at-color-main);background:transparent;color:var(--at-color-main);border-radius:3px;padding:0 15px;line-height:30px;outline:none}.atk-layer-dialog-wrap>.atk-layer-dialog>.atk-layer-dialog-actions button:active{color:#fff;background:var(--at-color-main)}.atk-layer-dialog-wrap>.atk-layer-dialog>.atk-layer-dialog-actions button:not(:last-child){margin-right:5px}.atk-layer-dialog-wrap>.atk-layer-dialog>.atk-layer-dialog-actions button.error{color:#fff;background:#ff5652;border-color:#ff5652}.atk-layer-dialog-wrap>.atk-layer-dialog .atk-checker-iframe-wrap{position:fixed;z-index:999998;left:0;top:0;height:100vh;width:100vw}.atk-layer-dialog-wrap>.atk-layer-dialog .atk-checker-iframe-wrap>iframe{width:100%;height:100%;border:0}.atk-layer-dialog-wrap>.atk-layer-dialog .atk-checker-iframe-wrap .atk-close-btn{z-index:999999;position:fixed;top:20px;right:20px;display:flex;flex-direction:column;width:50px;height:50px;align-items:center;place-content:center;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;user-select:none;margin-left:10px}.atk-layer-dialog-wrap>.atk-layer-dialog .atk-checker-iframe-wrap .atk-close-btn:hover .atk-icon-close{background-color:#e81123e6}@media only screen and (max-width: 768px){.atk-layer-dialog-wrap>.atk-layer-dialog{width:90%!important}}.atk-notify{display:block;overflow:hidden;background-color:#2c2c2c;color:#fff;border-radius:3px;cursor:pointer;font-size:14px;padding:5px 15px}.atk-notify:not(:last-child){margin-bottom:3px}.atk-notify .atk-notify-content{color:#fff}.atk-layer-wrap .atk-layer-mask{position:fixed;top:0;left:0;width:100%;height:100%;z-index:99998;background:rgba(0,0,0,.3)}.atk-layer-wrap .atk-layer-item{position:fixed;z-index:99999;top:0;right:0;width:100%;height:100%}.atk-common-action-btn.atk-btn-confirm,.atk-common-action-btn.atk-btn-warn{color:var(--at-color-yellow)!important}.atk-common-action-btn.atk-btn-error{color:var(--at-color-red)!important}.atk-common-action-btn.atk-btn-success{color:var(--at-color-green)!important}img[atk-emoticon]{max-height:60px;display:initial}.atk-slim-scrollbar::-webkit-scrollbar,.atk-editor-plug-emoticons>.atk-grp-wrap::-webkit-scrollbar{width:4px;height:4px;background:transparent}.atk-slim-scrollbar::-webkit-scrollbar-thumb,.atk-editor-plug-emoticons>.atk-grp-wrap::-webkit-scrollbar-thumb,.atk-slim-scrollbar::-webkit-scrollbar-thumb:window-inactive{background:rgba(86,86,86,.3)}.atk-slim-scrollbar::-webkit-scrollbar-thumb:vertical:hover,.atk-editor-plug-emoticons>.atk-grp-wrap::-webkit-scrollbar-thumb:vertical:hover{background:rgba(65,74,82,.77)}.atk-slim-scrollbar::-webkit-scrollbar-thumb:vertical:active,.atk-editor-plug-emoticons>.atk-grp-wrap::-webkit-scrollbar-thumb:vertical:active{background:rgba(41,47,53,.77)}.atk-editor-plug-emoticons{height:100%;width:100%}.atk-editor-plug-emoticons>.atk-grp-wrap{overflow-y:scroll;overflow-x:hidden;height:100%;width:100%}.atk-editor-plug-emoticons>.atk-grp-wrap>.atk-grp{display:flex;flex-wrap:wrap;flex-direction:row;padding:5px 10px 35px}.atk-editor-plug-emoticons>.atk-grp-wrap>.atk-grp[data-type=image]>.atk-item{height:63px;width:63px}.atk-editor-plug-emoticons>.atk-grp-wrap>.atk-grp>.atk-item{display:flex;align-items:center;justify-content:center;padding:5px;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;user-select:none;border-radius:3px;font-size:15px;min-width:35px;margin:2px}.atk-editor-plug-emoticons>.atk-grp-wrap>.atk-grp>.atk-item>img{max-height:100%;width:auto}.atk-editor-plug-emoticons>.atk-grp-wrap>.atk-grp>.atk-item:hover{background:var(--at-color-bg-grey)}.atk-editor-plug-emoticons>.atk-grp-switcher{position:absolute;bottom:0;left:0;width:100%;background:var(--at-color-bg-transl);height:30px;border-top:1px solid var(--at-color-border);border-bottom:1px solid var(--at-color-border)}.atk-editor-plug-emoticons>.atk-grp-switcher>span{-webkit-user-select:none;-moz-user-select:none;user-select:none;padding:0 10px;line-height:30px;float:left;display:block;cursor:pointer;font-size:14px}.atk-editor-plug-emoticons>.atk-grp-switcher>span:hover,.atk-editor-plug-emoticons>.atk-grp-switcher>span.active{background:var(--at-color-bg-grey)}.atk-slim-scrollbar::-webkit-scrollbar{width:4px;height:4px;background:transparent}.atk-slim-scrollbar::-webkit-scrollbar-thumb,.atk-slim-scrollbar::-webkit-scrollbar-thumb:window-inactive{background:rgba(86,86,86,.3)}.atk-slim-scrollbar::-webkit-scrollbar-thumb:vertical:hover{background:rgba(65,74,82,.77)}.atk-slim-scrollbar::-webkit-scrollbar-thumb:vertical:active{background:rgba(41,47,53,.77)}.atk-editor-plug-preview{overflow-y:scroll;overflow-x:hidden;height:100%;width:100%;padding:10px 15px} diff --git a/assets/lib/artalk/Artalk.js b/assets/lib/artalk/Artalk.js new file mode 100644 index 00000000..c4d6ffb4 --- /dev/null +++ b/assets/lib/artalk/Artalk.js @@ -0,0 +1 @@ +!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).Artalk=t()}(this,(function(){"use strict";var e=Object.defineProperty,t=Object.defineProperties,n=Object.getOwnPropertyDescriptors,i=Object.getOwnPropertySymbols,s=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable,a=(t,n,i)=>n in t?e(t,n,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[n]=i,o=(e,t)=>{for(var n in t||(t={}))s.call(t,n)&&a(e,n,t[n]);if(i)for(var n of i(t))r.call(t,n)&&a(e,n,t[n]);return e},l=(e,i)=>t(e,n(i)),c=(e,t,n)=>(a(e,"symbol"!=typeof t?t+"":t,n),n),d=(e,t,n)=>new Promise(((i,s)=>{var r=e=>{try{o(n.next(e))}catch(t){s(t)}},a=e=>{try{o(n.throw(e))}catch(t){s(t)}},o=e=>e.done?i(e.value):Promise.resolve(e.value).then(r,a);o((n=n.apply(e,t)).next())}));function h(e=""){const t=document.createElement("div");return t.innerHTML=e.trim(),t.firstElementChild||t}function u(e){return parseFloat(getComputedStyle(e,null).height.replace("px",""))}function p(e){const t=RegExp(`[?&]${e}=([^&]*)`).exec(window.location.search);return t&&decodeURIComponent(t[1].replace(/\+/g," "))}function g(e){const t=e.getBoundingClientRect();return{top:t.top+window.scrollY,left:t.left+window.scrollX}}function m(e,t){let n=e.toString();for(;n.length=13?e.replace(/Windows NT 10.0/,"Windows NT 11.0"):"macOS"===t.platform&&i>=11?e.replace(/(Mac OS X \d+_\d+_\d+|Mac OS X)/,`Mac OS X ${n.platformVersion.replace(/\./g,"_")}`):e}))}function y(e){let t;try{t=new URL(e)}catch(n){return!1}return"http:"===t.protocol||"https:"===t.protocol}function $(e,t){return function(e,t){return`${e.replace(/\/$/,"")}/${t.replace(/^\//,"")}`}(e.conf.server,t)}function x(e,t){const n=e=>e&&"object"==typeof e;return n(e)&&n(t)?(Object.keys(t).forEach((i=>{const s=e[i],r=t[i];Array.isArray(s)&&Array.isArray(r)?e[i]=s.concat(r):n(s)&&n(r)?e[i]=x(o({},s),r):e[i]=r})),e):t}class v{constructor(e){c(this,"$el"),c(this,"ctx"),c(this,"conf"),this.ctx=e,this.conf=e.conf}$t(e,t={}){return this.ctx.$t(e,t)}}function b(e,t){let n=e.querySelector(":scope > .atk-loading");n||(n=h(''),(null==t?void 0:t.transparentBg)&&(n.style.background="transparent"),e.appendChild(n)),n.style.display="";const i=n.querySelector(".atk-loading-spinner");i&&(i.style.display="none",window.setTimeout((()=>{i.style.display=""}),500))}function w(e){const t=e.querySelector(":scope > .atk-loading");t&&(t.style.display="none")}function C(e,t=!0){const n=g(e).top+u(e)/2-document.documentElement.clientHeight/2;t?window.scroll({top:n>0?n:0,left:0}):window.scroll(0,n>0?n:0)}function S(e,t,n){const i=h(`
`);i.querySelector(".atk-notify-content").innerHTML=function(e){const t=document.createElement("div");return t.innerText=e,t.innerHTML}(t).replace("\n","
"),e.appendChild(i);const s=()=>{i.classList.add("atk-fade-out"),setTimeout((()=>{i.remove()}),200)};let r;r=window.setTimeout((()=>{s()}),3e3),i.addEventListener("click",(()=>{s(),window.clearTimeout(r)}))}function T(e,t){!function(e,t,n="in"){e.classList.add(`atk-fade-${n}`);const i=()=>{e.classList.remove(`atk-fade-${n}`),e.removeEventListener("animationend",i),t&&t()};e.addEventListener("animationend",i)}(e,t,"in")}function E(e,t,n='Artalk Error'){let i=e.querySelector(".atk-error-layer");if(null===t)return void(null!==i&&i.remove());i||(i=h(`
${n}
`),e.appendChild(i));const s=i.querySelector(".atk-error-text");s.innerHTML="",null!==t&&(t instanceof HTMLElement?s.appendChild(t):s.innerText=t)}const L=class extends v{constructor(e,t,n){super(e),c(this,"name"),c(this,"$wrap"),c(this,"$mask"),c(this,"maskClickHideEnable",!0),c(this,"afterHide"),this.name=t;const{$wrap:i,$mask:s}=A();this.$wrap=i,this.$mask=s,this.$el=this.$wrap.querySelector(`[data-layer-name="${t}"].atk-layer-item`),null===this.$el&&(n?this.$el=n:(this.$el=h(),this.$el.classList.add("atk-layer-item"))),this.$el.setAttribute("data-layer-name",t),this.$el.style.display="none",this.$wrap.append(this.$el)}getName(){return this.name}getWrapEl(){return this.$wrap}getEl(){return this.$el}show(){this.fireAllActionTimer(),this.$wrap.style.display="block",this.$mask.style.display="block",this.$mask.classList.add("atk-fade-in"),this.$el.style.display="",this.$mask.onclick=()=>{this.maskClickHideEnable&&this.hide()},this.pageBodyScrollBarHide()}hide(){this.afterHide&&this.afterHide(),this.$wrap.classList.add("atk-fade-out"),this.$el.style.display="none",this.pageBodyScrollBarShow(),this.newActionTimer((()=>{this.$wrap.style.display="none",this.checkCleanLayer()}),450),this.newActionTimer((()=>{this.$wrap.style.display="none",this.$wrap.classList.remove("atk-fade-out")}),200)}setMaskClickHide(e){this.maskClickHideEnable=e}pageBodyScrollBarHide(){document.body.style.overflow="hidden";const e=parseInt(window.getComputedStyle(document.body,null).getPropertyValue("padding-right"),10);document.body.style.paddingRight=`${function(){const e=document.createElement("p");e.style.width="100%",e.style.height="200px";const t=document.createElement("div");t.style.position="absolute",t.style.top="0px",t.style.left="0px",t.style.visibility="hidden",t.style.width="200px",t.style.height="150px",t.style.overflow="hidden",t.appendChild(e),document.body.appendChild(t);const n=e.offsetWidth;t.style.overflow="scroll";let i=e.offsetWidth;return n===i&&(i=t.clientWidth),document.body.removeChild(t),n-i}()+e||0}px`}pageBodyScrollBarShow(){document.body.style.overflow=L.BodyOrgOverflow,document.body.style.paddingRight=L.BodyOrgPaddingRight}newActionTimer(e,t){const n=()=>{e(),L.actionTimers=L.actionTimers.filter((e=>e.act!==n))},i=window.setTimeout((()=>n()),t);L.actionTimers.push({act:n,tid:i})}fireAllActionTimer(){L.actionTimers.forEach((e=>{clearTimeout(e.tid),e.act()}))}disposeNow(){this.$el.remove(),this.pageBodyScrollBarShow(),this.checkCleanLayer()}dispose(){this.hide(),this.$el.remove(),this.checkCleanLayer()}checkCleanLayer(){0===this.getWrapEl().querySelectorAll(".atk-layer-item").length&&(this.$wrap.style.display="none")}};let _=L;function A(){let e=document.querySelector(".atk-layer-wrap");e||(e=h(''),document.body.appendChild(e));const t=e.querySelector(".atk-layer-mask");return{$wrap:e,$mask:t}}c(_,"BodyOrgOverflow"),c(_,"BodyOrgPaddingRight"),c(_,"actionTimers",[]);const O=window.matchMedia("(prefers-color-scheme: dark)");let M;function R(e){B(e,e.conf.darkMode,!1)}function B(e,t,n=!0){const i=t=>{!function(e,t){t?e.$root.classList.add(I):e.$root.classList.remove(I);const{$wrap:n}=A();n&&(t?n.classList.add(I):n.classList.remove(I))}(e,t),n&&function(e,t){e.conf.darkMode=t}(e,t)};"auto"===t?(M||(M=e=>i(e.matches),O.addEventListener("change",M)),i(O.matches)):(M&&O.removeEventListener("change",M),i(t))}const I="atk-dark-mode";function P(){return{async:!1,baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}let U={async:!1,baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1};const q=/[&<>"']/,D=new RegExp(q.source,"g"),z=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,W=new RegExp(z.source,"g"),F={"&":"&","<":"<",">":">",'"':""","'":"'"},j=e=>F[e];function N(e,t){if(t){if(q.test(e))return e.replace(D,j)}else if(z.test(e))return e.replace(W,j);return e}const H=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi;function Q(e){return e.replace(H,((e,t)=>"colon"===(t=t.toLowerCase())?":":"#"===t.charAt(0)?"x"===t.charAt(1)?String.fromCharCode(parseInt(t.substring(2),16)):String.fromCharCode(+t.substring(1)):""))}const V=/(^|[^\[])\^/g;function Z(e,t){e="string"==typeof e?e:e.source,t=t||"";const n={replace:(t,i)=>(i=(i=i.source||i).replace(V,"$1"),e=e.replace(t,i),n),getRegex:()=>new RegExp(e,t)};return n}const G=/[^\w:]/g,K=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function Y(e,t,n){if(e){let e;try{e=decodeURIComponent(Q(n)).replace(G,"").toLowerCase()}catch(i){return null}if(0===e.indexOf("javascript:")||0===e.indexOf("vbscript:")||0===e.indexOf("data:"))return null}t&&!K.test(n)&&(n=function(e,t){X[" "+e]||(J.test(e)?X[" "+e]=e+"/":X[" "+e]=re(e,"/",!0));e=X[" "+e];const n=-1===e.indexOf(":");return"//"===t.substring(0,2)?n?t:e.replace(ee,"$1")+t:"/"===t.charAt(0)?n?t:e.replace(te,"$1")+t:e+t}(t,n));try{n=encodeURI(n).replace(/%25/g,"%")}catch(i){return null}return n}const X={},J=/^[^:]+:\/*[^/]*$/,ee=/^([^:]+:)[\s\S]*$/,te=/^([^:]+:\/*[^/]*)[\s\S]*$/;const ne={exec:function(){}};function ie(e){let t,n,i=1;for(;i{let i=!1,s=t;for(;--s>=0&&"\\"===n[s];)i=!i;return i?"|":" |"})).split(/ \|/);let i=0;if(n[0].trim()||n.shift(),n.length>0&&!n[n.length-1].trim()&&n.pop(),n.length>t)n.splice(t);else for(;n.length1;)1&t&&(n+=e),t>>=1,e+=e;return n+e}function le(e,t,n,i){const s=t.href,r=t.title?N(t.title):null,a=e[1].replace(/\\([\[\]])/g,"$1");if("!"!==e[0].charAt(0)){i.state.inLink=!0;const e={type:"link",raw:n,href:s,title:r,text:a,tokens:i.inlineTokens(a)};return i.state.inLink=!1,e}return{type:"image",raw:n,href:s,title:r,text:N(a)}}class ce{constructor(e){this.options=e||U}space(e){const t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(e){const t=this.rules.block.code.exec(e);if(t){const e=t[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?e:re(e,"\n")}}}fences(e){const t=this.rules.block.fences.exec(e);if(t){const e=t[0],n=function(e,t){const n=e.match(/^(\s+)(?:```)/);if(null===n)return t;const i=n[1];return t.split("\n").map((e=>{const t=e.match(/^\s+/);if(null===t)return e;const[n]=t;return n.length>=i.length?e.slice(i.length):e})).join("\n")}(e,t[3]||"");return{type:"code",raw:e,lang:t[2]?t[2].trim().replace(this.rules.inline._escapes,"$1"):t[2],text:n}}}heading(e){const t=this.rules.block.heading.exec(e);if(t){let e=t[2].trim();if(/#$/.test(e)){const t=re(e,"#");this.options.pedantic?e=t.trim():t&&!/ $/.test(t)||(e=t.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:e,tokens:this.lexer.inline(e)}}}hr(e){const t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:t[0]}}blockquote(e){const t=this.rules.block.blockquote.exec(e);if(t){const e=t[0].replace(/^ *>[ \t]?/gm,""),n=this.lexer.state.top;this.lexer.state.top=!0;const i=this.lexer.blockTokens(e);return this.lexer.state.top=n,{type:"blockquote",raw:t[0],tokens:i,text:e}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n,i,s,r,a,o,l,c,d,h,u,p,g=t[1].trim();const m=g.length>1,f={type:"list",raw:"",ordered:m,start:m?+g.slice(0,-1):"",loose:!1,items:[]};g=m?`\\d{1,9}\\${g.slice(-1)}`:`\\${g}`,this.options.pedantic&&(g=m?g:"[*+-]");const k=new RegExp(`^( {0,3}${g})((?:[\t ][^\\n]*)?(?:\\n|$))`);for(;e&&(p=!1,t=k.exec(e))&&!this.rules.block.hr.test(e);){if(n=t[0],e=e.substring(n.length),c=t[2].split("\n",1)[0].replace(/^\t+/,(e=>" ".repeat(3*e.length))),d=e.split("\n",1)[0],this.options.pedantic?(r=2,u=c.trimLeft()):(r=t[2].search(/[^ ]/),r=r>4?1:r,u=c.slice(r),r+=t[1].length),o=!1,!c&&/^ *$/.test(d)&&(n+=d+"\n",e=e.substring(d.length+1),p=!0),!p){const t=new RegExp(`^ {0,${Math.min(3,r-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ \t][^\\n]*)?(?:\\n|$))`),i=new RegExp(`^ {0,${Math.min(3,r-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),s=new RegExp(`^ {0,${Math.min(3,r-1)}}(?:\`\`\`|~~~)`),a=new RegExp(`^ {0,${Math.min(3,r-1)}}#`);for(;e&&(h=e.split("\n",1)[0],d=h,this.options.pedantic&&(d=d.replace(/^ {1,4}(?=( {4})*[^ ])/g," ")),!s.test(d))&&!a.test(d)&&!t.test(d)&&!i.test(e);){if(d.search(/[^ ]/)>=r||!d.trim())u+="\n"+d.slice(r);else{if(o)break;if(c.search(/[^ ]/)>=4)break;if(s.test(c))break;if(a.test(c))break;if(i.test(c))break;u+="\n"+d}o||d.trim()||(o=!0),n+=h+"\n",e=e.substring(h.length+1),c=d.slice(r)}}f.loose||(l?f.loose=!0:/\n *\n *$/.test(n)&&(l=!0)),this.options.gfm&&(i=/^\[[ xX]\] /.exec(u),i&&(s="[ ] "!==i[0],u=u.replace(/^\[[ xX]\] +/,""))),f.items.push({type:"list_item",raw:n,task:!!i,checked:s,loose:!1,text:u}),f.raw+=n}f.items[f.items.length-1].raw=n.trimRight(),f.items[f.items.length-1].text=u.trimRight(),f.raw=f.raw.trimRight();const y=f.items.length;for(a=0;a"space"===e.type)),t=e.length>0&&e.some((e=>/\n.*\n/.test(e.raw)));f.loose=t}if(f.loose)for(a=0;a$/,"$1").replace(this.rules.inline._escapes,"$1"):"",i=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline._escapes,"$1"):t[3];return{type:"def",tag:e,raw:t[0],href:n,title:i}}}table(e){const t=this.rules.block.table.exec(e);if(t){const e={type:"table",header:se(t[1]).map((e=>({text:e}))),align:t[2].replace(/^ *|\| *$/g,"").split(/ *\| */),rows:t[3]&&t[3].trim()?t[3].replace(/\n[ \t]*$/,"").split("\n"):[]};if(e.header.length===e.align.length){e.raw=t[0];let n,i,s,r,a=e.align.length;for(n=0;n({text:e})));for(a=e.header.length,i=0;i/i.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:this.options.sanitize?"text":"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(t[0]):N(t[0]):t[0]}}link(e){const t=this.rules.inline.link.exec(e);if(t){const e=t[2].trim();if(!this.options.pedantic&&/^$/.test(e))return;const t=re(e.slice(0,-1),"\\");if((e.length-t.length)%2==0)return}else{const e=function(e,t){if(-1===e.indexOf(t[1]))return-1;const n=e.length;let i=0,s=0;for(;s-1){const n=(0===t[0].indexOf("!")?5:4)+t[1].length+e;t[2]=t[2].substring(0,e),t[0]=t[0].substring(0,n).trim(),t[3]=""}}let n=t[2],i="";if(this.options.pedantic){const e=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(n);e&&(n=e[1],i=e[3])}else i=t[3]?t[3].slice(1,-1):"";return n=n.trim(),/^$/.test(e)?n.slice(1):n.slice(1,-1)),le(t,{href:n?n.replace(this.rules.inline._escapes,"$1"):n,title:i?i.replace(this.rules.inline._escapes,"$1"):i},t[0],this.lexer)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){let e=(n[2]||n[1]).replace(/\s+/g," ");if(e=t[e.toLowerCase()],!e){const e=n[0].charAt(0);return{type:"text",raw:e,text:e}}return le(n,e,n[0],this.lexer)}}emStrong(e,t,n=""){let i=this.rules.inline.emStrong.lDelim.exec(e);if(!i)return;if(i[3]&&n.match(/[\p{L}\p{N}]/u))return;const s=i[1]||i[2]||"";if(!s||s&&(""===n||this.rules.inline.punctuation.exec(n))){const n=i[0].length-1;let s,r,a=n,o=0;const l="*"===i[0][0]?this.rules.inline.emStrong.rDelimAst:this.rules.inline.emStrong.rDelimUnd;for(l.lastIndex=0,t=t.slice(-1*e.length+n);null!=(i=l.exec(t));){if(s=i[1]||i[2]||i[3]||i[4]||i[5]||i[6],!s)continue;if(r=s.length,i[3]||i[4]){a+=r;continue}if((i[5]||i[6])&&n%3&&!((n+r)%3)){o+=r;continue}if(a-=r,a>0)continue;r=Math.min(r,r+a+o);const t=e.slice(0,n+i.index+(i[0].length-s.length)+r);if(Math.min(n,r)%2){const e=t.slice(1,-1);return{type:"em",raw:t,text:e,tokens:this.lexer.inlineTokens(e)}}const l=t.slice(2,-2);return{type:"strong",raw:t,text:l,tokens:this.lexer.inlineTokens(l)}}}}codespan(e){const t=this.rules.inline.code.exec(e);if(t){let e=t[2].replace(/\n/g," ");const n=/[^ ]/.test(e),i=/^ /.test(e)&&/ $/.test(e);return n&&i&&(e=e.substring(1,e.length-1)),e=N(e,!0),{type:"codespan",raw:t[0],text:e}}}br(e){const t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e){const t=this.rules.inline.del.exec(e);if(t)return{type:"del",raw:t[0],text:t[2],tokens:this.lexer.inlineTokens(t[2])}}autolink(e,t){const n=this.rules.inline.autolink.exec(e);if(n){let e,i;return"@"===n[2]?(e=N(this.options.mangle?t(n[1]):n[1]),i="mailto:"+e):(e=N(n[1]),i=e),{type:"link",raw:n[0],text:e,href:i,tokens:[{type:"text",raw:e,text:e}]}}}url(e,t){let n;if(n=this.rules.inline.url.exec(e)){let e,i;if("@"===n[2])e=N(this.options.mangle?t(n[0]):n[0]),i="mailto:"+e;else{let t;do{t=n[0],n[0]=this.rules.inline._backpedal.exec(n[0])[0]}while(t!==n[0]);e=N(n[0]),i="www."===n[1]?"http://"+n[0]:n[0]}return{type:"link",raw:n[0],text:e,href:i,tokens:[{type:"text",raw:e,text:e}]}}}inlineText(e,t){const n=this.rules.inline.text.exec(e);if(n){let e;return e=this.lexer.state.inRawBlock?this.options.sanitize?this.options.sanitizer?this.options.sanitizer(n[0]):N(n[0]):n[0]:N(this.options.smartypants?t(n[0]):n[0]),{type:"text",raw:n[0],text:e}}}}const de={newline:/^(?: *(?:\n|$))+/,code:/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*\n)|~{3,})([^\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?=\n|$)|$)/,hr:/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/,html:"^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|\\n*|$)|\\n*|$)|)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))",def:/^ {0,3}\[(label)\]: *(?:\n *)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/,table:ne,lheading:/^((?:.|\n(?!\n))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,text:/^[^\n]+/,_label:/(?!\s*\])(?:\\.|[^\[\]\\])+/,_title:/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/};de.def=Z(de.def).replace("label",de._label).replace("title",de._title).getRegex(),de.bullet=/(?:[*+-]|\d{1,9}[.)])/,de.listItemStart=Z(/^( *)(bull) */).replace("bull",de.bullet).getRegex(),de.list=Z(de.list).replace(/bull/g,de.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+de.def.source+")").getRegex(),de._tag="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",de._comment=/|$)/,de.html=Z(de.html,"i").replace("comment",de._comment).replace("tag",de._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),de.paragraph=Z(de._paragraph).replace("hr",de.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",de._tag).getRegex(),de.blockquote=Z(de.blockquote).replace("paragraph",de.paragraph).getRegex(),de.normal=ie({},de),de.gfm=ie({},de.normal,{table:"^ *([^\\n ].*\\|.*)\\n {0,3}(?:\\| *)?(:?-+:? *(?:\\| *:?-+:? *)*)(?:\\| *)?(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"}),de.gfm.table=Z(de.gfm.table).replace("hr",de.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",de._tag).getRegex(),de.gfm.paragraph=Z(de._paragraph).replace("hr",de.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("table",de.gfm.table).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",de._tag).getRegex(),de.pedantic=ie({},de.normal,{html:Z("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",de._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:ne,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:Z(de.normal._paragraph).replace("hr",de.hr).replace("heading"," *#{1,6} *[^\n]").replace("lheading",de.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});const he={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:ne,tag:"^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(ref)\]/,nolink:/^!?\[(ref)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",emStrong:{lDelim:/^(?:\*+(?:([punct_])|[^\s*]))|^_+(?:([punct*])|([^\s_]))/,rDelimAst:/^(?:[^_*\\]|\\.)*?\_\_(?:[^_*\\]|\\.)*?\*(?:[^_*\\]|\\.)*?(?=\_\_)|(?:[^*\\]|\\.)+(?=[^*])|[punct_](\*+)(?=[\s]|$)|(?:[^punct*_\s\\]|\\.)(\*+)(?=[punct_\s]|$)|[punct_\s](\*+)(?=[^punct*_\s])|[\s](\*+)(?=[punct_])|[punct_](\*+)(?=[punct_])|(?:[^punct*_\s\\]|\\.)(\*+)(?=[^punct*_\s])/,rDelimUnd:/^(?:[^_*\\]|\\.)*?\*\*(?:[^_*\\]|\\.)*?\_(?:[^_*\\]|\\.)*?(?=\*\*)|(?:[^_\\]|\\.)+(?=[^_])|[punct*](\_+)(?=[\s]|$)|(?:[^punct*_\s\\]|\\.)(\_+)(?=[punct*\s]|$)|[punct*\s](\_+)(?=[^punct*_\s])|[\s](\_+)(?=[punct*])|[punct*](\_+)(?=[punct*])/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:ne,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\.5&&(n="x"+n.toString(16)),i+="&#"+n+";";return i}he._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~",he.punctuation=Z(he.punctuation).replace(/punctuation/g,he._punctuation).getRegex(),he.blockSkip=/\[[^\]]*?\]\([^\)]*?\)|`[^`]*?`|<[^>]*?>/g,he.escapedEmSt=/(?:^|[^\\])(?:\\\\)*\\[*_]/g,he._comment=Z(de._comment).replace("(?:--\x3e|$)","--\x3e").getRegex(),he.emStrong.lDelim=Z(he.emStrong.lDelim).replace(/punct/g,he._punctuation).getRegex(),he.emStrong.rDelimAst=Z(he.emStrong.rDelimAst,"g").replace(/punct/g,he._punctuation).getRegex(),he.emStrong.rDelimUnd=Z(he.emStrong.rDelimUnd,"g").replace(/punct/g,he._punctuation).getRegex(),he._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,he._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,he._email=/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/,he.autolink=Z(he.autolink).replace("scheme",he._scheme).replace("email",he._email).getRegex(),he._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,he.tag=Z(he.tag).replace("comment",he._comment).replace("attribute",he._attribute).getRegex(),he._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,he._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/,he._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,he.link=Z(he.link).replace("label",he._label).replace("href",he._href).replace("title",he._title).getRegex(),he.reflink=Z(he.reflink).replace("label",he._label).replace("ref",de._label).getRegex(),he.nolink=Z(he.nolink).replace("ref",de._label).getRegex(),he.reflinkSearch=Z(he.reflinkSearch,"g").replace("reflink",he.reflink).replace("nolink",he.nolink).getRegex(),he.normal=ie({},he),he.pedantic=ie({},he.normal,{strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:Z(/^!?\[(label)\]\((.*?)\)/).replace("label",he._label).getRegex(),reflink:Z(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",he._label).getRegex()}),he.gfm=ie({},he.normal,{escape:Z(he.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\t+" ".repeat(n.length)));e;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some((i=>!!(n=i.call({lexer:this},e,t))&&(e=e.substring(n.raw.length),t.push(n),!0)))))if(n=this.tokenizer.space(e))e=e.substring(n.raw.length),1===n.raw.length&&t.length>0?t[t.length-1].raw+="\n":t.push(n);else if(n=this.tokenizer.code(e))e=e.substring(n.raw.length),i=t[t.length-1],!i||"paragraph"!==i.type&&"text"!==i.type?t.push(n):(i.raw+="\n"+n.raw,i.text+="\n"+n.text,this.inlineQueue[this.inlineQueue.length-1].src=i.text);else if(n=this.tokenizer.fences(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.heading(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.hr(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.blockquote(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.list(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.html(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.def(e))e=e.substring(n.raw.length),i=t[t.length-1],!i||"paragraph"!==i.type&&"text"!==i.type?this.tokens.links[n.tag]||(this.tokens.links[n.tag]={href:n.href,title:n.title}):(i.raw+="\n"+n.raw,i.text+="\n"+n.raw,this.inlineQueue[this.inlineQueue.length-1].src=i.text);else if(n=this.tokenizer.table(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.lheading(e))e=e.substring(n.raw.length),t.push(n);else{if(s=e,this.options.extensions&&this.options.extensions.startBlock){let t=1/0;const n=e.slice(1);let i;this.options.extensions.startBlock.forEach((function(e){i=e.call({lexer:this},n),"number"==typeof i&&i>=0&&(t=Math.min(t,i))})),t<1/0&&t>=0&&(s=e.substring(0,t+1))}if(this.state.top&&(n=this.tokenizer.paragraph(s)))i=t[t.length-1],r&&"paragraph"===i.type?(i.raw+="\n"+n.raw,i.text+="\n"+n.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=i.text):t.push(n),r=s.length!==e.length,e=e.substring(n.raw.length);else if(n=this.tokenizer.text(e))e=e.substring(n.raw.length),i=t[t.length-1],i&&"text"===i.type?(i.raw+="\n"+n.raw,i.text+="\n"+n.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=i.text):t.push(n);else if(e){const t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw new Error(t)}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){let n,i,s,r,a,o,l=e;if(this.tokens.links){const e=Object.keys(this.tokens.links);if(e.length>0)for(;null!=(r=this.tokenizer.rules.inline.reflinkSearch.exec(l));)e.includes(r[0].slice(r[0].lastIndexOf("[")+1,-1))&&(l=l.slice(0,r.index)+"["+oe("a",r[0].length-2)+"]"+l.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;null!=(r=this.tokenizer.rules.inline.blockSkip.exec(l));)l=l.slice(0,r.index)+"["+oe("a",r[0].length-2)+"]"+l.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;null!=(r=this.tokenizer.rules.inline.escapedEmSt.exec(l));)l=l.slice(0,r.index+r[0].length-2)+"++"+l.slice(this.tokenizer.rules.inline.escapedEmSt.lastIndex),this.tokenizer.rules.inline.escapedEmSt.lastIndex--;for(;e;)if(a||(o=""),a=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some((i=>!!(n=i.call({lexer:this},e,t))&&(e=e.substring(n.raw.length),t.push(n),!0)))))if(n=this.tokenizer.escape(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.tag(e))e=e.substring(n.raw.length),i=t[t.length-1],i&&"text"===n.type&&"text"===i.type?(i.raw+=n.raw,i.text+=n.text):t.push(n);else if(n=this.tokenizer.link(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.reflink(e,this.tokens.links))e=e.substring(n.raw.length),i=t[t.length-1],i&&"text"===n.type&&"text"===i.type?(i.raw+=n.raw,i.text+=n.text):t.push(n);else if(n=this.tokenizer.emStrong(e,l,o))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.codespan(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.br(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.del(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.autolink(e,pe))e=e.substring(n.raw.length),t.push(n);else if(this.state.inLink||!(n=this.tokenizer.url(e,pe))){if(s=e,this.options.extensions&&this.options.extensions.startInline){let t=1/0;const n=e.slice(1);let i;this.options.extensions.startInline.forEach((function(e){i=e.call({lexer:this},n),"number"==typeof i&&i>=0&&(t=Math.min(t,i))})),t<1/0&&t>=0&&(s=e.substring(0,t+1))}if(n=this.tokenizer.inlineText(s,ue))e=e.substring(n.raw.length),"_"!==n.raw.slice(-1)&&(o=n.raw.slice(-1)),a=!0,i=t[t.length-1],i&&"text"===i.type?(i.raw+=n.raw,i.text+=n.text):t.push(n);else if(e){const t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw new Error(t)}}else e=e.substring(n.raw.length),t.push(n);return t}}class me{constructor(e){this.options=e||U}code(e,t,n){const i=(t||"").match(/\S*/)[0];if(this.options.highlight){const t=this.options.highlight(e,i);null!=t&&t!==e&&(n=!0,e=t)}return e=e.replace(/\n$/,"")+"\n",i?'
'+(n?e:N(e,!0))+"
\n":"
"+(n?e:N(e,!0))+"
\n"}blockquote(e){return`
\n${e}
\n`}html(e){return e}heading(e,t,n,i){if(this.options.headerIds){return`${e}\n`}return`${e}\n`}hr(){return this.options.xhtml?"
\n":"
\n"}list(e,t,n){const i=t?"ol":"ul";return"<"+i+(t&&1!==n?' start="'+n+'"':"")+">\n"+e+"\n"}listitem(e){return`
  • ${e}
  • \n`}checkbox(e){return" "}paragraph(e){return`

    ${e}

    \n`}table(e,t){return t&&(t=`${t}`),"\n\n"+e+"\n"+t+"
    \n"}tablerow(e){return`\n${e}\n`}tablecell(e,t){const n=t.header?"th":"td";return(t.align?`<${n} align="${t.align}">`:`<${n}>`)+e+`\n`}strong(e){return`${e}`}em(e){return`${e}`}codespan(e){return`${e}`}br(){return this.options.xhtml?"
    ":"
    "}del(e){return`${e}`}link(e,t,n){if(null===(e=Y(this.options.sanitize,this.options.baseUrl,e)))return n;let i='",i}image(e,t,n){if(null===(e=Y(this.options.sanitize,this.options.baseUrl,e)))return n;let i=`${n}":">",i}text(e){return e}}class fe{strong(e){return e}em(e){return e}codespan(e){return e}del(e){return e}html(e){return e}text(e){return e}link(e,t,n){return""+n}image(e,t,n){return""+n}br(){return""}}class ke{constructor(){this.seen={}}serialize(e){return e.toLowerCase().trim().replace(/<[!\/a-z].*?>/gi,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-")}getNextSafeSlug(e,t){let n=e,i=0;if(this.seen.hasOwnProperty(n)){i=this.seen[e];do{i++,n=e+"-"+i}while(this.seen.hasOwnProperty(n))}return t||(this.seen[e]=i,this.seen[n]=0),n}slug(e,t={}){const n=this.serialize(e);return this.getNextSafeSlug(n,t.dryrun)}}class ye{constructor(e){this.options=e||U,this.options.renderer=this.options.renderer||new me,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new fe,this.slugger=new ke}static parse(e,t){return new ye(t).parse(e)}static parseInline(e,t){return new ye(t).parseInline(e)}parse(e,t=!0){let n,i,s,r,a,o,l,c,d,h,u,p,g,m,f,k,y,$,x,v="";const b=e.length;for(n=0;n0&&"paragraph"===f.tokens[0].type?(f.tokens[0].text=$+" "+f.tokens[0].text,f.tokens[0].tokens&&f.tokens[0].tokens.length>0&&"text"===f.tokens[0].tokens[0].type&&(f.tokens[0].tokens[0].text=$+" "+f.tokens[0].tokens[0].text)):f.tokens.unshift({type:"text",text:$}):m+=$),m+=this.parse(f.tokens,g),d+=this.renderer.listitem(m,y,k);v+=this.renderer.list(d,u,p);continue;case"html":v+=this.renderer.html(h.text);continue;case"paragraph":v+=this.renderer.paragraph(this.parseInline(h.tokens));continue;case"text":for(d=h.tokens?this.parseInline(h.tokens):h.text;n+1{i(e.text,e.lang,(function(t,n){if(t)return a(t);null!=n&&n!==e.text&&(e.text=n,e.escaped=!0),o--,0===o&&a()}))}),0))})),void(0===o&&a())}function i(e){if(e.message+="\nPlease report this to https://github.com/markedjs/marked.",t.silent)return"

    An error occurred:

    "+N(e.message+"",!0)+"
    ";throw e}try{const n=ge.lex(e,t);if(t.walkTokens){if(t.async)return Promise.all($e.walkTokens(n,t.walkTokens)).then((()=>ye.parse(n,t))).catch(i);$e.walkTokens(n,t.walkTokens)}return ye.parse(n,t)}catch(s){i(s)}}$e.options=$e.setOptions=function(e){var t;return ie($e.defaults,e),t=$e.defaults,U=t,$e},$e.getDefaults=P,$e.defaults=U,$e.use=function(...e){const t=$e.defaults.extensions||{renderers:{},childTokens:{}};e.forEach((e=>{const n=ie({},e);if(n.async=$e.defaults.async||n.async,e.extensions&&(e.extensions.forEach((e=>{if(!e.name)throw new Error("extension name required");if(e.renderer){const n=t.renderers[e.name];t.renderers[e.name]=n?function(...t){let i=e.renderer.apply(this,t);return!1===i&&(i=n.apply(this,t)),i}:e.renderer}if(e.tokenizer){if(!e.level||"block"!==e.level&&"inline"!==e.level)throw new Error("extension level must be 'block' or 'inline'");t[e.level]?t[e.level].unshift(e.tokenizer):t[e.level]=[e.tokenizer],e.start&&("block"===e.level?t.startBlock?t.startBlock.push(e.start):t.startBlock=[e.start]:"inline"===e.level&&(t.startInline?t.startInline.push(e.start):t.startInline=[e.start]))}e.childTokens&&(t.childTokens[e.name]=e.childTokens)})),n.extensions=t),e.renderer){const t=$e.defaults.renderer||new me;for(const n in e.renderer){const i=t[n];t[n]=(...s)=>{let r=e.renderer[n].apply(t,s);return!1===r&&(r=i.apply(t,s)),r}}n.renderer=t}if(e.tokenizer){const t=$e.defaults.tokenizer||new ce;for(const n in e.tokenizer){const i=t[n];t[n]=(...s)=>{let r=e.tokenizer[n].apply(t,s);return!1===r&&(r=i.apply(t,s)),r}}n.tokenizer=t}if(e.walkTokens){const t=$e.defaults.walkTokens;n.walkTokens=function(n){let i=[];return i.push(e.walkTokens.call(this,n)),t&&(i=i.concat(t.call(this,n))),i}}$e.setOptions(n)}))},$e.walkTokens=function(e,t){let n=[];for(const i of e)switch(n=n.concat(t.call($e,i)),i.type){case"table":for(const e of i.header)n=n.concat($e.walkTokens(e.tokens,t));for(const e of i.rows)for(const i of e)n=n.concat($e.walkTokens(i.tokens,t));break;case"list":n=n.concat($e.walkTokens(i.items,t));break;default:$e.defaults.extensions&&$e.defaults.extensions.childTokens&&$e.defaults.extensions.childTokens[i.type]?$e.defaults.extensions.childTokens[i.type].forEach((function(e){n=n.concat($e.walkTokens(i[e],t))})):i.tokens&&(n=n.concat($e.walkTokens(i.tokens,t)))}return n},$e.parseInline=function(e,t){if(null==e)throw new Error("marked.parseInline(): input parameter is undefined or null");if("string"!=typeof e)throw new Error("marked.parseInline(): input parameter is of type "+Object.prototype.toString.call(e)+", string expected");ae(t=ie({},$e.defaults,t||{}));try{const n=ge.lexInline(e,t);return t.walkTokens&&$e.walkTokens(n,t.walkTokens),ye.parseInline(n,t)}catch(n){if(n.message+="\nPlease report this to https://github.com/markedjs/marked.",t.silent)return"

    An error occurred:

    "+N(n.message+"",!0)+"
    ";throw n}},$e.Parser=ye,$e.parser=ye.parse,$e.Renderer=me,$e.TextRenderer=fe,$e.Lexer=ge,$e.lexer=ge.lex,$e.Tokenizer=ce,$e.Slugger=ke,$e.parse=$e,$e.options,$e.setOptions,$e.use,$e.walkTokens,$e.parseInline,ye.parse,ge.lex;var xe="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},ve={"&":"&","<":"<",">":">",'"':""","'":"'"},be={"&":"&","<":"<",">":">",""":'"',"'":"'"},we=/(&|<|>|"|')/g,Ce=/[&<>"']/g;function Se(e){return ve[e]}function Te(e){return be[e]}function Ee(e){return null==e?"":String(e).replace(Ce,Se)}function Le(e){return null==e?"":String(e).replace(we,Te)}Ee.options=Le.options={};var _e={encode:Ee,escape:Ee,decode:Le,unescape:Le,version:"1.0.0-browser"};var Ae=function e(t){for(var n,i,s=Array.prototype.slice.call(arguments,1);s.length;)for(i in n=s.shift())n.hasOwnProperty(i)&&("[object Object]"===Object.prototype.toString.call(t[i])?t[i]=e(t[i],n[i]):t[i]=n[i]);return t},Oe=function(e){return"string"==typeof e?e.toLowerCase():e};function Me(e,t){return e[t]=!0,e}var Re=function(e){return e.reduce(Me,{})},Be={uris:Re(["background","base","cite","href","longdesc","src","usemap"])},Ie={voids:Re(["area","br","col","hr","img","wbr","input","base","basefont","link","meta"])},Pe=_e,Ue=Oe,qe=Ie,De=/^<\s*([\w:-]+)((?:\s+[\w:-]+(?:\s*=\s*(?:(?:"[^"]*")|(?:'[^']*')|[^>\s]+))?)*)\s*(\/?)\s*>/,ze=/^<\s*\/\s*([\w:-]+)[^>]*>/,We=/([\w:-]+)(?:\s*=\s*(?:(?:"((?:[^"])*)")|(?:'((?:[^'])*)')|([^>\s]+)))?/g,Fe=/^=0&&(t.comment&&t.comment(e.substring(4,i)),e=e.substring(i+3),n=!1):je.test(e)?a(ze,l):Fe.test(e)&&a(De,o);var i;!function(){if(!n)return;var i,s=e.indexOf("<");s>=0?(i=e.substring(0,s),e=e.substring(s)):(i=e,e="");t.chars&&t.chars(i)}()}();var i=e===s;s=e,i&&(e="")}function a(t,i){var s=e.match(t);s&&(e=e.substring(s[0].length),s[0].replace(t,i),n=!1)}function o(e,n,s,r){var a={},o=Ue(n),l=qe.voids[o]||!!r;s.replace(We,(function(e,t,n,i,s){a[t]=void 0===n&&void 0===i&&void 0===s?void 0:Pe.decode(n||i||s||"")})),l||i.push(o),t.start&&t.start(o,a,l)}function l(e,n){var s,r=0,a=Ue(n);if(a)for(r=i.length-1;r>=0&&i[r]!==a;r--);if(r>=0){for(s=i.length-1;s>=r;s--)t.end&&t.end(i[s]);i.length=r}}l()},Ke=function(e,t){var n,i=t||{};return o(),{start:function(e,t,a){var o=He(e);if(n.ignoring)return void r(o);if(-1===(i.allowedTags||[]).indexOf(o))return void r(o);if(i.filter&&!i.filter({tag:o,attrs:t}))return void r(o);s("<"),s(o),Object.keys(t).forEach((function(e){var n=t[e],r=(i.allowedClasses||{})[o]||[],a=(i.allowedAttributes||{})[o]||[],l=He(e);("class"===l&&-1===a.indexOf(l)?(n=n.split(" ").filter((function(e){return r&&-1!==r.indexOf(e)})).join(" ").trim()).length:-1!==a.indexOf(l)&&(!0!==Qe.uris[l]||function(e){var t=e[0];if("#"===t||"/"===t)return!0;var n=e.indexOf(":");if(-1===n)return!0;var s=e.indexOf("?");if(-1!==s&&n>s)return!0;var r=e.indexOf("#");return-1!==r&&n>r||i.allowedSchemes.some(a);function a(t){return 0===e.indexOf(t+":")}}(n)))&&(s(" "),s(e),"string"==typeof n&&(s('="'),s(Ne.encode(n)),s('"')))})),s(a?"/>":">")},end:function(e){var t=He(e);-1!==(i.allowedTags||[]).indexOf(t)&&!1===n.ignoring?(s("")):a(t)},chars:function(e){!1===n.ignoring&&s(i.transformText?i.transformText(e):e)}};function s(t){e.push(t)}function r(e){Ve.voids[e]||(!1===n.ignoring?n={ignoring:e,depth:1}:n.ignoring===e&&n.depth++)}function a(e){n.ignoring===e&&--n.depth<=0&&o()}function o(){n={ignoring:!1,depth:0}}},Ye={allowedAttributes:{a:["href","name","target","title","aria-label"],iframe:["allowfullscreen","frameborder","src"],img:["src","alt","title","aria-label"]},allowedClasses:{},allowedSchemes:["http","https","mailto"],allowedTags:["a","abbr","article","b","blockquote","br","caption","code","del","details","div","em","h1","h2","h3","h4","h5","h6","hr","i","img","ins","kbd","li","main","mark","ol","p","pre","section","span","strike","strong","sub","summary","sup","table","tbody","td","th","thead","tr","u","ul"],filter:null};function Xe(e,t,n){var i=[],s=!0===n?t:Ze({},Ye,t),r=Ke(i,s);return Ge(e,r),i.join("")}Xe.defaults=Ye;var Je=Xe,et={};({get exports(){return et},set exports(e){et=e}}).exports=function(){function e(e,t){return e(t={exports:{}},t.exports),t.exports}var t=e((function(e){var t=e.exports=function(){return new RegExp("(?:"+t.line().source+")|(?:"+t.block().source+")","gm")};t.line=function(){return/(?:^|\s)\/\/(.+?)$/gm},t.block=function(){return/\/\*([\S\s]*?)\*\//gm}})),n=["23AC69","91C132","F19726","E8552D","1AAB8E","E1147F","2980C1","1BA1E6","9FA0A0","F19726","E30B20","E30B20","A3338B"];function i(e){return''+e+""}return function(e,s){void 0===s&&(s={});var r=s.colors;void 0===r&&(r=n);var a=0,o={},l=new RegExp("("+/[\u4E00-\u9FFF\u3400-\u4dbf\uf900-\ufaff\u3040-\u309f\uac00-\ud7af\u0400-\u04FF]+|\w+/.source+"|"+/'+t+"";return a=++a%r.length,l}))}}();const tt=et;let nt;function it(){return nt}function st(e,t){var n;let i=null==(n=it())?void 0:n.parse(t);i||(i=t.replace(/```\s*([^]+?.*?[^]+?[^]+?)```/g,((e,t)=>`
    ${tt(t)}
    `)).replace(/!\[(.*?)\]\((.*?)\)/g,((e,t,n)=>`${t}`)).replace(/\[(.*?)\]\((.*?)\)/g,((e,t,n)=>`
    ${t}`)).replace(/\n/g,"
    "));let s=Je(i,{allowedClasses:{},allowedSchemes:["http","https","mailto","data"],allowedTags:["a","abbr","article","b","blockquote","br","caption","code","del","details","div","em","h1","h2","h3","h4","h5","h6","hr","i","img","ins","kbd","li","main","mark","ol","p","pre","section","span","strike","strong","sub","summary","sup","table","tbody","td","th","thead","tr","u","ul"],allowedAttributes:{"*":["title","accesskey"],a:["href","name","target","aria-label","rel"],img:["src","alt","title","atk-emoticon","aria-label"],code:["class"],span:["class","style"]},filter:e=>([["code",/^hljs\W+language-(.*)$/],["span",/^(hljs-.*)$/]].forEach((([t,n])=>{e.tag===t&&e.attrs.class&&!n.test(e.attrs.class)&&delete e.attrs.class})),"span"===e.tag&&e.attrs.style&&!/^color:(\W+)?#[0-9a-f]{3,6};?$/i.test(e.attrs.style)&&delete e.attrs.style,!0)});return e.markedReplacers.forEach((e=>{"function"==typeof e&&(s=e(s))})),s}const rt={placeholder:"Leave a comment",noComment:"No Comment",send:"Send",save:"Save",nick:"Nickname",email:"Email",link:"Website",emoticon:"Emoji",preview:"Preview",image:"Image",uploadFail:"Upload Failed",commentFail:"Failed to comment",restoredMsg:"Content has been restored",onlyAdminCanReply:"Only admin can reply",uploadLoginMsg:"Please fill in your name and email to upload",counter:"{count} Comments",sortLatest:"Latest",sortOldest:"Oldest",sortBest:"Best",sortAuthor:"Author",openComment:"Open Comment",closeComment:"Close Comment",listLoadFailMsg:"Failed to load comments",listRetry:"Click to retry",loadMore:"Load More",admin:"Admin",reply:"Reply",voteUp:"Up",voteDown:"Down",voteFail:"Vote Failed",readMore:"Read More",actionConfirm:"Confirm",collapse:"Collapse",collapsed:"Collapsed",collapsedMsg:"This comment has been collapsed",expand:"Expand",approved:"Approved",pending:"Pending",pendingMsg:"Pending, visible only to commenter.",edit:"Edit",editCancel:"Cancel Edit",delete:"Delete",deleteConfirm:"Confirm",pin:"Pin",unpin:"Unpin",seconds:"seconds ago",minutes:"minutes ago",hours:"hours ago",days:"days ago",now:"just now",adminCheck:"Enter admin password:",captchaCheck:"Enter the CAPTCHA to continue:",confirm:"Confirm",cancel:"Cancel",msgCenter:"Messages",ctrlCenter:"Admin",frontend:"Frontend",backend:"Backend",loading:"Loading",loadFail:"Load Failed",editing:"Editing",editFail:"Edit Failed",deleting:"Deleting",deleteFail:"Delete Failed",reqGot:"Request got",reqAborted:"Request timed out or terminated unexpectedly"},at="ArtalkI18n",ot={en:rt,"en-US":rt,"zh-CN":{placeholder:"键入内容...",noComment:"「此时无声胜有声」",send:"发送评论",save:"保存评论",nick:"昵称",email:"邮箱",link:"网址",emoticon:"表情",preview:"预览",image:"图片",uploadFail:"上传失败",commentFail:"评论失败",restoredMsg:"内容已自动恢复",onlyAdminCanReply:"仅管理员可评论",uploadLoginMsg:"填入你的名字邮箱才能上传哦",counter:"{count} 条评论",sortLatest:"最新",sortOldest:"最早",sortBest:"最热",sortAuthor:"作者",openComment:"打开评论",closeComment:"关闭评论",listLoadFailMsg:"无法获取评论列表数据",listRetry:"点击重新获取",loadMore:"加载更多",admin:"管理员",reply:"回复",voteUp:"赞同",voteDown:"反对",voteFail:"投票失败",readMore:"阅读更多",actionConfirm:"确认操作",collapse:"折叠",collapsed:"已折叠",collapsedMsg:"该评论已被系统或管理员折叠",expand:"展开",approved:"已审",pending:"待审",pendingMsg:"审核中,仅本人可见。",edit:"编辑",editCancel:"取消编辑",delete:"删除",deleteConfirm:"确认删除",pin:"置顶",unpin:"取消置顶",seconds:"秒前",minutes:"分钟前",hours:"小时前",days:"天前",now:"刚刚",adminCheck:"键入密码来验证管理员身份:",captchaCheck:"键入验证码继续:",confirm:"确认",cancel:"取消",msgCenter:"通知中心",ctrlCenter:"控制中心",frontend:"前端",backend:"后端",loading:"加载中",loadFail:"加载失败",editing:"修改中",editFail:"修改失败",deleting:"删除中",deleteFail:"删除失败",reqGot:"请求响应",reqAborted:"请求超时或意外终止"}};function lt(e){return e=e.replace(/^([a-zA-Z]+)(-[a-zA-Z]+)?$/,((e,t,n)=>t.toLowerCase()+(n||"").toUpperCase())),ot[e]?ot[e]:window[at]&&window[at][e]?window[at][e]:ot.en}let ct="en",dt=lt(ct);function ht(e){e!==ct&&(ct=e,dt="string"==typeof e?lt(e):e)}function ut(e,t={}){let n=(null==dt?void 0:dt[e])||e;return n=n.replace(/\{\s*(\w+?)\s*\}/g,((e,n)=>t[n]||"")),n}const pt="2.5.2";const gt=new class{constructor(){c(this,"ctx"),c(this,"data");const e=JSON.parse(window.localStorage.getItem("ArtalkUser")||"{}");this.data={nick:e.nick||"",email:e.email||"",link:e.link||"",token:e.token||"",isAdmin:e.isAdmin||!1}}setContext(e){this.ctx=e}update(e={}){var t;Object.entries(e).forEach((([e,t])=>{this.data[e]=t})),window.localStorage.setItem("ArtalkUser",JSON.stringify(this.data)),null==(t=this.ctx)||t.trigger("user-changed",this.data)}logout(){this.update({token:"",isAdmin:!1})}checkHasBasicUserInfo(){return!!this.data.nick&&!!this.data.email}},mt=window||{},ft=navigator||{};class kt{constructor(e){c(this,"comment"),c(this,"$el"),c(this,"$main"),c(this,"$header"),c(this,"$headerNick"),c(this,"$headerBadgeWrap"),c(this,"$body"),c(this,"$content"),c(this,"$childrenWrap"),c(this,"$actions"),c(this,"voteBtnUp"),c(this,"voteBtnDown"),c(this,"$replyTo"),c(this,"$replyAt"),this.comment=e}get ctx(){return this.comment.ctx}get data(){return this.comment.getData()}get conf(){return this.comment.conf}get cConf(){return this.comment.getConf()}}function yt(e){if(e.$headerNick=e.$el.querySelector(".atk-nick"),e.data.link){const t=h('');t.innerText=e.data.nick,t.href=y(e.data.link)?e.data.link:`https://${e.data.link}`,e.$headerNick.append(t)}else e.$headerNick.innerText=e.data.nick}function $t(e){e.$headerBadgeWrap=e.$el.querySelector(".atk-badge-wrap"),e.$headerBadgeWrap.innerHTML="";const t=e.data.badge_name,n=e.data.badge_color;if(t){const i=h('');i.innerText=t.replace("管理员",e.ctx.$t("admin")),i.style.backgroundColor=n||"",e.$headerBadgeWrap.append(i)}if(e.data.is_pinned){const t=h(`${e.ctx.$t("pin")}`);e.$headerBadgeWrap.append(t)}}function xt(e){const t=e.$el.querySelector(".atk-date");t.innerText=e.comment.getDateFormatted(),t.setAttribute("data-atk-comment-date",String(+new Date(e.data.date)))}function vt(e){if(!e.ctx.conf.uaBadge&&!e.data.ip_region)return;let t=e.$header.querySelector("atk-ua-wrap");if(t||(t=h(''),e.$header.append(t)),t.innerHTML="",e.data.ip_region){const n=h('');n.innerText=e.data.ip_region,t.append(n)}if(e.ctx.conf.uaBadge){const{browser:n,os:i}=e.comment.getUserUA();if(String(n).trim()){const e=h('');e.innerText=n,t.append(e)}if(String(i).trim()){const e=h('');e.innerText=i,t.append(e)}}}class bt{constructor(e,t){c(this,"ctx"),c(this,"conf"),c(this,"$el"),c(this,"isLoading",!1),c(this,"msgRecTimer"),c(this,"msgRecTimerFunc"),c(this,"isConfirming",!1),c(this,"confirmRecTimer"),this.ctx=e,this.$el=h(''),this.conf="object"!=typeof t?{text:t}:t,this.$el.innerText=this.getText(),this.conf.adminOnly&&this.$el.setAttribute("atk-only-admin-show","")}get isMessaging(){return!!this.msgRecTimer}appendTo(e){return e.append(this.$el),this}getText(){return"string"==typeof this.conf.text?this.conf.text:this.conf.text()}setClick(e){this.$el.onclick=t=>{if(t.stopPropagation(),!this.isLoading){if(this.conf.confirm&&!this.isMessaging){const e=()=>{this.isConfirming=!1,this.$el.classList.remove("atk-btn-confirm"),this.$el.innerText=this.getText()};if(!this.isConfirming)return this.isConfirming=!0,this.$el.classList.add("atk-btn-confirm"),this.$el.innerText=this.conf.confirmText||this.ctx.$t("actionConfirm"),void(this.confirmRecTimer=window.setTimeout((()=>e()),5e3));this.confirmRecTimer&&window.clearTimeout(this.confirmRecTimer),e()}if(this.msgRecTimer)return this.fireMsgRecTimer(),void this.clearMsgRecTimer();e()}}}updateText(e){e&&(this.conf.text=e),this.setLoading(!1),this.$el.innerText=this.getText()}setLoading(e,t){this.isLoading!==e&&(this.isLoading=e,e?(this.$el.classList.add("atk-btn-loading"),this.$el.innerText=t||`${this.ctx.$t("loading")}...`):(this.$el.classList.remove("atk-btn-loading"),this.$el.innerText=this.getText()))}setError(e){this.setMsg(e,"atk-btn-error")}setWarn(e){this.setMsg(e,"atk-btn-warn")}setSuccess(e){this.setMsg(e,"atk-btn-success")}setMsg(e,t,n,i){this.setLoading(!1),t&&this.$el.classList.add(t),this.$el.innerText=e,this.setMsgRecTimer((()=>{this.$el.innerText=this.getText(),t&&this.$el.classList.remove(t),i&&i()}),n||2500)}setMsgRecTimer(e,t){this.fireMsgRecTimer(),this.clearMsgRecTimer(),this.msgRecTimerFunc=e,this.msgRecTimer=window.setTimeout((()=>{e(),this.clearMsgRecTimer()}),t)}fireMsgRecTimer(){this.msgRecTimerFunc&&this.msgRecTimerFunc()}clearMsgRecTimer(){this.msgRecTimer&&window.clearTimeout(this.msgRecTimer),this.msgRecTimer=void 0,this.msgRecTimerFunc=void 0}}function wt(e){e.ctx.conf.vote&&(e.voteBtnUp=new bt(e.ctx,(()=>`${e.ctx.$t("voteUp")} (${e.data.vote_up||0})`)).appendTo(e.$actions),e.voteBtnUp.setClick((()=>{e.comment.getActions().vote("up")})),e.ctx.conf.voteDown&&(e.voteBtnDown=new bt(e.ctx,(()=>`${e.ctx.$t("voteDown")} (${e.data.vote_down||0})`)).appendTo(e.$actions),e.voteBtnDown.setClick((()=>{e.comment.getActions().vote("down")}))))}function Ct(e){if(!e.data.is_allow_reply)return;const t=h(`${e.ctx.$t("reply")}`);e.$actions.append(t),t.addEventListener("click",(t=>{t.stopPropagation(),e.cConf.onReplyBtnClick?e.cConf.onReplyBtnClick():e.ctx.replyComment(e.data,e.$el)}))}function St(e){const t=new bt(e.ctx,{text:()=>e.data.is_collapsed?e.ctx.$t("expand"):e.ctx.$t("collapse"),adminOnly:!0});t.appendTo(e.$actions),t.setClick((()=>{e.comment.getActions().adminEdit("collapsed",t)}))}function Tt(e){const t=new bt(e.ctx,{text:()=>e.data.is_pending?e.ctx.$t("pending"):e.ctx.$t("approved"),adminOnly:!0});t.appendTo(e.$actions),t.setClick((()=>{e.comment.getActions().adminEdit("pending",t)}))}function Et(e){const t=new bt(e.ctx,{text:()=>e.data.is_pinned?e.ctx.$t("unpin"):e.ctx.$t("pin"),adminOnly:!0});t.appendTo(e.$actions),t.setClick((()=>{e.comment.getActions().adminEdit("pinned",t)}))}function Lt(e){const t=new bt(e.ctx,{text:e.ctx.$t("edit"),adminOnly:!0});t.appendTo(e.$actions),t.setClick((()=>{e.ctx.editComment(e.data,e.$el)}))}function _t(e){const t=new bt(e.ctx,{text:e.ctx.$t("delete"),confirm:!0,confirmText:e.ctx.$t("deleteConfirm"),adminOnly:!0});t.appendTo(e.$actions),t.setClick((()=>{e.comment.getActions().adminDelete(t)}))}const At={Avatar:function(e){const t=e.$el.querySelector(".atk-avatar"),n=h(""),i=e.conf.avatarURLBuilder;if(n.src=i?i(e.data):e.comment.getGravatarURL(),e.data.link){const i=h('');i.href=y(e.data.link)?e.data.link:`https://${e.data.link}`,i.append(n),t.append(i)}else t.append(n)},Header:function(e){Object.entries({renderNick:yt,renderVerifyBadge:$t,renderDate:xt,renderUABadge:vt}).forEach((([t,n])=>{n(e)}))},Content:function(e){if(!e.data.is_collapsed)return e.$content.innerHTML=e.comment.getContentMarked(),void e.$content.classList.remove("atk-hide","atk-collapsed");e.$content.classList.add("atk-hide","atk-type-collapsed");const t=h(`\n
    \n ${e.ctx.$t("collapsedMsg")}\n ${e.ctx.$t("expand")}\n
    `);e.$body.insertAdjacentElement("beforeend",t);const n=t.querySelector(".atk-show-btn");n.addEventListener("click",(t=>{t.stopPropagation(),e.$content.classList.contains("atk-hide")?(e.$content.innerHTML=e.comment.getContentMarked(),e.$content.classList.remove("atk-hide"),T(e.$content),n.innerHTML=e.ctx.$t("collapse")):(e.$content.innerHTML="",e.$content.classList.add("atk-hide"),n.innerHTML=e.ctx.$t("expand"))}))},ReplyAt:function(e){e.cConf.isFlatMode||0===e.data.rid||e.cConf.replyTo&&(e.$replyAt=h(''),e.$replyAt.querySelector(".atk-nick").innerText=`${e.cConf.replyTo.nick}`,e.$replyAt.onclick=()=>{e.comment.getActions().goToReplyComment()},e.$headerBadgeWrap.insertAdjacentElement("afterend",e.$replyAt))},ReplyTo:function(e){if(!e.cConf.isFlatMode)return;if(!e.cConf.replyTo)return;e.$replyTo=h(`\n
    \n
    ${e.ctx.$t("reply")} :
    \n
    \n
    `);const t=e.$replyTo.querySelector(".atk-nick");t.innerText=`@${e.cConf.replyTo.nick}`,t.onclick=()=>{e.comment.getActions().goToReplyComment()};let n=st(e.ctx,e.cConf.replyTo.content);e.cConf.replyTo.is_collapsed&&(n=`[${e.ctx.$t("collapsed")}]`),e.$replyTo.querySelector(".atk-content").innerHTML=n,e.$body.prepend(e.$replyTo)},Pending:function(e){if(!e.data.is_pending)return;const t=h(`
    ${e.ctx.$t("pendingMsg")}
    `);e.$body.prepend(t)},Actions:function(e){Object.entries({renderVote:wt,renderReply:Ct,renderCollapse:St,renderModerator:Tt,renderPin:Et,renderEdit:Lt,renderDel:_t}).forEach((([t,n])=>{n(e)}))}};function Ot(e,t){t.forEach((({el:t,max:n,imgContains:i})=>{const s=()=>{t&&(e.scrollable?function(e){if(!e.el)return;if(e.el.classList.contains(Bt))return;e.el.classList.add(Bt),e.el.style.height=`${e.maxHeight}px`}({el:t,maxHeight:n}):function(e){if(!e.el)return;if(!e.maxHeight)return;if(e.el.classList.contains(Mt))return;e.el.classList.add(Mt),e.el.style.height=`${e.maxHeight}px`,e.el.style.overflow="hidden";const t=h(`
    ${ut("readMore")}`);t.onclick=t=>{t.stopPropagation(),Rt(e.el),e.postBtnClick&&e.postBtnClick(t)},e.el.append(t)}({el:t,maxHeight:n,postBtnClick:e.postExpandBtnClick}))},r=()=>{t&&u(t)>n&&s()};r(),i&&t&&function(e,t){if(!e)return;const n=e.getElementsByTagName("img");if(!n.length)return;let i=n.length;for(let s=0;s{i--,0===i&&t()})),0===i&&t()}(t,(()=>r()))}))}const Mt="atk-height-limit";function Rt(e){e&&e.classList.contains(Mt)&&(e.classList.remove(Mt),Array.from(e.children).forEach((e=>{e.classList.contains("atk-height-limit-btn")&&e.remove()})),e.style.height="",e.style.overflow="")}const Bt="atk-height-limit-scroll";class It extends kt{constructor(e){super(e)}render(){var e;return this.$el=h('
    \n
    \n
    \n
    \n
    \n \n \n \n
    \n
    \n
    \n
    \n \n
    \n
    \n
    \n'),this.$main=this.$el.querySelector(".atk-main"),this.$header=this.$el.querySelector(".atk-header"),this.$body=this.$el.querySelector(".atk-body"),this.$content=this.$body.querySelector(".atk-content"),this.$actions=this.$el.querySelector(".atk-actions"),this.$el.setAttribute("id",`atk-comment-${this.data.id}`),e=this,Object.entries(At).forEach((([t,n])=>{n(e)})),this.recoveryChildrenWrap(),this.$el}checkHeightLimit(){const e=this.ctx.conf.heightLimit;if(!e||!e.content||!e.children)return;const t=e.content,n=e.children;Ot({postExpandBtnClick:()=>{const e=this.comment.getChildren();1===e.length&&Rt(e[0].getRender().$content)},scrollable:e.scrollable},[{el:this.$content,max:t,imgContains:!0},{el:this.$replyTo,max:t,imgContains:!0},{el:this.$childrenWrap,max:n,imgContains:!1}])}heightLimitRemoveForChildren(){this.$childrenWrap&&Rt(this.$childrenWrap)}playFadeAnim(){T(this.comment.getRender().$el)}playFadeAnimForBody(){T(this.comment.getRender().$body)}getChildrenWrap(){return this.$childrenWrap}renderChildrenWrap(){return this.$childrenWrap||(this.$childrenWrap=h('
    '),this.$main.append(this.$childrenWrap)),this.$childrenWrap}recoveryChildrenWrap(){this.$childrenWrap&&this.$main.append(this.$childrenWrap)}setUnread(e){e?this.$el.classList.add("atk-unread"):this.$el.classList.remove("atk-unread")}setOpenable(e){e?this.$el.classList.add("atk-openable"):this.$el.classList.remove("atk-openable")}setOpenURL(e){this.setOpenable(!0),this.$el.onclick=t=>{t.preventDefault(),window.open(e),this.cConf.openEvt&&this.cConf.openEvt()}}setOpenAction(e){this.setOpenable(!0),this.$el.onclick=t=>{t.preventDefault(),e()}}}class Pt{constructor(e){c(this,"comment"),this.comment=e}get ctx(){return this.comment.ctx}get data(){return this.comment.getData()}get cConf(){return this.comment.getConf()}vote(e){const t="up"===e?this.comment.getRender().voteBtnUp:this.comment.getRender().voteBtnDown;this.ctx.getApi().comment.vote(this.data.id,`comment_${e}`).then((e=>{var t,n;this.data.vote_up=e.up,this.data.vote_down=e.down,null==(t=this.comment.getRender().voteBtnUp)||t.updateText(),null==(n=this.comment.getRender().voteBtnDown)||n.updateText()})).catch((e=>{null==t||t.setError(this.ctx.$t("voteFail")),console.log(e)}))}adminEdit(e,t){if(t.isLoading)return;t.setLoading(!0,`${this.ctx.$t("editing")}...`);const n=o({},this.data);"collapsed"===e?n.is_collapsed=!n.is_collapsed:"pending"===e?n.is_pending=!n.is_pending:"pinned"===e&&(n.is_pinned=!n.is_pinned),this.ctx.getApi().comment.commentEdit(n).then((e=>{t.setLoading(!1),this.comment.setData(e),this.ctx.listRefreshUI()})).catch((e=>{console.error(e),t.setError(this.ctx.$t("editFail"))}))}adminDelete(e){e.isLoading||(e.setLoading(!0,`${this.ctx.$t("deleting")}...`),this.ctx.getApi().comment.commentDel(this.data.id,this.data.site_name).then((()=>{e.setLoading(!1),this.cConf.onDelete&&this.cConf.onDelete(this.comment)})).catch((t=>{console.error(t),e.setError(this.ctx.$t("deleteFail"))})))}goToReplyComment(){const e=window.location.hash,t=`#atk-comment-${this.data.rid}`;window.location.hash=t,t===e&&window.dispatchEvent(new Event("hashchange"))}}class Ut extends v{constructor(e,t,n){super(e),c(this,"renderInstance"),c(this,"actionInstance"),c(this,"data"),c(this,"cConf"),c(this,"parent"),c(this,"children",[]),c(this,"nestCurt"),c(this,"nestMax"),this.nestMax=e.conf.nestMax||3,this.cConf=n,this.data=o({},t),this.data.date=this.data.date.replace(/-/g,"/"),this.parent=null,this.nestCurt=1,this.actionInstance=new Pt(this),this.renderInstance=new It(this)}render(){const e=this.renderInstance.render();this.$el&&this.$el.replaceWith(e),this.$el=e,this.cConf.afterRender&&this.cConf.afterRender()}getActions(){return this.actionInstance}getRender(){return this.renderInstance}getData(){return this.data}setData(e){this.data=e,this.render(),this.getRender().playFadeAnimForBody()}getParent(){return this.parent}getChildren(){return this.children}getNestCurt(){return this.nestCurt}getIsRoot(){return 0===this.data.rid}getID(){return this.data.id}putChild(e,t="append"){e.parent=this,e.nestCurt=this.nestCurt+1,this.children.push(e);const n=this.getChildrenEl();"append"===t?n.append(e.getEl()):"prepend"===t&&n.prepend(e.getEl()),e.getRender().playFadeAnim(),e.getRender().checkHeightLimit()}getChildrenEl(){let e=this.getRender().getChildrenWrap();return e||(e=this.nestCurt{n.parent&&(e.push(n.parent),t(n.parent))};return t(this),e}getEl(){return this.$el}getGravatarURL(){return e=this.ctx,t=this.data.email_encrypted,`${e.conf.gravatar.mirror.replace(/\/$/,"")}/${t}?d=${encodeURIComponent(e.conf.gravatar.default)}&s=80`;var e,t}getContentMarked(){return st(this.ctx,this.data.content)}getDateFormatted(){return f(new Date(this.data.date),this.ctx)}getUserUA(){const e=function(e){const t=String(e||ft.userAgent),n={os:"",osVersion:"",engine:"",browser:"",device:"",language:"",version:""},i={Trident:t.includes("Trident")||t.includes("NET CLR"),Presto:t.includes("Presto"),WebKit:t.includes("AppleWebKit"),Gecko:t.includes("Gecko/")},s={Safari:t.includes("Safari"),Chrome:t.includes("Chrome")||t.includes("CriOS"),IE:t.includes("MSIE")||t.includes("Trident"),Edge:t.includes("Edge")||t.includes("Edg"),Firefox:t.includes("Firefox")||t.includes("FxiOS"),"Firefox Focus":t.includes("Focus"),Chromium:t.includes("Chromium"),Opera:t.includes("Opera")||t.includes("OPR"),Vivaldi:t.includes("Vivaldi"),Yandex:t.includes("YaBrowser"),Kindle:t.includes("Kindle")||t.includes("Silk/"),360:t.includes("360EE")||t.includes("360SE"),UC:t.includes("UC")||t.includes(" UBrowser"),QQBrowser:t.includes("QQBrowser"),QQ:t.includes("QQ/"),Baidu:t.includes("Baidu")||t.includes("BIDUBrowser"),Maxthon:t.includes("Maxthon"),Sogou:t.includes("MetaSr")||t.includes("Sogou"),LBBROWSER:t.includes("LBBROWSER"),"2345Explorer":t.includes("2345Explorer"),TheWorld:t.includes("TheWorld"),MIUI:t.includes("MiuiBrowser"),Quark:t.includes("Quark"),Qiyu:t.includes("Qiyu"),Wechat:t.includes("MicroMessenger"),Taobao:t.includes("AliApp(TB"),Alipay:t.includes("AliApp(AP"),Weibo:t.includes("Weibo"),Douban:t.includes("com.douban.frodo"),Suning:t.includes("SNEBUY-APP"),iQiYi:t.includes("IqiyiApp")},r={Windows:t.includes("Windows"),Linux:t.includes("Linux")||t.includes("X11"),macOS:t.includes("Macintosh"),Android:t.includes("Android")||t.includes("Adr"),Ubuntu:t.includes("Ubuntu"),FreeBSD:t.includes("FreeBSD"),Debian:t.includes("Debian"),"Windows Phone":t.includes("IEMobile")||t.includes("Windows Phone"),BlackBerry:t.includes("BlackBerry")||t.includes("RIM"),MeeGo:t.includes("MeeGo"),Symbian:t.includes("Symbian"),iOS:t.includes("like Mac OS X"),"Chrome OS":t.includes("CrOS"),WebOS:t.includes("hpwOS")},a={Mobile:t.includes("Mobi")||t.includes("iPh")||t.includes("480"),Tablet:t.includes("Tablet")||t.includes("Pad")||t.includes("Nexus 7")};a.Mobile?a.Mobile=!t.includes("iPad"):s.Chrome&&t.includes("Edg")?(s.Chrome=!1,s.Edge=!0):mt.showModalDialog&&mt.chrome&&(s.Chrome=!1,s[360]=!0),n.device="PC",n.language=(()=>{const e=(ft.browserLanguage||ft.language).split("-");return e[1]&&(e[1]=e[1].toUpperCase()),e.join("_")})();const o={engine:i,browser:s,os:r,device:a};Object.entries(o).forEach((([e,t])=>{Object.entries(t).forEach((([t,i])=>{!0===i&&(n[e]=t)}))}));const l={Windows:()=>{const e=t.replace(/^.*Windows NT ([\d.]+);.*$/,"$1");return{6.4:"10",6.3:"8.1",6.2:"8",6.1:"7","6.0":"Vista",5.2:"XP",5.1:"XP","5.0":"2000","10.0":"10","11.0":"11"}[e]||e},Android:()=>t.replace(/^.*Android ([\d.]+);.*$/,"$1"),iOS:()=>t.replace(/^.*OS ([\d_]+) like.*$/,"$1").replace(/_/g,"."),Debian:()=>t.replace(/^.*Debian\/([\d.]+).*$/,"$1"),"Windows Phone":()=>t.replace(/^.*Windows Phone( OS)? ([\d.]+);.*$/,"$2"),macOS:()=>t.replace(/^.*Mac OS X ([\d_]+).*$/,"$1").replace(/_/g,"."),WebOS:()=>t.replace(/^.*hpwOS\/([\d.]+);.*$/,"$1")};n.osVersion="",l[n.os]&&(n.osVersion=l[n.os](),n.osVersion===t&&(n.osVersion=""));const c={Safari:()=>t.replace(/^.*Version\/([\d.]+).*$/,"$1"),Chrome:()=>t.replace(/^.*Chrome\/([\d.]+).*$/,"$1").replace(/^.*CriOS\/([\d.]+).*$/,"$1"),IE:()=>t.replace(/^.*MSIE ([\d.]+).*$/,"$1").replace(/^.*rv:([\d.]+).*$/,"$1"),Edge:()=>t.replace(/^.*(Edge|Edg|Edg[A-Z]{1})\/([\d.]+).*$/,"$2"),Firefox:()=>t.replace(/^.*Firefox\/([\d.]+).*$/,"$1").replace(/^.*FxiOS\/([\d.]+).*$/,"$1"),"Firefox Focus":()=>t.replace(/^.*Focus\/([\d.]+).*$/,"$1"),Chromium:()=>t.replace(/^.*Chromium\/([\d.]+).*$/,"$1"),Opera:()=>t.replace(/^.*Opera\/([\d.]+).*$/,"$1").replace(/^.*OPR\/([\d.]+).*$/,"$1"),Vivaldi:()=>t.replace(/^.*Vivaldi\/([\d.]+).*$/,"$1"),Yandex:()=>t.replace(/^.*YaBrowser\/([\d.]+).*$/,"$1"),Kindle:()=>t.replace(/^.*Version\/([\d.]+).*$/,"$1"),Maxthon:()=>t.replace(/^.*Maxthon\/([\d.]+).*$/,"$1"),QQBrowser:()=>t.replace(/^.*QQBrowser\/([\d.]+).*$/,"$1"),QQ:()=>t.replace(/^.*QQ\/([\d.]+).*$/,"$1"),Baidu:()=>t.replace(/^.*BIDUBrowser[\s/]([\d.]+).*$/,"$1"),UC:()=>t.replace(/^.*UC?Browser\/([\d.]+).*$/,"$1"),Sogou:()=>t.replace(/^.*SE ([\d.X]+).*$/,"$1").replace(/^.*SogouMobileBrowser\/([\d.]+).*$/,"$1"),"2345Explorer":()=>t.replace(/^.*2345Explorer\/([\d.]+).*$/,"$1"),TheWorld:()=>t.replace(/^.*TheWorld ([\d.]+).*$/,"$1"),MIUI:()=>t.replace(/^.*MiuiBrowser\/([\d.]+).*$/,"$1"),Quark:()=>t.replace(/^.*Quark\/([\d.]+).*$/,"$1"),Qiyu:()=>t.replace(/^.*Qiyu\/([\d.]+).*$/,"$1"),Wechat:()=>t.replace(/^.*MicroMessenger\/([\d.]+).*$/,"$1"),Taobao:()=>t.replace(/^.*AliApp\(TB\/([\d.]+).*$/,"$1"),Alipay:()=>t.replace(/^.*AliApp\(AP\/([\d.]+).*$/,"$1"),Weibo:()=>t.replace(/^.*weibo__([\d.]+).*$/,"$1"),Douban:()=>t.replace(/^.*com.douban.frodo\/([\d.]+).*$/,"$1"),Suning:()=>t.replace(/^.*SNEBUY-APP([\d.]+).*$/,"$1"),iQiYi:()=>t.replace(/^.*IqiyiVersion\/([\d.]+).*$/,"$1")};return n.version="",c[n.browser]&&(n.version=c[n.browser](),n.version===t&&(n.version="")),n.version.indexOf(".")&&(n.version=n.version.substring(0,n.version.indexOf("."))),"iOS"===n.os&&t.includes("iPad")?n.os="iPadOS":"Edge"!==n.browser||t.includes("Edg")?"MIUI"===n.browser?n.os="Android":"Chrome"===n.browser&&Number(n.version)>27||"Opera"===n.browser&&Number(n.version)>12||"Yandex"===n.browser?n.engine="Blink":void 0===n.browser&&(n.browser="Unknow App"):n.engine="EdgeHTML",n}(this.data.ua);return{browser:`${e.browser} ${e.version}`,os:`${e.os} ${e.osVersion}`}}getConf(){return this.cConf}}class qt{constructor(e,t){c(this,"conf"),c(this,"total"),c(this,"$el"),c(this,"$input"),c(this,"inputTimer"),c(this,"$prevBtn"),c(this,"$nextBtn"),c(this,"page",1),this.total=e,this.conf=t,this.$el=h('
    \n
    \n
    Prev
    \n \n
    Next
    \n
    \n
    '),this.$input=this.$el.querySelector(".atk-input"),this.$input.value=`${this.page}`,this.$input.oninput=()=>this.input(),this.$input.onkeydown=e=>this.keydown(e),this.$prevBtn=this.$el.querySelector(".atk-btn-prev"),this.$nextBtn=this.$el.querySelector(".atk-btn-next"),this.$prevBtn.onclick=()=>this.prev(),this.$nextBtn.onclick=()=>this.next(),this.checkDisabled()}get pageSize(){return this.conf.pageSize}get offset(){return this.pageSize*(this.page-1)}get maxPage(){return Math.ceil(this.total/this.pageSize)}update(e,t){this.page=Math.ceil(e/this.pageSize)+1,this.total=t,this.setInput(this.page),this.checkDisabled()}setInput(e){this.$input.value=`${e}`}input(e=!1){window.clearTimeout(this.inputTimer);const t=this.$input.value.trim(),n=()=>{if(""===t)return void this.setInput(this.page);let e=Number(t);Number.isNaN(e)||e<1?this.setInput(this.page):(e>this.maxPage&&(this.setInput(this.maxPage),e=this.maxPage),this.change(e))};e?n():this.inputTimer=window.setTimeout((()=>n()),800)}prev(){const e=this.page-1;e<1||this.change(e)}next(){const e=this.page+1;e>this.maxPage||this.change(e)}change(e){this.page=e,this.conf.onChange(this.offset),this.setInput(e),this.checkDisabled()}checkDisabled(){this.page+1>this.maxPage?this.$nextBtn.classList.add("atk-disabled"):this.$nextBtn.classList.remove("atk-disabled"),this.page-1<1?this.$prevBtn.classList.add("atk-disabled"):this.$prevBtn.classList.remove("atk-disabled")}keydown(e){const t=e.keyCode||e.which;if(38===t){const e=Number(this.$input.value)+1;if(e>this.maxPage)return;this.setInput(e),this.input()}else if(40===t){const e=Number(this.$input.value)-1;if(e<1)return;this.setInput(e),this.input()}else 13===t&&this.input(!0)}setLoading(e){e?b(this.$el):w(this.$el)}}const Dt={createInstance(e){const t=new qt(e.total,{pageSize:e.pageSize,onChange:t=>d(this,null,(function*(){if(!0===e.list.conf.editorTravel&&e.list.ctx.editorTravelBack(),yield e.list.fetchComments(t),e.list.repositionAt){(e.list.scrollListenerAt||window).scroll({top:e.list.repositionAt?g(e.list.repositionAt).top:0,left:0})}}))});return[t,t.$el]},setLoading(e){this.instance.setLoading(e)},update(e,t){this.instance.update(e,t)},next(){this.instance.next()}};class zt{constructor(e){c(this,"conf"),c(this,"$el"),c(this,"$loading"),c(this,"$text"),c(this,"offset",0),c(this,"total",0),c(this,"origText","Load More"),this.conf=e,this.origText=this.conf.text||this.origText,this.$el=h(``),this.$loading=this.$el.querySelector(".atk-loading-icon"),this.$text=this.$el.querySelector(".atk-text"),this.$el.onclick=()=>{this.click()}}get hasMore(){return this.total>this.offset+this.conf.pageSize}click(){this.hasMore&&this.conf.onClick(this.offset+this.conf.pageSize),this.checkDisabled()}show(){this.$el.style.display=""}hide(){this.$el.style.display="none"}setLoading(e){this.$loading.style.display=e?"":"none",this.$text.style.display=e?"none":""}showErr(e){this.setLoading(!1),this.$text.innerText=e,this.$el.classList.add("atk-err"),window.setTimeout((()=>{this.$text.innerText=this.origText,this.$el.classList.remove("atk-err")}),2e3)}update(e,t){this.offset=e,this.total=t,this.checkDisabled()}checkDisabled(){this.hasMore?this.show():this.hide()}}const Wt={pagination:Dt,"read-more":{createInstance(e){const t=new zt({pageSize:e.pageSize,onClick:t=>d(this,null,(function*(){yield e.list.fetchComments(t)})),text:ut("loadMore")});if(e.list.conf.pagination.autoLoad){const n=e.list.scrollListenerAt||document;this.autoLoadScrollEvent&&n.removeEventListener("scroll",this.autoLoadScrollEvent),this.autoLoadScrollEvent=()=>{if("read-more"!==e.mode||!(null==t?void 0:t.hasMore)||e.list.getLoading())return;const n=e.list.$el.querySelector(".atk-list-comments-wrap > .atk-comment-wrap:nth-last-child(3)");n&&function(e,t=document.documentElement){const n=t.clientHeight,i=t.scrollTop,s=i+n,r=e.getBoundingClientRect();return r.top+i+r.height<=s}(n,e.list.scrollListenerAt)&&t.click()},n.addEventListener("scroll",this.autoLoadScrollEvent)}return[t,t.$el]},setLoading(e){this.instance.setLoading(e)},update(e,t){this.instance.update(e,t)},showErr(e){this.instance.showErr(e)},next(){this.instance.click()}}};class Ft{constructor(e){c(this,"conf"),this.conf=e,this.init()}getAdaptor(){return Wt[this.conf.mode]}init(){const e=this.getAdaptor(),[t,n]=e.createInstance(this.conf);e.instance=t,e.el=n,this.conf.list.$el.append(e.el)}setLoading(e){this.getAdaptor().setLoading(e)}update(e,t){this.getAdaptor().update(e,t)}getEl(){return this.getAdaptor().el}showErr(e){const t=this.getAdaptor(),n=t.showErr;n&&n.bind(t)(e)}setMode(e){e!==this.conf.mode&&(this.getEl().remove(),this.conf.mode=e,this.init())}next(){this.getAdaptor().next()}}function jt(e,t,n){const i=function(e,t){const n=e.split("."),i=t.split(".");for(let s=0;s<3;s++){const e=Number(n[s]),t=Number(i[s]);if(e>t)return 1;if(t>e)return-1;if(!Number.isNaN(e)&&Number.isNaN(t))return 1;if(Number.isNaN(e)&&!Number.isNaN(t))return-1}return 0}(t,n);if(0!==i){const s=h(`
    请更新 Artalk ${ut(i<0?"frontend":"backend")}以获得完整体验 (帮助文档)

    当前版本:${ut("frontend")} ${t} / ${ut("backend")} ${n}

    `),r=h('忽略');return r.onclick=()=>{E(e.$el.parentElement,null),e.ctx.conf.versionCheck=!1,e.fetchComments(0)},s.append(r),E(e.$el.parentElement,s,'Artalk Warn'),!0}return!1}function Nt(e){const{$dropdownWrap:t,dropdownList:n}=e;if(t.querySelector(".atk-dropdown"))return;t.classList.add("atk-dropdown-wrap"),t.append(h(''));let i=0;const s=h('
      ');n.forEach(((e,t)=>{const n=e[0],r=e[1],a=h('
    • '),o=a.querySelector("span");o.innerText=n,o.onclick=()=>{((e,t,n,r)=>{r(),i=e,s.querySelectorAll(".active").forEach((e=>{e.classList.remove("active")})),t.classList.add("active"),s.style.display="none",setTimeout((()=>{s.style.display=""}),80)})(t,a,0,r)},s.append(a),t===i&&a.classList.add("active")})),t.append(s)}const Ht={el:"",pageKey:"",pageTitle:"",server:"",site:"",placeholder:"",noComment:"",sendBtn:"",darkMode:!1,editorTravel:!0,flatMode:"auto",nestMax:2,nestSort:"DATE_ASC",emoticons:"https://cdn.jsdelivr.net/gh/ArtalkJS/Emoticons/grps/default.json",vote:!0,voteDown:!1,uaBadge:!0,listSort:!0,preview:!0,countEl:"#ArtalkCount",pvEl:"#ArtalkPV",gravatar:{default:"mp",mirror:"https://cravatar.cn/avatar/"},pagination:{pageSize:20,readMore:!0,autoLoad:!0},heightLimit:{content:300,children:400,scrollable:!1},imgUpload:!0,reqTimeout:15e3,versionCheck:!0,useBackendConf:!0,locale:"zh-CN"};function Qt(e){const t=x(Ht,e);if("string"==typeof t.el&&t.el)try{const e=document.querySelector(t.el);if(!e)throw Error(`Target element "${t.el}" was not found.`);t.el=e}catch(n){throw console.error(n),new Error("Please check your Artalk `el` config.")}return t.server=t.server.replace(/\/$/,"").replace(/\/api\/?$/,""),t.pageKey||(t.pageKey=`${window.location.pathname}`),t.pageTitle||(t.pageTitle=`${document.title}`),"auto"===t.locale&&(t.locale=navigator.language),t}function Vt(e){const t=["el","pageKey","pageTitle","server","site","darkMode"];return Object.keys(e).forEach((n=>{t.includes(n)&&delete e[n]})),e.emoticons&&"string"==typeof e.emoticons&&(e.emoticons=e.emoticons.trim(),e.emoticons.startsWith("[")||e.emoticons.startsWith("{")?e.emoticons=JSON.parse(e.emoticons):"false"===e.emoticons&&(e.emoticons=!1)),e}class Zt extends v{constructor(e){super(e),c(this,"$commentsWrap"),c(this,"data"),c(this,"isLoading",!1),c(this,"confLoaded",!1),c(this,"noCommentText"),c(this,"_nestSortBy"),c(this,"_flatMode"),c(this,"_pageMode"),c(this,"pgHolder"),c(this,"_pageSize"),c(this,"scrollListenerAt"),c(this,"repositionAt"),c(this,"renderComment"),c(this,"paramsEditor"),c(this,"onAfterLoad"),c(this,"unread",[]),c(this,"unreadHighlight"),this.$el=h('
      \n
      \n
      '),this.$commentsWrap=this.$el.querySelector(".atk-list-comments-wrap"),window.setInterval((()=>{this.$el.querySelectorAll("[data-atk-comment-date]").forEach((e=>{const t=e.getAttribute("data-atk-comment-date");e.innerText=f(new Date(Number(t)),this.ctx)}))}),3e4),this.ctx.on("conf-loaded",(()=>{}))}get nestSortBy(){return this._nestSortBy||this.ctx.conf.nestSort||"DATE_ASC"}set nestSortBy(e){this._nestSortBy=e}get flatMode(){return void 0!==this._flatMode?this._flatMode:!0===this.ctx.conf.flatMode||Number(this.ctx.conf.nestMax)<=1||!("auto"!==this.ctx.conf.flatMode||!window.matchMedia("(max-width: 768px)").matches)}set flatMode(e){this._flatMode=e}get pageMode(){return this._pageMode||(this.conf.pagination.readMore?"read-more":"pagination")}set pageMode(e){var t;this._pageMode=e,null==(t=this.pgHolder)||t.setMode(this._pageMode)}get pageSize(){return this._pageSize||this.conf.pagination.pageSize}set pageSize(e){this._pageSize=e}getData(){return this.data}clearData(){this.data=void 0}getLoading(){return this.isLoading}getCommentsWrapEl(){return this.$commentsWrap}setLoading(e,t=!1){var n;this.isLoading=e,t?function(e,t){e?b(t):w(t)}(e,this.$el):null==(n=this.pgHolder)||n.setLoading(e)}fetchComments(e){return d(this,null,(function*(){if(this.isLoading)return;const t=0===e,n=e=>this.setLoading(e,t);let i;n(!0),this.ctx.trigger("list-load"),("read-more"===this.pageMode&&t||"pagination"===this.pageMode)&&this.ctx.clearAllComments();try{i=yield this.ctx.getApi().comment.get(e,this.pageSize,this.flatMode,this.paramsEditor)}catch(s){throw this.onError(s.msg||String(s),e,s.data),s}finally{n(!1)}E(this.$el,null);try{this.onLoad(i,e)}catch(s){throw this.onError(String(s),e),s}finally{n(!1)}}))}onLoad(e,t){if(this.data=e,!this.confLoaded){const t=Vt(e.conf.frontend_conf);this.conf.useBackendConf?this.ctx.updateConf(t):this.ctx.updateConf({}),this.confLoaded=!0}this.ctx.conf.versionCheck&&jt(this,pt,e.api_version.version)||(this.importComments(e.comments),this.refreshPagination(t,this.flatMode?e.total:e.total_roots),this.refreshUI(),this.ctx.updateNotifies(e.unread||[]),this.ctx.trigger("list-loaded"),this.onAfterLoad&&this.onAfterLoad(e))}refreshPagination(e,t){var n;this.pgHolder||(this.pgHolder=new Ft({list:this,mode:this.pageMode,pageSize:this.pageSize,total:t})),null==(n=this.pgHolder)||n.update(e,t)}onError(e,t,n){var i;this.confLoaded||this.ctx.updateConf({}),e=String(e),console.error(e),0===t||"read-more"!==this.pageMode?E(this.$el,function(e,t,n){const i=h(`${t},${ut("listLoadFailMsg")}
      `),s=h(`${ut("listRetry")}`);s.onclick=()=>e.fetchComments(0),i.appendChild(s);const r=h(' | 打开控制台');i.appendChild(r),gt.data.isAdmin||r.classList.add("atk-hide");let a="";if(null==n?void 0:n.err_no_site){const t={create_name:e.ctx.conf.site,create_urls:`${window.location.protocol}//${window.location.host}`};a=`sites|${JSON.stringify(t)}`}return r.onclick=()=>e.ctx.showSidebar({view:a}),i}(this,e,n)):null==(i=this.pgHolder)||i.showErr(this.$t("loadFail"))}refreshUI(){!function(e){const t=e.ctx.getCommentList().length<=0;let n=e.getCommentsWrapEl().querySelector(".atk-list-no-comment");t?n||(n=h('
      '),n.innerHTML=e.noCommentText||e.ctx.conf.noComment||e.ctx.$t("noComment"),e.getCommentsWrapEl().appendChild(n)):null==n||n.remove(),e.ctx.checkAdminShowEl()}(this)}reload(){this.fetchComments(0)}createComment(e,t){t||(t=this.ctx.getCommentDataList());const n=new Ut(this.ctx,e,{isFlatMode:this.flatMode,afterRender:()=>{this.renderComment&&this.renderComment(n)},onDelete:e=>{this.ctx.deleteComment(e),this.refreshUI()},replyTo:e.rid?t.find((t=>t.id===e.rid)):void 0});return n.render(),this.ctx.getCommentList().push(n),n}importComments(e){this.flatMode?e.forEach((t=>{this.putCommentFlatMode(t,e,"append")})):this.importCommentsNest(e)}importCommentsNest(e){const t=function(e,t="DATE_DESC",n=2){const i=[];e.filter((e=>0===e.rid)).forEach((t=>{const s={id:t.id,comment:t,children:[],level:1};s.parent=s,i.push(s),function t(i){const s=e.filter((e=>e.rid===i.id));0!==s.length&&(i.level>=n&&(i=i.parent),s.forEach((e=>{const n={id:e.id,comment:e,children:[],parent:i,level:i.level+1};i.children.push(n),t(n)})))}(s)}));const s=(n,i)=>{let s=n.id-i.id;return"DATE_ASC"===t?s=+new Date(n.comment.date)-+new Date(i.comment.date):"DATE_DESC"===t?s=+new Date(i.comment.date)-+new Date(n.comment.date):"SRC_INDEX"===t?s=e.indexOf(n.comment)-e.indexOf(i.comment):"VOTE_UP_DESC"===t&&(s=i.comment.vote_up-n.comment.vote_up),s};return function e(t){t.forEach((t=>{t.children=t.children.sort(s),e(t.children)}))}(i),i}(e,this.nestSortBy,this.conf.nestMax);t.forEach((t=>{const n=this.createComment(t.comment,e);this.$commentsWrap.appendChild(n.getEl()),n.getRender().playFadeAnim();const i=this;!function t(n,s){s.children.forEach((s=>{const r=s.comment,a=i.createComment(r,e);n.putChild(a),t(a,s)}))}(n,t),n.getRender().checkHeightLimit()}))}putCommentFlatMode(e,t,n){e.is_collapsed&&(e.is_allow_reply=!1);const i=this.createComment(e,t);return e.visible&&("append"===n&&this.$commentsWrap.append(i.getEl()),"prepend"===n&&this.$commentsWrap.prepend(i.getEl()),i.getRender().playFadeAnim()),i.getRender().checkHeightLimit(),i}insertComment(e){if(this.flatMode){C(this.putCommentFlatMode(e,this.ctx.getCommentDataList(),"prepend").getEl())}else{const t=this.createComment(e);if(0===e.rid)this.$commentsWrap.prepend(t.getEl());else{const n=this.ctx.findComment(e.rid);n&&(n.putChild(t,"DATE_ASC"===this.nestSortBy?"append":"prepend"),t.getParents().forEach((e=>{e.getRender().heightLimitRemoveForChildren()})))}t.getRender().checkHeightLimit(),C(t.getEl()),t.getRender().playFadeAnim()}this.data&&(this.data.total+=1),this.refreshUI(),this.ctx.trigger("list-loaded"),this.ctx.trigger("list-inserted",e)}updateComment(e){const t=this.ctx.findComment(e.id);t&&t.setData(e)}updateUnread(e){this.unread=e,!0===this.unreadHighlight&&this.ctx.getCommentList().forEach((e=>{const t=this.unread.find((t=>t.comment_id===e.getID()));t?(e.getRender().setUnread(!0),e.getRender().setOpenAction((()=>{window.open(t.read_link),this.unread=this.unread.filter((t=>t.comment_id!==e.getID())),this.ctx.updateNotifies(this.unread)}))):e.getRender().setUnread(!1)}))}}class Gt extends Zt{constructor(e){const t=h('
      \n
      \n
      \n
      \n
      \n
      \n \n \n \n
      \n
      \n
      \n
      \n
      \n \n
      \n');super(e),c(this,"$closeCommentBtn"),c(this,"$openSidebarBtn"),c(this,"$unreadBadge"),c(this,"$commentCount"),c(this,"$commentCountNum"),c(this,"$dropdownWrap"),c(this,"goToCommentFounded",!1),c(this,"goToCommentDelay",!0),t.querySelector(".atk-list-body").append(this.$el),this.$el=t,this.repositionAt=this.$el,this.initListActionBtn();this.$commentCount=this.$el.querySelector(".atk-comment-count");const n=()=>{this.$commentCount.innerHTML=this.$t("counter",{count:'0'}),this.$commentCountNum=this.$commentCount.querySelector(".atk-comment-count-num")};n(),this.$el.querySelector(".atk-copyright").innerHTML=`Powered By Artalk`,this.ctx.on("conf-loaded",(()=>{n(),this.refreshUI()}))}initListActionBtn(){this.$openSidebarBtn=this.$el.querySelector('[data-action="open-sidebar"]'),this.$closeCommentBtn=this.$el.querySelector('[data-action="admin-close-comment"]'),this.$unreadBadge=this.$el.querySelector(".atk-unread-badge"),this.$openSidebarBtn.addEventListener("click",(()=>{this.ctx.showSidebar()})),this.$closeCommentBtn.addEventListener("click",(()=>{this.data&&(this.data.page.admin_only=!this.data.page.admin_only,this.adminPageEditSave())}))}refreshUI(){var e;super.refreshUI(),this.$commentCountNum.innerText=String(Number(null==(e=this.data)?void 0:e.total)||0),gt.data.nick&>.data.email?this.$openSidebarBtn.classList.remove("atk-hide"):this.$openSidebarBtn.classList.add("atk-hide"),this.$openSidebarBtn.querySelector(".atk-text").innerText=gt.data.isAdmin?this.$t("ctrlCenter"):this.$t("msgCenter"),this.data&&this.data.page&&!0===this.data.page.admin_only?(this.ctx.editorClose(),this.$closeCommentBtn.innerHTML=this.$t("openComment")):(this.ctx.editorOpen(),this.$closeCommentBtn.innerHTML=this.$t("closeComment")),this.ctx.conf.listSort?this.initDropdown():function(e){var t,n;const{$dropdownWrap:i}=e;i.classList.remove("atk-dropdown-wrap"),null==(t=i.querySelector(".atk-arrow-down-icon"))||t.remove(),null==(n=i.querySelector(".atk-dropdown"))||n.remove()}({$dropdownWrap:this.$commentCount})}onLoad(e,t){super.onLoad(e,t),this.goToCommentFounded||this.checkGoToCommentByUrlHash(),!0===this.ctx.conf.editorTravel&&this.ctx.editorTravelBack()}checkGoToCommentByUrlHash(){var e;let t=Number(p("atk_comment"));if(!t){const e=window.location.hash.match(/#atk-comment-([0-9]+)/);if(!e||!e[1]||Number.isNaN(Number(e[1])))return;t=Number(e[1])}if(!t)return;const n=this.ctx.findComment(t);if(!n)return void(null==(e=this.pgHolder)||e.next());const i=p("atk_notify_key");i&&this.ctx.getApi().user.markRead(t,i).then((()=>{this.unread=this.unread.filter((e=>e.comment_id!==t)),this.updateUnread(this.unread)})),n.getParents().forEach((e=>{e.getRender().heightLimitRemoveForChildren()}));const s=()=>{C(n.getEl(),!1),n.getEl().classList.remove("atk-flash-once"),window.setTimeout((()=>{n.getEl().classList.add("atk-flash-once")}),150)};this.goToCommentDelay?window.setTimeout((()=>s()),350):s(),this.goToCommentFounded=!0,this.goToCommentDelay=!0}adminPageEditSave(){this.data&&this.data.page&&(this.ctx.editorShowLoading(),this.ctx.getApi().page.pageEdit(this.data.page).then((e=>{this.data&&(this.data.page=o({},e)),this.refreshUI()})).catch((e=>{this.ctx.editorShowNotify(`${this.$t("editFail")}: ${e.msg||String(e)}`,"e")})).finally((()=>{this.ctx.editorHideLoading()})))}showUnreadBadge(e){e>0?(this.$unreadBadge.innerText=`${Number(e||0)}`,this.$unreadBadge.style.display="block"):this.$unreadBadge.style.display="none"}initDropdown(){const e=e=>{this.paramsEditor=e,this.fetchComments(0)};Nt({$dropdownWrap:this.$commentCount,dropdownList:[[this.$t("sortLatest"),()=>{e((e=>{e.sort_by="date_desc"}))}],[this.$t("sortBest"),()=>{e((e=>{e.sort_by="vote"}))}],[this.$t("sortOldest"),()=>{e((e=>{e.sort_by="date_asc"}))}],[this.$t("sortAuthor"),()=>{e((e=>{e.view_only_admin=!0}))}]]})}updateUnread(e){super.updateUnread(e),this.showUnreadBadge((null==e?void 0:e.length)||0)}}class Kt{constructor(e,t){c(this,"conf"),c(this,"$root"),c(this,"markedReplacers",[]),c(this,"commentList",[]),c(this,"eventList",[]),this.conf=e,this.$root=t||document.createElement("div"),this.$root.classList.add("artalk"),this.$root.innerHTML=""}inject(e,t){this[e]=t}get(e){return this[e]}getApi(){return this.api}getCommentList(){return this.commentList}getCommentDataList(){return this.commentList.map((e=>e.getData()))}findComment(e){return this.commentList.find((t=>t.getData().id===e))}deleteComment(e){let t;if("number"==typeof e){const n=this.findComment(e);if(!n)throw Error(`Comment ${e} cannot be found`);t=n}else t=e;if(t.getEl().remove(),this.commentList.splice(this.commentList.indexOf(t),1),this.list){const e=this.list.getData();e&&(e.total-=1),this.list.refreshUI()}}clearAllComments(){this.list&&(this.list.getCommentsWrapEl().innerHTML="",this.list.clearData()),this.commentList=[]}insertComment(e){var t;null==(t=this.list)||t.insertComment(e)}updateComment(e){var t;null==(t=this.list)||t.updateComment(e)}replyComment(e,t,n){this.editor.setReply(e,t,n)}cancelReplyComment(){this.editor.cancelReply()}editComment(e,t){this.editor.setEditComment(e,t)}cancelEditComment(){this.editor.cancelEditComment()}updateNotifies(e){var t;null==(t=this.list)||t.updateUnread(e)}listReload(){var e;null==(e=this.list)||e.reload()}reload(){this.listReload()}listRefreshUI(){var e;null==(e=this.list)||e.refreshUI()}listHashGotoCheck(){if(!(this.list&&this.list instanceof Gt))return;const e=this.list;e.goToCommentDelay=!1,e.checkGoToCommentByUrlHash()}editorOpen(){this.editor.open()}editorClose(){this.editor.close()}editorShowLoading(){this.editor.showLoading()}editorHideLoading(){this.editor.hideLoading()}editorShowNotify(e,t){this.editor.showNotify(e,t)}editorTravel(e){this.editor.travel(e)}editorTravelBack(){this.editor.travelBack()}showSidebar(e){this.sidebarLayer.show(e)}hideSidebar(){this.sidebarLayer.hide()}checkAdmin(e){this.checkerLauncher.checkAdmin(e)}checkCaptcha(e){this.checkerLauncher.checkCaptcha(e)}checkAdminShowEl(){const e=[];this.$root.querySelectorAll("[atk-only-admin-show]").forEach((t=>e.push(t)));const{$wrap:t}=A();t&&t.querySelectorAll("[atk-only-admin-show]").forEach((t=>e.push(t)));const n=document.querySelector(".atk-sidebar");n&&n.querySelectorAll("[atk-only-admin-show]").forEach((t=>e.push(t))),e.forEach((e=>{this.user.data.isAdmin?e.classList.remove("atk-hide"):e.classList.add("atk-hide")}))}on(e,t,n="internal"){this.eventList.push({name:e,handler:t,scope:n})}off(e,t,n="internal"){this.eventList=this.eventList.filter((i=>t?!(i.name===e&&i.handler===t&&i.scope===n):!(i.name===e&&i.scope===n)))}trigger(e,t,n){this.eventList.filter((t=>t.name===e&&(!n||t.scope===n))).map((e=>e.handler)).forEach((e=>e(t)))}$t(e,t={}){return ut(e,t)}setDarkMode(e){B(this,e)}updateConf(e){this.conf=x(this.conf,e),this.trigger("conf-loaded")}getMarkedInstance(){return it()}}class Yt{constructor(e,t){return c(this,"ctx"),c(this,"$el"),c(this,"$content"),c(this,"$actions"),this.ctx=e,this.$el=h('
      \n
      \n
      \n
      \n
      \n
      '),this.$actions=this.$el.querySelector(".atk-layer-dialog-actions"),this.$content=this.$el.querySelector(".atk-layer-dialog-content"),this.$content.appendChild(t),this}setYes(e){const t=h(``);return t.onclick=this.onBtnClick(e),this.$actions.appendChild(t),this}setNo(e){const t=h(``);return t.onclick=this.onBtnClick(e),this.$actions.appendChild(t),this}onBtnClick(e){return t=>{const n=e(t.currentTarget,this);void 0!==n&&!0!==n||this.$el.remove()}}}function Xt(e){const t=h('
      '),n=h('');n.style.display="none",b(t,{transparentBg:!0}),n.src=`${e.getCtx().conf.server}/api/captcha/get?t=${+new Date}`,n.onload=()=>{n.style.display="",w(t)},t.append(n);const i=h('
      ');t.append(i),e.hideInteractInput();let s=!1;return function t(){return d(this,null,(function*(){var n;if(yield(n=1e3,new Promise((e=>{window.setTimeout((()=>{e(null)}),n)}))),s)return;let i=!1;try{i=(yield e.getCtx().getApi().captcha.captchaStatus()).is_pass}catch(r){i=!1}i?e.triggerSuccess():t()}))}(),i.onclick=()=>{s=!0,e.cancel()},t}const Jt={request:(e,t)=>e.getApi().captcha.captchaCheck(t),body:e=>e.get("iframe")?Xt(e):function(e){const t=h(`${e.getCtx().$t("captchaCheck")}`);return t.querySelector(".atk-captcha-img").onclick=()=>{const n=t.querySelector(".atk-captcha-img");e.getApi().captcha.captchaGet().then((e=>{n.setAttribute("src",e)})).catch((e=>{console.error("Failed to get captcha image ",e)}))},t}(e),onSuccess(e,t,n,i){e.set("val",n)},onError(e,t,n,i){i.querySelector(".atk-captcha-img").click(),i.querySelector('input[type="text"]').value=""}},en={inputType:"password",request(e,t){const n={name:gt.data.nick,email:gt.data.email,password:t};return(()=>d(this,null,(function*(){return(yield e.getApi().user.login(n.name,n.email,n.password)).token})))()},body:e=>h(`${e.getCtx().$t("adminCheck")}`),onSuccess(e,t,n,i){gt.update({isAdmin:!0,token:t}),e.getCtx().trigger("user-changed",gt.data),e.getCtx().listReload()},onError(e,t,n,i){}};class tn{constructor(e){c(this,"ctx"),c(this,"launched",[]),this.ctx=e}checkCaptcha(e){this.fire(Jt,e,(t=>{t.set("img_data",e.imgData),t.set("iframe",e.iframe)}))}checkAdmin(e){this.fire(en,e)}fire(e,t,n){if(this.launched.includes(e))return;this.launched.push(e);const i=new _(this.ctx,`checker-${(new Date).getTime()}`);i.setMaskClickHide(!1),i.show();const s={};let r=!1;const a={set:(e,t)=>{s[e]=t},get:e=>s[e],getCtx:()=>this.ctx,getApi:()=>this.ctx.getApi(),getLayer:()=>i,hideInteractInput:()=>{r=!0},triggerSuccess:()=>{this.close(e,i),e.onSuccess&&e.onSuccess(a,"","",o),t.onSuccess&&t.onSuccess("",d.$el)},cancel:()=>{this.close(e,i),t.onCancel&&t.onCancel()}};n&&n(a);const o=h();o.appendChild(e.body(a));const l=h(``);let c;o.appendChild(l),setTimeout((()=>l.focus()),80),l.onkeyup=e=>{"Enter"!==e.key&&13!==e.keyCode||(e.preventDefault(),i.getEl().querySelector('button[data-action="confirm"]').click())};const d=new Yt(this.ctx,o);d.setYes((n=>{const s=l.value.trim();c||(c=n.innerText);const r=()=>{n.innerText=c||"",n.classList.remove("error")};return n.innerText=`${this.ctx.$t("loading")}...`,e.request(a,s).then((n=>{this.close(e,i),e.onSuccess&&e.onSuccess(a,n,s,o),t.onSuccess&&t.onSuccess(s,d.$el)})).catch((t=>{var i;i=String(t.msg||String(t)),n.innerText=i,n.classList.add("error"),e.onError&&e.onError(a,t,s,o);const c=setTimeout((()=>r()),3e3);l.onfocus=()=>{r(),clearTimeout(c)}})),!1})),d.setNo((()=>(this.close(e,i),t.onCancel&&t.onCancel(),!1))),r&&(l.style.display="none",d.$el.querySelector(".atk-layer-dialog-actions").style.display="none"),i.getEl().append(d.$el),t.onMount&&t.onMount(d.$el)}close(e,t){t.disposeNow(),this.launched=this.launched.filter((t=>t!==e))}}function nn(e,t,n,i){return d(this,null,(function*(){var s,r;if(gt.data.token){const e=new Headers(n.headers);e.set("Authorization",`Bearer ${gt.data.token}`),n.headers=e}const a=yield function(e,t,n,i){var s;const r=new AbortController;null==(s=i.signal)||s.addEventListener("abort",(()=>r.abort()));let a=fetch(t,l(o({},i),{signal:r.signal}));if(n>0){const e=setTimeout((()=>r.abort()),n);a.finally((()=>{clearTimeout(e)}))}return a=a.catch((e=>{throw"AbortError"===(e||{}).name?new Error(ut("reqAborted")):e})),a}(0,t,i||e.conf.reqTimeout||15e3,n),c=a.status,d=[401,400].includes(c);if(!a.ok&&!d)throw new Error(`${ut("reqGot")} ${c}`);let h=yield a.json();const u=(i,s)=>{nn(e,t,n).then((e=>{i(e)})).catch((e=>{s(e)}))};if((null==(s=h.data)?void 0:s.need_captcha)?h=yield new Promise(((t,n)=>{e.checkCaptcha({imgData:h.data.img_data,iframe:h.data.iframe,onSuccess:()=>{u(t,n)},onCancel:()=>{n(h)}})})):((null==(r=h.data)?void 0:r.need_login)||d)&&(h=yield new Promise(((t,n)=>{e.checkAdmin({onSuccess:()=>{u(t,n)},onCancel:()=>{n(h)}})}))),!h.success)throw h;return h}))}function sn(e){const t=new FormData;return Object.keys(e).forEach((n=>t.append(n,String(e[n])))),t}!function(){function e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function t(e,t){for(var n=0;n({user:e.data.user,is_login:e.data.is_login,unread:e.data.unread||[],unread_count:e.data.unread_count||0}))),abort:()=>{n.abort()}}}loginStatus(){return d(this,null,(function*(){return(yield this.POST("/login-status",{name:gt.data.nick,email:gt.data.email}))||{is_login:!1,is_admin:!1}}))}logout(){return d(this,null,(function*(){return this.POST("/logout")}))}markRead(e,t,n=!1){const i={comment_id:e,notify_key:t};return n&&(delete i.comment_id,delete i.notify_key,i.read_all=!0,i.name=gt.data.nick,i.email=gt.data.email),this.POST("/mark-read",i)}userList(e,t,n){return d(this,null,(function*(){const i={offset:e||0,limit:t||15};n&&(i.type=n);return yield this.POST("/admin/user-get",i)}))}userAdd(e,t){return d(this,null,(function*(){const n={name:e.name||"",email:e.email||"",password:t||"",link:e.link||"",is_admin:e.is_admin||!1,site_names:e.site_names_raw||"",receive_email:e.receive_email||!0,badge_name:e.badge_name||"",badge_color:e.badge_color||""};return(yield this.POST("/admin/user-add",n)).user}))}userEdit(e,t){return d(this,null,(function*(){const n={id:e.id,name:e.name||"",email:e.email||"",password:t||"",link:e.link||"",is_admin:e.is_admin||!1,site_names:e.site_names_raw||"",receive_email:e.receive_email||!0,badge_name:e.badge_name||"",badge_color:e.badge_color||""};return(yield this.POST("/admin/user-edit",n)).user}))}userDel(e){return this.POST("/admin/user-del",{id:String(e)})}},system:class extends rn{conf(){return d(this,null,(function*(){return Vt((yield this.POST("/conf")).frontend_conf||{})}))}getSettings(){return d(this,null,(function*(){return yield this.POST("/admin/setting-get")}))}saveSettings(e){return d(this,null,(function*(){return yield this.POST("/admin/setting-save",{data:e})}))}version(){return d(this,null,(function*(){const e=yield fetch(`${this.api.baseURL}/version`,{method:"POST"});return yield e.json()}))}},captcha:class extends rn{captchaGet(){return d(this,null,(function*(){return(yield this.POST("/captcha/refresh")).img_data||""}))}captchaCheck(e){return d(this,null,(function*(){return(yield this.POST("/captcha/check",{value:e})).img_data||""}))}captchaStatus(){return d(this,null,(function*(){return(yield this.POST("/captcha/status"))||{is_pass:!1}}))}},admin:class extends rn{cacheFlushAll(){return this.POST("/admin/cache-flush",{flush_all:!0})}cacheWarmUp(){return this.POST("/admin/cache-warm",{})}},upload:class extends rn{imgUpload(e){return d(this,null,(function*(){const t=sn({name:gt.data.nick,email:gt.data.email,page_key:this.ctx.conf.pageKey});t.set("file",e);const n={method:"POST",body:t};return(yield this.Fetch("/img-upload",n)).data||{}}))}}};class on{constructor(e){c(this,"ctx"),this.ctx=e,Object.entries(an).forEach((([e,t])=>{this[e]=new t(this,this.ctx)}))}get baseURL(){return`${this.ctx.conf.server}/api`}}function ln(e){const t={editor:e,isMoved:!1,move:e=>function(e,t){if(e.isMoved)return;e.isMoved=!0;const n=e.editor.getUI().$el;n.after(h('
      '));const i=h("
      ");t.after(i),i.replaceWith(n),n.classList.add("atk-fade-in")}(t,e),back:()=>function(e){var t;if(!e.isMoved)return;e.isMoved=!1,null==(t=e.editor.ctx.$root.querySelector(".atk-editor-travel-placeholder"))||t.replaceWith(e.editor.getUI().$el),e.editor.cancelReply()}(t)};return t}class cn{constructor(e){c(this,"editor"),c(this,"$panel"),c(this,"$btn"),c(this,"onHeaderInput"),c(this,"contentTransformer"),c(this,"onContentUpdated"),this.editor=e}get ctx(){return this.editor.ctx}registerPanel(e="
      "){return this.$panel=h(e),this.$panel}registerBtn(e){return this.$btn=h(`${e}`),this.$btn}registerHeaderInputEvt(e){this.onHeaderInput=e}registerContentTransformer(e){this.contentTransformer=e}registerContentUpdatedEvt(e){this.onContentUpdated=e}getPanel(){return this.$panel}getBtn(){return this.$btn}}c(cn,"Name");class dn extends cn{constructor(e){super(e),c(this,"emoticons",[]),c(this,"loadingTask",null),c(this,"$grpWrap"),c(this,"$grpSwitcher"),c(this,"isListLoaded",!1),c(this,"isImgLoaded",!1),this.editor=e,this.registerPanel('
      '),this.registerBtn(this.ctx.$t("emoticon")),this.registerContentTransformer((e=>this.transEmoticonImageText(e))),window.setTimeout((()=>{this.loadEmoticonsData()}),1e3)}onPanelShow(){(()=>{d(this,null,(function*(){yield this.loadEmoticonsData(),this.isImgLoaded||(this.initEmoticonsList(),this.isImgLoaded=!0),setTimeout((()=>{this.changeListHeight()}),30)}))})()}onPanelHide(){this.$panel.parentElement.style.height=""}loadEmoticonsData(){return d(this,null,(function*(){this.isListLoaded||(null===this.loadingTask?(this.loadingTask=(()=>d(this,null,(function*(){b(this.$panel),this.emoticons=yield this.handleData(this.ctx.conf.emoticons),w(this.$panel),this.loadingTask=null,this.isListLoaded=!0})))(),yield this.loadingTask):yield this.loadingTask)}))}handleData(e){return d(this,null,(function*(){if(!Array.isArray(e)&&["object","string"].includes(typeof e)&&(e=[e]),!Array.isArray(e))return E(this.$panel,"表情包数据必须为 Array/Object/String 类型"),w(this.$panel),[];const t=t=>{"object"==typeof t&&(t.name&&e.find((e=>e.name===t.name))||e.push(t))},n=e=>d(this,null,(function*(){yield Promise.all(e.map(((e,i)=>d(this,null,(function*(){if("object"!=typeof e||Array.isArray(e)){if(Array.isArray(e))yield n(e);else if("string"==typeof e){const i=yield this.remoteLoad(e);Array.isArray(i)?yield n(i):"object"==typeof i&&t(i)}}else t(e)})))))}));return yield n(e),e.forEach((e=>{if(this.isOwOFormat(e)){this.convertOwO(e).forEach((e=>{t(e)}))}else Array.isArray(e)&&e.forEach((e=>{t(e)}))})),e=e.filter((e=>"object"==typeof e&&!Array.isArray(e)&&!!e&&!!e.name)),this.solveNullKey(e),this.solveSameKey(e),e}))}remoteLoad(e){return d(this,null,(function*(){if(!e)return[];try{const t=yield fetch(e);return yield t.json()}catch(t){return w(this.$panel),E(this.$panel,`表情加载失败 ${String(t)}`),[]}}))}solveNullKey(e){e.forEach((e=>{e.items.forEach(((t,n)=>{t.key||(t.key=`${e.name} ${n+1}`)}))}))}solveSameKey(e){const t={};e.forEach((e=>{e.items.forEach((e=>{e.key&&""!==String(e.key).trim()&&(t[e.key]?t[e.key]++:t[e.key]=1,t[e.key]>1&&(e.key=`${e.key} ${t[e.key]}`))}))}))}isOwOFormat(e){try{return"object"==typeof e&&!!Object.values(e).length&&Array.isArray(Object.keys(Object.values(e)[0].container))&&Object.keys(Object.values(e)[0].container[0]).includes("icon")}catch(t){return!1}}convertOwO(e){const t=[];return Object.entries(e).forEach((([e,n])=>{const i={name:e,type:n.type,items:[]};n.container.forEach(((t,n)=>{const s=t.icon;if(/<(img|IMG)/.test(s)){const e=/src=["'](.*?)["']/.exec(s);e&&e.length>1&&(t.icon=e[1])}i.items.push({key:t.text||`${e} ${n+1}`,val:t.icon})})),t.push(i)})),t}initEmoticonsList(){this.$grpWrap=h('
      '),this.$panel.append(this.$grpWrap),this.emoticons.forEach(((e,t)=>{const n=h('');this.$grpWrap.append(n),n.setAttribute("data-index",String(t)),n.setAttribute("data-grp-name",e.name),n.setAttribute("data-type",e.type),e.items.forEach((t=>{const i=h('');if(n.append(i),t.key&&!new RegExp(`^(${e.name})?\\s?[0-9]+$`).test(t.key)&&i.setAttribute("title",t.key),"image"===e.type){const e=document.createElement("img");e.src=t.val,e.alt=t.key,i.append(e)}else i.innerText=t.val;i.onclick=()=>{"image"===e.type?this.editor.insertContent(`:[${t.key}]`):this.editor.insertContent(t.val||"")}}))})),this.emoticons.length>1&&(this.$grpSwitcher=h('
      '),this.$panel.append(this.$grpSwitcher),this.emoticons.forEach(((e,t)=>{const n=h("");n.innerText=e.name,n.setAttribute("data-index",String(t)),n.onclick=()=>this.openGrp(t),this.$grpSwitcher.append(n)}))),this.emoticons.length>0&&this.openGrp(0)}openGrp(e){var t,n,i;Array.from(this.$grpWrap.children).forEach((t=>{const n=t;n.getAttribute("data-index")!==String(e)?n.style.display="none":n.style.display=""})),null==(t=this.$grpSwitcher)||t.querySelectorAll("span.active").forEach((e=>e.classList.remove("active"))),null==(i=null==(n=this.$grpSwitcher)?void 0:n.querySelector(`span[data-index="${e}"]`))||i.classList.add("active"),this.changeListHeight()}changeListHeight(){}transEmoticonImageText(e){return this.emoticons&&Array.isArray(this.emoticons)?(this.emoticons.forEach((t=>{"image"===t.type&&Object.entries(t.items).forEach((([t,n])=>{e=e.split(`:[${n.key}]`).join(``)}))})),e):e}}c(dn,"Name","emoticons");class hn extends cn{constructor(e){super(e),c(this,"$imgUploadInput"),c(this,"allowImgExts",["png","jpg","jpeg","gif","bmp","svg","webp"]),this.$imgUploadInput=document.createElement("input"),this.$imgUploadInput.type="file",this.$imgUploadInput.style.display="none",this.$imgUploadInput.accept=this.allowImgExts.map((e=>`.${e}`)).join(",");const t=this.registerBtn(`${this.ctx.$t("image")}`);t.after(this.$imgUploadInput),t.onclick=()=>{const e=this.$imgUploadInput;e.onchange=()=>{(()=>{d(this,null,(function*(){if(!e.files||0===e.files.length)return;const t=e.files[0];this.uploadImg(t)}))})()},e.click()},this.ctx.conf.imgUpload||this.getBtn().setAttribute("atk-only-admin-show","");const n=e=>{if(e)for(let t=0;t{e.stopPropagation(),e.preventDefault()})),this.editor.getUI().$textarea.addEventListener("drop",(e=>{var t;const i=null==(t=e.dataTransfer)?void 0:t.files;(null==i?void 0:i.length)&&(e.preventDefault(),n(i))})),this.editor.getUI().$textarea.addEventListener("paste",(e=>{var t;const i=null==(t=e.clipboardData)?void 0:t.files;(null==i?void 0:i.length)&&(e.preventDefault(),n(i))}))}uploadImg(e){return d(this,null,(function*(){const t=/[^.]+$/.exec(e.name);if(!t||!this.allowImgExts.includes(t[0]))return;if(!gt.checkHasBasicUserInfo())return void this.editor.showNotify(this.ctx.$t("uploadLoginMsg"),"w");let n="\n";""===this.editor.getUI().$textarea.value.trim()&&(n="");const i=`${n}![](Uploading ${e.name}...)`;let s;this.editor.insertContent(i);try{s=this.ctx.conf.imgUploader?{img_url:yield this.ctx.conf.imgUploader(e)}:yield this.ctx.getApi().upload.imgUpload(e)}catch(r){console.error(r),this.editor.showNotify(`${this.ctx.$t("uploadFail")},${r.msg}`,"e")}if(s&&s.img_url){let e=s.img_url;y(e)||(e=$(this.ctx,e)),this.editor.setContent(this.editor.getUI().$textarea.value.replace(i,`${n}![](${e})`))}else this.editor.setContent(this.editor.getUI().$textarea.value.replace(i,""))}))}}c(hn,"Name","upload");class un extends cn{constructor(e){super(e),c(this,"isBind",!1),this.registerPanel('
      ');let t=this.editor.$t("preview");this.ctx.getMarkedInstance()&&(t+=' '),this.registerBtn(t),this.registerContentUpdatedEvt((e=>{this.updateContent()}))}onPanelShow(){if(this.updateContent(),!this.isBind){const e=()=>{this.updateContent()};this.editor.getUI().$textarea.addEventListener("input",e),this.editor.getUI().$textarea.addEventListener("change",e),this.isBind=!0}}updateContent(){"none"!==this.$panel.style.display&&(this.$panel.innerHTML=this.editor.getContentMarked())}}c(un,"Name","preview");class pn extends cn{constructor(e){super(e),c(this,"queryUserInfo",{timeout:null,abortFunc:null}),this.registerHeaderInputEvt(((e,t)=>{"nick"!==e&&"email"!==e||this.fetchUserInfo()})),this.editor.getUI().$link.addEventListener("change",(()=>{const e=this.editor.getUI().$link.value.trim();e&&!/^(http|https):\/\//.test(e)&&(this.editor.getUI().$link.value=`https://${e}`,gt.update({link:this.editor.getUI().$link.value}))}))}fetchUserInfo(){gt.logout(),this.queryUserInfo.timeout&&window.clearTimeout(this.queryUserInfo.timeout),this.queryUserInfo.abortFunc&&this.queryUserInfo.abortFunc(),this.queryUserInfo.timeout=window.setTimeout((()=>{this.queryUserInfo.timeout=null;const{req:e,abort:t}=this.ctx.getApi().user.userGet(gt.data.nick,gt.data.email);this.queryUserInfo.abortFunc=t,e.then((e=>{var t;e.is_login||gt.logout(),this.ctx.updateNotifies(e.unread),gt.checkHasBasicUserInfo()&&!e.is_login&&(null==(t=e.user)?void 0:t.is_admin)&&this.showLoginDialog(),e.user&&e.user.link&&(this.editor.getUI().$link.value=e.user.link,gt.update({link:e.user.link}))})).catch((()=>{})).finally((()=>{this.queryUserInfo.abortFunc=null}))}),400)}showLoginDialog(){this.ctx.checkAdmin({onSuccess:()=>{}})}}c(pn,"Name","headerInput");const gn=[dn,hn,un,pn];function mn(e){const t={editor:e,plugList:{},openedPlugName:null,openPlugPanel:e=>fn(t,e),closePlugPanel:()=>kn(t),triggerHeaderInputEvt:(e,n)=>function(e,t,n){Object.entries(e.plugList).forEach((([e,i])=>{i.onHeaderInput&&i.onHeaderInput(t,n)}))}(t,e,n),triggerContentUpdatedEvt:e=>function(e,t){Object.entries(e.plugList).forEach((([e,n])=>{n.onContentUpdated&&n.onContentUpdated(t)}))}(t,e),getTransformedContent:e=>function(e,t){let n=t;return Object.entries(e.plugList).forEach((([e,t])=>{t.contentTransformer&&(n=t.contentTransformer(n))})),n}(t,e)};e.getUI().$plugPanelWrap.innerHTML="",e.getUI().$plugPanelWrap.style.display="none",e.getUI().$plugBtnWrap.innerHTML="";const n=[{k:"upload",v:(i=e.conf).imgUpload},{k:"emoticons",v:i.emoticons},{k:"preview",v:i.preview}].filter((e=>!e.v)).flatMap((e=>e.k));var i;return gn.filter((e=>!n.includes(e.name))).forEach((e=>{!function(e,t){const n=t.Name,i=new t(e.editor);e.plugList[n]=i,function(e,t,n){const i=n.getBtn();if(!i)return;e.editor.getUI().$plugBtnWrap.appendChild(i),i.onclick=i.onclick||(()=>{e.editor.getUI().$plugBtnWrap.querySelectorAll(".active").forEach((e=>e.classList.remove("active"))),t!==e.openedPlugName?(fn(e,t),i.classList.add("active")):kn(e)});const s=n.getPanel();s&&(s.setAttribute("data-plug-name",t),s.style.display="none",e.editor.getUI().$plugPanelWrap.appendChild(s))}(e,n,i)}(t,e)})),t}function fn(e,t){Object.entries(e.plugList).forEach((([e,n])=>{const i=n.getPanel();i&&(e===t?(i.style.display="",n.onPanelShow&&n.onPanelShow()):(i.style.display="none",n.onPanelHide&&n.onPanelHide()))})),e.editor.getUI().$plugPanelWrap.style.display="",e.openedPlugName=t}function kn(e){if(!e.openedPlugName)return;const t=e.plugList[e.openedPlugName];t&&(t.onPanelHide&&t.onPanelHide(),e.editor.getUI().$plugPanelWrap.style.display="none",e.openedPlugName=null)}function yn(e){const t={editor:e,comment:void 0,setReply:(e,n,i)=>function(e,t,n,i=!0){e.editor.cancelEditComment(),$n(e);const s=e.editor.getUI();s.$sendReply||(s.$sendReply=h(`
      ${e.editor.$t("reply")} ×
      `),s.$sendReply.querySelector(".atk-text").innerText=`@${t.nick}`,s.$sendReply.addEventListener("click",(()=>{e.editor.cancelReply()})),s.$textareaWrap.append(s.$sendReply));e.comment=t,e.editor.travel(n),i&&C(s.$el);s.$textarea.focus()}(t,e,n,i),cancelReply:()=>$n(t)};return t}function $n(e){if(!e.comment)return;const t=e.editor.getUI();t.$sendReply&&(t.$sendReply.remove(),t.$sendReply=void 0),e.comment=void 0,e.editor.travelBack()}function xn(e){const t={editor:e,comment:void 0,setEdit:(e,n)=>function(e,t,n){vn(e),e.editor.cancelReply();const i=e.editor.getUI();if(!i.$editCancelBtn){const t=h(`
      ${e.editor.$t("editCancel")} ×
      `);t.onclick=()=>{vn(e)},i.$textareaWrap.append(t),i.$editCancelBtn=t}e.comment=t,i.$header.style.display="none",e.editor.travel(n),i.$nick.value=t.nick||"",i.$email.value=t.email||"",i.$link.value=t.link||"",e.editor.setContent(t.content),i.$textarea.focus(),e.editor.refreshSendBtnText()}(t,e,n),cancelEdit:()=>vn(t)};return function(e){e.editor.getSubmitManager().registerCustom({activeCond:()=>!!e.comment,req:()=>d(this,null,(function*(){const t={content:e.editor.getFinalContent(),nick:e.editor.getUI().$nick.value,email:e.editor.getUI().$email.value,link:e.editor.getUI().$link.value};return yield e.editor.ctx.getApi().comment.commentEdit(o(o({},e.comment),t))})),post:t=>{e.editor.ctx.updateComment(t)}})}(t),t}function vn(e){if(!e.comment)return;const t=e.editor.getUI();t.$editCancelBtn&&(t.$editCancelBtn.remove(),t.$editCancelBtn=void 0),e.comment=void 0,e.editor.travelBack();const{nick:n,email:i,link:s}=gt.data;t.$nick.value=n,t.$email.value=i,t.$link.value=s,e.editor.setContent(""),e.editor.refreshSendBtnText(),t.$header.style.display=""}function bn(e){const t={editor:e,do:()=>function(e){return d(this,null,(function*(){if(""===e.editor.getFinalContent().trim())return void e.editor.focus();const t=e.customs.find((e=>e.activeCond()));e.editor.ctx.trigger("editor-submit"),e.editor.showLoading();try{let n;(null==t?void 0:t.pre)&&t.pre(),n=(null==t?void 0:t.req)?yield t.req():yield function(e){return d(this,null,(function*(){const t=yield e.editor.ctx.getApi().comment.add(o({},function(e){var t;const{nick:n,email:i,link:s}=gt.data,r=e.editor.ctx.conf,a=null==(t=e.editor.getReplyManager())?void 0:t.comment;return{content:e.editor.getFinalContent(),nick:n,email:i,link:s,rid:a?a.id:0,page_key:a?a.page_key:r.pageKey,page_title:a?void 0:r.pageTitle,site_name:a?a.site_name:r.site}}(e)));return t}))}(e),(null==t?void 0:t.post)?t.post(n):function(e,t){const n=e.editor.getReplyManager(),i=e.editor.ctx.conf;(null==n?void 0:n.comment)&&n.comment.page_key!==i.pageKey&&window.open(`${n.comment.page_url}#atk-comment-${t.id}`);e.editor.ctx.insertComment(t)}(e,n)}catch(n){console.error(n),e.editor.showNotify(`${e.editor.$t("commentFail")},${n.msg||String(n)}`,"e")}e.editor.reset(),e.editor.ctx.trigger("editor-submitted"),e.editor.hideLoading()}))}(t),customs:[],registerCustom:e=>{t.customs.push(e)}};return t}const wn={localStorage:function(e){const t=window.localStorage.getItem("ArtalkContent")||"";""!==t.trim()&&(e.showNotify(e.$t("restoredMsg"),"i"),e.setContent(t));e.getUI().$textarea.addEventListener("input",(()=>e.saveToLocalStorage()))},header:function(e){const t=e.getHeaderInputEls();Object.entries(t).forEach((([t,n])=>{n.value=gt.data[t]||"",n.addEventListener("input",(()=>function(e,t,n){var i;if(e.isEditMode)return;gt.update({[t]:n.value.trim()}),null==(i=e.getPlugs())||i.triggerHeaderInputEvt(t,n)}(e,t,n))),n.placeholder=`${e.$t(t)}`}))},textarea:function(e){e.getUI().$textarea.placeholder=e.ctx.conf.placeholder||e.$t("placeholder"),e.getUI().$textarea.addEventListener("keydown",(t=>{9===(t.keyCode||t.which)&&(t.preventDefault(),e.insertContent("\t"))})),e.getUI().$textarea.addEventListener("input",(()=>{e.adjustTextareaHeight()}))},submitBtn:function(e){e.refreshSendBtnText(),e.getUI().$submitBtn.addEventListener("click",(()=>e.submit()))},submitManager:function(e){e.setSubmitManager(bn(e))},plugs:function(e){e.setPlugs(mn(e))},mover:function(e){if(!e.conf.editorTravel)return;e.setMover(ln(e))},replyManager:function(e){e.setReplyManager(yn(e))},editModeManager:function(e){e.setEditModeManager(xn(e))}};const Cn='
      \n
      \n \n \n \n
      \n
      \n \n
      \n \n
      \n
      \n
      \n \n
      \n
      \n
      \n
      \n',Sn={$header:".atk-header",$nick:'.atk-header [name="nick"]',$email:'.atk-header [name="email"]',$link:'.atk-header [name="link"]',$textareaWrap:".atk-textarea-wrap",$textarea:".atk-textarea",$bottom:".atk-bottom",$submitBtn:".atk-send-btn",$notifyWrap:".atk-notify-wrap",$plugBtnWrap:".atk-plug-btn-wrap",$plugPanelWrap:".atk-plug-panel-wrap"};class Tn extends v{constructor(e){super(e),c(this,"ui"),c(this,"plugs"),c(this,"mover"),c(this,"reply"),c(this,"editMode"),c(this,"submitManager"),this.ui=function(){const e=h(Cn),t={$el:e};return Object.entries(Sn).forEach((([n,i])=>{t[n]=e.querySelector(i)})),t}(),this.$el=this.ui.$el,this.ctx.on("conf-loaded",(()=>{var e;e=this,Object.entries(wn).forEach((([t,n])=>{n(e)}))}))}getUI(){return this.ui}getPlugs(){return this.plugs}setPlugs(e){this.plugs=e}setMover(e){this.mover=e}setReplyManager(e){this.reply=e}getReplyManager(){return this.reply}get isReplyMode(){var e;return!!(null==(e=this.reply)?void 0:e.comment)}setEditModeManager(e){this.editMode=e}get isEditMode(){var e;return!!(null==(e=this.editMode)?void 0:e.comment)}setSubmitManager(e){this.submitManager=e}getSubmitManager(){return this.submitManager}getHeaderInputEls(){return{nick:this.ui.$nick,email:this.ui.$email,link:this.ui.$link}}saveToLocalStorage(){window.localStorage.setItem("ArtalkContent",this.getContentOriginal().trim())}refreshSendBtnText(){this.isEditMode?this.ui.$submitBtn.innerText=this.$t("save"):this.ui.$submitBtn.innerText=this.ctx.conf.sendBtn||this.$t("send")}getFinalContent(){let e=this.getContentOriginal();return this.plugs&&(e=this.plugs.getTransformedContent(e)),e}getContentOriginal(){return this.ui.$textarea.value||""}getContentMarked(){return st(this.ctx,this.getFinalContent())}setContent(e){this.ui.$textarea.value=e,this.saveToLocalStorage(),this.plugs&&this.plugs.triggerContentUpdatedEvt(e),window.setTimeout((()=>{this.adjustTextareaHeight()}),80)}insertContent(e){if(document.selection)this.ui.$textarea.focus(),document.selection.createRange().text=e,this.ui.$textarea.focus();else if(this.ui.$textarea.selectionStart||0===this.ui.$textarea.selectionStart){const t=this.ui.$textarea.selectionStart,n=this.ui.$textarea.selectionEnd,i=this.ui.$textarea.scrollTop;this.setContent(this.ui.$textarea.value.substring(0,t)+e+this.ui.$textarea.value.substring(n,this.ui.$textarea.value.length)),this.ui.$textarea.focus(),this.ui.$textarea.selectionStart=t+e.length,this.ui.$textarea.selectionEnd=t+e.length,this.ui.$textarea.scrollTop=i}else this.ui.$textarea.focus(),this.ui.$textarea.value+=e}adjustTextareaHeight(){const e=this.ui.$textarea.offsetHeight-this.ui.$textarea.clientHeight;this.ui.$textarea.style.height="0px",this.ui.$textarea.style.height=`${this.ui.$textarea.scrollHeight+e}px`}focus(){this.ui.$textarea.focus()}reset(){this.setContent(""),this.cancelReply(),this.cancelEditComment()}setReply(e,t,n=!0){var i;null==(i=this.reply)||i.setReply(e,t,n)}cancelReply(){var e;null==(e=this.reply)||e.cancelReply()}setEditComment(e,t){var n;null==(n=this.editMode)||n.setEdit(e,t)}cancelEditComment(){var e;null==(e=this.editMode)||e.cancelEdit()}showNotify(e,t){S(this.ui.$notifyWrap,e,t)}showLoading(){b(this.ui.$el)}hideLoading(){w(this.ui.$el)}submit(){return d(this,null,(function*(){this.submitManager&&(yield this.submitManager.do())}))}close(){this.ui.$textareaWrap.querySelector(".atk-comment-closed")||this.ui.$textareaWrap.prepend(h(`
      ${this.$t("onlyAdminCanReply")}
      `)),gt.data.isAdmin?(this.ui.$textarea.style.display="",this.ui.$bottom.style.display=""):(this.ui.$textarea.style.display="none",this.closePlugPanel(),this.ui.$bottom.style.display="none")}open(){var e;null==(e=this.ui.$textareaWrap.querySelector(".atk-comment-closed"))||e.remove(),this.ui.$textarea.style.display="",this.ui.$bottom.style.display=""}travel(e){var t;null==(t=this.mover)||t.move(e)}travelBack(){var e;null==(e=this.mover)||e.back()}openPlugPanel(e){var t;null==(t=this.plugs)||t.openPlugPanel(e)}closePlugPanel(){var e;null==(e=this.plugs)||e.closePlugPanel()}}class En extends v{constructor(e){super(e),c(this,"layer"),c(this,"$header"),c(this,"$closeBtn"),c(this,"$iframeWrap"),c(this,"$iframe"),c(this,"firstShow",!0),this.$el=h('
      \n
      \n
      \n
      \n
      \n
      \n
      \n
      \n'),this.$header=this.$el.querySelector(".atk-sidebar-header"),this.$closeBtn=this.$header.querySelector(".atk-sidebar-close"),this.$iframeWrap=this.$el.querySelector(".atk-sidebar-iframe-wrap"),this.$closeBtn.onclick=()=>{this.hide()},this.ctx.on("user-changed",(()=>{this.firstShow=!0}))}show(){return d(this,arguments,(function*(e={}){if(this.$el.style.transform="",null==this.layer&&(this.layer=new _(this.ctx,"sidebar",this.$el),this.layer.afterHide=()=>{!0===this.ctx.conf.editorTravel&&this.ctx.editorTravelBack()}),this.layer.show(),(()=>{d(this,null,(function*(){var t;const n=yield this.ctx.getApi().user.loginStatus();n.is_admin&&!n.is_login&&(null==(t=this.layer)||t.hide(),this.firstShow=!0,this.ctx.checkAdmin({onSuccess:()=>{setTimeout((()=>{this.show(e)}),500)},onCancel:()=>{}}))}))})(),this.firstShow){this.$iframeWrap.innerHTML="",this.$iframe=h("");const t=$(this.ctx,"/sidebar/"),n={pageKey:this.conf.pageKey,site:this.conf.site||"",user:JSON.stringify(gt.data),time:+new Date};e.view&&(n.view=e.view),this.conf.darkMode&&(n.darkMode="1"),"string"==typeof this.conf.locale&&(n.locale=this.conf.locale);const i=new URLSearchParams(n);this.iframeLoad(`${t}?${i.toString()}`),this.$iframeWrap.append(this.$iframe),this.firstShow=!1}else{const e=this.$iframe.src.includes("darkMode=1");this.conf.darkMode&&!e&&this.iframeLoad(`${this.$iframe.src}&darkMode=1`),!this.conf.darkMode&&e&&this.iframeLoad(this.$iframe.src.replace("&darkMode=1",""))}setTimeout((()=>{this.$el.style.transform="translate(0, 0)"}),100),setTimeout((()=>{this.ctx.updateNotifies([])}),0),this.ctx.trigger("sidebar-show")}))}hide(){var e;this.$el.style.transform="",null==(e=this.layer)||e.hide(),this.ctx.trigger("sidebar-hide")}iframeLoad(e){this.$iframe&&(this.$iframe.src=e,b(this.$iframeWrap),this.$iframe.onload=()=>{w(this.$iframeWrap)})}}const Ln={i18n(e){ht(e.conf.locale),e.on("conf-loaded",(()=>{ht(e.conf.locale)}))},markdown(){!function(){try{if(!$e.name)return}catch(i){return}const e=new $e.Renderer,t=e.link;e.link=(n,i,s)=>{const r=null==n?void 0:n.startsWith(`${window.location.protocol}//${window.location.hostname}`);return t.call(e,n,i,s).replace(/^{const n=t||"plaintext";let i=e;return window.hljs?n&&window.hljs.getLanguage(n)&&(i=window.hljs.highlight(n,e).value):i=tt(e),`
      \n${i.replace(/&/g,"&")}\n
      `};const n=$e;$e.setOptions({renderer:e,pedantic:!1,gfm:!0,breaks:!0,smartLists:!0,smartypants:!0,xhtml:!1,sanitize:!1,silent:!0}),nt=n}()},user:e=>(gt.setContext(e),gt),api:e=>new on(e),checkerLauncher:e=>new tn(e),editor(e){const t=new Tn(e);return e.$root.appendChild(t.$el),t},list(e){const t=new Gt(e);return e.$root.appendChild(t.$el),t.fetchComments(0),t},layer(e){_.BodyOrgOverflow=document.body.style.overflow,_.BodyOrgPaddingRight=document.body.style.paddingRight},sidebarLayer:e=>new En(e),eventsDefault(e){window.addEventListener("hashchange",(()=>{e.listHashGotoCheck()})),e.on("user-changed",(()=>{e.checkAdminShowEl(),e.listRefreshUI()}))},darkMode(e){R(e),e.on("conf-loaded",(()=>{R(e)}))}};function _n(e){return d(this,null,(function*(){const t=e.ctx.conf.countEl;t&&document.querySelector(t)&&An(e,{api:"page_comment",countEl:t});const n=e.pvAdd?yield e.ctx.getApi().page.pv():void 0,i=e.ctx.conf.pvEl;i&&document.querySelector(i)&&An(e,{api:"page_pv",countEl:i,curtPageCount:n})}))}function An(e,t){return d(this,null,(function*(){let n={};const i=e.ctx.conf.pageKey;t.curtPageCount&&(n[i]=t.curtPageCount);let s=Array.from(document.querySelectorAll(t.countEl)).map((e=>e.getAttribute("data-page-key")||i)).filter((e=>void 0===n[e]));if(s=[...new Set(s)],s.length>0){const i=yield e.ctx.getApi().page.stat(t.api,s);n=o(o({},n),i)}document.querySelectorAll(t.countEl).forEach((e=>{const t=e.getAttribute("data-page-key")||i;e.innerHTML=`${Number(n[t]||0)}`}))}))}const On=class{constructor(e){c(this,"conf"),c(this,"ctx"),c(this,"$root"),On.instance&&On.destroy(),this.conf=Qt(e),this.conf.el instanceof HTMLElement&&(this.$root=this.conf.el),this.ctx=new Kt(this.conf,this.$root),Object.entries(Ln).forEach((([e,t])=>{if(On.DisabledComponents.includes(e))return;const n=t(this.ctx);n&&this.ctx.inject(e,n)})),On.plugins.forEach((e=>{"function"==typeof e&&e(this.ctx)}))}static init(e){return this.instance&&On.destroy(),this.instance=new On(e),this.instance}use(e){On.plugins.push(e),"function"==typeof e&&e(this.ctx)}update(e){if(!On.instance)throw Error("cannot call `update` function before call `load`");return On.instance.ctx.updateConf(e),On.instance}reload(){this.ctx.listReload()}destroy(){if(!On.instance)throw Error("cannot call `destroy` function before call `load`");On.instance.$root.remove(),delete On.instance}on(e,t){this.ctx.on(e,t,"external")}off(e,t){this.ctx.off(e,t,"external")}trigger(e,t){this.ctx.trigger(e,t,"external")}setDarkMode(e){this.ctx.setDarkMode(e)}static use(e){this.plugins.push(e),this.instance&&"function"==typeof e&&e(this.instance.ctx)}static update(e){var t;return null==(t=this.instance)?void 0:t.update(e)}static reload(){var e;null==(e=this.instance)||e.reload()}static destroy(){var e;null==(e=this.instance)||e.destroy()}static on(e,t){var n;null==(n=this.instance)||n.on(e,t)}static off(e,t){var n;null==(n=this.instance)||n.off(e,t)}static trigger(e,t){var n;null==(n=this.instance)||n.trigger(e,t)}static setDarkMode(e){var t;null==(t=this.instance)||t.setDarkMode(e)}static loadCountWidget(e){const t=new Kt(Qt(e));t.inject("api",new on(t)),_n({ctx:t,pvAdd:!1})}static LoadCountWidget(e){console.warn("The method `LoadCountWidget` is deprecated, please use `loadCountWidget` instead."),this.loadCountWidget(e)}};let Mn=On;return c(Mn,"instance"),c(Mn,"ListLite",Zt),c(Mn,"defaults",Ht),c(Mn,"plugins",[e=>{e.conf.useBackendConf?e.on("list-loaded",(()=>{_n({ctx:e,pvAdd:!0})})):_n({ctx:e,pvAdd:!0})}]),c(Mn,"DisabledComponents",[]),Mn})); diff --git a/assets/lib/artalk/Artalk.min.css b/assets/lib/artalk/Artalk.min.css deleted file mode 100644 index d245efe9..00000000 --- a/assets/lib/artalk/Artalk.min.css +++ /dev/null @@ -1,7 +0,0 @@ -/** - * Skipped minification because the original files appears to be already minified. - * Original file: /npm/artalk@2.3.4/dist/Artalk.css - * - * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files - */ -.artalk,.atk-layer-wrap{--at-color-font: #2a2e2e;--at-color-deep: #2a2e2e;--at-color-sub: #757575;--at-color-grey: #747474;--at-color-meta: #697182;--at-color-border: #eceff2;--at-color-light: #4285f4;--at-color-bg: #FFF;--at-color-bg-transl: rgba(255, 255, 255, .94);--at-color-bg-grey: #F4F4F4;--at-color-bg-grey-transl: rgba(244, 244, 244, .75);--at-color-bg-light: rgba(29, 161, 242, .1);--at-color-main: #0083ff;--at-color-red: #ff5652;--at-color-pink: #fa5a57;--at-color-yellow: #ff7c37;--at-color-green: #4caf50;--at-color-gradient: linear-gradient(180deg, rgba(255, 255, 255, 0), rgba(255, 255, 255))}.artalk.atk-dark-mode,.atk-layer-wrap.atk-dark-mode{--at-color-font: #fff;--at-color-deep: #e7e7e7;--at-color-sub: #e7e7e7;--at-color-grey: #fff;--at-color-meta: #fff;--at-color-border: #2d3235;--at-color-light: #687a86;--at-color-bg: #1e2224;--at-color-bg-transl: rgba(30, 34, 36, .95);--at-color-bg-grey: #46494e;--at-color-bg-grey-transl: rgba(8, 8, 8, .95);--at-color-bg-light: rgba(29, 161, 242, .1);--at-color-main: #0083ff;--at-color-red: #ff5652;--at-color-pink: #fa5a57;--at-color-yellow: #ff7c37;--at-color-green: #4caf50;--at-color-gradient: linear-gradient(180deg, rgba(30, 34, 36, 0), #1e2224)}.artalk{position:relative;width:100%;min-height:200px}.artalk,.atk-layer-wrap{color:var(--at-color-font);word-wrap:break-word;word-break:break-all}.artalk *,.atk-layer-wrap *{box-sizing:border-box}.artalk input,.atk-layer-wrap input,.artalk textarea,.atk-layer-wrap textarea,.artalk button,.atk-layer-wrap button,.artalk optgroup,.atk-layer-wrap optgroup,.artalk select,.atk-layer-wrap select{font-family:inherit;color:inherit;font-size:inherit}.artalk code,.atk-layer-wrap code{font-family:source code pro,Consolas,Monaco,Menlo,sans-serif;margin:0 .3em;padding:0 .5em;display:inline-block;font-size:.9em;background-color:var(--at-color-bg-grey);color:var(--at-color-font);border-radius:6px}.artalk pre,.atk-layer-wrap pre{margin:10px 0 0;padding:0;line-height:0}.artalk pre code,.atk-layer-wrap pre code{line-height:1.6em;display:block;padding:10px 15px;white-space:pre-wrap;background-color:var(--at-color-bg-grey);color:var(--at-color-font);margin:0}.artalk pre code *,.atk-layer-wrap pre code *{font-family:source code pro,Consolas,Monaco,Menlo,sans-serif}.artalk a,.atk-layer-wrap a{color:var(--at-color-main);text-decoration:none}.artalk blockquote,.atk-layer-wrap blockquote{position:static;margin:10px 0;padding:10px 20px;background:var(--at-color-bg-grey);border-left:4px solid #687a86;color:var(--at-color-font)}.artalk p:first-child,.atk-layer-wrap p:first-child{margin-top:0}.artalk p:last-child,.atk-layer-wrap p:last-child{margin-bottom:0}.artalk img,.atk-layer-wrap img{max-width:100%}.artalk table,.atk-layer-wrap table{width:100%;border-collapse:collapse;border-spacing:0;margin-bottom:1.5em;font-size:.96em}.artalk td,.atk-layer-wrap td,.artalk th,.atk-layer-wrap th{text-align:left;padding:4px 8px 4px 10px;border:1px solid var(--at-color-border)}.artalk td,.atk-layer-wrap td{vertical-align:top}.artalk tr:nth-child(even),.atk-layer-wrap tr:nth-child(even){background-color:var(--at-color-bg-grey)}.atk-hide{display:none!important}.atk-full-layer,.atk-loading,.atk-error-layer,.atk-layer-dialog-wrap{width:100%;height:100%;position:absolute;top:0;left:0;background:var(--at-color-bg);z-index:10;align-items:center;justify-content:center;flex-flow:column;display:flex}.atk-loading{z-index:11}.atk-loading-spinner{position:relative;width:50px;height:50px}.atk-loading-spinner svg{-webkit-animation:atkRotate 2s linear infinite;animation:atkRotate 2s linear infinite;transform-origin:center center;width:100%;height:100%;position:absolute;top:0;left:0}.atk-loading-spinner svg circle{stroke-dasharray:1,200;stroke-dashoffset:0;-webkit-animation:atkDash 1.5s ease-in-out infinite,atkColor 6s ease-in-out infinite;animation:atkDash 1.5s ease-in-out infinite,atkColor 6s ease-in-out infinite;stroke-linecap:round}@-webkit-keyframes atkRotate{to{transform:rotate(360deg)}}@keyframes atkRotate{to{transform:rotate(360deg)}}@-webkit-keyframes atkDash{0%{stroke-dasharray:1,200;stroke-dashoffset:0}50%{stroke-dasharray:89,200;stroke-dashoffset:-35px}to{stroke-dasharray:89,200;stroke-dashoffset:-124px}}@keyframes atkDash{0%{stroke-dasharray:1,200;stroke-dashoffset:0}50%{stroke-dasharray:89,200;stroke-dashoffset:-35px}to{stroke-dasharray:89,200;stroke-dashoffset:-124px}}@-webkit-keyframes atkColor{0%,to{stroke:#ff5652}40%{stroke:#2196f3}66%{stroke:#32c787}80%,90%{stroke:#ffc107}}@keyframes atkColor{0%,to{stroke:#ff5652}40%{stroke:#2196f3}66%{stroke:#32c787}80%,90%{stroke:#ffc107}}@-webkit-keyframes atkLoadingIconRotate{0%{transform:rotate(0)}to{transform:rotate(360deg)}}@keyframes atkLoadingIconRotate{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.atk-loading-icon{width:18px;height:18px;box-sizing:border-box;border:solid 1px transparent;border-top-color:#29d;border-left-color:#29d;border-radius:50%;-webkit-animation:atkLoadingIconRotate .4s linear infinite;animation:atkLoadingIconRotate .4s linear infinite}.atk-fade-in{-webkit-animation:atkFadeIn both .3s;animation:atkFadeIn both .3s}.atk-fade-out{-webkit-animation:atkFadeOut both .2s;animation:atkFadeOut both .2s}.atk-rotate{-webkit-animation:atkRotate 2s linear infinite;animation:atkRotate 2s linear infinite}@-webkit-keyframes atkFadeIn{0%{opacity:0}to{opacity:1}}@keyframes atkFadeIn{0%{opacity:0}to{opacity:1}}@-webkit-keyframes atkFadeOut{to{opacity:0}}@keyframes atkFadeOut{to{opacity:0}}@keyframes atkRotate{0%{transform:rotate(0)}to{transform:rotate(360deg)}}i.atk-icon{width:20px;height:20px;background-color:var(--at-color-deep);background-size:contain;background-repeat:no-repeat;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-position:center;mask-position:center;-webkit-mask-size:contain;mask-size:contain}.atk-icon-sync{-webkit-mask-image:url("data:image/svg+xml,%3Csvg width='20' height='20' viewBox='0 0 20 20' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M4.99133 4.87635C2.22512 7.64257 2.22512 12.1275 4.99133 14.8937C6.04677 15.9491 7.3524 16.6019 8.71732 16.8519' stroke='%234E5969' stroke-width='2'/%3E%3Cpath d='M14.4179 15.4815L15.0072 14.8922C17.7734 12.126 17.7734 7.64107 15.0072 4.87486C13.9518 3.81942 12.6461 3.16668 11.2812 2.91664' stroke='%234E5969' stroke-width='2'/%3E%3Cpath d='M6.17106 4.99252L5.58181 4.40327L4.99255 3.81401H6.17106V4.99252Z' fill='%23C4C4C4' stroke='%234E5969' stroke-width='2'/%3E%3Cpath d='M13.8299 15.0084L14.4192 15.5976L15.0084 16.1869H13.8299V15.0084Z' fill='%23C4C4C4' stroke='%234E5969' stroke-width='2'/%3E%3C/svg%3E");mask-image:url("data:image/svg+xml,%3Csvg width='20' height='20' viewBox='0 0 20 20' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M4.99133 4.87635C2.22512 7.64257 2.22512 12.1275 4.99133 14.8937C6.04677 15.9491 7.3524 16.6019 8.71732 16.8519' stroke='%234E5969' stroke-width='2'/%3E%3Cpath d='M14.4179 15.4815L15.0072 14.8922C17.7734 12.126 17.7734 7.64107 15.0072 4.87486C13.9518 3.81942 12.6461 3.16668 11.2812 2.91664' stroke='%234E5969' stroke-width='2'/%3E%3Cpath d='M6.17106 4.99252L5.58181 4.40327L4.99255 3.81401H6.17106V4.99252Z' fill='%23C4C4C4' stroke='%234E5969' stroke-width='2'/%3E%3Cpath d='M13.8299 15.0084L14.4192 15.5976L15.0084 16.1869H13.8299V15.0084Z' fill='%23C4C4C4' stroke='%234E5969' stroke-width='2'/%3E%3C/svg%3E")}.atk-icon-del{background-color:var(--at-color-red)!important;-webkit-mask-image:url("data:image/svg+xml,%3Csvg width='22' height='22' viewBox='0 0 22 22' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M2.29167 5.04166L4.81251 5.04166M4.81251 5.04166L4.81251 18.3333C4.81251 18.5865 5.01771 18.7917 5.27084 18.7917L16.7292 18.7917C16.9823 18.7917 17.1875 18.5865 17.1875 18.3333V5.04166M4.81251 5.04166L7.33334 5.04166M17.1875 5.04166L19.7083 5.04166M17.1875 5.04166L14.6667 5.04166M7.33334 5.04166V3.20833L14.6667 3.20833V5.04166M7.33334 5.04166L14.6667 5.04166' stroke='%23D06565' stroke-width='2'/%3E%3Cpath d='M9.16667 8.25V15.125M12.8333 8.25V15.125' stroke='%23D06565' stroke-width='2'/%3E%3C/svg%3E");mask-image:url("data:image/svg+xml,%3Csvg width='22' height='22' viewBox='0 0 22 22' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M2.29167 5.04166L4.81251 5.04166M4.81251 5.04166L4.81251 18.3333C4.81251 18.5865 5.01771 18.7917 5.27084 18.7917L16.7292 18.7917C16.9823 18.7917 17.1875 18.5865 17.1875 18.3333V5.04166M4.81251 5.04166L7.33334 5.04166M17.1875 5.04166L19.7083 5.04166M17.1875 5.04166L14.6667 5.04166M7.33334 5.04166V3.20833L14.6667 3.20833V5.04166M7.33334 5.04166L14.6667 5.04166' stroke='%23D06565' stroke-width='2'/%3E%3Cpath d='M9.16667 8.25V15.125M12.8333 8.25V15.125' stroke='%23D06565' stroke-width='2'/%3E%3C/svg%3E")}.atk-icon-edit{-webkit-mask-image:url("data:image/svg+xml,%3Csvg width='16' height='17' viewBox='0 0 16 17' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M9.70618 4.08515L12.6081 7.06376M1.00041 13.021L11.7376 2L14.6392 4.97861L3.90274 16H1L1.00041 13.021Z' stroke='%234E5969' stroke-width='1.5'/%3E%3C/svg%3E");mask-image:url("data:image/svg+xml,%3Csvg width='16' height='17' viewBox='0 0 16 17' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M9.70618 4.08515L12.6081 7.06376M1.00041 13.021L11.7376 2L14.6392 4.97861L3.90274 16H1L1.00041 13.021Z' stroke='%234E5969' stroke-width='1.5'/%3E%3C/svg%3E")}.atk-icon-no,.atk-icon-close{-webkit-mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='25' height='25' viewBox='0 0 25 25' fill='none'%3E%3Cpath d='M19.8657 5.13431L12.5 12.5L5.13431 19.8657' stroke='%234E5969'/%3E%3Cpath d='M5.13431 5.13432L12.5 12.5L19.8657 19.8657' stroke='%234E5969'/%3E%3C/svg%3E");mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='25' height='25' viewBox='0 0 25 25' fill='none'%3E%3Cpath d='M19.8657 5.13431L12.5 12.5L5.13431 19.8657' stroke='%234E5969'/%3E%3Cpath d='M5.13431 5.13432L12.5 12.5L19.8657 19.8657' stroke='%234E5969'/%3E%3C/svg%3E")}.atk-icon-yes{-webkit-mask-image:url("data:image/svg+xml,%3Csvg width='25' height='25' viewBox='0 0 25 25' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M21.7071 5.75533L9.92197 17.5404L3.29285 10.9113' stroke='%234E5969'/%3E%3C/svg%3E");mask-image:url("data:image/svg+xml,%3Csvg width='25' height='25' viewBox='0 0 25 25' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M21.7071 5.75533L9.92197 17.5404L3.29285 10.9113' stroke='%234E5969'/%3E%3C/svg%3E")}.atk-icon-plus{-webkit-mask-image:url("data:image/svg+xml,%3Csvg width='20' height='20' viewBox='0 0 20 20' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M2.08331 10H17.9166' stroke='%234E5969' stroke-width='2'/%3E%3Cpath d='M10 2.08334L10 17.9167' stroke='%234E5969' stroke-width='2'/%3E%3C/svg%3E");mask-image:url("data:image/svg+xml,%3Csvg width='20' height='20' viewBox='0 0 20 20' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M2.08331 10H17.9166' stroke='%234E5969' stroke-width='2'/%3E%3Cpath d='M10 2.08334L10 17.9167' stroke='%234E5969' stroke-width='2'/%3E%3C/svg%3E")}.atk-error-layer{background-color:var(--at-color-bg-transl)}.atk-error-layer .atk-error-title{color:var(--at-color-red)}.atk-error-layer .atk-warn-title{color:var(--at-color-yellow)}.atk-error-layer .atk-error-title,.atk-error-layer .atk-warn-title{display:inline-block;padding:0 15px;margin-bottom:20px;font-size:20px;letter-spacing:-.5px}.atk-error-layer .atk-error-text{text-align:center;padding:0 20px}.atk-error-layer .atk-error-text *{color:var(--at-color-deep)}.atk-error-layer .atk-error-text a{color:var(--at-color-meta)}.atk-layer-dialog-wrap{background-color:var(--at-color-bg-transl)}.atk-layer-dialog-wrap>.atk-layer-dialog{width:25%}.atk-layer-dialog-wrap>.atk-layer-dialog>.atk-layer-dialog-content .atk-captcha-img{cursor:pointer;width:170px;height:auto;margin-right:10px;padding-right:10px;border-right:1px solid var(--at-color-border);vertical-align:bottom}.atk-layer-dialog-wrap>.atk-layer-dialog>.atk-layer-dialog-content input{width:100%;line-height:34px;background-color:var(--at-color-bg);border:1px solid var(--at-color-border);border-radius:3px;outline:none;padding:0 6px;display:block;margin-top:10px;margin-bottom:5px;text-align:center}.atk-layer-dialog-wrap>.atk-layer-dialog>.atk-layer-dialog-actions{display:flex;flex-direction:row}.atk-layer-dialog-wrap>.atk-layer-dialog>.atk-layer-dialog-actions button{flex:1;display:block;cursor:pointer;border:1px solid var(--at-color-main);background:transparent;color:var(--at-color-main);border-radius:3px;padding:0 15px;line-height:30px;outline:none}.atk-layer-dialog-wrap>.atk-layer-dialog>.atk-layer-dialog-actions button:active{color:#fff;background:var(--at-color-main)}.atk-layer-dialog-wrap>.atk-layer-dialog>.atk-layer-dialog-actions button:not(:last-child){margin-right:5px}.atk-layer-dialog-wrap>.atk-layer-dialog>.atk-layer-dialog-actions button.error{color:#fff;background:#ff5652;border-color:#ff5652}.atk-layer-dialog-wrap>.atk-layer-dialog .atk-checker-iframe-wrap{position:fixed;z-index:999998;left:0;top:0;height:100vh;width:100vw}.atk-layer-dialog-wrap>.atk-layer-dialog .atk-checker-iframe-wrap>iframe{width:100%;height:100%;border:0}.atk-layer-dialog-wrap>.atk-layer-dialog .atk-checker-iframe-wrap .atk-close-btn{z-index:999999;position:fixed;top:20px;right:20px;display:flex;flex-direction:column;width:50px;height:50px;align-items:center;place-content:center;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;user-select:none;margin-left:10px}.atk-layer-dialog-wrap>.atk-layer-dialog .atk-checker-iframe-wrap .atk-close-btn:hover .atk-icon-close{background-color:#e81123e6}@media only screen and (max-width: 768px){.atk-layer-dialog-wrap>.atk-layer-dialog{width:90%!important}}.atk-notify{display:block;overflow:hidden;background-color:#2c2c2c;color:#fff;border-radius:3px;cursor:pointer;font-size:14px;padding:5px 15px}.atk-notify:not(:last-child){margin-bottom:3px}.atk-notify .atk-notify-content{color:#fff}.atk-layer-wrap .atk-layer-mask{position:fixed;top:0;left:0;width:100%;height:100%;z-index:99998;background:rgba(0,0,0,.3)}.atk-layer-wrap .atk-layer-item{position:fixed;z-index:99999;top:0;right:0;width:100%;height:100%}.atk-common-action-btn.atk-btn-confirm,.atk-common-action-btn.atk-btn-warn{color:var(--at-color-yellow)!important}.atk-common-action-btn.atk-btn-error{color:var(--at-color-red)!important}.atk-common-action-btn.atk-btn-success{color:var(--at-color-green)!important}img[atk-emoticon]{max-height:60px}.atk-main-editor{z-index:5;position:relative;overflow:hidden;background:var(--at-color-bg);border:1px solid var(--at-color-border);border-radius:6px;margin-bottom:10px}@media only screen and (max-width: 768px){.atk-main-editor{margin-bottom:7px}}.atk-main-editor>.atk-header{display:flex;flex-direction:row;padding:10px 14px 0}.atk-main-editor>.atk-header input{flex:1;width:100%;font-size:14px;background:transparent;border:2px solid transparent;border-radius:3px;padding:6px 5px;resize:none;outline:none}.atk-main-editor>.atk-header input:not(:last-child){margin-right:2px}.atk-main-editor>.atk-textarea-wrap{position:relative}.atk-main-editor>.atk-textarea-wrap>.atk-textarea{display:block;overflow:hidden;color:var(--at-color-font);font-size:15px;background-color:var(--at-color-bg);border:2px solid transparent;border-radius:3px;width:100%;min-height:120px;margin-top:2px;padding:10px 20px;resize:none;word-wrap:break-word;outline:none}.atk-main-editor>.atk-textarea-wrap>.atk-comment-closed{pointer-events:none;color:var(--at-color-meta);font-size:12px;background-color:var(--at-color-bg);border-top:1px solid var(--at-color-border);padding:5px 15px;margin-top:10px}.atk-main-editor>.atk-textarea-wrap>.atk-send-reply{z-index:2;position:absolute;right:7px;bottom:2px;max-width:80%;height:30px;line-height:30px;font-size:14px;background:var(--at-color-bg-grey-transl);padding:0 30px 0 10px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;cursor:pointer;border-radius:3px}.atk-main-editor>.atk-textarea-wrap>.atk-send-reply .atk-cancel{position:absolute;right:0;bottom:0;height:30px;text-align:center;width:30px;line-height:30px;font-weight:700}.atk-main-editor>.atk-textarea-wrap>.atk-send-reply .atk-cancel:hover{color:var(--at-color-deep)}.atk-main-editor>.atk-plug-panel-wrap{position:relative;height:180px;width:100%;overflow:hidden;border-top:1px solid var(--at-color-border);-webkit-animation:.3s both atkFadeIn;animation:.3s both atkFadeIn;transition:.2s height ease-in-out}.atk-main-editor>.atk-bottom{display:flex;flex-direction:row;justify-content:space-between;padding:5px 5px 5px 10px}.atk-main-editor>.atk-bottom>.atk-item{display:flex;flex-direction:row;align-items:center}.atk-main-editor>.atk-bottom .atk-plug-btn{padding:0 8px;line-height:24px;cursor:pointer;color:var(--at-color-grey);font-size:14px;-webkit-user-select:none;-moz-user-select:none;user-select:none;border-radius:3px}.atk-main-editor>.atk-bottom .atk-plug-btn:not(:last-child){margin-right:2px}.atk-main-editor>.atk-bottom .atk-plug-btn:hover{background:var(--at-color-bg-grey)}.atk-main-editor>.atk-bottom .atk-plug-btn.active{color:var(--at-color-main)}.atk-main-editor>.atk-bottom .atk-plug-btn.active svg.markdown path{fill:var(--at-color-main)}.atk-main-editor>.atk-bottom .atk-plug-btn i{color:var(--at-color-grey);display:inline-flex;vertical-align:sub;margin-left:4px}.atk-main-editor>.atk-bottom .atk-plug-btn i svg.markdown path{fill:var(--at-color-grey)}.atk-main-editor>.atk-bottom .atk-send-btn{background:var(--at-color-main);color:#fff;font-size:14px;border:none;padding:0 30px;margin:0;height:30px;cursor:pointer;transition:opacity .3s ease-in-out;outline:none;border-radius:3px}.atk-main-editor>.atk-bottom .atk-send-btn:active{opacity:.9}.atk-main-editor>.atk-notify-wrap{z-index:9;position:absolute;right:-2px;bottom:40px;width:225px;opacity:.83}.atk-editor-plug-emoticons{height:100%;width:100%}.atk-editor-plug-emoticons>.atk-grp-wrap{overflow-y:scroll;overflow-x:hidden;height:100%;width:100%}.atk-editor-plug-emoticons>.atk-grp-wrap::-webkit-scrollbar{width:4px;height:4px;background:transparent}.atk-editor-plug-emoticons>.atk-grp-wrap::-webkit-scrollbar-thumb,.atk-editor-plug-emoticons>.atk-grp-wrap::-webkit-scrollbar-thumb:window-inactive{background:rgba(86,86,86,.3)}.atk-editor-plug-emoticons>.atk-grp-wrap::-webkit-scrollbar-thumb:vertical:hover{background:rgba(65,74,82,.77)}.atk-editor-plug-emoticons>.atk-grp-wrap::-webkit-scrollbar-thumb:vertical:active{background:rgba(41,47,53,.77)}.atk-editor-plug-emoticons>.atk-grp-wrap>.atk-grp{display:flex;flex-wrap:wrap;flex-direction:row;padding:5px 10px 35px}.atk-editor-plug-emoticons>.atk-grp-wrap>.atk-grp[data-type=image]>.atk-item{height:63px;width:63px}.atk-editor-plug-emoticons>.atk-grp-wrap>.atk-grp>.atk-item{display:flex;align-items:center;justify-content:center;padding:5px;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;user-select:none;border-radius:3px;font-size:16px;min-width:35px}.atk-editor-plug-emoticons>.atk-grp-wrap>.atk-grp>.atk-item>img{max-height:100%;width:auto}.atk-editor-plug-emoticons>.atk-grp-wrap>.atk-grp>.atk-item:hover{background:var(--at-color-bg-grey)}.atk-editor-plug-emoticons>.atk-grp-switcher{position:absolute;bottom:0;left:0;width:100%;background:var(--at-color-bg-transl);height:30px;border-top:1px solid var(--at-color-border);border-bottom:1px solid var(--at-color-border)}.atk-editor-plug-emoticons>.atk-grp-switcher>span{-webkit-user-select:none;-moz-user-select:none;user-select:none;padding:0 10px;line-height:30px;float:left;display:block;cursor:pointer;font-size:14px}.atk-editor-plug-emoticons>.atk-grp-switcher>span:hover,.atk-editor-plug-emoticons>.atk-grp-switcher>span.active{background:var(--at-color-bg-grey)}.atk-editor-plug-preview{overflow-y:scroll;overflow-x:hidden;height:100%;width:100%;padding:10px 15px}.artalk>.atk-list{position:relative}.artalk>.atk-list>.atk-list-header{display:flex;flex-direction:row;padding:10px 17px}.artalk>.atk-list>.atk-list-header .atk-text{display:inline-block}.artalk>.atk-list>.atk-list-header .atk-dropdown-wrap{position:relative;cursor:pointer}.artalk>.atk-list>.atk-list-header .atk-dropdown-wrap .atk-arrow-down-icon{cursor:pointer;vertical-align:middle;border-top:5px solid var(--at-color-grey);border-left:3px solid transparent;border-right:3px solid transparent;margin-top:-1px;margin-left:.8rem;display:inline-block}.artalk>.atk-list>.atk-list-header .atk-dropdown-wrap:hover .atk-dropdown{display:block}.artalk>.atk-list>.atk-list-header .atk-dropdown-wrap .atk-dropdown{z-index:888;display:none;height:auto!important;max-height:calc(100vh - 2.7rem);overflow-y:auto;position:absolute;top:100%;right:0;width:100%;background-color:var(--at-color-bg);padding:.6rem 0;border:1px solid var(--at-color-border);text-align:center;border-radius:6px;white-space:nowrap;margin:0;list-style:none}.artalk>.atk-list>.atk-list-header .atk-dropdown-wrap .atk-dropdown-item span,.artalk>.atk-list>.atk-list-header .atk-dropdown-wrap .atk-dropdown-item a{display:block;line-height:2rem;position:relative;border-bottom:none;font-weight:400;padding:0 1.5rem}.artalk>.atk-list>.atk-list-header .atk-dropdown-wrap .atk-dropdown-item span:hover,.artalk>.atk-list>.atk-list-header .atk-dropdown-wrap .atk-dropdown-item a:hover{color:var(--at-color-main)}.artalk>.atk-list>.atk-list-header .atk-dropdown-wrap .atk-dropdown-item.active span,.artalk>.atk-list>.atk-list-header .atk-dropdown-wrap .atk-dropdown-item a{color:var(--at-color-main)}.artalk>.atk-list>.atk-list-header .atk-comment-count{font-size:15px}.artalk>.atk-list>.atk-list-header .atk-comment-count .atk-comment-count-num{font-size:22px;margin-right:4px}.artalk>.atk-list>.atk-list-header .atk-right-action{display:flex;flex:1;flex-direction:row;align-items:center;justify-content:flex-end}.artalk>.atk-list>.atk-list-header .atk-right-action>span{font-size:14px;color:var(--at-color-meta);cursor:pointer;-webkit-user-select:none;-moz-user-select:none;user-select:none;position:relative}.artalk>.atk-list>.atk-list-header .atk-right-action>span.atk-on,.artalk>.atk-list>.atk-list-header .atk-right-action>span.atk-on *{color:var(--at-color-main)}.artalk>.atk-list>.atk-list-header .atk-right-action>span:not(:last-child):not(.atk-hide){margin-right:10px;padding-right:10px}.artalk>.atk-list>.atk-list-header .atk-right-action>span .atk-unread-badge{position:absolute;top:-5px;left:-6px;color:#fff;background:var(--at-color-pink);text-align:center;min-width:16px;height:16px;padding:0 3px;border-radius:8px;line-height:16px;font-size:12px}.artalk>.atk-list>.atk-list-body{min-height:150px}.artalk>.atk-list>.atk-list-footer{z-index:1;position:absolute;bottom:5px;right:0}@media only screen and (max-width: 768px){.artalk>.atk-list>.atk-list-footer{position:relative;margin-top:10px;text-align:center}}.artalk>.atk-list>.atk-list-footer .atk-copyright{display:block;font-size:12px;color:var(--at-color-meta);padding-right:15px;margin-top:5px}.artalk>.atk-list>.atk-list-footer .atk-copyright a{color:var(--at-color-main);text-decoration:none}.atk-list-no-comment{text-align:center;height:150px;line-height:150px;display:block;font-size:19px}.atk-list-read-more{border-top:1px dashed var(--at-color-border);margin-top:28px;padding-bottom:25px}@media only screen and (max-width: 768px){.atk-list-read-more{padding-bottom:10px}}.atk-list-read-more .atk-list-read-more-inner{cursor:pointer;-webkit-user-select:none;-moz-user-select:none;user-select:none;padding:0 15px;font-size:14px;border-radius:6px;border:1px solid transparent;display:flex;height:30px;flex-direction:row;place-content:center;align-items:center;width:120px;margin:-15px auto 0;background:var(--at-color-bg);border-color:var(--at-color-border)}.atk-list-read-more .atk-list-read-more-inner.atk-err>.atk-text{color:var(--at-color-red)!important}.atk-list-read-more .atk-list-read-more-inner>.atk-loading-icon{height:15px;width:15px}.atk-list-read-more .atk-list-read-more-inner>.atk-text{color:var(--at-color-meta)}.atk-list-read-more .atk-list-read-more-inner:hover{background:var(--at-color-bg-grey)}.atk-comment-wrap{overflow:hidden;position:relative;border-bottom:1px solid transparent}.atk-comment-wrap.atk-flash-once{-webkit-animation:atkFlashOnce 1s ease-in-out 0s;animation:atkFlashOnce 1s ease-in-out 0s}@-webkit-keyframes atkFlashOnce{0%{background:rgba(0,131,255,.2)}to{background:transparent}}@keyframes atkFlashOnce{0%{background:rgba(0,131,255,.2)}to{background:transparent}}.atk-comment-wrap.atk-unread:before{content:" ";position:absolute;left:0;top:10%;width:3px;height:80%;background:var(--at-color-main)}.atk-comment-wrap.atk-openable{cursor:pointer}.atk-comment-wrap.atk-openable:hover{background:var(--at-color-bg-grey)}.atk-comment-wrap.atk-openable .atk-height-limit:after{background:transparent!important}.atk-comment-wrap:last-child{border-bottom:none}.atk-comment{display:block;padding:12px 10px}.atk-comment>.atk-avatar{display:block;padding:2px 0;float:left}.atk-comment>.atk-avatar img{width:50px;height:50px;border-radius:3px}.atk-comment>.atk-main{display:block;margin-left:63px}.atk-comment>.atk-main>.atk-header{line-height:1;font-size:13px;margin-bottom:.5em;overflow:hidden;position:relative;display:flex;flex-wrap:wrap;align-items:center}.atk-comment>.atk-main>.atk-header .atk-item{display:flex;align-items:center;margin-top:2px;margin-bottom:2px;color:var(--at-color-meta)}.atk-comment>.atk-main>.atk-header .atk-item:not(:last-child){margin-right:6px}.atk-comment>.atk-main>.atk-header .atk-item.atk-nick,.atk-comment>.atk-main>.atk-header .atk-item.atk-nick a{font-size:14px;color:var(--at-color-main);text-decoration:none}.atk-comment>.atk-main>.atk-header .atk-item.atk-reply-at{margin-left:2px}.atk-comment>.atk-main>.atk-header .atk-item.atk-reply-at>.atk-arrow:before{content:"";vertical-align:middle;transform:rotate(90deg);border-bottom:4px solid var(--at-color-grey);border-left:3px solid transparent;border-right:3px solid transparent;display:inline-block;margin-top:-1px}.atk-comment>.atk-main>.atk-header .atk-item.atk-reply-at>.atk-nick{color:var(--at-color-main);cursor:pointer;margin-left:6px}.atk-comment>.atk-main>.atk-header .atk-badge-wrap>*:last-child{margin-right:6px}.atk-comment>.atk-main>.atk-header .atk-badge{display:inline-block;color:var(--at-color-meta);background:var(--at-color-bg-grey);padding:0 6px;line-height:17px;border-radius:3px;color:#fff}.atk-comment>.atk-main>.atk-header .atk-badge:not(:last-child){margin-right:6px}.atk-comment>.atk-main>.atk-header .atk-pinned-badge{display:inline-block;color:var(--at-color-meta);background:var(--at-color-bg-grey);padding:0 6px;line-height:17px;border-radius:3px;color:#fff;background:#f44336}.atk-comment>.atk-main>.atk-header .atk-pinned-badge:not(:last-child){margin-right:6px}.atk-comment>.atk-main>.atk-header .atk-ua{display:inline-block;color:var(--at-color-meta);background:var(--at-color-bg-grey);padding:0 6px;line-height:17px;border-radius:3px}.atk-comment>.atk-main>.atk-header .atk-ua:not(:last-child){margin-right:6px}@media only screen and (max-width: 768px){.atk-comment>.atk-main>.atk-header .atk-ua-wrap{display:block;margin-top:5px}}.atk-comment>.atk-main>.atk-body{display:block;overflow:hidden;position:relative}.atk-comment>.atk-main>.atk-body img{max-width:100%}.atk-comment>.atk-main>.atk-body>.atk-content{word-break:break-all}.atk-comment>.atk-main>.atk-body>.atk-content.atk-type-collapsed{border:3px solid var(--at-color-bg-grey);border-bottom:0;padding:5px 10px;border-radius:6px 6px 0 0;margin-bottom:-5px}.atk-comment>.atk-main>.atk-body>.atk-content>*:first-child{margin-top:0}.atk-comment>.atk-main>.atk-body>.atk-content>*:last-child{margin-bottom:0}.atk-comment>.atk-main>.atk-body>.atk-content .atk-height-limit-btn{bottom:5px}.atk-comment>.atk-main>.atk-body>.atk-pending{color:var(--at-color-meta);margin:3px 0;font-size:13px;padding:10px 18px;display:block;background:var(--at-color-bg-grey);border-left:4px solid #f44336}.atk-comment>.atk-main>.atk-body>.atk-reply-to{padding:5px 15px;border-left:3px solid #eee;margin-bottom:10px;position:relative;margin-top:10px}.atk-comment>.atk-main>.atk-body>.atk-reply-to .atk-meta{font-size:15px}.atk-comment>.atk-main>.atk-body>.atk-reply-to .atk-meta .atk-nick{color:var(--at-color-main)}.atk-comment>.atk-main>.atk-body>.atk-reply-to .atk-content{margin-top:5px}.atk-comment>.atk-main>.atk-body>.atk-collapsed{margin:3px 0;font-size:13px;padding:10px 18px;display:block;background:var(--at-color-bg-grey);border-radius:6px}.atk-comment>.atk-main>.atk-body>.atk-collapsed .atk-text{color:var(--at-color-meta)}.atk-comment>.atk-main>.atk-body>.atk-collapsed .atk-show-btn{color:var(--at-color-main);cursor:pointer;-webkit-user-select:none;-moz-user-select:none;user-select:none;margin-left:3px}.atk-comment>.atk-main>.atk-body>.atk-collapsed .atk-show-btn:hover{color:var(--at-color-main)}.atk-comment>.atk-main>.atk-footer{margin-top:12px}.atk-comment>.atk-main>.atk-footer .atk-actions{display:flex;flex-direction:row;align-items:center;flex-wrap:wrap;margin-bottom:-15px}.atk-comment>.atk-main>.atk-footer .atk-actions>span{color:var(--at-color-meta);font-size:13px;line-height:15px;display:inline-flex;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;user-select:none;margin-bottom:15px}.atk-comment>.atk-main>.atk-footer .atk-actions>span.atk-error,.atk-comment>.atk-main>.atk-footer .atk-actions>span.atk-error:hover{color:var(--at-color-red)}.atk-comment>.atk-main>.atk-footer .atk-actions>span:not(:last-child):not(.atk-hide){margin-right:16px}.atk-comment>.atk-main>.atk-footer .atk-actions>span:hover{color:var(--at-color-deep)}.atk-comment .atk-height-limit:after{position:absolute;z-index:1;display:block;overflow:hidden;width:100%;content:" ";bottom:0;height:80px;background:var(--at-color-gradient)}.atk-comment .atk-height-limit-btn{z-index:10;position:absolute;left:50%;bottom:10px;transform:translate(-50%);cursor:pointer;border:1px solid var(--at-color-border);border-radius:6px;background:var(--at-color-bg);padding:1px 20px;font-size:15px;color:var(--at-color-meta);-webkit-user-select:none;-moz-user-select:none;user-select:none}.atk-comment .atk-height-limit-btn:hover{background:var(--at-color-bg-grey)}.atk-comment .atk-height-limit .atk-height-limit .atk-height-limit-btn{display:none}.atk-comment-children>.atk-comment-wrap{margin-top:10px;border-left:1px dashed transparent;border-bottom-color:transparent}.atk-comment-children>.atk-comment-wrap:not(:last-child){margin-bottom:5px}.atk-comment-children>.atk-comment-wrap>.atk-comment{padding:4px 0}.atk-comment-children>.atk-comment-wrap>.atk-comment>.atk-avatar img{width:36px;height:36px}.atk-comment-children>.atk-comment-wrap>.atk-comment>.atk-main{margin-left:47px}.atk-pagination{display:flex;flex-direction:row;justify-content:center;padding:10px 0;position:relative}.atk-pagination>.atk-btn,.atk-pagination>.atk-input{font-size:15px;height:30px;border:1px solid var(--at-color-border);border-radius:3px;padding:0 5px;text-align:center;background:var(--at-color-bg)}.atk-pagination>.atk-btn{-webkit-user-select:none;-moz-user-select:none;user-select:none;width:70px;cursor:pointer;display:flex;justify-content:center;align-items:center}.atk-pagination>.atk-btn:hover{background:var(--at-color-bg-grey)}.atk-pagination>.atk-btn.atk-disabled{color:var(--at-color-sub)}.atk-pagination>.atk-btn.atk-disabled:hover{cursor:default;background:initial}.atk-pagination>.atk-input{background:transparent;color:var(--at-color-font);font-size:18px;width:60px;outline:none}.atk-pagination>.atk-input:focus{border-color:var(--at-color-main)}.atk-pagination>*:not(:last-child){margin-right:10px}.atk-sidebar-layer{position:fixed;z-index:99999;top:0;right:0;width:430px;height:100%;background:var(--at-color-bg);transition:transform .45s cubic-bezier(.23,1,.32,1) 0ms;transform:translate(430px)}@media only screen and (max-width: 430px){.atk-sidebar-layer{width:100%}}.atk-sidebar-layer .atk-sidebar-inner{position:relative;height:100%}.atk-sidebar-layer .atk-sidebar-header{position:absolute;top:0;right:0;display:flex;flex-direction:row;align-items:center;z-index:99999}.atk-sidebar-layer .atk-sidebar-header .atk-sidebar-close{display:flex;flex-direction:column;width:60px;height:60px;align-items:center;place-content:center;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;user-select:none;margin-left:10px}.atk-sidebar-layer .atk-sidebar-header .atk-sidebar-close:hover .atk-icon-close{background-color:#e81123e6}.atk-sidebar-layer .atk-sidebar-iframe-wrap{height:100%;position:relative}.atk-sidebar-layer .atk-sidebar-iframe-wrap iframe{border:0;width:100%;height:100%}.atk-sidebar-layer .atk-sidebar-iframe-wrap .atk-err-alert{z-index:9999;top:50%;left:50%;transform:translate(-50%,-50%);position:absolute;background:var(--at-color-bg);padding:40px 30px;width:80%;text-align:center;border-radius:4px}.atk-sidebar-layer .atk-sidebar-iframe-wrap .atk-err-alert .atk-title{font-size:1.4em;margin-bottom:20px;color:var(--at-color-font)}.atk-sidebar-layer .atk-sidebar-iframe-wrap .atk-err-alert .atk-text{color:var(--at-color-font)}.atk-sidebar-layer .atk-sidebar-iframe-wrap .atk-err-alert .atk-text span{cursor:pointer;color:var(--at-color-main)} diff --git a/assets/lib/artalk/Artalk.min.js b/assets/lib/artalk/Artalk.min.js deleted file mode 100644 index cf62c02e..00000000 --- a/assets/lib/artalk/Artalk.min.js +++ /dev/null @@ -1,7 +0,0 @@ -/** - * Skipped minification because the original files appears to be already minified. - * Original file: /npm/artalk@2.3.4/dist/Artalk.js - * - * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files - */ -var __defProp=Object.defineProperty,__defProps=Object.defineProperties,__getOwnPropDescs=Object.getOwnPropertyDescriptors,__getOwnPropSymbols=Object.getOwnPropertySymbols,__hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable,__defNormalProp=(e,t,i)=>t in e?__defProp(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,__spreadValues=(e,t)=>{for(var i in t||(t={}))__hasOwnProp.call(t,i)&&__defNormalProp(e,i,t[i]);if(__getOwnPropSymbols)for(var i of __getOwnPropSymbols(t))__propIsEnum.call(t,i)&&__defNormalProp(e,i,t[i]);return e},__spreadProps=(e,t)=>__defProps(e,__getOwnPropDescs(t)),__publicField=(e,t,i)=>(__defNormalProp(e,"symbol"!=typeof t?t+"":t,i),i),__async=(e,t,i)=>new Promise(((n,s)=>{var r=e=>{try{o(i.next(e))}catch(t){s(t)}},a=e=>{try{o(i.throw(e))}catch(t){s(t)}},o=e=>e.done?n(e.value):Promise.resolve(e.value).then(r,a);o((i=i.apply(e,t)).next())}));!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).Artalk=t()}(this,(function(){"use strict";var e={placeholder:"Leave a comment",noComment:"No Comment",send:"Send",save:"Save",nick:"Nickname",email:"Email",link:"Website",emoticon:"Emoji",preview:"Preview",image:"Image",uploadFail:"Upload Failed",commentFail:"Failed to comment",restoredMsg:"Content has been restored",onlyAdminCanReply:"Only admin can reply",uploadLoginMsg:"Please fill in your name and email to upload",counter:"{count} Comments",sortLatest:"Latest",sortOldest:"Oldest",sortBest:"Best",sortAuthor:"Author",openComment:"Open Comment",closeComment:"Close Comment",listLoadFailMsg:"Failed to load comments",listRetry:"Click to retry",loadMore:"Load More",admin:"Admin",reply:"Reply",voteUp:"Up",voteDown:"Down",voteFail:"Vote Failed",readMore:"Read More",actionConfirm:"Confirm",collapse:"Collapse",collapsed:"Collapsed",collapsedMsg:"This comment has been collapsed",expand:"Expand",approved:"Approved",pending:"Pending",pendingMsg:"Pending, visible only to commenter.",edit:"Edit",editCancel:"Cancel Edit",delete:"Delete",deleteConfirm:"Confirm",pin:"Pin",unpin:"Unpin",seconds:"seconds ago",minutes:"minutes ago",hours:"hours ago",days:"days ago",now:"just now",adminCheck:"Enter admin password:",captchaCheck:"Enter the CAPTCHA to continue:",confirm:"Confirm",cancel:"Cancel",msgCenter:"Messages",ctrlCenter:"Admin",frontend:"Frontend",backend:"Backend",loading:"Loading",loadFail:"Load Failed",editing:"Editing",editFail:"Edit Failed",deleting:"Deleting",deleteFail:"Delete Failed",reqGot:"Request got",reqAborted:"Request timed out or terminated unexpectedly"};const t={en:e,"en-US":e,"zh-CN":{placeholder:"键入内容...",noComment:"「此时无声胜有声」",send:"发送评论",save:"保存评论",nick:"昵称",email:"邮箱",link:"网址",emoticon:"表情",preview:"预览",image:"图片",uploadFail:"上传失败",commentFail:"评论失败",restoredMsg:"内容已自动恢复",onlyAdminCanReply:"仅管理员可评论",uploadLoginMsg:"填入你的名字邮箱才能上传哦",counter:"{count} 条评论",sortLatest:"最新",sortOldest:"最早",sortBest:"最热",sortAuthor:"作者",openComment:"打开评论",closeComment:"关闭评论",listLoadFailMsg:"无法获取评论列表数据",listRetry:"点击重新获取",loadMore:"加载更多",admin:"管理员",reply:"回复",voteUp:"赞同",voteDown:"反对",voteFail:"投票失败",readMore:"阅读更多",actionConfirm:"确认操作",collapse:"折叠",collapsed:"已折叠",collapsedMsg:"该评论已被系统或管理员折叠",expand:"展开",approved:"已审",pending:"待审",pendingMsg:"审核中,仅本人可见。",edit:"编辑",editCancel:"取消编辑",delete:"删除",deleteConfirm:"确认删除",pin:"置顶",unpin:"取消置顶",seconds:"秒前",minutes:"分钟前",hours:"小时前",days:"天前",now:"刚刚",adminCheck:"键入密码来验证管理员身份:",captchaCheck:"键入验证码继续:",confirm:"确认",cancel:"取消",msgCenter:"通知中心",ctrlCenter:"控制中心",frontend:"前端",backend:"后端",loading:"加载中",loadFail:"加载失败",editing:"修改中",editFail:"修改失败",deleting:"删除中",deleteFail:"删除失败",reqGot:"请求响应",reqAborted:"请求超时或意外终止"}};class i{constructor(e){__publicField(this,"ctx"),__publicField(this,"data"),this.ctx=e;const t=JSON.parse(window.localStorage.getItem("ArtalkUser")||"{}");this.data={nick:t.nick||"",email:t.email||"",link:t.link||"",token:t.token||"",isAdmin:t.isAdmin||!1}}update(e={}){Object.entries(e).forEach((([e,t])=>{this.data[e]=t})),window.localStorage.setItem("ArtalkUser",JSON.stringify(this.data)),this.ctx.trigger("user-changed",this.ctx.user.data)}logout(){this.update({token:"",isAdmin:!1})}checkHasBasicUserInfo(){return!!this.data.nick&&!!this.data.email}}class n{constructor(e){__publicField(this,"$el"),__publicField(this,"ctx"),__publicField(this,"conf"),this.ctx=e,this.conf=e.conf}$t(e,t={}){return this.ctx.$t(e,t)}}function s(){return{baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}let r={baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1};const a=/[&<>"']/,o=/[&<>"']/g,l=/[<>"']|&(?!#?\w+;)/,c=/[<>"']|&(?!#?\w+;)/g,h={"&":"&","<":"<",">":">",'"':""","'":"'"},d=e=>h[e];function p(e,t){if(t){if(a.test(e))return e.replace(o,d)}else if(l.test(e))return e.replace(c,d);return e}const u=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi;function m(e){return e.replace(u,((e,t)=>"colon"===(t=t.toLowerCase())?":":"#"===t.charAt(0)?"x"===t.charAt(1)?String.fromCharCode(parseInt(t.substring(2),16)):String.fromCharCode(+t.substring(1)):""))}const g=/(^|[^\[])\^/g;function f(e,t){e="string"==typeof e?e:e.source,t=t||"";const i={replace:(t,n)=>(n=(n=n.source||n).replace(g,"$1"),e=e.replace(t,n),i),getRegex:()=>new RegExp(e,t)};return i}const k=/[^\w:]/g,y=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function $(e,t,i){if(e){let e;try{e=decodeURIComponent(m(i)).replace(k,"").toLowerCase()}catch(n){return null}if(0===e.indexOf("javascript:")||0===e.indexOf("vbscript:")||0===e.indexOf("data:"))return null}t&&!y.test(i)&&(i=function(e,t){b[" "+e]||(x.test(e)?b[" "+e]=e+"/":b[" "+e]=L(e,"/",!0));const i=-1===(e=b[" "+e]).indexOf(":");return"//"===t.substring(0,2)?i?t:e.replace(_,"$1")+t:"/"===t.charAt(0)?i?t:e.replace(v,"$1")+t:e+t}(t,i));try{i=encodeURI(i).replace(/%25/g,"%")}catch(n){return null}return i}const b={},x=/^[^:]+:\/*[^/]*$/,_=/^([^:]+:)[\s\S]*$/,v=/^([^:]+:\/*[^/]*)[\s\S]*$/;const w={exec:function(){}};function C(e){let t,i,n=1;for(;n{let n=!1,s=t;for(;--s>=0&&"\\"===i[s];)n=!n;return n?"|":" |"})).split(/ \|/);let n=0;if(i[0].trim()||i.shift(),i.length>0&&!i[i.length-1].trim()&&i.pop(),i.length>t)i.splice(t);else for(;i.length1;)1&t&&(i+=e),t>>=1,e+=e;return i+e}function A(e,t,i,n){const s=t.href,r=t.title?p(t.title):null,a=e[1].replace(/\\([\[\]])/g,"$1");if("!"!==e[0].charAt(0)){n.state.inLink=!0;const e={type:"link",raw:i,href:s,title:r,text:a,tokens:n.inlineTokens(a,[])};return n.state.inLink=!1,e}return{type:"image",raw:i,href:s,title:r,text:p(a)}}class F{constructor(e){this.options=e||r}space(e){const t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(e){const t=this.rules.block.code.exec(e);if(t){const e=t[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?e:L(e,"\n")}}}fences(e){const t=this.rules.block.fences.exec(e);if(t){const e=t[0],i=function(e,t){const i=e.match(/^(\s+)(?:```)/);if(null===i)return t;const n=i[1];return t.split("\n").map((e=>{const t=e.match(/^\s+/);if(null===t)return e;const[i]=t;return i.length>=n.length?e.slice(n.length):e})).join("\n")}(e,t[3]||"");return{type:"code",raw:e,lang:t[2]?t[2].trim():t[2],text:i}}}heading(e){const t=this.rules.block.heading.exec(e);if(t){let e=t[2].trim();if(/#$/.test(e)){const t=L(e,"#");this.options.pedantic?e=t.trim():t&&!/ $/.test(t)||(e=t.trim())}const i={type:"heading",raw:t[0],depth:t[1].length,text:e,tokens:[]};return this.lexer.inline(i.text,i.tokens),i}}hr(e){const t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:t[0]}}blockquote(e){const t=this.rules.block.blockquote.exec(e);if(t){const e=t[0].replace(/^ *>[ \t]?/gm,"");return{type:"blockquote",raw:t[0],tokens:this.lexer.blockTokens(e,[]),text:e}}}list(e){let t=this.rules.block.list.exec(e);if(t){let i,n,s,r,a,o,l,c,h,d,p,u,m=t[1].trim();const g=m.length>1,f={type:"list",raw:"",ordered:g,start:g?+m.slice(0,-1):"",loose:!1,items:[]};m=g?`\\d{1,9}\\${m.slice(-1)}`:`\\${m}`,this.options.pedantic&&(m=g?m:"[*+-]");const k=new RegExp(`^( {0,3}${m})((?:[\t ][^\\n]*)?(?:\\n|$))`);for(;e&&(u=!1,t=k.exec(e))&&!this.rules.block.hr.test(e);){if(i=t[0],e=e.substring(i.length),c=t[2].split("\n",1)[0],h=e.split("\n",1)[0],this.options.pedantic?(r=2,p=c.trimLeft()):(r=t[2].search(/[^ ]/),r=r>4?1:r,p=c.slice(r),r+=t[1].length),o=!1,!c&&/^ *$/.test(h)&&(i+=h+"\n",e=e.substring(h.length+1),u=!0),!u){const t=new RegExp(`^ {0,${Math.min(3,r-1)}}(?:[*+-]|\\d{1,9}[.)])((?: [^\\n]*)?(?:\\n|$))`),n=new RegExp(`^ {0,${Math.min(3,r-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),s=new RegExp(`^( {0,${Math.min(3,r-1)}})(\`\`\`|~~~)`);for(;e&&(d=e.split("\n",1)[0],c=d,this.options.pedantic&&(c=c.replace(/^ {1,4}(?=( {4})*[^ ])/g," ")),!s.test(c))&&!this.rules.block.heading.test(c)&&!t.test(c)&&!n.test(e);){if(c.search(/[^ ]/)>=r||!c.trim())p+="\n"+c.slice(r);else{if(o)break;p+="\n"+c}o||c.trim()||(o=!0),i+=d+"\n",e=e.substring(d.length+1)}}f.loose||(l?f.loose=!0:/\n *\n *$/.test(i)&&(l=!0)),this.options.gfm&&(n=/^\[[ xX]\] /.exec(p),n&&(s="[ ] "!==n[0],p=p.replace(/^\[[ xX]\] +/,""))),f.items.push({type:"list_item",raw:i,task:!!n,checked:s,loose:!1,text:p}),f.raw+=i}f.items[f.items.length-1].raw=i.trimRight(),f.items[f.items.length-1].text=p.trimRight(),f.raw=f.raw.trimRight();const y=f.items.length;for(a=0;a"space"===e.type)),t=e.every((e=>{const t=e.raw.split("");let i=0;for(const n of t)if("\n"===n&&(i+=1),i>1)return!0;return!1}));!f.loose&&e.length&&t&&(f.loose=!0,f.items[a].loose=!0)}return f}}html(e){const t=this.rules.block.html.exec(e);if(t){const e={type:"html",raw:t[0],pre:!this.options.sanitizer&&("pre"===t[1]||"script"===t[1]||"style"===t[1]),text:t[0]};return this.options.sanitize&&(e.type="paragraph",e.text=this.options.sanitizer?this.options.sanitizer(t[0]):p(t[0]),e.tokens=[],this.lexer.inline(e.text,e.tokens)),e}}def(e){const t=this.rules.block.def.exec(e);if(t){t[3]&&(t[3]=t[3].substring(1,t[3].length-1));return{type:"def",tag:t[1].toLowerCase().replace(/\s+/g," "),raw:t[0],href:t[2],title:t[3]}}}table(e){const t=this.rules.block.table.exec(e);if(t){const e={type:"table",header:S(t[1]).map((e=>({text:e}))),align:t[2].replace(/^ *|\| *$/g,"").split(/ *\| */),rows:t[3]&&t[3].trim()?t[3].replace(/\n[ \t]*$/,"").split("\n"):[]};if(e.header.length===e.align.length){e.raw=t[0];let i,n,s,r,a=e.align.length;for(i=0;i({text:e})));for(a=e.header.length,n=0;n/i.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:this.options.sanitize?"text":"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(t[0]):p(t[0]):t[0]}}link(e){const t=this.rules.inline.link.exec(e);if(t){const e=t[2].trim();if(!this.options.pedantic&&/^$/.test(e))return;const t=L(e.slice(0,-1),"\\");if((e.length-t.length)%2==0)return}else{const e=function(e,t){if(-1===e.indexOf(t[1]))return-1;const i=e.length;let n=0,s=0;for(;s-1){const i=(0===t[0].indexOf("!")?5:4)+t[1].length+e;t[2]=t[2].substring(0,e),t[0]=t[0].substring(0,i).trim(),t[3]=""}}let i=t[2],n="";if(this.options.pedantic){const e=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(i);e&&(i=e[1],n=e[3])}else n=t[3]?t[3].slice(1,-1):"";return i=i.trim(),/^$/.test(e)?i.slice(1):i.slice(1,-1)),A(t,{href:i?i.replace(this.rules.inline._escapes,"$1"):i,title:n?n.replace(this.rules.inline._escapes,"$1"):n},t[0],this.lexer)}}reflink(e,t){let i;if((i=this.rules.inline.reflink.exec(e))||(i=this.rules.inline.nolink.exec(e))){let e=(i[2]||i[1]).replace(/\s+/g," ");if(e=t[e.toLowerCase()],!e||!e.href){const e=i[0].charAt(0);return{type:"text",raw:e,text:e}}return A(i,e,i[0],this.lexer)}}emStrong(e,t,i=""){let n=this.rules.inline.emStrong.lDelim.exec(e);if(!n)return;if(n[3]&&i.match(/[\p{L}\p{N}]/u))return;const s=n[1]||n[2]||"";if(!s||s&&(""===i||this.rules.inline.punctuation.exec(i))){const i=n[0].length-1;let s,r,a=i,o=0;const l="*"===n[0][0]?this.rules.inline.emStrong.rDelimAst:this.rules.inline.emStrong.rDelimUnd;for(l.lastIndex=0,t=t.slice(-1*e.length+i);null!=(n=l.exec(t));){if(s=n[1]||n[2]||n[3]||n[4]||n[5]||n[6],!s)continue;if(r=s.length,n[3]||n[4]){a+=r;continue}if((n[5]||n[6])&&i%3&&!((i+r)%3)){o+=r;continue}if(a-=r,a>0)continue;if(r=Math.min(r,r+a+o),Math.min(i,r)%2){const t=e.slice(1,i+n.index+r);return{type:"em",raw:e.slice(0,i+n.index+r+1),text:t,tokens:this.lexer.inlineTokens(t,[])}}const t=e.slice(2,i+n.index+r-1);return{type:"strong",raw:e.slice(0,i+n.index+r+1),text:t,tokens:this.lexer.inlineTokens(t,[])}}}}codespan(e){const t=this.rules.inline.code.exec(e);if(t){let e=t[2].replace(/\n/g," ");const i=/[^ ]/.test(e),n=/^ /.test(e)&&/ $/.test(e);return i&&n&&(e=e.substring(1,e.length-1)),e=p(e,!0),{type:"codespan",raw:t[0],text:e}}}br(e){const t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e){const t=this.rules.inline.del.exec(e);if(t)return{type:"del",raw:t[0],text:t[2],tokens:this.lexer.inlineTokens(t[2],[])}}autolink(e,t){const i=this.rules.inline.autolink.exec(e);if(i){let e,n;return"@"===i[2]?(e=p(this.options.mangle?t(i[1]):i[1]),n="mailto:"+e):(e=p(i[1]),n=e),{type:"link",raw:i[0],text:e,href:n,tokens:[{type:"text",raw:e,text:e}]}}}url(e,t){let i;if(i=this.rules.inline.url.exec(e)){let e,n;if("@"===i[2])e=p(this.options.mangle?t(i[0]):i[0]),n="mailto:"+e;else{let t;do{t=i[0],i[0]=this.rules.inline._backpedal.exec(i[0])[0]}while(t!==i[0]);e=p(i[0]),n="www."===i[1]?"http://"+e:e}return{type:"link",raw:i[0],text:e,href:n,tokens:[{type:"text",raw:e,text:e}]}}}inlineText(e,t){const i=this.rules.inline.text.exec(e);if(i){let e;return e=this.lexer.state.inRawBlock?this.options.sanitize?this.options.sanitizer?this.options.sanitizer(i[0]):p(i[0]):i[0]:p(this.options.smartypants?t(i[0]):i[0]),{type:"text",raw:i[0],text:e}}}}const R={newline:/^(?: *(?:\n|$))+/,code:/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*\n)|~{3,})([^\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?=\n|$)|$)/,hr:/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/,html:"^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|\\n*|$)|\\n*|$)|)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))",def:/^ {0,3}\[(label)\]: *(?:\n *)?]+)>?(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/,table:w,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,text:/^[^\n]+/,_label:/(?!\s*\])(?:\\.|[^\[\]\\])+/,_title:/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/};R.def=f(R.def).replace("label",R._label).replace("title",R._title).getRegex(),R.bullet=/(?:[*+-]|\d{1,9}[.)])/,R.listItemStart=f(/^( *)(bull) */).replace("bull",R.bullet).getRegex(),R.list=f(R.list).replace(/bull/g,R.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+R.def.source+")").getRegex(),R._tag="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",R._comment=/|$)/,R.html=f(R.html,"i").replace("comment",R._comment).replace("tag",R._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),R.paragraph=f(R._paragraph).replace("hr",R.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",R._tag).getRegex(),R.blockquote=f(R.blockquote).replace("paragraph",R.paragraph).getRegex(),R.normal=C({},R),R.gfm=C({},R.normal,{table:"^ *([^\\n ].*\\|.*)\\n {0,3}(?:\\| *)?(:?-+:? *(?:\\| *:?-+:? *)*)(?:\\| *)?(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"}),R.gfm.table=f(R.gfm.table).replace("hr",R.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",R._tag).getRegex(),R.gfm.paragraph=f(R._paragraph).replace("hr",R.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("table",R.gfm.table).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",R._tag).getRegex(),R.pedantic=C({},R.normal,{html:f("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",R._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:w,paragraph:f(R.normal._paragraph).replace("hr",R.hr).replace("heading"," *#{1,6} *[^\n]").replace("lheading",R.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});const B={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:w,tag:"^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(ref)\]/,nolink:/^!?\[(ref)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",emStrong:{lDelim:/^(?:\*+(?:([punct_])|[^\s*]))|^_+(?:([punct*])|([^\s_]))/,rDelimAst:/^[^_*]*?\_\_[^_*]*?\*[^_*]*?(?=\_\_)|[^*]+(?=[^*])|[punct_](\*+)(?=[\s]|$)|[^punct*_\s](\*+)(?=[punct_\s]|$)|[punct_\s](\*+)(?=[^punct*_\s])|[\s](\*+)(?=[punct_])|[punct_](\*+)(?=[punct_])|[^punct*_\s](\*+)(?=[^punct*_\s])/,rDelimUnd:/^[^_*]*?\*\*[^_*]*?\_[^_*]*?(?=\*\*)|[^_]+(?=[^_])|[punct*](\_+)(?=[\s]|$)|[^punct*_\s](\_+)(?=[punct*\s]|$)|[punct*\s](\_+)(?=[^punct*_\s])|[\s](\_+)(?=[punct*])|[punct*](\_+)(?=[punct*])/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:w,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\.5&&(i="x"+i.toString(16)),n+="&#"+i+";";return n}B._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~",B.punctuation=f(B.punctuation).replace(/punctuation/g,B._punctuation).getRegex(),B.blockSkip=/\[[^\]]*?\]\([^\)]*?\)|`[^`]*?`|<[^>]*?>/g,B.escapedEmSt=/\\\*|\\_/g,B._comment=f(R._comment).replace("(?:--\x3e|$)","--\x3e").getRegex(),B.emStrong.lDelim=f(B.emStrong.lDelim).replace(/punct/g,B._punctuation).getRegex(),B.emStrong.rDelimAst=f(B.emStrong.rDelimAst,"g").replace(/punct/g,B._punctuation).getRegex(),B.emStrong.rDelimUnd=f(B.emStrong.rDelimUnd,"g").replace(/punct/g,B._punctuation).getRegex(),B._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,B._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,B._email=/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/,B.autolink=f(B.autolink).replace("scheme",B._scheme).replace("email",B._email).getRegex(),B._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,B.tag=f(B.tag).replace("comment",B._comment).replace("attribute",B._attribute).getRegex(),B._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,B._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/,B._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,B.link=f(B.link).replace("label",B._label).replace("href",B._href).replace("title",B._title).getRegex(),B.reflink=f(B.reflink).replace("label",B._label).replace("ref",R._label).getRegex(),B.nolink=f(B.nolink).replace("ref",R._label).getRegex(),B.reflinkSearch=f(B.reflinkSearch,"g").replace("reflink",B.reflink).replace("nolink",B.nolink).getRegex(),B.normal=C({},B),B.pedantic=C({},B.normal,{strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:f(/^!?\[(label)\]\((.*?)\)/).replace("label",B._label).getRegex(),reflink:f(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",B._label).getRegex()}),B.gfm=C({},B.normal,{escape:f(B.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\t+" ".repeat(i.length)));e;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some((n=>!!(i=n.call({lexer:this},e,t))&&(e=e.substring(i.raw.length),t.push(i),!0)))))if(i=this.tokenizer.space(e))e=e.substring(i.raw.length),1===i.raw.length&&t.length>0?t[t.length-1].raw+="\n":t.push(i);else if(i=this.tokenizer.code(e))e=e.substring(i.raw.length),n=t[t.length-1],!n||"paragraph"!==n.type&&"text"!==n.type?t.push(i):(n.raw+="\n"+i.raw,n.text+="\n"+i.text,this.inlineQueue[this.inlineQueue.length-1].src=n.text);else if(i=this.tokenizer.fences(e))e=e.substring(i.raw.length),t.push(i);else if(i=this.tokenizer.heading(e))e=e.substring(i.raw.length),t.push(i);else if(i=this.tokenizer.hr(e))e=e.substring(i.raw.length),t.push(i);else if(i=this.tokenizer.blockquote(e))e=e.substring(i.raw.length),t.push(i);else if(i=this.tokenizer.list(e))e=e.substring(i.raw.length),t.push(i);else if(i=this.tokenizer.html(e))e=e.substring(i.raw.length),t.push(i);else if(i=this.tokenizer.def(e))e=e.substring(i.raw.length),n=t[t.length-1],!n||"paragraph"!==n.type&&"text"!==n.type?this.tokens.links[i.tag]||(this.tokens.links[i.tag]={href:i.href,title:i.title}):(n.raw+="\n"+i.raw,n.text+="\n"+i.raw,this.inlineQueue[this.inlineQueue.length-1].src=n.text);else if(i=this.tokenizer.table(e))e=e.substring(i.raw.length),t.push(i);else if(i=this.tokenizer.lheading(e))e=e.substring(i.raw.length),t.push(i);else{if(s=e,this.options.extensions&&this.options.extensions.startBlock){let t=1/0;const i=e.slice(1);let n;this.options.extensions.startBlock.forEach((function(e){n=e.call({lexer:this},i),"number"==typeof n&&n>=0&&(t=Math.min(t,n))})),t<1/0&&t>=0&&(s=e.substring(0,t+1))}if(this.state.top&&(i=this.tokenizer.paragraph(s)))n=t[t.length-1],r&&"paragraph"===n.type?(n.raw+="\n"+i.raw,n.text+="\n"+i.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=n.text):t.push(i),r=s.length!==e.length,e=e.substring(i.raw.length);else if(i=this.tokenizer.text(e))e=e.substring(i.raw.length),n=t[t.length-1],n&&"text"===n.type?(n.raw+="\n"+i.raw,n.text+="\n"+i.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=n.text):t.push(i);else if(e){const t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw new Error(t)}}return this.state.top=!0,t}inline(e,t){this.inlineQueue.push({src:e,tokens:t})}inlineTokens(e,t=[]){let i,n,s,r,a,o,l=e;if(this.tokens.links){const e=Object.keys(this.tokens.links);if(e.length>0)for(;null!=(r=this.tokenizer.rules.inline.reflinkSearch.exec(l));)e.includes(r[0].slice(r[0].lastIndexOf("[")+1,-1))&&(l=l.slice(0,r.index)+"["+E("a",r[0].length-2)+"]"+l.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;null!=(r=this.tokenizer.rules.inline.blockSkip.exec(l));)l=l.slice(0,r.index)+"["+E("a",r[0].length-2)+"]"+l.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;null!=(r=this.tokenizer.rules.inline.escapedEmSt.exec(l));)l=l.slice(0,r.index)+"++"+l.slice(this.tokenizer.rules.inline.escapedEmSt.lastIndex);for(;e;)if(a||(o=""),a=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some((n=>!!(i=n.call({lexer:this},e,t))&&(e=e.substring(i.raw.length),t.push(i),!0)))))if(i=this.tokenizer.escape(e))e=e.substring(i.raw.length),t.push(i);else if(i=this.tokenizer.tag(e))e=e.substring(i.raw.length),n=t[t.length-1],n&&"text"===i.type&&"text"===n.type?(n.raw+=i.raw,n.text+=i.text):t.push(i);else if(i=this.tokenizer.link(e))e=e.substring(i.raw.length),t.push(i);else if(i=this.tokenizer.reflink(e,this.tokens.links))e=e.substring(i.raw.length),n=t[t.length-1],n&&"text"===i.type&&"text"===n.type?(n.raw+=i.raw,n.text+=i.text):t.push(i);else if(i=this.tokenizer.emStrong(e,l,o))e=e.substring(i.raw.length),t.push(i);else if(i=this.tokenizer.codespan(e))e=e.substring(i.raw.length),t.push(i);else if(i=this.tokenizer.br(e))e=e.substring(i.raw.length),t.push(i);else if(i=this.tokenizer.del(e))e=e.substring(i.raw.length),t.push(i);else if(i=this.tokenizer.autolink(e,O))e=e.substring(i.raw.length),t.push(i);else if(this.state.inLink||!(i=this.tokenizer.url(e,O))){if(s=e,this.options.extensions&&this.options.extensions.startInline){let t=1/0;const i=e.slice(1);let n;this.options.extensions.startInline.forEach((function(e){n=e.call({lexer:this},i),"number"==typeof n&&n>=0&&(t=Math.min(t,n))})),t<1/0&&t>=0&&(s=e.substring(0,t+1))}if(i=this.tokenizer.inlineText(s,M))e=e.substring(i.raw.length),"_"!==i.raw.slice(-1)&&(o=i.raw.slice(-1)),a=!0,n=t[t.length-1],n&&"text"===n.type?(n.raw+=i.raw,n.text+=i.text):t.push(i);else if(e){const t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw new Error(t)}}else e=e.substring(i.raw.length),t.push(i);return t}}class I{constructor(e){this.options=e||r}code(e,t,i){const n=(t||"").match(/\S*/)[0];if(this.options.highlight){const t=this.options.highlight(e,n);null!=t&&t!==e&&(i=!0,e=t)}return e=e.replace(/\n$/,"")+"\n",n?'
      '+(i?e:p(e,!0))+"
      \n":"
      "+(i?e:p(e,!0))+"
      \n"}blockquote(e){return`
      \n${e}
      \n`}html(e){return e}heading(e,t,i,n){if(this.options.headerIds){return`${e}\n`}return`${e}\n`}hr(){return this.options.xhtml?"
      \n":"
      \n"}list(e,t,i){const n=t?"ol":"ul";return"<"+n+(t&&1!==i?' start="'+i+'"':"")+">\n"+e+"\n"}listitem(e){return`
    • ${e}
    • \n`}checkbox(e){return" "}paragraph(e){return`

      ${e}

      \n`}table(e,t){return t&&(t=`${t}`),"\n\n"+e+"\n"+t+"
      \n"}tablerow(e){return`\n${e}\n`}tablecell(e,t){const i=t.header?"th":"td";return(t.align?`<${i} align="${t.align}">`:`<${i}>`)+e+`\n`}strong(e){return`${e}`}em(e){return`${e}`}codespan(e){return`${e}`}br(){return this.options.xhtml?"
      ":"
      "}del(e){return`${e}`}link(e,t,i){if(null===(e=$(this.options.sanitize,this.options.baseUrl,e)))return i;let n='
      ",n}image(e,t,i){if(null===(e=$(this.options.sanitize,this.options.baseUrl,e)))return i;let n=`${i}":">",n}text(e){return e}}class U{strong(e){return e}em(e){return e}codespan(e){return e}del(e){return e}html(e){return e}text(e){return e}link(e,t,i){return""+i}image(e,t,i){return""+i}br(){return""}}class q{constructor(){this.seen={}}serialize(e){return e.toLowerCase().trim().replace(/<[!\/a-z].*?>/gi,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-")}getNextSafeSlug(e,t){let i=e,n=0;if(this.seen.hasOwnProperty(i)){n=this.seen[e];do{n++,i=e+"-"+n}while(this.seen.hasOwnProperty(i))}return t||(this.seen[e]=n,this.seen[i]=0),i}slug(e,t={}){const i=this.serialize(e);return this.getNextSafeSlug(i,t.dryrun)}}class D{constructor(e){this.options=e||r,this.options.renderer=this.options.renderer||new I,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new U,this.slugger=new q}static parse(e,t){return new D(t).parse(e)}static parseInline(e,t){return new D(t).parseInline(e)}parse(e,t=!0){let i,n,s,r,a,o,l,c,h,d,p,u,g,f,k,y,$,b,x,_="";const v=e.length;for(i=0;i0&&"paragraph"===k.tokens[0].type?(k.tokens[0].text=b+" "+k.tokens[0].text,k.tokens[0].tokens&&k.tokens[0].tokens.length>0&&"text"===k.tokens[0].tokens[0].type&&(k.tokens[0].tokens[0].text=b+" "+k.tokens[0].tokens[0].text)):k.tokens.unshift({type:"text",text:b}):f+=b),f+=this.parse(k.tokens,g),h+=this.renderer.listitem(f,$,y);_+=this.renderer.list(h,p,u);continue;case"html":_+=this.renderer.html(d.text);continue;case"paragraph":_+=this.renderer.paragraph(this.parseInline(d.tokens));continue;case"text":for(h=d.tokens?this.parseInline(d.tokens):d.text;i+1{s(e.text,e.lang,(function(t,i){if(t)return a(t);null!=i&&i!==e.text&&(e.text=i,e.escaped=!0),o--,0===o&&a()}))}),0))})),void(0===o&&a())}try{const i=P.lex(e,t);return t.walkTokens&&z.walkTokens(i,t.walkTokens),D.parse(i,t)}catch(n){if(n.message+="\nPlease report this to https://github.com/markedjs/marked.",t.silent)return"

      An error occurred:

      "+p(n.message+"",!0)+"
      ";throw n}}z.options=z.setOptions=function(e){var t;return C(z.defaults,e),t=z.defaults,r=t,z},z.getDefaults=s,z.defaults=r,z.use=function(...e){const t=C({},...e),i=z.defaults.extensions||{renderers:{},childTokens:{}};let n;e.forEach((e=>{if(e.extensions&&(n=!0,e.extensions.forEach((e=>{if(!e.name)throw new Error("extension name required");if(e.renderer){const t=i.renderers?i.renderers[e.name]:null;i.renderers[e.name]=t?function(...i){let n=e.renderer.apply(this,i);return!1===n&&(n=t.apply(this,i)),n}:e.renderer}if(e.tokenizer){if(!e.level||"block"!==e.level&&"inline"!==e.level)throw new Error("extension level must be 'block' or 'inline'");i[e.level]?i[e.level].unshift(e.tokenizer):i[e.level]=[e.tokenizer],e.start&&("block"===e.level?i.startBlock?i.startBlock.push(e.start):i.startBlock=[e.start]:"inline"===e.level&&(i.startInline?i.startInline.push(e.start):i.startInline=[e.start]))}e.childTokens&&(i.childTokens[e.name]=e.childTokens)}))),e.renderer){const i=z.defaults.renderer||new I;for(const t in e.renderer){const n=i[t];i[t]=(...s)=>{let r=e.renderer[t].apply(i,s);return!1===r&&(r=n.apply(i,s)),r}}t.renderer=i}if(e.tokenizer){const i=z.defaults.tokenizer||new F;for(const t in e.tokenizer){const n=i[t];i[t]=(...s)=>{let r=e.tokenizer[t].apply(i,s);return!1===r&&(r=n.apply(i,s)),r}}t.tokenizer=i}if(e.walkTokens){const i=z.defaults.walkTokens;t.walkTokens=function(t){e.walkTokens.call(this,t),i&&i.call(this,t)}}n&&(t.extensions=i),z.setOptions(t)}))},z.walkTokens=function(e,t){for(const i of e)switch(t.call(z,i),i.type){case"table":for(const e of i.header)z.walkTokens(e.tokens,t);for(const e of i.rows)for(const i of e)z.walkTokens(i.tokens,t);break;case"list":z.walkTokens(i.items,t);break;default:z.defaults.extensions&&z.defaults.extensions.childTokens&&z.defaults.extensions.childTokens[i.type]?z.defaults.extensions.childTokens[i.type].forEach((function(e){z.walkTokens(i[e],t)})):i.tokens&&z.walkTokens(i.tokens,t)}},z.parseInline=function(e,t){if(null==e)throw new Error("marked.parseInline(): input parameter is undefined or null");if("string"!=typeof e)throw new Error("marked.parseInline(): input parameter is of type "+Object.prototype.toString.call(e)+", string expected");T(t=C({},z.defaults,t||{}));try{const i=P.lexInline(e,t);return t.walkTokens&&z.walkTokens(i,t.walkTokens),D.parseInline(i,t)}catch(i){if(i.message+="\nPlease report this to https://github.com/markedjs/marked.",t.silent)return"

      An error occurred:

      "+p(i.message+"",!0)+"
      ";throw i}},z.Parser=D,z.parser=D.parse,z.Renderer=I,z.TextRenderer=U,z.Lexer=P,z.lexer=P.lex,z.Tokenizer=F,z.Slugger=q,z.parse=z,z.options,z.setOptions,z.use,z.walkTokens,z.parseInline,D.parse,P.lex;var N="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},W={"&":"&","<":"<",">":">",'"':""","'":"'"},H={"&":"&","<":"<",">":">",""":'"',"'":"'"},j=/(&|<|>|"|')/g,Q=/[&<>"']/g;function V(e){return W[e]}function Z(e){return H[e]}function G(e){return null==e?"":String(e).replace(Q,V)}function K(e){return null==e?"":String(e).replace(j,Z)}G.options=K.options={};var Y={encode:G,escape:G,decode:K,unescape:K,version:"1.0.0-browser"};var X=function e(t){for(var i,n,s=Array.prototype.slice.call(arguments,1);s.length;)for(n in i=s.shift())i.hasOwnProperty(n)&&("[object Object]"===Object.prototype.toString.call(t[n])?t[n]=e(t[n],i[n]):t[n]=i[n]);return t},J=function(e){return"string"==typeof e?e.toLowerCase():e};function ee(e,t){return e[t]=!0,e}var te=function(e){return e.reduce(ee,{})},ie={uris:te(["background","base","cite","href","longdesc","src","usemap"])},ne={voids:te(["area","br","col","hr","img","wbr","input","base","basefont","link","meta"])},se=Y,re=J,ae=ne,oe=/^<\s*([\w:-]+)((?:\s+[\w:-]+(?:\s*=\s*(?:(?:"[^"]*")|(?:'[^']*')|[^>\s]+))?)*)\s*(\/?)\s*>/,le=/^<\s*\/\s*([\w:-]+)[^>]*>/,ce=/([\w:-]+)(?:\s*=\s*(?:(?:"((?:[^"])*)")|(?:'((?:[^'])*)')|([^>\s]+)))?/g,he=/^=0&&(t.comment&&t.comment(e.substring(4,n)),e=e.substring(n+3),i=!1):de.test(e)?a(le,l):he.test(e)&&a(oe,o);var n;!function(){if(!i)return;var n,s=e.indexOf("<");s>=0?(n=e.substring(0,s),e=e.substring(s)):(n=e,e="");t.chars&&t.chars(n)}()}();var n=e===s;s=e,n&&(e="")}function a(t,n){var s=e.match(t);s&&(e=e.substring(s[0].length),s[0].replace(t,n),i=!1)}function o(e,i,s,r){var a={},o=re(i),l=ae.voids[o]||!!r;s.replace(ce,(function(e,t,i,n,s){a[t]=void 0===i&&void 0===n&&void 0===s?void 0:se.decode(i||n||s||"")})),l||n.push(o),t.start&&t.start(o,a,l)}function l(e,i){var s,r=0,a=re(i);if(a)for(r=n.length-1;r>=0&&n[r]!==a;r--);if(r>=0){for(s=n.length-1;s>=r;s--)t.end&&t.end(n[s]);n.length=r}}l()},ye=function(e,t){var i,n=t||{};return o(),{start:function(e,t,a){var o=ue(e);if(i.ignoring)return void r(o);if(-1===(n.allowedTags||[]).indexOf(o))return void r(o);if(n.filter&&!n.filter({tag:o,attrs:t}))return void r(o);s("<"),s(o),Object.keys(t).forEach((function(e){var i=t[e],r=(n.allowedClasses||{})[o]||[],a=(n.allowedAttributes||{})[o]||[],l=ue(e);("class"===l&&-1===a.indexOf(l)?(i=i.split(" ").filter((function(e){return r&&-1!==r.indexOf(e)})).join(" ").trim()).length:-1!==a.indexOf(l)&&(!0!==me.uris[l]||function(e){var t=e[0];if("#"===t||"/"===t)return!0;var i=e.indexOf(":");if(-1===i)return!0;var s=e.indexOf("?");if(-1!==s&&i>s)return!0;var r=e.indexOf("#");return-1!==r&&i>r||n.allowedSchemes.some(a);function a(t){return 0===e.indexOf(t+":")}}(i)))&&(s(" "),s(e),"string"==typeof i&&(s('="'),s(pe.encode(i)),s('"')))})),s(a?"/>":">")},end:function(e){var t=ue(e);-1!==(n.allowedTags||[]).indexOf(t)&&!1===i.ignoring?(s("")):a(t)},chars:function(e){!1===i.ignoring&&s(n.transformText?n.transformText(e):e)}};function s(t){e.push(t)}function r(e){ge.voids[e]||(!1===i.ignoring?i={ignoring:e,depth:1}:i.ignoring===e&&i.depth++)}function a(e){i.ignoring===e&&--i.depth<=0&&o()}function o(){i={ignoring:!1,depth:0}}},$e={allowedAttributes:{a:["href","name","target","title","aria-label"],iframe:["allowfullscreen","frameborder","src"],img:["src","alt","title","aria-label"]},allowedClasses:{},allowedSchemes:["http","https","mailto"],allowedTags:["a","abbr","article","b","blockquote","br","caption","code","del","details","div","em","h1","h2","h3","h4","h5","h6","hr","i","img","ins","kbd","li","main","mark","ol","p","pre","section","span","strike","strong","sub","summary","sup","table","tbody","td","th","thead","tr","u","ul"],filter:null};function be(e,t,i){var n=[],s=!0===i?t:fe({},$e,t),r=ye(n,s);return ke(e,r),n.join("")}be.defaults=$e;var xe=be,_e={exports:{}};_e.exports=function(){function e(e,t){return e(t={exports:{}},t.exports),t.exports}var t=e((function(e){var t=e.exports=function(){return new RegExp("(?:"+t.line().source+")|(?:"+t.block().source+")","gm")};t.line=function(){return/(?:^|\s)\/\/(.+?)$/gm},t.block=function(){return/\/\*([\S\s]*?)\*\//gm}})),i=["23AC69","91C132","F19726","E8552D","1AAB8E","E1147F","2980C1","1BA1E6","9FA0A0","F19726","E30B20","E30B20","A3338B"];function n(e){return''+e+""}return function(e,s){void 0===s&&(s={});var r=s.colors;void 0===r&&(r=i);var a=0,o={},l=new RegExp("("+/[\u4E00-\u9FFF\u3400-\u4dbf\uf900-\ufaff\u3040-\u309f\uac00-\ud7af\u0400-\u04FF]+|\w+/.source+"|"+/'+t+"
      ";return a=++a%r.length,l}))}}();var ve=_e.exports;function we(e=""){const t=document.createElement("div");return t.innerHTML=e.trim(),t.firstElementChild||t}function Ce(e){return parseFloat(getComputedStyle(e,null).height.replace("px",""))}function Se(e){const t=RegExp(`[?&]${e}=([^&]*)`).exec(window.location.search);return t&&decodeURIComponent(t[1].replace(/\+/g," "))}function Le(e){const t=e.getBoundingClientRect();return{top:t.top+window.scrollY,left:t.left+window.scrollX}}function Te(e,t){let i=e.toString();for(;i.length{n--,0===n&&t()})),0===n&&t()}function Fe(e,t){var i;let n=null==(i=e.markedInstance)?void 0:i.parse(t);n||(n=t.replace(/```\s*([^]+?.*?[^]+?[^]+?)```/g,((e,t)=>`
      ${ve(t)}
      `)).replace(/!\[(.*?)\]\((.*?)\)/g,((e,t,i)=>`${t}`)).replace(/\[(.*?)\]\((.*?)\)/g,((e,t,i)=>`
      ${t}`)).replace(/\n/g,"
      "));let s=xe(n,{allowedClasses:{},allowedSchemes:["http","https","mailto"],allowedTags:["a","abbr","article","b","blockquote","br","caption","code","del","details","div","em","h1","h2","h3","h4","h5","h6","hr","i","img","ins","kbd","li","main","mark","ol","p","pre","section","span","strike","strong","sub","summary","sup","table","tbody","td","th","thead","tr","u","ul"],allowedAttributes:{"*":["title","accesskey"],a:["href","name","target","aria-label","rel"],img:["src","alt","title","atk-emoticon","aria-label"],code:["class"],span:["class","style"]},filter:e=>([["code",/^hljs\W+language-(.*)$/],["span",/^(hljs-.*)$/]].forEach((([t,i])=>{e.tag===t&&e.attrs.class&&!i.test(e.attrs.class)&&delete e.attrs.class})),"span"===e.tag&&e.attrs.style&&!/^color:(\W+)?#[0-9a-f]{3,6};?$/i.test(e.attrs.style)&&delete e.attrs.style,!0)});return e.markedReplacers.forEach((e=>{"function"==typeof e&&(s=e(s))})),s}function Re(){return __async(this,null,(function*(){const e=navigator.userAgent;if(!navigator.userAgentData||!navigator.userAgentData.getHighEntropyValues)return e;const t=navigator.userAgentData;let i=null;try{i=yield t.getHighEntropyValues(["platformVersion"])}catch(s){return console.error(s),e}const n=Number(i.platformVersion.split(".")[0]);return"Windows"===t.platform&&n>=13?e.replace(/Windows NT 10.0/,"Windows NT 11.0"):"macOS"===t.platform&&n>=11?e.replace(/(Mac OS X \d+_\d+_\d+|Mac OS X)/,`Mac OS X ${i.platformVersion.replace(/\./g,"_")}`):e}))}function Be(e,t){return function(e,t){return`${e.replace(/\/$/,"")}/${t.replace(/^\//,"")}`}(e.conf.server,t)}function Me(e,t){const i=e=>e&&"object"==typeof e;return i(e)&&i(t)?(Object.keys(t).forEach((n=>{const s=e[n],r=t[n];Array.isArray(s)&&Array.isArray(r)?e[n]=s.concat(r):i(s)&&i(r)?e[n]=Me(__spreadValues({},s),r):e[n]=r})),e):t}function Oe(e,t){let i=e.querySelector(":scope > .atk-loading");i||(i=we(''),(null==t?void 0:t.transparentBg)&&(i.style.background="transparent"),e.appendChild(i)),i.style.display="";const n=i.querySelector(".atk-loading-spinner");n&&(n.style.display="none",window.setTimeout((()=>{n.style.display=""}),500))}function Pe(e){const t=e.querySelector(":scope > .atk-loading");t&&(t.style.display="none")}function Ie(e,t=!0){const i=Le(e).top+Ce(e)/2-document.documentElement.clientHeight/2;t?window.scroll({top:i>0?i:0,left:0}):window.scroll(0,i>0?i:0)}function Ue(e,t,i){const n=we(`
      `);n.querySelector(".atk-notify-content").innerHTML=function(e){const t=document.createElement("div");return t.innerText=e,t.innerHTML}(t).replace("\n","
      "),e.appendChild(n);const s=()=>{n.classList.add("atk-fade-out"),setTimeout((()=>{n.remove()}),200)};let r;r=window.setTimeout((()=>{s()}),3e3),n.addEventListener("click",(()=>{s(),window.clearTimeout(r)}))}function qe(e,t){!function(e,t,i="in"){e.classList.add(`atk-fade-${i}`);const n=()=>{e.classList.remove(`atk-fade-${i}`),e.removeEventListener("animationend",n),t&&t()};e.addEventListener("animationend",n)}(e,t,"in")}function De(e,t,i='Artalk Error'){let n=e.querySelector(".atk-error-layer");if(null===t)return void(null!==n&&n.remove());n||(n=we(`
      ${i}
      `),e.appendChild(n));const s=n.querySelector(".atk-error-text");s.innerHTML="",null!==t&&(t instanceof HTMLElement?s.appendChild(t):s.innerText=t)}const ze=class extends n{constructor(e,t,i){super(e),__publicField(this,"name"),__publicField(this,"$wrap"),__publicField(this,"$mask"),__publicField(this,"maskClickHideEnable",!0),__publicField(this,"afterHide"),this.name=t;const{$wrap:n,$mask:s}=We(e);this.$wrap=n,this.$mask=s,this.$el=this.$wrap.querySelector(`[data-layer-name="${t}"].atk-layer-item`),null===this.$el&&(i?this.$el=i:(this.$el=we(),this.$el.classList.add("atk-layer-item"))),this.$el.setAttribute("data-layer-name",t),this.$el.style.display="none",this.$wrap.append(this.$el)}getName(){return this.name}getWrapEl(){return this.$wrap}getEl(){return this.$el}show(){this.fireAllActionTimer(),this.$wrap.style.display="block",this.$mask.style.display="block",this.$mask.classList.add("atk-fade-in"),this.$el.style.display="",this.$mask.onclick=()=>{this.maskClickHideEnable&&this.hide()},this.pageBodyScrollBarHide()}hide(){this.afterHide&&this.afterHide(),this.$wrap.classList.add("atk-fade-out"),this.$el.style.display="none",this.pageBodyScrollBarShow(),this.newActionTimer((()=>{this.$wrap.style.display="none",this.checkCleanLayer()}),450),this.newActionTimer((()=>{this.$wrap.style.display="none",this.$wrap.classList.remove("atk-fade-out")}),200)}setMaskClickHide(e){this.maskClickHideEnable=e}pageBodyScrollBarHide(){document.body.style.overflow="hidden";const e=parseInt(window.getComputedStyle(document.body,null).getPropertyValue("padding-right"),10);document.body.style.paddingRight=`${function(){const e=document.createElement("p");e.style.width="100%",e.style.height="200px";const t=document.createElement("div");t.style.position="absolute",t.style.top="0px",t.style.left="0px",t.style.visibility="hidden",t.style.width="200px",t.style.height="150px",t.style.overflow="hidden",t.appendChild(e),document.body.appendChild(t);const i=e.offsetWidth;t.style.overflow="scroll";let n=e.offsetWidth;return i===n&&(n=t.clientWidth),document.body.removeChild(t),i-n}()+e||0}px`}pageBodyScrollBarShow(){document.body.style.overflow=ze.BodyOrgOverflow,document.body.style.paddingRight=ze.BodyOrgPaddingRight}newActionTimer(e,t){const i=()=>{e(),ze.actionTimers=ze.actionTimers.filter((e=>e.act!==i))},n=window.setTimeout((()=>i()),t);ze.actionTimers.push({act:i,tid:n})}fireAllActionTimer(){ze.actionTimers.forEach((e=>{clearTimeout(e.tid),e.act()}))}disposeNow(){this.$el.remove(),this.pageBodyScrollBarShow(),this.checkCleanLayer()}dispose(){this.hide(),this.$el.remove(),this.checkCleanLayer()}checkCleanLayer(){0===this.getWrapEl().querySelectorAll(".atk-layer-item").length&&(this.$wrap.style.display="none")}};let Ne=ze;function We(e){let t=document.querySelector(`.atk-layer-wrap#ctx-${e.cid}`);t||(t=we(``),document.body.appendChild(t));const i=t.querySelector(".atk-layer-mask");return{$wrap:t,$mask:i}}function He(e,t,i,n){return __async(this,null,(function*(){var s,r;if(e.user.data.token){const t=new Headers(i.headers);t.set("Authorization",`Bearer ${e.user.data.token}`),i.headers=t}const a=yield function(e,t,i,n){var s;const r=new AbortController;null==(s=n.signal)||s.addEventListener("abort",(()=>r.abort()));let a=fetch(t,__spreadProps(__spreadValues({},n),{signal:r.signal}));if(i>0){const e=setTimeout((()=>r.abort()),i);a.finally((()=>{clearTimeout(e)}))}return a=a.catch((t=>{throw"AbortError"===(t||{}).name?new Error(e.$t("reqAborted")):t})),a}(e,t,n||e.conf.reqTimeout||15e3,i),o=a.status,l=[401,400].includes(o);if(!a.ok&&!l)throw new Error(`${e.$t("reqGot")} ${o}`);let c=yield a.json();const h=(n,s)=>{He(e,t,i).then((e=>{n(e)})).catch((e=>{s(e)}))};if((null==(s=c.data)?void 0:s.need_captcha)?c=yield new Promise(((t,i)=>{e.checkCaptcha({imgData:c.data.img_data,iframe:c.data.iframe,onSuccess:()=>{h(t,i)},onCancel:()=>{i(c)}})})):((null==(r=c.data)?void 0:r.need_login)||l)&&(c=yield new Promise(((t,i)=>{e.checkAdmin({onSuccess:()=>{h(t,i)},onCancel:()=>{i(c)}})}))),!c.success)throw c;return c}))}function je(e,t,i){return __async(this,null,(function*(){const n={method:"POST"};i=__spreadValues({site_name:e.conf.site||""},i||{}),n.body=Qe(i);return(yield He(e,t,n)).data||{}}))}function Qe(e){const t=new FormData;return Object.keys(e).forEach((i=>t.append(i,String(e[i])))),t}__publicField(Ne,"BodyOrgOverflow"),__publicField(Ne,"BodyOrgPaddingRight"),__publicField(Ne,"actionTimers",[]),function(){function e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function t(e,t){for(var i=0;i({user:e.data.user,is_login:e.data.is_login,unread:e.data.unread||[],unread_count:e.data.unread_count||0}))),abort:()=>{i.abort()}}}loginStatus(){return __async(this,null,(function*(){return(yield je(this.ctx,`${this.baseURL}/login-status`,{name:this.ctx.user.data.nick,email:this.ctx.user.data.email}))||{is_login:!1,is_admin:!1}}))}logout(){return __async(this,null,(function*(){return je(this.ctx,`${this.baseURL}/logout`)}))}pageGet(e,t,i){return __async(this,null,(function*(){const n={site_name:e||"",offset:t||0,limit:i||15};return yield je(this.ctx,`${this.baseURL}/admin/page-get`,n)}))}pageEdit(e){return __async(this,null,(function*(){const t={id:e.id,key:e.key,title:e.title,admin_only:e.admin_only,site_name:e.site_name||this.ctx.conf.site};return(yield je(this.ctx,`${this.baseURL}/admin/page-edit`,t)).page}))}pageDel(e,t){const i={key:String(e),site_name:t||""};return je(this.ctx,`${this.baseURL}/admin/page-del`,i)}pageFetch(e,t,i){return __async(this,null,(function*(){const n={};e&&(n.id=e),t&&(n.site_name=t),i&&(n.get_status=i);return yield je(this.ctx,`${this.baseURL}/admin/page-fetch`,n)}))}siteGet(){return __async(this,null,(function*(){return(yield je(this.ctx,`${this.baseURL}/admin/site-get`,{})).sites}))}siteAdd(e,t){return __async(this,null,(function*(){const i={name:e,urls:t};return(yield je(this.ctx,`${this.baseURL}/admin/site-add`,i)).site}))}siteEdit(e){return __async(this,null,(function*(){const t={id:e.id,name:e.name||"",urls:e.urls||""};return(yield je(this.ctx,`${this.baseURL}/admin/site-edit`,t)).site}))}siteDel(e,t=!1){const i={id:e,del_content:t};return je(this.ctx,`${this.baseURL}/admin/site-del`,i)}export(){return __async(this,null,(function*(){var e;return(null==(e=(yield He(this.ctx,`${this.baseURL}/admin/export`,{method:"POST"},0)).data)?void 0:e.data)||""}))}vote(e,t){return __async(this,null,(function*(){const i={site_name:this.ctx.conf.site||"",target_id:e,type:t};this.ctx.user.checkHasBasicUserInfo()&&(i.name=this.ctx.user.data.nick,i.email=this.ctx.user.data.email);return yield je(this.ctx,`${this.baseURL}/vote`,i)}))}markRead(e,t=!1){const i={site_name:this.ctx.conf.site||"",notify_key:e};return t&&(delete i.notify_key,i.read_all=!0,i.name=this.ctx.user.data.nick,i.email=this.ctx.user.data.email),je(this.ctx,`${this.baseURL}/mark-read`,i)}pv(){return __async(this,null,(function*(){const e={site_name:this.ctx.conf.site||"",page_key:this.ctx.conf.pageKey||"",page_title:this.ctx.conf.pageTitle||""};return(yield je(this.ctx,`${this.baseURL}/pv`,e)).pv}))}stat(e,t,i){return __async(this,null,(function*(){const n={type:e,site_name:this.ctx.conf.site||""};t&&(n.page_keys=Array.isArray(t)?t.join(","):t),i&&(n.limit=i);return yield je(this.ctx,`${this.baseURL}/stat`,n)}))}imgUpload(e){return __async(this,null,(function*(){const t={name:this.ctx.user.data.nick,email:this.ctx.user.data.email,page_key:this.ctx.conf.pageKey};this.ctx.conf.site&&(t.site_name=this.ctx.conf.site);const i=Qe(t);i.set("file",e);const n={method:"POST",body:i};return(yield He(this.ctx,`${this.baseURL}/img-upload`,n)).data||{}}))}conf(){return __async(this,null,(function*(){const e=(yield je(this.ctx,`${this.baseURL}/conf`)).frontend_conf||{};return e.emoticons&&"string"==typeof e.emoticons&&(e.emoticons=e.emoticons.trim(),e.emoticons.startsWith("[")||e.emoticons.startsWith("{")?e.emoticons=JSON.parse(e.emoticons):"false"===e.emoticons&&(e.emoticons=!1)),e}))}captchaGet(){return __async(this,null,(function*(){return(yield je(this.ctx,`${this.baseURL}/captcha/refresh`)).img_data||""}))}captchaCheck(e){return __async(this,null,(function*(){return(yield je(this.ctx,`${this.baseURL}/captcha/check`,{value:e})).img_data||""}))}captchaStatus(){return __async(this,null,(function*(){return(yield je(this.ctx,`${this.baseURL}/captcha/status`))||{is_pass:!1}}))}cacheFlushAll(){return je(this.ctx,`${this.baseURL}/admin/cache-flush`,{flush_all:!0})}cacheWarmUp(){return je(this.ctx,`${this.baseURL}/admin/cache-warm`,{})}}class Ze{constructor(e,t){__publicField(this,"api"),__publicField(this,"editor"),__publicField(this,"list"),__publicField(this,"sidebarLayer"),__publicField(this,"checkerLauncher"),__publicField(this,"cid"),__publicField(this,"conf"),__publicField(this,"user"),__publicField(this,"$root"),__publicField(this,"markedInstance"),__publicField(this,"markedReplacers",[]),__publicField(this,"commentList",[]),__publicField(this,"eventList",[]),this.cid=+new Date,this.conf=e,this.user=new i(this),this.$root=t||document.createElement("div"),this.$root.setAttribute("atk-run-id",this.cid.toString()),this.$root.classList.add("artalk"),this.$root.innerHTML="",this.api=new Ve(this)}setApi(e){this.api=e}setEditor(e){this.editor=e}setList(e){this.list=e}setSidebarLayer(e){this.sidebarLayer=e}setCheckerLauncher(e){this.checkerLauncher=e}getApi(){return this.api}getCommentList(){return this.commentList}getCommentDataList(){return this.commentList.map((e=>e.getData()))}findComment(e){return this.commentList.find((t=>t.getData().id===e))}deleteComment(e){let t;if("number"==typeof e){const i=this.findComment(e);if(!i)throw Error(`Comment ${e} cannot be found`);t=i}else t=e;t.getEl().remove(),this.commentList.splice(this.commentList.indexOf(t),1);const i=this.list.getData();i&&(i.total-=1),this.list.refreshUI()}clearAllComments(){this.list.getCommentsWrapEl().innerHTML="",this.list.clearData(),this.commentList=[]}insertComment(e){this.list.insertComment(e)}updateComment(e){this.list.updateComment(e)}replyComment(e,t,i){this.editor.setReply(e,t,i)}cancelReplyComment(){this.editor.cancelReply()}editComment(e,t){this.editor.setEditComment(e,t)}cancelEditComment(){this.editor.cancelEditComment()}updateNotifies(e){this.list.updateUnread(e)}listReload(){this.list.reload()}reload(){this.listReload()}listRefreshUI(){this.list.refreshUI()}editorOpen(){this.editor.open()}editorClose(){this.editor.close()}editorShowLoading(){this.editor.showLoading()}editorHideLoading(){this.editor.hideLoading()}editorShowNotify(e,t){this.editor.showNotify(e,t)}editorTravel(e){this.editor.travel(e)}editorTravelBack(){this.editor.travelBack()}showSidebar(e){this.sidebarLayer.show(e)}hideSidebar(){this.sidebarLayer.hide()}checkAdmin(e){this.checkerLauncher.checkAdmin(e)}checkCaptcha(e){this.checkerLauncher.checkCaptcha(e)}checkAdminShowEl(){const e=[];this.$root.querySelectorAll("[atk-only-admin-show]").forEach((t=>e.push(t)));const{$wrap:t}=We(this);t&&t.querySelectorAll("[atk-only-admin-show]").forEach((t=>e.push(t)));const i=document.querySelector(".atk-sidebar");i&&i.querySelectorAll("[atk-only-admin-show]").forEach((t=>e.push(t))),e.forEach((e=>{this.user.data.isAdmin?e.classList.remove("atk-hide"):e.classList.add("atk-hide")}))}on(e,t,i="internal"){this.eventList.push({name:e,handler:t,scope:i})}off(e,t,i="internal"){this.eventList=this.eventList.filter((n=>t?!(n.name===e&&n.handler===t&&n.scope===i):!(n.name===e&&n.scope===i)))}trigger(e,t,i){this.eventList.filter((t=>t.name===e&&(!i||t.scope===i))).map((e=>e.handler)).forEach((e=>e(t)))}$t(e,i={}){let n=this.conf.locale;"string"==typeof n&&(n=t[n]);let s=(null==n?void 0:n[e])||e;return s=s.replace(/\{\s*(\w+?)\s*\}/g,((e,t)=>i[t]||"")),s}setDarkMode(e){const t="atk-dark-mode";this.conf.darkMode=e,this.trigger("conf-updated"),this.conf.darkMode?this.$root.classList.add(t):this.$root.classList.remove(t);const{$wrap:i}=We(this);i&&(this.conf.darkMode?i.classList.add(t):i.classList.remove(t))}}class Ge{constructor(e,t){return __publicField(this,"ctx"),__publicField(this,"$el"),__publicField(this,"$content"),__publicField(this,"$actions"),this.ctx=e,this.$el=we('
      \n
      \n
      \n
      \n
      \n
      '),this.$actions=this.$el.querySelector(".atk-layer-dialog-actions"),this.$content=this.$el.querySelector(".atk-layer-dialog-content"),this.$content.appendChild(t),this}setYes(e){const t=we(``);return t.onclick=this.onBtnClick(e),this.$actions.appendChild(t),this}setNo(e){const t=we(``);return t.onclick=this.onBtnClick(e),this.$actions.appendChild(t),this}onBtnClick(e){return t=>{const i=e(t.currentTarget,this);void 0!==i&&!0!==i||this.$el.remove()}}}const Ke={request:(e,t,i)=>e.ctx.getApi().captchaCheck(i),body(e,t){if(e.captchaConf.iframe){const i=we('
      '),n=we('');n.style.display="none",Oe(i,{transparentBg:!0}),n.src=`${e.ctx.conf.server}/api/captcha/get?t=${+new Date}`,n.onload=()=>{n.style.display="",Pe(i)},i.append(n);const s=we('
      ');i.append(s),t.hideInteractInput();let r=!1;const a=e=>new Promise((t=>{window.setTimeout((()=>{t(null)}),e)}));return function i(){return __async(this,null,(function*(){if(yield a(1e3),r)return;let n=!1;try{n=(yield e.ctx.getApi().captchaStatus()).is_pass}catch(s){n=!1}n?t.triggerSuccess():i()}))}(),s.onclick=()=>{r=!0,t.cancel()},i}const i=we(`${e.ctx.$t("captchaCheck")}`);return i.querySelector(".atk-captcha-img").onclick=()=>{const t=i.querySelector(".atk-captcha-img");e.ctx.getApi().captchaGet().then((e=>{t.setAttribute("src",e)})).catch((e=>{console.error("Failed to get captcha image ",e)}))},i},onSuccess(e,t,i,n,s){e.captchaConf.val=n},onError(e,t,i,n,s){s.querySelector(".atk-captcha-img").click()}},Ye={inputType:"password",request(e,t,i){const n={name:e.ctx.user.data.nick,email:e.ctx.user.data.email,password:i};return e.ctx.getApi().login(n.name,n.email,n.password)},body:(e,t)=>we(`${e.ctx.$t("adminCheck")}`),onSuccess(e,t,i,n,s){e.ctx.user.update({isAdmin:!0,token:i}),e.ctx.trigger("user-changed",e.ctx.user.data),e.ctx.listReload()},onError(e,t,i,n,s){}};class Xe{constructor(e){__publicField(this,"ctx"),__publicField(this,"launched",[]),__publicField(this,"captchaConf",{}),this.ctx=e}checkCaptcha(e){this.captchaConf.imgData=e.imgData,this.captchaConf.iframe=e.iframe,this.fire(Ke,e)}checkAdmin(e){this.fire(Ye,e)}fire(e,t){if(this.launched.includes(e))return;this.launched.push(e);const i=new Ne(this.ctx,`checker-${(new Date).getTime()}`);i.setMaskClickHide(!1),i.show();let n=!1;const s={getLayer:()=>i,hideInteractInput:()=>{n=!0},triggerSuccess:()=>{this.close(e,i),e.onSuccess&&e.onSuccess(this,s,"","",r),t.onSuccess&&t.onSuccess("",l.$el)},cancel:()=>{this.close(e,i),t.onCancel&&t.onCancel()}},r=we();r.appendChild(e.body(this,s));const a=we(``);let o;r.appendChild(a),setTimeout((()=>a.focus()),80),a.onkeyup=e=>{"Enter"!==e.key&&13!==e.keyCode||(e.preventDefault(),i.getEl().querySelector('button[data-action="confirm"]').click())};const l=new Ge(this.ctx,r);l.setYes((n=>{const c=a.value.trim();o||(o=n.innerText);const h=()=>{n.innerText=o||"",n.classList.remove("error")};return n.innerText=`${this.ctx.$t("loading")}...`,e.request(this,s,c).then((n=>{this.close(e,i),e.onSuccess&&e.onSuccess(this,s,n,c,r),t.onSuccess&&t.onSuccess(c,l.$el)})).catch((t=>{var i;i=String(t.msg||String(t)),n.innerText=i,n.classList.add("error"),e.onError&&e.onError(this,s,t,c,r);const o=setTimeout((()=>h()),3e3);a.onfocus=()=>{h(),clearTimeout(o)}})),!1})),l.setNo((()=>(this.close(e,i),t.onCancel&&t.onCancel(),!1))),n&&(a.style.display="none",l.$el.querySelector(".atk-layer-dialog-actions").style.display="none"),i.getEl().append(l.$el),t.onMount&&t.onMount(l.$el)}close(e,t){t.disposeNow(),this.launched=this.launched.filter((t=>t!==e))}}class Je{constructor(e){__publicField(this,"editor"),__publicField(this,"$panel"),__publicField(this,"$btn"),__publicField(this,"onHeaderInput"),this.editor=e}get ctx(){return this.editor.ctx}registerPanel(e="
      "){return this.$panel=we(e),this.$panel}registerBtn(e){return this.$btn=we(`${e}`),this.$btn}registerHeaderInputEvt(e){this.onHeaderInput=e}getPanel(){return this.$panel}getBtn(){return this.$btn}}__publicField(Je,"Name");class et extends Je{constructor(e){super(e),__publicField(this,"emoticons",[]),__publicField(this,"loadingTask",null),__publicField(this,"$grpWrap"),__publicField(this,"$grpSwitcher"),__publicField(this,"isListLoaded",!1),__publicField(this,"isImgLoaded",!1),this.editor=e,this.registerPanel('
      '),this.registerBtn(this.ctx.$t("emoticon")),window.setTimeout((()=>{this.loadEmoticonsData()}),1e3)}onPanelShow(){(()=>{__async(this,null,(function*(){yield this.loadEmoticonsData(),this.isImgLoaded||(this.initEmoticonsList(),this.isImgLoaded=!0),setTimeout((()=>{this.changeListHeight()}),30)}))})()}onPanelHide(){this.$panel.parentElement.style.height=""}loadEmoticonsData(){return __async(this,null,(function*(){this.isListLoaded||(null===this.loadingTask?(this.loadingTask=(()=>__async(this,null,(function*(){Oe(this.$panel),this.emoticons=yield this.handleData(this.ctx.conf.emoticons),Pe(this.$panel),this.loadingTask=null,this.isListLoaded=!0})))(),yield this.loadingTask):yield this.loadingTask)}))}handleData(e){return __async(this,null,(function*(){if(!Array.isArray(e)&&["object","string"].includes(typeof e)&&(e=[e]),!Array.isArray(e))return De(this.$panel,"表情包数据必须为 Array/Object/String 类型"),Pe(this.$panel),[];const t=t=>{"object"==typeof t&&(t.name&&e.find((e=>e.name===t.name))||e.push(t))},i=e=>__async(this,null,(function*(){yield Promise.all(e.map(((e,n)=>__async(this,null,(function*(){if("object"!=typeof e||Array.isArray(e)){if(Array.isArray(e))yield i(e);else if("string"==typeof e){const n=yield this.remoteLoad(e);Array.isArray(n)?yield i(n):"object"==typeof n&&t(n)}}else t(e)})))))}));return yield i(e),e.forEach((e=>{if(this.isOwOFormat(e)){this.convertOwO(e).forEach((e=>{t(e)}))}else Array.isArray(e)&&e.forEach((e=>{t(e)}))})),e=e.filter((e=>"object"==typeof e&&!Array.isArray(e)&&!!e&&!!e.name)),this.solveNullKey(e),this.solveSameKey(e),e}))}remoteLoad(e){return __async(this,null,(function*(){if(!e)return[];try{const t=yield fetch(e);return yield t.json()}catch(t){return Pe(this.$panel),De(this.$panel,`表情加载失败 ${String(t)}`),[]}}))}solveNullKey(e){e.forEach((e=>{e.items.forEach(((t,i)=>{t.key||(t.key=`${e.name} ${i+1}`)}))}))}solveSameKey(e){const t={};e.forEach((e=>{e.items.forEach((e=>{e.key&&""!==String(e.key).trim()&&(t[e.key]?t[e.key]++:t[e.key]=1,t[e.key]>1&&(e.key=`${e.key} ${t[e.key]}`))}))}))}isOwOFormat(e){try{return"object"==typeof e&&!!Object.values(e).length&&Array.isArray(Object.keys(Object.values(e)[0].container))&&Object.keys(Object.values(e)[0].container[0]).includes("icon")}catch(t){return!1}}convertOwO(e){const t=[];return Object.entries(e).forEach((([e,i])=>{const n={name:e,type:i.type,items:[]};i.container.forEach(((t,i)=>{const s=t.icon;if(/<(img|IMG)/.test(s)){const e=/src=["'](.*?)["']/.exec(s);e&&e.length>1&&(t.icon=e[1])}n.items.push({key:t.text||`${e} ${i+1}`,val:t.icon})})),t.push(n)})),t}initEmoticonsList(){this.$grpWrap=we('
      '),this.$panel.append(this.$grpWrap),this.emoticons.forEach(((e,t)=>{const i=we('');this.$grpWrap.append(i),i.setAttribute("data-index",String(t)),i.setAttribute("data-grp-name",e.name),i.setAttribute("data-type",e.type),e.items.forEach((t=>{const n=we('');if(i.append(n),t.key&&!new RegExp(`^(${e.name})?\\s?[0-9]+$`).test(t.key)&&n.setAttribute("title",t.key),"image"===e.type){const e=document.createElement("img");e.src=t.val,e.alt=t.key,n.append(e)}else n.innerText=t.val;n.onclick=()=>{"image"===e.type?this.editor.insertContent(`:[${t.key}]`):this.editor.insertContent(t.val||"")}}))})),this.emoticons.length>1&&(this.$grpSwitcher=we('
      '),this.$panel.append(this.$grpSwitcher),this.emoticons.forEach(((e,t)=>{const i=we("");i.innerText=e.name,i.setAttribute("data-index",String(t)),i.onclick=()=>this.openGrp(t),this.$grpSwitcher.append(i)}))),this.emoticons.length>0&&this.openGrp(0)}openGrp(e){var t,i,n;Array.from(this.$grpWrap.children).forEach((t=>{const i=t;i.getAttribute("data-index")!==String(e)?i.style.display="none":i.style.display=""})),null==(t=this.$grpSwitcher)||t.querySelectorAll("span.active").forEach((e=>e.classList.remove("active"))),null==(n=null==(i=this.$grpSwitcher)?void 0:i.querySelector(`span[data-index="${e}"]`))||n.classList.add("active"),this.changeListHeight()}changeListHeight(){}transEmoticonImageText(e){return this.emoticons&&Array.isArray(this.emoticons)?(this.emoticons.forEach((t=>{"image"===t.type&&Object.entries(t.items).forEach((([t,i])=>{e=e.split(`:[${i.key}]`).join(``)}))})),e):e}}__publicField(et,"Name","emoticons");class tt extends Je{constructor(e){super(e),__publicField(this,"$imgUploadInput"),__publicField(this,"allowImgExts",["png","jpg","jpeg","gif","bmp","svg","webp"]),this.$imgUploadInput=document.createElement("input"),this.$imgUploadInput.type="file",this.$imgUploadInput.style.display="none",this.$imgUploadInput.accept=this.allowImgExts.map((e=>`.${e}`)).join(",");const t=this.registerBtn(`${this.ctx.$t("image")}`);t.after(this.$imgUploadInput),t.onclick=()=>{const e=this.$imgUploadInput;e.onchange=()=>{(()=>{__async(this,null,(function*(){if(!e.files||0===e.files.length)return;const t=e.files[0];this.uploadImg(t)}))})()},e.click()},this.ctx.on("conf-updated",(()=>{this.ctx.conf.imgUpload||(this.getBtn().setAttribute("atk-only-admin-show",""),this.ctx.checkAdminShowEl())}));const i=e=>{if(e)for(let t=0;t{e.stopPropagation(),e.preventDefault()})),this.editor.$textarea.addEventListener("drop",(e=>{var t;const n=null==(t=e.dataTransfer)?void 0:t.files;(null==n?void 0:n.length)&&(e.preventDefault(),i(n))})),this.editor.$textarea.addEventListener("paste",(e=>{var t;const n=null==(t=e.clipboardData)?void 0:t.files;(null==n?void 0:n.length)&&(e.preventDefault(),i(n))}))}uploadImg(e){return __async(this,null,(function*(){const t=/[^.]+$/.exec(e.name);if(!t||!this.allowImgExts.includes(t[0]))return;if(!this.ctx.user.checkHasBasicUserInfo())return void this.editor.showNotify(this.ctx.$t("uploadLoginMsg"),"w");let i="\n";""===this.editor.$textarea.value.trim()&&(i="");const n=`${i}![](Uploading ${e.name}...)`;let s;this.editor.insertContent(n);try{s=this.ctx.conf.imgUploader?{img_url:yield this.ctx.conf.imgUploader(e)}:yield this.ctx.getApi().imgUpload(e)}catch(r){console.error(r),this.editor.showNotify(`${this.ctx.$t("uploadFail")},${r.msg}`,"e")}if(s&&s.img_url){let e=s.img_url;(function(e){let t;try{t=new URL(e)}catch(i){return!1}return"http:"===t.protocol||"https:"===t.protocol})(e)||(e=Be(this.ctx,e)),this.editor.setContent(this.editor.$textarea.value.replace(n,`${i}![](${e})`))}else this.editor.setContent(this.editor.$textarea.value.replace(n,""))}))}}__publicField(tt,"Name","upload");class it extends Je{constructor(e){super(e),__publicField(this,"isBind",!1),this.registerPanel('
      ');let t=this.editor.$t("preview");this.ctx.markedInstance&&(t+=' '),this.registerBtn(t)}onPanelShow(){if(this.updateContent(),!this.isBind){const e=()=>{this.updateContent()};this.editor.$textarea.addEventListener("input",e),this.editor.$textarea.addEventListener("change",e),this.isBind=!0}}updateContent(){"none"!==this.$panel.style.display&&(this.$panel.innerHTML=this.editor.getContentMarked())}}__publicField(it,"Name","preview");class nt extends Je{constructor(e){super(e),__publicField(this,"queryUserInfo",{timeout:null,abortFunc:null}),this.registerHeaderInputEvt(((e,t)=>{"nick"!==e&&"email"!==e||this.fetchUserInfo()})),this.editor.$link.addEventListener("change",(()=>{const e=this.editor.$link.value.trim();e&&!/^(http|https):\/\//.test(e)&&(this.editor.$link.value=`https://${e}`,this.ctx.user.update({link:this.editor.$link.value}))}))}fetchUserInfo(){this.ctx.user.logout(),this.queryUserInfo.timeout&&window.clearTimeout(this.queryUserInfo.timeout),this.queryUserInfo.abortFunc&&this.queryUserInfo.abortFunc(),this.queryUserInfo.timeout=window.setTimeout((()=>{this.queryUserInfo.timeout=null;const{req:e,abort:t}=this.ctx.getApi().userGet(this.ctx.user.data.nick,this.ctx.user.data.email);this.queryUserInfo.abortFunc=t,e.then((e=>{var t;e.is_login||this.ctx.user.logout(),this.ctx.updateNotifies(e.unread),this.ctx.user.checkHasBasicUserInfo()&&!e.is_login&&(null==(t=e.user)?void 0:t.is_admin)&&this.showLoginDialog(),e.user&&e.user.link&&(this.editor.$link.value=e.user.link,this.ctx.user.update({link:e.user.link}))})).catch((()=>{})).finally((()=>{this.queryUserInfo.abortFunc=null}))}),400)}showLoginDialog(){this.ctx.checkAdmin({onSuccess:()=>{}})}}__publicField(nt,"Name","headerInput");class st extends n{constructor(e){super(e),__publicField(this,"$header"),__publicField(this,"$nick"),__publicField(this,"$email"),__publicField(this,"$link"),__publicField(this,"$textareaWrap"),__publicField(this,"$textarea"),__publicField(this,"$bottom"),__publicField(this,"$submitBtn"),__publicField(this,"$notifyWrap"),__publicField(this,"isTraveling",!1),__publicField(this,"replyComment",null),__publicField(this,"$sendReply",null),__publicField(this,"editComment",null),__publicField(this,"$editCancelBtn",null),__publicField(this,"ENABLED_PLUGS",[et,tt,it,nt]),__publicField(this,"plugList",{}),__publicField(this,"openedPlugName",null),__publicField(this,"$plugPanelWrap"),__publicField(this,"$plugBtnWrap"),this.$el=we('
      \n
      \n \n \n \n
      \n
      \n \n
      \n \n
      \n
      \n
      \n \n
      \n
      \n
      \n
      \n'),this.$header=this.$el.querySelector(".atk-header"),this.$nick=this.$header.querySelector('[name="nick"]'),this.$email=this.$header.querySelector('[name="email"]'),this.$link=this.$header.querySelector('[name="link"]'),this.$textareaWrap=this.$el.querySelector(".atk-textarea-wrap"),this.$textarea=this.$el.querySelector(".atk-textarea"),this.$bottom=this.$el.querySelector(".atk-bottom"),this.$submitBtn=this.$el.querySelector(".atk-send-btn"),this.$notifyWrap=this.$el.querySelector(".atk-notify-wrap"),this.$plugBtnWrap=this.$el.querySelector(".atk-plug-btn-wrap"),this.$plugPanelWrap=this.$el.querySelector(".atk-plug-panel-wrap"),this.initLocalStorage(),this.initHeader(),this.initTextarea(),this.initPlugs(),this.initSubmitBtn(),this.ctx.on("conf-updated",(()=>{}))}get user(){return this.ctx.user}get $inputs(){return{nick:this.$nick,email:this.$email,link:this.$link}}get isReplyMode(){return null!==this.replyComment}get isEditMode(){return null!==this.editComment}initLocalStorage(){const e=window.localStorage.getItem("ArtalkContent")||"";""!==e.trim()&&(this.showNotify(this.$t("restoredMsg"),"i"),this.setContent(e)),this.$textarea.addEventListener("input",(()=>this.saveToLocalStorage()))}saveToLocalStorage(){window.localStorage.setItem("ArtalkContent",this.getContentOriginal().trim())}initHeader(){Object.entries(this.$inputs).forEach((([e,t])=>{t.value=this.user.data[e]||"",t.addEventListener("input",(()=>this.onHeaderInput(e,t))),t.placeholder=`${this.$t(e)}`}))}onHeaderInput(e,t){this.isEditMode||(this.user.update({[e]:t.value.trim()}),Object.entries(this.plugList).forEach((([i,n])=>{n.onHeaderInput&&n.onHeaderInput(e,t)})))}initTextarea(){this.$textarea.placeholder=this.ctx.conf.placeholder||this.$t("placeholder"),this.$textarea.addEventListener("keydown",(e=>{9===(e.keyCode||e.which)&&(e.preventDefault(),this.insertContent("\t"))})),this.$textarea.addEventListener("input",(()=>{this.adjustTextareaHeight()}))}refreshSendBtnText(){this.isEditMode?this.$submitBtn.innerText=this.$t("save"):this.$submitBtn.innerText=this.ctx.conf.sendBtn||this.$t("send")}initSubmitBtn(){this.refreshSendBtnText(),this.$submitBtn.addEventListener("click",(()=>this.submit()))}getFinalContent(){let e=this.getContentOriginal();return this.plugList.emoticons&&(e=this.plugList.emoticons.transEmoticonImageText(e)),e}getContentOriginal(){return this.$textarea.value||""}getContentMarked(){return Fe(this.ctx,this.getFinalContent())}setContent(e){this.$textarea.value=e,this.saveToLocalStorage(),this.plugList.preview&&this.plugList.preview.updateContent(),window.setTimeout((()=>{this.adjustTextareaHeight()}),80)}insertContent(e){if(document.selection)this.$textarea.focus(),document.selection.createRange().text=e,this.$textarea.focus();else if(this.$textarea.selectionStart||0===this.$textarea.selectionStart){const t=this.$textarea.selectionStart,i=this.$textarea.selectionEnd,n=this.$textarea.scrollTop;this.setContent(this.$textarea.value.substring(0,t)+e+this.$textarea.value.substring(i,this.$textarea.value.length)),this.$textarea.focus(),this.$textarea.selectionStart=t+e.length,this.$textarea.selectionEnd=t+e.length,this.$textarea.scrollTop=n}else this.$textarea.focus(),this.$textarea.value+=e}adjustTextareaHeight(){const e=this.$textarea.offsetHeight-this.$textarea.clientHeight;this.$textarea.style.height="0px",this.$textarea.style.height=`${this.$textarea.scrollHeight+e}px`}setReply(e,t,i=!0){this.isEditMode&&this.cancelEditComment(),this.isReplyMode&&this.cancelReply(),null===this.$sendReply&&(this.$sendReply=we(`
      ${this.$t("reply")} ×
      `),this.$sendReply.querySelector(".atk-text").innerText=`@${e.nick}`,this.$sendReply.addEventListener("click",(()=>{this.cancelReply()})),this.$textareaWrap.append(this.$sendReply)),this.replyComment=e,!0===this.ctx.conf.editorTravel&&this.travel(t),i&&Ie(this.$el),this.$textarea.focus()}cancelReply(){null!==this.$sendReply&&(this.$sendReply.remove(),this.$sendReply=null),this.replyComment=null,!0===this.ctx.conf.editorTravel&&this.travelBack()}setEditComment(e,t){this.isEditMode&&this.cancelEditComment(),this.isReplyMode&&this.cancelReply(),null===this.$editCancelBtn&&(this.$editCancelBtn=we(`
      ${this.$t("editCancel")}×
      `),this.$editCancelBtn.onclick=()=>{this.cancelEditComment()},this.$textareaWrap.append(this.$editCancelBtn)),this.editComment=e,this.$header.style.display="none",this.travel(t),this.$nick.value=e.nick,this.$email.value=e.email||"",this.$link.value=e.link,this.setContent(e.content),this.$textarea.focus(),this.refreshSendBtnText()}cancelEditComment(){null!==this.$editCancelBtn&&(this.$editCancelBtn.remove(),this.$editCancelBtn=null),this.editComment=null,this.travelBack(),this.$nick.value=this.user.data.nick,this.$email.value=this.user.data.email,this.$link.value=this.user.data.link,this.setContent(""),this.refreshSendBtnText(),this.$header.style.display=""}showNotify(e,t){Ue(this.$notifyWrap,e,t)}showLoading(){Oe(this.$el)}hideLoading(){Pe(this.$el)}submit(){return __async(this,null,(function*(){""!==this.getFinalContent().trim()?(this.ctx.trigger("editor-submit"),this.showLoading(),this.isEditMode?yield this.submitEdit():yield this.submitAdd(),this.hideLoading()):this.$textarea.focus()}))}submitAdd(){return __async(this,null,(function*(){try{const e=yield this.ctx.getApi().add({content:this.getFinalContent(),nick:this.user.data.nick,email:this.user.data.email,link:this.user.data.link,rid:null===this.replyComment?0:this.replyComment.id,page_key:null===this.replyComment?this.ctx.conf.pageKey:this.replyComment.page_key,page_title:null===this.replyComment?this.ctx.conf.pageTitle:void 0,site_name:null===this.replyComment?this.ctx.conf.site:this.replyComment.site_name});null!==this.replyComment&&this.replyComment.page_key!==this.ctx.conf.pageKey&&window.open(`${this.replyComment.page_url}#atk-comment-${e.id}`),this.ctx.insertComment(e),this.setContent(""),this.cancelReply(),this.ctx.trigger("editor-submitted")}catch(e){console.error(e),this.showNotify(`${this.$t("commentFail")},${e.msg||String(e)}`,"e")}}))}submitEdit(){return __async(this,null,(function*(){try{const e={content:this.getFinalContent(),nick:this.$nick.value,email:this.$email.value,link:this.$link.value},t=yield this.ctx.getApi().commentEdit(__spreadValues(__spreadValues({},this.editComment),e));this.ctx.updateComment(t),this.setContent(""),this.cancelEditComment(),this.ctx.trigger("editor-submitted")}catch(e){console.error(e),this.showNotify(`${this.$t("commentFail")},${e.msg||String(e)}`,"e")}}))}close(){this.$textareaWrap.querySelector(".atk-comment-closed")||this.$textareaWrap.prepend(we(`
      ${this.$t("onlyAdminCanReply")}
      `)),this.user.data.isAdmin?(this.$textarea.style.display="",this.$bottom.style.display=""):(this.$textarea.style.display="none",this.closePlugPanel(),this.$bottom.style.display="none")}open(){var e;null==(e=this.$textareaWrap.querySelector(".atk-comment-closed"))||e.remove(),this.$textarea.style.display="",this.$bottom.style.display=""}travel(e){if(this.isTraveling)return;this.isTraveling=!0,this.$el.after(we('
      '));const t=we("
      ");e.after(t),t.replaceWith(this.$el),this.$el.classList.add("atk-fade-in")}travelBack(){var e;this.isTraveling&&(this.isTraveling=!1,null==(e=this.ctx.$root.querySelector(".atk-editor-travel-placeholder"))||e.replaceWith(this.$el),null!==this.replyComment&&this.cancelReply())}initPlugs(){this.plugList={},this.$plugPanelWrap.innerHTML="",this.$plugPanelWrap.style.display="none",this.openedPlugName=null,this.$plugBtnWrap.innerHTML="";const e=[];this.conf.emoticons||e.push("emoticons"),this.conf.preview||e.push("preview"),this.ENABLED_PLUGS.forEach((t=>{const i=t.Name;if(e.includes(i))return;const n=new t(this);this.plugList[i]=n;const s=n.getBtn();if(s){this.$plugBtnWrap.appendChild(s),s.onclick=s.onclick||(()=>{this.$plugBtnWrap.querySelectorAll(".active").forEach((e=>e.classList.remove("active"))),i!==this.openedPlugName?(this.openPlugPanel(i),s.classList.add("active")):this.closePlugPanel()});const e=n.getPanel();e&&(e.setAttribute("data-plug-name",i),e.style.display="none",this.$plugPanelWrap.appendChild(e))}}))}openPlugPanel(e){Object.entries(this.plugList).forEach((([t,i])=>{const n=i.getPanel();n&&(t===e?(n.style.display="",i.onPanelShow&&i.onPanelShow()):(n.style.display="none",i.onPanelHide&&i.onPanelHide()))})),this.$plugPanelWrap.style.display="",this.openedPlugName=e}closePlugPanel(){if(!this.openedPlugName)return;const e=this.plugList[this.openedPlugName];e&&(e.onPanelHide&&e.onPanelHide(),this.$plugPanelWrap.style.display="none",this.openedPlugName=null)}}const rt=window||{},at=navigator||{};function ot(e){const t=String(e||at.userAgent),i={os:"",osVersion:"",engine:"",browser:"",device:"",language:"",version:""},n={Trident:t.includes("Trident")||t.includes("NET CLR"),Presto:t.includes("Presto"),WebKit:t.includes("AppleWebKit"),Gecko:t.includes("Gecko/")},s={Safari:t.includes("Safari"),Chrome:t.includes("Chrome")||t.includes("CriOS"),IE:t.includes("MSIE")||t.includes("Trident"),Edge:t.includes("Edge")||t.includes("Edg"),Firefox:t.includes("Firefox")||t.includes("FxiOS"),"Firefox Focus":t.includes("Focus"),Chromium:t.includes("Chromium"),Opera:t.includes("Opera")||t.includes("OPR"),Vivaldi:t.includes("Vivaldi"),Yandex:t.includes("YaBrowser"),Kindle:t.includes("Kindle")||t.includes("Silk/"),360:t.includes("360EE")||t.includes("360SE"),UC:t.includes("UC")||t.includes(" UBrowser"),QQBrowser:t.includes("QQBrowser"),QQ:t.includes("QQ/"),Baidu:t.includes("Baidu")||t.includes("BIDUBrowser"),Maxthon:t.includes("Maxthon"),Sogou:t.includes("MetaSr")||t.includes("Sogou"),LBBROWSER:t.includes("LBBROWSER"),"2345Explorer":t.includes("2345Explorer"),TheWorld:t.includes("TheWorld"),MIUI:t.includes("MiuiBrowser"),Quark:t.includes("Quark"),Qiyu:t.includes("Qiyu"),Wechat:t.includes("MicroMessenger"),Taobao:t.includes("AliApp(TB"),Alipay:t.includes("AliApp(AP"),Weibo:t.includes("Weibo"),Douban:t.includes("com.douban.frodo"),Suning:t.includes("SNEBUY-APP"),iQiYi:t.includes("IqiyiApp")},r={Windows:t.includes("Windows"),Linux:t.includes("Linux")||t.includes("X11"),macOS:t.includes("Macintosh"),Android:t.includes("Android")||t.includes("Adr"),Ubuntu:t.includes("Ubuntu"),FreeBSD:t.includes("FreeBSD"),Debian:t.includes("Debian"),"Windows Phone":t.includes("IEMobile")||t.includes("Windows Phone"),BlackBerry:t.includes("BlackBerry")||t.includes("RIM"),MeeGo:t.includes("MeeGo"),Symbian:t.includes("Symbian"),iOS:t.includes("like Mac OS X"),"Chrome OS":t.includes("CrOS"),WebOS:t.includes("hpwOS")},a={Mobile:t.includes("Mobi")||t.includes("iPh")||t.includes("480"),Tablet:t.includes("Tablet")||t.includes("Pad")||t.includes("Nexus 7")};a.Mobile?a.Mobile=!t.includes("iPad"):s.Chrome&&t.includes("Edg")?(s.Chrome=!1,s.Edge=!0):rt.showModalDialog&&rt.chrome&&(s.Chrome=!1,s[360]=!0),i.device="PC",i.language=(()=>{const e=(at.browserLanguage||at.language).split("-");return e[1]&&(e[1]=e[1].toUpperCase()),e.join("_")})();const o={engine:n,browser:s,os:r,device:a};Object.entries(o).forEach((([e,t])=>{Object.entries(t).forEach((([t,n])=>{!0===n&&(i[e]=t)}))}));const l={Windows:()=>{const e=t.replace(/^.*Windows NT ([\d.]+);.*$/,"$1");return{6.4:"10",6.3:"8.1",6.2:"8",6.1:"7","6.0":"Vista",5.2:"XP",5.1:"XP","5.0":"2000","10.0":"10","11.0":"11"}[e]||e},Android:()=>t.replace(/^.*Android ([\d.]+);.*$/,"$1"),iOS:()=>t.replace(/^.*OS ([\d_]+) like.*$/,"$1").replace(/_/g,"."),Debian:()=>t.replace(/^.*Debian\/([\d.]+).*$/,"$1"),"Windows Phone":()=>t.replace(/^.*Windows Phone( OS)? ([\d.]+);.*$/,"$2"),macOS:()=>t.replace(/^.*Mac OS X ([\d_]+).*$/,"$1").replace(/_/g,"."),WebOS:()=>t.replace(/^.*hpwOS\/([\d.]+);.*$/,"$1")};i.osVersion="",l[i.os]&&(i.osVersion=l[i.os](),i.osVersion===t&&(i.osVersion=""));const c={Safari:()=>t.replace(/^.*Version\/([\d.]+).*$/,"$1"),Chrome:()=>t.replace(/^.*Chrome\/([\d.]+).*$/,"$1").replace(/^.*CriOS\/([\d.]+).*$/,"$1"),IE:()=>t.replace(/^.*MSIE ([\d.]+).*$/,"$1").replace(/^.*rv:([\d.]+).*$/,"$1"),Edge:()=>t.replace(/^.*(Edge|Edg|Edg[A-Z]{1})\/([\d.]+).*$/,"$2"),Firefox:()=>t.replace(/^.*Firefox\/([\d.]+).*$/,"$1").replace(/^.*FxiOS\/([\d.]+).*$/,"$1"),"Firefox Focus":()=>t.replace(/^.*Focus\/([\d.]+).*$/,"$1"),Chromium:()=>t.replace(/^.*Chromium\/([\d.]+).*$/,"$1"),Opera:()=>t.replace(/^.*Opera\/([\d.]+).*$/,"$1").replace(/^.*OPR\/([\d.]+).*$/,"$1"),Vivaldi:()=>t.replace(/^.*Vivaldi\/([\d.]+).*$/,"$1"),Yandex:()=>t.replace(/^.*YaBrowser\/([\d.]+).*$/,"$1"),Kindle:()=>t.replace(/^.*Version\/([\d.]+).*$/,"$1"),Maxthon:()=>t.replace(/^.*Maxthon\/([\d.]+).*$/,"$1"),QQBrowser:()=>t.replace(/^.*QQBrowser\/([\d.]+).*$/,"$1"),QQ:()=>t.replace(/^.*QQ\/([\d.]+).*$/,"$1"),Baidu:()=>t.replace(/^.*BIDUBrowser[\s/]([\d.]+).*$/,"$1"),UC:()=>t.replace(/^.*UC?Browser\/([\d.]+).*$/,"$1"),Sogou:()=>t.replace(/^.*SE ([\d.X]+).*$/,"$1").replace(/^.*SogouMobileBrowser\/([\d.]+).*$/,"$1"),"2345Explorer":()=>t.replace(/^.*2345Explorer\/([\d.]+).*$/,"$1"),TheWorld:()=>t.replace(/^.*TheWorld ([\d.]+).*$/,"$1"),MIUI:()=>t.replace(/^.*MiuiBrowser\/([\d.]+).*$/,"$1"),Quark:()=>t.replace(/^.*Quark\/([\d.]+).*$/,"$1"),Qiyu:()=>t.replace(/^.*Qiyu\/([\d.]+).*$/,"$1"),Wechat:()=>t.replace(/^.*MicroMessenger\/([\d.]+).*$/,"$1"),Taobao:()=>t.replace(/^.*AliApp\(TB\/([\d.]+).*$/,"$1"),Alipay:()=>t.replace(/^.*AliApp\(AP\/([\d.]+).*$/,"$1"),Weibo:()=>t.replace(/^.*weibo__([\d.]+).*$/,"$1"),Douban:()=>t.replace(/^.*com.douban.frodo\/([\d.]+).*$/,"$1"),Suning:()=>t.replace(/^.*SNEBUY-APP([\d.]+).*$/,"$1"),iQiYi:()=>t.replace(/^.*IqiyiVersion\/([\d.]+).*$/,"$1")};return i.version="",c[i.browser]&&(i.version=c[i.browser](),i.version===t&&(i.version="")),i.version.indexOf(".")&&(i.version=i.version.substring(0,i.version.indexOf("."))),"iOS"===i.os&&t.includes("iPad")?i.os="iPadOS":"Edge"!==i.browser||t.includes("Edg")?"MIUI"===i.browser?i.os="Android":"Chrome"===i.browser&&Number(i.version)>27||"Opera"===i.browser&&Number(i.version)>12||"Yandex"===i.browser?i.engine="Blink":void 0===i.browser&&(i.browser="Unknow App"):i.engine="EdgeHTML",i}class lt{constructor(e,t){__publicField(this,"ctx"),__publicField(this,"conf"),__publicField(this,"$el"),__publicField(this,"isLoading",!1),__publicField(this,"msgRecTimer"),__publicField(this,"msgRecTimerFunc"),__publicField(this,"isConfirming",!1),__publicField(this,"confirmRecTimer"),this.ctx=e,this.$el=we(''),this.conf="object"!=typeof t?{text:t}:t,this.$el.innerText=this.getText(),this.conf.adminOnly&&this.$el.setAttribute("atk-only-admin-show","")}get isMessaging(){return!!this.msgRecTimer}appendTo(e){return e.append(this.$el),this}getText(){return"string"==typeof this.conf.text?this.conf.text:this.conf.text()}setClick(e){this.$el.onclick=t=>{if(t.stopPropagation(),!this.isLoading){if(this.conf.confirm&&!this.isMessaging){const e=()=>{this.isConfirming=!1,this.$el.classList.remove("atk-btn-confirm"),this.$el.innerText=this.getText()};if(!this.isConfirming)return this.isConfirming=!0,this.$el.classList.add("atk-btn-confirm"),this.$el.innerText=this.conf.confirmText||this.ctx.$t("actionConfirm"),void(this.confirmRecTimer=window.setTimeout((()=>e()),5e3));this.confirmRecTimer&&window.clearTimeout(this.confirmRecTimer),e()}if(this.msgRecTimer)return this.fireMsgRecTimer(),void this.clearMsgRecTimer();e()}}}updateText(e){e&&(this.conf.text=e),this.setLoading(!1),this.$el.innerText=this.getText()}setLoading(e,t){this.isLoading!==e&&(this.isLoading=e,e?(this.$el.classList.add("atk-btn-loading"),this.$el.innerText=t||`${this.ctx.$t("loading")}...`):(this.$el.classList.remove("atk-btn-loading"),this.$el.innerText=this.getText()))}setError(e){this.setMsg(e,"atk-btn-error")}setWarn(e){this.setMsg(e,"atk-btn-warn")}setSuccess(e){this.setMsg(e,"atk-btn-success")}setMsg(e,t,i,n){this.setLoading(!1),t&&this.$el.classList.add(t),this.$el.innerText=e,this.setMsgRecTimer((()=>{this.$el.innerText=this.getText(),t&&this.$el.classList.remove(t),n&&n()}),i||2500)}setMsgRecTimer(e,t){this.fireMsgRecTimer(),this.clearMsgRecTimer(),this.msgRecTimerFunc=e,this.msgRecTimer=window.setTimeout((()=>{e(),this.clearMsgRecTimer()}),t)}fireMsgRecTimer(){this.msgRecTimerFunc&&this.msgRecTimerFunc()}clearMsgRecTimer(){this.msgRecTimer&&window.clearTimeout(this.msgRecTimer),this.msgRecTimer=void 0,this.msgRecTimerFunc=void 0}}class ct{constructor(e){__publicField(this,"comment"),__publicField(this,"$el"),__publicField(this,"$main"),__publicField(this,"$header"),__publicField(this,"$headerNick"),__publicField(this,"$headerBadgeWrap"),__publicField(this,"$body"),__publicField(this,"$content"),__publicField(this,"$childrenWrap"),__publicField(this,"$actions"),__publicField(this,"voteBtnUp"),__publicField(this,"voteBtnDown"),__publicField(this,"$replyTo"),__publicField(this,"$replyAt"),this.comment=e}get ctx(){return this.comment.ctx}get data(){return this.comment.getData()}get cConf(){return this.comment.getConf()}render(){return this.$el=we('
      \n
      \n
      \n
      \n
      \n \n \n \n
      \n
      \n
      \n
      \n \n
      \n
      \n
      \n'),this.$main=this.$el.querySelector(".atk-main"),this.$header=this.$el.querySelector(".atk-header"),this.$body=this.$el.querySelector(".atk-body"),this.$content=this.$body.querySelector(".atk-content"),this.$actions=this.$el.querySelector(".atk-actions"),this.$el.setAttribute("data-comment-id",`${this.data.id}`),this.renderAvatar(),this.renderHeader(),this.renderContent(),this.renderReplyAt(),this.renderReplyTo(),this.renderPending(),this.renderActionBtn(),this.recoveryChildrenWrap(),this.$el}renderAvatar(){const e=this.$el.querySelector(".atk-avatar"),t=we("");if(t.src=this.comment.getGravatarURL(),this.data.link){const i=we('');i.href=this.data.link,i.append(t),e.append(i)}else e.append(t)}renderHeader(){if(this.$headerNick=this.$el.querySelector(".atk-nick"),this.data.link){const e=we('');e.innerText=this.data.nick,e.href=this.data.link,this.$headerNick.append(e)}else this.$headerNick.innerText=this.data.nick;this.$headerBadgeWrap=this.$el.querySelector(".atk-badge-wrap"),this.$headerBadgeWrap.innerHTML="";const e=this.data.badge_name,t=this.data.badge_color;if(e){const i=we('');i.innerText=e.replace("管理员",this.ctx.$t("admin")),i.style.backgroundColor=t||"",this.$headerBadgeWrap.append(i)}if(this.data.is_pinned){const e=we(`${this.ctx.$t("pin")}`);this.$headerBadgeWrap.append(e)}const i=this.$el.querySelector(".atk-date");if(i.innerText=this.comment.getDateFormatted(),i.setAttribute("data-atk-comment-date",String(+new Date(this.data.date))),this.ctx.conf.uaBadge){let e=this.$header.querySelector("atk-ua-wrap");e||(e=we(''),this.$header.append(e)),e.innerHTML="";const t=we(''),i=we('');t.innerText=this.comment.getUserUaBrowser(),i.innerText=this.comment.getUserUaOS(),e.append(t),e.append(i)}}renderContent(){if(!this.data.is_collapsed)return this.$content.innerHTML=this.comment.getContentMarked(),void this.$content.classList.remove("atk-hide","atk-collapsed");this.$content.classList.add("atk-hide","atk-type-collapsed");const e=we(`\n
      \n ${this.ctx.$t("collapsedMsg")}\n ${this.ctx.$t("expand")}\n
      `);this.$body.insertAdjacentElement("beforeend",e);const t=e.querySelector(".atk-show-btn");t.addEventListener("click",(e=>{e.stopPropagation(),this.$content.classList.contains("atk-hide")?(this.$content.innerHTML=this.comment.getContentMarked(),this.$content.classList.remove("atk-hide"),qe(this.$content),t.innerHTML=this.ctx.$t("collapse")):(this.$content.innerHTML="",this.$content.classList.add("atk-hide"),t.innerHTML=this.ctx.$t("expand"))}))}renderReplyAt(){this.cConf.isFlatMode||0===this.data.rid||this.cConf.replyTo&&(this.$replyAt=we(''),this.$replyAt.querySelector(".atk-nick").innerText=`${this.cConf.replyTo.nick}`,this.$replyAt.onclick=()=>{this.comment.getActions().goToReplyComment()},this.$headerBadgeWrap.insertAdjacentElement("afterend",this.$replyAt))}renderReplyTo(){if(!this.cConf.isFlatMode)return;if(!this.cConf.replyTo)return;this.$replyTo=we(`\n
      \n
      ${this.ctx.$t("reply")} :
      \n
      \n
      `);const e=this.$replyTo.querySelector(".atk-nick");e.innerText=`@${this.cConf.replyTo.nick}`,e.onclick=()=>{this.comment.getActions().goToReplyComment()};let t=Fe(this.ctx,this.cConf.replyTo.content);this.cConf.replyTo.is_collapsed&&(t=`[${this.ctx.$t("collapsed")}]`),this.$replyTo.querySelector(".atk-content").innerHTML=t,this.$body.prepend(this.$replyTo)}renderPending(){if(!this.data.is_pending)return;const e=we(`
      ${this.ctx.$t("pendingMsg")}
      `);this.$body.prepend(e)}renderActionBtn(){if(this.ctx.conf.vote&&(this.voteBtnUp=new lt(this.ctx,(()=>`${this.ctx.$t("voteUp")} (${this.data.vote_up||0})`)).appendTo(this.$actions),this.voteBtnUp.setClick((()=>{this.comment.getActions().vote("up")})),this.ctx.conf.voteDown&&(this.voteBtnDown=new lt(this.ctx,(()=>`${this.ctx.$t("voteDown")} (${this.data.vote_down||0})`)).appendTo(this.$actions),this.voteBtnDown.setClick((()=>{this.comment.getActions().vote("down")})))),this.data.is_allow_reply){const e=we(`${this.ctx.$t("reply")}`);this.$actions.append(e),e.addEventListener("click",(e=>{e.stopPropagation(),this.cConf.onReplyBtnClick?this.cConf.onReplyBtnClick():this.ctx.replyComment(this.data,this.$el)}))}const e=new lt(this.ctx,{text:()=>this.data.is_collapsed?this.ctx.$t("expand"):this.ctx.$t("collapse"),adminOnly:!0});e.appendTo(this.$actions),e.setClick((()=>{this.comment.getActions().adminEdit("collapsed",e)}));const t=new lt(this.ctx,{text:()=>this.data.is_pending?this.ctx.$t("pending"):this.ctx.$t("approved"),adminOnly:!0});t.appendTo(this.$actions),t.setClick((()=>{this.comment.getActions().adminEdit("pending",t)}));const i=new lt(this.ctx,{text:()=>this.data.is_pinned?this.ctx.$t("unpin"):this.ctx.$t("pin"),adminOnly:!0});i.appendTo(this.$actions),i.setClick((()=>{this.comment.getActions().adminEdit("pinned",t)}));const n=new lt(this.ctx,{text:this.ctx.$t("edit"),adminOnly:!0});n.appendTo(this.$actions),n.setClick((()=>{this.ctx.editComment(this.data,this.$el)}));const s=new lt(this.ctx,{text:this.ctx.$t("delete"),confirm:!0,confirmText:this.ctx.$t("deleteConfirm"),adminOnly:!0});s.appendTo(this.$actions),s.setClick((()=>{this.comment.getActions().adminDelete(s)}))}checkHeightLimit(){this.checkHeightLimitArea("content"),this.checkHeightLimitArea("children")}checkHeightLimitArea(e){const t=this.ctx.conf.heightLimit.children,i=this.ctx.conf.heightLimit.content;if("children"===e&&!t)return;if("content"===e&&!i)return;let n;"children"===e&&(n=t),"content"===e&&(n=i);const s=e=>{e&&Ce(e)>n&&this.heightLimitAdd(e,n)};"children"===e?s(this.$childrenWrap):"content"===e&&(s(this.$content),s(this.$replyTo),Ae(this.$content,(()=>{s(this.$content)})),this.$replyTo&&Ae(this.$replyTo,(()=>{s(this.$replyTo)})))}heightLimitRemove(e){e&&e.classList.contains("atk-height-limit")&&(e.classList.remove("atk-height-limit"),Array.from(e.children).forEach((e=>{e.classList.contains("atk-height-limit-btn")&&e.remove()})),e.style.height="",e.style.overflow="")}heightLimitRemoveForChildren(){this.$childrenWrap&&this.heightLimitRemove(this.$childrenWrap)}heightLimitAdd(e,t){if(!e)return;if(e.classList.contains("atk-height-limit"))return;e.classList.add("atk-height-limit"),e.style.height=`${t}px`,e.style.overflow="hidden";const i=we(`
      ${this.ctx.$t("readMore")}`);i.onclick=t=>{t.stopPropagation(),this.heightLimitRemove(e);const i=this.comment.getChildren();1===i.length&&i[0].getRender().heightLimitRemove(i[0].getRender().$content)},e.append(i)}playFadeAnim(){qe(this.comment.getRender().$el)}playFadeAnimForBody(){qe(this.comment.getRender().$body)}getChildrenWrap(){return this.$childrenWrap}renderChildrenWrap(){return this.$childrenWrap||(this.$childrenWrap=we('
      '),this.$main.append(this.$childrenWrap)),this.$childrenWrap}recoveryChildrenWrap(){this.$childrenWrap&&this.$main.append(this.$childrenWrap)}setUnread(e){e?this.$el.classList.add("atk-unread"):this.$el.classList.remove("atk-unread")}setOpenable(e){e?this.$el.classList.add("atk-openable"):this.$el.classList.remove("atk-openable")}setOpenURL(e){this.setOpenable(!0),this.$el.onclick=t=>{t.preventDefault(),window.open(e),this.cConf.openEvt&&this.cConf.openEvt()}}setOpenAction(e){this.setOpenable(!0),this.$el.onclick=t=>{t.preventDefault(),e()}}}class ht{constructor(e){__publicField(this,"comment"),this.comment=e}get ctx(){return this.comment.ctx}get data(){return this.comment.getData()}get cConf(){return this.comment.getConf()}vote(e){const t="up"===e?this.comment.getRender().voteBtnUp:this.comment.getRender().voteBtnDown;this.ctx.getApi().vote(this.data.id,`comment_${e}`).then((e=>{var t,i;this.data.vote_up=e.up,this.data.vote_down=e.down,null==(t=this.comment.getRender().voteBtnUp)||t.updateText(),null==(i=this.comment.getRender().voteBtnDown)||i.updateText()})).catch((e=>{null==t||t.setError(this.ctx.$t("voteFail")),console.log(e)}))}adminEdit(e,t){if(t.isLoading)return;t.setLoading(!0,`${this.ctx.$t("editing")}...`);const i=__spreadValues({},this.data);"collapsed"===e?i.is_collapsed=!i.is_collapsed:"pending"===e?i.is_pending=!i.is_pending:"pinned"===e&&(i.is_pinned=!i.is_pinned),this.ctx.getApi().commentEdit(i).then((e=>{t.setLoading(!1),this.comment.setData(e),this.ctx.listRefreshUI()})).catch((e=>{console.error(e),t.setError(this.ctx.$t("editFail"))}))}adminDelete(e){e.isLoading||(e.setLoading(!0,`${this.ctx.$t("deleting")}...`),this.ctx.getApi().commentDel(this.data.id,this.data.site_name).then((()=>{e.setLoading(!1),this.cConf.onDelete&&this.cConf.onDelete(this.comment)})).catch((t=>{console.error(t),e.setError(this.ctx.$t("deleteFail"))})))}goToReplyComment(){const e=window.location.hash,t=`#atk-comment-${this.data.rid}`;window.location.hash=t,t===e&&window.dispatchEvent(new Event("hashchange"))}}class dt extends n{constructor(e,t,i){super(e),__publicField(this,"renderInstance"),__publicField(this,"actionInstance"),__publicField(this,"data"),__publicField(this,"cConf"),__publicField(this,"parent"),__publicField(this,"children",[]),__publicField(this,"nestCurt"),__publicField(this,"nestMax"),this.nestMax=e.conf.nestMax||3,this.cConf=i,this.data=__spreadValues({},t),this.data.date=this.data.date.replace(/-/g,"/"),this.parent=null,this.nestCurt=1,this.actionInstance=new ht(this),this.renderInstance=new ct(this)}render(){const e=this.renderInstance.render();this.$el&&this.$el.replaceWith(e),this.$el=e,this.cConf.afterRender&&this.cConf.afterRender()}getActions(){return this.actionInstance}getRender(){return this.renderInstance}getData(){return this.data}setData(e){this.data=e,this.render(),this.getRender().playFadeAnimForBody()}getParent(){return this.parent}getChildren(){return this.children}getNestCurt(){return this.nestCurt}getIsRoot(){return 0===this.data.rid}getID(){return this.data.id}putChild(e,t="append"){e.parent=this,e.nestCurt=this.nestCurt+1,this.children.push(e);const i=this.getChildrenEl();"append"===t?i.append(e.getEl()):"prepend"===t&&i.prepend(e.getEl()),e.getRender().playFadeAnim(),e.getRender().checkHeightLimitArea("content")}getChildrenEl(){let e=this.getRender().getChildrenWrap();return e||(e=this.nestCurt{i.parent&&(e.push(i.parent),t(i.parent))};return t(this),e}getEl(){return this.$el}getGravatarURL(){return e=this.ctx,t=this.data.email_encrypted,`${e.conf.gravatar.mirror.replace(/\/$/,"")}/${t}?d=${encodeURIComponent(e.conf.gravatar.default)}&s=80`;var e,t}getContentMarked(){return Fe(this.ctx,this.data.content)}getDateFormatted(){return Ee(new Date(this.data.date),this.ctx)}getUserUaBrowser(){const e=ot(this.data.ua);return`${e.browser} ${e.version}`}getUserUaOS(){const e=ot(this.data.ua);return`${e.os} ${e.osVersion}`}getConf(){return this.cConf}}class pt{constructor(e,t){__publicField(this,"conf"),__publicField(this,"total"),__publicField(this,"$el"),__publicField(this,"$input"),__publicField(this,"inputTimer"),__publicField(this,"$prevBtn"),__publicField(this,"$nextBtn"),__publicField(this,"page",1),this.total=e,this.conf=t,this.$el=we('
      \n
      \n
      Prev
      \n \n
      Next
      \n
      \n
      '),this.$input=this.$el.querySelector(".atk-input"),this.$input.value=`${this.page}`,this.$input.oninput=()=>this.input(),this.$input.onkeydown=e=>this.keydown(e),this.$prevBtn=this.$el.querySelector(".atk-btn-prev"),this.$nextBtn=this.$el.querySelector(".atk-btn-next"),this.$prevBtn.onclick=()=>this.prev(),this.$nextBtn.onclick=()=>this.next(),this.checkDisabled()}get pageSize(){return this.conf.pageSize}get offset(){return this.pageSize*(this.page-1)}get maxPage(){return Math.ceil(this.total/this.pageSize)}update(e,t){this.page=Math.ceil(e/this.pageSize)+1,this.total=t,this.setInput(this.page),this.checkDisabled()}setInput(e){this.$input.value=`${e}`}input(e=!1){window.clearTimeout(this.inputTimer);const t=this.$input.value.trim(),i=()=>{if(""===t)return void this.setInput(this.page);let e=Number(t);Number.isNaN(e)||e<1?this.setInput(this.page):(e>this.maxPage&&(this.setInput(this.maxPage),e=this.maxPage),this.change(e))};e?i():this.inputTimer=window.setTimeout((()=>i()),800)}prev(){const e=this.page-1;e<1||this.change(e)}next(){const e=this.page+1;e>this.maxPage||this.change(e)}change(e){this.page=e,this.conf.onChange(this.offset),this.setInput(e),this.checkDisabled()}checkDisabled(){this.page+1>this.maxPage?this.$nextBtn.classList.add("atk-disabled"):this.$nextBtn.classList.remove("atk-disabled"),this.page-1<1?this.$prevBtn.classList.add("atk-disabled"):this.$prevBtn.classList.remove("atk-disabled")}keydown(e){const t=e.keyCode||e.which;if(38===t){const e=Number(this.$input.value)+1;if(e>this.maxPage)return;this.setInput(e),this.input()}else if(40===t){const e=Number(this.$input.value)-1;if(e<1)return;this.setInput(e),this.input()}else 13===t&&this.input(!0)}setLoading(e){e?Oe(this.$el):Pe(this.$el)}}class ut{constructor(e){__publicField(this,"conf"),__publicField(this,"$el"),__publicField(this,"$loading"),__publicField(this,"$text"),__publicField(this,"offset",0),__publicField(this,"total",0),__publicField(this,"origText","Load More"),this.conf=e,this.origText=this.conf.text||this.origText,this.$el=we(``),this.$loading=this.$el.querySelector(".atk-loading-icon"),this.$text=this.$el.querySelector(".atk-text"),this.$el.onclick=()=>{this.click()}}get hasMore(){return this.total>this.offset+this.conf.pageSize}click(){this.hasMore&&this.conf.onClick(this.offset+this.conf.pageSize),this.checkDisabled()}show(){this.$el.style.display=""}hide(){this.$el.style.display="none"}setLoading(e){this.$loading.style.display=e?"":"none",this.$text.style.display=e?"none":""}showErr(e){this.setLoading(!1),this.$text.innerText=e,this.$el.classList.add("atk-err"),window.setTimeout((()=>{this.$text.innerText=this.origText,this.$el.classList.remove("atk-err")}),2e3)}update(e,t){this.offset=e,this.total=t,this.checkDisabled()}checkDisabled(){this.hasMore?this.show():this.hide()}}class mt extends n{constructor(e){super(e),__publicField(this,"$commentsWrap"),__publicField(this,"data"),__publicField(this,"isLoading",!1),__publicField(this,"noCommentText"),__publicField(this,"flatMode",!1),__publicField(this,"nestSortBy"),__publicField(this,"pageMode","pagination"),__publicField(this,"pageSize",20),__publicField(this,"scrollListenerAt"),__publicField(this,"repositionAt"),__publicField(this,"pagination"),__publicField(this,"readMoreBtn"),__publicField(this,"autoLoadScrollEvent"),__publicField(this,"renderComment"),__publicField(this,"paramsEditor"),__publicField(this,"onAfterLoad"),__publicField(this,"unread",[]),__publicField(this,"unreadHighlight"),this.$el=we('
      \n
      \n
      '),this.$commentsWrap=this.$el.querySelector(".atk-list-comments-wrap"),this.noCommentText=e.conf.noComment||e.$t("noComment"),this.nestSortBy=this.ctx.conf.nestSort||"DATE_ASC",window.setInterval((()=>{this.$el.querySelectorAll("[data-atk-comment-date]").forEach((e=>{const t=e.getAttribute("data-atk-comment-date");e.innerText=Ee(new Date(Number(t)),this.ctx)}))}),3e4)}getData(){return this.data}clearData(){this.data=void 0}getCommentsWrapEl(){return this.$commentsWrap}fetchComments(e){return __async(this,null,(function*(){if(this.isLoading)return;const t=()=>{this.isLoading=!1,0===e?Pe(this.$el):"read-more"===this.pageMode?this.readMoreBtn.setLoading(!1):"pagination"===this.pageMode&&this.pagination.setLoading(!1)};let i;(()=>{this.isLoading=!0,0===e?Oe(this.$el):"read-more"===this.pageMode?this.readMoreBtn.setLoading(!0):"pagination"===this.pageMode&&this.pagination.setLoading(!0)})(),this.ctx.trigger("list-load"),"read-more"===this.pageMode&&0===e&&this.ctx.clearAllComments();try{i=yield this.ctx.getApi().get(e,this.pageSize,this.flatMode,this.paramsEditor)}catch(n){throw this.onError(n.msg||String(n),e,n.data),n}finally{t()}De(this.$el,null);try{this.onLoad(i,e)}catch(n){throw this.onError(String(n),e),n}finally{t()}}))}onLoad(e,t){var i,n;"pagination"===this.pageMode&&this.ctx.clearAllComments(),this.data=e;const s=(null==(i=e.api_version)?void 0:i.fe_min_version)||"0.0.0";this.ctx.conf.versionCheck&&this.versionCheck("frontend",s,"2.3.4")||this.ctx.conf.versionCheck&&this.versionCheck("backend","2.1.10",null==(n=e.api_version)?void 0:n.version)||(e.conf&&"boolean"==typeof e.conf.img_upload&&(this.ctx.conf.imgUpload=e.conf.img_upload),this.importComments(e.comments),this.refreshPagination(t,this.flatMode?e.total:e.total_roots),this.refreshUI(),this.ctx.updateNotifies(e.unread||[]),this.ctx.trigger("list-loaded"),this.ctx.trigger("conf-updated"),this.onAfterLoad&&this.onAfterLoad(e))}refreshPagination(e,t){const i="pagination"===this.pageMode,n="read-more"===this.pageMode;(i?!!this.pagination:!!this.readMoreBtn)||this.initPagination(),i&&this.pagination.update(e,t),n&&this.readMoreBtn.update(e,t)}initPagination(){if("read-more"===this.pageMode&&(this.readMoreBtn=new ut({pageSize:this.pageSize,onClick:e=>__async(this,null,(function*(){yield this.fetchComments(e)})),text:this.ctx.$t("loadMore")}),this.$el.append(this.readMoreBtn.$el),this.conf.pagination.autoLoad)){const e=this.scrollListenerAt||document;this.autoLoadScrollEvent&&e.removeEventListener("scroll",this.autoLoadScrollEvent),this.autoLoadScrollEvent=()=>{if("read-more"!==this.pageMode)return;if(!this.readMoreBtn)return;if(!this.readMoreBtn.hasMore)return;if(this.isLoading)return;const e=this.$el.querySelector(".atk-list-comments-wrap > .atk-comment-wrap:nth-last-child(3)");e&&function(e,t=document.documentElement){const i=t.clientHeight,n=t.scrollTop,s=n+i,r=e.getBoundingClientRect();return r.top+n+r.height<=s}(e,this.scrollListenerAt)&&this.readMoreBtn.click()},e.addEventListener("scroll",this.autoLoadScrollEvent)}"pagination"===this.pageMode&&(this.pagination=new pt(this.flatMode?this.data.total:this.data.total_roots,{pageSize:this.pageSize,onChange:e=>__async(this,null,(function*(){if(!0===this.ctx.conf.editorTravel&&this.ctx.editorTravelBack(),yield this.fetchComments(e),this.repositionAt){(this.scrollListenerAt||window).scroll({top:this.repositionAt?Le(this.repositionAt).top:0,left:0})}}))}),this.$el.append(this.pagination.$el))}onError(e,t,i){var n;if(e=String(e),console.error(e),0!==t&&"read-more"===this.pageMode)return void(null==(n=this.readMoreBtn)||n.showErr(this.$t("loadFail")));const s=we(`${e},${this.$t("listLoadFailMsg")}
      `),r=we(`${this.$t("listRetry")}`);r.onclick=()=>this.fetchComments(0),s.appendChild(r);const a=we(' | 打开控制台');s.appendChild(a),this.ctx.user.data.isAdmin||a.classList.add("atk-hide");let o="";if(null==i?void 0:i.err_no_site){const e={create_name:this.ctx.conf.site,create_urls:`${window.location.protocol}//${window.location.host}`};o=`sites|${JSON.stringify(e)}`}a.onclick=()=>this.ctx.showSidebar({view:o}),De(this.$el,s)}refreshUI(){const e=this.ctx.getCommentList().length<=0;let t=this.$commentsWrap.querySelector(".atk-list-no-comment");e?t||(t=we('
      '),t.innerHTML=this.noCommentText,this.$commentsWrap.appendChild(t)):null==t||t.remove(),this.ctx.checkAdminShowEl()}reload(){this.fetchComments(0)}createComment(e,t){t||(t=this.ctx.getCommentDataList());const i=new dt(this.ctx,e,{isFlatMode:this.flatMode,afterRender:()=>{this.renderComment&&this.renderComment(i)},onDelete:e=>{this.ctx.deleteComment(e),this.refreshUI()},replyTo:e.rid?t.find((t=>t.id===e.rid)):void 0});return i.render(),this.ctx.getCommentList().push(i),i}importComments(e){this.flatMode?e.forEach((t=>{this.putCommentFlatMode(t,e,"append")})):this.importCommentsNest(e)}importCommentsNest(e){const t=function(e,t="DATE_DESC",i=2){const n=[];e.filter((e=>0===e.rid)).forEach((t=>{const s={id:t.id,comment:t,children:[],level:1};s.parent=s,n.push(s),function t(n){const s=e.filter((e=>e.rid===n.id));0!==s.length&&(n.level>=i&&(n=n.parent),s.forEach((e=>{const i={id:e.id,comment:e,children:[],parent:n,level:n.level+1};n.children.push(i),t(i)})))}(s)}));const s=(i,n)=>{let s=i.id-n.id;return"DATE_ASC"===t?s=+new Date(i.comment.date)-+new Date(n.comment.date):"DATE_DESC"===t?s=+new Date(n.comment.date)-+new Date(i.comment.date):"SRC_INDEX"===t?s=e.indexOf(i.comment)-e.indexOf(n.comment):"VOTE_UP_DESC"===t&&(s=n.comment.vote_up-i.comment.vote_up),s};return function e(t){t.forEach((t=>{t.children=t.children.sort(s),e(t.children)}))}(n),n}(e,this.nestSortBy,this.conf.nestMax);t.forEach((t=>{const i=this.createComment(t.comment,e);this.$commentsWrap.appendChild(i.getEl()),i.getRender().playFadeAnim();const n=this;!function t(i,s){s.children.forEach((s=>{const r=s.comment,a=n.createComment(r,e);i.putChild(a),t(a,s)}))}(i,t),i.getRender().checkHeightLimit()}))}putCommentFlatMode(e,t,i){e.is_collapsed&&(e.is_allow_reply=!1);const n=this.createComment(e,t);return e.visible&&("append"===i&&this.$commentsWrap.append(n.getEl()),"prepend"===i&&this.$commentsWrap.prepend(n.getEl()),n.getRender().playFadeAnim()),n.getRender().checkHeightLimit(),n}insertComment(e){if(this.flatMode){Ie(this.putCommentFlatMode(e,this.ctx.getCommentDataList(),"prepend").getEl())}else{const t=this.createComment(e);if(0===e.rid)this.$commentsWrap.prepend(t.getEl());else{const i=this.ctx.findComment(e.rid);i&&(i.putChild(t,"DATE_ASC"===this.nestSortBy?"append":"prepend"),t.getParents().forEach((e=>{e.getRender().heightLimitRemoveForChildren()})))}t.getRender().checkHeightLimit(),Ie(t.getEl()),t.getRender().playFadeAnim()}this.data&&(this.data.total+=1),this.refreshUI(),this.ctx.trigger("list-loaded"),this.ctx.trigger("list-inserted",e)}updateComment(e){const t=this.ctx.findComment(e.id);t&&t.setData(e)}updateUnread(e){this.unread=e,!0===this.unreadHighlight&&this.ctx.getCommentList().forEach((e=>{const t=this.unread.find((t=>t.comment_id===e.getID()));t?(e.getRender().setUnread(!0),e.getRender().setOpenAction((()=>{window.open(t.read_link),this.unread=this.unread.filter((t=>t.comment_id!==e.getID())),this.ctx.updateNotifies(this.unread)}))):e.getRender().setUnread(!1)}))}versionCheck(e,t,i){const n=1===function(e,t){const i=e.split("."),n=t.split(".");for(let s=0;s<3;s++){const e=Number(i[s]),t=Number(n[s]);if(e>t)return 1;if(t>e)return-1;if(!Number.isNaN(e)&&Number.isNaN(t))return 1;if(Number.isNaN(e)&&!Number.isNaN(t))return-1}return 0}(t,i);if(n){const n=we(`
      Artalk ${this.$t(e)}版本已过时,请更新以获得完整体验
      如果你是管理员,请前往 “官方文档” 获得帮助

      当前${this.$t(e)}版本 ${i},需求版本 >= ${t}

      `),s=we('忽略');s.onclick=()=>{De(this.$el.parentElement,null),this.ctx.conf.versionCheck=!1,this.ctx.trigger("conf-updated"),this.fetchComments(0)},n.append(s),De(this.$el.parentElement,n,'Artalk Warn')}return n}}class gt extends mt{constructor(e){const t=we('
      \n
      \n
      \n
      \n
      \n
      \n \n \n \n
      \n
      \n
      \n
      \n
      \n \n
      \n');super(e),__publicField(this,"$closeCommentBtn"),__publicField(this,"$openSidebarBtn"),__publicField(this,"$unreadBadge"),__publicField(this,"$commentCount"),__publicField(this,"$commentCountNum"),__publicField(this,"$dropdownWrap"),__publicField(this,"goToCommentFounded",!1),__publicField(this,"goToCommentDelay",!0),t.querySelector(".atk-list-body").append(this.$el),this.$el=t,(!0===this.ctx.conf.flatMode||this.conf.nestMax&&this.conf.nestMax<=1||"auto"===this.ctx.conf.flatMode&&window.matchMedia("(max-width: 768px)").matches)&&(this.flatMode=!0),this.pageMode=this.conf.pagination.readMore?"read-more":"pagination",this.pageSize=this.conf.pagination.pageSize||20,this.repositionAt=this.$el,this.initListActionBtn(),this.$commentCount=this.$el.querySelector(".atk-comment-count"),this.$commentCount.innerHTML=this.$t("counter",{count:'0'}),this.$commentCountNum=this.$commentCount.querySelector(".atk-comment-count-num"),this.ctx.conf.listSort&&this.initDropdown(),this.$el.querySelector(".atk-copyright").innerHTML='Powered By Artalk'}initListActionBtn(){this.$openSidebarBtn=this.$el.querySelector('[data-action="open-sidebar"]'),this.$closeCommentBtn=this.$el.querySelector('[data-action="admin-close-comment"]'),this.$unreadBadge=this.$el.querySelector(".atk-unread-badge"),this.$openSidebarBtn.addEventListener("click",(()=>{this.ctx.showSidebar()})),this.$closeCommentBtn.addEventListener("click",(()=>{this.data&&(this.data.page.admin_only=!this.data.page.admin_only,this.adminPageEditSave())}))}refreshUI(){var e;super.refreshUI(),this.$commentCountNum.innerText=String(Number(null==(e=this.data)?void 0:e.total)||0),this.ctx.user.data.nick&&this.ctx.user.data.email?this.$openSidebarBtn.classList.remove("atk-hide"):this.$openSidebarBtn.classList.add("atk-hide"),this.ctx.checkAdminShowEl(),this.$openSidebarBtn.querySelector(".atk-text").innerText=this.ctx.user.data.isAdmin?this.$t("ctrlCenter"):this.$t("msgCenter"),this.data&&this.data.page&&!0===this.data.page.admin_only?(this.ctx.editorClose(),this.$closeCommentBtn.innerHTML=this.$t("openComment")):(this.ctx.editorOpen(),this.$closeCommentBtn.innerHTML=this.$t("closeComment"))}onLoad(e,t){super.onLoad(e,t),this.goToCommentFounded||this.checkGoToCommentByUrlHash(),!0===this.ctx.conf.editorTravel&&this.ctx.editorTravelBack()}checkGoToCommentByUrlHash(){let e=Number(Se("atk_comment"));if(!e){const t=window.location.hash.match(/#atk-comment-([0-9]+)/);if(!t||!t[1]||Number.isNaN(Number(t[1])))return;e=Number(t[1])}if(!e)return;const t=this.ctx.findComment(e);if(!t)return void(this.readMoreBtn?this.readMoreBtn.click():this.pagination&&this.pagination.next());const i=Se("atk_notify_key");i&&this.ctx.getApi().markRead(i).then((()=>{this.unread=this.unread.filter((t=>t.comment_id!==e)),this.updateUnread(this.unread)})),t.getParents().forEach((e=>{e.getRender().heightLimitRemoveForChildren()}));const n=()=>{Ie(t.getEl(),!1),t.getEl().classList.remove("atk-flash-once"),window.setTimeout((()=>{t.getEl().classList.add("atk-flash-once")}),150)};this.goToCommentDelay?window.setTimeout((()=>n()),350):n(),this.goToCommentFounded=!0}adminPageEditSave(){this.data&&this.data.page&&(this.ctx.editorShowLoading(),this.ctx.getApi().pageEdit(this.data.page).then((e=>{this.data&&(this.data.page=__spreadValues({},e)),this.refreshUI()})).catch((e=>{this.ctx.editorShowNotify(`${this.$t("editFail")}: ${e.msg||String(e)}`,"e")})).finally((()=>{this.ctx.editorHideLoading()})))}showUnreadBadge(e){e>0?(this.$unreadBadge.innerText=`${Number(e||0)}`,this.$unreadBadge.style.display="block"):this.$unreadBadge.style.display="none"}initDropdown(){this.$dropdownWrap=this.$commentCount,this.$commentCount.classList.add("atk-dropdown-wrap"),this.$dropdownWrap.append(we(''));const e=e=>{this.paramsEditor=t=>{e(t)},this.fetchComments(0)},t=[[this.$t("sortLatest"),()=>{e((e=>{e.sort_by="date_desc"}))}],[this.$t("sortBest"),()=>{e((e=>{e.sort_by="vote"}))}],[this.$t("sortOldest"),()=>{e((e=>{e.sort_by="date_asc"}))}],[this.$t("sortAuthor"),()=>{e((e=>{e.view_only_admin=!0}))}]];let i=0;const n=we('
        ');t.forEach(((e,t)=>{const s=e[0],r=e[1],a=we('
      • '),o=a.querySelector("span");o.innerText=s,o.onclick=()=>{((e,t,s,r)=>{r(),i=e,n.querySelectorAll(".active").forEach((e=>{e.classList.remove("active")})),t.classList.add("active"),n.style.display="none",setTimeout((()=>{n.style.display=""}),80)})(t,a,0,r)},n.append(a),t===i&&a.classList.add("active")})),this.$dropdownWrap.append(n)}updateUnread(e){super.updateUnread(e),this.showUnreadBadge((null==e?void 0:e.length)||0)}}class ft extends n{constructor(e){super(e),__publicField(this,"layer"),__publicField(this,"$header"),__publicField(this,"$closeBtn"),__publicField(this,"$iframeWrap"),__publicField(this,"$iframe"),__publicField(this,"firstShow",!0),this.$el=we('
        \n
        \n
        \n
        \n
        \n
        \n
        \n
        \n'),this.$header=this.$el.querySelector(".atk-sidebar-header"),this.$closeBtn=this.$header.querySelector(".atk-sidebar-close"),this.$iframeWrap=this.$el.querySelector(".atk-sidebar-iframe-wrap"),this.$closeBtn.onclick=()=>{this.hide()},this.ctx.on("user-changed",(()=>{this.firstShow=!0}))}show(){return __async(this,arguments,(function*(e={}){if(this.$el.style.transform="",null==this.layer&&(this.layer=new Ne(this.ctx,"sidebar",this.$el),this.layer.afterHide=()=>{!0===this.ctx.conf.editorTravel&&this.ctx.editorTravelBack()}),this.layer.show(),setTimeout((()=>{this.$el.style.transform="translate(0, 0)"}),20),(()=>{__async(this,null,(function*(){var t;const i=yield this.ctx.getApi().loginStatus();i.is_admin&&!i.is_login&&(null==(t=this.layer)||t.hide(),this.firstShow=!0,this.ctx.checkAdmin({onSuccess:()=>{setTimeout((()=>{this.show(e)}),500)},onCancel:()=>{}}))}))})(),this.ctx.updateNotifies([]),this.firstShow){this.$iframeWrap.innerHTML="",this.$iframe=we("");const t=Be(this.ctx,"/sidebar/"),i={pageKey:this.conf.pageKey,site:this.conf.site||"",user:JSON.stringify(this.ctx.user.data),time:+new Date};e.view&&(i.view=e.view),this.conf.darkMode&&(i.darkMode="1");const n=new URLSearchParams(i);this.iframeLoad(`${t}?${n.toString()}`),this.$iframeWrap.append(this.$iframe),this.firstShow=!1}else{const e=this.$iframe.src.includes("darkMode=1");this.conf.darkMode&&!e&&this.iframeLoad(`${this.$iframe.src}&darkMode=1`),!this.conf.darkMode&&e&&this.iframeLoad(this.$iframe.src.replace("&darkMode=1",""))}this.ctx.trigger("sidebar-show")}))}hide(){var e;this.$el.style.transform="",null==(e=this.layer)||e.hide(),this.ctx.trigger("sidebar-hide")}iframeLoad(e){this.$iframe&&(this.$iframe.src=e,Oe(this.$iframeWrap),this.$iframe.onload=()=>{Pe(this.$iframeWrap)})}}function kt(e){return __async(this,null,(function*(){const t=e.ctx.conf.countEl;t&&document.querySelector(t)&&yt(e,{api:"page_comment",countEl:t});const i=e.pvAdd?yield e.ctx.getApi().pv():void 0,n=e.ctx.conf.pvEl;n&&document.querySelector(n)&&yt(e,{api:"page_pv",countEl:n,curtPageCount:i})}))}function yt(e,t){return __async(this,null,(function*(){let i={};const n=e.ctx.conf.pageKey;t.curtPageCount&&(i[n]=t.curtPageCount);let s=Array.from(document.querySelectorAll(t.countEl)).map((e=>e.getAttribute("data-page-key")||n)).filter((e=>void 0===i[e]));if(s=[...new Set(s)],s.length>0){const n=yield e.ctx.getApi().stat(t.api,s);i=__spreadValues(__spreadValues({},i),n)}document.querySelectorAll(t.countEl).forEach((e=>{const t=e.getAttribute("data-page-key")||n;e.innerHTML=`${Number(i[t]||0)}`}))}))}const $t=class{constructor(e){if(__publicField(this,"conf"),__publicField(this,"ctx"),__publicField(this,"$root"),__publicField(this,"checkerLauncher"),__publicField(this,"editor"),__publicField(this,"list"),__publicField(this,"sidebarLayer"),__publicField(this,"instancePlugins",[]),this.conf=$t.HandelBaseConf(e),this.conf.el instanceof HTMLElement&&(this.$root=this.conf.el),this.ctx=new Ze(this.conf,this.$root),this.conf.useBackendConf)return this.loadConfRemoteAndInitComponents();this.initComponents()}initComponents(){this.initLocale(),this.initLayer(),this.initDarkMode(),function(e){try{if(!z.name)return}catch(s){return}const t=new z.Renderer,i=t.link;t.link=(e,n,s)=>{const r=null==e?void 0:e.startsWith(`${window.location.protocol}//${window.location.hostname}`);return i.call(t,e,n,s).replace(/^{const i=t||"plaintext";let n=e;return window.hljs?i&&window.hljs.getLanguage(i)&&(n=window.hljs.highlight(i,e).value):n=ve(e),`
        \n${n.replace(/&/g,"&")}\n
        `};const n=z;z.setOptions({renderer:t,pedantic:!1,gfm:!0,breaks:!0,smartLists:!0,smartypants:!0,xhtml:!1,sanitize:!1,silent:!0}),e.markedInstance=n}(this.ctx),this.checkerLauncher=new Xe(this.ctx),this.ctx.setCheckerLauncher(this.checkerLauncher),this.editor=new st(this.ctx),this.ctx.setEditor(this.editor),this.$root.appendChild(this.editor.$el),this.list=new gt(this.ctx),this.ctx.setList(this.list),this.$root.appendChild(this.list.$el),this.sidebarLayer=new ft(this.ctx),this.ctx.setSidebarLayer(this.sidebarLayer),this.$root.appendChild(this.sidebarLayer.$el),this.list.fetchComments(0),this.initEventBind(),$t.Plugins.forEach((e=>{"function"==typeof e&&e(this.ctx)}))}static HandelBaseConf(e){const t=Me($t.defaults,e);if("string"==typeof t.el&&t.el)try{const e=document.querySelector(t.el);if(!e)throw Error(`Target element "${t.el}" was not found.`);t.el=e}catch(i){throw console.error(i),new Error("Please check your Artalk `el` config.")}return t.server=t.server.replace(/\/$/,"").replace(/\/api\/?$/,""),t.pageKey||(t.pageKey=`${window.location.pathname}`),t.pageTitle||(t.pageTitle=`${document.title}`),t}loadConfRemoteAndInitComponents(){return __async(this,null,(function*(){return yield this.loadConfRemote(),this.initComponents(),this}))}loadConfRemote(){return __async(this,null,(function*(){Oe(this.$root);let e={};try{e=yield this.ctx.getApi().conf()}catch(t){console.error("Load config from remote err",t)}this.ctx.conf=Me(this.ctx.conf,e),Pe(this.$root)}))}initEventBind(){window.addEventListener("hashchange",(()=>{this.list.goToCommentDelay=!1,this.list.checkGoToCommentByUrlHash()})),this.ctx.on("user-changed",(()=>{this.ctx.checkAdminShowEl(),this.ctx.listRefreshUI()}))}initLocale(){"string"==typeof this.conf.locale&&("auto"===this.conf.locale&&(this.conf.locale=navigator.languages?navigator.languages[0]:navigator.language),this.conf.locale=this.conf.locale.replace(/^([a-zA-Z]+)(-[a-zA-Z]+)?$/,((e,t,i)=>t.toLowerCase()+(i||"").toUpperCase())),t[this.conf.locale]||(console.log(`Locale "${this.conf.locale}" not found.`),this.conf.locale="en"))}initLayer(){Ne.BodyOrgOverflow=document.body.style.overflow,Ne.BodyOrgPaddingRight=document.body.style.paddingRight}initDarkMode(){if("auto"===this.conf.darkMode){const e=window.matchMedia("(prefers-color-scheme: dark)");e.addEventListener("change",(e=>{this.setDarkMode(e.matches)})),this.setDarkMode(e.matches)}else this.setDarkMode(this.conf.darkMode||!1)}on(e,t){this.ctx.on(e,t,"external")}off(e,t){this.ctx.off(e,t,"external")}trigger(e,t){this.ctx.trigger(e,t,"external")}reload(){this.ctx.listReload()}setDarkMode(e){this.ctx.setDarkMode(e)}use(e){this.instancePlugins.push(e),"function"==typeof e&&e(this.ctx)}static use(e){this.Plugins.push(e)}static Use(e){this.use(e),console.warn("`Use(...)` is deprecated, replace it with lowercase `use(...)`.")}static LoadCountWidget(e){const t=this.HandelBaseConf(e);kt({ctx:new Ze(t),pvAdd:!1})}};let bt=$t;return __publicField(bt,"defaults",{el:"",pageKey:"",pageTitle:"",server:"",site:"",placeholder:"",noComment:"",sendBtn:"",darkMode:!1,editorTravel:!0,flatMode:"auto",nestMax:2,nestSort:"DATE_ASC",emoticons:"https://cdn.jsdelivr.net/gh/ArtalkJS/Emoticons/grps/default.json",vote:!0,voteDown:!1,uaBadge:!0,listSort:!0,preview:!0,countEl:"#ArtalkCount",pvEl:"#ArtalkPV",gravatar:{default:"mp",mirror:"https://sdn.geekzu.org/avatar/"},pagination:{pageSize:20,readMore:!0,autoLoad:!0},heightLimit:{content:300,children:400},imgUpload:!0,reqTimeout:15e3,versionCheck:!0,useBackendConf:!1,locale:"zh-CN"}),__publicField(bt,"Plugins",[e=>{kt({ctx:e,pvAdd:!0})}]),bt})); diff --git a/config.toml b/config.toml index a34e10fc..04bb92f0 100644 --- a/config.toml +++ b/config.toml @@ -514,10 +514,20 @@ sendBtn = "" editorTravel = true flatMode = "auto" - maxNesting = 3 # FixIt 0.2.17 | CHANGED enable lightgallery support lightgallery = false locale = "" # FixIt 0.2.15 | NEW + # FixIt 0.2.18 | NEW + emoticons = "" + nestMax = 2 + nestSort = "DATE_ASC" # ["DATE_ASC", "DATE_DESC", "VOTE_UP_DESC"] + vote = true + voteDown = false + uaBadge = true + listSort = true + imgUpload = true + preview = true + versionCheck = true # FixIt 0.1.1 | NEW Disqus comment config (https://disqus.com) [params.page.comment.disqus] enable = false diff --git a/docs b/docs index 815d15a6..54db49b7 160000 --- a/docs +++ b/docs @@ -1 +1 @@ -Subproject commit 815d15a65bc7e9477d5b918b2c0fa1a8134c4549 +Subproject commit 54db49b7a8448e32b7ba1b9d36e75dcf210cc48d diff --git a/layouts/partials/single/comment.html b/layouts/partials/single/comment.html index 384d8115..fd3cbcf7 100644 --- a/layouts/partials/single/comment.html +++ b/layouts/partials/single/comment.html @@ -10,9 +10,9 @@ {{- $artalk := $comment.artalk | default dict -}} {{- if $artalk.enable -}}
        - {{- $source := $cdn.artalkCSS | default "lib/artalk/Artalk.min.css" -}} + {{- $source := $cdn.artalkCSS | default "lib/artalk/Artalk.css" -}} {{- dict "Source" $source "Minify" true "Fingerprint" $fingerprint | dict "Scratch" .Scratch "Data" | partial "scratch/style.html" -}} - {{- $source := $cdn.artalkJS | default "lib/artalk/Artalk.min.js" -}} + {{- $source := $cdn.artalkJS | default "lib/artalk/Artalk.js" -}} {{- dict "Source" $source "Fingerprint" $fingerprint | dict "Scratch" .Scratch "Data" | partial "scratch/script.html" -}} {{- $commentConfig = dict "el" "#artalk" "pageKey" .Permalink "pageTitle" .Title "pvEl" "artalk-visitor-count" "countEl" "artalk-comment-count" | dict "artalk" | merge $commentConfig -}} {{- if (eq $artalk.locale "") | and (eq $.Site.LanguageCode "en") -}} @@ -31,24 +31,48 @@ {{- with $artalk.placeholder -}} {{- $commentConfig = dict "placeholder" . | dict "artalk" | merge $commentConfig -}} {{- end -}} - {{- with $artalk.noComment -}} + {{- with $artalk.nocomment -}} {{- $commentConfig = dict "noComment" . | dict "artalk" | merge $commentConfig -}} {{- end -}} - {{- with $artalk.sendBtn -}} + {{- with $artalk.sendbtn -}} {{- $commentConfig = dict "sendBtn" . | dict "artalk" | merge $commentConfig -}} {{- end -}} - {{- with $artalk.editorTravel -}} + {{- with $artalk.editortravel -}} {{- $commentConfig = dict "editorTravel" . | dict "artalk" | merge $commentConfig -}} {{- end -}} - {{- with $artalk.flatMode -}} - {{- $commentConfig = dict "flatMode" . | dict "artalk" | merge $commentConfig -}} + {{- if ne $artalk.flatmode nil -}} + {{- $commentConfig = dict "flatMode" $artalk.flatmode | dict "artalk" | merge $commentConfig -}} {{- end -}} - {{- with $artalk.maxNesting -}} - {{- $commentConfig = dict "maxNesting" . | dict "artalk" | merge $commentConfig -}} + {{- with $artalk.nestmax -}} + {{- $commentConfig = dict "nestMax" . | dict "artalk" | merge $commentConfig -}} + {{- end -}} + {{- with $artalk.nestsort -}} + {{- $commentConfig = dict "nestSort" . | dict "artalk" | merge $commentConfig -}} {{- end -}} {{- with $artalk.lightgallery -}} {{- $commentConfig = dict "lightgallery" . | dict "artalk" | merge $commentConfig -}} {{- end -}} + {{- if eq $artalk.vote false -}} + {{- $commentConfig = dict "vote" false | dict "artalk" | merge $commentConfig -}} + {{- end -}} + {{- with $artalk.votedown -}} + {{- $commentConfig = dict "voteDown" . | dict "artalk" | merge $commentConfig -}} + {{- end -}} + {{- if eq $artalk.uabadge false -}} + {{- $commentConfig = dict "uaBadge" false | dict "artalk" | merge $commentConfig -}} + {{- end -}} + {{- if eq $artalk.listsort false -}} + {{- $commentConfig = dict "listSort" false | dict "artalk" | merge $commentConfig -}} + {{- end -}} + {{- if eq $artalk.imgupload false -}} + {{- $commentConfig = dict "imgUpload" false | dict "artalk" | merge $commentConfig -}} + {{- end -}} + {{- if eq $artalk.preview false -}} + {{- $commentConfig = dict "preview" false | dict "artalk" | merge $commentConfig -}} + {{- end -}} + {{- if eq $artalk.versioncheck false -}} + {{- $commentConfig = dict "versionCheck" false | dict "artalk" | merge $commentConfig -}} + {{- end -}}
        diff --git a/layouts/posts/single.html b/layouts/posts/single.html index f3a5671e..e156e843 100644 --- a/layouts/posts/single.html +++ b/layouts/posts/single.html @@ -101,7 +101,7 @@ {{- if $comment.enable -}} {{- if $comment.artalk.enable -}} - {{ $visitorIcon }}- {{ T "single.views" }} + {{ $visitorIcon }}- {{ T "single.views" }}   {{- else if ($comment.valine.enable | and $comment.valine.visitor) -}} @@ -129,7 +129,7 @@ {{- if $comment.enable -}} {{- if $comment.artalk.enable -}} - {{ $commentIcon }}- {{ T "single.comments" }} + {{ $commentIcon }}- {{ T "single.comments" }}   {{- else if $comment.valine.enable | and $comment.valine.commentCount -}} diff --git a/src/js/theme.js b/src/js/theme.js index 21e3399a..4b317378 100644 --- a/src/js/theme.js +++ b/src/js/theme.js @@ -885,7 +885,7 @@ class FixIt { countEl: this.config.comment.artalk.countEl }) } - const artalk = new Artalk(this.config.comment.artalk); + const artalk = Artalk.init(this.config.comment.artalk); artalk.setDarkMode(this.isDark); this.switchThemeEventSet.add(() => { artalk.setDarkMode(this.isDark);