1!function(){"use strict";var t={apiEndpoint:"/viewsource/api/viewSource",isLoading:!1,sourceHtml:"",sourceUrl:"",isWrapped:!1,isNavFixed:!1,currentViewId:null,splitWords:null,init:function(){var t=this,e=document.getElementById("view-source-btn"),n=document.getElementById("url-input"),i=(document.getElementById("ua-select"),document.getElementById("close-error-btn"));i&&i.addEventListener("click",function(){t.hideError()}),e&&e.addEventListener("click",function(){t.handleSubmitWithUrlParams()}),n&&n.addEventListener("keypress",function(e){"Enter"!==e.key||t.isLoading||t.handleSubmitWithUrlParams()});var a=document.getElementById("toggle-wrap-btn"),o=document.getElementById("copy-code-btn"),r=document.getElementById("download-code-btn");a&&a.addEventListener("click",function(){t.toggleWrap()}),o&&o.addEventListener("click",function(){t.copyCode()}),r&&r.addEventListener("click",function(){t.downloadCode()}),n&&(n.addEventListener("focus",function(){this.parentElement.classList.add("border-blue-500")}),n.addEventListener("blur",function(){this.parentElement.classList.remove("border-blue-500")})),this.initNavigation(),this.autoLoadDefault()},initNavigation:function(){var t=this;this.navOriginalRect=null,document.querySelectorAll(".info-nav-link").forEach(function(e){e.addEventListener("click",function(e){e.preventDefault();var n=this.getAttribute("data-target"),i=document.getElementById(n);i&&(i.scrollIntoView({behavior:"smooth",block:"start"}),t.updateActiveNav(n))})}),window.addEventListener("scroll",function(){t.handleScroll()}),window.addEventListener("resize",function(){t.isNavFixed&&t.resetNavFixed()});var e=document.getElementById("mobile-nav-toggle"),n=document.getElementById("mobile-nav-drawer"),i=document.getElementById("close-drawer-btn"),a=document.getElementById("nav-drawer-overlay");e&&n&&e.addEventListener("click",function(){t.openMobileDrawer()}),i&&i.addEventListener("click",function(){t.closeMobileDrawer()}),a&&a.addEventListener("click",function(){t.closeMobileDrawer()}),document.querySelectorAll(".mobile-nav-link").forEach(function(e){e.addEventListener("click",function(e){e.preventDefault();var n=this.getAttribute("data-target"),i=document.getElementById(n);i&&(i.scrollIntoView({behavior:"smooth",block:"start"}),t.closeMobileDrawer())})});var o=document.getElementById("back-to-top");o&&o.addEventListener("click",function(){window.scrollTo({top:0,behavior:"smooth"})})},autoLoadDefault:function(){""===window.location.search?(this.sourceUrl="https://example.com",this.fetchPageSource("https://example.com",1).then(function(t){1===t.code?(this.sourceHtml=t.data.html,this.displayResults(t.data,!1)):this.showError(t.msg||"è·å页颿ºä»£ç 失败")}.bind(this)).catch(function(t){this.showError("请æ±å¤±è´¥ï¼"+t.message)}.bind(this))):this.getQueryUrlFromParams()&&this.loadFromUrlParams()},loadFromUrlParams:function(){var t=this.getQueryUrlFromParams();if(t){var e=new URLSearchParams(window.location.search).get("ua_id")||"1";this.sourceUrl=t;var n=document.getElementById("url-input");n&&(n.value=t);var i=document.getElementById("ua-select");i&&(i.value=e),this.showLoading(),this.fetchPageSource(t,e).then(function(t){this.hideLoading(),1===t.code?(this.sourceHtml=t.data.html,this.displayResults(t.data,!0)):this.showError(t.msg||"è·å页颿ºä»£ç 失败")}.bind(this)).catch(function(t){this.hideLoading(),this.showError("请æ±å¤±è´¥ï¼"+t.message)}.bind(this))}},handleSubmitWithUrlParams:function(){var t=document.getElementById("url-input"),e=document.getElementById("ua-select");if(t){var n=t.value.trim(),i=e?e.value:"1";if(!n)return this.showError("请è¾å
¥URLå°å"),void t.focus();if(this.isValidUrl(n)){n.match(/^https?:\/\//i)||(n="https://"+n,t.value=n);var a=new URL(window.location.href);a.hash="",a.searchParams.set("q",n),a.searchParams.set("ua_id",i),window.location.href=a.toString()}else this.showError("URLæ ¼å¼ä¸æ£ç¡®ï¼è¯·è¾å
¥å®æ´çURLï¼å¦ï¼https://example.comï¼")}else this.showError("URLè¾å
¥æ¡æªæ¾å°")},handleScroll:function(){var t=document.getElementById("results-section");if(t&&!t.classList.contains("hidden")){var e=document.getElementById("nav-container");if(e){var n=e.closest(".flex");if(n){var i=n.querySelectorAll('div[id^="info-"]'),a=null;if(i.length>0&&(a=i[i.length-1]),a){var o=window.scrollY||window.pageYOffset,r=this.getElementOffsetTop(n),s=e.offsetHeight,l=this.getElementOffsetTop(a)+a.offsetHeight;o+32>=r&&o+32+s<=l?this.isNavFixed||(this.navOriginalRect={left:e.getBoundingClientRect().left,width:e.offsetWidth},e.style.position="fixed",e.style.top="32px",e.style.left=this.navOriginalRect.left+"px",e.style.width=this.navOriginalRect.width+"px",e.style.zIndex="50",this.isNavFixed=!0):this.isNavFixed&&this.resetNavFixed();var d=document.getElementById("back-to-top");d&&(o>300?(d.classList.remove("opacity-0","invisible"),d.classList.add("opacity-100","visible")):(d.classList.add("opacity-0","invisible"),d.classList.remove("opacity-100","visible")))}}}}},getElementOffsetTop:function(t){for(var e=0;t;)e+=t.offsetTop,t=t.offsetParent;return e},resetNavFixed:function(){var t=document.getElementById("nav-container");t&&this.isNavFixed&&(t.style.position="",t.style.top="",t.style.left="",t.style.width="",t.style.zIndex="",this.isNavFixed=!1,this.navOriginalRect=null)},openMobileDrawer:function(){var t=document.getElementById("mobile-nav-drawer"),e=document.getElementById("nav-drawer-panel");t&&e&&(t.classList.remove("hidden"),setTimeout(function(){e.classList.remove("translate-y-full")},10))},closeMobileDrawer:function(){var t=document.getElementById("mobile-nav-drawer"),e=document.getElementById("nav-drawer-panel");t&&e&&(e.classList.add("translate-y-full"),setTimeout(function(){t.classList.add("hidden")},300))},toggleMobileNavButton:function(t){var e=document.getElementById("mobile-nav-toggle");e&&(t?e.classList.remove("hidden"):e.classList.add("hidden"))},updateActiveNav:function(t){document.querySelectorAll(".info-nav-link").forEach(function(e){e.getAttribute("data-target")===t?e.classList.add("bg-blue-50","text-blue-700"):e.classList.remove("bg-blue-50","text-blue-700")})},handleSubmit:function(){var t=this,e=document.getElementById("url-input"),n=document.getElementById("ua-select");if(e){var i=e.value.trim(),a=n?n.value:"1";if(!i)return this.showError("请è¾å
¥URLå°å"),void e.focus();this.isValidUrl(i)?(i.match(/^https?:\/\//i)||(i="https://"+i,e.value=i),this.sourceUrl=i,this.showLoading(),this.hideError(),this.hideResults(),this.fetchPageSource(i,a).then(function(e){t.hideLoading(),1===e.code?(t.sourceHtml=e.data.html,t.displayResults(e.data)):t.showError(e.msg||"è·å页颿ºä»£ç 失败")}).catch(function(e){t.hideLoading(),t.showError("请æ±å¤±è´¥ï¼"+e.message)})):this.showError("URLæ ¼å¼ä¸æ£ç¡®ï¼è¯·è¾å
¥å®æ´çURLï¼å¦ï¼https://example.comï¼")}else this.showError("URLè¾å
¥æ¡æªæ¾å°")},fetchPageSource:function(e,n){return new Promise(function(i,a){var o=new XMLHttpRequest;o.open("POST",t.apiEndpoint,!0),o.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),o.onreadystatechange=function(){if(4===o.readyState)if(200===o.status)try{var t=JSON.parse(o.responseText);i(t)}catch(t){a(new Error("è§£æååºæ°æ®å¤±è´¥"))}else a(new Error("HTTP "+o.status))},o.onerror=function(){a(new Error("ç½ç»è¯·æ±å¤±è´¥"))},o.ontimeout=function(){a(new Error("请æ±è¶
æ¶"))},o.timeout=35e3;var r="url="+encodeURIComponent(e)+"&ua_id="+encodeURIComponent(n);o.send(r)})},displayResults:function(t,e){void 0===e&&(e=!1);var n=document.getElementById("results-section");if(n){this.toggleMobileNavButton(!0),this.updateUrlDisplay(this.sourceUrl),t.view_id&&(this.currentViewId=t.view_id),this.updatePageInfoBasic(t.pageInfo),this.updateTextHtmlRatioDisplay(t.pageInfo),this.updateRequestInfo(t.serverInfo,t.executionTime,t.metrics),this.updatePerformanceBreakdown(t.metrics),this.updateServerInfo(t.serverInfo),this.updateHtmlStructure(t.pageInfo,t.html);var i=this;setTimeout(function(){if(i.updateSourceCode(t.html),t.html){var e=i.parseHtml(t.html);i.updateTdkMeta(e),i.updateSeoIssues(e),i.updateDensityAsync(e),i.initDensityTabs(),i.updateHeadings(e),i.initHeadingsTabs(),i.updateImages(e),i.initImagesTabs(),i.updateLinks(e),i.initLinksTabs(),i.updateHreflangs(e),i.updateOpenGraph(e),i.updateStructured(e),i.updateTechnology(e)}},50),e&&setTimeout(function(){n.scrollIntoView({behavior:"smooth",block:"start"})},100)}},updateUrlDisplay:function(t){var e=document.getElementById("url-display");e&&(e.textContent=t)},updatePageInfoBasic:function(t){var e=document.getElementById("page-size-display"),n=document.getElementById("page-chars-display"),i=document.getElementById("page-words-display"),a=document.getElementById("page-lines-display"),o=document.getElementById("text-html-ratio-display");e&&(e.textContent=t.totalSize||"--"),n&&(n.textContent=this.formatNumber(t.totalChars||0)),i&&(i.textContent=this.formatNumber(t.totalWords||0)),a&&(a.textContent=this.formatNumber(t.totalLines||0)),o&&(o.textContent=(void 0!==t.textHtmlRatio?t.textHtmlRatio:"--")+"%")},updateTextHtmlRatioDisplay:function(t){var e=void 0!==t.textHtmlRatio?t.textHtmlRatio:null,n=t.textSizeRaw||0,i=t.totalSizeRaw||0,a=document.getElementById("text-html-ratio-value");a&&(a.textContent=null!==e?e+"%":"--%",null!==e&&(a.className=e>=25?"text-3xl font-bold text-green-600":e>=15&&e<25?"text-3xl font-bold text-lime-600":e>=10&&e<15?"text-3xl font-bold text-yellow-600":"text-3xl font-bold text-red-600"));var o=document.getElementById("text-content-size-display");o&&(o.textContent=this.formatSize(n));var r=document.getElementById("html-size-value"),s=document.getElementById("html-size-display");r&&(r.textContent=this.formatSize(i)),s&&(s.textContent="("+this.formatSize(i)+")");var l=document.getElementById("ratio-quality");if(l&&null!==e){var d="",c="";e>=25?(d=window._LANG_?.quality_good||"ä¼ç§",c="text-3xl font-bold text-green-600"):e>=15&&e<25?(d=window._LANG_?.quality_good_average||"è¯å¥½",c="text-3xl font-bold text-lime-600"):e>=10&&e<15?(d=window._LANG_?.quality_average||"ä¸è¬",c="text-3xl font-bold text-yellow-600"):(d=window._LANG_?.quality_poor||"è¾å·®",c="text-3xl font-bold text-red-600"),l.textContent=d,l.className=c}},formatSize:function(t){return 0===t?"0 B":t>=1048576?(t/1048576).toFixed(2)+" MB":t>=1024?(t/1024).toFixed(2)+" KB":t+" B"},updateRequestInfo:function(t,e,n){var i=document.getElementById("http-code-display"),a=document.getElementById("http-code-display-mini"),o=document.getElementById("execution-time-display"),r=document.getElementById("cache-status-display"),s=document.getElementById("total-time-display");if(i&&(i.textContent=t.httpCode||"--"),a&&(a.textContent=t.httpCode||"--"),o&&(o.textContent=this.formatTime(e/1e3)),r){var l=void 0!==t.cacheHit&&t.cacheHit;r.textContent=l?"HIT":"MISS",r.className=l?"text-2xl font-bold text-green-600":"text-2xl font-bold text-gray-400"}s&&(s.textContent=this.formatTime(n.totalTime))},updatePerformanceBreakdown:function(t){var e=t.totalTime||1,n=document.getElementById("dns-display"),i=document.getElementById("dns-bar");n&&(n.textContent=this.formatTime(t.dnsLookup)),i&&(i.style.width=Math.min(t.dnsLookup/e*100,100)+"%");var a=document.getElementById("tcp-display"),o=document.getElementById("tcp-bar");a&&(a.textContent=this.formatTime(t.tcpConnection)),o&&(o.style.width=Math.min(t.tcpConnection/e*100,100)+"%");var r=document.getElementById("tls-display"),s=document.getElementById("tls-bar");r&&(r.textContent=this.formatTime(t.tlsHandshake)),s&&(s.style.width=Math.min(t.tlsHandshake/e*100,100)+"%");var l=document.getElementById("server-wait-display"),d=document.getElementById("server-bar");l&&(l.textContent=this.formatTime(t.serverWait)),d&&(d.style.width=Math.min(t.serverWait/e*100,100)+"%");var c=document.getElementById("transfer-display"),u=document.getElementById("transfer-bar");c&&(c.textContent=this.formatTime(t.contentTransfer)),u&&(u.style.width=Math.min(t.contentTransfer/e*100,100)+"%");var m=document.getElementById("dns-display-mini");m&&(m.textContent=this.formatTime(t.dnsLookup));var h=document.getElementById("tcp-display-mini");h&&(h.textContent=this.formatTime(t.tcpConnection));var g=document.getElementById("tls-display-mini");g&&(g.textContent=this.formatTime(t.tlsHandshake));var y=document.getElementById("server-display-mini");y&&(y.textContent=this.formatTime(t.serverWait));var p=document.getElementById("transfer-display-mini");p&&(p.textContent=this.formatTime(t.contentTransfer));var f=document.getElementById("total-time-circle");f&&(f.textContent=this.formatTime(t.totalTime));var v=[{barId:"dns-bar-circle",value:t.dnsLookup||0},{barId:"tcp-bar-circle",value:t.tcpConnection||0},{barId:"tls-bar-circle",value:t.tlsHandshake||0},{barId:"server-bar-circle",value:t.serverWait||0},{barId:"transfer-bar-circle",value:t.contentTransfer||0}],x=e||1;v.forEach(function(t){var e=document.getElementById(t.barId);if(e&&t.value>0){var n=Math.min(t.value/x*100,100);e.style.width=n+"%"}else e&&(e.style.width="0%")})},updateServerInfo:function(t){var e=document.getElementById("server-display"),n=document.getElementById("http-version-display"),i=document.getElementById("content-type-display");e&&(e.textContent=t.server||"unknown"),n&&(n.textContent=t.httpVersion||"--"),i&&(i.textContent="text/html")},updateHtmlStructure:function(t,e){var n=document.getElementById("tag-count-display"),i=document.getElementById("link-count-display"),a=document.getElementById("image-count-display"),o=document.getElementById("script-count-display");
1n&&(n.textContent=this.formatNumber(t.tagCount||0));var r=(e.match(/<a[^>]*>/gi)||[]).length,s=(e.match(/<img[^>]*>/gi)||[]).length,l=(e.match(/<script[^>]*>/gi)||[]).length;i&&(i.textContent=this.formatNumber(r)),a&&(a.textContent=this.formatNumber(s)),o&&(o.textContent=this.formatNumber(l));var d=document.getElementById("tag-count-display-mini");d&&(d.textContent=this.formatNumber(t.tagCount||0))},updateSourceCode:function(t){var e=document.getElementById("results-section"),n=null;if(e&&(n=e.querySelector("#source-code-display")),n||(n=document.getElementById("source-code-display")),n)try{var i=html_beautify(t,{indent_size:4,indent_char:" ",wrap_line_length:120,unformatted:["pre","code"],preserve_newlines:!0,max_preserve_newlines:2,indent_inner_html:!0}),a=document.createElement("pre");a.className="language-html",a.style.margin="0",a.style.padding="0",a.style.backgroundColor="transparent";var o=document.createElement("code");o.className="language-html",o.textContent=i,a.appendChild(o),n.innerHTML="",n.appendChild(a),Prism.highlightElement(o)}catch(e){n.textContent=t}},toggleWrap:function(){this.isWrapped=!this.isWrapped;var t=document.getElementById("source-code-display"),e=document.getElementById("toggle-wrap-btn");if(t){var n=t.querySelector("code");n&&(n.style.whiteSpace=this.isWrapped?"pre-wrap":"pre")}e&&(e.textContent=this.isWrapped?window._LANG_?.no_wrap||"No Wrap":window._LANG_?.toggle_wrap||"Toggle Wrap")},copyCode:function(){var e=this.sourceHtml,n=document.getElementById("copy-code-btn");e&&(navigator.clipboard&&navigator.clipboard.writeText?navigator.clipboard.writeText(e).then(function(){t.showCopySuccess(n)}).catch(function(){t.fallbackCopy(e,n)}):this.fallbackCopy(e,n))},fallbackCopy:function(t,e){var n=document.createElement("textarea");n.value=t,n.style.position="fixed",n.style.top="-9999px",n.style.left="-9999px",document.body.appendChild(n),n.select();try{document.execCommand("copy"),this.showCopySuccess(e)}catch(t){this.showError("å¤å¶å¤±è´¥ï¼è¯·æå¨éæ©å¤å¶")}document.body.removeChild(n)},showCopySuccess:function(t){if(t){var e=t.textContent;t.textContent=window._LANG_?.copied||"Copied",t.classList.add("bg-green-600"),t.classList.remove("bg-gray-700"),setTimeout(function(){t.textContent=e,t.classList.remove("bg-green-600"),t.classList.add("bg-gray-700")},2e3)}},downloadCode:function(){var t=new Blob([this.sourceHtml],{type:"text/html"}),e=URL.createObjectURL(t),n=document.createElement("a");n.href=e,n.download=this.getFileNameFromUrl(this.sourceUrl),document.body.appendChild(n),n.click(),document.body.removeChild(n),URL.revokeObjectURL(e)},getFileNameFromUrl:function(t){try{return new URL(t).hostname.replace(/\./g,"_")+"_source.html"}catch(t){return"source.html"}},showLoading:function(){this.isLoading=!0;var t=document.getElementById("loading-spinner"),e=document.getElementById("view-source-btn");t&&t.classList.remove("hidden"),e&&(e.disabled=!0,e.classList.add("opacity-50","cursor-not-allowed"))},hideLoading:function(){this.isLoading=!1;var t=document.getElementById("loading-spinner"),e=document.getElementById("view-source-btn");t&&t.classList.add("hidden"),e&&(e.disabled=!1,e.classList.remove("opacity-50","cursor-not-allowed"))},hideResults:function(){var t=document.getElementById("results-section");t&&t.classList.add("hidden")},showError:function(t){var e=document.getElementById("error-message");if(e){var n=e.querySelector("span");n&&(n.textContent=t),e.classList.remove("hidden")}},hideError:function(){var t=document.getElementById("error-message");t&&t.classList.add("hidden")},getQueryUrlFromParams:function(){var t=window.location.search,e=window.location.href,n=t.indexOf("q=");return-1===n?null:-1!==e.indexOf("q=https%3A%2F%2F")||-1!==e.indexOf("q=http%3A%2F%2F")?new URLSearchParams(t).get("q"):t.substring(n+2)},isValidUrl:function(t){try{var e=t;t.match(/^https?:\/\//i)||(e="https://"+t);var n=new URL(e);return"http:"===n.protocol||"https:"===n.protocol}catch(t){return!1}},formatTime:function(t){return t<.001?(1e6*t).toFixed(0)+"ns":t<1?(1e3*t).toFixed(2)+"ms":t.toFixed(2)+"s"},formatNumber:function(t){return t.toString().replace(/\B(?=(\d{3})+(?!\d))/g,",")},parseHtml:function(t){try{return(new DOMParser).parseFromString(t,"text/html")}catch(t){return null}},updateTdkMeta:function(t){if(t){var e=document.getElementById("meta-title-display"),n=document.getElementById("meta-title-length"),i=t.querySelector("title");if(i){var a=i.textContent.trim();e&&(e.textContent=a||"--"),n&&(n.textContent=a.length)}var o=document.getElementById("meta-description-display"),r=document.getElementById("meta-description-length"),s=t.querySelector('meta[name="description"]');if(s){var l=s.getAttribute("content")||"";o&&(o.textContent=l||"--"),r&&(r.textContent=l.length)}var d=document.getElementById("meta-keywords-display"),c=document.getElementById("meta-keywords-length"),u=t.querySelector('meta[name="keywords"]');if(u){var m=u.getAttribute("content")||"";d&&(d.textContent=m||"--"),c&&(c.textContent=m.length)}var h=document.getElementById("meta-canonical-display"),g=t.querySelector('link[rel="canonical"]');if(g){var y=g.getAttribute("href")||"";h&&(h.textContent=y||"--")}var p=document.getElementById("meta-other-display");if(p){var f=t.querySelectorAll("meta[name], meta[property]"),v=["description","keywords","viewport","charset"],x="",b=0;f.forEach(function(t){var e=t.getAttribute("name")||t.getAttribute("property")||"",n=t.getAttribute("content")||"";e&&n&&-1===v.indexOf(e)&&b<20&&(x+='<div class="text-xs py-1 border-b border-gray-100 last:border-0">',x+='<span class="font-semibold text-gray-700">'+this.escapeHtml(e)+":</span> ",x+='<span class="text-gray-600 break-all">'+this.escapeHtml(n.substring(0,100))+(n.length>100?"...":"")+"</span>",x+="</div>",b++)}.bind(this)),p.innerHTML=x||'<div class="text-sm text-gray-400">'+(window._LANG_?.no_data||"No Data")+"</div>"}}},updateSeoIssues:function(t){if(t){var e=[],n=t.querySelector("title");if(n&&n.textContent.trim()){var i=n.textContent.trim().length;i<30&&e.push({type:"warning",msg:"title_too_short"}),i>60&&e.push({type:"warning",msg:"title_too_long"})}else e.push({type:"error",msg:"missing_title"});var a=t.querySelector('meta[name="description"]');if(a&&a.getAttribute("content")){var o=a.getAttribute("content").length;o<120&&e.push({type:"warning",msg:"description_too_short"}),o>160&&e.push({type:"warning",msg:"description_too_long"})}else e.push({type:"error",msg:"missing_description"});var r=t.querySelectorAll("h1");0===r.length?e.push({type:"error",msg:"missing_h1"}):r.length>1&&e.push({type:"warning",msg:"multiple_h1"});var s=t.querySelector('link[rel="canonical"]');s&&s.getAttribute("href")||e.push({type:"warning",msg:"missing_canonical"});var l=t.querySelectorAll("img"),d=0;l.forEach(function(t){t.getAttribute("alt")||d++}),d>0&&e.push({type:"info",msg:"images_without_alt",count:d});var c=document.getElementById("seo-issues-list");if(c)if(0===e.length)c.innerHTML='<div class="flex items-center text-green-600"><svg class="w-5 h-5 mr-2" fill="none" stroke="currentColor" viewBox="0 0 24 24">
1<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 13l4 4L19 7"></path></svg><span>'+(window._LANG_?.no_seo_issues||"No SEO issues found")+"</span></div>";else{var u="";e.forEach(function(t){var e="error"===t.type?"text-red-500":"warning"===t.type?"text-yellow-500":"text-blue-500",n="error"===t.type?'<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12"></path>':'<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"></path>',i=this.getLangText(t.msg);t.count&&(i+=" ("+t.count+")"),u+='<div class="flex items-start p-2 bg-gray-50 rounded">',u+='<svg class="w-5 h-5 mr-2 mt-0.5 '+e+' flex-shrink-0" fill="none" stroke="currentColor" viewBox="0 0 24 24">'+n+"</svg>",u+='<span class="text-sm text-gray-700">'+i+"</span>",u+="</div>"}.bind(this)),c.innerHTML=u}}},updateDensity:function(t){if(t){var e=t.body?t.body.textContent:"";t.querySelectorAll("script, style").forEach(function(t){t.textContent=""}),t.querySelectorAll("code, pre, samp, kbd, tt").forEach(function(t){t.textContent=""});var n={};["span","strong","em","b","i","u","s","del","ins","mark","small","sub","sup","q","cite","abbr","data","time","wbr","ruby","rt","rp","bdi","bdo"].forEach(function(t){n[t]=!0});var i=t.body.innerHTML;i=i.replace(/<([a-z0-9]+)(?:\s[^>]*)?>/gi,function(t,e){return n[e.toLowerCase()]?t:t+","}),t.body.innerHTML=i,e=t.body?t.body.textContent:"";var a=["the","be","to","of","and","a","in","that","have","i","it","for","not","on","with","he","as","you","do","at","this","but","his","by","from","they","we","say","her","she","or","an","will","my","one","all","would","there","their","what","so","up","out","if","about","who","get","which","go","me"],o=["ç","äº","å¨","æ¯","æ","æ","å","å°±","ä¸","人","é½","ä¸","ä¸å","ä¸","ä¹","å¾","å°","說","è¦","å»","ä½ ","æ","è","æ²æ","ç","好","èªå·±","é"],r=["ç","äº","å¨","æ¯","æ","æ","å","å°±","ä¸","人","é½","ä¸","ä¸ä¸ª","ä¸","ä¹","å¾","å°","说","è¦","å»","ä½ ","ä¼","ç","没æ","ç","好","èªå·±","è¿"],s="zh-cn",l=t.documentElement.getAttribute("lang")||"";-1!==l.indexOf("en")?(r=a,s="en"):-1===l.indexOf("tw")&&-1===l.indexOf("hk")||(r=o,s="zh-tw");for(var d={},c=0,u=e.split(/[\n\rãï¼ï¼ï¼ï¼ã.,!?;\-]+/).filter(function(t){var e=t.trim();return e.length>0&&!/^[\s,ï¼ã.ãï¼!?ï¼;ï¼:ï¼]+$/.test(e)}),m={},h=1;h<=5;h++)m[h]={};u.forEach(function(t){0;var e=[];"en"===s?(t.toLowerCase().match(/\b[a-z]{2,}\b/g)||[]).forEach(function(t){-1===r.indexOf(t)&&(e.push(t),d[t]=(d[t]||0)+1,c++)}):(t.match(/[\u4e00-\u9fa5]{2,}/g)||[]).forEach(function(t){-1===r.indexOf(t)&&(e.push(t),d[t]=(d[t]||0)+1,c++)});for(var n=1;n<=5;n++)for(var i=0;i<=e.length-n;i++){var a=e.slice(i,i+n).join(" ");a.length>0&&(m[n][a]=(m[n][a]||0)+1)}});var g=Object.keys(d).length;document.getElementById("density-total-words").textContent=c,document.getElementById("density-unique-words").textContent=g,document.getElementById("density-1word").textContent=Object.keys(m[1]).length,document.getElementById("density-2word").textContent=Object.keys(m[2]).length,document.getElementById("density-3word").textContent=Object.keys(m[3]).length,this.densityData=m,this.totalWords=c,this.renderDensityContent("1")}},updateDensityAsync:function(t){if(t){var e=t.documentElement.getAttribute("lang")||"",n=this.detectLanguage(e);this.needsSplitApi(n)&&this.currentViewId?(this.showDensityLoading(),this.fetchSplitContent().then(function(e){this.updateDensityWithWords(t,e)}.bind(this)).catch(function(e){this.updateDensity(t)}.bind(this))):this.updateDensity(t)}},detectLanguage:function(t){return-1!==t.indexOf("zh")?"zh-cn":-1!==t.indexOf("ja")?"ja":-1!==t.indexOf("ko")||-1!==t.indexOf("kr")?"kr":"en"},needsSplitApi:function(t){return-1!==["zh-cn","zh-tw","ja","kr"].indexOf(t)},showDensityLoading:function(){var t=document.getElementById("density-content");t&&(t.innerHTML='<div class="text-center text-gray-500 py-8">'+(window._LANG_?.smart_segmenting||"æ£å¨æºè½åè¯...")+"</div>")},fetchSplitContent:function(){return new Promise(function(t,e){if(this.currentViewId){var n=0,i=function(){n++;var a=new XMLHttpRequest;a.open("POST","/viewsource/api/getSplitContent",!0),a.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),a.onreadystatechange=function(){if(4===a.readyState)if(200===a.status)try{var o=JSON.parse(a.responseText);1===o.code&&o.data?t(o.data.words):n<2&&!o.msg?setTimeout(i,1e3):e(new Error(o.msg||"åè¯å¤±è´¥"))}catch(t){e(new Error("è§£æååºå¤±è´¥"))}else e(new Error("HTTP "+a.status))}.bind(this),a.onerror=function(){n<2?setTimeout(i,1e3):e(new Error("ç½ç»è¯·æ±å¤±è´¥"))}.bind(this),a.ontimeout=function(){n<2?setTimeout(i,1e3):e(new Error("请æ±è¶
æ¶"))}.bind(this),a.timeout=95e3;var o="view_id="+encodeURIComponent(this.currentViewId);a.send(o)}.bind(this);i()}else e(new Error("ç¼ºå° view_id"))}.bind(this))},updateDensityWithWords:function(t,e){if(t&&e){for(var n=t.documentElement.getAttribute("lang")||"",i={"zh-cn":["ç","äº","å¨","æ¯","æ","æ","å","å°±","ä¸","人","é½","ä¸","ä¸ä¸ª","ä¸","ä¹","å¾","å°","说","è¦","å»","ä½ ","ä¼","ç","没æ","ç","好","èªå·±","è¿"],ja:["ã®","ã«","ã","ã¯","ã¦","ã","ã","ã§","ã ","ã¨","ãã","ãã","ãªã","ãã","ãªã"],kr:["ì","ì´","ê°","ì","를","ë","ì","ì","ê³¼","íë¤","ëë¤","ìë¤","ìë¤"]}[this.detectLanguage(n)]||[],a={},o=0,r={},s=1;s<=5;s++)r[s]={};var l=[];e.forEach(function(t){if(0!==(t=t.trim()).length)if(function(t){var e=/[\p{L}\p{N}]/u.test(t);return/[\p{P}\p{S}\p{Z}]/u.test(t)||!e}(t))l=[];else if(-1===i.indexOf(t)&&!/^[a-zA-Z]$/.test(t)&&!/^\d{1,2}$/.test(t)){l.push(t),a[t]=(a[t]||0)+1,o++;for(var e=1;e<=5;e++)if(l.length>=e){var n=l.slice(-e).join(" ");r[e][n]=(r[e][n]||0)+1}}}.bind(this));var d=Object.keys(a).length;document.getElementById("density-total-words").textContent=o,document.getElementById("density-unique-words").textContent=d,document.getElementById("density-1word").textContent=Object.keys(r[1]).length,document.getElementById("density-2word").textContent=Object.keys(r[2]).length,document.getElementById("density-3word").textContent=Object.keys(r[3]).length,this.densityData=r,this.totalWords=o,this.renderDensityContent("1")}},initDensityTabs:function(){var t=document.querySelectorAll(".density-tab"),e=document.getElementById("density-content"),n=this;t.forEach(function(e){e.addEventListener("click",function(e){e.preventDefault();var i=this.getAttribute("data-tab");t.forEach(function(t){t.classList.remove("active","border-lime-500","text-lime-600"),t.classList.add("border-transparent")}),this.classList.add("active","border-lime-500","text-lime-600"),this.classList.remove("border-transparent"),n.renderDensityContent(i)})});var i=document.querySelector('.density-tab[data-tab="1"]');i&&(i.classList.add("active","border-lime-500","text-lime-600"),i.classList.remove("border-transparent")),e&&this.densityData&&this.renderDensityContent("1")},renderDensityContent:function(t){var e=document.getElementById("density-content");
1if(e&&this.densityData){var n=parseInt(t),i=this.densityData[n];if(i){var a=Object.keys(i).map(function(t){return{phrase:t,count:i[t]}});a.sort(function(t,e){return e.count-t.count});var o=a.slice(0,100),r="";if(r+='<table class="min-w-full divide-y divide-gray-200">',r+='<thead class="bg-gray-50"><tr>',r+='<th class="px-4 py-2 text-left text-xs font-medium text-gray-500 uppercase">'+(window._LANG_?.rank||"Rank")+"</th>",r+='<th class="px-4 py-2 text-left text-xs font-medium text-gray-500 uppercase">'+(window._LANG_?.word_phrase||"Word/Phrase")+"</th>",r+='<th class="px-4 py-2 text-left text-xs font-medium text-gray-500 uppercase">'+(window._LANG_?.total||"Count")+"</th>",r+='<th class="px-4 py-2 text-left text-xs font-medium text-gray-500 uppercase">'+(window._LANG_?.density_percent||"Density")+"</th>",r+='</tr></thead><tbody class="bg-white divide-y divide-gray-200">',o.forEach(function(t,e){var n=this.totalWords>0?(t.count/this.totalWords*100).toFixed(2):0;r+='<tr class="'+(e<3?"bg-lime-50":"")+'">',r+='<td class="px-4 py-2 text-sm text-gray-900">'+(e+1)+"</td>",r+='<td class="px-4 py-2 text-sm text-gray-800 font-medium">'+this.escapeHtml(t.phrase)+"</td>",r+='<td class="px-4 py-2 text-sm text-gray-600">'+t.count+"</td>",r+='<td class="px-4 py-2 text-sm text-gray-600">'+n+"%</td>",r+="</tr>"}.bind(this)),r+="</tbody></table>",a.length>100){var s=(window._LANG_?.showing_first||"Showing first 100 of {count} items").replace("{count}",a.length);r+='<div class="text-center text-sm text-gray-500 py-2">'+s+"</div>"}e.innerHTML=r||'<div class="text-sm text-gray-400">'+(window._LANG_?.no_data||"No Data")+"</div>"}else e.innerHTML='<div class="text-sm text-gray-400">'+(window._LANG_?.no_data||"No Data")+"</div>"}},getLangText:function(t){return window._LANG_&&window._LANG_[t]?window._LANG_[t]:t},updateHeadings:function(t){if(t){for(var e=[],n=1;n<=6;n++){var i=t.querySelectorAll("h"+n),a=i.length;e.push({level:n,count:a,elements:Array.from(i)});var o=document.getElementById("heading-h"+n+"-count");o&&(o.textContent=a)}var r=e.reduce(function(t,e){return t+e.count},0),s=document.getElementById("heading-total-count");s&&(s.textContent=r),this.headingsData=e}},initHeadingsTabs:function(){var t=document.querySelectorAll(".heading-tab"),e=document.getElementById("headings-content"),n=this;t.forEach(function(e){e.addEventListener("click",function(e){e.preventDefault();var i=this.getAttribute("data-tab");t.forEach(function(t){t.classList.remove("active","border-amber-500","text-amber-600"),t.classList.add("border-transparent")}),this.classList.add("active","border-amber-500","text-amber-600"),this.classList.remove("border-transparent"),n.renderHeadingsContent(i)})});var i=document.querySelector('.heading-tab[data-tab="all"]');i&&(i.classList.add("active","border-amber-500","text-amber-600"),i.classList.remove("border-transparent")),e&&this.headingsData&&this.renderHeadingsContent("all")},renderHeadingsContent:function(t){var e=document.getElementById("headings-content");if(e&&this.headingsData){var n="";if("all"===t||"h"===t)n+='<div class="space-y-1">',this.headingsData.forEach(function(t){t.elements.forEach(function(e){var i=e.textContent.trim()||window._LANG_?.empty_title||"(empty title)",a=16*(t.level-1),o="bg-amber-"+(100+100*t.level)+" text-white";n+='<div class="flex items-start py-1 hover:bg-gray-50 rounded" style="padding-left: '+a+'px">',n+='<span class="inline-flex items-center justify-center w-6 h-6 '+o+' rounded text-xs font-bold mr-2 flex-shrink-0">H'+t.level+"</span>",n+='<span class="text-sm text-gray-700 break-all">'+this.escapeHtml(i.substring(0,200))+"</span>",n+="</div>"}.bind(this))}.bind(this)),n+="</div>";else{var i=parseInt(t.substring(1)),a=this.headingsData[i-1];a&&(n+='<div class="space-y-1">',a.elements.forEach(function(t){var e=t.textContent.trim()||window._LANG_?.empty_title||"(empty title)";n+='<div class="flex items-start py-1 hover:bg-gray-50 rounded">',n+='<span class="text-sm text-gray-700 break-all">'+this.escapeHtml(e.substring(0,200))+"</span>",n+="</div>"}.bind(this)),n+="</div>")}e.innerHTML=n||'<div class="text-sm text-gray-400">'+(window._LANG_?.no_data||"No Data")+"</div>"}},updateImages:function(t){if(t){var e=Array.from(t.querySelectorAll("img")),n={},i=0,a=0;e.forEach(function(t){var e=t.getAttribute("src")||"";e&&(n[e]=(n[e]||0)+1),t.getAttribute("alt")||i++,t.getAttribute("title")||a++});var o=e.length,r=Object.keys(n).length;document.getElementById("image-total-count").textContent=o,document.getElementById("image-unique-count").textContent=r,document.getElementById("image-no-alt-count").textContent=i,document.getElementById("image-no-title-count").textContent=a,this.imagesData={all:e,unique:Object.keys(n),noAlt:e.filter(function(t){return!t.getAttribute("alt")}),noTitle:e.filter(function(t){return!t.getAttribute("title")})}}},initImagesTabs:function(){var t=document.querySelectorAll(".image-tab"),e=document.getElementById("images-content"),n=this;t.forEach(function(e){e.addEventListener("click",function(e){e.preventDefault();var i=this.getAttribute("data-tab");t.forEach(function(t){t.classList.remove("active","border-emerald-500","text-emerald-600"),t.classList.add("border-transparent")}),this.classList.add("active","border-emerald-500","text-emerald-600"),this.classList.remove("border-transparent"),n.renderImagesContent(i)})});var i=document.querySelector('.image-tab[data-tab="all"]');i&&(i.classList.add("active","border-emerald-500","text-emerald-600"),i.classList.remove("border-transparent")),e&&this.imagesData&&this.renderImagesContent("all")},renderImagesContent:function(t){var e=document.getElementById("images-content");
1if(e&&this.imagesData){var n="",i=this.imagesData[t];"unique"===t?(n+='<div class="space-y-2">',i.forEach(function(t){n+='<div class="flex items-center p-2 bg-gray-50 rounded">',n+='<div class="w-12 h-12 bg-gray-200 rounded mr-3 flex items-center justify-center flex-shrink-0 overflow-hidden">',n+='<svg class="w-6 h-6 text-gray-400" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z"></path></svg>',n+="</div>",n+='<div class="flex-1 min-w-0">',n+='<div class="text-xs text-gray-500 truncate">'+this.escapeHtml(t)+"</div>",n+="</div>",n+="</div>"}.bind(this)),n+="</div>"):(n+='<div class="grid grid-cols-1 sm:grid-cols-2 gap-3">',i.forEach(function(t){var e=t.getAttribute("src")||"",i=t.getAttribute("alt")||"",a=t.getAttribute("width")||"?",o=t.getAttribute("height")||"?";n+='<div class="bg-gray-50 rounded p-3">',n+='<div class="w-full h-20 bg-gray-200 rounded mb-2 flex items-center justify-center overflow-hidden">',e&&!e.startsWith("data:")?(n+='<img src="'+this.escapeHtml(e)+'" class="max-w-full max-h-full object-contain" onerror="this.style.display=\'none\';this.nextElementSibling.style.display=\'block\';">',n+='<svg class="w-8 h-8 text-gray-400 hidden" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z"></path></svg>'):n+='<svg class="w-8 h-8 text-gray-400" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z"></path></svg>',n+="</div>",n+='<div class="text-xs space-y-1">',n+='<div class="flex"><span class="text-gray-500 w-16">'+(window._LANG_?.alt_text||"Alt")+':</span><span class="text-gray-700 truncate flex-1">'+(i?this.escapeHtml(i.substring(0,30)):'<span class="text-orange-500">'+(window._LANG_?.none||"None")+"</span>")+"</span></div>",n+='<div class="flex"><span class="text-gray-500 w-16">'+(window._LANG_?.dimensions||"Dimensions")+':</span><span class="text-gray-700">'+a+" x "+o+"</span></div>",n+='<div class="text-gray-400 truncate">'+this.escapeHtml(e.substring(0,50))+(e.length>50?"...":"")+"</div>",n+="</div>",n+="</div>"}.bind(this)),n+="</div>"),e.innerHTML=n||'<div class="text-sm text-gray-400">'+(window._LANG_?.no_data||"No Data")+"</div>"}},updateLinks:function(t){if(t){var e=Array.from(t.querySelectorAll("a[href]")),n={},i=0,a=0,o=this.sourceUrl||"",r="";try{r=o?new URL(o).hostname:""}catch(t){}e.forEach(function(t){var e=t.getAttribute("href")||"";e&&(n[e]=(n[e]||0)+1);try{var s=new URL(e,o);s.hostname!==r&&s.hostname?a++:i++}catch(t){i++}});var s=e.length,l=Object.keys(n).length;document.getElementById("link-total-count").textContent=s,document.getElementById("link-unique-count").textContent=l,document.getElementById("link-internal-count").textContent=i,document.getElementById("link-external-count").textContent=a,this.linksData={all:e,unique:Object.keys(n),internal:[],external:[],dofollow:[],nofollow:[]},e.forEach(function(t){var e=t.getAttribute("href")||"",n=-1!==(t.getAttribute("rel")||"").toLowerCase().indexOf("nofollow");try{var i=new URL(e,o);i.hostname!==r&&i.hostname?this.linksData.external.push(t):this.linksData.internal.push(t)}catch(e){this.linksData.internal.push(t)}n?this.linksData.nofollow.push(t):this.linksData.dofollow.push(t)}.bind(this))}},initLinksTabs:function(){var t=document.querySelectorAll(".link-tab"),e=document.getElementById("links-content"),n=this;t.forEach(function(e){e.addEventListener("click",function(e){e.preventDefault();var i=this.getAttribute("data-tab");t.forEach(function(t){t.classList.remove("active","border-violet-500","text-violet-600"),t.classList.add("border-transparent")}),this.classList.add("active","border-violet-500","text-violet-600"),this.classList.remove("border-transparent"),n.renderLinksContent(i)})});var i=document.querySelector('.link-tab[data-tab="all"]');i&&(i.classList.add("active","border-violet-500","text-violet-600"),i.classList.remove("border-transparent")),e&&this.linksData&&this.renderLinksContent("all")},renderLinksContent:function(t){var e=document.getElementById("links-content");
1if(e&&this.linksData){var n="",i=this.linksData[t];n+='<div class="space-y-2">';var a="all"===t?50:100,o=0;i.forEach(function(t){if(!(o>=a)){var e=t.getAttribute("href")||"",i=t.textContent.trim().substring(0,80)||window._LANG_?.empty||"(empty)",r=t.getAttribute("title")||"",s=-1!==(t.getAttribute("rel")||"").toLowerCase().indexOf("nofollow");n+='<div class="p-2 bg-gray-50 rounded hover:bg-gray-100">',n+='<div class="flex items-start justify-between">',n+='<div class="flex-1 min-w-0">',n+='<div class="text-sm font-medium text-gray-800 truncate mb-1">'+this.escapeHtml(i)+"</div>",n+='<div class="text-xs text-gray-500 truncate">'+this.escapeHtml(e.substring(0,80))+(e.length>80?"...":"")+"</div>",r&&(n+='<div class="text-xs text-gray-400">Title: '+this.escapeHtml(r.substring(0,50))+"</div>"),n+="</div>",n+='<div class="ml-2 flex-shrink-0">',n+=s?'<span class="inline-flex items-center px-2 py-1 bg-red-100 text-red-600 text-xs rounded">Nofollow</span>':'<span class="inline-flex items-center px-2 py-1 bg-green-100 text-green-600 text-xs rounded">Follow</span>',n+="</div>",n+="</div>",n+="</div>",o++}}.bind(this)),i.length>a&&(n+='<div class="text-center text-sm text-gray-500 py-2">'+(window._LANG_?.showing_items||"Showing {count} of {total} items").replace("{count}",a).replace("{total}",i.length)+"</div>"),n+="</div>",e.innerHTML=n||'<div class="text-sm text-gray-400">'+(window._LANG_?.no_data||"No Data")+"</div>"}},updateHreflangs:function(t){if(t){var e=Array.from(t.querySelectorAll("link[hreflang]")),n={},i=0,a={};e.forEach(function(t){var e=t.getAttribute("hreflang")||"",o=t.getAttribute("href")||"";o&&(n[o]=(n[o]||0)+1,a[e]&&i++,a[e]=o)});var o=e.length,r=Object.keys(n).length;document.getElementById("hreflang-total-count").textContent=o,document.getElementById("hreflang-unique-count").textContent=r,document.getElementById("hreflang-error-count").textContent=i;var s=document.getElementById("hreflangs-content");if(s){var l="";o>0&&(l+='<table class="min-w-full divide-y divide-gray-200">',l+='<thead class="bg-gray-50"><tr>',l+='<th class="px-3 py-2 text-left text-xs font-medium text-gray-500 uppercase">'+(window._LANG_?.language_label||"Language")+"</th>",l+='<th class="px-3 py-2 text-left text-xs font-medium text-gray-500 uppercase">URL</th>',l+='</tr></thead><tbody class="bg-white divide-y divide-gray-200">',e.forEach(function(t){var e=t.getAttribute("hreflang")||"",n=t.getAttribute("href")||"";l+="<tr>",l+='<td class="px-3 py-2 text-sm text-gray-900"><code class="bg-gray-100 px-2 py-1 rounded">'+this.escapeHtml(e)+"</code></td>",l+='<td class="px-3 py-2 text-sm text-gray-600 truncate max-w-md">'+this.escapeHtml(n.substring(0,60))+(n.length>60?"...":"")+"</td>",l+="</tr>"}.bind(this)),l+="</tbody></table>"),s.innerHTML=l||'<div class="text-sm text-gray-400">'+(window._LANG_?.no_data||"No Data")+"</div>"}}},updateOpenGraph:function(t){if(t){var e=Array.from(t.querySelectorAll('meta[property^="og:"], meta[name^="og:"]')),n=Array.from(t.querySelectorAll('meta[name^="twitter:"]')),i=0,a=0;e.forEach(function(t){-1!==(t.getAttribute("property")||t.getAttribute("name")||"").indexOf("image")?a++:i++}),document.getElementById("og-total-count").textContent=e.length+n.length,document.getElementById("og-basic-count").textContent=i,document.getElementById("og-image-count").textContent=a,document.getElementById("og-twitter-count").textContent=n.length;var o=document.getElementById("opengraph-content");if(o){var r="";e.length>0&&(r+='<h4 class="text-sm font-semibold text-gray-700 mb-2">Open Graph</h4>',r+='<div class="space-y-2 mb-4">',e.forEach(function(t){var e=t.getAttribute("property")||t.getAttribute("name")||"",n=t.getAttribute("content")||"";r+='<div class="flex items-start py-2 border-b border-gray-100">',r+='<div class="w-1/3 text-sm font-medium text-gray-600">'+this.escapeHtml(e)+"</div>",r+='<div class="w-2/3 text-sm text-gray-800 break-all">'+this.escapeHtml(n.substring(0,100))+(n.length>100?"...":"")+"</div>",r+="</div>"}.bind(this)),r+="</div>"),n.length>0&&(r+='<h4 class="text-sm font-semibold text-gray-700 mb-2">Twitter Cards</h4>',r+='<div class="space-y-2">
1',n.forEach(function(t){var e=t.getAttribute("name")||"",n=t.getAttribute("content")||"";r+='<div class="flex items-start py-2 border-b border-gray-100">',r+='<div class="w-1/3 text-sm font-medium text-gray-600">'+this.escapeHtml(e)+"</div>",r+='<div class="w-2/3 text-sm text-gray-800 break-all">'+this.escapeHtml(n.substring(0,100))+(n.length>100?"...":"")+"</div>",r+="</div>"}.bind(this)),r+="</div>"),o.innerHTML=r||'<div class="text-sm text-gray-400">'+(window._LANG_?.no_data||"No Data")+"</div>"}}},updateStructured:function(t){if(t){var e=Array.from(t.querySelectorAll('script[type="application/ld+json"]')),n=Array.from(t.querySelectorAll("[itemscope]")),i=[];e.forEach(function(t){try{var e=JSON.parse(t.textContent);Array.isArray(e)?e.forEach(function(t){t["@type"]&&i.push(t["@type"])}):e["@type"]&&i.push(e["@type"])}catch(t){}}),n.forEach(function(t){var e=t.getAttribute("itemtype");if(e){var n=e.split("/").pop();-1===i.indexOf(n)&&i.push(n)}}),document.getElementById("jsonld-count").textContent=e.length,document.getElementById("microdata-count").textContent=n.length,document.getElementById("schema-types-count").textContent=i.length;var a=document.getElementById("structured-content");if(a){var o="";i.length>0&&(o+='<h4 class="text-sm font-semibold text-gray-700 mb-2">'+(window._LANG_?.schema_org_type||"Schema.org Types")+"</h4>",o+='<div class="flex flex-wrap gap-2 mb-4">',i.forEach(function(t){o+='<span class="inline-flex items-center px-3 py-1 bg-indigo-100 text-indigo-700 text-sm rounded-full">'+this.escapeHtml(t)+"</span>"}.bind(this)),o+="</div>"),e.length>0&&(o+='<h4 class="text-sm font-semibold text-gray-700 mb-2">'+(window._LANG_?.json_ld_data||"JSON-LD Data")+"</h4>",o+='<div class="space-y-3">',e.forEach(function(t,e){try{var n=JSON.parse(t.textContent),i=JSON.stringify(n,null,2);o+='<div class="bg-gray-100 rounded-lg p-3 overflow-x-auto border border-gray-200">',o+='<pre class="text-xs text-gray-800"><code>'+this.escapeHtml(i.substring(0,500))+(i.length>500?"...":"")+"</code></pre>",o+="</div>"}catch(t){}}.bind(this)),o+="</div>"),a.innerHTML=o||'<div class="text-sm text-gray-400">'+(window._LANG_?.no_data||"No Data")+"</div>"}}},updateTechnology:function(t){if(t){var e=t.documentElement.outerHTML||"",n={frameworks:[],cdn:[],analytics:[],other:[]},i=function(t,i){for(var a in t)t[a].test(e)&&n[i].push(a)};i({React:/react|reactjs|_react/i,Vue:/vue\.js|vuejs|_vue/i,Angular:/angular|ng-app/i,jQuery:/jquery/i,Bootstrap:/bootstrap/i,"Tailwind CSS":/tailwind/i,Laravel:/laravel/i,WordPress:/wordpress|wp-/i,Drupal:/drupal/i,Joomla:/joomla/i},"frameworks"),i({Cloudflare:/cloudflare/i,"AWS CloudFront":/cloudfront|amazonaws/i,Cloudinary:/cloudinary/i,Akamai:/akamai/i,Fastly:/fastly/i,jsDelivr:/jsdelivr/i,cdnjs:/cdnjs/i,unpkg:/unpkg\.com/i},"cdn"),i({"Google Analytics":/googletagmanager|google-analytics|ga\(|gtag\(/i,"Google Tag Manager":/googletagmanager/i,"Facebook Pixel":/facebook.*pixel|fbevents/i,Hotjar:/hotjar/i,Mixpanel:/mixpanel/i,Segment:/segment\.com/i,Matomo:/matomo|piwik/i},"analytics"),i({"Font Awesome":/fontawesome|fa-/i,"Google Fonts":/fonts\.googleapis/i,"Lazy Loading":/loading="lazy"|lazyload/i,"Service Worker":/service.*worker|navigator\.serviceWorker/i,PWA:/manifest\.json|service-worker/i},"other"),document.getElementById("tech-frameworks-count").textContent=n.frameworks.length,document.getElementById("tech-cdn-count").textContent=n.cdn.length,document.getElementById("tech-analytics-count").textContent=n.analytics.length,document.getElementById("tech-other-count").textContent=n.other.length;var a=document.getElementById("technology-content");if(a){var o="",r=function(t,e,n){e.length>0&&(o+='<h4 class="text-sm font-semibold text-gray-700 mb-2">'+t+"</h4>",o+='<div class="flex flex-wrap gap-2 mb-4">',e.forEach(function(t){o+='<span class="inline-flex items-center px-3 py-1 bg-'+n+"-100 text-"+n+'-700 text-sm rounded-full">'+t+"</span>"}),o+="</div>")};r(window._LANG_?.tech_frameworks||"Frameworks",n.frameworks,"rose"),r(window._LANG_?.tech_cdn||"CDN Services",n.cdn,"blue"),r(window._LANG_?.tech_analytics||"Analytics",n.analytics,"green"),r(window._LANG_?.tech_other||"Other",n.other,"purple"),a.innerHTML=o||'<div class="text-sm text-gray-400">'+(window._LANG_?.no_data||"No Data")+"</div>"}}},escapeHtml:function(t){if(!t)return"";var e=document.createElement("div");return e.textContent=t,e.innerHTML}};window.ViewPageSource=t,document.addEventListener("DOMContentLoaded",function(){document.getElementById("view-source-btn")&&t.init()})}();
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.