unshared-frontend-sdk 2.0.0 → 2.0.1

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/index.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";const e="1.3.1",t=1282368115,n={exclude:[],include:[],timeout:3e3,stabilize:["private","iframe","always"],experimental:!1,debug:!1,salt:""},r=new Set(["audio","timing","navigatorConnection","domrect","permissions","fonts","speech"]),o=new Set(["domrect"]),a={always:[{exclude:["speech"],browsers:["brave","firefox"]},{exclude:["keyboard"],browsers:["firefox","safari"]},{exclude:["workers"],browsers:["firefox"]},{exclude:["hardwareSensitive","navigatorProps"],browsers:["brave"]}],private:[{exclude:["fonts"],browsers:["firefox"]},{exclude:["audio"],browsers:["safari","brave"]}],iframe:[{exclude:["applePay"],browsers:["safari"]},{exclude:["permissions"]},{exclude:["keyboard"]}]};let i=null;function s(){if(i)return i;const e=navigator.userAgent;return i=function(){const e=navigator.brave;return!!e&&"function"==typeof e.isBrave}()?{name:"brave",version:c(e,/Chrome\/([\d.]+)/)}:/Edg\//i.test(e)?{name:"edge",version:c(e,/Edg\/([\d.]+)/)}:/OPR\//i.test(e)||/Opera/i.test(e)?{name:"opera",version:c(e,/OPR\/([\d.]+)/)||c(e,/Opera\/([\d.]+)/)}:/SamsungBrowser/i.test(e)?{name:"samsung",version:c(e,/SamsungBrowser\/([\d.]+)/)}:/Firefox\//i.test(e)?{name:"firefox",version:c(e,/Firefox\/([\d.]+)/)}:/Safari\//i.test(e)&&!/Chrome/i.test(e)?{name:"safari",version:c(e,/Version\/([\d.]+)/)}:/Chrome\//i.test(e)?{name:"chrome",version:c(e,/Chrome\/([\d.]+)/)}:{name:"unknown",version:""},i}function c(e,t){const n=e.match(t);return n?.[1]??""}async function l(e){try{switch(e){case"chrome":case"edge":case"opera":default:return await u();case"brave":return await async function(){return!1}();case"safari":return await async function(){if(navigator.storage?.estimate){const{quota:e}=await navigator.storage.estimate();if(void 0!==e)return e<4294967296}try{return!!navigator.storage?.getDirectory&&(await navigator.storage.getDirectory(),!1)}catch(e){return"NotFoundError"===e?.name}}();case"firefox":return await async function(){if(!("serviceWorker"in navigator))return!0;try{return!!navigator.storage?.getDirectory&&(await navigator.storage.getDirectory(),!1)}catch(e){return"SecurityError"===e?.name}}()}}catch{return!1}}async function u(){if(!navigator.storage?.estimate)return!1;const{quota:e}=await navigator.storage.estimate();return void 0!==e&&e<4294967296}function m(e,t){const n=e[0]>>>16,o=65535&e[0],r=e[1]>>>16,i=65535&e[1],a=t[0]>>>16,s=65535&t[0],c=t[1]>>>16;let u=0,l=0,d=0,f=0,m=0;return l=i+(65535&t[1]),u=l>>>16,l&=65535,d=r+c+u,u=d>>>16,d&=65535,f=o+s+u,u=f>>>16,f&=65535,m=n+a+u,m&=65535,[m<<16|f,d<<16|l]}function d(e,t){const n=e[0]>>>16,o=65535&e[0],r=e[1]>>>16,i=65535&e[1],a=t[0]>>>16,s=65535&t[0],c=t[1]>>>16,u=65535&t[1];let l=0,d=0,f=0,m=0,p=0;return d=i*u,l=d>>>16,d&=65535,f=r*u+l,l=f>>>16,f&=65535,f+=i*c,l+=f>>>16,f&=65535,m=o*u+l,l=m>>>16,m&=65535,m+=r*c,l+=m>>>16,m&=65535,m+=i*s,l+=m>>>16,m&=65535,p=n*u+o*c+r*s+i*a+l,p&=65535,[p<<16|m,f<<16|d]}function f(e,t){return 32==(t%=64)?[e[1],e[0]]:t<32?[e[0]<<t|e[1]>>>32-t,e[1]<<t|e[0]>>>32-t]:(t-=32,[e[1]<<t|e[0]>>>32-t,e[0]<<t|e[1]>>>32-t])}function p(e,t){return 0==(t%=64)?[e[0],e[1]]:t<32?[e[0]<<t|e[1]>>>32-t,e[1]<<t]:[e[1]<<t-32,0]}function g(e,t){return[e[0]^t[0],e[1]^t[1]]}function h(e){let t=[e[0],e[1]];return t=g(t,[0,t[0]>>>1]),t=d(t,[4283543511,3981806797]),t=g(t,[0,t[0]>>>1]),t=d(t,[3301882366,444984403]),t=g(t,[0,t[0]>>>1]),t}function y(e){return("00000000"+(e>>>0).toString(16)).slice(-8)}function v(e,t=0){const n=e.length%16,o=e.length-n;let r=[0,t],i=[0,t];const a=[2277735313,289559509],s=[1291169091,658871167];for(let t=0;t<o;t+=16){let n=[255&e.charCodeAt(t+4)|(255&e.charCodeAt(t+5))<<8|(255&e.charCodeAt(t+6))<<16|(255&e.charCodeAt(t+7))<<24,255&e.charCodeAt(t)|(255&e.charCodeAt(t+1))<<8|(255&e.charCodeAt(t+2))<<16|(255&e.charCodeAt(t+3))<<24],o=[255&e.charCodeAt(t+12)|(255&e.charCodeAt(t+13))<<8|(255&e.charCodeAt(t+14))<<16|(255&e.charCodeAt(t+15))<<24,255&e.charCodeAt(t+8)|(255&e.charCodeAt(t+9))<<8|(255&e.charCodeAt(t+10))<<16|(255&e.charCodeAt(t+11))<<24];n=d(n,a),n=f(n,31),n=d(n,s),r=g(r,n),r=f(r,27),r=m(r,i),r=m(d(r,[0,5]),[0,1390208809]),o=d(o,s),o=f(o,33),o=d(o,a),i=g(i,o),i=f(i,31),i=m(i,r),i=m(d(i,[0,5]),[0,944331445])}let c=[0,0],u=[0,0];switch(n){case 15:u=g(u,p([0,e.charCodeAt(o+14)],48));case 14:u=g(u,p([0,e.charCodeAt(o+13)],40));case 13:u=g(u,p([0,e.charCodeAt(o+12)],32));case 12:u=g(u,p([0,e.charCodeAt(o+11)],24));case 11:u=g(u,p([0,e.charCodeAt(o+10)],16));case 10:u=g(u,p([0,e.charCodeAt(o+9)],8));case 9:u=g(u,[0,e.charCodeAt(o+8)]),u=d(u,s),u=f(u,33),u=d(u,a),i=g(i,u);case 8:c=g(c,p([0,e.charCodeAt(o+7)],56));case 7:c=g(c,p([0,e.charCodeAt(o+6)],48));case 6:c=g(c,p([0,e.charCodeAt(o+5)],40));case 5:c=g(c,p([0,e.charCodeAt(o+4)],32));case 4:c=g(c,p([0,e.charCodeAt(o+3)],24));case 3:c=g(c,p([0,e.charCodeAt(o+2)],16));case 2:c=g(c,p([0,e.charCodeAt(o+1)],8));case 1:c=g(c,[0,e.charCodeAt(o)]),c=d(c,a),c=f(c,31),c=d(c,s),r=g(r,c)}return r=g(r,[0,e.length]),i=g(i,[0,e.length]),r=m(r,i),i=m(i,r),r=h(r),i=h(i),r=m(r,i),i=m(i,r),y(r[0])+y(r[1])+y(i[0])+y(i[1])}function x(e){return S(e,new Set)}function S(e,t){if(null===e)return"null";if(void 0===e)return"undefined";const n=typeof e;if("boolean"===n||"number"===n)return String(e);if("string"===n)return JSON.stringify(e);if(Array.isArray(e)){if(t.has(e))return'"[Circular]"';t.add(e);const n=e.map(e=>S(e,t));return t.delete(e),"["+n.join(",")+"]"}if("object"===n){const n=e;if(t.has(n))return'"[Circular]"';t.add(n);const o=Object.keys(n).sort().filter(e=>void 0!==n[e]).map(e=>JSON.stringify(e)+":"+S(n[e],t));return t.delete(n),"{"+o.join(",")+"}"}return String(e)}const b=v("",t);function w(e,n){const o=function(e){if(0===e.length)return v("",t);if(1===e.length)return v(e[0],t);let n=[...e];for(;n.length>1;){const e=[];for(let o=0;o<n.length;o+=2){const r=o+1<n.length?n[o+1]:b;e.push(v(n[o]+r,t))}n=e}return n[0]}(Object.keys(e).sort().map(n=>{const o=function(e){let n=t;for(let t=0;t<e.length;t++)n=Math.imul(n^e.charCodeAt(t),1540483477),n^=n>>>13;return n>>>0}(n);return v(x(e[n]),o)})),r=String.fromCharCode(76,111,98,115),i=n?v(n,t):"";return v(o+r+i,t)}function C(e){try{const t=e.getExtension("EXT_texture_filter_anisotropic")??e.getExtension("WEBKIT_EXT_texture_filter_anisotropic")??e.getExtension("MOZ_EXT_texture_filter_anisotropic");return t?e.getParameter(t.MAX_TEXTURE_MAX_ANISOTROPY_EXT):null}catch{return null}}function A(e){try{const t=e.getContext("webgl2");if(!t)return null;const n={version:t.getParameter(t.VERSION),maxSamples:t.getParameter(t.MAX_SAMPLES),max3DTextureSize:t.getParameter(t.MAX_3D_TEXTURE_SIZE),maxArrayTextureLayers:t.getParameter(t.MAX_ARRAY_TEXTURE_LAYERS),maxUniformBlockSize:t.getParameter(t.MAX_UNIFORM_BLOCK_SIZE),maxVertexUniformComponents:t.getParameter(t.MAX_VERTEX_UNIFORM_COMPONENTS),maxFragmentUniformComponents:t.getParameter(t.MAX_FRAGMENT_UNIFORM_COMPONENTS),maxColorAttachments:t.getParameter(t.MAX_COLOR_ATTACHMENTS),maxDrawBuffers:t.getParameter(t.MAX_DRAW_BUFFERS)};return t.getExtension("WEBGL_lose_context")?.loseContext(),n}catch{return null}}function E(){const e=navigator.userAgentData;if(e?.platform)return e.platform;const t=navigator.userAgent??"";return/Windows/.test(t)?"Windows":/Macintosh|Mac OS X/.test(t)?"macOS":/CrOS/.test(t)?"Chrome OS":/Android/.test(t)?"Android":/Linux/.test(t)?"Linux":/iPhone|iPad|iPod/.test(t)?"iOS":""}function M(){try{const e=new ArrayBuffer(4),t=new Float32Array(e),n=new Uint8Array(e);return t[0]=1/0,n[3]}catch{return 0}}function P(e,t,n,o){const r=(n-t)/o;let i=e(t)+e(n);for(let n=1;n<o;n++)i+=e(t+n*r)*(n%2==0?2:4);return i*r/3}function T(){try{const e=(new Intl.DateTimeFormat).resolvedOptions();return{locale:e.locale,calendar:e.calendar,numberingSystem:e.numberingSystem,timeZone:e.timeZone}}catch{return{}}}function _(){try{const e=(new Intl.NumberFormat).resolvedOptions();return{locale:e.locale,numberingSystem:e.numberingSystem,style:e.style,minimumIntegerDigits:e.minimumIntegerDigits,minimumFractionDigits:e.minimumFractionDigits,maximumFractionDigits:e.maximumFractionDigits,useGrouping:e.useGrouping}}catch{return{}}}function R(){try{const e=(new Intl.Collator).resolvedOptions();return{locale:e.locale,usage:e.usage,sensitivity:e.sensitivity,collation:e.collation,numeric:e.numeric,caseFirst:e.caseFirst}}catch{return{}}}function I(){try{const e=(new Intl.PluralRules).resolvedOptions(),t=new Intl.PluralRules(void 0,{type:"ordinal"}).resolvedOptions();return{locale:e.locale,type:e.type,cardinalCategories:(new Intl.PluralRules).select(0)+","+(new Intl.PluralRules).select(1)+","+(new Intl.PluralRules).select(2)+","+(new Intl.PluralRules).select(5)+","+(new Intl.PluralRules).select(11)+","+(new Intl.PluralRules).select(100),ordinalCategory1:t.type,minimumIntegerDigits:e.minimumIntegerDigits}}catch{return{}}}function k(){try{const e=new Intl.RelativeTimeFormat;if(!e)return{};const t=e.resolvedOptions();return{locale:t.locale,style:t.style,numeric:t.numeric,numberingSystem:t.numberingSystem}}catch{return{}}}function O(){try{const e=new Intl.ListFormat;if(!e)return{};const t=e.resolvedOptions(),n=["X","Y","Z"],o=new Intl.ListFormat(void 0,{type:"conjunction",style:"long"}),r=new Intl.ListFormat(void 0,{type:"disjunction",style:"long"});return{locale:t.locale,type:t.type,style:t.style,conjunctionSample:o.format(n),disjunctionSample:r.format(n)}}catch{return{}}}const D=[["backdrop-filter","blur(1px)"],["container-type","inline-size"],["text-wrap","balance"],["overscroll-behavior","contain"],["hanging-punctuation","first"],["-webkit-line-clamp","1"],["appearance","none"],["font-size-adjust","ex-height 0.5"],["font-palette","normal"],["field-sizing","content"],["-webkit-text-stroke","1px black"],["zoom","1"],["scrollbar-width","thin"],["scrollbar-color","red blue"],["animation-timeline","auto"],["mask-composite","add"],["offset-path","none"],["text-decoration-thickness","1px"],["content-visibility","auto"],["contain-intrinsic-size","auto 100px"],["aspect-ratio","16/9"],["gap","10px"],["color-mix","in srgb, red 50%, blue"],["linear-gradient(in oklch, red, blue)",""]];function L(){try{const e=document.createElement("div");e.style.cssText="visibility:hidden;overflow:scroll;position:absolute;top:-9999px;width:100px;height:100px",document.body.appendChild(e);const t=document.createElement("div");e.appendChild(t);const n=e.offsetWidth-t.offsetWidth;return document.body.removeChild(e),n}catch{return-1}}function N(){const e={};if("undefined"==typeof CSS||"function"!=typeof CSS.supports)return e;for(const[t,n]of D)e[t]=n?CSS.supports(t,n):CSS.supports(t);return e}function F(){try{const e=document.createElement("div");e.style.cssText=["position:fixed","top:0","left:0","width:0","height:0","visibility:hidden","padding-top:env(safe-area-inset-top,0px)","padding-bottom:env(safe-area-inset-bottom,0px)","padding-left:env(safe-area-inset-left,0px)","padding-right:env(safe-area-inset-right,0px)"].join(";"),document.body.appendChild(e);const t=getComputedStyle(e),n={top:t.paddingTop,bottom:t.paddingBottom,left:t.paddingLeft,right:t.paddingRight};return document.body.removeChild(e),n}catch{return null}}function B(){try{const e=performance.now();let t=1/0,n=e;for(let o=0;o<50;o++){const o=performance.now(),r=o-n;if(r>0&&r<t&&(t=r),n=o,o-e>=1)break}if(t===1/0)return-1;const o=1e3*t;if(o<=0)return-1;const r=Math.max(0,Math.round(Math.log10(o)));return Math.pow(10,r)}catch{return-1}}const U=["Arial","Arial Black","Arial Narrow","Arial Rounded MT Bold","Bookman Old Style","Bradley Hand","Calibri","Cambria","Cambria Math","Century","Century Gothic","Comic Sans MS","Consolas","Courier","Courier New","Garamond","Geneva","Georgia","Gill Sans","Helvetica","Helvetica Neue","Impact","Lucida Console","Lucida Grande","Lucida Sans Unicode","Microsoft Sans Serif","Monaco","Palatino","Palatino Linotype","Segoe Print","Segoe Script","Segoe UI","Tahoma","Times","Times New Roman","Trebuchet MS","Verdana","Wingdings","Wingdings 2","Wingdings 3","Inter","Roboto","Open Sans","Lato","Montserrat","Poppins","Nunito","Raleway","Ubuntu","Merriweather","Playfair Display","Source Sans Pro","Source Code Pro","Fira Code","JetBrains Mono","Cascadia Code","Apple Color Emoji","Segoe UI Emoji","Noto Color Emoji","SF Pro","SF Pro Display","SF Mono","San Francisco","Menlo","Andale Mono","Futura","MS Gothic","MS Mincho","MS PGothic","MS PMincho","Yu Gothic","Meiryo","Hiragino Sans","Hiragino Kaku Gothic Pro","SimSun","SimHei","Microsoft YaHei","PingFang SC","Noto Sans CJK","Malgun Gothic","Arial Hebrew"],V=["monospace","sans-serif","serif"],W="mmMwWLliI0O&1";function X(e,t){const n=[],o=e.split("\r\n");let r=!1;for(const e of o)if(e.startsWith(`m=${t}`))r=!0;else{if(e.startsWith("m=")&&r)break;if(r&&e.startsWith("a=rtpmap:")){const t=e.match(/^a=rtpmap:\d+\s+(.+)$/);t&&n.push(t[1])}}return n}const z=["accelerometer","accessibility-events","ambient-light-sensor","background-fetch","background-sync","bluetooth","camera","clipboard-read","clipboard-write","display-capture","geolocation","gyroscope","local-fonts","magnetometer","microphone","midi","nfc","notifications","payment-handler","persistent-storage","push","screen-wake-lock","speaker-selection","storage-access","top-level-storage-access","window-management","xr-spatial-tracking"];function G(e){const t={};for(const n of e)t[n]=(t[n]??0)+1;let n=e[0],o=0;for(const[e,r]of Object.entries(t))r>o&&(n=e,o=r);return n}const j=[{name:"prefers-contrast",values:["no-preference","more","less","custom"]},{name:"any-hover",values:["none","hover"]},{name:"any-pointer",values:["none","coarse","fine"]},{name:"pointer",values:["none","coarse","fine"]},{name:"hover",values:["none","hover"]},{name:"update",values:["none","slow","fast"]},{name:"inverted-colors",values:["none","inverted"]},{name:"prefers-reduced-motion",values:["no-preference","reduce"]},{name:"prefers-reduced-transparency",values:["no-preference","reduce"]},{name:"scripting",values:["none","initial-only","enabled"]},{name:"forced-colors",values:["none","active"]},{name:"prefers-color-scheme",values:["light","dark"]},{name:"color-gamut",values:["srgb","p3","rec2020"]},{name:"dynamic-range",values:["standard","high"]}],H=["KeyQ","KeyW","KeyA","KeyS","KeyZ","KeyX","KeyY","KeyM","Semicolon","BracketLeft","Quote","Digit1","Digit2","Digit3"];function K(e){const t=e.KeyQ,n=e.KeyZ,o=e.KeyY;return t?"a"===t?"azerty":"q"===t&&"z"===o?"qwertz":"q"===t&&"z"===n?"qwerty":"'"===t?"dvorak":"other":null}const $=[{name:"webgl",tier:1,async collect(){const e=document.createElement("canvas"),t=e.getContext("webgl")||e.getContext("experimental-webgl");if(!(t&&t instanceof WebGLRenderingContext))return null;const n=t.getExtension("WEBGL_debug_renderer_info"),o=t.getSupportedExtensions()??[],r=function(e){const t={},n=[e.VERTEX_SHADER,e.FRAGMENT_SHADER],o=[e.LOW_FLOAT,e.MEDIUM_FLOAT,e.HIGH_FLOAT,e.LOW_INT,e.MEDIUM_INT,e.HIGH_INT],r=["vertex","fragment"],i=["lowFloat","mediumFloat","highFloat","lowInt","mediumInt","highInt"];for(let a=0;a<n.length;a++){const s={};for(let t=0;t<o.length;t++){const r=e.getShaderPrecisionFormat(n[a],o[t]);r&&(s[i[t]]={rangeMin:r.rangeMin,rangeMax:r.rangeMax,precision:r.precision})}t[r[a]]=s}return t}(t),i={vendor:t.getParameter(t.VENDOR),renderer:t.getParameter(t.RENDERER),version:t.getParameter(t.VERSION),shadingLanguageVersion:t.getParameter(t.SHADING_LANGUAGE_VERSION),unmaskedVendor:n?t.getParameter(n.UNMASKED_VENDOR_WEBGL):null,unmaskedRenderer:n?t.getParameter(n.UNMASKED_RENDERER_WEBGL):null,extensions:o.sort(),maxTextureSize:t.getParameter(t.MAX_TEXTURE_SIZE),maxRenderbufferSize:t.getParameter(t.MAX_RENDERBUFFER_SIZE),maxViewportDims:Array.from(t.getParameter(t.MAX_VIEWPORT_DIMS)),maxVertexAttribs:t.getParameter(t.MAX_VERTEX_ATTRIBS),maxVertexUniformVectors:t.getParameter(t.MAX_VERTEX_UNIFORM_VECTORS),maxFragmentUniformVectors:t.getParameter(t.MAX_FRAGMENT_UNIFORM_VECTORS),maxVaryingVectors:t.getParameter(t.MAX_VARYING_VECTORS),aliasedLineWidthRange:Array.from(t.getParameter(t.ALIASED_LINE_WIDTH_RANGE)),aliasedPointSizeRange:Array.from(t.getParameter(t.ALIASED_POINT_SIZE_RANGE)),maxCombinedTextureImageUnits:t.getParameter(t.MAX_COMBINED_TEXTURE_IMAGE_UNITS),maxTextureImageUnits:t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS),maxVertexTextureImageUnits:t.getParameter(t.MAX_VERTEX_TEXTURE_IMAGE_UNITS),shaderPrecision:r,maxAnisotropy:C(t),webgl2:A(e)};return t.getExtension("WEBGL_lose_context")?.loseContext(),i}},{name:"hardware",tier:1,collect:async()=>({architecture:M(),platform:E()})},{name:"hardwareSensitive",tier:1,collect:async()=>({deviceMemory:navigator.deviceMemory??null,hardwareConcurrency:navigator.hardwareConcurrency??null})},{name:"math",tier:1,collect:async()=>({acos:Math.acos(.5),asin:P(Math.asin,-1,1,97),cos:P(Math.cos,0,Math.PI,97),cosLarge:Math.cos(1e20),sinLarge:Math.sin(1e20),tanLarge:Math.tan(1e20),sin:P(Math.sin,0,Math.PI,97),tan:P(Math.tan,0,Math.PI/4,97)})},{name:"i18n",tier:1,collect:async()=>({dateTimeFormat:T(),numberFormat:_(),collator:R(),pluralRules:I(),relativeTimeFormat:k(),listFormat:O()})},{name:"domrect",tier:1,collect:async()=>({basic:function(){const e=document.createElement("div");e.style.cssText="position:fixed;left:-9999px;width:100px;height:100px;",document.body.appendChild(e);const t=e.getBoundingClientRect();return document.body.removeChild(e),{x:t.x,y:t.y,width:t.width,height:t.height,top:t.top,right:t.right,bottom:t.bottom,left:t.left}}(),precision:function(){const e=document.createElement("div");e.style.cssText=`position:absolute;left:-9999px;width:${Math.PI}px;height:${Math.E}px;`,document.body.appendChild(e);const t=e.getBoundingClientRect();return document.body.removeChild(e),{width:t.width,height:t.height}}(),fromRect:"undefined"!=typeof DOMRectReadOnly&&"function"==typeof DOMRectReadOnly.fromRect})},{name:"touch",tier:1,collect:async()=>({supported:"ontouchstart"in window||navigator.maxTouchPoints>0,maxTouchPoints:navigator.maxTouchPoints??0})},{name:"display",tier:1,collect:async()=>({colorDepth:screen.colorDepth??0,pixelDepth:screen.pixelDepth??0})},{name:"locale",tier:1,collect:async()=>({timezone:Intl.DateTimeFormat().resolvedOptions().timeZone??"",language:navigator.language??""})},{name:"workers",tier:1,collect:async()=>({webWorker:"undefined"!=typeof Worker,sharedWorker:"undefined"!=typeof SharedWorker,serviceWorker:"serviceWorker"in navigator})},{name:"plugins",tier:1,async collect(){const e=[];if(navigator.plugins)for(let t=0;t<navigator.plugins.length;t++){const n=navigator.plugins[t];"internal-pdf-viewer"===n.filename&&e.push(`${n.name}|${n.filename}|${n.description}`)}return{plugins:e.sort(),pdfViewerEnabled:navigator.pdfViewerEnabled??!1}}},{name:"css",tier:1,collect:async()=>({scrollbarWidth:L(),supports:N(),safeArea:F()})},{name:"navigatorProps",tier:1,collect:async()=>({vendor:navigator.vendor??"",productSub:navigator.productSub??"",cookieEnabled:navigator.cookieEnabled})},{name:"timing",tier:2,collect:async()=>({performancePrecisionUs:B()})},{name:"navigatorConnection",tier:2,async collect(){const e=navigator,t=e.connection??e.mozConnection??e.webkitConnection??null,n=performance.memory??null;return{connection:t?{type:t.type??null,effectiveType:t.effectiveType??null,saveData:t.saveData??null}:null,memory:n?{jsHeapSizeLimit:n.jsHeapSizeLimit}:null}}},{name:"webgpu",tier:2,async collect(){const e=navigator.gpu;if(!e)return null;const t=await e.requestAdapter();if(!t)return null;let n="",o="",r="",i="";if(t.info)n=t.info.vendor??"",o=t.info.architecture??"",r=t.info.device??"",i=t.info.description??"";else if("function"==typeof t.requestAdapterInfo){const e=await t.requestAdapterInfo();n=e.vendor??"",o=e.architecture??"",r=e.device??"",i=e.description??""}const a=[];t.features&&(t.features.forEach(e=>a.push(e)),a.sort());const s={};if(t.limits){const e=["maxTextureDimension1D","maxTextureDimension2D","maxTextureDimension3D","maxTextureArrayLayers","maxBindGroups","maxBindGroupsPlusVertexBuffers","maxBindingsPerBindGroup","maxDynamicUniformBuffersPerPipelineLayout","maxDynamicStorageBuffersPerPipelineLayout","maxSampledTexturesPerShaderStage","maxSamplersPerShaderStage","maxStorageBuffersPerShaderStage","maxStorageTexturesPerShaderStage","maxUniformBuffersPerShaderStage","maxUniformBufferBindingSize","maxStorageBufferBindingSize","minUniformBufferOffsetAlignment","minStorageBufferOffsetAlignment","maxVertexBuffers","maxBufferSize","maxVertexAttributes","maxVertexBufferArrayStride","maxInterStageShaderComponents","maxInterStageShaderVariables","maxColorAttachments","maxColorAttachmentBytesPerSample","maxComputeWorkgroupStorageSize","maxComputeInvocationsPerWorkgroup","maxComputeWorkgroupSizeX","maxComputeWorkgroupSizeY","maxComputeWorkgroupSizeZ","maxComputeWorkgroupsPerDimension"];for(const n of e){const e=t.limits[n];void 0!==e&&(s[n]=e)}}return{vendor:n,architecture:o,device:r,description:i,features:a,limits:s}}},{name:"audio",tier:2,async collect(){const e=window.AudioContext||window.webkitAudioContext;if(!e)return null;let t=null;try{t=new e;const n=t.destination;return{sampleRate:t.sampleRate,maxChannelCount:n.maxChannelCount,channelCount:n.channelCount,channelCountMode:n.channelCountMode,channelInterpretation:n.channelInterpretation,baseLatency:t.baseLatency??null,outputLatency:t.outputLatency??null}}finally{if(t&&"closed"!==t.state)try{await t.close()}catch{}}}},{name:"fonts",tier:2,collect:()=>new Promise(e=>{const t=()=>e(function(){try{if("undefined"==typeof document)return{available:[],method:"css-layout"};const e=new Set,t=[];if("function"==typeof document.fonts?.check)for(const n of U)document.fonts.check(`72px "${n}"`)?e.add(n):t.push(n);else t.push(...U);const n=new Set;if(t.length>0){const e=document.createElement("div");e.style.cssText="position:absolute;visibility:hidden;top:-9999px;left:-9999px;pointer-events:none;";const o=V.map(t=>{const n=document.createElement("span");return n.style.cssText=`font-size:72px;font-family:${t};white-space:nowrap;display:inline-block`,n.textContent=W,e.appendChild(n),n}),r=t.map(t=>V.map(n=>{const o=document.createElement("span");return o.style.cssText=`font-size:72px;font-family:'${t}',${n};white-space:nowrap;display:inline-block`,o.textContent=W,e.appendChild(o),o}));document.body.appendChild(e);const i=o.map(e=>e.getBoundingClientRect().width),a=r.map(e=>e.map(e=>e.getBoundingClientRect().width));document.body.removeChild(e);for(let e=0;e<t.length;e++)for(let o=0;o<V.length;o++)if(a[e][o]!==i[o]){n.add(t[e]);break}}return{available:U.filter(t=>e.has(t)||n.has(t)),method:"css-layout"}}catch{return{available:[],method:"css-layout"}}}());"undefined"!=typeof requestIdleCallback?requestIdleCallback(t,{timeout:2e3}):setTimeout(t,0)})},{name:"webrtc",tier:2,async collect(){if("undefined"==typeof RTCPeerConnection)return{supported:!1,audioCodecCount:0,videoCodecCount:0,audioCodecs:[],videoCodecs:[],extensions:[]};const e=new RTCPeerConnection({iceServers:[]});try{e.addTransceiver("audio"),e.addTransceiver("video");const t=(await e.createOffer()).sdp??"",n=X(t,"audio"),o=X(t,"video"),r=function(e){const t=new Set,n=e.split("\r\n");for(const e of n)if(e.startsWith("a=extmap:")){const n=e.match(/^a=extmap:\d+(?:\/\w+)?\s+(.+)$/);n&&t.add(n[1].trim())}return Array.from(t)}(t);return{supported:!0,audioCodecCount:n.length,videoCodecCount:o.length,audioCodecs:n.sort(),videoCodecs:o.sort(),extensions:r.sort()}}finally{e.close()}}},{name:"permissions",tier:2,async collect(){if(!navigator.permissions?.query)return{states:{}};const e=()=>Promise.allSettled(z.map(async e=>{try{return{name:e,state:(await navigator.permissions.query({name:e})).state}}catch{return{name:e,state:"error"}}})),t=await Promise.all([e(),e(),e()]),n={};for(const e of t)for(const t of e)if("fulfilled"===t.status){const{name:e,state:o}=t.value;n[e]||(n[e]=[]),n[e].push(o)}const o={};for(const[e,t]of Object.entries(n))o[e]=G(t);return{states:o}}},{name:"speech",tier:2,async collect(){if("undefined"==typeof speechSynthesis)return{supported:!1,voiceCount:0,voices:[]};const e=await new Promise(e=>{const t=speechSynthesis.getVoices();if(t.length>0)return void e(t);const n=setTimeout(()=>e([]),800);speechSynthesis.addEventListener("voiceschanged",()=>{clearTimeout(n),e(speechSynthesis.getVoices())},{once:!0})}),t=e.map(e=>`${e.name}|${e.lang}|${e.localService}`).sort();return{supported:!0,voiceCount:e.length,voices:t}}},{name:"mediaQueries",tier:2,async collect(){if("function"!=typeof matchMedia){const e={};for(const t of j)e[t.name.replace(/-([a-z])/g,(e,t)=>t.toUpperCase())]="unsupported";return{...e,monochrome:0}}const e={};for(const t of j){let n="unknown";for(const e of t.values){const o=matchMedia(`(${t.name}: ${e})`);if(o?.matches){n=e;break}}e[t.name.replace(/-([a-z])/g,(e,t)=>t.toUpperCase())]=n}let t=0;for(let e=100;e>=0;e--)if(matchMedia(`(monochrome: ${e})`)?.matches){t=e;break}return{...e,monochrome:t}}},{name:"applePay",tier:2,async collect(){const e=window.ApplePaySession;if(!e||"function"!=typeof e.supportsVersion)return{supported:!1,maxVersion:0};let t=0;for(let n=15;n>=1;n--)try{if(e.supportsVersion(n)){t=n;break}}catch{continue}return{supported:!0,maxVersion:t}}},{name:"keyboard",tier:2,async collect(){const e=navigator.keyboard;if(!e||"function"!=typeof e.getLayoutMap)return{supported:!1,layoutKeys:null,layoutHint:null};try{const t=await e.getLayoutMap(),n={};for(const e of H){const o=t.get(e);void 0!==o&&(n[e]=o)}return{supported:!0,layoutKeys:n,layoutHint:K(n)}}catch{return{supported:!1,layoutKeys:null,layoutHint:null}}}}];async function q(e,t,n){const o={},r=[],i=$.filter(t=>!e.has(t.name)&&(n||3!==t.tier)),a=await Promise.allSettled(i.map(async e=>{const n=await(o=e.collect(),r=t,new Promise((e,t)=>{const n=setTimeout(()=>e(null),r);o.then(t=>{clearTimeout(n),e(t)},e=>{clearTimeout(n),t(e)})}));var o,r;return{name:e.name,value:n}}));for(let e=0;e<a.length;e++){const t=a[e],n=i[e].name;"fulfilled"===t.status&&null!==t.value.value?o[n]=t.value.value:"rejected"===t.status&&r.push({signal:n,error:String(t.reason?.message??t.reason)})}return{components:o,errors:r}}async function Z(t){const i=function(e){return e?{exclude:e.exclude??n.exclude,include:e.include??n.include,timeout:e.timeout??n.timeout,stabilize:e.stabilize??n.stabilize,experimental:e.experimental??n.experimental,debug:e.debug??n.debug,salt:e.salt??n.salt}:{...n}}(t),c=s(),u=function(){try{return window.self!==window.top}catch{return!0}}();let d=!1;try{d=await l(c.name)}catch{}const f=function(e,t,n,o){const r=new Set;for(const i of e){if("private"===i&&!n)continue;if("iframe"===i&&!o)continue;const e=a[i];if(e)for(const n of e)if(!n.browsers||n.browsers.includes(t))for(const e of n.exclude)r.add(e)}return r}(i.stabilize,c.name,d,u),m=new Set(f);for(const e of i.exclude)m.add(e);for(const e of i.include)m.delete(e);const{components:p,errors:h}=await q(m,i.timeout,i.experimental),g={t:e};for(const[e,t]of Object.entries(p))o.has(e)||(g[e]=t);const y=w(g,i.salt),S={t:e};for(const[e,t]of Object.entries(p))r.has(e)||(S[e]=t);const v=w(S,i.salt),x={hash:y,stableHash:v,components:{...p,t:e},timestamp:(new Date).toISOString(),version:e,isIncognito:d,errors:h};return i.debug&&(console.log("[fingerprint] components:",p),console.log("[fingerprint] hash:",y,"stableHash:",v),h.length>0&&console.warn("[fingerprint] errors:",h)),x}const Q=new RegExp(["googlebot","bingbot","slurp","baiduspider","duckduckbot","yandex","sogou","exabot","ia_archiver","curl","wget","python-requests","python-urllib","axios","node-fetch","go-http-client","java/","libwww-perl","okhttp","apache-httpclient","http_request","httpie","headlesschrome","phantomjs","puppeteer","playwright","cypress","selenium","webdriver","electron","jsdom","vercel-screenshot","screenshot","prerender","lighthouse","chrome-lighthouse","pagespeed","gtmetrix","pingdom","nessus","nikto","sqlmap","burp","zap","qualys","openvas","nmap","masscan","facebookexternalhit","twitterbot","linkedinbot","whatsapp","telegrambot","slackbot","discordbot","bot","crawl","spider","scrape","fetch","scan"].join("|"),"i");function ee(e){return!!e&&Q.test(e)}const SENTINEL_USER_IDS=new Set(["__pre_auth__","anonymous","guest","undefined","null"]);function isSentinelUserId(e){return"string"==typeof e&&SENTINEL_USER_IDS.has(e)}const DEFAULT_MAX_RETRIES=3,DEFAULT_TIMEOUT_MS=3e4,MAX_DELAY_MS=3e4,BASE_DELAY_MS=1e3,SUBMIT_FP_PATH="/__unshared/submit-fp",SS_EMAIL_KEY="__unshared_email",SS_FP_KEY="__unshared_fp",SS_LAST_SUBMIT_KEY="__unshared_last_submit",LS_DEVICE_ID="__unshared_device_id",COOKIE_UID="__unshared_uid",COOKIE_SID="__unshared_sid";function generateUUID(){if("undefined"!=typeof crypto&&crypto.randomUUID)return crypto.randomUUID();const e=new Uint8Array(16);crypto.getRandomValues(e),e[6]=15&e[6]|64,e[8]=63&e[8]|128;const t=Array.from(e).map(e=>e.toString(16).padStart(2,"0")).join("");return`${t.slice(0,8)}-${t.slice(8,12)}-${t.slice(12,16)}-${t.slice(16,20)}-${t.slice(20)}`}function sleep(e){return new Promise(t=>setTimeout(t,e))}function retryDelay(e){const t=Math.min(1e3*Math.pow(2,e-1),3e4),n=500*Math.random()-250;return Math.max(0,t+n)}function getCookie(e){if("undefined"==typeof document)return;const t=document.cookie.match(new RegExp(`(?:^|; )${e}=([^;]*)`));return t?decodeURIComponent(t[1]):void 0}function setCookie(e,t){"undefined"!=typeof document&&(document.cookie=`${e}=${encodeURIComponent(t)}; Path=/; SameSite=Lax`)}function deleteCookie(e){"undefined"!=typeof document&&(document.cookie=`${e}=; Path=/; SameSite=Lax; Expires=Thu, 01 Jan 1970 00:00:00 GMT`)}function getLocalStorageItem(e){if("undefined"!=typeof localStorage)try{return localStorage.getItem(e)??void 0}catch{return}}function setLocalStorageItem(e,t){if("undefined"!=typeof localStorage)try{localStorage.setItem(e,t)}catch{}}function getSessionStorageItem(e){if("undefined"!=typeof sessionStorage)try{return sessionStorage.getItem(e)??void 0}catch{return}}function setSessionStorageItem(e,t){if("undefined"!=typeof sessionStorage)try{sessionStorage.setItem(e,t)}catch{}}function isValidUrl(e){try{return new URL(e),!0}catch{return!1}}class UnsharedBrowser{constructor(e={}){if(this.o="",e.baseUrl&&!isValidUrl(e.baseUrl))throw new Error('baseUrl must be a valid URL (e.g. "https://app.example.com")');let t,n;this.i=e.baseUrl?e.baseUrl.replace(/\/$/,""):"",this.u=e.maxRetries??3,this.l=e.timeout??3e4,this.m=e.includePathPrefix,this.p=e.skipPaths,this.h=e.sessionId,this.S=e.deviceId,this.o=getSessionStorageItem(SS_LAST_SUBMIT_KEY)??"";try{t=this.h?.()}catch{}this.v=t??getCookie(COOKIE_SID)??generateUUID(),setCookie(COOKIE_SID,this.v);try{n=this.S?.()}catch{}n?(this._=n,setLocalStorageItem(LS_DEVICE_ID,n)):this._=getLocalStorageItem(LS_DEVICE_ID)??"",this.I()}async init(e){try{if("undefined"!=typeof navigator&&ee(navigator.userAgent))return;if(isSentinelUserId(e.userId))return void this.C;this.C=e.userId,this.M=e.emailAddress,"undefined"!=typeof sessionStorage&&sessionStorage.setItem(SS_EMAIL_KEY,e.emailAddress),setCookie(COOKIE_UID,e.userId);let t,n=this.k();n||(n=await this.collect(),this.D(n));try{t=this.S?.()}catch{}t?(this._=t,setLocalStorageItem(LS_DEVICE_ID,t)):n.fingerprint_id&&(this._=n.fingerprint_id,setLocalStorageItem(LS_DEVICE_ID,n.fingerprint_id)),this.P(n).catch(()=>{})}catch{}}onRouteChange(){try{if(!this.L())return;const e=this.k();if(!e)return;this.P(e).catch(()=>{})}catch{}}destroy(){try{"undefined"!=typeof sessionStorage&&(sessionStorage.removeItem(SS_EMAIL_KEY),sessionStorage.removeItem(SS_FP_KEY),sessionStorage.removeItem(SS_LAST_SUBMIT_KEY)),this.o="",deleteCookie(COOKIE_UID),this.T&&"undefined"!=typeof document&&(document.removeEventListener("DOMContentLoaded",this.T),this.T=void 0),this.C=void 0,this.M=void 0}catch{}}async collect(e){const t=[...new Set(["timing","speech",...e?.exclude??[]])],n=await Z({...e,exclude:t});return{fingerprint_id:n.stableHash,full_hash:n.hash,components:n.components,timestamp:n.timestamp,isIncognito:n.isIncognito,version:n.version}}async submitFingerprintEvent(e,t){try{const n=this.A(e,t),o=generateUUID(),r=`${this.i}${SUBMIT_FP_PATH}`;return await this.U(r,JSON.stringify(n),o)}catch(e){return{success:!1,error:{code:"DELIVERY_FAILED",message:e instanceof Error?e.message:String(e)}}}}L(){if("undefined"!=typeof sessionStorage)return sessionStorage.getItem(SS_EMAIL_KEY)??void 0}k(){if("undefined"==typeof sessionStorage)return;const e=sessionStorage.getItem(SS_FP_KEY);if(e)try{return JSON.parse(e)}catch{return}}D(e){"undefined"!=typeof sessionStorage&&sessionStorage.setItem(SS_FP_KEY,JSON.stringify(e))}O(){if("undefined"==typeof location)return!0;const e=location.pathname||"/";if(this.p)for(const t of this.p)if(e.startsWith(t))return!1;return!this.m||this.m.some(t=>e.startsWith(t))}async P(e){if("undefined"!=typeof navigator&&ee(navigator.userAgent))return{success:!0};if(!this.O())return{success:!0};const t=this.M??this.L(),n=this.C??getCookie(COOKIE_UID),o="undefined"!=typeof location?(location.pathname||"/")+(location.search||""):"/";if(n){const e=`${n}|${o}`;if(e===this.o)return{success:!0};this.o=e,setSessionStorageItem(SS_LAST_SUBMIT_KEY,e)}const r={hash:e.full_hash,stable_hash:e.fingerprint_id,collected_at:(new Date).toISOString(),is_incognito:e.isIncognito,components:e.components,version:e.version,session_id:this.v,event_type:o};n&&(r.user_id=n),t&&(r.email=t);const i=`${e.fingerprint_id}|${n??""}|${o}`,a=`${this.i}${SUBMIT_FP_PATH}`;return this.U(a,JSON.stringify(r),i)}I(){"undefined"!=typeof document&&(this.T&&document.removeEventListener("DOMContentLoaded",this.T),this.T=()=>{if(!this.L())return;const e=this.k();e&&this.P(e).catch(()=>{})},document.addEventListener("DOMContentLoaded",this.T))}async U(e,t,n){const o=this.u+1;let r={success:!1,error:{code:"DELIVERY_FAILED",message:"Request failed"}};for(let i=1;i<=o;i++){i>1&&await sleep(retryDelay(i-1));const o=new AbortController,a=setTimeout(()=>o.abort(),this.l);try{const i=await fetch(e,{method:"POST",headers:{"Content-Type":"application/json","X-Idempotency-Key":n,"X-Session-Id":this.v,"X-Device-Id":this._},body:t,signal:o.signal});if(clearTimeout(a),i.status>=500){r={success:!1,error:{code:"DELIVERY_FAILED",message:`Backend returned ${i.status}`}};continue}if(i.status>=400)return{success:!1,error:{code:"DELIVERY_FAILED",message:`Backend returned ${i.status}`}};const s=await i.text().catch(()=>"{}");let c;try{c=JSON.parse(s)}catch{c={}}return!1===c?.success?{success:!1,error:c.error??{code:"UPSTREAM_ERROR",message:"Upstream failed"}}:{success:!0,data:c?.data}}catch(e){clearTimeout(a),r={success:!1,error:{code:"DELIVERY_FAILED",message:e instanceof Error?e.message:String(e)}}}}return r}A(e,t){const n={hash:e.full_hash,stable_hash:e.fingerprint_id,collected_at:e.timestamp,is_incognito:e.isIncognito,components:e.components,version:e.version,session_id:this.v};n.user_id=t.userId,null!=t?.eventType&&(n.event_type=t.eventType);const o=this.M??this.L();return o&&(n.email=o),n}}function createAxiosInterceptor(e){return t=>{if(403===t?.response?.status&&"account_flagged"===t?.response?.data?.error)try{e.onFlagged()}catch{}return Promise.reject(t)}}function createFetchInterceptor(e,t){return async(...n)=>{const o=await e(...n);if(403===o.status){const e=o.clone();try{const n=await e.json();if("account_flagged"===n?.error)try{t.onFlagged()}catch{}}catch{}}return o}}exports.UnsharedBrowser=UnsharedBrowser,exports.createAxiosInterceptor=createAxiosInterceptor,exports.createFetchInterceptor=createFetchInterceptor;
1
+ "use strict";const e="1.3.3",t=1282368115,n={exclude:[],include:[],timeout:3e3,stabilize:["private","iframe","always"],experimental:!1,debug:!1,salt:""},o=new Set(["audio","timing","navigatorConnection","domrect","permissions","fonts","speech","display","cssLayout"]),r=new Set(["domrect"]),a=new Set(["screen","mediaCapabilities","storage","features","sensors","battery","gamepads","webApis","notificationState","extendedLocale","privacyPrefs","performanceContext","canvas","audioOscillator","webglRender","canvasTextMetrics","vendorFlavors","fontPreferences","screenFrame","clientHints","domBlockers","privateClickMeasurement","automationDetection","agentDetection","tamperDetection","vmDetection","devtoolsDetection"]),i={always:[{exclude:["speech"],browsers:["brave","firefox"]},{exclude:["keyboard"],browsers:["firefox","safari"]},{exclude:["workers"],browsers:["firefox"]},{exclude:["hardwareSensitive","navigatorProps"],browsers:["brave"]},{exclude:["canvas","audioOscillator","webglRender","canvasTextMetrics"],browsers:["brave"]},{exclude:["canvas"],browsers:["firefox"]}],private:[{exclude:["fonts"],browsers:["firefox"]},{exclude:["audio"],browsers:["safari","brave"]},{exclude:["audioOscillator"],browsers:["safari"]}],iframe:[{exclude:["applePay"],browsers:["safari"]},{exclude:["permissions"]},{exclude:["keyboard"]}]};let s=null;function c(){if(s)return s;const e=navigator.userAgent;return s=function(){const e=navigator.brave;return!!e&&"function"==typeof e.isBrave}()?{name:"brave",version:l(e,/Chrome\/([\d.]+)/)}:/Edg\//i.test(e)?{name:"edge",version:l(e,/Edg\/([\d.]+)/)}:/OPR\//i.test(e)||/Opera/i.test(e)?{name:"opera",version:l(e,/OPR\/([\d.]+)/)||l(e,/Opera\/([\d.]+)/)}:/SamsungBrowser/i.test(e)?{name:"samsung",version:l(e,/SamsungBrowser\/([\d.]+)/)}:/Firefox\//i.test(e)?{name:"firefox",version:l(e,/Firefox\/([\d.]+)/)}:/Safari\//i.test(e)&&!/Chrome/i.test(e)?{name:"safari",version:l(e,/Version\/([\d.]+)/)}:/Chrome\//i.test(e)?{name:"chrome",version:l(e,/Chrome\/([\d.]+)/)}:{name:"unknown",version:""},s}function l(e,t){const n=e.match(t);return n?.[1]??""}async function u(e){try{switch(e){case"chrome":case"edge":case"opera":default:return await d();case"brave":return await async function(){return!1}();case"safari":return await async function(){if(navigator.storage?.estimate){const{quota:e}=await navigator.storage.estimate();if(void 0!==e)return e<4294967296}try{return!!navigator.storage?.getDirectory&&(await navigator.storage.getDirectory(),!1)}catch(e){return"NotFoundError"===e?.name}}();case"firefox":return await async function(){if(!("serviceWorker"in navigator))return!0;try{return!!navigator.storage?.getDirectory&&(await navigator.storage.getDirectory(),!1)}catch(e){return"SecurityError"===e?.name}}()}}catch{return!1}}async function d(){if(!navigator.storage?.estimate)return!1;const{quota:e}=await navigator.storage.estimate();return void 0!==e&&e<4294967296}function m(e,t){const n=e[0]>>>16,o=65535&e[0],r=e[1]>>>16,i=65535&e[1],a=t[0]>>>16,c=65535&t[0],s=t[1]>>>16;let u=0,l=0,d=0,f=0,m=0;return l=i+(65535&t[1]),u=l>>>16,l&=65535,d=r+s+u,u=d>>>16,d&=65535,f=o+c+u,u=f>>>16,f&=65535,m=n+a+u,m&=65535,[m<<16|f,d<<16|l]}function f(e,t){const n=e[0]>>>16,o=65535&e[0],r=e[1]>>>16,i=65535&e[1],a=t[0]>>>16,c=65535&t[0],s=t[1]>>>16,u=65535&t[1];let l=0,d=0,f=0,m=0,p=0;return d=i*u,l=d>>>16,d&=65535,f=r*u+l,l=f>>>16,f&=65535,f+=i*s,l+=f>>>16,f&=65535,m=o*u+l,l=m>>>16,m&=65535,m+=r*s,l+=m>>>16,m&=65535,m+=i*c,l+=m>>>16,m&=65535,p=n*u+o*s+r*c+i*a+l,p&=65535,[p<<16|m,f<<16|d]}function p(e,t){return 32==(t%=64)?[e[1],e[0]]:t<32?[e[0]<<t|e[1]>>>32-t,e[1]<<t|e[0]>>>32-t]:(t-=32,[e[1]<<t|e[0]>>>32-t,e[0]<<t|e[1]>>>32-t])}function h(e,t){return 0==(t%=64)?[e[0],e[1]]:t<32?[e[0]<<t|e[1]>>>32-t,e[1]<<t]:[e[1]<<t-32,0]}function g(e,t){return[e[0]^t[0],e[1]^t[1]]}function y(e){let t=[e[0],e[1]];return t=g(t,[0,t[0]>>>1]),t=f(t,[4283543511,3981806797]),t=g(t,[0,t[0]>>>1]),t=f(t,[3301882366,444984403]),t=g(t,[0,t[0]>>>1]),t}function v(e){return("00000000"+(e>>>0).toString(16)).slice(-8)}function w(e,t=0){const n=e.length%16,o=e.length-n;let r=[0,t],i=[0,t];const a=[2277735313,289559509],c=[1291169091,658871167];for(let t=0;t<o;t+=16){let n=[255&e.charCodeAt(t+4)|(255&e.charCodeAt(t+5))<<8|(255&e.charCodeAt(t+6))<<16|(255&e.charCodeAt(t+7))<<24,255&e.charCodeAt(t)|(255&e.charCodeAt(t+1))<<8|(255&e.charCodeAt(t+2))<<16|(255&e.charCodeAt(t+3))<<24],o=[255&e.charCodeAt(t+12)|(255&e.charCodeAt(t+13))<<8|(255&e.charCodeAt(t+14))<<16|(255&e.charCodeAt(t+15))<<24,255&e.charCodeAt(t+8)|(255&e.charCodeAt(t+9))<<8|(255&e.charCodeAt(t+10))<<16|(255&e.charCodeAt(t+11))<<24];n=f(n,a),n=p(n,31),n=f(n,c),r=g(r,n),r=p(r,27),r=m(r,i),r=m(f(r,[0,5]),[0,1390208809]),o=f(o,c),o=p(o,33),o=f(o,a),i=g(i,o),i=p(i,31),i=m(i,r),i=m(f(i,[0,5]),[0,944331445])}let s=[0,0],u=[0,0];switch(n){case 15:u=g(u,h([0,e.charCodeAt(o+14)],48));case 14:u=g(u,h([0,e.charCodeAt(o+13)],40));case 13:u=g(u,h([0,e.charCodeAt(o+12)],32));case 12:u=g(u,h([0,e.charCodeAt(o+11)],24));case 11:u=g(u,h([0,e.charCodeAt(o+10)],16));case 10:u=g(u,h([0,e.charCodeAt(o+9)],8));case 9:u=g(u,[0,e.charCodeAt(o+8)]),u=f(u,c),u=p(u,33),u=f(u,a),i=g(i,u);case 8:s=g(s,h([0,e.charCodeAt(o+7)],56));case 7:s=g(s,h([0,e.charCodeAt(o+6)],48));case 6:s=g(s,h([0,e.charCodeAt(o+5)],40));case 5:s=g(s,h([0,e.charCodeAt(o+4)],32));case 4:s=g(s,h([0,e.charCodeAt(o+3)],24));case 3:s=g(s,h([0,e.charCodeAt(o+2)],16));case 2:s=g(s,h([0,e.charCodeAt(o+1)],8));case 1:s=g(s,[0,e.charCodeAt(o)]),s=f(s,a),s=p(s,31),s=f(s,c),r=g(r,s)}return r=g(r,[0,e.length]),i=g(i,[0,e.length]),r=m(r,i),i=m(i,r),r=y(r),i=y(i),r=m(r,i),i=m(i,r),v(r[0])+v(r[1])+v(i[0])+v(i[1])}function b(e){return x(e,new Set)}function x(e,t){if(null===e)return"null";if(void 0===e)return"undefined";const n=typeof e;if("boolean"===n||"number"===n)return String(e);if("string"===n)return JSON.stringify(e);if(Array.isArray(e)){if(t.has(e))return'"[Circular]"';t.add(e);const n=e.map(e=>x(e,t));return t.delete(e),"["+n.join(",")+"]"}if("object"===n){const n=e;if(t.has(n))return'"[Circular]"';t.add(n);const o=Object.keys(n).sort().filter(e=>void 0!==n[e]).map(e=>JSON.stringify(e)+":"+x(n[e],t));return t.delete(n),"{"+o.join(",")+"}"}return String(e)}const S=w("",t);function _(e,n){const o=function(e){if(0===e.length)return w("",t);if(1===e.length)return w(e[0],t);let n=[...e];for(;n.length>1;){const e=[];for(let o=0;o<n.length;o+=2){const r=o+1<n.length?n[o+1]:S;e.push(w(n[o]+r,t))}n=e}return n[0]}(Object.keys(e).sort().map(n=>{const o=function(e){let n=t;for(let t=0;t<e.length;t++)n=Math.imul(n^e.charCodeAt(t),1540483477),n^=n>>>13;return n>>>0}(n);return w(b(e[n]),o)})),r=String.fromCharCode(76,111,98,115),i=n?w(n,t):"";return w(o+r+i,t)}const C={name:"webgl",tier:1,async collect(){const e=document.createElement("canvas"),t=e.getContext("webgl")||e.getContext("experimental-webgl");if(!(t&&t instanceof WebGLRenderingContext))return null;const n=t.getExtension("WEBGL_debug_renderer_info"),o=t.getSupportedExtensions()??[],r=function(e){const t={},n=[e.VERTEX_SHADER,e.FRAGMENT_SHADER],o=[e.LOW_FLOAT,e.MEDIUM_FLOAT,e.HIGH_FLOAT,e.LOW_INT,e.MEDIUM_INT,e.HIGH_INT],r=["vertex","fragment"],i=["lowFloat","mediumFloat","highFloat","lowInt","mediumInt","highInt"];for(let a=0;a<n.length;a++){const c={};for(let t=0;t<o.length;t++){const r=e.getShaderPrecisionFormat(n[a],o[t]);r&&(c[i[t]]={rangeMin:r.rangeMin,rangeMax:r.rangeMax,precision:r.precision})}t[r[a]]=c}return t}(t),i={vendor:t.getParameter(t.VENDOR),renderer:t.getParameter(t.RENDERER),version:t.getParameter(t.VERSION),shadingLanguageVersion:t.getParameter(t.SHADING_LANGUAGE_VERSION),unmaskedVendor:n?t.getParameter(n.UNMASKED_VENDOR_WEBGL):null,unmaskedRenderer:n?t.getParameter(n.UNMASKED_RENDERER_WEBGL):null,extensions:o.sort(),maxTextureSize:t.getParameter(t.MAX_TEXTURE_SIZE),maxRenderbufferSize:t.getParameter(t.MAX_RENDERBUFFER_SIZE),maxViewportDims:Array.from(t.getParameter(t.MAX_VIEWPORT_DIMS)),maxVertexAttribs:t.getParameter(t.MAX_VERTEX_ATTRIBS),maxVertexUniformVectors:t.getParameter(t.MAX_VERTEX_UNIFORM_VECTORS),maxFragmentUniformVectors:t.getParameter(t.MAX_FRAGMENT_UNIFORM_VECTORS),maxVaryingVectors:t.getParameter(t.MAX_VARYING_VECTORS),aliasedLineWidthRange:Array.from(t.getParameter(t.ALIASED_LINE_WIDTH_RANGE)),aliasedPointSizeRange:Array.from(t.getParameter(t.ALIASED_POINT_SIZE_RANGE)),maxCombinedTextureImageUnits:t.getParameter(t.MAX_COMBINED_TEXTURE_IMAGE_UNITS),maxTextureImageUnits:t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS),maxVertexTextureImageUnits:t.getParameter(t.MAX_VERTEX_TEXTURE_IMAGE_UNITS),shaderPrecision:r,maxAnisotropy:A(t),webgl2:E(e)};return t.getExtension("WEBGL_lose_context")?.loseContext(),i}};function A(e){try{const t=e.getExtension("EXT_texture_filter_anisotropic")??e.getExtension("WEBKIT_EXT_texture_filter_anisotropic")??e.getExtension("MOZ_EXT_texture_filter_anisotropic");return t?e.getParameter(t.MAX_TEXTURE_MAX_ANISOTROPY_EXT):null}catch{return null}}function E(e){try{const t=e.getContext("webgl2");if(!t)return null;const n={version:t.getParameter(t.VERSION),maxSamples:t.getParameter(t.MAX_SAMPLES),max3DTextureSize:t.getParameter(t.MAX_3D_TEXTURE_SIZE),maxArrayTextureLayers:t.getParameter(t.MAX_ARRAY_TEXTURE_LAYERS),maxUniformBlockSize:t.getParameter(t.MAX_UNIFORM_BLOCK_SIZE),maxVertexUniformComponents:t.getParameter(t.MAX_VERTEX_UNIFORM_COMPONENTS),maxFragmentUniformComponents:t.getParameter(t.MAX_FRAGMENT_UNIFORM_COMPONENTS),maxColorAttachments:t.getParameter(t.MAX_COLOR_ATTACHMENTS),maxDrawBuffers:t.getParameter(t.MAX_DRAW_BUFFERS)};return t.getExtension("WEBGL_lose_context")?.loseContext(),n}catch{return null}}const P={name:"hardware",tier:1,collect:async()=>({architecture:M(),platform:R()})},T={name:"hardwareSensitive",tier:1,collect:async()=>({deviceMemory:navigator.deviceMemory??null,hardwareConcurrency:navigator.hardwareConcurrency??null})};function R(){const e=navigator.userAgentData;if(e?.platform)return e.platform;const t=navigator.userAgent??"";return/Windows/.test(t)?"Windows":/Macintosh|Mac OS X/.test(t)?"macOS":/CrOS/.test(t)?"Chrome OS":/Android/.test(t)?"Android":/Linux/.test(t)?"Linux":/iPhone|iPad|iPod/.test(t)?"iOS":""}function M(){try{const e=new ArrayBuffer(4),t=new Float32Array(e),n=new Uint8Array(e);return t[0]=1/0,n[3]}catch{return 0}}const D={name:"math",tier:1,collect:async()=>({acos:Math.acos(.5),asin:k(Math.asin,-1,1,97),cos:k(Math.cos,0,Math.PI,97),cosLarge:Math.cos(1e20),sinLarge:Math.sin(1e20),tanLarge:Math.tan(1e20),sin:k(Math.sin,0,Math.PI,97),tan:k(Math.tan,0,Math.PI/4,97)})};function k(e,t,n,o){const r=(n-t)/o;let i=e(t)+e(n);for(let n=1;n<o;n++)i+=e(t+n*r)*(n%2==0?2:4);return i*r/3}const I={name:"i18n",tier:1,collect:async()=>({dateTimeFormat:O(),numberFormat:B(),collator:L(),pluralRules:F(),relativeTimeFormat:N(),listFormat:W()})};function O(){try{const e=(new Intl.DateTimeFormat).resolvedOptions();return{locale:e.locale,calendar:e.calendar,numberingSystem:e.numberingSystem,timeZone:e.timeZone}}catch{return{}}}function B(){try{const e=(new Intl.NumberFormat).resolvedOptions();return{locale:e.locale,numberingSystem:e.numberingSystem,style:e.style,minimumIntegerDigits:e.minimumIntegerDigits,minimumFractionDigits:e.minimumFractionDigits,maximumFractionDigits:e.maximumFractionDigits,useGrouping:e.useGrouping}}catch{return{}}}function L(){try{const e=(new Intl.Collator).resolvedOptions();return{locale:e.locale,usage:e.usage,sensitivity:e.sensitivity,collation:e.collation,numeric:e.numeric,caseFirst:e.caseFirst}}catch{return{}}}function F(){try{const e=(new Intl.PluralRules).resolvedOptions(),t=new Intl.PluralRules(void 0,{type:"ordinal"}).resolvedOptions();return{locale:e.locale,type:e.type,cardinalCategories:(new Intl.PluralRules).select(0)+","+(new Intl.PluralRules).select(1)+","+(new Intl.PluralRules).select(2)+","+(new Intl.PluralRules).select(5)+","+(new Intl.PluralRules).select(11)+","+(new Intl.PluralRules).select(100),ordinalCategory1:t.type,minimumIntegerDigits:e.minimumIntegerDigits}}catch{return{}}}function N(){try{const e=new Intl.RelativeTimeFormat;if(!e)return{};const t=e.resolvedOptions();return{locale:t.locale,style:t.style,numeric:t.numeric,numberingSystem:t.numberingSystem}}catch{return{}}}function W(){try{const e=new Intl.ListFormat;if(!e)return{};const t=e.resolvedOptions(),n=["X","Y","Z"],o=new Intl.ListFormat(void 0,{type:"conjunction",style:"long"}),r=new Intl.ListFormat(void 0,{type:"disjunction",style:"long"});return{locale:t.locale,type:t.type,style:t.style,conjunctionSample:o.format(n),disjunctionSample:r.format(n)}}catch{return{}}}const U={name:"domrect",tier:1,collect:async()=>({basic:function(){const e=document.createElement("div");e.style.cssText="position:fixed;left:-9999px;width:100px;height:100px;",document.body.appendChild(e);const t=e.getBoundingClientRect();return document.body.removeChild(e),{x:t.x,y:t.y,width:t.width,height:t.height,top:t.top,right:t.right,bottom:t.bottom,left:t.left}}(),precision:function(){const e=document.createElement("div");e.style.cssText=`position:absolute;left:-9999px;width:${Math.PI}px;height:${Math.E}px;`,document.body.appendChild(e);const t=e.getBoundingClientRect();return document.body.removeChild(e),{width:t.width,height:t.height}}(),fromRect:"undefined"!=typeof DOMRectReadOnly&&"function"==typeof DOMRectReadOnly.fromRect})},V={name:"touch",tier:1,collect:async()=>({supported:"ontouchstart"in window||navigator.maxTouchPoints>0,maxTouchPoints:navigator.maxTouchPoints??0})},G={name:"display",tier:1,collect:async()=>({colorDepth:screen.colorDepth??0,pixelDepth:screen.pixelDepth??0})},z={name:"locale",tier:1,collect:async()=>({timezone:Intl.DateTimeFormat().resolvedOptions().timeZone??"",language:navigator.language??""})},H={name:"workers",tier:1,collect:async()=>({webWorker:"undefined"!=typeof Worker,sharedWorker:"undefined"!=typeof SharedWorker,serviceWorker:"serviceWorker"in navigator})},X={name:"plugins",tier:1,async collect(){const e=[];if(navigator.plugins)for(let t=0;t<navigator.plugins.length;t++){const n=navigator.plugins[t];"internal-pdf-viewer"===n.filename&&e.push(`${n.name}|${n.filename}|${n.description}`)}return{plugins:e.sort(),pdfViewerEnabled:navigator.pdfViewerEnabled??!1}}},j=[["backdrop-filter","blur(1px)"],["container-type","inline-size"],["text-wrap","balance"],["overscroll-behavior","contain"],["hanging-punctuation","first"],["-webkit-line-clamp","1"],["appearance","none"],["font-size-adjust","ex-height 0.5"],["font-palette","normal"],["field-sizing","content"],["-webkit-text-stroke","1px black"],["zoom","1"],["scrollbar-width","thin"],["scrollbar-color","red blue"],["animation-timeline","auto"],["mask-composite","add"],["offset-path","none"],["text-decoration-thickness","1px"],["content-visibility","auto"],["contain-intrinsic-size","auto 100px"],["aspect-ratio","16/9"],["gap","10px"],["color-mix","in srgb, red 50%, blue"],["linear-gradient(in oklch, red, blue)",""]],q={name:"css",tier:1,collect:async()=>({supports:K(),safeArea:$()})};function K(){const e={};if("undefined"==typeof CSS||"function"!=typeof CSS.supports)return e;for(const[t,n]of j)e[t]=n?CSS.supports(t,n):CSS.supports(t);return e}function $(){try{const e=document.createElement("div");e.style.cssText=["position:fixed","top:0","left:0","width:0","height:0","visibility:hidden","padding-top:env(safe-area-inset-top,0px)","padding-bottom:env(safe-area-inset-bottom,0px)","padding-left:env(safe-area-inset-left,0px)","padding-right:env(safe-area-inset-right,0px)"].join(";"),document.body.appendChild(e);const t=getComputedStyle(e),n={top:t.paddingTop,bottom:t.paddingBottom,left:t.paddingLeft,right:t.paddingRight};return document.body.removeChild(e),n}catch{return null}}const Z={name:"cssLayout",tier:1,collect:async()=>({scrollbarWidth:Y()})};function Y(){try{const e=document.createElement("div");e.style.cssText="visibility:hidden;overflow:scroll;position:absolute;top:-9999px;width:100px;height:100px",document.body.appendChild(e);const t=document.createElement("div");e.appendChild(t);const n=e.offsetWidth-t.offsetWidth;return document.body.removeChild(e),n}catch{return-1}}const J={name:"navigatorProps",tier:1,collect:async()=>({vendor:navigator.vendor??"",productSub:navigator.productSub??"",cookieEnabled:navigator.cookieEnabled})},Q={name:"navigatorConnection",tier:2,async collect(){const e=navigator,t=e.connection??e.mozConnection??e.webkitConnection??null,n=performance.memory??null;return{connection:t?{type:t.type??null,effectiveType:t.effectiveType??null,saveData:t.saveData??null}:null,memory:n?{jsHeapSizeLimit:n.jsHeapSizeLimit}:null}}},ee={name:"timing",tier:2,collect:async()=>({performancePrecisionUs:te()})};function te(){try{const e=performance.now();let t=1/0,n=e;for(let o=0;o<50;o++){const o=performance.now(),r=o-n;if(r>0&&r<t&&(t=r),n=o,o-e>=1)break}if(t===1/0)return-1;const o=1e3*t;if(o<=0)return-1;const r=Math.max(0,Math.round(Math.log10(o)));return Math.pow(10,r)}catch{return-1}}const ne={name:"webgpu",tier:2,async collect(){const e=navigator.gpu;if(!e)return null;const t=await e.requestAdapter();if(!t)return null;let n="",o="",r="",i="";if(t.info)n=t.info.vendor??"",o=t.info.architecture??"",r=t.info.device??"",i=t.info.description??"";else if("function"==typeof t.requestAdapterInfo){const e=await t.requestAdapterInfo();n=e.vendor??"",o=e.architecture??"",r=e.device??"",i=e.description??""}const a=[];t.features&&(t.features.forEach(e=>a.push(e)),a.sort());const c={};if(t.limits){const e=["maxTextureDimension1D","maxTextureDimension2D","maxTextureDimension3D","maxTextureArrayLayers","maxBindGroups","maxBindGroupsPlusVertexBuffers","maxBindingsPerBindGroup","maxDynamicUniformBuffersPerPipelineLayout","maxDynamicStorageBuffersPerPipelineLayout","maxSampledTexturesPerShaderStage","maxSamplersPerShaderStage","maxStorageBuffersPerShaderStage","maxStorageTexturesPerShaderStage","maxUniformBuffersPerShaderStage","maxUniformBufferBindingSize","maxStorageBufferBindingSize","minUniformBufferOffsetAlignment","minStorageBufferOffsetAlignment","maxVertexBuffers","maxBufferSize","maxVertexAttributes","maxVertexBufferArrayStride","maxInterStageShaderComponents","maxInterStageShaderVariables","maxColorAttachments","maxColorAttachmentBytesPerSample","maxComputeWorkgroupStorageSize","maxComputeInvocationsPerWorkgroup","maxComputeWorkgroupSizeX","maxComputeWorkgroupSizeY","maxComputeWorkgroupSizeZ","maxComputeWorkgroupsPerDimension"];for(const n of e){const e=t.limits[n];void 0!==e&&(c[n]=e)}}return{vendor:n,architecture:o,device:r,description:i,features:a,limits:c}}},oe={name:"audio",tier:2,async collect(){const e=window.AudioContext||window.webkitAudioContext;if(!e)return null;let t=null;try{t=new e;const n=t.destination;return{sampleRate:t.sampleRate,maxChannelCount:n.maxChannelCount,channelCount:n.channelCount,channelCountMode:n.channelCountMode,channelInterpretation:n.channelInterpretation,baseLatency:t.baseLatency??null,outputLatency:t.outputLatency??null}}finally{if(t&&"closed"!==t.state)try{await t.close()}catch{}}}},re=["Arial","Arial Black","Arial Narrow","Arial Rounded MT Bold","Bookman Old Style","Bradley Hand","Calibri","Cambria","Cambria Math","Century","Century Gothic","Comic Sans MS","Consolas","Courier","Courier New","Garamond","Geneva","Georgia","Gill Sans","Helvetica","Helvetica Neue","Impact","Lucida Console","Lucida Grande","Lucida Sans Unicode","Microsoft Sans Serif","Monaco","Palatino","Palatino Linotype","Segoe Print","Segoe Script","Segoe UI","Tahoma","Times","Times New Roman","Trebuchet MS","Verdana","Wingdings","Wingdings 2","Wingdings 3","Inter","Roboto","Open Sans","Lato","Montserrat","Poppins","Nunito","Raleway","Ubuntu","Merriweather","Playfair Display","Source Sans Pro","Source Code Pro","Fira Code","JetBrains Mono","Cascadia Code","Apple Color Emoji","Segoe UI Emoji","Noto Color Emoji","SF Pro","SF Pro Display","SF Mono","San Francisco","Menlo","Andale Mono","Futura","MS Gothic","MS Mincho","MS PGothic","MS PMincho","Yu Gothic","Meiryo","Hiragino Sans","Hiragino Kaku Gothic Pro","SimSun","SimHei","Microsoft YaHei","PingFang SC","Noto Sans CJK","Malgun Gothic","Arial Hebrew"],ae=["monospace","sans-serif","serif"],ie="mmMwWLliI0O&1",se={name:"fonts",tier:2,collect:()=>new Promise(e=>{const t=()=>e(function(){try{if("undefined"==typeof document)return{available:[],method:"css-layout"};const e=new Set,t=[];if("function"==typeof document.fonts?.check)for(const n of re)document.fonts.check(`72px "${n}"`)?e.add(n):t.push(n);else t.push(...re);const n=new Set;if(t.length>0){const e=document.createElement("div");e.style.cssText="position:absolute;visibility:hidden;top:-9999px;left:-9999px;pointer-events:none;";const o=ae.map(t=>{const n=document.createElement("span");return n.style.cssText=`font-size:72px;font-family:${t};white-space:nowrap;display:inline-block`,n.textContent=ie,e.appendChild(n),n}),r=t.map(t=>ae.map(n=>{const o=document.createElement("span");return o.style.cssText=`font-size:72px;font-family:'${t}',${n};white-space:nowrap;display:inline-block`,o.textContent=ie,e.appendChild(o),o}));document.body.appendChild(e);const i=o.map(e=>e.getBoundingClientRect().width),a=r.map(e=>e.map(e=>e.getBoundingClientRect().width));document.body.removeChild(e);for(let e=0;e<t.length;e++)for(let o=0;o<ae.length;o++)if(a[e][o]!==i[o]){n.add(t[e]);break}}return{available:re.filter(t=>e.has(t)||n.has(t)),method:"css-layout"}}catch{return{available:[],method:"css-layout"}}}());"undefined"!=typeof requestIdleCallback?requestIdleCallback(t,{timeout:2e3}):setTimeout(t,0)})},ce={name:"webrtc",tier:2,async collect(){if("undefined"==typeof RTCPeerConnection)return{supported:!1,audioCodecCount:0,videoCodecCount:0,audioCodecs:[],videoCodecs:[],extensions:[]};const e=new RTCPeerConnection({iceServers:[]});try{e.addTransceiver("audio"),e.addTransceiver("video");const t=(await e.createOffer()).sdp??"",n=le(t,"audio"),o=le(t,"video"),r=function(e){const t=new Set,n=e.split("\r\n");for(const e of n)if(e.startsWith("a=extmap:")){const n=e.match(/^a=extmap:\d+(?:\/\w+)?\s+(.+)$/);n&&t.add(n[1].trim())}return Array.from(t)}(t);return{supported:!0,audioCodecCount:n.length,videoCodecCount:o.length,audioCodecs:n.sort(),videoCodecs:o.sort(),extensions:r.sort()}}finally{e.close()}}};function le(e,t){const n=[],o=e.split("\r\n");let r=!1;for(const e of o)if(e.startsWith(`m=${t}`))r=!0;else{if(e.startsWith("m=")&&r)break;if(r&&e.startsWith("a=rtpmap:")){const t=e.match(/^a=rtpmap:\d+\s+(.+)$/);t&&n.push(t[1])}}return n}const ue=["accelerometer","accessibility-events","ambient-light-sensor","background-fetch","background-sync","bluetooth","camera","clipboard-read","clipboard-write","display-capture","geolocation","gyroscope","local-fonts","magnetometer","microphone","midi","nfc","notifications","payment-handler","persistent-storage","push","screen-wake-lock","speaker-selection","storage-access","top-level-storage-access","window-management","xr-spatial-tracking"],de={name:"permissions",tier:2,async collect(){if(!navigator.permissions?.query)return{states:{}};const e=()=>Promise.allSettled(ue.map(async e=>{try{return{name:e,state:(await navigator.permissions.query({name:e})).state}}catch{return{name:e,state:"error"}}})),t=await Promise.all([e(),e(),e()]),n={};for(const e of t)for(const t of e)if("fulfilled"===t.status){const{name:e,state:o}=t.value;n[e]||(n[e]=[]),n[e].push(o)}const o={};for(const[e,t]of Object.entries(n))o[e]=me(t);return{states:o}}};function me(e){const t={};for(const n of e)t[n]=(t[n]??0)+1;let n=e[0],o=0;for(const[e,r]of Object.entries(t))r>o&&(n=e,o=r);return n}const fe={name:"speech",tier:2,async collect(){if("undefined"==typeof speechSynthesis)return{supported:!1,voiceCount:0,voices:[]};const e=await new Promise(e=>{const t=speechSynthesis.getVoices();if(t.length>0)return void e(t);const n=setTimeout(()=>e([]),800);speechSynthesis.addEventListener("voiceschanged",()=>{clearTimeout(n),e(speechSynthesis.getVoices())},{once:!0})}),t=e.map(e=>`${e.name}|${e.lang}|${e.localService}`).sort();return{supported:!0,voiceCount:e.length,voices:t}}},pe=[{name:"prefers-contrast",values:["no-preference","more","less","custom"]},{name:"any-hover",values:["none","hover"]},{name:"any-pointer",values:["none","coarse","fine"]},{name:"pointer",values:["none","coarse","fine"]},{name:"hover",values:["none","hover"]},{name:"update",values:["none","slow","fast"]},{name:"inverted-colors",values:["none","inverted"]},{name:"prefers-reduced-motion",values:["no-preference","reduce"]},{name:"prefers-reduced-transparency",values:["no-preference","reduce"]},{name:"scripting",values:["none","initial-only","enabled"]},{name:"forced-colors",values:["none","active"]},{name:"prefers-color-scheme",values:["light","dark"]},{name:"color-gamut",values:["srgb","p3","rec2020"]},{name:"dynamic-range",values:["standard","high"]}],he={name:"mediaQueries",tier:2,async collect(){if("function"!=typeof matchMedia){const e={};for(const t of pe)e[t.name.replace(/-([a-z])/g,(e,t)=>t.toUpperCase())]="unsupported";return{...e,monochrome:0}}const e={};for(const t of pe){let n="unknown";for(const e of t.values){const o=matchMedia(`(${t.name}: ${e})`);if(o?.matches){n=e;break}}e[t.name.replace(/-([a-z])/g,(e,t)=>t.toUpperCase())]=n}let t=0;for(let e=100;e>=0;e--)if(matchMedia(`(monochrome: ${e})`)?.matches){t=e;break}return{...e,monochrome:t}}},ge={name:"applePay",tier:2,async collect(){const e=window.ApplePaySession;if(!e||"function"!=typeof e.supportsVersion)return{supported:!1,maxVersion:0};let t=0;for(let n=15;n>=1;n--)try{if(e.supportsVersion(n)){t=n;break}}catch{continue}return{supported:!0,maxVersion:t}}},ye=["KeyQ","KeyW","KeyA","KeyS","KeyZ","KeyX","KeyY","KeyM","Semicolon","BracketLeft","Quote","Digit1","Digit2","Digit3"],ve={name:"keyboard",tier:2,async collect(){const e=navigator.keyboard;if(!e||"function"!=typeof e.getLayoutMap)return{supported:!1,layoutKeys:null,layoutHint:null};try{const t=await e.getLayoutMap(),n={};for(const e of ye){const o=t.get(e);void 0!==o&&(n[e]=o)}return{supported:!0,layoutKeys:n,layoutHint:we(n)}}catch{return{supported:!1,layoutKeys:null,layoutHint:null}}}};function we(e){const t=e.KeyQ,n=e.KeyZ,o=e.KeyY;return t?"a"===t?"azerty":"q"===t&&"z"===o?"qwertz":"q"===t&&"z"===n?"qwerty":"'"===t?"dvorak":"other":null}const be={name:"canvas",tier:2,async collect(){const e=document.createElement("canvas"),t=e.getContext("2d");if(!t)return null;e.width=240,e.height=120,t.textBaseline="alphabetic",t.fillStyle="#f60",t.fillRect(100,1,62,20),t.fillStyle="#069",t.font='11pt "Times New Roman"',t.fillText("Cwm fjordbank gly"+String.fromCharCode(55357,56835),2,15),t.fillStyle="rgba(102,204,0,0.2)",t.font="18pt Arial",t.fillText("Cwm fjordbank gly"+String.fromCharCode(55357,56835),4,45);const n=e.toDataURL("image/png");t.clearRect(0,0,e.width,e.height),t.globalCompositeOperation="multiply",t.fillStyle="#f2f",t.beginPath(),t.arc(40,40,40,0,2*Math.PI),t.fill(),t.fillStyle="#2ff",t.beginPath(),t.arc(80,40,40,0,2*Math.PI),t.fill(),t.fillStyle="#ff2",t.beginPath(),t.arc(60,80,40,0,2*Math.PI),t.fill(),t.globalCompositeOperation="source-over",t.fillStyle="#f9c",t.beginPath(),t.arc(60,60,60,0,2*Math.PI),t.arc(60,60,20,0,2*Math.PI),t.fill("evenodd");const o=e.toDataURL("image/png");return{textDataUrl:n,geometryDataUrl:o,readbackAllowed:n.length>=1e3&&o.length>=1e3,windingRule:0===t.getImageData(60,60,1,1).data[3]}}},xe={name:"audioOscillator",tier:2,async collect(){const e=window.OfflineAudioContext||window.webkitOfflineAudioContext;if(!e)return null;const t=new e(1,5e3,44100),n=t.createOscillator();n.type="triangle",n.frequency.value=1e4;const o=t.createDynamicsCompressor();o.threshold.value=-50,o.knee.value=40,o.ratio.value=12,o.attack.value=0,o.release.value=.25,n.connect(o),o.connect(t.destination),n.start(0);const r=(await t.startRendering()).getChannelData(0).slice(4500,5e3);let i=0;for(let e=0;e<r.length;e++)i+=Math.abs(r[e]);return{sampleSum:i,sampleCount:r.length}}},Se={name:"webglRender",tier:2,async collect(){const e=document.createElement("canvas");e.width=256,e.height=256;const t=e.getContext("webgl",{preserveDrawingBuffer:!0});if(!t)return null;try{const e="\n attribute vec2 position;\n attribute vec3 color;\n varying vec3 vColor;\n void main() {\n gl_Position = vec4(position, 0.0, 1.0);\n vColor = color;\n }\n ",n="\n precision mediump float;\n varying vec3 vColor;\n void main() {\n gl_FragColor = vec4(vColor, 1.0);\n }\n ",o=t.createShader(t.VERTEX_SHADER);t.shaderSource(o,e),t.compileShader(o);const r=t.createShader(t.FRAGMENT_SHADER);t.shaderSource(r,n),t.compileShader(r);const i=t.createProgram();t.attachShader(i,o),t.attachShader(i,r),t.linkProgram(i),t.useProgram(i);const a=new Float32Array([-.5,-.5,1,0,0,.5,-.5,0,1,0,0,.5,0,0,1]),c=t.createBuffer();t.bindBuffer(t.ARRAY_BUFFER,c),t.bufferData(t.ARRAY_BUFFER,a,t.STATIC_DRAW);const s=t.getAttribLocation(i,"position");t.enableVertexAttribArray(s),t.vertexAttribPointer(s,2,t.FLOAT,!1,20,0);const u=t.getAttribLocation(i,"color");t.enableVertexAttribArray(u),t.vertexAttribPointer(u,3,t.FLOAT,!1,20,8),t.clearColor(0,0,0,1),t.clear(t.COLOR_BUFFER_BIT),t.drawArrays(t.TRIANGLES,0,3),t.enable(t.BLEND),t.blendFunc(t.SRC_ALPHA,t.ONE_MINUS_SRC_ALPHA),t.drawArrays(t.TRIANGLES,0,3);const l=new Uint8Array(262144);t.readPixels(0,0,256,256,t.RGBA,t.UNSIGNED_BYTE,l);const d=function(e){let t=2166136261;for(let n=0;n<e.length;n++)t^=e[n],t=Math.imul(t,16777619);return(t>>>0).toString(16).padStart(8,"0")}(l);let f=!1;for(let e=0;e<l.length;e++)if(0!==l[e]){f=!0;break}return{pixelHash:d,readbackAllowed:f}}finally{t.getExtension("WEBGL_lose_context")?.loseContext()}}},_e=["14px Arial","14px Georgia","14px monospace"],Ce={name:"canvasTextMetrics",tier:2,async collect(){const e=document.createElement("canvas").getContext("2d");if(!e)return null;const t=[];for(const n of _e){e.font=n;const o=e.measureText("Sphinx of black quartz, judge my vow. 0123456789");t.push({font:n,width:o.width,actualBoundingBoxAscent:o.actualBoundingBoxAscent??null,actualBoundingBoxDescent:o.actualBoundingBoxDescent??null,actualBoundingBoxLeft:o.actualBoundingBoxLeft??null,actualBoundingBoxRight:o.actualBoundingBoxRight??null,fontBoundingBoxAscent:o.fontBoundingBoxAscent??null,fontBoundingBoxDescent:o.fontBoundingBoxDescent??null})}return{metrics:t}}},Ae=["chrome","safari","__crWeb","__gCrWeb","yandex","__yb","__ybro","__firefox__","__edgeTrackingPreventionStatistics","webkit","oprt","samsungAr","ucweb","UCShellJava","puffinDevice"],Ee={name:"vendorFlavors",tier:2,async collect(){const e=window,t=[];for(const n of Ae)void 0!==e[n]&&t.push(n);return t.sort(),{flavors:t}}},Pe=[{key:"default",family:""},{key:"apple",family:"-apple-system, BlinkMacSystemFont"},{key:"serif",family:"serif"},{key:"sansSerif",family:"sans-serif"},{key:"monospace",family:"monospace"},{key:"systemUi",family:"system-ui"}],Te={name:"fontPreferences",tier:2,async collect(){if("undefined"==typeof document||!document.body)return null;const e=document.createElement("div");e.style.cssText="position:absolute;visibility:hidden;top:-9999px";const t=Pe.map(({family:t})=>{const n=document.createElement("span");return n.textContent="mmMwWLliI0fiflO&1",n.style.fontSize="72px",t&&(n.style.fontFamily=t),e.appendChild(n),n});document.body.appendChild(e);const n={};for(let e=0;e<Pe.length;e++){const o=t[e].getBoundingClientRect().width;n[Pe[e].key]=Math.round(1e3*o)/1e3}return document.body.removeChild(e),n}},Re={name:"screenFrame",tier:2,async collect(){const e=screen,t=e.availTop??0,n=e.availLeft??0;return{top:t,right:screen.width-(e.availWidth??screen.width)-n,bottom:screen.height-(e.availHeight??screen.height)-t,left:n}}};function Me(e){return/Not[ ;)\/]/i.test(e)}const De={name:"clientHints",tier:2,async collect(){const e=navigator;if(!e.userAgentData)return null;const t=(e.userAgentData.brands??[]).filter(e=>!Me(e.brand)),n=e.userAgentData.mobile??!1,o=e.userAgentData.platform??"",r=await e.userAgentData.getHighEntropyValues(["architecture","bitness","model","platformVersion","fullVersionList"]),i=(r.fullVersionList??[]).filter(e=>!Me(e.brand));return{brands:t,mobile:n,platform:o,architecture:r.architecture??"",bitness:r.bitness??"",model:r.model??"",platformVersion:r.platformVersion??"",fullVersionList:i}}},ke=[{name:"EasyList",selectors:[".ad-banner",".ad_banner","#ad-banner",".adsbygoogle",".ad-container"]},{name:"AdGuard Base",selectors:[".BannerAd",".ad-rotate","#ad-box",".ad-placement",".ad-zone"]},{name:"EasyPrivacy",selectors:["#tracking-pixel",".tracking",".analytics-tag","#beacon",".pixel-tracker"]},{name:"Fanboy Annoyances",selectors:["#newsletter-popup",".cookie-banner",".consent-dialog","#gdpr-notice",".subscribe-modal"]},{name:"AdGuard Tracking",selectors:[".tracker-frame","#analytics-beacon",".telemetry-pixel",".data-tracker","#stats-counter"]}],Ie={name:"domBlockers",tier:2,async collect(){if("undefined"==typeof document||!document.body)return{activeFilters:[]};const e=[],t=[];try{for(const n of ke){const o=[];for(const t of n.selectors){const n=document.createElement("div");t.startsWith("#")?n.id=t.slice(1):n.className=t.slice(1),document.body.appendChild(n),o.push(n),e.push(n)}t.push({name:n.name,elements:o})}await new Promise(e=>setTimeout(e,0));const n=[];for(const{name:e,elements:o}of t){let t=0;for(const e of o)null===e.offsetParent&&t++;t/o.length>.6&&n.push(e)}return{activeFilters:n}}catch{return{activeFilters:[]}}finally{for(const t of e)try{t.parentNode?.removeChild(t)}catch{}}}},Oe={name:"privateClickMeasurement",tier:2,collect:async()=>({supported:"attributionSourceId"in document.createElement("a")})},Be={name:"automationDetection",tier:2,async collect(){const e=!!navigator.webdriver,t=function(){const e=[];try{const t=Object.getOwnPropertyNames(document);for(const n of t)/^\$?cdc_/.test(n)&&e.push(n)}catch{}const t=[["_Selenium_IDE_Recorder",()=>"t"in window],["__webdriver_evaluate",()=>"o"in document],["__driver_evaluate",()=>"i"in document],["__puppeteer_evaluation_script__",()=>"u"in window],["__playwright__binding__",()=>"l"in window],["__pwInitScripts",()=>"m"in window],["callPhantom",()=>"callPhantom"in window],["_phantom",()=>"p"in window],["__nightmare",()=>"h"in window],["domAutomation",()=>"domAutomation"in window],["domAutomationController",()=>"domAutomationController"in window]];for(const[n,o]of t)try{o()&&e.push(n)}catch{}return e}(),n=await async function(){try{if("undefined"==typeof Proxy)return!1;let e=!1;const t={};return Object.setPrototypeOf(t,new Proxy(Object.create(null),{ownKeys:()=>(e=!0,[])})),console.groupEnd(t),await new Promise(e=>setTimeout(e,100)),e}catch{return!1}}(),o=await async function(){const e=[];try{0===navigator.plugins.length&&window.chrome&&e.push("no_plugins_with_chrome")}catch{}0!==window.outerWidth&&0!==window.outerHeight||e.push("zero_outer_dimensions"),0===screen.availHeight&&e.push("zero_avail_height");try{0===navigator.languages.length&&e.push("empty_languages")}catch{}try{window.chrome&&void 0===window.chrome?.runtime&&e.push("chrome_without_runtime")}catch{}try{"undefined"!=typeof Notification&&"denied"===Notification.permission&&"prompt"===(await navigator.permissions.query({name:"notifications"})).state&&e.push("notification_permission_contradiction")}catch{}return e}(),r=function(){let e=null;try{if(e=document.createElement("canvas").getContext("webgl"),!e)return!1;const t=e.getExtension("WEBGL_debug_renderer_info");if(!t)return!1;const n=e.getParameter(t.UNMASKED_RENDERER_WEBGL);if("string"!=typeof n)return!1;const o=["swiftshader","google swiftshader","llvmpipe","mesa","software rasterizer","microsoft basic render driver"],r=n.toLowerCase();return o.some(e=>r.includes(e))}catch{return!1}finally{if(e){const t=e.getExtension("WEBGL_lose_context");t&&t.loseContext()}}}();let i=0;return e&&(i+=30),t.length>0&&(i+=20),n&&(i+=25),o.length>=2&&(i+=15),r&&(i+=20),{webdriver:e,automationMarkers:t,cdpDetected:n,headlessIndicators:o,softwareRenderer:r,botScore:i}}},Le={name:"agentDetection",tier:2,async collect(){const e=function(){const e=[];try{13===navigator.hardwareConcurrency&&e.push("unusual_core_count_13")}catch{}try{4===navigator.deviceMemory&&6===navigator.hardwareConcurrency&&e.push("manus_hardware_signature")}catch{}try{1280===screen.width&&1100===screen.height&&e.push("manus_resolution")}catch{}try{if("UTC"===Intl.DateTimeFormat().resolvedOptions().timeZone){const t=navigator.languages||[],n=["en-GB","pt-PT","is","is-IS"];t.some(e=>n.includes(e))||e.push("utc_timezone_mismatch")}}catch{}return e}(),t=function(){try{const e=navigator.userAgent||"",t=navigator.userAgentData?.platform,n=navigator.platform||"";let o="";if(/Windows/.test(e)?o="Windows":/Macintosh|Mac OS X/.test(e)?o="macOS":/Android/.test(e)?o="Android":/iPhone|iPad|iPod/.test(e)?o="iOS":/Linux/.test(e)&&(o="Linux"),t){const e=t.toLowerCase();if("linux"===e&&("macOS"===o||"Windows"===o))return!1;if("windows"===e&&"macOS"===o)return!1;if("macos"===e&&"Windows"===o)return!1}if(n){const e=n.toLowerCase();if(e.includes("linux")&&("macOS"===o||"Windows"===o))return!1;if(e.includes("win")&&"macOS"===o)return!1;if(e.includes("mac")&&"Windows"===o)return!1}return!0}catch{return!0}}(),n=function(){try{const e=Intl.DateTimeFormat().resolvedOptions().timeZone,t=(new Date).getTimezoneOffset();return"UTC"!==e||0===t}catch{return!0}}(),o=function(e,t){return e.includes("unusual_core_count_13")?"chatgpt":e.includes("manus_hardware_signature")&&e.includes("manus_resolution")?"manus":t?null:"operator"}(e,t);let r=0;return r+=25*e.length,t||(r+=30),o&&(r+=50),{fingerprintAnomalies:e,uaPlatformMatch:t,timezoneConsistent:n,detectedAgent:o,agentScore:r}}},Fe={name:"tamperDetection",tier:2,async collect(){const e=function(){try{const e=navigator.userAgent||"",t=/Chrome\//.test(e)&&!/Edg\//.test(e),n=/Firefox\//.test(e)&&!/Chrome/.test(e),o="undefined"!=typeof CSS&&CSS.supports&&CSS.supports("-moz-appearance","none"),r=void 0!==window.chrome;return!(t&&o||n&&r)}catch{return!0}}(),t=function(){try{const e=Object.getOwnPropertyDescriptor(Navigator.prototype,"userAgent");if(!e)return!1;if(!e.get)return!1;const t=e.get.toString();return!!/\[native code\]/.test(t)}catch{return!0}}(),n=function(){try{const e=eval.toString().length;if(33!==e&&37!==e&&39!==e&&(e<20||e>60))return!1;try{if(1!==new(0,navigator.userAgent.constructor.constructor)("return 1")())return!1}catch{return!1}return!0}catch{return!0}}(),o=function(){const e=[];try{"v"in window&&e.push("multilogin")}catch{}try{void 0!==window.chrome&&0===navigator.plugins.length&&e.push("empty_plugins_chromium")}catch{}try{const t=window;if(t.safari){const n=t.safari.toString?.();n&&!/\[object Safari\]/.test(n)&&e.push("safari_object_spoofed")}}catch{}try{const t=navigator.userAgent||"",n=t.match(/Chrome\/(\d+)/);n&&parseInt(n[1],10)>=88&&/Macintosh/.test(t)&&void 0===window.BarcodeDetector&&e.push("missing_barcode_detector")}catch{}return e}(),r=function(){try{const e=((new Error).stack||"").split("\n").filter(e=>e.trim().length>0);for(const t of e){const e=t.trim();if("Error"!==e){if(/^\s*at\s/.test(e))return"chromium";if(/@/.test(e)&&!e.startsWith("at"))return/^\w+@/.test(e)?"gecko":"webkit"}}return"unknown"}catch{return"unknown"}}(),i=eval.toString().length;let a=0;if(e||(a+=30),t||(a+=25),n||(a+=20),a+=15*o.length,"unknown"!==r){const e=navigator.userAgent||"";("gecko"===r&&!/Firefox/.test(e)||"chromium"===r&&/Firefox/.test(e)&&!/Chrome/.test(e))&&(a+=10)}return{uaEngineConsistent:e,navigatorPropsNative:t,prototypeChainIntact:n,antiDetectMarkers:o,stackTraceFormat:r,evalLength:i,tamperScore:a}}},Ne={name:"vmDetection",tier:2,async collect(){const e=function(){const e=[];try{navigator.hardwareConcurrency<=2&&e.push("low_core_count")}catch{}try{const t=navigator.deviceMemory;"number"==typeof t&&t<=2&&e.push("low_memory")}catch{}try{screen.colorDepth<24&&e.push("low_color_depth")}catch{}try{screen.colorDepth!==screen.pixelDepth&&e.push("depth_mismatch")}catch{}return e}();let t="",n=null;try{if(n=document.createElement("canvas").getContext("webgl"),n){const e=n.getExtension("WEBGL_debug_renderer_info");e&&(t=n.getParameter(e.UNMASKED_RENDERER_WEBGL)||"")}}catch{}finally{if(n)try{const e=n.getExtension("WEBGL_lose_context");e&&e.loseContext()}catch{}}const o=function(e){if(!e)return[];const t=e.toLowerCase();return We.filter(e=>t.includes(e))}(t),r=function(e){if(!e)return!1;const t=e.toLowerCase();return Ue.some(e=>t.includes(e))}(t);let i=0;return o.length>0?i=.9:r?i=.5:e.length>=3&&(i=.3),{isVM:o.length>0,vmRendererMatches:o,softwareRenderer:r,confidence:i,indicators:e}}},We=["virtualbox","vmware","svga3d","qemu","parallels","hyper-v","qxl","red hat","virtio","citrix"],Ue=["swiftshader","google swiftshader","llvmpipe","mesa","software rasterizer","microsoft basic render driver","softpipe"],Ve=[{label:"h264",contentType:'video/mp4; codecs="avc1.42E01E"',width:1920,height:1080,bitrate:5e6,framerate:30},{label:"vp8",contentType:'video/webm; codecs="vp8"',width:1920,height:1080,bitrate:5e6,framerate:30},{label:"vp9",contentType:'video/webm; codecs="vp09.00.10.08"',width:1920,height:1080,bitrate:5e6,framerate:30},{label:"av1",contentType:'video/mp4; codecs="av01.0.05M.08"',width:1920,height:1080,bitrate:5e6,framerate:30}],Ge=[{label:"aac",contentType:'audio/mp4; codecs="mp4a.40.2"',channels:"2",bitrate:128e3,samplerate:44100},{label:"opus",contentType:'audio/webm; codecs="opus"',channels:"2",bitrate:128e3,samplerate:48e3}],ze=[C,P,T,D,I,U,V,G,z,H,X,q,Z,J,ee,Q,ne,oe,se,ce,de,fe,he,ge,ve,be,xe,Se,Ce,Ee,Te,Re,De,Ie,Oe,Be,Le,Fe,Ne,{name:"devtoolsDetection",tier:2,collect:async()=>({dimensionDelta:function(){const e=window.outerHeight-window.innerHeight,t=window.outerWidth-window.innerWidth;return{heightDelta:e,widthDelta:t,likelyOpen:e>200||t>200}}(),consoleTimingAnomaly:function(){try{const e={};for(let t=0;t<1e3;t++)e[`key${t}`]=t;const t=performance.now();return console.log(e),performance.now()-t>1}catch{return!1}}(),consoleNative:function(){try{return/\[native code\]/.test(Function.prototype.toString.call(console.log))}catch{return!0}}()})},{name:"webApis",tier:2,async collect(){const e=navigator,t=window;return{credentials:void 0!==e.credentials,usb:void 0!==e.usb,bluetooth:void 0!==e.bluetooth,clipboard:void 0!==e.clipboard,serial:void 0!==e.serial,hid:void 0!==e.hid,xr:void 0!==e.xr,share:"function"==typeof e.share,wakeLock:void 0!==e.wakeLock,presentation:void 0!==e.presentation,mediaSession:void 0!==e.mediaSession,ink:void 0!==e.ink,virtualKeyboard:void 0!==e.virtualKeyboard,eyeDropper:void 0!==t.EyeDropper,getScreenDetails:"function"==typeof t.getScreenDetails,paymentRequest:void 0!==t.PaymentRequest,adoptedStyleSheets:void 0!==document.adoptedStyleSheets,cssHighlights:void 0!==t.CSS?.highlights}}},{name:"notificationState",tier:2,async collect(){const e="undefined"!=typeof Notification;return{supported:e,permission:e?Notification.permission:null}}},{name:"extendedLocale",tier:2,collect:async()=>({languages:Array.from(navigator.languages??[])})},{name:"privacyPrefs",tier:2,async collect(){const e=navigator;return{doNotTrack:navigator.doNotTrack??null,globalPrivacyControl:e.globalPrivacyControl??null}}},{name:"performanceContext",tier:2,async collect(){let e=null;try{const t=performance.getEntriesByType("navigation");t.length>0&&(e=t[0].nextHopProtocol||null)}catch{}let t=[];try{t=Array.from(PerformanceObserver.supportedEntryTypes??[])}catch{}return{nextHopProtocol:e,supportedEntryTypes:t}}},{name:"sensors",tier:2,async collect(){const e=window;return{deviceOrientation:void 0!==e.DeviceOrientationEvent,deviceMotion:void 0!==e.DeviceMotionEvent,gyroscope:void 0!==e.Gyroscope,accelerometer:void 0!==e.Accelerometer,ambientLightSensor:void 0!==e.AmbientLightSensor,absoluteOrientationSensor:void 0!==e.AbsoluteOrientationSensor,relativeOrientationSensor:void 0!==e.RelativeOrientationSensor}}},{name:"battery",tier:2,collect:async()=>({supported:"function"==typeof navigator.getBattery})},{name:"gamepads",tier:2,collect:async()=>({supported:"function"==typeof navigator.getGamepads})},{name:"storage",tier:2,async collect(){let e=null;try{navigator.storage?.estimate&&(e=(await navigator.storage.estimate()).quota??null)}catch{}let t=!1;try{t=void 0!==window.indexedDB}catch{}let n=!1;try{n=void 0!==window.localStorage}catch{}return{quota:e,indexedDB:t,localStorage:n,cacheApi:void 0!==window.caches}}},{name:"features",tier:2,async collect(){const e=window;return{isSecureContext:!!e.isSecureContext,webdriver:!!navigator.webdriver,crossOriginIsolated:!!e.crossOriginIsolated,sharedArrayBuffer:void 0!==e.SharedArrayBuffer,webAssembly:void 0!==e.WebAssembly,bigInt:void 0!==e.BigInt,offscreenCanvas:void 0!==e.OffscreenCanvas}}},{name:"screen",tier:2,async collect(){const e=window.visualViewport;return{availWidth:screen.availWidth??0,availHeight:screen.availHeight??0,devicePixelRatio:window.devicePixelRatio??1,orientationType:screen.orientation?.type??null,orientationAngle:screen.orientation?.angle??null,visualViewport:e?{width:e.width,height:e.height,offsetLeft:e.offsetLeft,offsetTop:e.offsetTop,scale:e.scale}:null}}},{name:"mediaCapabilities",tier:2,async collect(){if(!navigator.mediaCapabilities?.decodingInfo)return null;const e={},t=[...Ve.map(e=>({label:e.label,config:{type:"file",video:{contentType:e.contentType,width:e.width,height:e.height,bitrate:e.bitrate,framerate:e.framerate}}})),...Ge.map(e=>({label:e.label,config:{type:"file",audio:{contentType:e.contentType,channels:e.channels,bitrate:e.bitrate,samplerate:e.samplerate}}}))];return await Promise.allSettled(t.map(async({label:t,config:n})=>{try{const o=await navigator.mediaCapabilities.decodingInfo(n);e[t]={supported:o.supported,smooth:o.smooth,powerEfficient:o.powerEfficient}}catch{e[t]=null}})),e}}];async function He(e,t,n){const o={},r=[],i=ze.filter(t=>!e.has(t.name)&&(n||3!==t.tier)),a=await Promise.allSettled(i.map(async e=>{const n=await(o=e.collect(),r=t,new Promise((e,t)=>{const n=setTimeout(()=>e(null),r);o.then(t=>{clearTimeout(n),e(t)},e=>{clearTimeout(n),t(e)})}));var o,r;return{name:e.name,value:n}}));for(let e=0;e<a.length;e++){const t=a[e],n=i[e].name;"fulfilled"===t.status&&null!==t.value.value?o[n]=t.value.value:"rejected"===t.status&&r.push({signal:n,error:String(t.reason?.message??t.reason)})}return{components:o,errors:r}}async function Xe(t){const s=function(e){return e?{exclude:e.exclude??n.exclude,include:e.include??n.include,timeout:e.timeout??n.timeout,stabilize:e.stabilize??n.stabilize,experimental:e.experimental??n.experimental,debug:e.debug??n.debug,salt:e.salt??n.salt}:{...n}}(t),l=c(),d=function(){try{return window.self!==window.top}catch{return!0}}();let f=!1;try{f=await u(l.name)}catch{}const m=function(e,t,n,o){const r=new Set;for(const a of e){if("private"===a&&!n)continue;if("iframe"===a&&!o)continue;const e=i[a];if(e)for(const n of e)if(!n.browsers||n.browsers.includes(t))for(const e of n.exclude)r.add(e)}return r}(s.stabilize,l.name,f,d),p=new Set(m);for(const e of s.exclude)p.add(e);for(const e of s.include)p.delete(e);const{components:h,errors:g}=await He(p,s.timeout,s.experimental),y={S:e};for(const[e,t]of Object.entries(h))r.has(e)||a.has(e)||(y[e]=t);const v=_(y,s.salt),w={S:e};for(const[e,t]of Object.entries(h))o.has(e)||a.has(e)||(w[e]=t);const S=_(w,s.salt),b={hash:v,stableHash:S,components:{...h,S:e},timestamp:(new Date).toISOString(),version:e,isIncognito:f,errors:g};return s.debug&&(console.log("[fingerprint] components:",h),console.log("[fingerprint] hash:",v,"stableHash:",S),g.length>0&&console.warn("[fingerprint] errors:",g)),b}const Ke=new RegExp(["googlebot","bingbot","slurp","baiduspider","duckduckbot","yandex","sogou","exabot","ia_archiver","curl","wget","python-requests","python-urllib","axios","node-fetch","go-http-client","java/","libwww-perl","okhttp","apache-httpclient","http_request","httpie","headlesschrome","phantomjs","puppeteer","playwright","cypress","selenium","webdriver","electron","jsdom","vercel-screenshot","screenshot","prerender","lighthouse","chrome-lighthouse","pagespeed","gtmetrix","pingdom","nessus","nikto","sqlmap","burp","zap","qualys","openvas","nmap","masscan","facebookexternalhit","twitterbot","linkedinbot","whatsapp","telegrambot","slackbot","discordbot","bot","crawl","spider","scrape","fetch","scan"].join("|"),"i");function $e(e){return!!e&&Ke.test(e)}const SENTINEL_USER_IDS=new Set(["__pre_auth__","anonymous","guest","undefined","null"]);function isSentinelUserId(e){return"string"==typeof e&&SENTINEL_USER_IDS.has(e)}const DEFAULT_MAX_RETRIES=3,DEFAULT_TIMEOUT_MS=3e4,MAX_DELAY_MS=3e4,BASE_DELAY_MS=1e3,SUBMIT_FP_PATH="/__unshared/submit-fp",SS_EMAIL_KEY="__unshared_email",SS_FP_KEY="__unshared_fp",SS_LAST_SUBMIT_KEY="__unshared_last_submit",LS_DEVICE_ID="__unshared_device_id",COOKIE_UID="__unshared_uid",COOKIE_SID="__unshared_sid";function generateUUID(){if("undefined"!=typeof crypto&&crypto.randomUUID)return crypto.randomUUID();const e=new Uint8Array(16);crypto.getRandomValues(e),e[6]=15&e[6]|64,e[8]=63&e[8]|128;const t=Array.from(e).map(e=>e.toString(16).padStart(2,"0")).join("");return`${t.slice(0,8)}-${t.slice(8,12)}-${t.slice(12,16)}-${t.slice(16,20)}-${t.slice(20)}`}function sleep(e){return new Promise(t=>setTimeout(t,e))}function retryDelay(e){const t=Math.min(1e3*Math.pow(2,e-1),3e4),n=500*Math.random()-250;return Math.max(0,t+n)}function getCookie(e){if("undefined"==typeof document)return;const t=document.cookie.match(new RegExp(`(?:^|; )${e}=([^;]*)`));return t?decodeURIComponent(t[1]):void 0}function setCookie(e,t){"undefined"!=typeof document&&(document.cookie=`${e}=${encodeURIComponent(t)}; Path=/; SameSite=Lax`)}function deleteCookie(e){"undefined"!=typeof document&&(document.cookie=`${e}=; Path=/; SameSite=Lax; Expires=Thu, 01 Jan 1970 00:00:00 GMT`)}function getLocalStorageItem(e){if("undefined"!=typeof localStorage)try{return localStorage.getItem(e)??void 0}catch{return}}function setLocalStorageItem(e,t){if("undefined"!=typeof localStorage)try{localStorage.setItem(e,t)}catch{}}function getSessionStorageItem(e){if("undefined"!=typeof sessionStorage)try{return sessionStorage.getItem(e)??void 0}catch{return}}function setSessionStorageItem(e,t){if("undefined"!=typeof sessionStorage)try{sessionStorage.setItem(e,t)}catch{}}function isValidUrl(e){try{return new URL(e),!0}catch{return!1}}class UnsharedBrowser{constructor(e={}){if(this._="",e.baseUrl&&!isValidUrl(e.baseUrl))throw new Error('baseUrl must be a valid URL (e.g. "https://app.example.com")');let t,n;this.C=e.baseUrl?e.baseUrl.replace(/\/$/,""):"",this.I=e.maxRetries??3,this.k=e.timeout??3e4,this.M=e.includePathPrefix,this.D=e.skipPaths,this.P=e.sessionId,this.A=e.deviceId,this._=getSessionStorageItem(SS_LAST_SUBMIT_KEY)??"";try{t=this.P?.()}catch{}this.L=t??getCookie(COOKIE_SID)??generateUUID(),setCookie(COOKIE_SID,this.L);try{n=this.A?.()}catch{}n?(this.T=n,setLocalStorageItem(LS_DEVICE_ID,n)):this.T=getLocalStorageItem(LS_DEVICE_ID)??"",this.O()}async init(e){try{if("undefined"!=typeof navigator&&$e(navigator.userAgent))return;if(isSentinelUserId(e.userId))return void this.B;this.B=e.userId,this.U=e.emailAddress,"undefined"!=typeof sessionStorage&&sessionStorage.setItem(SS_EMAIL_KEY,e.emailAddress),setCookie(COOKIE_UID,e.userId);let t,n=this.F();n||(n=await this.collect(),this.R(n));try{t=this.A?.()}catch{}t?(this.T=t,setLocalStorageItem(LS_DEVICE_ID,t)):n.fingerprint_id&&(this.T=n.fingerprint_id,setLocalStorageItem(LS_DEVICE_ID,n.fingerprint_id)),this.W(n).catch(()=>{})}catch{}}onRouteChange(){try{if(!this.$())return;const e=this.F();if(!e)return;this.W(e).catch(()=>{})}catch{}}destroy(){try{"undefined"!=typeof sessionStorage&&(sessionStorage.removeItem(SS_EMAIL_KEY),sessionStorage.removeItem(SS_FP_KEY),sessionStorage.removeItem(SS_LAST_SUBMIT_KEY)),this._="",deleteCookie(COOKIE_UID),this.V&&"undefined"!=typeof document&&(document.removeEventListener("DOMContentLoaded",this.V),this.V=void 0),this.B=void 0,this.U=void 0}catch{}}async collect(e){const t=[...new Set(["timing","speech",...e?.exclude??[]])],n=await Xe({...e,exclude:t});return{fingerprint_id:n.stableHash,full_hash:n.hash,components:n.components,timestamp:n.timestamp,isIncognito:n.isIncognito,version:n.version}}async submitFingerprintEvent(e,t){try{const n=this.K(e,t),o=generateUUID(),r=`${this.C}${SUBMIT_FP_PATH}`;return await this.G(r,JSON.stringify(n),o)}catch(e){return{success:!1,error:{code:"DELIVERY_FAILED",message:e instanceof Error?e.message:String(e)}}}}$(){if("undefined"!=typeof sessionStorage)return sessionStorage.getItem(SS_EMAIL_KEY)??void 0}F(){if("undefined"==typeof sessionStorage)return;const e=sessionStorage.getItem(SS_FP_KEY);if(e)try{return JSON.parse(e)}catch{return}}R(e){"undefined"!=typeof sessionStorage&&sessionStorage.setItem(SS_FP_KEY,JSON.stringify(e))}N(){if("undefined"==typeof location)return!0;const e=location.pathname||"/";if(this.D)for(const t of this.D)if(e.startsWith(t))return!1;return!this.M||this.M.some(t=>e.startsWith(t))}async W(e){if("undefined"!=typeof navigator&&$e(navigator.userAgent))return{success:!0};if(!this.N())return{success:!0};const t=this.U??this.$(),n=this.B??getCookie(COOKIE_UID),o="undefined"!=typeof location?(location.pathname||"/")+(location.search||""):"/";if(n){const e=`${n}|${o}`;if(e===this._)return{success:!0};this._=e,setSessionStorageItem(SS_LAST_SUBMIT_KEY,e)}const r={hash:e.full_hash,stable_hash:e.fingerprint_id,collected_at:(new Date).toISOString(),is_incognito:e.isIncognito,components:e.components,version:e.version,session_id:this.L,event_type:o};n&&(r.user_id=n),t&&(r.email=t);const i=`${e.fingerprint_id}|${n??""}|${o}`,a=`${this.C}${SUBMIT_FP_PATH}`;return this.G(a,JSON.stringify(r),i)}O(){"undefined"!=typeof document&&(this.V&&document.removeEventListener("DOMContentLoaded",this.V),this.V=()=>{if(!this.$())return;const e=this.F();e&&this.W(e).catch(()=>{})},document.addEventListener("DOMContentLoaded",this.V))}async G(e,t,n){const o=this.I+1;let r={success:!1,error:{code:"DELIVERY_FAILED",message:"Request failed"}};for(let i=1;i<=o;i++){i>1&&await sleep(retryDelay(i-1));const o=new AbortController,a=setTimeout(()=>o.abort(),this.k);try{const i=await fetch(e,{method:"POST",headers:{"Content-Type":"application/json","X-Idempotency-Key":n,"X-Session-Id":this.L,"X-Device-Id":this.T},body:t,signal:o.signal});if(clearTimeout(a),i.status>=500){r={success:!1,error:{code:"DELIVERY_FAILED",message:`Backend returned ${i.status}`}};continue}if(i.status>=400)return{success:!1,error:{code:"DELIVERY_FAILED",message:`Backend returned ${i.status}`}};const c=await i.text().catch(()=>"{}");let s;try{s=JSON.parse(c)}catch{s={}}return!1===s?.success?{success:!1,error:s.error??{code:"UPSTREAM_ERROR",message:"Upstream failed"}}:{success:!0,data:s?.data}}catch(e){clearTimeout(a),r={success:!1,error:{code:"DELIVERY_FAILED",message:e instanceof Error?e.message:String(e)}}}}return r}K(e,t){const n={hash:e.full_hash,stable_hash:e.fingerprint_id,collected_at:e.timestamp,is_incognito:e.isIncognito,components:e.components,version:e.version,session_id:this.L};n.user_id=t.userId,null!=t?.eventType&&(n.event_type=t.eventType);const o=this.U??this.$();return o&&(n.email=o),n}}function createAxiosInterceptor(e){return t=>{if(403===t?.response?.status&&"account_flagged"===t?.response?.data?.error)try{e.onFlagged()}catch{}return Promise.reject(t)}}function createFetchInterceptor(e,t){return async(...n)=>{const o=await e(...n);if(403===o.status){const e=o.clone();try{const n=await e.json();if("account_flagged"===n?.error)try{t.onFlagged()}catch{}}catch{}}return o}}exports.UnsharedBrowser=UnsharedBrowser,exports.createAxiosInterceptor=createAxiosInterceptor,exports.createFetchInterceptor=createFetchInterceptor;
package/dist/index.mjs CHANGED
@@ -1 +1 @@
1
- const e="1.3.1",t=1282368115,n={exclude:[],include:[],timeout:3e3,stabilize:["private","iframe","always"],experimental:!1,debug:!1,salt:""},r=new Set(["audio","timing","navigatorConnection","domrect","permissions","fonts","speech"]),o=new Set(["domrect"]),a={always:[{exclude:["speech"],browsers:["brave","firefox"]},{exclude:["keyboard"],browsers:["firefox","safari"]},{exclude:["workers"],browsers:["firefox"]},{exclude:["hardwareSensitive","navigatorProps"],browsers:["brave"]}],private:[{exclude:["fonts"],browsers:["firefox"]},{exclude:["audio"],browsers:["safari","brave"]}],iframe:[{exclude:["applePay"],browsers:["safari"]},{exclude:["permissions"]},{exclude:["keyboard"]}]};let i=null;function s(){if(i)return i;const e=navigator.userAgent;return i=function(){const e=navigator.brave;return!!e&&"function"==typeof e.isBrave}()?{name:"brave",version:c(e,/Chrome\/([\d.]+)/)}:/Edg\//i.test(e)?{name:"edge",version:c(e,/Edg\/([\d.]+)/)}:/OPR\//i.test(e)||/Opera/i.test(e)?{name:"opera",version:c(e,/OPR\/([\d.]+)/)||c(e,/Opera\/([\d.]+)/)}:/SamsungBrowser/i.test(e)?{name:"samsung",version:c(e,/SamsungBrowser\/([\d.]+)/)}:/Firefox\//i.test(e)?{name:"firefox",version:c(e,/Firefox\/([\d.]+)/)}:/Safari\//i.test(e)&&!/Chrome/i.test(e)?{name:"safari",version:c(e,/Version\/([\d.]+)/)}:/Chrome\//i.test(e)?{name:"chrome",version:c(e,/Chrome\/([\d.]+)/)}:{name:"unknown",version:""},i}function c(e,t){const n=e.match(t);return n?.[1]??""}async function l(e){try{switch(e){case"chrome":case"edge":case"opera":default:return await u();case"brave":return await async function(){return!1}();case"safari":return await async function(){if(navigator.storage?.estimate){const{quota:e}=await navigator.storage.estimate();if(void 0!==e)return e<4294967296}try{return!!navigator.storage?.getDirectory&&(await navigator.storage.getDirectory(),!1)}catch(e){return"NotFoundError"===e?.name}}();case"firefox":return await async function(){if(!("serviceWorker"in navigator))return!0;try{return!!navigator.storage?.getDirectory&&(await navigator.storage.getDirectory(),!1)}catch(e){return"SecurityError"===e?.name}}()}}catch{return!1}}async function u(){if(!navigator.storage?.estimate)return!1;const{quota:e}=await navigator.storage.estimate();return void 0!==e&&e<4294967296}function m(e,t){const n=e[0]>>>16,o=65535&e[0],r=e[1]>>>16,i=65535&e[1],a=t[0]>>>16,s=65535&t[0],c=t[1]>>>16;let u=0,l=0,d=0,f=0,m=0;return l=i+(65535&t[1]),u=l>>>16,l&=65535,d=r+c+u,u=d>>>16,d&=65535,f=o+s+u,u=f>>>16,f&=65535,m=n+a+u,m&=65535,[m<<16|f,d<<16|l]}function d(e,t){const n=e[0]>>>16,o=65535&e[0],r=e[1]>>>16,i=65535&e[1],a=t[0]>>>16,s=65535&t[0],c=t[1]>>>16,u=65535&t[1];let l=0,d=0,f=0,m=0,p=0;return d=i*u,l=d>>>16,d&=65535,f=r*u+l,l=f>>>16,f&=65535,f+=i*c,l+=f>>>16,f&=65535,m=o*u+l,l=m>>>16,m&=65535,m+=r*c,l+=m>>>16,m&=65535,m+=i*s,l+=m>>>16,m&=65535,p=n*u+o*c+r*s+i*a+l,p&=65535,[p<<16|m,f<<16|d]}function f(e,t){return 32==(t%=64)?[e[1],e[0]]:t<32?[e[0]<<t|e[1]>>>32-t,e[1]<<t|e[0]>>>32-t]:(t-=32,[e[1]<<t|e[0]>>>32-t,e[0]<<t|e[1]>>>32-t])}function p(e,t){return 0==(t%=64)?[e[0],e[1]]:t<32?[e[0]<<t|e[1]>>>32-t,e[1]<<t]:[e[1]<<t-32,0]}function g(e,t){return[e[0]^t[0],e[1]^t[1]]}function h(e){let t=[e[0],e[1]];return t=g(t,[0,t[0]>>>1]),t=d(t,[4283543511,3981806797]),t=g(t,[0,t[0]>>>1]),t=d(t,[3301882366,444984403]),t=g(t,[0,t[0]>>>1]),t}function y(e){return("00000000"+(e>>>0).toString(16)).slice(-8)}function v(e,t=0){const n=e.length%16,o=e.length-n;let r=[0,t],i=[0,t];const a=[2277735313,289559509],s=[1291169091,658871167];for(let t=0;t<o;t+=16){let n=[255&e.charCodeAt(t+4)|(255&e.charCodeAt(t+5))<<8|(255&e.charCodeAt(t+6))<<16|(255&e.charCodeAt(t+7))<<24,255&e.charCodeAt(t)|(255&e.charCodeAt(t+1))<<8|(255&e.charCodeAt(t+2))<<16|(255&e.charCodeAt(t+3))<<24],o=[255&e.charCodeAt(t+12)|(255&e.charCodeAt(t+13))<<8|(255&e.charCodeAt(t+14))<<16|(255&e.charCodeAt(t+15))<<24,255&e.charCodeAt(t+8)|(255&e.charCodeAt(t+9))<<8|(255&e.charCodeAt(t+10))<<16|(255&e.charCodeAt(t+11))<<24];n=d(n,a),n=f(n,31),n=d(n,s),r=g(r,n),r=f(r,27),r=m(r,i),r=m(d(r,[0,5]),[0,1390208809]),o=d(o,s),o=f(o,33),o=d(o,a),i=g(i,o),i=f(i,31),i=m(i,r),i=m(d(i,[0,5]),[0,944331445])}let c=[0,0],u=[0,0];switch(n){case 15:u=g(u,p([0,e.charCodeAt(o+14)],48));case 14:u=g(u,p([0,e.charCodeAt(o+13)],40));case 13:u=g(u,p([0,e.charCodeAt(o+12)],32));case 12:u=g(u,p([0,e.charCodeAt(o+11)],24));case 11:u=g(u,p([0,e.charCodeAt(o+10)],16));case 10:u=g(u,p([0,e.charCodeAt(o+9)],8));case 9:u=g(u,[0,e.charCodeAt(o+8)]),u=d(u,s),u=f(u,33),u=d(u,a),i=g(i,u);case 8:c=g(c,p([0,e.charCodeAt(o+7)],56));case 7:c=g(c,p([0,e.charCodeAt(o+6)],48));case 6:c=g(c,p([0,e.charCodeAt(o+5)],40));case 5:c=g(c,p([0,e.charCodeAt(o+4)],32));case 4:c=g(c,p([0,e.charCodeAt(o+3)],24));case 3:c=g(c,p([0,e.charCodeAt(o+2)],16));case 2:c=g(c,p([0,e.charCodeAt(o+1)],8));case 1:c=g(c,[0,e.charCodeAt(o)]),c=d(c,a),c=f(c,31),c=d(c,s),r=g(r,c)}return r=g(r,[0,e.length]),i=g(i,[0,e.length]),r=m(r,i),i=m(i,r),r=h(r),i=h(i),r=m(r,i),i=m(i,r),y(r[0])+y(r[1])+y(i[0])+y(i[1])}function x(e){return S(e,new Set)}function S(e,t){if(null===e)return"null";if(void 0===e)return"undefined";const n=typeof e;if("boolean"===n||"number"===n)return String(e);if("string"===n)return JSON.stringify(e);if(Array.isArray(e)){if(t.has(e))return'"[Circular]"';t.add(e);const n=e.map(e=>S(e,t));return t.delete(e),"["+n.join(",")+"]"}if("object"===n){const n=e;if(t.has(n))return'"[Circular]"';t.add(n);const o=Object.keys(n).sort().filter(e=>void 0!==n[e]).map(e=>JSON.stringify(e)+":"+S(n[e],t));return t.delete(n),"{"+o.join(",")+"}"}return String(e)}const b=v("",t);function w(e,n){const o=function(e){if(0===e.length)return v("",t);if(1===e.length)return v(e[0],t);let n=[...e];for(;n.length>1;){const e=[];for(let o=0;o<n.length;o+=2){const r=o+1<n.length?n[o+1]:b;e.push(v(n[o]+r,t))}n=e}return n[0]}(Object.keys(e).sort().map(n=>{const o=function(e){let n=t;for(let t=0;t<e.length;t++)n=Math.imul(n^e.charCodeAt(t),1540483477),n^=n>>>13;return n>>>0}(n);return v(x(e[n]),o)})),r=String.fromCharCode(76,111,98,115),i=n?v(n,t):"";return v(o+r+i,t)}function C(e){try{const t=e.getExtension("EXT_texture_filter_anisotropic")??e.getExtension("WEBKIT_EXT_texture_filter_anisotropic")??e.getExtension("MOZ_EXT_texture_filter_anisotropic");return t?e.getParameter(t.MAX_TEXTURE_MAX_ANISOTROPY_EXT):null}catch{return null}}function A(e){try{const t=e.getContext("webgl2");if(!t)return null;const n={version:t.getParameter(t.VERSION),maxSamples:t.getParameter(t.MAX_SAMPLES),max3DTextureSize:t.getParameter(t.MAX_3D_TEXTURE_SIZE),maxArrayTextureLayers:t.getParameter(t.MAX_ARRAY_TEXTURE_LAYERS),maxUniformBlockSize:t.getParameter(t.MAX_UNIFORM_BLOCK_SIZE),maxVertexUniformComponents:t.getParameter(t.MAX_VERTEX_UNIFORM_COMPONENTS),maxFragmentUniformComponents:t.getParameter(t.MAX_FRAGMENT_UNIFORM_COMPONENTS),maxColorAttachments:t.getParameter(t.MAX_COLOR_ATTACHMENTS),maxDrawBuffers:t.getParameter(t.MAX_DRAW_BUFFERS)};return t.getExtension("WEBGL_lose_context")?.loseContext(),n}catch{return null}}function E(){const e=navigator.userAgentData;if(e?.platform)return e.platform;const t=navigator.userAgent??"";return/Windows/.test(t)?"Windows":/Macintosh|Mac OS X/.test(t)?"macOS":/CrOS/.test(t)?"Chrome OS":/Android/.test(t)?"Android":/Linux/.test(t)?"Linux":/iPhone|iPad|iPod/.test(t)?"iOS":""}function M(){try{const e=new ArrayBuffer(4),t=new Float32Array(e),n=new Uint8Array(e);return t[0]=1/0,n[3]}catch{return 0}}function P(e,t,n,o){const r=(n-t)/o;let i=e(t)+e(n);for(let n=1;n<o;n++)i+=e(t+n*r)*(n%2==0?2:4);return i*r/3}function T(){try{const e=(new Intl.DateTimeFormat).resolvedOptions();return{locale:e.locale,calendar:e.calendar,numberingSystem:e.numberingSystem,timeZone:e.timeZone}}catch{return{}}}function _(){try{const e=(new Intl.NumberFormat).resolvedOptions();return{locale:e.locale,numberingSystem:e.numberingSystem,style:e.style,minimumIntegerDigits:e.minimumIntegerDigits,minimumFractionDigits:e.minimumFractionDigits,maximumFractionDigits:e.maximumFractionDigits,useGrouping:e.useGrouping}}catch{return{}}}function R(){try{const e=(new Intl.Collator).resolvedOptions();return{locale:e.locale,usage:e.usage,sensitivity:e.sensitivity,collation:e.collation,numeric:e.numeric,caseFirst:e.caseFirst}}catch{return{}}}function I(){try{const e=(new Intl.PluralRules).resolvedOptions(),t=new Intl.PluralRules(void 0,{type:"ordinal"}).resolvedOptions();return{locale:e.locale,type:e.type,cardinalCategories:(new Intl.PluralRules).select(0)+","+(new Intl.PluralRules).select(1)+","+(new Intl.PluralRules).select(2)+","+(new Intl.PluralRules).select(5)+","+(new Intl.PluralRules).select(11)+","+(new Intl.PluralRules).select(100),ordinalCategory1:t.type,minimumIntegerDigits:e.minimumIntegerDigits}}catch{return{}}}function k(){try{const e=new Intl.RelativeTimeFormat;if(!e)return{};const t=e.resolvedOptions();return{locale:t.locale,style:t.style,numeric:t.numeric,numberingSystem:t.numberingSystem}}catch{return{}}}function O(){try{const e=new Intl.ListFormat;if(!e)return{};const t=e.resolvedOptions(),n=["X","Y","Z"],o=new Intl.ListFormat(void 0,{type:"conjunction",style:"long"}),r=new Intl.ListFormat(void 0,{type:"disjunction",style:"long"});return{locale:t.locale,type:t.type,style:t.style,conjunctionSample:o.format(n),disjunctionSample:r.format(n)}}catch{return{}}}const D=[["backdrop-filter","blur(1px)"],["container-type","inline-size"],["text-wrap","balance"],["overscroll-behavior","contain"],["hanging-punctuation","first"],["-webkit-line-clamp","1"],["appearance","none"],["font-size-adjust","ex-height 0.5"],["font-palette","normal"],["field-sizing","content"],["-webkit-text-stroke","1px black"],["zoom","1"],["scrollbar-width","thin"],["scrollbar-color","red blue"],["animation-timeline","auto"],["mask-composite","add"],["offset-path","none"],["text-decoration-thickness","1px"],["content-visibility","auto"],["contain-intrinsic-size","auto 100px"],["aspect-ratio","16/9"],["gap","10px"],["color-mix","in srgb, red 50%, blue"],["linear-gradient(in oklch, red, blue)",""]];function L(){try{const e=document.createElement("div");e.style.cssText="visibility:hidden;overflow:scroll;position:absolute;top:-9999px;width:100px;height:100px",document.body.appendChild(e);const t=document.createElement("div");e.appendChild(t);const n=e.offsetWidth-t.offsetWidth;return document.body.removeChild(e),n}catch{return-1}}function N(){const e={};if("undefined"==typeof CSS||"function"!=typeof CSS.supports)return e;for(const[t,n]of D)e[t]=n?CSS.supports(t,n):CSS.supports(t);return e}function F(){try{const e=document.createElement("div");e.style.cssText=["position:fixed","top:0","left:0","width:0","height:0","visibility:hidden","padding-top:env(safe-area-inset-top,0px)","padding-bottom:env(safe-area-inset-bottom,0px)","padding-left:env(safe-area-inset-left,0px)","padding-right:env(safe-area-inset-right,0px)"].join(";"),document.body.appendChild(e);const t=getComputedStyle(e),n={top:t.paddingTop,bottom:t.paddingBottom,left:t.paddingLeft,right:t.paddingRight};return document.body.removeChild(e),n}catch{return null}}function B(){try{const e=performance.now();let t=1/0,n=e;for(let o=0;o<50;o++){const o=performance.now(),r=o-n;if(r>0&&r<t&&(t=r),n=o,o-e>=1)break}if(t===1/0)return-1;const o=1e3*t;if(o<=0)return-1;const r=Math.max(0,Math.round(Math.log10(o)));return Math.pow(10,r)}catch{return-1}}const U=["Arial","Arial Black","Arial Narrow","Arial Rounded MT Bold","Bookman Old Style","Bradley Hand","Calibri","Cambria","Cambria Math","Century","Century Gothic","Comic Sans MS","Consolas","Courier","Courier New","Garamond","Geneva","Georgia","Gill Sans","Helvetica","Helvetica Neue","Impact","Lucida Console","Lucida Grande","Lucida Sans Unicode","Microsoft Sans Serif","Monaco","Palatino","Palatino Linotype","Segoe Print","Segoe Script","Segoe UI","Tahoma","Times","Times New Roman","Trebuchet MS","Verdana","Wingdings","Wingdings 2","Wingdings 3","Inter","Roboto","Open Sans","Lato","Montserrat","Poppins","Nunito","Raleway","Ubuntu","Merriweather","Playfair Display","Source Sans Pro","Source Code Pro","Fira Code","JetBrains Mono","Cascadia Code","Apple Color Emoji","Segoe UI Emoji","Noto Color Emoji","SF Pro","SF Pro Display","SF Mono","San Francisco","Menlo","Andale Mono","Futura","MS Gothic","MS Mincho","MS PGothic","MS PMincho","Yu Gothic","Meiryo","Hiragino Sans","Hiragino Kaku Gothic Pro","SimSun","SimHei","Microsoft YaHei","PingFang SC","Noto Sans CJK","Malgun Gothic","Arial Hebrew"],V=["monospace","sans-serif","serif"],W="mmMwWLliI0O&1";function X(e,t){const n=[],o=e.split("\r\n");let r=!1;for(const e of o)if(e.startsWith(`m=${t}`))r=!0;else{if(e.startsWith("m=")&&r)break;if(r&&e.startsWith("a=rtpmap:")){const t=e.match(/^a=rtpmap:\d+\s+(.+)$/);t&&n.push(t[1])}}return n}const z=["accelerometer","accessibility-events","ambient-light-sensor","background-fetch","background-sync","bluetooth","camera","clipboard-read","clipboard-write","display-capture","geolocation","gyroscope","local-fonts","magnetometer","microphone","midi","nfc","notifications","payment-handler","persistent-storage","push","screen-wake-lock","speaker-selection","storage-access","top-level-storage-access","window-management","xr-spatial-tracking"];function G(e){const t={};for(const n of e)t[n]=(t[n]??0)+1;let n=e[0],o=0;for(const[e,r]of Object.entries(t))r>o&&(n=e,o=r);return n}const j=[{name:"prefers-contrast",values:["no-preference","more","less","custom"]},{name:"any-hover",values:["none","hover"]},{name:"any-pointer",values:["none","coarse","fine"]},{name:"pointer",values:["none","coarse","fine"]},{name:"hover",values:["none","hover"]},{name:"update",values:["none","slow","fast"]},{name:"inverted-colors",values:["none","inverted"]},{name:"prefers-reduced-motion",values:["no-preference","reduce"]},{name:"prefers-reduced-transparency",values:["no-preference","reduce"]},{name:"scripting",values:["none","initial-only","enabled"]},{name:"forced-colors",values:["none","active"]},{name:"prefers-color-scheme",values:["light","dark"]},{name:"color-gamut",values:["srgb","p3","rec2020"]},{name:"dynamic-range",values:["standard","high"]}],H=["KeyQ","KeyW","KeyA","KeyS","KeyZ","KeyX","KeyY","KeyM","Semicolon","BracketLeft","Quote","Digit1","Digit2","Digit3"];function K(e){const t=e.KeyQ,n=e.KeyZ,o=e.KeyY;return t?"a"===t?"azerty":"q"===t&&"z"===o?"qwertz":"q"===t&&"z"===n?"qwerty":"'"===t?"dvorak":"other":null}const $=[{name:"webgl",tier:1,async collect(){const e=document.createElement("canvas"),t=e.getContext("webgl")||e.getContext("experimental-webgl");if(!(t&&t instanceof WebGLRenderingContext))return null;const n=t.getExtension("WEBGL_debug_renderer_info"),o=t.getSupportedExtensions()??[],r=function(e){const t={},n=[e.VERTEX_SHADER,e.FRAGMENT_SHADER],o=[e.LOW_FLOAT,e.MEDIUM_FLOAT,e.HIGH_FLOAT,e.LOW_INT,e.MEDIUM_INT,e.HIGH_INT],r=["vertex","fragment"],i=["lowFloat","mediumFloat","highFloat","lowInt","mediumInt","highInt"];for(let a=0;a<n.length;a++){const s={};for(let t=0;t<o.length;t++){const r=e.getShaderPrecisionFormat(n[a],o[t]);r&&(s[i[t]]={rangeMin:r.rangeMin,rangeMax:r.rangeMax,precision:r.precision})}t[r[a]]=s}return t}(t),i={vendor:t.getParameter(t.VENDOR),renderer:t.getParameter(t.RENDERER),version:t.getParameter(t.VERSION),shadingLanguageVersion:t.getParameter(t.SHADING_LANGUAGE_VERSION),unmaskedVendor:n?t.getParameter(n.UNMASKED_VENDOR_WEBGL):null,unmaskedRenderer:n?t.getParameter(n.UNMASKED_RENDERER_WEBGL):null,extensions:o.sort(),maxTextureSize:t.getParameter(t.MAX_TEXTURE_SIZE),maxRenderbufferSize:t.getParameter(t.MAX_RENDERBUFFER_SIZE),maxViewportDims:Array.from(t.getParameter(t.MAX_VIEWPORT_DIMS)),maxVertexAttribs:t.getParameter(t.MAX_VERTEX_ATTRIBS),maxVertexUniformVectors:t.getParameter(t.MAX_VERTEX_UNIFORM_VECTORS),maxFragmentUniformVectors:t.getParameter(t.MAX_FRAGMENT_UNIFORM_VECTORS),maxVaryingVectors:t.getParameter(t.MAX_VARYING_VECTORS),aliasedLineWidthRange:Array.from(t.getParameter(t.ALIASED_LINE_WIDTH_RANGE)),aliasedPointSizeRange:Array.from(t.getParameter(t.ALIASED_POINT_SIZE_RANGE)),maxCombinedTextureImageUnits:t.getParameter(t.MAX_COMBINED_TEXTURE_IMAGE_UNITS),maxTextureImageUnits:t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS),maxVertexTextureImageUnits:t.getParameter(t.MAX_VERTEX_TEXTURE_IMAGE_UNITS),shaderPrecision:r,maxAnisotropy:C(t),webgl2:A(e)};return t.getExtension("WEBGL_lose_context")?.loseContext(),i}},{name:"hardware",tier:1,collect:async()=>({architecture:M(),platform:E()})},{name:"hardwareSensitive",tier:1,collect:async()=>({deviceMemory:navigator.deviceMemory??null,hardwareConcurrency:navigator.hardwareConcurrency??null})},{name:"math",tier:1,collect:async()=>({acos:Math.acos(.5),asin:P(Math.asin,-1,1,97),cos:P(Math.cos,0,Math.PI,97),cosLarge:Math.cos(1e20),sinLarge:Math.sin(1e20),tanLarge:Math.tan(1e20),sin:P(Math.sin,0,Math.PI,97),tan:P(Math.tan,0,Math.PI/4,97)})},{name:"i18n",tier:1,collect:async()=>({dateTimeFormat:T(),numberFormat:_(),collator:R(),pluralRules:I(),relativeTimeFormat:k(),listFormat:O()})},{name:"domrect",tier:1,collect:async()=>({basic:function(){const e=document.createElement("div");e.style.cssText="position:fixed;left:-9999px;width:100px;height:100px;",document.body.appendChild(e);const t=e.getBoundingClientRect();return document.body.removeChild(e),{x:t.x,y:t.y,width:t.width,height:t.height,top:t.top,right:t.right,bottom:t.bottom,left:t.left}}(),precision:function(){const e=document.createElement("div");e.style.cssText=`position:absolute;left:-9999px;width:${Math.PI}px;height:${Math.E}px;`,document.body.appendChild(e);const t=e.getBoundingClientRect();return document.body.removeChild(e),{width:t.width,height:t.height}}(),fromRect:"undefined"!=typeof DOMRectReadOnly&&"function"==typeof DOMRectReadOnly.fromRect})},{name:"touch",tier:1,collect:async()=>({supported:"ontouchstart"in window||navigator.maxTouchPoints>0,maxTouchPoints:navigator.maxTouchPoints??0})},{name:"display",tier:1,collect:async()=>({colorDepth:screen.colorDepth??0,pixelDepth:screen.pixelDepth??0})},{name:"locale",tier:1,collect:async()=>({timezone:Intl.DateTimeFormat().resolvedOptions().timeZone??"",language:navigator.language??""})},{name:"workers",tier:1,collect:async()=>({webWorker:"undefined"!=typeof Worker,sharedWorker:"undefined"!=typeof SharedWorker,serviceWorker:"serviceWorker"in navigator})},{name:"plugins",tier:1,async collect(){const e=[];if(navigator.plugins)for(let t=0;t<navigator.plugins.length;t++){const n=navigator.plugins[t];"internal-pdf-viewer"===n.filename&&e.push(`${n.name}|${n.filename}|${n.description}`)}return{plugins:e.sort(),pdfViewerEnabled:navigator.pdfViewerEnabled??!1}}},{name:"css",tier:1,collect:async()=>({scrollbarWidth:L(),supports:N(),safeArea:F()})},{name:"navigatorProps",tier:1,collect:async()=>({vendor:navigator.vendor??"",productSub:navigator.productSub??"",cookieEnabled:navigator.cookieEnabled})},{name:"timing",tier:2,collect:async()=>({performancePrecisionUs:B()})},{name:"navigatorConnection",tier:2,async collect(){const e=navigator,t=e.connection??e.mozConnection??e.webkitConnection??null,n=performance.memory??null;return{connection:t?{type:t.type??null,effectiveType:t.effectiveType??null,saveData:t.saveData??null}:null,memory:n?{jsHeapSizeLimit:n.jsHeapSizeLimit}:null}}},{name:"webgpu",tier:2,async collect(){const e=navigator.gpu;if(!e)return null;const t=await e.requestAdapter();if(!t)return null;let n="",o="",r="",i="";if(t.info)n=t.info.vendor??"",o=t.info.architecture??"",r=t.info.device??"",i=t.info.description??"";else if("function"==typeof t.requestAdapterInfo){const e=await t.requestAdapterInfo();n=e.vendor??"",o=e.architecture??"",r=e.device??"",i=e.description??""}const a=[];t.features&&(t.features.forEach(e=>a.push(e)),a.sort());const s={};if(t.limits){const e=["maxTextureDimension1D","maxTextureDimension2D","maxTextureDimension3D","maxTextureArrayLayers","maxBindGroups","maxBindGroupsPlusVertexBuffers","maxBindingsPerBindGroup","maxDynamicUniformBuffersPerPipelineLayout","maxDynamicStorageBuffersPerPipelineLayout","maxSampledTexturesPerShaderStage","maxSamplersPerShaderStage","maxStorageBuffersPerShaderStage","maxStorageTexturesPerShaderStage","maxUniformBuffersPerShaderStage","maxUniformBufferBindingSize","maxStorageBufferBindingSize","minUniformBufferOffsetAlignment","minStorageBufferOffsetAlignment","maxVertexBuffers","maxBufferSize","maxVertexAttributes","maxVertexBufferArrayStride","maxInterStageShaderComponents","maxInterStageShaderVariables","maxColorAttachments","maxColorAttachmentBytesPerSample","maxComputeWorkgroupStorageSize","maxComputeInvocationsPerWorkgroup","maxComputeWorkgroupSizeX","maxComputeWorkgroupSizeY","maxComputeWorkgroupSizeZ","maxComputeWorkgroupsPerDimension"];for(const n of e){const e=t.limits[n];void 0!==e&&(s[n]=e)}}return{vendor:n,architecture:o,device:r,description:i,features:a,limits:s}}},{name:"audio",tier:2,async collect(){const e=window.AudioContext||window.webkitAudioContext;if(!e)return null;let t=null;try{t=new e;const n=t.destination;return{sampleRate:t.sampleRate,maxChannelCount:n.maxChannelCount,channelCount:n.channelCount,channelCountMode:n.channelCountMode,channelInterpretation:n.channelInterpretation,baseLatency:t.baseLatency??null,outputLatency:t.outputLatency??null}}finally{if(t&&"closed"!==t.state)try{await t.close()}catch{}}}},{name:"fonts",tier:2,collect:()=>new Promise(e=>{const t=()=>e(function(){try{if("undefined"==typeof document)return{available:[],method:"css-layout"};const e=new Set,t=[];if("function"==typeof document.fonts?.check)for(const n of U)document.fonts.check(`72px "${n}"`)?e.add(n):t.push(n);else t.push(...U);const n=new Set;if(t.length>0){const e=document.createElement("div");e.style.cssText="position:absolute;visibility:hidden;top:-9999px;left:-9999px;pointer-events:none;";const o=V.map(t=>{const n=document.createElement("span");return n.style.cssText=`font-size:72px;font-family:${t};white-space:nowrap;display:inline-block`,n.textContent=W,e.appendChild(n),n}),r=t.map(t=>V.map(n=>{const o=document.createElement("span");return o.style.cssText=`font-size:72px;font-family:'${t}',${n};white-space:nowrap;display:inline-block`,o.textContent=W,e.appendChild(o),o}));document.body.appendChild(e);const i=o.map(e=>e.getBoundingClientRect().width),a=r.map(e=>e.map(e=>e.getBoundingClientRect().width));document.body.removeChild(e);for(let e=0;e<t.length;e++)for(let o=0;o<V.length;o++)if(a[e][o]!==i[o]){n.add(t[e]);break}}return{available:U.filter(t=>e.has(t)||n.has(t)),method:"css-layout"}}catch{return{available:[],method:"css-layout"}}}());"undefined"!=typeof requestIdleCallback?requestIdleCallback(t,{timeout:2e3}):setTimeout(t,0)})},{name:"webrtc",tier:2,async collect(){if("undefined"==typeof RTCPeerConnection)return{supported:!1,audioCodecCount:0,videoCodecCount:0,audioCodecs:[],videoCodecs:[],extensions:[]};const e=new RTCPeerConnection({iceServers:[]});try{e.addTransceiver("audio"),e.addTransceiver("video");const t=(await e.createOffer()).sdp??"",n=X(t,"audio"),o=X(t,"video"),r=function(e){const t=new Set,n=e.split("\r\n");for(const e of n)if(e.startsWith("a=extmap:")){const n=e.match(/^a=extmap:\d+(?:\/\w+)?\s+(.+)$/);n&&t.add(n[1].trim())}return Array.from(t)}(t);return{supported:!0,audioCodecCount:n.length,videoCodecCount:o.length,audioCodecs:n.sort(),videoCodecs:o.sort(),extensions:r.sort()}}finally{e.close()}}},{name:"permissions",tier:2,async collect(){if(!navigator.permissions?.query)return{states:{}};const e=()=>Promise.allSettled(z.map(async e=>{try{return{name:e,state:(await navigator.permissions.query({name:e})).state}}catch{return{name:e,state:"error"}}})),t=await Promise.all([e(),e(),e()]),n={};for(const e of t)for(const t of e)if("fulfilled"===t.status){const{name:e,state:o}=t.value;n[e]||(n[e]=[]),n[e].push(o)}const o={};for(const[e,t]of Object.entries(n))o[e]=G(t);return{states:o}}},{name:"speech",tier:2,async collect(){if("undefined"==typeof speechSynthesis)return{supported:!1,voiceCount:0,voices:[]};const e=await new Promise(e=>{const t=speechSynthesis.getVoices();if(t.length>0)return void e(t);const n=setTimeout(()=>e([]),800);speechSynthesis.addEventListener("voiceschanged",()=>{clearTimeout(n),e(speechSynthesis.getVoices())},{once:!0})}),t=e.map(e=>`${e.name}|${e.lang}|${e.localService}`).sort();return{supported:!0,voiceCount:e.length,voices:t}}},{name:"mediaQueries",tier:2,async collect(){if("function"!=typeof matchMedia){const e={};for(const t of j)e[t.name.replace(/-([a-z])/g,(e,t)=>t.toUpperCase())]="unsupported";return{...e,monochrome:0}}const e={};for(const t of j){let n="unknown";for(const e of t.values){const o=matchMedia(`(${t.name}: ${e})`);if(o?.matches){n=e;break}}e[t.name.replace(/-([a-z])/g,(e,t)=>t.toUpperCase())]=n}let t=0;for(let e=100;e>=0;e--)if(matchMedia(`(monochrome: ${e})`)?.matches){t=e;break}return{...e,monochrome:t}}},{name:"applePay",tier:2,async collect(){const e=window.ApplePaySession;if(!e||"function"!=typeof e.supportsVersion)return{supported:!1,maxVersion:0};let t=0;for(let n=15;n>=1;n--)try{if(e.supportsVersion(n)){t=n;break}}catch{continue}return{supported:!0,maxVersion:t}}},{name:"keyboard",tier:2,async collect(){const e=navigator.keyboard;if(!e||"function"!=typeof e.getLayoutMap)return{supported:!1,layoutKeys:null,layoutHint:null};try{const t=await e.getLayoutMap(),n={};for(const e of H){const o=t.get(e);void 0!==o&&(n[e]=o)}return{supported:!0,layoutKeys:n,layoutHint:K(n)}}catch{return{supported:!1,layoutKeys:null,layoutHint:null}}}}];async function q(e,t,n){const o={},r=[],i=$.filter(t=>!e.has(t.name)&&(n||3!==t.tier)),a=await Promise.allSettled(i.map(async e=>{const n=await(o=e.collect(),r=t,new Promise((e,t)=>{const n=setTimeout(()=>e(null),r);o.then(t=>{clearTimeout(n),e(t)},e=>{clearTimeout(n),t(e)})}));var o,r;return{name:e.name,value:n}}));for(let e=0;e<a.length;e++){const t=a[e],n=i[e].name;"fulfilled"===t.status&&null!==t.value.value?o[n]=t.value.value:"rejected"===t.status&&r.push({signal:n,error:String(t.reason?.message??t.reason)})}return{components:o,errors:r}}async function Z(t){const i=function(e){return e?{exclude:e.exclude??n.exclude,include:e.include??n.include,timeout:e.timeout??n.timeout,stabilize:e.stabilize??n.stabilize,experimental:e.experimental??n.experimental,debug:e.debug??n.debug,salt:e.salt??n.salt}:{...n}}(t),c=s(),u=function(){try{return window.self!==window.top}catch{return!0}}();let d=!1;try{d=await l(c.name)}catch{}const f=function(e,t,n,o){const r=new Set;for(const i of e){if("private"===i&&!n)continue;if("iframe"===i&&!o)continue;const e=a[i];if(e)for(const n of e)if(!n.browsers||n.browsers.includes(t))for(const e of n.exclude)r.add(e)}return r}(i.stabilize,c.name,d,u),m=new Set(f);for(const e of i.exclude)m.add(e);for(const e of i.include)m.delete(e);const{components:p,errors:h}=await q(m,i.timeout,i.experimental),g={t:e};for(const[e,t]of Object.entries(p))o.has(e)||(g[e]=t);const y=w(g,i.salt),S={t:e};for(const[e,t]of Object.entries(p))r.has(e)||(S[e]=t);const v=w(S,i.salt),x={hash:y,stableHash:v,components:{...p,t:e},timestamp:(new Date).toISOString(),version:e,isIncognito:d,errors:h};return i.debug&&(console.log("[fingerprint] components:",p),console.log("[fingerprint] hash:",y,"stableHash:",v),h.length>0&&console.warn("[fingerprint] errors:",h)),x}const Q=new RegExp(["googlebot","bingbot","slurp","baiduspider","duckduckbot","yandex","sogou","exabot","ia_archiver","curl","wget","python-requests","python-urllib","axios","node-fetch","go-http-client","java/","libwww-perl","okhttp","apache-httpclient","http_request","httpie","headlesschrome","phantomjs","puppeteer","playwright","cypress","selenium","webdriver","electron","jsdom","vercel-screenshot","screenshot","prerender","lighthouse","chrome-lighthouse","pagespeed","gtmetrix","pingdom","nessus","nikto","sqlmap","burp","zap","qualys","openvas","nmap","masscan","facebookexternalhit","twitterbot","linkedinbot","whatsapp","telegrambot","slackbot","discordbot","bot","crawl","spider","scrape","fetch","scan"].join("|"),"i");function ee(e){return!!e&&Q.test(e)}const SENTINEL_USER_IDS=new Set(["__pre_auth__","anonymous","guest","undefined","null"]);function isSentinelUserId(e){return"string"==typeof e&&SENTINEL_USER_IDS.has(e)}const DEFAULT_MAX_RETRIES=3,DEFAULT_TIMEOUT_MS=3e4,MAX_DELAY_MS=3e4,BASE_DELAY_MS=1e3,SUBMIT_FP_PATH="/__unshared/submit-fp",SS_EMAIL_KEY="__unshared_email",SS_FP_KEY="__unshared_fp",SS_LAST_SUBMIT_KEY="__unshared_last_submit",LS_DEVICE_ID="__unshared_device_id",COOKIE_UID="__unshared_uid",COOKIE_SID="__unshared_sid";function generateUUID(){if("undefined"!=typeof crypto&&crypto.randomUUID)return crypto.randomUUID();const e=new Uint8Array(16);crypto.getRandomValues(e),e[6]=15&e[6]|64,e[8]=63&e[8]|128;const t=Array.from(e).map(e=>e.toString(16).padStart(2,"0")).join("");return`${t.slice(0,8)}-${t.slice(8,12)}-${t.slice(12,16)}-${t.slice(16,20)}-${t.slice(20)}`}function sleep(e){return new Promise(t=>setTimeout(t,e))}function retryDelay(e){const t=Math.min(1e3*Math.pow(2,e-1),3e4),n=500*Math.random()-250;return Math.max(0,t+n)}function getCookie(e){if("undefined"==typeof document)return;const t=document.cookie.match(new RegExp(`(?:^|; )${e}=([^;]*)`));return t?decodeURIComponent(t[1]):void 0}function setCookie(e,t){"undefined"!=typeof document&&(document.cookie=`${e}=${encodeURIComponent(t)}; Path=/; SameSite=Lax`)}function deleteCookie(e){"undefined"!=typeof document&&(document.cookie=`${e}=; Path=/; SameSite=Lax; Expires=Thu, 01 Jan 1970 00:00:00 GMT`)}function getLocalStorageItem(e){if("undefined"!=typeof localStorage)try{return localStorage.getItem(e)??void 0}catch{return}}function setLocalStorageItem(e,t){if("undefined"!=typeof localStorage)try{localStorage.setItem(e,t)}catch{}}function getSessionStorageItem(e){if("undefined"!=typeof sessionStorage)try{return sessionStorage.getItem(e)??void 0}catch{return}}function setSessionStorageItem(e,t){if("undefined"!=typeof sessionStorage)try{sessionStorage.setItem(e,t)}catch{}}function isValidUrl(e){try{return new URL(e),!0}catch{return!1}}class UnsharedBrowser{constructor(e={}){if(this.o="",e.baseUrl&&!isValidUrl(e.baseUrl))throw new Error('baseUrl must be a valid URL (e.g. "https://app.example.com")');let t,n;this.i=e.baseUrl?e.baseUrl.replace(/\/$/,""):"",this.u=e.maxRetries??3,this.l=e.timeout??3e4,this.m=e.includePathPrefix,this.p=e.skipPaths,this.h=e.sessionId,this.S=e.deviceId,this.o=getSessionStorageItem(SS_LAST_SUBMIT_KEY)??"";try{t=this.h?.()}catch{}this.v=t??getCookie(COOKIE_SID)??generateUUID(),setCookie(COOKIE_SID,this.v);try{n=this.S?.()}catch{}n?(this._=n,setLocalStorageItem(LS_DEVICE_ID,n)):this._=getLocalStorageItem(LS_DEVICE_ID)??"",this.I()}async init(e){try{if("undefined"!=typeof navigator&&ee(navigator.userAgent))return;if(isSentinelUserId(e.userId))return void this.C;this.C=e.userId,this.M=e.emailAddress,"undefined"!=typeof sessionStorage&&sessionStorage.setItem(SS_EMAIL_KEY,e.emailAddress),setCookie(COOKIE_UID,e.userId);let t,n=this.k();n||(n=await this.collect(),this.D(n));try{t=this.S?.()}catch{}t?(this._=t,setLocalStorageItem(LS_DEVICE_ID,t)):n.fingerprint_id&&(this._=n.fingerprint_id,setLocalStorageItem(LS_DEVICE_ID,n.fingerprint_id)),this.P(n).catch(()=>{})}catch{}}onRouteChange(){try{if(!this.L())return;const e=this.k();if(!e)return;this.P(e).catch(()=>{})}catch{}}destroy(){try{"undefined"!=typeof sessionStorage&&(sessionStorage.removeItem(SS_EMAIL_KEY),sessionStorage.removeItem(SS_FP_KEY),sessionStorage.removeItem(SS_LAST_SUBMIT_KEY)),this.o="",deleteCookie(COOKIE_UID),this.T&&"undefined"!=typeof document&&(document.removeEventListener("DOMContentLoaded",this.T),this.T=void 0),this.C=void 0,this.M=void 0}catch{}}async collect(e){const t=[...new Set(["timing","speech",...e?.exclude??[]])],n=await Z({...e,exclude:t});return{fingerprint_id:n.stableHash,full_hash:n.hash,components:n.components,timestamp:n.timestamp,isIncognito:n.isIncognito,version:n.version}}async submitFingerprintEvent(e,t){try{const n=this.A(e,t),o=generateUUID(),r=`${this.i}${SUBMIT_FP_PATH}`;return await this.U(r,JSON.stringify(n),o)}catch(e){return{success:!1,error:{code:"DELIVERY_FAILED",message:e instanceof Error?e.message:String(e)}}}}L(){if("undefined"!=typeof sessionStorage)return sessionStorage.getItem(SS_EMAIL_KEY)??void 0}k(){if("undefined"==typeof sessionStorage)return;const e=sessionStorage.getItem(SS_FP_KEY);if(e)try{return JSON.parse(e)}catch{return}}D(e){"undefined"!=typeof sessionStorage&&sessionStorage.setItem(SS_FP_KEY,JSON.stringify(e))}O(){if("undefined"==typeof location)return!0;const e=location.pathname||"/";if(this.p)for(const t of this.p)if(e.startsWith(t))return!1;return!this.m||this.m.some(t=>e.startsWith(t))}async P(e){if("undefined"!=typeof navigator&&ee(navigator.userAgent))return{success:!0};if(!this.O())return{success:!0};const t=this.M??this.L(),n=this.C??getCookie(COOKIE_UID),o="undefined"!=typeof location?(location.pathname||"/")+(location.search||""):"/";if(n){const e=`${n}|${o}`;if(e===this.o)return{success:!0};this.o=e,setSessionStorageItem(SS_LAST_SUBMIT_KEY,e)}const r={hash:e.full_hash,stable_hash:e.fingerprint_id,collected_at:(new Date).toISOString(),is_incognito:e.isIncognito,components:e.components,version:e.version,session_id:this.v,event_type:o};n&&(r.user_id=n),t&&(r.email=t);const i=`${e.fingerprint_id}|${n??""}|${o}`,a=`${this.i}${SUBMIT_FP_PATH}`;return this.U(a,JSON.stringify(r),i)}I(){"undefined"!=typeof document&&(this.T&&document.removeEventListener("DOMContentLoaded",this.T),this.T=()=>{if(!this.L())return;const e=this.k();e&&this.P(e).catch(()=>{})},document.addEventListener("DOMContentLoaded",this.T))}async U(e,t,n){const o=this.u+1;let r={success:!1,error:{code:"DELIVERY_FAILED",message:"Request failed"}};for(let i=1;i<=o;i++){i>1&&await sleep(retryDelay(i-1));const o=new AbortController,a=setTimeout(()=>o.abort(),this.l);try{const i=await fetch(e,{method:"POST",headers:{"Content-Type":"application/json","X-Idempotency-Key":n,"X-Session-Id":this.v,"X-Device-Id":this._},body:t,signal:o.signal});if(clearTimeout(a),i.status>=500){r={success:!1,error:{code:"DELIVERY_FAILED",message:`Backend returned ${i.status}`}};continue}if(i.status>=400)return{success:!1,error:{code:"DELIVERY_FAILED",message:`Backend returned ${i.status}`}};const s=await i.text().catch(()=>"{}");let c;try{c=JSON.parse(s)}catch{c={}}return!1===c?.success?{success:!1,error:c.error??{code:"UPSTREAM_ERROR",message:"Upstream failed"}}:{success:!0,data:c?.data}}catch(e){clearTimeout(a),r={success:!1,error:{code:"DELIVERY_FAILED",message:e instanceof Error?e.message:String(e)}}}}return r}A(e,t){const n={hash:e.full_hash,stable_hash:e.fingerprint_id,collected_at:e.timestamp,is_incognito:e.isIncognito,components:e.components,version:e.version,session_id:this.v};n.user_id=t.userId,null!=t?.eventType&&(n.event_type=t.eventType);const o=this.M??this.L();return o&&(n.email=o),n}}function createAxiosInterceptor(e){return t=>{if(403===t?.response?.status&&"account_flagged"===t?.response?.data?.error)try{e.onFlagged()}catch{}return Promise.reject(t)}}function createFetchInterceptor(e,t){return async(...n)=>{const o=await e(...n);if(403===o.status){const e=o.clone();try{const n=await e.json();if("account_flagged"===n?.error)try{t.onFlagged()}catch{}}catch{}}return o}}export{UnsharedBrowser,createAxiosInterceptor,createFetchInterceptor};
1
+ const e="1.3.3",t=1282368115,n={exclude:[],include:[],timeout:3e3,stabilize:["private","iframe","always"],experimental:!1,debug:!1,salt:""},o=new Set(["audio","timing","navigatorConnection","domrect","permissions","fonts","speech","display","cssLayout"]),r=new Set(["domrect"]),a=new Set(["screen","mediaCapabilities","storage","features","sensors","battery","gamepads","webApis","notificationState","extendedLocale","privacyPrefs","performanceContext","canvas","audioOscillator","webglRender","canvasTextMetrics","vendorFlavors","fontPreferences","screenFrame","clientHints","domBlockers","privateClickMeasurement","automationDetection","agentDetection","tamperDetection","vmDetection","devtoolsDetection"]),i={always:[{exclude:["speech"],browsers:["brave","firefox"]},{exclude:["keyboard"],browsers:["firefox","safari"]},{exclude:["workers"],browsers:["firefox"]},{exclude:["hardwareSensitive","navigatorProps"],browsers:["brave"]},{exclude:["canvas","audioOscillator","webglRender","canvasTextMetrics"],browsers:["brave"]},{exclude:["canvas"],browsers:["firefox"]}],private:[{exclude:["fonts"],browsers:["firefox"]},{exclude:["audio"],browsers:["safari","brave"]},{exclude:["audioOscillator"],browsers:["safari"]}],iframe:[{exclude:["applePay"],browsers:["safari"]},{exclude:["permissions"]},{exclude:["keyboard"]}]};let s=null;function c(){if(s)return s;const e=navigator.userAgent;return s=function(){const e=navigator.brave;return!!e&&"function"==typeof e.isBrave}()?{name:"brave",version:l(e,/Chrome\/([\d.]+)/)}:/Edg\//i.test(e)?{name:"edge",version:l(e,/Edg\/([\d.]+)/)}:/OPR\//i.test(e)||/Opera/i.test(e)?{name:"opera",version:l(e,/OPR\/([\d.]+)/)||l(e,/Opera\/([\d.]+)/)}:/SamsungBrowser/i.test(e)?{name:"samsung",version:l(e,/SamsungBrowser\/([\d.]+)/)}:/Firefox\//i.test(e)?{name:"firefox",version:l(e,/Firefox\/([\d.]+)/)}:/Safari\//i.test(e)&&!/Chrome/i.test(e)?{name:"safari",version:l(e,/Version\/([\d.]+)/)}:/Chrome\//i.test(e)?{name:"chrome",version:l(e,/Chrome\/([\d.]+)/)}:{name:"unknown",version:""},s}function l(e,t){const n=e.match(t);return n?.[1]??""}async function u(e){try{switch(e){case"chrome":case"edge":case"opera":default:return await d();case"brave":return await async function(){return!1}();case"safari":return await async function(){if(navigator.storage?.estimate){const{quota:e}=await navigator.storage.estimate();if(void 0!==e)return e<4294967296}try{return!!navigator.storage?.getDirectory&&(await navigator.storage.getDirectory(),!1)}catch(e){return"NotFoundError"===e?.name}}();case"firefox":return await async function(){if(!("serviceWorker"in navigator))return!0;try{return!!navigator.storage?.getDirectory&&(await navigator.storage.getDirectory(),!1)}catch(e){return"SecurityError"===e?.name}}()}}catch{return!1}}async function d(){if(!navigator.storage?.estimate)return!1;const{quota:e}=await navigator.storage.estimate();return void 0!==e&&e<4294967296}function m(e,t){const n=e[0]>>>16,o=65535&e[0],r=e[1]>>>16,i=65535&e[1],a=t[0]>>>16,c=65535&t[0],s=t[1]>>>16;let l=0,u=0,d=0,f=0,m=0;return u=i+(65535&t[1]),l=u>>>16,u&=65535,d=r+s+l,l=d>>>16,d&=65535,f=o+c+l,l=f>>>16,f&=65535,m=n+a+l,m&=65535,[m<<16|f,d<<16|u]}function f(e,t){const n=e[0]>>>16,o=65535&e[0],r=e[1]>>>16,i=65535&e[1],a=t[0]>>>16,c=65535&t[0],s=t[1]>>>16,l=65535&t[1];let u=0,d=0,f=0,m=0,p=0;return d=i*l,u=d>>>16,d&=65535,f=r*l+u,u=f>>>16,f&=65535,f+=i*s,u+=f>>>16,f&=65535,m=o*l+u,u=m>>>16,m&=65535,m+=r*s,u+=m>>>16,m&=65535,m+=i*c,u+=m>>>16,m&=65535,p=n*l+o*s+r*c+i*a+u,p&=65535,[p<<16|m,f<<16|d]}function p(e,t){return 32==(t%=64)?[e[1],e[0]]:t<32?[e[0]<<t|e[1]>>>32-t,e[1]<<t|e[0]>>>32-t]:(t-=32,[e[1]<<t|e[0]>>>32-t,e[0]<<t|e[1]>>>32-t])}function h(e,t){return 0==(t%=64)?[e[0],e[1]]:t<32?[e[0]<<t|e[1]>>>32-t,e[1]<<t]:[e[1]<<t-32,0]}function g(e,t){return[e[0]^t[0],e[1]^t[1]]}function y(e){let t=[e[0],e[1]];return t=g(t,[0,t[0]>>>1]),t=f(t,[4283543511,3981806797]),t=g(t,[0,t[0]>>>1]),t=f(t,[3301882366,444984403]),t=g(t,[0,t[0]>>>1]),t}function v(e){return("00000000"+(e>>>0).toString(16)).slice(-8)}function w(e,t=0){const n=e.length%16,o=e.length-n;let r=[0,t],i=[0,t];const a=[2277735313,289559509],c=[1291169091,658871167];for(let t=0;t<o;t+=16){let n=[255&e.charCodeAt(t+4)|(255&e.charCodeAt(t+5))<<8|(255&e.charCodeAt(t+6))<<16|(255&e.charCodeAt(t+7))<<24,255&e.charCodeAt(t)|(255&e.charCodeAt(t+1))<<8|(255&e.charCodeAt(t+2))<<16|(255&e.charCodeAt(t+3))<<24],o=[255&e.charCodeAt(t+12)|(255&e.charCodeAt(t+13))<<8|(255&e.charCodeAt(t+14))<<16|(255&e.charCodeAt(t+15))<<24,255&e.charCodeAt(t+8)|(255&e.charCodeAt(t+9))<<8|(255&e.charCodeAt(t+10))<<16|(255&e.charCodeAt(t+11))<<24];n=f(n,a),n=p(n,31),n=f(n,c),r=g(r,n),r=p(r,27),r=m(r,i),r=m(f(r,[0,5]),[0,1390208809]),o=f(o,c),o=p(o,33),o=f(o,a),i=g(i,o),i=p(i,31),i=m(i,r),i=m(f(i,[0,5]),[0,944331445])}let s=[0,0],l=[0,0];switch(n){case 15:l=g(l,h([0,e.charCodeAt(o+14)],48));case 14:l=g(l,h([0,e.charCodeAt(o+13)],40));case 13:l=g(l,h([0,e.charCodeAt(o+12)],32));case 12:l=g(l,h([0,e.charCodeAt(o+11)],24));case 11:l=g(l,h([0,e.charCodeAt(o+10)],16));case 10:l=g(l,h([0,e.charCodeAt(o+9)],8));case 9:l=g(l,[0,e.charCodeAt(o+8)]),l=f(l,c),l=p(l,33),l=f(l,a),i=g(i,l);case 8:s=g(s,h([0,e.charCodeAt(o+7)],56));case 7:s=g(s,h([0,e.charCodeAt(o+6)],48));case 6:s=g(s,h([0,e.charCodeAt(o+5)],40));case 5:s=g(s,h([0,e.charCodeAt(o+4)],32));case 4:s=g(s,h([0,e.charCodeAt(o+3)],24));case 3:s=g(s,h([0,e.charCodeAt(o+2)],16));case 2:s=g(s,h([0,e.charCodeAt(o+1)],8));case 1:s=g(s,[0,e.charCodeAt(o)]),s=f(s,a),s=p(s,31),s=f(s,c),r=g(r,s)}return r=g(r,[0,e.length]),i=g(i,[0,e.length]),r=m(r,i),i=m(i,r),r=y(r),i=y(i),r=m(r,i),i=m(i,r),v(r[0])+v(r[1])+v(i[0])+v(i[1])}function b(e){return x(e,new Set)}function x(e,t){if(null===e)return"null";if(void 0===e)return"undefined";const n=typeof e;if("boolean"===n||"number"===n)return String(e);if("string"===n)return JSON.stringify(e);if(Array.isArray(e)){if(t.has(e))return'"[Circular]"';t.add(e);const n=e.map(e=>x(e,t));return t.delete(e),"["+n.join(",")+"]"}if("object"===n){const n=e;if(t.has(n))return'"[Circular]"';t.add(n);const o=Object.keys(n).sort().filter(e=>void 0!==n[e]).map(e=>JSON.stringify(e)+":"+x(n[e],t));return t.delete(n),"{"+o.join(",")+"}"}return String(e)}const S=w("",t);function _(e,n){const o=function(e){if(0===e.length)return w("",t);if(1===e.length)return w(e[0],t);let n=[...e];for(;n.length>1;){const e=[];for(let o=0;o<n.length;o+=2){const r=o+1<n.length?n[o+1]:S;e.push(w(n[o]+r,t))}n=e}return n[0]}(Object.keys(e).sort().map(n=>{const o=function(e){let n=t;for(let t=0;t<e.length;t++)n=Math.imul(n^e.charCodeAt(t),1540483477),n^=n>>>13;return n>>>0}(n);return w(b(e[n]),o)})),r=String.fromCharCode(76,111,98,115),i=n?w(n,t):"";return w(o+r+i,t)}const C={name:"webgl",tier:1,async collect(){const e=document.createElement("canvas"),t=e.getContext("webgl")||e.getContext("experimental-webgl");if(!(t&&t instanceof WebGLRenderingContext))return null;const n=t.getExtension("WEBGL_debug_renderer_info"),o=t.getSupportedExtensions()??[],r=function(e){const t={},n=[e.VERTEX_SHADER,e.FRAGMENT_SHADER],o=[e.LOW_FLOAT,e.MEDIUM_FLOAT,e.HIGH_FLOAT,e.LOW_INT,e.MEDIUM_INT,e.HIGH_INT],r=["vertex","fragment"],i=["lowFloat","mediumFloat","highFloat","lowInt","mediumInt","highInt"];for(let a=0;a<n.length;a++){const c={};for(let t=0;t<o.length;t++){const r=e.getShaderPrecisionFormat(n[a],o[t]);r&&(c[i[t]]={rangeMin:r.rangeMin,rangeMax:r.rangeMax,precision:r.precision})}t[r[a]]=c}return t}(t),i={vendor:t.getParameter(t.VENDOR),renderer:t.getParameter(t.RENDERER),version:t.getParameter(t.VERSION),shadingLanguageVersion:t.getParameter(t.SHADING_LANGUAGE_VERSION),unmaskedVendor:n?t.getParameter(n.UNMASKED_VENDOR_WEBGL):null,unmaskedRenderer:n?t.getParameter(n.UNMASKED_RENDERER_WEBGL):null,extensions:o.sort(),maxTextureSize:t.getParameter(t.MAX_TEXTURE_SIZE),maxRenderbufferSize:t.getParameter(t.MAX_RENDERBUFFER_SIZE),maxViewportDims:Array.from(t.getParameter(t.MAX_VIEWPORT_DIMS)),maxVertexAttribs:t.getParameter(t.MAX_VERTEX_ATTRIBS),maxVertexUniformVectors:t.getParameter(t.MAX_VERTEX_UNIFORM_VECTORS),maxFragmentUniformVectors:t.getParameter(t.MAX_FRAGMENT_UNIFORM_VECTORS),maxVaryingVectors:t.getParameter(t.MAX_VARYING_VECTORS),aliasedLineWidthRange:Array.from(t.getParameter(t.ALIASED_LINE_WIDTH_RANGE)),aliasedPointSizeRange:Array.from(t.getParameter(t.ALIASED_POINT_SIZE_RANGE)),maxCombinedTextureImageUnits:t.getParameter(t.MAX_COMBINED_TEXTURE_IMAGE_UNITS),maxTextureImageUnits:t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS),maxVertexTextureImageUnits:t.getParameter(t.MAX_VERTEX_TEXTURE_IMAGE_UNITS),shaderPrecision:r,maxAnisotropy:A(t),webgl2:E(e)};return t.getExtension("WEBGL_lose_context")?.loseContext(),i}};function A(e){try{const t=e.getExtension("EXT_texture_filter_anisotropic")??e.getExtension("WEBKIT_EXT_texture_filter_anisotropic")??e.getExtension("MOZ_EXT_texture_filter_anisotropic");return t?e.getParameter(t.MAX_TEXTURE_MAX_ANISOTROPY_EXT):null}catch{return null}}function E(e){try{const t=e.getContext("webgl2");if(!t)return null;const n={version:t.getParameter(t.VERSION),maxSamples:t.getParameter(t.MAX_SAMPLES),max3DTextureSize:t.getParameter(t.MAX_3D_TEXTURE_SIZE),maxArrayTextureLayers:t.getParameter(t.MAX_ARRAY_TEXTURE_LAYERS),maxUniformBlockSize:t.getParameter(t.MAX_UNIFORM_BLOCK_SIZE),maxVertexUniformComponents:t.getParameter(t.MAX_VERTEX_UNIFORM_COMPONENTS),maxFragmentUniformComponents:t.getParameter(t.MAX_FRAGMENT_UNIFORM_COMPONENTS),maxColorAttachments:t.getParameter(t.MAX_COLOR_ATTACHMENTS),maxDrawBuffers:t.getParameter(t.MAX_DRAW_BUFFERS)};return t.getExtension("WEBGL_lose_context")?.loseContext(),n}catch{return null}}const P={name:"hardware",tier:1,collect:async()=>({architecture:M(),platform:R()})},T={name:"hardwareSensitive",tier:1,collect:async()=>({deviceMemory:navigator.deviceMemory??null,hardwareConcurrency:navigator.hardwareConcurrency??null})};function R(){const e=navigator.userAgentData;if(e?.platform)return e.platform;const t=navigator.userAgent??"";return/Windows/.test(t)?"Windows":/Macintosh|Mac OS X/.test(t)?"macOS":/CrOS/.test(t)?"Chrome OS":/Android/.test(t)?"Android":/Linux/.test(t)?"Linux":/iPhone|iPad|iPod/.test(t)?"iOS":""}function M(){try{const e=new ArrayBuffer(4),t=new Float32Array(e),n=new Uint8Array(e);return t[0]=1/0,n[3]}catch{return 0}}const D={name:"math",tier:1,collect:async()=>({acos:Math.acos(.5),asin:k(Math.asin,-1,1,97),cos:k(Math.cos,0,Math.PI,97),cosLarge:Math.cos(1e20),sinLarge:Math.sin(1e20),tanLarge:Math.tan(1e20),sin:k(Math.sin,0,Math.PI,97),tan:k(Math.tan,0,Math.PI/4,97)})};function k(e,t,n,o){const r=(n-t)/o;let i=e(t)+e(n);for(let n=1;n<o;n++)i+=e(t+n*r)*(n%2==0?2:4);return i*r/3}const I={name:"i18n",tier:1,collect:async()=>({dateTimeFormat:O(),numberFormat:B(),collator:L(),pluralRules:F(),relativeTimeFormat:N(),listFormat:W()})};function O(){try{const e=(new Intl.DateTimeFormat).resolvedOptions();return{locale:e.locale,calendar:e.calendar,numberingSystem:e.numberingSystem,timeZone:e.timeZone}}catch{return{}}}function B(){try{const e=(new Intl.NumberFormat).resolvedOptions();return{locale:e.locale,numberingSystem:e.numberingSystem,style:e.style,minimumIntegerDigits:e.minimumIntegerDigits,minimumFractionDigits:e.minimumFractionDigits,maximumFractionDigits:e.maximumFractionDigits,useGrouping:e.useGrouping}}catch{return{}}}function L(){try{const e=(new Intl.Collator).resolvedOptions();return{locale:e.locale,usage:e.usage,sensitivity:e.sensitivity,collation:e.collation,numeric:e.numeric,caseFirst:e.caseFirst}}catch{return{}}}function F(){try{const e=(new Intl.PluralRules).resolvedOptions(),t=new Intl.PluralRules(void 0,{type:"ordinal"}).resolvedOptions();return{locale:e.locale,type:e.type,cardinalCategories:(new Intl.PluralRules).select(0)+","+(new Intl.PluralRules).select(1)+","+(new Intl.PluralRules).select(2)+","+(new Intl.PluralRules).select(5)+","+(new Intl.PluralRules).select(11)+","+(new Intl.PluralRules).select(100),ordinalCategory1:t.type,minimumIntegerDigits:e.minimumIntegerDigits}}catch{return{}}}function N(){try{const e=new Intl.RelativeTimeFormat;if(!e)return{};const t=e.resolvedOptions();return{locale:t.locale,style:t.style,numeric:t.numeric,numberingSystem:t.numberingSystem}}catch{return{}}}function W(){try{const e=new Intl.ListFormat;if(!e)return{};const t=e.resolvedOptions(),n=["X","Y","Z"],o=new Intl.ListFormat(void 0,{type:"conjunction",style:"long"}),r=new Intl.ListFormat(void 0,{type:"disjunction",style:"long"});return{locale:t.locale,type:t.type,style:t.style,conjunctionSample:o.format(n),disjunctionSample:r.format(n)}}catch{return{}}}const U={name:"domrect",tier:1,collect:async()=>({basic:function(){const e=document.createElement("div");e.style.cssText="position:fixed;left:-9999px;width:100px;height:100px;",document.body.appendChild(e);const t=e.getBoundingClientRect();return document.body.removeChild(e),{x:t.x,y:t.y,width:t.width,height:t.height,top:t.top,right:t.right,bottom:t.bottom,left:t.left}}(),precision:function(){const e=document.createElement("div");e.style.cssText=`position:absolute;left:-9999px;width:${Math.PI}px;height:${Math.E}px;`,document.body.appendChild(e);const t=e.getBoundingClientRect();return document.body.removeChild(e),{width:t.width,height:t.height}}(),fromRect:"undefined"!=typeof DOMRectReadOnly&&"function"==typeof DOMRectReadOnly.fromRect})},V={name:"touch",tier:1,collect:async()=>({supported:"ontouchstart"in window||navigator.maxTouchPoints>0,maxTouchPoints:navigator.maxTouchPoints??0})},G={name:"display",tier:1,collect:async()=>({colorDepth:screen.colorDepth??0,pixelDepth:screen.pixelDepth??0})},z={name:"locale",tier:1,collect:async()=>({timezone:Intl.DateTimeFormat().resolvedOptions().timeZone??"",language:navigator.language??""})},H={name:"workers",tier:1,collect:async()=>({webWorker:"undefined"!=typeof Worker,sharedWorker:"undefined"!=typeof SharedWorker,serviceWorker:"serviceWorker"in navigator})},X={name:"plugins",tier:1,async collect(){const e=[];if(navigator.plugins)for(let t=0;t<navigator.plugins.length;t++){const n=navigator.plugins[t];"internal-pdf-viewer"===n.filename&&e.push(`${n.name}|${n.filename}|${n.description}`)}return{plugins:e.sort(),pdfViewerEnabled:navigator.pdfViewerEnabled??!1}}},j=[["backdrop-filter","blur(1px)"],["container-type","inline-size"],["text-wrap","balance"],["overscroll-behavior","contain"],["hanging-punctuation","first"],["-webkit-line-clamp","1"],["appearance","none"],["font-size-adjust","ex-height 0.5"],["font-palette","normal"],["field-sizing","content"],["-webkit-text-stroke","1px black"],["zoom","1"],["scrollbar-width","thin"],["scrollbar-color","red blue"],["animation-timeline","auto"],["mask-composite","add"],["offset-path","none"],["text-decoration-thickness","1px"],["content-visibility","auto"],["contain-intrinsic-size","auto 100px"],["aspect-ratio","16/9"],["gap","10px"],["color-mix","in srgb, red 50%, blue"],["linear-gradient(in oklch, red, blue)",""]],q={name:"css",tier:1,collect:async()=>({supports:K(),safeArea:$()})};function K(){const e={};if("undefined"==typeof CSS||"function"!=typeof CSS.supports)return e;for(const[t,n]of j)e[t]=n?CSS.supports(t,n):CSS.supports(t);return e}function $(){try{const e=document.createElement("div");e.style.cssText=["position:fixed","top:0","left:0","width:0","height:0","visibility:hidden","padding-top:env(safe-area-inset-top,0px)","padding-bottom:env(safe-area-inset-bottom,0px)","padding-left:env(safe-area-inset-left,0px)","padding-right:env(safe-area-inset-right,0px)"].join(";"),document.body.appendChild(e);const t=getComputedStyle(e),n={top:t.paddingTop,bottom:t.paddingBottom,left:t.paddingLeft,right:t.paddingRight};return document.body.removeChild(e),n}catch{return null}}const Z={name:"cssLayout",tier:1,collect:async()=>({scrollbarWidth:Y()})};function Y(){try{const e=document.createElement("div");e.style.cssText="visibility:hidden;overflow:scroll;position:absolute;top:-9999px;width:100px;height:100px",document.body.appendChild(e);const t=document.createElement("div");e.appendChild(t);const n=e.offsetWidth-t.offsetWidth;return document.body.removeChild(e),n}catch{return-1}}const J={name:"navigatorProps",tier:1,collect:async()=>({vendor:navigator.vendor??"",productSub:navigator.productSub??"",cookieEnabled:navigator.cookieEnabled})},Q={name:"navigatorConnection",tier:2,async collect(){const e=navigator,t=e.connection??e.mozConnection??e.webkitConnection??null,n=performance.memory??null;return{connection:t?{type:t.type??null,effectiveType:t.effectiveType??null,saveData:t.saveData??null}:null,memory:n?{jsHeapSizeLimit:n.jsHeapSizeLimit}:null}}},ee={name:"timing",tier:2,collect:async()=>({performancePrecisionUs:te()})};function te(){try{const e=performance.now();let t=1/0,n=e;for(let o=0;o<50;o++){const o=performance.now(),r=o-n;if(r>0&&r<t&&(t=r),n=o,o-e>=1)break}if(t===1/0)return-1;const o=1e3*t;if(o<=0)return-1;const r=Math.max(0,Math.round(Math.log10(o)));return Math.pow(10,r)}catch{return-1}}const ne={name:"webgpu",tier:2,async collect(){const e=navigator.gpu;if(!e)return null;const t=await e.requestAdapter();if(!t)return null;let n="",o="",r="",i="";if(t.info)n=t.info.vendor??"",o=t.info.architecture??"",r=t.info.device??"",i=t.info.description??"";else if("function"==typeof t.requestAdapterInfo){const e=await t.requestAdapterInfo();n=e.vendor??"",o=e.architecture??"",r=e.device??"",i=e.description??""}const a=[];t.features&&(t.features.forEach(e=>a.push(e)),a.sort());const c={};if(t.limits){const e=["maxTextureDimension1D","maxTextureDimension2D","maxTextureDimension3D","maxTextureArrayLayers","maxBindGroups","maxBindGroupsPlusVertexBuffers","maxBindingsPerBindGroup","maxDynamicUniformBuffersPerPipelineLayout","maxDynamicStorageBuffersPerPipelineLayout","maxSampledTexturesPerShaderStage","maxSamplersPerShaderStage","maxStorageBuffersPerShaderStage","maxStorageTexturesPerShaderStage","maxUniformBuffersPerShaderStage","maxUniformBufferBindingSize","maxStorageBufferBindingSize","minUniformBufferOffsetAlignment","minStorageBufferOffsetAlignment","maxVertexBuffers","maxBufferSize","maxVertexAttributes","maxVertexBufferArrayStride","maxInterStageShaderComponents","maxInterStageShaderVariables","maxColorAttachments","maxColorAttachmentBytesPerSample","maxComputeWorkgroupStorageSize","maxComputeInvocationsPerWorkgroup","maxComputeWorkgroupSizeX","maxComputeWorkgroupSizeY","maxComputeWorkgroupSizeZ","maxComputeWorkgroupsPerDimension"];for(const n of e){const e=t.limits[n];void 0!==e&&(c[n]=e)}}return{vendor:n,architecture:o,device:r,description:i,features:a,limits:c}}},oe={name:"audio",tier:2,async collect(){const e=window.AudioContext||window.webkitAudioContext;if(!e)return null;let t=null;try{t=new e;const n=t.destination;return{sampleRate:t.sampleRate,maxChannelCount:n.maxChannelCount,channelCount:n.channelCount,channelCountMode:n.channelCountMode,channelInterpretation:n.channelInterpretation,baseLatency:t.baseLatency??null,outputLatency:t.outputLatency??null}}finally{if(t&&"closed"!==t.state)try{await t.close()}catch{}}}},re=["Arial","Arial Black","Arial Narrow","Arial Rounded MT Bold","Bookman Old Style","Bradley Hand","Calibri","Cambria","Cambria Math","Century","Century Gothic","Comic Sans MS","Consolas","Courier","Courier New","Garamond","Geneva","Georgia","Gill Sans","Helvetica","Helvetica Neue","Impact","Lucida Console","Lucida Grande","Lucida Sans Unicode","Microsoft Sans Serif","Monaco","Palatino","Palatino Linotype","Segoe Print","Segoe Script","Segoe UI","Tahoma","Times","Times New Roman","Trebuchet MS","Verdana","Wingdings","Wingdings 2","Wingdings 3","Inter","Roboto","Open Sans","Lato","Montserrat","Poppins","Nunito","Raleway","Ubuntu","Merriweather","Playfair Display","Source Sans Pro","Source Code Pro","Fira Code","JetBrains Mono","Cascadia Code","Apple Color Emoji","Segoe UI Emoji","Noto Color Emoji","SF Pro","SF Pro Display","SF Mono","San Francisco","Menlo","Andale Mono","Futura","MS Gothic","MS Mincho","MS PGothic","MS PMincho","Yu Gothic","Meiryo","Hiragino Sans","Hiragino Kaku Gothic Pro","SimSun","SimHei","Microsoft YaHei","PingFang SC","Noto Sans CJK","Malgun Gothic","Arial Hebrew"],ae=["monospace","sans-serif","serif"],ie="mmMwWLliI0O&1",se={name:"fonts",tier:2,collect:()=>new Promise(e=>{const t=()=>e(function(){try{if("undefined"==typeof document)return{available:[],method:"css-layout"};const e=new Set,t=[];if("function"==typeof document.fonts?.check)for(const n of re)document.fonts.check(`72px "${n}"`)?e.add(n):t.push(n);else t.push(...re);const n=new Set;if(t.length>0){const e=document.createElement("div");e.style.cssText="position:absolute;visibility:hidden;top:-9999px;left:-9999px;pointer-events:none;";const o=ae.map(t=>{const n=document.createElement("span");return n.style.cssText=`font-size:72px;font-family:${t};white-space:nowrap;display:inline-block`,n.textContent=ie,e.appendChild(n),n}),r=t.map(t=>ae.map(n=>{const o=document.createElement("span");return o.style.cssText=`font-size:72px;font-family:'${t}',${n};white-space:nowrap;display:inline-block`,o.textContent=ie,e.appendChild(o),o}));document.body.appendChild(e);const i=o.map(e=>e.getBoundingClientRect().width),a=r.map(e=>e.map(e=>e.getBoundingClientRect().width));document.body.removeChild(e);for(let e=0;e<t.length;e++)for(let o=0;o<ae.length;o++)if(a[e][o]!==i[o]){n.add(t[e]);break}}return{available:re.filter(t=>e.has(t)||n.has(t)),method:"css-layout"}}catch{return{available:[],method:"css-layout"}}}());"undefined"!=typeof requestIdleCallback?requestIdleCallback(t,{timeout:2e3}):setTimeout(t,0)})},ce={name:"webrtc",tier:2,async collect(){if("undefined"==typeof RTCPeerConnection)return{supported:!1,audioCodecCount:0,videoCodecCount:0,audioCodecs:[],videoCodecs:[],extensions:[]};const e=new RTCPeerConnection({iceServers:[]});try{e.addTransceiver("audio"),e.addTransceiver("video");const t=(await e.createOffer()).sdp??"",n=le(t,"audio"),o=le(t,"video"),r=function(e){const t=new Set,n=e.split("\r\n");for(const e of n)if(e.startsWith("a=extmap:")){const n=e.match(/^a=extmap:\d+(?:\/\w+)?\s+(.+)$/);n&&t.add(n[1].trim())}return Array.from(t)}(t);return{supported:!0,audioCodecCount:n.length,videoCodecCount:o.length,audioCodecs:n.sort(),videoCodecs:o.sort(),extensions:r.sort()}}finally{e.close()}}};function le(e,t){const n=[],o=e.split("\r\n");let r=!1;for(const e of o)if(e.startsWith(`m=${t}`))r=!0;else{if(e.startsWith("m=")&&r)break;if(r&&e.startsWith("a=rtpmap:")){const t=e.match(/^a=rtpmap:\d+\s+(.+)$/);t&&n.push(t[1])}}return n}const ue=["accelerometer","accessibility-events","ambient-light-sensor","background-fetch","background-sync","bluetooth","camera","clipboard-read","clipboard-write","display-capture","geolocation","gyroscope","local-fonts","magnetometer","microphone","midi","nfc","notifications","payment-handler","persistent-storage","push","screen-wake-lock","speaker-selection","storage-access","top-level-storage-access","window-management","xr-spatial-tracking"],de={name:"permissions",tier:2,async collect(){if(!navigator.permissions?.query)return{states:{}};const e=()=>Promise.allSettled(ue.map(async e=>{try{return{name:e,state:(await navigator.permissions.query({name:e})).state}}catch{return{name:e,state:"error"}}})),t=await Promise.all([e(),e(),e()]),n={};for(const e of t)for(const t of e)if("fulfilled"===t.status){const{name:e,state:o}=t.value;n[e]||(n[e]=[]),n[e].push(o)}const o={};for(const[e,t]of Object.entries(n))o[e]=me(t);return{states:o}}};function me(e){const t={};for(const n of e)t[n]=(t[n]??0)+1;let n=e[0],o=0;for(const[e,r]of Object.entries(t))r>o&&(n=e,o=r);return n}const fe={name:"speech",tier:2,async collect(){if("undefined"==typeof speechSynthesis)return{supported:!1,voiceCount:0,voices:[]};const e=await new Promise(e=>{const t=speechSynthesis.getVoices();if(t.length>0)return void e(t);const n=setTimeout(()=>e([]),800);speechSynthesis.addEventListener("voiceschanged",()=>{clearTimeout(n),e(speechSynthesis.getVoices())},{once:!0})}),t=e.map(e=>`${e.name}|${e.lang}|${e.localService}`).sort();return{supported:!0,voiceCount:e.length,voices:t}}},pe=[{name:"prefers-contrast",values:["no-preference","more","less","custom"]},{name:"any-hover",values:["none","hover"]},{name:"any-pointer",values:["none","coarse","fine"]},{name:"pointer",values:["none","coarse","fine"]},{name:"hover",values:["none","hover"]},{name:"update",values:["none","slow","fast"]},{name:"inverted-colors",values:["none","inverted"]},{name:"prefers-reduced-motion",values:["no-preference","reduce"]},{name:"prefers-reduced-transparency",values:["no-preference","reduce"]},{name:"scripting",values:["none","initial-only","enabled"]},{name:"forced-colors",values:["none","active"]},{name:"prefers-color-scheme",values:["light","dark"]},{name:"color-gamut",values:["srgb","p3","rec2020"]},{name:"dynamic-range",values:["standard","high"]}],he={name:"mediaQueries",tier:2,async collect(){if("function"!=typeof matchMedia){const e={};for(const t of pe)e[t.name.replace(/-([a-z])/g,(e,t)=>t.toUpperCase())]="unsupported";return{...e,monochrome:0}}const e={};for(const t of pe){let n="unknown";for(const e of t.values){const o=matchMedia(`(${t.name}: ${e})`);if(o?.matches){n=e;break}}e[t.name.replace(/-([a-z])/g,(e,t)=>t.toUpperCase())]=n}let t=0;for(let e=100;e>=0;e--)if(matchMedia(`(monochrome: ${e})`)?.matches){t=e;break}return{...e,monochrome:t}}},ge={name:"applePay",tier:2,async collect(){const e=window.ApplePaySession;if(!e||"function"!=typeof e.supportsVersion)return{supported:!1,maxVersion:0};let t=0;for(let n=15;n>=1;n--)try{if(e.supportsVersion(n)){t=n;break}}catch{continue}return{supported:!0,maxVersion:t}}},ye=["KeyQ","KeyW","KeyA","KeyS","KeyZ","KeyX","KeyY","KeyM","Semicolon","BracketLeft","Quote","Digit1","Digit2","Digit3"],ve={name:"keyboard",tier:2,async collect(){const e=navigator.keyboard;if(!e||"function"!=typeof e.getLayoutMap)return{supported:!1,layoutKeys:null,layoutHint:null};try{const t=await e.getLayoutMap(),n={};for(const e of ye){const o=t.get(e);void 0!==o&&(n[e]=o)}return{supported:!0,layoutKeys:n,layoutHint:we(n)}}catch{return{supported:!1,layoutKeys:null,layoutHint:null}}}};function we(e){const t=e.KeyQ,n=e.KeyZ,o=e.KeyY;return t?"a"===t?"azerty":"q"===t&&"z"===o?"qwertz":"q"===t&&"z"===n?"qwerty":"'"===t?"dvorak":"other":null}const be={name:"canvas",tier:2,async collect(){const e=document.createElement("canvas"),t=e.getContext("2d");if(!t)return null;e.width=240,e.height=120,t.textBaseline="alphabetic",t.fillStyle="#f60",t.fillRect(100,1,62,20),t.fillStyle="#069",t.font='11pt "Times New Roman"',t.fillText("Cwm fjordbank gly"+String.fromCharCode(55357,56835),2,15),t.fillStyle="rgba(102,204,0,0.2)",t.font="18pt Arial",t.fillText("Cwm fjordbank gly"+String.fromCharCode(55357,56835),4,45);const n=e.toDataURL("image/png");t.clearRect(0,0,e.width,e.height),t.globalCompositeOperation="multiply",t.fillStyle="#f2f",t.beginPath(),t.arc(40,40,40,0,2*Math.PI),t.fill(),t.fillStyle="#2ff",t.beginPath(),t.arc(80,40,40,0,2*Math.PI),t.fill(),t.fillStyle="#ff2",t.beginPath(),t.arc(60,80,40,0,2*Math.PI),t.fill(),t.globalCompositeOperation="source-over",t.fillStyle="#f9c",t.beginPath(),t.arc(60,60,60,0,2*Math.PI),t.arc(60,60,20,0,2*Math.PI),t.fill("evenodd");const o=e.toDataURL("image/png");return{textDataUrl:n,geometryDataUrl:o,readbackAllowed:n.length>=1e3&&o.length>=1e3,windingRule:0===t.getImageData(60,60,1,1).data[3]}}},xe={name:"audioOscillator",tier:2,async collect(){const e=window.OfflineAudioContext||window.webkitOfflineAudioContext;if(!e)return null;const t=new e(1,5e3,44100),n=t.createOscillator();n.type="triangle",n.frequency.value=1e4;const o=t.createDynamicsCompressor();o.threshold.value=-50,o.knee.value=40,o.ratio.value=12,o.attack.value=0,o.release.value=.25,n.connect(o),o.connect(t.destination),n.start(0);const r=(await t.startRendering()).getChannelData(0).slice(4500,5e3);let i=0;for(let e=0;e<r.length;e++)i+=Math.abs(r[e]);return{sampleSum:i,sampleCount:r.length}}},Se={name:"webglRender",tier:2,async collect(){const e=document.createElement("canvas");e.width=256,e.height=256;const t=e.getContext("webgl",{preserveDrawingBuffer:!0});if(!t)return null;try{const e="\n attribute vec2 position;\n attribute vec3 color;\n varying vec3 vColor;\n void main() {\n gl_Position = vec4(position, 0.0, 1.0);\n vColor = color;\n }\n ",n="\n precision mediump float;\n varying vec3 vColor;\n void main() {\n gl_FragColor = vec4(vColor, 1.0);\n }\n ",o=t.createShader(t.VERTEX_SHADER);t.shaderSource(o,e),t.compileShader(o);const r=t.createShader(t.FRAGMENT_SHADER);t.shaderSource(r,n),t.compileShader(r);const i=t.createProgram();t.attachShader(i,o),t.attachShader(i,r),t.linkProgram(i),t.useProgram(i);const a=new Float32Array([-.5,-.5,1,0,0,.5,-.5,0,1,0,0,.5,0,0,1]),c=t.createBuffer();t.bindBuffer(t.ARRAY_BUFFER,c),t.bufferData(t.ARRAY_BUFFER,a,t.STATIC_DRAW);const s=t.getAttribLocation(i,"position");t.enableVertexAttribArray(s),t.vertexAttribPointer(s,2,t.FLOAT,!1,20,0);const l=t.getAttribLocation(i,"color");t.enableVertexAttribArray(l),t.vertexAttribPointer(l,3,t.FLOAT,!1,20,8),t.clearColor(0,0,0,1),t.clear(t.COLOR_BUFFER_BIT),t.drawArrays(t.TRIANGLES,0,3),t.enable(t.BLEND),t.blendFunc(t.SRC_ALPHA,t.ONE_MINUS_SRC_ALPHA),t.drawArrays(t.TRIANGLES,0,3);const u=new Uint8Array(262144);t.readPixels(0,0,256,256,t.RGBA,t.UNSIGNED_BYTE,u);const d=function(e){let t=2166136261;for(let n=0;n<e.length;n++)t^=e[n],t=Math.imul(t,16777619);return(t>>>0).toString(16).padStart(8,"0")}(u);let f=!1;for(let e=0;e<u.length;e++)if(0!==u[e]){f=!0;break}return{pixelHash:d,readbackAllowed:f}}finally{t.getExtension("WEBGL_lose_context")?.loseContext()}}},_e=["14px Arial","14px Georgia","14px monospace"],Ce={name:"canvasTextMetrics",tier:2,async collect(){const e=document.createElement("canvas").getContext("2d");if(!e)return null;const t=[];for(const n of _e){e.font=n;const o=e.measureText("Sphinx of black quartz, judge my vow. 0123456789");t.push({font:n,width:o.width,actualBoundingBoxAscent:o.actualBoundingBoxAscent??null,actualBoundingBoxDescent:o.actualBoundingBoxDescent??null,actualBoundingBoxLeft:o.actualBoundingBoxLeft??null,actualBoundingBoxRight:o.actualBoundingBoxRight??null,fontBoundingBoxAscent:o.fontBoundingBoxAscent??null,fontBoundingBoxDescent:o.fontBoundingBoxDescent??null})}return{metrics:t}}},Ae=["chrome","safari","__crWeb","__gCrWeb","yandex","__yb","__ybro","__firefox__","__edgeTrackingPreventionStatistics","webkit","oprt","samsungAr","ucweb","UCShellJava","puffinDevice"],Ee={name:"vendorFlavors",tier:2,async collect(){const e=window,t=[];for(const n of Ae)void 0!==e[n]&&t.push(n);return t.sort(),{flavors:t}}},Pe=[{key:"default",family:""},{key:"apple",family:"-apple-system, BlinkMacSystemFont"},{key:"serif",family:"serif"},{key:"sansSerif",family:"sans-serif"},{key:"monospace",family:"monospace"},{key:"systemUi",family:"system-ui"}],Te={name:"fontPreferences",tier:2,async collect(){if("undefined"==typeof document||!document.body)return null;const e=document.createElement("div");e.style.cssText="position:absolute;visibility:hidden;top:-9999px";const t=Pe.map(({family:t})=>{const n=document.createElement("span");return n.textContent="mmMwWLliI0fiflO&1",n.style.fontSize="72px",t&&(n.style.fontFamily=t),e.appendChild(n),n});document.body.appendChild(e);const n={};for(let e=0;e<Pe.length;e++){const o=t[e].getBoundingClientRect().width;n[Pe[e].key]=Math.round(1e3*o)/1e3}return document.body.removeChild(e),n}},Re={name:"screenFrame",tier:2,async collect(){const e=screen,t=e.availTop??0,n=e.availLeft??0;return{top:t,right:screen.width-(e.availWidth??screen.width)-n,bottom:screen.height-(e.availHeight??screen.height)-t,left:n}}};function Me(e){return/Not[ ;)\/]/i.test(e)}const De={name:"clientHints",tier:2,async collect(){const e=navigator;if(!e.userAgentData)return null;const t=(e.userAgentData.brands??[]).filter(e=>!Me(e.brand)),n=e.userAgentData.mobile??!1,o=e.userAgentData.platform??"",r=await e.userAgentData.getHighEntropyValues(["architecture","bitness","model","platformVersion","fullVersionList"]),i=(r.fullVersionList??[]).filter(e=>!Me(e.brand));return{brands:t,mobile:n,platform:o,architecture:r.architecture??"",bitness:r.bitness??"",model:r.model??"",platformVersion:r.platformVersion??"",fullVersionList:i}}},ke=[{name:"EasyList",selectors:[".ad-banner",".ad_banner","#ad-banner",".adsbygoogle",".ad-container"]},{name:"AdGuard Base",selectors:[".BannerAd",".ad-rotate","#ad-box",".ad-placement",".ad-zone"]},{name:"EasyPrivacy",selectors:["#tracking-pixel",".tracking",".analytics-tag","#beacon",".pixel-tracker"]},{name:"Fanboy Annoyances",selectors:["#newsletter-popup",".cookie-banner",".consent-dialog","#gdpr-notice",".subscribe-modal"]},{name:"AdGuard Tracking",selectors:[".tracker-frame","#analytics-beacon",".telemetry-pixel",".data-tracker","#stats-counter"]}],Ie={name:"domBlockers",tier:2,async collect(){if("undefined"==typeof document||!document.body)return{activeFilters:[]};const e=[],t=[];try{for(const n of ke){const o=[];for(const t of n.selectors){const n=document.createElement("div");t.startsWith("#")?n.id=t.slice(1):n.className=t.slice(1),document.body.appendChild(n),o.push(n),e.push(n)}t.push({name:n.name,elements:o})}await new Promise(e=>setTimeout(e,0));const n=[];for(const{name:e,elements:o}of t){let t=0;for(const e of o)null===e.offsetParent&&t++;t/o.length>.6&&n.push(e)}return{activeFilters:n}}catch{return{activeFilters:[]}}finally{for(const t of e)try{t.parentNode?.removeChild(t)}catch{}}}},Oe={name:"privateClickMeasurement",tier:2,collect:async()=>({supported:"attributionSourceId"in document.createElement("a")})},Be={name:"automationDetection",tier:2,async collect(){const e=!!navigator.webdriver,t=function(){const e=[];try{const t=Object.getOwnPropertyNames(document);for(const n of t)/^\$?cdc_/.test(n)&&e.push(n)}catch{}const t=[["_Selenium_IDE_Recorder",()=>"t"in window],["__webdriver_evaluate",()=>"o"in document],["__driver_evaluate",()=>"i"in document],["__puppeteer_evaluation_script__",()=>"l"in window],["__playwright__binding__",()=>"u"in window],["__pwInitScripts",()=>"m"in window],["callPhantom",()=>"callPhantom"in window],["_phantom",()=>"p"in window],["__nightmare",()=>"h"in window],["domAutomation",()=>"domAutomation"in window],["domAutomationController",()=>"domAutomationController"in window]];for(const[n,o]of t)try{o()&&e.push(n)}catch{}return e}(),n=await async function(){try{if("undefined"==typeof Proxy)return!1;let e=!1;const t={};return Object.setPrototypeOf(t,new Proxy(Object.create(null),{ownKeys:()=>(e=!0,[])})),console.groupEnd(t),await new Promise(e=>setTimeout(e,100)),e}catch{return!1}}(),o=await async function(){const e=[];try{0===navigator.plugins.length&&window.chrome&&e.push("no_plugins_with_chrome")}catch{}0!==window.outerWidth&&0!==window.outerHeight||e.push("zero_outer_dimensions"),0===screen.availHeight&&e.push("zero_avail_height");try{0===navigator.languages.length&&e.push("empty_languages")}catch{}try{window.chrome&&void 0===window.chrome?.runtime&&e.push("chrome_without_runtime")}catch{}try{"undefined"!=typeof Notification&&"denied"===Notification.permission&&"prompt"===(await navigator.permissions.query({name:"notifications"})).state&&e.push("notification_permission_contradiction")}catch{}return e}(),r=function(){let e=null;try{if(e=document.createElement("canvas").getContext("webgl"),!e)return!1;const t=e.getExtension("WEBGL_debug_renderer_info");if(!t)return!1;const n=e.getParameter(t.UNMASKED_RENDERER_WEBGL);if("string"!=typeof n)return!1;const o=["swiftshader","google swiftshader","llvmpipe","mesa","software rasterizer","microsoft basic render driver"],r=n.toLowerCase();return o.some(e=>r.includes(e))}catch{return!1}finally{if(e){const t=e.getExtension("WEBGL_lose_context");t&&t.loseContext()}}}();let i=0;return e&&(i+=30),t.length>0&&(i+=20),n&&(i+=25),o.length>=2&&(i+=15),r&&(i+=20),{webdriver:e,automationMarkers:t,cdpDetected:n,headlessIndicators:o,softwareRenderer:r,botScore:i}}},Le={name:"agentDetection",tier:2,async collect(){const e=function(){const e=[];try{13===navigator.hardwareConcurrency&&e.push("unusual_core_count_13")}catch{}try{4===navigator.deviceMemory&&6===navigator.hardwareConcurrency&&e.push("manus_hardware_signature")}catch{}try{1280===screen.width&&1100===screen.height&&e.push("manus_resolution")}catch{}try{if("UTC"===Intl.DateTimeFormat().resolvedOptions().timeZone){const t=navigator.languages||[],n=["en-GB","pt-PT","is","is-IS"];t.some(e=>n.includes(e))||e.push("utc_timezone_mismatch")}}catch{}return e}(),t=function(){try{const e=navigator.userAgent||"",t=navigator.userAgentData?.platform,n=navigator.platform||"";let o="";if(/Windows/.test(e)?o="Windows":/Macintosh|Mac OS X/.test(e)?o="macOS":/Android/.test(e)?o="Android":/iPhone|iPad|iPod/.test(e)?o="iOS":/Linux/.test(e)&&(o="Linux"),t){const e=t.toLowerCase();if("linux"===e&&("macOS"===o||"Windows"===o))return!1;if("windows"===e&&"macOS"===o)return!1;if("macos"===e&&"Windows"===o)return!1}if(n){const e=n.toLowerCase();if(e.includes("linux")&&("macOS"===o||"Windows"===o))return!1;if(e.includes("win")&&"macOS"===o)return!1;if(e.includes("mac")&&"Windows"===o)return!1}return!0}catch{return!0}}(),n=function(){try{const e=Intl.DateTimeFormat().resolvedOptions().timeZone,t=(new Date).getTimezoneOffset();return"UTC"!==e||0===t}catch{return!0}}(),o=function(e,t){return e.includes("unusual_core_count_13")?"chatgpt":e.includes("manus_hardware_signature")&&e.includes("manus_resolution")?"manus":t?null:"operator"}(e,t);let r=0;return r+=25*e.length,t||(r+=30),o&&(r+=50),{fingerprintAnomalies:e,uaPlatformMatch:t,timezoneConsistent:n,detectedAgent:o,agentScore:r}}},Fe={name:"tamperDetection",tier:2,async collect(){const e=function(){try{const e=navigator.userAgent||"",t=/Chrome\//.test(e)&&!/Edg\//.test(e),n=/Firefox\//.test(e)&&!/Chrome/.test(e),o="undefined"!=typeof CSS&&CSS.supports&&CSS.supports("-moz-appearance","none"),r=void 0!==window.chrome;return!(t&&o||n&&r)}catch{return!0}}(),t=function(){try{const e=Object.getOwnPropertyDescriptor(Navigator.prototype,"userAgent");if(!e)return!1;if(!e.get)return!1;const t=e.get.toString();return!!/\[native code\]/.test(t)}catch{return!0}}(),n=function(){try{const e=eval.toString().length;if(33!==e&&37!==e&&39!==e&&(e<20||e>60))return!1;try{if(1!==new(0,navigator.userAgent.constructor.constructor)("return 1")())return!1}catch{return!1}return!0}catch{return!0}}(),o=function(){const e=[];try{"v"in window&&e.push("multilogin")}catch{}try{void 0!==window.chrome&&0===navigator.plugins.length&&e.push("empty_plugins_chromium")}catch{}try{const t=window;if(t.safari){const n=t.safari.toString?.();n&&!/\[object Safari\]/.test(n)&&e.push("safari_object_spoofed")}}catch{}try{const t=navigator.userAgent||"",n=t.match(/Chrome\/(\d+)/);n&&parseInt(n[1],10)>=88&&/Macintosh/.test(t)&&void 0===window.BarcodeDetector&&e.push("missing_barcode_detector")}catch{}return e}(),r=function(){try{const e=((new Error).stack||"").split("\n").filter(e=>e.trim().length>0);for(const t of e){const e=t.trim();if("Error"!==e){if(/^\s*at\s/.test(e))return"chromium";if(/@/.test(e)&&!e.startsWith("at"))return/^\w+@/.test(e)?"gecko":"webkit"}}return"unknown"}catch{return"unknown"}}(),i=eval.toString().length;let a=0;if(e||(a+=30),t||(a+=25),n||(a+=20),a+=15*o.length,"unknown"!==r){const e=navigator.userAgent||"";("gecko"===r&&!/Firefox/.test(e)||"chromium"===r&&/Firefox/.test(e)&&!/Chrome/.test(e))&&(a+=10)}return{uaEngineConsistent:e,navigatorPropsNative:t,prototypeChainIntact:n,antiDetectMarkers:o,stackTraceFormat:r,evalLength:i,tamperScore:a}}},Ne={name:"vmDetection",tier:2,async collect(){const e=function(){const e=[];try{navigator.hardwareConcurrency<=2&&e.push("low_core_count")}catch{}try{const t=navigator.deviceMemory;"number"==typeof t&&t<=2&&e.push("low_memory")}catch{}try{screen.colorDepth<24&&e.push("low_color_depth")}catch{}try{screen.colorDepth!==screen.pixelDepth&&e.push("depth_mismatch")}catch{}return e}();let t="",n=null;try{if(n=document.createElement("canvas").getContext("webgl"),n){const e=n.getExtension("WEBGL_debug_renderer_info");e&&(t=n.getParameter(e.UNMASKED_RENDERER_WEBGL)||"")}}catch{}finally{if(n)try{const e=n.getExtension("WEBGL_lose_context");e&&e.loseContext()}catch{}}const o=function(e){if(!e)return[];const t=e.toLowerCase();return We.filter(e=>t.includes(e))}(t),r=function(e){if(!e)return!1;const t=e.toLowerCase();return Ue.some(e=>t.includes(e))}(t);let i=0;return o.length>0?i=.9:r?i=.5:e.length>=3&&(i=.3),{isVM:o.length>0,vmRendererMatches:o,softwareRenderer:r,confidence:i,indicators:e}}},We=["virtualbox","vmware","svga3d","qemu","parallels","hyper-v","qxl","red hat","virtio","citrix"],Ue=["swiftshader","google swiftshader","llvmpipe","mesa","software rasterizer","microsoft basic render driver","softpipe"],Ve=[{label:"h264",contentType:'video/mp4; codecs="avc1.42E01E"',width:1920,height:1080,bitrate:5e6,framerate:30},{label:"vp8",contentType:'video/webm; codecs="vp8"',width:1920,height:1080,bitrate:5e6,framerate:30},{label:"vp9",contentType:'video/webm; codecs="vp09.00.10.08"',width:1920,height:1080,bitrate:5e6,framerate:30},{label:"av1",contentType:'video/mp4; codecs="av01.0.05M.08"',width:1920,height:1080,bitrate:5e6,framerate:30}],Ge=[{label:"aac",contentType:'audio/mp4; codecs="mp4a.40.2"',channels:"2",bitrate:128e3,samplerate:44100},{label:"opus",contentType:'audio/webm; codecs="opus"',channels:"2",bitrate:128e3,samplerate:48e3}],ze=[C,P,T,D,I,U,V,G,z,H,X,q,Z,J,ee,Q,ne,oe,se,ce,de,fe,he,ge,ve,be,xe,Se,Ce,Ee,Te,Re,De,Ie,Oe,Be,Le,Fe,Ne,{name:"devtoolsDetection",tier:2,collect:async()=>({dimensionDelta:function(){const e=window.outerHeight-window.innerHeight,t=window.outerWidth-window.innerWidth;return{heightDelta:e,widthDelta:t,likelyOpen:e>200||t>200}}(),consoleTimingAnomaly:function(){try{const e={};for(let t=0;t<1e3;t++)e[`key${t}`]=t;const t=performance.now();return console.log(e),performance.now()-t>1}catch{return!1}}(),consoleNative:function(){try{return/\[native code\]/.test(Function.prototype.toString.call(console.log))}catch{return!0}}()})},{name:"webApis",tier:2,async collect(){const e=navigator,t=window;return{credentials:void 0!==e.credentials,usb:void 0!==e.usb,bluetooth:void 0!==e.bluetooth,clipboard:void 0!==e.clipboard,serial:void 0!==e.serial,hid:void 0!==e.hid,xr:void 0!==e.xr,share:"function"==typeof e.share,wakeLock:void 0!==e.wakeLock,presentation:void 0!==e.presentation,mediaSession:void 0!==e.mediaSession,ink:void 0!==e.ink,virtualKeyboard:void 0!==e.virtualKeyboard,eyeDropper:void 0!==t.EyeDropper,getScreenDetails:"function"==typeof t.getScreenDetails,paymentRequest:void 0!==t.PaymentRequest,adoptedStyleSheets:void 0!==document.adoptedStyleSheets,cssHighlights:void 0!==t.CSS?.highlights}}},{name:"notificationState",tier:2,async collect(){const e="undefined"!=typeof Notification;return{supported:e,permission:e?Notification.permission:null}}},{name:"extendedLocale",tier:2,collect:async()=>({languages:Array.from(navigator.languages??[])})},{name:"privacyPrefs",tier:2,async collect(){const e=navigator;return{doNotTrack:navigator.doNotTrack??null,globalPrivacyControl:e.globalPrivacyControl??null}}},{name:"performanceContext",tier:2,async collect(){let e=null;try{const t=performance.getEntriesByType("navigation");t.length>0&&(e=t[0].nextHopProtocol||null)}catch{}let t=[];try{t=Array.from(PerformanceObserver.supportedEntryTypes??[])}catch{}return{nextHopProtocol:e,supportedEntryTypes:t}}},{name:"sensors",tier:2,async collect(){const e=window;return{deviceOrientation:void 0!==e.DeviceOrientationEvent,deviceMotion:void 0!==e.DeviceMotionEvent,gyroscope:void 0!==e.Gyroscope,accelerometer:void 0!==e.Accelerometer,ambientLightSensor:void 0!==e.AmbientLightSensor,absoluteOrientationSensor:void 0!==e.AbsoluteOrientationSensor,relativeOrientationSensor:void 0!==e.RelativeOrientationSensor}}},{name:"battery",tier:2,collect:async()=>({supported:"function"==typeof navigator.getBattery})},{name:"gamepads",tier:2,collect:async()=>({supported:"function"==typeof navigator.getGamepads})},{name:"storage",tier:2,async collect(){let e=null;try{navigator.storage?.estimate&&(e=(await navigator.storage.estimate()).quota??null)}catch{}let t=!1;try{t=void 0!==window.indexedDB}catch{}let n=!1;try{n=void 0!==window.localStorage}catch{}return{quota:e,indexedDB:t,localStorage:n,cacheApi:void 0!==window.caches}}},{name:"features",tier:2,async collect(){const e=window;return{isSecureContext:!!e.isSecureContext,webdriver:!!navigator.webdriver,crossOriginIsolated:!!e.crossOriginIsolated,sharedArrayBuffer:void 0!==e.SharedArrayBuffer,webAssembly:void 0!==e.WebAssembly,bigInt:void 0!==e.BigInt,offscreenCanvas:void 0!==e.OffscreenCanvas}}},{name:"screen",tier:2,async collect(){const e=window.visualViewport;return{availWidth:screen.availWidth??0,availHeight:screen.availHeight??0,devicePixelRatio:window.devicePixelRatio??1,orientationType:screen.orientation?.type??null,orientationAngle:screen.orientation?.angle??null,visualViewport:e?{width:e.width,height:e.height,offsetLeft:e.offsetLeft,offsetTop:e.offsetTop,scale:e.scale}:null}}},{name:"mediaCapabilities",tier:2,async collect(){if(!navigator.mediaCapabilities?.decodingInfo)return null;const e={},t=[...Ve.map(e=>({label:e.label,config:{type:"file",video:{contentType:e.contentType,width:e.width,height:e.height,bitrate:e.bitrate,framerate:e.framerate}}})),...Ge.map(e=>({label:e.label,config:{type:"file",audio:{contentType:e.contentType,channels:e.channels,bitrate:e.bitrate,samplerate:e.samplerate}}}))];return await Promise.allSettled(t.map(async({label:t,config:n})=>{try{const o=await navigator.mediaCapabilities.decodingInfo(n);e[t]={supported:o.supported,smooth:o.smooth,powerEfficient:o.powerEfficient}}catch{e[t]=null}})),e}}];async function He(e,t,n){const o={},r=[],i=ze.filter(t=>!e.has(t.name)&&(n||3!==t.tier)),a=await Promise.allSettled(i.map(async e=>{const n=await(o=e.collect(),r=t,new Promise((e,t)=>{const n=setTimeout(()=>e(null),r);o.then(t=>{clearTimeout(n),e(t)},e=>{clearTimeout(n),t(e)})}));var o,r;return{name:e.name,value:n}}));for(let e=0;e<a.length;e++){const t=a[e],n=i[e].name;"fulfilled"===t.status&&null!==t.value.value?o[n]=t.value.value:"rejected"===t.status&&r.push({signal:n,error:String(t.reason?.message??t.reason)})}return{components:o,errors:r}}async function Xe(t){const s=function(e){return e?{exclude:e.exclude??n.exclude,include:e.include??n.include,timeout:e.timeout??n.timeout,stabilize:e.stabilize??n.stabilize,experimental:e.experimental??n.experimental,debug:e.debug??n.debug,salt:e.salt??n.salt}:{...n}}(t),l=c(),d=function(){try{return window.self!==window.top}catch{return!0}}();let f=!1;try{f=await u(l.name)}catch{}const m=function(e,t,n,o){const r=new Set;for(const a of e){if("private"===a&&!n)continue;if("iframe"===a&&!o)continue;const e=i[a];if(e)for(const n of e)if(!n.browsers||n.browsers.includes(t))for(const e of n.exclude)r.add(e)}return r}(s.stabilize,l.name,f,d),p=new Set(m);for(const e of s.exclude)p.add(e);for(const e of s.include)p.delete(e);const{components:h,errors:g}=await He(p,s.timeout,s.experimental),y={S:e};for(const[e,t]of Object.entries(h))r.has(e)||a.has(e)||(y[e]=t);const v=_(y,s.salt),w={S:e};for(const[e,t]of Object.entries(h))o.has(e)||a.has(e)||(w[e]=t);const S=_(w,s.salt),b={hash:v,stableHash:S,components:{...h,S:e},timestamp:(new Date).toISOString(),version:e,isIncognito:f,errors:g};return s.debug&&(console.log("[fingerprint] components:",h),console.log("[fingerprint] hash:",v,"stableHash:",S),g.length>0&&console.warn("[fingerprint] errors:",g)),b}const Ke=new RegExp(["googlebot","bingbot","slurp","baiduspider","duckduckbot","yandex","sogou","exabot","ia_archiver","curl","wget","python-requests","python-urllib","axios","node-fetch","go-http-client","java/","libwww-perl","okhttp","apache-httpclient","http_request","httpie","headlesschrome","phantomjs","puppeteer","playwright","cypress","selenium","webdriver","electron","jsdom","vercel-screenshot","screenshot","prerender","lighthouse","chrome-lighthouse","pagespeed","gtmetrix","pingdom","nessus","nikto","sqlmap","burp","zap","qualys","openvas","nmap","masscan","facebookexternalhit","twitterbot","linkedinbot","whatsapp","telegrambot","slackbot","discordbot","bot","crawl","spider","scrape","fetch","scan"].join("|"),"i");function $e(e){return!!e&&Ke.test(e)}const SENTINEL_USER_IDS=new Set(["__pre_auth__","anonymous","guest","undefined","null"]);function isSentinelUserId(e){return"string"==typeof e&&SENTINEL_USER_IDS.has(e)}const DEFAULT_MAX_RETRIES=3,DEFAULT_TIMEOUT_MS=3e4,MAX_DELAY_MS=3e4,BASE_DELAY_MS=1e3,SUBMIT_FP_PATH="/__unshared/submit-fp",SS_EMAIL_KEY="__unshared_email",SS_FP_KEY="__unshared_fp",SS_LAST_SUBMIT_KEY="__unshared_last_submit",LS_DEVICE_ID="__unshared_device_id",COOKIE_UID="__unshared_uid",COOKIE_SID="__unshared_sid";function generateUUID(){if("undefined"!=typeof crypto&&crypto.randomUUID)return crypto.randomUUID();const e=new Uint8Array(16);crypto.getRandomValues(e),e[6]=15&e[6]|64,e[8]=63&e[8]|128;const t=Array.from(e).map(e=>e.toString(16).padStart(2,"0")).join("");return`${t.slice(0,8)}-${t.slice(8,12)}-${t.slice(12,16)}-${t.slice(16,20)}-${t.slice(20)}`}function sleep(e){return new Promise(t=>setTimeout(t,e))}function retryDelay(e){const t=Math.min(1e3*Math.pow(2,e-1),3e4),n=500*Math.random()-250;return Math.max(0,t+n)}function getCookie(e){if("undefined"==typeof document)return;const t=document.cookie.match(new RegExp(`(?:^|; )${e}=([^;]*)`));return t?decodeURIComponent(t[1]):void 0}function setCookie(e,t){"undefined"!=typeof document&&(document.cookie=`${e}=${encodeURIComponent(t)}; Path=/; SameSite=Lax`)}function deleteCookie(e){"undefined"!=typeof document&&(document.cookie=`${e}=; Path=/; SameSite=Lax; Expires=Thu, 01 Jan 1970 00:00:00 GMT`)}function getLocalStorageItem(e){if("undefined"!=typeof localStorage)try{return localStorage.getItem(e)??void 0}catch{return}}function setLocalStorageItem(e,t){if("undefined"!=typeof localStorage)try{localStorage.setItem(e,t)}catch{}}function getSessionStorageItem(e){if("undefined"!=typeof sessionStorage)try{return sessionStorage.getItem(e)??void 0}catch{return}}function setSessionStorageItem(e,t){if("undefined"!=typeof sessionStorage)try{sessionStorage.setItem(e,t)}catch{}}function isValidUrl(e){try{return new URL(e),!0}catch{return!1}}class UnsharedBrowser{constructor(e={}){if(this._="",e.baseUrl&&!isValidUrl(e.baseUrl))throw new Error('baseUrl must be a valid URL (e.g. "https://app.example.com")');let t,n;this.C=e.baseUrl?e.baseUrl.replace(/\/$/,""):"",this.I=e.maxRetries??3,this.k=e.timeout??3e4,this.M=e.includePathPrefix,this.D=e.skipPaths,this.P=e.sessionId,this.A=e.deviceId,this._=getSessionStorageItem(SS_LAST_SUBMIT_KEY)??"";try{t=this.P?.()}catch{}this.L=t??getCookie(COOKIE_SID)??generateUUID(),setCookie(COOKIE_SID,this.L);try{n=this.A?.()}catch{}n?(this.T=n,setLocalStorageItem(LS_DEVICE_ID,n)):this.T=getLocalStorageItem(LS_DEVICE_ID)??"",this.O()}async init(e){try{if("undefined"!=typeof navigator&&$e(navigator.userAgent))return;if(isSentinelUserId(e.userId))return void this.B;this.B=e.userId,this.U=e.emailAddress,"undefined"!=typeof sessionStorage&&sessionStorage.setItem(SS_EMAIL_KEY,e.emailAddress),setCookie(COOKIE_UID,e.userId);let t,n=this.F();n||(n=await this.collect(),this.R(n));try{t=this.A?.()}catch{}t?(this.T=t,setLocalStorageItem(LS_DEVICE_ID,t)):n.fingerprint_id&&(this.T=n.fingerprint_id,setLocalStorageItem(LS_DEVICE_ID,n.fingerprint_id)),this.W(n).catch(()=>{})}catch{}}onRouteChange(){try{if(!this.$())return;const e=this.F();if(!e)return;this.W(e).catch(()=>{})}catch{}}destroy(){try{"undefined"!=typeof sessionStorage&&(sessionStorage.removeItem(SS_EMAIL_KEY),sessionStorage.removeItem(SS_FP_KEY),sessionStorage.removeItem(SS_LAST_SUBMIT_KEY)),this._="",deleteCookie(COOKIE_UID),this.V&&"undefined"!=typeof document&&(document.removeEventListener("DOMContentLoaded",this.V),this.V=void 0),this.B=void 0,this.U=void 0}catch{}}async collect(e){const t=[...new Set(["timing","speech",...e?.exclude??[]])],n=await Xe({...e,exclude:t});return{fingerprint_id:n.stableHash,full_hash:n.hash,components:n.components,timestamp:n.timestamp,isIncognito:n.isIncognito,version:n.version}}async submitFingerprintEvent(e,t){try{const n=this.K(e,t),o=generateUUID(),r=`${this.C}${SUBMIT_FP_PATH}`;return await this.G(r,JSON.stringify(n),o)}catch(e){return{success:!1,error:{code:"DELIVERY_FAILED",message:e instanceof Error?e.message:String(e)}}}}$(){if("undefined"!=typeof sessionStorage)return sessionStorage.getItem(SS_EMAIL_KEY)??void 0}F(){if("undefined"==typeof sessionStorage)return;const e=sessionStorage.getItem(SS_FP_KEY);if(e)try{return JSON.parse(e)}catch{return}}R(e){"undefined"!=typeof sessionStorage&&sessionStorage.setItem(SS_FP_KEY,JSON.stringify(e))}N(){if("undefined"==typeof location)return!0;const e=location.pathname||"/";if(this.D)for(const t of this.D)if(e.startsWith(t))return!1;return!this.M||this.M.some(t=>e.startsWith(t))}async W(e){if("undefined"!=typeof navigator&&$e(navigator.userAgent))return{success:!0};if(!this.N())return{success:!0};const t=this.U??this.$(),n=this.B??getCookie(COOKIE_UID),o="undefined"!=typeof location?(location.pathname||"/")+(location.search||""):"/";if(n){const e=`${n}|${o}`;if(e===this._)return{success:!0};this._=e,setSessionStorageItem(SS_LAST_SUBMIT_KEY,e)}const r={hash:e.full_hash,stable_hash:e.fingerprint_id,collected_at:(new Date).toISOString(),is_incognito:e.isIncognito,components:e.components,version:e.version,session_id:this.L,event_type:o};n&&(r.user_id=n),t&&(r.email=t);const i=`${e.fingerprint_id}|${n??""}|${o}`,a=`${this.C}${SUBMIT_FP_PATH}`;return this.G(a,JSON.stringify(r),i)}O(){"undefined"!=typeof document&&(this.V&&document.removeEventListener("DOMContentLoaded",this.V),this.V=()=>{if(!this.$())return;const e=this.F();e&&this.W(e).catch(()=>{})},document.addEventListener("DOMContentLoaded",this.V))}async G(e,t,n){const o=this.I+1;let r={success:!1,error:{code:"DELIVERY_FAILED",message:"Request failed"}};for(let i=1;i<=o;i++){i>1&&await sleep(retryDelay(i-1));const o=new AbortController,a=setTimeout(()=>o.abort(),this.k);try{const i=await fetch(e,{method:"POST",headers:{"Content-Type":"application/json","X-Idempotency-Key":n,"X-Session-Id":this.L,"X-Device-Id":this.T},body:t,signal:o.signal});if(clearTimeout(a),i.status>=500){r={success:!1,error:{code:"DELIVERY_FAILED",message:`Backend returned ${i.status}`}};continue}if(i.status>=400)return{success:!1,error:{code:"DELIVERY_FAILED",message:`Backend returned ${i.status}`}};const c=await i.text().catch(()=>"{}");let s;try{s=JSON.parse(c)}catch{s={}}return!1===s?.success?{success:!1,error:s.error??{code:"UPSTREAM_ERROR",message:"Upstream failed"}}:{success:!0,data:s?.data}}catch(e){clearTimeout(a),r={success:!1,error:{code:"DELIVERY_FAILED",message:e instanceof Error?e.message:String(e)}}}}return r}K(e,t){const n={hash:e.full_hash,stable_hash:e.fingerprint_id,collected_at:e.timestamp,is_incognito:e.isIncognito,components:e.components,version:e.version,session_id:this.L};n.user_id=t.userId,null!=t?.eventType&&(n.event_type=t.eventType);const o=this.U??this.$();return o&&(n.email=o),n}}function createAxiosInterceptor(e){return t=>{if(403===t?.response?.status&&"account_flagged"===t?.response?.data?.error)try{e.onFlagged()}catch{}return Promise.reject(t)}}function createFetchInterceptor(e,t){return async(...n)=>{const o=await e(...n);if(403===o.status){const e=o.clone();try{const n=await e.json();if("account_flagged"===n?.error)try{t.onFlagged()}catch{}}catch{}}return o}}export{UnsharedBrowser,createAxiosInterceptor,createFetchInterceptor};
package/dist/index.umd.js CHANGED
@@ -1 +1 @@
1
- !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).UnsharedBrowser={})}(this,function(e){"use strict";const t="1.3.1",n=1282368115,o={exclude:[],include:[],timeout:3e3,stabilize:["private","iframe","always"],experimental:!1,debug:!1,salt:""},r=new Set(["audio","timing","navigatorConnection","domrect","permissions","fonts","speech"]),i=new Set(["domrect"]),a={always:[{exclude:["speech"],browsers:["brave","firefox"]},{exclude:["keyboard"],browsers:["firefox","safari"]},{exclude:["workers"],browsers:["firefox"]},{exclude:["hardwareSensitive","navigatorProps"],browsers:["brave"]}],private:[{exclude:["fonts"],browsers:["firefox"]},{exclude:["audio"],browsers:["safari","brave"]}],iframe:[{exclude:["applePay"],browsers:["safari"]},{exclude:["permissions"]},{exclude:["keyboard"]}]};let s=null;function c(){if(s)return s;const e=navigator.userAgent;return s=function(){const e=navigator.brave;return!!e&&"function"==typeof e.isBrave}()?{name:"brave",version:u(e,/Chrome\/([\d.]+)/)}:/Edg\//i.test(e)?{name:"edge",version:u(e,/Edg\/([\d.]+)/)}:/OPR\//i.test(e)||/Opera/i.test(e)?{name:"opera",version:u(e,/OPR\/([\d.]+)/)||u(e,/Opera\/([\d.]+)/)}:/SamsungBrowser/i.test(e)?{name:"samsung",version:u(e,/SamsungBrowser\/([\d.]+)/)}:/Firefox\//i.test(e)?{name:"firefox",version:u(e,/Firefox\/([\d.]+)/)}:/Safari\//i.test(e)&&!/Chrome/i.test(e)?{name:"safari",version:u(e,/Version\/([\d.]+)/)}:/Chrome\//i.test(e)?{name:"chrome",version:u(e,/Chrome\/([\d.]+)/)}:{name:"unknown",version:""},s}function u(e,t){const n=e.match(t);return n?.[1]??""}function l(e,t){const n=e[0]>>>16,o=65535&e[0],r=e[1]>>>16,i=65535&e[1],a=t[0]>>>16,s=65535&t[0],c=t[1]>>>16;let u=0,l=0,f=0,d=0,m=0;return l=i+(65535&t[1]),u=l>>>16,l&=65535,f=r+c+u,u=f>>>16,f&=65535,d=o+s+u,u=d>>>16,d&=65535,m=n+a+u,m&=65535,[m<<16|d,f<<16|l]}function f(e,t){const n=e[0]>>>16,o=65535&e[0],r=e[1]>>>16,i=65535&e[1],a=t[0]>>>16,s=65535&t[0],c=t[1]>>>16,u=65535&t[1];let l=0,f=0,d=0,m=0,p=0;return f=i*u,l=f>>>16,f&=65535,d=r*u+l,l=d>>>16,d&=65535,d+=i*c,l+=d>>>16,d&=65535,m=o*u+l,l=m>>>16,m&=65535,m+=r*c,l+=m>>>16,m&=65535,m+=i*s,l+=m>>>16,m&=65535,p=n*u+o*c+r*s+i*a+l,p&=65535,[p<<16|m,d<<16|f]}function d(e,t){return 32==(t%=64)?[e[1],e[0]]:t<32?[e[0]<<t|e[1]>>>32-t,e[1]<<t|e[0]>>>32-t]:(t-=32,[e[1]<<t|e[0]>>>32-t,e[0]<<t|e[1]>>>32-t])}function m(e,t){return 0==(t%=64)?[e[0],e[1]]:t<32?[e[0]<<t|e[1]>>>32-t,e[1]<<t]:[e[1]<<t-32,0]}function p(e,t){return[e[0]^t[0],e[1]^t[1]]}function h(e){let t=[e[0],e[1]];return t=p(t,[0,t[0]>>>1]),t=f(t,[4283543511,3981806797]),t=p(t,[0,t[0]>>>1]),t=f(t,[3301882366,444984403]),t=p(t,[0,t[0]>>>1]),t}function g(e){return("00000000"+(e>>>0).toString(16)).slice(-8)}function y(e,t=0){const n=e.length%16,o=e.length-n;let r=[0,t],i=[0,t];const a=[2277735313,289559509],s=[1291169091,658871167];for(let t=0;t<o;t+=16){let n=[255&e.charCodeAt(t+4)|(255&e.charCodeAt(t+5))<<8|(255&e.charCodeAt(t+6))<<16|(255&e.charCodeAt(t+7))<<24,255&e.charCodeAt(t)|(255&e.charCodeAt(t+1))<<8|(255&e.charCodeAt(t+2))<<16|(255&e.charCodeAt(t+3))<<24],o=[255&e.charCodeAt(t+12)|(255&e.charCodeAt(t+13))<<8|(255&e.charCodeAt(t+14))<<16|(255&e.charCodeAt(t+15))<<24,255&e.charCodeAt(t+8)|(255&e.charCodeAt(t+9))<<8|(255&e.charCodeAt(t+10))<<16|(255&e.charCodeAt(t+11))<<24];n=f(n,a),n=d(n,31),n=f(n,s),r=p(r,n),r=d(r,27),r=l(r,i),r=l(f(r,[0,5]),[0,1390208809]),o=f(o,s),o=d(o,33),o=f(o,a),i=p(i,o),i=d(i,31),i=l(i,r),i=l(f(i,[0,5]),[0,944331445])}let c=[0,0],u=[0,0];switch(n){case 15:u=p(u,m([0,e.charCodeAt(o+14)],48));case 14:u=p(u,m([0,e.charCodeAt(o+13)],40));case 13:u=p(u,m([0,e.charCodeAt(o+12)],32));case 12:u=p(u,m([0,e.charCodeAt(o+11)],24));case 11:u=p(u,m([0,e.charCodeAt(o+10)],16));case 10:u=p(u,m([0,e.charCodeAt(o+9)],8));case 9:u=p(u,[0,e.charCodeAt(o+8)]),u=f(u,s),u=d(u,33),u=f(u,a),i=p(i,u);case 8:c=p(c,m([0,e.charCodeAt(o+7)],56));case 7:c=p(c,m([0,e.charCodeAt(o+6)],48));case 6:c=p(c,m([0,e.charCodeAt(o+5)],40));case 5:c=p(c,m([0,e.charCodeAt(o+4)],32));case 4:c=p(c,m([0,e.charCodeAt(o+3)],24));case 3:c=p(c,m([0,e.charCodeAt(o+2)],16));case 2:c=p(c,m([0,e.charCodeAt(o+1)],8));case 1:c=p(c,[0,e.charCodeAt(o)]),c=f(c,a),c=d(c,31),c=f(c,s),r=p(r,c)}return r=p(r,[0,e.length]),i=p(i,[0,e.length]),r=l(r,i),i=l(i,r),r=h(r),i=h(i),r=l(r,i),i=l(i,r),g(r[0])+g(r[1])+g(i[0])+g(i[1])}function v(e){return w(e,new Set)}function w(e,t){if(null===e)return"null";if(void 0===e)return"undefined";const n=typeof e;if("boolean"===n||"number"===n)return String(e);if("string"===n)return JSON.stringify(e);if(Array.isArray(e)){if(t.has(e))return'"[Circular]"';t.add(e);const n=e.map(e=>w(e,t));return t.delete(e),"["+n.join(",")+"]"}if("object"===n){const n=e;if(t.has(n))return'"[Circular]"';t.add(n);const o=Object.keys(n).sort().filter(e=>void 0!==n[e]).map(e=>JSON.stringify(e)+":"+w(n[e],t));return t.delete(n),"{"+o.join(",")+"}"}return String(e)}const x=y("",n);function S(e,t){const o=function(e){if(0===e.length)return y("",n);if(1===e.length)return y(e[0],n);let t=[...e];for(;t.length>1;){const e=[];for(let o=0;o<t.length;o+=2){const r=o+1<t.length?t[o+1]:x;e.push(y(t[o]+r,n))}t=e}return t[0]}(Object.keys(e).sort().map(t=>{const o=function(e){let t=n;for(let n=0;n<e.length;n++)t=Math.imul(t^e.charCodeAt(n),1540483477),t^=t>>>13;return t>>>0}(t);return y(v(e[t]),o)})),r=String.fromCharCode(76,111,98,115),i=t?y(t,n):"";return y(o+r+i,n)}function b(e){try{const t=e.getExtension("EXT_texture_filter_anisotropic")??e.getExtension("WEBKIT_EXT_texture_filter_anisotropic")??e.getExtension("MOZ_EXT_texture_filter_anisotropic");return t?e.getParameter(t.MAX_TEXTURE_MAX_ANISOTROPY_EXT):null}catch{return null}}function C(e){try{const t=e.getContext("webgl2");if(!t)return null;const n={version:t.getParameter(t.VERSION),maxSamples:t.getParameter(t.MAX_SAMPLES),max3DTextureSize:t.getParameter(t.MAX_3D_TEXTURE_SIZE),maxArrayTextureLayers:t.getParameter(t.MAX_ARRAY_TEXTURE_LAYERS),maxUniformBlockSize:t.getParameter(t.MAX_UNIFORM_BLOCK_SIZE),maxVertexUniformComponents:t.getParameter(t.MAX_VERTEX_UNIFORM_COMPONENTS),maxFragmentUniformComponents:t.getParameter(t.MAX_FRAGMENT_UNIFORM_COMPONENTS),maxColorAttachments:t.getParameter(t.MAX_COLOR_ATTACHMENTS),maxDrawBuffers:t.getParameter(t.MAX_DRAW_BUFFERS)};return t.getExtension("WEBGL_lose_context")?.loseContext(),n}catch{return null}}function _(){const e=navigator.userAgentData;if(e?.platform)return e.platform;const t=navigator.userAgent??"";return/Windows/.test(t)?"Windows":/Macintosh|Mac OS X/.test(t)?"macOS":/CrOS/.test(t)?"Chrome OS":/Android/.test(t)?"Android":/Linux/.test(t)?"Linux":/iPhone|iPad|iPod/.test(t)?"iOS":""}function k(){try{const e=new ArrayBuffer(4),t=new Float32Array(e),n=new Uint8Array(e);return t[0]=1/0,n[3]}catch{return 0}}function M(e,t,n,o){const r=(n-t)/o;let i=e(t)+e(n);for(let n=1;n<o;n++)i+=e(t+n*r)*(n%2==0?2:4);return i*r/3}function P(){try{const e=(new Intl.DateTimeFormat).resolvedOptions();return{locale:e.locale,calendar:e.calendar,numberingSystem:e.numberingSystem,timeZone:e.timeZone}}catch{return{}}}function I(){try{const e=(new Intl.NumberFormat).resolvedOptions();return{locale:e.locale,numberingSystem:e.numberingSystem,style:e.style,minimumIntegerDigits:e.minimumIntegerDigits,minimumFractionDigits:e.minimumFractionDigits,maximumFractionDigits:e.maximumFractionDigits,useGrouping:e.useGrouping}}catch{return{}}}function T(){try{const e=(new Intl.Collator).resolvedOptions();return{locale:e.locale,usage:e.usage,sensitivity:e.sensitivity,collation:e.collation,numeric:e.numeric,caseFirst:e.caseFirst}}catch{return{}}}function L(){try{const e=(new Intl.PluralRules).resolvedOptions(),t=new Intl.PluralRules(void 0,{type:"ordinal"}).resolvedOptions();return{locale:e.locale,type:e.type,cardinalCategories:(new Intl.PluralRules).select(0)+","+(new Intl.PluralRules).select(1)+","+(new Intl.PluralRules).select(2)+","+(new Intl.PluralRules).select(5)+","+(new Intl.PluralRules).select(11)+","+(new Intl.PluralRules).select(100),ordinalCategory1:t.type,minimumIntegerDigits:e.minimumIntegerDigits}}catch{return{}}}function D(){try{const e=new Intl.RelativeTimeFormat;if(!e)return{};const t=e.resolvedOptions();return{locale:t.locale,style:t.style,numeric:t.numeric,numberingSystem:t.numberingSystem}}catch{return{}}}function E(){try{const e=new Intl.ListFormat;if(!e)return{};const t=e.resolvedOptions(),n=["X","Y","Z"],o=new Intl.ListFormat(void 0,{type:"conjunction",style:"long"}),r=new Intl.ListFormat(void 0,{type:"disjunction",style:"long"});return{locale:t.locale,type:t.type,style:t.style,conjunctionSample:o.format(n),disjunctionSample:r.format(n)}}catch{return{}}}const A=[["backdrop-filter","blur(1px)"],["container-type","inline-size"],["text-wrap","balance"],["overscroll-behavior","contain"],["hanging-punctuation","first"],["-webkit-line-clamp","1"],["appearance","none"],["font-size-adjust","ex-height 0.5"],["font-palette","normal"],["field-sizing","content"],["-webkit-text-stroke","1px black"],["zoom","1"],["scrollbar-width","thin"],["scrollbar-color","red blue"],["animation-timeline","auto"],["mask-composite","add"],["offset-path","none"],["text-decoration-thickness","1px"],["content-visibility","auto"],["contain-intrinsic-size","auto 100px"],["aspect-ratio","16/9"],["gap","10px"],["color-mix","in srgb, red 50%, blue"],["linear-gradient(in oklch, red, blue)",""]];function $(){try{const e=document.createElement("div");e.style.cssText="visibility:hidden;overflow:scroll;position:absolute;top:-9999px;width:100px;height:100px",document.body.appendChild(e);const t=document.createElement("div");e.appendChild(t);const n=e.offsetWidth-t.offsetWidth;return document.body.removeChild(e),n}catch{return-1}}function R(){const e={};if("undefined"==typeof CSS||"function"!=typeof CSS.supports)return e;for(const[t,n]of A)e[t]=n?CSS.supports(t,n):CSS.supports(t);return e}function B(){try{const e=document.createElement("div");e.style.cssText=["position:fixed","top:0","left:0","width:0","height:0","visibility:hidden","padding-top:env(safe-area-inset-top,0px)","padding-bottom:env(safe-area-inset-bottom,0px)","padding-left:env(safe-area-inset-left,0px)","padding-right:env(safe-area-inset-right,0px)"].join(";"),document.body.appendChild(e);const t=getComputedStyle(e),n={top:t.paddingTop,bottom:t.paddingBottom,left:t.paddingLeft,right:t.paddingRight};return document.body.removeChild(e),n}catch{return null}}function O(){try{const e=performance.now();let t=1/0,n=e;for(let o=0;o<50;o++){const o=performance.now(),r=o-n;if(r>0&&r<t&&(t=r),n=o,o-e>=1)break}if(t===1/0)return-1;const o=1e3*t;if(o<=0)return-1;const r=Math.max(0,Math.round(Math.log10(o)));return Math.pow(10,r)}catch{return-1}}const F=["Arial","Arial Black","Arial Narrow","Arial Rounded MT Bold","Bookman Old Style","Bradley Hand","Calibri","Cambria","Cambria Math","Century","Century Gothic","Comic Sans MS","Consolas","Courier","Courier New","Garamond","Geneva","Georgia","Gill Sans","Helvetica","Helvetica Neue","Impact","Lucida Console","Lucida Grande","Lucida Sans Unicode","Microsoft Sans Serif","Monaco","Palatino","Palatino Linotype","Segoe Print","Segoe Script","Segoe UI","Tahoma","Times","Times New Roman","Trebuchet MS","Verdana","Wingdings","Wingdings 2","Wingdings 3","Inter","Roboto","Open Sans","Lato","Montserrat","Poppins","Nunito","Raleway","Ubuntu","Merriweather","Playfair Display","Source Sans Pro","Source Code Pro","Fira Code","JetBrains Mono","Cascadia Code","Apple Color Emoji","Segoe UI Emoji","Noto Color Emoji","SF Pro","SF Pro Display","SF Mono","San Francisco","Menlo","Andale Mono","Futura","MS Gothic","MS Mincho","MS PGothic","MS PMincho","Yu Gothic","Meiryo","Hiragino Sans","Hiragino Kaku Gothic Pro","SimSun","SimHei","Microsoft YaHei","PingFang SC","Noto Sans CJK","Malgun Gothic","Arial Hebrew"],z=["monospace","sans-serif","serif"],W="mmMwWLliI0O&1";function U(e,t){const n=[],o=e.split("\r\n");let r=!1;for(const e of o)if(e.startsWith(`m=${t}`))r=!0;else{if(e.startsWith("m=")&&r)break;if(r&&e.startsWith("a=rtpmap:")){const t=e.match(/^a=rtpmap:\d+\s+(.+)$/);t&&n.push(t[1])}}return n}const V=["accelerometer","accessibility-events","ambient-light-sensor","background-fetch","background-sync","bluetooth","camera","clipboard-read","clipboard-write","display-capture","geolocation","gyroscope","local-fonts","magnetometer","microphone","midi","nfc","notifications","payment-handler","persistent-storage","push","screen-wake-lock","speaker-selection","storage-access","top-level-storage-access","window-management","xr-spatial-tracking"];function j(e){const t={};for(const n of e)t[n]=(t[n]??0)+1;let n=e[0],o=0;for(const[e,r]of Object.entries(t))r>o&&(n=e,o=r);return n}const G=[{name:"prefers-contrast",values:["no-preference","more","less","custom"]},{name:"any-hover",values:["none","hover"]},{name:"any-pointer",values:["none","coarse","fine"]},{name:"pointer",values:["none","coarse","fine"]},{name:"hover",values:["none","hover"]},{name:"update",values:["none","slow","fast"]},{name:"inverted-colors",values:["none","inverted"]},{name:"prefers-reduced-motion",values:["no-preference","reduce"]},{name:"prefers-reduced-transparency",values:["no-preference","reduce"]},{name:"scripting",values:["none","initial-only","enabled"]},{name:"forced-colors",values:["none","active"]},{name:"prefers-color-scheme",values:["light","dark"]},{name:"color-gamut",values:["srgb","p3","rec2020"]},{name:"dynamic-range",values:["standard","high"]}],K=["KeyQ","KeyW","KeyA","KeyS","KeyZ","KeyX","KeyY","KeyM","Semicolon","BracketLeft","Quote","Digit1","Digit2","Digit3"];function N(e){const t=e.KeyQ,n=e.KeyZ,o=e.KeyY;return t?"a"===t?"azerty":"q"===t&&"z"===o?"qwertz":"q"===t&&"z"===n?"qwerty":"'"===t?"dvorak":"other":null}const H=[{name:"webgl",tier:1,async collect(){const e=document.createElement("canvas"),t=e.getContext("webgl")||e.getContext("experimental-webgl");if(!(t&&t instanceof WebGLRenderingContext))return null;const n=t.getExtension("WEBGL_debug_renderer_info"),o=t.getSupportedExtensions()??[],r=function(e){const t={},n=[e.VERTEX_SHADER,e.FRAGMENT_SHADER],o=[e.LOW_FLOAT,e.MEDIUM_FLOAT,e.HIGH_FLOAT,e.LOW_INT,e.MEDIUM_INT,e.HIGH_INT],r=["vertex","fragment"],i=["lowFloat","mediumFloat","highFloat","lowInt","mediumInt","highInt"];for(let a=0;a<n.length;a++){const s={};for(let t=0;t<o.length;t++){const r=e.getShaderPrecisionFormat(n[a],o[t]);r&&(s[i[t]]={rangeMin:r.rangeMin,rangeMax:r.rangeMax,precision:r.precision})}t[r[a]]=s}return t}(t),i={vendor:t.getParameter(t.VENDOR),renderer:t.getParameter(t.RENDERER),version:t.getParameter(t.VERSION),shadingLanguageVersion:t.getParameter(t.SHADING_LANGUAGE_VERSION),unmaskedVendor:n?t.getParameter(n.UNMASKED_VENDOR_WEBGL):null,unmaskedRenderer:n?t.getParameter(n.UNMASKED_RENDERER_WEBGL):null,extensions:o.sort(),maxTextureSize:t.getParameter(t.MAX_TEXTURE_SIZE),maxRenderbufferSize:t.getParameter(t.MAX_RENDERBUFFER_SIZE),maxViewportDims:Array.from(t.getParameter(t.MAX_VIEWPORT_DIMS)),maxVertexAttribs:t.getParameter(t.MAX_VERTEX_ATTRIBS),maxVertexUniformVectors:t.getParameter(t.MAX_VERTEX_UNIFORM_VECTORS),maxFragmentUniformVectors:t.getParameter(t.MAX_FRAGMENT_UNIFORM_VECTORS),maxVaryingVectors:t.getParameter(t.MAX_VARYING_VECTORS),aliasedLineWidthRange:Array.from(t.getParameter(t.ALIASED_LINE_WIDTH_RANGE)),aliasedPointSizeRange:Array.from(t.getParameter(t.ALIASED_POINT_SIZE_RANGE)),maxCombinedTextureImageUnits:t.getParameter(t.MAX_COMBINED_TEXTURE_IMAGE_UNITS),maxTextureImageUnits:t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS),maxVertexTextureImageUnits:t.getParameter(t.MAX_VERTEX_TEXTURE_IMAGE_UNITS),shaderPrecision:r,maxAnisotropy:b(t),webgl2:C(e)};return t.getExtension("WEBGL_lose_context")?.loseContext(),i}},{name:"hardware",tier:1,collect:async()=>({architecture:k(),platform:_()})},{name:"hardwareSensitive",tier:1,collect:async()=>({deviceMemory:navigator.deviceMemory??null,hardwareConcurrency:navigator.hardwareConcurrency??null})},{name:"math",tier:1,collect:async()=>({acos:Math.acos(.5),asin:M(Math.asin,-1,1,97),cos:M(Math.cos,0,Math.PI,97),cosLarge:Math.cos(1e20),sinLarge:Math.sin(1e20),tanLarge:Math.tan(1e20),sin:M(Math.sin,0,Math.PI,97),tan:M(Math.tan,0,Math.PI/4,97)})},{name:"i18n",tier:1,collect:async()=>({dateTimeFormat:P(),numberFormat:I(),collator:T(),pluralRules:L(),relativeTimeFormat:D(),listFormat:E()})},{name:"domrect",tier:1,collect:async()=>({basic:function(){const e=document.createElement("div");e.style.cssText="position:fixed;left:-9999px;width:100px;height:100px;",document.body.appendChild(e);const t=e.getBoundingClientRect();return document.body.removeChild(e),{x:t.x,y:t.y,width:t.width,height:t.height,top:t.top,right:t.right,bottom:t.bottom,left:t.left}}(),precision:function(){const e=document.createElement("div");e.style.cssText=`position:absolute;left:-9999px;width:${Math.PI}px;height:${Math.E}px;`,document.body.appendChild(e);const t=e.getBoundingClientRect();return document.body.removeChild(e),{width:t.width,height:t.height}}(),fromRect:"undefined"!=typeof DOMRectReadOnly&&"function"==typeof DOMRectReadOnly.fromRect})},{name:"touch",tier:1,collect:async()=>({supported:"ontouchstart"in window||navigator.maxTouchPoints>0,maxTouchPoints:navigator.maxTouchPoints??0})},{name:"display",tier:1,collect:async()=>({colorDepth:screen.colorDepth??0,pixelDepth:screen.pixelDepth??0})},{name:"locale",tier:1,collect:async()=>({timezone:Intl.DateTimeFormat().resolvedOptions().timeZone??"",language:navigator.language??""})},{name:"workers",tier:1,collect:async()=>({webWorker:"undefined"!=typeof Worker,sharedWorker:"undefined"!=typeof SharedWorker,serviceWorker:"serviceWorker"in navigator})},{name:"plugins",tier:1,async collect(){const e=[];if(navigator.plugins)for(let t=0;t<navigator.plugins.length;t++){const n=navigator.plugins[t];"internal-pdf-viewer"===n.filename&&e.push(`${n.name}|${n.filename}|${n.description}`)}return{plugins:e.sort(),pdfViewerEnabled:navigator.pdfViewerEnabled??!1}}},{name:"css",tier:1,collect:async()=>({scrollbarWidth:$(),supports:R(),safeArea:B()})},{name:"navigatorProps",tier:1,collect:async()=>({vendor:navigator.vendor??"",productSub:navigator.productSub??"",cookieEnabled:navigator.cookieEnabled})},{name:"timing",tier:2,collect:async()=>({performancePrecisionUs:O()})},{name:"navigatorConnection",tier:2,async collect(){const e=navigator,t=e.connection??e.mozConnection??e.webkitConnection??null,n=performance.memory??null;return{connection:t?{type:t.type??null,effectiveType:t.effectiveType??null,saveData:t.saveData??null}:null,memory:n?{jsHeapSizeLimit:n.jsHeapSizeLimit}:null}}},{name:"webgpu",tier:2,async collect(){const e=navigator.gpu;if(!e)return null;const t=await e.requestAdapter();if(!t)return null;let n="",o="",r="",i="";if(t.info)n=t.info.vendor??"",o=t.info.architecture??"",r=t.info.device??"",i=t.info.description??"";else if("function"==typeof t.requestAdapterInfo){const e=await t.requestAdapterInfo();n=e.vendor??"",o=e.architecture??"",r=e.device??"",i=e.description??""}const a=[];t.features&&(t.features.forEach(e=>a.push(e)),a.sort());const s={};if(t.limits){const e=["maxTextureDimension1D","maxTextureDimension2D","maxTextureDimension3D","maxTextureArrayLayers","maxBindGroups","maxBindGroupsPlusVertexBuffers","maxBindingsPerBindGroup","maxDynamicUniformBuffersPerPipelineLayout","maxDynamicStorageBuffersPerPipelineLayout","maxSampledTexturesPerShaderStage","maxSamplersPerShaderStage","maxStorageBuffersPerShaderStage","maxStorageTexturesPerShaderStage","maxUniformBuffersPerShaderStage","maxUniformBufferBindingSize","maxStorageBufferBindingSize","minUniformBufferOffsetAlignment","minStorageBufferOffsetAlignment","maxVertexBuffers","maxBufferSize","maxVertexAttributes","maxVertexBufferArrayStride","maxInterStageShaderComponents","maxInterStageShaderVariables","maxColorAttachments","maxColorAttachmentBytesPerSample","maxComputeWorkgroupStorageSize","maxComputeInvocationsPerWorkgroup","maxComputeWorkgroupSizeX","maxComputeWorkgroupSizeY","maxComputeWorkgroupSizeZ","maxComputeWorkgroupsPerDimension"];for(const n of e){const e=t.limits[n];void 0!==e&&(s[n]=e)}}return{vendor:n,architecture:o,device:r,description:i,features:a,limits:s}}},{name:"audio",tier:2,async collect(){const e=window.AudioContext||window.webkitAudioContext;if(!e)return null;let t=null;try{t=new e;const n=t.destination;return{sampleRate:t.sampleRate,maxChannelCount:n.maxChannelCount,channelCount:n.channelCount,channelCountMode:n.channelCountMode,channelInterpretation:n.channelInterpretation,baseLatency:t.baseLatency??null,outputLatency:t.outputLatency??null}}finally{if(t&&"closed"!==t.state)try{await t.close()}catch{}}}},{name:"fonts",tier:2,collect:()=>new Promise(e=>{const t=()=>e(function(){try{if("undefined"==typeof document)return{available:[],method:"css-layout"};const e=new Set,t=[];if("function"==typeof document.fonts?.check)for(const n of F)document.fonts.check(`72px "${n}"`)?e.add(n):t.push(n);else t.push(...F);const n=new Set;if(t.length>0){const e=document.createElement("div");e.style.cssText="position:absolute;visibility:hidden;top:-9999px;left:-9999px;pointer-events:none;";const o=z.map(t=>{const n=document.createElement("span");return n.style.cssText=`font-size:72px;font-family:${t};white-space:nowrap;display:inline-block`,n.textContent=W,e.appendChild(n),n}),r=t.map(t=>z.map(n=>{const o=document.createElement("span");return o.style.cssText=`font-size:72px;font-family:'${t}',${n};white-space:nowrap;display:inline-block`,o.textContent=W,e.appendChild(o),o}));document.body.appendChild(e);const i=o.map(e=>e.getBoundingClientRect().width),a=r.map(e=>e.map(e=>e.getBoundingClientRect().width));document.body.removeChild(e);for(let e=0;e<t.length;e++)for(let o=0;o<z.length;o++)if(a[e][o]!==i[o]){n.add(t[e]);break}}return{available:F.filter(t=>e.has(t)||n.has(t)),method:"css-layout"}}catch{return{available:[],method:"css-layout"}}}());"undefined"!=typeof requestIdleCallback?requestIdleCallback(t,{timeout:2e3}):setTimeout(t,0)})},{name:"webrtc",tier:2,async collect(){if("undefined"==typeof RTCPeerConnection)return{supported:!1,audioCodecCount:0,videoCodecCount:0,audioCodecs:[],videoCodecs:[],extensions:[]};const e=new RTCPeerConnection({iceServers:[]});try{e.addTransceiver("audio"),e.addTransceiver("video");const t=(await e.createOffer()).sdp??"",n=U(t,"audio"),o=U(t,"video"),r=function(e){const t=new Set,n=e.split("\r\n");for(const e of n)if(e.startsWith("a=extmap:")){const n=e.match(/^a=extmap:\d+(?:\/\w+)?\s+(.+)$/);n&&t.add(n[1].trim())}return Array.from(t)}(t);return{supported:!0,audioCodecCount:n.length,videoCodecCount:o.length,audioCodecs:n.sort(),videoCodecs:o.sort(),extensions:r.sort()}}finally{e.close()}}},{name:"permissions",tier:2,async collect(){if(!navigator.permissions?.query)return{states:{}};const e=()=>Promise.allSettled(V.map(async e=>{try{return{name:e,state:(await navigator.permissions.query({name:e})).state}}catch{return{name:e,state:"error"}}})),t=await Promise.all([e(),e(),e()]),n={};for(const e of t)for(const t of e)if("fulfilled"===t.status){const{name:e,state:o}=t.value;n[e]||(n[e]=[]),n[e].push(o)}const o={};for(const[e,t]of Object.entries(n))o[e]=j(t);return{states:o}}},{name:"speech",tier:2,async collect(){if("undefined"==typeof speechSynthesis)return{supported:!1,voiceCount:0,voices:[]};const e=await new Promise(e=>{const t=speechSynthesis.getVoices();if(t.length>0)return void e(t);const n=setTimeout(()=>e([]),800);speechSynthesis.addEventListener("voiceschanged",()=>{clearTimeout(n),e(speechSynthesis.getVoices())},{once:!0})}),t=e.map(e=>`${e.name}|${e.lang}|${e.localService}`).sort();return{supported:!0,voiceCount:e.length,voices:t}}},{name:"mediaQueries",tier:2,async collect(){if("function"!=typeof matchMedia){const e={};for(const t of G)e[t.name.replace(/-([a-z])/g,(e,t)=>t.toUpperCase())]="unsupported";return{...e,monochrome:0}}const e={};for(const t of G){let n="unknown";for(const e of t.values){const o=matchMedia(`(${t.name}: ${e})`);if(o?.matches){n=e;break}}e[t.name.replace(/-([a-z])/g,(e,t)=>t.toUpperCase())]=n}let t=0;for(let e=100;e>=0;e--)if(matchMedia(`(monochrome: ${e})`)?.matches){t=e;break}return{...e,monochrome:t}}},{name:"applePay",tier:2,async collect(){const e=window.ApplePaySession;if(!e||"function"!=typeof e.supportsVersion)return{supported:!1,maxVersion:0};let t=0;for(let n=15;n>=1;n--)try{if(e.supportsVersion(n)){t=n;break}}catch{continue}return{supported:!0,maxVersion:t}}},{name:"keyboard",tier:2,async collect(){const e=navigator.keyboard;if(!e||"function"!=typeof e.getLayoutMap)return{supported:!1,layoutKeys:null,layoutHint:null};try{const t=await e.getLayoutMap(),n={};for(const e of K){const o=t.get(e);void 0!==o&&(n[e]=o)}return{supported:!0,layoutKeys:n,layoutHint:N(n)}}catch{return{supported:!1,layoutKeys:null,layoutHint:null}}}}];async function q(e){const n=function(e){return e?{exclude:e.exclude??o.exclude,include:e.include??o.include,timeout:e.timeout??o.timeout,stabilize:e.stabilize??o.stabilize,experimental:e.experimental??o.experimental,debug:e.debug??o.debug,salt:e.salt??o.salt}:{...o}}(e),s=c(),u=function(){try{return window.self!==window.top}catch{return!0}}();let l=!1;try{l=await async function(e){try{switch(e){case"chrome":case"edge":case"opera":default:return await async function(){if(!navigator.storage?.estimate)return!1;const{quota:e}=await navigator.storage.estimate();return void 0!==e&&e<4294967296}();case"brave":return await async function(){return!1}();case"safari":return await async function(){if(navigator.storage?.estimate){const{quota:e}=await navigator.storage.estimate();if(void 0!==e)return e<4294967296}try{return!!navigator.storage?.getDirectory&&(await navigator.storage.getDirectory(),!1)}catch(e){return"NotFoundError"===e?.name}}();case"firefox":return await async function(){if(!("serviceWorker"in navigator))return!0;try{return!!navigator.storage?.getDirectory&&(await navigator.storage.getDirectory(),!1)}catch(e){return"SecurityError"===e?.name}}()}}catch{return!1}}(s.name)}catch{}const f=function(e,t,n,o){const r=new Set;for(const i of e){if("private"===i&&!n)continue;if("iframe"===i&&!o)continue;const e=a[i];if(e)for(const n of e)if(!n.browsers||n.browsers.includes(t))for(const e of n.exclude)r.add(e)}return r}(n.stabilize,s.name,l,u),d=new Set(f);for(const e of n.exclude)d.add(e);for(const e of n.include)d.delete(e);const{components:m,errors:p}=await async function(e,t,n){const o={},r=[],i=H.filter(t=>!e.has(t.name)&&(n||3!==t.tier)),a=await Promise.allSettled(i.map(async e=>{const n=await(o=e.collect(),r=t,new Promise((e,t)=>{const n=setTimeout(()=>e(null),r);o.then(t=>{clearTimeout(n),e(t)},e=>{clearTimeout(n),t(e)})}));var o,r;return{name:e.name,value:n}}));for(let e=0;e<a.length;e++){const t=a[e],n=i[e].name;"fulfilled"===t.status&&null!==t.value.value?o[n]=t.value.value:"rejected"===t.status&&r.push({signal:n,error:String(t.reason?.message??t.reason)})}return{components:o,errors:r}}(d,n.timeout,n.experimental),h={t:t};for(const[e,t]of Object.entries(m))i.has(e)||(h[e]=t);const g=S(h,n.salt),y={t:t};for(const[e,t]of Object.entries(m))r.has(e)||(y[e]=t);const v=S(y,n.salt),w={hash:g,stableHash:v,components:{...m,t:t},timestamp:(new Date).toISOString(),version:t,isIncognito:l,errors:p};return n.debug&&(console.log("[fingerprint] components:",m),console.log("[fingerprint] hash:",g,"stableHash:",v),p.length>0&&console.warn("[fingerprint] errors:",p)),w}const J=new RegExp(["googlebot","bingbot","slurp","baiduspider","duckduckbot","yandex","sogou","exabot","ia_archiver","curl","wget","python-requests","python-urllib","axios","node-fetch","go-http-client","java/","libwww-perl","okhttp","apache-httpclient","http_request","httpie","headlesschrome","phantomjs","puppeteer","playwright","cypress","selenium","webdriver","electron","jsdom","vercel-screenshot","screenshot","prerender","lighthouse","chrome-lighthouse","pagespeed","gtmetrix","pingdom","nessus","nikto","sqlmap","burp","zap","qualys","openvas","nmap","masscan","facebookexternalhit","twitterbot","linkedinbot","whatsapp","telegrambot","slackbot","discordbot","bot","crawl","spider","scrape","fetch","scan"].join("|"),"i");function X(e){return!!e&&J.test(e)}const Y=new Set(["__pre_auth__","anonymous","guest","undefined","null"]),Z="/__unshared/submit-fp",Q="__unshared_email",ee="__unshared_fp",te="__unshared_last_submit",ne="__unshared_device_id",oe="__unshared_uid",re="__unshared_sid";function ie(){if("undefined"!=typeof crypto&&crypto.randomUUID)return crypto.randomUUID();const e=new Uint8Array(16);crypto.getRandomValues(e),e[6]=15&e[6]|64,e[8]=63&e[8]|128;const t=Array.from(e).map(e=>e.toString(16).padStart(2,"0")).join("");return`${t.slice(0,8)}-${t.slice(8,12)}-${t.slice(12,16)}-${t.slice(16,20)}-${t.slice(20)}`}function ae(e){return new Promise(t=>setTimeout(t,e))}function se(e){const t=Math.min(1e3*Math.pow(2,e-1),3e4),n=500*Math.random()-250;return Math.max(0,t+n)}function ce(e){if("undefined"==typeof document)return;const t=document.cookie.match(new RegExp(`(?:^|; )${e}=([^;]*)`));return t?decodeURIComponent(t[1]):void 0}function ue(e,t){"undefined"!=typeof document&&(document.cookie=`${e}=${encodeURIComponent(t)}; Path=/; SameSite=Lax`)}function le(e,t){if("undefined"!=typeof localStorage)try{localStorage.setItem(e,t)}catch{}}e.UnsharedBrowser=class{constructor(e={}){if(this.o="",e.baseUrl&&!function(e){try{return new URL(e),!0}catch{return!1}}(e.baseUrl))throw new Error('baseUrl must be a valid URL (e.g. "https://app.example.com")');let t,n;this.i=e.baseUrl?e.baseUrl.replace(/\/$/,""):"",this.u=e.maxRetries??3,this.l=e.timeout??3e4,this.m=e.includePathPrefix,this.p=e.skipPaths,this.h=e.sessionId,this.v=e.deviceId,this.o=function(e){if("undefined"!=typeof sessionStorage)try{return sessionStorage.getItem(e)??void 0}catch{return}}(te)??"";try{t=this.h?.()}catch{}this.S=t??ce(re)??ie(),ue(re,this.S);try{n=this.v?.()}catch{}n?(this.C=n,le(ne,n)):this.C=function(e){if("undefined"!=typeof localStorage)try{return localStorage.getItem(e)??void 0}catch{return}}(ne)??"",this._()}async init(e){try{if("undefined"!=typeof navigator&&X(navigator.userAgent))return;if("string"==typeof(t=e.userId)&&Y.has(t))return void this.k;this.k=e.userId,this.M=e.emailAddress,"undefined"!=typeof sessionStorage&&sessionStorage.setItem(Q,e.emailAddress),ue(oe,e.userId);let n,o=this.P();o||(o=await this.collect(),this.I(o));try{n=this.v?.()}catch{}n?(this.C=n,le(ne,n)):o.fingerprint_id&&(this.C=o.fingerprint_id,le(ne,o.fingerprint_id)),this.T(o).catch(()=>{})}catch{}var t}onRouteChange(){try{if(!this.L())return;const e=this.P();if(!e)return;this.T(e).catch(()=>{})}catch{}}destroy(){try{"undefined"!=typeof sessionStorage&&(sessionStorage.removeItem(Q),sessionStorage.removeItem(ee),sessionStorage.removeItem(te)),this.o="",e=oe,"undefined"!=typeof document&&(document.cookie=`${e}=; Path=/; SameSite=Lax; Expires=Thu, 01 Jan 1970 00:00:00 GMT`),this.D&&"undefined"!=typeof document&&(document.removeEventListener("DOMContentLoaded",this.D),this.D=void 0),this.k=void 0,this.M=void 0}catch{}var e}async collect(e){const t=[...new Set(["timing","speech",...e?.exclude??[]])],n=await q({...e,exclude:t});return{fingerprint_id:n.stableHash,full_hash:n.hash,components:n.components,timestamp:n.timestamp,isIncognito:n.isIncognito,version:n.version}}async submitFingerprintEvent(e,t){try{const n=this.A(e,t),o=ie(),r=`${this.i}${Z}`;return await this.$(r,JSON.stringify(n),o)}catch(e){return{success:!1,error:{code:"DELIVERY_FAILED",message:e instanceof Error?e.message:String(e)}}}}L(){if("undefined"!=typeof sessionStorage)return sessionStorage.getItem(Q)??void 0}P(){if("undefined"==typeof sessionStorage)return;const e=sessionStorage.getItem(ee);if(e)try{return JSON.parse(e)}catch{return}}I(e){"undefined"!=typeof sessionStorage&&sessionStorage.setItem(ee,JSON.stringify(e))}R(){if("undefined"==typeof location)return!0;const e=location.pathname||"/";if(this.p)for(const t of this.p)if(e.startsWith(t))return!1;return!this.m||this.m.some(t=>e.startsWith(t))}async T(e){if("undefined"!=typeof navigator&&X(navigator.userAgent))return{success:!0};if(!this.R())return{success:!0};const t=this.M??this.L(),n=this.k??ce(oe),o="undefined"!=typeof location?(location.pathname||"/")+(location.search||""):"/";if(n){const e=`${n}|${o}`;if(e===this.o)return{success:!0};this.o=e,function(e,t){if("undefined"!=typeof sessionStorage)try{sessionStorage.setItem(e,t)}catch{}}(te,e)}const r={hash:e.full_hash,stable_hash:e.fingerprint_id,collected_at:(new Date).toISOString(),is_incognito:e.isIncognito,components:e.components,version:e.version,session_id:this.S,event_type:o};n&&(r.user_id=n),t&&(r.email=t);const i=`${e.fingerprint_id}|${n??""}|${o}`,a=`${this.i}${Z}`;return this.$(a,JSON.stringify(r),i)}_(){"undefined"!=typeof document&&(this.D&&document.removeEventListener("DOMContentLoaded",this.D),this.D=()=>{if(!this.L())return;const e=this.P();e&&this.T(e).catch(()=>{})},document.addEventListener("DOMContentLoaded",this.D))}async $(e,t,n){const o=this.u+1;let r={success:!1,error:{code:"DELIVERY_FAILED",message:"Request failed"}};for(let i=1;i<=o;i++){i>1&&await ae(se(i-1));const o=new AbortController,a=setTimeout(()=>o.abort(),this.l);try{const i=await fetch(e,{method:"POST",headers:{"Content-Type":"application/json","X-Idempotency-Key":n,"X-Session-Id":this.S,"X-Device-Id":this.C},body:t,signal:o.signal});if(clearTimeout(a),i.status>=500){r={success:!1,error:{code:"DELIVERY_FAILED",message:`Backend returned ${i.status}`}};continue}if(i.status>=400)return{success:!1,error:{code:"DELIVERY_FAILED",message:`Backend returned ${i.status}`}};const s=await i.text().catch(()=>"{}");let c;try{c=JSON.parse(s)}catch{c={}}return!1===c?.success?{success:!1,error:c.error??{code:"UPSTREAM_ERROR",message:"Upstream failed"}}:{success:!0,data:c?.data}}catch(e){clearTimeout(a),r={success:!1,error:{code:"DELIVERY_FAILED",message:e instanceof Error?e.message:String(e)}}}}return r}A(e,t){const n={hash:e.full_hash,stable_hash:e.fingerprint_id,collected_at:e.timestamp,is_incognito:e.isIncognito,components:e.components,version:e.version,session_id:this.S};n.user_id=t.userId,null!=t?.eventType&&(n.event_type=t.eventType);const o=this.M??this.L();return o&&(n.email=o),n}},e.createAxiosInterceptor=function(e){return t=>{if(403===t?.response?.status&&"account_flagged"===t?.response?.data?.error)try{e.onFlagged()}catch{}return Promise.reject(t)}},e.createFetchInterceptor=function(e,t){return async(...n)=>{const o=await e(...n);if(403===o.status){const e=o.clone();try{const n=await e.json();if("account_flagged"===n?.error)try{t.onFlagged()}catch{}}catch{}}return o}}});
1
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).UnsharedBrowser={})}(this,function(e){"use strict";const t="1.3.3",n=1282368115,o={exclude:[],include:[],timeout:3e3,stabilize:["private","iframe","always"],experimental:!1,debug:!1,salt:""},r=new Set(["audio","timing","navigatorConnection","domrect","permissions","fonts","speech","display","cssLayout"]),i=new Set(["domrect"]),a=new Set(["screen","mediaCapabilities","storage","features","sensors","battery","gamepads","webApis","notificationState","extendedLocale","privacyPrefs","performanceContext","canvas","audioOscillator","webglRender","canvasTextMetrics","vendorFlavors","fontPreferences","screenFrame","clientHints","domBlockers","privateClickMeasurement","automationDetection","agentDetection","tamperDetection","vmDetection","devtoolsDetection"]),c={always:[{exclude:["speech"],browsers:["brave","firefox"]},{exclude:["keyboard"],browsers:["firefox","safari"]},{exclude:["workers"],browsers:["firefox"]},{exclude:["hardwareSensitive","navigatorProps"],browsers:["brave"]},{exclude:["canvas","audioOscillator","webglRender","canvasTextMetrics"],browsers:["brave"]},{exclude:["canvas"],browsers:["firefox"]}],private:[{exclude:["fonts"],browsers:["firefox"]},{exclude:["audio"],browsers:["safari","brave"]},{exclude:["audioOscillator"],browsers:["safari"]}],iframe:[{exclude:["applePay"],browsers:["safari"]},{exclude:["permissions"]},{exclude:["keyboard"]}]};let s=null;function u(){if(s)return s;const e=navigator.userAgent;return s=function(){const e=navigator.brave;return!!e&&"function"==typeof e.isBrave}()?{name:"brave",version:l(e,/Chrome\/([\d.]+)/)}:/Edg\//i.test(e)?{name:"edge",version:l(e,/Edg\/([\d.]+)/)}:/OPR\//i.test(e)||/Opera/i.test(e)?{name:"opera",version:l(e,/OPR\/([\d.]+)/)||l(e,/Opera\/([\d.]+)/)}:/SamsungBrowser/i.test(e)?{name:"samsung",version:l(e,/SamsungBrowser\/([\d.]+)/)}:/Firefox\//i.test(e)?{name:"firefox",version:l(e,/Firefox\/([\d.]+)/)}:/Safari\//i.test(e)&&!/Chrome/i.test(e)?{name:"safari",version:l(e,/Version\/([\d.]+)/)}:/Chrome\//i.test(e)?{name:"chrome",version:l(e,/Chrome\/([\d.]+)/)}:{name:"unknown",version:""},s}function l(e,t){const n=e.match(t);return n?.[1]??""}function d(e,t){const n=e[0]>>>16,o=65535&e[0],r=e[1]>>>16,i=65535&e[1],a=t[0]>>>16,c=65535&t[0],s=t[1]>>>16;let u=0,l=0,d=0,f=0,m=0;return l=i+(65535&t[1]),u=l>>>16,l&=65535,d=r+s+u,u=d>>>16,d&=65535,f=o+c+u,u=f>>>16,f&=65535,m=n+a+u,m&=65535,[m<<16|f,d<<16|l]}function f(e,t){const n=e[0]>>>16,o=65535&e[0],r=e[1]>>>16,i=65535&e[1],a=t[0]>>>16,c=65535&t[0],s=t[1]>>>16,u=65535&t[1];let l=0,d=0,f=0,m=0,p=0;return d=i*u,l=d>>>16,d&=65535,f=r*u+l,l=f>>>16,f&=65535,f+=i*s,l+=f>>>16,f&=65535,m=o*u+l,l=m>>>16,m&=65535,m+=r*s,l+=m>>>16,m&=65535,m+=i*c,l+=m>>>16,m&=65535,p=n*u+o*s+r*c+i*a+l,p&=65535,[p<<16|m,f<<16|d]}function m(e,t){return 32==(t%=64)?[e[1],e[0]]:t<32?[e[0]<<t|e[1]>>>32-t,e[1]<<t|e[0]>>>32-t]:(t-=32,[e[1]<<t|e[0]>>>32-t,e[0]<<t|e[1]>>>32-t])}function p(e,t){return 0==(t%=64)?[e[0],e[1]]:t<32?[e[0]<<t|e[1]>>>32-t,e[1]<<t]:[e[1]<<t-32,0]}function h(e,t){return[e[0]^t[0],e[1]^t[1]]}function y(e){let t=[e[0],e[1]];return t=h(t,[0,t[0]>>>1]),t=f(t,[4283543511,3981806797]),t=h(t,[0,t[0]>>>1]),t=f(t,[3301882366,444984403]),t=h(t,[0,t[0]>>>1]),t}function g(e){return("00000000"+(e>>>0).toString(16)).slice(-8)}function v(e,t=0){const n=e.length%16,o=e.length-n;let r=[0,t],i=[0,t];const a=[2277735313,289559509],c=[1291169091,658871167];for(let t=0;t<o;t+=16){let n=[255&e.charCodeAt(t+4)|(255&e.charCodeAt(t+5))<<8|(255&e.charCodeAt(t+6))<<16|(255&e.charCodeAt(t+7))<<24,255&e.charCodeAt(t)|(255&e.charCodeAt(t+1))<<8|(255&e.charCodeAt(t+2))<<16|(255&e.charCodeAt(t+3))<<24],o=[255&e.charCodeAt(t+12)|(255&e.charCodeAt(t+13))<<8|(255&e.charCodeAt(t+14))<<16|(255&e.charCodeAt(t+15))<<24,255&e.charCodeAt(t+8)|(255&e.charCodeAt(t+9))<<8|(255&e.charCodeAt(t+10))<<16|(255&e.charCodeAt(t+11))<<24];n=f(n,a),n=m(n,31),n=f(n,c),r=h(r,n),r=m(r,27),r=d(r,i),r=d(f(r,[0,5]),[0,1390208809]),o=f(o,c),o=m(o,33),o=f(o,a),i=h(i,o),i=m(i,31),i=d(i,r),i=d(f(i,[0,5]),[0,944331445])}let s=[0,0],u=[0,0];switch(n){case 15:u=h(u,p([0,e.charCodeAt(o+14)],48));case 14:u=h(u,p([0,e.charCodeAt(o+13)],40));case 13:u=h(u,p([0,e.charCodeAt(o+12)],32));case 12:u=h(u,p([0,e.charCodeAt(o+11)],24));case 11:u=h(u,p([0,e.charCodeAt(o+10)],16));case 10:u=h(u,p([0,e.charCodeAt(o+9)],8));case 9:u=h(u,[0,e.charCodeAt(o+8)]),u=f(u,c),u=m(u,33),u=f(u,a),i=h(i,u);case 8:s=h(s,p([0,e.charCodeAt(o+7)],56));case 7:s=h(s,p([0,e.charCodeAt(o+6)],48));case 6:s=h(s,p([0,e.charCodeAt(o+5)],40));case 5:s=h(s,p([0,e.charCodeAt(o+4)],32));case 4:s=h(s,p([0,e.charCodeAt(o+3)],24));case 3:s=h(s,p([0,e.charCodeAt(o+2)],16));case 2:s=h(s,p([0,e.charCodeAt(o+1)],8));case 1:s=h(s,[0,e.charCodeAt(o)]),s=f(s,a),s=m(s,31),s=f(s,c),r=h(r,s)}return r=h(r,[0,e.length]),i=h(i,[0,e.length]),r=d(r,i),i=d(i,r),r=y(r),i=y(i),r=d(r,i),i=d(i,r),g(r[0])+g(r[1])+g(i[0])+g(i[1])}function w(e){return b(e,new Set)}function b(e,t){if(null===e)return"null";if(void 0===e)return"undefined";const n=typeof e;if("boolean"===n||"number"===n)return String(e);if("string"===n)return JSON.stringify(e);if(Array.isArray(e)){if(t.has(e))return'"[Circular]"';t.add(e);const n=e.map(e=>b(e,t));return t.delete(e),"["+n.join(",")+"]"}if("object"===n){const n=e;if(t.has(n))return'"[Circular]"';t.add(n);const o=Object.keys(n).sort().filter(e=>void 0!==n[e]).map(e=>JSON.stringify(e)+":"+b(n[e],t));return t.delete(n),"{"+o.join(",")+"}"}return String(e)}const x=v("",n);function _(e,t){const o=function(e){if(0===e.length)return v("",n);if(1===e.length)return v(e[0],n);let t=[...e];for(;t.length>1;){const e=[];for(let o=0;o<t.length;o+=2){const r=o+1<t.length?t[o+1]:x;e.push(v(t[o]+r,n))}t=e}return t[0]}(Object.keys(e).sort().map(t=>{const o=function(e){let t=n;for(let n=0;n<e.length;n++)t=Math.imul(t^e.charCodeAt(n),1540483477),t^=t>>>13;return t>>>0}(t);return v(w(e[t]),o)})),r=String.fromCharCode(76,111,98,115),i=t?v(t,n):"";return v(o+r+i,n)}const S={name:"webgl",tier:1,async collect(){const e=document.createElement("canvas"),t=e.getContext("webgl")||e.getContext("experimental-webgl");if(!(t&&t instanceof WebGLRenderingContext))return null;const n=t.getExtension("WEBGL_debug_renderer_info"),o=t.getSupportedExtensions()??[],r=function(e){const t={},n=[e.VERTEX_SHADER,e.FRAGMENT_SHADER],o=[e.LOW_FLOAT,e.MEDIUM_FLOAT,e.HIGH_FLOAT,e.LOW_INT,e.MEDIUM_INT,e.HIGH_INT],r=["vertex","fragment"],i=["lowFloat","mediumFloat","highFloat","lowInt","mediumInt","highInt"];for(let a=0;a<n.length;a++){const c={};for(let t=0;t<o.length;t++){const r=e.getShaderPrecisionFormat(n[a],o[t]);r&&(c[i[t]]={rangeMin:r.rangeMin,rangeMax:r.rangeMax,precision:r.precision})}t[r[a]]=c}return t}(t),i={vendor:t.getParameter(t.VENDOR),renderer:t.getParameter(t.RENDERER),version:t.getParameter(t.VERSION),shadingLanguageVersion:t.getParameter(t.SHADING_LANGUAGE_VERSION),unmaskedVendor:n?t.getParameter(n.UNMASKED_VENDOR_WEBGL):null,unmaskedRenderer:n?t.getParameter(n.UNMASKED_RENDERER_WEBGL):null,extensions:o.sort(),maxTextureSize:t.getParameter(t.MAX_TEXTURE_SIZE),maxRenderbufferSize:t.getParameter(t.MAX_RENDERBUFFER_SIZE),maxViewportDims:Array.from(t.getParameter(t.MAX_VIEWPORT_DIMS)),maxVertexAttribs:t.getParameter(t.MAX_VERTEX_ATTRIBS),maxVertexUniformVectors:t.getParameter(t.MAX_VERTEX_UNIFORM_VECTORS),maxFragmentUniformVectors:t.getParameter(t.MAX_FRAGMENT_UNIFORM_VECTORS),maxVaryingVectors:t.getParameter(t.MAX_VARYING_VECTORS),aliasedLineWidthRange:Array.from(t.getParameter(t.ALIASED_LINE_WIDTH_RANGE)),aliasedPointSizeRange:Array.from(t.getParameter(t.ALIASED_POINT_SIZE_RANGE)),maxCombinedTextureImageUnits:t.getParameter(t.MAX_COMBINED_TEXTURE_IMAGE_UNITS),maxTextureImageUnits:t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS),maxVertexTextureImageUnits:t.getParameter(t.MAX_VERTEX_TEXTURE_IMAGE_UNITS),shaderPrecision:r,maxAnisotropy:C(t),webgl2:k(e)};return t.getExtension("WEBGL_lose_context")?.loseContext(),i}};function C(e){try{const t=e.getExtension("EXT_texture_filter_anisotropic")??e.getExtension("WEBKIT_EXT_texture_filter_anisotropic")??e.getExtension("MOZ_EXT_texture_filter_anisotropic");return t?e.getParameter(t.MAX_TEXTURE_MAX_ANISOTROPY_EXT):null}catch{return null}}function k(e){try{const t=e.getContext("webgl2");if(!t)return null;const n={version:t.getParameter(t.VERSION),maxSamples:t.getParameter(t.MAX_SAMPLES),max3DTextureSize:t.getParameter(t.MAX_3D_TEXTURE_SIZE),maxArrayTextureLayers:t.getParameter(t.MAX_ARRAY_TEXTURE_LAYERS),maxUniformBlockSize:t.getParameter(t.MAX_UNIFORM_BLOCK_SIZE),maxVertexUniformComponents:t.getParameter(t.MAX_VERTEX_UNIFORM_COMPONENTS),maxFragmentUniformComponents:t.getParameter(t.MAX_FRAGMENT_UNIFORM_COMPONENTS),maxColorAttachments:t.getParameter(t.MAX_COLOR_ATTACHMENTS),maxDrawBuffers:t.getParameter(t.MAX_DRAW_BUFFERS)};return t.getExtension("WEBGL_lose_context")?.loseContext(),n}catch{return null}}const M={name:"hardware",tier:1,collect:async()=>({architecture:D(),platform:A()})},P={name:"hardwareSensitive",tier:1,collect:async()=>({deviceMemory:navigator.deviceMemory??null,hardwareConcurrency:navigator.hardwareConcurrency??null})};function A(){const e=navigator.userAgentData;if(e?.platform)return e.platform;const t=navigator.userAgent??"";return/Windows/.test(t)?"Windows":/Macintosh|Mac OS X/.test(t)?"macOS":/CrOS/.test(t)?"Chrome OS":/Android/.test(t)?"Android":/Linux/.test(t)?"Linux":/iPhone|iPad|iPod/.test(t)?"iOS":""}function D(){try{const e=new ArrayBuffer(4),t=new Float32Array(e),n=new Uint8Array(e);return t[0]=1/0,n[3]}catch{return 0}}const T={name:"math",tier:1,collect:async()=>({acos:Math.acos(.5),asin:I(Math.asin,-1,1,97),cos:I(Math.cos,0,Math.PI,97),cosLarge:Math.cos(1e20),sinLarge:Math.sin(1e20),tanLarge:Math.tan(1e20),sin:I(Math.sin,0,Math.PI,97),tan:I(Math.tan,0,Math.PI/4,97)})};function I(e,t,n,o){const r=(n-t)/o;let i=e(t)+e(n);for(let n=1;n<o;n++)i+=e(t+n*r)*(n%2==0?2:4);return i*r/3}const B={name:"i18n",tier:1,collect:async()=>({dateTimeFormat:L(),numberFormat:E(),collator:O(),pluralRules:R(),relativeTimeFormat:F(),listFormat:W()})};function L(){try{const e=(new Intl.DateTimeFormat).resolvedOptions();return{locale:e.locale,calendar:e.calendar,numberingSystem:e.numberingSystem,timeZone:e.timeZone}}catch{return{}}}function E(){try{const e=(new Intl.NumberFormat).resolvedOptions();return{locale:e.locale,numberingSystem:e.numberingSystem,style:e.style,minimumIntegerDigits:e.minimumIntegerDigits,minimumFractionDigits:e.minimumFractionDigits,maximumFractionDigits:e.maximumFractionDigits,useGrouping:e.useGrouping}}catch{return{}}}function O(){try{const e=(new Intl.Collator).resolvedOptions();return{locale:e.locale,usage:e.usage,sensitivity:e.sensitivity,collation:e.collation,numeric:e.numeric,caseFirst:e.caseFirst}}catch{return{}}}function R(){try{const e=(new Intl.PluralRules).resolvedOptions(),t=new Intl.PluralRules(void 0,{type:"ordinal"}).resolvedOptions();return{locale:e.locale,type:e.type,cardinalCategories:(new Intl.PluralRules).select(0)+","+(new Intl.PluralRules).select(1)+","+(new Intl.PluralRules).select(2)+","+(new Intl.PluralRules).select(5)+","+(new Intl.PluralRules).select(11)+","+(new Intl.PluralRules).select(100),ordinalCategory1:t.type,minimumIntegerDigits:e.minimumIntegerDigits}}catch{return{}}}function F(){try{const e=new Intl.RelativeTimeFormat;if(!e)return{};const t=e.resolvedOptions();return{locale:t.locale,style:t.style,numeric:t.numeric,numberingSystem:t.numberingSystem}}catch{return{}}}function W(){try{const e=new Intl.ListFormat;if(!e)return{};const t=e.resolvedOptions(),n=["X","Y","Z"],o=new Intl.ListFormat(void 0,{type:"conjunction",style:"long"}),r=new Intl.ListFormat(void 0,{type:"disjunction",style:"long"});return{locale:t.locale,type:t.type,style:t.style,conjunctionSample:o.format(n),disjunctionSample:r.format(n)}}catch{return{}}}const $={name:"domrect",tier:1,collect:async()=>({basic:function(){const e=document.createElement("div");e.style.cssText="position:fixed;left:-9999px;width:100px;height:100px;",document.body.appendChild(e);const t=e.getBoundingClientRect();return document.body.removeChild(e),{x:t.x,y:t.y,width:t.width,height:t.height,top:t.top,right:t.right,bottom:t.bottom,left:t.left}}(),precision:function(){const e=document.createElement("div");e.style.cssText=`position:absolute;left:-9999px;width:${Math.PI}px;height:${Math.E}px;`,document.body.appendChild(e);const t=e.getBoundingClientRect();return document.body.removeChild(e),{width:t.width,height:t.height}}(),fromRect:"undefined"!=typeof DOMRectReadOnly&&"function"==typeof DOMRectReadOnly.fromRect})},z={name:"touch",tier:1,collect:async()=>({supported:"ontouchstart"in window||navigator.maxTouchPoints>0,maxTouchPoints:navigator.maxTouchPoints??0})},U={name:"display",tier:1,collect:async()=>({colorDepth:screen.colorDepth??0,pixelDepth:screen.pixelDepth??0})},V={name:"locale",tier:1,collect:async()=>({timezone:Intl.DateTimeFormat().resolvedOptions().timeZone??"",language:navigator.language??""})},j={name:"workers",tier:1,collect:async()=>({webWorker:"undefined"!=typeof Worker,sharedWorker:"undefined"!=typeof SharedWorker,serviceWorker:"serviceWorker"in navigator})},G={name:"plugins",tier:1,async collect(){const e=[];if(navigator.plugins)for(let t=0;t<navigator.plugins.length;t++){const n=navigator.plugins[t];"internal-pdf-viewer"===n.filename&&e.push(`${n.name}|${n.filename}|${n.description}`)}return{plugins:e.sort(),pdfViewerEnabled:navigator.pdfViewerEnabled??!1}}},N=[["backdrop-filter","blur(1px)"],["container-type","inline-size"],["text-wrap","balance"],["overscroll-behavior","contain"],["hanging-punctuation","first"],["-webkit-line-clamp","1"],["appearance","none"],["font-size-adjust","ex-height 0.5"],["font-palette","normal"],["field-sizing","content"],["-webkit-text-stroke","1px black"],["zoom","1"],["scrollbar-width","thin"],["scrollbar-color","red blue"],["animation-timeline","auto"],["mask-composite","add"],["offset-path","none"],["text-decoration-thickness","1px"],["content-visibility","auto"],["contain-intrinsic-size","auto 100px"],["aspect-ratio","16/9"],["gap","10px"],["color-mix","in srgb, red 50%, blue"],["linear-gradient(in oklch, red, blue)",""]],H={name:"css",tier:1,collect:async()=>({supports:q(),safeArea:K()})};function q(){const e={};if("undefined"==typeof CSS||"function"!=typeof CSS.supports)return e;for(const[t,n]of N)e[t]=n?CSS.supports(t,n):CSS.supports(t);return e}function K(){try{const e=document.createElement("div");e.style.cssText=["position:fixed","top:0","left:0","width:0","height:0","visibility:hidden","padding-top:env(safe-area-inset-top,0px)","padding-bottom:env(safe-area-inset-bottom,0px)","padding-left:env(safe-area-inset-left,0px)","padding-right:env(safe-area-inset-right,0px)"].join(";"),document.body.appendChild(e);const t=getComputedStyle(e),n={top:t.paddingTop,bottom:t.paddingBottom,left:t.paddingLeft,right:t.paddingRight};return document.body.removeChild(e),n}catch{return null}}const J={name:"cssLayout",tier:1,collect:async()=>({scrollbarWidth:X()})};function X(){try{const e=document.createElement("div");e.style.cssText="visibility:hidden;overflow:scroll;position:absolute;top:-9999px;width:100px;height:100px",document.body.appendChild(e);const t=document.createElement("div");e.appendChild(t);const n=e.offsetWidth-t.offsetWidth;return document.body.removeChild(e),n}catch{return-1}}const Y={name:"navigatorProps",tier:1,collect:async()=>({vendor:navigator.vendor??"",productSub:navigator.productSub??"",cookieEnabled:navigator.cookieEnabled})},Z={name:"navigatorConnection",tier:2,async collect(){const e=navigator,t=e.connection??e.mozConnection??e.webkitConnection??null,n=performance.memory??null;return{connection:t?{type:t.type??null,effectiveType:t.effectiveType??null,saveData:t.saveData??null}:null,memory:n?{jsHeapSizeLimit:n.jsHeapSizeLimit}:null}}},Q={name:"timing",tier:2,collect:async()=>({performancePrecisionUs:ee()})};function ee(){try{const e=performance.now();let t=1/0,n=e;for(let o=0;o<50;o++){const o=performance.now(),r=o-n;if(r>0&&r<t&&(t=r),n=o,o-e>=1)break}if(t===1/0)return-1;const o=1e3*t;if(o<=0)return-1;const r=Math.max(0,Math.round(Math.log10(o)));return Math.pow(10,r)}catch{return-1}}const te={name:"webgpu",tier:2,async collect(){const e=navigator.gpu;if(!e)return null;const t=await e.requestAdapter();if(!t)return null;let n="",o="",r="",i="";if(t.info)n=t.info.vendor??"",o=t.info.architecture??"",r=t.info.device??"",i=t.info.description??"";else if("function"==typeof t.requestAdapterInfo){const e=await t.requestAdapterInfo();n=e.vendor??"",o=e.architecture??"",r=e.device??"",i=e.description??""}const a=[];t.features&&(t.features.forEach(e=>a.push(e)),a.sort());const c={};if(t.limits){const e=["maxTextureDimension1D","maxTextureDimension2D","maxTextureDimension3D","maxTextureArrayLayers","maxBindGroups","maxBindGroupsPlusVertexBuffers","maxBindingsPerBindGroup","maxDynamicUniformBuffersPerPipelineLayout","maxDynamicStorageBuffersPerPipelineLayout","maxSampledTexturesPerShaderStage","maxSamplersPerShaderStage","maxStorageBuffersPerShaderStage","maxStorageTexturesPerShaderStage","maxUniformBuffersPerShaderStage","maxUniformBufferBindingSize","maxStorageBufferBindingSize","minUniformBufferOffsetAlignment","minStorageBufferOffsetAlignment","maxVertexBuffers","maxBufferSize","maxVertexAttributes","maxVertexBufferArrayStride","maxInterStageShaderComponents","maxInterStageShaderVariables","maxColorAttachments","maxColorAttachmentBytesPerSample","maxComputeWorkgroupStorageSize","maxComputeInvocationsPerWorkgroup","maxComputeWorkgroupSizeX","maxComputeWorkgroupSizeY","maxComputeWorkgroupSizeZ","maxComputeWorkgroupsPerDimension"];for(const n of e){const e=t.limits[n];void 0!==e&&(c[n]=e)}}return{vendor:n,architecture:o,device:r,description:i,features:a,limits:c}}},ne={name:"audio",tier:2,async collect(){const e=window.AudioContext||window.webkitAudioContext;if(!e)return null;let t=null;try{t=new e;const n=t.destination;return{sampleRate:t.sampleRate,maxChannelCount:n.maxChannelCount,channelCount:n.channelCount,channelCountMode:n.channelCountMode,channelInterpretation:n.channelInterpretation,baseLatency:t.baseLatency??null,outputLatency:t.outputLatency??null}}finally{if(t&&"closed"!==t.state)try{await t.close()}catch{}}}},oe=["Arial","Arial Black","Arial Narrow","Arial Rounded MT Bold","Bookman Old Style","Bradley Hand","Calibri","Cambria","Cambria Math","Century","Century Gothic","Comic Sans MS","Consolas","Courier","Courier New","Garamond","Geneva","Georgia","Gill Sans","Helvetica","Helvetica Neue","Impact","Lucida Console","Lucida Grande","Lucida Sans Unicode","Microsoft Sans Serif","Monaco","Palatino","Palatino Linotype","Segoe Print","Segoe Script","Segoe UI","Tahoma","Times","Times New Roman","Trebuchet MS","Verdana","Wingdings","Wingdings 2","Wingdings 3","Inter","Roboto","Open Sans","Lato","Montserrat","Poppins","Nunito","Raleway","Ubuntu","Merriweather","Playfair Display","Source Sans Pro","Source Code Pro","Fira Code","JetBrains Mono","Cascadia Code","Apple Color Emoji","Segoe UI Emoji","Noto Color Emoji","SF Pro","SF Pro Display","SF Mono","San Francisco","Menlo","Andale Mono","Futura","MS Gothic","MS Mincho","MS PGothic","MS PMincho","Yu Gothic","Meiryo","Hiragino Sans","Hiragino Kaku Gothic Pro","SimSun","SimHei","Microsoft YaHei","PingFang SC","Noto Sans CJK","Malgun Gothic","Arial Hebrew"],re=["monospace","sans-serif","serif"],ie="mmMwWLliI0O&1",ae={name:"fonts",tier:2,collect:()=>new Promise(e=>{const t=()=>e(function(){try{if("undefined"==typeof document)return{available:[],method:"css-layout"};const e=new Set,t=[];if("function"==typeof document.fonts?.check)for(const n of oe)document.fonts.check(`72px "${n}"`)?e.add(n):t.push(n);else t.push(...oe);const n=new Set;if(t.length>0){const e=document.createElement("div");e.style.cssText="position:absolute;visibility:hidden;top:-9999px;left:-9999px;pointer-events:none;";const o=re.map(t=>{const n=document.createElement("span");return n.style.cssText=`font-size:72px;font-family:${t};white-space:nowrap;display:inline-block`,n.textContent=ie,e.appendChild(n),n}),r=t.map(t=>re.map(n=>{const o=document.createElement("span");return o.style.cssText=`font-size:72px;font-family:'${t}',${n};white-space:nowrap;display:inline-block`,o.textContent=ie,e.appendChild(o),o}));document.body.appendChild(e);const i=o.map(e=>e.getBoundingClientRect().width),a=r.map(e=>e.map(e=>e.getBoundingClientRect().width));document.body.removeChild(e);for(let e=0;e<t.length;e++)for(let o=0;o<re.length;o++)if(a[e][o]!==i[o]){n.add(t[e]);break}}return{available:oe.filter(t=>e.has(t)||n.has(t)),method:"css-layout"}}catch{return{available:[],method:"css-layout"}}}());"undefined"!=typeof requestIdleCallback?requestIdleCallback(t,{timeout:2e3}):setTimeout(t,0)})},ce={name:"webrtc",tier:2,async collect(){if("undefined"==typeof RTCPeerConnection)return{supported:!1,audioCodecCount:0,videoCodecCount:0,audioCodecs:[],videoCodecs:[],extensions:[]};const e=new RTCPeerConnection({iceServers:[]});try{e.addTransceiver("audio"),e.addTransceiver("video");const t=(await e.createOffer()).sdp??"",n=se(t,"audio"),o=se(t,"video"),r=function(e){const t=new Set,n=e.split("\r\n");for(const e of n)if(e.startsWith("a=extmap:")){const n=e.match(/^a=extmap:\d+(?:\/\w+)?\s+(.+)$/);n&&t.add(n[1].trim())}return Array.from(t)}(t);return{supported:!0,audioCodecCount:n.length,videoCodecCount:o.length,audioCodecs:n.sort(),videoCodecs:o.sort(),extensions:r.sort()}}finally{e.close()}}};function se(e,t){const n=[],o=e.split("\r\n");let r=!1;for(const e of o)if(e.startsWith(`m=${t}`))r=!0;else{if(e.startsWith("m=")&&r)break;if(r&&e.startsWith("a=rtpmap:")){const t=e.match(/^a=rtpmap:\d+\s+(.+)$/);t&&n.push(t[1])}}return n}const ue=["accelerometer","accessibility-events","ambient-light-sensor","background-fetch","background-sync","bluetooth","camera","clipboard-read","clipboard-write","display-capture","geolocation","gyroscope","local-fonts","magnetometer","microphone","midi","nfc","notifications","payment-handler","persistent-storage","push","screen-wake-lock","speaker-selection","storage-access","top-level-storage-access","window-management","xr-spatial-tracking"],le={name:"permissions",tier:2,async collect(){if(!navigator.permissions?.query)return{states:{}};const e=()=>Promise.allSettled(ue.map(async e=>{try{return{name:e,state:(await navigator.permissions.query({name:e})).state}}catch{return{name:e,state:"error"}}})),t=await Promise.all([e(),e(),e()]),n={};for(const e of t)for(const t of e)if("fulfilled"===t.status){const{name:e,state:o}=t.value;n[e]||(n[e]=[]),n[e].push(o)}const o={};for(const[e,t]of Object.entries(n))o[e]=de(t);return{states:o}}};function de(e){const t={};for(const n of e)t[n]=(t[n]??0)+1;let n=e[0],o=0;for(const[e,r]of Object.entries(t))r>o&&(n=e,o=r);return n}const fe={name:"speech",tier:2,async collect(){if("undefined"==typeof speechSynthesis)return{supported:!1,voiceCount:0,voices:[]};const e=await new Promise(e=>{const t=speechSynthesis.getVoices();if(t.length>0)return void e(t);const n=setTimeout(()=>e([]),800);speechSynthesis.addEventListener("voiceschanged",()=>{clearTimeout(n),e(speechSynthesis.getVoices())},{once:!0})}),t=e.map(e=>`${e.name}|${e.lang}|${e.localService}`).sort();return{supported:!0,voiceCount:e.length,voices:t}}},me=[{name:"prefers-contrast",values:["no-preference","more","less","custom"]},{name:"any-hover",values:["none","hover"]},{name:"any-pointer",values:["none","coarse","fine"]},{name:"pointer",values:["none","coarse","fine"]},{name:"hover",values:["none","hover"]},{name:"update",values:["none","slow","fast"]},{name:"inverted-colors",values:["none","inverted"]},{name:"prefers-reduced-motion",values:["no-preference","reduce"]},{name:"prefers-reduced-transparency",values:["no-preference","reduce"]},{name:"scripting",values:["none","initial-only","enabled"]},{name:"forced-colors",values:["none","active"]},{name:"prefers-color-scheme",values:["light","dark"]},{name:"color-gamut",values:["srgb","p3","rec2020"]},{name:"dynamic-range",values:["standard","high"]}],pe={name:"mediaQueries",tier:2,async collect(){if("function"!=typeof matchMedia){const e={};for(const t of me)e[t.name.replace(/-([a-z])/g,(e,t)=>t.toUpperCase())]="unsupported";return{...e,monochrome:0}}const e={};for(const t of me){let n="unknown";for(const e of t.values){const o=matchMedia(`(${t.name}: ${e})`);if(o?.matches){n=e;break}}e[t.name.replace(/-([a-z])/g,(e,t)=>t.toUpperCase())]=n}let t=0;for(let e=100;e>=0;e--)if(matchMedia(`(monochrome: ${e})`)?.matches){t=e;break}return{...e,monochrome:t}}},he={name:"applePay",tier:2,async collect(){const e=window.ApplePaySession;if(!e||"function"!=typeof e.supportsVersion)return{supported:!1,maxVersion:0};let t=0;for(let n=15;n>=1;n--)try{if(e.supportsVersion(n)){t=n;break}}catch{continue}return{supported:!0,maxVersion:t}}},ye=["KeyQ","KeyW","KeyA","KeyS","KeyZ","KeyX","KeyY","KeyM","Semicolon","BracketLeft","Quote","Digit1","Digit2","Digit3"],ge={name:"keyboard",tier:2,async collect(){const e=navigator.keyboard;if(!e||"function"!=typeof e.getLayoutMap)return{supported:!1,layoutKeys:null,layoutHint:null};try{const t=await e.getLayoutMap(),n={};for(const e of ye){const o=t.get(e);void 0!==o&&(n[e]=o)}return{supported:!0,layoutKeys:n,layoutHint:ve(n)}}catch{return{supported:!1,layoutKeys:null,layoutHint:null}}}};function ve(e){const t=e.KeyQ,n=e.KeyZ,o=e.KeyY;return t?"a"===t?"azerty":"q"===t&&"z"===o?"qwertz":"q"===t&&"z"===n?"qwerty":"'"===t?"dvorak":"other":null}const we={name:"canvas",tier:2,async collect(){const e=document.createElement("canvas"),t=e.getContext("2d");if(!t)return null;e.width=240,e.height=120,t.textBaseline="alphabetic",t.fillStyle="#f60",t.fillRect(100,1,62,20),t.fillStyle="#069",t.font='11pt "Times New Roman"',t.fillText("Cwm fjordbank gly"+String.fromCharCode(55357,56835),2,15),t.fillStyle="rgba(102,204,0,0.2)",t.font="18pt Arial",t.fillText("Cwm fjordbank gly"+String.fromCharCode(55357,56835),4,45);const n=e.toDataURL("image/png");t.clearRect(0,0,e.width,e.height),t.globalCompositeOperation="multiply",t.fillStyle="#f2f",t.beginPath(),t.arc(40,40,40,0,2*Math.PI),t.fill(),t.fillStyle="#2ff",t.beginPath(),t.arc(80,40,40,0,2*Math.PI),t.fill(),t.fillStyle="#ff2",t.beginPath(),t.arc(60,80,40,0,2*Math.PI),t.fill(),t.globalCompositeOperation="source-over",t.fillStyle="#f9c",t.beginPath(),t.arc(60,60,60,0,2*Math.PI),t.arc(60,60,20,0,2*Math.PI),t.fill("evenodd");const o=e.toDataURL("image/png");return{textDataUrl:n,geometryDataUrl:o,readbackAllowed:n.length>=1e3&&o.length>=1e3,windingRule:0===t.getImageData(60,60,1,1).data[3]}}},be={name:"audioOscillator",tier:2,async collect(){const e=window.OfflineAudioContext||window.webkitOfflineAudioContext;if(!e)return null;const t=new e(1,5e3,44100),n=t.createOscillator();n.type="triangle",n.frequency.value=1e4;const o=t.createDynamicsCompressor();o.threshold.value=-50,o.knee.value=40,o.ratio.value=12,o.attack.value=0,o.release.value=.25,n.connect(o),o.connect(t.destination),n.start(0);const r=(await t.startRendering()).getChannelData(0).slice(4500,5e3);let i=0;for(let e=0;e<r.length;e++)i+=Math.abs(r[e]);return{sampleSum:i,sampleCount:r.length}}},xe={name:"webglRender",tier:2,async collect(){const e=document.createElement("canvas");e.width=256,e.height=256;const t=e.getContext("webgl",{preserveDrawingBuffer:!0});if(!t)return null;try{const e="\n attribute vec2 position;\n attribute vec3 color;\n varying vec3 vColor;\n void main() {\n gl_Position = vec4(position, 0.0, 1.0);\n vColor = color;\n }\n ",n="\n precision mediump float;\n varying vec3 vColor;\n void main() {\n gl_FragColor = vec4(vColor, 1.0);\n }\n ",o=t.createShader(t.VERTEX_SHADER);t.shaderSource(o,e),t.compileShader(o);const r=t.createShader(t.FRAGMENT_SHADER);t.shaderSource(r,n),t.compileShader(r);const i=t.createProgram();t.attachShader(i,o),t.attachShader(i,r),t.linkProgram(i),t.useProgram(i);const a=new Float32Array([-.5,-.5,1,0,0,.5,-.5,0,1,0,0,.5,0,0,1]),c=t.createBuffer();t.bindBuffer(t.ARRAY_BUFFER,c),t.bufferData(t.ARRAY_BUFFER,a,t.STATIC_DRAW);const s=t.getAttribLocation(i,"position");t.enableVertexAttribArray(s),t.vertexAttribPointer(s,2,t.FLOAT,!1,20,0);const u=t.getAttribLocation(i,"color");t.enableVertexAttribArray(u),t.vertexAttribPointer(u,3,t.FLOAT,!1,20,8),t.clearColor(0,0,0,1),t.clear(t.COLOR_BUFFER_BIT),t.drawArrays(t.TRIANGLES,0,3),t.enable(t.BLEND),t.blendFunc(t.SRC_ALPHA,t.ONE_MINUS_SRC_ALPHA),t.drawArrays(t.TRIANGLES,0,3);const l=new Uint8Array(262144);t.readPixels(0,0,256,256,t.RGBA,t.UNSIGNED_BYTE,l);const d=function(e){let t=2166136261;for(let n=0;n<e.length;n++)t^=e[n],t=Math.imul(t,16777619);return(t>>>0).toString(16).padStart(8,"0")}(l);let f=!1;for(let e=0;e<l.length;e++)if(0!==l[e]){f=!0;break}return{pixelHash:d,readbackAllowed:f}}finally{t.getExtension("WEBGL_lose_context")?.loseContext()}}},_e=["14px Arial","14px Georgia","14px monospace"],Se={name:"canvasTextMetrics",tier:2,async collect(){const e=document.createElement("canvas").getContext("2d");if(!e)return null;const t=[];for(const n of _e){e.font=n;const o=e.measureText("Sphinx of black quartz, judge my vow. 0123456789");t.push({font:n,width:o.width,actualBoundingBoxAscent:o.actualBoundingBoxAscent??null,actualBoundingBoxDescent:o.actualBoundingBoxDescent??null,actualBoundingBoxLeft:o.actualBoundingBoxLeft??null,actualBoundingBoxRight:o.actualBoundingBoxRight??null,fontBoundingBoxAscent:o.fontBoundingBoxAscent??null,fontBoundingBoxDescent:o.fontBoundingBoxDescent??null})}return{metrics:t}}},Ce=["chrome","safari","__crWeb","__gCrWeb","yandex","__yb","__ybro","__firefox__","__edgeTrackingPreventionStatistics","webkit","oprt","samsungAr","ucweb","UCShellJava","puffinDevice"],ke={name:"vendorFlavors",tier:2,async collect(){const e=window,t=[];for(const n of Ce)void 0!==e[n]&&t.push(n);return t.sort(),{flavors:t}}},Me=[{key:"default",family:""},{key:"apple",family:"-apple-system, BlinkMacSystemFont"},{key:"serif",family:"serif"},{key:"sansSerif",family:"sans-serif"},{key:"monospace",family:"monospace"},{key:"systemUi",family:"system-ui"}],Pe={name:"fontPreferences",tier:2,async collect(){if("undefined"==typeof document||!document.body)return null;const e=document.createElement("div");e.style.cssText="position:absolute;visibility:hidden;top:-9999px";const t=Me.map(({family:t})=>{const n=document.createElement("span");return n.textContent="mmMwWLliI0fiflO&1",n.style.fontSize="72px",t&&(n.style.fontFamily=t),e.appendChild(n),n});document.body.appendChild(e);const n={};for(let e=0;e<Me.length;e++){const o=t[e].getBoundingClientRect().width;n[Me[e].key]=Math.round(1e3*o)/1e3}return document.body.removeChild(e),n}},Ae={name:"screenFrame",tier:2,async collect(){const e=screen,t=e.availTop??0,n=e.availLeft??0;return{top:t,right:screen.width-(e.availWidth??screen.width)-n,bottom:screen.height-(e.availHeight??screen.height)-t,left:n}}};function De(e){return/Not[ ;)\/]/i.test(e)}const Te={name:"clientHints",tier:2,async collect(){const e=navigator;if(!e.userAgentData)return null;const t=(e.userAgentData.brands??[]).filter(e=>!De(e.brand)),n=e.userAgentData.mobile??!1,o=e.userAgentData.platform??"",r=await e.userAgentData.getHighEntropyValues(["architecture","bitness","model","platformVersion","fullVersionList"]),i=(r.fullVersionList??[]).filter(e=>!De(e.brand));return{brands:t,mobile:n,platform:o,architecture:r.architecture??"",bitness:r.bitness??"",model:r.model??"",platformVersion:r.platformVersion??"",fullVersionList:i}}},Ie=[{name:"EasyList",selectors:[".ad-banner",".ad_banner","#ad-banner",".adsbygoogle",".ad-container"]},{name:"AdGuard Base",selectors:[".BannerAd",".ad-rotate","#ad-box",".ad-placement",".ad-zone"]},{name:"EasyPrivacy",selectors:["#tracking-pixel",".tracking",".analytics-tag","#beacon",".pixel-tracker"]},{name:"Fanboy Annoyances",selectors:["#newsletter-popup",".cookie-banner",".consent-dialog","#gdpr-notice",".subscribe-modal"]},{name:"AdGuard Tracking",selectors:[".tracker-frame","#analytics-beacon",".telemetry-pixel",".data-tracker","#stats-counter"]}],Be={name:"domBlockers",tier:2,async collect(){if("undefined"==typeof document||!document.body)return{activeFilters:[]};const e=[],t=[];try{for(const n of Ie){const o=[];for(const t of n.selectors){const n=document.createElement("div");t.startsWith("#")?n.id=t.slice(1):n.className=t.slice(1),document.body.appendChild(n),o.push(n),e.push(n)}t.push({name:n.name,elements:o})}await new Promise(e=>setTimeout(e,0));const n=[];for(const{name:e,elements:o}of t){let t=0;for(const e of o)null===e.offsetParent&&t++;t/o.length>.6&&n.push(e)}return{activeFilters:n}}catch{return{activeFilters:[]}}finally{for(const t of e)try{t.parentNode?.removeChild(t)}catch{}}}},Le={name:"privateClickMeasurement",tier:2,collect:async()=>({supported:"attributionSourceId"in document.createElement("a")})},Ee={name:"automationDetection",tier:2,async collect(){const e=!!navigator.webdriver,t=function(){const e=[];try{const t=Object.getOwnPropertyNames(document);for(const n of t)/^\$?cdc_/.test(n)&&e.push(n)}catch{}const t=[["_Selenium_IDE_Recorder",()=>"t"in window],["__webdriver_evaluate",()=>"o"in document],["__driver_evaluate",()=>"i"in document],["__puppeteer_evaluation_script__",()=>"u"in window],["__playwright__binding__",()=>"l"in window],["__pwInitScripts",()=>"m"in window],["callPhantom",()=>"callPhantom"in window],["_phantom",()=>"p"in window],["__nightmare",()=>"h"in window],["domAutomation",()=>"domAutomation"in window],["domAutomationController",()=>"domAutomationController"in window]];for(const[n,o]of t)try{o()&&e.push(n)}catch{}return e}(),n=await async function(){try{if("undefined"==typeof Proxy)return!1;let e=!1;const t={};return Object.setPrototypeOf(t,new Proxy(Object.create(null),{ownKeys:()=>(e=!0,[])})),console.groupEnd(t),await new Promise(e=>setTimeout(e,100)),e}catch{return!1}}(),o=await async function(){const e=[];try{0===navigator.plugins.length&&window.chrome&&e.push("no_plugins_with_chrome")}catch{}0!==window.outerWidth&&0!==window.outerHeight||e.push("zero_outer_dimensions"),0===screen.availHeight&&e.push("zero_avail_height");try{0===navigator.languages.length&&e.push("empty_languages")}catch{}try{window.chrome&&void 0===window.chrome?.runtime&&e.push("chrome_without_runtime")}catch{}try{"undefined"!=typeof Notification&&"denied"===Notification.permission&&"prompt"===(await navigator.permissions.query({name:"notifications"})).state&&e.push("notification_permission_contradiction")}catch{}return e}(),r=function(){let e=null;try{if(e=document.createElement("canvas").getContext("webgl"),!e)return!1;const t=e.getExtension("WEBGL_debug_renderer_info");if(!t)return!1;const n=e.getParameter(t.UNMASKED_RENDERER_WEBGL);if("string"!=typeof n)return!1;const o=["swiftshader","google swiftshader","llvmpipe","mesa","software rasterizer","microsoft basic render driver"],r=n.toLowerCase();return o.some(e=>r.includes(e))}catch{return!1}finally{if(e){const t=e.getExtension("WEBGL_lose_context");t&&t.loseContext()}}}();let i=0;return e&&(i+=30),t.length>0&&(i+=20),n&&(i+=25),o.length>=2&&(i+=15),r&&(i+=20),{webdriver:e,automationMarkers:t,cdpDetected:n,headlessIndicators:o,softwareRenderer:r,botScore:i}}},Oe={name:"agentDetection",tier:2,async collect(){const e=function(){const e=[];try{13===navigator.hardwareConcurrency&&e.push("unusual_core_count_13")}catch{}try{4===navigator.deviceMemory&&6===navigator.hardwareConcurrency&&e.push("manus_hardware_signature")}catch{}try{1280===screen.width&&1100===screen.height&&e.push("manus_resolution")}catch{}try{if("UTC"===Intl.DateTimeFormat().resolvedOptions().timeZone){const t=navigator.languages||[],n=["en-GB","pt-PT","is","is-IS"];t.some(e=>n.includes(e))||e.push("utc_timezone_mismatch")}}catch{}return e}(),t=function(){try{const e=navigator.userAgent||"",t=navigator.userAgentData?.platform,n=navigator.platform||"";let o="";if(/Windows/.test(e)?o="Windows":/Macintosh|Mac OS X/.test(e)?o="macOS":/Android/.test(e)?o="Android":/iPhone|iPad|iPod/.test(e)?o="iOS":/Linux/.test(e)&&(o="Linux"),t){const e=t.toLowerCase();if("linux"===e&&("macOS"===o||"Windows"===o))return!1;if("windows"===e&&"macOS"===o)return!1;if("macos"===e&&"Windows"===o)return!1}if(n){const e=n.toLowerCase();if(e.includes("linux")&&("macOS"===o||"Windows"===o))return!1;if(e.includes("win")&&"macOS"===o)return!1;if(e.includes("mac")&&"Windows"===o)return!1}return!0}catch{return!0}}(),n=function(){try{const e=Intl.DateTimeFormat().resolvedOptions().timeZone,t=(new Date).getTimezoneOffset();return"UTC"!==e||0===t}catch{return!0}}(),o=function(e,t){return e.includes("unusual_core_count_13")?"chatgpt":e.includes("manus_hardware_signature")&&e.includes("manus_resolution")?"manus":t?null:"operator"}(e,t);let r=0;return r+=25*e.length,t||(r+=30),o&&(r+=50),{fingerprintAnomalies:e,uaPlatformMatch:t,timezoneConsistent:n,detectedAgent:o,agentScore:r}}},Re={name:"tamperDetection",tier:2,async collect(){const e=function(){try{const e=navigator.userAgent||"",t=/Chrome\//.test(e)&&!/Edg\//.test(e),n=/Firefox\//.test(e)&&!/Chrome/.test(e),o="undefined"!=typeof CSS&&CSS.supports&&CSS.supports("-moz-appearance","none"),r=void 0!==window.chrome;return!(t&&o||n&&r)}catch{return!0}}(),t=function(){try{const e=Object.getOwnPropertyDescriptor(Navigator.prototype,"userAgent");if(!e)return!1;if(!e.get)return!1;const t=e.get.toString();return!!/\[native code\]/.test(t)}catch{return!0}}(),n=function(){try{const e=eval.toString().length;if(33!==e&&37!==e&&39!==e&&(e<20||e>60))return!1;try{if(1!==new(0,navigator.userAgent.constructor.constructor)("return 1")())return!1}catch{return!1}return!0}catch{return!0}}(),o=function(){const e=[];try{"v"in window&&e.push("multilogin")}catch{}try{void 0!==window.chrome&&0===navigator.plugins.length&&e.push("empty_plugins_chromium")}catch{}try{const t=window;if(t.safari){const n=t.safari.toString?.();n&&!/\[object Safari\]/.test(n)&&e.push("safari_object_spoofed")}}catch{}try{const t=navigator.userAgent||"",n=t.match(/Chrome\/(\d+)/);n&&parseInt(n[1],10)>=88&&/Macintosh/.test(t)&&void 0===window.BarcodeDetector&&e.push("missing_barcode_detector")}catch{}return e}(),r=function(){try{const e=((new Error).stack||"").split("\n").filter(e=>e.trim().length>0);for(const t of e){const e=t.trim();if("Error"!==e){if(/^\s*at\s/.test(e))return"chromium";if(/@/.test(e)&&!e.startsWith("at"))return/^\w+@/.test(e)?"gecko":"webkit"}}return"unknown"}catch{return"unknown"}}(),i=eval.toString().length;let a=0;if(e||(a+=30),t||(a+=25),n||(a+=20),a+=15*o.length,"unknown"!==r){const e=navigator.userAgent||"";("gecko"===r&&!/Firefox/.test(e)||"chromium"===r&&/Firefox/.test(e)&&!/Chrome/.test(e))&&(a+=10)}return{uaEngineConsistent:e,navigatorPropsNative:t,prototypeChainIntact:n,antiDetectMarkers:o,stackTraceFormat:r,evalLength:i,tamperScore:a}}},Fe={name:"vmDetection",tier:2,async collect(){const e=function(){const e=[];try{navigator.hardwareConcurrency<=2&&e.push("low_core_count")}catch{}try{const t=navigator.deviceMemory;"number"==typeof t&&t<=2&&e.push("low_memory")}catch{}try{screen.colorDepth<24&&e.push("low_color_depth")}catch{}try{screen.colorDepth!==screen.pixelDepth&&e.push("depth_mismatch")}catch{}return e}();let t="",n=null;try{if(n=document.createElement("canvas").getContext("webgl"),n){const e=n.getExtension("WEBGL_debug_renderer_info");e&&(t=n.getParameter(e.UNMASKED_RENDERER_WEBGL)||"")}}catch{}finally{if(n)try{const e=n.getExtension("WEBGL_lose_context");e&&e.loseContext()}catch{}}const o=function(e){if(!e)return[];const t=e.toLowerCase();return We.filter(e=>t.includes(e))}(t),r=function(e){if(!e)return!1;const t=e.toLowerCase();return $e.some(e=>t.includes(e))}(t);let i=0;return o.length>0?i=.9:r?i=.5:e.length>=3&&(i=.3),{isVM:o.length>0,vmRendererMatches:o,softwareRenderer:r,confidence:i,indicators:e}}},We=["virtualbox","vmware","svga3d","qemu","parallels","hyper-v","qxl","red hat","virtio","citrix"],$e=["swiftshader","google swiftshader","llvmpipe","mesa","software rasterizer","microsoft basic render driver","softpipe"],ze=[{label:"h264",contentType:'video/mp4; codecs="avc1.42E01E"',width:1920,height:1080,bitrate:5e6,framerate:30},{label:"vp8",contentType:'video/webm; codecs="vp8"',width:1920,height:1080,bitrate:5e6,framerate:30},{label:"vp9",contentType:'video/webm; codecs="vp09.00.10.08"',width:1920,height:1080,bitrate:5e6,framerate:30},{label:"av1",contentType:'video/mp4; codecs="av01.0.05M.08"',width:1920,height:1080,bitrate:5e6,framerate:30}],Ue=[{label:"aac",contentType:'audio/mp4; codecs="mp4a.40.2"',channels:"2",bitrate:128e3,samplerate:44100},{label:"opus",contentType:'audio/webm; codecs="opus"',channels:"2",bitrate:128e3,samplerate:48e3}],Ve=[S,M,P,T,B,$,z,U,V,j,G,H,J,Y,Q,Z,te,ne,ae,ce,le,fe,pe,he,ge,we,be,xe,Se,ke,Pe,Ae,Te,Be,Le,Ee,Oe,Re,Fe,{name:"devtoolsDetection",tier:2,collect:async()=>({dimensionDelta:function(){const e=window.outerHeight-window.innerHeight,t=window.outerWidth-window.innerWidth;return{heightDelta:e,widthDelta:t,likelyOpen:e>200||t>200}}(),consoleTimingAnomaly:function(){try{const e={};for(let t=0;t<1e3;t++)e[`key${t}`]=t;const t=performance.now();return console.log(e),performance.now()-t>1}catch{return!1}}(),consoleNative:function(){try{return/\[native code\]/.test(Function.prototype.toString.call(console.log))}catch{return!0}}()})},{name:"webApis",tier:2,async collect(){const e=navigator,t=window;return{credentials:void 0!==e.credentials,usb:void 0!==e.usb,bluetooth:void 0!==e.bluetooth,clipboard:void 0!==e.clipboard,serial:void 0!==e.serial,hid:void 0!==e.hid,xr:void 0!==e.xr,share:"function"==typeof e.share,wakeLock:void 0!==e.wakeLock,presentation:void 0!==e.presentation,mediaSession:void 0!==e.mediaSession,ink:void 0!==e.ink,virtualKeyboard:void 0!==e.virtualKeyboard,eyeDropper:void 0!==t.EyeDropper,getScreenDetails:"function"==typeof t.getScreenDetails,paymentRequest:void 0!==t.PaymentRequest,adoptedStyleSheets:void 0!==document.adoptedStyleSheets,cssHighlights:void 0!==t.CSS?.highlights}}},{name:"notificationState",tier:2,async collect(){const e="undefined"!=typeof Notification;return{supported:e,permission:e?Notification.permission:null}}},{name:"extendedLocale",tier:2,collect:async()=>({languages:Array.from(navigator.languages??[])})},{name:"privacyPrefs",tier:2,async collect(){const e=navigator;return{doNotTrack:navigator.doNotTrack??null,globalPrivacyControl:e.globalPrivacyControl??null}}},{name:"performanceContext",tier:2,async collect(){let e=null;try{const t=performance.getEntriesByType("navigation");t.length>0&&(e=t[0].nextHopProtocol||null)}catch{}let t=[];try{t=Array.from(PerformanceObserver.supportedEntryTypes??[])}catch{}return{nextHopProtocol:e,supportedEntryTypes:t}}},{name:"sensors",tier:2,async collect(){const e=window;return{deviceOrientation:void 0!==e.DeviceOrientationEvent,deviceMotion:void 0!==e.DeviceMotionEvent,gyroscope:void 0!==e.Gyroscope,accelerometer:void 0!==e.Accelerometer,ambientLightSensor:void 0!==e.AmbientLightSensor,absoluteOrientationSensor:void 0!==e.AbsoluteOrientationSensor,relativeOrientationSensor:void 0!==e.RelativeOrientationSensor}}},{name:"battery",tier:2,collect:async()=>({supported:"function"==typeof navigator.getBattery})},{name:"gamepads",tier:2,collect:async()=>({supported:"function"==typeof navigator.getGamepads})},{name:"storage",tier:2,async collect(){let e=null;try{navigator.storage?.estimate&&(e=(await navigator.storage.estimate()).quota??null)}catch{}let t=!1;try{t=void 0!==window.indexedDB}catch{}let n=!1;try{n=void 0!==window.localStorage}catch{}return{quota:e,indexedDB:t,localStorage:n,cacheApi:void 0!==window.caches}}},{name:"features",tier:2,async collect(){const e=window;return{isSecureContext:!!e.isSecureContext,webdriver:!!navigator.webdriver,crossOriginIsolated:!!e.crossOriginIsolated,sharedArrayBuffer:void 0!==e.SharedArrayBuffer,webAssembly:void 0!==e.WebAssembly,bigInt:void 0!==e.BigInt,offscreenCanvas:void 0!==e.OffscreenCanvas}}},{name:"screen",tier:2,async collect(){const e=window.visualViewport;return{availWidth:screen.availWidth??0,availHeight:screen.availHeight??0,devicePixelRatio:window.devicePixelRatio??1,orientationType:screen.orientation?.type??null,orientationAngle:screen.orientation?.angle??null,visualViewport:e?{width:e.width,height:e.height,offsetLeft:e.offsetLeft,offsetTop:e.offsetTop,scale:e.scale}:null}}},{name:"mediaCapabilities",tier:2,async collect(){if(!navigator.mediaCapabilities?.decodingInfo)return null;const e={},t=[...ze.map(e=>({label:e.label,config:{type:"file",video:{contentType:e.contentType,width:e.width,height:e.height,bitrate:e.bitrate,framerate:e.framerate}}})),...Ue.map(e=>({label:e.label,config:{type:"file",audio:{contentType:e.contentType,channels:e.channels,bitrate:e.bitrate,samplerate:e.samplerate}}}))];return await Promise.allSettled(t.map(async({label:t,config:n})=>{try{const o=await navigator.mediaCapabilities.decodingInfo(n);e[t]={supported:o.supported,smooth:o.smooth,powerEfficient:o.powerEfficient}}catch{e[t]=null}})),e}}];async function je(e){const n=function(e){return e?{exclude:e.exclude??o.exclude,include:e.include??o.include,timeout:e.timeout??o.timeout,stabilize:e.stabilize??o.stabilize,experimental:e.experimental??o.experimental,debug:e.debug??o.debug,salt:e.salt??o.salt}:{...o}}(e),s=u(),l=function(){try{return window.self!==window.top}catch{return!0}}();let d=!1;try{d=await async function(e){try{switch(e){case"chrome":case"edge":case"opera":default:return await async function(){if(!navigator.storage?.estimate)return!1;const{quota:e}=await navigator.storage.estimate();return void 0!==e&&e<4294967296}();case"brave":return await async function(){return!1}();case"safari":return await async function(){if(navigator.storage?.estimate){const{quota:e}=await navigator.storage.estimate();if(void 0!==e)return e<4294967296}try{return!!navigator.storage?.getDirectory&&(await navigator.storage.getDirectory(),!1)}catch(e){return"NotFoundError"===e?.name}}();case"firefox":return await async function(){if(!("serviceWorker"in navigator))return!0;try{return!!navigator.storage?.getDirectory&&(await navigator.storage.getDirectory(),!1)}catch(e){return"SecurityError"===e?.name}}()}}catch{return!1}}(s.name)}catch{}const f=function(e,t,n,o){const r=new Set;for(const i of e){if("private"===i&&!n)continue;if("iframe"===i&&!o)continue;const e=c[i];if(e)for(const n of e)if(!n.browsers||n.browsers.includes(t))for(const e of n.exclude)r.add(e)}return r}(n.stabilize,s.name,d,l),m=new Set(f);for(const e of n.exclude)m.add(e);for(const e of n.include)m.delete(e);const{components:p,errors:h}=await async function(e,t,n){const o={},r=[],i=Ve.filter(t=>!e.has(t.name)&&(n||3!==t.tier)),a=await Promise.allSettled(i.map(async e=>{const n=await(o=e.collect(),r=t,new Promise((e,t)=>{const n=setTimeout(()=>e(null),r);o.then(t=>{clearTimeout(n),e(t)},e=>{clearTimeout(n),t(e)})}));var o,r;return{name:e.name,value:n}}));for(let e=0;e<a.length;e++){const t=a[e],n=i[e].name;"fulfilled"===t.status&&null!==t.value.value?o[n]=t.value.value:"rejected"===t.status&&r.push({signal:n,error:String(t.reason?.message??t.reason)})}return{components:o,errors:r}}(m,n.timeout,n.experimental),y={_:t};for(const[e,t]of Object.entries(p))i.has(e)||a.has(e)||(y[e]=t);const g=_(y,n.salt),v={_:t};for(const[e,t]of Object.entries(p))r.has(e)||a.has(e)||(v[e]=t);const w=_(v,n.salt),b={hash:g,stableHash:w,components:{...p,_:t},timestamp:(new Date).toISOString(),version:t,isIncognito:d,errors:h};return n.debug&&(console.log("[fingerprint] components:",p),console.log("[fingerprint] hash:",g,"stableHash:",w),h.length>0&&console.warn("[fingerprint] errors:",h)),b}const Ge=new RegExp(["googlebot","bingbot","slurp","baiduspider","duckduckbot","yandex","sogou","exabot","ia_archiver","curl","wget","python-requests","python-urllib","axios","node-fetch","go-http-client","java/","libwww-perl","okhttp","apache-httpclient","http_request","httpie","headlesschrome","phantomjs","puppeteer","playwright","cypress","selenium","webdriver","electron","jsdom","vercel-screenshot","screenshot","prerender","lighthouse","chrome-lighthouse","pagespeed","gtmetrix","pingdom","nessus","nikto","sqlmap","burp","zap","qualys","openvas","nmap","masscan","facebookexternalhit","twitterbot","linkedinbot","whatsapp","telegrambot","slackbot","discordbot","bot","crawl","spider","scrape","fetch","scan"].join("|"),"i");function Ne(e){return!!e&&Ge.test(e)}const He=new Set(["__pre_auth__","anonymous","guest","undefined","null"]),qe="/__unshared/submit-fp",Ke="__unshared_email",Je="__unshared_fp",Xe="__unshared_last_submit",Ye="__unshared_device_id",Ze="__unshared_uid",Qe="__unshared_sid";function et(){if("undefined"!=typeof crypto&&crypto.randomUUID)return crypto.randomUUID();const e=new Uint8Array(16);crypto.getRandomValues(e),e[6]=15&e[6]|64,e[8]=63&e[8]|128;const t=Array.from(e).map(e=>e.toString(16).padStart(2,"0")).join("");return`${t.slice(0,8)}-${t.slice(8,12)}-${t.slice(12,16)}-${t.slice(16,20)}-${t.slice(20)}`}function tt(e){return new Promise(t=>setTimeout(t,e))}function nt(e){const t=Math.min(1e3*Math.pow(2,e-1),3e4),n=500*Math.random()-250;return Math.max(0,t+n)}function ot(e){if("undefined"==typeof document)return;const t=document.cookie.match(new RegExp(`(?:^|; )${e}=([^;]*)`));return t?decodeURIComponent(t[1]):void 0}function rt(e,t){"undefined"!=typeof document&&(document.cookie=`${e}=${encodeURIComponent(t)}; Path=/; SameSite=Lax`)}function it(e,t){if("undefined"!=typeof localStorage)try{localStorage.setItem(e,t)}catch{}}e.UnsharedBrowser=class{constructor(e={}){if(this.S="",e.baseUrl&&!function(e){try{return new URL(e),!0}catch{return!1}}(e.baseUrl))throw new Error('baseUrl must be a valid URL (e.g. "https://app.example.com")');let t,n;this.C=e.baseUrl?e.baseUrl.replace(/\/$/,""):"",this.k=e.maxRetries??3,this.M=e.timeout??3e4,this.P=e.includePathPrefix,this.A=e.skipPaths,this.D=e.sessionId,this.T=e.deviceId,this.S=function(e){if("undefined"!=typeof sessionStorage)try{return sessionStorage.getItem(e)??void 0}catch{return}}(Xe)??"";try{t=this.D?.()}catch{}this.I=t??ot(Qe)??et(),rt(Qe,this.I);try{n=this.T?.()}catch{}n?(this.B=n,it(Ye,n)):this.B=function(e){if("undefined"!=typeof localStorage)try{return localStorage.getItem(e)??void 0}catch{return}}(Ye)??"",this.L()}async init(e){try{if("undefined"!=typeof navigator&&Ne(navigator.userAgent))return;if("string"==typeof(t=e.userId)&&He.has(t))return void this.O;this.O=e.userId,this.R=e.emailAddress,"undefined"!=typeof sessionStorage&&sessionStorage.setItem(Ke,e.emailAddress),rt(Ze,e.userId);let n,o=this.F();o||(o=await this.collect(),this.W(o));try{n=this.T?.()}catch{}n?(this.B=n,it(Ye,n)):o.fingerprint_id&&(this.B=o.fingerprint_id,it(Ye,o.fingerprint_id)),this.$(o).catch(()=>{})}catch{}var t}onRouteChange(){try{if(!this.U())return;const e=this.F();if(!e)return;this.$(e).catch(()=>{})}catch{}}destroy(){try{"undefined"!=typeof sessionStorage&&(sessionStorage.removeItem(Ke),sessionStorage.removeItem(Je),sessionStorage.removeItem(Xe)),this.S="",e=Ze,"undefined"!=typeof document&&(document.cookie=`${e}=; Path=/; SameSite=Lax; Expires=Thu, 01 Jan 1970 00:00:00 GMT`),this.V&&"undefined"!=typeof document&&(document.removeEventListener("DOMContentLoaded",this.V),this.V=void 0),this.O=void 0,this.R=void 0}catch{}var e}async collect(e){const t=[...new Set(["timing","speech",...e?.exclude??[]])],n=await je({...e,exclude:t});return{fingerprint_id:n.stableHash,full_hash:n.hash,components:n.components,timestamp:n.timestamp,isIncognito:n.isIncognito,version:n.version}}async submitFingerprintEvent(e,t){try{const n=this.j(e,t),o=et(),r=`${this.C}${qe}`;return await this.G(r,JSON.stringify(n),o)}catch(e){return{success:!1,error:{code:"DELIVERY_FAILED",message:e instanceof Error?e.message:String(e)}}}}U(){if("undefined"!=typeof sessionStorage)return sessionStorage.getItem(Ke)??void 0}F(){if("undefined"==typeof sessionStorage)return;const e=sessionStorage.getItem(Je);if(e)try{return JSON.parse(e)}catch{return}}W(e){"undefined"!=typeof sessionStorage&&sessionStorage.setItem(Je,JSON.stringify(e))}N(){if("undefined"==typeof location)return!0;const e=location.pathname||"/";if(this.A)for(const t of this.A)if(e.startsWith(t))return!1;return!this.P||this.P.some(t=>e.startsWith(t))}async $(e){if("undefined"!=typeof navigator&&Ne(navigator.userAgent))return{success:!0};if(!this.N())return{success:!0};const t=this.R??this.U(),n=this.O??ot(Ze),o="undefined"!=typeof location?(location.pathname||"/")+(location.search||""):"/";if(n){const e=`${n}|${o}`;if(e===this.S)return{success:!0};this.S=e,function(e,t){if("undefined"!=typeof sessionStorage)try{sessionStorage.setItem(e,t)}catch{}}(Xe,e)}const r={hash:e.full_hash,stable_hash:e.fingerprint_id,collected_at:(new Date).toISOString(),is_incognito:e.isIncognito,components:e.components,version:e.version,session_id:this.I,event_type:o};n&&(r.user_id=n),t&&(r.email=t);const i=`${e.fingerprint_id}|${n??""}|${o}`,a=`${this.C}${qe}`;return this.G(a,JSON.stringify(r),i)}L(){"undefined"!=typeof document&&(this.V&&document.removeEventListener("DOMContentLoaded",this.V),this.V=()=>{if(!this.U())return;const e=this.F();e&&this.$(e).catch(()=>{})},document.addEventListener("DOMContentLoaded",this.V))}async G(e,t,n){const o=this.k+1;let r={success:!1,error:{code:"DELIVERY_FAILED",message:"Request failed"}};for(let i=1;i<=o;i++){i>1&&await tt(nt(i-1));const o=new AbortController,a=setTimeout(()=>o.abort(),this.M);try{const i=await fetch(e,{method:"POST",headers:{"Content-Type":"application/json","X-Idempotency-Key":n,"X-Session-Id":this.I,"X-Device-Id":this.B},body:t,signal:o.signal});if(clearTimeout(a),i.status>=500){r={success:!1,error:{code:"DELIVERY_FAILED",message:`Backend returned ${i.status}`}};continue}if(i.status>=400)return{success:!1,error:{code:"DELIVERY_FAILED",message:`Backend returned ${i.status}`}};const c=await i.text().catch(()=>"{}");let s;try{s=JSON.parse(c)}catch{s={}}return!1===s?.success?{success:!1,error:s.error??{code:"UPSTREAM_ERROR",message:"Upstream failed"}}:{success:!0,data:s?.data}}catch(e){clearTimeout(a),r={success:!1,error:{code:"DELIVERY_FAILED",message:e instanceof Error?e.message:String(e)}}}}return r}j(e,t){const n={hash:e.full_hash,stable_hash:e.fingerprint_id,collected_at:e.timestamp,is_incognito:e.isIncognito,components:e.components,version:e.version,session_id:this.I};n.user_id=t.userId,null!=t?.eventType&&(n.event_type=t.eventType);const o=this.R??this.U();return o&&(n.email=o),n}},e.createAxiosInterceptor=function(e){return t=>{if(403===t?.response?.status&&"account_flagged"===t?.response?.data?.error)try{e.onFlagged()}catch{}return Promise.reject(t)}},e.createFetchInterceptor=function(e,t){return async(...n)=>{const o=await e(...n);if(403===o.status){const e=o.clone();try{const n=await e.json();if("account_flagged"===n?.error)try{t.onFlagged()}catch{}}catch{}}return o}}});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "unshared-frontend-sdk",
3
- "version": "2.0.0",
3
+ "version": "2.0.1",
4
4
  "description": "Browser SDK for Unshared Labs — routes fingerprint events through the customer's own backend",
5
5
  "main": "dist/index.cjs",
6
6
  "module": "dist/index.mjs",
@@ -42,7 +42,7 @@
42
42
  "vitest": "^3.0.0"
43
43
  },
44
44
  "dependencies": {
45
- "unshared-fingerprint-lib": "1.3.1",
45
+ "unshared-fingerprint-lib": "1.3.3",
46
46
  "tslib": "^2.8.1"
47
47
  }
48
48
  }