@fingerly/web-js 0.1.0 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +47 -6
- package/dist/browser.global.js +1 -1
- package/dist/index.cjs +45 -158
- package/dist/index.d.cts +18 -13
- package/dist/index.d.ts +18 -13
- package/dist/index.js +42 -159
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -30,22 +30,63 @@ const fingerly = await load({ apiKey: 'fly_pk_production_…' })
|
|
|
30
30
|
fingerly.setConsent('granted')
|
|
31
31
|
|
|
32
32
|
// When the visitor does something worth protecting: sign-up, login, checkout.
|
|
33
|
-
const { requestId, visitorId,
|
|
33
|
+
const { requestId, visitorId, suspectLevel } = await fingerly.identify({ tag: 'login' })
|
|
34
34
|
```
|
|
35
35
|
|
|
36
36
|
Loading collects nothing and sends nothing. Consent defaults to `pending`, and
|
|
37
37
|
`identify()` rejects with a `ConsentError` until it is `granted`.
|
|
38
38
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
39
|
+
This package collects and sends. Everything about the score is decided on the
|
|
40
|
+
server, under the weights you set: `suspectLevel` is the band, and it is `null`
|
|
41
|
+
when absent (unscored, or hidden by the SDK key), which is not a clean result.
|
|
42
|
+
Send `requestId` to your server and read the signals and the full result there
|
|
43
|
+
with a secret key (see the server SDKs), rather than trusting what the page
|
|
44
|
+
reports: the page runs code the visitor controls and is not told which signals
|
|
45
|
+
fired.
|
|
46
|
+
|
|
47
|
+
## Serve it from your own site
|
|
48
|
+
|
|
49
|
+
Content blockers refuse requests to third-party hosts and to paths they know.
|
|
50
|
+
Create a proxy in the dashboard (**Integration > Proxy keys**), mount it at the
|
|
51
|
+
path it issued with one of the server SDKs or proxy templates, and point the
|
|
52
|
+
SDK at that path:
|
|
53
|
+
|
|
54
|
+
```ts
|
|
55
|
+
const fingerly = await load({
|
|
56
|
+
apiKey: 'fly_pk_production_…',
|
|
57
|
+
endpoints: '/k7x2qm4a',
|
|
58
|
+
consent: 'granted',
|
|
59
|
+
})
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
The path is used exactly as given, with nothing appended. An array of paths
|
|
63
|
+
or URLs is tried in order when one does not answer.
|
|
64
|
+
|
|
65
|
+
## Content Security Policy
|
|
66
|
+
|
|
67
|
+
With a first-party proxy the SDK needs nothing beyond what your page already
|
|
68
|
+
allows: `connect-src 'self'` covers the proxy path, and the script itself is
|
|
69
|
+
your own bundle or `script-src 'self'` for the script-tag build. Under a policy
|
|
70
|
+
without `'unsafe-eval'`, one check that compiles a string is refused by the
|
|
71
|
+
browser, once per page load; the SDK skips it and its sibling and carries on.
|
|
72
|
+
That refusal is reported to your `report-uri` or `report-to` endpoint if you
|
|
73
|
+
have one, as one `script-src` (`eval`) violation per page view.
|
|
74
|
+
|
|
75
|
+
Firefox prints two deprecation warnings while the SDK reads the graphics
|
|
76
|
+
renderer and the motion sensor. They come from the browser, change nothing
|
|
77
|
+
for the visitor, and are not errors.
|
|
42
78
|
|
|
43
79
|
## Errors
|
|
44
80
|
|
|
45
|
-
- `load()`
|
|
81
|
+
- `load()` rejects for a configuration mistake, such as a missing `apiKey`.
|
|
82
|
+
It never throws synchronously, so a misconfigured key cannot take the page
|
|
83
|
+
down with it.
|
|
46
84
|
- `identify()` rejects with a `ConsentError` while consent is not `granted`,
|
|
47
85
|
and with a `TransportError` when the request cannot be completed. Branch on
|
|
48
|
-
its `status` and `retryable`.
|
|
86
|
+
its `status` and `retryable`. When the server asks for patience (`429` or
|
|
87
|
+
`503` with `Retry-After`), `retryAfterMs` says how long; a wait of up to two
|
|
88
|
+
seconds is taken care of before the error would be raised. A retry reuses
|
|
89
|
+
the first attempt's idempotency key, so it is never counted twice.
|
|
49
90
|
|
|
50
91
|
## Without a bundler
|
|
51
92
|
|
package/dist/browser.global.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var Fingerly=(()=>{var G=Object.defineProperty;var ht=Object.getOwnPropertyDescriptor;var yt=Object.getOwnPropertyNames;var wt=Object.prototype.hasOwnProperty;var vt=(e,t)=>{for(var n in t)G(e,n,{get:t[n],enumerable:!0})},bt=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of yt(t))!wt.call(e,o)&&o!==n&&G(e,o,{get:()=>t[o],enumerable:!(r=ht(t,o))||r.enumerable});return e};var St=e=>bt(G({},"__esModule",{value:!0}),e);var Kn={};vt(Kn,{ConsentError:()=>I,FingerlyClient:()=>N,SOURCE:()=>u,TransportError:()=>b,browserSources:()=>U,inspectIntegrity:()=>P,load:()=>gt});var _t=["granted","pending","denied"];function Z(e){if(!_t.includes(e))throw new TypeError(`Fingerly consent must be 'granted', 'pending' or 'denied' (received ${JSON.stringify(e)})`)}var I=class extends Error{constructor(e){super(`Fingerly needs consent before it can identify this visitor (consent is ${e})`),this.state=e,this.name="ConsentError",this.code="consent_required"}},u={navigator:"navigator",userAgentData:"user_agent_data",languages:"languages",plugins:"plugins",vendor:"vendor",engine:"engine",math:"math",errors:"errors",screen:"screen",screenFrame:"screen_frame",colorGamut:"color_gamut",mediaQueries:"media_queries",canvas:"canvas",webgl:"webgl",webglExtensions:"webgl_extensions",audio:"audio",audioLatency:"audio_latency",fonts:"fonts",fontPreferences:"font_preferences",intl:"intl",timezone:"timezone",storage:"storage",storageQuota:"storage_quota",storageDurability:"storage_durability",hardware:"hardware",touch:"touch",sensors:"sensors",battery:"battery",mediaDevices:"media_devices",network:"network",speech:"speech",timing:"timing",permissions:"permissions",automation:"automation",shields:"shields",domBlockers:"dom_blockers"};function p(e,t){let n=e.sources[t];return n?.status==="ok"?n.value:void 0}function fe(e,t){return e.sources[t]?.status}function V(e,t){return fe(e,t)==="blocked"}function C(e,t=1){let n=e.reduce((o,a)=>o+a.weight,0)*t,r="low";return n>=2?r="high":n>=1.25&&(r="medium"),{value:n>=1,confidence:r,reasons:[...e].sort((o,a)=>a.weight-o.weight).map(o=>o.reason)}}function X(){return{value:!1,confidence:"low",reasons:[]}}var Et="20030107";function xt(e){let t=[],n=p(e,u.automation),r=p(e,u.navigator),o=p(e,u.permissions),a=p(e,u.engine),i=p(e,u.screen),s=e.integrity;if((n?.webdriver===!0||r?.webdriver===!0)&&t.push({reason:"navigator-webdriver-true",weight:1}),n?.cdp_artifacts&&n.cdp_artifacts.length>0&&t.push({reason:`cdp-artifacts-${n.cdp_artifacts.length}`,weight:1.2}),n?.distinctive_properties&&n.distinctive_properties.length>0&&t.push({reason:`automation-globals-${n.distinctive_properties.join(",")}`,weight:1}),s.patched_natives.length>0){let h=s.patched_natives.slice(0,3).join(",");t.push({reason:`patched-natives-${s.patched_natives.length}-${h}`,weight:Math.min(1.8,.9+.3*s.patched_natives.length)})}let c=s.lies.filter(h=>h.kind==="contradiction"),l=new Set(c.map(h=>h.id)),g=c.length-(l.has("engine-vs-error-shapes")&&l.has("user-agent-vs-error-shapes")?1:0);c.length>0&&t.push({reason:`signal-contradictions-${c.map(h=>h.id).join(",")}`,weight:Math.min(1.5,.5*g)});let y=s.lies.filter(h=>h.kind==="descriptor");return y.length>0&&t.push({reason:`redefined-properties-${y.map(h=>h.id).join(",")}`,weight:Math.min(1.4,.6*y.length)}),a?.agrees===!1&&t.push({reason:`engine-mismatch-claimed-${a.claimed}-observed-${a.observed}`,weight:1.3}),r?.product_sub!==void 0&&a?.observed==="chromium"&&r.product_sub!==Et&&t.push({reason:"product-sub-inconsistent",weight:.8}),o?.inconsistent===!0&&t.push({reason:"notification-permission-inconsistent",weight:1.1}),a?.observed==="chromium"&&r?.plugin_count===0&&r.max_touch_points===0&&t.push({reason:"chromium-desktop-with-no-plugins",weight:.7}),(i?.inner_width===0||i?.inner_height===0)&&t.push({reason:"zero-sized-viewport",weight:.8}),n?.window_external&&/Sequentum/i.test(n.window_external)&&t.push({reason:"window-external-sequentum",weight:1}),C(t)}var Tt=["swiftshader","llvmpipe","softpipe","mesa offscreen","android emulator","generic renderer","apple software renderer","microsoft basic render","virgl","vmware svga","virtualbox","parallels"];function Mt(e){if(!e)return;let t=e.toLowerCase();return Tt.find(n=>t.includes(n))}function kt(e){return e?/Android|iPhone|iPad|iPod|Mobile/i.test(e):!1}function Ct(e){let t=p(e,u.webgl),n=p(e,u.navigator),r=p(e,u.screen),o=p(e,u.touch),a=p(e,u.sensors);if(!t&&!n)return X();let i=[],s=kt(n?.user_agent),c=Mt(t?.unmasked_renderer??t?.renderer);return c&&i.push({reason:`software-renderer-${c.replace(/\s+/g,"-")}`,weight:s?1.5:.7}),s&&o?.max_touch_points===0&&i.push({reason:"mobile-ua-without-touch-points",weight:.9}),s&&o?.pointer_coarse===!1&&o.any_hover===!0&&i.push({reason:"mobile-ua-with-fine-pointer-and-hover",weight:.9}),s&&a?.device_motion===!1&&a.device_orientation===!1&&i.push({reason:"mobile-ua-without-motion-sensors",weight:.7}),s&&r?.device_pixel_ratio===1&&i.push({reason:"mobile-ua-with-dpr-1",weight:.6}),typeof n?.hardware_concurrency=="number"&&n.hardware_concurrency===1&&i.push({reason:"single-core-reported",weight:.4}),s&&r?.width===1080&&r.height===1920&&r.device_pixel_ratio===1&&i.push({reason:"emulator-default-screen-geometry",weight:.5}),C(i)}function Ot(e){let t=p(e,u.navigator),n=p(e,u.fonts),r=p(e,u.mediaDevices),o=p(e,u.webgl),a=p(e,u.screen),i=p(e,u.network);if(!t)return X();let s=[];n?.available&&n.probed&&n.probed>20&&n.available.length/n.probed<.15&&s.push({reason:"font-set-is-platform-default-only",weight:.7}),r&&r.audio_input===0&&r.video_input===0&&r.audio_output===0&&s.push({reason:"no-media-devices-attached",weight:.8});let c=o?.unmasked_renderer??o?.renderer;return c&&/^(generic|google|unknown)\b/i.test(c)&&s.push({reason:"generic-gpu-renderer",weight:.5}),i?.effective_type==="4g"&&i.rtt===0&&i.downlink===10&&s.push({reason:"synthetic-network-information",weight:.4}),t.languages?.length===1&&t.languages[0]==="en-US"&&a?.device_pixel_ratio===1&&s.push({reason:"untouched-locale-defaults",weight:.3}),C(s)}var D=2147483648,pe=10737418240;function Rt(e,t){return e-(t??0)===pe}var me=5;function At(e){let t=p(e,u.shields),n=p(e,u.storage),r=p(e,u.navigator),o=p(e,u.engine),a=p(e,u.canvas),i=[],s=o?.observed==="chromium";return t?.brave===!0&&i.push({reason:"brave-vendor-api",weight:.9}),t?.brave_claimed===!0&&i.push({reason:"brave-named-in-ua-ch-brands",weight:.5}),s&&n?.quota===D&&i.push({reason:"storage-quota-is-brave-constant",weight:1}),s&&typeof r?.plugin_count=="number"&&r.plugin_count>me&&i.push({reason:"plugin-list-padded",weight:.8}),a?.unstable===!0&&i.push({reason:"canvas-noised-per-read",weight:.9}),s&&fe(e,u.network)==="unsupported"&&i.push({reason:"network-information-api-absent",weight:.3}),C(i)}function Dt(e){let t=p(e,u.navigator),n=p(e,u.hardware),r=t?.device_memory??n?.device_memory;if(!(typeof r!="number"||r<=0))return It(e)?void 0:r}function It(e){let t=p(e,u.shields),n=p(e,u.storage),r=p(e,u.navigator),o=p(e,u.canvas);return t?.brave===!0||t?.brave_claimed===!0||t?.canvas_noise===!0||n?.quota===D||typeof r?.plugin_count=="number"&&r.plugin_count>me||o?.unstable===!0}var Nt=1073741824,Pt=.25,Lt=1073741824,Ut=1.3,Bt=5;function Ft(e){return e.quota!==D?e.quota:e.legacy_quota===D?void 0:e.legacy_quota}function Wt(e){let t=p(e,u.storage),n=p(e,u.engine),r=p(e,u.storageDurability);if(!t&&!r)return X();let o=[],a=n?.observed;if((t?.origin_filesystem==="transient"||t?.safari_private===!0)&&o.push({reason:"safari-private-origin-filesystem-refused",weight:1.4}),a==="gecko"&&t?.origin_filesystem==="refused"&&o.push({reason:"firefox-private-origin-filesystem-refused",weight:1.3}),a==="gecko"&&t?.service_worker===!1&&o.push({reason:"firefox-no-service-worker-registration",weight:1.2}),a==="chromium"){r?.honored===!0&&typeof r.ratio=="number"&&typeof r.rounds=="number"&&r.rounds>=Bt&&r.ratio<Ut&&o.push({reason:"chromium-indexeddb-writes-are-not-durable",weight:1.4});let i=t?Ft(t):void 0;if(typeof i=="number"&&!Rt(i,t?.usage)){t?.quota===D&&i<pe&&o.push({reason:"chromium-quota-below-static-pool",weight:1.3}),i<Nt&&o.push({reason:"chromium-storage-quota-capped",weight:1.3});let s=Dt(e);typeof s=="number"&&i/(s*Lt)<Pt&&o.push({reason:"chromium-storage-quota-ratio-capped",weight:1.3})}}return t?.local_storage===!1&&t?.session_storage===!1&&o.push({reason:"web-storage-unavailable",weight:.4}),t?.indexed_db===!1&&o.push({reason:"indexeddb-unavailable",weight:.3}),C(o)}var qt=100;function $t(e,t){return typeof e!="number"||typeof t!="number"||e<=0||t<=0?!1:e%200===0&&t%100===0}function Gt(e){let t=[],n=p(e,u.timing),r=p(e,u.intl),o=p(e,u.screen),a=p(e,u.navigator),i=p(e,u.canvas),s=p(e,u.engine);typeof n?.now_resolution=="number"&&n.now_resolution>=qt&&t.push({reason:"clock-resolution-clamped-to-100ms",weight:1.6}),r?.timezone==="UTC"&&r.timezone_offset===0&&t.push({reason:"timezone-forced-to-utc",weight:.7}),a?.language==="en-US"&&a.languages?.length===1&&t.push({reason:"locale-forced-to-en-us",weight:.5}),a?.hardware_concurrency===2&&t.push({reason:"hardware-concurrency-pinned-to-2",weight:.4}),(V(e,u.canvas)||i?.unstable===!0)&&t.push({reason:"canvas-readback-refused-or-noised",weight:.8}),V(e,u.audio)&&t.push({reason:"audio-readback-refused-or-noised",weight:.5}),$t(o?.inner_width,o?.inner_height)&&t.push({reason:"viewport-letterboxed-to-200x100-grid",weight:.5}),V(e,u.fonts)&&t.push({reason:"font-enumeration-restricted",weight:.5});let c=s?.observed!==void 0&&s.observed!=="gecko";return c&&t.length>0&&t.push({reason:"rfp-tells-on-non-gecko-engine",weight:0}),C(t,c?.35:1)}function ee(e){return{incognito:Wt(e),shields:At(e),tor:Gt(e),emulator:Ct(e),automation:xt(e),farm:Ot(e)}}var f=class extends Error{constructor(e){super(e??"unsupported"),this.reason=e,this.name="UnsupportedSignal"}},E=class extends Error{constructor(e){super(e??"blocked"),this.reason=e,this.name="BlockedSignal"}},R=class extends Error{constructor(e){super(e??"timeout"),this.reason=e,this.name="TimedOutSignal"}};function Vt(e){if(e instanceof f||e instanceof E||e instanceof R)return e.reason;if(e instanceof Error&&typeof e.name=="string"&&e.name!=="Error")return e.name}var x=typeof globalThis.performance?.now=="function"?()=>globalThis.performance.now():()=>Date.now(),H={budgetMs:1200,defaultSourceTimeoutMs:300,concurrency:6};function F(e){return Math.max(0,Math.round(e))}function Ht(e){return e instanceof f?"unsupported":e instanceof E?"blocked":e instanceof R?"timeout":"error"}async function jt(e,t,n,r,o){let a=x(),i=t-a;if(i<=0)return{status:"timeout",ms:0,reason:"budget-exhausted"};let s=Math.min(e.timeoutMs??n,i),c=new AbortController,l=()=>c.abort(new R("aborted"));r?.addEventListener("abort",l,{once:!0});let g=setTimeout(()=>c.abort(new R("source-timeout")),s),y={signal:c.signal,budgetRemainingMs:()=>Math.max(0,t-x()),completed:h=>o[h]};try{let h=await Promise.race([(async()=>e.run(y))(),new Promise((w,_)=>{c.signal.addEventListener("abort",()=>_(c.signal.reason??new R("source-timeout")),{once:!0})})]);return{status:"ok",ms:F(x()-a),value:h}}catch(h){let w=Ht(h),_=Vt(h);return _===void 0?{status:w,ms:F(x()-a)}:{status:w,ms:F(x()-a),reason:_}}finally{clearTimeout(g),r?.removeEventListener("abort",l)}}async function Xt(e,t={}){let n=t.budgetMs??H.budgetMs,r=t.defaultSourceTimeoutMs??H.defaultSourceTimeoutMs,o=Math.max(1,t.concurrency??H.concurrency),a=t.tiers??["fast","deferred"],i=x(),s=i+n,c={},l={...t.completed??{}},g=!1;for(let y of a){let h=e.filter(T=>T.tier===y);if(h.length===0)continue;let w=0,_=async()=>{for(;w<h.length;){let T=h[w++];if(!T)continue;if(x()>=s||t.signal?.aborted){g=!0,c[T.id]={status:"timeout",ms:0,reason:"budget-exhausted"};continue}let $=await jt(T,s,r,t.signal,l);$.status==="timeout"&&(g=!0),c[T.id]=$,l[T.id]=$}};await Promise.all(Array.from({length:Math.min(o,h.length)},_))}return{outcomes:c,elapsedMs:F(x()-i),truncated:g}}function zt(e="v1"){if(!/^v[1-9]\d*$/.test(e)||e.trim()!==e)throw new TypeError('apiVersion must be a version such as "v1" or "v2"');return e}var Qt="https://api.fingerly.io",te="x-api-key",Kt="Idempotency-Key",b=class extends Error{constructor(e,t,n=!1,r){super(e),this.status=t,this.retryable=n,this.code=r,this.name="TransportError"}};async function ne(e){try{let n=(await e.json())?.error?.code;return typeof n=="string"&&n!==""?n:void 0}catch{return}}function re(e,t){return new b(`The server refused the submission (${e.status})`,e.status,Yt(e.status),t)}function Yt(e){return e===404||e===405||e===408||e===425||e===429||e>=500&&e<=599}function ge(e,t){return`${e}/api/${t}/ingest`}function j(e){return ge(Qt,e)}function Jt(e,t){let n=e.trim().replace(/\/+$/,"");if(n===""||n.includes("?")||n.includes("#"))throw new TypeError("A Fingerly endpoint must be a non-empty URL or path without a query or fragment");if(!(n.startsWith("/")||/^https?:\/\//i.test(n)))throw new TypeError("A Fingerly endpoint must be an absolute URL or a root-relative browser path");return/^https?:\/\/[^/]+$/i.test(n)?ge(n,t):n}function oe(e,t){let n=Math.min(2e3,100*2**(e-1));return Math.floor(t()*n)}function Zt(){let e=globalThis.crypto;if(typeof e?.randomUUID=="function")return e.randomUUID();if(typeof e?.getRandomValues=="function"){let t=e.getRandomValues(new Uint8Array(16));t[6]=(t[6]??0)&15|64,t[8]=(t[8]??0)&63|128;let n=Array.from(t,r=>r.toString(16).padStart(2,"0")).join("");return`${n.slice(0,8)}-${n.slice(8,12)}-${n.slice(12,16)}-${n.slice(16,20)}-${n.slice(20)}`}return`fingerly-${Date.now().toString(36)}-${Math.random().toString(36).slice(2)}-${Math.random().toString(36).slice(2)}`}var en=class{constructor(e){if(!e.apiKey)throw new b("An SDK key is required to submit a fingerprint");if(e.endpoint!==void 0&&e.endpoints!==void 0)throw new TypeError("Pass endpoints or the deprecated endpoint option, not both");this.apiKey=e.apiKey;let t=zt(e.apiVersion),n=e.endpoints??e.endpoint,r=n===void 0?[j(t)]:Array.isArray(n)?[...n]:[n];if(r.length===0)throw new TypeError("The endpoints array must not be empty");let o=r.map(i=>Jt(i,t));n!==void 0&&e.fallbackToDefaultEndpoint&&(o.includes(j(t))||o.push(j(t))),this.urls=o,this.maxAttempts=Math.max(1,this.urls.length,e.maxAttempts??3),this.requestTimeoutMs=e.requestTimeoutMs??5e3;let a=e.fetchImpl??globalThis.fetch;if(typeof a!="function")throw new b("No fetch implementation is available; pass one as fetchImpl");this.fetchImpl=a.bind(globalThis)}async submit(e,t){let n,r=JSON.stringify(e),o=Zt(),a=0;for(let i=1;i<=this.maxAttempts;i++){if(t?.aborted)throw new b("The submission was cancelled");try{return await this.attempt(this.urls[a],r,o,t)}catch(s){let c=s instanceof b?s:new b(s instanceof Error?s.message:"The submission could not be sent",void 0,!0);if(!c.retryable||i===this.maxAttempts)throw c;n=c,a=Math.min(a+1,this.urls.length-1),await new Promise(l=>setTimeout(l,oe(i,Math.random)))}}throw n??new b("The submission could not be sent")}async submitSupplement(e,t,n){let r=JSON.stringify(t),o,a=0;for(let i=1;i<=this.maxAttempts;i++){if(n?.aborted)throw new b("The supplement was cancelled");try{await this.postJSON(this.urls[a],r,n);return}catch(s){let c=s instanceof b?s:new b(s instanceof Error?s.message:"The supplement could not be sent",void 0,!0);if(!c.retryable||i===this.maxAttempts)throw c;o=c,a=Math.min(a+1,this.urls.length-1),await new Promise(l=>setTimeout(l,oe(i,Math.random)))}}throw o??new b("The supplement could not be sent")}async postJSON(e,t,n){let r=new AbortController,o=()=>r.abort();n?.addEventListener("abort",o,{once:!0});let a=setTimeout(o,this.requestTimeoutMs);try{let i=await this.fetchImpl(e,{method:"POST",headers:{"content-type":"application/json",[te]:this.apiKey},body:t,credentials:"omit",signal:r.signal});if(!i.ok)throw re(i,await ne(i));return i}finally{clearTimeout(a),n?.removeEventListener("abort",o)}}async attempt(e,t,n,r){let o=new AbortController,a=()=>o.abort();r?.addEventListener("abort",a,{once:!0});let i=setTimeout(a,this.requestTimeoutMs);try{let s=await this.fetchImpl(e,{method:"POST",headers:{"content-type":"application/json",[te]:this.apiKey,[Kt]:n},body:t,credentials:"omit",signal:o.signal});if(!s.ok)throw re(s,await ne(s));let c=await s.json();if(typeof c?.request_id!="string"||c.request_id==="")throw new b("The server accepted the submission but returned no request_id");return c}finally{clearTimeout(i),r?.removeEventListener("abort",a)}}},ie="0.1.0",tn=1;function ae(e){return e instanceof b&&e.code==="consent_required"?new I("pending"):e}var se={patched_natives:[],lies:[],engine:{}},N=class{constructor(e){this.consentListeners=new Set;let t=e.consent??"pending";Z(t),this.consentState=t,this.options=e,this.platform=e.platform??"web",this.transport=e.transport??new en({...e.apiVersion===void 0?{}:{apiVersion:e.apiVersion},apiKey:e.apiKey,...e.endpoint===void 0?{}:{endpoint:e.endpoint},...e.endpoints===void 0?{}:{endpoints:e.endpoints},...e.fallbackToDefaultEndpoint===void 0?{}:{fallbackToDefaultEndpoint:e.fallbackToDefaultEndpoint}})}get consent(){return this.consentState}setConsent(e){if(Z(e),e!==this.consentState){this.consentState=e;for(let t of[...this.consentListeners])try{t(e)}catch(n){setTimeout(()=>{throw n},0)}}}onConsentChange(e){return this.consentListeners.add(e),()=>{this.consentListeners.delete(e)}}requireConsent(){if(this.consentState!=="granted")throw new I(this.consentState)}consentScope(e){let t=new AbortController,n=()=>t.abort();e?.aborted?n():e?.addEventListener("abort",n,{once:!0});let r=this.onConsentChange(o=>{o!=="granted"&&n()});return{signal:t.signal,close:()=>{r(),e?.removeEventListener("abort",n)}}}async identify(e={}){this.requireConsent();let t=this.consentScope(e.signal);try{return await this.identifyWithConsent(e,t.signal)}finally{t.close()}}async identifyWithConsent(e,t){let n=e.submit!==!1&&e.tiers===void 0,r=await this.collectReport(n?["fast"]:e.tiers??["fast","deferred"],t,n?300:void 0);this.requireConsent();let o=ee(r);if(e.submit===!1)return{requestId:"",visitorId:"",visitorIsNew:!1,visitorConfidence:0,identifiable:!1,duplicate:!1,state:"",reason:"not-submitted",suspectScore:null,suspectLevel:null,triggers:[],verdicts:o,report:r,deferred:Promise.resolve({status:"skipped",reason:"not-submitted"})};let a={sdk:{platform:this.platform,version:ie},consent:this.consentState,signals:r,...e.tag===void 0?{}:{tag:e.tag}},i;try{i=await this.transport.submit(a,t)}catch(c){throw this.requireConsent(),ae(c)}let s={requestId:i.request_id,visitorId:i.visitor_id??"",visitorIsNew:i.visitor_is_new??!1,visitorConfidence:i.visitor_confidence??0,identifiable:i.identifiable??!1,duplicate:i.duplicate??!1,state:i.state??"",reason:i.reason??"",suspectScore:i.suspect_score??null,suspectLevel:i.suspect_level??null,triggers:(i.triggers??[]).map(c=>({signal:c.signal,group:c.group??"",weight:c.weight,confidence:c.confidence??"",reason:c.reason??""})),verdicts:o,report:r,deferred:Promise.resolve({status:"skipped",reason:"explicit-tiers"})};return n?i.duplicate||!i.deferred_token?(s.deferred=Promise.resolve({status:"skipped",reason:i.duplicate?"duplicate":"unsupported-transport"}),s):typeof this.transport.submitSupplement!="function"?(s.deferred=Promise.resolve({status:"skipped",reason:"unsupported-transport"}),s):(s.deferred=this.finishDeferred(r,i.request_id,i.deferred_token,e.signal),s):s}async finishDeferred(e,t,n,r){let o={status:"skipped",reason:"consent-withdrawn"};if(this.consentState!=="granted")return o;let a=this.consentScope(r),i,s,c;try{if(i=await this.collectReport(["deferred"],a.signal,1200,e.sources),this.consentState!=="granted")return o;s={schema:e.schema,budget_ms:e.budget_ms+i.budget_ms,elapsed_ms:e.elapsed_ms+i.elapsed_ms,tiers:["fast","deferred"],sources:{...e.sources,...i.sources},integrity:this.options.integrity?this.options.integrity({sources:{...e.sources,...i.sources}}):se},c=ee(s);let l={sdk:{platform:this.platform,version:ie},consent:this.consentState,signals:i,token:n};return await this.transport.submitSupplement(t,l,a.signal),{status:"submitted",report:i,combinedReport:s,verdicts:c}}catch(l){if(this.consentState!=="granted")return o;let g=ae(l);return{status:"failed",error:g instanceof Error?g:new Error(String(g)),...i===void 0?{}:{report:i},...s===void 0?{}:{combinedReport:s},...c===void 0?{}:{verdicts:c}}}finally{a.close()}}async collect(e={}){this.requireConsent();let t=e.tiers??["fast","deferred"],n=this.consentScope(e.signal);try{let r=await this.collectReport(t,n.signal);return this.requireConsent(),r}finally{n.close()}}async collectReport(e,t,n,r){let o=this.options.sources??[],a={...this.options.schedule,tiers:e,...n===void 0?{}:{budgetMs:n},...t===void 0?{}:{signal:t},...r===void 0?{}:{completed:r}},i=await Xt(o,a),s=this.options.integrity?this.options.integrity({sources:i.outcomes}):se;return{schema:tn,budget_ms:a.budgetMs??1200,elapsed_ms:i.elapsedMs,tiers:e,sources:i.outcomes,integrity:s}}};var A=2654435761,W=2246822519,ce=3266489917,nn=668265263,ue=374761393;function M(e,t){return e<<t|e>>>32-t}function B(e,t){return Math.imul(M(e+Math.imul(t,W)|0,13),A)}function O(e,t){return((e[t]??0)|(e[t+1]??0)<<8|(e[t+2]??0)<<16|(e[t+3]??0)<<24)>>>0}function rn(e){if(typeof TextEncoder<"u")return new TextEncoder().encode(e);let t=[];for(let n=0;n<e.length;n++){let r=e.charCodeAt(n);if(r>=55296&&r<=56319&&n+1<e.length){let o=e.charCodeAt(n+1);o>=56320&&o<=57343&&(r=(r-55296)*1024+(o-56320)+65536,n++)}r<128?t.push(r):r<2048?t.push(192|r>>6,128|r&63):r<65536?t.push(224|r>>12,128|r>>6&63,128|r&63):t.push(240|r>>18,128|r>>12&63,128|r>>6&63,128|r&63)}return new Uint8Array(t)}function de(e,t){let n=e.length,r=0,o;if(n>=16){let a=t+A+W|0,i=t+W|0,s=t|0,c=t-A|0,l=n-16;do a=B(a,O(e,r)),i=B(i,O(e,r+4)),s=B(s,O(e,r+8)),c=B(c,O(e,r+12)),r+=16;while(r<=l);o=M(a,1)+M(i,7)+M(s,12)+M(c,18)|0}else o=t+ue|0;for(o=o+n|0;r+4<=n;)o=Math.imul(M(o+Math.imul(O(e,r),ce)|0,17),nn),r+=4;for(;r<n;)o=Math.imul(M(o+Math.imul(e[r]??0,ue)|0,11),A),r++;return o^=o>>>15,o=Math.imul(o,W),o^=o>>>13,o=Math.imul(o,ce),o^=o>>>16,o>>>0}function le(e){return e.toString(16).padStart(8,"0")}function k(e){let t=typeof e=="string"?rn(e):e;return le(de(t,0))+le(de(t,A))}function m(e){let t={};for(let[n,r]of Object.entries(e))r!==void 0&&(t[n]=r);return t}function d(e){try{return e()}catch{return}}function z(){return typeof window>"u"?void 0:window}function v(){let e=z();if(!e)throw new f("no-window");return e}function he(e){throw e instanceof Error&&(e.name==="SecurityError"||e.name==="NotAllowedError"||e.name==="NotSupportedError")?new E(e.name):e}function on(e){return{schema:1,budget_ms:0,elapsed_ms:0,tiers:[],sources:e,integrity:{patched_natives:[],lies:[],engine:{}}}}function an(e){if(e){if(/Windows NT/i.test(e))return"windows";if(/Android/i.test(e))return"android";if(/iPhone|iPad|iPod/i.test(e))return"ios";if(/Mac OS X/i.test(e))return"macos";if(/Linux/i.test(e))return"linux"}}function sn(e){if(!e)return;let t=e.toLowerCase();if(t.includes("direct3d")||t.includes("d3d11")||t.includes("d3d9"))return"windows";if(t.includes("metal")||t.includes("apple"))return"apple";if(t.includes("adreno")||t.includes("mali")||t.includes("powervr"))return"mobile"}function ye(e){let t=on(e),n=[],r=p(t,u.navigator),o=p(t,u.engine),a=p(t,u.errors),i=p(t,u.math),s=p(t,u.webgl),c=p(t,u.touch),l=p(t,u.screen);o?.agrees===!1&&n.push({id:"user-agent-vs-engine",kind:"contradiction",detail:`claimed-${o.claimed}-observed-${o.observed}`}),a?.observed&&o?.observed&&a.observed!==o.observed&&n.push({id:"engine-vs-error-shapes",kind:"contradiction",detail:`engine-${o.observed}-errors-${a.observed}`});let g=o?.claimed;a?.observed&&g&&a.observed!==g&&n.push({id:"user-agent-vs-error-shapes",kind:"contradiction",detail:`claimed-${g}-errors-${a.observed}`}),i?.identities_hold===!1&&n.push({id:"math-identities",kind:"contradiction",detail:"math-builtins-do-not-hold-exact-identities"});let y=an(r?.user_agent),h=sn(s?.unmasked_renderer??s?.renderer);if(y&&h&&(h==="windows"&&y==="windows"||h==="apple"&&(y==="macos"||y==="ios")||h==="mobile"&&(y==="android"||y==="ios")||n.push({id:"user-agent-vs-gpu",kind:"contradiction",detail:`os-${y}-gpu-${h}`})),r?.platform&&y){let w=r.platform.toLowerCase();y==="windows"&&w.startsWith("win")||y==="macos"&&w.startsWith("mac")||y==="ios"&&(w.startsWith("iphone")||w.startsWith("ipad")||w.startsWith("mac"))||y==="android"&&(w.startsWith("linux")||w.startsWith("android"))||y==="linux"&&w.startsWith("linux")||n.push({id:"user-agent-vs-platform",kind:"contradiction",detail:`os-${y}-platform-${r.platform}`})}if(c){let w=c.max_touch_points;typeof w=="number"&&w>0&&c.pointer_coarse===!1&&c.any_hover===!0&&n.push({id:"touch-points-vs-pointer-media",kind:"contradiction",detail:"touch-claimed-with-fine-pointer-and-hover"}),c.touch_event===!0&&typeof w=="number"&&w===0&&n.push({id:"touch-event-vs-touch-points",kind:"contradiction",detail:"ontouchstart-present-with-zero-points"})}return typeof l?.inner_width=="number"&&typeof l.width=="number"&&l.width>0&&l.inner_width>l.width&&n.push({id:"viewport-larger-than-screen",kind:"contradiction",detail:`inner-${l.inner_width}-screen-${l.width}`}),r?.product_sub!==void 0&&(o?.observed==="chromium"||o?.observed==="webkit")&&r.product_sub!=="20030107"&&n.push({id:"product-sub",kind:"contradiction",detail:`expected-20030107-got-${r.product_sub}`}),r?.language&&r.languages&&r.languages.length>0&&r.languages[0]!==r.language&&n.push({id:"language-vs-languages",kind:"contradiction",detail:`language-${r.language}-languages-${r.languages[0]}`}),n}var cn=/\{\s*\[native code\]\s*\}\s*$/,un=[["navigator","webdriver"],["navigator","userAgent"],["navigator","platform"],["navigator","plugins"],["navigator","mimeTypes"],["navigator","languages"],["navigator","language"],["navigator","hardwareConcurrency"],["navigator","deviceMemory"],["navigator","maxTouchPoints"],["navigator","vendor"],["navigator","appVersion"],["navigator","productSub"],["screen","width"],["screen","height"],["screen","availWidth"],["screen","availHeight"],["screen","colorDepth"]];function we(e){let t=[];for(let[o,a]of un){let i=o==="navigator"?e.navigator:e.screen;if(!i)continue;if(d(()=>Object.getOwnPropertyDescriptor(i,a))){t.push({id:`${o}.${a}`,kind:"descriptor",detail:"own-property-shadows-prototype"});continue}let c=d(()=>Object.getPrototypeOf(i));if(!c)continue;let l=d(()=>Object.getOwnPropertyDescriptor(c,a));if(!l?.get)continue;let g=d(()=>Function.prototype.toString.call(l.get));g!==void 0&&!cn.test(g)&&t.push({id:`${o}.${a}.getter`,kind:"descriptor",detail:"getter-is-not-native"})}let n=d(()=>Object.getPrototypeOf(e.navigator));e.Navigator&&n!==void 0&&n!==e.Navigator.prototype&&t.push({id:"navigator",kind:"prototype",detail:"not-Navigator.prototype"});let r=d(()=>Object.getPrototypeOf(e.screen));return e.Screen&&r!==void 0&&r!==e.Screen.prototype&&t.push({id:"screen",kind:"prototype",detail:"not-Screen.prototype"}),t}var ve=/\{\s*\[native code\]\s*\}\s*$/,dn=[["Function.prototype.toString",()=>Function.prototype.toString],["Function.prototype.bind",()=>Function.prototype.bind],["Object.getOwnPropertyDescriptor",()=>Object.getOwnPropertyDescriptor],["Object.defineProperty",()=>Object.defineProperty],["Date.prototype.getTimezoneOffset",()=>Date.prototype.getTimezoneOffset],["Number.prototype.toFixed",()=>Number.prototype.toFixed],["Error.prototype.toString",()=>Error.prototype.toString],["Intl.DateTimeFormat",()=>Intl?.DateTimeFormat],["Navigator.prototype.javaEnabled",e=>e.Navigator?.prototype?.javaEnabled],["Permissions.prototype.query",e=>e.Permissions?.prototype?.query],["MediaDevices.prototype.enumerateDevices",e=>e.MediaDevices?.prototype?.enumerateDevices],["HTMLCanvasElement.prototype.toDataURL",e=>e.HTMLCanvasElement?.prototype?.toDataURL],["CanvasRenderingContext2D.prototype.getImageData",e=>e.CanvasRenderingContext2D?.prototype?.getImageData],["WebGLRenderingContext.prototype.getParameter",e=>e.WebGLRenderingContext?.prototype?.getParameter],["WebGLRenderingContext.prototype.getExtension",e=>e.WebGLRenderingContext?.prototype?.getExtension],["AudioBuffer.prototype.getChannelData",e=>e.AudioBuffer?.prototype?.getChannelData],["Element.prototype.getBoundingClientRect",e=>e.Element?.prototype?.getBoundingClientRect],["Performance.prototype.now",e=>e.Performance?.prototype?.now],["Screen.prototype.constructor",e=>e.Screen]];function ln(){let e=Function.prototype.toString;if(typeof document>"u"||!document.body)return{fn:e,clean:!1};let t=d(()=>{let n=document.createElement("iframe");return n.setAttribute("sandbox","allow-same-origin"),n.style.display="none",document.body.appendChild(n),n});if(!t)return{fn:e,clean:!1};try{let n=d(()=>t.contentWindow?.Function?.prototype?.toString);return n?{fn:n,clean:!0}:{fn:e,clean:!1}}finally{t.remove()}}function be(e){let t=[],n=[],{fn:r,clean:o}=ln(),a=i=>d(()=>r.call(i));for(let[i,s]of dn){let c=d(()=>s(e));if(c==null){n.push({id:i,kind:"missing"});continue}if(typeof c!="function")continue;let l=a(c);l!==void 0&&(ve.test(l)||(t.push(i),n.push({id:i,kind:"not-native"})))}if(o){let i=Function.prototype.toString,s=a(i);s!==void 0&&!ve.test(s)&&(t.includes("Function.prototype.toString")||t.push("Function.prototype.toString"),n.push({id:"Function.prototype.toString",kind:"not-native",detail:"caught-via-fresh-realm"}))}return{patched:t,lies:n}}function P(e){let t=z(),n=ye(e),r=p({schema:1,budget_ms:0,elapsed_ms:0,tiers:[],sources:e,integrity:{patched_natives:[],lies:[],engine:{}}},u.engine),o={...r?.claimed===void 0?{}:{claimed:r.claimed},...r?.observed===void 0?{}:{observed:r.observed},...r?.agrees===void 0?{}:{agrees:r.agrees}};if(!t)return{patched_natives:[],lies:n,engine:o};let a=be(t),i=we(t);return{patched_natives:a.patched,lies:[...a.lies,...i,...n],engine:o}}function fn(){let e=globalThis,t=e.OfflineAudioContext??e.webkitOfflineAudioContext;if(!t)throw new f("no-offline-audio-context");return t}async function Se(e){let t=fn(),n=new t(1,5e3,44100),r=n.createOscillator();r.type="triangle",r.frequency.value=1e4;let o=n.createDynamicsCompressor();o.threshold.value=-50,o.knee.value=40,o.ratio.value=12,o.attack.value=0,o.release.value=.25,r.connect(o),o.connect(n.destination),r.start(0);let i=(await new Promise((c,l)=>{e.signal.addEventListener("abort",()=>l(e.signal.reason),{once:!0}),n.oncomplete=g=>c(g.renderedBuffer);try{let g=n.startRendering();g&&typeof g.then=="function"&&g.then(c,l)}catch(g){l(g)}})).getChannelData(0),s=0;for(let c=4500;c<i.length;c++)s+=Math.abs(i[c]??0);return s}var _e={id:u.audio,tier:"deferred",timeoutMs:500,async run(e){let t=await Se(e);if(t===0)throw new E("audio-silent");let n=await Se(e);return m({value:t,unstable:t!==n,sample_rate:44100})}},Ee={id:u.audioLatency,tier:"deferred",timeoutMs:200,run(){let e=globalThis,t=e.AudioContext??e.webkitAudioContext;if(!t)throw new f("no-audio-context");let n=new t;try{return m({base_latency:d(()=>n.baseLatency),sample_rate:d(()=>n.sampleRate),state:d(()=>n.state)})}finally{d(()=>{n.close()})}}};var xe={id:u.hardware,tier:"fast",run(){if(typeof navigator>"u")throw new f("no-navigator");let e=navigator;return m({hardware_concurrency:d(()=>e.hardwareConcurrency),device_memory:d(()=>e.deviceMemory)})}},Te={id:u.touch,tier:"fast",run(){let e=v();return m({max_touch_points:d(()=>navigator.maxTouchPoints),touch_event:d(()=>"ontouchstart"in e),touch_start:d(()=>(document.createEvent("TouchEvent"),!0)),pointer_coarse:d(()=>e.matchMedia?.("(pointer: coarse)").matches),any_hover:d(()=>e.matchMedia?.("(any-hover: hover)").matches)})}},Me={id:u.sensors,tier:"deferred",timeoutMs:150,async run(e){let t=v(),n="DeviceMotionEvent"in t,r="DeviceOrientationEvent"in t;if(!n&&!r)return m({device_motion:!1,device_orientation:!1});if(typeof document<"u"&&document.visibilityState==="hidden")return m({device_motion:n,device_orientation:r});let o=await new Promise(a=>{let i=!1,s=g=>{i||(i=!0,t.removeEventListener("devicemotion",c),clearTimeout(l),a(g))},c=()=>s(!0),l=setTimeout(()=>s(!1),100);e.signal.addEventListener("abort",()=>s(!1),{once:!0}),t.addEventListener("devicemotion",c,{once:!0})});return m({device_motion:n,device_orientation:r,motion_observed:o})}},ke={id:u.mediaDevices,tier:"deferred",timeoutMs:300,async run(){if(typeof navigator>"u")throw new f("no-navigator");if(typeof navigator.mediaDevices?.enumerateDevices!="function")throw new f("no-media-devices");let e=await navigator.mediaDevices.enumerateDevices();return m({audio_input:e.filter(t=>t.kind==="audioinput").length,audio_output:e.filter(t=>t.kind==="audiooutput").length,video_input:e.filter(t=>t.kind==="videoinput").length,labels_hidden:e.length>0&&e.every(t=>t.label==="")})}},Ce={id:u.network,tier:"fast",run(){let e=navigator.connection;if(!e)throw new f("no-network-information");return m({effective_type:d(()=>e.effectiveType),downlink:d(()=>e.downlink),rtt:d(()=>e.rtt),save_data:d(()=>e.saveData)})}},Oe={id:u.intl,tier:"fast",run(){if(typeof Intl>"u")throw new f("no-intl");let e=d(()=>new Intl.DateTimeFormat().resolvedOptions());return m({timezone:e?.timeZone,timezone_offset:d(()=>new Date().getTimezoneOffset()),locale:e?.locale,calendar:e?.calendar,numbering_system:e?.numberingSystem,formatted:d(()=>new Intl.DateTimeFormat(void 0,{dateStyle:"full",timeStyle:"full"}).format(new Date(0)))})}},Re={id:u.timezone,tier:"fast",run(){if(typeof Intl>"u")throw new f("no-intl");return m({name:d(()=>new Intl.DateTimeFormat().resolvedOptions().timeZone),offset:d(()=>new Date().getTimezoneOffset())})}},Ae={id:u.battery,tier:"deferred",timeoutMs:250,async run(){if(typeof navigator>"u")throw new f("no-navigator");let e=navigator.getBattery;if(typeof e!="function")throw new f("no-battery-api");let t=await e.call(navigator),n=r=>r===void 0?void 0:Number.isFinite(r)?r:null;return m({charging:t.charging,charging_time:n(t.chargingTime),discharging_time:n(t.dischargingTime),level:t.level})}},De={id:u.speech,tier:"deferred",timeoutMs:250,async run(e){if(typeof speechSynthesis>"u")throw new f("no-speech-synthesis");let t=speechSynthesis.getVoices();return t.length===0&&(t=await new Promise(n=>{let r=()=>{speechSynthesis.removeEventListener("voiceschanged",o),e.signal.removeEventListener("abort",a),n(speechSynthesis.getVoices())},o=()=>r(),a=()=>r();speechSynthesis.addEventListener("voiceschanged",o,{once:!0}),e.signal.addEventListener("abort",a,{once:!0}),setTimeout(r,Math.min(100,e.budgetRemainingMs()))})),{voices:t.map(n=>({name:n.name,language:n.lang,local_service:n.localService,default:n.default,uri:n.voiceURI}))}}};var Ie={id:u.screen,tier:"fast",run(){let e=v(),t=e.screen;return m({width:d(()=>t.width),height:d(()=>t.height),avail_width:d(()=>t.availWidth),avail_height:d(()=>t.availHeight),color_depth:d(()=>t.colorDepth),pixel_depth:d(()=>t.pixelDepth),device_pixel_ratio:d(()=>e.devicePixelRatio),orientation:d(()=>t.orientation?.type),inner_width:d(()=>e.innerWidth),inner_height:d(()=>e.innerHeight),frame:d(()=>[t.availTop??null,(t.width??0)-(t.availWidth??0)-(t.availLeft??0),(t.height??0)-(t.availHeight??0)-(t.availTop??0),t.availLeft??null])})}},Q;function pn(e){let t=e.screen;return[t.availTop??null,(t.width??0)-(t.availWidth??0)-(t.availLeft??0),(t.height??0)-(t.availHeight??0)-(t.availTop??0),t.availLeft??null]}var Ne={id:u.screenFrame,tier:"fast",run(){let e=v(),t=pn(e),n=e.document?.fullscreenElement!=null,r=t.every(o=>o===0||o===null);return!n&&!r&&(Q=t),{frame:n&&Q?[...Q]:t}}};function mn(e,t,n){if(typeof e.matchMedia=="function"){for(let r=0;r<=n;r++)if(e.matchMedia(`(${t}: ${r})`).matches)return r}}function K(e,t){if(typeof e.matchMedia=="function")return t.find(n=>e.matchMedia(n).matches)}var Pe={id:u.mediaQueries,tier:"fast",run(){let e=v();if(typeof e.matchMedia!="function")throw new f("no-match-media");let t=K(e,["(color-gamut: rec2020)","(color-gamut: p3)","(color-gamut: srgb)"]),n=K(e,["(prefers-contrast: more)","(prefers-contrast: less)","(prefers-contrast: custom)","(prefers-contrast: no-preference)"]);return m({color_gamut:t?.match(/color-gamut:\s*(\w+)/)?.[1],inverted_colors:d(()=>e.matchMedia("(inverted-colors: inverted)").matches),forced_colors:d(()=>e.matchMedia("(forced-colors: active)").matches),monochrome:mn(e,"monochrome",10),contrast:n?.match(/prefers-contrast:\s*([\w-]+)/)?.[1],reduced_motion:d(()=>e.matchMedia("(prefers-reduced-motion: reduce)").matches),reduced_transparency:d(()=>e.matchMedia("(prefers-reduced-transparency: reduce)").matches),hdr:d(()=>e.matchMedia("(dynamic-range: high)").matches)})}},Le={id:u.colorGamut,tier:"fast",run(){let e=v();if(typeof e.matchMedia!="function")throw new f("no-match-media");let n=K(e,["(color-gamut: rec2020)","(color-gamut: p3)","(color-gamut: srgb)"])?.match(/color-gamut:\s*(\w+)/)?.[1];return n==="srgb"||n==="p3"||n==="rec2020"?{gamut:n}:{}}};var gn=16384,hn=15,yn=9;var wn=250,Ue=600;function vn(e){return new Promise((t,n)=>{let r=indexedDB.open(e,1);r.onupgradeneeded=()=>r.result.createObjectStore("s"),r.onsuccess=()=>t(r.result),r.onerror=()=>n(r.error??new Error("indexeddb-open-failed")),r.onblocked=()=>n(new Error("indexeddb-open-blocked"))})}function bn(e){try{let t=e.transaction("s","readwrite",{durability:"strict"}),n=t.durability==="strict";return t.abort(),n}catch{return!1}}function q(e,t,n){return new Promise((r,o)=>{let a=performance.now(),i=0,s=()=>{if(i===hn){r(performance.now()-a);return}let c=e.transaction("s","readwrite",{durability:t});c.objectStore("s").put(n,i),i+=1,c.oncomplete=s,c.onerror=c.onabort=()=>o(c.error??new Error("indexeddb-write-failed"))};s()})}var Be={id:u.storageDurability,tier:"deferred",timeoutMs:Ue+400,async run(e){if(v(),typeof indexedDB!="object"||indexedDB===null)throw new f("no-indexeddb");let t=e.completed(u.engine);if((t?.status==="ok"?t.value.observed:void 0)!=="chromium")throw new f("not-chromium");let r=`__fingerly_durability_${Math.random().toString(36).slice(2)}`,o=new Uint8Array(gn),a;try{if(a=await vn(r),!bn(a))return{honored:!1};await q(a,"relaxed",o),await q(a,"strict",o);let i=performance.now(),s=i+Math.min(Ue,Math.max(0,e.budgetRemainingMs()-wn)),c=[];for(;c.length<yn&&!e.signal.aborted;){if(c.length>0){let y=(performance.now()-i)/c.length;if(performance.now()+y>s)break}let l=await q(a,"relaxed",o),g=await q(a,"strict",o);if(l>0)c.push(g/l);else break}return c.length===0?{honored:!0,rounds:0}:(c.sort((l,g)=>l-g),m({ratio:c[c.length>>1],rounds:c.length,honored:!0}))}finally{try{a?.close(),indexedDB.deleteDatabase(r)}catch{}}}};var Fe=[["easylist",".ad_300x250",".textads"],["easylist_germany",".werbung1",".werbeblock"],["easylist_italy",".pubbl",".banner_pubblicita"],["easylist_dutch",".advertentie-container",".reclame"],["easyprivacy",".trackingpixel","#tracking-pixel"],["fanboy_annoyances","#newsletter-signup-modal",".cookie-consent-banner"],["fanboy_social",".social-share-buttons",".facebook-like-box"],["adguard_base","#adsense_widget",".adsbygoogle-container"],["adguard_annoyances",".push-notification-prompt","#app-install-banner"],["listekr","#ad_wrapper_top",".ad_zone"],["liste_fr",".pub_300x250","#pubfooter"],["ro_list",".reclama-mare","#reclama"]],Sn=60;function _n(){return new Promise(e=>{let t=!1,n=()=>{t||(t=!0,e())};setTimeout(n,Sn),typeof requestAnimationFrame=="function"&&requestAnimationFrame(()=>setTimeout(n,0))})}function We(e){if(e.offsetParent===null||e.offsetHeight===0||e.offsetWidth===0)return!0;let t=getComputedStyle(e);return t.display==="none"||t.visibility==="hidden"}function qe(e,t){let n=e.createElement("div");return t.startsWith("#")?n.id=t.slice(1):n.className=t.slice(1),n.style.position="absolute",n.style.top="-9999px",n.style.left="-9999px",n.style.width="1px",n.style.height="1px",n}var $e={id:u.domBlockers,tier:"deferred",timeoutMs:300,async run(){if(v(),typeof document>"u"||!document.body)throw new f("no-document-body");let e=document.createElement("div");e.style.position="absolute",e.style.top="-9999px",e.style.left="-9999px",e.style.width="1px",e.style.height="1px";let t=qe(document,".fingerly-control-element");e.appendChild(t);let n=Fe.map(([r,...o])=>({name:r,nodes:o.map(a=>{let i=qe(document,a);return e.appendChild(i),i})}));document.body.appendChild(e);try{if(await _n(),We(t))return{};let r=n.filter(({nodes:o})=>o.some(We)).map(({name:o})=>o);return m({blocked:r,probed:Fe.length})}finally{e.remove()}}};function En(){return d(()=>{try{(-1).toFixed(-1)}catch(e){return e instanceof Error?e.message.length:void 0}})}function xn(){return d(()=>eval.toString().length)}function Tn(){return d(()=>{let e=new Error("probe").stack;if(!(typeof e!="string"||e===""))return e.includes(" at ")?"v8":/^@|\n@|^\w*@/m.test(e)?e.includes("global code")?"javascriptcore":"spidermonkey":"unknown"})}function Mn(e,t,n){let r=[];if(e===51?r.push("chromium"):e===43||e===44?r.push("webkit"):e===25&&r.push("gecko"),t===33&&r.push("chromium"),n==="v8"?r.push("chromium"):n==="javascriptcore"?r.push("webkit"):n==="spidermonkey"&&r.push("gecko"),r.length===0)return;let o=new Map;for(let s of r)o.set(s,(o.get(s)??0)+1);let a,i=0;for(let[s,c]of o)c>i&&(i=c,a=s);return a}function kn(e){if(e){if(/Firefox\/|FxiOS/.test(e))return"gecko";if(/Edg\/|OPR\/|Chrome\/|Chromium\//.test(e))return"chromium";if(/Safari\//.test(e))return"webkit"}}var Ge={id:u.engine,tier:"fast",run(){let e=En(),t=xn(),n=Tn(),r=Mn(e,t,n),o=kn(typeof navigator>"u"?void 0:navigator.userAgent);return m({to_fixed_error_length:e,eval_length:t,stack_style:n,observed:r,claimed:o,agrees:r===void 0||o===void 0?void 0:r===o})}},Cn=[["acos",()=>Math.acos(.12312423423423424)],["acosh",()=>Math.acosh(1e308)],["asin",()=>Math.asin(.12312423423423424)],["asinh",()=>Math.asinh(1)],["atan",()=>Math.atan(.5)],["atanh",()=>Math.atanh(.5)],["cbrt",()=>Math.cbrt(100)],["cos",()=>Math.cos(10.000000000123)],["cosh",()=>Math.cosh(1)],["exp",()=>Math.exp(1)],["expm1",()=>Math.expm1(1)],["log",()=>Math.log(10)],["log1p",()=>Math.log1p(10)],["pow",()=>Math.pow(Math.PI,-100)],["sin",()=>Math.sin(1e300)],["sinh",()=>Math.sinh(1)],["sqrt",()=>Math.sqrt(2)],["tan",()=>Math.tan(-1e300)],["tanh",()=>Math.tanh(1)]];function On(){return Object.is(Math.sin(0),0)&&Math.cos(0)===1&&Math.sqrt(4)===2&&Math.log(1)===0&&Math.pow(2,10)===1024}var Ve={id:u.math,tier:"fast",timeoutMs:50,run(){let e=[],t=0,n=new Map;for(let[r,o]of Cn){let a=d(o);typeof a=="number"&&Number.isFinite(a)?(t+=1,n.set(r,a),e.push(`${r}:${a}`)):e.push(`${r}:`)}return m({hash:k(e.join("|")),probed:t,atanh_half:n.get("atanh"),expm1_1:n.get("expm1"),identities_hold:d(On)})}};function L(e){return d(()=>{try{e()}catch(t){return t instanceof EvalError?void 0:t instanceof Error?t.message.length:void 0}})}function Rn(){try{return new Function(""),!0}catch{return!1}}function An(e){let t=[],n=e.own_properties;if(n!==void 0&&(n.includes("sourceURL")?t.push("webkit","webkit"):n.includes("lineNumber")?t.push("gecko","gecko"):n==="message,stack"&&t.push("chromium","chromium")),e.null_property_length===44?t.push("chromium"):e.null_property_length===33&&t.push("gecko"),e.syntax_length===20?t.push("chromium"):e.syntax_length===28&&t.push("gecko"),t.length===0)return;let r=new Map;for(let s of t)r.set(s,(r.get(s)??0)+1);let o,a=0,i=!1;for(let[s,c]of r)c>a?(a=c,o=s,i=!1):c===a&&(i=!0);return i?void 0:o}function Dn(){return d(()=>{try{throw new Error("probe")}catch(e){return Object.getOwnPropertyNames(e).sort().join(",")}})}var He={id:u.errors,tier:"fast",timeoutMs:50,run(){let e=Rn(),t=m({null_property_length:L(()=>null.x),syntax_length:e?L(()=>new Function("!")):void 0,json_parse_length:L(()=>JSON.parse("{")),invalid_array_length:L(()=>{let n=[];n.length=-1}),const_assign_length:e?L(()=>{new Function("const c = 1; c = 2")()}):void 0,own_properties:Dn(),capture_stack_trace:d(()=>typeof Error.captureStackTrace=="function"),stack_trace_limit:d(()=>"stackTraceLimit"in Error)});return m({...t,observed:An(t)})}};var je={id:u.navigator,tier:"fast",run(){if(typeof navigator>"u")throw new f("no-navigator");let e=navigator;return m({user_agent:d(()=>e.userAgent),platform:d(()=>e.platform),vendor:d(()=>e.vendor),product_sub:d(()=>e.productSub),app_version:d(()=>e.appVersion),hardware_concurrency:d(()=>e.hardwareConcurrency),device_memory:d(()=>e.deviceMemory),max_touch_points:d(()=>e.maxTouchPoints),webdriver:d(()=>e.webdriver),cookie_enabled:d(()=>e.cookieEnabled),pdf_viewer_enabled:d(()=>e.pdfViewerEnabled),do_not_track:d(()=>e.doNotTrack),plugin_count:d(()=>e.plugins?.length),mime_type_count:d(()=>e.mimeTypes?.length),language:d(()=>e.language),languages:d(()=>e.languages?[...e.languages]:void 0)})}},Xe={id:u.languages,tier:"fast",run(){if(typeof navigator>"u")throw new f("no-navigator");return m({primary:d(()=>navigator.language),accepted:d(()=>navigator.languages?[...navigator.languages]:void 0)})}},ze={id:u.vendor,tier:"fast",run(){if(typeof navigator>"u")throw new f("no-navigator");return m({vendor:d(()=>navigator.vendor)})}},Qe={id:u.plugins,tier:"fast",run(){if(typeof navigator>"u")throw new f("no-navigator");let e=navigator.plugins;if(!e)throw new f("no-plugins");return{plugins:Array.from(e,t=>({name:t.name,filename:t.filename,description:t.description,mime_types:Array.from(t,n=>({type:n.type,suffixes:n.suffixes,description:n.description}))}))}}},Ke={id:u.userAgentData,tier:"deferred",timeoutMs:200,async run(){if(typeof navigator>"u")throw new f("no-navigator");let e=navigator.userAgentData;if(!e)throw new f("no-user-agent-data");let t=m({brands:e.brands,mobile:e.mobile,platform:e.platform});if(typeof e.getHighEntropyValues!="function")return t;let n=await e.getHighEntropyValues(["architecture","bitness","model","platformVersion","fullVersionList","wow64"]);return{...t,...n}}};function Y(e,t){let n=document.createElement("canvas");n.width=e,n.height=t;let r=n.getContext("2d");if(!r)throw new f("no-2d-context");return[n,r]}function Ye(){let[e,t]=Y(240,60);t.globalCompositeOperation="multiply";for(let[n,r,o]of[["#f2f",40,40],["#2ff",80,40],["#ff2",60,80]])t.fillStyle=n,t.beginPath(),t.arc(r,o,40,0,Math.PI*2,!0),t.closePath(),t.fill();return t.fillStyle="#f9c",t.arc(100,50,50,0,Math.PI*2,!0),t.arc(100,50,20,0,Math.PI*2,!0),t.fill("evenodd"),e.toDataURL()}function Je(){let[e,t]=Y(300,60);return t.textBaseline="alphabetic",t.fillStyle="#f60",t.fillRect(100,1,62,20),t.fillStyle="#069",t.font='11pt "Times New Roman"',t.fillText("Fingerly <canvas> 1.0 \u{1F512}\u0416\u4E2D",2,15),t.font="18pt Arial",t.fillStyle="rgba(102, 204, 0, 0.7)",t.fillText("Fingerly <canvas> 1.0",4,45),e.toDataURL()}function In(){let[,e]=Y(1,1);return e.rect(0,0,10,10),e.rect(2,2,6,6),e.isPointInPath(5,5,"evenodd")===!1}function Nn(e){let t=e.completed(u.timing);if(t?.status!=="ok")return!1;let n=t.value?.now_resolution;return typeof n=="number"&&n>=16}var Ze={id:u.canvas,tier:"deferred",timeoutMs:400,run(e){if(v(),typeof document>"u")throw new f("no-document");if(Nn(e))throw new E("rfp-canvas-prompt-avoided");try{let t=Ye(),n=Ye(),r=Je(),o=Je(),a=t!==n||r!==o;return m({geometry:k(t),text:k(r),winding:d(In),unstable:a})}catch(t){he(t)}}};function et(){if(typeof document>"u")throw new f("no-document");let e=document.createElement("canvas"),t=e.getContext("webgl")??e.getContext("experimental-webgl");if(!t)throw new f("no-webgl-context");return t}var tt={id:u.webgl,tier:"fast",timeoutMs:400,run(){let e=et(),t=d(()=>e.getExtension("WEBGL_debug_renderer_info")),n={};for(let o of["MAX_TEXTURE_SIZE","MAX_VIEWPORT_DIMS","MAX_VERTEX_ATTRIBS","MAX_VARYING_VECTORS","MAX_COMBINED_TEXTURE_IMAGE_UNITS","MAX_CUBE_MAP_TEXTURE_SIZE","MAX_FRAGMENT_UNIFORM_VECTORS","MAX_RENDERBUFFER_SIZE","MAX_TEXTURE_IMAGE_UNITS","MAX_VERTEX_TEXTURE_IMAGE_UNITS","MAX_VERTEX_UNIFORM_VECTORS","ALIASED_LINE_WIDTH_RANGE","ALIASED_POINT_SIZE_RANGE","RED_BITS","GREEN_BITS","BLUE_BITS","ALPHA_BITS","DEPTH_BITS","STENCIL_BITS"]){let a=e[o];if(typeof a!="number")continue;let i=d(()=>e.getParameter(a));i!=null&&(n[o]=ArrayBuffer.isView(i)?Array.from(i):i)}let r=[];for(let o of[e.VERTEX_SHADER,e.FRAGMENT_SHADER])for(let a of[e.LOW_FLOAT,e.MEDIUM_FLOAT,e.HIGH_FLOAT]){let i=d(()=>e.getShaderPrecisionFormat(o,a));i&&r.push(i.rangeMin,i.rangeMax,i.precision)}return m({vendor:d(()=>e.getParameter(e.VENDOR)),renderer:d(()=>e.getParameter(e.RENDERER)),unmasked_vendor:t?d(()=>e.getParameter(t.UNMASKED_VENDOR_WEBGL)):void 0,unmasked_renderer:t?d(()=>e.getParameter(t.UNMASKED_RENDERER_WEBGL)):void 0,version:d(()=>e.getParameter(e.VERSION)),shading_language_version:d(()=>e.getParameter(e.SHADING_LANGUAGE_VERSION)),max_texture_size:d(()=>e.getParameter(e.MAX_TEXTURE_SIZE)),max_render_buffer_size:d(()=>e.getParameter(e.MAX_RENDERBUFFER_SIZE)),parameters_hash:Object.keys(n).length>0?k(JSON.stringify(n)):void 0,shader_precision_hash:r.length>0?k(r.join(",")):void 0})}},nt={id:u.webglExtensions,tier:"deferred",timeoutMs:200,run(){let t=et().getSupportedExtensions();if(!t)throw new E("extensions-withheld");return[...t].sort()}};function Pn(e){let t=[],n=Date.now()+12;for(;t.length<25&&Date.now()<n;){let r=e(),o=e(),a=0;for(;o===r&&a++<1e5&&Date.now()<n;)o=e();o!==r&&t.push(o-r)}return t.length===0?100:Math.round(Math.min(...t)*1e6)/1e6}var rt={id:u.timing,tier:"fast",timeoutMs:150,run(){let t=v().performance;return typeof t?.now!="function"?m({has_performance:!1}):m({has_performance:!0,now_resolution:Pn(()=>t.now())})}},ot={id:u.permissions,tier:"fast",timeoutMs:200,async run(){let e=v();if(!e.navigator.permissions?.query)throw new f("no-permissions-api");let t=async o=>{try{return(await e.navigator.permissions.query({name:o})).state}catch{return}},n=await t("notifications"),r=d(()=>e.Notification?.permission);return m({notification:n,notification_legacy:r,geolocation:await t("geolocation"),inconsistent:n!==void 0&&r!==void 0?(r==="default"?"prompt":r)!==n:void 0})}},Ln=["__nightmare","_phantom","callPhantom","__phantomas","Buffer","emit","spawn","__selenium_evaluate","__selenium_unwrapped","__webdriver_evaluate","__webdriver_script_fn","__webdriver_script_func","__webdriver_unwrapped","__fxdriver_evaluate","__fxdriver_unwrapped","__driver_evaluate","__driver_unwrapped","_Selenium_IDE_Recorder","domAutomation","domAutomationController","__lastWatirAlert","__playwright","__puppeteer","__pw_manual"],it={id:u.automation,tier:"fast",run(){let e=v(),t=Ln.filter(r=>d(()=>r in e)===!0),n=d(()=>Object.getOwnPropertyNames(e).filter(r=>/^cdc_|^\$cdc_/.test(r)));return m({webdriver:d(()=>navigator.webdriver),cdp_artifacts:n&&n.length>0?n:void 0,distinctive_properties:t.length>0?[...t]:void 0,chrome_object:d(()=>"chrome"in e),window_external:d(()=>{let r=e.external;return r?String(r):void 0})})}};var Un=50,at=Symbol("timed-out");async function Bn(e){if(typeof e.brave?.isBrave=="function")try{let t=await Promise.race([e.brave.isBrave(),new Promise(n=>setTimeout(()=>n(at),Un))]);return t===at?void 0:t===!0}catch{return}}function Fn(e){let t=e.userAgentData?.brands;if(Array.isArray(t))return t.some(n=>n?.brand==="Brave")}var st=[[30,60,90],[210,180,140]],S=8;function Wn(){if(!(typeof document>"u"))try{let e=document.createElement("canvas");e.width=S,e.height=S;let t=e.getContext("2d",{willReadFrequently:!0});if(!t)return;for(let r=0;r<S;r++)for(let o=0;o<S;o++){let[a,i,s]=st[(o+r)%2];t.fillStyle=`rgb(${a}, ${i}, ${s})`,t.fillRect(o,r,1,1)}let n=t.getImageData(0,0,S,S).data;for(let r=0;r<S*S;r++){let o=r%S,a=Math.floor(r/S),[i,s,c]=st[(o+a)%2],l=r*4;if(n[l]!==i||n[l+1]!==s||n[l+2]!==c||n[l+3]!==255)return!0}return!1}catch{return}}var ct={id:u.shields,tier:"fast",timeoutMs:100,async run(){if(typeof navigator>"u")throw new f("no-navigator");let e=navigator;return m({brave:await Bn(e),brave_claimed:Fn(e),canvas_noise:Wn()})}};function ut(e){try{let t=window[e];if(!t)return!1;let n="__fingerly_probe__";return t.setItem(n,"1"),t.removeItem(n),!0}catch{return!1}}function qn(){try{return typeof window.indexedDB=="object"&&window.indexedDB!==null}catch{return!1}}function $n(e){let t=e instanceof Error?e.name:"",n=e instanceof Error?e.message:String(e);return n.includes("unknown transient reason")?"transient":t==="SecurityError"||n.includes("Security error")?"refused":"failed"}var Gn=200;async function Vn(){let e=navigator.storage;if(typeof e?.getDirectory=="function")return Promise.race([e.getDirectory().then(()=>"ok",t=>$n(t)),new Promise(t=>setTimeout(t,Gn))])}var Hn=150;function jn(){let e=navigator.webkitTemporaryStorage;return typeof e?.queryUsageAndQuota!="function"?Promise.resolve(void 0):new Promise(t=>{let n=!1,r=o=>{n||(n=!0,t(o))};setTimeout(()=>r(void 0),Hn);try{e.queryUsageAndQuota((o,a)=>r(typeof a=="number"?a:void 0),()=>r(void 0))}catch{r(void 0)}})}function Xn(){if(window.isSecureContext)return"serviceWorker"in navigator}var dt={id:u.storage,tier:"fast",timeoutMs:250,async run(){v();let e=d(async()=>{if(typeof navigator.storage?.estimate!="function")return;let c=await navigator.storage.estimate();return{quota:c.quota,usage:c.usage}}),t=jn(),n=Vn(),[r,o,a]=await Promise.all([e,t,n]),i=r?.quota,s=navigator.deviceMemory;return m({local_storage:ut("localStorage"),session_storage:ut("sessionStorage"),indexed_db:qn(),quota:i,usage:r?.usage,legacy_quota:o,quota_ratio:typeof i=="number"&&typeof s=="number"&&s>0?i/(s*1024*1024*1024):void 0,origin_filesystem:a,service_worker:Xn()})}},lt={id:u.storageQuota,tier:"fast",run(){if(v(),typeof document>"u")throw new f("no-document");return{partitioned:typeof document.hasStorageAccess=="function"}}};var ft=["monospace","sans-serif","serif"],zn="72px",Qn="mmmmmmmmmmlli WwMmIi 0123",J=["Arial","Arial Black","Calibri","Cambria","Candara","Comic Sans MS","Consolas","Constantia","Corbel","Courier New","Ebrima","Franklin Gothic","Gabriola","Georgia","Impact","Lucida Console","Lucida Sans Unicode","Malgun Gothic","Marlett","Microsoft Himalaya","MS Gothic","MV Boli","Nirmala UI","Palatino Linotype","Segoe UI","Segoe UI Emoji","Sylfaen","Tahoma","Times New Roman","Trebuchet MS","Verdana","Webdings","Wingdings","American Typewriter","Andale Mono","Apple Chancery","Arial Hebrew","Avenir","Avenir Next","Baskerville","Big Caslon","Bodoni 72","Chalkboard","Cochin","Copperplate","Didot","Futura","Geneva","Gill Sans","Helvetica","Helvetica Neue","Herculanum","Hoefler Text","Lucida Grande","Luminari","Menlo","Monaco","Optima","Papyrus","Phosphate","Rockwell","SF Pro","Skia","Snell Roundhand","Trattatello","Zapfino","Cantarell","DejaVu Sans","DejaVu Serif","FreeSans","Liberation Sans","Liberation Serif","Nimbus Sans","Noto Sans","Ubuntu","Ubuntu Mono","Droid Sans","Roboto","Roboto Condensed","Bahnschrift","Bookshelf Symbol 7","Cascadia Code","Fira Code","HoloLens MDL2 Assets","Inter","JetBrains Mono","MT Extra","Source Code Pro","Wingdings 2","Wingdings 3"],pt={id:u.fonts,tier:"deferred",timeoutMs:700,run(){if(typeof document>"u")throw new f("no-document");let e=document.createElement("div");e.style.cssText="position:absolute;left:-9999px;top:-9999px;visibility:hidden;width:auto;height:auto;margin:0;padding:0;white-space:nowrap;";let t=o=>{let a=document.createElement("span");return a.style.cssText=`position:absolute;font-size:${zn};margin:0;padding:0;font-family:${o};`,a.textContent=Qn,e.appendChild(a),a},n=ft.map(o=>t(o)),r=J.map(o=>ft.map(a=>t(`'${o}',${a}`)));document.body.appendChild(e);try{let o=n.map(s=>s.offsetWidth),a=n.map(s=>s.offsetHeight),i=[];return J.forEach((s,c)=>{let l=r[c];if(!l)return;l.every((y,h)=>{let w=o[h],_=a[h];return y.offsetWidth!==w||y.offsetHeight!==_})&&i.push(s)}),m({available:i,probed:J.length})}finally{e.remove()}}},mt={id:u.fontPreferences,tier:"deferred",timeoutMs:250,run(){if(typeof document>"u"||!document.body)throw new f("no-document-body");let e=document.createElement("iframe");e.setAttribute("aria-hidden","true"),e.style.cssText="position:absolute;left:-9999px;width:1px;height:1px;border:0",document.body.appendChild(e);try{let t=e.contentDocument;if(!t?.body)throw new f("no-frame-document");let n="mmMwWLliI0O&1",r={default:"",serif:"serif",sans:"sans-serif",mono:"monospace",system:"system-ui",apple:"-apple-system",min:"Arial, sans-serif"},o={};for(let[a,i]of Object.entries(r)){let s=t.createElement("span");s.textContent=n,s.style.cssText=`font:72px ${i||"initial"};white-space:nowrap;position:absolute`,t.body.appendChild(s),o[a]=Math.round(s.getBoundingClientRect().width*1e3)/1e3}return{widths:o}}finally{e.remove()}}};var U=[Ge,He,Ve,je,Xe,Qe,ze,Ie,Ne,Pe,Le,xe,Te,Ce,Oe,Re,dt,lt,ct,rt,ot,it,tt,Ze,nt,_e,Ee,pt,mt,Ae,De,Me,ke,Ke,$e,Be];function gt(e){return Promise.resolve(new N({...e,platform:"web",sources:e.sources??U,integrity:t=>P(t.sources)}))}return St(Kn);})();
|
|
1
|
+
"use strict";var Fingerly=(()=>{var G=Object.defineProperty;var vt=Object.getOwnPropertyDescriptor;var wt=Object.getOwnPropertyNames;var bt=Object.prototype.hasOwnProperty;var _t=(e,t)=>{for(var n in t)G(e,n,{get:t[n],enumerable:!0})},Et=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of wt(t))!bt.call(e,o)&&o!==n&&G(e,o,{get:()=>t[o],enumerable:!(r=vt(t,o))||r.enumerable});return e};var xt=e=>Et(G({},"__esModule",{value:!0}),e);var In={};_t(In,{ConsentError:()=>N,FingerlyClient:()=>P,SOURCE:()=>d,TransportError:()=>h,browserSources:()=>B,inspectIntegrity:()=>I,load:()=>St});var le=e=>{throw TypeError(e)},fe=(e,t,n)=>t.has(e)||le("Cannot "+n),x=(e,t,n)=>(fe(e,t,"read from private field"),n?n.call(e):t.get(e)),me=(e,t,n)=>t.has(e)?le("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),pe=(e,t,n,r)=>(fe(e,t,"write to private field"),t.set(e,n),n),Tt=["granted","pending","denied"];function J(e){if(!Tt.includes(e))throw new TypeError(`Fingerly consent must be 'granted', 'pending' or 'denied' (received ${JSON.stringify(e)})`)}var N=class extends Error{constructor(e){super(`Fingerly needs consent before it can identify this visitor (consent is ${e})`),this.state=e,this.name="ConsentError",this.code="consent_required"}},l=class extends Error{constructor(e){super(e??"unsupported"),this.reason=e,this.name="UnsupportedSignal"}},w=class extends Error{constructor(e){super(e??"blocked"),this.reason=e,this.name="BlockedSignal"}},R=class extends Error{constructor(e){super(e??"timeout"),this.reason=e,this.name="TimedOutSignal"}};function Mt(e){if(e instanceof l||e instanceof w||e instanceof R)return e.reason;if(e instanceof Error&&typeof e.name=="string"&&e.name!=="Error")return e.name}var T=typeof globalThis.performance?.now=="function"?()=>globalThis.performance.now():()=>Date.now(),H={budgetMs:1200,defaultSourceTimeoutMs:300,concurrency:6};function U(e){return Math.max(0,Math.round(e))}function kt(e){return e instanceof l?"unsupported":e instanceof w?"blocked":e instanceof R?"timeout":"error"}async function At(e,t,n,r,o){let i=T(),a=t-i;if(a<=0)return{status:"timeout",ms:0,reason:"budget-exhausted"};let c=Math.min(e.timeoutMs??n,a),u=new AbortController,m=()=>u.abort(new R("aborted"));r?.addEventListener("abort",m,{once:!0});let p=setTimeout(()=>u.abort(new R("source-timeout")),c),b={signal:u.signal,budgetRemainingMs:()=>Math.max(0,t-T()),completed:y=>o[y]};try{let y=await Promise.race([(async()=>e.run(b))(),new Promise((_,E)=>{u.signal.addEventListener("abort",()=>E(u.signal.reason??new R("source-timeout")),{once:!0})})]);return{status:"ok",ms:U(T()-i),value:y}}catch(y){let _=kt(y),E=Mt(y);return E===void 0?{status:_,ms:U(T()-i)}:{status:_,ms:U(T()-i),reason:E}}finally{clearTimeout(p),r?.removeEventListener("abort",m)}}async function Ct(e,t={}){let n=t.budgetMs??H.budgetMs,r=t.defaultSourceTimeoutMs??H.defaultSourceTimeoutMs,o=Math.max(1,t.concurrency??H.concurrency),i=t.tiers??["fast","deferred"],a=T(),c=a+n,u={},m={...t.completed??{}},p=!1;for(let b of i){let y=e.filter(M=>M.tier===b);if(y.length===0)continue;let _=0,E=async()=>{for(;_<y.length;){let M=y[_++];if(!M)continue;if(T()>=c||t.signal?.aborted){p=!0,u[M.id]={status:"timeout",ms:0,reason:"budget-exhausted"};continue}let V=await At(M,c,r,t.signal,m);V.status==="timeout"&&(p=!0),u[M.id]=V,m[M.id]=V}};await Promise.all(Array.from({length:Math.min(o,y.length)},E))}return{outcomes:u,elapsedMs:U(T()-a),truncated:p}}function Dt(e="v1"){if(!/^v[1-9]\d*$/.test(e)||e.trim()!==e)throw new TypeError('apiVersion must be a version such as "v1" or "v2"');return e}var Rt="https://api.fingerly.io",Y="x-api-key",ge="[redacted]",he=Symbol.for("nodejs.util.inspect.custom"),Ot="Idempotency-Key",h=class extends Error{constructor(e,t,n=!1,r,o){super(e),this.status=t,this.retryable=n,this.code=r,this.retryAfterMs=o,this.name="TransportError"}},Z=4*1024*1024,Nt=2e3;function Pt(e){let t=e.headers.get("retry-after")?.trim();if(!t)return;if(/^\d+$/.test(t))return Number(t)*1e3;let n=Date.parse(t);return Number.isFinite(n)?Math.max(0,n-Date.now()):void 0}async function ee(e){try{let n=(await e.json())?.error?.code;return typeof n=="string"&&n!==""?n:void 0}catch{return}}function te(e,t){return new h(`The server refused the submission (${e.status})`,e.status,Bt(e.status),t,Pt(e))}async function It(e){let t=()=>new h("The server answered with a response this SDK cannot read",e.status,!1);if(Number(e.headers.get("content-length"))>Z)throw e.body?.cancel().catch(()=>{}),t();let n=await e.text();if(n.length>Z)throw t();try{let r=JSON.parse(n);if(r===null||typeof r!="object")throw t();return r}catch{throw t()}}function Lt(e,t){let n=Wt(t,Math.random);return e.retryAfterMs===void 0?n:e.retryAfterMs>Nt?null:e.retryAfterMs+n}function Bt(e){return e===408||e===429||e>=500&&e<=599}function Ft(e){return e.status===404||e.status===405}function ye(e,t){return`${e}/api/${t}/ingest`}function $(e){return ye(Rt,e)}function Ut(e,t){let n=e.trim().replace(/\/+$/,"");if(n===""||n.includes("?")||n.includes("#"))throw new TypeError("A Fingerly endpoint must be a non-empty URL or path without a query or fragment");if(!(n.startsWith("/")||/^https?:\/\//i.test(n)))throw new TypeError("A Fingerly endpoint must be an absolute URL or a root-relative browser path");return/^https?:\/\/[^/]+$/i.test(n)?ye(n,t):n}function Wt(e,t){let n=Math.min(2e3,100*2**(e-1));return Math.floor(t()*n)}function ne(e,t){return new Promise(n=>{if(t?.aborted)return n();let r=()=>{clearTimeout(o),t?.removeEventListener("abort",r),n()},o=setTimeout(r,e);t?.addEventListener("abort",r,{once:!0})})}function qt(){let e=globalThis.crypto;if(typeof e?.randomUUID=="function")return e.randomUUID();if(typeof e?.getRandomValues=="function"){let t=e.getRandomValues(new Uint8Array(16));t[6]=(t[6]??0)&15|64,t[8]=(t[8]??0)&63|128;let n=Array.from(t,r=>r.toString(16).padStart(2,"0")).join("");return`${n.slice(0,8)}-${n.slice(8,12)}-${n.slice(12,16)}-${n.slice(16,20)}-${n.slice(20)}`}return`fingerly-${Date.now().toString(36)}-${Math.random().toString(36).slice(2)}-${Math.random().toString(36).slice(2)}`}var D,re=class{constructor(e){if(me(this,D),!e.apiKey)throw new h("An SDK key is required to submit a fingerprint");pe(this,D,e.apiKey);let t=Dt(e.apiVersion),n=e.endpoints,r=n===void 0?[$(t)]:Array.isArray(n)?[...n]:[n];if(r.length===0)throw new TypeError("The endpoints array must not be empty");let o=r.map(a=>Ut(a,t));n!==void 0&&e.fallbackToDefaultEndpoint&&(o.includes($(t))||o.push($(t))),this.urls=o,this.maxAttempts=Math.max(1,this.urls.length,e.maxAttempts??3),this.requestTimeoutMs=e.requestTimeoutMs??5e3;let i=e.fetchImpl??globalThis.fetch;if(typeof i!="function")throw new h("No fetch implementation is available; pass one as fetchImpl");this.fetchImpl=i.bind(globalThis)}toJSON(){return{apiKey:ge,urls:[...this.urls],maxAttempts:this.maxAttempts,requestTimeoutMs:this.requestTimeoutMs}}[he](){return this.toJSON()}async submit(e,t){let n,r=JSON.stringify(e),o=qt(),i=0;for(let a=1;a<=this.maxAttempts;a++){if(t?.aborted)throw new h("The submission was cancelled");try{return await this.attempt(this.urls[i],r,o,t)}catch(c){let u=c instanceof h?c:new h(c instanceof Error?c.message:"The submission could not be sent",void 0,!0),m=this.nextAttempt(u,a,i);if(m===null)throw u;n=u,i=Math.min(i+1,this.urls.length-1),await ne(m,t)}}throw n??new h("The submission could not be sent")}async submitSupplement(e,t,n){let r=JSON.stringify(t),o,i=0;for(let a=1;a<=this.maxAttempts;a++){if(n?.aborted)throw new h("The supplement was cancelled");try{await this.postJSON(this.urls[i],r,n);return}catch(c){let u=c instanceof h?c:new h(c instanceof Error?c.message:"The supplement could not be sent",void 0,!0),m=this.nextAttempt(u,a,i);if(m===null)throw u;o=u,i=Math.min(i+1,this.urls.length-1),await ne(m,n)}}throw o??new h("The supplement could not be sent")}nextAttempt(e,t,n){return t===this.maxAttempts?null:e.retryable?Lt(e,t):Ft(e)&&n<this.urls.length-1?0:null}async postJSON(e,t,n){let r=new AbortController,o=()=>r.abort();n?.addEventListener("abort",o,{once:!0});let i=setTimeout(o,this.requestTimeoutMs);try{let a=await this.fetchImpl(e,{method:"POST",headers:{"content-type":"application/json",[Y]:x(this,D)},body:t,credentials:"omit",signal:r.signal});if(!a.ok)throw te(a,await ee(a));return await a.arrayBuffer().catch(()=>{}),a}finally{clearTimeout(i),n?.removeEventListener("abort",o)}}async attempt(e,t,n,r){let o=new AbortController,i=()=>o.abort();r?.addEventListener("abort",i,{once:!0});let a=setTimeout(i,this.requestTimeoutMs);try{let c=await this.fetchImpl(e,{method:"POST",headers:{"content-type":"application/json",[Y]:x(this,D),[Ot]:n},body:t,credentials:"omit",signal:o.signal});if(!c.ok)throw te(c,await ee(c));let u=await It(c);if(typeof u?.request_id!="string"||u.request_id==="")throw new h("The server accepted the submission but returned no request_id");return u}finally{clearTimeout(a),r?.removeEventListener("abort",i)}}};D=new WeakMap;var oe="0.1.2",Vt=1;function ie(e){return e instanceof h&&e.code==="consent_required"?new N("pending"):e}var ae={patched_natives:[],lies:[],engine:{}},v,P=class{constructor(e){me(this,v),this.consentListeners=new Set;let t=e.consent??"pending";J(t),this.consentState=t,pe(this,v,e),this.platform=e.platform??"web",this.transport=e.transport??new re({...e.apiVersion===void 0?{}:{apiVersion:e.apiVersion},apiKey:e.apiKey,...e.endpoints===void 0?{}:{endpoints:e.endpoints},...e.fallbackToDefaultEndpoint===void 0?{}:{fallbackToDefaultEndpoint:e.fallbackToDefaultEndpoint}})}toJSON(){return{apiKey:ge,platform:this.platform,consent:this.consentState,transport:this.transport instanceof re?this.transport:"custom"}}[he](){return this.toJSON()}get consent(){return this.consentState}setConsent(e){if(J(e),e!==this.consentState){this.consentState=e;for(let t of[...this.consentListeners])try{t(e)}catch(n){setTimeout(()=>{throw n},0)}}}onConsentChange(e){return this.consentListeners.add(e),()=>{this.consentListeners.delete(e)}}requireConsent(){if(this.consentState!=="granted")throw new N(this.consentState)}consentScope(e){let t=new AbortController,n=()=>t.abort();e?.aborted?n():e?.addEventListener("abort",n,{once:!0});let r=this.onConsentChange(o=>{o!=="granted"&&n()});return{signal:t.signal,close:()=>{r(),e?.removeEventListener("abort",n)}}}async identify(e={}){this.requireConsent();let t=this.consentScope(e.signal);try{return await this.identifyWithConsent(e,t.signal)}finally{t.close()}}async identifyWithConsent(e,t){let n=e.submit!==!1&&e.tiers===void 0,r=await this.collectReport(n?["fast"]:e.tiers??["fast","deferred"],t,n?300:void 0);if(this.requireConsent(),e.submit===!1)return{requestId:"",visitorId:"",visitorIsNew:!1,visitorConfidence:0,identifiable:!1,duplicate:!1,state:"",suspectScore:null,suspectLevel:null,report:r,deferred:Promise.resolve({status:"skipped",reason:"not-submitted"})};let o={sdk:{platform:this.platform,version:oe},consent:this.consentState,signals:r,...e.tag===void 0?{}:{tag:e.tag}},i;try{i=await this.transport.submit(o,t)}catch(c){throw this.requireConsent(),ie(c)}let a={requestId:i.request_id,visitorId:i.visitor_id??"",visitorIsNew:i.visitor_is_new??!1,visitorConfidence:i.visitor_confidence??0,identifiable:i.identifiable??!1,duplicate:i.duplicate??!1,state:i.state??"",suspectScore:typeof i.suspect_score=="number"&&Number.isFinite(i.suspect_score)?i.suspect_score:null,suspectLevel:typeof i.suspect_level=="string"&&i.suspect_level!==""?i.suspect_level:null,report:r,deferred:Promise.resolve({status:"skipped",reason:"explicit-tiers"})};return n?i.duplicate||!i.deferred_token?(a.deferred=Promise.resolve({status:"skipped",reason:i.duplicate?"duplicate":"unsupported-transport"}),a):typeof this.transport.submitSupplement!="function"?(a.deferred=Promise.resolve({status:"skipped",reason:"unsupported-transport"}),a):(a.deferred=this.finishDeferred(r,i.request_id,i.deferred_token,e.signal),a):a}async finishDeferred(e,t,n,r){let o={status:"skipped",reason:"consent-withdrawn"};if(this.consentState!=="granted")return o;let i=this.consentScope(r),a,c;try{if(a=await this.collectReport(["deferred"],i.signal,1200,e.sources),this.consentState!=="granted")return o;c={schema:e.schema,budget_ms:e.budget_ms+a.budget_ms,elapsed_ms:e.elapsed_ms+a.elapsed_ms,tiers:["fast","deferred"],sources:{...e.sources,...a.sources},integrity:x(this,v).integrity?x(this,v).integrity({sources:{...e.sources,...a.sources}}):ae};let u={sdk:{platform:this.platform,version:oe},consent:this.consentState,signals:a,token:n};return await this.transport.submitSupplement(t,u,i.signal),{status:"submitted",report:a,combinedReport:c}}catch(u){if(this.consentState!=="granted")return o;let m=ie(u);return{status:"failed",error:m instanceof Error?m:new Error(String(m)),...a===void 0?{}:{report:a},...c===void 0?{}:{combinedReport:c}}}finally{i.close()}}async collect(e={}){this.requireConsent();let t=e.tiers??["fast","deferred"],n=this.consentScope(e.signal);try{let r=await this.collectReport(t,n.signal);return this.requireConsent(),r}finally{n.close()}}async collectReport(e,t,n,r){let o=x(this,v).sources??[],i={...x(this,v).schedule,tiers:e,...n===void 0?{}:{budgetMs:n},...t===void 0?{}:{signal:t},...r===void 0?{}:{completed:r}},a=await Ct(o,i),c=x(this,v).integrity?x(this,v).integrity({sources:a.outcomes}):ae;return{schema:Vt,budget_ms:i.budgetMs??1200,elapsed_ms:a.elapsedMs,tiers:e,sources:a.outcomes,integrity:c}}};v=new WeakMap;var O=2654435761,W=2246822519,se=3266489917,Gt=668265263,ce=374761393;function k(e,t){return e<<t|e>>>32-t}function F(e,t){return Math.imul(k(e+Math.imul(t,W)|0,13),O)}function C(e,t){return((e[t]??0)|(e[t+1]??0)<<8|(e[t+2]??0)<<16|(e[t+3]??0)<<24)>>>0}function Ht(e){if(typeof TextEncoder<"u")return new TextEncoder().encode(e);let t=[];for(let n=0;n<e.length;n++){let r=e.charCodeAt(n);if(r>=55296&&r<=56319&&n+1<e.length){let o=e.charCodeAt(n+1);o>=56320&&o<=57343&&(r=(r-55296)*1024+(o-56320)+65536,n++)}r<128?t.push(r):r<2048?t.push(192|r>>6,128|r&63):r<65536?t.push(224|r>>12,128|r>>6&63,128|r&63):t.push(240|r>>18,128|r>>12&63,128|r>>6&63,128|r&63)}return new Uint8Array(t)}function ue(e,t){let n=e.length,r=0,o;if(n>=16){let i=t+O+W|0,a=t+W|0,c=t|0,u=t-O|0,m=n-16;do i=F(i,C(e,r)),a=F(a,C(e,r+4)),c=F(c,C(e,r+8)),u=F(u,C(e,r+12)),r+=16;while(r<=m);o=k(i,1)+k(a,7)+k(c,12)+k(u,18)|0}else o=t+ce|0;for(o=o+n|0;r+4<=n;)o=Math.imul(k(o+Math.imul(C(e,r),se)|0,17),Gt),r+=4;for(;r<n;)o=Math.imul(k(o+Math.imul(e[r]??0,ce)|0,11),O),r++;return o^=o>>>15,o=Math.imul(o,W),o^=o>>>13,o=Math.imul(o,se),o^=o>>>16,o>>>0}function de(e){return e.toString(16).padStart(8,"0")}function A(e){let t=typeof e=="string"?Ht(e):e;return de(ue(t,0))+de(ue(t,O))}var d={navigator:"navigator",userAgentData:"user_agent_data",languages:"languages",plugins:"plugins",vendor:"vendor",engine:"engine",math:"math",errors:"errors",screen:"screen",screenFrame:"screen_frame",colorGamut:"color_gamut",mediaQueries:"media_queries",canvas:"canvas",webgl:"webgl",webglExtensions:"webgl_extensions",audio:"audio",audioLatency:"audio_latency",fonts:"fonts",fontPreferences:"font_preferences",intl:"intl",timezone:"timezone",storage:"storage",storageQuota:"storage_quota",storageDurability:"storage_durability",hardware:"hardware",touch:"touch",sensors:"sensors",battery:"battery",mediaDevices:"media_devices",network:"network",speech:"speech",timing:"timing",permissions:"permissions",automation:"automation",shields:"shields",domBlockers:"dom_blockers"};function Se(e,t){let n=e.sources[t];return n?.status==="ok"?n.value:void 0}function f(e){let t={};for(let[n,r]of Object.entries(e))r!==void 0&&(t[n]=r);return t}function s(e){try{return e()}catch{return}}function j(){return typeof window>"u"?void 0:window}function g(){let e=j();if(!e)throw new l("no-window");return e}function ve(e){throw e instanceof Error&&(e.name==="SecurityError"||e.name==="NotAllowedError"||e.name==="NotSupportedError")?new w(e.name):e}var $t=/\{\s*\[native code\]\s*\}\s*$/,jt=[["navigator","webdriver"],["navigator","userAgent"],["navigator","platform"],["navigator","plugins"],["navigator","mimeTypes"],["navigator","languages"],["navigator","language"],["navigator","hardwareConcurrency"],["navigator","deviceMemory"],["navigator","maxTouchPoints"],["navigator","vendor"],["navigator","appVersion"],["navigator","productSub"],["screen","width"],["screen","height"],["screen","availWidth"],["screen","availHeight"],["screen","colorDepth"]];function we(e){let t=[];for(let[o,i]of jt){let a=o==="navigator"?e.navigator:e.screen;if(!a)continue;if(s(()=>Object.getOwnPropertyDescriptor(a,i))){t.push({id:`${o}.${i}`,kind:"descriptor",detail:"own-property-shadows-prototype"});continue}let u=s(()=>Object.getPrototypeOf(a));if(!u)continue;let m=s(()=>Object.getOwnPropertyDescriptor(u,i));if(!m?.get)continue;let p=s(()=>Function.prototype.toString.call(m.get));p!==void 0&&!$t.test(p)&&t.push({id:`${o}.${i}.getter`,kind:"descriptor",detail:"getter-is-not-native"})}let n=s(()=>Object.getPrototypeOf(e.navigator));e.Navigator&&n!==void 0&&n!==e.Navigator.prototype&&t.push({id:"navigator",kind:"prototype",detail:"not-Navigator.prototype"});let r=s(()=>Object.getPrototypeOf(e.screen));return e.Screen&&r!==void 0&&r!==e.Screen.prototype&&t.push({id:"screen",kind:"prototype",detail:"not-Screen.prototype"}),t}var be=/\{\s*\[native code\]\s*\}\s*$/,Xt=[["Function.prototype.toString",()=>Function.prototype.toString],["Function.prototype.bind",()=>Function.prototype.bind],["Object.getOwnPropertyDescriptor",()=>Object.getOwnPropertyDescriptor],["Object.defineProperty",()=>Object.defineProperty],["Date.prototype.getTimezoneOffset",()=>Date.prototype.getTimezoneOffset],["Number.prototype.toFixed",()=>Number.prototype.toFixed],["Error.prototype.toString",()=>Error.prototype.toString],["Intl.DateTimeFormat",()=>Intl?.DateTimeFormat],["Navigator.prototype.javaEnabled",e=>e.Navigator?.prototype?.javaEnabled],["Permissions.prototype.query",e=>e.Permissions?.prototype?.query],["MediaDevices.prototype.enumerateDevices",e=>e.MediaDevices?.prototype?.enumerateDevices],["HTMLCanvasElement.prototype.toDataURL",e=>e.HTMLCanvasElement?.prototype?.toDataURL],["CanvasRenderingContext2D.prototype.getImageData",e=>e.CanvasRenderingContext2D?.prototype?.getImageData],["WebGLRenderingContext.prototype.getParameter",e=>e.WebGLRenderingContext?.prototype?.getParameter],["WebGLRenderingContext.prototype.getExtension",e=>e.WebGLRenderingContext?.prototype?.getExtension],["AudioBuffer.prototype.getChannelData",e=>e.AudioBuffer?.prototype?.getChannelData],["Element.prototype.getBoundingClientRect",e=>e.Element?.prototype?.getBoundingClientRect],["Performance.prototype.now",e=>e.Performance?.prototype?.now],["Screen.prototype.constructor",e=>e.Screen]];function Kt(){let e=Function.prototype.toString;if(typeof document>"u"||!document.body)return{fn:e,clean:!1};let t=s(()=>{let n=document.createElement("iframe");return n.setAttribute("sandbox","allow-same-origin"),n.style.display="none",document.body.appendChild(n),n});if(!t)return{fn:e,clean:!1};try{let n=s(()=>t.contentWindow?.Function?.prototype?.toString);return n?{fn:n,clean:!0}:{fn:e,clean:!1}}finally{t.remove()}}function _e(e){let t=[],n=[],{fn:r,clean:o}=Kt(),i=a=>s(()=>r.call(a));for(let[a,c]of Xt){let u=s(()=>c(e));if(u==null){n.push({id:a,kind:"missing"});continue}if(typeof u!="function")continue;let m=i(u);m!==void 0&&(be.test(m)||(t.push(a),n.push({id:a,kind:"not-native"})))}if(o){let a=Function.prototype.toString,c=i(a);c!==void 0&&!be.test(c)&&(t.includes("Function.prototype.toString")||t.push("Function.prototype.toString"),n.push({id:"Function.prototype.toString",kind:"not-native",detail:"caught-via-fresh-realm"}))}return{patched:t,lies:n}}function I(e){let t=j(),n=Se({schema:1,budget_ms:0,elapsed_ms:0,tiers:[],sources:e,integrity:{patched_natives:[],lies:[],engine:{}}},d.engine),r={...n?.claimed===void 0?{}:{claimed:n.claimed},...n?.observed===void 0?{}:{observed:n.observed}};if(!t)return{patched_natives:[],lies:[],engine:r};let o=_e(t),i=we(t);return{patched_natives:o.patched,lies:[...o.lies,...i],engine:r}}function zt(){let e=globalThis,t=e.OfflineAudioContext??e.webkitOfflineAudioContext;if(!t)throw new l("no-offline-audio-context");return t}async function Ee(e){let t=zt(),n=new t(1,5e3,44100),r=n.createOscillator();r.type="triangle",r.frequency.value=1e4;let o=n.createDynamicsCompressor();o.threshold.value=-50,o.knee.value=40,o.ratio.value=12,o.attack.value=0,o.release.value=.25,r.connect(o),o.connect(n.destination),r.start(0);let a=(await new Promise((u,m)=>{e.signal.addEventListener("abort",()=>m(e.signal.reason),{once:!0}),n.oncomplete=p=>u(p.renderedBuffer);try{let p=n.startRendering();p&&typeof p.then=="function"&&p.then(u,m)}catch(p){m(p)}})).getChannelData(0),c=0;for(let u=4500;u<a.length;u++)c+=Math.abs(a[u]??0);return c}var xe={id:d.audio,tier:"deferred",timeoutMs:500,async run(e){let t=await Ee(e);if(t===0)throw new w("audio-silent");let n=await Ee(e);return f({value:t,unstable:t!==n,sample_rate:44100})}},Te={id:d.audioLatency,tier:"deferred",timeoutMs:200,run(){let e=globalThis,t=e.AudioContext??e.webkitAudioContext;if(!t)throw new l("no-audio-context");let n=new t;try{return f({base_latency:s(()=>n.baseLatency),sample_rate:s(()=>n.sampleRate),state:s(()=>n.state)})}finally{s(()=>{n.close()})}}};var Me={id:d.hardware,tier:"fast",run(){if(typeof navigator>"u")throw new l("no-navigator");let e=navigator;return f({hardware_concurrency:s(()=>e.hardwareConcurrency),device_memory:s(()=>e.deviceMemory)})}},ke={id:d.touch,tier:"fast",run(){let e=g();return f({max_touch_points:s(()=>navigator.maxTouchPoints),touch_event:s(()=>"ontouchstart"in e),touch_start:s(()=>(document.createEvent("TouchEvent"),!0)),pointer_coarse:s(()=>e.matchMedia?.("(pointer: coarse)").matches),any_hover:s(()=>e.matchMedia?.("(any-hover: hover)").matches),device_motion:s(()=>"DeviceMotionEvent"in e),device_orientation:s(()=>"DeviceOrientationEvent"in e)})}},Ae={id:d.sensors,tier:"deferred",timeoutMs:150,async run(e){let t=g(),n="DeviceMotionEvent"in t,r="DeviceOrientationEvent"in t;if(!n&&!r)return f({device_motion:!1,device_orientation:!1});if(typeof document<"u"&&document.visibilityState==="hidden")return f({device_motion:n,device_orientation:r});let o=await new Promise(i=>{let a=!1,c=p=>{a||(a=!0,t.removeEventListener("devicemotion",u),clearTimeout(m),i(p))},u=()=>c(!0),m=setTimeout(()=>c(!1),100);e.signal.addEventListener("abort",()=>c(!1),{once:!0}),t.addEventListener("devicemotion",u,{once:!0})});return f({device_motion:n,device_orientation:r,motion_observed:o})}},Ce={id:d.mediaDevices,tier:"fast",timeoutMs:120,async run(){if(typeof navigator>"u")throw new l("no-navigator");if(typeof navigator.mediaDevices?.enumerateDevices!="function")throw new l("no-media-devices");let e=await navigator.mediaDevices.enumerateDevices();return f({audio_input:e.filter(t=>t.kind==="audioinput").length,audio_output:e.filter(t=>t.kind==="audiooutput").length,video_input:e.filter(t=>t.kind==="videoinput").length,labels_hidden:e.length>0&&e.every(t=>t.label==="")})}},De={id:d.network,tier:"fast",run(){let e=navigator.connection;if(!e)throw new l("no-network-information");return f({effective_type:s(()=>e.effectiveType),downlink:s(()=>e.downlink),rtt:s(()=>e.rtt),save_data:s(()=>e.saveData)})}},Re={id:d.intl,tier:"fast",run(){if(typeof Intl>"u")throw new l("no-intl");let e=s(()=>new Intl.DateTimeFormat().resolvedOptions());return f({timezone:e?.timeZone,timezone_offset:s(()=>new Date().getTimezoneOffset()),locale:e?.locale,calendar:e?.calendar,numbering_system:e?.numberingSystem,formatted:s(()=>new Intl.DateTimeFormat(void 0,{dateStyle:"full",timeStyle:"full"}).format(new Date(0)))})}},Oe={id:d.timezone,tier:"fast",run(){if(typeof Intl>"u")throw new l("no-intl");return f({name:s(()=>new Intl.DateTimeFormat().resolvedOptions().timeZone),offset:s(()=>new Date().getTimezoneOffset())})}},Ne={id:d.battery,tier:"deferred",timeoutMs:250,async run(){if(typeof navigator>"u")throw new l("no-navigator");let e=navigator.getBattery;if(typeof e!="function")throw new l("no-battery-api");let t=await e.call(navigator),n=r=>r===void 0?void 0:Number.isFinite(r)?r:null;return f({charging:t.charging,charging_time:n(t.chargingTime),discharging_time:n(t.dischargingTime),level:t.level})}},Pe={id:d.speech,tier:"deferred",timeoutMs:250,async run(e){if(typeof speechSynthesis>"u")throw new l("no-speech-synthesis");let t=speechSynthesis.getVoices();return t.length===0&&(t=await new Promise(n=>{let r=()=>{speechSynthesis.removeEventListener("voiceschanged",o),e.signal.removeEventListener("abort",i),n(speechSynthesis.getVoices())},o=()=>r(),i=()=>r();speechSynthesis.addEventListener("voiceschanged",o,{once:!0}),e.signal.addEventListener("abort",i,{once:!0}),setTimeout(r,Math.min(100,e.budgetRemainingMs()))})),{voices:t.map(n=>({name:n.name,language:n.lang,local_service:n.localService,default:n.default,uri:n.voiceURI}))}}};var Ie={id:d.screen,tier:"fast",run(){let e=g(),t=e.screen;return f({width:s(()=>t.width),height:s(()=>t.height),avail_width:s(()=>t.availWidth),avail_height:s(()=>t.availHeight),color_depth:s(()=>t.colorDepth),pixel_depth:s(()=>t.pixelDepth),device_pixel_ratio:s(()=>e.devicePixelRatio),orientation:s(()=>t.orientation?.type),inner_width:s(()=>e.innerWidth),inner_height:s(()=>e.innerHeight),frame:s(()=>[t.availTop??null,(t.width??0)-(t.availWidth??0)-(t.availLeft??0),(t.height??0)-(t.availHeight??0)-(t.availTop??0),t.availLeft??null])})}},X;function Qt(e){let t=e.screen;return[t.availTop??null,(t.width??0)-(t.availWidth??0)-(t.availLeft??0),(t.height??0)-(t.availHeight??0)-(t.availTop??0),t.availLeft??null]}var Le={id:d.screenFrame,tier:"fast",run(){let e=g(),t=Qt(e),n=e.document?.fullscreenElement!=null,r=t.every(o=>o===0||o===null);return!n&&!r&&(X=t),{frame:n&&X?[...X]:t}}};function Jt(e,t,n){if(typeof e.matchMedia=="function"){for(let r=0;r<=n;r++)if(e.matchMedia(`(${t}: ${r})`).matches)return r}}function K(e,t){if(typeof e.matchMedia=="function")return t.find(n=>e.matchMedia(n).matches)}var Be={id:d.mediaQueries,tier:"fast",run(){let e=g();if(typeof e.matchMedia!="function")throw new l("no-match-media");let t=K(e,["(color-gamut: rec2020)","(color-gamut: p3)","(color-gamut: srgb)"]),n=K(e,["(prefers-contrast: more)","(prefers-contrast: less)","(prefers-contrast: custom)","(prefers-contrast: no-preference)"]);return f({color_gamut:t?.match(/color-gamut:\s*(\w+)/)?.[1],inverted_colors:s(()=>e.matchMedia("(inverted-colors: inverted)").matches),forced_colors:s(()=>e.matchMedia("(forced-colors: active)").matches),monochrome:Jt(e,"monochrome",10),contrast:n?.match(/prefers-contrast:\s*([\w-]+)/)?.[1],reduced_motion:s(()=>e.matchMedia("(prefers-reduced-motion: reduce)").matches),reduced_transparency:s(()=>e.matchMedia("(prefers-reduced-transparency: reduce)").matches),hdr:s(()=>e.matchMedia("(dynamic-range: high)").matches)})}},Fe={id:d.colorGamut,tier:"fast",run(){let e=g();if(typeof e.matchMedia!="function")throw new l("no-match-media");let n=K(e,["(color-gamut: rec2020)","(color-gamut: p3)","(color-gamut: srgb)"])?.match(/color-gamut:\s*(\w+)/)?.[1];return n==="srgb"||n==="p3"||n==="rec2020"?{gamut:n}:{}}};var Yt=16384,Zt=15,en=9;var tn=250,Ue=600;function nn(e){return new Promise((t,n)=>{let r=indexedDB.open(e,1);r.onupgradeneeded=()=>r.result.createObjectStore("s"),r.onsuccess=()=>t(r.result),r.onerror=()=>n(r.error??new Error("indexeddb-open-failed")),r.onblocked=()=>n(new Error("indexeddb-open-blocked"))})}function rn(e){try{let t=e.transaction("s","readwrite",{durability:"strict"}),n=t.durability==="strict";return t.abort(),n}catch{return!1}}function q(e,t,n){return new Promise((r,o)=>{let i=performance.now(),a=0,c=()=>{if(a===Zt){r(performance.now()-i);return}let u=e.transaction("s","readwrite",{durability:t});u.objectStore("s").put(n,a),a+=1,u.oncomplete=c,u.onerror=u.onabort=()=>o(u.error??new Error("indexeddb-write-failed"))};c()})}var We={id:d.storageDurability,tier:"deferred",timeoutMs:Ue+400,async run(e){if(g(),typeof indexedDB!="object"||indexedDB===null)throw new l("no-indexeddb");let t=e.completed(d.engine);if((t?.status==="ok"?t.value.observed:void 0)!=="chromium")throw new l("not-chromium");let r=`__fingerly_durability_${Math.random().toString(36).slice(2)}`,o=new Uint8Array(Yt),i;try{if(i=await nn(r),!rn(i))return{honored:!1};await q(i,"relaxed",o),await q(i,"strict",o);let a=performance.now(),c=a+Math.min(Ue,Math.max(0,e.budgetRemainingMs()-tn)),u=[];for(;u.length<en&&!e.signal.aborted;){if(u.length>0){let b=(performance.now()-a)/u.length;if(performance.now()+b>c)break}let m=await q(i,"relaxed",o),p=await q(i,"strict",o);if(m>0)u.push(p/m);else break}return u.length===0?{honored:!0,rounds:0}:(u.sort((m,p)=>m-p),f({ratio:u[u.length>>1],rounds:u.length,honored:!0}))}finally{try{i?.close(),indexedDB.deleteDatabase(r)}catch{}}}};var qe=[["easylist",".ad_300x250",".textads"],["easylist_germany",".werbung1",".werbeblock"],["easylist_italy",".pubbl",".banner_pubblicita"],["easylist_dutch",".advertentie-container",".reclame"],["easyprivacy",".trackingpixel","#tracking-pixel"],["fanboy_annoyances","#newsletter-signup-modal",".cookie-consent-banner"],["fanboy_social",".social-share-buttons",".facebook-like-box"],["adguard_base","#adsense_widget",".adsbygoogle-container"],["adguard_annoyances",".push-notification-prompt","#app-install-banner"],["listekr","#ad_wrapper_top",".ad_zone"],["liste_fr",".pub_300x250","#pubfooter"],["ro_list",".reclama-mare","#reclama"]],on=60;function an(){return new Promise(e=>{let t=!1,n=()=>{t||(t=!0,e())};setTimeout(n,on),typeof requestAnimationFrame=="function"&&requestAnimationFrame(()=>setTimeout(n,0))})}function Ve(e){if(e.offsetParent===null||e.offsetHeight===0||e.offsetWidth===0)return!0;let t=getComputedStyle(e);return t.display==="none"||t.visibility==="hidden"}function Ge(e,t){let n=e.createElement("div");return t.startsWith("#")?n.id=t.slice(1):n.className=t.slice(1),n.style.position="absolute",n.style.top="-9999px",n.style.left="-9999px",n.style.width="1px",n.style.height="1px",n}var He={id:d.domBlockers,tier:"deferred",timeoutMs:300,async run(){if(g(),typeof document>"u"||!document.body)throw new l("no-document-body");let e=document.createElement("div");e.style.position="absolute",e.style.top="-9999px",e.style.left="-9999px",e.style.width="1px",e.style.height="1px";let t=Ge(document,".fingerly-control-element");e.appendChild(t);let n=qe.map(([r,...o])=>({name:r,nodes:o.map(i=>{let a=Ge(document,i);return e.appendChild(a),a})}));document.body.appendChild(e);try{if(await an(),Ve(t))return{};let r=n.filter(({nodes:o})=>o.some(Ve)).map(({name:o})=>o);return f({blocked:r,probed:qe.length})}finally{e.remove()}}};function sn(){return s(()=>{try{(-1).toFixed(-1)}catch(e){return e instanceof Error?e.message.length:void 0}})}function cn(){return s(()=>eval.toString().length)}function un(){return s(()=>{let e=new Error("probe").stack;if(!(typeof e!="string"||e===""))return e.includes(" at ")?"v8":/^@|\n@|^\w*@/m.test(e)?e.includes("global code")?"javascriptcore":"spidermonkey":"unknown"})}function dn(e,t,n){let r=[];if(e===51?r.push("chromium"):e===43||e===44?r.push("webkit"):e===25&&r.push("gecko"),t===33&&r.push("chromium"),n==="v8"?r.push("chromium"):n==="javascriptcore"?r.push("webkit"):n==="spidermonkey"&&r.push("gecko"),r.length===0)return;let o=new Map;for(let c of r)o.set(c,(o.get(c)??0)+1);let i,a=0;for(let[c,u]of o)u>a&&(a=u,i=c);return i}function ln(e){if(e){if(/Firefox\//.test(e))return"gecko";if(/Edg\/|OPR\/|Chrome\/|Chromium\//.test(e))return"chromium";if(/Safari\//.test(e))return"webkit"}}var $e={id:d.engine,tier:"fast",run(){let e=sn(),t=cn(),n=un(),r=dn(e,t,n),o=ln(typeof navigator>"u"?void 0:navigator.userAgent);return f({to_fixed_error_length:e,eval_length:t,stack_style:n,observed:r,claimed:o})}},fn=[["acos",()=>Math.acos(.12312423423423424)],["acosh",()=>Math.acosh(1e308)],["asin",()=>Math.asin(.12312423423423424)],["asinh",()=>Math.asinh(1)],["atan",()=>Math.atan(.5)],["atanh",()=>Math.atanh(.5)],["cbrt",()=>Math.cbrt(100)],["cos",()=>Math.cos(10.000000000123)],["cosh",()=>Math.cosh(1)],["exp",()=>Math.exp(1)],["expm1",()=>Math.expm1(1)],["log",()=>Math.log(10)],["log1p",()=>Math.log1p(10)],["pow",()=>Math.pow(Math.PI,-100)],["sin",()=>Math.sin(1e300)],["sinh",()=>Math.sinh(1)],["sqrt",()=>Math.sqrt(2)],["tan",()=>Math.tan(-1e300)],["tanh",()=>Math.tanh(1)]];function mn(){return Object.is(Math.sin(0),0)&&Math.cos(0)===1&&Math.sqrt(4)===2&&Math.log(1)===0&&Math.pow(2,10)===1024}var je={id:d.math,tier:"fast",timeoutMs:50,run(){let e=[],t=0,n=new Map;for(let[r,o]of fn){let i=s(o);typeof i=="number"&&Number.isFinite(i)?(t+=1,n.set(r,i),e.push(`${r}:${i}`)):e.push(`${r}:`)}return f({hash:A(e.join("|")),probed:t,atanh_half:n.get("atanh"),expm1_1:n.get("expm1"),identities_hold:s(mn)})}};function L(e){return s(()=>{try{e()}catch(t){return t instanceof EvalError?void 0:t instanceof Error?t.message.length:void 0}})}function pn(){try{return new Function(""),!0}catch{return!1}}function gn(e){let t=[],n=e.own_properties;if(n!==void 0&&(n.includes("sourceURL")?t.push("webkit","webkit"):n.includes("lineNumber")?t.push("gecko","gecko"):n==="message,stack"&&t.push("chromium","chromium")),e.null_property_length===44?t.push("chromium"):e.null_property_length===33&&t.push("gecko"),e.syntax_length===20?t.push("chromium"):e.syntax_length===28&&t.push("gecko"),t.length===0)return;let r=new Map;for(let c of t)r.set(c,(r.get(c)??0)+1);let o,i=0,a=!1;for(let[c,u]of r)u>i?(i=u,o=c,a=!1):u===i&&(a=!0);return a?void 0:o}function hn(){return s(()=>{try{throw new Error("probe")}catch(e){return Object.getOwnPropertyNames(e).sort().join(",")}})}var Xe={id:d.errors,tier:"fast",timeoutMs:50,run(){let e=pn(),t=f({null_property_length:L(()=>null.x),syntax_length:e?L(()=>new Function("!")):void 0,json_parse_length:L(()=>JSON.parse("{")),invalid_array_length:L(()=>{let n=[];n.length=-1}),const_assign_length:e?L(()=>{new Function("const c = 1; c = 2")()}):void 0,own_properties:hn(),capture_stack_trace:s(()=>typeof Error.captureStackTrace=="function"),stack_trace_limit:s(()=>"stackTraceLimit"in Error)});return f({...t,observed:gn(t)})}};var Ke={id:d.navigator,tier:"fast",run(){if(typeof navigator>"u")throw new l("no-navigator");let e=navigator;return f({user_agent:s(()=>e.userAgent),platform:s(()=>e.platform),vendor:s(()=>e.vendor),product_sub:s(()=>e.productSub),app_version:s(()=>e.appVersion),hardware_concurrency:s(()=>e.hardwareConcurrency),device_memory:s(()=>e.deviceMemory),max_touch_points:s(()=>e.maxTouchPoints),webdriver:s(()=>e.webdriver),cookie_enabled:s(()=>e.cookieEnabled),pdf_viewer_enabled:s(()=>e.pdfViewerEnabled),do_not_track:s(()=>e.doNotTrack),plugin_count:s(()=>e.plugins?.length),mime_type_count:s(()=>e.mimeTypes?.length),language:s(()=>e.language),languages:s(()=>e.languages?[...e.languages]:void 0)})}},ze={id:d.languages,tier:"fast",run(){if(typeof navigator>"u")throw new l("no-navigator");return f({primary:s(()=>navigator.language),accepted:s(()=>navigator.languages?[...navigator.languages]:void 0)})}},Qe={id:d.vendor,tier:"fast",run(){if(typeof navigator>"u")throw new l("no-navigator");return f({vendor:s(()=>navigator.vendor)})}},Je={id:d.plugins,tier:"fast",run(){if(typeof navigator>"u")throw new l("no-navigator");let e=navigator.plugins;if(!e)throw new l("no-plugins");return{plugins:Array.from(e,t=>({name:t.name,filename:t.filename,description:t.description,mime_types:Array.from(t,n=>({type:n.type,suffixes:n.suffixes,description:n.description}))}))}}},Ye={id:d.userAgentData,tier:"deferred",timeoutMs:200,async run(){if(typeof navigator>"u")throw new l("no-navigator");let e=navigator.userAgentData;if(!e)throw new l("no-user-agent-data");let t=f({brands:e.brands,mobile:e.mobile,platform:e.platform});if(typeof e.getHighEntropyValues!="function")return t;let n=await e.getHighEntropyValues(["architecture","bitness","model","platformVersion","fullVersionList","wow64"]);return{...t,...n}}};function z(e,t){let n=document.createElement("canvas");n.width=e,n.height=t;let r=n.getContext("2d");if(!r)throw new l("no-2d-context");return[n,r]}function Ze(){let[e,t]=z(240,60);t.globalCompositeOperation="multiply";for(let[n,r,o]of[["#f2f",40,40],["#2ff",80,40],["#ff2",60,80]])t.fillStyle=n,t.beginPath(),t.arc(r,o,40,0,Math.PI*2,!0),t.closePath(),t.fill();return t.fillStyle="#f9c",t.arc(100,50,50,0,Math.PI*2,!0),t.arc(100,50,20,0,Math.PI*2,!0),t.fill("evenodd"),e.toDataURL()}function et(){let[e,t]=z(300,60);return t.textBaseline="alphabetic",t.fillStyle="#f60",t.fillRect(100,1,62,20),t.fillStyle="#069",t.font='11pt "Times New Roman"',t.fillText("Fingerly <canvas> 1.0 \u{1F512}\u0416\u4E2D",2,15),t.font="18pt Arial",t.fillStyle="rgba(102, 204, 0, 0.7)",t.fillText("Fingerly <canvas> 1.0",4,45),e.toDataURL()}function yn(){let[,e]=z(1,1);return e.rect(0,0,10,10),e.rect(2,2,6,6),e.isPointInPath(5,5,"evenodd")===!1}function Sn(e){let t=e.completed(d.timing);if(t?.status!=="ok")return!1;let n=t.value?.now_resolution;return typeof n=="number"&&n>=16}var tt={id:d.canvas,tier:"deferred",timeoutMs:400,run(e){if(g(),typeof document>"u")throw new l("no-document");if(Sn(e))throw new w("rfp-canvas-prompt-avoided");try{let t=Ze(),n=Ze(),r=et(),o=et(),i=t!==n||r!==o;return f({geometry:A(t),text:A(r),winding:s(yn),unstable:i})}catch(t){ve(t)}}};function nt(){if(typeof document>"u")throw new l("no-document");let e=document.createElement("canvas"),t=e.getContext("webgl")??e.getContext("experimental-webgl");if(!t)throw new l("no-webgl-context");return t}var rt={id:d.webgl,tier:"fast",timeoutMs:400,run(){let e=nt(),t=s(()=>e.getExtension("WEBGL_debug_renderer_info")),n={};for(let o of["MAX_TEXTURE_SIZE","MAX_VIEWPORT_DIMS","MAX_VERTEX_ATTRIBS","MAX_VARYING_VECTORS","MAX_COMBINED_TEXTURE_IMAGE_UNITS","MAX_CUBE_MAP_TEXTURE_SIZE","MAX_FRAGMENT_UNIFORM_VECTORS","MAX_RENDERBUFFER_SIZE","MAX_TEXTURE_IMAGE_UNITS","MAX_VERTEX_TEXTURE_IMAGE_UNITS","MAX_VERTEX_UNIFORM_VECTORS","ALIASED_LINE_WIDTH_RANGE","ALIASED_POINT_SIZE_RANGE","RED_BITS","GREEN_BITS","BLUE_BITS","ALPHA_BITS","DEPTH_BITS","STENCIL_BITS"]){let i=e[o];if(typeof i!="number")continue;let a=s(()=>e.getParameter(i));a!=null&&(n[o]=ArrayBuffer.isView(a)?Array.from(a):a)}let r=[];for(let o of[e.VERTEX_SHADER,e.FRAGMENT_SHADER])for(let i of[e.LOW_FLOAT,e.MEDIUM_FLOAT,e.HIGH_FLOAT]){let a=s(()=>e.getShaderPrecisionFormat(o,i));a&&r.push(a.rangeMin,a.rangeMax,a.precision)}return f({vendor:s(()=>e.getParameter(e.VENDOR)),renderer:s(()=>e.getParameter(e.RENDERER)),unmasked_vendor:t?s(()=>e.getParameter(t.UNMASKED_VENDOR_WEBGL)):void 0,unmasked_renderer:t?s(()=>e.getParameter(t.UNMASKED_RENDERER_WEBGL)):void 0,version:s(()=>e.getParameter(e.VERSION)),shading_language_version:s(()=>e.getParameter(e.SHADING_LANGUAGE_VERSION)),max_texture_size:s(()=>e.getParameter(e.MAX_TEXTURE_SIZE)),max_render_buffer_size:s(()=>e.getParameter(e.MAX_RENDERBUFFER_SIZE)),parameters_hash:Object.keys(n).length>0?A(JSON.stringify(n)):void 0,shader_precision_hash:r.length>0?A(r.join(",")):void 0})}},ot={id:d.webglExtensions,tier:"deferred",timeoutMs:200,run(){let t=nt().getSupportedExtensions();if(!t)throw new w("extensions-withheld");return[...t].sort()}};function vn(e){let t=[],n=Date.now()+12;for(;t.length<25&&Date.now()<n;){let r=e(),o=e(),i=0;for(;o===r&&i++<1e5&&Date.now()<n;)o=e();o!==r&&t.push(o-r)}return t.length===0?100:Math.round(Math.min(...t)*1e6)/1e6}var at={id:d.timing,tier:"fast",timeoutMs:150,run(){let t=g().performance;return typeof t?.now!="function"?f({has_performance:!1}):f({has_performance:!0,now_resolution:vn(()=>t.now())})}},it=new WeakMap;function wn(e,t){let n=it.get(e.navigator);n||(n=new Map,it.set(e.navigator,n));let r=n.get(t);return r||(r=e.navigator.permissions.query({name:t}),n.set(t,r)),r}var st={id:d.permissions,tier:"fast",timeoutMs:200,async run(){let e=g();if(!e.navigator.permissions?.query)throw new l("no-permissions-api");let t=async o=>{try{return(await wn(e,o)).state}catch{return}},n=await t("notifications"),r=s(()=>e.Notification?.permission);return f({notification:n,notification_legacy:r,geolocation:await t("geolocation")})}},bn=["__nightmare","_phantom","callPhantom","__phantomas","Buffer","emit","spawn","__selenium_evaluate","__selenium_unwrapped","__webdriver_evaluate","__webdriver_script_fn","__webdriver_script_func","__webdriver_unwrapped","__fxdriver_evaluate","__fxdriver_unwrapped","__driver_evaluate","__driver_unwrapped","_Selenium_IDE_Recorder","domAutomation","domAutomationController","__lastWatirAlert","__playwright","__puppeteer","__pw_manual"],ct={id:d.automation,tier:"fast",run(){let e=g(),t=bn.filter(r=>s(()=>r in e)===!0),n=s(()=>Object.getOwnPropertyNames(e).filter(r=>/^cdc_|^\$cdc_/.test(r)));return f({webdriver:s(()=>navigator.webdriver),cdp_artifacts:n&&n.length>0?n:void 0,distinctive_properties:t.length>0?[...t]:void 0,chrome_object:s(()=>"chrome"in e),window_external:s(()=>{let r=e.external;return r?String(r):void 0})})}};var _n=50,ut=Symbol("timed-out");async function En(e){if(typeof e.brave?.isBrave=="function")try{let t=await Promise.race([e.brave.isBrave(),new Promise(n=>setTimeout(()=>n(ut),_n))]);return t===ut?void 0:t===!0}catch{return}}function xn(e){let t=e.userAgentData?.brands;if(Array.isArray(t))return t.some(n=>n?.brand==="Brave")}var dt=[[30,60,90],[210,180,140]],S=8;function Tn(){if(!(typeof document>"u"))try{let e=document.createElement("canvas");e.width=S,e.height=S;let t=e.getContext("2d",{willReadFrequently:!0});if(!t)return;for(let r=0;r<S;r++)for(let o=0;o<S;o++){let[i,a,c]=dt[(o+r)%2];t.fillStyle=`rgb(${i}, ${a}, ${c})`,t.fillRect(o,r,1,1)}let n=t.getImageData(0,0,S,S).data;for(let r=0;r<S*S;r++){let o=r%S,i=Math.floor(r/S),[a,c,u]=dt[(o+i)%2],m=r*4;if(n[m]!==a||n[m+1]!==c||n[m+2]!==u||n[m+3]!==255)return!0}return!1}catch{return}}var lt={id:d.shields,tier:"fast",timeoutMs:100,async run(){if(typeof navigator>"u")throw new l("no-navigator");let e=navigator;return f({brave:await En(e),brave_claimed:xn(e),canvas_noise:Tn()})}};function ft(e){try{let t=window[e];if(!t)return!1;let n="__fingerly_probe__";return t.setItem(n,"1"),t.removeItem(n),!0}catch{return!1}}function Mn(){try{return typeof window.indexedDB=="object"&&window.indexedDB!==null}catch{return!1}}function kn(e){let t=e instanceof Error?e.name:"",n=e instanceof Error?e.message:String(e);return n.includes("unknown transient reason")?"transient":t==="SecurityError"||n.includes("Security error")?"refused":"failed"}var An=200;async function Cn(){let e=navigator.storage;if(typeof e?.getDirectory=="function")return Promise.race([e.getDirectory().then(()=>"ok",t=>kn(t)),new Promise(t=>setTimeout(t,An))])}var Dn=150;function Rn(){let e=navigator.webkitTemporaryStorage;return typeof e?.queryUsageAndQuota!="function"?Promise.resolve(void 0):new Promise(t=>{let n=!1,r=o=>{n||(n=!0,t(o))};setTimeout(()=>r(void 0),Dn);try{e.queryUsageAndQuota((o,i)=>r(typeof i=="number"?i:void 0),()=>r(void 0))}catch{r(void 0)}})}function On(){if(window.isSecureContext)return"serviceWorker"in navigator}var mt={id:d.storage,tier:"fast",timeoutMs:250,async run(){g();let e=s(async()=>{if(typeof navigator.storage?.estimate!="function")return;let u=await navigator.storage.estimate();return{quota:u.quota,usage:u.usage}}),t=Rn(),n=Cn(),[r,o,i]=await Promise.all([e,t,n]),a=r?.quota,c=navigator.deviceMemory;return f({local_storage:ft("localStorage"),session_storage:ft("sessionStorage"),indexed_db:Mn(),quota:a,usage:r?.usage,legacy_quota:o,quota_ratio:typeof a=="number"&&typeof c=="number"&&c>0?a/(c*1024*1024*1024):void 0,origin_filesystem:i,service_worker:On()})}},pt={id:d.storageQuota,tier:"fast",run(){if(g(),typeof document>"u")throw new l("no-document");return{partitioned:typeof document.hasStorageAccess=="function"}}};var gt=["monospace","sans-serif","serif"],Nn="72px",Pn="mmmmmmmmmmlli WwMmIi 0123",Q=["Arial","Arial Black","Calibri","Cambria","Candara","Comic Sans MS","Consolas","Constantia","Corbel","Courier New","Ebrima","Franklin Gothic","Gabriola","Georgia","Impact","Lucida Console","Lucida Sans Unicode","Malgun Gothic","Marlett","Microsoft Himalaya","MS Gothic","MV Boli","Nirmala UI","Palatino Linotype","Segoe UI","Segoe UI Emoji","Sylfaen","Tahoma","Times New Roman","Trebuchet MS","Verdana","Webdings","Wingdings","American Typewriter","Andale Mono","Apple Chancery","Arial Hebrew","Avenir","Avenir Next","Baskerville","Big Caslon","Bodoni 72","Chalkboard","Cochin","Copperplate","Didot","Futura","Geneva","Gill Sans","Helvetica","Helvetica Neue","Herculanum","Hoefler Text","Lucida Grande","Luminari","Menlo","Monaco","Optima","Papyrus","Phosphate","Rockwell","SF Pro","Skia","Snell Roundhand","Trattatello","Zapfino","Cantarell","DejaVu Sans","DejaVu Serif","FreeSans","Liberation Sans","Liberation Serif","Nimbus Sans","Noto Sans","Ubuntu","Ubuntu Mono","Droid Sans","Roboto","Roboto Condensed","Bahnschrift","Bookshelf Symbol 7","Cascadia Code","Fira Code","HoloLens MDL2 Assets","Inter","JetBrains Mono","MT Extra","Source Code Pro","Wingdings 2","Wingdings 3"],ht={id:d.fonts,tier:"deferred",timeoutMs:700,run(){if(typeof document>"u")throw new l("no-document");let e=document.createElement("div");e.style.cssText="position:absolute;left:-9999px;top:-9999px;visibility:hidden;width:auto;height:auto;margin:0;padding:0;white-space:nowrap;";let t=o=>{let i=document.createElement("span");return i.style.cssText=`position:absolute;font-size:${Nn};margin:0;padding:0;font-family:${o};`,i.textContent=Pn,e.appendChild(i),i},n=gt.map(o=>t(o)),r=Q.map(o=>gt.map(i=>t(`'${o}',${i}`)));document.body.appendChild(e);try{let o=n.map(c=>c.offsetWidth),i=n.map(c=>c.offsetHeight),a=[];return Q.forEach((c,u)=>{let m=r[u];if(!m)return;m.every((b,y)=>{let _=o[y],E=i[y];return b.offsetWidth!==_||b.offsetHeight!==E})&&a.push(c)}),f({available:a,probed:Q.length})}finally{e.remove()}}},yt={id:d.fontPreferences,tier:"deferred",timeoutMs:250,run(){if(typeof document>"u"||!document.body)throw new l("no-document-body");let e=document.createElement("iframe");e.setAttribute("aria-hidden","true"),e.style.cssText="position:absolute;left:-9999px;width:1px;height:1px;border:0",document.body.appendChild(e);try{let t=e.contentDocument;if(!t?.body)throw new l("no-frame-document");let n="mmMwWLliI0O&1",r={default:"",serif:"serif",sans:"sans-serif",mono:"monospace",system:"system-ui",apple:"-apple-system",min:"Arial, sans-serif"},o={};for(let[i,a]of Object.entries(r)){let c=t.createElement("span");c.textContent=n,c.style.cssText=`font:72px ${a||"initial"};white-space:nowrap;position:absolute`,t.body.appendChild(c),o[i]=Math.round(c.getBoundingClientRect().width*1e3)/1e3}return{widths:o}}finally{e.remove()}}};var B=[$e,Xe,je,Ke,ze,Je,Qe,Ie,Le,Be,Fe,Me,ke,De,Re,Oe,mt,pt,lt,at,st,ct,rt,Ce,tt,ot,xe,Te,ht,yt,Ne,Pe,Ae,Ye,He,We];function St(e){return new Promise(t=>t(new P({...e,platform:"web",sources:e.sources??B,integrity:n=>I(n.sources)})))}return xt(In);})();
|
package/dist/index.cjs
CHANGED
|
@@ -33,135 +33,6 @@ function asBlockedIfRefused(error) {
|
|
|
33
33
|
}
|
|
34
34
|
throw error;
|
|
35
35
|
}
|
|
36
|
-
function asReport(sources) {
|
|
37
|
-
return {
|
|
38
|
-
schema: 1,
|
|
39
|
-
budget_ms: 0,
|
|
40
|
-
elapsed_ms: 0,
|
|
41
|
-
tiers: [],
|
|
42
|
-
sources,
|
|
43
|
-
integrity: { patched_natives: [], lies: [], engine: {} }
|
|
44
|
-
};
|
|
45
|
-
}
|
|
46
|
-
function claimedOs(userAgent) {
|
|
47
|
-
if (!userAgent) return void 0;
|
|
48
|
-
if (/Windows NT/i.test(userAgent)) return "windows";
|
|
49
|
-
if (/Android/i.test(userAgent)) return "android";
|
|
50
|
-
if (/iPhone|iPad|iPod/i.test(userAgent)) return "ios";
|
|
51
|
-
if (/Mac OS X/i.test(userAgent)) return "macos";
|
|
52
|
-
if (/Linux/i.test(userAgent)) return "linux";
|
|
53
|
-
return void 0;
|
|
54
|
-
}
|
|
55
|
-
function impliedOs(renderer) {
|
|
56
|
-
if (!renderer) return void 0;
|
|
57
|
-
const r = renderer.toLowerCase();
|
|
58
|
-
if (r.includes("direct3d") || r.includes("d3d11") || r.includes("d3d9")) return "windows";
|
|
59
|
-
if (r.includes("metal") || r.includes("apple")) return "apple";
|
|
60
|
-
if (r.includes("adreno") || r.includes("mali") || r.includes("powervr")) return "mobile";
|
|
61
|
-
return void 0;
|
|
62
|
-
}
|
|
63
|
-
function findContradictions(sources) {
|
|
64
|
-
const report = asReport(sources);
|
|
65
|
-
const lies = [];
|
|
66
|
-
const nav = core.valueOf(report, core.SOURCE.navigator);
|
|
67
|
-
const engine = core.valueOf(report, core.SOURCE.engine);
|
|
68
|
-
const errors = core.valueOf(report, core.SOURCE.errors);
|
|
69
|
-
const maths = core.valueOf(report, core.SOURCE.math);
|
|
70
|
-
const webgl = core.valueOf(report, core.SOURCE.webgl);
|
|
71
|
-
const touch = core.valueOf(report, core.SOURCE.touch);
|
|
72
|
-
const screen = core.valueOf(report, core.SOURCE.screen);
|
|
73
|
-
if (engine?.agrees === false) {
|
|
74
|
-
lies.push({
|
|
75
|
-
id: "user-agent-vs-engine",
|
|
76
|
-
kind: "contradiction",
|
|
77
|
-
detail: `claimed-${engine.claimed}-observed-${engine.observed}`
|
|
78
|
-
});
|
|
79
|
-
}
|
|
80
|
-
if (errors?.observed && engine?.observed && errors.observed !== engine.observed) {
|
|
81
|
-
lies.push({
|
|
82
|
-
id: "engine-vs-error-shapes",
|
|
83
|
-
kind: "contradiction",
|
|
84
|
-
detail: `engine-${engine.observed}-errors-${errors.observed}`
|
|
85
|
-
});
|
|
86
|
-
}
|
|
87
|
-
const claimed = engine?.claimed;
|
|
88
|
-
if (errors?.observed && claimed && errors.observed !== claimed) {
|
|
89
|
-
lies.push({
|
|
90
|
-
id: "user-agent-vs-error-shapes",
|
|
91
|
-
kind: "contradiction",
|
|
92
|
-
detail: `claimed-${claimed}-errors-${errors.observed}`
|
|
93
|
-
});
|
|
94
|
-
}
|
|
95
|
-
if (maths?.identities_hold === false) {
|
|
96
|
-
lies.push({
|
|
97
|
-
id: "math-identities",
|
|
98
|
-
kind: "contradiction",
|
|
99
|
-
detail: "math-builtins-do-not-hold-exact-identities"
|
|
100
|
-
});
|
|
101
|
-
}
|
|
102
|
-
const os = claimedOs(nav?.user_agent);
|
|
103
|
-
const gpu = impliedOs(webgl?.unmasked_renderer ?? webgl?.renderer);
|
|
104
|
-
if (os && gpu) {
|
|
105
|
-
const consistent = gpu === "windows" && os === "windows" || gpu === "apple" && (os === "macos" || os === "ios") || gpu === "mobile" && (os === "android" || os === "ios");
|
|
106
|
-
if (!consistent) {
|
|
107
|
-
lies.push({
|
|
108
|
-
id: "user-agent-vs-gpu",
|
|
109
|
-
kind: "contradiction",
|
|
110
|
-
detail: `os-${os}-gpu-${gpu}`
|
|
111
|
-
});
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
if (nav?.platform && os) {
|
|
115
|
-
const platform = nav.platform.toLowerCase();
|
|
116
|
-
const consistent = os === "windows" && platform.startsWith("win") || os === "macos" && platform.startsWith("mac") || os === "ios" && (platform.startsWith("iphone") || platform.startsWith("ipad") || platform.startsWith("mac")) || os === "android" && (platform.startsWith("linux") || platform.startsWith("android")) || os === "linux" && platform.startsWith("linux");
|
|
117
|
-
if (!consistent) {
|
|
118
|
-
lies.push({
|
|
119
|
-
id: "user-agent-vs-platform",
|
|
120
|
-
kind: "contradiction",
|
|
121
|
-
detail: `os-${os}-platform-${nav.platform}`
|
|
122
|
-
});
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
if (touch) {
|
|
126
|
-
const points = touch.max_touch_points;
|
|
127
|
-
if (typeof points === "number" && points > 0 && touch.pointer_coarse === false && touch.any_hover === true) {
|
|
128
|
-
lies.push({
|
|
129
|
-
id: "touch-points-vs-pointer-media",
|
|
130
|
-
kind: "contradiction",
|
|
131
|
-
detail: "touch-claimed-with-fine-pointer-and-hover"
|
|
132
|
-
});
|
|
133
|
-
}
|
|
134
|
-
if (touch.touch_event === true && typeof points === "number" && points === 0) {
|
|
135
|
-
lies.push({
|
|
136
|
-
id: "touch-event-vs-touch-points",
|
|
137
|
-
kind: "contradiction",
|
|
138
|
-
detail: "ontouchstart-present-with-zero-points"
|
|
139
|
-
});
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
if (typeof screen?.inner_width === "number" && typeof screen.width === "number" && screen.width > 0 && screen.inner_width > screen.width) {
|
|
143
|
-
lies.push({
|
|
144
|
-
id: "viewport-larger-than-screen",
|
|
145
|
-
kind: "contradiction",
|
|
146
|
-
detail: `inner-${screen.inner_width}-screen-${screen.width}`
|
|
147
|
-
});
|
|
148
|
-
}
|
|
149
|
-
if (nav?.product_sub !== void 0 && (engine?.observed === "chromium" || engine?.observed === "webkit") && nav.product_sub !== "20030107") {
|
|
150
|
-
lies.push({
|
|
151
|
-
id: "product-sub",
|
|
152
|
-
kind: "contradiction",
|
|
153
|
-
detail: `expected-20030107-got-${nav.product_sub}`
|
|
154
|
-
});
|
|
155
|
-
}
|
|
156
|
-
if (nav?.language && nav.languages && nav.languages.length > 0 && nav.languages[0] !== nav.language) {
|
|
157
|
-
lies.push({
|
|
158
|
-
id: "language-vs-languages",
|
|
159
|
-
kind: "contradiction",
|
|
160
|
-
detail: `language-${nav.language}-languages-${nav.languages[0]}`
|
|
161
|
-
});
|
|
162
|
-
}
|
|
163
|
-
return lies;
|
|
164
|
-
}
|
|
165
36
|
|
|
166
37
|
// src/lies/descriptors.ts
|
|
167
38
|
var NATIVE_PATTERN = /\{\s*\[native code\]\s*\}\s*$/;
|
|
@@ -314,7 +185,6 @@ function findPatchedNatives(w) {
|
|
|
314
185
|
// src/lies/index.ts
|
|
315
186
|
function inspectIntegrity(sources) {
|
|
316
187
|
const w = windowOrNull();
|
|
317
|
-
const contradictions = findContradictions(sources);
|
|
318
188
|
const engine = core.valueOf(
|
|
319
189
|
{
|
|
320
190
|
schema: 1,
|
|
@@ -328,17 +198,16 @@ function inspectIntegrity(sources) {
|
|
|
328
198
|
);
|
|
329
199
|
const identity = {
|
|
330
200
|
...engine?.claimed === void 0 ? {} : { claimed: engine.claimed },
|
|
331
|
-
...engine?.observed === void 0 ? {} : { observed: engine.observed }
|
|
332
|
-
...engine?.agrees === void 0 ? {} : { agrees: engine.agrees }
|
|
201
|
+
...engine?.observed === void 0 ? {} : { observed: engine.observed }
|
|
333
202
|
};
|
|
334
203
|
if (!w) {
|
|
335
|
-
return { patched_natives: [], lies:
|
|
204
|
+
return { patched_natives: [], lies: [], engine: identity };
|
|
336
205
|
}
|
|
337
206
|
const natives = findPatchedNatives(w);
|
|
338
207
|
const descriptors = findRedefinedProperties(w);
|
|
339
208
|
return {
|
|
340
209
|
patched_natives: natives.patched,
|
|
341
|
-
lies: [...natives.lies, ...descriptors
|
|
210
|
+
lies: [...natives.lies, ...descriptors],
|
|
342
211
|
engine: identity
|
|
343
212
|
};
|
|
344
213
|
}
|
|
@@ -438,7 +307,12 @@ var touchSource = {
|
|
|
438
307
|
return true;
|
|
439
308
|
}),
|
|
440
309
|
pointer_coarse: attempt(() => w.matchMedia?.("(pointer: coarse)").matches),
|
|
441
|
-
any_hover: attempt(() => w.matchMedia?.("(any-hover: hover)").matches)
|
|
310
|
+
any_hover: attempt(() => w.matchMedia?.("(any-hover: hover)").matches),
|
|
311
|
+
// Presence only, and in the fast tier for that reason: the deferred
|
|
312
|
+
// `sensors` source is what waits to see whether an event fires. This is
|
|
313
|
+
// what the server's mobile-UA-with-no-motion-sensors rule reads.
|
|
314
|
+
device_motion: attempt(() => "DeviceMotionEvent" in w),
|
|
315
|
+
device_orientation: attempt(() => "DeviceOrientationEvent" in w)
|
|
442
316
|
});
|
|
443
317
|
}
|
|
444
318
|
};
|
|
@@ -485,8 +359,8 @@ var sensorsSource = {
|
|
|
485
359
|
};
|
|
486
360
|
var mediaDevicesSource = {
|
|
487
361
|
id: core.SOURCE.mediaDevices,
|
|
488
|
-
tier: "
|
|
489
|
-
timeoutMs:
|
|
362
|
+
tier: "fast",
|
|
363
|
+
timeoutMs: 120,
|
|
490
364
|
async run() {
|
|
491
365
|
if (typeof navigator === "undefined") throw new core.UnsupportedSignal("no-navigator");
|
|
492
366
|
if (typeof navigator.mediaDevices?.enumerateDevices !== "function") {
|
|
@@ -941,7 +815,7 @@ function observedEngine(toFixed, evalLen, stack) {
|
|
|
941
815
|
}
|
|
942
816
|
function claimedEngine(userAgent) {
|
|
943
817
|
if (!userAgent) return void 0;
|
|
944
|
-
if (/Firefox
|
|
818
|
+
if (/Firefox\//.test(userAgent)) return "gecko";
|
|
945
819
|
if (/Edg\/|OPR\/|Chrome\/|Chromium\//.test(userAgent)) return "chromium";
|
|
946
820
|
if (/Safari\//.test(userAgent)) return "webkit";
|
|
947
821
|
return void 0;
|
|
@@ -962,11 +836,9 @@ var engineSource = {
|
|
|
962
836
|
eval_length: evalLen,
|
|
963
837
|
stack_style: stack,
|
|
964
838
|
observed,
|
|
965
|
-
|
|
966
|
-
//
|
|
967
|
-
|
|
968
|
-
// detector weighs the second one heavily.
|
|
969
|
-
agrees: observed === void 0 || claimed === void 0 ? void 0 : observed === claimed
|
|
839
|
+
// Compared on the server, where "we could not tell" and "they disagree"
|
|
840
|
+
// are kept apart by which of the two is missing.
|
|
841
|
+
claimed
|
|
970
842
|
});
|
|
971
843
|
}
|
|
972
844
|
};
|
|
@@ -1399,6 +1271,20 @@ var timingSource = {
|
|
|
1399
1271
|
});
|
|
1400
1272
|
}
|
|
1401
1273
|
};
|
|
1274
|
+
var permissionStatuses = /* @__PURE__ */ new WeakMap();
|
|
1275
|
+
function permissionStatus(w, name) {
|
|
1276
|
+
let byName = permissionStatuses.get(w.navigator);
|
|
1277
|
+
if (!byName) {
|
|
1278
|
+
byName = /* @__PURE__ */ new Map();
|
|
1279
|
+
permissionStatuses.set(w.navigator, byName);
|
|
1280
|
+
}
|
|
1281
|
+
let status = byName.get(name);
|
|
1282
|
+
if (!status) {
|
|
1283
|
+
status = w.navigator.permissions.query({ name });
|
|
1284
|
+
byName.set(name, status);
|
|
1285
|
+
}
|
|
1286
|
+
return status;
|
|
1287
|
+
}
|
|
1402
1288
|
var permissionsSource = {
|
|
1403
1289
|
id: core.SOURCE.permissions,
|
|
1404
1290
|
tier: "fast",
|
|
@@ -1408,7 +1294,7 @@ var permissionsSource = {
|
|
|
1408
1294
|
if (!w.navigator.permissions?.query) throw new core.UnsupportedSignal("no-permissions-api");
|
|
1409
1295
|
const query = async (name) => {
|
|
1410
1296
|
try {
|
|
1411
|
-
return (await w
|
|
1297
|
+
return (await permissionStatus(w, name)).state;
|
|
1412
1298
|
} catch {
|
|
1413
1299
|
return void 0;
|
|
1414
1300
|
}
|
|
@@ -1418,12 +1304,7 @@ var permissionsSource = {
|
|
|
1418
1304
|
return compact({
|
|
1419
1305
|
notification,
|
|
1420
1306
|
notification_legacy: legacy,
|
|
1421
|
-
geolocation: await query("geolocation")
|
|
1422
|
-
inconsistent: notification !== void 0 && legacy !== void 0 ? (
|
|
1423
|
-
// `default` and `prompt` are the same state under two names, which
|
|
1424
|
-
// is why this is not a plain string comparison.
|
|
1425
|
-
(legacy === "default" ? "prompt" : legacy) !== notification
|
|
1426
|
-
) : void 0
|
|
1307
|
+
geolocation: await query("geolocation")
|
|
1427
1308
|
});
|
|
1428
1309
|
}
|
|
1429
1310
|
};
|
|
@@ -1872,6 +1753,7 @@ var browserSources = [
|
|
|
1872
1753
|
permissionsSource,
|
|
1873
1754
|
automationSource,
|
|
1874
1755
|
webglSource,
|
|
1756
|
+
mediaDevicesSource,
|
|
1875
1757
|
// deferred
|
|
1876
1758
|
canvasSource,
|
|
1877
1759
|
webglExtensionsSource,
|
|
@@ -1882,19 +1764,20 @@ var browserSources = [
|
|
|
1882
1764
|
batterySource,
|
|
1883
1765
|
speechSource,
|
|
1884
1766
|
sensorsSource,
|
|
1885
|
-
mediaDevicesSource,
|
|
1886
1767
|
userAgentDataSource,
|
|
1887
1768
|
domBlockersSource,
|
|
1888
1769
|
storageDurabilitySource
|
|
1889
1770
|
];
|
|
1890
1771
|
function load(options) {
|
|
1891
|
-
return Promise
|
|
1892
|
-
|
|
1893
|
-
|
|
1894
|
-
|
|
1895
|
-
|
|
1896
|
-
|
|
1897
|
-
|
|
1772
|
+
return new Promise(
|
|
1773
|
+
(resolve) => resolve(
|
|
1774
|
+
new core.FingerlyClient({
|
|
1775
|
+
...options,
|
|
1776
|
+
platform: "web",
|
|
1777
|
+
sources: options.sources ?? browserSources,
|
|
1778
|
+
integrity: (report) => inspectIntegrity(report.sources)
|
|
1779
|
+
})
|
|
1780
|
+
)
|
|
1898
1781
|
);
|
|
1899
1782
|
}
|
|
1900
1783
|
|
|
@@ -1914,6 +1797,10 @@ Object.defineProperty(exports, "TransportError", {
|
|
|
1914
1797
|
enumerable: true,
|
|
1915
1798
|
get: function () { return core.TransportError; }
|
|
1916
1799
|
});
|
|
1800
|
+
Object.defineProperty(exports, "isSuspiciousLevel", {
|
|
1801
|
+
enumerable: true,
|
|
1802
|
+
get: function () { return core.isSuspiciousLevel; }
|
|
1803
|
+
});
|
|
1917
1804
|
exports.browserSources = browserSources;
|
|
1918
1805
|
exports.inspectIntegrity = inspectIntegrity;
|
|
1919
1806
|
exports.load = load;
|
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Source, SignalOutcome, IntegrityReport, FingerlyClientOptions, FingerlyClient } from '@fingerly/core';
|
|
2
|
-
export { Confidence, ConsentError, ConsentState, FingerlyClient, FingerlyEvent, FingerlyWebEvent, IdentifyOptions, IdentifyResult,
|
|
2
|
+
export { Confidence, ConsentError, ConsentState, FingerlyClient, FingerlyEvent, FingerlyWebEvent, IdentifyOptions, IdentifyResult, IntegrityReport, Lie, SOURCE, SignalOutcome, SignalReport, SignalStatus, TransportError, isSuspiciousLevel } from '@fingerly/core';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* The browser source set.
|
|
@@ -20,6 +20,12 @@ declare const browserSources: readonly Source[];
|
|
|
20
20
|
* for two reasons: it reads what the other sources produced, so it cannot run
|
|
21
21
|
* beside them; and a tamper check that competed for the budget could be starved
|
|
22
22
|
* by a slow source, which is precisely the outcome an attacker would arrange.
|
|
23
|
+
*
|
|
24
|
+
* What it reports is raw: which natives are patched, which properties were
|
|
25
|
+
* redefined. Whether the reported values contradict each other - a user agent
|
|
26
|
+
* claiming a phone that hovers, a language that is not the first of its own
|
|
27
|
+
* languages - is the server's reading of the same sources, not something the
|
|
28
|
+
* page decides.
|
|
23
29
|
*/
|
|
24
30
|
|
|
25
31
|
declare function inspectIntegrity(sources: Record<string, SignalOutcome>): IntegrityReport;
|
|
@@ -28,27 +34,26 @@ declare function inspectIntegrity(sources: Record<string, SignalOutcome>): Integ
|
|
|
28
34
|
* @fingerly/web-js - the browser SDK.
|
|
29
35
|
*
|
|
30
36
|
* Wires the browser source set and the tamper layer into `@fingerly/core`'s
|
|
31
|
-
* client. Everything platform-specific is in this package;
|
|
32
|
-
*
|
|
33
|
-
*
|
|
37
|
+
* client. Everything platform-specific is in this package; scheduling and
|
|
38
|
+
* transport are in the kernel, and scoring is on the server, where customers
|
|
39
|
+
* set the weights and a page cannot read or edit them.
|
|
34
40
|
*
|
|
35
41
|
* ```ts
|
|
36
42
|
* import { load } from '@fingerly/web-js'
|
|
37
43
|
*
|
|
38
44
|
* const fingerly = await load({ apiKey: 'fly_pk_production_…' })
|
|
39
|
-
* const { visitorId, visitorIsNew,
|
|
45
|
+
* const { visitorId, visitorIsNew, suspectLevel } = await fingerly.identify()
|
|
40
46
|
*
|
|
41
|
-
* // The server's answer, in the same round trip.
|
|
42
|
-
*
|
|
47
|
+
* // The server's answer, in the same round trip. Everything about the score
|
|
48
|
+
* // lives on the server, under the weights you set. `suspectLevel` is null
|
|
49
|
+
* // when absent, which is not a clean result. Signals are read on your backend.
|
|
50
|
+
* if (suspectLevel === 'high') {
|
|
43
51
|
* // step up to a challenge
|
|
44
52
|
* }
|
|
45
|
-
*
|
|
46
|
-
* // The local verdicts are still there, and are still advisory: they are
|
|
47
|
-
* // computed in the page, by code the visitor controls.
|
|
48
|
-
* if (verdicts.automation.value && verdicts.automation.confidence === 'high') {
|
|
49
|
-
* // ...
|
|
50
|
-
* }
|
|
51
53
|
* ```
|
|
54
|
+
*
|
|
55
|
+
* Nothing about that decision happens in the page. This package collects and
|
|
56
|
+
* submits; the server scores.
|
|
52
57
|
*/
|
|
53
58
|
|
|
54
59
|
interface FingerlyOptions extends Omit<FingerlyClientOptions, 'sources' | 'integrity' | 'platform'> {
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Source, SignalOutcome, IntegrityReport, FingerlyClientOptions, FingerlyClient } from '@fingerly/core';
|
|
2
|
-
export { Confidence, ConsentError, ConsentState, FingerlyClient, FingerlyEvent, FingerlyWebEvent, IdentifyOptions, IdentifyResult,
|
|
2
|
+
export { Confidence, ConsentError, ConsentState, FingerlyClient, FingerlyEvent, FingerlyWebEvent, IdentifyOptions, IdentifyResult, IntegrityReport, Lie, SOURCE, SignalOutcome, SignalReport, SignalStatus, TransportError, isSuspiciousLevel } from '@fingerly/core';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* The browser source set.
|
|
@@ -20,6 +20,12 @@ declare const browserSources: readonly Source[];
|
|
|
20
20
|
* for two reasons: it reads what the other sources produced, so it cannot run
|
|
21
21
|
* beside them; and a tamper check that competed for the budget could be starved
|
|
22
22
|
* by a slow source, which is precisely the outcome an attacker would arrange.
|
|
23
|
+
*
|
|
24
|
+
* What it reports is raw: which natives are patched, which properties were
|
|
25
|
+
* redefined. Whether the reported values contradict each other - a user agent
|
|
26
|
+
* claiming a phone that hovers, a language that is not the first of its own
|
|
27
|
+
* languages - is the server's reading of the same sources, not something the
|
|
28
|
+
* page decides.
|
|
23
29
|
*/
|
|
24
30
|
|
|
25
31
|
declare function inspectIntegrity(sources: Record<string, SignalOutcome>): IntegrityReport;
|
|
@@ -28,27 +34,26 @@ declare function inspectIntegrity(sources: Record<string, SignalOutcome>): Integ
|
|
|
28
34
|
* @fingerly/web-js - the browser SDK.
|
|
29
35
|
*
|
|
30
36
|
* Wires the browser source set and the tamper layer into `@fingerly/core`'s
|
|
31
|
-
* client. Everything platform-specific is in this package;
|
|
32
|
-
*
|
|
33
|
-
*
|
|
37
|
+
* client. Everything platform-specific is in this package; scheduling and
|
|
38
|
+
* transport are in the kernel, and scoring is on the server, where customers
|
|
39
|
+
* set the weights and a page cannot read or edit them.
|
|
34
40
|
*
|
|
35
41
|
* ```ts
|
|
36
42
|
* import { load } from '@fingerly/web-js'
|
|
37
43
|
*
|
|
38
44
|
* const fingerly = await load({ apiKey: 'fly_pk_production_…' })
|
|
39
|
-
* const { visitorId, visitorIsNew,
|
|
45
|
+
* const { visitorId, visitorIsNew, suspectLevel } = await fingerly.identify()
|
|
40
46
|
*
|
|
41
|
-
* // The server's answer, in the same round trip.
|
|
42
|
-
*
|
|
47
|
+
* // The server's answer, in the same round trip. Everything about the score
|
|
48
|
+
* // lives on the server, under the weights you set. `suspectLevel` is null
|
|
49
|
+
* // when absent, which is not a clean result. Signals are read on your backend.
|
|
50
|
+
* if (suspectLevel === 'high') {
|
|
43
51
|
* // step up to a challenge
|
|
44
52
|
* }
|
|
45
|
-
*
|
|
46
|
-
* // The local verdicts are still there, and are still advisory: they are
|
|
47
|
-
* // computed in the page, by code the visitor controls.
|
|
48
|
-
* if (verdicts.automation.value && verdicts.automation.confidence === 'high') {
|
|
49
|
-
* // ...
|
|
50
|
-
* }
|
|
51
53
|
* ```
|
|
54
|
+
*
|
|
55
|
+
* Nothing about that decision happens in the page. This package collects and
|
|
56
|
+
* submits; the server scores.
|
|
52
57
|
*/
|
|
53
58
|
|
|
54
59
|
interface FingerlyOptions extends Omit<FingerlyClientOptions, 'sources' | 'integrity' | 'platform'> {
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { SOURCE, valueOf, BlockedSignal, UnsupportedSignal, hash64, FingerlyClient } from '@fingerly/core';
|
|
2
|
-
export { ConsentError, FingerlyClient, SOURCE, TransportError } from '@fingerly/core';
|
|
2
|
+
export { ConsentError, FingerlyClient, SOURCE, TransportError, isSuspiciousLevel } from '@fingerly/core';
|
|
3
3
|
|
|
4
4
|
// src/index.ts
|
|
5
5
|
function compact(value) {
|
|
@@ -32,135 +32,6 @@ function asBlockedIfRefused(error) {
|
|
|
32
32
|
}
|
|
33
33
|
throw error;
|
|
34
34
|
}
|
|
35
|
-
function asReport(sources) {
|
|
36
|
-
return {
|
|
37
|
-
schema: 1,
|
|
38
|
-
budget_ms: 0,
|
|
39
|
-
elapsed_ms: 0,
|
|
40
|
-
tiers: [],
|
|
41
|
-
sources,
|
|
42
|
-
integrity: { patched_natives: [], lies: [], engine: {} }
|
|
43
|
-
};
|
|
44
|
-
}
|
|
45
|
-
function claimedOs(userAgent) {
|
|
46
|
-
if (!userAgent) return void 0;
|
|
47
|
-
if (/Windows NT/i.test(userAgent)) return "windows";
|
|
48
|
-
if (/Android/i.test(userAgent)) return "android";
|
|
49
|
-
if (/iPhone|iPad|iPod/i.test(userAgent)) return "ios";
|
|
50
|
-
if (/Mac OS X/i.test(userAgent)) return "macos";
|
|
51
|
-
if (/Linux/i.test(userAgent)) return "linux";
|
|
52
|
-
return void 0;
|
|
53
|
-
}
|
|
54
|
-
function impliedOs(renderer) {
|
|
55
|
-
if (!renderer) return void 0;
|
|
56
|
-
const r = renderer.toLowerCase();
|
|
57
|
-
if (r.includes("direct3d") || r.includes("d3d11") || r.includes("d3d9")) return "windows";
|
|
58
|
-
if (r.includes("metal") || r.includes("apple")) return "apple";
|
|
59
|
-
if (r.includes("adreno") || r.includes("mali") || r.includes("powervr")) return "mobile";
|
|
60
|
-
return void 0;
|
|
61
|
-
}
|
|
62
|
-
function findContradictions(sources) {
|
|
63
|
-
const report = asReport(sources);
|
|
64
|
-
const lies = [];
|
|
65
|
-
const nav = valueOf(report, SOURCE.navigator);
|
|
66
|
-
const engine = valueOf(report, SOURCE.engine);
|
|
67
|
-
const errors = valueOf(report, SOURCE.errors);
|
|
68
|
-
const maths = valueOf(report, SOURCE.math);
|
|
69
|
-
const webgl = valueOf(report, SOURCE.webgl);
|
|
70
|
-
const touch = valueOf(report, SOURCE.touch);
|
|
71
|
-
const screen = valueOf(report, SOURCE.screen);
|
|
72
|
-
if (engine?.agrees === false) {
|
|
73
|
-
lies.push({
|
|
74
|
-
id: "user-agent-vs-engine",
|
|
75
|
-
kind: "contradiction",
|
|
76
|
-
detail: `claimed-${engine.claimed}-observed-${engine.observed}`
|
|
77
|
-
});
|
|
78
|
-
}
|
|
79
|
-
if (errors?.observed && engine?.observed && errors.observed !== engine.observed) {
|
|
80
|
-
lies.push({
|
|
81
|
-
id: "engine-vs-error-shapes",
|
|
82
|
-
kind: "contradiction",
|
|
83
|
-
detail: `engine-${engine.observed}-errors-${errors.observed}`
|
|
84
|
-
});
|
|
85
|
-
}
|
|
86
|
-
const claimed = engine?.claimed;
|
|
87
|
-
if (errors?.observed && claimed && errors.observed !== claimed) {
|
|
88
|
-
lies.push({
|
|
89
|
-
id: "user-agent-vs-error-shapes",
|
|
90
|
-
kind: "contradiction",
|
|
91
|
-
detail: `claimed-${claimed}-errors-${errors.observed}`
|
|
92
|
-
});
|
|
93
|
-
}
|
|
94
|
-
if (maths?.identities_hold === false) {
|
|
95
|
-
lies.push({
|
|
96
|
-
id: "math-identities",
|
|
97
|
-
kind: "contradiction",
|
|
98
|
-
detail: "math-builtins-do-not-hold-exact-identities"
|
|
99
|
-
});
|
|
100
|
-
}
|
|
101
|
-
const os = claimedOs(nav?.user_agent);
|
|
102
|
-
const gpu = impliedOs(webgl?.unmasked_renderer ?? webgl?.renderer);
|
|
103
|
-
if (os && gpu) {
|
|
104
|
-
const consistent = gpu === "windows" && os === "windows" || gpu === "apple" && (os === "macos" || os === "ios") || gpu === "mobile" && (os === "android" || os === "ios");
|
|
105
|
-
if (!consistent) {
|
|
106
|
-
lies.push({
|
|
107
|
-
id: "user-agent-vs-gpu",
|
|
108
|
-
kind: "contradiction",
|
|
109
|
-
detail: `os-${os}-gpu-${gpu}`
|
|
110
|
-
});
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
if (nav?.platform && os) {
|
|
114
|
-
const platform = nav.platform.toLowerCase();
|
|
115
|
-
const consistent = os === "windows" && platform.startsWith("win") || os === "macos" && platform.startsWith("mac") || os === "ios" && (platform.startsWith("iphone") || platform.startsWith("ipad") || platform.startsWith("mac")) || os === "android" && (platform.startsWith("linux") || platform.startsWith("android")) || os === "linux" && platform.startsWith("linux");
|
|
116
|
-
if (!consistent) {
|
|
117
|
-
lies.push({
|
|
118
|
-
id: "user-agent-vs-platform",
|
|
119
|
-
kind: "contradiction",
|
|
120
|
-
detail: `os-${os}-platform-${nav.platform}`
|
|
121
|
-
});
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
if (touch) {
|
|
125
|
-
const points = touch.max_touch_points;
|
|
126
|
-
if (typeof points === "number" && points > 0 && touch.pointer_coarse === false && touch.any_hover === true) {
|
|
127
|
-
lies.push({
|
|
128
|
-
id: "touch-points-vs-pointer-media",
|
|
129
|
-
kind: "contradiction",
|
|
130
|
-
detail: "touch-claimed-with-fine-pointer-and-hover"
|
|
131
|
-
});
|
|
132
|
-
}
|
|
133
|
-
if (touch.touch_event === true && typeof points === "number" && points === 0) {
|
|
134
|
-
lies.push({
|
|
135
|
-
id: "touch-event-vs-touch-points",
|
|
136
|
-
kind: "contradiction",
|
|
137
|
-
detail: "ontouchstart-present-with-zero-points"
|
|
138
|
-
});
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
if (typeof screen?.inner_width === "number" && typeof screen.width === "number" && screen.width > 0 && screen.inner_width > screen.width) {
|
|
142
|
-
lies.push({
|
|
143
|
-
id: "viewport-larger-than-screen",
|
|
144
|
-
kind: "contradiction",
|
|
145
|
-
detail: `inner-${screen.inner_width}-screen-${screen.width}`
|
|
146
|
-
});
|
|
147
|
-
}
|
|
148
|
-
if (nav?.product_sub !== void 0 && (engine?.observed === "chromium" || engine?.observed === "webkit") && nav.product_sub !== "20030107") {
|
|
149
|
-
lies.push({
|
|
150
|
-
id: "product-sub",
|
|
151
|
-
kind: "contradiction",
|
|
152
|
-
detail: `expected-20030107-got-${nav.product_sub}`
|
|
153
|
-
});
|
|
154
|
-
}
|
|
155
|
-
if (nav?.language && nav.languages && nav.languages.length > 0 && nav.languages[0] !== nav.language) {
|
|
156
|
-
lies.push({
|
|
157
|
-
id: "language-vs-languages",
|
|
158
|
-
kind: "contradiction",
|
|
159
|
-
detail: `language-${nav.language}-languages-${nav.languages[0]}`
|
|
160
|
-
});
|
|
161
|
-
}
|
|
162
|
-
return lies;
|
|
163
|
-
}
|
|
164
35
|
|
|
165
36
|
// src/lies/descriptors.ts
|
|
166
37
|
var NATIVE_PATTERN = /\{\s*\[native code\]\s*\}\s*$/;
|
|
@@ -313,7 +184,6 @@ function findPatchedNatives(w) {
|
|
|
313
184
|
// src/lies/index.ts
|
|
314
185
|
function inspectIntegrity(sources) {
|
|
315
186
|
const w = windowOrNull();
|
|
316
|
-
const contradictions = findContradictions(sources);
|
|
317
187
|
const engine = valueOf(
|
|
318
188
|
{
|
|
319
189
|
schema: 1,
|
|
@@ -327,17 +197,16 @@ function inspectIntegrity(sources) {
|
|
|
327
197
|
);
|
|
328
198
|
const identity = {
|
|
329
199
|
...engine?.claimed === void 0 ? {} : { claimed: engine.claimed },
|
|
330
|
-
...engine?.observed === void 0 ? {} : { observed: engine.observed }
|
|
331
|
-
...engine?.agrees === void 0 ? {} : { agrees: engine.agrees }
|
|
200
|
+
...engine?.observed === void 0 ? {} : { observed: engine.observed }
|
|
332
201
|
};
|
|
333
202
|
if (!w) {
|
|
334
|
-
return { patched_natives: [], lies:
|
|
203
|
+
return { patched_natives: [], lies: [], engine: identity };
|
|
335
204
|
}
|
|
336
205
|
const natives = findPatchedNatives(w);
|
|
337
206
|
const descriptors = findRedefinedProperties(w);
|
|
338
207
|
return {
|
|
339
208
|
patched_natives: natives.patched,
|
|
340
|
-
lies: [...natives.lies, ...descriptors
|
|
209
|
+
lies: [...natives.lies, ...descriptors],
|
|
341
210
|
engine: identity
|
|
342
211
|
};
|
|
343
212
|
}
|
|
@@ -437,7 +306,12 @@ var touchSource = {
|
|
|
437
306
|
return true;
|
|
438
307
|
}),
|
|
439
308
|
pointer_coarse: attempt(() => w.matchMedia?.("(pointer: coarse)").matches),
|
|
440
|
-
any_hover: attempt(() => w.matchMedia?.("(any-hover: hover)").matches)
|
|
309
|
+
any_hover: attempt(() => w.matchMedia?.("(any-hover: hover)").matches),
|
|
310
|
+
// Presence only, and in the fast tier for that reason: the deferred
|
|
311
|
+
// `sensors` source is what waits to see whether an event fires. This is
|
|
312
|
+
// what the server's mobile-UA-with-no-motion-sensors rule reads.
|
|
313
|
+
device_motion: attempt(() => "DeviceMotionEvent" in w),
|
|
314
|
+
device_orientation: attempt(() => "DeviceOrientationEvent" in w)
|
|
441
315
|
});
|
|
442
316
|
}
|
|
443
317
|
};
|
|
@@ -484,8 +358,8 @@ var sensorsSource = {
|
|
|
484
358
|
};
|
|
485
359
|
var mediaDevicesSource = {
|
|
486
360
|
id: SOURCE.mediaDevices,
|
|
487
|
-
tier: "
|
|
488
|
-
timeoutMs:
|
|
361
|
+
tier: "fast",
|
|
362
|
+
timeoutMs: 120,
|
|
489
363
|
async run() {
|
|
490
364
|
if (typeof navigator === "undefined") throw new UnsupportedSignal("no-navigator");
|
|
491
365
|
if (typeof navigator.mediaDevices?.enumerateDevices !== "function") {
|
|
@@ -940,7 +814,7 @@ function observedEngine(toFixed, evalLen, stack) {
|
|
|
940
814
|
}
|
|
941
815
|
function claimedEngine(userAgent) {
|
|
942
816
|
if (!userAgent) return void 0;
|
|
943
|
-
if (/Firefox
|
|
817
|
+
if (/Firefox\//.test(userAgent)) return "gecko";
|
|
944
818
|
if (/Edg\/|OPR\/|Chrome\/|Chromium\//.test(userAgent)) return "chromium";
|
|
945
819
|
if (/Safari\//.test(userAgent)) return "webkit";
|
|
946
820
|
return void 0;
|
|
@@ -961,11 +835,9 @@ var engineSource = {
|
|
|
961
835
|
eval_length: evalLen,
|
|
962
836
|
stack_style: stack,
|
|
963
837
|
observed,
|
|
964
|
-
|
|
965
|
-
//
|
|
966
|
-
|
|
967
|
-
// detector weighs the second one heavily.
|
|
968
|
-
agrees: observed === void 0 || claimed === void 0 ? void 0 : observed === claimed
|
|
838
|
+
// Compared on the server, where "we could not tell" and "they disagree"
|
|
839
|
+
// are kept apart by which of the two is missing.
|
|
840
|
+
claimed
|
|
969
841
|
});
|
|
970
842
|
}
|
|
971
843
|
};
|
|
@@ -1398,6 +1270,20 @@ var timingSource = {
|
|
|
1398
1270
|
});
|
|
1399
1271
|
}
|
|
1400
1272
|
};
|
|
1273
|
+
var permissionStatuses = /* @__PURE__ */ new WeakMap();
|
|
1274
|
+
function permissionStatus(w, name) {
|
|
1275
|
+
let byName = permissionStatuses.get(w.navigator);
|
|
1276
|
+
if (!byName) {
|
|
1277
|
+
byName = /* @__PURE__ */ new Map();
|
|
1278
|
+
permissionStatuses.set(w.navigator, byName);
|
|
1279
|
+
}
|
|
1280
|
+
let status = byName.get(name);
|
|
1281
|
+
if (!status) {
|
|
1282
|
+
status = w.navigator.permissions.query({ name });
|
|
1283
|
+
byName.set(name, status);
|
|
1284
|
+
}
|
|
1285
|
+
return status;
|
|
1286
|
+
}
|
|
1401
1287
|
var permissionsSource = {
|
|
1402
1288
|
id: SOURCE.permissions,
|
|
1403
1289
|
tier: "fast",
|
|
@@ -1407,7 +1293,7 @@ var permissionsSource = {
|
|
|
1407
1293
|
if (!w.navigator.permissions?.query) throw new UnsupportedSignal("no-permissions-api");
|
|
1408
1294
|
const query = async (name) => {
|
|
1409
1295
|
try {
|
|
1410
|
-
return (await w
|
|
1296
|
+
return (await permissionStatus(w, name)).state;
|
|
1411
1297
|
} catch {
|
|
1412
1298
|
return void 0;
|
|
1413
1299
|
}
|
|
@@ -1417,12 +1303,7 @@ var permissionsSource = {
|
|
|
1417
1303
|
return compact({
|
|
1418
1304
|
notification,
|
|
1419
1305
|
notification_legacy: legacy,
|
|
1420
|
-
geolocation: await query("geolocation")
|
|
1421
|
-
inconsistent: notification !== void 0 && legacy !== void 0 ? (
|
|
1422
|
-
// `default` and `prompt` are the same state under two names, which
|
|
1423
|
-
// is why this is not a plain string comparison.
|
|
1424
|
-
(legacy === "default" ? "prompt" : legacy) !== notification
|
|
1425
|
-
) : void 0
|
|
1306
|
+
geolocation: await query("geolocation")
|
|
1426
1307
|
});
|
|
1427
1308
|
}
|
|
1428
1309
|
};
|
|
@@ -1871,6 +1752,7 @@ var browserSources = [
|
|
|
1871
1752
|
permissionsSource,
|
|
1872
1753
|
automationSource,
|
|
1873
1754
|
webglSource,
|
|
1755
|
+
mediaDevicesSource,
|
|
1874
1756
|
// deferred
|
|
1875
1757
|
canvasSource,
|
|
1876
1758
|
webglExtensionsSource,
|
|
@@ -1881,19 +1763,20 @@ var browserSources = [
|
|
|
1881
1763
|
batterySource,
|
|
1882
1764
|
speechSource,
|
|
1883
1765
|
sensorsSource,
|
|
1884
|
-
mediaDevicesSource,
|
|
1885
1766
|
userAgentDataSource,
|
|
1886
1767
|
domBlockersSource,
|
|
1887
1768
|
storageDurabilitySource
|
|
1888
1769
|
];
|
|
1889
1770
|
function load(options) {
|
|
1890
|
-
return Promise
|
|
1891
|
-
|
|
1892
|
-
|
|
1893
|
-
|
|
1894
|
-
|
|
1895
|
-
|
|
1896
|
-
|
|
1771
|
+
return new Promise(
|
|
1772
|
+
(resolve) => resolve(
|
|
1773
|
+
new FingerlyClient({
|
|
1774
|
+
...options,
|
|
1775
|
+
platform: "web",
|
|
1776
|
+
sources: options.sources ?? browserSources,
|
|
1777
|
+
integrity: (report) => inspectIntegrity(report.sources)
|
|
1778
|
+
})
|
|
1779
|
+
)
|
|
1897
1780
|
);
|
|
1898
1781
|
}
|
|
1899
1782
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fingerly/web-js",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
],
|
|
29
29
|
"sideEffects": false,
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@fingerly/core": "0.1.
|
|
31
|
+
"@fingerly/core": "0.1.2"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
34
|
"happy-dom": "^15.11.7",
|