代码拉取完成,页面将自动刷新
同步操作将从 Yaohaixiao/outline.js 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).Anchors=e()}(this,(function(){"use strict";const t=t=>"string"==typeof t,e=(t,e)=>{const r=Object.prototype.hasOwnProperty;return t&&r.call(t,e)},r=t=>Object.prototype.toString.apply(t),s=t=>"function"==typeof t||"[object Function]"===r(t),n=t=>("[object Object]"===r(t)||"object"==typeof t||s(t))&&null!==t,i={},o=t=>e(i,t)&&i[t].length>0,l=(t,e=!0)=>e?o(t):(t=>{let e=o(t),r=t.lastIndexOf(".");for(;!e&&-1!==r;)r=(t=t.substring(0,r)).lastIndexOf("."),e=o(t);return e})(t),c=(t,e,s=!0)=>{const n=t=>{if(!o(t))return!1;i[t].forEach((t=>{const s=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]","[object BigInt64Array]","[object BigUint64Array]"].indexOf(r(e))>-1?e.toString():e;t.callback.call(t.context||t,s)}))},c=()=>{let e=t,r=t.lastIndexOf(".");for(;-1!==r;)e=e.substring(0,r),r=e.lastIndexOf("."),n(e);n(t),n("*")};if(!l(t))return!1;s?setTimeout(c,10):c()},a=(()=>{let t=0;return e=>(t+=1,e?e+"-"+t:"guid-"+t)})(),h=t=>{if(!e(i,t))return!1;delete i[t]},u=(t,e)=>{if(!l(t))return!1;e?(t=>{const e=Object.keys(i);if(!t||e.length<1)return!1;e.forEach((e=>{const r=i[e];let s;r.forEach(((e,n)=>{e.callback!==t&&e.token!==t||(s=e.topic,r.splice(-1,n))})),r.length<1&&h(s)}))})(e):h(t)};class d{constructor(t){this.attrs={},t&&this.initialize(t)}initialize(t){return this.attr(t).render().addListeners(),this}attr(r,s){const i=this.attrs;return t(r)?s&&e(i,r)?(i[r]=s,this):i[r]:n(r)?(o=i,l=r,Object.keys(l).forEach((t=>{e(l,t)&&(o[t]=l[t])})),this):0===arguments.length?i:this;var o,l}render(){return this}destroy(){return this.removeListeners(),this}reload(t){return this.destroy().initialize(this.attr(t)),this}$emit(t,e){return c(t,e),this}$on(t,e){return((t,e,r=null)=>{const n=a();let o="symbol"==typeof t?t.toString():t;s(e)&&(i[o]||(i[o]=[]),i[o].push({topic:o,callback:e,context:r,token:n}))})(t,e,this),this}$off(t,e){return u(t,e),this}addListeners(){return this}removeListeners(){return this}}const p=t=>!!(n(t)&&t.nodeName&&t.tagName&&1===t.nodeType),m=t=>t*t,f=(e=null)=>{let r,s;return e?t(e)?s=document.querySelector(e):p(e)&&(s=e):(r=document.querySelectorAll("html,body"),s=r[0].scrollTop-r[1].scrollTop>=0?r[0]:r[1]),s},y=t=>{let e=t.offsetTop;return null!==t.offsetParent&&(e+=y(t.offsetParent)),e},g=(t,e="")=>{const r=e.replace(/^>/i,"");return!!(e&&r&&t)&&(t.matches?t.matches(r):!!t.msMatchesSelector&&t.msMatchesSelector(r))},b=t=>t.host&&t!==document&&t.host.nodeType?t.host:t.parentNode,v=["focusout","blur","focusin","focus","load","unload","mouseenter","mouseleave"],$=(t,e,r)=>{const s=v.indexOf(e)>-1;r._delegateListener&&delete(r=r._delegateListener)._delegateListener,function(t,e,r){const s=t._listeners;let n=-1;if(s.length<1)return!1;s.forEach(((t,s)=>{const i=t.fn;e===t.type&&(n=s,i===r&&(n=s))})),n>-1&&s.splice(n,1)}(t,e,r),t.removeEventListener(e,r,s)},x=function(e,r,s=!1){const n=t(e)?document.querySelector(e):e,i=n.childNodes,o=((e,r)=>{let s=e._listeners||[];return t(r)&&r&&(s=s.filter((t=>t.type===r))),s})(n,r);o.forEach((t=>{$(n,t.type,t.fn)})),(s||!0===r||1===arguments.length)&&n&&i&&i.forEach((t=>{p(t)&&x(t,r,s)}))},A=(t,e,r)=>{if(!s(r))return x(t,e);$(t,e,r)},E=(t,e,r,s,n,i,o=!1)=>{const l=v.indexOf(r)>-1,c=function(l){const a=function(t){const e=t.target;return(r=e)&&3===r.nodeType?r.parentNode:r;var r}(l),h=((t,e,r,s)=>{const n=r||document;if(!t)return null;do{if(null!=e&&(e.startsWith(">")?t.parentNode===n&&g(t,e):g(t,e))||s&&t===n)return t;if(t===n)break}while(t=b(t))})(a,e,t);let u=i||t;l.delegateTarget=h,!0===i&&(u=n),h&&(!0===o&&A(t,r,c),s.call(u,l,n))};t._listeners||(t._listeners=[]),t._listeners.push({el:t,selector:e,type:r,fn:c,data:n,context:i,capture:l}),s._delegateListener=c,t.addEventListener(r,c,l)},L=t=>Array.isArray?Array.isArray(t):"[object Array]"===r(t),T=['<symbol id="outline-icon-up" viewBox="0 0 1024 1024"><path d="M494.784 261.696c0.832-0.448 1.536-1.216 2.368-1.536a38.72 38.72 0 0 1 46.08 8.256l277.824 302.272a41.92 41.92 0 0 1-1.536 58.048 39.104 39.104 0 0 1-56.448-1.6L513.728 355.904 260.736 626.048a39.104 39.104 0 0 1-56.448 1.088 41.6 41.6 0 0 1-1.088-57.984L483.84 269.696c0.512-0.512 1.344-0.768 1.92-1.408l1.088-1.344c2.368-2.496 5.312-3.648 8-5.248z"></path></symbol>','<symbol id="outline-icon-down" viewBox="0 0 1024 1024"><path d="M494.784 762.304c0.832 0.448 1.536 1.216 2.368 1.536 15.232 7.488 33.92 4.992 46.08-8.256l277.824-302.272a41.92 41.92 0 0 0-1.536-58.048 39.104 39.104 0 0 0-56.448 1.6l-249.344 271.232-252.992-270.144a39.104 39.104 0 0 0-56.448-1.088 41.6 41.6 0 0 0-1.088 57.984l280.576 299.456c0.512 0.512 1.344 0.768 1.92 1.408l1.088 1.344c2.368 2.496 5.312 3.648 8 5.248z"></path></symbol>','<symbol id="outline-icon-menu" viewBox="0 0 1024 1024"><path d="M320 256h640V128H320zM320 576h640V448H320zM320 896h640v-128H320zM64 256h128V128H64zM64 576h128V448H64zM64 896h128v-128H64z"></path></symbol>','<symbol id="outline-icon-file" viewBox="0 0 1024 1024"><path d="M320 640h256v128H320z"></path><path d="M320 448h384v128H320z"></path><path d="M640 0l320 320v557.696C960 958.528 909.824 1024 848 1024H176C114.176 1024 64 958.528 64 877.696V146.304C64 65.472 114.176 0 176 0H640z m0 128H192v768h640V320h-192V128z"></path></symbol>','<symbol id="outline-icon-hash" viewBox="0 0 24 24"><path d="M14.216 10l-0.444 4h-3.988l0.444-4zM15.006 2.89l-0.568 5.11h-3.988l0.543-4.89c0.061-0.549-0.335-1.043-0.883-1.104s-1.043 0.335-1.104 0.884l-0.568 5.11h-4.438c-0.552 0-1 0.448-1 1s0.448 1 1 1h4.216l-0.444 4h-3.772c-0.552 0-1 0.448-1 1s0.448 1 1 1h3.549l-0.543 4.89c-0.061 0.549 0.335 1.043 0.883 1.104s1.043-0.335 1.104-0.883l0.569-5.111h3.988l-0.543 4.89c-0.061 0.549 0.335 1.043 0.883 1.104s1.043-0.335 1.104-0.883l0.568-5.111h4.438c0.552 0 1-0.448 1-1s-0.448-1-1-1h-4.216l0.444-4h3.772c0.552 0 1-0.448 1-1s-0.448-1-1-1h-3.549l0.543-4.89c0.061-0.549-0.335-1.043-0.883-1.104s-1.043 0.335-1.104 0.883z"></path></symbol>','<symbol id="outline-icon-close" viewBox="0 0 1024 1024"><path d="M536.96 491.648L310.592 265.344a32 32 0 1 0-45.248 45.248L491.584 536.96l-226.304 226.304a32 32 0 0 0 45.312 45.248l226.24-226.304 226.304 226.304a32 32 0 0 0 45.248-45.248L582.144 536.896l226.304-226.24a32 32 0 0 0-45.248-45.248L536.896 491.584z"></path></symbol>','<symbol id="outline-icon-homepage" viewBox="0 0 26 28"><path d="M22 15.5v7.5c0 0.547-0.453 1-1 1h-6v-6h-4v6h-6c-0.547 0-1-0.453-1-1v-7.5c0-0.031 0.016-0.063 0.016-0.094l8.984-7.406 8.984 7.406c0.016 0.031 0.016 0.063 0.016 0.094zM25.484 14.422l-0.969 1.156c-0.078 0.094-0.203 0.156-0.328 0.172h-0.047c-0.125 0-0.234-0.031-0.328-0.109l-10.813-9.016-10.813 9.016c-0.109 0.078-0.234 0.125-0.375 0.109-0.125-0.016-0.25-0.078-0.328-0.172l-0.969-1.156c-0.172-0.203-0.141-0.531 0.063-0.703l11.234-9.359c0.656-0.547 1.719-0.547 2.375 0l3.813 3.187v-3.047c0-0.281 0.219-0.5 0.5-0.5h3c0.281 0 0.5 0.219 0.5 0.5v6.375l3.422 2.844c0.203 0.172 0.234 0.5 0.063 0.703z"></path></symbol>','<symbol id="outline-icon-github" viewBox="0 0 24 28"><path d="M12 2c6.625 0 12 5.375 12 12 0 5.297-3.437 9.797-8.203 11.391-0.609 0.109-0.828-0.266-0.828-0.578 0-0.391 0.016-1.687 0.016-3.297 0-1.125-0.375-1.844-0.812-2.219 2.672-0.297 5.484-1.313 5.484-5.922 0-1.313-0.469-2.375-1.234-3.219 0.125-0.313 0.531-1.531-0.125-3.187-1-0.313-3.297 1.234-3.297 1.234-0.953-0.266-1.984-0.406-3-0.406s-2.047 0.141-3 0.406c0 0-2.297-1.547-3.297-1.234-0.656 1.656-0.25 2.875-0.125 3.187-0.766 0.844-1.234 1.906-1.234 3.219 0 4.594 2.797 5.625 5.469 5.922-0.344 0.313-0.656 0.844-0.766 1.609-0.688 0.313-2.438 0.844-3.484-1-0.656-1.141-1.844-1.234-1.844-1.234-1.172-0.016-0.078 0.734-0.078 0.734 0.781 0.359 1.328 1.75 1.328 1.75 0.703 2.141 4.047 1.422 4.047 1.422 0 1 0.016 1.937 0.016 2.234 0 0.313-0.219 0.688-0.828 0.578-4.766-1.594-8.203-6.094-8.203-11.391 0-6.625 5.375-12 12-12zM4.547 19.234c0.031-0.063-0.016-0.141-0.109-0.187-0.094-0.031-0.172-0.016-0.203 0.031-0.031 0.063 0.016 0.141 0.109 0.187 0.078 0.047 0.172 0.031 0.203-0.031zM5.031 19.766c0.063-0.047 0.047-0.156-0.031-0.25-0.078-0.078-0.187-0.109-0.25-0.047-0.063 0.047-0.047 0.156 0.031 0.25 0.078 0.078 0.187 0.109 0.25 0.047zM5.5 20.469c0.078-0.063 0.078-0.187 0-0.297-0.063-0.109-0.187-0.156-0.266-0.094-0.078 0.047-0.078 0.172 0 0.281s0.203 0.156 0.266 0.109zM6.156 21.125c0.063-0.063 0.031-0.203-0.063-0.297-0.109-0.109-0.25-0.125-0.313-0.047-0.078 0.063-0.047 0.203 0.063 0.297 0.109 0.109 0.25 0.125 0.313 0.047zM7.047 21.516c0.031-0.094-0.063-0.203-0.203-0.25-0.125-0.031-0.266 0.016-0.297 0.109s0.063 0.203 0.203 0.234c0.125 0.047 0.266 0 0.297-0.094zM8.031 21.594c0-0.109-0.125-0.187-0.266-0.172-0.141 0-0.25 0.078-0.25 0.172 0 0.109 0.109 0.187 0.266 0.172 0.141 0 0.25-0.078 0.25-0.172zM8.937 21.438c-0.016-0.094-0.141-0.156-0.281-0.141-0.141 0.031-0.234 0.125-0.219 0.234 0.016 0.094 0.141 0.156 0.281 0.125s0.234-0.125 0.219-0.219z"></path></symbol>','<symbol id="outline-icon-issues" viewBox="0 0 24 28"><path d="M25.5 15c0 0.547-0.453 1-1 1h-3.5c0 1.953-0.422 3.422-1.047 4.531l3.25 3.266c0.391 0.391 0.391 1.016 0 1.406-0.187 0.203-0.453 0.297-0.703 0.297s-0.516-0.094-0.703-0.297l-3.094-3.078s-2.047 1.875-4.703 1.875v-14h-2v14c-2.828 0-4.891-2.063-4.891-2.063l-2.859 3.234c-0.203 0.219-0.469 0.328-0.75 0.328-0.234 0-0.469-0.078-0.672-0.25-0.406-0.375-0.438-1-0.078-1.422l3.156-3.547c-0.547-1.078-0.906-2.469-0.906-4.281h-3.5c-0.547 0-1-0.453-1-1s0.453-1 1-1h3.5v-4.594l-2.703-2.703c-0.391-0.391-0.391-1.016 0-1.406s1.016-0.391 1.406 0l2.703 2.703h13.188l2.703-2.703c0.391-0.391 1.016-0.391 1.406 0s0.391 1.016 0 1.406l-2.703 2.703v4.594h3.5c0.547 0 1 0.453 1 1zM18 6h-10c0-2.766 2.234-5 5-5s5 2.234 5 5z"></path></symbol>','<symbol id="outline-icon-tags" viewBox="0 0 26 28"><path d="M7 7c0-1.109-0.891-2-2-2s-2 0.891-2 2 0.891 2 2 2 2-0.891 2-2zM23.672 16c0 0.531-0.219 1.047-0.578 1.406l-7.672 7.688c-0.375 0.359-0.891 0.578-1.422 0.578s-1.047-0.219-1.406-0.578l-11.172-11.188c-0.797-0.781-1.422-2.297-1.422-3.406v-6.5c0-1.094 0.906-2 2-2h6.5c1.109 0 2.625 0.625 3.422 1.422l11.172 11.156c0.359 0.375 0.578 0.891 0.578 1.422zM29.672 16c0 0.531-0.219 1.047-0.578 1.406l-7.672 7.688c-0.375 0.359-0.891 0.578-1.422 0.578-0.812 0-1.219-0.375-1.75-0.922l7.344-7.344c0.359-0.359 0.578-0.875 0.578-1.406s-0.219-1.047-0.578-1.422l-11.172-11.156c-0.797-0.797-2.312-1.422-3.422-1.422h3.5c1.109 0 2.625 0.625 3.422 1.422l11.172 11.156c0.359 0.375 0.578 0.891 0.578 1.422z"></path></symbol>'],M=(e,r="icon")=>t(e)?((t,e="icon")=>{const r=/id="(.*?)"/,s=/^(\w+)-/;return T.find((n=>{const i=r.exec(n)[1];return s.exec(i)[1]===e&&i===("icon"===e?`${e}-${t}`:`${e}-icon-${t}`)}))})(e,r):[...T],z=(e="")=>{const r=document.body;let s=document.querySelector("#outline-icons"),n=[];(e=>{if(!e)return!1;L(e)&&e.length>0?e.forEach((e=>{-1===T.indexOf(e)&&t(e)&&T.push(e)})):t(e)&&T.push(e)})(e),n=M(),s?s.innerHTML=n.join(""):(s=document.createElement("div"),s.innerHTML=`<svg id="outline-icons" aria-hidden="true" style="position:absolute;display:none;width:0;height:0;overflow:hidden;">${n.join("")}</svg>`,r.insertBefore(s.firstChild,r.firstChild))},w=e=>!!t(e)&&e.replace(/(^\s+)|(\s+$)/g,""),j=t=>{return!(!n(t)||!(p(t)||(t=>!(!n(t)||"[object NodeList]"!==r(t)))(t)||(e=t,n(e)&&"[object DocumentFragment]"===r(e))||(t=>!(!n(t)||!("[object Text]"===r(t)||t.tagName&&3===t.nodeType)))(t)));var e},S=(t,e,r)=>{let s=t.tagName.toLowerCase();switch(e){case"style":t.style.cssText=r;break;case"value":"input"===s||"textarea"===s?t.value=r:t.setAttribute(e,r);break;case"className":t.className=r;break;default:t.setAttribute(e,r)}},H=e=>{const r=new RegExp("^\\s*(?:<\\?xml[^>]*>\\s*)?(?:<\\!doctype svg[^>]*\\s*(?:\\[?(?:\\s*<![^>]*>\\s*)*\\]?)*[^>]*>\\s*)?<svg[^>]*>[^]*<\\/svg>\\s*$\\s*$","i");return t(e)&&r.test(e)},N=(e,r={})=>((e,r={})=>{const s=r.size||0,n=r.color||"",i=r.iconSet||"",o=L(s)?s[0]:s,l=L(s)?s[1]:s,c=s?`width:${o}px;height:${l}px;`:"",a=n?c+`color:${n}`:c,h=document.createElement("i");let u,d="",p="";return t(e)?(H(e)?p=e:(d=i&&"icon"!==i?`xlink:href="#${i}-icon-${e}"`:`xlink:href="#icon-${e}"`,p=`<svg aria-hidden="true" class="outline-icon__svg" style="${a}"><use ${d}></use></svg>`),h.className="outline-icon",h.innerHTML=p,H(e)&&(u=h.querySelector("svg"),u.setAttribute("aria-hidden","true"),u.setAttribute("xmlns","http://www.w3.org/2000/svg"),u.setAttribute("class","outline-icon__svg"),u.setAttribute("width","200"),u.setAttribute("height","200"),u.style.cssText=a),h):null})(e,r),_=(r,s,i)=>{const o="outline-heading",l=i.hasAnchor||!0,c=i.isAtStart||!0,a=i.showCode||!1,h=i.chapterCode||"",u=i.anchorURL||"",d=`heading-${s}`,p={id:d,className:c?`${o} ${o}_start`:o,"data-id":s},m=Object.keys(p),f=w(r.innerHTML);let y,g;if(m.forEach((t=>{S(r,t,p[t])})),a&&(r.innerHTML=h+" "+f),!l)return!1;g=N("hash",{iconSet:"outline"}),y=((r,s,i)=>{const o=document.createDocumentFragment(),l=document.createElement(r),c=e=>j(e)||t(e),a=e=>{let r;if(!c(e))return!1;j(e)?r=e:t(e)&&(r=document.createTextNode(e)),o.appendChild(r)};return n(s)?Object.keys(s).forEach((t=>{e(s,t)&&S(l,t,s[t])})):L(s)&&s.every((t=>c(t)))&&s.forEach((t=>{a(t)})),L(i)?i.forEach((t=>{a(t)})):a(i),l.appendChild(o),l})("a",{id:`anchor-${s}`,className:`${o}__anchor anchor-${s}`,href:u||`#${d}`,target:u?"_blank":"self","data-id":s},g),r.appendChild(y)},k=(t,e)=>{let r,s=t.className;if(!s||!((t,e)=>{const r=new RegExp("(\\s|^)"+e+"(\\s|$)");let s,n;return!!p(t)&&(s=t.className,!!s&&(n=t.classList,n?.contains?t.classList.contains(e):!!r.exec(s)))})(t,e))return!1;r=t.classList,r?.remove?r.remove(e):(s=w(s.replace(e,"")),t.className=s)},C=(e,r=!0,s=!0)=>{const n="outline-heading",i=e.innerHTML;let o;if(e.innerHTML=i.replace(/^\d+(\.?\d+)*\s?/gi,""),e.removeAttribute("id"),e.removeAttribute("data-id"),k(e,n),!r)return!1;var l;o=e.querySelector(`.${n}__anchor`),s&&k(e,`${n}_start`),l=w(e.className),t(l)&&""===l&&e.removeAttribute("class"),e.removeChild(o)},O=(e,r=!0,n=null)=>{let i=1,o=0,l="";const c=[];return e.forEach(((e,r)=>{const a=e.tagName,h=a.replace(/h/i,"");let u=parseInt(h,10),d=-1;var p;u>i?(o+=1,d=1===o?-1:r-1):u===i||u<i&&u>o?1===u?(o=1,d=-1):d=c[r-1].pid:u<=o&&(1===u?o=1:(o-=i-u,o<=1&&(o=1)),d=1===o?-1:((t,e,r)=>{let s,n,i=t[r-1];for(n=0;n<e;n+=1)s=i.pid,i=t[s];return s=i.pid,s})(c,i-u,r)),i=u,p=w(e.innerHTML),l=t(p)?p.replace(/<\/?[^>]+(>|$)/g,""):"",s(n)&&(l=n(l)),c.push({id:r,pid:d,level:o,rel:`heading-${r}`,text:l,tagName:a})})),r?(t=>{const e={};return t.forEach((t=>{const r=JSON.stringify((t=>[t.pid])(t));e[r]=e[r]||[],e[r].push(t),t.index=e[r].length,-1===t.pid&&(t.code=String(t.index))})),Object.keys(e).forEach((t=>{e[t].forEach((t=>{const r=e[`[${t.id}]`];if(!r||!L(r))return!1;r.forEach((e=>{e.code=t.code+"."+e.index}))}))})),t})(c):c};class B extends d{constructor(t){super(),this.attrs=B.DEFAULTS,this.$articleElement=null,this.$scrollElement=null,this.$headings=[],this.chapters=[],t&&this.initialize(t)}initialize(e){const r=this.attr("showCode")||!0;let n,i,o,l,c;return this.attr(e),c=this.attr("articleElement"),i=this.attr("scrollElement"),o=this.attr("selector"),n=this.attr("created"),t(c)?l=document.querySelector(c):p(c)&&(l=c),l?(this.$articleElement=l,this.$scrollElement=f(i),this.$headings=[...l.querySelectorAll(o)],this.$headings.length<1||(this.chapters=O(this.$headings,r,this.attr("chapterTextFilter")),s(n)&&n.call(this),this.render().addListeners()),this):this}getChapters(t=!1){const e=this.chapters;return t?((t,e,r)=>{const s={},n=[];return t.forEach(((t,r)=>{s[t[e]]=r,t.children=[]})),t.forEach((e=>{const i=t[s[e[r]]];-1!==e[r]?i.children.push(e):n.push(e)})),n})(e,"id","pid"):e}count(){return this.chapters.length}render(){const t=this.attr("mounted"),e=this.attr("hasAnchor"),r=this.attr("isAtStart"),n=this.attr("showCode"),i=this.attr("anchorURL"),o=this.$headings,l=this.getChapters();return z(),o.forEach(((t,s)=>{const o=l[s].code;_(t,s,{hasAnchor:e,isAtStart:r,showCode:n,chapterCode:o,anchorURL:i})})),s(t)&&t.call(this),this}scrollTo(t,e){return((t,e,r)=>{const n=f(t);let i=n.scrollTop,o=0;const l=e-i,c=n.scrollHeight,a=e-c<=0?e:c,h=t=>(s(r)&&r(t),!1),u=()=>{if(o+=1,l<0){if(i-=m(o),n.scrollTop=i,i<=e)return n.scrollTop=e,h(e)}else if(i+=m(o),n.scrollTop=i,i>=a)return n.scrollTop=a,h(a);requestAnimationFrame(u)};requestAnimationFrame(u)})(this.$scrollElement,t,e),this}destroy(){const t=this.attr("hasAnchor"),e=this.attr("isAtStart"),r=this.attr("beforeDestroy"),n=this.attr("afterDestroy"),i=this.$headings;return s(r)&&r.call(this),this.removeListeners(),i.forEach((r=>{C(r,t,e)})),this.attr(B.DEFAULTS),this.$articleElement=null,this.$scrollElement=null,this.$headings=[],this.chapters=[],s(n)&&n.call(this),this}onAnchorTrigger(t){const e=this.attr("anchorURL"),r=this.attr("afterScroll"),n=this.attr("stickyHeight"),i=t.delegateTarget.parentNode,o=y(i)-(n+10),l=this.$scrollElement,c=l.scrollHeight-l.clientHeight;return this.scrollTo(o,(()=>{s(r)&&r.call(this,"anchor"),((t,e=300)=>{!!s(t)&&setTimeout((()=>{t()}),e)})((()=>{this.$emit("toolbar:update",{top:o,min:0,max:c})}))})),e||function(t){t.stopPropagation(),t.preventDefault()}(t),this}addListeners(){const t=this.$articleElement;return E(t,".outline-heading__anchor","click",this.onAnchorTrigger,this,!0),this}removeListeners(){const t=this.$articleElement;return A(t,"click",this.onAnchorTrigger),this}}return B.DEFAULTS={scrollElement:"html,body",articleElement:"#article",selector:"h1,h2,h3,h4,h5,h6",stickyHeight:0,anchorURL:"",hasAnchor:!0,isAtStart:!0,showCode:!1,created:null,mounted:null,afterScroll:null,beforeDestroy:null,afterDestroy:null,chapterTextFilter:null},B}));
//# sourceMappingURL=anchors.min.js.map
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。