PageSourceSearch

https://sovereign-smartphone.github.io/js/theme.min.js

js sovereign-smartphone.github.io collected 2026-10-03 09:58:39 UTC 31,672 bytes, 2 lines download raw bytes

1(()=>{var A=class{forEach(e,t){e=e||[];let i=[];for(let n=0;n<e.length;n++){let s=t(e[n],n);s instanceof Promise&&i.push(s)}return Promise.all(i)}getScrollTop(){return(document.documentElement??document.body).scrollTop}isMobile(){return window.matchMedia("only screen and (max-width: 680px)").matches}isTocStatic(){return window.matchMedia("only screen and (max-width: 960px)").matches}animateCSS(e,t,i,n){!Array.isArray(t)&&(t=[t]),e.classList.add("animate__animated",...t),e.addEventListener("animationend",()=>{!i&&e.classList.remove("animate__animated",...t),typeof n=="function"&&n()},{once:!0})}isValidDate(e){return e instanceof Date&&!isNaN(e.getTime())}scrollIntoView(e){(e.startsWith("#")?document.getElementById(e.slice(1)):document.querySelector(e))?.scrollIntoView({behavior:"smooth"})}getStagingDOM(){let e=document.createElement("div");return e.style.display="none",e.dataset.stagingId=Math.random().toString(36).slice(2),document.body.appendChild(e),{$el:e,stage(t){e.innerHTML="",e.appendChild(t)},contentAsHtml(){return e.innerHTML},contentAsText(){return e.innerText},contentAsJson(){return JSON.parse(e.innerHTML)},destroy(){document.body.removeChild(e)}}}copyText(e){return navigator.clipboard?(this.copyText=t=>navigator.clipboard.writeText(t),this.copyText(e)):(this.copyText=t=>new Promise((i,n)=>{let s=document.createElement("input");s.value=t,document.body.appendChild(s),s.select(),document.execCommand("copy")?(document.body.removeChild(s),i()):n()}),this.copyText(e))}isObjectLiteral(e){return typeof e!="string"?!1:(e=e.replace(/\s+/g," ").trim().replace(/;$/,""),!!(e.startsWith("{")&&e.endsWith("}")))}};var B=class{constructor(){this.config=window.config,this.isDark=document.documentElement.dataset.theme==="dark",this.util=new A,this.newScrollTop=this.util.getScrollTop(),this.oldScrollTop=this.newScrollTop,this.scrollEventSet=new Set,this.resizeEventSet=new Set,this.switchThemeEventSet=new Set,this.clickMaskEventSet=new Set,this.beforeprintEventSet=new Set,this.disableScrollEvent=!1,window.objectFitImages&&objectFitImages()}initThemeColor(){let e=document.querySelector('[name="theme-color"]');e&&(this._themeColorOnSwitchTheme=this._themeColorOnSwitchTheme||(()=>{e.content=this.isDark?e.dataset.dark:e.dataset.light}),this.switchThemeEventSet.add(this._themeColorOnSwitchTheme),this._themeColorOnSwitchTheme())}initSVGIcon(){this.util.forEach(document.querySelectorAll("[data-svg-src]"),e=>{fetch(e.dataset.svgSrc).then(t=>t.text()).then(t=>{let i=document.createElement("div");i.insertAdjacentHTML("afterbegin",t);let n=i.firstChild;n.dataset.svgSrc=e.dataset.svgSrc,n.classList.add("icon");let s=n.getElementsByTagName("title");s.length&&n.removeChild(s[0]),e.parentElement.replaceChild(n,e)}).catch(t=>{console.error(t)})})}initTwemoji(e=document.body){this.config.twemoji&&twemoji.parse(e)}initMenu(){this.initMenuDesktop(),this.initMenuMobile()}initMenuDesktop(){this.util.forEach(document.querySelectorAll(".has-children"),e=>{e.querySelector(".sub-menu").style.minWidth=`${e.offsetWidth-8}px`})}initMenuMobile(){let e=document.getElementById("menu-toggle-mobile"),t=document.getElementById("menu-mobile");e.addEventListener("click",i=>{document.body.classList.toggle("blur"),e.classList.toggle("active"),t.classList.toggle("active"),this.disableScrollEvent=document.body.classList.contains("blur")},!1),this._menuMobileOnClickMask=this._menuMobileOnClickMask||(()=>{e.classList.remove("active"),t.classList.remove("active")}),this.clickMaskEventSet.add(this._menuMobileOnClickMask),this.util.forEach(document.querySelectorAll(".menu-item>.nested-item"),i=>{i.addEventListener("click",function(){this.parentNode.querySelector(".sub-menu").classList.toggle("open"),this.querySelector(".dropdown-icon").classList.toggle("open")})})}initSwitchTheme(){this.util.forEach(document.getElementsByClassName("theme-switch"),e=>{e.addEventListener("click",()=>{document.documentElement.dataset.theme=this.isDark?"light":"dark",this.isDark=!this.isDark,window.localStorage?.setItem("theme",this.isDark?"dark":"light");for(let t of this.switchThemeEventSet)t(this.isDark)},!1)})}initSearch(){let e=this.config.search,t=this.util.isMobile();if(!e||t&&this._searchMobileOnce||!t&&this._searchDesktopOnce)return;let i=e.maxResultLength??10,n=e.snippetLength??50,s=e.highlightTag??"em",a=e.isCaseSensitive??!1,r=e.minMatchCharLength??1,l=e.findAllMatches??!1,h=e.location??0,c=e.threshold??.3,o=e.distance??100,g=e.ignoreLocation??!1,d=e.useExtendedSearch??!1,p=e.ignoreFieldNorm??!1,S=t?"mobile":"desktop",T=document.getElementById(`header-${S}`),C=document.getElementById(`search-input-${S}`),I=document.getElementById(`search-toggle-${S}`),x=document.getElementById(`search-loading-${S}`),E=document.getElementById(`search-clear-${S}`),W=document.getElementById("search-cancel-mobile");if(e.type==="post-chat"&&window.postChatUser){t?C.addEventListener("focus",()=>{window.postChatUser.setSearchInput("")},!1):I.addEventListener("click",()=>{window.postChatUser.setSearchInput("")},!1);return}t?(this._searchMobileOnce=!0,C.addEventListener("focus",()=>{this.disableScrollEvent=!0,document.body.classList.add("blur"),T.classList.add("open")},!1),W.addEventListener("click",()=>{this.disableScrollEvent=!1,T.classList.remove("open"),document.body.classList.remove("blur"),document.getElementById("menu-toggle-mobile").classList.remove("active"),document.getElementById("menu-mobile").classList.remove("active"),x.style.display="none",E.style.display="none",this._searchMobile&&this._searchMobile.autocomplete.setVal("")},!1),E.addEventListener("click",()=>{E.style.display="none",this._searchMobile&&this._searchMobile.autocomplete.setVal("")},!1),this._searchMobileOnClickMask=this._searchMobileOnClickMask||(()=>{T.classList.remove("open"),x.style.display="none",E.style.display="none",this._searchMobile&&this._searchMobile.autocomplete.setVal("")}),this.clickMaskEventSet.add(this._searchMobileOnClickMask)):(this._searchDesktopOnce=!0,I.addEventListener("click",()=>{document.body.classList.add("blur"),T.classList.add("open"),C.focus(),this.disableScrollEvent=!0},!1),E.addEventListener("click",()=>{this.disableScrollEvent=!1,E.style.display="none",this._searchDesktop&&this._searchDesktop.autocomplete.setVal("")},!1),this._searchDesktopOnClickMask=this._searchDesktopOnClickMask||(()=>{T.classList.remove("open"),x.style.display="none",E.style.display="none",this._searchDesktop&&this._searchDesktop.autocomplete.setVal("")}),this.clickMaskEventSet.add(this._searchDesktopOnClickMask)),C.addEventListener("input",()=>{C.value===""?E.style.display="none":E.style.display="inline"},!1),(()=>{let O=autocomplete(`#search-input-${S}`,{hint:!1,autoselect:!0,dropdownMenuContainer:`#search-dropdown-${S}
1`,clearOnSelected:!0,cssClasses:{noPrefix:!0},debug:!0},{name:"search",source:(f,k)=>{x.style.display="inline",E.style.display="none";let m=u=>{x.style.display="none",E.style.display="inline",k(u)};if(e.type==="algolia")this._algoliaIndex=this._algoliaIndex||algoliasearch(e.algoliaAppID,e.algoliaSearchKey).initIndex(e.algoliaIndex),this._algoliaIndex.search(f,{offset:0,length:i*8,attributesToHighlight:["title"],attributesToSnippet:[`content:${n}`],highlightPreTag:`<${s}>`,highlightPostTag:`</${s}>`}).then(({hits:u})=>{let y={};u.forEach(({uri:w,date:N,_highlightResult:{title:D},_snippetResult:{content:_}})=>{y[w]&&y[w].context.length>_.value||(y[w]={uri:w,title:D.value,date:N,context:_.value})}),m(Object.values(y).slice(0,i))}).catch(u=>{console.error(u),m([])});else if(e.type==="fuse"){let u=()=>{let y={};return window._index.search(f).forEach(({item:w,refIndex:N,matches:D})=>{let _=w.title,M=w.content.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;");D.forEach(({indices:L,value:j,key:H})=>{if(H==="content"){let v=0;for(let b=0;b<L.length;b++){let $=M.substring(L[b][0]+v,L[b][1]+1+v),q=`<${s}>`+$+`</${s}>`;M=M.substring(0,L[b][0]+v)+q+M.substring(L[b][1]+1+v,M.length),v+=s.length*2+5}}else if(H==="title"){let v=0;for(let b=0;b<L.length;b++){let $=_.substring(L[b][0]+v,L[b][1]+1+v),q=`<${s}>`+$+`</${s}>`;_=_.substring(0,L[b][0]+v)+q+_.substring(L[b][1]+1+v,M.length),v+=s.length*2+5}}}),y[w.uri]={uri:w.uri,title:_,date:w.date,context:M}}),Object.values(y).slice(0,i)};window._index?m(u()):fetch(e.fuseIndexURL).then(y=>y.json()).then(y=>{let w={isCaseSensitive:a,findAllMatches:l,minMatchCharLength:r,location:h,threshold:c,distance:o,ignoreLocation:g,useExtendedSearch:d,ignoreFieldNorm:p,includeScore:!1,shouldSort:!0,includeMatches:!0,keys:["content","title"]};window._index=new Fuse(y,w),m(u())}).catch(y=>{console.error(y),m([])})}else if(e.type==="cse"){let u=this.config.cse;u.engine==="google"&&u.cx&&m([{uri:`${u.resultsPage}#gsc.tab=0&gsc.q=${encodeURIComponent(f)}`,title:u.searchIn,date:'<i class="fa-brands fa-searchengin fa-xl" aria-hidden="true"></i>',context:u.gotoResultsPage}])}else m([])},templates:{suggestion:({title:f,date:k,context:m})=>`<div><span class="suggestion-title">${f}</span><span class="suggestion-date">${k}</span></div><div class="suggestion-context">${m}</div>`,empty:({query:f})=>`<div class="search-empty">${e.noResultsFound}: <span class="search-query">"${f}"</span></div>`,footer:({})=>{let f,k,m;switch(e.type){case"algolia":f="algolia",k='<i class="fa-brands fa-algolia fa-fw" aria-hidden="true"></i>',m="https://www.algolia.com/";break;case"fuse":f="Fuse.js",k="",m="https://fusejs.io/";break;case"cse":this.config.cse.engine==="google"&&(f="Google CSE",k='<i class="fa-brands fa-google fa-fw" aria-hidden="true"></i>',m="https://programmablesearchengine.google.com/");break;default:f="",k="",m=""}return`<div class="search-footer">Search by <a href="${m}" rel="noopener noreferrer" target="_blank">${k} ${f}</a></div>`}}});O.on("autocomplete:selected",(f,k,m,u)=>{window.location.assign(k.uri)}),t?this._searchMobile=O:this._searchDesktop=O})()}initBreadcrumb(){let e=document.querySelector(".breadcrumb-container.sticky");this.breadcrumbHeight=e?.clientHeight??0,this.breadcrumbHeight&&document.querySelector("main.fi-container")?.style.setProperty("--fi-breadcrumb-height",`${this.breadcrumbHeight}px`)}
1initDetails(e=document){this.util.forEach(e.querySelectorAll(".details:not(.disabled)"),t=>{t.querySelector(".details-summary").addEventListener("click",()=>{t.classList.toggle("open")},!1)})}initLightGallery(){this.config.lightgallery&&(this.lg&&this.lg.destroy(!0),this.lg=lightGallery(document.getElementById("content"),{plugins:[lgThumbnail,lgZoom],selector:".lightgallery",speed:400,hideBarsDelay:2e3,allowMediaOverlap:!0,exThumbImage:"data-thumbnail",toggleThumb:!0,thumbWidth:80,thumbHeight:"60px",actualSize:!1,showZoomInOutIcons:!0,licenseKey:"none"}))}initCodeWrapper(){if(!this.config.code){this.initCopyCode();return}this.util.forEach(document.querySelectorAll(".highlight > pre.chroma"),e=>{let t=document.createElement("div");t.className=e.className;let i=document.createElement("table");t.appendChild(i);let n=document.createElement("tbody");i.appendChild(n);let s=document.createElement("tr");n.appendChild(s);let a=document.createElement("td");s.appendChild(a),e.parentElement.replaceChild(t,e),a.appendChild(e)}),this.util.forEach(document.querySelectorAll(".highlight > .chroma:not([data-init])"),e=>{if(e.dataset.init="true",e.parentElement.classList.contains("no-header")){this.initCopyCode(e);return}let t=e.querySelectorAll("pre.chroma > code");if(t.length){let i=t[t.length-1],n=document.createElement("div");n.className="code-header "+i.className.toLowerCase();let s=document.createElement("span");s.classList.add("code-title"),s.insertAdjacentHTML("afterbegin",e.parentNode.title?`<i class="arrow fa-solid fa-chevron-right fa-fw" aria-hidden="true"></i><span class="title-inner">${e.parentNode.title}</span>`:'<i class="arrow fa-solid fa-chevron-right fa-fw" aria-hidden="true"></i>'),s.addEventListener("click",()=>{e.classList.toggle("open")},!1),n.appendChild(s);let a=document.createElement("span");if(a.insertAdjacentHTML("afterbegin",'<i class="fa-solid fa-ellipsis-h fa-fw" aria-hidden="true"></i>'),a.classList.add("ellipses"),a.addEventListener("click",()=>{e.classList.add("open")},!1),n.appendChild(a),this.config.code.editable){let r=document.createElement("span");r.classList.add("edit"),r.insertAdjacentHTML("afterbegin",`<i class="fa-solid fa-pen-to-square fa-fw" title="${this.config.code.editUnLockTitle}" aria-hidden="true"></i>`),r.addEventListener("click",()=>{let l=r.querySelector(".fa-pen-to-square"),h=r.querySelector(".fa-lock"),c=r.parentElement.parentElement.querySelectorAll("pre.chroma"),o=c.length===2?c[1]:c[0];l?(l.classList.add("fa-lock"),l.classList.remove("fa-pen-to-square"),l.title=this.config.code.editLockTitle,o.setAttribute("contenteditable",!0),o.focus()):(h.classList.add("fa-pen-to-square"),h.classList.remove("fa-lock"),h.title=this.config.code.editUnLockTitle,o.setAttribute("contenteditable",!1),o.blur())},!1),n.appendChild(r)}if(this.config.code.copyTitle){let r=document.createElement("span");r.insertAdjacentHTML("afterbegin",'<i class="fa-regular fa-copy fa-fw" aria-hidden="true"></i>'),r.classList.add("copy");let l=i.innerText.trim();if(e.closest("details")!==null){let c=document.createElement("div");c.appendChild(i.cloneNode(!0)),l=c.innerText.trim()}((e.parentElement.dataset.open?JSON.parse(e.parentElement.dataset.open):void 0)??(this.config.code.maxShownLines<0||l.split(`
2`).length<this.config.code.maxShownLines+2))&&e.classList.add("open"),r.title=this.config.code.copyTitle,r.addEventListener("click",()=>{this.util.copyText(l).then(()=>{this.util.animateCSS(i,"animate__flash")},()=>{console.error("Clipboard write failed!","Your browser does not support clipboard API!")})},!1),n.appendChild(r)}e.insertBefore(n,e.firstChild)}})}initDiagramCopyBtn(){let e=this.util.getStagingDOM();this.util.forEach(document.querySelectorAll(".diagram-copy-btn"),t=>{t.addEventListener("click",()=>{e.stage(t.parentElement.querySelector("template").content.cloneNode(!0));let i=e.contentAsText();this.util.copyText(i).then(()=>{t.toggleAttribute("data-copied",!0),setTimeout(()=>{t.toggleAttribute("data-copied",!1)},2e3)},()=>{console.error("Clipboard write failed!","Your browser does not support clipboard API!")})},!1)}),e.destroy()}initTable(e=document){this.util.forEach(e.querySelectorAll(".content table"),t=>{let i=document.createElement("div");i.className="table-wrapper",t.parentElement.replaceChild(i,t),i.appendChild(t)})}initCopyCode(e){}initToc(){let e=document.getElementById("TableOfContents");if(e!==null)if(document.getElementById("toc-static").dataset.kept==="true"||this.util.isTocStatic()){let t=document.getElementById("toc-content-static");e.parentElement!==t&&(e.parentElement.removeChild(e),t.appendChild(e)),this._tocOnScroll&&this.scrollEventSet.delete(this._tocOnScroll)}else{let t=document.getElementById("toc-content-auto");e.parentElement!==t&&(e.parentElement.removeChild(e),t.appendChild(e));let i=document.getElementById("toc-auto");i.style.visibility="visible",this.util.animateCSS(i,["animate__fadeIn","animate__faster"],!0);let n=document.querySelector(".post-meta");
2i.style.marginTop=`${n.offsetTop+n.clientHeight}px`;let s=e.querySelectorAll("a:first-child"),a=e.getElementsByTagName("li"),r=document.getElementsByClassName("heading-element"),l=document.getElementById("header-desktop").offsetHeight;document.querySelector(".fi-container").addEventListener("resize",()=>{i.style.marginBottom=`${document.querySelector(".fi-container").clientHeight-document.querySelector(".post-footer").offsetTop}px`}),this._tocOnScroll=this._tocOnScroll||(()=>{i.style.marginBottom=`${document.querySelector(".fi-container").clientHeight-document.querySelector(".post-footer").offsetTop}px`,this.util.forEach(s,o=>{o.classList.remove("active")}),this.util.forEach(a,o=>{o.classList.remove("has-active")});let h=20+(document.body.dataset.headerDesktop!=="normal"?l:0)+this.breadcrumbHeight,c=r.length-1;for(let o=0;o<r.length-1;o++){let g=r[o].getBoundingClientRect().top,d=r[o+1].getBoundingClientRect().top;if(o==0&&g>h||g<=h&&d>h){c=o;break}}if(c!==-1&&s[c]){s[c].classList.add("active");let o=s[c].parentElement;for(;o!==e;)o.classList.add("has-active"),o=o.parentElement.parentElement}}),this._tocOnScroll(),this.scrollEventSet.add(this._tocOnScroll)}}initTocListener(){let e=document.getElementById("toc-auto"),t=document.getElementById("toc-content-auto");document.querySelector("#toc-auto>.toc-title")?.addEventListener("click",()=>{let i=["animate__faster"],n=e.classList.contains("toc-hidden");i.push(n?"animate__fadeIn":"animate__fadeOut"),t.classList.remove(n?"animate__fadeOut":"animate__fadeIn"),this.util.animateCSS(t,i,!0),e.classList.toggle("toc-hidden")},!1)}fixTocScroll(){if(typeof APlayer=="function"){let e=document.getElementById("TableOfContents");if(e){let t=e.cloneNode(!0);e.parentElement.replaceChild(t,e),e=t}this.util.forEach(document.querySelectorAll(".heading-mark"),t=>{let i=t.cloneNode(!0);t.parentElement.replaceChild(i,t)})}}initEcharts(){this.config.echarts&&(echarts.registerTheme("light",this.config.echarts.lightTheme),echarts.registerTheme("dark",this.config.echarts.darkTheme),this._echartsOnSwitchTheme=this._echartsOnSwitchTheme||(()=>{this._echartsArr=this._echartsArr||[];for(let t=0;t<this._echartsArr.length;t++)this._echartsArr[t].dispose();this._echartsArr=[];let e=this.util.getStagingDOM();this.util.forEach(document.getElementsByClassName("echarts"),t=>{let i=t.nextElementSibling;if(i.tagName!=="TEMPLATE")return;let n=echarts.init(t,this.isDark?"dark":"light",{renderer:"svg"});n.showLoading(),e.stage(i.content.cloneNode(!0));let s=a=>{if(!a){n.hideLoading(),console.warn("ECharts option is missing or invalid. Chart disposed.",{element:t,option:i}),n.dispose(),t.removeAttribute("style");return}n.hideLoading(),n.setOption(a),this._echartsArr.push(n)};if(i.dataset.fmt==="js")try{let a=e.contentAsText(),r=new Function("fixit","chart",this.util.isObjectLiteral(a)?`return ${a}`:a);return i.dataset.async==="true"?Promise.resolve(r(this,n)).then(l=>{s(l)}):s(r(this,n))}catch(a){return console.error(a)}s(e.contentAsJson())}),e.destroy()}),this.switchThemeEventSet.add(this._echartsOnSwitchTheme),this._echartsOnSwitchTheme(),this._echartsOnResize=this._echartsOnResize||(()=>{for(let e=0;e<this._echartsArr.length;e++)this._echartsArr[e].resize()}),this.resizeEventSet.add(this._echartsOnResize))}initMapbox(){this.config.mapbox&&(mapboxgl.accessToken||(mapboxgl.accessToken=this.config.mapbox.accessToken,mapboxgl.setRTLTextPlugin(this.config.mapbox.RTLTextPlugin),this._mapboxArr=this._mapboxArr||[]),this.util.forEach(document.querySelectorAll(".mapbox:empty"),e=>{let{lng:t,lat:i,zoom:n,lightStyle:s,darkStyle:a,marked:r,markers:l,navigation:h,geolocate:c,scale:o,fullscreen:g}=JSON.parse(e.dataset.options),d=new mapboxgl.Map({container:e,center:[t,i],zoom:n,minZoom:.2,style:this.isDark?a:s,attributionControl:!1});r&&new mapboxgl.Marker().setLngLat([t,i]).addTo(d);let p=typeof l=="string"?JSON.parse(l):l;Array.isArray(p)&&p.length>0&&p.forEach(S=>{let{lng:T,lat:C,description:I}=S,x=new mapboxgl.Popup({offset:25}).setText(I);new mapboxgl.Marker().setLngLat([T,C]).setPopup(x).addTo(d)}),h&&d.addControl(new mapboxgl.NavigationControl,"bottom-right"),c&&d.addControl(new mapboxgl.GeolocateControl({positionOptions:{enableHighAccuracy:!0},showUserLocation:!0,trackUserLocation:!0}
2),"bottom-right"),o&&d.addControl(new mapboxgl.ScaleControl),g&&d.addControl(new mapboxgl.FullscreenControl),d.addControl(new MapboxLanguage),this._mapboxArr.push(d)}),this._mapboxOnSwitchTheme=this._mapboxOnSwitchTheme||(()=>{this.util.forEach(this._mapboxArr,e=>{let t=e.getContainer(),{lightStyle:i,darkStyle:n}=JSON.parse(t.dataset.options);e.setStyle(this.isDark?n:i),e.addControl(new MapboxLanguage)})}),this.switchThemeEventSet.add(this._mapboxOnSwitchTheme))}initTypeit(e=document){if(this.config.typeit){let t=this.config.typeit,i=t.speed||100,n=t.cursorSpeed||1e3,s=t.cursorChar||"|",a=t.loop??!1,r=e.querySelectorAll(".typeit"),l=Array.from(r).reduce((c,o)=>{let g=o.dataset.group||o.id||Math.random().toString(36).substring(2);return c[g]=c[g]||[],c[g].push(o),c},{}),h=this.util.getStagingDOM();Object.values(l).forEach(c=>{let o=g=>{let d=c[g],p=d.dataset;h.stage(d.querySelector("template").content.cloneNode(!0));let S=d.firstElementChild;d.firstElementChild.tagName==="TEMPLATE"&&(d.innerHTML="",S=d);let T=new TypeIt(S,{strings:h.$el.querySelector("pre")?.innerHTML||h.contentAsHtml(),speed:Number(p.speed)>=0?Number(p.speed):i,lifeLike:!0,cursorSpeed:Number(p.cursorSpeed)>=0?Number(p.cursorSpeed):n,cursorChar:p.cursorChar||s,waitUntilVisible:!0,loop:p.loop?p.loop==="true":a,afterComplete:()=>{let C=Number(p.duration??t.duration);if(g===c.length-1){C>=0&&window.setTimeout(()=>{T.destroy()},C);return}T.destroy(),o(g+1)}}).go()};o(0)}),h.destroy()}}initCommentLightGallery(e,t){document.querySelectorAll(e).forEach(i=>{let n=i.querySelectorAll(t+":not([lightgallery-loaded])");n.forEach(s=>{s.setAttribute("lightgallery-loaded","");let a=document.createElement("a");a.setAttribute("class","comment-lightgallery"),a.setAttribute("href",s.src),a.append(s.cloneNode()),s.replaceWith(a)}),n.length&&lightGallery(i,{selector:".comment-lightgallery",actualSize:!1,hideBarsDelay:2e3,speed:400})})}initComment(){if(this.config.comment?.enable){if(document.querySelector("#comments")){let e=document.querySelector(".view-comments");e.classList.remove("d-none"),e.addEventListener("click",()=>{this.util.scrollIntoView("#comments")},!1)}if(this.config.comment.expired&&document.querySelector("#comments").remove(),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});let e=Artalk.init(this.config.comment.artalk);return e.setDarkMode(this.isDark),this.switchThemeEventSet.add(()=>{e.setDarkMode(this.isDark)}),e.on("comments-loaded",()=>{this.config.comment.artalk.lightgallery&&this.initCommentLightGallery(".atk-comment .atk-content","img:not([atk-emoticon])")}),e}if(this.config.comment.gitalk){this.config.comment.gitalk.body=decodeURI(window.location.href);let e=new Gitalk(this.config.comment.gitalk);return e.render("gitalk"),e}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){let e=this.config.comment.utterances,t=document.createElement("script");t.src="https://utteranc.es/client.js",t.setAttribute("repo",e.repo),t.setAttribute("issue-term",e.issueTerm),e.label&&t.setAttribute("label",e.label),t.setAttribute("theme",this.isDark?e.darkTheme:e.lightTheme),t.crossOrigin="anonymous",t.async=!0,document.getElementById("utterances").appendChild(t),this._utterancesOnSwitchTheme=this._utterancesOnSwitchTheme||(()=>{let i={type:"set-theme",theme:this.isDark?e.darkTheme:e.lightTheme};document.querySelector(".utterances-frame")?.contentWindow.postMessage(i,"https://utteranc.es")}),this.switchThemeEventSet.add(this._utterancesOnSwitchTheme);return}if(this.config.comment.twikoo){let e=this.config.comment.twikoo;e.lightgallery&&(e.onCommentLoaded=()=>{this.initCommentLightGallery(".tk-comments .tk-content","img:not(.tk-owo-emotion)")}),twikoo.init(e),e.commentCount&&twikoo.getCommentsCount({envId:e.envId,region:e.region,urls:[window.location.pathname],includeReply:!1}).then(function(t){let i=document.getElementById("twikoo-comment-count");
2i&&(i.innerHTML=t[0].count)});return}if(this.config.comment.giscus){let e=this.config.comment.giscus;this._giscusOnSwitchTheme=this._giscusOnSwitchTheme||(()=>{let t={setConfig:{theme:this.isDark?e.darkTheme:e.lightTheme}};document.querySelector(".giscus-frame")?.contentWindow.postMessage({giscus:t},e.origin)}),this.switchThemeEventSet.add(this._giscusOnSwitchTheme),this._messageListener=t=>{if(t.origin!==e.origin)return;let i=document.querySelector("#giscus>script");i&&i.parentElement.removeChild(i),this._giscusOnSwitchTheme(),window.removeEventListener("message",this._messageListener,!1)},window.addEventListener("message",this._messageListener,!1);return}}}initCookieconsent(){this.config.cookieconsent&&window.cookieconsent?.initialise(this.config.cookieconsent)}getSiteTime=()=>{let e=new Date,t=new Date(this.config.siteTime),i=document.querySelector(".run-times");if(!this.util.isValidDate(t)||!i){clearInterval(this.siteTime),i&&i.parentNode.remove();return}let n=(e-t)/1e3,s=Math.floor(n/60/60/24),a=Math.floor(n/60/60-24*s),r=Math.floor(n/60-1440*s-60*a),l=Math.floor((e-t)/1e3-1440*60*s-3600*a-60*r);i.innerHTML=`${s}, ${String(a).padStart(2,0)}:${String(r).padStart(2,0)}:${String(l).padStart(2,0)}`,document.querySelector(".site-time .d-none")?.classList.remove("d-none")};initSiteTime(){this.config.siteTime&&(this.siteTime=setInterval(this.getSiteTime,500),document.addEventListener("visibilitychange",()=>{if(document.hidden)return clearInterval(this.siteTime);this.siteTime=setInterval(this.getSiteTime,500)},!1))}initServiceWorker(){this.config.enablePWA&&"serviceWorker"in navigator&&(navigator.serviceWorker.register("/service-worker.min.js",{scope:"/"}).then(function(e){}).catch(function(e){console.error("error: ",e)}),navigator.serviceWorker.ready.then(function(e){}))}initWatermark(){this.config.watermark?.enable&&new Watermark(this.config.watermark)}initPangu(){if(!this.config.pangu?.enable)return;let e=this.config.pangu.selector;if(e){pangu.ignoredTags=/^(script|code|pre|textarea|sup|sub)$/i,e.startsWith("#")?pangu.spacingElementById(e.slice(1)):e.startsWith(".")?pangu.spacingElementByClassName(e.slice(1)):pangu.spacingElementByTagName(e);return}pangu.autoSpacingPage()}initMathJax(){window.MathJax?.typeset&&window.MathJax.typeset()}initFixItDecryptor(){this.decryptor=new FixItDecryptor({decrypted:()=>{this.initTwemoji(),this.initDetails(),this.initLightGallery(),this.initCodeWrapper(),this.initDiagramCopyBtn(),this.initTable(),this.initEcharts(),this.initTypeit(),this.initMapbox(),this.fixTocScroll(),this.initToc(),this.initTocListener(),this.initPangu(),this.initMathJax(),window.FixItMermaid?.init?.(),this.util.forEach(document.querySelectorAll(".encrypted-hidden"),e=>{e.classList.replace("encrypted-hidden","decrypted-shown")})},partialDecrypted:e=>{this.initTwemoji(e),this.initDetails(e),this.initLightGallery(),this.initCodeWrapper(),this.initDiagramCopyBtn(),this.initTable(e),this.initEcharts(),this.initTypeit(e),this.initMapbox(),this.initPangu(),this.initMathJax(),window.FixItMermaid?.init?.(),this.util.forEach(e.querySelectorAll(".encrypted-hidden"),t=>{t.classList.replace("encrypted-hidden","decrypted-shown")})},reset:()=>{this.util.forEach(document.querySelectorAll(".decrypted-shown"),e=>{e.classList.replace("decrypted-shown","encrypted-hidden")})}}),this.decryptor.init(this.config.encryption)}initAutoMark(){if(!this.config.autoBookmark)return;window.addEventListener("beforeunload",()=>{window.sessionStorage?.setItem(`fixit-bookmark/#${location.pathname}`,this.util.getScrollTop())});let e=Number(window.sessionStorage?.getItem(`fixit-bookmark/#${location.pathname}`));e&&location.hash===""&&window.scrollTo({top:e,behavior:"smooth"})}initReward(){let e=document.querySelectorAll('.post-reward [data-mode="fixed"]');if(!e.length)return;if(this.util.isMobile()){this.util.forEach(e,i=>{i.removeAttribute("data-mode")});return}let t=i=>{this.util.forEach(e,n=>{let s=n.parentElement.querySelector(".reward-input");s.id!==i&&(s.checked=!1)})};this.util.forEach(e,i=>{i.previousElementSibling.addEventListener("click",function(){t(this.getAttribute("for"))},!1)}),this.scrollEventSet.add(t)}initPostChatUser(){!window.postChatUser||!postChatConfig||postChatConfig.userMode==="magic"||(postChat_theme=this.isDark?"dark":"light",this.switchThemeEventSet.add(e=>
2{document.getElementById("postChat_iframeContainer")?window.postChatUser.setPostChatTheme(e?"dark":"light"):postChat_theme=e?"dark":"light"}))}onScroll(){let e=[],i=document.querySelector(".fixed-buttons"),n=document.querySelector(".back-to-top"),s=document.querySelector(".reading-progress-bar");document.body.dataset.headerDesktop==="auto"&&e.push(document.getElementById("header-desktop")),document.body.dataset.headerMobile==="auto"&&e.push(document.getElementById("header-mobile")),n?.addEventListener("click",()=>{this.util.scrollIntoView("body")}),window.addEventListener("scroll",a=>{if(this.disableScrollEvent){a.preventDefault();return}let r=document.getElementById("mask");this.newScrollTop=this.util.getScrollTop();let l=this.newScrollTop-this.oldScrollTop;this.util.forEach(e,o=>{l>20?(o.classList.remove("animate__fadeInDown"),this.util.animateCSS(o,["animate__fadeOutUp"],!0),r.click()):l<-20&&(o.classList.remove("animate__fadeOutUp"),this.util.animateCSS(o,["animate__fadeInDown"],!0),r.click())});let h=document.body.scrollHeight-window.innerHeight,c=Math.max(Math.min(100*Math.max(this.newScrollTop,0)/h,100),0);s&&s.style.setProperty("--progress",`${c.toFixed(2)}%`),i&&(c>1?(i.classList.remove("d-none","animate__fadeOut"),this.util.animateCSS(i,["animate__fadeIn"],!0)):(i.classList.remove("animate__fadeIn"),this.util.animateCSS(i,["animate__fadeOut"],!0,()=>{i.classList.contains("animate__fadeOut")&&i.classList.add("d-none")})),n&&(n.querySelector("span").innerText=`${Math.round(c)}%`));for(let o of this.scrollEventSet)o();this.oldScrollTop=this.newScrollTop},!1)}onResize(){let e=this.util.isMobile();window.addEventListener("resize",()=>{this._resizeTimeout||(this._resizeTimeout=window.setTimeout(()=>{this._resizeTimeout=null;for(let i of this.resizeEventSet)i();this.initToc(),this.initSearch();let t=this.util.isMobile();t!==e&&(document.getElementById("mask").click(),e=t)},100))},!1)}onClickMask(){document.getElementById("mask").addEventListener("click",()=>{if(document.body.classList.contains("blur")){for(let e of this.clickMaskEventSet)e();this.disableScrollEvent=!1,document.body.classList.remove("blur")}},!1)}beforeprint(){window.addEventListener("beforeprint",()=>{this.util.forEach(document.querySelectorAll(".chroma"),e=>{e.classList.toggle("open",!0)});for(let e of this.beforeprintEventSet)e()},!1)}init(){try{this.config.encryption&&this.initFixItDecryptor(),this.config.encryption?.all||(this.initTwemoji(),this.initDetails(),this.initLightGallery(),this.initCodeWrapper(),this.initDiagramCopyBtn(),this.initTable(),this.initEcharts(),this.initTypeit(),this.initMapbox(),this.initPangu()),this.initThemeColor(),this.initSVGIcon(),this.initMenu(),this.initSwitchTheme(),this.initSearch(),this.initBreadcrumb(),this.initCookieconsent(),this.initSiteTime(),this.initServiceWorker(),this.initWatermark(),this.initAutoMark(),this.initReward(),this.initPostChatUser(),window.setTimeout(()=>{this.initComment(),this.config.encryption?.all||(this.fixTocScroll(),this.initToc(),this.initTocListener()),this.onScroll(),this.onResize(),this.onClickMask(),this.beforeprint()},100)}catch(e){console.error(e)}console.log(`%c FixIt ${this.config.version} %c https://github.com/hugo-fixit %c`,"background: #FF735A;border:1px solid #FF735A; padding: 1px; border-radius: 2px 0 0 2px; color: #fff;","border:1px solid #FF735A; padding: 1px; border-radius: 0 2px 2px 0; color: #FF735A;","background:transparent;")}},P=()=>{window.fixit=new B,window.fixit.init()};document.readyState!=="loading"?P():document.addEventListener("DOMContentLoaded",P,!1);})();

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.