!function(){"use strict";(t=>{try{const{screen:{width:f,height:u},navigator:{language:h,doNotTrack:d,msDoNotTrack:g},location:m,document:p,history:y,top:v,doNotTrack:b}=t,{currentScript:w,referrer:E}=p;if(!w)return;const{hostname:S,href:A,origin:_}=m;let N;try{N=A.startsWith("data:")?void 0:t.localStorage}catch{}const T=w.getAttribute.bind(w),x=t=>T(`data-${t}`);const U=(c=w.src,s=new RegExp("[?&]"+"site"+"=([^&#]*)"),(l=c.match(s))?decodeURIComponent(l[1]):null),C=x("host-url"),M=x("before-send"),I=x("tag")||void 0,k="false"!==x("auto-track"),L="true"===x("do-not-track"),O="true"===x("exclude-search"),R="true"===x("exclude-hash"),B=x("domains")||"",D=B.split(",").map(t=>t.trim()),$=`${(C||""||w.src.split("/").slice(0,-1).join("/")).replace(/\/$/,"")}/bt-stats.gif`,j=`${f}x${u}`,P="33724f5a-7bf8-408e-85cb-36fa0aa40f19:8b40f3d4-4c97-4d99-8f03-d92b1771c286:d08da3c30fa52b50afce4dd8912b979ea2de527d48730ce820f9138c89ba044c",K="1783522558",W={},H="MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAo+sWio3jbJoyc1nS6N/rtdbx8jywqvO3qkC/74+W9XbzoorQZa2IStIizy2iArJw1a5n+iAkKSAXjln4EMZDE4cAIApSXUG3T6oc9N44a7TcjZOtoAndIntb4JFLzhIo94iOvgReSiojV5I6uYi91EWy1K3cXL+Da4g7nWSbD+kZdoO+RofRAP7HdQ73TYC1qeTk0aRbhlllUwqK40A6i8pWH5DKdjaY184EXe+I9ahxIl1OBSQgTxS1FT1XijGf/JJgm3Vf0ZXzMWEXYZ+MAFv6/tAPtwxQUf7zwVHA4vOKYPFz0gmUFbGYu22Qii8rFgqWZ5a/P0YTb8pdPIqjGwIDAQAB",G="33724f5a-7bf8-408e-85cb-36fa0aa40f19",J="8b40f3d4-4c97-4d99-8f03-d92b1771c286";let V=null;var e,n=0;function Y(){if(!e)if(W&&"object"==typeof W&&!Array.isArray(W))try{e=Object.keys(W).map(function(t){var e=t.replace(/[.+^${}()|[\]\\]/g,"\\$&");return{pattern:new RegExp("^"+e.replace(/\*/g,".*")+"$","i"),value:W[t]}})}catch(t){e=[]}else e=[]}function q(){if(Y(),!e||0===e.length)return!1;for(var t=0;t1&&(i+=":nth-of-type("+l+")")}e.unshift(i),n=s,r++}return e.join(" > ")}function X(t){var e=t.target,n=p.documentElement.clientWidth||1,a=p.documentElement.clientHeight||1,o=p.documentElement.scrollWidth||1,i=p.documentElement.scrollHeight||1;r.push({nx:Math.round(t.pageX/o*1920),ny:Math.round(t.pageY/i*(1920/o*i)),s:Q(e),vw:Math.round(n),vh:Math.round(a),t:Date.now()}),r.length>=5&&z()}function z(){if(r.length){var t=r.slice();if(r=[],q()){var e={...mt(),url_id:n,clicks:t};console.log("[btStats] heatmap behavior:",JSON.stringify(e)),wt(e,"heat_map")}}}function F(t){const e=atob(t),n=new Uint8Array(e.length);for(let t=0;tt>>>e|t<<32-e>>>0;let r=1779033703,a=3144134277,o=1013904242,i=2773480762,c=1359893119,s=2600822924,l=528734635,f=1541459225;const u=t.length,h=u+9+63>>6<<6,d=new Uint8Array(h);d.set(t),d[u]=128;const g=8*Math.floor(u/536870912),m=8*u>>>0;d[h-8]=g>>>24&255,d[h-7]=g>>>16&255,d[h-6]=g>>>8&255,d[h-5]=255&g,d[h-4]=m>>>24&255,d[h-3]=m>>>16&255,d[h-2]=m>>>8&255,d[h-1]=255&m;for(let t=0;t>>0}for(let t=16;t<64;t++){const e=u[t-15],r=u[t-2],a=(n(e,7)^n(e,18)^e>>>3)>>>0,o=(n(r,17)^n(r,19)^r>>>10)>>>0;u[t]=u[t-16]+a+u[t-7]+o>>>0}let h=r,g=a,m=o,p=i,y=c,v=s,b=l,w=f;for(let t=0;t<64;t++){const r=w+((n(y,6)^n(y,11)^n(y,25))>>>0)+((y&v^~y&b)>>>0)+e[t]+u[t]>>>0,a=(h&g^h&m^g&m)>>>0;w=b,b=v,v=y,y=p+r>>>0,p=m,m=g,g=h,h=r+(((n(h,2)^n(h,13)^n(h,22))>>>0)+a>>>0)>>>0}r=r+h>>>0,a=a+g>>>0,o=o+m>>>0,i=i+p>>>0,c=c+y>>>0,s=s+v>>>0,l=l+b>>>0,f=f+w>>>0}const p=new Uint8Array(32),y=[r,a,o,i,c,s,l,f];for(let t=0;t<8;t++)p[4*t]=y[t]>>>24&255,p[4*t+1]=y[t]>>>16&255,p[4*t+2]=y[t]>>>8&255,p[4*t+3]=255&y[t];return p}function et(t,e){const n=new Uint8Array(e);for(let r=0,a=0;a>>24&255,o[t.length+1]=r>>>16&255,o[t.length+2]=r>>>8&255,o[t.length+3]=255&r;const i=tt(o),c=Math.min(32,e-a);for(let t=0;t0n;)1n&p&&(m=m*g%e),p>>=1n,g=g*g%e;const y=new Uint8Array(r);for(let t=r-1;t>=0&&m>0n;t--)y[t]=Number(0xffn&m),m>>=8n;return y}function rt(t){let e=0;function n(){return t[e++]}function r(){let n=t[e++];if(128&n){const r=127&n;n=0;for(let a=0;a1;)i++;const c=i,s=o-(c-e);let l=0n;for(let e=0;e0n;)d>>=8n,h++;return{n:l,e:u,keyBytes:h}}function at(){if(!H||0===H.indexOf("__"))return null;if(V)return V;try{const t=atob(H);let e;if(-1!==t.indexOf("-----BEGIN")){e=F(t.replace(/-----BEGIN[^-]+-----/g,"").replace(/-----END[^-]+-----/g,"").replace(/[\s\r\n]/g,""))}else{e=new Uint8Array(t.length);for(let n=0;n>6,128|63&r);else if(r<55296||r>=57344)e.push(224|r>>12,128|r>>6&63,128|63&r);else{n++;var a=65536+((1023&r)<<10|1023&t.charCodeAt(n));e.push(240|a>>18,128|a>>12&63,128|a>>6&63,128|63&a)}}return new Uint8Array(e)}function st(){const t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";let e="";const n=new Uint8Array(32);it(n);for(let r=0;r<32;r++)e+=t[n[r]%t.length];return e}function lt(t){var e=[];for(var n in t)t.hasOwnProperty(n)&&e.push(encodeURIComponent(n)+"="+encodeURIComponent(t[n]));return e.join("&")}function ft(t,e,n){if(e&&0!==e.indexOf("__")){var r=t+"="+encodeURIComponent(e)+"; path=/; SameSite=Lax";if(n>0){var a=new Date;a.setTime(a.getTime()+24*n*60*60*1e3),r+="; expires="+a.toUTCString()}p.cookie=r}}const ut=t=>{if(!t)return t;try{const e=new URL(t,m.href);return O&&(e.search=""),R&&(e.hash=""),e.toString()}catch{return t}};let ht=ut(A),dt=ut(E.startsWith(_)?"":E);var a;function gt(){var e=10,n=m.protocol,r=m.hostname,a=/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/.test(r),o="localhost"===r||"127.0.0.1"===r;"https:"!==n&&(e-=1),t.top!==t.self&&(e-=1),a&&(e-=1),p.title&&0!==p.title.length||(e-=.5);try{p.querySelector('link[rel*="icon"]')||(e-=.5)}catch(t){}return o&&(e-=2),e}a=gt();const mt=()=>({website:U,screen:j,language:h,title:p.title,hostname:S,url:ht,referrer:dt,tag:I}),pt=()=>{const t=b||d||g;return 1===t||"1"===t||"yes"===t};let yt;function vt(){if(void 0!==yt)return yt;var t=navigator.userAgent;try{if(navigator.webdriver)return yt=!0,!0;if(/Headless|PhantomJS/i.test(t))return yt=!0,!0;var e=p.createElement("canvas"),n=e.getContext("webgl")||e.getContext("experimental-webgl");if(n){var r=n.getExtension("WEBGL_debug_renderer_info");if(r){var a=n.getParameter(r.UNMASKED_RENDERER_WEBGL);if("string"==typeof a&&-1!==a.indexOf("SwiftShader"))return yt=!0,!0}}}catch(t){}return yt=!1,!1}const bt=()=>Mt||!U||vt()||N&&N.getItem("umami.disabled")||B&&!D.includes(S)||L&&pt();async function wt(e,n="event"){try{if(bt())return;const a=t[M];if("function"==typeof a&&(e=await Promise.resolve(a(n,e))),!e)return;const o=JSON.stringify({type:n,payload:e});q()&&console.log("[btStats] Heatmap page matched:",ht),console.log("[btStats] report payload: event");const i=ot(o);if(!i)return void console.warn("[btStats] 加密失败:未配置 RSA 公钥或加密错误,上报已跳过");var r=lt({token:P,site:U,v:i,nonce:st(),node_time:K});(new Image).src=$+"?"+r}catch(t){try{console.error("[btStats] send error:",t)}catch(t){}}}function Et(){const e={};let n,r=!1,a=!0,o=0,i=performance.now();const c=(t,e)=>{try{new PerformanceObserver(t=>{t.getEntries().forEach(e)}).observe({type:t,buffered:!0})}catch{}};c("navigation",t=>{o=t.activationStart||0,e.ttfb=Math.max(t.responseStart-o,0)}),c("paint",t=>{"first-contentful-paint"===t.name&&(e.fcp=Math.max(t.startTime-o,0))}),c("largest-contentful-paint",t=>{e.lcp=Math.max(t.startTime-o,0)});let s=0,l=[];c("layout-shift",t=>{if(!t.hadRecentInput){const n=l[l.length-1],r=l[0];n&&t.startTime-n.startTime-n.duration<1e3&&t.startTime-r.startTime<5e3?(s+=t.value,l.push(t)):(s=t.value,l=[t]),s>(e.cls||0)&&(e.cls=s)}});let f={};try{new PerformanceObserver(t=>{t.getEntries().forEach(t=>{if(t.interactionId){const n=f[t.interactionId];(!n||t.duration>n)&&(f[t.interactionId]=t.duration);const r=Object.values(f).sort((t,e)=>e-t);if(r.length){const t=Math.floor(.02*Math.max(r.length,10));e.inp=r[Math.min(t,r.length-1)]}}})}).observe({type:"event",buffered:!0,durationThreshold:40})}catch{}const u=e=>{try{return t.performance?.getEntriesByType?.(e)||[]}catch{return[]}};function h(){r||(!function(){if(a){if(void 0===e.ttfb){const t=u("navigation")?.[0];t&&(e.ttfb=Math.max(t.responseStart-(t.activationStart||0),0))}if(void 0===e.fcp){const t=u("paint")?.find(t=>"first-contentful-paint"===t.name);t&&(e.fcp=Math.max(t.startTime-o,0))}if(void 0===e.lcp){const t=u("largest-contentful-paint"),n=t?.[t.length-1];n&&(e.lcp=Math.max(n.startTime-o,0))}}}(),e.duration=Math.round(performance.now()-i),r=!0,n&&clearTimeout(n),wt({...mt(),...e},"performance"))}Ut=()=>{h(),a=!1,Object.keys(e).forEach(t=>delete e[t]),o=0,i=performance.now(),s=0,l=[],f={},r=!1,n&&clearTimeout(n),n=setTimeout(h,1e4)},n=setTimeout(h,1e4),p.addEventListener("visibilitychange",()=>{"hidden"===p.visibilityState&&h()}),t.addEventListener("pagehide",h)}const St=/data-umami-event-([\w-_]+)/,At="data-umami-event";function _t(){const t=async t=>{const e=t.getAttribute(At);if(e){const n={};return t.getAttributeNames().forEach(e=>{const r=e.match(St);r&&(n[r[1]]=t.getAttribute(e))}),wt(n,e)}};p.addEventListener("click",async e=>{const n=e.target,r=n.closest("a,button");if(!r)return void t(n);const{href:a,target:o}=r;if(r.getAttribute(At))if("BUTTON"!==r.tagName){if("A"===r.tagName&&a){const n="_blank"===o||e.ctrlKey||e.shiftKey||e.metaKey||e.button&&1===e.button;n||e.preventDefault(),t(r).then(()=>{n||(("_top"===o?v.location:m).href=a)})}}else t(r)},!0)}let Nt=null;function Tt(){const t=(t,e,n)=>{const r=t[e];return(...e)=>(n.apply(null,e),r.apply(t,e))},e=(t,e,n)=>{n&&(Nt&&(clearTimeout(Nt),Nt=null),"function"==typeof Ut&&Ut(),z(),dt=ht,ht=ut(n),ht!==dt&&(Nt=setTimeout(function(){Nt=null,xt()},300)))};y.pushState=t(y,"pushState",e),y.replaceState=t(y,"replaceState",e)}const xt=(t,e)=>wt("string"==typeof t?{...mt(),name:t,data:e}:"object"==typeof t?{...t}:"function"==typeof t?t(mt()):{...mt(),score:a});t.btStats={track:xt};let Ut,Ct=!1,Mt=!1;function It(){if(!Ct){Ct=!0;try{ft("ANACCOUNT",G,365),ft("ANASID",J,0)}catch(t){}try{xt()}catch(t){try{console.error("[btStats] track error:",t)}catch(t){}}try{Tt()}catch(t){}try{_t()}catch(t){}try{Et()}catch(t){}try{q()&&(p.addEventListener("click",X,!0),setInterval(z,1e4),p.addEventListener("visibilitychange",function(){"hidden"===p.visibilityState&&z()}),t.addEventListener("pagehide",z))}catch(t){}try{p.addEventListener("visibilitychange",function(){"hidden"===p.visibilityState&&e()}),t.addEventListener("pagehide",e)}catch(t){}}function e(){try{Nt&&(clearTimeout(Nt),Nt=null,xt())}catch(t){}}}k&&!bt()&&("complete"===p.readyState?It():p.addEventListener("readystatechange",It,!0))}catch(kt){try{console.error("[btStats] init error:",kt);var o=kt&&kt.message?String(kt.message):String(kt),i=encodeQueryParams({msg:o.substring(0,500),url:href});(new Image).src=host.replace(/\/$/,"")+"?"+i}catch(Lt){}}var c,s,l})(window)}();