@zaplier/sdk 1.2.0 → 1.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/sdk.min.js CHANGED
@@ -4,4 +4,4 @@
4
4
  * (c) 2025 RabbitTracker Team
5
5
  * https://zaplier.com
6
6
  */
7
- var e=function(e){"use strict";function t(e,t){const n=e[1]+t[1]&4294967295;return[e[0]+t[0]+(n<e[1]?1:0)&4294967295,n]}function n(e,t){const n=65535&e[1],o=e[1]>>>16,i=65535&t[1],r=t[1]>>>16,s=n*r+o*i&4294967295,a=o*r+(s>>>16),c=n*i+((65535&s)<<16)&4294967295;return[e[0]*t[1]+e[1]*t[0]+a&4294967295,c]}function o(e,t){return 0==(t%=64)?e:t<32?[4294967295&(e[0]<<t|e[1]>>>32-t),4294967295&(e[1]<<t|e[0]>>>32-t)]:(t-=32,[4294967295&(e[1]<<t|e[0]>>>32-t),4294967295&(e[0]<<t|e[1]>>>32-t)])}function i(e,t){return[e[0]^t[0],e[1]^t[1]]}function r(e){let t=e;return t=i(t,[0,t[0]>>>1]),t=n(t,[4283543511,3981806797]),t=i(t,[0,t[0]>>>1]),t=n(t,[3301882366,444984403]),t=i(t,[0,t[0]>>>1]),t}function s(e,s=0){const a=function(e){const t=[];for(let n=0;n<e.length;n+=4){let o=0;for(let t=Math.min(3,e.length-n-1);t>=0;t--)o=o<<8|e.charCodeAt(n+t);t.push(o)}return t}(e),c=Math.floor(a.length/4);let l=[0,s],u=[0,s];const h=[2277735313,289559509],d=[1291169091,658871167];for(let e=0;e<c;e++){const r=4*e,s=4*e+2;let c=[a[r+1]||0,a[r]||0],p=[a[s+1]||0,a[s]||0];c=n(c,h),c=o(c,31),c=n(c,d),l=i(l,c),l=o(l,27),l=t(l,u),l=t(n(l,[0,5]),[0,1390208809]),p=n(p,d),p=o(p,33),p=n(p,h),u=i(u,p),u=o(u,31),u=t(u,l),u=t(n(u,[0,5]),[0,944331445])}const p=4*c,m=a.length-p;let f=[0,0],g=[0,0];return m>=12&&(g=i(g,[a[p+3]||0,0])),m>=8&&(g=i(g,[0,a[p+2]||0]),g=n(g,d),g=o(g,33),g=n(g,h),u=i(u,g)),m>=4&&(f=i(f,[a[p+1]||0,0])),m>=1&&(f=i(f,[0,a[p]||0]),f=n(f,h),f=o(f,31),f=n(f,d),l=i(l,f)),l=i(l,[0,e.length]),u=i(u,[0,e.length]),l=t(l,u),u=t(u,l),l=r(l),u=r(u),l=t(l,u),u=t(u,l),(l[0]>>>0).toString(16).padStart(8,"0")+(l[1]>>>0).toString(16).padStart(8,"0")+((u[0]>>>0).toString(16).padStart(8,"0")+(u[1]>>>0).toString(16).padStart(8,"0"))}function a(e){let t=0;if(0===e.length)return t.toString(36);for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n),t&=t;return Math.abs(t).toString(36)}function c(e,t=!1){const n=h(e),o=JSON.stringify(n);t&&console.log("[RabbitTracker] hashFingerprint debug:",{originalKeys:Object.keys(e),canonicalizedKeys:Object.keys(n),canonicalLength:o.length,sample:o.substring(0,200)+"..."});const i=s(o);return t&&console.log("[RabbitTracker] Generated fingerprintHash:",i.substring(0,32)),i}function l(e){return"vis_"+e.substring(0,16)}function u(e){return["duration","timestamp","error","errors","collectionTime","startTime","endTime","_timestamp"].includes(e)||e.endsWith("_timestamp")||e.endsWith("Timestamp")}function h(e){if(null==e)return null;if(Array.isArray(e))return e.map(e=>h(e)).filter(e=>null!==e).sort((e,t)=>JSON.stringify(e).localeCompare(JSON.stringify(t)));if("object"==typeof e){const t=Object.keys(e).sort(),n={};for(const o of t){if(u(o))continue;const t=h(e[o]);null!==t&&(n[o]=t)}return n}return"number"==typeof e?Number.isFinite(e)?Math.abs(e)<1e-4?0:Math.abs(e)>1e6?e>0?1e6:-1e6:Number(e>=.1&&e<=10?e.toFixed(3):e.toFixed(2)):0:"string"==typeof e?e.trim().toLowerCase():"boolean"==typeof e?e:null}const d={SAMPLE_RATE:44100,DURATION:.1,FREQUENCIES:[440,1e3,1760,3520],COMPRESSOR_THRESHOLD:-50,COMPRESSOR_KNEE:40,COMPRESSOR_RATIO:12,COMPRESSOR_ATTACK:.003,COMPRESSOR_RELEASE:.25,FILTER_FREQUENCY:2e3,GAIN_VALUE:.5,DELAY_TIME:.02};function p(){try{const e=window.OfflineAudioContext||window.webkitOfflineAudioContext;if(!e)return null;const t=44100,n=d.DURATION;return new e(1,Math.floor(t*n),t)}catch{return null}}async function m(e){try{const t=d.FREQUENCIES.map((t,n)=>{const o=e.createOscillator(),i=["sine","square","sawtooth","triangle"],r=i[n%i.length];return o.type=r||"sine",o.frequency.setValueAtTime(t,e.currentTime),o}),n=e.createDynamicsCompressor(),o=e.createBiquadFilter(),i=e.createGain(),r=e.createDelay(),s=e.createAnalyser();n.threshold.setValueAtTime(d.COMPRESSOR_THRESHOLD,e.currentTime),n.knee.setValueAtTime(d.COMPRESSOR_KNEE,e.currentTime),n.ratio.setValueAtTime(d.COMPRESSOR_RATIO,e.currentTime),n.attack.setValueAtTime(d.COMPRESSOR_ATTACK,e.currentTime),n.release.setValueAtTime(d.COMPRESSOR_RELEASE,e.currentTime),o.type="bandpass",o.frequency.setValueAtTime(d.FILTER_FREQUENCY,e.currentTime),o.Q.setValueAtTime(.7,e.currentTime),i.gain.setValueAtTime(d.GAIN_VALUE,e.currentTime),r.delayTime.setValueAtTime(d.DELAY_TIME,e.currentTime);const c=e.createGain();c.gain.setValueAtTime(.25,e.currentTime),t.forEach(e=>{e.connect(c)}),c.connect(o),o.connect(n),n.connect(i),i.connect(r),r.connect(s),s.connect(e.destination),t.forEach((e,t)=>{e.start(.01*t),e.stop(d.DURATION)});const l=(await e.startRendering()).getChannelData(0),u=[];for(let e=0;e<32;e++){const t=Math.floor(l.length/32*e);u.push(l[t]||0)}const h=Math.sqrt(u.reduce((e,t)=>e+t*t,0)/u.length),p=Math.max(...u.map(Math.abs)),m=u.reduce((e,t)=>e+Math.abs(t),0)/u.length;let f=0;for(let e=0;e<Math.min(u.length,16);e++){const t=u[e];void 0!==t&&(f+=e*Math.abs(t))}return a([...u,h,p,m,f].join(","))}catch(e){return a("multi_oscillator_error")}}async function f(e){try{const t=[100,440,1e3,2e3,4e3,8e3,12e3,16e3],n=[];for(const o of t){const t=e.createOscillator(),i=e.createAnalyser();t.type="sine",t.frequency.setValueAtTime(o,e.currentTime),i.fftSize=256,i.smoothingTimeConstant=0,t.connect(i),i.connect(e.destination),t.start(),t.stop(.05);const r=p();if(r){const e=r.createOscillator();e.type="sine",e.frequency.setValueAtTime(o,r.currentTime),e.connect(r.destination),e.start(),e.stop(.05);try{const e=(await r.startRendering()).getChannelData(0),t=Math.sqrt(e.reduce((e,t)=>e+t*t,0)/e.length);n.push(t)}catch{n.push(0)}}}return a(n.join(","))}catch(e){return a("frequency_response_error")}}async function g(e){try{const t=e.createOscillator(),n=e.createDynamicsCompressor();t.type="triangle",t.frequency.setValueAtTime(d.FREQUENCIES[0],e.currentTime),n.threshold.setValueAtTime(d.COMPRESSOR_THRESHOLD,e.currentTime),n.knee.setValueAtTime(d.COMPRESSOR_KNEE,e.currentTime),n.ratio.setValueAtTime(d.COMPRESSOR_RATIO,e.currentTime),n.attack.setValueAtTime(d.COMPRESSOR_ATTACK,e.currentTime),n.release.setValueAtTime(d.COMPRESSOR_RELEASE,e.currentTime),t.connect(n),n.connect(e.destination),t.start(),t.stop(d.DURATION);const o=(await e.startRendering()).getChannelData(0);return a([o[0]||0,o[Math.floor(.25*o.length)]||0,o[Math.floor(.5*o.length)]||0,o[Math.floor(.75*o.length)]||0,o[o.length-1]||0].join(","))}catch(e){return a("compressor_error")}}async function y(){const e=performance.now();try{const t=function(){try{const e=window.OfflineAudioContext||window.webkitOfflineAudioContext;if(e)try{return new e(1,1,44100).sampleRate}catch{}const t=window.AudioContext||window.webkitAudioContext;if(t)try{const e=new t,n=e.sampleRate;return e.close().catch(()=>{}),n}catch{}}catch{}return 44100}(),n=function(){const e={};try{const t=p();if(t){e.sampleRate=t.sampleRate,e.length=t.length,e.state=t.state;const n=[],o=[8e3,22050,44100,48e3,96e3];for(const e of o)try{const t=new(window.OfflineAudioContext||window.webkitOfflineAudioContext)(1,1,e);t.sampleRate===e&&n.push(e),"close"in t&&"function"==typeof t.close&&t.close()}catch{}e.supportedSampleRates=n,"baseLatency"in t&&(e.baseLatency=t.baseLatency),"close"in t&&"function"==typeof t.close&&t.close()}}catch(t){e.error="context_characteristics_error"}return e}(),o={multiOsc:p(),compressor:p(),frequencyResponse:p()};if(!o.multiOsc||!o.compressor||!o.frequencyResponse)throw new Error("OfflineAudioContext not available");const[i,r,s]=await Promise.all([m(o.multiOsc).catch(()=>"multi_oscillator_error"),g(o.compressor).catch(()=>"compressor_error"),f(o.frequencyResponse).catch(()=>"frequency_response_error")]),c={};try{const e=p();if(e){const t=["createOscillator","createAnalyser","createBiquadFilter","createConvolver","createDelay","createDynamicsCompressor","createGain","createWaveShaper","createStereoPanner","createChannelSplitter","createChannelMerger"];for(const n of t)try{"function"==typeof e[n]&&(e[n](),c[n]=!0)}catch{c[n]=!1}"close"in e&&"function"==typeof e.close&&e.close()}}catch{}const l=a([i,r,s,t.toString(),JSON.stringify(n),JSON.stringify(c)].join("|")),u=performance.now();return{value:{oscillator:i,compressor:r,sampleRate:t,maxChannelCount:n.supportedSampleRates?.length||2,multiOscillatorFingerprint:i,frequencyResponseFingerprint:s,contextCharacteristics:n,nodeCapabilities:c,audioStackHash:l,supportedSampleRates:n.supportedSampleRates||[]},duration:u-e}}catch(t){return{value:{oscillator:"error",compressor:"error",sampleRate:0,maxChannelCount:0,multiOscillatorFingerprint:"error",frequencyResponseFingerprint:"error",contextCharacteristics:{},nodeCapabilities:{},audioStackHash:"error",supportedSampleRates:[]},duration:performance.now()-e,error:t instanceof Error?t.message:"Audio fingerprinting failed"}}}function w(){try{return"function"==typeof(window.OfflineAudioContext||window.webkitOfflineAudioContext)||"function"==typeof(window.AudioContext||window.webkitAudioContext)}catch{return!1}}function v(){try{return"WebKitAppearance"in document.documentElement.style||"webkitRequestFileSystem"in window||"webkitResolveLocalFileSystemURL"in window||Boolean(window.safari)}catch{return!1}}function b(){try{return"ontouchstart"in window&&("orientation"in window||"onorientationchange"in window)&&/android/i.test(navigator.userAgent)}catch{return!1}}function k(){try{if("brave"in navigator&&navigator.brave)return!0;const e=navigator.userAgent;return!!e.includes("Brave")||!(!window.chrome||!window.chrome.runtime||window.chrome.webstore||window.navigator.getBattery||!/Chrome/.test(e))}catch{return!1}}function _(){try{const e=navigator.userAgent;return!!(e.includes("Arc/")||window.arc||window.Arc||window.chrome&&window.chrome.runtime&&/Chrome/.test(e)&&(e.includes("ArcBrowser")||"arc:"===window.location.protocol))}catch{return!1}}function S(){try{if(window.opr||window.opera)return!0;const e=navigator.userAgent;return!(!e.includes("OPR/")&&!e.includes("Opera/"))}catch{return!1}}function E(){try{return!!navigator.userAgent.includes("Vivaldi/")||!!window.vivaldi}catch{return!1}}function A(){try{const e=navigator.userAgent;return e.includes("SamsungBrowser/")||e.includes("Samsung Internet")}catch{return!1}}function T(){try{return!(k()||_()||S()||E()||M()||A())&&Boolean(window.chrome&&(window.chrome.webstore||window.chrome.runtime)&&/Chrome/.test(navigator.userAgent)&&!/Edg|OPR|Opera|Vivaldi|SamsungBrowser|Arc|Brave/.test(navigator.userAgent))}catch{return!1}}function C(){try{return"InstallTrigger"in window||"mozInnerScreenX"in window||"mozPaintCount"in window||Boolean(navigator.mozApps)}catch{return!1}}function M(){try{return"msCredentials"in navigator||Boolean(window.StyleMedia)||T()&&/edg/i.test(navigator.userAgent)}catch{return!1}}function R(){try{return v()&&!T()&&!M()&&Boolean(window.safari)&&/safari/i.test(navigator.userAgent)}catch{return!1}}function x(){try{return window.isSecureContext||"https:"===location.protocol}catch{return!1}}function D(){try{return"webkitTemporaryStorage"in navigator||navigator.storage&&navigator.storage.estimate&&navigator.storage.estimate().then(e=>(e.quota||0)<104857600),!1}catch{return!1}}function I(){return k()||_()||S()||E()||A()||T()?"Blink":M()?"EdgeHTML/Blink":C()?"Gecko":v()||R()?"WebKit":"Unknown"}function O(){const e=function(){try{if(k())return"Brave";if(_())return"Arc";if(S())return"Opera";if(E())return"Vivaldi";if(A())return"Samsung Internet";if(M())return"Edge";if(C())return"Firefox";if(R())return"Safari";if(T())return"Chrome";const e=navigator.userAgent;return/Firefox/i.test(e)&&!T()?"Firefox":/Safari/i.test(e)&&!T()?"Safari":/Chrome/i.test(e)?"Chrome":"Unknown"}catch{return"Unknown"}}(),t=I(),n=["Brave","Arc","Opera","Vivaldi","Samsung Internet","Edge","Chrome"].includes(e);let o=e.toLowerCase();return n&&"Chrome"!==e&&(o=`${e.toLowerCase()}-chromium`),{name:e,engine:t,isChromiumBased:n,family:o}}function P(){try{return"undefined"!=typeof document&&"function"==typeof document.createElement&&void 0!==document.body}catch{return!1}}function L(){try{if(!P())return!1;const e=document.createElement("canvas"),t=e.getContext("webgl")||e.getContext("experimental-webgl");if(!t)return!1;const n=t,o=n.getParameter(n.RENDERER),i=Boolean(o&&"string"==typeof o),r=n.getExtension("WEBGL_lose_context");return r&&r.loseContext(),i}catch{return!1}}function N(){try{return!(!window.AudioContext&&!window.webkitAudioContext)}catch{return!1}}function B(){const e=P(),t=function(){try{return"undefined"!=typeof window&&"function"==typeof window.matchMedia}catch{return!1}}();return{engine:I(),supportsDOM:e,supportsMediaQueries:t,supportsWebGL:L(),supportsAudio:N(),isSecure:x(),isPrivateMode:D(),canRunDOMBlockers:(v()||b())&&e,canRunAccessibility:t,canRunBrowserAPIs:e&&"undefined"!=typeof navigator}}async function F(){const e=performance.now();try{const t=function(){try{const e=navigator.language||"";let t=[];navigator.languages?t=Array.from(navigator.languages):navigator.language&&(t=[navigator.language]);const n=[navigator.userLanguage,navigator.browserLanguage,navigator.systemLanguage].filter(Boolean);return t=[...new Set([...t,...n])],{language:e,languages:t}}catch{return{language:"",languages:[]}}}(),n=function(){try{let e="";if(Intl&&Intl.DateTimeFormat)try{e=Intl.DateTimeFormat().resolvedOptions().timeZone}catch{}if(!e){const t=new Date(2024,0,1).getTimezoneOffset(),n=t>0?"-":"+",o=Math.floor(Math.abs(t)/60),i=Math.abs(t)%60;e=`UTC${n}${o.toString().padStart(2,"0")}:${i.toString().padStart(2,"0")}`}return{timezone:e,timezoneOffset:new Date(2024,0,1).getTimezoneOffset()}}catch{return{timezone:"",timezoneOffset:0}}}(),o=function(){try{return{platform:navigator.platform||"",userAgent:navigator.userAgent||""}}catch{return{platform:"",userAgent:""}}}(),i=function(){try{const e=navigator.hardwareConcurrency||0;let t;"deviceMemory"in navigator&&(t=navigator.deviceMemory);const n={hardwareConcurrency:e};return void 0!==t&&(n.deviceMemory=t),n}catch{return{hardwareConcurrency:0}}}(),r=function(){try{const e=!1!==navigator.cookieEnabled;let t=null;return"doNotTrack"in navigator?t=navigator.doNotTrack:"msDoNotTrack"in navigator?t=navigator.msDoNotTrack:"mozDoNotTrack"in window&&(t=window.mozDoNotTrack),{cookieEnabled:e,doNotTrack:t}}catch{return{cookieEnabled:!0,doNotTrack:null}}}(),s=function(){try{if(!navigator.plugins)return{length:0,names:[]};const e=Array.from(navigator.plugins).map(e=>e.name).filter(e=>e).sort();return{length:navigator.plugins.length,names:e.slice(0,10)}}catch{return{length:0,names:[]}}}(),a=function(){try{let e=0,t=!1,n=!1;"maxTouchPoints"in navigator?e=navigator.maxTouchPoints:"msMaxTouchPoints"in navigator&&(e=navigator.msMaxTouchPoints);try{t="TouchEvent"in window}catch{t="ontouchstart"in window}return n="ontouchstart"in window,{maxTouchPoints:e,touchEvent:t,touchStart:n}}catch{return{maxTouchPoints:0,touchEvent:!1,touchStart:!1}}}(),c=function(){try{return O()}catch{return{name:"Unknown",engine:"Unknown",isChromiumBased:!1,family:"unknown"}}}(),l=performance.now(),u={language:t.language,languages:t.languages,timezone:n.timezone,timezoneOffset:n.timezoneOffset,platform:o.platform,userAgent:o.userAgent,browserInfo:c,hardwareConcurrency:i.hardwareConcurrency,cookieEnabled:r.cookieEnabled,doNotTrack:r.doNotTrack,plugins:s,touchSupport:a};return void 0!==i.deviceMemory&&(u.deviceMemory=i.deviceMemory),{value:u,duration:l-e}}catch(t){return{value:{language:"",languages:[],timezone:"",timezoneOffset:0,platform:"",userAgent:"",hardwareConcurrency:0,cookieEnabled:!0,doNotTrack:null,plugins:{length:0,names:[]},touchSupport:{maxTouchPoints:0,touchEvent:!1,touchStart:!1}},duration:performance.now()-e,error:t instanceof Error?t.message:"Browser fingerprinting failed"}}}function U(){try{return"object"==typeof navigator&&null!==navigator}catch{return!1}}const q=["Zap Canvas 🎨🔒2024","Żółć gęślą jaźń €$¢£¥","αβγδεζηθικλμνξο","中文测试字体渲染","🌟🎯🚀💎🌊🎨"];function j(e){e.imageSmoothingEnabled=!0,e.imageSmoothingQuality="high";const t=e.createRadialGradient(75,75,0,75,75,50);t.addColorStop(0,"rgba(255, 0, 0, 0.8)"),t.addColorStop(.3,"rgba(0, 255, 0, 0.6)"),t.addColorStop(.7,"rgba(0, 0, 255, 0.4)"),t.addColorStop(1,"rgba(255, 255, 0, 0.2)"),e.fillStyle=t,e.fillRect(10,10,130,100),e.fillStyle="rgba(102, 204, 0, 0.7)",e.fillRect(15.5,15.3,49.7,49.2),e.fillStyle="#f60",e.fillRect(70.3,10.7,50.1,50.9),e.beginPath(),e.moveTo(25.2,120.1),e.bezierCurveTo(25.2,120.1,75.8,90.3,125.5,120.7),e.bezierCurveTo(125.5,120.7,90.1,150.2,60.8,140.9),e.closePath(),e.fillStyle="rgba(200, 100, 50, 0.6)",e.fill(),e.globalCompositeOperation="multiply",e.beginPath(),e.arc(50.7,80.3,20.1,0,2*Math.PI),e.fillStyle="rgba(255, 0, 100, 0.5)",e.fill(),e.beginPath(),e.arc(70.3,80.7,20.9,0,2*Math.PI),e.fillStyle="rgba(0, 255, 100, 0.5)",e.fill(),e.globalCompositeOperation="source-over",e.strokeStyle="rgba(50, 50, 50, 0.8)",e.lineWidth=.5,e.setLineDash([2.3,1.7]);for(let t=0;t<10;t++)e.beginPath(),e.moveTo(10+13.7*t,160),e.lineTo(50+11.3*t,200),e.stroke();e.setLineDash([]);const n=document.createElement("canvas");n.width=20,n.height=20;const o=n.getContext("2d");if(o){o.fillStyle="rgba(150, 75, 200, 0.3)",o.fillRect(0,0,10,10),o.fillRect(10,10,10,10);const t=e.createPattern(n,"repeat");t&&(e.fillStyle=t,e.fillRect(150,120,80,60))}e.shadowColor="rgba(0, 0, 0, 0.5)",e.shadowBlur=3.2,e.shadowOffsetX=2.1,e.shadowOffsetY=2.7,e.fillStyle="rgba(100, 200, 150, 0.8)",e.fillRect(160,30,60,40),e.shadowColor="transparent",e.shadowBlur=0,e.shadowOffsetX=0,e.shadowOffsetY=0}function V(e){const t=["14px Arial, sans-serif",'13px "Times New Roman", serif',"12px Georgia, serif","15px Helvetica, Arial, sans-serif",'11px "Courier New", monospace',"13px Verdana, sans-serif","16px Impact, fantasy",'12px "Comic Sans MS", cursive'],n=["#000","#333","#666","#999","rgba(255, 0, 0, 0.8)","rgba(0, 255, 0, 0.7)","rgba(0, 0, 255, 0.6)","rgba(128, 64, 192, 0.9)"],o=["top","hanging","middle","alphabetic","bottom"],i=["left","center","right"];let r=250;q.forEach((s,a)=>{t.forEach((t,c)=>{const l=(a+c)%n.length,u=c%o.length,h=c%i.length;e.font=t,e.fillStyle=n[l]||n[0],e.textBaseline=o[u]||"top",e.textAlign=i[h]||"left";const d=10+.7*c%200,p=r+18.3*c%100;e.fillText(s,d,p),c%2==0&&(e.strokeStyle=`rgba(${100+20*c}, ${50+15*c}, ${150+10*c}, 0.5)`,e.lineWidth=.3,e.strokeText(s,d+.5,p+.5))}),r+=120}),e.save(),e.translate(100,400),e.rotate(Math.PI/6),e.scale(1.2,.8),e.font="italic 14px Arial",e.fillStyle="rgba(200, 100, 50, 0.8)",e.fillText("Transformed & Rotated Text",0,0),e.restore(),e.font="6px Arial",e.fillStyle="#000",e.fillText("Tiny text rendering test",10,500),e.font="32px Arial",e.fillStyle="rgba(255, 0, 0, 0.5)",e.fillText("Large",10,540),e.textAlign="left",e.textBaseline="top"}async function H(){const e=performance.now();try{const t=document.createElement("canvas");t.width=300,t.height=600;const n=t.getContext("2d",{alpha:!0,desynchronized:!1,colorSpace:"srgb",willReadFrequently:!0});if(!n)throw new Error("Canvas 2D context not available");n.rect(0,0,10,10),n.rect(2,2,6,6);const o=n.isPointInPath(5,5,"evenodd");V(n);const i=a(t.toDataURL("image/png"));n.clearRect(0,0,t.width,t.height),j(n);const r=a(t.toDataURL("image/png")),s=function(e,t){try{e.clearRect(0,0,t.width,t.height),e.fillStyle="rgb(100, 150, 200)",e.fillRect(10.3,10.7,20.1,20.9),e.strokeStyle="rgb(200, 100, 50)",e.lineWidth=1.3,e.beginPath(),e.moveTo(15.2,35.8),e.lineTo(25.7,45.1),e.stroke();const n=e.getImageData(10,10,30,40).data;let o=0,i=0,r=0,s=0,a=0;for(let e=0;e<n.length;e+=4){const t=n[e]||0,c=n[e+1]||0,l=n[e+2]||0;if((n[e+3]||0)>25&&(o+=t,i+=c,r+=l,a++,e>=16)){const o=n[e-16]||0,i=Math.abs(t-o);i>=8&&(s+=i)}}if(0===a)return"no-valid-pixels";return`${10*Math.round(o/a/10)}-${10*Math.round(i/a/10)}-${10*Math.round(r/a/10)}-${10*Math.round(s/a/10)}`}catch(e){return"subpixel-error"}}(n,t),c=function(e,t,n,o){const i=[];let r=0;try{const s=o.getImageData(0,0,1,1);s&&0!==s.data.length||(i.push("getImageData-blocked"),r+=3),(e.length<8||t.length<8)&&(i.push("short-hash"),r+=2);const a=["error","blocked","disabled","00000000","ffffffff","12345678"];(a.includes(e)||a.includes(t))&&(i.push("known-blocked-hash"),r+=3),("subpixel-error"===n||n.includes("0-0-0"))&&(i.push("subpixel-anomaly"),r+=2),e===t&&"error"!==e&&(i.push("identical-hashes"),r+=2);const c=document.createElement("canvas");c.width=10,c.height=10;const l=c.getContext("2d");if(l){const e=performance.now();l.fillStyle="red",l.fillRect(0,0,10,10),c.toDataURL(),performance.now()-e>50&&(i.push("slow-canvas"),r+=1)}return{isInconsistent:r>=2,confidence:Math.min(r/5,1),reasons:i}}catch(e){return{isInconsistent:!0,confidence:1,reasons:["detection-error"]}}}(i,r,s,n);n.clearRect(0,0,t.width,t.height),V(n),n.globalCompositeOperation="multiply",j(n),n.globalCompositeOperation="source-over";const l=a(t.toDataURL("image/png")),u=performance.now();return{value:{text:i,geometry:r,winding:o,isInconsistent:c.isInconsistent,subPixelAnalysis:s,compositeHash:l,inconsistencyConfidence:c.confidence,blockingReasons:c.reasons},duration:u-e}}catch(t){return{value:{text:"error",geometry:"error",winding:!1,isInconsistent:!0,subPixelAnalysis:"error",compositeHash:"error",inconsistencyConfidence:1,blockingReasons:["canvas-error"]},duration:performance.now()-e,error:t instanceof Error?t.message:"Canvas fingerprinting failed"}}}function z(){try{const e=document.createElement("canvas").getContext("2d");return null!==e&&"function"==typeof e.fillText}catch{return!1}}const W=["Arial","Arial Black","Calibri","Cambria","Comic Sans MS","Consolas","Courier New","Georgia","Impact","Lucida Console","Lucida Sans Unicode","Microsoft Sans Serif","Palatino Linotype","Segoe UI","Tahoma","Times New Roman","Trebuchet MS","Verdana","American Typewriter","Avenir","Baskerville","Big Caslon","Brush Script MT","Copperplate","Didot","Futura","Gill Sans","Helvetica","Helvetica Neue","Hoefler Text","Lucida Grande","Marker Felt","Optima","Papyrus","Phosphate","Rockwell","Savoye LET","SignPainter","Skia","Snell Roundhand","System Font","Zapfino","DejaVu Sans","DejaVu Sans Mono","DejaVu Serif","Droid Sans","Droid Sans Mono","Droid Serif","Liberation Sans","Liberation Sans Narrow","Liberation Serif","Ubuntu","Ubuntu Mono","Roboto","Roboto Condensed","Roboto Mono","Roboto Slab","Droid Sans","Droid Sans Mono","Droid Serif","Helvetica Neue","Arial","Helvetica","Courier New","Times New Roman","San Francisco","Avenir Next","Open Sans","Lato","Montserrat","Source Sans Pro","Raleway","PT Sans","Lora","Playfair Display","Oswald","Slabo 27px","Fira Sans","Hiragino Sans","Hiragino Kaku Gothic ProN","Meiryo","MS Gothic","MS Mincho","SimSun","SimHei","Microsoft YaHei","Malgun Gothic","Apple SD Gothic Neo"],$=["monospace","sans-serif","serif"],G="mmMwWLliI0O&1 ※";function Z(e,t){const n=document.createElement("canvas").getContext("2d");if(!n)return{width:0,height:0};n.font=`12px ${t}`;const o=n.measureText(e);return{width:o.width,height:o.actualBoundingBoxAscent+o.actualBoundingBoxDescent}}function X(e,t){const n=document.createElement("span");n.style.position="absolute",n.style.left="-9999px",n.style.top="-9999px",n.style.fontSize="12px",n.style.fontFamily=t,n.style.whiteSpace="nowrap",n.textContent=e,document.body.appendChild(n);const o=n.getBoundingClientRect(),i={width:o.width,height:o.height};return document.body.removeChild(n),i}function K(e,t="canvas"){const n="canvas"===t?Z:X,o=$.map(e=>n(G,e)),i=$.map(t=>n(G,`${e}, ${t}`));for(let e=0;e<o.length;e++){const t=o[e],n=i[e];if(t&&n){const e=Math.abs(t.width-n.width),o=Math.abs(t.height-n.height);if(e>.1||o>.1)return!0}}return!1}function Y(){try{const e=document.createElement("span");return e&&"object"==typeof e.style}catch{return!1}}function J(e){return 10*Math.round(e/10)}async function Q(){const e=performance.now();try{const t=function(){try{return{width:screen.width||0,height:screen.height||0}}catch{return{width:0,height:0}}}(),n=screen.colorDepth||screen.pixelDepth||0,o=function(){try{return window.devicePixelRatio||1}catch{return 1}}(),i=function(){try{const e=screen.availWidth||0,t=screen.availHeight||0;return 0===e&&0===t?{width:J(screen.width||0),height:J(screen.height||0)}:{width:J(e),height:J(t)}}catch{return{width:J(screen.width||0),height:J(screen.height||0)}}}(),r=function(){try{const e=document.documentElement,t=Math.max(e.clientWidth||0,window.innerWidth||0),n=Math.max(e.clientHeight||0,window.innerHeight||0);return{width:J(t),height:J(n)}}catch{const e=window.innerWidth||0,t=window.innerHeight||0;return{width:J(e),height:J(t)}}}(),s=function(){try{if(screen.orientation)return{angle:screen.orientation.angle,type:screen.orientation.type};const e=screen.mozOrientation||screen.msOrientation||screen.webkitOrientation;if(void 0!==e)return{angle:e,type:"unknown"};const t=screen.width>screen.height;return{angle:t?90:0,type:t?"landscape-primary":"portrait-primary"}}catch{return}}(),a=performance.now(),c={width:t.width,height:t.height,colorDepth:n,pixelRatio:o,availableWidth:i.width,availableHeight:i.height,viewportWidth:r.width,viewportHeight:r.height};return s&&(c.orientation=s),{value:c,duration:a-e}}catch(t){return{value:{width:0,height:0,colorDepth:0,pixelRatio:1,viewportWidth:0,viewportHeight:0,availableWidth:0,availableHeight:0},duration:performance.now()-e,error:t instanceof Error?t.message:"Screen fingerprinting failed"}}}function ee(){try{return"object"==typeof screen&&"number"==typeof screen.width&&"number"==typeof screen.height}catch{return!1}}let te=null,ne=0,oe=0;function ie(){try{const e=performance.now();if(te&&te.isValid)if(e-te.timestamp<18e5){if(te.context&&!te.context.isContextLost())return te.usageCount++,te.lastUsed=e,te.context;re()}else re();if(ne>=8)return console.warn("[WebGL Cache] Maximum context limit reached, reusing existing contexts"),null;const t=function(){try{if("undefined"==typeof document)return null;const e=document.createElement("canvas");return e.width=1,e.height=1,e}catch{return null}}();if(!t)return null;const n=function(e){try{const t={alpha:!1,antialias:!1,depth:!1,stencil:!1,preserveDrawingBuffer:!1,failIfMajorPerformanceCaveat:!0,powerPreference:"default"};return e.getContext("webgl",t)||e.getContext("experimental-webgl",t)}catch{return null}}(t);return n?(ne++,oe++,te={context:n,canvas:t,timestamp:e,isValid:!0,usageCount:1,lastUsed:e},n):null}catch(e){return re(),null}}function re(){if(te){try{if(te.context){const e=te.context.getExtension("WEBGL_lose_context");e&&e.loseContext()}te.canvas&&(te.canvas.width=0,te.canvas.height=0),ne>0&&ne--}catch{ne>0&&ne--}te.isValid=!1,te=null}}function se(){if(!te||!te.context)return!1;try{return!te.context.isContextLost()}catch{return!1}}function ae(){const e=ie();if(!e)return[];try{const t=e.getSupportedExtensions();return t?Array.from(t).sort():[]}catch{return[]}}function ce(){const e=ie();if(!e)return{};try{const t={},n=["VERSION","VENDOR","RENDERER","SHADING_LANGUAGE_VERSION","MAX_TEXTURE_SIZE","MAX_RENDERBUFFER_SIZE","MAX_VIEWPORT_DIMS","MAX_VERTEX_ATTRIBS","MAX_VERTEX_UNIFORM_VECTORS","MAX_FRAGMENT_UNIFORM_VECTORS","MAX_VARYING_VECTORS"];for(const o of n)try{const n=e[o];void 0!==n&&(t[o]=e.getParameter(n))}catch{}return t}catch{return{}}}function le(){try{re(),ne=0,oe=0}catch(e){console.warn("[WebGL Cache] Cleanup error:",e)}}if("undefined"!=typeof window&&(window.addEventListener("beforeunload",le),window.addEventListener("pagehide",le),window.addEventListener("unload",le),document.addEventListener("visibilitychange",()=>{}),"memory"in performance&&"function"==typeof performance.memory.addEventListener))try{performance.memory.addEventListener("memorypressure",le)}catch(e){}var ue=Object.freeze({__proto__:null,cleanupWebGLCache:le,forceCleanupWebGL:function(){re(),ne=0},getCachedWebGLContext:ie,getCachedWebGLExtensions:ae,getCachedWebGLParameters:ce,invalidateWebGLCache:re,isWebGLContextValid:se});const he={VENDOR:7936,RENDERER:7937,VERSION:7938,SHADING_LANGUAGE_VERSION:35724,MAX_VERTEX_ATTRIBS:34921,MAX_TEXTURE_SIZE:3379,MAX_RENDERBUFFER_SIZE:34024,MAX_VIEWPORT_DIMS:3386,ALIASED_LINE_WIDTH_RANGE:33902,ALIASED_POINT_SIZE_RANGE:33901,MAX_FRAGMENT_UNIFORM_VECTORS:36349,MAX_VERTEX_UNIFORM_VECTORS:36347,MAX_VARYING_VECTORS:36348,MAX_VERTEX_TEXTURE_IMAGE_UNITS:35660,MAX_TEXTURE_IMAGE_UNITS:34930,MAX_COMBINED_TEXTURE_IMAGE_UNITS:35661};function de(e,t,n){const o=e.createShader(t);return o?(e.shaderSource(o,n),e.compileShader(o),e.getShaderParameter(o,e.COMPILE_STATUS)?o:(e.deleteShader(o),null)):null}function pe(e){try{const t=e.getParameter(e.VENDOR)||"unknown",n=e.getParameter(e.RENDERER)||"unknown",o=e.getParameter(e.VERSION)||"unknown",i=`${t}|${n}|${o}|${e.getParameter(e.MAX_TEXTURE_SIZE)||0}|${e.getParameter(e.MAX_VERTEX_ATTRIBS)||0}|${e.getParameter(e.MAX_VIEWPORT_DIMS)||[0,0]}`;let r=0;for(let e=0;e<i.length;e++)r=(r<<5)-r+i.charCodeAt(e)&4294967295;return`fallback_${Math.abs(r).toString(16)}`}catch{return"webgl_unavailable"}}async function me(){const e=performance.now();try{if(!ge())throw new Error("WebGL not supported in this browser");const t=ie();if(!t)throw new Error("WebGL context not available");if(!se())throw new Error("WebGL context lost");const n=function(){try{return ce()}catch{return{}}}(),o=n.VENDOR||"unknown",i=n.RENDERER||"unknown",r=n.VERSION||"unknown";let s=o,a=i;for(let e=0;e<3;e++)try{const e=t.getExtension("WEBGL_debug_renderer_info");if(e){const n=t.getParameter(e.UNMASKED_VENDOR_WEBGL),o=t.getParameter(e.UNMASKED_RENDERER_WEBGL);n&&"unknown"!==n&&(s=n),o&&"unknown"!==o&&(a=o);break}}catch(t){if(2===e)break;await new Promise(e=>setTimeout(e,10))}const c=function(){try{return ae()}catch{return[]}}(),l=function(e){const t={};return Object.entries(he).forEach(([n,o])=>{const i=function(e,t){try{return e.getParameter(t)}catch{return null}}(e,o);null!==i&&(t[n]=Array.isArray(i)?i.join(","):i)}),["UNMASKED_VENDOR_WEBGL","UNMASKED_RENDERER_WEBGL"].forEach(n=>{try{const o=e.getExtension("WEBGL_debug_renderer_info");if(o){const i=o[n];if(void 0!==i){const o=e.getParameter(i);o&&(t[n]=o)}}}catch{}}),t}(t),u=function(e){const t=[],n=[];try{const o=[e.LOW_FLOAT,e.MEDIUM_FLOAT,e.HIGH_FLOAT,e.LOW_INT,e.MEDIUM_INT,e.HIGH_INT],i=["LOW_FLOAT","MEDIUM_FLOAT","HIGH_FLOAT","LOW_INT","MEDIUM_INT","HIGH_INT"];for(let r=0;r<o.length;r++){const s=o[r];if(void 0===s)continue;const a=e.getShaderPrecisionFormat(e.VERTEX_SHADER,s),c=e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,s);a&&t.push(`${i[r]}:${a.precision},${a.rangeMin},${a.rangeMax}`),c&&n.push(`${i[r]}:${c.precision},${c.rangeMin},${c.rangeMax}`)}}catch{}return{vertex:t.join(";"),fragment:n.join(";")}}(t),h=function(e){try{const t="\n attribute vec2 a_position;\n attribute vec3 a_color;\n varying vec3 v_color;\n uniform float u_time;\n \n void main() {\n // Complex mathematical operations to differentiate GPUs\n float wave = sin(a_position.x * 10.0 + u_time) * 0.1;\n vec2 position = a_position + vec2(wave, cos(a_position.y * 8.0) * 0.1);\n \n // GPU-specific floating point calculations\n float precision = sin(position.x * 123.456) + cos(position.y * 789.012);\n position += vec2(precision * 0.001);\n \n gl_Position = vec4(position, 0.0, 1.0);\n v_color = a_color;\n }\n ",n="\n precision mediump float;\n varying vec3 v_color;\n uniform float u_time;\n \n void main() {\n // Complex color calculations that vary between GPU vendors\n vec3 color = v_color;\n color.r += sin(gl_FragCoord.x * 0.1 + u_time) * 0.1;\n color.g += cos(gl_FragCoord.y * 0.1 + u_time) * 0.1;\n color.b += sin((gl_FragCoord.x + gl_FragCoord.y) * 0.05) * 0.1;\n \n // GPU-specific precision in color calculations\n color = normalize(color) * length(v_color);\n \n gl_FragColor = vec4(color, 1.0);\n }\n ",o=de(e,e.VERTEX_SHADER,t),i=de(e,e.FRAGMENT_SHADER,n);if(!o||!i)return pe(e);const r=function(e,t,n){const o=e.createProgram();return o?(e.attachShader(o,t),e.attachShader(o,n),e.linkProgram(o),e.getProgramParameter(o,e.LINK_STATUS)?o:(e.deleteProgram(o),null)):null}(e,o,i);if(!r)return pe(e);e.useProgram(r);const s=new Float32Array([-.8,-.6,1,.2,.3,0,.8,.3,1,.2,.8,-.6,.2,.3,1,-.5,-.2,.8,.9,.1,.3,.6,.1,.8,.9,.7,-.3,.9,.1,.8]),a=e.createBuffer();e.bindBuffer(e.ARRAY_BUFFER,a),e.bufferData(e.ARRAY_BUFFER,s,e.STATIC_DRAW);const c=e.getAttribLocation(r,"a_position"),l=e.getAttribLocation(r,"a_color"),u=e.getUniformLocation(r,"u_time");e.enableVertexAttribArray(c),e.enableVertexAttribArray(l),e.vertexAttribPointer(c,2,e.FLOAT,!1,20,0),e.vertexAttribPointer(l,3,e.FLOAT,!1,20,8),e.uniform1f(u,1.23456789),e.enable(e.BLEND),e.blendFunc(e.SRC_ALPHA,e.ONE_MINUS_SRC_ALPHA),e.clearColor(.1,.2,.3,1),e.clear(e.COLOR_BUFFER_BIT),e.drawArrays(e.TRIANGLES,0,6);const h=new Uint8Array(e.canvas.width*e.canvas.height*4);e.readPixels(0,0,e.canvas.width,e.canvas.height,e.RGBA,e.UNSIGNED_BYTE,h);let d=0;for(let e=0;e<h.length;e+=4){const t=1*(h[e]??0);d=33*d+(t+256*(h[e+1]??0)+65536*(h[e+2]??0)+16777216*(h[e+3]??0))>>>0}return e.deleteProgram(r),e.deleteShader(o),e.deleteShader(i),e.deleteBuffer(a),d.toString(16)}catch(t){return pe(e)}}(t),d=function(e){const t={};try{const n=e.getExtension("WEBGL_debug_renderer_info");n&&(t.unmaskedVendor=e.getParameter(n.UNMASKED_VENDOR_WEBGL),t.unmaskedRenderer=e.getParameter(n.UNMASKED_RENDERER_WEBGL)),t.maxTextureSize=e.getParameter(e.MAX_TEXTURE_SIZE),t.maxCombinedTextureImageUnits=e.getParameter(e.MAX_COMBINED_TEXTURE_IMAGE_UNITS),t.maxViewportDims=e.getParameter(e.MAX_VIEWPORT_DIMS),t.maxRenderbufferSize=e.getParameter(e.MAX_RENDERBUFFER_SIZE),t.maxVertexAttribs=e.getParameter(e.MAX_VERTEX_ATTRIBS),t.maxVertexUniformVectors=e.getParameter(e.MAX_VERTEX_UNIFORM_VECTORS),t.maxFragmentUniformVectors=e.getParameter(e.MAX_FRAGMENT_UNIFORM_VECTORS),t.maxVaryingVectors=e.getParameter(e.MAX_VARYING_VECTORS),t.antialias=e.getContextAttributes()?.antialias||!1;const o=e.getExtension("OES_texture_float");t.floatTextures=!!o;const i=e.getExtension("OES_texture_half_float");t.halfFloatTextures=!!i;const r=e.getParameter(e.COMPRESSED_TEXTURE_FORMATS);t.compressedTextureFormats=Array.isArray(r)?r.length:0;const s=e instanceof WebGL2RenderingContext;if(t.webgl2=s,s){const n=e;t.maxColorAttachments=n.getParameter(n.MAX_COLOR_ATTACHMENTS),t.maxDrawBuffers=n.getParameter(n.MAX_DRAW_BUFFERS),t.maxTexture3DSize=n.getParameter(n.MAX_3D_TEXTURE_SIZE)}const a=e.getParameter(e.ALIASED_LINE_WIDTH_RANGE);t.lineWidthRange=Array.isArray(a)?a.join(","):"";const c=e.getParameter(e.ALIASED_POINT_SIZE_RANGE);t.pointSizeRange=Array.isArray(c)?c.join(","):""}catch(e){}return t}(t),p=(()=>{const e=`${s||o||""}|${a||i||""}`.toLowerCase();let t=0;for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n)&4294967295;return Math.abs(t).toString(16)})(),m=performance.now();return{value:{vendor:s,renderer:a,version:r,extensions:c,parameters:l,shaderPrecision:u,renderHash:h,capabilities:d,vendorRendererHash:p,contextAttributes:t.getContextAttributes()||{}},duration:m-e}}catch(t){return{value:{vendor:"unknown",renderer:"unknown",version:"unknown",extensions:[],parameters:{},shaderPrecision:{vertex:"",fragment:""},renderHash:"",capabilities:{},vendorRendererHash:"",contextAttributes:{}},duration:performance.now()-e,error:t instanceof Error?t.message:"WebGL fingerprinting failed"}}}let fe=null;function ge(){if(null!==fe)return fe;try{const e=document.createElement("canvas");e.width=1,e.height=1;const t=e.getContext("webgl",{failIfMajorPerformanceCaveat:!0,antialias:!1,alpha:!1,depth:!1,stencil:!1,preserveDrawingBuffer:!1})||e.getContext("experimental-webgl",{failIfMajorPerformanceCaveat:!0,antialias:!1,alpha:!1,depth:!1,stencil:!1,preserveDrawingBuffer:!1}),n=null!==t;if(t&&"getExtension"in t)try{const e=t.getExtension("WEBGL_lose_context");e&&e.loseContext()}catch(e){}return e.width=0,e.height=0,fe=n,n}catch{return fe=!1,!1}}function ye(){try{for(const e of["rec2020","p3","srgb"]){const t=Re(`(color-gamut: ${e})`);if(t?.matches)return e}return"unknown"}catch{return"unknown"}}function we(){try{const e=Re("(forced-colors: active)");if(e?.matches)return!0;const t=Re("(forced-colors: none)");return!t?.matches&&null}catch{return null}}function ve(){try{const e=["no-preference","high","more","low","less","forced"];for(const t of e){const e=Re(`(prefers-contrast: ${t})`);if(e?.matches)return"high"===t?"more":"low"===t?"less":t}return"unknown"}catch{return"unknown"}}function be(){try{const e=Re("(prefers-reduced-motion: reduce)");if(e?.matches)return!0;const t=Re("(prefers-reduced-motion: no-preference)");return!t?.matches&&null}catch{return null}}function ke(){try{return!!matchMedia("(prefers-reduced-transparency: reduce)").matches||!matchMedia("(prefers-reduced-transparency: no-preference)").matches&&null}catch{return null}}function _e(){try{for(let e=8;e>=0;e--)if(matchMedia(`(monochrome: ${e})`).matches)return e;return 0}catch{return 0}}function Se(){try{return!!matchMedia("(inverted-colors: inverted)").matches||!matchMedia("(inverted-colors: none)").matches&&null}catch{return null}}function Ee(){try{return!!matchMedia("(dynamic-range: high)").matches||!matchMedia("(dynamic-range: standard)").matches&&null}catch{return null}}function Ae(){try{const e=[48,36,30,24,16,15,8];for(const t of e)if(matchMedia(`(color: ${t})`).matches)return t;return screen.colorDepth||24}catch{return screen.colorDepth||24}}function Te(){try{return matchMedia("(hover: hover)").matches?"hover":matchMedia("(hover: none)").matches?"none":"unknown"}catch{return"unknown"}}function Ce(){try{return matchMedia("(pointer: fine)").matches?"fine":matchMedia("(pointer: coarse)").matches?"coarse":matchMedia("(pointer: none)").matches?"none":"unknown"}catch{return"unknown"}}function Me(){return B().canRunAccessibility}function Re(e){try{return Me()?matchMedia(e):null}catch(e){return null}}function xe(){try{return!!matchMedia("(prefers-reduced-data: reduce)").matches||!matchMedia("(prefers-reduced-data: no-preference)").matches&&null}catch{return null}}function De(){try{const e=["fullscreen","standalone","minimal-ui","browser"];for(const t of e)if(matchMedia(`(display-mode: ${t})`).matches)return t;return"unknown"}catch{return"unknown"}}function Ie(){try{const e=["opaque","additive","subtractive"];for(const t of e)if(matchMedia(`(environment-blending: ${t})`).matches)return t;return"unknown"}catch{return"unknown"}}function Oe(){try{return!!matchMedia("(any-hover: hover)").matches||!matchMedia("(any-hover: none)").matches&&null}catch{return null}}function Pe(){try{return matchMedia("(any-pointer: fine)").matches?"fine":matchMedia("(any-pointer: coarse)").matches?"coarse":matchMedia("(any-pointer: none)").matches?"none":"unknown"}catch{return"unknown"}}function Le(){try{return matchMedia("(prefers-color-scheme: dark)").matches?"dark":matchMedia("(prefers-color-scheme: light)").matches?"light":matchMedia("(prefers-color-scheme: no-preference)").matches?"no-preference":"unknown"}catch{return"unknown"}}function Ne(){const e=ye(),t=we(),n=ve(),o=be(),i=ke(),r=_e(),s=Se(),a=Ee(),c=Ae(),l=Te(),u=Ce(),h=xe(),d=De(),p=Ie(),m=Oe(),f=Pe(),g=Le(),y=Boolean(t||o||i||s||h||"no-preference"!==n||"no-preference"!==g||r>0),w=[e,a?"hdr":"sdr",`${c}bit`,r>0?`mono${r}`:"color",g,d,p].join("-"),v=[l,u,m?"anyhover":"nohover",f].join("-");return{colorGamut:e,forcedColors:t,contrastPreference:n,reducedMotion:o,reducedTransparency:i,monochromeDepth:r,invertedColors:s,hdrSupport:a,enhancedColorDepth:c,hoverCapability:l,pointerCapability:u,reducedData:h,displayMode:d,environmentBlending:p,anyHover:m,anyPointer:f,colorScheme:g,hasAccessibilityFeatures:y,displayCapabilities:w,interactionCapabilities:v}}function Be(e){const t=["unknown"!==e.colorGamut,null!==e.forcedColors,"unknown"!==e.contrastPreference,null!==e.reducedMotion,null!==e.reducedTransparency,null!==e.invertedColors,null!==e.hdrSupport,null!==e.reducedData,"unknown"!==e.displayMode,"unknown"!==e.environmentBlending,null!==e.anyHover,"unknown"!==e.colorScheme],n=t.filter(Boolean).length/t.length,o=[null!==e.reducedData,"unknown"!==e.displayMode,"unknown"!==e.environmentBlending,"unknown"!==e.colorScheme,null!==e.hdrSupport],i=o.filter(Boolean).length/o.length,r=[!0===e.forcedColors,!0===e.reducedMotion,!0===e.reducedTransparency,!0===e.invertedColors,!0===e.reducedData,"no-preference"!==e.contrastPreference,"dark"===e.colorScheme,e.monochromeDepth>0],s=r.filter(Boolean).length/r.length,a=["srgb"!==e.colorGamut,!0===e.forcedColors,!0===e.reducedMotion,!0===e.reducedTransparency,!0===e.invertedColors,!0===e.reducedData,e.monochromeDepth>0,!0===e.hdrSupport,"browser"!==e.displayMode,"opaque"!==e.environmentBlending,"dark"===e.colorScheme],c=a.filter(Boolean).length/a.length;return{confidence:Math.round(100*n)/100,uniqueness:Math.round(100*c)/100,accessibilityScore:Math.round(100*s)/100,modernBrowserScore:Math.round(100*i)/100}}var Fe=Object.freeze({__proto__:null,analyzeAccessibilityFingerprint:Be,getAccessibilityFingerprint:Ne,getAnyHover:Oe,getAnyPointer:Pe,getColorGamut:ye,getColorScheme:Le,getContrastPreference:ve,getDisplayMode:De,getEnhancedColorDepth:Ae,getEnvironmentBlending:Ie,getForcedColors:we,getHDRSupport:Ee,getHoverCapability:Te,getInvertedColors:Se,getMonochromeDepth:_e,getPointerCapability:Ce,getReducedData:xe,getReducedMotion:be,getReducedTransparency:ke,isAccessibilityDetectionAvailable:Me});function Ue(e){if("number"==typeof e)return{confidence:0,uniqueness:0,intlApiSupport:0,localeComplexity:0};const t=Object.values(e.intlSupport).filter(Boolean).length/Object.keys(e.intlSupport).length,n=[e.locale,e.calendar,e.numberingSystem,e.timeZone,e.dateStyle,e.timeStyle,e.hourCycle,e.numberLocale,e.currencyDisplay,e.currencySign,e.notation,e.signDisplay,e.listStyle,e.relativeTimeStyle,e.pluralRules],o=n.filter(e=>"unknown"!==e&&""!==e).length/n.length,i=[e.locale.length>2?1:0,"gregory"!==e.calendar?1:0,"latn"!==e.numberingSystem?1:0,e.hour12?1:0,e.localeMatch?0:1].reduce((e,t)=>e+t,0)/5,r=(o+t+i)/3;return{confidence:Math.round(100*o)/100,uniqueness:Math.round(100*r)/100,intlApiSupport:Math.round(100*t)/100,localeComplexity:Math.round(100*i)/100}}const qe="mmMwWLliI0fiflO&1",je={default:{text:qe},serif:{style:{fontFamily:"serif"},text:qe},sans:{style:{fontFamily:"sans-serif"},text:qe},mono:{style:{fontFamily:"monospace"},text:qe},apple:{style:{font:"-apple-system-body"},text:qe},system:{style:{fontFamily:"system-ui"},text:qe},min:{style:{fontSize:"1px"},text:qe},large:{style:{fontSize:"72px"},text:qe},ui:{style:{fontFamily:"ui-serif"},text:qe},emoji:{style:{fontFamily:"Apple Color Emoji, Segoe UI Emoji, Noto Color Emoji"},text:"🎯🔥💯"},math:{style:{fontFamily:"STIX Two Math, Cambria Math"},text:"∑∆∇∂"},cjk:{style:{fontFamily:"Hiragino Sans, Microsoft YaHei, SimSun"},text:"中文测试"},arabic:{style:{fontFamily:"Tahoma, Arial Unicode MS"},text:"اختبار"},hebrew:{style:{fontFamily:"Tahoma, Arial Unicode MS"},text:"בדיקה"},subpixel:{style:{fontFamily:"Arial",fontSize:"11px",textRendering:"optimizeLegibility"},text:qe},kerning:{style:{fontFamily:"Times",fontSize:"24px",fontKerning:"normal"},text:"AV To"},ligatures:{style:{fontFamily:"Times",fontSize:"24px",fontVariantLigatures:"common-ligatures"},text:"ffi ffl fi fl"}};function Ve(e,t,n){try{const o="mmmmmmmmmmlli",i=He(e,t,{style:{fontFamily:n},text:o}),r=He(e,t,{style:{fontFamily:"monospace"},text:o});if(Math.abs(i-r)<1)return"monospace-fallback";const s=He(e,t,{style:{fontFamily:"sans-serif"},text:o});return Math.abs(i-s)<1?"sans-serif-fallback":"native-font"}catch(e){return"fallback-error"}}function He(e,t,n){const o=e.createElement("span"),{style:i={},text:r=qe}=n;o.textContent=r,o.style.cssText="position: absolute; left: 0; top: 0; white-space: nowrap; visibility: hidden;",Object.entries(i).forEach(([e,t])=>{void 0!==t&&(o.style[e]=t)}),t.appendChild(o);const s=o.getBoundingClientRect().width;return t.removeChild(o),Math.round(100*s)/100}function ze(e){const t=[e.default,e.serif,e.sans,e.mono,e.apple,e.system,e.min,e.large,e.ui,e.emoji,e.math,e.cjk,e.arabic,e.hebrew,e.subpixel,e.kerning,e.ligatures],n=t.some(e=>e>0),o=t.filter(e=>e>0).length,i=t.length;let r=n?o/i:0;(e.antiAliasing.enabled||e.systemFontHints.clearType)&&(r+=.2),Object.keys(e.fallbackBehavior).length>0&&(r+=.1),r=Math.min(r,1);const s=e.apple>0||e.system>0,a=[e.subpixel,e.kerning,e.ligatures,e.emoji,e.math].some(e=>e>0)||e.antiAliasing.enabled||e.systemFontHints.clearType,c=t.reduce((e,t)=>e+t,0)/t.length,l=t.reduce((e,t)=>e+Math.pow(t-c,2),0)/t.length;let u=Math.min(l/100,1);e.antiAliasing.smoothingLevel>0&&(u+=.1),e.systemFontHints.hintingLevel>0&&(u+=.1),u=Math.min(u,1);let h="low";const d=e.antiAliasing.smoothingLevel;d>50||e.systemFontHints.clearType?h="high":(d>20||e.systemFontHints.hintingLevel>2)&&(h="medium");const p="error"!==e.isolatedHash&&e.isolatedHash.length>0;return{confidence:Math.round(100*r)/100,uniqueness:Math.round(100*u)/100,hasSystemFonts:s,hasAdvancedFeatures:a,renderingQuality:h,isolationIntegrity:p}}const We=["sans-serif-thin","ARNO PRO","Agency FB","Arabic Typesetting","Arial Unicode MS","AvantGarde Bk BT","BankGothic Md BT","Batang","Bitstream Vera Sans Mono","Calibri","Century","Century Gothic","Clarendon","EUROSTILE","Franklin Gothic","Futura Bk BT","Futura Md BT","GOTHAM","Gill Sans","HELV","Haettenschweiler","Helvetica Neue","Humanst521 BT","Leelawadee","Letter Gothic","Levenim MT","Lucida Bright","Lucida Sans","Menlo","MS Mincho","MS Outlook","MS Reference Specialty","MS UI Gothic","MT Extra","MYRIAD PRO","Marlett","Meiryo UI","Microsoft Uighur","Minion Pro","Monotype Corsiva","PMingLiU","Pristina","SCRIPTINA","Segoe UI Light","Serifa","SimHei","Small Fonts","Staccato222 BT","TRAJAN PRO","Univers CE 55 Medium","Vrinda","ZWAdobeF","Arial","Arial Black","Comic Sans MS","Courier New","Georgia","Impact","Palatino Linotype","Tahoma","Times New Roman","Trebuchet MS","Verdana","American Typewriter","Avenir","Baskerville","Big Caslon","Brush Script MT","Copperplate","Didot","Futura","Helvetica","Hoefler Text","Lucida Grande","Marker Felt","Optima","Papyrus","Phosphate","Rockwell","Savoye LET","SignPainter","Skia","Snell Roundhand","Zapfino","DejaVu Sans","DejaVu Sans Mono","DejaVu Serif","Liberation Sans","Liberation Serif","Ubuntu","Ubuntu Mono"],$e="mmMwWLliI0O&1",Ge="48px",Ze=["monospace","sans-serif","serif"];function Xe(e,t){const n=e.createElement("span");return n.style.position="absolute",n.style.top="0",n.style.left="0",n.style.fontFamily=t,n.style.fontSize=Ge,n.style.whiteSpace="nowrap",n.textContent=$e,n}function Ke(e,t,n){return Xe(e,`'${t}',${n}`)}function Ye(e,t){return Ze.some((n,o)=>{const i=e[o],r=t[n];return!(!i||!r||i.offsetWidth===r.width&&i.offsetHeight===r.height)})}function Je(e){const{available:t,method:n,precision:o,totalTested:i,detectionTime:r}=e;let s=.5;"iframe"===n?s=.9:"dom"===n&&(s=.7),s*=o;const a=t.filter(e=>["Calibri","Segoe UI Light","MS UI Gothic","Arial Unicode MS"].includes(e)).length,c=t.filter(e=>["Helvetica Neue","Avenir","Menlo","Zapfino","Baskerville"].includes(e)).length,l=t.filter(e=>["DejaVu Sans","Liberation Sans","Ubuntu"].includes(e)).length,u=t.filter(e=>["sans-serif-thin","Roboto"].includes(e)).length;let h="unknown";a>=2?h="windows":c>=2?h="macos":l>=1?h="linux":u>=1&&(h="android");const d=Math.min(r<100?1:.8,1),p=["Arial","Times New Roman","Helvetica"],m=t.filter(e=>!p.includes(e)),f=Math.min(m.length/10,1);return{confidence:Math.round(100*s)/100,uniqueness:Math.round(100*f)/100,osSignature:h,browserCapabilities:Math.round(100*d)/100}}const Qe=Math,et=()=>0;function tt(){const e=Qe.acos||et,t=Qe.acosh||et,n=Qe.asin||et,o=Qe.asinh||et,i=Qe.atanh||et,r=Qe.atan||et,s=Qe.sin||et,a=Qe.sinh||et,c=Qe.cos||et,l=Qe.cosh||et,u=Qe.tan||et,h=Qe.tanh||et,d=Qe.exp||et,p=Qe.expm1||et,m=Qe.log1p||et,f=Qe.cbrt||et,g=Qe.hypot||et,y=Qe.log10||et,w=Qe.log2||et;return{acos:e(.12312423423423424),asin:n(.12312423423423424),atan:r(.5),cos:c(10.000000000123),sin:s(-1e300),tan:u(-1e300),acosh:t(1e308),asinh:o(1),atanh:i(.5),cosh:l(1),sinh:a(1),tanh:h(1),exp:d(1),expm1:p(1),log1p:m(10),powPI:Qe.pow(Qe.PI,-100),cbrt:f(27),hypot:g(3,4),log10:y(100),log2:w(8),acoshPf:(e=>Qe.log(e+Qe.sqrt(e*e-1)))(1e154),asinhPf:Qe.log(1+Qe.sqrt(2)),atanhPf:Qe.log(3)/2,sinhPf:(Qe.exp(1)-Qe.exp(-1))/2,coshPf:(Qe.exp(1)+Qe.exp(-1))/2,expm1Pf:Qe.exp(1)-1,tanhPf:(Qe.exp(2)-1)/(Qe.exp(2)+1),log1pPf:Qe.log(11),precision:{float32:Qe.abs(0),float64:Qe.abs(2-2.0000000000000004),bigNumbers:Qe.abs(1),smallNumbers:Qe.abs(1e-15+2e-15-3e-15)}}}function nt(){try{const e=tt();return[e.acos,e.asin,e.atan,e.cos,e.sin,e.tan,e.acosh,e.asinh,e.atanh,e.cosh,e.sinh,e.tanh,e.exp,e.expm1,e.log1p,e.powPI,e.cbrt,e.hypot,e.log10,e.log2,e.precision.float32,e.precision.float64,e.precision.bigNumbers,e.precision.smallNumbers].join(",")}catch{return"math-unavailable"}}function ot(e){let t=.9,n=.8;Object.values(e).some(e=>"number"==typeof e&&0!==e)||(t=.1,n=.1),t*=Object.values(e.precision).reduce((e,t)=>e+("number"!=typeof t||isNaN(t)?0:1),0)/4;let o="high";return t<.3?o="low":t<.7&&(o="medium"),{confidence:Math.round(100*t)/100,stability:o,uniqueness:Math.round(100*n)/100}}const it={gdprMode:!1,includeInvasive:!0,timeout:5e3,debug:!1,excludeComponents:[]},rt=new Map;function st(e,t){return!(t.excludeComponents.includes(e)||t.gdprMode&&!t.includeInvasive&&["canvas","webgl","audio","fontPreferences","enhancedFonts"].includes(e)||(["mathFingerprint","dateTimeLocale","accessibilityEnhanced","fontPreferences","enhancedFonts"].includes(e),0))}function at(e,t){rt.set(e,t)}async function ct(e,t,n){const o=`${e}_${n.gdprMode}`,i=(r=o,rt.get(r)||null);var r;if(i)return i;const s="webgl"===e,a=["canvas","webgl","audio","hardware","system"].includes(e),c=s?2:a?3:1,l=s?[200,500]:[100,250,500];for(let i=0;i<c;i++)try{const r=n.timeout+i*(s?2e3:1e3),a=new Promise((t,n)=>{setTimeout(()=>n(new Error(`${e} timeout after ${r}ms (attempt ${i+1})`)),r)}),c=await Promise.race([t(),a]);if(null!=c)return at(o,c),c;throw new Error(`${e} returned null/undefined result`)}catch(t){const n=i===c-1,o=t instanceof Error?t.message:String(t);if(s&&o.includes("context")){console.warn(`[RabbitTracker] WebGL context issue detected: ${o}`);try{const{forceCleanupWebGL:e}=await Promise.resolve().then(function(){return ue});e()}catch(e){}return null}if(n)return console.warn(`[RabbitTracker] Component ${e} failed after ${c} attempts: ${o}`),null;!o.includes("timeout")&&i<l.length&&await new Promise(e=>setTimeout(e,l[i])),s&&await new Promise(e=>setTimeout(e,100))}return null}async function lt(e={}){const t=performance.now(),n={...it,...e},o=[],i=[],r={collectionTime:t,gdprMode:n.gdprMode,components:[]},l=[];if(st("canvas",n)&&z()&&l.push(ct("canvas",H,n).then(e=>({component:"canvas",result:e}))),st("webgl",n)&&ge()&&l.push(ct("webgl",me,n).then(e=>({component:"webgl",result:e}))),st("audio",n)&&w()&&l.push(ct("audio",y,n).then(e=>({component:"audio",result:e}))),st("fonts",n)&&Y()&&l.push(ct("fonts",()=>async function(e=!0){const t=performance.now();try{let n;if(e&&function(){try{const e=document.createElement("canvas").getContext("2d");return null!==e&&"function"==typeof e.measureText}catch{return!1}}()){const{available:e,measurements:t}=function(){const e=[],t={};for(const n of W)try{const o=Z(G,n);t[n]=o,K(n,"canvas")&&e.push(n)}catch(e){continue}return{available:e,measurements:t}}();n={available:e.sort(),method:"advanced",measurements:t}}else n={available:function(){const e=[];for(const t of W)try{K(t,"dom")&&e.push(t)}catch(e){continue}return e}().sort(),method:"basic"};return{value:n,duration:performance.now()-t}}catch(e){return{value:{available:[],method:"basic"},duration:performance.now()-t,error:e instanceof Error?e.message:"Font detection failed"}}}(!n.gdprMode),n).then(e=>({component:"fonts",result:e}))),st("screen",n)&&ee()&&l.push(ct("screen",Q,n).then(e=>({component:"screen",result:e}))),st("browser",n)&&U()&&l.push(ct("browser",F,n).then(e=>({component:"browser",result:e}))),(await Promise.allSettled(l)).forEach((e,t)=>{if("fulfilled"===e.status&&e.value.result){const{component:t,result:n}=e.value;r[t]=n,o.push(t)}else{const n=l[t],o=n?.toString().match(/component: "(\w+)"/)?.[1]||"unknown";i.push({component:o,error:"rejected"===e.status?e.reason?.message||"Promise rejected":"Collection failed or timeout"})}}),!n.gdprMode)try{const{detectIncognitoHeuristics:e}=await Promise.resolve().then(function(){return Jt}),t=await e();t&&(r.incognitoDetection={likelihood:t.likelihood,methods:t.methods},o.push("incognito"))}catch(e){i.push({component:"incognito",error:e instanceof Error?e.message:"Incognito detection failed"})}if(st("hardware",n))try{const e=await Promise.resolve().then(function(){return on}).catch(()=>null);if(e?.isHardwareDetectionAvailable?.()){const t=e.getHardwareFingerprint?.();t&&(r.hardware={value:t,duration:0},o.push("hardware"))}else if(!e){const e={hardwareConcurrency:navigator.hardwareConcurrency||0,deviceMemory:navigator.deviceMemory||0,platform:navigator.platform||"unknown"};r.hardware={value:e,duration:0},o.push("hardware")}}catch(e){i.push({component:"hardware",error:e instanceof Error?e.message:"Hardware detection failed"})}if(st("system",n))try{const{getSystemFingerprint:e,isSystemDetectionAvailable:t}=await Promise.resolve().then(function(){return ln});if(t()){const t=e();t&&(r.system={value:t,duration:0},o.push("system"))}}catch(e){i.push({component:"system",error:e instanceof Error?e.message:"System detection failed"})}if(st("storage",n))try{const{getStorageFingerprint:e,isStorageDetectionAvailable:t}=await Promise.resolve().then(function(){return fn});if(t()){const t=performance.now(),n=await e(),i=performance.now()-t;n&&(r.storage={value:n,duration:i},o.push("storage"))}}catch(e){i.push({component:"storage",error:e instanceof Error?e.message:"Storage detection failed"})}if(st("math",n))try{const{getCompleteMathFingerprint:e,isMathDetectionAvailable:t}=await Promise.resolve().then(function(){return vn});if(t()){const t=performance.now(),n=e(),i=performance.now()-t;n&&(r.math={value:n,duration:i},o.push("math"))}}catch(e){i.push({component:"math",error:e instanceof Error?e.message:"Math fingerprinting failed"})}if(st("domBlockers",n))try{const{getDomBlockersFingerprint:e,isDomBlockersDetectionAvailable:t}=await Promise.resolve().then(function(){return Cn});if(t()){const t=performance.now(),i=await e({debug:n.debug}),s=performance.now()-t;i&&(r.domBlockers={value:i,duration:s},o.push("domBlockers"))}}catch(e){i.push({component:"domBlockers",error:e instanceof Error?e.message:"DOM blockers detection failed"})}if(st("accessibility",n))try{const{getAccessibilityFingerprint:e,isAccessibilityDetectionAvailable:t}=await Promise.resolve().then(function(){return Fe});if(t()){const t=performance.now(),n=e(),i=performance.now()-t;n&&(r.accessibility={value:n,duration:i},o.push("accessibility"))}}catch(e){i.push({component:"accessibility",error:e instanceof Error?e.message:"Accessibility detection failed"})}if(st("browserApis",n))try{const{getBrowserApisFingerprint:e,isBrowserApisDetectionAvailable:t}=await Promise.resolve().then(function(){return Fn});if(t()){const t=performance.now(),n=e(),i=performance.now()-t;n&&(r.browserApis={value:n,duration:i},o.push("browserApis"))}}catch(e){i.push({component:"browserApis",error:e instanceof Error?e.message:"Browser APIs detection failed"})}if(st("pluginsEnhanced",n))try{const{getEnhancedPluginFingerprint:e,isEnhancedPluginDetectionAvailable:t}=await Promise.resolve().then(function(){return Yn});if(t()){const t=performance.now(),n=e(),i=performance.now()-t;n&&(r.pluginsEnhanced={value:n,duration:i},o.push("pluginsEnhanced"))}}catch(e){i.push({component:"pluginsEnhanced",error:e instanceof Error?e.message:"Enhanced plugin detection failed"})}if(st("mathFingerprint",n)&&function(){try{return"undefined"!=typeof Math&&"function"==typeof Math.sin}catch{return!1}}())try{const e=performance.now(),t=tt(),n=performance.now()-e;t&&(r.mathFingerprint={value:t,duration:n,analysis:ot(t),hash:nt()},o.push("mathFingerprint"))}catch(e){i.push({component:"mathFingerprint",error:e instanceof Error?e.message:"Math fingerprinting failed"})}if(st("fontPreferences",n)&&function(){try{return"undefined"!=typeof document&&"function"==typeof document.createElement&&void 0!==document.body}catch{return!1}}())try{const e=performance.now(),t=await async function(){try{const{document:e,container:t,cleanup:n}=await new Promise((e,t)=>{const n=document.createElement("iframe");n.style.cssText="position: absolute; left: -9999px; top: -9999px; width: 1px; height: 1px; opacity: 0;",n.srcdoc='<!doctype html>\n <html>\n <head>\n <meta name="viewport" content="width=device-width, initial-scale=1">\n <style>\n body { \n margin: 0; \n padding: 20px; \n width: 4000px;\n text-size-adjust: none;\n -webkit-text-size-adjust: none;\n }\n </style>\n </head>\n <body></body>\n </html>',n.onload=()=>{try{const o=n.contentDocument,i=n.contentWindow;if(!o||!i)return void t(new Error("Cannot access iframe content"));const r=o.body;T()?r.style.zoom=""+1/i.devicePixelRatio:v()&&(r.style.zoom="reset");const s=o.createElement("div");s.textContent=Array(200).fill("word").join(" "),r.appendChild(s),e({document:o,container:r,cleanup:()=>{n.parentNode&&n.parentNode.removeChild(n)}})}catch(e){t(e)}},n.onerror=()=>{t(new Error("Failed to load iframe"))},document.body.appendChild(n)}),o={};for(const[n,i]of Object.entries(je))try{o[n]=He(e,t,i)}catch(e){o[n]=0}const i=function(e,t,n="Arial"){try{const t=e.createElement("canvas");t.width=100,t.height=50;const o=t.getContext("2d",{willReadFrequently:!0});if(!o)return{quality:0,antiAliasing:!1,smoothing:0};o.font=`24px "${n}"`,o.fillStyle="#000000",o.fillText("Wg",10.5,30.7);const i=o.getImageData(10,20,30,20).data;let r=0,s=0,a=0;for(let e=0;e<i.length;e+=4){const t=i[e]||0,n=i[e+1]||0,o=i[e+2]||0;(i[e+3]||0)<10||(a++,t===n&&n===o&&t>0&&t<255&&s++,e>4&&Math.abs(t-(i[e-4]||0))>50&&r++)}const c=a>0?s/a:0,l=a>0?100*s/a:0;return{quality:Math.round(l),antiAliasing:c>.1,smoothing:Math.round(100*l)/100}}catch(e){return{quality:0,antiAliasing:!1,smoothing:0}}}(e,0,"Arial"),r=function(e){try{const t=e.createElement("canvas");t.width=100,t.height=50;const n=t.getContext("2d",{willReadFrequently:!0});if(!n)return{clearType:!1,hintingLevel:0,subpixelRendering:!1};const o=["rn","il","WW","mm"];let i=0,r=0,s=0;for(const e of o){n.clearRect(0,0,t.width,t.height),n.font="16px Arial",n.fillStyle="#000",n.fillText(e,10,25);const o=n.getImageData(10,15,40,20).data;for(let e=0;e<o.length;e+=12){const t=o[e]||0,n=o[e+1]||0,a=o[e+2]||0,c=o[e+4]||0,l=o[e+5]||0,u=o[e+6]||0;(Math.abs(t-n)>20||Math.abs(n-a)>20)&&i++,Math.abs(t-c)+Math.abs(n-l)+Math.abs(a-u)>50&&r++,(t>0&&t<255||n>0&&n<255||a>0&&a<255)&&s++}}return{clearType:i>10,hintingLevel:Math.min(Math.round(s/10),5),subpixelRendering:r>5}}catch(e){return{clearType:!1,hintingLevel:0,subpixelRendering:!1}}}(e),s={},c=["Arial","Helvetica","Times New Roman","Georgia","Courier New"];for(const n of c)try{s[n]=Ve(e,t,n)}catch(e){s[n]="fallback-error"}const l=a([JSON.stringify(o),JSON.stringify(i),JSON.stringify(r),JSON.stringify(s)].join("|"));return n(),{...o,antiAliasing:{enabled:i.antiAliasing,type:r.clearType?"cleartype":i.antiAliasing?"standard":"none",smoothingLevel:i.smoothing},systemFontHints:r,fallbackBehavior:s,isolatedHash:l}}catch(e){return{...Object.keys(je).reduce((e,t)=>(e[t]=0,e),{}),antiAliasing:{enabled:!1,type:"unknown",smoothingLevel:0},systemFontHints:{clearType:!1,hintingLevel:0,subpixelRendering:!1},fallbackBehavior:{},isolatedHash:"error"}}}(),n=performance.now()-e;t&&(r.fontPreferences={value:t,duration:n,analysis:ze(t),hash:(u=t,u.isolatedHash&&"error"!==u.isolatedHash?u.isolatedHash:[...[u.default,u.serif,u.sans,u.mono,u.apple,u.system,u.min,u.large,u.ui,u.emoji,u.math,u.cjk,u.arabic,u.hebrew,u.subpixel,u.kerning,u.ligatures].map(e=>Math.round(e)),u.antiAliasing.enabled?1:0,u.systemFontHints.clearType?1:0,u.systemFontHints.hintingLevel,Math.round(u.antiAliasing.smoothingLevel)].join(","))},o.push("fontPreferences"))}catch(e){i.push({component:"fontPreferences",error:e instanceof Error?e.message:"Font preferences detection failed"})}var u,d,p;if(st("dateTimeLocale",n)&&function(){try{return"undefined"!=typeof window&&void 0!==window.Intl}catch{return!1}}())try{const e=performance.now(),t=function(){const e=function(){try{if(!window.Intl)return-1;const e=window.Intl.DateTimeFormat;if(!e)return-2;const t=(new e).resolvedOptions();return t.locale||""===t.locale?{locale:t.locale||"unknown",calendar:t.calendar||"unknown",numberingSystem:t.numberingSystem||"unknown",timeZone:t.timeZone||"unknown",hourCycle:t.hourCycle||"unknown",hour12:void 0!==t.hour12&&t.hour12}:-3}catch(e){return-2}}();if("number"==typeof e)return e;const t=function(){try{if(!window.Intl||!window.Intl.NumberFormat)return-4;const e=(new Intl.NumberFormat).resolvedOptions(),t=new Intl.NumberFormat(void 0,{style:"currency",currency:"USD"}).resolvedOptions();return{numberLocale:e.locale||"unknown",currencyDisplay:t.currencyDisplay||"unknown",currencySign:t.currencySign||"unknown",notation:e.notation||"unknown",signDisplay:e.signDisplay||"unknown"}}catch(e){return-4}}(),n="number"==typeof t?{}:t,o=function(){const e={listStyle:"unknown",relativeTimeStyle:"unknown",pluralRules:"unknown"};try{if(window.Intl&&window.Intl.ListFormat){const t=(new window.Intl.ListFormat).resolvedOptions();e.listStyle=t.style||"unknown"}}catch(e){}try{if(window.Intl&&window.Intl.RelativeTimeFormat){const t=(new window.Intl.RelativeTimeFormat).resolvedOptions();e.relativeTimeStyle=t.style||"unknown"}}catch(e){}try{if(window.Intl&&window.Intl.PluralRules){const t=(new window.Intl.PluralRules).select(1);e.pluralRules=t||"unknown"}}catch(e){}return e}(),i=function(){const e={DateTimeFormat:!1,NumberFormat:!1,RelativeTimeFormat:!1,ListFormat:!1,PluralRules:!1,Collator:!1};try{window.Intl&&(e.DateTimeFormat="function"==typeof window.Intl.DateTimeFormat,e.NumberFormat="function"==typeof window.Intl.NumberFormat,e.RelativeTimeFormat="function"==typeof window.Intl.RelativeTimeFormat,e.ListFormat="function"==typeof window.Intl.ListFormat,e.PluralRules="function"==typeof window.Intl.PluralRules,e.Collator="function"==typeof window.Intl.Collator)}catch(e){}return e}(),r=navigator.language||"unknown",s=e.locale===r;let a="unknown",c="unknown";try{if(window.Intl&&"function"==typeof window.Intl.DateTimeFormat){const e=new Intl.DateTimeFormat(void 0,{dateStyle:"long"}),t=new Intl.DateTimeFormat(void 0,{timeStyle:"long"}),n=e.resolvedOptions(),o=t.resolvedOptions();a=n.dateStyle||"unknown",c=o.timeStyle||"unknown"}}catch(e){}return{locale:e.locale||"unknown",calendar:e.calendar||"unknown",numberingSystem:e.numberingSystem||"unknown",timeZone:e.timeZone||"unknown",dateStyle:a,timeStyle:c,hourCycle:e.hourCycle||"unknown",hour12:e.hour12||!1,numberLocale:n.numberLocale||e.locale||"unknown",currencyDisplay:n.currencyDisplay||"unknown",currencySign:n.currencySign||"unknown",notation:n.notation||"unknown",signDisplay:n.signDisplay||"unknown",listStyle:o.listStyle||"unknown",relativeTimeStyle:o.relativeTimeStyle||"unknown",pluralRules:o.pluralRules||"unknown",navigatorLanguage:r,localeMatch:s,intlSupport:i}}(),n=performance.now()-e;t&&"object"==typeof t&&(r.dateTimeLocale={value:t,duration:n,analysis:Ue(t),hash:(d=t,"number"==typeof d?`status-${d}`:[d.locale,d.calendar,d.numberingSystem,d.timeZone,d.hourCycle,d.hour12?"1":"0",d.localeMatch?"1":"0",Object.values(d.intlSupport).map(e=>e?"1":"0").join("")].join("|"))},o.push("dateTimeLocale"))}catch(e){i.push({component:"dateTimeLocale",error:e instanceof Error?e.message:"DateTime locale detection failed"})}if(st("accessibilityEnhanced",n)&&Me())try{const e=performance.now(),t=Ne(),n=performance.now()-e;t&&(r.accessibilityEnhanced={value:t,duration:n,analysis:Be(t)},o.push("accessibilityEnhanced"))}catch(e){i.push({component:"accessibilityEnhanced",error:e instanceof Error?e.message:"Enhanced accessibility detection failed"})}if(st("enhancedFonts",n)&&function(){try{return"undefined"!=typeof document&&"function"==typeof document.createElement&&void 0!==document.body}catch{return!1}}())try{const e=performance.now(),t=await async function(){const e=performance.now();try{const{document:t,body:n,cleanup:o}=await new Promise((e,t)=>{const n=document.createElement("iframe");n.style.cssText="position: absolute; left: -9999px; top: -9999px; width: 1px; height: 1px; opacity: 0; pointer-events: none;",n.onload=()=>{try{const t=n.contentDocument;if(!t)throw new Error("Cannot access iframe document");const o=t.body;if(!o)throw new Error("Iframe body not available");o.style.fontSize=Ge,o.style.margin="0",o.style.padding="0",e({document:t,body:o,cleanup:()=>{n.parentNode&&n.parentNode.removeChild(n)}})}catch(e){t(e)}},n.onerror=()=>{t(new Error("Failed to load font measurement iframe"))},document.body.appendChild(n)});try{const o=t.createElement("div");o.style.setProperty("visibility","hidden","important");const i=Ze.map(e=>Xe(t,e));i.forEach(e=>o.appendChild(e));const r={};for(const e of We)r[e]=Ze.map(n=>Ke(t,e,n)),r[e].forEach(e=>o.appendChild(e));n.appendChild(o);const s={};Ze.forEach((e,t)=>{const n=i[t];n&&(s[e]={width:n.offsetWidth,height:n.offsetHeight})});const a=[],c={};for(const e of We){const t=r[e];t&&(Ye(t,s)&&a.push(e),t.length>0&&t[0]&&(c[e]={width:t[0].offsetWidth,height:t[0].offsetHeight}))}const l=performance.now()-e,u=Object.values(c).map(e=>e.width);return{available:a,method:"iframe",measurements:c,precision:new Set(u).size/u.length,totalTested:We.length,detectionTime:l}}finally{o()}}catch(t){return function(e){const t=[],n={};try{const e=document.createElement("div");e.style.cssText="position: absolute; left: -9999px; top: -9999px; visibility: hidden;";const o={};Ze.forEach(t=>{const n=document.createElement("span");n.style.fontFamily=t,n.style.fontSize=Ge,n.style.whiteSpace="nowrap",n.textContent=$e,e.appendChild(n),document.body.appendChild(e),o[t]={width:n.offsetWidth,height:n.offsetHeight},document.body.removeChild(e),e.removeChild(n)});for(const i of We){let r=!1;for(const t of Ze){const s=document.createElement("span");s.style.fontFamily=`'${i}',${t}`,s.style.fontSize=Ge,s.style.whiteSpace="nowrap",s.textContent=$e,e.appendChild(s),document.body.appendChild(e);const a={width:s.offsetWidth,height:s.offsetHeight};n[i]=a;const c=o[t];if(!c||a.width===c.width&&a.height===c.height||(r=!0),document.body.removeChild(e),e.removeChild(s),r)break}r&&t.push(i)}}catch(e){}const o=performance.now()-e,i=Object.values(n).map(e=>e.width),r=new Set(i).size;return{available:t,method:"dom",measurements:n,precision:i.length>0?r/i.length:0,totalTested:We.length,detectionTime:o}}(e)}}(),n=performance.now()-e;t&&(r.enhancedFonts={value:t,duration:n,analysis:Je(t),hash:(p=t,`${p.available.sort().join(",")}|${p.method}|${p.precision.toFixed(2)}`)},o.push("enhancedFonts"))}catch(e){i.push({component:"enhancedFonts",error:e instanceof Error?e.message:"Enhanced font detection failed"})}const m={};let f;o.forEach(e=>{const t=r[e];t&&t.value&&(m[e]=t.value)});try{const{calculateConfidence:e}=await Promise.resolve().then(function(){return to});f=e([...o.map(e=>({component:e,success:!0,duration:r[e]?.duration||0,value:r[e]?.value})),...i.map(e=>({component:e.component,success:!1,duration:0,error:e.error}))],{requireMinimumComponents:6,penalizeMissingCore:!0,adjustForIncognito:!0}),r.confidence={score:f.score,level:f.level,factors:f.factors,recommendations:f.recommendations}}catch(e){const t=o.length/(o.length+i.length||1);r.confidence={score:t>=.8?.95:t>=.6?.8:.5,level:t>=.8?"High":t>=.6?"Medium":"Low",factors:{componentCount:o.length,weightedScore:t,stabilityScore:t,entropyScore:t,spoofResistanceScore:t},recommendations:t<.8?["Enable more fingerprinting components"]:[]}}const g={...r,hash:"",components:o,collectionTime:performance.now()-t},b={success:o.length>0,collectedComponents:o,failedComponents:i,confidence:f||r.confidence};if(o.length>0){const e=g.browser?.value,t=g.screen?.value,r=e?.userAgent||"",a=(()=>{const e=!0===navigator.userAgentData?.mobile,n=navigator.maxTouchPoints||0,o=t?.width||0,i=t?.height||0,r=Math.min(o,i);return Math.max(o,i),e?"mobile":n>0?r<=480?"mobile":"tablet":r>1024?"desktop":r<=480?"mobile":"desktop"})();let l={};try{const{collectDeviceSignals:e}=await Promise.resolve().then(function(){return lo});l=e()}catch(e){}const u={ua:(()=>{try{return O().family}catch{const e=r,t=e.match(/(chrome|safari|firefox|edge|edg|brave|opera|opr|chromium)/i);return(t?.[1]||e.split(" ")[0]||"unknown").toLowerCase()}})(),timezone:e?.timezone||"unknown",primaryLanguage:(()=>{try{const t=e?.languages;return Array.isArray(t)&&t.length>0&&t[0]?t[0].toLowerCase().split("-")[0]:"undefined"!=typeof navigator&&navigator.language?navigator.language.toLowerCase().split("-")[0]:"unknown"}catch{return"unknown"}})(),platform:(e?.platform||"unknown").toLowerCase(),deviceType:a,hardware:(()=>{const e=l.hardwareConcurrency,t=l.deviceMemory;if(!e&&!t)return;const n=e?(e=>e>=32?"workstation":e>=20?"ultra":e>=16?"high":e>=12?"premium":e>=8?"mid":e>=6?"normal":e>=4?"basic":e>=2?"low":"minimal")(e):"unknown",o=t?(e=>e>=64?"workstation":e>=32?"ultra":e>=24?"high":e>=16?"premium":e>=12?"mid":e>=8?"normal":e>=4?"basic":e>=2?"low":"minimal")(t):"unknown";var i;return{cores:n,memory:o,arch:void 0===(i=l.architecture)?"unknown":255===i?"arm64":0===i?"x86_64":"other",class:((e,t)=>"workstation"!==e&&"ultra"!==e||"workstation"!==t&&"ultra"!==t?"high"!==e&&"premium"!==e||"high"!==t&&"premium"!==t&&"ultra"!==t?"mid"!==e&&"normal"!==e||"mid"!==t&&"normal"!==t&&"premium"!==t?"basic"!==e&&"low"!==e||"basic"!==t&&"low"!==t&&"normal"!==t?"minimal"===e||"minimal"===t?"mobile":"mixed":"budget":"mainstream":"enthusiast":"professional")(n,o),touch:l.touchSupport?.maxTouchPoints?l.touchSupport.maxTouchPoints>=10?"multi":l.touchSupport.maxTouchPoints>=5?"standard":"basic":"none"}})(),screenFrame:l?.screenFrame?{top:l.screenFrame.top||0,right:l.screenFrame.right||0,bottom:l.screenFrame.bottom||0,left:l.screenFrame.left||0}:void 0,display:(()=>{const e=l.colorDepth,t=l.colorGamut,n=(e=>e?e>=48?"ultra_high":e>=32?"high":e>=24?"normal":e>=16?"basic":"low":"unknown")(e),o=(e=>{if(!e)return"unknown";switch(e){case"rec2020":return"professional";case"p3":return"enhanced";case"srgb":return"standard";default:return"unknown"}})(t);return{depth:n,gamut:o,class:((e,t)=>"ultra_high"===e||"professional"===t?"professional":"high"===e||"enhanced"===t?"premium":"normal"===e&&"standard"===t?"standard":"basic"===e?"basic":"legacy")(n,o)}})()},d=[u.ua||"",u.platform||"",u.deviceType||"",u.timezone||"",u.primaryLanguage||""].filter(Boolean);if(d.length>=3){const e=d.join("|");let t=0;for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n)&4294967295;u._entropy=Math.abs(t).toString(36).substring(0,8)}(n.debug||"undefined"!=typeof window&&window._rabbitTrackerDebug)&&console.log("[RabbitTracker DEBUG] coreVector components:",{ua:u.ua,platform:u.platform,deviceType:u.deviceType,timezone:u.timezone,primaryLanguage:u.primaryLanguage,hasHardware:!!u.hardware,hasDisplay:!!u.display,hasScreenFrame:!!u.screenFrame,_entropy:u._entropy});const p=function(e,t=!1){const n=h(e),o=JSON.stringify(n);t&&console.log("[RabbitTracker] hashStableCore debug:",{originalKeys:Object.keys(e),canonicalizedKeys:Object.keys(n),canonicalLength:o.length,sample:o.substring(0,200)+"..."});const i=s(o);return t&&console.log("[RabbitTracker] Generated stableCoreHash:",i.substring(0,32)),i}(u,n.debug),y=["canvas","webgl","audio","mathFingerprint","fontPreferences","enhancedFonts","dateTimeLocale","accessibilityEnhanced","domBlockers","pluginsEnhanced"],w={};for(const[e,t]of Object.entries(m))y.includes(e)||(w[e]=t);const v={...w,_stableCore:u},k=c(v,n.debug);g.hash=k,n.debug&&console.log("[RabbitTracker] Ultra-stable core vector:",{components:Object.keys(u),entropy:u._entropy,stableCoreHash:p.substring(0,16),enhancedFingerprintHash:k.substring(0,16),ua:u.ua,deviceType:u.deviceType,platform:u.platform,timezone:u.timezone,hasScreenFrame:!!u.screenFrame,hardwareClass:u.hardware?.class,displayClass:u.display?.class,totalComponentsInHash:Object.keys(v).length}),b.data={...g,stableCoreHash:p,stableCoreVector:u},n.debug&&(console.log("[RabbitTracker] Fingerprint collection completed:",{collected:o.length,failed:i.length,duration:g.collectionTime,enhancedFingerprintHash:g.hash,stableCoreHash:p,confidence:f?.level||"Unknown",score:f?.score||0,collisionResistance:"Enhanced with stable + unstable components (no temporal entropy)"}),f?.recommendations.length&&console.log("[RabbitTracker] Confidence recommendations:",f.recommendations))}else b.error="No components could be collected";return b}async function ut(){return lt({gdprMode:!0,includeInvasive:!1,excludeComponents:["canvas","webgl","audio"],timeout:2e3})}async function ht(){return lt({gdprMode:!1,includeInvasive:!0,timeout:5e3})}class dt{constructor(){this.name="fetch",this.available="undefined"!=typeof fetch}async send(e,t){const n=Date.now();try{const o=await fetch(t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!o.ok)throw new Error(`HTTP ${o.status}`);return{success:!0,method:this.name,latency:Date.now()-n}}catch(e){return{success:!1,method:this.name,latency:Date.now()-n,error:e instanceof Error?e.message:String(e)}}}}class pt{constructor(e){this.name="resource",this.available="undefined"!=typeof fetch,this.baseUrl=e}async send(e,t){const n=Date.now();try{const t=this.encodeData(e),o=[{path:"/assets/styles.css",type:"text/css"},{path:"/images/pixel.gif",type:"image/gif"},{path:"/fonts/roboto.woff2",type:"font/woff2"},{path:"/js/analytics.js",type:"application/javascript"}],i=o[Math.floor(Math.random()*o.length)],r=`${this.baseUrl}${i.path}?d=${t}&t=${Date.now()}`;return await fetch(r,{method:"GET",headers:{Accept:i.type,"Cache-Control":"no-cache","User-Agent":navigator.userAgent}}),{success:!0,method:this.name,latency:Date.now()-n}}catch(e){return{success:!1,method:this.name,latency:Date.now()-n,error:e instanceof Error?e.message:String(e)}}}encodeData(e){try{const t=JSON.stringify(e);return btoa(encodeURIComponent(t)).replace(/[+/=]/g,e=>({"+":"-","/":"_","=":""}[e]||e))}catch(e){return""}}}class mt{constructor(e,t){this.name="elysia-websocket",this.available="undefined"!=typeof WebSocket,this.connected=!1,this.baseUrl=e,this.token=t}async send(e,t){const n=Date.now();try{if(!this.token)throw new Error("Missing token for WebSocket connection");if(await this.connect(),!this.ws||!this.connected)throw new Error("WebSocket not connected");return new Promise((t,o)=>{const i=e=>{try{const o=JSON.parse(e.data);this.ws?.removeEventListener("message",i),t({success:o.success||!1,method:this.name,latency:Date.now()-n})}catch(e){this.ws?.removeEventListener("message",i),o(new Error("Failed to parse WebSocket response"))}};this.ws?.addEventListener("message",i),this.ws?.send(JSON.stringify({eventId:e.eventId||crypto.randomUUID(),sessionId:e.sessionId||e.s,eventType:e.eventType||e.type||"websocket_event",eventName:e.eventName||e.name,url:e.url,userAgent:e.userAgent||navigator.userAgent,timestamp:(new Date).toISOString()})),setTimeout(()=>{this.ws?.removeEventListener("message",i),o(new Error("WebSocket response timeout"))},5e3)})}catch(e){return{success:!1,method:this.name,latency:Date.now()-n,error:e instanceof Error?e.message:String(e)}}}async connect(){if(!this.connected||this.ws?.readyState!==WebSocket.OPEN)return new Promise((e,t)=>{try{const n=new URL(this.baseUrl),o=`${"https:"===n.protocol?"wss:":"ws:"}//${n.host}/ws/track?token=${encodeURIComponent(this.token)}`;this.ws=new WebSocket(o),this.ws.onopen=()=>{this.connected=!0,e()},this.ws.onerror=()=>{this.connected=!1,t(new Error("WebSocket connection failed"))},this.ws.onclose=()=>{this.connected=!1},setTimeout(()=>{this.connected||(this.ws?.close(),t(new Error("WebSocket connection timeout")))},5e3)}catch(e){t(e)}})}cleanup(){this.ws&&(this.ws.close(),this.connected=!1)}}class ft{constructor(e){this.name="socketio",this.available="undefined"!=typeof WebSocket,this.connected=!1,this.baseUrl=e}async send(e,t){const n=Date.now();if(!this.available)return{success:!1,method:this.name,error:"WebRTC not available"};try{return this.connected||await this.connect(),new Promise(t=>{this.socket.emit("track",e),this.socket.once("track_success",()=>{t({success:!0,method:this.name,latency:Date.now()-n})}),this.socket.once("track_error",e=>{t({success:!1,method:this.name,error:e.error||"WebSocket send failed"})}),setTimeout(()=>{t({success:!1,method:this.name,error:"WebSocket timeout"})},5e3)})}catch(e){return{success:!1,method:this.name,error:e instanceof Error?e.message:String(e)}}}async connect(){return new Promise((e,t)=>{try{Promise.resolve().then(function(){return Pi}).then(({io:n})=>{const o=new URL(this.baseUrl),i=`${o.protocol}//${o.host}`;this.socket=n(i,{transports:["polling","websocket"],timeout:5e3,upgrade:!0,rememberUpgrade:!1}),this.socket.on("connect",()=>{this.connected=!0,e()}),this.socket.on("connect_error",e=>{t(e)}),this.socket.on("disconnect",()=>{this.connected=!1})}).catch(t)}catch(e){t(e)}})}destroy(){this.socket&&(this.socket.disconnect(),this.connected=!1)}}class gt{constructor(){this.name="webrtc",this.available=void 0!==globalThis.RTCPeerConnection,this.connected=!1}async send(e,t){const n=Date.now();if(!this.available)return{success:!1,method:this.name,error:"WebRTC not available"};try{return await this.setupConnection(),this.dataChannel&&this.connected?(this.dataChannel.send(JSON.stringify(e)),{success:!0,method:this.name,latency:Date.now()-n}):{success:!1,method:this.name,error:"DataChannel not ready"}}catch(e){return{success:!1,method:this.name,error:e instanceof Error?e.message:String(e)}}}async setupConnection(){if(!this.connected)return new Promise((e,t)=>{try{this.pc=new globalThis.RTCPeerConnection({iceServers:[{urls:"stun:stun.l.google.com:19302"}]}),this.dataChannel=this.pc.createDataChannel("tracking",{ordered:!1,maxRetransmits:0}),this.dataChannel.onopen=()=>{this.connected=!0,e()},this.dataChannel.onerror=e=>{t(e)}}catch(e){t(e)}})}destroy(){this.dataChannel&&this.dataChannel.close(),this.pc&&this.pc.close(),this.connected=!1}}class yt{constructor(e,t,n={}){this.transports=[],this.stats={totalRequests:0,successfulRequests:0,methodSuccess:new Map,methodFailures:new Map},this.baseUrl=e,this.token=t,this.config={enabled:!0,methods:["elysia-websocket","fetch","resource"],fallbackDelay:100,maxRetries:2,debug:!1,...n},this.initializeTransports()}initializeTransports(){const e={"elysia-websocket":()=>new mt(this.baseUrl,this.token),socketio:()=>new ft(this.baseUrl),fetch:()=>new dt,resource:()=>new pt(this.baseUrl),webrtc:()=>new gt};this.transports=this.config.methods.map(t=>e[t]?.()).filter(e=>void 0!==e&&e.available),this.config.debug&&console.log("[Zaplier] Anti-adblock initialized with transports:",this.transports.map(e=>e.name))}async send(e,t="/tracking/event"){if(this.stats.totalRequests++,!this.config.enabled||0===this.transports.length)return{success:!1,method:"none",error:"No transports available"};let n="";for(const o of this.transports){try{const i=await o.send(e,`${this.baseUrl}${t}`);if(i.success)return this.stats.successfulRequests++,this.updateMethodStats(o.name,!0),this.config.debug&&console.log(`[Zaplier] Data sent successfully via ${o.name}`,i),i;this.updateMethodStats(o.name,!1),n=i.error||"Unknown error",this.config.debug&&console.warn(`[Zaplier] Transport ${o.name} failed:`,i.error)}catch(e){n=e instanceof Error?e.message:String(e),this.updateMethodStats(o.name,!1),this.config.debug&&console.warn(`[Zaplier] Transport ${o.name} threw error:`,e)}this.config.fallbackDelay>0&&await new Promise(e=>setTimeout(e,this.config.fallbackDelay))}return{success:!1,method:"all_failed",error:`All transports failed. Last error: ${n}`}}updateMethodStats(e,t){t?this.stats.methodSuccess.set(e,(this.stats.methodSuccess.get(e)||0)+1):this.stats.methodFailures.set(e,(this.stats.methodFailures.get(e)||0)+1)}getStats(){return{...this.stats}}getSuccessRates(){const e={};for(const t of this.transports){const n=this.stats.methodSuccess.get(t.name)||0,o=n+(this.stats.methodFailures.get(t.name)||0);e[t.name]=o>0?n/o*100:0}return e}destroy(){this.transports.forEach(e=>{e.destroy&&e.destroy()}),this.transports=[]}async testTransports(){const e={},t={test:!0,timestamp:Date.now()};for(const n of this.transports)try{e[n.name]=await n.send(t,`${this.baseUrl}/test`)}catch(t){e[n.name]={success:!1,method:n.name,error:t instanceof Error?t.message:String(t)}}return e}}class wt{constructor(e,t={}){this.clicks=[],this.scrollData=[],this.mouseMoves=[],this.lastMouseMove=0,this.maxScrollDepth=0,this.isActive=!1,this.recentClicks=[],this.handleClick=e=>{if(!this.config.trackClicks)return;const t=e.target;t.getBoundingClientRect();const n=window.pageXOffset||document.documentElement.scrollLeft,o=window.pageYOffset||document.documentElement.scrollTop,i={x:e.clientX,y:e.clientY,absoluteX:e.clientX+n,absoluteY:e.clientY+o,element:this.getElementSelector(t),timestamp:Date.now(),button:e.button};this.config.trackRageClicks&&this.detectRageClick(i.x,i.y,i.timestamp)&&(i.rageClick=!0),this.clicks.push(i),this.clicks.length>this.config.maxClickBuffer&&(this.clicks=this.clicks.slice(-this.config.maxClickBuffer))},this.handleScroll=()=>{if(!this.config.trackScrollDepth)return;const e=this.calculateScrollDepth();this.maxScrollDepth=Math.max(this.maxScrollDepth,e),this.scrollData.push({depth:e,maxDepth:this.maxScrollDepth,timestamp:Date.now(),viewport:{width:window.innerWidth,height:window.innerHeight}}),this.scrollData.length>100&&(this.scrollData=this.scrollData.slice(-50))},this.handleMouseMove=e=>{if(!this.config.trackMouseMoves)return;const t=Date.now();t-this.lastMouseMove<this.config.mouseMoveThrottle||(this.lastMouseMove=t,this.mouseMoves.push({x:e.clientX,y:e.clientY,timestamp:t}),this.mouseMoves.length>200&&(this.mouseMoves=this.mouseMoves.slice(-100)))},this.handleResize=()=>{const e=this.calculateScrollDepth();this.scrollData.push({depth:e,maxDepth:this.maxScrollDepth,timestamp:Date.now(),viewport:{width:window.innerWidth,height:window.innerHeight}})},this.sessionId=e,this.config={enabled:!0,trackClicks:!0,trackScrollDepth:!0,trackMouseMoves:!1,trackRageClicks:!0,mouseMoveThrottle:200,batchInterval:1e4,maxClickBuffer:500,rageClickThreshold:3,rageClickTimeWindow:1e3,...t}}start(){return!(!this.config.enabled||this.isActive||(this.isActive=!0,this.setupEventListeners(),this.startBatchTimer(),this.trackInitialViewport(),0))}stop(){this.isActive&&(this.isActive=!1,this.removeEventListeners(),this.batchTimer&&(clearInterval(this.batchTimer),this.batchTimer=void 0),this.sendBatch())}setupEventListeners(){this.config.trackClicks&&document.addEventListener("click",this.handleClick,!0),this.config.trackScrollDepth&&(window.addEventListener("scroll",this.handleScroll,{passive:!0}),document.addEventListener("scroll",this.handleScroll,{passive:!0})),this.config.trackMouseMoves&&document.addEventListener("mousemove",this.handleMouseMove,{passive:!0}),window.addEventListener("resize",this.handleResize),window.addEventListener("orientationchange",this.handleResize)}removeEventListeners(){document.removeEventListener("click",this.handleClick,!0),window.removeEventListener("scroll",this.handleScroll),document.removeEventListener("scroll",this.handleScroll),document.removeEventListener("mousemove",this.handleMouseMove),window.removeEventListener("resize",this.handleResize),window.removeEventListener("orientationchange",this.handleResize)}trackInitialViewport(){const e=this.calculateScrollDepth();this.scrollData.push({depth:e,maxDepth:e,timestamp:Date.now(),viewport:{width:window.innerWidth,height:window.innerHeight}})}calculateScrollDepth(){const e=window.pageYOffset||document.documentElement.scrollTop,t=Math.max(document.body.scrollHeight,document.body.offsetHeight,document.documentElement.clientHeight,document.documentElement.scrollHeight,document.documentElement.offsetHeight),n=window.innerHeight;return t<=n?100:Math.min(100,Math.round((e+n)/t*100))}detectRageClick(e,t,n){const o=this.config.rageClickTimeWindow;this.recentClicks=this.recentClicks.filter(e=>n-e.timestamp<=o);const i=this.recentClicks.filter(n=>Math.sqrt(Math.pow(n.x-e,2)+Math.pow(n.y-t,2))<=50);return this.recentClicks.push({x:e,y:t,timestamp:n}),i.length>=this.config.rageClickThreshold-1}getElementSelector(e){if(e.id)return`#${e.id}`;if(e.className&&"string"==typeof e.className){const t=e.className.split(" ").filter(e=>e.length>0);if(t.length>0)return`.${t.slice(0,2).join(".")}`}const t=e.tagName.toLowerCase();return e.parentElement?`${t}:nth-child(${Array.from(e.parentElement.children).indexOf(e)+1})`:t}startBatchTimer(){this.batchTimer=window.setInterval(()=>{this.sendBatch()},this.config.batchInterval)}sendBatch(){if(0===this.clicks.length&&0===this.scrollData.length&&0===this.mouseMoves.length)return;const e={sessionId:this.sessionId,pageMetadata:{url:window.location.href,title:document.title,viewport:{width:window.innerWidth,height:window.innerHeight},documentSize:{width:Math.max(document.body.scrollWidth,document.body.offsetWidth,document.documentElement.clientWidth,document.documentElement.scrollWidth,document.documentElement.offsetWidth),height:Math.max(document.body.scrollHeight,document.body.offsetHeight,document.documentElement.clientHeight,document.documentElement.scrollHeight,document.documentElement.offsetHeight)}},clicks:[...this.clicks],scrollData:[...this.scrollData],mouseMoves:this.config.trackMouseMoves?[...this.mouseMoves]:[],maxScrollDepth:this.maxScrollDepth,timestamp:Date.now()};this.clicks=[],this.scrollData=[],this.mouseMoves=[],this.sendToBackend(e)}setAntiAdblockManager(e){this.antiAdblockManager=e}async sendToBackend(e){try{if(this.antiAdblockManager&&(await this.antiAdblockManager.send(e,"/api/heatmap/record")).success)return;(await fetch("/api/heatmap/track",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})).ok||console.warn("[Zaplier] Heatmap batch failed to send")}catch(e){console.warn("[Zaplier] Heatmap error:",e)}}getStats(){const e=this.clicks.filter(e=>e.rageClick).length;return{clickCount:this.clicks.length,maxScrollDepth:this.maxScrollDepth,isRecording:this.isActive,mouseMovements:this.mouseMoves.length,rageClicks:e}}enableMouseTracking(){this.config.trackMouseMoves||(this.config.trackMouseMoves=!0,this.isActive&&document.addEventListener("mousemove",this.handleMouseMove,{passive:!0}))}disableMouseTracking(){this.config.trackMouseMoves&&(this.config.trackMouseMoves=!1,document.removeEventListener("mousemove",this.handleMouseMove),this.mouseMoves=[])}isRecording(){return this.isActive}}class vt{constructor(e,t={}){this.events=[],this.sequence=0,this.isActive=!1,this.lastMouseMove=0,this.mouseMoveThrottle=100,this.handleClick=e=>{const t=e.target,n=this.getElementPath(t);this.addEvent({type:"click",timestamp:Date.now(),data:{x:e.clientX,y:e.clientY,element:n,button:e.button,ctrlKey:e.ctrlKey,shiftKey:e.shiftKey,altKey:e.altKey},sequence:this.sequence++})},this.handleScroll=()=>{this.addEvent({type:"scroll",timestamp:Date.now(),data:{x:window.pageXOffset||document.documentElement.scrollLeft,y:window.pageYOffset||document.documentElement.scrollTop},sequence:this.sequence++})},this.handleInput=e=>{const t=e.target,n=this.getElementPath(t);let o=t.value;this.config.maskSensitiveFields&&this.isSensitiveField(t)&&(o="*".repeat(o.length)),this.addEvent({type:"input",timestamp:Date.now(),data:{element:n,value:o,inputType:e.inputType},sequence:this.sequence++})},this.handleChange=e=>{const t=e.target,n=this.getElementPath(t);let o=t.value;this.config.maskSensitiveFields&&this.isSensitiveField(t)&&(o="*".repeat(o.length)),this.addEvent({type:"input",timestamp:Date.now(),data:{element:n,value:o,type:"change"},sequence:this.sequence++})},this.handleMouseMove=e=>{const t=Date.now();t-this.lastMouseMove<this.mouseMoveThrottle||(this.lastMouseMove=t,this.addEvent({type:"mouse",timestamp:t,data:{x:e.clientX,y:e.clientY},sequence:this.sequence++}))},this.handleViewportChange=()=>{this.addEvent({type:"viewport",timestamp:Date.now(),data:{width:window.innerWidth,height:window.innerHeight},sequence:this.sequence++})},this.handleNavigation=()=>{this.sendBatch()},this.sessionId=e,this.config={enabled:!0,sampleRate:.1,maskSensitiveFields:!0,maxEventBuffer:1e3,batchInterval:5e3,captureClicks:!0,captureScrolls:!0,captureInputs:!0,captureMouseMoves:!1,compressionEnabled:!0,...t}}start(){return!(!this.config.enabled||this.isActive||Math.random()>this.config.sampleRate||(this.isActive=!0,this.setupDOMObserver(),this.setupEventListeners(),this.startBatchTimer(),this.recordInitialState(),0))}stop(){this.isActive&&(this.isActive=!1,this.observer&&(this.observer.disconnect(),this.observer=void 0),this.removeEventListeners(),this.batchTimer&&(clearInterval(this.batchTimer),this.batchTimer=void 0),this.sendBatch())}setupDOMObserver(){"undefined"!=typeof MutationObserver&&(this.observer=new MutationObserver(e=>{const t=e.map(e=>this.serializeMutation(e)).filter(Boolean);t.length>0&&this.addEvent({type:"mutation",timestamp:Date.now(),data:{mutations:t},sequence:this.sequence++})}),this.observer.observe(document,{childList:!0,subtree:!0,attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0}))}setupEventListeners(){this.config.captureClicks&&document.addEventListener("click",this.handleClick,!0),this.config.captureScrolls&&(window.addEventListener("scroll",this.handleScroll,{passive:!0}),document.addEventListener("scroll",this.handleScroll,{passive:!0})),this.config.captureInputs&&(document.addEventListener("input",this.handleInput,!0),document.addEventListener("change",this.handleChange,!0)),this.config.captureMouseMoves&&document.addEventListener("mousemove",this.handleMouseMove,{passive:!0}),window.addEventListener("resize",this.handleViewportChange),window.addEventListener("orientationchange",this.handleViewportChange),window.addEventListener("beforeunload",this.handleNavigation),window.addEventListener("pagehide",this.handleNavigation)}removeEventListeners(){document.removeEventListener("click",this.handleClick,!0),window.removeEventListener("scroll",this.handleScroll),document.removeEventListener("scroll",this.handleScroll),document.removeEventListener("input",this.handleInput,!0),document.removeEventListener("change",this.handleChange,!0),document.removeEventListener("mousemove",this.handleMouseMove),window.removeEventListener("resize",this.handleViewportChange),window.removeEventListener("orientationchange",this.handleViewportChange),window.removeEventListener("beforeunload",this.handleNavigation),window.removeEventListener("pagehide",this.handleNavigation)}recordInitialState(){this.addEvent({type:"navigation",timestamp:Date.now(),data:{url:window.location.href,referrer:document.referrer,title:document.title,viewport:{width:window.innerWidth,height:window.innerHeight},screen:{width:window.screen?.width||0,height:window.screen?.height||0}},sequence:this.sequence++})}serializeMutation(e){const t={type:e.type,target:this.getElementPath(e.target)};switch(e.type){case"childList":t.addedNodes=Array.from(e.addedNodes).filter(e=>e.nodeType===Node.ELEMENT_NODE).map(e=>this.serializeElement(e)).slice(0,10),t.removedNodes=Array.from(e.removedNodes).filter(e=>e.nodeType===Node.ELEMENT_NODE).map(e=>this.getElementPath(e)).slice(0,10);break;case"attributes":t.attributeName=e.attributeName,t.oldValue=e.oldValue,t.newValue=e.target.getAttribute(e.attributeName);break;case"characterData":t.oldValue=e.oldValue,t.newValue=e.target.textContent}return t}serializeElement(e){const t={};for(const n of Array.from(e.attributes))this.isSensitiveAttribute(n.name)||(t[n.name]=n.value);return{tagName:e.tagName.toLowerCase(),attributes:t,textContent:e.textContent?.substring(0,1e3)||""}}getElementPath(e){const t=[];let n=e;for(;n&&n!==document.body;){let e=n.tagName.toLowerCase();if(n.id){e+=`#${n.id}`,t.unshift(e);break}n.className&&(e+=`.${n.className.toString().split(/\s+/).slice(0,2).join(".")}`),n.id||n.className||(e+=`:nth-child(${Array.from(n.parentElement?.children||[]).indexOf(n)+1})`),t.unshift(e),n=n.parentElement}return t.join(" > ")}isSensitiveField(e){const t=e.getAttribute("type")?.toLowerCase(),n=e.getAttribute("name")?.toLowerCase(),o=e.className.toLowerCase();return["password","email","tel","ssn","cc"].includes(t||"")||["password","email","phone","credit","card","ssn","social"].some(e=>n&&n.includes(e)||o.includes(e))}isSensitiveAttribute(e){return["data-token","data-key","data-secret","authorization"].includes(e.toLowerCase())}addEvent(e){this.events.push(e),this.events.length>this.config.maxEventBuffer&&(this.events=this.events.slice(-this.config.maxEventBuffer))}startBatchTimer(){this.batchTimer=window.setInterval(()=>{this.sendBatch()},this.config.batchInterval)}sendBatch(){if(0===this.events.length)return;const e=[...this.events];this.events=[];const t={sessionId:this.sessionId,events:e,metadata:{userAgent:navigator.userAgent,timestamp:Date.now(),compression:this.config.compressionEnabled}};this.sendToBackend(t)}setAntiAdblockManager(e){this.antiAdblockManager=e}async sendToBackend(e){try{if(this.antiAdblockManager&&(await this.antiAdblockManager.send(e,"/api/replay/record")).success)return;(await fetch("/api/replay/record",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})).ok||console.warn("[Zaplier] Session replay batch failed to send")}catch(e){console.warn("[Zaplier] Session replay error:",e)}}getEventCount(){return this.events.length}isRecording(){return this.isActive}}const bt={apiEndpoint:"https://api.zaplier.com",retryEnabled:!0,maxRetries:3,retryDelays:[1e3,2e3,4e3],autoTrack:!0,dedupeEnabled:!0,fingerprintEnabled:!0,presenceTracking:!1,heartbeatInterval:3e4,scrollTracking:!0,scrollDepthTracking:!0,gdprCompliant:!0,enhancedTracking:"ask",replaySampling:.1,replayMaskInputs:!0};class kt{constructor(e){if(this.version="3.0.0",this.isInitialized=!1,this.eventQueue=[],this.heatmap={enable:()=>{if(this.config.heatmap=!0,!this.heatmapEngine&&this.isInitialized){this.sessionId||(this.sessionId=this.generateSessionId());const e=this.sessionId;this.heatmapEngine=new wt(e,{trackClicks:!0,trackScrollDepth:!0,trackRageClicks:!0,trackMouseMoves:!1}),this.antiAdblockManager&&this.heatmapEngine.setAntiAdblockManager(this.antiAdblockManager),this.heatmapEngine.start()}this.config.debug&&console.log("[Zaplier] Heatmap enabled")},disable:()=>{this.config.heatmap=!1,this.heatmapEngine&&(this.heatmapEngine.stop(),this.heatmapEngine=void 0),this.config.debug&&console.log("[Zaplier] Heatmap disabled")},enableMouseTracking:()=>{this.heatmapEngine&&this.heatmapEngine.enableMouseTracking()},disableMouseTracking:()=>{this.heatmapEngine&&this.heatmapEngine.disableMouseTracking()},getStats:()=>this.heatmapEngine?this.heatmapEngine.getStats():null,isRecording:()=>!!this.heatmapEngine&&this.heatmapEngine.isRecording()},this.replay={enable:()=>{if(this.config.replay=!0,!this.replayEngine&&this.isInitialized){this.sessionId||(this.sessionId=this.generateSessionId());const e=this.sessionId;this.replayEngine=new vt(e,{sampleRate:this.config.replaySampling,maskSensitiveFields:this.config.replayMaskInputs,compressionEnabled:!0}),this.antiAdblockManager&&this.replayEngine.setAntiAdblockManager(this.antiAdblockManager),this.replayEngine.start()}this.config.debug&&console.log("[Zaplier] Replay enabled")},disable:()=>{this.config.replay=!1,this.replayEngine&&(this.replayEngine.stop(),this.replayEngine=void 0),this.config.debug&&console.log("[Zaplier] Replay disabled")},start:()=>{if(!this.replayEngine&&this.isInitialized){this.sessionId||(this.sessionId=this.generateSessionId());const e=this.sessionId;return this.replayEngine=new vt(e,{sampleRate:1,maskSensitiveFields:this.config.replayMaskInputs,compressionEnabled:!0}),this.antiAdblockManager&&this.replayEngine.setAntiAdblockManager(this.antiAdblockManager),this.replayEngine.start()}return!!this.replayEngine&&this.replayEngine.start()},stop:()=>{this.replayEngine&&this.replayEngine.stop()},isRecording:()=>!!this.replayEngine&&this.replayEngine.isRecording(),getEventCount:()=>this.replayEngine?this.replayEngine.getEventCount():0,addFunnelStep:e=>{this.sendEvent({eventType:"funnel_step",eventName:"funnel_step",customData:e})},markConversion:e=>{this.trackConversion("funnel_conversion",e.value,e.currency,e)}},!e.token)throw new Error("Zaplier: token is required");this.config={...bt,...e,gdprMode:e.gdprMode??!1},"undefined"!=typeof window&&this.initialize()}async initialize(){try{if(this.config.debug&&console.log("[Zaplier] Initializing SDK v"+this.version),!this.config.allow_localhost&&this.isLocalhost())return void(this.config.debug&&console.log("[Zaplier] Skipping tracking on localhost"));await this.collectFingerprint(),this.config.autoTrack&&this.trackPageView(),this.isInitialized=!0,this.initializeAntiAdblock(),this.initializeTrackingEngines(),this.processEventQueue(),this.config.debug&&console.log("[Zaplier] SDK initialized successfully",{visitorId:this.visitorId,gdprMode:this.config.gdprMode})}catch(e){console.error("[Zaplier] Initialization failed:",e)}}initializeTrackingEngines(){try{this.sessionId||(this.sessionId=this.generateSessionId(),this.config.debug&&console.log("[Zaplier] Generated session ID:",this.sessionId)),this.config.replay&&(this.replayEngine=new vt(this.sessionId,{sampleRate:this.config.replaySampling,maskSensitiveFields:this.config.replayMaskInputs,compressionEnabled:!0}),this.antiAdblockManager&&this.replayEngine.setAntiAdblockManager(this.antiAdblockManager),this.replayEngine.start(),this.config.debug&&console.log("[Zaplier] Session Replay started")),this.config.heatmap&&(this.heatmapEngine=new wt(this.sessionId,{trackClicks:!0,trackScrollDepth:!0,trackRageClicks:!0,trackMouseMoves:!1}),this.antiAdblockManager&&this.heatmapEngine.setAntiAdblockManager(this.antiAdblockManager),this.heatmapEngine.start(),this.config.debug&&console.log("[Zaplier] Heatmap tracking started"))}catch(e){console.error("[Zaplier] Failed to initialize tracking engines:",e)}}generateSessionId(){const e=performance.timeOrigin||Date.now(),t=this.getBrowserFingerprint();return e.toString(36)+t.substring(0,8)}getBrowserFingerprint(){const e=[navigator.userAgent||"",navigator.platform||"",screen.width||0,screen.height||0,new Date(2024,0,1).getTimezoneOffset(),navigator.language||"",navigator.hardwareConcurrency||0].join("|");let t=0;for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n)&4294967295;return Math.abs(t).toString(36)}initializeAntiAdblock(){try{this.antiAdblockManager=new yt(this.config.apiEndpoint,this.config.token,{enabled:!0,methods:["elysia-websocket","fetch","resource"],fallbackDelay:100,maxRetries:2,debug:this.config.debug}),this.config.debug&&console.log("[Zaplier] Anti-Adblock Manager initialized")}catch(e){console.error("[Zaplier] Failed to initialize Anti-Adblock Manager:",e)}}async collectFingerprint(){try{const e=this.config.gdprMode?await ut():await ht();if(!e.success||!e.data)throw new Error("Fingerprint collection failed");this.fingerprint=e.data,e.data.incognitoDetection&&(this.fingerprint.incognitoDetection={...e.data.incognitoDetection,detectionTimestamp:Date.now(),sdkVersion:this.version}),this.config.debug&&console.log("[Zaplier] Fingerprint collected:",{components:e.collectedComponents,hashes:{full:e.data.hash,stableCore:e.data.stableCoreHash},gdprMode:this.config.gdprMode,incognitoDetected:e.data.incognitoDetection?.isIncognito,incognitoConfidence:e.data.incognitoDetection?.confidence})}catch(e){this.config.debug&&console.error("[Zaplier] Fingerprint collection failed:",e);try{const e=[navigator.userAgent||"",navigator.language||"",navigator.platform||"",screen.width||0,screen.height||0,screen.colorDepth||0,new Date(2024,0,1).getTimezoneOffset(),navigator.hardwareConcurrency||0,navigator.deviceMemory||0,navigator.maxTouchPoints||0,performance.timeOrigin||0,navigator.plugins?navigator.plugins.length:0,navigator.mimeTypes?navigator.mimeTypes.length:0,Math.floor((performance.memory?.usedJSHeapSize||0)/1e6),Math.floor((performance.memory?.totalJSHeapSize||0)/1e6),navigator.connection?.effectiveType||"",Math.floor(navigator.connection?.downlink||0),window.outerHeight||0,window.outerWidth||0,Math.floor(100*(window.devicePixelRatio||1))/100,"function"==typeof document.createElement("canvas").getContext?1:0].join("|");let t=0;for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n)&4294967295;const n=Math.abs(t).toString(36);let o=0;const i=e+n;for(let e=0;e<i.length;e++)o=(o<<5)-o+i.charCodeAt(e)&4294967295,o^=o>>>16;this.fingerprint||(this.fingerprint={}),this.fingerprint.fallbackEntropy=Math.abs(o).toString(36)}catch{}}}isLocalhost(){return!("undefined"==typeof window||!window.location)&&("localhost"===window.location.hostname||"127.0.0.1"===window.location.hostname||window.location.hostname.startsWith("192.168.")||window.location.hostname.startsWith("10.")||window.location.hostname.includes("local"))}async sendEvent(e){if(this.isInitialized)try{const t={fingerprintHash:this.fingerprint?.hash,stableCoreHash:this.fingerprint?.stableCoreHash,stableCoreVector:this.fingerprint?.stableCoreVector,fingerprintVector:this.fingerprint||void 0,incognitoDetection:this.fingerprint?.incognitoDetection&&(void 0!==this.fingerprint.incognitoDetection.likelihood||this.fingerprint.incognitoDetection.methods&&this.fingerprint.incognitoDetection.methods.length>0)?this.fingerprint.incognitoDetection:void 0,isSafari:"undefined"!=typeof navigator&&/safari/i.test(navigator.userAgent)&&!/chrome|chromium|opr|edg|edge/i.test(navigator.userAgent),ch:navigator.userAgentData?{brands:navigator.userAgentData.brands||[],platform:navigator.userAgentData.platform||void 0,mobile:navigator.userAgentData.mobile||void 0,model:navigator.userAgentData.model||void 0}:void 0,fingerprintComponents:this.fingerprint?.components||{},...e,timestamp:(new Date).toISOString(),url:"undefined"!=typeof window&&window.location?window.location.href:"",referrer:"undefined"!=typeof document?document.referrer:"",pageTitle:"undefined"!=typeof document?document.title:"",userAgent:"undefined"!=typeof navigator?navigator.userAgent:"",screenWidth:this.fingerprint?.screen?.value?.width||("undefined"!=typeof window&&window.screen?window.screen.width:0),screenHeight:this.fingerprint?.screen?.value?.height||("undefined"!=typeof window&&window.screen?window.screen.height:0),viewportWidth:this.fingerprint?.screen?.value?.viewportWidth||("undefined"!=typeof window?window.innerWidth:0),viewportHeight:this.fingerprint?.screen?.value?.viewportHeight||("undefined"!=typeof window?window.innerHeight:0),gdprMode:this.config.gdprMode},n=await this.makeRequest(`/tracking/event?token=${encodeURIComponent(this.config.token)}`,t);return n.visitorId&&(this.backendVisitorId=n.visitorId,this.config.debug&&console.log("[Zaplier] Backend visitor ID received:",n.visitorId)),n.sessionId&&(this.sessionId=n.sessionId),n}catch(t){this.config.debug&&console.error("[Zaplier] Event sending failed:",t),this.config.retryEnabled&&setTimeout(()=>this.sendEvent(e),5e3)}else this.eventQueue.push(e)}async makeRequest(e,t,n="POST"){const o=`${this.config.apiEndpoint}${e}`,i={method:n,headers:{"Content-Type":"application/json"}};"POST"===n&&t&&(i.body=JSON.stringify(t));try{const e=Promise.race([fetch(o,i),new Promise((e,t)=>setTimeout(()=>t(new Error("Fetch timeout - possibly blocked")),5e3))]),t=await e;if(!t.ok)throw new Error(`HTTP ${t.status}: ${t.statusText}`);return await t.json()}catch(o){if(this.antiAdblockManager&&"POST"===n){this.config.debug&&console.warn(`[Zaplier] Standard fetch failed (${o instanceof Error?o.message:String(o)}), trying anti-adblock fallback`);try{const n=await this.antiAdblockManager.send(t,e);if(n.success)return this.config.debug&&console.log(`[Zaplier] Request sent via ${n.method} (${n.latency}ms) as fallback`),{success:!0,method:n.method}}catch(e){this.config.debug&&console.warn("[Zaplier] Both standard fetch and anti-adblock failed:",e)}}throw o}}processEventQueue(){for(;this.eventQueue.length>0;){const e=this.eventQueue.shift();this.sendEvent(e)}}track(e,t){this.sendEvent({eventType:e,eventName:e,customData:t})}trackCustomEvent(e,t){return this.sendEvent({eventType:"custom",eventName:e,customData:t}),!0}trackConversion(e,t,n,o){return this.sendEvent({eventType:"conversion",eventName:e,revenue:t,currency:n||"USD",customData:o}),!0}trackPageView(e){this.sendEvent({eventType:"page_view",eventName:"page_view",...e})}trackPurchase(e){this.sendEvent({eventType:"purchase",eventName:"purchase",revenue:e.value||e.revenue,currency:e.currency||"USD",quantity:e.quantity||1,productId:e.productId,customData:{productName:e.productName,orderId:e.orderId,...e.customData}})}trackAddToCart(e){this.sendEvent({eventType:"add_to_cart",eventName:"add_to_cart",revenue:e?.price,quantity:e?.quantity||1,productId:e?.productId,customData:{productName:e?.productName,...e?.customData}})}trackViewContent(e){this.sendEvent({eventType:"view_content",eventName:"view_content",productId:e?.productId,customData:{productName:e?.productName,category:e?.category,...e?.customData}})}trackInitiateCheckout(e){this.sendEvent({eventType:"initiate_checkout",eventName:"initiate_checkout",revenue:e?.value,currency:e?.currency||"USD",quantity:e?.numItems,customData:e?.customData})}trackLead(e){this.sendEvent({eventType:"lead",eventName:"lead",customData:e})}identify(e){this.sendEvent({eventType:"identify",eventName:"identify",email:e.email,phone:e.phone,customData:e})}trackSPANavigation(e,t){this.trackPageView({url:e||("undefined"!=typeof window&&window.location?window.location.href:""),pageTitle:t||("undefined"!=typeof document?document.title:"")})}resetScrollTracking(){this.config.debug&&console.log("[Zaplier] Scroll tracking reset")}startPresenceTracking(){this.config.presenceTracking=!0,this.config.debug&&console.log("[Zaplier] Presence tracking started")}stopPresenceTracking(){this.config.presenceTracking=!1,this.config.debug&&console.log("[Zaplier] Presence tracking stopped")}enableEnhancedTracking(){return this.config.enhancedTracking="true",this.config.gdprMode=!1,this.collectFingerprint(),this.config.debug&&console.log("[Zaplier] Enhanced tracking enabled"),!0}disableEnhancedTracking(){this.config.enhancedTracking="false",this.config.gdprMode=!0,this.config.debug&&console.log("[Zaplier] Enhanced tracking disabled")}isEnhancedMode(){return"true"===this.config.enhancedTracking&&!this.config.gdprMode}getVisitorId(){return this.backendVisitorId||this.visitorId||null}async getVisitorInfo(){const e=this.backendVisitorId;if(!e)return this.config.debug&&console.warn("[Zaplier] No backend visitor ID available. Track an event first and wait for the response."),null;if(!/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(e))return this.config.debug&&console.warn("[Zaplier] Invalid visitor ID format. Expected UUID, got:",e),null;try{return await this.makeRequest(`/tracking/visitor/${e}?token=${encodeURIComponent(this.config.token)}`,null,"GET")}catch(e){return this.config.debug&&console.error("[Zaplier] Failed to get visitor info:",e),null}}async getVisitorHistory(){const e=this.backendVisitorId;if(!e)return this.config.debug&&console.warn("[Zaplier] No backend visitor ID available. Track an event first and wait for the response."),null;if(!/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(e))return this.config.debug&&console.warn("[Zaplier] Invalid visitor ID format. Expected UUID, got:",e),null;try{return await this.makeRequest(`/tracking/visitor/${e}/history?token=${encodeURIComponent(this.config.token)}`,null,"GET")}catch(e){return this.config.debug&&console.error("[Zaplier] Failed to get visitor history:",e),null}}getUserData(){const e="undefined"!=typeof window&&"undefined"!=typeof navigator?{userAgent:navigator.userAgent||"",language:navigator.language||"",screen:{width:window.screen?.width||0,height:window.screen?.height||0}}:{userAgent:"",language:"",screen:{width:0,height:0}};return{sessionId:this.sessionId||"",visitorId:this.getVisitorId()||void 0,location:{},device:e,journey:[],fingerprint:this.fingerprint?.hash}}getConversionLikelihood(){return{score:.5,factors:["Requires backend analysis"]}}getUserSegment(){return{type:"medium_intent",confidence:.5}}}let _t=null;const St={init:e=>_t?(console.warn("[Zaplier] SDK already initialized"),_t):(_t=new kt(e),_t),getInstance:()=>_t,track:(e,t)=>{_t?_t.track(e,t):console.warn("[Zaplier] SDK not initialized. Call Zaplier.init() first")},trackPageView:e=>{_t?_t.trackPageView(e):console.warn("[Zaplier] SDK not initialized. Call Zaplier.init() first")},trackEvent:(e,t)=>_t?_t.trackCustomEvent(e,t):(console.warn("[Zaplier] SDK not initialized. Call Zaplier.init() first"),!1),trackConversion:(e,t,n,o)=>{_t?_t.trackConversion(e,t,n,o):console.warn("[Zaplier] SDK not initialized. Call Zaplier.init() first")},trackPurchase:e=>{_t?_t.trackPurchase(e):console.warn("[Zaplier] SDK not initialized. Call Zaplier.init() first")},trackAddToCart:e=>{_t?_t.trackAddToCart(e):console.warn("[Zaplier] SDK not initialized. Call Zaplier.init() first")},identify:e=>{_t?_t.identify(e):console.warn("[Zaplier] SDK not initialized. Call Zaplier.init() first")},getVisitorId:()=>_t?_t.getVisitorId():null,getVisitorInfo:()=>_t?_t.getVisitorInfo():Promise.resolve(null),getUserData:()=>_t?_t.getUserData():null,enableEnhancedTracking:()=>_t?_t.enableEnhancedTracking():(console.warn("[Zaplier] SDK not initialized. Call Zaplier.init() first"),!1),disableEnhancedTracking:()=>{_t?_t.disableEnhancedTracking():console.warn("[Zaplier] SDK not initialized. Call Zaplier.init() first")},isEnhancedMode:()=>!!_t&&_t.isEnhancedMode(),heatmap:{enable:()=>{_t?_t.heatmap.enable():console.warn("[Zaplier] SDK not initialized. Call Zaplier.init() first")},disable:()=>{_t?_t.heatmap.disable():console.warn("[Zaplier] SDK not initialized. Call Zaplier.init() first")},enableMouseTracking:()=>{_t?_t.heatmap.enableMouseTracking():console.warn("[Zaplier] SDK not initialized. Call Zaplier.init() first")},disableMouseTracking:()=>{_t?_t.heatmap.disableMouseTracking():console.warn("[Zaplier] SDK not initialized. Call Zaplier.init() first")},getStats:()=>_t?_t.heatmap.getStats():null,isRecording:()=>!!_t&&_t.heatmap.isRecording()},replay:{enable:()=>{_t?_t.replay.enable():console.warn("[Zaplier] SDK not initialized. Call Zaplier.init() first")},disable:()=>{_t?_t.replay.disable():console.warn("[Zaplier] SDK not initialized. Call Zaplier.init() first")},start:()=>_t?_t.replay.start():(console.warn("[Zaplier] SDK not initialized. Call Zaplier.init() first"),!1),stop:()=>{_t?_t.replay.stop():console.warn("[Zaplier] SDK not initialized. Call Zaplier.init() first")},isRecording:()=>!!_t&&_t.replay.isRecording(),getEventCount:()=>_t?_t.replay.getEventCount():0,addFunnelStep:e=>{_t?_t.replay.addFunnelStep(e):console.warn("[Zaplier] SDK not initialized. Call Zaplier.init() first")},markConversion:e=>{_t?_t.replay.markConversion(e):console.warn("[Zaplier] SDK not initialized. Call Zaplier.init() first")}},debug:{getStats:()=>_t&&_t.antiAdblockManager?_t.antiAdblockManager.getStats():null,getSuccessRates:()=>_t&&_t.antiAdblockManager?_t.antiAdblockManager.getSuccessRates():null,testTransports:()=>_t&&_t.antiAdblockManager?_t.antiAdblockManager.testTransports():Promise.resolve(null)},version:"3.0.0"};function Et(){if("undefined"==typeof window||"undefined"==typeof document)return;const e=document.getElementsByTagName("script");let t=null;for(const n of Array.from(e))if(n.src&&(n.src.includes("zaplier")||n.src.includes("sdk.js")||n.src.includes("sdk.min.js"))&&n.dataset.token){t=n;break}if(!t||!t.dataset.token)return;const n={token:t.dataset.token,debug:"true"===t.dataset.debug,gdprMode:"true"===t.dataset.gdprMode,heatmap:"true"===t.dataset.heatmap,replay:"true"===t.dataset.replay,allow_localhost:"true"===t.dataset.allowLocalhost};try{St.init(n),n.debug&&console.log("[Zaplier] Auto-initialized from script tag",n)}catch(e){console.error("[Zaplier] Auto-initialization failed:",e)}}"undefined"!=typeof window&&(window.Zaplier=St,"loading"===document.readyState?document.addEventListener("DOMContentLoaded",Et):Et());const At=[/HeadlessChrome/i,/PhantomJS/i,/SlimerJS/i,/Selenium/i,/WebDriver/i,/ChromeDriver/i,/GeckoDriver/i,/bot/i,/crawler/i,/spider/i,/scraper/i,/Googlebot/i,/Bingbot/i,/Slurp/i,/DuckDuckBot/i,/Baiduspider/i,/YandexBot/i,/facebookexternalhit/i,/Twitterbot/i,/LinkedInBot/i,/WhatsApp/i,/SkypeUriPreview/i],Tt=[/^Mozilla\/5\.0$/,/Headless/i,/automated/i,/testing/i,/^$/];function Ct(){try{if(!0===navigator.webdriver)return{detected:!0,confidence:95,method:"navigator.webdriver_true"};if(!0===window.webdriver)return{detected:!0,confidence:90,method:"window.webdriver_true"};const e=["_selenium","callSelenium","_Selenium_IDE_Recorder","callPhantom","_phantom","__phantomas","__fxdriver_evaluate","__fxdriver_unwrapped","_fxdriver_evaluate","_fxdriver_unwrapped"];for(const t of e)if(t in window||t in document)return{detected:!0,confidence:85,method:`selenium_property_${t}`};return document.documentElement.getAttribute("webdriver")?{detected:!0,confidence:80,method:"document_webdriver_attribute"}:{detected:!1,confidence:0,method:"webdriver_not_detected"}}catch(e){return{detected:!1,confidence:0,method:"webdriver_error",details:{error:e instanceof Error?e.message:"Unknown"}}}}function Mt(){try{let e=0;const t=[];window.outerHeight&&window.outerWidth||(e++,t.push("missing_outer_dimensions")),0===navigator.plugins.length&&(e++,t.push("no_plugins")),navigator.languages&&0!==navigator.languages.length||(e++,t.push("no_languages"));const n=navigator.userAgent;return(!n||n.length<50)&&(e++,t.push("short_user_agent")),void 0===Notification?.permission&&(e++,t.push("no_notification_permission")),window.performance&&window.performance.timing||(e++,t.push("missing_performance_api")),n.includes("Chrome")&&(window.chrome||(e++,t.push("missing_chrome_object")),n.includes("HeadlessChrome"))?{detected:!0,confidence:95,method:"chrome_headless_user_agent"}:{detected:e>=3,confidence:Math.min(15*e,90),method:"headless_characteristics",details:{issues:t,suspiciousCount:e}}}catch(e){return{detected:!1,confidence:0,method:"headless_detection_error",details:{error:e instanceof Error?e.message:"Unknown"}}}}function Rt(){try{const e=["webdriver","selenium","phantomjs","slimerjs","chromedriver","geckodriver","automation","puppeteer"],t=[];for(const n of e)(window[n]||window[`_${n}`]||window[`__${n}`])&&t.push(n);for(const n of e)(document[n]||document[`_${n}`]||document[`__${n}`])&&t.push(n);try{window.navigator||t.push("navigation_missing")}catch(e){const n=e instanceof Error?e.message:"";(n.includes("automation")||n.includes("webdriver"))&&t.push("navigation_automation_error")}return t.length>0?{detected:!0,confidence:Math.min(30*t.length,95),method:"automation_tools_detected",details:{tools:t}}:{detected:!1,confidence:0,method:"no_automation_tools"}}catch(e){return{detected:!1,confidence:0,method:"automation_detection_error",details:{error:e instanceof Error?e.message:"Unknown"}}}}function xt(){try{const e=["#ad-banner",".advertisement",".google-ads",".adsense","#google-analytics",".analytics",'[src*="google-analytics"]','[src*="googletagmanager"]',".facebook-widget",".twitter-widget",".social-share"];let t=0;for(const n of e)document.querySelector(n)||t++;try{const e=document.createElement("img");e.src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",e.style.display="none",document.body.appendChild(e),setTimeout(()=>{e.parentNode&&e.parentNode.removeChild(e)},100)}catch{t++}return{detected:t>=2,confidence:Math.min(20*t,80),method:"dom_blockers",details:{blockedCount:t,totalTests:e.length+1}}}catch(e){return{detected:!1,confidence:0,method:"dom_blocker_error",details:{error:e instanceof Error?e.message:"Unknown"}}}}function Dt(){try{return navigator.languages&&0!==navigator.languages.length?1===navigator.languages.length&&"en-US"===navigator.languages[0]?{detected:!0,confidence:40,method:"single_default_language"}:navigator.language!==navigator.languages[0]?{detected:!0,confidence:30,method:"inconsistent_languages",details:{language:navigator.language,firstLanguage:navigator.languages[0]}}:{detected:!1,confidence:0,method:"languages_normal",details:{languageCount:navigator.languages.length}}:{detected:!0,confidence:70,method:"no_languages"}}catch(e){return{detected:!0,confidence:50,method:"language_detection_error",details:{error:e instanceof Error?e.message:"Unknown"}}}}function It(){try{const e=new Function("return 2 + 2")();if(4!==e)return{detected:!0,confidence:90,method:"function_constructor_incorrect_result",details:{expected:4,actual:e}};const t=Function.toString();return t.includes("[native code]")||t.includes("function Function()")?{detected:!1,confidence:0,method:"eval_normal"}:{detected:!0,confidence:70,method:"function_constructor_modified_toString",details:{functionString:t.substring(0,100)}}}catch(e){return{detected:!0,confidence:60,method:"eval_error",details:{error:e instanceof Error?e.message:"Unknown"}}}}function Ot(){const e=navigator.userAgent,t=At.filter(t=>t.test(e)),n=Tt.filter(t=>t.test(e));let o="legitimate";t.some(e=>e.source.includes("bot|crawler|spider"))?o="crawler":t.some(e=>e.source.includes("Selenium|WebDriver"))?o="automation":t.some(e=>e.source.includes("Headless|Phantom"))&&(o="headless");const i=[...t.map(e=>e.source),...n.map(e=>e.source)];return{browser:{name:"Unknown",version:"Unknown",major:"Unknown",engine:"unknown"},os:{name:"Unknown",version:"Unknown",family:"unknown"},device:{type:"desktop"},suspicious:{isBot:t.length>0||n.length>0,patterns:i,category:t.length>0?o:"legitimate"},isMobile:!1,isTablet:!1,isDesktop:!0,isBot:t.length>0||n.length>0,raw:e}}async function Pt(){try{const e="__incognito_test_"+Date.now(),t="test";localStorage.setItem(e,t);const n=localStorage.getItem(e);if(localStorage.removeItem(e),n!==t)return{detected:!0,confidence:80,method:"localStorage_inconsistency",details:{retrieved:n,expected:t}};try{const e="x".repeat(1048576);return localStorage.setItem("__capacity_test",e),localStorage.removeItem("__capacity_test"),{detected:!1,confidence:30,method:"localStorage_capacity"}}catch(e){return{detected:!0,confidence:60,method:"localStorage_capacity_limited",details:{error:e instanceof Error?e.message:"Unknown"}}}}catch(e){return{detected:!0,confidence:90,method:"localStorage_unavailable",details:{error:e instanceof Error?e.message:"Unknown"}}}}async function Lt(){try{const e="__session_test_"+Date.now(),t="test";sessionStorage.setItem(e,t);const n=sessionStorage.getItem(e);return sessionStorage.removeItem(e),n!==t?{detected:!0,confidence:75,method:"sessionStorage_inconsistency",details:{retrieved:n,expected:t}}:{detected:!1,confidence:20,method:"sessionStorage_working"}}catch(e){return{detected:!0,confidence:85,method:"sessionStorage_unavailable",details:{error:e instanceof Error?e.message:"Unknown"}}}}async function Nt(){try{return window.indexedDB?new Promise(e=>{const t="__incognito_test_"+Date.now(),n=indexedDB.open(t,1),o=setTimeout(()=>{e({detected:!0,confidence:60,method:"indexedDB_timeout"})},1e3);n.onerror=()=>{clearTimeout(o),e({detected:!0,confidence:80,method:"indexedDB_error",details:{error:n.error?.message}})},n.onsuccess=()=>{clearTimeout(o),n.result.close(),indexedDB.deleteDatabase(t),e({detected:!1,confidence:25,method:"indexedDB_working"})},n.onblocked=()=>{clearTimeout(o),e({detected:!0,confidence:70,method:"indexedDB_blocked"})}}):{detected:!0,confidence:70,method:"indexedDB_unavailable"}}catch(e){return{detected:!0,confidence:85,method:"indexedDB_exception",details:{error:e instanceof Error?e.message:"Unknown"}}}}async function Bt(){try{if(!navigator.permissions)return{detected:!1,confidence:10,method:"permissions_unsupported"};const e=await navigator.permissions.query({name:"notifications"});return"denied"===e.state?{detected:!0,confidence:40,method:"permissions_notifications_denied",details:{state:e.state}}:{detected:!1,confidence:30,method:"permissions_working",details:{state:e.state}}}catch(e){return{detected:!0,confidence:50,method:"permissions_error",details:{error:e instanceof Error?e.message:"Unknown"}}}}async function Ft(){try{if(!navigator.storage||!navigator.storage.estimate)return{detected:!1,confidence:10,method:"quota_unsupported"};const e=await navigator.storage.estimate(),t=navigator.userAgent,n=/Chrome/.test(t)&&!/Edg|OPR/.test(t),o=/Safari/.test(t)&&!/Chrome/.test(t);let i,r;if(n?(i=157286400,r=125829120):o?(i=52428800,r=26214400):(i=104857600,r=52428800),e.quota){if(e.quota<=r)return{detected:!0,confidence:85,method:"quota_very_limited",details:{quota:e.quota,usage:e.usage,quotaMB:Math.round(e.quota/1048576),threshold:Math.round(r/1048576)}};if(e.quota<=i)return{detected:!0,confidence:65,method:"quota_limited",details:{quota:e.quota,usage:e.usage,quotaMB:Math.round(e.quota/1048576),threshold:Math.round(i/1048576)}}}return{detected:!1,confidence:30,method:"quota_normal",details:{quota:e.quota,usage:e.usage,quotaMB:e.quota?Math.round(e.quota/1048576):null}}}catch(e){return{detected:!0,confidence:50,method:"quota_error",details:{error:e instanceof Error?e.message:"Unknown"}}}}async function Ut(){try{const e=navigator.userAgent;return/Chrome/.test(e)&&!/Edg|OPR/.test(e)?window.webkitRequestFileSystem?new Promise(e=>{const t=()=>{e({detected:!1,confidence:40,method:"chrome_filesystem_available"})},n=()=>{e({detected:!0,confidence:80,method:"chrome_filesystem_blocked"})};try{window.webkitRequestFileSystem(0,1,t,n)}catch(t){e({detected:!0,confidence:70,method:"chrome_filesystem_exception"})}setTimeout(()=>{e({detected:!1,confidence:20,method:"chrome_filesystem_timeout"})},1e3)}):{detected:!1,confidence:10,method:"chrome_filesystem_unsupported"}:{detected:!1,confidence:0,method:"chrome_detection_not_applicable"}}catch(e){return{detected:!1,confidence:10,method:"chrome_detection_error",details:{error:e instanceof Error?e.message:"Unknown"}}}}async function qt(){try{const e=navigator.userAgent;if(!/Safari/.test(e)||/Chrome/.test(e))return{detected:!1,confidence:0,method:"safari_detection_not_applicable"};try{localStorage.setItem("__safari_test","test");const e=localStorage.length;if(localStorage.removeItem("__safari_test"),0===e)return{detected:!0,confidence:75,method:"safari_localStorage_blocked"}}catch(e){return{detected:!0,confidence:80,method:"safari_localStorage_exception"}}return window.indexedDB?{detected:!1,confidence:30,method:"safari_detection_normal"}:{detected:!0,confidence:70,method:"safari_indexedDB_missing"}}catch(e){return{detected:!1,confidence:10,method:"safari_detection_error",details:{error:e instanceof Error?e.message:"Unknown"}}}}async function jt(){try{const e=window.requestFileSystem||window.webkitRequestFileSystem;return e?new Promise(t=>{e(window.TEMPORARY||0,1024,()=>{t({detected:!1,confidence:30,method:"filesystem_working"})},e=>{t({detected:!0,confidence:60,method:"filesystem_error",details:{error:e.name||"Unknown"}})}),setTimeout(()=>{t({detected:!0,confidence:50,method:"filesystem_timeout"})},1e3)}):{detected:!1,confidence:10,method:"filesystem_unsupported"}}catch(e){return{detected:!0,confidence:70,method:"filesystem_exception",details:{error:e instanceof Error?e.message:"Unknown"}}}}async function Vt(){try{const e=new Image,t=performance.now();return new Promise(n=>{const o=setTimeout(()=>{n({detected:!1,confidence:10,method:"cache_timeout"})},3e3);e.onload=()=>{clearTimeout(o);const e=performance.now()-t;n(e<5?{detected:!0,confidence:30,method:"cache_too_fast",details:{loadTime:e}}:{detected:!1,confidence:20,method:"cache_normal",details:{loadTime:e}})},e.onerror=()=>{clearTimeout(o),n({detected:!1,confidence:10,method:"cache_error"})},e.src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7"})}catch(e){return{detected:!1,confidence:10,method:"cache_exception",details:{error:e instanceof Error?e.message:"Unknown"}}}}function Ht(e,t){return new Promise(n=>{setTimeout(()=>{n({detected:!1,confidence:0,method:`${t}_timeout`})},e)})}function zt(){try{return"object"==typeof window.chrome&&null!==window.chrome&&"object"==typeof window.chrome.runtime}catch{return!1}}function Wt(){return navigator.userAgent.includes("WebKit")&&!navigator.userAgent.includes("Chrome")}function $t(){return navigator.userAgent.includes("Gecko")&&!navigator.userAgent.includes("Chrome")}function Gt(){return navigator.userAgent.includes("SamsungBrowser")||navigator.userAgent.includes("Samsung Internet")}function Zt(){return navigator.userAgent.includes("iPad")||"MacIntel"===navigator.platform&&navigator.maxTouchPoints>1}function Xt(){return navigator.userAgent.includes("Android")}function Kt(e,t){const n=e.match(t);return n&&n[1]||"Unknown"}function Yt(e){const t=e.toLowerCase();return t.includes("tablet")||Zt()?Zt()?{type:"tablet",vendor:"Apple",model:"iPad"}:t.includes("kindle")?{type:"tablet",vendor:"Amazon",model:"Kindle"}:{type:"tablet"}:t.includes("mobile")||t.includes("iphone")||t.includes("ipod")||Xt()?t.includes("iphone")?{type:"mobile",vendor:"Apple",model:"iPhone"}:t.includes("ipod")?{type:"mobile",vendor:"Apple",model:"iPod"}:Xt()&&t.includes("mobile")?{type:"mobile",vendor:"Android"}:{type:"mobile"}:{type:"desktop"}}var Jt=Object.freeze({__proto__:null,detectIncognitoHeuristics:async function(){const e=[];let t=0;const n=await async function(){try{const e="__incognito_test__",t=Date.now().toString();localStorage.setItem(e,t);const n=localStorage.getItem(e);return localStorage.removeItem(e),n===t}catch{return!1}}();n||(t+=.25,e.push("localStorage_blocked"));const o=await async function(){try{const e="__incognito_test__",t=Date.now().toString();sessionStorage.setItem(e,t);const n=sessionStorage.getItem(e);return sessionStorage.removeItem(e),n===t}catch{return!1}}();o||(t+=.2,e.push("sessionStorage_blocked"));const i=await async function(){try{return!!window.indexedDB&&new Promise(e=>{const t=indexedDB.open("__incognito_test__",1);t.onsuccess=()=>{t.result.close(),indexedDB.deleteDatabase("__incognito_test__"),e(!0)},t.onerror=()=>e(!1),t.onblocked=()=>e(!1)})}catch{return!1}}();i||(t+=.15,e.push("indexedDB_blocked"));const r=function(){try{const e="__incognito_test__",t=Date.now().toString();document.cookie=`${e}=${t}; SameSite=Strict; path=/`;const n=-1!==document.cookie.indexOf(`${e}=${t}`);return document.cookie=`${e}=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/`,n}catch{return!1}}();r||(t+=.2,e.push("cookies_blocked")),function(){try{return!(!Array.isArray(navigator.languages)||1!==navigator.languages.length||!navigator.language)&&navigator.languages[0]===navigator.language}catch{return!1}}()&&(t+=.25,e.push("languages_single_value"));try{if(n){const n="__incognito_persistence_test__",o="persist_test";localStorage.setItem(n,o);const i=localStorage.getItem(n)===o;localStorage.removeItem(n),i||(t+=.2,e.push("localStorage_not_persistent"))}}catch{}try{if(navigator.storage?.estimate){const n=await navigator.storage.estimate(),o=n?.quota||0,i=n?.usage||0;0===o?(t+=.3,e.push("storage_quota_zero")):o>0&&o<125829120&&(t+=.25,e.push("storage_quota_low")),0===i&&o>0&&(t+=.1,e.push("storage_usage_zero"))}else e.push("storage_estimate_unavailable")}catch{e.push("storage_estimate_error")}"serviceWorker"in navigator||(t+=.1,e.push("service_worker_absent")),"caches"in window||(t+=.05,e.push("cache_api_absent"));try{if(navigator.permissions?.query){const n=await navigator.permissions.query({name:"notifications"});"denied"===n?.state&&(t+=.05,e.push("notifications_denied"))}}catch{e.push("permissions_query_error")}(function(){try{return!!window.showOpenFilePicker}catch{return!1}})()||e.push("fs_access_absent"),"connection"in navigator||e.push("network_info_absent"),t=Math.max(0,Math.min(1,t));const s=[n,o,i,r].filter(e=>!e).length;return s>=3?t=Math.max(t,.85):s>=2&&(t=Math.max(t,.7)),e.includes("languages_single_value")&&(s>=1||t>=.2)&&(t=Math.max(t,.5)),{likelihood:t,methods:e}}});function Qt(){try{if("deviceMemory"in navigator){const e=navigator.deviceMemory;return"number"==typeof e?e:null}return null}catch{return null}}function en(){try{if("hardwareConcurrency"in navigator){const e=navigator.hardwareConcurrency;return"number"==typeof e?e:null}return null}catch{return null}}function tn(){try{return[navigator.platform,navigator.userAgent,navigator.userAgent.includes("ARM")?"ARM":null,navigator.userAgent.includes("arm64")?"ARM64":null,navigator.userAgent.includes("aarch64")?"ARM64":null,navigator.userAgent.includes("x86_64")?"x86_64":null,navigator.userAgent.includes("WOW64")?"x86_64":null,navigator.userAgent.includes("Win64")?"x86_64":null,navigator.userAgent.includes("Intel")?"Intel":null].filter(Boolean).join("|")||"unknown"}catch{return"unknown"}}function nn(){try{return navigator.maxTouchPoints||0}catch{return 0}}var on=Object.freeze({__proto__:null,getArchitecture:tn,getDeviceMemory:Qt,getHardwareConcurrency:en,getHardwareFingerprint:function(){return{deviceMemory:Qt(),hardwareConcurrency:en(),architecture:tn(),maxTouchPoints:nn(),platform:navigator.platform||"unknown"}},getMaxTouchPoints:nn,isHardwareDetectionAvailable:function(){return"undefined"!=typeof navigator}});function rn(){try{if("undefined"!=typeof Intl&&Intl.DateTimeFormat){const e=Intl.DateTimeFormat().resolvedOptions().timeZone;if(e)return e}const e=new Date(2024,0,1).getTimezoneOffset();return`UTC${e>0?"-":"+"}${Math.abs(e/60)}`}catch{return"unknown"}}function sn(){try{const e=[];navigator.languages&&Array.isArray(navigator.languages)&&e.push(...navigator.languages),navigator.language&&e.push(navigator.language);const t=navigator.userLanguage||navigator.browserLanguage;return t&&e.push(t),[...new Set(e)]}catch{return["unknown"]}}function an(){try{if("undefined"!=typeof Intl&&Intl.DateTimeFormat){const e=(new Intl.DateTimeFormat).resolvedOptions();return{locale:e.locale||"unknown",calendar:e.calendar||"unknown",numberingSystem:e.numberingSystem||"unknown",timeZone:e.timeZone||"unknown"}}return{locale:"unknown"}}catch{return{locale:"unknown"}}}function cn(){try{const e={platform:navigator.platform||"unknown",oscpu:navigator.oscpu||null,vendor:navigator.vendor||null},t=navigator.userAgent;if(t.includes("Windows"))e.os="Windows",t.includes("Windows NT 10.0")?e.osVersion="10":t.includes("Windows NT 6.3")?e.osVersion="8.1":t.includes("Windows NT 6.2")?e.osVersion="8":t.includes("Windows NT 6.1")&&(e.osVersion="7");else if(t.includes("Macintosh")||t.includes("Mac OS")){e.os="macOS";const n=t.match(/Mac OS X ([0-9_]+)/);n&&n[1]&&(e.osVersion=n[1].replace(/_/g,"."))}else if(t.includes("Linux"))e.os="Linux";else if(t.includes("Android")){e.os="Android";const n=t.match(/Android ([0-9.]+)/);n&&n[1]&&(e.osVersion=n[1])}else if(t.includes("iOS")||t.includes("iPhone")||t.includes("iPad")){e.os="iOS";const n=t.match(/OS ([0-9_]+)/);n&&n[1]&&(e.osVersion=n[1].replace(/_/g,"."))}return e}catch{return{platform:"unknown"}}}var ln=Object.freeze({__proto__:null,getDateTimeLocale:an,getLanguages:sn,getPlatformExtended:cn,getSystemFingerprint:function(){return{timezone:rn(),languages:sn(),dateTimeLocale:an(),platform:cn(),cookiesEnabled:navigator.cookieEnabled||!1}},getTimezone:rn,isSystemDetectionAvailable:function(){return"undefined"!=typeof navigator}});function un(){try{if("undefined"==typeof localStorage)return!1;const e="__rb_test__",t="test";localStorage.setItem(e,t);const n=localStorage.getItem(e);return localStorage.removeItem(e),n===t}catch(e){return"blocked"}}function hn(){try{if("undefined"==typeof sessionStorage)return!1;const e="__rb_test__",t="test";sessionStorage.setItem(e,t);const n=sessionStorage.getItem(e);return sessionStorage.removeItem(e),n===t}catch(e){return"blocked"}}function dn(){return new Promise(e=>{try{if(!("indexedDB"in window))return void e(!1);const t="__rb_test_db__",n=indexedDB.open(t,1);let o=!1;const i=t=>{o||(o=!0,e(t))};setTimeout(()=>i("blocked"),1e3),n.onerror=()=>i("blocked"),n.onsuccess=()=>{try{n.result.close();const e=indexedDB.deleteDatabase(t);e.onsuccess=()=>i(!0),e.onerror=()=>i(!0)}catch{i("blocked")}},n.onupgradeneeded=()=>{try{const e=n.result;e.objectStoreNames.contains("test")||e.createObjectStore("test")}catch{i("blocked")}}}catch{e("blocked")}})}function pn(){try{return"openDatabase"in window&&"function"==typeof window.openDatabase}catch{return!1}}async function mn(){try{if("storage"in navigator&&"estimate"in navigator.storage){const e=await navigator.storage.estimate();return{quota:e.quota||null,usage:e.usage||null,available:e.quota&&e.usage?e.quota-e.usage:null}}return{}}catch{return{}}}var fn=Object.freeze({__proto__:null,getIndexedDBSupport:dn,getLocalStorageSupport:un,getSessionStorageSupport:hn,getStorageFingerprint:async function(){const[e,t]=await Promise.all([dn(),mn()]);return{localStorage:un(),sessionStorage:hn(),indexedDB:e,webSQL:pn(),quota:t}},getStorageQuota:mn,getWebSQLSupport:pn,isStorageDetectionAvailable:function(){return"undefined"!=typeof window}});function gn(){const e=Math,t=()=>0,n=e.acos||t,o=e.acosh||t,i=e.asin||t,r=e.asinh||t,s=e.atanh||t,a=e.atan||t,c=e.sin||t,l=e.sinh||t,u=e.cos||t,h=e.cosh||t,d=e.tan||t,p=e.tanh||t,m=e.exp||t,f=e.expm1||t,g=e.log1p||t,y=t=>e.pow(e.PI,t),w=t=>e.log(t+e.sqrt(t*t-1)),v=t=>e.log(t+e.sqrt(t*t+1)),b=t=>e.log((1+t)/(1-t))/2,k=t=>(e.exp(t)-1/e.exp(t))/2,_=t=>(e.exp(t)+1/e.exp(t))/2,S=t=>e.exp(t)-1,E=t=>(e.exp(2*t)-1)/(e.exp(2*t)+1),A=t=>e.log(1+t);try{return{acos:n(.12312423423423424),asin:i(.12312423423423424),atan:a(.5),cos:u(10.000000000123),sin:c(-1e300),tan:d(-1e300),acosh:o(1e308),acoshPf:w(1e154),asinh:r(1),asinhPf:v(1),atanh:s(.5),atanhPf:b(.5),cosh:h(1),coshPf:_(1),sinh:l(1),sinhPf:k(1),tanh:p(1),tanhPf:E(1),exp:m(1),expm1:f(1),expm1Pf:S(1),log1p:g(10),log1pPf:A(10),powPI:y(-100),sqrt:e.sqrt(2),cbrt:e.cbrt?e.cbrt(8):0,log:e.log(e.E),log10:e.log10?e.log10(10):0,log2:e.log2?e.log2(2):0,special_0:e.sin(e.PI),special_1:e.cos(e.PI/2),special_2:e.tan(e.PI/4),special_3:e.sqrt(-1),special_4:e.log(-1),special_5:1/0,special_6:NaN}}catch(t){return{error:1,basicMath:e.PI+e.E}}}function yn(){try{return{PI:Math.PI,E:Math.E,LN2:Math.LN2,LN10:Math.LN10,LOG2E:Math.LOG2E,LOG10E:Math.LOG10E,SQRT1_2:Math.SQRT1_2,SQRT2:Math.SQRT2}}catch{return{}}}function wn(){try{return{precision1:.1+.2,precision2:.3-.1,precision3:.1*3,precision4:1.1-.9,largeAdd:1e16,largeSub:1e16,tiny:Number.MIN_VALUE,epsilon:Number.EPSILON||2220446049250313e-31,maxValue:Number.MAX_VALUE,maxSafeInteger:Number.MAX_SAFE_INTEGER||9007199254740991,minSafeInteger:Number.MIN_SAFE_INTEGER||-9007199254740991}}catch{return{}}}var vn=Object.freeze({__proto__:null,getCompleteMathFingerprint:function(){return{operations:gn(),constants:yn(),floatingPoint:wn()}},getFloatingPointBehavior:wn,getMathConstants:yn,getMathFingerprint:gn,isMathDetectionAvailable:function(){return"undefined"!=typeof Math}});function bn(){const e=atob;return{adBlock:["#ad-banner",".advertisement",e("I2FkLWNvbnRhaW5lcg=="),e("LmFkdmVydGlzZW1lbnQ="),e("W2NsYXNzKj0iYWQtIl0=")],uBlockOrigin:["#ublock-stats",".adsbygoogle",e("I2dvb2dsZV9hZHM="),e("LmFkc2J5Z29vZ2xl"),e("LnVibG9jay1ibG9ja2Vk")],adGuardBase:[".BetterJsPopOverlay",e("I2FkXzMwMFgyNTA="),e("I2Jhbm5lcmZsb2F0"),e("I2NhbXBhaWduLWJhbm5lcg=="),e("I0FkLUNvbnRlbnQ=")],adGuardAnnoyances:[".hs-sosyal","#cookieconsentdiv",'div[class^="app_gdpr"]',".as-oil",'[data-cypress="soft-push-notification-modal"]'],easyList:[".yb-floorad",e("LndpZGdldF9wb19hZHNfd2lkZ2V0"),e("LnRyYWZmaWNqdW5reS1hZA=="),".textad_headline",e("LnNwb25zb3JlZC10ZXh0LWxpbmtz")],privacyBadger:["#privacy-badger-popup",".privacy-badger-blocked",e("LnByaXZhY3ktYmFkZ2Vy")],ghostery:["#ghostery-popup",".ghostery-blocking",e("Lmdob3N0ZXJ5LWJsb2NrZWQ=")],brave:["#brave-ads-blocked",".brave-blocked",e("LmJyYXZlLWFkLWJsb2Nr")],facebookContainer:[".facebook-container-blocked",e("LmZiLWJsb2NrZWQ=")],cookieBlockers:[".cookie-notice-blocked","#cookie-banner-hidden",e("LmNvb2tpZS1ibG9ja2Vy")],trackingProtection:[".tracking-blocked","#tracking-protection-enabled",e("LnRyYWNrZXItYmxvY2tlZA==")]}}function kn(e){const t=document.createElement("div");if(e.startsWith("#"))t.id=e.substring(1);else if(e.startsWith("."))t.className=e.substring(1);else if(e.includes("["))try{const n=e.match(/\[([^=]+)([*^$|~]?=)"([^"]+)"\]/);if(n&&n[1]&&n[3]){const[,e,o,i]=n;"*="===o?t.setAttribute(e,`test-${i}-test`):t.setAttribute(e,i)}}catch{t.className="test-element"}else t.className=e.replace(/[^a-zA-Z0-9-_]/g,"");return t}function _n(e){const t=e.style;t.setProperty("visibility","hidden","important"),t.setProperty("display","block","important"),t.setProperty("position","absolute","important"),t.setProperty("left","-9999px","important"),t.setProperty("width","1px","important"),t.setProperty("height","1px","important"),t.setProperty("pointer-events","none","important"),t.setProperty("z-index","-1","important")}function Sn(e){return new Promise(t=>setTimeout(t,e))}async function En(e){const t=document,n=t.createElement("div"),o=new Array(e.length),i={};_n(n);const r=t.createDocumentFragment();for(let n=0;n<e.length;n++){const i=e[n];if(i)try{const e=kn(i),s=t.createElement("div");"DIALOG"===e.tagName&&e.show?.(),_n(s),s.appendChild(e),r.appendChild(s),o[n]=e}catch(e){o[n]=void 0}}n.appendChild(r);let s=0;for(;!t.body&&s<100;)await Sn(50),s++;if(!t.body)throw new Error("Document body not available for DOM blockers detection");t.body.appendChild(n);try{await Sn(50),await new Promise(t=>{requestAnimationFrame(()=>{for(let t=0;t<e.length;t++){const n=o[t],r=e[t];n&&r&&!n.offsetParent&&(i[r]=!0)}t()})})}finally{try{n.parentNode&&n.parentNode.removeChild(n)}catch(e){setTimeout(()=>{try{n.parentNode&&n.parentNode.removeChild(n)}catch{}},0)}}return i}async function An(e={}){const{debug:t=!1,timeout:n=5e3}=e;try{if(!Tn())return t&&console.log("[RabbitTracker] DOM Blockers detection not applicable for this browser"),"BROWSER_INCOMPATIBLE";if(!document||!document.body)return t&&console.log("[RabbitTracker] DOM not ready for blockers detection"),"DOM_NOT_AVAILABLE";const e=bn(),o=Object.keys(e),i=[].concat(...o.map(t=>e[t]||[])),r=new Promise((e,t)=>{setTimeout(()=>t(new Error("DOM blockers detection timeout")),n)}),s=await Promise.race([En(i),r]);return t&&console.log("[RabbitTracker] DOM Blockers Debug:",{totalSelectors:i.length,blockedCount:Object.keys(s).length,blockedSelectors:s}),o.filter(t=>{const n=e[t];return!(!n||0===n.length)&&n.map(e=>s[e]).filter(Boolean).length>.6*n.length}).sort()}catch(e){if(t&&console.error("[RabbitTracker] DOM Blockers detection failed:",e),e instanceof Error){if(e.message.includes("timeout"))return"TIMEOUT";if("SecurityError"===e.name||e.message.includes("SecurityError"))return"SECURITY_ERROR"}return"NOT_SUPPORTED"}}function Tn(){return B().canRunDOMBlockers}var Cn=Object.freeze({__proto__:null,getBlockedSelectors:En,getBlockerFilters:bn,getDomBlockers:An,getDomBlockersFingerprint:async function(e={}){const t=await An(e),n=Array.isArray(t)?t:[];return{activeBlockers:n,blockerCount:n.length,hasAdBlocker:n.some(e=>["adBlock","uBlockOrigin","adGuardBase","easyList"].includes(e)),hasPrivacyExtension:n.some(e=>["privacyBadger","ghostery","brave"].includes(e)),hasTrackingProtection:n.includes("trackingProtection")}},isDomBlockersDetectionAvailable:Tn});function Mn(){try{return T()?navigator.pdfViewerEnabled??null:null}catch{return null}}function Rn(){try{if(!R())return-1;const{ApplePaySession:e}=window;if("function"!=typeof e?.canMakePayments)return-1;if(!x())return-2;if(window.self!==window.top)return-3;try{return e.canMakePayments()?1:0}catch(e){if(e instanceof Error&&"InvalidAccessError"===e.name)return-2;throw e}}catch{return-1}}function xn(){try{return"attributionReporting"in window||"privateClickMeasurement"in window||null}catch{return null}}function Dn(){const e={enabled:!1,sameSiteSupport:!1,secureSupport:!1,partitionedSupport:!1};try{if(e.enabled=navigator.cookieEnabled,!e.enabled)return e;e.sameSiteSupport=In("__rb_test_samesite","SameSite=Strict"),x()&&(e.secureSupport=In("__rb_test_secure","Secure")),x()&&T()&&(e.partitionedSupport=In("__rb_test_partitioned","Partitioned; Secure; SameSite=None"))}catch{}return e}function In(e,t){try{const n="1",o=`${e}=${n}; ${t}; path=/`;document.cookie=o;const i=document.cookie.includes(`${e}=${n}`);return On(e),i}catch{return On(e),!1}}function On(e){try{const t=[`${e}=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/`,`${e}=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/; domain=${location.hostname}`,`${e}=; max-age=0; path=/`,`${e}=; max-age=0; path=/; domain=${location.hostname}`];for(const e of t)try{document.cookie=e}catch{}setTimeout(()=>{try{document.cookie=`${e}=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/`}catch{}},100)}catch{}}function Pn(){try{const e=document.createElement("canvas"),t=e.getContext("webgl")||e.getContext("experimental-webgl");return t?(t.getSupportedExtensions()||[]).sort():[]}catch{return[]}}function Ln(){try{const e=performance.memory;return e?{usedJSHeapSize:e.usedJSHeapSize,totalJSHeapSize:e.totalJSHeapSize,jsHeapSizeLimit:e.jsHeapSizeLimit}:null}catch{return null}}function Nn(){try{const e=navigator.connection||navigator.mozConnection||navigator.webkitConnection;return e?{effectiveType:e.effectiveType,downlink:e.downlink,rtt:e.rtt,saveData:e.saveData}:null}catch{return null}}function Bn(){const e={};try{e.webkitTemporaryStorage="webkitTemporaryStorage"in navigator,e.webkitPersistentStorage="webkitPersistentStorage"in navigator,window.safari&&(e.safariObjectTypes=Object.getOwnPropertyNames(window.safari)),e.chromeRuntime=!!window.chrome?.runtime,e.mozInnerScreenX="mozInnerScreenX"in window,e.msCredentials="msCredentials"in navigator}catch{}return e}var Fn=Object.freeze({__proto__:null,getApplePayState:Rn,getBrowserApisFingerprint:function(){const e=Mn(),t=Rn(),n=xn(),o=Dn(),i=Pn(),r=Ln(),s=Nn(),a=Bn();let c="unknown";a.chromeRuntime?c="chrome":-1!==t?c="safari":a.mozInnerScreenX?c="firefox":a.msCredentials&&(c="edge");const l=Boolean(e||t>-1||n||r||s),u=[null!==e,-1!==t,null!==n,o.enabled,i.length>0,null!==r,null!==s,Object.keys(a).length>0];return{pdfViewerEnabled:e,applePayState:t,privateClickMeasurement:n,cookieCapabilities:o,webglExtensions:i,performanceMemory:r,connectionInfo:s,vendorProperties:a,browserVendor:c,hasNativeFeatures:l,apiScore:Math.round(u.filter(Boolean).length/u.length*100)}},getConnectionInfo:Nn,getCookieCapabilities:Dn,getPdfViewerEnabled:Mn,getPerformanceMemory:Ln,getPrivateClickMeasurement:xn,getVendorProperties:Bn,getWebGLExtensions:Pn,isBrowserApisDetectionAvailable:function(){return"undefined"!=typeof window&&"undefined"!=typeof navigator}});function Un(){try{if(!Kn())return"NOT_SUPPORTED";const e=function(){try{return navigator.plugins||null}catch(e){if("SecurityError"===e.name)return null;throw e}}();if(!e)return"NAVIGATOR_UNAVAILABLE";const t=[];if(0===e.length)return t;for(let n=0;n<e.length;n++){const o=e[n];if(!o)continue;const i=[];if(o.length>0)for(let e=0;e<o.length;e++){const t=o[e];t&&t.type&&i.push(t.type)}t.push({name:o.name||"",filename:o.filename||"",description:o.description||"",version:o.version||void 0,mimeTypes:i})}return t.sort((e,t)=>e.name.localeCompare(t.name))}catch(e){return"SecurityError"===e.name?"SECURITY_RESTRICTED":[]}}function qn(){try{if(!navigator.mimeTypes||0===navigator.mimeTypes.length)return[];const e=[];for(let t=0;t<navigator.mimeTypes.length;t++){const n=navigator.mimeTypes[t];n&&n.type&&e.push(n.type)}return e.sort()}catch{return[]}}function jn(){try{if(navigator.plugins&&Array.from(navigator.plugins).some(e=>e.name.toLowerCase().includes("flash")||e.description.toLowerCase().includes("flash")))return!0;if(navigator.mimeTypes&&Array.from(navigator.mimeTypes).some(e=>"application/x-shockwave-flash"===e.type))return!0;if(void 0!==window.ActiveXObject)try{return!!new window.ActiveXObject("ShockwaveFlash.ShockwaveFlash")}catch{return!1}return!1}catch{return!1}}function Vn(){try{if(navigator.plugins&&Array.from(navigator.plugins).some(e=>e.name.toLowerCase().includes("java")&&!e.name.toLowerCase().includes("javascript")))return!0;const e=["application/x-java-applet","application/x-java-bean","application/x-java-vm"];return!(!navigator.mimeTypes||!e.some(e=>Array.from(navigator.mimeTypes).some(t=>t.type===e)))||"function"==typeof navigator.javaEnabled&&navigator.javaEnabled()}catch{return!1}}function Hn(){try{if(navigator.plugins&&Array.from(navigator.plugins).some(e=>e.name.toLowerCase().includes("silverlight")))return!0;if(navigator.mimeTypes&&Array.from(navigator.mimeTypes).some(e=>"application/x-silverlight"===e.type))return!0;if(void 0!==window.ActiveXObject)try{return!!new window.ActiveXObject("AgControl.AgControl")}catch{return!1}return!1}catch{return!1}}function zn(){try{if(!T())return"NOT_SUPPORTED";if(!navigator.plugins)return"NAVIGATOR_UNAVAILABLE";const e=navigator.plugins.length;return 0===e||!window.chrome?.runtime&&!window.chrome?.webstore&&void 0!==window.chrome||!Array.from(navigator.plugins).some(e=>e.name.toLowerCase().includes("pdf")||e.name.toLowerCase().includes("chrome"))&&e<3}catch(e){return"SecurityError"===e.name&&"SECURITY_RESTRICTED"}}function Wn(){try{if(!C())return"NOT_SUPPORTED";const e={mozInnerScreenX:"mozInnerScreenX"in window,mozPaintCount:"mozPaintCount"in window,mozApps:!!navigator.mozApps,buildID:!!navigator.buildID,oscpu:!!navigator.oscpu},t=Object.values(e).filter(Boolean).length;return 0===t||(navigator.plugins?0===navigator.plugins.length&&t<2:"NAVIGATOR_UNAVAILABLE")}catch(e){return"SecurityError"===e.name&&"SECURITY_RESTRICTED"}}function $n(e){const t=["antivirus","security","firewall","malware","protection","kaspersky","norton","mcafee","avast","avira","bitdefender","eset","sophos","symantec","trend micro","f-secure"];return e.filter(e=>t.some(t=>e.name.toLowerCase().includes(t)||e.description.toLowerCase().includes(t))).map(e=>e.name)}function Gn(e){const t=["adblock","adblocker","ad block","ublock","ghostery","privacy badger","disconnect","noscript","tracking protection"];return e.filter(e=>t.some(t=>e.name.toLowerCase().includes(t)||e.description.toLowerCase().includes(t))).map(e=>e.name)}function Zn(e,t,n,o){let i=50;return i+=10*e.length,i+=5*t.length,n&&(i-=15),o&&(i-=10),Math.max(0,Math.min(100,i))}function Xn(e,t){const n=e.map(e=>e.name).sort(),o=t.slice(0,10).sort();return[`plugins:${n.length}`,`mimes:${t.length}`,...n.slice(0,5),...o.slice(0,5)].join("|")}function Kn(){return B().canRunBrowserAPIs&&"undefined"!=typeof navigator}var Yn=Object.freeze({__proto__:null,calculateSecurityScore:Zn,detectChromeExtensionsBlocked:zn,detectFirefoxExtensionsBlocked:Wn,generatePluginSignature:Xn,getEnhancedPluginFingerprint:function(){const e=Un(),t=Array.isArray(e)?e:[],n=qn(),o=Array.isArray(n)?n:[],i=jn(),r=Vn(),s=Hn(),a=zn(),c="boolean"==typeof a&&a,l=Wn(),u="boolean"==typeof l&&l,h=$n(t),d=Gn(t),p=Xn(t,o),m=Zn(h,d,i,r);return{plugins:t,pluginCount:t.length,mimeTypes:o,mimeTypeCount:o.length,flashEnabled:i,javaEnabled:r,silverLightEnabled:s,chromeExtensionsBlocked:c,firefoxExtensionsBlocked:u,securityPlugins:h,adBlockerPlugins:d,pluginSignature:p,securityScore:m}},getMimeTypes:qn,getNavigatorPlugins:Un,identifyAdBlockerPlugins:Gn,identifySecurityPlugins:$n,isEnhancedPluginDetectionAvailable:Kn,testFlashEnabled:jn,testJavaEnabled:Vn,testSilverlightEnabled:Hn});const Jn={canvas:{stability:.95,entropy:.9,uniqueness:.85,spoofResistance:.8},webgl:{stability:.92,entropy:.88,uniqueness:.82,spoofResistance:.85},audio:{stability:.9,entropy:.85,uniqueness:.8,spoofResistance:.9},hardware:{stability:.98,entropy:.7,uniqueness:.75,spoofResistance:.95},screen:{stability:.85,entropy:.6,uniqueness:.65,spoofResistance:.7},system:{stability:.8,entropy:.65,uniqueness:.7,spoofResistance:.6},browser:{stability:.75,entropy:.6,uniqueness:.65,spoofResistance:.5},fonts:{stability:.7,entropy:.75,uniqueness:.7,spoofResistance:.4},math:{stability:.95,entropy:.8,uniqueness:.9,spoofResistance:.95},storage:{stability:.6,entropy:.5,uniqueness:.6,spoofResistance:.3},incognito:{stability:.5,entropy:.4,uniqueness:.3,spoofResistance:.2},domBlockers:{stability:.8,entropy:.7,uniqueness:.6,spoofResistance:.9},accessibility:{stability:.9,entropy:.6,uniqueness:.7,spoofResistance:.85},browserApis:{stability:.85,entropy:.75,uniqueness:.8,spoofResistance:.7},pluginsEnhanced:{stability:.7,entropy:.65,uniqueness:.75,spoofResistance:.5},mathFingerprint:{stability:.99,entropy:.95,uniqueness:.9,spoofResistance:.98},fontPreferences:{stability:.92,entropy:.88,uniqueness:.85,spoofResistance:.75},dateTimeLocale:{stability:.95,entropy:.7,uniqueness:.75,spoofResistance:.8},accessibilityEnhanced:{stability:.93,entropy:.65,uniqueness:.8,spoofResistance:.9},enhancedFonts:{stability:.88,entropy:.85,uniqueness:.82,spoofResistance:.7}},Qn={domBlockers:{stability:.8,entropy:.7,uniqueness:.6,spoofResistance:.9},accessibility:{stability:.9,entropy:.6,uniqueness:.7,spoofResistance:.85},browserApis:{stability:.85,entropy:.75,uniqueness:.8,spoofResistance:.7}};function eo(e){const t=Jn[e]||Qn[e];if(!t)return.5;const n=.3*t.stability+.25*t.entropy+.25*t.uniqueness+.2*t.spoofResistance;return Math.max(.1,Math.min(1,n))}var to=Object.freeze({__proto__:null,ADVANCED_COMPONENT_CHARACTERISTICS:Qn,COMPONENT_CHARACTERISTICS:Jn,calculateComponentWeight:eo,calculateConfidence:function(e,t={}){const{requireMinimumComponents:n=4,penalizeMissingCore:o=!0,adjustForIncognito:i=!0}=t,r=e.filter(e=>e.success),s=[];r.length<n&&s.push(`Collect at least ${n} components for reliable identification`);let a=0,c=0,l=0,u=0,h=0;const d=["canvas","webgl","audio","hardware"].filter(e=>!r.some(t=>t.component===e));for(const e of r){const t=eo(e.component),n=Jn[e.component]||Qn[e.component];n&&(a+=t,c+=n.stability*t,l+=n.entropy*t,u+=n.uniqueness*t,h+=n.spoofResistance*t)}const p=a>0?c/a:0,m=a>0?l/a:0,f=a>0?h/a:0;let g,y,w=.35*p+.25*m+.25*(a>0?u/a:0)+.15*f,v=w;return o&&d.length>0&&(v-=.1*d.length,s.push(`Missing core components: ${d.join(", ")}`)),r.length<6&&(v-=.05*(6-r.length)),i&&r.some(e=>"incognito"===e.component)&&(v+=.02),r.filter(e=>["domBlockers","accessibility","browserApis","math"].includes(e.component)).length>=2&&(v+=.05),v=Math.max(0,Math.min(1,v)),v>=.995?(g=.995,y="Very High"):v>=.99?(g=.99,y="High"):v>=.95?(g=.95,y="Medium"):v>=.8?(g=.8,y="Low"):(g=.5,y="Very Low",s.push("Consider implementing additional fingerprinting techniques")),v<.95&&s.push("Enable all available fingerprinting components for better accuracy"),f<.6&&s.push("Include more spoof-resistant components like audio and WebGL"),m<.6&&s.push("Add high-entropy components like canvas and math fingerprinting"),{score:g,level:y,factors:{componentCount:r.length,weightedScore:Math.round(1e3*w)/1e3,stabilityScore:Math.round(1e3*p)/1e3,entropyScore:Math.round(1e3*m)/1e3,spoofResistanceScore:Math.round(1e3*f)/1e3},recommendations:s.slice(0,3)}}});function no(){try{const e=screen,t=e.availTop??0,n=e.availLeft??0,o=e.availWidth??e.width,i=e.availHeight??e.height,r=t||null,s=e.width-o-n||null,a=e.height-i-t||null,c=n||null;if(null===r&&null===s&&null===a&&null===c)return null;const l=e=>null===e?null:10*Math.round(e/10);return{top:l(r),right:l(s),bottom:l(a),left:l(c)}}catch{return null}}function oo(){try{const e=navigator.platform?.toLowerCase()||"",t=navigator.userAgent?.toLowerCase()||"";if(e.includes("win")&&(t.includes("wow64")||t.includes("x64")||t.includes("x86_64")))return 0;if(e.includes("linux")&&(e.includes("x86_64")||t.includes("x86_64")))return 0;if(e.includes("mac")&&(e.includes("intel")||t.includes("intel mac")))return 0;if(e.includes("x86")||e.includes("x64")||e.includes("intel")||e.includes("amd64")||t.includes("x86")||t.includes("amd64"))return 0;if(e.includes("arm")||t.includes("arm")||t.includes("aarch64")||e.includes("aarch64"))return 255;try{const e=document.createElement("canvas"),t=e.getContext("webgl")||e.getContext("experimental-webgl");if(t&&"getExtension"in t&&"getParameter"in t){const e=t.getExtension("WEBGL_debug_renderer_info");if(e){const n=t.getParameter(e.UNMASKED_VENDOR_WEBGL)?.toLowerCase()||"",o=t.getParameter(e.UNMASKED_RENDERER_WEBGL)?.toLowerCase()||"";if(n.includes("intel")||n.includes("nvidia")||n.includes("amd")||o.includes("intel")||o.includes("nvidia")||o.includes("amd")||o.includes("radeon")||o.includes("geforce")||o.includes("quadro")||o.includes("iris")||o.includes("uhd")||o.includes("hd graphics"))return 0;if(o.includes("mali")||o.includes("adreno")||o.includes("powervr")||o.includes("tegra")||o.includes("apple gpu")||n.includes("arm")||o.includes("videocore"))return 255}}}catch{}try{const t=new Float32Array(1),n=new Uint8Array(t.buffer);t[0]=1/0,t[0]=t[0]-t[0];const o=n[3];return e.includes("linux"),o}catch{return}}catch{return}}function io(){try{const e=navigator;let t=0;void 0!==e.maxTouchPoints?t=e.maxTouchPoints:void 0!==e.msMaxTouchPoints&&(t=e.msMaxTouchPoints);let n=!1;try{document.createEvent("TouchEvent"),n=!0}catch{n=!1}return{maxTouchPoints:t,touchEvent:n,touchStart:"ontouchstart"in window}}catch{return}}function ro(){const e=[],t=["chrome","safari","__crWeb","__gCrWeb","yandex","__yb","__ybro","__firefox__","__edgeTrackingPreventionStatistics","webkit","oprt","samsungAr","ucweb","UCShellJava","puffinDevice"];for(const n of t){const t=window[n];t&&"object"==typeof t&&e.push(n)}return e.sort()}function so(){try{const e=navigator.deviceMemory;if("number"==typeof e)return Math.round(e);if("string"==typeof e){const t=parseFloat(e);return isNaN(t)?void 0:Math.round(t)}return}catch{return}}function ao(){try{return screen.colorDepth||void 0}catch{return}}function co(){try{for(const e of["rec2020","p3","srgb"])if(window.matchMedia(`(color-gamut: ${e})`).matches)return e;return}catch{return}}var lo=Object.freeze({__proto__:null,collectDeviceSignals:function(){return{screenFrame:no(),hardwareConcurrency:navigator.hardwareConcurrency||void 0,deviceMemory:so(),architecture:oo(),touchSupport:io(),vendorFlavors:ro(),cpuClass:navigator.cpuClass||void 0,colorDepth:ao(),colorGamut:co()}}});const uo=Object.create(null);uo.open="0",uo.close="1",uo.ping="2",uo.pong="3",uo.message="4",uo.upgrade="5",uo.noop="6";const ho=Object.create(null);Object.keys(uo).forEach(e=>{ho[uo[e]]=e});const po={type:"error",data:"parser error"},mo="function"==typeof Blob||"undefined"!=typeof Blob&&"[object BlobConstructor]"===Object.prototype.toString.call(Blob),fo="function"==typeof ArrayBuffer,go=e=>"function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,yo=({type:e,data:t},n,o)=>mo&&t instanceof Blob?n?o(t):wo(t,o):fo&&(t instanceof ArrayBuffer||go(t))?n?o(t):wo(new Blob([t]),o):o(uo[e]+(t||"")),wo=(e,t)=>{const n=new FileReader;return n.onload=function(){const e=n.result.split(",")[1];t("b"+(e||""))},n.readAsDataURL(e)};function vo(e){return e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}let bo;const ko="undefined"==typeof Uint8Array?[]:new Uint8Array(256);for(let e=0;e<64;e++)ko["ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charCodeAt(e)]=e;const _o="function"==typeof ArrayBuffer,So=(e,t)=>{if("string"!=typeof e)return{type:"message",data:Ao(e,t)};const n=e.charAt(0);return"b"===n?{type:"message",data:Eo(e.substring(1),t)}:ho[n]?e.length>1?{type:ho[n],data:e.substring(1)}:{type:ho[n]}:po},Eo=(e,t)=>{if(_o){const n=(e=>{let t,n,o,i,r,s=.75*e.length,a=e.length,c=0;"="===e[e.length-1]&&(s--,"="===e[e.length-2]&&s--);const l=new ArrayBuffer(s),u=new Uint8Array(l);for(t=0;t<a;t+=4)n=ko[e.charCodeAt(t)],o=ko[e.charCodeAt(t+1)],i=ko[e.charCodeAt(t+2)],r=ko[e.charCodeAt(t+3)],u[c++]=n<<2|o>>4,u[c++]=(15&o)<<4|i>>2,u[c++]=(3&i)<<6|63&r;return l})(e);return Ao(n,t)}return{base64:!0,data:e}},Ao=(e,t)=>"blob"===t?e instanceof Blob?e:new Blob([e]):e instanceof ArrayBuffer?e:e.buffer,To=String.fromCharCode(30);let Co;function Mo(e){return e.reduce((e,t)=>e+t.length,0)}function Ro(e,t){if(e[0].length===t)return e.shift();const n=new Uint8Array(t);let o=0;for(let i=0;i<t;i++)n[i]=e[0][o++],o===e[0].length&&(e.shift(),o=0);return e.length&&o<e[0].length&&(e[0]=e[0].slice(o)),n}function xo(e){if(e)return function(e){for(var t in xo.prototype)e[t]=xo.prototype[t];return e}(e)}xo.prototype.on=xo.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this},xo.prototype.once=function(e,t){function n(){this.off(e,n),t.apply(this,arguments)}return n.fn=t,this.on(e,n),this},xo.prototype.off=xo.prototype.removeListener=xo.prototype.removeAllListeners=xo.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var n,o=this._callbacks["$"+e];if(!o)return this;if(1==arguments.length)return delete this._callbacks["$"+e],this;for(var i=0;i<o.length;i++)if((n=o[i])===t||n.fn===t){o.splice(i,1);break}return 0===o.length&&delete this._callbacks["$"+e],this},xo.prototype.emit=function(e){this._callbacks=this._callbacks||{};for(var t=new Array(arguments.length-1),n=this._callbacks["$"+e],o=1;o<arguments.length;o++)t[o-1]=arguments[o];if(n){o=0;for(var i=(n=n.slice(0)).length;o<i;++o)n[o].apply(this,t)}return this},xo.prototype.emitReserved=xo.prototype.emit,xo.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]},xo.prototype.hasListeners=function(e){return!!this.listeners(e).length};const Do="function"==typeof Promise&&"function"==typeof Promise.resolve?e=>Promise.resolve().then(e):(e,t)=>t(e,0),Io="undefined"!=typeof self?self:"undefined"!=typeof window?window:Function("return this")();function Oo(e,...t){return t.reduce((t,n)=>(e.hasOwnProperty(n)&&(t[n]=e[n]),t),{})}const Po=Io.setTimeout,Lo=Io.clearTimeout;function No(e,t){t.useNativeTimers?(e.setTimeoutFn=Po.bind(Io),e.clearTimeoutFn=Lo.bind(Io)):(e.setTimeoutFn=Io.setTimeout.bind(Io),e.clearTimeoutFn=Io.clearTimeout.bind(Io))}function Bo(e){return"string"==typeof e?function(e){let t=0,n=0;for(let o=0,i=e.length;o<i;o++)t=e.charCodeAt(o),t<128?n+=1:t<2048?n+=2:t<55296||t>=57344?n+=3:(o++,n+=4);return n}(e):Math.ceil(1.33*(e.byteLength||e.size))}function Fo(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}class Uo extends Error{constructor(e,t,n){super(e),this.description=t,this.context=n,this.type="TransportError"}}class qo extends xo{constructor(e){super(),this.writable=!1,No(this,e),this.opts=e,this.query=e.query,this.socket=e.socket,this.supportsBinary=!e.forceBase64}onError(e,t,n){return super.emitReserved("error",new Uo(e,t,n)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return"opening"!==this.readyState&&"open"!==this.readyState||(this.doClose(),this.onClose()),this}send(e){"open"===this.readyState&&this.write(e)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(e){const t=So(e,this.socket.binaryType);this.onPacket(t)}onPacket(e){super.emitReserved("packet",e)}onClose(e){this.readyState="closed",super.emitReserved("close",e)}pause(e){}createUri(e,t={}){return e+"://"+this._hostname()+this._port()+this.opts.path+this._query(t)}_hostname(){const e=this.opts.hostname;return-1===e.indexOf(":")?e:"["+e+"]"}_port(){return this.opts.port&&(this.opts.secure&&Number(443!==this.opts.port)||!this.opts.secure&&80!==Number(this.opts.port))?":"+this.opts.port:""}_query(e){const t=function(e){let t="";for(let n in e)e.hasOwnProperty(n)&&(t.length&&(t+="&"),t+=encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return t}(e);return t.length?"?"+t:""}}class jo extends qo{constructor(){super(...arguments),this._polling=!1}get name(){return"polling"}doOpen(){this._poll()}pause(e){this.readyState="pausing";const t=()=>{this.readyState="paused",e()};if(this._polling||!this.writable){let e=0;this._polling&&(e++,this.once("pollComplete",function(){--e||t()})),this.writable||(e++,this.once("drain",function(){--e||t()}))}else t()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(e){((e,t)=>{const n=e.split(To),o=[];for(let e=0;e<n.length;e++){const i=So(n[e],t);if(o.push(i),"error"===i.type)break}return o})(e,this.socket.binaryType).forEach(e=>{if("opening"===this.readyState&&"open"===e.type&&this.onOpen(),"close"===e.type)return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(e)}),"closed"!==this.readyState&&(this._polling=!1,this.emitReserved("pollComplete"),"open"===this.readyState&&this._poll())}doClose(){const e=()=>{this.write([{type:"close"}])};"open"===this.readyState?e():this.once("open",e)}write(e){this.writable=!1,((e,t)=>{const n=e.length,o=new Array(n);let i=0;e.forEach((e,r)=>{yo(e,!1,e=>{o[r]=e,++i===n&&t(o.join(To))})})})(e,e=>{this.doWrite(e,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const e=this.opts.secure?"https":"http",t=this.query||{};return!1!==this.opts.timestampRequests&&(t[this.opts.timestampParam]=Fo()),this.supportsBinary||t.sid||(t.b64=1),this.createUri(e,t)}}let Vo=!1;try{Vo="undefined"!=typeof XMLHttpRequest&&"withCredentials"in new XMLHttpRequest}catch(e){}const Ho=Vo;function zo(){}class Wo extends jo{constructor(e){if(super(e),"undefined"!=typeof location){const t="https:"===location.protocol;let n=location.port;n||(n=t?"443":"80"),this.xd="undefined"!=typeof location&&e.hostname!==location.hostname||n!==e.port}}doWrite(e,t){const n=this.request({method:"POST",data:e});n.on("success",t),n.on("error",(e,t)=>{this.onError("xhr post error",e,t)})}doPoll(){const e=this.request();e.on("data",this.onData.bind(this)),e.on("error",(e,t)=>{this.onError("xhr poll error",e,t)}),this.pollXhr=e}}class $o extends xo{constructor(e,t,n){super(),this.createRequest=e,No(this,n),this._opts=n,this._method=n.method||"GET",this._uri=t,this._data=void 0!==n.data?n.data:null,this._create()}_create(){var e;const t=Oo(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");t.xdomain=!!this._opts.xd;const n=this._xhr=this.createRequest(t);try{n.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){n.setDisableHeaderCheck&&n.setDisableHeaderCheck(!0);for(let e in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(e)&&n.setRequestHeader(e,this._opts.extraHeaders[e])}}catch(e){}if("POST"===this._method)try{n.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch(e){}try{n.setRequestHeader("Accept","*/*")}catch(e){}null===(e=this._opts.cookieJar)||void 0===e||e.addCookies(n),"withCredentials"in n&&(n.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(n.timeout=this._opts.requestTimeout),n.onreadystatechange=()=>{var e;3===n.readyState&&(null===(e=this._opts.cookieJar)||void 0===e||e.parseCookies(n.getResponseHeader("set-cookie"))),4===n.readyState&&(200===n.status||1223===n.status?this._onLoad():this.setTimeoutFn(()=>{this._onError("number"==typeof n.status?n.status:0)},0))},n.send(this._data)}catch(e){return void this.setTimeoutFn(()=>{this._onError(e)},0)}"undefined"!=typeof document&&(this._index=$o.requestsCount++,$o.requests[this._index]=this)}_onError(e){this.emitReserved("error",e,this._xhr),this._cleanup(!0)}_cleanup(e){if(void 0!==this._xhr&&null!==this._xhr){if(this._xhr.onreadystatechange=zo,e)try{this._xhr.abort()}catch(e){}"undefined"!=typeof document&&delete $o.requests[this._index],this._xhr=null}}_onLoad(){const e=this._xhr.responseText;null!==e&&(this.emitReserved("data",e),this.emitReserved("success"),this._cleanup())}abort(){this._cleanup()}}function Go(){for(let e in $o.requests)$o.requests.hasOwnProperty(e)&&$o.requests[e].abort()}$o.requestsCount=0,$o.requests={},"undefined"!=typeof document&&("function"==typeof attachEvent?attachEvent("onunload",Go):"function"==typeof addEventListener&&addEventListener("onpagehide"in Io?"pagehide":"unload",Go,!1));const Zo=function(){const e=Ko({xdomain:!1});return e&&null!==e.responseType}();class Xo extends Wo{constructor(e){super(e);const t=e&&e.forceBase64;this.supportsBinary=Zo&&!t}request(e={}){return Object.assign(e,{xd:this.xd},this.opts),new $o(Ko,this.uri(),e)}}function Ko(e){const t=e.xdomain;try{if("undefined"!=typeof XMLHttpRequest&&(!t||Ho))return new XMLHttpRequest}catch(e){}if(!t)try{return new(Io[["Active"].concat("Object").join("X")])("Microsoft.XMLHTTP")}catch(e){}}const Yo="undefined"!=typeof navigator&&"string"==typeof navigator.product&&"reactnative"===navigator.product.toLowerCase();class Jo extends qo{get name(){return"websocket"}doOpen(){const e=this.uri(),t=this.opts.protocols,n=Yo?{}:Oo(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(n.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(e,t,n)}catch(e){return this.emitReserved("error",e)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=e=>this.onClose({description:"websocket connection closed",context:e}),this.ws.onmessage=e=>this.onData(e.data),this.ws.onerror=e=>this.onError("websocket error",e)}write(e){this.writable=!1;for(let t=0;t<e.length;t++){const n=e[t],o=t===e.length-1;yo(n,this.supportsBinary,e=>{try{this.doWrite(n,e)}catch(e){}o&&Do(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){void 0!==this.ws&&(this.ws.onerror=()=>{},this.ws.close(),this.ws=null)}uri(){const e=this.opts.secure?"wss":"ws",t=this.query||{};return this.opts.timestampRequests&&(t[this.opts.timestampParam]=Fo()),this.supportsBinary||(t.b64=1),this.createUri(e,t)}}const Qo=Io.WebSocket||Io.MozWebSocket;class ei extends Jo{createSocket(e,t,n){return Yo?new Qo(e,t,n):t?new Qo(e,t):new Qo(e)}doWrite(e,t){this.ws.send(t)}}class ti extends qo{get name(){return"webtransport"}doOpen(){try{this._transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(e){return this.emitReserved("error",e)}this._transport.closed.then(()=>{this.onClose()}).catch(e=>{this.onError("webtransport error",e)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(e=>{const t=function(e,t){Co||(Co=new TextDecoder);const n=[];let o=0,i=-1,r=!1;return new TransformStream({transform(s,a){for(n.push(s);;){if(0===o){if(Mo(n)<1)break;const e=Ro(n,1);r=!(128&~e[0]),i=127&e[0],o=i<126?3:126===i?1:2}else if(1===o){if(Mo(n)<2)break;const e=Ro(n,2);i=new DataView(e.buffer,e.byteOffset,e.length).getUint16(0),o=3}else if(2===o){if(Mo(n)<8)break;const e=Ro(n,8),t=new DataView(e.buffer,e.byteOffset,e.length),r=t.getUint32(0);if(r>Math.pow(2,21)-1){a.enqueue(po);break}i=r*Math.pow(2,32)+t.getUint32(4),o=3}else{if(Mo(n)<i)break;const e=Ro(n,i);a.enqueue(So(r?e:Co.decode(e),t)),o=0}if(0===i||i>e){a.enqueue(po);break}}}})}(Number.MAX_SAFE_INTEGER,this.socket.binaryType),n=e.readable.pipeThrough(t).getReader(),o=new TransformStream({transform(e,t){!function(e,t){mo&&e.data instanceof Blob?e.data.arrayBuffer().then(vo).then(t):fo&&(e.data instanceof ArrayBuffer||go(e.data))?t(vo(e.data)):yo(e,!1,e=>{bo||(bo=new TextEncoder),t(bo.encode(e))})}(e,n=>{const o=n.length;let i;if(o<126)i=new Uint8Array(1),new DataView(i.buffer).setUint8(0,o);else if(o<65536){i=new Uint8Array(3);const e=new DataView(i.buffer);e.setUint8(0,126),e.setUint16(1,o)}else{i=new Uint8Array(9);const e=new DataView(i.buffer);e.setUint8(0,127),e.setBigUint64(1,BigInt(o))}e.data&&"string"!=typeof e.data&&(i[0]|=128),t.enqueue(i),t.enqueue(n)})}});o.readable.pipeTo(e.writable),this._writer=o.writable.getWriter();const i=()=>{n.read().then(({done:e,value:t})=>{e||(this.onPacket(t),i())}).catch(e=>{})};i();const r={type:"open"};this.query.sid&&(r.data=`{"sid":"${this.query.sid}"}`),this._writer.write(r).then(()=>this.onOpen())})})}write(e){this.writable=!1;for(let t=0;t<e.length;t++){const n=e[t],o=t===e.length-1;this._writer.write(n).then(()=>{o&&Do(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var e;null===(e=this._transport)||void 0===e||e.close()}}const ni={websocket:ei,webtransport:ti,polling:Xo},oi=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,ii=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function ri(e){if(e.length>8e3)throw"URI too long";const t=e,n=e.indexOf("["),o=e.indexOf("]");-1!=n&&-1!=o&&(e=e.substring(0,n)+e.substring(n,o).replace(/:/g,";")+e.substring(o,e.length));let i=oi.exec(e||""),r={},s=14;for(;s--;)r[ii[s]]=i[s]||"";return-1!=n&&-1!=o&&(r.source=t,r.host=r.host.substring(1,r.host.length-1).replace(/;/g,":"),r.authority=r.authority.replace("[","").replace("]","").replace(/;/g,":"),r.ipv6uri=!0),r.pathNames=function(e,t){const n=t.replace(/\/{2,9}/g,"/").split("/");return"/"!=t.slice(0,1)&&0!==t.length||n.splice(0,1),"/"==t.slice(-1)&&n.splice(n.length-1,1),n}(0,r.path),r.queryKey=function(e,t){const n={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(e,t,o){t&&(n[t]=o)}),n}(0,r.query),r}const si="function"==typeof addEventListener&&"function"==typeof removeEventListener,ai=[];si&&addEventListener("offline",()=>{ai.forEach(e=>e())},!1);class ci extends xo{constructor(e,t){if(super(),this.binaryType="arraybuffer",this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,e&&"object"==typeof e&&(t=e,e=null),e){const n=ri(e);t.hostname=n.host,t.secure="https"===n.protocol||"wss"===n.protocol,t.port=n.port,n.query&&(t.query=n.query)}else t.host&&(t.hostname=ri(t.host).host);No(this,t),this.secure=null!=t.secure?t.secure:"undefined"!=typeof location&&"https:"===location.protocol,t.hostname&&!t.port&&(t.port=this.secure?"443":"80"),this.hostname=t.hostname||("undefined"!=typeof location?location.hostname:"localhost"),this.port=t.port||("undefined"!=typeof location&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},t.transports.forEach(e=>{const t=e.prototype.name;this.transports.push(t),this._transportsByName[t]=e}),this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},t),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),"string"==typeof this.opts.query&&(this.opts.query=function(e){let t={},n=e.split("&");for(let e=0,o=n.length;e<o;e++){let o=n[e].split("=");t[decodeURIComponent(o[0])]=decodeURIComponent(o[1])}return t}(this.opts.query)),si&&(this.opts.closeOnBeforeunload&&(this._beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this._beforeunloadEventListener,!1)),"localhost"!==this.hostname&&(this._offlineEventListener=()=>{this._onClose("transport close",{description:"network connection lost"})},ai.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(e){const t=Object.assign({},this.opts.query);t.EIO=4,t.transport=e,this.id&&(t.sid=this.id);const n=Object.assign({},this.opts,{query:t,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[e]);return new this._transportsByName[e](n)}_open(){if(0===this.transports.length)return void this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);const e=this.opts.rememberUpgrade&&ci.priorWebsocketSuccess&&-1!==this.transports.indexOf("websocket")?"websocket":this.transports[0];this.readyState="opening";const t=this.createTransport(e);t.open(),this.setTransport(t)}setTransport(e){this.transport&&this.transport.removeAllListeners(),this.transport=e,e.on("drain",this._onDrain.bind(this)).on("packet",this._onPacket.bind(this)).on("error",this._onError.bind(this)).on("close",e=>this._onClose("transport close",e))}onOpen(){this.readyState="open",ci.priorWebsocketSuccess="websocket"===this.transport.name,this.emitReserved("open"),this.flush()}_onPacket(e){if("opening"===this.readyState||"open"===this.readyState||"closing"===this.readyState)switch(this.emitReserved("packet",e),this.emitReserved("heartbeat"),e.type){case"open":this.onHandshake(JSON.parse(e.data));break;case"ping":this._sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong"),this._resetPingTimeout();break;case"error":const t=new Error("server error");t.code=e.data,this._onError(t);break;case"message":this.emitReserved("data",e.data),this.emitReserved("message",e.data)}}onHandshake(e){this.emitReserved("handshake",e),this.id=e.sid,this.transport.query.sid=e.sid,this._pingInterval=e.pingInterval,this._pingTimeout=e.pingTimeout,this._maxPayload=e.maxPayload,this.onOpen(),"closed"!==this.readyState&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);const e=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+e,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose("ping timeout")},e),this.opts.autoUnref&&this._pingTimeoutTimer.unref()}_onDrain(){this.writeBuffer.splice(0,this._prevBufferLen),this._prevBufferLen=0,0===this.writeBuffer.length?this.emitReserved("drain"):this.flush()}flush(){if("closed"!==this.readyState&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const e=this._getWritablePackets();this.transport.send(e),this._prevBufferLen=e.length,this.emitReserved("flush")}}_getWritablePackets(){if(!(this._maxPayload&&"polling"===this.transport.name&&this.writeBuffer.length>1))return this.writeBuffer;let e=1;for(let t=0;t<this.writeBuffer.length;t++){const n=this.writeBuffer[t].data;if(n&&(e+=Bo(n)),t>0&&e>this._maxPayload)return this.writeBuffer.slice(0,t);e+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;const e=Date.now()>this._pingTimeoutTime;return e&&(this._pingTimeoutTime=0,Do(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),e}write(e,t,n){return this._sendPacket("message",e,t,n),this}send(e,t,n){return this._sendPacket("message",e,t,n),this}_sendPacket(e,t,n,o){if("function"==typeof t&&(o=t,t=void 0),"function"==typeof n&&(o=n,n=null),"closing"===this.readyState||"closed"===this.readyState)return;(n=n||{}).compress=!1!==n.compress;const i={type:e,data:t,options:n};this.emitReserved("packetCreate",i),this.writeBuffer.push(i),o&&this.once("flush",o),this.flush()}close(){const e=()=>{this._onClose("forced close"),this.transport.close()},t=()=>{this.off("upgrade",t),this.off("upgradeError",t),e()},n=()=>{this.once("upgrade",t),this.once("upgradeError",t)};return"opening"!==this.readyState&&"open"!==this.readyState||(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?n():e()}):this.upgrading?n():e()),this}_onError(e){if(ci.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&"opening"===this.readyState)return this.transports.shift(),this._open();this.emitReserved("error",e),this._onClose("transport error",e)}_onClose(e,t){if("opening"===this.readyState||"open"===this.readyState||"closing"===this.readyState){if(this.clearTimeoutFn(this._pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),si&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const e=ai.indexOf(this._offlineEventListener);-1!==e&&ai.splice(e,1)}this.readyState="closed",this.id=null,this.emitReserved("close",e,t),this.writeBuffer=[],this._prevBufferLen=0}}}ci.protocol=4;class li extends ci{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),"open"===this.readyState&&this.opts.upgrade)for(let e=0;e<this._upgrades.length;e++)this._probe(this._upgrades[e])}_probe(e){let t=this.createTransport(e),n=!1;ci.priorWebsocketSuccess=!1;const o=()=>{n||(t.send([{type:"ping",data:"probe"}]),t.once("packet",e=>{if(!n)if("pong"===e.type&&"probe"===e.data){if(this.upgrading=!0,this.emitReserved("upgrading",t),!t)return;ci.priorWebsocketSuccess="websocket"===t.name,this.transport.pause(()=>{n||"closed"!==this.readyState&&(l(),this.setTransport(t),t.send([{type:"upgrade"}]),this.emitReserved("upgrade",t),t=null,this.upgrading=!1,this.flush())})}else{const e=new Error("probe error");e.transport=t.name,this.emitReserved("upgradeError",e)}}))};function i(){n||(n=!0,l(),t.close(),t=null)}const r=e=>{const n=new Error("probe error: "+e);n.transport=t.name,i(),this.emitReserved("upgradeError",n)};function s(){r("transport closed")}function a(){r("socket closed")}function c(e){t&&e.name!==t.name&&i()}const l=()=>{t.removeListener("open",o),t.removeListener("error",r),t.removeListener("close",s),this.off("close",a),this.off("upgrading",c)};t.once("open",o),t.once("error",r),t.once("close",s),this.once("close",a),this.once("upgrading",c),-1!==this._upgrades.indexOf("webtransport")&&"webtransport"!==e?this.setTimeoutFn(()=>{n||t.open()},200):t.open()}onHandshake(e){this._upgrades=this._filterUpgrades(e.upgrades),super.onHandshake(e)}_filterUpgrades(e){const t=[];for(let n=0;n<e.length;n++)~this.transports.indexOf(e[n])&&t.push(e[n]);return t}}let ui=class extends li{constructor(e,t={}){const n="object"==typeof e?e:t;(!n.transports||n.transports&&"string"==typeof n.transports[0])&&(n.transports=(n.transports||["polling","websocket","webtransport"]).map(e=>ni[e]).filter(e=>!!e)),super(e,n)}};const hi="function"==typeof ArrayBuffer,di=Object.prototype.toString,pi="function"==typeof Blob||"undefined"!=typeof Blob&&"[object BlobConstructor]"===di.call(Blob),mi="function"==typeof File||"undefined"!=typeof File&&"[object FileConstructor]"===di.call(File);function fi(e){return hi&&(e instanceof ArrayBuffer||(e=>"function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer)(e))||pi&&e instanceof Blob||mi&&e instanceof File}function gi(e,t){if(!e||"object"!=typeof e)return!1;if(Array.isArray(e)){for(let t=0,n=e.length;t<n;t++)if(gi(e[t]))return!0;return!1}if(fi(e))return!0;if(e.toJSON&&"function"==typeof e.toJSON&&1===arguments.length)return gi(e.toJSON(),!0);for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t)&&gi(e[t]))return!0;return!1}function yi(e){const t=[],n=e.data,o=e;return o.data=wi(n,t),o.attachments=t.length,{packet:o,buffers:t}}function wi(e,t){if(!e)return e;if(fi(e)){const n={_placeholder:!0,num:t.length};return t.push(e),n}if(Array.isArray(e)){const n=new Array(e.length);for(let o=0;o<e.length;o++)n[o]=wi(e[o],t);return n}if("object"==typeof e&&!(e instanceof Date)){const n={};for(const o in e)Object.prototype.hasOwnProperty.call(e,o)&&(n[o]=wi(e[o],t));return n}return e}function vi(e,t){return e.data=bi(e.data,t),delete e.attachments,e}function bi(e,t){if(!e)return e;if(e&&!0===e._placeholder){if("number"==typeof e.num&&e.num>=0&&e.num<t.length)return t[e.num];throw new Error("illegal attachments")}if(Array.isArray(e))for(let n=0;n<e.length;n++)e[n]=bi(e[n],t);else if("object"==typeof e)for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(e[n]=bi(e[n],t));return e}const ki=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"];var _i;function Si(e){return"[object Object]"===Object.prototype.toString.call(e)}!function(e){e[e.CONNECT=0]="CONNECT",e[e.DISCONNECT=1]="DISCONNECT",e[e.EVENT=2]="EVENT",e[e.ACK=3]="ACK",e[e.CONNECT_ERROR=4]="CONNECT_ERROR",e[e.BINARY_EVENT=5]="BINARY_EVENT",e[e.BINARY_ACK=6]="BINARY_ACK"}(_i||(_i={}));class Ei extends xo{constructor(e){super(),this.reviver=e}add(e){let t;if("string"==typeof e){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");t=this.decodeString(e);const n=t.type===_i.BINARY_EVENT;n||t.type===_i.BINARY_ACK?(t.type=n?_i.EVENT:_i.ACK,this.reconstructor=new Ai(t),0===t.attachments&&super.emitReserved("decoded",t)):super.emitReserved("decoded",t)}else{if(!fi(e)&&!e.base64)throw new Error("Unknown type: "+e);if(!this.reconstructor)throw new Error("got binary data when not reconstructing a packet");t=this.reconstructor.takeBinaryData(e),t&&(this.reconstructor=null,super.emitReserved("decoded",t))}}decodeString(e){let t=0;const n={type:Number(e.charAt(0))};if(void 0===_i[n.type])throw new Error("unknown packet type "+n.type);if(n.type===_i.BINARY_EVENT||n.type===_i.BINARY_ACK){const o=t+1;for(;"-"!==e.charAt(++t)&&t!=e.length;);const i=e.substring(o,t);if(i!=Number(i)||"-"!==e.charAt(t))throw new Error("Illegal attachments");n.attachments=Number(i)}if("/"===e.charAt(t+1)){const o=t+1;for(;++t&&","!==e.charAt(t)&&t!==e.length;);n.nsp=e.substring(o,t)}else n.nsp="/";const o=e.charAt(t+1);if(""!==o&&Number(o)==o){const o=t+1;for(;++t;){const n=e.charAt(t);if(null==n||Number(n)!=n){--t;break}if(t===e.length)break}n.id=Number(e.substring(o,t+1))}if(e.charAt(++t)){const o=this.tryParse(e.substr(t));if(!Ei.isPayloadValid(n.type,o))throw new Error("invalid payload");n.data=o}return n}tryParse(e){try{return JSON.parse(e,this.reviver)}catch(e){return!1}}static isPayloadValid(e,t){switch(e){case _i.CONNECT:return Si(t);case _i.DISCONNECT:return void 0===t;case _i.CONNECT_ERROR:return"string"==typeof t||Si(t);case _i.EVENT:case _i.BINARY_EVENT:return Array.isArray(t)&&("number"==typeof t[0]||"string"==typeof t[0]&&-1===ki.indexOf(t[0]));case _i.ACK:case _i.BINARY_ACK:return Array.isArray(t)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class Ai{constructor(e){this.packet=e,this.buffers=[],this.reconPack=e}takeBinaryData(e){if(this.buffers.push(e),this.buffers.length===this.reconPack.attachments){const e=vi(this.reconPack,this.buffers);return this.finishedReconstruction(),e}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}var Ti=Object.freeze({__proto__:null,Decoder:Ei,Encoder:class{constructor(e){this.replacer=e}encode(e){return e.type!==_i.EVENT&&e.type!==_i.ACK||!gi(e)?[this.encodeAsString(e)]:this.encodeAsBinary({type:e.type===_i.EVENT?_i.BINARY_EVENT:_i.BINARY_ACK,nsp:e.nsp,data:e.data,id:e.id})}encodeAsString(e){let t=""+e.type;return e.type!==_i.BINARY_EVENT&&e.type!==_i.BINARY_ACK||(t+=e.attachments+"-"),e.nsp&&"/"!==e.nsp&&(t+=e.nsp+","),null!=e.id&&(t+=e.id),null!=e.data&&(t+=JSON.stringify(e.data,this.replacer)),t}encodeAsBinary(e){const t=yi(e),n=this.encodeAsString(t.packet),o=t.buffers;return o.unshift(n),o}},get PacketType(){return _i},protocol:5});function Ci(e,t,n){return e.on(t,n),function(){e.off(t,n)}}const Mi=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class Ri extends xo{constructor(e,t,n){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=e,this.nsp=t,n&&n.auth&&(this.auth=n.auth),this._opts=Object.assign({},n),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const e=this.io;this.subs=[Ci(e,"open",this.onopen.bind(this)),Ci(e,"packet",this.onpacket.bind(this)),Ci(e,"error",this.onerror.bind(this)),Ci(e,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected||(this.subEvents(),this.io._reconnecting||this.io.open(),"open"===this.io._readyState&&this.onopen()),this}open(){return this.connect()}send(...e){return e.unshift("message"),this.emit.apply(this,e),this}emit(e,...t){var n,o,i;if(Mi.hasOwnProperty(e))throw new Error('"'+e.toString()+'" is a reserved event name');if(t.unshift(e),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(t),this;const r={type:_i.EVENT,data:t,options:{}};if(r.options.compress=!1!==this.flags.compress,"function"==typeof t[t.length-1]){const e=this.ids++,n=t.pop();this._registerAckCallback(e,n),r.id=e}const s=null===(o=null===(n=this.io.engine)||void 0===n?void 0:n.transport)||void 0===o?void 0:o.writable,a=this.connected&&!(null===(i=this.io.engine)||void 0===i?void 0:i._hasPingExpired());return this.flags.volatile&&!s||(a?(this.notifyOutgoingListeners(r),this.packet(r)):this.sendBuffer.push(r)),this.flags={},this}_registerAckCallback(e,t){var n;const o=null!==(n=this.flags.timeout)&&void 0!==n?n:this._opts.ackTimeout;if(void 0===o)return void(this.acks[e]=t);const i=this.io.setTimeoutFn(()=>{delete this.acks[e];for(let t=0;t<this.sendBuffer.length;t++)this.sendBuffer[t].id===e&&this.sendBuffer.splice(t,1);t.call(this,new Error("operation has timed out"))},o),r=(...e)=>{this.io.clearTimeoutFn(i),t.apply(this,e)};r.withError=!0,this.acks[e]=r}emitWithAck(e,...t){return new Promise((n,o)=>{const i=(e,t)=>e?o(e):n(t);i.withError=!0,t.push(i),this.emit(e,...t)})}_addToQueue(e){let t;"function"==typeof e[e.length-1]&&(t=e.pop());const n={id:this._queueSeq++,tryCount:0,pending:!1,args:e,flags:Object.assign({fromQueue:!0},this.flags)};e.push((e,...o)=>{if(n===this._queue[0])return null!==e?n.tryCount>this._opts.retries&&(this._queue.shift(),t&&t(e)):(this._queue.shift(),t&&t(null,...o)),n.pending=!1,this._drainQueue()}),this._queue.push(n),this._drainQueue()}_drainQueue(e=!1){if(!this.connected||0===this._queue.length)return;const t=this._queue[0];t.pending&&!e||(t.pending=!0,t.tryCount++,this.flags=t.flags,this.emit.apply(this,t.args))}packet(e){e.nsp=this.nsp,this.io._packet(e)}onopen(){"function"==typeof this.auth?this.auth(e=>{this._sendConnectPacket(e)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(e){this.packet({type:_i.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},e):e})}onerror(e){this.connected||this.emitReserved("connect_error",e)}onclose(e,t){this.connected=!1,delete this.id,this.emitReserved("disconnect",e,t),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(e=>{if(!this.sendBuffer.some(t=>String(t.id)===e)){const t=this.acks[e];delete this.acks[e],t.withError&&t.call(this,new Error("socket has been disconnected"))}})}onpacket(e){if(e.nsp===this.nsp)switch(e.type){case _i.CONNECT:e.data&&e.data.sid?this.onconnect(e.data.sid,e.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case _i.EVENT:case _i.BINARY_EVENT:this.onevent(e);break;case _i.ACK:case _i.BINARY_ACK:this.onack(e);break;case _i.DISCONNECT:this.ondisconnect();break;case _i.CONNECT_ERROR:this.destroy();const t=new Error(e.data.message);t.data=e.data.data,this.emitReserved("connect_error",t)}}onevent(e){const t=e.data||[];null!=e.id&&t.push(this.ack(e.id)),this.connected?this.emitEvent(t):this.receiveBuffer.push(Object.freeze(t))}emitEvent(e){if(this._anyListeners&&this._anyListeners.length){const t=this._anyListeners.slice();for(const n of t)n.apply(this,e)}super.emit.apply(this,e),this._pid&&e.length&&"string"==typeof e[e.length-1]&&(this._lastOffset=e[e.length-1])}ack(e){const t=this;let n=!1;return function(...o){n||(n=!0,t.packet({type:_i.ACK,id:e,data:o}))}}onack(e){const t=this.acks[e.id];"function"==typeof t&&(delete this.acks[e.id],t.withError&&e.data.unshift(null),t.apply(this,e.data))}onconnect(e,t){this.id=e,this.recovered=t&&this._pid===t,this._pid=t,this.connected=!0,this.emitBuffered(),this.emitReserved("connect"),this._drainQueue(!0)}emitBuffered(){this.receiveBuffer.forEach(e=>this.emitEvent(e)),this.receiveBuffer=[],this.sendBuffer.forEach(e=>{this.notifyOutgoingListeners(e),this.packet(e)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(e=>e()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:_i.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(e){return this.flags.compress=e,this}get volatile(){return this.flags.volatile=!0,this}timeout(e){return this.flags.timeout=e,this}onAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(e),this}prependAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(e),this}offAny(e){if(!this._anyListeners)return this;if(e){const t=this._anyListeners;for(let n=0;n<t.length;n++)if(e===t[n])return t.splice(n,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(e){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(e),this}prependAnyOutgoing(e){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(e),this}offAnyOutgoing(e){if(!this._anyOutgoingListeners)return this;if(e){const t=this._anyOutgoingListeners;for(let n=0;n<t.length;n++)if(e===t[n])return t.splice(n,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(e){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const t=this._anyOutgoingListeners.slice();for(const n of t)n.apply(this,e.data)}}}function xi(e){e=e||{},this.ms=e.min||100,this.max=e.max||1e4,this.factor=e.factor||2,this.jitter=e.jitter>0&&e.jitter<=1?e.jitter:0,this.attempts=0}xi.prototype.duration=function(){var e=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var t=Math.random(),n=Math.floor(t*this.jitter*e);e=1&Math.floor(10*t)?e+n:e-n}return 0|Math.min(e,this.max)},xi.prototype.reset=function(){this.attempts=0},xi.prototype.setMin=function(e){this.ms=e},xi.prototype.setMax=function(e){this.max=e},xi.prototype.setJitter=function(e){this.jitter=e};class Di extends xo{constructor(e,t){var n;super(),this.nsps={},this.subs=[],e&&"object"==typeof e&&(t=e,e=void 0),(t=t||{}).path=t.path||"/socket.io",this.opts=t,No(this,t),this.reconnection(!1!==t.reconnection),this.reconnectionAttempts(t.reconnectionAttempts||1/0),this.reconnectionDelay(t.reconnectionDelay||1e3),this.reconnectionDelayMax(t.reconnectionDelayMax||5e3),this.randomizationFactor(null!==(n=t.randomizationFactor)&&void 0!==n?n:.5),this.backoff=new xi({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(null==t.timeout?2e4:t.timeout),this._readyState="closed",this.uri=e;const o=t.parser||Ti;this.encoder=new o.Encoder,this.decoder=new o.Decoder,this._autoConnect=!1!==t.autoConnect,this._autoConnect&&this.open()}reconnection(e){return arguments.length?(this._reconnection=!!e,e||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(e){return void 0===e?this._reconnectionAttempts:(this._reconnectionAttempts=e,this)}reconnectionDelay(e){var t;return void 0===e?this._reconnectionDelay:(this._reconnectionDelay=e,null===(t=this.backoff)||void 0===t||t.setMin(e),this)}randomizationFactor(e){var t;return void 0===e?this._randomizationFactor:(this._randomizationFactor=e,null===(t=this.backoff)||void 0===t||t.setJitter(e),this)}reconnectionDelayMax(e){var t;return void 0===e?this._reconnectionDelayMax:(this._reconnectionDelayMax=e,null===(t=this.backoff)||void 0===t||t.setMax(e),this)}timeout(e){return arguments.length?(this._timeout=e,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&0===this.backoff.attempts&&this.reconnect()}open(e){if(~this._readyState.indexOf("open"))return this;this.engine=new ui(this.uri,this.opts);const t=this.engine,n=this;this._readyState="opening",this.skipReconnect=!1;const o=Ci(t,"open",function(){n.onopen(),e&&e()}),i=t=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",t),e?e(t):this.maybeReconnectOnOpen()},r=Ci(t,"error",i);if(!1!==this._timeout){const e=this._timeout,n=this.setTimeoutFn(()=>{o(),i(new Error("timeout")),t.close()},e);this.opts.autoUnref&&n.unref(),this.subs.push(()=>{this.clearTimeoutFn(n)})}return this.subs.push(o),this.subs.push(r),this}connect(e){return this.open(e)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const e=this.engine;this.subs.push(Ci(e,"ping",this.onping.bind(this)),Ci(e,"data",this.ondata.bind(this)),Ci(e,"error",this.onerror.bind(this)),Ci(e,"close",this.onclose.bind(this)),Ci(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(e){try{this.decoder.add(e)}catch(e){this.onclose("parse error",e)}}ondecoded(e){Do(()=>{this.emitReserved("packet",e)},this.setTimeoutFn)}onerror(e){this.emitReserved("error",e)}socket(e,t){let n=this.nsps[e];return n?this._autoConnect&&!n.active&&n.connect():(n=new Ri(this,e,t),this.nsps[e]=n),n}_destroy(e){const t=Object.keys(this.nsps);for(const e of t)if(this.nsps[e].active)return;this._close()}_packet(e){const t=this.encoder.encode(e);for(let n=0;n<t.length;n++)this.engine.write(t[n],e.options)}cleanup(){this.subs.forEach(e=>e()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(e,t){var n;this.cleanup(),null===(n=this.engine)||void 0===n||n.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",e,t),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const e=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const t=this.backoff.duration();this._reconnecting=!0;const n=this.setTimeoutFn(()=>{e.skipReconnect||(this.emitReserved("reconnect_attempt",e.backoff.attempts),e.skipReconnect||e.open(t=>{t?(e._reconnecting=!1,e.reconnect(),this.emitReserved("reconnect_error",t)):e.onreconnect()}))},t);this.opts.autoUnref&&n.unref(),this.subs.push(()=>{this.clearTimeoutFn(n)})}}onreconnect(){const e=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",e)}}const Ii={};function Oi(e,t){"object"==typeof e&&(t=e,e=void 0);const n=function(e,t="",n){let o=e;n=n||"undefined"!=typeof location&&location,null==e&&(e=n.protocol+"//"+n.host),"string"==typeof e&&("/"===e.charAt(0)&&(e="/"===e.charAt(1)?n.protocol+e:n.host+e),/^(https?|wss?):\/\//.test(e)||(e=void 0!==n?n.protocol+"//"+e:"https://"+e),o=ri(e)),o.port||(/^(http|ws)$/.test(o.protocol)?o.port="80":/^(http|ws)s$/.test(o.protocol)&&(o.port="443")),o.path=o.path||"/";const i=-1!==o.host.indexOf(":")?"["+o.host+"]":o.host;return o.id=o.protocol+"://"+i+":"+o.port+t,o.href=o.protocol+"://"+i+(n&&n.port===o.port?"":":"+o.port),o}(e,(t=t||{}).path||"/socket.io"),o=n.source,i=n.id,r=n.path,s=Ii[i]&&r in Ii[i].nsps;let a;return t.forceNew||t["force new connection"]||!1===t.multiplex||s?a=new Di(o,t):(Ii[i]||(Ii[i]=new Di(o,t)),a=Ii[i]),n.query&&!t.query&&(t.query=n.queryKey),a.socket(n.path,t)}Object.assign(Oi,{Manager:Di,Socket:Ri,io:Oi,connect:Oi});var Pi=Object.freeze({__proto__:null,Manager:Di,NodeWebSocket:ei,NodeXHR:Xo,Socket:Ri,WebSocket:ei,WebTransport:ti,XHR:Xo,connect:Oi,default:Oi,io:Oi,protocol:5});return e.Zaplier=St,e.ZaplierSDK=kt,e.analyzeUserAgent=function(e){const t=e||navigator.userAgent||"",n=function(e){const t=e.toLowerCase();if(t.includes("edg/")){const t=Kt(e,/edg\/([0-9.]+)/i);return{name:"Edge",version:t,major:t.split(".")[0]||"Unknown",engine:"chromium"}}if(t.includes("edge/")){const t=Kt(e,/edge\/([0-9.]+)/i);return{name:"Edge Legacy",version:t,major:t.split(".")[0]||"Unknown",engine:"edgehtml"}}if(t.includes("brave/")||navigator.brave){const t=Kt(e,/chrome\/([0-9.]+)/i);return{name:"Brave",version:t,major:t.split(".")[0]||"Unknown",engine:"chromium"}}if(Gt()){const t=Kt(e,/samsungbrowser\/([0-9.]+)/i);return{name:"Samsung Internet",version:t,major:t.split(".")[0]||"Unknown",engine:"chromium"}}if(t.includes("chrome/")&&!t.includes("edg")){const t=Kt(e,/chrome\/([0-9.]+)/i);return{name:"Chrome",version:t,major:t.split(".")[0]||"Unknown",engine:"chromium"}}if(t.includes("firefox/")){const t=Kt(e,/firefox\/([0-9.]+)/i);return{name:"Firefox",version:t,major:t.split(".")[0]||"Unknown",engine:"gecko"}}if(t.includes("safari/")&&!t.includes("chrome")){const t=Kt(e,/version\/([0-9.]+)/i);return{name:"Safari",version:t,major:t.split(".")[0]||"Unknown",engine:"webkit"}}if(t.includes("opr/")||t.includes("opera/")){const t=Kt(e,/(?:opr|opera)\/([0-9.]+)/i);return{name:"Opera",version:t,major:t.split(".")[0]||"Unknown",engine:zt()?"chromium":"unknown"}}if(t.includes("vivaldi/")){const t=Kt(e,/vivaldi\/([0-9.]+)/i);return{name:"Vivaldi",version:t,major:t.split(".")[0]||"Unknown",engine:"chromium"}}if(t.includes("yabrowser/")){const t=Kt(e,/yabrowser\/([0-9.]+)/i);return{name:"Yandex Browser",version:t,major:t.split(".")[0]||"Unknown",engine:"chromium"}}if(t.includes("msie")||t.includes("trident/")){const t=Kt(e,/(?:msie |rv:)([0-9.]+)/i);return{name:"Internet Explorer",version:t,major:t.split(".")[0]||"Unknown",engine:"trident"}}if(t.includes("ucbrowser/")){const t=Kt(e,/ucbrowser\/([0-9.]+)/i);return{name:"UC Browser",version:t,major:t.split(".")[0]||"Unknown",engine:"chromium"}}if(t.includes("qqbrowser/")){const t=Kt(e,/qqbrowser\/([0-9.]+)/i);return{name:"QQ Browser",version:t,major:t.split(".")[0]||"Unknown",engine:"chromium"}}return{name:"Unknown",version:"Unknown",major:"Unknown",engine:"unknown"}}(t),o=function(e){const t=e.toLowerCase();if(t.includes("windows nt")){const t=Kt(e,/windows nt ([0-9.]+)/i);let n="Windows";switch(t){case"10.0":n="Windows 10/11";break;case"6.3":n="Windows 8.1";break;case"6.2":n="Windows 8";break;case"6.1":n="Windows 7";break;case"6.0":n="Windows Vista";break;case"5.1":n="Windows XP";break;default:n="Windows"}return{name:n,version:t,family:"windows"}}return t.includes("mac os x")||t.includes("macos")?{name:"macOS",version:Kt(e,/mac os x ([0-9._]+)/i).replace(/_/g,"."),family:"macos"}:t.includes("iphone")||t.includes("ipad")||t.includes("ipod")||Zt()?{name:"iOS",version:Kt(e,/os ([0-9._]+)/i).replace(/_/g,"."),family:"ios"}:Xt()?{name:"Android",version:Kt(e,/android ([0-9.]+)/i),family:"android"}:t.includes("linux")?{name:"Linux",version:"Unknown",family:"linux"}:t.includes("cros")?{name:"Chrome OS",version:Kt(e,/cros [a-z0-9_]+ ([0-9.]+)/i),family:"linux"}:t.includes("freebsd")?{name:"FreeBSD",version:"Unknown",family:"unix"}:{name:"Unknown",version:"Unknown",family:"unknown"}}(t),i=Yt(t),r=function(e){const t=[];let n="legitimate";const o=["bot","crawler","spider","scraper","automation","headless","phantom","selenium","webdriver","google","bing","yahoo","baidu","yandex","facebook","twitter","linkedin","whatsapp"];for(const i of o)e.toLowerCase().includes(i)&&(t.push(i),["bot","crawler","spider","scraper"].some(e=>i.includes(e))?n="crawler":["selenium","webdriver","automation"].some(e=>i.includes(e))?n="automation":["headless","phantom"].some(e=>i.includes(e))&&(n="headless"));return e.length<10&&t.push("too_short"),e&&"Mozilla/5.0"!==e||t.push("generic_mozilla"),{isBot:t.length>0,patterns:t,category:n}}(t);return{browser:{name:n.name,version:n.version,major:n.major,engine:n.engine},os:{name:o.name,version:o.version,family:o.family},device:{type:i.type,vendor:i.vendor,model:i.model},suspicious:{isBot:r.isBot,patterns:r.patterns,category:r.category},isMobile:"mobile"===i.type,isTablet:"tablet"===i.type,isDesktop:"desktop"===i.type,isBot:r.isBot,raw:t}},e.autoInitializeFromScript=Et,e.clearFingerprintCache=function(){rt.clear()},e.collectFingerprint=lt,e.default=kt,e.detectBot=async function(){const e={webDriver:Ct(),headlessBrowser:Mt(),automationTools:Rt(),domBlockers:xt(),missingLanguages:Dt(),inconsistentEval:It(),humanBehavior:{detected:!1,confidence:0,method:"not_implemented"},mouseMovement:{detected:!1,confidence:0,method:"not_implemented"},clickPatterns:{detected:!1,confidence:0,method:"not_implemented"},canvasInconsistency:{detected:!1,confidence:0,method:"not_implemented"},webglAnomaly:{detected:!1,confidence:0,method:"not_implemented"},missingPlugins:{detected:0===navigator.plugins.length,confidence:30,method:"plugin_count"},inconsistentProperties:{detected:!1,confidence:0,method:"not_implemented"},modifiedBuiltins:{detected:!1,confidence:0,method:"not_implemented"}},t=Ot(),n=Object.values(e).filter(e=>e.detected),o=n.reduce((e,t)=>e+t.confidence,0),i=n.length>0?o/n.length:0,r=n.length>=2||n.some(e=>e.confidence>=90)||(t.suspicious?.isBot??!1);let s="low";return i>=70?s="high":(i>=40||n.length>=2)&&(s="medium"),{isBot:r,confidence:Math.round(Math.min(i,95)),riskLevel:s,detectionMethods:Object.keys(e).filter(t=>e[t]?.detected),detectors:e,userAgent:t}},e.detectIncognitoMode=async function(){!function(){const e=navigator.userAgent.toLowerCase();e.includes("chrome")||e.includes("firefox")||e.includes("safari")||e.includes("edge")}();const e=navigator.userAgent,t=/Chrome/.test(e)&&!/Edg|OPR/.test(e),n=/Safari/.test(e)&&!/Chrome/.test(e),o=/Firefox/.test(e),i=/Edg/.test(e),r=2e3,[s,a,c,l,u,h,d,p,m]=await Promise.allSettled([Promise.race([Pt(),Ht(r,"localStorage")]),Promise.race([Lt(),Ht(r,"sessionStorage")]),Promise.race([Nt(),Ht(r,"indexedDB")]),Promise.race([Bt(),Ht(r,"permissions")]),Promise.race([Ft(),Ht(r,"quotaManagement")]),Promise.race([jt(),Ht(r,"filesystem")]),Promise.race([Vt(),Ht(r,"cacheDetection")]),Promise.race([Ut(),Ht(r,"chromeSpecific")]),Promise.race([qt(),Ht(r,"safariSpecific")])]),f=[];[{name:"localStorage",result:s},{name:"sessionStorage",result:a},{name:"indexedDB",result:c},{name:"permissions",result:l},{name:"quotaManagement",result:u},{name:"filesystem",result:h},{name:"cacheDetection",result:d},{name:"chromeSpecific",result:p},{name:"safariSpecific",result:m}].forEach(({name:e,result:r})=>{if("fulfilled"===r.status&&r.value.detected){const s=function(e,t,n){const o=Math.floor(.5*n);switch(e){case"quotaManagement":return t.isChrome||t.isEdge?Math.min(50,o+25):t.isSafari?Math.min(40,o+15):Math.min(30,o+10);case"filesystem":return t.isChrome||t.isEdge?Math.min(40,o+20):Math.max(5,o-5);case"indexedDB":return t.isFirefox?Math.min(45,o+20):t.isSafari?Math.min(35,o+10):o;case"localStorage":return Math.max(5,o-15);case"sessionStorage":return Math.max(5,o-10);case"permissions":return t.isChrome?Math.min(30,o+10):Math.max(5,o-5);case"cacheDetection":return Math.max(5,o-20);case"chromeSpecific":return t.isChrome?Math.min(50,o+30):0;case"safariSpecific":return t.isSafari?Math.min(45,o+25):0;default:return Math.max(5,o)}}(e,{isChrome:t,isSafari:n,isFirefox:o,isEdge:i},r.value.confidence);f.push({method:r.value.method,confidence:r.value.confidence,weight:s})}});const g=f.reduce((e,t)=>e+t.weight,0),y=f.reduce((e,t)=>e+t.confidence*t.weight/100,0);let w;w=n?35:t||i?45:o?40:50;const v=g>=w,b=g>0?Math.min(95,y/g*100):0,k="fulfilled"===s.status?s.value:{detected:!1},_="fulfilled"===a.status?a.value:{detected:!1},S="fulfilled"===c.status?c.value:{detected:!1},E="fulfilled"===l.status?l.value:{},A="fulfilled"===u.status?u.value:{detected:!1};return"fulfilled"===h.status&&h.value,"fulfilled"===d.status&&d.value,"undefined"!=typeof window&&window.RabbitTracker?.config?.debug&&console.debug("Incognito Detection Analysis:",{browserInfo:{isChrome:t,isSafari:n,isFirefox:o,isEdge:i},detectedSignals:f,totalWeight:g,minWeightThreshold:w,finalConfidence:b,isDetected:v}),{isIncognito:v,confidence:Math.round(b),detectionMethods:f.map(e=>e.method),details:{localStorage:k?.detected??!1,sessionStorage:_?.detected??!1,indexedDB:S?.detected??!1,cookiesEnabled:!1,quota:A?.detected?0:null,permissions:E?.details||{}}}},e.generateVisitorId=l,e.generateVisitorIdFromFingerprint=function(e){return l(e.hash)},e.getAvailableComponents=function(){const e=[];return z()&&e.push("canvas"),ge()&&e.push("webgl"),w()&&e.push("audio"),Y()&&e.push("fonts"),ee()&&e.push("screen"),U()&&e.push("browser"),e},e.getBrowserEngine=function(){return zt()?"chromium":Wt()?"webkit":$t()?"gecko":navigator.userAgent.toLowerCase().includes("trident")?"trident":"unknown"},e.getCompleteFingerprint=ht,e.getLightweightFingerprint=ut,e.hash32=a,e.hashFingerprint=c,e.isAndroid=Xt,e.isChromium=zt,e.isDesktop=function(){return"desktop"===Yt(navigator.userAgent).type},e.isFingerprintingAvailable=function(){return ee()&&U()},e.isGecko=$t,e.isIPad=Zt,e.isMobile=function(){return"mobile"===Yt(navigator.userAgent).type},e.isSamsungInternet=Gt,e.isTablet=function(){return"tablet"===Yt(navigator.userAgent).type},e.isWebKit=Wt,e.quickBotDetection=async function(){const e=Ct(),t=Ot();return e.detected||(t.suspicious?.isBot??!1)},e.quickIncognitoDetection=async function(){try{const[e,t]=await Promise.all([Pt(),Nt()]);return e.detected||t.detected}catch{return!1}},e.x64hash128=s,Object.defineProperty(e,"__esModule",{value:!0}),e}({});
7
+ var e=function(e){"use strict";function t(e,t){const n=e[1]+t[1]&4294967295;return[e[0]+t[0]+(n<e[1]?1:0)&4294967295,n]}function n(e,t){const n=65535&e[1],o=e[1]>>>16,i=65535&t[1],r=t[1]>>>16,a=n*r+o*i&4294967295,s=o*r+(a>>>16),c=n*i+((65535&a)<<16)&4294967295;return[e[0]*t[1]+e[1]*t[0]+s&4294967295,c]}function o(e,t){return 0==(t%=64)?e:t<32?[4294967295&(e[0]<<t|e[1]>>>32-t),4294967295&(e[1]<<t|e[0]>>>32-t)]:(t-=32,[4294967295&(e[1]<<t|e[0]>>>32-t),4294967295&(e[0]<<t|e[1]>>>32-t)])}function i(e,t){return[e[0]^t[0],e[1]^t[1]]}function r(e){let t=e;return t=i(t,[0,t[0]>>>1]),t=n(t,[4283543511,3981806797]),t=i(t,[0,t[0]>>>1]),t=n(t,[3301882366,444984403]),t=i(t,[0,t[0]>>>1]),t}function a(e,a=0){const s=function(e){const t=[];for(let n=0;n<e.length;n+=4){let o=0;for(let t=Math.min(3,e.length-n-1);t>=0;t--)o=o<<8|e.charCodeAt(n+t);t.push(o)}return t}(e),c=Math.floor(s.length/4);let l=[0,a],u=[0,a];const d=[2277735313,289559509],h=[1291169091,658871167];for(let e=0;e<c;e++){const r=4*e,a=4*e+2;let c=[s[r+1]||0,s[r]||0],m=[s[a+1]||0,s[a]||0];c=n(c,d),c=o(c,31),c=n(c,h),l=i(l,c),l=o(l,27),l=t(l,u),l=t(n(l,[0,5]),[0,1390208809]),m=n(m,h),m=o(m,33),m=n(m,d),u=i(u,m),u=o(u,31),u=t(u,l),u=t(n(u,[0,5]),[0,944331445])}const m=4*c,g=s.length-m;let f=[0,0],p=[0,0];return g>=12&&(p=i(p,[s[m+3]||0,0])),g>=8&&(p=i(p,[0,s[m+2]||0]),p=n(p,h),p=o(p,33),p=n(p,d),u=i(u,p)),g>=4&&(f=i(f,[s[m+1]||0,0])),g>=1&&(f=i(f,[0,s[m]||0]),f=n(f,d),f=o(f,31),f=n(f,h),l=i(l,f)),l=i(l,[0,e.length]),u=i(u,[0,e.length]),l=t(l,u),u=t(u,l),l=r(l),u=r(u),l=t(l,u),u=t(u,l),(l[0]>>>0).toString(16).padStart(8,"0")+(l[1]>>>0).toString(16).padStart(8,"0")+((u[0]>>>0).toString(16).padStart(8,"0")+(u[1]>>>0).toString(16).padStart(8,"0"))}function s(e){let t=0;if(0===e.length)return t.toString(36);for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n),t&=t;return Math.abs(t).toString(36)}function c(e,t=!1){const n=d(e),o=JSON.stringify(n);t&&console.log("[RabbitTracker] hashFingerprint debug:",{originalKeys:Object.keys(e),canonicalizedKeys:Object.keys(n),canonicalLength:o.length,sample:o.substring(0,200)+"..."});const i=a(o);return t&&console.log("[RabbitTracker] Generated fingerprintHash:",i.substring(0,32)),i}function l(e){return"vis_"+e.substring(0,16)}function u(e){return["duration","timestamp","error","errors","collectionTime","startTime","endTime","_timestamp"].includes(e)||e.endsWith("_timestamp")||e.endsWith("Timestamp")}function d(e){if(null==e)return null;if(Array.isArray(e))return e.map(e=>d(e)).filter(e=>null!==e).sort((e,t)=>JSON.stringify(e).localeCompare(JSON.stringify(t)));if("object"==typeof e){const t=Object.keys(e).sort(),n={};for(const o of t){if(u(o))continue;const t=d(e[o]);null!==t&&(n[o]=t)}return n}return"number"==typeof e?Number.isFinite(e)?Math.abs(e)<1e-4?0:Math.abs(e)>1e6?e>0?1e6:-1e6:Number(e>=.1&&e<=10?e.toFixed(3):e.toFixed(2)):0:"string"==typeof e?e.trim().toLowerCase():"boolean"==typeof e?e:null}const h={SAMPLE_RATE:44100,DURATION:.1,FREQUENCIES:[440,1e3,1760,3520],COMPRESSOR_THRESHOLD:-50,COMPRESSOR_KNEE:40,COMPRESSOR_RATIO:12,COMPRESSOR_ATTACK:.003,COMPRESSOR_RELEASE:.25,FILTER_FREQUENCY:2e3,GAIN_VALUE:.5,DELAY_TIME:.02};function m(){try{const e=window.OfflineAudioContext||window.webkitOfflineAudioContext;if(!e)return null;const t=44100,n=h.DURATION;return new e(1,Math.floor(t*n),t)}catch{return null}}async function g(e){try{const t=h.FREQUENCIES.map((t,n)=>{const o=e.createOscillator(),i=["sine","square","sawtooth","triangle"],r=i[n%i.length];return o.type=r||"sine",o.frequency.setValueAtTime(t,e.currentTime),o}),n=e.createDynamicsCompressor(),o=e.createBiquadFilter(),i=e.createGain(),r=e.createDelay(),a=e.createAnalyser();n.threshold.setValueAtTime(h.COMPRESSOR_THRESHOLD,e.currentTime),n.knee.setValueAtTime(h.COMPRESSOR_KNEE,e.currentTime),n.ratio.setValueAtTime(h.COMPRESSOR_RATIO,e.currentTime),n.attack.setValueAtTime(h.COMPRESSOR_ATTACK,e.currentTime),n.release.setValueAtTime(h.COMPRESSOR_RELEASE,e.currentTime),o.type="bandpass",o.frequency.setValueAtTime(h.FILTER_FREQUENCY,e.currentTime),o.Q.setValueAtTime(.7,e.currentTime),i.gain.setValueAtTime(h.GAIN_VALUE,e.currentTime),r.delayTime.setValueAtTime(h.DELAY_TIME,e.currentTime);const c=e.createGain();c.gain.setValueAtTime(.25,e.currentTime),t.forEach(e=>{e.connect(c)}),c.connect(o),o.connect(n),n.connect(i),i.connect(r),r.connect(a),a.connect(e.destination),t.forEach((e,t)=>{e.start(.01*t),e.stop(h.DURATION)});const l=(await e.startRendering()).getChannelData(0),u=[];for(let e=0;e<32;e++){const t=Math.floor(l.length/32*e);u.push(l[t]||0)}const d=Math.sqrt(u.reduce((e,t)=>e+t*t,0)/u.length),m=Math.max(...u.map(Math.abs)),g=u.reduce((e,t)=>e+Math.abs(t),0)/u.length;let f=0;for(let e=0;e<Math.min(u.length,16);e++){const t=u[e];void 0!==t&&(f+=e*Math.abs(t))}return s([...u,d,m,g,f].join(","))}catch(e){return s("multi_oscillator_error")}}async function f(e){try{const t=[100,440,1e3,2e3,4e3,8e3,12e3,16e3],n=[];for(const o of t){const t=e.createOscillator(),i=e.createAnalyser();t.type="sine",t.frequency.setValueAtTime(o,e.currentTime),i.fftSize=256,i.smoothingTimeConstant=0,t.connect(i),i.connect(e.destination),t.start(),t.stop(.05);const r=m();if(r){const e=r.createOscillator();e.type="sine",e.frequency.setValueAtTime(o,r.currentTime),e.connect(r.destination),e.start(),e.stop(.05);try{const e=(await r.startRendering()).getChannelData(0),t=Math.sqrt(e.reduce((e,t)=>e+t*t,0)/e.length);n.push(t)}catch{n.push(0)}}}return s(n.join(","))}catch(e){return s("frequency_response_error")}}async function p(e){try{const t=e.createOscillator(),n=e.createDynamicsCompressor();t.type="triangle",t.frequency.setValueAtTime(h.FREQUENCIES[0],e.currentTime),n.threshold.setValueAtTime(h.COMPRESSOR_THRESHOLD,e.currentTime),n.knee.setValueAtTime(h.COMPRESSOR_KNEE,e.currentTime),n.ratio.setValueAtTime(h.COMPRESSOR_RATIO,e.currentTime),n.attack.setValueAtTime(h.COMPRESSOR_ATTACK,e.currentTime),n.release.setValueAtTime(h.COMPRESSOR_RELEASE,e.currentTime),t.connect(n),n.connect(e.destination),t.start(),t.stop(h.DURATION);const o=(await e.startRendering()).getChannelData(0);return s([o[0]||0,o[Math.floor(.25*o.length)]||0,o[Math.floor(.5*o.length)]||0,o[Math.floor(.75*o.length)]||0,o[o.length-1]||0].join(","))}catch(e){return s("compressor_error")}}async function w(){const e=performance.now();try{const t=function(){try{const e=window.OfflineAudioContext||window.webkitOfflineAudioContext;if(e)try{return new e(1,1,44100).sampleRate}catch{}const t=window.AudioContext||window.webkitAudioContext;if(t)try{const e=new t,n=e.sampleRate;return e.close().catch(()=>{}),n}catch{}}catch{}return 44100}(),n=function(){const e={};try{const t=m();if(t){e.sampleRate=t.sampleRate,e.length=t.length,e.state=t.state;const n=[],o=[8e3,22050,44100,48e3,96e3];for(const e of o)try{const t=new(window.OfflineAudioContext||window.webkitOfflineAudioContext)(1,1,e);t.sampleRate===e&&n.push(e),"close"in t&&"function"==typeof t.close&&t.close()}catch{}e.supportedSampleRates=n,"baseLatency"in t&&(e.baseLatency=t.baseLatency),"close"in t&&"function"==typeof t.close&&t.close()}}catch(t){e.error="context_characteristics_error"}return e}(),o={multiOsc:m(),compressor:m(),frequencyResponse:m()};if(!o.multiOsc||!o.compressor||!o.frequencyResponse)throw new Error("OfflineAudioContext not available");const[i,r,a]=await Promise.all([g(o.multiOsc).catch(()=>"multi_oscillator_error"),p(o.compressor).catch(()=>"compressor_error"),f(o.frequencyResponse).catch(()=>"frequency_response_error")]),c={};try{const e=m();if(e){const t=["createOscillator","createAnalyser","createBiquadFilter","createConvolver","createDelay","createDynamicsCompressor","createGain","createWaveShaper","createStereoPanner","createChannelSplitter","createChannelMerger"];for(const n of t)try{"function"==typeof e[n]&&(e[n](),c[n]=!0)}catch{c[n]=!1}"close"in e&&"function"==typeof e.close&&e.close()}}catch{}const l=s([i,r,a,t.toString(),JSON.stringify(n),JSON.stringify(c)].join("|")),u=performance.now();return{value:{oscillator:i,compressor:r,sampleRate:t,maxChannelCount:n.supportedSampleRates?.length||2,multiOscillatorFingerprint:i,frequencyResponseFingerprint:a,contextCharacteristics:n,nodeCapabilities:c,audioStackHash:l,supportedSampleRates:n.supportedSampleRates||[]},duration:u-e}}catch(t){return{value:{oscillator:"error",compressor:"error",sampleRate:0,maxChannelCount:0,multiOscillatorFingerprint:"error",frequencyResponseFingerprint:"error",contextCharacteristics:{},nodeCapabilities:{},audioStackHash:"error",supportedSampleRates:[]},duration:performance.now()-e,error:t instanceof Error?t.message:"Audio fingerprinting failed"}}}function y(){try{return"function"==typeof(window.OfflineAudioContext||window.webkitOfflineAudioContext)||"function"==typeof(window.AudioContext||window.webkitAudioContext)}catch{return!1}}function v(){try{return"WebKitAppearance"in document.documentElement.style||"webkitRequestFileSystem"in window||"webkitResolveLocalFileSystemURL"in window||Boolean(window.safari)}catch{return!1}}function b(){try{return"ontouchstart"in window&&("orientation"in window||"onorientationchange"in window)&&/android/i.test(navigator.userAgent)}catch{return!1}}function S(){try{if("brave"in navigator&&navigator.brave)return!0;const e=navigator.userAgent;return!!e.includes("Brave")||!(!window.chrome||!window.chrome.runtime||window.chrome.webstore||window.navigator.getBattery||!/Chrome/.test(e))}catch{return!1}}function k(){try{const e=navigator.userAgent;return!!(e.includes("Arc/")||window.arc||window.Arc||window.chrome&&window.chrome.runtime&&/Chrome/.test(e)&&(e.includes("ArcBrowser")||"arc:"===window.location.protocol))}catch{return!1}}function E(){try{if(window.opr||window.opera)return!0;const e=navigator.userAgent;return!(!e.includes("OPR/")&&!e.includes("Opera/"))}catch{return!1}}function _(){try{return!!navigator.userAgent.includes("Vivaldi/")||!!window.vivaldi}catch{return!1}}function A(){try{const e=navigator.userAgent;return e.includes("SamsungBrowser/")||e.includes("Samsung Internet")}catch{return!1}}function M(){try{return!(S()||k()||E()||_()||C()||A())&&Boolean(window.chrome&&(window.chrome.webstore||window.chrome.runtime)&&/Chrome/.test(navigator.userAgent)&&!/Edg|OPR|Opera|Vivaldi|SamsungBrowser|Arc|Brave/.test(navigator.userAgent))}catch{return!1}}function T(){try{return"InstallTrigger"in window||"mozInnerScreenX"in window||"mozPaintCount"in window||Boolean(navigator.mozApps)}catch{return!1}}function C(){try{return"msCredentials"in navigator||Boolean(window.StyleMedia)||M()&&/edg/i.test(navigator.userAgent)}catch{return!1}}function x(){try{return v()&&!M()&&!C()&&Boolean(window.safari)&&/safari/i.test(navigator.userAgent)}catch{return!1}}function R(){try{return window.isSecureContext||"https:"===location.protocol}catch{return!1}}function D(){try{return"webkitTemporaryStorage"in navigator||navigator.storage&&navigator.storage.estimate&&navigator.storage.estimate().then(e=>(e.quota||0)<104857600),!1}catch{return!1}}function I(){return S()||k()||E()||_()||A()||M()?"Blink":C()?"EdgeHTML/Blink":T()?"Gecko":v()||x()?"WebKit":"Unknown"}function P(){const e=function(){try{if(S())return"Brave";if(k())return"Arc";if(E())return"Opera";if(_())return"Vivaldi";if(A())return"Samsung Internet";if(C())return"Edge";if(T())return"Firefox";if(x())return"Safari";if(M())return"Chrome";const e=navigator.userAgent;return/Firefox/i.test(e)&&!M()?"Firefox":/Safari/i.test(e)&&!M()?"Safari":/Chrome/i.test(e)?"Chrome":"Unknown"}catch{return"Unknown"}}(),t=I(),n=["Brave","Arc","Opera","Vivaldi","Samsung Internet","Edge","Chrome"].includes(e);let o=e.toLowerCase();return n&&"Chrome"!==e&&(o=`${e.toLowerCase()}-chromium`),{name:e,engine:t,isChromiumBased:n,family:o}}function L(){try{return"undefined"!=typeof document&&"function"==typeof document.createElement&&void 0!==document.body}catch{return!1}}function O(){try{if(!L())return!1;const e=document.createElement("canvas"),t=e.getContext("webgl")||e.getContext("experimental-webgl");if(!t)return!1;const n=t,o=n.getParameter(n.RENDERER),i=Boolean(o&&"string"==typeof o),r=n.getExtension("WEBGL_lose_context");return r&&r.loseContext(),i}catch{return!1}}function N(){try{return!(!window.AudioContext&&!window.webkitAudioContext)}catch{return!1}}function F(){const e=L(),t=function(){try{return"undefined"!=typeof window&&"function"==typeof window.matchMedia}catch{return!1}}();return{engine:I(),supportsDOM:e,supportsMediaQueries:t,supportsWebGL:O(),supportsAudio:N(),isSecure:R(),isPrivateMode:D(),canRunDOMBlockers:(v()||b())&&e,canRunAccessibility:t,canRunBrowserAPIs:e&&"undefined"!=typeof navigator}}async function B(){const e=performance.now();try{const t=function(){try{const e=navigator.language||"";let t=[];navigator.languages?t=Array.from(navigator.languages):navigator.language&&(t=[navigator.language]);const n=[navigator.userLanguage,navigator.browserLanguage,navigator.systemLanguage].filter(Boolean);return t=[...new Set([...t,...n])],{language:e,languages:t}}catch{return{language:"",languages:[]}}}(),n=function(){try{let e="";if(Intl&&Intl.DateTimeFormat)try{e=Intl.DateTimeFormat().resolvedOptions().timeZone}catch{}if(!e){const t=new Date(2024,0,1).getTimezoneOffset(),n=t>0?"-":"+",o=Math.floor(Math.abs(t)/60),i=Math.abs(t)%60;e=`UTC${n}${o.toString().padStart(2,"0")}:${i.toString().padStart(2,"0")}`}return{timezone:e,timezoneOffset:new Date(2024,0,1).getTimezoneOffset()}}catch{return{timezone:"",timezoneOffset:0}}}(),o=function(){try{return{platform:navigator.platform||"",userAgent:navigator.userAgent||""}}catch{return{platform:"",userAgent:""}}}(),i=function(){try{const e=navigator.hardwareConcurrency||0;let t;"deviceMemory"in navigator&&(t=navigator.deviceMemory);const n={hardwareConcurrency:e};return void 0!==t&&(n.deviceMemory=t),n}catch{return{hardwareConcurrency:0}}}(),r=function(){try{const e=!1!==navigator.cookieEnabled;let t=null;return"doNotTrack"in navigator?t=navigator.doNotTrack:"msDoNotTrack"in navigator?t=navigator.msDoNotTrack:"mozDoNotTrack"in window&&(t=window.mozDoNotTrack),{cookieEnabled:e,doNotTrack:t}}catch{return{cookieEnabled:!0,doNotTrack:null}}}(),a=function(){try{if(!navigator.plugins)return{length:0,names:[]};const e=Array.from(navigator.plugins).map(e=>e.name).filter(e=>e).sort();return{length:navigator.plugins.length,names:e.slice(0,10)}}catch{return{length:0,names:[]}}}(),s=function(){try{let e=0,t=!1,n=!1;"maxTouchPoints"in navigator?e=navigator.maxTouchPoints:"msMaxTouchPoints"in navigator&&(e=navigator.msMaxTouchPoints);try{t="TouchEvent"in window}catch{t="ontouchstart"in window}return n="ontouchstart"in window,{maxTouchPoints:e,touchEvent:t,touchStart:n}}catch{return{maxTouchPoints:0,touchEvent:!1,touchStart:!1}}}(),c=function(){try{return P()}catch{return{name:"Unknown",engine:"Unknown",isChromiumBased:!1,family:"unknown"}}}(),l=performance.now(),u={language:t.language,languages:t.languages,timezone:n.timezone,timezoneOffset:n.timezoneOffset,platform:o.platform,userAgent:o.userAgent,browserInfo:c,hardwareConcurrency:i.hardwareConcurrency,cookieEnabled:r.cookieEnabled,doNotTrack:r.doNotTrack,plugins:a,touchSupport:s};return void 0!==i.deviceMemory&&(u.deviceMemory=i.deviceMemory),{value:u,duration:l-e}}catch(t){return{value:{language:"",languages:[],timezone:"",timezoneOffset:0,platform:"",userAgent:"",hardwareConcurrency:0,cookieEnabled:!0,doNotTrack:null,plugins:{length:0,names:[]},touchSupport:{maxTouchPoints:0,touchEvent:!1,touchStart:!1}},duration:performance.now()-e,error:t instanceof Error?t.message:"Browser fingerprinting failed"}}}function U(){try{return"object"==typeof navigator&&null!==navigator}catch{return!1}}const V=["Zap Canvas 🎨🔒2024","Żółć gęślą jaźń €$¢£¥","αβγδεζηθικλμνξο","中文测试字体渲染","🌟🎯🚀💎🌊🎨"];function H(e){e.imageSmoothingEnabled=!0,e.imageSmoothingQuality="high";const t=e.createRadialGradient(75,75,0,75,75,50);t.addColorStop(0,"rgba(255, 0, 0, 0.8)"),t.addColorStop(.3,"rgba(0, 255, 0, 0.6)"),t.addColorStop(.7,"rgba(0, 0, 255, 0.4)"),t.addColorStop(1,"rgba(255, 255, 0, 0.2)"),e.fillStyle=t,e.fillRect(10,10,130,100),e.fillStyle="rgba(102, 204, 0, 0.7)",e.fillRect(15.5,15.3,49.7,49.2),e.fillStyle="#f60",e.fillRect(70.3,10.7,50.1,50.9),e.beginPath(),e.moveTo(25.2,120.1),e.bezierCurveTo(25.2,120.1,75.8,90.3,125.5,120.7),e.bezierCurveTo(125.5,120.7,90.1,150.2,60.8,140.9),e.closePath(),e.fillStyle="rgba(200, 100, 50, 0.6)",e.fill(),e.globalCompositeOperation="multiply",e.beginPath(),e.arc(50.7,80.3,20.1,0,2*Math.PI),e.fillStyle="rgba(255, 0, 100, 0.5)",e.fill(),e.beginPath(),e.arc(70.3,80.7,20.9,0,2*Math.PI),e.fillStyle="rgba(0, 255, 100, 0.5)",e.fill(),e.globalCompositeOperation="source-over",e.strokeStyle="rgba(50, 50, 50, 0.8)",e.lineWidth=.5,e.setLineDash([2.3,1.7]);for(let t=0;t<10;t++)e.beginPath(),e.moveTo(10+13.7*t,160),e.lineTo(50+11.3*t,200),e.stroke();e.setLineDash([]);const n=document.createElement("canvas");n.width=20,n.height=20;const o=n.getContext("2d");if(o){o.fillStyle="rgba(150, 75, 200, 0.3)",o.fillRect(0,0,10,10),o.fillRect(10,10,10,10);const t=e.createPattern(n,"repeat");t&&(e.fillStyle=t,e.fillRect(150,120,80,60))}e.shadowColor="rgba(0, 0, 0, 0.5)",e.shadowBlur=3.2,e.shadowOffsetX=2.1,e.shadowOffsetY=2.7,e.fillStyle="rgba(100, 200, 150, 0.8)",e.fillRect(160,30,60,40),e.shadowColor="transparent",e.shadowBlur=0,e.shadowOffsetX=0,e.shadowOffsetY=0}function z(e){const t=["14px Arial, sans-serif",'13px "Times New Roman", serif',"12px Georgia, serif","15px Helvetica, Arial, sans-serif",'11px "Courier New", monospace',"13px Verdana, sans-serif","16px Impact, fantasy",'12px "Comic Sans MS", cursive'],n=["#000","#333","#666","#999","rgba(255, 0, 0, 0.8)","rgba(0, 255, 0, 0.7)","rgba(0, 0, 255, 0.6)","rgba(128, 64, 192, 0.9)"],o=["top","hanging","middle","alphabetic","bottom"],i=["left","center","right"];let r=250;V.forEach((a,s)=>{t.forEach((t,c)=>{const l=(s+c)%n.length,u=c%o.length,d=c%i.length;e.font=t,e.fillStyle=n[l]||n[0],e.textBaseline=o[u]||"top",e.textAlign=i[d]||"left";const h=10+.7*c%200,m=r+18.3*c%100;e.fillText(a,h,m),c%2==0&&(e.strokeStyle=`rgba(${100+20*c}, ${50+15*c}, ${150+10*c}, 0.5)`,e.lineWidth=.3,e.strokeText(a,h+.5,m+.5))}),r+=120}),e.save(),e.translate(100,400),e.rotate(Math.PI/6),e.scale(1.2,.8),e.font="italic 14px Arial",e.fillStyle="rgba(200, 100, 50, 0.8)",e.fillText("Transformed & Rotated Text",0,0),e.restore(),e.font="6px Arial",e.fillStyle="#000",e.fillText("Tiny text rendering test",10,500),e.font="32px Arial",e.fillStyle="rgba(255, 0, 0, 0.5)",e.fillText("Large",10,540),e.textAlign="left",e.textBaseline="top"}async function W(){const e=performance.now();try{const t=document.createElement("canvas");t.width=300,t.height=600;const n=t.getContext("2d",{alpha:!0,desynchronized:!1,colorSpace:"srgb",willReadFrequently:!0});if(!n)throw new Error("Canvas 2D context not available");n.rect(0,0,10,10),n.rect(2,2,6,6);const o=n.isPointInPath(5,5,"evenodd");z(n);const i=s(t.toDataURL("image/png"));n.clearRect(0,0,t.width,t.height),H(n);const r=s(t.toDataURL("image/png")),a=function(e,t){try{e.clearRect(0,0,t.width,t.height),e.fillStyle="rgb(100, 150, 200)",e.fillRect(10.3,10.7,20.1,20.9),e.strokeStyle="rgb(200, 100, 50)",e.lineWidth=1.3,e.beginPath(),e.moveTo(15.2,35.8),e.lineTo(25.7,45.1),e.stroke();const n=e.getImageData(10,10,30,40).data;let o=0,i=0,r=0,a=0,s=0;for(let e=0;e<n.length;e+=4){const t=n[e]||0,c=n[e+1]||0,l=n[e+2]||0;if((n[e+3]||0)>25&&(o+=t,i+=c,r+=l,s++,e>=16)){const o=n[e-16]||0,i=Math.abs(t-o);i>=8&&(a+=i)}}if(0===s)return"no-valid-pixels";return`${10*Math.round(o/s/10)}-${10*Math.round(i/s/10)}-${10*Math.round(r/s/10)}-${10*Math.round(a/s/10)}`}catch(e){return"subpixel-error"}}(n,t),c=function(e,t,n,o){const i=[];let r=0;try{const a=o.getImageData(0,0,1,1);a&&0!==a.data.length||(i.push("getImageData-blocked"),r+=3),(e.length<8||t.length<8)&&(i.push("short-hash"),r+=2);const s=["error","blocked","disabled","00000000","ffffffff","12345678"];(s.includes(e)||s.includes(t))&&(i.push("known-blocked-hash"),r+=3),("subpixel-error"===n||n.includes("0-0-0"))&&(i.push("subpixel-anomaly"),r+=2),e===t&&"error"!==e&&(i.push("identical-hashes"),r+=2);const c=document.createElement("canvas");c.width=10,c.height=10;const l=c.getContext("2d");if(l){const e=performance.now();l.fillStyle="red",l.fillRect(0,0,10,10),c.toDataURL(),performance.now()-e>50&&(i.push("slow-canvas"),r+=1)}return{isInconsistent:r>=2,confidence:Math.min(r/5,1),reasons:i}}catch(e){return{isInconsistent:!0,confidence:1,reasons:["detection-error"]}}}(i,r,a,n);n.clearRect(0,0,t.width,t.height),z(n),n.globalCompositeOperation="multiply",H(n),n.globalCompositeOperation="source-over";const l=s(t.toDataURL("image/png")),u=performance.now();return{value:{text:i,geometry:r,winding:o,isInconsistent:c.isInconsistent,subPixelAnalysis:a,compositeHash:l,inconsistencyConfidence:c.confidence,blockingReasons:c.reasons},duration:u-e}}catch(t){return{value:{text:"error",geometry:"error",winding:!1,isInconsistent:!0,subPixelAnalysis:"error",compositeHash:"error",inconsistencyConfidence:1,blockingReasons:["canvas-error"]},duration:performance.now()-e,error:t instanceof Error?t.message:"Canvas fingerprinting failed"}}}function j(){try{const e=document.createElement("canvas").getContext("2d");return null!==e&&"function"==typeof e.fillText}catch{return!1}}const q=["Arial","Arial Black","Calibri","Cambria","Comic Sans MS","Consolas","Courier New","Georgia","Impact","Lucida Console","Lucida Sans Unicode","Microsoft Sans Serif","Palatino Linotype","Segoe UI","Tahoma","Times New Roman","Trebuchet MS","Verdana","American Typewriter","Avenir","Baskerville","Big Caslon","Brush Script MT","Copperplate","Didot","Futura","Gill Sans","Helvetica","Helvetica Neue","Hoefler Text","Lucida Grande","Marker Felt","Optima","Papyrus","Phosphate","Rockwell","Savoye LET","SignPainter","Skia","Snell Roundhand","System Font","Zapfino","DejaVu Sans","DejaVu Sans Mono","DejaVu Serif","Droid Sans","Droid Sans Mono","Droid Serif","Liberation Sans","Liberation Sans Narrow","Liberation Serif","Ubuntu","Ubuntu Mono","Roboto","Roboto Condensed","Roboto Mono","Roboto Slab","Droid Sans","Droid Sans Mono","Droid Serif","Helvetica Neue","Arial","Helvetica","Courier New","Times New Roman","San Francisco","Avenir Next","Open Sans","Lato","Montserrat","Source Sans Pro","Raleway","PT Sans","Lora","Playfair Display","Oswald","Slabo 27px","Fira Sans","Hiragino Sans","Hiragino Kaku Gothic ProN","Meiryo","MS Gothic","MS Mincho","SimSun","SimHei","Microsoft YaHei","Malgun Gothic","Apple SD Gothic Neo"],Z=["monospace","sans-serif","serif"],G="mmMwWLliI0O&1 ※";function $(e,t){const n=document.createElement("canvas").getContext("2d");if(!n)return{width:0,height:0};n.font=`12px ${t}`;const o=n.measureText(e);return{width:o.width,height:o.actualBoundingBoxAscent+o.actualBoundingBoxDescent}}function X(e,t){const n=document.createElement("span");n.style.position="absolute",n.style.left="-9999px",n.style.top="-9999px",n.style.fontSize="12px",n.style.fontFamily=t,n.style.whiteSpace="nowrap",n.textContent=e,document.body.appendChild(n);const o=n.getBoundingClientRect(),i={width:o.width,height:o.height};return document.body.removeChild(n),i}function K(e,t="canvas"){const n="canvas"===t?$:X,o=Z.map(e=>n(G,e)),i=Z.map(t=>n(G,`${e}, ${t}`));for(let e=0;e<o.length;e++){const t=o[e],n=i[e];if(t&&n){const e=Math.abs(t.width-n.width),o=Math.abs(t.height-n.height);if(e>.1||o>.1)return!0}}return!1}function J(){try{const e=document.createElement("span");return e&&"object"==typeof e.style}catch{return!1}}function Y(e){return 10*Math.round(e/10)}async function Q(){const e=performance.now();try{const t=function(){try{return{width:screen.width||0,height:screen.height||0}}catch{return{width:0,height:0}}}(),n=screen.colorDepth||screen.pixelDepth||0,o=function(){try{return window.devicePixelRatio||1}catch{return 1}}(),i=function(){try{const e=screen.availWidth||0,t=screen.availHeight||0;return 0===e&&0===t?{width:Y(screen.width||0),height:Y(screen.height||0)}:{width:Y(e),height:Y(t)}}catch{return{width:Y(screen.width||0),height:Y(screen.height||0)}}}(),r=function(){try{const e=document.documentElement,t=Math.max(e.clientWidth||0,window.innerWidth||0),n=Math.max(e.clientHeight||0,window.innerHeight||0);return{width:Y(t),height:Y(n)}}catch{const e=window.innerWidth||0,t=window.innerHeight||0;return{width:Y(e),height:Y(t)}}}(),a=function(){try{if(screen.orientation)return{angle:screen.orientation.angle,type:screen.orientation.type};const e=screen.mozOrientation||screen.msOrientation||screen.webkitOrientation;if(void 0!==e)return{angle:e,type:"unknown"};const t=screen.width>screen.height;return{angle:t?90:0,type:t?"landscape-primary":"portrait-primary"}}catch{return}}(),s=performance.now(),c={width:t.width,height:t.height,colorDepth:n,pixelRatio:o,availableWidth:i.width,availableHeight:i.height,viewportWidth:r.width,viewportHeight:r.height};return a&&(c.orientation=a),{value:c,duration:s-e}}catch(t){return{value:{width:0,height:0,colorDepth:0,pixelRatio:1,viewportWidth:0,viewportHeight:0,availableWidth:0,availableHeight:0},duration:performance.now()-e,error:t instanceof Error?t.message:"Screen fingerprinting failed"}}}function ee(){try{return"object"==typeof screen&&"number"==typeof screen.width&&"number"==typeof screen.height}catch{return!1}}let te=null,ne=0,oe=0;function ie(){try{const e=performance.now();if(te&&te.isValid)if(e-te.timestamp<18e5){if(te.context&&!te.context.isContextLost())return te.usageCount++,te.lastUsed=e,te.context;re()}else re();if(ne>=8)return console.warn("[WebGL Cache] Maximum context limit reached, reusing existing contexts"),null;const t=function(){try{if("undefined"==typeof document)return null;const e=document.createElement("canvas");return e.width=1,e.height=1,e}catch{return null}}();if(!t)return null;const n=function(e){try{const t={alpha:!1,antialias:!1,depth:!1,stencil:!1,preserveDrawingBuffer:!1,failIfMajorPerformanceCaveat:!0,powerPreference:"default"};return e.getContext("webgl",t)||e.getContext("experimental-webgl",t)}catch{return null}}(t);return n?(ne++,oe++,te={context:n,canvas:t,timestamp:e,isValid:!0,usageCount:1,lastUsed:e},n):null}catch(e){return re(),null}}function re(){if(te){try{if(te.context){const e=te.context.getExtension("WEBGL_lose_context");e&&e.loseContext()}te.canvas&&(te.canvas.width=0,te.canvas.height=0),ne>0&&ne--}catch{ne>0&&ne--}te.isValid=!1,te=null}}function ae(){if(!te||!te.context)return!1;try{return!te.context.isContextLost()}catch{return!1}}function se(){const e=ie();if(!e)return[];try{const t=e.getSupportedExtensions();return t?Array.from(t).sort():[]}catch{return[]}}function ce(){const e=ie();if(!e)return{};try{const t={},n=["VERSION","VENDOR","RENDERER","SHADING_LANGUAGE_VERSION","MAX_TEXTURE_SIZE","MAX_RENDERBUFFER_SIZE","MAX_VIEWPORT_DIMS","MAX_VERTEX_ATTRIBS","MAX_VERTEX_UNIFORM_VECTORS","MAX_FRAGMENT_UNIFORM_VECTORS","MAX_VARYING_VECTORS"];for(const o of n)try{const n=e[o];void 0!==n&&(t[o]=e.getParameter(n))}catch{}return t}catch{return{}}}function le(){try{re(),ne=0,oe=0}catch(e){console.warn("[WebGL Cache] Cleanup error:",e)}}if("undefined"!=typeof window&&(window.addEventListener("beforeunload",le),window.addEventListener("pagehide",le),window.addEventListener("unload",le),document.addEventListener("visibilitychange",()=>{}),"memory"in performance&&"function"==typeof performance.memory.addEventListener))try{performance.memory.addEventListener("memorypressure",le)}catch(e){}var ue=Object.freeze({__proto__:null,cleanupWebGLCache:le,forceCleanupWebGL:function(){re(),ne=0},getCachedWebGLContext:ie,getCachedWebGLExtensions:se,getCachedWebGLParameters:ce,invalidateWebGLCache:re,isWebGLContextValid:ae});const de={VENDOR:7936,RENDERER:7937,VERSION:7938,SHADING_LANGUAGE_VERSION:35724,MAX_VERTEX_ATTRIBS:34921,MAX_TEXTURE_SIZE:3379,MAX_RENDERBUFFER_SIZE:34024,MAX_VIEWPORT_DIMS:3386,ALIASED_LINE_WIDTH_RANGE:33902,ALIASED_POINT_SIZE_RANGE:33901,MAX_FRAGMENT_UNIFORM_VECTORS:36349,MAX_VERTEX_UNIFORM_VECTORS:36347,MAX_VARYING_VECTORS:36348,MAX_VERTEX_TEXTURE_IMAGE_UNITS:35660,MAX_TEXTURE_IMAGE_UNITS:34930,MAX_COMBINED_TEXTURE_IMAGE_UNITS:35661};function he(e,t,n){const o=e.createShader(t);return o?(e.shaderSource(o,n),e.compileShader(o),e.getShaderParameter(o,e.COMPILE_STATUS)?o:(e.deleteShader(o),null)):null}function me(e){try{const t=e.getParameter(e.VENDOR)||"unknown",n=e.getParameter(e.RENDERER)||"unknown",o=e.getParameter(e.VERSION)||"unknown",i=`${t}|${n}|${o}|${e.getParameter(e.MAX_TEXTURE_SIZE)||0}|${e.getParameter(e.MAX_VERTEX_ATTRIBS)||0}|${e.getParameter(e.MAX_VIEWPORT_DIMS)||[0,0]}`;let r=0;for(let e=0;e<i.length;e++)r=(r<<5)-r+i.charCodeAt(e)&4294967295;return`fallback_${Math.abs(r).toString(16)}`}catch{return"webgl_unavailable"}}async function ge(){const e=performance.now();try{if(!pe())throw new Error("WebGL not supported in this browser");const t=ie();if(!t)throw new Error("WebGL context not available");if(!ae())throw new Error("WebGL context lost");const n=function(){try{return ce()}catch{return{}}}(),o=n.VENDOR||"unknown",i=n.RENDERER||"unknown",r=n.VERSION||"unknown";let a=o,s=i;for(let e=0;e<3;e++)try{const e=t.getExtension("WEBGL_debug_renderer_info");if(e){const n=t.getParameter(e.UNMASKED_VENDOR_WEBGL),o=t.getParameter(e.UNMASKED_RENDERER_WEBGL);n&&"unknown"!==n&&(a=n),o&&"unknown"!==o&&(s=o);break}}catch(t){if(2===e)break;await new Promise(e=>setTimeout(e,10))}const c=function(){try{return se()}catch{return[]}}(),l=function(e){const t={};return Object.entries(de).forEach(([n,o])=>{const i=function(e,t){try{return e.getParameter(t)}catch{return null}}(e,o);null!==i&&(t[n]=Array.isArray(i)?i.join(","):i)}),["UNMASKED_VENDOR_WEBGL","UNMASKED_RENDERER_WEBGL"].forEach(n=>{try{const o=e.getExtension("WEBGL_debug_renderer_info");if(o){const i=o[n];if(void 0!==i){const o=e.getParameter(i);o&&(t[n]=o)}}}catch{}}),t}(t),u=function(e){const t=[],n=[];try{const o=[e.LOW_FLOAT,e.MEDIUM_FLOAT,e.HIGH_FLOAT,e.LOW_INT,e.MEDIUM_INT,e.HIGH_INT],i=["LOW_FLOAT","MEDIUM_FLOAT","HIGH_FLOAT","LOW_INT","MEDIUM_INT","HIGH_INT"];for(let r=0;r<o.length;r++){const a=o[r];if(void 0===a)continue;const s=e.getShaderPrecisionFormat(e.VERTEX_SHADER,a),c=e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,a);s&&t.push(`${i[r]}:${s.precision},${s.rangeMin},${s.rangeMax}`),c&&n.push(`${i[r]}:${c.precision},${c.rangeMin},${c.rangeMax}`)}}catch{}return{vertex:t.join(";"),fragment:n.join(";")}}(t),d=function(e){try{const t="\n attribute vec2 a_position;\n attribute vec3 a_color;\n varying vec3 v_color;\n uniform float u_time;\n \n void main() {\n // Complex mathematical operations to differentiate GPUs\n float wave = sin(a_position.x * 10.0 + u_time) * 0.1;\n vec2 position = a_position + vec2(wave, cos(a_position.y * 8.0) * 0.1);\n \n // GPU-specific floating point calculations\n float precision = sin(position.x * 123.456) + cos(position.y * 789.012);\n position += vec2(precision * 0.001);\n \n gl_Position = vec4(position, 0.0, 1.0);\n v_color = a_color;\n }\n ",n="\n precision mediump float;\n varying vec3 v_color;\n uniform float u_time;\n \n void main() {\n // Complex color calculations that vary between GPU vendors\n vec3 color = v_color;\n color.r += sin(gl_FragCoord.x * 0.1 + u_time) * 0.1;\n color.g += cos(gl_FragCoord.y * 0.1 + u_time) * 0.1;\n color.b += sin((gl_FragCoord.x + gl_FragCoord.y) * 0.05) * 0.1;\n \n // GPU-specific precision in color calculations\n color = normalize(color) * length(v_color);\n \n gl_FragColor = vec4(color, 1.0);\n }\n ",o=he(e,e.VERTEX_SHADER,t),i=he(e,e.FRAGMENT_SHADER,n);if(!o||!i)return me(e);const r=function(e,t,n){const o=e.createProgram();return o?(e.attachShader(o,t),e.attachShader(o,n),e.linkProgram(o),e.getProgramParameter(o,e.LINK_STATUS)?o:(e.deleteProgram(o),null)):null}(e,o,i);if(!r)return me(e);e.useProgram(r);const a=new Float32Array([-.8,-.6,1,.2,.3,0,.8,.3,1,.2,.8,-.6,.2,.3,1,-.5,-.2,.8,.9,.1,.3,.6,.1,.8,.9,.7,-.3,.9,.1,.8]),s=e.createBuffer();e.bindBuffer(e.ARRAY_BUFFER,s),e.bufferData(e.ARRAY_BUFFER,a,e.STATIC_DRAW);const c=e.getAttribLocation(r,"a_position"),l=e.getAttribLocation(r,"a_color"),u=e.getUniformLocation(r,"u_time");e.enableVertexAttribArray(c),e.enableVertexAttribArray(l),e.vertexAttribPointer(c,2,e.FLOAT,!1,20,0),e.vertexAttribPointer(l,3,e.FLOAT,!1,20,8),e.uniform1f(u,1.23456789),e.enable(e.BLEND),e.blendFunc(e.SRC_ALPHA,e.ONE_MINUS_SRC_ALPHA),e.clearColor(.1,.2,.3,1),e.clear(e.COLOR_BUFFER_BIT),e.drawArrays(e.TRIANGLES,0,6);const d=new Uint8Array(e.canvas.width*e.canvas.height*4);e.readPixels(0,0,e.canvas.width,e.canvas.height,e.RGBA,e.UNSIGNED_BYTE,d);let h=0;for(let e=0;e<d.length;e+=4){const t=1*(d[e]??0);h=33*h+(t+256*(d[e+1]??0)+65536*(d[e+2]??0)+16777216*(d[e+3]??0))>>>0}return e.deleteProgram(r),e.deleteShader(o),e.deleteShader(i),e.deleteBuffer(s),h.toString(16)}catch(t){return me(e)}}(t),h=function(e){const t={};try{const n=e.getExtension("WEBGL_debug_renderer_info");n&&(t.unmaskedVendor=e.getParameter(n.UNMASKED_VENDOR_WEBGL),t.unmaskedRenderer=e.getParameter(n.UNMASKED_RENDERER_WEBGL)),t.maxTextureSize=e.getParameter(e.MAX_TEXTURE_SIZE),t.maxCombinedTextureImageUnits=e.getParameter(e.MAX_COMBINED_TEXTURE_IMAGE_UNITS),t.maxViewportDims=e.getParameter(e.MAX_VIEWPORT_DIMS),t.maxRenderbufferSize=e.getParameter(e.MAX_RENDERBUFFER_SIZE),t.maxVertexAttribs=e.getParameter(e.MAX_VERTEX_ATTRIBS),t.maxVertexUniformVectors=e.getParameter(e.MAX_VERTEX_UNIFORM_VECTORS),t.maxFragmentUniformVectors=e.getParameter(e.MAX_FRAGMENT_UNIFORM_VECTORS),t.maxVaryingVectors=e.getParameter(e.MAX_VARYING_VECTORS),t.antialias=e.getContextAttributes()?.antialias||!1;const o=e.getExtension("OES_texture_float");t.floatTextures=!!o;const i=e.getExtension("OES_texture_half_float");t.halfFloatTextures=!!i;const r=e.getParameter(e.COMPRESSED_TEXTURE_FORMATS);t.compressedTextureFormats=Array.isArray(r)?r.length:0;const a=e instanceof WebGL2RenderingContext;if(t.webgl2=a,a){const n=e;t.maxColorAttachments=n.getParameter(n.MAX_COLOR_ATTACHMENTS),t.maxDrawBuffers=n.getParameter(n.MAX_DRAW_BUFFERS),t.maxTexture3DSize=n.getParameter(n.MAX_3D_TEXTURE_SIZE)}const s=e.getParameter(e.ALIASED_LINE_WIDTH_RANGE);t.lineWidthRange=Array.isArray(s)?s.join(","):"";const c=e.getParameter(e.ALIASED_POINT_SIZE_RANGE);t.pointSizeRange=Array.isArray(c)?c.join(","):""}catch(e){}return t}(t),m=(()=>{const e=`${a||o||""}|${s||i||""}`.toLowerCase();let t=0;for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n)&4294967295;return Math.abs(t).toString(16)})(),g=performance.now();return{value:{vendor:a,renderer:s,version:r,extensions:c,parameters:l,shaderPrecision:u,renderHash:d,capabilities:h,vendorRendererHash:m,contextAttributes:t.getContextAttributes()||{}},duration:g-e}}catch(t){return{value:{vendor:"unknown",renderer:"unknown",version:"unknown",extensions:[],parameters:{},shaderPrecision:{vertex:"",fragment:""},renderHash:"",capabilities:{},vendorRendererHash:"",contextAttributes:{}},duration:performance.now()-e,error:t instanceof Error?t.message:"WebGL fingerprinting failed"}}}let fe=null;function pe(){if(null!==fe)return fe;try{const e=document.createElement("canvas");e.width=1,e.height=1;const t=e.getContext("webgl",{failIfMajorPerformanceCaveat:!0,antialias:!1,alpha:!1,depth:!1,stencil:!1,preserveDrawingBuffer:!1})||e.getContext("experimental-webgl",{failIfMajorPerformanceCaveat:!0,antialias:!1,alpha:!1,depth:!1,stencil:!1,preserveDrawingBuffer:!1}),n=null!==t;if(t&&"getExtension"in t)try{const e=t.getExtension("WEBGL_lose_context");e&&e.loseContext()}catch(e){}return e.width=0,e.height=0,fe=n,n}catch{return fe=!1,!1}}function we(){try{for(const e of["rec2020","p3","srgb"]){const t=xe(`(color-gamut: ${e})`);if(t?.matches)return e}return"unknown"}catch{return"unknown"}}function ye(){try{const e=xe("(forced-colors: active)");if(e?.matches)return!0;const t=xe("(forced-colors: none)");return!t?.matches&&null}catch{return null}}function ve(){try{const e=["no-preference","high","more","low","less","forced"];for(const t of e){const e=xe(`(prefers-contrast: ${t})`);if(e?.matches)return"high"===t?"more":"low"===t?"less":t}return"unknown"}catch{return"unknown"}}function be(){try{const e=xe("(prefers-reduced-motion: reduce)");if(e?.matches)return!0;const t=xe("(prefers-reduced-motion: no-preference)");return!t?.matches&&null}catch{return null}}function Se(){try{return!!matchMedia("(prefers-reduced-transparency: reduce)").matches||!matchMedia("(prefers-reduced-transparency: no-preference)").matches&&null}catch{return null}}function ke(){try{for(let e=8;e>=0;e--)if(matchMedia(`(monochrome: ${e})`).matches)return e;return 0}catch{return 0}}function Ee(){try{return!!matchMedia("(inverted-colors: inverted)").matches||!matchMedia("(inverted-colors: none)").matches&&null}catch{return null}}function _e(){try{return!!matchMedia("(dynamic-range: high)").matches||!matchMedia("(dynamic-range: standard)").matches&&null}catch{return null}}function Ae(){try{const e=[48,36,30,24,16,15,8];for(const t of e)if(matchMedia(`(color: ${t})`).matches)return t;return screen.colorDepth||24}catch{return screen.colorDepth||24}}function Me(){try{return matchMedia("(hover: hover)").matches?"hover":matchMedia("(hover: none)").matches?"none":"unknown"}catch{return"unknown"}}function Te(){try{return matchMedia("(pointer: fine)").matches?"fine":matchMedia("(pointer: coarse)").matches?"coarse":matchMedia("(pointer: none)").matches?"none":"unknown"}catch{return"unknown"}}function Ce(){return F().canRunAccessibility}function xe(e){try{return Ce()?matchMedia(e):null}catch(e){return null}}function Re(){try{return!!matchMedia("(prefers-reduced-data: reduce)").matches||!matchMedia("(prefers-reduced-data: no-preference)").matches&&null}catch{return null}}function De(){try{const e=["fullscreen","standalone","minimal-ui","browser"];for(const t of e)if(matchMedia(`(display-mode: ${t})`).matches)return t;return"unknown"}catch{return"unknown"}}function Ie(){try{const e=["opaque","additive","subtractive"];for(const t of e)if(matchMedia(`(environment-blending: ${t})`).matches)return t;return"unknown"}catch{return"unknown"}}function Pe(){try{return!!matchMedia("(any-hover: hover)").matches||!matchMedia("(any-hover: none)").matches&&null}catch{return null}}function Le(){try{return matchMedia("(any-pointer: fine)").matches?"fine":matchMedia("(any-pointer: coarse)").matches?"coarse":matchMedia("(any-pointer: none)").matches?"none":"unknown"}catch{return"unknown"}}function Oe(){try{return matchMedia("(prefers-color-scheme: dark)").matches?"dark":matchMedia("(prefers-color-scheme: light)").matches?"light":matchMedia("(prefers-color-scheme: no-preference)").matches?"no-preference":"unknown"}catch{return"unknown"}}function Ne(){const e=we(),t=ye(),n=ve(),o=be(),i=Se(),r=ke(),a=Ee(),s=_e(),c=Ae(),l=Me(),u=Te(),d=Re(),h=De(),m=Ie(),g=Pe(),f=Le(),p=Oe(),w=Boolean(t||o||i||a||d||"no-preference"!==n||"no-preference"!==p||r>0),y=[e,s?"hdr":"sdr",`${c}bit`,r>0?`mono${r}`:"color",p,h,m].join("-"),v=[l,u,g?"anyhover":"nohover",f].join("-");return{colorGamut:e,forcedColors:t,contrastPreference:n,reducedMotion:o,reducedTransparency:i,monochromeDepth:r,invertedColors:a,hdrSupport:s,enhancedColorDepth:c,hoverCapability:l,pointerCapability:u,reducedData:d,displayMode:h,environmentBlending:m,anyHover:g,anyPointer:f,colorScheme:p,hasAccessibilityFeatures:w,displayCapabilities:y,interactionCapabilities:v}}function Fe(e){const t=["unknown"!==e.colorGamut,null!==e.forcedColors,"unknown"!==e.contrastPreference,null!==e.reducedMotion,null!==e.reducedTransparency,null!==e.invertedColors,null!==e.hdrSupport,null!==e.reducedData,"unknown"!==e.displayMode,"unknown"!==e.environmentBlending,null!==e.anyHover,"unknown"!==e.colorScheme],n=t.filter(Boolean).length/t.length,o=[null!==e.reducedData,"unknown"!==e.displayMode,"unknown"!==e.environmentBlending,"unknown"!==e.colorScheme,null!==e.hdrSupport],i=o.filter(Boolean).length/o.length,r=[!0===e.forcedColors,!0===e.reducedMotion,!0===e.reducedTransparency,!0===e.invertedColors,!0===e.reducedData,"no-preference"!==e.contrastPreference,"dark"===e.colorScheme,e.monochromeDepth>0],a=r.filter(Boolean).length/r.length,s=["srgb"!==e.colorGamut,!0===e.forcedColors,!0===e.reducedMotion,!0===e.reducedTransparency,!0===e.invertedColors,!0===e.reducedData,e.monochromeDepth>0,!0===e.hdrSupport,"browser"!==e.displayMode,"opaque"!==e.environmentBlending,"dark"===e.colorScheme],c=s.filter(Boolean).length/s.length;return{confidence:Math.round(100*n)/100,uniqueness:Math.round(100*c)/100,accessibilityScore:Math.round(100*a)/100,modernBrowserScore:Math.round(100*i)/100}}var Be=Object.freeze({__proto__:null,analyzeAccessibilityFingerprint:Fe,getAccessibilityFingerprint:Ne,getAnyHover:Pe,getAnyPointer:Le,getColorGamut:we,getColorScheme:Oe,getContrastPreference:ve,getDisplayMode:De,getEnhancedColorDepth:Ae,getEnvironmentBlending:Ie,getForcedColors:ye,getHDRSupport:_e,getHoverCapability:Me,getInvertedColors:Ee,getMonochromeDepth:ke,getPointerCapability:Te,getReducedData:Re,getReducedMotion:be,getReducedTransparency:Se,isAccessibilityDetectionAvailable:Ce});function Ue(e){if("number"==typeof e)return{confidence:0,uniqueness:0,intlApiSupport:0,localeComplexity:0};const t=Object.values(e.intlSupport).filter(Boolean).length/Object.keys(e.intlSupport).length,n=[e.locale,e.calendar,e.numberingSystem,e.timeZone,e.dateStyle,e.timeStyle,e.hourCycle,e.numberLocale,e.currencyDisplay,e.currencySign,e.notation,e.signDisplay,e.listStyle,e.relativeTimeStyle,e.pluralRules],o=n.filter(e=>"unknown"!==e&&""!==e).length/n.length,i=[e.locale.length>2?1:0,"gregory"!==e.calendar?1:0,"latn"!==e.numberingSystem?1:0,e.hour12?1:0,e.localeMatch?0:1].reduce((e,t)=>e+t,0)/5,r=(o+t+i)/3;return{confidence:Math.round(100*o)/100,uniqueness:Math.round(100*r)/100,intlApiSupport:Math.round(100*t)/100,localeComplexity:Math.round(100*i)/100}}const Ve="mmMwWLliI0fiflO&1",He={default:{text:Ve},serif:{style:{fontFamily:"serif"},text:Ve},sans:{style:{fontFamily:"sans-serif"},text:Ve},mono:{style:{fontFamily:"monospace"},text:Ve},apple:{style:{font:"-apple-system-body"},text:Ve},system:{style:{fontFamily:"system-ui"},text:Ve},min:{style:{fontSize:"1px"},text:Ve},large:{style:{fontSize:"72px"},text:Ve},ui:{style:{fontFamily:"ui-serif"},text:Ve},emoji:{style:{fontFamily:"Apple Color Emoji, Segoe UI Emoji, Noto Color Emoji"},text:"🎯🔥💯"},math:{style:{fontFamily:"STIX Two Math, Cambria Math"},text:"∑∆∇∂"},cjk:{style:{fontFamily:"Hiragino Sans, Microsoft YaHei, SimSun"},text:"中文测试"},arabic:{style:{fontFamily:"Tahoma, Arial Unicode MS"},text:"اختبار"},hebrew:{style:{fontFamily:"Tahoma, Arial Unicode MS"},text:"בדיקה"},subpixel:{style:{fontFamily:"Arial",fontSize:"11px",textRendering:"optimizeLegibility"},text:Ve},kerning:{style:{fontFamily:"Times",fontSize:"24px",fontKerning:"normal"},text:"AV To"},ligatures:{style:{fontFamily:"Times",fontSize:"24px",fontVariantLigatures:"common-ligatures"},text:"ffi ffl fi fl"}};function ze(e,t,n){try{const o="mmmmmmmmmmlli",i=We(e,t,{style:{fontFamily:n},text:o}),r=We(e,t,{style:{fontFamily:"monospace"},text:o});if(Math.abs(i-r)<1)return"monospace-fallback";const a=We(e,t,{style:{fontFamily:"sans-serif"},text:o});return Math.abs(i-a)<1?"sans-serif-fallback":"native-font"}catch(e){return"fallback-error"}}function We(e,t,n){const o=e.createElement("span"),{style:i={},text:r=Ve}=n;o.textContent=r,o.style.cssText="position: absolute; left: 0; top: 0; white-space: nowrap; visibility: hidden;",Object.entries(i).forEach(([e,t])=>{void 0!==t&&(o.style[e]=t)}),t.appendChild(o);const a=o.getBoundingClientRect().width;return t.removeChild(o),Math.round(100*a)/100}function je(e){const t=[e.default,e.serif,e.sans,e.mono,e.apple,e.system,e.min,e.large,e.ui,e.emoji,e.math,e.cjk,e.arabic,e.hebrew,e.subpixel,e.kerning,e.ligatures],n=t.some(e=>e>0),o=t.filter(e=>e>0).length,i=t.length;let r=n?o/i:0;(e.antiAliasing.enabled||e.systemFontHints.clearType)&&(r+=.2),Object.keys(e.fallbackBehavior).length>0&&(r+=.1),r=Math.min(r,1);const a=e.apple>0||e.system>0,s=[e.subpixel,e.kerning,e.ligatures,e.emoji,e.math].some(e=>e>0)||e.antiAliasing.enabled||e.systemFontHints.clearType,c=t.reduce((e,t)=>e+t,0)/t.length,l=t.reduce((e,t)=>e+Math.pow(t-c,2),0)/t.length;let u=Math.min(l/100,1);e.antiAliasing.smoothingLevel>0&&(u+=.1),e.systemFontHints.hintingLevel>0&&(u+=.1),u=Math.min(u,1);let d="low";const h=e.antiAliasing.smoothingLevel;h>50||e.systemFontHints.clearType?d="high":(h>20||e.systemFontHints.hintingLevel>2)&&(d="medium");const m="error"!==e.isolatedHash&&e.isolatedHash.length>0;return{confidence:Math.round(100*r)/100,uniqueness:Math.round(100*u)/100,hasSystemFonts:a,hasAdvancedFeatures:s,renderingQuality:d,isolationIntegrity:m}}const qe=["sans-serif-thin","ARNO PRO","Agency FB","Arabic Typesetting","Arial Unicode MS","AvantGarde Bk BT","BankGothic Md BT","Batang","Bitstream Vera Sans Mono","Calibri","Century","Century Gothic","Clarendon","EUROSTILE","Franklin Gothic","Futura Bk BT","Futura Md BT","GOTHAM","Gill Sans","HELV","Haettenschweiler","Helvetica Neue","Humanst521 BT","Leelawadee","Letter Gothic","Levenim MT","Lucida Bright","Lucida Sans","Menlo","MS Mincho","MS Outlook","MS Reference Specialty","MS UI Gothic","MT Extra","MYRIAD PRO","Marlett","Meiryo UI","Microsoft Uighur","Minion Pro","Monotype Corsiva","PMingLiU","Pristina","SCRIPTINA","Segoe UI Light","Serifa","SimHei","Small Fonts","Staccato222 BT","TRAJAN PRO","Univers CE 55 Medium","Vrinda","ZWAdobeF","Arial","Arial Black","Comic Sans MS","Courier New","Georgia","Impact","Palatino Linotype","Tahoma","Times New Roman","Trebuchet MS","Verdana","American Typewriter","Avenir","Baskerville","Big Caslon","Brush Script MT","Copperplate","Didot","Futura","Helvetica","Hoefler Text","Lucida Grande","Marker Felt","Optima","Papyrus","Phosphate","Rockwell","Savoye LET","SignPainter","Skia","Snell Roundhand","Zapfino","DejaVu Sans","DejaVu Sans Mono","DejaVu Serif","Liberation Sans","Liberation Serif","Ubuntu","Ubuntu Mono"],Ze="mmMwWLliI0O&1",Ge="48px",$e=["monospace","sans-serif","serif"];function Xe(e,t){const n=e.createElement("span");return n.style.position="absolute",n.style.top="0",n.style.left="0",n.style.fontFamily=t,n.style.fontSize=Ge,n.style.whiteSpace="nowrap",n.textContent=Ze,n}function Ke(e,t,n){return Xe(e,`'${t}',${n}`)}function Je(e,t){return $e.some((n,o)=>{const i=e[o],r=t[n];return!(!i||!r||i.offsetWidth===r.width&&i.offsetHeight===r.height)})}function Ye(e){const{available:t,method:n,precision:o,totalTested:i,detectionTime:r}=e;let a=.5;"iframe"===n?a=.9:"dom"===n&&(a=.7),a*=o;const s=t.filter(e=>["Calibri","Segoe UI Light","MS UI Gothic","Arial Unicode MS"].includes(e)).length,c=t.filter(e=>["Helvetica Neue","Avenir","Menlo","Zapfino","Baskerville"].includes(e)).length,l=t.filter(e=>["DejaVu Sans","Liberation Sans","Ubuntu"].includes(e)).length,u=t.filter(e=>["sans-serif-thin","Roboto"].includes(e)).length;let d="unknown";s>=2?d="windows":c>=2?d="macos":l>=1?d="linux":u>=1&&(d="android");const h=Math.min(r<100?1:.8,1),m=["Arial","Times New Roman","Helvetica"],g=t.filter(e=>!m.includes(e)),f=Math.min(g.length/10,1);return{confidence:Math.round(100*a)/100,uniqueness:Math.round(100*f)/100,osSignature:d,browserCapabilities:Math.round(100*h)/100}}const Qe=Math,et=()=>0;function tt(){const e=Qe.acos||et,t=Qe.acosh||et,n=Qe.asin||et,o=Qe.asinh||et,i=Qe.atanh||et,r=Qe.atan||et,a=Qe.sin||et,s=Qe.sinh||et,c=Qe.cos||et,l=Qe.cosh||et,u=Qe.tan||et,d=Qe.tanh||et,h=Qe.exp||et,m=Qe.expm1||et,g=Qe.log1p||et,f=Qe.cbrt||et,p=Qe.hypot||et,w=Qe.log10||et,y=Qe.log2||et;return{acos:e(.12312423423423424),asin:n(.12312423423423424),atan:r(.5),cos:c(10.000000000123),sin:a(-1e300),tan:u(-1e300),acosh:t(1e308),asinh:o(1),atanh:i(.5),cosh:l(1),sinh:s(1),tanh:d(1),exp:h(1),expm1:m(1),log1p:g(10),powPI:Qe.pow(Qe.PI,-100),cbrt:f(27),hypot:p(3,4),log10:w(100),log2:y(8),acoshPf:(v=1e154,Qe.log(v+Qe.sqrt(v*v-1))),asinhPf:Qe.log(1+Qe.sqrt(2)),atanhPf:Qe.log(3)/2,sinhPf:(Qe.exp(1)-Qe.exp(-1))/2,coshPf:(Qe.exp(1)+Qe.exp(-1))/2,expm1Pf:Qe.exp(1)-1,tanhPf:(Qe.exp(2)-1)/(Qe.exp(2)+1),log1pPf:Qe.log(11),precision:{float32:Qe.abs(0),float64:Qe.abs(2-2.0000000000000004),bigNumbers:Qe.abs(1),smallNumbers:Qe.abs(1e-15+2e-15-3e-15)}};var v}function nt(){try{const e=tt();return[e.acos,e.asin,e.atan,e.cos,e.sin,e.tan,e.acosh,e.asinh,e.atanh,e.cosh,e.sinh,e.tanh,e.exp,e.expm1,e.log1p,e.powPI,e.cbrt,e.hypot,e.log10,e.log2,e.precision.float32,e.precision.float64,e.precision.bigNumbers,e.precision.smallNumbers].join(",")}catch{return"math-unavailable"}}function ot(e){let t=.9,n=.8;Object.values(e).some(e=>"number"==typeof e&&0!==e)||(t=.1,n=.1),t*=Object.values(e.precision).reduce((e,t)=>e+("number"!=typeof t||isNaN(t)?0:1),0)/4;let o="high";return t<.3?o="low":t<.7&&(o="medium"),{confidence:Math.round(100*t)/100,stability:o,uniqueness:Math.round(100*n)/100}}const it={gdprMode:!1,includeInvasive:!0,timeout:5e3,debug:!1,excludeComponents:[]},rt=new Map;function at(e,t){return!(t.excludeComponents.includes(e)||t.gdprMode&&!t.includeInvasive&&["canvas","webgl","audio","fontPreferences","enhancedFonts"].includes(e)||(["mathFingerprint","dateTimeLocale","accessibilityEnhanced","fontPreferences","enhancedFonts"].includes(e),0))}function st(e,t){rt.set(e,t)}async function ct(e,t,n){const o=`${e}_${n.gdprMode}`,i=(r=o,rt.get(r)||null);var r;if(i)return i;const a="webgl"===e,s=["canvas","webgl","audio","hardware","system"].includes(e),c=a?2:s?3:1,l=a?[200,500]:[100,250,500];for(let i=0;i<c;i++)try{const r=n.timeout+i*(a?2e3:1e3),s=new Promise((t,n)=>{setTimeout(()=>n(new Error(`${e} timeout after ${r}ms (attempt ${i+1})`)),r)}),c=await Promise.race([t(),s]);if(null!=c)return st(o,c),c;throw new Error(`${e} returned null/undefined result`)}catch(t){const n=i===c-1,o=t instanceof Error?t.message:String(t);if(a&&o.includes("context")){console.warn(`[RabbitTracker] WebGL context issue detected: ${o}`);try{const{forceCleanupWebGL:e}=await Promise.resolve().then(function(){return ue});e()}catch(e){}return null}if(n)return console.warn(`[RabbitTracker] Component ${e} failed after ${c} attempts: ${o}`),null;!o.includes("timeout")&&i<l.length&&await new Promise(e=>setTimeout(e,l[i])),a&&await new Promise(e=>setTimeout(e,100))}return null}async function lt(e={}){const t=performance.now(),n={...it,...e},o=[],i=[],r={collectionTime:t,gdprMode:n.gdprMode,components:[]},l=[];if(at("canvas",n)&&j()&&l.push(ct("canvas",W,n).then(e=>({component:"canvas",result:e}))),at("webgl",n)&&pe()&&l.push(ct("webgl",ge,n).then(e=>({component:"webgl",result:e}))),at("audio",n)&&y()&&l.push(ct("audio",w,n).then(e=>({component:"audio",result:e}))),at("fonts",n)&&J()&&l.push(ct("fonts",()=>async function(e=!0){const t=performance.now();try{let n;if(e&&function(){try{const e=document.createElement("canvas").getContext("2d");return null!==e&&"function"==typeof e.measureText}catch{return!1}}()){const{available:e,measurements:t}=function(){const e=[],t={};for(const n of q)try{const o=$(G,n);t[n]=o,K(n,"canvas")&&e.push(n)}catch(e){continue}return{available:e,measurements:t}}();n={available:e.sort(),method:"advanced",measurements:t}}else n={available:function(){const e=[];for(const t of q)try{K(t,"dom")&&e.push(t)}catch(e){continue}return e}().sort(),method:"basic"};return{value:n,duration:performance.now()-t}}catch(e){return{value:{available:[],method:"basic"},duration:performance.now()-t,error:e instanceof Error?e.message:"Font detection failed"}}}(!n.gdprMode),n).then(e=>({component:"fonts",result:e}))),at("screen",n)&&ee()&&l.push(ct("screen",Q,n).then(e=>({component:"screen",result:e}))),at("browser",n)&&U()&&l.push(ct("browser",B,n).then(e=>({component:"browser",result:e}))),(await Promise.allSettled(l)).forEach((e,t)=>{if("fulfilled"===e.status&&e.value.result){const{component:t,result:n}=e.value;r[t]=n,o.push(t)}else{const n=l[t],o=n?.toString().match(/component: "(\w+)"/)?.[1]||"unknown";i.push({component:o,error:"rejected"===e.status?e.reason?.message||"Promise rejected":"Collection failed or timeout"})}}),!n.gdprMode)try{const{detectIncognitoHeuristics:e}=await Promise.resolve().then(function(){return Jt}),t=await e();t&&(r.incognitoDetection={likelihood:t.likelihood,methods:t.methods},o.push("incognito"))}catch(e){i.push({component:"incognito",error:e instanceof Error?e.message:"Incognito detection failed"})}if(at("hardware",n))try{const e=await Promise.resolve().then(function(){return nn}).catch(()=>null);if(e?.isHardwareDetectionAvailable?.()){const t=e.getHardwareFingerprint?.();t&&(r.hardware={value:t,duration:0},o.push("hardware"))}else if(!e){const e={hardwareConcurrency:navigator.hardwareConcurrency||0,deviceMemory:navigator.deviceMemory||0,platform:navigator.platform||"unknown"};r.hardware={value:e,duration:0},o.push("hardware")}}catch(e){i.push({component:"hardware",error:e instanceof Error?e.message:"Hardware detection failed"})}if(at("system",n))try{const{getSystemFingerprint:e,isSystemDetectionAvailable:t}=await Promise.resolve().then(function(){return cn});if(t()){const t=e();t&&(r.system={value:t,duration:0},o.push("system"))}}catch(e){i.push({component:"system",error:e instanceof Error?e.message:"System detection failed"})}if(at("storage",n))try{const{getStorageFingerprint:e,isStorageDetectionAvailable:t}=await Promise.resolve().then(function(){return gn});if(t()){const t=performance.now(),n=await e(),i=performance.now()-t;n&&(r.storage={value:n,duration:i},o.push("storage"))}}catch(e){i.push({component:"storage",error:e instanceof Error?e.message:"Storage detection failed"})}if(at("math",n))try{const{getCompleteMathFingerprint:e,isMathDetectionAvailable:t}=await Promise.resolve().then(function(){return yn});if(t()){const t=performance.now(),n=e(),i=performance.now()-t;n&&(r.math={value:n,duration:i},o.push("math"))}}catch(e){i.push({component:"math",error:e instanceof Error?e.message:"Math fingerprinting failed"})}if(at("domBlockers",n))try{const{getDomBlockersFingerprint:e,isDomBlockersDetectionAvailable:t}=await Promise.resolve().then(function(){return Mn});if(t()){const t=performance.now(),i=await e({debug:n.debug}),a=performance.now()-t;i&&(r.domBlockers={value:i,duration:a},o.push("domBlockers"))}}catch(e){i.push({component:"domBlockers",error:e instanceof Error?e.message:"DOM blockers detection failed"})}if(at("accessibility",n))try{const{getAccessibilityFingerprint:e,isAccessibilityDetectionAvailable:t}=await Promise.resolve().then(function(){return Be});if(t()){const t=performance.now(),n=e(),i=performance.now()-t;n&&(r.accessibility={value:n,duration:i},o.push("accessibility"))}}catch(e){i.push({component:"accessibility",error:e instanceof Error?e.message:"Accessibility detection failed"})}if(at("browserApis",n))try{const{getBrowserApisFingerprint:e,isBrowserApisDetectionAvailable:t}=await Promise.resolve().then(function(){return Fn});if(t()){const t=performance.now(),n=e(),i=performance.now()-t;n&&(r.browserApis={value:n,duration:i},o.push("browserApis"))}}catch(e){i.push({component:"browserApis",error:e instanceof Error?e.message:"Browser APIs detection failed"})}if(at("pluginsEnhanced",n))try{const{getEnhancedPluginFingerprint:e,isEnhancedPluginDetectionAvailable:t}=await Promise.resolve().then(function(){return Kn});if(t()){const t=performance.now(),n=e(),i=performance.now()-t;n&&(r.pluginsEnhanced={value:n,duration:i},o.push("pluginsEnhanced"))}}catch(e){i.push({component:"pluginsEnhanced",error:e instanceof Error?e.message:"Enhanced plugin detection failed"})}if(at("mathFingerprint",n)&&function(){try{return"undefined"!=typeof Math&&"function"==typeof Math.sin}catch{return!1}}())try{const e=performance.now(),t=tt(),n=performance.now()-e;t&&(r.mathFingerprint={value:t,duration:n,analysis:ot(t),hash:nt()},o.push("mathFingerprint"))}catch(e){i.push({component:"mathFingerprint",error:e instanceof Error?e.message:"Math fingerprinting failed"})}if(at("fontPreferences",n)&&function(){try{return"undefined"!=typeof document&&"function"==typeof document.createElement&&void 0!==document.body}catch{return!1}}())try{const e=performance.now(),t=await async function(){try{const{document:e,container:t,cleanup:n}=await new Promise((e,t)=>{const n=document.createElement("iframe");n.style.cssText="position: absolute; left: -9999px; top: -9999px; width: 1px; height: 1px; opacity: 0;",n.srcdoc='<!doctype html>\n <html>\n <head>\n <meta name="viewport" content="width=device-width, initial-scale=1">\n <style>\n body { \n margin: 0; \n padding: 20px; \n width: 4000px;\n text-size-adjust: none;\n -webkit-text-size-adjust: none;\n }\n </style>\n </head>\n <body></body>\n </html>',n.onload=()=>{try{const o=n.contentDocument,i=n.contentWindow;if(!o||!i)return void t(new Error("Cannot access iframe content"));const r=o.body;M()?r.style.zoom=""+1/i.devicePixelRatio:v()&&(r.style.zoom="reset");const a=o.createElement("div");a.textContent=Array(200).fill("word").join(" "),r.appendChild(a),e({document:o,container:r,cleanup:()=>{n.parentNode&&n.parentNode.removeChild(n)}})}catch(e){t(e)}},n.onerror=()=>{t(new Error("Failed to load iframe"))},document.body.appendChild(n)}),o={};for(const[n,i]of Object.entries(He))try{o[n]=We(e,t,i)}catch(e){o[n]=0}const i=function(e,t,n="Arial"){try{const t=e.createElement("canvas");t.width=100,t.height=50;const o=t.getContext("2d",{willReadFrequently:!0});if(!o)return{quality:0,antiAliasing:!1,smoothing:0};o.font=`24px "${n}"`,o.fillStyle="#000000",o.fillText("Wg",10.5,30.7);const i=o.getImageData(10,20,30,20).data;let r=0,a=0,s=0;for(let e=0;e<i.length;e+=4){const t=i[e]||0,n=i[e+1]||0,o=i[e+2]||0;(i[e+3]||0)<10||(s++,t===n&&n===o&&t>0&&t<255&&a++,e>4&&Math.abs(t-(i[e-4]||0))>50&&r++)}const c=s>0?a/s:0,l=s>0?100*a/s:0;return{quality:Math.round(l),antiAliasing:c>.1,smoothing:Math.round(100*l)/100}}catch(e){return{quality:0,antiAliasing:!1,smoothing:0}}}(e,0,"Arial"),r=function(e){try{const t=e.createElement("canvas");t.width=100,t.height=50;const n=t.getContext("2d",{willReadFrequently:!0});if(!n)return{clearType:!1,hintingLevel:0,subpixelRendering:!1};const o=["rn","il","WW","mm"];let i=0,r=0,a=0;for(const e of o){n.clearRect(0,0,t.width,t.height),n.font="16px Arial",n.fillStyle="#000",n.fillText(e,10,25);const o=n.getImageData(10,15,40,20).data;for(let e=0;e<o.length;e+=12){const t=o[e]||0,n=o[e+1]||0,s=o[e+2]||0,c=o[e+4]||0,l=o[e+5]||0,u=o[e+6]||0;(Math.abs(t-n)>20||Math.abs(n-s)>20)&&i++,Math.abs(t-c)+Math.abs(n-l)+Math.abs(s-u)>50&&r++,(t>0&&t<255||n>0&&n<255||s>0&&s<255)&&a++}}return{clearType:i>10,hintingLevel:Math.min(Math.round(a/10),5),subpixelRendering:r>5}}catch(e){return{clearType:!1,hintingLevel:0,subpixelRendering:!1}}}(e),a={},c=["Arial","Helvetica","Times New Roman","Georgia","Courier New"];for(const n of c)try{a[n]=ze(e,t,n)}catch(e){a[n]="fallback-error"}const l=s([JSON.stringify(o),JSON.stringify(i),JSON.stringify(r),JSON.stringify(a)].join("|"));return n(),{...o,antiAliasing:{enabled:i.antiAliasing,type:r.clearType?"cleartype":i.antiAliasing?"standard":"none",smoothingLevel:i.smoothing},systemFontHints:r,fallbackBehavior:a,isolatedHash:l}}catch(e){return{...Object.keys(He).reduce((e,t)=>(e[t]=0,e),{}),antiAliasing:{enabled:!1,type:"unknown",smoothingLevel:0},systemFontHints:{clearType:!1,hintingLevel:0,subpixelRendering:!1},fallbackBehavior:{},isolatedHash:"error"}}}(),n=performance.now()-e;t&&(r.fontPreferences={value:t,duration:n,analysis:je(t),hash:(u=t,u.isolatedHash&&"error"!==u.isolatedHash?u.isolatedHash:[...[u.default,u.serif,u.sans,u.mono,u.apple,u.system,u.min,u.large,u.ui,u.emoji,u.math,u.cjk,u.arabic,u.hebrew,u.subpixel,u.kerning,u.ligatures].map(e=>Math.round(e)),u.antiAliasing.enabled?1:0,u.systemFontHints.clearType?1:0,u.systemFontHints.hintingLevel,Math.round(u.antiAliasing.smoothingLevel)].join(","))},o.push("fontPreferences"))}catch(e){i.push({component:"fontPreferences",error:e instanceof Error?e.message:"Font preferences detection failed"})}var u,h,m;if(at("dateTimeLocale",n)&&function(){try{return"undefined"!=typeof window&&void 0!==window.Intl}catch{return!1}}())try{const e=performance.now(),t=function(){const e=function(){try{if(!window.Intl)return-1;const e=window.Intl.DateTimeFormat;if(!e)return-2;const t=(new e).resolvedOptions();return t.locale||""===t.locale?{locale:t.locale||"unknown",calendar:t.calendar||"unknown",numberingSystem:t.numberingSystem||"unknown",timeZone:t.timeZone||"unknown",hourCycle:t.hourCycle||"unknown",hour12:void 0!==t.hour12&&t.hour12}:-3}catch(e){return-2}}();if("number"==typeof e)return e;const t=function(){try{if(!window.Intl||!window.Intl.NumberFormat)return-4;const e=(new Intl.NumberFormat).resolvedOptions(),t=new Intl.NumberFormat(void 0,{style:"currency",currency:"USD"}).resolvedOptions();return{numberLocale:e.locale||"unknown",currencyDisplay:t.currencyDisplay||"unknown",currencySign:t.currencySign||"unknown",notation:e.notation||"unknown",signDisplay:e.signDisplay||"unknown"}}catch(e){return-4}}(),n="number"==typeof t?{}:t,o=function(){const e={listStyle:"unknown",relativeTimeStyle:"unknown",pluralRules:"unknown"};try{if(window.Intl&&window.Intl.ListFormat){const t=(new window.Intl.ListFormat).resolvedOptions();e.listStyle=t.style||"unknown"}}catch(e){}try{if(window.Intl&&window.Intl.RelativeTimeFormat){const t=(new window.Intl.RelativeTimeFormat).resolvedOptions();e.relativeTimeStyle=t.style||"unknown"}}catch(e){}try{if(window.Intl&&window.Intl.PluralRules){const t=(new window.Intl.PluralRules).select(1);e.pluralRules=t||"unknown"}}catch(e){}return e}(),i=function(){const e={DateTimeFormat:!1,NumberFormat:!1,RelativeTimeFormat:!1,ListFormat:!1,PluralRules:!1,Collator:!1};try{window.Intl&&(e.DateTimeFormat="function"==typeof window.Intl.DateTimeFormat,e.NumberFormat="function"==typeof window.Intl.NumberFormat,e.RelativeTimeFormat="function"==typeof window.Intl.RelativeTimeFormat,e.ListFormat="function"==typeof window.Intl.ListFormat,e.PluralRules="function"==typeof window.Intl.PluralRules,e.Collator="function"==typeof window.Intl.Collator)}catch(e){}return e}(),r=navigator.language||"unknown",a=e.locale===r;let s="unknown",c="unknown";try{if(window.Intl&&"function"==typeof window.Intl.DateTimeFormat){const e=new Intl.DateTimeFormat(void 0,{dateStyle:"long"}),t=new Intl.DateTimeFormat(void 0,{timeStyle:"long"}),n=e.resolvedOptions(),o=t.resolvedOptions();s=n.dateStyle||"unknown",c=o.timeStyle||"unknown"}}catch(e){}return{locale:e.locale||"unknown",calendar:e.calendar||"unknown",numberingSystem:e.numberingSystem||"unknown",timeZone:e.timeZone||"unknown",dateStyle:s,timeStyle:c,hourCycle:e.hourCycle||"unknown",hour12:e.hour12||!1,numberLocale:n.numberLocale||e.locale||"unknown",currencyDisplay:n.currencyDisplay||"unknown",currencySign:n.currencySign||"unknown",notation:n.notation||"unknown",signDisplay:n.signDisplay||"unknown",listStyle:o.listStyle||"unknown",relativeTimeStyle:o.relativeTimeStyle||"unknown",pluralRules:o.pluralRules||"unknown",navigatorLanguage:r,localeMatch:a,intlSupport:i}}(),n=performance.now()-e;t&&"object"==typeof t&&(r.dateTimeLocale={value:t,duration:n,analysis:Ue(t),hash:(h=t,"number"==typeof h?`status-${h}`:[h.locale,h.calendar,h.numberingSystem,h.timeZone,h.hourCycle,h.hour12?"1":"0",h.localeMatch?"1":"0",Object.values(h.intlSupport).map(e=>e?"1":"0").join("")].join("|"))},o.push("dateTimeLocale"))}catch(e){i.push({component:"dateTimeLocale",error:e instanceof Error?e.message:"DateTime locale detection failed"})}if(at("accessibilityEnhanced",n)&&Ce())try{const e=performance.now(),t=Ne(),n=performance.now()-e;t&&(r.accessibilityEnhanced={value:t,duration:n,analysis:Fe(t)},o.push("accessibilityEnhanced"))}catch(e){i.push({component:"accessibilityEnhanced",error:e instanceof Error?e.message:"Enhanced accessibility detection failed"})}if(at("enhancedFonts",n)&&function(){try{return"undefined"!=typeof document&&"function"==typeof document.createElement&&void 0!==document.body}catch{return!1}}())try{const e=performance.now(),t=await async function(){const e=performance.now();try{const{document:t,body:n,cleanup:o}=await new Promise((e,t)=>{const n=document.createElement("iframe");n.style.cssText="position: absolute; left: -9999px; top: -9999px; width: 1px; height: 1px; opacity: 0; pointer-events: none;",n.onload=()=>{try{const t=n.contentDocument;if(!t)throw new Error("Cannot access iframe document");const o=t.body;if(!o)throw new Error("Iframe body not available");o.style.fontSize=Ge,o.style.margin="0",o.style.padding="0",e({document:t,body:o,cleanup:()=>{n.parentNode&&n.parentNode.removeChild(n)}})}catch(e){t(e)}},n.onerror=()=>{t(new Error("Failed to load font measurement iframe"))},document.body.appendChild(n)});try{const o=t.createElement("div");o.style.setProperty("visibility","hidden","important");const i=$e.map(e=>Xe(t,e));i.forEach(e=>o.appendChild(e));const r={};for(const e of qe)r[e]=$e.map(n=>Ke(t,e,n)),r[e].forEach(e=>o.appendChild(e));n.appendChild(o);const a={};$e.forEach((e,t)=>{const n=i[t];n&&(a[e]={width:n.offsetWidth,height:n.offsetHeight})});const s=[],c={};for(const e of qe){const t=r[e];t&&(Je(t,a)&&s.push(e),t.length>0&&t[0]&&(c[e]={width:t[0].offsetWidth,height:t[0].offsetHeight}))}const l=performance.now()-e,u=Object.values(c).map(e=>e.width);return{available:s,method:"iframe",measurements:c,precision:new Set(u).size/u.length,totalTested:qe.length,detectionTime:l}}finally{o()}}catch(t){return function(e){const t=[],n={};try{const e=document.createElement("div");e.style.cssText="position: absolute; left: -9999px; top: -9999px; visibility: hidden;";const o={};$e.forEach(t=>{const n=document.createElement("span");n.style.fontFamily=t,n.style.fontSize=Ge,n.style.whiteSpace="nowrap",n.textContent=Ze,e.appendChild(n),document.body.appendChild(e),o[t]={width:n.offsetWidth,height:n.offsetHeight},document.body.removeChild(e),e.removeChild(n)});for(const i of qe){let r=!1;for(const t of $e){const a=document.createElement("span");a.style.fontFamily=`'${i}',${t}`,a.style.fontSize=Ge,a.style.whiteSpace="nowrap",a.textContent=Ze,e.appendChild(a),document.body.appendChild(e);const s={width:a.offsetWidth,height:a.offsetHeight};n[i]=s;const c=o[t];if(!c||s.width===c.width&&s.height===c.height||(r=!0),document.body.removeChild(e),e.removeChild(a),r)break}r&&t.push(i)}}catch(e){}const o=performance.now()-e,i=Object.values(n).map(e=>e.width),r=new Set(i).size;return{available:t,method:"dom",measurements:n,precision:i.length>0?r/i.length:0,totalTested:qe.length,detectionTime:o}}(e)}}(),n=performance.now()-e;t&&(r.enhancedFonts={value:t,duration:n,analysis:Ye(t),hash:(m=t,`${m.available.sort().join(",")}|${m.method}|${m.precision.toFixed(2)}`)},o.push("enhancedFonts"))}catch(e){i.push({component:"enhancedFonts",error:e instanceof Error?e.message:"Enhanced font detection failed"})}const g={};let f;o.forEach(e=>{const t=r[e];t&&t.value&&(g[e]=t.value)});try{const{calculateConfidence:e}=await Promise.resolve().then(function(){return eo});f=e([...o.map(e=>({component:e,success:!0,duration:r[e]?.duration||0,value:r[e]?.value})),...i.map(e=>({component:e.component,success:!1,duration:0,error:e.error}))],{requireMinimumComponents:6,penalizeMissingCore:!0,adjustForIncognito:!0}),r.confidence={score:f.score,level:f.level,factors:f.factors,recommendations:f.recommendations}}catch(e){const t=o.length/(o.length+i.length||1);r.confidence={score:t>=.8?.95:t>=.6?.8:.5,level:t>=.8?"High":t>=.6?"Medium":"Low",factors:{componentCount:o.length,weightedScore:t,stabilityScore:t,entropyScore:t,spoofResistanceScore:t},recommendations:t<.8?["Enable more fingerprinting components"]:[]}}const p={...r,hash:"",components:o,collectionTime:performance.now()-t},b={success:o.length>0,collectedComponents:o,failedComponents:i,confidence:f||r.confidence};if(o.length>0){const e=p.browser?.value,t=p.screen?.value,r=e?.userAgent||"",s=(()=>{const e=!0===navigator.userAgentData?.mobile,n=navigator.maxTouchPoints||0,o=t?.width||0,i=t?.height||0,r=Math.min(o,i);return Math.max(o,i),e?"mobile":n>0?r<=480?"mobile":"tablet":r>1024?"desktop":r<=480?"mobile":"desktop"})();let l={};try{const{collectDeviceSignals:e}=await Promise.resolve().then(function(){return co});l=e()}catch(e){}const u={ua:(()=>{try{return P().family}catch{const e=r,t=e.match(/(chrome|safari|firefox|edge|edg|brave|opera|opr|chromium)/i);return(t?.[1]||e.split(" ")[0]||"unknown").toLowerCase()}})(),timezone:e?.timezone||"unknown",primaryLanguage:(()=>{try{const t=e?.languages;return Array.isArray(t)&&t.length>0&&t[0]?t[0].toLowerCase().split("-")[0]:"undefined"!=typeof navigator&&navigator.language?navigator.language.toLowerCase().split("-")[0]:"unknown"}catch{return"unknown"}})(),platform:(e?.platform||"unknown").toLowerCase(),deviceType:s,hardware:(()=>{const e=l.hardwareConcurrency,t=l.deviceMemory;if(!e&&!t)return;const n=e?(e=>e>=32?"workstation":e>=20?"ultra":e>=16?"high":e>=12?"premium":e>=8?"mid":e>=6?"normal":e>=4?"basic":e>=2?"low":"minimal")(e):"unknown",o=t?(e=>e>=64?"workstation":e>=32?"ultra":e>=24?"high":e>=16?"premium":e>=12?"mid":e>=8?"normal":e>=4?"basic":e>=2?"low":"minimal")(t):"unknown";var i;return{cores:n,memory:o,arch:void 0===(i=l.architecture)?"unknown":255===i?"arm64":0===i?"x86_64":"other",class:((e,t)=>"workstation"!==e&&"ultra"!==e||"workstation"!==t&&"ultra"!==t?"high"!==e&&"premium"!==e||"high"!==t&&"premium"!==t&&"ultra"!==t?"mid"!==e&&"normal"!==e||"mid"!==t&&"normal"!==t&&"premium"!==t?"basic"!==e&&"low"!==e||"basic"!==t&&"low"!==t&&"normal"!==t?"minimal"===e||"minimal"===t?"mobile":"mixed":"budget":"mainstream":"enthusiast":"professional")(n,o),touch:l.touchSupport?.maxTouchPoints?l.touchSupport.maxTouchPoints>=10?"multi":l.touchSupport.maxTouchPoints>=5?"standard":"basic":"none"}})(),screenFrame:l?.screenFrame?{top:l.screenFrame.top||0,right:l.screenFrame.right||0,bottom:l.screenFrame.bottom||0,left:l.screenFrame.left||0}:void 0,display:(()=>{const e=l.colorDepth,t=l.colorGamut,n=(e=>e?e>=48?"ultra_high":e>=32?"high":e>=24?"normal":e>=16?"basic":"low":"unknown")(e),o=(e=>{if(!e)return"unknown";switch(e){case"rec2020":return"professional";case"p3":return"enhanced";case"srgb":return"standard";default:return"unknown"}})(t);return{depth:n,gamut:o,class:((e,t)=>"ultra_high"===e||"professional"===t?"professional":"high"===e||"enhanced"===t?"premium":"normal"===e&&"standard"===t?"standard":"basic"===e?"basic":"legacy")(n,o)}})()},h=[u.ua||"",u.platform||"",u.deviceType||"",u.timezone||"",u.primaryLanguage||""].filter(Boolean);if(h.length>=3){const e=h.join("|");let t=0;for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n)&4294967295;u._entropy=Math.abs(t).toString(36).substring(0,8)}(n.debug||"undefined"!=typeof window&&window._rabbitTrackerDebug)&&console.log("[RabbitTracker DEBUG] coreVector components:",{ua:u.ua,platform:u.platform,deviceType:u.deviceType,timezone:u.timezone,primaryLanguage:u.primaryLanguage,hasHardware:!!u.hardware,hasDisplay:!!u.display,hasScreenFrame:!!u.screenFrame,_entropy:u._entropy});const m=function(e,t=!1){const n=d(e),o=JSON.stringify(n);t&&console.log("[RabbitTracker] hashStableCore debug:",{originalKeys:Object.keys(e),canonicalizedKeys:Object.keys(n),canonicalLength:o.length,sample:o.substring(0,200)+"..."});const i=a(o);return t&&console.log("[RabbitTracker] Generated stableCoreHash:",i.substring(0,32)),i}(u,n.debug),w=["canvas","webgl","audio","mathFingerprint","fontPreferences","enhancedFonts","dateTimeLocale","accessibilityEnhanced","domBlockers","pluginsEnhanced"],y={};for(const[e,t]of Object.entries(g))w.includes(e)||(y[e]=t);const v={...y,_stableCore:u},S=c(v,n.debug);p.hash=S,n.debug&&console.log("[RabbitTracker] Ultra-stable core vector:",{components:Object.keys(u),entropy:u._entropy,stableCoreHash:m.substring(0,16),enhancedFingerprintHash:S.substring(0,16),ua:u.ua,deviceType:u.deviceType,platform:u.platform,timezone:u.timezone,hasScreenFrame:!!u.screenFrame,hardwareClass:u.hardware?.class,displayClass:u.display?.class,totalComponentsInHash:Object.keys(v).length}),b.data={...p,stableCoreHash:m,stableCoreVector:u},n.debug&&(console.log("[RabbitTracker] Fingerprint collection completed:",{collected:o.length,failed:i.length,duration:p.collectionTime,enhancedFingerprintHash:p.hash,stableCoreHash:m,confidence:f?.level||"Unknown",score:f?.score||0,collisionResistance:"Enhanced with stable + unstable components (no temporal entropy)"}),f?.recommendations.length&&console.log("[RabbitTracker] Confidence recommendations:",f.recommendations))}else b.error="No components could be collected";return b}async function ut(){return lt({gdprMode:!0,includeInvasive:!1,excludeComponents:["canvas","webgl","audio"],timeout:2e3})}async function dt(){return lt({gdprMode:!1,includeInvasive:!0,timeout:5e3})}class ht{constructor(){this.name="fetch",this.available="undefined"!=typeof fetch}async send(e,t){const n=Date.now();try{const o=await fetch(t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!o.ok)throw new Error(`HTTP ${o.status}`);return{success:!0,method:this.name,latency:Date.now()-n}}catch(e){return{success:!1,method:this.name,latency:Date.now()-n,error:e instanceof Error?e.message:String(e)}}}}class mt{constructor(e){this.name="resource",this.available="undefined"!=typeof fetch,this.baseUrl=e}async send(e,t){const n=Date.now();try{const t=this.encodeData(e),o=[{path:"/assets/styles.css",type:"text/css"},{path:"/images/pixel.gif",type:"image/gif"},{path:"/fonts/roboto.woff2",type:"font/woff2"},{path:"/js/analytics.js",type:"application/javascript"}],i=o[Math.floor(Math.random()*o.length)],r=`${this.baseUrl}${i.path}?d=${t}&t=${Date.now()}`;return await fetch(r,{method:"GET",headers:{Accept:i.type,"Cache-Control":"no-cache","User-Agent":navigator.userAgent}}),{success:!0,method:this.name,latency:Date.now()-n}}catch(e){return{success:!1,method:this.name,latency:Date.now()-n,error:e instanceof Error?e.message:String(e)}}}encodeData(e){try{const t=JSON.stringify(e);return btoa(encodeURIComponent(t)).replace(/[+/=]/g,e=>({"+":"-","/":"_","=":""}[e]||e))}catch(e){return""}}}class gt{constructor(e,t){this.name="elysia-websocket",this.available="undefined"!=typeof WebSocket,this.connected=!1,this.baseUrl=e,this.token=t}async send(e,t){const n=Date.now();try{if(!this.token)throw new Error("Missing token for WebSocket connection");if(await this.connect(),!this.ws||!this.connected)throw new Error("WebSocket not connected");return new Promise((t,o)=>{const i=e=>{try{const o=JSON.parse(e.data);this.ws?.removeEventListener("message",i),t({success:o.success||!1,method:this.name,latency:Date.now()-n})}catch(e){this.ws?.removeEventListener("message",i),o(new Error("Failed to parse WebSocket response"))}};this.ws?.addEventListener("message",i),this.ws?.send(JSON.stringify({...e,eventId:e.eventId||crypto.randomUUID(),sessionId:e.sessionId||e.s,eventType:e.eventType||e.type||"websocket_event",eventName:e.eventName||e.name,url:e.url,userAgent:e.userAgent||navigator.userAgent,timestamp:(new Date).toISOString(),fingerprintHash:e.fingerprintHash,stableCoreHash:e.stableCoreHash,stableCoreVector:e.stableCoreVector})),setTimeout(()=>{this.ws?.removeEventListener("message",i),o(new Error("WebSocket response timeout"))},5e3)})}catch(e){return{success:!1,method:this.name,latency:Date.now()-n,error:e instanceof Error?e.message:String(e)}}}async connect(){if(!this.connected||this.ws?.readyState!==WebSocket.OPEN)return new Promise((e,t)=>{try{const n=new URL(this.baseUrl),o=`${"https:"===n.protocol?"wss:":"ws:"}//${n.host}/ws/track?token=${encodeURIComponent(this.token)}`;this.ws=new WebSocket(o),this.ws.onopen=()=>{this.connected=!0,e()},this.ws.onerror=()=>{this.connected=!1,t(new Error("WebSocket connection failed"))},this.ws.onclose=()=>{this.connected=!1},setTimeout(()=>{this.connected||(this.ws?.close(),t(new Error("WebSocket connection timeout")))},5e3)}catch(e){t(e)}})}cleanup(){this.ws&&(this.ws.close(),this.connected=!1)}}class ft{constructor(){this.name="webrtc",this.available=void 0!==globalThis.RTCPeerConnection,this.connected=!1}async send(e,t){const n=Date.now();if(!this.available)return{success:!1,method:this.name,error:"WebRTC not available"};try{return await this.setupConnection(),this.dataChannel&&this.connected?(this.dataChannel.send(JSON.stringify(e)),{success:!0,method:this.name,latency:Date.now()-n}):{success:!1,method:this.name,error:"DataChannel not ready"}}catch(e){return{success:!1,method:this.name,error:e instanceof Error?e.message:String(e)}}}async setupConnection(){if(!this.connected)return new Promise((e,t)=>{try{this.pc=new globalThis.RTCPeerConnection({iceServers:[{urls:"stun:stun.l.google.com:19302"}]}),this.dataChannel=this.pc.createDataChannel("tracking",{ordered:!1,maxRetransmits:0}),this.dataChannel.onopen=()=>{this.connected=!0,e()},this.dataChannel.onerror=e=>{t(e)}}catch(e){t(e)}})}destroy(){this.dataChannel&&this.dataChannel.close(),this.pc&&this.pc.close(),this.connected=!1}}class pt{constructor(e,t,n={}){this.transports=[],this.stats={totalRequests:0,successfulRequests:0,methodSuccess:new Map,methodFailures:new Map},this.baseUrl=e,this.token=t,this.config={enabled:!0,methods:["elysia-websocket","fetch","resource"],fallbackDelay:100,maxRetries:2,debug:!1,...n},this.initializeTransports()}initializeTransports(){const e={"elysia-websocket":()=>new gt(this.baseUrl,this.token),fetch:()=>new ht,resource:()=>new mt(this.baseUrl),webrtc:()=>new ft};this.transports=this.config.methods.map(t=>e[t]?.()).filter(e=>void 0!==e&&e.available),this.config.debug&&console.log("[Zaplier] Anti-adblock initialized with transports:",this.transports.map(e=>e.name))}async send(e,t="/tracking/event"){if(this.stats.totalRequests++,!this.config.enabled||0===this.transports.length)return{success:!1,method:"none",error:"No transports available"};let n="";for(const o of this.transports){try{const i=await o.send(e,`${this.baseUrl}${t}`);if(i.success)return this.stats.successfulRequests++,this.updateMethodStats(o.name,!0),this.config.debug&&console.log(`[Zaplier] Data sent successfully via ${o.name}`,i),i;this.updateMethodStats(o.name,!1),n=i.error||"Unknown error",this.config.debug&&console.warn(`[Zaplier] Transport ${o.name} failed:`,i.error)}catch(e){n=e instanceof Error?e.message:String(e),this.updateMethodStats(o.name,!1),this.config.debug&&console.warn(`[Zaplier] Transport ${o.name} threw error:`,e)}this.config.fallbackDelay>0&&await new Promise(e=>setTimeout(e,this.config.fallbackDelay))}return{success:!1,method:"all_failed",error:`All transports failed. Last error: ${n}`}}updateMethodStats(e,t){t?this.stats.methodSuccess.set(e,(this.stats.methodSuccess.get(e)||0)+1):this.stats.methodFailures.set(e,(this.stats.methodFailures.get(e)||0)+1)}getStats(){return{...this.stats}}getSuccessRates(){const e={};for(const t of this.transports){const n=this.stats.methodSuccess.get(t.name)||0,o=n+(this.stats.methodFailures.get(t.name)||0);e[t.name]=o>0?n/o*100:0}return e}destroy(){this.transports.forEach(e=>{e.destroy&&e.destroy()}),this.transports=[]}async testTransports(){const e={},t={test:!0,timestamp:Date.now()};for(const n of this.transports)try{e[n.name]=await n.send(t,`${this.baseUrl}/test`)}catch(t){e[n.name]={success:!1,method:n.name,error:t instanceof Error?t.message:String(t)}}return e}}class wt{constructor(e,t={}){this.clicks=[],this.scrollData=[],this.mouseMoves=[],this.lastMouseMove=0,this.maxScrollDepth=0,this.isActive=!1,this.recentClicks=[],this.handleClick=e=>{if(!this.config.trackClicks)return;const t=e.target;t.getBoundingClientRect();const n=window.pageXOffset||document.documentElement.scrollLeft,o=window.pageYOffset||document.documentElement.scrollTop,i={x:e.clientX,y:e.clientY,absoluteX:e.clientX+n,absoluteY:e.clientY+o,element:this.getElementSelector(t),timestamp:Date.now(),button:e.button};this.config.trackRageClicks&&this.detectRageClick(i.x,i.y,i.timestamp)&&(i.rageClick=!0),this.clicks.push(i),this.clicks.length>this.config.maxClickBuffer&&(this.clicks=this.clicks.slice(-this.config.maxClickBuffer))},this.handleScroll=()=>{if(!this.config.trackScrollDepth)return;const e=this.calculateScrollDepth();this.maxScrollDepth=Math.max(this.maxScrollDepth,e),this.scrollData.push({depth:e,maxDepth:this.maxScrollDepth,timestamp:Date.now(),viewport:{width:window.innerWidth,height:window.innerHeight}}),this.scrollData.length>100&&(this.scrollData=this.scrollData.slice(-50))},this.handleMouseMove=e=>{if(!this.config.trackMouseMoves)return;const t=Date.now();t-this.lastMouseMove<this.config.mouseMoveThrottle||(this.lastMouseMove=t,this.mouseMoves.push({x:e.clientX,y:e.clientY,timestamp:t}),this.mouseMoves.length>200&&(this.mouseMoves=this.mouseMoves.slice(-100)))},this.handleResize=()=>{const e=this.calculateScrollDepth();this.scrollData.push({depth:e,maxDepth:this.maxScrollDepth,timestamp:Date.now(),viewport:{width:window.innerWidth,height:window.innerHeight}})},this.sessionId=e,this.config={enabled:!0,trackClicks:!0,trackScrollDepth:!0,trackMouseMoves:!1,trackRageClicks:!0,mouseMoveThrottle:200,batchInterval:1e4,maxClickBuffer:500,rageClickThreshold:3,rageClickTimeWindow:1e3,...t}}start(){return!(!this.config.enabled||this.isActive||(this.isActive=!0,this.setupEventListeners(),this.startBatchTimer(),this.trackInitialViewport(),0))}stop(){this.isActive&&(this.isActive=!1,this.removeEventListeners(),this.batchTimer&&(clearInterval(this.batchTimer),this.batchTimer=void 0),this.sendBatch())}setupEventListeners(){this.config.trackClicks&&document.addEventListener("click",this.handleClick,!0),this.config.trackScrollDepth&&(window.addEventListener("scroll",this.handleScroll,{passive:!0}),document.addEventListener("scroll",this.handleScroll,{passive:!0})),this.config.trackMouseMoves&&document.addEventListener("mousemove",this.handleMouseMove,{passive:!0}),window.addEventListener("resize",this.handleResize),window.addEventListener("orientationchange",this.handleResize)}removeEventListeners(){document.removeEventListener("click",this.handleClick,!0),window.removeEventListener("scroll",this.handleScroll),document.removeEventListener("scroll",this.handleScroll),document.removeEventListener("mousemove",this.handleMouseMove),window.removeEventListener("resize",this.handleResize),window.removeEventListener("orientationchange",this.handleResize)}trackInitialViewport(){const e=this.calculateScrollDepth();this.scrollData.push({depth:e,maxDepth:e,timestamp:Date.now(),viewport:{width:window.innerWidth,height:window.innerHeight}})}calculateScrollDepth(){const e=window.pageYOffset||document.documentElement.scrollTop,t=Math.max(document.body.scrollHeight,document.body.offsetHeight,document.documentElement.clientHeight,document.documentElement.scrollHeight,document.documentElement.offsetHeight),n=window.innerHeight;return t<=n?100:Math.min(100,Math.round((e+n)/t*100))}detectRageClick(e,t,n){const o=this.config.rageClickTimeWindow;this.recentClicks=this.recentClicks.filter(e=>n-e.timestamp<=o);const i=this.recentClicks.filter(n=>Math.sqrt(Math.pow(n.x-e,2)+Math.pow(n.y-t,2))<=50);return this.recentClicks.push({x:e,y:t,timestamp:n}),i.length>=this.config.rageClickThreshold-1}getElementSelector(e){if(e.id)return`#${e.id}`;if(e.className&&"string"==typeof e.className){const t=e.className.split(" ").filter(e=>e.length>0);if(t.length>0)return`.${t.slice(0,2).join(".")}`}const t=e.tagName.toLowerCase();return e.parentElement?`${t}:nth-child(${Array.from(e.parentElement.children).indexOf(e)+1})`:t}startBatchTimer(){this.batchTimer=window.setInterval(()=>{this.sendBatch()},this.config.batchInterval)}sendBatch(){if(0===this.clicks.length&&0===this.scrollData.length&&0===this.mouseMoves.length)return;const e={sessionId:this.sessionId,pageMetadata:{url:window.location.href,title:document.title,viewport:{width:window.innerWidth,height:window.innerHeight},documentSize:{width:Math.max(document.body.scrollWidth,document.body.offsetWidth,document.documentElement.clientWidth,document.documentElement.scrollWidth,document.documentElement.offsetWidth),height:Math.max(document.body.scrollHeight,document.body.offsetHeight,document.documentElement.clientHeight,document.documentElement.scrollHeight,document.documentElement.offsetHeight)}},clicks:[...this.clicks],scrollData:[...this.scrollData],mouseMoves:this.config.trackMouseMoves?[...this.mouseMoves]:[],maxScrollDepth:this.maxScrollDepth,timestamp:Date.now()};this.clicks=[],this.scrollData=[],this.mouseMoves=[],this.sendToBackend(e)}setAntiAdblockManager(e){this.antiAdblockManager=e}async sendToBackend(e){try{if(this.antiAdblockManager&&(await this.antiAdblockManager.send(e,"/api/heatmap/record")).success)return;(await fetch("/api/heatmap/track",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})).ok||console.warn("[Zaplier] Heatmap batch failed to send")}catch(e){console.warn("[Zaplier] Heatmap error:",e)}}getStats(){const e=this.clicks.filter(e=>e.rageClick).length;return{clickCount:this.clicks.length,maxScrollDepth:this.maxScrollDepth,isRecording:this.isActive,mouseMovements:this.mouseMoves.length,rageClicks:e}}enableMouseTracking(){this.config.trackMouseMoves||(this.config.trackMouseMoves=!0,this.isActive&&document.addEventListener("mousemove",this.handleMouseMove,{passive:!0}))}disableMouseTracking(){this.config.trackMouseMoves&&(this.config.trackMouseMoves=!1,document.removeEventListener("mousemove",this.handleMouseMove),this.mouseMoves=[])}isRecording(){return this.isActive}}class yt{constructor(e,t={}){this.events=[],this.sequence=0,this.isActive=!1,this.lastMouseMove=0,this.mouseMoveThrottle=100,this.handleClick=e=>{const t=e.target,n=this.getElementPath(t);this.addEvent({type:"click",timestamp:Date.now(),data:{x:e.clientX,y:e.clientY,element:n,button:e.button,ctrlKey:e.ctrlKey,shiftKey:e.shiftKey,altKey:e.altKey},sequence:this.sequence++})},this.handleScroll=()=>{this.addEvent({type:"scroll",timestamp:Date.now(),data:{x:window.pageXOffset||document.documentElement.scrollLeft,y:window.pageYOffset||document.documentElement.scrollTop},sequence:this.sequence++})},this.handleInput=e=>{const t=e.target,n=this.getElementPath(t);let o=t.value;this.config.maskSensitiveFields&&this.isSensitiveField(t)&&(o="*".repeat(o.length)),this.addEvent({type:"input",timestamp:Date.now(),data:{element:n,value:o,inputType:e.inputType},sequence:this.sequence++})},this.handleChange=e=>{const t=e.target,n=this.getElementPath(t);let o=t.value;this.config.maskSensitiveFields&&this.isSensitiveField(t)&&(o="*".repeat(o.length)),this.addEvent({type:"input",timestamp:Date.now(),data:{element:n,value:o,type:"change"},sequence:this.sequence++})},this.handleMouseMove=e=>{const t=Date.now();t-this.lastMouseMove<this.mouseMoveThrottle||(this.lastMouseMove=t,this.addEvent({type:"mouse",timestamp:t,data:{x:e.clientX,y:e.clientY},sequence:this.sequence++}))},this.handleViewportChange=()=>{this.addEvent({type:"viewport",timestamp:Date.now(),data:{width:window.innerWidth,height:window.innerHeight},sequence:this.sequence++})},this.handleNavigation=()=>{this.sendBatch()},this.sessionId=e,this.config={enabled:!0,sampleRate:.1,maskSensitiveFields:!0,maxEventBuffer:1e3,batchInterval:5e3,captureClicks:!0,captureScrolls:!0,captureInputs:!0,captureMouseMoves:!1,compressionEnabled:!0,...t}}start(){return!(!this.config.enabled||this.isActive||Math.random()>this.config.sampleRate||(this.isActive=!0,this.setupDOMObserver(),this.setupEventListeners(),this.startBatchTimer(),this.recordInitialState(),0))}stop(){this.isActive&&(this.isActive=!1,this.observer&&(this.observer.disconnect(),this.observer=void 0),this.removeEventListeners(),this.batchTimer&&(clearInterval(this.batchTimer),this.batchTimer=void 0),this.sendBatch())}setupDOMObserver(){"undefined"!=typeof MutationObserver&&(this.observer=new MutationObserver(e=>{const t=e.map(e=>this.serializeMutation(e)).filter(Boolean);t.length>0&&this.addEvent({type:"mutation",timestamp:Date.now(),data:{mutations:t},sequence:this.sequence++})}),this.observer.observe(document,{childList:!0,subtree:!0,attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0}))}setupEventListeners(){this.config.captureClicks&&document.addEventListener("click",this.handleClick,!0),this.config.captureScrolls&&(window.addEventListener("scroll",this.handleScroll,{passive:!0}),document.addEventListener("scroll",this.handleScroll,{passive:!0})),this.config.captureInputs&&(document.addEventListener("input",this.handleInput,!0),document.addEventListener("change",this.handleChange,!0)),this.config.captureMouseMoves&&document.addEventListener("mousemove",this.handleMouseMove,{passive:!0}),window.addEventListener("resize",this.handleViewportChange),window.addEventListener("orientationchange",this.handleViewportChange),window.addEventListener("beforeunload",this.handleNavigation),window.addEventListener("pagehide",this.handleNavigation)}removeEventListeners(){document.removeEventListener("click",this.handleClick,!0),window.removeEventListener("scroll",this.handleScroll),document.removeEventListener("scroll",this.handleScroll),document.removeEventListener("input",this.handleInput,!0),document.removeEventListener("change",this.handleChange,!0),document.removeEventListener("mousemove",this.handleMouseMove),window.removeEventListener("resize",this.handleViewportChange),window.removeEventListener("orientationchange",this.handleViewportChange),window.removeEventListener("beforeunload",this.handleNavigation),window.removeEventListener("pagehide",this.handleNavigation)}recordInitialState(){this.addEvent({type:"navigation",timestamp:Date.now(),data:{url:window.location.href,referrer:document.referrer,title:document.title,viewport:{width:window.innerWidth,height:window.innerHeight},screen:{width:window.screen?.width||0,height:window.screen?.height||0}},sequence:this.sequence++})}serializeMutation(e){const t={type:e.type,target:this.getElementPath(e.target)};switch(e.type){case"childList":t.addedNodes=Array.from(e.addedNodes).filter(e=>e.nodeType===Node.ELEMENT_NODE).map(e=>this.serializeElement(e)).slice(0,10),t.removedNodes=Array.from(e.removedNodes).filter(e=>e.nodeType===Node.ELEMENT_NODE).map(e=>this.getElementPath(e)).slice(0,10);break;case"attributes":t.attributeName=e.attributeName,t.oldValue=e.oldValue,t.newValue=e.target.getAttribute(e.attributeName);break;case"characterData":t.oldValue=e.oldValue,t.newValue=e.target.textContent}return t}serializeElement(e){const t={};for(const n of Array.from(e.attributes))this.isSensitiveAttribute(n.name)||(t[n.name]=n.value);return{tagName:e.tagName.toLowerCase(),attributes:t,textContent:e.textContent?.substring(0,1e3)||""}}getElementPath(e){const t=[];let n=e;for(;n&&n!==document.body;){let e=n.tagName.toLowerCase();if(n.id){e+=`#${n.id}`,t.unshift(e);break}n.className&&(e+=`.${n.className.toString().split(/\s+/).slice(0,2).join(".")}`),n.id||n.className||(e+=`:nth-child(${Array.from(n.parentElement?.children||[]).indexOf(n)+1})`),t.unshift(e),n=n.parentElement}return t.join(" > ")}isSensitiveField(e){const t=e.getAttribute("type")?.toLowerCase(),n=e.getAttribute("name")?.toLowerCase(),o=e.className.toLowerCase();return["password","email","tel","ssn","cc"].includes(t||"")||["password","email","phone","credit","card","ssn","social"].some(e=>n&&n.includes(e)||o.includes(e))}isSensitiveAttribute(e){return["data-token","data-key","data-secret","authorization"].includes(e.toLowerCase())}addEvent(e){this.events.push(e),this.events.length>this.config.maxEventBuffer&&(this.events=this.events.slice(-this.config.maxEventBuffer))}startBatchTimer(){this.batchTimer=window.setInterval(()=>{this.sendBatch()},this.config.batchInterval)}sendBatch(){if(0===this.events.length)return;const e=[...this.events];this.events=[];const t={sessionId:this.sessionId,events:e,metadata:{userAgent:navigator.userAgent,timestamp:Date.now(),compression:this.config.compressionEnabled}};this.sendToBackend(t)}setAntiAdblockManager(e){this.antiAdblockManager=e}async sendToBackend(e){try{if(this.antiAdblockManager&&(await this.antiAdblockManager.send(e,"/api/replay/record")).success)return;(await fetch("/api/replay/record",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})).ok||console.warn("[Zaplier] Session replay batch failed to send")}catch(e){console.warn("[Zaplier] Session replay error:",e)}}getEventCount(){return this.events.length}isRecording(){return this.isActive}}const vt={apiEndpoint:"https://api.zaplier.com",retryEnabled:!0,maxRetries:3,retryDelays:[1e3,2e3,4e3],autoTrack:!0,dedupeEnabled:!0,fingerprintEnabled:!0,presenceTracking:!1,heartbeatInterval:3e4,scrollTracking:!0,scrollDepthTracking:!0,gdprCompliant:!0,enhancedTracking:"ask",replaySampling:.1,replayMaskInputs:!0};class bt{constructor(e){if(this.version="3.0.0",this.isInitialized=!1,this.eventQueue=[],this.heatmap={enable:()=>{if(this.config.heatmap=!0,!this.heatmapEngine&&this.isInitialized){this.sessionId||(this.sessionId=this.generateSessionId());const e=this.sessionId;this.heatmapEngine=new wt(e,{trackClicks:!0,trackScrollDepth:!0,trackRageClicks:!0,trackMouseMoves:!1}),this.antiAdblockManager&&this.heatmapEngine.setAntiAdblockManager(this.antiAdblockManager),this.heatmapEngine.start()}this.config.debug&&console.log("[Zaplier] Heatmap enabled")},disable:()=>{this.config.heatmap=!1,this.heatmapEngine&&(this.heatmapEngine.stop(),this.heatmapEngine=void 0),this.config.debug&&console.log("[Zaplier] Heatmap disabled")},enableMouseTracking:()=>{this.heatmapEngine&&this.heatmapEngine.enableMouseTracking()},disableMouseTracking:()=>{this.heatmapEngine&&this.heatmapEngine.disableMouseTracking()},getStats:()=>this.heatmapEngine?this.heatmapEngine.getStats():null,isRecording:()=>!!this.heatmapEngine&&this.heatmapEngine.isRecording()},this.replay={enable:()=>{if(this.config.replay=!0,!this.replayEngine&&this.isInitialized){this.sessionId||(this.sessionId=this.generateSessionId());const e=this.sessionId;this.replayEngine=new yt(e,{sampleRate:this.config.replaySampling,maskSensitiveFields:this.config.replayMaskInputs,compressionEnabled:!0}),this.antiAdblockManager&&this.replayEngine.setAntiAdblockManager(this.antiAdblockManager),this.replayEngine.start()}this.config.debug&&console.log("[Zaplier] Replay enabled")},disable:()=>{this.config.replay=!1,this.replayEngine&&(this.replayEngine.stop(),this.replayEngine=void 0),this.config.debug&&console.log("[Zaplier] Replay disabled")},start:()=>{if(!this.replayEngine&&this.isInitialized){this.sessionId||(this.sessionId=this.generateSessionId());const e=this.sessionId;return this.replayEngine=new yt(e,{sampleRate:1,maskSensitiveFields:this.config.replayMaskInputs,compressionEnabled:!0}),this.antiAdblockManager&&this.replayEngine.setAntiAdblockManager(this.antiAdblockManager),this.replayEngine.start()}return!!this.replayEngine&&this.replayEngine.start()},stop:()=>{this.replayEngine&&this.replayEngine.stop()},isRecording:()=>!!this.replayEngine&&this.replayEngine.isRecording(),getEventCount:()=>this.replayEngine?this.replayEngine.getEventCount():0,addFunnelStep:e=>{this.sendEvent({eventType:"funnel_step",eventName:"funnel_step",customData:e})},markConversion:e=>{this.trackConversion("funnel_conversion",e.value,e.currency,e)}},!e.token)throw new Error("Zaplier: token is required");this.config={...vt,...e,gdprMode:e.gdprMode??!1},"undefined"!=typeof window&&this.initialize()}async initialize(){try{if(this.config.debug&&console.log("[Zaplier] Initializing SDK v"+this.version),!this.config.allow_localhost&&this.isLocalhost())return void(this.config.debug&&console.log("[Zaplier] Skipping tracking on localhost"));await this.collectFingerprint(),this.config.autoTrack&&this.trackPageView(),this.isInitialized=!0,this.initializeAntiAdblock(),this.initializeTrackingEngines(),this.processEventQueue(),this.config.debug&&console.log("[Zaplier] SDK initialized successfully",{visitorId:this.visitorId,gdprMode:this.config.gdprMode})}catch(e){console.error("[Zaplier] Initialization failed:",e)}}initializeTrackingEngines(){try{this.sessionId||(this.sessionId=this.generateSessionId(),this.config.debug&&console.log("[Zaplier] Generated session ID:",this.sessionId)),this.config.replay&&(this.replayEngine=new yt(this.sessionId,{sampleRate:this.config.replaySampling,maskSensitiveFields:this.config.replayMaskInputs,compressionEnabled:!0}),this.antiAdblockManager&&this.replayEngine.setAntiAdblockManager(this.antiAdblockManager),this.replayEngine.start(),this.config.debug&&console.log("[Zaplier] Session Replay started")),this.config.heatmap&&(this.heatmapEngine=new wt(this.sessionId,{trackClicks:!0,trackScrollDepth:!0,trackRageClicks:!0,trackMouseMoves:!1}),this.antiAdblockManager&&this.heatmapEngine.setAntiAdblockManager(this.antiAdblockManager),this.heatmapEngine.start(),this.config.debug&&console.log("[Zaplier] Heatmap tracking started"))}catch(e){console.error("[Zaplier] Failed to initialize tracking engines:",e)}}generateSessionId(){const e=performance.timeOrigin||Date.now(),t=this.getBrowserFingerprint();return e.toString(36)+t.substring(0,8)}getBrowserFingerprint(){const e=[navigator.userAgent||"",navigator.platform||"",screen.width||0,screen.height||0,new Date(2024,0,1).getTimezoneOffset(),navigator.language||"",navigator.hardwareConcurrency||0].join("|");let t=0;for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n)&4294967295;return Math.abs(t).toString(36)}initializeAntiAdblock(){try{this.antiAdblockManager=new pt(this.config.apiEndpoint,this.config.token,{enabled:!0,methods:["elysia-websocket","fetch","resource"],fallbackDelay:100,maxRetries:2,debug:this.config.debug}),this.config.debug&&console.log("[Zaplier] Anti-Adblock Manager initialized")}catch(e){console.error("[Zaplier] Failed to initialize Anti-Adblock Manager:",e)}}async collectFingerprint(){try{const e=this.config.gdprMode?await ut():await dt();if(!e.success||!e.data)throw new Error("Fingerprint collection failed");this.fingerprint=e.data,e.data.incognitoDetection&&(this.fingerprint.incognitoDetection={...e.data.incognitoDetection,detectionTimestamp:Date.now(),sdkVersion:this.version}),this.config.debug&&console.log("[Zaplier] Fingerprint collected:",{components:e.collectedComponents,hashes:{full:e.data.hash,stableCore:e.data.stableCoreHash},gdprMode:this.config.gdprMode,incognitoDetected:e.data.incognitoDetection?.isIncognito,incognitoConfidence:e.data.incognitoDetection?.confidence})}catch(e){this.config.debug&&console.error("[Zaplier] Fingerprint collection failed:",e);try{const e=[navigator.userAgent||"",navigator.language||"",navigator.platform||"",screen.width||0,screen.height||0,screen.colorDepth||0,new Date(2024,0,1).getTimezoneOffset(),navigator.hardwareConcurrency||0,navigator.deviceMemory||0,navigator.maxTouchPoints||0,performance.timeOrigin||0,navigator.plugins?navigator.plugins.length:0,navigator.mimeTypes?navigator.mimeTypes.length:0,Math.floor((performance.memory?.usedJSHeapSize||0)/1e6),Math.floor((performance.memory?.totalJSHeapSize||0)/1e6),navigator.connection?.effectiveType||"",Math.floor(navigator.connection?.downlink||0),window.outerHeight||0,window.outerWidth||0,Math.floor(100*(window.devicePixelRatio||1))/100,"function"==typeof document.createElement("canvas").getContext?1:0].join("|");let t=0;for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n)&4294967295;const n=Math.abs(t).toString(36);let o=0;const i=e+n;for(let e=0;e<i.length;e++)o=(o<<5)-o+i.charCodeAt(e)&4294967295,o^=o>>>16;this.fingerprint||(this.fingerprint={}),this.fingerprint.fallbackEntropy=Math.abs(o).toString(36)}catch{}}}isLocalhost(){return!("undefined"==typeof window||!window.location)&&("localhost"===window.location.hostname||"127.0.0.1"===window.location.hostname||window.location.hostname.startsWith("192.168.")||window.location.hostname.startsWith("10.")||window.location.hostname.includes("local"))}async sendEvent(e){if(this.isInitialized)try{const t={fingerprintHash:this.fingerprint?.hash,stableCoreHash:this.fingerprint?.stableCoreHash,stableCoreVector:this.fingerprint?.stableCoreVector,fingerprintVector:this.fingerprint||void 0,incognitoDetection:this.fingerprint?.incognitoDetection&&(void 0!==this.fingerprint.incognitoDetection.likelihood||this.fingerprint.incognitoDetection.methods&&this.fingerprint.incognitoDetection.methods.length>0)?this.fingerprint.incognitoDetection:void 0,isSafari:"undefined"!=typeof navigator&&/safari/i.test(navigator.userAgent)&&!/chrome|chromium|opr|edg|edge/i.test(navigator.userAgent),ch:navigator.userAgentData?{brands:navigator.userAgentData.brands||[],platform:navigator.userAgentData.platform||void 0,mobile:navigator.userAgentData.mobile||void 0,model:navigator.userAgentData.model||void 0}:void 0,fingerprintComponents:this.fingerprint?.components||{},...e,timestamp:(new Date).toISOString(),url:"undefined"!=typeof window&&window.location?window.location.href:"",referrer:"undefined"!=typeof document?document.referrer:"",pageTitle:"undefined"!=typeof document?document.title:"",userAgent:"undefined"!=typeof navigator?navigator.userAgent:"",screenWidth:this.fingerprint?.screen?.value?.width||("undefined"!=typeof window&&window.screen?window.screen.width:0),screenHeight:this.fingerprint?.screen?.value?.height||("undefined"!=typeof window&&window.screen?window.screen.height:0),viewportWidth:this.fingerprint?.screen?.value?.viewportWidth||("undefined"!=typeof window?window.innerWidth:0),viewportHeight:this.fingerprint?.screen?.value?.viewportHeight||("undefined"!=typeof window?window.innerHeight:0),gdprMode:this.config.gdprMode},n=await this.makeRequest(`/tracking/event?token=${encodeURIComponent(this.config.token)}`,t);return n.visitorId&&(this.backendVisitorId=n.visitorId,this.config.debug&&console.log("[Zaplier] Backend visitor ID received:",n.visitorId)),n.sessionId&&(this.sessionId=n.sessionId),n}catch(t){this.config.debug&&console.error("[Zaplier] Event sending failed:",t),this.config.retryEnabled&&setTimeout(()=>this.sendEvent(e),5e3)}else this.eventQueue.push(e)}async makeRequest(e,t,n="POST"){const o=`${this.config.apiEndpoint}${e}`,i={method:n,headers:{"Content-Type":"application/json"}};"POST"===n&&t&&(i.body=JSON.stringify(t));try{const e=Promise.race([fetch(o,i),new Promise((e,t)=>setTimeout(()=>t(new Error("Fetch timeout - possibly blocked")),5e3))]),t=await e;if(!t.ok)throw new Error(`HTTP ${t.status}: ${t.statusText}`);return await t.json()}catch(o){if(this.antiAdblockManager&&"POST"===n){this.config.debug&&console.warn(`[Zaplier] Standard fetch failed (${o instanceof Error?o.message:String(o)}), trying anti-adblock fallback`);try{const n=await this.antiAdblockManager.send(t,e);if(n.success)return this.config.debug&&console.log(`[Zaplier] Request sent via ${n.method} (${n.latency}ms) as fallback`),{success:!0,method:n.method}}catch(e){this.config.debug&&console.warn("[Zaplier] Both standard fetch and anti-adblock failed:",e)}}throw o}}processEventQueue(){for(;this.eventQueue.length>0;){const e=this.eventQueue.shift();this.sendEvent(e)}}track(e,t){this.sendEvent({eventType:e,eventName:e,customData:t})}trackCustomEvent(e,t){return this.sendEvent({eventType:"custom",eventName:e,customData:t}),!0}trackConversion(e,t,n,o){return this.sendEvent({eventType:"conversion",eventName:e,revenue:t,currency:n||"USD",customData:o}),!0}trackPageView(e){this.sendEvent({eventType:"page_view",eventName:"page_view",...e})}trackPurchase(e){this.sendEvent({eventType:"purchase",eventName:"purchase",revenue:e.value||e.revenue,currency:e.currency||"USD",quantity:e.quantity||1,productId:e.productId,customData:{productName:e.productName,orderId:e.orderId,...e.customData}})}trackAddToCart(e){this.sendEvent({eventType:"add_to_cart",eventName:"add_to_cart",revenue:e?.price,quantity:e?.quantity||1,productId:e?.productId,customData:{productName:e?.productName,...e?.customData}})}trackViewContent(e){this.sendEvent({eventType:"view_content",eventName:"view_content",productId:e?.productId,customData:{productName:e?.productName,category:e?.category,...e?.customData}})}trackInitiateCheckout(e){this.sendEvent({eventType:"initiate_checkout",eventName:"initiate_checkout",revenue:e?.value,currency:e?.currency||"USD",quantity:e?.numItems,customData:e?.customData})}trackLead(e){this.sendEvent({eventType:"lead",eventName:"lead",customData:e})}identify(e){this.sendEvent({eventType:"identify",eventName:"identify",email:e.email,phone:e.phone,customData:e})}trackSPANavigation(e,t){this.trackPageView({url:e||("undefined"!=typeof window&&window.location?window.location.href:""),pageTitle:t||("undefined"!=typeof document?document.title:"")})}resetScrollTracking(){this.config.debug&&console.log("[Zaplier] Scroll tracking reset")}startPresenceTracking(){this.config.presenceTracking=!0,this.config.debug&&console.log("[Zaplier] Presence tracking started")}stopPresenceTracking(){this.config.presenceTracking=!1,this.config.debug&&console.log("[Zaplier] Presence tracking stopped")}enableEnhancedTracking(){return this.config.enhancedTracking="true",this.config.gdprMode=!1,this.collectFingerprint(),this.config.debug&&console.log("[Zaplier] Enhanced tracking enabled"),!0}disableEnhancedTracking(){this.config.enhancedTracking="false",this.config.gdprMode=!0,this.config.debug&&console.log("[Zaplier] Enhanced tracking disabled")}isEnhancedMode(){return"true"===this.config.enhancedTracking&&!this.config.gdprMode}getVisitorId(){return this.backendVisitorId||this.visitorId||null}async getVisitorInfo(){const e=this.backendVisitorId;if(!e)return this.config.debug&&console.warn("[Zaplier] No backend visitor ID available. Track an event first and wait for the response."),null;if(!/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(e))return this.config.debug&&console.warn("[Zaplier] Invalid visitor ID format. Expected UUID, got:",e),null;try{return await this.makeRequest(`/tracking/visitor/${e}?token=${encodeURIComponent(this.config.token)}`,null,"GET")}catch(e){return this.config.debug&&console.error("[Zaplier] Failed to get visitor info:",e),null}}async getVisitorHistory(){const e=this.backendVisitorId;if(!e)return this.config.debug&&console.warn("[Zaplier] No backend visitor ID available. Track an event first and wait for the response."),null;if(!/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(e))return this.config.debug&&console.warn("[Zaplier] Invalid visitor ID format. Expected UUID, got:",e),null;try{return await this.makeRequest(`/tracking/visitor/${e}/history?token=${encodeURIComponent(this.config.token)}`,null,"GET")}catch(e){return this.config.debug&&console.error("[Zaplier] Failed to get visitor history:",e),null}}getUserData(){const e="undefined"!=typeof window&&"undefined"!=typeof navigator?{userAgent:navigator.userAgent||"",language:navigator.language||"",screen:{width:window.screen?.width||0,height:window.screen?.height||0}}:{userAgent:"",language:"",screen:{width:0,height:0}};return{sessionId:this.sessionId||"",visitorId:this.getVisitorId()||void 0,location:{},device:e,journey:[],fingerprint:this.fingerprint?.hash}}getConversionLikelihood(){return{score:.5,factors:["Requires backend analysis"]}}getUserSegment(){return{type:"medium_intent",confidence:.5}}}let St=null;const kt={init:e=>St?(console.warn("[Zaplier] SDK already initialized"),St):(St=new bt(e),St),getInstance:()=>St,track:(e,t)=>{St?St.track(e,t):console.warn("[Zaplier] SDK not initialized. Call Zaplier.init() first")},trackPageView:e=>{St?St.trackPageView(e):console.warn("[Zaplier] SDK not initialized. Call Zaplier.init() first")},trackEvent:(e,t)=>St?St.trackCustomEvent(e,t):(console.warn("[Zaplier] SDK not initialized. Call Zaplier.init() first"),!1),trackConversion:(e,t,n,o)=>{St?St.trackConversion(e,t,n,o):console.warn("[Zaplier] SDK not initialized. Call Zaplier.init() first")},trackPurchase:e=>{St?St.trackPurchase(e):console.warn("[Zaplier] SDK not initialized. Call Zaplier.init() first")},trackAddToCart:e=>{St?St.trackAddToCart(e):console.warn("[Zaplier] SDK not initialized. Call Zaplier.init() first")},identify:e=>{St?St.identify(e):console.warn("[Zaplier] SDK not initialized. Call Zaplier.init() first")},getVisitorId:()=>St?St.getVisitorId():null,getVisitorInfo:()=>St?St.getVisitorInfo():Promise.resolve(null),getUserData:()=>St?St.getUserData():null,enableEnhancedTracking:()=>St?St.enableEnhancedTracking():(console.warn("[Zaplier] SDK not initialized. Call Zaplier.init() first"),!1),disableEnhancedTracking:()=>{St?St.disableEnhancedTracking():console.warn("[Zaplier] SDK not initialized. Call Zaplier.init() first")},isEnhancedMode:()=>!!St&&St.isEnhancedMode(),heatmap:{enable:()=>{St?St.heatmap.enable():console.warn("[Zaplier] SDK not initialized. Call Zaplier.init() first")},disable:()=>{St?St.heatmap.disable():console.warn("[Zaplier] SDK not initialized. Call Zaplier.init() first")},enableMouseTracking:()=>{St?St.heatmap.enableMouseTracking():console.warn("[Zaplier] SDK not initialized. Call Zaplier.init() first")},disableMouseTracking:()=>{St?St.heatmap.disableMouseTracking():console.warn("[Zaplier] SDK not initialized. Call Zaplier.init() first")},getStats:()=>St?St.heatmap.getStats():null,isRecording:()=>!!St&&St.heatmap.isRecording()},replay:{enable:()=>{St?St.replay.enable():console.warn("[Zaplier] SDK not initialized. Call Zaplier.init() first")},disable:()=>{St?St.replay.disable():console.warn("[Zaplier] SDK not initialized. Call Zaplier.init() first")},start:()=>St?St.replay.start():(console.warn("[Zaplier] SDK not initialized. Call Zaplier.init() first"),!1),stop:()=>{St?St.replay.stop():console.warn("[Zaplier] SDK not initialized. Call Zaplier.init() first")},isRecording:()=>!!St&&St.replay.isRecording(),getEventCount:()=>St?St.replay.getEventCount():0,addFunnelStep:e=>{St?St.replay.addFunnelStep(e):console.warn("[Zaplier] SDK not initialized. Call Zaplier.init() first")},markConversion:e=>{St?St.replay.markConversion(e):console.warn("[Zaplier] SDK not initialized. Call Zaplier.init() first")}},debug:{getStats:()=>St&&St.antiAdblockManager?St.antiAdblockManager.getStats():null,getSuccessRates:()=>St&&St.antiAdblockManager?St.antiAdblockManager.getSuccessRates():null,testTransports:()=>St&&St.antiAdblockManager?St.antiAdblockManager.testTransports():Promise.resolve(null)},version:"3.0.0"};function Et(){if("undefined"==typeof window||"undefined"==typeof document)return;const e=document.getElementsByTagName("script");let t=null;for(const n of Array.from(e))if(n.src&&(n.src.includes("zaplier")||n.src.includes("sdk.js")||n.src.includes("sdk.min.js"))&&n.dataset.token){t=n;break}if(!t||!t.dataset.token)return;const n={token:t.dataset.token,debug:"true"===t.dataset.debug,gdprMode:"true"===t.dataset.gdprMode,heatmap:"true"===t.dataset.heatmap,replay:"true"===t.dataset.replay,allow_localhost:"true"===t.dataset.allowLocalhost};try{kt.init(n),n.debug&&console.log("[Zaplier] Auto-initialized from script tag",n)}catch(e){console.error("[Zaplier] Auto-initialization failed:",e)}}"undefined"!=typeof window&&(window.Zaplier=kt,"loading"===document.readyState?document.addEventListener("DOMContentLoaded",Et):Et());const _t=[/HeadlessChrome/i,/PhantomJS/i,/SlimerJS/i,/Selenium/i,/WebDriver/i,/ChromeDriver/i,/GeckoDriver/i,/bot/i,/crawler/i,/spider/i,/scraper/i,/Googlebot/i,/Bingbot/i,/Slurp/i,/DuckDuckBot/i,/Baiduspider/i,/YandexBot/i,/facebookexternalhit/i,/Twitterbot/i,/LinkedInBot/i,/WhatsApp/i,/SkypeUriPreview/i],At=[/^Mozilla\/5\.0$/,/Headless/i,/automated/i,/testing/i,/^$/];function Mt(){try{if(!0===navigator.webdriver)return{detected:!0,confidence:95,method:"navigator.webdriver_true"};if(!0===window.webdriver)return{detected:!0,confidence:90,method:"window.webdriver_true"};const e=["_selenium","callSelenium","_Selenium_IDE_Recorder","callPhantom","_phantom","__phantomas","__fxdriver_evaluate","__fxdriver_unwrapped","_fxdriver_evaluate","_fxdriver_unwrapped"];for(const t of e)if(t in window||t in document)return{detected:!0,confidence:85,method:`selenium_property_${t}`};return document.documentElement.getAttribute("webdriver")?{detected:!0,confidence:80,method:"document_webdriver_attribute"}:{detected:!1,confidence:0,method:"webdriver_not_detected"}}catch(e){return{detected:!1,confidence:0,method:"webdriver_error",details:{error:e instanceof Error?e.message:"Unknown"}}}}function Tt(){try{let e=0;const t=[];window.outerHeight&&window.outerWidth||(e++,t.push("missing_outer_dimensions")),0===navigator.plugins.length&&(e++,t.push("no_plugins")),navigator.languages&&0!==navigator.languages.length||(e++,t.push("no_languages"));const n=navigator.userAgent;return(!n||n.length<50)&&(e++,t.push("short_user_agent")),void 0===Notification?.permission&&(e++,t.push("no_notification_permission")),window.performance&&window.performance.timing||(e++,t.push("missing_performance_api")),n.includes("Chrome")&&(window.chrome||(e++,t.push("missing_chrome_object")),n.includes("HeadlessChrome"))?{detected:!0,confidence:95,method:"chrome_headless_user_agent"}:{detected:e>=3,confidence:Math.min(15*e,90),method:"headless_characteristics",details:{issues:t,suspiciousCount:e}}}catch(e){return{detected:!1,confidence:0,method:"headless_detection_error",details:{error:e instanceof Error?e.message:"Unknown"}}}}function Ct(){try{const e=["webdriver","selenium","phantomjs","slimerjs","chromedriver","geckodriver","automation","puppeteer"],t=[];for(const n of e)(window[n]||window[`_${n}`]||window[`__${n}`])&&t.push(n);for(const n of e)(document[n]||document[`_${n}`]||document[`__${n}`])&&t.push(n);try{window.navigator||t.push("navigation_missing")}catch(e){const n=e instanceof Error?e.message:"";(n.includes("automation")||n.includes("webdriver"))&&t.push("navigation_automation_error")}return t.length>0?{detected:!0,confidence:Math.min(30*t.length,95),method:"automation_tools_detected",details:{tools:t}}:{detected:!1,confidence:0,method:"no_automation_tools"}}catch(e){return{detected:!1,confidence:0,method:"automation_detection_error",details:{error:e instanceof Error?e.message:"Unknown"}}}}function xt(){try{const e=["#ad-banner",".advertisement",".google-ads",".adsense","#google-analytics",".analytics",'[src*="google-analytics"]','[src*="googletagmanager"]',".facebook-widget",".twitter-widget",".social-share"];let t=0;for(const n of e)document.querySelector(n)||t++;try{const e=document.createElement("img");e.src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",e.style.display="none",document.body.appendChild(e),setTimeout(()=>{e.parentNode&&e.parentNode.removeChild(e)},100)}catch{t++}return{detected:t>=2,confidence:Math.min(20*t,80),method:"dom_blockers",details:{blockedCount:t,totalTests:e.length+1}}}catch(e){return{detected:!1,confidence:0,method:"dom_blocker_error",details:{error:e instanceof Error?e.message:"Unknown"}}}}function Rt(){try{return navigator.languages&&0!==navigator.languages.length?1===navigator.languages.length&&"en-US"===navigator.languages[0]?{detected:!0,confidence:40,method:"single_default_language"}:navigator.language!==navigator.languages[0]?{detected:!0,confidence:30,method:"inconsistent_languages",details:{language:navigator.language,firstLanguage:navigator.languages[0]}}:{detected:!1,confidence:0,method:"languages_normal",details:{languageCount:navigator.languages.length}}:{detected:!0,confidence:70,method:"no_languages"}}catch(e){return{detected:!0,confidence:50,method:"language_detection_error",details:{error:e instanceof Error?e.message:"Unknown"}}}}function Dt(){try{const e=new Function("return 2 + 2")();if(4!==e)return{detected:!0,confidence:90,method:"function_constructor_incorrect_result",details:{expected:4,actual:e}};const t=Function.toString();return t.includes("[native code]")||t.includes("function Function()")?{detected:!1,confidence:0,method:"eval_normal"}:{detected:!0,confidence:70,method:"function_constructor_modified_toString",details:{functionString:t.substring(0,100)}}}catch(e){return{detected:!0,confidence:60,method:"eval_error",details:{error:e instanceof Error?e.message:"Unknown"}}}}function It(){const e=navigator.userAgent,t=_t.filter(t=>t.test(e)),n=At.filter(t=>t.test(e));let o="legitimate";t.some(e=>e.source.includes("bot|crawler|spider"))?o="crawler":t.some(e=>e.source.includes("Selenium|WebDriver"))?o="automation":t.some(e=>e.source.includes("Headless|Phantom"))&&(o="headless");const i=[...t.map(e=>e.source),...n.map(e=>e.source)];return{browser:{name:"Unknown",version:"Unknown",major:"Unknown",engine:"unknown"},os:{name:"Unknown",version:"Unknown",family:"unknown"},device:{type:"desktop"},suspicious:{isBot:t.length>0||n.length>0,patterns:i,category:t.length>0?o:"legitimate"},isMobile:!1,isTablet:!1,isDesktop:!0,isBot:t.length>0||n.length>0,raw:e}}async function Pt(){try{const e="__incognito_test_"+Date.now(),t="test";localStorage.setItem(e,t);const n=localStorage.getItem(e);if(localStorage.removeItem(e),n!==t)return{detected:!0,confidence:80,method:"localStorage_inconsistency",details:{retrieved:n,expected:t}};try{const e="x".repeat(1048576);return localStorage.setItem("__capacity_test",e),localStorage.removeItem("__capacity_test"),{detected:!1,confidence:30,method:"localStorage_capacity"}}catch(e){return{detected:!0,confidence:60,method:"localStorage_capacity_limited",details:{error:e instanceof Error?e.message:"Unknown"}}}}catch(e){return{detected:!0,confidence:90,method:"localStorage_unavailable",details:{error:e instanceof Error?e.message:"Unknown"}}}}async function Lt(){try{const e="__session_test_"+Date.now(),t="test";sessionStorage.setItem(e,t);const n=sessionStorage.getItem(e);return sessionStorage.removeItem(e),n!==t?{detected:!0,confidence:75,method:"sessionStorage_inconsistency",details:{retrieved:n,expected:t}}:{detected:!1,confidence:20,method:"sessionStorage_working"}}catch(e){return{detected:!0,confidence:85,method:"sessionStorage_unavailable",details:{error:e instanceof Error?e.message:"Unknown"}}}}async function Ot(){try{return window.indexedDB?new Promise(e=>{const t="__incognito_test_"+Date.now(),n=indexedDB.open(t,1),o=setTimeout(()=>{e({detected:!0,confidence:60,method:"indexedDB_timeout"})},1e3);n.onerror=()=>{clearTimeout(o),e({detected:!0,confidence:80,method:"indexedDB_error",details:{error:n.error?.message}})},n.onsuccess=()=>{clearTimeout(o),n.result.close(),indexedDB.deleteDatabase(t),e({detected:!1,confidence:25,method:"indexedDB_working"})},n.onblocked=()=>{clearTimeout(o),e({detected:!0,confidence:70,method:"indexedDB_blocked"})}}):{detected:!0,confidence:70,method:"indexedDB_unavailable"}}catch(e){return{detected:!0,confidence:85,method:"indexedDB_exception",details:{error:e instanceof Error?e.message:"Unknown"}}}}async function Nt(){try{if(!navigator.permissions)return{detected:!1,confidence:10,method:"permissions_unsupported"};const e=await navigator.permissions.query({name:"notifications"});return"denied"===e.state?{detected:!0,confidence:40,method:"permissions_notifications_denied",details:{state:e.state}}:{detected:!1,confidence:30,method:"permissions_working",details:{state:e.state}}}catch(e){return{detected:!0,confidence:50,method:"permissions_error",details:{error:e instanceof Error?e.message:"Unknown"}}}}async function Ft(){try{if(!navigator.storage||!navigator.storage.estimate)return{detected:!1,confidence:10,method:"quota_unsupported"};const e=await navigator.storage.estimate(),t=navigator.userAgent,n=/Chrome/.test(t)&&!/Edg|OPR/.test(t),o=/Safari/.test(t)&&!/Chrome/.test(t);let i,r;if(n?(i=157286400,r=125829120):o?(i=52428800,r=26214400):(i=104857600,r=52428800),e.quota){if(e.quota<=r)return{detected:!0,confidence:85,method:"quota_very_limited",details:{quota:e.quota,usage:e.usage,quotaMB:Math.round(e.quota/1048576),threshold:Math.round(r/1048576)}};if(e.quota<=i)return{detected:!0,confidence:65,method:"quota_limited",details:{quota:e.quota,usage:e.usage,quotaMB:Math.round(e.quota/1048576),threshold:Math.round(i/1048576)}}}return{detected:!1,confidence:30,method:"quota_normal",details:{quota:e.quota,usage:e.usage,quotaMB:e.quota?Math.round(e.quota/1048576):null}}}catch(e){return{detected:!0,confidence:50,method:"quota_error",details:{error:e instanceof Error?e.message:"Unknown"}}}}async function Bt(){try{const e=navigator.userAgent;return/Chrome/.test(e)&&!/Edg|OPR/.test(e)?window.webkitRequestFileSystem?new Promise(e=>{const t=()=>{e({detected:!1,confidence:40,method:"chrome_filesystem_available"})},n=()=>{e({detected:!0,confidence:80,method:"chrome_filesystem_blocked"})};try{window.webkitRequestFileSystem(0,1,t,n)}catch(t){e({detected:!0,confidence:70,method:"chrome_filesystem_exception"})}setTimeout(()=>{e({detected:!1,confidence:20,method:"chrome_filesystem_timeout"})},1e3)}):{detected:!1,confidence:10,method:"chrome_filesystem_unsupported"}:{detected:!1,confidence:0,method:"chrome_detection_not_applicable"}}catch(e){return{detected:!1,confidence:10,method:"chrome_detection_error",details:{error:e instanceof Error?e.message:"Unknown"}}}}async function Ut(){try{const e=navigator.userAgent;if(!/Safari/.test(e)||/Chrome/.test(e))return{detected:!1,confidence:0,method:"safari_detection_not_applicable"};try{localStorage.setItem("__safari_test","test");const e=localStorage.length;if(localStorage.removeItem("__safari_test"),0===e)return{detected:!0,confidence:75,method:"safari_localStorage_blocked"}}catch(e){return{detected:!0,confidence:80,method:"safari_localStorage_exception"}}return window.indexedDB?{detected:!1,confidence:30,method:"safari_detection_normal"}:{detected:!0,confidence:70,method:"safari_indexedDB_missing"}}catch(e){return{detected:!1,confidence:10,method:"safari_detection_error",details:{error:e instanceof Error?e.message:"Unknown"}}}}async function Vt(){try{const e=window.requestFileSystem||window.webkitRequestFileSystem;return e?new Promise(t=>{e(window.TEMPORARY||0,1024,()=>{t({detected:!1,confidence:30,method:"filesystem_working"})},e=>{t({detected:!0,confidence:60,method:"filesystem_error",details:{error:e.name||"Unknown"}})}),setTimeout(()=>{t({detected:!0,confidence:50,method:"filesystem_timeout"})},1e3)}):{detected:!1,confidence:10,method:"filesystem_unsupported"}}catch(e){return{detected:!0,confidence:70,method:"filesystem_exception",details:{error:e instanceof Error?e.message:"Unknown"}}}}async function Ht(){try{const e=new Image,t=performance.now();return new Promise(n=>{const o=setTimeout(()=>{n({detected:!1,confidence:10,method:"cache_timeout"})},3e3);e.onload=()=>{clearTimeout(o);const e=performance.now()-t;n(e<5?{detected:!0,confidence:30,method:"cache_too_fast",details:{loadTime:e}}:{detected:!1,confidence:20,method:"cache_normal",details:{loadTime:e}})},e.onerror=()=>{clearTimeout(o),n({detected:!1,confidence:10,method:"cache_error"})},e.src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7"})}catch(e){return{detected:!1,confidence:10,method:"cache_exception",details:{error:e instanceof Error?e.message:"Unknown"}}}}function zt(e,t){return new Promise(n=>{setTimeout(()=>{n({detected:!1,confidence:0,method:`${t}_timeout`})},e)})}function Wt(){try{return"object"==typeof window.chrome&&null!==window.chrome&&"object"==typeof window.chrome.runtime}catch{return!1}}function jt(){return navigator.userAgent.includes("WebKit")&&!navigator.userAgent.includes("Chrome")}function qt(){return navigator.userAgent.includes("Gecko")&&!navigator.userAgent.includes("Chrome")}function Zt(){return navigator.userAgent.includes("SamsungBrowser")||navigator.userAgent.includes("Samsung Internet")}function Gt(){return navigator.userAgent.includes("iPad")||"MacIntel"===navigator.platform&&navigator.maxTouchPoints>1}function $t(){return navigator.userAgent.includes("Android")}function Xt(e,t){const n=e.match(t);return n&&n[1]||"Unknown"}function Kt(e){const t=e.toLowerCase();return t.includes("tablet")||Gt()?Gt()?{type:"tablet",vendor:"Apple",model:"iPad"}:t.includes("kindle")?{type:"tablet",vendor:"Amazon",model:"Kindle"}:{type:"tablet"}:t.includes("mobile")||t.includes("iphone")||t.includes("ipod")||$t()?t.includes("iphone")?{type:"mobile",vendor:"Apple",model:"iPhone"}:t.includes("ipod")?{type:"mobile",vendor:"Apple",model:"iPod"}:$t()&&t.includes("mobile")?{type:"mobile",vendor:"Android"}:{type:"mobile"}:{type:"desktop"}}var Jt=Object.freeze({__proto__:null,detectIncognitoHeuristics:async function(){const e=[];let t=0;const n=await async function(){try{const e="__incognito_test__",t=Date.now().toString();localStorage.setItem(e,t);const n=localStorage.getItem(e);return localStorage.removeItem(e),n===t}catch{return!1}}();n||(t+=.25,e.push("localStorage_blocked"));const o=await async function(){try{const e="__incognito_test__",t=Date.now().toString();sessionStorage.setItem(e,t);const n=sessionStorage.getItem(e);return sessionStorage.removeItem(e),n===t}catch{return!1}}();o||(t+=.2,e.push("sessionStorage_blocked"));const i=await async function(){try{return!!window.indexedDB&&new Promise(e=>{const t=indexedDB.open("__incognito_test__",1);t.onsuccess=()=>{t.result.close(),indexedDB.deleteDatabase("__incognito_test__"),e(!0)},t.onerror=()=>e(!1),t.onblocked=()=>e(!1)})}catch{return!1}}();i||(t+=.15,e.push("indexedDB_blocked"));const r=function(){try{const e="__incognito_test__",t=Date.now().toString();document.cookie=`${e}=${t}; SameSite=Strict; path=/`;const n=-1!==document.cookie.indexOf(`${e}=${t}`);return document.cookie=`${e}=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/`,n}catch{return!1}}();r||(t+=.2,e.push("cookies_blocked")),function(){try{return!(!Array.isArray(navigator.languages)||1!==navigator.languages.length||!navigator.language)&&navigator.languages[0]===navigator.language}catch{return!1}}()&&(t+=.25,e.push("languages_single_value"));try{if(n){const n="__incognito_persistence_test__",o="persist_test";localStorage.setItem(n,o);const i=localStorage.getItem(n)===o;localStorage.removeItem(n),i||(t+=.2,e.push("localStorage_not_persistent"))}}catch{}try{if(navigator.storage?.estimate){const n=await navigator.storage.estimate(),o=n?.quota||0,i=n?.usage||0;0===o?(t+=.3,e.push("storage_quota_zero")):o>0&&o<125829120&&(t+=.25,e.push("storage_quota_low")),0===i&&o>0&&(t+=.1,e.push("storage_usage_zero"))}else e.push("storage_estimate_unavailable")}catch{e.push("storage_estimate_error")}"serviceWorker"in navigator||(t+=.1,e.push("service_worker_absent")),"caches"in window||(t+=.05,e.push("cache_api_absent"));try{if(navigator.permissions?.query){const n=await navigator.permissions.query({name:"notifications"});"denied"===n?.state&&(t+=.05,e.push("notifications_denied"))}}catch{e.push("permissions_query_error")}(function(){try{return!!window.showOpenFilePicker}catch{return!1}})()||e.push("fs_access_absent"),"connection"in navigator||e.push("network_info_absent"),t=Math.max(0,Math.min(1,t));const a=[n,o,i,r].filter(e=>!e).length;return a>=3?t=Math.max(t,.85):a>=2&&(t=Math.max(t,.7)),e.includes("languages_single_value")&&(a>=1||t>=.2)&&(t=Math.max(t,.5)),{likelihood:t,methods:e}}});function Yt(){try{if("deviceMemory"in navigator){const e=navigator.deviceMemory;return"number"==typeof e?e:null}return null}catch{return null}}function Qt(){try{if("hardwareConcurrency"in navigator){const e=navigator.hardwareConcurrency;return"number"==typeof e?e:null}return null}catch{return null}}function en(){try{return[navigator.platform,navigator.userAgent,navigator.userAgent.includes("ARM")?"ARM":null,navigator.userAgent.includes("arm64")?"ARM64":null,navigator.userAgent.includes("aarch64")?"ARM64":null,navigator.userAgent.includes("x86_64")?"x86_64":null,navigator.userAgent.includes("WOW64")?"x86_64":null,navigator.userAgent.includes("Win64")?"x86_64":null,navigator.userAgent.includes("Intel")?"Intel":null].filter(Boolean).join("|")||"unknown"}catch{return"unknown"}}function tn(){try{return navigator.maxTouchPoints||0}catch{return 0}}var nn=Object.freeze({__proto__:null,getArchitecture:en,getDeviceMemory:Yt,getHardwareConcurrency:Qt,getHardwareFingerprint:function(){return{deviceMemory:Yt(),hardwareConcurrency:Qt(),architecture:en(),maxTouchPoints:tn(),platform:navigator.platform||"unknown"}},getMaxTouchPoints:tn,isHardwareDetectionAvailable:function(){return"undefined"!=typeof navigator}});function on(){try{if("undefined"!=typeof Intl&&Intl.DateTimeFormat){const e=Intl.DateTimeFormat().resolvedOptions().timeZone;if(e)return e}const e=new Date(2024,0,1).getTimezoneOffset();return`UTC${e>0?"-":"+"}${Math.abs(e/60)}`}catch{return"unknown"}}function rn(){try{const e=[];navigator.languages&&Array.isArray(navigator.languages)&&e.push(...navigator.languages),navigator.language&&e.push(navigator.language);const t=navigator.userLanguage||navigator.browserLanguage;return t&&e.push(t),[...new Set(e)]}catch{return["unknown"]}}function an(){try{if("undefined"!=typeof Intl&&Intl.DateTimeFormat){const e=(new Intl.DateTimeFormat).resolvedOptions();return{locale:e.locale||"unknown",calendar:e.calendar||"unknown",numberingSystem:e.numberingSystem||"unknown",timeZone:e.timeZone||"unknown"}}return{locale:"unknown"}}catch{return{locale:"unknown"}}}function sn(){try{const e={platform:navigator.platform||"unknown",oscpu:navigator.oscpu||null,vendor:navigator.vendor||null},t=navigator.userAgent;if(t.includes("Windows"))e.os="Windows",t.includes("Windows NT 10.0")?e.osVersion="10":t.includes("Windows NT 6.3")?e.osVersion="8.1":t.includes("Windows NT 6.2")?e.osVersion="8":t.includes("Windows NT 6.1")&&(e.osVersion="7");else if(t.includes("Macintosh")||t.includes("Mac OS")){e.os="macOS";const n=t.match(/Mac OS X ([0-9_]+)/);n&&n[1]&&(e.osVersion=n[1].replace(/_/g,"."))}else if(t.includes("Linux"))e.os="Linux";else if(t.includes("Android")){e.os="Android";const n=t.match(/Android ([0-9.]+)/);n&&n[1]&&(e.osVersion=n[1])}else if(t.includes("iOS")||t.includes("iPhone")||t.includes("iPad")){e.os="iOS";const n=t.match(/OS ([0-9_]+)/);n&&n[1]&&(e.osVersion=n[1].replace(/_/g,"."))}return e}catch{return{platform:"unknown"}}}var cn=Object.freeze({__proto__:null,getDateTimeLocale:an,getLanguages:rn,getPlatformExtended:sn,getSystemFingerprint:function(){return{timezone:on(),languages:rn(),dateTimeLocale:an(),platform:sn(),cookiesEnabled:navigator.cookieEnabled||!1}},getTimezone:on,isSystemDetectionAvailable:function(){return"undefined"!=typeof navigator}});function ln(){try{if("undefined"==typeof localStorage)return!1;const e="__rb_test__",t="test";localStorage.setItem(e,t);const n=localStorage.getItem(e);return localStorage.removeItem(e),n===t}catch(e){return"blocked"}}function un(){try{if("undefined"==typeof sessionStorage)return!1;const e="__rb_test__",t="test";sessionStorage.setItem(e,t);const n=sessionStorage.getItem(e);return sessionStorage.removeItem(e),n===t}catch(e){return"blocked"}}function dn(){return new Promise(e=>{try{if(!("indexedDB"in window))return void e(!1);const t="__rb_test_db__",n=indexedDB.open(t,1);let o=!1;const i=t=>{o||(o=!0,e(t))};setTimeout(()=>i("blocked"),1e3),n.onerror=()=>i("blocked"),n.onsuccess=()=>{try{n.result.close();const e=indexedDB.deleteDatabase(t);e.onsuccess=()=>i(!0),e.onerror=()=>i(!0)}catch{i("blocked")}},n.onupgradeneeded=()=>{try{const e=n.result;e.objectStoreNames.contains("test")||e.createObjectStore("test")}catch{i("blocked")}}}catch{e("blocked")}})}function hn(){try{return"openDatabase"in window&&"function"==typeof window.openDatabase}catch{return!1}}async function mn(){try{if("storage"in navigator&&"estimate"in navigator.storage){const e=await navigator.storage.estimate();return{quota:e.quota||null,usage:e.usage||null,available:e.quota&&e.usage?e.quota-e.usage:null}}return{}}catch{return{}}}var gn=Object.freeze({__proto__:null,getIndexedDBSupport:dn,getLocalStorageSupport:ln,getSessionStorageSupport:un,getStorageFingerprint:async function(){const[e,t]=await Promise.all([dn(),mn()]);return{localStorage:ln(),sessionStorage:un(),indexedDB:e,webSQL:hn(),quota:t}},getStorageQuota:mn,getWebSQLSupport:hn,isStorageDetectionAvailable:function(){return"undefined"!=typeof window}});function fn(){const e=Math,t=()=>0,n=e.acos||t,o=e.acosh||t,i=e.asin||t,r=e.asinh||t,a=e.atanh||t,s=e.atan||t,c=e.sin||t,l=e.sinh||t,u=e.cos||t,d=e.cosh||t,h=e.tan||t,m=e.tanh||t,g=e.exp||t,f=e.expm1||t,p=e.log1p||t,w=t=>e.pow(e.PI,t),y=t=>e.log(t+e.sqrt(t*t+1)),v=t=>e.log((1+t)/(1-t))/2,b=t=>(e.exp(t)-1/e.exp(t))/2,S=t=>(e.exp(t)+1/e.exp(t))/2,k=t=>e.exp(t)-1,E=t=>(e.exp(2*t)-1)/(e.exp(2*t)+1),_=t=>e.log(1+t);try{return{acos:n(.12312423423423424),asin:i(.12312423423423424),atan:s(.5),cos:u(10.000000000123),sin:c(-1e300),tan:h(-1e300),acosh:o(1e308),acoshPf:(A=1e154,e.log(A+e.sqrt(A*A-1))),asinh:r(1),asinhPf:y(1),atanh:a(.5),atanhPf:v(.5),cosh:d(1),coshPf:S(1),sinh:l(1),sinhPf:b(1),tanh:m(1),tanhPf:E(1),exp:g(1),expm1:f(1),expm1Pf:k(1),log1p:p(10),log1pPf:_(10),powPI:w(-100),sqrt:e.sqrt(2),cbrt:e.cbrt?e.cbrt(8):0,log:e.log(e.E),log10:e.log10?e.log10(10):0,log2:e.log2?e.log2(2):0,special_0:e.sin(e.PI),special_1:e.cos(e.PI/2),special_2:e.tan(e.PI/4),special_3:e.sqrt(-1),special_4:e.log(-1),special_5:1/0,special_6:NaN}}catch(t){return{error:1,basicMath:e.PI+e.E}}var A}function pn(){try{return{PI:Math.PI,E:Math.E,LN2:Math.LN2,LN10:Math.LN10,LOG2E:Math.LOG2E,LOG10E:Math.LOG10E,SQRT1_2:Math.SQRT1_2,SQRT2:Math.SQRT2}}catch{return{}}}function wn(){try{return{precision1:.1+.2,precision2:.3-.1,precision3:.1*3,precision4:1.1-.9,largeAdd:1e16,largeSub:1e16,tiny:Number.MIN_VALUE,epsilon:Number.EPSILON||2220446049250313e-31,maxValue:Number.MAX_VALUE,maxSafeInteger:Number.MAX_SAFE_INTEGER||9007199254740991,minSafeInteger:Number.MIN_SAFE_INTEGER||-9007199254740991}}catch{return{}}}var yn=Object.freeze({__proto__:null,getCompleteMathFingerprint:function(){return{operations:fn(),constants:pn(),floatingPoint:wn()}},getFloatingPointBehavior:wn,getMathConstants:pn,getMathFingerprint:fn,isMathDetectionAvailable:function(){return"undefined"!=typeof Math}});function vn(){const e=atob;return{adBlock:["#ad-banner",".advertisement",e("I2FkLWNvbnRhaW5lcg=="),e("LmFkdmVydGlzZW1lbnQ="),e("W2NsYXNzKj0iYWQtIl0=")],uBlockOrigin:["#ublock-stats",".adsbygoogle",e("I2dvb2dsZV9hZHM="),e("LmFkc2J5Z29vZ2xl"),e("LnVibG9jay1ibG9ja2Vk")],adGuardBase:[".BetterJsPopOverlay",e("I2FkXzMwMFgyNTA="),e("I2Jhbm5lcmZsb2F0"),e("I2NhbXBhaWduLWJhbm5lcg=="),e("I0FkLUNvbnRlbnQ=")],adGuardAnnoyances:[".hs-sosyal","#cookieconsentdiv",'div[class^="app_gdpr"]',".as-oil",'[data-cypress="soft-push-notification-modal"]'],easyList:[".yb-floorad",e("LndpZGdldF9wb19hZHNfd2lkZ2V0"),e("LnRyYWZmaWNqdW5reS1hZA=="),".textad_headline",e("LnNwb25zb3JlZC10ZXh0LWxpbmtz")],privacyBadger:["#privacy-badger-popup",".privacy-badger-blocked",e("LnByaXZhY3ktYmFkZ2Vy")],ghostery:["#ghostery-popup",".ghostery-blocking",e("Lmdob3N0ZXJ5LWJsb2NrZWQ=")],brave:["#brave-ads-blocked",".brave-blocked",e("LmJyYXZlLWFkLWJsb2Nr")],facebookContainer:[".facebook-container-blocked",e("LmZiLWJsb2NrZWQ=")],cookieBlockers:[".cookie-notice-blocked","#cookie-banner-hidden",e("LmNvb2tpZS1ibG9ja2Vy")],trackingProtection:[".tracking-blocked","#tracking-protection-enabled",e("LnRyYWNrZXItYmxvY2tlZA==")]}}function bn(e){const t=document.createElement("div");if(e.startsWith("#"))t.id=e.substring(1);else if(e.startsWith("."))t.className=e.substring(1);else if(e.includes("["))try{const n=e.match(/\[([^=]+)([*^$|~]?=)"([^"]+)"\]/);if(n&&n[1]&&n[3]){const[,e,o,i]=n;"*="===o?t.setAttribute(e,`test-${i}-test`):t.setAttribute(e,i)}}catch{t.className="test-element"}else t.className=e.replace(/[^a-zA-Z0-9-_]/g,"");return t}function Sn(e){const t=e.style;t.setProperty("visibility","hidden","important"),t.setProperty("display","block","important"),t.setProperty("position","absolute","important"),t.setProperty("left","-9999px","important"),t.setProperty("width","1px","important"),t.setProperty("height","1px","important"),t.setProperty("pointer-events","none","important"),t.setProperty("z-index","-1","important")}function kn(e){return new Promise(t=>setTimeout(t,e))}async function En(e){const t=document,n=t.createElement("div"),o=new Array(e.length),i={};Sn(n);const r=t.createDocumentFragment();for(let n=0;n<e.length;n++){const i=e[n];if(i)try{const e=bn(i),a=t.createElement("div");"DIALOG"===e.tagName&&e.show?.(),Sn(a),a.appendChild(e),r.appendChild(a),o[n]=e}catch(e){o[n]=void 0}}n.appendChild(r);let a=0;for(;!t.body&&a<100;)await kn(50),a++;if(!t.body)throw new Error("Document body not available for DOM blockers detection");t.body.appendChild(n);try{await kn(50),await new Promise(t=>{requestAnimationFrame(()=>{for(let t=0;t<e.length;t++){const n=o[t],r=e[t];n&&r&&!n.offsetParent&&(i[r]=!0)}t()})})}finally{try{n.parentNode&&n.parentNode.removeChild(n)}catch(e){setTimeout(()=>{try{n.parentNode&&n.parentNode.removeChild(n)}catch{}},0)}}return i}async function _n(e={}){const{debug:t=!1,timeout:n=5e3}=e;try{if(!An())return t&&console.log("[RabbitTracker] DOM Blockers detection not applicable for this browser"),"BROWSER_INCOMPATIBLE";if(!document||!document.body)return t&&console.log("[RabbitTracker] DOM not ready for blockers detection"),"DOM_NOT_AVAILABLE";const e=vn(),o=Object.keys(e),i=[].concat(...o.map(t=>e[t]||[])),r=new Promise((e,t)=>{setTimeout(()=>t(new Error("DOM blockers detection timeout")),n)}),a=await Promise.race([En(i),r]);return t&&console.log("[RabbitTracker] DOM Blockers Debug:",{totalSelectors:i.length,blockedCount:Object.keys(a).length,blockedSelectors:a}),o.filter(t=>{const n=e[t];return!(!n||0===n.length)&&n.map(e=>a[e]).filter(Boolean).length>.6*n.length}).sort()}catch(e){if(t&&console.error("[RabbitTracker] DOM Blockers detection failed:",e),e instanceof Error){if(e.message.includes("timeout"))return"TIMEOUT";if("SecurityError"===e.name||e.message.includes("SecurityError"))return"SECURITY_ERROR"}return"NOT_SUPPORTED"}}function An(){return F().canRunDOMBlockers}var Mn=Object.freeze({__proto__:null,getBlockedSelectors:En,getBlockerFilters:vn,getDomBlockers:_n,getDomBlockersFingerprint:async function(e={}){const t=await _n(e),n=Array.isArray(t)?t:[];return{activeBlockers:n,blockerCount:n.length,hasAdBlocker:n.some(e=>["adBlock","uBlockOrigin","adGuardBase","easyList"].includes(e)),hasPrivacyExtension:n.some(e=>["privacyBadger","ghostery","brave"].includes(e)),hasTrackingProtection:n.includes("trackingProtection")}},isDomBlockersDetectionAvailable:An});function Tn(){try{return M()?navigator.pdfViewerEnabled??null:null}catch{return null}}function Cn(){try{if(!x())return-1;const{ApplePaySession:e}=window;if("function"!=typeof e?.canMakePayments)return-1;if(!R())return-2;if(window.self!==window.top)return-3;try{return e.canMakePayments()?1:0}catch(e){if(e instanceof Error&&"InvalidAccessError"===e.name)return-2;throw e}}catch{return-1}}function xn(){try{return"attributionReporting"in window||"privateClickMeasurement"in window||null}catch{return null}}function Rn(){const e={enabled:!1,sameSiteSupport:!1,secureSupport:!1,partitionedSupport:!1};try{if(e.enabled=navigator.cookieEnabled,!e.enabled)return e;e.sameSiteSupport=Dn("__rb_test_samesite","SameSite=Strict"),R()&&(e.secureSupport=Dn("__rb_test_secure","Secure")),R()&&M()&&(e.partitionedSupport=Dn("__rb_test_partitioned","Partitioned; Secure; SameSite=None"))}catch{}return e}function Dn(e,t){try{const n="1",o=`${e}=${n}; ${t}; path=/`;document.cookie=o;const i=document.cookie.includes(`${e}=${n}`);return In(e),i}catch{return In(e),!1}}function In(e){try{const t=[`${e}=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/`,`${e}=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/; domain=${location.hostname}`,`${e}=; max-age=0; path=/`,`${e}=; max-age=0; path=/; domain=${location.hostname}`];for(const e of t)try{document.cookie=e}catch{}setTimeout(()=>{try{document.cookie=`${e}=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/`}catch{}},100)}catch{}}function Pn(){try{const e=document.createElement("canvas"),t=e.getContext("webgl")||e.getContext("experimental-webgl");return t?(t.getSupportedExtensions()||[]).sort():[]}catch{return[]}}function Ln(){try{const e=performance.memory;return e?{usedJSHeapSize:e.usedJSHeapSize,totalJSHeapSize:e.totalJSHeapSize,jsHeapSizeLimit:e.jsHeapSizeLimit}:null}catch{return null}}function On(){try{const e=navigator.connection||navigator.mozConnection||navigator.webkitConnection;return e?{effectiveType:e.effectiveType,downlink:e.downlink,rtt:e.rtt,saveData:e.saveData}:null}catch{return null}}function Nn(){const e={};try{e.webkitTemporaryStorage="webkitTemporaryStorage"in navigator,e.webkitPersistentStorage="webkitPersistentStorage"in navigator,window.safari&&(e.safariObjectTypes=Object.getOwnPropertyNames(window.safari)),e.chromeRuntime=!!window.chrome?.runtime,e.mozInnerScreenX="mozInnerScreenX"in window,e.msCredentials="msCredentials"in navigator}catch{}return e}var Fn=Object.freeze({__proto__:null,getApplePayState:Cn,getBrowserApisFingerprint:function(){const e=Tn(),t=Cn(),n=xn(),o=Rn(),i=Pn(),r=Ln(),a=On(),s=Nn();let c="unknown";s.chromeRuntime?c="chrome":-1!==t?c="safari":s.mozInnerScreenX?c="firefox":s.msCredentials&&(c="edge");const l=Boolean(e||t>-1||n||r||a),u=[null!==e,-1!==t,null!==n,o.enabled,i.length>0,null!==r,null!==a,Object.keys(s).length>0];return{pdfViewerEnabled:e,applePayState:t,privateClickMeasurement:n,cookieCapabilities:o,webglExtensions:i,performanceMemory:r,connectionInfo:a,vendorProperties:s,browserVendor:c,hasNativeFeatures:l,apiScore:Math.round(u.filter(Boolean).length/u.length*100)}},getConnectionInfo:On,getCookieCapabilities:Rn,getPdfViewerEnabled:Tn,getPerformanceMemory:Ln,getPrivateClickMeasurement:xn,getVendorProperties:Nn,getWebGLExtensions:Pn,isBrowserApisDetectionAvailable:function(){return"undefined"!=typeof window&&"undefined"!=typeof navigator}});function Bn(){try{if(!Xn())return"NOT_SUPPORTED";const e=function(){try{return navigator.plugins||null}catch(e){if("SecurityError"===e.name)return null;throw e}}();if(!e)return"NAVIGATOR_UNAVAILABLE";const t=[];if(0===e.length)return t;for(let n=0;n<e.length;n++){const o=e[n];if(!o)continue;const i=[];if(o.length>0)for(let e=0;e<o.length;e++){const t=o[e];t&&t.type&&i.push(t.type)}t.push({name:o.name||"",filename:o.filename||"",description:o.description||"",version:o.version||void 0,mimeTypes:i})}return t.sort((e,t)=>e.name.localeCompare(t.name))}catch(e){return"SecurityError"===e.name?"SECURITY_RESTRICTED":[]}}function Un(){try{if(!navigator.mimeTypes||0===navigator.mimeTypes.length)return[];const e=[];for(let t=0;t<navigator.mimeTypes.length;t++){const n=navigator.mimeTypes[t];n&&n.type&&e.push(n.type)}return e.sort()}catch{return[]}}function Vn(){try{if(navigator.plugins&&Array.from(navigator.plugins).some(e=>e.name.toLowerCase().includes("flash")||e.description.toLowerCase().includes("flash")))return!0;if(navigator.mimeTypes&&Array.from(navigator.mimeTypes).some(e=>"application/x-shockwave-flash"===e.type))return!0;if(void 0!==window.ActiveXObject)try{return!!new window.ActiveXObject("ShockwaveFlash.ShockwaveFlash")}catch{return!1}return!1}catch{return!1}}function Hn(){try{if(navigator.plugins&&Array.from(navigator.plugins).some(e=>e.name.toLowerCase().includes("java")&&!e.name.toLowerCase().includes("javascript")))return!0;const e=["application/x-java-applet","application/x-java-bean","application/x-java-vm"];return!(!navigator.mimeTypes||!e.some(e=>Array.from(navigator.mimeTypes).some(t=>t.type===e)))||"function"==typeof navigator.javaEnabled&&navigator.javaEnabled()}catch{return!1}}function zn(){try{if(navigator.plugins&&Array.from(navigator.plugins).some(e=>e.name.toLowerCase().includes("silverlight")))return!0;if(navigator.mimeTypes&&Array.from(navigator.mimeTypes).some(e=>"application/x-silverlight"===e.type))return!0;if(void 0!==window.ActiveXObject)try{return!!new window.ActiveXObject("AgControl.AgControl")}catch{return!1}return!1}catch{return!1}}function Wn(){try{if(!M())return"NOT_SUPPORTED";if(!navigator.plugins)return"NAVIGATOR_UNAVAILABLE";const e=navigator.plugins.length;return 0===e||!window.chrome?.runtime&&!window.chrome?.webstore&&void 0!==window.chrome||!Array.from(navigator.plugins).some(e=>e.name.toLowerCase().includes("pdf")||e.name.toLowerCase().includes("chrome"))&&e<3}catch(e){return"SecurityError"===e.name&&"SECURITY_RESTRICTED"}}function jn(){try{if(!T())return"NOT_SUPPORTED";const e={mozInnerScreenX:"mozInnerScreenX"in window,mozPaintCount:"mozPaintCount"in window,mozApps:!!navigator.mozApps,buildID:!!navigator.buildID,oscpu:!!navigator.oscpu},t=Object.values(e).filter(Boolean).length;return 0===t||(navigator.plugins?0===navigator.plugins.length&&t<2:"NAVIGATOR_UNAVAILABLE")}catch(e){return"SecurityError"===e.name&&"SECURITY_RESTRICTED"}}function qn(e){const t=["antivirus","security","firewall","malware","protection","kaspersky","norton","mcafee","avast","avira","bitdefender","eset","sophos","symantec","trend micro","f-secure"];return e.filter(e=>t.some(t=>e.name.toLowerCase().includes(t)||e.description.toLowerCase().includes(t))).map(e=>e.name)}function Zn(e){const t=["adblock","adblocker","ad block","ublock","ghostery","privacy badger","disconnect","noscript","tracking protection"];return e.filter(e=>t.some(t=>e.name.toLowerCase().includes(t)||e.description.toLowerCase().includes(t))).map(e=>e.name)}function Gn(e,t,n,o){let i=50;return i+=10*e.length,i+=5*t.length,n&&(i-=15),o&&(i-=10),Math.max(0,Math.min(100,i))}function $n(e,t){const n=e.map(e=>e.name).sort(),o=t.slice(0,10).sort();return[`plugins:${n.length}`,`mimes:${t.length}`,...n.slice(0,5),...o.slice(0,5)].join("|")}function Xn(){return F().canRunBrowserAPIs&&"undefined"!=typeof navigator}var Kn=Object.freeze({__proto__:null,calculateSecurityScore:Gn,detectChromeExtensionsBlocked:Wn,detectFirefoxExtensionsBlocked:jn,generatePluginSignature:$n,getEnhancedPluginFingerprint:function(){const e=Bn(),t=Array.isArray(e)?e:[],n=Un(),o=Array.isArray(n)?n:[],i=Vn(),r=Hn(),a=zn(),s=Wn(),c="boolean"==typeof s&&s,l=jn(),u="boolean"==typeof l&&l,d=qn(t),h=Zn(t),m=$n(t,o),g=Gn(d,h,i,r);return{plugins:t,pluginCount:t.length,mimeTypes:o,mimeTypeCount:o.length,flashEnabled:i,javaEnabled:r,silverLightEnabled:a,chromeExtensionsBlocked:c,firefoxExtensionsBlocked:u,securityPlugins:d,adBlockerPlugins:h,pluginSignature:m,securityScore:g}},getMimeTypes:Un,getNavigatorPlugins:Bn,identifyAdBlockerPlugins:Zn,identifySecurityPlugins:qn,isEnhancedPluginDetectionAvailable:Xn,testFlashEnabled:Vn,testJavaEnabled:Hn,testSilverlightEnabled:zn});const Jn={canvas:{stability:.95,entropy:.9,uniqueness:.85,spoofResistance:.8},webgl:{stability:.92,entropy:.88,uniqueness:.82,spoofResistance:.85},audio:{stability:.9,entropy:.85,uniqueness:.8,spoofResistance:.9},hardware:{stability:.98,entropy:.7,uniqueness:.75,spoofResistance:.95},screen:{stability:.85,entropy:.6,uniqueness:.65,spoofResistance:.7},system:{stability:.8,entropy:.65,uniqueness:.7,spoofResistance:.6},browser:{stability:.75,entropy:.6,uniqueness:.65,spoofResistance:.5},fonts:{stability:.7,entropy:.75,uniqueness:.7,spoofResistance:.4},math:{stability:.95,entropy:.8,uniqueness:.9,spoofResistance:.95},storage:{stability:.6,entropy:.5,uniqueness:.6,spoofResistance:.3},incognito:{stability:.5,entropy:.4,uniqueness:.3,spoofResistance:.2},domBlockers:{stability:.8,entropy:.7,uniqueness:.6,spoofResistance:.9},accessibility:{stability:.9,entropy:.6,uniqueness:.7,spoofResistance:.85},browserApis:{stability:.85,entropy:.75,uniqueness:.8,spoofResistance:.7},pluginsEnhanced:{stability:.7,entropy:.65,uniqueness:.75,spoofResistance:.5},mathFingerprint:{stability:.99,entropy:.95,uniqueness:.9,spoofResistance:.98},fontPreferences:{stability:.92,entropy:.88,uniqueness:.85,spoofResistance:.75},dateTimeLocale:{stability:.95,entropy:.7,uniqueness:.75,spoofResistance:.8},accessibilityEnhanced:{stability:.93,entropy:.65,uniqueness:.8,spoofResistance:.9},enhancedFonts:{stability:.88,entropy:.85,uniqueness:.82,spoofResistance:.7}},Yn={domBlockers:{stability:.8,entropy:.7,uniqueness:.6,spoofResistance:.9},accessibility:{stability:.9,entropy:.6,uniqueness:.7,spoofResistance:.85},browserApis:{stability:.85,entropy:.75,uniqueness:.8,spoofResistance:.7}};function Qn(e){const t=Jn[e]||Yn[e];if(!t)return.5;const n=.3*t.stability+.25*t.entropy+.25*t.uniqueness+.2*t.spoofResistance;return Math.max(.1,Math.min(1,n))}var eo=Object.freeze({__proto__:null,ADVANCED_COMPONENT_CHARACTERISTICS:Yn,COMPONENT_CHARACTERISTICS:Jn,calculateComponentWeight:Qn,calculateConfidence:function(e,t={}){const{requireMinimumComponents:n=4,penalizeMissingCore:o=!0,adjustForIncognito:i=!0}=t,r=e.filter(e=>e.success),a=[];r.length<n&&a.push(`Collect at least ${n} components for reliable identification`);let s=0,c=0,l=0,u=0,d=0;const h=["canvas","webgl","audio","hardware"].filter(e=>!r.some(t=>t.component===e));for(const e of r){const t=Qn(e.component),n=Jn[e.component]||Yn[e.component];n&&(s+=t,c+=n.stability*t,l+=n.entropy*t,u+=n.uniqueness*t,d+=n.spoofResistance*t)}const m=s>0?c/s:0,g=s>0?l/s:0,f=s>0?d/s:0;let p,w,y=.35*m+.25*g+.25*(s>0?u/s:0)+.15*f,v=y;return o&&h.length>0&&(v-=.1*h.length,a.push(`Missing core components: ${h.join(", ")}`)),r.length<6&&(v-=.05*(6-r.length)),i&&r.some(e=>"incognito"===e.component)&&(v+=.02),r.filter(e=>["domBlockers","accessibility","browserApis","math"].includes(e.component)).length>=2&&(v+=.05),v=Math.max(0,Math.min(1,v)),v>=.995?(p=.995,w="Very High"):v>=.99?(p=.99,w="High"):v>=.95?(p=.95,w="Medium"):v>=.8?(p=.8,w="Low"):(p=.5,w="Very Low",a.push("Consider implementing additional fingerprinting techniques")),v<.95&&a.push("Enable all available fingerprinting components for better accuracy"),f<.6&&a.push("Include more spoof-resistant components like audio and WebGL"),g<.6&&a.push("Add high-entropy components like canvas and math fingerprinting"),{score:p,level:w,factors:{componentCount:r.length,weightedScore:Math.round(1e3*y)/1e3,stabilityScore:Math.round(1e3*m)/1e3,entropyScore:Math.round(1e3*g)/1e3,spoofResistanceScore:Math.round(1e3*f)/1e3},recommendations:a.slice(0,3)}}});function to(){try{const e=screen,t=e.availTop??0,n=e.availLeft??0,o=e.availWidth??e.width,i=e.availHeight??e.height,r=t||null,a=e.width-o-n||null,s=e.height-i-t||null,c=n||null;if(null===r&&null===a&&null===s&&null===c)return null;const l=e=>null===e?null:10*Math.round(e/10);return{top:l(r),right:l(a),bottom:l(s),left:l(c)}}catch{return null}}function no(){try{const e=navigator.platform?.toLowerCase()||"",t=navigator.userAgent?.toLowerCase()||"";if(e.includes("win")&&(t.includes("wow64")||t.includes("x64")||t.includes("x86_64")))return 0;if(e.includes("linux")&&(e.includes("x86_64")||t.includes("x86_64")))return 0;if(e.includes("mac")&&(e.includes("intel")||t.includes("intel mac")))return 0;if(e.includes("x86")||e.includes("x64")||e.includes("intel")||e.includes("amd64")||t.includes("x86")||t.includes("amd64"))return 0;if(e.includes("arm")||t.includes("arm")||t.includes("aarch64")||e.includes("aarch64"))return 255;try{const e=document.createElement("canvas"),t=e.getContext("webgl")||e.getContext("experimental-webgl");if(t&&"getExtension"in t&&"getParameter"in t){const e=t.getExtension("WEBGL_debug_renderer_info");if(e){const n=t.getParameter(e.UNMASKED_VENDOR_WEBGL)?.toLowerCase()||"",o=t.getParameter(e.UNMASKED_RENDERER_WEBGL)?.toLowerCase()||"";if(n.includes("intel")||n.includes("nvidia")||n.includes("amd")||o.includes("intel")||o.includes("nvidia")||o.includes("amd")||o.includes("radeon")||o.includes("geforce")||o.includes("quadro")||o.includes("iris")||o.includes("uhd")||o.includes("hd graphics"))return 0;if(o.includes("mali")||o.includes("adreno")||o.includes("powervr")||o.includes("tegra")||o.includes("apple gpu")||n.includes("arm")||o.includes("videocore"))return 255}}}catch{}try{const t=new Float32Array(1),n=new Uint8Array(t.buffer);t[0]=1/0,t[0]=t[0]-t[0];const o=n[3];return e.includes("linux"),o}catch{return}}catch{return}}function oo(){try{const e=navigator;let t=0;void 0!==e.maxTouchPoints?t=e.maxTouchPoints:void 0!==e.msMaxTouchPoints&&(t=e.msMaxTouchPoints);let n=!1;try{document.createEvent("TouchEvent"),n=!0}catch{n=!1}return{maxTouchPoints:t,touchEvent:n,touchStart:"ontouchstart"in window}}catch{return}}function io(){const e=[],t=["chrome","safari","__crWeb","__gCrWeb","yandex","__yb","__ybro","__firefox__","__edgeTrackingPreventionStatistics","webkit","oprt","samsungAr","ucweb","UCShellJava","puffinDevice"];for(const n of t){const t=window[n];t&&"object"==typeof t&&e.push(n)}return e.sort()}function ro(){try{const e=navigator.deviceMemory;if("number"==typeof e)return Math.round(e);if("string"==typeof e){const t=parseFloat(e);return isNaN(t)?void 0:Math.round(t)}return}catch{return}}function ao(){try{return screen.colorDepth||void 0}catch{return}}function so(){try{for(const e of["rec2020","p3","srgb"])if(window.matchMedia(`(color-gamut: ${e})`).matches)return e;return}catch{return}}var co=Object.freeze({__proto__:null,collectDeviceSignals:function(){return{screenFrame:to(),hardwareConcurrency:navigator.hardwareConcurrency||void 0,deviceMemory:ro(),architecture:no(),touchSupport:oo(),vendorFlavors:io(),cpuClass:navigator.cpuClass||void 0,colorDepth:ao(),colorGamut:so()}}});return e.Zaplier=kt,e.ZaplierSDK=bt,e.analyzeUserAgent=function(e){const t=e||navigator.userAgent||"",n=function(e){const t=e.toLowerCase();if(t.includes("edg/")){const t=Xt(e,/edg\/([0-9.]+)/i);return{name:"Edge",version:t,major:t.split(".")[0]||"Unknown",engine:"chromium"}}if(t.includes("edge/")){const t=Xt(e,/edge\/([0-9.]+)/i);return{name:"Edge Legacy",version:t,major:t.split(".")[0]||"Unknown",engine:"edgehtml"}}if(t.includes("brave/")||navigator.brave){const t=Xt(e,/chrome\/([0-9.]+)/i);return{name:"Brave",version:t,major:t.split(".")[0]||"Unknown",engine:"chromium"}}if(Zt()){const t=Xt(e,/samsungbrowser\/([0-9.]+)/i);return{name:"Samsung Internet",version:t,major:t.split(".")[0]||"Unknown",engine:"chromium"}}if(t.includes("chrome/")&&!t.includes("edg")){const t=Xt(e,/chrome\/([0-9.]+)/i);return{name:"Chrome",version:t,major:t.split(".")[0]||"Unknown",engine:"chromium"}}if(t.includes("firefox/")){const t=Xt(e,/firefox\/([0-9.]+)/i);return{name:"Firefox",version:t,major:t.split(".")[0]||"Unknown",engine:"gecko"}}if(t.includes("safari/")&&!t.includes("chrome")){const t=Xt(e,/version\/([0-9.]+)/i);return{name:"Safari",version:t,major:t.split(".")[0]||"Unknown",engine:"webkit"}}if(t.includes("opr/")||t.includes("opera/")){const t=Xt(e,/(?:opr|opera)\/([0-9.]+)/i);return{name:"Opera",version:t,major:t.split(".")[0]||"Unknown",engine:Wt()?"chromium":"unknown"}}if(t.includes("vivaldi/")){const t=Xt(e,/vivaldi\/([0-9.]+)/i);return{name:"Vivaldi",version:t,major:t.split(".")[0]||"Unknown",engine:"chromium"}}if(t.includes("yabrowser/")){const t=Xt(e,/yabrowser\/([0-9.]+)/i);return{name:"Yandex Browser",version:t,major:t.split(".")[0]||"Unknown",engine:"chromium"}}if(t.includes("msie")||t.includes("trident/")){const t=Xt(e,/(?:msie |rv:)([0-9.]+)/i);return{name:"Internet Explorer",version:t,major:t.split(".")[0]||"Unknown",engine:"trident"}}if(t.includes("ucbrowser/")){const t=Xt(e,/ucbrowser\/([0-9.]+)/i);return{name:"UC Browser",version:t,major:t.split(".")[0]||"Unknown",engine:"chromium"}}if(t.includes("qqbrowser/")){const t=Xt(e,/qqbrowser\/([0-9.]+)/i);return{name:"QQ Browser",version:t,major:t.split(".")[0]||"Unknown",engine:"chromium"}}return{name:"Unknown",version:"Unknown",major:"Unknown",engine:"unknown"}}(t),o=function(e){const t=e.toLowerCase();if(t.includes("windows nt")){const t=Xt(e,/windows nt ([0-9.]+)/i);let n="Windows";switch(t){case"10.0":n="Windows 10/11";break;case"6.3":n="Windows 8.1";break;case"6.2":n="Windows 8";break;case"6.1":n="Windows 7";break;case"6.0":n="Windows Vista";break;case"5.1":n="Windows XP";break;default:n="Windows"}return{name:n,version:t,family:"windows"}}return t.includes("mac os x")||t.includes("macos")?{name:"macOS",version:Xt(e,/mac os x ([0-9._]+)/i).replace(/_/g,"."),family:"macos"}:t.includes("iphone")||t.includes("ipad")||t.includes("ipod")||Gt()?{name:"iOS",version:Xt(e,/os ([0-9._]+)/i).replace(/_/g,"."),family:"ios"}:$t()?{name:"Android",version:Xt(e,/android ([0-9.]+)/i),family:"android"}:t.includes("linux")?{name:"Linux",version:"Unknown",family:"linux"}:t.includes("cros")?{name:"Chrome OS",version:Xt(e,/cros [a-z0-9_]+ ([0-9.]+)/i),family:"linux"}:t.includes("freebsd")?{name:"FreeBSD",version:"Unknown",family:"unix"}:{name:"Unknown",version:"Unknown",family:"unknown"}}(t),i=Kt(t),r=function(e){const t=[];let n="legitimate";const o=["bot","crawler","spider","scraper","automation","headless","phantom","selenium","webdriver","google","bing","yahoo","baidu","yandex","facebook","twitter","linkedin","whatsapp"];for(const i of o)e.toLowerCase().includes(i)&&(t.push(i),["bot","crawler","spider","scraper"].some(e=>i.includes(e))?n="crawler":["selenium","webdriver","automation"].some(e=>i.includes(e))?n="automation":["headless","phantom"].some(e=>i.includes(e))&&(n="headless"));return e.length<10&&t.push("too_short"),e&&"Mozilla/5.0"!==e||t.push("generic_mozilla"),{isBot:t.length>0,patterns:t,category:n}}(t);return{browser:{name:n.name,version:n.version,major:n.major,engine:n.engine},os:{name:o.name,version:o.version,family:o.family},device:{type:i.type,vendor:i.vendor,model:i.model},suspicious:{isBot:r.isBot,patterns:r.patterns,category:r.category},isMobile:"mobile"===i.type,isTablet:"tablet"===i.type,isDesktop:"desktop"===i.type,isBot:r.isBot,raw:t}},e.autoInitializeFromScript=Et,e.clearFingerprintCache=function(){rt.clear()},e.collectFingerprint=lt,e.default=bt,e.detectBot=async function(){const e={webDriver:Mt(),headlessBrowser:Tt(),automationTools:Ct(),domBlockers:xt(),missingLanguages:Rt(),inconsistentEval:Dt(),humanBehavior:{detected:!1,confidence:0,method:"not_implemented"},mouseMovement:{detected:!1,confidence:0,method:"not_implemented"},clickPatterns:{detected:!1,confidence:0,method:"not_implemented"},canvasInconsistency:{detected:!1,confidence:0,method:"not_implemented"},webglAnomaly:{detected:!1,confidence:0,method:"not_implemented"},missingPlugins:{detected:0===navigator.plugins.length,confidence:30,method:"plugin_count"},inconsistentProperties:{detected:!1,confidence:0,method:"not_implemented"},modifiedBuiltins:{detected:!1,confidence:0,method:"not_implemented"}},t=It(),n=Object.values(e).filter(e=>e.detected),o=n.reduce((e,t)=>e+t.confidence,0),i=n.length>0?o/n.length:0,r=n.length>=2||n.some(e=>e.confidence>=90)||(t.suspicious?.isBot??!1);let a="low";return i>=70?a="high":(i>=40||n.length>=2)&&(a="medium"),{isBot:r,confidence:Math.round(Math.min(i,95)),riskLevel:a,detectionMethods:Object.keys(e).filter(t=>e[t]?.detected),detectors:e,userAgent:t}},e.detectIncognitoMode=async function(){!function(){const e=navigator.userAgent.toLowerCase();e.includes("chrome")||e.includes("firefox")||e.includes("safari")||e.includes("edge")}();const e=navigator.userAgent,t=/Chrome/.test(e)&&!/Edg|OPR/.test(e),n=/Safari/.test(e)&&!/Chrome/.test(e),o=/Firefox/.test(e),i=/Edg/.test(e),r=2e3,[a,s,c,l,u,d,h,m,g]=await Promise.allSettled([Promise.race([Pt(),zt(r,"localStorage")]),Promise.race([Lt(),zt(r,"sessionStorage")]),Promise.race([Ot(),zt(r,"indexedDB")]),Promise.race([Nt(),zt(r,"permissions")]),Promise.race([Ft(),zt(r,"quotaManagement")]),Promise.race([Vt(),zt(r,"filesystem")]),Promise.race([Ht(),zt(r,"cacheDetection")]),Promise.race([Bt(),zt(r,"chromeSpecific")]),Promise.race([Ut(),zt(r,"safariSpecific")])]),f=[];[{name:"localStorage",result:a},{name:"sessionStorage",result:s},{name:"indexedDB",result:c},{name:"permissions",result:l},{name:"quotaManagement",result:u},{name:"filesystem",result:d},{name:"cacheDetection",result:h},{name:"chromeSpecific",result:m},{name:"safariSpecific",result:g}].forEach(({name:e,result:r})=>{if("fulfilled"===r.status&&r.value.detected){const a=function(e,t,n){const o=Math.floor(.5*n);switch(e){case"quotaManagement":return t.isChrome||t.isEdge?Math.min(50,o+25):t.isSafari?Math.min(40,o+15):Math.min(30,o+10);case"filesystem":return t.isChrome||t.isEdge?Math.min(40,o+20):Math.max(5,o-5);case"indexedDB":return t.isFirefox?Math.min(45,o+20):t.isSafari?Math.min(35,o+10):o;case"localStorage":return Math.max(5,o-15);case"sessionStorage":return Math.max(5,o-10);case"permissions":return t.isChrome?Math.min(30,o+10):Math.max(5,o-5);case"cacheDetection":return Math.max(5,o-20);case"chromeSpecific":return t.isChrome?Math.min(50,o+30):0;case"safariSpecific":return t.isSafari?Math.min(45,o+25):0;default:return Math.max(5,o)}}(e,{isChrome:t,isSafari:n,isFirefox:o,isEdge:i},r.value.confidence);f.push({method:r.value.method,confidence:r.value.confidence,weight:a})}});const p=f.reduce((e,t)=>e+t.weight,0),w=f.reduce((e,t)=>e+t.confidence*t.weight/100,0);let y;y=n?35:t||i?45:o?40:50;const v=p>=y,b=p>0?Math.min(95,w/p*100):0,S="fulfilled"===a.status?a.value:{detected:!1},k="fulfilled"===s.status?s.value:{detected:!1},E="fulfilled"===c.status?c.value:{detected:!1},_="fulfilled"===l.status?l.value:{},A="fulfilled"===u.status?u.value:{detected:!1};return"fulfilled"===d.status&&d.value,"fulfilled"===h.status&&h.value,"undefined"!=typeof window&&window.RabbitTracker?.config?.debug&&console.debug("Incognito Detection Analysis:",{browserInfo:{isChrome:t,isSafari:n,isFirefox:o,isEdge:i},detectedSignals:f,totalWeight:p,minWeightThreshold:y,finalConfidence:b,isDetected:v}),{isIncognito:v,confidence:Math.round(b),detectionMethods:f.map(e=>e.method),details:{localStorage:S?.detected??!1,sessionStorage:k?.detected??!1,indexedDB:E?.detected??!1,cookiesEnabled:!1,quota:A?.detected?0:null,permissions:_?.details||{}}}},e.generateVisitorId=l,e.generateVisitorIdFromFingerprint=function(e){return l(e.hash)},e.getAvailableComponents=function(){const e=[];return j()&&e.push("canvas"),pe()&&e.push("webgl"),y()&&e.push("audio"),J()&&e.push("fonts"),ee()&&e.push("screen"),U()&&e.push("browser"),e},e.getBrowserEngine=function(){return Wt()?"chromium":jt()?"webkit":qt()?"gecko":navigator.userAgent.toLowerCase().includes("trident")?"trident":"unknown"},e.getCompleteFingerprint=dt,e.getLightweightFingerprint=ut,e.hash32=s,e.hashFingerprint=c,e.isAndroid=$t,e.isChromium=Wt,e.isDesktop=function(){return"desktop"===Kt(navigator.userAgent).type},e.isFingerprintingAvailable=function(){return ee()&&U()},e.isGecko=qt,e.isIPad=Gt,e.isMobile=function(){return"mobile"===Kt(navigator.userAgent).type},e.isSamsungInternet=Zt,e.isTablet=function(){return"tablet"===Kt(navigator.userAgent).type},e.isWebKit=jt,e.quickBotDetection=async function(){const e=Mt(),t=It();return e.detected||(t.suspicious?.isBot??!1)},e.quickIncognitoDetection=async function(){try{const[e,t]=await Promise.all([Pt(),Ot()]);return e.detected||t.detected}catch{return!1}},e.x64hash128=a,Object.defineProperty(e,"__esModule",{value:!0}),e}({});