@buoy-gg/shared-ui 7.0.45 → 7.0.46
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/lib/commonjs/index.js +1 -1
- package/lib/commonjs/license/licenseModule.js +1 -1
- package/lib/commonjs/stores/ignoredPatternsStore.shared.js +1 -1
- package/lib/commonjs/sync/settingsSync.js +1 -0
- package/lib/commonjs/utils/persistentStorage.js +1 -1
- package/lib/commonjs/utils/persistentStorage.web.js +1 -1
- package/lib/commonjs/utils/storageWrites.js +1 -0
- package/lib/module/index.js +1 -1
- package/lib/module/license/licenseModule.js +1 -1
- package/lib/module/stores/ignoredPatternsStore.shared.js +1 -1
- package/lib/module/sync/settingsSync.js +1 -0
- package/lib/module/utils/persistentStorage.js +1 -1
- package/lib/module/utils/persistentStorage.web.js +1 -1
- package/lib/module/utils/storageWrites.js +1 -0
- package/lib/typescript/commonjs/hooks/safe-area-impl.d.ts +1 -1
- package/lib/typescript/commonjs/index.d.ts +2 -0
- package/lib/typescript/commonjs/license/licenseModule.d.ts +5 -0
- package/lib/typescript/commonjs/stores/ignoredPatternsStore.shared.d.ts +16 -1
- package/lib/typescript/commonjs/sync/settingsSync.d.ts +78 -0
- package/lib/typescript/commonjs/utils/storageWrites.d.ts +10 -0
- package/lib/typescript/module/hooks/safe-area-impl.d.ts +1 -1
- package/lib/typescript/module/index.d.ts +2 -0
- package/lib/typescript/module/license/licenseModule.d.ts +5 -0
- package/lib/typescript/module/stores/ignoredPatternsStore.shared.d.ts +16 -1
- package/lib/typescript/module/sync/settingsSync.d.ts +78 -0
- package/lib/typescript/module/utils/storageWrites.d.ts +10 -0
- package/lib/web/chunks/chunk-5NOIO6ZM.mjs +1 -1
- package/lib/web/chunks/chunk-ASEPWYDC.mjs +5 -5
- package/lib/web/chunks/chunk-DEEKIG2L.mjs +1 -0
- package/lib/web/chunks/chunk-MKJKS3IG.mjs +1 -1
- package/lib/web/chunks/chunk-T7RZZG4A.mjs +15 -0
- package/lib/web/chunks/chunk-U2BTZZID.mjs +14 -0
- package/lib/web/chunks/chunk-XD2BEYMM.mjs +2 -2
- package/lib/web/chunks/persistentStorage.web-56ENKXFJ.mjs +1 -0
- package/lib/web/dataViewer.mjs +1 -1
- package/lib/web/hooks.mjs +1 -1
- package/lib/web/index.mjs +3 -3
- package/lib/web/ui.mjs +1 -1
- package/lib/web/utils.mjs +1 -1
- package/package.json +5 -5
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";var e={base:"@react_buoy",bubble:{root:()=>`${e.base}_bubble`,settings:()=>`${e.bubble.root()}_settings`,userPreferences:()=>`${e.bubble.root()}_user_preferences`,position:()=>`${e.bubble.root()}_position`},modal:{root:()=>`${e.base}_modal`,state:()=>`${e.modal.root()}_state`,position:()=>`${e.modal.root()}_position`,dimensions:()=>`${e.modal.root()}_dimensions`,hintAcknowledged:()=>`${e.modal.root()}_hint_acknowledged`},custom:t=>{let o=`${e.base}_custom_${t}`;return{root:()=>o,modal:()=>`${o}_modal`,settings:()=>`${o}_settings`,key:r=>`${o}_${r}`}},settings:{root:()=>`${e.base}_settings`,theme:()=>`${e.settings.root()}_theme`,preferences:()=>`${e.settings.root()}_preferences`,wifiEnabled:()=>`${e.settings.root()}_wifi_enabled`,global:()=>`${e.settings.root()}_global`,activeTab:()=>`${e.settings.root()}_active_tab`,modalOpen:()=>`${e.settings.root()}_modal_open`},dial:{root:()=>`${e.base}_dial`,isOpen:()=>`${e.dial.root()}_is_open`,usage:()=>`${e.dial.root()}_usage`},clipboard:{root:()=>`${e.base}_clipboard`,hintAcknowledged:()=>`${e.clipboard.root()}_hint_acknowledged`},env:{root:()=>`${e.base}_env`,modal:()=>`${e.env.root()}_modal`,currentEnv:()=>`${e.env.root()}_current`,overrides:()=>`${e.env.root()}_overrides`},sentry:{root:()=>`${e.base}_sentry`,modal:()=>`${e.sentry.root()}_modal`,filters:()=>`${e.sentry.root()}_filters`,preferences:()=>`${e.sentry.root()}_preferences`},storage:{root:()=>`${e.base}_storage`,modal:()=>`${e.storage.root()}_modal`,eventsModal:()=>`${e.storage.root()}_events_modal`,filters:()=>`${e.storage.root()}_filters`,eventFilters:()=>`${e.storage.root()}_event_filters`,keyFilters:()=>`${e.storage.root()}_key_filters`,pinnedKeys:()=>`${e.storage.root()}_pinned_keys`,preferences:()=>`${e.storage.root()}_preferences`,activeTab:()=>`${e.storage.root()}_active_tab`,isMonitoring:()=>`${e.storage.root()}_is_monitoring`,diffViewerMode:()=>`${e.storage.root()}_diff_viewer_mode`},clock:{root:()=>`${e.base}_clock`,state:()=>`${e.clock.root()}_state`},permissions:{root:()=>`${e.base}_permissions`,state:()=>`${e.permissions.root()}_state`},lifecycle:{root:()=>`${e.base}_lifecycle`,state:()=>`${e.lifecycle.root()}_state`},location:{root:()=>`${e.base}_location`,state:()=>`${e.location.root()}_state`},timeMachine:{root:()=>`${e.base}_time_machine`,diffViewerMode:()=>`${e.timeMachine.root()}_diff_viewer_mode`,armedPoint:()=>`${e.timeMachine.root()}_armed_point`,barReloadMode:()=>`${e.timeMachine.root()}_bar_reload_mode`,disabledSources:()=>`${e.timeMachine.root()}_disabled_sources`},scenarios:{root:()=>`${e.base}_scenarios`,modal:()=>`${e.scenarios.root()}_modal`,library:()=>`${e.scenarios.root()}_library`,active:()=>`${e.scenarios.root()}_active`},reactQuery:{root:()=>`${e.base}_rq`,modal:()=>`${e.reactQuery.root()}_modal`,browserModal:()=>`${e.reactQuery.root()}_browser_modal`,mutationModal:()=>`${e.reactQuery.root()}_mutation_modal`,filters:()=>`${e.reactQuery.root()}_filters`,ignoredPatterns:()=>`${e.reactQuery.root()}_ignored_patterns`,includedPatterns:()=>`${e.reactQuery.root()}_included_patterns`,preferences:()=>`${e.reactQuery.root()}_preferences`},network:{root:()=>`${e.base}_network`,modal:()=>`${e.network.root()}_modal`,copyModal:()=>`${e.network.root()}_copy_modal`,filters:()=>`${e.network.root()}_filters`,ignoredDomains:()=>`${e.network.root()}_ignored_domains`,ignoredUrls:()=>`${e.network.root()}_ignored_urls`,preferences:()=>`${e.network.root()}_preferences`,copyOptions:()=>`${e.network.root()}_copy_options`,saved:()=>`${e.network.root()}_saved`,overrides:()=>`${e.network.root()}_overrides`},routeEvents:{root:()=>`${e.base}_route_events`,modal:()=>`${e.routeEvents.root()}_modal`,eventFilters:()=>`${e.routeEvents.root()}_event_filters`,activeTab:()=>`${e.routeEvents.root()}_active_tab`,isMonitoring:()=>`${e.routeEvents.root()}_is_monitoring`,detailView:()=>`${e.routeEvents.root()}_detail_view`,diffViewerMode:()=>`${e.routeEvents.root()}_diff_viewer_mode`},highlightUpdates:{root:()=>`${e.base}_highlight_updates`,modal:()=>`${e.highlightUpdates.root()}_modal`,isTracking:()=>`${e.highlightUpdates.root()}_is_tracking`,filters:()=>`${e.highlightUpdates.root()}_filters`,settings:()=>`${e.highlightUpdates.root()}_settings`,copySettings:()=>`${e.highlightUpdates.root()}_copy_settings`},benchmark:{root:()=>`${e.base}_benchmark`,modal:()=>`${e.benchmark.root()}_modal`,isRecording:()=>`${e.benchmark.root()}_is_recording`,activeTab:()=>`${e.benchmark.root()}_active_tab`,settings:()=>`${e.benchmark.root()}_settings`,selectedReports:()=>`${e.benchmark.root()}_selected_reports`},debugBorders:{root:()=>`${e.base}_debug_borders`,infoModal:()=>`${e.debugBorders.root()}_info_modal`},events:{root:()=>`${e.base}_events`,modal:()=>`${e.events.root()}_modal`,enabledSources:()=>`${e.events.root()}_enabled_sources`,isCapturing:()=>`${e.events.root()}_is_capturing`,pausedAt:()=>`${e.events.root()}_paused_at`,copySettings:()=>`${e.events.root()}_copy_settings`},sync:{root:()=>`${e.base}_sync`,deviceId:()=>`${e.sync.root()}_device_id`}},d=["@devtools","@dev_tools_","@modal_state_","@react_query_browser_modal","@react_query_modal","@react_query_mutation_modal","@sentry_logs_modal","@floating_rn_better_dev_tools_","@floating_tools_","@apphost_","@bubble_settings_","@env_vars_modal","@storage_modal","@floating_@devtools_","dev_last_route"];function c(t){if(!t)return false;if(t.startsWith(e.base)||t.startsWith("buoy-")||t.startsWith("@buoy"))return true;for(let o of d)if(t.startsWith(o))return true;return false}var i=new Set;function $(t){return i.add(t),()=>i.delete(t)}function l(t,o){for(let r of[...i])try{r(t,o)}catch{}}var s=new Map;function a(){try{return typeof window>"u"?null:window.localStorage}catch{return null}}var n={async getItem(t){if(s.has(t))return s.get(t)??null;try{return a()?.getItem(t)??null}catch{return null}},async setItem(t,o){s.set(t,o);try{let r=a();r&&(r.setItem(t,o),s.delete(t))}catch{}l(t,o)},async removeItem(t){s.set(t,null);try{let o=a();o&&(o.removeItem(t),s.delete(t))}catch{}l(t,null)},async getAllKeys(){let t=new Set;try{let o=a();if(o)for(let r=0;r<o.length;r++){let _=o.key(r);_?.startsWith(e.base)&&t.add(_)}}catch{}for(let[o,r]of s)o.startsWith(e.base)&&(r===null?t.delete(o):t.add(o));return[...t]},async multiGet(t){return Promise.all(t.map(async o=>[o,await n.getItem(o)]))},async multiRemove(t){await Promise.all(t.map(o=>n.removeItem(o)))},async clear(){await n.multiRemove(await n.getAllKeys())}};async function m(){return a()!==null}async function u(){return a()?"localstorage":"memory"}export{e as a,c as b,$ as c,n as d,m as e,u as f};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";function h(e){if(typeof e!=="object"||e===null)return false;const n=Object.getPrototypeOf(e);return n===Object.prototype||n===null}function y(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function m(e,n,
|
|
1
|
+
"use client";function h(e){if(typeof e!=="object"||e===null)return false;const n=Object.getPrototypeOf(e);return n===Object.prototype||n===null}function y(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function m(e,n,t){const s={nodes:t?.maxNodes??2e3,truncated:false};return l(e,n,t?.maxDepth??8,s,new WeakSet)}function l(e,n,t,s,a){if(s.nodes--<=0){s.truncated=true;return false}if(Object.is(e,n))return true;if(typeof e!==typeof n)return false;if(typeof e!=="object"||e===null||n===null){return typeof e==="function"&&typeof n==="function"}if(e instanceof Date||n instanceof Date){return e instanceof Date&&n instanceof Date&&e.getTime()===n.getTime()}if(e instanceof RegExp||n instanceof RegExp){return e instanceof RegExp&&n instanceof RegExp&&e.source===n.source&&e.flags===n.flags}if(e instanceof Error||n instanceof Error){return e instanceof Error&&n instanceof Error&&e.name===n.name&&e.message===n.message}if(typeof URL!=="undefined"&&(e instanceof URL||n instanceof URL)){return e instanceof URL&&n instanceof URL&&e.href===n.href}if(y(e)||y(n)){if(!y(e)||!y(n))return false;if(e.constructor!==n.constructor||e.byteLength!==n.byteLength){return false}const f=new Uint8Array(e.buffer,e.byteOffset,e.byteLength);const c=new Uint8Array(n.buffer,n.byteOffset,n.byteLength);for(let o=0;o<f.length;o++)if(f[o]!==c[o])return false;return true}if(t<=0){s.truncated=true;return false}if(a.has(e)){s.truncated=true;return false}a.add(e);if(e instanceof Map||n instanceof Map){if(!(e instanceof Map)||!(n instanceof Map)||e.size!==n.size){return false}const f=Array.from(e.entries());const c=Array.from(n.entries());for(let o=0;o<f.length;o++){if(!l(f[o][0],c[o][0],t-1,s,a))return false;if(!l(f[o][1],c[o][1],t-1,s,a))return false}return true}if(e instanceof Set||n instanceof Set){if(!(e instanceof Set)||!(n instanceof Set)||e.size!==n.size){return false}const f=Array.from(e.values());const c=Array.from(n.values());for(let o=0;o<f.length;o++){if(!l(f[o],c[o],t-1,s,a))return false}return true}if(Array.isArray(e)||Array.isArray(n)){if(!Array.isArray(e)||!Array.isArray(n)||e.length!==n.length){return false}for(let f=0;f<e.length;f++){if(!l(e[f],n[f],t-1,s,a))return false}return true}const r=Object.keys(e);const i=Object.keys(n);if(r.length!==i.length)return false;for(const f of r){if(!Object.prototype.hasOwnProperty.call(n,f))return false;if(!l(e[f],n[f],t-1,s,a)){return false}}return true}function A(e,n,t){const s=t?.maxDepth??8;const a={nodes:t?.maxNodes??2e3,truncated:false};const r=h(e);const i=h(n);if(!r||!i){const u=l(e,n,s,a,new WeakSet);return{equal:u,addedKeys:[],removedKeys:[],changedKeys:u?[]:["value"],truncated:a.truncated}}const f=[];const c=[];const o=[];const g=e;const d=n;for(const u of Object.keys(g)){if(!Object.prototype.hasOwnProperty.call(d,u)){c.push(u)}else if(!l(g[u],d[u],s-1,a,new WeakSet)){o.push(u)}}for(const u of Object.keys(d)){if(!Object.prototype.hasOwnProperty.call(g,u))f.push(u)}return{equal:f.length===0&&c.length===0&&o.length===0,addedKeys:f,removedKeys:c,changedKeys:o,truncated:a.truncated}}var O=12;function b(e){return p(e,O,new WeakSet)}function p(e,n,t){if(e===null||e===void 0)return e;const s=typeof e;if(s==="string"||s==="boolean")return e;if(s==="number"){return Number.isFinite(e)?e:String(e)}if(s==="bigint")return`${String(e)}n`;if(s==="function")return"[Function]";if(s==="symbol")return String(e);if(s!=="object")return String(e);if(e instanceof Date)return e.toISOString();if(e instanceof RegExp)return String(e);if(e instanceof Error)return`[${e.name}: ${e.message}]`;if(typeof URL!=="undefined"&&e instanceof URL)return e.href;if(y(e)){return`<${e.constructor.name} ${e.byteLength} bytes>`}if(n<=0)return"[Max depth]";if(t.has(e))return"[Circular]";t.add(e);if(e instanceof Map){const r={};for(const[i,f]of e.entries()){const c=typeof i==="string"?i:JSON.stringify(b(i));r[c]=p(f,n-1,t)}return r}if(e instanceof Set){return Array.from(e.values()).map(r=>p(r,n-1,t))}if(Array.isArray(e)){return e.map(r=>p(r,n-1,t))}const a={};for(const[r,i]of Object.entries(e)){a[r]=p(i,n-1,t)}return a}function S(e,n){let t=0;const s=[e];const a=new Set;while(s.length>0){const r=s.pop();if(r===null||r===void 0){t+=4}else if(typeof r==="string"){t+=r.length+2}else if(typeof r==="number"||typeof r==="boolean"){t+=8}else if(typeof r==="bigint"){t+=String(r).length+1}else if(typeof r==="object"){if(a.has(r))continue;a.add(r);if(r instanceof Date||r instanceof RegExp){t+=32}else if(y(r)){t+=r.byteLength}else if(r instanceof Map){for(const[i,f]of r.entries()){s.push(i,f);t+=4}}else if(r instanceof Set){for(const i of r.values()){s.push(i);t+=2}}else if(Array.isArray(r)){for(const i of r)s.push(i);t+=2*r.length+2}else{for(const[i,f]of Object.entries(r)){t+=i.length+4;s.push(f)}}}if(t>n)return true}return false}function j(e){return e!==null&&e!==void 0&&typeof e==="object"&&!Array.isArray(e)&&!(e instanceof Date)&&!(e instanceof Error)&&!(e instanceof Map)&&!(e instanceof Set)&&!(e instanceof RegExp)&&typeof e!=="function"}function E(e){switch(e.toLowerCase().trim()){case"local":return"local";case"dev":case"development":return"dev";case"qa":case"test":return"qa";case"staging":case"stage":return"staging";case"prod":case"production":return"prod";default:return"local"}}export{m as boundedDeepEqual,A as objectDiff,b as toDiffable,S as jsonLikelyLargerThan,j as isPlainObject,E as normalizeEnvironment};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use client";import{e as te}from"./chunk-46TKOKMV.mjs";import{d as W}from"./chunk-DEEKIG2L.mjs";import{A as Y,G as $,H as r,W as ae,p as C,q as m,s as I,u as A,x as R,z as L}from"./chunk-3UTMGIUG.mjs";import{useCallback as ne,useEffect as ie,useRef as j,useState as q}from"react";var T=new Map;function se(e){try{return JSON.parse(e)}catch{return}}function re(e,t,a={}){let[s,o]=q(()=>T.has(e)?T.get(e):t),[E,f]=q(()=>T.has(e)),c=j(e);c.current=e;let d=j(a);d.current=a,ie(()=>{if(T.has(e)){o(T.get(e)),f(true);return}let l=false,S=d.current.storage??W,p=d.current.parse??se;return S.getItem(e).then(h=>{if(!l){if(h!=null){let u;try{u=p(h)}catch{}u!==void 0&&(T.set(e,u),o(u))}f(true)}}).catch(()=>{l||f(true)}),()=>{l=true}},[e]);let v=ne(l=>{o(S=>{let p=typeof l=="function"?l(S):l;T.set(c.current,p);let h=d.current.storage??W,u=d.current.serialize??JSON.stringify;try{h.setItem(c.current,u(p)).catch(()=>{})}catch{}return p})},[]);return[s,v,E]}function oe(){T.clear()}import{useCallback as P,useEffect as z,useMemo as le,useState as O}from"react";function ce(e,t={}){let[a,s]=O(()=>e.getAll()),[o,E]=O(()=>t.initialFilter??{}),[f,c]=O(()=>e.getEnabled());z(()=>e.subscribe(s),[e]);let d=t.filterItems,v=le(()=>d?d(a,o):a,[a,o,d]),l=P(()=>{e.clear()},[e]),S=P(()=>{let h=!f;e.setEnabled(h),c(h)},[e,f]),p=P(h=>e.getById(h),[e]);return{items:a,filteredItems:v,filter:o,setFilter:E,isEnabled:f,toggleCapture:S,clear:l,getById:p}}function de(e,t){let[a,s]=O(e);return z(()=>t(s),[t]),a}import{useCallback as ue,useEffect as ge,useState as K}from"react";function fe(e,t={}){let{enabled:a=true,maxEvents:s=500,select:o}=t,[E,f]=K([]),[c,d]=K(a);ge(()=>{if(!a){d(false);return}let l=null,S=null,p=e.subscribeToEvents(h=>{S=h,l==null&&(l=requestAnimationFrame(()=>{if(l=null,!S)return;let u=S;S=null,o&&(u=o(u)),u.length>s&&(u=u.slice(0,s)),f(u)}))});return d(true),()=>{p(),l!=null&&cancelAnimationFrame(l)}},[e,a,s,o]);let v=ue(()=>{e.clearEvents()},[e]);return{events:E,clearEvents:v,isActive:c}}import{useState as b,useEffect as w,useCallback as he}from"react";async function U(){let[e,t,a]=await Promise.all([m.isScreenReaderEnabled(),m.isReduceMotionEnabled(),m.isReduceTransparencyEnabled()]),s={isScreenReaderEnabled:e,isReduceMotionEnabled:t,isReduceTransparencyEnabled:a};if(r.OS==="ios"){let[o,E,f,c,d]=await Promise.all([m.isBoldTextEnabled?.()??Promise.resolve(false),m.isGrayscaleEnabled?.()??Promise.resolve(false),m.isInvertColorsEnabled?.()??Promise.resolve(false),m.isDarkerSystemColorsEnabled?.()??Promise.resolve(false),m.prefersCrossFadeTransitions?.()??Promise.resolve(false)]);s.isBoldTextEnabled=o,s.isGrayscaleEnabled=E,s.isInvertColorsEnabled=f,s.isDarkerSystemColorsEnabled=c,s.prefersCrossFadeTransitions=d}if(r.OS==="android"){let o=await m.isHighTextContrastEnabled?.()??false;s.isHighTextContrastEnabled=o}return s}function k(){let e=r.constants,t={os:r.OS,version:r.Version,reactNativeVersion:e.reactNativeVersion,isTesting:r.isTesting??false,isDisableAnimations:e.isDisableAnimations??false};return r.OS==="ios"?{...t,osVersion:e.osVersion,systemName:e.systemName,interfaceIdiom:e.interfaceIdiom,isPad:r.isPad,isTV:r.isTV,isVision:r.isVision??false,isMacCatalyst:r.isMacCatalyst??false,forceTouchAvailable:e.forceTouchAvailable}:r.OS==="android"?{...t,apiLevel:e.Version,release:e.Release,brand:e.Brand,manufacturer:e.Manufacturer,model:e.Model,fingerprint:e.Fingerprint,serial:e.Serial,uiMode:e.uiMode}:t}function M(){let e=R.get("window"),t=R.get("screen"),a={window:{width:e.width,height:e.height,scale:e.scale,fontScale:e.fontScale},screen:{width:t.width,height:t.height,scale:t.scale,fontScale:t.fontScale},pixelRatio:$.get(),fontScale:$.getFontScale(),isLandscape:e.width>e.height,isPortrait:e.height>e.width};if(r.OS==="ios")try{let s=C.DeviceInfo?.getConstants?.();a.isIPhoneNotched=s?.isIPhoneX_deprecated??false}catch{a.isIPhoneNotched=false}if(r.OS==="android")try{let s=C.DeviceInfo?.getConstants?.();a.isEdgeToEdge=s?.isEdgeToEdge??false,a.densityDpi=Math.round(e.scale*160)}catch{}return a}async function X(){return new Promise(e=>{let t=false;r.OS==="ios"?C.StatusBarManager?.getHeight?.(a=>{t||(t=true,e(a?.height??null))})??e(null):r.OS==="android"?(t=true,e(ae.currentHeight??null)):(t=true,e(null)),setTimeout(()=>{t||(t=true,e(null))},100)})}function N(){let e={isRTL:L.isRTL,doLeftAndRightSwapInRTL:L.doLeftAndRightSwapInRTL};return r.OS==="android"&&(e.localeIdentifier=L.localeIdentifier),e}function V(){if(r.OS==="ios")try{return{userDefaults:C.SettingsManager?.getConstants?.()?.settings??{}}}catch{return{}}return{}}function B(){let e={};if(r.OS==="android"){let t=r.constants;e.serial=t.Serial,e.fingerprint=t.Fingerprint;try{let a=C.PlatformConstants;a?.getAndroidID&&(e.androidId=a.getAndroidID())}catch{}}return e}function me(e){let t=[e.platform.os,e.platform.version,e.display.window.width,e.display.window.height,e.display.pixelRatio,e.platform.interfaceIdiom??"",e.platform.forceTouchAvailable??false,e.display.isIPhoneNotched??false,e.platform.model??"",e.platform.brand??"",e.platform.manufacturer??"",e.platform.uiMode??""].join("|"),a=0;for(let s=0;s<t.length;s++){let o=t.charCodeAt(s);a=(a<<5)-a+o,a=a&a}return Math.abs(a).toString(16).padStart(8,"0")}function Se(){let[e,t]=b(true),[a,s]=b(k()),[o,E]=b(M()),[f,c]=b({isScreenReaderEnabled:false,isReduceMotionEnabled:false,isReduceTransparencyEnabled:false}),[d,v]=b(()=>{let g=I.getColorScheme()??null;return{colorScheme:g,prefersDarkMode:g==="dark"}}),[l,S]=b(N()),[p,h]=b({height:null,isVisible:true}),[u,F]=b({isVisible:false,height:0,animationDuration:0}),[J,_]=b({currentState:A.currentState,isActive:A.currentState==="active"}),[x,Q]=b(B()),[H,Z]=b(V()),[G,ee]=b(Date.now()),D=he(async()=>{t(true);let[g,n]=await Promise.all([U(),X()]);s(k()),E(M()),c(g);let i=I.getColorScheme()??null;v({colorScheme:i,prefersDarkMode:i==="dark"}),S(N()),h(y=>({...y,height:n})),Q(B()),Z(V()),ee(Date.now()),t(false)},[]);return w(()=>{D()},[D]),w(()=>{let g=R.addEventListener("change",({window:n,screen:i})=>{E(y=>({...y,window:{width:n.width,height:n.height,scale:n.scale,fontScale:n.fontScale},screen:{width:i.width,height:i.height,scale:i.scale,fontScale:i.fontScale},isLandscape:n.width>n.height,isPortrait:n.height>n.width}))});return()=>g.remove()},[]),w(()=>{let g=I.addChangeListener(({colorScheme:n})=>{let i=n??null;v({colorScheme:i,prefersDarkMode:i==="dark"})});return()=>g.remove()},[]),w(()=>{let g=Y.addListener(r.OS==="ios"?"keyboardWillShow":"keyboardDidShow",i=>{F({isVisible:true,height:i.endCoordinates.height,animationDuration:i.duration??0})}),n=Y.addListener(r.OS==="ios"?"keyboardWillHide":"keyboardDidHide",i=>{F({isVisible:false,height:0,animationDuration:i.duration??0})});return()=>{g.remove(),n.remove()}},[]),w(()=>{let g=te(n=>{_({currentState:n,isActive:n==="active"})});return()=>g.remove()},[]),w(()=>{let g=[m.addEventListener("screenReaderChanged",n=>{c(i=>({...i,isScreenReaderEnabled:n}))}),m.addEventListener("reduceMotionChanged",n=>{c(i=>({...i,isReduceMotionEnabled:n}))}),m.addEventListener("reduceTransparencyChanged",n=>{c(i=>({...i,isReduceTransparencyEnabled:n}))})];if(r.OS==="ios"){let n=(i,y)=>m.addEventListener(i,y);g.push(n("boldTextChanged",i=>{c(y=>({...y,isBoldTextEnabled:i}))}),n("grayscaleChanged",i=>{c(y=>({...y,isGrayscaleEnabled:i}))}),n("invertColorsChanged",i=>{c(y=>({...y,isInvertColorsEnabled:i}))}))}return()=>{g.forEach(n=>n.remove())}},[]),{platform:a,display:o,accessibility:f,appearance:d,locale:l,statusBar:p,keyboard:u,appState:J,identifiers:x,settings:H,timestamp:G,isLoading:e,refresh:D,generateFingerprint:()=>me({platform:a,display:o,accessibility:f,appearance:d,locale:l,statusBar:p,keyboard:u,appState:J,identifiers:x,settings:H,timestamp:G,isLoading:e})}}async function pe(){let[e,t]=await Promise.all([U(),X()]),a=I.getColorScheme()??null;return{platform:k(),display:M(),accessibility:e,appearance:{colorScheme:a,prefersDarkMode:a==="dark"},locale:N(),statusBar:{height:t,isVisible:true},keyboard:{isVisible:false,height:0,animationDuration:0},appState:{currentState:A.currentState,isActive:A.currentState==="active"},identifiers:B(),settings:V(),timestamp:Date.now(),isLoading:false}}function be(e){console.log(`
|
|
2
|
+
========================================`),console.log(" DEVICE INFO REPORT"),console.log(`========================================
|
|
3
|
+
`),console.log("--- PLATFORM ---"),console.log(JSON.stringify(e.platform,null,2)),console.log(`
|
|
4
|
+
--- DISPLAY ---`),console.log(JSON.stringify(e.display,null,2)),console.log(`
|
|
5
|
+
--- ACCESSIBILITY ---`),console.log(JSON.stringify(e.accessibility,null,2)),console.log(`
|
|
6
|
+
--- APPEARANCE ---`),console.log(JSON.stringify(e.appearance,null,2)),console.log(`
|
|
7
|
+
--- LOCALE ---`),console.log(JSON.stringify(e.locale,null,2)),console.log(`
|
|
8
|
+
--- STATUS BAR ---`),console.log(JSON.stringify(e.statusBar,null,2)),console.log(`
|
|
9
|
+
--- KEYBOARD ---`),console.log(JSON.stringify(e.keyboard,null,2)),console.log(`
|
|
10
|
+
--- APP STATE ---`),console.log(JSON.stringify(e.appState,null,2)),console.log(`
|
|
11
|
+
--- IDENTIFIERS ---`),console.log(JSON.stringify(e.identifiers,null,2)),console.log(`
|
|
12
|
+
--- SETTINGS ---`);let t=Object.keys(e.settings.userDefaults??{});console.log(`userDefaults: ${t.length} keys`),t.length>0&&t.length<=20&&console.log(JSON.stringify(e.settings,null,2)),console.log(`
|
|
13
|
+
--- METADATA ---`),console.log(`timestamp: ${e.timestamp}`),console.log(`isLoading: ${e.isLoading}`),console.log(`
|
|
14
|
+
========================================
|
|
15
|
+
`)}export{re as a,oe as b,ce as c,de as d,fe as e,Se as f,pe as g,be as h};
|