PageSourceSearch

https://20030327.xyz/js/thoughts.0642ae5c90e6e4c05a5bcb9d8a3e7839a0fbe784ab1a4fed8e84e78b6688e806.js

js 20030327.xyz collected 2026-10-08 08:26:01 UTC 9,151 bytes, 1 lines download raw bytes

1(()=>{function P(o){if(!o)return;var d=window.matchMedia("(max-width: 767px)");function u(a){return a.querySelectorAll(":scope > .tk-comment").length}function l(a){return a&&(a.classList.contains("tk-expand-wrap")||a.classList.contains("tk-collapse-wrap"))&&!a.classList.contains("tk-replies-toggle-wrap")}function c(a){for(var t=[],n=[],e=a.nextElementSibling;e;){if(e.classList.contains("tk-replies-toggle-wrap")){var r=e.querySelector(".tk-replies-toggle");r&&t.push(r),e=e.nextElementSibling;continue}if(e.classList.contains("tk-replies-toggle")){t.push(e),e=e.nextElementSibling;continue}if(l(e)){n.push(e),e=e.nextElementSibling;continue}if(e.classList.contains("tk-expand")&&!e.classList.contains("tk-replies-toggle")){n.push(e),e=e.nextElementSibling;continue}break}return{toggles:t,natives:n}}function h(a){a.hidden=!0,a.style.display="none",a.style.pointerEvents="none",a.setAttribute("aria-hidden","true"),a.classList.add("tk-replies-native-expand"),a.tabIndex=-1}function C(a){a.forEach(h)}function I(a){var t=document.createElement("div");t.className="tk-expand-wrap tk-replies-toggle-wrap";var n=document.createElement("button");return n.type="button",n.className="tk-replies-toggle",t.appendChild(n),a.insertAdjacentElement("afterend",t),n}function v(a,t,n){var e=t.classList.contains("tk-replies-expand");a.textContent=e?"\u6536\u8D77\u56DE\u590D":"\u5C55\u5F00 "+n+" \u6761\u56DE\u590D",a.setAttribute("aria-expanded",e?"true":"false");var r=a.closest(".tk-replies-toggle-wrap");r&&(r.hidden=!1,r.style.display="",r.removeAttribute("aria-hidden")),a.hidden=!1,a.style.display="",a.removeAttribute("aria-hidden")}function x(a,t){if(t){a.classList.remove("tk-replies-expand"),a.dataset.tkRepliesCollapsed="true";return}a.classList.add("tk-replies-expand"),delete a.dataset.tkRepliesCollapsed}function L(a,t){var n=u(a),e=a.classList.contains("tk-replies-expand");x(a,e),v(t,a,n)}function A(a,t){if(t.dataset.tkReplyBound)return;t.dataset.tkReplyBound="1",t.classList.contains("tk-expand")&&t.classList.remove("tk-expand");var n=0;function e(r){r.preventDefault(),r.stopPropagation(),r.stopImmediatePropagation()}t.addEventListener("touchend",function(r){e(r),n=Date.now(),L(a,t)},{capture:!0,passive:!1}),t.addEventListener("click",function(r){if(Date.now()-n<500){e(r);return}e(r),L(a,t)},!0)}function R(a,t){C(t.natives);var n=t.toggles[0]||null;if(t.toggles.length>1&&t.toggles.slice(1).forEach(function(r){var i=r.closest(".tk-replies-toggle-wrap");i&&i!==n.closest(".tk-replies-toggle-wrap")?i.remove():r!==n&&r.remove()}),!n)n=I(a);else if(!n.closest(".tk-replies-toggle-wrap")){var e=document.createElement("div");e.className="tk-expand-wrap tk-replies-toggle-wrap",n.parentNode.insertBefore(e,n),e.appendChild(n)}return n.classList.contains("tk-replies-toggle")||n.classList.add("tk-replies-toggle"),n}function E(a){if(!(!d.matches||!a)){var t=a.querySelector(":scope > .tk-replies");if(!(!t||!u(t))){var n=a.querySelector(":scope > .tk-content");if(n){n.classList.add("tk-content-expand");for(var e=n.nextElementSibling;e&&e!==t;)(l(e)||e.classList.contains("tk-replies-native-expand"))&&h(e),e=e.nextElementSibling}}}}function T(a){var t=u(a);if(t){a.dataset.tkRepliesManaged?a.dataset.tkRepliesCollapsed==="true"&&a.classList.remove("tk-replies-expand"):(a.dataset.tkRepliesManaged="1",x(a,!0));var n=a.closest(".tk-main");n&&a===n.querySelector(":scope > .tk-replies")&&E(n);var e=c(a),r=R(a,e);A(a,r),v(r,a,t)}}function f(){o.querySelectorAll(".tk-replies").forEach(T)}f(),requestAnimationFrame(f);var w=!1,b=new MutationObserver(function(){w||(w=!0,requestAnimationFrame(function(){w=!1,f()}))});return b.observe(o,{childList:!0,subtree:!0}),window.setTimeout(f,150),window.setTimeout(f,500),window.setTimeout(f,1200),typeof d.addEventListener=="function"&&d.addEventListener("change",f),b}var y=null;function B(o,d){return new Promise(function(u,l){if(typeof twikoo<"u"){u();return}var c=0,h=window.setInterval(function(){typeof twikoo<"u"?(window.clearInterval(h),u()):++c>
1(o||120)&&(window.clearInterval(h),l(new Error("Twikoo load timeout")))},d||50)})}function F(o){return typeof twikoo<"u"?Promise.resolve():!o||!o.jsUrl?Promise.reject(new Error("Missing Twikoo config")):y||(y=new Promise(function(d,u){if(o.cssUrl&&!document.querySelector('link[data-twikoo-css="1"]')){var l=document.createElement("link");l.rel="stylesheet",l.href=o.cssUrl,l.setAttribute("data-twikoo-css","1"),document.head.appendChild(l)}if(document.querySelector('script[data-twikoo-js="1"]')){B().then(d).catch(u);return}var c=document.createElement("script");c.src=o.jsUrl,c.defer=!0,c.setAttribute("data-twikoo-js","1"),c.addEventListener("load",function(){B().then(d).catch(u)}),c.addEventListener("error",function(){y=null,u(new Error("Twikoo script failed"))}),document.head.appendChild(c)}),y)}function N(o,d){F(o).then(d).catch(function(){})}(function(){"use strict";var o=!1;function d(){return window.matchMedia("(prefers-reduced-motion: reduce)").matches}function u(t){var n=Date.now(),e=t.getTime(),r=Math.max(0,n-e),i=Math.floor(r/1e3),s=Math.floor(i/60),m=Math.floor(s/60),p=Math.floor(m/24),k=Math.floor(p/30),g=Math.floor(p/365);return i<60?"\u521A\u521A":s<60?s+" \u5206\u949F\u524D":m<24?m+" \u5C0F\u65F6\u524D":p<30?p+" \u5929\u524D":k<12?k+" \u4E2A\u6708\u524D":g<2?"1 \u5E74\u524D":g+" \u5E74\u524D"}function l(t){var n=t||document;n.querySelectorAll("[data-relative-time]").forEach(function(e){var r=e.closest("[data-date]"),i=r?r.getAttribute("data-date"):e.getAttribute("datetime");if(i){var s=new Date(i);isNaN(s.getTime())||(e.textContent=u(s))}})}function c(t){document.dispatchEvent(new CustomEvent("post-prose:init",{detail:{root:t||document}}))}function h(){var t=document.querySelector("[data-thoughts]");return t?{cssUrl:t.getAttribute("data-twikoo-css")||"",jsUrl:t.getAttribute("data-twikoo-cdn")||""}:null}function C(t){N(h(),t)}function I(t){if(!(!t||t.dataset.twikooReady==="1")){var n=t.getAttribute("data-twikoo-el"),e=n?document.getElementById(n):null,r=t.getAttribute("data-twikoo-env");!e||!r||typeof twikoo>"u"||twikoo.init({envId:r,el:"#"+n,path:t.getAttribute("data-twikoo-path")||location.pathname,lang:t.getAttribute("data-twikoo-lang")||"zh-CN",onCommentLoaded:function(){t.classList.add("is-ready"),t.dataset.twikooReady="1",P(t)}})}}function v(t,n){if(!(!t||t.hidden)){var e=n||{};t.hidden=!0,t.classList.remove("is-open");var r=t.id,i=r?document.querySelector('[data-thought-comment-trigger][data-target="'+r+'"]'):null;i&&i.setAttribute("aria-expanded","false"),e.updateHash!==!1&&r&&location.hash==="#"+r&&history.replaceState&&history.replaceState(null,"",location.pathname+location.search)}}function x(t){document.querySelectorAll(".thought-card__comments.is-open").forEach(function(n){n!==t&&v(n,{updateHash:!1})})}function L(t){return!!(t&&!t.hidden&&t.classList.contains("is-open"))}function A(t,n){if(t){var e=n||{};x(t),t.hidden=!1,t.classList.add("is-open");var r=t.id,i=r?document.querySelector('[data-thought-comment-trigger][data-target="'+r+'"]'):null;i&&i.setAttribute("aria-expanded","true");var s=t.querySelector(".thought-card__comments-host");C(function(){I(s)}),e.updateHash!==!1&&r&&history.replaceState&&history.replaceState(null,"","#"+r),e.scroll!==!1&&window.requestAnimationFrame(function(){t.scrollIntoView({behavior:e.smooth===!1||d()?"auto":"smooth",block:"start"})})}}function R(t,n){if(t){if(L(t)){v(t,n);return}A(t,n)}}function E(t){var n=t||document;n.querySelectorAll("[data-thought-comment-trigger]").forEach(function(e){e.dataset.commentBound!=="1"&&(e.dataset.commentBound="1",e.
1setAttribute("aria-expanded","false"),e.addEventListener("click",function(r){r.preventDefault();var i=e.getAttribute("data-target");R(i?document.getElementById(i):null)}))})}function T(){var t=location.hash?location.hash.slice(1):"";!t||t.indexOf("thought-comments-")!==0||A(document.getElementById(t),{smooth:!1})}function f(t){t.querySelectorAll(".thought-card").forEach(function(n){n.classList.add("thought-card--instant")})}function w(){var t=document.querySelector("[data-thoughts]");if(t){if(d()){t.classList.add("is-visible");return}requestAnimationFrame(function(){t.classList.add("is-visible")})}}function b(){if(o)return;o=!0;var t=document.getElementById("thoughts-feed"),n=document.getElementById("thoughts-load"),e=document.getElementById("thoughts-sentinel"),r=document.getElementById("thoughts-loading"),i=document.getElementById("thoughts-end"),s=n?Array.prototype.slice.call(n.querySelectorAll("template.thoughts-chunk")):[];if(!t||!n||!s.length){i&&(!n||!s.length)&&(i.hidden=!1);return}var m=0,p=!1,k=!1,g=null;function M(){k=!0,r&&(r.hidden=!0),i&&(i.hidden=!1),g?.disconnect()}function D(){if(!(p||k)){if(m>=s.length){M();return}p=!0,r&&(r.hidden=!1);var q=s[m];m+=1;var S=q.content.cloneNode(!0);f(S),t.appendChild(S),l(t),c(t),E(t),p=!1,r&&(r.hidden=!0),m>=s.length&&M()}}g=new IntersectionObserver(function(q){q.some(function(S){return S.isIntersecting})&&D()},{root:null,rootMargin:"180px 0px",threshold:0}),e&&g.observe(e)}function a(){w(),l(),E(),b(),T()}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",a):a()})();})();

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.